@ai-matrx/records-ui 0.113.32 → 0.113.34
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 +25 -0
- package/dist/index.cjs +10 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +8 -4
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.d.cts +6 -1
- package/dist/pickers.d.ts +6 -1
- package/dist/pickers.js +8 -4
- package/dist/pickers.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -951,6 +951,7 @@ function fieldTypeLabel(field2) {
|
|
|
951
951
|
// src/gridPage.ts
|
|
952
952
|
import { holdsNumbers } from "@ai-matrx/records/first-page";
|
|
953
953
|
import { holdsNumbers as holdsNumbers2, pageSortFor, sortAsFor } from "@ai-matrx/records/first-page";
|
|
954
|
+
import { containsPattern } from "@ai-matrx/records/data";
|
|
954
955
|
function sortRefusal(f) {
|
|
955
956
|
if (!computedOnRead(f)) return null;
|
|
956
957
|
return `${fieldName(f)} is worked out each time it is read, so the store keeps no value to sort the whole table by. Sort by a column it is worked out from.`;
|
|
@@ -963,9 +964,6 @@ function computedOnRead(f) {
|
|
|
963
964
|
const kind = String(editorKindFor(f));
|
|
964
965
|
return (f.type === "formula" || kind === "formula" || kind === "lookup" || kind === "rollup") && String(f.compute_on ?? "read") === "read";
|
|
965
966
|
}
|
|
966
|
-
function containsPattern(text) {
|
|
967
|
-
return `(?i)${text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`;
|
|
968
|
-
}
|
|
969
967
|
var BLANK_VALUE = "__empty__";
|
|
970
968
|
var field = (f) => ({ field: f.id });
|
|
971
969
|
var constant = (value) => ({ const: value });
|
|
@@ -50895,10 +50893,14 @@ import { useEffect as useEffect120, useState as useState140 } from "react";
|
|
|
50895
50893
|
import { RecordsProvider as RecordsProvider3, useRecordsClient as useRecordsClient100 } from "@ai-matrx/records/react";
|
|
50896
50894
|
import { Button as Button113 } from "@ai-matrx/design-system";
|
|
50897
50895
|
import { jsx as jsx168, jsxs as jsxs156 } from "react/jsx-runtime";
|
|
50898
|
-
function HeldChangeDecision({ dataSource, userId, organizationId, approvalId, onDecided }) {
|
|
50899
|
-
return /* @__PURE__ */ jsx168(RecordsProvider3, { config: { dataSource, actor: personActor(userId), organizationId }, children: /* @__PURE__ */ jsx168(Decision, { approvalId, onDecided }) });
|
|
50896
|
+
function HeldChangeDecision({ dataSource, userId, organizationId, approvalId, onDecided, approveLabel }) {
|
|
50897
|
+
return /* @__PURE__ */ jsx168(RecordsProvider3, { config: { dataSource, actor: personActor(userId), organizationId }, children: /* @__PURE__ */ jsx168(Decision, { approvalId, onDecided, approveLabel: approveLabel ?? "Approve" }) });
|
|
50900
50898
|
}
|
|
50901
|
-
function Decision({
|
|
50899
|
+
function Decision({
|
|
50900
|
+
approvalId,
|
|
50901
|
+
onDecided,
|
|
50902
|
+
approveLabel
|
|
50903
|
+
}) {
|
|
50902
50904
|
const client = useRecordsClient100();
|
|
50903
50905
|
const [may, setMay] = useState140(null);
|
|
50904
50906
|
const [busy, setBusy] = useState140(null);
|
|
@@ -50928,7 +50930,7 @@ function Decision({ approvalId, onDecided }) {
|
|
|
50928
50930
|
if (may === null) return /* @__PURE__ */ jsx168("p", { className: "text-xs text-muted-foreground", children: "Checking who can decide\u2026" });
|
|
50929
50931
|
return /* @__PURE__ */ jsxs156("div", { className: "flex flex-col gap-1.5", children: [
|
|
50930
50932
|
may ? /* @__PURE__ */ jsxs156("div", { className: "flex gap-2", children: [
|
|
50931
|
-
/* @__PURE__ */ jsx168(Button113, { type: "button", size: "sm", disabled: busy !== null, onClick: () => void decide(true), children: busy === "approve" ? "Approving\u2026" :
|
|
50933
|
+
/* @__PURE__ */ jsx168(Button113, { type: "button", size: "sm", disabled: busy !== null, onClick: () => void decide(true), children: busy === "approve" ? "Approving\u2026" : approveLabel }),
|
|
50932
50934
|
/* @__PURE__ */ jsx168(Button113, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void decide(false), children: busy === "refuse" ? "Refusing\u2026" : "Refuse" })
|
|
50933
50935
|
] }) : !error && /* @__PURE__ */ jsx168("p", { className: "text-xs text-muted-foreground", children: "An owner or admin of this organization decides this." }),
|
|
50934
50936
|
error ? /* @__PURE__ */ jsx168(RefusalLine, { error }) : null
|