@ai-matrx/records-ui 0.101.26 → 0.101.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 +12 -0
- package/dist/index.cjs +33 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +33 -11
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog — @ai-matrx/records-ui
|
|
2
2
|
|
|
3
|
+
## 0.101.28
|
|
4
|
+
|
|
5
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
6
|
+
`git diff npm/records-ui/v0.101.27..npm/records-ui/v0.101.28 -- apps/shared/records-ui`).
|
|
7
|
+
No source changes intended and no consumer action required.
|
|
8
|
+
|
|
9
|
+
## 0.101.27
|
|
10
|
+
|
|
11
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
12
|
+
`git diff npm/records-ui/v0.101.26..npm/records-ui/v0.101.27 -- apps/shared/records-ui`).
|
|
13
|
+
No source changes intended and no consumer action required.
|
|
14
|
+
|
|
3
15
|
## 0.101.26
|
|
4
16
|
|
|
5
17
|
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
package/dist/index.cjs
CHANGED
|
@@ -13747,6 +13747,14 @@ function asField(f) {
|
|
|
13747
13747
|
relation_target: f.relation_target ?? null
|
|
13748
13748
|
};
|
|
13749
13749
|
}
|
|
13750
|
+
function CustomValue({ field: field2, value }) {
|
|
13751
|
+
const choice = isChoiceField(field2);
|
|
13752
|
+
const index = useChoiceOptions(choice ? [field2] : [], choice ? [field2.key] : []);
|
|
13753
|
+
const options = index.get(field2.key);
|
|
13754
|
+
if (!choice || !options) return renderValue(field2, value);
|
|
13755
|
+
const worded = (v) => optionFor(options, v)?.label ?? v;
|
|
13756
|
+
return renderValue(field2, Array.isArray(value) ? value.map(worded) : worded(value));
|
|
13757
|
+
}
|
|
13750
13758
|
function CustomFieldsSection({
|
|
13751
13759
|
entityToken,
|
|
13752
13760
|
recordId,
|
|
@@ -14066,7 +14074,7 @@ function CustomFieldsSection({
|
|
|
14066
14074
|
setCellValue(values[f.key]);
|
|
14067
14075
|
setCellKey(f.key);
|
|
14068
14076
|
},
|
|
14069
|
-
children: isEmptyValue(values[f.key]) ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-muted-foreground", children: "\u2014" }) :
|
|
14077
|
+
children: isEmptyValue(values[f.key]) ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-muted-foreground", children: "\u2014" }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(CustomValue, { field: asField(f), value: values[f.key] })
|
|
14070
14078
|
}
|
|
14071
14079
|
) })
|
|
14072
14080
|
] }, f.id)) })
|
|
@@ -20815,10 +20823,11 @@ function viewOrderOf(definition) {
|
|
|
20815
20823
|
const raw = definition?.["order"];
|
|
20816
20824
|
return raw === "manual" ? "manual" : raw === "sorted" ? "sorted" : null;
|
|
20817
20825
|
}
|
|
20826
|
+
var RETIRED_HOST_LAYOUTS = ["sheet"];
|
|
20818
20827
|
function designatedLayoutOf(definition) {
|
|
20819
20828
|
const data = definition ?? {};
|
|
20820
20829
|
const raw = typeof data["layout"] === "string" ? data["layout"].trim().toLowerCase() : "";
|
|
20821
|
-
if (raw !== "" && !VIEW_LAYOUTS.includes(raw)) return raw;
|
|
20830
|
+
if (raw !== "" && !VIEW_LAYOUTS.includes(raw) && !RETIRED_HOST_LAYOUTS.includes(raw)) return raw;
|
|
20822
20831
|
return null;
|
|
20823
20832
|
}
|
|
20824
20833
|
function tableOpening(view, hostLayoutIds) {
|
|
@@ -23154,7 +23163,8 @@ function GridBody({
|
|
|
23154
23163
|
rows: rows.length,
|
|
23155
23164
|
onPage: setPage
|
|
23156
23165
|
}
|
|
23157
|
-
)
|
|
23166
|
+
),
|
|
23167
|
+
embedded && !merged && !readOnly && rights.write ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "px-2 py-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(AddRowLine, { onAdd: () => void addRecord(), busy: editingBusy, label: newRowLabel ?? "Add row" }) }) : null
|
|
23158
23168
|
] }),
|
|
23159
23169
|
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ActionConfirm, { runner, fields: fields.data ?? [], noun, nounPlural }),
|
|
23160
23170
|
assist.dialogs,
|
|
@@ -31187,7 +31197,8 @@ function ListView({
|
|
|
31187
31197
|
remembered,
|
|
31188
31198
|
note,
|
|
31189
31199
|
style,
|
|
31190
|
-
formats
|
|
31200
|
+
formats,
|
|
31201
|
+
newLabel
|
|
31191
31202
|
}) {
|
|
31192
31203
|
const groupField = grouping?.field ? fields.find((f) => f.key === grouping.field) : void 0;
|
|
31193
31204
|
const groupKey = groupField?.key ?? null;
|
|
@@ -31253,14 +31264,17 @@ function ListView({
|
|
|
31253
31264
|
)
|
|
31254
31265
|
}
|
|
31255
31266
|
) }, row.id)) }),
|
|
31256
|
-
mayAddIn ? /* @__PURE__ */ (0, import_jsx_runtime104.
|
|
31267
|
+
mayAddIn ? /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(
|
|
31257
31268
|
"button",
|
|
31258
31269
|
{
|
|
31259
31270
|
type: "button",
|
|
31260
31271
|
"data-records-list-add": group.key,
|
|
31261
31272
|
className: "self-start rounded px-1 py-0.5 text-xs text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
31262
31273
|
onClick: () => void add(group),
|
|
31263
|
-
children:
|
|
31274
|
+
children: [
|
|
31275
|
+
"+ ",
|
|
31276
|
+
newLabel ?? "New"
|
|
31277
|
+
]
|
|
31264
31278
|
}
|
|
31265
31279
|
) : null
|
|
31266
31280
|
] }, group.key)) }),
|
|
@@ -31562,7 +31576,8 @@ function ViewSwitcher({
|
|
|
31562
31576
|
remembered: Boolean(onViewChange),
|
|
31563
31577
|
...onOpenRecord ? { onOpenRecord } : {},
|
|
31564
31578
|
...onMoved ? { onMoved } : {},
|
|
31565
|
-
canCreate: Boolean(onNewRecordForm)
|
|
31579
|
+
canCreate: Boolean(onNewRecordForm),
|
|
31580
|
+
...embedded && newRowLabel ? { newRowLabel } : {}
|
|
31566
31581
|
}
|
|
31567
31582
|
)
|
|
31568
31583
|
] });
|
|
@@ -31645,7 +31660,8 @@ function Board({
|
|
|
31645
31660
|
onMoved,
|
|
31646
31661
|
viewId,
|
|
31647
31662
|
onClearFilter,
|
|
31648
|
-
canCreate = false
|
|
31663
|
+
canCreate = false,
|
|
31664
|
+
newRowLabel
|
|
31649
31665
|
}) {
|
|
31650
31666
|
const fields = (0, import_react178.useFields)(view.subject);
|
|
31651
31667
|
const records = useViewRecords(view, pageSize, filter, viewId ?? null);
|
|
@@ -31889,6 +31905,7 @@ function Board({
|
|
|
31889
31905
|
onChanged: () => records.reload(),
|
|
31890
31906
|
...onMoved ? { onMoved } : {},
|
|
31891
31907
|
canAdd: mayAdd,
|
|
31908
|
+
...newRowLabel ? { newLabel: newRowLabel } : {},
|
|
31892
31909
|
remembered,
|
|
31893
31910
|
note: records.membership,
|
|
31894
31911
|
style,
|
|
@@ -31911,6 +31928,7 @@ function Board({
|
|
|
31911
31928
|
Gallery,
|
|
31912
31929
|
{
|
|
31913
31930
|
...addCard ? { onNew: () => void addCard() } : {},
|
|
31931
|
+
...newRowLabel ? { newLabel: newRowLabel } : {},
|
|
31914
31932
|
tableId: view.subject,
|
|
31915
31933
|
titleKey,
|
|
31916
31934
|
onChanged: () => {
|
|
@@ -32239,7 +32257,8 @@ function Gallery({
|
|
|
32239
32257
|
onSizeChange,
|
|
32240
32258
|
onHiddenFieldsChange,
|
|
32241
32259
|
remembered,
|
|
32242
|
-
onNew
|
|
32260
|
+
onNew,
|
|
32261
|
+
newLabel
|
|
32243
32262
|
}) {
|
|
32244
32263
|
const hidden = (0, import_react177.useMemo)(() => new Set(hiddenFields ?? []), [hiddenFields]);
|
|
32245
32264
|
const imageField = imageKey ? fields.find((field2) => field2.key === imageKey) : void 0;
|
|
@@ -32303,14 +32322,17 @@ function Gallery({
|
|
|
32303
32322
|
}
|
|
32304
32323
|
) }, row.id);
|
|
32305
32324
|
}),
|
|
32306
|
-
onNew ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime105.
|
|
32325
|
+
onNew ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
|
|
32307
32326
|
"button",
|
|
32308
32327
|
{
|
|
32309
32328
|
type: "button",
|
|
32310
32329
|
"data-records-gallery-add": "",
|
|
32311
32330
|
className: "flex h-full min-h-16 w-full items-center justify-center rounded border border-dashed p-2 text-xs text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
32312
32331
|
onClick: onNew,
|
|
32313
|
-
children:
|
|
32332
|
+
children: [
|
|
32333
|
+
"+ ",
|
|
32334
|
+
newLabel ?? "New"
|
|
32335
|
+
]
|
|
32314
32336
|
}
|
|
32315
32337
|
) }) : null
|
|
32316
32338
|
]
|