@rebasepro/cms 0.19.1 → 0.19.2-canary.g08eed46
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-BeX4b92r.js → CollectionEditorDialog-DQjLtp1W.js} +75 -70
- package/dist/CollectionEditorDialog-DQjLtp1W.js.map +1 -0
- package/dist/{PropertyEditView-C7thfj4L.js → PropertyEditView-BMCCD2OI.js} +6 -6
- package/dist/PropertyEditView-BMCCD2OI.js.map +1 -0
- package/dist/{RouterCollectionsStudioView-BtjzvB6E.js → RouterCollectionsStudioView-DwsbIAqr.js} +9 -9
- package/dist/RouterCollectionsStudioView-DwsbIAqr.js.map +1 -0
- package/dist/{SchemaChangeDialog-CkqK6KOC.js → SchemaChangeDialog-BeP0A4MJ.js} +3 -3
- package/dist/SchemaChangeDialog-BeP0A4MJ.js.map +1 -0
- package/dist/collection_editor/serializable_types.d.ts +20 -0
- package/dist/collection_editor_ui.js +5 -5
- package/dist/components/CollectionTableBinding/fields/CompactEntityCellField.d.ts +23 -0
- package/dist/components/CollectionTableBinding/fields/TableRelationSelectorField.d.ts +1 -1
- package/dist/components/RelationSelector.d.ts +5 -1
- package/dist/data_import/utils/file_headers.d.ts +28 -4
- package/dist/editor.js +11 -11
- package/dist/editor.js.map +1 -1
- package/dist/{export--arni_VY.js → export-DJoGYb89.js} +2 -2
- package/dist/{export--arni_VY.js.map → export-DJoGYb89.js.map} +1 -1
- package/dist/{history-C2TpoQwi.js → history-BBpsdTrJ.js} +4 -4
- package/dist/history-BBpsdTrJ.js.map +1 -0
- package/dist/{import-DTkXNoBg.js → import-C4VQ0rwO.js} +2 -2
- package/dist/{import-DTkXNoBg.js.map → import-C4VQ0rwO.js.map} +1 -1
- package/dist/index.js +30 -35
- package/dist/index.js.map +1 -1
- package/dist/{markdown-CklalUUk.js → markdown-CCqp8ibf.js} +3 -3
- package/dist/markdown-CCqp8ibf.js.map +1 -0
- package/dist/util/view_constants.d.ts +3 -3
- package/dist/{util-DE1WQW6h.js → util-4oPxPkbp.js} +339 -155
- package/dist/util-4oPxPkbp.js.map +1 -0
- package/dist/{util-CfLFggP7.js → util-DB31IoJE.js} +4 -4
- package/dist/{util-CfLFggP7.js.map → util-DB31IoJE.js.map} +1 -1
- package/package.json +12 -11
- package/dist/CollectionEditorDialog-BeX4b92r.js.map +0 -1
- package/dist/PropertyEditView-C7thfj4L.js.map +0 -1
- package/dist/RouterCollectionsStudioView-BtjzvB6E.js.map +0 -1
- package/dist/SchemaChangeDialog-CkqK6KOC.js.map +0 -1
- package/dist/history-C2TpoQwi.js.map +0 -1
- package/dist/markdown-CklalUUk.js.map +0 -1
- package/dist/util-DE1WQW6h.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as getThumbnailMeasure, r as sanitizeUrl, t as getPreviewSizeFrom } from "./util-
|
|
1
|
+
import { n as getThumbnailMeasure, r as sanitizeUrl, t as getPreviewSizeFrom } from "./util-DB31IoJE.js";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
3
|
import React, { Suspense, createContext, createElement, forwardRef, memo, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
4
4
|
import { deepEqual } from "fast-equals";
|
|
@@ -277,7 +277,7 @@ function FieldBlock({ propertyKey, property, showLabel, mode = "edit", label, ic
|
|
|
277
277
|
showLabel && /* @__PURE__ */ jsx(PropertyIdCopyTooltip, {
|
|
278
278
|
propertyKey,
|
|
279
279
|
children: /* @__PURE__ */ jsxs("div", {
|
|
280
|
-
className: cls("flex items-center gap-1.5 font-medium leading-tight mb-1.5", "text-[13px] text-text-
|
|
280
|
+
className: cls("flex items-center gap-1.5 font-medium leading-tight mb-1.5", "text-[13px] text-text-primary dark:text-text-primary-dark"),
|
|
281
281
|
children: [
|
|
282
282
|
(property || icon) && /* @__PURE__ */ jsx("span", {
|
|
283
283
|
className: "shrink-0 text-text-disabled dark:text-text-disabled-dark",
|
|
@@ -375,7 +375,7 @@ function isPromise(value) {
|
|
|
375
375
|
function FormRail({ fields, showRecordMeta, entity, renderField }) {
|
|
376
376
|
if (!fields.length && !showRecordMeta) return null;
|
|
377
377
|
return /* @__PURE__ */ jsxs("aside", {
|
|
378
|
-
className: cls("flex flex-col gap-6 shrink-0 w-76 @7xl/form:w-84
|
|
378
|
+
className: cls("flex flex-col gap-6 shrink-0 w-76 @7xl/form:w-84 overflow-y-auto", "px-5 py-6 bg-surface-sheet"),
|
|
379
379
|
children: [fields.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
380
380
|
className: "flex flex-col gap-5",
|
|
381
381
|
children: fields.map(renderField)
|
|
@@ -575,7 +575,7 @@ function useRailVisible(ref) {
|
|
|
575
575
|
* @group Preview components
|
|
576
576
|
*/
|
|
577
577
|
function EmptyValue({ className }) {
|
|
578
|
-
return /* @__PURE__ */ jsx("div", { className: "rounded-full bg-surface-200
|
|
578
|
+
return /* @__PURE__ */ jsx("div", { className: "rounded-full bg-surface-200/30 dark:bg-surface-200/20 w-5 h-2 inline-block" });
|
|
579
579
|
}
|
|
580
580
|
//#endregion
|
|
581
581
|
//#region src/preview/components/ImagePreview.tsx
|
|
@@ -592,7 +592,7 @@ function ImagePreview({ size, url, fill }) {
|
|
|
592
592
|
const { t } = useTranslation();
|
|
593
593
|
if (fill) {
|
|
594
594
|
if (hasError) return /* @__PURE__ */ jsx("div", {
|
|
595
|
-
className: "w-full h-full flex items-center justify-center bg-surface-
|
|
595
|
+
className: "w-full h-full flex items-center justify-center bg-surface-raised rounded-md",
|
|
596
596
|
children: /* @__PURE__ */ jsx(ImageOffIcon, { className: "text-surface-400 dark:text-surface-500" })
|
|
597
597
|
});
|
|
598
598
|
return /* @__PURE__ */ jsx("img", {
|
|
@@ -604,7 +604,7 @@ function ImagePreview({ size, url, fill }) {
|
|
|
604
604
|
}
|
|
605
605
|
if (size === "small") {
|
|
606
606
|
if (hasError) return /* @__PURE__ */ jsx("div", {
|
|
607
|
-
className: "flex items-center justify-center bg-surface-
|
|
607
|
+
className: "flex items-center justify-center bg-surface-raised rounded-md",
|
|
608
608
|
style: {
|
|
609
609
|
width: imageSize,
|
|
610
610
|
height: imageSize,
|
|
@@ -632,7 +632,7 @@ function ImagePreview({ size, url, fill }) {
|
|
|
632
632
|
height: imageSize
|
|
633
633
|
},
|
|
634
634
|
children: [hasError ? /* @__PURE__ */ jsx("div", {
|
|
635
|
-
className: "w-full h-full flex items-center justify-center bg-surface-
|
|
635
|
+
className: "w-full h-full flex items-center justify-center bg-surface-raised rounded-md",
|
|
636
636
|
children: /* @__PURE__ */ jsx(ImageOffIcon, { className: "text-surface-400 dark:text-surface-500" })
|
|
637
637
|
}) : /* @__PURE__ */ jsx("img", {
|
|
638
638
|
src: url,
|
|
@@ -2045,7 +2045,7 @@ var EntityPreviewContainer = React$1.forwardRef(({ children, hover, onClick, siz
|
|
|
2045
2045
|
ref,
|
|
2046
2046
|
tabIndex: 0,
|
|
2047
2047
|
style,
|
|
2048
|
-
className: cls("bg-
|
|
2048
|
+
className: cls("bg-surface-card", size === "small" ? "min-h-[32px]" : "min-h-[48px]", fullwidth ? "w-full" : "", "items-center overflow-hidden", hover ? "hover:bg-surface-hover group-hover:bg-surface-hover" : "", size === "small" ? "p-1" : "px-2 py-1", "flex border rounded-lg", onClick ? "cursor-pointer" : "", defaultBorderMixin, className),
|
|
2049
2049
|
role: onClick ? "button" : void 0,
|
|
2050
2050
|
onClick: (event) => {
|
|
2051
2051
|
if (onClick) {
|
|
@@ -2239,7 +2239,7 @@ function ReferencePreviewInternal(props) {
|
|
|
2239
2239
|
function ReferencePreviewExisting({ reference, collection, previewProperties, size, disabled, includeEntityLink, includeId, onClick, hover, textOnly }) {
|
|
2240
2240
|
const ResolvedEntityPreview = useComponentOverride("EntityPreview", EntityPreviewBinding);
|
|
2241
2241
|
useCustomizationController();
|
|
2242
|
-
const inline = useIsNestedEntityPreview() || Boolean(textOnly);
|
|
2242
|
+
const inline = useIsNestedEntityPreview() || Boolean(textOnly) || size === "small";
|
|
2243
2243
|
const { entity, dataLoading, dataLoadingError } = useFetch({
|
|
2244
2244
|
path: reference.path,
|
|
2245
2245
|
entityId: reference.id,
|
|
@@ -2480,7 +2480,7 @@ function RelationPreviewExisting({ relation, collection, previewProperties, size
|
|
|
2480
2480
|
const passedEntity = relation.data;
|
|
2481
2481
|
const ResolvedEntityPreview = useComponentOverride("EntityPreview", EntityPreviewBinding);
|
|
2482
2482
|
useCustomizationController();
|
|
2483
|
-
const inline = useIsNestedEntityPreview() || Boolean(textOnly);
|
|
2483
|
+
const inline = useIsNestedEntityPreview() || Boolean(textOnly) || size === "small";
|
|
2484
2484
|
const { entity, dataLoading, dataLoadingError } = useFetch({
|
|
2485
2485
|
path: relation.path,
|
|
2486
2486
|
entityId: passedEntity ? void 0 : relation.id,
|
|
@@ -3005,7 +3005,7 @@ function DatePreview({ date, mode = "date_time", timezone }) {
|
|
|
3005
3005
|
timeZoneName: "short"
|
|
3006
3006
|
}).formatToParts(date).find((p) => p.type === "timeZoneName")?.value ?? "";
|
|
3007
3007
|
return /* @__PURE__ */ jsxs("span", {
|
|
3008
|
-
className: "flex items-center gap-1",
|
|
3008
|
+
className: "flex items-center gap-1 font-mono tabular-nums",
|
|
3009
3009
|
children: [formattedDate, tzAbbrev && /* @__PURE__ */ jsxs("span", {
|
|
3010
3010
|
className: "text-xs text-slate-500 dark:text-slate-400",
|
|
3011
3011
|
children: [
|
|
@@ -3019,7 +3019,10 @@ function DatePreview({ date, mode = "date_time", timezone }) {
|
|
|
3019
3019
|
let dateFormat;
|
|
3020
3020
|
if (mode === "date") dateFormat = customizationController?.dateTimeFormat ? customizationController.dateTimeFormat.replace(/[, ]*[HhKk].*$/, "").trim() : "PP";
|
|
3021
3021
|
else dateFormat = customizationController?.dateTimeFormat ?? defaultDateFormat;
|
|
3022
|
-
return /* @__PURE__ */ jsx(
|
|
3022
|
+
return /* @__PURE__ */ jsx("span", {
|
|
3023
|
+
className: "font-mono tabular-nums",
|
|
3024
|
+
children: format(date, dateFormat, { locale: dateUtilsLocale })
|
|
3025
|
+
});
|
|
3023
3026
|
}
|
|
3024
3027
|
//#endregion
|
|
3025
3028
|
//#region src/preview/components/BooleanPreview.tsx
|
|
@@ -3033,7 +3036,7 @@ function BooleanPreview({ value, size, property, hideLabel }) {
|
|
|
3033
3036
|
checked: value,
|
|
3034
3037
|
padding: false,
|
|
3035
3038
|
size,
|
|
3036
|
-
color: "
|
|
3039
|
+
color: "primary"
|
|
3037
3040
|
}), !hideLabel && property.name && /* @__PURE__ */ jsx("span", {
|
|
3038
3041
|
className: cls("text-text-secondary dark:text-text-secondary-dark", size === "small" ? "text-sm" : ""),
|
|
3039
3042
|
children: property.name
|
|
@@ -3082,7 +3085,7 @@ function NumberPropertyPreview({ value, property, size }) {
|
|
|
3082
3085
|
const enumKey = numValue;
|
|
3083
3086
|
const enumValues = enumToObjectEntries(property.enum);
|
|
3084
3087
|
if (!enumValues) return /* @__PURE__ */ jsx("span", {
|
|
3085
|
-
className: size === "small" ? "text-sm" : "",
|
|
3088
|
+
className: size === "small" ? "font-mono tabular-nums text-sm" : "font-mono tabular-nums",
|
|
3086
3089
|
children: numValue
|
|
3087
3090
|
});
|
|
3088
3091
|
return /* @__PURE__ */ jsx(EnumValuesChip, {
|
|
@@ -3091,7 +3094,7 @@ function NumberPropertyPreview({ value, property, size }) {
|
|
|
3091
3094
|
size: size !== "medium" ? "small" : "medium"
|
|
3092
3095
|
});
|
|
3093
3096
|
} else return /* @__PURE__ */ jsx("span", {
|
|
3094
|
-
className: size === "small" ? "text-sm" : "",
|
|
3097
|
+
className: size === "small" ? "font-mono tabular-nums text-sm" : "font-mono tabular-nums",
|
|
3095
3098
|
children: formatNumber(numValue, property.admin?.format, customizationController?.locale)
|
|
3096
3099
|
});
|
|
3097
3100
|
}
|
|
@@ -3484,7 +3487,7 @@ function ReadOnlyFieldBinding({ propertyKey, value, error, showError, minimalist
|
|
|
3484
3487
|
className: "h-8 text-text-secondary dark:text-text-secondary-dark ml-3"
|
|
3485
3488
|
}),
|
|
3486
3489
|
/* @__PURE__ */ jsx("div", {
|
|
3487
|
-
className: cls("w-full overflow-x-scroll no-scrollbar flex items-center", skipCardWrapper ? "" : "rounded-lg border border-
|
|
3490
|
+
className: cls("w-full overflow-x-scroll no-scrollbar flex items-center", skipCardWrapper ? "" : "rounded-lg border border-hairline-strong px-3 min-h-12 opacity-80"),
|
|
3488
3491
|
children: /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(PropertyPreview, {
|
|
3489
3492
|
propertyKey,
|
|
3490
3493
|
value,
|
|
@@ -3661,6 +3664,7 @@ function VirtualTableSelect(props) {
|
|
|
3661
3664
|
}, 0);
|
|
3662
3665
|
}, []);
|
|
3663
3666
|
return multiple ? /* @__PURE__ */ jsx(MultiSelect, {
|
|
3667
|
+
invisible: true,
|
|
3664
3668
|
inputRef: ref,
|
|
3665
3669
|
className: "w-full h-full p-0 bg-transparent outline-none",
|
|
3666
3670
|
position: "item-aligned",
|
|
@@ -3680,6 +3684,7 @@ function VirtualTableSelect(props) {
|
|
|
3680
3684
|
}, enumConfig.id))
|
|
3681
3685
|
}) : /* @__PURE__ */ jsx(Select, {
|
|
3682
3686
|
inputRef: ref,
|
|
3687
|
+
invisible: true,
|
|
3683
3688
|
fullWidth: true,
|
|
3684
3689
|
className: "w-full h-full p-0 bg-transparent outline-none [&_button]:ring-0 [&_button]:ring-offset-0",
|
|
3685
3690
|
inputClassName: "ring-0 ring-offset-0 focus:ring-0 focus-visible:ring-0 outline-none focus:outline-none focus-visible:outline-none focus-visible:ring-offset-0",
|
|
@@ -3947,7 +3952,7 @@ var UserSelector = React$1.forwardRef(({ value, size = "medium", onValueChange,
|
|
|
3947
3952
|
children: /* @__PURE__ */ jsx(PopoverPrimitive.Content, {
|
|
3948
3953
|
ref: contentRef,
|
|
3949
3954
|
"data-user-selector-content": true,
|
|
3950
|
-
className: cls("z-50 overflow-hidden border bg-
|
|
3955
|
+
className: cls("z-50 overflow-hidden border bg-surface-card rounded-lg min-w-72", defaultBorderMixin),
|
|
3951
3956
|
align: "start",
|
|
3952
3957
|
sideOffset: 8,
|
|
3953
3958
|
side: "bottom",
|
|
@@ -4012,7 +4017,7 @@ var UserSelector = React$1.forwardRef(({ value, size = "medium", onValueChange,
|
|
|
4012
4017
|
e.stopPropagation();
|
|
4013
4018
|
},
|
|
4014
4019
|
onSelect: () => handleItemClick(item),
|
|
4015
|
-
className: cls("flex flex-row items-center gap-1.5 m-1 p-1.5 rounded-xs cursor-pointer ring-offset-transparent", isSelected && "bg-surface-
|
|
4020
|
+
className: cls("flex flex-row items-center gap-1.5 m-1 p-1.5 rounded-xs cursor-pointer ring-offset-transparent", isSelected && "bg-surface-active", "aria-selected:outline-hidden aria-selected:bg-surface-active"),
|
|
4016
4021
|
children: /* @__PURE__ */ jsx(UserDisplay, { user: item.user })
|
|
4017
4022
|
}, item.uid);
|
|
4018
4023
|
}),
|
|
@@ -4333,6 +4338,60 @@ function TableStorageItemPreview({ propertyKey, property, value, size, entity })
|
|
|
4333
4338
|
});
|
|
4334
4339
|
}
|
|
4335
4340
|
//#endregion
|
|
4341
|
+
//#region src/components/CollectionTableBinding/fields/CompactEntityCellField.tsx
|
|
4342
|
+
/**
|
|
4343
|
+
* The one-line editor a reference or relation cell shows while selected, at
|
|
4344
|
+
* the row sizes that carry small previews (`xs`, `s`, `m`).
|
|
4345
|
+
*
|
|
4346
|
+
* The flow it replaces: at 48px the selected cell swapped its resting inline
|
|
4347
|
+
* line for the card editor built for 140px rows, which was clipped to its top
|
|
4348
|
+
* third and whose only click opened the picker — there was no way to look at
|
|
4349
|
+
* the record. Here the line stays (its title opens the record in the side
|
|
4350
|
+
* panel, exactly as it does at rest), a pencil opens the picker and a cross
|
|
4351
|
+
* clears the value. Click the name to see it, click the pencil to change it.
|
|
4352
|
+
*/
|
|
4353
|
+
function CompactEntityCellField({ children, empty, disabled, onEdit, onClear, emptyLabel }) {
|
|
4354
|
+
const { t } = useTranslation();
|
|
4355
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
4356
|
+
className: "w-full min-w-0 flex items-center gap-0.5 min-h-8",
|
|
4357
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
4358
|
+
className: "grow min-w-0 flex items-center gap-x-3 overflow-hidden text-sm",
|
|
4359
|
+
children: empty ? /* @__PURE__ */ jsx("button", {
|
|
4360
|
+
type: "button",
|
|
4361
|
+
disabled,
|
|
4362
|
+
onClick: (e) => {
|
|
4363
|
+
e.stopPropagation();
|
|
4364
|
+
onEdit();
|
|
4365
|
+
},
|
|
4366
|
+
className: cls("truncate text-left text-text-secondary dark:text-text-secondary-dark", !disabled && "cursor-pointer hover:text-text-primary dark:hover:text-text-primary-dark"),
|
|
4367
|
+
children: emptyLabel ?? t("select_reference")
|
|
4368
|
+
}) : children
|
|
4369
|
+
}), !disabled && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Tooltip, {
|
|
4370
|
+
title: t("edit"),
|
|
4371
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
4372
|
+
size: "small",
|
|
4373
|
+
"aria-label": t("edit"),
|
|
4374
|
+
onClick: (e) => {
|
|
4375
|
+
e.stopPropagation();
|
|
4376
|
+
onEdit();
|
|
4377
|
+
},
|
|
4378
|
+
children: /* @__PURE__ */ jsx(PencilIcon, {})
|
|
4379
|
+
})
|
|
4380
|
+
}), !empty && /* @__PURE__ */ jsx(Tooltip, {
|
|
4381
|
+
title: t("clear"),
|
|
4382
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
4383
|
+
size: "small",
|
|
4384
|
+
"aria-label": t("clear"),
|
|
4385
|
+
onClick: (e) => {
|
|
4386
|
+
e.stopPropagation();
|
|
4387
|
+
onClear();
|
|
4388
|
+
},
|
|
4389
|
+
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
4390
|
+
})
|
|
4391
|
+
})] })]
|
|
4392
|
+
});
|
|
4393
|
+
}
|
|
4394
|
+
//#endregion
|
|
4336
4395
|
//#region src/components/CollectionTableBinding/fields/TableReferenceField.tsx
|
|
4337
4396
|
var DefaultMissingReference = () => null;
|
|
4338
4397
|
function TableReferenceFieldResolver(props) {
|
|
@@ -4417,13 +4476,29 @@ var TableReferenceFieldInternal = React.memo(function TableReferenceFieldInterna
|
|
|
4417
4476
|
else return /* @__PURE__ */ jsx(ErrorView, { error: "Data is not an array of references" });
|
|
4418
4477
|
};
|
|
4419
4478
|
if (!collection) return /* @__PURE__ */ jsx(ErrorView, { error: "The specified collection does not exist" });
|
|
4479
|
+
if (getPreviewSizeFrom(size) === "small") return /* @__PURE__ */ jsx(CompactEntityCellField, {
|
|
4480
|
+
empty: valueNotSet,
|
|
4481
|
+
disabled,
|
|
4482
|
+
onEdit: handleOpen,
|
|
4483
|
+
onClear: () => updateValue(multiselect ? [] : null),
|
|
4484
|
+
emptyLabel: title,
|
|
4485
|
+
children: (!internalValue ? [] : Array.isArray(internalValue) ? internalValue : [internalValue]).map((reference, index) => reference && reference.isEntityReference && reference.isEntityReference() ? /* @__PURE__ */ jsx(ReferencePreview, {
|
|
4486
|
+
size: "small",
|
|
4487
|
+
reference,
|
|
4488
|
+
hover: false,
|
|
4489
|
+
disabled: !path,
|
|
4490
|
+
previewProperties,
|
|
4491
|
+
includeId,
|
|
4492
|
+
includeEntityLink
|
|
4493
|
+
}, `compact_ref__`) : /* @__PURE__ */ jsx(ErrorView, { error: "Value is not a reference" }, `compact_ref__`))
|
|
4494
|
+
});
|
|
4420
4495
|
return /* @__PURE__ */ jsxs("div", {
|
|
4421
4496
|
className: "w-full group",
|
|
4422
4497
|
children: [
|
|
4423
4498
|
internalValue && !multiselect && buildSingleReferenceField(),
|
|
4424
4499
|
internalValue && multiselect && buildMultipleReferenceField(),
|
|
4425
4500
|
valueNotSet && /* @__PURE__ */ jsxs(EntityPreviewContainer, {
|
|
4426
|
-
className: cls("px-3 py-2 text-sm font-medium flex items-center", multiselect ? "gap-4" : "gap-6", disabled ? "text-surface-accent-500" : "cursor-pointer text-text-secondary dark:text-text-secondary-dark hover:bg-surface-
|
|
4501
|
+
className: cls("px-3 py-2 text-sm font-medium flex items-center", multiselect ? "gap-4" : "gap-6", disabled ? "text-surface-accent-500" : "cursor-pointer text-text-secondary dark:text-text-secondary-dark hover:bg-surface-hover group-hover:bg-surface-hover"),
|
|
4427
4502
|
onClick: handleOpen,
|
|
4428
4503
|
size: "medium",
|
|
4429
4504
|
children: [/* @__PURE__ */ jsx(PencilIcon, { className: "ml-2 mr-1 text-surface-300 dark:text-surface-600" }), title]
|
|
@@ -4441,7 +4516,7 @@ function TableMultipleRelationField(props) {
|
|
|
4441
4516
|
});
|
|
4442
4517
|
}
|
|
4443
4518
|
var TableMultipleRelationFieldInternal = React.memo(function TableMultipleRelationFieldInternal(props) {
|
|
4444
|
-
const { name, internalValue, updateValue, previewProperties, title, disabled, fixedFilter, collection, includeId, includeEntityLink } = props;
|
|
4519
|
+
const { name, internalValue, updateValue, previewProperties, title, disabled, fixedFilter, collection, includeId, includeEntityLink, size } = props;
|
|
4445
4520
|
const value = Array.isArray(internalValue) ? internalValue : [];
|
|
4446
4521
|
const onMultipleEntitiesSelected = useCallback((entities) => {
|
|
4447
4522
|
updateValue(entities.map((e) => getRelationFrom(e)));
|
|
@@ -4480,10 +4555,29 @@ var TableMultipleRelationFieldInternal = React.memo(function TableMultipleRelati
|
|
|
4480
4555
|
else return /* @__PURE__ */ jsx(ErrorView, { error: "Data is not an array of relations" });
|
|
4481
4556
|
};
|
|
4482
4557
|
if (!collection) return /* @__PURE__ */ jsx(ErrorView, { error: "The specified collection does not exist" });
|
|
4558
|
+
if (getPreviewSizeFrom(size) === "small") return /* @__PURE__ */ jsx(CompactEntityCellField, {
|
|
4559
|
+
empty: valueNotSet,
|
|
4560
|
+
disabled,
|
|
4561
|
+
onEdit: handleOpen,
|
|
4562
|
+
onClear: () => updateValue([]),
|
|
4563
|
+
emptyLabel: title,
|
|
4564
|
+
children: value.map((item, index) => {
|
|
4565
|
+
const relationItem = normalizeToEntityRelation(item);
|
|
4566
|
+
if (!relationItem) return null;
|
|
4567
|
+
return /* @__PURE__ */ jsx(RelationPreview, {
|
|
4568
|
+
size: "small",
|
|
4569
|
+
relation: relationItem,
|
|
4570
|
+
hover: false,
|
|
4571
|
+
previewProperties,
|
|
4572
|
+
includeId,
|
|
4573
|
+
includeEntityLink
|
|
4574
|
+
}, `compact_rel__`);
|
|
4575
|
+
})
|
|
4576
|
+
});
|
|
4483
4577
|
return /* @__PURE__ */ jsxs("div", {
|
|
4484
4578
|
className: "w-full group",
|
|
4485
4579
|
children: [internalValue && buildMultipleRelationField(), valueNotSet && /* @__PURE__ */ jsxs(EntityPreviewContainer, {
|
|
4486
|
-
className: cls("px-3 py-2 text-sm font-medium flex items-center gap-4", disabled ? "text-surface-accent-500" : "cursor-pointer text-text-secondary dark:text-text-secondary-dark hover:bg-surface-
|
|
4580
|
+
className: cls("px-3 py-2 text-sm font-medium flex items-center gap-4", disabled ? "text-surface-accent-500" : "cursor-pointer text-text-secondary dark:text-text-secondary-dark hover:bg-surface-hover group-hover:bg-surface-hover"),
|
|
4487
4581
|
onClick: handleOpen,
|
|
4488
4582
|
size: "medium",
|
|
4489
4583
|
children: [/* @__PURE__ */ jsx(PencilIcon, { className: "ml-2 mr-1 text-surface-300 dark:text-surface-600" }), title]
|
|
@@ -4579,13 +4673,32 @@ var TableRelationFieldInternal = React.memo(function TableRelationFieldInternal(
|
|
|
4579
4673
|
else return /* @__PURE__ */ jsx(ErrorView, { error: "Data is not an array of relations" });
|
|
4580
4674
|
};
|
|
4581
4675
|
if (!collection) return /* @__PURE__ */ jsx(ErrorView, { error: "The specified collection does not exist" });
|
|
4676
|
+
if (getPreviewSizeFrom(size) === "small") return /* @__PURE__ */ jsx(CompactEntityCellField, {
|
|
4677
|
+
empty: valueNotSet,
|
|
4678
|
+
disabled,
|
|
4679
|
+
onEdit: handleOpen,
|
|
4680
|
+
onClear: () => updateValue(multiselect ? [] : null),
|
|
4681
|
+
emptyLabel: title,
|
|
4682
|
+
children: (!internalValue ? [] : Array.isArray(internalValue) ? internalValue : [internalValue]).map((item, index) => {
|
|
4683
|
+
const relationItem = normalizeToEntityRelation(item);
|
|
4684
|
+
if (!relationItem) return null;
|
|
4685
|
+
return /* @__PURE__ */ jsx(RelationPreview, {
|
|
4686
|
+
size: "small",
|
|
4687
|
+
relation: relationItem,
|
|
4688
|
+
hover: false,
|
|
4689
|
+
previewProperties,
|
|
4690
|
+
includeId,
|
|
4691
|
+
includeEntityLink
|
|
4692
|
+
}, `compact_rel__`);
|
|
4693
|
+
})
|
|
4694
|
+
});
|
|
4582
4695
|
return /* @__PURE__ */ jsxs("div", {
|
|
4583
4696
|
className: "w-full group",
|
|
4584
4697
|
children: [
|
|
4585
4698
|
internalValue && !multiselect && buildSingleRelationField(),
|
|
4586
4699
|
internalValue && multiselect && buildMultipleRelationField(),
|
|
4587
4700
|
valueNotSet && /* @__PURE__ */ jsxs(EntityPreviewContainer, {
|
|
4588
|
-
className: cls("px-3 py-2 text-sm font-medium flex items-center", multiselect ? "gap-4" : "gap-6", disabled ? "text-surface-accent-500" : "cursor-pointer text-text-secondary dark:text-text-secondary-dark hover:bg-surface-
|
|
4701
|
+
className: cls("px-3 py-2 text-sm font-medium flex items-center", multiselect ? "gap-4" : "gap-6", disabled ? "text-surface-accent-500" : "cursor-pointer text-text-secondary dark:text-text-secondary-dark hover:bg-surface-hover group-hover:bg-surface-hover"),
|
|
4589
4702
|
onClick: handleOpen,
|
|
4590
4703
|
size: "medium",
|
|
4591
4704
|
children: [/* @__PURE__ */ jsx(PencilIcon, { className: "ml-2 mr-1 text-surface-300 dark:text-surface-600" }), title]
|
|
@@ -4922,6 +5035,7 @@ var RelationSelector = React$1.forwardRef(({ value, size = "medium", onValueChan
|
|
|
4922
5035
|
});
|
|
4923
5036
|
},
|
|
4924
5037
|
className: cls({
|
|
5038
|
+
"min-h-8 py-0.5 px-2": size === "compact",
|
|
4925
5039
|
"min-h-[42px] py-1 px-2": size === "small",
|
|
4926
5040
|
"min-h-[56px] py-2 px-4": size === "medium",
|
|
4927
5041
|
"min-h-[48px] py-1 px-4": size === "large"
|
|
@@ -4937,19 +5051,36 @@ var RelationSelector = React$1.forwardRef(({ value, size = "medium", onValueChan
|
|
|
4937
5051
|
}) : selectedItems.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
4938
5052
|
className: "flex flex-wrap items-center gap-1.5 text-start flex-1 min-w-0 mr-2",
|
|
4939
5053
|
children: selectedItems.map((item) => {
|
|
4940
|
-
if (!useChips || !multiple)
|
|
4941
|
-
|
|
4942
|
-
children: item.data ? /* @__PURE__ */ jsx(EntityPreviewBindingData, {
|
|
4943
|
-
size: "medium",
|
|
5054
|
+
if (!useChips || !multiple) {
|
|
5055
|
+
if (size === "compact") return item.data ? /* @__PURE__ */ jsx(InlineEntityPreview, {
|
|
4944
5056
|
entity: item.data,
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
5057
|
+
onClick: () => {
|
|
5058
|
+
closePopover();
|
|
5059
|
+
sidePanelController.open({
|
|
5060
|
+
entityId: item.data.id,
|
|
5061
|
+
path: item.data.path,
|
|
5062
|
+
collection,
|
|
5063
|
+
updateUrl: true
|
|
5064
|
+
});
|
|
5065
|
+
}
|
|
5066
|
+
}, String(item.id)) : /* @__PURE__ */ jsx("span", {
|
|
4949
5067
|
className: "text-sm truncate",
|
|
4950
5068
|
children: item.label
|
|
4951
|
-
})
|
|
4952
|
-
|
|
5069
|
+
}, String(item.id));
|
|
5070
|
+
return /* @__PURE__ */ jsx("div", {
|
|
5071
|
+
className: "flex flex-row items-center gap-1 truncate",
|
|
5072
|
+
children: item.data ? /* @__PURE__ */ jsx(EntityPreviewBindingData, {
|
|
5073
|
+
size: "medium",
|
|
5074
|
+
entity: item.data,
|
|
5075
|
+
includeEntityLink: false,
|
|
5076
|
+
includeId: false,
|
|
5077
|
+
onSidePanelClick: closePopover
|
|
5078
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
5079
|
+
className: "text-sm truncate",
|
|
5080
|
+
children: item.label
|
|
5081
|
+
})
|
|
5082
|
+
}, String(item.id));
|
|
5083
|
+
}
|
|
4953
5084
|
return /* @__PURE__ */ jsxs(Chip, {
|
|
4954
5085
|
size: "small",
|
|
4955
5086
|
className: cls("flex flex-row items-center gap-1 truncate"),
|
|
@@ -4975,7 +5106,7 @@ var RelationSelector = React$1.forwardRef(({ value, size = "medium", onValueChan
|
|
|
4975
5106
|
children: resolvedPlaceholder
|
|
4976
5107
|
}), /* @__PURE__ */ jsxs("div", {
|
|
4977
5108
|
className: "flex items-center flex-shrink-0",
|
|
4978
|
-
children: [!multiple && selectedItems.length === 1 && selectedItems[0]?.data && /* @__PURE__ */ jsx(Tooltip, {
|
|
5109
|
+
children: [size !== "compact" && !multiple && selectedItems.length === 1 && selectedItems[0]?.data && /* @__PURE__ */ jsx(Tooltip, {
|
|
4979
5110
|
title: `Open ${selectedItems[0].label}`,
|
|
4980
5111
|
children: /* @__PURE__ */ jsx(IconButton, {
|
|
4981
5112
|
component: "div",
|
|
@@ -4997,7 +5128,7 @@ var RelationSelector = React$1.forwardRef(({ value, size = "medium", onValueChan
|
|
|
4997
5128
|
children: /* @__PURE__ */ jsx(ArrowRightToLineIcon, { size: iconSize.small })
|
|
4998
5129
|
})
|
|
4999
5130
|
}), /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
5000
|
-
size: size === "small" ? iconSize.small : iconSize.medium,
|
|
5131
|
+
size: size === "small" || size === "compact" ? iconSize.small : iconSize.medium,
|
|
5001
5132
|
className: cls("transition", isPopoverOpen ? "rotate-180" : "")
|
|
5002
5133
|
})]
|
|
5003
5134
|
})]
|
|
@@ -5008,7 +5139,7 @@ var RelationSelector = React$1.forwardRef(({ value, size = "medium", onValueChan
|
|
|
5008
5139
|
children: /* @__PURE__ */ jsx(PopoverPrimitive.Content, {
|
|
5009
5140
|
ref: contentRef,
|
|
5010
5141
|
"data-relation-selector-content": true,
|
|
5011
|
-
className: cls("z-50 overflow-hidden border bg-
|
|
5142
|
+
className: cls("z-50 overflow-hidden border bg-surface-card rounded-lg min-w-72", defaultBorderMixin),
|
|
5012
5143
|
align: "start",
|
|
5013
5144
|
sideOffset: 8,
|
|
5014
5145
|
side: "bottom",
|
|
@@ -5086,7 +5217,7 @@ var RelationSelector = React$1.forwardRef(({ value, size = "medium", onValueChan
|
|
|
5086
5217
|
e.stopPropagation();
|
|
5087
5218
|
},
|
|
5088
5219
|
onSelect: () => onItemClick(item),
|
|
5089
|
-
className: cls("flex flex-row items-center gap-1.5 m-1 p-1 rounded-xs cursor-pointer ring-offset-transparent", isSelected && "bg-surface-
|
|
5220
|
+
className: cls("flex flex-row items-center gap-1.5 m-1 p-1 rounded-xs cursor-pointer ring-offset-transparent", isSelected && "bg-surface-active", "aria-selected:outline-hidden aria-selected:bg-surface-active"),
|
|
5090
5221
|
children: [multiple && /* @__PURE__ */ jsx(InnerCheckBox, { checked: isSelected }), item.data ? /* @__PURE__ */ jsx("div", {
|
|
5091
5222
|
className: "flex flex-row items-center gap-2 min-w-0 w-full",
|
|
5092
5223
|
children: /* @__PURE__ */ jsx(EntityPreviewBindingData, {
|
|
@@ -5130,7 +5261,7 @@ var RelationSelector = React$1.forwardRef(({ value, size = "medium", onValueChan
|
|
|
5130
5261
|
e.stopPropagation();
|
|
5131
5262
|
},
|
|
5132
5263
|
onClick: handleCreateNew,
|
|
5133
|
-
className: cls("w-full flex flex-row items-center gap-2 px-4 py-3 text-sm text-left", "text-primary hover:bg-surface-
|
|
5264
|
+
className: cls("w-full flex flex-row items-center gap-2 px-4 py-3 text-sm text-left", "text-primary hover:bg-surface-hover"),
|
|
5134
5265
|
children: [/* @__PURE__ */ jsx(PlusIcon, { size: iconSize.smallest }), /* @__PURE__ */ jsx("span", {
|
|
5135
5266
|
className: "truncate",
|
|
5136
5267
|
children: searchString.trim() ? t("add_named", { name: searchString.trim() }) : t("add_specific", { name: collection.singularName ?? collection.name })
|
|
@@ -5147,7 +5278,7 @@ function InnerCheckBox({ checked }) {
|
|
|
5147
5278
|
return /* @__PURE__ */ jsx("div", {
|
|
5148
5279
|
className: cls("p-2 w-8 h-8 inline-flex items-center justify-center text-sm font-medium focus:outline-hidden transition-colors ease-in-out duration-150"),
|
|
5149
5280
|
children: /* @__PURE__ */ jsx("div", {
|
|
5150
|
-
className: cls("border-2 relative transition-colors ease-in-out duration-150 w-4 h-4 rounded-xs flex items-center justify-center", checked ? "bg-primary text-surface-accent-100 dark:text-surface-accent-900 border-transparent" : "bg-
|
|
5281
|
+
className: cls("border-2 relative transition-colors ease-in-out duration-150 w-4 h-4 rounded-xs flex items-center justify-center", checked ? "bg-primary text-surface-accent-100 dark:text-surface-accent-900 border-transparent" : "bg-surface-card border-surface-accent-800 dark:border-surface-accent-500"),
|
|
5151
5282
|
children: checked && /* @__PURE__ */ jsx(CheckIcon, {
|
|
5152
5283
|
size: iconSize.smallest,
|
|
5153
5284
|
className: "absolute"
|
|
@@ -5392,14 +5523,14 @@ function RelationDialogBindingComponent({ propertyKey, internalValue, updateValu
|
|
|
5392
5523
|
});
|
|
5393
5524
|
}
|
|
5394
5525
|
/** Stable component for relation fields rendered with the inline selector */
|
|
5395
|
-
function RelationSelectorBindingComponent({ propertyKey, internalValue, updateValue, disabled, property }) {
|
|
5526
|
+
function RelationSelectorBindingComponent({ propertyKey, internalValue, updateValue, disabled, property, size }) {
|
|
5396
5527
|
const relProp = property;
|
|
5397
5528
|
return /* @__PURE__ */ jsx(TableRelationSelectorField, {
|
|
5529
|
+
size: getPreviewSizeFrom(size) === "small" ? "compact" : "medium",
|
|
5398
5530
|
name: propertyKey,
|
|
5399
5531
|
internalValue,
|
|
5400
5532
|
updateValue,
|
|
5401
5533
|
disabled,
|
|
5402
|
-
size: "small",
|
|
5403
5534
|
relation: relProp.relation,
|
|
5404
5535
|
fixedFilter: relProp.admin?.fixedFilter
|
|
5405
5536
|
});
|
|
@@ -5746,7 +5877,7 @@ var EntityTableCell = React.memo(function EntityTableCell({ children, actions, s
|
|
|
5746
5877
|
const setOnHoverFalse = useCallback(() => setOnHover(false), []);
|
|
5747
5878
|
const borderClass = showError ? "border-red-500" : isSelected ? "border-primary" : "border-transparent";
|
|
5748
5879
|
const result = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", {
|
|
5749
|
-
className: cls("transition-colors duration-500", `flex relative h-full rounded-md p-${p} border-4`, showSaved ? "bg-primary/20 dark:bg-primary/20" : onHover && !disabled ? "bg-surface-
|
|
5880
|
+
className: cls("transition-colors duration-500", `flex relative h-full rounded-md p-${p} border-4`, showSaved ? "bg-primary/20 dark:bg-primary/20" : onHover && !disabled ? "bg-surface-hover" : "", hideOverflow ? "overflow-hidden" : "", isSelected && !showSaved ? "bg-surface-raised" : "", borderClass),
|
|
5750
5881
|
ref,
|
|
5751
5882
|
style: {
|
|
5752
5883
|
justifyContent,
|
|
@@ -5780,7 +5911,7 @@ var EntityTableCell = React.memo(function EntityTableCell({ children, actions, s
|
|
|
5780
5911
|
return sortableNodeRef ? /* @__PURE__ */ jsx("div", {
|
|
5781
5912
|
ref: sortableNodeRef,
|
|
5782
5913
|
style: sortableStyle,
|
|
5783
|
-
className: cls("flex-shrink-0", frozen && "sticky left-0 z-10 bg-
|
|
5914
|
+
className: cls("flex-shrink-0", frozen && "sticky left-0 z-10 bg-surface-card"),
|
|
5784
5915
|
...sortableAttrsWithoutTabIndex,
|
|
5785
5916
|
children: showError ? /* @__PURE__ */ jsx(ErrorTooltip, {
|
|
5786
5917
|
className: "flex h-full w-full",
|
|
@@ -6116,18 +6247,18 @@ var CollectionRowActions = function CollectionRowActions({ entity, collection, p
|
|
|
6116
6247
|
const hasDraft = (collection ? getLocalChangesBackup(collection) : false) ? getEntityFromCache(path + "/" + entity.id) : false;
|
|
6117
6248
|
const iconSize = "small";
|
|
6118
6249
|
const content = /* @__PURE__ */ jsxs("div", {
|
|
6119
|
-
className: cls("h-full flex items-center justify-center flex-col z-10", isSelected ? "bg-surface-
|
|
6250
|
+
className: cls("h-full flex items-center justify-center flex-col z-10", isSelected ? "bg-surface-raised" : "bg-surface-card group-hover:bg-surface-card-hover", frozen ? "sticky left-0" : ""),
|
|
6120
6251
|
onClick: useCallback((event) => {
|
|
6121
6252
|
event.stopPropagation();
|
|
6122
6253
|
}, []),
|
|
6123
6254
|
style: {
|
|
6124
6255
|
width,
|
|
6125
|
-
position: frozen ? "sticky" : "
|
|
6256
|
+
position: frozen ? "sticky" : "relative",
|
|
6126
6257
|
left: frozen ? 0 : "initial",
|
|
6127
6258
|
contain: "strict"
|
|
6128
6259
|
},
|
|
6129
6260
|
children: [(hasActions || selectionEnabled) && /* @__PURE__ */ jsxs("div", {
|
|
6130
|
-
className: "flex items-center justify-center gap-0.5",
|
|
6261
|
+
className: cls("absolute inset-0 flex items-center justify-center gap-0.5", isSelected ? "bg-surface-raised" : "bg-surface-card group-hover:bg-surface-card-hover opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity duration-100"),
|
|
6131
6262
|
children: [
|
|
6132
6263
|
uncollapsedActions.map((action, index) => {
|
|
6133
6264
|
const isEditAction = action.key === "edit";
|
|
@@ -6196,7 +6327,7 @@ var CollectionRowActions = function CollectionRowActions({ entity, collection, p
|
|
|
6196
6327
|
})
|
|
6197
6328
|
})
|
|
6198
6329
|
]
|
|
6199
|
-
}), !hideId &&
|
|
6330
|
+
}), !hideId && /* @__PURE__ */ jsx("div", {
|
|
6200
6331
|
className: "w-[138px] overflow-hidden truncate font-mono text-xs text-text-secondary dark:text-text-secondary-dark max-w-full text-ellipsis px-2 align-center justify-center flex items-center gap-1",
|
|
6201
6332
|
onClick: (event) => {
|
|
6202
6333
|
event.stopPropagation();
|
|
@@ -6212,7 +6343,7 @@ var CollectionRowActions = function CollectionRowActions({ entity, collection, p
|
|
|
6212
6343
|
return /* @__PURE__ */ jsx("div", {
|
|
6213
6344
|
ref: sortableNodeRef,
|
|
6214
6345
|
style: sortableStyle,
|
|
6215
|
-
className: cls("flex-shrink-0", frozen && "sticky left-0 z-10 bg-
|
|
6346
|
+
className: cls("flex-shrink-0", frozen && "sticky left-0 z-10 bg-surface-card"),
|
|
6216
6347
|
...sortableAttrsWithoutTabIndex,
|
|
6217
6348
|
children: content
|
|
6218
6349
|
});
|
|
@@ -6228,7 +6359,7 @@ function CollectionTableToolbar({ actions, actionsStart, loading, onTextSearch,
|
|
|
6228
6359
|
const addButton = actionChildren.length > 0 ? actionChildren[actionChildren.length - 1] : null;
|
|
6229
6360
|
const secondaryActions = actionChildren.slice(0, -1);
|
|
6230
6361
|
return /* @__PURE__ */ jsxs("div", {
|
|
6231
|
-
className: cls(
|
|
6362
|
+
className: cls("no-scrollbar min-h-[52px] overflow-x-auto px-2 md:px-4 bg-surface-sheet flex flex-row justify-between items-center w-full"),
|
|
6232
6363
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
6233
6364
|
className: "flex items-center gap-1 md:mr-4 mr-2 min-w-0",
|
|
6234
6365
|
children: [
|
|
@@ -6313,7 +6444,6 @@ function propertiesToColumns({ properties, sortable, fixedFilter, engine, Additi
|
|
|
6313
6444
|
return [{
|
|
6314
6445
|
key,
|
|
6315
6446
|
align: getTableCellAlignment(property),
|
|
6316
|
-
icon: getIconForProperty(property, "small"),
|
|
6317
6447
|
title: property.name ?? key,
|
|
6318
6448
|
sortable: sortable && sortableProperty(property),
|
|
6319
6449
|
filter: !disabledFilter && filterable,
|
|
@@ -6838,7 +6968,7 @@ function ReferenceFilterField({ value, setValue, isArray, path, includeId = true
|
|
|
6838
6968
|
children: multiple ? t("select_references") : t("select_reference")
|
|
6839
6969
|
}),
|
|
6840
6970
|
!isArray && /* @__PURE__ */ jsxs(Label, {
|
|
6841
|
-
className: "border cursor-pointer rounded-md p-2 flex items-center gap-2 bg-surface-
|
|
6971
|
+
className: "border border-hairline cursor-pointer rounded-md p-2 flex items-center gap-2 bg-surface-field hover:bg-surface-field-hover",
|
|
6842
6972
|
htmlFor: nullFilterId,
|
|
6843
6973
|
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
6844
6974
|
id: nullFilterId,
|
|
@@ -6999,7 +7129,7 @@ function RelationFilterField({ value, setValue, relation, name: _name, hidden: _
|
|
|
6999
7129
|
disabled: nullFiltered,
|
|
7000
7130
|
size: "medium"
|
|
7001
7131
|
}), /* @__PURE__ */ jsxs(Label, {
|
|
7002
|
-
className: "border cursor-pointer rounded-md p-2 flex items-center gap-2 bg-surface-
|
|
7132
|
+
className: "border border-hairline cursor-pointer rounded-md p-2 flex items-center gap-2 bg-surface-field hover:bg-surface-field-hover",
|
|
7003
7133
|
htmlFor: nullFilterId,
|
|
7004
7134
|
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
7005
7135
|
id: nullFilterId,
|
|
@@ -7240,7 +7370,7 @@ var SelectableTable = function SelectableTable({ onValueChange, cellRenderer, on
|
|
|
7240
7370
|
return /* @__PURE__ */ jsx(SelectableTableContext.Provider, {
|
|
7241
7371
|
value: contextValue,
|
|
7242
7372
|
children: /* @__PURE__ */ jsx("div", {
|
|
7243
|
-
className: "h-full w-full flex flex-col bg-
|
|
7373
|
+
className: "h-full w-full flex flex-col bg-surface-card",
|
|
7244
7374
|
ref,
|
|
7245
7375
|
children: /* @__PURE__ */ jsx(VirtualTable, {
|
|
7246
7376
|
data,
|
|
@@ -7263,7 +7393,7 @@ var SelectableTable = function SelectableTable({ onValueChange, cellRenderer, on
|
|
|
7263
7393
|
checkFilterCombination,
|
|
7264
7394
|
createFilterField: filterable ? createFilterField : void 0,
|
|
7265
7395
|
rowClassName: useCallback((entity) => {
|
|
7266
|
-
return highlightedRow?.(entity) ? "bg-surface-
|
|
7396
|
+
return highlightedRow?.(entity) ? "!bg-surface-raised" : "";
|
|
7267
7397
|
}, [highlightedRow]),
|
|
7268
7398
|
className: "grow",
|
|
7269
7399
|
emptyComponent,
|
|
@@ -7502,7 +7632,7 @@ var CollectionTableBinding = function CollectionTableBinding({ className, style,
|
|
|
7502
7632
|
return /* @__PURE__ */ jsxs("div", {
|
|
7503
7633
|
ref,
|
|
7504
7634
|
style,
|
|
7505
|
-
className: cls("h-full w-full flex flex-col bg-
|
|
7635
|
+
className: cls("h-full w-full flex flex-col bg-surface-card", className),
|
|
7506
7636
|
children: [!hideToolbar && /* @__PURE__ */ jsx(CollectionTableToolbar, {
|
|
7507
7637
|
onTextSearch,
|
|
7508
7638
|
title,
|
|
@@ -7977,7 +8107,7 @@ function ArrayContainerItem({ nodeRef, style, dragHandleProps, index, internalId
|
|
|
7977
8107
|
return /* @__PURE__ */ jsx("div", {
|
|
7978
8108
|
ref: nodeRef,
|
|
7979
8109
|
style,
|
|
7980
|
-
className: `relative ${!isDragging ? "hover
|
|
8110
|
+
className: `relative ${!isDragging ? "hover:bg-surface-hover" : ""} rounded-md opacity-100`,
|
|
7981
8111
|
children: /* @__PURE__ */ jsxs("div", {
|
|
7982
8112
|
className: "flex items-start",
|
|
7983
8113
|
children: [/* @__PURE__ */ jsx("div", {
|
|
@@ -8250,15 +8380,26 @@ function getRandomId$1() {
|
|
|
8250
8380
|
//#endregion
|
|
8251
8381
|
//#region src/data_import/utils/file_headers.ts
|
|
8252
8382
|
/**
|
|
8253
|
-
*
|
|
8254
|
-
*
|
|
8383
|
+
* Read the header names out of the first row.
|
|
8384
|
+
*
|
|
8385
|
+
* A column whose header is blank is left out entirely, so it contributes
|
|
8386
|
+
* neither a field nor a value — the same intent as the old `filter(Boolean)`,
|
|
8387
|
+
* without the shift.
|
|
8255
8388
|
*/
|
|
8256
|
-
function getWorksheetHeaders(
|
|
8257
|
-
const
|
|
8258
|
-
|
|
8259
|
-
|
|
8389
|
+
function getWorksheetHeaders(headerRow) {
|
|
8390
|
+
const byColumn = /* @__PURE__ */ new Map();
|
|
8391
|
+
const order = [];
|
|
8392
|
+
headerRow.forEach((cell, index) => {
|
|
8393
|
+
if (cell === null || cell === void 0) return;
|
|
8394
|
+
const name = (cell instanceof Date ? cell.toISOString() : String(cell)).trim();
|
|
8395
|
+
if (!name) return;
|
|
8396
|
+
byColumn.set(index, name);
|
|
8397
|
+
order.push(name);
|
|
8260
8398
|
});
|
|
8261
|
-
return
|
|
8399
|
+
return {
|
|
8400
|
+
byColumn,
|
|
8401
|
+
order
|
|
8402
|
+
};
|
|
8262
8403
|
}
|
|
8263
8404
|
//#endregion
|
|
8264
8405
|
//#region src/data_import/utils/transforms.ts
|
|
@@ -8449,10 +8590,15 @@ function parseCsvToObjects(text) {
|
|
|
8449
8590
|
}
|
|
8450
8591
|
//#endregion
|
|
8451
8592
|
//#region src/data_import/utils/file_to_json.ts
|
|
8452
|
-
var
|
|
8453
|
-
function
|
|
8454
|
-
|
|
8455
|
-
|
|
8593
|
+
var xlsxReader;
|
|
8594
|
+
function loadXlsxReader() {
|
|
8595
|
+
xlsxReader ??= import("read-excel-file/browser").then((mod) => {
|
|
8596
|
+
const candidate = mod.default ?? mod;
|
|
8597
|
+
const fn = typeof candidate === "function" ? candidate : candidate?.default;
|
|
8598
|
+
if (typeof fn !== "function") throw new Error("read-excel-file did not resolve to a function");
|
|
8599
|
+
return fn;
|
|
8600
|
+
});
|
|
8601
|
+
return xlsxReader;
|
|
8456
8602
|
}
|
|
8457
8603
|
/**
|
|
8458
8604
|
* Whether this file is delimited text rather than a workbook.
|
|
@@ -8516,27 +8662,49 @@ function convertFileToJson(file) {
|
|
|
8516
8662
|
reader.onload = async function(e) {
|
|
8517
8663
|
try {
|
|
8518
8664
|
const buffer = e.target?.result;
|
|
8519
|
-
const
|
|
8520
|
-
|
|
8521
|
-
|
|
8522
|
-
|
|
8665
|
+
const readXlsxFile = await loadXlsxReader();
|
|
8666
|
+
const magic = new Uint8Array(buffer, 0, Math.min(2, buffer.byteLength));
|
|
8667
|
+
if (magic[0] !== 80 || magic[1] !== 75) {
|
|
8668
|
+
reject(/* @__PURE__ */ new Error(`'${file.name}' is not a readable .xlsx workbook. Export it again as .xlsx, or save it as .csv.`));
|
|
8669
|
+
return;
|
|
8670
|
+
}
|
|
8671
|
+
let sheets;
|
|
8672
|
+
try {
|
|
8673
|
+
sheets = await readXlsxFile(buffer);
|
|
8674
|
+
} catch (readError) {
|
|
8675
|
+
console.debug("Spreadsheet reader failed", readError);
|
|
8676
|
+
reject(/* @__PURE__ */ new Error("No worksheets found in file — it has no sheets, or none this reader can open."));
|
|
8677
|
+
return;
|
|
8678
|
+
}
|
|
8679
|
+
const firstSheet = sheets[0];
|
|
8680
|
+
if (!firstSheet) {
|
|
8523
8681
|
reject(/* @__PURE__ */ new Error("No worksheets found in file"));
|
|
8524
8682
|
return;
|
|
8525
8683
|
}
|
|
8526
|
-
const
|
|
8684
|
+
const [headerRow, ...dataRows] = firstSheet.data;
|
|
8685
|
+
if (!headerRow) {
|
|
8686
|
+
reject(/* @__PURE__ */ new Error("The spreadsheet is empty"));
|
|
8687
|
+
return;
|
|
8688
|
+
}
|
|
8689
|
+
const headers = getWorksheetHeaders(headerRow);
|
|
8690
|
+
if (headers.order.length === 0) {
|
|
8691
|
+
reject(/* @__PURE__ */ new Error("The spreadsheet has no column headers in its first row"));
|
|
8692
|
+
return;
|
|
8693
|
+
}
|
|
8527
8694
|
const parsedData = [];
|
|
8528
|
-
|
|
8529
|
-
if (
|
|
8695
|
+
for (const row of dataRows) {
|
|
8696
|
+
if (row.every((cell) => cell === null || cell === void 0)) continue;
|
|
8530
8697
|
const obj = {};
|
|
8531
|
-
row.
|
|
8532
|
-
|
|
8533
|
-
|
|
8698
|
+
row.forEach((cell, index) => {
|
|
8699
|
+
if (cell === null || cell === void 0) return;
|
|
8700
|
+
const header = headers.byColumn.get(index);
|
|
8701
|
+
if (header && !isPrototypePollutingKey(header)) obj[header] = cell;
|
|
8534
8702
|
});
|
|
8535
8703
|
parsedData.push(obj);
|
|
8536
|
-
}
|
|
8704
|
+
}
|
|
8537
8705
|
resolve({
|
|
8538
8706
|
data: toImportRows(parsedData),
|
|
8539
|
-
propertiesOrder: headers
|
|
8707
|
+
propertiesOrder: headers.order
|
|
8540
8708
|
});
|
|
8541
8709
|
} catch (err) {
|
|
8542
8710
|
console.error("Error parsing Excel file", err);
|
|
@@ -9426,8 +9594,8 @@ function EditorCollectionAction({ path, parentCollectionSlugs, parentEntityIds,
|
|
|
9426
9594
|
}
|
|
9427
9595
|
//#endregion
|
|
9428
9596
|
//#region src/components/CollectionViewBinding/CollectionViewActions.tsx
|
|
9429
|
-
var ImportCollectionAction = lazyChunk(() => import("./import-
|
|
9430
|
-
var ExportCollectionAction = lazyChunk(() => import("./export
|
|
9597
|
+
var ImportCollectionAction = lazyChunk(() => import("./import-C4VQ0rwO.js").then((n) => n.t).then((m) => ({ default: m.ImportCollectionAction })));
|
|
9598
|
+
var ExportCollectionAction = lazyChunk(() => import("./export-DJoGYb89.js").then((n) => n.t).then((m) => ({ default: m.ExportCollectionAction })));
|
|
9431
9599
|
function CollectionViewActions({ collection, relativePath, parentCollectionSlugs, parentEntityIds, onNewClick, onAddExistingClick, onMultipleDeleteClick, selectionEnabled, path, selectionController, tableController, collectionEntitiesCount, compact, children, openNewDocument }) {
|
|
9432
9600
|
const context = useAdminContext();
|
|
9433
9601
|
const { canCreate, canDelete } = usePermissions();
|
|
@@ -9444,12 +9612,13 @@ function CollectionViewActions({ collection, relativePath, parentCollectionSlugs
|
|
|
9444
9612
|
variant: "filled",
|
|
9445
9613
|
color: "primary",
|
|
9446
9614
|
children: t("add_specific", { name: collection.singularName ?? collection.name })
|
|
9447
|
-
}) : /* @__PURE__ */ jsx(
|
|
9615
|
+
}) : /* @__PURE__ */ jsx(IconButton, {
|
|
9448
9616
|
id: `add_entity_${path}`,
|
|
9449
9617
|
onClick: onNewClick,
|
|
9450
9618
|
variant: "filled",
|
|
9451
|
-
|
|
9619
|
+
shape: "square",
|
|
9452
9620
|
size: "small",
|
|
9621
|
+
"aria-label": t("add_specific", { name: collection.singularName ?? collection.name }),
|
|
9453
9622
|
children: /* @__PURE__ */ jsx(PlusIcon, { size: iconSize.small })
|
|
9454
9623
|
}));
|
|
9455
9624
|
const linkButton = onAddExistingClick && (largeLayout && !compact ? /* @__PURE__ */ jsx(Button, {
|
|
@@ -10031,10 +10200,10 @@ function EntityCardBinding({ entity, collection, onClick, selected, highlighted,
|
|
|
10031
10200
|
onSelectionChange?.(entity, checked);
|
|
10032
10201
|
};
|
|
10033
10202
|
return /* @__PURE__ */ jsxs(Card, {
|
|
10034
|
-
className: cls("cursor-pointer overflow-hidden group relative", "transition-all duration-200", "hover:shadow-lg hover:-translate-y-0.5", selected && "ring-2 ring-primary bg-surface-
|
|
10203
|
+
className: cls("cursor-pointer overflow-hidden group relative", "transition-all duration-200", "hover:shadow-lg hover:-translate-y-0.5", selected && "ring-2 ring-primary bg-surface-raised", highlighted && !selected && "ring-2 ring-primary/50 bg-surface-card-hover"),
|
|
10035
10204
|
onClick: handleClick,
|
|
10036
10205
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
10037
|
-
className: "aspect-[4/3] relative overflow-hidden bg-surface-
|
|
10206
|
+
className: "aspect-[4/3] relative overflow-hidden bg-surface-raised",
|
|
10038
10207
|
children: [
|
|
10039
10208
|
slots.image ? /* @__PURE__ */ jsx("div", {
|
|
10040
10209
|
className: "w-full h-full",
|
|
@@ -10050,7 +10219,7 @@ function EntityCardBinding({ entity, collection, onClick, selected, highlighted,
|
|
|
10050
10219
|
color: "disabled"
|
|
10051
10220
|
})
|
|
10052
10221
|
}),
|
|
10053
|
-
/* @__PURE__ */ jsx("div", { className: cls("absolute inset-0 bg-
|
|
10222
|
+
/* @__PURE__ */ jsx("div", { className: cls("absolute inset-0 bg-white/0 group-hover:bg-white/[0.06]", "transition-colors duration-200") }),
|
|
10054
10223
|
selectionEnabled && /* @__PURE__ */ jsx("div", {
|
|
10055
10224
|
className: cls("absolute", size === "xs" || size === "s" ? "top-1 left-1" : "top-2 left-2"),
|
|
10056
10225
|
onClick: handleCheckboxClick,
|
|
@@ -10221,15 +10390,15 @@ function getIdealColumnWidth(prop) {
|
|
|
10221
10390
|
*/
|
|
10222
10391
|
function getRowClasses(size) {
|
|
10223
10392
|
switch (size) {
|
|
10224
|
-
case "xs": return "py-2 px-
|
|
10225
|
-
case "s": return "py-2.5 px-
|
|
10226
|
-
case "m": return "py-3 px-
|
|
10227
|
-
case "l": return "py-4 px-
|
|
10228
|
-
case "xl": return "py-5 px-
|
|
10229
|
-
default: return "py-3 px-
|
|
10393
|
+
case "xs": return "py-2 px-3";
|
|
10394
|
+
case "s": return "py-2.5 px-3";
|
|
10395
|
+
case "m": return "py-3 px-3";
|
|
10396
|
+
case "l": return "py-4 px-3";
|
|
10397
|
+
case "xl": return "py-5 px-3";
|
|
10398
|
+
default: return "py-3 px-3";
|
|
10230
10399
|
}
|
|
10231
10400
|
}
|
|
10232
|
-
/** `px-
|
|
10401
|
+
/** `mx-2` + `px-3` on both sides: the row is an inset, rounded highlight, not an edge-to-edge bar. */
|
|
10233
10402
|
var ROW_PADDING_WIDTH = 40;
|
|
10234
10403
|
/** `gap-4` between every cell of the row. */
|
|
10235
10404
|
var COLUMN_GAP = 16;
|
|
@@ -10399,9 +10568,22 @@ function CollectionListViewBinding({ collection, tableController, onEntityClick,
|
|
|
10399
10568
|
* silently drop.
|
|
10400
10569
|
*/
|
|
10401
10570
|
const sortableKeys = useMemo(() => new Set(getSortablePropertyOptions(resolvedCollection.properties).map((option) => option.key)), [resolvedCollection.properties]);
|
|
10402
|
-
/**
|
|
10571
|
+
/**
|
|
10572
|
+
* The row's identity cell — the thumbnail, the title and the subtitle.
|
|
10573
|
+
*
|
|
10574
|
+
* Labelled by the title slot, because that is what the cell renders. In
|
|
10575
|
+
* column mode it used to be labelled by `listProperties[0]` instead, which
|
|
10576
|
+
* was right only when the two happened to be the same property and a lie
|
|
10577
|
+
* whenever they were not: `listProperties: ["roles", "createdAt"]` on the
|
|
10578
|
+
* users collection put a "Roles" header over the name-and-email cell, and
|
|
10579
|
+
* the roles themselves appeared in no column at all — the header was the
|
|
10580
|
+
* only trace of the property the developer had asked for.
|
|
10581
|
+
*
|
|
10582
|
+
* The first list property is therefore only consumed here when it *is* the
|
|
10583
|
+
* title; otherwise it stays in {@link declaredColumns} and gets a cell.
|
|
10584
|
+
*/
|
|
10403
10585
|
const titleColumn = useMemo(() => {
|
|
10404
|
-
const key = columnMode ? resolvedCollection.listProperties?.[0] :
|
|
10586
|
+
const key = titlePropertyKey ?? (columnMode ? resolvedCollection.listProperties?.[0] : void 0);
|
|
10405
10587
|
if (!key) return void 0;
|
|
10406
10588
|
const property = resolvedCollection.properties[key];
|
|
10407
10589
|
return {
|
|
@@ -10427,7 +10609,7 @@ function CollectionListViewBinding({ collection, tableController, onEntityClick,
|
|
|
10427
10609
|
*/
|
|
10428
10610
|
const declaredColumns = useMemo(() => {
|
|
10429
10611
|
if (columnMode) {
|
|
10430
|
-
const keys = resolvedCollection.listProperties.
|
|
10612
|
+
const keys = resolvedCollection.listProperties.filter((key) => key !== titleColumn?.key);
|
|
10431
10613
|
return keys.flatMap((key, index) => {
|
|
10432
10614
|
const property = resolvedCollection.properties[key];
|
|
10433
10615
|
if (!property) return [];
|
|
@@ -10479,6 +10661,7 @@ function CollectionListViewBinding({ collection, tableController, onEntityClick,
|
|
|
10479
10661
|
}, [
|
|
10480
10662
|
columnMode,
|
|
10481
10663
|
resolvedCollection,
|
|
10664
|
+
titleColumn?.key,
|
|
10482
10665
|
slotKeys.tagsKey,
|
|
10483
10666
|
statusPropertyKey,
|
|
10484
10667
|
datePropertyKey,
|
|
@@ -10838,10 +11021,9 @@ var ListRow = React.memo(function ListRow({ entity, collection, onClick, selecte
|
|
|
10838
11021
|
]);
|
|
10839
11022
|
const useColumnMode = !!collection.listProperties && collection.listProperties.length > 0;
|
|
10840
11023
|
return /* @__PURE__ */ jsxs("div", {
|
|
10841
|
-
className: cls("@container flex items-center gap-4 cursor-pointer group transition-colors duration-200 relative h-full", rowClasses, isActive
|
|
11024
|
+
className: cls("@container flex items-center gap-4 cursor-pointer group transition-colors duration-200 relative h-full mx-2 rounded-lg", rowClasses, isActive || selected ? "bg-surface-active" : highlighted ? "bg-surface-hover" : "hover:bg-surface-hover"),
|
|
10842
11025
|
onClick: handleClick,
|
|
10843
11026
|
children: [
|
|
10844
|
-
selected && !isActive && /* @__PURE__ */ jsx("div", { className: "absolute left-0 top-0 bottom-0 w-0.5 bg-primary-500 rounded-r-full" }),
|
|
10845
11027
|
selectionEnabled && !combineSelection && /* @__PURE__ */ jsx("div", {
|
|
10846
11028
|
className: "flex-shrink-0 w-8",
|
|
10847
11029
|
onClick: handleCheckboxClick,
|
|
@@ -10854,14 +11036,14 @@ var ListRow = React.memo(function ListRow({ entity, collection, onClick, selecte
|
|
|
10854
11036
|
showImage && /* @__PURE__ */ jsxs("div", {
|
|
10855
11037
|
className: "flex-shrink-0 relative w-10 h-10",
|
|
10856
11038
|
children: [slots.image ? /* @__PURE__ */ jsx("div", {
|
|
10857
|
-
className: cls("w-10 h-10 rounded-lg border relative overflow-hidden bg-surface-
|
|
11039
|
+
className: cls("w-10 h-10 rounded-lg border relative overflow-hidden bg-surface-raised", defaultBorderMixin),
|
|
10858
11040
|
children: /* @__PURE__ */ jsx(SlotValue, {
|
|
10859
11041
|
slot: slots.image,
|
|
10860
11042
|
size: "small",
|
|
10861
11043
|
fill: true
|
|
10862
11044
|
})
|
|
10863
11045
|
}) : /* @__PURE__ */ jsx("div", {
|
|
10864
|
-
className: cls("w-10 h-10 rounded-lg bg-surface-
|
|
11046
|
+
className: cls("w-10 h-10 rounded-lg bg-surface-raised flex items-center justify-center border", defaultBorderMixin),
|
|
10865
11047
|
children: /* @__PURE__ */ jsx(IconForView, {
|
|
10866
11048
|
collectionOrView: collection,
|
|
10867
11049
|
className: "text-surface-500 dark:text-surface-400",
|
|
@@ -11055,7 +11237,7 @@ function ListHeader({ titleColumn, columns, selectionEnabled, showImage, actions
|
|
|
11055
11237
|
onSort: column.sortable && sortIsAvailable(column.key) ? (additive) => onColumnSort(column.key, additive) : void 0
|
|
11056
11238
|
});
|
|
11057
11239
|
return /* @__PURE__ */ jsxs("div", {
|
|
11058
|
-
className: cls("flex items-center gap-4 px-5 py-1.5 select-none border-b bg-surface-
|
|
11240
|
+
className: cls("flex items-center gap-4 px-5 py-1.5 select-none border-b bg-surface-sheet", defaultBorderMixin),
|
|
11059
11241
|
children: [
|
|
11060
11242
|
selectionEnabled && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 w-8" }),
|
|
11061
11243
|
showImage && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 w-10" }),
|
|
@@ -11182,7 +11364,7 @@ function EntityDisplayHeader({ entity, collection, showTitle = false, className
|
|
|
11182
11364
|
return /* @__PURE__ */ jsxs("div", {
|
|
11183
11365
|
className: cls("flex items-start gap-4 min-w-0", className),
|
|
11184
11366
|
children: [hasImage && /* @__PURE__ */ jsx("div", {
|
|
11185
|
-
className: "shrink-0 w-16 h-16 rounded-lg overflow-hidden flex items-center justify-center bg-surface-
|
|
11367
|
+
className: "shrink-0 w-16 h-16 rounded-lg overflow-hidden flex items-center justify-center bg-surface-raised",
|
|
11186
11368
|
children: /* @__PURE__ */ jsx(RoleValue, {
|
|
11187
11369
|
role: display.image,
|
|
11188
11370
|
propertyFallback: typeof display.image.value === "string" ? /* @__PURE__ */ jsx("img", {
|
|
@@ -11387,7 +11569,7 @@ function EntityViewBinding({ entity, collection, className, asPage = false, open
|
|
|
11387
11569
|
showLabel: true,
|
|
11388
11570
|
mode: "read",
|
|
11389
11571
|
children: /* @__PURE__ */ jsx("div", {
|
|
11390
|
-
className: "min-h-8 flex flex-col justify-center min-w-0 text-text-primary dark:text-text-primary-dark",
|
|
11572
|
+
className: "min-h-8 flex flex-col justify-center min-w-0 text-sm text-text-primary dark:text-text-primary-dark",
|
|
11391
11573
|
children: /* @__PURE__ */ jsx(PropertyPreview, {
|
|
11392
11574
|
propertyKey: field.key,
|
|
11393
11575
|
value: getValueInPath(entity.values, field.key),
|
|
@@ -11503,7 +11685,7 @@ function EntityIdentityBar({ collection, collectionUrl, title, entityId, status,
|
|
|
11503
11685
|
const saveAndCloseMenu = Boolean(onSaveAndClose) && saveAndClosePlacement === "menu";
|
|
11504
11686
|
const saveTooltip = hasErrors ? t("fix_errors_before_saving") ?? "Fix highlighted errors before saving" : void 0;
|
|
11505
11687
|
return /* @__PURE__ */ jsxs("div", {
|
|
11506
|
-
className: cls("h-[52px] shrink-0 flex items-center gap-2 pl-1.5 pr-2
|
|
11688
|
+
className: cls("h-[52px] shrink-0 flex items-center gap-2 pl-1.5 pr-2", "bg-surface-sheet"),
|
|
11507
11689
|
children: [
|
|
11508
11690
|
leading,
|
|
11509
11691
|
onBack && /* @__PURE__ */ jsx(Tooltip, {
|
|
@@ -11615,18 +11797,16 @@ function EntityIdentityBar({ collection, collectionUrl, title, entityId, status,
|
|
|
11615
11797
|
]
|
|
11616
11798
|
}),
|
|
11617
11799
|
trailing,
|
|
11618
|
-
onClose && /* @__PURE__ */
|
|
11619
|
-
orientation: "vertical",
|
|
11620
|
-
className: "h-5 mx-1 shrink-0"
|
|
11621
|
-
}), /* @__PURE__ */ jsx(Tooltip, {
|
|
11800
|
+
onClose && /* @__PURE__ */ jsx(Tooltip, {
|
|
11622
11801
|
title: `${t("close")} · Esc`,
|
|
11623
11802
|
children: /* @__PURE__ */ jsx(IconButton, {
|
|
11624
11803
|
size: "small",
|
|
11625
11804
|
onClick: onClose,
|
|
11626
11805
|
"aria-label": t("close"),
|
|
11806
|
+
className: "ml-2",
|
|
11627
11807
|
children: /* @__PURE__ */ jsx(XIcon, { size: iconSize.smallest })
|
|
11628
11808
|
})
|
|
11629
|
-
})
|
|
11809
|
+
})
|
|
11630
11810
|
]
|
|
11631
11811
|
});
|
|
11632
11812
|
}
|
|
@@ -11669,7 +11849,7 @@ function IdChip({ value }) {
|
|
|
11669
11849
|
type: "button",
|
|
11670
11850
|
onClick: copy,
|
|
11671
11851
|
"aria-label": `${t("copy_id")} ${value}`,
|
|
11672
|
-
className: cls("hidden md:inline-flex items-center gap-1.5 shrink-0 whitespace-nowrap px-2 py-0.5 rounded-md", "font-mono text-[11px] text-text-secondary dark:text-text-secondary-dark", "bg-surface-
|
|
11852
|
+
className: cls("hidden md:inline-flex items-center gap-1.5 shrink-0 whitespace-nowrap px-2 py-0.5 rounded-md", "font-mono text-[11px] text-text-secondary dark:text-text-secondary-dark", "bg-surface-field", "hover:bg-surface-field-hover transition-colors"),
|
|
11673
11853
|
children: [truncated, copied ? /* @__PURE__ */ jsx(CheckIcon, { size: iconSize.smallest }) : /* @__PURE__ */ jsx(CopyIcon, { size: iconSize.smallest })]
|
|
11674
11854
|
})
|
|
11675
11855
|
});
|
|
@@ -11775,7 +11955,7 @@ function JsonPreviewBinding({ values }) {
|
|
|
11775
11955
|
}
|
|
11776
11956
|
//#endregion
|
|
11777
11957
|
//#region src/components/EntityInspector.tsx
|
|
11778
|
-
var EntityHistoryView = lazyChunk(() => import("./history-
|
|
11958
|
+
var EntityHistoryView = lazyChunk(() => import("./history-BBpsdTrJ.js").then((m) => ({ default: m.EntityHistoryView })));
|
|
11779
11959
|
/**
|
|
11780
11960
|
* Raw values and revision history, as an inspector rather than as tabs.
|
|
11781
11961
|
*
|
|
@@ -11803,7 +11983,7 @@ function EntityInspector({ tab, onTabChange, onClose, collection, entity, formCo
|
|
|
11803
11983
|
}, [open, onClose]);
|
|
11804
11984
|
if (!open) return null;
|
|
11805
11985
|
return /* @__PURE__ */ jsxs("div", {
|
|
11806
|
-
className: cls("relative flex flex-col shrink-0 h-full w-full max-w-md border-l", "bg-
|
|
11986
|
+
className: cls("relative flex flex-col shrink-0 h-full w-full max-w-md border-l", "bg-surface-card", defaultBorderMixin),
|
|
11807
11987
|
role: "complementary",
|
|
11808
11988
|
"aria-label": t("inspect_record") ?? "Inspect record",
|
|
11809
11989
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -11894,7 +12074,7 @@ var MAIN_TAB_VALUE = "__main_##Q$SC^#S6";
|
|
|
11894
12074
|
* tab's underline stopped short of the record it opens. Paired with
|
|
11895
12075
|
* `items-stretch` on the Tabs root, which the variant leaves centred.
|
|
11896
12076
|
*/
|
|
11897
|
-
var ENTITY_VIEW_TAB_CLASS = "h-full
|
|
12077
|
+
var ENTITY_VIEW_TAB_CLASS = "h-full";
|
|
11898
12078
|
//#endregion
|
|
11899
12079
|
//#region src/components/DetailViewBinding.tsx
|
|
11900
12080
|
function DetailViewBinding({ entityId, ...props }) {
|
|
@@ -12135,7 +12315,7 @@ function DetailViewBindingInner({ path, entityId, selectedTab: selectedTabProp,
|
|
|
12135
12315
|
const subcollectionTabs = subcollections && subcollections.map((subcollection) => {
|
|
12136
12316
|
const icon = getIcon(subcollection.icon, void 0, void 0, "smallest");
|
|
12137
12317
|
return /* @__PURE__ */ jsx(Tab, {
|
|
12138
|
-
className: cls("h-full
|
|
12318
|
+
className: cls("h-full", "text-sm min-w-[90px]"),
|
|
12139
12319
|
value: subcollection.slug,
|
|
12140
12320
|
children: /* @__PURE__ */ jsxs("span", {
|
|
12141
12321
|
className: "flex items-center gap-1.5",
|
|
@@ -12191,7 +12371,7 @@ function DetailViewBindingInner({ path, entityId, selectedTab: selectedTabProp,
|
|
|
12191
12371
|
children: propertyDetailView()
|
|
12192
12372
|
});
|
|
12193
12373
|
let result = /* @__PURE__ */ jsxs("div", {
|
|
12194
|
-
className: "relative flex flex-col h-full w-full bg-
|
|
12374
|
+
className: "relative flex flex-col h-full w-full bg-surface-card",
|
|
12195
12375
|
children: [
|
|
12196
12376
|
/* @__PURE__ */ jsx(EntityIdentityBar, {
|
|
12197
12377
|
collection,
|
|
@@ -12225,7 +12405,7 @@ function DetailViewBindingInner({ path, entityId, selectedTab: selectedTabProp,
|
|
|
12225
12405
|
] })
|
|
12226
12406
|
}),
|
|
12227
12407
|
hasAdditionalViews && /* @__PURE__ */ jsx("div", {
|
|
12228
|
-
className: cls("h-10 shrink-0 flex items-stretch border-b px-2 min-w-0", "bg-surface-
|
|
12408
|
+
className: cls("h-10 shrink-0 flex items-stretch border-b px-2 min-w-0", "bg-surface-sheet", defaultBorderMixin),
|
|
12229
12409
|
children: /* @__PURE__ */ jsxs(Tabs, {
|
|
12230
12410
|
className: "!w-full items-stretch",
|
|
12231
12411
|
innerClassName: "h-full",
|
|
@@ -12238,7 +12418,7 @@ function DetailViewBindingInner({ path, entityId, selectedTab: selectedTabProp,
|
|
|
12238
12418
|
customViewTabsStart,
|
|
12239
12419
|
/* @__PURE__ */ jsx(Tab, {
|
|
12240
12420
|
value: "__main_##Q$SC^#S6",
|
|
12241
|
-
className: cls("h-full
|
|
12421
|
+
className: cls("h-full", "text-sm min-w-[90px]"),
|
|
12242
12422
|
children: /* @__PURE__ */ jsxs("span", {
|
|
12243
12423
|
className: "flex items-center gap-1.5",
|
|
12244
12424
|
children: [getIcon(collection.icon, void 0, void 0, "smallest"), collection.singularName ?? collection.name]
|
|
@@ -12560,7 +12740,7 @@ function SplitListView({ collection, tableController, onEntityClick: externalOnE
|
|
|
12560
12740
|
});
|
|
12561
12741
|
const detailPanel = renderedEntityId !== void 0 ? /* @__PURE__ */ jsx("div", {
|
|
12562
12742
|
ref: detailPanelRef,
|
|
12563
|
-
className: cls("flex-1 flex flex-col min-w-0 h-full transition-all ease-out w-full", animationPhase === "entered" ? "opacity-100 translate-x-0" : largeLayout ? "opacity-0 translate-x-8" : "opacity-0 translate-x-1/3"),
|
|
12743
|
+
className: cls("flex-1 flex flex-col min-w-0 h-full transition-all ease-out w-full", largeLayout && "border-l border-hairline", animationPhase === "entered" ? "opacity-100 translate-x-0" : largeLayout ? "opacity-0 translate-x-8" : "opacity-0 translate-x-1/3"),
|
|
12564
12744
|
style: { transitionDuration: `${TRANSITION_DURATION}ms` },
|
|
12565
12745
|
children: /* @__PURE__ */ jsx(ErrorBoundary, { children: collection.defaultEntityAction === "view" && !isEditMode ? /* @__PURE__ */ jsx(DetailViewBinding, {
|
|
12566
12746
|
path,
|
|
@@ -12685,9 +12865,9 @@ function BoardCardBindingInner({ item, isDragging, isGroupedOver, style, collect
|
|
|
12685
12865
|
onSelectionChange?.(entity, checked);
|
|
12686
12866
|
}, [entity, onSelectionChange]);
|
|
12687
12867
|
const backgroundColor = useMemo(() => {
|
|
12688
|
-
if (isDragging) return "bg-surface-
|
|
12689
|
-
if (isGroupedOver) return "bg-surface-
|
|
12690
|
-
return "bg-
|
|
12868
|
+
if (isDragging) return "bg-surface-raised";
|
|
12869
|
+
if (isGroupedOver) return "bg-surface-raised";
|
|
12870
|
+
return "bg-surface-card hover:bg-surface-hover";
|
|
12691
12871
|
}, [isDragging, isGroupedOver]);
|
|
12692
12872
|
const borderColor = useMemo(() => isDragging ? "ring-2 ring-primary" : "", [isDragging]);
|
|
12693
12873
|
const cardClassName = useMemo(() => cls("group/card p-2 flex items-start border rounded-lg cursor-pointer transition-all duration-200", defaultBorderMixin, borderColor, backgroundColor, selected ? "ring-2 ring-primary bg-primary/[0.03] dark:bg-primary/[0.06]" : "hover:shadow-sm"), [
|
|
@@ -12714,7 +12894,7 @@ function BoardCardBindingInner({ item, isDragging, isGroupedOver, style, collect
|
|
|
12714
12894
|
fill: true
|
|
12715
12895
|
})
|
|
12716
12896
|
}) : /* @__PURE__ */ jsx("div", {
|
|
12717
|
-
className: cls("w-10 h-10 rounded-md bg-surface-
|
|
12897
|
+
className: cls("w-10 h-10 rounded-md bg-surface-raised flex items-center justify-center transition-opacity duration-200", selectionEnabled && "group-hover/card:opacity-30", selected && "opacity-0"),
|
|
12718
12898
|
children: /* @__PURE__ */ jsx(IconForView, {
|
|
12719
12899
|
collectionOrView: collection,
|
|
12720
12900
|
color: "disabled",
|
|
@@ -14260,7 +14440,7 @@ function CreationResultDialog({ result, onClose }) {
|
|
|
14260
14440
|
}), /* @__PURE__ */ jsxs("div", {
|
|
14261
14441
|
className: "flex items-center gap-2 mt-1",
|
|
14262
14442
|
children: [/* @__PURE__ */ jsx("code", {
|
|
14263
|
-
className: "flex-grow bg-surface-
|
|
14443
|
+
className: "flex-grow bg-surface-raised border border-hairline-strong rounded px-3 py-2 font-mono text-base select-all",
|
|
14264
14444
|
children: result.temporaryPassword
|
|
14265
14445
|
}), /* @__PURE__ */ jsx(Tooltip, {
|
|
14266
14446
|
title: t("copy_password") ?? "Copy password",
|
|
@@ -14893,7 +15073,7 @@ function PopupFormFieldInternal({ tableKey, entityId, customFieldValidator, prop
|
|
|
14893
15073
|
children: internalForm
|
|
14894
15074
|
});
|
|
14895
15075
|
const form = /* @__PURE__ */ jsxs("div", {
|
|
14896
|
-
className: `text-surface-900 dark:text-white overflow-auto rounded-xs rounded-md bg-
|
|
15076
|
+
className: `text-surface-900 dark:text-white overflow-auto rounded-xs rounded-md bg-surface-card ${!open ? "hidden" : ""} cursor-grab max-w-[100vw]`,
|
|
14897
15077
|
children: [internalForm, savingError && /* @__PURE__ */ jsx(Typography, {
|
|
14898
15078
|
color: "error",
|
|
14899
15079
|
children: savingError.message
|
|
@@ -14901,7 +15081,7 @@ function PopupFormFieldInternal({ tableKey, entityId, customFieldValidator, prop
|
|
|
14901
15081
|
});
|
|
14902
15082
|
const draggable = /* @__PURE__ */ jsx("div", {
|
|
14903
15083
|
style: { boxShadow: "0 0 0 2px rgba(128,128,128,0.2)" },
|
|
14904
|
-
className: `inline-block fixed z-20 shadow-outline rounded-md bg-
|
|
15084
|
+
className: `inline-block fixed z-20 shadow-outline rounded-md bg-surface-card ${!open ? "invisible" : "visible"} cursor-grab overflow-visible`,
|
|
14905
15085
|
ref: draggableRef,
|
|
14906
15086
|
children: /* @__PURE__ */ jsxs("div", {
|
|
14907
15087
|
className: "overflow-hidden",
|
|
@@ -15475,7 +15655,7 @@ function SortButton({ tableController, properties, compact }) {
|
|
|
15475
15655
|
"aria-label": keys.length > 0 ? `${t("sort_then_by")} ${title}` : `${t("sort_by")} ${title}`,
|
|
15476
15656
|
disabled,
|
|
15477
15657
|
onClick: () => onOptionClick(key),
|
|
15478
|
-
className: cls("flex items-center gap-2 px-3 py-1.5 text-sm text-left w-full", disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:bg-surface-
|
|
15658
|
+
className: cls("flex items-center gap-2 px-3 py-1.5 text-sm text-left w-full", disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:bg-surface-hover"),
|
|
15479
15659
|
children: [/* @__PURE__ */ jsx("span", {
|
|
15480
15660
|
className: "flex-shrink-0 flex items-center",
|
|
15481
15661
|
children: getIconForProperty(property, "smallest")
|
|
@@ -15577,7 +15757,7 @@ function CollectionViewStartActions({ collection, relativePath, parentCollection
|
|
|
15577
15757
|
const countBadge = !iconOnlyToolbar && entitiesCount !== void 0 ? /* @__PURE__ */ jsx(Tooltip, {
|
|
15578
15758
|
title: t("records_in_view"),
|
|
15579
15759
|
children: entitiesCount === null ? /* @__PURE__ */ jsx(Skeleton, { className: "w-8 h-4 rounded-md mx-1" }) : /* @__PURE__ */ jsx("span", {
|
|
15580
|
-
className: "mx-1 text-xs
|
|
15760
|
+
className: "mx-1 text-xs font-mono tabular-nums text-text-secondary dark:text-text-secondary-dark",
|
|
15581
15761
|
children: entitiesCount.toLocaleString()
|
|
15582
15762
|
})
|
|
15583
15763
|
}, "entities_count") : null;
|
|
@@ -16418,7 +16598,7 @@ var CollectionViewBindingInner = React.memo(function CollectionViewBindingInner(
|
|
|
16418
16598
|
]
|
|
16419
16599
|
}) : innerView;
|
|
16420
16600
|
return /* @__PURE__ */ jsxs("div", {
|
|
16421
|
-
className: cls("overflow-hidden h-full w-full rounded-md flex flex-col
|
|
16601
|
+
className: cls("overflow-hidden h-full w-full rounded-md flex flex-col bg-surface-sheet", className),
|
|
16422
16602
|
ref: containerRef,
|
|
16423
16603
|
children: [
|
|
16424
16604
|
countFetcher,
|
|
@@ -16601,7 +16781,7 @@ function EntityIdHeaderWidget({ collection, path, idPath, openEntityMode }) {
|
|
|
16601
16781
|
children: /* @__PURE__ */ jsx(SearchIcon, { size: iconSize.small })
|
|
16602
16782
|
}),
|
|
16603
16783
|
children: /* @__PURE__ */ jsxs("div", {
|
|
16604
|
-
className: cls("my-2 rounded-lg bg-surface-
|
|
16784
|
+
className: cls("my-2 rounded-lg bg-surface-sheet text-surface-900 dark:text-white"),
|
|
16605
16785
|
children: [/* @__PURE__ */ jsx("form", {
|
|
16606
16786
|
noValidate: true,
|
|
16607
16787
|
onSubmit: (e) => {
|
|
@@ -16632,7 +16812,7 @@ function EntityIdHeaderWidget({ collection, path, idPath, openEntityMode }) {
|
|
|
16632
16812
|
},
|
|
16633
16813
|
value: searchString,
|
|
16634
16814
|
className: "flex-grow",
|
|
16635
|
-
inputClassName: cls("rounded-lg bg-
|
|
16815
|
+
inputClassName: cls("rounded-lg bg-surface-card", focusedDisabled)
|
|
16636
16816
|
}), /* @__PURE__ */ jsx(Button, {
|
|
16637
16817
|
variant: "text",
|
|
16638
16818
|
disabled: !searchString.trim(),
|
|
@@ -17499,7 +17679,7 @@ function EditViewBindingInner({ path, entityId, selectedTab: selectedTabProp, co
|
|
|
17499
17679
|
const subcollectionTabs = subcollections && subcollections.map((subcollection) => {
|
|
17500
17680
|
const icon = getIcon(subcollection.icon, void 0, void 0, "smallest");
|
|
17501
17681
|
return /* @__PURE__ */ jsx(Tab, {
|
|
17502
|
-
className: cls("h-full
|
|
17682
|
+
className: cls("h-full", "text-sm min-w-[90px]"),
|
|
17503
17683
|
value: subcollection.slug,
|
|
17504
17684
|
children: /* @__PURE__ */ jsxs("span", {
|
|
17505
17685
|
className: "flex items-center gap-1.5",
|
|
@@ -17543,7 +17723,7 @@ function EditViewBindingInner({ path, entityId, selectedTab: selectedTabProp, co
|
|
|
17543
17723
|
})
|
|
17544
17724
|
}) : null;
|
|
17545
17725
|
let result = /* @__PURE__ */ jsxs("div", {
|
|
17546
|
-
className: "relative flex flex-col h-full w-full bg-
|
|
17726
|
+
className: "relative flex flex-col h-full w-full bg-surface-card",
|
|
17547
17727
|
children: [
|
|
17548
17728
|
/* @__PURE__ */ jsx(EntityIdentityBar, {
|
|
17549
17729
|
collection,
|
|
@@ -17602,7 +17782,7 @@ function EditViewBindingInner({ path, entityId, selectedTab: selectedTabProp, co
|
|
|
17602
17782
|
] })
|
|
17603
17783
|
}),
|
|
17604
17784
|
hasAdditionalViews && /* @__PURE__ */ jsx("div", {
|
|
17605
|
-
className: cls("h-10 shrink-0 flex items-stretch border-b px-2 min-w-0", "bg-surface-
|
|
17785
|
+
className: cls("h-10 shrink-0 flex items-stretch border-b px-2 min-w-0", "bg-surface-sheet", defaultBorderMixin),
|
|
17606
17786
|
children: /* @__PURE__ */ jsxs(Tabs, {
|
|
17607
17787
|
className: "!w-full items-stretch",
|
|
17608
17788
|
innerClassName: "h-full",
|
|
@@ -17615,7 +17795,7 @@ function EditViewBindingInner({ path, entityId, selectedTab: selectedTabProp, co
|
|
|
17615
17795
|
customViewTabsStart,
|
|
17616
17796
|
/* @__PURE__ */ jsx(Tab, {
|
|
17617
17797
|
value: "__main_##Q$SC^#S6",
|
|
17618
|
-
className: cls("h-full
|
|
17798
|
+
className: cls("h-full", "text-sm min-w-[90px]"),
|
|
17619
17799
|
children: /* @__PURE__ */ jsxs("span", {
|
|
17620
17800
|
className: "flex items-center gap-1.5",
|
|
17621
17801
|
children: [getIcon(collection.icon, void 0, void 0, "smallest"), collection.singularName ?? collection.name]
|
|
@@ -19408,7 +19588,7 @@ function SideDialogView({ offsetPosition, panel, panelIndex, isTopPanel }) {
|
|
|
19408
19588
|
onInteractOutside: !isTopPanel ? preventDismiss : void 0,
|
|
19409
19589
|
title: "Side dialog " + panel?.key,
|
|
19410
19590
|
children: [panel && /* @__PURE__ */ jsx("div", {
|
|
19411
|
-
className: "transform max-w-[100vw] lg:max-w-[95vw] flex flex-col h-full transition-all duration-250 ease-in-out bg-
|
|
19591
|
+
className: "transform max-w-[100vw] lg:max-w-[95vw] flex flex-col h-full transition-all duration-250 ease-in-out bg-surface-card ",
|
|
19412
19592
|
style: {
|
|
19413
19593
|
width: panel.width,
|
|
19414
19594
|
transform: `translateX(-${offsetPosition * 200}px)`
|
|
@@ -20475,7 +20655,7 @@ function MapFieldBinding({ propertyKey, value, showError, error, disabled, prope
|
|
|
20475
20655
|
expanded
|
|
20476
20656
|
} });
|
|
20477
20657
|
},
|
|
20478
|
-
innerClassName: "px-2 md:px-4 pb-2 md:pb-4 pt-1 md:pt-2 bg-
|
|
20658
|
+
innerClassName: "px-2 md:px-4 pb-2 md:pb-4 pt-1 md:pt-2 bg-surface-card",
|
|
20479
20659
|
title: /* @__PURE__ */ jsx(LabelWithIconAndTooltip, {
|
|
20480
20660
|
propertyKey,
|
|
20481
20661
|
icon: getIconForProperty(property, "small"),
|
|
@@ -20498,7 +20678,7 @@ function MapFieldBinding({ propertyKey, value, showError, error, disabled, prope
|
|
|
20498
20678
|
//#endregion
|
|
20499
20679
|
//#region src/form/field_bindings/MarkdownEditorFieldBinding.tsx
|
|
20500
20680
|
var RichTextEditor = lazyChunk(() => import("./editor.js").then((m) => ({ default: m.RichTextEditor })));
|
|
20501
|
-
var loadMarkdownUtils = () => import("./markdown-
|
|
20681
|
+
var loadMarkdownUtils = () => import("./markdown-CCqp8ibf.js").then((n) => n.t);
|
|
20502
20682
|
var _markdownUtils = null;
|
|
20503
20683
|
var getMarkdownUtils = async () => {
|
|
20504
20684
|
if (!_markdownUtils) _markdownUtils = await loadMarkdownUtils();
|
|
@@ -20683,7 +20863,7 @@ function MarkdownEditorFieldBinding({ property, propertyKey, value, setValue, in
|
|
|
20683
20863
|
* and tables to the specified properties.
|
|
20684
20864
|
* @group Form fields
|
|
20685
20865
|
*/
|
|
20686
|
-
function MultiSelectFieldBinding({ propertyKey, value, setValue, error, showError, disabled, property, includeDescription, hideLabel, size = "
|
|
20866
|
+
function MultiSelectFieldBinding({ propertyKey, value, setValue, error, showError, disabled, property, includeDescription, hideLabel, size = "small", autoFocus }) {
|
|
20687
20867
|
const of = property.of;
|
|
20688
20868
|
if (!of) throw Error("Using wrong component ArrayEnumSelect");
|
|
20689
20869
|
if (Array.isArray(of)) throw Error("Using array properties instead of single one in `of` in ArrayProperty");
|
|
@@ -20819,7 +20999,7 @@ function ReferenceFieldBindingInternal({ propertyKey, value, setValue, error, sh
|
|
|
20819
20999
|
}), !refValue && /* @__PURE__ */ jsx("div", {
|
|
20820
21000
|
className: "justify-center text-left",
|
|
20821
21001
|
children: /* @__PURE__ */ jsxs(EntityPreviewContainer, {
|
|
20822
|
-
className: cls("px-6 h-12 text-sm font-medium flex items-center gap-6", disabled || isSubmitting ? "text-surface-accent-500" : "cursor-pointer text-surface-accent-700 dark:text-surface-accent-300 hover:bg-surface-
|
|
21002
|
+
className: cls("px-6 h-12 text-sm font-medium flex items-center gap-6", disabled || isSubmitting ? "text-surface-accent-500" : "cursor-pointer text-surface-accent-700 dark:text-surface-accent-300 hover:bg-surface-hover group-hover:bg-surface-hover"),
|
|
20823
21003
|
onClick: onEntryClick,
|
|
20824
21004
|
size: "medium",
|
|
20825
21005
|
children: [/* @__PURE__ */ jsx(IconForView, {
|
|
@@ -20941,7 +21121,7 @@ function RepeatFieldBinding({ propertyKey, value, error, showError, isSubmitting
|
|
|
20941
21121
|
* and tables to the specified properties.
|
|
20942
21122
|
* @group Form fields
|
|
20943
21123
|
*/
|
|
20944
|
-
function SelectFieldBinding({ propertyKey, value, setValue, error, showError, disabled, autoFocus, touched, property, includeDescription, hideLabel, size = "
|
|
21124
|
+
function SelectFieldBinding({ propertyKey, value, setValue, error, showError, disabled, autoFocus, touched, property, includeDescription, hideLabel, size = "small" }) {
|
|
20945
21125
|
const enumValues = resolveEnumValues(property.enum ?? []);
|
|
20946
21126
|
useClearRestoreValue({
|
|
20947
21127
|
property,
|
|
@@ -21011,7 +21191,7 @@ function StorageItemPreview({ name, property, value, onRemove, disabled, size, p
|
|
|
21011
21191
|
className: cls("relative border-box flex items-center justify-center", size === "large" ? "min-w-[220px] min-h-[220px] max-w-[220px]" : "min-w-[118px] min-h-[118px] max-w-[118px]", paperMixin, className),
|
|
21012
21192
|
children: [
|
|
21013
21193
|
!placeholder && !disabled && /* @__PURE__ */ jsx("div", {
|
|
21014
|
-
className: "absolute rounded-full -top-2 -right-2 z-10 bg-
|
|
21194
|
+
className: "absolute rounded-full -top-2 -right-2 z-10 bg-surface-card",
|
|
21015
21195
|
children: /* @__PURE__ */ jsx(Tooltip, {
|
|
21016
21196
|
asChild: true,
|
|
21017
21197
|
title: t("remove"),
|
|
@@ -21303,7 +21483,7 @@ function StorageUpload({ property, name, value, setInternalValue, onChange, mult
|
|
|
21303
21483
|
* and tables to the specified properties.
|
|
21304
21484
|
* @group Form fields
|
|
21305
21485
|
*/
|
|
21306
|
-
var SwitchFieldBinding = function SwitchFieldBinding({ propertyKey, value, setValue, error, showError, autoFocus, disabled, size = "
|
|
21486
|
+
var SwitchFieldBinding = function SwitchFieldBinding({ propertyKey, value, setValue, error, showError, autoFocus, disabled, size = "small", property, includeDescription, hideLabel }) {
|
|
21307
21487
|
useClearRestoreValue({
|
|
21308
21488
|
property,
|
|
21309
21489
|
value,
|
|
@@ -21341,7 +21521,7 @@ var SwitchFieldBinding = function SwitchFieldBinding({ propertyKey, value, setVa
|
|
|
21341
21521
|
* and tables to the specified properties.
|
|
21342
21522
|
* @group Form fields
|
|
21343
21523
|
*/
|
|
21344
|
-
function TextFieldBinding({ propertyKey, value, setValue, error, showError, disabled, autoFocus, property, includeDescription, hideLabel, size = "
|
|
21524
|
+
function TextFieldBinding({ propertyKey, value, setValue, error, showError, disabled, autoFocus, property, includeDescription, hideLabel, size = "small" }) {
|
|
21345
21525
|
let multiline;
|
|
21346
21526
|
let url;
|
|
21347
21527
|
if (property.type === "string") {
|
|
@@ -21396,7 +21576,7 @@ function TextFieldBinding({ propertyKey, value, setValue, error, showError, disa
|
|
|
21396
21576
|
autoFocus,
|
|
21397
21577
|
disabled,
|
|
21398
21578
|
"aria-label": accessibleName,
|
|
21399
|
-
className: cls("rounded-md resize-none w-full outline-none text-
|
|
21579
|
+
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" : "")
|
|
21400
21580
|
}),
|
|
21401
21581
|
property.admin?.clearable && /* @__PURE__ */ jsx("div", {
|
|
21402
21582
|
className: "flex flex-row justify-center items-center absolute h-full right-0 top-0 mr-4",
|
|
@@ -21451,7 +21631,7 @@ function TextFieldBinding({ propertyKey, value, setValue, error, showError, disa
|
|
|
21451
21631
|
* Vector object structure expected by Rebase driver.
|
|
21452
21632
|
* @group Form fields
|
|
21453
21633
|
*/
|
|
21454
|
-
function VectorFieldBinding({ propertyKey, value, setValue, error, showError, disabled, autoFocus, property, includeDescription, hideLabel, size = "
|
|
21634
|
+
function VectorFieldBinding({ propertyKey, value, setValue, error, showError, disabled, autoFocus, property, includeDescription, hideLabel, size = "small" }) {
|
|
21455
21635
|
const isVectorObject = (val) => {
|
|
21456
21636
|
return typeof val === "object" && val !== null && "value" in val;
|
|
21457
21637
|
};
|
|
@@ -21499,7 +21679,7 @@ function VectorFieldBinding({ propertyKey, value, setValue, error, showError, di
|
|
|
21499
21679
|
children: /* @__PURE__ */ jsx("div", {
|
|
21500
21680
|
className: "w-full",
|
|
21501
21681
|
children: !isEditing ? /* @__PURE__ */ jsxs("div", {
|
|
21502
|
-
className: cls("flex flex-col gap-3 p-4 rounded-xl border bg-surface-
|
|
21682
|
+
className: cls("flex flex-col gap-3 p-4 rounded-xl border bg-surface-field transition-all duration-200", defaultBorderMixin),
|
|
21503
21683
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
21504
21684
|
className: "flex items-center justify-between flex-wrap gap-2",
|
|
21505
21685
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -21511,7 +21691,7 @@ function VectorFieldBinding({ propertyKey, value, setValue, error, showError, di
|
|
|
21511
21691
|
children: isPopulated ? `${arrayValue.length} Dimensions` : "Empty Vector"
|
|
21512
21692
|
}),
|
|
21513
21693
|
isPopulated && /* @__PURE__ */ jsx("span", {
|
|
21514
|
-
className: "text-xs text-text-secondary dark:text-text-secondary-dark px-2 py-0.5 rounded-full bg-surface-
|
|
21694
|
+
className: "text-xs text-text-secondary dark:text-text-secondary-dark px-2 py-0.5 rounded-full bg-surface-raised font-medium",
|
|
21515
21695
|
children: "Embedding"
|
|
21516
21696
|
})
|
|
21517
21697
|
]
|
|
@@ -21541,11 +21721,11 @@ function VectorFieldBinding({ propertyKey, value, setValue, error, showError, di
|
|
|
21541
21721
|
]
|
|
21542
21722
|
})]
|
|
21543
21723
|
}), showValues && isPopulated && /* @__PURE__ */ jsx("div", {
|
|
21544
|
-
className: "mt-1 p-3 rounded-lg bg-surface-
|
|
21724
|
+
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-100 dark:selection:bg-primary-900/40",
|
|
21545
21725
|
children: arrayValue.join(", ")
|
|
21546
21726
|
})]
|
|
21547
21727
|
}) : /* @__PURE__ */ jsxs("div", {
|
|
21548
|
-
className: cls("flex flex-col gap-2 p-4 rounded-xl border bg-surface-
|
|
21728
|
+
className: cls("flex flex-col gap-2 p-4 rounded-xl border bg-surface-field", defaultBorderMixin),
|
|
21549
21729
|
children: [/* @__PURE__ */ jsx(TextField, {
|
|
21550
21730
|
size,
|
|
21551
21731
|
"aria-label": `${property.name ?? propertyKey} vector values`,
|
|
@@ -21625,7 +21805,7 @@ var inRange = (n, [min, max]) => n >= min && n <= max;
|
|
|
21625
21805
|
*
|
|
21626
21806
|
* @group Form fields
|
|
21627
21807
|
*/
|
|
21628
|
-
function GeopointFieldBinding({ propertyKey, value, setValue, error, showError, disabled, autoFocus, property, includeDescription, hideLabel, size = "
|
|
21808
|
+
function GeopointFieldBinding({ propertyKey, value, setValue, error, showError, disabled, autoFocus, property, includeDescription, hideLabel, size = "small" }) {
|
|
21629
21809
|
const coordinates = readCoordinates(value);
|
|
21630
21810
|
const [latText, setLatText] = useState(() => coordinates ? String(coordinates.latitude) : "");
|
|
21631
21811
|
const [lngText, setLngText] = useState(() => coordinates ? String(coordinates.longitude) : "");
|
|
@@ -21763,7 +21943,7 @@ function humanSize(bytes) {
|
|
|
21763
21943
|
*
|
|
21764
21944
|
* @group Form fields
|
|
21765
21945
|
*/
|
|
21766
|
-
function BinaryFieldBinding({ propertyKey, value, setValue, error, showError, disabled, autoFocus, property, includeDescription, hideLabel, size = "
|
|
21946
|
+
function BinaryFieldBinding({ propertyKey, value, setValue, error, showError, disabled, autoFocus, property, includeDescription, hideLabel, size = "small" }) {
|
|
21767
21947
|
const [text, setText] = useState(typeof value === "string" ? value : "");
|
|
21768
21948
|
const [isEditing, setIsEditing] = useState(false);
|
|
21769
21949
|
useEffect(() => {
|
|
@@ -21805,7 +21985,7 @@ function BinaryFieldBinding({ propertyKey, value, setValue, error, showError, di
|
|
|
21805
21985
|
children: /* @__PURE__ */ jsx("div", {
|
|
21806
21986
|
className: "w-full",
|
|
21807
21987
|
children: !isEditing ? /* @__PURE__ */ jsxs("div", {
|
|
21808
|
-
className: cls("flex items-center justify-between gap-2 p-4 rounded-xl border bg-surface-
|
|
21988
|
+
className: cls("flex items-center justify-between gap-2 p-4 rounded-xl border bg-surface-field", defaultBorderMixin),
|
|
21809
21989
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
21810
21990
|
className: "flex items-center gap-2.5 min-w-0",
|
|
21811
21991
|
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", {
|
|
@@ -22068,7 +22248,7 @@ function SingleRelationFieldBinding({ propertyKey, value, size, error, showError
|
|
|
22068
22248
|
}), !value && /* @__PURE__ */ jsx("div", {
|
|
22069
22249
|
className: "justify-center text-left",
|
|
22070
22250
|
children: /* @__PURE__ */ jsxs(EntityPreviewContainer, {
|
|
22071
|
-
className: cls("px-6 h-12 text-sm font-medium flex items-center gap-6", disabled || isSubmitting ? "text-surface-accent-500" : "cursor-pointer text-surface-accent-700 dark:text-surface-accent-300 hover:bg-surface-
|
|
22251
|
+
className: cls("px-6 h-12 text-sm font-medium flex items-center gap-6", disabled || isSubmitting ? "text-surface-accent-500" : "cursor-pointer text-surface-accent-700 dark:text-surface-accent-300 hover:bg-surface-hover group-hover:bg-surface-hover"),
|
|
22072
22252
|
onClick: onEntryClick,
|
|
22073
22253
|
size: "medium",
|
|
22074
22254
|
children: [/* @__PURE__ */ jsx(IconForView, {
|
|
@@ -22097,7 +22277,7 @@ function SingleRelationFieldBinding({ propertyKey, value, size, error, showError
|
|
|
22097
22277
|
* and tables to the specified properties.
|
|
22098
22278
|
* @group Form fields
|
|
22099
22279
|
*/
|
|
22100
|
-
function UserSelectFieldBinding({ propertyKey, value, setValue, error, showError, disabled, autoFocus, touched, property, includeDescription, hideLabel, size = "
|
|
22280
|
+
function UserSelectFieldBinding({ propertyKey, value, setValue, error, showError, disabled, autoFocus, touched, property, includeDescription, hideLabel, size = "small" }) {
|
|
22101
22281
|
const selectorSize = size;
|
|
22102
22282
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22103
22283
|
!hideLabel && /* @__PURE__ */ jsx(PropertyIdCopyTooltip, {
|
|
@@ -23518,7 +23698,7 @@ function EntityForm({ path, entityId: entityIdProp, collection, onValuesModified
|
|
|
23518
23698
|
context: formContext,
|
|
23519
23699
|
partOfArray: false,
|
|
23520
23700
|
minimalistView: false,
|
|
23521
|
-
size: "
|
|
23701
|
+
size: "small",
|
|
23522
23702
|
autoFocus: autoFocusKey === field.key
|
|
23523
23703
|
};
|
|
23524
23704
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -24206,6 +24386,7 @@ function toSerializableBaseFields(property) {
|
|
|
24206
24386
|
if (property.propertyConfig) result.propertyConfig = property.propertyConfig;
|
|
24207
24387
|
if (property.columnName) result.columnName = property.columnName;
|
|
24208
24388
|
if (property.excludeFromApi !== void 0) result.excludeFromApi = property.excludeFromApi;
|
|
24389
|
+
if (property.access !== void 0) result.access = property.access;
|
|
24209
24390
|
if (property.defaultValue !== void 0) result.defaultValue = property.defaultValue;
|
|
24210
24391
|
if (property.conditions) result.conditions = property.conditions;
|
|
24211
24392
|
if (property.metadata) result.metadata = property.metadata;
|
|
@@ -24232,6 +24413,7 @@ function toSerializableProperty(property) {
|
|
|
24232
24413
|
if (sp.userSelect) result.userSelect = sp.userSelect;
|
|
24233
24414
|
if (sp.email) result.email = sp.email;
|
|
24234
24415
|
if (sp.url) result.url = sp.url;
|
|
24416
|
+
if (sp.autoValue) result.autoValue = sp.autoValue;
|
|
24235
24417
|
if (sp.validation) {
|
|
24236
24418
|
const { matches, ...restValidation } = sp.validation;
|
|
24237
24419
|
const serializedValidation = { ...restValidation };
|
|
@@ -24253,6 +24435,8 @@ function toSerializableProperty(property) {
|
|
|
24253
24435
|
if (np.validation) result.validation = np.validation;
|
|
24254
24436
|
if (np.isId !== void 0) result.isId = np.isId;
|
|
24255
24437
|
if (np.enum) result.enum = np.enum;
|
|
24438
|
+
if (np.precision !== void 0) result.precision = np.precision;
|
|
24439
|
+
if (np.scale !== void 0) result.scale = np.scale;
|
|
24256
24440
|
return result;
|
|
24257
24441
|
}
|
|
24258
24442
|
case "boolean": {
|
|
@@ -24908,4 +25092,4 @@ function getFullIdPath(propertyKey, propertyNamespace) {
|
|
|
24908
25092
|
//#endregion
|
|
24909
25093
|
export { NAVIGATION_DEFAULT_GROUP_NAME as $, getEntityTitlePropertyKeyForEntity as $n, getCollectionBySlugWithin as $t, getFieldId as A, NumberPropertyPreview as An, convertDataToEntity as At, MapFieldBinding as B, RelationPreview as Bn, detectCsvDelimiter as Bt, EntityFormBinding as C, ReadOnlyFieldBinding as Cn, getIconForProperty as Cr, EntityCardBinding as Ct, getDefaultFieldConfig as D, ArrayOfMapsPreview as Dn, getResolvedPropertyInPath as Dr, useCollectionEditorDialogsState as Dt, DEFAULT_FIELD_CONFIGS as E, FieldHelperText as En, getPropertyInPath$1 as Er, ConfigControllerProvider as Et, SelectFieldBinding as F, ArrayOneOfPreview as Fn, ImportSaveInProgress as Ft, useSelectionDialog as G, SidePanelControllerContext as Gn, SearchIconsView as Gt, DateTimeFieldBinding as H, InlineEntityListPreview as Hn, parseCsvToObjects as Ht, RepeatFieldBinding as I, ArrayOfStringsPreview as In, IMPORT_BATCH_SIZE as It, useBuildUrlController as J, useCollectionRegistryController as Jn, BreadcrumbsProvider as Jt, SelectionTableBinding as K, useSidePanel as Kn, FieldCaption as Kt, ReferenceFieldBinding as L, ArrayPropertyEnumPreview as Ln, saveImportedEntities as Lt, TextFieldBinding as M, DatePreview as Mn, processValueMapping as Mt, SwitchFieldBinding as N, KeyValuePreview as Nn, getInferenceType as Nt, getDefaultFieldId as O, PropertyPreview as On, isReferenceProperty as Or, ImportNewPropertyFieldPreview as Ot, StorageUploadFieldBinding as P, MapPropertyPreview as Pn, useImportConfig as Pt, useResolvedCollections as Q, getEntityTitlePropertyKey as Qn, addInitialSlash as Qt, MultiSelectFieldBinding as R, ArrayEnumPreview as Rn, ImportFileUpload as Rt, isSchemaChangeCancelled as S, useClearRestoreValue as Sn, getDefaultPropertiesOrder as Sr, CollectionCardViewBinding as St, PropertyFieldBinding as T, LabelWithIcon as Tn, getPropertiesWithPropertiesOrder as Tr, useCollectionEditorController as Tt, BlockFieldBinding as U, ReferencePreview as Un, ArrayContainer as Ut, KeyValueFieldBinding as V, ArrayOfReferencesPreview as Vn, parseCsvRows as Vt, ArrayOfReferencesFieldBinding as W, EntityPreviewBinding as Wn, PropertyConfigBadge as Wt, useTopLevelNavigation as X, useResolvedUser as Xn, resolveEntityView as Xt, useBuildNavigationStateController as Y, getUserLabel as Yn, resolveEntityAction as Yt, useResolvedViews as Z, getEntityPreviewKeys as Zn, mergeEntityActions as Zt, useCollectionsConfigController as _, useNavigationStateController as _n, LABEL_ICON_SIZE as _r, editEntityAction as _t, namespaceToPropertiesPath as a, resolveCollectionPathIds$1 as an, SkeletonPropertyComponent as ar, getEntityViewWidth as at, asUnavailable as b, SelectableTableContext as bn, PropertyIdCopyTooltip as br, DetailViewBinding as bt, buildCollectionGenerationCallback as c, useSelectionController as cn, renderSkeletonImageThumbnail as cr, useSafeSnackbarController as ct, fromSerializableCollectionConfigs as d, SelectableTable as dn, ImagePreview as dr, getInitialEntityValues as dt, getCollectionPathsCombinations as en, ArrayPropertyPreview as er, useBuildCollectionRegistryController as et, fromSerializableProperties as f, CollectionRowActions as fn, EmptyValue as fr, removeEmptyContainers as ft, toSerializableProperty as g, NavigationStateContext as gn, FieldBlock as gr, deleteEntityAction as gt, toSerializableProperties as h, useUrlController as hn, RecordMeta as hr, copyEntityAction as ht, namespaceToPropertiesOrderPath as i, removeTrailingSlash$1 as in, StorageThumbnailInternal as ir, buildSidePanelsFromUrl as it, VectorFieldBinding as j, BooleanPreview as jn, flattenEntry as jt, getFieldConfig as k, UserPreview as kn, isRelationProperty as kr, DataNewPropertiesMapping as kt, validateCollectionJson as l, VirtualTableInput$1 as ln, renderSkeletonText as lr, extractTouchedValues as lt, toSerializableCollectionConfig as m, UrlContext as mn, FormRail as mr, CollectionViewBinding as mt, getFullIdPath as n, removeInitialAndTrailingSlashes$1 as nn, EnumValuesChip as nr, resolveNavigationFrom as nt, CollectionGenerationApiError as o, resolveOpenEntityMode as on, renderSkeletonCaptionText as or, useBuildSidePanel as ot, fromSerializableProperty as p, useAdminContext as pn, FormSections as pr, zodToFormErrors as pt, SideDialogs as q, CollectionRegistryContext as qn, useBreadcrumbsController as qt, idToPropertiesPath as r, removeInitialSlash as rn, StorageThumbnail as rr, useResolvedNavigationFrom as rt, DEFAULT_COLLECTION_GENERATION_ENDPOINT as s, resolveViewMode as sn, renderSkeletonIcon as sr, EditViewBinding as st, getFullId as t, getLastSegment$1 as tn, StringPropertyPreview as tr, useHistory as tt, fromSerializableCollectionConfig as u, CollectionTableBinding as un, UrlComponentPreview as ur, getChanges as ut, LiveSchemaError as v, useSideDialogsController as vn, isSelfLabellingProperty as vr, resetPasswordAction as vt, EntityForm as w, LabelWithIconAndTooltip as wn, getIconForWidget as wr, CollectionViewActions as wt, createLiveSchemaClient as x, ArrayCustomShapedFieldBinding as xn, getBracketNotation as xr, EntityViewBinding as xt, SchemaChangeCancelled as y, SideDialogsControllerContext as yn, spanClass as yr, CreationResultDialog as yt, MarkdownEditorFieldBinding as z, ArrayOfStorageComponentsPreview as zn, convertFileToJson as zt };
|
|
24910
25094
|
|
|
24911
|
-
//# sourceMappingURL=util-
|
|
25095
|
+
//# sourceMappingURL=util-4oPxPkbp.js.map
|