@dxos/react-ui-form 0.8.2-main.2f9c567 → 0.8.2-main.5885341
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 +49 -83
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +177 -210
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +49 -83
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Form/ArrayField.d.ts.map +1 -1
- package/dist/types/src/components/Form/Defaults.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.d.ts +2 -3
- package/dist/types/src/components/Form/Form.d.ts.map +1 -1
- package/dist/types/src/components/Form/Form.stories.d.ts +32 -33
- package/dist/types/src/components/Form/Form.stories.d.ts.map +1 -1
- package/dist/types/src/components/Form/FormContent.d.ts +2 -2
- package/dist/types/src/components/Form/FormContent.d.ts.map +1 -1
- package/dist/types/src/components/Form/RefField.d.ts +2 -3
- package/dist/types/src/components/Form/RefField.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/index.d.ts +0 -1
- package/dist/types/src/components/Form/index.d.ts.map +1 -1
- package/dist/types/src/components/ViewEditor/ViewEditor.d.ts.map +1 -1
- 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/hooks/index.d.ts +0 -1
- 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/package.json +24 -24
- package/src/components/Form/ArrayField.tsx +6 -5
- package/src/components/Form/Defaults.tsx +1 -4
- package/src/components/Form/Form.stories.tsx +41 -46
- package/src/components/Form/Form.tsx +2 -3
- package/src/components/Form/FormContent.tsx +6 -5
- package/src/components/Form/RefField.tsx +2 -2
- package/src/components/Form/custom/SelectOptionsInput.stories.tsx +4 -5
- package/src/components/Form/index.ts +1 -1
- package/src/components/ViewEditor/ViewEditor.stories.tsx +2 -3
- package/src/components/ViewEditor/ViewEditor.tsx +8 -9
- package/src/components/deprecated/Form.tsx +6 -6
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useForm.ts +3 -3
- package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts +0 -8
- package/dist/types/src/hooks/useRefQueryLookupHandler.d.ts.map +0 -1
- package/src/hooks/useRefQueryLookupHandler.ts +0 -43
|
@@ -181,7 +181,7 @@ var ControlFrameItem = ({ title, description, children }) => {
|
|
|
181
181
|
};
|
|
182
182
|
|
|
183
183
|
// packages/ui/react-ui-form/src/components/FieldEditor/FieldEditor.tsx
|
|
184
|
-
import React14, { useCallback as
|
|
184
|
+
import React14, { useCallback as useCallback6, useEffect as useEffect8, useMemo as useMemo7, useState as useState5 } from "react";
|
|
185
185
|
import { FormatEnum as FormatEnum2, FormatEnums, formatToType } from "@dxos/echo-schema";
|
|
186
186
|
import { log as log3 } from "@dxos/log";
|
|
187
187
|
import { useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
@@ -546,28 +546,23 @@ var BooleanInput = ({ type, label, inputOnly, getStatus, getValue: getValue3, on
|
|
|
546
546
|
};
|
|
547
547
|
var SelectInput = ({ type, label, inputOnly, disabled, placeholder, options, getStatus, getValue: getValue3, onValueChange }) => {
|
|
548
548
|
const { status, error } = getStatus();
|
|
549
|
-
const value = getValue3();
|
|
550
|
-
const handleValueChange = useCallback3((value2) => onValueChange(type, value2), [
|
|
551
|
-
type,
|
|
552
|
-
onValueChange
|
|
553
|
-
]);
|
|
554
549
|
return /* @__PURE__ */ React7.createElement(Input6.Root, {
|
|
555
550
|
validationValence: status
|
|
556
551
|
}, !inputOnly && /* @__PURE__ */ React7.createElement(InputHeader, {
|
|
557
552
|
error
|
|
558
553
|
}, /* @__PURE__ */ React7.createElement(Input6.Label, null, label)), /* @__PURE__ */ React7.createElement(Select.Root, {
|
|
559
|
-
value,
|
|
560
|
-
onValueChange:
|
|
554
|
+
value: getValue3(),
|
|
555
|
+
onValueChange: (value) => onValueChange(type, value)
|
|
561
556
|
}, /* @__PURE__ */ React7.createElement(Select.TriggerButton, {
|
|
562
557
|
classNames: "is-full",
|
|
563
558
|
disabled,
|
|
564
559
|
placeholder
|
|
565
|
-
}), /* @__PURE__ */ React7.createElement(Select.Portal, null, /* @__PURE__ */ React7.createElement(Select.Content, null, /* @__PURE__ */ React7.createElement(Select.Viewport, null, options?.map(({ value
|
|
560
|
+
}), /* @__PURE__ */ React7.createElement(Select.Portal, null, /* @__PURE__ */ React7.createElement(Select.Content, null, /* @__PURE__ */ React7.createElement(Select.Viewport, null, options?.map(({ value, label: label2 }) => (
|
|
566
561
|
// NOTE: Numeric values are converted to and from strings.
|
|
567
562
|
/* @__PURE__ */ React7.createElement(Select.Option, {
|
|
568
|
-
key: String(
|
|
569
|
-
value: String(
|
|
570
|
-
}, label2 ?? String(
|
|
563
|
+
key: String(value),
|
|
564
|
+
value: String(value)
|
|
565
|
+
}, label2 ?? String(value))
|
|
571
566
|
)))))), inputOnly && /* @__PURE__ */ React7.createElement(Input6.DescriptionAndValidation, null, error));
|
|
572
567
|
};
|
|
573
568
|
var MarkdownInput = ({ type, label, inputOnly, disabled, placeholder, getStatus, getValue: getValue3, onValueChange, onBlur }) => {
|
|
@@ -626,7 +621,7 @@ import { getValue as getValue2 } from "@dxos/echo-schema";
|
|
|
626
621
|
import { createJsonPath as createJsonPath2 } from "@dxos/effect";
|
|
627
622
|
|
|
628
623
|
// packages/ui/react-ui-form/src/hooks/useForm.ts
|
|
629
|
-
import { SchemaAST } from "effect";
|
|
624
|
+
import { SchemaAST as AST } from "effect";
|
|
630
625
|
import { useCallback as useCallback4, useEffect as useEffect4, useMemo as useMemo2, useState as useState3 } from "react";
|
|
631
626
|
import { getValue, setValue } from "@dxos/echo-schema";
|
|
632
627
|
import { createJsonPath, fromEffectValidationPath } from "@dxos/effect";
|
|
@@ -635,12 +630,12 @@ import { log } from "@dxos/log";
|
|
|
635
630
|
import { validateSchema } from "@dxos/schema";
|
|
636
631
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/ui/react-ui-form/src/hooks/useForm.ts";
|
|
637
632
|
var useForm = ({ schema, initialValues, onValuesChanged, onValidate, onValid, onSave }) => {
|
|
638
|
-
invariant(
|
|
633
|
+
invariant(AST.isTypeLiteral(schema.ast), void 0, {
|
|
639
634
|
F: __dxlog_file,
|
|
640
635
|
L: 93,
|
|
641
636
|
S: void 0,
|
|
642
637
|
A: [
|
|
643
|
-
"
|
|
638
|
+
"AST.isTypeLiteral(schema.ast)",
|
|
644
639
|
""
|
|
645
640
|
]
|
|
646
641
|
});
|
|
@@ -834,35 +829,6 @@ var flatMap = (errors) => {
|
|
|
834
829
|
}, {});
|
|
835
830
|
};
|
|
836
831
|
|
|
837
|
-
// packages/ui/react-ui-form/src/hooks/useRefQueryLookupHandler.ts
|
|
838
|
-
import { useCallback as useCallback5 } from "react";
|
|
839
|
-
import { getDXN } from "@dxos/echo-schema";
|
|
840
|
-
import { Filter } from "@dxos/react-client/echo";
|
|
841
|
-
import { isNonNullable } from "@dxos/util";
|
|
842
|
-
var useRefQueryLookupHandler = ({ space }) => {
|
|
843
|
-
const handleRefQueryLookup = useCallback5(async (typeInfo) => {
|
|
844
|
-
if (!space) {
|
|
845
|
-
return [];
|
|
846
|
-
}
|
|
847
|
-
const query = space.db.query(Filter.typename(typeInfo.typename));
|
|
848
|
-
const { objects } = await query.run();
|
|
849
|
-
return objects.map((object) => {
|
|
850
|
-
const dxn = getDXN(object);
|
|
851
|
-
if (!dxn) {
|
|
852
|
-
return void 0;
|
|
853
|
-
}
|
|
854
|
-
const item = {
|
|
855
|
-
dxn,
|
|
856
|
-
label: object?.name ?? object?.id ?? ""
|
|
857
|
-
};
|
|
858
|
-
return item;
|
|
859
|
-
}).filter(isNonNullable);
|
|
860
|
-
}, [
|
|
861
|
-
space
|
|
862
|
-
]);
|
|
863
|
-
return handleRefQueryLookup;
|
|
864
|
-
};
|
|
865
|
-
|
|
866
832
|
// packages/ui/react-ui-form/src/components/Form/FormContext.tsx
|
|
867
833
|
var FormContext = /* @__PURE__ */ createContext(void 0);
|
|
868
834
|
var useFormContext = () => {
|
|
@@ -954,18 +920,20 @@ var FormActions = ({ onCancel, readonly }) => {
|
|
|
954
920
|
};
|
|
955
921
|
|
|
956
922
|
// packages/ui/react-ui-form/src/components/Form/FormContent.tsx
|
|
957
|
-
import {
|
|
923
|
+
import { pipe as pipe2 } from "effect";
|
|
958
924
|
import { capitalize as capitalize2 } from "effect/String";
|
|
959
925
|
import React12, { useMemo as useMemo5 } from "react";
|
|
926
|
+
import { AST as AST3, S } from "@dxos/echo-schema";
|
|
960
927
|
import { createJsonPath as createJsonPath3, findNode as findNode2, getDiscriminatedType as getDiscriminatedType2, isDiscriminatedUnion as isDiscriminatedUnion2 } from "@dxos/effect";
|
|
961
928
|
import { mx as mx7 } from "@dxos/react-ui-theme";
|
|
962
929
|
import { getSchemaProperties as getSchemaProperties2 } from "@dxos/schema";
|
|
963
930
|
import { isNotFalsy } from "@dxos/util";
|
|
964
931
|
|
|
965
932
|
// packages/ui/react-ui-form/src/components/Form/ArrayField.tsx
|
|
966
|
-
import {
|
|
933
|
+
import { pipe } from "effect";
|
|
967
934
|
import { capitalize } from "effect/String";
|
|
968
|
-
import React10, { useCallback as
|
|
935
|
+
import React10, { useCallback as useCallback5, useMemo as useMemo4 } from "react";
|
|
936
|
+
import { AST as AST2 } from "@dxos/echo-schema";
|
|
969
937
|
import { findNode, getDiscriminatedType, isDiscriminatedUnion, SimpleType } from "@dxos/effect";
|
|
970
938
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
971
939
|
import { IconButton as IconButton3, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
@@ -979,7 +947,7 @@ var ArrayField = ({ property, readonly, path, inputProps, Custom, lookupComponen
|
|
|
979
947
|
const values = useFormValues(path ?? []) ?? [];
|
|
980
948
|
invariant2(Array.isArray(values), `Values at path ${path?.join(".")} must be an array.`, {
|
|
981
949
|
F: __dxlog_file2,
|
|
982
|
-
L:
|
|
950
|
+
L: 39,
|
|
983
951
|
S: void 0,
|
|
984
952
|
A: [
|
|
985
953
|
"Array.isArray(values)",
|
|
@@ -987,11 +955,11 @@ var ArrayField = ({ property, readonly, path, inputProps, Custom, lookupComponen
|
|
|
987
955
|
]
|
|
988
956
|
});
|
|
989
957
|
const label = title ?? pipe(name, capitalize);
|
|
990
|
-
const tupleType = findNode(ast,
|
|
958
|
+
const tupleType = findNode(ast, AST2.isTupleType);
|
|
991
959
|
const elementType = tupleType?.rest[0]?.type;
|
|
992
960
|
const getDefaultObjectValue = (typeNode) => {
|
|
993
961
|
const baseNode = findNode(typeNode, isDiscriminatedUnion);
|
|
994
|
-
const typeLiteral = baseNode ? getDiscriminatedType(baseNode, {}) : findNode(typeNode,
|
|
962
|
+
const typeLiteral = baseNode ? getDiscriminatedType(baseNode, {}) : findNode(typeNode, AST2.isTypeLiteral);
|
|
995
963
|
if (!typeLiteral) {
|
|
996
964
|
return {};
|
|
997
965
|
}
|
|
@@ -1010,7 +978,7 @@ var ArrayField = ({ property, readonly, path, inputProps, Custom, lookupComponen
|
|
|
1010
978
|
type,
|
|
1011
979
|
elementType
|
|
1012
980
|
]);
|
|
1013
|
-
const handleAdd =
|
|
981
|
+
const handleAdd = useCallback5(() => {
|
|
1014
982
|
inputProps.onValueChange(type, [
|
|
1015
983
|
...values,
|
|
1016
984
|
newValue
|
|
@@ -1022,7 +990,7 @@ var ArrayField = ({ property, readonly, path, inputProps, Custom, lookupComponen
|
|
|
1022
990
|
newValue,
|
|
1023
991
|
values
|
|
1024
992
|
]);
|
|
1025
|
-
const handleRemove =
|
|
993
|
+
const handleRemove = useCallback5((index) => {
|
|
1026
994
|
const newValues = values.filter((_, i) => i !== index);
|
|
1027
995
|
inputProps.onValueChange(type, newValues);
|
|
1028
996
|
}, [
|
|
@@ -1211,7 +1179,7 @@ var FormField = ({ property, path, readonly, inline, onQueryRefOptions, lookupCo
|
|
|
1211
1179
|
]);
|
|
1212
1180
|
const FoundComponent = lookupComponent?.({
|
|
1213
1181
|
prop: name,
|
|
1214
|
-
schema:
|
|
1182
|
+
schema: S.make(ast),
|
|
1215
1183
|
inputProps: {
|
|
1216
1184
|
type,
|
|
1217
1185
|
format,
|
|
@@ -1293,14 +1261,14 @@ var FormField = ({ property, path, readonly, inline, onQueryRefOptions, lookupCo
|
|
|
1293
1261
|
}
|
|
1294
1262
|
if (type === "object") {
|
|
1295
1263
|
const baseNode = findNode2(ast, isDiscriminatedUnion2);
|
|
1296
|
-
const typeLiteral = baseNode ? getDiscriminatedType2(baseNode, inputProps.getValue()) : findNode2(ast,
|
|
1264
|
+
const typeLiteral = baseNode ? getDiscriminatedType2(baseNode, inputProps.getValue()) : findNode2(ast, AST3.isTypeLiteral);
|
|
1297
1265
|
if (typeLiteral) {
|
|
1298
1266
|
return /* @__PURE__ */ React12.createElement("div", {
|
|
1299
1267
|
role: "none"
|
|
1300
1268
|
}, !inline && /* @__PURE__ */ React12.createElement("h3", {
|
|
1301
1269
|
className: "text-lg mbs-2 mbe-1"
|
|
1302
1270
|
}, label), /* @__PURE__ */ React12.createElement(FormFields, {
|
|
1303
|
-
schema:
|
|
1271
|
+
schema: S.make(typeLiteral),
|
|
1304
1272
|
path,
|
|
1305
1273
|
readonly,
|
|
1306
1274
|
onQueryRefOptions,
|
|
@@ -1426,7 +1394,7 @@ var FieldEditor = ({ view, projection, field, registry, onSave, onCancel }) => {
|
|
|
1426
1394
|
const [{ fieldSchema }, setFieldSchema] = useState5({
|
|
1427
1395
|
fieldSchema: getFormatSchema(props?.format)
|
|
1428
1396
|
});
|
|
1429
|
-
const handleValuesChanged =
|
|
1397
|
+
const handleValuesChanged = useCallback6((_props) => {
|
|
1430
1398
|
setFieldSchema((prev) => {
|
|
1431
1399
|
const fieldSchema2 = getFormatSchema(_props.format);
|
|
1432
1400
|
if (prev.fieldSchema === fieldSchema2) {
|
|
@@ -1461,7 +1429,7 @@ var FieldEditor = ({ view, projection, field, registry, onSave, onCancel }) => {
|
|
|
1461
1429
|
props.format,
|
|
1462
1430
|
props.referenceSchema
|
|
1463
1431
|
]);
|
|
1464
|
-
const handleValidate =
|
|
1432
|
+
const handleValidate = useCallback6(({ property }) => {
|
|
1465
1433
|
if (property && view.fields.find((f) => f.path === property && f.path !== field.path)) {
|
|
1466
1434
|
return [
|
|
1467
1435
|
{
|
|
@@ -1474,7 +1442,7 @@ var FieldEditor = ({ view, projection, field, registry, onSave, onCancel }) => {
|
|
|
1474
1442
|
view.fields,
|
|
1475
1443
|
field
|
|
1476
1444
|
]);
|
|
1477
|
-
const handleSave =
|
|
1445
|
+
const handleSave = useCallback6((props2) => {
|
|
1478
1446
|
projection.setFieldProjection({
|
|
1479
1447
|
field,
|
|
1480
1448
|
props: props2
|
|
@@ -1485,7 +1453,7 @@ var FieldEditor = ({ view, projection, field, registry, onSave, onCancel }) => {
|
|
|
1485
1453
|
field,
|
|
1486
1454
|
onSave
|
|
1487
1455
|
]);
|
|
1488
|
-
const handleCancel =
|
|
1456
|
+
const handleCancel = useCallback6(() => {
|
|
1489
1457
|
requestAnimationFrame(() => onCancel?.());
|
|
1490
1458
|
onSave();
|
|
1491
1459
|
}, [
|
|
@@ -1517,7 +1485,7 @@ var FieldEditor = ({ view, projection, field, registry, onSave, onCancel }) => {
|
|
|
1517
1485
|
schemas,
|
|
1518
1486
|
referenceSchema
|
|
1519
1487
|
]);
|
|
1520
|
-
const propIsNotType =
|
|
1488
|
+
const propIsNotType = useCallback6((props2) => props2.filter((p) => p.name !== "type"), []);
|
|
1521
1489
|
if (!fieldSchema) {
|
|
1522
1490
|
log3.warn("invalid format", {
|
|
1523
1491
|
props
|
|
@@ -1548,9 +1516,8 @@ var FieldEditor = ({ view, projection, field, registry, onSave, onCancel }) => {
|
|
|
1548
1516
|
};
|
|
1549
1517
|
|
|
1550
1518
|
// packages/ui/react-ui-form/src/components/ViewEditor/ViewEditor.tsx
|
|
1551
|
-
import {
|
|
1552
|
-
import
|
|
1553
|
-
import { Format } from "@dxos/echo-schema";
|
|
1519
|
+
import React15, { useCallback as useCallback7, useMemo as useMemo8, useState as useState6 } from "react";
|
|
1520
|
+
import { AST as AST4, Format, S as S2 } from "@dxos/echo-schema";
|
|
1554
1521
|
import { invariant as invariant3 } from "@dxos/invariant";
|
|
1555
1522
|
import { IconButton as IconButton4, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
1556
1523
|
import { List as List2 } from "@dxos/react-ui-list";
|
|
@@ -1558,14 +1525,14 @@ import { ghostHover, inputTextLabel, mx as mx9 } from "@dxos/react-ui-theme";
|
|
|
1558
1525
|
import { FieldSchema, ViewProjection, VIEW_FIELD_LIMIT } from "@dxos/schema";
|
|
1559
1526
|
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-form/src/components/ViewEditor/ViewEditor.tsx";
|
|
1560
1527
|
var grid = "grid grid-cols-[32px_1fr_32px] min-bs-[2.5rem]";
|
|
1561
|
-
var ViewMetaSchema =
|
|
1562
|
-
name:
|
|
1563
|
-
[
|
|
1528
|
+
var ViewMetaSchema = S2.Struct({
|
|
1529
|
+
name: S2.String.annotations({
|
|
1530
|
+
[AST4.TitleAnnotationId]: "View"
|
|
1564
1531
|
}),
|
|
1565
1532
|
typename: Format.URL.annotations({
|
|
1566
|
-
[
|
|
1533
|
+
[AST4.TitleAnnotationId]: "Typename"
|
|
1567
1534
|
})
|
|
1568
|
-
}).pipe(
|
|
1535
|
+
}).pipe(S2.mutable);
|
|
1569
1536
|
var ViewEditor = ({ classNames, schema, view, registry, readonly, showHeading = false, onTypenameChanged, onDelete }) => {
|
|
1570
1537
|
const { t } = useTranslation7(translationKey);
|
|
1571
1538
|
const projection = useMemo8(() => new ViewProjection(schema.jsonSchema, view), [
|
|
@@ -1583,13 +1550,13 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly, showHeading =
|
|
|
1583
1550
|
}, [
|
|
1584
1551
|
view
|
|
1585
1552
|
]);
|
|
1586
|
-
const handleSelect =
|
|
1553
|
+
const handleSelect = useCallback7((field2) => {
|
|
1587
1554
|
setField((f) => f === field2 ? void 0 : field2);
|
|
1588
1555
|
}, []);
|
|
1589
|
-
const handleAdd =
|
|
1556
|
+
const handleAdd = useCallback7(() => {
|
|
1590
1557
|
invariant3(!schema.readonly, void 0, {
|
|
1591
1558
|
F: __dxlog_file5,
|
|
1592
|
-
L:
|
|
1559
|
+
L: 76,
|
|
1593
1560
|
S: void 0,
|
|
1594
1561
|
A: [
|
|
1595
1562
|
"!schema.readonly",
|
|
@@ -1602,10 +1569,10 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly, showHeading =
|
|
|
1602
1569
|
schema,
|
|
1603
1570
|
view
|
|
1604
1571
|
]);
|
|
1605
|
-
const handleUpdate =
|
|
1572
|
+
const handleUpdate = useCallback7(({ name, typename }) => {
|
|
1606
1573
|
invariant3(!schema.readonly, void 0, {
|
|
1607
1574
|
F: __dxlog_file5,
|
|
1608
|
-
L:
|
|
1575
|
+
L: 83,
|
|
1609
1576
|
S: void 0,
|
|
1610
1577
|
A: [
|
|
1611
1578
|
"!schema.readonly",
|
|
@@ -1625,10 +1592,10 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly, showHeading =
|
|
|
1625
1592
|
view,
|
|
1626
1593
|
onTypenameChanged
|
|
1627
1594
|
]);
|
|
1628
|
-
const handleDelete =
|
|
1595
|
+
const handleDelete = useCallback7((fieldId) => {
|
|
1629
1596
|
invariant3(!schema.readonly, void 0, {
|
|
1630
1597
|
F: __dxlog_file5,
|
|
1631
|
-
L:
|
|
1598
|
+
L: 99,
|
|
1632
1599
|
S: void 0,
|
|
1633
1600
|
A: [
|
|
1634
1601
|
"!schema.readonly",
|
|
@@ -1644,10 +1611,10 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly, showHeading =
|
|
|
1644
1611
|
field,
|
|
1645
1612
|
onDelete
|
|
1646
1613
|
]);
|
|
1647
|
-
const handleMove =
|
|
1614
|
+
const handleMove = useCallback7((fromIndex, toIndex) => {
|
|
1648
1615
|
invariant3(!schema.readonly, void 0, {
|
|
1649
1616
|
F: __dxlog_file5,
|
|
1650
|
-
L:
|
|
1617
|
+
L: 111,
|
|
1651
1618
|
S: void 0,
|
|
1652
1619
|
A: [
|
|
1653
1620
|
"!schema.readonly",
|
|
@@ -1664,15 +1631,15 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly, showHeading =
|
|
|
1664
1631
|
schema,
|
|
1665
1632
|
view.fields
|
|
1666
1633
|
]);
|
|
1667
|
-
const handleClose =
|
|
1634
|
+
const handleClose = useCallback7(() => setField(void 0), []);
|
|
1668
1635
|
const hiddenProperties = projection.getHiddenProperties();
|
|
1669
|
-
const handleHide =
|
|
1636
|
+
const handleHide = useCallback7((fieldId) => {
|
|
1670
1637
|
setField(void 0);
|
|
1671
1638
|
projection.hideFieldProjection(fieldId);
|
|
1672
1639
|
}, [
|
|
1673
1640
|
projection
|
|
1674
1641
|
]);
|
|
1675
|
-
const handleShow =
|
|
1642
|
+
const handleShow = useCallback7((property) => {
|
|
1676
1643
|
setField(void 0);
|
|
1677
1644
|
projection.showFieldProjection(property);
|
|
1678
1645
|
}, [
|
|
@@ -1697,7 +1664,7 @@ var ViewEditor = ({ classNames, schema, view, registry, readonly, showHeading =
|
|
|
1697
1664
|
className: mx9(inputTextLabel)
|
|
1698
1665
|
}, t("fields label"))), /* @__PURE__ */ React15.createElement(List2.Root, {
|
|
1699
1666
|
items: view.fields,
|
|
1700
|
-
isItem:
|
|
1667
|
+
isItem: S2.is(FieldSchema),
|
|
1701
1668
|
getId: (field2) => field2.id,
|
|
1702
1669
|
onMove: schema.readonly ? void 0 : handleMove
|
|
1703
1670
|
}, ({ items: fields }) => /* @__PURE__ */ React15.createElement(React15.Fragment, null, showHeading && /* @__PURE__ */ React15.createElement("div", {
|
|
@@ -2065,7 +2032,6 @@ export {
|
|
|
2065
2032
|
useForm,
|
|
2066
2033
|
useFormContext,
|
|
2067
2034
|
useFormValues,
|
|
2068
|
-
useInputProps
|
|
2069
|
-
useRefQueryLookupHandler
|
|
2035
|
+
useInputProps
|
|
2070
2036
|
};
|
|
2071
2037
|
//# sourceMappingURL=index.mjs.map
|