@ai-matrx/records-ui 0.115.46 → 0.115.47
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 +99 -49
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +99 -49
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +20 -9
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +20 -9
- package/dist/pickers.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog — @ai-matrx/records-ui
|
|
2
2
|
|
|
3
|
+
## 0.115.47
|
|
4
|
+
|
|
5
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
6
|
+
`git diff npm/records-ui/v0.115.46..npm/records-ui/v0.115.47 -- apps/shared/records-ui`).
|
|
7
|
+
No source changes intended and no consumer action required.
|
|
8
|
+
|
|
3
9
|
## 0.115.46
|
|
4
10
|
|
|
5
11
|
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
package/dist/index.cjs
CHANGED
|
@@ -2647,14 +2647,24 @@ function RefusalLine({ error, className }) {
|
|
|
2647
2647
|
// src/FieldRetype.tsx
|
|
2648
2648
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
2649
2649
|
var RETYPE_TARGETS = [
|
|
2650
|
-
{ id: "text", behaviour: "text", kind: null, label: "Text", holds: "words" },
|
|
2651
|
-
{ id: "number", behaviour: "range", kind: "number", label: "Number", holds: "a number" },
|
|
2650
|
+
{ id: "text", behaviour: "text", kind: null, label: "Text", holds: "words", via: "behaviour" },
|
|
2651
|
+
{ id: "number", behaviour: "range", kind: "number", label: "Number", holds: "a number", via: "behaviour" },
|
|
2652
2652
|
// A DATE is a `range` of kind date: `migrate_retype` alone cannot say "date" (it keeps the old
|
|
2653
2653
|
// kind, so every date would be kept aside), so this one goes through `custom.field_update`'s own
|
|
2654
2654
|
// retype arm (`parity_type: datetime`), which converts on the SAME trigger and keeps what does not
|
|
2655
2655
|
// fit in `_retired` with the reason — measured on the live store 2026-09-28.
|
|
2656
|
-
{ id: "date", behaviour: "range", kind: "date", label: "Date", holds: "a date" },
|
|
2657
|
-
{ id: "checkbox", behaviour: "boolean", kind: null, label: "Yes / no", holds: "a yes or a no" }
|
|
2656
|
+
{ id: "date", behaviour: "range", kind: "date", label: "Date", holds: "a date", via: "kind", parity: "datetime" },
|
|
2657
|
+
{ id: "checkbox", behaviour: "boolean", kind: null, label: "Yes / no", holds: "a yes or a no", via: "behaviour" },
|
|
2658
|
+
// THE REST OF WHAT THE STORE'S RETYPE TAKES (walk 2026-10-10: a text column could only become Number,
|
|
2659
|
+
// Date or Yes/no, so it could not become a Choice, Phone, Email or Link — the Sheet allowed any
|
|
2660
|
+
// kind the values convert to). All go through `custom.field_update`'s `parity_type` arm, the same
|
|
2661
|
+
// conversion trigger, which keeps what does not fit in `_retired` with the reason.
|
|
2662
|
+
{ id: "email", behaviour: "text", kind: null, label: "Email address", holds: "email addresses", via: "kind", parity: "email" },
|
|
2663
|
+
{ id: "phone", behaviour: "text", kind: null, label: "Phone number", holds: "phone numbers", via: "kind", parity: "phone" },
|
|
2664
|
+
{ id: "url", behaviour: "text", kind: null, label: "Link", holds: "web addresses", via: "kind", parity: "url" },
|
|
2665
|
+
{ id: "currency", behaviour: "range", kind: "number", label: "Money", holds: "an amount of money", via: "kind", parity: "currency" },
|
|
2666
|
+
{ id: "percent", behaviour: "range", kind: "number", label: "Percentage", holds: "a percentage", via: "kind", parity: "percent" },
|
|
2667
|
+
{ id: "select", behaviour: "text", kind: null, label: "Choice", holds: "one choice from a list", via: "kind", parity: "select" }
|
|
2658
2668
|
];
|
|
2659
2669
|
var PREVIEW_GROUPS = 1e3;
|
|
2660
2670
|
function retypeableFrom(field2) {
|
|
@@ -2676,6 +2686,7 @@ function currentTarget(field2) {
|
|
|
2676
2686
|
const kind = String(editorKindFor(field2));
|
|
2677
2687
|
if (String(field2.type) === "boolean") return "checkbox";
|
|
2678
2688
|
if (kind === "datetime" || kind === "date") return "date";
|
|
2689
|
+
if (kind === "email" || kind === "phone" || kind === "url" || kind === "currency" || kind === "percent") return kind;
|
|
2679
2690
|
if (String(field2.type) === "range") return "number";
|
|
2680
2691
|
return "text";
|
|
2681
2692
|
}
|
|
@@ -2719,8 +2730,8 @@ function FieldRetype({ field: field2, tableId, onRetyped }) {
|
|
|
2719
2730
|
setRefusal(null);
|
|
2720
2731
|
let holding;
|
|
2721
2732
|
let aside;
|
|
2722
|
-
if (to.
|
|
2723
|
-
const done = await client.fieldUpdate({ field_id: field2.id, patch: { parity_type:
|
|
2733
|
+
if (to.via !== "behaviour") {
|
|
2734
|
+
const done = await client.fieldUpdate({ field_id: field2.id, patch: { parity_type: to.parity } });
|
|
2724
2735
|
setBusy(false);
|
|
2725
2736
|
if (!done.ok) {
|
|
2726
2737
|
setRefusal(done.error);
|
|
@@ -5886,7 +5897,7 @@ function FormulaTextEditor({
|
|
|
5886
5897
|
value: text,
|
|
5887
5898
|
rows: 2,
|
|
5888
5899
|
"aria-label": "The formula",
|
|
5889
|
-
placeholder:
|
|
5900
|
+
placeholder: columns.length > 0 ? `{${fieldName(columns[0])}}` : "Write a formula",
|
|
5890
5901
|
className: "font-mono text-xs",
|
|
5891
5902
|
onChange: (e) => onText(e.target.value)
|
|
5892
5903
|
}
|
|
@@ -9413,7 +9424,7 @@ function FieldEditor(props) {
|
|
|
9413
9424
|
const statusGroupsSent = Object.fromEntries(shownStatusRows.filter((r) => !editing || r.ref in statusGroups || !(r.ref in statusKeys)).map((r) => [r.ref, r.group]));
|
|
9414
9425
|
const statusGroupsChanged = type === "status" && editing && Object.keys(statusGroupsSent).length > 0;
|
|
9415
9426
|
const formulaChanged = formulaText.trim() !== startingFormulaText.trim();
|
|
9416
|
-
const formulaMissing = type !== "formula" || !formulaWritten ? null : editing && !formulaChanged ? null : formulaText.trim() === "" ? "Write the formula
|
|
9427
|
+
const formulaMissing = type !== "formula" || !formulaWritten ? null : editing && !formulaChanged ? null : formulaText.trim() === "" ? "Write the formula" : formulaOk === false ? "The formula has a mistake \u2014 it is marked above." : formulaOk === null ? "Checking the formula\u2026" : null;
|
|
9417
9428
|
const noun = onEntity ? "field" : "column";
|
|
9418
9429
|
const nameTaken = columnNameTakenBy(label, others.map(fieldName));
|
|
9419
9430
|
const nameLine = nameTaken ? columnNameTakenLine(nameTaken, noun) : columnNameProblemLine(label, noun);
|
|
@@ -10019,7 +10030,7 @@ function FieldEditor(props) {
|
|
|
10019
10030
|
import_design_system33.Button,
|
|
10020
10031
|
{
|
|
10021
10032
|
size: "sm",
|
|
10022
|
-
disabled: mutation.saving || Boolean(formulaMissing),
|
|
10033
|
+
disabled: mutation.saving || Boolean(formulaMissing) || Boolean(nameLine) && label.trim() !== (field2?.label ?? "").trim(),
|
|
10023
10034
|
...missingShown ? { "aria-describedby": "field-editor-missing" } : {},
|
|
10024
10035
|
onClick: () => {
|
|
10025
10036
|
if (missing) {
|
|
@@ -24305,7 +24316,18 @@ function useGroupFacts(args) {
|
|
|
24305
24316
|
}, [client, tableId, groupKey, chosenKey, filterKey, version]);
|
|
24306
24317
|
return facts;
|
|
24307
24318
|
}
|
|
24319
|
+
function yesNoGroupWords(field2, value) {
|
|
24320
|
+
const answer = value === true || value === "true" ? true : value === false || value === "false" ? false : null;
|
|
24321
|
+
if (answer === null) return null;
|
|
24322
|
+
const name = (field2.label || field2.key).trim();
|
|
24323
|
+
return answer ? `\u2713 ${name}` : `\u2014 Not ${name.charAt(0).toLowerCase()}${name.slice(1)}`;
|
|
24324
|
+
}
|
|
24308
24325
|
function GroupLabel({ field: field2, value, withheld = null }) {
|
|
24326
|
+
if (field2 && editorKindFor(field2) === "checkbox") {
|
|
24327
|
+
if (groupValueKey(value) === "") return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "text-muted-foreground", "data-records-group-label": "", children: "Not answered" });
|
|
24328
|
+
const words2 = yesNoGroupWords(field2, value);
|
|
24329
|
+
if (words2) return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { "data-records-group-label": "", children: words2 });
|
|
24330
|
+
}
|
|
24309
24331
|
if (groupValueKey(value) === "" && !(field2 && withheld)) return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "text-muted-foreground", children: "No value" });
|
|
24310
24332
|
if (!field2) return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { children: String(value) });
|
|
24311
24333
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "inline-flex min-w-0 items-center", "data-records-group-label": "", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(RecordValue, { inCell: true, field: field2, value, format: formatForField(field2), withheld }) });
|
|
@@ -24339,11 +24361,16 @@ function groupFactsFor(facts, fields, chosen) {
|
|
|
24339
24361
|
return { count: fact.count, aggregates };
|
|
24340
24362
|
};
|
|
24341
24363
|
}
|
|
24342
|
-
function useGroupLabel(fields, groupKey) {
|
|
24364
|
+
function useGroupLabel(fields, groupKey, thenKeys = []) {
|
|
24365
|
+
const thenJoined = thenKeys.join("|");
|
|
24343
24366
|
return (0, import_react129.useMemo)(() => {
|
|
24344
|
-
const
|
|
24345
|
-
return (group) =>
|
|
24346
|
-
|
|
24367
|
+
const keys = groupKey ? [groupKey, ...thenJoined ? thenJoined.split("|") : []] : [];
|
|
24368
|
+
return (group) => {
|
|
24369
|
+
const key = keys[group.ancestors?.length ?? 0] ?? groupKey;
|
|
24370
|
+
const field2 = key ? fields.find((f) => f.key === key) : void 0;
|
|
24371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(GroupLabel, { field: field2, value: group.value, withheld: key ? groupWithheldNotice(group.rows, key, group.value) : null });
|
|
24372
|
+
};
|
|
24373
|
+
}, [fields, groupKey, thenJoined]);
|
|
24347
24374
|
}
|
|
24348
24375
|
|
|
24349
24376
|
// src/gridUndo.tsx
|
|
@@ -26089,7 +26116,7 @@ function GridBody({
|
|
|
26089
26116
|
const summaries = useColumnSummaries({ tableId, chosen: chosenSummaries, filter: readFilter, version: summaryVersion });
|
|
26090
26117
|
const drillConfig = useGridDrillConfig({ tableId, state: drillState, presentation, onPresentationChange, version: records.data });
|
|
26091
26118
|
const groupFacts = useGroupFacts({ tableId, groupKey: rowGroupKey, chosen: chosenSummaries, filter: readFilter, version: summaryVersion });
|
|
26092
|
-
const groupLabel2 = useGroupLabel(fields.data ?? [], rowGroupKey);
|
|
26119
|
+
const groupLabel2 = useGroupLabel(fields.data ?? [], rowGroupKey, (presentation.grouping?.then ?? []).map((t) => t.field));
|
|
26093
26120
|
const [duplicated, setDuplicated] = (0, import_react143.useState)(null);
|
|
26094
26121
|
const duplicate = (0, import_react143.useCallback)(
|
|
26095
26122
|
async (row) => {
|
|
@@ -27017,7 +27044,7 @@ function GridBody({
|
|
|
27017
27044
|
rowNoun: "record",
|
|
27018
27045
|
...thenKeys.length > 0 ? { thenColumnIds: thenKeys } : {},
|
|
27019
27046
|
...aggregates ? { aggregates } : {},
|
|
27020
|
-
...rowsGrouped ? { renderLabel:
|
|
27047
|
+
...rowsGrouped ? { renderLabel: groupLabel2, order: "first-seen", emptyLabel: "No value" } : {},
|
|
27021
27048
|
...facts ? { groupFacts: facts } : {},
|
|
27022
27049
|
...!rowsGrouped && view?.order ? { order: view.order } : {},
|
|
27023
27050
|
...view?.collapsed ? { collapsed: view.collapsed } : {},
|
|
@@ -35376,6 +35403,17 @@ function baselineSpan(start, end) {
|
|
|
35376
35403
|
if (!start) return null;
|
|
35377
35404
|
return { first: start, last: end && end >= start ? end : start };
|
|
35378
35405
|
}
|
|
35406
|
+
function taskListNeedsYear(days, currentYear) {
|
|
35407
|
+
const years = new Set(days.map((d) => Number(d.slice(0, 4))));
|
|
35408
|
+
return years.size > 1 || years.size === 1 && !years.has(currentYear);
|
|
35409
|
+
}
|
|
35410
|
+
function taskListDay(day2, withYear) {
|
|
35411
|
+
const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(day2);
|
|
35412
|
+
if (!m) return day2;
|
|
35413
|
+
const at = new Date(Number(m[1]), Number(m[2]) - 1, Number(m[3]));
|
|
35414
|
+
const short = at.toLocaleDateString(void 0, { month: "short", day: "numeric" });
|
|
35415
|
+
return withYear ? `${short} '${(m[1] ?? "").slice(2)}` : short;
|
|
35416
|
+
}
|
|
35379
35417
|
|
|
35380
35418
|
// src/TimelineView.tsx
|
|
35381
35419
|
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
@@ -35453,9 +35491,6 @@ function packRows(bars) {
|
|
|
35453
35491
|
return { ...bar, row };
|
|
35454
35492
|
});
|
|
35455
35493
|
}
|
|
35456
|
-
function shortDay(day2) {
|
|
35457
|
-
return dayAt(day2).toLocaleDateString(void 0, { month: "short", day: "numeric" });
|
|
35458
|
-
}
|
|
35459
35494
|
function windowStart(anchor, zoom, firstDay) {
|
|
35460
35495
|
const from = dayAt(addDays(anchor, -WINDOW[zoom].lead));
|
|
35461
35496
|
if (zoom === "day" || zoom === "week") from.setDate(from.getDate() - daysSinceWeekStart(from.getDay(), firstDay));
|
|
@@ -36294,6 +36329,11 @@ function TimelineView({
|
|
|
36294
36329
|
}) })
|
|
36295
36330
|
] })
|
|
36296
36331
|
) : null;
|
|
36332
|
+
const listYear = ganttOn && taskListNeedsYear(placed.flatMap((p) => {
|
|
36333
|
+
const at = shown5(p);
|
|
36334
|
+
return [at.first, at.last];
|
|
36335
|
+
}), Number(today.slice(0, 4)));
|
|
36336
|
+
const listDayW = listYear ? "w-[3.75rem]" : "w-12";
|
|
36297
36337
|
const LABEL_COLUMN = (0, import_design_system102.cn)("sticky left-0 z-30 shrink-0 border-r bg-background", ganttOn ? "w-64 sm:w-80" : "w-24 sm:w-36");
|
|
36298
36338
|
const todayLine = todayX !== null ? /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
36299
36339
|
"div",
|
|
@@ -36307,8 +36347,8 @@ function TimelineView({
|
|
|
36307
36347
|
const headerRow = (segments, className2, key) => /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex", "data-timeline-scale": key, children: [
|
|
36308
36348
|
hasLabel ? /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: (0, import_design_system102.cn)(LABEL_COLUMN, "border-b"), children: ganttOn && key === "bottom" ? /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex h-full items-center gap-1 px-1.5 text-[11px] text-muted-foreground", "data-timeline-list-head": "", children: [
|
|
36309
36349
|
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "min-w-0 flex-1 truncate", children: "Task" }),
|
|
36310
|
-
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "
|
|
36311
|
-
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "
|
|
36350
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: (0, import_design_system102.cn)(listDayW, "shrink-0"), children: "Start" }),
|
|
36351
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: (0, import_design_system102.cn)(listDayW, "shrink-0"), children: "End" }),
|
|
36312
36352
|
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "w-14 shrink-0 text-right", children: "Days" })
|
|
36313
36353
|
] }) : null }) : null,
|
|
36314
36354
|
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "relative shrink-0", style: { width, height: 22 }, children: [
|
|
@@ -36340,9 +36380,9 @@ function TimelineView({
|
|
|
36340
36380
|
const slip = slipDays(baselineOf(b.p.row)?.last ?? null, at.last);
|
|
36341
36381
|
return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { "data-timeline-list-row": b.p.row.id, className: "flex items-center gap-1 px-1.5 text-xs", style: { height: ROW_PX }, children: [
|
|
36342
36382
|
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("button", { type: "button", className: "min-w-0 flex-1 truncate text-left hover:underline", onClick: () => onOpenRecord?.(b.p.row.id), children: titleOf(b.p.row) }),
|
|
36343
|
-
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "
|
|
36344
|
-
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "
|
|
36345
|
-
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("span", { className: "w-14 shrink-0 text-right tabular-nums", title: slip !== null ? slipWords(slip) : void 0, children: [
|
|
36383
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: (0, import_design_system102.cn)(listDayW, "shrink-0 whitespace-nowrap tabular-nums text-muted-foreground"), children: taskListDay(at.first, listYear) }),
|
|
36384
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: (0, import_design_system102.cn)(listDayW, "shrink-0 whitespace-nowrap tabular-nums text-muted-foreground"), children: taskListDay(at.last, listYear) }),
|
|
36385
|
+
/* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("span", { className: "w-14 shrink-0 whitespace-nowrap text-right tabular-nums", title: slip !== null ? slipWords(slip) : void 0, children: [
|
|
36346
36386
|
daysBetween(at.first, at.last) + 1,
|
|
36347
36387
|
"d",
|
|
36348
36388
|
slip !== null && slip !== 0 ? /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: (0, import_design_system102.cn)("ml-1", slip > 0 ? "text-destructive" : "text-emerald-600"), children: slip > 0 ? `+${slip}` : slip }) : null
|
|
@@ -39532,7 +39572,7 @@ function useSeedGuard() {
|
|
|
39532
39572
|
var import_react233 = require("@ai-matrx/records/react");
|
|
39533
39573
|
|
|
39534
39574
|
// src/viewActions.ts
|
|
39535
|
-
var VIEW_LOCKED_REASON = "
|
|
39575
|
+
var VIEW_LOCKED_REASON = "Locked \xB7 ask an editor to unlock";
|
|
39536
39576
|
var NOOP3 = () => {
|
|
39537
39577
|
};
|
|
39538
39578
|
function viewActions(whyNot, host, locked = false, personal = false) {
|
|
@@ -39571,6 +39611,9 @@ function copyName(name, taken) {
|
|
|
39571
39611
|
if (!taken.includes(next)) return next;
|
|
39572
39612
|
}
|
|
39573
39613
|
}
|
|
39614
|
+
function viewActionReasons(actions) {
|
|
39615
|
+
return [...new Set(actions.flatMap((a) => a.disabledReason ? [a.disabledReason] : []))];
|
|
39616
|
+
}
|
|
39574
39617
|
|
|
39575
39618
|
// src/ViewBar.tsx
|
|
39576
39619
|
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
@@ -39604,6 +39647,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
39604
39647
|
const claimSeed = useSeedGuard();
|
|
39605
39648
|
const table = (0, import_react233.useTable)(tableId);
|
|
39606
39649
|
const rights = useTableRights(table.data);
|
|
39650
|
+
const tableThere = Boolean(table.data);
|
|
39607
39651
|
const notify = useRecordsUi().notify;
|
|
39608
39652
|
const [views, setViews] = (0, import_react231.useState)(() => initialViews ?? null);
|
|
39609
39653
|
const [error, setError] = (0, import_react231.useState)(null);
|
|
@@ -39683,7 +39727,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
39683
39727
|
}
|
|
39684
39728
|
setUnavailable(false);
|
|
39685
39729
|
const mine = result.data;
|
|
39686
|
-
const missing = (seed ?? []).filter((s) => !seedIsSatisfied(s, mine));
|
|
39730
|
+
const missing = tableThere ? (seed ?? []).filter((s) => !seedIsSatisfied(s, mine)) : [];
|
|
39687
39731
|
if (missing.length > 0) {
|
|
39688
39732
|
for (const spec of missing) {
|
|
39689
39733
|
if (!claimSeed(spec.name)) continue;
|
|
@@ -39708,7 +39752,7 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
39708
39752
|
setError(null);
|
|
39709
39753
|
setViews(mine);
|
|
39710
39754
|
onViews?.(mine);
|
|
39711
|
-
}, [client, readViews, tableId, seedKey]);
|
|
39755
|
+
}, [client, readViews, tableId, seedKey, tableThere]);
|
|
39712
39756
|
(0, import_react231.useEffect)(() => {
|
|
39713
39757
|
if (!readOnMount.current) {
|
|
39714
39758
|
readOnMount.current = true;
|
|
@@ -40032,29 +40076,35 @@ function ViewBar({ tableId, activeViewId, onActiveView, seed, settings, onViews,
|
|
|
40032
40076
|
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_design_system112.Button, { size: "sm", type: "submit", className: "h-7", children: "Save" })
|
|
40033
40077
|
]
|
|
40034
40078
|
}
|
|
40035
|
-
) :
|
|
40036
|
-
|
|
40037
|
-
|
|
40038
|
-
|
|
40039
|
-
|
|
40040
|
-
|
|
40041
|
-
|
|
40042
|
-
|
|
40043
|
-
|
|
40044
|
-
|
|
40045
|
-
|
|
40046
|
-
|
|
40047
|
-
|
|
40048
|
-
|
|
40049
|
-
|
|
40050
|
-
|
|
40051
|
-
|
|
40052
|
-
|
|
40053
|
-
|
|
40054
|
-
|
|
40055
|
-
|
|
40056
|
-
|
|
40057
|
-
|
|
40079
|
+
) : (() => {
|
|
40080
|
+
const actions = viewActions(rights.admin || current.personal ? null : rightsReason(rights, "structure") ?? ACTION_NO_ACCESS_REASON, {
|
|
40081
|
+
rename: () => setRenaming(current.name),
|
|
40082
|
+
duplicate: () => duplicate(current),
|
|
40083
|
+
archive: () => archive(current),
|
|
40084
|
+
...rights.admin ? { toggleLock: () => toggleLock(current) } : {},
|
|
40085
|
+
// Collaborative -> personal is the creator's or an editor's; personal -> collaborative is the creator's,
|
|
40086
|
+
// and a personal view is only ever listed to its creator.
|
|
40087
|
+
...rights.admin || current.personal ? { togglePersonal: () => togglePersonal(current) } : {},
|
|
40088
|
+
moveToSection: () => setMovingTo("")
|
|
40089
|
+
}, current.presentation?.locked === true, current.personal === true);
|
|
40090
|
+
const reasons = viewActionReasons(actions);
|
|
40091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_jsx_runtime131.Fragment, { children: [
|
|
40092
|
+
reasons.map((reason) => /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("p", { className: "truncate px-2 py-1 text-xs text-muted-foreground", "data-view-actions-reason": "", title: reason, children: reason }, reason)),
|
|
40093
|
+
actions.map((action3) => /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
40094
|
+
import_controls2.Tile,
|
|
40095
|
+
{
|
|
40096
|
+
variant: "quiet",
|
|
40097
|
+
...action3.destructive ? { danger: true } : {},
|
|
40098
|
+
disabled: action3.disabledReason !== void 0,
|
|
40099
|
+
"data-view-action": action3.id,
|
|
40100
|
+
onClick: () => void action3.run(),
|
|
40101
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(ObjectActionGlyph, { name: action3.icon, className: "h-3.5 w-3.5 shrink-0" }),
|
|
40102
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { title: action3.disabledReason, children: action3.label })
|
|
40103
|
+
},
|
|
40104
|
+
action3.id
|
|
40105
|
+
))
|
|
40106
|
+
] });
|
|
40107
|
+
})() }) : null,
|
|
40058
40108
|
settings ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "mt-1 border-t border-border pt-1", "data-view-settings": "", children: settings }) : null
|
|
40059
40109
|
] })
|
|
40060
40110
|
] });
|