@dxos/react-ui-table 0.8.2-main.f11618f → 0.8.2-staging.42af850
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/chunk-U6LL2AVU.mjs +26 -0
- package/dist/lib/browser/chunk-U6LL2AVU.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1074 -828
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{chunk-TGG6OZ54.cjs → chunk-CXDGXPM6.cjs} +12 -12
- package/dist/lib/node/chunk-CXDGXPM6.cjs.map +7 -0
- package/dist/lib/node/index.cjs +1080 -837
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +3 -3
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{chunk-KKLP54L3.mjs → chunk-EFSM52KQ.mjs} +10 -10
- package/dist/lib/node-esm/chunk-EFSM52KQ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1074 -828
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/components/Table/ColumnActionsMenu.d.ts.map +1 -1
- package/dist/types/src/components/Table/ColumnSettings.d.ts.map +1 -1
- package/dist/types/src/components/Table/CreateRefPanel.d.ts.map +1 -1
- package/dist/types/src/components/Table/DynamicTable.d.ts +3 -4
- package/dist/types/src/components/Table/DynamicTable.d.ts.map +1 -1
- package/dist/types/src/components/Table/RowActionsMenu.d.ts.map +1 -1
- package/dist/types/src/components/Table/Table.d.ts +2 -0
- package/dist/types/src/components/Table/Table.d.ts.map +1 -1
- package/dist/types/src/components/Table/Table.stories.d.ts +1 -0
- package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
- package/dist/types/src/components/Table/relations.stories.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts +13 -0
- package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts.map +1 -0
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts +3 -0
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/extension.d.ts.map +1 -1
- package/dist/types/src/components/TableToolbar/TableToolbar.d.ts +6 -3
- package/dist/types/src/components/TableToolbar/TableToolbar.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +39 -39
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/hooks/useTableModel.d.ts.map +1 -1
- package/dist/types/src/model/modal-controller.d.ts.map +1 -1
- package/dist/types/src/model/selection-model.d.ts.map +1 -1
- package/dist/types/src/model/table-model.d.ts.map +1 -1
- package/dist/types/src/model/table-presentation.d.ts.map +1 -1
- package/dist/types/src/types/table.d.ts +46 -45
- package/dist/types/src/types/table.d.ts.map +1 -1
- package/dist/types/src/util/dynamic-table.d.ts +4 -3
- package/dist/types/src/util/dynamic-table.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/schema.d.ts +12 -0
- package/dist/types/src/util/schema.d.ts.map +1 -0
- package/dist/types/src/util/signals.d.ts.map +1 -1
- package/dist/types/src/util/table-controls.d.ts.map +1 -1
- package/dist/types/src/util/table.d.ts +2 -2
- package/dist/types/src/util/table.d.ts.map +1 -1
- package/dist/types/src/util/tag.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +41 -34
- package/src/components/Table/CreateRefPanel.tsx +3 -3
- package/src/components/Table/DynamicTable.stories.tsx +2 -2
- package/src/components/Table/DynamicTable.tsx +4 -5
- package/src/components/Table/Table.stories.tsx +76 -42
- package/src/components/Table/Table.tsx +8 -5
- package/src/components/Table/relations.stories.tsx +17 -20
- package/src/components/TableCellEditor/FormCellEditor.tsx +94 -0
- package/src/components/TableCellEditor/TableCellEditor.stories.tsx +10 -8
- package/src/components/TableCellEditor/TableCellEditor.tsx +45 -4
- package/src/components/TableToolbar/TableToolbar.tsx +63 -33
- package/src/components/testing.ts +7 -6
- package/src/hooks/useTableModel.ts +4 -2
- package/src/model/selection-model.ts +1 -1
- package/src/model/table-model.test.ts +4 -3
- package/src/model/table-model.ts +1 -1
- package/src/model/table-presentation.test.ts +4 -3
- package/src/model/table-presentation.ts +53 -7
- package/src/types/table.ts +16 -11
- package/src/util/dynamic-table.ts +7 -4
- package/src/util/index.ts +1 -0
- package/src/util/schema.ts +36 -0
- package/src/util/table-buttons.ts +1 -1
- package/src/util/table.ts +11 -10
- package/dist/lib/browser/chunk-YWNRUF4J.mjs +0 -26
- package/dist/lib/browser/chunk-YWNRUF4J.mjs.map +0 -7
- package/dist/lib/node/chunk-TGG6OZ54.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-KKLP54L3.mjs.map +0 -7
package/dist/lib/node/index.cjs
CHANGED
|
@@ -37,13 +37,14 @@ __export(node_exports, {
|
|
|
37
37
|
Table: () => Table,
|
|
38
38
|
TableModel: () => TableModel,
|
|
39
39
|
TablePresentation: () => TablePresentation,
|
|
40
|
-
TableSchema: () =>
|
|
40
|
+
TableSchema: () => import_chunk_CXDGXPM6.TableSchema,
|
|
41
41
|
TableToolbar: () => TableToolbar,
|
|
42
|
-
TableType: () =>
|
|
42
|
+
TableType: () => import_chunk_CXDGXPM6.TableType,
|
|
43
43
|
cellClassesForRowSelection: () => cellClassesForRowSelection,
|
|
44
|
-
|
|
44
|
+
getBaseSchema: () => getBaseSchema,
|
|
45
45
|
initializeTable: () => initializeTable,
|
|
46
46
|
makeDynamicTable: () => makeDynamicTable,
|
|
47
|
+
narrowSchema: () => narrowSchema,
|
|
47
48
|
tableButtons: () => tableButtons,
|
|
48
49
|
tableControls: () => tableControls,
|
|
49
50
|
touch: () => touch,
|
|
@@ -51,7 +52,8 @@ __export(node_exports, {
|
|
|
51
52
|
useTableModel: () => useTableModel
|
|
52
53
|
});
|
|
53
54
|
module.exports = __toCommonJS(node_exports);
|
|
54
|
-
var
|
|
55
|
+
var import_chunk_CXDGXPM6 = require("./chunk-CXDGXPM6.cjs");
|
|
56
|
+
var import_tracking = require("@preact-signals/safe-react/tracking");
|
|
55
57
|
var import_react = __toESM(require("react"));
|
|
56
58
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
57
59
|
var import_invariant = require("@dxos/invariant");
|
|
@@ -61,33 +63,41 @@ var import_react_ui_attention = require("@dxos/react-ui-attention");
|
|
|
61
63
|
var import_react_ui_grid = require("@dxos/react-ui-grid");
|
|
62
64
|
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
63
65
|
var import_util = require("@dxos/util");
|
|
66
|
+
var import_tracking2 = require("@preact-signals/safe-react/tracking");
|
|
64
67
|
var import_react2 = __toESM(require("react"));
|
|
65
68
|
var import_react_ui2 = require("@dxos/react-ui");
|
|
69
|
+
var import_tracking3 = require("@preact-signals/safe-react/tracking");
|
|
66
70
|
var import_react3 = __toESM(require("react"));
|
|
67
71
|
var import_react_ui3 = require("@dxos/react-ui");
|
|
68
72
|
var import_react_ui_form = require("@dxos/react-ui-form");
|
|
73
|
+
var import_tracking4 = require("@preact-signals/safe-react/tracking");
|
|
74
|
+
var import_effect = require("effect");
|
|
69
75
|
var import_react4 = __toESM(require("react"));
|
|
70
|
-
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
71
76
|
var import_echo2 = require("@dxos/react-client/echo");
|
|
72
77
|
var import_react_ui4 = require("@dxos/react-ui");
|
|
73
78
|
var import_react_ui_form2 = require("@dxos/react-ui-form");
|
|
74
79
|
var import_react_ui_grid2 = require("@dxos/react-ui-grid");
|
|
80
|
+
var import_tracking5 = require("@preact-signals/safe-react/tracking");
|
|
75
81
|
var import_react5 = __toESM(require("react"));
|
|
76
82
|
var import_react_ui5 = require("@dxos/react-ui");
|
|
77
83
|
var import_signals_core = require("@preact/signals-core");
|
|
78
84
|
var import_context = require("@dxos/context");
|
|
79
|
-
var
|
|
85
|
+
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
80
86
|
var import_invariant2 = require("@dxos/invariant");
|
|
81
87
|
var import_live_object = require("@dxos/live-object");
|
|
82
88
|
var import_react_ui_form3 = require("@dxos/react-ui-form");
|
|
83
89
|
var import_signals_core2 = require("@preact/signals-core");
|
|
84
90
|
var import_context2 = require("@dxos/context");
|
|
91
|
+
var import_echo_schema3 = require("@dxos/echo-schema");
|
|
85
92
|
var import_live_object2 = require("@dxos/live-object");
|
|
86
93
|
var import_schema = require("@dxos/schema");
|
|
94
|
+
var import_effect2 = require("effect");
|
|
87
95
|
var import_echo_schema4 = require("@dxos/echo-schema");
|
|
88
96
|
var import_react_client = require("@dxos/react-client");
|
|
89
97
|
var import_echo3 = require("@dxos/react-client/echo");
|
|
90
98
|
var import_schema2 = require("@dxos/schema");
|
|
99
|
+
var import_effect3 = require("effect");
|
|
100
|
+
var import_SchemaAST = require("effect/SchemaAST");
|
|
91
101
|
var import_signals_core3 = require("@preact/signals-core");
|
|
92
102
|
var import_lodash = __toESM(require("lodash.orderby"));
|
|
93
103
|
var import_echo_schema5 = require("@dxos/echo-schema");
|
|
@@ -95,11 +105,13 @@ var import_react_ui_form4 = require("@dxos/react-ui-form");
|
|
|
95
105
|
var import_signals_core4 = require("@preact/signals-core");
|
|
96
106
|
var import_log = require("@dxos/log");
|
|
97
107
|
var import_signals_core5 = require("@preact/signals-core");
|
|
108
|
+
var import_Predicate = require("effect/Predicate");
|
|
98
109
|
var import_echo_schema6 = require("@dxos/echo-schema");
|
|
99
110
|
var import_react_ui_form5 = require("@dxos/react-ui-form");
|
|
100
111
|
var import_react_ui_grid3 = require("@dxos/react-ui-grid");
|
|
101
112
|
var import_react_ui_theme2 = require("@dxos/react-ui-theme");
|
|
102
113
|
var import_schema3 = require("@dxos/schema");
|
|
114
|
+
var import_tracking6 = require("@preact-signals/safe-react/tracking");
|
|
103
115
|
var import_react6 = __toESM(require("react"));
|
|
104
116
|
var import_echo_schema7 = require("@dxos/echo-schema");
|
|
105
117
|
var import_invariant3 = require("@dxos/invariant");
|
|
@@ -107,19 +119,32 @@ var import_react_ui6 = require("@dxos/react-ui");
|
|
|
107
119
|
var import_react_ui_editor = require("@dxos/react-ui-editor");
|
|
108
120
|
var import_react_ui_grid4 = require("@dxos/react-ui-grid");
|
|
109
121
|
var import_react_ui_tag_picker = require("@dxos/react-ui-tag-picker");
|
|
110
|
-
var
|
|
111
|
-
var import_view = require("@codemirror/view");
|
|
122
|
+
var import_tracking7 = require("@preact-signals/safe-react/tracking");
|
|
112
123
|
var import_react7 = __toESM(require("react"));
|
|
124
|
+
var import_echo_schema8 = require("@dxos/echo-schema");
|
|
125
|
+
var import_invariant4 = require("@dxos/invariant");
|
|
113
126
|
var import_react_ui7 = require("@dxos/react-ui");
|
|
127
|
+
var import_react_ui_form6 = require("@dxos/react-ui-form");
|
|
128
|
+
var import_react_ui_grid5 = require("@dxos/react-ui-grid");
|
|
129
|
+
var import_util2 = require("@dxos/util");
|
|
130
|
+
var import_autocomplete = require("@codemirror/autocomplete");
|
|
131
|
+
var import_view = require("@codemirror/view");
|
|
132
|
+
var import_tracking8 = require("@preact-signals/safe-react/tracking");
|
|
133
|
+
var import_react8 = __toESM(require("react"));
|
|
134
|
+
var import_react_ui8 = require("@dxos/react-ui");
|
|
114
135
|
var import_react_ui_theme3 = require("@dxos/react-ui-theme");
|
|
136
|
+
var import_tracking9 = require("@preact-signals/safe-react/tracking");
|
|
115
137
|
var import_signals_core6 = require("@preact/signals-core");
|
|
116
|
-
var
|
|
138
|
+
var import_react9 = require("react");
|
|
117
139
|
var import_echo4 = require("@dxos/react-client/echo");
|
|
118
140
|
var import_react_ui_attention2 = require("@dxos/react-ui-attention");
|
|
119
|
-
var
|
|
120
|
-
var
|
|
141
|
+
var import_util3 = require("@dxos/util");
|
|
142
|
+
var import_tracking10 = require("@preact-signals/safe-react/tracking");
|
|
143
|
+
var import_rx_react = require("@effect-rx/rx-react");
|
|
144
|
+
var import_react10 = __toESM(require("react"));
|
|
121
145
|
var import_live_object3 = require("@dxos/live-object");
|
|
122
146
|
var import_react_ui_menu = require("@dxos/react-ui-menu");
|
|
147
|
+
var import_react_ui_menu2 = require("@dxos/react-ui-menu");
|
|
123
148
|
var translationKey = "table";
|
|
124
149
|
var translations_default = [
|
|
125
150
|
{
|
|
@@ -151,191 +176,211 @@ var translations_default = [
|
|
|
151
176
|
}
|
|
152
177
|
];
|
|
153
178
|
var ColumnActionsMenu = ({ model, modals }) => {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
var _effect = (0, import_tracking2.useSignals)();
|
|
180
|
+
try {
|
|
181
|
+
const { t } = (0, import_react_ui2.useTranslation)(translationKey);
|
|
182
|
+
const state = modals.state.value;
|
|
183
|
+
if (state?.type !== "column") {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
const currentSort = model.sorting?.sorting;
|
|
187
|
+
const isCurrentColumnSorted = currentSort?.fieldId === state.fieldId;
|
|
188
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.DropdownMenu.Root, {
|
|
189
|
+
modal: false,
|
|
190
|
+
open: true,
|
|
191
|
+
onOpenChange: modals.close
|
|
192
|
+
}, /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.DropdownMenu.VirtualTrigger, {
|
|
193
|
+
virtualRef: modals.trigger
|
|
194
|
+
}), /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.DropdownMenu.Portal, null, /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.DropdownMenu.Content, null, /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.DropdownMenu.Viewport, null, (!isCurrentColumnSorted || currentSort?.direction === "asc") && /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.DropdownMenu.Item, {
|
|
195
|
+
"data-testid": "column-sort-descending",
|
|
196
|
+
onClick: () => model.sorting?.setSort(state.fieldId, "desc")
|
|
197
|
+
}, t("column action sort descending")), (!isCurrentColumnSorted || currentSort?.direction === "desc") && /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.DropdownMenu.Item, {
|
|
198
|
+
"data-testid": "column-sort-ascending",
|
|
199
|
+
onClick: () => model.sorting?.setSort(state.fieldId, "asc")
|
|
200
|
+
}, t("column action sort ascending")), isCurrentColumnSorted && /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.DropdownMenu.Item, {
|
|
201
|
+
"data-testid": "column-clear-sort",
|
|
202
|
+
onClick: () => model.sorting?.clearSort()
|
|
203
|
+
}, t("column action clear sorting")), model.getColumnCount() > 1 && model.features.schemaEditable && /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.DropdownMenu.Item, {
|
|
204
|
+
"data-testid": "column-delete",
|
|
205
|
+
onClick: () => model.deleteColumn(state.fieldId)
|
|
206
|
+
}, t("column action delete")), model.features.schemaEditable && /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.DropdownMenu.Item, {
|
|
207
|
+
"data-testid": "column-settings",
|
|
208
|
+
onClick: () => modals.openColumnSettings()
|
|
209
|
+
}, t("column action settings"))), /* @__PURE__ */ import_react2.default.createElement(import_react_ui2.DropdownMenu.Arrow, null))));
|
|
210
|
+
} finally {
|
|
211
|
+
_effect.f();
|
|
212
|
+
}
|
|
183
213
|
};
|
|
184
214
|
var ColumnSettings = ({ model, modals, onNewColumn }) => {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
model?.projection,
|
|
199
|
-
state
|
|
200
|
-
]);
|
|
201
|
-
const existingField = (0, import_react3.useMemo)(() => {
|
|
202
|
-
if (state?.type === "columnSettings") {
|
|
203
|
-
const { mode } = state;
|
|
204
|
-
if (mode.type === "edit") {
|
|
205
|
-
return model?.view?.fields.find((f) => f.id === mode.fieldId);
|
|
215
|
+
var _effect = (0, import_tracking3.useSignals)();
|
|
216
|
+
try {
|
|
217
|
+
const [newField, setNewField] = (0, import_react3.useState)();
|
|
218
|
+
const state = modals.state.value;
|
|
219
|
+
const space = model?.space;
|
|
220
|
+
(0, import_react3.useEffect)(() => {
|
|
221
|
+
if (state?.type === "columnSettings" && state.mode.type === "create" && model?.projection) {
|
|
222
|
+
setNewField(model.projection.createFieldProjection());
|
|
223
|
+
requestAnimationFrame(() => {
|
|
224
|
+
onNewColumn();
|
|
225
|
+
});
|
|
226
|
+
} else {
|
|
227
|
+
setNewField(void 0);
|
|
206
228
|
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
229
|
+
}, [
|
|
230
|
+
model?.projection,
|
|
231
|
+
state
|
|
232
|
+
]);
|
|
233
|
+
const existingField = (0, import_react3.useMemo)(() => {
|
|
234
|
+
if (state?.type === "columnSettings") {
|
|
235
|
+
const { mode } = state;
|
|
236
|
+
if (mode.type === "edit") {
|
|
237
|
+
return model?.view?.fields.find((f) => f.id === mode.fieldId);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return void 0;
|
|
241
|
+
}, [
|
|
242
|
+
model?.view?.fields,
|
|
243
|
+
state
|
|
244
|
+
]);
|
|
245
|
+
const field = existingField ?? newField;
|
|
246
|
+
const handleSave = (0, import_react3.useCallback)(() => {
|
|
247
|
+
modals.close();
|
|
248
|
+
}, [
|
|
249
|
+
modals
|
|
250
|
+
]);
|
|
251
|
+
const handleCancel = (0, import_react3.useCallback)(() => {
|
|
252
|
+
if (state?.type === "columnSettings" && state.mode.type === "create" && newField) {
|
|
253
|
+
model?.projection?.deleteFieldProjection(newField.id);
|
|
254
|
+
}
|
|
255
|
+
}, [
|
|
256
|
+
model?.projection,
|
|
257
|
+
state,
|
|
258
|
+
newField
|
|
259
|
+
]);
|
|
260
|
+
if (!model?.view || !model.projection || !field) {
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react_ui3.DropdownMenu.Root, {
|
|
264
|
+
modal: false,
|
|
265
|
+
open: state?.type === "columnSettings"
|
|
266
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui3.DropdownMenu.VirtualTrigger, {
|
|
267
|
+
virtualRef: modals.trigger
|
|
268
|
+
}), /* @__PURE__ */ import_react3.default.createElement(import_react_ui3.DropdownMenu.Portal, null, /* @__PURE__ */ import_react3.default.createElement(import_react_ui3.DropdownMenu.Content, {
|
|
269
|
+
classNames: "md:is-64"
|
|
270
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui3.DropdownMenu.Viewport, null, /* @__PURE__ */ import_react3.default.createElement(import_react_ui_form.FieldEditor, {
|
|
271
|
+
view: model.view,
|
|
272
|
+
projection: model.projection,
|
|
273
|
+
field,
|
|
274
|
+
registry: space?.db.schemaRegistry,
|
|
275
|
+
onSave: handleSave,
|
|
276
|
+
onCancel: handleCancel
|
|
277
|
+
})), /* @__PURE__ */ import_react3.default.createElement(import_react_ui3.DropdownMenu.Arrow, null))));
|
|
278
|
+
} finally {
|
|
279
|
+
_effect.f();
|
|
280
|
+
}
|
|
246
281
|
};
|
|
247
282
|
var CreateRefPanel = ({ model, modals, __gridScope }) => {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
typename: state.typename
|
|
257
|
-
}).runSync();
|
|
258
|
-
if (schema2) {
|
|
259
|
-
const omit = import_echo_schema2.S.omit("id");
|
|
260
|
-
return omit(schema2);
|
|
261
|
-
}
|
|
262
|
-
}, [
|
|
263
|
-
space,
|
|
264
|
-
state
|
|
265
|
-
]);
|
|
266
|
-
const handleSave = (0, import_react4.useCallback)((values) => {
|
|
267
|
-
if (!model || !space || state?.type !== "createRefPanel") {
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
const [schema2] = space.db.schemaRegistry.query({
|
|
271
|
-
typename: state.typename
|
|
272
|
-
}).runSync();
|
|
273
|
-
if (schema2) {
|
|
274
|
-
const obj = space.db.add((0, import_echo2.live)(schema2, values));
|
|
275
|
-
state.onCreate?.(obj);
|
|
276
|
-
}
|
|
277
|
-
void modals.close();
|
|
278
|
-
}, [
|
|
279
|
-
modals,
|
|
280
|
-
space,
|
|
281
|
-
state
|
|
282
|
-
]);
|
|
283
|
-
const handleCancel = (0, import_react4.useCallback)(() => {
|
|
284
|
-
if (model) {
|
|
285
|
-
modals.close();
|
|
286
|
-
}
|
|
287
|
-
}, [
|
|
288
|
-
modals
|
|
289
|
-
]);
|
|
290
|
-
if (!model?.view || !model.projection) {
|
|
291
|
-
return null;
|
|
292
|
-
}
|
|
293
|
-
return /* @__PURE__ */ import_react4.default.createElement(import_react_ui4.Popover.Root, {
|
|
294
|
-
modal: false,
|
|
295
|
-
open: state?.type === "createRefPanel" && !!schema,
|
|
296
|
-
onOpenChange: (nextOpen) => {
|
|
297
|
-
if (model && !nextOpen) {
|
|
298
|
-
return modals.close();
|
|
283
|
+
var _effect = (0, import_tracking4.useSignals)();
|
|
284
|
+
try {
|
|
285
|
+
const { id: gridId } = (0, import_react_ui_grid2.useGridContext)("TableCellEditor", __gridScope);
|
|
286
|
+
const space = model?.space;
|
|
287
|
+
const state = modals.state.value;
|
|
288
|
+
const schema = (0, import_react4.useMemo)(() => {
|
|
289
|
+
if (!space || state?.type !== "createRefPanel") {
|
|
290
|
+
return;
|
|
299
291
|
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
292
|
+
const [schema2] = space.db.schemaRegistry.query({
|
|
293
|
+
typename: state.typename
|
|
294
|
+
}).runSync();
|
|
295
|
+
if (schema2) {
|
|
296
|
+
const omit = import_effect.Schema.omit("id");
|
|
297
|
+
return omit(schema2);
|
|
298
|
+
}
|
|
299
|
+
}, [
|
|
300
|
+
space,
|
|
301
|
+
state
|
|
302
|
+
]);
|
|
303
|
+
const handleSave = (0, import_react4.useCallback)((values) => {
|
|
304
|
+
if (!model || !space || state?.type !== "createRefPanel") {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
const [schema2] = space.db.schemaRegistry.query({
|
|
308
|
+
typename: state.typename
|
|
309
|
+
}).runSync();
|
|
310
|
+
if (schema2) {
|
|
311
|
+
const obj = space.db.add((0, import_echo2.live)(schema2, values));
|
|
312
|
+
state.onCreate?.(obj);
|
|
313
|
+
}
|
|
314
|
+
void modals.close();
|
|
315
|
+
}, [
|
|
316
|
+
modals,
|
|
317
|
+
space,
|
|
318
|
+
state
|
|
319
|
+
]);
|
|
320
|
+
const handleCancel = (0, import_react4.useCallback)(() => {
|
|
321
|
+
if (model) {
|
|
322
|
+
modals.close();
|
|
323
|
+
}
|
|
324
|
+
}, [
|
|
325
|
+
modals
|
|
326
|
+
]);
|
|
327
|
+
if (!model?.view || !model.projection) {
|
|
328
|
+
return null;
|
|
329
|
+
}
|
|
330
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_react_ui4.Popover.Root, {
|
|
331
|
+
modal: false,
|
|
332
|
+
open: state?.type === "createRefPanel" && !!schema,
|
|
333
|
+
onOpenChange: (nextOpen) => {
|
|
334
|
+
if (model && !nextOpen) {
|
|
335
|
+
return modals.close();
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui4.Popover.VirtualTrigger, {
|
|
339
|
+
virtualRef: modals.trigger
|
|
340
|
+
}), /* @__PURE__ */ import_react4.default.createElement(import_react_ui4.Popover.Portal, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui4.Popover.Content, {
|
|
341
|
+
classNames: "md:is-64",
|
|
342
|
+
"data-grid": gridId
|
|
343
|
+
}, state?.type === "createRefPanel" && schema && /* @__PURE__ */ import_react4.default.createElement(import_react_ui_form2.Form, {
|
|
344
|
+
schema,
|
|
345
|
+
values: state.initialValues ?? {},
|
|
346
|
+
onSave: handleSave,
|
|
347
|
+
onCancel: handleCancel
|
|
348
|
+
}), /* @__PURE__ */ import_react4.default.createElement(import_react_ui4.Popover.Arrow, null))));
|
|
349
|
+
} finally {
|
|
350
|
+
_effect.f();
|
|
351
|
+
}
|
|
312
352
|
};
|
|
313
353
|
var RowActionsMenu = ({ model, modals }) => {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
"
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
354
|
+
var _effect = (0, import_tracking5.useSignals)();
|
|
355
|
+
try {
|
|
356
|
+
const { t } = (0, import_react_ui5.useTranslation)(translationKey);
|
|
357
|
+
const hasSelection = model.selection.hasSelection.value;
|
|
358
|
+
const state = modals.state.value;
|
|
359
|
+
if (state?.type !== "row") {
|
|
360
|
+
return null;
|
|
361
|
+
}
|
|
362
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_react_ui5.DropdownMenu.Root, {
|
|
363
|
+
modal: false,
|
|
364
|
+
open: true,
|
|
365
|
+
onOpenChange: modals.close
|
|
366
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_ui5.DropdownMenu.VirtualTrigger, {
|
|
367
|
+
virtualRef: modals.trigger
|
|
368
|
+
}), /* @__PURE__ */ import_react5.default.createElement(import_react_ui5.DropdownMenu.Content, null, /* @__PURE__ */ import_react5.default.createElement(import_react_ui5.DropdownMenu.Viewport, null, model.features.dataEditable !== false && /* @__PURE__ */ import_react5.default.createElement(import_react_ui5.DropdownMenu.Item, {
|
|
369
|
+
"data-testid": "row-menu-delete",
|
|
370
|
+
onClick: () => model.deleteRow(state.rowIndex)
|
|
371
|
+
}, t(hasSelection ? "bulk delete row label" : "delete row label")), model.rowActions?.map((action) => /* @__PURE__ */ import_react5.default.createElement(import_react_ui5.DropdownMenu.Item, {
|
|
372
|
+
key: action.id,
|
|
373
|
+
"data-testid": `row-action-${action.id}`,
|
|
374
|
+
onClick: () => {
|
|
375
|
+
modals.close();
|
|
376
|
+
model.handleRowAction(action.id, state.rowIndex);
|
|
377
|
+
}
|
|
378
|
+
}, t(action.translationKey)))), /* @__PURE__ */ import_react5.default.createElement(import_react_ui5.DropdownMenu.Arrow, null)));
|
|
379
|
+
} finally {
|
|
380
|
+
_effect.f();
|
|
381
|
+
}
|
|
337
382
|
};
|
|
338
|
-
var
|
|
383
|
+
var getBaseSchema = ({ typename, properties, jsonSchema, schema }) => {
|
|
339
384
|
if (typename && properties) {
|
|
340
385
|
const schema2 = (0, import_schema.getSchemaFromPropertyDefinitions)(typename, properties);
|
|
341
386
|
return {
|
|
@@ -344,8 +389,8 @@ var getBaseSchems = ({ typename, properties, jsonSchema, schema }) => {
|
|
|
344
389
|
};
|
|
345
390
|
} else if (schema) {
|
|
346
391
|
return {
|
|
347
|
-
typename: schema
|
|
348
|
-
jsonSchema: schema
|
|
392
|
+
typename: (0, import_echo_schema3.getTypename)(schema),
|
|
393
|
+
jsonSchema: (0, import_echo_schema3.toJsonSchema)(schema)
|
|
349
394
|
};
|
|
350
395
|
} else if (typename && jsonSchema) {
|
|
351
396
|
return {
|
|
@@ -365,7 +410,7 @@ var makeDynamicTable = ({ typename, jsonSchema, properties }) => {
|
|
|
365
410
|
fields: properties.map((property) => property.name)
|
|
366
411
|
}
|
|
367
412
|
});
|
|
368
|
-
const table = (0, import_live_object2.live)(
|
|
413
|
+
const table = (0, import_live_object2.live)(import_chunk_CXDGXPM6.TableType, {
|
|
369
414
|
name: "dynamic-table",
|
|
370
415
|
view: (0, import_live_object2.makeRef)(view)
|
|
371
416
|
});
|
|
@@ -415,7 +460,7 @@ var initializeTable = async ({ client, space, table, typename, initialRow = true
|
|
|
415
460
|
throw new Error(`Schema not found: ${typename}`);
|
|
416
461
|
}
|
|
417
462
|
const fields = (0, import_schema2.getSchemaProperties)(schema.ast).map((prop) => prop.name);
|
|
418
|
-
table.view =
|
|
463
|
+
table.view = import_echo_schema4.Ref.make((0, import_schema2.createView)({
|
|
419
464
|
// TODO(ZaymonFC): Don't hardcode name?
|
|
420
465
|
name: "View",
|
|
421
466
|
typename: schema.typename,
|
|
@@ -428,7 +473,7 @@ var initializeTable = async ({ client, space, table, typename, initialRow = true
|
|
|
428
473
|
ContactSchema
|
|
429
474
|
]);
|
|
430
475
|
const fields = ContactFields;
|
|
431
|
-
table.view =
|
|
476
|
+
table.view = import_echo_schema4.Ref.make((0, import_schema2.createView)({
|
|
432
477
|
name: "View",
|
|
433
478
|
typename: schema.typename,
|
|
434
479
|
jsonSchema: schema.jsonSchema,
|
|
@@ -445,13 +490,13 @@ var ContactSchema = (0, import_echo_schema4.TypedObject)({
|
|
|
445
490
|
typename: `example.com/type/${import_react_client.PublicKey.random().truncate()}`,
|
|
446
491
|
version: "0.1.0"
|
|
447
492
|
})({
|
|
448
|
-
name:
|
|
449
|
-
|
|
493
|
+
name: import_effect2.Schema.optional(import_effect2.Schema.String).annotations({
|
|
494
|
+
title: "Name"
|
|
450
495
|
}),
|
|
451
|
-
active:
|
|
452
|
-
email:
|
|
453
|
-
salary:
|
|
454
|
-
|
|
496
|
+
active: import_effect2.Schema.optional(import_effect2.Schema.Boolean),
|
|
497
|
+
email: import_effect2.Schema.optional(import_echo_schema4.Format.Email),
|
|
498
|
+
salary: import_effect2.Schema.optional(import_echo_schema4.Format.Currency()).annotations({
|
|
499
|
+
title: "Salary"
|
|
455
500
|
})
|
|
456
501
|
});
|
|
457
502
|
var ContactFields = [
|
|
@@ -502,7 +547,7 @@ var BUTTON_IDENTIFIERS = {
|
|
|
502
547
|
var createButton = ({ attr, data, disabled = false, icon, testId, type = "primary" }) => {
|
|
503
548
|
const dataAttrs = Object.entries(data).map(([k, v]) => `${k}="${v}"`).join(" ");
|
|
504
549
|
const positionClass = type === "primary" ? "inline-end-2" : "inline-end-9";
|
|
505
|
-
return `<button ${attr} data-testid="${testId}" class="dx-button is-6 pli-0.5 min-bs-0 absolute inset-block-1 ${positionClass}" ${dataAttrs} ${disabled ? "disabled" : ""}><svg><use href="/icons.svg#${icon}"/></svg></button>`;
|
|
550
|
+
return `<button ${attr} data-testid="${testId}" class="dx-button is-6 pli-0.5 min-bs-0 absolute inset-block-1 ${positionClass}" ${dataAttrs} ${disabled ? "disabled" : ""}><svg data-size="4"><use href="/icons.svg#${icon}"/></svg></button>`;
|
|
506
551
|
};
|
|
507
552
|
var addColumnButton = {
|
|
508
553
|
attr: BUTTON_IDENTIFIERS.newColumn,
|
|
@@ -637,14 +682,20 @@ var tableControls = {
|
|
|
637
682
|
})
|
|
638
683
|
}
|
|
639
684
|
};
|
|
685
|
+
var narrowSchema = (schema, paths) => {
|
|
686
|
+
const ast = schema?.ast;
|
|
687
|
+
if ((0, import_SchemaAST.isTypeLiteral)(ast)) {
|
|
688
|
+
const propertySignatures = ast.propertySignatures.filter((signature) => paths.includes(signature.name.toString()));
|
|
689
|
+
if (propertySignatures.length > 0) {
|
|
690
|
+
const narrowType = new import_SchemaAST.TypeLiteral(propertySignatures, []);
|
|
691
|
+
return import_effect3.Schema.make(narrowType);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
return void 0;
|
|
695
|
+
};
|
|
640
696
|
var SelectionModel = class extends import_context2.Resource {
|
|
641
697
|
constructor(_rows, _selectionMode, _onSelectionChanged) {
|
|
642
|
-
super()
|
|
643
|
-
this._rows = _rows;
|
|
644
|
-
this._selectionMode = _selectionMode;
|
|
645
|
-
this._onSelectionChanged = _onSelectionChanged;
|
|
646
|
-
this._selection = (0, import_signals_core2.signal)(/* @__PURE__ */ new Set());
|
|
647
|
-
this._validSelectedIds = (0, import_signals_core2.computed)(() => {
|
|
698
|
+
super(), this._rows = _rows, this._selectionMode = _selectionMode, this._onSelectionChanged = _onSelectionChanged, this._selection = (0, import_signals_core2.signal)(/* @__PURE__ */ new Set()), this._validSelectedIds = (0, import_signals_core2.computed)(() => {
|
|
648
699
|
const rows = this._rows.value;
|
|
649
700
|
if (!rows) {
|
|
650
701
|
return /* @__PURE__ */ new Set();
|
|
@@ -653,27 +704,21 @@ var SelectionModel = class extends import_context2.Resource {
|
|
|
653
704
|
return new Set([
|
|
654
705
|
...this._selection.value
|
|
655
706
|
].filter((id) => validIds.has(id)));
|
|
656
|
-
})
|
|
657
|
-
this._hasSelection = (0, import_signals_core2.computed)(() => this._validSelectedIds.value.size > 0);
|
|
658
|
-
this._allSelected = (0, import_signals_core2.computed)(() => {
|
|
707
|
+
}), this._hasSelection = (0, import_signals_core2.computed)(() => this._validSelectedIds.value.size > 0), this._allSelected = (0, import_signals_core2.computed)(() => {
|
|
659
708
|
const rows = this._rows.value;
|
|
660
709
|
if (rows.length === 0) {
|
|
661
710
|
return false;
|
|
662
711
|
}
|
|
663
712
|
return rows.every((row) => this._selection.value.has(row.id));
|
|
664
|
-
})
|
|
665
|
-
this.getSelectedRows = () => {
|
|
713
|
+
}), this.getSelectedRows = () => {
|
|
666
714
|
const selectedIds = this._validSelectedIds.value;
|
|
667
715
|
return this._rows.value.filter((row) => selectedIds.has(row.id));
|
|
668
|
-
}
|
|
669
|
-
this.isRowIndexSelected = (rowIndex) => {
|
|
716
|
+
}, this.isRowIndexSelected = (rowIndex) => {
|
|
670
717
|
const row = this._rows.value[rowIndex];
|
|
671
718
|
return this._selection.value.has(row.id);
|
|
672
|
-
}
|
|
673
|
-
this.isObjectSelected = (object) => {
|
|
719
|
+
}, this.isObjectSelected = (object) => {
|
|
674
720
|
return this._selection.value.has(object.id);
|
|
675
|
-
}
|
|
676
|
-
this.toggleSelectionForRowIndex = (rowIndex) => {
|
|
721
|
+
}, this.toggleSelectionForRowIndex = (rowIndex) => {
|
|
677
722
|
const row = this._rows.value[rowIndex];
|
|
678
723
|
const newSelection = new Set(this._selection.value);
|
|
679
724
|
if (newSelection.has(row.id)) {
|
|
@@ -685,8 +730,7 @@ var SelectionModel = class extends import_context2.Resource {
|
|
|
685
730
|
newSelection.add(row.id);
|
|
686
731
|
}
|
|
687
732
|
this._selection.value = newSelection;
|
|
688
|
-
}
|
|
689
|
-
this.setSelection = (mode) => {
|
|
733
|
+
}, this.setSelection = (mode) => {
|
|
690
734
|
switch (mode) {
|
|
691
735
|
case "all": {
|
|
692
736
|
this._selection.value = new Set(this._rows.value.map((row) => row.id));
|
|
@@ -959,17 +1003,17 @@ var TableModel = class extends import_context.Resource {
|
|
|
959
1003
|
}
|
|
960
1004
|
const field = fields[col];
|
|
961
1005
|
const dataIndex = this._sorting.getDataIndex(row);
|
|
962
|
-
const value = (0,
|
|
1006
|
+
const value = (0, import_echo_schema2.getValue)(this._rows.value[dataIndex], field.path);
|
|
963
1007
|
if (value == null) {
|
|
964
1008
|
return "";
|
|
965
1009
|
}
|
|
966
1010
|
const { props } = this._projection.getFieldProjection(field.id);
|
|
967
1011
|
switch (props.format) {
|
|
968
|
-
case
|
|
1012
|
+
case import_echo_schema2.FormatEnum.Ref: {
|
|
969
1013
|
if (!field.referencePath) {
|
|
970
1014
|
return "";
|
|
971
1015
|
}
|
|
972
|
-
return (0,
|
|
1016
|
+
return (0, import_echo_schema2.getValue)(value.target, field.referencePath);
|
|
973
1017
|
}
|
|
974
1018
|
default: {
|
|
975
1019
|
return (0, import_react_ui_form3.formatForEditing)({
|
|
@@ -989,28 +1033,28 @@ var TableModel = class extends import_context.Resource {
|
|
|
989
1033
|
const field = fields[col];
|
|
990
1034
|
const { props } = this._projection.getFieldProjection(field.id);
|
|
991
1035
|
switch (props.format) {
|
|
992
|
-
case
|
|
1036
|
+
case import_echo_schema2.FormatEnum.Ref: {
|
|
993
1037
|
if ((0, import_live_object.isLiveObject)(value)) {
|
|
994
|
-
(0,
|
|
1038
|
+
(0, import_echo_schema2.setValue)(this._rows.value[rowIdx], field.path, (0, import_live_object.makeRef)(value));
|
|
995
1039
|
}
|
|
996
1040
|
break;
|
|
997
1041
|
}
|
|
998
|
-
case
|
|
1042
|
+
case import_echo_schema2.FormatEnum.SingleSelect: {
|
|
999
1043
|
const ids = extractTagIds(value);
|
|
1000
1044
|
if (ids && ids.length > 0) {
|
|
1001
|
-
(0,
|
|
1045
|
+
(0, import_echo_schema2.setValue)(this._rows.value[rowIdx], field.path, ids[0]);
|
|
1002
1046
|
}
|
|
1003
1047
|
break;
|
|
1004
1048
|
}
|
|
1005
|
-
case
|
|
1049
|
+
case import_echo_schema2.FormatEnum.MultiSelect: {
|
|
1006
1050
|
const ids = extractTagIds(value);
|
|
1007
1051
|
if (ids) {
|
|
1008
|
-
(0,
|
|
1052
|
+
(0, import_echo_schema2.setValue)(this._rows.value[rowIdx], field.path, ids);
|
|
1009
1053
|
}
|
|
1010
1054
|
break;
|
|
1011
1055
|
}
|
|
1012
1056
|
default: {
|
|
1013
|
-
(0,
|
|
1057
|
+
(0, import_echo_schema2.setValue)(this._rows.value[rowIdx], field.path, (0, import_react_ui_form3.parseValue)({
|
|
1014
1058
|
type: props.type,
|
|
1015
1059
|
format: props.format,
|
|
1016
1060
|
value
|
|
@@ -1156,7 +1200,7 @@ var TableModel = class extends import_context.Resource {
|
|
|
1156
1200
|
for (let row = start.row; row <= end.row; row++) {
|
|
1157
1201
|
rowEffects.push((0, import_signals_core.effect)(() => {
|
|
1158
1202
|
const obj = this._sorting.sortedRows.value[row];
|
|
1159
|
-
this._view?.fields.forEach((field) => touch((0,
|
|
1203
|
+
this._view?.fields.forEach((field) => touch((0, import_echo_schema2.getValue)(obj, field.path)));
|
|
1160
1204
|
this._onCellUpdate?.({
|
|
1161
1205
|
row,
|
|
1162
1206
|
col: start.col,
|
|
@@ -1177,9 +1221,9 @@ var TableModel = class extends import_context.Resource {
|
|
|
1177
1221
|
const dataRow = this._sorting.getDataIndex(row);
|
|
1178
1222
|
const fields = this._view?.fields ?? [];
|
|
1179
1223
|
const field = fields[col];
|
|
1180
|
-
const value = (0,
|
|
1224
|
+
const value = (0, import_echo_schema2.getValue)(this._rows.value[dataRow], field.path);
|
|
1181
1225
|
const updatedValue = update(value);
|
|
1182
|
-
(0,
|
|
1226
|
+
(0, import_echo_schema2.setValue)(this._rows.value[dataRow], field.path, updatedValue);
|
|
1183
1227
|
}
|
|
1184
1228
|
//
|
|
1185
1229
|
// Column Operations
|
|
@@ -1365,6 +1409,9 @@ var TablePresentation = class {
|
|
|
1365
1409
|
if (value == null) {
|
|
1366
1410
|
return "";
|
|
1367
1411
|
}
|
|
1412
|
+
if (props.type === "array") {
|
|
1413
|
+
return "";
|
|
1414
|
+
}
|
|
1368
1415
|
switch (props.format) {
|
|
1369
1416
|
case import_echo_schema6.FormatEnum.Boolean:
|
|
1370
1417
|
case import_echo_schema6.FormatEnum.SingleSelect:
|
|
@@ -1402,11 +1449,38 @@ var TablePresentation = class {
|
|
|
1402
1449
|
if (classes.length > 0) {
|
|
1403
1450
|
cell.className = (0, import_react_ui_theme2.mx)(classes.flat());
|
|
1404
1451
|
}
|
|
1452
|
+
if (props.type === import_echo_schema6.TypeEnum.Array) {
|
|
1453
|
+
const targetArray = (0, import_echo_schema6.getValue)(obj, field.path);
|
|
1454
|
+
if (targetArray && Array.isArray(targetArray)) {
|
|
1455
|
+
const getLabel = (value) => {
|
|
1456
|
+
if (!value) {
|
|
1457
|
+
return void 0;
|
|
1458
|
+
}
|
|
1459
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
1460
|
+
return String(value);
|
|
1461
|
+
}
|
|
1462
|
+
if (Array.isArray(value)) {
|
|
1463
|
+
return "Array";
|
|
1464
|
+
}
|
|
1465
|
+
if (typeof value === "object" && value.name) {
|
|
1466
|
+
return value.name;
|
|
1467
|
+
}
|
|
1468
|
+
if (typeof value === "object" && value.value) {
|
|
1469
|
+
return `${value.value}`;
|
|
1470
|
+
}
|
|
1471
|
+
return "Object";
|
|
1472
|
+
};
|
|
1473
|
+
const tags = targetArray.map(getLabel).filter(import_Predicate.isNotNullable).map((title) => {
|
|
1474
|
+
return `<span class="dx-tag rounded-xl" data-hue="neutral">${title}</span>`;
|
|
1475
|
+
}).join("");
|
|
1476
|
+
cell.accessoryHtml = `<div role='none' class="flex flex-row gap-1 overflow-x-auto">${tags}</div>`;
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1405
1479
|
if (props.format === import_echo_schema6.FormatEnum.Ref && props.referenceSchema) {
|
|
1406
1480
|
const targetObj = (0, import_echo_schema6.getValue)(obj, field.path)?.target;
|
|
1407
1481
|
if (targetObj) {
|
|
1408
1482
|
const dxn = (0, import_echo_schema6.getDXN)(targetObj)?.toString();
|
|
1409
|
-
cell.accessoryHtml = `<dx-ref-tag
|
|
1483
|
+
cell.accessoryHtml = `<dx-ref-tag refId=${dxn} class="dx-button block is-6 pli-[3px] plb-[3px] pbe-[2px] min-bs-0 absolute inline-end-1"><dx-icon icon="ph--link-simple--regular"/></dx-ref-tag>`;
|
|
1410
1484
|
}
|
|
1411
1485
|
}
|
|
1412
1486
|
if (props.format === import_echo_schema6.FormatEnum.Boolean) {
|
|
@@ -1440,7 +1514,7 @@ var TablePresentation = class {
|
|
|
1440
1514
|
return null;
|
|
1441
1515
|
}).filter(Boolean).join(" ");
|
|
1442
1516
|
if (tags) {
|
|
1443
|
-
cell.accessoryHtml = tags
|
|
1517
|
+
cell.accessoryHtml = `<div role='none' class="flex flex-row gap-1">${tags}</div>`;
|
|
1444
1518
|
}
|
|
1445
1519
|
}
|
|
1446
1520
|
}
|
|
@@ -1485,7 +1559,7 @@ var TablePresentation = class {
|
|
|
1485
1559
|
fieldId: field.id
|
|
1486
1560
|
})}
|
|
1487
1561
|
`,
|
|
1488
|
-
className: "!bg-
|
|
1562
|
+
className: "!bg-toolbarSurface"
|
|
1489
1563
|
};
|
|
1490
1564
|
}
|
|
1491
1565
|
return cells;
|
|
@@ -1536,7 +1610,7 @@ var TablePresentation = class {
|
|
|
1536
1610
|
col: 0,
|
|
1537
1611
|
row: 0
|
|
1538
1612
|
})]: {
|
|
1539
|
-
className: "!bg-
|
|
1613
|
+
className: "!bg-toolbarSurface",
|
|
1540
1614
|
readonly: true,
|
|
1541
1615
|
value: ""
|
|
1542
1616
|
}
|
|
@@ -1552,7 +1626,7 @@ var TablePresentation = class {
|
|
|
1552
1626
|
header: true,
|
|
1553
1627
|
checked: this.model.selection.allRowsSeleted.value
|
|
1554
1628
|
}),
|
|
1555
|
-
className: "!bg-
|
|
1629
|
+
className: "!bg-toolbarSurface",
|
|
1556
1630
|
readonly: true,
|
|
1557
1631
|
value: ""
|
|
1558
1632
|
}
|
|
@@ -1567,7 +1641,7 @@ var TablePresentation = class {
|
|
|
1567
1641
|
accessoryHtml: this.model.features.schemaEditable ? tableButtons.addColumn.render({
|
|
1568
1642
|
disabled: (this.model.view?.fields?.length ?? 0) >= import_schema3.VIEW_FIELD_LIMIT
|
|
1569
1643
|
}) : void 0,
|
|
1570
|
-
className: "!bg-
|
|
1644
|
+
className: "!bg-toolbarSurface",
|
|
1571
1645
|
readonly: true,
|
|
1572
1646
|
value: ""
|
|
1573
1647
|
}
|
|
@@ -1596,6 +1670,97 @@ var cellClassesForRowSelection = (selected, selectionMode) => {
|
|
|
1596
1670
|
];
|
|
1597
1671
|
}
|
|
1598
1672
|
};
|
|
1673
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-table/src/components/TableCellEditor/FormCellEditor.tsx";
|
|
1674
|
+
var FormCellEditor = ({ fieldProjection, model, schema, __gridScope }) => {
|
|
1675
|
+
var _effect = (0, import_tracking7.useSignals)();
|
|
1676
|
+
try {
|
|
1677
|
+
const { editing, setEditing } = (0, import_react_ui_grid5.useGridContext)("ArrayEditor", __gridScope);
|
|
1678
|
+
const cellRef = (0, import_react7.useRef)(null);
|
|
1679
|
+
(0, import_react7.useEffect)(() => {
|
|
1680
|
+
if (editing && editing.cellElement) {
|
|
1681
|
+
cellRef.current = editing.cellElement;
|
|
1682
|
+
}
|
|
1683
|
+
}, [
|
|
1684
|
+
editing?.cellElement
|
|
1685
|
+
]);
|
|
1686
|
+
const narrowedSchema = (0, import_react7.useMemo)(() => {
|
|
1687
|
+
if (!schema) {
|
|
1688
|
+
return void 0;
|
|
1689
|
+
}
|
|
1690
|
+
return narrowSchema(schema, [
|
|
1691
|
+
fieldProjection.field.path
|
|
1692
|
+
]);
|
|
1693
|
+
}, [
|
|
1694
|
+
JSON.stringify(schema),
|
|
1695
|
+
fieldProjection.field.path
|
|
1696
|
+
]);
|
|
1697
|
+
const originalRow = (0, import_react7.useMemo)(() => {
|
|
1698
|
+
if (model && editing) {
|
|
1699
|
+
const cell = (0, import_react_ui_grid5.parseCellIndex)(editing.index);
|
|
1700
|
+
const row = model.getRowAt(cell.row);
|
|
1701
|
+
(0, import_invariant4.invariant)(row, void 0, {
|
|
1702
|
+
F: __dxlog_file3,
|
|
1703
|
+
L: 47,
|
|
1704
|
+
S: void 0,
|
|
1705
|
+
A: [
|
|
1706
|
+
"row",
|
|
1707
|
+
""
|
|
1708
|
+
]
|
|
1709
|
+
});
|
|
1710
|
+
return row;
|
|
1711
|
+
}
|
|
1712
|
+
return void 0;
|
|
1713
|
+
}, [
|
|
1714
|
+
model,
|
|
1715
|
+
editing
|
|
1716
|
+
]);
|
|
1717
|
+
const formValues = (0, import_react7.useMemo)(() => {
|
|
1718
|
+
if (originalRow) {
|
|
1719
|
+
return (0, import_echo_schema8.getSnapshot)(originalRow);
|
|
1720
|
+
}
|
|
1721
|
+
}, [
|
|
1722
|
+
originalRow
|
|
1723
|
+
]);
|
|
1724
|
+
const handleSave = (0, import_react7.useCallback)((values) => {
|
|
1725
|
+
const path = fieldProjection.field.path;
|
|
1726
|
+
const value = (0, import_util2.getDeep)(values, [
|
|
1727
|
+
path
|
|
1728
|
+
]);
|
|
1729
|
+
(0, import_util2.setDeep)(originalRow, [
|
|
1730
|
+
path
|
|
1731
|
+
], value);
|
|
1732
|
+
setEditing(null);
|
|
1733
|
+
}, [
|
|
1734
|
+
fieldProjection.field.path,
|
|
1735
|
+
originalRow
|
|
1736
|
+
]);
|
|
1737
|
+
const handleOpenChange = (0, import_react7.useCallback)((nextOpen) => {
|
|
1738
|
+
if (nextOpen === false) {
|
|
1739
|
+
setEditing(null);
|
|
1740
|
+
}
|
|
1741
|
+
}, [
|
|
1742
|
+
setEditing
|
|
1743
|
+
]);
|
|
1744
|
+
if (!editing) {
|
|
1745
|
+
return null;
|
|
1746
|
+
}
|
|
1747
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react_ui7.Popover.Root, {
|
|
1748
|
+
open: editing !== null,
|
|
1749
|
+
onOpenChange: handleOpenChange
|
|
1750
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui7.Popover.VirtualTrigger, {
|
|
1751
|
+
virtualRef: cellRef
|
|
1752
|
+
}), /* @__PURE__ */ import_react7.default.createElement(import_react_ui7.Popover.Content, {
|
|
1753
|
+
tabIndex: -1,
|
|
1754
|
+
classNames: "popover-card-width"
|
|
1755
|
+
}, /* @__PURE__ */ import_react7.default.createElement(import_react_ui7.Popover.Arrow, null), /* @__PURE__ */ import_react7.default.createElement(import_react_ui_form6.Form, {
|
|
1756
|
+
values: formValues,
|
|
1757
|
+
schema: narrowedSchema,
|
|
1758
|
+
onSave: handleSave
|
|
1759
|
+
})));
|
|
1760
|
+
} finally {
|
|
1761
|
+
_effect.f();
|
|
1762
|
+
}
|
|
1763
|
+
};
|
|
1599
1764
|
var completion = ({ debug, onQuery, onMatch }) => {
|
|
1600
1765
|
return [
|
|
1601
1766
|
import_view.EditorView.theme({
|
|
@@ -1631,218 +1796,268 @@ var completion = ({ debug, onQuery, onMatch }) => {
|
|
|
1631
1796
|
})
|
|
1632
1797
|
];
|
|
1633
1798
|
};
|
|
1634
|
-
var
|
|
1799
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-table/src/components/TableCellEditor/TableCellEditor.tsx";
|
|
1635
1800
|
var newValue = Symbol.for("newValue");
|
|
1636
1801
|
var createOption = (text) => ({
|
|
1637
1802
|
[newValue]: true,
|
|
1638
1803
|
text
|
|
1639
1804
|
});
|
|
1640
1805
|
var isCreateOption = (data) => typeof data === "object" && data[newValue];
|
|
1641
|
-
var
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1806
|
+
var TableValueEditor = ({ model, modals, schema, onEnter, onFocus, onQuery, __gridScope }) => {
|
|
1807
|
+
var _effect = (0, import_tracking6.useSignals)();
|
|
1808
|
+
try {
|
|
1809
|
+
const { editing } = (0, import_react_ui_grid4.useGridContext)("TableValueEditor", __gridScope);
|
|
1810
|
+
const fieldProjection = (0, import_react6.useMemo)(() => {
|
|
1811
|
+
if (!model || !editing) {
|
|
1812
|
+
return;
|
|
1813
|
+
}
|
|
1814
|
+
const { col } = (0, import_react_ui_grid4.parseCellIndex)(editing.index);
|
|
1815
|
+
const field = model.projection.view.fields[col];
|
|
1816
|
+
const fieldProjection2 = model.projection.getFieldProjection(field.id);
|
|
1817
|
+
(0, import_invariant3.invariant)(fieldProjection2, void 0, {
|
|
1818
|
+
F: __dxlog_file4,
|
|
1819
|
+
L: 73,
|
|
1820
|
+
S: void 0,
|
|
1821
|
+
A: [
|
|
1822
|
+
"fieldProjection",
|
|
1823
|
+
""
|
|
1824
|
+
]
|
|
1825
|
+
});
|
|
1826
|
+
return fieldProjection2;
|
|
1827
|
+
}, [
|
|
1828
|
+
model,
|
|
1829
|
+
editing
|
|
1830
|
+
]);
|
|
1831
|
+
if (fieldProjection?.props.type === import_echo_schema7.TypeEnum.Array) {
|
|
1832
|
+
return /* @__PURE__ */ import_react6.default.createElement(FormCellEditor, {
|
|
1833
|
+
fieldProjection,
|
|
1834
|
+
model,
|
|
1835
|
+
schema,
|
|
1836
|
+
__gridScope
|
|
1837
|
+
});
|
|
1648
1838
|
}
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
A: [
|
|
1657
|
-
"fieldProjection",
|
|
1658
|
-
""
|
|
1659
|
-
]
|
|
1839
|
+
return /* @__PURE__ */ import_react6.default.createElement(TableCellEditor, {
|
|
1840
|
+
model,
|
|
1841
|
+
modals,
|
|
1842
|
+
onEnter,
|
|
1843
|
+
onFocus,
|
|
1844
|
+
onQuery,
|
|
1845
|
+
__gridScope
|
|
1660
1846
|
});
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
const
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1847
|
+
} finally {
|
|
1848
|
+
_effect.f();
|
|
1849
|
+
}
|
|
1850
|
+
};
|
|
1851
|
+
var TableCellEditor = ({ model, modals, onEnter, onFocus, onQuery, __gridScope }) => {
|
|
1852
|
+
var _effect = (0, import_tracking6.useSignals)();
|
|
1853
|
+
try {
|
|
1854
|
+
const { id: gridId, editing, setEditing } = (0, import_react_ui_grid4.useGridContext)("TableCellEditor", __gridScope);
|
|
1855
|
+
const suppressNextBlur = (0, import_react6.useRef)(false);
|
|
1856
|
+
const { themeMode } = (0, import_react_ui6.useThemeContext)();
|
|
1857
|
+
const fieldProjection = (0, import_react6.useMemo)(() => {
|
|
1858
|
+
if (!model || !editing) {
|
|
1859
|
+
return;
|
|
1860
|
+
}
|
|
1861
|
+
const { col } = (0, import_react_ui_grid4.parseCellIndex)(editing.index);
|
|
1862
|
+
const field = model.projection.view.fields[col];
|
|
1863
|
+
const fieldProjection2 = model.projection.getFieldProjection(field.id);
|
|
1864
|
+
(0, import_invariant3.invariant)(fieldProjection2, void 0, {
|
|
1865
|
+
F: __dxlog_file4,
|
|
1866
|
+
L: 114,
|
|
1867
|
+
S: void 0,
|
|
1868
|
+
A: [
|
|
1869
|
+
"fieldProjection",
|
|
1870
|
+
""
|
|
1871
|
+
]
|
|
1872
|
+
});
|
|
1873
|
+
return fieldProjection2;
|
|
1874
|
+
}, [
|
|
1875
|
+
model,
|
|
1876
|
+
editing
|
|
1877
|
+
]);
|
|
1878
|
+
const handleEnter = (0, import_react6.useCallback)((value) => {
|
|
1879
|
+
if (!model || !editing) {
|
|
1880
|
+
return;
|
|
1881
|
+
}
|
|
1882
|
+
const cell = (0, import_react_ui_grid4.parseCellIndex)(editing.index);
|
|
1692
1883
|
model.setCellData(cell, value);
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1884
|
+
onEnter?.(cell);
|
|
1885
|
+
onFocus?.();
|
|
1886
|
+
setEditing(null);
|
|
1887
|
+
}, [
|
|
1888
|
+
model,
|
|
1889
|
+
editing,
|
|
1890
|
+
onEnter,
|
|
1891
|
+
onFocus,
|
|
1892
|
+
setEditing
|
|
1893
|
+
]);
|
|
1894
|
+
const handleBlur = (0, import_react6.useCallback)((value) => {
|
|
1895
|
+
if (!model || !editing) {
|
|
1896
|
+
return;
|
|
1897
|
+
}
|
|
1898
|
+
if (suppressNextBlur.current) {
|
|
1899
|
+
suppressNextBlur.current = false;
|
|
1900
|
+
return;
|
|
1901
|
+
}
|
|
1902
|
+
const cell = (0, import_react_ui_grid4.parseCellIndex)(editing.index);
|
|
1903
|
+
if (value !== void 0) {
|
|
1904
|
+
model.setCellData(cell, value);
|
|
1905
|
+
}
|
|
1906
|
+
}, [
|
|
1907
|
+
model,
|
|
1908
|
+
editing
|
|
1909
|
+
]);
|
|
1910
|
+
const handleClose = (0, import_react6.useCallback)((value, event) => {
|
|
1911
|
+
if (!model || !editing || !fieldProjection) {
|
|
1912
|
+
return;
|
|
1913
|
+
}
|
|
1914
|
+
const cell = (0, import_react_ui_grid4.parseCellIndex)(editing.index);
|
|
1915
|
+
onEnter?.(cell);
|
|
1916
|
+
if (event && onFocus) {
|
|
1917
|
+
onFocus(determineNavigationAxis(event), determineNavigationDelta(event));
|
|
1918
|
+
}
|
|
1919
|
+
}, [
|
|
1920
|
+
model,
|
|
1921
|
+
editing,
|
|
1922
|
+
onFocus,
|
|
1923
|
+
onEnter,
|
|
1924
|
+
fieldProjection
|
|
1925
|
+
]);
|
|
1926
|
+
const extension = (0, import_react6.useMemo)(() => {
|
|
1927
|
+
if (!fieldProjection) {
|
|
1928
|
+
return [];
|
|
1929
|
+
}
|
|
1930
|
+
const extension2 = [
|
|
1931
|
+
(0, import_react_ui_grid4.editorKeys)({
|
|
1932
|
+
onClose: handleClose,
|
|
1933
|
+
...editing?.initialContent && {
|
|
1934
|
+
onNav: handleClose
|
|
1935
|
+
}
|
|
1936
|
+
})
|
|
1937
|
+
];
|
|
1938
|
+
const format = fieldProjection.props.format;
|
|
1939
|
+
if (format === import_echo_schema7.FormatEnum.SingleSelect || format === import_echo_schema7.FormatEnum.MultiSelect) {
|
|
1940
|
+
extension2.push((0, import_react_ui_editor.createMarkdownExtensions)({
|
|
1941
|
+
themeMode
|
|
1942
|
+
}));
|
|
1943
|
+
const options = fieldProjection.props.options || [];
|
|
1944
|
+
const mode = format === import_echo_schema7.FormatEnum.SingleSelect ? "single-select" : "multi-select";
|
|
1945
|
+
extension2.push((0, import_react_ui_tag_picker.tagPickerExtension)({
|
|
1946
|
+
mode,
|
|
1947
|
+
inGrid: true,
|
|
1948
|
+
onSearch: (text, selectedIds) => {
|
|
1949
|
+
return options.filter((option) => selectedIds.indexOf(option.id) === -1 && (text.length === 0 || option.title.toLowerCase().includes(text.toLowerCase()))).map((option) => ({
|
|
1950
|
+
id: option.id,
|
|
1951
|
+
label: option.title,
|
|
1952
|
+
hue: option.color
|
|
1953
|
+
}));
|
|
1954
|
+
},
|
|
1955
|
+
onUpdate: (ids) => {
|
|
1956
|
+
if (model && editing) {
|
|
1957
|
+
if (ids.length === 0) {
|
|
1958
|
+
return;
|
|
1959
|
+
}
|
|
1960
|
+
if (mode === "single-select") {
|
|
1961
|
+
handleEnter(ids[0]);
|
|
1962
|
+
} else {
|
|
1963
|
+
handleEnter(ids);
|
|
1964
|
+
}
|
|
1752
1965
|
}
|
|
1753
1966
|
}
|
|
1754
|
-
}
|
|
1755
|
-
}
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
}
|
|
1967
|
+
}));
|
|
1968
|
+
}
|
|
1969
|
+
if (onQuery) {
|
|
1970
|
+
switch (fieldProjection.props.format) {
|
|
1971
|
+
case import_echo_schema7.FormatEnum.Ref: {
|
|
1972
|
+
extension2.push([
|
|
1973
|
+
completion({
|
|
1974
|
+
onQuery: (text) => onQuery(fieldProjection, text),
|
|
1975
|
+
onMatch: (data) => {
|
|
1976
|
+
if (model && editing && modals) {
|
|
1977
|
+
if (isCreateOption(data)) {
|
|
1978
|
+
const { field, props } = fieldProjection;
|
|
1979
|
+
if (props.referenceSchema) {
|
|
1980
|
+
suppressNextBlur.current = true;
|
|
1981
|
+
modals.openCreateRef(props.referenceSchema, document.querySelector((0, import_react_ui_grid4.cellQuery)(editing.index, gridId)), {
|
|
1982
|
+
[field.referencePath]: data.text
|
|
1983
|
+
}, (data2) => {
|
|
1984
|
+
handleEnter(data2);
|
|
1985
|
+
});
|
|
1986
|
+
}
|
|
1987
|
+
} else {
|
|
1988
|
+
handleEnter(data);
|
|
1774
1989
|
}
|
|
1775
|
-
} else {
|
|
1776
|
-
handleEnter(data);
|
|
1777
1990
|
}
|
|
1778
1991
|
}
|
|
1779
|
-
}
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1992
|
+
})
|
|
1993
|
+
]);
|
|
1994
|
+
break;
|
|
1995
|
+
}
|
|
1783
1996
|
}
|
|
1784
1997
|
}
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1998
|
+
return extension2;
|
|
1999
|
+
}, [
|
|
2000
|
+
model,
|
|
2001
|
+
modals,
|
|
2002
|
+
editing,
|
|
2003
|
+
fieldProjection,
|
|
2004
|
+
handleClose,
|
|
2005
|
+
themeMode
|
|
2006
|
+
]);
|
|
2007
|
+
const getCellContent = (0, import_react6.useCallback)(() => {
|
|
2008
|
+
if (model && editing) {
|
|
2009
|
+
const cell = (0, import_react_ui_grid4.parseCellIndex)(editing.index);
|
|
2010
|
+
const { col } = cell;
|
|
2011
|
+
const field = model.projection.view.fields[col];
|
|
2012
|
+
const fieldProjection2 = model.projection.getFieldProjection(field.id);
|
|
2013
|
+
if (fieldProjection2?.props.format === import_echo_schema7.FormatEnum.SingleSelect || fieldProjection2?.props.format === import_echo_schema7.FormatEnum.MultiSelect) {
|
|
2014
|
+
const value2 = model.getCellData(cell);
|
|
2015
|
+
if (value2 !== void 0) {
|
|
2016
|
+
const options = fieldProjection2.props.options || [];
|
|
2017
|
+
if (fieldProjection2.props.format === import_echo_schema7.FormatEnum.MultiSelect && Array.isArray(value2)) {
|
|
2018
|
+
const tagItems = value2.map((id) => {
|
|
2019
|
+
const option = options.find((o) => o.id === id);
|
|
2020
|
+
if (option) {
|
|
2021
|
+
return {
|
|
2022
|
+
id,
|
|
2023
|
+
label: option.title,
|
|
2024
|
+
hue: option.color
|
|
2025
|
+
};
|
|
2026
|
+
}
|
|
2027
|
+
return void 0;
|
|
2028
|
+
}).filter((item) => item !== void 0);
|
|
2029
|
+
return (0, import_react_ui_tag_picker.createLinks)(tagItems);
|
|
2030
|
+
} else {
|
|
2031
|
+
const option = options.find((o) => o.id === value2);
|
|
1808
2032
|
if (option) {
|
|
1809
|
-
|
|
1810
|
-
id,
|
|
2033
|
+
const tagItem = {
|
|
2034
|
+
id: value2,
|
|
1811
2035
|
label: option.title,
|
|
1812
2036
|
hue: option.color
|
|
1813
2037
|
};
|
|
2038
|
+
return (0, import_react_ui_tag_picker.createLinks)([
|
|
2039
|
+
tagItem
|
|
2040
|
+
]);
|
|
1814
2041
|
}
|
|
1815
|
-
return void 0;
|
|
1816
|
-
}).filter((item) => item !== void 0);
|
|
1817
|
-
return (0, import_react_ui_tag_picker.createLinks)(tagItems);
|
|
1818
|
-
} else {
|
|
1819
|
-
const option = options.find((o) => o.id === value2);
|
|
1820
|
-
if (option) {
|
|
1821
|
-
const tagItem = {
|
|
1822
|
-
id: value2,
|
|
1823
|
-
label: option.title,
|
|
1824
|
-
hue: option.color
|
|
1825
|
-
};
|
|
1826
|
-
return (0, import_react_ui_tag_picker.createLinks)([
|
|
1827
|
-
tagItem
|
|
1828
|
-
]);
|
|
1829
2042
|
}
|
|
1830
2043
|
}
|
|
2044
|
+
return "";
|
|
1831
2045
|
}
|
|
1832
|
-
|
|
2046
|
+
const value = model.getCellData(cell);
|
|
2047
|
+
return value !== void 0 ? String(value) : "";
|
|
1833
2048
|
}
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
}
|
|
2049
|
+
}, [
|
|
2050
|
+
model,
|
|
2051
|
+
editing
|
|
2052
|
+
]);
|
|
2053
|
+
return /* @__PURE__ */ import_react6.default.createElement(import_react_ui_grid4.GridCellEditor, {
|
|
2054
|
+
extension,
|
|
2055
|
+
getCellContent,
|
|
2056
|
+
onBlur: handleBlur
|
|
2057
|
+
});
|
|
2058
|
+
} finally {
|
|
2059
|
+
_effect.f();
|
|
2060
|
+
}
|
|
1846
2061
|
};
|
|
1847
2062
|
var determineNavigationAxis = ({ key }) => {
|
|
1848
2063
|
switch (key) {
|
|
@@ -1868,417 +2083,438 @@ var determineNavigationDelta = ({ key, shift }) => {
|
|
|
1868
2083
|
}
|
|
1869
2084
|
return shift ? -1 : 1;
|
|
1870
2085
|
};
|
|
1871
|
-
var
|
|
2086
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-table/src/components/Table/Table.tsx";
|
|
1872
2087
|
var TableRoot = ({ children, role }) => {
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
2088
|
+
var _effect = (0, import_tracking.useSignals)();
|
|
2089
|
+
try {
|
|
2090
|
+
return /* @__PURE__ */ import_react.default.createElement("div", {
|
|
2091
|
+
role: "none",
|
|
2092
|
+
className: (0, import_react_ui_theme.mx)("relative !border-separator", role === "section" ? "attention-surface overflow-hidden [&_.dx-grid]:max-is-[--dx-grid-content-inline-size]" : "flex flex-col [&_.dx-grid]:grow [&_.dx-grid]:max-is-[--dx-grid-content-inline-size] [&_.dx-grid]:bs-0 [&_.dx-grid]:max-bs-[--dx-grid-content-block-size]")
|
|
2093
|
+
}, children);
|
|
2094
|
+
} finally {
|
|
2095
|
+
_effect.f();
|
|
2096
|
+
}
|
|
1877
2097
|
};
|
|
1878
|
-
var TableMain = /* @__PURE__ */ (0, import_react.forwardRef)(({ model, presentation, ignoreAttention, onRowClick }, forwardedRef) => {
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
const
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
}, [
|
|
1902
|
-
presentation,
|
|
1903
|
-
dxGrid,
|
|
1904
|
-
getCells
|
|
1905
|
-
]);
|
|
1906
|
-
(0, import_react.useImperativeHandle)(forwardedRef, () => {
|
|
1907
|
-
if (!presentation || !dxGrid) {
|
|
1908
|
-
return {};
|
|
1909
|
-
}
|
|
1910
|
-
return {
|
|
1911
|
-
update: (cell) => {
|
|
1912
|
-
if (cell) {
|
|
1913
|
-
dxGrid.updateIfWithinBounds(cell);
|
|
1914
|
-
} else {
|
|
1915
|
-
dxGrid.updateCells(true);
|
|
1916
|
-
dxGrid.requestUpdate();
|
|
1917
|
-
}
|
|
2098
|
+
var TableMain = /* @__PURE__ */ (0, import_react.forwardRef)(({ model, presentation, ignoreAttention, schema, onRowClick }, forwardedRef) => {
|
|
2099
|
+
var _effect = (0, import_tracking.useSignals)();
|
|
2100
|
+
try {
|
|
2101
|
+
const [dxGrid, setDxGrid] = (0, import_react.useState)(null);
|
|
2102
|
+
const { hasAttention } = (0, import_react_ui_attention.useAttention)(model?.id ?? "table");
|
|
2103
|
+
const { t } = (0, import_react_ui.useTranslation)(translationKey);
|
|
2104
|
+
const modals = (0, import_react.useMemo)(() => new ModalController(), []);
|
|
2105
|
+
const frozen = (0, import_react.useMemo)(() => {
|
|
2106
|
+
const noActionColumn = model?.features.dataEditable === false && model?.features.schemaEditable === false && model.rowActions.length === 0;
|
|
2107
|
+
return {
|
|
2108
|
+
frozenRowsStart: 1,
|
|
2109
|
+
frozenColsStart: model?.features.selection.enabled ? 1 : 0,
|
|
2110
|
+
frozenColsEnd: noActionColumn ? 0 : 1
|
|
2111
|
+
};
|
|
2112
|
+
}, [
|
|
2113
|
+
model
|
|
2114
|
+
]);
|
|
2115
|
+
const getCells = (0, import_react.useCallback)((range, plane) => presentation?.getCells(range, plane) ?? {}, [
|
|
2116
|
+
presentation
|
|
2117
|
+
]);
|
|
2118
|
+
(0, import_react.useEffect)(() => {
|
|
2119
|
+
if (!presentation || !dxGrid) {
|
|
2120
|
+
return;
|
|
1918
2121
|
}
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
const row = model?.getRowAt(rowIndex);
|
|
1929
|
-
row && onRowClick(row);
|
|
1930
|
-
}
|
|
1931
|
-
if (model?.features.selection.enabled && model?.selection.selectionMode === "single") {
|
|
1932
|
-
model.selection.toggleSelectionForRowIndex(rowIndex);
|
|
2122
|
+
dxGrid.getCells = getCells;
|
|
2123
|
+
}, [
|
|
2124
|
+
presentation,
|
|
2125
|
+
dxGrid,
|
|
2126
|
+
getCells
|
|
2127
|
+
]);
|
|
2128
|
+
(0, import_react.useImperativeHandle)(forwardedRef, () => {
|
|
2129
|
+
if (!presentation || !dxGrid) {
|
|
2130
|
+
return {};
|
|
1933
2131
|
}
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
2132
|
+
return {
|
|
2133
|
+
update: (cell) => {
|
|
2134
|
+
if (cell) {
|
|
2135
|
+
dxGrid.updateIfWithinBounds(cell);
|
|
2136
|
+
} else {
|
|
2137
|
+
dxGrid.updateCells(true);
|
|
2138
|
+
dxGrid.requestUpdate();
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
};
|
|
2142
|
+
}, [
|
|
2143
|
+
presentation,
|
|
2144
|
+
dxGrid
|
|
2145
|
+
]);
|
|
2146
|
+
const handleGridClick = (0, import_react.useCallback)((event) => {
|
|
2147
|
+
const rowIndex = (0, import_util.safeParseInt)(event.target.ariaRowIndex ?? "");
|
|
2148
|
+
if (rowIndex != null) {
|
|
2149
|
+
if (onRowClick) {
|
|
2150
|
+
const row = model?.getRowAt(rowIndex);
|
|
2151
|
+
row && onRowClick(row);
|
|
2152
|
+
}
|
|
2153
|
+
if (model?.features.selection.enabled && model?.selection.selectionMode === "single") {
|
|
2154
|
+
model.selection.toggleSelectionForRowIndex(rowIndex);
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
if (!modals) {
|
|
1943
2158
|
return;
|
|
1944
2159
|
}
|
|
1945
|
-
|
|
1946
|
-
const
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
2160
|
+
const buttonSelector = Object.values(tableButtons).map((button) => `button[${button.attr}]`).join(",");
|
|
2161
|
+
const tableButtonElement = event.target.closest(buttonSelector);
|
|
2162
|
+
if (tableButtonElement) {
|
|
2163
|
+
const button = Object.values(tableButtons).find((btn) => tableButtonElement.hasAttribute(btn.attr));
|
|
2164
|
+
if (!button) {
|
|
2165
|
+
return;
|
|
1951
2166
|
}
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
2167
|
+
modals.setTrigger(tableButtonElement);
|
|
2168
|
+
const data = button.getData(tableButtonElement);
|
|
2169
|
+
switch (data.type) {
|
|
2170
|
+
case "rowMenu": {
|
|
2171
|
+
modals.showRowMenu(data.rowIndex);
|
|
2172
|
+
break;
|
|
2173
|
+
}
|
|
2174
|
+
case "columnSettings": {
|
|
2175
|
+
modals.showColumnMenu(data.fieldId);
|
|
2176
|
+
break;
|
|
2177
|
+
}
|
|
2178
|
+
case "newColumn": {
|
|
2179
|
+
modals.showColumnCreator();
|
|
2180
|
+
break;
|
|
2181
|
+
}
|
|
2182
|
+
case "sort": {
|
|
2183
|
+
model?.sorting?.toggleSort(data.fieldId);
|
|
2184
|
+
break;
|
|
2185
|
+
}
|
|
1955
2186
|
}
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
2187
|
+
return;
|
|
2188
|
+
}
|
|
2189
|
+
const controlSelector = Object.values(tableControls).map((control) => `input[${control.attr}]`).join(",");
|
|
2190
|
+
const controlElement = event.target.closest(controlSelector);
|
|
2191
|
+
if (controlElement) {
|
|
2192
|
+
const control = Object.values(tableControls).find((ctrl) => controlElement.hasAttribute(ctrl.attr));
|
|
2193
|
+
if (!control) {
|
|
2194
|
+
return;
|
|
1959
2195
|
}
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
2196
|
+
const data = control.getData(controlElement);
|
|
2197
|
+
switch (data.type) {
|
|
2198
|
+
case "checkbox": {
|
|
2199
|
+
if (data.header) {
|
|
2200
|
+
model?.selection.setSelection(model.selection.allRowsSeleted.value ? "none" : "all");
|
|
2201
|
+
} else {
|
|
2202
|
+
model?.selection.toggleSelectionForRowIndex(data.rowIndex);
|
|
2203
|
+
}
|
|
2204
|
+
break;
|
|
2205
|
+
}
|
|
2206
|
+
case "switch": {
|
|
2207
|
+
if (model) {
|
|
2208
|
+
model.updateCellData({
|
|
2209
|
+
row: data.rowIndex,
|
|
2210
|
+
col: data.colIndex
|
|
2211
|
+
}, (value) => !value);
|
|
2212
|
+
}
|
|
2213
|
+
break;
|
|
2214
|
+
}
|
|
1963
2215
|
}
|
|
1964
2216
|
}
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
2217
|
+
}, [
|
|
2218
|
+
model,
|
|
2219
|
+
modals
|
|
2220
|
+
]);
|
|
2221
|
+
const handleFocus = (0, import_react.useCallback)((increment, delta) => {
|
|
2222
|
+
if (dxGrid) {
|
|
2223
|
+
dxGrid.refocus(increment, delta);
|
|
2224
|
+
}
|
|
2225
|
+
}, [
|
|
2226
|
+
dxGrid
|
|
2227
|
+
]);
|
|
2228
|
+
const handleEnter = (0, import_react.useCallback)((cell) => {
|
|
2229
|
+
if (!model?.features.dataEditable) {
|
|
1972
2230
|
return;
|
|
1973
2231
|
}
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
}
|
|
1982
|
-
break;
|
|
2232
|
+
if (model && cell.row === model.getRowCount() - 1) {
|
|
2233
|
+
model.insertRow(cell.row);
|
|
2234
|
+
if (dxGrid) {
|
|
2235
|
+
requestAnimationFrame(() => {
|
|
2236
|
+
dxGrid?.scrollToRow(cell.row + 1);
|
|
2237
|
+
dxGrid?.refocus("row", 1);
|
|
2238
|
+
});
|
|
1983
2239
|
}
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
2240
|
+
}
|
|
2241
|
+
}, [
|
|
2242
|
+
model,
|
|
2243
|
+
dxGrid
|
|
2244
|
+
]);
|
|
2245
|
+
const handleKeyDown = (0, import_react.useCallback)((event) => {
|
|
2246
|
+
if (!model?.features.dataEditable) {
|
|
2247
|
+
return;
|
|
2248
|
+
}
|
|
2249
|
+
const cell = (0, import_react_ui_grid.closestCell)(event.target);
|
|
2250
|
+
if (!model || !cell) {
|
|
2251
|
+
return;
|
|
2252
|
+
}
|
|
2253
|
+
switch (event.key) {
|
|
2254
|
+
case "Backspace":
|
|
2255
|
+
case "Delete": {
|
|
2256
|
+
model.setCellData(cell, void 0);
|
|
1991
2257
|
break;
|
|
1992
2258
|
}
|
|
1993
2259
|
}
|
|
1994
|
-
}
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
dxGrid.refocus(increment, delta);
|
|
2002
|
-
}
|
|
2003
|
-
}, [
|
|
2004
|
-
dxGrid
|
|
2005
|
-
]);
|
|
2006
|
-
const handleEnter = (0, import_react.useCallback)((cell) => {
|
|
2007
|
-
if (!model?.features.dataEditable) {
|
|
2008
|
-
return;
|
|
2009
|
-
}
|
|
2010
|
-
if (model && cell.row === model.getRowCount() - 1) {
|
|
2011
|
-
model.insertRow(cell.row);
|
|
2012
|
-
if (dxGrid) {
|
|
2013
|
-
requestAnimationFrame(() => {
|
|
2014
|
-
dxGrid?.scrollToRow(cell.row + 1);
|
|
2015
|
-
dxGrid?.refocus("row", 1);
|
|
2016
|
-
});
|
|
2260
|
+
}, [
|
|
2261
|
+
model
|
|
2262
|
+
]);
|
|
2263
|
+
const handleAxisResize = (0, import_react.useCallback)((event) => {
|
|
2264
|
+
if (event.axis === "col") {
|
|
2265
|
+
const columnIndex = parseInt(event.index, 10);
|
|
2266
|
+
model?.setColumnWidth(columnIndex, event.size);
|
|
2017
2267
|
}
|
|
2018
|
-
}
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
if (!model?.features.dataEditable) {
|
|
2025
|
-
return;
|
|
2026
|
-
}
|
|
2027
|
-
const cell = (0, import_react_ui_grid.closestCell)(event.target);
|
|
2028
|
-
if (!model || !cell) {
|
|
2029
|
-
return;
|
|
2030
|
-
}
|
|
2031
|
-
switch (event.key) {
|
|
2032
|
-
case "Backspace":
|
|
2033
|
-
case "Delete": {
|
|
2034
|
-
model.setCellData(cell, void 0);
|
|
2035
|
-
break;
|
|
2268
|
+
}, [
|
|
2269
|
+
model
|
|
2270
|
+
]);
|
|
2271
|
+
const handleWheel = (0, import_react.useCallback)((event) => {
|
|
2272
|
+
if (!ignoreAttention && !hasAttention) {
|
|
2273
|
+
event.stopPropagation();
|
|
2036
2274
|
}
|
|
2037
|
-
}
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
}
|
|
2086
|
-
return {
|
|
2087
|
-
label: value,
|
|
2088
|
-
data: obj
|
|
2089
|
-
};
|
|
2090
|
-
}).filter(import_util.isNotFalsy);
|
|
2091
|
-
return [
|
|
2092
|
-
...options,
|
|
2093
|
-
{
|
|
2094
|
-
label: t("create new object label", {
|
|
2095
|
-
text
|
|
2096
|
-
}),
|
|
2097
|
-
data: createOption(text)
|
|
2098
|
-
}
|
|
2099
|
-
];
|
|
2275
|
+
}, [
|
|
2276
|
+
hasAttention,
|
|
2277
|
+
ignoreAttention
|
|
2278
|
+
]);
|
|
2279
|
+
const handleNewColumn = (0, import_react.useCallback)(() => {
|
|
2280
|
+
const columns = model?.getColumnCount();
|
|
2281
|
+
if (dxGrid && columns) {
|
|
2282
|
+
dxGrid.scrollToColumn(columns - 1);
|
|
2283
|
+
}
|
|
2284
|
+
}, [
|
|
2285
|
+
model,
|
|
2286
|
+
dxGrid
|
|
2287
|
+
]);
|
|
2288
|
+
const handleQuery = (0, import_react.useCallback)(async ({ field, props }, text) => {
|
|
2289
|
+
if (model && props.referenceSchema && field.referencePath) {
|
|
2290
|
+
const space = model.space;
|
|
2291
|
+
(0, import_invariant.invariant)(space, void 0, {
|
|
2292
|
+
F: __dxlog_file5,
|
|
2293
|
+
L: 309,
|
|
2294
|
+
S: void 0,
|
|
2295
|
+
A: [
|
|
2296
|
+
"space",
|
|
2297
|
+
""
|
|
2298
|
+
]
|
|
2299
|
+
});
|
|
2300
|
+
const schema2 = space.db.schemaRegistry.getSchema(props.referenceSchema);
|
|
2301
|
+
if (schema2) {
|
|
2302
|
+
const { objects } = await space.db.query(import_echo.Filter.type(schema2)).run();
|
|
2303
|
+
const options = objects.map((obj) => {
|
|
2304
|
+
const value = (0, import_echo_schema.getValue)(obj, field.referencePath);
|
|
2305
|
+
if (!value || typeof value !== "string") {
|
|
2306
|
+
return void 0;
|
|
2307
|
+
}
|
|
2308
|
+
return {
|
|
2309
|
+
label: value,
|
|
2310
|
+
data: obj
|
|
2311
|
+
};
|
|
2312
|
+
}).filter(import_util.isNotFalsy);
|
|
2313
|
+
return [
|
|
2314
|
+
...options,
|
|
2315
|
+
{
|
|
2316
|
+
label: t("create new object label", {
|
|
2317
|
+
text
|
|
2318
|
+
}),
|
|
2319
|
+
data: createOption(text)
|
|
2320
|
+
}
|
|
2321
|
+
];
|
|
2322
|
+
}
|
|
2100
2323
|
}
|
|
2324
|
+
return [];
|
|
2325
|
+
}, [
|
|
2326
|
+
model,
|
|
2327
|
+
t
|
|
2328
|
+
]);
|
|
2329
|
+
if (!model || !modals) {
|
|
2330
|
+
return /* @__PURE__ */ import_react.default.createElement("span", {
|
|
2331
|
+
role: "none",
|
|
2332
|
+
className: "attention-surface"
|
|
2333
|
+
});
|
|
2101
2334
|
}
|
|
2102
|
-
return
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
})
|
|
2335
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react_ui_grid.Grid.Root, {
|
|
2336
|
+
id: model.id ?? "table-grid"
|
|
2337
|
+
}, /* @__PURE__ */ import_react.default.createElement(TableValueEditor, {
|
|
2338
|
+
model,
|
|
2339
|
+
modals,
|
|
2340
|
+
schema,
|
|
2341
|
+
onEnter: handleEnter,
|
|
2342
|
+
onFocus: handleFocus,
|
|
2343
|
+
onQuery: handleQuery
|
|
2344
|
+
}), /* @__PURE__ */ import_react.default.createElement(import_react_ui_grid.Grid.Content, {
|
|
2345
|
+
className: (0, import_react_ui_theme.mx)("[--dx-grid-base:var(--baseSurface)]", import_react_ui_grid.gridSeparatorInlineEnd, import_react_ui_grid.gridSeparatorBlockEnd),
|
|
2346
|
+
frozen,
|
|
2347
|
+
// getCells={getCells}
|
|
2348
|
+
columns: model.columnMeta.value,
|
|
2349
|
+
limitRows: model.getRowCount() ?? 0,
|
|
2350
|
+
limitColumns: model.view?.fields?.length ?? 0,
|
|
2351
|
+
overscroll: "trap",
|
|
2352
|
+
onAxisResize: handleAxisResize,
|
|
2353
|
+
onClick: handleGridClick,
|
|
2354
|
+
onKeyDown: handleKeyDown,
|
|
2355
|
+
onWheelCapture: handleWheel,
|
|
2356
|
+
ref: setDxGrid
|
|
2357
|
+
}), /* @__PURE__ */ import_react.default.createElement(RowActionsMenu, {
|
|
2358
|
+
model,
|
|
2359
|
+
modals
|
|
2360
|
+
}), /* @__PURE__ */ import_react.default.createElement(ColumnActionsMenu, {
|
|
2361
|
+
model,
|
|
2362
|
+
modals
|
|
2363
|
+
}), /* @__PURE__ */ import_react.default.createElement(ColumnSettings, {
|
|
2364
|
+
model,
|
|
2365
|
+
modals,
|
|
2366
|
+
onNewColumn: handleNewColumn
|
|
2367
|
+
}), /* @__PURE__ */ import_react.default.createElement(CreateRefPanel, {
|
|
2368
|
+
model,
|
|
2369
|
+
modals
|
|
2370
|
+
}));
|
|
2371
|
+
} finally {
|
|
2372
|
+
_effect.f();
|
|
2112
2373
|
}
|
|
2113
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react_ui_grid.Grid.Root, {
|
|
2114
|
-
id: model.id ?? "table-grid"
|
|
2115
|
-
}, /* @__PURE__ */ import_react.default.createElement(TableCellEditor, {
|
|
2116
|
-
model,
|
|
2117
|
-
modals,
|
|
2118
|
-
onEnter: handleEnter,
|
|
2119
|
-
onFocus: handleFocus,
|
|
2120
|
-
onQuery: handleQuery
|
|
2121
|
-
}), /* @__PURE__ */ import_react.default.createElement(import_react_ui_grid.Grid.Content, {
|
|
2122
|
-
className: (0, import_react_ui_theme.mx)("[--dx-grid-base:var(--surface-bg)]", import_react_ui_grid.gridSeparatorInlineEnd, import_react_ui_grid.gridSeparatorBlockEnd),
|
|
2123
|
-
frozen,
|
|
2124
|
-
// getCells={getCells}
|
|
2125
|
-
columns: model.columnMeta.value,
|
|
2126
|
-
limitRows: model.getRowCount() ?? 0,
|
|
2127
|
-
limitColumns: model.view?.fields?.length ?? 0,
|
|
2128
|
-
overscroll: "trap",
|
|
2129
|
-
onAxisResize: handleAxisResize,
|
|
2130
|
-
onClick: handleGridClick,
|
|
2131
|
-
onKeyDown: handleKeyDown,
|
|
2132
|
-
onWheelCapture: handleWheel,
|
|
2133
|
-
ref: setDxGrid
|
|
2134
|
-
}), /* @__PURE__ */ import_react.default.createElement(RowActionsMenu, {
|
|
2135
|
-
model,
|
|
2136
|
-
modals
|
|
2137
|
-
}), /* @__PURE__ */ import_react.default.createElement(ColumnActionsMenu, {
|
|
2138
|
-
model,
|
|
2139
|
-
modals
|
|
2140
|
-
}), /* @__PURE__ */ import_react.default.createElement(ColumnSettings, {
|
|
2141
|
-
model,
|
|
2142
|
-
modals,
|
|
2143
|
-
onNewColumn: handleNewColumn
|
|
2144
|
-
}), /* @__PURE__ */ import_react.default.createElement(CreateRefPanel, {
|
|
2145
|
-
model,
|
|
2146
|
-
modals
|
|
2147
|
-
}));
|
|
2148
2374
|
});
|
|
2149
2375
|
var Table = {
|
|
2150
2376
|
Root: TableRoot,
|
|
2151
2377
|
Main: TableMain
|
|
2152
2378
|
};
|
|
2153
2379
|
var useTableModel = ({ table, projection, rows, rowActions, features, onSelectionChanged, onRowAction, ...props }) => {
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
model2
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2380
|
+
var _effect = (0, import_tracking9.useSignals)();
|
|
2381
|
+
try {
|
|
2382
|
+
const [model, setModel] = (0, import_react9.useState)();
|
|
2383
|
+
(0, import_react9.useEffect)(() => {
|
|
2384
|
+
if (!table || !projection) {
|
|
2385
|
+
return;
|
|
2386
|
+
}
|
|
2387
|
+
let model2;
|
|
2388
|
+
const t = setTimeout(async () => {
|
|
2389
|
+
model2 = new TableModel({
|
|
2390
|
+
id: (0, import_echo4.fullyQualifiedId)(table),
|
|
2391
|
+
space: (0, import_echo4.getSpace)(table),
|
|
2392
|
+
view: table.view?.target,
|
|
2393
|
+
projection,
|
|
2394
|
+
features,
|
|
2395
|
+
rowActions,
|
|
2396
|
+
onRowAction,
|
|
2397
|
+
...props
|
|
2398
|
+
});
|
|
2399
|
+
await model2.open();
|
|
2400
|
+
setModel(model2);
|
|
2170
2401
|
});
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
model
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
model
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2402
|
+
return () => {
|
|
2403
|
+
clearTimeout(t);
|
|
2404
|
+
void model2?.close();
|
|
2405
|
+
};
|
|
2406
|
+
}, [
|
|
2407
|
+
table,
|
|
2408
|
+
projection,
|
|
2409
|
+
table?.view?.target,
|
|
2410
|
+
features,
|
|
2411
|
+
rowActions
|
|
2412
|
+
]);
|
|
2413
|
+
(0, import_react9.useEffect)(() => {
|
|
2414
|
+
if (rows) {
|
|
2415
|
+
model?.setRows(rows);
|
|
2416
|
+
}
|
|
2417
|
+
}, [
|
|
2418
|
+
model,
|
|
2419
|
+
rows
|
|
2420
|
+
]);
|
|
2421
|
+
const { multiSelect, clear } = (0, import_react_ui_attention2.useSelectionActions)([
|
|
2422
|
+
table?.id,
|
|
2423
|
+
table?.view?.target?.query.typename
|
|
2424
|
+
].filter(import_util3.isNonNullable));
|
|
2425
|
+
(0, import_react9.useEffect)(() => {
|
|
2426
|
+
if (!model) {
|
|
2427
|
+
return;
|
|
2428
|
+
}
|
|
2429
|
+
const unsubscribe = (0, import_signals_core6.effect)(() => {
|
|
2430
|
+
const selectedItems = [
|
|
2431
|
+
...model.selection.selection.value
|
|
2432
|
+
];
|
|
2433
|
+
multiSelect(selectedItems);
|
|
2434
|
+
onSelectionChanged?.(selectedItems);
|
|
2435
|
+
});
|
|
2436
|
+
return () => {
|
|
2437
|
+
clear();
|
|
2438
|
+
unsubscribe();
|
|
2439
|
+
};
|
|
2440
|
+
}, [
|
|
2441
|
+
model,
|
|
2442
|
+
onSelectionChanged
|
|
2443
|
+
]);
|
|
2444
|
+
return model;
|
|
2445
|
+
} finally {
|
|
2446
|
+
_effect.f();
|
|
2447
|
+
}
|
|
2217
2448
|
};
|
|
2218
2449
|
var DynamicTable = ({ classNames, name = "example.com/dynamic-table", rows, properties, jsonSchema, schema, rowActions, onRowClick, onRowAction, ...props }) => {
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2450
|
+
var _effect = (0, import_tracking8.useSignals)();
|
|
2451
|
+
try {
|
|
2452
|
+
const { table, projection } = (0, import_react8.useMemo)(() => {
|
|
2453
|
+
const props2 = getBaseSchema({
|
|
2454
|
+
typename: name,
|
|
2455
|
+
properties,
|
|
2456
|
+
jsonSchema,
|
|
2457
|
+
schema
|
|
2458
|
+
});
|
|
2459
|
+
return makeDynamicTable({
|
|
2460
|
+
...props2,
|
|
2461
|
+
properties
|
|
2462
|
+
});
|
|
2463
|
+
}, [
|
|
2464
|
+
name,
|
|
2222
2465
|
properties,
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2466
|
+
schema,
|
|
2467
|
+
jsonSchema
|
|
2468
|
+
]);
|
|
2469
|
+
const tableRef = (0, import_react8.useRef)(null);
|
|
2470
|
+
const handleCellUpdate = (0, import_react8.useCallback)((cell) => {
|
|
2471
|
+
tableRef.current?.update?.(cell);
|
|
2472
|
+
}, []);
|
|
2473
|
+
const handleRowOrderChange = (0, import_react8.useCallback)(() => {
|
|
2474
|
+
tableRef.current?.update?.();
|
|
2475
|
+
}, []);
|
|
2476
|
+
const features = (0, import_react_ui8.useDefaultValue)(props.features, () => ({
|
|
2477
|
+
selection: {
|
|
2478
|
+
enabled: false
|
|
2479
|
+
},
|
|
2480
|
+
dataEditable: false
|
|
2481
|
+
}));
|
|
2482
|
+
const model = useTableModel({
|
|
2483
|
+
table,
|
|
2484
|
+
rows,
|
|
2485
|
+
projection,
|
|
2486
|
+
features,
|
|
2487
|
+
rowActions,
|
|
2488
|
+
onCellUpdate: handleCellUpdate,
|
|
2489
|
+
onRowOrderChange: handleRowOrderChange,
|
|
2490
|
+
onRowAction
|
|
2229
2491
|
});
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
features,
|
|
2254
|
-
rowActions,
|
|
2255
|
-
onCellUpdate: handleCellUpdate,
|
|
2256
|
-
onRowOrderChange: handleRowOrderChange,
|
|
2257
|
-
onRowAction
|
|
2258
|
-
});
|
|
2259
|
-
const presentation = (0, import_react7.useMemo)(() => {
|
|
2260
|
-
if (model) {
|
|
2261
|
-
return new TablePresentation(model);
|
|
2262
|
-
}
|
|
2263
|
-
}, [
|
|
2264
|
-
model
|
|
2265
|
-
]);
|
|
2266
|
-
return /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
2267
|
-
role: "none",
|
|
2268
|
-
className: (0, import_react_ui_theme3.mx)("is-full bs-full grow grid", classNames)
|
|
2269
|
-
}, /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
2270
|
-
role: "none",
|
|
2271
|
-
className: "grid min-bs-0 overflow-hidden"
|
|
2272
|
-
}, /* @__PURE__ */ import_react7.default.createElement(Table.Root, null, /* @__PURE__ */ import_react7.default.createElement(Table.Main, {
|
|
2273
|
-
ref: tableRef,
|
|
2274
|
-
model,
|
|
2275
|
-
presentation,
|
|
2276
|
-
ignoreAttention: true,
|
|
2277
|
-
onRowClick
|
|
2278
|
-
}))));
|
|
2492
|
+
const presentation = (0, import_react8.useMemo)(() => {
|
|
2493
|
+
if (model) {
|
|
2494
|
+
return new TablePresentation(model);
|
|
2495
|
+
}
|
|
2496
|
+
}, [
|
|
2497
|
+
model
|
|
2498
|
+
]);
|
|
2499
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
2500
|
+
role: "none",
|
|
2501
|
+
className: (0, import_react_ui_theme3.mx)("is-full bs-full grow grid", classNames)
|
|
2502
|
+
}, /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
2503
|
+
role: "none",
|
|
2504
|
+
className: "grid min-bs-0 overflow-hidden"
|
|
2505
|
+
}, /* @__PURE__ */ import_react8.default.createElement(Table.Root, null, /* @__PURE__ */ import_react8.default.createElement(Table.Main, {
|
|
2506
|
+
ref: tableRef,
|
|
2507
|
+
model,
|
|
2508
|
+
presentation,
|
|
2509
|
+
ignoreAttention: true,
|
|
2510
|
+
onRowClick
|
|
2511
|
+
}))));
|
|
2512
|
+
} finally {
|
|
2513
|
+
_effect.f();
|
|
2514
|
+
}
|
|
2279
2515
|
};
|
|
2280
|
-
var createTableToolbarActions = (state) => {
|
|
2281
|
-
const add = (0, import_react_ui_menu.createMenuAction)("add-row", {
|
|
2516
|
+
var createTableToolbarActions = ({ state, onAdd, onSave, customActions }) => import_rx_react.Rx.make((get) => {
|
|
2517
|
+
const add = (0, import_react_ui_menu.createMenuAction)("add-row", onAdd, {
|
|
2282
2518
|
type: "add-row",
|
|
2283
2519
|
icon: "ph--plus--regular",
|
|
2284
2520
|
label: [
|
|
@@ -2289,7 +2525,7 @@ var createTableToolbarActions = (state) => {
|
|
|
2289
2525
|
],
|
|
2290
2526
|
testId: "table.toolbar.add-row"
|
|
2291
2527
|
});
|
|
2292
|
-
const save = (0, import_react_ui_menu.createMenuAction)("save-view", {
|
|
2528
|
+
const save = (0, import_react_ui_menu.createMenuAction)("save-view", onSave, {
|
|
2293
2529
|
type: "save-view",
|
|
2294
2530
|
icon: "ph--floppy-disk--regular",
|
|
2295
2531
|
label: [
|
|
@@ -2300,49 +2536,55 @@ var createTableToolbarActions = (state) => {
|
|
|
2300
2536
|
],
|
|
2301
2537
|
testId: "table.toolbar.save-view",
|
|
2302
2538
|
iconOnly: false,
|
|
2303
|
-
hidden: !state.viewDirty
|
|
2539
|
+
hidden: get((0, import_react_ui_menu2.rxFromSignal)(() => !state.viewDirty))
|
|
2304
2540
|
});
|
|
2305
2541
|
const gap = (0, import_react_ui_menu.createGapSeparator)();
|
|
2306
|
-
const comment = (0, import_react_ui_menu.createMenuAction)("comment", {
|
|
2307
|
-
type: "comment",
|
|
2308
|
-
icon: "ph--chat-text--regular",
|
|
2309
|
-
label: [
|
|
2310
|
-
"create comment",
|
|
2311
|
-
{
|
|
2312
|
-
ns: translationKey
|
|
2313
|
-
}
|
|
2314
|
-
],
|
|
2315
|
-
testId: "table.toolbar.comment"
|
|
2316
|
-
});
|
|
2317
2542
|
const nodes = [
|
|
2318
2543
|
add,
|
|
2319
2544
|
save,
|
|
2320
|
-
...gap.nodes
|
|
2321
|
-
comment
|
|
2545
|
+
...gap.nodes
|
|
2322
2546
|
];
|
|
2547
|
+
const edges = nodes.map(({ id: target }) => ({
|
|
2548
|
+
source: "root",
|
|
2549
|
+
target
|
|
2550
|
+
}));
|
|
2551
|
+
if (customActions) {
|
|
2552
|
+
const custom = get(customActions);
|
|
2553
|
+
nodes.push(...custom.nodes);
|
|
2554
|
+
edges.push(...custom.edges);
|
|
2555
|
+
}
|
|
2323
2556
|
return {
|
|
2324
2557
|
nodes,
|
|
2325
|
-
edges
|
|
2326
|
-
source: "root",
|
|
2327
|
-
target
|
|
2328
|
-
}))
|
|
2558
|
+
edges
|
|
2329
2559
|
};
|
|
2330
|
-
};
|
|
2331
|
-
var TableToolbar = ({ classNames, viewDirty, attendableId,
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2560
|
+
});
|
|
2561
|
+
var TableToolbar = ({ classNames, viewDirty, attendableId, onAdd, onSave, customActions }) => {
|
|
2562
|
+
var _effect = (0, import_tracking10.useSignals)();
|
|
2563
|
+
try {
|
|
2564
|
+
const state = (0, import_react10.useMemo)(() => (0, import_live_object3.live)({
|
|
2565
|
+
viewDirty
|
|
2566
|
+
}), []);
|
|
2567
|
+
const actionsCreator = (0, import_react10.useMemo)(() => createTableToolbarActions({
|
|
2568
|
+
state,
|
|
2569
|
+
onAdd,
|
|
2570
|
+
onSave,
|
|
2571
|
+
customActions
|
|
2572
|
+
}), [
|
|
2573
|
+
state,
|
|
2574
|
+
onAdd,
|
|
2575
|
+
onSave,
|
|
2576
|
+
customActions
|
|
2577
|
+
]);
|
|
2578
|
+
const menu = (0, import_react_ui_menu.useMenuActions)(actionsCreator);
|
|
2579
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_react_ui_menu.MenuProvider, {
|
|
2580
|
+
...menu,
|
|
2581
|
+
attendableId
|
|
2582
|
+
}, /* @__PURE__ */ import_react10.default.createElement(import_react_ui_menu.ToolbarMenu, {
|
|
2583
|
+
classNames
|
|
2584
|
+
}));
|
|
2585
|
+
} finally {
|
|
2586
|
+
_effect.f();
|
|
2587
|
+
}
|
|
2346
2588
|
};
|
|
2347
2589
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2348
2590
|
0 && (module.exports = {
|
|
@@ -2359,9 +2601,10 @@ var TableToolbar = ({ classNames, viewDirty, attendableId, onAction }) => {
|
|
|
2359
2601
|
TableToolbar,
|
|
2360
2602
|
TableType,
|
|
2361
2603
|
cellClassesForRowSelection,
|
|
2362
|
-
|
|
2604
|
+
getBaseSchema,
|
|
2363
2605
|
initializeTable,
|
|
2364
2606
|
makeDynamicTable,
|
|
2607
|
+
narrowSchema,
|
|
2365
2608
|
tableButtons,
|
|
2366
2609
|
tableControls,
|
|
2367
2610
|
touch,
|