aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/formattedText/DashFieldView.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/formattedText/DashFieldView.tsx')
-rw-r--r--src/client/views/nodes/formattedText/DashFieldView.tsx11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/client/views/nodes/formattedText/DashFieldView.tsx b/src/client/views/nodes/formattedText/DashFieldView.tsx
index 18cf36603..e899b49bc 100644
--- a/src/client/views/nodes/formattedText/DashFieldView.tsx
+++ b/src/client/views/nodes/formattedText/DashFieldView.tsx
@@ -25,6 +25,7 @@ import './DashFieldView.scss';
import { FormattedTextBox } from './FormattedTextBox';
import { Node } from 'prosemirror-model';
import { EditorView } from 'prosemirror-view';
+import { DocumentOptions, FInfo } from '../../../documents/Documents';
@observer
export class DashFieldViewMenu extends AntimodeMenu<AntimodeMenuProps> {
@@ -151,6 +152,8 @@ export class DashFieldViewInternal extends ObservableReactComponent<IDashFieldVi
selectedCells = () => (this._dashDoc ? [this._dashDoc] : undefined);
columnWidth = () => Math.min(this._props.tbox._props.PanelWidth(), Math.max(50, this._props.tbox._props.PanelWidth() - 100)); // try to leave room for the fieldKey
+ finfo = (fieldKey: string) => (new DocumentOptions() as Record<string, FInfo>)[fieldKey];
+
// set the display of the field's value (checkbox for booleans, span of text for strings)
@computed get fieldValueContent() {
return !this._dashDoc ? null : (
@@ -165,7 +168,7 @@ export class DashFieldViewInternal extends ObservableReactComponent<IDashFieldVi
deselectCell={emptyFunction}
selectCell={emptyFunction}
maxWidth={this._props.hideKey || this._hideKey ? undefined : this._props.tbox._props.PanelWidth}
- columnWidth={this._expanded || this._props.nodeSelected() ? this.columnWidth : returnZero}
+ columnWidth={this._expanded || this._props.nodeSelected() ? () => undefined : returnZero}
selectedCells={this.selectedCells}
selectedCol={returnZero}
fieldKey={this._fieldKey}
@@ -178,7 +181,7 @@ export class DashFieldViewInternal extends ObservableReactComponent<IDashFieldVi
rowHeight={returnZero}
isRowActive={this.isRowActive}
padding={0}
- getFinfo={emptyFunction}
+ getFinfo={this.finfo}
setColumnValues={returnFalse}
allowCRs
oneLine={!this._expanded && !this._props.nodeSelected()}
@@ -196,7 +199,7 @@ export class DashFieldViewInternal extends ObservableReactComponent<IDashFieldVi
const container = this._props.tbox.DocumentView?.().containerViewPath?.().lastElement();
if (container) {
const embedding = Doc.MakeEmbedding(container.Document);
- embedding._type_collection = CollectionViewType.Time;
+ embedding._type_collection = CollectionViewType.Pivot;
const colHdrKey = '_' + container.LayoutFieldKey + '_columnHeaders';
let list = Cast(embedding[colHdrKey], listSpec(SchemaHeaderField));
if (!list) {
@@ -264,7 +267,7 @@ export class DashFieldViewInternal extends ObservableReactComponent<IDashFieldVi
className={`dashFieldView${this.isRowActive() ? '-active' : ''}`}
ref={this._fieldRef}
style={{
- width: this._props.width,
+ // width: this._props.width,
height: this._props.height,
pointerEvents: this._props.tbox._props.rootSelected?.() || this._props.tbox.isAnyChildContentActive?.() ? undefined : 'none',
}}>