@dxos/react-ui-form 0.7.4 → 0.7.5-labs.5f04cf6
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 +574 -496
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +629 -565
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +574 -496
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/FieldEditor/FieldEditor.d.ts +2 -2
- package/dist/types/src/components/FieldEditor/FieldEditor.d.ts.map +1 -1
- package/dist/types/src/components/Form/ArrayField.d.ts +16 -0
- package/dist/types/src/components/Form/ArrayField.d.ts.map +1 -0
- package/dist/types/src/components/Form/Defaults.d.ts +5 -6
- package/dist/types/src/components/Form/Defaults.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.d.ts +13 -17
- package/dist/types/src/components/Form/Form.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.stories.d.ts +7 -1
- package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/FormActions.d.ts +7 -0
- package/dist/types/src/components/Form/FormActions.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormContent.d.ts +26 -0
- package/dist/types/src/components/Form/FormContent.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormContext.d.ts +20 -0
- package/dist/types/src/components/Form/FormContext.d.ts.map +1 -0
- package/dist/types/src/components/Form/Input.d.ts +5 -6
- package/dist/types/src/components/Form/Input.d.ts.map +1 -1
- package/dist/types/src/components/Form/custom/GeoPointInput.d.ts +4 -0
- package/dist/types/src/components/Form/custom/GeoPointInput.d.ts.map +1 -0
- package/dist/types/src/components/Form/custom/TupleInput.d.ts +6 -0
- package/dist/types/src/components/Form/custom/TupleInput.d.ts.map +1 -0
- package/dist/types/src/components/Form/custom/index.d.ts +3 -0
- package/dist/types/src/components/Form/custom/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/factory.d.ts +2 -2
- package/dist/types/src/components/Form/factory.d.ts.map +1 -1
- package/dist/types/src/components/Form/index.d.ts +2 -2
- package/dist/types/src/components/Form/index.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +6 -5
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
- package/dist/types/src/hooks/useForm.d.ts +13 -15
- package/dist/types/src/hooks/useForm.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +26 -26
- package/src/components/FieldEditor/FieldEditor.stories.tsx +2 -2
- package/src/components/FieldEditor/FieldEditor.tsx +75 -50
- package/src/components/Form/ArrayField.tsx +111 -0
- package/src/components/Form/Defaults.tsx +20 -33
- package/src/components/Form/Form.stories.tsx +48 -6
- package/src/components/Form/Form.tsx +39 -333
- package/src/components/Form/FormActions.tsx +41 -0
- package/src/components/Form/FormContent.tsx +155 -0
- package/src/components/Form/FormContext.tsx +48 -0
- package/src/components/Form/Input.tsx +5 -6
- package/src/components/Form/custom/GeoPointInput.tsx +44 -0
- package/src/components/Form/custom/TupleInput.tsx +49 -0
- package/src/components/Form/custom/index.ts +6 -0
- package/src/components/Form/factory.tsx +4 -7
- package/src/components/Form/index.ts +3 -2
- package/src/components/ViewEditor/ViewEditor.stories.tsx +30 -8
- package/src/components/ViewEditor/ViewEditor.tsx +13 -8
- package/src/hooks/useForm.ts +67 -78
- package/dist/types/src/components/Form/Custom.d.ts +0 -5
- package/dist/types/src/components/Form/Custom.d.ts.map +0 -1
- package/src/components/Form/Custom.tsx +0 -65
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/ui/react-ui-form/src/translations.ts":{"bytes":5683,"imports":[],"format":"esm"},"packages/ui/react-ui-form/src/components/deprecated/FormInput.tsx":{"bytes":4795,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-form/src/components/deprecated/index.ts":{"bytes":520,"imports":[{"path":"packages/ui/react-ui-form/src/components/deprecated/FormInput.tsx","kind":"import-statement","original":"./FormInput"}],"format":"esm"},"packages/ui/react-ui-form/src/components/Form/Input.tsx":{"bytes":3877,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-form/src/components/Form/Defaults.tsx":{"bytes":13248,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-form/src/components/Form/Input.tsx","kind":"import-statement","original":"./Input"}],"format":"esm"},"packages/ui/react-ui-form/src/components/Form/Custom.tsx":{"bytes":6401,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-form/src/components/Form/Input.tsx","kind":"import-statement","original":"./Input"},{"path":"packages/ui/react-ui-form/src/translations.ts","kind":"import-statement","original":"../../translations"}],"format":"esm"},"packages/ui/react-ui-form/src/components/Form/factory.tsx":{"bytes":2489,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-form/src/components/Form/Custom.tsx","kind":"import-statement","original":"./Custom"},{"path":"packages/ui/react-ui-form/src/components/Form/Defaults.tsx","kind":"import-statement","original":"./Defaults"}],"format":"esm"},"packages/ui/react-ui-form/src/hooks/useForm.ts":{"bytes":22431,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-form/src/hooks/index.ts":{"bytes":502,"imports":[{"path":"packages/ui/react-ui-form/src/hooks/useForm.ts","kind":"import-statement","original":"./useForm"}],"format":"esm"},"packages/ui/react-ui-form/src/components/Form/Form.tsx":{"bytes":40645,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"effect/String","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-form/src/components/Form/Defaults.tsx","kind":"import-statement","original":"./Defaults"},{"path":"packages/ui/react-ui-form/src/components/Form/Input.tsx","kind":"import-statement","original":"./Input"},{"path":"packages/ui/react-ui-form/src/components/Form/factory.tsx","kind":"import-statement","original":"./factory"},{"path":"packages/ui/react-ui-form/src/hooks/index.ts","kind":"import-statement","original":"../../hooks"},{"path":"packages/ui/react-ui-form/src/translations.ts","kind":"import-statement","original":"../../translations"}],"format":"esm"},"packages/ui/react-ui-form/src/components/Form/index.ts":{"bytes":760,"imports":[{"path":"packages/ui/react-ui-form/src/components/Form/Form.tsx","kind":"import-statement","original":"./Form"},{"path":"packages/ui/react-ui-form/src/components/Form/Custom.tsx","kind":"import-statement","original":"./Custom"},{"path":"packages/ui/react-ui-form/src/components/Form/Defaults.tsx","kind":"import-statement","original":"./Defaults"},{"path":"packages/ui/react-ui-form/src/components/Form/Input.tsx","kind":"import-statement","original":"./Input"}],"format":"esm"},"packages/ui/react-ui-form/src/components/FieldEditor/FieldEditor.tsx":{"bytes":17911,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-form/src/translations.ts","kind":"import-statement","original":"../../translations"},{"path":"packages/ui/react-ui-form/src/components/Form/index.ts","kind":"import-statement","original":"../Form"}],"format":"esm"},"packages/ui/react-ui-form/src/components/FieldEditor/index.ts":{"bytes":531,"imports":[{"path":"packages/ui/react-ui-form/src/components/FieldEditor/FieldEditor.tsx","kind":"import-statement","original":"./FieldEditor"}],"format":"esm"},"packages/ui/react-ui-form/src/components/ViewEditor/ViewEditor.tsx":{"bytes":16952,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-form/src/translations.ts","kind":"import-statement","original":"../../translations"},{"path":"packages/ui/react-ui-form/src/components/FieldEditor/index.ts","kind":"import-statement","original":"../FieldEditor"},{"path":"packages/ui/react-ui-form/src/components/Form/index.ts","kind":"import-statement","original":"../Form"}],"format":"esm"},"packages/ui/react-ui-form/src/components/ViewEditor/index.ts":{"bytes":525,"imports":[{"path":"packages/ui/react-ui-form/src/components/ViewEditor/ViewEditor.tsx","kind":"import-statement","original":"./ViewEditor"}],"format":"esm"},"packages/ui/react-ui-form/src/components/index.ts":{"bytes":787,"imports":[{"path":"packages/ui/react-ui-form/src/components/deprecated/index.ts","kind":"import-statement","original":"./deprecated"},{"path":"packages/ui/react-ui-form/src/components/FieldEditor/index.ts","kind":"import-statement","original":"./FieldEditor"},{"path":"packages/ui/react-ui-form/src/components/Form/index.ts","kind":"import-statement","original":"./Form"},{"path":"packages/ui/react-ui-form/src/components/ViewEditor/index.ts","kind":"import-statement","original":"./ViewEditor"}],"format":"esm"},"packages/ui/react-ui-form/src/util/field.ts":{"bytes":12238,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-form/src/util/formatting.ts":{"bytes":12559,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-form/src/util/index.ts":{"bytes":589,"imports":[{"path":"packages/ui/react-ui-form/src/util/field.ts","kind":"import-statement","original":"./field"},{"path":"packages/ui/react-ui-form/src/util/formatting.ts","kind":"import-statement","original":"./formatting"}],"format":"esm"},"packages/ui/react-ui-form/src/index.ts":{"bytes":916,"imports":[{"path":"packages/ui/react-ui-form/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/ui/react-ui-form/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/ui/react-ui-form/src/hooks/index.ts","kind":"import-statement","original":"./hooks"},{"path":"packages/ui/react-ui-form/src/util/index.ts","kind":"import-statement","original":"./util"}],"format":"esm"}},"outputs":{"packages/ui/react-ui-form/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":81189},"packages/ui/react-ui-form/dist/lib/node-esm/index.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"effect/String","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["BooleanInput","DeprecatedFormInput","FieldEditor","Form","FormActions","GeiPointInput","InputHeader","NumberInput","SelectInput","TextInput","ViewEditor","cellClassesForFieldType","cellClassesForRowSelection","formatForDisplay","formatForEditing","parseValue","pathNotUniqueError","translations","useForm"],"entryPoint":"packages/ui/react-ui-form/src/index.ts","inputs":{"packages/ui/react-ui-form/src/translations.ts":{"bytesInOutput":1666},"packages/ui/react-ui-form/src/components/deprecated/FormInput.tsx":{"bytesInOutput":1121},"packages/ui/react-ui-form/src/components/deprecated/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-form/src/components/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-form/src/components/FieldEditor/FieldEditor.tsx":{"bytesInOutput":4164},"packages/ui/react-ui-form/src/components/Form/Form.tsx":{"bytesInOutput":9972},"packages/ui/react-ui-form/src/components/Form/Defaults.tsx":{"bytesInOutput":3471},"packages/ui/react-ui-form/src/components/Form/Input.tsx":{"bytesInOutput":737},"packages/ui/react-ui-form/src/components/Form/factory.tsx":{"bytesInOutput":332},"packages/ui/react-ui-form/src/components/Form/Custom.tsx":{"bytesInOutput":1388},"packages/ui/react-ui-form/src/hooks/useForm.ts":{"bytesInOutput":4111},"packages/ui/react-ui-form/src/hooks/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-form/src/components/Form/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-form/src/components/FieldEditor/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-form/src/components/ViewEditor/ViewEditor.tsx":{"bytesInOutput":4312},"packages/ui/react-ui-form/src/components/ViewEditor/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-form/src/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-form/src/util/field.ts":{"bytesInOutput":2809},"packages/ui/react-ui-form/src/util/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-form/src/util/formatting.ts":{"bytesInOutput":2779}},"bytes":38328}}}
|
|
1
|
+
{"inputs":{"packages/ui/react-ui-form/src/translations.ts":{"bytes":5683,"imports":[],"format":"esm"},"packages/ui/react-ui-form/src/components/deprecated/FormInput.tsx":{"bytes":4795,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-form/src/components/deprecated/index.ts":{"bytes":520,"imports":[{"path":"packages/ui/react-ui-form/src/components/deprecated/FormInput.tsx","kind":"import-statement","original":"./FormInput"}],"format":"esm"},"packages/ui/react-ui-form/src/components/Form/Input.tsx":{"bytes":3673,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-form/src/components/Form/custom/GeoPointInput.tsx":{"bytes":5514,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-form/src/translations.ts","kind":"import-statement","original":"../../../translations"},{"path":"packages/ui/react-ui-form/src/components/Form/Input.tsx","kind":"import-statement","original":"../Input"}],"format":"esm"},"packages/ui/react-ui-form/src/components/Form/custom/TupleInput.tsx":{"bytes":5029,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-form/src/components/Form/Input.tsx","kind":"import-statement","original":"../Input"}],"format":"esm"},"packages/ui/react-ui-form/src/components/Form/custom/index.ts":{"bytes":627,"imports":[{"path":"packages/ui/react-ui-form/src/components/Form/custom/GeoPointInput.tsx","kind":"import-statement","original":"./GeoPointInput"},{"path":"packages/ui/react-ui-form/src/components/Form/custom/TupleInput.tsx","kind":"import-statement","original":"./TupleInput"}],"format":"esm"},"packages/ui/react-ui-form/src/components/Form/Defaults.tsx":{"bytes":12703,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-form/src/components/Form/Input.tsx","kind":"import-statement","original":"./Input"}],"format":"esm"},"packages/ui/react-ui-form/src/hooks/useForm.ts":{"bytes":21805,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-form/src/hooks/index.ts":{"bytes":502,"imports":[{"path":"packages/ui/react-ui-form/src/hooks/useForm.ts","kind":"import-statement","original":"./useForm"}],"format":"esm"},"packages/ui/react-ui-form/src/components/Form/FormContext.tsx":{"bytes":5567,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-form/src/hooks/index.ts","kind":"import-statement","original":"../../hooks"}],"format":"esm"},"packages/ui/react-ui-form/src/components/Form/FormActions.tsx":{"bytes":4236,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-form/src/components/Form/FormContext.tsx","kind":"import-statement","original":"./FormContext"},{"path":"packages/ui/react-ui-form/src/translations.ts","kind":"import-statement","original":"../../translations"}],"format":"esm"},"packages/ui/react-ui-form/src/components/Form/ArrayField.tsx":{"bytes":13860,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"effect/String","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-form/src/components/Form/FormContent.tsx","kind":"import-statement","original":"./FormContent"},{"path":"packages/ui/react-ui-form/src/components/Form/FormContext.tsx","kind":"import-statement","original":"./FormContext"},{"path":"packages/ui/react-ui-form/src/components/Form/Input.tsx","kind":"import-statement","original":"./Input"},{"path":"packages/ui/react-ui-form/src/translations.ts","kind":"import-statement","original":"../../translations"}],"format":"esm"},"packages/ui/react-ui-form/src/components/Form/factory.tsx":{"bytes":2421,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-form/src/components/Form/Defaults.tsx","kind":"import-statement","original":"./Defaults"},{"path":"packages/ui/react-ui-form/src/components/Form/custom/index.ts","kind":"import-statement","original":"./custom"}],"format":"esm"},"packages/ui/react-ui-form/src/components/Form/FormContent.tsx":{"bytes":15590,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"effect/String","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-form/src/components/Form/ArrayField.tsx","kind":"import-statement","original":"./ArrayField"},{"path":"packages/ui/react-ui-form/src/components/Form/Defaults.tsx","kind":"import-statement","original":"./Defaults"},{"path":"packages/ui/react-ui-form/src/components/Form/FormContext.tsx","kind":"import-statement","original":"./FormContext"},{"path":"packages/ui/react-ui-form/src/components/Form/factory.tsx","kind":"import-statement","original":"./factory"}],"format":"esm"},"packages/ui/react-ui-form/src/components/Form/Form.tsx":{"bytes":6777,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-form/src/components/Form/FormActions.tsx","kind":"import-statement","original":"./FormActions"},{"path":"packages/ui/react-ui-form/src/components/Form/FormContent.tsx","kind":"import-statement","original":"./FormContent"},{"path":"packages/ui/react-ui-form/src/components/Form/FormContext.tsx","kind":"import-statement","original":"./FormContext"}],"format":"esm"},"packages/ui/react-ui-form/src/components/Form/index.ts":{"bytes":764,"imports":[{"path":"packages/ui/react-ui-form/src/components/Form/custom/index.ts","kind":"import-statement","original":"./custom"},{"path":"packages/ui/react-ui-form/src/components/Form/Defaults.tsx","kind":"import-statement","original":"./Defaults"},{"path":"packages/ui/react-ui-form/src/components/Form/Form.tsx","kind":"import-statement","original":"./Form"},{"path":"packages/ui/react-ui-form/src/components/Form/Input.tsx","kind":"import-statement","original":"./Input"}],"format":"esm"},"packages/ui/react-ui-form/src/components/FieldEditor/FieldEditor.tsx":{"bytes":20208,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-form/src/translations.ts","kind":"import-statement","original":"../../translations"},{"path":"packages/ui/react-ui-form/src/components/Form/index.ts","kind":"import-statement","original":"../Form"}],"format":"esm"},"packages/ui/react-ui-form/src/components/FieldEditor/index.ts":{"bytes":531,"imports":[{"path":"packages/ui/react-ui-form/src/components/FieldEditor/FieldEditor.tsx","kind":"import-statement","original":"./FieldEditor"}],"format":"esm"},"packages/ui/react-ui-form/src/components/ViewEditor/ViewEditor.tsx":{"bytes":17372,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/ui/react-ui-form/src/translations.ts","kind":"import-statement","original":"../../translations"},{"path":"packages/ui/react-ui-form/src/components/FieldEditor/index.ts","kind":"import-statement","original":"../FieldEditor"},{"path":"packages/ui/react-ui-form/src/components/Form/index.ts","kind":"import-statement","original":"../Form"}],"format":"esm"},"packages/ui/react-ui-form/src/components/ViewEditor/index.ts":{"bytes":525,"imports":[{"path":"packages/ui/react-ui-form/src/components/ViewEditor/ViewEditor.tsx","kind":"import-statement","original":"./ViewEditor"}],"format":"esm"},"packages/ui/react-ui-form/src/components/index.ts":{"bytes":787,"imports":[{"path":"packages/ui/react-ui-form/src/components/deprecated/index.ts","kind":"import-statement","original":"./deprecated"},{"path":"packages/ui/react-ui-form/src/components/FieldEditor/index.ts","kind":"import-statement","original":"./FieldEditor"},{"path":"packages/ui/react-ui-form/src/components/Form/index.ts","kind":"import-statement","original":"./Form"},{"path":"packages/ui/react-ui-form/src/components/ViewEditor/index.ts","kind":"import-statement","original":"./ViewEditor"}],"format":"esm"},"packages/ui/react-ui-form/src/util/field.ts":{"bytes":12238,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-form/src/util/formatting.ts":{"bytes":12559,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/ui/react-ui-form/src/util/index.ts":{"bytes":589,"imports":[{"path":"packages/ui/react-ui-form/src/util/field.ts","kind":"import-statement","original":"./field"},{"path":"packages/ui/react-ui-form/src/util/formatting.ts","kind":"import-statement","original":"./formatting"}],"format":"esm"},"packages/ui/react-ui-form/src/index.ts":{"bytes":916,"imports":[{"path":"packages/ui/react-ui-form/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/ui/react-ui-form/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/ui/react-ui-form/src/hooks/index.ts","kind":"import-statement","original":"./hooks"},{"path":"packages/ui/react-ui-form/src/util/index.ts","kind":"import-statement","original":"./util"}],"format":"esm"}},"outputs":{"packages/ui/react-ui-form/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":87341},"packages/ui/react-ui-form/dist/lib/node-esm/index.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"effect/String","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"effect/String","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-list","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["BooleanInput","DeprecatedFormInput","FieldEditor","Form","GeoPointInput","InputHeader","NumberInput","SelectInput","TextInput","TupleInput","ViewEditor","cellClassesForFieldType","cellClassesForRowSelection","formatForDisplay","formatForEditing","parseValue","pathNotUniqueError","translations","useForm"],"entryPoint":"packages/ui/react-ui-form/src/index.ts","inputs":{"packages/ui/react-ui-form/src/translations.ts":{"bytesInOutput":1666},"packages/ui/react-ui-form/src/components/deprecated/FormInput.tsx":{"bytesInOutput":1121},"packages/ui/react-ui-form/src/components/deprecated/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-form/src/components/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-form/src/components/FieldEditor/FieldEditor.tsx":{"bytesInOutput":4651},"packages/ui/react-ui-form/src/components/Form/custom/GeoPointInput.tsx":{"bytesInOutput":1266},"packages/ui/react-ui-form/src/components/Form/Input.tsx":{"bytesInOutput":737},"packages/ui/react-ui-form/src/components/Form/custom/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-form/src/components/Form/custom/TupleInput.tsx":{"bytesInOutput":1106},"packages/ui/react-ui-form/src/components/Form/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-form/src/components/Form/Defaults.tsx":{"bytesInOutput":3367},"packages/ui/react-ui-form/src/components/Form/Form.tsx":{"bytesInOutput":958},"packages/ui/react-ui-form/src/components/Form/FormActions.tsx":{"bytesInOutput":999},"packages/ui/react-ui-form/src/components/Form/FormContext.tsx":{"bytesInOutput":1103},"packages/ui/react-ui-form/src/hooks/useForm.ts":{"bytesInOutput":4551},"packages/ui/react-ui-form/src/hooks/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-form/src/components/Form/FormContent.tsx":{"bytesInOutput":3709},"packages/ui/react-ui-form/src/components/Form/ArrayField.tsx":{"bytesInOutput":3575},"packages/ui/react-ui-form/src/components/Form/factory.tsx":{"bytesInOutput":332},"packages/ui/react-ui-form/src/components/FieldEditor/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-form/src/components/ViewEditor/ViewEditor.tsx":{"bytesInOutput":4430},"packages/ui/react-ui-form/src/components/ViewEditor/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-form/src/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-form/src/util/field.ts":{"bytesInOutput":2809},"packages/ui/react-ui-form/src/util/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-form/src/util/formatting.ts":{"bytesInOutput":2779}},"bytes":41121}}}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type SchemaRegistry } from '@dxos/echo-db';
|
|
3
3
|
import { type FieldType, type ViewType, type ViewProjection } from '@dxos/schema';
|
|
4
4
|
export type FieldEditorProps = {
|
|
5
5
|
view: ViewType;
|
|
6
6
|
projection: ViewProjection;
|
|
7
7
|
field: FieldType;
|
|
8
|
-
registry?:
|
|
8
|
+
registry?: SchemaRegistry;
|
|
9
9
|
onSave: () => void;
|
|
10
10
|
onCancel?: () => void;
|
|
11
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/FieldEditor/FieldEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"FieldEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/FieldEditor/FieldEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAIpD,OAAO,EAIL,KAAK,SAAS,EAEd,KAAK,QAAQ,EACb,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;AAKtB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,cAAc,CAAC;IAC3B,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,4DAA6D,gBAAgB,6BA2JpG,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type SchemaProperty } from '@dxos/schema';
|
|
3
|
+
import { type ComponentLookup } from './Form';
|
|
4
|
+
import { type FormInputStateProps } from './FormContext';
|
|
5
|
+
import { type InputComponent } from './Input';
|
|
6
|
+
type ArrayFieldProps = {
|
|
7
|
+
property: SchemaProperty<any>;
|
|
8
|
+
readonly?: boolean;
|
|
9
|
+
inputProps: FormInputStateProps;
|
|
10
|
+
path?: (string | number)[];
|
|
11
|
+
Custom?: Partial<Record<string, InputComponent>>;
|
|
12
|
+
lookupComponent?: ComponentLookup;
|
|
13
|
+
};
|
|
14
|
+
export declare const ArrayField: ({ property, readonly, path, inputProps, Custom, lookupComponent }: ArrayFieldProps) => React.JSX.Element | null;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=ArrayField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArrayField.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/ArrayField.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAOpD,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAiB,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAK3D,KAAK,eAAe,GAAG;IACrB,QAAQ,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;IACjD,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,UAAU,sEAAuE,eAAe,6BA8E5G,CAAC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type BaseObject } from '@dxos/echo-schema';
|
|
3
2
|
import { type InputProps } from './Input';
|
|
4
|
-
export declare const TextInput:
|
|
5
|
-
export declare const NumberInput:
|
|
6
|
-
export declare const BooleanInput:
|
|
7
|
-
export type SelectInputOptions
|
|
3
|
+
export declare const TextInput: ({ type, label, inputOnly, disabled, placeholder, getStatus, getValue, onValueChange, onBlur, }: InputProps) => React.JSX.Element;
|
|
4
|
+
export declare const NumberInput: ({ type, label, inputOnly, disabled, placeholder, getStatus, getValue, onValueChange, onBlur, }: InputProps) => React.JSX.Element;
|
|
5
|
+
export declare const BooleanInput: ({ type, label, inputOnly, getStatus, getValue, onValueChange }: InputProps) => React.JSX.Element;
|
|
6
|
+
export type SelectInputOptions = InputProps & {
|
|
8
7
|
options?: Array<{
|
|
9
8
|
value: string | number;
|
|
10
9
|
label?: string;
|
|
11
10
|
}>;
|
|
12
11
|
};
|
|
13
|
-
export declare const SelectInput:
|
|
12
|
+
export declare const SelectInput: ({ type, label, inputOnly, disabled, placeholder, options, getStatus, getValue, onValueChange, }: SelectInputOptions) => React.JSX.Element;
|
|
14
13
|
//# sourceMappingURL=Defaults.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Defaults.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Defaults.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Defaults.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Defaults.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,SAAS,mGAUnB,UAAU,sBAoBZ,CAAC;AAEF,eAAO,MAAM,WAAW,mGAUrB,UAAU,sBAqBZ,CAAC;AAEF,eAAO,MAAM,YAAY,mEAAoE,UAAU,sBAgBtG,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG;IAC5C,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC7D,CAAC;AAEF,eAAO,MAAM,WAAW,oGAUrB,kBAAkB,sBA6BpB,CAAC"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type BaseObject, type PropertyKey } from '@dxos/echo-schema';
|
|
1
|
+
import React, { type ReactElement } from 'react';
|
|
2
|
+
import { type BaseObject, type S, type PropertyKey } from '@dxos/echo-schema';
|
|
3
3
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
4
4
|
import { type SchemaProperty } from '@dxos/schema';
|
|
5
|
-
import { type InputComponent } from './Input';
|
|
5
|
+
import { type InputProps, type InputComponent } from './Input';
|
|
6
6
|
import { type FormOptions } from '../../hooks';
|
|
7
7
|
export type PropsFilter<T extends BaseObject> = (props: SchemaProperty<T>[]) => SchemaProperty<T>[];
|
|
8
|
+
export type ComponentLookup = (args: {
|
|
9
|
+
prop: string;
|
|
10
|
+
schema: S.Schema<any>;
|
|
11
|
+
inputProps: InputProps;
|
|
12
|
+
}) => ReactElement | undefined;
|
|
8
13
|
export type FormProps<T extends BaseObject> = ThemedClassName<{
|
|
9
|
-
values: T
|
|
14
|
+
values: Partial<T>;
|
|
10
15
|
/** Path to the current object from the root. Used with nested forms. */
|
|
11
16
|
path?: string[];
|
|
12
17
|
autoFocus?: boolean;
|
|
@@ -16,21 +21,12 @@ export type FormProps<T extends BaseObject> = ThemedClassName<{
|
|
|
16
21
|
autoSave?: boolean;
|
|
17
22
|
testId?: string;
|
|
18
23
|
onCancel?: () => void;
|
|
24
|
+
lookupComponent?: ComponentLookup;
|
|
19
25
|
/**
|
|
20
26
|
* Map of custom renderers for specific properties.
|
|
27
|
+
* Prefer lookupComponent for plugin specific input surfaces.
|
|
21
28
|
*/
|
|
22
|
-
Custom?: Partial<Record<string, InputComponent
|
|
29
|
+
Custom?: Partial<Record<string, InputComponent>>;
|
|
23
30
|
} & Pick<FormOptions<T>, 'schema' | 'onValuesChanged' | 'onValidate' | 'onSave'>>;
|
|
24
|
-
|
|
25
|
-
* General purpose form component that displays field controls based on the given schema.
|
|
26
|
-
*/
|
|
27
|
-
export declare const Form: <T extends BaseObject>({ classNames, schema, values: initialValues, path, readonly, filter, sort, autoSave, testId, onValuesChanged, onValidate, onSave, onCancel, Custom, }: FormProps<T>) => React.JSX.Element;
|
|
28
|
-
type FormActionsProps = {
|
|
29
|
-
readonly?: boolean;
|
|
30
|
-
canSubmit: boolean;
|
|
31
|
-
onCancel?: () => void;
|
|
32
|
-
onSubmit: () => void;
|
|
33
|
-
};
|
|
34
|
-
export declare const FormActions: ({ onCancel, onSubmit, canSubmit, readonly }: FormActionsProps) => React.JSX.Element;
|
|
35
|
-
export {};
|
|
31
|
+
export declare const Form: <T extends BaseObject>({ classNames, schema, values: initialValues, path, readonly, filter, sort, autoSave, testId, onValuesChanged, onValidate, onSave, onCancel, lookupComponent, Custom, }: FormProps<T>) => React.JSX.Element;
|
|
36
32
|
//# sourceMappingURL=Form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Form.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Form.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,YAAY,EAAW,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,CAAC,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAKnD,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,UAAU,IAAI,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;AAEpG,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACtB,UAAU,EAAE,UAAU,CAAC;CACxB,KAAK,YAAY,GAAG,SAAS,CAAC;AAE/B,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,UAAU,IAAI,eAAe,CAC3D;IACE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAEnB,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAGhB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,MAAM,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;CAClD,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,QAAQ,GAAG,iBAAiB,GAAG,YAAY,GAAG,QAAQ,CAAC,CACjF,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,UAAU,0KAgBtC,SAAS,CAAC,CAAC,CAAC,sBA0Bd,CAAC"}
|
|
@@ -24,13 +24,14 @@ export default meta;
|
|
|
24
24
|
type Story<T extends BaseObject> = StoryObj<StoryProps<T>>;
|
|
25
25
|
export declare const Default: Story<TestType>;
|
|
26
26
|
export declare const Org: Story<Testing.OrgSchemaType>;
|
|
27
|
+
export declare const OrgAutoSave: Story<Testing.OrgSchemaType>;
|
|
27
28
|
declare const ShapeSchema: S.mutable<S.Struct<{
|
|
28
29
|
shape: S.optional<S.Union<[S.Struct<{
|
|
29
30
|
type: S.Literal<["circle"]>;
|
|
30
31
|
radius: S.optional<S.SchemaClass<number, number, never>>;
|
|
31
32
|
}>, S.Struct<{
|
|
32
33
|
type: S.Literal<["square"]>;
|
|
33
|
-
size: S.optional<S.
|
|
34
|
+
size: S.optional<S.refine<number, S.Schema<number, number, never>>>;
|
|
34
35
|
}>]>>;
|
|
35
36
|
}>>;
|
|
36
37
|
type ShapeType = S.Schema.Type<typeof ShapeSchema>;
|
|
@@ -47,4 +48,9 @@ declare const ArraysSchema: S.mutable<S.Struct<{
|
|
|
47
48
|
}>>;
|
|
48
49
|
type ArraysType = S.Schema.Type<typeof ArraysSchema>;
|
|
49
50
|
export declare const Arrays: StoryObj<FormProps<ArraysType>>;
|
|
51
|
+
declare const ColorSchema: S.mutable<S.Struct<{
|
|
52
|
+
color: S.Union<[S.Literal<["red"]>, S.Literal<["green"]>, S.Literal<["blue"]>]>;
|
|
53
|
+
}>>;
|
|
54
|
+
type ColorType = S.Schema.Type<typeof ColorSchema>;
|
|
55
|
+
export declare const Enum: StoryObj<FormProps<ColorType>>;
|
|
50
56
|
//# sourceMappingURL=Form.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Form.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5D,OAAO,EAAO,KAAK,UAAU,EAAU,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAI/C,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAY9C,QAAA,MAAM,UAAU;;;;;;;;;;;GAME,CAAC;AAEnB,KAAK,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAEjD,KAAK,UAAU,CAAC,CAAC,SAAS,UAAU,IAAI;IAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;CAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAiB/E,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAQ/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,CAAC,CAAC,SAAS,UAAU,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3D,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,QAAQ,CAWnC,CAAC;
|
|
1
|
+
{"version":3,"file":"Form.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Form.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5D,OAAO,EAAO,KAAK,UAAU,EAAU,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAI/C,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAY9C,QAAA,MAAM,UAAU;;;;;;;;;;;GAME,CAAC;AAEnB,KAAK,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAEjD,KAAK,UAAU,CAAC,CAAC,SAAS,UAAU,IAAI;IAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;CAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAiB/E,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAQ/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,CAAC,CAAC,SAAS,UAAU,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3D,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,QAAQ,CAWnC,CAAC;AAEF,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,aAAa,CAQ5C,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,aAAa,CASpD,CAAC;AAkBF,QAAA,MAAM,WAAW;;;;;;;;GAaC,CAAC;AAEnB,KAAK,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC;AAEnD,KAAK,4BAA4B,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;AAgCzD,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,4BAA4B,CAUrE,CAAC;AAEF,QAAA,MAAM,YAAY;;;;;;;;GAGA,CAAC;AAEnB,KAAK,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,YAAY,CAAC,CAAC;AAiBrD,eAAO,MAAM,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,CAQlD,CAAC;AAEF,QAAA,MAAM,WAAW;;GAIC,CAAC;AAEnB,KAAK,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC;AAiBnD,eAAO,MAAM,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,CAO/C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormActions.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FormActions.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,WAAW,2BAA4B,gBAAgB,sBAuBnE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { S } from '@dxos/echo-schema';
|
|
3
|
+
import { type SchemaProperty } from '@dxos/schema';
|
|
4
|
+
import { type ComponentLookup } from './Form';
|
|
5
|
+
import { type InputComponent } from './Input';
|
|
6
|
+
export type FormContentProps = {
|
|
7
|
+
schema: S.Schema.All;
|
|
8
|
+
path?: (string | number)[];
|
|
9
|
+
filter?: (props: SchemaProperty<any>[]) => SchemaProperty<any>[];
|
|
10
|
+
sort?: string[];
|
|
11
|
+
readonly?: boolean;
|
|
12
|
+
lookupComponent?: ComponentLookup;
|
|
13
|
+
Custom?: Partial<Record<string, InputComponent>>;
|
|
14
|
+
};
|
|
15
|
+
export type FormFieldProps = {
|
|
16
|
+
property: SchemaProperty<any>;
|
|
17
|
+
path?: (string | number)[];
|
|
18
|
+
readonly?: boolean;
|
|
19
|
+
/** Used to indicate if input should be presented inline (e.g. for array items). */
|
|
20
|
+
inline?: boolean;
|
|
21
|
+
lookupComponent?: ComponentLookup;
|
|
22
|
+
Custom?: Partial<Record<string, InputComponent>>;
|
|
23
|
+
};
|
|
24
|
+
export declare const FormField: ({ property, path, readonly, inline, lookupComponent, Custom }: FormFieldProps) => React.JSX.Element | null;
|
|
25
|
+
export declare const FormFields: ({ schema, path, filter, sort, readonly, lookupComponent, Custom }: FormContentProps) => React.JSX.Element;
|
|
26
|
+
//# sourceMappingURL=FormContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormContent.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FormContent.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAO,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAKxE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;IACrB,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,EAAE,KAAK,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;IACjE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mFAAmF;IACnF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;CAClD,CAAC;AAEF,eAAO,MAAM,SAAS,kEAAmE,cAAc,6BAmFtG,CAAC;AAEF,eAAO,MAAM,UAAU,sEAAuE,gBAAgB,sBA4B7G,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { type FocusEvent, type PropsWithChildren } from 'react';
|
|
2
|
+
import { type BaseObject } from '@dxos/echo-schema';
|
|
3
|
+
import { type SimpleType } from '@dxos/effect';
|
|
4
|
+
import { type FormHandler, type FormOptions } from '../../hooks';
|
|
5
|
+
type FormContextValue<T extends BaseObject> = FormHandler<T>;
|
|
6
|
+
export declare const useFormContext: <T extends BaseObject>() => FormContextValue<T>;
|
|
7
|
+
export declare const useFormValues: (path?: (string | number)[]) => any;
|
|
8
|
+
export type FormInputStateProps = {
|
|
9
|
+
getStatus: () => {
|
|
10
|
+
status?: 'error';
|
|
11
|
+
error?: string;
|
|
12
|
+
};
|
|
13
|
+
getValue: <V>() => V | undefined;
|
|
14
|
+
onValueChange: (type: SimpleType, value: any) => void;
|
|
15
|
+
onBlur: (event: FocusEvent<HTMLElement>) => void;
|
|
16
|
+
};
|
|
17
|
+
export declare const useInputProps: (path?: (string | number)[]) => FormInputStateProps;
|
|
18
|
+
export declare const FormProvider: ({ children, ...formOptions }: PropsWithChildren<FormOptions<any>>) => React.JSX.Element;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=FormContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormContext.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FormContext.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAA6B,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGlG,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAW,MAAM,aAAa,CAAC;AAE1E,KAAK,gBAAgB,CAAC,CAAC,SAAS,UAAU,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AAI7D,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,UAAU,OAAK,gBAAgB,CAAC,CAAC,CAEzE,CAAC;AAEF,eAAO,MAAM,aAAa,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAQ,GAI9D,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,MAAM;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;IACjC,aAAa,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACtD,MAAM,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CAClD,CAAC;AAEF,eAAO,MAAM,aAAa,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAQ,mBAS9D,CAAC;AAEF,eAAO,MAAM,YAAY,iCAAkC,iBAAiB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,sBAG7F,CAAC"}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import React, { type FC, type PropsWithChildren } from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type FormatEnum } from '@dxos/echo-schema';
|
|
3
3
|
import { type SimpleType } from '@dxos/effect';
|
|
4
|
-
import { type
|
|
4
|
+
import { type FormInputStateProps } from './FormContext';
|
|
5
5
|
/**
|
|
6
6
|
* Props passed to input components.
|
|
7
7
|
*/
|
|
8
|
-
export type InputProps
|
|
9
|
-
property: FormPath<T>;
|
|
8
|
+
export type InputProps = {
|
|
10
9
|
type: SimpleType;
|
|
11
10
|
format?: FormatEnum;
|
|
12
11
|
label?: string;
|
|
13
12
|
disabled?: boolean;
|
|
14
13
|
placeholder?: string;
|
|
15
14
|
inputOnly?: boolean;
|
|
16
|
-
} &
|
|
15
|
+
} & FormInputStateProps;
|
|
17
16
|
/**
|
|
18
17
|
* Form input component.
|
|
19
18
|
*/
|
|
20
|
-
export type InputComponent
|
|
19
|
+
export type InputComponent = FC<InputProps>;
|
|
21
20
|
export type InputHeaderProps = PropsWithChildren<{
|
|
22
21
|
error?: string;
|
|
23
22
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Input.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,KAAK,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Input.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAI/C,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,GAAG,mBAAmB,CAAC;AAExB;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEH,eAAO,MAAM,WAAW,wBAAyB,gBAAgB,sBAiBhE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeoPointInput.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/custom/GeoPointInput.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAExD,eAAO,MAAM,aAAa,0EAA2E,UAAU,sBA8B9G,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type InputProps } from '../Input';
|
|
3
|
+
export declare const TupleInput: ({ binding, type, label, disabled, getStatus, getValue, onValueChange, onBlur, }: InputProps & {
|
|
4
|
+
binding: string[];
|
|
5
|
+
}) => React.JSX.Element;
|
|
6
|
+
//# sourceMappingURL=TupleInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TupleInput.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/custom/TupleInput.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAIxD,eAAO,MAAM,UAAU,oFASpB,UAAU,GAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,sBAyBpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/custom/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FormatEnum } from '@dxos/echo-schema';
|
|
2
2
|
import { type SimpleType } from '@dxos/effect';
|
|
3
3
|
import { type InputComponent } from './Input';
|
|
4
4
|
/**
|
|
5
5
|
* Get property input component.
|
|
6
6
|
*/
|
|
7
|
-
export declare const getInputComponent:
|
|
7
|
+
export declare const getInputComponent: (type: SimpleType, format?: FormatEnum) => InputComponent | undefined;
|
|
8
8
|
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/factory.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/factory.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C;;GAEG;AACH,eAAO,MAAM,iBAAiB,SAAU,UAAU,WAAW,UAAU,KAAG,cAAc,GAAG,SAc1F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AAEzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
3
|
-
import { type
|
|
2
|
+
import { type SchemaRegistry } from '@dxos/echo-db';
|
|
3
|
+
import { type EchoSchema } from '@dxos/echo-schema';
|
|
4
4
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
5
5
|
import { type ViewType } from '@dxos/schema';
|
|
6
6
|
export type ViewEditorProps = ThemedClassName<{
|
|
7
|
-
schema:
|
|
7
|
+
schema: EchoSchema;
|
|
8
8
|
view: ViewType;
|
|
9
|
-
registry?:
|
|
9
|
+
registry?: SchemaRegistry;
|
|
10
10
|
readonly?: boolean;
|
|
11
11
|
showHeading?: boolean;
|
|
12
|
+
onTypenameChanged: (typename: string) => void;
|
|
12
13
|
onDelete: (fieldId: string) => void;
|
|
13
14
|
}>;
|
|
14
15
|
/**
|
|
15
16
|
* Schema-based object form.
|
|
16
17
|
*/
|
|
17
|
-
export declare const ViewEditor: ({ classNames, schema, view, registry, readonly, showHeading, onDelete, }: ViewEditorProps) => React.JSX.Element;
|
|
18
|
+
export declare const ViewEditor: ({ classNames, schema, view, registry, readonly, showHeading, onTypenameChanged, onDelete, }: ViewEditorProps) => React.JSX.Element;
|
|
18
19
|
//# sourceMappingURL=ViewEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAe,KAAK,
|
|
1
|
+
{"version":3,"file":"ViewEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAe,KAAK,UAAU,EAAK,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAc,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAGlF,OAAO,EAA+B,KAAK,QAAQ,EAAoC,MAAM,cAAc,CAAC;AAoB5G,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC;IAC5C,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC,CAAC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU,gGASpB,eAAe,sBA8GjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ViewEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAU5D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA+D1C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAQjC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAEtB,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -1,45 +1,43 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
3
|
-
import { type SimpleType, type S } from '@dxos/effect';
|
|
1
|
+
import { type BaseObject } from '@dxos/echo-schema';
|
|
2
|
+
import { type S, type SimpleType, type JsonPath } from '@dxos/effect';
|
|
4
3
|
import { type ValidationError } from '@dxos/schema';
|
|
5
4
|
import { type MaybePromise } from '@dxos/util';
|
|
6
|
-
export type FormPath<T extends object = {}> = PropertyKey<T> | `${PropertyKey<T>}.${number}`;
|
|
7
5
|
/**
|
|
8
6
|
* Return type from `useForm` hook.
|
|
9
7
|
*/
|
|
10
8
|
export type FormHandler<T extends BaseObject> = {
|
|
11
|
-
values: T
|
|
12
|
-
errors: Record<
|
|
13
|
-
touched: Record<
|
|
14
|
-
changed: Record<
|
|
9
|
+
values: Partial<T>;
|
|
10
|
+
errors: Record<JsonPath, string>;
|
|
11
|
+
touched: Record<JsonPath, boolean>;
|
|
12
|
+
changed: Record<JsonPath, boolean>;
|
|
15
13
|
canSave: boolean;
|
|
16
14
|
handleSave: () => void;
|
|
17
|
-
getStatus: (
|
|
15
|
+
getStatus: (path: string | (string | number)[]) => {
|
|
18
16
|
status?: 'error';
|
|
19
17
|
error?: string;
|
|
20
18
|
};
|
|
21
|
-
getValue: <V>(
|
|
22
|
-
onValueChange: <V>(
|
|
23
|
-
|
|
19
|
+
getValue: <V>(path: (string | number)[]) => V | undefined;
|
|
20
|
+
onValueChange: <V>(path: (string | number)[], type: SimpleType, value: V) => void;
|
|
21
|
+
onTouched: (path: (string | number)[]) => void;
|
|
24
22
|
};
|
|
25
23
|
/**
|
|
26
24
|
* Hook options.
|
|
27
25
|
*/
|
|
28
26
|
export interface FormOptions<T extends BaseObject> {
|
|
29
27
|
/**
|
|
30
|
-
* Effect schema.
|
|
28
|
+
* Effect schema (Type literal).
|
|
31
29
|
*/
|
|
32
30
|
schema: S.Schema<T>;
|
|
33
31
|
/**
|
|
34
32
|
* Initial values (which may not pass validation).
|
|
35
33
|
*/
|
|
36
|
-
initialValues: T
|
|
34
|
+
initialValues: Partial<T>;
|
|
37
35
|
/**
|
|
38
36
|
* Callback for value changes. Note: This is called even when values are invalid.
|
|
39
37
|
* Sometimes the parent component may want to know about changes even if the form is
|
|
40
38
|
* in an invalid state.
|
|
41
39
|
*/
|
|
42
|
-
onValuesChanged?: (values: T) => void;
|
|
40
|
+
onValuesChanged?: (values: Partial<T>) => void;
|
|
43
41
|
/**
|
|
44
42
|
* Custom validation function that runs only after schema validation passes.
|
|
45
43
|
* Use this for complex validation logic that can't be expressed in the schema.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useForm.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useForm.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,UAAU,EAAsB,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAO,KAAK,CAAC,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAA4C,MAAM,cAAc,CAAC;AAGrH,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,UAAU,IAAI;IAK9C,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,IAAI,CAAC;IAMvB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxF,QAAQ,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC;IAC1D,aAAa,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAClF,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,UAAU;IAC/C;;OAEG;IACH,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAEpB;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAE1B;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAE/C;;;;OAIG;IAEH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,eAAe,EAAE,GAAG,SAAS,CAAC;IAE1D;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE;QAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;KAAE,KAAK,IAAI,CAAC;IAE5E;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE;QAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;KAAE,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;CAC1F;AAED;;;GAGG;AACH,eAAO,MAAM,OAAO,GAAI,CAAC,SAAS,UAAU,4EAOzC,WAAW,CAAC,CAAC,CAAC,KAAG,WAAW,CAAC,CAAC,CA+IhC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"5.7.2"}
|