@protobase/ui 0.53.8 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/nav-recent.js +13 -6
- package/dist/app-shell/sidebar-group.js +5 -5
- package/dist/package.js +1 -1
- package/dist/shell/assets/{app-D0QfXMxK.js → app-BUbmsBiu.js} +5 -5
- package/dist/shell/assets/{index-f5Nt4-Hd.js → index-Bpl6cTJg.js} +2 -2
- package/dist/shell/assets/{records-map-nmljawiv.js → records-map-BFpLtSYz.js} +2 -2
- package/dist/shell/assets/{shared-protobase-ui-BDt_1A9W.js → shared-protobase-ui-CazeXVLF.js} +2 -2
- package/dist/shell/index.html +3 -3
- package/dist/shell/protobase.shell.json +1 -1
- package/dist/shell/protobase.sw.js +2 -2
- package/dist/shell-source-maps/assets/app-BUbmsBiu.js.map +1 -0
- package/dist/shell-source-maps/assets/{index-f5Nt4-Hd.js.map → index-Bpl6cTJg.js.map} +1 -1
- package/dist/shell-source-maps/assets/{records-map-nmljawiv.js.map → records-map-BFpLtSYz.js.map} +1 -1
- package/dist/shell-source-maps/assets/{shared-protobase-ui-BDt_1A9W.js.map → shared-protobase-ui-CazeXVLF.js.map} +1 -1
- package/package.json +4 -4
- package/dist/shell-source-maps/assets/app-D0QfXMxK.js.map +0 -1
package/dist/app/nav-recent.js
CHANGED
|
@@ -11,14 +11,23 @@ const recentRequest = (model, view, recent) => ({
|
|
|
11
11
|
fields: [.../* @__PURE__ */ new Set([
|
|
12
12
|
...model.primaryKey,
|
|
13
13
|
recordTitleField(model, view),
|
|
14
|
-
recent.status
|
|
14
|
+
...recent.status === void 0 ? [] : [recent.status]
|
|
15
15
|
])]
|
|
16
16
|
});
|
|
17
|
-
|
|
17
|
+
const recordStatus = (model, view, recent, row) => {
|
|
18
|
+
if (recent.status === void 0) return;
|
|
19
|
+
const value = String(row[recent.status] ?? "");
|
|
20
|
+
return {
|
|
21
|
+
label: model.fields[recent.status]?.type === "enum" && value ? enumLabel(value, view.fields[recent.status]?.valueLabels) : value,
|
|
22
|
+
tone: recent.tones?.[value] ?? "neutral",
|
|
23
|
+
pulse: recent.pulse?.includes(value) ?? false
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
/** List rows as sidebar records: titled like the record page, dotted by their status when the group has one, active while open. */
|
|
18
27
|
const recentRecords = (model, view, recent, rows, basePath, activeKey) => {
|
|
19
28
|
return rows.map((row) => {
|
|
20
29
|
const key = encodeKey(recordKey(model, row));
|
|
21
|
-
const status =
|
|
30
|
+
const status = recordStatus(model, view, recent, row);
|
|
22
31
|
return {
|
|
23
32
|
id: key,
|
|
24
33
|
label: recordTitle(model, view, row, key),
|
|
@@ -27,9 +36,7 @@ const recentRecords = (model, view, recent, rows, basePath, activeKey) => {
|
|
|
27
36
|
resource: model.name,
|
|
28
37
|
key
|
|
29
38
|
}, basePath),
|
|
30
|
-
status
|
|
31
|
-
tone: recent.tones[status] ?? "neutral",
|
|
32
|
-
pulse: recent.pulse?.includes(status) ?? false,
|
|
39
|
+
...status && { status },
|
|
33
40
|
active: key === activeKey
|
|
34
41
|
};
|
|
35
42
|
});
|
|
@@ -70,13 +70,13 @@ const SidebarGroup = ({ item, recent, mode, active, onNavigate }) => {
|
|
|
70
70
|
}),
|
|
71
71
|
recent.state === "ready" && recent.records.map((record) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("a", {
|
|
72
72
|
...link(record.href),
|
|
73
|
-
"aria-label": `${record.label}, ${record.status}
|
|
74
|
-
title: `${record.label} (${record.status})
|
|
73
|
+
"aria-label": record.status ? `${record.label}, ${record.status.label}` : record.label,
|
|
74
|
+
title: record.status ? `${record.label} (${record.status.label})` : record.label,
|
|
75
75
|
"aria-current": record.active ? "page" : void 0,
|
|
76
76
|
className: cn("flex min-w-0 items-center rounded-md font-medium transition-colors", row[mode], record.active ? "bg-muted text-foreground" : "text-muted-foreground hover:bg-muted hover:text-foreground"),
|
|
77
|
-
children: [/* @__PURE__ */ jsx(StatusDot, {
|
|
78
|
-
tone: record.tone,
|
|
79
|
-
pulse: record.pulse
|
|
77
|
+
children: [record.status && /* @__PURE__ */ jsx(StatusDot, {
|
|
78
|
+
tone: record.status.tone,
|
|
79
|
+
pulse: record.status.pulse
|
|
80
80
|
}), /* @__PURE__ */ jsx("span", {
|
|
81
81
|
className: "truncate",
|
|
82
82
|
children: record.label
|
package/dist/package.js
CHANGED