@dxos/react-ui-form 0.8.3-main.672df60 → 0.8.3-main.7f5a14c
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 +10 -9
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +10 -9
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +10 -9
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts +6 -0
- package/dist/types/src/components/FieldEditor/FieldEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.d.ts +2 -1
- package/dist/types/src/components/Form/Form.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts +8 -0
- package/dist/types/src/components/ViewEditor/ViewEditor.stories.d.ts.map +1 -1
- package/package.json +27 -26
- package/src/components/FieldEditor/FieldEditor.stories.tsx +27 -4
- package/src/components/FieldEditor/FieldEditor.test.tsx +20 -13
- package/src/components/Form/Form.tsx +4 -1
- package/src/components/Form/FormActions.tsx +1 -1
- package/src/components/Form/FormContent.tsx +2 -2
- package/src/components/ViewEditor/ViewEditor.stories.tsx +27 -8
- package/src/components/ViewEditor/ViewEditor.test.tsx +79 -42
- package/src/components/ViewEditor/ViewEditor.tsx +4 -4
|
@@ -732,6 +732,7 @@ var MarkdownInput = ({ type, label, inputOnly, disabled, placeholder, getStatus,
|
|
|
732
732
|
// packages/ui/react-ui-form/src/components/Form/Form.tsx
|
|
733
733
|
import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
|
|
734
734
|
import React13, { useEffect as useEffect7, useMemo as useMemo6, useRef as useRef3 } from "react";
|
|
735
|
+
import { cardSpacing } from "@dxos/react-ui-stack";
|
|
735
736
|
import { mx as mx7 } from "@dxos/react-ui-theme";
|
|
736
737
|
|
|
737
738
|
// packages/ui/react-ui-form/src/components/Form/FormActions.tsx
|
|
@@ -1110,7 +1111,7 @@ var FormActions = ({ readonly, onCancel }) => {
|
|
|
1110
1111
|
const { canSave, handleSave } = useFormContext();
|
|
1111
1112
|
return /* @__PURE__ */ React9.createElement("div", {
|
|
1112
1113
|
role: "none",
|
|
1113
|
-
className: "flex [&_button]:grow gap-1
|
|
1114
|
+
className: "flex [&_button]:grow gap-1 mlb-3 last:mbe-0 first:mbs-0"
|
|
1114
1115
|
}, onCancel && !readonly && /* @__PURE__ */ React9.createElement(IconButton2, {
|
|
1115
1116
|
"data-testid": "cancel-button",
|
|
1116
1117
|
icon: "ph--x--regular",
|
|
@@ -1833,7 +1834,7 @@ var FormField = ({ property, path, readonly, inline, onQueryRefOptions, lookupCo
|
|
|
1833
1834
|
const typeLiteral = baseNode ? getDiscriminatedType2(baseNode, inputProps.getValue()) : findNode3(ast, SchemaAST4.isTypeLiteral);
|
|
1834
1835
|
if (typeLiteral) {
|
|
1835
1836
|
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, !inline && /* @__PURE__ */ React12.createElement("h3", {
|
|
1836
|
-
className: "text-lg
|
|
1837
|
+
className: mx6("text-lg mlb-card-spacing-block first:mbs-0")
|
|
1837
1838
|
}, label), /* @__PURE__ */ React12.createElement(FormFields, {
|
|
1838
1839
|
schema: Schema.make(typeLiteral),
|
|
1839
1840
|
path,
|
|
@@ -1867,7 +1868,7 @@ var FormFields = ({ classNames, Custom, schema, path, filter, sort, readonly, lo
|
|
|
1867
1868
|
// TODO(burdon): Consistent padding (with composite forms).
|
|
1868
1869
|
/* @__PURE__ */ React12.createElement("div", {
|
|
1869
1870
|
role: "form",
|
|
1870
|
-
className: mx6("
|
|
1871
|
+
className: mx6("is-full", classNames)
|
|
1871
1872
|
}, properties.map((property) => {
|
|
1872
1873
|
return /* @__PURE__ */ React12.createElement(FormField, {
|
|
1873
1874
|
key: property.name,
|
|
@@ -1889,7 +1890,7 @@ var FormFields = ({ classNames, Custom, schema, path, filter, sort, readonly, lo
|
|
|
1889
1890
|
};
|
|
1890
1891
|
|
|
1891
1892
|
// packages/ui/react-ui-form/src/components/Form/Form.tsx
|
|
1892
|
-
var Form = ({ classNames, schema, values: initialValues, path = [], autoFocus, readonly, filter, sort, autoSave, testId, onValuesChanged, onValidate, onSave, onCancel, onQueryRefOptions, lookupComponent, Custom }) => {
|
|
1893
|
+
var Form = ({ classNames, schema, values: initialValues, path = [], autoFocus, readonly, filter, sort, autoSave, flush, testId, onValuesChanged, onValidate, onSave, onCancel, onQueryRefOptions, lookupComponent, Custom }) => {
|
|
1893
1894
|
var _effect = _useSignals13();
|
|
1894
1895
|
try {
|
|
1895
1896
|
const formRef = useRef3(null);
|
|
@@ -1919,7 +1920,7 @@ var Form = ({ classNames, schema, values: initialValues, path = [], autoFocus, r
|
|
|
1919
1920
|
}, /* @__PURE__ */ React13.createElement("div", {
|
|
1920
1921
|
ref: formRef,
|
|
1921
1922
|
role: "none",
|
|
1922
|
-
className: mx7(
|
|
1923
|
+
className: mx7(!flush && cardSpacing, classNames),
|
|
1923
1924
|
"data-testid": testId
|
|
1924
1925
|
}, /* @__PURE__ */ React13.createElement(FormFields, {
|
|
1925
1926
|
schema,
|
|
@@ -2252,7 +2253,7 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly, showHeading =
|
|
|
2252
2253
|
className: mx8("overflow-y-auto", classNames)
|
|
2253
2254
|
}, immutable && /* @__PURE__ */ React15.createElement("div", {
|
|
2254
2255
|
role: "none",
|
|
2255
|
-
className: "mbe-
|
|
2256
|
+
className: "mbe-card-spacing-block"
|
|
2256
2257
|
}, /* @__PURE__ */ React15.createElement(Message.Root, {
|
|
2257
2258
|
valence: "neutral",
|
|
2258
2259
|
className: "rounded"
|
|
@@ -2271,7 +2272,7 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly, showHeading =
|
|
|
2271
2272
|
className: "min-bs-0 overflow-y-auto"
|
|
2272
2273
|
}, /* @__PURE__ */ React15.createElement("div", {
|
|
2273
2274
|
role: "none",
|
|
2274
|
-
className: "
|
|
2275
|
+
className: "pli-card-spacing-inline mlb-card-spacing-block"
|
|
2275
2276
|
}, /* @__PURE__ */ React15.createElement("label", {
|
|
2276
2277
|
className: mx8(inputTextLabel)
|
|
2277
2278
|
}, t("fields label"))), /* @__PURE__ */ React15.createElement(List2.Root, {
|
|
@@ -2306,7 +2307,7 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly, showHeading =
|
|
|
2306
2307
|
onClick: () => handleDelete(field2.id)
|
|
2307
2308
|
}))))))), hiddenProperties.length > 0 && /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement("div", {
|
|
2308
2309
|
role: "none",
|
|
2309
|
-
className: "
|
|
2310
|
+
className: "pli-card-spacing-inline mlb-card-spacing-block"
|
|
2310
2311
|
}, /* @__PURE__ */ React15.createElement("label", {
|
|
2311
2312
|
className: mx8(inputTextLabel)
|
|
2312
2313
|
}, t("hidden fields label"))), /* @__PURE__ */ React15.createElement(List2.Root, {
|
|
@@ -2333,7 +2334,7 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly, showHeading =
|
|
|
2333
2334
|
onSave: handleClose
|
|
2334
2335
|
}), !readonly && !field && /* @__PURE__ */ React15.createElement("div", {
|
|
2335
2336
|
role: "none",
|
|
2336
|
-
className: "
|
|
2337
|
+
className: "pli-card-spacing-chrome mlb-card-spacing-chrome"
|
|
2337
2338
|
}, /* @__PURE__ */ React15.createElement(IconButton4, {
|
|
2338
2339
|
icon: "ph--plus--regular",
|
|
2339
2340
|
label: t("button add property"),
|