@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.
@@ -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
- /** List rows as sidebar records: titled like the record page, dotted by their status, active while open. */
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 = String(row[recent.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: model.fields[recent.status]?.type === "enum" && status ? enumLabel(status, view.fields[recent.status]?.valueLabels) : 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
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.53.8";
2
+ var version = "0.54.0";
3
3
  var protobase = { "pluginApi": 1 };
4
4
  //#endregion
5
5
  export { protobase, version };