@burojs/ui-shadcn 0.7.0 → 0.8.0
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/dist/{bulk-summary-CrEij5vq.cjs → bulk-summary-2HLgz7Il.cjs} +31 -5
- package/dist/bulk-summary-2HLgz7Il.cjs.map +1 -0
- package/dist/{bulk-summary-BWSAS7k2.js → bulk-summary-D6A0ua21.js} +32 -6
- package/dist/bulk-summary-D6A0ua21.js.map +1 -0
- package/dist/{candidates-relation-picker-y5M6_oe4.cjs → candidates-relation-picker-C47mF260.cjs} +3 -3
- package/dist/{candidates-relation-picker-y5M6_oe4.cjs.map → candidates-relation-picker-C47mF260.cjs.map} +1 -1
- package/dist/{candidates-relation-picker-CS_JZ4Fd.js → candidates-relation-picker-CGXItMN0.js} +3 -3
- package/dist/{candidates-relation-picker-CS_JZ4Fd.js.map → candidates-relation-picker-CGXItMN0.js.map} +1 -1
- package/dist/{check-confirm-dialog-C-NHgMST.cjs → check-confirm-dialog-BT04Mieo.cjs} +13 -6
- package/dist/check-confirm-dialog-BT04Mieo.cjs.map +1 -0
- package/dist/{check-confirm-dialog-2j0gOd7x.js → check-confirm-dialog-CtiRzOAt.js} +14 -7
- package/dist/{check-confirm-dialog-2j0gOd7x.js.map → check-confirm-dialog-CtiRzOAt.js.map} +1 -1
- package/dist/{filter-builder-DFu0JP-1.cjs → filter-builder-ByGhxLf_.cjs} +127 -63
- package/dist/filter-builder-ByGhxLf_.cjs.map +1 -0
- package/dist/{filter-builder-DaWHUZuV.js → filter-builder-z3Axzf9Y.js} +114 -56
- package/dist/filter-builder-z3Axzf9Y.js.map +1 -0
- package/dist/{flow-runtime-BpmrIUb6.cjs → flow-runtime-BVFjMU5-.cjs} +6 -3
- package/dist/{flow-runtime-BpmrIUb6.cjs.map → flow-runtime-BVFjMU5-.cjs.map} +1 -1
- package/dist/{flow-runtime-DyqTmK3H.js → flow-runtime-DrUWyTS0.js} +6 -3
- package/dist/{flow-runtime-DyqTmK3H.js.map → flow-runtime-DrUWyTS0.js.map} +1 -1
- package/dist/{flow-screen-DCdli6Ha.js → flow-screen-3fk6J33y.js} +6 -4
- package/dist/flow-screen-3fk6J33y.js.map +1 -0
- package/dist/{flow-screen-Bcz9NF2V.cjs → flow-screen-6y5E_HT6.cjs} +5 -3
- package/dist/flow-screen-6y5E_HT6.cjs.map +1 -0
- package/dist/index.cjs +518 -107
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +187 -86
- package/dist/index.d.ts +187 -86
- package/dist/index.js +519 -108
- package/dist/index.js.map +1 -1
- package/dist/{inline-flow-host-3vw7LzzD.cjs → inline-flow-host-C4KmZIYE.cjs} +3 -3
- package/dist/{inline-flow-host-3vw7LzzD.cjs.map → inline-flow-host-C4KmZIYE.cjs.map} +1 -1
- package/dist/{inline-flow-host-C0rI9B7f.js → inline-flow-host-YnnvWjdU.js} +3 -3
- package/dist/{inline-flow-host-C0rI9B7f.js.map → inline-flow-host-YnnvWjdU.js.map} +1 -1
- package/dist/{lazy-relation-picker-dialog-Bt8lrEIu.cjs → lazy-relation-picker-dialog-BAKBRn3V.cjs} +2 -2
- package/dist/{lazy-relation-picker-dialog-Bt8lrEIu.cjs.map → lazy-relation-picker-dialog-BAKBRn3V.cjs.map} +1 -1
- package/dist/{lazy-relation-picker-dialog-CAScLPb2.js → lazy-relation-picker-dialog-DN4bvQfg.js} +2 -2
- package/dist/{lazy-relation-picker-dialog-CAScLPb2.js.map → lazy-relation-picker-dialog-DN4bvQfg.js.map} +1 -1
- package/dist/{page-flow-route-BHUEpn0I.js → page-flow-route-CtEfqAvU.js} +5 -6
- package/dist/page-flow-route-CtEfqAvU.js.map +1 -0
- package/dist/{page-flow-route-DS8IVTVH.cjs → page-flow-route-DEjAxHe3.cjs} +6 -7
- package/dist/page-flow-route-DEjAxHe3.cjs.map +1 -0
- package/dist/{place-node-CfzQvh4Y.js → place-node-BdxT-30h.js} +149 -108
- package/dist/place-node-BdxT-30h.js.map +1 -0
- package/dist/{place-node-CNb3w-c7.cjs → place-node-Bhl8B3fF.cjs} +163 -134
- package/dist/place-node-Bhl8B3fF.cjs.map +1 -0
- package/dist/{related-list-cards-CelMxl4q.cjs → related-list-cards-Bc_vfCE_.cjs} +3 -3
- package/dist/{related-list-cards-CelMxl4q.cjs.map → related-list-cards-Bc_vfCE_.cjs.map} +1 -1
- package/dist/{related-list-cards-BIqqY69Y.js → related-list-cards-BvkD5OcC.js} +3 -3
- package/dist/{related-list-cards-BIqqY69Y.js.map → related-list-cards-BvkD5OcC.js.map} +1 -1
- package/dist/related-list-timeline-DCrwN9oO.js +167 -0
- package/dist/related-list-timeline-DCrwN9oO.js.map +1 -0
- package/dist/related-list-timeline-k0DtnxTs.cjs +167 -0
- package/dist/related-list-timeline-k0DtnxTs.cjs.map +1 -0
- package/dist/{related-rows-MPnLCmPF.cjs → related-rows-BW9Jr07T.cjs} +3 -3
- package/dist/{related-rows-MPnLCmPF.cjs.map → related-rows-BW9Jr07T.cjs.map} +1 -1
- package/dist/{related-rows--uP2iKQC.js → related-rows-CPE-9FFr.js} +3 -3
- package/dist/{related-rows--uP2iKQC.js.map → related-rows-CPE-9FFr.js.map} +1 -1
- package/dist/{relation-many-picker-BJhaEqxz.js → relation-many-picker-BlrGRwMV.js} +10 -5
- package/dist/relation-many-picker-BlrGRwMV.js.map +1 -0
- package/dist/{relation-many-picker-DzuGJpEl.cjs → relation-many-picker-Br-zBHxT.cjs} +10 -5
- package/dist/relation-many-picker-Br-zBHxT.cjs.map +1 -0
- package/dist/{relation-picker-DaIMzf2H.cjs → relation-picker-ADjxI_TI.cjs} +11 -6
- package/dist/relation-picker-ADjxI_TI.cjs.map +1 -0
- package/dist/{relation-picker-dialog-DoEY8EkH.js → relation-picker-dialog-CyKliBkN.js} +2 -2
- package/dist/{relation-picker-dialog-DoEY8EkH.js.map → relation-picker-dialog-CyKliBkN.js.map} +1 -1
- package/dist/{relation-picker-dialog-9Vg5vvR1.cjs → relation-picker-dialog-DimVQF9Y.cjs} +2 -2
- package/dist/{relation-picker-dialog-9Vg5vvR1.cjs.map → relation-picker-dialog-DimVQF9Y.cjs.map} +1 -1
- package/dist/{relation-picker-D-tBBZW_.js → relation-picker-x7P5HKie.js} +11 -6
- package/dist/relation-picker-x7P5HKie.js.map +1 -0
- package/dist/{resource-page-router-Diw6S6TK.js → resource-page-router-BRpUnhay.js} +144 -17
- package/dist/resource-page-router-BRpUnhay.js.map +1 -0
- package/dist/{resource-page-router-C_kGW2o_.cjs → resource-page-router-qEd2xb55.cjs} +158 -19
- package/dist/resource-page-router-qEd2xb55.cjs.map +1 -0
- package/dist/use-record-subtitle-bfwIoUme.cjs +70 -0
- package/dist/use-record-subtitle-bfwIoUme.cjs.map +1 -0
- package/dist/use-record-subtitle-gIaCGgbI.js +53 -0
- package/dist/use-record-subtitle-gIaCGgbI.js.map +1 -0
- package/package.json +9 -9
- package/dist/bulk-summary-BWSAS7k2.js.map +0 -1
- package/dist/bulk-summary-CrEij5vq.cjs.map +0 -1
- package/dist/check-confirm-dialog-C-NHgMST.cjs.map +0 -1
- package/dist/filter-builder-DFu0JP-1.cjs.map +0 -1
- package/dist/filter-builder-DaWHUZuV.js.map +0 -1
- package/dist/flow-screen-Bcz9NF2V.cjs.map +0 -1
- package/dist/flow-screen-DCdli6Ha.js.map +0 -1
- package/dist/page-flow-route-BHUEpn0I.js.map +0 -1
- package/dist/page-flow-route-DS8IVTVH.cjs.map +0 -1
- package/dist/place-node-CNb3w-c7.cjs.map +0 -1
- package/dist/place-node-CfzQvh4Y.js.map +0 -1
- package/dist/related-list-timeline-CRh7xwLD.js +0 -141
- package/dist/related-list-timeline-CRh7xwLD.js.map +0 -1
- package/dist/related-list-timeline-DsLdi8sv.cjs +0 -141
- package/dist/related-list-timeline-DsLdi8sv.cjs.map +0 -1
- package/dist/relation-many-picker-BJhaEqxz.js.map +0 -1
- package/dist/relation-many-picker-DzuGJpEl.cjs.map +0 -1
- package/dist/relation-picker-D-tBBZW_.js.map +0 -1
- package/dist/relation-picker-DaIMzf2H.cjs.map +0 -1
- package/dist/resource-page-router-C_kGW2o_.cjs.map +0 -1
- package/dist/resource-page-router-Diw6S6TK.js.map +0 -1
|
@@ -11,6 +11,7 @@ let react = require("react");
|
|
|
11
11
|
react = require_use_theme.__toESM(react, 1);
|
|
12
12
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
13
13
|
let class_variance_authority = require("class-variance-authority");
|
|
14
|
+
let _burojs_core_internal = require("@burojs/core/internal");
|
|
14
15
|
let _radix_ui_react_select = require("@radix-ui/react-select");
|
|
15
16
|
_radix_ui_react_select = require_use_theme.__toESM(_radix_ui_react_select, 1);
|
|
16
17
|
//#region src/layout/language-storage.ts
|
|
@@ -100,6 +101,7 @@ const SEMANTIC_KEYS = Object.freeze([
|
|
|
100
101
|
"empty",
|
|
101
102
|
"default",
|
|
102
103
|
"constraints",
|
|
104
|
+
"zone",
|
|
103
105
|
"texts",
|
|
104
106
|
"options",
|
|
105
107
|
"items",
|
|
@@ -129,9 +131,11 @@ function projectUiSelection(input) {
|
|
|
129
131
|
const selection = {};
|
|
130
132
|
const inputId = ownSelection(input, "input");
|
|
131
133
|
const displayId = ownSelection(input, "display");
|
|
134
|
+
const layout = ownData(input, "layout").value;
|
|
132
135
|
if (inputId !== void 0) selection.input = inputId;
|
|
133
136
|
if (displayId !== void 0) selection.display = displayId;
|
|
134
|
-
|
|
137
|
+
if (Array.isArray(layout)) selection.layout = layout;
|
|
138
|
+
return Object.keys(selection).length === 0 ? void 0 : Object.freeze(selection);
|
|
135
139
|
}
|
|
136
140
|
function projectFieldDeclaration(input) {
|
|
137
141
|
const type = ownString(input, "type");
|
|
@@ -150,7 +154,16 @@ function projectFieldDeclaration(input) {
|
|
|
150
154
|
}
|
|
151
155
|
if (type === "object") {
|
|
152
156
|
const properties = ownData(input, "properties").value;
|
|
153
|
-
if (
|
|
157
|
+
if (Array.isArray(properties)) {
|
|
158
|
+
const output = {};
|
|
159
|
+
for (let index = 0; index < properties.length; index += 1) {
|
|
160
|
+
const entry = ownData(properties, index).value;
|
|
161
|
+
const name = ownString(entry, "name");
|
|
162
|
+
const child = projectFieldDeclaration(entry);
|
|
163
|
+
if (name !== void 0 && child !== void 0) output[name] = child;
|
|
164
|
+
}
|
|
165
|
+
projected.properties = Object.freeze(output);
|
|
166
|
+
} else if (properties !== null && typeof properties === "object") {
|
|
154
167
|
const output = {};
|
|
155
168
|
for (const key of Object.keys(properties)) {
|
|
156
169
|
const child = projectFieldDeclaration(ownData(properties, key).value);
|
|
@@ -207,6 +220,7 @@ function lowerLegacyField(field) {
|
|
|
207
220
|
const items = type === "array" ? projectFieldDeclaration(ownData(field, "items").value) ?? mapping?.items ?? STRING_ITEM : void 0;
|
|
208
221
|
const meta = ownData(field, "meta");
|
|
209
222
|
const texts = ownData(field, "texts");
|
|
223
|
+
const zone = ownData(field, "zone");
|
|
210
224
|
const options = kind === "enum" ? enumValueOptions(field) : void 0;
|
|
211
225
|
const required = ownData(field, "required");
|
|
212
226
|
const nullable = ownData(field, "nullable");
|
|
@@ -222,6 +236,7 @@ function lowerLegacyField(field) {
|
|
|
222
236
|
...meta.present && meta.value !== void 0 ? { meta: meta.value } : {},
|
|
223
237
|
...options === void 0 ? {} : { options },
|
|
224
238
|
...texts.present && texts.value !== void 0 ? { texts: texts.value } : {},
|
|
239
|
+
...zone.present && zone.value !== void 0 ? { zone: zone.value } : {},
|
|
225
240
|
...requiredValue === true ? { required: true } : {},
|
|
226
241
|
...nullableValue === true ? { nullable: true } : {}
|
|
227
242
|
});
|
|
@@ -373,7 +388,7 @@ function useFieldImplementationDiagnostic(diagnostic) {
|
|
|
373
388
|
console.warn("[buro/ui-shadcn] missing-field-implementation; rendering fallback.", diagnostic);
|
|
374
389
|
}, [diagnostic]);
|
|
375
390
|
}
|
|
376
|
-
function ResolvedFieldDisplay({ resource, name, field: source, value, record, testId, fallback, presentation, metaSources, uiSurface = "display", columnEntry }) {
|
|
391
|
+
function ResolvedFieldDisplay({ resource, name, field: source, value, record, testId, fallback, presentation, metaSources, uiSurface = "display", columnEntry, absentPaths, pathStatus }) {
|
|
377
392
|
const { sourceAtEdge, field, ui } = useLoweredField(source);
|
|
378
393
|
const surfaceField = (0, react.useMemo)(() => sourceAtEdge.ui === void 0 ? field : Object.freeze({
|
|
379
394
|
...field,
|
|
@@ -398,10 +413,19 @@ function ResolvedFieldDisplay({ resource, name, field: source, value, record, te
|
|
|
398
413
|
const text = (0, _burojs_react.useFieldDisplayText)(textField, value, {
|
|
399
414
|
surface: uiSurface,
|
|
400
415
|
...columnEntry === void 0 ? {} : { entry: columnEntry },
|
|
401
|
-
resource: (0, _burojs_core.canonicalResourceKey)(resource)
|
|
416
|
+
resource: (0, _burojs_core.canonicalResourceKey)(resource),
|
|
417
|
+
...record === void 0 ? {} : { record }
|
|
402
418
|
});
|
|
403
419
|
const options = useContextOptions(field, name, metaState.status === "ready" ? metaState.meta : void 0, ui, resource);
|
|
404
420
|
const texts = useContextTexts(field, name, resolved, resource);
|
|
421
|
+
const dateDisplay = (0, _burojs_core.resolveSurfaceUi)(surfaceField, uiSurface, columnEntry).dateDisplay;
|
|
422
|
+
const contextUi = (0, react.useMemo)(() => dateDisplay === void 0 ? ui : Object.freeze({
|
|
423
|
+
...ui,
|
|
424
|
+
display: Object.freeze({
|
|
425
|
+
...typeof ui.display === "object" && ui.display !== null ? ui.display : {},
|
|
426
|
+
...dateDisplay
|
|
427
|
+
})
|
|
428
|
+
}), [ui, dateDisplay]);
|
|
405
429
|
useFieldMetaDiagnostic(metaState, resource, name, surfaceField, uiSurface, columnEntry);
|
|
406
430
|
useFieldImplementationDiagnostic(resolved.diagnostic);
|
|
407
431
|
if (resolved.Component === void 0) return (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: fallback });
|
|
@@ -412,11 +436,13 @@ function ResolvedFieldDisplay({ resource, name, field: source, value, record, te
|
|
|
412
436
|
resource,
|
|
413
437
|
field,
|
|
414
438
|
path: Object.freeze([name]),
|
|
439
|
+
...absentPaths === void 0 || absentPaths.length === 0 ? {} : { absentPaths },
|
|
440
|
+
...pathStatus === void 0 ? {} : { pathStatus },
|
|
415
441
|
surface: "display",
|
|
416
442
|
presentation: presentation ?? "default",
|
|
417
443
|
record,
|
|
418
444
|
meta: metaState.meta,
|
|
419
|
-
ui,
|
|
445
|
+
ui: contextUi,
|
|
420
446
|
options,
|
|
421
447
|
texts,
|
|
422
448
|
...text === void 0 ? {} : { text },
|
|
@@ -439,7 +465,7 @@ function ResolvedFieldDisplay({ resource, name, field: source, value, record, te
|
|
|
439
465
|
value
|
|
440
466
|
});
|
|
441
467
|
}
|
|
442
|
-
function ResolvedFieldInput({ resource, name, field: source, value, record, form, testId, inputId, onChange, onBlur, disabled, required, placeholder, descriptionId, labelId, errorId, errorMessage, pending = false, touched = errorMessage != null, issues: suppliedIssues, relationSeeds, fixedFilters, link, metaSources, fallback }) {
|
|
468
|
+
function ResolvedFieldInput({ resource, name, field: source, value, record, form, testId, inputId, onChange, onBlur, disabled, required, placeholder, descriptionId, labelId, errorId, errorMessage, pending = false, touched = errorMessage != null, issues: suppliedIssues, relationSeeds, fixedFilters, optionSubtitle, link, metaSources, baseline, fallback, absentPaths, pathStatus }) {
|
|
443
469
|
const { sourceAtEdge, field: base } = useLoweredField(source);
|
|
444
470
|
const field = (0, react.useMemo)(() => required === void 0 || required === base.required ? base : Object.freeze({
|
|
445
471
|
...base,
|
|
@@ -481,6 +507,8 @@ function ResolvedFieldInput({ resource, name, field: source, value, record, form
|
|
|
481
507
|
resource,
|
|
482
508
|
field,
|
|
483
509
|
path: Object.freeze([name]),
|
|
510
|
+
...absentPaths === void 0 || absentPaths.length === 0 ? {} : { absentPaths },
|
|
511
|
+
...pathStatus === void 0 ? {} : { pathStatus },
|
|
484
512
|
surface: "input",
|
|
485
513
|
presentation: "default",
|
|
486
514
|
record,
|
|
@@ -511,8 +539,10 @@ function ResolvedFieldInput({ resource, name, field: source, value, record, form
|
|
|
511
539
|
disabled,
|
|
512
540
|
relationSeeds,
|
|
513
541
|
fixedFilters,
|
|
542
|
+
optionSubtitle,
|
|
514
543
|
link,
|
|
515
|
-
metaSources: runtimeContext.metaSources
|
|
544
|
+
metaSources: runtimeContext.metaSources,
|
|
545
|
+
...baseline === void 0 ? {} : { baseline }
|
|
516
546
|
});
|
|
517
547
|
return (0, react.createElement)(Component, {
|
|
518
548
|
...context,
|
|
@@ -523,8 +553,10 @@ function ResolvedFieldInput({ resource, name, field: source, value, record, form
|
|
|
523
553
|
disabled,
|
|
524
554
|
relationSeeds,
|
|
525
555
|
fixedFilters,
|
|
556
|
+
optionSubtitle,
|
|
526
557
|
link,
|
|
527
|
-
metaSources: runtimeContext.metaSources
|
|
558
|
+
metaSources: runtimeContext.metaSources,
|
|
559
|
+
...baseline === void 0 ? {} : { baseline }
|
|
528
560
|
});
|
|
529
561
|
}
|
|
530
562
|
//#endregion
|
|
@@ -678,8 +710,6 @@ SelectSeparator.displayName = _radix_ui_react_select.Separator.displayName;
|
|
|
678
710
|
function localeTag(locale) {
|
|
679
711
|
return locale || loadLocale() || "en-US";
|
|
680
712
|
}
|
|
681
|
-
const dateCache = new Map();
|
|
682
|
-
const dateTimeCache = new Map();
|
|
683
713
|
const numberCache = new Map();
|
|
684
714
|
function cached(cache, key, make) {
|
|
685
715
|
const hit = cache.get(key);
|
|
@@ -693,24 +723,6 @@ function cached(cache, key, make) {
|
|
|
693
723
|
cache.set(key, made);
|
|
694
724
|
return made;
|
|
695
725
|
}
|
|
696
|
-
function formatDate(d, locale) {
|
|
697
|
-
const tag = localeTag(locale);
|
|
698
|
-
return cached(dateCache, tag, (t) => new Intl.DateTimeFormat(t, {
|
|
699
|
-
year: "numeric",
|
|
700
|
-
month: "short",
|
|
701
|
-
day: "numeric"
|
|
702
|
-
})).format(d);
|
|
703
|
-
}
|
|
704
|
-
function formatDateTime(d, locale) {
|
|
705
|
-
const tag = localeTag(locale);
|
|
706
|
-
return cached(dateTimeCache, tag, (t) => new Intl.DateTimeFormat(t, {
|
|
707
|
-
year: "numeric",
|
|
708
|
-
month: "short",
|
|
709
|
-
day: "numeric",
|
|
710
|
-
hour: "2-digit",
|
|
711
|
-
minute: "2-digit"
|
|
712
|
-
})).format(d);
|
|
713
|
-
}
|
|
714
726
|
function formatNumber(n, locale) {
|
|
715
727
|
const tag = localeTag(locale);
|
|
716
728
|
return cached(numberCache, tag, (t) => new Intl.NumberFormat(t)).format(n);
|
|
@@ -724,7 +736,7 @@ function describeValue(value, chromeT, spec, formatValue) {
|
|
|
724
736
|
const optionLabel = spec?.options?.find((o) => o.value === String(value))?.label;
|
|
725
737
|
if (optionLabel !== void 0) return optionLabel;
|
|
726
738
|
if (spec && formatValue) {
|
|
727
|
-
const formatted = formatValue(spec.kind, value);
|
|
739
|
+
const formatted = formatValue(spec.kind, value, spec.zone);
|
|
728
740
|
if (formatted !== void 0) return formatted;
|
|
729
741
|
}
|
|
730
742
|
return String(value);
|
|
@@ -881,6 +893,8 @@ function FilterBadges(props) {
|
|
|
881
893
|
const { group, setGroup, available, fixed, testIdBase, onOpenAt, onRemoved, pinnedFields = [], pinnedValue = [], setPinnedValue } = props;
|
|
882
894
|
const chromeT = (0, _burojs_react.useChromeT)();
|
|
883
895
|
const locale = (0, _burojs_react.useOptionalLocale)();
|
|
896
|
+
const viewer = (0, _burojs_react.useTimeZone)();
|
|
897
|
+
const timeContext = (0, _burojs_react.useTimeContext)();
|
|
884
898
|
const tt = (key, params, fallback) => chromeT(key, {
|
|
885
899
|
params,
|
|
886
900
|
...typeof params?.count === "number" ? { count: params.count } : {},
|
|
@@ -888,13 +902,18 @@ function FilterBadges(props) {
|
|
|
888
902
|
});
|
|
889
903
|
const removeLabel = chromeT("filters.removeRow", { defaultValue: "Remove filter" });
|
|
890
904
|
const { enumLabels, relationLabels, onEnumResolved, onRelationResolved } = useFormatValueMaps();
|
|
891
|
-
const formatValue = (kind, value) => {
|
|
905
|
+
const formatValue = (kind, value, fieldZone) => {
|
|
892
906
|
if (kind.kind === "enum") return enumLabels[kind.enumName]?.[String(value)];
|
|
893
907
|
if (kind.kind === "relation") return relationLabels[relationLabelKey(kind.to, kind.by, String(value))];
|
|
894
|
-
if (kind.kind === "date") {
|
|
895
|
-
const
|
|
896
|
-
if (
|
|
897
|
-
return kind.time ?
|
|
908
|
+
if (kind.kind === "date" && viewer.status === "ready") {
|
|
909
|
+
const zone = (0, _burojs_core.resolveTimeZone)(timeContext.levels, fieldZone, timeContext.sources);
|
|
910
|
+
if (zone.status === "pending") return void 0;
|
|
911
|
+
return (0, _burojs_core.formatTimeValue)(kind.time ? "dateTime" : "date", String(value), {
|
|
912
|
+
zone: zone.zone,
|
|
913
|
+
viewerZone: viewer.zone,
|
|
914
|
+
locale: localeTag(locale),
|
|
915
|
+
params: {}
|
|
916
|
+
});
|
|
898
917
|
}
|
|
899
918
|
};
|
|
900
919
|
const orphanPinned = (0, react.useMemo)(() => {
|
|
@@ -1481,21 +1500,56 @@ function RelationValueControl(props) {
|
|
|
1481
1500
|
});
|
|
1482
1501
|
}
|
|
1483
1502
|
//#endregion
|
|
1503
|
+
//#region src/fields/field-time-zone.ts
|
|
1504
|
+
function useFieldTimeZone(zone, row) {
|
|
1505
|
+
const { sources: session } = (0, _burojs_react.useTimeContext)();
|
|
1506
|
+
const sources = (0, react.useMemo)(() => row === void 0 ? session : {
|
|
1507
|
+
...session,
|
|
1508
|
+
record: {
|
|
1509
|
+
status: "ready",
|
|
1510
|
+
value: row,
|
|
1511
|
+
refreshing: false
|
|
1512
|
+
}
|
|
1513
|
+
}, [session, row]);
|
|
1514
|
+
const fieldZone = (0, react.useMemo)(() => (0, _burojs_core_internal.normaliseFieldZone)(zone), [zone]);
|
|
1515
|
+
return (0, _burojs_react.useTimeZone)(fieldZone, sources);
|
|
1516
|
+
}
|
|
1517
|
+
const DATE_KEYS = [
|
|
1518
|
+
"dateStyle",
|
|
1519
|
+
"timeStyle",
|
|
1520
|
+
"zoneName"
|
|
1521
|
+
];
|
|
1522
|
+
function dateDisplayParams(ui) {
|
|
1523
|
+
const display = ui?.display;
|
|
1524
|
+
if (display === null || typeof display !== "object") return {};
|
|
1525
|
+
const params = {};
|
|
1526
|
+
for (const key of DATE_KEYS) {
|
|
1527
|
+
const value = display[key];
|
|
1528
|
+
if (value !== void 0) params[key] = value;
|
|
1529
|
+
}
|
|
1530
|
+
return params;
|
|
1531
|
+
}
|
|
1532
|
+
//#endregion
|
|
1484
1533
|
//#region src/fields/local-date-time.ts
|
|
1485
|
-
function toLocalDateTimeText(value) {
|
|
1534
|
+
function toLocalDateTimeText(value, zone) {
|
|
1486
1535
|
if (value === void 0 || value === null || value === "") return "";
|
|
1487
|
-
const
|
|
1488
|
-
if (
|
|
1489
|
-
const
|
|
1490
|
-
return `${
|
|
1536
|
+
const instant = (0, _burojs_core.canonicalInstant)(value instanceof Date ? value.toISOString() : String(value));
|
|
1537
|
+
if (instant === void 0) return "";
|
|
1538
|
+
const { date, time } = (0, _burojs_core.instantToWall)(instant, zone);
|
|
1539
|
+
return `${date}T${time.slice(0, 5)}`;
|
|
1491
1540
|
}
|
|
1492
|
-
function fromLocalDateTimeText(text) {
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1541
|
+
function fromLocalDateTimeText(text, zone) {
|
|
1542
|
+
const [date, time, ...rest] = text.split("T");
|
|
1543
|
+
if (date === void 0 || time === void 0 || rest.length > 0) return void 0;
|
|
1544
|
+
if (!(0, _burojs_core.isCalendarDate)(date) || !(0, _burojs_core.isWallTime)(time)) return void 0;
|
|
1545
|
+
return (0, _burojs_core.wallToInstant)(date, time, zone);
|
|
1496
1546
|
}
|
|
1497
1547
|
//#endregion
|
|
1498
1548
|
//#region src/list-kit/filter-builder/values/scalar-value-input.tsx
|
|
1549
|
+
function useFilterZone(fieldZone) {
|
|
1550
|
+
const zone = useFieldTimeZone(fieldZone, void 0);
|
|
1551
|
+
return zone.status === "ready" ? zone.zone : "UTC";
|
|
1552
|
+
}
|
|
1499
1553
|
function isDateTime(kind) {
|
|
1500
1554
|
return kind.kind === "date" && kind.time === true;
|
|
1501
1555
|
}
|
|
@@ -1506,18 +1560,18 @@ function inputTypeFor(kind) {
|
|
|
1506
1560
|
default: return "text";
|
|
1507
1561
|
}
|
|
1508
1562
|
}
|
|
1509
|
-
function toText(kind, value) {
|
|
1510
|
-
if (isDateTime(kind)) return toLocalDateTimeText(value);
|
|
1563
|
+
function toText(kind, value, zone) {
|
|
1564
|
+
if (isDateTime(kind)) return toLocalDateTimeText(value, zone);
|
|
1511
1565
|
if (value === void 0 || value === null || value === "") return "";
|
|
1512
1566
|
return String(value);
|
|
1513
1567
|
}
|
|
1514
|
-
function parseOne(kind, raw) {
|
|
1568
|
+
function parseOne(kind, raw, zone) {
|
|
1515
1569
|
if (raw === "") return void 0;
|
|
1516
1570
|
if (kind.kind === "number") {
|
|
1517
1571
|
const n = Number(raw);
|
|
1518
1572
|
return Number.isFinite(n) ? n : void 0;
|
|
1519
1573
|
}
|
|
1520
|
-
if (isDateTime(kind)) return fromLocalDateTimeText(raw);
|
|
1574
|
+
if (isDateTime(kind)) return fromLocalDateTimeText(raw, zone);
|
|
1521
1575
|
return raw;
|
|
1522
1576
|
}
|
|
1523
1577
|
function ScalarValueInput(props) {
|
|
@@ -1540,7 +1594,8 @@ function ScalarValueInput(props) {
|
|
|
1540
1594
|
}
|
|
1541
1595
|
function ScalarSingleInput(props) {
|
|
1542
1596
|
const { value, onChange, kind, testId, autoFocus, inputType, ariaLabel, debounceMs = 300 } = props;
|
|
1543
|
-
const
|
|
1597
|
+
const zone = useFilterZone(props.zone);
|
|
1598
|
+
const storedText = toText(kind, value, zone);
|
|
1544
1599
|
const [text, setText] = (0, react.useState)(storedText);
|
|
1545
1600
|
const lastPushedRef = (0, react.useRef)(storedText);
|
|
1546
1601
|
const timerRef = (0, react.useRef)(null);
|
|
@@ -1548,8 +1603,8 @@ function ScalarSingleInput(props) {
|
|
|
1548
1603
|
const commitRef = (0, react.useRef)(() => {});
|
|
1549
1604
|
(0, react.useEffect)(() => {
|
|
1550
1605
|
commitRef.current = (raw) => {
|
|
1551
|
-
const parsed = parseOne(kind, raw);
|
|
1552
|
-
lastPushedRef.current = toText(kind, parsed);
|
|
1606
|
+
const parsed = parseOne(kind, raw, zone);
|
|
1607
|
+
lastPushedRef.current = toText(kind, parsed, zone);
|
|
1553
1608
|
pendingRawRef.current = null;
|
|
1554
1609
|
onChange(parsed);
|
|
1555
1610
|
};
|
|
@@ -1598,8 +1653,9 @@ function ScalarMultiInput(props) {
|
|
|
1598
1653
|
const { value, onChange, kind, testId, autoFocus, inputType, ariaLabel } = props;
|
|
1599
1654
|
const chips = Array.isArray(value) ? value.map((v) => String(v)) : [];
|
|
1600
1655
|
const [draft, setDraft] = (0, react.useState)("");
|
|
1656
|
+
const zone = useFilterZone(props.zone);
|
|
1601
1657
|
const addChip = () => {
|
|
1602
|
-
const parsed = parseOne(kind, draft.trim());
|
|
1658
|
+
const parsed = parseOne(kind, draft.trim(), zone);
|
|
1603
1659
|
if (parsed === void 0) return;
|
|
1604
1660
|
const text = String(parsed);
|
|
1605
1661
|
setDraft("");
|
|
@@ -1789,6 +1845,7 @@ function FilterRow(props) {
|
|
|
1789
1845
|
debounceMs,
|
|
1790
1846
|
fieldLabel: spec.label,
|
|
1791
1847
|
options: spec.options,
|
|
1848
|
+
...spec.zone === void 0 ? {} : { zone: spec.zone },
|
|
1792
1849
|
fill: true
|
|
1793
1850
|
})
|
|
1794
1851
|
}),
|
|
@@ -2090,7 +2147,8 @@ function PinnedControl(props) {
|
|
|
2090
2147
|
testId: `${testIdBase}:pinned:${spec.field}`,
|
|
2091
2148
|
fieldLabel: spec.label,
|
|
2092
2149
|
placeholder: spec.label,
|
|
2093
|
-
options: spec.options
|
|
2150
|
+
options: spec.options,
|
|
2151
|
+
...spec.zone === void 0 ? {} : { zone: spec.zone }
|
|
2094
2152
|
});
|
|
2095
2153
|
}
|
|
2096
2154
|
//#endregion
|
|
@@ -2528,22 +2586,16 @@ Object.defineProperty(exports, "badgeVariants", {
|
|
|
2528
2586
|
return badgeVariants;
|
|
2529
2587
|
}
|
|
2530
2588
|
});
|
|
2531
|
-
Object.defineProperty(exports, "
|
|
2589
|
+
Object.defineProperty(exports, "dateDisplayParams", {
|
|
2532
2590
|
enumerable: true,
|
|
2533
2591
|
get: function() {
|
|
2534
|
-
return
|
|
2535
|
-
}
|
|
2536
|
-
});
|
|
2537
|
-
Object.defineProperty(exports, "formatDate", {
|
|
2538
|
-
enumerable: true,
|
|
2539
|
-
get: function() {
|
|
2540
|
-
return formatDate;
|
|
2592
|
+
return dateDisplayParams;
|
|
2541
2593
|
}
|
|
2542
2594
|
});
|
|
2543
|
-
Object.defineProperty(exports, "
|
|
2595
|
+
Object.defineProperty(exports, "fieldDescription", {
|
|
2544
2596
|
enumerable: true,
|
|
2545
2597
|
get: function() {
|
|
2546
|
-
return
|
|
2598
|
+
return fieldDescription;
|
|
2547
2599
|
}
|
|
2548
2600
|
});
|
|
2549
2601
|
Object.defineProperty(exports, "formatNumber", {
|
|
@@ -2564,6 +2616,12 @@ Object.defineProperty(exports, "loadLocale", {
|
|
|
2564
2616
|
return loadLocale;
|
|
2565
2617
|
}
|
|
2566
2618
|
});
|
|
2619
|
+
Object.defineProperty(exports, "localeTag", {
|
|
2620
|
+
enumerable: true,
|
|
2621
|
+
get: function() {
|
|
2622
|
+
return localeTag;
|
|
2623
|
+
}
|
|
2624
|
+
});
|
|
2567
2625
|
Object.defineProperty(exports, "lowerLegacyField", {
|
|
2568
2626
|
enumerable: true,
|
|
2569
2627
|
get: function() {
|
|
@@ -2588,5 +2646,11 @@ Object.defineProperty(exports, "useFieldMetaDiagnostic", {
|
|
|
2588
2646
|
return useFieldMetaDiagnostic;
|
|
2589
2647
|
}
|
|
2590
2648
|
});
|
|
2649
|
+
Object.defineProperty(exports, "useFieldTimeZone", {
|
|
2650
|
+
enumerable: true,
|
|
2651
|
+
get: function() {
|
|
2652
|
+
return useFieldTimeZone;
|
|
2653
|
+
}
|
|
2654
|
+
});
|
|
2591
2655
|
|
|
2592
|
-
//# sourceMappingURL=filter-builder-
|
|
2656
|
+
//# sourceMappingURL=filter-builder-ByGhxLf_.cjs.map
|