@dxos/react-ui-form 0.8.4-main.d05673bc65 → 0.8.4-main.dfabb4ec29
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/index.mjs +1004 -612
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/translations.mjs +82 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1004 -612
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/translations.mjs +84 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/types/src/components/FieldEditor/FieldEditor.d.ts.map +1 -1
- package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts +63 -61
- package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.d.ts +40 -12
- package/dist/types/src/components/Form/Form.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.stories.d.ts +76 -74
- package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/FormField.d.ts +11 -5
- package/dist/types/src/components/Form/FormField.d.ts.map +1 -1
- package/dist/types/src/components/Form/FormFieldComponent.d.ts +8 -7
- package/dist/types/src/components/Form/FormFieldComponent.d.ts.map +1 -1
- package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/FormFieldSet.d.ts +5 -9
- package/dist/types/src/components/Form/FormFieldSet.d.ts.map +1 -1
- package/dist/types/src/components/Form/fields/ArrayField.d.ts +4 -4
- package/dist/types/src/components/Form/fields/ArrayField.d.ts.map +1 -1
- package/dist/types/src/components/Form/fields/BooleanField.d.ts.map +1 -1
- package/dist/types/src/components/Form/fields/GeoPointField.d.ts.map +1 -1
- package/dist/types/src/components/Form/fields/MarkdownField.d.ts +8 -1
- package/dist/types/src/components/Form/fields/MarkdownField.d.ts.map +1 -1
- package/dist/types/src/components/Form/fields/MarkdownField.stories.d.ts +84 -0
- package/dist/types/src/components/Form/fields/MarkdownField.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/NumberField.d.ts.map +1 -1
- package/dist/types/src/components/Form/fields/RefField.d.ts +12 -6
- package/dist/types/src/components/Form/fields/RefField.d.ts.map +1 -1
- package/dist/types/src/components/Form/fields/SelectField.d.ts.map +1 -1
- package/dist/types/src/components/Form/fields/SelectOptionField.d.ts.map +1 -1
- package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts +63 -61
- package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/fields/TextAreaField.d.ts.map +1 -1
- package/dist/types/src/components/Form/fields/TextField.d.ts +1 -1
- package/dist/types/src/components/Form/fields/TextField.d.ts.map +1 -1
- package/dist/types/src/components/Form/fields/TupleField.d.ts.map +1 -1
- package/dist/types/src/components/ObjectForm/ObjectForm.d.ts +9 -0
- package/dist/types/src/components/ObjectForm/ObjectForm.d.ts.map +1 -0
- package/dist/types/src/components/ObjectForm/index.d.ts +2 -0
- package/dist/types/src/components/ObjectForm/index.d.ts.map +1 -0
- package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts +26 -4
- package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts.map +1 -1
- package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts +63 -61
- package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts.map +1 -1
- package/dist/types/src/components/ObjectProperties/ObjectProperties.d.ts +9 -0
- package/dist/types/src/components/ObjectProperties/ObjectProperties.d.ts.map +1 -0
- package/dist/types/src/components/ObjectProperties/ObjectProperties.stories.d.ts +127 -0
- package/dist/types/src/components/ObjectProperties/ObjectProperties.stories.d.ts.map +1 -0
- package/dist/types/src/components/ObjectProperties/ObjectProperties.test.d.ts +2 -0
- package/dist/types/src/components/ObjectProperties/ObjectProperties.test.d.ts.map +1 -0
- package/dist/types/src/components/ObjectProperties/index.d.ts +2 -0
- package/dist/types/src/components/ObjectProperties/index.d.ts.map +1 -0
- package/dist/types/src/components/Settings/Settings.d.ts +28 -33
- package/dist/types/src/components/Settings/Settings.d.ts.map +1 -1
- package/dist/types/src/components/Settings/Settings.stories.d.ts +64 -61
- package/dist/types/src/components/Settings/Settings.stories.d.ts.map +1 -1
- package/dist/types/src/components/Settings/SettingsFieldSet.d.ts +43 -0
- package/dist/types/src/components/Settings/SettingsFieldSet.d.ts.map +1 -0
- package/dist/types/src/components/Settings/SettingsItem.d.ts +16 -0
- package/dist/types/src/components/Settings/SettingsItem.d.ts.map +1 -0
- package/dist/types/src/components/Settings/SettingsSelectField.d.ts +18 -0
- package/dist/types/src/components/Settings/SettingsSelectField.d.ts.map +1 -0
- package/dist/types/src/components/Settings/index.d.ts +2 -0
- package/dist/types/src/components/Settings/index.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +2 -2
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +65 -63
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +4 -4
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/hooks/useFormHandler.d.ts.map +1 -1
- package/dist/types/src/hooks/useKeyHandler.d.ts +2 -1
- package/dist/types/src/hooks/useKeyHandler.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +63 -61
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/util/field-type.d.ts +19 -0
- package/dist/types/src/util/field-type.d.ts.map +1 -0
- package/dist/types/src/util/field.d.ts.map +1 -1
- package/dist/types/src/util/formatting.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/properties.d.ts.map +1 -1
- package/dist/types/src/util/refs.d.ts +1 -0
- package/dist/types/src/util/refs.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +42 -40
- package/src/components/FieldEditor/FieldEditor.stories.tsx +2 -2
- package/src/components/FieldEditor/FieldEditor.test.tsx +0 -1
- package/src/components/FieldEditor/FieldEditor.tsx +4 -3
- package/src/components/Form/AUDIT.md +17 -0
- package/src/components/Form/Form.stories.tsx +23 -36
- package/src/components/Form/Form.tsx +77 -48
- package/src/components/Form/FormField.tsx +27 -15
- package/src/components/Form/FormFieldComponent.tsx +5 -3
- package/src/components/Form/FormFieldSet.tsx +98 -77
- package/src/components/Form/fields/ArrayField.tsx +14 -8
- package/src/components/Form/fields/GeoPointField.tsx +8 -7
- package/src/components/Form/fields/MarkdownField.stories.tsx +206 -0
- package/src/components/Form/fields/MarkdownField.tsx +135 -45
- package/src/components/Form/fields/RefField.tsx +70 -35
- package/src/components/Form/fields/SelectOptionField.stories.tsx +8 -6
- package/src/components/Form/fields/SelectOptionField.tsx +10 -10
- package/src/components/Form/fields/TextField.tsx +2 -2
- package/src/components/Form/fields/TupleField.tsx +1 -1
- package/src/components/ObjectForm/ObjectForm.tsx +114 -0
- package/src/components/ObjectForm/index.ts +5 -0
- package/src/components/ObjectPicker/ObjectPicker.stories.tsx +9 -7
- package/src/components/ObjectPicker/ObjectPicker.tsx +92 -65
- package/src/components/ObjectProperties/ObjectProperties.stories.tsx +362 -0
- package/src/components/ObjectProperties/ObjectProperties.test.tsx +101 -0
- package/src/components/ObjectProperties/ObjectProperties.tsx +141 -0
- package/src/components/ObjectProperties/index.ts +5 -0
- package/src/components/Settings/AUDIT.md +52 -0
- package/src/components/Settings/Settings.stories.tsx +69 -21
- package/src/components/Settings/Settings.tsx +33 -183
- package/src/components/Settings/SettingsFieldSet.tsx +257 -0
- package/src/components/Settings/SettingsItem.tsx +58 -0
- package/src/components/Settings/SettingsSelectField.tsx +59 -0
- package/src/components/Settings/index.ts +2 -0
- package/src/components/ViewEditor/ViewEditor.stories.tsx +10 -10
- package/src/components/ViewEditor/ViewEditor.test.tsx +0 -1
- package/src/components/ViewEditor/ViewEditor.tsx +15 -15
- package/src/components/index.ts +2 -0
- package/src/components/testing.tsx +19 -11
- package/src/hooks/useKeyHandler.tsx +7 -7
- package/src/index.ts +0 -4
- package/src/translations.ts +66 -63
- package/src/util/field-type.ts +60 -0
- package/src/util/index.ts +1 -0
- package/src/util/refs.ts +7 -3
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import '@dxos/lit-ui/dx-tag-picker.pcss';
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import
|
|
2
|
+
import '@dxos/lit-ui/dx-tag-picker.pcss';
|
|
3
|
+
import { type Database, Entity, Obj, Type } from '@dxos/echo';
|
|
4
4
|
import { type ObjectPickerContentProps, type RefOption } from '../../ObjectPicker';
|
|
5
5
|
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
6
|
-
export type RefFieldProps = FormFieldComponentProps & Pick<ObjectPickerContentProps, 'createOptionLabel' | 'createOptionIcon' | 'createInitialValuePath'> & {
|
|
6
|
+
export type RefFieldProps = FormFieldComponentProps & Pick<ObjectPickerContentProps, 'createOptionLabel' | 'createOptionIcon' | 'createInitialValuePath' | 'createFieldMap'> & {
|
|
7
7
|
db?: Database.Database;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
useSchema?: (db?: Database.Database, typename?: string) => Type.AnyEntity;
|
|
9
|
+
useResults?: (db?: Database.Database, typename?: string) => Entity.Any[];
|
|
10
10
|
getOptions?: (objects: Entity.Any[], options?: {
|
|
11
11
|
parentLabel?: boolean;
|
|
12
12
|
}) => RefOption[];
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Persist a newly-created object. Called after the user fills out the
|
|
15
|
+
* inline create form and clicks Save. Should add the object to the
|
|
16
|
+
* database and return it (sync or async). The returned object is then
|
|
17
|
+
* wired into this slot's form value as a Ref.
|
|
18
|
+
*/
|
|
19
|
+
onCreate?: (schema: Type.AnyEntity, values: any) => Obj.Unknown | Promise<Obj.Unknown> | undefined | void;
|
|
14
20
|
};
|
|
15
21
|
export declare const RefField: (props: RefFieldProps) => React.JSX.Element | null;
|
|
16
22
|
//# sourceMappingURL=RefField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RefField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/RefField.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"RefField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/RefField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,EAAU,GAAG,EAAO,IAAI,EAAE,MAAM,YAAY,CAAC;AAW3E,OAAO,EAAgB,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEjG,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AA0BrF,MAAM,MAAM,aAAa,GAAG,uBAAuB,GACjD,IAAI,CACF,wBAAwB,EACxB,mBAAmB,GAAG,kBAAkB,GAAG,wBAAwB,GAAG,gBAAgB,CACvF,GAAG;IACF,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAEvB,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC,SAAS,CAAC;IAC1E,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC;IACzE,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,SAAS,EAAE,CAAC;IACzF;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;CAC3G,CAAC;AAEJ,eAAO,MAAM,QAAQ,UAAW,aAAa,6BAmK5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/SelectField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAErF,MAAM,MAAM,kBAAkB,GAAG,uBAAuB,GAAG;IACzD,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC7D,CAAC;AAEF,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"SelectField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/SelectField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAErF,MAAM,MAAM,kBAAkB,GAAG,uBAAuB,GAAG;IACzD,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC7D,CAAC;AAEF,eAAO,MAAM,WAAW,iGAUrB,kBAAkB,6BAwCpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectOptionField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/SelectOptionField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyF,MAAM,OAAO,CAAC;AAE9G,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectOptionField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/SelectOptionField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyF,MAAM,OAAO,CAAC;AAE9G,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AASxD,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAErF,eAAO,MAAM,iBAAiB,mEAO3B,uBAAuB,CAAC,YAAY,EAAE,GAAG,SAAS,CAAC,sBA4KrD,CAAC"}
|
|
@@ -10,67 +10,69 @@ declare const meta: {
|
|
|
10
10
|
translations: [{
|
|
11
11
|
readonly 'en-US': {
|
|
12
12
|
readonly "@dxos/react-ui-form": {
|
|
13
|
-
readonly 'fields
|
|
14
|
-
readonly 'hidden
|
|
15
|
-
readonly 'empty
|
|
16
|
-
readonly '
|
|
17
|
-
readonly 'field
|
|
18
|
-
readonly 'field
|
|
19
|
-
readonly 'field
|
|
20
|
-
readonly '
|
|
21
|
-
readonly 'add
|
|
22
|
-
readonly '
|
|
23
|
-
readonly '
|
|
24
|
-
readonly '
|
|
25
|
-
readonly '
|
|
26
|
-
readonly '
|
|
27
|
-
readonly '
|
|
28
|
-
readonly '
|
|
29
|
-
readonly 'ref
|
|
30
|
-
readonly 'ref
|
|
31
|
-
readonly 'ref
|
|
32
|
-
readonly '
|
|
33
|
-
readonly '
|
|
34
|
-
readonly '
|
|
35
|
-
readonly '
|
|
36
|
-
readonly '
|
|
37
|
-
readonly '
|
|
38
|
-
readonly '
|
|
39
|
-
readonly 'format
|
|
40
|
-
readonly 'format
|
|
41
|
-
readonly 'format
|
|
42
|
-
readonly 'format
|
|
43
|
-
readonly 'format
|
|
44
|
-
readonly 'format
|
|
45
|
-
readonly 'format
|
|
46
|
-
readonly 'format
|
|
47
|
-
readonly 'format
|
|
48
|
-
readonly 'format
|
|
49
|
-
readonly 'format
|
|
50
|
-
readonly 'format
|
|
51
|
-
readonly 'format
|
|
52
|
-
readonly 'format
|
|
53
|
-
readonly 'format
|
|
54
|
-
readonly 'format
|
|
55
|
-
readonly 'format
|
|
56
|
-
readonly 'format
|
|
57
|
-
readonly 'format
|
|
58
|
-
readonly 'format
|
|
59
|
-
readonly 'format
|
|
60
|
-
readonly 'format
|
|
61
|
-
readonly 'format
|
|
62
|
-
readonly 'format
|
|
63
|
-
readonly 'format
|
|
64
|
-
readonly 'format
|
|
65
|
-
readonly '
|
|
66
|
-
readonly '
|
|
67
|
-
readonly '
|
|
68
|
-
readonly '
|
|
69
|
-
readonly 'select
|
|
70
|
-
readonly 'select
|
|
71
|
-
readonly 'select
|
|
72
|
-
readonly '
|
|
73
|
-
readonly 'system
|
|
13
|
+
readonly 'fields.label': 'Fields';
|
|
14
|
+
readonly 'hidden-fields.label': 'Hidden Fields';
|
|
15
|
+
readonly 'empty-readonly-ref-field.label': '(none)';
|
|
16
|
+
readonly 'field-property.label': 'Property';
|
|
17
|
+
readonly 'field-property.placeholder': 'Property name';
|
|
18
|
+
readonly 'field-format.label': 'Type';
|
|
19
|
+
readonly 'field-path.label': 'Field path';
|
|
20
|
+
readonly 'add-item.button': 'Add item';
|
|
21
|
+
readonly 'add-property-button.label': 'Add property';
|
|
22
|
+
readonly 'boolean-input-true.value': 'Yes';
|
|
23
|
+
readonly 'boolean-input-false.value': 'No';
|
|
24
|
+
readonly 'show-field.label': 'Show field';
|
|
25
|
+
readonly 'hide-field.label': 'Hide field';
|
|
26
|
+
readonly 'delete-field.label': 'Delete field';
|
|
27
|
+
readonly 'create-option.label': 'Create';
|
|
28
|
+
readonly 'add-tag.label': 'Add tag';
|
|
29
|
+
readonly 'ref-field-combobox-input.placeholder': 'Search\u2026';
|
|
30
|
+
readonly 'ref-field.placeholder': 'Select\u2026';
|
|
31
|
+
readonly 'ref-field.placeholder_one': 'Select\u2026';
|
|
32
|
+
readonly 'ref-field.placeholder_other': 'Select items\u2026';
|
|
33
|
+
readonly 'example.placeholder': 'Example';
|
|
34
|
+
readonly 'latitude.placeholder': 'Latitude (e.g., 40.7128)';
|
|
35
|
+
readonly 'longitude.placeholder': 'Longitude (e.g., -74.0060)';
|
|
36
|
+
readonly 'cancel-button.label': 'Cancel';
|
|
37
|
+
readonly 'save-button.label': 'Save';
|
|
38
|
+
readonly 'create-text.label': 'Create text';
|
|
39
|
+
readonly 'format.boolean.label': 'Boolean';
|
|
40
|
+
readonly 'format.currency.label': 'Currency';
|
|
41
|
+
readonly 'format.date.label': 'Date';
|
|
42
|
+
readonly 'format.date-time.label': 'DateTime';
|
|
43
|
+
readonly 'format.did.label': 'DID';
|
|
44
|
+
readonly 'format.duration.label': 'Duration';
|
|
45
|
+
readonly 'format.dxn.label': 'DXN';
|
|
46
|
+
readonly 'format.email.label': 'Email';
|
|
47
|
+
readonly 'format.formula.label': 'Formula';
|
|
48
|
+
readonly 'format.hostname.label': 'Hostname';
|
|
49
|
+
readonly 'format.integer.label': 'Integer';
|
|
50
|
+
readonly 'format.json.label': 'JSON';
|
|
51
|
+
readonly 'format.lnglat.label': 'Geopoint';
|
|
52
|
+
readonly 'format.markdown.label': 'Markdown';
|
|
53
|
+
readonly 'format.percent.label': 'Percent';
|
|
54
|
+
readonly 'format.ref.label': 'Reference';
|
|
55
|
+
readonly 'format.regex.label': 'RegExp';
|
|
56
|
+
readonly 'format.string.label': 'String';
|
|
57
|
+
readonly 'format.single-select.label': 'Select';
|
|
58
|
+
readonly 'format.multi-select.label': 'Multi-select';
|
|
59
|
+
readonly 'format.text.label': 'Long text';
|
|
60
|
+
readonly 'format.time.label': 'Time';
|
|
61
|
+
readonly 'format.timestamp.label': 'Timestamp';
|
|
62
|
+
readonly 'format.user.label': 'User';
|
|
63
|
+
readonly 'format.number.label': 'Number';
|
|
64
|
+
readonly 'format.uri.label': 'URI';
|
|
65
|
+
readonly 'format.url.label': 'URL';
|
|
66
|
+
readonly 'format.uuid.label': 'UUID';
|
|
67
|
+
readonly 'latitude.label': 'Latitude';
|
|
68
|
+
readonly 'longitude.label': 'Longitude';
|
|
69
|
+
readonly 'select-option.label': 'Label';
|
|
70
|
+
readonly 'select-option-label.placeholder': 'Option label';
|
|
71
|
+
readonly 'select-option-delete.button': 'Delete';
|
|
72
|
+
readonly 'select-option-add.button': 'Add option';
|
|
73
|
+
readonly 'system-schema.title': 'System type';
|
|
74
|
+
readonly 'system-schema.description': 'System type: cannot add or remove fields.';
|
|
75
|
+
readonly 'remove.button': 'Remove';
|
|
74
76
|
};
|
|
75
77
|
};
|
|
76
78
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectOptionField.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/SelectOptionField.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectOptionField.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/SelectOptionField.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAmB,MAAM,OAAO,CAAC;AA4CxC,QAAA,MAAM,IAAI;;eAEwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOA,CAAC;eAEvB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextAreaField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/TextAreaField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"TextAreaField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/TextAreaField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,aAAa,qEAOvB,uBAAuB,CAAC,MAAM,CAAC,sBAoBjC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
3
|
-
export declare const TextField: ({ type, readonly, placeholder,
|
|
3
|
+
export declare const TextField: ({ type, readonly, placeholder, onBlur, onValueChange, ...props }: FormFieldComponentProps<string>) => React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=TextField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/TextField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/TextField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,SAAS,qEAOnB,uBAAuB,CAAC,MAAM,CAAC,sBAoBjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TupleField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/TupleField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAIrF,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"TupleField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/TupleField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAIrF,eAAO,MAAM,UAAU,oFASpB,uBAAuB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG;IACnD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,sBA4BA,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Obj } from '@dxos/echo';
|
|
4
|
+
export type ObjectFormProps = {
|
|
5
|
+
schema: Schema.Schema.AnyNoContext;
|
|
6
|
+
object: Obj.Unknown;
|
|
7
|
+
};
|
|
8
|
+
export declare const ObjectForm: ({ object, schema }: ObjectFormProps) => React.JSX.Element;
|
|
9
|
+
//# sourceMappingURL=ObjectForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectForm.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectForm/ObjectForm.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAA+B,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAO,GAAG,EAAkB,MAAM,YAAY,CAAC;AAUtD,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IACnC,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC;CACrB,CAAC;AAeF,eAAO,MAAM,UAAU,uBAAwB,eAAe,sBA8E7D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectForm/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type * as Schema from 'effect/Schema';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { type Palette, type ThemedClassName } from '@dxos/react-ui';
|
|
4
|
+
import { type FormFieldMap } from '../Form/FormFieldComponent';
|
|
4
5
|
export type RefOption = {
|
|
5
6
|
id: string;
|
|
6
7
|
label: string;
|
|
@@ -15,12 +16,25 @@ export type ObjectPickerContentProps = ThemedClassName<{
|
|
|
15
16
|
createOptionIcon?: string;
|
|
16
17
|
createSchema?: Schema.Schema.AnyNoContext;
|
|
17
18
|
createInitialValuePath?: string;
|
|
18
|
-
|
|
19
|
+
createFieldMap?: FormFieldMap;
|
|
20
|
+
/**
|
|
21
|
+
* Persist a newly-created object given the form values. May be async (e.g.
|
|
22
|
+
* to write to a database). The Promise is awaited before the inline create
|
|
23
|
+
* form is collapsed back to the picker list, so consumers can complete
|
|
24
|
+
* follow-up work (assign the new ref to a parent slot, close the popover)
|
|
25
|
+
* before the picker UI re-renders.
|
|
26
|
+
*/
|
|
27
|
+
onCreate?: (values: any) => unknown | Promise<unknown>;
|
|
19
28
|
onSelect: (id: string) => void;
|
|
20
29
|
}>;
|
|
21
30
|
export declare const ObjectPicker: {
|
|
22
|
-
Root: ({ modal, modalId:
|
|
23
|
-
Portal:
|
|
31
|
+
Root: ({ children, modal, modalId: modalIdProp, open: openProp, defaultOpen, onOpenChange: propsOnOpenChange, value: valueProp, defaultValue, onValueChange: propsOnValueChange, placeholder, }: import("@dxos/react-ui-list").ComboboxRootProps) => React.JSX.Element;
|
|
32
|
+
Portal: {
|
|
33
|
+
(props: import("@dxos/react-ui").PopoverPortalProps & {
|
|
34
|
+
__scopePopover?: import("@radix-ui/react-context").Scope;
|
|
35
|
+
}): React.JSX.Element;
|
|
36
|
+
displayName: string;
|
|
37
|
+
};
|
|
24
38
|
Trigger: React.ForwardRefExoticComponent<Omit<import("@dxos/react-ui").ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
25
39
|
VirtualTrigger: {
|
|
26
40
|
(props: import("@dxos/react-ui").PopoverVirtualTriggerProps & {
|
|
@@ -37,7 +51,15 @@ export declare const ObjectPicker: {
|
|
|
37
51
|
createOptionIcon?: string;
|
|
38
52
|
createSchema?: Schema.Schema.AnyNoContext;
|
|
39
53
|
createInitialValuePath?: string;
|
|
40
|
-
|
|
54
|
+
createFieldMap?: FormFieldMap;
|
|
55
|
+
/**
|
|
56
|
+
* Persist a newly-created object given the form values. May be async (e.g.
|
|
57
|
+
* to write to a database). The Promise is awaited before the inline create
|
|
58
|
+
* form is collapsed back to the picker list, so consumers can complete
|
|
59
|
+
* follow-up work (assign the new ref to a parent slot, close the popover)
|
|
60
|
+
* before the picker UI re-renders.
|
|
61
|
+
*/
|
|
62
|
+
onCreate?: (values: any) => unknown | Promise<unknown>;
|
|
41
63
|
onSelect: (id: string) => void;
|
|
42
64
|
}, "className"> & {
|
|
43
65
|
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectPicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectPicker/ObjectPicker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAgE,MAAM,OAAO,CAAC;AAErF,OAAO,EAAE,KAAK,OAAO,EAAW,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ObjectPicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectPicker/ObjectPicker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAgE,MAAM,OAAO,CAAC;AAErF,OAAO,EAAE,KAAK,OAAO,EAAW,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAO7F,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC;IACrD,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IAC1C,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,cAAc,CAAC,EAAE,YAAY,CAAC;IAC9B;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,CAAC,CAAC;AA4JH,eAAO,MAAM,YAAY;IACvB,IAAI;IACJ,MAAM;;;;;;IACN,OAAO;IACP,cAAc;;;;;;IACd,OAAO;iBAjLE,SAAS,EAAE;sBACN,MAAM,EAAE;4BACF,CAAC,MAAM,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC;2BACzB,MAAM;uBACV,MAAM,CAAC,MAAM,CAAC,YAAY;iCAChB,MAAM;yBACd,YAAY;QAC7B;;;;;;WAMG;mBACQ,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;kBAC5C,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI;;;;CAmK/B,CAAC"}
|
|
@@ -12,67 +12,69 @@ declare const meta: {
|
|
|
12
12
|
translations: [{
|
|
13
13
|
readonly 'en-US': {
|
|
14
14
|
readonly "@dxos/react-ui-form": {
|
|
15
|
-
readonly 'fields
|
|
16
|
-
readonly 'hidden
|
|
17
|
-
readonly 'empty
|
|
18
|
-
readonly '
|
|
19
|
-
readonly 'field
|
|
20
|
-
readonly 'field
|
|
21
|
-
readonly 'field
|
|
22
|
-
readonly '
|
|
23
|
-
readonly 'add
|
|
24
|
-
readonly '
|
|
25
|
-
readonly '
|
|
26
|
-
readonly '
|
|
27
|
-
readonly '
|
|
28
|
-
readonly '
|
|
29
|
-
readonly '
|
|
30
|
-
readonly '
|
|
31
|
-
readonly 'ref
|
|
32
|
-
readonly 'ref
|
|
33
|
-
readonly 'ref
|
|
34
|
-
readonly '
|
|
35
|
-
readonly '
|
|
36
|
-
readonly '
|
|
37
|
-
readonly '
|
|
38
|
-
readonly '
|
|
39
|
-
readonly '
|
|
40
|
-
readonly '
|
|
41
|
-
readonly 'format
|
|
42
|
-
readonly 'format
|
|
43
|
-
readonly 'format
|
|
44
|
-
readonly 'format
|
|
45
|
-
readonly 'format
|
|
46
|
-
readonly 'format
|
|
47
|
-
readonly 'format
|
|
48
|
-
readonly 'format
|
|
49
|
-
readonly 'format
|
|
50
|
-
readonly 'format
|
|
51
|
-
readonly 'format
|
|
52
|
-
readonly 'format
|
|
53
|
-
readonly 'format
|
|
54
|
-
readonly 'format
|
|
55
|
-
readonly 'format
|
|
56
|
-
readonly 'format
|
|
57
|
-
readonly 'format
|
|
58
|
-
readonly 'format
|
|
59
|
-
readonly 'format
|
|
60
|
-
readonly 'format
|
|
61
|
-
readonly 'format
|
|
62
|
-
readonly 'format
|
|
63
|
-
readonly 'format
|
|
64
|
-
readonly 'format
|
|
65
|
-
readonly 'format
|
|
66
|
-
readonly 'format
|
|
67
|
-
readonly '
|
|
68
|
-
readonly '
|
|
69
|
-
readonly '
|
|
70
|
-
readonly '
|
|
71
|
-
readonly 'select
|
|
72
|
-
readonly 'select
|
|
73
|
-
readonly 'select
|
|
74
|
-
readonly '
|
|
75
|
-
readonly 'system
|
|
15
|
+
readonly 'fields.label': 'Fields';
|
|
16
|
+
readonly 'hidden-fields.label': 'Hidden Fields';
|
|
17
|
+
readonly 'empty-readonly-ref-field.label': '(none)';
|
|
18
|
+
readonly 'field-property.label': 'Property';
|
|
19
|
+
readonly 'field-property.placeholder': 'Property name';
|
|
20
|
+
readonly 'field-format.label': 'Type';
|
|
21
|
+
readonly 'field-path.label': 'Field path';
|
|
22
|
+
readonly 'add-item.button': 'Add item';
|
|
23
|
+
readonly 'add-property-button.label': 'Add property';
|
|
24
|
+
readonly 'boolean-input-true.value': 'Yes';
|
|
25
|
+
readonly 'boolean-input-false.value': 'No';
|
|
26
|
+
readonly 'show-field.label': 'Show field';
|
|
27
|
+
readonly 'hide-field.label': 'Hide field';
|
|
28
|
+
readonly 'delete-field.label': 'Delete field';
|
|
29
|
+
readonly 'create-option.label': 'Create';
|
|
30
|
+
readonly 'add-tag.label': 'Add tag';
|
|
31
|
+
readonly 'ref-field-combobox-input.placeholder': 'Search\u2026';
|
|
32
|
+
readonly 'ref-field.placeholder': 'Select\u2026';
|
|
33
|
+
readonly 'ref-field.placeholder_one': 'Select\u2026';
|
|
34
|
+
readonly 'ref-field.placeholder_other': 'Select items\u2026';
|
|
35
|
+
readonly 'example.placeholder': 'Example';
|
|
36
|
+
readonly 'latitude.placeholder': 'Latitude (e.g., 40.7128)';
|
|
37
|
+
readonly 'longitude.placeholder': 'Longitude (e.g., -74.0060)';
|
|
38
|
+
readonly 'cancel-button.label': 'Cancel';
|
|
39
|
+
readonly 'save-button.label': 'Save';
|
|
40
|
+
readonly 'create-text.label': 'Create text';
|
|
41
|
+
readonly 'format.boolean.label': 'Boolean';
|
|
42
|
+
readonly 'format.currency.label': 'Currency';
|
|
43
|
+
readonly 'format.date.label': 'Date';
|
|
44
|
+
readonly 'format.date-time.label': 'DateTime';
|
|
45
|
+
readonly 'format.did.label': 'DID';
|
|
46
|
+
readonly 'format.duration.label': 'Duration';
|
|
47
|
+
readonly 'format.dxn.label': 'DXN';
|
|
48
|
+
readonly 'format.email.label': 'Email';
|
|
49
|
+
readonly 'format.formula.label': 'Formula';
|
|
50
|
+
readonly 'format.hostname.label': 'Hostname';
|
|
51
|
+
readonly 'format.integer.label': 'Integer';
|
|
52
|
+
readonly 'format.json.label': 'JSON';
|
|
53
|
+
readonly 'format.lnglat.label': 'Geopoint';
|
|
54
|
+
readonly 'format.markdown.label': 'Markdown';
|
|
55
|
+
readonly 'format.percent.label': 'Percent';
|
|
56
|
+
readonly 'format.ref.label': 'Reference';
|
|
57
|
+
readonly 'format.regex.label': 'RegExp';
|
|
58
|
+
readonly 'format.string.label': 'String';
|
|
59
|
+
readonly 'format.single-select.label': 'Select';
|
|
60
|
+
readonly 'format.multi-select.label': 'Multi-select';
|
|
61
|
+
readonly 'format.text.label': 'Long text';
|
|
62
|
+
readonly 'format.time.label': 'Time';
|
|
63
|
+
readonly 'format.timestamp.label': 'Timestamp';
|
|
64
|
+
readonly 'format.user.label': 'User';
|
|
65
|
+
readonly 'format.number.label': 'Number';
|
|
66
|
+
readonly 'format.uri.label': 'URI';
|
|
67
|
+
readonly 'format.url.label': 'URL';
|
|
68
|
+
readonly 'format.uuid.label': 'UUID';
|
|
69
|
+
readonly 'latitude.label': 'Latitude';
|
|
70
|
+
readonly 'longitude.label': 'Longitude';
|
|
71
|
+
readonly 'select-option.label': 'Label';
|
|
72
|
+
readonly 'select-option-label.placeholder': 'Option label';
|
|
73
|
+
readonly 'select-option-delete.button': 'Delete';
|
|
74
|
+
readonly 'select-option-add.button': 'Add option';
|
|
75
|
+
readonly 'system-schema.title': 'System type';
|
|
76
|
+
readonly 'system-schema.description': 'System type: cannot add or remove fields.';
|
|
77
|
+
readonly 'remove.button': 'Remove';
|
|
76
78
|
};
|
|
77
79
|
};
|
|
78
80
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectPicker.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectPicker/ObjectPicker.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAoD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ObjectPicker.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectPicker/ObjectPicker.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAoD,MAAM,OAAO,CAAC;AA8FzE,QAAA,MAAM,IAAI;;;;;;;YAaM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGc,CAAC;eAEvB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,KAuFtB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
|
+
import { Obj } from '@dxos/echo';
|
|
3
|
+
export type ObjectPropertiesProps = PropsWithChildren<{
|
|
4
|
+
object: Obj.Unknown;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const ObjectProperties: React.ForwardRefExoticComponent<Omit<ObjectPropertiesProps, "className"> & {
|
|
7
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
8
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
//# sourceMappingURL=ObjectProperties.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectProperties.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectProperties/ObjectProperties.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAwB,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAO,GAAG,EAAkB,MAAM,YAAY,CAAC;AAYtD,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;IAAE,MAAM,EAAE,GAAG,CAAC,OAAO,CAAA;CAAE,CAAC,CAAC;AAG/E,eAAO,MAAM,gBAAgB;;2HAkG5B,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Obj } from '@dxos/echo';
|
|
3
|
+
import { useClientStory } from '@dxos/react-client/testing';
|
|
4
|
+
export type ObjectPropertiesDebug = {
|
|
5
|
+
/** Live database the story is rendering against. */
|
|
6
|
+
db: ReturnType<typeof useClientStory>['space'] extends infer S ? (S extends {
|
|
7
|
+
db: infer D;
|
|
8
|
+
} ? D : never) : never;
|
|
9
|
+
/** Object whose properties are being edited. */
|
|
10
|
+
object: Obj.Unknown;
|
|
11
|
+
};
|
|
12
|
+
declare const meta: {
|
|
13
|
+
title: string;
|
|
14
|
+
component: any;
|
|
15
|
+
decorators: import("@storybook/react").Decorator[];
|
|
16
|
+
parameters: {
|
|
17
|
+
layout: string;
|
|
18
|
+
translations: [{
|
|
19
|
+
readonly 'en-US': {
|
|
20
|
+
readonly "@dxos/react-ui-form": {
|
|
21
|
+
readonly 'fields.label': 'Fields';
|
|
22
|
+
readonly 'hidden-fields.label': 'Hidden Fields';
|
|
23
|
+
readonly 'empty-readonly-ref-field.label': '(none)';
|
|
24
|
+
readonly 'field-property.label': 'Property';
|
|
25
|
+
readonly 'field-property.placeholder': 'Property name';
|
|
26
|
+
readonly 'field-format.label': 'Type';
|
|
27
|
+
readonly 'field-path.label': 'Field path';
|
|
28
|
+
readonly 'add-item.button': 'Add item';
|
|
29
|
+
readonly 'add-property-button.label': 'Add property';
|
|
30
|
+
readonly 'boolean-input-true.value': 'Yes';
|
|
31
|
+
readonly 'boolean-input-false.value': 'No';
|
|
32
|
+
readonly 'show-field.label': 'Show field';
|
|
33
|
+
readonly 'hide-field.label': 'Hide field';
|
|
34
|
+
readonly 'delete-field.label': 'Delete field';
|
|
35
|
+
readonly 'create-option.label': 'Create';
|
|
36
|
+
readonly 'add-tag.label': 'Add tag';
|
|
37
|
+
readonly 'ref-field-combobox-input.placeholder': 'Search\u2026';
|
|
38
|
+
readonly 'ref-field.placeholder': 'Select\u2026';
|
|
39
|
+
readonly 'ref-field.placeholder_one': 'Select\u2026';
|
|
40
|
+
readonly 'ref-field.placeholder_other': 'Select items\u2026';
|
|
41
|
+
readonly 'example.placeholder': 'Example';
|
|
42
|
+
readonly 'latitude.placeholder': 'Latitude (e.g., 40.7128)';
|
|
43
|
+
readonly 'longitude.placeholder': 'Longitude (e.g., -74.0060)';
|
|
44
|
+
readonly 'cancel-button.label': 'Cancel';
|
|
45
|
+
readonly 'save-button.label': 'Save';
|
|
46
|
+
readonly 'create-text.label': 'Create text';
|
|
47
|
+
readonly 'format.boolean.label': 'Boolean';
|
|
48
|
+
readonly 'format.currency.label': 'Currency';
|
|
49
|
+
readonly 'format.date.label': 'Date';
|
|
50
|
+
readonly 'format.date-time.label': 'DateTime';
|
|
51
|
+
readonly 'format.did.label': 'DID';
|
|
52
|
+
readonly 'format.duration.label': 'Duration';
|
|
53
|
+
readonly 'format.dxn.label': 'DXN';
|
|
54
|
+
readonly 'format.email.label': 'Email';
|
|
55
|
+
readonly 'format.formula.label': 'Formula';
|
|
56
|
+
readonly 'format.hostname.label': 'Hostname';
|
|
57
|
+
readonly 'format.integer.label': 'Integer';
|
|
58
|
+
readonly 'format.json.label': 'JSON';
|
|
59
|
+
readonly 'format.lnglat.label': 'Geopoint';
|
|
60
|
+
readonly 'format.markdown.label': 'Markdown';
|
|
61
|
+
readonly 'format.percent.label': 'Percent';
|
|
62
|
+
readonly 'format.ref.label': 'Reference';
|
|
63
|
+
readonly 'format.regex.label': 'RegExp';
|
|
64
|
+
readonly 'format.string.label': 'String';
|
|
65
|
+
readonly 'format.single-select.label': 'Select';
|
|
66
|
+
readonly 'format.multi-select.label': 'Multi-select';
|
|
67
|
+
readonly 'format.text.label': 'Long text';
|
|
68
|
+
readonly 'format.time.label': 'Time';
|
|
69
|
+
readonly 'format.timestamp.label': 'Timestamp';
|
|
70
|
+
readonly 'format.user.label': 'User';
|
|
71
|
+
readonly 'format.number.label': 'Number';
|
|
72
|
+
readonly 'format.uri.label': 'URI';
|
|
73
|
+
readonly 'format.url.label': 'URL';
|
|
74
|
+
readonly 'format.uuid.label': 'UUID';
|
|
75
|
+
readonly 'latitude.label': 'Latitude';
|
|
76
|
+
readonly 'longitude.label': 'Longitude';
|
|
77
|
+
readonly 'select-option.label': 'Label';
|
|
78
|
+
readonly 'select-option-label.placeholder': 'Option label';
|
|
79
|
+
readonly 'select-option-delete.button': 'Delete';
|
|
80
|
+
readonly 'select-option-add.button': 'Add option';
|
|
81
|
+
readonly 'system-schema.title': 'System type';
|
|
82
|
+
readonly 'system-schema.description': 'System type: cannot add or remove fields.';
|
|
83
|
+
readonly 'remove.button': 'Remove';
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
}];
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
export default meta;
|
|
90
|
+
type Story = StoryObj<typeof meta>;
|
|
91
|
+
/**
|
|
92
|
+
* Default Pipeline form — manual exploration. Includes the Tags picker (which
|
|
93
|
+
* is the only ref-array path that currently works end-to-end, by virtue of
|
|
94
|
+
* `Tag.Tag` being special-cased in `ObjectProperties.handleCreate`).
|
|
95
|
+
*/
|
|
96
|
+
export declare const Default: Story;
|
|
97
|
+
/**
|
|
98
|
+
* Tag-creation play. Walks the inline create flow against the Tags picker and
|
|
99
|
+
* leaves the magazine in the post-Save state for assertions to inspect via
|
|
100
|
+
* `OBJECT_PROPERTIES_DEBUG_SYMBOL`.
|
|
101
|
+
*
|
|
102
|
+
* Expected end-state (currently passes):
|
|
103
|
+
* - new Tag.Tag exists in the DB with `label === "PinnedTag"`
|
|
104
|
+
* - `Obj.getMeta(object).tags` includes its DXN.
|
|
105
|
+
*/
|
|
106
|
+
export declare const CreateTagPlay: Story;
|
|
107
|
+
/**
|
|
108
|
+
* Ref-array creation play. Walks Add → Open → Create → Save against
|
|
109
|
+
* `Article.authors`. After the fix, the new Author should be persisted AND
|
|
110
|
+
* wired into `article.authors[0]`. Today it persists to the DB but the array
|
|
111
|
+
* slot stays empty.
|
|
112
|
+
*/
|
|
113
|
+
export declare const CreateRefArrayPlay: Story;
|
|
114
|
+
/**
|
|
115
|
+
* Ref-array creation against a schema with a hidden required field. `Note`
|
|
116
|
+
* mirrors the shape of `Subscription.Feed`: the form omits `backing` (a
|
|
117
|
+
* required `Ref` annotated `FormInputAnnotation.set(false)`) but the schema
|
|
118
|
+
* requires it. Without `omitHiddenFormFields` + `FactoryAnnotation`, the
|
|
119
|
+
* form's validator would reject Save and the popover would never close.
|
|
120
|
+
*
|
|
121
|
+
* Expected end-state after the fix:
|
|
122
|
+
* - new Note exists in DB with a synthesised `backing` ref
|
|
123
|
+
* - `notebook.notes[0]` references the new Note
|
|
124
|
+
* - the create form is gone
|
|
125
|
+
*/
|
|
126
|
+
export declare const CreateHiddenFieldPlay: Story;
|
|
127
|
+
//# sourceMappingURL=ObjectProperties.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectProperties.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectProperties/ObjectProperties.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAKjE,OAAO,EAAsB,GAAG,EAAkB,MAAM,YAAY,CAAC;AAGrE,OAAO,EAAE,cAAc,EAAsB,MAAM,4BAA4B,CAAC;AAsFhF,MAAM,MAAM,qBAAqB,GAAG;IAClC,oDAAoD;IACpD,EAAE,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,OAAO,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS;QAAE,EAAE,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;IACjH,gDAAgD;IAChD,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC;CACrB,CAAC;AA8CF,QAAA,MAAM,IAAI;;eAEuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAME,CAAC;eAExB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA4DnC;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,KAGrB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,EAAE,KAmC3B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAkChC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,EAAE,KA8BnC,CAAC"}
|