@ai-matrx/records-ui 0.113.3 → 0.113.6
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 +21 -1
- package/dist/index.cjs +282 -261
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +40 -19
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +91 -76
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.d.cts +1 -1
- package/dist/pickers.d.ts +1 -1
- package/dist/pickers.js +22 -7
- package/dist/pickers.js.map +1 -1
- package/package.json +2 -2
package/dist/pickers.d.cts
CHANGED
|
@@ -9,7 +9,7 @@ interface TableAnywhere {
|
|
|
9
9
|
organization_id: Uuid;
|
|
10
10
|
organization_name: string;
|
|
11
11
|
kind: string | null;
|
|
12
|
-
|
|
12
|
+
platform_owned: boolean;
|
|
13
13
|
/** When the table last changed (the door's own column) — what tells two same-named tables apart. */
|
|
14
14
|
updated_at?: string | null;
|
|
15
15
|
/** Who made it, when the door says. */
|
package/dist/pickers.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ interface TableAnywhere {
|
|
|
9
9
|
organization_id: Uuid;
|
|
10
10
|
organization_name: string;
|
|
11
11
|
kind: string | null;
|
|
12
|
-
|
|
12
|
+
platform_owned: boolean;
|
|
13
13
|
/** When the table last changed (the door's own column) — what tells two same-named tables apart. */
|
|
14
14
|
updated_at?: string | null;
|
|
15
15
|
/** Who made it, when the door says. */
|
package/dist/pickers.js
CHANGED
|
@@ -66,7 +66,7 @@ function fieldOptionsOnce(client, fieldId) {
|
|
|
66
66
|
|
|
67
67
|
// src/editors.tsx
|
|
68
68
|
import { useCallback as useCallback5, useEffect as useEffect10, useLayoutEffect as useLayoutEffect2, useRef as useRef12, useState as useState15 } from "react";
|
|
69
|
-
import { allowsOtherValues, choiceValuesOf, coerceTypedAnswer, newerKindOf as
|
|
69
|
+
import { allowsOtherValues, choiceValuesOf, coerceTypedAnswer, newerKindOf as newerKindOf5, decideTypedChoice, isTheChosen, optionKey as optionKey2, rankTypedMatches as rankTypedMatches3, readTypedTime as readTypedTime2, typedDateText as typedDateText2, typedTimeText as typedTimeText2 } from "@ai-matrx/records";
|
|
70
70
|
import { useOptionalRecordsClient as useOptionalRecordsClient7 } from "@ai-matrx/records/react";
|
|
71
71
|
import {
|
|
72
72
|
BasicInput as BasicInput5,
|
|
@@ -458,6 +458,7 @@ function BarcodeControl({ value, onChange, disabled, id }) {
|
|
|
458
458
|
}
|
|
459
459
|
|
|
460
460
|
// src/choiceLooks.ts
|
|
461
|
+
import { newerKindOf as newerKindOf2 } from "@ai-matrx/records";
|
|
461
462
|
import {
|
|
462
463
|
CHOICE_CHIP_CLASS,
|
|
463
464
|
NEUTRAL_CHIP_CLASS,
|
|
@@ -496,6 +497,20 @@ function choiceLooksOf(field) {
|
|
|
496
497
|
function choiceWord(value) {
|
|
497
498
|
return String(value ?? "").trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
498
499
|
}
|
|
500
|
+
var STATUS_GROUP_COLOR = { todo: "gray", in_progress: "blue", done: "green" };
|
|
501
|
+
function statusGroupColor(field, value) {
|
|
502
|
+
if (newerKindOf2(field) !== "status" || value === null || value === void 0 || value === "") return void 0;
|
|
503
|
+
const word = choiceWord(value);
|
|
504
|
+
if (word === "") return void 0;
|
|
505
|
+
const groups = (field.config ?? {})["status_groups"];
|
|
506
|
+
if (groups && typeof groups === "object") {
|
|
507
|
+
for (const [key, group] of Object.entries(groups)) {
|
|
508
|
+
if (choiceWord(key) !== word) continue;
|
|
509
|
+
return group === "in_progress" ? STATUS_GROUP_COLOR.in_progress : group === "done" ? STATUS_GROUP_COLOR.done : STATUS_GROUP_COLOR.todo;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
return STATUS_GROUP_COLOR.todo;
|
|
513
|
+
}
|
|
499
514
|
function storedChoiceColor(field, value) {
|
|
500
515
|
if (value === null || value === void 0 || value === "") return void 0;
|
|
501
516
|
const word = choiceWord(value);
|
|
@@ -504,7 +519,7 @@ function storedChoiceColor(field, value) {
|
|
|
504
519
|
if (!look.color) continue;
|
|
505
520
|
if (choiceWord(look.value) === word || look.label && choiceWord(look.label) === word) return look.color;
|
|
506
521
|
}
|
|
507
|
-
return
|
|
522
|
+
return statusGroupColor(field, value);
|
|
508
523
|
}
|
|
509
524
|
function choiceChipLookOf(field, ...words) {
|
|
510
525
|
for (const word of words) {
|
|
@@ -519,7 +534,7 @@ import {
|
|
|
519
534
|
KERNEL_TABLES,
|
|
520
535
|
PARITY_FIELD_TYPES,
|
|
521
536
|
fieldKindFor,
|
|
522
|
-
newerKindOf as
|
|
537
|
+
newerKindOf as newerKindOf3
|
|
523
538
|
} from "@ai-matrx/records";
|
|
524
539
|
import { humanizeIdentifier } from "@ai-matrx/kit/text-case";
|
|
525
540
|
|
|
@@ -2781,7 +2796,7 @@ import {
|
|
|
2781
2796
|
COLOR_ROTATION
|
|
2782
2797
|
} from "@ai-matrx/design-system/data-table";
|
|
2783
2798
|
import { getFieldFormat } from "@ai-matrx/design-system/field-formats";
|
|
2784
|
-
import { newerKindOf as
|
|
2799
|
+
import { newerKindOf as newerKindOf4, ratingMaxOf } from "@ai-matrx/records";
|
|
2785
2800
|
var DRAWN_KINDS = /* @__PURE__ */ new Set(["select", "multi_select", "relation", "member", "person", "attachment", "file", "entity_reference", "checkbox", "boolean", "signature", "json"]);
|
|
2786
2801
|
function shownAsOf(field) {
|
|
2787
2802
|
if (DRAWN_KINDS.has(String(editorKindFor(field)))) return void 0;
|
|
@@ -2794,7 +2809,7 @@ function shownAsOf(field) {
|
|
|
2794
2809
|
}
|
|
2795
2810
|
function formatForField(field) {
|
|
2796
2811
|
const shownAs = shownAsOf(field);
|
|
2797
|
-
if (
|
|
2812
|
+
if (newerKindOf4(field) === "rating" && (!shownAs || shownAs.id === "rating")) {
|
|
2798
2813
|
return { id: "rating", options: { ...shownAs?.options ?? {}, ratingMax: ratingMaxOf(field) } };
|
|
2799
2814
|
}
|
|
2800
2815
|
if (shownAs) return shownAs;
|
|
@@ -4251,10 +4266,10 @@ import { jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
|
4251
4266
|
var PLATFORM_TABLE_PREFIX = "records_ui_";
|
|
4252
4267
|
function isValueSet(table) {
|
|
4253
4268
|
if (table.kept_for === "choices") return true;
|
|
4254
|
-
return table.kept_for == null && table.kind === "list" && table.
|
|
4269
|
+
return table.kept_for == null && table.kind === "list" && table.platform_owned === true;
|
|
4255
4270
|
}
|
|
4256
4271
|
function isKeptTable(table) {
|
|
4257
|
-
return table.
|
|
4272
|
+
return table.platform_owned === true || isValueSet(table) || Boolean(table.work_kind) || (table.slug ?? "").startsWith(PLATFORM_TABLE_PREFIX);
|
|
4258
4273
|
}
|
|
4259
4274
|
var CHOICES_SUFFIX = / choices$/i;
|
|
4260
4275
|
function tablePickerEntries(tables, options = {}) {
|