@firecms/core 3.1.0-canary.1df3b2c → 3.1.0-canary.9e89e98
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/components/EntityCollectionView/ViewModeToggle.d.ts +5 -10
- package/dist/index.es.js +136 -161
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +135 -160
- package/dist/index.umd.js.map +1 -1
- package/dist/types/collections.d.ts +8 -0
- package/package.json +5 -5
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +20 -15
- package/src/components/EntityCollectionView/ViewModeToggle.tsx +27 -30
- package/src/types/collections.ts +9 -0
package/dist/index.umd.js
CHANGED
|
@@ -18341,13 +18341,13 @@
|
|
|
18341
18341
|
] })
|
|
18342
18342
|
] });
|
|
18343
18343
|
}
|
|
18344
|
+
const ALL_VIEW_MODES = ["table", "cards", "kanban"];
|
|
18344
18345
|
function ViewModeToggle(t0) {
|
|
18345
|
-
const $ = reactCompilerRuntime.c(
|
|
18346
|
+
const $ = reactCompilerRuntime.c(36);
|
|
18346
18347
|
const {
|
|
18347
18348
|
viewMode: t1,
|
|
18348
18349
|
onViewModeChange,
|
|
18349
|
-
|
|
18350
|
-
hasKanbanConfigPlugin: t3,
|
|
18350
|
+
enabledViews: t2,
|
|
18351
18351
|
size,
|
|
18352
18352
|
onSizeChanged,
|
|
18353
18353
|
open,
|
|
@@ -18357,14 +18357,13 @@
|
|
|
18357
18357
|
onKanbanPropertyChange
|
|
18358
18358
|
} = t0;
|
|
18359
18359
|
const viewMode = t1 === void 0 ? "table" : t1;
|
|
18360
|
-
const
|
|
18361
|
-
const hasKanbanConfigPlugin = t3 === void 0 ? false : t3;
|
|
18360
|
+
const enabledViews = t2 === void 0 ? ALL_VIEW_MODES : t2;
|
|
18362
18361
|
if (!onViewModeChange) {
|
|
18363
18362
|
return null;
|
|
18364
18363
|
}
|
|
18365
|
-
let
|
|
18364
|
+
let t3;
|
|
18366
18365
|
if ($[0] !== viewMode) {
|
|
18367
|
-
|
|
18366
|
+
t3 = () => {
|
|
18368
18367
|
if (viewMode === "kanban") {
|
|
18369
18368
|
return /* @__PURE__ */ jsxRuntime.jsx(ui.ViewKanbanIcon, { size: "small" });
|
|
18370
18369
|
}
|
|
@@ -18374,14 +18373,14 @@
|
|
|
18374
18373
|
return /* @__PURE__ */ jsxRuntime.jsx(ui.ListIcon, { size: "small" });
|
|
18375
18374
|
};
|
|
18376
18375
|
$[0] = viewMode;
|
|
18377
|
-
$[1] =
|
|
18376
|
+
$[1] = t3;
|
|
18378
18377
|
} else {
|
|
18379
|
-
|
|
18378
|
+
t3 = $[1];
|
|
18380
18379
|
}
|
|
18381
|
-
const getViewModeIcon =
|
|
18382
|
-
let
|
|
18380
|
+
const getViewModeIcon = t3;
|
|
18381
|
+
let t4;
|
|
18383
18382
|
if ($[2] !== viewMode) {
|
|
18384
|
-
|
|
18383
|
+
t4 = () => {
|
|
18385
18384
|
if (viewMode === "kanban") {
|
|
18386
18385
|
return "Board";
|
|
18387
18386
|
}
|
|
@@ -18391,177 +18390,151 @@
|
|
|
18391
18390
|
return "List";
|
|
18392
18391
|
};
|
|
18393
18392
|
$[2] = viewMode;
|
|
18394
|
-
$[3] =
|
|
18393
|
+
$[3] = t4;
|
|
18395
18394
|
} else {
|
|
18396
|
-
|
|
18395
|
+
t4 = $[3];
|
|
18397
18396
|
}
|
|
18398
|
-
const getViewModeName =
|
|
18399
|
-
const showKanban = kanbanEnabled || hasKanbanConfigPlugin;
|
|
18397
|
+
const getViewModeName = t4;
|
|
18400
18398
|
const showSizeSelector = size && onSizeChanged && (viewMode === "table" || viewMode === "cards");
|
|
18401
18399
|
const showKanbanPropertySelector = viewMode === "kanban" && kanbanPropertyOptions && kanbanPropertyOptions.length > 0 && onKanbanPropertyChange;
|
|
18400
|
+
let t5;
|
|
18402
18401
|
let t6;
|
|
18403
|
-
let t7;
|
|
18404
18402
|
if ($[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
18405
|
-
|
|
18406
|
-
|
|
18407
|
-
label: "List",
|
|
18408
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(ui.ListIcon, { size: "small" })
|
|
18409
|
-
};
|
|
18410
|
-
$[4] = t7;
|
|
18403
|
+
t6 = /* @__PURE__ */ jsxRuntime.jsx(ui.ListIcon, { size: "small" });
|
|
18404
|
+
$[4] = t6;
|
|
18411
18405
|
} else {
|
|
18412
|
-
|
|
18406
|
+
t6 = $[4];
|
|
18413
18407
|
}
|
|
18414
|
-
let
|
|
18415
|
-
if ($[5]
|
|
18416
|
-
|
|
18408
|
+
let t7;
|
|
18409
|
+
if ($[5] !== enabledViews) {
|
|
18410
|
+
const allOptions = [{
|
|
18411
|
+
value: "table",
|
|
18412
|
+
label: "List",
|
|
18413
|
+
icon: t6
|
|
18414
|
+
}, {
|
|
18417
18415
|
value: "cards",
|
|
18418
18416
|
label: "Cards",
|
|
18419
18417
|
icon: /* @__PURE__ */ jsxRuntime.jsx(ui.AppsIcon, { size: "small" })
|
|
18420
|
-
}
|
|
18421
|
-
|
|
18418
|
+
}, {
|
|
18419
|
+
value: "kanban",
|
|
18420
|
+
label: "Board",
|
|
18421
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(ui.ViewKanbanIcon, { size: "small" })
|
|
18422
|
+
}];
|
|
18423
|
+
t7 = allOptions.filter((option) => enabledViews.includes(option.value));
|
|
18424
|
+
$[5] = enabledViews;
|
|
18425
|
+
$[6] = t7;
|
|
18422
18426
|
} else {
|
|
18423
|
-
|
|
18427
|
+
t7 = $[6];
|
|
18424
18428
|
}
|
|
18425
|
-
|
|
18426
|
-
|
|
18427
|
-
|
|
18428
|
-
|
|
18429
|
-
|
|
18430
|
-
|
|
18431
|
-
|
|
18432
|
-
|
|
18433
|
-
|
|
18434
|
-
|
|
18435
|
-
}
|
|
18436
|
-
const t102 = !kanbanEnabled && !hasKanbanConfigPlugin;
|
|
18437
|
-
let t112;
|
|
18438
|
-
if ($[11] !== t102) {
|
|
18439
|
-
t112 = {
|
|
18440
|
-
value: "kanban",
|
|
18441
|
-
label: "Board",
|
|
18442
|
-
icon: t92,
|
|
18443
|
-
disabled: t102
|
|
18444
|
-
};
|
|
18445
|
-
$[11] = t102;
|
|
18446
|
-
$[12] = t112;
|
|
18447
|
-
} else {
|
|
18448
|
-
t112 = $[12];
|
|
18449
|
-
}
|
|
18450
|
-
options.push(t112);
|
|
18451
|
-
}
|
|
18452
|
-
$[6] = hasKanbanConfigPlugin;
|
|
18453
|
-
$[7] = kanbanEnabled;
|
|
18454
|
-
$[8] = showKanban;
|
|
18455
|
-
$[9] = options;
|
|
18429
|
+
t5 = t7;
|
|
18430
|
+
const viewModeOptions = t5;
|
|
18431
|
+
if (viewModeOptions.length <= 1 && !showSizeSelector) {
|
|
18432
|
+
return null;
|
|
18433
|
+
}
|
|
18434
|
+
let t8;
|
|
18435
|
+
if ($[7] !== getViewModeIcon) {
|
|
18436
|
+
t8 = getViewModeIcon();
|
|
18437
|
+
$[7] = getViewModeIcon;
|
|
18438
|
+
$[8] = t8;
|
|
18456
18439
|
} else {
|
|
18457
|
-
|
|
18440
|
+
t8 = $[8];
|
|
18458
18441
|
}
|
|
18459
|
-
|
|
18460
|
-
|
|
18461
|
-
|
|
18462
|
-
|
|
18463
|
-
|
|
18464
|
-
$[
|
|
18465
|
-
$[14] = t9;
|
|
18442
|
+
const t9 = getViewModeName();
|
|
18443
|
+
let t10;
|
|
18444
|
+
if ($[9] !== t9) {
|
|
18445
|
+
t10 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 text-sm", children: t9 });
|
|
18446
|
+
$[9] = t9;
|
|
18447
|
+
$[10] = t10;
|
|
18466
18448
|
} else {
|
|
18467
|
-
|
|
18449
|
+
t10 = $[10];
|
|
18468
18450
|
}
|
|
18469
|
-
const t10 = getViewModeName();
|
|
18470
18451
|
let t11;
|
|
18471
|
-
if ($[
|
|
18472
|
-
t11 = /* @__PURE__ */ jsxRuntime.
|
|
18473
|
-
|
|
18474
|
-
|
|
18452
|
+
if ($[11] !== t10 || $[12] !== t8) {
|
|
18453
|
+
t11 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { size: "small", children: [
|
|
18454
|
+
t8,
|
|
18455
|
+
t10
|
|
18456
|
+
] });
|
|
18457
|
+
$[11] = t10;
|
|
18458
|
+
$[12] = t8;
|
|
18459
|
+
$[13] = t11;
|
|
18475
18460
|
} else {
|
|
18476
|
-
t11 = $[
|
|
18461
|
+
t11 = $[13];
|
|
18477
18462
|
}
|
|
18478
18463
|
let t12;
|
|
18479
|
-
if ($[
|
|
18480
|
-
t12 = /* @__PURE__ */ jsxRuntime.
|
|
18481
|
-
|
|
18482
|
-
|
|
18483
|
-
]
|
|
18484
|
-
$[17] =
|
|
18485
|
-
$[18] = t9;
|
|
18486
|
-
$[19] = t12;
|
|
18464
|
+
if ($[14] !== onViewModeChange || $[15] !== viewMode || $[16] !== viewModeOptions) {
|
|
18465
|
+
t12 = viewModeOptions.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(ui.ToggleButtonGroup, { value: viewMode, onValueChange: onViewModeChange, options: viewModeOptions });
|
|
18466
|
+
$[14] = onViewModeChange;
|
|
18467
|
+
$[15] = viewMode;
|
|
18468
|
+
$[16] = viewModeOptions;
|
|
18469
|
+
$[17] = t12;
|
|
18487
18470
|
} else {
|
|
18488
|
-
t12 = $[
|
|
18471
|
+
t12 = $[17];
|
|
18489
18472
|
}
|
|
18490
18473
|
let t13;
|
|
18491
|
-
if ($[
|
|
18492
|
-
t13 = /* @__PURE__ */ jsxRuntime.
|
|
18493
|
-
$[20] = onViewModeChange;
|
|
18494
|
-
$[21] = viewMode;
|
|
18495
|
-
$[22] = viewModeOptions;
|
|
18496
|
-
$[23] = t13;
|
|
18497
|
-
} else {
|
|
18498
|
-
t13 = $[23];
|
|
18499
|
-
}
|
|
18500
|
-
let t14;
|
|
18501
|
-
if ($[24] !== onSizeChanged || $[25] !== showSizeSelector || $[26] !== size) {
|
|
18502
|
-
t14 = showSizeSelector && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
18474
|
+
if ($[18] !== onSizeChanged || $[19] !== showSizeSelector || $[20] !== size) {
|
|
18475
|
+
t13 = showSizeSelector && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
18503
18476
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-sm text-surface-600 dark:text-surface-300", children: [
|
|
18504
18477
|
/* @__PURE__ */ jsxRuntime.jsx(ui.ViewColumnIcon, { size: "small" }),
|
|
18505
18478
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Size" })
|
|
18506
18479
|
] }),
|
|
18507
18480
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Select, { value: size, size: "small", className: "w-20", onValueChange: (v) => onSizeChanged?.(v), renderValue: _temp$e, children: ["xs", "s", "m", "l", "xl"].map(_temp2$5) })
|
|
18508
18481
|
] });
|
|
18509
|
-
$[
|
|
18510
|
-
$[
|
|
18511
|
-
$[
|
|
18512
|
-
$[
|
|
18482
|
+
$[18] = onSizeChanged;
|
|
18483
|
+
$[19] = showSizeSelector;
|
|
18484
|
+
$[20] = size;
|
|
18485
|
+
$[21] = t13;
|
|
18513
18486
|
} else {
|
|
18514
|
-
|
|
18487
|
+
t13 = $[21];
|
|
18515
18488
|
}
|
|
18516
|
-
let
|
|
18517
|
-
if ($[
|
|
18518
|
-
|
|
18489
|
+
let t14;
|
|
18490
|
+
if ($[22] !== kanbanPropertyOptions || $[23] !== onKanbanPropertyChange || $[24] !== selectedKanbanProperty || $[25] !== showKanbanPropertySelector) {
|
|
18491
|
+
t14 = showKanbanPropertySelector && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
18519
18492
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-sm text-surface-600 dark:text-surface-300", children: [
|
|
18520
18493
|
/* @__PURE__ */ jsxRuntime.jsx(ui.ViewKanbanIcon, { size: "small" }),
|
|
18521
18494
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Group by" })
|
|
18522
18495
|
] }),
|
|
18523
18496
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Select, { value: selectedKanbanProperty, size: "small", className: "w-32", onValueChange: (v_1) => onKanbanPropertyChange?.(v_1), renderValue: (v_2) => {
|
|
18524
|
-
const
|
|
18525
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium truncate", children:
|
|
18497
|
+
const option_0 = kanbanPropertyOptions?.find((o) => o.key === v_2);
|
|
18498
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium truncate", children: option_0?.label ?? v_2 });
|
|
18526
18499
|
}, children: kanbanPropertyOptions?.map(_temp3$3) })
|
|
18527
18500
|
] });
|
|
18528
|
-
$[
|
|
18529
|
-
$[
|
|
18530
|
-
$[
|
|
18531
|
-
$[
|
|
18532
|
-
$[
|
|
18501
|
+
$[22] = kanbanPropertyOptions;
|
|
18502
|
+
$[23] = onKanbanPropertyChange;
|
|
18503
|
+
$[24] = selectedKanbanProperty;
|
|
18504
|
+
$[25] = showKanbanPropertySelector;
|
|
18505
|
+
$[26] = t14;
|
|
18533
18506
|
} else {
|
|
18534
|
-
|
|
18507
|
+
t14 = $[26];
|
|
18535
18508
|
}
|
|
18536
|
-
let
|
|
18537
|
-
if ($[
|
|
18538
|
-
|
|
18509
|
+
let t15;
|
|
18510
|
+
if ($[27] !== t12 || $[28] !== t13 || $[29] !== t14) {
|
|
18511
|
+
t15 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3 flex flex-col gap-3 min-w-[240px]", children: [
|
|
18512
|
+
t12,
|
|
18539
18513
|
t13,
|
|
18540
|
-
t14
|
|
18541
|
-
t15
|
|
18514
|
+
t14
|
|
18542
18515
|
] });
|
|
18543
|
-
$[
|
|
18544
|
-
$[
|
|
18545
|
-
$[
|
|
18546
|
-
$[
|
|
18516
|
+
$[27] = t12;
|
|
18517
|
+
$[28] = t13;
|
|
18518
|
+
$[29] = t14;
|
|
18519
|
+
$[30] = t15;
|
|
18547
18520
|
} else {
|
|
18548
|
-
|
|
18521
|
+
t15 = $[30];
|
|
18549
18522
|
}
|
|
18550
|
-
let
|
|
18551
|
-
if ($[
|
|
18552
|
-
|
|
18553
|
-
$[
|
|
18554
|
-
$[
|
|
18555
|
-
$[
|
|
18556
|
-
$[
|
|
18557
|
-
$[
|
|
18523
|
+
let t16;
|
|
18524
|
+
if ($[31] !== onOpenChange || $[32] !== open || $[33] !== t11 || $[34] !== t15) {
|
|
18525
|
+
t16 = /* @__PURE__ */ jsxRuntime.jsx(ui.Popover, { open, onOpenChange, modal: true, trigger: t11, children: t15 });
|
|
18526
|
+
$[31] = onOpenChange;
|
|
18527
|
+
$[32] = open;
|
|
18528
|
+
$[33] = t11;
|
|
18529
|
+
$[34] = t15;
|
|
18530
|
+
$[35] = t16;
|
|
18558
18531
|
} else {
|
|
18559
|
-
|
|
18532
|
+
t16 = $[35];
|
|
18560
18533
|
}
|
|
18561
|
-
return
|
|
18534
|
+
return t16;
|
|
18562
18535
|
}
|
|
18563
|
-
function _temp3$3(
|
|
18564
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value:
|
|
18536
|
+
function _temp3$3(option_1) {
|
|
18537
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: option_1.key, children: option_1.label }, option_1.key);
|
|
18565
18538
|
}
|
|
18566
18539
|
function _temp2$5(s) {
|
|
18567
18540
|
return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: s, className: "font-medium text-center", children: s.toUpperCase() }, s);
|
|
@@ -24562,24 +24535,26 @@
|
|
|
24562
24535
|
propertyConfigs: customizationController.propertyConfigs,
|
|
24563
24536
|
authController
|
|
24564
24537
|
}), [collection, fullPath]);
|
|
24565
|
-
const
|
|
24566
|
-
|
|
24567
|
-
|
|
24568
|
-
|
|
24569
|
-
|
|
24570
|
-
|
|
24571
|
-
|
|
24572
|
-
|
|
24573
|
-
|
|
24538
|
+
const hasEnumProperty = React.useMemo(() => {
|
|
24539
|
+
const properties = resolvedCollection.properties;
|
|
24540
|
+
return Object.values(properties).some((prop) => prop && prop.dataType === "string" && prop.enumValues);
|
|
24541
|
+
}, [resolvedCollection.properties]);
|
|
24542
|
+
const enabledViews = React.useMemo(() => {
|
|
24543
|
+
const configured = collection.enabledViews ?? ["table", "cards", "kanban"];
|
|
24544
|
+
if (!hasEnumProperty) {
|
|
24545
|
+
return configured.filter((v) => v !== "kanban");
|
|
24546
|
+
}
|
|
24547
|
+
return configured;
|
|
24548
|
+
}, [collection.enabledViews, hasEnumProperty]);
|
|
24574
24549
|
const kanbanPropertyOptions = React.useMemo(() => {
|
|
24575
24550
|
const options = [];
|
|
24576
|
-
const
|
|
24577
|
-
for (const [key_0,
|
|
24578
|
-
const
|
|
24579
|
-
if (
|
|
24551
|
+
const properties_0 = resolvedCollection.properties;
|
|
24552
|
+
for (const [key_0, property_0] of Object.entries(properties_0)) {
|
|
24553
|
+
const prop_0 = property_0;
|
|
24554
|
+
if (prop_0 && prop_0.dataType === "string" && prop_0.enumValues) {
|
|
24580
24555
|
options.push({
|
|
24581
24556
|
key: key_0,
|
|
24582
|
-
label:
|
|
24557
|
+
label: prop_0.name || key_0
|
|
24583
24558
|
});
|
|
24584
24559
|
}
|
|
24585
24560
|
}
|
|
@@ -24607,11 +24582,11 @@
|
|
|
24607
24582
|
}
|
|
24608
24583
|
}
|
|
24609
24584
|
}, [kanbanPropertyOptions, selectedKanbanProperty, getSavedKanbanProperty, collection.kanban?.columnProperty]);
|
|
24610
|
-
const onKanbanPropertyChange = React.useCallback((
|
|
24611
|
-
setSelectedKanbanProperty(
|
|
24585
|
+
const onKanbanPropertyChange = React.useCallback((property_1) => {
|
|
24586
|
+
setSelectedKanbanProperty(property_1);
|
|
24612
24587
|
if (userConfigPersistence) {
|
|
24613
24588
|
onCollectionModifiedForUser(fullPath, {
|
|
24614
|
-
kanbanColumnProperty:
|
|
24589
|
+
kanbanColumnProperty: property_1
|
|
24615
24590
|
});
|
|
24616
24591
|
}
|
|
24617
24592
|
}, [userConfigPersistence, onCollectionModifiedForUser, fullPath]);
|
|
@@ -24726,15 +24701,15 @@
|
|
|
24726
24701
|
}, [docsCount, fullPath, breadcrumbs.updateCount]);
|
|
24727
24702
|
const countFetcher = /* @__PURE__ */ jsxRuntime.jsx(EntitiesCount, { fullPath, collection, filter: tableController.filterValues, sortBy: tableController.sortBy, onCountChange: setDocsCount });
|
|
24728
24703
|
const buildAdditionalHeaderWidget = React.useCallback(({
|
|
24729
|
-
property:
|
|
24704
|
+
property: property_2,
|
|
24730
24705
|
propertyKey: propertyKey_1,
|
|
24731
24706
|
onHover
|
|
24732
24707
|
}) => {
|
|
24733
24708
|
const collection_4 = collectionRef.current;
|
|
24734
24709
|
if (!customizationController.plugins) return null;
|
|
24735
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: customizationController.plugins.filter((
|
|
24736
|
-
const HeaderAction =
|
|
24737
|
-
return /* @__PURE__ */ jsxRuntime.jsx(HeaderAction, { onHover, propertyKey: propertyKey_1, property:
|
|
24710
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: customizationController.plugins.filter((plugin_0) => plugin_0.collectionView?.HeaderAction).map((plugin_1, i) => {
|
|
24711
|
+
const HeaderAction = plugin_1.collectionView.HeaderAction;
|
|
24712
|
+
return /* @__PURE__ */ jsxRuntime.jsx(HeaderAction, { onHover, propertyKey: propertyKey_1, property: property_2, fullPath, collection: collection_4, tableController, parentCollectionIds: parentCollectionIds ?? [] }, `plugin_header_action_${i}`);
|
|
24738
24713
|
}) });
|
|
24739
24714
|
}, [customizationController.plugins, fullPath, parentCollectionIds]);
|
|
24740
24715
|
const addColumnComponentInternal = AddColumnComponent ? function() {
|
|
@@ -24752,11 +24727,11 @@
|
|
|
24752
24727
|
parentCollectionIds
|
|
24753
24728
|
});
|
|
24754
24729
|
const [viewModePopoverOpen, setViewModePopoverOpen] = React.useState(false);
|
|
24755
|
-
const viewModeToggleElement = /* @__PURE__ */ jsxRuntime.jsx(ViewModeToggle, { viewMode, onViewModeChange,
|
|
24730
|
+
const viewModeToggleElement = /* @__PURE__ */ jsxRuntime.jsx(ViewModeToggle, { viewMode, onViewModeChange, enabledViews, size: viewMode === "table" ? tableSize : viewMode === "cards" ? cardSize : void 0, onSizeChanged: viewMode === "table" ? onTableSizeChanged : viewMode === "cards" ? setCardSize : void 0, open: viewModePopoverOpen, onOpenChange: setViewModePopoverOpen, kanbanPropertyOptions, selectedKanbanProperty, onKanbanPropertyChange });
|
|
24756
24731
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("overflow-hidden h-full w-full rounded-md flex flex-col", className), ref: containerRef, children: [
|
|
24757
24732
|
countFetcher,
|
|
24758
24733
|
/* @__PURE__ */ jsxRuntime.jsx(CollectionTableToolbar, { loading: tableController.dataLoading, onTextSearch: textSearchEnabled && textSearchInitialised ? tableController.setSearchString : void 0, onTextSearchClick: textSearchEnabled && !textSearchInitialised ? onTextSearchClick : void 0, textSearchLoading, viewModeToggle: viewModeToggleElement, actionsStart: /* @__PURE__ */ jsxRuntime.jsx(EntityCollectionViewStartActions, { parentCollectionIds: parentCollectionIds ?? [], collection, tableController, path: fullPath, relativePath: collection.path, selectionController: usedSelectionController, collectionEntitiesCount: docsCount, resolvedProperties: resolvedCollection.properties }), actions: /* @__PURE__ */ jsxRuntime.jsx(EntityCollectionViewActions, { parentCollectionIds: parentCollectionIds ?? [], collection, tableController, onMultipleDeleteClick, onNewClick, path: fullPath, relativePath: collection.path, selectionController: usedSelectionController, selectionEnabled, collectionEntitiesCount: docsCount }) }),
|
|
24759
|
-
viewMode === "kanban" && (
|
|
24734
|
+
viewMode === "kanban" && enabledViews.includes("kanban") ? /* @__PURE__ */ jsxRuntime.jsx(EntityCollectionBoardView, { collection, tableController, fullPath, parentCollectionIds, columnProperty: selectedKanbanProperty, onEntityClick, selectionController: usedSelectionController, selectionEnabled, highlightedEntities: highlightedEntity ? [highlightedEntity] : [], deletedEntities, emptyComponent: canCreateEntities && tableController.filterValues === void 0 && tableController.sortBy === void 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center", children: [
|
|
24760
24735
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", children: "So empty..." }),
|
|
24761
24736
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { onClick: onNewClick, className: "mt-4", children: [
|
|
24762
24737
|
/* @__PURE__ */ jsxRuntime.jsx(ui.AddIcon, {}),
|
|
@@ -24783,8 +24758,8 @@
|
|
|
24783
24758
|
});
|
|
24784
24759
|
setLocalPropertiesOrder(newPropertiesOrder);
|
|
24785
24760
|
if (customizationController?.plugins) {
|
|
24786
|
-
customizationController.plugins.filter((
|
|
24787
|
-
|
|
24761
|
+
customizationController.plugins.filter((plugin_2) => plugin_2.collectionView?.onColumnsReorder).forEach((plugin_3) => {
|
|
24762
|
+
plugin_3.collectionView.onColumnsReorder({
|
|
24788
24763
|
fullPath,
|
|
24789
24764
|
parentCollectionIds: parentCollectionIds ?? [],
|
|
24790
24765
|
collection,
|