react-semaphor 0.1.526 → 0.1.528
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 +1190 -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-DUu-tCQw.js} +66 -65
- package/dist/chunks/{card-config-utils-9sv4e-Vb.js → card-config-utils-BdPceiw8.js} +68 -65
- package/dist/chunks/{constants-DeLIHVAW.js → constants-DNWVy8Y3.js} +4 -4
- package/dist/chunks/dashboard-BkskKMck.js +14 -0
- package/dist/chunks/{dashboard-briefing-launcher-DXz1GhFZ.js → dashboard-briefing-launcher-Bb0RhGRC.js} +372 -359
- package/dist/chunks/{dashboard-controls-Df8qOSrs.js → dashboard-controls-loWTHPMi.js} +739 -686
- package/dist/chunks/{dashboard-json-Xldp0qww.js → dashboard-json-DUci_SOR.js} +10 -10
- package/dist/chunks/{edit-dashboard-visual-COHBqyic.js → edit-dashboard-visual-z9WN26w7.js} +6603 -6572
- package/dist/chunks/{editor-action-buttons-DahlP57T.js → editor-action-buttons-CGSFK9S-.js} +266 -267
- package/dist/chunks/{field-aggregations-BQjogiI1.js → field-aggregations-CdXSo1pb.js} +19 -19
- package/dist/chunks/{field-dependencies-v-lJNzC7.js → field-dependencies-CGYic38w.js} +1 -1
- package/dist/chunks/{index-CbjuruKe.js → index-CTYnXU85.js} +781 -780
- 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-DhykwdZs.js} +7 -6
- package/dist/chunks/{matrix-control-sources-2VAzGlt8.js → matrix-control-sources-BV9ywFtJ.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-1Mm8x8w7.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-Dp7kFpVk.js +1383 -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-CZa3556D.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-Bqdtknud.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-VV0-Ro6F.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-IZjBSU6Z.js} +47 -26
- package/dist/chunks/semantic-format-BBLvfwua.js +192 -0
- package/dist/chunks/{semaphor-ready-indicator-BLRDuLr4.js → semaphor-ready-indicator-DbA4mVQL.js} +49909 -46207
- package/dist/chunks/{slider-BYIH4icg.js → slider-DpiJG8lv.js} +81 -82
- package/dist/chunks/{source-entity-resolution-Bzefiive.js → source-entity-resolution-Bde29mqE.js} +25 -25
- package/dist/chunks/switch-C4YH-W1X.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/semantic-types.d.ts +4 -2
- package/dist/types/lib/types/token-types.d.ts +0 -1
- package/dist/types/lib/utils/aggregate-expression-utils.d.ts +0 -4
- 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/aggregate-expression.d.ts +89 -0
- package/dist/types/shared/analytics-protocol/analytics-refusal.d.ts +32 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +48 -7
- package/dist/types/shared/analytics-protocol/index.d.ts +15 -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 +61 -6
- package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +63 -0
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as b } from "./validators-CQcG0EPN.js";
|
|
2
2
|
const g = "higher_is_better", D = {
|
|
3
3
|
displayMode: "difference",
|
|
4
4
|
showComparison: !0,
|
|
@@ -7,9 +7,9 @@ const g = "higher_is_better", D = {
|
|
|
7
7
|
conditionalLabel: !1
|
|
8
8
|
};
|
|
9
9
|
function u(o) {
|
|
10
|
-
return
|
|
10
|
+
return b(o) !== null;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function y(o) {
|
|
13
13
|
var n, e, s, t;
|
|
14
14
|
if (((n = o.metricComparison) == null ? void 0 : n.mode) !== "off") {
|
|
15
15
|
if (((e = o.metricComparison) == null ? void 0 : e.mode) === "explicit")
|
|
@@ -22,7 +22,7 @@ function I(o) {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function I(o) {
|
|
26
26
|
if (o.alias) return o.alias;
|
|
27
27
|
const n = o.entityName && o.entityName !== "SEMAPHOR_CALCULATED_FIELD" ? o.entityName : void 0, e = n && n !== o.name ? `${n}_` : "";
|
|
28
28
|
if (o.role !== "metric") return `${e}${o.name}`;
|
|
@@ -77,7 +77,7 @@ function f(o, n, e) {
|
|
|
77
77
|
)
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function _(o, n = "comparison") {
|
|
81
81
|
const e = [];
|
|
82
82
|
return p(o) ? (o.kind === "previous_period" ? (a(
|
|
83
83
|
o,
|
|
@@ -127,7 +127,7 @@ function k(o, n = "comparison") {
|
|
|
127
127
|
warnings: []
|
|
128
128
|
};
|
|
129
129
|
const e = [];
|
|
130
|
-
return o.mode === "off" ? a(o, ["mode"], n, e) : o.mode === "explicit" ? (a(o, ["mode", "spec"], n, e), e.push(...
|
|
130
|
+
return o.mode === "off" ? a(o, ["mode"], n, e) : o.mode === "explicit" ? (a(o, ["mode", "spec"], n, e), e.push(..._(o.spec, `${n}.spec`).errors)) : e.push(
|
|
131
131
|
i(
|
|
132
132
|
"invalid_comparison_config",
|
|
133
133
|
"Comparison mode must be off or explicit.",
|
|
@@ -153,7 +153,7 @@ function C(o, n = "comparisonSelection") {
|
|
|
153
153
|
a(o, ["mode"], n, e);
|
|
154
154
|
else if (o.mode === "period") {
|
|
155
155
|
a(o, ["mode", "spec"], n, e);
|
|
156
|
-
const s =
|
|
156
|
+
const s = _(o.spec, `${n}.spec`);
|
|
157
157
|
e.push(...s.errors), p(o.spec) && o.spec.kind === "target" && e.push(
|
|
158
158
|
i(
|
|
159
159
|
"invalid_global_date_comparison",
|
|
@@ -238,6 +238,10 @@ function N(o, n = "globalDateComparison") {
|
|
|
238
238
|
)
|
|
239
239
|
), { ok: e.length === 0, errors: e, warnings: [] };
|
|
240
240
|
}
|
|
241
|
+
function T(o) {
|
|
242
|
+
const { referenceTime: n, ...e } = o;
|
|
243
|
+
return e;
|
|
244
|
+
}
|
|
241
245
|
function M(o, n = "comparisonPolarity") {
|
|
242
246
|
return o === "higher_is_better" || o === "lower_is_better" || o === "neutral" ? { ok: !0, errors: [], warnings: [] } : {
|
|
243
247
|
ok: !1,
|
|
@@ -355,7 +359,7 @@ function w(o) {
|
|
|
355
359
|
function $(o, n) {
|
|
356
360
|
return o === "unknown" || o === "no_change" || n === "neutral" ? "neutral" : n === "higher_is_better" && o === "increase" || n === "lower_is_better" && o === "decrease" ? "favorable" : "unfavorable";
|
|
357
361
|
}
|
|
358
|
-
function
|
|
362
|
+
function A(o) {
|
|
359
363
|
const {
|
|
360
364
|
currentValue: n,
|
|
361
365
|
comparisonValue: e,
|
|
@@ -381,7 +385,8 @@ export {
|
|
|
381
385
|
N as d,
|
|
382
386
|
M as e,
|
|
383
387
|
S as f,
|
|
384
|
-
|
|
388
|
+
A as g,
|
|
385
389
|
I as r,
|
|
386
|
-
|
|
390
|
+
_ as v,
|
|
391
|
+
T as w
|
|
387
392
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { K as C, M as O } from "./validators-CQcG0EPN.js";
|
|
2
2
|
import { canonicalizeSupportedLocale as E, canonicalizeSupportedCurrencyCode as h } from "../value-format-preferences/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { d as _ } from "./temporal-bucket-DlFuhCnT.js";
|
|
4
4
|
const U = [
|
|
5
5
|
"day",
|
|
6
6
|
"hour",
|
|
@@ -13,13 +13,13 @@ const U = [
|
|
|
13
13
|
minute: 6e4,
|
|
14
14
|
second: 1e3,
|
|
15
15
|
millisecond: 1
|
|
16
|
-
},
|
|
16
|
+
}, T = {
|
|
17
17
|
day: "d",
|
|
18
18
|
hour: "hr",
|
|
19
19
|
minute: "min",
|
|
20
20
|
second: "s",
|
|
21
21
|
millisecond: "ms"
|
|
22
|
-
},
|
|
22
|
+
}, b = {
|
|
23
23
|
day: ["day", "days"],
|
|
24
24
|
hour: ["hour", "hours"],
|
|
25
25
|
minute: ["minute", "minutes"],
|
|
@@ -36,38 +36,38 @@ function M(i, e) {
|
|
|
36
36
|
return U.indexOf(k(i, e));
|
|
37
37
|
}
|
|
38
38
|
function A(i, e) {
|
|
39
|
-
const c = M(i, "day"), r = M(e, "second"),
|
|
40
|
-
return U.slice(
|
|
39
|
+
const c = M(i, "day"), r = M(e, "second"), n = Math.min(c, r), t = Math.max(c, r);
|
|
40
|
+
return U.slice(n, t + 1);
|
|
41
41
|
}
|
|
42
42
|
function K(i, e) {
|
|
43
43
|
return i * D[k(e, "second")];
|
|
44
44
|
}
|
|
45
45
|
function W(i, e) {
|
|
46
|
-
const c = A(e.largestUnit, e.smallestUnit), r = c[c.length - 1],
|
|
47
|
-
let t = Math.round(i /
|
|
48
|
-
return c.map((
|
|
49
|
-
const u = D[
|
|
50
|
-
return t -= s * u, { unit:
|
|
46
|
+
const c = A(e.largestUnit, e.smallestUnit), r = c[c.length - 1], n = D[r];
|
|
47
|
+
let t = Math.round(i / n) * n;
|
|
48
|
+
return c.map((a) => {
|
|
49
|
+
const u = D[a], s = Math.floor(t / u);
|
|
50
|
+
return t -= s * u, { unit: a, value: s };
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
function q(i, e) {
|
|
54
|
-
const c = i.filter((t) => t.value !== 0), r = c.length > 0 ? c : [i[i.length - 1]],
|
|
55
|
-
return r.slice(0,
|
|
54
|
+
const c = i.filter((t) => t.value !== 0), r = c.length > 0 ? c : [i[i.length - 1]], n = typeof e == "number" && Number.isFinite(e) ? Math.max(1, Math.trunc(e)) : r.length;
|
|
55
|
+
return r.slice(0, n).map((t) => `${t.value}${T[t.unit]}`).join(" ");
|
|
56
56
|
}
|
|
57
57
|
function Z(i, e) {
|
|
58
|
-
const c = i.filter((t) => t.value !== 0), r = c.length > 0 ? c : [i[i.length - 1]],
|
|
59
|
-
return r.slice(0,
|
|
60
|
-
const [
|
|
61
|
-
return `${t.value} ${t.value === 1 ?
|
|
58
|
+
const c = i.filter((t) => t.value !== 0), r = c.length > 0 ? c : [i[i.length - 1]], n = typeof e == "number" && Number.isFinite(e) ? Math.max(1, Math.trunc(e)) : r.length;
|
|
59
|
+
return r.slice(0, n).map((t) => {
|
|
60
|
+
const [a, u] = b[t.unit];
|
|
61
|
+
return `${t.value} ${t.value === 1 ? a : u}`;
|
|
62
62
|
}).join(" ");
|
|
63
63
|
}
|
|
64
64
|
function z(i) {
|
|
65
65
|
const e = i.some(
|
|
66
66
|
(s) => s.unit === "day" && s.value !== 0
|
|
67
|
-
), c = i.some((s) => s.unit === "millisecond"), r = i.findIndex((s) => s.value !== 0),
|
|
68
|
-
if (
|
|
67
|
+
), c = i.some((s) => s.unit === "millisecond"), r = i.findIndex((s) => s.value !== 0), n = Math.max(0, i.length - 2), t = e ? 0 : r === -1 ? n : Math.min(r, n), a = r === -1 ? i.slice(n) : i.slice(t);
|
|
68
|
+
if (a.length === 0)
|
|
69
69
|
return "0";
|
|
70
|
-
const u =
|
|
70
|
+
const u = a.map((s, l) => s.unit === "millisecond" ? String(s.value).padStart(3, "0") : l === 0 ? String(s.value) : String(s.value).padStart(2, "0")).join(":");
|
|
71
71
|
return c ? u.replace(/:(\d{3})$/, ".$1") : u;
|
|
72
72
|
}
|
|
73
73
|
function J(i, e, c) {
|
|
@@ -80,7 +80,7 @@ function Y(i, e = {}) {
|
|
|
80
80
|
const c = typeof i == "number" ? i : typeof i == "string" && i.trim() ? Number(i) : NaN;
|
|
81
81
|
if (!Number.isFinite(c))
|
|
82
82
|
return "";
|
|
83
|
-
const r = e.inputUnit || "second",
|
|
83
|
+
const r = e.inputUnit || "second", n = e.outputStyle === "digital" || e.outputStyle === "long" ? e.outputStyle : "compact", t = c < 0, a = Math.abs(K(c, r)), u = W(a, e), s = n === "digital" ? z(u) : n === "long" ? Z(u, e.maxUnits) : q(u, e.maxUnits);
|
|
84
84
|
return J(s, t, e);
|
|
85
85
|
}
|
|
86
86
|
function G(i, e) {
|
|
@@ -143,7 +143,7 @@ function I(i) {
|
|
|
143
143
|
return e === "en-in" || e.startsWith("en-in-");
|
|
144
144
|
}
|
|
145
145
|
function P(i, e) {
|
|
146
|
-
const c = d(i), r = (
|
|
146
|
+
const c = d(i), r = (n) => typeof c == "number" ? c >= n : O(c.value, String(n)) >= 0;
|
|
147
147
|
return r(1e12) ? { power: 12, suffix: "T" } : r(1e9) ? { power: 9, suffix: "B" } : I(e) && r(1e7) ? { power: 7, suffix: "Cr" } : r(1e6) ? { power: 6, suffix: "M" } : I(e) && r(1e5) ? { power: 5, suffix: "L" } : r(1e3) ? { power: 3, suffix: "K" } : { power: 0, suffix: "" };
|
|
148
148
|
}
|
|
149
149
|
function S(i, e) {
|
|
@@ -170,33 +170,33 @@ function v(i, e) {
|
|
|
170
170
|
const c = g(e == null ? void 0 : e.locale);
|
|
171
171
|
let r = i;
|
|
172
172
|
if (e != null && e.multiplyBy && (r = V(r, e.multiplyBy)), e != null && e.useSuffix) {
|
|
173
|
-
const { power: t, suffix:
|
|
173
|
+
const { power: t, suffix: a } = S(r, c);
|
|
174
174
|
r = y(r, t);
|
|
175
175
|
const u = f(r, new Intl.NumberFormat(c, {
|
|
176
176
|
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
177
177
|
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
|
|
178
178
|
useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
|
|
179
179
|
}));
|
|
180
|
-
return `${(e == null ? void 0 : e.prefix) ?? ""}${u}${
|
|
180
|
+
return `${(e == null ? void 0 : e.prefix) ?? ""}${u}${a}${(e == null ? void 0 : e.suffix) ?? ""}`;
|
|
181
181
|
}
|
|
182
|
-
const
|
|
182
|
+
const n = f(r, new Intl.NumberFormat(c, {
|
|
183
183
|
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
184
184
|
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
|
|
185
185
|
useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
|
|
186
186
|
}));
|
|
187
187
|
if (e != null && e.negativeInParentheses && x(r)) {
|
|
188
|
-
const t =
|
|
188
|
+
const t = n.replace("-", "");
|
|
189
189
|
return `(${(e == null ? void 0 : e.prefix) ?? ""}${t}${(e == null ? void 0 : e.suffix) ?? ""})`;
|
|
190
190
|
}
|
|
191
|
-
return `${(e == null ? void 0 : e.prefix) ?? ""}${
|
|
191
|
+
return `${(e == null ? void 0 : e.prefix) ?? ""}${n}${(e == null ? void 0 : e.suffix) ?? ""}`;
|
|
192
192
|
}
|
|
193
193
|
function o(i, e) {
|
|
194
194
|
if (i == null || Number.isNaN(i))
|
|
195
195
|
return "";
|
|
196
|
-
const c = g(e == null ? void 0 : e.locale), r = (e == null ? void 0 : e.currency) || "USD",
|
|
196
|
+
const c = g(e == null ? void 0 : e.locale), r = (e == null ? void 0 : e.currency) || "USD", n = x(i), t = !!(e != null && e.negativeInParentheses && n), a = t ? d(i) : i;
|
|
197
197
|
try {
|
|
198
198
|
if (e != null && e.useSuffix) {
|
|
199
|
-
const { power: s, suffix: l } = S(
|
|
199
|
+
const { power: s, suffix: l } = S(a, c), m = y(a, s), w = `${f(m, new Intl.NumberFormat(c, {
|
|
200
200
|
style: "currency",
|
|
201
201
|
currency: r,
|
|
202
202
|
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
@@ -205,7 +205,7 @@ function o(i, e) {
|
|
|
205
205
|
}))}${l}`;
|
|
206
206
|
return t ? `(${w})` : w;
|
|
207
207
|
}
|
|
208
|
-
const u = f(
|
|
208
|
+
const u = f(a, new Intl.NumberFormat(c, {
|
|
209
209
|
style: "currency",
|
|
210
210
|
currency: r,
|
|
211
211
|
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
@@ -223,14 +223,14 @@ function o(i, e) {
|
|
|
223
223
|
useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
|
|
224
224
|
}
|
|
225
225
|
), m = `${r} ${l}${s.suffix}`;
|
|
226
|
-
return
|
|
226
|
+
return n ? e != null && e.negativeInParentheses ? `(${m})` : `-${m}` : m;
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
function L(i, e) {
|
|
230
230
|
if (i == null || Number.isNaN(i))
|
|
231
231
|
return "";
|
|
232
|
-
const c = g(e == null ? void 0 : e.locale),
|
|
233
|
-
return f(
|
|
232
|
+
const c = g(e == null ? void 0 : e.locale), n = (e == null ? void 0 : e.alreadyPercent) ?? (e == null ? void 0 : e.percentValueMode) === "whole" ? y(i, 2) : i;
|
|
233
|
+
return f(n, new Intl.NumberFormat(c, {
|
|
234
234
|
style: "percent",
|
|
235
235
|
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
236
236
|
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
|
|
@@ -250,7 +250,7 @@ function R(i, e) {
|
|
|
250
250
|
function B(i, e) {
|
|
251
251
|
if (i == null || Number.isNaN(i))
|
|
252
252
|
return "";
|
|
253
|
-
const c = e.scale === void 0 ? i : V(i, e.scale), r = e.negativeStyle === "parentheses" && x(c),
|
|
253
|
+
const c = e.scale === void 0 ? i : V(i, e.scale), r = e.negativeStyle === "parentheses" && x(c), n = r ? d(c) : c, t = {
|
|
254
254
|
style: e.type === "number" ? "decimal" : e.type,
|
|
255
255
|
locale: e.locale,
|
|
256
256
|
currency: e.currency,
|
|
@@ -260,28 +260,28 @@ function B(i, e) {
|
|
|
260
260
|
percentValueMode: e.percentValueMode,
|
|
261
261
|
useSuffix: e.compact
|
|
262
262
|
};
|
|
263
|
-
let
|
|
263
|
+
let a;
|
|
264
264
|
switch (e.type) {
|
|
265
265
|
case "currency":
|
|
266
|
-
|
|
266
|
+
a = o(n, t);
|
|
267
267
|
break;
|
|
268
268
|
case "percent":
|
|
269
|
-
|
|
269
|
+
a = L(n, t);
|
|
270
270
|
break;
|
|
271
271
|
case "scientific":
|
|
272
|
-
|
|
272
|
+
a = R(n, t);
|
|
273
273
|
break;
|
|
274
274
|
default:
|
|
275
|
-
|
|
275
|
+
a = v(n, t);
|
|
276
276
|
break;
|
|
277
277
|
}
|
|
278
|
-
const u = `${e.prefix ?? ""}${
|
|
278
|
+
const u = `${e.prefix ?? ""}${a}${e.suffix ?? ""}`;
|
|
279
279
|
return r ? `(${u})` : u;
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function ne(i, e) {
|
|
282
282
|
return e.type === "duration" ? i == null ? "" : G(i, e) : B(i, e);
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function ae(i, e, c = "en-US") {
|
|
285
285
|
if (i == null || typeof i == "number" && isNaN(i))
|
|
286
286
|
return "";
|
|
287
287
|
if ((e == null ? void 0 : e.style) === "duration")
|
|
@@ -291,7 +291,7 @@ function ne(i, e, c = "en-US") {
|
|
|
291
291
|
suffix: e.suffix,
|
|
292
292
|
negativeStyle: e.negativeStyle
|
|
293
293
|
});
|
|
294
|
-
const r = g((e == null ? void 0 : e.locale) || c),
|
|
294
|
+
const r = g((e == null ? void 0 : e.locale) || c), n = (e == null ? void 0 : e.style) || "decimal", t = n === "decimal" ? "number" : n;
|
|
295
295
|
return t === "currency" && new Intl.NumberFormat(r, {
|
|
296
296
|
style: "currency",
|
|
297
297
|
currency: (e == null ? void 0 : e.currency) || "USD"
|
|
@@ -363,14 +363,14 @@ function p(i) {
|
|
|
363
363
|
});
|
|
364
364
|
const r = i.locale === void 0 ? void 0 : E(i.locale);
|
|
365
365
|
i.locale !== void 0 && !r && e.push({ path: "locale", message: "Expected a supported BCP 47 locale." });
|
|
366
|
-
const
|
|
367
|
-
i.currency !== void 0 && !
|
|
366
|
+
const n = i.currency === void 0 ? void 0 : h(i.currency);
|
|
367
|
+
i.currency !== void 0 && !n && e.push({
|
|
368
368
|
path: "currency",
|
|
369
369
|
message: "Expected a supported ISO 4217 currency code."
|
|
370
370
|
});
|
|
371
371
|
for (const t of ["minimumFractionDigits", "maximumFractionDigits"]) {
|
|
372
|
-
const
|
|
373
|
-
|
|
372
|
+
const a = i[t];
|
|
373
|
+
a !== void 0 && (!Number.isInteger(a) || typeof a != "number" || a < 0 || a > 20) && e.push({
|
|
374
374
|
path: t,
|
|
375
375
|
message: "Expected an integer from 0 to 20."
|
|
376
376
|
});
|
|
@@ -404,7 +404,7 @@ function p(i) {
|
|
|
404
404
|
} : {},
|
|
405
405
|
...i.compact !== void 0 ? { compact: i.compact } : {},
|
|
406
406
|
...i.scale !== void 0 ? { scale: i.scale } : {},
|
|
407
|
-
...
|
|
407
|
+
...n ? { currency: n } : {},
|
|
408
408
|
...i.percentValueMode !== void 0 ? {
|
|
409
409
|
percentValueMode: i.percentValueMode
|
|
410
410
|
} : {}
|
|
@@ -433,25 +433,25 @@ function se(i) {
|
|
|
433
433
|
function me(i) {
|
|
434
434
|
var r;
|
|
435
435
|
const e = /* @__PURE__ */ new Set();
|
|
436
|
-
if (i.snapshot.resolvedFormats.forEach((
|
|
437
|
-
if (
|
|
438
|
-
if (
|
|
436
|
+
if (i.snapshot.resolvedFormats.forEach((n, t) => {
|
|
437
|
+
if (n.format.type !== "temporal_bucket") {
|
|
438
|
+
if (n.scope.attachmentIndex !== void 0)
|
|
439
439
|
throw new Error(
|
|
440
440
|
`resolvedFormats.${t}.scope.attachmentIndex is not valid for a card export`
|
|
441
441
|
);
|
|
442
|
-
if (
|
|
442
|
+
if (n.scope.dashboardId !== i.expectedScope.dashboardId || n.scope.cardId !== i.expectedScope.cardId)
|
|
443
443
|
throw new Error(
|
|
444
444
|
`resolvedFormats.${t}.scope must match the executing dashboard/card`
|
|
445
445
|
);
|
|
446
|
-
if (
|
|
446
|
+
if (n.target.kind !== "column")
|
|
447
447
|
throw new Error(
|
|
448
448
|
`resolvedFormats.${t}.target must identify an export column`
|
|
449
449
|
);
|
|
450
|
-
if (e.has(
|
|
450
|
+
if (e.has(n.target.columnKey))
|
|
451
451
|
throw new Error(
|
|
452
|
-
`resolvedFormats.${t} duplicates export column "${
|
|
452
|
+
`resolvedFormats.${t} duplicates export column "${n.target.columnKey}"`
|
|
453
453
|
);
|
|
454
|
-
e.add(
|
|
454
|
+
e.add(n.target.columnKey);
|
|
455
455
|
}
|
|
456
456
|
}), !i.useFormattedValues)
|
|
457
457
|
return;
|
|
@@ -460,7 +460,7 @@ function me(i) {
|
|
|
460
460
|
"visibleColumns must identify every formatted export column"
|
|
461
461
|
);
|
|
462
462
|
const c = i.visibleColumns.find(
|
|
463
|
-
(
|
|
463
|
+
(n) => !e.has(n)
|
|
464
464
|
);
|
|
465
465
|
if (c)
|
|
466
466
|
throw new Error(
|
|
@@ -492,16 +492,16 @@ function ie(i) {
|
|
|
492
492
|
};
|
|
493
493
|
}
|
|
494
494
|
function le(i, e, c) {
|
|
495
|
-
const r = E(i.locale) ?? e.locale,
|
|
496
|
-
if (!(i.type === "currency" ||
|
|
495
|
+
const r = E(i.locale) ?? e.locale, n = i.type === "number" || i.type === "currency" ? h(c) : void 0;
|
|
496
|
+
if (!(i.type === "currency" || n !== void 0))
|
|
497
497
|
return {
|
|
498
498
|
...i,
|
|
499
499
|
locale: r,
|
|
500
500
|
...ie(i)
|
|
501
501
|
};
|
|
502
|
-
const
|
|
502
|
+
const a = n ?? h(i.currency) ?? e.defaultCurrency, u = ee(
|
|
503
503
|
r,
|
|
504
|
-
|
|
504
|
+
a
|
|
505
505
|
), s = u.minimumFractionDigits ?? 0, l = u.maximumFractionDigits ?? s, m = i.minimumFractionDigits ?? Math.min(
|
|
506
506
|
s,
|
|
507
507
|
i.maximumFractionDigits ?? s
|
|
@@ -513,19 +513,19 @@ function le(i, e, c) {
|
|
|
513
513
|
...i,
|
|
514
514
|
type: "currency",
|
|
515
515
|
locale: r,
|
|
516
|
-
currency:
|
|
516
|
+
currency: a,
|
|
517
517
|
minimumFractionDigits: m,
|
|
518
518
|
maximumFractionDigits: N
|
|
519
519
|
};
|
|
520
520
|
}
|
|
521
521
|
export {
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
522
|
+
v as a,
|
|
523
|
+
o as b,
|
|
524
|
+
L as c,
|
|
525
|
+
R as d,
|
|
526
|
+
B as e,
|
|
527
527
|
ne as f,
|
|
528
|
-
|
|
528
|
+
ae as g,
|
|
529
529
|
ue as h,
|
|
530
530
|
Y as i,
|
|
531
531
|
G as j,
|