@dxos/react-ui-form 0.8.1 → 0.8.2-main.10c050d
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 +1818 -1309
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +1774 -1273
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +1818 -1309
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/{ControlSection.d.ts → ControlSection/ControlSection.d.ts} +9 -6
- package/dist/types/src/components/ControlSection/ControlSection.d.ts.map +1 -0
- package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts +8 -0
- package/dist/types/src/components/ControlSection/ControlSection.stories.d.ts.map +1 -0
- package/dist/types/src/components/ControlSection/index.d.ts +2 -0
- package/dist/types/src/components/ControlSection/index.d.ts.map +1 -0
- package/dist/types/src/components/FieldEditor/FieldEditor.d.ts.map +1 -1
- package/dist/types/src/components/FieldEditor/FieldEditor.test.d.ts +2 -0
- package/dist/types/src/components/FieldEditor/FieldEditor.test.d.ts.map +1 -0
- package/dist/types/src/components/Form/ArrayField.d.ts.map +1 -1
- package/dist/types/src/components/Form/Defaults.d.ts +4 -4
- package/dist/types/src/components/Form/Defaults.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.d.ts +6 -4
- package/dist/types/src/components/Form/Form.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.stories.d.ts +38 -36
- package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/FormActions.d.ts +1 -1
- package/dist/types/src/components/Form/FormActions.d.ts.map +1 -1
- package/dist/types/src/components/Form/FormContent.d.ts +16 -12
- package/dist/types/src/components/Form/FormContent.d.ts.map +1 -1
- package/dist/types/src/components/Form/FormContext.d.ts +2 -2
- package/dist/types/src/components/Form/FormContext.d.ts.map +1 -1
- package/dist/types/src/components/Form/Input.d.ts.map +1 -1
- package/dist/types/src/components/Form/RefField.d.ts +12 -0
- package/dist/types/src/components/Form/RefField.d.ts.map +1 -0
- package/dist/types/src/components/Form/custom/GeoPointInput.d.ts.map +1 -1
- package/dist/types/src/components/Form/custom/SelectOptionsInput.d.ts.map +1 -1
- package/dist/types/src/components/Form/custom/SelectOptionsInput.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/custom/TupleInput.d.ts.map +1 -1
- package/dist/types/src/components/Form/factory.d.ts +1 -1
- package/dist/types/src/components/Form/factory.d.ts.map +1 -1
- package/dist/types/src/components/Form/index.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor/Test.stories.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +2 -2
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +5 -3
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/deprecated/Form.d.ts +2 -2
- package/dist/types/src/components/deprecated/Form.d.ts.map +1 -1
- package/dist/types/src/components/deprecated/Form.stories.d.ts.map +1 -1
- package/dist/types/src/components/deprecated/FormInput.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useForm.d.ts +2 -2
- package/dist/types/src/hooks/useForm.d.ts.map +1 -1
- package/dist/types/src/hooks/useQueryRefOptions.d.ts +23 -0
- package/dist/types/src/hooks/useQueryRefOptions.d.ts.map +1 -0
- package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts +8 -0
- package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +5 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/util/field.d.ts.map +1 -1
- package/dist/types/src/util/formatting.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +2 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/refs.d.ts +9 -0
- package/dist/types/src/util/refs.d.ts.map +1 -0
- package/dist/types/src/util/schema.d.ts +3 -0
- package/dist/types/src/util/schema.d.ts.map +1 -0
- package/dist/types/src/vitest-setup.d.ts +2 -0
- package/dist/types/src/vitest-setup.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +28 -25
- package/src/components/ControlSection/ControlSection.stories.tsx +29 -0
- package/src/components/{ControlSection.tsx → ControlSection/ControlSection.tsx} +40 -16
- package/src/components/ControlSection/index.ts +5 -0
- package/src/components/FieldEditor/FieldEditor.stories.tsx +1 -1
- package/src/components/FieldEditor/FieldEditor.test.tsx +49 -0
- package/src/components/FieldEditor/FieldEditor.tsx +3 -2
- package/src/components/Form/ArrayField.tsx +63 -50
- package/src/components/Form/Defaults.tsx +77 -48
- package/src/components/Form/Form.stories.tsx +134 -109
- package/src/components/Form/Form.tsx +8 -5
- package/src/components/Form/FormActions.tsx +15 -18
- package/src/components/Form/FormContent.tsx +116 -46
- package/src/components/Form/FormContext.tsx +24 -10
- package/src/components/Form/Input.tsx +4 -10
- package/src/components/Form/RefField.tsx +217 -0
- package/src/components/Form/custom/GeoPointInput.tsx +2 -2
- package/src/components/Form/custom/SelectOptionsInput.stories.tsx +6 -5
- package/src/components/Form/custom/SelectOptionsInput.tsx +2 -2
- package/src/components/Form/factory.tsx +1 -1
- package/src/components/Form/index.ts +0 -1
- package/src/components/ViewEditor/ViewEditor.stories.tsx +19 -9
- package/src/components/ViewEditor/ViewEditor.tsx +65 -35
- package/src/components/deprecated/Form.stories.tsx +6 -6
- package/src/components/deprecated/Form.tsx +6 -6
- package/src/components/deprecated/FormInput.tsx +1 -1
- package/src/components/index.ts +1 -0
- package/src/components/testing.tsx +5 -9
- package/src/hooks/index.ts +3 -1
- package/src/hooks/useForm.ts +4 -3
- package/src/hooks/useQueryRefOptions.ts +53 -0
- package/src/hooks/useRefQueryLookupHandler.ts +39 -0
- package/src/translations.ts +9 -2
- package/src/util/formatting.ts +15 -3
- package/src/util/index.ts +3 -1
- package/src/util/refs.ts +38 -0
- package/src/util/schema.ts +14 -0
- package/src/vitest-setup.ts +11 -0
- package/dist/types/src/components/ControlSection.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefField.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/RefField.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAgD,MAAM,OAAO,CAAC;AAkBrE,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,aAAa,CAAC;AAGvE,KAAK,aAAa,GAAG,UAAU,GAAG;IAChC,GAAG,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,iBAAiB,CAAC,EAAE,eAAe,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,sIAatB,aAAa,6BA2Hf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeoPointInput.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/custom/GeoPointInput.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"GeoPointInput.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/custom/GeoPointInput.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAO3F,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAExD,eAAO,MAAM,aAAa,GAAI,uEAAuE,UAAU,sBA4D9G,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectOptionsInput.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/custom/SelectOptionsInput.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"SelectOptionsInput.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/custom/SelectOptionsInput.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyF,MAAM,OAAO,CAAC;AAU9G,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAGxD,eAAO,MAAM,iBAAiB,GAAI,+DAA+D,UAAU,sBAgL1G,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectOptionsInput.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/custom/SelectOptionsInput.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectOptionsInput.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/custom/SelectOptionsInput.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAwC5D,QAAA,MAAM,IAAI,EAAE,IAKX,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAEtB,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC"}
|
|
@@ -1 +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,
|
|
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,GAAI,iFASxB,UAAU,GAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,sBAyBpC,CAAC"}
|
|
@@ -4,5 +4,5 @@ import { type InputComponent } from './Input';
|
|
|
4
4
|
/**
|
|
5
5
|
* Get property input component.
|
|
6
6
|
*/
|
|
7
|
-
export declare const getInputComponent: (type: SimpleType, format?: FormatEnum) => InputComponent | undefined;
|
|
7
|
+
export declare const getInputComponent: (type: SimpleType, format?: FormatEnum | string) => 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,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,
|
|
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,GAAI,MAAM,UAAU,EAAE,SAAS,UAAU,GAAG,MAAM,KAAG,cAAc,GAAG,SAgBnG,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;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Test.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/Test.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"Test.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/Test.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,aAAa,SAAS,sBAI1C,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,SAAS,CAUvC,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAIX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { type SchemaRegistry } from '@dxos/echo-db';
|
|
3
|
-
import { type BaseSchema } 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: Schema.Schema.AnyNoContext;
|
|
8
8
|
view: ViewType;
|
|
9
9
|
registry?: SchemaRegistry;
|
|
10
10
|
readonly?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"ViewEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewEditor/ViewEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,EAA6B,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAGjG,OAAO,EAA+B,KAAK,QAAQ,EAAoC,MAAM,cAAc,CAAC;AAmB5G,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC;IAC5C,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IACnC,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,CAAC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,6FASxB,eAAe,sBAmOjB,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import '@dxos-theme';
|
|
2
2
|
import { type Meta, type StoryObj } from '@storybook/react';
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { type ViewEditorProps } from './ViewEditor';
|
|
4
|
+
type StoryProps = Pick<ViewEditorProps, 'readonly'>;
|
|
5
|
+
declare const meta: Meta<StoryProps>;
|
|
5
6
|
export default meta;
|
|
6
|
-
type Story = StoryObj
|
|
7
|
+
type Story = StoryObj<StoryProps>;
|
|
7
8
|
export declare const Default: Story;
|
|
9
|
+
export declare const Readonly: Story;
|
|
8
10
|
//# 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,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;AAW5D,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAIhE,KAAK,UAAU,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;AA+DpD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAAU,CAO1B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;AAElC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,KAItB,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type Schema
|
|
1
|
+
import { type Schema } from 'effect';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
4
4
|
import { type ViewType } from '@dxos/schema';
|
|
5
5
|
export type DeprecatedFormProps<T extends {} = {}> = ThemedClassName<{
|
|
6
6
|
view: ViewType;
|
|
7
7
|
object: T;
|
|
8
|
-
schema?:
|
|
8
|
+
schema?: Schema.Schema<T>;
|
|
9
9
|
readonly?: boolean;
|
|
10
10
|
}>;
|
|
11
11
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../src/components/deprecated/Form.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../src/components/deprecated/Form.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,MAAM,EAAgB,MAAM,QAAQ,CAAC;AAC9D,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAS,KAAK,eAAe,EAA+C,MAAM,gBAAgB,CAAC;AAE1G,OAAO,EAAE,KAAK,QAAQ,EAAgC,MAAM,cAAc,CAAC;AAE3E,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,eAAe,CAAC;IACnE,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,CAAC,CAAC;IACV,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,iDAM/C,mBAAmB,CAAC,CAAC,CAAC,sBA0DxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/deprecated/Form.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAkC,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGrF,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAIlE,QAAA,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"Form.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/deprecated/Form.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAkC,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGrF,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAIlE,QAAA,MAAM,YAAY,GAAI,OAAO,mBAAmB,sBAM/C,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAQnC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAErD,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAOtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/deprecated/FormInput.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,GAAG,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAS,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAG7D;;GAEG;AACH,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"FormInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/deprecated/FormInput.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,GAAG,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAS,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAG7D;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,0BAA0B,eAAe,CAAC,iBAAiB,CAAC,gBAQnG,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,8CAKjC,iBAAiB,CAAC,wBAAwB,CAAC,gBAkC7C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAE7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC"}
|
|
@@ -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,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAItD,eAAO,MAAM,SAAS,
|
|
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,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAItD,eAAO,MAAM,SAAS,GAAI,0BAA0B,eAAe,CAAC,iBAAiB,CAAC,sBAErF,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,gCAAgC,eAAe,CAAC,iBAAiB,CAAC;IAAE,IAAI,CAAC,EAAE,GAAG,CAAA;CAAE,CAAC,CAAC,sBAK5G,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Schema
|
|
1
|
+
import { type Schema } from 'effect';
|
|
2
2
|
import { type BaseObject } from '@dxos/echo-schema';
|
|
3
3
|
import { type SimpleType, type JsonPath } from '@dxos/effect';
|
|
4
4
|
import { type ValidationError } from '@dxos/schema';
|
|
@@ -29,7 +29,7 @@ export interface FormOptions<T extends BaseObject> {
|
|
|
29
29
|
/**
|
|
30
30
|
* Effect schema (Type literal).
|
|
31
31
|
*/
|
|
32
|
-
schema:
|
|
32
|
+
schema: Schema.Schema<T, any>;
|
|
33
33
|
/**
|
|
34
34
|
* Initial values (which may not pass validation).
|
|
35
35
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useForm.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useForm.ts"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhD,OAAO,EAAE,KAAK,UAAU,EAAsB,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAA4C,MAAM,cAAc,CAAC;AAGxG,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,WAAW,EAAE,OAAO,CAAC;IACrB,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,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAE9B;;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,EAAE,0EAO3C,WAAW,CAAC,CAAC,CAAC,KAAG,WAAW,CAAC,CAAC,CAoLhC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type TypeAnnotation } from '@dxos/echo-schema';
|
|
2
|
+
import { type DXN } from '@dxos/keys';
|
|
3
|
+
import { type TagPickerItemData } from '@dxos/react-ui-tag-picker';
|
|
4
|
+
import { type MaybePromise } from '@dxos/util';
|
|
5
|
+
export type RefOption = {
|
|
6
|
+
dxn: DXN;
|
|
7
|
+
label?: string;
|
|
8
|
+
};
|
|
9
|
+
export type QueryRefOptions = (type: TypeAnnotation) => MaybePromise<RefOption[]>;
|
|
10
|
+
type UseQueryRefOptionsProps = {
|
|
11
|
+
refTypeInfo: TypeAnnotation | undefined;
|
|
12
|
+
onQueryRefOptions?: QueryRefOptions;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Hook to query reference options based on type information.
|
|
16
|
+
* Used internally within forms to fetch and format reference options for reference fields.
|
|
17
|
+
*/
|
|
18
|
+
export declare const useQueryRefOptions: ({ refTypeInfo, onQueryRefOptions }: UseQueryRefOptionsProps) => {
|
|
19
|
+
options: TagPickerItemData[];
|
|
20
|
+
loading: boolean;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=useQueryRefOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useQueryRefOptions.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useQueryRefOptions.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,MAAM,SAAS,GAAG;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACrD,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,cAAc,KAAK,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC;AAElF,KAAK,uBAAuB,GAAG;IAAE,WAAW,EAAE,cAAc,GAAG,SAAS,CAAC;IAAC,iBAAiB,CAAC,EAAE,eAAe,CAAA;CAAE,CAAC;AAEhH;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,oCAAoC,uBAAuB;;;CA+B7F,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
2
|
+
import { type QueryRefOptions } from './useQueryRefOptions';
|
|
3
|
+
type UseRefQueryLookupProps = {
|
|
4
|
+
space?: Space;
|
|
5
|
+
};
|
|
6
|
+
export declare const useRefQueryLookupHandler: ({ space }: UseRefQueryLookupProps) => QueryRefOptions;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=useRefQueryLookupHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRefQueryLookupHandler.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useRefQueryLookupHandler.ts"],"names":[],"mappings":"AAOA,OAAO,EAAU,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,KAAK,sBAAsB,GAAG;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAEhD,eAAO,MAAM,wBAAwB,GAAI,WAAW,sBAAsB,KAAG,eAwB5E,CAAC"}
|
|
@@ -4,6 +4,7 @@ declare const _default: {
|
|
|
4
4
|
"react-ui-form": {
|
|
5
5
|
'fields label': string;
|
|
6
6
|
'hidden fields label': string;
|
|
7
|
+
'empty readonly ref field label': string;
|
|
7
8
|
'button add property': string;
|
|
8
9
|
'field property label': string;
|
|
9
10
|
'field property placeholder': string;
|
|
@@ -12,6 +13,8 @@ declare const _default: {
|
|
|
12
13
|
'add field': string;
|
|
13
14
|
'delete field': string;
|
|
14
15
|
'field limit reached': string;
|
|
16
|
+
'boolean input true value': string;
|
|
17
|
+
'boolean input false value': string;
|
|
15
18
|
'button cancel': string;
|
|
16
19
|
'button save': string;
|
|
17
20
|
'format boolean': string;
|
|
@@ -46,6 +49,8 @@ declare const _default: {
|
|
|
46
49
|
'select option color': string;
|
|
47
50
|
'select option delete': string;
|
|
48
51
|
'select option add': string;
|
|
52
|
+
'system schema title': string;
|
|
53
|
+
'system schema description': string;
|
|
49
54
|
};
|
|
50
55
|
};
|
|
51
56
|
}[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,kBAAkB,CAAC
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,kBAAkB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9C,wBAoEE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../src/util/field.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAe,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtE,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,UAAU,CAAC;IACpB,KAAK,EAAE,GAAG,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../src/util/field.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAe,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtE,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,UAAU,CAAC;IACpB,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,UAAU,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,kBAAkB,4BAA4B,KAAG,MAAM,EAAE,GAAG,SAmCnG,CAAC;AAGF,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,eAGhD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../src/util/formatting.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAe,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEtE,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAChC,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF;;;GAGG;AAGH,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../src/util/formatting.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAe,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEtE,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAChC,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"}
|
|
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,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type SchemaAST } from 'effect';
|
|
2
|
+
import { type SchemaProperty } from '@dxos/schema';
|
|
3
|
+
type RefProps = {
|
|
4
|
+
ast: SchemaAST.AST;
|
|
5
|
+
isArray: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const getRefProps: (property: SchemaProperty<any>) => RefProps | undefined;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=refs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refs.d.ts","sourceRoot":"","sources":["../../../../src/util/refs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAIxC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAInD,KAAK,QAAQ,GAAG;IACd,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,UAAU,cAAc,CAAC,GAAG,CAAC,KAAG,QAAQ,GAAG,SAoBtE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/util/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAInC,eAAO,MAAM,oBAAoB,GAAI,KAAK,SAAS,CAAC,GAAG,8BAKtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest-setup.d.ts","sourceRoot":"","sources":["../../../src/vitest-setup.ts"],"names":[],"mappings":"AAKA,OAAO,kCAAkC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.
|
|
1
|
+
{"version":"5.8.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-form",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2-main.10c050d",
|
|
4
4
|
"description": "Data components.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -25,49 +25,52 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@atlaskit/pragmatic-drag-and-drop": "^1.4.0",
|
|
27
27
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.3",
|
|
28
|
+
"@preact-signals/safe-react": "^0.9.0",
|
|
28
29
|
"@radix-ui/react-context": "1.1.1",
|
|
29
30
|
"date-fns": "^3.3.1",
|
|
30
31
|
"jsonpath": "^1.1.1",
|
|
31
|
-
"@dxos/async": "0.8.
|
|
32
|
-
"@dxos/
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/echo-schema": "0.8.
|
|
35
|
-
"@dxos/effect": "0.8.
|
|
36
|
-
"@dxos/invariant": "0.8.
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/react-
|
|
41
|
-
"@dxos/react-
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/react-ui-
|
|
45
|
-
"@dxos/util": "0.8.
|
|
32
|
+
"@dxos/async": "0.8.2-main.10c050d",
|
|
33
|
+
"@dxos/debug": "0.8.2-main.10c050d",
|
|
34
|
+
"@dxos/echo-db": "0.8.2-main.10c050d",
|
|
35
|
+
"@dxos/echo-schema": "0.8.2-main.10c050d",
|
|
36
|
+
"@dxos/effect": "0.8.2-main.10c050d",
|
|
37
|
+
"@dxos/invariant": "0.8.2-main.10c050d",
|
|
38
|
+
"@dxos/keys": "0.8.2-main.10c050d",
|
|
39
|
+
"@dxos/lit-ui": "0.8.2-main.10c050d",
|
|
40
|
+
"@dxos/live-object": "0.8.2-main.10c050d",
|
|
41
|
+
"@dxos/react-ui-list": "0.8.2-main.10c050d",
|
|
42
|
+
"@dxos/react-client": "0.8.2-main.10c050d",
|
|
43
|
+
"@dxos/log": "0.8.2-main.10c050d",
|
|
44
|
+
"@dxos/react-ui-pickers": "0.8.2-main.10c050d",
|
|
45
|
+
"@dxos/react-ui-types": "0.8.2-main.10c050d",
|
|
46
|
+
"@dxos/util": "0.8.2-main.10c050d",
|
|
47
|
+
"@dxos/schema": "0.8.2-main.10c050d",
|
|
48
|
+
"@dxos/react-ui-tag-picker": "0.8.2-main.10c050d"
|
|
46
49
|
},
|
|
47
50
|
"devDependencies": {
|
|
48
51
|
"@phosphor-icons/react": "^2.1.5",
|
|
49
52
|
"@types/jsonpath": "^0.2.4",
|
|
50
53
|
"@types/react": "~18.2.0",
|
|
51
54
|
"@types/react-dom": "~18.2.0",
|
|
52
|
-
"effect": "3.
|
|
55
|
+
"effect": "3.14.21",
|
|
53
56
|
"fast-check": "^3.19.0",
|
|
54
57
|
"react": "~18.2.0",
|
|
55
58
|
"react-dom": "~18.2.0",
|
|
56
59
|
"vite": "5.4.7",
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/react-ui": "0.8.
|
|
61
|
-
"@dxos/react-ui-theme": "0.8.
|
|
62
|
-
"@dxos/storybook-utils": "0.8.
|
|
60
|
+
"@dxos/echo-signals": "0.8.2-main.10c050d",
|
|
61
|
+
"@dxos/random": "0.8.2-main.10c050d",
|
|
62
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.2-main.10c050d",
|
|
63
|
+
"@dxos/react-ui": "0.8.2-main.10c050d",
|
|
64
|
+
"@dxos/react-ui-theme": "0.8.2-main.10c050d",
|
|
65
|
+
"@dxos/storybook-utils": "0.8.2-main.10c050d"
|
|
63
66
|
},
|
|
64
67
|
"peerDependencies": {
|
|
65
68
|
"@phosphor-icons/react": "^2.1.5",
|
|
66
69
|
"effect": "3.13.3",
|
|
67
70
|
"react": "~18.2.0",
|
|
68
71
|
"react-dom": "~18.2.0",
|
|
69
|
-
"@dxos/react-ui": "0.8.
|
|
70
|
-
"@dxos/react-ui
|
|
72
|
+
"@dxos/react-ui-theme": "0.8.2-main.10c050d",
|
|
73
|
+
"@dxos/react-ui": "0.8.2-main.10c050d"
|
|
71
74
|
},
|
|
72
75
|
"publishConfig": {
|
|
73
76
|
"access": "public"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
8
|
+
|
|
9
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
10
|
+
|
|
11
|
+
import { ControlSection, type ControlSectionProps } from './ControlSection';
|
|
12
|
+
import translations from '../../translations';
|
|
13
|
+
|
|
14
|
+
const meta: Meta<ControlSectionProps> = {
|
|
15
|
+
title: 'ui/react-ui-form/ControlSection',
|
|
16
|
+
component: ControlSection,
|
|
17
|
+
decorators: [withLayout(), withTheme],
|
|
18
|
+
parameters: {
|
|
19
|
+
translations,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
|
|
25
|
+
type Story = StoryObj<ControlSectionProps>;
|
|
26
|
+
|
|
27
|
+
export const Default: Story = {
|
|
28
|
+
args: {},
|
|
29
|
+
};
|
|
@@ -2,19 +2,45 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { type PropsWithChildren } from 'react';
|
|
5
|
+
import React, { type ComponentPropsWithoutRef, type PropsWithChildren } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
Button,
|
|
9
|
+
type ButtonProps,
|
|
10
|
+
type Label,
|
|
11
|
+
Input,
|
|
12
|
+
type ThemedClassName,
|
|
13
|
+
toLocalizedString,
|
|
14
|
+
useTranslation,
|
|
15
|
+
} from '@dxos/react-ui';
|
|
16
|
+
import { mx } from '@dxos/react-ui-theme';
|
|
8
17
|
|
|
9
|
-
import { translationKey } from '
|
|
18
|
+
import { translationKey } from '../../translations';
|
|
10
19
|
|
|
11
|
-
|
|
20
|
+
export type ControlPageProps = ThemedClassName<ComponentPropsWithoutRef<'div'>>;
|
|
21
|
+
|
|
22
|
+
export const ControlPage = ({ children, classNames, ...props }: ControlPageProps) => {
|
|
23
|
+
return (
|
|
24
|
+
<div role='none' className={mx('pli-2', classNames)} {...props}>
|
|
25
|
+
{children}
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
12
29
|
|
|
13
30
|
export type ControlSectionProps = PropsWithChildren<{
|
|
14
31
|
title: Label;
|
|
15
32
|
description?: Label;
|
|
16
33
|
}>;
|
|
17
34
|
|
|
35
|
+
export const ControlSection = ({ title, description, children }: ControlSectionProps) => {
|
|
36
|
+
return (
|
|
37
|
+
<>
|
|
38
|
+
<ControlSectionHeading title={title} description={description} />
|
|
39
|
+
{children}
|
|
40
|
+
</>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
18
44
|
export const ControlSectionHeading = ({ title, description }: Omit<ControlSectionProps, 'children'>) => {
|
|
19
45
|
const { t } = useTranslation(translationKey);
|
|
20
46
|
return (
|
|
@@ -27,19 +53,17 @@ export const ControlSectionHeading = ({ title, description }: Omit<ControlSectio
|
|
|
27
53
|
);
|
|
28
54
|
};
|
|
29
55
|
|
|
30
|
-
export const
|
|
31
|
-
return
|
|
32
|
-
<>
|
|
33
|
-
<ControlSectionHeading title={title} description={description} />
|
|
34
|
-
{children}
|
|
35
|
-
</>
|
|
36
|
-
);
|
|
56
|
+
export const ControlGroupButton = ({ classNames, ...props }: ButtonProps) => {
|
|
57
|
+
return <Button {...props} classNames={['md:col-span-2', classNames]} />;
|
|
37
58
|
};
|
|
38
59
|
|
|
39
|
-
export type ControlGroupProps = PropsWithChildren<{}
|
|
60
|
+
export type ControlGroupProps = ThemedClassName<PropsWithChildren<{}>>;
|
|
40
61
|
|
|
41
|
-
export const ControlGroup = ({ children }: ControlGroupProps) => (
|
|
42
|
-
<div
|
|
62
|
+
export const ControlGroup = ({ children, classNames }: ControlGroupProps) => (
|
|
63
|
+
<div
|
|
64
|
+
role='none'
|
|
65
|
+
className={mx('group container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content] gap-4', classNames)}
|
|
66
|
+
>
|
|
43
67
|
{children}
|
|
44
68
|
</div>
|
|
45
69
|
);
|
|
@@ -59,9 +83,9 @@ export type ControlItemProps = PropsWithChildren<{
|
|
|
59
83
|
}>;
|
|
60
84
|
|
|
61
85
|
export const controlItemClasses =
|
|
62
|
-
'p-4 border border-separator rounded-lg container-max-width grid md:col-span-2 grid-cols-subgrid items-center';
|
|
86
|
+
'p-4 border border-separator rounded-lg container-max-width grid md:col-span-2 grid-cols-subgrid items-center gap-2';
|
|
63
87
|
|
|
64
|
-
const controlItemTitleClasses = 'text-lg font-normal
|
|
88
|
+
const controlItemTitleClasses = 'text-lg font-normal';
|
|
65
89
|
const controlItemDescriptionClasses = 'text-base mlb-2 md:mbe-0 text-description';
|
|
66
90
|
|
|
67
91
|
export const ControlItem = ({ title, description, children }: ControlItemProps) => {
|
|
@@ -37,7 +37,7 @@ const meta: Meta<StoryProps> = {
|
|
|
37
37
|
title: 'ui/react-ui-form/FieldEditor',
|
|
38
38
|
component: FieldEditor,
|
|
39
39
|
render: DefaultStory,
|
|
40
|
-
decorators: [withLayout({ fullscreen: true
|
|
40
|
+
decorators: [withLayout({ fullscreen: true }), withTheme],
|
|
41
41
|
parameters: {
|
|
42
42
|
translations,
|
|
43
43
|
},
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { composeStories } from '@storybook/react';
|
|
6
|
+
import { screen, cleanup, fireEvent, act } from '@testing-library/react';
|
|
7
|
+
import { afterEach, describe, expect, test } from 'vitest';
|
|
8
|
+
|
|
9
|
+
import * as stories from './FieldEditor.stories';
|
|
10
|
+
|
|
11
|
+
const { Default } = composeStories(stories);
|
|
12
|
+
|
|
13
|
+
describe('FieldEditor', () => {
|
|
14
|
+
afterEach(() => {
|
|
15
|
+
cleanup();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('update field type', async () => {
|
|
19
|
+
await Default.run();
|
|
20
|
+
|
|
21
|
+
expect(screen.getByText('Type format')).toBeInTheDocument();
|
|
22
|
+
expect(screen.getByText('String')).toBeInTheDocument();
|
|
23
|
+
|
|
24
|
+
{
|
|
25
|
+
const debug = JSON.parse(screen.getByTestId('debug').textContent!);
|
|
26
|
+
const name = debug.props.projection._schema.properties.name;
|
|
27
|
+
expect(name.type).toBe('string');
|
|
28
|
+
expect(name.description).toBe('Full name.');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
fireEvent.click(screen.getByRole('combobox'));
|
|
32
|
+
const options = screen.getAllByRole('option');
|
|
33
|
+
const option = options.find((option) => option.textContent === 'Number');
|
|
34
|
+
fireEvent.click(option!);
|
|
35
|
+
expect(screen.getByText('Number')).toBeInTheDocument();
|
|
36
|
+
|
|
37
|
+
await act(async () => {
|
|
38
|
+
fireEvent.click(screen.getByTestId('save-button'));
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
{
|
|
42
|
+
const debug = JSON.parse(screen.getByTestId('debug').textContent!);
|
|
43
|
+
const name = debug.props.projection._schema.properties.name;
|
|
44
|
+
expect(name.type).toBe('number');
|
|
45
|
+
expect(name.format).toBe('number');
|
|
46
|
+
expect(name.description).toBe('Full name.');
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|