@ai-matrx/records-ui 0.116.18 → 0.116.19
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 +2 -1
- package/dist/{SaveToTable-QRVSTLIR.js → SaveToTable-PGOQVYVS.js} +5 -5
- package/dist/{chunk-PX3F6PHS.js → chunk-5IX4BL72.js} +2 -2
- package/dist/{chunk-YHAJPUX3.js → chunk-KBNU55HU.js} +23 -29
- package/dist/chunk-KBNU55HU.js.map +1 -0
- package/dist/{chunk-7X2UJN4A.js → chunk-MCDA6L7E.js} +4 -2
- package/dist/{chunk-7X2UJN4A.js.map → chunk-MCDA6L7E.js.map} +1 -1
- package/dist/{chunk-RGMLZHYZ.js → chunk-ODABFEHG.js} +4 -4
- package/dist/chunk-ODABFEHG.js.map +1 -0
- package/dist/{chunk-IUUZVQZD.js → chunk-PPWNFIJ5.js} +2 -2
- package/dist/{chunk-IUUZVQZD.js.map → chunk-PPWNFIJ5.js.map} +1 -1
- package/dist/{chunk-VQZQJAU5.js → chunk-VHZKLE63.js} +13 -13
- package/dist/chunk-VHZKLE63.js.map +1 -0
- package/dist/{chunk-MWIIMCHK.js → chunk-ZNIXJ5RY.js} +2 -2
- package/dist/data-source.cjs +1 -1
- package/dist/data-source.cjs.map +1 -1
- package/dist/data-source.d.cts +1 -1
- package/dist/data-source.d.ts +1 -1
- package/dist/data-source.js +1 -1
- package/dist/data-source.js.map +1 -1
- package/dist/first-page.cjs +3 -1
- package/dist/first-page.cjs.map +1 -1
- package/dist/first-page.d.cts +6 -23
- package/dist/first-page.d.ts +6 -23
- package/dist/first-page.js +3 -1
- package/dist/first-page.js.map +1 -1
- package/dist/helpers.cjs +3 -3
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.d.cts +2 -2
- package/dist/helpers.d.ts +2 -2
- package/dist/helpers.js +3 -3
- package/dist/helpers.js.map +1 -1
- package/dist/index.cjs +144 -165
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +115 -132
- package/dist/index.js.map +1 -1
- package/dist/object-actions.cjs +1 -1
- package/dist/object-actions.cjs.map +1 -1
- package/dist/object-actions.js +2 -2
- package/dist/pickers.cjs +14 -14
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +4 -4
- package/dist/skeleton.js +2 -2
- package/package.json +7 -7
- package/dist/chunk-RGMLZHYZ.js.map +0 -1
- package/dist/chunk-VQZQJAU5.js.map +0 -1
- package/dist/chunk-YHAJPUX3.js.map +0 -1
- /package/dist/{SaveToTable-QRVSTLIR.js.map → SaveToTable-PGOQVYVS.js.map} +0 -0
- /package/dist/{chunk-PX3F6PHS.js.map → chunk-5IX4BL72.js.map} +0 -0
- /package/dist/{chunk-MWIIMCHK.js.map → chunk-ZNIXJ5RY.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -117,7 +117,7 @@ var init_rights = __esm({
|
|
|
117
117
|
// custom.field_declare / field_update / field_retire / table settings
|
|
118
118
|
structure: "admin"
|
|
119
119
|
};
|
|
120
|
-
NOT_YET = "
|
|
120
|
+
NOT_YET = "Checking what you may do here. Nothing is offered until then.";
|
|
121
121
|
NOTHING_AT_ALL = "You have not been given this. Ask somebody who administers it to share it with you.";
|
|
122
122
|
NOT_ANSWERED_YET = whatYouMayDo(null, false);
|
|
123
123
|
KERNEL_REASON = "This is one of the tables the platform ships, so its columns are not changed from a screen. Make your own table to change columns.";
|
|
@@ -394,7 +394,7 @@ function refusalForAPerson(error) {
|
|
|
394
394
|
const ours = error.ours === true;
|
|
395
395
|
const hint = plainSentence(String(error.hint ?? ""));
|
|
396
396
|
const message = ours ? plainSentence(String(error.message ?? "")) : peopleSentence(String(error.message ?? ""));
|
|
397
|
-
const title = TITLE[code] ?? "
|
|
397
|
+
const title = TITLE[code] ?? "That was refused";
|
|
398
398
|
const hintIsForEngineers = isDeveloperHint(String(error.hint ?? ""));
|
|
399
399
|
const example = exampleOf(error);
|
|
400
400
|
const remedy = (example ? `Enter it like ${example}.` : null) ?? (hintIsForEngineers ? null : hint.kept) ?? REMEDY[code] ?? REMEDY["internal"];
|
|
@@ -1682,7 +1682,7 @@ var init_enumLabels = __esm({
|
|
|
1682
1682
|
CONTEXT_POLICY_LABEL = {
|
|
1683
1683
|
include: "Yes, an assistant can read it",
|
|
1684
1684
|
summarize: "Only a summary of it",
|
|
1685
|
-
on_request: "Only
|
|
1685
|
+
on_request: "Only on request",
|
|
1686
1686
|
exclude: "No, keep it away from assistants"
|
|
1687
1687
|
};
|
|
1688
1688
|
STAGE_RULE_ON_FAIL_LABEL = {
|
|
@@ -4457,7 +4457,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
4457
4457
|
interesting.length === 1 ? " is" : " are",
|
|
4458
4458
|
" listed below by their ",
|
|
4459
4459
|
source ? "row" : "line in your file",
|
|
4460
|
-
" \u2014 the
|
|
4460
|
+
" \u2014 the rest stay with this run and are not all shown at once."
|
|
4461
4461
|
] }) : null,
|
|
4462
4462
|
interesting.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "max-h-64 overflow-auto rounded border", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("table", { className: "w-full", children: [
|
|
4463
4463
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("thead", { className: "sticky top-0 bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("tr", { children: [
|
|
@@ -4493,7 +4493,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, autoRun, className })
|
|
|
4493
4493
|
ledger?.refused === 1 ? " is" : " are",
|
|
4494
4494
|
" kept with this import \u2014 open ",
|
|
4495
4495
|
ledger?.refused === 1 ? "it" : "them",
|
|
4496
|
-
" again from the list of imports below, with the
|
|
4496
|
+
" again from the list of imports below, with the reason and the line from your file on each."
|
|
4497
4497
|
] }) : null
|
|
4498
4498
|
] }) : null
|
|
4499
4499
|
] }) : null,
|
|
@@ -5428,10 +5428,10 @@ var init_publicQuestions = __esm({
|
|
|
5428
5428
|
CANNOT_ASK = {
|
|
5429
5429
|
relation: "points at a record in another table, and somebody with no account cannot see that table to pick from it",
|
|
5430
5430
|
member: "is a person in this organization, and somebody outside it has no way to choose one",
|
|
5431
|
-
attachment: "holds a file in your own
|
|
5432
|
-
formula: "is
|
|
5433
|
-
lookup: "is read through a relation, so
|
|
5434
|
-
rollup: "is added up
|
|
5431
|
+
attachment: "holds a file in your own files, and a public page has nowhere to put one yet",
|
|
5432
|
+
formula: "is calculated, so there is nothing for anybody to answer",
|
|
5433
|
+
lookup: "is read through a relation, so it fills in by itself",
|
|
5434
|
+
rollup: "is added up, so there is nothing for anybody to answer"
|
|
5435
5435
|
};
|
|
5436
5436
|
SHORT_WHY = {
|
|
5437
5437
|
relation: "it points at a record in another table",
|
|
@@ -5841,7 +5841,7 @@ function BookingBuilder({ tableId, bookingId, onSaved, onClose, startNew, classN
|
|
|
5841
5841
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs text-muted-foreground", children: "Nobody booking is asked who they are, so you would not know who booked or how to reach them." }),
|
|
5842
5842
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_design_system35.Button, { size: "sm", variant: "outline", disabled: addingWho, onClick: () => void addWho(), children: addingWho ? "Adding\u2026" : "Ask their name and email" })
|
|
5843
5843
|
] }) : null,
|
|
5844
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs text-muted-foreground", children: "The time, whether it is booked or cancelled, and who it is with are filled in
|
|
5844
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs text-muted-foreground", children: "The time, whether it is booked or cancelled, and who it is with are filled in for you \u2014 a booking page cannot ask a visitor for any of the three." }),
|
|
5845
5845
|
leftOut ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs text-muted-foreground", children: leftOut }) : null,
|
|
5846
5846
|
unfillable ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5847
5847
|
import_design_system34.ErrorBox,
|
|
@@ -6966,13 +6966,13 @@ function WhereItLives({ tableId, knownOrganizationName, onMoved, variant = "head
|
|
|
6966
6966
|
className: "w-80 p-3 text-xs",
|
|
6967
6967
|
onClick: (e) => e.stopPropagation(),
|
|
6968
6968
|
onFocusOutside: (e) => e.preventDefault(),
|
|
6969
|
-
children: answer === null ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "text-muted-foreground", children: "
|
|
6969
|
+
children: answer === null ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "text-muted-foreground", children: "Finding where this table lives\u2026" }) : answer.state === "not-given" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "text-muted-foreground", children: "This table has not been shared with you, so where it lives is not yours to see." }) : answer.state === "door-absent" || answer.state === "unavailable" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "space-y-2", children: [
|
|
6970
6970
|
knownOrganizationName ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("p", { children: [
|
|
6971
6971
|
"Lives in ",
|
|
6972
6972
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "font-medium text-foreground", children: knownOrganizationName }),
|
|
6973
6973
|
"."
|
|
6974
6974
|
] }) : null,
|
|
6975
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "text-muted-foreground", children: answer.state === "door-absent" ? "Moving it to another organization is not available on this database yet." : `
|
|
6975
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "text-muted-foreground", children: answer.state === "door-absent" ? "Moving it to another organization is not available on this database yet." : `Where this lives could not be found, so nothing here says anything about your access. ${answer.why}` }),
|
|
6976
6976
|
answer.state === "unavailable" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_design_system40.Button, { size: "sm", variant: "outline", className: "h-7 text-xs", onClick: () => setAttempt((n) => n + 1), children: "Ask again" }) : null
|
|
6977
6977
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "space-y-2", "data-where-it-lives-panel": answer.home.table.id, children: [
|
|
6978
6978
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("p", { children: [
|
|
@@ -7330,7 +7330,7 @@ var init_TablesHome = __esm({
|
|
|
7330
7330
|
community: "Nothing published to the web.",
|
|
7331
7331
|
app: "No platform tables yet."
|
|
7332
7332
|
};
|
|
7333
|
-
SECTIONS_UNKNOWN = "Who can see each table, and which you made, could not be read
|
|
7333
|
+
SECTIONS_UNKNOWN = "Who can see each table, and which you made, could not be read, so every table is listed under Everyone and Only me is empty. That is not their real sharing.";
|
|
7334
7334
|
VISIBILITY_LANES = ["mine", "organization", "community", "world"];
|
|
7335
7335
|
VISIBILITY_LANE_TITLE = {
|
|
7336
7336
|
mine: "Only me",
|
|
@@ -8573,13 +8573,13 @@ function stepColumn(name, fields, where) {
|
|
|
8573
8573
|
const field2 = columnNamed(name, fields);
|
|
8574
8574
|
if (!field2) throw new Error(`${where}.field "${name}" is not a column of this table. The columns a step may set are: ${columnsSaid(fields)}.`);
|
|
8575
8575
|
if (!settable(field2)) {
|
|
8576
|
-
throw new Error(`${where}.field "${name}" is
|
|
8576
|
+
throw new Error(`${where}.field "${name}" is calculated from other columns, so no step can set it. The columns a step may set are: ${columnsSaid(fields)}.`);
|
|
8577
8577
|
}
|
|
8578
8578
|
return field2;
|
|
8579
8579
|
}
|
|
8580
8580
|
async function checkFormula(client, tableId, expression, where) {
|
|
8581
8581
|
const answered = await client.formulaParse({ table_id: tableId, text: expression });
|
|
8582
|
-
if (!answered.ok) throw new Error(`${where}: the
|
|
8582
|
+
if (!answered.ok) throw new Error(`${where}: the formula could not be checked (${refusalSentence(answered.error)}). Try again.`);
|
|
8583
8583
|
if (!answered.data.ok) {
|
|
8584
8584
|
const at = answered.data.position;
|
|
8585
8585
|
throw new Error(
|
|
@@ -8605,7 +8605,7 @@ async function stepFromAgent(input, index, fields, check) {
|
|
|
8605
8605
|
if (!("value" in input)) throw new Error(`${where} sets a value but has no \`value\` key. Send set: "clear" to empty the column.`);
|
|
8606
8606
|
const value = input["value"];
|
|
8607
8607
|
if (value !== null && !["string", "number", "boolean"].includes(typeof value)) {
|
|
8608
|
-
throw new Error(`${where}.value must be a string, number, boolean or
|
|
8608
|
+
throw new Error(`${where}.value must be a string, number, boolean or empty \u2014 received ${describeJsonShape(value)}.`);
|
|
8609
8609
|
}
|
|
8610
8610
|
return { field: field2.id, set: "value", value };
|
|
8611
8611
|
}
|
|
@@ -8808,7 +8808,7 @@ var import_first_page2 = require("@ai-matrx/records/first-page");
|
|
|
8808
8808
|
var import_data = require("@ai-matrx/records/data");
|
|
8809
8809
|
function sortRefusal(f) {
|
|
8810
8810
|
if (!computedOnRead(f)) return null;
|
|
8811
|
-
return `${fieldName(f)} is worked out each time it is read, so the
|
|
8811
|
+
return `${fieldName(f)} is worked out each time it is read, so the whole table cannot be sorted by it. Sort by a column it is worked out from.`;
|
|
8812
8812
|
}
|
|
8813
8813
|
function sortAndFilterRefusal(f) {
|
|
8814
8814
|
if (sortRefusal(f) === null) return null;
|
|
@@ -8816,7 +8816,7 @@ function sortAndFilterRefusal(f) {
|
|
|
8816
8816
|
}
|
|
8817
8817
|
function filterRefusal(f) {
|
|
8818
8818
|
if (!computedOnRead(f)) return null;
|
|
8819
|
-
return `${fieldName(f)} is worked out each time it is read, so the
|
|
8819
|
+
return `${fieldName(f)} is worked out each time it is read, so the whole table cannot be filtered by it. Filter by a column it is worked out from.`;
|
|
8820
8820
|
}
|
|
8821
8821
|
function computedOnRead(f) {
|
|
8822
8822
|
const kind2 = String(editorKindFor(f));
|
|
@@ -8908,7 +8908,7 @@ function clauseFor(f, value, now = /* @__PURE__ */ new Date()) {
|
|
|
8908
8908
|
};
|
|
8909
8909
|
}
|
|
8910
8910
|
default:
|
|
8911
|
-
return `${name} cannot be filtered that way
|
|
8911
|
+
return `${name} cannot be filtered that way.`;
|
|
8912
8912
|
}
|
|
8913
8913
|
}
|
|
8914
8914
|
function dayWindow(day2, holdsDays) {
|
|
@@ -11481,7 +11481,7 @@ function whyNotRetypeable(field2) {
|
|
|
11481
11481
|
if (kind2 === "attachment") return "Holds files, so its kind is not changed here.";
|
|
11482
11482
|
if (kind2 === "relation" || kind2 === "entity_reference") return "Links to records, so its kind is not changed here.";
|
|
11483
11483
|
if (kind2 === "formula" || kind2 === "lookup" || kind2 === "rollup" || String(field2.type) === "formula") {
|
|
11484
|
-
return "
|
|
11484
|
+
return "Calculated by the table, so its kind is not changed here.";
|
|
11485
11485
|
}
|
|
11486
11486
|
return "Its kind is not changed here.";
|
|
11487
11487
|
}
|
|
@@ -11703,7 +11703,7 @@ function rowLabelRefusal(field2) {
|
|
|
11703
11703
|
if (!field2) return "This column is not one of the table's own.";
|
|
11704
11704
|
const kind2 = String(field2.type);
|
|
11705
11705
|
if (kind2 === "formula" || kind2 === "lookup" || kind2 === "rollup") {
|
|
11706
|
-
return `${fieldName(field2)} is
|
|
11706
|
+
return `${fieldName(field2)} is calculated, and a record is named by a column people fill in.`;
|
|
11707
11707
|
}
|
|
11708
11708
|
if (kind2 === "relation") return `${fieldName(field2)} points at other records; a record is named by its own words.`;
|
|
11709
11709
|
return void 0;
|
|
@@ -11773,7 +11773,7 @@ function headerMenuItems(columnId2, ctx) {
|
|
|
11773
11773
|
id: "col-clean",
|
|
11774
11774
|
label: "Clean column\u2026",
|
|
11775
11775
|
icon: "paintbrush",
|
|
11776
|
-
disabledReason: !a.cleanColumn ? NOT_HERE : !ctx.typeable(columnId2) ? `${columnWords(ctx, columnId2)} is
|
|
11776
|
+
disabledReason: !a.cleanColumn ? NOT_HERE : !ctx.typeable(columnId2) ? `${columnWords(ctx, columnId2)} is calculated; nobody types it.` : field2 && !ctx.cleanable?.(field2) ? "Only a text column can be cleaned." : void 0,
|
|
11777
11777
|
onSelect: () => a.cleanColumn?.(columnId2)
|
|
11778
11778
|
},
|
|
11779
11779
|
{
|
|
@@ -11822,7 +11822,7 @@ function cellSection(payload, ctx) {
|
|
|
11822
11822
|
const { rowId, columnId: columnId2 } = payload;
|
|
11823
11823
|
const mayWrite = ctx.mayWriteRow(rowId);
|
|
11824
11824
|
const typeable = ctx.typeable(columnId2);
|
|
11825
|
-
const why = !mayWrite ? ctx.whyNotWrite(rowId) : !typeable ? `${columnWords(ctx, columnId2)} is
|
|
11825
|
+
const why = !mayWrite ? ctx.whyNotWrite(rowId) : !typeable ? `${columnWords(ctx, columnId2)} is calculated; nobody types it.` : void 0;
|
|
11826
11826
|
const items = [
|
|
11827
11827
|
{
|
|
11828
11828
|
id: "cell-cut",
|
|
@@ -11915,7 +11915,6 @@ function rowSection(rowId, ctx, rowText) {
|
|
|
11915
11915
|
{
|
|
11916
11916
|
id: "row-print-layout",
|
|
11917
11917
|
label: "Print with layout\u2026",
|
|
11918
|
-
icon: "printer",
|
|
11919
11918
|
separatorBefore: true,
|
|
11920
11919
|
// Reading a record to print it never needs write access.
|
|
11921
11920
|
disabledReason: a.printRow ? void 0 : NOT_HERE,
|
|
@@ -12007,7 +12006,7 @@ function allSections(payload, ctx, rowText) {
|
|
|
12007
12006
|
const n = payload.cellCount;
|
|
12008
12007
|
const blocked = payload.rowIds.find((id) => !ctx.mayWriteRow(id));
|
|
12009
12008
|
const untypeable = payload.columnIds.find((id) => !ctx.typeable(id));
|
|
12010
|
-
const why = blocked ? ctx.whyNotWrite(blocked) : untypeable ? `${columnWords(ctx, untypeable)} is
|
|
12009
|
+
const why = blocked ? ctx.whyNotWrite(blocked) : untypeable ? `${columnWords(ctx, untypeable)} is calculated; nobody types it.` : void 0;
|
|
12011
12010
|
const cells = payload.rowIds.flatMap((rowId) => payload.columnIds.map((columnId2) => ({ rowId, columnId: columnId2 })));
|
|
12012
12011
|
return [
|
|
12013
12012
|
{
|
|
@@ -12256,7 +12255,7 @@ function FormulaTextEditor({
|
|
|
12256
12255
|
] }),
|
|
12257
12256
|
STORE_FORMULA_FUNCTION_NAMES.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("details", { className: "text-[11px] text-muted-foreground", children: [
|
|
12258
12257
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("summary", { className: "cursor-pointer", children: [
|
|
12259
|
-
"Functions
|
|
12258
|
+
"Functions you can use (",
|
|
12260
12259
|
STORE_FORMULA_FUNCTION_NAMES.length,
|
|
12261
12260
|
")"
|
|
12262
12261
|
] }),
|
|
@@ -14387,7 +14386,9 @@ var { viewSettings, viewSettingsPatch } = boundViews;
|
|
|
14387
14386
|
|
|
14388
14387
|
// src/firstPage.ts
|
|
14389
14388
|
var import_first_page5 = require("@ai-matrx/records/first-page");
|
|
14390
|
-
var
|
|
14389
|
+
var boundFirstPage = (0, import_first_page4.bindFirstPageCodec)(gridPresentationCodec);
|
|
14390
|
+
var firstGridPageRequest = boundFirstPage.firstGridPageRequest;
|
|
14391
|
+
var askTablePageSeed = boundFirstPage.askTablePageSeed;
|
|
14391
14392
|
|
|
14392
14393
|
// src/embeddedLook.tsx
|
|
14393
14394
|
var EMBEDDED_LOOK = { blankEmpty: true, choiceDot: true, plainRelation: true };
|
|
@@ -15508,12 +15509,7 @@ function formulaDefaultFormat(field2, fields, kindOf, currencyCodeOf) {
|
|
|
15508
15509
|
if (!inputs || inputs.length === 0) return void 0;
|
|
15509
15510
|
const ops = opsOf(exprOf(field2));
|
|
15510
15511
|
if (ops.length === 0 || !ops.every((op2) => ARITHMETIC2.has(op2))) return void 0;
|
|
15511
|
-
|
|
15512
|
-
const look = f.display_format?.id;
|
|
15513
|
-
return typeof look === "string" && ["number", "decimal", "currency", "percent", "integer"].includes(look);
|
|
15514
|
-
};
|
|
15515
|
-
const isNumeric = (f) => NUMERIC_KINDS.has(kindOf(f)) || ["rollup", "lookup", "formula"].includes(kindOf(f)) && numericLookOf(f);
|
|
15516
|
-
if (!inputs.every(isNumeric)) return void 0;
|
|
15512
|
+
if (!inputs.every((f) => NUMERIC_KINDS.has(kindOf(f)))) return void 0;
|
|
15517
15513
|
const precisions = inputs.map((f) => f.display_format?.options?.precision).filter((p) => typeof p === "number");
|
|
15518
15514
|
const precision = precisions.length > 0 ? Math.max(...precisions) : 2;
|
|
15519
15515
|
const lookOf2 = (f) => f.display_format;
|
|
@@ -17521,13 +17517,13 @@ function FieldFormatPicker({
|
|
|
17521
17517
|
...groups.flatMap((g) => g.formats.map((d) => ({ value: d.id, label: d.label, group: g.group }))),
|
|
17522
17518
|
...otherKinds.map(({ def }) => ({
|
|
17523
17519
|
value: def.id,
|
|
17524
|
-
label: `${def.label} \xB7
|
|
17525
|
-
group: "Other kinds \xB7 changes what the column
|
|
17520
|
+
label: `${def.label} \xB7 holds ${storesWord(def)}`,
|
|
17521
|
+
group: "Other kinds \xB7 changes what the column holds"
|
|
17526
17522
|
}))
|
|
17527
17523
|
]
|
|
17528
17524
|
}
|
|
17529
17525
|
),
|
|
17530
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-[11px] text-muted-foreground", children: retypedTo ? `This changes what the column
|
|
17526
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-[11px] text-muted-foreground", children: retypedTo ? `This changes what the column holds, to ${storesWord(retypedTo.def)}. Each value that can convert does; you are told before anything that cannot is lost.` : active ? active.description : "How every value in this column is written, wherever it appears." }),
|
|
17531
17527
|
optionKeys.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-wrap items-end gap-2", children: [
|
|
17532
17528
|
option(
|
|
17533
17529
|
"currency",
|
|
@@ -17677,7 +17673,7 @@ function tableArchiveSentence(s) {
|
|
|
17677
17673
|
const done = p.total - p.remaining;
|
|
17678
17674
|
const sofar = `${(0, import_format3.formatCount)(done)} of ${recordsWord(p.total)} ${done === 1 ? "is" : "are"} put away`;
|
|
17679
17675
|
if (s.running) {
|
|
17680
|
-
return `Archiving \u2014 ${(0, import_format3.formatCount)(done)} of ${recordsWord(p.total)} put away.${s.slowedDown ? "
|
|
17676
|
+
return `Archiving \u2014 ${(0, import_format3.formatCount)(done)} of ${recordsWord(p.total)} put away.${s.slowedDown ? " Busy, so it is taking smaller passes; it will still finish." : ""}`;
|
|
17681
17677
|
}
|
|
17682
17678
|
if (p.in_progress && !s.failed && !(s.passesHere ?? 0)) {
|
|
17683
17679
|
return `Archiving this table was started and not finished: ${sofar}. Carry on and it picks up where it stopped.`;
|
|
@@ -18136,8 +18132,8 @@ function keyFor(label) {
|
|
|
18136
18132
|
if (token2 === "") return "";
|
|
18137
18133
|
return /^[a-z]/.test(token2) ? token2 : `f_${token2}`;
|
|
18138
18134
|
}
|
|
18139
|
-
var COLUMN_DID_NOT_LAND_SENTENCE = "The
|
|
18140
|
-
var COLUMN_DID_NOT_LAND_REMEDY = "Press Save again; if it keeps happening, tell us
|
|
18135
|
+
var COLUMN_DID_NOT_LAND_SENTENCE = "The column was accepted but the table does not have it yet. Nothing was lost \u2014 your record values are untouched \u2014 but the column is not there, so this panel is staying open.";
|
|
18136
|
+
var COLUMN_DID_NOT_LAND_REMEDY = "Press Save again; if it keeps happening, tell us \u2014 that is ours to fix.";
|
|
18141
18137
|
var COLUMN_DID_NOT_LAND = `${COLUMN_DID_NOT_LAND_SENTENCE} ${COLUMN_DID_NOT_LAND_REMEDY}`;
|
|
18142
18138
|
function FieldEditor(props) {
|
|
18143
18139
|
const { field: field2, onSaved, onCancel, onRemoved, className } = props;
|
|
@@ -18937,7 +18933,7 @@ function FieldEditor(props) {
|
|
|
18937
18933
|
{
|
|
18938
18934
|
error: (0, refusals_exports.refusal)(
|
|
18939
18935
|
"internal",
|
|
18940
|
-
onEntity ? "The
|
|
18936
|
+
onEntity ? "The field was accepted but these records do not have it yet. Nothing was lost, and this panel is staying open." : COLUMN_DID_NOT_LAND_SENTENCE,
|
|
18941
18937
|
COLUMN_DID_NOT_LAND_REMEDY
|
|
18942
18938
|
)
|
|
18943
18939
|
}
|
|
@@ -20296,7 +20292,7 @@ function FieldControl({ field: field2, value, onChange, disabled, id, autoOpen,
|
|
|
20296
20292
|
value === null || value === void 0 ? "\u2014" : String(value),
|
|
20297
20293
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("span", { className: "ml-2 italic", children: [
|
|
20298
20294
|
fieldName(field2),
|
|
20299
|
-
" is
|
|
20295
|
+
" is calculated, so it cannot be typed in"
|
|
20300
20296
|
] })
|
|
20301
20297
|
] });
|
|
20302
20298
|
case "json":
|
|
@@ -21025,7 +21021,7 @@ init_host();
|
|
|
21025
21021
|
var import_format4 = require("@ai-matrx/kit/format");
|
|
21026
21022
|
var import_text_case8 = require("@ai-matrx/kit/text-case");
|
|
21027
21023
|
var SOMEBODY = "somebody in this organization";
|
|
21028
|
-
var THE_SYSTEM = "
|
|
21024
|
+
var THE_SYSTEM = "Matrx";
|
|
21029
21025
|
function actorWords(actor, resolve) {
|
|
21030
21026
|
if (actor.kind === "system") return THE_SYSTEM;
|
|
21031
21027
|
const named = actor.name?.trim() || (actor.user_id && resolve ? resolve(actor.user_id)?.trim() : null) || null;
|
|
@@ -21547,7 +21543,7 @@ function useGridEditing({ tableId, fields, rows, reload, reloadAfterWrite, canWr
|
|
|
21547
21543
|
error: {
|
|
21548
21544
|
// A throw while the browser is offline never reached the store: it is sent again.
|
|
21549
21545
|
code: browserIsOffline() ? "unreachable" : "internal",
|
|
21550
|
-
message: "This
|
|
21546
|
+
message: "This was not saved.",
|
|
21551
21547
|
hint: thrown instanceof Error ? thrown.message : String(thrown)
|
|
21552
21548
|
}
|
|
21553
21549
|
};
|
|
@@ -21906,7 +21902,7 @@ function GridCell({
|
|
|
21906
21902
|
const sayWhyNot = () => {
|
|
21907
21903
|
if (Date.now() - saidAt.current < 4e3) return;
|
|
21908
21904
|
saidAt.current = Date.now();
|
|
21909
|
-
const why = fieldIsEditable(field2) ? `${fieldName(field2)} \u2014 ${whyNot ?? "you cannot change this record"}` : `${fieldName(field2)} is
|
|
21905
|
+
const why = fieldIsEditable(field2) ? `${fieldName(field2)} \u2014 ${whyNot ?? "you cannot change this record"}` : `${fieldName(field2)} is calculated, so it cannot be typed in`;
|
|
21910
21906
|
ui.notify?.error(why);
|
|
21911
21907
|
};
|
|
21912
21908
|
const open = Boolean(
|
|
@@ -22089,7 +22085,7 @@ function GridCell({
|
|
|
22089
22085
|
// words. The editor was never offered, so nothing is refused
|
|
22090
22086
|
// after it has been typed into.
|
|
22091
22087
|
`${fieldName(field2)} \u2014 ${whyNot ?? "you cannot change this record"}`
|
|
22092
|
-
) : `${fieldName(field2)} is
|
|
22088
|
+
) : `${fieldName(field2)} is calculated, so it cannot be typed in`,
|
|
22093
22089
|
className: (0, import_design_system57.cn)(
|
|
22094
22090
|
// `w-full` so the whole cell is the control. A gap beside it is bare
|
|
22095
22091
|
// table cell, and a click there is a row click.
|
|
@@ -23349,7 +23345,7 @@ function PersonNamesBridge() {
|
|
|
23349
23345
|
init_host();
|
|
23350
23346
|
init_rights();
|
|
23351
23347
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
23352
|
-
var STORE_DECIDES_REASON = "This host offers exactly what
|
|
23348
|
+
var STORE_DECIDES_REASON = "This host offers exactly what this person may do, so a control they cannot use is never drawn in the first place.";
|
|
23353
23349
|
function storeDecidesRights(_table) {
|
|
23354
23350
|
return NO_RIGHTS;
|
|
23355
23351
|
}
|
|
@@ -23814,12 +23810,12 @@ var import_react120 = require("react");
|
|
|
23814
23810
|
var import_design_system63 = require("@ai-matrx/design-system");
|
|
23815
23811
|
var import_document = require("@ai-matrx/print/document");
|
|
23816
23812
|
init_FilePicker();
|
|
23813
|
+
init_PickOne();
|
|
23817
23814
|
init_docs();
|
|
23818
23815
|
init_names();
|
|
23819
23816
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
23820
23817
|
var LOGO_FILE_LIMIT = 200 * 1024;
|
|
23821
23818
|
var SLOTS = ["left", "center", "right"];
|
|
23822
|
-
var SELECT2 = "h-7 rounded-md border bg-background px-1.5 text-xs";
|
|
23823
23819
|
function readAsDataUrl(file) {
|
|
23824
23820
|
return new Promise((resolve, reject) => {
|
|
23825
23821
|
const reader = new FileReader();
|
|
@@ -23850,17 +23846,32 @@ function LayoutPageSettings({ value, onChange, fields }) {
|
|
|
23850
23846
|
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
23851
23847
|
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("label", { className: "flex items-center gap-1 text-xs", children: [
|
|
23852
23848
|
"Size",
|
|
23853
|
-
/* @__PURE__ */ (0, import_jsx_runtime76.
|
|
23854
|
-
|
|
23855
|
-
|
|
23856
|
-
|
|
23849
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
23850
|
+
PickOne,
|
|
23851
|
+
{
|
|
23852
|
+
label: "Page size",
|
|
23853
|
+
attrs: { "data-layout-size": "" },
|
|
23854
|
+
value: value.size,
|
|
23855
|
+
onChange: (size) => set({ size }),
|
|
23856
|
+
options: [{ value: "", label: "Default" }, ...Object.entries(import_document.PAGE_SIZES).map(([name, size]) => ({ value: name, label: size.label }))]
|
|
23857
|
+
}
|
|
23858
|
+
)
|
|
23857
23859
|
] }),
|
|
23858
23860
|
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("label", { className: "flex items-center gap-1 text-xs", children: [
|
|
23859
23861
|
"Orientation",
|
|
23860
|
-
/* @__PURE__ */ (0, import_jsx_runtime76.
|
|
23861
|
-
|
|
23862
|
-
|
|
23863
|
-
|
|
23862
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
23863
|
+
PickOne,
|
|
23864
|
+
{
|
|
23865
|
+
label: "Orientation",
|
|
23866
|
+
attrs: { "data-layout-orientation": "" },
|
|
23867
|
+
value: value.orientation,
|
|
23868
|
+
onChange: (orientation) => set({ orientation }),
|
|
23869
|
+
options: [
|
|
23870
|
+
{ value: "portrait", label: "Portrait" },
|
|
23871
|
+
{ value: "landscape", label: "Landscape" }
|
|
23872
|
+
]
|
|
23873
|
+
}
|
|
23874
|
+
)
|
|
23864
23875
|
] })
|
|
23865
23876
|
] }),
|
|
23866
23877
|
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
@@ -23868,20 +23879,17 @@ function LayoutPageSettings({ value, onChange, fields }) {
|
|
|
23868
23879
|
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
23869
23880
|
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("label", { className: "flex items-center gap-1 text-xs", children: [
|
|
23870
23881
|
"From a field",
|
|
23871
|
-
/* @__PURE__ */ (0, import_jsx_runtime76.
|
|
23872
|
-
|
|
23882
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
23883
|
+
PickOne,
|
|
23873
23884
|
{
|
|
23874
|
-
|
|
23875
|
-
"data-layout-logo-field": "",
|
|
23885
|
+
label: "Logo from a field",
|
|
23886
|
+
attrs: { "data-layout-logo-field": "" },
|
|
23876
23887
|
value: value.logo.startsWith("{{") ? value.logo : "",
|
|
23877
|
-
onChange: (
|
|
23888
|
+
onChange: (logo) => {
|
|
23878
23889
|
setLogoNote(null);
|
|
23879
|
-
set({ logo
|
|
23890
|
+
set({ logo });
|
|
23880
23891
|
},
|
|
23881
|
-
|
|
23882
|
-
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("option", { value: "", children: "None" }),
|
|
23883
|
-
fields.map((f) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("option", { value: fieldToken(f.id), children: fieldName(f) }, f.id))
|
|
23884
|
-
]
|
|
23892
|
+
options: [{ value: "", label: "None" }, ...fields.map((f) => ({ value: fieldToken(f.id), label: fieldName(f) }))]
|
|
23885
23893
|
}
|
|
23886
23894
|
)
|
|
23887
23895
|
] }),
|
|
@@ -23929,10 +23937,17 @@ function LayoutPageSettings({ value, onChange, fields }) {
|
|
|
23929
23937
|
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("label", { className: "flex items-center gap-1 text-xs", children: [
|
|
23930
23938
|
"Put a field in the ",
|
|
23931
23939
|
focused.replace("-", " "),
|
|
23932
|
-
/* @__PURE__ */ (0, import_jsx_runtime76.
|
|
23933
|
-
|
|
23934
|
-
|
|
23935
|
-
|
|
23940
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
23941
|
+
PickOne,
|
|
23942
|
+
{
|
|
23943
|
+
label: "Field to put in",
|
|
23944
|
+
placeholder: "Choose a field",
|
|
23945
|
+
attrs: { "data-layout-insert": "" },
|
|
23946
|
+
value: "",
|
|
23947
|
+
onChange: insert,
|
|
23948
|
+
options: fields.map((f) => ({ value: f.id, label: fieldName(f) }))
|
|
23949
|
+
}
|
|
23950
|
+
)
|
|
23936
23951
|
] })
|
|
23937
23952
|
] });
|
|
23938
23953
|
}
|
|
@@ -24672,7 +24687,7 @@ function useGridColours(args) {
|
|
|
24672
24687
|
] }) : null;
|
|
24673
24688
|
return { headerItem, cellItem, cellsItem, rowItem, dialogs, sheet };
|
|
24674
24689
|
}
|
|
24675
|
-
var
|
|
24690
|
+
var SELECT2 = "h-8";
|
|
24676
24691
|
var CHOICE_OPS = ["is", "is_not", "is_empty", "not_empty"].filter(
|
|
24677
24692
|
(op2) => import_data_table9.COLOR_RULE_OPS.includes(op2)
|
|
24678
24693
|
);
|
|
@@ -24728,7 +24743,7 @@ function ColourRulesDialog({
|
|
|
24728
24743
|
PickOne,
|
|
24729
24744
|
{
|
|
24730
24745
|
label: "Where the rules are kept",
|
|
24731
|
-
className:
|
|
24746
|
+
className: SELECT2,
|
|
24732
24747
|
value: scope,
|
|
24733
24748
|
onChange: (picked) => {
|
|
24734
24749
|
setScope(picked === "view" ? "view" : "table");
|
|
@@ -24748,7 +24763,7 @@ function ColourRulesDialog({
|
|
|
24748
24763
|
PickOne,
|
|
24749
24764
|
{
|
|
24750
24765
|
label: "Column",
|
|
24751
|
-
className:
|
|
24766
|
+
className: SELECT2,
|
|
24752
24767
|
value: rule.field,
|
|
24753
24768
|
onChange: (picked) => set(i, { field: picked }),
|
|
24754
24769
|
options: fields.map((f) => ({ value: f.key, label: fieldName(f) }))
|
|
@@ -24759,7 +24774,7 @@ function ColourRulesDialog({
|
|
|
24759
24774
|
{
|
|
24760
24775
|
label: "Test",
|
|
24761
24776
|
attrs: { "data-records-colour-rule-op": "" },
|
|
24762
|
-
className:
|
|
24777
|
+
className: SELECT2,
|
|
24763
24778
|
value: rule.op,
|
|
24764
24779
|
onChange: (picked) => set(i, { op: picked }),
|
|
24765
24780
|
options: opsFor(rule.field).map((op2) => ({
|
|
@@ -24773,7 +24788,7 @@ function ColourRulesDialog({
|
|
|
24773
24788
|
{
|
|
24774
24789
|
label: "Choice",
|
|
24775
24790
|
attrs: { "data-records-colour-rule-choice": "" },
|
|
24776
|
-
className:
|
|
24791
|
+
className: SELECT2,
|
|
24777
24792
|
placeholder: "Pick a choice",
|
|
24778
24793
|
value: optionFor(choicesOf(rule.field), rule.value)?.id ?? "",
|
|
24779
24794
|
onChange: (picked) => set(i, { value: picked }),
|
|
@@ -24794,7 +24809,7 @@ function ColourRulesDialog({
|
|
|
24794
24809
|
PickOne,
|
|
24795
24810
|
{
|
|
24796
24811
|
label: "Tint",
|
|
24797
|
-
className:
|
|
24812
|
+
className: SELECT2,
|
|
24798
24813
|
value: rule.target,
|
|
24799
24814
|
onChange: (picked) => set(i, { target: picked }),
|
|
24800
24815
|
options: [
|
|
@@ -24808,7 +24823,7 @@ function ColourRulesDialog({
|
|
|
24808
24823
|
{
|
|
24809
24824
|
label: "Colour",
|
|
24810
24825
|
attrs: { "data-records-colour-rule-color": "" },
|
|
24811
|
-
className:
|
|
24826
|
+
className: SELECT2,
|
|
24812
24827
|
value: rule.color,
|
|
24813
24828
|
onChange: (picked) => set(i, { color: picked }),
|
|
24814
24829
|
options: import_data_table9.STYLE_COLORS.map((c) => ({ value: c, label: import_data_table9.STYLE_COLOR_LABELS[c] }))
|
|
@@ -24861,25 +24876,6 @@ init_host();
|
|
|
24861
24876
|
init_Refusal();
|
|
24862
24877
|
init_plainWords();
|
|
24863
24878
|
|
|
24864
|
-
// src/pressWords.ts
|
|
24865
|
-
init_parity();
|
|
24866
|
-
var PRESS_WORDS = { now: "@now", today: "@today", me: "@me" };
|
|
24867
|
-
function pressWordsFor(value) {
|
|
24868
|
-
if (value === PRESS_WORDS.now) return "now, when it is pressed";
|
|
24869
|
-
if (value === PRESS_WORDS.me) return "whoever presses it";
|
|
24870
|
-
if (value === PRESS_WORDS.today) return "today, when it is pressed";
|
|
24871
|
-
const m = typeof value === "string" ? /^@today([+-])(\d{1,4})([dwmyb])$/.exec(value) : null;
|
|
24872
|
-
if (m) return `${m[2]} ${{ d: "day", w: "week", m: "month", y: "year", b: "business day" }[m[3]]}${m[2] === "1" ? "" : "s"} ${m[1] === "+" ? "after" : "before"} the day it is pressed`;
|
|
24873
|
-
return null;
|
|
24874
|
-
}
|
|
24875
|
-
function pressChoicesFor(field2) {
|
|
24876
|
-
if (!field2) return [];
|
|
24877
|
-
const kind2 = editorKindFor(field2);
|
|
24878
|
-
if (kind2 === "datetime") return ["now", "today"];
|
|
24879
|
-
if (kind2 === "member") return ["me"];
|
|
24880
|
-
return [];
|
|
24881
|
-
}
|
|
24882
|
-
|
|
24883
24879
|
// src/rowActionPreview.tsx
|
|
24884
24880
|
var import_react127 = require("react");
|
|
24885
24881
|
var import_react128 = require("@ai-matrx/records/react");
|
|
@@ -24915,9 +24911,8 @@ function previewActionOnRecord(steps, row, fields) {
|
|
|
24915
24911
|
formula: step2.formula_text
|
|
24916
24912
|
};
|
|
24917
24913
|
}
|
|
24918
|
-
const
|
|
24919
|
-
|
|
24920
|
-
return { key: field2.key, name: fieldName(field2), before, after, how: "value", changed: press !== null || !same2(before, after), computed };
|
|
24914
|
+
const after = step2.value ?? null;
|
|
24915
|
+
return { key: field2.key, name: fieldName(field2), before, after, how: "value", changed: !same2(before, after), computed };
|
|
24921
24916
|
});
|
|
24922
24917
|
return { cells, changedCount: cells.filter((c) => c.changed).length };
|
|
24923
24918
|
}
|
|
@@ -24963,7 +24958,7 @@ function ActionRowPreview({
|
|
|
24963
24958
|
const afterWords = (cell2) => {
|
|
24964
24959
|
if (cell2.how === "compute") {
|
|
24965
24960
|
const reading = cell2.formula ? readings[cell2.formula] : void 0;
|
|
24966
|
-
if (reading && reading.ok === false) return { text: `
|
|
24961
|
+
if (reading && reading.ok === false) return { text: `This formula cannot be read: ${reading.error}`, note: true };
|
|
24967
24962
|
const kind2 = reading && reading.ok ? RESULT_WORDS[reading.result_type] ?? "a value" : "the result";
|
|
24968
24963
|
return { text: `Worked out when it runs \u2014 ${kind2}${cell2.formula ? ` from ${cell2.formula}` : ""}`, note: true };
|
|
24969
24964
|
}
|
|
@@ -25019,7 +25014,7 @@ function ActionRowPreview({
|
|
|
25019
25014
|
]
|
|
25020
25015
|
}
|
|
25021
25016
|
) }),
|
|
25022
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("p", { className: "text-[11px] text-muted-foreground", "data-records-action-preview-count": "", children: preview.changedCount === 0 ? "Nothing on this record would change: every value is already what the action sets." : `${preview.changedCount} of ${preview.cells.length} ${preview.cells.length === 1 ? "cell changes" : "cells change"}.
|
|
25017
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("p", { className: "text-[11px] text-muted-foreground", "data-records-action-preview-count": "", children: preview.changedCount === 0 ? "Nothing on this record would change: every value is already what the action sets." : `${preview.changedCount} of ${preview.cells.length} ${preview.cells.length === 1 ? "cell changes" : "cells change"}. Calculated columns are filled in when it runs.` })
|
|
25023
25018
|
] });
|
|
25024
25019
|
}
|
|
25025
25020
|
|
|
@@ -25090,8 +25085,7 @@ function whatItChanges(action3, fields) {
|
|
|
25090
25085
|
const name = field2 ? fieldName(field2) : "a column this table no longer has";
|
|
25091
25086
|
if (step2.set === "clear") return `clears ${name}`;
|
|
25092
25087
|
if (step2.set === "compute") return `works out ${name}${step2.formula_text ? ` from ${step2.formula_text}` : ""}`;
|
|
25093
|
-
|
|
25094
|
-
return press ? `sets ${name} to ${press}` : `sets ${name} to ${String(step2.value ?? "nothing")}`;
|
|
25088
|
+
return `sets ${name} to ${String(step2.value ?? "nothing")}`;
|
|
25095
25089
|
});
|
|
25096
25090
|
if (names2.length === 0) return "changes nothing it can name";
|
|
25097
25091
|
if (names2.length === 1) return names2[0];
|
|
@@ -25166,7 +25160,7 @@ function useActionRunner(args) {
|
|
|
25166
25160
|
setOutcome({
|
|
25167
25161
|
kind: "undone",
|
|
25168
25162
|
failures,
|
|
25169
|
-
says: failures.length === 0 ? `Put back what ${plural3(outcome.undo.length, noun, nounPlural)} held before ${outcome.action.name}.` : `Put back ${outcome.undo.length - failures.length} of ${outcome.undo.length}; the
|
|
25163
|
+
says: failures.length === 0 ? `Put back what ${plural3(outcome.undo.length, noun, nounPlural)} held before ${outcome.action.name}.` : `Put back ${outcome.undo.length - failures.length} of ${outcome.undo.length}; the rest were refused.`
|
|
25170
25164
|
});
|
|
25171
25165
|
await reload();
|
|
25172
25166
|
}, [client, outcome, reload, noun, nounPlural]);
|
|
@@ -25328,19 +25322,15 @@ function draftOf(action3) {
|
|
|
25328
25322
|
icon: action3.icon,
|
|
25329
25323
|
steps: (action3.steps ?? []).map((s) => ({
|
|
25330
25324
|
field: s.field,
|
|
25331
|
-
set: s.set
|
|
25325
|
+
set: s.set,
|
|
25332
25326
|
value: s.set === "value" ? typeof s.value === "string" ? s.value : shown2(s.value) : "",
|
|
25333
25327
|
formula: s.set === "compute" ? s.formula_text ?? "" : ""
|
|
25334
25328
|
}))
|
|
25335
25329
|
};
|
|
25336
25330
|
}
|
|
25337
|
-
function pressChoiceOf(value) {
|
|
25338
|
-
return Object.keys(PRESS_WORDS).find((k) => PRESS_WORDS[k] === value) ?? null;
|
|
25339
|
-
}
|
|
25340
25331
|
function stepOf(step2, original) {
|
|
25341
25332
|
const field2 = step2.field;
|
|
25342
25333
|
if (step2.set === "clear") return { field: field2, set: "clear" };
|
|
25343
|
-
if (step2.set === "now" || step2.set === "today" || step2.set === "me") return { field: field2, set: "value", value: PRESS_WORDS[step2.set] };
|
|
25344
25334
|
if (step2.set === "compute") {
|
|
25345
25335
|
if (!step2.formula.trim() && original?.set === "compute" && original.expr) return { field: field2, set: "compute", expr: original.expr };
|
|
25346
25336
|
return { field: field2, set: "compute", formula_text: step2.formula };
|
|
@@ -25739,25 +25729,14 @@ function ActionForm({
|
|
|
25739
25729
|
] }),
|
|
25740
25730
|
draft.steps.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime82.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,
|
|
25741
25731
|
draft.steps.map((step2, index) => /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "flex flex-wrap items-center gap-1", "data-records-action-step": index, children: [
|
|
25742
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
25743
|
-
import_design_system69.
|
|
25744
|
-
{
|
|
25745
|
-
|
|
25746
|
-
onValueChange: (v) => {
|
|
25747
|
-
const offered = pressChoicesFor(fields.find((f) => f.id === v));
|
|
25748
|
-
setStep(index, { field: v, ...step2.set === "now" || step2.set === "today" || step2.set === "me" ? offered.includes(step2.set) ? {} : { set: "value", value: "" } : {} });
|
|
25749
|
-
},
|
|
25750
|
-
children: [
|
|
25751
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system69.SelectTrigger, { size: "sm", "aria-label": `Column for change ${index + 1}`, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system69.SelectValue, { placeholder: "Column" }) }),
|
|
25752
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system69.SelectContent, { children: settable2.map((f) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system69.SelectItem, { value: f.id, children: fieldName(f) }, f.id)) })
|
|
25753
|
-
]
|
|
25754
|
-
}
|
|
25755
|
-
),
|
|
25732
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_design_system69.Select, { value: step2.field, onValueChange: (v) => setStep(index, { field: v }), children: [
|
|
25733
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system69.SelectTrigger, { size: "sm", "aria-label": `Column for change ${index + 1}`, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system69.SelectValue, { placeholder: "Column" }) }),
|
|
25734
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system69.SelectContent, { children: settable2.map((f) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system69.SelectItem, { value: f.id, children: fieldName(f) }, f.id)) })
|
|
25735
|
+
] }),
|
|
25756
25736
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_design_system69.Select, { value: step2.set, onValueChange: (v) => setStep(index, { set: v }), children: [
|
|
25757
25737
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system69.SelectTrigger, { size: "sm", "aria-label": `How change ${index + 1} sets it`, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system69.SelectValue, {}) }),
|
|
25758
25738
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_design_system69.SelectContent, { children: [
|
|
25759
25739
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system69.SelectItem, { value: "value", children: "Set to" }),
|
|
25760
|
-
pressChoicesFor(fields.find((f) => f.id === step2.field)).map((choice) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system69.SelectItem, { value: choice, children: { now: "Now", today: "Today", me: "Me" }[choice] }, choice)),
|
|
25761
25740
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system69.SelectItem, { value: "clear", children: "Clear" }),
|
|
25762
25741
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system69.SelectItem, { value: "compute", children: "Work out" })
|
|
25763
25742
|
] })
|
|
@@ -26041,7 +26020,7 @@ function SummaryCell({
|
|
|
26041
26020
|
// while its menu is open; the header menu's "Summarize column" is the other door.
|
|
26042
26021
|
chosen ? "text-foreground" : "text-muted-foreground opacity-0 hover:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100"
|
|
26043
26022
|
),
|
|
26044
|
-
title: chosen && rowCount !== null ? `${label} of ${fieldName(field2)},
|
|
26023
|
+
title: chosen && rowCount !== null ? `${label} of ${fieldName(field2)}, over all ${rowCount} record${rowCount === 1 ? "" : "s"} \u2014 not only this page.` : `Summarize ${fieldName(field2)}`,
|
|
26045
26024
|
children: chosen ? /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_jsx_runtime84.Fragment, { children: [
|
|
26046
26025
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "text-muted-foreground", children: label }),
|
|
26047
26026
|
summaries.withheld[field2.key] ? (
|
|
@@ -26053,7 +26032,7 @@ function SummaryCell({
|
|
|
26053
26032
|
) }),
|
|
26054
26033
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_design_system71.DropdownMenuContent, { align: "start", children: [
|
|
26055
26034
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_design_system71.DropdownMenuLabel, { className: "text-xs", children: fieldName(field2) }),
|
|
26056
|
-
offered === null ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_design_system71.DropdownMenuLabel, { className: "text-xs font-normal text-muted-foreground", children: "
|
|
26035
|
+
offered === null ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_design_system71.DropdownMenuLabel, { className: "text-xs font-normal text-muted-foreground", children: "Loading measures\u2026" }) : offered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_design_system71.DropdownMenuLabel, { className: "text-xs font-normal text-muted-foreground", children: "No measure for this column." }) : offered.map((op2) => /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
26057
26036
|
import_design_system71.DropdownMenuItem,
|
|
26058
26037
|
{
|
|
26059
26038
|
"data-records-summary-choice": op2,
|
|
@@ -26077,9 +26056,9 @@ function summaryMenuItem(field2, firstColumn, chosen, operations, onChoose) {
|
|
|
26077
26056
|
id: "col-summary",
|
|
26078
26057
|
label,
|
|
26079
26058
|
icon: "sigma",
|
|
26080
|
-
...offered !== null && offered.length === 0 && !chosen ? { disabledReason: "
|
|
26059
|
+
...offered !== null && offered.length === 0 && !chosen ? { disabledReason: "No measure for this column." } : {},
|
|
26081
26060
|
submenu: [
|
|
26082
|
-
...offered === null ? [{ id: "col-summary-asking", label: "
|
|
26061
|
+
...offered === null ? [{ id: "col-summary-asking", label: "Loading measures\u2026", disabledReason: "One moment." }] : offered.map((op2) => ({
|
|
26083
26062
|
id: `col-summary-${op2}`,
|
|
26084
26063
|
label: op2 === chosen ? `${MEASURE_LABEL[op2] ?? op2} (now)` : MEASURE_LABEL[op2] ?? op2,
|
|
26085
26064
|
onSelect: () => onChoose(op2)
|
|
@@ -26121,7 +26100,7 @@ function SummarySheetControls({
|
|
|
26121
26100
|
}))
|
|
26122
26101
|
}
|
|
26123
26102
|
) }),
|
|
26124
|
-
field2 ? offered === null ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "text-xs text-muted-foreground", children: "
|
|
26103
|
+
field2 ? offered === null ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "text-xs text-muted-foreground", children: "Loading measures\u2026" }) : offered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "text-xs text-muted-foreground", children: "No measure for this column." }) : /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
26125
26104
|
PickOne,
|
|
26126
26105
|
{
|
|
26127
26106
|
label: "Summarize as",
|
|
@@ -27400,7 +27379,7 @@ function useMergedGridControls(args) {
|
|
|
27400
27379
|
},
|
|
27401
27380
|
variant: "destructive",
|
|
27402
27381
|
title: dialog?.kind === "backlink" ? backLinkTitle(dialog.column) : "A linked column",
|
|
27403
|
-
description: dialog?.kind === "backlink" ? mutation.error ? `
|
|
27382
|
+
description: dialog?.kind === "backlink" ? mutation.error ? `Saved: ${refusalSentence(mutation.error)}` : backLinkSentence(dialog.column, readersThrough(fields, dialog.column.key), table?.name ?? null) : "",
|
|
27404
27383
|
confirmLabel: dialog?.kind === "backlink" ? `Archive ${dialog.column.source_field_label}` : "Archive",
|
|
27405
27384
|
cancelLabel: "Keep",
|
|
27406
27385
|
busy: deleteBusy,
|
|
@@ -27428,7 +27407,7 @@ function useMergedGridControls(args) {
|
|
|
27428
27407
|
},
|
|
27429
27408
|
variant: "destructive",
|
|
27430
27409
|
title: dialog?.kind === "delete" ? `Delete the ${fieldName(dialog.field)} column?` : "Delete this column?",
|
|
27431
|
-
description: mutation.error && dialog?.kind === "delete" ? `
|
|
27410
|
+
description: mutation.error && dialog?.kind === "delete" ? `Column saved: ${refusalSentence(mutation.error)}` : "Removes it from the table and every view. Its values stay in record history; anything still using it is named.",
|
|
27432
27411
|
confirmLabel: "Delete column",
|
|
27433
27412
|
cancelLabel: "Keep",
|
|
27434
27413
|
busy: deleteBusy,
|
|
@@ -27723,7 +27702,7 @@ function CustomFieldsSection({
|
|
|
27723
27702
|
if (!back.ok || !(back.data?.fields ?? []).some((f) => f.id === declared2.data)) {
|
|
27724
27703
|
return {
|
|
27725
27704
|
ok: false,
|
|
27726
|
-
message: `
|
|
27705
|
+
message: `"${label}" was saved but this record does not show it yet. Nothing was lost \u2014 read the page again before adding it a second time.`
|
|
27727
27706
|
};
|
|
27728
27707
|
}
|
|
27729
27708
|
return { ok: true, field_id: declared2.data, label, type };
|
|
@@ -29716,14 +29695,14 @@ function workedOutFrom(field2) {
|
|
|
29716
29695
|
if (kind2 !== "formula" && kind2 !== "lookup" && kind2 !== "rollup") return null;
|
|
29717
29696
|
const config = field2.config ?? {};
|
|
29718
29697
|
const text = typeof config["formula_text"] === "string" ? config["formula_text"].trim() : "";
|
|
29719
|
-
if (text !== "") return `
|
|
29698
|
+
if (text !== "") return `Calculated from ${text}. Nobody types it.`;
|
|
29720
29699
|
const system = config["system"];
|
|
29721
|
-
if (system === "autonumber") return "
|
|
29722
|
-
if (system === "created_time") return "When the record was made
|
|
29723
|
-
if (system === "modified_time") return "When the record last changed
|
|
29724
|
-
if (kind2 === "lookup") return "Read
|
|
29725
|
-
if (kind2 === "rollup") return "
|
|
29726
|
-
return "
|
|
29700
|
+
if (system === "autonumber") return "One number per record, in the order they were made.";
|
|
29701
|
+
if (system === "created_time") return "When the record was made.";
|
|
29702
|
+
if (system === "modified_time") return "When the record last changed.";
|
|
29703
|
+
if (kind2 === "lookup") return "Read from the record this one points at. Nobody types it.";
|
|
29704
|
+
if (kind2 === "rollup") return "Added up from the records this one points at. Nobody types it.";
|
|
29705
|
+
return "Calculated from this record's other columns. Nobody types it.";
|
|
29727
29706
|
}
|
|
29728
29707
|
function reorderItems(rows, sort, label) {
|
|
29729
29708
|
const list = [...rows];
|
|
@@ -30480,7 +30459,7 @@ function PastePreview({
|
|
|
30480
30459
|
outcome === null ? /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(import_jsx_runtime97.Fragment, { children: [
|
|
30481
30460
|
nothingToDo ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("p", { className: "text-sm", children: "Nothing in what you pasted can be written to this table. Every cell is listed below with the reason." }) : /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("p", { className: "text-sm", children: [
|
|
30482
30461
|
sentence(plan, noun, nounPlural),
|
|
30483
|
-
" The values below are exactly what will be
|
|
30462
|
+
" The values below are exactly what will be saved, written the way the grid writes them \u2014 a choice column shows the word and saves the option behind it."
|
|
30484
30463
|
] }),
|
|
30485
30464
|
plan.header ? /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("p", { className: "text-xs text-muted-foreground", "data-matrx-paste-header": true, children: [
|
|
30486
30465
|
"The first line named columns, so it matched by name and is not written.",
|
|
@@ -32297,7 +32276,7 @@ function BulkActions({
|
|
|
32297
32276
|
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_design_system89.Dialog, { open: asking !== null, onOpenChange: (next) => !next ? setAsking(null) : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_design_system89.DialogContent, { className: "sm:max-w-md", children: [
|
|
32298
32277
|
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_design_system89.DialogHeader, { children: [
|
|
32299
32278
|
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_design_system89.DialogTitle, { children: asking === "set" ? `Set a column on ${many}` : asking === "clear" ? `Clear a column on ${many}` : `Fill a column down ${many}` }),
|
|
32300
|
-
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_design_system89.DialogDescription, { children: asking === "fill" ? "The top ticked row's value is copied to every other ticked row, in one change
|
|
32279
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_design_system89.DialogDescription, { children: asking === "fill" ? "The top ticked row's value is copied to every other ticked row, in one change that applies whole or not at all." : "Every ticked row changes in one step that applies whole or not at all, and Undo puts every one back." })
|
|
32301
32280
|
] }),
|
|
32302
32281
|
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
|
|
32303
32282
|
"form",
|
|
@@ -33605,7 +33584,7 @@ function GridBody({
|
|
|
33605
33584
|
chunk.forEach((c, index) => {
|
|
33606
33585
|
const id = made.data[index];
|
|
33607
33586
|
if (id === void 0) {
|
|
33608
|
-
refusals.push(`Row ${c.row.fromLine}:
|
|
33587
|
+
refusals.push(`Row ${c.row.fromLine}: this line was saved without an id.`);
|
|
33609
33588
|
return;
|
|
33610
33589
|
}
|
|
33611
33590
|
written += 1;
|
|
@@ -35215,7 +35194,7 @@ function Withheld({ withheld }) {
|
|
|
35215
35194
|
masked.map((w) => w.label).join(", "),
|
|
35216
35195
|
".",
|
|
35217
35196
|
" ",
|
|
35218
|
-
masked[0]?.says ?? "
|
|
35197
|
+
masked[0]?.says ?? "Hidden from you.",
|
|
35219
35198
|
" An answer here is an answer without ",
|
|
35220
35199
|
masked.length === 1 ? "that field" : "those fields",
|
|
35221
35200
|
"."
|
|
@@ -36015,12 +35994,12 @@ function Peek({ tableId, recordId, onClose, className, onPage = false }) {
|
|
|
36015
35994
|
onPage ? null : /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(ReverseLinksSections, { tableId, recordId }),
|
|
36016
35995
|
record.data?.computedUnavailable ? /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(import_jsx_runtime118.Fragment, { children: [
|
|
36017
35996
|
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_design_system98.Separator, {}),
|
|
36018
|
-
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)("p", { className: "text-muted-foreground", children: "
|
|
35997
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)("p", { className: "text-muted-foreground", children: "Calculated columns are not shown: that part of the record is not readable from your seat. Everything above is the record as it stands." })
|
|
36019
35998
|
] }) : null,
|
|
36020
35999
|
computedShown.length ? /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(import_jsx_runtime118.Fragment, { children: [
|
|
36021
36000
|
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_design_system98.Separator, {}),
|
|
36022
36001
|
/* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
36023
|
-
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)("span", { className: "font-medium", children: "
|
|
36002
|
+
/* @__PURE__ */ (0, import_jsx_runtime118.jsx)("span", { className: "font-medium", children: "Calculated columns" }),
|
|
36024
36003
|
computedShown.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("p", { className: "text-muted-foreground", children: computedInPlainWords(row, (fields.data ?? []).find((f) => f.key === row.field_key)) }, i))
|
|
36025
36004
|
] })
|
|
36026
36005
|
] }) : null
|
|
@@ -37841,7 +37820,7 @@ function ChecklistTemplateEditor({
|
|
|
37841
37820
|
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
37842
37821
|
import_controls5.Select,
|
|
37843
37822
|
{
|
|
37844
|
-
"aria-label": `Step ${index + 1}
|
|
37823
|
+
"aria-label": `Step ${index + 1} needs`,
|
|
37845
37824
|
value: row.requires,
|
|
37846
37825
|
onValueChange: (v) => change(index, { requires: v }),
|
|
37847
37826
|
options: REQUIRES_KINDS.map((kind2) => ({ value: kind2, label: kind2 === "none" ? "just a tick" : REQUIRES_WORD[kind2] ?? kind2 }))
|
|
@@ -37850,7 +37829,7 @@ function ChecklistTemplateEditor({
|
|
|
37850
37829
|
row.requires === "answer" || row.requires === "record_field" ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
37851
37830
|
import_design_system104.BasicInput,
|
|
37852
37831
|
{
|
|
37853
|
-
"aria-label": `Step ${index + 1}
|
|
37832
|
+
"aria-label": `Step ${index + 1} needs which value`,
|
|
37854
37833
|
placeholder: "which value?",
|
|
37855
37834
|
className: "h-7 w-32 text-xs",
|
|
37856
37835
|
value: row.requires_key,
|
|
@@ -38431,7 +38410,7 @@ var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
|
38431
38410
|
function RecordsTableCard(props) {
|
|
38432
38411
|
const client = (0, import_react216.useOptionalRecordsClient)();
|
|
38433
38412
|
if (!client) {
|
|
38434
|
-
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_data_table16.MatrxTableCard, { title: "Table", ...props.className ? { className: props.className } : {}, children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_data_table16.MatrxTableCardEmpty, { message: "This table cannot be shown here: the page has no connection to the data
|
|
38413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_data_table16.MatrxTableCard, { title: "Table", ...props.className ? { className: props.className } : {}, children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_data_table16.MatrxTableCardEmpty, { message: "This table cannot be shown here: the page has no connection to the data." }) });
|
|
38435
38414
|
}
|
|
38436
38415
|
if (props.source.kind === "entity") return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(EntityTableCard, { ...props, source: props.source });
|
|
38437
38416
|
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(ConnectedRecordsTableCard, { ...props, source: props.source });
|
|
@@ -39077,7 +39056,7 @@ function StageRulesSection({ tableId, stage, className }) {
|
|
|
39077
39056
|
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
39078
39057
|
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "truncate font-medium", children: rule.name }),
|
|
39079
39058
|
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "text-muted-foreground", children: rule.message }),
|
|
39080
|
-
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "text-muted-foreground", children: (rule.on_fail ?? "refuse") === "require_approval" ? "
|
|
39059
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { className: "text-muted-foreground", children: (rule.on_fail ?? "refuse") === "require_approval" ? "Needs approval" : "Turns it away" })
|
|
39081
39060
|
] }),
|
|
39082
39061
|
canEdit ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_design_system110.Button, { size: "sm", variant: "ghost", onClick: () => setDraft(draftOf2(rule)), children: "Edit" }) : null
|
|
39083
39062
|
] }, rule.id)) }) : null,
|
|
@@ -41005,7 +40984,7 @@ function Held({
|
|
|
41005
40984
|
error: (0, refusals_exports.refusal)(
|
|
41006
40985
|
"refused_by_rule",
|
|
41007
40986
|
pending.verdict.why,
|
|
41008
|
-
"The card stays where it was. Fill in what this stage
|
|
40987
|
+
"The card stays where it was. Fill in what this stage needs, then move it again."
|
|
41009
40988
|
),
|
|
41010
40989
|
actions: /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_design_system118.Button, { size: "sm", variant: "ghost", className: "mt-1 h-6", onClick: onCancel, children: "Close" })
|
|
41011
40990
|
}
|
|
@@ -43622,7 +43601,7 @@ function ViewNeeds({ layout, tableId, fields, onMade, className }) {
|
|
|
43622
43601
|
),
|
|
43623
43602
|
mutation.error ? /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(RefusalNotice, { error: mutation.error }) : null,
|
|
43624
43603
|
refused ? /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(RefusalNotice, { error: refused }) : null,
|
|
43625
|
-
pendingId ? /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("p", { className: "mt-2 text-xs text-muted-foreground", children: "The
|
|
43604
|
+
pendingId ? /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("p", { className: "mt-2 text-xs text-muted-foreground", children: "The column was accepted but the table does not show it yet. Press Make it work again to look for it \u2014 it will not be added twice." }) : null
|
|
43626
43605
|
] });
|
|
43627
43606
|
}
|
|
43628
43607
|
|
|
@@ -44809,7 +44788,7 @@ function ChartBlock({ block, subject, tableName: tableName2, className, centerVa
|
|
|
44809
44788
|
] }),
|
|
44810
44789
|
block.compare_refused ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("p", { className: "px-1 text-xs text-muted-foreground", children: block.compare_refused }) : null,
|
|
44811
44790
|
!block.refused && targetNote(target) ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("p", { className: "px-1 text-xs text-muted-foreground", children: targetNote(target) }) : null,
|
|
44812
|
-
block.refused ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(RefusalNotice, { error: asRefusal2(block) }) : needs ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: needs }) : kind2 === "stuck" ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(StuckList, { rows: block.rows ?? [] }) : points.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: "
|
|
44791
|
+
block.refused ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(RefusalNotice, { error: asRefusal2(block) }) : needs ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: needs }) : kind2 === "stuck" ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(StuckList, { rows: block.rows ?? [] }) : points.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("p", { className: "px-1 py-3 text-xs text-muted-foreground", children: "No groups came back, so there is nothing to draw yet." }) : /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(import_jsx_runtime150.Fragment, { children: kind2 === "number" ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(BigNumber, { points, measure: primary, onDrill: drill, block }) : kind2 === "table" ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(GroupTable, { points, series, onDrill: drill }) : /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(import_jsx_runtime150.Fragment, { children: [
|
|
44813
44792
|
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
44814
44793
|
Drawing,
|
|
44815
44794
|
{
|
|
@@ -46463,7 +46442,7 @@ function useViewRecords(view, pageSize = 200, filter, viewId) {
|
|
|
46463
46442
|
// sat over every board and gallery. A view of the whole table says nothing about it; a narrowed
|
|
46464
46443
|
// one says how, in words a person uses.
|
|
46465
46444
|
membership: [
|
|
46466
|
-
ruleId ? "Showing the records this view's rule picks." : fromView ? "Showing the records this view's filter
|
|
46445
|
+
ruleId ? "Showing the records this view's rule picks." : fromView ? "Showing the records this view's filter matches." : asked4 !== "{}" ? "Showing only the records behind the number you clicked." : "",
|
|
46467
46446
|
manual ? HAND_ORDER_NOTE : ""
|
|
46468
46447
|
].filter(Boolean).join(" ")
|
|
46469
46448
|
};
|
|
@@ -48587,7 +48566,7 @@ function ProposalRow({
|
|
|
48587
48566
|
return updated.ok ? { settled: "accepted", sentence: "Written." } : { settled: "refused", sentence: refusalLineForAPerson(updated.error) };
|
|
48588
48567
|
}
|
|
48589
48568
|
const removed = await client.recordDelete({ record_id: change.record });
|
|
48590
|
-
return removed.ok ? { settled: "accepted", sentence: "Deleted.
|
|
48569
|
+
return removed.ok ? { settled: "accepted", sentence: "Deleted. It can be restored for a while." } : { settled: "refused", sentence: refusalLineForAPerson(removed.error) };
|
|
48591
48570
|
}
|
|
48592
48571
|
async function accept() {
|
|
48593
48572
|
setBusy(true);
|
|
@@ -49539,7 +49518,7 @@ function FormResultsPanel({ form, className }) {
|
|
|
49539
49518
|
const [round, setRound] = (0, import_react283.useState)(0);
|
|
49540
49519
|
(0, import_react283.useEffect)(() => {
|
|
49541
49520
|
if (!client) {
|
|
49542
|
-
setError((0, refusals_exports.refusal)("not_supported", "
|
|
49521
|
+
setError((0, refusals_exports.refusal)("not_supported", "No results are available on this screen.", "Open the form inside the app."));
|
|
49543
49522
|
return;
|
|
49544
49523
|
}
|
|
49545
49524
|
let cancelled = false;
|
|
@@ -50365,7 +50344,7 @@ function revokeConsequence(person, portalTitle) {
|
|
|
50365
50344
|
return `${who} will no longer be able to sign in to \u201C${portalTitle}\u201D, and the records that named their client will stop reaching them. Nothing is deleted \u2014 you can invite them again.`;
|
|
50366
50345
|
}
|
|
50367
50346
|
function previewLine(person) {
|
|
50368
|
-
return `This is what ${person.client || person.email} sees. It is the same question their own screen
|
|
50347
|
+
return `This is what ${person.client || person.email} sees. It is the same question their own screen shows \u2014 it was worked out for their sign-in, not for yours \u2014 so it cannot disagree with what they open.`;
|
|
50369
50348
|
}
|
|
50370
50349
|
function stateWords(person) {
|
|
50371
50350
|
if (!person.is_active || person.revoked_at) {
|
|
@@ -50761,7 +50740,7 @@ function PortalCardView({
|
|
|
50761
50740
|
className
|
|
50762
50741
|
}) {
|
|
50763
50742
|
return /* @__PURE__ */ (0, import_jsx_runtime165.jsxs)("div", { className: (0, import_design_system141.cn)("mt-2.5 flex flex-col gap-2.5 border-t border-border pt-2.5", className), children: [
|
|
50764
|
-
card.external_lane_open ? null : /* @__PURE__ */ (0, import_jsx_runtime165.jsx)("p", { className: "rounded border border-destructive/40 px-2 py-1.5 text-xs text-destructive", children: "This organization's outside
|
|
50743
|
+
card.external_lane_open ? null : /* @__PURE__ */ (0, import_jsx_runtime165.jsx)("p", { className: "rounded border border-destructive/40 px-2 py-1.5 text-xs text-destructive", children: "This organization's outside access is closed, so nobody in this portal can sign in yet \u2014 whatever their row below says. Re-stating the portal opens it." }),
|
|
50765
50744
|
/* @__PURE__ */ (0, import_jsx_runtime165.jsxs)("section", { className: "flex flex-col gap-1.5", children: [
|
|
50766
50745
|
/* @__PURE__ */ (0, import_jsx_runtime165.jsx)("h4", { className: "text-xs font-medium", children: "What they see" }),
|
|
50767
50746
|
card.tables.map((exposed) => /* @__PURE__ */ (0, import_jsx_runtime165.jsxs)("div", { className: "rounded border border-border px-2 py-1.5 text-xs", children: [
|
|
@@ -52293,7 +52272,7 @@ function ConnectedFormRunner(props) {
|
|
|
52293
52272
|
const whichAsked = (0, import_react298.useCallback)(
|
|
52294
52273
|
async (values) => {
|
|
52295
52274
|
if (!client) {
|
|
52296
|
-
return { ok: false, message: "This preview
|
|
52275
|
+
return { ok: false, message: "This preview shows every question." };
|
|
52297
52276
|
}
|
|
52298
52277
|
const answered = await client.formPreviewRoute({
|
|
52299
52278
|
table_id: form.subject,
|
|
@@ -54140,12 +54119,12 @@ function SignBlock({ tableId, recordId, render, className }) {
|
|
|
54140
54119
|
className: "mt-0.5",
|
|
54141
54120
|
error: (0, refusals_exports.refusal)(
|
|
54142
54121
|
"refused_by_rule",
|
|
54143
|
-
typeof verdict === "object" && verdict !== null && "reason" in verdict ? String(verdict.reason) : "
|
|
54122
|
+
typeof verdict === "object" && verdict !== null && "reason" in verdict ? String(verdict.reason) : "What is there no longer matches what was signed.",
|
|
54144
54123
|
"Ask for it to be signed again on the version that is there now."
|
|
54145
54124
|
)
|
|
54146
54125
|
}
|
|
54147
54126
|
)
|
|
54148
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime174.jsx)("p", { className: "mt-0.5 text-muted-foreground", children: intact === true ? "
|
|
54127
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime174.jsx)("p", { className: "mt-0.5 text-muted-foreground", children: intact === true ? "What was signed is still exactly what is there." : String(verdict ?? "") })
|
|
54149
54128
|
] }, signature.id);
|
|
54150
54129
|
}) }) : null,
|
|
54151
54130
|
!render ? /* @__PURE__ */ (0, import_jsx_runtime174.jsx)("p", { className: "text-xs text-muted-foreground", children: 'Nothing has been frozen yet, so there is no version to sign. A signature seals one exact document version and its hash \u2014 "the document as it reads today" is not something anyone can agree to.' }) : signable.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime174.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
@@ -54363,7 +54342,7 @@ function NotifyRuleEditor({ tableId, seed, chosenRuleId, onChoose, className })
|
|
|
54363
54342
|
held.quiet_hours.end
|
|
54364
54343
|
] }) : null,
|
|
54365
54344
|
held.recipient_user_id === null ? /* @__PURE__ */ (0, import_jsx_runtime175.jsx)("span", { className: "text-destructive", children: "This one has nobody to tell, so it fires at nobody." }) : null,
|
|
54366
|
-
held.saved_view_id === null ? /* @__PURE__ */ (0, import_jsx_runtime175.jsx)("span", { className: "text-destructive", children: "This one names no view, so
|
|
54345
|
+
held.saved_view_id === null ? /* @__PURE__ */ (0, import_jsx_runtime175.jsx)("span", { className: "text-destructive", children: "This one names no view, so no record ever matches it." }) : null,
|
|
54367
54346
|
held.muted ? /* @__PURE__ */ (0, import_jsx_runtime175.jsx)("span", { className: "text-muted-foreground", children: "Switched off \u2014 it tells nobody until somebody switches it back on." }) : null,
|
|
54368
54347
|
onChoose ? held.rule_id === chosenRuleId ? /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)("span", { className: "ml-auto flex items-center gap-1", children: [
|
|
54369
54348
|
/* @__PURE__ */ (0, import_jsx_runtime175.jsx)("span", { className: "font-medium text-foreground", children: "Used for this form" }),
|
|
@@ -54477,7 +54456,7 @@ function NotifyRuleEditor({ tableId, seed, chosenRuleId, onChoose, className })
|
|
|
54477
54456
|
}
|
|
54478
54457
|
),
|
|
54479
54458
|
/* @__PURE__ */ (0, import_jsx_runtime175.jsx)(import_design_system152.Button, { size: "sm", type: "submit", disabled: busy, children: "Tell me" }),
|
|
54480
|
-
/* @__PURE__ */ (0, import_jsx_runtime175.jsx)("p", { className: "w-full text-xs text-muted-foreground", children: "A send inside your quiet hours is held until they end \u2014 it is never dropped. Leave the schedule blank for the
|
|
54459
|
+
/* @__PURE__ */ (0, import_jsx_runtime175.jsx)("p", { className: "w-full text-xs text-muted-foreground", children: "A send inside your quiet hours is held until they end \u2014 it is never dropped. Leave the schedule blank for the default of 08:00." })
|
|
54481
54460
|
]
|
|
54482
54461
|
}
|
|
54483
54462
|
) : /* @__PURE__ */ (0, import_jsx_runtime175.jsx)("p", { className: "text-xs text-muted-foreground", children: rights.why("write") })
|
|
@@ -55545,7 +55524,7 @@ function whatTheStoreDidNotKeep(sent, stored) {
|
|
|
55545
55524
|
if (what.length) lost.push(`${what.join(" and ")} for \u201C${block.title}\u201D`);
|
|
55546
55525
|
});
|
|
55547
55526
|
if (lost.length === 0) return null;
|
|
55548
|
-
return `
|
|
55527
|
+
return `It was not saved: ${lost.join("; ")}. What it holds is shown; nothing else was changed.`;
|
|
55549
55528
|
}
|
|
55550
55529
|
function withCompare(block, compare) {
|
|
55551
55530
|
const { compare: _dropped, ...rest } = block;
|
|
@@ -58337,7 +58316,7 @@ init_Refusal();
|
|
|
58337
58316
|
init_host();
|
|
58338
58317
|
var import_jsx_runtime184 = require("react/jsx-runtime");
|
|
58339
58318
|
var FORM_NOT_HERE_LINE = "The link named a form this table does not have \u2014 it may have been removed, or it belongs to another table. The forms this table does have are listed here.";
|
|
58340
|
-
var WHAT_A_FORM_IS = "A form
|
|
58319
|
+
var WHAT_A_FORM_IS = "A form uses this table's own fields, and its answers land here as ordinary records stamped with the form they came through.";
|
|
58341
58320
|
var NO_ADMIN2 = "This table has no forms. Making one needs the admin level on it, because a form decides what people with no account may add here.";
|
|
58342
58321
|
function formSuggestion(tableName2) {
|
|
58343
58322
|
const subject = tableName2?.trim() ? tableName2.trim() : "this table";
|
|
@@ -59431,7 +59410,7 @@ function EmbedFrame({
|
|
|
59431
59410
|
if (!rights.admin) {
|
|
59432
59411
|
return /* @__PURE__ */ (0, import_jsx_runtime189.jsxs)("p", { className: (0, import_design_system166.cn)("rounded border border-dashed px-2 py-1 text-xs text-muted-foreground", className), children: [
|
|
59433
59412
|
rights.why("structure"),
|
|
59434
|
-
" Issuing an embed opens a way in from somebody else's website, so
|
|
59413
|
+
" Issuing an embed opens a way in from somebody else's website, so it needs the admin level on this table."
|
|
59435
59414
|
] });
|
|
59436
59415
|
}
|
|
59437
59416
|
const snippet = secret ? `<iframe src="${embedUrl}#t=${secret}" style="width:100%;height:640px;border:0" loading="lazy"></iframe>` : null;
|
|
@@ -60172,7 +60151,7 @@ function ViewFilter({ tableId, view, onApply, className }) {
|
|
|
60172
60151
|
className: "flex flex-col gap-2 text-xs",
|
|
60173
60152
|
"data-testid": "view-filter-panel",
|
|
60174
60153
|
children: [
|
|
60175
|
-
view.ruleId ? /* @__PURE__ */ (0, import_jsx_runtime195.jsx)("p", { className: "text-muted-foreground", children: "This view's records are chosen by a membership Rule, and
|
|
60154
|
+
view.ruleId ? /* @__PURE__ */ (0, import_jsx_runtime195.jsx)("p", { className: "text-muted-foreground", children: "This view's records are chosen by a membership Rule, and it decides who is in. Change the Rule to change who is in this view." }) : !conditionIsDrawable(saved) ? /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)("p", { className: "text-muted-foreground", children: [
|
|
60176
60155
|
"This view asks: ",
|
|
60177
60156
|
conditionInWords(saved, conditionFields),
|
|
60178
60157
|
". It cannot be drawn here; clear it to start a new filter."
|