@dxos/react-ui-form 0.8.4-main.c1de068 → 0.8.4-main.c85a9c8dae
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/dist/lib/browser/index.mjs +2314 -2078
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +2314 -2078
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/FieldEditor/FieldEditor.d.ts +8 -7
- package/dist/types/src/components/FieldEditor/FieldEditor.d.ts.map +1 -1
- package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts +82 -5
- package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.d.ts +81 -25
- package/dist/types/src/components/Form/Form.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.stories.d.ts +127 -55
- package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/FormField.d.ts +37 -0
- package/dist/types/src/components/Form/FormField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormFieldComponent.d.ts +78 -0
- package/dist/types/src/components/Form/FormFieldComponent.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts +9 -0
- package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormFieldSet.d.ts +19 -0
- package/dist/types/src/components/Form/FormFieldSet.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/ArrayField.d.ts +18 -0
- package/dist/types/src/components/Form/fields/ArrayField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/BooleanField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/BooleanField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/GeoPointField.d.ts +5 -0
- package/dist/types/src/components/Form/fields/GeoPointField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/MarkdownField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/MarkdownField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/NumberField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/NumberField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/RefField.d.ts +14 -0
- package/dist/types/src/components/Form/fields/RefField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/SelectField.d.ts +10 -0
- package/dist/types/src/components/Form/fields/SelectField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/SelectOptionField.d.ts +5 -0
- package/dist/types/src/components/Form/fields/SelectOptionField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts +82 -0
- package/dist/types/src/components/Form/fields/SelectOptionField.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/TextAreaField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/TextAreaField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/TextField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/TextField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/TupleField.d.ts +6 -0
- package/dist/types/src/components/Form/fields/TupleField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/index.d.ts +12 -0
- package/dist/types/src/components/Form/fields/index.d.ts.map +1 -0
- package/dist/types/src/components/Form/index.d.ts +2 -4
- package/dist/types/src/components/Form/index.d.ts.map +1 -1
- package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts +46 -0
- package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts.map +1 -0
- package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts +85 -0
- package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts.map +1 -0
- package/dist/types/src/components/ObjectPicker/index.d.ts +2 -0
- package/dist/types/src/components/ObjectPicker/index.d.ts.map +1 -0
- package/dist/types/src/components/Settings/Settings.d.ts +56 -0
- package/dist/types/src/components/Settings/Settings.d.ts.map +1 -0
- package/dist/types/src/components/Settings/Settings.stories.d.ts +81 -0
- package/dist/types/src/components/Settings/Settings.stories.d.ts.map +1 -0
- package/dist/types/src/components/Settings/index.d.ts +2 -0
- package/dist/types/src/components/Settings/index.d.ts.map +1 -0
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +22 -10
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +84 -8
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +4 -3
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -3
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useFormHandler.d.ts +82 -0
- package/dist/types/src/hooks/useFormHandler.d.ts.map +1 -0
- package/dist/types/src/hooks/useKeyHandler.d.ts +6 -0
- package/dist/types/src/hooks/useKeyHandler.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +19 -10
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/util/field.d.ts +3 -3
- package/dist/types/src/util/field.d.ts.map +1 -1
- package/dist/types/src/util/formatting.d.ts +2 -2
- package/dist/types/src/util/formatting.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/properties.d.ts +7 -0
- package/dist/types/src/util/properties.d.ts.map +1 -0
- package/dist/types/src/util/refs.d.ts +2 -3
- package/dist/types/src/util/refs.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +51 -42
- package/src/components/FieldEditor/FieldEditor.stories.tsx +51 -32
- package/src/components/FieldEditor/FieldEditor.test.tsx +3 -2
- package/src/components/FieldEditor/FieldEditor.tsx +87 -83
- package/src/components/Form/Form.stories.tsx +156 -219
- package/src/components/Form/Form.tsx +347 -96
- package/src/components/Form/FormField.tsx +294 -0
- package/src/components/Form/FormFieldComponent.stories.tsx +65 -0
- package/src/components/Form/FormFieldComponent.tsx +172 -0
- package/src/components/Form/FormFieldSet.tsx +123 -0
- package/src/components/Form/README.md +3 -0
- package/src/components/Form/fields/ArrayField.tsx +149 -0
- package/src/components/Form/fields/BooleanField.tsx +22 -0
- package/src/components/Form/fields/GeoPointField.tsx +120 -0
- package/src/components/Form/fields/MarkdownField.tsx +78 -0
- package/src/components/Form/fields/NumberField.tsx +39 -0
- package/src/components/Form/fields/RefField.tsx +189 -0
- package/src/components/Form/fields/SelectField.tsx +65 -0
- package/src/components/Form/fields/SelectOptionField.stories.tsx +64 -0
- package/src/components/Form/{custom/SelectOptionsInput.tsx → fields/SelectOptionField.tsx} +46 -41
- package/src/components/Form/fields/TextAreaField.tsx +38 -0
- package/src/components/Form/fields/TextField.tsx +38 -0
- package/src/components/Form/{custom/TupleInput.tsx → fields/TupleField.tsx} +16 -9
- package/src/components/Form/fields/index.ts +15 -0
- package/src/components/Form/index.ts +3 -4
- package/src/components/ObjectPicker/ObjectPicker.stories.tsx +210 -0
- package/src/components/ObjectPicker/ObjectPicker.tsx +175 -0
- package/src/components/{ControlSection → ObjectPicker}/index.ts +1 -1
- package/src/components/Settings/Settings.stories.tsx +56 -0
- package/src/components/Settings/Settings.tsx +230 -0
- package/src/components/Settings/index.ts +5 -0
- package/src/components/ViewEditor/ViewEditor.stories.tsx +140 -62
- package/src/components/ViewEditor/ViewEditor.test.tsx +17 -18
- package/src/components/ViewEditor/ViewEditor.tsx +341 -202
- package/src/components/index.ts +2 -3
- package/src/components/testing.tsx +22 -11
- package/src/hooks/index.ts +2 -3
- package/src/hooks/useFormHandler.ts +380 -0
- package/src/hooks/useKeyHandler.tsx +37 -0
- package/src/translations.ts +21 -12
- package/src/util/field.ts +33 -43
- package/src/util/formatting.ts +22 -22
- package/src/util/index.ts +1 -1
- package/src/util/properties.ts +18 -0
- package/src/util/refs.ts +12 -18
- package/dist/types/src/components/ControlSection/ControlSection.d.ts +0 -23
- package/dist/types/src/components/ControlSection/ControlSection.d.ts.map +0 -1
- package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts +0 -8
- package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts.map +0 -1
- package/dist/types/src/components/ControlSection/index.d.ts +0 -2
- package/dist/types/src/components/ControlSection/index.d.ts.map +0 -1
- package/dist/types/src/components/Form/ArrayField.d.ts +0 -16
- package/dist/types/src/components/Form/ArrayField.d.ts.map +0 -1
- package/dist/types/src/components/Form/Defaults.d.ts +0 -14
- package/dist/types/src/components/Form/Defaults.d.ts.map +0 -1
- package/dist/types/src/components/Form/FormActions.d.ts +0 -9
- package/dist/types/src/components/Form/FormActions.d.ts.map +0 -1
- package/dist/types/src/components/Form/FormContent.d.ts +0 -57
- package/dist/types/src/components/Form/FormContent.d.ts.map +0 -1
- package/dist/types/src/components/Form/FormContext.d.ts +0 -23
- package/dist/types/src/components/Form/FormContext.d.ts.map +0 -1
- package/dist/types/src/components/Form/Input.d.ts +0 -26
- package/dist/types/src/components/Form/Input.d.ts.map +0 -1
- package/dist/types/src/components/Form/RefField.d.ts +0 -12
- package/dist/types/src/components/Form/RefField.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/GeoPointInput.d.ts +0 -4
- package/dist/types/src/components/Form/custom/GeoPointInput.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts +0 -4
- package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts +0 -7
- package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/TupleInput.d.ts +0 -6
- package/dist/types/src/components/Form/custom/TupleInput.d.ts.map +0 -1
- package/dist/types/src/components/Form/custom/index.d.ts +0 -4
- package/dist/types/src/components/Form/custom/index.d.ts.map +0 -1
- package/dist/types/src/components/Form/factory.d.ts +0 -8
- package/dist/types/src/components/Form/factory.d.ts.map +0 -1
- package/dist/types/src/components/deprecated/Form.d.ts +0 -15
- package/dist/types/src/components/deprecated/Form.d.ts.map +0 -1
- package/dist/types/src/components/deprecated/Form.stories.d.ts +0 -13
- package/dist/types/src/components/deprecated/Form.stories.d.ts.map +0 -1
- package/dist/types/src/components/deprecated/FormInput.d.ts +0 -16
- package/dist/types/src/components/deprecated/FormInput.d.ts.map +0 -1
- package/dist/types/src/components/deprecated/index.d.ts +0 -2
- package/dist/types/src/components/deprecated/index.d.ts.map +0 -1
- package/dist/types/src/hooks/useForm.d.ts +0 -67
- package/dist/types/src/hooks/useForm.d.ts.map +0 -1
- package/dist/types/src/hooks/useQueryRefOptions.d.ts +0 -23
- package/dist/types/src/hooks/useQueryRefOptions.d.ts.map +0 -1
- package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts +0 -8
- package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts.map +0 -1
- package/dist/types/src/util/schema.d.ts +0 -3
- package/dist/types/src/util/schema.d.ts.map +0 -1
- package/src/components/ControlSection/ControlSection.stories.tsx +0 -41
- package/src/components/ControlSection/ControlSection.tsx +0 -139
- package/src/components/Form/ArrayField.tsx +0 -124
- package/src/components/Form/Defaults.tsx +0 -203
- package/src/components/Form/FormActions.tsx +0 -53
- package/src/components/Form/FormContent.tsx +0 -240
- package/src/components/Form/FormContext.tsx +0 -110
- package/src/components/Form/Input.tsx +0 -51
- package/src/components/Form/RefField.tsx +0 -213
- package/src/components/Form/custom/GeoPointInput.tsx +0 -72
- package/src/components/Form/custom/SelectOptionsInput.stories.tsx +0 -61
- package/src/components/Form/custom/index.ts +0 -7
- package/src/components/Form/factory.tsx +0 -31
- package/src/components/deprecated/Form.stories.tsx +0 -62
- package/src/components/deprecated/Form.tsx +0 -119
- package/src/components/deprecated/FormInput.tsx +0 -71
- package/src/components/deprecated/index.ts +0 -5
- package/src/hooks/useForm.ts +0 -291
- package/src/hooks/useQueryRefOptions.ts +0 -53
- package/src/hooks/useRefQueryLookupHandler.ts +0 -39
- package/src/util/schema.ts +0 -14
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type * as Schema from 'effect/Schema';
|
|
2
|
+
import type * as SchemaAST from 'effect/SchemaAST';
|
|
3
|
+
import { type AnyProperties } from '@dxos/echo/internal';
|
|
4
|
+
import { type JsonPath } from '@dxos/effect';
|
|
5
|
+
import { type ValidationError } from '@dxos/schema';
|
|
6
|
+
import { type MaybePromise } from '@dxos/util';
|
|
7
|
+
export type FormFieldStatus = {
|
|
8
|
+
status?: 'error';
|
|
9
|
+
error?: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Form properties.
|
|
13
|
+
*/
|
|
14
|
+
export interface FormHandlerProps<T extends AnyProperties> {
|
|
15
|
+
/**
|
|
16
|
+
* Effect schema (Type literal).
|
|
17
|
+
*/
|
|
18
|
+
schema?: Schema.Schema<T, any>;
|
|
19
|
+
/**
|
|
20
|
+
* Values for the form if controlled.
|
|
21
|
+
*/
|
|
22
|
+
values?: Partial<T>;
|
|
23
|
+
/**
|
|
24
|
+
* Default values for the form which will be used if values is not provided.
|
|
25
|
+
*/
|
|
26
|
+
defaultValues?: Partial<T>;
|
|
27
|
+
/**
|
|
28
|
+
* Auto-save the form when the values change.
|
|
29
|
+
*/
|
|
30
|
+
autoSave?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Callback for value changes. Note: This is called even when values are invalid.
|
|
33
|
+
* Sometimes the parent component may want to know about changes even if the form is
|
|
34
|
+
* in an invalid state.
|
|
35
|
+
*/
|
|
36
|
+
onValuesChanged?: (values: Partial<T>, meta: FormUpdateMeta<T>) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Custom validation function that runs only after schema validation passes.
|
|
39
|
+
* Use this for complex validation logic that can't be expressed in the schema.
|
|
40
|
+
* @returns Array of validation errors, or undefined if validation passes
|
|
41
|
+
*/
|
|
42
|
+
onValidate?: (values: T) => ValidationError[] | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Called when the form is submitted and passes validation.
|
|
45
|
+
*/
|
|
46
|
+
onSave?: (values: T, meta: FormUpdateMeta<T>) => MaybePromise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Called when the form is canceled.
|
|
49
|
+
*/
|
|
50
|
+
onCancel?: () => void;
|
|
51
|
+
}
|
|
52
|
+
export type FormUpdateMeta<T extends AnyProperties> = {
|
|
53
|
+
changed: FormHandler<T>['changed'];
|
|
54
|
+
isValid: boolean;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Form handler properties and methods.
|
|
58
|
+
*/
|
|
59
|
+
export type FormHandler<T extends AnyProperties> = Pick<FormHandlerProps<T>, 'schema' | 'autoSave'> & {
|
|
60
|
+
/** Initial values (which may not pass validation). */
|
|
61
|
+
values: Partial<T>;
|
|
62
|
+
/** Map of changed fields. */
|
|
63
|
+
changed: Record<JsonPath, boolean>;
|
|
64
|
+
touched: Record<JsonPath, boolean>;
|
|
65
|
+
/** Map of error strings. */
|
|
66
|
+
errors: Record<JsonPath, string>;
|
|
67
|
+
/** Whether the form can be saved (i.e., data is valid). */
|
|
68
|
+
isValid: boolean;
|
|
69
|
+
canSave: boolean;
|
|
70
|
+
onSave: () => void;
|
|
71
|
+
onCancel: () => void;
|
|
72
|
+
getStatus: (path: string | (string | number)[]) => FormFieldStatus;
|
|
73
|
+
getValue: <V>(path: (string | number)[]) => V | undefined;
|
|
74
|
+
onBlur: (path: (string | number)[]) => void;
|
|
75
|
+
onValueChange: <V>(path: (string | number)[], type: SchemaAST.AST, value: V) => void;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Creates a hook for managing form state, including values, validation, and submission.
|
|
79
|
+
* Deeply integrated with `@dxos/schema` for schema-based validation.
|
|
80
|
+
*/
|
|
81
|
+
export declare const useFormHandler: <T extends AnyProperties>({ schema, autoSave, values: valuesProp, defaultValues: defaultValuesProp, onValuesChanged, onValidate, onSave, onCancel, ...props }: FormHandlerProps<T>) => FormHandler<T>;
|
|
82
|
+
//# sourceMappingURL=useFormHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormHandler.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useFormHandler.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,KAAK,QAAQ,EAAmE,MAAM,cAAc,CAAC;AAG9G,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,aAAa;IACvD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAE/B;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAExE;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,eAAe,EAAE,GAAG,SAAS,CAAC;IAE1D;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;IAEpE;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,aAAa,IAAI;IACpD,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,aAAa,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC,GAAG;IACpG,sDAAsD;IACtD,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAEnB,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAEnC,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAEnC,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAEjC,2DAA2D;IAC3D,OAAO,EAAE,OAAO,CAAC;IAEjB,OAAO,EAAE,OAAO,CAAC;IAEjB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IAMrB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,eAAe,CAAC;IACnE,QAAQ,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC;IAC1D,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC;IAC5C,aAAa,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CACtF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,aAAa,EAAE,qIAUrD,gBAAgB,CAAC,CAAC,CAAC,KAAG,WAAW,CAAC,CAAC,CA8NrC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeyHandler.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useKeyHandler.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,aAAa,cAAc,GAAG,IAAI,EAAE,MAAM,WAAW,CAAC,GAAG,CAAC,SAuBvF,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export declare const translationKey = "react-ui-form";
|
|
1
|
+
export declare const translationKey = "@dxos/react-ui-form";
|
|
2
2
|
export declare const translations: [{
|
|
3
3
|
readonly 'en-US': {
|
|
4
|
-
readonly "react-ui-form": {
|
|
4
|
+
readonly "@dxos/react-ui-form": {
|
|
5
5
|
readonly 'fields label': "Fields";
|
|
6
6
|
readonly 'hidden fields label': "Hidden Fields";
|
|
7
7
|
readonly 'empty readonly ref field label': "(none)";
|
|
8
|
-
readonly '
|
|
8
|
+
readonly 'add property button label': "Add property";
|
|
9
9
|
readonly 'field property label': "Property";
|
|
10
10
|
readonly 'field property placeholder': "Property name";
|
|
11
11
|
readonly 'field format label': "Type";
|
|
@@ -15,8 +15,17 @@ export declare const translations: [{
|
|
|
15
15
|
readonly 'field limit reached': "Maximum number of fields reached";
|
|
16
16
|
readonly 'boolean input true value': "Yes";
|
|
17
17
|
readonly 'boolean input false value': "No";
|
|
18
|
-
readonly '
|
|
19
|
-
readonly '
|
|
18
|
+
readonly 'show field label': "Show field";
|
|
19
|
+
readonly 'hide field label': "Hide field";
|
|
20
|
+
readonly 'delete field label': "Delete field";
|
|
21
|
+
readonly 'ref field combobox input placeholder': "Search…";
|
|
22
|
+
readonly 'ref field placeholder_one': "Select…";
|
|
23
|
+
readonly 'ref field placeholder_other': "Select items…";
|
|
24
|
+
readonly 'example placeholder': "Example";
|
|
25
|
+
readonly 'latitude placeholder': "Latitude (e.g., 40.7128)";
|
|
26
|
+
readonly 'longitude placeholder': "Longitude (e.g., -74.0060)";
|
|
27
|
+
readonly 'cancel button label': "Cancel";
|
|
28
|
+
readonly 'save button label': "Save";
|
|
20
29
|
readonly 'format boolean': "Boolean";
|
|
21
30
|
readonly 'format currency': "Currency";
|
|
22
31
|
readonly 'format date': "Date";
|
|
@@ -29,7 +38,7 @@ export declare const translations: [{
|
|
|
29
38
|
readonly 'format hostname': "Hostname";
|
|
30
39
|
readonly 'format integer': "Integer";
|
|
31
40
|
readonly 'format json': "JSON";
|
|
32
|
-
readonly 'format
|
|
41
|
+
readonly 'format lnglat': "Geopoint";
|
|
33
42
|
readonly 'format markdown': "Markdown";
|
|
34
43
|
readonly 'format percent': "Percent";
|
|
35
44
|
readonly 'format ref': "Reference";
|
|
@@ -45,15 +54,15 @@ export declare const translations: [{
|
|
|
45
54
|
readonly 'format uri': "URI";
|
|
46
55
|
readonly 'format url': "URL";
|
|
47
56
|
readonly 'format uuid': "UUID";
|
|
48
|
-
readonly '
|
|
49
|
-
readonly '
|
|
57
|
+
readonly 'latitude label': "Latitude";
|
|
58
|
+
readonly 'longitude label': "Longitude";
|
|
50
59
|
readonly 'select option label': "Label";
|
|
51
60
|
readonly 'select option label placeholder': "Option label";
|
|
52
61
|
readonly 'select option color': "Color";
|
|
53
62
|
readonly 'select option delete': "Delete";
|
|
54
63
|
readonly 'select option add': "Add option";
|
|
55
|
-
readonly 'system schema title': "System
|
|
56
|
-
readonly 'system schema description': "
|
|
64
|
+
readonly 'system schema title': "System type";
|
|
65
|
+
readonly 'system schema description': "System type: cannot add or remove fields.";
|
|
57
66
|
};
|
|
58
67
|
};
|
|
59
68
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,wBAAwB,CAAC;AAEpD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgFM,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Format, TypeEnum } from '@dxos/echo/internal';
|
|
2
2
|
import { type ValidationError } from '@dxos/schema';
|
|
3
3
|
/**
|
|
4
4
|
* Parse value by field value type.
|
|
@@ -8,13 +8,13 @@ import { type ValidationError } from '@dxos/schema';
|
|
|
8
8
|
*/
|
|
9
9
|
export type ParseProps = {
|
|
10
10
|
type?: TypeEnum;
|
|
11
|
-
format?:
|
|
11
|
+
format?: Format.TypeFormat;
|
|
12
12
|
value: any;
|
|
13
13
|
};
|
|
14
14
|
export declare const parseValue: ({ type, format, value }: ParseProps) => any;
|
|
15
15
|
export type CellClassesForFieldTypeProps = {
|
|
16
16
|
type?: TypeEnum;
|
|
17
|
-
format?:
|
|
17
|
+
format?: Format.TypeFormat;
|
|
18
18
|
};
|
|
19
19
|
export declare const cellClassesForFieldType: ({ type, format }: CellClassesForFieldTypeProps) => string[] | undefined;
|
|
20
20
|
export declare const pathNotUniqueError: (path: string) => ValidationError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../src/util/field.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../src/util/field.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAe,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IAC3B,KAAK,EAAE,GAAG,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,yBAAyB,UAAU,QAsF7D,CAAC;AAGF,MAAM,MAAM,4BAA4B,GAAG;IACzC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,kBAAkB,4BAA4B,KAAG,MAAM,EAAE,GAAG,SAyBnG,CAAC;AAGF,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,eAGhD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Format, TypeEnum } from '@dxos/echo/internal';
|
|
2
2
|
type ValueFormatProps = {
|
|
3
3
|
type: TypeEnum;
|
|
4
|
-
format?:
|
|
4
|
+
format?: Format.TypeFormat | undefined;
|
|
5
5
|
value: any;
|
|
6
6
|
locale?: string | undefined;
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../src/util/formatting.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../src/util/formatting.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAe,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpE,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC;IACvC,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF;;;GAGG;AAGH,eAAO,MAAM,gBAAgB,GAAI,iCAA6C,gBAAgB,KAAG,MAqFhG,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,iCAA6C,gBAAgB,KAAG,MA8DhG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as SchemaAST from 'effect/SchemaAST';
|
|
2
|
+
import { type SchemaProperty } from '@dxos/effect';
|
|
3
|
+
/**
|
|
4
|
+
* Get the property types of an AST and filter out properties that are not form inputs.
|
|
5
|
+
*/
|
|
6
|
+
export declare const getFormProperties: (ast: SchemaAST.AST) => SchemaProperty[];
|
|
7
|
+
//# sourceMappingURL=properties.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../../../src/util/properties.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAAE,KAAK,cAAc,EAAiB,MAAM,cAAc,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,SAAS,CAAC,GAAG,KAAG,cAAc,EAIpE,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { type SchemaProperty } from '@dxos/schema';
|
|
1
|
+
import type * as SchemaAST from 'effect/SchemaAST';
|
|
3
2
|
type RefProps = {
|
|
4
3
|
ast: SchemaAST.AST;
|
|
5
4
|
isArray: boolean;
|
|
6
5
|
};
|
|
7
|
-
export declare const getRefProps: (
|
|
6
|
+
export declare const getRefProps: (ast: SchemaAST.AST) => RefProps | undefined;
|
|
8
7
|
export {};
|
|
9
8
|
//# sourceMappingURL=refs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refs.d.ts","sourceRoot":"","sources":["../../../../src/util/refs.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"refs.d.ts","sourceRoot":"","sources":["../../../../src/util/refs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAKnD,KAAK,QAAQ,GAAG;IACd,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,KAAK,SAAS,CAAC,GAAG,KAAG,QAAQ,GAAG,SAiB3D,CAAC"}
|