react-semaphor 0.1.526 → 0.1.527
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/DATA_APP_SDK.md +5 -1
- package/dist/analytics-protocol/index.js +1179 -296
- package/dist/brand-studio/index.js +15 -15
- package/dist/briefings/index.js +50 -49
- package/dist/chunks/{calculated-field-identity-D1ofR4KJ.js → calculated-field-identity-DEhjPSr-.js} +66 -65
- package/dist/chunks/{card-config-utils-9sv4e-Vb.js → card-config-utils-BlIbwkuD.js} +68 -65
- package/dist/chunks/{constants-DeLIHVAW.js → constants-DNWVy8Y3.js} +4 -4
- package/dist/chunks/dashboard-JNHR0_cZ.js +14 -0
- package/dist/chunks/{dashboard-briefing-launcher-DXz1GhFZ.js → dashboard-briefing-launcher-D9pFByPh.js} +372 -359
- package/dist/chunks/{dashboard-controls-Df8qOSrs.js → dashboard-controls-CJI5ZWMq.js} +739 -686
- package/dist/chunks/{dashboard-json-Xldp0qww.js → dashboard-json-DLdrFry-.js} +10 -10
- package/dist/chunks/{edit-dashboard-visual-COHBqyic.js → edit-dashboard-visual-D5LjWle1.js} +6603 -6572
- package/dist/chunks/{editor-action-buttons-DahlP57T.js → editor-action-buttons-G91NQKxU.js} +266 -267
- package/dist/chunks/{field-aggregations-BQjogiI1.js → field-aggregations-DeVQLIsP.js} +19 -19
- package/dist/chunks/{field-dependencies-v-lJNzC7.js → field-dependencies-CGYic38w.js} +1 -1
- package/dist/chunks/{index-CbjuruKe.js → index-BvJOYbNv.js} +755 -745
- package/dist/chunks/{matrix-analytical-definition-BimC4XIV.js → matrix-analytical-definition-BJyH5-99.js} +1 -1
- package/dist/chunks/{matrix-card-CIlz0Dnp.js → matrix-card-DY45yiUM.js} +7 -6
- package/dist/chunks/{matrix-control-sources-2VAzGlt8.js → matrix-control-sources-BypfLZsK.js} +11 -11
- package/dist/chunks/{matrix-definition-E5gXXSTZ.js → matrix-definition-Cdn3LoxW.js} +3 -3
- package/dist/chunks/{semantic-format-Baqp8kD_.js → matrix-formatter-BoKU3MzZ.js} +655 -511
- package/dist/chunks/{matrix-member-presentation-Bw7-JCrr.js → matrix-member-presentation-BBW0n1iY.js} +1 -1
- package/dist/chunks/matrix-operation-contract-BV02rLhu.js +809 -0
- package/dist/chunks/{metric-comparison-BphoJ9bq.js → metric-comparison-Crljx_XY.js} +15 -10
- package/dist/chunks/{numeric-presentation-VhMUHfrJ.js → numeric-presentation-LvnNY5Ma.js} +68 -68
- package/dist/chunks/pivot-header-presentation-D5v8uyjj.js +618 -0
- package/dist/chunks/{pivot-result-identity-BzUQiCEV.js → pivot-result-identity-CY__BuwI.js} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-BFO354lk.js → pivot-result-lifecycle-BWrPhlGT.js} +259 -204
- package/dist/chunks/{raw-temporal-7bFbXd2a.js → raw-temporal-CdnA_OXJ.js} +10 -10
- package/dist/chunks/{raw-temporal-contract-BQZIJ1fn.js → raw-temporal-contract-Bc9z83t-.js} +1 -1
- package/dist/chunks/relative-date-DAF9J7mt.js +456 -0
- package/dist/chunks/{report-preferences-dialog-BcH-0lR-.js → report-preferences-dialog-D3hxu4sE.js} +131 -132
- package/dist/chunks/{report-runtime-context-CxIoGyNM.js → report-runtime-context-CtaGGlit.js} +1 -1
- package/dist/chunks/{selection-reducer-NF5C07yM.js → selection-reducer-C7Um5XN-.js} +47 -26
- package/dist/chunks/semantic-format-BjBMOSoo.js +192 -0
- package/dist/chunks/{semaphor-ready-indicator-BLRDuLr4.js → semaphor-ready-indicator-D46I_4g7.js} +49895 -46141
- package/dist/chunks/{slider-BYIH4icg.js → slider-B6LELqx6.js} +81 -82
- package/dist/chunks/{source-entity-resolution-Bzefiive.js → source-entity-resolution-Bde29mqE.js} +25 -25
- package/dist/chunks/switch-_7uBAbYx.js +24003 -0
- package/dist/chunks/{temporal-bucket-PcLFSYWX.js → temporal-bucket-DlFuhCnT.js} +6 -6
- package/dist/chunks/{temporal-bucket-contract-DTLDRzgV.js → temporal-bucket-contract-C6lUGPS3.js} +1 -1
- package/dist/chunks/temporal-input-presentation-DyMWCZYh.js +195 -0
- package/dist/chunks/{token-types-BC6RcUY8.js → token-types-UjyNz95-.js} +1 -1
- package/dist/chunks/{validators-CsdOtZI6.js → validators-CQcG0EPN.js} +852 -731
- package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +138 -137
- package/dist/data-app-sdk/index.js +12 -12
- package/dist/data-app-sdk-adapters/index.js +23 -22
- package/dist/data-app-sdk-validation/index.js +27 -26
- package/dist/format-utils/index.js +247 -329
- package/dist/index.js +165 -168
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/briefings/index.d.ts +3 -0
- package/dist/types/components/explorer/filters/card-date-filter.d.ts +13 -5
- package/dist/types/components/explorer/filters/card-date-selection.d.ts +28 -0
- package/dist/types/components/sharing-and-management/dashboard-actions-menu.d.ts +1 -1
- package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +0 -1
- package/dist/types/components/surfboard/download-settings-dialog.d.ts +8 -0
- package/dist/types/components/surfboard/filter/types.d.ts +8 -29
- package/dist/types/components/surfboard/filter/use-dashboard-filter-mapping-popover.d.ts +5 -1
- package/dist/types/components/ui-custom/date-range-picker.d.ts +18 -2
- package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -21
- package/dist/types/components/ui-custom/report-calendar.d.ts +18 -0
- package/dist/types/components/visual/aggregated-table/utils/export-utils.d.ts +3 -5
- package/dist/types/components/visual/data-table/data-table-toolbar.d.ts +1 -1
- package/dist/types/components/visual/pivot-table/utils/pivot-table-export-utils.d.ts +3 -1
- package/dist/types/index.js +5 -5
- package/dist/types/lib/api/exports-api.d.ts +3 -0
- package/dist/types/lib/csv-download.d.ts +9 -0
- package/dist/types/lib/csv-encoding-options.d.ts +6 -0
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +2 -1
- package/dist/types/lib/dashboard-navigation/build-carried-click-context.d.ts +0 -1
- package/dist/types/lib/document/document-input-runtime.d.ts +2 -1
- package/dist/types/lib/export-utils.d.ts +17 -15
- package/dist/types/lib/hooks/explorer/use-filter-builder.d.ts +2 -2
- package/dist/types/lib/hooks/use-relative-date-summarizer.d.ts +7 -0
- package/dist/types/lib/matrix-table/matrix-application-adapter.d.ts +3 -2
- package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-dataset-history.d.ts +47 -0
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +7 -3
- package/dist/types/lib/matrix-table/matrix-execution-context.d.ts +2 -0
- package/dist/types/lib/matrix-table/matrix-query-transport.d.ts +4 -1
- package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +105 -4
- package/dist/types/lib/matrix-table/matrix-runtime.d.ts +43 -2
- package/dist/types/lib/matrix-table/use-matrix.d.ts +6 -0
- package/dist/types/lib/query-context/build-card-query-context.d.ts +5 -1
- package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +0 -1
- package/dist/types/lib/query-context/build-global-date-comparison-context.d.ts +1 -2
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +1 -2
- package/dist/types/lib/query-context/dashboard-card-query-key.d.ts +10 -0
- package/dist/types/lib/query-context/query-auth-scope.d.ts +5 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +9 -4
- package/dist/types/lib/temporal-filter/temporal-filter-utils.d.ts +9 -2
- package/dist/types/lib/types/common-types.d.ts +5 -0
- package/dist/types/lib/types/explorer-types.d.ts +14 -0
- package/dist/types/lib/types/token-types.d.ts +0 -1
- package/dist/types/lib/utils/card-definition.d.ts +1 -1
- package/dist/types/lib/utils/date-timezone-utils.d.ts +4 -46
- package/dist/types/lib/utils/filter-default-value-utils.d.ts +8 -2
- package/dist/types/lib/utils/inline-filter-utils.d.ts +3 -2
- package/dist/types/lib/utils/relative-date-description.d.ts +38 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +10 -7
- package/dist/types/shared/analytics-protocol/index.d.ts +12 -1
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +20 -20
- package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +10 -10
- package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +8 -8
- package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +51 -5
- package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +9 -3
- package/dist/types/shared/analytics-protocol/operation-temporal-state.d.ts +64 -0
- package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +61 -0
- package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +20 -0
- package/dist/types/shared/analytics-protocol/runtime-schemas.d.ts +0 -2
- package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +314 -0
- package/dist/types/shared/analytics-protocol/time-window.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +8 -4
- package/dist/types/shared/format-utils/exporters/csv-utils.d.ts +46 -15
- package/dist/types/shared/format-utils/exporters/index.d.ts +2 -3
- package/dist/types/shared/format-utils/flat-table-export-totals.d.ts +2 -1
- package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +2 -2
- package/dist/types/shared/format-utils/types/format-types.d.ts +0 -42
- package/dist/types/shared/temporal/calendar-periods.d.ts +56 -0
- package/dist/types/shared/temporal/index.d.ts +5 -0
- package/dist/types/shared/temporal/relative-date.d.ts +21 -0
- package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +73 -0
- package/dist/types/shared/temporal/time-window-periods.d.ts +21 -0
- package/dist/types/shared/temporal/zoned-wall-clock.d.ts +23 -0
- package/package.json +1 -17
- package/src/data-app-sdk/README.md +6 -3
- package/dist/chunks/code-highlight-994tgM9v.js +0 -22265
- package/dist/chunks/dashboard-CsHvEtjN.js +0 -15
- package/dist/chunks/dashboard-date-comparison-definition-BqNhECUr.js +0 -183
- package/dist/chunks/matrix-formatter-WBgtebUT.js +0 -341
- package/dist/chunks/matrix-operation-contract-D32U2CSw.js +0 -1802
- package/dist/chunks/mouse-pointer-2-BZvGk45-.js +0 -19
- package/dist/chunks/pivot-header-presentation-CGtudHo7.js +0 -661
- package/dist/chunks/pre-block-Cq1RqhZX.js +0 -3987
- package/dist/chunks/search-CJz-QQ0Q.js +0 -24
- package/dist/chunks/switch-XaAACBrJ.js +0 -2234
- package/dist/chunks/temporal-input-presentation-2RJrvmYL.js +0 -222
- package/dist/chunks/update-policy-DhAUtiC8.js +0 -913
- package/dist/data-app-builder/index.js +0 -3666
- package/dist/data-app-builder-browser-runtime/index.js +0 -8
- package/dist/data-app-codegen/index.js +0 -22
- package/dist/data-app-codegen-node/index.js +0 -1807
- package/dist/types/components/data-app-runtime/published-data-app-runtime.d.ts +0 -7
- package/dist/types/components/surfboard/json-to-csv.d.ts +0 -7
- package/dist/types/components/visual/data-table/utils/export-utils.d.ts +0 -31
- package/dist/types/data-app-builder/browser-runtime.d.ts +0 -174
- package/dist/types/data-app-builder/constants.d.ts +0 -14
- package/dist/types/data-app-builder/data-app-builder.d.ts +0 -14
- package/dist/types/data-app-builder/index.d.ts +0 -1
- package/dist/types/data-app-builder/lib/api.d.ts +0 -36
- package/dist/types/data-app-builder/lib/context-select.d.ts +0 -3
- package/dist/types/data-app-builder/lib/diagnostics.d.ts +0 -12
- package/dist/types/data-app-builder/lib/file-tree.d.ts +0 -2
- package/dist/types/data-app-builder/types.d.ts +0 -558
- package/dist/types/data-app-builder-browser-runtime.d.ts +0 -2
- package/dist/types/data-app-builder.d.ts +0 -2
- package/dist/types/data-app-codegen/generate-contract.d.ts +0 -26
- package/dist/types/data-app-codegen/generated-contract-files.d.ts +0 -7
- package/dist/types/data-app-codegen/generated-contract-validation.d.ts +0 -13
- package/dist/types/data-app-codegen/index.d.ts +0 -6
- package/dist/types/data-app-codegen/live-execution.d.ts +0 -42
- package/dist/types/data-app-codegen/node.d.ts +0 -2
- package/dist/types/data-app-codegen/update-policy.d.ts +0 -25
- package/dist/types/data-app-codegen/validation.d.ts +0 -8
- package/dist/types/data-app-codegen-node.d.ts +0 -2
- package/dist/types/data-app-codegen.d.ts +0 -2
- package/dist/types/shared/analytics-protocol/data-app-codegen-summary.d.ts +0 -418
- package/dist/types/shared/format-utils/exporters/pivot-exporter.d.ts +0 -13
- package/dist/types/shared/format-utils/exporters/table-exporter.d.ts +0 -10
package/dist/chunks/{report-runtime-context-CxIoGyNM.js → report-runtime-context-CtaGGlit.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseValueFormatPreferences as _, isReportPreferenceSource as C } from "../value-format-preferences/index.js";
|
|
2
|
-
import { i as k,
|
|
2
|
+
import { i as k, A as g } from "./validators-CQcG0EPN.js";
|
|
3
3
|
const M = {
|
|
4
4
|
tz: "UTC",
|
|
5
5
|
weekStart: 1,
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import {
|
|
1
|
+
import { c as r } from "./x-CXDkqdur.js";
|
|
2
|
+
import { x as h, o as f } from "./matrix-operation-contract-BV02rLhu.js";
|
|
3
3
|
/**
|
|
4
4
|
* @license lucide-react v0.453.0 - ISC
|
|
5
5
|
*
|
|
6
6
|
* This source code is licensed under the ISC license.
|
|
7
7
|
* See the LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
const
|
|
9
|
+
const g = r("ChevronRight", [
|
|
10
|
+
["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
|
|
11
|
+
]);
|
|
12
|
+
/**
|
|
13
|
+
* @license lucide-react v0.453.0 - ISC
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the ISC license.
|
|
16
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/
|
|
18
|
+
const z = r("Eye", [
|
|
10
19
|
[
|
|
11
20
|
"path",
|
|
12
21
|
{
|
|
@@ -22,7 +31,7 @@ const S = y("Eye", [
|
|
|
22
31
|
* This source code is licensed under the ISC license.
|
|
23
32
|
* See the LICENSE file in the root directory of this source tree.
|
|
24
33
|
*/
|
|
25
|
-
const
|
|
34
|
+
const I = r("Maximize2", [
|
|
26
35
|
["polyline", { points: "15 3 21 3 21 9", key: "mznyad" }],
|
|
27
36
|
["polyline", { points: "9 21 3 21 3 15", key: "1avn1i" }],
|
|
28
37
|
["line", { x1: "21", x2: "14", y1: "3", y2: "10", key: "ota7mn" }],
|
|
@@ -34,57 +43,69 @@ const g = y("Maximize2", [
|
|
|
34
43
|
* This source code is licensed under the ISC license.
|
|
35
44
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
45
|
*/
|
|
37
|
-
const
|
|
46
|
+
const E = r("Minimize2", [
|
|
38
47
|
["polyline", { points: "4 14 10 14 10 20", key: "11kfnr" }],
|
|
39
48
|
["polyline", { points: "20 10 14 10 14 4", key: "rlmsce" }],
|
|
40
49
|
["line", { x1: "14", x2: "21", y1: "10", y2: "3", key: "o5lafz" }],
|
|
41
50
|
["line", { x1: "3", x2: "10", y1: "21", y2: "14", key: "1atl0r" }]
|
|
42
51
|
]);
|
|
43
|
-
|
|
52
|
+
/**
|
|
53
|
+
* @license lucide-react v0.453.0 - ISC
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the ISC license.
|
|
56
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
57
|
+
*/
|
|
58
|
+
const K = r("Search", [
|
|
59
|
+
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
|
|
60
|
+
["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
|
|
61
|
+
]);
|
|
62
|
+
function m(e, l, t) {
|
|
44
63
|
return e.length === 1 && t(e[0]) === t(l) ? { tuples: [], outcome: "cleared" } : { tuples: [l], outcome: "selected" };
|
|
45
64
|
}
|
|
46
|
-
function
|
|
65
|
+
function k(e, l) {
|
|
47
66
|
const t = /* @__PURE__ */ new Set();
|
|
48
|
-
return e.filter((
|
|
49
|
-
const i = l(
|
|
67
|
+
return e.filter((c) => {
|
|
68
|
+
const i = l(c);
|
|
50
69
|
return t.has(i) ? !1 : (t.add(i), !0);
|
|
51
70
|
});
|
|
52
71
|
}
|
|
53
|
-
function
|
|
54
|
-
const i =
|
|
72
|
+
function C(e, l, t, c) {
|
|
73
|
+
const i = c.limit ?? f, n = c.tupleKey ?? h;
|
|
55
74
|
if (t.kind === "clear") return { tuples: [], outcome: "cleared" };
|
|
56
|
-
if (t.kind === "replace" || !
|
|
57
|
-
return
|
|
75
|
+
if (t.kind === "replace" || !c.multipleSelection)
|
|
76
|
+
return m(e, l, n);
|
|
58
77
|
if (t.kind === "toggle") {
|
|
59
78
|
const u = e.findIndex(
|
|
60
79
|
(o) => n(o) === n(l)
|
|
61
80
|
);
|
|
62
81
|
if (u >= 0) {
|
|
63
|
-
const o = e.filter((
|
|
82
|
+
const o = e.filter((x, p) => p !== u);
|
|
64
83
|
return { tuples: o, outcome: o.length ? "removed" : "cleared" };
|
|
65
84
|
}
|
|
66
85
|
return e.length >= i ? { tuples: e, outcome: "limitReached" } : { tuples: [...e, l], outcome: "added" };
|
|
67
86
|
}
|
|
68
87
|
const d = (u) => t.ordered.findIndex(
|
|
69
88
|
(o) => n(o) === n(u)
|
|
70
|
-
),
|
|
71
|
-
if (
|
|
72
|
-
const
|
|
73
|
-
t.ordered.slice(Math.min(
|
|
89
|
+
), a = d(t.anchor), s = d(l);
|
|
90
|
+
if (a < 0 || s < 0) return m(e, l, n);
|
|
91
|
+
const y = k(
|
|
92
|
+
t.ordered.slice(Math.min(a, s), Math.max(a, s) + 1),
|
|
74
93
|
n
|
|
75
94
|
);
|
|
76
|
-
return
|
|
77
|
-
tuples:
|
|
95
|
+
return y.length <= i ? { tuples: y, outcome: "rangeSelected" } : {
|
|
96
|
+
tuples: a <= s ? y.slice(0, i) : y.slice(-i),
|
|
78
97
|
outcome: "limitReached"
|
|
79
98
|
};
|
|
80
99
|
}
|
|
81
|
-
function
|
|
100
|
+
function R(e, l, t) {
|
|
82
101
|
return t.multipleSelection ? e.metaKey || e.ctrlKey ? "toggle" : e.shiftKey ? l === "table" && t.hasAnchor ? "range" : "toggle" : e.pointerType === "touch" && t.checkboxesShown ? "toggle" : "replace" : "replace";
|
|
83
102
|
}
|
|
84
103
|
export {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
I as
|
|
88
|
-
K as
|
|
89
|
-
E as
|
|
104
|
+
g as C,
|
|
105
|
+
z as E,
|
|
106
|
+
I as M,
|
|
107
|
+
K as S,
|
|
108
|
+
E as a,
|
|
109
|
+
R as g,
|
|
110
|
+
C as r
|
|
90
111
|
};
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { v as D } from "./validators-CQcG0EPN.js";
|
|
2
|
+
import "./matrix-operation-contract-BV02rLhu.js";
|
|
3
|
+
import "zod";
|
|
4
|
+
import { i as F } from "./raw-temporal-CdnA_OXJ.js";
|
|
5
|
+
const S = "en-US", p = [
|
|
6
|
+
"compact",
|
|
7
|
+
"maximumFractionDigits",
|
|
8
|
+
"minimumFractionDigits",
|
|
9
|
+
"negativeStyle",
|
|
10
|
+
"type",
|
|
11
|
+
"useGrouping"
|
|
12
|
+
];
|
|
13
|
+
function b(e) {
|
|
14
|
+
if (e.type !== "currency" || Object.prototype.hasOwnProperty.call(e, "currency") || Object.prototype.hasOwnProperty.call(e, "locale"))
|
|
15
|
+
return !1;
|
|
16
|
+
const i = Object.keys(e).sort();
|
|
17
|
+
return i.length === p.length && p.every(
|
|
18
|
+
(n, t) => i[t] === n
|
|
19
|
+
) && typeof e.minimumFractionDigits == "number" && typeof e.maximumFractionDigits == "number" && e.useGrouping === !0 && e.negativeStyle === "minus" && typeof e.compact == "boolean";
|
|
20
|
+
}
|
|
21
|
+
function y(e) {
|
|
22
|
+
if (typeof e != "string")
|
|
23
|
+
return;
|
|
24
|
+
const i = e.trim();
|
|
25
|
+
if (!(!i || i.toLowerCase() === "none"))
|
|
26
|
+
return i;
|
|
27
|
+
}
|
|
28
|
+
function a(e) {
|
|
29
|
+
if (!(typeof e != "number" || !Number.isFinite(e)))
|
|
30
|
+
return Math.max(0, Math.min(10, Math.trunc(e)));
|
|
31
|
+
}
|
|
32
|
+
function v(e) {
|
|
33
|
+
return e === "currency" ? 2 : e === "percent" ? 1 : e === "scientific" ? 2 : 0;
|
|
34
|
+
}
|
|
35
|
+
function U(e, i, n) {
|
|
36
|
+
const t = a(i.minimumFractionDigits), u = a(i.maximumFractionDigits);
|
|
37
|
+
if (typeof t == "number" || typeof u == "number") {
|
|
38
|
+
const o = t ?? 0, m = u ?? Math.max(o, 2);
|
|
39
|
+
return {
|
|
40
|
+
minimumFractionDigits: Math.min(o, m),
|
|
41
|
+
maximumFractionDigits: Math.max(o, m)
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
const s = a(i.decimals);
|
|
45
|
+
if (typeof s == "number")
|
|
46
|
+
return {
|
|
47
|
+
minimumFractionDigits: s,
|
|
48
|
+
maximumFractionDigits: s
|
|
49
|
+
};
|
|
50
|
+
if (n != null && n.preserveOmittedProperties)
|
|
51
|
+
return {};
|
|
52
|
+
const c = v(e);
|
|
53
|
+
return {
|
|
54
|
+
minimumFractionDigits: c,
|
|
55
|
+
maximumFractionDigits: c
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function z(e, i) {
|
|
59
|
+
if (!(typeof i != "string" || e === "percent" && i === "%"))
|
|
60
|
+
return i;
|
|
61
|
+
}
|
|
62
|
+
function g(e) {
|
|
63
|
+
const i = y(e.locale), n = y(e.currency), t = z(e.type, e.suffix);
|
|
64
|
+
return {
|
|
65
|
+
...e,
|
|
66
|
+
...i !== e.locale ? { locale: i } : {},
|
|
67
|
+
...n !== e.currency ? { currency: n } : {},
|
|
68
|
+
...t !== e.suffix ? { suffix: t } : {}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function r(e, i, n) {
|
|
72
|
+
const t = { ...i, type: e };
|
|
73
|
+
if ((n == null ? void 0 : n.numericInput) === "canonical" && F(t))
|
|
74
|
+
return g(t);
|
|
75
|
+
const u = U(e, i, n), s = typeof i.prefix == "string" ? i.prefix : void 0, c = {
|
|
76
|
+
type: e,
|
|
77
|
+
locale: i.locale,
|
|
78
|
+
minimumFractionDigits: u.minimumFractionDigits,
|
|
79
|
+
maximumFractionDigits: u.maximumFractionDigits,
|
|
80
|
+
useGrouping: typeof i.useGrouping == "boolean" ? i.useGrouping : typeof i.thousandsSeparator == "boolean" ? i.thousandsSeparator : !0,
|
|
81
|
+
prefix: s,
|
|
82
|
+
suffix: i.suffix,
|
|
83
|
+
negativeStyle: i.negativeStyle || "minus",
|
|
84
|
+
compact: !!i.compact,
|
|
85
|
+
scale: typeof i.scale == "number" ? i.scale : void 0
|
|
86
|
+
};
|
|
87
|
+
return e === "currency" && i.currency && (c.currency = i.currency), e === "percent" && (c.percentValueMode = i.percentValueMode || "fraction"), g(c);
|
|
88
|
+
}
|
|
89
|
+
function f(e) {
|
|
90
|
+
return {
|
|
91
|
+
type: "date",
|
|
92
|
+
locale: e.locale || S,
|
|
93
|
+
pattern: e.pattern,
|
|
94
|
+
relative: !!e.relative,
|
|
95
|
+
timezone: e.timezone,
|
|
96
|
+
sourceTimezone: e.sourceTimezone,
|
|
97
|
+
prefix: e.prefix,
|
|
98
|
+
suffix: e.suffix
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function l(e) {
|
|
102
|
+
return e === "millisecond" || e === "second" || e === "minute" || e === "hour" || e === "day";
|
|
103
|
+
}
|
|
104
|
+
function d(e) {
|
|
105
|
+
const i = a(e.maxUnits);
|
|
106
|
+
return {
|
|
107
|
+
type: "duration",
|
|
108
|
+
inputUnit: l(e.inputUnit) ? e.inputUnit : "second",
|
|
109
|
+
outputStyle: e.outputStyle === "digital" || e.outputStyle === "long" ? e.outputStyle : "compact",
|
|
110
|
+
largestUnit: l(e.largestUnit) ? e.largestUnit : void 0,
|
|
111
|
+
smallestUnit: l(e.smallestUnit) ? e.smallestUnit : "second",
|
|
112
|
+
maxUnits: i,
|
|
113
|
+
prefix: e.prefix,
|
|
114
|
+
suffix: e.suffix,
|
|
115
|
+
negativeStyle: e.negativeStyle || "minus"
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
function x(e) {
|
|
119
|
+
return {
|
|
120
|
+
type: "string",
|
|
121
|
+
prefix: e.prefix,
|
|
122
|
+
suffix: e.suffix
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function L(e, i) {
|
|
126
|
+
if (!e)
|
|
127
|
+
return;
|
|
128
|
+
if (typeof e == "string") {
|
|
129
|
+
const t = e.trim().toLowerCase();
|
|
130
|
+
return t === "currency" ? r(
|
|
131
|
+
"currency",
|
|
132
|
+
{ type: "currency" },
|
|
133
|
+
i
|
|
134
|
+
) : t === "percentage" || t === "percent" ? r(
|
|
135
|
+
"percent",
|
|
136
|
+
{
|
|
137
|
+
type: "percentage",
|
|
138
|
+
percentValueMode: "fraction"
|
|
139
|
+
},
|
|
140
|
+
i
|
|
141
|
+
) : t === "scientific" ? r(
|
|
142
|
+
"scientific",
|
|
143
|
+
{ type: "scientific" },
|
|
144
|
+
i
|
|
145
|
+
) : t === "date" ? f({}) : t === "duration" ? d({}) : t === "string" ? x({}) : t === "number" ? r(
|
|
146
|
+
"number",
|
|
147
|
+
{ type: "number" },
|
|
148
|
+
i
|
|
149
|
+
) : void 0;
|
|
150
|
+
}
|
|
151
|
+
if ("type" in e && e.type === "temporal_bucket") {
|
|
152
|
+
const t = D.safeParse(e);
|
|
153
|
+
return t.success ? t.data : void 0;
|
|
154
|
+
}
|
|
155
|
+
const n = e;
|
|
156
|
+
if ((i == null ? void 0 : i.numericInput) === "canonical") {
|
|
157
|
+
const t = n.type === "percentage" ? { ...n, type: "percent" } : n;
|
|
158
|
+
if (F(t))
|
|
159
|
+
return r(t.type, t, i);
|
|
160
|
+
}
|
|
161
|
+
if (n.type === "percentage")
|
|
162
|
+
return r(
|
|
163
|
+
"percent",
|
|
164
|
+
{
|
|
165
|
+
...n,
|
|
166
|
+
percentValueMode: n.percentValueMode || "fraction"
|
|
167
|
+
},
|
|
168
|
+
i
|
|
169
|
+
);
|
|
170
|
+
if (n.type === "number" || n.type === "currency" || n.type === "percent" || n.type === "scientific") {
|
|
171
|
+
const t = r(
|
|
172
|
+
n.type,
|
|
173
|
+
n,
|
|
174
|
+
i
|
|
175
|
+
);
|
|
176
|
+
return b(n) ? { ...t, currency: "USD" } : t;
|
|
177
|
+
}
|
|
178
|
+
if (n.type === "date")
|
|
179
|
+
return f(n);
|
|
180
|
+
if (n.type === "duration")
|
|
181
|
+
return d(n);
|
|
182
|
+
if (n.type === "string")
|
|
183
|
+
return x(n);
|
|
184
|
+
}
|
|
185
|
+
export {
|
|
186
|
+
S as D,
|
|
187
|
+
d as a,
|
|
188
|
+
r as b,
|
|
189
|
+
y as c,
|
|
190
|
+
L as f,
|
|
191
|
+
f as n
|
|
192
|
+
};
|