@ai-matrx/records-ui 0.116.59 → 0.116.60
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 +52 -1
- package/dist/{SaveToTable-2TQKEYJA.js → SaveToTable-VPLDWCSU.js} +4 -4
- package/dist/{chunk-AJVN4BMI.js → chunk-2YK72GHL.js} +305 -248
- package/dist/chunk-2YK72GHL.js.map +1 -0
- package/dist/{chunk-NGOPU3AJ.js → chunk-4KWCNW7V.js} +5 -4
- package/dist/{chunk-NGOPU3AJ.js.map → chunk-4KWCNW7V.js.map} +1 -1
- package/dist/{chunk-MBUW42SM.js → chunk-NBL26U5K.js} +2 -2
- package/dist/{chunk-4ZS4WEEE.js → chunk-TEYXG4XD.js} +73 -4
- package/dist/chunk-TEYXG4XD.js.map +1 -0
- package/dist/{chunk-HAWACXPU.js → chunk-W6FX3XVF.js} +2 -2
- package/dist/{chunk-Y6U5OFJX.js → chunk-WXYI4DKC.js} +3 -3
- package/dist/data-source.cjs +2 -1
- package/dist/data-source.cjs.map +1 -1
- package/dist/data-source.js +2 -1
- package/dist/data-source.js.map +1 -1
- package/dist/helpers.cjs +7 -7
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.js +8 -8
- package/dist/helpers.js.map +1 -1
- package/dist/index.cjs +732 -616
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -16
- package/dist/index.d.ts +17 -16
- package/dist/index.js +53 -62
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +106 -96
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +4 -4
- package/dist/skeleton.js +3 -3
- package/package.json +4 -4
- package/dist/chunk-4ZS4WEEE.js.map +0 -1
- package/dist/chunk-AJVN4BMI.js.map +0 -1
- /package/dist/{SaveToTable-2TQKEYJA.js.map → SaveToTable-VPLDWCSU.js.map} +0 -0
- /package/dist/{chunk-MBUW42SM.js.map → chunk-NBL26U5K.js.map} +0 -0
- /package/dist/{chunk-HAWACXPU.js.map → chunk-W6FX3XVF.js.map} +0 -0
- /package/dist/{chunk-Y6U5OFJX.js.map → chunk-WXYI4DKC.js.map} +0 -0
package/dist/pickers.cjs
CHANGED
|
@@ -649,6 +649,45 @@ var init_Refusal = __esm({
|
|
|
649
649
|
}
|
|
650
650
|
});
|
|
651
651
|
|
|
652
|
+
// src/personZone.ts
|
|
653
|
+
function getPersonTimeZone() {
|
|
654
|
+
return state.zone;
|
|
655
|
+
}
|
|
656
|
+
function subscribePersonTimeZone(listener) {
|
|
657
|
+
state.listeners.add(listener);
|
|
658
|
+
return () => {
|
|
659
|
+
state.listeners.delete(listener);
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
function personWallNow(at = /* @__PURE__ */ new Date()) {
|
|
663
|
+
const zone = state.zone;
|
|
664
|
+
if (!zone) return at;
|
|
665
|
+
const parts = new Intl.DateTimeFormat("en-US", {
|
|
666
|
+
timeZone: zone,
|
|
667
|
+
year: "numeric",
|
|
668
|
+
month: "2-digit",
|
|
669
|
+
day: "2-digit",
|
|
670
|
+
hour: "2-digit",
|
|
671
|
+
minute: "2-digit",
|
|
672
|
+
second: "2-digit",
|
|
673
|
+
hourCycle: "h23"
|
|
674
|
+
}).formatToParts(at);
|
|
675
|
+
const n = (t) => Number(parts.find((p) => p.type === t)?.value ?? 0);
|
|
676
|
+
return new Date(n("year"), n("month") - 1, n("day"), n("hour"), n("minute"), n("second"));
|
|
677
|
+
}
|
|
678
|
+
var import_table_style2, import_global_slot, state;
|
|
679
|
+
var init_personZone = __esm({
|
|
680
|
+
"src/personZone.ts"() {
|
|
681
|
+
"use strict";
|
|
682
|
+
import_table_style2 = require("@ai-matrx/design-system/data-table/table-style");
|
|
683
|
+
import_global_slot = require("@ai-matrx/kit/global-slot");
|
|
684
|
+
state = (0, import_global_slot.globalSlot)("ai-matrx.records-ui.person-time-zone", () => ({
|
|
685
|
+
zone: null,
|
|
686
|
+
listeners: /* @__PURE__ */ new Set()
|
|
687
|
+
}));
|
|
688
|
+
}
|
|
689
|
+
});
|
|
690
|
+
|
|
652
691
|
// src/dates.ts
|
|
653
692
|
function systemStampOf(field) {
|
|
654
693
|
if (field.type !== "formula") return null;
|
|
@@ -688,11 +727,12 @@ function dateText(field, value) {
|
|
|
688
727
|
function isDateLike(value) {
|
|
689
728
|
return typeof value === "string" && /^\d{4}-\d{2}-\d{2}/.test(value.trim());
|
|
690
729
|
}
|
|
691
|
-
var import_field_formats, BARE_CALENDAR_DATE;
|
|
730
|
+
var import_field_formats, import_field_formats2, BARE_CALENDAR_DATE;
|
|
692
731
|
var init_dates = __esm({
|
|
693
732
|
"src/dates.ts"() {
|
|
694
733
|
"use strict";
|
|
695
734
|
import_field_formats = require("@ai-matrx/design-system/field-formats");
|
|
735
|
+
import_field_formats2 = require("@ai-matrx/design-system/field-formats");
|
|
696
736
|
BARE_CALENDAR_DATE = /^(\d{4})-(\d{2})-(\d{2})(?:[T ]00:00(?::00(?:\.0+)?)?)?$/;
|
|
697
737
|
}
|
|
698
738
|
});
|
|
@@ -1274,12 +1314,13 @@ function madeOn(stamp) {
|
|
|
1274
1314
|
if (!stamp) return null;
|
|
1275
1315
|
const at = new Date(stamp);
|
|
1276
1316
|
if (Number.isNaN(at.getTime())) return null;
|
|
1277
|
-
return new Intl.DateTimeFormat(void 0, { month: "short", day: "numeric", year: "numeric" }).format(at);
|
|
1317
|
+
return new Intl.DateTimeFormat(void 0, { month: "short", day: "numeric", year: "numeric", ...(0, import_field_formats3.momentZoneOptions)(at) }).format(at);
|
|
1278
1318
|
}
|
|
1279
|
-
var PLATFORM_TABLE_PREFIX, CHOICES_SUFFIX;
|
|
1319
|
+
var import_field_formats3, PLATFORM_TABLE_PREFIX, CHOICES_SUFFIX;
|
|
1280
1320
|
var init_tablePickerEntries = __esm({
|
|
1281
1321
|
"src/tablePickerEntries.ts"() {
|
|
1282
1322
|
"use strict";
|
|
1323
|
+
import_field_formats3 = require("@ai-matrx/design-system/field-formats");
|
|
1283
1324
|
PLATFORM_TABLE_PREFIX = "records_ui_";
|
|
1284
1325
|
CHOICES_SUFFIX = / choices$/i;
|
|
1285
1326
|
}
|
|
@@ -1422,8 +1463,8 @@ var init_enumLabels = __esm({
|
|
|
1422
1463
|
FIELD_SENSITIVITY_LABEL = {
|
|
1423
1464
|
public: "Anyone who can open the record",
|
|
1424
1465
|
internal: "People in this organization",
|
|
1425
|
-
confidential: "
|
|
1426
|
-
restricted: "
|
|
1466
|
+
confidential: "Editors and administrators",
|
|
1467
|
+
restricted: "Administrators only"
|
|
1427
1468
|
};
|
|
1428
1469
|
CONTEXT_POLICY_LABEL = {
|
|
1429
1470
|
include: "Yes, an assistant can read it",
|
|
@@ -6424,7 +6465,7 @@ function withoutLeadingBlank(text) {
|
|
|
6424
6465
|
// src/values.tsx
|
|
6425
6466
|
init_personChip();
|
|
6426
6467
|
var import_data_table3 = require("@ai-matrx/design-system/data-table");
|
|
6427
|
-
var
|
|
6468
|
+
var import_field_formats9 = require("@ai-matrx/design-system/field-formats");
|
|
6428
6469
|
var import_design_system32 = require("@ai-matrx/design-system");
|
|
6429
6470
|
init_parity();
|
|
6430
6471
|
init_dates();
|
|
@@ -6433,8 +6474,8 @@ init_dates();
|
|
|
6433
6474
|
var import_react22 = require("react");
|
|
6434
6475
|
|
|
6435
6476
|
// src/presentation.ts
|
|
6436
|
-
var
|
|
6437
|
-
var
|
|
6477
|
+
var import_table_style3 = require("@ai-matrx/design-system/data-table/table-style");
|
|
6478
|
+
var import_field_formats4 = require("@ai-matrx/design-system/field-formats");
|
|
6438
6479
|
var import_field_kinds6 = require("@ai-matrx/records/field-kinds");
|
|
6439
6480
|
init_parity();
|
|
6440
6481
|
init_dates();
|
|
@@ -6444,7 +6485,7 @@ function shownAsOf(field) {
|
|
|
6444
6485
|
const raw = field.display_format;
|
|
6445
6486
|
if (!raw || typeof raw !== "object") return void 0;
|
|
6446
6487
|
const id = raw.id;
|
|
6447
|
-
if (typeof id !== "string" || id === "formula" || !(0,
|
|
6488
|
+
if (typeof id !== "string" || id === "formula" || !(0, import_field_formats4.getFieldFormat)(id)) return void 0;
|
|
6448
6489
|
const options = raw.options;
|
|
6449
6490
|
return options && typeof options === "object" && Object.keys(options).length > 0 ? { id, options } : { id };
|
|
6450
6491
|
}
|
|
@@ -6810,7 +6851,7 @@ function encodeAt(canvas, type, maxWidth, quality) {
|
|
|
6810
6851
|
var import_react25 = require("react");
|
|
6811
6852
|
var import_icons = require("@ai-matrx/design-system/icons");
|
|
6812
6853
|
var import_design_system17 = require("@ai-matrx/design-system");
|
|
6813
|
-
var
|
|
6854
|
+
var import_field_formats5 = require("@ai-matrx/design-system/field-formats");
|
|
6814
6855
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
6815
6856
|
var TYPE_SAMPLE = "The quick brown fox jumps over the lazy dog";
|
|
6816
6857
|
var HEX_6 = /^#[0-9a-f]{6}$/i;
|
|
@@ -6837,17 +6878,17 @@ function colorPairContrast(pair, format, context) {
|
|
|
6837
6878
|
if (!ground) return {};
|
|
6838
6879
|
const out = {};
|
|
6839
6880
|
if (ground.light) {
|
|
6840
|
-
const r = (0,
|
|
6881
|
+
const r = (0, import_field_formats5.contrastRatio)(pair.light, ground.light);
|
|
6841
6882
|
if (r !== null) out.light = r;
|
|
6842
6883
|
}
|
|
6843
6884
|
if (ground.dark) {
|
|
6844
|
-
const r = (0,
|
|
6885
|
+
const r = (0, import_field_formats5.contrastRatio)(pair.dark ?? pair.light, ground.dark);
|
|
6845
6886
|
if (r !== null) out.dark = r;
|
|
6846
6887
|
}
|
|
6847
6888
|
return out;
|
|
6848
6889
|
}
|
|
6849
6890
|
function ContrastMark({ ratio, min }) {
|
|
6850
|
-
const level = (0,
|
|
6891
|
+
const level = (0, import_field_formats5.contrastLevel)(ratio, min);
|
|
6851
6892
|
const said2 = `${ratio}:1`;
|
|
6852
6893
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
6853
6894
|
"span",
|
|
@@ -6863,7 +6904,7 @@ function ContrastMark({ ratio, min }) {
|
|
|
6863
6904
|
);
|
|
6864
6905
|
}
|
|
6865
6906
|
function ColorPairView({ value, format }) {
|
|
6866
|
-
const pair = (0,
|
|
6907
|
+
const pair = (0, import_field_formats5.readColorPair)(value);
|
|
6867
6908
|
if (!pair) return null;
|
|
6868
6909
|
const contrast = colorPairContrast(pair, format);
|
|
6869
6910
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { "data-records-look": "color_pair", className: "inline-flex min-w-0 items-center gap-3", children: [
|
|
@@ -6932,7 +6973,7 @@ function ColorWell({
|
|
|
6932
6973
|
] });
|
|
6933
6974
|
}
|
|
6934
6975
|
function ColorPairEditor({ value, onChange, disabled, id, label }) {
|
|
6935
|
-
const pair = (0,
|
|
6976
|
+
const pair = (0, import_field_formats5.readColorPair)(value) ?? { light: "" };
|
|
6936
6977
|
const write = (next) => onChange(next.light ? JSON.stringify(next) : null);
|
|
6937
6978
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "grid grid-cols-[auto_1fr] items-center gap-x-2 gap-y-1.5", children: [
|
|
6938
6979
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xs text-muted-foreground", children: "Light" }),
|
|
@@ -6962,7 +7003,7 @@ function ColorPairEditor({ value, onChange, disabled, id, label }) {
|
|
|
6962
7003
|
] });
|
|
6963
7004
|
}
|
|
6964
7005
|
function ColorPairPreview({ value }) {
|
|
6965
|
-
const pair = (0,
|
|
7006
|
+
const pair = (0, import_field_formats5.readColorPair)(value);
|
|
6966
7007
|
if (!pair) return null;
|
|
6967
7008
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "grid h-24 w-full grid-cols-2 overflow-hidden rounded-lg border border-border", children: [
|
|
6968
7009
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "flex items-end p-2", style: { backgroundColor: pair.light }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "rounded bg-background px-1.5 py-0.5 text-xs text-foreground", children: "Light" }) }),
|
|
@@ -6970,16 +7011,16 @@ function ColorPairPreview({ value }) {
|
|
|
6970
7011
|
] });
|
|
6971
7012
|
}
|
|
6972
7013
|
function colorPairChecks(value, format, context) {
|
|
6973
|
-
const pair = (0,
|
|
7014
|
+
const pair = (0, import_field_formats5.readColorPair)(value);
|
|
6974
7015
|
if (!pair) return [];
|
|
6975
7016
|
const contrast = colorPairContrast(pair, format, context);
|
|
6976
7017
|
const ground = colorPairGround(format, context)?.label ?? "its background";
|
|
6977
7018
|
const out = [];
|
|
6978
7019
|
for (const part of ["light", "dark"]) {
|
|
6979
7020
|
const ratio = contrast[part];
|
|
6980
|
-
if (ratio === void 0 || (0,
|
|
7021
|
+
if (ratio === void 0 || (0, import_field_formats5.contrastLevel)(ratio, pair.min) === "pass") continue;
|
|
6981
7022
|
const color = part === "light" ? pair.light : pair.dark ?? pair.light;
|
|
6982
|
-
const need = pair.min ??
|
|
7023
|
+
const need = pair.min ?? import_field_formats5.TEXT_CONTRAST;
|
|
6983
7024
|
out.push({
|
|
6984
7025
|
part,
|
|
6985
7026
|
message: `hard to read on ${ground}`,
|
|
@@ -7107,16 +7148,16 @@ function MeasurePreview({ value, format }) {
|
|
|
7107
7148
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: dotted, "data-records-measure-preview": "size", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "h-3 rounded-full bg-primary", style: { width: Math.max(2, clamped) } }) });
|
|
7108
7149
|
}
|
|
7109
7150
|
function TypeStyleView({ value }) {
|
|
7110
|
-
const style = (0,
|
|
7151
|
+
const style = (0, import_field_formats5.readTypeStyle)(value);
|
|
7111
7152
|
if (!style) return null;
|
|
7112
7153
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { "data-records-look": "type_style", className: "flex min-w-0 flex-col items-start gap-1", children: [
|
|
7113
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "block max-w-full truncate text-foreground", style: (0,
|
|
7114
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "rounded-md border border-border bg-muted px-1.5 py-0.5 text-xs text-muted-foreground", children: (0,
|
|
7154
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "block max-w-full truncate text-foreground", style: (0, import_field_formats5.typeStyleCss)(style), children: TYPE_SAMPLE }),
|
|
7155
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "rounded-md border border-border bg-muted px-1.5 py-0.5 text-xs text-muted-foreground", children: (0, import_field_formats5.typeStyleText)(style) })
|
|
7115
7156
|
] });
|
|
7116
7157
|
}
|
|
7117
7158
|
var FIELD = "grid grid-cols-[6rem_1fr] items-center gap-2";
|
|
7118
7159
|
function TypeStyleEditor({ value, onChange, disabled, id, label }) {
|
|
7119
|
-
const style = (0,
|
|
7160
|
+
const style = (0, import_field_formats5.readTypeStyle)(value) ?? { font: "", weight: 400, size: 13, lineHeight: 20, letterSpacing: 0 };
|
|
7120
7161
|
const write = (next) => {
|
|
7121
7162
|
const merged = { ...style };
|
|
7122
7163
|
for (const [k, v] of Object.entries(next)) {
|
|
@@ -7142,7 +7183,7 @@ function TypeStyleEditor({ value, onChange, disabled, id, label }) {
|
|
|
7142
7183
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "grid grid-cols-[1fr_6rem] gap-2", children: [
|
|
7143
7184
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_design_system17.Select, { value: String(clampWeight(style.weight)), disabled: disabled ?? false, onValueChange: (v) => write({ weight: clampWeight(Number(v)) }), children: [
|
|
7144
7185
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system17.SelectTrigger, { "aria-label": `${label} weight`, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system17.SelectValue, {}) }),
|
|
7145
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system17.SelectContent, { children:
|
|
7186
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system17.SelectContent, { children: import_field_formats5.TYPE_WEIGHTS.map((w) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system17.SelectItem, { value: String(w.value), children: w.label }, w.value)) })
|
|
7146
7187
|
] }),
|
|
7147
7188
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(UnitInput, { label: `${label} size`, unit: "px", value: style.size, disabled, onChange: (n) => n !== null && write({ size: clampSize(n) }) })
|
|
7148
7189
|
] })
|
|
@@ -7166,8 +7207,8 @@ function UnitInput({
|
|
|
7166
7207
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(NumberBox, { label, unit, value, disabled, onChange });
|
|
7167
7208
|
}
|
|
7168
7209
|
function TypeStylePreview({ value }) {
|
|
7169
|
-
const style = (0,
|
|
7170
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "flex h-28 w-full items-center justify-center overflow-hidden rounded-lg border border-border bg-muted px-4", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "truncate text-foreground", style: style ? (0,
|
|
7210
|
+
const style = (0, import_field_formats5.readTypeStyle)(value);
|
|
7211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "flex h-28 w-full items-center justify-center overflow-hidden rounded-lg border border-border bg-muted px-4", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "truncate text-foreground", style: style ? (0, import_field_formats5.typeStyleCss)(style) : void 0, children: style ? TYPE_SAMPLE : "Aa" }) });
|
|
7171
7212
|
}
|
|
7172
7213
|
var THEME_GROUNDS = { light: { ground: "#f4f4f5", card: "#ffffff" }, dark: { ground: "#0b0c0e", card: "#18191c" } };
|
|
7173
7214
|
function ShadowSwatch({ layers, theme, size = "sm" }) {
|
|
@@ -7179,13 +7220,13 @@ function ShadowSwatch({ layers, theme, size = "sm" }) {
|
|
|
7179
7220
|
"data-records-shadow-swatch": theme,
|
|
7180
7221
|
className: (0, import_design_system17.cn)("flex shrink-0 items-center justify-center rounded-md", size === "lg" ? "h-24 w-full" : "h-7 w-11"),
|
|
7181
7222
|
style: { backgroundColor: g.ground },
|
|
7182
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: (0, import_design_system17.cn)("rounded", size === "lg" ? "h-12 w-20" : "h-3.5 w-6"), style: { backgroundColor: g.card, boxShadow: (0,
|
|
7223
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: (0, import_design_system17.cn)("rounded", size === "lg" ? "h-12 w-20" : "h-3.5 w-6"), style: { backgroundColor: g.card, boxShadow: (0, import_field_formats5.shadowCss)(layers) } })
|
|
7183
7224
|
}
|
|
7184
7225
|
);
|
|
7185
7226
|
}
|
|
7186
|
-
var layersWords =
|
|
7227
|
+
var layersWords = import_field_formats5.shadowWords;
|
|
7187
7228
|
function ShadowView({ value }) {
|
|
7188
|
-
const pair = (0,
|
|
7229
|
+
const pair = (0, import_field_formats5.readShadowPair)(value);
|
|
7189
7230
|
if (!pair) return null;
|
|
7190
7231
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { "data-records-look": "shadow", className: "inline-flex min-w-0 items-center gap-2", children: [
|
|
7191
7232
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ShadowSwatch, { layers: pair.light, theme: "light" }),
|
|
@@ -7222,7 +7263,7 @@ function ShadowLayersEditor({
|
|
|
7222
7263
|
] });
|
|
7223
7264
|
}
|
|
7224
7265
|
function ShadowEditor({ value, onChange, disabled, id, label }) {
|
|
7225
|
-
const pair = (0,
|
|
7266
|
+
const pair = (0, import_field_formats5.readShadowPair)(value) ?? { light: [NEW_LAYER], dark: [NEW_LAYER] };
|
|
7226
7267
|
const own3 = (() => {
|
|
7227
7268
|
const raw = typeof value === "string" && value.trim().startsWith("{") ? value : null;
|
|
7228
7269
|
return raw !== null && raw.includes('"dark"');
|
|
@@ -7259,7 +7300,7 @@ function ShadowEditor({ value, onChange, disabled, id, label }) {
|
|
|
7259
7300
|
] });
|
|
7260
7301
|
}
|
|
7261
7302
|
function ShadowPreview({ value }) {
|
|
7262
|
-
const pair = (0,
|
|
7303
|
+
const pair = (0, import_field_formats5.readShadowPair)(value) ?? { light: [NEW_LAYER], dark: [NEW_LAYER] };
|
|
7263
7304
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "grid w-full grid-cols-2 gap-2", children: [
|
|
7264
7305
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ShadowSwatch, { layers: pair.light, theme: "light", size: "lg" }),
|
|
7265
7306
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ShadowSwatch, { layers: pair.dark, theme: "dark", size: "lg" })
|
|
@@ -7270,7 +7311,7 @@ function OpacitySwatch({ opacity, size = "sm" }) {
|
|
|
7270
7311
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { "aria-hidden": true, className: (0, import_design_system17.cn)("relative inline-block shrink-0 overflow-hidden rounded border border-border", size === "lg" ? "h-24 w-full" : "h-5 w-5"), style: { background: CHECKER }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "absolute inset-0 bg-foreground", style: { opacity } }) });
|
|
7271
7312
|
}
|
|
7272
7313
|
function OpacityView({ value }) {
|
|
7273
|
-
const o = (0,
|
|
7314
|
+
const o = (0, import_field_formats5.readOpacity)(value);
|
|
7274
7315
|
if (o === null) return null;
|
|
7275
7316
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { "data-records-look": "opacity", className: "inline-flex items-center gap-2 tabular-nums", children: [
|
|
7276
7317
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(OpacitySwatch, { opacity: o }),
|
|
@@ -7279,7 +7320,7 @@ function OpacityView({ value }) {
|
|
|
7279
7320
|
] });
|
|
7280
7321
|
}
|
|
7281
7322
|
function OpacityEditor({ value, onChange, disabled, id, label }) {
|
|
7282
|
-
const o = (0,
|
|
7323
|
+
const o = (0, import_field_formats5.readOpacity)(value);
|
|
7283
7324
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex items-center gap-2", children: [
|
|
7284
7325
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(NumberBox, { id, label, value: o, unit: "", disabled, className: "w-full max-w-28", onChange: (n) => onChange(n === null ? null : Math.min(1, Math.max(0, n))) }),
|
|
7285
7326
|
o !== null ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(OpacitySwatch, { opacity: o }) : null,
|
|
@@ -7290,7 +7331,7 @@ function OpacityEditor({ value, onChange, disabled, id, label }) {
|
|
|
7290
7331
|
] });
|
|
7291
7332
|
}
|
|
7292
7333
|
function OpacityPreview({ value }) {
|
|
7293
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(OpacitySwatch, { opacity: (0,
|
|
7334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(OpacitySwatch, { opacity: (0, import_field_formats5.readOpacity)(value) ?? 0.5, size: "lg" });
|
|
7294
7335
|
}
|
|
7295
7336
|
function MotionTrack({ motion, size = "sm" }) {
|
|
7296
7337
|
const id = `m${Math.round(motion.duration)}-${motion.easing.replace(/[^a-z0-9]/gi, "")}`;
|
|
@@ -7312,27 +7353,27 @@ function MotionTrack({ motion, size = "sm" }) {
|
|
|
7312
7353
|
] });
|
|
7313
7354
|
}
|
|
7314
7355
|
function MotionView({ value }) {
|
|
7315
|
-
const m = (0,
|
|
7356
|
+
const m = (0, import_field_formats5.readMotion)(value);
|
|
7316
7357
|
if (!m) return null;
|
|
7317
7358
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { "data-records-look": "motion", className: "inline-flex items-center gap-2", children: [
|
|
7318
7359
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MotionTrack, { motion: m }),
|
|
7319
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "tabular-nums", children: (0,
|
|
7360
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "tabular-nums", children: (0, import_field_formats5.motionText)(m) })
|
|
7320
7361
|
] });
|
|
7321
7362
|
}
|
|
7322
7363
|
function MotionEditor({ value, onChange, disabled, id, label }) {
|
|
7323
|
-
const m = (0,
|
|
7364
|
+
const m = (0, import_field_formats5.readMotion)(value) ?? { duration: 200, easing: "ease-out" };
|
|
7324
7365
|
const write = (next) => onChange(JSON.stringify({ ...m, ...next }));
|
|
7325
7366
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex flex-wrap items-center gap-2", children: [
|
|
7326
7367
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(NumberBox, { id, label: `${label} duration`, value: m.duration, unit: "ms", disabled, className: "w-24", onChange: (n) => n !== null && n >= 0 && write({ duration: n }) }),
|
|
7327
7368
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_design_system17.Select, { value: m.easing, disabled: disabled ?? false, onValueChange: (v) => write({ easing: v }), children: [
|
|
7328
7369
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system17.SelectTrigger, { "aria-label": `${label} easing`, className: "h-7 w-36 text-xs", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system17.SelectValue, {}) }),
|
|
7329
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system17.SelectContent, { children:
|
|
7370
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system17.SelectContent, { children: import_field_formats5.MOTION_EASINGS.map((e) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system17.SelectItem, { value: e.value, children: e.label }, e.value)) })
|
|
7330
7371
|
] }),
|
|
7331
7372
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MotionTrack, { motion: m })
|
|
7332
7373
|
] });
|
|
7333
7374
|
}
|
|
7334
7375
|
function MotionPreview({ value }) {
|
|
7335
|
-
const m = (0,
|
|
7376
|
+
const m = (0, import_field_formats5.readMotion)(value) ?? { duration: 200, easing: "ease-out" };
|
|
7336
7377
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "flex h-24 w-full items-center rounded-lg border border-border bg-muted px-4", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MotionTrack, { motion: m, size: "lg" }) });
|
|
7337
7378
|
}
|
|
7338
7379
|
var DESIGN_LOOKS = [
|
|
@@ -7674,7 +7715,7 @@ function registeredLook(format) {
|
|
|
7674
7715
|
}
|
|
7675
7716
|
|
|
7676
7717
|
// src/labels.tsx
|
|
7677
|
-
var
|
|
7718
|
+
var import_field_formats6 = require("@ai-matrx/design-system/field-formats");
|
|
7678
7719
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
7679
7720
|
var LabelContext = (0, import_react28.createContext)({
|
|
7680
7721
|
// With no provider the resolver is ABSENT, not silently empty: a caller gets
|
|
@@ -8077,12 +8118,12 @@ function WholeValueCell({ words, pointer }) {
|
|
|
8077
8118
|
|
|
8078
8119
|
// src/values.tsx
|
|
8079
8120
|
init_choiceLooks();
|
|
8080
|
-
var
|
|
8121
|
+
var import_field_formats10 = require("@ai-matrx/design-system/field-formats");
|
|
8081
8122
|
|
|
8082
8123
|
// src/formattedValue.tsx
|
|
8083
8124
|
var import_react35 = require("react");
|
|
8084
8125
|
var import_data_table2 = require("@ai-matrx/design-system/data-table");
|
|
8085
|
-
var
|
|
8126
|
+
var import_field_formats7 = require("@ai-matrx/design-system/field-formats");
|
|
8086
8127
|
var import_design_system23 = require("@ai-matrx/design-system");
|
|
8087
8128
|
var import_outbound_react3 = require("@ai-matrx/kit/outbound-react");
|
|
8088
8129
|
|
|
@@ -8208,7 +8249,7 @@ function rich(id, text, raw, format) {
|
|
|
8208
8249
|
case "url":
|
|
8209
8250
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(LinkPreviewCard, { url: text.includes("://") ? text : `https://${text}`, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_outbound_react3.OutboundLink, { href: text.includes("://") ? text : `https://${text}`, className: LINK, onClick: own2, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "truncate", children: text }) }) });
|
|
8210
8251
|
case "phone":
|
|
8211
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("a", { href: `tel:${text.replace(/[^\d+]/g, "")}`, className: LINK, onClick: own2, title: text, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "truncate tabular-nums", children: (0,
|
|
8252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("a", { href: `tel:${text.replace(/[^\d+]/g, "")}`, className: LINK, onClick: own2, title: text, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "truncate tabular-nums", children: (0, import_field_formats7.formatPhone)(text) }) });
|
|
8212
8253
|
case "address":
|
|
8213
8254
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
8214
8255
|
import_outbound_react3.OutboundLink,
|
|
@@ -8262,13 +8303,13 @@ function FormattedValue({
|
|
|
8262
8303
|
onRate,
|
|
8263
8304
|
selectFirst
|
|
8264
8305
|
}) {
|
|
8265
|
-
const def = (0,
|
|
8306
|
+
const def = (0, import_field_formats7.getFieldFormat)(format.id);
|
|
8266
8307
|
const score = numberOf2(value);
|
|
8267
8308
|
const max = format.options?.ratingMax ?? 5;
|
|
8268
8309
|
if (def?.id === "rating" && onRate && (value === null || value === void 0 || value === "" || score !== null && score >= 0 && score <= max)) {
|
|
8269
8310
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(RatingStars, { value, max: format.options?.ratingMax ?? 5, onRate, selectFirst });
|
|
8270
8311
|
}
|
|
8271
|
-
const result = (0,
|
|
8312
|
+
const result = (0, import_field_formats7.formatFieldValue)(value, format);
|
|
8272
8313
|
if (!result.ok || result.empty || !def?.rich) return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_data_table2.FormattedCell, { result });
|
|
8273
8314
|
const look = fieldLookFor(def.id);
|
|
8274
8315
|
if (look) {
|
|
@@ -9079,6 +9120,7 @@ var import_text_case6 = require("@ai-matrx/kit/text-case");
|
|
|
9079
9120
|
init_host();
|
|
9080
9121
|
init_kindValues();
|
|
9081
9122
|
init_tableShape();
|
|
9123
|
+
var import_field_formats8 = require("@ai-matrx/design-system/field-formats");
|
|
9082
9124
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
9083
9125
|
var SaveToTable2 = (0, import_react52.lazy)(() => Promise.resolve().then(() => (init_SaveToTable(), SaveToTable_exports)).then((m) => ({ default: m.SaveToTable })));
|
|
9084
9126
|
var LONGEST_READ = 5e5;
|
|
@@ -9187,7 +9229,7 @@ function dateWords(v) {
|
|
|
9187
9229
|
return Number.isNaN(local.getTime()) ? null : local.toLocaleDateString(void 0, { dateStyle: "medium" });
|
|
9188
9230
|
}
|
|
9189
9231
|
const at = new Date(v);
|
|
9190
|
-
return Number.isNaN(at.getTime()) ? null : at.toLocaleString(void 0, { dateStyle: "medium", timeStyle: "short" });
|
|
9232
|
+
return Number.isNaN(at.getTime()) ? null : at.toLocaleString(void 0, { dateStyle: "medium", timeStyle: "short", ...(0, import_field_formats8.momentZoneOptions)(v) });
|
|
9191
9233
|
}
|
|
9192
9234
|
function stop(event) {
|
|
9193
9235
|
event.stopPropagation();
|
|
@@ -9563,7 +9605,7 @@ function renderValue(field, value, document2, labels, stillWaitingFor, look, roo
|
|
|
9563
9605
|
title: value,
|
|
9564
9606
|
"data-records-phone": "",
|
|
9565
9607
|
onClick: (event) => event.stopPropagation(),
|
|
9566
|
-
children: (0,
|
|
9608
|
+
children: (0, import_field_formats10.formatPhone)(value)
|
|
9567
9609
|
}
|
|
9568
9610
|
);
|
|
9569
9611
|
}
|
|
@@ -9649,7 +9691,7 @@ function scalarText(field, value, labels, stillWaitingFor) {
|
|
|
9649
9691
|
}
|
|
9650
9692
|
const shownAs = shownAsOf(field);
|
|
9651
9693
|
if (shownAs) {
|
|
9652
|
-
const said2 = (0,
|
|
9694
|
+
const said2 = (0, import_field_formats9.formatFieldValue)(value, shownAs.id === "number" && isYearField(field) && isYearValue(value) ? formatForField(field) ?? shownAs : shownAs);
|
|
9653
9695
|
if (said2.ok && !said2.empty) return said2.text;
|
|
9654
9696
|
}
|
|
9655
9697
|
if (typeof value === "number") {
|
|
@@ -9731,41 +9773,8 @@ init_parity();
|
|
|
9731
9773
|
|
|
9732
9774
|
// src/personTime.ts
|
|
9733
9775
|
var import_react56 = require("react");
|
|
9734
|
-
|
|
9735
|
-
|
|
9736
|
-
var import_table_style3 = require("@ai-matrx/design-system/data-table/table-style");
|
|
9737
|
-
var import_global_slot = require("@ai-matrx/kit/global-slot");
|
|
9738
|
-
var state = (0, import_global_slot.globalSlot)("ai-matrx.records-ui.person-time-zone", () => ({
|
|
9739
|
-
zone: null,
|
|
9740
|
-
listeners: /* @__PURE__ */ new Set()
|
|
9741
|
-
}));
|
|
9742
|
-
function getPersonTimeZone() {
|
|
9743
|
-
return state.zone;
|
|
9744
|
-
}
|
|
9745
|
-
function subscribePersonTimeZone(listener) {
|
|
9746
|
-
state.listeners.add(listener);
|
|
9747
|
-
return () => {
|
|
9748
|
-
state.listeners.delete(listener);
|
|
9749
|
-
};
|
|
9750
|
-
}
|
|
9751
|
-
function personWallNow(at = /* @__PURE__ */ new Date()) {
|
|
9752
|
-
const zone = state.zone;
|
|
9753
|
-
if (!zone) return at;
|
|
9754
|
-
const parts = new Intl.DateTimeFormat("en-US", {
|
|
9755
|
-
timeZone: zone,
|
|
9756
|
-
year: "numeric",
|
|
9757
|
-
month: "2-digit",
|
|
9758
|
-
day: "2-digit",
|
|
9759
|
-
hour: "2-digit",
|
|
9760
|
-
minute: "2-digit",
|
|
9761
|
-
second: "2-digit",
|
|
9762
|
-
hourCycle: "h23"
|
|
9763
|
-
}).formatToParts(at);
|
|
9764
|
-
const n = (t) => Number(parts.find((p) => p.type === t)?.value ?? 0);
|
|
9765
|
-
return new Date(n("year"), n("month") - 1, n("day"), n("hour"), n("minute"), n("second"));
|
|
9766
|
-
}
|
|
9767
|
-
|
|
9768
|
-
// src/personTime.ts
|
|
9776
|
+
init_personZone();
|
|
9777
|
+
init_personZone();
|
|
9769
9778
|
function usePersonTimeZone() {
|
|
9770
9779
|
return (0, import_react56.useSyncExternalStore)(
|
|
9771
9780
|
subscribePersonTimeZone,
|
|
@@ -11000,7 +11009,7 @@ function BarcodeSymbologyQuestion({ value, onChange }) {
|
|
|
11000
11009
|
|
|
11001
11010
|
// src/FieldFormatPicker.tsx
|
|
11002
11011
|
var import_design_system37 = require("@ai-matrx/design-system");
|
|
11003
|
-
var
|
|
11012
|
+
var import_field_formats11 = require("@ai-matrx/design-system/field-formats");
|
|
11004
11013
|
init_PickOne();
|
|
11005
11014
|
init_choiceLooks();
|
|
11006
11015
|
init_parity();
|
|
@@ -11066,7 +11075,7 @@ function formatMenu(field) {
|
|
|
11066
11075
|
if (base === null) return { groups: [], otherKinds: [] };
|
|
11067
11076
|
if (base === "formula") {
|
|
11068
11077
|
const groups2 = [];
|
|
11069
|
-
for (const def of
|
|
11078
|
+
for (const def of import_field_formats11.FIELD_FORMAT_LIST) {
|
|
11070
11079
|
if (neverALook(def) || KIND_WORD[def.id] || def.id === "boolean") continue;
|
|
11071
11080
|
const bucket = groups2.find((g) => g.group === def.group);
|
|
11072
11081
|
if (bucket) bucket.formats.push(def);
|
|
@@ -11074,10 +11083,10 @@ function formatMenu(field) {
|
|
|
11074
11083
|
}
|
|
11075
11084
|
return { groups: groups2, otherKinds: [] };
|
|
11076
11085
|
}
|
|
11077
|
-
const groups = (0,
|
|
11086
|
+
const groups = (0, import_field_formats11.groupedFormatsForBase)(base).map((g) => ({ group: g.group, formats: g.formats.filter((d) => !neverALook(d) && !KIND_WORD[d.id]) })).filter((g) => g.formats.length > 0);
|
|
11078
11087
|
const own3 = new Set(groups.flatMap((g) => g.formats.map((d) => d.id)));
|
|
11079
11088
|
const otherKinds = [];
|
|
11080
|
-
for (const def of
|
|
11089
|
+
for (const def of import_field_formats11.FIELD_FORMAT_LIST) {
|
|
11081
11090
|
if (own3.has(def.id) || neverALook(def)) continue;
|
|
11082
11091
|
const word = KIND_WORD[def.id] ?? PLAIN_WORD[def.base];
|
|
11083
11092
|
if (word) otherKinds.push({ def, word });
|
|
@@ -11086,7 +11095,7 @@ function formatMenu(field) {
|
|
|
11086
11095
|
}
|
|
11087
11096
|
function startingChoice(field) {
|
|
11088
11097
|
const held = displayFormatOf(field);
|
|
11089
|
-
if (!held || !(0,
|
|
11098
|
+
if (!held || !(0, import_field_formats11.getFieldFormat)(held.id) || held.id === "formula") return { format: null, retype: null };
|
|
11090
11099
|
return {
|
|
11091
11100
|
format: Object.keys(held.options).length > 0 ? { id: held.id, options: held.options } : { id: held.id },
|
|
11092
11101
|
retype: null
|
|
@@ -11116,7 +11125,7 @@ function FieldFormatPicker({
|
|
|
11116
11125
|
}) {
|
|
11117
11126
|
const { groups, otherKinds } = formatMenu(field);
|
|
11118
11127
|
if (groups.length === 0 && otherKinds.length === 0) return null;
|
|
11119
|
-
const active = value.format ? (0,
|
|
11128
|
+
const active = value.format ? (0, import_field_formats11.getFieldFormat)(value.format.id) : null;
|
|
11120
11129
|
const options = value.format?.options ?? {};
|
|
11121
11130
|
const optionKeys = active?.optionKeys ?? [];
|
|
11122
11131
|
const retypedTo = value.retype ? otherKinds.find((k) => k.def.id === value.format?.id) : void 0;
|
|
@@ -13354,7 +13363,7 @@ init_refusals();
|
|
|
13354
13363
|
// src/formatControls.tsx
|
|
13355
13364
|
var import_react72 = require("react");
|
|
13356
13365
|
var import_design_system43 = require("@ai-matrx/design-system");
|
|
13357
|
-
var
|
|
13366
|
+
var import_field_formats12 = require("@ai-matrx/design-system/field-formats");
|
|
13358
13367
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
13359
13368
|
var TYPED_NUMBERS = /* @__PURE__ */ new Set(["currency", "percent", "progress", "decimal", "duration", "file_size", "integer"]);
|
|
13360
13369
|
function scaled(format) {
|
|
@@ -13367,7 +13376,7 @@ function typedText(format, value) {
|
|
|
13367
13376
|
}
|
|
13368
13377
|
function keptValue(format, raw) {
|
|
13369
13378
|
if (raw.trim() === "") return null;
|
|
13370
|
-
const parsed = (0,
|
|
13379
|
+
const parsed = (0, import_field_formats12.parseFieldInput)(raw, format);
|
|
13371
13380
|
if (typeof parsed === "number" && scaled(format)) return Math.round(parsed / 100 * 1e9) / 1e9;
|
|
13372
13381
|
return parsed;
|
|
13373
13382
|
}
|
|
@@ -13397,7 +13406,7 @@ function NumberInFormat({ format, value, onChange, disabled, id }) {
|
|
|
13397
13406
|
);
|
|
13398
13407
|
}
|
|
13399
13408
|
function formatControl(args) {
|
|
13400
|
-
const def = (0,
|
|
13409
|
+
const def = (0, import_field_formats12.getFieldFormat)(args.format.id);
|
|
13401
13410
|
if (!def) return null;
|
|
13402
13411
|
const { format, value, onChange, disabled, id, label, ownDetails } = args;
|
|
13403
13412
|
const look = fieldLookFor(def.id);
|
|
@@ -13406,7 +13415,7 @@ function formatControl(args) {
|
|
|
13406
13415
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Editor, { value, format, onChange, disabled, id, label });
|
|
13407
13416
|
}
|
|
13408
13417
|
const text = value === null || value === void 0 ? "" : String(value);
|
|
13409
|
-
const commit = (raw) => onChange(raw === "" ? null : (0,
|
|
13418
|
+
const commit = (raw) => onChange(raw === "" ? null : (0, import_field_formats12.parseFieldInput)(raw, format));
|
|
13410
13419
|
if (def.id === "rating") {
|
|
13411
13420
|
return disabled ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(RatingStars, { value, max: format.options?.ratingMax ?? 5, label }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { id, className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(RatingStars, { value, max: format.options?.ratingMax ?? 5, label, onRate: (n) => onChange(n) }) });
|
|
13412
13421
|
}
|
|
@@ -13472,8 +13481,8 @@ function readBox(text, kind) {
|
|
|
13472
13481
|
const read = (0, import_records27.readTypedDate)(text, { withTime: kind === "datetime" });
|
|
13473
13482
|
if (!read.ok) return { day: null, time: null };
|
|
13474
13483
|
if (kind === "datetime" && read.instant) {
|
|
13475
|
-
const
|
|
13476
|
-
return { day: read.day, time: { h:
|
|
13484
|
+
const wall = (0, import_records27.wallPartsInZone)(new Date(read.instant));
|
|
13485
|
+
return { day: read.day, time: { h: wall.hour, m: wall.minute } };
|
|
13477
13486
|
}
|
|
13478
13487
|
return { day: read.day, time: null };
|
|
13479
13488
|
}
|
|
@@ -14614,6 +14623,7 @@ init_tablePicking();
|
|
|
14614
14623
|
init_Refusal();
|
|
14615
14624
|
init_refusals();
|
|
14616
14625
|
init_plainWords();
|
|
14626
|
+
var import_field_formats13 = require("@ai-matrx/design-system/field-formats");
|
|
14617
14627
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
14618
14628
|
var SHARED_FOR_MS = 5e3;
|
|
14619
14629
|
var sharedReads = /* @__PURE__ */ new WeakMap();
|
|
@@ -14673,7 +14683,7 @@ function TablePicker({ dataSource, value, onChange, disabled, tables }) {
|
|
|
14673
14683
|
const pickerOptions = options.map((t) => {
|
|
14674
14684
|
const twin = (sameName.get(`${t.organization_id}|${t.table_name.trim().toLowerCase()}`) ?? 0) > 1;
|
|
14675
14685
|
const row = t;
|
|
14676
|
-
const secondOf = (r) => [r.created_by_name ? `by ${r.created_by_name}` : null, r.updated_at ? `changed ${new Date(r.updated_at).toLocaleDateString()}` : null].filter(Boolean).join(" \xB7 ");
|
|
14686
|
+
const secondOf = (r) => [r.created_by_name ? `by ${r.created_by_name}` : null, r.updated_at ? `changed ${new Date(r.updated_at).toLocaleDateString(void 0, (0, import_field_formats13.momentZoneOptions)(r.updated_at))}` : null].filter(Boolean).join(" \xB7 ");
|
|
14677
14687
|
const base = secondOf(row);
|
|
14678
14688
|
const alike = options.filter((o) => o.organization_id === t.organization_id && o.table_name.trim().toLowerCase() === t.table_name.trim().toLowerCase() && secondOf(o) === base).length;
|
|
14679
14689
|
const second = alike > 1 ? [base, `#${t.table_id.slice(0, 4)}`].filter(Boolean).join(" \xB7 ") : base;
|