@ai-matrx/records-ui 0.101.30 → 0.101.31
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 +6 -0
- package/dist/index.cjs +45 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +45 -9
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +61 -14
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +48 -1
- package/dist/pickers.js.map +1 -1
- package/package.json +3 -3
package/dist/pickers.js
CHANGED
|
@@ -4411,6 +4411,24 @@ import { SWATCH_CLASS, formatColumnValue } from "@ai-matrx/design-system/data-ta
|
|
|
4411
4411
|
import { formatFieldValue as formatFieldValue3 } from "@ai-matrx/design-system/field-formats";
|
|
4412
4412
|
import { Badge as Badge5, cn as cn16 } from "@ai-matrx/design-system";
|
|
4413
4413
|
|
|
4414
|
+
// src/embeddedLook.tsx
|
|
4415
|
+
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
4416
|
+
var EmbeddedLookContext = createContext3(null);
|
|
4417
|
+
var EmbeddedLookProvider = EmbeddedLookContext.Provider;
|
|
4418
|
+
function useEmbeddedLook() {
|
|
4419
|
+
return useContext3(EmbeddedLookContext);
|
|
4420
|
+
}
|
|
4421
|
+
var EMBEDDED_TABLE_CLASS = [
|
|
4422
|
+
"[&_tbody_td]:h-10",
|
|
4423
|
+
"[&_tbody_td]:align-middle!",
|
|
4424
|
+
"[&_tbody_td]:border-r",
|
|
4425
|
+
"[&_tbody_td]:border-border",
|
|
4426
|
+
"[&_tbody_td:last-child]:border-r-0",
|
|
4427
|
+
"[&_thead_th]:border-r",
|
|
4428
|
+
"[&_thead_th]:border-border",
|
|
4429
|
+
"[&_thead_th:last-child]:border-r-0"
|
|
4430
|
+
].join(" ");
|
|
4431
|
+
|
|
4414
4432
|
// src/enumLabels.ts
|
|
4415
4433
|
function exhaustiveValuesOf() {
|
|
4416
4434
|
return function(values) {
|
|
@@ -4543,10 +4561,39 @@ function referencesOf(field, value, kind, labels) {
|
|
|
4543
4561
|
}
|
|
4544
4562
|
var ARCHIVED_REFERENCE_WORD = "Archived";
|
|
4545
4563
|
var ARCHIVED_REFERENCE_TIP = "In the Archived view; restore it to use it again";
|
|
4564
|
+
function PageGlyph() {
|
|
4565
|
+
return /* @__PURE__ */ jsxs19("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: 14, height: 14, fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "data-records-page-glyph": "", children: [
|
|
4566
|
+
/* @__PURE__ */ jsx22("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
|
|
4567
|
+
/* @__PURE__ */ jsx22("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }),
|
|
4568
|
+
/* @__PURE__ */ jsx22("path", { d: "M10 13H8" }),
|
|
4569
|
+
/* @__PURE__ */ jsx22("path", { d: "M16 17H8" })
|
|
4570
|
+
] });
|
|
4571
|
+
}
|
|
4546
4572
|
function ReferenceChip({ reference, waiting }) {
|
|
4547
4573
|
const host = useRecordsUi();
|
|
4548
4574
|
const words = reference.label ?? (reference.token === "record" ? waiting ?? "Loading\u2026" : WITHHELD_ENTITY_LABEL);
|
|
4549
4575
|
const drawn = host.renderReference ? host.renderReference({ ...reference, label: reference.label ?? words }) : null;
|
|
4576
|
+
const look = useEmbeddedLook();
|
|
4577
|
+
if (look?.plainRelation) {
|
|
4578
|
+
return /* @__PURE__ */ jsxs19(
|
|
4579
|
+
"span",
|
|
4580
|
+
{
|
|
4581
|
+
className: cn15(
|
|
4582
|
+
"inline-flex max-w-full min-w-0 items-center gap-1.5 text-sm text-foreground hover:underline [&_a]:text-inherit [&_a]:no-underline [&_a:hover]:underline",
|
|
4583
|
+
reference.archived && "opacity-70"
|
|
4584
|
+
),
|
|
4585
|
+
"data-records-reference-chip": reference.token,
|
|
4586
|
+
"data-records-reference-plain": "",
|
|
4587
|
+
"data-records-reference-archived": reference.archived ? "" : void 0,
|
|
4588
|
+
title: reference.archived ? ARCHIVED_REFERENCE_TIP : words,
|
|
4589
|
+
children: [
|
|
4590
|
+
/* @__PURE__ */ jsx22("span", { "aria-hidden": "true", "data-records-reference-icon": "", className: "inline-flex size-4 shrink-0 items-center justify-center text-muted-foreground", children: reference.icon ? /* @__PURE__ */ jsx22("span", { className: "text-sm leading-none", children: reference.icon }) : /* @__PURE__ */ jsx22(PageGlyph, {}) }),
|
|
4591
|
+
drawn ?? /* @__PURE__ */ jsx22("span", { className: "truncate", children: words }),
|
|
4592
|
+
reference.archived ? /* @__PURE__ */ jsx22("span", { className: "shrink-0 text-muted-foreground", children: ARCHIVED_REFERENCE_WORD }) : null
|
|
4593
|
+
]
|
|
4594
|
+
}
|
|
4595
|
+
);
|
|
4596
|
+
}
|
|
4550
4597
|
return /* @__PURE__ */ jsxs19(
|
|
4551
4598
|
Badge4,
|
|
4552
4599
|
{
|
|
@@ -4700,7 +4747,7 @@ function renderValue(field, value, document2, labels, stillWaitingFor, look) {
|
|
|
4700
4747
|
"data-records-choice-chip": "",
|
|
4701
4748
|
...chip.tinted ? { "data-records-choice-tint": "" } : {},
|
|
4702
4749
|
children: [
|
|
4703
|
-
look?.choiceDot ? /* @__PURE__ */ jsx23("span", { "aria-hidden": "true", "data-records-choice-dot": "", className: cn16("mr-1.5 inline-block size-1.5 shrink-0 rounded-full", chip.dot) }) : null,
|
|
4750
|
+
look?.choiceDot ? /* @__PURE__ */ jsx23("span", { "aria-hidden": "true", "data-matrx-pill-ink": "", "data-records-choice-dot": "", className: cn16("mr-1.5 inline-block size-1.5 shrink-0 rounded-full", chip.dot) }) : null,
|
|
4704
4751
|
statusMark(field, item, Array.isArray(value) ? void 0 : document2),
|
|
4705
4752
|
scalarText(field, item, labels, Array.isArray(value) ? void 0 : stillWaitingFor)
|
|
4706
4753
|
]
|