@measured/puck 0.19.0-canary.59cb0d9 → 0.19.0-canary.61c8658
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/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +237 -201
- package/dist/index.mjs +252 -217
- package/dist/{resolve-all-data-wwgDuTnC.d.mts → resolve-all-data-DleIzc4N.d.mts} +1 -0
- package/dist/{resolve-all-data-wwgDuTnC.d.ts → resolve-all-data-DleIzc4N.d.ts} +1 -0
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/package.json +4 -3
package/dist/index.d.mts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { F as FieldProps, a as Field, D as DropZoneProps, C as Config, U as UserGenerics, b as Data, c as UiState, O as OnAction, P as Permissions, d as Plugin, e as Overrides, f as PuckAction, V as Viewports, I as IframeConfig, g as InitialHistory, M as Metadata, h as DefaultComponentProps, i as DefaultRootFieldProps, H as History, j as ComponentData, k as Fields, A as AppState, l as ComponentConfig } from './resolve-all-data-
|
2
|
-
export { Q as Adaptor, K as ArrayField, t as ArrayState, a2 as AsFieldProps, B as BaseData, E as BaseField, y as ComponentDataMap, z as Content, Y as CustomField, $ as DefaultRootProps, _ as DefaultRootRenderProps, m as Direction, n as DragAxis, X as ExternalField, W as ExternalFieldWithAdaptor, a4 as ExtractPropsFromConfig, a5 as ExtractRootPropsFromConfig, r as FieldRenderFunctions, s as ItemWithId, x as MappedItem, N as NumberField, L as ObjectField, q as OverrideKey, u as PuckComponent, Z as PuckContext, J as RadioField, w as RootData, R as RootDataWithProps, v as RootDataWithoutProps, S as SelectField, T as TextField, G as TextareaField, o as Viewport, a3 as WithChildren, a0 as WithId, a1 as WithPuckProps, p as overrideKeys, a6 as resolveAllData } from './resolve-all-data-
|
1
|
+
import { F as FieldProps, a as Field, D as DropZoneProps, C as Config, U as UserGenerics, b as Data, c as UiState, O as OnAction, P as Permissions, d as Plugin, e as Overrides, f as PuckAction, V as Viewports, I as IframeConfig, g as InitialHistory, M as Metadata, h as DefaultComponentProps, i as DefaultRootFieldProps, H as History, j as ComponentData, k as Fields, A as AppState, l as ComponentConfig } from './resolve-all-data-DleIzc4N.mjs';
|
2
|
+
export { Q as Adaptor, K as ArrayField, t as ArrayState, a2 as AsFieldProps, B as BaseData, E as BaseField, y as ComponentDataMap, z as Content, Y as CustomField, $ as DefaultRootProps, _ as DefaultRootRenderProps, m as Direction, n as DragAxis, X as ExternalField, W as ExternalFieldWithAdaptor, a4 as ExtractPropsFromConfig, a5 as ExtractRootPropsFromConfig, r as FieldRenderFunctions, s as ItemWithId, x as MappedItem, N as NumberField, L as ObjectField, q as OverrideKey, u as PuckComponent, Z as PuckContext, J as RadioField, w as RootData, R as RootDataWithProps, v as RootDataWithoutProps, S as SelectField, T as TextField, G as TextareaField, o as Viewport, a3 as WithChildren, a0 as WithId, a1 as WithPuckProps, p as overrideKeys, a6 as resolveAllData } from './resolve-all-data-DleIzc4N.mjs';
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
4
4
|
import * as react from 'react';
|
5
5
|
import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
|
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { F as FieldProps, a as Field, D as DropZoneProps, C as Config, U as UserGenerics, b as Data, c as UiState, O as OnAction, P as Permissions, d as Plugin, e as Overrides, f as PuckAction, V as Viewports, I as IframeConfig, g as InitialHistory, M as Metadata, h as DefaultComponentProps, i as DefaultRootFieldProps, H as History, j as ComponentData, k as Fields, A as AppState, l as ComponentConfig } from './resolve-all-data-
|
2
|
-
export { Q as Adaptor, K as ArrayField, t as ArrayState, a2 as AsFieldProps, B as BaseData, E as BaseField, y as ComponentDataMap, z as Content, Y as CustomField, $ as DefaultRootProps, _ as DefaultRootRenderProps, m as Direction, n as DragAxis, X as ExternalField, W as ExternalFieldWithAdaptor, a4 as ExtractPropsFromConfig, a5 as ExtractRootPropsFromConfig, r as FieldRenderFunctions, s as ItemWithId, x as MappedItem, N as NumberField, L as ObjectField, q as OverrideKey, u as PuckComponent, Z as PuckContext, J as RadioField, w as RootData, R as RootDataWithProps, v as RootDataWithoutProps, S as SelectField, T as TextField, G as TextareaField, o as Viewport, a3 as WithChildren, a0 as WithId, a1 as WithPuckProps, p as overrideKeys, a6 as resolveAllData } from './resolve-all-data-
|
1
|
+
import { F as FieldProps, a as Field, D as DropZoneProps, C as Config, U as UserGenerics, b as Data, c as UiState, O as OnAction, P as Permissions, d as Plugin, e as Overrides, f as PuckAction, V as Viewports, I as IframeConfig, g as InitialHistory, M as Metadata, h as DefaultComponentProps, i as DefaultRootFieldProps, H as History, j as ComponentData, k as Fields, A as AppState, l as ComponentConfig } from './resolve-all-data-DleIzc4N.js';
|
2
|
+
export { Q as Adaptor, K as ArrayField, t as ArrayState, a2 as AsFieldProps, B as BaseData, E as BaseField, y as ComponentDataMap, z as Content, Y as CustomField, $ as DefaultRootProps, _ as DefaultRootRenderProps, m as Direction, n as DragAxis, X as ExternalField, W as ExternalFieldWithAdaptor, a4 as ExtractPropsFromConfig, a5 as ExtractRootPropsFromConfig, r as FieldRenderFunctions, s as ItemWithId, x as MappedItem, N as NumberField, L as ObjectField, q as OverrideKey, u as PuckComponent, Z as PuckContext, J as RadioField, w as RootData, R as RootDataWithProps, v as RootDataWithoutProps, S as SelectField, T as TextField, G as TextareaField, o as Viewport, a3 as WithChildren, a0 as WithId, a1 as WithPuckProps, p as overrideKeys, a6 as resolveAllData } from './resolve-all-data-DleIzc4N.js';
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
4
4
|
import * as react from 'react';
|
5
5
|
import react__default, { ReactNode, SyntheticEvent, ReactElement } from 'react';
|
package/dist/index.js
CHANGED
@@ -2758,6 +2758,7 @@ var createDynamicCollisionDetector = (dragAxis, midpointOffset = 0.05) => (input
|
|
2758
2758
|
var import_modifiers = require("@dnd-kit/dom/modifiers");
|
2759
2759
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
2760
2760
|
var SortableProvider = ({
|
2761
|
+
container,
|
2761
2762
|
children,
|
2762
2763
|
onDragStart,
|
2763
2764
|
onDragEnd,
|
@@ -2772,7 +2773,7 @@ var SortableProvider = ({
|
|
2772
2773
|
modifiers: [
|
2773
2774
|
import_modifiers.RestrictToElement.configure({
|
2774
2775
|
element() {
|
2775
|
-
return
|
2776
|
+
return container.current;
|
2776
2777
|
}
|
2777
2778
|
})
|
2778
2779
|
],
|
@@ -2885,6 +2886,7 @@ var ArrayField = ({
|
|
2885
2886
|
value: _value,
|
2886
2887
|
name,
|
2887
2888
|
label,
|
2889
|
+
labelIcon,
|
2888
2890
|
readOnly,
|
2889
2891
|
id,
|
2890
2892
|
Label: Label2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", __spreadValues({}, props))
|
@@ -2949,6 +2951,7 @@ var ArrayField = ({
|
|
2949
2951
|
}
|
2950
2952
|
}, []);
|
2951
2953
|
const [isDragging, setIsDragging] = (0, import_react16.useState)(false);
|
2954
|
+
const dndContainerRef = (0, import_react16.useRef)(null);
|
2952
2955
|
const canEdit = useAppStore(
|
2953
2956
|
(s) => s.permissions.getPermissions({ item: s.selectedItem }).edit
|
2954
2957
|
);
|
@@ -2961,12 +2964,13 @@ var ArrayField = ({
|
|
2961
2964
|
Label2,
|
2962
2965
|
{
|
2963
2966
|
label: label || name,
|
2964
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(List, { size: 16 }),
|
2967
|
+
icon: labelIcon || /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(List, { size: 16 }),
|
2965
2968
|
el: "div",
|
2966
2969
|
readOnly,
|
2967
2970
|
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
2968
2971
|
SortableProvider,
|
2969
2972
|
{
|
2973
|
+
container: dndContainerRef,
|
2970
2974
|
onDragStart: () => setIsDragging(true),
|
2971
2975
|
onDragEnd: () => setIsDragging(false),
|
2972
2976
|
onMove: (move) => {
|
@@ -2996,168 +3000,173 @@ var ArrayField = ({
|
|
2996
3000
|
hasItems: Array.isArray(value) && value.length > 0,
|
2997
3001
|
addDisabled
|
2998
3002
|
}),
|
2999
|
-
onClick: (e) => {
|
3000
|
-
e.preventDefault();
|
3001
|
-
},
|
3002
3003
|
children: [
|
3003
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3004
|
-
|
3005
|
-
|
3006
|
-
|
3007
|
-
|
3008
|
-
|
3009
|
-
|
3010
|
-
|
3011
|
-
|
3012
|
-
|
3013
|
-
|
3004
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3005
|
+
"div",
|
3006
|
+
{
|
3007
|
+
ref: dndContainerRef,
|
3008
|
+
className: getClassName5("inner"),
|
3009
|
+
"data-dnd-container": true,
|
3010
|
+
children: localState.arrayState.items.map((item, i) => {
|
3011
|
+
const { _arrayId = `${id}-${i}`, _originalIndex = i } = item;
|
3012
|
+
const data = Array.from(localState.value || [])[i] || {};
|
3013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3014
|
+
Sortable,
|
3014
3015
|
{
|
3015
|
-
|
3016
|
-
|
3017
|
-
|
3018
|
-
|
3019
|
-
|
3020
|
-
|
3021
|
-
|
3022
|
-
|
3023
|
-
|
3024
|
-
|
3025
|
-
|
3026
|
-
|
3027
|
-
|
3028
|
-
|
3029
|
-
|
3030
|
-
|
3031
|
-
|
3032
|
-
|
3033
|
-
|
3034
|
-
|
3035
|
-
|
3036
|
-
|
3037
|
-
|
3038
|
-
|
3039
|
-
|
3040
|
-
|
3016
|
+
id: _arrayId,
|
3017
|
+
index: i,
|
3018
|
+
disabled: readOnly,
|
3019
|
+
children: ({ status, ref }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
3020
|
+
"div",
|
3021
|
+
{
|
3022
|
+
ref,
|
3023
|
+
className: getClassNameItem({
|
3024
|
+
isExpanded: arrayState.openId === _arrayId,
|
3025
|
+
isDragging: status === "dragging",
|
3026
|
+
readOnly
|
3027
|
+
}),
|
3028
|
+
children: [
|
3029
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
3030
|
+
"div",
|
3031
|
+
{
|
3032
|
+
onClick: (e) => {
|
3033
|
+
if (isDragging) return;
|
3034
|
+
e.preventDefault();
|
3035
|
+
e.stopPropagation();
|
3036
|
+
if (arrayState.openId === _arrayId) {
|
3037
|
+
setUi(
|
3038
|
+
mapArrayStateToUi({
|
3039
|
+
openId: ""
|
3040
|
+
})
|
3041
|
+
);
|
3042
|
+
} else {
|
3043
|
+
setUi(
|
3044
|
+
mapArrayStateToUi({
|
3045
|
+
openId: _arrayId
|
3046
|
+
})
|
3047
|
+
);
|
3048
|
+
}
|
3049
|
+
},
|
3050
|
+
className: getClassNameItem("summary"),
|
3051
|
+
children: [
|
3052
|
+
field.getItemSummary ? field.getItemSummary(data, i) : `Item #${_originalIndex}`,
|
3053
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: getClassNameItem("rhs"), children: [
|
3054
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: getClassNameItem("actions"), children: [
|
3055
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3056
|
+
IconButton,
|
3057
|
+
{
|
3058
|
+
type: "button",
|
3059
|
+
disabled: !!addDisabled,
|
3060
|
+
onClick: (e) => {
|
3061
|
+
e.stopPropagation();
|
3062
|
+
const existingValue = [...value || []];
|
3063
|
+
existingValue.splice(
|
3064
|
+
i,
|
3065
|
+
0,
|
3066
|
+
existingValue[i]
|
3067
|
+
);
|
3068
|
+
onChange(
|
3069
|
+
existingValue,
|
3070
|
+
mapArrayStateToUi(
|
3071
|
+
regenerateArrayState(existingValue)
|
3072
|
+
)
|
3073
|
+
);
|
3074
|
+
},
|
3075
|
+
title: "Duplicate",
|
3076
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Copy, { size: 16 })
|
3077
|
+
}
|
3078
|
+
) }),
|
3079
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3080
|
+
IconButton,
|
3081
|
+
{
|
3082
|
+
type: "button",
|
3083
|
+
disabled: field.min !== void 0 && field.min >= localState.arrayState.items.length,
|
3084
|
+
onClick: (e) => {
|
3085
|
+
e.stopPropagation();
|
3086
|
+
const existingValue = [...value || []];
|
3087
|
+
const existingItems = [
|
3088
|
+
...arrayState.items || []
|
3089
|
+
];
|
3090
|
+
existingValue.splice(i, 1);
|
3091
|
+
existingItems.splice(i, 1);
|
3092
|
+
onChange(
|
3093
|
+
existingValue,
|
3094
|
+
mapArrayStateToUi({
|
3095
|
+
items: existingItems
|
3096
|
+
})
|
3097
|
+
);
|
3098
|
+
},
|
3099
|
+
title: "Delete",
|
3100
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Trash, { size: 16 })
|
3101
|
+
}
|
3102
|
+
) })
|
3103
|
+
] }),
|
3104
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DragIcon, {}) })
|
3105
|
+
] })
|
3106
|
+
]
|
3041
3107
|
}
|
3042
|
-
|
3043
|
-
className: getClassNameItem("
|
3044
|
-
|
3045
|
-
|
3046
|
-
|
3047
|
-
|
3048
|
-
|
3049
|
-
IconButton,
|
3050
|
-
{
|
3051
|
-
type: "button",
|
3052
|
-
disabled: !!addDisabled,
|
3053
|
-
onClick: (e) => {
|
3054
|
-
e.stopPropagation();
|
3055
|
-
const existingValue = [...value || []];
|
3056
|
-
existingValue.splice(
|
3057
|
-
i,
|
3058
|
-
0,
|
3059
|
-
existingValue[i]
|
3060
|
-
);
|
3061
|
-
onChange(
|
3062
|
-
existingValue,
|
3063
|
-
mapArrayStateToUi(
|
3064
|
-
regenerateArrayState(existingValue)
|
3065
|
-
)
|
3066
|
-
);
|
3067
|
-
},
|
3068
|
-
title: "Duplicate",
|
3069
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Copy, { size: 16 })
|
3070
|
-
}
|
3071
|
-
) }),
|
3072
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3073
|
-
IconButton,
|
3074
|
-
{
|
3075
|
-
type: "button",
|
3076
|
-
disabled: field.min !== void 0 && field.min >= localState.arrayState.items.length,
|
3077
|
-
onClick: (e) => {
|
3078
|
-
e.stopPropagation();
|
3079
|
-
const existingValue = [...value || []];
|
3080
|
-
const existingItems = [
|
3081
|
-
...arrayState.items || []
|
3082
|
-
];
|
3083
|
-
existingValue.splice(i, 1);
|
3084
|
-
existingItems.splice(i, 1);
|
3085
|
-
onChange(
|
3086
|
-
existingValue,
|
3087
|
-
mapArrayStateToUi({
|
3088
|
-
items: existingItems
|
3089
|
-
})
|
3090
|
-
);
|
3091
|
-
},
|
3092
|
-
title: "Delete",
|
3093
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Trash, { size: 16 })
|
3094
|
-
}
|
3095
|
-
) })
|
3096
|
-
] }),
|
3097
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DragIcon, {}) })
|
3098
|
-
] })
|
3099
|
-
]
|
3100
|
-
}
|
3101
|
-
),
|
3102
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassNameItem("body"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3103
|
-
"fieldset",
|
3104
|
-
{
|
3105
|
-
className: getClassNameItem("fieldset"),
|
3106
|
-
onPointerDownCapture: (e) => {
|
3107
|
-
e.stopPropagation();
|
3108
|
-
},
|
3109
|
-
children: Object.keys(field.arrayFields).map((subName) => {
|
3110
|
-
const subField = field.arrayFields[subName];
|
3111
|
-
const indexName = `${name}[${i}]`;
|
3112
|
-
const subPath = `${indexName}.${subName}`;
|
3113
|
-
const localIndexName = `${localName}[${i}]`;
|
3114
|
-
const localWildcardName = `${localName}[*]`;
|
3115
|
-
const localSubPath = `${localIndexName}.${subName}`;
|
3116
|
-
const localWildcardSubPath = `${localWildcardName}.${subName}`;
|
3117
|
-
const subReadOnly = forceReadOnly ? forceReadOnly : typeof readOnlyFields[subPath] !== "undefined" ? readOnlyFields[localSubPath] : readOnlyFields[localWildcardSubPath];
|
3118
|
-
const label2 = subField.label || subName;
|
3119
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3120
|
-
NestedFieldProvider,
|
3121
|
-
{
|
3122
|
-
name: localIndexName,
|
3123
|
-
wildcardName: localWildcardName,
|
3124
|
-
subName,
|
3125
|
-
readOnlyFields,
|
3126
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3127
|
-
AutoFieldPrivate,
|
3128
|
-
{
|
3129
|
-
name: subPath,
|
3130
|
-
label: label2,
|
3131
|
-
id: `${_arrayId}_${subName}`,
|
3132
|
-
readOnly: subReadOnly,
|
3133
|
-
field: __spreadProps(__spreadValues({}, subField), {
|
3134
|
-
label: label2
|
3135
|
-
// May be used by custom fields
|
3136
|
-
}),
|
3137
|
-
value: data[subName],
|
3138
|
-
onChange: (val, ui) => {
|
3139
|
-
onChange(
|
3140
|
-
replace(value, i, __spreadProps(__spreadValues({}, data), {
|
3141
|
-
[subName]: val
|
3142
|
-
})),
|
3143
|
-
ui
|
3144
|
-
);
|
3145
|
-
}
|
3146
|
-
}
|
3147
|
-
)
|
3108
|
+
),
|
3109
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassNameItem("body"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3110
|
+
"fieldset",
|
3111
|
+
{
|
3112
|
+
className: getClassNameItem("fieldset"),
|
3113
|
+
onPointerDownCapture: (e) => {
|
3114
|
+
e.stopPropagation();
|
3148
3115
|
},
|
3149
|
-
|
3150
|
-
|
3151
|
-
|
3152
|
-
|
3153
|
-
|
3154
|
-
|
3155
|
-
|
3156
|
-
|
3157
|
-
|
3158
|
-
|
3159
|
-
|
3160
|
-
|
3116
|
+
children: Object.keys(field.arrayFields).map((subName) => {
|
3117
|
+
const subField = field.arrayFields[subName];
|
3118
|
+
const indexName = `${name}[${i}]`;
|
3119
|
+
const subPath = `${indexName}.${subName}`;
|
3120
|
+
const localIndexName = `${localName}[${i}]`;
|
3121
|
+
const localWildcardName = `${localName}[*]`;
|
3122
|
+
const localSubPath = `${localIndexName}.${subName}`;
|
3123
|
+
const localWildcardSubPath = `${localWildcardName}.${subName}`;
|
3124
|
+
const subReadOnly = forceReadOnly ? forceReadOnly : typeof readOnlyFields[subPath] !== "undefined" ? readOnlyFields[localSubPath] : readOnlyFields[localWildcardSubPath];
|
3125
|
+
const label2 = subField.label || subName;
|
3126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3127
|
+
NestedFieldProvider,
|
3128
|
+
{
|
3129
|
+
name: localIndexName,
|
3130
|
+
wildcardName: localWildcardName,
|
3131
|
+
subName,
|
3132
|
+
readOnlyFields,
|
3133
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3134
|
+
AutoFieldPrivate,
|
3135
|
+
{
|
3136
|
+
name: subPath,
|
3137
|
+
label: label2,
|
3138
|
+
id: `${_arrayId}_${subName}`,
|
3139
|
+
readOnly: subReadOnly,
|
3140
|
+
field: __spreadProps(__spreadValues({}, subField), {
|
3141
|
+
label: label2
|
3142
|
+
// May be used by custom fields
|
3143
|
+
}),
|
3144
|
+
value: data[subName],
|
3145
|
+
onChange: (val, ui) => {
|
3146
|
+
onChange(
|
3147
|
+
replace(value, i, __spreadProps(__spreadValues({}, data), {
|
3148
|
+
[subName]: val
|
3149
|
+
})),
|
3150
|
+
ui
|
3151
|
+
);
|
3152
|
+
}
|
3153
|
+
}
|
3154
|
+
)
|
3155
|
+
},
|
3156
|
+
subPath
|
3157
|
+
);
|
3158
|
+
})
|
3159
|
+
}
|
3160
|
+
) })
|
3161
|
+
]
|
3162
|
+
}
|
3163
|
+
)
|
3164
|
+
},
|
3165
|
+
_arrayId
|
3166
|
+
);
|
3167
|
+
})
|
3168
|
+
}
|
3169
|
+
),
|
3161
3170
|
!addDisabled && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3162
3171
|
"button",
|
3163
3172
|
{
|
@@ -3196,6 +3205,7 @@ var DefaultField = ({
|
|
3196
3205
|
value: _value,
|
3197
3206
|
name,
|
3198
3207
|
label,
|
3208
|
+
labelIcon,
|
3199
3209
|
Label: Label2,
|
3200
3210
|
id
|
3201
3211
|
}) => {
|
@@ -3204,7 +3214,7 @@ var DefaultField = ({
|
|
3204
3214
|
Label2,
|
3205
3215
|
{
|
3206
3216
|
label: label || name,
|
3207
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
3217
|
+
icon: labelIcon || /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
3208
3218
|
field.type === "text" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Type, { size: 16 }),
|
3209
3219
|
field.type === "number" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Hash, { size: 16 })
|
3210
3220
|
] }),
|
@@ -3634,6 +3644,7 @@ var ExternalField = ({
|
|
3634
3644
|
value,
|
3635
3645
|
name,
|
3636
3646
|
label,
|
3647
|
+
labelIcon,
|
3637
3648
|
Label: Label2,
|
3638
3649
|
id,
|
3639
3650
|
readOnly
|
@@ -3651,27 +3662,35 @@ var ExternalField = ({
|
|
3651
3662
|
if (field.type !== "external") {
|
3652
3663
|
return null;
|
3653
3664
|
}
|
3654
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
3655
|
-
|
3665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
3666
|
+
Label2,
|
3656
3667
|
{
|
3657
|
-
name,
|
3658
|
-
|
3659
|
-
|
3660
|
-
|
3661
|
-
|
3662
|
-
|
3663
|
-
|
3664
|
-
|
3665
|
-
|
3666
|
-
|
3667
|
-
|
3668
|
-
|
3669
|
-
|
3670
|
-
|
3671
|
-
|
3672
|
-
|
3668
|
+
label: label || name,
|
3669
|
+
icon: labelIcon || /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Link, { size: 16 }),
|
3670
|
+
el: "div",
|
3671
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
3672
|
+
ExternalInput,
|
3673
|
+
{
|
3674
|
+
name,
|
3675
|
+
field: __spreadProps(__spreadValues({}, validField), {
|
3676
|
+
// DEPRECATED
|
3677
|
+
placeholder: ((_a = deprecatedField.adaptor) == null ? void 0 : _a.name) ? `Select from ${deprecatedField.adaptor.name}` : validField.placeholder || "Select data",
|
3678
|
+
mapProp: ((_b = deprecatedField.adaptor) == null ? void 0 : _b.mapProp) || validField.mapProp,
|
3679
|
+
mapRow: validField.mapRow,
|
3680
|
+
fetchList: ((_c = deprecatedField.adaptor) == null ? void 0 : _c.fetchList) ? () => __async(void 0, null, function* () {
|
3681
|
+
return yield deprecatedField.adaptor.fetchList(
|
3682
|
+
deprecatedField.adaptorParams
|
3683
|
+
);
|
3684
|
+
}) : validField.fetchList
|
3685
|
+
}),
|
3686
|
+
onChange,
|
3687
|
+
value,
|
3688
|
+
id,
|
3689
|
+
readOnly
|
3690
|
+
}
|
3691
|
+
)
|
3673
3692
|
}
|
3674
|
-
)
|
3693
|
+
);
|
3675
3694
|
};
|
3676
3695
|
|
3677
3696
|
// components/AutoField/fields/RadioField/index.tsx
|
@@ -3700,6 +3719,7 @@ var RadioField = ({
|
|
3700
3719
|
name,
|
3701
3720
|
id,
|
3702
3721
|
label,
|
3722
|
+
labelIcon,
|
3703
3723
|
Label: Label2
|
3704
3724
|
}) => {
|
3705
3725
|
const flatOptions = (0, import_react21.useMemo)(
|
@@ -3712,7 +3732,7 @@ var RadioField = ({
|
|
3712
3732
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
3713
3733
|
Label2,
|
3714
3734
|
{
|
3715
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CircleCheckBig, { size: 16 }),
|
3735
|
+
icon: labelIcon || /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CircleCheckBig, { size: 16 }),
|
3716
3736
|
label: label || name,
|
3717
3737
|
readOnly,
|
3718
3738
|
el: "div",
|
@@ -3759,6 +3779,7 @@ var SelectField = ({
|
|
3759
3779
|
field,
|
3760
3780
|
onChange,
|
3761
3781
|
label,
|
3782
|
+
labelIcon,
|
3762
3783
|
Label: Label2,
|
3763
3784
|
value,
|
3764
3785
|
name,
|
@@ -3776,7 +3797,7 @@ var SelectField = ({
|
|
3776
3797
|
Label2,
|
3777
3798
|
{
|
3778
3799
|
label: label || name,
|
3779
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChevronDown, { size: 16 }),
|
3800
|
+
icon: labelIcon || /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChevronDown, { size: 16 }),
|
3780
3801
|
readOnly,
|
3781
3802
|
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
3782
3803
|
"select",
|
@@ -3820,24 +3841,33 @@ var TextareaField = ({
|
|
3820
3841
|
value,
|
3821
3842
|
name,
|
3822
3843
|
label,
|
3844
|
+
labelIcon,
|
3823
3845
|
Label: Label2,
|
3824
3846
|
id
|
3825
3847
|
}) => {
|
3826
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
3827
|
-
|
3848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
3849
|
+
Label2,
|
3828
3850
|
{
|
3829
|
-
|
3830
|
-
|
3831
|
-
autoComplete: "off",
|
3832
|
-
name,
|
3833
|
-
value: typeof value === "undefined" ? "" : value,
|
3834
|
-
onChange: (e) => onChange(e.currentTarget.value),
|
3851
|
+
label: label || name,
|
3852
|
+
icon: labelIcon || /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Type, { size: 16 }),
|
3835
3853
|
readOnly,
|
3836
|
-
|
3837
|
-
|
3838
|
-
|
3854
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
3855
|
+
"textarea",
|
3856
|
+
{
|
3857
|
+
id,
|
3858
|
+
className: getClassName13("input"),
|
3859
|
+
autoComplete: "off",
|
3860
|
+
name,
|
3861
|
+
value: typeof value === "undefined" ? "" : value,
|
3862
|
+
onChange: (e) => onChange(e.currentTarget.value),
|
3863
|
+
readOnly,
|
3864
|
+
tabIndex: readOnly ? -1 : void 0,
|
3865
|
+
rows: 5,
|
3866
|
+
placeholder: field.type === "textarea" ? field.placeholder : void 0
|
3867
|
+
}
|
3868
|
+
)
|
3839
3869
|
}
|
3840
|
-
)
|
3870
|
+
);
|
3841
3871
|
};
|
3842
3872
|
|
3843
3873
|
// components/AutoField/fields/ObjectField/index.tsx
|
@@ -3856,6 +3886,7 @@ var ObjectField = ({
|
|
3856
3886
|
value,
|
3857
3887
|
name,
|
3858
3888
|
label,
|
3889
|
+
labelIcon,
|
3859
3890
|
Label: Label2,
|
3860
3891
|
readOnly,
|
3861
3892
|
id
|
@@ -3869,7 +3900,7 @@ var ObjectField = ({
|
|
3869
3900
|
Label2,
|
3870
3901
|
{
|
3871
3902
|
label: label || name,
|
3872
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(EllipsisVertical, { size: 16 }),
|
3903
|
+
icon: labelIcon || /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(EllipsisVertical, { size: 16 }),
|
3873
3904
|
el: "div",
|
3874
3905
|
readOnly,
|
3875
3906
|
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: getClassName14(), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("fieldset", { className: getClassName14("fieldset"), children: Object.keys(field.objectFields).map((subName) => {
|
@@ -3986,6 +4017,7 @@ function AutoFieldInternal(props) {
|
|
3986
4017
|
const { id, Label: Label2 = FieldLabelInternal } = props;
|
3987
4018
|
const field = props.field;
|
3988
4019
|
const label = field.label;
|
4020
|
+
const labelIcon = field.labelIcon;
|
3989
4021
|
const defaultId = useSafeId();
|
3990
4022
|
const resolvedId = id || defaultId;
|
3991
4023
|
const defaultFields = {
|
@@ -4011,6 +4043,7 @@ function AutoFieldInternal(props) {
|
|
4011
4043
|
const mergedProps = __spreadProps(__spreadValues({}, props), {
|
4012
4044
|
field,
|
4013
4045
|
label,
|
4046
|
+
labelIcon,
|
4014
4047
|
Label: Label2,
|
4015
4048
|
id: resolvedId
|
4016
4049
|
});
|
@@ -4073,10 +4106,13 @@ function AutoFieldPrivate(props) {
|
|
4073
4106
|
const isFocused = useAppStore((s) => s.state.ui.field.focus === props.name);
|
4074
4107
|
const { value, onChange } = props;
|
4075
4108
|
const [localValue, setLocalValue] = (0, import_react24.useState)(value);
|
4076
|
-
const onChangeLocal = (0, import_react24.useCallback)(
|
4077
|
-
|
4078
|
-
|
4079
|
-
|
4109
|
+
const onChangeLocal = (0, import_react24.useCallback)(
|
4110
|
+
(val, ui) => {
|
4111
|
+
setLocalValue(val);
|
4112
|
+
onChange(val, ui);
|
4113
|
+
},
|
4114
|
+
[onChange]
|
4115
|
+
);
|
4080
4116
|
(0, import_react24.useEffect)(() => {
|
4081
4117
|
if (!isFocused) {
|
4082
4118
|
setLocalValue(value);
|
@@ -5554,7 +5590,7 @@ var DragDropContextClient = ({
|
|
5554
5590
|
const resolveData2 = useAppStore((s) => s.resolveData);
|
5555
5591
|
const metadata = useAppStore((s) => s.metadata);
|
5556
5592
|
const appStore = useAppStoreApi();
|
5557
|
-
const id = (
|
5593
|
+
const id = useSafeId();
|
5558
5594
|
const debouncedParamsRef = (0, import_react36.useRef)(null);
|
5559
5595
|
const tempDisableFallback = useTempDisableFallback(100);
|
5560
5596
|
const [zoneStore] = (0, import_react36.useState)(
|
@@ -6008,7 +6044,7 @@ var Drawer = ({
|
|
6008
6044
|
"Warning: The `direction` prop on Drawer is deprecated and no longer required to achieve multi-directional dragging."
|
6009
6045
|
);
|
6010
6046
|
}
|
6011
|
-
const id = (
|
6047
|
+
const id = useSafeId();
|
6012
6048
|
const { ref } = useDroppableSafe({
|
6013
6049
|
id,
|
6014
6050
|
type: "void",
|