@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":"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;AAqFhF,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;AAEvC,eAAe,IAAI,CAAC;AAEpB,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectProperties.test.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectProperties/ObjectProperties.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectProperties/index.ts"],"names":[],"mappings":"AAIA,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
|
+
import { type Label, type ThemedClassName } from '@dxos/react-ui';
|
|
3
|
+
type SettingsRootProps = ThemedClassName<PropsWithChildren>;
|
|
4
|
+
type SettingsSectionProps = PropsWithChildren<{
|
|
5
|
+
title: Label;
|
|
6
|
+
description?: Label;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const Settings: {
|
|
9
|
+
Root: {
|
|
10
|
+
({ children, classNames }: SettingsRootProps): React.JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
Viewport: React.ForwardRefExoticComponent<Omit<{}, "className"> & {
|
|
14
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
15
|
+
} & Pick<React.HTMLAttributes<Element>, "style" | "children" | "className" | "role"> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
Section: {
|
|
17
|
+
({ title, description, children }: SettingsSectionProps): React.JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
Panel: {
|
|
21
|
+
({ classNames, children }: Omit<{
|
|
22
|
+
children?: React.ReactNode | undefined;
|
|
23
|
+
}, "className"> & {
|
|
24
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
25
|
+
}): React.JSX.Element;
|
|
26
|
+
displayName: string;
|
|
27
|
+
};
|
|
28
|
+
Item: {
|
|
29
|
+
({ title, description, children }: {
|
|
30
|
+
title: Label;
|
|
31
|
+
description?: Label;
|
|
32
|
+
} & {
|
|
33
|
+
children?: React.ReactNode | undefined;
|
|
34
|
+
}): React.JSX.Element;
|
|
35
|
+
displayName: string;
|
|
36
|
+
};
|
|
37
|
+
FieldSet: {
|
|
38
|
+
<T extends Record<string, any>>({ schema, values, onValuesChanged, readonly, fieldMap, visible, sort, }: import("./SettingsFieldSet").SettingsFieldSetProps<T>): React.JSX.Element;
|
|
39
|
+
displayName: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=Settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Settings.d.ts","sourceRoot":"","sources":["../../../../../src/components/Settings/Settings.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,KAAK,KAAK,EAAc,KAAK,eAAe,EAAqC,MAAM,gBAAgB,CAAC;AAejH,KAAK,iBAAiB,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;AA8B5D,KAAK,oBAAoB,GAAG,iBAAiB,CAAC;IAC5C,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,CAAC,CAAC;AAmBH,eAAO,MAAM,QAAQ;;mCAlD2B,iBAAiB;;;;;;;2CAiCN,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;CAwB9E,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
|
+
render: () => React.JSX.Element;
|
|
6
|
+
decorators: import("@storybook/react").Decorator[];
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
translations: [{
|
|
10
|
+
readonly 'en-US': {
|
|
11
|
+
readonly "@dxos/react-ui-form": {
|
|
12
|
+
readonly 'fields.label': "Fields";
|
|
13
|
+
readonly 'hidden-fields.label': "Hidden Fields";
|
|
14
|
+
readonly 'empty-readonly-ref-field.label': "(none)";
|
|
15
|
+
readonly 'field-property.label': "Property";
|
|
16
|
+
readonly 'field-property.placeholder': "Property name";
|
|
17
|
+
readonly 'field-format.label': "Type";
|
|
18
|
+
readonly 'field-path.label': "Field path";
|
|
19
|
+
readonly 'add-item.button': "Add item";
|
|
20
|
+
readonly 'add-property-button.label': "Add property";
|
|
21
|
+
readonly 'boolean-input-true.value': "Yes";
|
|
22
|
+
readonly 'boolean-input-false.value': "No";
|
|
23
|
+
readonly 'show-field.label': "Show field";
|
|
24
|
+
readonly 'hide-field.label': "Hide field";
|
|
25
|
+
readonly 'delete-field.label': "Delete field";
|
|
26
|
+
readonly 'create-option.label': "Create";
|
|
27
|
+
readonly 'add-tag.label': "Add tag";
|
|
28
|
+
readonly 'ref-field-combobox-input.placeholder': "Search…";
|
|
29
|
+
readonly 'ref-field.placeholder': "Select…";
|
|
30
|
+
readonly 'ref-field.placeholder_one': "Select…";
|
|
31
|
+
readonly 'ref-field.placeholder_other': "Select items…";
|
|
32
|
+
readonly 'example.placeholder': "Example";
|
|
33
|
+
readonly 'latitude.placeholder': "Latitude (e.g., 40.7128)";
|
|
34
|
+
readonly 'longitude.placeholder': "Longitude (e.g., -74.0060)";
|
|
35
|
+
readonly 'cancel-button.label': "Cancel";
|
|
36
|
+
readonly 'save-button.label': "Save";
|
|
37
|
+
readonly 'create-text.label': "Create text";
|
|
38
|
+
readonly 'format.boolean.label': "Boolean";
|
|
39
|
+
readonly 'format.currency.label': "Currency";
|
|
40
|
+
readonly 'format.date.label': "Date";
|
|
41
|
+
readonly 'format.date-time.label': "DateTime";
|
|
42
|
+
readonly 'format.did.label': "DID";
|
|
43
|
+
readonly 'format.duration.label': "Duration";
|
|
44
|
+
readonly 'format.dxn.label': "DXN";
|
|
45
|
+
readonly 'format.email.label': "Email";
|
|
46
|
+
readonly 'format.formula.label': "Formula";
|
|
47
|
+
readonly 'format.hostname.label': "Hostname";
|
|
48
|
+
readonly 'format.integer.label': "Integer";
|
|
49
|
+
readonly 'format.json.label': "JSON";
|
|
50
|
+
readonly 'format.lnglat.label': "Geopoint";
|
|
51
|
+
readonly 'format.markdown.label': "Markdown";
|
|
52
|
+
readonly 'format.percent.label': "Percent";
|
|
53
|
+
readonly 'format.ref.label': "Reference";
|
|
54
|
+
readonly 'format.regex.label': "RegExp";
|
|
55
|
+
readonly 'format.string.label': "String";
|
|
56
|
+
readonly 'format.single-select.label': "Select";
|
|
57
|
+
readonly 'format.multi-select.label': "Multi-select";
|
|
58
|
+
readonly 'format.text.label': "Long text";
|
|
59
|
+
readonly 'format.time.label': "Time";
|
|
60
|
+
readonly 'format.timestamp.label': "Timestamp";
|
|
61
|
+
readonly 'format.user.label': "User";
|
|
62
|
+
readonly 'format.number.label': "Number";
|
|
63
|
+
readonly 'format.uri.label': "URI";
|
|
64
|
+
readonly 'format.url.label': "URL";
|
|
65
|
+
readonly 'format.uuid.label': "UUID";
|
|
66
|
+
readonly 'latitude.label': "Latitude";
|
|
67
|
+
readonly 'longitude.label': "Longitude";
|
|
68
|
+
readonly 'select-option.label': "Label";
|
|
69
|
+
readonly 'select-option-label.placeholder': "Option label";
|
|
70
|
+
readonly 'select-option-delete.button': "Delete";
|
|
71
|
+
readonly 'select-option-add.button': "Add option";
|
|
72
|
+
readonly 'system-schema.title': "System type";
|
|
73
|
+
readonly 'system-schema.description': "System type: cannot add or remove fields.";
|
|
74
|
+
readonly 'remove.button': "Remove";
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
}];
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export default meta;
|
|
81
|
+
type Story = StoryObj<typeof meta>;
|
|
82
|
+
export declare const Default: Story;
|
|
83
|
+
export declare const FieldSet: Story;
|
|
84
|
+
//# sourceMappingURL=Settings.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Settings.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Settings/Settings.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAmC1B,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQM,CAAC;AAEjB,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AA6CjC,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as SchemaAST from 'effect/SchemaAST';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Props for a custom field renderer.
|
|
5
|
+
* The renderer provides the control only; SettingsItem wrapper is handled by FieldSet.
|
|
6
|
+
*/
|
|
7
|
+
export type SettingsFieldProps<T = any> = {
|
|
8
|
+
value: T;
|
|
9
|
+
onChange: (value: T) => void;
|
|
10
|
+
readonly?: boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Map of property names to custom field renderers.
|
|
14
|
+
*/
|
|
15
|
+
export type SettingsFieldMap = Record<string, React.FC<SettingsFieldProps>>;
|
|
16
|
+
export type SettingsFieldSetProps<T extends Record<string, any> = Record<string, any>> = {
|
|
17
|
+
/** Effect Schema for the settings object. */
|
|
18
|
+
schema: {
|
|
19
|
+
ast: SchemaAST.AST;
|
|
20
|
+
};
|
|
21
|
+
/** Current settings values. */
|
|
22
|
+
values: T;
|
|
23
|
+
/** Callback when any value changes. Receives a new complete object. */
|
|
24
|
+
onValuesChanged?: (values: T) => void;
|
|
25
|
+
/** When true, all controls are disabled. */
|
|
26
|
+
readonly?: boolean;
|
|
27
|
+
/** Map of property names to custom field renderers. */
|
|
28
|
+
fieldMap?: SettingsFieldMap;
|
|
29
|
+
/** Control field visibility. Return false to hide a field. */
|
|
30
|
+
visible?: (path: string, values: T) => boolean;
|
|
31
|
+
/** Override the order of fields. Fields not listed are appended in schema order. */
|
|
32
|
+
sort?: string[];
|
|
33
|
+
};
|
|
34
|
+
export declare const SettingsFieldSet: {
|
|
35
|
+
<T extends Record<string, any>>({ schema, values, onValuesChanged, readonly, fieldMap, visible, sort, }: SettingsFieldSetProps<T>): React.JSX.Element;
|
|
36
|
+
displayName: string;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=SettingsFieldSet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsFieldSet.d.ts","sourceRoot":"","sources":["../../../../../src/components/Settings/SettingsFieldSet.tsx"],"names":[],"mappings":"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ildren } from 'react';
|
|
2
|
+
import { type Label, type ThemedClassName } from '@dxos/react-ui';
|
|
3
|
+
type SettingsPanelProps = ThemedClassName<PropsWithChildren>;
|
|
4
|
+
export declare const SettingsPanel: {
|
|
5
|
+
({ classNames, children }: SettingsPanelProps): React.JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
type SettingsItemProps = PropsWithChildren<{
|
|
9
|
+
title: Label;
|
|
10
|
+
description?: Label;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const SettingsItem: {
|
|
13
|
+
({ title, description, children }: SettingsItemProps): React.JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=SettingsItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/Settings/SettingsItem.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAS,KAAK,KAAK,EAAE,KAAK,eAAe,EAAqC,MAAM,gBAAgB,CAAC;AAY5G,KAAK,kBAAkB,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;AAE7D,eAAO,MAAM,aAAa;+BAA8B,kBAAkB;;CAMzE,CAAC;AAQF,KAAK,iBAAiB,GAAG,iBAAiB,CAAC;IACzC,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,CAAC,CAAC;AAEH,eAAO,MAAM,YAAY;uCAA2C,iBAAiB;;CAoBpF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Settings/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,34 +1,32 @@
|
|
|
1
1
|
import * as Schema from 'effect/Schema';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { QueryAST } from '@dxos/echo';
|
|
4
|
-
import {
|
|
3
|
+
import { QueryAST, type SchemaRegistry } from '@dxos/echo';
|
|
4
|
+
import { View } from '@dxos/echo';
|
|
5
5
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
6
6
|
import { type QueryFormProps } from '@dxos/react-ui-components';
|
|
7
|
-
import {
|
|
8
|
-
import { type
|
|
7
|
+
import { ProjectionModel } from '@dxos/schema';
|
|
8
|
+
import { type FormRootProps } from '../Form';
|
|
9
9
|
export type ViewEditorProps = ThemedClassName<{
|
|
10
10
|
schema: Schema.Schema.AnyNoContext;
|
|
11
|
-
view:
|
|
12
|
-
mode?: 'schema' | '
|
|
13
|
-
registry?: SchemaRegistry;
|
|
14
|
-
readonly?: boolean;
|
|
11
|
+
view: View.View;
|
|
12
|
+
mode?: 'schema' | 'tag';
|
|
13
|
+
registry?: SchemaRegistry.SchemaRegistry;
|
|
15
14
|
showHeading?: boolean;
|
|
16
15
|
onQueryChanged?: (query: QueryAST.Query, target?: string) => void;
|
|
17
16
|
onDelete?: (fieldId: string) => void;
|
|
18
|
-
} & Pick<
|
|
17
|
+
} & Pick<QueryFormProps, 'types' | 'tags'> & Pick<FormRootProps<any>, 'readonly' | 'db'>>;
|
|
19
18
|
/**
|
|
20
19
|
* Schema-based object form.
|
|
21
20
|
*/
|
|
22
21
|
export declare const ViewEditor: React.ForwardRefExoticComponent<Omit<{
|
|
23
22
|
schema: Schema.Schema.AnyNoContext;
|
|
24
|
-
view:
|
|
25
|
-
mode?: "schema" | "
|
|
26
|
-
registry?: SchemaRegistry;
|
|
27
|
-
readonly?: boolean;
|
|
23
|
+
view: View.View;
|
|
24
|
+
mode?: "schema" | "tag";
|
|
25
|
+
registry?: SchemaRegistry.SchemaRegistry;
|
|
28
26
|
showHeading?: boolean;
|
|
29
27
|
onQueryChanged?: (query: QueryAST.Query, target?: string) => void;
|
|
30
28
|
onDelete?: (fieldId: string) => void;
|
|
31
|
-
} & Pick<
|
|
32
|
-
classNames?: import("@dxos/
|
|
29
|
+
} & Pick<QueryFormProps, "tags" | "types"> & Pick<FormRootProps<any>, "readonly" | "db">, "className"> & {
|
|
30
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
33
31
|
} & React.RefAttributes<ProjectionModel>>;
|
|
34
32
|
//# sourceMappingURL=ViewEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ViewEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAsF,MAAM,OAAO,CAAC;AAE3G,OAAO,EAA4C,QAAQ,EAAO,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAC1G,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAIlC,OAAO,EAA8B,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3E,OAAO,EAEL,eAAe,EAIhB,MAAM,cAAc,CAAC;AAKtB,OAAO,EAML,KAAK,aAAa,EACnB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,eAAe,GAAG,eAAe,CAC3C;IACE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IACnC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;IAChB,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IACxB,QAAQ,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAClE,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,MAAM,CAAC,GACxC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC,CAC9C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU;YAdX,MAAM,CAAC,MAAM,CAAC,YAAY;UAC5B,IAAI,CAAC,IAAI;WACR,QAAQ,GAAG,KAAK;eACZ,cAAc,CAAC,cAAc;kBAC1B,OAAO;qBACJ,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI;eACtD,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI;;;yCAyKvC,CAAC"}
|
|
@@ -1,81 +1,87 @@
|
|
|
1
1
|
import { type StoryObj } from '@storybook/react-vite';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { type View } from '@dxos/echo';
|
|
3
4
|
import { type EchoSchema } from '@dxos/echo/internal';
|
|
4
|
-
import {
|
|
5
|
+
import { type ProjectionModel } from '@dxos/schema';
|
|
5
6
|
import { type ViewEditorProps } from './ViewEditor';
|
|
6
7
|
export type ViewEditorDebugObjects = {
|
|
7
8
|
schema: EchoSchema;
|
|
8
|
-
view:
|
|
9
|
+
view: View.View;
|
|
9
10
|
projection: ProjectionModel;
|
|
10
11
|
};
|
|
11
|
-
type
|
|
12
|
+
type DefaultStoryProps = Pick<ViewEditorProps, 'readonly' | 'mode'>;
|
|
12
13
|
declare const meta: {
|
|
13
14
|
title: string;
|
|
14
|
-
render: (props:
|
|
15
|
+
render: (props: DefaultStoryProps) => React.JSX.Element;
|
|
15
16
|
decorators: import("@storybook/react").Decorator[];
|
|
16
17
|
parameters: {
|
|
17
18
|
layout: string;
|
|
18
19
|
translations: [{
|
|
19
20
|
readonly 'en-US': {
|
|
20
|
-
readonly "react-ui-form": {
|
|
21
|
-
readonly 'fields
|
|
22
|
-
readonly 'hidden
|
|
23
|
-
readonly 'empty
|
|
24
|
-
readonly '
|
|
25
|
-
readonly 'field
|
|
26
|
-
readonly 'field
|
|
27
|
-
readonly 'field
|
|
28
|
-
readonly '
|
|
29
|
-
readonly 'add
|
|
30
|
-
readonly '
|
|
31
|
-
readonly '
|
|
32
|
-
readonly '
|
|
33
|
-
readonly '
|
|
34
|
-
readonly '
|
|
35
|
-
readonly '
|
|
36
|
-
readonly '
|
|
37
|
-
readonly 'ref
|
|
38
|
-
readonly 'ref
|
|
39
|
-
readonly 'ref
|
|
40
|
-
readonly '
|
|
41
|
-
readonly '
|
|
42
|
-
readonly '
|
|
43
|
-
readonly '
|
|
44
|
-
readonly '
|
|
45
|
-
readonly '
|
|
46
|
-
readonly '
|
|
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 'format
|
|
68
|
-
readonly 'format
|
|
69
|
-
readonly 'format
|
|
70
|
-
readonly '
|
|
71
|
-
readonly '
|
|
72
|
-
readonly '
|
|
73
|
-
readonly '
|
|
74
|
-
readonly '
|
|
75
|
-
readonly '
|
|
76
|
-
readonly '
|
|
77
|
-
readonly '
|
|
78
|
-
readonly '
|
|
21
|
+
readonly "@dxos/react-ui-form": {
|
|
22
|
+
readonly 'fields.label': "Fields";
|
|
23
|
+
readonly 'hidden-fields.label': "Hidden Fields";
|
|
24
|
+
readonly 'empty-readonly-ref-field.label': "(none)";
|
|
25
|
+
readonly 'field-property.label': "Property";
|
|
26
|
+
readonly 'field-property.placeholder': "Property name";
|
|
27
|
+
readonly 'field-format.label': "Type";
|
|
28
|
+
readonly 'field-path.label': "Field path";
|
|
29
|
+
readonly 'add-item.button': "Add item";
|
|
30
|
+
readonly 'add-property-button.label': "Add property";
|
|
31
|
+
readonly 'boolean-input-true.value': "Yes";
|
|
32
|
+
readonly 'boolean-input-false.value': "No";
|
|
33
|
+
readonly 'show-field.label': "Show field";
|
|
34
|
+
readonly 'hide-field.label': "Hide field";
|
|
35
|
+
readonly 'delete-field.label': "Delete field";
|
|
36
|
+
readonly 'create-option.label': "Create";
|
|
37
|
+
readonly 'add-tag.label': "Add tag";
|
|
38
|
+
readonly 'ref-field-combobox-input.placeholder': "Search…";
|
|
39
|
+
readonly 'ref-field.placeholder': "Select…";
|
|
40
|
+
readonly 'ref-field.placeholder_one': "Select…";
|
|
41
|
+
readonly 'ref-field.placeholder_other': "Select items…";
|
|
42
|
+
readonly 'example.placeholder': "Example";
|
|
43
|
+
readonly 'latitude.placeholder': "Latitude (e.g., 40.7128)";
|
|
44
|
+
readonly 'longitude.placeholder': "Longitude (e.g., -74.0060)";
|
|
45
|
+
readonly 'cancel-button.label': "Cancel";
|
|
46
|
+
readonly 'save-button.label': "Save";
|
|
47
|
+
readonly 'create-text.label': "Create text";
|
|
48
|
+
readonly 'format.boolean.label': "Boolean";
|
|
49
|
+
readonly 'format.currency.label': "Currency";
|
|
50
|
+
readonly 'format.date.label': "Date";
|
|
51
|
+
readonly 'format.date-time.label': "DateTime";
|
|
52
|
+
readonly 'format.did.label': "DID";
|
|
53
|
+
readonly 'format.duration.label': "Duration";
|
|
54
|
+
readonly 'format.dxn.label': "DXN";
|
|
55
|
+
readonly 'format.email.label': "Email";
|
|
56
|
+
readonly 'format.formula.label': "Formula";
|
|
57
|
+
readonly 'format.hostname.label': "Hostname";
|
|
58
|
+
readonly 'format.integer.label': "Integer";
|
|
59
|
+
readonly 'format.json.label': "JSON";
|
|
60
|
+
readonly 'format.lnglat.label': "Geopoint";
|
|
61
|
+
readonly 'format.markdown.label': "Markdown";
|
|
62
|
+
readonly 'format.percent.label': "Percent";
|
|
63
|
+
readonly 'format.ref.label': "Reference";
|
|
64
|
+
readonly 'format.regex.label': "RegExp";
|
|
65
|
+
readonly 'format.string.label': "String";
|
|
66
|
+
readonly 'format.single-select.label': "Select";
|
|
67
|
+
readonly 'format.multi-select.label': "Multi-select";
|
|
68
|
+
readonly 'format.text.label': "Long text";
|
|
69
|
+
readonly 'format.time.label': "Time";
|
|
70
|
+
readonly 'format.timestamp.label': "Timestamp";
|
|
71
|
+
readonly 'format.user.label': "User";
|
|
72
|
+
readonly 'format.number.label': "Number";
|
|
73
|
+
readonly 'format.uri.label': "URI";
|
|
74
|
+
readonly 'format.url.label': "URL";
|
|
75
|
+
readonly 'format.uuid.label': "UUID";
|
|
76
|
+
readonly 'latitude.label': "Latitude";
|
|
77
|
+
readonly 'longitude.label': "Longitude";
|
|
78
|
+
readonly 'select-option.label': "Label";
|
|
79
|
+
readonly 'select-option-label.placeholder': "Option label";
|
|
80
|
+
readonly 'select-option-delete.button': "Delete";
|
|
81
|
+
readonly 'select-option-add.button': "Add option";
|
|
82
|
+
readonly 'system-schema.title': "System type";
|
|
83
|
+
readonly 'system-schema.description': "System type: cannot add or remove fields.";
|
|
84
|
+
readonly 'remove.button': "Remove";
|
|
79
85
|
};
|
|
80
86
|
};
|
|
81
87
|
}];
|
|
@@ -85,5 +91,5 @@ export default meta;
|
|
|
85
91
|
type Story = StoryObj<typeof meta>;
|
|
86
92
|
export declare const Default: Story;
|
|
87
93
|
export declare const Readonly: Story;
|
|
88
|
-
export declare const
|
|
94
|
+
export declare const TagQueryMode: Story;
|
|
89
95
|
//# sourceMappingURL=ViewEditor.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAA4D,MAAM,OAAO,CAAC;AAGjF,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"ViewEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAA4D,MAAM,OAAO,CAAC;AAGjF,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,KAAK,UAAU,EAAwB,MAAM,qBAAqB,CAAC;AAK5E,OAAO,EAAE,KAAK,eAAe,EAAmC,MAAM,cAAc,CAAC;AAKrF,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAWhE,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;IAChB,UAAU,EAAE,eAAe,CAAC;CAC7B,CAAC;AAEF,KAAK,iBAAiB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,MAAM,CAAC,CAAC;AA+HpE,QAAA,MAAM,IAAI;;oBA7HmB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiJT,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,KAItB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAI1B,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export * from './ControlSection';
|
|
2
1
|
export * from './FieldEditor';
|
|
3
2
|
export * from './Form';
|
|
3
|
+
export * from './ObjectForm';
|
|
4
4
|
export * from './ObjectPicker';
|
|
5
|
+
export * from './ObjectProperties';
|
|
6
|
+
export * from './Settings';
|
|
5
7
|
export * from './ViewEditor';
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import React, { type PropsWithChildren } from 'react';
|
|
2
|
-
|
|
3
|
-
type TestLayoutProps = ThemedClassName<PropsWithChildren<{
|
|
2
|
+
type TestLayoutProps = PropsWithChildren<{
|
|
4
3
|
json?: any;
|
|
5
|
-
}
|
|
6
|
-
export declare const TestLayout: ({
|
|
7
|
-
type TestPanelProps = ThemedClassName<PropsWithChildren>;
|
|
8
|
-
export declare const TestPanel: ({ classNames, children }: TestPanelProps) => React.JSX.Element;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const TestLayout: ({ children, json }: TestLayoutProps) => React.JSX.Element;
|
|
9
6
|
export declare const VIEW_EDITOR_DEBUG_SYMBOL: unique symbol;
|
|
10
7
|
export declare const FIELD_EDITOR_DEBUG_SYMBOL: unique symbol;
|
|
8
|
+
export declare const OBJECT_PROPERTIES_DEBUG_SYMBOL: unique symbol;
|
|
11
9
|
export {};
|
|
12
10
|
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/components/testing.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/components/testing.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAMtD,KAAK,eAAe,GAAG,iBAAiB,CAAC;IAAE,IAAI,CAAC,EAAE,GAAG,CAAA;CAAE,CAAC,CAAC;AAEzD,eAAO,MAAM,UAAU,GAAI,oBAAoB,eAAe,sBAgB7D,CAAC;AAaF,eAAO,MAAM,wBAAwB,eAA4B,CAAC;AAClE,eAAO,MAAM,yBAAyB,eAA6B,CAAC;AACpE,eAAO,MAAM,8BAA8B,eAAkC,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,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type * as Schema from 'effect/Schema';
|
|
2
|
+
import type * as SchemaAST from 'effect/SchemaAST';
|
|
3
|
+
import { type AnyProperties } from '@dxos/echo/internal';
|
|
4
|
+
import { type JsonPath } from '@dxos/effect';
|
|
5
|
+
import { type ValidationError } from '@dxos/schema';
|
|
6
|
+
import { type MaybePromise } from '@dxos/util';
|
|
7
|
+
export type FormFieldStatus = {
|
|
8
|
+
status?: 'error';
|
|
9
|
+
error?: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Form properties.
|
|
13
|
+
*/
|
|
14
|
+
export interface FormHandlerProps<T extends AnyProperties> {
|
|
15
|
+
/**
|
|
16
|
+
* Effect schema (Type literal).
|
|
17
|
+
*/
|
|
18
|
+
schema?: Schema.Schema<T, any>;
|
|
19
|
+
/**
|
|
20
|
+
* Values for the form if controlled.
|
|
21
|
+
*/
|
|
22
|
+
values?: Partial<T>;
|
|
23
|
+
/**
|
|
24
|
+
* Default values for the form which will be used if values is not provided.
|
|
25
|
+
*/
|
|
26
|
+
defaultValues?: Partial<T>;
|
|
27
|
+
/**
|
|
28
|
+
* Auto-save the form when the values change.
|
|
29
|
+
*/
|
|
30
|
+
autoSave?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Callback for value changes. Note: This is called even when values are invalid.
|
|
33
|
+
* Sometimes the parent component may want to know about changes even if the form is
|
|
34
|
+
* in an invalid state.
|
|
35
|
+
*/
|
|
36
|
+
onValuesChanged?: (values: Partial<T>, meta: FormUpdateMeta<T>) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Custom validation function that runs only after schema validation passes.
|
|
39
|
+
* Use this for complex validation logic that can't be expressed in the schema.
|
|
40
|
+
* @returns Array of validation errors, or undefined if validation passes
|
|
41
|
+
*/
|
|
42
|
+
onValidate?: (values: T) => ValidationError[] | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Called when the form is submitted and passes validation.
|
|
45
|
+
*/
|
|
46
|
+
onSave?: (values: T, meta: FormUpdateMeta<T>) => MaybePromise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Called when the form is canceled.
|
|
49
|
+
*/
|
|
50
|
+
onCancel?: () => void;
|
|
51
|
+
}
|
|
52
|
+
export type FormUpdateMeta<T extends AnyProperties> = {
|
|
53
|
+
changed: FormHandler<T>['changed'];
|
|
54
|
+
isValid: boolean;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Form handler properties and methods.
|
|
58
|
+
*/
|
|
59
|
+
export type FormHandler<T extends AnyProperties> = Pick<FormHandlerProps<T>, 'schema' | 'autoSave'> & {
|
|
60
|
+
/** Initial values (which may not pass validation). */
|
|
61
|
+
values: Partial<T>;
|
|
62
|
+
/** Map of changed fields. */
|
|
63
|
+
changed: Record<JsonPath, boolean>;
|
|
64
|
+
touched: Record<JsonPath, boolean>;
|
|
65
|
+
/** Map of error strings. */
|
|
66
|
+
errors: Record<JsonPath, string>;
|
|
67
|
+
/** Whether the form can be saved (i.e., data is valid). */
|
|
68
|
+
isValid: boolean;
|
|
69
|
+
canSave: boolean;
|
|
70
|
+
onSave: () => void;
|
|
71
|
+
onCancel: () => void;
|
|
72
|
+
getStatus: (path: string | (string | number)[]) => FormFieldStatus;
|
|
73
|
+
getValue: <V>(path: (string | number)[]) => V | undefined;
|
|
74
|
+
onBlur: (path: (string | number)[]) => void;
|
|
75
|
+
onValueChange: <V>(path: (string | number)[], type: SchemaAST.AST, value: V) => void;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Creates a hook for managing form state, including values, validation, and submission.
|
|
79
|
+
* Deeply integrated with `@dxos/schema` for schema-based validation.
|
|
80
|
+
*/
|
|
81
|
+
export declare const useFormHandler: <T extends AnyProperties>({ schema, autoSave, values: valuesProp, defaultValues: defaultValuesProp, onValuesChanged, onValidate, onSave, onCancel, ...props }: FormHandlerProps<T>) => FormHandler<T>;
|
|
82
|
+
//# sourceMappingURL=useFormHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormHandler.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useFormHandler.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,SAAS,MAAM,kBA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,WAAW,CAAC,CAAC,CA8NrC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import { type FormHandler } from './useFormHandler';
|
|
3
|
+
/**
|
|
4
|
+
* Key handler.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useKeyHandler: (elRef: RefObject<HTMLDivElement | null>, form: FormHandler<any>) => void;
|
|
7
|
+
//# sourceMappingURL=useKeyHandler.d.ts.map
|