@dxos/react-ui-form 0.8.4-main.b97322e → 0.8.4-main.bcb3aa67d6
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 +2315 -2116
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +2315 -2116
- 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 +84 -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 +43 -0
- package/dist/types/src/components/Form/FormField.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormFieldComponent.d.ts +77 -0
- package/dist/types/src/components/Form/FormFieldComponent.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts +9 -0
- package/dist/types/src/components/Form/FormFieldComponent.stories.d.ts.map +1 -0
- package/dist/types/src/components/Form/FormFieldSet.d.ts +18 -0
- package/dist/types/src/components/Form/FormFieldSet.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/ArrayField.d.ts +18 -0
- package/dist/types/src/components/Form/fields/ArrayField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/BooleanField.d.ts +4 -0
- package/dist/types/src/components/Form/fields/BooleanField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/GeoPointField.d.ts +5 -0
- package/dist/types/src/components/Form/fields/GeoPointField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/MarkdownField.d.ts +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 +16 -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 +54 -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 +39 -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 +63 -54
- 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 +3 -3
- package/dist/types/src/util/refs.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +52 -43
- 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/AUDIT.md +17 -0
- package/src/components/Form/Form.stories.tsx +154 -219
- package/src/components/Form/Form.tsx +314 -97
- package/src/components/Form/FormField.tsx +305 -0
- package/src/components/Form/FormFieldComponent.stories.tsx +65 -0
- package/src/components/Form/FormFieldComponent.tsx +171 -0
- package/src/components/Form/FormFieldSet.tsx +129 -0
- package/src/components/Form/README.md +3 -0
- package/src/components/Form/fields/ArrayField.tsx +154 -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 +199 -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} +49 -45
- package/src/components/Form/fields/TextAreaField.tsx +38 -0
- package/src/components/Form/fields/TextField.tsx +38 -0
- package/src/components/Form/{custom/TupleInput.tsx → fields/TupleField.tsx} +17 -10
- 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 +186 -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 +129 -0
- package/src/components/Settings/index.ts +5 -0
- package/src/components/ViewEditor/ViewEditor.stories.tsx +141 -63
- package/src/components/ViewEditor/ViewEditor.test.tsx +17 -18
- package/src/components/ViewEditor/ViewEditor.tsx +353 -203
- package/src/components/index.ts +2 -3
- package/src/components/testing.tsx +33 -13
- 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 +66 -58
- 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 +17 -19
- 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,12 @@
|
|
|
1
|
+
export * from './ArrayField';
|
|
2
|
+
export * from './BooleanField';
|
|
3
|
+
export * from './GeoPointField';
|
|
4
|
+
export * from './MarkdownField';
|
|
5
|
+
export * from './NumberField';
|
|
6
|
+
export * from './RefField';
|
|
7
|
+
export * from './SelectField';
|
|
8
|
+
export * from './SelectOptionField';
|
|
9
|
+
export * from './TextField';
|
|
10
|
+
export * from './TextAreaField';
|
|
11
|
+
export * from './TupleField';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AAEzB,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type * as Schema from 'effect/Schema';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type Palette, type ThemedClassName } from '@dxos/react-ui';
|
|
4
|
+
import { type FormFieldMap } from '../Form/FormFieldComponent';
|
|
5
|
+
export type RefOption = {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
hue?: Palette;
|
|
9
|
+
};
|
|
10
|
+
export type ObjectPickerContentProps = ThemedClassName<{
|
|
11
|
+
options: RefOption[];
|
|
12
|
+
selectedIds?: string[];
|
|
13
|
+
createOptionLabel?: [string, {
|
|
14
|
+
ns: string;
|
|
15
|
+
}];
|
|
16
|
+
createOptionIcon?: string;
|
|
17
|
+
createSchema?: Schema.Schema.AnyNoContext;
|
|
18
|
+
createInitialValuePath?: string;
|
|
19
|
+
createFieldMap?: FormFieldMap;
|
|
20
|
+
onCreate?: (values: any) => void;
|
|
21
|
+
onSelect: (id: string) => void;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const ObjectPicker: {
|
|
24
|
+
Root: ({ modal, modalId: propsModalId, open: propsOpen, defaultOpen, onOpenChange: propsOnOpenChange, value: propsValue, defaultValue, onValueChange: propsOnValueChange, placeholder, children, }: import("@dxos/react-ui-search").ComboboxRootProps) => React.JSX.Element;
|
|
25
|
+
Portal: {
|
|
26
|
+
(props: import("@dxos/react-ui").PopoverPortalProps & {
|
|
27
|
+
__scopePopover?: import("@radix-ui/react-context").Scope;
|
|
28
|
+
}): React.JSX.Element;
|
|
29
|
+
displayName: string;
|
|
30
|
+
};
|
|
31
|
+
Trigger: React.ForwardRefExoticComponent<Omit<import("@dxos/react-ui").ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
32
|
+
VirtualTrigger: {
|
|
33
|
+
(props: import("@dxos/react-ui").PopoverVirtualTriggerProps & {
|
|
34
|
+
__scopePopover?: import("@radix-ui/react-context").Scope;
|
|
35
|
+
}): React.JSX.Element;
|
|
36
|
+
displayName: string;
|
|
37
|
+
};
|
|
38
|
+
Content: React.ForwardRefExoticComponent<Omit<{
|
|
39
|
+
options: RefOption[];
|
|
40
|
+
selectedIds?: string[];
|
|
41
|
+
createOptionLabel?: [string, {
|
|
42
|
+
ns: string;
|
|
43
|
+
}];
|
|
44
|
+
createOptionIcon?: string;
|
|
45
|
+
createSchema?: Schema.Schema.AnyNoContext;
|
|
46
|
+
createInitialValuePath?: string;
|
|
47
|
+
createFieldMap?: FormFieldMap;
|
|
48
|
+
onCreate?: (values: any) => void;
|
|
49
|
+
onSelect: (id: string) => void;
|
|
50
|
+
}, "className"> & {
|
|
51
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
52
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=ObjectPicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectPicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectPicker/ObjectPicker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAgE,MAAM,OAAO,CAAC;AAErF,OAAO,EAAE,KAAK,OAAO,EAAW,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAK7F,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC;IACrD,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IAC1C,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,cAAc,CAAC,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,CAAC,CAAC;AAqJH,eAAO,MAAM,YAAY;;;;0BAjHb,CAAC;;;;;;;0BAiBH,CAAV;;;;;iBA9DW,SAAS,EAAE;sBACN,MAAM,EAAE;4BACF,CAAC,MAAM,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC;2BACzB,MAAM;uBACV,MAAM,CAAC,MAAM,CAAC,YAAY;iCAChB,MAAM;yBACd,YAAY;mBAClB,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI;kBACtB,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI;;;;CA4J/B,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
render: () => React.JSX.Element;
|
|
6
|
+
decorators: import("@storybook/react").Decorator[];
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
controls: {
|
|
10
|
+
disable: boolean;
|
|
11
|
+
};
|
|
12
|
+
translations: [{
|
|
13
|
+
readonly 'en-US': {
|
|
14
|
+
readonly "@dxos/react-ui-form": {
|
|
15
|
+
readonly 'fields.label': "Fields";
|
|
16
|
+
readonly 'hidden-fields.label': "Hidden Fields";
|
|
17
|
+
readonly 'empty-readonly-ref-field.label': "(none)";
|
|
18
|
+
readonly 'add-property-button.label': "Add property";
|
|
19
|
+
readonly 'field-property.label': "Property";
|
|
20
|
+
readonly 'field-property.placeholder': "Property name";
|
|
21
|
+
readonly 'field-format.label': "Type";
|
|
22
|
+
readonly 'field-path.label': "Field path";
|
|
23
|
+
readonly 'add-field.button': "Add field";
|
|
24
|
+
readonly 'boolean-input-true.value': "Yes";
|
|
25
|
+
readonly 'boolean-input-false.value': "No";
|
|
26
|
+
readonly 'show-field.label': "Show field";
|
|
27
|
+
readonly 'hide-field.label': "Hide field";
|
|
28
|
+
readonly 'delete-field.label': "Delete field";
|
|
29
|
+
readonly 'ref-field-combobox-input.placeholder': "Search…";
|
|
30
|
+
readonly 'ref-field.placeholder': "Select…";
|
|
31
|
+
readonly 'ref-field.placeholder_one': "Select…";
|
|
32
|
+
readonly 'ref-field.placeholder_other': "Select items…";
|
|
33
|
+
readonly 'create-option.label': "Create";
|
|
34
|
+
readonly 'example.placeholder': "Example";
|
|
35
|
+
readonly 'latitude.placeholder': "Latitude (e.g., 40.7128)";
|
|
36
|
+
readonly 'longitude.placeholder': "Longitude (e.g., -74.0060)";
|
|
37
|
+
readonly 'cancel-button.label': "Cancel";
|
|
38
|
+
readonly 'save-button.label': "Save";
|
|
39
|
+
readonly 'format.boolean.label': "Boolean";
|
|
40
|
+
readonly 'format.currency.label': "Currency";
|
|
41
|
+
readonly 'format.date.label': "Date";
|
|
42
|
+
readonly 'format.date-time.label': "DateTime";
|
|
43
|
+
readonly 'format.did.label': "DID";
|
|
44
|
+
readonly 'format.duration.label': "Duration";
|
|
45
|
+
readonly 'format.dxn.label': "DXN";
|
|
46
|
+
readonly 'format.email.label': "Email";
|
|
47
|
+
readonly 'format.formula.label': "Formula";
|
|
48
|
+
readonly 'format.hostname.label': "Hostname";
|
|
49
|
+
readonly 'format.integer.label': "Integer";
|
|
50
|
+
readonly 'format.json.label': "JSON";
|
|
51
|
+
readonly 'format.lnglat.label': "Geopoint";
|
|
52
|
+
readonly 'format.markdown.label': "Markdown";
|
|
53
|
+
readonly 'format.percent.label': "Percent";
|
|
54
|
+
readonly 'format.ref.label': "Reference";
|
|
55
|
+
readonly 'format.regex.label': "RegExp";
|
|
56
|
+
readonly 'format.string.label': "String";
|
|
57
|
+
readonly 'format.single-select.label': "Select";
|
|
58
|
+
readonly 'format.multi-select.label': "Multi-select";
|
|
59
|
+
readonly 'format.text.label': "Long text";
|
|
60
|
+
readonly 'format.time.label': "Time";
|
|
61
|
+
readonly 'format.timestamp.label': "Timestamp";
|
|
62
|
+
readonly 'format.user.label': "User";
|
|
63
|
+
readonly 'format.number.label': "Number";
|
|
64
|
+
readonly 'format.uri.label': "URI";
|
|
65
|
+
readonly 'format.url.label': "URL";
|
|
66
|
+
readonly 'format.uuid.label': "UUID";
|
|
67
|
+
readonly 'latitude.label': "Latitude";
|
|
68
|
+
readonly 'longitude.label': "Longitude";
|
|
69
|
+
readonly 'select-option.label': "Label";
|
|
70
|
+
readonly 'select-option-label.placeholder': "Option label";
|
|
71
|
+
readonly 'select-option-delete.button': "Delete";
|
|
72
|
+
readonly 'select-option-add.button': "Add option";
|
|
73
|
+
readonly 'system-schema.title': "System type";
|
|
74
|
+
readonly 'system-schema.description': "System type: cannot add or remove fields.";
|
|
75
|
+
readonly 'remove.button': "Remove";
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
}];
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
export default meta;
|
|
82
|
+
type Story = StoryObj<typeof meta>;
|
|
83
|
+
export declare const Default: Story;
|
|
84
|
+
export declare const WithTest: Story;
|
|
85
|
+
//# sourceMappingURL=ObjectPicker.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectPicker.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectPicker/ObjectPicker.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAoD,MAAM,OAAO,CAAC;AA4FzE,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgB2B,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,KAuFtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectPicker/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
|
+
import { type Label, type ThemedClassName } from '@dxos/react-ui';
|
|
3
|
+
type SettingsRootProps = ThemedClassName<PropsWithChildren>;
|
|
4
|
+
type SettingsSectionProps = PropsWithChildren<{
|
|
5
|
+
title: Label;
|
|
6
|
+
description?: Label;
|
|
7
|
+
}>;
|
|
8
|
+
type SettingsPanelProps = ThemedClassName<PropsWithChildren>;
|
|
9
|
+
type SettingsItemProps = PropsWithChildren<{
|
|
10
|
+
title: Label;
|
|
11
|
+
description?: Label;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const Settings: {
|
|
14
|
+
Root: {
|
|
15
|
+
({ children, classNames }: SettingsRootProps): React.JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
Viewport: React.ForwardRefExoticComponent<Omit<{}, "className"> & {
|
|
19
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
20
|
+
} & {
|
|
21
|
+
className?: string;
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
role?: string;
|
|
24
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
Section: {
|
|
26
|
+
({ title, description, children }: SettingsSectionProps): React.JSX.Element;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
29
|
+
Panel: {
|
|
30
|
+
({ classNames, children }: SettingsPanelProps): React.JSX.Element;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
33
|
+
Item: {
|
|
34
|
+
({ title, description, children }: SettingsItemProps): React.JSX.Element;
|
|
35
|
+
displayName: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=Settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Settings.d.ts","sourceRoot":"","sources":["../../../../../src/components/Settings/Settings.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAS,KAAK,KAAK,EAAc,KAAK,eAAe,EAAqC,MAAM,gBAAgB,CAAC;AAexH,KAAK,iBAAiB,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;AA8B5D,KAAK,oBAAoB,GAAG,iBAAiB,CAAC;IAC5C,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,CAAC,CAAC;AAmBH,KAAK,kBAAkB,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;AAgB7D,KAAK,iBAAiB,GAAG,iBAAiB,CAAC;IACzC,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,CAAC,CAAC;AA8BH,eAAO,MAAM,QAAQ;;mCAnG2B,iBAAiB;;;;;;;;;;;2CAiCN,oBAAoB;;;;mCAmB9B,kBAAkB;;;;2CAmBN,iBAAiB;;;CAkC7E,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
render: () => React.JSX.Element;
|
|
6
|
+
decorators: import("@storybook/react").Decorator[];
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
translations: [{
|
|
10
|
+
readonly 'en-US': {
|
|
11
|
+
readonly "@dxos/react-ui-form": {
|
|
12
|
+
readonly 'fields.label': "Fields";
|
|
13
|
+
readonly 'hidden-fields.label': "Hidden Fields";
|
|
14
|
+
readonly 'empty-readonly-ref-field.label': "(none)";
|
|
15
|
+
readonly 'add-property-button.label': "Add property";
|
|
16
|
+
readonly 'field-property.label': "Property";
|
|
17
|
+
readonly 'field-property.placeholder': "Property name";
|
|
18
|
+
readonly 'field-format.label': "Type";
|
|
19
|
+
readonly 'field-path.label': "Field path";
|
|
20
|
+
readonly 'add-field.button': "Add field";
|
|
21
|
+
readonly 'boolean-input-true.value': "Yes";
|
|
22
|
+
readonly 'boolean-input-false.value': "No";
|
|
23
|
+
readonly 'show-field.label': "Show field";
|
|
24
|
+
readonly 'hide-field.label': "Hide field";
|
|
25
|
+
readonly 'delete-field.label': "Delete field";
|
|
26
|
+
readonly 'ref-field-combobox-input.placeholder': "Search…";
|
|
27
|
+
readonly 'ref-field.placeholder': "Select…";
|
|
28
|
+
readonly 'ref-field.placeholder_one': "Select…";
|
|
29
|
+
readonly 'ref-field.placeholder_other': "Select items…";
|
|
30
|
+
readonly 'create-option.label': "Create";
|
|
31
|
+
readonly 'example.placeholder': "Example";
|
|
32
|
+
readonly 'latitude.placeholder': "Latitude (e.g., 40.7128)";
|
|
33
|
+
readonly 'longitude.placeholder': "Longitude (e.g., -74.0060)";
|
|
34
|
+
readonly 'cancel-button.label': "Cancel";
|
|
35
|
+
readonly 'save-button.label': "Save";
|
|
36
|
+
readonly 'format.boolean.label': "Boolean";
|
|
37
|
+
readonly 'format.currency.label': "Currency";
|
|
38
|
+
readonly 'format.date.label': "Date";
|
|
39
|
+
readonly 'format.date-time.label': "DateTime";
|
|
40
|
+
readonly 'format.did.label': "DID";
|
|
41
|
+
readonly 'format.duration.label': "Duration";
|
|
42
|
+
readonly 'format.dxn.label': "DXN";
|
|
43
|
+
readonly 'format.email.label': "Email";
|
|
44
|
+
readonly 'format.formula.label': "Formula";
|
|
45
|
+
readonly 'format.hostname.label': "Hostname";
|
|
46
|
+
readonly 'format.integer.label': "Integer";
|
|
47
|
+
readonly 'format.json.label': "JSON";
|
|
48
|
+
readonly 'format.lnglat.label': "Geopoint";
|
|
49
|
+
readonly 'format.markdown.label': "Markdown";
|
|
50
|
+
readonly 'format.percent.label': "Percent";
|
|
51
|
+
readonly 'format.ref.label': "Reference";
|
|
52
|
+
readonly 'format.regex.label': "RegExp";
|
|
53
|
+
readonly 'format.string.label': "String";
|
|
54
|
+
readonly 'format.single-select.label': "Select";
|
|
55
|
+
readonly 'format.multi-select.label': "Multi-select";
|
|
56
|
+
readonly 'format.text.label': "Long text";
|
|
57
|
+
readonly 'format.time.label': "Time";
|
|
58
|
+
readonly 'format.timestamp.label': "Timestamp";
|
|
59
|
+
readonly 'format.user.label': "User";
|
|
60
|
+
readonly 'format.number.label': "Number";
|
|
61
|
+
readonly 'format.uri.label': "URI";
|
|
62
|
+
readonly 'format.url.label': "URL";
|
|
63
|
+
readonly 'format.uuid.label': "UUID";
|
|
64
|
+
readonly 'latitude.label': "Latitude";
|
|
65
|
+
readonly 'longitude.label': "Longitude";
|
|
66
|
+
readonly 'select-option.label': "Label";
|
|
67
|
+
readonly 'select-option-label.placeholder': "Option label";
|
|
68
|
+
readonly 'select-option-delete.button': "Delete";
|
|
69
|
+
readonly 'select-option-add.button': "Add option";
|
|
70
|
+
readonly 'system-schema.title': "System type";
|
|
71
|
+
readonly 'system-schema.description': "System type: cannot add or remove fields.";
|
|
72
|
+
readonly 'remove.button': "Remove";
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
}];
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export default meta;
|
|
79
|
+
type Story = StoryObj<typeof meta>;
|
|
80
|
+
export declare const Default: Story;
|
|
81
|
+
//# sourceMappingURL=Settings.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Settings.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Settings/Settings.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAoC1B,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQM,CAAC;AAEjB,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Settings/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC"}
|
|
@@ -1,20 +1,32 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { type SchemaRegistry } from '@dxos/echo
|
|
3
|
+
import { QueryAST, type SchemaRegistry } from '@dxos/echo';
|
|
4
|
+
import { View } from '@dxos/echo';
|
|
4
5
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
5
|
-
import { type
|
|
6
|
-
import {
|
|
6
|
+
import { type QueryFormProps } from '@dxos/react-ui-components';
|
|
7
|
+
import { ProjectionModel } from '@dxos/schema';
|
|
8
|
+
import { type FormRootProps } from '../Form';
|
|
7
9
|
export type ViewEditorProps = ThemedClassName<{
|
|
8
10
|
schema: Schema.Schema.AnyNoContext;
|
|
9
|
-
view:
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
view: View.View;
|
|
12
|
+
mode?: 'schema' | 'tag';
|
|
13
|
+
registry?: SchemaRegistry.SchemaRegistry;
|
|
12
14
|
showHeading?: boolean;
|
|
13
|
-
|
|
15
|
+
onQueryChanged?: (query: QueryAST.Query, target?: string) => void;
|
|
14
16
|
onDelete?: (fieldId: string) => void;
|
|
15
|
-
} & Pick<
|
|
17
|
+
} & Pick<QueryFormProps, 'types' | 'tags'> & Pick<FormRootProps<any>, 'readonly' | 'db'>>;
|
|
16
18
|
/**
|
|
17
19
|
* Schema-based object form.
|
|
18
20
|
*/
|
|
19
|
-
export declare const ViewEditor:
|
|
21
|
+
export declare const ViewEditor: React.ForwardRefExoticComponent<Omit<{
|
|
22
|
+
schema: Schema.Schema.AnyNoContext;
|
|
23
|
+
view: View.View;
|
|
24
|
+
mode?: "schema" | "tag";
|
|
25
|
+
registry?: SchemaRegistry.SchemaRegistry;
|
|
26
|
+
showHeading?: boolean;
|
|
27
|
+
onQueryChanged?: (query: QueryAST.Query, target?: string) => void;
|
|
28
|
+
onDelete?: (fieldId: string) => void;
|
|
29
|
+
} & Pick<QueryFormProps, "types" | "tags"> & Pick<FormRootProps<any>, "readonly" | "db">, "className"> & {
|
|
30
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
31
|
+
} & React.RefAttributes<ProjectionModel>>;
|
|
20
32
|
//# sourceMappingURL=ViewEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ViewEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAsF,MAAM,OAAO,CAAC;AAE3G,OAAO,EAA4C,QAAQ,EAAO,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAC1G,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAIlC,OAAO,EAA8B,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3E,OAAO,EAEL,eAAe,EAIhB,MAAM,cAAc,CAAC;AAKtB,OAAO,EAML,KAAK,aAAa,EACnB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,eAAe,GAAG,eAAe,CAC3C;IACE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IACnC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;IAChB,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IACxB,QAAQ,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAClE,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,MAAM,CAAC,GACxC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC,CAC9C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU;YAdX,MAAM,CAAC,MAAM,CAAC,YAAY;UAC5B,IAAI,CAAC,IAAI;WACR,QAAQ,GAAG,KAAK;eACZ,cAAc,CAAC,cAAc;kBAC1B,OAAO;qBACJ,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI;eACtD,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI;;;yCAyKvC,CAAC"}
|
|
@@ -1,17 +1,93 @@
|
|
|
1
|
-
import '@
|
|
2
|
-
import
|
|
3
|
-
import { type
|
|
4
|
-
import {
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type View } from '@dxos/echo';
|
|
4
|
+
import { type EchoSchema } from '@dxos/echo/internal';
|
|
5
|
+
import { type ProjectionModel } from '@dxos/schema';
|
|
5
6
|
import { type ViewEditorProps } from './ViewEditor';
|
|
6
7
|
export type ViewEditorDebugObjects = {
|
|
7
8
|
schema: EchoSchema;
|
|
8
|
-
view:
|
|
9
|
+
view: View.View;
|
|
9
10
|
projection: ProjectionModel;
|
|
10
11
|
};
|
|
11
|
-
type
|
|
12
|
-
declare const meta:
|
|
12
|
+
type DefaultStoryProps = Pick<ViewEditorProps, 'readonly' | 'mode'>;
|
|
13
|
+
declare const meta: {
|
|
14
|
+
title: string;
|
|
15
|
+
render: (props: DefaultStoryProps) => React.JSX.Element;
|
|
16
|
+
decorators: import("@storybook/react").Decorator[];
|
|
17
|
+
parameters: {
|
|
18
|
+
layout: string;
|
|
19
|
+
translations: [{
|
|
20
|
+
readonly 'en-US': {
|
|
21
|
+
readonly "@dxos/react-ui-form": {
|
|
22
|
+
readonly 'fields.label': "Fields";
|
|
23
|
+
readonly 'hidden-fields.label': "Hidden Fields";
|
|
24
|
+
readonly 'empty-readonly-ref-field.label': "(none)";
|
|
25
|
+
readonly 'add-property-button.label': "Add property";
|
|
26
|
+
readonly 'field-property.label': "Property";
|
|
27
|
+
readonly 'field-property.placeholder': "Property name";
|
|
28
|
+
readonly 'field-format.label': "Type";
|
|
29
|
+
readonly 'field-path.label': "Field path";
|
|
30
|
+
readonly 'add-field.button': "Add field";
|
|
31
|
+
readonly 'boolean-input-true.value': "Yes";
|
|
32
|
+
readonly 'boolean-input-false.value': "No";
|
|
33
|
+
readonly 'show-field.label': "Show field";
|
|
34
|
+
readonly 'hide-field.label': "Hide field";
|
|
35
|
+
readonly 'delete-field.label': "Delete field";
|
|
36
|
+
readonly 'ref-field-combobox-input.placeholder': "Search…";
|
|
37
|
+
readonly 'ref-field.placeholder': "Select…";
|
|
38
|
+
readonly 'ref-field.placeholder_one': "Select…";
|
|
39
|
+
readonly 'ref-field.placeholder_other': "Select items…";
|
|
40
|
+
readonly 'create-option.label': "Create";
|
|
41
|
+
readonly 'example.placeholder': "Example";
|
|
42
|
+
readonly 'latitude.placeholder': "Latitude (e.g., 40.7128)";
|
|
43
|
+
readonly 'longitude.placeholder': "Longitude (e.g., -74.0060)";
|
|
44
|
+
readonly 'cancel-button.label': "Cancel";
|
|
45
|
+
readonly 'save-button.label': "Save";
|
|
46
|
+
readonly 'format.boolean.label': "Boolean";
|
|
47
|
+
readonly 'format.currency.label': "Currency";
|
|
48
|
+
readonly 'format.date.label': "Date";
|
|
49
|
+
readonly 'format.date-time.label': "DateTime";
|
|
50
|
+
readonly 'format.did.label': "DID";
|
|
51
|
+
readonly 'format.duration.label': "Duration";
|
|
52
|
+
readonly 'format.dxn.label': "DXN";
|
|
53
|
+
readonly 'format.email.label': "Email";
|
|
54
|
+
readonly 'format.formula.label': "Formula";
|
|
55
|
+
readonly 'format.hostname.label': "Hostname";
|
|
56
|
+
readonly 'format.integer.label': "Integer";
|
|
57
|
+
readonly 'format.json.label': "JSON";
|
|
58
|
+
readonly 'format.lnglat.label': "Geopoint";
|
|
59
|
+
readonly 'format.markdown.label': "Markdown";
|
|
60
|
+
readonly 'format.percent.label': "Percent";
|
|
61
|
+
readonly 'format.ref.label': "Reference";
|
|
62
|
+
readonly 'format.regex.label': "RegExp";
|
|
63
|
+
readonly 'format.string.label': "String";
|
|
64
|
+
readonly 'format.single-select.label': "Select";
|
|
65
|
+
readonly 'format.multi-select.label': "Multi-select";
|
|
66
|
+
readonly 'format.text.label': "Long text";
|
|
67
|
+
readonly 'format.time.label': "Time";
|
|
68
|
+
readonly 'format.timestamp.label': "Timestamp";
|
|
69
|
+
readonly 'format.user.label': "User";
|
|
70
|
+
readonly 'format.number.label': "Number";
|
|
71
|
+
readonly 'format.uri.label': "URI";
|
|
72
|
+
readonly 'format.url.label': "URL";
|
|
73
|
+
readonly 'format.uuid.label': "UUID";
|
|
74
|
+
readonly 'latitude.label': "Latitude";
|
|
75
|
+
readonly 'longitude.label': "Longitude";
|
|
76
|
+
readonly 'select-option.label': "Label";
|
|
77
|
+
readonly 'select-option-label.placeholder': "Option label";
|
|
78
|
+
readonly 'select-option-delete.button': "Delete";
|
|
79
|
+
readonly 'select-option-add.button': "Add option";
|
|
80
|
+
readonly 'system-schema.title': "System type";
|
|
81
|
+
readonly 'system-schema.description': "System type: cannot add or remove fields.";
|
|
82
|
+
readonly 'remove.button': "Remove";
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
}];
|
|
86
|
+
};
|
|
87
|
+
};
|
|
13
88
|
export default meta;
|
|
14
|
-
type Story = StoryObj<
|
|
89
|
+
type Story = StoryObj<typeof meta>;
|
|
15
90
|
export declare const Default: Story;
|
|
16
91
|
export declare const Readonly: Story;
|
|
92
|
+
export declare const TagQueryMode: Story;
|
|
17
93
|
//# sourceMappingURL=ViewEditor.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"ViewEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAA4D,MAAM,OAAO,CAAC;AAGjF,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,KAAK,UAAU,EAAwB,MAAM,qBAAqB,CAAC;AAK5E,OAAO,EAAE,KAAK,eAAe,EAAmC,MAAM,cAAc,CAAC;AAMrF,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAWhE,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;IAChB,UAAU,EAAE,eAAe,CAAC;CAC7B,CAAC;AAEF,KAAK,iBAAiB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,MAAM,CAAC,CAAC;AA+HpE,QAAA,MAAM,IAAI;;oBA7HmB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiJT,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,KAItB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAI1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { type PropsWithChildren } from 'react';
|
|
2
2
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
3
|
-
|
|
3
|
+
type TestLayoutProps = ThemedClassName<PropsWithChildren<{
|
|
4
4
|
json?: any;
|
|
5
|
-
}
|
|
6
|
-
export declare const
|
|
5
|
+
}>>;
|
|
6
|
+
export declare const TestLayout: ({ classNames, children, json }: TestLayoutProps) => React.JSX.Element;
|
|
7
7
|
export declare const VIEW_EDITOR_DEBUG_SYMBOL: unique symbol;
|
|
8
8
|
export declare const FIELD_EDITOR_DEBUG_SYMBOL: unique symbol;
|
|
9
|
+
export {};
|
|
9
10
|
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/components/testing.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/components/testing.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAU,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAI9D,KAAK,eAAe,GAAG,eAAe,CAAC,iBAAiB,CAAC;IAAE,IAAI,CAAC,EAAE,GAAG,CAAA;CAAE,CAAC,CAAC,CAAC;AAE1E,eAAO,MAAM,UAAU,GAAI,gCAAgC,eAAe,sBAkBzE,CAAC;AAaF,eAAO,MAAM,wBAAwB,eAA4B,CAAC;AAClE,eAAO,MAAM,yBAAyB,eAA6B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type * as Schema from 'effect/Schema';
|
|
2
|
+
import type * as SchemaAST from 'effect/SchemaAST';
|
|
3
|
+
import { type AnyProperties } from '@dxos/echo/internal';
|
|
4
|
+
import { type JsonPath } from '@dxos/effect';
|
|
5
|
+
import { type ValidationError } from '@dxos/schema';
|
|
6
|
+
import { type MaybePromise } from '@dxos/util';
|
|
7
|
+
export type FormFieldStatus = {
|
|
8
|
+
status?: 'error';
|
|
9
|
+
error?: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Form properties.
|
|
13
|
+
*/
|
|
14
|
+
export interface FormHandlerProps<T extends AnyProperties> {
|
|
15
|
+
/**
|
|
16
|
+
* Effect schema (Type literal).
|
|
17
|
+
*/
|
|
18
|
+
schema?: Schema.Schema<T, any>;
|
|
19
|
+
/**
|
|
20
|
+
* Values for the form if controlled.
|
|
21
|
+
*/
|
|
22
|
+
values?: Partial<T>;
|
|
23
|
+
/**
|
|
24
|
+
* Default values for the form which will be used if values is not provided.
|
|
25
|
+
*/
|
|
26
|
+
defaultValues?: Partial<T>;
|
|
27
|
+
/**
|
|
28
|
+
* Auto-save the form when the values change.
|
|
29
|
+
*/
|
|
30
|
+
autoSave?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Callback for value changes. Note: This is called even when values are invalid.
|
|
33
|
+
* Sometimes the parent component may want to know about changes even if the form is
|
|
34
|
+
* in an invalid state.
|
|
35
|
+
*/
|
|
36
|
+
onValuesChanged?: (values: Partial<T>, meta: FormUpdateMeta<T>) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Custom validation function that runs only after schema validation passes.
|
|
39
|
+
* Use this for complex validation logic that can't be expressed in the schema.
|
|
40
|
+
* @returns Array of validation errors, or undefined if validation passes
|
|
41
|
+
*/
|
|
42
|
+
onValidate?: (values: T) => ValidationError[] | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Called when the form is submitted and passes validation.
|
|
45
|
+
*/
|
|
46
|
+
onSave?: (values: T, meta: FormUpdateMeta<T>) => MaybePromise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Called when the form is canceled.
|
|
49
|
+
*/
|
|
50
|
+
onCancel?: () => void;
|
|
51
|
+
}
|
|
52
|
+
export type FormUpdateMeta<T extends AnyProperties> = {
|
|
53
|
+
changed: FormHandler<T>['changed'];
|
|
54
|
+
isValid: boolean;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Form handler properties and methods.
|
|
58
|
+
*/
|
|
59
|
+
export type FormHandler<T extends AnyProperties> = Pick<FormHandlerProps<T>, 'schema' | 'autoSave'> & {
|
|
60
|
+
/** Initial values (which may not pass validation). */
|
|
61
|
+
values: Partial<T>;
|
|
62
|
+
/** Map of changed fields. */
|
|
63
|
+
changed: Record<JsonPath, boolean>;
|
|
64
|
+
touched: Record<JsonPath, boolean>;
|
|
65
|
+
/** Map of error strings. */
|
|
66
|
+
errors: Record<JsonPath, string>;
|
|
67
|
+
/** Whether the form can be saved (i.e., data is valid). */
|
|
68
|
+
isValid: boolean;
|
|
69
|
+
canSave: boolean;
|
|
70
|
+
onSave: () => void;
|
|
71
|
+
onCancel: () => void;
|
|
72
|
+
getStatus: (path: string | (string | number)[]) => FormFieldStatus;
|
|
73
|
+
getValue: <V>(path: (string | number)[]) => V | undefined;
|
|
74
|
+
onBlur: (path: (string | number)[]) => void;
|
|
75
|
+
onValueChange: <V>(path: (string | number)[], type: SchemaAST.AST, value: V) => void;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Creates a hook for managing form state, including values, validation, and submission.
|
|
79
|
+
* Deeply integrated with `@dxos/schema` for schema-based validation.
|
|
80
|
+
*/
|
|
81
|
+
export declare const useFormHandler: <T extends AnyProperties>({ schema, autoSave, values: valuesProp, defaultValues: defaultValuesProp, onValuesChanged, onValidate, onSave, onCancel, ...props }: FormHandlerProps<T>) => FormHandler<T>;
|
|
82
|
+
//# sourceMappingURL=useFormHandler.d.ts.map
|