@dxos/react-ui-form 0.9.0 → 0.9.1-staging.ee54ba693a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/index.mjs +2337 -1919
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +2337 -1919
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/annotations.d.ts +47 -0
- package/dist/types/src/annotations.d.ts.map +1 -0
- package/dist/types/src/components/FieldEditor/FieldEditor.d.ts +3 -3
- package/dist/types/src/components/FieldEditor/FieldEditor.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.d.ts +23 -110
- package/dist/types/src/components/Form/Form.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.stories.d.ts +48 -101
- package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.theme.d.ts +252 -0
- package/dist/types/src/components/Form/Form.theme.d.ts.map +1 -0
- package/dist/types/src/components/Form/Form.theme.test.d.ts +2 -0
- package/dist/types/src/components/Form/Form.theme.test.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormControls.d.ts +75 -0
- package/dist/types/src/components/Form/FormControls.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/FormField.d.ts +44 -0
- package/dist/types/src/components/Form/FormField/FormField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/FormFieldHeader.d.ts +27 -0
- package/dist/types/src/components/Form/FormField/FormFieldHeader.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/FormRow.d.ts +85 -0
- package/dist/types/src/components/Form/FormField/FormRow.d.ts.map +1 -0
- package/dist/types/src/components/Form/{FormFieldComponent.stories.d.ts → FormField/FormRow.stories.d.ts} +6 -3
- package/dist/types/src/components/Form/FormField/FormRow.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/{fields → FormField/fields/ArrayField}/ArrayField.d.ts +2 -2
- package/dist/types/src/components/Form/FormField/fields/ArrayField/ArrayField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/ArrayField/ArrayField.stories.d.ts +88 -0
- package/dist/types/src/components/Form/FormField/fields/ArrayField/ArrayField.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/ArrayField/index.d.ts +2 -0
- package/dist/types/src/components/Form/FormField/fields/ArrayField/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/AsyncSelectField/AsyncSelectField.d.ts +12 -0
- package/dist/types/src/components/Form/FormField/fields/AsyncSelectField/AsyncSelectField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/AsyncSelectField/index.d.ts +2 -0
- package/dist/types/src/components/Form/FormField/fields/AsyncSelectField/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/AutofillField/AutofillField.d.ts +12 -0
- package/dist/types/src/components/Form/FormField/fields/AutofillField/AutofillField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/AutofillField/index.d.ts +2 -0
- package/dist/types/src/components/Form/FormField/fields/AutofillField/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/BooleanField/BooleanField.d.ts +4 -0
- package/dist/types/src/components/Form/FormField/fields/BooleanField/BooleanField.d.ts.map +1 -0
- package/dist/types/src/components/{Settings/Settings.stories.d.ts → Form/FormField/fields/BooleanField/BooleanField.stories.d.ts} +1 -2
- package/dist/types/src/components/Form/FormField/fields/BooleanField/BooleanField.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/BooleanField/index.d.ts +2 -0
- package/dist/types/src/components/Form/FormField/fields/BooleanField/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/ComboboxField/ComboboxField.d.ts +12 -0
- package/dist/types/src/components/Form/FormField/fields/ComboboxField/ComboboxField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/ComboboxField/index.d.ts +2 -0
- package/dist/types/src/components/Form/FormField/fields/ComboboxField/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/DateField/DateField.d.ts +4 -0
- package/dist/types/src/components/Form/FormField/fields/DateField/DateField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/DateField/DateField.stories.d.ts +88 -0
- package/dist/types/src/components/Form/FormField/fields/DateField/DateField.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/DateField/index.d.ts +2 -0
- package/dist/types/src/components/Form/FormField/fields/DateField/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/GeoPointField/GeoPointField.d.ts +5 -0
- package/dist/types/src/components/Form/FormField/fields/GeoPointField/GeoPointField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/GeoPointField/GeoPointField.stories.d.ts +88 -0
- package/dist/types/src/components/Form/FormField/fields/GeoPointField/GeoPointField.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/GeoPointField/index.d.ts +2 -0
- package/dist/types/src/components/Form/FormField/fields/GeoPointField/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/{fields → FormField/fields/MarkdownField}/MarkdownField.d.ts +2 -2
- package/dist/types/src/components/Form/FormField/fields/MarkdownField/MarkdownField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/MarkdownField/MarkdownField.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/MarkdownField/index.d.ts +2 -0
- package/dist/types/src/components/Form/FormField/fields/MarkdownField/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/NumberField/NumberField.d.ts +15 -0
- package/dist/types/src/components/Form/FormField/fields/NumberField/NumberField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/NumberField/NumberField.stories.d.ts +88 -0
- package/dist/types/src/components/Form/FormField/fields/NumberField/NumberField.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/NumberField/NumberField.test.d.ts +2 -0
- package/dist/types/src/components/Form/FormField/fields/NumberField/NumberField.test.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/NumberField/index.d.ts +2 -0
- package/dist/types/src/components/Form/FormField/fields/NumberField/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/PasswordField/PasswordField.d.ts +4 -0
- package/dist/types/src/components/Form/FormField/fields/PasswordField/PasswordField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/PasswordField/PasswordField.stories.d.ts +88 -0
- package/dist/types/src/components/Form/FormField/fields/PasswordField/PasswordField.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/PasswordField/index.d.ts +2 -0
- package/dist/types/src/components/Form/FormField/fields/PasswordField/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/RefField/InlineRefField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/RefField/RefField.d.ts +16 -0
- package/dist/types/src/components/Form/FormField/fields/RefField/RefField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/RefField/RefField.stories.d.ts +92 -0
- package/dist/types/src/components/Form/FormField/fields/RefField/RefField.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/RefField/RefField.test.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/RefField/index.d.ts +3 -0
- package/dist/types/src/components/Form/FormField/fields/RefField/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/SelectField/SelectField.d.ts +29 -0
- package/dist/types/src/components/Form/FormField/fields/SelectField/SelectField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/SelectField/SelectField.stories.d.ts +88 -0
- package/dist/types/src/components/Form/FormField/fields/SelectField/SelectField.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/SelectField/index.d.ts +2 -0
- package/dist/types/src/components/Form/FormField/fields/SelectField/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/SelectOptionField/SelectOptionField.d.ts +5 -0
- package/dist/types/src/components/Form/FormField/fields/SelectOptionField/SelectOptionField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/SelectOptionField/SelectOptionField.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/SelectOptionField/index.d.ts +2 -0
- package/dist/types/src/components/Form/FormField/fields/SelectOptionField/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/TextAreaField/TextAreaField.d.ts +4 -0
- package/dist/types/src/components/Form/FormField/fields/TextAreaField/TextAreaField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/TextAreaField/TextAreaField.stories.d.ts +88 -0
- package/dist/types/src/components/Form/FormField/fields/TextAreaField/TextAreaField.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/TextAreaField/index.d.ts +2 -0
- package/dist/types/src/components/Form/FormField/fields/TextAreaField/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/TextField/TextField.d.ts +4 -0
- package/dist/types/src/components/Form/FormField/fields/TextField/TextField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/TextField/TextField.stories.d.ts +88 -0
- package/dist/types/src/components/Form/FormField/fields/TextField/TextField.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/TextField/index.d.ts +2 -0
- package/dist/types/src/components/Form/FormField/fields/TextField/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/{fields → FormField/fields/TupleField}/TupleField.d.ts +2 -2
- package/dist/types/src/components/Form/FormField/fields/TupleField/TupleField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/TupleField/TupleField.stories.d.ts +88 -0
- package/dist/types/src/components/Form/FormField/fields/TupleField/TupleField.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/fields/TupleField/index.d.ts +2 -0
- package/dist/types/src/components/Form/FormField/fields/TupleField/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/{fields → FormField/fields}/index.d.ts +4 -1
- package/dist/types/src/components/Form/FormField/fields/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/index.d.ts +6 -0
- package/dist/types/src/components/Form/FormField/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormField/presentation.d.ts +22 -0
- package/dist/types/src/components/Form/FormField/presentation.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormFieldSet/FormFieldSet.d.ts +30 -0
- package/dist/types/src/components/Form/FormFieldSet/FormFieldSet.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormFieldSet/FormFieldSetContainer.d.ts +22 -0
- package/dist/types/src/components/Form/FormFieldSet/FormFieldSetContainer.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormFieldSet/index.d.ts +3 -0
- package/dist/types/src/components/Form/FormFieldSet/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/{Layout → FormLayout}/FormLayout.d.ts +2 -0
- package/dist/types/src/components/Form/FormLayout/FormLayout.d.ts.map +1 -0
- package/dist/types/src/components/Form/{Layout → FormLayout}/FormLayout.stories.d.ts +5 -5
- package/dist/types/src/components/Form/FormLayout/FormLayout.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormLayout/FormLayout.stories.test.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormLayout/FormLayout.test.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormLayout/index.d.ts +3 -0
- package/dist/types/src/components/Form/FormLayout/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormLayout/parser.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormLayout/parser.test.d.ts.map +1 -0
- package/dist/types/src/components/Form/index.d.ts +3 -5
- package/dist/types/src/components/Form/index.d.ts.map +1 -1
- package/dist/types/src/components/Form/meta-tags.d.ts +1 -12
- package/dist/types/src/components/Form/meta-tags.d.ts.map +1 -1
- package/dist/types/src/components/ObjectForm/ObjectForm.d.ts.map +1 -1
- package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts +6 -23
- package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts.map +1 -1
- package/dist/types/src/components/ObjectProperties/ObjectProperties.d.ts +2 -1
- package/dist/types/src/components/ObjectProperties/ObjectProperties.d.ts.map +1 -1
- package/dist/types/src/components/RefEditor/RefEditor.stories.d.ts +2 -2
- package/dist/types/src/components/RefEditor/RefEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +1 -1
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +2 -2
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useAsyncFieldEffect.d.ts +24 -0
- package/dist/types/src/hooks/useAsyncFieldEffect.d.ts.map +1 -0
- package/dist/types/src/hooks/useFormContext.d.ts +42 -0
- package/dist/types/src/hooks/useFormContext.d.ts.map +1 -0
- package/dist/types/src/hooks/useFormHandler.d.ts +9 -6
- package/dist/types/src/hooks/useFormHandler.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/{components/testing.d.ts → testing/TestLayout.d.ts} +2 -2
- package/dist/types/src/testing/TestLayout.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +3 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/schema.d.ts +40 -0
- package/dist/types/src/testing/schema.d.ts.map +1 -0
- package/dist/types/src/types.d.ts +161 -0
- package/dist/types/src/types.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +1 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/omit.d.ts +12 -0
- package/dist/types/src/util/omit.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +43 -41
- package/src/annotations.ts +63 -0
- package/src/components/FieldEditor/FieldEditor.stories.tsx +1 -1
- package/src/components/FieldEditor/FieldEditor.test.tsx +1 -1
- package/src/components/FieldEditor/FieldEditor.tsx +10 -6
- package/src/components/Form/DESIGN.md +24 -0
- package/src/components/Form/Form.stories.tsx +260 -61
- package/src/components/Form/Form.theme.test.ts +33 -0
- package/src/components/Form/Form.theme.ts +86 -0
- package/src/components/Form/Form.tsx +30 -453
- package/src/components/Form/FormControls.tsx +377 -0
- package/src/components/Form/{FormField.tsx → FormField/FormField.tsx} +98 -71
- package/src/components/Form/FormField/FormFieldHeader.tsx +68 -0
- package/src/components/Form/FormField/FormRow.stories.tsx +97 -0
- package/src/components/Form/FormField/FormRow.tsx +298 -0
- package/src/components/Form/FormField/fields/ArrayField/ArrayField.stories.tsx +119 -0
- package/src/components/Form/FormField/fields/ArrayField/ArrayField.tsx +328 -0
- package/src/components/Form/FormField/fields/ArrayField/index.ts +5 -0
- package/src/components/Form/FormField/fields/AsyncSelectField/AsyncSelectField.tsx +59 -0
- package/src/components/Form/FormField/fields/AsyncSelectField/index.ts +5 -0
- package/src/components/Form/FormField/fields/AutofillField/AutofillField.tsx +67 -0
- package/src/components/Form/FormField/fields/AutofillField/index.ts +5 -0
- package/src/components/Form/FormField/fields/BooleanField/BooleanField.stories.tsx +52 -0
- package/src/components/Form/FormField/fields/BooleanField/BooleanField.tsx +28 -0
- package/src/components/Form/FormField/fields/BooleanField/index.ts +5 -0
- package/src/components/Form/FormField/fields/ComboboxField/ComboboxField.tsx +104 -0
- package/src/components/Form/FormField/fields/ComboboxField/index.ts +5 -0
- package/src/components/Form/FormField/fields/DateField/DateField.stories.tsx +60 -0
- package/src/components/Form/{fields → FormField/fields/DateField}/DateField.tsx +12 -10
- package/src/components/Form/FormField/fields/DateField/index.ts +5 -0
- package/src/components/Form/FormField/fields/GeoPointField/GeoPointField.stories.tsx +53 -0
- package/src/components/Form/{fields → FormField/fields/GeoPointField}/GeoPointField.tsx +19 -21
- package/src/components/Form/FormField/fields/GeoPointField/index.ts +5 -0
- package/src/components/Form/{fields → FormField/fields/MarkdownField}/MarkdownField.stories.tsx +8 -8
- package/src/components/Form/{fields → FormField/fields/MarkdownField}/MarkdownField.tsx +41 -41
- package/src/components/Form/FormField/fields/MarkdownField/index.ts +5 -0
- package/src/components/Form/FormField/fields/NumberField/NumberField.stories.tsx +52 -0
- package/src/components/Form/FormField/fields/NumberField/NumberField.test.ts +29 -0
- package/src/components/Form/FormField/fields/NumberField/NumberField.tsx +140 -0
- package/src/components/Form/FormField/fields/NumberField/index.ts +5 -0
- package/src/components/Form/FormField/fields/PasswordField/PasswordField.stories.tsx +53 -0
- package/src/components/Form/FormField/fields/PasswordField/PasswordField.tsx +41 -0
- package/src/components/Form/FormField/fields/PasswordField/index.ts +5 -0
- package/src/components/Form/{fields → FormField/fields/RefField}/InlineRefField.tsx +21 -14
- package/src/components/Form/FormField/fields/RefField/RefField.stories.tsx +97 -0
- package/src/components/Form/{fields → FormField/fields/RefField}/RefField.test.ts +10 -1
- package/src/components/Form/{fields → FormField/fields/RefField}/RefField.tsx +55 -47
- package/src/components/Form/FormField/fields/RefField/index.ts +6 -0
- package/src/components/Form/FormField/fields/SelectField/SelectField.stories.tsx +53 -0
- package/src/components/Form/FormField/fields/SelectField/SelectField.tsx +136 -0
- package/src/components/Form/FormField/fields/SelectField/index.ts +5 -0
- package/src/components/Form/{fields → FormField/fields/SelectOptionField}/SelectOptionField.stories.tsx +5 -5
- package/src/components/Form/{fields → FormField/fields/SelectOptionField}/SelectOptionField.tsx +56 -54
- package/src/components/Form/FormField/fields/SelectOptionField/index.ts +5 -0
- package/src/components/Form/FormField/fields/TextAreaField/TextAreaField.stories.tsx +53 -0
- package/src/components/Form/{fields → FormField/fields/TextAreaField}/TextAreaField.tsx +6 -4
- package/src/components/Form/FormField/fields/TextAreaField/index.ts +5 -0
- package/src/components/Form/FormField/fields/TextField/TextField.stories.tsx +52 -0
- package/src/components/Form/{fields → FormField/fields/TextField}/TextField.tsx +6 -4
- package/src/components/Form/FormField/fields/TextField/index.ts +5 -0
- package/src/components/Form/FormField/fields/TupleField/TupleField.stories.tsx +55 -0
- package/src/components/Form/{fields → FormField/fields/TupleField}/TupleField.tsx +4 -2
- package/src/components/Form/FormField/fields/TupleField/index.ts +5 -0
- package/src/components/Form/{fields → FormField/fields}/index.ts +4 -1
- package/src/components/Form/FormField/index.ts +10 -0
- package/src/components/Form/FormField/presentation.tsx +32 -0
- package/src/components/Form/{FormFieldSet.tsx → FormFieldSet/FormFieldSet.tsx} +53 -90
- package/src/components/Form/FormFieldSet/FormFieldSetContainer.tsx +93 -0
- package/src/components/Form/FormFieldSet/index.ts +6 -0
- package/src/components/Form/{Layout → FormLayout}/FormLayout.stories.tsx +11 -9
- package/src/components/Form/{Layout → FormLayout}/FormLayout.tsx +29 -18
- package/src/components/Form/FormLayout/index.ts +6 -0
- package/src/components/Form/index.ts +3 -5
- package/src/components/Form/meta-tags.test.ts +1 -1
- package/src/components/Form/meta-tags.ts +1 -1
- package/src/components/ObjectForm/ObjectForm.tsx +15 -14
- package/src/components/ObjectPicker/ObjectPicker.tsx +20 -27
- package/src/components/ObjectProperties/ObjectProperties.stories.tsx +2 -2
- package/src/components/ObjectProperties/ObjectProperties.test.tsx +1 -1
- package/src/components/ObjectProperties/ObjectProperties.tsx +13 -8
- package/src/components/RefEditor/RefEditor.stories.tsx +2 -3
- package/src/components/RefEditor/RefEditor.tsx +1 -1
- package/src/components/ViewEditor/ViewEditor.stories.tsx +6 -7
- package/src/components/ViewEditor/ViewEditor.test.tsx +9 -3
- package/src/components/ViewEditor/ViewEditor.tsx +98 -128
- package/src/components/index.ts +0 -1
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useAsyncFieldEffect.ts +81 -0
- package/src/hooks/useFormContext.ts +89 -0
- package/src/hooks/useFormHandler.ts +12 -10
- package/src/index.ts +2 -0
- package/src/{components/testing.tsx → testing/TestLayout.tsx} +16 -13
- package/src/testing/index.ts +7 -0
- package/src/testing/schema.ts +59 -0
- package/src/types.ts +186 -0
- package/src/util/index.ts +1 -1
- package/src/util/omit.ts +61 -0
- package/src/util/properties.test.ts +110 -28
- package/src/util/refs.ts +1 -1
- package/src/vitest-setup.ts +40 -0
- package/dist/types/src/components/Form/FormField.d.ts +0 -52
- package/dist/types/src/components/Form/FormField.d.ts.map +0 -1
- package/dist/types/src/components/Form/FormFieldComponent.d.ts +0 -98
- package/dist/types/src/components/Form/FormFieldComponent.d.ts.map +0 -1
- package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts.map +0 -1
- package/dist/types/src/components/Form/FormFieldSet.d.ts +0 -26
- package/dist/types/src/components/Form/FormFieldSet.d.ts.map +0 -1
- package/dist/types/src/components/Form/FormTooltipsContext.d.ts +0 -19
- package/dist/types/src/components/Form/FormTooltipsContext.d.ts.map +0 -1
- package/dist/types/src/components/Form/Layout/FormLayout.d.ts.map +0 -1
- package/dist/types/src/components/Form/Layout/FormLayout.stories.d.ts.map +0 -1
- package/dist/types/src/components/Form/Layout/FormLayout.stories.test.d.ts.map +0 -1
- package/dist/types/src/components/Form/Layout/FormLayout.test.d.ts.map +0 -1
- package/dist/types/src/components/Form/Layout/annotation.d.ts +0 -30
- package/dist/types/src/components/Form/Layout/annotation.d.ts.map +0 -1
- package/dist/types/src/components/Form/Layout/index.d.ts +0 -4
- package/dist/types/src/components/Form/Layout/index.d.ts.map +0 -1
- package/dist/types/src/components/Form/Layout/parser.d.ts.map +0 -1
- package/dist/types/src/components/Form/Layout/parser.test.d.ts.map +0 -1
- package/dist/types/src/components/Form/fields/ArrayField.d.ts.map +0 -1
- package/dist/types/src/components/Form/fields/BooleanField.d.ts +0 -4
- package/dist/types/src/components/Form/fields/BooleanField.d.ts.map +0 -1
- package/dist/types/src/components/Form/fields/DateField.d.ts +0 -4
- package/dist/types/src/components/Form/fields/DateField.d.ts.map +0 -1
- package/dist/types/src/components/Form/fields/GeoPointField.d.ts +0 -5
- package/dist/types/src/components/Form/fields/GeoPointField.d.ts.map +0 -1
- package/dist/types/src/components/Form/fields/InlineRefField.d.ts.map +0 -1
- package/dist/types/src/components/Form/fields/MarkdownField.d.ts.map +0 -1
- package/dist/types/src/components/Form/fields/MarkdownField.stories.d.ts.map +0 -1
- package/dist/types/src/components/Form/fields/NumberField.d.ts +0 -4
- package/dist/types/src/components/Form/fields/NumberField.d.ts.map +0 -1
- package/dist/types/src/components/Form/fields/RefField.d.ts +0 -34
- package/dist/types/src/components/Form/fields/RefField.d.ts.map +0 -1
- package/dist/types/src/components/Form/fields/RefField.test.d.ts.map +0 -1
- package/dist/types/src/components/Form/fields/SelectField.d.ts +0 -13
- package/dist/types/src/components/Form/fields/SelectField.d.ts.map +0 -1
- package/dist/types/src/components/Form/fields/SelectOptionField.d.ts +0 -5
- package/dist/types/src/components/Form/fields/SelectOptionField.d.ts.map +0 -1
- package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts.map +0 -1
- package/dist/types/src/components/Form/fields/TextAreaField.d.ts +0 -4
- package/dist/types/src/components/Form/fields/TextAreaField.d.ts.map +0 -1
- package/dist/types/src/components/Form/fields/TextField.d.ts +0 -4
- package/dist/types/src/components/Form/fields/TextField.d.ts.map +0 -1
- package/dist/types/src/components/Form/fields/TupleField.d.ts.map +0 -1
- package/dist/types/src/components/Form/fields/index.d.ts.map +0 -1
- package/dist/types/src/components/Settings/Settings.d.ts +0 -51
- package/dist/types/src/components/Settings/Settings.d.ts.map +0 -1
- package/dist/types/src/components/Settings/Settings.stories.d.ts.map +0 -1
- package/dist/types/src/components/Settings/SettingsFieldSet.d.ts +0 -43
- package/dist/types/src/components/Settings/SettingsFieldSet.d.ts.map +0 -1
- package/dist/types/src/components/Settings/SettingsItem.d.ts +0 -16
- package/dist/types/src/components/Settings/SettingsItem.d.ts.map +0 -1
- package/dist/types/src/components/Settings/SettingsSelectField.d.ts +0 -18
- package/dist/types/src/components/Settings/SettingsSelectField.d.ts.map +0 -1
- package/dist/types/src/components/Settings/index.d.ts +0 -4
- package/dist/types/src/components/Settings/index.d.ts.map +0 -1
- package/dist/types/src/components/testing.d.ts.map +0 -1
- package/dist/types/src/util/field-type.d.ts +0 -19
- package/dist/types/src/util/field-type.d.ts.map +0 -1
- package/src/components/Form/AUDIT.md +0 -17
- package/src/components/Form/FormFieldComponent.stories.tsx +0 -65
- package/src/components/Form/FormFieldComponent.tsx +0 -253
- package/src/components/Form/FormTooltipsContext.ts +0 -25
- package/src/components/Form/Layout/annotation.ts +0 -38
- package/src/components/Form/Layout/index.ts +0 -7
- package/src/components/Form/README.md +0 -3
- package/src/components/Form/fields/ArrayField.tsx +0 -173
- package/src/components/Form/fields/BooleanField.tsx +0 -22
- package/src/components/Form/fields/NumberField.tsx +0 -76
- package/src/components/Form/fields/SelectField.tsx +0 -77
- package/src/components/Settings/AUDIT.md +0 -51
- package/src/components/Settings/Settings.stories.tsx +0 -104
- package/src/components/Settings/Settings.tsx +0 -81
- package/src/components/Settings/SettingsFieldSet.tsx +0 -257
- package/src/components/Settings/SettingsItem.tsx +0 -58
- package/src/components/Settings/SettingsSelectField.tsx +0 -59
- package/src/components/Settings/index.ts +0 -7
- package/src/util/field-type.ts +0 -60
- /package/dist/types/src/components/Form/{fields → FormField/fields/MarkdownField}/MarkdownField.stories.d.ts +0 -0
- /package/dist/types/src/components/Form/{fields → FormField/fields/RefField}/InlineRefField.d.ts +0 -0
- /package/dist/types/src/components/Form/{fields → FormField/fields/RefField}/RefField.test.d.ts +0 -0
- /package/dist/types/src/components/Form/{fields → FormField/fields/SelectOptionField}/SelectOptionField.stories.d.ts +0 -0
- /package/dist/types/src/components/Form/{Layout → FormLayout}/FormLayout.stories.test.d.ts +0 -0
- /package/dist/types/src/components/Form/{Layout → FormLayout}/FormLayout.test.d.ts +0 -0
- /package/dist/types/src/components/Form/{Layout → FormLayout}/parser.d.ts +0 -0
- /package/dist/types/src/components/Form/{Layout → FormLayout}/parser.test.d.ts +0 -0
- /package/src/components/Form/{Layout → FormLayout}/FormLayout.stories.test.tsx +0 -0
- /package/src/components/Form/{Layout → FormLayout}/FormLayout.test.ts +0 -0
- /package/src/components/Form/{Layout → FormLayout}/parser.test.ts +0 -0
- /package/src/components/Form/{Layout → FormLayout}/parser.ts +0 -0
|
@@ -2,22 +2,27 @@
|
|
|
2
2
|
// Copyright 2026 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
5
6
|
import * as Schema from 'effect/Schema';
|
|
6
7
|
import * as SchemaAST from 'effect/SchemaAST';
|
|
7
8
|
import { describe, test } from 'vitest';
|
|
8
9
|
|
|
9
|
-
import {
|
|
10
|
+
import { Annotation, DXN, JsonSchema, Type } from '@dxos/echo';
|
|
10
11
|
import { Format } from '@dxos/echo/Format';
|
|
11
12
|
import { SchemaEx } from '@dxos/effect';
|
|
12
13
|
|
|
14
|
+
import { AutofillAnnotation, OptionsLookupAnnotation, autofill, optionsLookup } from '../annotations';
|
|
15
|
+
import { omitId } from './omit';
|
|
13
16
|
import { getFormProperties, getRootFormProperties } from './properties';
|
|
14
17
|
|
|
15
18
|
describe('getFormProperties', () => {
|
|
16
19
|
test('filters out keyword fields annotated FormInputAnnotation.set(false)', ({ expect }) => {
|
|
17
|
-
const TestSchema =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
const TestSchema = Type.makeObject(DXN.make('org.dxos.test.keywordHidden', '0.1.0'))(
|
|
21
|
+
Schema.Struct({
|
|
22
|
+
name: Schema.optional(Schema.String),
|
|
23
|
+
hidden: Schema.String.pipe(Annotation.FormInputAnnotation.set(false)),
|
|
24
|
+
}),
|
|
25
|
+
);
|
|
21
26
|
|
|
22
27
|
const names = getFormProperties(Type.getSchema(TestSchema).ast).map((prop) => prop.name);
|
|
23
28
|
expect(names).toContain('name');
|
|
@@ -28,10 +33,12 @@ describe('getFormProperties', () => {
|
|
|
28
33
|
// Regression: JsonSchema fields are a Schema.Struct; encodedBoundAST strips
|
|
29
34
|
// annotations from non-keyword inner types, which previously bypassed the
|
|
30
35
|
// form-input filter (e.g., Routine.input).
|
|
31
|
-
const TestSchema =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
const TestSchema = Type.makeObject(DXN.make('org.dxos.test.structHidden', '0.1.0'))(
|
|
37
|
+
Schema.Struct({
|
|
38
|
+
name: Schema.optional(Schema.String),
|
|
39
|
+
schema: JsonSchema.JsonSchema.pipe(Annotation.FormInputAnnotation.set(false)),
|
|
40
|
+
}),
|
|
41
|
+
);
|
|
35
42
|
|
|
36
43
|
const names = getFormProperties(Type.getSchema(TestSchema).ast).map((prop) => prop.name);
|
|
37
44
|
expect(names).toContain('name');
|
|
@@ -39,10 +46,12 @@ describe('getFormProperties', () => {
|
|
|
39
46
|
});
|
|
40
47
|
|
|
41
48
|
test('filters out array fields annotated FormInputAnnotation.set(false)', ({ expect }) => {
|
|
42
|
-
const TestSchema =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
const TestSchema = Type.makeObject(DXN.make('org.dxos.test.arrayHidden', '0.1.0'))(
|
|
50
|
+
Schema.Struct({
|
|
51
|
+
name: Schema.optional(Schema.String),
|
|
52
|
+
context: Schema.Array(Schema.Any).pipe(Annotation.FormInputAnnotation.set(false)),
|
|
53
|
+
}),
|
|
54
|
+
);
|
|
46
55
|
|
|
47
56
|
const names = getFormProperties(Type.getSchema(TestSchema).ast).map((prop) => prop.name);
|
|
48
57
|
expect(names).toContain('name');
|
|
@@ -54,10 +63,12 @@ describe('getFormProperties', () => {
|
|
|
54
63
|
// annotation lives on the inner `T`. Without unwrapping, the filter would
|
|
55
64
|
// miss the annotation and the hidden field would render. Covers the
|
|
56
65
|
// conventional pattern `Schema.X.pipe(FormInputAnnotation.set(false), Schema.optional)`.
|
|
57
|
-
const TestSchema =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
66
|
+
const TestSchema = Type.makeObject(DXN.make('org.dxos.test.optionalHidden', '0.1.0'))(
|
|
67
|
+
Schema.Struct({
|
|
68
|
+
name: Schema.optional(Schema.String),
|
|
69
|
+
userId: Schema.String.pipe(Annotation.FormInputAnnotation.set(false), Schema.optional),
|
|
70
|
+
}),
|
|
71
|
+
);
|
|
61
72
|
|
|
62
73
|
const names = getFormProperties(Type.getSchema(TestSchema).ast).map((prop) => prop.name);
|
|
63
74
|
expect(names).toContain('name');
|
|
@@ -75,12 +86,14 @@ describe('getFormProperties', () => {
|
|
|
75
86
|
geometry: Schema.Array(Format.GeoPoint).pipe(Annotation.FormInputAnnotation.set(false)),
|
|
76
87
|
});
|
|
77
88
|
const Route = Schema.Struct({ legs: Schema.Array(Leg) });
|
|
78
|
-
const TestSchema =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
89
|
+
const TestSchema = Type.makeObject(DXN.make('org.dxos.test.nestedHidden', '0.1.0'))(
|
|
90
|
+
Schema.Struct({
|
|
91
|
+
details: Schema.Union(
|
|
92
|
+
Schema.TaggedStruct('road', { routes: Schema.optional(Schema.Array(Route)) }),
|
|
93
|
+
Schema.TaggedStruct('other', { note: Schema.optional(Schema.String) }),
|
|
94
|
+
),
|
|
95
|
+
}),
|
|
96
|
+
);
|
|
84
97
|
|
|
85
98
|
// Drill as the form does: getFormProperties at each level, descending via the property type
|
|
86
99
|
// (array element / type literal) returned by the previous level.
|
|
@@ -110,12 +123,14 @@ describe('getFormProperties', () => {
|
|
|
110
123
|
test('preserves annotation when chained with .annotations()', ({ expect }) => {
|
|
111
124
|
// Regression: `.pipe(FormInputAnnotation.set(false)).annotations({...})` must
|
|
112
125
|
// not lose the form-input annotation.
|
|
113
|
-
const TestSchema =
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
126
|
+
const TestSchema = Type.makeObject(DXN.make('org.dxos.test.chainedHidden', '0.1.0'))(
|
|
127
|
+
Schema.Struct({
|
|
128
|
+
name: Schema.optional(Schema.String),
|
|
129
|
+
hidden: JsonSchema.JsonSchema.pipe(Annotation.FormInputAnnotation.set(false)).annotations({
|
|
130
|
+
description: 'Hidden field',
|
|
131
|
+
}),
|
|
117
132
|
}),
|
|
118
|
-
|
|
133
|
+
);
|
|
119
134
|
|
|
120
135
|
const names = getFormProperties(Type.getSchema(TestSchema).ast).map((prop) => prop.name);
|
|
121
136
|
expect(names).toContain('name');
|
|
@@ -150,4 +165,71 @@ describe('getRootFormProperties', () => {
|
|
|
150
165
|
test('falls back to the discriminator alone when no value selects a member', ({ expect }) => {
|
|
151
166
|
expect(getRootFormProperties(Union.ast, {}).map((prop) => prop.name)).toEqual(['kind']);
|
|
152
167
|
});
|
|
168
|
+
|
|
169
|
+
describe('magazine-shaped union (base struct + spread + piped dynamic annotations + Format.URL)', () => {
|
|
170
|
+
const StandardSiteBase = Schema.Struct({
|
|
171
|
+
type: Schema.Literal('standard-site'),
|
|
172
|
+
handle: Schema.String,
|
|
173
|
+
publication: Schema.String,
|
|
174
|
+
name: Schema.optional(Schema.String),
|
|
175
|
+
});
|
|
176
|
+
type StandardSiteValues = Schema.Schema.Type<typeof StandardSiteBase>;
|
|
177
|
+
const StandardSite = Schema.Struct({
|
|
178
|
+
...StandardSiteBase.fields,
|
|
179
|
+
handle: StandardSiteBase.fields.handle.pipe(
|
|
180
|
+
OptionsLookupAnnotation.set(
|
|
181
|
+
optionsLookup<StandardSiteValues>()(['handle'], () => Effect.succeed([]), { combobox: true }),
|
|
182
|
+
),
|
|
183
|
+
),
|
|
184
|
+
publication: StandardSiteBase.fields.publication.pipe(
|
|
185
|
+
OptionsLookupAnnotation.set(optionsLookup<StandardSiteValues>()(['handle'], () => Effect.succeed([]))),
|
|
186
|
+
),
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
const RssBase = Schema.Struct({
|
|
190
|
+
type: Schema.Literal('rss'),
|
|
191
|
+
url: Format.URL,
|
|
192
|
+
name: Schema.optional(Schema.String),
|
|
193
|
+
});
|
|
194
|
+
type RssValues = Schema.Schema.Type<typeof RssBase>;
|
|
195
|
+
const Rss = Schema.Struct({
|
|
196
|
+
...RssBase.fields,
|
|
197
|
+
name: Schema.optional(
|
|
198
|
+
Schema.String.pipe(AutofillAnnotation.set(autofill<RssValues>()(['url'], () => Effect.succeed(undefined)))),
|
|
199
|
+
),
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
const CreateUnion = Schema.Union(StandardSite, Rss);
|
|
203
|
+
|
|
204
|
+
test('expands to the standard-site member fields', ({ expect }) => {
|
|
205
|
+
expect(getRootFormProperties(CreateUnion.ast, { type: 'standard-site' }).map((prop) => prop.name)).toEqual([
|
|
206
|
+
'type',
|
|
207
|
+
'handle',
|
|
208
|
+
'publication',
|
|
209
|
+
'name',
|
|
210
|
+
]);
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
test('expands to the rss member fields', ({ expect }) => {
|
|
214
|
+
expect(getRootFormProperties(CreateUnion.ast, { type: 'rss' }).map((prop) => prop.name)).toEqual([
|
|
215
|
+
'type',
|
|
216
|
+
'url',
|
|
217
|
+
'name',
|
|
218
|
+
]);
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
test('shows only the discriminator before a type is selected', ({ expect }) => {
|
|
222
|
+
expect(getRootFormProperties(CreateUnion.ast, {}).map((prop) => prop.name)).toEqual(['type']);
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
test('survives omitId (applied by CreateObjectPanel) — union discriminant must be preserved', ({ expect }) => {
|
|
226
|
+
const omitted = omitId(CreateUnion);
|
|
227
|
+
expect(getRootFormProperties(omitted.ast, { type: 'standard-site' }).map((prop) => prop.name)).toEqual([
|
|
228
|
+
'type',
|
|
229
|
+
'handle',
|
|
230
|
+
'publication',
|
|
231
|
+
'name',
|
|
232
|
+
]);
|
|
233
|
+
});
|
|
234
|
+
});
|
|
153
235
|
});
|
package/src/util/refs.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import type * as SchemaAST from 'effect/SchemaAST';
|
|
6
6
|
|
|
7
7
|
import { Ref } from '@dxos/echo';
|
|
8
|
-
import { type ReferenceAnnotationValue
|
|
8
|
+
import { ReferenceAnnotationId, type ReferenceAnnotationValue } from '@dxos/echo/Annotation';
|
|
9
9
|
import { SchemaEx } from '@dxos/effect';
|
|
10
10
|
|
|
11
11
|
type RefProps = {
|
package/src/vitest-setup.ts
CHANGED
|
@@ -7,5 +7,45 @@ import '@testing-library/jest-dom/vitest';
|
|
|
7
7
|
|
|
8
8
|
// https://github.com/jsdom/jsdom/issues/3368#issuecomment-1396749033
|
|
9
9
|
import ResizeObserver from 'resize-observer-polyfill';
|
|
10
|
+
import { disposeTabster, getTabster } from 'tabster';
|
|
11
|
+
import { afterEach } from 'vitest';
|
|
10
12
|
|
|
11
13
|
global.ResizeObserver = ResizeObserver;
|
|
14
|
+
|
|
15
|
+
// Tabster (used by `useListNavigation` inside `OrderedList` / `Listbox`) lazy-installs a
|
|
16
|
+
// `DummyInputManagerCore` refresh timer. After happy-dom tears down the per-file
|
|
17
|
+
// environment, the `Node` DOM global is gone — if the timer fires in that window the
|
|
18
|
+
// callback crashes with `ReferenceError: Node is not defined`. The 48 tests themselves
|
|
19
|
+
// always pass; the error is purely a post-teardown race.
|
|
20
|
+
//
|
|
21
|
+
// Two complementary mitigations:
|
|
22
|
+
// 1. `afterEach` disposes any active Tabster instance so its pending timers are cleared
|
|
23
|
+
// while the DOM is still alive.
|
|
24
|
+
// 2. A targeted `process` listener swallows the specific ReferenceError when it slips
|
|
25
|
+
// through (e.g. Tabster instance attached to a window we can't recover post-teardown).
|
|
26
|
+
// The listener is registered once via a process-level flag so re-running setup across
|
|
27
|
+
// test files doesn't pile up handlers.
|
|
28
|
+
|
|
29
|
+
afterEach(() => {
|
|
30
|
+
if (typeof globalThis.window === 'undefined') {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const instance = getTabster(globalThis.window);
|
|
34
|
+
if (instance) {
|
|
35
|
+
disposeTabster(instance);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const FLAG = '__dxos_tabster_post_teardown_filter__';
|
|
40
|
+
if (!(globalThis as Record<string, unknown>)[FLAG]) {
|
|
41
|
+
(globalThis as Record<string, unknown>)[FLAG] = true;
|
|
42
|
+
const handler = (err: unknown) => {
|
|
43
|
+
if (err instanceof ReferenceError && err.message === 'Node is not defined') {
|
|
44
|
+
// Swallow — see comment above.
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
throw err;
|
|
48
|
+
};
|
|
49
|
+
process.on('uncaughtException', handler);
|
|
50
|
+
process.on('unhandledRejection', handler);
|
|
51
|
+
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import * as SchemaAST from 'effect/SchemaAST';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { IconButtonProps } from '@dxos/react-ui';
|
|
4
|
-
import { type ProjectionModel } from '@dxos/schema';
|
|
5
|
-
import { type RefFieldProps } from './fields';
|
|
6
|
-
import { type FormFieldComponentProps, type FormFieldMap, type FormFieldProvider } from './FormFieldComponent';
|
|
7
|
-
export type FormFieldProps = {
|
|
8
|
-
/**
|
|
9
|
-
* AST of the property to render.
|
|
10
|
-
*/
|
|
11
|
-
type: SchemaAST.AST;
|
|
12
|
-
/**
|
|
13
|
-
* Name of the property. Used to derive a default label
|
|
14
|
-
* (`title ?? capitalize(name)`) and as the projection lookup key. Pass
|
|
15
|
-
* `null` to suppress the header label entirely -- the form still renders
|
|
16
|
-
* the field/struct, but `FormFieldSet`'s top-level `<FormFieldLabel>` is
|
|
17
|
-
* skipped. Used by `ArrayField` for object-array items, where every item
|
|
18
|
-
* would otherwise repeat the array's parent name.
|
|
19
|
-
*/
|
|
20
|
-
name: string | null;
|
|
21
|
-
/**
|
|
22
|
-
* Path to the current object from the root. Used with nested forms.
|
|
23
|
-
*/
|
|
24
|
-
path?: (string | number)[];
|
|
25
|
-
/**
|
|
26
|
-
* Optional projection for projection-based field management.
|
|
27
|
-
*/
|
|
28
|
-
projection?: ProjectionModel;
|
|
29
|
-
/**
|
|
30
|
-
* Map of custom renderers for specific properties.
|
|
31
|
-
* Prefer fieldProvider for plugin specific input surfaces.
|
|
32
|
-
*/
|
|
33
|
-
fieldMap?: FormFieldMap;
|
|
34
|
-
/**
|
|
35
|
-
* Function to lookup custom renderers for specific properties.
|
|
36
|
-
*/
|
|
37
|
-
fieldProvider?: FormFieldProvider;
|
|
38
|
-
/**
|
|
39
|
-
* Typename of the ref type that the create props apply to.
|
|
40
|
-
* When set, createOptionLabel/createOptionIcon/createInitialValuePath/createFieldMap/onCreate
|
|
41
|
-
* are only passed to ref fields whose typename matches.
|
|
42
|
-
*/
|
|
43
|
-
createTypename?: string;
|
|
44
|
-
} & Pick<FormFieldComponentProps, 'autoFocus' | 'readonly' | 'layout'> & Pick<RefFieldProps, 'createOptionLabel' | 'createOptionIcon' | 'createInitialValuePath' | 'createFieldMap' | 'db' | 'useType' | 'getOptions' | 'onCreate'>;
|
|
45
|
-
export declare function FormField(props: FormFieldProps): React.JSX.Element | null;
|
|
46
|
-
export declare namespace FormField {
|
|
47
|
-
var displayName: string;
|
|
48
|
-
}
|
|
49
|
-
export declare const IconBlock: ({ inline, ...props }: IconButtonProps & {
|
|
50
|
-
inline?: boolean;
|
|
51
|
-
}) => React.JSX.Element;
|
|
52
|
-
//# sourceMappingURL=FormField.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FormField.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,OAAO,EAAc,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAMpD,OAAO,EASL,KAAK,aAAa,EAInB,MAAM,UAAU,CAAC;AAElB,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAG9B,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC;IAEpB;;;;;;;OAOG;IACH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpB;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAE3B;;OAEG;IACH,UAAU,CAAC,EAAE,eAAe,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAElC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC,GACpE,IAAI,CACF,aAAa,EACX,mBAAmB,GACnB,kBAAkB,GAClB,wBAAwB,GACxB,gBAAgB,GAChB,IAAI,GACJ,SAAS,GACT,YAAY,GACZ,UAAU,CACb,CAAC;kCAEsB,KAAK,EAAE,cAAc;;;;AAiM/C,eAAO,MAAM,SAAS,yBAA0B,eAAe,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,sBAMrF,CAAC"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import type * as Schema from 'effect/Schema';
|
|
2
|
-
import type * as SchemaAST from 'effect/SchemaAST';
|
|
3
|
-
import React, { Component, type FC, type FocusEvent, type PropsWithChildren, type ReactElement, type ReactNode } from 'react';
|
|
4
|
-
import { type Database, Format } from '@dxos/echo';
|
|
5
|
-
import { ThemedClassName } from '@dxos/react-ui';
|
|
6
|
-
import { type FormFieldStatus } from '../../hooks';
|
|
7
|
-
/**
|
|
8
|
-
* Dynamic props passed to input components.
|
|
9
|
-
*/
|
|
10
|
-
export type FormFieldStateProps<T = any> = {
|
|
11
|
-
getStatus: () => FormFieldStatus;
|
|
12
|
-
getValue: () => T | undefined;
|
|
13
|
-
onBlur: (event: FocusEvent<HTMLElement>) => void;
|
|
14
|
-
onValueChange: (type: SchemaAST.AST, value: T) => void;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Presentation mode.
|
|
18
|
-
* - full: Show label, control, and status.
|
|
19
|
-
* - compact: Show label and control.
|
|
20
|
-
* - inline: Control only.
|
|
21
|
-
* - static: Plain DOM; omit all undefined values.
|
|
22
|
-
*/
|
|
23
|
-
export type Presentation = 'full' | 'compact' | 'inline' | 'static';
|
|
24
|
-
/**
|
|
25
|
-
* Props passed to input components.
|
|
26
|
-
*/
|
|
27
|
-
export type FormFieldComponentProps<T = any> = {
|
|
28
|
-
/** Database the form is editing against; populated for fields whose value is an ECHO object/Ref. */
|
|
29
|
-
db?: Database.Database;
|
|
30
|
-
type: SchemaAST.AST;
|
|
31
|
-
format?: Format.TypeFormat;
|
|
32
|
-
readonly?: boolean;
|
|
33
|
-
label: string;
|
|
34
|
-
/**
|
|
35
|
-
* Dotted JSON path of this field within the form values (e.g.
|
|
36
|
-
* `runtime.client.storage.persistent`). Forwarded to `FormFieldLabel` so
|
|
37
|
-
* that it can render the path as a debug hint when the enclosing
|
|
38
|
-
* `Form.Root` has `debug` enabled.
|
|
39
|
-
*/
|
|
40
|
-
jsonPath?: string;
|
|
41
|
-
placeholder?: string;
|
|
42
|
-
autoFocus?: boolean;
|
|
43
|
-
layout?: Presentation;
|
|
44
|
-
} & FormFieldStateProps<T>;
|
|
45
|
-
export type FormFieldComponent = FC<FormFieldComponentProps>;
|
|
46
|
-
export type FormFieldMap = Record<string, FormFieldComponent>;
|
|
47
|
-
export type FormFieldProvider = (props: {
|
|
48
|
-
prop: string;
|
|
49
|
-
schema: Schema.Schema<any>;
|
|
50
|
-
fieldProps: FormFieldComponentProps;
|
|
51
|
-
}) => ReactElement | null | undefined;
|
|
52
|
-
export type FormFieldLabelProps = ThemedClassName<{
|
|
53
|
-
asChild?: boolean;
|
|
54
|
-
error?: string;
|
|
55
|
-
/**
|
|
56
|
-
* JSON path of the field this label describes (e.g. `runtime.client.storage.persistent`).
|
|
57
|
-
* Surfaced as a hover tooltip on the label when the enclosing `Form.Root`
|
|
58
|
-
* has `tooltips` enabled (the default) -- useful for spotting which field
|
|
59
|
-
* maps to which path when authoring schemas or filing bugs against a form.
|
|
60
|
-
* Callers can supply the path unconditionally; the label suppresses the
|
|
61
|
-
* tooltip when `Form.Root tooltips={false}`.
|
|
62
|
-
*/
|
|
63
|
-
path?: string;
|
|
64
|
-
/**
|
|
65
|
-
* Trailing button rendered at the end of the label row (third grid column).
|
|
66
|
-
* Used by nested-object field sets to surface a collapse toggle.
|
|
67
|
-
*/
|
|
68
|
-
button?: ReactNode;
|
|
69
|
-
onClick?: () => void;
|
|
70
|
-
} & Pick<FormFieldComponentProps, 'label' | 'readonly'>>;
|
|
71
|
-
export declare function FormFieldLabel({ classNames, label, error, readonly, asChild, path, button, onClick }: FormFieldLabelProps): React.JSX.Element;
|
|
72
|
-
export declare namespace FormFieldLabel {
|
|
73
|
-
var displayName: string;
|
|
74
|
-
}
|
|
75
|
-
export type FormFieldWrapperProps<T = any> = Pick<FormFieldComponentProps, 'readonly' | 'label' | 'layout' | 'getStatus' | 'getValue' | 'jsonPath' | 'format'> & {
|
|
76
|
-
children?: (props: {
|
|
77
|
-
value: T;
|
|
78
|
-
}) => ReactNode;
|
|
79
|
-
};
|
|
80
|
-
export declare const FormFieldWrapper: <T>(props: FormFieldWrapperProps<T>) => React.JSX.Element | null;
|
|
81
|
-
type FormFieldErrorState = {
|
|
82
|
-
error: Error | undefined;
|
|
83
|
-
};
|
|
84
|
-
type FormFieldErrorBoundaryProps = PropsWithChildren<{
|
|
85
|
-
path?: (string | number)[];
|
|
86
|
-
}>;
|
|
87
|
-
export declare class FormFieldErrorBoundary extends Component<FormFieldErrorBoundaryProps, FormFieldErrorState> {
|
|
88
|
-
static getDerivedStateFromError(error: Error): {
|
|
89
|
-
error: Error;
|
|
90
|
-
};
|
|
91
|
-
state: {
|
|
92
|
-
error: undefined;
|
|
93
|
-
};
|
|
94
|
-
componentDidUpdate(prevProps: FormFieldErrorBoundaryProps): void;
|
|
95
|
-
render(): string | number | bigint | boolean | React.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | ReactElement<unknown, string | React.JSXElementConstructor<any>> | React.ReactPortal | null | undefined> | null | undefined;
|
|
96
|
-
private resetError;
|
|
97
|
-
}
|
|
98
|
-
//# sourceMappingURL=FormFieldComponent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormFieldComponent.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FormFieldComponent.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,SAAS,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,EACZ,SAAS,EACT,KAAK,EAAE,EACP,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAe,eAAe,EAAW,MAAM,gBAAgB,CAAC;AAIvE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnD;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,GAAG,GAAG,IAAI;IACzC,SAAS,EAAE,MAAM,eAAe,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAC9B,MAAM,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACjD,aAAa,EAAE,CAAC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ourceRoot":"","sources":["../../../../../src/components/Form/FormFieldComponent.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAwC,MAAM,OAAO,CAAC;AAK7D,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,sBAAsB,CAAC;AAEtF,QAAA,MAAM,YAAY,qEAOf,uBAAuB,CAAC,MAAM,CAAC,sBAsBjC,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAOnC,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type AnyProperties } from '@dxos/echo/internal';
|
|
3
|
-
import { SchemaEx } from '@dxos/effect';
|
|
4
|
-
import { type FormHandlerProps } from '../../hooks';
|
|
5
|
-
import { type FormFieldProps } from './FormField';
|
|
6
|
-
export type FormFieldSetProps<T extends AnyProperties> = {
|
|
7
|
-
label?: string;
|
|
8
|
-
sort?: string[];
|
|
9
|
-
/**
|
|
10
|
-
* When set, renders a toggle button at the end of the label row that
|
|
11
|
-
* shows/hides the field set body. Used for nested objects.
|
|
12
|
-
*/
|
|
13
|
-
collapsible?: boolean;
|
|
14
|
-
exclude?: (props: SchemaEx.SchemaProperty[]) => SchemaEx.SchemaProperty[];
|
|
15
|
-
/**
|
|
16
|
-
* Picks a named layout out of `FormLayoutAnnotation` when present.
|
|
17
|
-
* Falls back to `'default'`. Ignored when the schema has no annotation
|
|
18
|
-
* (linear rendering then takes over).
|
|
19
|
-
*/
|
|
20
|
-
layoutName?: string;
|
|
21
|
-
} & Pick<FormHandlerProps<T>, 'schema'> & Pick<FormFieldProps, 'path' | 'autoFocus' | 'readonly' | 'layout' | 'projection' | 'fieldMap' | 'fieldProvider' | 'createTypename' | 'createOptionLabel' | 'createOptionIcon' | 'createInitialValuePath' | 'createFieldMap' | 'db' | 'useType' | 'getOptions' | 'onCreate'>;
|
|
22
|
-
export declare function FormFieldSet({ label, schema, readonly, path, sort, collapsible, exclude, projection, layout, layoutName, ...props }: FormFieldSetProps<any>): React.JSX.Element | null;
|
|
23
|
-
export declare namespace FormFieldSet {
|
|
24
|
-
var displayName: string;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=FormFieldSet.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormFieldSet.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FormFieldSet.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAMxC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAM7D,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,aAAa,IAAI;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,cAAc,EAAE,KAAK,QAAQ,CAAC,cAAc,EAAE,CAAC;IAC1E;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,GACrC,IAAI,CACF,cAAc,EACZ,MAAM,GACN,WAAW,GACX,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,eAAe,GACf,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,wBAAwB,GACxB,gBAAgB,GAChB,IAAI,GACJ,SAAS,GACT,YAAY,GACZ,UAAU,CACb,CAAC;qCAKyB,EAC3B,KAAK,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,OAAO,EACP,UAAU,EACV,MAAM,EACN,UAAgC,EAChC,GAAG,KAAK,EACT,EAAE,iBAAiB,CAAC,GAAG,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A standalone context for the `tooltips` flag (Form.Root's only label
|
|
3
|
-
* decoration today: a JSON-path hover tooltip rendered by
|
|
4
|
-
* `FormFieldLabel`).
|
|
5
|
-
*
|
|
6
|
-
* Lives in its own module so that `FormFieldComponent.tsx` -- imported at
|
|
7
|
-
* the top of `Form.tsx` -- can read the flag without re-importing from
|
|
8
|
-
* `Form.tsx`. That round-trip used to create a circular module-eval
|
|
9
|
-
* dependency that intermittently hit a TDZ ("Cannot access 'FormFieldLabel'
|
|
10
|
-
* before initialization") in browser-mode storybook tests.
|
|
11
|
-
*
|
|
12
|
-
* Defaults to `true` both when `Form.Root` doesn't pass an explicit value
|
|
13
|
-
* AND when there is no enclosing `Form.Root` (e.g. `FormFieldWrapper`
|
|
14
|
-
* stories that render an input without a Form provider).
|
|
15
|
-
*/
|
|
16
|
-
export declare const FormTooltipsContext: import("react").Context<boolean>;
|
|
17
|
-
/** Returns whether the enclosing `Form.Root` has field tooltips enabled. */
|
|
18
|
-
export declare const useFormTooltips: () => boolean;
|
|
19
|
-
//# sourceMappingURL=FormTooltipsContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormTooltipsContext.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FormTooltipsContext.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,mBAAmB,kCAA+B,CAAC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,CAAC;AAwCF,eAAO,MAAM,eAAe,EAAE,KAE7B,CAAC;AAqCF,eAAO,MAAM,WAAW,EAAE,KAEzB,CAAC;AAEF,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,EAAE,KAE/B,CAAC;AAwIF,eAAO,MAAM,cAAc,EAAE,KAE5B,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,cAAc,EAAE,KAE5B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormLayout.stories.test.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/Layout/FormLayout.stories.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormLayout.test.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/Layout/FormLayout.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Annotation carrying one or more named `FormLayout` DSL templates that
|
|
3
|
-
* control how `Form.FieldSet` / `Form.Layout` arrange a schema's fields.
|
|
4
|
-
* Callers select a variant via the `name` prop; the implicit name is
|
|
5
|
-
* `DEFAULT_LAYOUT_NAME` (`'default'`).
|
|
6
|
-
*
|
|
7
|
-
* Templates use a minimal XML grammar — see `parser.ts`. Example:
|
|
8
|
-
*
|
|
9
|
-
* FormLayoutAnnotation.set({
|
|
10
|
-
* default: `
|
|
11
|
-
* <grid cols="2">
|
|
12
|
-
* <field name="origin"/>
|
|
13
|
-
* <field name="destination"/>
|
|
14
|
-
* <field name="provider" span="2"/>
|
|
15
|
-
* </grid>
|
|
16
|
-
* `,
|
|
17
|
-
* card: `
|
|
18
|
-
* <grid cols="1">
|
|
19
|
-
* <field name="provider"/>
|
|
20
|
-
* <field name="number"/>
|
|
21
|
-
* </grid>
|
|
22
|
-
* `,
|
|
23
|
-
* })
|
|
24
|
-
*/
|
|
25
|
-
export declare const FormLayoutAnnotationId: unique symbol;
|
|
26
|
-
export type FormLayoutMap = Record<string, string>;
|
|
27
|
-
export declare const FormLayoutAnnotation: import("@dxos/echo/internal").AnnotationHelper<FormLayoutMap>;
|
|
28
|
-
/** Name used when no explicit variant is requested. */
|
|
29
|
-
export declare const DEFAULT_LAYOUT_NAME = "default";
|
|
30
|
-
//# sourceMappingURL=annotation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"annotation.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/Layout/annotation.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,sBAAsB,eAAsD,CAAC;AAE1F,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEnD,eAAO,MAAM,oBAAoB,+DAAgE,CAAC;AAElG,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/Layout/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/Layout/parser.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,4CAA4C;AAC5C,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,UAAU,EAAE,CAAA;CAAE,GAC1F;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9E,qBAAa,gBAAiB,SAAQ,KAAK;IAIvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM;IAH5B,QAAQ,CAAC,IAAI,sBAAsB;IACnC,YACE,OAAO,EAAE,MAAM,EACN,QAAQ,CAAC,EAAE,MAAM,YAAA,EAG3B;CACF;AAuED,0FAA0F;AAC1F,eAAO,MAAM,WAAW,aAAc,MAAM,KAAG,UA+D9C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parser.test.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/Layout/parser.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/ArrayField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAsB,MAAM,OAAO,CAAC;AAU3C,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,mBAAmB,CAAC;CACjC,GAAG,cAAc,CAAC;mCAEQ,EACzB,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,MAAM,EACN,UAAU,EAAE,UAAU,EACtB,GAAG,KAAK,EACT,EAAE,eAAe;;;;AAiHlB;;;GAGG;AAEH,eAAO,MAAM,eAAe,SAAU,SAAS,CAAC,GAAG,KAAG,GAsBrD,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
3
|
-
export declare const BooleanField: ({ type, readonly, onValueChange, ...props }: FormFieldComponentProps<boolean>) => React.JSX.Element;
|
|
4
|
-
//# sourceMappingURL=BooleanField.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BooleanField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/BooleanField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,YAAY,gDAAiD,uBAAuB,CAAC,OAAO,CAAC,sBAWzG,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
3
|
-
export declare const DateField: ({ type, format, readonly, placeholder: _placeholder, onValueChange, onBlur: _onBlur, ...props }: FormFieldComponentProps<string>) => React.JSX.Element;
|
|
4
|
-
//# sourceMappingURL=DateField.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DateField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/DateField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAoCvF,eAAO,MAAM,SAAS,oGAQnB,uBAAuB,CAAC,MAAM,CAAC,sBA8CjC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type GeoPoint } from '@dxos/echo/Format';
|
|
3
|
-
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
4
|
-
export declare const GeoPointField: ({ type, label, jsonPath, readonly, layout, getStatus, getValue, onValueChange, onBlur, }: FormFieldComponentProps<GeoPoint>) => React.JSX.Element | null;
|
|
5
|
-
//# sourceMappingURL=GeoPointField.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GeoPointField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/GeoPointField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAE3F,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAM/D,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAErF,eAAO,MAAM,aAAa,6FAUvB,uBAAuB,CAAC,QAAQ,CAAC,6BAiFnC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InlineRefField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/InlineRefField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAapD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,UAAW,aAAa,6BAqDlD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/MarkdownField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAWpD,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAKrF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,sGAWvB,uBAAuB,6BAgDzB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownField.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/MarkdownField.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA4GjE,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOM,CAAC;eAEF,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,YAAY,EAAE,KAE1B,CAAC;AAMF,eAAO,MAAM,sBAAsB,EAAE,KA+CpC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAY1B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAStB,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
3
|
-
export declare const NumberField: ({ type, readonly, placeholder, getValue, onValueChange, onBlur, ...props }: FormFieldComponentProps<number>) => React.JSX.Element;
|
|
4
|
-
//# sourceMappingURL=NumberField.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NumberField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/NumberField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAKhE,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,WAAW,+EAQrB,uBAAuB,CAAC,MAAM,CAAC,sBAwDjC,CAAC"}
|