@dxos/react-ui-form 0.8.2-staging.4d6ad0f → 0.8.2
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 +30 -26
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +30 -26
- package/dist/lib/node/index.cjs.map +2 -2
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +30 -26
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Form/FormContent.d.ts +6 -5
- package/dist/types/src/components/Form/FormContent.d.ts.map +1 -1
- package/package.json +26 -26
- package/src/components/Form/FormContent.tsx +12 -8
|
@@ -732,7 +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 { mx as
|
|
735
|
+
import { mx as mx7 } from "@dxos/react-ui-theme";
|
|
736
736
|
|
|
737
737
|
// packages/ui/react-ui-form/src/components/Form/FormActions.tsx
|
|
738
738
|
import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
|
|
@@ -1135,6 +1135,7 @@ import { Schema, SchemaAST as SchemaAST4, pipe as pipe2 } from "effect";
|
|
|
1135
1135
|
import { capitalize as capitalize2 } from "effect/String";
|
|
1136
1136
|
import React12, { useMemo as useMemo5 } from "react";
|
|
1137
1137
|
import { createJsonPath as createJsonPath3, findNode as findNode3, getDiscriminatedType as getDiscriminatedType2, isDiscriminatedUnion as isDiscriminatedUnion2 } from "@dxos/effect";
|
|
1138
|
+
import { mx as mx6 } from "@dxos/react-ui-theme";
|
|
1138
1139
|
import { getSchemaProperties as getSchemaProperties2 } from "@dxos/schema";
|
|
1139
1140
|
import { isNotFalsy } from "@dxos/util";
|
|
1140
1141
|
|
|
@@ -1848,7 +1849,7 @@ var FormField = ({ property, path, readonly, inline, onQueryRefOptions, lookupCo
|
|
|
1848
1849
|
_effect.f();
|
|
1849
1850
|
}
|
|
1850
1851
|
};
|
|
1851
|
-
var FormFields = ({ schema, path, filter, sort, readonly,
|
|
1852
|
+
var FormFields = ({ classNames, Custom, schema, path, filter, sort, readonly, lookupComponent, onQueryRefOptions }) => {
|
|
1852
1853
|
var _effect = _useSignals12();
|
|
1853
1854
|
try {
|
|
1854
1855
|
const values = useFormValues(path);
|
|
@@ -1862,23 +1863,26 @@ var FormFields = ({ schema, path, filter, sort, readonly, onQueryRefOptions, loo
|
|
|
1862
1863
|
filter,
|
|
1863
1864
|
sort
|
|
1864
1865
|
]);
|
|
1865
|
-
return
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1866
|
+
return (
|
|
1867
|
+
// TODO(burdon): Consistent padding (with composite forms).
|
|
1868
|
+
/* @__PURE__ */ React12.createElement("div", {
|
|
1869
|
+
role: "form",
|
|
1870
|
+
className: mx6("p-2 is-full", classNames)
|
|
1871
|
+
}, properties.map((property) => {
|
|
1872
|
+
return /* @__PURE__ */ React12.createElement(FormField, {
|
|
1873
|
+
key: property.name,
|
|
1874
|
+
property,
|
|
1875
|
+
path: [
|
|
1876
|
+
...path ?? [],
|
|
1877
|
+
property.name
|
|
1878
|
+
],
|
|
1879
|
+
readonly,
|
|
1880
|
+
onQueryRefOptions,
|
|
1881
|
+
lookupComponent,
|
|
1882
|
+
Custom
|
|
1883
|
+
});
|
|
1884
|
+
}).filter(isNotFalsy))
|
|
1885
|
+
);
|
|
1882
1886
|
} finally {
|
|
1883
1887
|
_effect.f();
|
|
1884
1888
|
}
|
|
@@ -1915,7 +1919,7 @@ var Form = ({ classNames, schema, values: initialValues, path = [], autoFocus, r
|
|
|
1915
1919
|
}, /* @__PURE__ */ React13.createElement("div", {
|
|
1916
1920
|
ref: formRef,
|
|
1917
1921
|
role: "none",
|
|
1918
|
-
className:
|
|
1922
|
+
className: mx7("flex flex-col gap-4", classNames),
|
|
1919
1923
|
"data-testid": testId
|
|
1920
1924
|
}, /* @__PURE__ */ React13.createElement(FormFields, {
|
|
1921
1925
|
schema,
|
|
@@ -2107,7 +2111,7 @@ import { EchoSchema, Format, isMutable, toJsonSchema } from "@dxos/echo-schema";
|
|
|
2107
2111
|
import { invariant as invariant3 } from "@dxos/invariant";
|
|
2108
2112
|
import { Icon as Icon3, IconButton as IconButton4, Message, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
2109
2113
|
import { List as List2 } from "@dxos/react-ui-list";
|
|
2110
|
-
import { ghostHover, inputTextLabel, mx as
|
|
2114
|
+
import { ghostHover, inputTextLabel, mx as mx8 } from "@dxos/react-ui-theme";
|
|
2111
2115
|
import { FieldSchema, ViewProjection, VIEW_FIELD_LIMIT } from "@dxos/schema";
|
|
2112
2116
|
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-form/src/components/ViewEditor/ViewEditor.tsx";
|
|
2113
2117
|
var grid = "grid grid-cols-[32px_1fr_32px] min-bs-[2.5rem]";
|
|
@@ -2245,7 +2249,7 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly, showHeading =
|
|
|
2245
2249
|
]);
|
|
2246
2250
|
return /* @__PURE__ */ React15.createElement("div", {
|
|
2247
2251
|
role: "none",
|
|
2248
|
-
className:
|
|
2252
|
+
className: mx8("overflow-y-auto", classNames)
|
|
2249
2253
|
}, /* @__PURE__ */ React15.createElement("div", {
|
|
2250
2254
|
role: "none",
|
|
2251
2255
|
className: "p-2"
|
|
@@ -2272,7 +2276,7 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly, showHeading =
|
|
|
2272
2276
|
role: "none",
|
|
2273
2277
|
className: "p-2"
|
|
2274
2278
|
}, /* @__PURE__ */ React15.createElement("label", {
|
|
2275
|
-
className:
|
|
2279
|
+
className: mx8(inputTextLabel)
|
|
2276
2280
|
}, t("fields label"))), /* @__PURE__ */ React15.createElement(List2.Root, {
|
|
2277
2281
|
items: view.fields,
|
|
2278
2282
|
isItem: Schema2.is(FieldSchema),
|
|
@@ -2289,7 +2293,7 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly, showHeading =
|
|
|
2289
2293
|
}, fields?.map((field2) => /* @__PURE__ */ React15.createElement(List2.Item, {
|
|
2290
2294
|
key: field2.id,
|
|
2291
2295
|
item: field2,
|
|
2292
|
-
classNames:
|
|
2296
|
+
classNames: mx8(grid, ghostHover, !immutable && "cursor-pointer")
|
|
2293
2297
|
}, /* @__PURE__ */ React15.createElement(List2.ItemDragHandle, null), /* @__PURE__ */ React15.createElement(List2.ItemTitle, {
|
|
2294
2298
|
onClick: () => handleSelect(field2)
|
|
2295
2299
|
}, field2.path), /* @__PURE__ */ React15.createElement("div", {
|
|
@@ -2306,7 +2310,7 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly, showHeading =
|
|
|
2306
2310
|
role: "none",
|
|
2307
2311
|
className: "p-2"
|
|
2308
2312
|
}, /* @__PURE__ */ React15.createElement("label", {
|
|
2309
|
-
className:
|
|
2313
|
+
className: mx8(inputTextLabel)
|
|
2310
2314
|
}, t("hidden fields label"))), /* @__PURE__ */ React15.createElement(List2.Root, {
|
|
2311
2315
|
items: hiddenProperties,
|
|
2312
2316
|
isItem: (item) => typeof item === "string",
|
|
@@ -2317,7 +2321,7 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly, showHeading =
|
|
|
2317
2321
|
}, properties?.map((property) => /* @__PURE__ */ React15.createElement(List2.Item, {
|
|
2318
2322
|
key: property,
|
|
2319
2323
|
item: property,
|
|
2320
|
-
classNames:
|
|
2324
|
+
classNames: mx8(grid, ghostHover, !immutable && "cursor-pointer")
|
|
2321
2325
|
}, /* @__PURE__ */ React15.createElement("div", null), /* @__PURE__ */ React15.createElement(List2.ItemTitle, null, property), /* @__PURE__ */ React15.createElement(List2.ItemButton, {
|
|
2322
2326
|
icon: "ph--eye--regular",
|
|
2323
2327
|
onClick: () => handleShow(property)
|