@dxos/react-ui-form 0.8.4-main.fffef41 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +102 -5
- package/README.md +0 -1
- package/dist/lib/browser/index.mjs +4005 -2402
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/translations.mjs +87 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +4005 -2402
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/translations.mjs +89 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- 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 +73 -59
- package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.d.ts +135 -27
- package/dist/types/src/components/Form/Form.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.stories.d.ts +192 -137
- package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/FormField.d.ts +52 -0
- package/dist/types/src/components/Form/FormField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormFieldComponent.d.ts +98 -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 +26 -0
- package/dist/types/src/components/Form/FormFieldSet.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormTooltipsContext.d.ts +19 -0
- package/dist/types/src/components/Form/FormTooltipsContext.d.ts.map +1 -0
- package/dist/types/src/components/Form/Layout/FormLayout.d.ts +50 -0
- package/dist/types/src/components/Form/Layout/FormLayout.d.ts.map +1 -0
- package/dist/types/src/components/Form/Layout/FormLayout.stories.d.ts +123 -0
- package/dist/types/src/components/Form/Layout/FormLayout.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/Layout/FormLayout.stories.test.d.ts +2 -0
- package/dist/types/src/components/Form/Layout/FormLayout.stories.test.d.ts.map +1 -0
- package/dist/types/src/components/Form/Layout/FormLayout.test.d.ts +2 -0
- package/dist/types/src/components/Form/Layout/FormLayout.test.d.ts.map +1 -0
- package/dist/types/src/components/Form/Layout/annotation.d.ts +30 -0
- package/dist/types/src/components/Form/Layout/annotation.d.ts.map +1 -0
- package/dist/types/src/components/Form/Layout/index.d.ts +4 -0
- package/dist/types/src/components/Form/Layout/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/Layout/parser.d.ts +31 -0
- package/dist/types/src/components/Form/Layout/parser.d.ts.map +1 -0
- package/dist/types/src/components/Form/Layout/parser.test.d.ts +2 -0
- package/dist/types/src/components/Form/Layout/parser.test.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/DateField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/DateField.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/InlineRefField.d.ts +13 -0
- package/dist/types/src/components/Form/fields/InlineRefField.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 +89 -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 +34 -0
- package/dist/types/src/components/Form/fields/RefField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/RefField.test.d.ts +2 -0
- package/dist/types/src/components/Form/fields/RefField.test.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/SelectField.d.ts +13 -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 +89 -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 +14 -0
- package/dist/types/src/components/Form/fields/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/index.d.ts +5 -4
- package/dist/types/src/components/Form/index.d.ts.map +1 -1
- package/dist/types/src/components/Form/meta-tags.d.ts +30 -0
- package/dist/types/src/components/Form/meta-tags.d.ts.map +1 -0
- package/dist/types/src/components/Form/meta-tags.test.d.ts +2 -0
- package/dist/types/src/components/Form/meta-tags.test.d.ts.map +1 -0
- package/dist/types/src/components/ObjectForm/ObjectForm.d.ts +8 -0
- package/dist/types/src/components/ObjectForm/ObjectForm.d.ts.map +1 -0
- package/dist/types/src/components/ObjectForm/ObjectForm.stories.d.ts +87 -0
- package/dist/types/src/components/ObjectForm/ObjectForm.stories.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 +39 -12
- package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts.map +1 -1
- package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts +69 -58
- 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 +132 -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/ObjectTree/ObjectTree.d.ts +9 -0
- package/dist/types/src/components/ObjectTree/ObjectTree.d.ts.map +1 -0
- package/dist/types/src/components/ObjectTree/ObjectTree.stories.d.ts +91 -0
- package/dist/types/src/components/ObjectTree/ObjectTree.stories.d.ts.map +1 -0
- package/dist/types/src/components/ObjectTree/index.d.ts +2 -0
- package/dist/types/src/components/ObjectTree/index.d.ts.map +1 -0
- package/dist/types/src/components/RefEditor/RefEditor.d.ts +73 -0
- package/dist/types/src/components/RefEditor/RefEditor.d.ts.map +1 -0
- package/dist/types/src/components/RefEditor/RefEditor.stories.d.ts +92 -0
- package/dist/types/src/components/RefEditor/RefEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/RefEditor/index.d.ts +3 -0
- package/dist/types/src/components/RefEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/RefEditor/ref-editor-extension.d.ts +47 -0
- package/dist/types/src/components/RefEditor/ref-editor-extension.d.ts.map +1 -0
- package/dist/types/src/components/Settings/Settings.d.ts +51 -0
- package/dist/types/src/components/Settings/Settings.d.ts.map +1 -0
- package/dist/types/src/components/Settings/Settings.stories.d.ts +89 -0
- package/dist/types/src/components/Settings/Settings.stories.d.ts.map +1 -0
- package/dist/types/src/components/Settings/SettingsFieldSet.d.ts +43 -0
- package/dist/types/src/components/Settings/SettingsFieldSet.d.ts.map +1 -0
- package/dist/types/src/components/Settings/SettingsItem.d.ts +16 -0
- package/dist/types/src/components/Settings/SettingsItem.d.ts.map +1 -0
- package/dist/types/src/components/Settings/SettingsSelectField.d.ts +18 -0
- package/dist/types/src/components/Settings/SettingsSelectField.d.ts.map +1 -0
- package/dist/types/src/components/Settings/index.d.ts +4 -0
- package/dist/types/src/components/Settings/index.d.ts.map +1 -0
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +15 -19
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +75 -64
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +5 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +13 -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/index.d.ts +0 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +70 -59
- 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 +35 -0
- package/dist/types/src/util/properties.d.ts.map +1 -0
- package/dist/types/src/util/properties.test.d.ts +2 -0
- package/dist/types/src/util/properties.test.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 +64 -52
- package/src/components/FieldEditor/FieldEditor.stories.tsx +44 -25
- package/src/components/FieldEditor/FieldEditor.test.tsx +4 -2
- package/src/components/FieldEditor/FieldEditor.tsx +91 -86
- package/src/components/Form/AUDIT.md +17 -0
- package/src/components/Form/Form.stories.tsx +147 -252
- package/src/components/Form/Form.tsx +461 -108
- package/src/components/Form/FormField.tsx +345 -0
- package/src/components/Form/FormFieldComponent.stories.tsx +65 -0
- package/src/components/Form/FormFieldComponent.tsx +253 -0
- package/src/components/Form/FormFieldSet.tsx +213 -0
- package/src/components/Form/FormTooltipsContext.ts +25 -0
- package/src/components/Form/Layout/FormLayout.stories.test.tsx +51 -0
- package/src/components/Form/Layout/FormLayout.stories.tsx +422 -0
- package/src/components/Form/Layout/FormLayout.test.ts +59 -0
- package/src/components/Form/Layout/FormLayout.tsx +251 -0
- package/src/components/Form/Layout/annotation.ts +38 -0
- package/src/components/Form/Layout/index.ts +7 -0
- package/src/components/Form/Layout/parser.test.ts +120 -0
- package/src/components/Form/Layout/parser.ts +167 -0
- package/src/components/Form/README.md +3 -0
- package/src/components/Form/fields/ArrayField.tsx +173 -0
- package/src/components/Form/fields/BooleanField.tsx +22 -0
- package/src/components/Form/fields/DateField.tsx +101 -0
- package/src/components/Form/fields/GeoPointField.tsx +124 -0
- package/src/components/Form/fields/InlineRefField.tsx +138 -0
- package/src/components/Form/fields/MarkdownField.stories.tsx +206 -0
- package/src/components/Form/fields/MarkdownField.tsx +167 -0
- package/src/components/Form/fields/NumberField.tsx +76 -0
- package/src/components/Form/fields/RefField.test.ts +45 -0
- package/src/components/Form/fields/RefField.tsx +266 -0
- package/src/components/Form/fields/SelectField.tsx +77 -0
- package/src/components/Form/{custom/SelectOptionsInput.stories.tsx → fields/SelectOptionField.stories.tsx} +23 -18
- package/src/components/Form/{custom/SelectOptionsInput.tsx → fields/SelectOptionField.tsx} +33 -26
- 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} +17 -9
- package/src/components/Form/fields/index.ts +17 -0
- package/src/components/Form/index.ts +6 -4
- package/src/components/Form/meta-tags.test.ts +47 -0
- package/src/components/Form/meta-tags.ts +33 -0
- package/src/components/ObjectForm/ObjectForm.stories.tsx +62 -0
- package/src/components/ObjectForm/ObjectForm.tsx +111 -0
- package/src/components/{ControlSection → ObjectForm}/index.ts +1 -1
- package/src/components/ObjectPicker/ObjectPicker.stories.tsx +26 -21
- package/src/components/ObjectPicker/ObjectPicker.tsx +123 -82
- package/src/components/ObjectProperties/ObjectProperties.stories.tsx +350 -0
- package/src/components/ObjectProperties/ObjectProperties.test.tsx +111 -0
- package/src/components/ObjectProperties/ObjectProperties.tsx +146 -0
- package/src/components/ObjectProperties/index.ts +5 -0
- package/src/components/ObjectTree/ObjectTree.stories.tsx +134 -0
- package/src/components/ObjectTree/ObjectTree.tsx +190 -0
- package/src/components/ObjectTree/index.ts +5 -0
- package/src/components/RefEditor/RefEditor.stories.tsx +148 -0
- package/src/components/RefEditor/RefEditor.tsx +275 -0
- package/src/components/RefEditor/index.ts +6 -0
- package/src/components/RefEditor/ref-editor-extension.ts +254 -0
- package/src/components/Settings/AUDIT.md +51 -0
- package/src/components/Settings/Settings.stories.tsx +104 -0
- package/src/components/Settings/Settings.tsx +81 -0
- package/src/components/Settings/SettingsFieldSet.tsx +257 -0
- package/src/components/Settings/SettingsItem.tsx +58 -0
- package/src/components/Settings/SettingsSelectField.tsx +59 -0
- package/src/components/Settings/index.ts +7 -0
- package/src/components/ViewEditor/ViewEditor.stories.tsx +70 -76
- package/src/components/ViewEditor/ViewEditor.test.tsx +17 -13
- package/src/components/ViewEditor/ViewEditor.tsx +340 -226
- package/src/components/index.ts +5 -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/index.ts +0 -4
- package/src/translations.ts +76 -64
- package/src/util/field-type.ts +60 -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.test.ts +153 -0
- package/src/util/properties.ts +100 -0
- package/src/util/refs.ts +16 -15
- package/src/vite-env.d.ts +10 -0
- 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 -83
- 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 -78
- 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 -362
- 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,89 @@
|
|
|
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 'ref-editor.placeholder': "Type '@' to add a reference, or enter a value";
|
|
13
|
+
readonly 'ref-editor-auto.placeholder': 'Search by name, or enter a value';
|
|
14
|
+
readonly 'fields.label': 'Fields';
|
|
15
|
+
readonly 'hidden-fields.label': 'Hidden Fields';
|
|
16
|
+
readonly 'empty-readonly-ref-field.label': '(none)';
|
|
17
|
+
readonly 'field-property.label': 'Property';
|
|
18
|
+
readonly 'field-property.placeholder': 'Property name';
|
|
19
|
+
readonly 'field-format.label': 'Type';
|
|
20
|
+
readonly 'field-path.label': 'Field path';
|
|
21
|
+
readonly 'remove-item.button': 'Delete item';
|
|
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 'expand-fields.label': 'Expand';
|
|
29
|
+
readonly 'collapse-fields.label': 'Collapse';
|
|
30
|
+
readonly 'delete-field.label': 'Delete field';
|
|
31
|
+
readonly 'create-option.label': 'Create';
|
|
32
|
+
readonly 'add-tag.label': 'Add tag';
|
|
33
|
+
readonly 'ref-field-combobox-input.placeholder': 'Search\u2026';
|
|
34
|
+
readonly 'ref-field.placeholder': 'Select\u2026';
|
|
35
|
+
readonly 'ref-field.placeholder_one': 'Select\u2026';
|
|
36
|
+
readonly 'ref-field.placeholder_other': 'Select items\u2026';
|
|
37
|
+
readonly 'example.placeholder': 'Example';
|
|
38
|
+
readonly 'latitude.placeholder': 'Latitude (e.g., 40.7128)';
|
|
39
|
+
readonly 'longitude.placeholder': 'Longitude (e.g., -74.0060)';
|
|
40
|
+
readonly 'cancel-button.label': 'Cancel';
|
|
41
|
+
readonly 'save-button.label': 'Save';
|
|
42
|
+
readonly 'create-text.label': 'Create text';
|
|
43
|
+
readonly 'format.boolean.label': 'Boolean';
|
|
44
|
+
readonly 'format.currency.label': 'Currency';
|
|
45
|
+
readonly 'format.date.label': 'Date';
|
|
46
|
+
readonly 'format.date-time.label': 'DateTime';
|
|
47
|
+
readonly 'format.did.label': 'DID';
|
|
48
|
+
readonly 'format.duration.label': 'Duration';
|
|
49
|
+
readonly 'format.dxn.label': 'DXN';
|
|
50
|
+
readonly 'format.email.label': 'Email';
|
|
51
|
+
readonly 'format.formula.label': 'Formula';
|
|
52
|
+
readonly 'format.hostname.label': 'Hostname';
|
|
53
|
+
readonly 'format.integer.label': 'Integer';
|
|
54
|
+
readonly 'format.json.label': 'JSON';
|
|
55
|
+
readonly 'format.lnglat.label': 'Geopoint';
|
|
56
|
+
readonly 'format.markdown.label': 'Markdown';
|
|
57
|
+
readonly 'format.percent.label': 'Percent';
|
|
58
|
+
readonly 'format.ref.label': 'Reference';
|
|
59
|
+
readonly 'format.regex.label': 'RegExp';
|
|
60
|
+
readonly 'format.string.label': 'String';
|
|
61
|
+
readonly 'format.single-select.label': 'Select';
|
|
62
|
+
readonly 'format.multi-select.label': 'Multi-select';
|
|
63
|
+
readonly 'format.text.label': 'Long text';
|
|
64
|
+
readonly 'format.time.label': 'Time';
|
|
65
|
+
readonly 'format.timestamp.label': 'Timestamp';
|
|
66
|
+
readonly 'format.user.label': 'User';
|
|
67
|
+
readonly 'format.number.label': 'Number';
|
|
68
|
+
readonly 'format.uri.label': 'URI';
|
|
69
|
+
readonly 'format.url.label': 'URL';
|
|
70
|
+
readonly 'format.uuid.label': 'UUID';
|
|
71
|
+
readonly 'latitude.label': 'Latitude';
|
|
72
|
+
readonly 'longitude.label': 'Longitude';
|
|
73
|
+
readonly 'select-option.label': 'Label';
|
|
74
|
+
readonly 'select-option-label.placeholder': 'Option label';
|
|
75
|
+
readonly 'select-option-delete.button': 'Delete';
|
|
76
|
+
readonly 'select-option-add.button': 'Add option';
|
|
77
|
+
readonly 'system-schema.title': 'System type';
|
|
78
|
+
readonly 'system-schema.description': 'System type: cannot add or remove fields.';
|
|
79
|
+
readonly 'remove.button': 'Delete';
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
}];
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
export default meta;
|
|
86
|
+
type Story = StoryObj<typeof meta>;
|
|
87
|
+
export declare const Default: Story;
|
|
88
|
+
export declare const FieldSet: Story;
|
|
89
|
+
//# 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;AAoC1B,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQM,CAAC;eAEF,IAAI;AAEnB,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,43 @@
|
|
|
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 either a custom field renderer or a nested field map for struct fields.
|
|
14
|
+
* When a value type `T` is provided, the map shape is checked against the schema's value type.
|
|
15
|
+
*/
|
|
16
|
+
export type SettingsFieldMap<T extends Record<string, any> = Record<string, any>> = {
|
|
17
|
+
[K in keyof T]?: NonNullable<T[K]> extends Record<string, any> ? SettingsFieldMap<NonNullable<T[K]>> : React.FC<SettingsFieldProps<T[K]>>;
|
|
18
|
+
};
|
|
19
|
+
export type SettingsFieldSetProps<T extends Record<string, any> = Record<string, any>> = {
|
|
20
|
+
/** Effect Schema for the settings object. */
|
|
21
|
+
schema: {
|
|
22
|
+
ast: SchemaAST.AST;
|
|
23
|
+
};
|
|
24
|
+
/** Current settings values. */
|
|
25
|
+
values: T;
|
|
26
|
+
/** Callback when any value changes. Receives a new complete object. */
|
|
27
|
+
onValuesChanged?: (values: T) => void;
|
|
28
|
+
/** When true, all controls are disabled. */
|
|
29
|
+
readonly?: boolean;
|
|
30
|
+
/** Map of property names to custom field renderers. Nested objects map to struct sub-fields. */
|
|
31
|
+
fieldMap?: SettingsFieldMap<T>;
|
|
32
|
+
/** Control field visibility. Receives the dotted path (e.g. `'modelDefaults.edge'`) at every level. */
|
|
33
|
+
visible?: (path: string, values: T) => boolean;
|
|
34
|
+
/** Override the order of fields. Fields not listed are appended in schema order. Applied per scope. */
|
|
35
|
+
sort?: string[];
|
|
36
|
+
/** Internal: dot-path prefix used by recursive struct rendering. */
|
|
37
|
+
pathPrefix?: string;
|
|
38
|
+
};
|
|
39
|
+
export declare function SettingsFieldSet<T extends Record<string, any>>({ schema, values, onValuesChanged, readonly, fieldMap, visible, sort, pathPrefix }: SettingsFieldSetProps<T>): React.JSX.Element;
|
|
40
|
+
export declare namespace SettingsFieldSet {
|
|
41
|
+
var displayName: string;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=SettingsFieldSet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsFieldSet.d.ts","sourceRoot":"","sources":["../../../../../src/components/Settings/SettingsFieldSet.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAA+B,MAAM,OAAO,CAAC;AAYpD;;;GAGG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,GAAG,IAAI;IACxC,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI;KACjF,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC1D,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACnC,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI;IACvF,6CAA6C;IAC7C,MAAM,EAAE;QAAE,GAAG,EAAE,SAAS,CAAC,GAAG,CAAA;KAAE,CAAC;IAE/B,+BAA+B;IAC/B,MAAM,EAAE,CAAC,CAAC;IAEV,uEAAuE;IACvE,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;IAEtC,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,gGAAgG;IAChG,QAAQ,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAE/B,uGAAuG;IACvG,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC;IAE/C,uGAAuG;IACvG,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;yCAM+B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EAC9D,MAAM,EACN,MAAM,EACN,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,UAAe,EAChB,EAAE,qBAAqB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
|
+
import { type Label, type ThemedClassName } from '@dxos/react-ui';
|
|
3
|
+
type SettingsPanelProps = ThemedClassName<PropsWithChildren>;
|
|
4
|
+
export declare function SettingsPanel({ classNames, children }: SettingsPanelProps): React.JSX.Element;
|
|
5
|
+
export declare namespace SettingsPanel {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
type SettingsItemProps = PropsWithChildren<{
|
|
9
|
+
title: Label;
|
|
10
|
+
description?: Label;
|
|
11
|
+
}>;
|
|
12
|
+
export declare function SettingsItem({ title, description, children }: SettingsItemProps): React.JSX.Element;
|
|
13
|
+
export declare namespace SettingsItem {
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
16
|
+
//# 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;sCAE/B,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,kBAAkB;;;;AAY1E,KAAK,iBAAiB,GAAG,iBAAiB,CAAC;IACzC,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,CAAC,CAAC;qCAE0B,EAAE,KAAK,EAAE,WAAgB,EAAE,QAAQ,EAAE,EAAE,iBAAiB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type SettingsFieldProps } from './SettingsFieldSet';
|
|
3
|
+
export type SelectFieldOption = {
|
|
4
|
+
value: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
};
|
|
7
|
+
export type CreateSelectFieldOptions = {
|
|
8
|
+
/** Options to display. Strings are used as both value and label. */
|
|
9
|
+
options: ReadonlyArray<string | SelectFieldOption>;
|
|
10
|
+
/** Label for the sentinel option that maps to `undefined`. Defaults to `'Default'`. Pass `null` to omit. */
|
|
11
|
+
defaultLabel?: string | null;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Factory for a `SettingsFieldSet` `fieldMap` entry that renders a Select control
|
|
15
|
+
* over a fixed list of options, with an optional sentinel for `undefined`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const createSelectField: ({ options, defaultLabel, }: CreateSelectFieldOptions) => React.FC<SettingsFieldProps<string | undefined>>;
|
|
18
|
+
//# sourceMappingURL=SettingsSelectField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsSelectField.d.ts","sourceRoot":"","sources":["../../../../../src/components/Settings/SettingsSelectField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,oEAAoE;IACpE,OAAO,EAAE,aAAa,CAAC,MAAM,GAAG,iBAAiB,CAAC,CAAC;IACnD,4GAA4G;IAC5G,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,+BAG3B,wBAAwB,KAAG,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,MAAM,GAAG,SAAS,CAAC,CA6B5E,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export * from './Settings';
|
|
2
|
+
export { type SettingsFieldMap, type SettingsFieldProps, type SettingsFieldSetProps } from './SettingsFieldSet';
|
|
3
|
+
export { createSelectField, type CreateSelectFieldOptions, type SelectFieldOption } from './SettingsSelectField';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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;AAChH,OAAO,EAAE,iBAAiB,EAAE,KAAK,wBAAwB,EAAE,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,34 +1,30 @@
|
|
|
1
|
-
import * as Schema from 'effect/Schema';
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import { QueryAST } from '@dxos/echo';
|
|
4
|
-
import { type SchemaRegistry } from '@dxos/echo-db';
|
|
2
|
+
import { EID, QueryAST, type Registry, Type, View } from '@dxos/echo';
|
|
5
3
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
6
4
|
import { type QueryFormProps } from '@dxos/react-ui-components';
|
|
7
|
-
import { ProjectionModel
|
|
8
|
-
import { type
|
|
5
|
+
import { ProjectionModel } from '@dxos/schema';
|
|
6
|
+
import { type FormRootProps } from '../Form';
|
|
9
7
|
export type ViewEditorProps = ThemedClassName<{
|
|
10
|
-
|
|
8
|
+
type?: Type.AnyEntity;
|
|
11
9
|
view: View.View;
|
|
12
|
-
mode?: 'schema' | '
|
|
13
|
-
registry?:
|
|
14
|
-
readonly?: boolean;
|
|
10
|
+
mode?: 'schema' | 'tag';
|
|
11
|
+
registry?: Registry.Registry;
|
|
15
12
|
showHeading?: boolean;
|
|
16
|
-
onQueryChanged?: (query: QueryAST.Query, target?:
|
|
13
|
+
onQueryChanged?: (query: QueryAST.Query, target?: EID.EID) => void;
|
|
17
14
|
onDelete?: (fieldId: string) => void;
|
|
18
|
-
} & Pick<
|
|
15
|
+
} & Pick<QueryFormProps, 'types' | 'tags'> & Pick<FormRootProps<any>, 'readonly' | 'db'>>;
|
|
19
16
|
/**
|
|
20
17
|
* Schema-based object form.
|
|
21
18
|
*/
|
|
22
19
|
export declare const ViewEditor: React.ForwardRefExoticComponent<Omit<{
|
|
23
|
-
|
|
20
|
+
type?: Type.AnyEntity;
|
|
24
21
|
view: View.View;
|
|
25
|
-
mode?:
|
|
26
|
-
registry?:
|
|
27
|
-
readonly?: boolean;
|
|
22
|
+
mode?: 'schema' | 'tag';
|
|
23
|
+
registry?: Registry.Registry;
|
|
28
24
|
showHeading?: boolean;
|
|
29
|
-
onQueryChanged?: (query: QueryAST.Query, target?:
|
|
25
|
+
onQueryChanged?: (query: QueryAST.Query, target?: EID.EID) => void;
|
|
30
26
|
onDelete?: (fieldId: string) => void;
|
|
31
|
-
} & Pick<
|
|
32
|
-
classNames?: import("@dxos/
|
|
33
|
-
} & React.RefAttributes<ProjectionModel>>;
|
|
27
|
+
} & Pick<QueryFormProps, "tags" | "types"> & Pick<FormRootProps<any>, "db" | "readonly">, "className"> & {
|
|
28
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
29
|
+
} & React.RefAttributes<ProjectionModel | null>>;
|
|
34
30
|
//# 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,KAAsF,MAAM,OAAO,CAAC;AAE3G,OAAO,EAEL,GAAG,EAOH,QAAQ,EAER,KAAK,QAAQ,EACb,IAAI,EACJ,IAAI,EACL,MAAM,YAAY,CAAC;AAIpB,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;AAMtB,OAAO,EAML,KAAK,aAAa,EACnB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,eAAe,GAAG,eAAe,CAC3C;IACE,IAAI,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC;IACtB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;IAChB,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IACxB,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,IAAI,CAAC;IACnE,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;WAdZ,IAAI,CAAC,SAAS;UACf,IAAI,CAAC,IAAI;WACR,QAAQ,GAAG,KAAK;eACZ,QAAQ,CAAC,QAAQ;kBACd,OAAO;qBACJ,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,IAAI;eACvD,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI;;;gDA0LvC,CAAC"}
|
|
@@ -1,80 +1,91 @@
|
|
|
1
1
|
import { type StoryObj } from '@storybook/react-vite';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { type
|
|
4
|
-
import { type ProjectionModel
|
|
3
|
+
import { Type, type View } from '@dxos/echo';
|
|
4
|
+
import { type ProjectionModel } from '@dxos/schema';
|
|
5
5
|
import { type ViewEditorProps } from './ViewEditor';
|
|
6
6
|
export type ViewEditorDebugObjects = {
|
|
7
|
-
|
|
7
|
+
type: Type.AnyEntity;
|
|
8
8
|
view: View.View;
|
|
9
9
|
projection: ProjectionModel;
|
|
10
10
|
};
|
|
11
|
-
type
|
|
11
|
+
type DefaultStoryProps = Pick<ViewEditorProps, 'readonly' | 'mode'>;
|
|
12
12
|
declare const meta: {
|
|
13
13
|
title: string;
|
|
14
|
-
render: (props:
|
|
14
|
+
render: (props: DefaultStoryProps) => React.JSX.Element;
|
|
15
15
|
decorators: import("@storybook/react").Decorator[];
|
|
16
16
|
parameters: {
|
|
17
17
|
layout: string;
|
|
18
18
|
translations: [{
|
|
19
19
|
readonly 'en-US': {
|
|
20
|
-
readonly "react-ui-form": {
|
|
21
|
-
readonly '
|
|
22
|
-
readonly '
|
|
23
|
-
readonly '
|
|
24
|
-
readonly '
|
|
25
|
-
readonly 'field
|
|
26
|
-
readonly 'field
|
|
27
|
-
readonly 'field
|
|
28
|
-
readonly 'field
|
|
29
|
-
readonly '
|
|
30
|
-
readonly '
|
|
31
|
-
readonly '
|
|
32
|
-
readonly '
|
|
33
|
-
readonly 'boolean
|
|
34
|
-
readonly '
|
|
35
|
-
readonly '
|
|
36
|
-
readonly '
|
|
37
|
-
readonly '
|
|
38
|
-
readonly '
|
|
39
|
-
readonly '
|
|
40
|
-
readonly '
|
|
41
|
-
readonly '
|
|
42
|
-
readonly '
|
|
43
|
-
readonly '
|
|
44
|
-
readonly '
|
|
45
|
-
readonly '
|
|
46
|
-
readonly '
|
|
47
|
-
readonly '
|
|
48
|
-
readonly '
|
|
49
|
-
readonly '
|
|
50
|
-
readonly '
|
|
51
|
-
readonly '
|
|
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 '
|
|
70
|
-
readonly '
|
|
71
|
-
readonly 'select
|
|
72
|
-
readonly '
|
|
73
|
-
readonly '
|
|
74
|
-
readonly '
|
|
75
|
-
readonly '
|
|
76
|
-
readonly '
|
|
77
|
-
readonly '
|
|
20
|
+
readonly "@dxos/react-ui-form": {
|
|
21
|
+
readonly 'ref-editor.placeholder': "Type '@' to add a reference, or enter a value";
|
|
22
|
+
readonly 'ref-editor-auto.placeholder': 'Search by name, or enter a value';
|
|
23
|
+
readonly 'fields.label': 'Fields';
|
|
24
|
+
readonly 'hidden-fields.label': 'Hidden Fields';
|
|
25
|
+
readonly 'empty-readonly-ref-field.label': '(none)';
|
|
26
|
+
readonly 'field-property.label': 'Property';
|
|
27
|
+
readonly 'field-property.placeholder': 'Property name';
|
|
28
|
+
readonly 'field-format.label': 'Type';
|
|
29
|
+
readonly 'field-path.label': 'Field path';
|
|
30
|
+
readonly 'remove-item.button': 'Delete item';
|
|
31
|
+
readonly 'add-item.button': 'Add item';
|
|
32
|
+
readonly 'add-property-button.label': 'Add property';
|
|
33
|
+
readonly 'boolean-input-true.value': 'Yes';
|
|
34
|
+
readonly 'boolean-input-false.value': 'No';
|
|
35
|
+
readonly 'show-field.label': 'Show field';
|
|
36
|
+
readonly 'hide-field.label': 'Hide field';
|
|
37
|
+
readonly 'expand-fields.label': 'Expand';
|
|
38
|
+
readonly 'collapse-fields.label': 'Collapse';
|
|
39
|
+
readonly 'delete-field.label': 'Delete field';
|
|
40
|
+
readonly 'create-option.label': 'Create';
|
|
41
|
+
readonly 'add-tag.label': 'Add tag';
|
|
42
|
+
readonly 'ref-field-combobox-input.placeholder': 'Search\u2026';
|
|
43
|
+
readonly 'ref-field.placeholder': 'Select\u2026';
|
|
44
|
+
readonly 'ref-field.placeholder_one': 'Select\u2026';
|
|
45
|
+
readonly 'ref-field.placeholder_other': 'Select items\u2026';
|
|
46
|
+
readonly 'example.placeholder': 'Example';
|
|
47
|
+
readonly 'latitude.placeholder': 'Latitude (e.g., 40.7128)';
|
|
48
|
+
readonly 'longitude.placeholder': 'Longitude (e.g., -74.0060)';
|
|
49
|
+
readonly 'cancel-button.label': 'Cancel';
|
|
50
|
+
readonly 'save-button.label': 'Save';
|
|
51
|
+
readonly 'create-text.label': 'Create text';
|
|
52
|
+
readonly 'format.boolean.label': 'Boolean';
|
|
53
|
+
readonly 'format.currency.label': 'Currency';
|
|
54
|
+
readonly 'format.date.label': 'Date';
|
|
55
|
+
readonly 'format.date-time.label': 'DateTime';
|
|
56
|
+
readonly 'format.did.label': 'DID';
|
|
57
|
+
readonly 'format.duration.label': 'Duration';
|
|
58
|
+
readonly 'format.dxn.label': 'DXN';
|
|
59
|
+
readonly 'format.email.label': 'Email';
|
|
60
|
+
readonly 'format.formula.label': 'Formula';
|
|
61
|
+
readonly 'format.hostname.label': 'Hostname';
|
|
62
|
+
readonly 'format.integer.label': 'Integer';
|
|
63
|
+
readonly 'format.json.label': 'JSON';
|
|
64
|
+
readonly 'format.lnglat.label': 'Geopoint';
|
|
65
|
+
readonly 'format.markdown.label': 'Markdown';
|
|
66
|
+
readonly 'format.percent.label': 'Percent';
|
|
67
|
+
readonly 'format.ref.label': 'Reference';
|
|
68
|
+
readonly 'format.regex.label': 'RegExp';
|
|
69
|
+
readonly 'format.string.label': 'String';
|
|
70
|
+
readonly 'format.single-select.label': 'Select';
|
|
71
|
+
readonly 'format.multi-select.label': 'Multi-select';
|
|
72
|
+
readonly 'format.text.label': 'Long text';
|
|
73
|
+
readonly 'format.time.label': 'Time';
|
|
74
|
+
readonly 'format.timestamp.label': 'Timestamp';
|
|
75
|
+
readonly 'format.user.label': 'User';
|
|
76
|
+
readonly 'format.number.label': 'Number';
|
|
77
|
+
readonly 'format.uri.label': 'URI';
|
|
78
|
+
readonly 'format.url.label': 'URL';
|
|
79
|
+
readonly 'format.uuid.label': 'UUID';
|
|
80
|
+
readonly 'latitude.label': 'Latitude';
|
|
81
|
+
readonly 'longitude.label': 'Longitude';
|
|
82
|
+
readonly 'select-option.label': 'Label';
|
|
83
|
+
readonly 'select-option-label.placeholder': 'Option label';
|
|
84
|
+
readonly 'select-option-delete.button': 'Delete';
|
|
85
|
+
readonly 'select-option-add.button': 'Add option';
|
|
86
|
+
readonly 'system-schema.title': 'System type';
|
|
87
|
+
readonly 'system-schema.description': 'System type: cannot add or remove fields.';
|
|
88
|
+
readonly 'remove.button': 'Delete';
|
|
78
89
|
};
|
|
79
90
|
};
|
|
80
91
|
}];
|
|
@@ -84,5 +95,5 @@ export default meta;
|
|
|
84
95
|
type Story = StoryObj<typeof meta>;
|
|
85
96
|
export declare const Default: Story;
|
|
86
97
|
export declare const Readonly: Story;
|
|
87
|
-
export declare const
|
|
98
|
+
export declare const TagQueryMode: Story;
|
|
88
99
|
//# 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;
|
|
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;AAEjF,OAAO,EAAuE,IAAI,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAOlH,OAAO,EAAE,KAAK,eAAe,EAAkC,MAAM,cAAc,CAAC;AAMpF,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAWhE,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;IACrB,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;AAsHpE,QAAA,MAAM,IAAI;;oBApHmB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwIT,CAAC;eAEvB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,KAItB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAI1B,CAAC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
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 './ObjectTree';
|
|
7
|
+
export * from './RefEditor';
|
|
8
|
+
export * from './Settings';
|
|
5
9
|
export * from './ViewEditor';
|
|
6
10
|
//# 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,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
|
@@ -1,12 +1,19 @@
|
|
|
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
|
-
|
|
8
|
-
|
|
4
|
+
}>;
|
|
5
|
+
export declare const TestLayout: ({ children, json }: TestLayoutProps) => React.JSX.Element;
|
|
6
|
+
export declare const TestPanel: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
7
|
+
children?: React.ReactNode | undefined;
|
|
8
|
+
}, "className"> & {
|
|
9
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
10
|
+
} & {
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
}, "className"> & {
|
|
13
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
14
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
15
|
export declare const VIEW_EDITOR_DEBUG_SYMBOL: unique symbol;
|
|
10
16
|
export declare const FIELD_EDITOR_DEBUG_SYMBOL: unique symbol;
|
|
17
|
+
export declare const OBJECT_PROPERTIES_DEBUG_SYMBOL: unique symbol;
|
|
11
18
|
export {};
|
|
12
19
|
//# 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,uBAAwB,eAAe,sBAgB7D,CAAC;AAIF,eAAO,MAAM,SAAS;;;;;;;;2HAMpB,CAAC;AAGH,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 { SchemaEx } 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<SchemaEx.JsonPath, boolean>;
|
|
64
|
+
touched: Record<SchemaEx.JsonPath, boolean>;
|
|
65
|
+
/** Map of error strings. */
|
|
66
|
+
errors: Record<SchemaEx.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,kBAAkB,CAAC;AAGnD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,aAAa;IACvD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAE/B;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAExE;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,eAAe,EAAE,GAAG,SAAS,CAAC;IAE1D;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;IAEpE;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,aAAa,IAAI;IACpD,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,aAAa,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC,GAAG;IACpG,sDAAsD;IACtD,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAEnB,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAE5C,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAE5C,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAE1C,2DAA2D;IAC3D,OAAO,EAAE,OAAO,CAAC;IAEjB,OAAO,EAAE,OAAO,CAAC;IAEjB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IAMrB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,eAAe,CAAC;IACnE,QAAQ,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC;IAC1D,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC;IAC5C,aAAa,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CACtF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,aAAa,uIAUnD,gBAAgB,CAAC,CAAC,CAAC,KAAG,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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeyHandler.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useKeyHandler.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAgC,MAAM,OAAO,CAAC;AAIrE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,aAAa,UAAW,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,QAAQ,WAAW,CAAC,GAAG,CAAC,SAuB5F,CAAC"}
|