@rebasepro/cms 0.21.1 → 0.22.0
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/{CollectionEditorDialog-DPLimWfL.js → CollectionEditorDialog-CUtfS_49.js} +3 -3
- package/dist/{CollectionEditorDialog-DPLimWfL.js.map → CollectionEditorDialog-CUtfS_49.js.map} +1 -1
- package/dist/{PropertyEditView-D85vuYZu.js → PropertyEditView-BpEbC0Q2.js} +2 -2
- package/dist/{PropertyEditView-D85vuYZu.js.map → PropertyEditView-BpEbC0Q2.js.map} +1 -1
- package/dist/{RouterCollectionsStudioView-C1BseTGZ.js → RouterCollectionsStudioView-EK8Knq5I.js} +4 -4
- package/dist/{RouterCollectionsStudioView-C1BseTGZ.js.map → RouterCollectionsStudioView-EK8Knq5I.js.map} +1 -1
- package/dist/collection_editor_ui.js +4 -4
- package/dist/components/EntityIdentityBar.d.ts +11 -0
- package/dist/components/PropertyKeyHint.d.ts +25 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/{export-CrKQwyBM.js → export-LvIpE7sE.js} +3 -3
- package/dist/export-LvIpE7sE.js.map +1 -0
- package/dist/form/components/LabelWithIcon.d.ts +7 -0
- package/dist/form/components/index.d.ts +0 -1
- package/dist/{history-DH4h_T1U.js → history-DG6Ln7CV.js} +2 -2
- package/dist/{history-DH4h_T1U.js.map → history-DG6Ln7CV.js.map} +1 -1
- package/dist/{import-Ct2FFEEj.js → import-Cxnmpyjl.js} +2 -2
- package/dist/{import-Ct2FFEEj.js.map → import-Cxnmpyjl.js.map} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -8
- package/dist/index.js.map +1 -1
- package/dist/{util-jUWinb7D.js → util-CyIcgnv2.js} +544 -460
- package/dist/util-CyIcgnv2.js.map +1 -0
- package/package.json +9 -9
- package/dist/components/PropertyIdCopyTooltip.d.ts +0 -8
- package/dist/export-CrKQwyBM.js.map +0 -1
- package/dist/form/components/LabelWithIconAndTooltip.d.ts +0 -15
- package/dist/util-jUWinb7D.js.map +0 -1
|
@@ -156,41 +156,53 @@ function getDefaultPropertiesOrder(collection) {
|
|
|
156
156
|
return [...Object.keys(collection.properties), ...(collection.additionalFields ?? []).map((field) => field.key)];
|
|
157
157
|
}
|
|
158
158
|
//#endregion
|
|
159
|
-
//#region src/components/
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
159
|
+
//#region src/components/PropertyKeyHint.tsx
|
|
160
|
+
/**
|
|
161
|
+
* A property's key, shown beside its label while the label is hovered, and
|
|
162
|
+
* copied when clicked.
|
|
163
|
+
*
|
|
164
|
+
* Inline, in the label row's own empty space, rather than a tooltip. The tooltip
|
|
165
|
+
* this replaces wrapped the field's control as well as its label, so it opened
|
|
166
|
+
* the moment a field took focus and sat on top of the label of the very field
|
|
167
|
+
* being filled in. Closing again on blur, it was also what threw Tab out of the
|
|
168
|
+
* dialog (see `useRestoreInterruptedFocus` in `@rebasepro/ui`). A key a
|
|
169
|
+
* developer copies now and then is not worth a layer over the form.
|
|
170
|
+
*
|
|
171
|
+
* Revealed by hovering the nearest `group/label` ancestor, after a pause, so a
|
|
172
|
+
* pointer crossing the form does not flicker keys on and off; hidden again at
|
|
173
|
+
* once. Out of the tab order: a stop per field would double the keystrokes it
|
|
174
|
+
* takes to get through a form, for something only the pointer needs.
|
|
175
|
+
*
|
|
176
|
+
* Gives up its width before the label does (`shrink-[999]`), so a long field
|
|
177
|
+
* name in a narrow column is never truncated to make room for a key that is not
|
|
178
|
+
* even showing.
|
|
179
|
+
*/
|
|
180
|
+
function PropertyKeyHint({ propertyKey, className }) {
|
|
181
|
+
const { t } = useTranslation();
|
|
172
182
|
const [copied, setCopied] = useState(false);
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
183
|
+
const copy = (event) => {
|
|
184
|
+
event.preventDefault();
|
|
185
|
+
event.stopPropagation();
|
|
186
|
+
navigator.clipboard?.writeText(propertyKey).then(() => {
|
|
187
|
+
setCopied(true);
|
|
188
|
+
setTimeout(() => setCopied(false), 1600);
|
|
189
|
+
}, () => void 0);
|
|
190
|
+
};
|
|
191
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
192
|
+
type: "button",
|
|
193
|
+
tabIndex: -1,
|
|
194
|
+
onClick: copy,
|
|
195
|
+
"aria-label": `${t("copy")} ${propertyKey}`,
|
|
196
|
+
className: cls("inline-flex items-center gap-1 min-w-0 shrink-[999] px-1 -my-0.5 rounded-md", "font-mono text-[11px] font-normal leading-tight", "text-text-disabled dark:text-text-disabled-dark", "hover:text-text-secondary dark:hover:text-text-secondary-dark hover:bg-surface-hover", "opacity-0 transition-opacity duration-150 group-hover/label:opacity-100 group-hover/label:delay-500", className),
|
|
197
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
198
|
+
className: "truncate",
|
|
199
|
+
children: propertyKey
|
|
200
|
+
}), copied ? /* @__PURE__ */ jsx(CheckIcon, {
|
|
201
|
+
size: 11,
|
|
202
|
+
className: "shrink-0"
|
|
203
|
+
}) : /* @__PURE__ */ jsx(CopyIcon, {
|
|
204
|
+
size: 11,
|
|
205
|
+
className: "shrink-0"
|
|
194
206
|
})]
|
|
195
207
|
});
|
|
196
208
|
}
|
|
@@ -273,25 +285,23 @@ function FieldBlock({ propertyKey, property, showLabel, mode = "edit", label, ic
|
|
|
273
285
|
id: `form_field_${propertyKey}`,
|
|
274
286
|
className: "relative flex flex-col min-w-0",
|
|
275
287
|
children: [
|
|
276
|
-
showLabel && /* @__PURE__ */
|
|
277
|
-
|
|
278
|
-
children:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
(property
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
]
|
|
294
|
-
})
|
|
288
|
+
showLabel && /* @__PURE__ */ jsxs("div", {
|
|
289
|
+
className: cls("group/label flex items-center gap-1.5 min-w-0 font-medium leading-tight mb-1.5", "text-[13px] text-text-primary dark:text-text-primary-dark"),
|
|
290
|
+
children: [
|
|
291
|
+
(property || icon) && /* @__PURE__ */ jsx("span", {
|
|
292
|
+
className: "shrink-0 text-text-disabled dark:text-text-disabled-dark",
|
|
293
|
+
children: property ? getIconForProperty(property, 14) : icon
|
|
294
|
+
}),
|
|
295
|
+
/* @__PURE__ */ jsx("span", {
|
|
296
|
+
className: "truncate",
|
|
297
|
+
children: property?.name ?? label ?? propertyKey
|
|
298
|
+
}),
|
|
299
|
+
required && /* @__PURE__ */ jsx("span", {
|
|
300
|
+
className: "text-red-500 dark:text-red-500 -ml-1",
|
|
301
|
+
children: "*"
|
|
302
|
+
}),
|
|
303
|
+
property && /* @__PURE__ */ jsx(PropertyKeyHint, { propertyKey })
|
|
304
|
+
]
|
|
295
305
|
}),
|
|
296
306
|
/* @__PURE__ */ jsx("div", {
|
|
297
307
|
className: "min-w-0",
|
|
@@ -3484,32 +3494,23 @@ function FieldHelperText({ error, showError, property, includeDescription = true
|
|
|
3484
3494
|
* Render the label of with an icon and the title of a property
|
|
3485
3495
|
* @group Form custom fields
|
|
3486
3496
|
*/
|
|
3487
|
-
var LabelWithIcon = forwardRef(({ icon, title, small, className, required, labelId }, ref) => {
|
|
3497
|
+
var LabelWithIcon = forwardRef(({ icon, title, small, className, required, labelId, propertyKey }, ref) => {
|
|
3488
3498
|
return /* @__PURE__ */ jsxs("div", {
|
|
3489
3499
|
ref,
|
|
3490
|
-
className: cls("align-middle inline-flex items-center my-0.5", small ? "gap-1" : "gap-2", className),
|
|
3491
|
-
children: [
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3500
|
+
className: cls("group/label align-middle inline-flex items-center min-w-0 my-0.5", small ? "gap-1" : "gap-2", className),
|
|
3501
|
+
children: [
|
|
3502
|
+
icon,
|
|
3503
|
+
/* @__PURE__ */ jsx("span", {
|
|
3504
|
+
id: labelId,
|
|
3505
|
+
className: `text-start font-medium text-${small ? "base" : "sm"} origin-top-left transform ${small ? "translate-x-2 scale-75" : ""}`,
|
|
3506
|
+
children: (title ?? "") + (required ? " *" : "")
|
|
3507
|
+
}),
|
|
3508
|
+
propertyKey && /* @__PURE__ */ jsx(PropertyKeyHint, { propertyKey })
|
|
3509
|
+
]
|
|
3496
3510
|
});
|
|
3497
3511
|
});
|
|
3498
3512
|
LabelWithIcon.displayName = "LabelWithIcon";
|
|
3499
3513
|
//#endregion
|
|
3500
|
-
//#region src/form/components/LabelWithIconAndTooltip.tsx
|
|
3501
|
-
/**
|
|
3502
|
-
* Render the label of with an icon and the title of a property
|
|
3503
|
-
* @group Form custom fields
|
|
3504
|
-
*/
|
|
3505
|
-
function LabelWithIconAndTooltip({ propertyKey, className, ...props }) {
|
|
3506
|
-
return /* @__PURE__ */ jsx(PropertyIdCopyTooltip, {
|
|
3507
|
-
propertyKey,
|
|
3508
|
-
className,
|
|
3509
|
-
children: /* @__PURE__ */ jsx(LabelWithIcon, { ...props })
|
|
3510
|
-
});
|
|
3511
|
-
}
|
|
3512
|
-
//#endregion
|
|
3513
3514
|
//#region src/form/field_bindings/ReadOnlyFieldBinding.tsx
|
|
3514
3515
|
/**
|
|
3515
3516
|
*
|
|
@@ -3522,7 +3523,7 @@ function LabelWithIconAndTooltip({ propertyKey, className, ...props }) {
|
|
|
3522
3523
|
function ReadOnlyFieldBinding({ propertyKey, value, error, showError, minimalistView, property, includeDescription, hideLabel, context, size = "large" }) {
|
|
3523
3524
|
const skipCardWrapper = property.type === "relation" || property.type === "reference";
|
|
3524
3525
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3525
|
-
!minimalistView && !hideLabel && /* @__PURE__ */ jsx(
|
|
3526
|
+
!minimalistView && !hideLabel && /* @__PURE__ */ jsx(LabelWithIcon, {
|
|
3526
3527
|
propertyKey,
|
|
3527
3528
|
icon: getIconForProperty(property, "small"),
|
|
3528
3529
|
required: property.validation?.required,
|
|
@@ -3599,7 +3600,7 @@ function ArrayCustomShapedFieldBinding({ propertyKey, value, error, showError, i
|
|
|
3599
3600
|
value,
|
|
3600
3601
|
setValue
|
|
3601
3602
|
});
|
|
3602
|
-
const title = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(
|
|
3603
|
+
const title = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(LabelWithIcon, {
|
|
3603
3604
|
propertyKey,
|
|
3604
3605
|
icon: getIconForProperty(property, "small"),
|
|
3605
3606
|
required: property.validation?.required,
|
|
@@ -6284,10 +6285,24 @@ var CollectionRowActions = function CollectionRowActions({ entity, collection, p
|
|
|
6284
6285
|
const context = useAdminContext();
|
|
6285
6286
|
const sidePanelCtrl = context.sidePanelController;
|
|
6286
6287
|
const { t } = useTranslation();
|
|
6288
|
+
const slotActions = useSlot("entity.row.actions", React.useMemo(() => ({
|
|
6289
|
+
entity,
|
|
6290
|
+
entityId: entity.id,
|
|
6291
|
+
path,
|
|
6292
|
+
collection,
|
|
6293
|
+
selectionController,
|
|
6294
|
+
context
|
|
6295
|
+
}), [
|
|
6296
|
+
entity,
|
|
6297
|
+
path,
|
|
6298
|
+
collection,
|
|
6299
|
+
selectionController,
|
|
6300
|
+
context
|
|
6301
|
+
]));
|
|
6287
6302
|
const onCheckedChange = useCallback((checked) => {
|
|
6288
6303
|
selectionController?.toggleEntitySelection(entity, checked);
|
|
6289
6304
|
}, [entity, selectionController?.toggleEntitySelection]);
|
|
6290
|
-
const hasActions = actions.length > 0;
|
|
6305
|
+
const hasActions = actions.length > 0 || slotActions.length > 0;
|
|
6291
6306
|
const hasCollapsedActions = actions.some((a) => a.collapsed || a.collapsed === void 0);
|
|
6292
6307
|
const collapsedActions = actions.filter((a) => a.collapsed || a.collapsed === void 0);
|
|
6293
6308
|
const uncollapsedActions = actions.filter((a) => a.collapsed === false);
|
|
@@ -6340,6 +6355,7 @@ var CollectionRowActions = function CollectionRowActions({ entity, collection, p
|
|
|
6340
6355
|
children: iconButton
|
|
6341
6356
|
}, index);
|
|
6342
6357
|
}),
|
|
6358
|
+
slotActions,
|
|
6343
6359
|
hasCollapsedActions && /* @__PURE__ */ jsx(Menu, {
|
|
6344
6360
|
trigger: /* @__PURE__ */ jsx(IconButton, {
|
|
6345
6361
|
size: iconSize,
|
|
@@ -8902,6 +8918,21 @@ function loadXlsxReader() {
|
|
|
8902
8918
|
return xlsxReader;
|
|
8903
8919
|
}
|
|
8904
8920
|
/**
|
|
8921
|
+
* Put a date the reader left a millisecond short back on its second.
|
|
8922
|
+
*
|
|
8923
|
+
* `read-excel-file` turns Excel's date serials (fractional days) into
|
|
8924
|
+
* milliseconds with `Math.floor`, and the fraction is rarely exact in floating
|
|
8925
|
+
* point: a time of 12:30:00 arrives as 12:29:59.999, and a field that shows
|
|
8926
|
+
* minutes displays 12:29. A date within a millisecond of a whole second is put
|
|
8927
|
+
* back on it; a genuine sub-second value is left alone.
|
|
8928
|
+
*/
|
|
8929
|
+
function snapToSecond(cell) {
|
|
8930
|
+
if (!(cell instanceof Date)) return cell;
|
|
8931
|
+
const time = cell.getTime();
|
|
8932
|
+
const second = Math.round(time / 1e3) * 1e3;
|
|
8933
|
+
return Math.abs(time - second) <= 1 ? new Date(second) : cell;
|
|
8934
|
+
}
|
|
8935
|
+
/**
|
|
8905
8936
|
* Whether this file is delimited text rather than a workbook.
|
|
8906
8937
|
*
|
|
8907
8938
|
* Browsers report `text/csv`, `application/csv` or nothing at all for the same
|
|
@@ -8999,7 +9030,7 @@ function convertFileToJson(file) {
|
|
|
8999
9030
|
row.forEach((cell, index) => {
|
|
9000
9031
|
if (cell === null || cell === void 0) return;
|
|
9001
9032
|
const header = headers.byColumn.get(index);
|
|
9002
|
-
if (header && !isPrototypePollutingKey(header)) obj[header] = cell;
|
|
9033
|
+
if (header && !isPrototypePollutingKey(header)) obj[header] = snapToSecond(cell);
|
|
9003
9034
|
});
|
|
9004
9035
|
parsedData.push(obj);
|
|
9005
9036
|
}
|
|
@@ -9895,8 +9926,8 @@ function EditorCollectionAction({ path, parentCollectionSlugs, parentEntityIds,
|
|
|
9895
9926
|
}
|
|
9896
9927
|
//#endregion
|
|
9897
9928
|
//#region src/components/CollectionViewBinding/CollectionViewActions.tsx
|
|
9898
|
-
var ImportCollectionAction = lazyChunk(() => import("./import-
|
|
9899
|
-
var ExportCollectionAction = lazyChunk(() => import("./export-
|
|
9929
|
+
var ImportCollectionAction = lazyChunk(() => import("./import-Cxnmpyjl.js").then((n) => n.t).then((m) => ({ default: m.ImportCollectionAction })));
|
|
9930
|
+
var ExportCollectionAction = lazyChunk(() => import("./export-LvIpE7sE.js").then((n) => n.t).then((m) => ({ default: m.ExportCollectionAction })));
|
|
9900
9931
|
function CollectionViewActions({ collection, relativePath, parentCollectionSlugs, parentEntityIds, onNewClick, onAddExistingClick, onMultipleDeleteClick, selectionEnabled, path, selectionController, tableController, collectionEntitiesCount, compact, children, openNewDocument }) {
|
|
9901
9932
|
const context = useAdminContext();
|
|
9902
9933
|
const { canCreate, canDelete } = usePermissions();
|
|
@@ -11983,12 +12014,7 @@ function EntityViewBinding({ entity, collection, className, asPage = false, open
|
|
|
11983
12014
|
*/
|
|
11984
12015
|
function EntityIdentityBar({ collection, collectionUrl, title, entityId, status, dirty, saving, onSave, onDiscard, saveDisabled, hasErrors, onSaveAndClose, saveAndClosePlacement = "button", onClose, onBack, onInspect, onViewHistory, externalLink, recordActions, pluginActions, trailing, leading }) {
|
|
11985
12016
|
const { t } = useTranslation();
|
|
11986
|
-
const saveLabel = status === "existing" ? t("save") : status === "copy" ? t("create_copy") : t("create");
|
|
11987
|
-
const closeLabel = status === "existing" ? t("save_and_close") : status === "copy" ? t("create_copy_and_close") : t("create_and_close");
|
|
11988
12017
|
const hasMenu = Boolean(recordActions) || Boolean(onInspect) || Boolean(onViewHistory) || Boolean(externalLink);
|
|
11989
|
-
const saveAndCloseButton = Boolean(onSaveAndClose) && saveAndClosePlacement === "button";
|
|
11990
|
-
const saveAndCloseMenu = Boolean(onSaveAndClose) && saveAndClosePlacement === "menu";
|
|
11991
|
-
const saveTooltip = hasErrors ? t("fix_errors_before_saving") ?? "Fix highlighted errors before saving" : void 0;
|
|
11992
12018
|
return /* @__PURE__ */ jsxs("div", {
|
|
11993
12019
|
className: cls("h-[52px] shrink-0 flex items-center gap-2 pl-1.5 pr-2", "bg-surface-sheet"),
|
|
11994
12020
|
children: [
|
|
@@ -12022,59 +12048,17 @@ function EntityIdentityBar({ collection, collectionUrl, title, entityId, status,
|
|
|
12022
12048
|
}),
|
|
12023
12049
|
entityId !== void 0 && /* @__PURE__ */ jsx(IdChip, { value: String(entityId) }),
|
|
12024
12050
|
/* @__PURE__ */ jsx("div", { className: "flex-1" }),
|
|
12025
|
-
|
|
12051
|
+
pluginActions,
|
|
12052
|
+
/* @__PURE__ */ jsx(EntitySaveActions, {
|
|
12053
|
+
status,
|
|
12026
12054
|
dirty,
|
|
12027
12055
|
saving,
|
|
12028
|
-
|
|
12029
|
-
|
|
12030
|
-
|
|
12031
|
-
|
|
12032
|
-
|
|
12033
|
-
|
|
12034
|
-
size: "small",
|
|
12035
|
-
onClick: onDiscard,
|
|
12036
|
-
children: status === "existing" ? t("discard") : t("clear")
|
|
12037
|
-
}),
|
|
12038
|
-
onSave && /* @__PURE__ */ jsxs("div", {
|
|
12039
|
-
className: "flex items-stretch rounded-lg overflow-hidden",
|
|
12040
|
-
children: [/* @__PURE__ */ jsx(Tooltip, {
|
|
12041
|
-
title: saveTooltip,
|
|
12042
|
-
children: /* @__PURE__ */ jsx(LoadingButton, {
|
|
12043
|
-
variant: saveAndCloseButton ? "text" : "filled",
|
|
12044
|
-
color: "primary",
|
|
12045
|
-
size: "small",
|
|
12046
|
-
loading: saving && !saveAndCloseButton,
|
|
12047
|
-
disabled: saveDisabled,
|
|
12048
|
-
onClick: onSave,
|
|
12049
|
-
className: saveAndCloseMenu ? "rounded-none" : void 0,
|
|
12050
|
-
children: saveLabel
|
|
12051
|
-
})
|
|
12052
|
-
}), saveAndCloseMenu && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Menu, {
|
|
12053
|
-
align: "end",
|
|
12054
|
-
trigger: /* @__PURE__ */ jsx(Button, {
|
|
12055
|
-
variant: "filled",
|
|
12056
|
-
color: "primary",
|
|
12057
|
-
size: "small",
|
|
12058
|
-
disabled: saveDisabled,
|
|
12059
|
-
"aria-label": closeLabel,
|
|
12060
|
-
style: { borderLeftColor: "color-mix(in oklab, currentColor 15%, transparent)" },
|
|
12061
|
-
className: "rounded-none px-1.5",
|
|
12062
|
-
children: /* @__PURE__ */ jsx(ChevronDownIcon, { size: iconSize.smallest })
|
|
12063
|
-
}),
|
|
12064
|
-
children: /* @__PURE__ */ jsxs(MenuItem, {
|
|
12065
|
-
onClick: onSaveAndClose,
|
|
12066
|
-
children: [/* @__PURE__ */ jsx(CheckIcon, { size: iconSize.smallest }), closeLabel]
|
|
12067
|
-
})
|
|
12068
|
-
}) })]
|
|
12069
|
-
}),
|
|
12070
|
-
saveAndCloseButton && /* @__PURE__ */ jsx(LoadingButton, {
|
|
12071
|
-
variant: "filled",
|
|
12072
|
-
color: "primary",
|
|
12073
|
-
size: "small",
|
|
12074
|
-
loading: saving,
|
|
12075
|
-
disabled: saveDisabled,
|
|
12076
|
-
onClick: onSaveAndClose,
|
|
12077
|
-
children: closeLabel
|
|
12056
|
+
onSave,
|
|
12057
|
+
onDiscard,
|
|
12058
|
+
saveDisabled,
|
|
12059
|
+
hasErrors,
|
|
12060
|
+
onSaveAndClose,
|
|
12061
|
+
saveAndClosePlacement
|
|
12078
12062
|
}),
|
|
12079
12063
|
hasMenu && /* @__PURE__ */ jsxs(Menu, {
|
|
12080
12064
|
align: "end",
|
|
@@ -12116,6 +12100,78 @@ function EntityIdentityBar({ collection, collectionUrl, title, entityId, status,
|
|
|
12116
12100
|
});
|
|
12117
12101
|
}
|
|
12118
12102
|
/**
|
|
12103
|
+
* Save, "save and close", Discard, and the words saying where the edit stands.
|
|
12104
|
+
*
|
|
12105
|
+
* Its own component because it has two homes. On a page and in the side panel
|
|
12106
|
+
* it sits in the identity bar, where it stays in view while the form scrolls. In
|
|
12107
|
+
* the dialog it sits in a footer under the form: a dialog is read top to bottom
|
|
12108
|
+
* and finished at the bottom, where every other dialog in the app keeps its
|
|
12109
|
+
* buttons, and the bar at its top is left to say what the record is.
|
|
12110
|
+
*/
|
|
12111
|
+
function EntitySaveActions({ status, dirty, saving, onSave, onDiscard, saveDisabled, hasErrors, onSaveAndClose, saveAndClosePlacement = "button" }) {
|
|
12112
|
+
const { t } = useTranslation();
|
|
12113
|
+
const saveLabel = status === "existing" ? t("save") : status === "copy" ? t("create_copy") : t("create");
|
|
12114
|
+
const closeLabel = status === "existing" ? t("save_and_close") : status === "copy" ? t("create_copy_and_close") : t("create_and_close");
|
|
12115
|
+
const saveAndCloseButton = Boolean(onSaveAndClose) && saveAndClosePlacement === "button";
|
|
12116
|
+
const saveAndCloseMenu = Boolean(onSaveAndClose) && saveAndClosePlacement === "menu";
|
|
12117
|
+
const saveTooltip = hasErrors ? t("fix_errors_before_saving") ?? "Fix highlighted errors before saving" : void 0;
|
|
12118
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12119
|
+
onSave && /* @__PURE__ */ jsx(SaveState, {
|
|
12120
|
+
dirty,
|
|
12121
|
+
saving,
|
|
12122
|
+
status,
|
|
12123
|
+
t
|
|
12124
|
+
}),
|
|
12125
|
+
onDiscard && dirty && !saving && /* @__PURE__ */ jsx(Button, {
|
|
12126
|
+
variant: "text",
|
|
12127
|
+
size: "small",
|
|
12128
|
+
onClick: onDiscard,
|
|
12129
|
+
children: status === "existing" ? t("discard") : t("clear")
|
|
12130
|
+
}),
|
|
12131
|
+
onSave && /* @__PURE__ */ jsxs("div", {
|
|
12132
|
+
className: "flex items-stretch rounded-lg overflow-hidden",
|
|
12133
|
+
children: [/* @__PURE__ */ jsx(Tooltip, {
|
|
12134
|
+
title: saveTooltip,
|
|
12135
|
+
children: /* @__PURE__ */ jsx(LoadingButton, {
|
|
12136
|
+
variant: saveAndCloseButton ? "text" : "filled",
|
|
12137
|
+
color: "primary",
|
|
12138
|
+
size: "small",
|
|
12139
|
+
loading: saving && !saveAndCloseButton,
|
|
12140
|
+
disabled: saveDisabled,
|
|
12141
|
+
onClick: onSave,
|
|
12142
|
+
className: saveAndCloseMenu ? "rounded-none" : void 0,
|
|
12143
|
+
children: saveLabel
|
|
12144
|
+
})
|
|
12145
|
+
}), saveAndCloseMenu && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Menu, {
|
|
12146
|
+
align: "end",
|
|
12147
|
+
trigger: /* @__PURE__ */ jsx(Button, {
|
|
12148
|
+
variant: "filled",
|
|
12149
|
+
color: "primary",
|
|
12150
|
+
size: "small",
|
|
12151
|
+
disabled: saveDisabled,
|
|
12152
|
+
"aria-label": closeLabel,
|
|
12153
|
+
style: { borderLeftColor: "color-mix(in oklab, currentColor 15%, transparent)" },
|
|
12154
|
+
className: "rounded-none px-1.5",
|
|
12155
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { size: iconSize.smallest })
|
|
12156
|
+
}),
|
|
12157
|
+
children: /* @__PURE__ */ jsxs(MenuItem, {
|
|
12158
|
+
onClick: onSaveAndClose,
|
|
12159
|
+
children: [/* @__PURE__ */ jsx(CheckIcon, { size: iconSize.smallest }), closeLabel]
|
|
12160
|
+
})
|
|
12161
|
+
}) })]
|
|
12162
|
+
}),
|
|
12163
|
+
saveAndCloseButton && /* @__PURE__ */ jsx(LoadingButton, {
|
|
12164
|
+
variant: "filled",
|
|
12165
|
+
color: "primary",
|
|
12166
|
+
size: "small",
|
|
12167
|
+
loading: saving,
|
|
12168
|
+
disabled: saveDisabled,
|
|
12169
|
+
onClick: onSaveAndClose,
|
|
12170
|
+
children: closeLabel
|
|
12171
|
+
})
|
|
12172
|
+
] });
|
|
12173
|
+
}
|
|
12174
|
+
/**
|
|
12119
12175
|
* The words the unlabelled floating circle never said.
|
|
12120
12176
|
*
|
|
12121
12177
|
* That indicator was a ✓ / pencil / spinner chip stuck to the top-right of the
|
|
@@ -12232,7 +12288,7 @@ function SplitListShowButton({ onClick }) {
|
|
|
12232
12288
|
}
|
|
12233
12289
|
//#endregion
|
|
12234
12290
|
//#region src/components/EntityInspector.tsx
|
|
12235
|
-
var EntityHistoryView = lazyChunk(() => import("./history-
|
|
12291
|
+
var EntityHistoryView = lazyChunk(() => import("./history-DG6Ln7CV.js").then((m) => ({ default: m.EntityHistoryView })));
|
|
12236
12292
|
/**
|
|
12237
12293
|
* The JSON tab pulls `prism-react-renderer` — 85 kB, and it was EAGER.
|
|
12238
12294
|
*
|
|
@@ -18185,6 +18241,34 @@ function EditViewBindingInner({ path, entityId, selectedTab: selectedTabProp, co
|
|
|
18185
18241
|
})
|
|
18186
18242
|
}, `entity_detail_collection_tab_${view.name}`);
|
|
18187
18243
|
});
|
|
18244
|
+
const onSave = formActionsContext ? () => {
|
|
18245
|
+
sideDialogContext.setPendingClose?.(false);
|
|
18246
|
+
pendingCloseRef.current = false;
|
|
18247
|
+
formActionsContext.submit();
|
|
18248
|
+
} : void 0;
|
|
18249
|
+
const onSaveAndClose = formActionsContext && canCloseAfterSave ? () => {
|
|
18250
|
+
if (layout === "split") {
|
|
18251
|
+
pendingCloseRef.current = true;
|
|
18252
|
+
Promise.resolve(formActionsContext.submit()).finally(() => {
|
|
18253
|
+
pendingCloseRef.current = false;
|
|
18254
|
+
});
|
|
18255
|
+
return;
|
|
18256
|
+
}
|
|
18257
|
+
sideDialogContext.setPendingClose?.(true);
|
|
18258
|
+
Promise.resolve(formActionsContext.submit()).finally(() => sideDialogContext.setPendingClose?.(false));
|
|
18259
|
+
} : void 0;
|
|
18260
|
+
const onDiscard = formActionsContext ? () => discard(formActionsContext.formex, status) : void 0;
|
|
18261
|
+
/**
|
|
18262
|
+
* The dialog keeps Save at its foot, not in the bar.
|
|
18263
|
+
*
|
|
18264
|
+
* A dialog is filled in top to bottom and finished at the bottom, which is
|
|
18265
|
+
* where every other dialog in the app puts its buttons; up in the bar's
|
|
18266
|
+
* right-hand corner, Create was the one thing on screen the eye had to
|
|
18267
|
+
* travel back up to reach. The bar keeps what the record is and the ways
|
|
18268
|
+
* out of it. The side panel and the pages keep Save in the bar, where it
|
|
18269
|
+
* stays in view while a long form scrolls.
|
|
18270
|
+
*/
|
|
18271
|
+
const actionsInFooter = layout === "dialog";
|
|
18188
18272
|
const fullScreenButton = !barActions && (layout === "side_panel" || layout === "dialog") && entityId ? /* @__PURE__ */ jsx(Tooltip, {
|
|
18189
18273
|
title: "Open full screen",
|
|
18190
18274
|
children: /* @__PURE__ */ jsx(IconButton, {
|
|
@@ -18212,25 +18296,11 @@ function EditViewBindingInner({ path, entityId, selectedTab: selectedTabProp, co
|
|
|
18212
18296
|
hasErrors: hasFormErrors,
|
|
18213
18297
|
saveDisabled: !canEdit || saveDisabled,
|
|
18214
18298
|
onBack: layout === "full_screen" && !onShowList ? () => navigate(withListState(urlController.buildUrlCollectionPath(path))) : void 0,
|
|
18215
|
-
onSave:
|
|
18216
|
-
|
|
18217
|
-
pendingCloseRef.current = false;
|
|
18218
|
-
formActionsContext.submit();
|
|
18219
|
-
} : void 0,
|
|
18220
|
-
onSaveAndClose: formActionsContext && canCloseAfterSave ? () => {
|
|
18221
|
-
if (layout === "split") {
|
|
18222
|
-
pendingCloseRef.current = true;
|
|
18223
|
-
Promise.resolve(formActionsContext.submit()).finally(() => {
|
|
18224
|
-
pendingCloseRef.current = false;
|
|
18225
|
-
});
|
|
18226
|
-
return;
|
|
18227
|
-
}
|
|
18228
|
-
sideDialogContext.setPendingClose?.(true);
|
|
18229
|
-
Promise.resolve(formActionsContext.submit()).finally(() => sideDialogContext.setPendingClose?.(false));
|
|
18230
|
-
} : void 0,
|
|
18299
|
+
onSave: actionsInFooter ? void 0 : onSave,
|
|
18300
|
+
onSaveAndClose: actionsInFooter ? void 0 : onSaveAndClose,
|
|
18231
18301
|
saveAndClosePlacement: layout === "split" ? "menu" : "button",
|
|
18232
18302
|
onClose: onCloseRequest,
|
|
18233
|
-
onDiscard:
|
|
18303
|
+
onDiscard: actionsInFooter ? void 0 : onDiscard,
|
|
18234
18304
|
onInspect: includeJsonView ? () => setInspectorTab("json") : void 0,
|
|
18235
18305
|
onViewHistory: includeHistoryView ? () => setInspectorTab("history") : void 0,
|
|
18236
18306
|
externalLink: usedEntity ? customizationController?.entityLinkBuilder?.({ entity: usedEntity }) : void 0,
|
|
@@ -18302,6 +18372,19 @@ function EditViewBindingInner({ path, entityId, selectedTab: selectedTabProp, co
|
|
|
18302
18372
|
refreshToken: savedCount,
|
|
18303
18373
|
includeHistory: includeHistoryView
|
|
18304
18374
|
})]
|
|
18375
|
+
}),
|
|
18376
|
+
actionsInFooter && onSave && /* @__PURE__ */ jsx(DialogActions, {
|
|
18377
|
+
translucent: false,
|
|
18378
|
+
children: /* @__PURE__ */ jsx(EntitySaveActions, {
|
|
18379
|
+
status,
|
|
18380
|
+
dirty: Boolean(formContext?.formex?.dirty),
|
|
18381
|
+
saving: Boolean(formContext?.isSaving),
|
|
18382
|
+
hasErrors: hasFormErrors,
|
|
18383
|
+
saveDisabled: !canEdit || saveDisabled,
|
|
18384
|
+
onSave,
|
|
18385
|
+
onSaveAndClose,
|
|
18386
|
+
onDiscard
|
|
18387
|
+
})
|
|
18305
18388
|
})
|
|
18306
18389
|
]
|
|
18307
18390
|
});
|
|
@@ -20394,7 +20477,7 @@ function ArrayOfReferencesFieldBinding({ propertyKey, value, error, showError, d
|
|
|
20394
20477
|
ofProperty.admin?.previewProperties,
|
|
20395
20478
|
value
|
|
20396
20479
|
]);
|
|
20397
|
-
const title = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(
|
|
20480
|
+
const title = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(LabelWithIcon, {
|
|
20398
20481
|
propertyKey,
|
|
20399
20482
|
icon: getIconForProperty(property, "small"),
|
|
20400
20483
|
required: property.validation?.required,
|
|
@@ -20486,7 +20569,7 @@ function BlockFieldBinding({ propertyKey, value, error, showError, isSubmitting,
|
|
|
20486
20569
|
storedProps
|
|
20487
20570
|
}, `array_one_of_${internalId}`);
|
|
20488
20571
|
};
|
|
20489
|
-
const title = /* @__PURE__ */ jsx(
|
|
20572
|
+
const title = /* @__PURE__ */ jsx(LabelWithIcon, {
|
|
20490
20573
|
propertyKey,
|
|
20491
20574
|
icon: getIconForProperty(property, "small"),
|
|
20492
20575
|
required: property.validation?.required,
|
|
@@ -20624,25 +20707,22 @@ function DateTimeFieldBinding({ propertyKey, value, setValue, autoFocus, error,
|
|
|
20624
20707
|
value,
|
|
20625
20708
|
setValue
|
|
20626
20709
|
});
|
|
20627
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(
|
|
20628
|
-
|
|
20629
|
-
|
|
20630
|
-
|
|
20631
|
-
|
|
20632
|
-
|
|
20633
|
-
|
|
20634
|
-
|
|
20635
|
-
|
|
20636
|
-
|
|
20637
|
-
|
|
20638
|
-
|
|
20639
|
-
|
|
20640
|
-
|
|
20641
|
-
|
|
20642
|
-
|
|
20643
|
-
}),
|
|
20644
|
-
"aria-label": hideLabel ? property.name ?? propertyKey : void 0
|
|
20645
|
-
})
|
|
20710
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DateTimeField, {
|
|
20711
|
+
size,
|
|
20712
|
+
value: internalValue,
|
|
20713
|
+
onChange: (dateValue) => setValue(dateValue),
|
|
20714
|
+
mode: property.mode,
|
|
20715
|
+
clearable: property.admin?.clearable,
|
|
20716
|
+
locale,
|
|
20717
|
+
error: showError,
|
|
20718
|
+
disabled,
|
|
20719
|
+
label: hideLabel ? void 0 : /* @__PURE__ */ jsx(LabelWithIcon, {
|
|
20720
|
+
icon: getIconForProperty(property, "small"),
|
|
20721
|
+
required: property.validation?.required,
|
|
20722
|
+
className: showError ? "text-red-500 dark:text-red-500" : "text-text-secondary dark:text-text-secondary-dark",
|
|
20723
|
+
title: property.name ?? propertyKey
|
|
20724
|
+
}),
|
|
20725
|
+
"aria-label": hideLabel ? property.name ?? propertyKey : void 0
|
|
20646
20726
|
}), /* @__PURE__ */ jsx(FieldHelperText, {
|
|
20647
20727
|
includeDescription,
|
|
20648
20728
|
showError,
|
|
@@ -20668,7 +20748,7 @@ function KeyValueFieldBinding({ propertyKey, value, showError, error, disabled,
|
|
|
20668
20748
|
initialValue: getIn(context.formex.initialValues, propertyKey),
|
|
20669
20749
|
fieldName: property.name ?? propertyKey
|
|
20670
20750
|
});
|
|
20671
|
-
const title = /* @__PURE__ */ jsx(
|
|
20751
|
+
const title = /* @__PURE__ */ jsx(LabelWithIcon, {
|
|
20672
20752
|
propertyKey,
|
|
20673
20753
|
icon: getIconForProperty(property, "small"),
|
|
20674
20754
|
required: property.validation?.required,
|
|
@@ -21135,7 +21215,7 @@ function MapFieldBinding({ propertyKey, value, showError, error, disabled, prope
|
|
|
21135
21215
|
} });
|
|
21136
21216
|
},
|
|
21137
21217
|
innerClassName: "px-2 md:px-4 pb-2 md:pb-4 pt-1 md:pt-2 bg-surface-card",
|
|
21138
|
-
title: /* @__PURE__ */ jsx(
|
|
21218
|
+
title: /* @__PURE__ */ jsx(LabelWithIcon, {
|
|
21139
21219
|
propertyKey,
|
|
21140
21220
|
icon: getIconForProperty(property, "small"),
|
|
21141
21221
|
required: property.validation?.required,
|
|
@@ -21304,7 +21384,7 @@ function MarkdownEditorFieldBinding({ property, propertyKey, value, setValue, in
|
|
|
21304
21384
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21305
21385
|
!hideLabel && /* @__PURE__ */ jsx("div", {
|
|
21306
21386
|
className: "flex items-center w-full",
|
|
21307
|
-
children: /* @__PURE__ */ jsx(
|
|
21387
|
+
children: /* @__PURE__ */ jsx(LabelWithIcon, {
|
|
21308
21388
|
propertyKey,
|
|
21309
21389
|
icon: getIconForProperty(property, "small"),
|
|
21310
21390
|
required: property.validation?.required,
|
|
@@ -21390,7 +21470,7 @@ function MultiSelectFieldBinding({ propertyKey, value, setValue, error, showErro
|
|
|
21390
21470
|
value: validValue ? value.map((v) => v?.toString()) : [],
|
|
21391
21471
|
disabled,
|
|
21392
21472
|
modalPopover: true,
|
|
21393
|
-
label: hideLabel ? void 0 : /* @__PURE__ */ jsx(
|
|
21473
|
+
label: hideLabel ? void 0 : /* @__PURE__ */ jsx(LabelWithIcon, {
|
|
21394
21474
|
propertyKey,
|
|
21395
21475
|
icon: getIconForProperty(property, "small"),
|
|
21396
21476
|
required: property.validation?.required,
|
|
@@ -21458,7 +21538,7 @@ function ReferenceFieldBindingInternal({ propertyKey, value, setValue, error, sh
|
|
|
21458
21538
|
referenceDialogController.open();
|
|
21459
21539
|
};
|
|
21460
21540
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21461
|
-
!minimalistView && !hideLabel && /* @__PURE__ */ jsx(
|
|
21541
|
+
!minimalistView && !hideLabel && /* @__PURE__ */ jsx(LabelWithIcon, {
|
|
21462
21542
|
propertyKey,
|
|
21463
21543
|
icon: getIconForProperty(property, "small"),
|
|
21464
21544
|
required: property.validation?.required,
|
|
@@ -21558,7 +21638,7 @@ function RepeatFieldBinding({ propertyKey, value, error, showError, isSubmitting
|
|
|
21558
21638
|
newDefaultEntry: getDefaultValueFor(property.of),
|
|
21559
21639
|
onValueChange: (value) => setFieldValue(propertyKey, value)
|
|
21560
21640
|
});
|
|
21561
|
-
const title = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(
|
|
21641
|
+
const title = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(LabelWithIcon, {
|
|
21562
21642
|
propertyKey,
|
|
21563
21643
|
icon: getIconForProperty(property, "small"),
|
|
21564
21644
|
required: property.validation?.required,
|
|
@@ -21620,14 +21700,12 @@ function SelectFieldBinding({ propertyKey, value, setValue, error, showError, di
|
|
|
21620
21700
|
fullWidth: true,
|
|
21621
21701
|
position: "item-aligned",
|
|
21622
21702
|
inputClassName: cls("w-full"),
|
|
21623
|
-
label: hideLabel ? void 0 : /* @__PURE__ */ jsx(
|
|
21703
|
+
label: hideLabel ? void 0 : /* @__PURE__ */ jsx(LabelWithIcon, {
|
|
21704
|
+
icon: getIconForProperty(property, "small"),
|
|
21705
|
+
required: property.validation?.required,
|
|
21706
|
+
title: property.name ?? propertyKey,
|
|
21624
21707
|
propertyKey,
|
|
21625
|
-
|
|
21626
|
-
icon: getIconForProperty(property, "small"),
|
|
21627
|
-
required: property.validation?.required,
|
|
21628
|
-
title: property.name ?? propertyKey,
|
|
21629
|
-
className: "h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5 my-0"
|
|
21630
|
-
})
|
|
21708
|
+
className: "h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5 my-0"
|
|
21631
21709
|
}),
|
|
21632
21710
|
endAdornment: property.admin?.clearable && !disabled && /* @__PURE__ */ jsx(IconButton, {
|
|
21633
21711
|
size: "small",
|
|
@@ -21728,7 +21806,7 @@ function StorageUploadFieldBinding({ propertyKey, value, setValue, error, showEr
|
|
|
21728
21806
|
setValue
|
|
21729
21807
|
});
|
|
21730
21808
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21731
|
-
!minimalistView && !hideLabel && /* @__PURE__ */ jsx(
|
|
21809
|
+
!minimalistView && !hideLabel && /* @__PURE__ */ jsx(LabelWithIcon, {
|
|
21732
21810
|
propertyKey,
|
|
21733
21811
|
icon: getIconForProperty(property, "small"),
|
|
21734
21812
|
required: property.validation?.required,
|
|
@@ -21968,22 +22046,19 @@ var SwitchFieldBinding = function SwitchFieldBinding({ propertyKey, value, setVa
|
|
|
21968
22046
|
value,
|
|
21969
22047
|
setValue
|
|
21970
22048
|
});
|
|
21971
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(
|
|
21972
|
-
|
|
21973
|
-
|
|
21974
|
-
|
|
21975
|
-
|
|
21976
|
-
|
|
21977
|
-
|
|
21978
|
-
|
|
21979
|
-
|
|
21980
|
-
|
|
21981
|
-
|
|
21982
|
-
|
|
21983
|
-
|
|
21984
|
-
autoFocus,
|
|
21985
|
-
size
|
|
21986
|
-
})
|
|
22049
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BooleanSwitchWithLabel, {
|
|
22050
|
+
value,
|
|
22051
|
+
onValueChange: (v) => setValue(v),
|
|
22052
|
+
error: showError,
|
|
22053
|
+
position: hideLabel ? "start" : void 0,
|
|
22054
|
+
label: hideLabel ? void 0 : /* @__PURE__ */ jsx(LabelWithIcon, {
|
|
22055
|
+
icon: getIconForProperty(property, "small"),
|
|
22056
|
+
required: property.validation?.required,
|
|
22057
|
+
title: property.name ?? propertyKey
|
|
22058
|
+
}),
|
|
22059
|
+
disabled,
|
|
22060
|
+
autoFocus,
|
|
22061
|
+
size
|
|
21987
22062
|
}), /* @__PURE__ */ jsx(FieldHelperText, {
|
|
21988
22063
|
includeDescription,
|
|
21989
22064
|
showError,
|
|
@@ -22040,47 +22115,44 @@ function TextFieldBinding({ propertyKey, value, setValue, error, showError, disa
|
|
|
22040
22115
|
});
|
|
22041
22116
|
const accessibleName = property.name ?? propertyKey;
|
|
22042
22117
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22043
|
-
/* @__PURE__ */
|
|
22044
|
-
|
|
22045
|
-
children:
|
|
22046
|
-
|
|
22047
|
-
|
|
22048
|
-
label
|
|
22049
|
-
className: "pointer-events-none absolute top-1 text-xs font-medium px-3 text-text-secondary dark:text-text-secondary-dark",
|
|
22050
|
-
children: label
|
|
22051
|
-
}),
|
|
22052
|
-
/* @__PURE__ */ jsx(TextareaAutosize, {
|
|
22053
|
-
value: displayValue,
|
|
22054
|
-
onChange,
|
|
22055
|
-
autoFocus,
|
|
22056
|
-
disabled,
|
|
22057
|
-
"aria-label": accessibleName,
|
|
22058
|
-
className: cls("rounded-md resize-none w-full outline-none text-sm bg-transparent min-h-[64px] px-3", label ? "pt-8 pb-2" : "py-2", disabled && "outline-none opacity-50 text-surface-accent-600 dark:text-surface-accent-500", showError && error ? "text-red-500 dark:text-red-600" : "")
|
|
22059
|
-
}),
|
|
22060
|
-
property.admin?.clearable && /* @__PURE__ */ jsx("div", {
|
|
22061
|
-
className: "flex flex-row justify-center items-center absolute h-full right-0 top-0 mr-4",
|
|
22062
|
-
children: /* @__PURE__ */ jsx(IconButton, {
|
|
22063
|
-
onClick: handleClearClick,
|
|
22064
|
-
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
22065
|
-
})
|
|
22066
|
-
})
|
|
22067
|
-
]
|
|
22068
|
-
}) : /* @__PURE__ */ jsx(TextField, {
|
|
22069
|
-
size,
|
|
22070
|
-
value: displayValue,
|
|
22071
|
-
onChange,
|
|
22072
|
-
autoFocus,
|
|
22073
|
-
label,
|
|
22074
|
-
"aria-label": label ? void 0 : accessibleName,
|
|
22075
|
-
type: inputType,
|
|
22076
|
-
disabled,
|
|
22077
|
-
endAdornment: property.admin?.clearable && /* @__PURE__ */ jsx(IconButton, {
|
|
22078
|
-
onClick: handleClearClick,
|
|
22079
|
-
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
22118
|
+
isMultiline ? /* @__PURE__ */ jsxs("div", {
|
|
22119
|
+
className: cls("rounded-md relative max-w-full min-h-[64px]", fieldBackgroundMixin, fieldBackgroundHoverMixin, showError && error ? "border border-red-500 dark:border-red-600" : ""),
|
|
22120
|
+
children: [
|
|
22121
|
+
label && /* @__PURE__ */ jsx("div", {
|
|
22122
|
+
className: "pointer-events-none absolute top-1 text-xs font-medium px-3 text-text-secondary dark:text-text-secondary-dark",
|
|
22123
|
+
children: label
|
|
22080
22124
|
}),
|
|
22081
|
-
|
|
22082
|
-
|
|
22083
|
-
|
|
22125
|
+
/* @__PURE__ */ jsx(TextareaAutosize, {
|
|
22126
|
+
value: displayValue,
|
|
22127
|
+
onChange,
|
|
22128
|
+
autoFocus,
|
|
22129
|
+
disabled,
|
|
22130
|
+
"aria-label": accessibleName,
|
|
22131
|
+
className: cls("rounded-md resize-none w-full outline-none text-sm bg-transparent min-h-[64px] px-3", label ? "pt-8 pb-2" : "py-2", disabled && "outline-none opacity-50 text-surface-accent-600 dark:text-surface-accent-500", showError && error ? "text-red-500 dark:text-red-600" : "")
|
|
22132
|
+
}),
|
|
22133
|
+
property.admin?.clearable && /* @__PURE__ */ jsx("div", {
|
|
22134
|
+
className: "flex flex-row justify-center items-center absolute h-full right-0 top-0 mr-4",
|
|
22135
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
22136
|
+
onClick: handleClearClick,
|
|
22137
|
+
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
22138
|
+
})
|
|
22139
|
+
})
|
|
22140
|
+
]
|
|
22141
|
+
}) : /* @__PURE__ */ jsx(TextField, {
|
|
22142
|
+
size,
|
|
22143
|
+
value: displayValue,
|
|
22144
|
+
onChange,
|
|
22145
|
+
autoFocus,
|
|
22146
|
+
label,
|
|
22147
|
+
"aria-label": label ? void 0 : accessibleName,
|
|
22148
|
+
type: inputType,
|
|
22149
|
+
disabled,
|
|
22150
|
+
endAdornment: property.admin?.clearable && /* @__PURE__ */ jsx(IconButton, {
|
|
22151
|
+
onClick: handleClearClick,
|
|
22152
|
+
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
22153
|
+
}),
|
|
22154
|
+
error: showError ? !!error : void 0,
|
|
22155
|
+
inputClassName: error ? "text-red-500 dark:text-red-600" : ""
|
|
22084
22156
|
}),
|
|
22085
22157
|
/* @__PURE__ */ jsx(FieldHelperText, {
|
|
22086
22158
|
includeDescription,
|
|
@@ -22153,84 +22225,81 @@ function VectorFieldBinding({ propertyKey, value, setValue, error, showError, di
|
|
|
22153
22225
|
className: "flex items-center justify-between mb-1",
|
|
22154
22226
|
children: label
|
|
22155
22227
|
}),
|
|
22156
|
-
/* @__PURE__ */ jsx(
|
|
22157
|
-
|
|
22158
|
-
children: /* @__PURE__ */
|
|
22159
|
-
className: "
|
|
22160
|
-
children:
|
|
22161
|
-
className:
|
|
22228
|
+
/* @__PURE__ */ jsx("div", {
|
|
22229
|
+
className: "w-full",
|
|
22230
|
+
children: !isEditing ? /* @__PURE__ */ jsxs("div", {
|
|
22231
|
+
className: cls("flex flex-col gap-3 p-4 rounded-xl border bg-surface-field transition-all duration-200", defaultBorderMixin),
|
|
22232
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
22233
|
+
className: "flex items-center justify-between flex-wrap gap-2",
|
|
22162
22234
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
22163
|
-
className: "flex items-center
|
|
22164
|
-
children: [
|
|
22165
|
-
className:
|
|
22166
|
-
|
|
22167
|
-
|
|
22168
|
-
|
|
22169
|
-
|
|
22170
|
-
|
|
22171
|
-
|
|
22172
|
-
|
|
22173
|
-
|
|
22174
|
-
|
|
22175
|
-
})
|
|
22176
|
-
]
|
|
22177
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
22178
|
-
className: "flex items-center gap-2",
|
|
22179
|
-
children: [
|
|
22180
|
-
isPopulated && /* @__PURE__ */ jsx(Button, {
|
|
22181
|
-
variant: "text",
|
|
22182
|
-
size: "small",
|
|
22183
|
-
onClick: () => setShowValues(!showValues),
|
|
22184
|
-
startIcon: showValues ? /* @__PURE__ */ jsx(EyeOffIcon, { size: 14 }) : /* @__PURE__ */ jsx(EyeIcon, { size: 14 }),
|
|
22185
|
-
children: showValues ? "Hide values" : "Show values"
|
|
22186
|
-
}),
|
|
22187
|
-
!disabled && /* @__PURE__ */ jsx(Button, {
|
|
22188
|
-
variant: "outlined",
|
|
22189
|
-
size: "small",
|
|
22190
|
-
onClick: () => setIsEditing(true),
|
|
22191
|
-
startIcon: /* @__PURE__ */ jsx(PencilIcon, { size: 14 }),
|
|
22192
|
-
children: isPopulated ? "Edit values" : "Add values"
|
|
22193
|
-
}),
|
|
22194
|
-
isPopulated && !disabled && /* @__PURE__ */ jsx(IconButton, {
|
|
22195
|
-
size: "small",
|
|
22196
|
-
onClick: handleClearClick,
|
|
22197
|
-
className: "text-text-secondary hover:text-red-500",
|
|
22198
|
-
children: /* @__PURE__ */ jsx(Trash2Icon, { size: 14 })
|
|
22199
|
-
})
|
|
22200
|
-
]
|
|
22201
|
-
})]
|
|
22202
|
-
}), showValues && isPopulated && /* @__PURE__ */ jsx("div", {
|
|
22203
|
-
className: "mt-1 p-3 rounded-lg bg-surface-well border border-hairline max-h-36 overflow-y-auto font-mono text-[11px] leading-relaxed text-text-secondary dark:text-text-secondary-dark break-all selection:bg-primary/20",
|
|
22204
|
-
children: arrayValue.join(", ")
|
|
22205
|
-
})]
|
|
22206
|
-
}) : /* @__PURE__ */ jsxs("div", {
|
|
22207
|
-
className: cls("flex flex-col gap-2 p-4 rounded-xl border bg-surface-field", defaultBorderMixin),
|
|
22208
|
-
children: [/* @__PURE__ */ jsx(TextField, {
|
|
22209
|
-
size,
|
|
22210
|
-
"aria-label": `${property.name ?? propertyKey} vector values`,
|
|
22211
|
-
value: textValue,
|
|
22212
|
-
onChange,
|
|
22213
|
-
autoFocus: true,
|
|
22214
|
-
placeholder: `e.g., 0.15, -0.42, 0.88 (Requires ${property.dimensions} dimensions)`,
|
|
22215
|
-
disabled,
|
|
22216
|
-
error: showError ? !!error : void 0,
|
|
22217
|
-
inputClassName: error ? "text-red-500 dark:text-red-600 font-mono text-xs" : "font-mono text-xs"
|
|
22235
|
+
className: "flex items-center gap-2.5",
|
|
22236
|
+
children: [
|
|
22237
|
+
/* @__PURE__ */ jsx("div", { className: `w-2.5 h-2.5 rounded-full ${isPopulated ? "bg-emerald-500 animate-pulse" : "bg-surface-300 dark:bg-surface-600"}` }),
|
|
22238
|
+
/* @__PURE__ */ jsx("span", {
|
|
22239
|
+
className: "text-sm font-semibold text-text-primary dark:text-text-primary-dark",
|
|
22240
|
+
children: isPopulated ? `${arrayValue.length} Dimensions` : "Empty Vector"
|
|
22241
|
+
}),
|
|
22242
|
+
isPopulated && /* @__PURE__ */ jsx("span", {
|
|
22243
|
+
className: "text-xs text-text-secondary dark:text-text-secondary-dark px-2 py-0.5 rounded-full bg-surface-raised font-medium",
|
|
22244
|
+
children: "Embedding"
|
|
22245
|
+
})
|
|
22246
|
+
]
|
|
22218
22247
|
}), /* @__PURE__ */ jsxs("div", {
|
|
22219
|
-
className: "flex
|
|
22220
|
-
children: [
|
|
22221
|
-
|
|
22222
|
-
|
|
22223
|
-
|
|
22224
|
-
|
|
22225
|
-
|
|
22226
|
-
|
|
22227
|
-
|
|
22228
|
-
|
|
22229
|
-
|
|
22230
|
-
|
|
22231
|
-
|
|
22248
|
+
className: "flex items-center gap-2",
|
|
22249
|
+
children: [
|
|
22250
|
+
isPopulated && /* @__PURE__ */ jsx(Button, {
|
|
22251
|
+
variant: "text",
|
|
22252
|
+
size: "small",
|
|
22253
|
+
onClick: () => setShowValues(!showValues),
|
|
22254
|
+
startIcon: showValues ? /* @__PURE__ */ jsx(EyeOffIcon, { size: 14 }) : /* @__PURE__ */ jsx(EyeIcon, { size: 14 }),
|
|
22255
|
+
children: showValues ? "Hide values" : "Show values"
|
|
22256
|
+
}),
|
|
22257
|
+
!disabled && /* @__PURE__ */ jsx(Button, {
|
|
22258
|
+
variant: "outlined",
|
|
22259
|
+
size: "small",
|
|
22260
|
+
onClick: () => setIsEditing(true),
|
|
22261
|
+
startIcon: /* @__PURE__ */ jsx(PencilIcon, { size: 14 }),
|
|
22262
|
+
children: isPopulated ? "Edit values" : "Add values"
|
|
22263
|
+
}),
|
|
22264
|
+
isPopulated && !disabled && /* @__PURE__ */ jsx(IconButton, {
|
|
22265
|
+
size: "small",
|
|
22266
|
+
onClick: handleClearClick,
|
|
22267
|
+
className: "text-text-secondary hover:text-red-500",
|
|
22268
|
+
children: /* @__PURE__ */ jsx(Trash2Icon, { size: 14 })
|
|
22269
|
+
})
|
|
22270
|
+
]
|
|
22232
22271
|
})]
|
|
22233
|
-
})
|
|
22272
|
+
}), showValues && isPopulated && /* @__PURE__ */ jsx("div", {
|
|
22273
|
+
className: "mt-1 p-3 rounded-lg bg-surface-well border border-hairline max-h-36 overflow-y-auto font-mono text-[11px] leading-relaxed text-text-secondary dark:text-text-secondary-dark break-all selection:bg-primary/20",
|
|
22274
|
+
children: arrayValue.join(", ")
|
|
22275
|
+
})]
|
|
22276
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
22277
|
+
className: cls("flex flex-col gap-2 p-4 rounded-xl border bg-surface-field", defaultBorderMixin),
|
|
22278
|
+
children: [/* @__PURE__ */ jsx(TextField, {
|
|
22279
|
+
size,
|
|
22280
|
+
"aria-label": `${property.name ?? propertyKey} vector values`,
|
|
22281
|
+
value: textValue,
|
|
22282
|
+
onChange,
|
|
22283
|
+
autoFocus: true,
|
|
22284
|
+
placeholder: `e.g., 0.15, -0.42, 0.88 (Requires ${property.dimensions} dimensions)`,
|
|
22285
|
+
disabled,
|
|
22286
|
+
error: showError ? !!error : void 0,
|
|
22287
|
+
inputClassName: error ? "text-red-500 dark:text-red-600 font-mono text-xs" : "font-mono text-xs"
|
|
22288
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
22289
|
+
className: "flex justify-end gap-2 mt-2",
|
|
22290
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
22291
|
+
variant: "outlined",
|
|
22292
|
+
size: "small",
|
|
22293
|
+
onClick: () => setIsEditing(false),
|
|
22294
|
+
children: "Cancel"
|
|
22295
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
22296
|
+
variant: "filled",
|
|
22297
|
+
size: "small",
|
|
22298
|
+
onClick: () => setIsEditing(false),
|
|
22299
|
+
startIcon: /* @__PURE__ */ jsx(CheckIcon, { size: 14 }),
|
|
22300
|
+
children: "Done"
|
|
22301
|
+
})]
|
|
22302
|
+
})]
|
|
22234
22303
|
})
|
|
22235
22304
|
}),
|
|
22236
22305
|
/* @__PURE__ */ jsx(FieldHelperText, {
|
|
@@ -22336,49 +22405,46 @@ function GeopointFieldBinding({ propertyKey, value, setValue, error, showError,
|
|
|
22336
22405
|
title: property.name ?? propertyKey
|
|
22337
22406
|
})
|
|
22338
22407
|
}),
|
|
22339
|
-
/* @__PURE__ */
|
|
22340
|
-
|
|
22341
|
-
children:
|
|
22342
|
-
|
|
22343
|
-
|
|
22344
|
-
|
|
22345
|
-
|
|
22346
|
-
|
|
22347
|
-
|
|
22348
|
-
|
|
22349
|
-
|
|
22350
|
-
|
|
22351
|
-
|
|
22352
|
-
|
|
22353
|
-
|
|
22354
|
-
|
|
22355
|
-
|
|
22356
|
-
|
|
22357
|
-
|
|
22358
|
-
|
|
22359
|
-
|
|
22360
|
-
|
|
22361
|
-
|
|
22362
|
-
|
|
22363
|
-
|
|
22364
|
-
|
|
22365
|
-
|
|
22366
|
-
|
|
22367
|
-
|
|
22368
|
-
|
|
22369
|
-
|
|
22370
|
-
|
|
22371
|
-
|
|
22372
|
-
|
|
22373
|
-
|
|
22374
|
-
|
|
22375
|
-
|
|
22376
|
-
|
|
22377
|
-
|
|
22378
|
-
|
|
22379
|
-
})
|
|
22380
|
-
]
|
|
22381
|
-
})
|
|
22408
|
+
/* @__PURE__ */ jsxs("div", {
|
|
22409
|
+
className: "flex gap-4 w-full items-center",
|
|
22410
|
+
children: [
|
|
22411
|
+
/* @__PURE__ */ jsx(TextField, {
|
|
22412
|
+
className: "flex-1",
|
|
22413
|
+
size,
|
|
22414
|
+
label: "Latitude",
|
|
22415
|
+
value: latText,
|
|
22416
|
+
autoFocus,
|
|
22417
|
+
disabled,
|
|
22418
|
+
error: showError ? Boolean(error) || latInvalid : latInvalid,
|
|
22419
|
+
onChange: (e) => {
|
|
22420
|
+
setLatText(e.target.value);
|
|
22421
|
+
commit(e.target.value, lngText);
|
|
22422
|
+
},
|
|
22423
|
+
placeholder: "e.g. 41.3874",
|
|
22424
|
+
inputClassName: "font-mono"
|
|
22425
|
+
}),
|
|
22426
|
+
/* @__PURE__ */ jsx(TextField, {
|
|
22427
|
+
className: "flex-1",
|
|
22428
|
+
size,
|
|
22429
|
+
label: "Longitude",
|
|
22430
|
+
value: lngText,
|
|
22431
|
+
disabled,
|
|
22432
|
+
error: showError ? Boolean(error) || lngInvalid : lngInvalid,
|
|
22433
|
+
onChange: (e) => {
|
|
22434
|
+
setLngText(e.target.value);
|
|
22435
|
+
commit(latText, e.target.value);
|
|
22436
|
+
},
|
|
22437
|
+
placeholder: "e.g. 2.1686",
|
|
22438
|
+
inputClassName: "font-mono"
|
|
22439
|
+
}),
|
|
22440
|
+
!disabled && (latText || lngText) && /* @__PURE__ */ jsx(IconButton, {
|
|
22441
|
+
size: "small",
|
|
22442
|
+
onClick: handleClear,
|
|
22443
|
+
className: "shrink-0 text-text-secondary hover:text-red-500",
|
|
22444
|
+
"aria-label": "Clear location",
|
|
22445
|
+
children: /* @__PURE__ */ jsx(Trash2Icon, { size: 14 })
|
|
22446
|
+
})
|
|
22447
|
+
]
|
|
22382
22448
|
}),
|
|
22383
22449
|
/* @__PURE__ */ jsx(FieldHelperText, {
|
|
22384
22450
|
includeDescription,
|
|
@@ -22459,59 +22525,56 @@ function BinaryFieldBinding({ propertyKey, value, setValue, error, showError, di
|
|
|
22459
22525
|
title: property.name ?? propertyKey
|
|
22460
22526
|
})
|
|
22461
22527
|
}),
|
|
22462
|
-
/* @__PURE__ */ jsx(
|
|
22463
|
-
|
|
22464
|
-
children: /* @__PURE__ */
|
|
22465
|
-
className: "
|
|
22466
|
-
children:
|
|
22467
|
-
className:
|
|
22468
|
-
children: [/* @__PURE__ */
|
|
22469
|
-
className: "
|
|
22470
|
-
children:
|
|
22471
|
-
className: "text-sm font-semibold text-text-primary truncate",
|
|
22472
|
-
children: malformed ? "Invalid base64" : isPopulated ? `${humanSize(bytes)} of binary data` : "Empty"
|
|
22473
|
-
})]
|
|
22474
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
22475
|
-
className: "flex items-center gap-2 shrink-0",
|
|
22476
|
-
children: [!disabled && /* @__PURE__ */ jsx(Button, {
|
|
22477
|
-
variant: "outlined",
|
|
22478
|
-
size: "small",
|
|
22479
|
-
onClick: () => setIsEditing(true),
|
|
22480
|
-
startIcon: /* @__PURE__ */ jsx(PencilIcon, { size: 14 }),
|
|
22481
|
-
children: isPopulated ? "Edit base64" : "Add base64"
|
|
22482
|
-
}), isPopulated && !disabled && /* @__PURE__ */ jsx(IconButton, {
|
|
22483
|
-
size: "small",
|
|
22484
|
-
onClick: handleClear,
|
|
22485
|
-
className: "text-text-secondary hover:text-red-500",
|
|
22486
|
-
"aria-label": "Clear binary value",
|
|
22487
|
-
children: /* @__PURE__ */ jsx(Trash2Icon, { size: 14 })
|
|
22488
|
-
})]
|
|
22528
|
+
/* @__PURE__ */ jsx("div", {
|
|
22529
|
+
className: "w-full",
|
|
22530
|
+
children: !isEditing ? /* @__PURE__ */ jsxs("div", {
|
|
22531
|
+
className: cls("flex items-center justify-between gap-2 p-4 rounded-xl border bg-surface-field", defaultBorderMixin),
|
|
22532
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
22533
|
+
className: "flex items-center gap-2.5 min-w-0",
|
|
22534
|
+
children: [/* @__PURE__ */ jsx("div", { className: `w-2.5 h-2.5 rounded-full shrink-0 ${isPopulated ? "bg-emerald-500" : "bg-surface-300 dark:bg-surface-600"}` }), /* @__PURE__ */ jsx("span", {
|
|
22535
|
+
className: "text-sm font-semibold text-text-primary truncate",
|
|
22536
|
+
children: malformed ? "Invalid base64" : isPopulated ? `${humanSize(bytes)} of binary data` : "Empty"
|
|
22489
22537
|
})]
|
|
22490
|
-
})
|
|
22491
|
-
className:
|
|
22492
|
-
children: [/* @__PURE__ */ jsx(
|
|
22493
|
-
|
|
22494
|
-
"
|
|
22495
|
-
|
|
22496
|
-
|
|
22497
|
-
|
|
22498
|
-
|
|
22499
|
-
|
|
22500
|
-
|
|
22501
|
-
|
|
22502
|
-
|
|
22503
|
-
|
|
22504
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
22505
|
-
className: "flex justify-end",
|
|
22506
|
-
children: /* @__PURE__ */ jsx(Button, {
|
|
22507
|
-
variant: "filled",
|
|
22508
|
-
size: "small",
|
|
22509
|
-
onClick: () => setIsEditing(false),
|
|
22510
|
-
startIcon: /* @__PURE__ */ jsx(CheckIcon, { size: 14 }),
|
|
22511
|
-
children: "Done"
|
|
22512
|
-
})
|
|
22538
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
22539
|
+
className: "flex items-center gap-2 shrink-0",
|
|
22540
|
+
children: [!disabled && /* @__PURE__ */ jsx(Button, {
|
|
22541
|
+
variant: "outlined",
|
|
22542
|
+
size: "small",
|
|
22543
|
+
onClick: () => setIsEditing(true),
|
|
22544
|
+
startIcon: /* @__PURE__ */ jsx(PencilIcon, { size: 14 }),
|
|
22545
|
+
children: isPopulated ? "Edit base64" : "Add base64"
|
|
22546
|
+
}), isPopulated && !disabled && /* @__PURE__ */ jsx(IconButton, {
|
|
22547
|
+
size: "small",
|
|
22548
|
+
onClick: handleClear,
|
|
22549
|
+
className: "text-text-secondary hover:text-red-500",
|
|
22550
|
+
"aria-label": "Clear binary value",
|
|
22551
|
+
children: /* @__PURE__ */ jsx(Trash2Icon, { size: 14 })
|
|
22513
22552
|
})]
|
|
22514
|
-
})
|
|
22553
|
+
})]
|
|
22554
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
22555
|
+
className: cls("flex flex-col gap-2 p-4 rounded-xl border", defaultBorderMixin),
|
|
22556
|
+
children: [/* @__PURE__ */ jsx(TextField, {
|
|
22557
|
+
size,
|
|
22558
|
+
"aria-label": `${property.name ?? propertyKey} base64 value`,
|
|
22559
|
+
value: text,
|
|
22560
|
+
onChange,
|
|
22561
|
+
autoFocus: autoFocus ?? true,
|
|
22562
|
+
multiline: true,
|
|
22563
|
+
minRows: 4,
|
|
22564
|
+
disabled,
|
|
22565
|
+
placeholder: "Base64-encoded bytes, e.g. iVBORw0KGgo…",
|
|
22566
|
+
error: showError ? Boolean(error) || malformed : malformed,
|
|
22567
|
+
inputClassName: `font-mono text-xs ${malformed ? "text-red-500" : ""}`
|
|
22568
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
22569
|
+
className: "flex justify-end",
|
|
22570
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
22571
|
+
variant: "filled",
|
|
22572
|
+
size: "small",
|
|
22573
|
+
onClick: () => setIsEditing(false),
|
|
22574
|
+
startIcon: /* @__PURE__ */ jsx(CheckIcon, { size: 14 }),
|
|
22575
|
+
children: "Done"
|
|
22576
|
+
})
|
|
22577
|
+
})]
|
|
22515
22578
|
})
|
|
22516
22579
|
}),
|
|
22517
22580
|
/* @__PURE__ */ jsx(FieldHelperText, {
|
|
@@ -22576,7 +22639,7 @@ function MultipleRelationFieldBinding({ propertyKey, value: valueProp, error, sh
|
|
|
22576
22639
|
property.admin?.previewProperties,
|
|
22577
22640
|
value
|
|
22578
22641
|
]);
|
|
22579
|
-
const title = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(
|
|
22642
|
+
const title = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(LabelWithIcon, {
|
|
22580
22643
|
propertyKey,
|
|
22581
22644
|
icon: getIconForProperty(property, "small"),
|
|
22582
22645
|
required: property.validation?.required,
|
|
@@ -22657,7 +22720,7 @@ function RelationSelectorBinding({ propertyKey, value, size, error, showError, d
|
|
|
22657
22720
|
return /* @__PURE__ */ jsxs("div", {
|
|
22658
22721
|
className: "",
|
|
22659
22722
|
children: [
|
|
22660
|
-
!hideLabel && /* @__PURE__ */ jsx(
|
|
22723
|
+
!hideLabel && /* @__PURE__ */ jsx(LabelWithIcon, {
|
|
22661
22724
|
propertyKey,
|
|
22662
22725
|
icon: getIconForProperty(property, "small"),
|
|
22663
22726
|
required: property.validation?.required,
|
|
@@ -22707,7 +22770,7 @@ function SingleRelationFieldBinding({ propertyKey, value, size, error, showError
|
|
|
22707
22770
|
};
|
|
22708
22771
|
const usedRelation = Array.isArray(value) ? void 0 : normalizedValue ?? void 0;
|
|
22709
22772
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22710
|
-
!hideLabel && /* @__PURE__ */ jsx(
|
|
22773
|
+
!hideLabel && /* @__PURE__ */ jsx(LabelWithIcon, {
|
|
22711
22774
|
propertyKey,
|
|
22712
22775
|
icon: getIconForProperty(property, "small"),
|
|
22713
22776
|
required: property.validation?.required,
|
|
@@ -22759,14 +22822,12 @@ function SingleRelationFieldBinding({ propertyKey, value, size, error, showError
|
|
|
22759
22822
|
function UserSelectFieldBinding({ propertyKey, value, setValue, error, showError, disabled, autoFocus, touched, property, includeDescription, hideLabel, size = "large" }) {
|
|
22760
22823
|
const selectorSize = size;
|
|
22761
22824
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22762
|
-
!hideLabel && /* @__PURE__ */ jsx(
|
|
22825
|
+
!hideLabel && /* @__PURE__ */ jsx(LabelWithIcon, {
|
|
22826
|
+
icon: getIconForProperty(property, "small"),
|
|
22827
|
+
required: property.validation?.required,
|
|
22828
|
+
title: property.name,
|
|
22763
22829
|
propertyKey,
|
|
22764
|
-
|
|
22765
|
-
icon: getIconForProperty(property, "small"),
|
|
22766
|
-
required: property.validation?.required,
|
|
22767
|
-
title: property.name,
|
|
22768
|
-
className: "h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5 my-0"
|
|
22769
|
-
})
|
|
22830
|
+
className: "h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5 my-0"
|
|
22770
22831
|
}),
|
|
22771
22832
|
/* @__PURE__ */ jsx(UserSelector, {
|
|
22772
22833
|
value,
|
|
@@ -23341,6 +23402,24 @@ function PropertyFieldBindingInternal({ propertyKey, property, context, includeD
|
|
|
23341
23402
|
}
|
|
23342
23403
|
function FieldInternal({ Component, componentProps: { propertyKey, property, includeDescription, hideLabel, underlyingValueHasChanged, partOfArray, partOfBlock, minimalistView, autoFocus, context, disabled, size, onPropertyChange }, formexFieldProps }) {
|
|
23343
23404
|
const { plugins } = useCustomizationController();
|
|
23405
|
+
const rebaseContext = useRebaseContext();
|
|
23406
|
+
const fieldSlotProps = React.useMemo(() => ({
|
|
23407
|
+
propertyKey,
|
|
23408
|
+
property,
|
|
23409
|
+
path: context.path ?? "",
|
|
23410
|
+
entityId: context.entityId,
|
|
23411
|
+
collection: context.collection,
|
|
23412
|
+
context: rebaseContext
|
|
23413
|
+
}), [
|
|
23414
|
+
propertyKey,
|
|
23415
|
+
property,
|
|
23416
|
+
context.path,
|
|
23417
|
+
context.entityId,
|
|
23418
|
+
context.collection,
|
|
23419
|
+
rebaseContext
|
|
23420
|
+
]);
|
|
23421
|
+
const beforeField = useSlot("entity.field.before", fieldSlotProps);
|
|
23422
|
+
const afterField = useSlot("entity.field.after", fieldSlotProps);
|
|
23344
23423
|
const customFieldProps = property.admin?.customProps;
|
|
23345
23424
|
const value = formexFieldProps.field.value;
|
|
23346
23425
|
const error = getIn(formexFieldProps.form.errors, propertyKey);
|
|
@@ -23355,42 +23434,47 @@ function FieldInternal({ Component, componentProps: { propertyKey, property, inc
|
|
|
23355
23434
|
plugins
|
|
23356
23435
|
}) ?? Component;
|
|
23357
23436
|
const isSubmitting = formexFieldProps.form.isSubmitting;
|
|
23358
|
-
return /* @__PURE__ */ jsxs(ErrorBoundary, { children: [
|
|
23359
|
-
|
|
23360
|
-
|
|
23361
|
-
|
|
23362
|
-
|
|
23363
|
-
|
|
23364
|
-
|
|
23365
|
-
|
|
23366
|
-
|
|
23367
|
-
|
|
23368
|
-
|
|
23369
|
-
|
|
23370
|
-
|
|
23371
|
-
|
|
23372
|
-
|
|
23373
|
-
|
|
23374
|
-
|
|
23375
|
-
|
|
23376
|
-
|
|
23377
|
-
|
|
23378
|
-
|
|
23379
|
-
|
|
23380
|
-
|
|
23381
|
-
|
|
23382
|
-
|
|
23383
|
-
|
|
23384
|
-
|
|
23385
|
-
|
|
23386
|
-
|
|
23387
|
-
|
|
23437
|
+
return /* @__PURE__ */ jsxs(ErrorBoundary, { children: [
|
|
23438
|
+
beforeField,
|
|
23439
|
+
/* @__PURE__ */ jsx(Suspense, {
|
|
23440
|
+
fallback: null,
|
|
23441
|
+
children: /* @__PURE__ */ jsx(UsedComponent, {
|
|
23442
|
+
propertyKey,
|
|
23443
|
+
value,
|
|
23444
|
+
setValue: useCallback((value, shouldValidate) => {
|
|
23445
|
+
formexFieldProps.form.setFieldTouched(propertyKey, true, false);
|
|
23446
|
+
formexFieldProps.form.setFieldValue(propertyKey, value, shouldValidate);
|
|
23447
|
+
}, []),
|
|
23448
|
+
setFieldValue: useCallback((otherPropertyKey, value, shouldValidate) => {
|
|
23449
|
+
formexFieldProps.form.setFieldTouched(propertyKey, true, false);
|
|
23450
|
+
formexFieldProps.form.setFieldValue(otherPropertyKey, value, shouldValidate);
|
|
23451
|
+
}, []),
|
|
23452
|
+
error,
|
|
23453
|
+
touched,
|
|
23454
|
+
showError,
|
|
23455
|
+
isSubmitting,
|
|
23456
|
+
includeDescription: includeDescription ?? true,
|
|
23457
|
+
hideLabel: hideLabel ?? false,
|
|
23458
|
+
property,
|
|
23459
|
+
disabled: disabled ?? false,
|
|
23460
|
+
underlyingValueHasChanged: underlyingValueHasChanged ?? false,
|
|
23461
|
+
partOfArray: partOfArray ?? false,
|
|
23462
|
+
partOfBlock: partOfBlock ?? false,
|
|
23463
|
+
minimalistView: minimalistView ?? false,
|
|
23464
|
+
autoFocus: autoFocus ?? false,
|
|
23465
|
+
customProps: customFieldProps,
|
|
23466
|
+
context,
|
|
23467
|
+
size,
|
|
23468
|
+
onPropertyChange
|
|
23469
|
+
})
|
|
23470
|
+
}),
|
|
23471
|
+
afterField,
|
|
23472
|
+
underlyingValueHasChanged && !isSubmitting && /* @__PURE__ */ jsx(Typography, {
|
|
23473
|
+
variant: "caption",
|
|
23474
|
+
className: "ml-3.5",
|
|
23475
|
+
children: "This value has been updated elsewhere"
|
|
23388
23476
|
})
|
|
23389
|
-
})
|
|
23390
|
-
variant: "caption",
|
|
23391
|
-
className: "ml-3.5",
|
|
23392
|
-
children: "This value has been updated elsewhere"
|
|
23393
|
-
})] });
|
|
23477
|
+
] });
|
|
23394
23478
|
}
|
|
23395
23479
|
var shouldPropertyReRender = (property, plugins) => {
|
|
23396
23480
|
if (plugins?.some((plugin) => plugin.fieldBuilder)) return true;
|
|
@@ -25574,6 +25658,6 @@ function getFullIdPath(propertyKey, propertyNamespace) {
|
|
|
25574
25658
|
return idToPropertiesPath(propertyNamespace ? `${propertyNamespace}.${propertyKey}` : propertyKey);
|
|
25575
25659
|
}
|
|
25576
25660
|
//#endregion
|
|
25577
|
-
export { NAVIGATION_DEFAULT_GROUP_NAME as $,
|
|
25661
|
+
export { NAVIGATION_DEFAULT_GROUP_NAME as $, CollectionRegistryContext as $n, getCollectionBySlugWithin as $t, getFieldId as A, ReadOnlyFieldBinding as An, getIconForWidget as Ar, convertDataToEntity as At, MapFieldBinding as B, MapPropertyPreview as Bn, detectCsvDelimiter as Bt, EntityFormBinding as C, NavigationStateContext as Cn, LABEL_ICON_SIZE as Cr, EntityCardBinding as Ct, getDefaultFieldConfig as D, SelectableTableContext as Dn, getBracketNotation as Dr, useCollectionEditorDialogsState as Dt, DEFAULT_FIELD_CONFIGS as E, SideDialogsControllerContext as En, PropertyKeyHint as Er, ConfigControllerProvider as Et, SelectFieldBinding as F, UserPreview as Fn, isRelationProperty as Fr, ImportSaveInProgress as Ft, useSelectionDialog as G, ArrayOfStorageComponentsPreview as Gn, SearchIconsView as Gt, DateTimeFieldBinding as H, ArrayOfStringsPreview as Hn, parseCsvToObjects as Ht, RepeatFieldBinding as I, NumberPropertyPreview as In, IMPORT_BATCH_SIZE as It, useBuildUrlController as J, InlineEntityListPreview as Jn, BreadcrumbsProvider as Jt, SelectionTableBinding as K, RelationPreview as Kn, FieldCaption as Kt, ReferenceFieldBinding as L, BooleanPreview as Ln, saveImportedEntities as Lt, TextFieldBinding as M, FieldHelperText as Mn, getPropertyInPath$1 as Mr, processValueMapping as Mt, SwitchFieldBinding as N, ArrayOfMapsPreview as Nn, getResolvedPropertyInPath as Nr, getInferenceType as Nt, getDefaultFieldId as O, ArrayCustomShapedFieldBinding as On, getDefaultPropertiesOrder as Or, ImportNewPropertyFieldPreview as Ot, StorageUploadFieldBinding as P, PropertyPreview as Pn, isReferenceProperty as Pr, useImportConfig as Pt, useResolvedCollections as Q, useSidePanel as Qn, addInitialSlash as Qt, MultiSelectFieldBinding as R, DatePreview as Rn, ImportFileUpload as Rt, isSchemaChangeCancelled as S, useUrlController as Sn, FieldBlock as Sr, CollectionCardViewBinding as St, PropertyFieldBinding as T, useSideDialogsController as Tn, spanClass as Tr, useCollectionEditorController as Tt, BlockFieldBinding as U, ArrayPropertyEnumPreview as Un, ArrayContainer as Ut, KeyValueFieldBinding as V, ArrayOneOfPreview as Vn, parseCsvRows as Vt, ArrayOfReferencesFieldBinding as W, ArrayEnumPreview as Wn, PropertyConfigBadge as Wt, useTopLevelNavigation as X, EntityPreviewBinding as Xn, resolveEntityView as Xt, useBuildNavigationStateController as Y, ReferencePreview as Yn, resolveEntityAction as Yt, useResolvedViews as Z, SidePanelControllerContext as Zn, mergeEntityActions as Zt, useCollectionsConfigController as _, CollectionTableBinding as _n, ImagePreview as _r, editEntityAction as _t, namespaceToPropertiesPath as a, resolveCollectionPathIds$1 as an, getEntityTitlePropertyKeyForEntity as ar, getEntityViewWidth as at, asUnavailable as b, useAdminContext as bn, FormRail as br, DetailViewBinding as bt, buildCollectionGenerationCallback as c, SelectionMenu as cn, EnumValuesChip as cr, useSafeSnackbarController as ct, fromSerializableCollectionConfigs as d, resolveSelection as dn, SkeletonPropertyComponent as dr, getInitialEntityValues as dt, getCollectionPathsCombinations as en, useCollectionRegistryController as er, useBuildCollectionRegistryController as et, fromSerializableProperties as f, selectionQueryToFindParams as fn, renderSkeletonCaptionText as fr, removeEmptyContainers as ft, toSerializableProperty as g, VirtualTableInput$1 as gn, UrlComponentPreview as gr, deleteEntityAction as gt, toSerializableProperties as h, useSelectionController as hn, renderSkeletonText as hr, copyEntityAction as ht, namespaceToPropertiesOrderPath as i, removeTrailingSlash$1 as in, getEntityTitlePropertyKey as ir, buildSidePanelsFromUrl as it, VectorFieldBinding as j, LabelWithIcon as jn, getPropertiesWithPropertiesOrder as jr, flattenEntry as jt, getFieldConfig as k, useClearRestoreValue as kn, getIconForProperty as kr, DataNewPropertiesMapping as kt, validateCollectionJson as l, MAX_SELECTION_ROWS as ln, StorageThumbnail as lr, extractTouchedValues as lt, toSerializableCollectionConfig as m, walkEntityPages as mn, renderSkeletonImageThumbnail as mr, CollectionViewBinding as mt, getFullIdPath as n, removeInitialAndTrailingSlashes$1 as nn, useResolvedUser as nr, resolveNavigationFrom as nt, CollectionGenerationApiError as o, resolveOpenEntityMode as on, ArrayPropertyPreview as or, useBuildSidePanel as ot, fromSerializableProperty as p, serializeSelectionQuery as pn, renderSkeletonIcon as pr, zodToFormErrors as pt, SideDialogs as q, ArrayOfReferencesPreview as qn, useBreadcrumbsController as qt, idToPropertiesPath as r, removeInitialSlash as rn, getEntityPreviewKeys as rr, useResolvedNavigationFrom as rt, DEFAULT_COLLECTION_GENERATION_ENDPOINT as s, resolveViewMode as sn, StringPropertyPreview as sr, EditViewBinding as st, getFullId as t, getLastSegment$1 as tn, getUserLabel as tr, useHistory as tt, fromSerializableCollectionConfig as u, SELECTION_PAGE_SIZE as un, StorageThumbnailInternal as ur, getChanges as ut, LiveSchemaError as v, SelectableTable as vn, EmptyValue as vr, resetPasswordAction as vt, EntityForm as w, useNavigationStateController as wn, isSelfLabellingProperty as wr, CollectionViewActions as wt, createLiveSchemaClient as x, UrlContext as xn, RecordMeta as xr, EntityViewBinding as xt, SchemaChangeCancelled as y, CollectionRowActions as yn, FormSections as yr, CreationResultDialog as yt, MarkdownEditorFieldBinding as z, KeyValuePreview as zn, convertFileToJson as zt };
|
|
25578
25662
|
|
|
25579
|
-
//# sourceMappingURL=util-
|
|
25663
|
+
//# sourceMappingURL=util-CyIcgnv2.js.map
|