react-semaphor 0.1.183 → 0.1.184
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/chunks/calendar-preferences-dialog-D9oF_URo.js +1 -0
- package/dist/chunks/calendar-preferences-dialog-DeXKY9JD.js +457 -0
- package/dist/chunks/common-types-CfJLrTJd.js +1 -0
- package/dist/chunks/common-types-DhqlRVrq.js +8 -0
- package/dist/chunks/{dashboard-controls-BqMZqU3v.js → dashboard-controls-CB8282ob.js} +8 -8
- package/dist/chunks/{dashboard-controls-F8wbPI8x.js → dashboard-controls-lRs5t5cg.js} +499 -484
- package/dist/chunks/{dashboard-json-DUNbo5Io.js → dashboard-json-BmzqRV5Q.js} +1 -1
- package/dist/chunks/{dashboard-json-BFRJvB_f.js → dashboard-json-Brn4hMd-.js} +1 -1
- package/dist/chunks/date-formatter-Sz6QDaM8.js +1 -0
- package/dist/chunks/{index-B4EhQdS9.js → date-formatter-Y8Za1ib3.js} +500 -544
- package/dist/chunks/{edit-dashboard-visual-CPwMz-Gl.js → edit-dashboard-visual--FJBg3i3.js} +713 -713
- package/dist/chunks/{edit-dashboard-visual-C-2xW9ZO.js → edit-dashboard-visual-DNq8ni5W.js} +8 -8
- package/dist/chunks/{editor-action-buttons-DEi2BM_u.js → editor-action-buttons-COCkxvCM.js} +27 -27
- package/dist/chunks/{editor-action-buttons-C5pFQC5d.js → editor-action-buttons-RPpMm3Zr.js} +1 -1
- package/dist/chunks/{index-LgltNjBB.js → index-CyYJ0bVW.js} +21147 -20949
- package/dist/chunks/{index-CcVMCdNu.js → index-Dz2kwOQh.js} +229 -229
- package/dist/chunks/{notification-bell-BCdcnJx6.js → notification-bell-B86bWytX.js} +109 -109
- package/dist/chunks/{notification-bell-C0rpelXK.js → notification-bell-Bdk-qQIx.js} +2 -2
- package/dist/chunks/{resource-management-panel-D6ZT7DsU.js → resource-management-panel-BZKSwkRq.js} +160 -160
- package/dist/chunks/{resource-management-panel-CaKtrD1Q.js → resource-management-panel-CvKBoIFQ.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-B3xYm_4b.js → use-role-aware-display-preferences-D-jgaajh.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-F6Zc7Evm.js → use-role-aware-display-preferences-Kxc427Zx.js} +1 -1
- package/dist/chunks/{use-visual-utils-B1yUV6dt.js → use-visual-utils-Du4NIgMk.js} +1 -1
- package/dist/chunks/{use-visual-utils-D48U4CBx.js → use-visual-utils-DwQQN6wI.js} +33 -33
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +3 -3
- package/dist/format-utils/index.cjs +5 -5
- package/dist/format-utils/index.js +200 -250
- package/dist/index.cjs +1 -1
- package/dist/index.js +75 -71
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +6 -4
- package/dist/types/format-utils.d.ts +43 -20
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +8 -5
- package/dist/types/main.d.ts +87 -2
- package/dist/types/surfboard.d.ts +7 -0
- package/dist/types/types.d.ts +313 -0
- package/package.json +1 -1
- package/dist/chunks/index-8Crk3ROJ.js +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { f as
|
|
2
|
-
|
|
1
|
+
import { f as N, a as I } from "../chunks/date-formatter-Y8Za1ib3.js";
|
|
2
|
+
import { g as Y, b as Z, p as F, r as p } from "../chunks/date-formatter-Y8Za1ib3.js";
|
|
3
|
+
const b = [
|
|
3
4
|
{ value: 1e12, suffix: "T" },
|
|
4
5
|
{ value: 1e9, suffix: "B" },
|
|
5
6
|
{ value: 1e7, suffix: "Cr" },
|
|
@@ -9,11 +10,11 @@ const $ = [
|
|
|
9
10
|
// Lakh (Indian)
|
|
10
11
|
{ value: 1e3, suffix: "K" }
|
|
11
12
|
];
|
|
12
|
-
function
|
|
13
|
+
function D(r) {
|
|
13
14
|
const e = Math.abs(r);
|
|
14
|
-
for (const { value: u, suffix:
|
|
15
|
+
for (const { value: u, suffix: c } of b)
|
|
15
16
|
if (e >= u)
|
|
16
|
-
return { divisor: u, suffix:
|
|
17
|
+
return { divisor: u, suffix: c };
|
|
17
18
|
return { divisor: 1, suffix: "" };
|
|
18
19
|
}
|
|
19
20
|
function L(r) {
|
|
@@ -23,95 +24,95 @@ function L(r) {
|
|
|
23
24
|
return !1;
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
+
function t(r) {
|
|
27
28
|
return r && L(r) ? r : "en-US";
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
+
function $(r, e) {
|
|
30
31
|
if (r == null || isNaN(r))
|
|
31
32
|
return "";
|
|
32
|
-
const u =
|
|
33
|
-
let
|
|
34
|
-
if (e != null && e.multiplyBy && (
|
|
35
|
-
const { divisor:
|
|
36
|
-
|
|
37
|
-
const
|
|
33
|
+
const u = t(e == null ? void 0 : e.locale);
|
|
34
|
+
let c = r;
|
|
35
|
+
if (e != null && e.multiplyBy && (c *= e.multiplyBy), e != null && e.useSuffix) {
|
|
36
|
+
const { divisor: f, suffix: i } = D(c);
|
|
37
|
+
c = c / f;
|
|
38
|
+
const m = new Intl.NumberFormat(u, {
|
|
38
39
|
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
39
40
|
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
|
|
40
41
|
useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
|
|
41
|
-
}).format(
|
|
42
|
-
return `${(e == null ? void 0 : e.prefix) ?? ""}${
|
|
42
|
+
}).format(c);
|
|
43
|
+
return `${(e == null ? void 0 : e.prefix) ?? ""}${m}${i}${(e == null ? void 0 : e.suffix) ?? ""}`;
|
|
43
44
|
}
|
|
44
|
-
const
|
|
45
|
+
const l = new Intl.NumberFormat(u, {
|
|
45
46
|
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
46
47
|
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
|
|
47
48
|
useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
|
|
48
|
-
}).format(
|
|
49
|
-
if (e != null && e.negativeInParentheses &&
|
|
50
|
-
const
|
|
51
|
-
return `${(e == null ? void 0 : e.prefix) ?? ""}(${
|
|
49
|
+
}).format(c);
|
|
50
|
+
if (e != null && e.negativeInParentheses && c < 0) {
|
|
51
|
+
const f = l.replace("-", "");
|
|
52
|
+
return `${(e == null ? void 0 : e.prefix) ?? ""}(${f})${(e == null ? void 0 : e.suffix) ?? ""}`;
|
|
52
53
|
}
|
|
53
|
-
return `${(e == null ? void 0 : e.prefix) ?? ""}${
|
|
54
|
+
return `${(e == null ? void 0 : e.prefix) ?? ""}${l}${(e == null ? void 0 : e.suffix) ?? ""}`;
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
+
function z(r, e) {
|
|
56
57
|
if (r == null || isNaN(r))
|
|
57
58
|
return "";
|
|
58
|
-
const u =
|
|
59
|
+
const u = t(e == null ? void 0 : e.locale), c = (e == null ? void 0 : e.currency) || "USD";
|
|
59
60
|
if (e != null && e.useSuffix) {
|
|
60
|
-
const { divisor:
|
|
61
|
+
const { divisor: l, suffix: f } = D(r), i = r / l;
|
|
61
62
|
return `${new Intl.NumberFormat(u, {
|
|
62
63
|
style: "currency",
|
|
63
|
-
currency:
|
|
64
|
+
currency: c,
|
|
64
65
|
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
65
66
|
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
|
|
66
|
-
}).format(
|
|
67
|
+
}).format(i)}${f}`;
|
|
67
68
|
}
|
|
68
69
|
return new Intl.NumberFormat(u, {
|
|
69
70
|
style: "currency",
|
|
70
|
-
currency:
|
|
71
|
+
currency: c,
|
|
71
72
|
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
72
73
|
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
|
|
73
74
|
}).format(r);
|
|
74
75
|
}
|
|
75
|
-
function
|
|
76
|
+
function B(r, e) {
|
|
76
77
|
if (r == null || isNaN(r))
|
|
77
78
|
return "";
|
|
78
|
-
const u =
|
|
79
|
+
const u = t(e == null ? void 0 : e.locale), c = e != null && e.alreadyPercent ? r / 100 : r;
|
|
79
80
|
return new Intl.NumberFormat(u, {
|
|
80
81
|
style: "percent",
|
|
81
82
|
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
82
83
|
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
|
|
83
|
-
}).format(
|
|
84
|
+
}).format(c);
|
|
84
85
|
}
|
|
85
|
-
function
|
|
86
|
+
function E(r, e) {
|
|
86
87
|
if (r == null || isNaN(r))
|
|
87
88
|
return "";
|
|
88
|
-
const u =
|
|
89
|
+
const u = t(e == null ? void 0 : e.locale);
|
|
89
90
|
return new Intl.NumberFormat(u, {
|
|
90
91
|
notation: "scientific",
|
|
91
92
|
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
92
93
|
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
|
|
93
94
|
}).format(r);
|
|
94
95
|
}
|
|
95
|
-
function
|
|
96
|
+
function d(r, e, u = "en-US") {
|
|
96
97
|
if (r == null || isNaN(r))
|
|
97
98
|
return "";
|
|
98
|
-
const
|
|
99
|
-
return
|
|
99
|
+
const c = t((e == null ? void 0 : e.locale) || u), l = (e == null ? void 0 : e.style) || "decimal";
|
|
100
|
+
return l === "percent" ? new Intl.NumberFormat(c, {
|
|
100
101
|
style: "percent",
|
|
101
102
|
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
102
103
|
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
|
|
103
|
-
}).format(r / 100) :
|
|
104
|
+
}).format(r / 100) : l === "currency" ? new Intl.NumberFormat(c, {
|
|
104
105
|
style: "currency",
|
|
105
106
|
currency: (e == null ? void 0 : e.currency) || "USD",
|
|
106
107
|
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
107
108
|
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
|
|
108
|
-
}).format(r) : new Intl.NumberFormat(
|
|
109
|
+
}).format(r) : new Intl.NumberFormat(c, {
|
|
109
110
|
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
110
111
|
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
|
|
111
112
|
}).format(r);
|
|
112
113
|
}
|
|
113
|
-
function
|
|
114
|
-
const
|
|
114
|
+
function k(r, e, u) {
|
|
115
|
+
const c = {
|
|
115
116
|
locale: u == null ? void 0 : u.locale,
|
|
116
117
|
currency: u == null ? void 0 : u.currency,
|
|
117
118
|
minimumFractionDigits: u == null ? void 0 : u.decimalPlaces,
|
|
@@ -124,101 +125,51 @@ function q(r, e, u) {
|
|
|
124
125
|
};
|
|
125
126
|
switch (e) {
|
|
126
127
|
case "currency":
|
|
127
|
-
return
|
|
128
|
+
return z(r, c);
|
|
128
129
|
case "percent":
|
|
129
|
-
return
|
|
130
|
+
return B(r, c);
|
|
130
131
|
case "scientific":
|
|
131
|
-
return
|
|
132
|
+
return E(r, c);
|
|
132
133
|
default:
|
|
133
|
-
return
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
function b(r, e) {
|
|
137
|
-
return r && r !== "auto" ? r : e;
|
|
138
|
-
}
|
|
139
|
-
function J(r, e = /* @__PURE__ */ new Date()) {
|
|
140
|
-
try {
|
|
141
|
-
const u = {
|
|
142
|
-
timeZone: r,
|
|
143
|
-
timeZoneName: "short"
|
|
144
|
-
}, c = new Intl.DateTimeFormat("en-US", u).formatToParts(e).find((a) => a.type === "timeZoneName");
|
|
145
|
-
return (c == null ? void 0 : c.value) || r;
|
|
146
|
-
} catch {
|
|
147
|
-
return r;
|
|
134
|
+
return $(r, c);
|
|
148
135
|
}
|
|
149
136
|
}
|
|
150
|
-
function
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
if (!r)
|
|
165
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
166
|
-
const u = r.endsWith("Z"), t = /[+-]\d{2}:?\d{2}$/.test(r), c = /\([A-Z]{3,4}\)$/.test(r);
|
|
167
|
-
if (e === "auto")
|
|
168
|
-
return u || t || c ? new Date(r) : /* @__PURE__ */ new Date(r + "Z");
|
|
169
|
-
if (e === "local") {
|
|
170
|
-
if (u || t) {
|
|
171
|
-
const a = r.replace(/Z$/, "").replace(/[+-]\d{2}:?\d{2}$/, "");
|
|
172
|
-
return new Date(a);
|
|
173
|
-
}
|
|
174
|
-
return new Date(r);
|
|
175
|
-
} else return e === "UTC" ? u ? new Date(r) : t ? new Date(r) : /* @__PURE__ */ new Date(r + "Z") : u || t || c ? new Date(r) : /* @__PURE__ */ new Date(r + "Z");
|
|
137
|
+
function R(r, e, u, c) {
|
|
138
|
+
const l = r instanceof Date ? r.toISOString() : String(r), f = (c == null ? void 0 : c.browserTimezone) || u, i = (c == null ? void 0 : c.isSqlCard) ?? !1;
|
|
139
|
+
if (e != null && e.useRelativeTime)
|
|
140
|
+
return N(
|
|
141
|
+
l,
|
|
142
|
+
(e == null ? void 0 : e.sourceTimezone) || "auto"
|
|
143
|
+
);
|
|
144
|
+
const m = e != null && e.useCustomFormat && (e != null && e.customFormat) ? e.customFormat : (e == null ? void 0 : e.format) || "MM/dd/yyyy";
|
|
145
|
+
return I(
|
|
146
|
+
l,
|
|
147
|
+
m,
|
|
148
|
+
e != null && e.timezone && (e == null ? void 0 : e.timezone) !== "auto" ? e.timezone : i ? f : u,
|
|
149
|
+
(e == null ? void 0 : e.sourceTimezone) || "auto"
|
|
150
|
+
);
|
|
176
151
|
}
|
|
177
152
|
function P(r, e, u) {
|
|
178
|
-
if (r == null)
|
|
179
|
-
return "";
|
|
180
|
-
try {
|
|
181
|
-
const t = typeof r == "string" ? A(r, e == null ? void 0 : e.sourceTimezone) : r;
|
|
182
|
-
if (isNaN(t.getTime()))
|
|
183
|
-
return String(r);
|
|
184
|
-
if (e != null && e.useRelativeTime)
|
|
185
|
-
return H(t);
|
|
186
|
-
const c = e != null && e.useCustomFormat && (e != null && e.customFormat) ? e.customFormat : (e == null ? void 0 : e.format) || "MM/dd/yyyy", a = b(e == null ? void 0 : e.timezone, u || "UTC");
|
|
187
|
-
return F(t, a, c);
|
|
188
|
-
} catch {
|
|
189
|
-
return String(r);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
function H(r) {
|
|
193
|
-
if (r == null)
|
|
194
|
-
return "";
|
|
195
|
-
try {
|
|
196
|
-
const e = typeof r == "string" ? g(r) : r;
|
|
197
|
-
return isNaN(e.getTime()) ? String(r) : I(e, { addSuffix: !0 });
|
|
198
|
-
} catch {
|
|
199
|
-
return String(r);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
function U(r, e, u) {
|
|
203
|
-
return P(r, e, u);
|
|
204
|
-
}
|
|
205
|
-
function M(r, e, u) {
|
|
206
153
|
if (r == null)
|
|
207
154
|
return "";
|
|
208
155
|
if (!u.useFormattedValues || !e)
|
|
209
156
|
return String(r);
|
|
210
157
|
switch (e.type) {
|
|
211
158
|
case "number":
|
|
212
|
-
return typeof r == "number" ?
|
|
159
|
+
return typeof r == "number" ? d(
|
|
213
160
|
r,
|
|
214
161
|
e.numberFormat,
|
|
215
162
|
u.locale
|
|
216
163
|
) : String(r);
|
|
217
164
|
case "date":
|
|
218
|
-
return
|
|
165
|
+
return R(
|
|
219
166
|
r,
|
|
220
167
|
e.dateFormat,
|
|
221
|
-
u.timezone
|
|
168
|
+
u.timezone,
|
|
169
|
+
{
|
|
170
|
+
browserTimezone: u.browserTimezone,
|
|
171
|
+
isSqlCard: u.isSqlCard
|
|
172
|
+
}
|
|
222
173
|
);
|
|
223
174
|
case "progress":
|
|
224
175
|
return typeof r == "number" ? `${r}%` : String(r);
|
|
@@ -230,222 +181,221 @@ function M(r, e, u) {
|
|
|
230
181
|
return String(r);
|
|
231
182
|
}
|
|
232
183
|
}
|
|
233
|
-
function
|
|
184
|
+
function A(r, e) {
|
|
234
185
|
return e.visibleColumns.map((u) => {
|
|
235
|
-
const
|
|
236
|
-
return
|
|
186
|
+
const c = r[u], l = e.columnSettings[u];
|
|
187
|
+
return P(c, l, {
|
|
237
188
|
useFormattedValues: e.useFormattedValues,
|
|
238
189
|
timezone: e.timezone,
|
|
239
190
|
locale: e.locale
|
|
240
191
|
});
|
|
241
192
|
});
|
|
242
193
|
}
|
|
243
|
-
function
|
|
194
|
+
function h(r, e = ",") {
|
|
244
195
|
if (r == null)
|
|
245
196
|
return "";
|
|
246
197
|
const u = String(r);
|
|
247
198
|
return u.includes(e) || u.includes('"') || u.includes(`
|
|
248
199
|
`) || u.includes("\r") ? `"${u.replace(/"/g, '""')}"` : u;
|
|
249
200
|
}
|
|
250
|
-
function
|
|
251
|
-
return r.map((u) =>
|
|
201
|
+
function S(r, e = ",") {
|
|
202
|
+
return r.map((u) => h(u, e)).join(e);
|
|
252
203
|
}
|
|
253
|
-
function
|
|
254
|
-
const { delimiter: u = ",", lineEnding:
|
|
204
|
+
function H(r, e = {}) {
|
|
205
|
+
const { delimiter: u = ",", lineEnding: c = `
|
|
255
206
|
` } = e;
|
|
256
|
-
return r.map((
|
|
207
|
+
return r.map((l) => S(l, u)).join(c);
|
|
257
208
|
}
|
|
258
|
-
function
|
|
209
|
+
function K(r, e = {}) {
|
|
259
210
|
if (r.length === 0)
|
|
260
211
|
return "";
|
|
261
212
|
const {
|
|
262
213
|
delimiter: u = ",",
|
|
263
|
-
lineEnding:
|
|
214
|
+
lineEnding: c = `
|
|
264
215
|
`,
|
|
265
|
-
includeHeaders:
|
|
266
|
-
columns:
|
|
267
|
-
} = e,
|
|
268
|
-
|
|
269
|
-
for (const
|
|
270
|
-
const s =
|
|
271
|
-
const
|
|
272
|
-
return
|
|
216
|
+
includeHeaders: l = !0,
|
|
217
|
+
columns: f
|
|
218
|
+
} = e, i = f || Object.keys(r[0]), m = [];
|
|
219
|
+
l && m.push(i);
|
|
220
|
+
for (const n of r) {
|
|
221
|
+
const s = i.map((y) => {
|
|
222
|
+
const a = n[y];
|
|
223
|
+
return a == null ? "" : String(a);
|
|
273
224
|
});
|
|
274
|
-
|
|
225
|
+
m.push(s);
|
|
275
226
|
}
|
|
276
|
-
return
|
|
227
|
+
return H(m, { delimiter: u, lineEnding: c });
|
|
277
228
|
}
|
|
278
|
-
function
|
|
229
|
+
function C(r, e) {
|
|
279
230
|
const u = [];
|
|
280
|
-
e.includeHeaders && u.push(
|
|
281
|
-
for (const
|
|
282
|
-
const
|
|
231
|
+
e.includeHeaders && u.push(S(e.visibleColumns, e.delimiter));
|
|
232
|
+
for (const c of r) {
|
|
233
|
+
const l = A(c, e);
|
|
283
234
|
u.push(
|
|
284
|
-
|
|
235
|
+
l.map((f) => h(f, e.delimiter)).join(e.delimiter)
|
|
285
236
|
);
|
|
286
237
|
}
|
|
287
238
|
return u;
|
|
288
239
|
}
|
|
289
|
-
function
|
|
240
|
+
function X(r, e, u = `
|
|
290
241
|
`) {
|
|
291
|
-
return
|
|
242
|
+
return C(r, e).join(u);
|
|
292
243
|
}
|
|
293
|
-
function
|
|
294
|
-
return r == null ? "" : u.useFormattedValues ? typeof r == "number" && (e == null ? void 0 : e.type) === "number" ?
|
|
244
|
+
function M(r, e, u) {
|
|
245
|
+
return r == null ? "" : u.useFormattedValues ? typeof r == "number" && (e == null ? void 0 : e.type) === "number" ? d(
|
|
295
246
|
r,
|
|
296
247
|
e.numberFormat,
|
|
297
248
|
u.locale
|
|
298
249
|
) : typeof r == "number" ? r.toLocaleString(u.locale) : String(r) : String(r);
|
|
299
250
|
}
|
|
300
|
-
function
|
|
301
|
-
var
|
|
302
|
-
const
|
|
251
|
+
function j(r, e, u) {
|
|
252
|
+
var l, f;
|
|
253
|
+
const c = [];
|
|
303
254
|
if (r.isSubtotal && !r.isGrandTotal) {
|
|
304
|
-
const
|
|
305
|
-
(
|
|
255
|
+
const i = e.groupByColumns.findIndex(
|
|
256
|
+
(m) => m.alias === r.subtotalLevel
|
|
306
257
|
);
|
|
307
|
-
e.groupByColumns.forEach((
|
|
308
|
-
var s,
|
|
309
|
-
if (
|
|
310
|
-
const
|
|
258
|
+
e.groupByColumns.forEach((m, n) => {
|
|
259
|
+
var s, y, a, x;
|
|
260
|
+
if (n === i) {
|
|
261
|
+
const w = (y = (s = e.rowAggregates) == null ? void 0 : s.find(
|
|
311
262
|
(V) => V.groupLevel === r.subtotalLevel
|
|
312
|
-
)) == null ? void 0 :
|
|
313
|
-
|
|
314
|
-
} else
|
|
263
|
+
)) == null ? void 0 : y.label, g = (x = (a = r.subtotalContext) == null ? void 0 : a.groupByValues) == null ? void 0 : x[m.alias];
|
|
264
|
+
c.push(w ?? `Subtotal (${g ?? "Total"})`);
|
|
265
|
+
} else n < i ? c.push(String(r[m.alias] ?? "")) : c.push("");
|
|
315
266
|
});
|
|
316
267
|
} else if (r.isGrandTotal) {
|
|
317
|
-
const
|
|
318
|
-
(
|
|
319
|
-
)) == null ? void 0 :
|
|
320
|
-
|
|
268
|
+
const i = (f = (l = e.rowAggregates) == null ? void 0 : l.find(
|
|
269
|
+
(m) => m.groupLevel === "ALL"
|
|
270
|
+
)) == null ? void 0 : f.label;
|
|
271
|
+
c.push(i || "Grand Total"), e.groupByColumns.slice(1).forEach(() => c.push(""));
|
|
321
272
|
} else
|
|
322
|
-
e.groupByColumns.forEach((
|
|
323
|
-
|
|
273
|
+
e.groupByColumns.forEach((i) => {
|
|
274
|
+
c.push(String(r[i.alias] ?? ""));
|
|
324
275
|
});
|
|
325
|
-
return e.pivotSchema.filter((
|
|
326
|
-
const
|
|
327
|
-
|
|
328
|
-
}),
|
|
276
|
+
return e.pivotSchema.filter((i) => i.isMetricColumn).forEach((i) => {
|
|
277
|
+
const m = r[i.alias], n = u.columnSettings[i.alias];
|
|
278
|
+
c.push(M(m, n, u));
|
|
279
|
+
}), c;
|
|
329
280
|
}
|
|
330
|
-
function
|
|
281
|
+
function G(r) {
|
|
331
282
|
const e = r.groupByColumns.map(
|
|
332
|
-
(
|
|
333
|
-
), u = r.pivotSchema.filter((
|
|
283
|
+
(c) => c.label || c.name
|
|
284
|
+
), u = r.pivotSchema.filter((c) => c.isMetricColumn).map((c) => c.displayLabel || c.metricLabel || c.metricName || c.alias);
|
|
334
285
|
return [...e, ...u];
|
|
335
286
|
}
|
|
336
|
-
function
|
|
337
|
-
const
|
|
287
|
+
function _(r, e, u) {
|
|
288
|
+
const c = [];
|
|
338
289
|
if (u.includeHeaders) {
|
|
339
|
-
const
|
|
340
|
-
|
|
290
|
+
const l = G(e);
|
|
291
|
+
c.push(S(l, u.delimiter));
|
|
341
292
|
}
|
|
342
|
-
for (const
|
|
343
|
-
const
|
|
344
|
-
|
|
293
|
+
for (const l of r) {
|
|
294
|
+
const f = j(
|
|
295
|
+
l,
|
|
345
296
|
e,
|
|
346
297
|
u
|
|
347
298
|
);
|
|
348
|
-
|
|
349
|
-
|
|
299
|
+
c.push(
|
|
300
|
+
f.map((i) => h(i, u.delimiter)).join(u.delimiter)
|
|
350
301
|
);
|
|
351
302
|
}
|
|
352
|
-
return
|
|
303
|
+
return c;
|
|
353
304
|
}
|
|
354
|
-
function
|
|
355
|
-
for (const
|
|
356
|
-
if (
|
|
357
|
-
e[
|
|
358
|
-
for (let
|
|
359
|
-
e[
|
|
305
|
+
function T(r, e, u) {
|
|
306
|
+
for (const c of r) {
|
|
307
|
+
if (c.level < u) {
|
|
308
|
+
e[c.level].push(c.name);
|
|
309
|
+
for (let l = 1; l < c.colspan; l++)
|
|
310
|
+
e[c.level].push("");
|
|
360
311
|
}
|
|
361
|
-
|
|
312
|
+
c.children ? T(c.children, e, u) : c.columnKey && e[u].push(c.name);
|
|
362
313
|
}
|
|
363
314
|
}
|
|
364
|
-
function
|
|
365
|
-
const e = r.pivotByColumns.length, u = r.groupByColumns.length,
|
|
315
|
+
function U(r) {
|
|
316
|
+
const e = r.pivotByColumns.length, u = r.groupByColumns.length, c = Array.from(
|
|
366
317
|
{ length: e + 1 },
|
|
367
318
|
() => []
|
|
368
319
|
);
|
|
369
|
-
for (let
|
|
370
|
-
|
|
371
|
-
if (
|
|
372
|
-
...r.groupByColumns.map((
|
|
373
|
-
),
|
|
374
|
-
for (let
|
|
375
|
-
|
|
376
|
-
|
|
320
|
+
for (let l = 0; l < e; l++)
|
|
321
|
+
c[l].push(...Array(u).fill(""));
|
|
322
|
+
if (c[e].push(
|
|
323
|
+
...r.groupByColumns.map((l) => l.label || l.name)
|
|
324
|
+
), T(r.columnHeadersTree, c, e), r.showRowTotals) {
|
|
325
|
+
for (let l = 0; l < e; l++)
|
|
326
|
+
c[l].push("");
|
|
327
|
+
c[e].push("Total");
|
|
377
328
|
}
|
|
378
|
-
return
|
|
329
|
+
return c;
|
|
379
330
|
}
|
|
380
|
-
function
|
|
331
|
+
function q(r, e, u) {
|
|
381
332
|
if (r == null)
|
|
382
333
|
return "";
|
|
383
334
|
if (!u.useFormattedValues)
|
|
384
335
|
return String(r);
|
|
385
|
-
const
|
|
386
|
-
return typeof r == "number" && (
|
|
336
|
+
const c = u.columnSettings[e];
|
|
337
|
+
return typeof r == "number" && (c == null ? void 0 : c.type) === "number" ? d(
|
|
387
338
|
r,
|
|
388
|
-
|
|
339
|
+
c.numberFormat,
|
|
389
340
|
u.locale
|
|
390
341
|
) : typeof r == "number" ? r.toLocaleString(u.locale) : String(r);
|
|
391
342
|
}
|
|
392
|
-
function
|
|
393
|
-
const
|
|
394
|
-
r.fieldValues.forEach((
|
|
395
|
-
r.isSubtotal &&
|
|
343
|
+
function O(r, e, u) {
|
|
344
|
+
const c = [];
|
|
345
|
+
r.fieldValues.forEach((f, i) => {
|
|
346
|
+
r.isSubtotal && i === 0 ? c.push(`${f} Total`) : r.isSubtotal ? c.push("") : c.push(String(f ?? ""));
|
|
396
347
|
});
|
|
397
|
-
let
|
|
398
|
-
return e.columnHeaders.forEach((
|
|
399
|
-
var
|
|
400
|
-
const
|
|
401
|
-
|
|
402
|
-
}), e.showRowTotals &&
|
|
403
|
-
}
|
|
404
|
-
function
|
|
405
|
-
const
|
|
348
|
+
let l = 0;
|
|
349
|
+
return e.columnHeaders.forEach((f) => {
|
|
350
|
+
var n;
|
|
351
|
+
const i = (n = r.cells[f]) == null ? void 0 : n.value, m = q(i, f, u);
|
|
352
|
+
c.push(m), e.showRowTotals && typeof i == "number" && (l += i);
|
|
353
|
+
}), e.showRowTotals && c.push(l.toLocaleString(u.locale)), c;
|
|
354
|
+
}
|
|
355
|
+
function v(r, e, u) {
|
|
356
|
+
const c = [];
|
|
406
357
|
if (u.includeHeaders) {
|
|
407
|
-
const
|
|
408
|
-
for (const
|
|
409
|
-
|
|
358
|
+
const l = U(e);
|
|
359
|
+
for (const f of l)
|
|
360
|
+
c.push(S(f, u.delimiter));
|
|
410
361
|
}
|
|
411
|
-
for (const
|
|
412
|
-
const
|
|
413
|
-
|
|
362
|
+
for (const l of r) {
|
|
363
|
+
const f = O(
|
|
364
|
+
l,
|
|
414
365
|
e,
|
|
415
366
|
u
|
|
416
367
|
);
|
|
417
|
-
|
|
418
|
-
|
|
368
|
+
c.push(
|
|
369
|
+
f.map((i) => h(i, u.delimiter)).join(u.delimiter)
|
|
419
370
|
);
|
|
420
371
|
}
|
|
421
|
-
return
|
|
372
|
+
return c;
|
|
422
373
|
}
|
|
423
374
|
export {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
G as
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
b as resolveTimezone
|
|
375
|
+
H as arrayToCSV,
|
|
376
|
+
S as arrayToCSVRow,
|
|
377
|
+
h as escapeCSVValue,
|
|
378
|
+
j as formatAggregateRow,
|
|
379
|
+
_ as formatAggregateTableForCSV,
|
|
380
|
+
P as formatCellValue,
|
|
381
|
+
z as formatCurrency,
|
|
382
|
+
I as formatDate,
|
|
383
|
+
$ as formatNumber,
|
|
384
|
+
k as formatNumberCustom,
|
|
385
|
+
d as formatNumberWithColumnSettings,
|
|
386
|
+
B as formatPercent,
|
|
387
|
+
O as formatPivotDataRow,
|
|
388
|
+
v as formatPivotTableForCSV,
|
|
389
|
+
N as formatRelativeTime,
|
|
390
|
+
A as formatRowForExport,
|
|
391
|
+
E as formatScientific,
|
|
392
|
+
C as formatTableForCSV,
|
|
393
|
+
G as generateAggregateHeaders,
|
|
394
|
+
U as generatePivotHeaders,
|
|
395
|
+
X as generateTableCSV,
|
|
396
|
+
Y as getTimezoneAbbreviation,
|
|
397
|
+
Z as getTimezoneName,
|
|
398
|
+
K as objectsToCSV,
|
|
399
|
+
F as parseWithSourceTimezone,
|
|
400
|
+
p as resolveTimezone
|
|
451
401
|
};
|