@dxos/react-ui-form 0.8.4-main.c4373fc → 0.8.4-main.d05539e30a
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/LICENSE +102 -5
- package/README.md +0 -1
- package/dist/lib/browser/index.mjs +2747 -2324
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/translations.mjs +82 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +2747 -2324
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/translations.mjs +84 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- 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 +68 -60
- package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.d.ts +109 -26
- package/dist/types/src/components/Form/Form.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.stories.d.ts +114 -137
- 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 +79 -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 +15 -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 +11 -0
- package/dist/types/src/components/Form/fields/MarkdownField.d.ts.map +1 -0
- package/dist/types/src/components/Form/fields/MarkdownField.stories.d.ts +84 -0
- package/dist/types/src/components/Form/fields/MarkdownField.stories.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 +22 -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 +84 -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/ObjectForm/ObjectForm.d.ts +9 -0
- package/dist/types/src/components/ObjectForm/ObjectForm.d.ts.map +1 -0
- package/dist/types/src/components/ObjectForm/index.d.ts +2 -0
- package/dist/types/src/components/ObjectForm/index.d.ts.map +1 -0
- package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts +37 -10
- package/dist/types/src/components/ObjectPicker/ObjectPicker.d.ts.map +1 -1
- package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts +65 -59
- package/dist/types/src/components/ObjectPicker/ObjectPicker.stories.d.ts.map +1 -1
- package/dist/types/src/components/ObjectProperties/ObjectProperties.d.ts +9 -0
- package/dist/types/src/components/ObjectProperties/ObjectProperties.d.ts.map +1 -0
- package/dist/types/src/components/ObjectProperties/ObjectProperties.stories.d.ts +127 -0
- package/dist/types/src/components/ObjectProperties/ObjectProperties.stories.d.ts.map +1 -0
- package/dist/types/src/components/ObjectProperties/ObjectProperties.test.d.ts +2 -0
- package/dist/types/src/components/ObjectProperties/ObjectProperties.test.d.ts.map +1 -0
- package/dist/types/src/components/ObjectProperties/index.d.ts +2 -0
- package/dist/types/src/components/ObjectProperties/index.d.ts.map +1 -0
- package/dist/types/src/components/Settings/Settings.d.ts +51 -0
- package/dist/types/src/components/Settings/Settings.d.ts.map +1 -0
- package/dist/types/src/components/Settings/Settings.stories.d.ts +84 -0
- package/dist/types/src/components/Settings/Settings.stories.d.ts.map +1 -0
- package/dist/types/src/components/Settings/SettingsFieldSet.d.ts +43 -0
- package/dist/types/src/components/Settings/SettingsFieldSet.d.ts.map +1 -0
- package/dist/types/src/components/Settings/SettingsItem.d.ts +16 -0
- package/dist/types/src/components/Settings/SettingsItem.d.ts.map +1 -0
- package/dist/types/src/components/Settings/SettingsSelectField.d.ts +18 -0
- package/dist/types/src/components/Settings/SettingsSelectField.d.ts.map +1 -0
- package/dist/types/src/components/Settings/index.d.ts +4 -0
- package/dist/types/src/components/Settings/index.d.ts.map +1 -0
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts +15 -16
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +70 -64
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +4 -6
- 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 +7 -0
- package/dist/types/src/hooks/useKeyHandler.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +0 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +65 -60
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/util/field-type.d.ts +19 -0
- package/dist/types/src/util/field-type.d.ts.map +1 -0
- 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 +2 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/properties.d.ts +13 -0
- package/dist/types/src/util/properties.d.ts.map +1 -0
- package/dist/types/src/util/properties.test.d.ts +2 -0
- package/dist/types/src/util/properties.test.d.ts.map +1 -0
- package/dist/types/src/util/refs.d.ts +2 -2
- package/dist/types/src/util/refs.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +57 -51
- package/src/components/FieldEditor/FieldEditor.stories.tsx +44 -25
- package/src/components/FieldEditor/FieldEditor.test.tsx +0 -1
- package/src/components/FieldEditor/FieldEditor.tsx +76 -79
- package/src/components/Form/AUDIT.md +17 -0
- package/src/components/Form/Form.stories.tsx +139 -251
- package/src/components/Form/Form.tsx +375 -106
- package/src/components/Form/FormField.tsx +306 -0
- package/src/components/Form/FormFieldComponent.stories.tsx +65 -0
- package/src/components/Form/FormFieldComponent.tsx +174 -0
- package/src/components/Form/FormFieldSet.tsx +144 -0
- package/src/components/Form/README.md +3 -0
- package/src/components/Form/fields/ArrayField.tsx +155 -0
- package/src/components/Form/fields/BooleanField.tsx +22 -0
- package/src/components/Form/fields/GeoPointField.tsx +121 -0
- package/src/components/Form/fields/MarkdownField.stories.tsx +206 -0
- package/src/components/Form/fields/MarkdownField.tsx +168 -0
- package/src/components/Form/fields/NumberField.tsx +39 -0
- package/src/components/Form/fields/RefField.tsx +229 -0
- package/src/components/Form/fields/SelectField.tsx +65 -0
- package/src/components/Form/{custom/SelectOptionsInput.stories.tsx → fields/SelectOptionField.stories.tsx} +23 -18
- package/src/components/Form/{custom/SelectOptionsInput.tsx → fields/SelectOptionField.tsx} +30 -24
- 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/ObjectForm/ObjectForm.tsx +114 -0
- package/src/components/{ControlSection → ObjectForm}/index.ts +1 -1
- package/src/components/ObjectPicker/ObjectPicker.stories.tsx +50 -45
- package/src/components/ObjectPicker/ObjectPicker.tsx +127 -86
- package/src/components/ObjectProperties/ObjectProperties.stories.tsx +362 -0
- package/src/components/ObjectProperties/ObjectProperties.test.tsx +101 -0
- package/src/components/ObjectProperties/ObjectProperties.tsx +148 -0
- package/src/components/ObjectProperties/index.ts +5 -0
- package/src/components/Settings/AUDIT.md +51 -0
- package/src/components/Settings/Settings.stories.tsx +104 -0
- package/src/components/Settings/Settings.tsx +80 -0
- package/src/components/Settings/SettingsFieldSet.tsx +257 -0
- package/src/components/Settings/SettingsItem.tsx +58 -0
- package/src/components/Settings/SettingsSelectField.tsx +59 -0
- package/src/components/Settings/index.ts +7 -0
- package/src/components/ViewEditor/ViewEditor.stories.tsx +73 -54
- package/src/components/ViewEditor/ViewEditor.test.tsx +8 -7
- package/src/components/ViewEditor/ViewEditor.tsx +304 -269
- package/src/components/index.ts +3 -1
- package/src/components/testing.tsx +24 -11
- package/src/hooks/index.ts +2 -3
- package/src/hooks/useFormHandler.ts +380 -0
- package/src/hooks/useKeyHandler.tsx +37 -0
- package/src/index.ts +0 -4
- package/src/translations.ts +70 -65
- package/src/util/field-type.ts +60 -0
- package/src/util/field.ts +25 -25
- package/src/util/formatting.ts +22 -22
- package/src/util/index.ts +2 -1
- package/src/util/properties.test.ts +63 -0
- package/src/util/properties.ts +29 -0
- package/src/util/refs.ts +16 -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 -84
- 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 -63
- 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 -29
- package/dist/types/src/components/Form/Input.d.ts.map +0 -1
- package/dist/types/src/components/Form/RefField.d.ts +0 -21
- 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 -79
- 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/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 -28
- 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 -38
- package/src/components/ControlSection/ControlSection.tsx +0 -153
- package/src/components/Form/ArrayField.tsx +0 -125
- package/src/components/Form/Defaults.tsx +0 -205
- package/src/components/Form/FormActions.tsx +0 -54
- package/src/components/Form/FormContent.tsx +0 -322
- package/src/components/Form/FormContext.tsx +0 -110
- package/src/components/Form/Input.tsx +0 -54
- package/src/components/Form/RefField.tsx +0 -269
- package/src/components/Form/custom/GeoPointInput.tsx +0 -80
- package/src/components/Form/custom/index.ts +0 -7
- package/src/components/Form/factory.tsx +0 -31
- package/src/hooks/useForm.ts +0 -295
- package/src/hooks/useQueryRefOptions.ts +0 -59
- package/src/hooks/useRefQueryLookupHandler.ts +0 -39
- package/src/util/schema.ts +0 -12
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as SchemaAST from 'effect/SchemaAST';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type FormFieldProps } from '../FormField';
|
|
4
|
+
import { type FormFieldStateProps } from '../FormFieldComponent';
|
|
5
|
+
export type ArrayFieldProps = {
|
|
6
|
+
label: string;
|
|
7
|
+
fieldProps: FormFieldStateProps;
|
|
8
|
+
} & FormFieldProps;
|
|
9
|
+
export declare function ArrayField({ type, path, label, readonly, layout, fieldProps: inputProps, ...props }: ArrayFieldProps): React.JSX.Element | null;
|
|
10
|
+
export declare namespace ArrayField {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Returns the default empty value for a given AST.
|
|
15
|
+
* Used for initializing new array values etc.
|
|
16
|
+
*/
|
|
17
|
+
export declare const getDefaultValue: (ast?: SchemaAST.AST) => any;
|
|
18
|
+
//# sourceMappingURL=ArrayField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArrayField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/ArrayField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAsB,MAAM,OAAO,CAAC;AAS3C,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,mBAAmB,CAAC;CACjC,GAAG,cAAc,CAAC;mCAEQ,EACzB,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,MAAM,EACN,UAAU,EAAE,UAAU,EACtB,GAAG,KAAK,EACT,EAAE,eAAe;;;;AAgGlB;;;GAGG;AAEH,eAAO,MAAM,eAAe,SAAU,SAAS,CAAC,GAAG,KAAG,GAsBrD,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
3
|
+
export declare const BooleanField: ({ type, readonly, onValueChange, ...props }: FormFieldComponentProps<boolean>) => React.JSX.Element;
|
|
4
|
+
//# sourceMappingURL=BooleanField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BooleanField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/BooleanField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,YAAY,gDAAiD,uBAAuB,CAAC,OAAO,CAAC,sBAWzG,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type GeoPoint } from '@dxos/echo/internal';
|
|
3
|
+
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
4
|
+
export declare const GeoPointField: ({ type, label, readonly, layout, getStatus, getValue, onValueChange, onBlur, }: FormFieldComponentProps<GeoPoint>) => React.JSX.Element | null;
|
|
5
|
+
//# sourceMappingURL=GeoPointField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeoPointField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/GeoPointField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAE3F,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAMjE,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAErF,eAAO,MAAM,aAAa,mFASvB,uBAAuB,CAAC,QAAQ,CAAC,6BA+EnC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
3
|
+
/**
|
|
4
|
+
* Form field that edits a markdown value in a CodeMirror editor.
|
|
5
|
+
* Supports two backings:
|
|
6
|
+
* - `Schema.String` annotated with `Format.TypeFormat.Markdown`: edited as plain text via `getValue`/`onValueChange`.
|
|
7
|
+
* - `Ref<Text>` annotated with `Format.TypeFormat.Markdown`: edited in-place via an Automerge doc accessor.
|
|
8
|
+
* When the ref is empty and a database is available, a create button is shown to allocate a new Text.
|
|
9
|
+
*/
|
|
10
|
+
export declare const MarkdownField: ({ type, readonly, label, placeholder, layout, db, getStatus, getValue, onValueChange, }: FormFieldComponentProps) => React.JSX.Element | null;
|
|
11
|
+
//# sourceMappingURL=MarkdownField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/MarkdownField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAYpD,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAKrF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,4FAUvB,uBAAuB,6BAgDzB,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
decorators: import("@storybook/react").Decorator[];
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
translations: [{
|
|
8
|
+
readonly 'en-US': {
|
|
9
|
+
readonly "@dxos/react-ui-form": {
|
|
10
|
+
readonly 'fields.label': 'Fields';
|
|
11
|
+
readonly 'hidden-fields.label': 'Hidden Fields';
|
|
12
|
+
readonly 'empty-readonly-ref-field.label': '(none)';
|
|
13
|
+
readonly 'field-property.label': 'Property';
|
|
14
|
+
readonly 'field-property.placeholder': 'Property name';
|
|
15
|
+
readonly 'field-format.label': 'Type';
|
|
16
|
+
readonly 'field-path.label': 'Field path';
|
|
17
|
+
readonly 'add-item.button': 'Add item';
|
|
18
|
+
readonly 'add-property-button.label': 'Add property';
|
|
19
|
+
readonly 'boolean-input-true.value': 'Yes';
|
|
20
|
+
readonly 'boolean-input-false.value': 'No';
|
|
21
|
+
readonly 'show-field.label': 'Show field';
|
|
22
|
+
readonly 'hide-field.label': 'Hide field';
|
|
23
|
+
readonly 'delete-field.label': 'Delete field';
|
|
24
|
+
readonly 'create-option.label': 'Create';
|
|
25
|
+
readonly 'add-tag.label': 'Add tag';
|
|
26
|
+
readonly 'ref-field-combobox-input.placeholder': 'Search\u2026';
|
|
27
|
+
readonly 'ref-field.placeholder': 'Select\u2026';
|
|
28
|
+
readonly 'ref-field.placeholder_one': 'Select\u2026';
|
|
29
|
+
readonly 'ref-field.placeholder_other': 'Select items\u2026';
|
|
30
|
+
readonly 'example.placeholder': 'Example';
|
|
31
|
+
readonly 'latitude.placeholder': 'Latitude (e.g., 40.7128)';
|
|
32
|
+
readonly 'longitude.placeholder': 'Longitude (e.g., -74.0060)';
|
|
33
|
+
readonly 'cancel-button.label': 'Cancel';
|
|
34
|
+
readonly 'save-button.label': 'Save';
|
|
35
|
+
readonly 'create-text.label': 'Create text';
|
|
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 StringBacked: Story;
|
|
81
|
+
export declare const StringBackedKeepsFocus: Story;
|
|
82
|
+
export declare const RefPopulated: Story;
|
|
83
|
+
export declare const RefEmpty: Story;
|
|
84
|
+
//# sourceMappingURL=MarkdownField.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownField.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/MarkdownField.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA4GjE,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOM,CAAC;eAEF,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,YAAY,EAAE,KAE1B,CAAC;AAMF,eAAO,MAAM,sBAAsB,EAAE,KA+CpC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAY1B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAStB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
3
|
+
export declare const NumberField: ({ type, readonly, placeholder, onValueChange, onBlur, ...props }: FormFieldComponentProps<number>) => React.JSX.Element;
|
|
4
|
+
//# sourceMappingURL=NumberField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/NumberField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAK3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,WAAW,qEAOrB,uBAAuB,CAAC,MAAM,CAAC,sBAoBjC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@dxos/lit-ui/dx-tag-picker.pcss';
|
|
3
|
+
import { type Database, Entity, Obj, Type } from '@dxos/echo';
|
|
4
|
+
import { type ObjectPickerContentProps, type RefOption } from '../../ObjectPicker';
|
|
5
|
+
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
6
|
+
export type RefFieldProps = FormFieldComponentProps & Pick<ObjectPickerContentProps, 'createOptionLabel' | 'createOptionIcon' | 'createInitialValuePath' | 'createFieldMap'> & {
|
|
7
|
+
db?: Database.Database;
|
|
8
|
+
useSchema?: (db?: Database.Database, typename?: string) => Type.AnyEntity;
|
|
9
|
+
useResults?: (db?: Database.Database, typename?: string) => Entity.Any[];
|
|
10
|
+
getOptions?: (objects: Entity.Any[], options?: {
|
|
11
|
+
parentLabel?: boolean;
|
|
12
|
+
}) => RefOption[];
|
|
13
|
+
/**
|
|
14
|
+
* Persist a newly-created object. Called after the user fills out the
|
|
15
|
+
* inline create form and clicks Save. Should add the object to the
|
|
16
|
+
* database and return it (sync or async). The returned object is then
|
|
17
|
+
* wired into this slot's form value as a Ref.
|
|
18
|
+
*/
|
|
19
|
+
onCreate?: (schema: Type.AnyEntity, values: any) => Obj.Unknown | Promise<Obj.Unknown> | undefined | void;
|
|
20
|
+
};
|
|
21
|
+
export declare const RefField: (props: RefFieldProps) => React.JSX.Element | null;
|
|
22
|
+
//# sourceMappingURL=RefField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/RefField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,EAAU,GAAG,EAAO,IAAI,EAAE,MAAM,YAAY,CAAC;AAW3E,OAAO,EAAgB,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEjG,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AA0BrF,MAAM,MAAM,aAAa,GAAG,uBAAuB,GACjD,IAAI,CACF,wBAAwB,EACxB,mBAAmB,GAAG,kBAAkB,GAAG,wBAAwB,GAAG,gBAAgB,CACvF,GAAG;IACF,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAEvB,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC,SAAS,CAAC;IAC1E,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC;IACzE,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,SAAS,EAAE,CAAC;IACzF;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;CAC3G,CAAC;AAEJ,eAAO,MAAM,QAAQ,UAAW,aAAa,6BAmK5C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
3
|
+
export type SelectFieldOptions = FormFieldComponentProps & {
|
|
4
|
+
options?: Array<{
|
|
5
|
+
value: string | number;
|
|
6
|
+
label?: string;
|
|
7
|
+
}>;
|
|
8
|
+
};
|
|
9
|
+
export declare const SelectField: ({ type, readonly, label, layout, placeholder, options, getStatus, getValue, onValueChange, }: SelectFieldOptions) => React.JSX.Element | null;
|
|
10
|
+
//# sourceMappingURL=SelectField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/SelectField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAErF,MAAM,MAAM,kBAAkB,GAAG,uBAAuB,GAAG;IACzD,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC7D,CAAC;AAEF,eAAO,MAAM,WAAW,iGAUrB,kBAAkB,6BAwCpB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type SelectOption } from '@dxos/echo/internal';
|
|
3
|
+
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
4
|
+
export declare const SelectOptionField: ({ type, readonly, label, getStatus, getValue, onValueChange, }: FormFieldComponentProps<SelectOption[] | undefined>) => React.JSX.Element;
|
|
5
|
+
//# sourceMappingURL=SelectOptionField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectOptionField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/SelectOptionField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyF,MAAM,OAAO,CAAC;AAE9G,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AASxD,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAErF,eAAO,MAAM,iBAAiB,mEAO3B,uBAAuB,CAAC,YAAY,EAAE,GAAG,SAAS,CAAC,sBA4KrD,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: any;
|
|
6
|
+
render: () => React.JSX.Element;
|
|
7
|
+
decorators: import("@storybook/react").Decorator[];
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
translations: [{
|
|
11
|
+
readonly 'en-US': {
|
|
12
|
+
readonly "@dxos/react-ui-form": {
|
|
13
|
+
readonly 'fields.label': 'Fields';
|
|
14
|
+
readonly 'hidden-fields.label': 'Hidden Fields';
|
|
15
|
+
readonly 'empty-readonly-ref-field.label': '(none)';
|
|
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-item.button': 'Add item';
|
|
21
|
+
readonly 'add-property-button.label': 'Add property';
|
|
22
|
+
readonly 'boolean-input-true.value': 'Yes';
|
|
23
|
+
readonly 'boolean-input-false.value': 'No';
|
|
24
|
+
readonly 'show-field.label': 'Show field';
|
|
25
|
+
readonly 'hide-field.label': 'Hide field';
|
|
26
|
+
readonly 'delete-field.label': 'Delete field';
|
|
27
|
+
readonly 'create-option.label': 'Create';
|
|
28
|
+
readonly 'add-tag.label': 'Add tag';
|
|
29
|
+
readonly 'ref-field-combobox-input.placeholder': 'Search\u2026';
|
|
30
|
+
readonly 'ref-field.placeholder': 'Select\u2026';
|
|
31
|
+
readonly 'ref-field.placeholder_one': 'Select\u2026';
|
|
32
|
+
readonly 'ref-field.placeholder_other': 'Select items\u2026';
|
|
33
|
+
readonly 'example.placeholder': 'Example';
|
|
34
|
+
readonly 'latitude.placeholder': 'Latitude (e.g., 40.7128)';
|
|
35
|
+
readonly 'longitude.placeholder': 'Longitude (e.g., -74.0060)';
|
|
36
|
+
readonly 'cancel-button.label': 'Cancel';
|
|
37
|
+
readonly 'save-button.label': 'Save';
|
|
38
|
+
readonly 'create-text.label': 'Create text';
|
|
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
|
+
//# sourceMappingURL=SelectOptionField.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectOptionField.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/SelectOptionField.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAmB,MAAM,OAAO,CAAC;AA4CxC,QAAA,MAAM,IAAI;;eAEwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOA,CAAC;eAEvB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
3
|
+
export declare const TextAreaField: ({ type, readonly, placeholder, onValueChange, onBlur, ...props }: FormFieldComponentProps<string>) => React.JSX.Element;
|
|
4
|
+
//# sourceMappingURL=TextAreaField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextAreaField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/TextAreaField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,aAAa,qEAOvB,uBAAuB,CAAC,MAAM,CAAC,sBAoBjC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
3
|
+
export declare const TextField: ({ type, readonly, placeholder, onBlur, onValueChange, ...props }: FormFieldComponentProps<string>) => React.JSX.Element;
|
|
4
|
+
//# sourceMappingURL=TextField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/TextField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,uBAAuB,CAAC;AAEvF,eAAO,MAAM,SAAS,qEAOnB,uBAAuB,CAAC,MAAM,CAAC,sBAoBjC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FormFieldComponentProps } from '../FormFieldComponent';
|
|
3
|
+
export declare const TupleField: ({ binding, type, readonly, label, getStatus, getValue, onValueChange, onBlur, }: FormFieldComponentProps<Record<string, number>> & {
|
|
4
|
+
binding: string[];
|
|
5
|
+
}) => React.JSX.Element;
|
|
6
|
+
//# sourceMappingURL=TupleField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TupleField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/fields/TupleField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,KAAK,uBAAuB,EAAkB,MAAM,uBAAuB,CAAC;AAIrF,eAAO,MAAM,UAAU,oFASpB,uBAAuB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG;IACnD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,sBA4BA,CAAC"}
|
|
@@ -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,9 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Obj } from '@dxos/echo';
|
|
4
|
+
export type ObjectFormProps = {
|
|
5
|
+
schema: Schema.Schema.AnyNoContext;
|
|
6
|
+
object: Obj.Unknown;
|
|
7
|
+
};
|
|
8
|
+
export declare const ObjectForm: ({ object, schema }: ObjectFormProps) => React.JSX.Element;
|
|
9
|
+
//# sourceMappingURL=ObjectForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectForm.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectForm/ObjectForm.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAA+B,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAO,GAAG,EAAkB,MAAM,YAAY,CAAC;AAUtD,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;IACnC,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC;CACrB,CAAC;AAeF,eAAO,MAAM,UAAU,uBAAwB,eAAe,sBA8E7D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ObjectForm/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC"}
|
|
@@ -1,21 +1,40 @@
|
|
|
1
1
|
import type * as Schema from 'effect/Schema';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
4
|
-
import { type
|
|
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
|
+
};
|
|
5
10
|
export type ObjectPickerContentProps = ThemedClassName<{
|
|
6
|
-
options:
|
|
11
|
+
options: RefOption[];
|
|
7
12
|
selectedIds?: string[];
|
|
8
|
-
createSchema?: Schema.Schema.AnyNoContext;
|
|
9
13
|
createOptionLabel?: [string, {
|
|
10
14
|
ns: string;
|
|
11
15
|
}];
|
|
12
16
|
createOptionIcon?: string;
|
|
17
|
+
createSchema?: Schema.Schema.AnyNoContext;
|
|
13
18
|
createInitialValuePath?: string;
|
|
19
|
+
createFieldMap?: FormFieldMap;
|
|
20
|
+
/**
|
|
21
|
+
* Persist a newly-created object given the form values. May be async (e.g.
|
|
22
|
+
* to write to a database). The Promise is awaited before the inline create
|
|
23
|
+
* form is collapsed back to the picker list, so consumers can complete
|
|
24
|
+
* follow-up work (assign the new ref to a parent slot, close the popover)
|
|
25
|
+
* before the picker UI re-renders.
|
|
26
|
+
*/
|
|
27
|
+
onCreate?: (values: any) => unknown | Promise<unknown>;
|
|
14
28
|
onSelect: (id: string) => void;
|
|
15
|
-
onCreate?: (values: any) => void;
|
|
16
29
|
}>;
|
|
17
30
|
export declare const ObjectPicker: {
|
|
18
|
-
Root: ({ modal,
|
|
31
|
+
Root: ({ children, modal, modalId: modalIdProp, open: openProp, defaultOpen, onOpenChange: propsOnOpenChange, value: valueProp, defaultValue, onValueChange: propsOnValueChange, placeholder, }: import("@dxos/react-ui-list").ComboboxRootProps) => React.JSX.Element;
|
|
32
|
+
Portal: {
|
|
33
|
+
(props: import("@dxos/react-ui").PopoverPortalProps & {
|
|
34
|
+
__scopePopover?: import("@radix-ui/react-context").Scope;
|
|
35
|
+
}): React.JSX.Element;
|
|
36
|
+
displayName: string;
|
|
37
|
+
};
|
|
19
38
|
Trigger: React.ForwardRefExoticComponent<Omit<import("@dxos/react-ui").ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
20
39
|
VirtualTrigger: {
|
|
21
40
|
(props: import("@dxos/react-ui").PopoverVirtualTriggerProps & {
|
|
@@ -24,18 +43,26 @@ export declare const ObjectPicker: {
|
|
|
24
43
|
displayName: string;
|
|
25
44
|
};
|
|
26
45
|
Content: React.ForwardRefExoticComponent<Omit<{
|
|
27
|
-
options:
|
|
46
|
+
options: RefOption[];
|
|
28
47
|
selectedIds?: string[];
|
|
29
|
-
createSchema?: Schema.Schema.AnyNoContext;
|
|
30
48
|
createOptionLabel?: [string, {
|
|
31
49
|
ns: string;
|
|
32
50
|
}];
|
|
33
51
|
createOptionIcon?: string;
|
|
52
|
+
createSchema?: Schema.Schema.AnyNoContext;
|
|
34
53
|
createInitialValuePath?: string;
|
|
54
|
+
createFieldMap?: FormFieldMap;
|
|
55
|
+
/**
|
|
56
|
+
* Persist a newly-created object given the form values. May be async (e.g.
|
|
57
|
+
* to write to a database). The Promise is awaited before the inline create
|
|
58
|
+
* form is collapsed back to the picker list, so consumers can complete
|
|
59
|
+
* follow-up work (assign the new ref to a parent slot, close the popover)
|
|
60
|
+
* before the picker UI re-renders.
|
|
61
|
+
*/
|
|
62
|
+
onCreate?: (values: any) => unknown | Promise<unknown>;
|
|
35
63
|
onSelect: (id: string) => void;
|
|
36
|
-
onCreate?: (values: any) => void;
|
|
37
64
|
}, "className"> & {
|
|
38
|
-
classNames?: import("@dxos/
|
|
65
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
39
66
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
40
67
|
};
|
|
41
68
|
//# sourceMappingURL=ObjectPicker.d.ts.map
|
|
@@ -1 +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,
|
|
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;AAO7F,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;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,CAAC,CAAC;AA4JH,eAAO,MAAM,YAAY;IACvB,IAAI;IACJ,MAAM;;;;;;IACN,OAAO;IACP,cAAc;;;;;;IACd,OAAO;iBAjLE,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;QAC7B;;;;;;WAMG;mBACQ,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;kBAC5C,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI;;;;CAmK/B,CAAC"}
|