@ai-matrx/records-ui 0.113.16 → 0.113.18
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 +12 -0
- package/dist/index.cjs +151 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +723 -603
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +109 -14
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +149 -54
- package/dist/pickers.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog — @ai-matrx/records-ui
|
|
2
2
|
|
|
3
|
+
## 0.113.18
|
|
4
|
+
|
|
5
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
6
|
+
`git diff npm/records-ui/v0.113.17..npm/records-ui/v0.113.18 -- apps/shared/records-ui`).
|
|
7
|
+
No source changes intended and no consumer action required.
|
|
8
|
+
|
|
9
|
+
## 0.113.17
|
|
10
|
+
|
|
11
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
12
|
+
`git diff npm/records-ui/v0.113.16..npm/records-ui/v0.113.17 -- apps/shared/records-ui`).
|
|
13
|
+
No source changes intended and no consumer action required.
|
|
14
|
+
|
|
3
15
|
## 0.113.16
|
|
4
16
|
|
|
5
17
|
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
package/dist/index.cjs
CHANGED
|
@@ -7931,7 +7931,8 @@ function cardWords(record, field2, labels) {
|
|
|
7931
7931
|
if (notice && (value === null || value === void 0)) {
|
|
7932
7932
|
return { text: WITHHELD_WORD, withheld: withheldSentence(field2, notice) };
|
|
7933
7933
|
}
|
|
7934
|
-
|
|
7934
|
+
const empty = value === null || value === void 0 || typeof value === "string" && value.trim() === "";
|
|
7935
|
+
return { text: empty ? "Untitled" : scalarText(field2, value, labels), withheld: null };
|
|
7935
7936
|
}
|
|
7936
7937
|
|
|
7937
7938
|
// src/SourceArchivedNotice.tsx
|
|
@@ -9296,13 +9297,16 @@ function ButtonSettingsEditor({
|
|
|
9296
9297
|
}) {
|
|
9297
9298
|
const client = (0, import_react49.useOptionalRecordsClient)();
|
|
9298
9299
|
const [actions, setActions] = (0, import_react48.useState)(null);
|
|
9300
|
+
const [actionsRefused, setActionsRefused] = (0, import_react48.useState)(null);
|
|
9299
9301
|
const [automations, setAutomations] = (0, import_react48.useState)(null);
|
|
9300
9302
|
(0, import_react48.useEffect)(() => {
|
|
9301
9303
|
if (!client || !tableId) return;
|
|
9302
9304
|
let live = true;
|
|
9303
9305
|
if (value.do === "run_action" && actions === null) {
|
|
9304
9306
|
void client.rowActions({ table_id: tableId }).then((got) => {
|
|
9305
|
-
if (live)
|
|
9307
|
+
if (!live) return;
|
|
9308
|
+
if (!got.ok) return setActionsRefused(got.error);
|
|
9309
|
+
setActions((got.data?.actions ?? []).filter((a) => a.id));
|
|
9306
9310
|
});
|
|
9307
9311
|
}
|
|
9308
9312
|
if (value.do === "run_automation" && automations === null) {
|
|
@@ -9376,16 +9380,32 @@ function ButtonSettingsEditor({
|
|
|
9376
9380
|
] }),
|
|
9377
9381
|
value.url && (0, import_records25.buttonUrlPlaceholders)(value.url).length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "truncate text-[11px] text-muted-foreground", "data-records-button-url-words": "", children: buttonUrlInWords(value.url, fields) }) : null
|
|
9378
9382
|
] }) : null,
|
|
9379
|
-
value.do === "run_action" ?
|
|
9380
|
-
|
|
9381
|
-
|
|
9382
|
-
|
|
9383
|
-
|
|
9384
|
-
|
|
9385
|
-
|
|
9386
|
-
|
|
9387
|
-
|
|
9388
|
-
|
|
9383
|
+
value.do === "run_action" ? !tableId ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-xs text-muted-foreground", children: "Row actions belong to a table" }) : actionsRefused ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(RefusalLine, { error: actionsRefused }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col gap-2", "data-records-button-action": "", children: [
|
|
9384
|
+
actions === null || actions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9385
|
+
PickOne,
|
|
9386
|
+
{
|
|
9387
|
+
label: "Row action",
|
|
9388
|
+
value: value.action_id ?? "",
|
|
9389
|
+
placeholder: actions ? "Choose a row action" : "Reading row actions\u2026",
|
|
9390
|
+
attrs: { "data-records-button-action-pick": "" },
|
|
9391
|
+
onChange: (id) => set({ action_id: id }),
|
|
9392
|
+
options: (actions ?? []).map((a) => ({ value: a.id, label: a.name }))
|
|
9393
|
+
}
|
|
9394
|
+
) : null,
|
|
9395
|
+
actions !== null ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9396
|
+
NewRowAction,
|
|
9397
|
+
{
|
|
9398
|
+
tableId,
|
|
9399
|
+
label: value.label,
|
|
9400
|
+
actions,
|
|
9401
|
+
columns,
|
|
9402
|
+
onMade: (made, all) => {
|
|
9403
|
+
setActions(all);
|
|
9404
|
+
set({ action_id: made });
|
|
9405
|
+
}
|
|
9406
|
+
}
|
|
9407
|
+
) : null
|
|
9408
|
+
] }) : null,
|
|
9389
9409
|
value.do === "run_automation" ? automations && automations.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-xs text-muted-foreground", children: "No automations yet. Add one in Table settings." }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9390
9410
|
PickOne,
|
|
9391
9411
|
{
|
|
@@ -9398,6 +9418,70 @@ function ButtonSettingsEditor({
|
|
|
9398
9418
|
) : null
|
|
9399
9419
|
] });
|
|
9400
9420
|
}
|
|
9421
|
+
function settableColumns(columns) {
|
|
9422
|
+
return columns.filter((f) => {
|
|
9423
|
+
const kind = editorKindFor(f);
|
|
9424
|
+
return f.type !== "formula" && kind !== "formula" && kind !== "lookup" && kind !== "rollup" && !(f.type === "text" && f.format === "button");
|
|
9425
|
+
});
|
|
9426
|
+
}
|
|
9427
|
+
function NewRowAction({
|
|
9428
|
+
tableId,
|
|
9429
|
+
label,
|
|
9430
|
+
actions,
|
|
9431
|
+
columns,
|
|
9432
|
+
onMade
|
|
9433
|
+
}) {
|
|
9434
|
+
const client = (0, import_react49.useOptionalRecordsClient)();
|
|
9435
|
+
const settable2 = settableColumns(columns);
|
|
9436
|
+
const [fieldId, setFieldId] = (0, import_react48.useState)("");
|
|
9437
|
+
const [setTo, setSetTo] = (0, import_react48.useState)("");
|
|
9438
|
+
const [busy, setBusy] = (0, import_react48.useState)(false);
|
|
9439
|
+
const [refused, setRefused] = (0, import_react48.useState)(null);
|
|
9440
|
+
if (settable2.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-xs text-muted-foreground", children: "No column to set" });
|
|
9441
|
+
const make = async () => {
|
|
9442
|
+
if (!client || fieldId === "") return;
|
|
9443
|
+
setBusy(true);
|
|
9444
|
+
setRefused(null);
|
|
9445
|
+
const name = label.trim() || "Set fields";
|
|
9446
|
+
const kept = actions.map((a) => ({ ...a.id ? { id: a.id } : {}, name: a.name, kind: a.kind ?? "update", ...a.color !== void 0 ? { color: a.color } : {}, ...a.icon ? { icon: a.icon } : {}, ...a.confirm !== void 0 ? { confirm: a.confirm } : {}, ...a.steps ? { steps: a.steps } : {}, ...a.prompt ? { prompt: a.prompt } : {} }));
|
|
9447
|
+
const declared2 = await client.actionDeclare({
|
|
9448
|
+
table_id: tableId,
|
|
9449
|
+
actions: [...kept, { name, kind: "update", confirm: false, steps: [setTo === "" ? { field: fieldId, set: "clear" } : { field: fieldId, set: "value", value: setTo }] }]
|
|
9450
|
+
});
|
|
9451
|
+
if (!declared2.ok) {
|
|
9452
|
+
setBusy(false);
|
|
9453
|
+
return setRefused(declared2.error);
|
|
9454
|
+
}
|
|
9455
|
+
const reread = await client.rowActions({ table_id: tableId });
|
|
9456
|
+
setBusy(false);
|
|
9457
|
+
if (!reread.ok) return setRefused(reread.error);
|
|
9458
|
+
const all = (reread.data?.actions ?? []).filter((a) => a.id);
|
|
9459
|
+
const before = new Set(actions.map((a) => a.id));
|
|
9460
|
+
const made = all.find((a) => !before.has(a.id) && a.name === name) ?? all.find((a) => !before.has(a.id));
|
|
9461
|
+
if (!made?.id) return setRefused({ code: "internal", message: "The row action was saved but could not be read back.", hint: "Reopen this column's settings and pick it from the list." });
|
|
9462
|
+
onMade(made.id, all);
|
|
9463
|
+
};
|
|
9464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col gap-1", "data-records-button-new-action": "", children: [
|
|
9465
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system30.Label, { className: "text-xs", children: "New row action" }),
|
|
9466
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
9467
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
9468
|
+
PickOne,
|
|
9469
|
+
{
|
|
9470
|
+
label: "Column to set",
|
|
9471
|
+
className: "h-8 w-40 text-xs",
|
|
9472
|
+
value: fieldId,
|
|
9473
|
+
placeholder: "Column",
|
|
9474
|
+
attrs: { "data-records-button-action-field": "" },
|
|
9475
|
+
onChange: setFieldId,
|
|
9476
|
+
options: settable2.map((f) => ({ value: f.id, label: fieldName(f) }))
|
|
9477
|
+
}
|
|
9478
|
+
),
|
|
9479
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system30.BasicInput, { className: "h-8 w-32 text-xs", placeholder: "Value", "aria-label": "Value", "data-records-button-action-value": "", value: setTo, onChange: (e) => setSetTo(e.target.value) }),
|
|
9480
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_design_system30.Button, { type: "button", size: "sm", variant: "outline", disabled: busy || fieldId === "", "data-records-button-action-make": "", onClick: () => void make(), children: busy ? "Making\u2026" : "Make" })
|
|
9481
|
+
] }),
|
|
9482
|
+
refused ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(RefusalLine, { error: refused }) : null
|
|
9483
|
+
] });
|
|
9484
|
+
}
|
|
9401
9485
|
|
|
9402
9486
|
// src/FieldEditor.tsx
|
|
9403
9487
|
var import_records27 = require("@ai-matrx/records");
|
|
@@ -9655,9 +9739,10 @@ function FieldEditor(props) {
|
|
|
9655
9739
|
const noun = onEntity ? "field" : "column";
|
|
9656
9740
|
const nameTaken = columnNameTakenBy(label, others.map(fieldName));
|
|
9657
9741
|
const listsChoices = type === "select" || type === "multi_select" || type === "status";
|
|
9658
|
-
const
|
|
9742
|
+
const buttonMissing = type === "button" && buttonSettings.do ? (0, import_records26.buttonNeeds)(buttonSettings) : null;
|
|
9743
|
+
const missing = buttonMissing ?? (editing ? formulaMissing ?? (listsChoices ? whatTheChoiceListIsMissing(choiceList) : null) : formulaMissing ?? (listsChoices ? whatTheChoiceListIsMissing(newChoices) : null) ?? (type === "formula" && formulaWritten ? null : whatIsMissing(
|
|
9659
9744
|
type === "count" ? { type: "rollup", label, options, via, pick, agg: "count", of, relations: totalSources, formulaFields, relationTarget, allowedTypes, noun } : { type, label, options, via, pick, agg, of, relations: sourcesFor(type), formulaFields, relationTarget, allowedTypes, noun }
|
|
9660
|
-
));
|
|
9745
|
+
)));
|
|
9661
9746
|
const missingShown = missing && (attempted || formulaMissing) ? missing : null;
|
|
9662
9747
|
const removeConsequence = field2 ? `${archiveConfirmSentence(`the field \u201C${fieldName(field2)}\u201D`)} Its values stay in every record and come back with it.${linkReaders.length > 0 ? ` ${readersSentence(linkReaders.length, farTable.data?.name ?? null)}` : ""}` : "";
|
|
9663
9748
|
const save = async () => {
|
|
@@ -9808,6 +9893,13 @@ function FieldEditor(props) {
|
|
|
9808
9893
|
}
|
|
9809
9894
|
}
|
|
9810
9895
|
setBackfillError(null);
|
|
9896
|
+
if (type === "relation" && relationTarget === tableId && dependency && !onEntity) {
|
|
9897
|
+
const marked = await client.fieldUpdate({ field_id: written, patch: { dependency: true } });
|
|
9898
|
+
if (!marked.ok) {
|
|
9899
|
+
setBackfillError(marked.error);
|
|
9900
|
+
return;
|
|
9901
|
+
}
|
|
9902
|
+
}
|
|
9811
9903
|
if (type === "relation" && showOnOther && otherTable.data && otherTable.data.id !== tableId) {
|
|
9812
9904
|
const made = await client.relationReverseField({ field_id: written });
|
|
9813
9905
|
if (!made.ok) {
|
|
@@ -9982,7 +10074,7 @@ function FieldEditor(props) {
|
|
|
9982
10074
|
onChange: setRollupFilter
|
|
9983
10075
|
}
|
|
9984
10076
|
) : null,
|
|
9985
|
-
editing && field2 && !(type === "select" || type === "multi_select" || type === "status") ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FieldFormatPicker, { field: field2, value: showsAs, onValue: setShowsAs }) : null,
|
|
10077
|
+
editing && field2 && !(type === "select" || type === "multi_select" || type === "status" || type === "autonumber") ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FieldFormatPicker, { field: field2, value: showsAs, onValue: setShowsAs }) : null,
|
|
9986
10078
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-wrap items-center gap-4", children: [
|
|
9987
10079
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
9988
10080
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
@@ -10030,6 +10122,10 @@ function FieldEditor(props) {
|
|
|
10030
10122
|
"Show on ",
|
|
10031
10123
|
otherTable.data.name ?? "the other table"
|
|
10032
10124
|
] }) : null,
|
|
10125
|
+
!field2 && type === "relation" && relationTarget === tableId ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("label", { className: "flex items-center gap-1.5", title: "A timeline draws a line to each record this one waits on", children: [
|
|
10126
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_design_system31.Checkbox, { checked: dependency, "aria-label": "Waits on the linked records", "data-records-dependency": "", onCheckedChange: (v) => setDependency(v === true) }),
|
|
10127
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { children: "Waits on the linked records" })
|
|
10128
|
+
] }) : null,
|
|
10033
10129
|
!field2 && type === "relation" && relationTarget === tableId ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("label", { className: "flex items-center gap-1.5", children: [
|
|
10034
10130
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
10035
10131
|
import_design_system31.Checkbox,
|
|
@@ -19202,6 +19298,10 @@ function columnForField(field2, editing, mayWriteRow, whyNotRow, look, onAskWhoC
|
|
|
19202
19298
|
),
|
|
19203
19299
|
name
|
|
19204
19300
|
] })
|
|
19301
|
+
) : workedOut && stampMarkOf(field2) ? (
|
|
19302
|
+
// A STAMP OR A RECORD NUMBER (walk 2026-10-08 D7): kept by the store, but nobody wrote a formula
|
|
19303
|
+
// for it, so its header wears its own mark — a clock, a person, a number sign — never "fx".
|
|
19304
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "inline-flex items-center", title: workedOut, "data-records-stamp": stampMarkOf(field2), children: withTypeMark(field2, name) })
|
|
19205
19305
|
) : workedOut ? /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "inline-flex items-center gap-1", children: [
|
|
19206
19306
|
name,
|
|
19207
19307
|
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
@@ -19316,10 +19416,16 @@ var TYPE_ICON = {
|
|
|
19316
19416
|
var CLOCK = [["circle", { cx: 12, cy: 12, r: 10 }], ["path", { d: "M12 6v6l4 2" }]];
|
|
19317
19417
|
var PERSON_PLUS = [["path", { d: "M2 21a8 8 0 0 1 13.292-6" }], ["circle", { cx: 10, cy: 8, r: 5 }], ["path", { d: "M19 16v6" }], ["path", { d: "M22 19h-6" }]];
|
|
19318
19418
|
var PERSON_PEN = [["path", { d: "M11.5 15H7a4 4 0 0 0-4 4v2" }], ["path", { d: "M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z" }], ["circle", { cx: 10, cy: 7, r: 4 }]];
|
|
19319
|
-
var
|
|
19320
|
-
|
|
19419
|
+
var HASH = [["path", { d: "M4 9h16" }], ["path", { d: "M4 15h16" }], ["path", { d: "M10 3 8 21" }], ["path", { d: "M16 3l-2 18" }]];
|
|
19420
|
+
var STAMP_ICON = { created_time: CLOCK, modified_time: CLOCK, created_by: PERSON_PLUS, modified_by: PERSON_PEN, autonumber: HASH };
|
|
19421
|
+
function stampMarkOf(field2) {
|
|
19321
19422
|
const picked = pickableTypeOf(field2);
|
|
19322
|
-
|
|
19423
|
+
if (picked !== void 0 && picked in STAMP_ICON) return picked;
|
|
19424
|
+
const system = field2.config?.["system"];
|
|
19425
|
+
return typeof system === "string" && system in STAMP_ICON ? system : void 0;
|
|
19426
|
+
}
|
|
19427
|
+
function withTypeMark(field2, header) {
|
|
19428
|
+
const stamp = stampMarkOf(field2);
|
|
19323
19429
|
const kind = stamp ?? editorKindFor(field2);
|
|
19324
19430
|
const parts = (stamp ? STAMP_ICON[stamp] : TYPE_ICON[editorKindFor(field2)]) ?? TYPE_ICON.text;
|
|
19325
19431
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "inline-flex min-w-0 items-center gap-1.5", "data-records-type-mark": kind, children: [
|
|
@@ -34935,7 +35041,8 @@ function Board({
|
|
|
34935
35041
|
onMoved?.();
|
|
34936
35042
|
},
|
|
34937
35043
|
note: records.membership,
|
|
34938
|
-
style
|
|
35044
|
+
style,
|
|
35045
|
+
parentField: subItemsField(all, view.subject)
|
|
34939
35046
|
}
|
|
34940
35047
|
),
|
|
34941
35048
|
pager,
|
|
@@ -35192,7 +35299,8 @@ function Kanban({
|
|
|
35192
35299
|
note,
|
|
35193
35300
|
style,
|
|
35194
35301
|
cardFields,
|
|
35195
|
-
canAdd = false
|
|
35302
|
+
canAdd = false,
|
|
35303
|
+
parentField
|
|
35196
35304
|
}) {
|
|
35197
35305
|
const groupFields = (0, import_react196.useMemo)(() => [groupField], [groupField]);
|
|
35198
35306
|
const labels = useRecordLabels(groupFields);
|
|
@@ -35348,7 +35456,7 @@ function Kanban({
|
|
|
35348
35456
|
name: cardWords(card, titleField).text,
|
|
35349
35457
|
onOpenRecord,
|
|
35350
35458
|
onChanged,
|
|
35351
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(RecordCard, { record: card, field: titleField, onOpenRecord, style, dates: dateFields, fields: cardFields })
|
|
35459
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(RecordCard, { record: card, field: titleField, onOpenRecord, style, dates: dateFields, fields: cardFields, parentField })
|
|
35352
35460
|
}
|
|
35353
35461
|
),
|
|
35354
35462
|
moves.refused?.recordId === card.id ? /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(MoveRefusedBadge, { refused: moves.refused }) : null
|
|
@@ -35522,30 +35630,42 @@ function RecordCard({
|
|
|
35522
35630
|
onOpenRecord,
|
|
35523
35631
|
style,
|
|
35524
35632
|
dates,
|
|
35525
|
-
fields
|
|
35633
|
+
fields,
|
|
35634
|
+
parentField
|
|
35526
35635
|
}) {
|
|
35527
35636
|
const host = useRecordsUi();
|
|
35528
|
-
const wanted = (0, import_react196.useMemo)(
|
|
35529
|
-
|
|
35530
|
-
|
|
35531
|
-
);
|
|
35637
|
+
const wanted = (0, import_react196.useMemo)(() => {
|
|
35638
|
+
const asked3 = [field2 && pointsAtRecords(field2) ? field2 : null, parentField ?? null].filter((f) => f !== null);
|
|
35639
|
+
return asked3.length > 0 ? asked3 : NO_FIELDS2;
|
|
35640
|
+
}, [field2, parentField]);
|
|
35532
35641
|
const labels = useRecordLabels(wanted);
|
|
35533
35642
|
const { text: label, withheld } = cardWords(record, field2, labels);
|
|
35643
|
+
const parentId = parentField ? parentIdOf(record.document, parentField.key) : null;
|
|
35644
|
+
const parentName = parentField && parentId ? scalarText(parentField, parentId, labels) : null;
|
|
35645
|
+
const open = () => onOpenRecord?.(record.id);
|
|
35534
35646
|
const color = style ? (0, import_data_table24.resolveRowColor)(style, { id: record.id, data: record.document ?? {} }, colorFromTheValue) : null;
|
|
35535
35647
|
return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
35536
|
-
"
|
|
35648
|
+
"div",
|
|
35537
35649
|
{
|
|
35538
|
-
|
|
35650
|
+
role: "button",
|
|
35651
|
+
tabIndex: 0,
|
|
35652
|
+
"data-records-card": record.id,
|
|
35539
35653
|
className: (0, import_design_system97.cn)(
|
|
35540
|
-
"w-full truncate rounded border bg-background px-2 py-1 text-left text-xs hover:bg-muted",
|
|
35654
|
+
"w-full cursor-pointer truncate rounded border bg-background px-2 py-1 text-left text-xs hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
35541
35655
|
host.density === "spacious" ? "py-2" : "",
|
|
35542
35656
|
color ? import_data_table24.ROW_TINT_CLASS[color] : void 0
|
|
35543
35657
|
),
|
|
35544
|
-
onClick:
|
|
35658
|
+
onClick: open,
|
|
35659
|
+
onKeyDown: (e) => {
|
|
35660
|
+
if (e.target !== e.currentTarget || e.key !== "Enter" && e.key !== " ") return;
|
|
35661
|
+
e.preventDefault();
|
|
35662
|
+
open();
|
|
35663
|
+
},
|
|
35545
35664
|
title: withheld ?? label,
|
|
35546
35665
|
...withheld && field2 ? { "data-records-withheld": field2.key } : {},
|
|
35547
|
-
children: dates && dates.length > 0 || fields && fields.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(import_jsx_runtime114.Fragment, { children: [
|
|
35666
|
+
children: dates && dates.length > 0 || fields && fields.length > 0 || parentName ? /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(import_jsx_runtime114.Fragment, { children: [
|
|
35548
35667
|
/* @__PURE__ */ (0, import_jsx_runtime114.jsx)("span", { className: "block truncate", children: label }),
|
|
35668
|
+
parentName ? /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("span", { className: "block truncate text-muted-foreground", "data-records-card-parent": parentId ?? "", children: `Sub-item of ${parentName}` }) : null,
|
|
35549
35669
|
dates && dates.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(CardDates, { record, fields: dates }) : null,
|
|
35550
35670
|
(fields ?? []).filter((f) => (0, import_records56.isButtonField)(f) || !isEmptyOnCard((record.document ?? {})[f.key]) || withheldNoticeOf(record.hidden, f.key)).map((f) => /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("span", { className: "block truncate text-muted-foreground", "data-records-card-value": f.key, children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
|
|
35551
35671
|
RecordValue,
|