@dxos/react-ui-form 0.8.4-main.406dc2a → 0.8.4-main.422d1c7879
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/README.md +0 -1
- package/dist/lib/browser/index.mjs +2856 -2309
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +2856 -2309
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/FieldEditor/FieldEditor.d.ts +8 -7
- package/dist/types/src/components/FieldEditor/FieldEditor.d.ts.map +1 -1
- package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts +68 -60
- package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.d.ts +93 -26
- package/dist/types/src/components/Form/Form.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.stories.d.ts +114 -137
- package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/FormField.d.ts +43 -0
- package/dist/types/src/components/Form/FormField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormFieldComponent.d.ts +80 -0
- package/dist/types/src/components/Form/FormFieldComponent.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts +9 -0
- package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormFieldSet.d.ts +18 -0
- package/dist/types/src/components/Form/FormFieldSet.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/ArrayField.d.ts +18 -0
- package/dist/types/src/components/Form/fields/ArrayField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/BooleanField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/BooleanField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/GeoPointField.d.ts +5 -0
- package/dist/types/src/components/Form/fields/GeoPointField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/MarkdownField.d.ts +11 -0
- package/dist/types/src/components/Form/fields/MarkdownField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/MarkdownField.stories.d.ts +83 -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 +4 -0
- package/dist/types/src/components/Form/fields/NumberField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/RefField.d.ts +22 -0
- package/dist/types/src/components/Form/fields/RefField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/SelectField.d.ts +10 -0
- package/dist/types/src/components/Form/fields/SelectField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/SelectOptionField.d.ts +5 -0
- package/dist/types/src/components/Form/fields/SelectOptionField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts +84 -0
- package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/TextAreaField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/TextAreaField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/TextField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/TextField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/TupleField.d.ts +6 -0
- package/dist/types/src/components/Form/fields/TupleField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/index.d.ts +12 -0
- package/dist/types/src/components/Form/fields/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/index.d.ts +2 -4
- package/dist/types/src/components/Form/index.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 +37 -10
- package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts.map +1 -1
- package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts +64 -59
- 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 +43 -0
- package/dist/types/src/components/Settings/Settings.d.ts.map +1 -0
- package/dist/types/src/components/Settings/Settings.stories.d.ts +84 -0
- package/dist/types/src/components/Settings/Settings.stories.d.ts.map +1 -0
- package/dist/types/src/components/Settings/SettingsFieldSet.d.ts +38 -0
- package/dist/types/src/components/Settings/SettingsFieldSet.d.ts.map +1 -0
- package/dist/types/src/components/Settings/SettingsItem.d.ts +17 -0
- package/dist/types/src/components/Settings/SettingsItem.d.ts.map +1 -0
- package/dist/types/src/components/Settings/index.d.ts +3 -0
- package/dist/types/src/components/Settings/index.d.ts.map +1 -0
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +13 -15
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +70 -64
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +4 -6
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -3
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useFormHandler.d.ts +82 -0
- package/dist/types/src/hooks/useFormHandler.d.ts.map +1 -0
- package/dist/types/src/hooks/useKeyHandler.d.ts +7 -0
- package/dist/types/src/hooks/useKeyHandler.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +65 -60
- 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 +3 -3
- package/dist/types/src/util/field.d.ts.map +1 -1
- package/dist/types/src/util/formatting.d.ts +2 -2
- package/dist/types/src/util/formatting.d.ts.map +1 -1
- 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/properties.d.ts +7 -0
- package/dist/types/src/util/properties.d.ts.map +1 -0
- package/dist/types/src/util/refs.d.ts +2 -2
- package/dist/types/src/util/refs.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +47 -50
- package/src/components/FieldEditor/FieldEditor.stories.tsx +43 -25
- package/src/components/FieldEditor/FieldEditor.test.tsx +0 -1
- package/src/components/FieldEditor/FieldEditor.tsx +74 -78
- package/src/components/Form/AUDIT.md +17 -0
- package/src/components/Form/Form.stories.tsx +137 -250
- package/src/components/Form/Form.tsx +375 -107
- package/src/components/Form/FormField.tsx +305 -0
- package/src/components/Form/FormFieldComponent.stories.tsx +65 -0
- package/src/components/Form/FormFieldComponent.tsx +174 -0
- package/src/components/Form/FormFieldSet.tsx +144 -0
- package/src/components/Form/README.md +3 -0
- package/src/components/Form/fields/ArrayField.tsx +158 -0
- package/src/components/Form/fields/BooleanField.tsx +22 -0
- package/src/components/Form/fields/GeoPointField.tsx +120 -0
- package/src/components/Form/fields/MarkdownField.stories.tsx +151 -0
- package/src/components/Form/fields/MarkdownField.tsx +167 -0
- package/src/components/Form/fields/NumberField.tsx +39 -0
- package/src/components/Form/fields/RefField.tsx +228 -0
- package/src/components/Form/fields/SelectField.tsx +65 -0
- package/src/components/Form/{custom/SelectOptionsInput.stories.tsx → fields/SelectOptionField.stories.tsx} +21 -17
- package/src/components/Form/{custom/SelectOptionsInput.tsx → fields/SelectOptionField.tsx} +28 -23
- package/src/components/Form/fields/TextAreaField.tsx +38 -0
- package/src/components/Form/fields/TextField.tsx +38 -0
- package/src/components/Form/{custom/TupleInput.tsx → fields/TupleField.tsx} +16 -9
- package/src/components/Form/fields/index.ts +15 -0
- package/src/components/Form/index.ts +3 -4
- package/src/components/ObjectForm/ObjectForm.tsx +113 -0
- package/src/components/{ControlSection → ObjectForm}/index.ts +1 -1
- package/src/components/ObjectPicker/ObjectPicker.stories.tsx +23 -21
- package/src/components/ObjectPicker/ObjectPicker.tsx +112 -80
- package/src/components/ObjectProperties/ObjectProperties.stories.tsx +361 -0
- package/src/components/ObjectProperties/ObjectProperties.test.tsx +101 -0
- package/src/components/ObjectProperties/ObjectProperties.tsx +140 -0
- package/src/components/ObjectProperties/index.ts +5 -0
- package/src/components/Settings/Settings.stories.tsx +103 -0
- package/src/components/Settings/Settings.tsx +81 -0
- package/src/components/Settings/SettingsFieldSet.tsx +211 -0
- package/src/components/Settings/SettingsItem.tsx +62 -0
- package/src/components/Settings/index.ts +6 -0
- package/src/components/ViewEditor/ViewEditor.stories.tsx +53 -50
- package/src/components/ViewEditor/ViewEditor.test.tsx +6 -6
- package/src/components/ViewEditor/ViewEditor.tsx +296 -206
- package/src/components/index.ts +3 -1
- package/src/components/testing.tsx +24 -11
- package/src/hooks/index.ts +2 -3
- package/src/hooks/useFormHandler.ts +380 -0
- package/src/hooks/useKeyHandler.tsx +37 -0
- package/src/translations.ts +70 -65
- package/src/util/field-type.ts +57 -0
- package/src/util/field.ts +25 -25
- package/src/util/formatting.ts +22 -22
- package/src/util/index.ts +2 -1
- package/src/util/properties.ts +18 -0
- package/src/util/refs.ts +16 -18
- package/dist/types/src/components/ControlSection/ControlSection.d.ts +0 -23
- package/dist/types/src/components/ControlSection/ControlSection.d.ts.map +0 -1
- package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts +0 -84
- package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts.map +0 -1
- package/dist/types/src/components/ControlSection/index.d.ts +0 -2
- package/dist/types/src/components/ControlSection/index.d.ts.map +0 -1
- package/dist/types/src/components/Form/ArrayField.d.ts +0 -16
- package/dist/types/src/components/Form/ArrayField.d.ts.map +0 -1
- package/dist/types/src/components/Form/Defaults.d.ts +0 -14
- package/dist/types/src/components/Form/Defaults.d.ts.map +0 -1
- package/dist/types/src/components/Form/FormActions.d.ts +0 -9
- package/dist/types/src/components/Form/FormActions.d.ts.map +0 -1
- package/dist/types/src/components/Form/FormContent.d.ts +0 -63
- package/dist/types/src/components/Form/FormContent.d.ts.map +0 -1
- package/dist/types/src/components/Form/FormContext.d.ts +0 -23
- package/dist/types/src/components/Form/FormContext.d.ts.map +0 -1
- package/dist/types/src/components/Form/Input.d.ts +0 -29
- package/dist/types/src/components/Form/Input.d.ts.map +0 -1
- package/dist/types/src/components/Form/RefField.d.ts +0 -22
- package/dist/types/src/components/Form/RefField.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/GeoPointInput.d.ts +0 -4
- package/dist/types/src/components/Form/custom/GeoPointInput.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts +0 -4
- package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts +0 -79
- package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/TupleInput.d.ts +0 -6
- package/dist/types/src/components/Form/custom/TupleInput.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/index.d.ts +0 -4
- package/dist/types/src/components/Form/custom/index.d.ts.map +0 -1
- package/dist/types/src/components/Form/factory.d.ts +0 -8
- package/dist/types/src/components/Form/factory.d.ts.map +0 -1
- package/dist/types/src/hooks/useForm.d.ts +0 -67
- package/dist/types/src/hooks/useForm.d.ts.map +0 -1
- package/dist/types/src/hooks/useQueryRefOptions.d.ts +0 -29
- package/dist/types/src/hooks/useQueryRefOptions.d.ts.map +0 -1
- package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts +0 -8
- package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts.map +0 -1
- package/dist/types/src/util/schema.d.ts +0 -3
- package/dist/types/src/util/schema.d.ts.map +0 -1
- package/src/components/ControlSection/ControlSection.stories.tsx +0 -38
- package/src/components/ControlSection/ControlSection.tsx +0 -153
- package/src/components/Form/ArrayField.tsx +0 -125
- package/src/components/Form/Defaults.tsx +0 -205
- package/src/components/Form/FormActions.tsx +0 -54
- package/src/components/Form/FormContent.tsx +0 -322
- package/src/components/Form/FormContext.tsx +0 -110
- package/src/components/Form/Input.tsx +0 -54
- package/src/components/Form/RefField.tsx +0 -283
- package/src/components/Form/custom/GeoPointInput.tsx +0 -80
- package/src/components/Form/custom/index.ts +0 -7
- package/src/components/Form/factory.tsx +0 -31
- package/src/hooks/useForm.ts +0 -296
- package/src/hooks/useQueryRefOptions.ts +0 -62
- package/src/hooks/useRefQueryLookupHandler.ts +0 -39
- package/src/util/schema.ts +0 -12
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/NumberField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,WAAW,GAAI,kEAOzB,uBAAuB,CAAC,MAAM,CAAC,sBAoBjC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@dxos/lit-ui/dx-tag-picker.pcss';
|
|
3
|
+
import { type Database, Entity, Obj, Type } from '@dxos/echo';
|
|
4
|
+
import { type ObjectPickerContentProps, type RefOption } from '../../ObjectPicker';
|
|
5
|
+
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
6
|
+
export type RefFieldProps = FormFieldComponentProps & Pick<ObjectPickerContentProps, 'createOptionLabel' | 'createOptionIcon' | 'createInitialValuePath' | 'createFieldMap'> & {
|
|
7
|
+
db?: Database.Database;
|
|
8
|
+
useSchema?: (db?: Database.Database, typename?: string) => Type.AnyEntity;
|
|
9
|
+
useResults?: (db?: Database.Database, typename?: string) => Entity.Any[];
|
|
10
|
+
getOptions?: (objects: Entity.Any[], options?: {
|
|
11
|
+
parentLabel?: boolean;
|
|
12
|
+
}) => RefOption[];
|
|
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;
|
|
20
|
+
};
|
|
21
|
+
export declare const RefField: (props: RefFieldProps) => React.JSX.Element | null;
|
|
22
|
+
//# sourceMappingURL=RefField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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;AAU3E,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,GAAI,OAAO,aAAa,6BAmK5C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
3
|
+
export type SelectFieldOptions = FormFieldComponentProps & {
|
|
4
|
+
options?: Array<{
|
|
5
|
+
value: string | number;
|
|
6
|
+
label?: string;
|
|
7
|
+
}>;
|
|
8
|
+
};
|
|
9
|
+
export declare const SelectField: ({ type, readonly, label, layout, placeholder, options, getStatus, getValue, onValueChange, }: SelectFieldOptions) => React.JSX.Element | null;
|
|
10
|
+
//# sourceMappingURL=SelectField.d.ts.map
|
|
@@ -0,0 +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,GAAI,8FAUzB,kBAAkB,6BAwCpB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type SelectOption } from '@dxos/echo/internal';
|
|
3
|
+
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
4
|
+
export declare const SelectOptionField: ({ type, readonly, label, getStatus, getValue, onValueChange, }: FormFieldComponentProps<SelectOption[] | undefined>) => React.JSX.Element;
|
|
5
|
+
//# sourceMappingURL=SelectOptionField.d.ts.map
|
|
@@ -0,0 +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;AAQxD,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAErF,eAAO,MAAM,iBAAiB,GAAI,gEAO/B,uBAAuB,CAAC,YAAY,EAAE,GAAG,SAAS,CAAC,sBA4KrD,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: any;
|
|
6
|
+
render: () => React.JSX.Element;
|
|
7
|
+
decorators: import("@storybook/react").Decorator[];
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
translations: [{
|
|
11
|
+
readonly 'en-US': {
|
|
12
|
+
readonly "@dxos/react-ui-form": {
|
|
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…";
|
|
30
|
+
readonly 'ref-field.placeholder': "Select…";
|
|
31
|
+
readonly 'ref-field.placeholder_one': "Select…";
|
|
32
|
+
readonly 'ref-field.placeholder_other': "Select items…";
|
|
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";
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
}];
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
export default meta;
|
|
82
|
+
type Story = StoryObj<typeof meta>;
|
|
83
|
+
export declare const Default: Story;
|
|
84
|
+
//# sourceMappingURL=SelectOptionField.stories.d.ts.map
|
|
@@ -0,0 +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;AA2CxC,QAAA,MAAM,IAAI;;eAEwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOA,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
3
|
+
export declare const TextAreaField: ({ type, readonly, placeholder, onValueChange, onBlur, ...props }: FormFieldComponentProps<string>) => React.JSX.Element;
|
|
4
|
+
//# sourceMappingURL=TextAreaField.d.ts.map
|
|
@@ -0,0 +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,GAAI,kEAO3B,uBAAuB,CAAC,MAAM,CAAC,sBAoBjC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
3
|
+
export declare const TextField: ({ type, readonly, placeholder, onBlur, onValueChange, ...props }: FormFieldComponentProps<string>) => React.JSX.Element;
|
|
4
|
+
//# sourceMappingURL=TextField.d.ts.map
|
|
@@ -0,0 +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,GAAI,kEAOvB,uBAAuB,CAAC,MAAM,CAAC,sBAoBjC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
3
|
+
export declare const TupleField: ({ binding, type, readonly, label, getStatus, getValue, onValueChange, onBlur, }: FormFieldComponentProps<Record<string, number>> & {
|
|
4
|
+
binding: string[];
|
|
5
|
+
}) => React.JSX.Element;
|
|
6
|
+
//# sourceMappingURL=TupleField.d.ts.map
|
|
@@ -0,0 +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,GAAI,iFASxB,uBAAuB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG;IACnD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,sBA4BA,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './ArrayField';
|
|
2
|
+
export * from './BooleanField';
|
|
3
|
+
export * from './GeoPointField';
|
|
4
|
+
export * from './MarkdownField';
|
|
5
|
+
export * from './NumberField';
|
|
6
|
+
export * from './RefField';
|
|
7
|
+
export * from './SelectField';
|
|
8
|
+
export * from './SelectOptionField';
|
|
9
|
+
export * from './TextField';
|
|
10
|
+
export * from './TextAreaField';
|
|
11
|
+
export * from './TupleField';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AAEzB,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,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;AAStD,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,GAAI,oBAAoB,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,21 +1,40 @@
|
|
|
1
1
|
import type * as Schema from 'effect/Schema';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
4
|
-
import { type
|
|
3
|
+
import { type Palette, type ThemedClassName } from '@dxos/react-ui';
|
|
4
|
+
import { type FormFieldMap } from '../Form/FormFieldComponent';
|
|
5
|
+
export type RefOption = {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
hue?: Palette;
|
|
9
|
+
};
|
|
5
10
|
export type ObjectPickerContentProps = ThemedClassName<{
|
|
6
|
-
options:
|
|
11
|
+
options: RefOption[];
|
|
7
12
|
selectedIds?: string[];
|
|
8
|
-
createSchema?: Schema.Schema.AnyNoContext;
|
|
9
13
|
createOptionLabel?: [string, {
|
|
10
14
|
ns: string;
|
|
11
15
|
}];
|
|
12
16
|
createOptionIcon?: string;
|
|
17
|
+
createSchema?: Schema.Schema.AnyNoContext;
|
|
13
18
|
createInitialValuePath?: string;
|
|
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>;
|
|
14
28
|
onSelect: (id: string) => void;
|
|
15
|
-
onCreate?: (values: any) => void;
|
|
16
29
|
}>;
|
|
17
30
|
export declare const ObjectPicker: {
|
|
18
|
-
Root: ({ modal, modalId: propsModalId, open: propsOpen, defaultOpen, onOpenChange: propsOnOpenChange, value: propsValue, defaultValue, onValueChange: propsOnValueChange, placeholder, children, }: import("@dxos/react-ui-
|
|
31
|
+
Root: ({ modal, modalId: propsModalId, open: propsOpen, defaultOpen, onOpenChange: propsOnOpenChange, value: propsValue, defaultValue, onValueChange: propsOnValueChange, placeholder, children, }: import("@dxos/react-ui-search").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
|
+
};
|
|
19
38
|
Trigger: React.ForwardRefExoticComponent<Omit<import("@dxos/react-ui").ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
20
39
|
VirtualTrigger: {
|
|
21
40
|
(props: import("@dxos/react-ui").PopoverVirtualTriggerProps & {
|
|
@@ -24,18 +43,26 @@ export declare const ObjectPicker: {
|
|
|
24
43
|
displayName: string;
|
|
25
44
|
};
|
|
26
45
|
Content: React.ForwardRefExoticComponent<Omit<{
|
|
27
|
-
options:
|
|
46
|
+
options: RefOption[];
|
|
28
47
|
selectedIds?: string[];
|
|
29
|
-
createSchema?: Schema.Schema.AnyNoContext;
|
|
30
48
|
createOptionLabel?: [string, {
|
|
31
49
|
ns: string;
|
|
32
50
|
}];
|
|
33
51
|
createOptionIcon?: string;
|
|
52
|
+
createSchema?: Schema.Schema.AnyNoContext;
|
|
34
53
|
createInitialValuePath?: string;
|
|
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>;
|
|
35
63
|
onSelect: (id: string) => void;
|
|
36
|
-
onCreate?: (values: any) => void;
|
|
37
64
|
}, "className"> & {
|
|
38
|
-
classNames?: import("@dxos/
|
|
65
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
39
66
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
40
67
|
};
|
|
41
68
|
//# sourceMappingURL=ObjectPicker.d.ts.map
|
|
@@ -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,
|
|
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;AAK7F,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;AAqJH,eAAO,MAAM,YAAY;;;;0BAjIa,CAAC;;;;;;;0BAyB7B,CAAN;;;;;iBA7DO,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;;;;CA4J/B,CAAC"}
|
|
@@ -11,65 +11,70 @@ declare const meta: {
|
|
|
11
11
|
};
|
|
12
12
|
translations: [{
|
|
13
13
|
readonly 'en-US': {
|
|
14
|
-
readonly "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 '
|
|
65
|
-
readonly '
|
|
66
|
-
readonly '
|
|
67
|
-
readonly '
|
|
68
|
-
readonly '
|
|
69
|
-
readonly '
|
|
70
|
-
readonly '
|
|
71
|
-
readonly '
|
|
72
|
-
readonly '
|
|
14
|
+
readonly "@dxos/react-ui-form": {
|
|
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…";
|
|
32
|
+
readonly 'ref-field.placeholder': "Select…";
|
|
33
|
+
readonly 'ref-field.placeholder_one': "Select…";
|
|
34
|
+
readonly 'ref-field.placeholder_other': "Select items…";
|
|
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";
|
|
73
78
|
};
|
|
74
79
|
};
|
|
75
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;AA2FzE,QAAA,MAAM,IAAI
|
|
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;AA2FzE,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgB2B,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,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>, "style" | "children" | "className" | "role"> & 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;AAWtD,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…";
|
|
38
|
+
readonly 'ref-field.placeholder': "Select…";
|
|
39
|
+
readonly 'ref-field.placeholder_one': "Select…";
|
|
40
|
+
readonly 'ref-field.placeholder_other': "Select items…";
|
|
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
|