@dxos/react-ui-table 0.8.4-main.c1de068 → 0.8.4-main.c351d160a8
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-BF54SSNL.mjs +70 -0
- package/dist/lib/browser/chunk-BF54SSNL.mjs.map +7 -0
- package/dist/lib/browser/chunk-PTHMYAAM.mjs +1751 -0
- package/dist/lib/browser/chunk-PTHMYAAM.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1188 -1139
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +31 -38
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/browser/types/index.mjs +3 -3
- package/dist/lib/node-esm/chunk-GI72MQSG.mjs +1753 -0
- package/dist/lib/node-esm/chunk-GI72MQSG.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SIRDIPHZ.mjs +71 -0
- package/dist/lib/node-esm/chunk-SIRDIPHZ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1188 -1139
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +31 -38
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/types/index.mjs +3 -3
- package/dist/types/src/components/Table/ColumnActionsMenu.d.ts +2 -3
- package/dist/types/src/components/Table/ColumnActionsMenu.d.ts.map +1 -1
- package/dist/types/src/components/Table/ColumnSettings.d.ts +3 -3
- package/dist/types/src/components/Table/ColumnSettings.d.ts.map +1 -1
- package/dist/types/src/components/Table/DynamicTable.d.ts +7 -7
- package/dist/types/src/components/Table/DynamicTable.d.ts.map +1 -1
- package/dist/types/src/components/Table/DynamicTable.stories.d.ts +37 -3
- package/dist/types/src/components/Table/DynamicTable.stories.d.ts.map +1 -1
- package/dist/types/src/components/Table/Relations.stories.d.ts +111 -0
- package/dist/types/src/components/Table/Relations.stories.d.ts.map +1 -0
- 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 +16 -12
- package/dist/types/src/components/Table/Table.d.ts.map +1 -1
- package/dist/types/src/components/Table/Table.stories.d.ts +108 -4
- package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/CellValidationMessage.d.ts +1 -1
- package/dist/types/src/components/TableCellEditor/CellValidationMessage.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts +13 -9
- package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts +11 -18
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts +39 -4
- package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/index.d.ts +1 -0
- package/dist/types/src/components/TableCellEditor/index.d.ts.map +1 -1
- package/dist/types/src/components/TableToolbar/TableToolbar.d.ts +5 -5
- package/dist/types/src/components/TableToolbar/TableToolbar.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +23 -16
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useAddRow.d.ts +6 -6
- package/dist/types/src/hooks/useAddRow.d.ts.map +1 -1
- package/dist/types/src/hooks/useProjectionModel.d.ts +6 -0
- package/dist/types/src/hooks/useProjectionModel.d.ts.map +1 -0
- package/dist/types/src/hooks/useTableModel.d.ts +10 -10
- package/dist/types/src/hooks/useTableModel.d.ts.map +1 -1
- package/dist/types/src/model/modal-controller.d.ts +5 -8
- package/dist/types/src/model/modal-controller.d.ts.map +1 -1
- package/dist/types/src/model/selection-model.d.ts +17 -8
- package/dist/types/src/model/selection-model.d.ts.map +1 -1
- package/dist/types/src/model/table-model.d.ts +112 -30
- package/dist/types/src/model/table-model.d.ts.map +1 -1
- package/dist/types/src/model/table-presentation.d.ts +5 -2
- package/dist/types/src/model/table-presentation.d.ts.map +1 -1
- package/dist/types/src/playwright/TableManager.d.ts +2 -1
- package/dist/types/src/playwright/TableManager.d.ts.map +1 -1
- package/dist/types/src/testing/useTestTableModel.d.ts +18 -34
- package/dist/types/src/testing/useTestTableModel.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +4 -4
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Table.d.ts +26 -0
- package/dist/types/src/types/Table.d.ts.map +1 -0
- 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 +14 -12
- package/dist/types/src/util/dynamic-table.d.ts.map +1 -1
- package/dist/types/src/util/dynamic-table.test.d.ts +2 -0
- package/dist/types/src/util/dynamic-table.test.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +2 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/query-ast.d.ts +7 -0
- package/dist/types/src/util/query-ast.d.ts.map +1 -0
- package/dist/types/src/util/schema.d.ts +1 -1
- package/dist/types/src/util/schema.d.ts.map +1 -1
- package/dist/types/src/util/sort.d.ts +12 -0
- package/dist/types/src/util/sort.d.ts.map +1 -0
- package/dist/types/src/util/table-buttons.d.ts.map +1 -1
- package/dist/types/src/util/table-controls.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +61 -56
- package/src/components/Table/ColumnActionsMenu.tsx +11 -7
- package/src/components/Table/ColumnSettings.tsx +9 -10
- package/src/components/Table/DynamicTable.stories.tsx +28 -24
- package/src/components/Table/DynamicTable.tsx +34 -28
- package/src/components/Table/Relations.stories.tsx +240 -0
- package/src/components/Table/RowActionsMenu.tsx +26 -17
- package/src/components/Table/Table.stories.tsx +148 -118
- package/src/components/Table/Table.tsx +351 -296
- package/src/components/TableCellEditor/CellValidationMessage.tsx +6 -6
- package/src/components/TableCellEditor/FormCellEditor.tsx +134 -40
- package/src/components/TableCellEditor/TableCellEditor.stories.tsx +31 -66
- package/src/components/TableCellEditor/TableCellEditor.tsx +88 -238
- package/src/components/TableCellEditor/index.ts +1 -0
- package/src/components/TableToolbar/TableToolbar.tsx +54 -38
- package/src/components/testing.ts +39 -13
- package/src/hooks/index.ts +2 -1
- package/src/hooks/useAddRow.ts +14 -14
- package/src/hooks/useProjectionModel.ts +39 -0
- package/src/hooks/useTableModel.ts +36 -34
- package/src/model/modal-controller.ts +24 -41
- package/src/model/selection-model.ts +75 -43
- package/src/model/table-model.test.ts +92 -55
- package/src/model/table-model.ts +453 -175
- package/src/model/table-presentation.test.ts +70 -58
- package/src/model/table-presentation.ts +111 -64
- package/src/playwright/TableManager.ts +13 -6
- package/src/playwright/playwright.config.ts +1 -1
- package/src/playwright/smoke.spec.ts +171 -33
- package/src/testing/useTestTableModel.ts +46 -35
- package/src/translations.ts +3 -3
- package/src/types/Table.ts +79 -0
- package/src/types/index.ts +1 -1
- package/src/util/dynamic-table.test.ts +70 -0
- package/src/util/dynamic-table.ts +46 -33
- package/src/util/index.ts +2 -1
- package/src/util/query-ast.ts +22 -0
- package/src/util/schema.ts +4 -4
- package/src/util/sort.ts +90 -0
- package/src/util/table-buttons.ts +4 -3
- package/src/util/table-controls.ts +6 -3
- package/dist/lib/browser/chunk-5XLSHLOG.mjs +0 -1751
- package/dist/lib/browser/chunk-5XLSHLOG.mjs.map +0 -7
- package/dist/lib/browser/chunk-L2LSB6KV.mjs +0 -18
- package/dist/lib/browser/chunk-L2LSB6KV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NXZ4CJYX.mjs +0 -20
- package/dist/lib/node-esm/chunk-NXZ4CJYX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Y66YLSTC.mjs +0 -1752
- package/dist/lib/node-esm/chunk-Y66YLSTC.mjs.map +0 -7
- package/dist/types/src/components/Table/CreateRefPanel.d.ts +0 -9
- package/dist/types/src/components/Table/CreateRefPanel.d.ts.map +0 -1
- package/dist/types/src/components/Table/relations.stories.d.ts +0 -9
- package/dist/types/src/components/Table/relations.stories.d.ts.map +0 -1
- package/dist/types/src/components/TableCellEditor/extension.d.ts +0 -13
- package/dist/types/src/components/TableCellEditor/extension.d.ts.map +0 -1
- package/dist/types/src/model/table-sorting.d.ts +0 -53
- package/dist/types/src/model/table-sorting.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -8
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/dist/types/src/util/table.d.ts +0 -11
- package/dist/types/src/util/table.d.ts.map +0 -1
- package/src/components/Table/CreateRefPanel.tsx +0 -86
- package/src/components/Table/relations.stories.tsx +0 -116
- package/src/components/TableCellEditor/extension.ts +0 -61
- package/src/model/table-sorting.ts +0 -216
- package/src/types/schema.ts +0 -16
- package/src/util/table.ts +0 -49
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import '@dxos/lit-ui/dx-tag-picker.pcss';
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
render: () => React.JSX.Element;
|
|
7
|
+
decorators: import("@storybook/react").Decorator[];
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
controls: {
|
|
11
|
+
disable: boolean;
|
|
12
|
+
};
|
|
13
|
+
translations: ({
|
|
14
|
+
readonly 'en-US': {
|
|
15
|
+
readonly "@dxos/react-ui-table": {
|
|
16
|
+
readonly 'object placeholder': "New table";
|
|
17
|
+
readonly 'create object label': "Create table";
|
|
18
|
+
readonly 'table name placeholder': "Table name";
|
|
19
|
+
readonly 'settings title': "Table settings";
|
|
20
|
+
readonly 'table schema label': "Type";
|
|
21
|
+
readonly 'new schema': "New type";
|
|
22
|
+
readonly 'continue label': "Continue";
|
|
23
|
+
readonly 'create stack section label': "Create table";
|
|
24
|
+
readonly 'add row label': "Add row";
|
|
25
|
+
readonly 'create comment': "Create thread";
|
|
26
|
+
readonly 'column action sort descending': "Sort Descending";
|
|
27
|
+
readonly 'column action sort ascending': "Sort Ascending";
|
|
28
|
+
readonly 'column action clear sorting': "Clear Sorting";
|
|
29
|
+
readonly 'column action settings': "Column Settings";
|
|
30
|
+
readonly 'column action delete': "Delete Column";
|
|
31
|
+
readonly 'delete row label': "Delete row";
|
|
32
|
+
readonly 'bulk delete row label': "Delete selected rows";
|
|
33
|
+
readonly 'column deleted label': "Column deleted";
|
|
34
|
+
readonly 'new column button label': "Create column";
|
|
35
|
+
readonly 'create new object label': "Create new object “{{text}}”";
|
|
36
|
+
readonly 'save view label': "Save changes to view";
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
} | {
|
|
40
|
+
readonly 'en-US': {
|
|
41
|
+
readonly "@dxos/react-ui-form": {
|
|
42
|
+
readonly "fields label": "Fields";
|
|
43
|
+
readonly "hidden fields label": "Hidden Fields";
|
|
44
|
+
readonly "empty readonly ref field label": "(none)";
|
|
45
|
+
readonly "add property button label": "Add property";
|
|
46
|
+
readonly "field property label": "Property";
|
|
47
|
+
readonly "field property placeholder": "Property name";
|
|
48
|
+
readonly "field format label": "Type";
|
|
49
|
+
readonly "field path label": "Field path";
|
|
50
|
+
readonly "add field": "Add field";
|
|
51
|
+
readonly "delete field": "Delete field";
|
|
52
|
+
readonly "field limit reached": "Maximum number of fields reached";
|
|
53
|
+
readonly "boolean input true value": "Yes";
|
|
54
|
+
readonly "boolean input false value": "No";
|
|
55
|
+
readonly "show field label": "Show field";
|
|
56
|
+
readonly "hide field label": "Hide field";
|
|
57
|
+
readonly "delete field label": "Delete field";
|
|
58
|
+
readonly "ref field combobox input placeholder": "Search\u2026";
|
|
59
|
+
readonly "ref field placeholder_one": "Select\u2026";
|
|
60
|
+
readonly "ref field placeholder_other": "Select items\u2026";
|
|
61
|
+
readonly "example placeholder": "Example";
|
|
62
|
+
readonly "latitude placeholder": "Latitude (e.g., 40.7128)";
|
|
63
|
+
readonly "longitude placeholder": "Longitude (e.g., -74.0060)";
|
|
64
|
+
readonly "cancel button label": "Cancel";
|
|
65
|
+
readonly "save button label": "Save";
|
|
66
|
+
readonly "format boolean": "Boolean";
|
|
67
|
+
readonly "format currency": "Currency";
|
|
68
|
+
readonly "format date": "Date";
|
|
69
|
+
readonly "format date-time": "DateTime";
|
|
70
|
+
readonly "format did": "DID";
|
|
71
|
+
readonly "format duration": "Duration";
|
|
72
|
+
readonly "format dxn": "DXN";
|
|
73
|
+
readonly "format email": "Email";
|
|
74
|
+
readonly "format formula": "Formula";
|
|
75
|
+
readonly "format hostname": "Hostname";
|
|
76
|
+
readonly "format integer": "Integer";
|
|
77
|
+
readonly "format json": "JSON";
|
|
78
|
+
readonly "format lnglat": "Geopoint";
|
|
79
|
+
readonly "format markdown": "Markdown";
|
|
80
|
+
readonly "format percent": "Percent";
|
|
81
|
+
readonly "format ref": "Reference";
|
|
82
|
+
readonly "format regex": "RegExp";
|
|
83
|
+
readonly "format string": "String";
|
|
84
|
+
readonly "format single-select": "Select";
|
|
85
|
+
readonly "format multi-select": "Multi-select";
|
|
86
|
+
readonly "format text": "Long text";
|
|
87
|
+
readonly "format time": "Time";
|
|
88
|
+
readonly "format timestamp": "Timestamp";
|
|
89
|
+
readonly "format user": "User";
|
|
90
|
+
readonly "format number": "Number";
|
|
91
|
+
readonly "format uri": "URI";
|
|
92
|
+
readonly "format url": "URL";
|
|
93
|
+
readonly "format uuid": "UUID";
|
|
94
|
+
readonly "latitude label": "Latitude";
|
|
95
|
+
readonly "longitude label": "Longitude";
|
|
96
|
+
readonly "select option label": "Label";
|
|
97
|
+
readonly "select option label placeholder": "Option label";
|
|
98
|
+
readonly "select option color": "Color";
|
|
99
|
+
readonly "select option delete": "Delete";
|
|
100
|
+
readonly "select option add": "Add option";
|
|
101
|
+
readonly "system schema title": "System type";
|
|
102
|
+
readonly "system schema description": "System type: cannot add or remove fields.";
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
})[];
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
export default meta;
|
|
109
|
+
type Story = StoryObj<typeof meta>;
|
|
110
|
+
export declare const Default: Story;
|
|
111
|
+
//# sourceMappingURL=Relations.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Relations.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/Relations.stories.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAgE,MAAM,OAAO,CAAC;AAOrF,OAAO,iCAAiC,CAAC;AA+GzC,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmB2B,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KA0Fd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowActionsMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/RowActionsMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RowActionsMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/RowActionsMenu.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAGpE,KAAK,mBAAmB,GAAG;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC;AAE1E,eAAO,MAAM,cAAc,GAAI,mBAAmB,mBAAmB,6BA2CpE,CAAC"}
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import
|
|
3
|
-
import { type Client } from '@dxos/client';
|
|
1
|
+
import { type JSX, type PropsWithChildren, type Ref } from 'react';
|
|
2
|
+
import { type Type } from '@dxos/echo';
|
|
4
3
|
import { type DxGridPosition } from '@dxos/react-ui-grid';
|
|
5
|
-
import { type
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { type ComposableProps } from '@dxos/ui-types';
|
|
5
|
+
import { type InsertRowResult, type TableModel, type TablePresentation } from '../../model';
|
|
6
|
+
import { type OnCreateHandler } from '../TableCellEditor';
|
|
7
|
+
export type TableRootProps = PropsWithChildren;
|
|
9
8
|
export type TableController = {
|
|
10
9
|
update?: (cell?: DxGridPosition) => void;
|
|
10
|
+
handleInsertRowResult?: (insertRowResult?: InsertRowResult) => void;
|
|
11
11
|
};
|
|
12
|
-
export type TableMainProps = {
|
|
12
|
+
export type TableMainProps<T extends Type.AnyEntity = Type.AnyEntity> = ComposableProps<HTMLDivElement> & {
|
|
13
|
+
schema?: T;
|
|
13
14
|
model?: TableModel;
|
|
14
15
|
presentation?: TablePresentation;
|
|
15
|
-
schema?: Schema.AnyNoContext;
|
|
16
|
-
client?: Client;
|
|
17
16
|
ignoreAttention?: boolean;
|
|
17
|
+
onCreate?: OnCreateHandler;
|
|
18
18
|
onRowClick?: (row: any) => void;
|
|
19
|
+
testId?: string;
|
|
19
20
|
};
|
|
20
21
|
export declare const Table: {
|
|
21
|
-
Root: ({ children
|
|
22
|
-
Main:
|
|
22
|
+
Root: ({ children }: TableRootProps) => JSX.Element;
|
|
23
|
+
Main: <T extends Type.AnyEntity = Type.AnyEntity>(props: TableMainProps<T> & {
|
|
24
|
+
ref?: Ref<TableController>;
|
|
25
|
+
}) => JSX.Element;
|
|
26
|
+
Toolbar: ({ classNames, viewDirty, attendableId, onAdd, onSave, customActions, ...props }: import("..").TableToolbarProps) => JSX.Element;
|
|
23
27
|
};
|
|
24
28
|
//# sourceMappingURL=Table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/Table.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/Table.tsx"],"names":[],"mappings":"AAMA,OAAc,EACZ,KAAK,GAAG,EAER,KAAK,iBAAiB,EACtB,KAAK,GAAG,EAST,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAKL,KAAK,cAAc,EAMpB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,KAAK,eAAe,EAAmB,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE7G,OAAO,EAAE,KAAK,eAAe,EAA+C,MAAM,oBAAoB,CAAC;AAevG,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAa/C,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,qBAAqB,CAAC,EAAE,CAAC,eAAe,CAAC,EAAE,eAAe,KAAK,IAAI,CAAC;CACrE,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,eAAe,CAAC,cAAc,CAAC,GAAG;IACxG,MAAM,CAAC,EAAE,CAAC,CAAC;IACX,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,YAAY,CAAC,EAAE,iBAAiB,CAAC;IAEjC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAwXF,eAAO,MAAM,KAAK;yBAjZe,cAAc;WAyYE,CAAC,SAAS,IAAI,CAAC,SAAS,0BAChE,cAAc,CAAC,CAAC,CAAC,GAAG;QAAE,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAA;KAAE,KACtD,GAAG,CAAC,OAAO;;CAUf,CAAC"}
|
|
@@ -1,11 +1,115 @@
|
|
|
1
|
-
import '@
|
|
2
|
-
import
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
type StoryProps = {
|
|
4
4
|
rows?: number;
|
|
5
5
|
};
|
|
6
|
-
declare const meta:
|
|
6
|
+
declare const meta: {
|
|
7
|
+
title: string;
|
|
8
|
+
render: () => React.JSX.Element;
|
|
9
|
+
decorators: import("@storybook/react").Decorator[];
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: string;
|
|
12
|
+
controls: {
|
|
13
|
+
disable: boolean;
|
|
14
|
+
};
|
|
15
|
+
translations: ({
|
|
16
|
+
readonly 'en-US': {
|
|
17
|
+
readonly "@dxos/react-ui-table": {
|
|
18
|
+
readonly 'object placeholder': "New table";
|
|
19
|
+
readonly 'create object label': "Create table";
|
|
20
|
+
readonly 'table name placeholder': "Table name";
|
|
21
|
+
readonly 'settings title': "Table settings";
|
|
22
|
+
readonly 'table schema label': "Type";
|
|
23
|
+
readonly 'new schema': "New type";
|
|
24
|
+
readonly 'continue label': "Continue";
|
|
25
|
+
readonly 'create stack section label': "Create table";
|
|
26
|
+
readonly 'add row label': "Add row";
|
|
27
|
+
readonly 'create comment': "Create thread";
|
|
28
|
+
readonly 'column action sort descending': "Sort Descending";
|
|
29
|
+
readonly 'column action sort ascending': "Sort Ascending";
|
|
30
|
+
readonly 'column action clear sorting': "Clear Sorting";
|
|
31
|
+
readonly 'column action settings': "Column Settings";
|
|
32
|
+
readonly 'column action delete': "Delete Column";
|
|
33
|
+
readonly 'delete row label': "Delete row";
|
|
34
|
+
readonly 'bulk delete row label': "Delete selected rows";
|
|
35
|
+
readonly 'column deleted label': "Column deleted";
|
|
36
|
+
readonly 'new column button label': "Create column";
|
|
37
|
+
readonly 'create new object label': "Create new object “{{text}}”";
|
|
38
|
+
readonly 'save view label': "Save changes to view";
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
} | {
|
|
42
|
+
readonly 'en-US': {
|
|
43
|
+
readonly "@dxos/react-ui-form": {
|
|
44
|
+
readonly "fields label": "Fields";
|
|
45
|
+
readonly "hidden fields label": "Hidden Fields";
|
|
46
|
+
readonly "empty readonly ref field label": "(none)";
|
|
47
|
+
readonly "add property button label": "Add property";
|
|
48
|
+
readonly "field property label": "Property";
|
|
49
|
+
readonly "field property placeholder": "Property name";
|
|
50
|
+
readonly "field format label": "Type";
|
|
51
|
+
readonly "field path label": "Field path";
|
|
52
|
+
readonly "add field": "Add field";
|
|
53
|
+
readonly "delete field": "Delete field";
|
|
54
|
+
readonly "field limit reached": "Maximum number of fields reached";
|
|
55
|
+
readonly "boolean input true value": "Yes";
|
|
56
|
+
readonly "boolean input false value": "No";
|
|
57
|
+
readonly "show field label": "Show field";
|
|
58
|
+
readonly "hide field label": "Hide field";
|
|
59
|
+
readonly "delete field label": "Delete field";
|
|
60
|
+
readonly "ref field combobox input placeholder": "Search\u2026";
|
|
61
|
+
readonly "ref field placeholder_one": "Select\u2026";
|
|
62
|
+
readonly "ref field placeholder_other": "Select items\u2026";
|
|
63
|
+
readonly "example placeholder": "Example";
|
|
64
|
+
readonly "latitude placeholder": "Latitude (e.g., 40.7128)";
|
|
65
|
+
readonly "longitude placeholder": "Longitude (e.g., -74.0060)";
|
|
66
|
+
readonly "cancel button label": "Cancel";
|
|
67
|
+
readonly "save button label": "Save";
|
|
68
|
+
readonly "format boolean": "Boolean";
|
|
69
|
+
readonly "format currency": "Currency";
|
|
70
|
+
readonly "format date": "Date";
|
|
71
|
+
readonly "format date-time": "DateTime";
|
|
72
|
+
readonly "format did": "DID";
|
|
73
|
+
readonly "format duration": "Duration";
|
|
74
|
+
readonly "format dxn": "DXN";
|
|
75
|
+
readonly "format email": "Email";
|
|
76
|
+
readonly "format formula": "Formula";
|
|
77
|
+
readonly "format hostname": "Hostname";
|
|
78
|
+
readonly "format integer": "Integer";
|
|
79
|
+
readonly "format json": "JSON";
|
|
80
|
+
readonly "format lnglat": "Geopoint";
|
|
81
|
+
readonly "format markdown": "Markdown";
|
|
82
|
+
readonly "format percent": "Percent";
|
|
83
|
+
readonly "format ref": "Reference";
|
|
84
|
+
readonly "format regex": "RegExp";
|
|
85
|
+
readonly "format string": "String";
|
|
86
|
+
readonly "format single-select": "Select";
|
|
87
|
+
readonly "format multi-select": "Multi-select";
|
|
88
|
+
readonly "format text": "Long text";
|
|
89
|
+
readonly "format time": "Time";
|
|
90
|
+
readonly "format timestamp": "Timestamp";
|
|
91
|
+
readonly "format user": "User";
|
|
92
|
+
readonly "format number": "Number";
|
|
93
|
+
readonly "format uri": "URI";
|
|
94
|
+
readonly "format url": "URL";
|
|
95
|
+
readonly "format uuid": "UUID";
|
|
96
|
+
readonly "latitude label": "Latitude";
|
|
97
|
+
readonly "longitude label": "Longitude";
|
|
98
|
+
readonly "select option label": "Label";
|
|
99
|
+
readonly "select option label placeholder": "Option label";
|
|
100
|
+
readonly "select option color": "Color";
|
|
101
|
+
readonly "select option delete": "Delete";
|
|
102
|
+
readonly "select option add": "Add option";
|
|
103
|
+
readonly "system schema title": "System type";
|
|
104
|
+
readonly "system schema description": "System type: cannot add or remove fields.";
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
})[];
|
|
108
|
+
};
|
|
109
|
+
};
|
|
7
110
|
export default meta;
|
|
8
|
-
|
|
111
|
+
type Story = StoryObj<typeof meta>;
|
|
112
|
+
export declare const Default: Story;
|
|
9
113
|
export declare const StaticSchema: StoryObj;
|
|
10
114
|
export declare const ArrayOfObjects: StoryObj;
|
|
11
115
|
export declare const Tags: Meta<StoryProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/Table.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"Table.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/Table.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAsB,MAAM,OAAO,CAAC;AAoJ3C,KAAK,UAAU,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAQpC,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2C6B,CAAC;AAExC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,YAAY,EAAE,QA2B1B,CAAC;AAmBF,eAAO,MAAM,cAAc,EAAE,QA4B5B,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,UAAU,CAwDjC,CAAC"}
|
|
@@ -4,5 +4,5 @@ export type CellValidationMessageProps = {
|
|
|
4
4
|
validationError: string | null;
|
|
5
5
|
variant?: 'error' | 'warning';
|
|
6
6
|
};
|
|
7
|
-
export declare const CellValidationMessage: ({ validationError, variant,
|
|
7
|
+
export declare const CellValidationMessage: ({ __gridScope, validationError, variant, }: GridScopedProps<CellValidationMessageProps>) => React.JSX.Element | null;
|
|
8
8
|
//# sourceMappingURL=CellValidationMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellValidationMessage.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableCellEditor/CellValidationMessage.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,
|
|
1
|
+
{"version":3,"file":"CellValidationMessage.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableCellEditor/CellValidationMessage.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,qBAAqB,CAAC;AAE3E,MAAM,MAAM,0BAA0B,GAAG;IACvC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,4CAInC,eAAe,CAAC,0BAA0B,CAAC,6BAyB7C,CAAC"}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { type Schema } from 'effect';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import { type Type } from '@dxos/echo';
|
|
3
|
+
import { Ref } from '@dxos/echo/internal';
|
|
4
|
+
import { type FormRootProps } from '@dxos/react-ui-form';
|
|
3
5
|
import { type FieldProjection } from '@dxos/schema';
|
|
4
|
-
import { type TableModel } from '../../model';
|
|
5
|
-
type
|
|
6
|
-
|
|
6
|
+
import { type ModalController, type TableModel } from '../../model';
|
|
7
|
+
export type OnCreateHandler = (schema: Type.AnyEntity, values: any) => Parameters<typeof Ref.make>[0];
|
|
8
|
+
export type FormCellEditorProps<T extends Type.AnyEntity = Type.AnyEntity> = {
|
|
9
|
+
__gridScope: any;
|
|
10
|
+
schema?: T;
|
|
7
11
|
model?: TableModel;
|
|
8
|
-
|
|
12
|
+
fieldProjection: FieldProjection;
|
|
13
|
+
modals?: ModalController;
|
|
9
14
|
onSave?: () => void;
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
export declare const FormCellEditor: ({
|
|
13
|
-
export {};
|
|
15
|
+
onCreate?: OnCreateHandler;
|
|
16
|
+
} & Omit<FormRootProps<any>, 'values' | 'schema' | 'onCreate'>;
|
|
17
|
+
export declare const FormCellEditor: <T extends Type.AnyEntity = Type.AnyEntity>({ __gridScope, schema, model, fieldProjection, onSave, onCreate, ...formProps }: FormCellEditorProps<T>) => React.JSX.Element | null;
|
|
14
18
|
//# sourceMappingURL=FormCellEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormCellEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableCellEditor/FormCellEditor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FormCellEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableCellEditor/FormCellEditor.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAEjF,OAAO,EAAU,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAY,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAQ,KAAK,aAAa,EAAsB,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAiB,MAAM,aAAa,CAAC;AAMnF,MAAM,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,KAAK,UAAU,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAEtG,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI;IAC3E,WAAW,EAAE,GAAG,CAAC;IACjB,MAAM,CAAC,EAAE,CAAC,CAAC;IACX,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,eAAe,EAAE,eAAe,CAAC;IACjC,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC,CAAC;AAE/D,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,iFAQvE,mBAAmB,CAAC,CAAC,CAAC,6BA4JxB,CAAC"}
|
|
@@ -1,31 +1,24 @@
|
|
|
1
1
|
import { type Completion } from '@codemirror/autocomplete';
|
|
2
|
-
import { type Schema } from 'effect/Schema';
|
|
3
2
|
import React from 'react';
|
|
4
|
-
import { type
|
|
5
|
-
import { type
|
|
6
|
-
import { type
|
|
7
|
-
import { type
|
|
8
|
-
|
|
3
|
+
import { type Type } from '@dxos/echo';
|
|
4
|
+
import { type DxGridAxis, type DxGridPosition } from '@dxos/lit-grid';
|
|
5
|
+
import { type GridScopedProps } from '@dxos/react-ui-grid';
|
|
6
|
+
import { type ModalController, type TableModel } from '../../model';
|
|
7
|
+
import { type OnCreateHandler } from './FormCellEditor';
|
|
9
8
|
/**
|
|
10
9
|
* Option to create new object/value.
|
|
11
10
|
*/
|
|
12
|
-
export declare const createOption: (text: string) => {
|
|
13
|
-
[newValue]: boolean;
|
|
14
|
-
text: string;
|
|
15
|
-
};
|
|
16
11
|
export type QueryResult = Pick<Completion, 'label'> & {
|
|
17
12
|
data: any;
|
|
18
13
|
};
|
|
19
|
-
export type TableCellEditorProps = {
|
|
14
|
+
export type TableCellEditorProps<T extends Type.AnyEntity = Type.AnyEntity> = {
|
|
15
|
+
schema?: T;
|
|
20
16
|
model?: TableModel;
|
|
21
17
|
modals?: ModalController;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
onFocus?: DxGrid['refocus'];
|
|
18
|
+
onFocus?: (axis?: DxGridAxis, delta?: -1 | 0 | 1, cell?: DxGridPosition) => void;
|
|
19
|
+
onCreate?: OnCreateHandler;
|
|
25
20
|
onSave?: () => void;
|
|
26
|
-
onQuery?: (field: FieldProjection, text: string) => Promise<QueryResult[]>;
|
|
27
21
|
};
|
|
28
|
-
export declare const TableValueEditor: ({
|
|
29
|
-
export declare const TableCellEditor: ({ model, modals,
|
|
30
|
-
export {};
|
|
22
|
+
export declare const TableValueEditor: <T extends Type.AnyEntity = Type.AnyEntity>({ __gridScope, schema, model, modals, onFocus, onSave, onCreate, }: GridScopedProps<TableCellEditorProps<T>>) => React.JSX.Element;
|
|
23
|
+
export declare const TableCellEditor: ({ __gridScope, model, modals, onFocus, onSave, }: GridScopedProps<TableCellEditorProps>) => React.JSX.Element;
|
|
31
24
|
//# sourceMappingURL=TableCellEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCellEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableCellEditor/TableCellEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"TableCellEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableCellEditor/TableCellEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,KAAiD,MAAM,OAAO,CAAC;AAGtE,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAML,KAAK,eAAe,EAIrB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAGpE,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAQxE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG;IACpD,IAAI,EAAE,GAAG,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI;IAC5E,MAAM,CAAC,EAAE,CAAC,CAAC;IACX,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IACjF,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,oEAQzE,eAAe,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,sBAoC1C,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,kDAM7B,eAAe,CAAC,oBAAoB,CAAC,sBAsJvC,CAAC"}
|
|
@@ -1,11 +1,46 @@
|
|
|
1
|
-
import '@
|
|
2
|
-
import
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { type GridEditing } from '@dxos/react-ui-grid';
|
|
4
4
|
type StoryProps = {
|
|
5
5
|
editing: GridEditing;
|
|
6
6
|
};
|
|
7
|
-
declare const meta:
|
|
7
|
+
declare const meta: {
|
|
8
|
+
title: string;
|
|
9
|
+
component: ({ editing }: StoryProps) => React.JSX.Element;
|
|
10
|
+
render: ({ editing }: StoryProps) => React.JSX.Element;
|
|
11
|
+
decorators: import("@storybook/react").Decorator[];
|
|
12
|
+
parameters: {
|
|
13
|
+
layout: string;
|
|
14
|
+
translations: [{
|
|
15
|
+
readonly 'en-US': {
|
|
16
|
+
readonly "@dxos/react-ui-table": {
|
|
17
|
+
readonly 'object placeholder': "New table";
|
|
18
|
+
readonly 'create object label': "Create table";
|
|
19
|
+
readonly 'table name placeholder': "Table name";
|
|
20
|
+
readonly 'settings title': "Table settings";
|
|
21
|
+
readonly 'table schema label': "Type";
|
|
22
|
+
readonly 'new schema': "New type";
|
|
23
|
+
readonly 'continue label': "Continue";
|
|
24
|
+
readonly 'create stack section label': "Create table";
|
|
25
|
+
readonly 'add row label': "Add row";
|
|
26
|
+
readonly 'create comment': "Create thread";
|
|
27
|
+
readonly 'column action sort descending': "Sort Descending";
|
|
28
|
+
readonly 'column action sort ascending': "Sort Ascending";
|
|
29
|
+
readonly 'column action clear sorting': "Clear Sorting";
|
|
30
|
+
readonly 'column action settings': "Column Settings";
|
|
31
|
+
readonly 'column action delete': "Delete Column";
|
|
32
|
+
readonly 'delete row label': "Delete row";
|
|
33
|
+
readonly 'bulk delete row label': "Delete selected rows";
|
|
34
|
+
readonly 'column deleted label': "Column deleted";
|
|
35
|
+
readonly 'new column button label': "Create column";
|
|
36
|
+
readonly 'create new object label': "Create new object “{{text}}”";
|
|
37
|
+
readonly 'save view label': "Save changes to view";
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
}];
|
|
41
|
+
};
|
|
42
|
+
};
|
|
8
43
|
export default meta;
|
|
9
|
-
type Story = StoryObj<
|
|
44
|
+
type Story = StoryObj<typeof meta>;
|
|
10
45
|
export declare const Default: Story;
|
|
11
46
|
//# sourceMappingURL=TableCellEditor.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCellEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableCellEditor/TableCellEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"TableCellEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableCellEditor/TableCellEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAQ,KAAK,WAAW,EAAkB,MAAM,qBAAqB,CAAC;AAU7E,KAAK,UAAU,GAAG;IAChB,OAAO,EAAE,WAAW,CAAC;CACtB,CAAC;AAmBF,QAAA,MAAM,IAAI;;6BAhByB,UAAU;0BAAV,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CR,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableCellEditor/index.ts"],"names":[],"mappings":"AAIA,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableCellEditor/index.ts"],"names":[],"mappings":"AAIA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Atom } from '@effect-atom/atom-react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
4
4
|
import { type ActionGraphProps, type MenuAction } from '@dxos/react-ui-menu';
|
|
@@ -11,11 +11,11 @@ type TableToolbarState = Partial<{
|
|
|
11
11
|
viewDirty: boolean;
|
|
12
12
|
}>;
|
|
13
13
|
export type TableToolbarProps = ThemedClassName<TableToolbarState & {
|
|
14
|
-
onAdd
|
|
15
|
-
onSave
|
|
14
|
+
onAdd?: () => void;
|
|
15
|
+
onSave?: () => void;
|
|
16
16
|
attendableId?: string;
|
|
17
|
-
customActions?:
|
|
17
|
+
customActions?: Atom.Atom<ActionGraphProps>;
|
|
18
18
|
}>;
|
|
19
|
-
export declare const TableToolbar: ({ classNames, viewDirty, attendableId, onAdd, onSave, customActions, }: TableToolbarProps) => React.JSX.Element;
|
|
19
|
+
export declare const TableToolbar: ({ classNames, viewDirty, attendableId, onAdd, onSave, customActions, ...props }: TableToolbarProps) => React.JSX.Element;
|
|
20
20
|
export {};
|
|
21
21
|
//# sourceMappingURL=TableToolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableToolbar/TableToolbar.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"TableToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableToolbar/TableToolbar.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAmB,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAGL,KAAK,gBAAgB,EAErB,KAAK,UAAU,EAIhB,MAAM,qBAAqB,CAAC;AAI7B,MAAM,MAAM,4BAA4B,GAAG;IAAE,IAAI,EAAE,sBAAsB,CAAA;CAAE,CAAC;AAE5E,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,4BAA4B,CAAC,CAAC;AAE1E,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;AAEzE,KAAK,iBAAiB,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAIzD,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAC7C,iBAAiB,GAAG;IAClB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;CAC7C,CACF,CAAC;AAmDF,eAAO,MAAM,YAAY,GAAI,iFAQ1B,iBAAiB,sBAoBnB,CAAC"}
|
|
@@ -1,24 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Atom } from '@effect-atom/atom-react';
|
|
2
|
+
import * as Schema from 'effect/Schema';
|
|
3
|
+
import { Type } from '@dxos/echo';
|
|
2
4
|
import { type ProjectionModel } from '@dxos/schema';
|
|
3
|
-
export declare const TestSchema:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
id: import("@dxos/keys").ObjectIdClass;
|
|
11
|
-
name: Schema.optional<typeof Schema.String>;
|
|
12
|
-
age: Schema.optional<typeof Schema.Number>;
|
|
13
|
-
active: Schema.optional<typeof Schema.Boolean>;
|
|
14
|
-
netWorth: Schema.optional<typeof Schema.Number>;
|
|
15
|
-
}>>;
|
|
16
|
-
export declare const createItems: (n: number) => {
|
|
5
|
+
export declare const TestSchema: Type.Obj<{
|
|
6
|
+
readonly name?: string | undefined;
|
|
7
|
+
readonly age?: number | undefined;
|
|
8
|
+
readonly active?: boolean | undefined;
|
|
9
|
+
readonly netWorth?: number | undefined;
|
|
10
|
+
}, Schema.Struct.Fields>;
|
|
11
|
+
export type TestItem = {
|
|
17
12
|
name: string;
|
|
18
13
|
age: number;
|
|
19
14
|
active: boolean;
|
|
20
15
|
netWorth: number;
|
|
21
|
-
}
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Creates an Atom containing test items data.
|
|
19
|
+
*/
|
|
20
|
+
export declare const createItemsAtom: (n: number) => Atom.Writable<{
|
|
21
|
+
data: TestItem[];
|
|
22
|
+
}, {
|
|
23
|
+
data: TestItem[];
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Creates plain test items (non-reactive).
|
|
27
|
+
*/
|
|
28
|
+
export declare const createItems: (n: number) => TestItem[];
|
|
22
29
|
export type SimulatorProps = {
|
|
23
30
|
projection: ProjectionModel;
|
|
24
31
|
items: any[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/components/testing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/components/testing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAU,IAAI,EAAE,MAAM,YAAY,CAAC;AAI1C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,UAAU;;;;;wBAUtB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,GAAG,MAAM;UACd,QAAQ,EAAE;;UAAV,QAAQ,EAAE;EAQpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,GAAG,MAAM,KAAG,QAAQ,EAO/C,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,eAAe,CAAC;IAC5B,KAAK,EAAE,GAAG,EAAE,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,uDAAuD,cAAc,SA6DjG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
schema?:
|
|
1
|
+
import { type Database, type Type } from '@dxos/echo';
|
|
2
|
+
import { type InsertRowResult } from '../model';
|
|
3
|
+
export type UseAddRowProps = {
|
|
4
|
+
db?: Database.Database;
|
|
5
|
+
schema?: Type.AnyObj;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
8
|
* Hook that provides a safe row creation function that handles schema validation failures.
|
|
9
9
|
* Returns a callback that attempts to create an object and returns boolean success/failure.
|
|
10
10
|
* Can accept optional data to create objects with specific content (used for committing draft rows).
|
|
11
11
|
*/
|
|
12
|
-
export declare const useAddRow: ({
|
|
12
|
+
export declare const useAddRow: ({ db, schema }: UseAddRowProps) => (data?: any) => InsertRowResult;
|
|
13
13
|
//# sourceMappingURL=useAddRow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAddRow.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useAddRow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAddRow.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useAddRow.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,QAAQ,EAAO,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAE3D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACvB,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,gBAAgB,cAAc,aAE5C,GAAG,KAAG,eAajB,CAAC"}
|