@ai-matrx/records-ui 0.116.119 → 0.116.121
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 +10 -2
- package/dist/{chunk-ESOQXQAE.js → chunk-7J7AUZ25.js} +2 -2
- package/dist/chunk-7J7AUZ25.js.map +1 -0
- package/dist/{chunk-ZFNJTEIB.js → chunk-U2B3TLDZ.js} +19 -1
- package/dist/{chunk-ZFNJTEIB.js.map → chunk-U2B3TLDZ.js.map} +1 -1
- package/dist/entity-doors.cjs.map +1 -1
- package/dist/entity-doors.d.cts +1 -1
- package/dist/entity-doors.d.ts +1 -1
- package/dist/entity-doors.js.map +1 -1
- package/dist/entity-ref.cjs.map +1 -1
- package/dist/entity-ref.d.cts +1 -1
- package/dist/entity-ref.d.ts +1 -1
- package/dist/entity-ref.js.map +1 -1
- package/dist/index.cjs +106 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist/list-dimensions.cjs +267 -0
- package/dist/list-dimensions.cjs.map +1 -0
- package/dist/list-dimensions.d.cts +56 -0
- package/dist/list-dimensions.d.ts +56 -0
- package/dist/list-dimensions.js +248 -0
- package/dist/list-dimensions.js.map +1 -0
- package/dist/pickers.cjs +18 -0
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +1 -1
- package/dist/skeleton.cjs +2 -2
- package/dist/skeleton.cjs.map +1 -1
- package/dist/skeleton.js +1 -1
- package/package.json +53 -2
- package/dist/chunk-ESOQXQAE.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -18227,6 +18227,24 @@ function FieldFormatPicker({
|
|
|
18227
18227
|
}
|
|
18228
18228
|
)
|
|
18229
18229
|
),
|
|
18230
|
+
option(
|
|
18231
|
+
"durationStyle",
|
|
18232
|
+
"Shown as",
|
|
18233
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
18234
|
+
PickOne,
|
|
18235
|
+
{
|
|
18236
|
+
label: "Shown as",
|
|
18237
|
+
attrs: { "data-records-format-option": "durationStyle" },
|
|
18238
|
+
className: SELECT,
|
|
18239
|
+
value: options.durationStyle ?? "clock",
|
|
18240
|
+
onChange: (picked) => setOption("durationStyle", picked),
|
|
18241
|
+
options: [
|
|
18242
|
+
{ value: "clock", label: "Clock (1:30:00)" },
|
|
18243
|
+
{ value: "readable", label: "Words (1 hr 30 min)" }
|
|
18244
|
+
]
|
|
18245
|
+
}
|
|
18246
|
+
)
|
|
18247
|
+
),
|
|
18230
18248
|
option(
|
|
18231
18249
|
"precision",
|
|
18232
18250
|
"Decimals",
|
|
@@ -23624,9 +23642,9 @@ function TableDetails({
|
|
|
23624
23642
|
(0, import_react108.tableShapeChanged)(tableId);
|
|
23625
23643
|
onSaved?.();
|
|
23626
23644
|
};
|
|
23627
|
-
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex flex-col gap-2", "data-table-details": "", children: [
|
|
23645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex flex-col gap-2", "data-table-details": "", "data-surface-value": "table_details_draft", children: [
|
|
23628
23646
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "font-medium", children: "About this table" }),
|
|
23629
|
-
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
23647
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex flex-col gap-1", "data-surface-value": "table_description", children: [
|
|
23630
23648
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("label", { className: "text-muted-foreground", htmlFor: `table-description-${tableId}`, children: "Description" }),
|
|
23631
23649
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
23632
23650
|
import_design_system66.Textarea,
|
|
@@ -25297,7 +25315,7 @@ function rememberLayout(tableId, layout) {
|
|
|
25297
25315
|
var import_react114 = require("react");
|
|
25298
25316
|
var import_cn2 = require("@ai-matrx/design-system/cn");
|
|
25299
25317
|
var import_skeleton = require("@ai-matrx/design-system/skeleton");
|
|
25300
|
-
var
|
|
25318
|
+
var import_lazy = require("@ai-matrx/design-system/data-table/lazy");
|
|
25301
25319
|
|
|
25302
25320
|
// src/skeletonLayout.ts
|
|
25303
25321
|
var RECORDS_SKELETON_LAYOUTS = [
|
|
@@ -25376,7 +25394,7 @@ var PLACEHOLDER_COLUMNS = ["a", "b", "c", "d", "e", "f"].map((id) => ({
|
|
|
25376
25394
|
var NO_ROWS2 = [];
|
|
25377
25395
|
function GridSkeleton({ embedded, rows }) {
|
|
25378
25396
|
const table = /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
25379
|
-
|
|
25397
|
+
import_lazy.MatrxDataTable,
|
|
25380
25398
|
{
|
|
25381
25399
|
...embedded ? {} : { className: "min-h-0 flex-1" },
|
|
25382
25400
|
data: NO_ROWS2,
|
|
@@ -25551,7 +25569,7 @@ var import_react197 = require("react");
|
|
|
25551
25569
|
var import_react198 = require("@ai-matrx/records/react");
|
|
25552
25570
|
var import_records51 = require("@ai-matrx/records");
|
|
25553
25571
|
var import_records52 = require("@ai-matrx/records");
|
|
25554
|
-
var
|
|
25572
|
+
var import_data_table13 = require("@ai-matrx/design-system/data-table");
|
|
25555
25573
|
var import_core21 = require("@ai-matrx/records/core");
|
|
25556
25574
|
|
|
25557
25575
|
// src/tableDecorations.ts
|
|
@@ -25728,7 +25746,7 @@ var import_core17 = require("@ai-matrx/records/core");
|
|
|
25728
25746
|
var import_react158 = require("react");
|
|
25729
25747
|
var import_react159 = require("@ai-matrx/records/react");
|
|
25730
25748
|
var import_design_system87 = require("@ai-matrx/design-system");
|
|
25731
|
-
var
|
|
25749
|
+
var import_data_table9 = require("@ai-matrx/design-system/data-table");
|
|
25732
25750
|
var import_format9 = require("@ai-matrx/kit/format");
|
|
25733
25751
|
|
|
25734
25752
|
// src/pointsCost.ts
|
|
@@ -29001,7 +29019,7 @@ function ActionForm({
|
|
|
29001
29019
|
const first = settable2.find((f) => doc[f.key] !== null && doc[f.key] !== void 0 && doc[f.key] !== "");
|
|
29002
29020
|
return first ? shown2(doc[first.key]) : row.id;
|
|
29003
29021
|
};
|
|
29004
|
-
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: (0, import_design_system81.cn)("flex flex-col gap-3 text-xs", className), "data-records-action-form": "", children: [
|
|
29022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: (0, import_design_system81.cn)("flex flex-col gap-3 text-xs", className), "data-records-action-form": "", "data-surface-value": "editing_row_action", children: [
|
|
29005
29023
|
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { className: "font-medium", children: original ? `Row action \xB7 ${original.name}` : "New row action" }),
|
|
29006
29024
|
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("label", { className: "flex flex-col gap-1", children: [
|
|
29007
29025
|
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_design_system81.Label, { className: "text-xs", children: "Name" }),
|
|
@@ -29086,7 +29104,7 @@ function ActionForm({
|
|
|
29086
29104
|
] }) : null
|
|
29087
29105
|
] }),
|
|
29088
29106
|
draft.steps.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("p", { className: "text-muted-foreground", children: "Nothing yet. Add a change, or start from a record and remove the columns it should leave alone." }) : null,
|
|
29089
|
-
draft.steps.map((step2, index) => /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex flex-wrap items-center gap-1", "data-records-action-step": index, children: [
|
|
29107
|
+
draft.steps.map((step2, index) => /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex flex-wrap items-center gap-1", "data-records-action-step": index, "data-surface-value": "row_action_step_formula", children: [
|
|
29090
29108
|
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_design_system81.Select, { value: step2.field, onValueChange: (v) => setStep(index, { field: v }), children: [
|
|
29091
29109
|
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_design_system81.SelectTrigger, { size: "sm", "aria-label": `Column for change ${index + 1}`, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_design_system81.SelectValue, { placeholder: "Column" }) }),
|
|
29092
29110
|
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_design_system81.SelectContent, { children: settable2.map((f) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_design_system81.SelectItem, { value: f.id, children: fieldName(f) }, f.id)) })
|
|
@@ -30563,7 +30581,7 @@ function useMergedGridControls(args) {
|
|
|
30563
30581
|
const row = rows.find((r) => r.id === rowId);
|
|
30564
30582
|
if (!row) return null;
|
|
30565
30583
|
const doc = row.document ?? {};
|
|
30566
|
-
return (0,
|
|
30584
|
+
return (0, import_data_table9.gridToTsv)([order.filter((k) => !hidden.includes(k)).map((k) => doc[k])]);
|
|
30567
30585
|
},
|
|
30568
30586
|
[rows, order, hidden]
|
|
30569
30587
|
);
|
|
@@ -31142,14 +31160,14 @@ function NewRecordControl({
|
|
|
31142
31160
|
var import_react164 = require("react");
|
|
31143
31161
|
var import_react165 = require("@ai-matrx/records/react");
|
|
31144
31162
|
var import_records45 = require("@ai-matrx/records");
|
|
31145
|
-
var
|
|
31163
|
+
var import_data_table11 = require("@ai-matrx/design-system/data-table");
|
|
31146
31164
|
init_parity();
|
|
31147
31165
|
init_plainWords();
|
|
31148
31166
|
|
|
31149
31167
|
// src/drillLevel.ts
|
|
31150
31168
|
var import_react162 = require("react");
|
|
31151
31169
|
var import_react163 = require("@ai-matrx/records/react");
|
|
31152
|
-
var
|
|
31170
|
+
var import_data_table10 = require("@ai-matrx/design-system/data-table");
|
|
31153
31171
|
init_plainWords();
|
|
31154
31172
|
var askId = (ask2) => `${ask2.outer ?? ""}|${ask2.fact}`;
|
|
31155
31173
|
function valueOf(v) {
|
|
@@ -31158,11 +31176,11 @@ function valueOf(v) {
|
|
|
31158
31176
|
function drillLevelAsks(args) {
|
|
31159
31177
|
const { question, dimensions, answers: answers2, where } = args;
|
|
31160
31178
|
const known = (k) => dimensions.some((d) => d.key === k);
|
|
31161
|
-
const dim = (ref) => dimensions.find((d) => d.key === (0,
|
|
31179
|
+
const dim = (ref) => dimensions.find((d) => d.key === (0, import_data_table10.parseDimensionRef)(ref).key);
|
|
31162
31180
|
const outer2 = question.by[0] ?? null;
|
|
31163
|
-
const groupsOf2 = (ref) => (answers2[(0,
|
|
31181
|
+
const groupsOf2 = (ref) => (answers2[(0, import_data_table10.drillRequestKey)(question.by.slice(0, question.by.indexOf(ref) + 1))] ?? []).map((r) => r.groups[ref] ?? null).filter((v) => typeof v === "string" && v !== "");
|
|
31164
31182
|
const attributes = [];
|
|
31165
|
-
if (outer2 && !question.across && !(0,
|
|
31183
|
+
if (outer2 && !question.across && !(0, import_data_table10.parseDimensionRef)(outer2).grain) {
|
|
31166
31184
|
const groups = groupsOf2(outer2);
|
|
31167
31185
|
if (groups.length > 0) {
|
|
31168
31186
|
for (const fact of dim(outer2)?.level?.attributes ?? []) {
|
|
@@ -31171,9 +31189,9 @@ function drillLevelAsks(args) {
|
|
|
31171
31189
|
}
|
|
31172
31190
|
}
|
|
31173
31191
|
const focus = [];
|
|
31174
|
-
const at = (0,
|
|
31175
|
-
if (at && !(0,
|
|
31176
|
-
const filtered = new Set(question.where.map((w) => (0,
|
|
31192
|
+
const at = (0, import_data_table10.drillFocus)(question);
|
|
31193
|
+
if (at && !(0, import_data_table10.parseDimensionRef)(at.dim).grain) {
|
|
31194
|
+
const filtered = new Set(question.where.map((w) => (0, import_data_table10.parseDimensionRef)(w.dim).key));
|
|
31177
31195
|
for (const fact of dim(at.dim)?.level?.attributes ?? []) {
|
|
31178
31196
|
if (!filtered.has(fact) && known(fact)) focus.push({ outer: null, fact, where });
|
|
31179
31197
|
}
|
|
@@ -31181,7 +31199,7 @@ function drillLevelAsks(args) {
|
|
|
31181
31199
|
const names2 = [];
|
|
31182
31200
|
for (const ref of question.by) {
|
|
31183
31201
|
const d = dim(ref);
|
|
31184
|
-
if (!d?.labelFrom || (0,
|
|
31202
|
+
if (!d?.labelFrom || (0, import_data_table10.parseDimensionRef)(ref).grain || !known(d.labelFrom)) continue;
|
|
31185
31203
|
const groups = groupsOf2(ref);
|
|
31186
31204
|
if (groups.length > 0) names2.push({ outer: d.key, fact: d.labelFrom, where: { ...where, [d.key]: groups } });
|
|
31187
31205
|
}
|
|
@@ -31365,7 +31383,7 @@ function useDrillDefinition(source) {
|
|
|
31365
31383
|
function drillWhere(base2, trail, booleans) {
|
|
31366
31384
|
const where = { ...base2 ?? {} };
|
|
31367
31385
|
for (const w of trail) {
|
|
31368
|
-
const { key, grain } = (0,
|
|
31386
|
+
const { key, grain } = (0, import_data_table11.parseDimensionRef)(w.dim);
|
|
31369
31387
|
if (grain) where[w.dim] = w.value;
|
|
31370
31388
|
else if (booleans.has(key) && (w.value === "true" || w.value === "false")) where[key] = w.value === "true";
|
|
31371
31389
|
else where[key] = w.value;
|
|
@@ -31414,7 +31432,7 @@ function useDrillAnswers(args) {
|
|
|
31414
31432
|
(0, import_react164.useEffect)(() => {
|
|
31415
31433
|
if (!enabled || !source || question.by.length === 0) return;
|
|
31416
31434
|
const asked4 = JSON.parse(askKey2);
|
|
31417
|
-
const range = asked4.window && asked4.windowKey ? (0,
|
|
31435
|
+
const range = asked4.window && asked4.windowKey ? (0, import_data_table11.drillWindowRange)(asked4.window) : null;
|
|
31418
31436
|
const compare = asked4.compare && range && asked4.windowKey ? {
|
|
31419
31437
|
against: asked4.compare,
|
|
31420
31438
|
from: range.from,
|
|
@@ -31424,7 +31442,7 @@ function useDrillAnswers(args) {
|
|
|
31424
31442
|
let cancelled = false;
|
|
31425
31443
|
setAnswers({});
|
|
31426
31444
|
setError(null);
|
|
31427
|
-
const requests = (0,
|
|
31445
|
+
const requests = (0, import_data_table11.drillRequests)({ by: asked4.by, across: asked4.across, show: asked4.show, where: [] });
|
|
31428
31446
|
void Promise.all(
|
|
31429
31447
|
requests.map(async (request) => {
|
|
31430
31448
|
const got = await client.drillAsk({
|
|
@@ -31487,7 +31505,7 @@ function useDrillAnswers(args) {
|
|
|
31487
31505
|
}
|
|
31488
31506
|
function drillQuestionFor(question, def) {
|
|
31489
31507
|
if (!def) return question;
|
|
31490
|
-
const known = (ref) => def.dimensions.some((d) => d.key === (0,
|
|
31508
|
+
const known = (ref) => def.dimensions.some((d) => d.key === (0, import_data_table11.parseDimensionRef)(ref).key);
|
|
31491
31509
|
const show = question.show.filter((key) => def.measures.some((m) => m.key === key));
|
|
31492
31510
|
return {
|
|
31493
31511
|
...question,
|
|
@@ -31524,7 +31542,7 @@ function useDrill(args) {
|
|
|
31524
31542
|
});
|
|
31525
31543
|
const hostDims = args.dimensions;
|
|
31526
31544
|
const plain3 = (0, import_react164.useMemo)(() => drillDimensionsOf(def, labels, hostDims), [def, labels, hostDims]);
|
|
31527
|
-
const range = question.window && windowKey ? (0,
|
|
31545
|
+
const range = question.window && windowKey ? (0, import_data_table11.drillWindowRange)(question.window) : null;
|
|
31528
31546
|
const level = useDrillLevelReads({
|
|
31529
31547
|
source: args.source,
|
|
31530
31548
|
question,
|
|
@@ -31593,7 +31611,7 @@ function useAddressDrill(args) {
|
|
|
31593
31611
|
() => ({ by: [], across: null, show: [], where: [], ...startWindow ? { window: startWindow } : {} }),
|
|
31594
31612
|
[startWindow]
|
|
31595
31613
|
);
|
|
31596
|
-
const url = (0,
|
|
31614
|
+
const url = (0, import_data_table11.useDrillUrlState)({ fallback, prefix: prefix ?? "drill" });
|
|
31597
31615
|
const question = (0, import_react164.useMemo)(
|
|
31598
31616
|
() => startWindow && !url.question.window ? { ...url.question, window: startWindow } : url.question,
|
|
31599
31617
|
[url.question, startWindow]
|
|
@@ -31613,7 +31631,7 @@ function questionFromGrouping(grouping) {
|
|
|
31613
31631
|
};
|
|
31614
31632
|
}
|
|
31615
31633
|
function groupingFromQuestion(question, held) {
|
|
31616
|
-
const [first, ...rest] = question.by.map(
|
|
31634
|
+
const [first, ...rest] = question.by.map(import_data_table11.parseDimensionRef);
|
|
31617
31635
|
if (!first) return void 0;
|
|
31618
31636
|
const sameFirst = held?.field === first.key;
|
|
31619
31637
|
return {
|
|
@@ -31628,9 +31646,9 @@ function groupingFromQuestion(question, held) {
|
|
|
31628
31646
|
};
|
|
31629
31647
|
}
|
|
31630
31648
|
function trailClause(fields, w) {
|
|
31631
|
-
const { key, grain } = (0,
|
|
31649
|
+
const { key, grain } = (0, import_data_table11.parseDimensionRef)(w.dim);
|
|
31632
31650
|
const field2 = fields.find((f) => f.key === key);
|
|
31633
|
-
if (grain && w.value !== null) return { key, value: (0,
|
|
31651
|
+
if (grain && w.value !== null) return { key, value: (0, import_data_table11.bucketWindow)(w.value, grain), field: field2 };
|
|
31634
31652
|
if (field2 && String(editorKindFor(field2)) === "checkbox" && (w.value === "true" || w.value === "false")) {
|
|
31635
31653
|
return { key, value: w.value === "true", field: field2 };
|
|
31636
31654
|
}
|
|
@@ -31674,7 +31692,7 @@ function useGridDrillQuestion(args) {
|
|
|
31674
31692
|
const { tableId, fields, presentation, filter } = args;
|
|
31675
31693
|
const source = (0, import_react164.useMemo)(() => ({ kind: "table", id: tableId }), [tableId]);
|
|
31676
31694
|
const saved = (0, import_react164.useMemo)(() => questionFromGrouping(presentation.grouping), [presentation.grouping]);
|
|
31677
|
-
const url = (0,
|
|
31695
|
+
const url = (0, import_data_table11.useDrillUrlState)({ fallback: saved });
|
|
31678
31696
|
const requested = args.enabled && // Up to three levels are ROWS under nested headers on the merged grid (Airtable's group levels).
|
|
31679
31697
|
(url.question.by.length > (args.plainGroupingIsRows ? 3 : 0) || url.question.across !== null || url.question.where.length > 0 || // `!= null`: a question read by a design-system that does not know the window or the comparison
|
|
31680
31698
|
// yet has them UNDEFINED, and `undefined !== null` asked for drill metadata on every plain grid.
|
|
@@ -31685,7 +31703,7 @@ function useGridDrillQuestion(args) {
|
|
|
31685
31703
|
const windowKey = drillWindowDimensionOf(def);
|
|
31686
31704
|
const trailFilter = (0, import_react164.useMemo)(() => {
|
|
31687
31705
|
if (!enabled) return filter;
|
|
31688
|
-
const range = question.window && windowKey ? (0,
|
|
31706
|
+
const range = question.window && windowKey ? (0, import_data_table11.drillWindowRange)(question.window) : null;
|
|
31689
31707
|
const withWindow = range && windowKey ? filterWithWindow(fields, filter, windowKey, range) : filter;
|
|
31690
31708
|
return filterWithTrail(fields, withWindow, question.where);
|
|
31691
31709
|
}, [enabled, fields, filter, question.where, question.window, windowKey]);
|
|
@@ -33867,7 +33885,7 @@ var import_react186 = require("@ai-matrx/records/react");
|
|
|
33867
33885
|
var import_core18 = require("@ai-matrx/records/core");
|
|
33868
33886
|
var import_design_system99 = require("@ai-matrx/design-system");
|
|
33869
33887
|
init_plainWords();
|
|
33870
|
-
var
|
|
33888
|
+
var import_data_table12 = require("@ai-matrx/design-system/data-table");
|
|
33871
33889
|
init_recordVersions();
|
|
33872
33890
|
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
33873
33891
|
function changesFor(step2, direction, versions = /* @__PURE__ */ new Map()) {
|
|
@@ -33896,7 +33914,7 @@ function useGridUndo(args) {
|
|
|
33896
33914
|
onVersionsRef.current = args.onVersions;
|
|
33897
33915
|
const onVersions = (versions) => onVersionsRef.current?.(versions);
|
|
33898
33916
|
const known = (0, import_react185.useRef)(/* @__PURE__ */ new Map());
|
|
33899
|
-
const [held, setHeld] = (0, import_react185.useState)(() => ({ stack: (0,
|
|
33917
|
+
const [held, setHeld] = (0, import_react185.useState)(() => ({ stack: (0, import_data_table12.createUndoStack)(args.depth ?? 100), steps: /* @__PURE__ */ new Map() }));
|
|
33900
33918
|
const heldRef = (0, import_react185.useRef)(held);
|
|
33901
33919
|
heldRef.current = held;
|
|
33902
33920
|
const [busy, setBusy] = (0, import_react185.useState)(false);
|
|
@@ -33911,7 +33929,7 @@ function useGridUndo(args) {
|
|
|
33911
33929
|
setHeld((was) => {
|
|
33912
33930
|
const steps = new Map(was.steps);
|
|
33913
33931
|
steps.set(id, step2);
|
|
33914
|
-
const stack = (0,
|
|
33932
|
+
const stack = (0, import_data_table12.pushUndo)(was.stack, { label: id, undo: [], redo: [] });
|
|
33915
33933
|
const live = new Set([...stack.past, ...stack.future].map((e) => e.label));
|
|
33916
33934
|
for (const key of [...steps.keys()]) if (!live.has(key)) steps.delete(key);
|
|
33917
33935
|
return { stack, steps };
|
|
@@ -33921,7 +33939,7 @@ function useGridUndo(args) {
|
|
|
33921
33939
|
const apply = (0, import_react185.useCallback)(
|
|
33922
33940
|
async (direction) => {
|
|
33923
33941
|
const was = heldRef.current;
|
|
33924
|
-
const taken = direction === "undo" ? (0,
|
|
33942
|
+
const taken = direction === "undo" ? (0, import_data_table12.popUndo)(was.stack) : (0, import_data_table12.popRedo)(was.stack);
|
|
33925
33943
|
if (!taken.entry) return;
|
|
33926
33944
|
const step2 = was.steps.get(taken.entry.label);
|
|
33927
33945
|
if (!step2) return;
|
|
@@ -35178,7 +35196,7 @@ var NO_REREAD = () => {
|
|
|
35178
35196
|
};
|
|
35179
35197
|
var VALUE_FILTER_UI = { allowNegation: true };
|
|
35180
35198
|
function Grid(props) {
|
|
35181
|
-
const inCard = (0,
|
|
35199
|
+
const inCard = (0, import_data_table13.useMatrxTableCard)() !== null;
|
|
35182
35200
|
if (!inCard) return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(GridBody, { ...props });
|
|
35183
35201
|
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(TableToolbarSlotContext.Provider, { value: void 0, children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(TableToolbarFoldContext.Provider, { value: 0, children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(TableToolbarSheetExtrasContext.Provider, { value: void 0, children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(GridBody, { ...props }) }) }) });
|
|
35184
35202
|
}
|
|
@@ -35212,7 +35230,7 @@ function GridBody({
|
|
|
35212
35230
|
hideRefusedRowActions = false
|
|
35213
35231
|
}) {
|
|
35214
35232
|
const toolbarSlot = useTableToolbarSlot();
|
|
35215
|
-
const tableCard = (0,
|
|
35233
|
+
const tableCard = (0, import_data_table13.useMatrxTableCard)();
|
|
35216
35234
|
const [cardExtraRows, setCardExtraRows] = (0, import_react197.useState)(0);
|
|
35217
35235
|
const fills = footer === "sticky";
|
|
35218
35236
|
const host = useRecordsUi();
|
|
@@ -35232,7 +35250,7 @@ function GridBody({
|
|
|
35232
35250
|
);
|
|
35233
35251
|
const merged = host.grid === "merged";
|
|
35234
35252
|
const phone = (0, import_design_system103.useIsMobile)();
|
|
35235
|
-
const macLook = (0,
|
|
35253
|
+
const macLook = (0, import_data_table13.useMatrxDataTableHost)().defaultLook === "mac";
|
|
35236
35254
|
const toolbarFold2 = useTableToolbarFold();
|
|
35237
35255
|
const sheetExtras = useTableToolbarSheetExtras();
|
|
35238
35256
|
const rights = useTableRights(table.data);
|
|
@@ -36492,7 +36510,7 @@ function GridBody({
|
|
|
36492
36510
|
[tableId, table.data, ordered, labelFor, merged]
|
|
36493
36511
|
);
|
|
36494
36512
|
const tableStyleProp = (0, import_react197.useMemo)(
|
|
36495
|
-
() => (0,
|
|
36513
|
+
() => (0, import_data_table13.tableStyleIsEmpty)(paint.style) ? null : {
|
|
36496
36514
|
style: paint.style,
|
|
36497
36515
|
// A choice is read as its OPTION (`paintByOption`): the rule, the value and the
|
|
36498
36516
|
// color a column keeps for it all name the same option, however it is stored.
|
|
@@ -37140,6 +37158,7 @@ function GridBody({
|
|
|
37140
37158
|
"div",
|
|
37141
37159
|
{
|
|
37142
37160
|
className: (0, import_design_system103.cn)("relative flex min-h-0 flex-col gap-2", fills && "flex-1", className),
|
|
37161
|
+
"data-surface-value": "current_cell_value",
|
|
37143
37162
|
"data-records-grid-footer": footer ?? "natural",
|
|
37144
37163
|
...merged ? {
|
|
37145
37164
|
// THE SUMMARY MEASURES ARE ASKED WHEN A PERSON REACHES FOR THE GRID — a header menu, a
|
|
@@ -37319,7 +37338,7 @@ function GridBody({
|
|
|
37319
37338
|
"data-records-grid-fit": look.fit,
|
|
37320
37339
|
onPasteCapture: takeEmptyTablePaste,
|
|
37321
37340
|
children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(EmbeddedLookProvider, { value: embedded ? EMBEDDED_LOOK : null, children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
37322
|
-
|
|
37341
|
+
import_data_table13.MatrxDataTable,
|
|
37323
37342
|
{
|
|
37324
37343
|
...fills ? { className: "min-h-0 flex-1" } : {},
|
|
37325
37344
|
frameHeight: fills ? "fill" : "content",
|
|
@@ -37444,7 +37463,7 @@ function GridBody({
|
|
|
37444
37463
|
// More exists when the store's total says so, or when it answered a FULL page (it
|
|
37445
37464
|
// names a total only once a page comes back short).
|
|
37446
37465
|
(typeof records.data?.total === "number" ? records.data.total > rows.length : rows.length >= pageSize + cardExtraRows) ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
37447
|
-
|
|
37466
|
+
import_data_table13.MatrxTableCardShowMore,
|
|
37448
37467
|
{
|
|
37449
37468
|
shown: rows.length,
|
|
37450
37469
|
total: typeof records.data?.total === "number" ? records.data.total : void 0,
|
|
@@ -37453,7 +37472,7 @@ function GridBody({
|
|
|
37453
37472
|
}
|
|
37454
37473
|
) : null
|
|
37455
37474
|
) : embeddedMore ? typeof records.data?.total === "number" && records.data.total > pageRows.length ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
37456
|
-
|
|
37475
|
+
import_data_table13.MatrxTableCardShowMore,
|
|
37457
37476
|
{
|
|
37458
37477
|
shown: pageRows.length,
|
|
37459
37478
|
total: records.data.total,
|
|
@@ -37646,7 +37665,7 @@ function sortIgnoredOf(answer) {
|
|
|
37646
37665
|
|
|
37647
37666
|
// src/RecordsTableCard.tsx
|
|
37648
37667
|
var import_react234 = require("react");
|
|
37649
|
-
var
|
|
37668
|
+
var import_data_table15 = require("@ai-matrx/design-system/data-table");
|
|
37650
37669
|
var import_design_system120 = require("@ai-matrx/design-system");
|
|
37651
37670
|
var import_react235 = require("@ai-matrx/records/react");
|
|
37652
37671
|
|
|
@@ -40882,7 +40901,7 @@ function PrintLayoutEntry({ tableId, recordId }) {
|
|
|
40882
40901
|
|
|
40883
40902
|
// src/entityTable.tsx
|
|
40884
40903
|
var import_react231 = require("react");
|
|
40885
|
-
var
|
|
40904
|
+
var import_data_table14 = require("@ai-matrx/design-system/data-table");
|
|
40886
40905
|
var import_react232 = require("@ai-matrx/records/react");
|
|
40887
40906
|
var import_react233 = require("@ai-matrx/records/entity/react");
|
|
40888
40907
|
|
|
@@ -41012,7 +41031,7 @@ function EntityGrid({
|
|
|
41012
41031
|
const columns = (0, import_react231.useMemo)(() => entityTableColumns(entity.columns, canEdit), [entity.columns, canEdit]);
|
|
41013
41032
|
const byId = (0, import_react231.useMemo)(() => new Map(entity.columns.map((c) => [columnId(c), c])), [entity.columns]);
|
|
41014
41033
|
return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
|
|
41015
|
-
|
|
41034
|
+
import_data_table14.MatrxDataTable,
|
|
41016
41035
|
{
|
|
41017
41036
|
data: entity.rows,
|
|
41018
41037
|
columns,
|
|
@@ -41048,7 +41067,7 @@ var import_jsx_runtime140 = require("react/jsx-runtime");
|
|
|
41048
41067
|
function RecordsTableCard(props) {
|
|
41049
41068
|
const client = (0, import_react235.useOptionalRecordsClient)();
|
|
41050
41069
|
if (!client) {
|
|
41051
|
-
return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
41070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_data_table15.MatrxTableCard, { title: "Table", ...props.className ? { className: props.className } : {}, children: /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_data_table15.MatrxTableCardEmpty, { message: "This table cannot be shown here: the page has no connection to the data." }) });
|
|
41052
41071
|
}
|
|
41053
41072
|
if (props.source.kind === "entity") return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(EntityTableCard, { ...props, source: props.source });
|
|
41054
41073
|
return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(ConnectedRecordsTableCard, { ...props, source: props.source });
|
|
@@ -41070,11 +41089,11 @@ function EntityTableCardBody({
|
|
|
41070
41089
|
headerActions,
|
|
41071
41090
|
className
|
|
41072
41091
|
}) {
|
|
41073
|
-
const batch = initialRows ??
|
|
41092
|
+
const batch = initialRows ?? import_data_table15.TABLE_CARD_DEFAULT_INITIAL_ROWS;
|
|
41074
41093
|
const entity = useEntitySourceTable(source.token, { pageSize: batch, filter: source.filter ?? null });
|
|
41075
41094
|
const label = entity.label ?? (entity.loading ? "Loading\u2026" : "Table");
|
|
41076
41095
|
return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
41077
|
-
|
|
41096
|
+
import_data_table15.MatrxTableCard,
|
|
41078
41097
|
{
|
|
41079
41098
|
title: label,
|
|
41080
41099
|
fields: entity.columns.length,
|
|
@@ -41093,10 +41112,10 @@ function EntityTableCardBody({
|
|
|
41093
41112
|
} : {},
|
|
41094
41113
|
...initialRows ? { initialRows } : {},
|
|
41095
41114
|
...className ? { className } : {},
|
|
41096
|
-
children: entity.error ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
41115
|
+
children: entity.error ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_data_table15.MatrxTableCardEmpty, { message: `This table could not be read: ${entity.error}` }) : /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_jsx_runtime140.Fragment, { children: [
|
|
41097
41116
|
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)(EntityGrid, { entity, pageSize: batch, ...editable === void 0 ? {} : { editable } }),
|
|
41098
41117
|
entity.hasMore ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
41099
|
-
|
|
41118
|
+
import_data_table15.MatrxTableCardShowMore,
|
|
41100
41119
|
{
|
|
41101
41120
|
shown: entity.rows.length,
|
|
41102
41121
|
total: entity.total ?? entity.rows.length + 1,
|
|
@@ -41132,7 +41151,7 @@ function ConnectedRecordsTableCard({
|
|
|
41132
41151
|
const plural5 = t?.label_plural ?? t?.name ?? "Records";
|
|
41133
41152
|
const singular = t?.label_singular ?? t?.name ?? "Record";
|
|
41134
41153
|
return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
41135
|
-
|
|
41154
|
+
import_data_table15.MatrxTableCard,
|
|
41136
41155
|
{
|
|
41137
41156
|
title: t ? plural5 : table.loading ? "Loading\u2026" : "Table",
|
|
41138
41157
|
records: { singular: singular.toLowerCase(), plural: plural5.toLowerCase() },
|
|
@@ -41147,14 +41166,14 @@ function ConnectedRecordsTableCard({
|
|
|
41147
41166
|
...headerActions ? { headerActions } : {},
|
|
41148
41167
|
...initialRows ? { initialRows } : {},
|
|
41149
41168
|
...className ? { className } : {},
|
|
41150
|
-
children: table.error ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
41169
|
+
children: table.error ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_data_table15.MatrxTableCardEmpty, { message: `This table could not be read: ${refusalSentence(table.error)}` }) : inCard ? /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "flex flex-col gap-2", "data-records-card-detail": "", children: [
|
|
41151
41170
|
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_design_system120.Button, { size: "sm", variant: "ghost", className: "self-start", "data-records-card-back": "", onClick: () => setInCard(null), children: `Back to ${plural5.toLowerCase()}` }),
|
|
41152
41171
|
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)(RecordPanel, { tableId: source.id, recordId: inCard, onPage: true, onClose: () => setInCard(null) })
|
|
41153
41172
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
41154
41173
|
Grid,
|
|
41155
41174
|
{
|
|
41156
41175
|
tableId: source.id,
|
|
41157
|
-
pageSize: initialRows ??
|
|
41176
|
+
pageSize: initialRows ?? import_data_table15.TABLE_CARD_DEFAULT_INITIAL_ROWS,
|
|
41158
41177
|
...opener2 ? { onOpenRecord: opener2 } : {},
|
|
41159
41178
|
...editable === void 0 ? {} : { editable }
|
|
41160
41179
|
}
|
|
@@ -43157,7 +43176,7 @@ var import_react299 = require("react");
|
|
|
43157
43176
|
var import_react300 = require("@ai-matrx/records/react");
|
|
43158
43177
|
var import_records64 = require("@ai-matrx/records");
|
|
43159
43178
|
var import_design_system147 = require("@ai-matrx/design-system");
|
|
43160
|
-
var
|
|
43179
|
+
var import_data_table22 = require("@ai-matrx/design-system/data-table");
|
|
43161
43180
|
var import_format15 = require("@ai-matrx/kit/format");
|
|
43162
43181
|
|
|
43163
43182
|
// src/recordMoves.tsx
|
|
@@ -43361,7 +43380,7 @@ var import_react267 = require("react");
|
|
|
43361
43380
|
var import_react268 = require("@ai-matrx/records/react");
|
|
43362
43381
|
var import_records58 = require("@ai-matrx/records");
|
|
43363
43382
|
var import_design_system133 = require("@ai-matrx/design-system");
|
|
43364
|
-
var
|
|
43383
|
+
var import_data_table16 = require("@ai-matrx/design-system/data-table");
|
|
43365
43384
|
init_recordVersions();
|
|
43366
43385
|
init_Refusal();
|
|
43367
43386
|
init_refusals();
|
|
@@ -43603,7 +43622,7 @@ function PipelineBoard({
|
|
|
43603
43622
|
const ordered = (definition?.stages ?? []).flatMap((stage) => cardsByStage.get(stage.key) ?? []);
|
|
43604
43623
|
const selectedInOrder = ordered.filter((r) => selected.has(r.id));
|
|
43605
43624
|
const select = (index, how) => {
|
|
43606
|
-
const { next, anchor: at } = (0,
|
|
43625
|
+
const { next, anchor: at } = (0, import_data_table16.toggleSelection)({
|
|
43607
43626
|
order: ordered,
|
|
43608
43627
|
idOf: (r) => r.id,
|
|
43609
43628
|
selected,
|
|
@@ -43980,7 +43999,7 @@ function PipelineCard({
|
|
|
43980
43999
|
dates
|
|
43981
44000
|
}) {
|
|
43982
44001
|
const labels = useRecordLabels(field2 ? [field2] : []);
|
|
43983
|
-
const color = style ? (0,
|
|
44002
|
+
const color = style ? (0, import_data_table16.resolveRowColor)(style, { id: record.id, data: record.document ?? {} }, colorFromTheValue) : null;
|
|
43984
44003
|
const draggable = (0, import_react268.mayDrag)(record.level);
|
|
43985
44004
|
const { text: label, withheld } = cardWords(record, field2, labels);
|
|
43986
44005
|
return /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)(
|
|
@@ -43998,7 +44017,7 @@ function PipelineCard({
|
|
|
43998
44017
|
draggable ? "cursor-grab active:cursor-grabbing" : "",
|
|
43999
44018
|
dragging ? "opacity-50" : "",
|
|
44000
44019
|
// A selected card shows the selection, not its tint — the two never fight for one background.
|
|
44001
|
-
selected ? "border-primary bg-primary/10 ring-1 ring-primary" : color ?
|
|
44020
|
+
selected ? "border-primary bg-primary/10 ring-1 ring-primary" : color ? import_data_table16.ROW_TINT_CLASS[color] : ""
|
|
44002
44021
|
),
|
|
44003
44022
|
onClick: (e) => {
|
|
44004
44023
|
if (draggable && (e.shiftKey || e.metaKey || e.ctrlKey)) {
|
|
@@ -44169,7 +44188,7 @@ var import_react273 = require("react");
|
|
|
44169
44188
|
var import_react274 = require("@ai-matrx/records/react");
|
|
44170
44189
|
var import_design_system134 = require("@ai-matrx/design-system");
|
|
44171
44190
|
var import_controls14 = require("@ai-matrx/design-system/controls");
|
|
44172
|
-
var
|
|
44191
|
+
var import_data_table18 = require("@ai-matrx/design-system/data-table");
|
|
44173
44192
|
|
|
44174
44193
|
// src/weekStart.ts
|
|
44175
44194
|
var import_react270 = require("react");
|
|
@@ -44211,7 +44230,7 @@ init_names();
|
|
|
44211
44230
|
|
|
44212
44231
|
// src/rowColorBy.tsx
|
|
44213
44232
|
var import_react272 = require("react");
|
|
44214
|
-
var
|
|
44233
|
+
var import_data_table17 = require("@ai-matrx/design-system/data-table");
|
|
44215
44234
|
init_choiceLooks();
|
|
44216
44235
|
function useRowColorBy(all, colorKey, style) {
|
|
44217
44236
|
const colorField = all.find((f) => f.key === colorKey);
|
|
@@ -44222,11 +44241,11 @@ function useRowColorBy(all, colorKey, style) {
|
|
|
44222
44241
|
return optionFor(options.get(key), first)?.color ?? (colorField ? storedChoiceColor(colorField, first) : void 0) ?? colorFromTheValue(key, first);
|
|
44223
44242
|
};
|
|
44224
44243
|
const effective = {
|
|
44225
|
-
...
|
|
44244
|
+
...import_data_table17.EMPTY_TABLE_STYLE,
|
|
44226
44245
|
...style ?? {},
|
|
44227
44246
|
...colorKey ? { colorBy: { field: colorKey, target: "row" } } : { colorBy: null }
|
|
44228
44247
|
};
|
|
44229
|
-
return (row) => (0,
|
|
44248
|
+
return (row) => (0, import_data_table17.resolveRowColor)(effective, { id: row.id, data: row.document ?? {} }, lookup);
|
|
44230
44249
|
}, [options, colorField, colorKey, style]);
|
|
44231
44250
|
}
|
|
44232
44251
|
|
|
@@ -44797,7 +44816,7 @@ function CalendarView({
|
|
|
44797
44816
|
className: (0, import_design_system134.cn)(
|
|
44798
44817
|
"@container flex w-full min-w-0 items-center gap-1 truncate rounded border px-1.5 py-0.5 text-left text-xs hover:brightness-95",
|
|
44799
44818
|
// The chip palette, not the faint row tint: a calendar is read by its colors at a glance.
|
|
44800
|
-
color ?
|
|
44819
|
+
color ? import_data_table18.CHOICE_CHIP_CLASS[color] : "bg-background",
|
|
44801
44820
|
may ? "cursor-grab active:cursor-grabbing" : "cursor-default",
|
|
44802
44821
|
compact ? "min-h-3 px-0" : "",
|
|
44803
44822
|
className2
|
|
@@ -44899,7 +44918,7 @@ function CalendarView({
|
|
|
44899
44918
|
tight: tightCells,
|
|
44900
44919
|
dotClass: (row) => {
|
|
44901
44920
|
const c = colorOf(row);
|
|
44902
|
-
return c ?
|
|
44921
|
+
return c ? import_data_table18.CHOICE_CHIP_CLASS[c] : "bg-muted-foreground/40";
|
|
44903
44922
|
},
|
|
44904
44923
|
card: (p, key) => listCard(p, key),
|
|
44905
44924
|
bar: (p, key) => /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { ...dragSource(p.row), className: "relative h-full", children: [
|
|
@@ -45244,7 +45263,7 @@ var import_react275 = require("react");
|
|
|
45244
45263
|
var import_react276 = require("@ai-matrx/records/react");
|
|
45245
45264
|
var import_design_system135 = require("@ai-matrx/design-system");
|
|
45246
45265
|
var import_controls15 = require("@ai-matrx/design-system/controls");
|
|
45247
|
-
var
|
|
45266
|
+
var import_data_table19 = require("@ai-matrx/design-system/data-table");
|
|
45248
45267
|
init_dates();
|
|
45249
45268
|
init_names();
|
|
45250
45269
|
init_parity();
|
|
@@ -46031,7 +46050,7 @@ function TimelineView({
|
|
|
46031
46050
|
className: (0, import_design_system135.cn)(
|
|
46032
46051
|
"absolute flex select-none items-center gap-1 rounded border px-1.5 text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
46033
46052
|
outside ? "overflow-visible" : "overflow-hidden",
|
|
46034
|
-
milestone ? "border-transparent bg-transparent" : color ?
|
|
46053
|
+
milestone ? "border-transparent bg-transparent" : color ? import_data_table19.CHOICE_CHIP_CLASS[color] : "bg-muted",
|
|
46035
46054
|
onCritical ? "ring-2 ring-amber-500" : void 0,
|
|
46036
46055
|
linkTarget === p.row.id ? "ring-2 ring-primary" : void 0,
|
|
46037
46056
|
may ? "cursor-grab active:cursor-grabbing" : "cursor-pointer",
|
|
@@ -46261,7 +46280,7 @@ function TimelineView({
|
|
|
46261
46280
|
type: "button",
|
|
46262
46281
|
className: (0, import_design_system135.cn)(
|
|
46263
46282
|
"flex w-full min-w-0 items-center gap-1 truncate rounded border px-1.5 py-0.5 text-left text-xs hover:brightness-95",
|
|
46264
|
-
color ?
|
|
46283
|
+
color ? import_data_table19.CHOICE_CHIP_CLASS[color] : "bg-background",
|
|
46265
46284
|
may ? "cursor-grab" : "cursor-default"
|
|
46266
46285
|
),
|
|
46267
46286
|
title: may ? `${titleOf(row)} \xB7 drag onto a day` : (0, import_react276.mayDrag)(row.level) ? WORKED_OUT_DATE_LOCK : whatYouMayDo(row.level ?? null).why("write"),
|
|
@@ -46341,7 +46360,7 @@ function TimelineView({
|
|
|
46341
46360
|
/* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
|
|
46342
46361
|
"span",
|
|
46343
46362
|
{
|
|
46344
|
-
className: (0, import_design_system135.cn)("max-w-full truncate rounded px-1.5 py-0.5 text-xs font-medium", lane.color ?
|
|
46363
|
+
className: (0, import_design_system135.cn)("max-w-full truncate rounded px-1.5 py-0.5 text-xs font-medium", lane.color ? import_data_table19.CHOICE_CHIP_CLASS[lane.color] : void 0),
|
|
46345
46364
|
title: laneLocked ?? lane.label,
|
|
46346
46365
|
...laneLocked ? { "data-timeline-lane-locked": "" } : {},
|
|
46347
46366
|
children: lane.label
|
|
@@ -46824,7 +46843,7 @@ function ClickableSurface({
|
|
|
46824
46843
|
// src/ListView.tsx
|
|
46825
46844
|
var import_react282 = require("react");
|
|
46826
46845
|
var import_design_system139 = require("@ai-matrx/design-system");
|
|
46827
|
-
var
|
|
46846
|
+
var import_data_table20 = require("@ai-matrx/design-system/data-table");
|
|
46828
46847
|
init_names();
|
|
46829
46848
|
var import_jsx_runtime163 = require("react/jsx-runtime");
|
|
46830
46849
|
var LIST_DEFAULT_FIELDS = 4;
|
|
@@ -46967,7 +46986,7 @@ function ListRow({
|
|
|
46967
46986
|
const doc = row.document ?? {};
|
|
46968
46987
|
const filled = fields.filter((field2) => !isEmptyOnCard(doc[field2.key]) || withheldNoticeOf(row.hidden, field2.key));
|
|
46969
46988
|
const onRow = chose ? filled : filled.slice(0, LIST_DEFAULT_FIELDS);
|
|
46970
|
-
const color = style ? (0,
|
|
46989
|
+
const color = style ? (0, import_data_table20.resolveRowColor)(style, { id: row.id, data: row.document ?? {} }, colorFromTheValue) : null;
|
|
46971
46990
|
const values = onRow.map((field2) => (
|
|
46972
46991
|
// ONE LINE PER VALUE (walk 2026-10-05): a multi-line caption drew as paragraphs, pushing the
|
|
46973
46992
|
// title to the row's foot. A list row is one line, as Notion's is; the record page has the rest.
|
|
@@ -46991,7 +47010,7 @@ function ListRow({
|
|
|
46991
47010
|
onOpen: () => onOpenRecord?.(row.id),
|
|
46992
47011
|
title: withheld ?? title,
|
|
46993
47012
|
data: { "data-records-list-row": row.id },
|
|
46994
|
-
className: (0, import_design_system139.cn)("w-full min-w-0 rounded text-left text-xs hover:bg-muted", color ?
|
|
47013
|
+
className: (0, import_design_system139.cn)("w-full min-w-0 rounded text-left text-xs hover:bg-muted", color ? import_data_table20.ROW_TINT_CLASS[color] : void 0),
|
|
46995
47014
|
contentClassName: "flex w-full min-w-0 items-center gap-3 px-1 py-1 pr-7",
|
|
46996
47015
|
children: [
|
|
46997
47016
|
/* @__PURE__ */ (0, import_jsx_runtime163.jsx)("span", { className: "min-w-0 shrink truncate font-medium", children: title }),
|
|
@@ -47090,7 +47109,7 @@ var import_react284 = require("@ai-matrx/records/react");
|
|
|
47090
47109
|
init_parity();
|
|
47091
47110
|
|
|
47092
47111
|
// src/charts.ts
|
|
47093
|
-
var
|
|
47112
|
+
var import_data_table21 = require("@ai-matrx/design-system/data-table");
|
|
47094
47113
|
var CHART_KIND_LABEL = {
|
|
47095
47114
|
number: "Number",
|
|
47096
47115
|
bar: "Bars",
|
|
@@ -47334,7 +47353,7 @@ function positionBucket(windowFrom, grain, weekStart, position) {
|
|
|
47334
47353
|
function groupBucketWindow(groupKey, value) {
|
|
47335
47354
|
const grain = BUCKET_SUFFIX.exec(groupKey)?.[1];
|
|
47336
47355
|
if (!grain || !/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(value)) return null;
|
|
47337
|
-
return { key: groupKey.replace(BUCKET_SUFFIX, ""), window: (0,
|
|
47356
|
+
return { key: groupKey.replace(BUCKET_SUFFIX, ""), window: (0, import_data_table21.bucketWindow)(value, grain) };
|
|
47338
47357
|
}
|
|
47339
47358
|
|
|
47340
47359
|
// src/linkWords.ts
|
|
@@ -50102,7 +50121,7 @@ function Board({
|
|
|
50102
50121
|
onColorFieldChange: (key) => onChange({
|
|
50103
50122
|
presentation: {
|
|
50104
50123
|
...view.presentation,
|
|
50105
|
-
style: { ...
|
|
50124
|
+
style: { ...import_data_table22.EMPTY_TABLE_STYLE, ...view.presentation?.style ?? {}, colorBy: key ? { field: key, target: "row" } : null }
|
|
50106
50125
|
}
|
|
50107
50126
|
}),
|
|
50108
50127
|
titleField,
|
|
@@ -50154,7 +50173,7 @@ function Board({
|
|
|
50154
50173
|
onChange({
|
|
50155
50174
|
presentation: {
|
|
50156
50175
|
...view.presentation,
|
|
50157
|
-
style: { ...
|
|
50176
|
+
style: { ...import_data_table22.EMPTY_TABLE_STYLE, ...view.presentation?.style ?? {}, colorBy: patch.colorKey ? { field: patch.colorKey, target: "row" } : null }
|
|
50158
50177
|
}
|
|
50159
50178
|
});
|
|
50160
50179
|
}
|
|
@@ -50483,7 +50502,7 @@ function Kanban({
|
|
|
50483
50502
|
const heading = (name) => /* @__PURE__ */ (0, import_jsx_runtime171.jsxs)(
|
|
50484
50503
|
"header",
|
|
50485
50504
|
{
|
|
50486
|
-
className: (0, import_design_system147.cn)("flex h-7 items-center gap-2 border-b px-2 text-xs font-medium", columnColor(name) ?
|
|
50505
|
+
className: (0, import_design_system147.cn)("flex h-7 items-center gap-2 border-b px-2 text-xs font-medium", columnColor(name) ? import_data_table22.CHOICE_CHIP_CLASS[columnColor(name)] : void 0),
|
|
50487
50506
|
"data-board-heading": name,
|
|
50488
50507
|
...columnColor(name) ? { "data-column-color": columnColor(name) } : {},
|
|
50489
50508
|
children: [
|
|
@@ -50550,7 +50569,7 @@ function Kanban({
|
|
|
50550
50569
|
void move(card, { column: name, lane: laneName }, { column: to, lane: laneName });
|
|
50551
50570
|
},
|
|
50552
50571
|
children: [
|
|
50553
|
-
accent ? /* @__PURE__ */ (0, import_jsx_runtime171.jsx)("span", { "aria-hidden": "true", "data-card-accent": accent, className: (0, import_design_system147.cn)("absolute inset-y-0.5 left-0 w-1 rounded",
|
|
50572
|
+
accent ? /* @__PURE__ */ (0, import_jsx_runtime171.jsx)("span", { "aria-hidden": "true", "data-card-accent": accent, className: (0, import_design_system147.cn)("absolute inset-y-0.5 left-0 w-1 rounded", import_data_table22.SWATCH_CLASS[accent]) }) : null,
|
|
50554
50573
|
/* @__PURE__ */ (0, import_jsx_runtime171.jsx)(RecordActionMenu, { tableId, row: card, name: cardWords(card, titleField).text, onOpenRecord, onChanged, children: previewField ? /* @__PURE__ */ (0, import_jsx_runtime171.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
50555
50574
|
/* @__PURE__ */ (0, import_jsx_runtime171.jsx)("span", { className: (0, import_design_system147.cn)("block w-full shrink-0 overflow-hidden rounded bg-muted/50", size.cover), "data-board-preview": previewField.key, children: /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(GalleryCover, { field: previewField, value: cover }) }),
|
|
50556
50575
|
recordCard
|
|
@@ -50683,7 +50702,7 @@ function Gallery({
|
|
|
50683
50702
|
const doc = row.document ?? {};
|
|
50684
50703
|
const filled = shown5.filter((field2) => !isEmptyOnCard(doc[field2.key]) || withheldNoticeOf(row.hidden, field2.key));
|
|
50685
50704
|
const onCard = chose ? filled : filled.slice(0, GALLERY_DEFAULT_FIELDS);
|
|
50686
|
-
const rowColor = style ? (0,
|
|
50705
|
+
const rowColor = style ? (0, import_data_table22.resolveRowColor)(style, { id: row.id, data: row.document ?? {} }, colorFromTheValue) : null;
|
|
50687
50706
|
return (
|
|
50688
50707
|
// min-w-0 + overflow-hidden: a long unbroken value (a link, a data: URL) is cut at the card's
|
|
50689
50708
|
// edge with its line's ellipsis, never drawn over the next card (AT-SLOW 4b).
|
|
@@ -50700,7 +50719,7 @@ function Gallery({
|
|
|
50700
50719
|
{
|
|
50701
50720
|
label: `Open ${recordNameIn({ title_field: titleKey ?? null }, doc) || "record"}`,
|
|
50702
50721
|
onOpen: () => onOpenRecord?.(row.id),
|
|
50703
|
-
className: (0, import_design_system147.cn)("h-full w-full min-w-0 overflow-hidden rounded border text-left hover:bg-muted", rowColor ?
|
|
50722
|
+
className: (0, import_design_system147.cn)("h-full w-full min-w-0 overflow-hidden rounded border text-left hover:bg-muted", rowColor ? import_data_table22.ROW_TINT_CLASS[rowColor] : void 0),
|
|
50704
50723
|
contentClassName: "flex h-full w-full min-w-0 flex-col gap-1 p-2 pr-7",
|
|
50705
50724
|
data: { "data-records-gallery-card": row.id },
|
|
50706
50725
|
children: [
|
|
@@ -50776,7 +50795,7 @@ function RecordCard({
|
|
|
50776
50795
|
const parentId = parentField ? parentIdOf(record.document, parentField.key) : null;
|
|
50777
50796
|
const parentName = parentField && parentId ? scalarText(parentField, parentId, labels) : null;
|
|
50778
50797
|
const open = () => onOpenRecord?.(record.id);
|
|
50779
|
-
const color = style ? (0,
|
|
50798
|
+
const color = style ? (0, import_data_table22.resolveRowColor)(style, { id: record.id, data: record.document ?? {} }, colorFromTheValue) : null;
|
|
50780
50799
|
return /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(
|
|
50781
50800
|
ClickableSurface,
|
|
50782
50801
|
{
|
|
@@ -50786,7 +50805,7 @@ function RecordCard({
|
|
|
50786
50805
|
data: { "data-records-card": record.id, ...withheld && field2 ? { "data-records-withheld": field2.key } : {} },
|
|
50787
50806
|
className: (0, import_design_system147.cn)(
|
|
50788
50807
|
"w-full truncate rounded border bg-background text-left text-xs hover:bg-muted",
|
|
50789
|
-
color ?
|
|
50808
|
+
color ? import_data_table22.ROW_TINT_CLASS[color] : void 0
|
|
50790
50809
|
),
|
|
50791
50810
|
contentClassName: (0, import_design_system147.cn)("truncate px-2 py-1", host.density === "spacious" ? "py-2" : ""),
|
|
50792
50811
|
children: dates && dates.length > 0 || fields && fields.length > 0 || parentName ? /* @__PURE__ */ (0, import_jsx_runtime171.jsxs)(import_jsx_runtime171.Fragment, { children: [
|
|
@@ -51882,7 +51901,7 @@ function ProposalRow({
|
|
|
51882
51901
|
var import_react310 = require("react");
|
|
51883
51902
|
var import_react311 = require("@ai-matrx/records/react");
|
|
51884
51903
|
var import_design_system152 = require("@ai-matrx/design-system");
|
|
51885
|
-
var
|
|
51904
|
+
var import_data_table23 = require("@ai-matrx/design-system/data-table");
|
|
51886
51905
|
var import_format16 = require("@ai-matrx/kit/format");
|
|
51887
51906
|
init_Refusal();
|
|
51888
51907
|
init_enumLabels();
|
|
@@ -52154,7 +52173,7 @@ function ActionInbox({
|
|
|
52154
52173
|
);
|
|
52155
52174
|
const select = (0, import_react310.useCallback)(
|
|
52156
52175
|
(index, shift) => {
|
|
52157
|
-
const { next, anchor: at } = (0,
|
|
52176
|
+
const { next, anchor: at } = (0, import_data_table23.toggleSelection)({
|
|
52158
52177
|
order: shown5,
|
|
52159
52178
|
idOf: (i) => i.item_id,
|
|
52160
52179
|
selected,
|
|
@@ -54277,7 +54296,7 @@ function Invite({ card, onInvited }) {
|
|
|
54277
54296
|
|
|
54278
54297
|
// src/FormLookFrame.tsx
|
|
54279
54298
|
var import_design_system158 = require("@ai-matrx/design-system");
|
|
54280
|
-
var
|
|
54299
|
+
var import_data_table24 = require("@ai-matrx/design-system/data-table");
|
|
54281
54300
|
var import_jsx_runtime182 = require("react/jsx-runtime");
|
|
54282
54301
|
var ACCENT_PRIMARY = {
|
|
54283
54302
|
slate: "215 19% 35%",
|
|
@@ -54296,15 +54315,15 @@ function safeHref(url) {
|
|
|
54296
54315
|
return null;
|
|
54297
54316
|
}
|
|
54298
54317
|
function formLookView(style, fallbackName) {
|
|
54299
|
-
const accent = style?.accent && style.accent in
|
|
54318
|
+
const accent = style?.accent && style.accent in import_data_table24.SWATCH_CLASS ? style.accent : null;
|
|
54300
54319
|
const https = (u) => typeof u === "string" && /^https:\/\//i.test(u) ? u : null;
|
|
54301
54320
|
const links = Array.isArray(style?.footer_links) ? style.footer_links : [];
|
|
54302
54321
|
return {
|
|
54303
54322
|
name: (style?.display_name ?? "").trim() || fallbackName.trim() || "Form",
|
|
54304
54323
|
logoUrl: https(style?.logo_url),
|
|
54305
54324
|
coverUrl: https(style?.cover_url),
|
|
54306
|
-
bandClass: accent ?
|
|
54307
|
-
monogramClass: accent ? `${
|
|
54325
|
+
bandClass: accent ? import_data_table24.SWATCH_CLASS[accent] : null,
|
|
54326
|
+
monogramClass: accent ? `${import_data_table24.SWATCH_CLASS[accent]} text-white` : "bg-primary text-primary-foreground",
|
|
54308
54327
|
primaryVars: accent && ACCENT_PRIMARY[accent] ? {
|
|
54309
54328
|
"--primary": ACCENT_PRIMARY[accent],
|
|
54310
54329
|
"--primary-foreground": "0 0% 100%",
|
|
@@ -65920,7 +65939,7 @@ function usePublicReadOnly(client, organizationId, tableId, table, rights) {
|
|
|
65920
65939
|
// src/entityViews.tsx
|
|
65921
65940
|
var import_format19 = require("@ai-matrx/kit/format");
|
|
65922
65941
|
var import_design_system192 = require("@ai-matrx/design-system");
|
|
65923
|
-
var
|
|
65942
|
+
var import_data_table25 = require("@ai-matrx/design-system/data-table");
|
|
65924
65943
|
var import_react379 = require("react");
|
|
65925
65944
|
var import_design_system193 = require("@ai-matrx/design-system");
|
|
65926
65945
|
var import_react380 = require("@ai-matrx/records/react");
|
|
@@ -66169,7 +66188,7 @@ function EntityTablePageBody({
|
|
|
66169
66188
|
) }) }) : null,
|
|
66170
66189
|
/* @__PURE__ */ (0, import_jsx_runtime216.jsx)(EntityGrid, { entity, pageSize, embedded: presentation === "embedded", ...drill ? { drill } : {} }),
|
|
66171
66190
|
entity.hasMore ? /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
66172
|
-
|
|
66191
|
+
import_data_table25.MatrxTableCardShowMore,
|
|
66173
66192
|
{
|
|
66174
66193
|
shown: entity.rows.length,
|
|
66175
66194
|
total: entity.total ?? entity.rows.length + 1,
|