@ai-matrx/records-ui 0.110.8 → 0.110.10
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/CHANGELOG.md +15 -0
- package/dist/first-page.cjs +10 -0
- package/dist/first-page.cjs.map +1 -1
- package/dist/first-page.js +10 -0
- package/dist/first-page.js.map +1 -1
- package/dist/index.cjs +34 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +34 -11
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -2853,15 +2853,18 @@ function rowSection(rowId, ctx, rowText) {
|
|
|
2853
2853
|
items.push({ id: "row-history", label: "Row history", icon: "history", onSelect: () => a.openRecord?.(rowId) });
|
|
2854
2854
|
}
|
|
2855
2855
|
items.push(...ctx.extras?.row?.(rowId) ?? []);
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2856
|
+
const mayRemove = mayWrite && (ctx.mayRemoveRow ? ctx.mayRemoveRow(rowId) : true);
|
|
2857
|
+
if (mayRemove || !ctx.hideRefusedRowActions) {
|
|
2858
|
+
items.push({
|
|
2859
|
+
id: "row-archive",
|
|
2860
|
+
label: "Archive record",
|
|
2861
|
+
icon: "trash",
|
|
2862
|
+
destructive: true,
|
|
2863
|
+
separatorBefore: true,
|
|
2864
|
+
disabledReason: mayRemove ? void 0 : !mayWrite ? ctx.whyNotWrite(rowId) : ctx.whyNotRemove?.(rowId) ?? ctx.whyNotWrite(rowId),
|
|
2865
|
+
onSelect: () => a.archiveRow(rowId)
|
|
2866
|
+
});
|
|
2867
|
+
}
|
|
2865
2868
|
return { id: "row", title: ctx.extras?.rowTitle?.(rowId) || "Row", items };
|
|
2866
2869
|
}
|
|
2867
2870
|
function columnSection(columnId2, columnLabel2, ctx) {
|
|
@@ -7484,6 +7487,7 @@ function chosenEntries(chosen) {
|
|
|
7484
7487
|
function groupFactMeasures(chosen) {
|
|
7485
7488
|
return [{ op: "count" }, ...chosenEntries(chosen).filter(([, op2]) => op2 !== "count").map(([key, op2]) => ({ op: op2, key }))];
|
|
7486
7489
|
}
|
|
7490
|
+
var REVERSE_CELL_CHIPS = 3;
|
|
7487
7491
|
|
|
7488
7492
|
// src/viewKeys.ts
|
|
7489
7493
|
var STORE_KEEPS_TIMELINE = true;
|
|
@@ -16425,6 +16429,9 @@ function useMergedGridControls(args) {
|
|
|
16425
16429
|
canWrite,
|
|
16426
16430
|
mayWriteRow,
|
|
16427
16431
|
whyNotRow,
|
|
16432
|
+
mayRemoveRow,
|
|
16433
|
+
whyNotRemoveRow,
|
|
16434
|
+
hideRefusedRowActions,
|
|
16428
16435
|
rights,
|
|
16429
16436
|
editable,
|
|
16430
16437
|
presentation,
|
|
@@ -16682,6 +16689,9 @@ function useMergedGridControls(args) {
|
|
|
16682
16689
|
titleField: table?.title_field ?? null,
|
|
16683
16690
|
mayWriteRow: (rowId) => canWrite && mayWriteRow(rowId),
|
|
16684
16691
|
whyNotWrite: (rowId) => !editable ? "Editing is off here." : rowId ? whyNotRow(rowId) : rights.why("write"),
|
|
16692
|
+
mayRemoveRow: (rowId) => canWrite && mayRemoveRow(rowId),
|
|
16693
|
+
whyNotRemove: (rowId) => rowId ? whyNotRemoveRow(rowId) : rights.why("remove"),
|
|
16694
|
+
hideRefusedRowActions,
|
|
16685
16695
|
mayAddRecord: editable && rights.write,
|
|
16686
16696
|
whyNotAdd: editable ? rights.why("write") : "Editing is off here.",
|
|
16687
16697
|
mayStructure,
|
|
@@ -19572,7 +19582,6 @@ var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
|
19572
19582
|
function reverseColumnId(column) {
|
|
19573
19583
|
return `${REVERSE_COLUMN_PREFIX}${column.key}`;
|
|
19574
19584
|
}
|
|
19575
|
-
var REVERSE_CELL_CHIPS = 3;
|
|
19576
19585
|
var REVERSE_PANEL_PAGE = 20;
|
|
19577
19586
|
function refsOf(column, answer) {
|
|
19578
19587
|
return (answer?.links ?? []).map((link) => ({
|
|
@@ -23929,7 +23938,8 @@ function GridBody({
|
|
|
23929
23938
|
sortOverride,
|
|
23930
23939
|
searchOverride,
|
|
23931
23940
|
onSearchChange,
|
|
23932
|
-
searchBox = true
|
|
23941
|
+
searchBox = true,
|
|
23942
|
+
hideRefusedRowActions = false
|
|
23933
23943
|
}) {
|
|
23934
23944
|
const toolbarSlot = useTableToolbarSlot();
|
|
23935
23945
|
const tableCard = (0, import_data_table13.useMatrxTableCard)();
|
|
@@ -24168,6 +24178,14 @@ function GridBody({
|
|
|
24168
24178
|
(rowId) => askPerRow ? rowRights(rowId)?.write ?? false : rights.write,
|
|
24169
24179
|
[askPerRow, rowRights, rights.write]
|
|
24170
24180
|
);
|
|
24181
|
+
const mayRemoveRow = (0, import_react123.useCallback)(
|
|
24182
|
+
(rowId) => askPerRow ? rowRights(rowId)?.remove ?? false : rights.remove,
|
|
24183
|
+
[askPerRow, rowRights, rights.remove]
|
|
24184
|
+
);
|
|
24185
|
+
const whyNotRemoveRow = (0, import_react123.useCallback)(
|
|
24186
|
+
(rowId) => askPerRow ? rowRights(rowId)?.why("remove") ?? rights.why("remove") : rights.why("remove"),
|
|
24187
|
+
[askPerRow, rowRights, rights]
|
|
24188
|
+
);
|
|
24171
24189
|
const whyNotRow = (0, import_react123.useCallback)(
|
|
24172
24190
|
(rowId) => askPerRow ? rowRights(rowId)?.why("write") ?? rights.why("write") : rights.why("write"),
|
|
24173
24191
|
[askPerRow, rowRights, rights]
|
|
@@ -24838,6 +24856,9 @@ function GridBody({
|
|
|
24838
24856
|
canWrite,
|
|
24839
24857
|
mayWriteRow,
|
|
24840
24858
|
whyNotRow,
|
|
24859
|
+
mayRemoveRow,
|
|
24860
|
+
whyNotRemoveRow,
|
|
24861
|
+
hideRefusedRowActions,
|
|
24841
24862
|
rights,
|
|
24842
24863
|
editable: Boolean(editable),
|
|
24843
24864
|
readOnly,
|
|
@@ -34360,6 +34381,7 @@ function ViewSwitcher({
|
|
|
34360
34381
|
searchOverride,
|
|
34361
34382
|
onSearchChange,
|
|
34362
34383
|
searchBox,
|
|
34384
|
+
hideRefusedRowActions,
|
|
34363
34385
|
newRowLabel,
|
|
34364
34386
|
className
|
|
34365
34387
|
}) {
|
|
@@ -34405,6 +34427,7 @@ function ViewSwitcher({
|
|
|
34405
34427
|
...searchOverride !== void 0 ? { searchOverride } : {},
|
|
34406
34428
|
...onSearchChange ? { onSearchChange } : {},
|
|
34407
34429
|
...searchBox === false ? { searchBox } : {},
|
|
34430
|
+
...hideRefusedRowActions ? { hideRefusedRowActions } : {},
|
|
34408
34431
|
...newRowLabel ? { newRowLabel } : {},
|
|
34409
34432
|
...filter ? { filter } : {},
|
|
34410
34433
|
...onClearFilter ? { onClearFilter } : {},
|