@ai-matrx/records-ui 0.101.26 → 0.101.27
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 +6 -0
- package/dist/index.cjs +24 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +24 -10
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -20533,10 +20533,11 @@ function viewOrderOf(definition) {
|
|
|
20533
20533
|
const raw = definition?.["order"];
|
|
20534
20534
|
return raw === "manual" ? "manual" : raw === "sorted" ? "sorted" : null;
|
|
20535
20535
|
}
|
|
20536
|
+
var RETIRED_HOST_LAYOUTS = ["sheet"];
|
|
20536
20537
|
function designatedLayoutOf(definition) {
|
|
20537
20538
|
const data = definition ?? {};
|
|
20538
20539
|
const raw = typeof data["layout"] === "string" ? data["layout"].trim().toLowerCase() : "";
|
|
20539
|
-
if (raw !== "" && !VIEW_LAYOUTS.includes(raw)) return raw;
|
|
20540
|
+
if (raw !== "" && !VIEW_LAYOUTS.includes(raw) && !RETIRED_HOST_LAYOUTS.includes(raw)) return raw;
|
|
20540
20541
|
return null;
|
|
20541
20542
|
}
|
|
20542
20543
|
function tableOpening(view, hostLayoutIds) {
|
|
@@ -22872,7 +22873,8 @@ function GridBody({
|
|
|
22872
22873
|
rows: rows.length,
|
|
22873
22874
|
onPage: setPage
|
|
22874
22875
|
}
|
|
22875
|
-
)
|
|
22876
|
+
),
|
|
22877
|
+
embedded && !merged && !readOnly && rights.write ? /* @__PURE__ */ jsx68("div", { className: "px-2 py-1.5", children: /* @__PURE__ */ jsx68(AddRowLine, { onAdd: () => void addRecord(), busy: editingBusy, label: newRowLabel ?? "Add row" }) }) : null
|
|
22876
22878
|
] }),
|
|
22877
22879
|
/* @__PURE__ */ jsx68(ActionConfirm, { runner, fields: fields.data ?? [], noun, nounPlural }),
|
|
22878
22880
|
assist.dialogs,
|
|
@@ -30996,7 +30998,8 @@ function ListView({
|
|
|
30996
30998
|
remembered,
|
|
30997
30999
|
note,
|
|
30998
31000
|
style,
|
|
30999
|
-
formats
|
|
31001
|
+
formats,
|
|
31002
|
+
newLabel
|
|
31000
31003
|
}) {
|
|
31001
31004
|
const groupField = grouping?.field ? fields.find((f) => f.key === grouping.field) : void 0;
|
|
31002
31005
|
const groupKey = groupField?.key ?? null;
|
|
@@ -31062,14 +31065,17 @@ function ListView({
|
|
|
31062
31065
|
)
|
|
31063
31066
|
}
|
|
31064
31067
|
) }, row.id)) }),
|
|
31065
|
-
mayAddIn ? /* @__PURE__ */
|
|
31068
|
+
mayAddIn ? /* @__PURE__ */ jsxs93(
|
|
31066
31069
|
"button",
|
|
31067
31070
|
{
|
|
31068
31071
|
type: "button",
|
|
31069
31072
|
"data-records-list-add": group.key,
|
|
31070
31073
|
className: "self-start rounded px-1 py-0.5 text-xs text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
31071
31074
|
onClick: () => void add(group),
|
|
31072
|
-
children:
|
|
31075
|
+
children: [
|
|
31076
|
+
"+ ",
|
|
31077
|
+
newLabel ?? "New"
|
|
31078
|
+
]
|
|
31073
31079
|
}
|
|
31074
31080
|
) : null
|
|
31075
31081
|
] }, group.key)) }),
|
|
@@ -31371,7 +31377,8 @@ function ViewSwitcher({
|
|
|
31371
31377
|
remembered: Boolean(onViewChange),
|
|
31372
31378
|
...onOpenRecord ? { onOpenRecord } : {},
|
|
31373
31379
|
...onMoved ? { onMoved } : {},
|
|
31374
|
-
canCreate: Boolean(onNewRecordForm)
|
|
31380
|
+
canCreate: Boolean(onNewRecordForm),
|
|
31381
|
+
...embedded && newRowLabel ? { newRowLabel } : {}
|
|
31375
31382
|
}
|
|
31376
31383
|
)
|
|
31377
31384
|
] });
|
|
@@ -31454,7 +31461,8 @@ function Board({
|
|
|
31454
31461
|
onMoved,
|
|
31455
31462
|
viewId,
|
|
31456
31463
|
onClearFilter,
|
|
31457
|
-
canCreate = false
|
|
31464
|
+
canCreate = false,
|
|
31465
|
+
newRowLabel
|
|
31458
31466
|
}) {
|
|
31459
31467
|
const fields = useFields18(view.subject);
|
|
31460
31468
|
const records = useViewRecords(view, pageSize, filter, viewId ?? null);
|
|
@@ -31698,6 +31706,7 @@ function Board({
|
|
|
31698
31706
|
onChanged: () => records.reload(),
|
|
31699
31707
|
...onMoved ? { onMoved } : {},
|
|
31700
31708
|
canAdd: mayAdd,
|
|
31709
|
+
...newRowLabel ? { newLabel: newRowLabel } : {},
|
|
31701
31710
|
remembered,
|
|
31702
31711
|
note: records.membership,
|
|
31703
31712
|
style,
|
|
@@ -31720,6 +31729,7 @@ function Board({
|
|
|
31720
31729
|
Gallery,
|
|
31721
31730
|
{
|
|
31722
31731
|
...addCard ? { onNew: () => void addCard() } : {},
|
|
31732
|
+
...newRowLabel ? { newLabel: newRowLabel } : {},
|
|
31723
31733
|
tableId: view.subject,
|
|
31724
31734
|
titleKey,
|
|
31725
31735
|
onChanged: () => {
|
|
@@ -32048,7 +32058,8 @@ function Gallery({
|
|
|
32048
32058
|
onSizeChange,
|
|
32049
32059
|
onHiddenFieldsChange,
|
|
32050
32060
|
remembered,
|
|
32051
|
-
onNew
|
|
32061
|
+
onNew,
|
|
32062
|
+
newLabel
|
|
32052
32063
|
}) {
|
|
32053
32064
|
const hidden = useMemo53(() => new Set(hiddenFields ?? []), [hiddenFields]);
|
|
32054
32065
|
const imageField = imageKey ? fields.find((field2) => field2.key === imageKey) : void 0;
|
|
@@ -32112,14 +32123,17 @@ function Gallery({
|
|
|
32112
32123
|
}
|
|
32113
32124
|
) }, row.id);
|
|
32114
32125
|
}),
|
|
32115
|
-
onNew ? /* @__PURE__ */ jsx105("li", { children: /* @__PURE__ */
|
|
32126
|
+
onNew ? /* @__PURE__ */ jsx105("li", { children: /* @__PURE__ */ jsxs94(
|
|
32116
32127
|
"button",
|
|
32117
32128
|
{
|
|
32118
32129
|
type: "button",
|
|
32119
32130
|
"data-records-gallery-add": "",
|
|
32120
32131
|
className: "flex h-full min-h-16 w-full items-center justify-center rounded border border-dashed p-2 text-xs text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
32121
32132
|
onClick: onNew,
|
|
32122
|
-
children:
|
|
32133
|
+
children: [
|
|
32134
|
+
"+ ",
|
|
32135
|
+
newLabel ?? "New"
|
|
32136
|
+
]
|
|
32123
32137
|
}
|
|
32124
32138
|
) }) : null
|
|
32125
32139
|
]
|