@dxos/react-ui-table 0.12.0-next-73daef452f1464b62efdbca75fb0067c1066f264 → 0.13.0
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/chunk-types.mjs +5 -6
- package/dist/lib/chunk-types.mjs.map +1 -1
- package/dist/lib/chunk-useTableModel.mjs +21 -22
- package/dist/lib/chunk-useTableModel.mjs.map +1 -1
- package/dist/lib/index.mjs +89 -66
- package/dist/lib/index.mjs.map +1 -1
- package/dist/lib/testing.mjs.map +1 -1
- package/dist/lib/translations.mjs.map +1 -1
- package/dist/types/src/components/Table/ColumnActionsMenu.d.ts +1 -1
- package/dist/types/src/components/Table/ColumnActionsMenu.d.ts.map +1 -1
- package/dist/types/src/components/Table/ColumnSettings.d.ts +1 -1
- package/dist/types/src/components/Table/ColumnSettings.d.ts.map +1 -1
- package/dist/types/src/components/Table/DynamicTable.d.ts +4 -4
- package/dist/types/src/components/Table/DynamicTable.d.ts.map +1 -1
- package/dist/types/src/components/Table/DynamicTable.stories.d.ts +1 -1
- package/dist/types/src/components/Table/DynamicTable.stories.d.ts.map +1 -1
- package/dist/types/src/components/Table/Relations.stories.d.ts +4 -2
- package/dist/types/src/components/Table/Relations.stories.d.ts.map +1 -1
- package/dist/types/src/components/Table/RowActionsMenu.d.ts +1 -1
- package/dist/types/src/components/Table/RowActionsMenu.d.ts.map +1 -1
- package/dist/types/src/components/Table/Table.d.ts +4 -4
- package/dist/types/src/components/Table/Table.d.ts.map +1 -1
- package/dist/types/src/components/Table/Table.stories.d.ts +4 -2
- package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
- package/dist/types/src/components/Table/TableContent.d.ts +2 -2
- package/dist/types/src/components/Table/TableContent.d.ts.map +1 -1
- package/dist/types/src/components/Table/TableContext.d.ts +2 -2
- package/dist/types/src/components/Table/TableContext.d.ts.map +1 -1
- package/dist/types/src/components/Table/TableToolbar.d.ts +3 -3
- package/dist/types/src/components/Table/TableToolbar.d.ts.map +1 -1
- package/dist/types/src/components/Table/index.d.ts +3 -3
- package/dist/types/src/components/Table/index.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/CellValidationMessage.d.ts +1 -2
- package/dist/types/src/components/TableCellEditor/CellValidationMessage.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts +2 -3
- package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts +4 -5
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/index.d.ts +2 -2
- package/dist/types/src/components/TableCellEditor/index.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +3 -3
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useAddRow.d.ts +1 -1
- package/dist/types/src/hooks/useAddRow.d.ts.map +1 -1
- package/dist/types/src/hooks/useProjectionModel.d.ts +2 -2
- package/dist/types/src/hooks/useProjectionModel.d.ts.map +1 -1
- package/dist/types/src/hooks/useTableModel.d.ts +2 -2
- package/dist/types/src/hooks/useTableModel.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +4 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/model/index.d.ts +5 -5
- package/dist/types/src/model/index.d.ts.map +1 -1
- package/dist/types/src/model/modal-controller.d.ts +2 -2
- package/dist/types/src/model/modal-controller.d.ts.map +1 -1
- package/dist/types/src/model/selection-model.d.ts +3 -3
- package/dist/types/src/model/selection-model.d.ts.map +1 -1
- package/dist/types/src/model/table-model.d.ts +12 -13
- package/dist/types/src/model/table-model.d.ts.map +1 -1
- package/dist/types/src/model/table-presentation.d.ts +3 -3
- package/dist/types/src/model/table-presentation.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/useTestTableModel.d.ts +3 -3
- package/dist/types/src/testing/useTestTableModel.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Table.d.ts +2 -3
- package/dist/types/src/types/Table.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util/dynamic-table.d.ts +2 -2
- package/dist/types/src/util/dynamic-table.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +7 -7
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +40 -37
- package/src/components/Table/ColumnActionsMenu.tsx +48 -44
- package/src/components/Table/ColumnSettings.tsx +19 -18
- package/src/components/Table/DynamicTable.stories.tsx +3 -4
- package/src/components/Table/DynamicTable.tsx +9 -8
- package/src/components/Table/Relations.stories.tsx +8 -9
- package/src/components/Table/RowActionsMenu.tsx +44 -37
- package/src/components/Table/Table.stories.tsx +18 -15
- package/src/components/Table/Table.tsx +6 -6
- package/src/components/Table/TableContent.tsx +13 -13
- package/src/components/Table/TableContext.ts +3 -2
- package/src/components/Table/TableToolbar.tsx +7 -11
- package/src/components/Table/index.ts +3 -3
- package/src/components/TableCellEditor/CellValidationMessage.tsx +3 -7
- package/src/components/TableCellEditor/FormCellEditor.tsx +39 -39
- package/src/components/TableCellEditor/TableCellEditor.stories.tsx +3 -3
- package/src/components/TableCellEditor/TableCellEditor.tsx +9 -18
- package/src/components/TableCellEditor/index.ts +2 -2
- package/src/components/index.ts +1 -1
- package/src/hooks/index.ts +3 -3
- package/src/hooks/useAddRow.ts +1 -1
- package/src/hooks/useProjectionModel.ts +4 -4
- package/src/hooks/useTableModel.ts +2 -2
- package/src/index.ts +4 -4
- package/src/model/index.ts +5 -5
- package/src/model/modal-controller.ts +2 -2
- package/src/model/selection-model.ts +3 -3
- package/src/model/table-model.test.ts +3 -3
- package/src/model/table-model.ts +26 -22
- package/src/model/table-presentation.test.ts +4 -4
- package/src/model/table-presentation.ts +10 -10
- package/src/playwright/TableManager.ts +1 -1
- package/src/playwright/smoke.spec.ts +28 -32
- package/src/testing/index.ts +1 -1
- package/src/testing/useTestTableModel.ts +4 -4
- package/src/translations.ts +2 -2
- package/src/types/Table.ts +10 -7
- package/src/types/index.ts +1 -1
- package/src/util/dynamic-table.test.ts +2 -2
- package/src/util/dynamic-table.ts +2 -2
- package/src/util/index.ts +7 -7
- package/src/util/schema.ts +1 -1
- package/src/util/table-buttons.ts +1 -1
- package/src/util/table-controls.ts +2 -2
package/dist/lib/chunk-types.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Annotation, DXN, JsonSchema, Obj, Ref, Type, View } from "@dxos/echo";
|
|
2
|
-
import { SchemaAST } from "@dxos/effect";
|
|
3
2
|
import { ViewAnnotation } from "@dxos/schema";
|
|
4
3
|
import * as Schema from "effect/Schema";
|
|
5
|
-
import
|
|
4
|
+
import * as SchemaAST from "@dxos/effect/SchemaAST";
|
|
6
5
|
//#region \0rolldown/runtime.js
|
|
7
6
|
var __defProp = Object.defineProperty;
|
|
8
7
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -22,12 +21,12 @@ var Table_exports = /* @__PURE__ */ __exportAll({
|
|
|
22
21
|
});
|
|
23
22
|
var Table = class extends Type.makeObject(DXN.make("org.dxos.type.table", "0.1.0"))(Schema.Struct({
|
|
24
23
|
name: Schema.String.pipe(Schema.optional),
|
|
25
|
-
view: Ref.Ref(View.View).pipe(FormInputAnnotation.set(false)),
|
|
26
|
-
sizes: Schema.Record(Schema.String, Schema.Number).pipe(Schema.mutableKey, FormInputAnnotation.set(false))
|
|
27
|
-
}).pipe(LabelAnnotation.set(["name"]), ViewAnnotation.set(["view"]), Annotation.IconAnnotation.set({
|
|
24
|
+
view: Ref.Ref(View.View).pipe(Annotation.FormInputAnnotation.set(false)),
|
|
25
|
+
sizes: Schema.Record(Schema.String, Schema.Number).pipe(Schema.mutableKey, Annotation.FormInputAnnotation.set(false))
|
|
26
|
+
}).pipe(Annotation.LabelAnnotation.set(["name"]), ViewAnnotation.set(["view"]), Annotation.IconAnnotation.set({
|
|
28
27
|
icon: "ph--table--regular",
|
|
29
28
|
hue: "green"
|
|
30
|
-
}))) {};
|
|
29
|
+
}), Annotation.UserType.set())) {};
|
|
31
30
|
/**
|
|
32
31
|
* Make a table as a view of a data set.
|
|
33
32
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-types.mjs","names":[],"sources":["../../src/types/Table.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\n// QueryAST is referenced indirectly through `Type.InstanceType<typeof TableSchema>`\n// (Ref.Ref(View.View) → View.View → QueryAST.Query) in the emitted .d.ts; the\n// namespace import keeps the inferred types portable.\n// eslint-disable-next-line unused-imports/no-unused-imports\nimport { Annotation, DXN, JsonSchema, Obj, QueryAST, Ref, Type, View } from '@dxos/echo';\nimport
|
|
1
|
+
{"version":3,"file":"chunk-types.mjs","names":[],"sources":["../../src/types/Table.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\n// QueryAST is referenced indirectly through `Type.InstanceType<typeof TableSchema>`\n// (Ref.Ref(View.View) → View.View → QueryAST.Query) in the emitted .d.ts; the\n// namespace import keeps the inferred types portable.\n// eslint-disable-next-line unused-imports/no-unused-imports\nimport { Annotation, DXN, JsonSchema, Obj, QueryAST, Ref, Type, View } from '@dxos/echo';\nimport * as SchemaAST from '@dxos/effect/SchemaAST';\nimport * as SchemaEx from '@dxos/effect/SchemaEx';\nimport { ViewAnnotation } from '@dxos/schema';\n\n// TODO(wittjosiah): Try to clean up this type inference.\nexport class Table extends Type.makeObject<Table>(DXN.make('org.dxos.type.table', '0.1.0'))(\n Schema.Struct({\n name: Schema.String.pipe(Schema.optional),\n\n view: Ref.Ref(View.View).pipe(Annotation.FormInputAnnotation.set(false)),\n\n // TODO(wittjosiah): Key should be JsonPath.\n sizes: Schema.Record(Schema.String, Schema.Number).pipe(\n Schema.mutableKey,\n Annotation.FormInputAnnotation.set(false),\n ),\n }).pipe(\n Annotation.LabelAnnotation.set(['name']),\n ViewAnnotation.set(['view']),\n Annotation.IconAnnotation.set({ icon: 'ph--table--regular', hue: 'green' }),\n Annotation.UserType.set(),\n ),\n) {}\n\ntype MakeProps = {\n name?: string;\n sizes?: Record<string, number>;\n view: View.View;\n /** Required to auto-size columns. */\n jsonSchema?: JsonSchema.JsonSchema;\n};\n\n/**\n * Make a table as a view of a data set.\n */\nexport const make = ({ name, sizes = {}, view, jsonSchema }: MakeProps): Table => {\n // Preset sizes are computed before construction: Effect 4 records are readonly at the type level,\n // so the defaults go in as initial props rather than being assigned onto the live object.\n const initialSizes: Record<string, number> = { ...sizes };\n if (jsonSchema) {\n const schema = JsonSchema.toEffectSchema(jsonSchema);\n for (const property of SchemaAST.getPropertySignatures(schema.ast)) {\n const name = property.name.toString() as SchemaEx.JsonPath;\n if (initialSizes[name] !== undefined) {\n continue;\n }\n\n // A plain switch rather than `Match.when({ _tag })`: matching an object pattern against\n // Effect 4's mutually recursive AST union expands into a mapped type the checker cannot resolve.\n switch (property.type._tag) {\n case 'Boolean':\n case 'Number':\n initialSizes[name] = 100;\n break;\n }\n }\n }\n\n return Obj.make(Table, { name, view: Ref.make(view), sizes: initialSizes } as Obj.MakeProps<typeof Table>);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgBA,IAAa,QAAb,cAA2B,KAAK,WAAkB,IAAI,KAAK,uBAAuB,OAAO,CAAC,CAAC,CACzF,OAAO,OAAO;CACZ,MAAM,OAAO,OAAO,KAAK,OAAO,QAAQ;CAExC,MAAM,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC,KAAK,WAAW,oBAAoB,IAAI,KAAK,CAAC;CAGvE,OAAO,OAAO,OAAO,OAAO,QAAQ,OAAO,MAAM,CAAC,CAAC,KACjD,OAAO,YACP,WAAW,oBAAoB,IAAI,KAAK,CAC1C;AACF,CAAC,CAAC,CAAC,KACD,WAAW,gBAAgB,IAAI,CAAC,MAAM,CAAC,GACvC,eAAe,IAAI,CAAC,MAAM,CAAC,GAC3B,WAAW,eAAe,IAAI;CAAE,MAAM;CAAsB,KAAK;AAAQ,CAAC,GAC1E,WAAW,SAAS,IAAI,CAC1B,CACF,CAAC,CAAC,CAAC;;;;AAaH,IAAa,QAAQ,EAAE,MAAM,QAAQ,CAAC,GAAG,MAAM,iBAAmC;CAGhF,MAAM,eAAuC,EAAE,GAAG,MAAM;CACxD,IAAI,YAAY;EACd,MAAM,SAAS,WAAW,eAAe,UAAU;EACnD,KAAK,MAAM,YAAY,UAAU,sBAAsB,OAAO,GAAG,GAAG;GAClE,MAAM,OAAO,SAAS,KAAK,SAAS;GACpC,IAAI,aAAa,UAAU,KAAA,GACzB;GAKF,QAAQ,SAAS,KAAK,MAAtB;IACE,KAAK;IACL,KAAK,UACH,aAAa,QAAQ;GAEzB;EACF;CACF;CAEA,OAAO,IAAI,KAAK,OAAO;EAAE;EAAM,MAAM,IAAI,KAAK,IAAI;EAAG,OAAO;CAAa,CAAgC;AAC3G"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import * as Atom from "effect/
|
|
1
|
+
import * as Atom from "effect/reactivity/Atom";
|
|
2
2
|
import { useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
3
3
|
import { RegistryContext } from "@effect/atom-react/RegistryContext";
|
|
4
|
-
import { useAsyncEffect } from "@dxos/react-ui";
|
|
5
4
|
import { ViewState, useManagerOptional, useSelection, useSelectionActions } from "@dxos/react-ui-attention";
|
|
6
5
|
import { toPlaneCellIndex } from "@dxos/react-ui-grid";
|
|
7
6
|
import { mx } from "@dxos/ui-theme";
|
|
8
7
|
import { Resource } from "@dxos/context";
|
|
9
8
|
import { Format, Obj, Order, Query, QueryAST, Ref, Type } from "@dxos/echo";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { SchemaEx } from "@dxos/effect";
|
|
9
|
+
import * as JsonSchema$1 from "@dxos/echo/JsonSchema";
|
|
10
|
+
import * as SchemaEx from "@dxos/effect/SchemaEx";
|
|
13
11
|
import { invariant } from "@dxos/invariant";
|
|
14
12
|
import { EntityId } from "@dxos/keys";
|
|
15
13
|
import { cellClassesForFieldType, parseValue } from "@dxos/react-ui-form";
|
|
@@ -18,6 +16,7 @@ import * as Schema from "effect/Schema";
|
|
|
18
16
|
import { accessoryHandlesPointerdownAttrs } from "@dxos/lit-grid";
|
|
19
17
|
import * as Predicate from "effect/Predicate";
|
|
20
18
|
import { Format as Format$1, TypeEnum } from "@dxos/echo/Format";
|
|
19
|
+
import * as Hooks from "@dxos/react-ui/Hooks";
|
|
21
20
|
//#region src/util/query-ast.ts
|
|
22
21
|
/**
|
|
23
22
|
* Extracts order clauses from a query AST.
|
|
@@ -76,7 +75,7 @@ var BUTTON_IDENTIFIERS = {
|
|
|
76
75
|
sort: "data-table-sort-button"
|
|
77
76
|
};
|
|
78
77
|
var createButton = ({ attr, data, disabled = false, icon, testId, type: _type = "primary" }) => {
|
|
79
|
-
return `<div role="none" class="dx-grid__cell__block"><button ${attr} data-testid="${testId}" class="dx-
|
|
78
|
+
return `<div role="none" class="dx-grid__cell__block"><button ${attr} data-testid="${testId}" class="dx-control dx-button dx-button-square" data-size="sm" ${Object.entries(data).map(([k, v]) => `${k}="${v}"`).join(" ")} ${disabled ? "disabled" : ""} data-dx-grid-action="accessory"><svg data-size="4"><use href="/icons.svg#${icon}"/></svg></button></div>`;
|
|
80
79
|
};
|
|
81
80
|
var addColumnButton = {
|
|
82
81
|
attr: BUTTON_IDENTIFIERS.newColumn,
|
|
@@ -182,8 +181,8 @@ var CONTROL_IDENTIFIERS = {
|
|
|
182
181
|
switch: "data-table-switch"
|
|
183
182
|
};
|
|
184
183
|
var BASE_CLASSES = {
|
|
185
|
-
checkbox: "dx-checkbox",
|
|
186
|
-
switch: "dx-
|
|
184
|
+
checkbox: "dx-checkbox-native",
|
|
185
|
+
switch: "dx-switch-native"
|
|
187
186
|
};
|
|
188
187
|
var renderAttributes = (data) => {
|
|
189
188
|
return Object.entries(data).map(([k, v]) => `${k}="${v}"`).join(" ");
|
|
@@ -442,7 +441,7 @@ var TableModel = class extends Resource {
|
|
|
442
441
|
invariant(!(this._features.dataEditable && this._features.selection.enabled && this._features.selection.mode === "single"), "Single selection is not compatible with editable tables.", {
|
|
443
442
|
"~LogMeta": "~LogMeta",
|
|
444
443
|
F: __dxlog_file,
|
|
445
|
-
L:
|
|
444
|
+
L: 213,
|
|
446
445
|
S: this,
|
|
447
446
|
A: ["!(this._features.dataEditable && this._features.selection.enabled && this._features.selection.mode === 'single')", "'Single selection is not compatible with editable tables.'"]
|
|
448
447
|
});
|
|
@@ -515,7 +514,7 @@ var TableModel = class extends Resource {
|
|
|
515
514
|
invariant(view, "Table model not initialized", {
|
|
516
515
|
"~LogMeta": "~LogMeta",
|
|
517
516
|
F: __dxlog_file,
|
|
518
|
-
L:
|
|
517
|
+
L: 333,
|
|
519
518
|
S: this,
|
|
520
519
|
A: ["view", "'Table model not initialized'"]
|
|
521
520
|
});
|
|
@@ -632,7 +631,7 @@ var TableModel = class extends Resource {
|
|
|
632
631
|
invariant(this._columnMeta, void 0, {
|
|
633
632
|
"~LogMeta": "~LogMeta",
|
|
634
633
|
F: __dxlog_file,
|
|
635
|
-
L:
|
|
634
|
+
L: 475,
|
|
636
635
|
S: this,
|
|
637
636
|
A: ["this._columnMeta", ""]
|
|
638
637
|
});
|
|
@@ -654,7 +653,7 @@ var TableModel = class extends Resource {
|
|
|
654
653
|
invariant(this._object.view.target, "View must be loaded before initializing column meta", {
|
|
655
654
|
"~LogMeta": "~LogMeta",
|
|
656
655
|
F: __dxlog_file,
|
|
657
|
-
L:
|
|
656
|
+
L: 499,
|
|
658
657
|
S: this,
|
|
659
658
|
A: ["this._object.view.target", "'View must be loaded before initializing column meta'"]
|
|
660
659
|
});
|
|
@@ -782,7 +781,7 @@ var TableModel = class extends Resource {
|
|
|
782
781
|
this._registry.set(this._draftRows, newDraftRows);
|
|
783
782
|
}
|
|
784
783
|
validateDraftRowData(data) {
|
|
785
|
-
const schema = toEffectSchema(this._projection.baseSchema);
|
|
784
|
+
const schema = JsonSchema$1.toEffectSchema(this._projection.baseSchema);
|
|
786
785
|
return validateSchema(schema, data) || [];
|
|
787
786
|
}
|
|
788
787
|
commitDraftRow = (draftRowIndex) => {
|
|
@@ -868,17 +867,17 @@ var TableModel = class extends Resource {
|
|
|
868
867
|
invariant(currentRow, "Invalid row index", {
|
|
869
868
|
"~LogMeta": "~LogMeta",
|
|
870
869
|
F: __dxlog_file,
|
|
871
|
-
L:
|
|
870
|
+
L: 818,
|
|
872
871
|
S: this,
|
|
873
872
|
A: ["currentRow", "'Invalid row index'"]
|
|
874
873
|
});
|
|
875
|
-
const snapshot = { ...getSnapshot(currentRow) };
|
|
874
|
+
const snapshot = { ...Obj.getSnapshot(currentRow) };
|
|
876
875
|
SchemaEx.setValue(snapshot, field.path, transformedValue);
|
|
877
876
|
const type = Obj.getType(currentRow);
|
|
878
877
|
invariant(type, void 0, {
|
|
879
878
|
"~LogMeta": "~LogMeta",
|
|
880
879
|
F: __dxlog_file,
|
|
881
|
-
L:
|
|
880
|
+
L: 825,
|
|
882
881
|
S: this,
|
|
883
882
|
A: ["type", ""]
|
|
884
883
|
});
|
|
@@ -1170,18 +1169,18 @@ var TablePresentation = class {
|
|
|
1170
1169
|
return "Object";
|
|
1171
1170
|
};
|
|
1172
1171
|
cell.accessoryHtml = `<div class="flex flex-row gap-1 overflow-x-auto">${targetArray.map(getLabel).filter(Predicate.isNotNullish).map((title) => {
|
|
1173
|
-
return `<span class="dx-tag" data-hue="neutral">${title}</span>`;
|
|
1172
|
+
return `<span class="dx-tag dx-tag-inline" data-hue="neutral">${title}</span>`;
|
|
1174
1173
|
}).join("")}</div>`;
|
|
1175
1174
|
}
|
|
1176
1175
|
}
|
|
1177
1176
|
if (props.format === Format$1.TypeFormat.Ref && props.referenceSchema) {
|
|
1178
1177
|
const targetObj = SchemaEx.getValue(obj, field.path)?.target;
|
|
1179
|
-
if (targetObj) cell.accessoryHtml = `<div role="none" class="dx-grid__cell__block"><dx-anchor
|
|
1178
|
+
if (targetObj) cell.accessoryHtml = `<div role="none" class="dx-grid__cell__block"><dx-anchor eid=${Obj.getURI(targetObj)} class="dx-control dx-button dx-button-square" data-size="sm" data-variant="ghost" data-dx-grid-action="accessory"><dx-icon icon="ph--link-simple--regular"/></dx-anchor></div>`;
|
|
1180
1179
|
}
|
|
1181
1180
|
if (props.format === Format$1.TypeFormat.URL) {
|
|
1182
1181
|
const value = SchemaEx.getValue(obj, field.path);
|
|
1183
1182
|
const href = typeof value === "string" ? safeHttpUrl(value) : void 0;
|
|
1184
|
-
if (href) cell.accessoryHtml = `<div role="none" class="dx-grid__cell__block"><a href="${escapeHtmlAttribute(href)}" target="_blank" rel="noopener noreferrer" class="dx-
|
|
1183
|
+
if (href) cell.accessoryHtml = `<div role="none" class="dx-grid__cell__block"><a href="${escapeHtmlAttribute(href)}" target="_blank" rel="noopener noreferrer" class="dx-control dx-button dx-button-square" data-size="sm" data-variant="ghost" data-dx-grid-action="accessory"><dx-icon icon="ph--arrow-square-out--regular"/></a></div>`;
|
|
1185
1184
|
}
|
|
1186
1185
|
if (props.format === Format$1.TypeFormat.Boolean) {
|
|
1187
1186
|
const value = SchemaEx.getValue(obj, field.path);
|
|
@@ -1198,7 +1197,7 @@ var TablePresentation = class {
|
|
|
1198
1197
|
const options = this.model.projection.getFieldProjection(field.id).props.options;
|
|
1199
1198
|
if (options) {
|
|
1200
1199
|
const option = options.find((o) => o.id === value);
|
|
1201
|
-
if (option) cell.accessoryHtml = `<span class="dx-tag" data-hue="${option.color}">${option.title}</span>`;
|
|
1200
|
+
if (option) cell.accessoryHtml = `<span class="dx-tag dx-tag-inline" data-hue="${option.color}">${option.title}</span>`;
|
|
1202
1201
|
}
|
|
1203
1202
|
}
|
|
1204
1203
|
if (props.format === Format$1.TypeFormat.MultiSelect) {
|
|
@@ -1207,7 +1206,7 @@ var TablePresentation = class {
|
|
|
1207
1206
|
if (options && values && values.length > 0) {
|
|
1208
1207
|
const tags = values.map((value) => {
|
|
1209
1208
|
const option = options.find((o) => o.id === value);
|
|
1210
|
-
if (option) return `<span class="dx-tag" data-hue="${option.color}">${option.title}</span>`;
|
|
1209
|
+
if (option) return `<span class="dx-tag dx-tag-inline" data-hue="${option.color}">${option.title}</span>`;
|
|
1211
1210
|
return null;
|
|
1212
1211
|
}).filter(Boolean).join("");
|
|
1213
1212
|
if (tags) cell.accessoryHtml = tags;
|
|
@@ -1509,7 +1508,7 @@ var useAddRow = ({ db, schema }) => {
|
|
|
1509
1508
|
//#region src/hooks/useProjectionModel.ts
|
|
1510
1509
|
var useProjectionModel = (schema, table, registry) => {
|
|
1511
1510
|
const [projection, setProjection] = useState();
|
|
1512
|
-
useAsyncEffect(async () => {
|
|
1511
|
+
Hooks.useAsyncEffect(async () => {
|
|
1513
1512
|
if (schema && table) {
|
|
1514
1513
|
const view = await table.view.load();
|
|
1515
1514
|
const jsonSchema = schema.jsonSchema;
|