@ai-matrx/records-ui 0.113.26 → 0.113.28
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 +30 -0
- package/dist/index.cjs +19 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +19 -11
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +9 -6
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +9 -6
- package/dist/pickers.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,41 @@
|
|
|
1
1
|
# Changelog — @ai-matrx/records-ui
|
|
2
2
|
|
|
3
|
+
## 0.113.28
|
|
4
|
+
|
|
5
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
6
|
+
`git diff npm/records-ui/v0.113.27..npm/records-ui/v0.113.28 -- apps/shared/records-ui`).
|
|
7
|
+
No source changes intended and no consumer action required.
|
|
8
|
+
|
|
9
|
+
## 0.113.27
|
|
10
|
+
|
|
11
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
12
|
+
`git diff npm/records-ui/v0.113.26..npm/records-ui/v0.113.27 -- apps/shared/records-ui`).
|
|
13
|
+
No source changes intended and no consumer action required.
|
|
14
|
+
|
|
3
15
|
## 0.113.26
|
|
4
16
|
|
|
5
17
|
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
6
18
|
`git diff npm/records-ui/v0.113.25..npm/records-ui/v0.113.26 -- apps/shared/records-ui`).
|
|
7
19
|
No source changes intended and no consumer action required.
|
|
8
20
|
|
|
21
|
+
## 0.113.25
|
|
22
|
+
|
|
23
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
24
|
+
`git diff npm/records-ui/v0.113.24..npm/records-ui/v0.113.25 -- apps/shared/records-ui`).
|
|
25
|
+
No source changes intended and no consumer action required.
|
|
26
|
+
|
|
27
|
+
## 0.113.24
|
|
28
|
+
|
|
29
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
30
|
+
`git diff npm/records-ui/v0.113.23..npm/records-ui/v0.113.24 -- apps/shared/records-ui`).
|
|
31
|
+
No source changes intended and no consumer action required.
|
|
32
|
+
|
|
33
|
+
## 0.113.23
|
|
34
|
+
|
|
35
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
36
|
+
`git diff npm/records-ui/v0.113.22..npm/records-ui/v0.113.23 -- apps/shared/records-ui`).
|
|
37
|
+
No source changes intended and no consumer action required.
|
|
38
|
+
|
|
9
39
|
## 0.113.22
|
|
10
40
|
|
|
11
41
|
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
package/dist/index.cjs
CHANGED
|
@@ -5169,8 +5169,11 @@ var import_jsx_runtime14 = (
|
|
|
5169
5169
|
// `FieldLabel`, so the sentence does not say it a second time.
|
|
5170
5170
|
require("react/jsx-runtime")
|
|
5171
5171
|
);
|
|
5172
|
+
function withoutSelf(rows, selfId) {
|
|
5173
|
+
return selfId ? rows.filter((row) => row.id !== selfId) : rows;
|
|
5174
|
+
}
|
|
5172
5175
|
var NO_STORE_ON_THIS_SCREEN_REASON = "This question points at a record in somebody's own data, and a page answered without an account is never allowed to search that. Leave it blank \u2014 whoever receives your answer will fill it in.";
|
|
5173
|
-
function RelationPicker({ field: field2, value, onChange, disabled, id, className, allowCreate = true, onPicked, autoOpen, onClose, onCancel }) {
|
|
5176
|
+
function RelationPicker({ field: field2, value, onChange, disabled, id, className, allowCreate = true, onPicked, autoOpen, onClose, onCancel, excludeId }) {
|
|
5174
5177
|
const client = (0, import_react24.useOptionalRecordsClient)();
|
|
5175
5178
|
const [rows, setRows] = (0, import_react23.useState)(null);
|
|
5176
5179
|
const [words2, setWords] = (0, import_react23.useState)({});
|
|
@@ -5199,7 +5202,7 @@ function RelationPicker({ field: field2, value, onChange, disabled, id, classNam
|
|
|
5199
5202
|
let cancelled = false;
|
|
5200
5203
|
void client.list({ table_id: target2, limit: 200 }).then((result) => {
|
|
5201
5204
|
if (cancelled) return;
|
|
5202
|
-
if (result.ok) setRows(result.data.rows);
|
|
5205
|
+
if (result.ok) setRows(withoutSelf(result.data.rows, excludeId));
|
|
5203
5206
|
else setRefusal(result.error);
|
|
5204
5207
|
});
|
|
5205
5208
|
return () => {
|
|
@@ -5305,7 +5308,7 @@ function RelationPicker({ field: field2, value, onChange, disabled, id, classNam
|
|
|
5305
5308
|
}
|
|
5306
5309
|
const createdId = String(written.data);
|
|
5307
5310
|
const refreshed = await client.list({ table_id: tableId, limit: 200 });
|
|
5308
|
-
if (refreshed.ok) setRows(refreshed.data.rows);
|
|
5311
|
+
if (refreshed.ok) setRows(withoutSelf(refreshed.data.rows, excludeId));
|
|
5309
5312
|
setBusy(false);
|
|
5310
5313
|
setCreating(false);
|
|
5311
5314
|
setNewTitle("");
|
|
@@ -11435,7 +11438,7 @@ function isPersonsName(field2) {
|
|
|
11435
11438
|
const words2 = `${field2.key} ${field2.label ?? ""}`.toLowerCase();
|
|
11436
11439
|
return /(^|[\s_])(full[\s_]?)?name(\s|$)/.test(words2) && !/(therapist|doctor|physician|company|business|pet|room)/.test(words2);
|
|
11437
11440
|
}
|
|
11438
|
-
function FieldControl({ field: field2, value, onChange, disabled, id, autoOpen, onClose, onCommit, onCancel, addsChoices, initialSearch, asForm, onChosen }) {
|
|
11441
|
+
function FieldControl({ field: field2, value, onChange, disabled, id, autoOpen, onClose, onCommit, onCancel, addsChoices, initialSearch, asForm, onChosen, recordId }) {
|
|
11439
11442
|
const host = useRecordsUi();
|
|
11440
11443
|
const kind = editorKindFor(field2);
|
|
11441
11444
|
const inputId = id ?? `field-${field2.key}`;
|
|
@@ -11520,9 +11523,9 @@ function FieldControl({ field: field2, value, onChange, disabled, id, autoOpen,
|
|
|
11520
11523
|
if (hostTakesFiles(host)) {
|
|
11521
11524
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(AttachmentControl, { field: field2, value, onChange, disabled, id: inputId, autoOpen, onClose });
|
|
11522
11525
|
}
|
|
11523
|
-
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(RelationPicker, { field: field2, value, onChange, disabled, id: inputId });
|
|
11526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(RelationPicker, { field: field2, value, onChange, disabled, id: inputId, excludeId: recordId });
|
|
11524
11527
|
case "relation":
|
|
11525
|
-
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(RelationPicker, { field: field2, value, onChange, disabled, id: inputId, onPicked: onCommit, autoOpen, onClose, onCancel });
|
|
11528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(RelationPicker, { field: field2, value, onChange, disabled, id: inputId, onPicked: onCommit, autoOpen, onClose, onCancel, excludeId: recordId });
|
|
11526
11529
|
default:
|
|
11527
11530
|
if (typeof value === "boolean" || field2.config?.["kind"] === "boolean") {
|
|
11528
11531
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
@@ -12930,6 +12933,7 @@ function GridCell({
|
|
|
12930
12933
|
OpenCell,
|
|
12931
12934
|
{
|
|
12932
12935
|
field: field2,
|
|
12936
|
+
recordId: row.id,
|
|
12933
12937
|
draft: editing.draft,
|
|
12934
12938
|
initialSearch: editing.searchSeed,
|
|
12935
12939
|
onType: editing.type,
|
|
@@ -13275,7 +13279,8 @@ function OpenCell({
|
|
|
13275
13279
|
onCommit,
|
|
13276
13280
|
onCancel,
|
|
13277
13281
|
below,
|
|
13278
|
-
initialSearch
|
|
13282
|
+
initialSearch,
|
|
13283
|
+
recordId
|
|
13279
13284
|
}) {
|
|
13280
13285
|
const multiline = takesANewline(field2);
|
|
13281
13286
|
const picker = opensAsAList(field2, hostTakesFiles(useRecordsUi()));
|
|
@@ -13398,7 +13403,8 @@ function OpenCell({
|
|
|
13398
13403
|
...picker && ahead ? { initialSearch: ahead } : {},
|
|
13399
13404
|
onCommit: () => once(() => onCommit(null, "pick")),
|
|
13400
13405
|
onCancel: () => once(() => onCancel("pick")),
|
|
13401
|
-
addsChoices: true
|
|
13406
|
+
addsChoices: true,
|
|
13407
|
+
recordId
|
|
13402
13408
|
}
|
|
13403
13409
|
),
|
|
13404
13410
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { "data-records-cell-tray": "", className: FLOATING_CELL_TRAY_CLASS, children: [
|
|
@@ -17793,6 +17799,7 @@ function CustomRecordForm({
|
|
|
17793
17799
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "grid gap-3 sm:grid-cols-2", children: (fields.data ?? []).map((field2) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
17794
17800
|
FieldRow,
|
|
17795
17801
|
{
|
|
17802
|
+
recordId,
|
|
17796
17803
|
field: field2,
|
|
17797
17804
|
value: draft[field2.key],
|
|
17798
17805
|
document: existing.data?.document,
|
|
@@ -17867,7 +17874,8 @@ function FieldRow({
|
|
|
17867
17874
|
problems,
|
|
17868
17875
|
onChange,
|
|
17869
17876
|
onKeepEditing,
|
|
17870
|
-
onDiscard
|
|
17877
|
+
onDiscard,
|
|
17878
|
+
recordId
|
|
17871
17879
|
}) {
|
|
17872
17880
|
const id = `field-${field2.id}`;
|
|
17873
17881
|
const storedWords = document2?.[field2.key];
|
|
@@ -17878,7 +17886,7 @@ function FieldRow({
|
|
|
17878
17886
|
// A TEXT KEPT AS A FILE opens WHOLE, never as the 1000 characters its cell holds —
|
|
17879
17887
|
// saving those would cut the value (lane BIG-VALUES-WRITE).
|
|
17880
17888
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(WholeValueEditor, { field: field2, pointer: whole, words: String(storedWords ?? ""), value, onChange, id })
|
|
17881
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FieldControl, { field: field2, value, onChange, id }),
|
|
17889
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FieldControl, { field: field2, value, onChange, id, recordId }),
|
|
17882
17890
|
problems.map((problem, index) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
17883
17891
|
RefusalNotice,
|
|
17884
17892
|
{
|
|
@@ -19626,7 +19634,7 @@ function ReverseLinksEditor({ tableId, recordId, column, autoOpen, onClose }) {
|
|
|
19626
19634
|
if (done.ok) read.reload();
|
|
19627
19635
|
};
|
|
19628
19636
|
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("span", { className: "flex min-w-0 flex-col gap-1", "data-records-reverse-editor": column.key, children: [
|
|
19629
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(RelationPicker, { field: field2, value: current, onChange: (next) => void write(next), autoOpen, onClose }),
|
|
19637
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(RelationPicker, { field: field2, value: current, onChange: (next) => void write(next), autoOpen, onClose, excludeId: recordId }),
|
|
19630
19638
|
refused ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(RefusalNotice, { error: refused }) : null
|
|
19631
19639
|
] });
|
|
19632
19640
|
}
|