react-semaphor 0.1.531 → 0.1.533
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/brand-studio/index.js +1 -1
- package/dist/chunks/{dashboard-BHMHze_t.js → dashboard-DUCg1mNJ.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-nHbT_XPG.js → dashboard-briefing-launcher-B0PuQUiR.js} +1401 -1383
- package/dist/chunks/{dashboard-controls-Chv8n1oV.js → dashboard-controls-Cl3fLg9W.js} +39 -39
- package/dist/chunks/{dashboard-json-XgY8U_hG.js → dashboard-json-BSOgXGwr.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-CcxZN7C6.js → edit-dashboard-visual-CQDyMxM7.js} +516 -516
- package/dist/chunks/{editor-action-buttons-CCzvDROJ.js → editor-action-buttons-BKVrZnRQ.js} +2 -2
- package/dist/chunks/{matrix-formatter-DDjECnMd.js → matrix-formatter-DY1y9odV.js} +2 -1
- package/dist/chunks/{pivot-header-presentation-BTOXdU6S.js → pivot-header-presentation-Bb6b3Ch2.js} +232 -210
- package/dist/chunks/{report-preferences-dialog-D2Tz_5WT.js → report-preferences-dialog-WDM7qWxV.js} +16 -16
- package/dist/chunks/{semaphor-ready-indicator-CpbyewzC.js → semaphor-ready-indicator-yZ0JtL4D.js} +36174 -36148
- package/dist/chunks/{slider-p0D5yTI_.js → slider-0mB67Lls.js} +3 -3
- package/dist/chunks/{switch-JmX27lNB.js → switch-D95vek6N.js} +1690 -1683
- package/dist/dashboard/index.js +1 -1
- package/dist/data-app-sdk/index.js +1 -1
- package/dist/format-utils/index.js +90 -89
- package/dist/index.js +120 -119
- package/dist/surfboard/index.js +1 -1
- package/dist/types/components/surfboard/filter/date-range-filter-v2.d.ts +2 -2
- package/dist/types/components/surfboard/filter/types.d.ts +9 -0
- package/dist/types/components/ui-custom/date-range-picker.d.ts +18 -6
- package/dist/types/lib/api/exports-api.d.ts +30 -3
- package/dist/types/lib/csv-download.d.ts +4 -2
- package/dist/types/lib/export-messages.d.ts +47 -0
- package/dist/types/lib/exports/bounded-request.d.ts +12 -0
- package/dist/types/lib/exports/export-status.d.ts +2 -0
- package/dist/types/lib/hooks/use-date-filter.d.ts +3 -3
- package/dist/types/lib/hooks/use-export-polling.d.ts +9 -1
- package/dist/types/lib/matrix-table/submit-matrix-delivery.d.ts +14 -2
- package/dist/types/lib/matrix-table/use-matrix.d.ts +4 -0
- package/dist/types/lib/stores/export-store.d.ts +11 -0
- package/dist/types/lib/temporal-filter/temporal-filter-utils.d.ts +9 -0
- package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +6 -0
- package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +28 -4
- package/package.json +1 -1
package/dist/chunks/{pivot-header-presentation-BTOXdU6S.js → pivot-header-presentation-Bb6b3Ch2.js}
RENAMED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { i as
|
|
5
|
-
import { e as
|
|
6
|
-
import { e as
|
|
7
|
-
import { i as
|
|
8
|
-
import { F as
|
|
1
|
+
var j = Object.defineProperty;
|
|
2
|
+
var z = (e, r, t) => r in e ? j(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
|
+
var M = (e, r, t) => z(e, typeof r != "symbol" ? r + "" : r, t);
|
|
4
|
+
import { i as K } from "./raw-temporal-B0EuwEHr.js";
|
|
5
|
+
import { e as v, i as H } from "./numeric-presentation-D2I9znLM.js";
|
|
6
|
+
import { e as F, m as S, h as V, i as W, j as D } from "./matrix-formatter-DY1y9odV.js";
|
|
7
|
+
import { i as E } from "./pivot-result-lifecycle-BxmATSFJ.js";
|
|
8
|
+
import { F as Y, bh as O, B as T } from "./validators-BS521dum.js";
|
|
9
9
|
import "./matrix-operation-contract-BotZ-6zT.js";
|
|
10
10
|
import "zod";
|
|
11
|
-
import { g as
|
|
12
|
-
import { PDF_SAFETY_LIMIT_EXCEEDED as
|
|
13
|
-
import { f as
|
|
14
|
-
function
|
|
11
|
+
import { g as N } from "./matrix-definition-CiGRzEzt.js";
|
|
12
|
+
import { PDF_SAFETY_LIMIT_EXCEEDED as $, getUtf8ByteLength as q, FAST_PDF_POLICY as J } from "../pdf-export-policy/index.js";
|
|
13
|
+
import { f as Z } from "./temporal-bucket-DlFuhCnT.js";
|
|
14
|
+
function Q(e, r, t) {
|
|
15
15
|
const a = {
|
|
16
16
|
...r,
|
|
17
17
|
locale: r.locale ?? t
|
|
18
18
|
};
|
|
19
19
|
if (a.type === "number")
|
|
20
|
-
return
|
|
20
|
+
return v(e, a);
|
|
21
21
|
const { prefix: o, suffix: n, ...s } = a;
|
|
22
|
-
return `${o ?? ""}${
|
|
22
|
+
return `${o ?? ""}${v(e, {
|
|
23
23
|
...s,
|
|
24
24
|
negativeStyle: a.type === "currency" ? a.negativeStyle : "minus"
|
|
25
25
|
})}${n ?? ""}`;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
return e === null ? { value: e, text: null } : !r || !
|
|
27
|
+
function k(e, r, t) {
|
|
28
|
+
return e === null ? { value: e, text: null } : !r || !K(r) && r.type !== "duration" ? {
|
|
29
29
|
value: e,
|
|
30
|
-
text:
|
|
30
|
+
text: v(e, { type: "number", locale: t })
|
|
31
31
|
} : r.type === "duration" ? {
|
|
32
32
|
value: e,
|
|
33
|
-
text:
|
|
33
|
+
text: H(e, {
|
|
34
34
|
inputUnit: r.inputUnit,
|
|
35
35
|
outputStyle: r.outputStyle,
|
|
36
36
|
largestUnit: r.largestUnit,
|
|
@@ -40,12 +40,12 @@ function E(e, r, t) {
|
|
|
40
40
|
suffix: r.suffix,
|
|
41
41
|
negativeInParentheses: r.negativeStyle === "parentheses"
|
|
42
42
|
})
|
|
43
|
-
} : { value: e, text:
|
|
43
|
+
} : { value: e, text: Q(e, r, t) };
|
|
44
44
|
}
|
|
45
45
|
function I(e, r, t, a) {
|
|
46
46
|
return e === null ? { value: e, text: null } : a === "percent" ? {
|
|
47
47
|
value: e,
|
|
48
|
-
text:
|
|
48
|
+
text: v(e, {
|
|
49
49
|
type: "percent",
|
|
50
50
|
locale: t,
|
|
51
51
|
minimumFractionDigits: r,
|
|
@@ -54,7 +54,7 @@ function I(e, r, t, a) {
|
|
|
54
54
|
})
|
|
55
55
|
} : {
|
|
56
56
|
value: e,
|
|
57
|
-
text:
|
|
57
|
+
text: v(e, {
|
|
58
58
|
type: "number",
|
|
59
59
|
locale: t,
|
|
60
60
|
minimumFractionDigits: r,
|
|
@@ -63,51 +63,51 @@ function I(e, r, t, a) {
|
|
|
63
63
|
})
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function _(e, r) {
|
|
67
67
|
if (e === void 0) return r;
|
|
68
68
|
if (!Number.isInteger(e) || e < 0 || e > 6)
|
|
69
69
|
throw new RangeError("Comparison precision must be an integer from 0 to 6.");
|
|
70
70
|
return e;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function ke(e, r) {
|
|
73
73
|
const t = {
|
|
74
74
|
mode: r.displayMode,
|
|
75
|
-
current:
|
|
75
|
+
current: k(
|
|
76
76
|
e.currentValue,
|
|
77
77
|
r.metricFormat,
|
|
78
78
|
r.locale
|
|
79
79
|
),
|
|
80
|
-
comparison:
|
|
80
|
+
comparison: k(
|
|
81
81
|
e.comparisonValue,
|
|
82
82
|
r.metricFormat,
|
|
83
83
|
r.locale
|
|
84
84
|
)
|
|
85
85
|
};
|
|
86
|
-
return (r.displayMode === "difference" || r.displayMode === "both") && (t.difference =
|
|
86
|
+
return (r.displayMode === "difference" || r.displayMode === "both") && (t.difference = k(
|
|
87
87
|
e.delta,
|
|
88
88
|
r.metricFormat,
|
|
89
89
|
r.locale
|
|
90
90
|
)), (r.displayMode === "percent_change" || r.displayMode === "both") && (t.percentChange = I(
|
|
91
91
|
e.percentChange,
|
|
92
|
-
|
|
92
|
+
_(r.precision, 1),
|
|
93
93
|
r.locale,
|
|
94
94
|
"percent"
|
|
95
95
|
)), r.displayMode === "ratio" && (t.ratio = I(
|
|
96
96
|
e.ratio,
|
|
97
|
-
|
|
97
|
+
_(r.precision, 2),
|
|
98
98
|
r.locale,
|
|
99
99
|
"ratio"
|
|
100
100
|
)), t;
|
|
101
101
|
}
|
|
102
|
-
const
|
|
103
|
-
function
|
|
104
|
-
return e >
|
|
102
|
+
const ee = 1e4, Se = 1e6, Ce = 5e6, Ie = 1024 ** 3, _e = 1024 ** 3;
|
|
103
|
+
function Re(e) {
|
|
104
|
+
return e > ee;
|
|
105
105
|
}
|
|
106
|
-
const
|
|
106
|
+
const Fe = {
|
|
107
107
|
rowLabels: "tabular",
|
|
108
108
|
subtotals: "after"
|
|
109
109
|
};
|
|
110
|
-
function
|
|
110
|
+
function Ve(e, r) {
|
|
111
111
|
const t = r.rowLabels === "outline" ? { kind: "compact" } : e.layout.kind === "tabular" ? e.layout : { kind: "tabular", repeatLabels: !1 }, a = e.totals.rows;
|
|
112
112
|
return {
|
|
113
113
|
...e,
|
|
@@ -126,21 +126,21 @@ function Fe(e, r) {
|
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
|
-
const
|
|
130
|
-
function
|
|
131
|
-
return typeof e == "number" ? Number.isInteger(e) :
|
|
129
|
+
const re = 2;
|
|
130
|
+
function te(e) {
|
|
131
|
+
return typeof e == "number" ? Number.isInteger(e) : O(e) ? !e.value.includes(".") : !0;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function oe(e, r, t) {
|
|
134
134
|
const a = e.descriptors.measures.filter(
|
|
135
|
-
(s) => t.measureFormats[s.id] === void 0 && s.semanticFormat === void 0 &&
|
|
135
|
+
(s) => t.measureFormats[s.id] === void 0 && s.semanticFormat === void 0 && Y(s.column.dataType) === "number"
|
|
136
136
|
);
|
|
137
137
|
if (a.length === 0) return t;
|
|
138
138
|
const o = /* @__PURE__ */ new Set();
|
|
139
|
-
e.columns.forEach((s,
|
|
139
|
+
e.columns.forEach((s, l) => {
|
|
140
140
|
if (!(s.kind !== "measure" || o.has(s.measureId)))
|
|
141
141
|
for (const m of r) {
|
|
142
|
-
const u = m.values[
|
|
143
|
-
if ((u == null ? void 0 : u.kind) === "value" && !
|
|
142
|
+
const u = m.values[l];
|
|
143
|
+
if ((u == null ? void 0 : u.kind) === "value" && !te(u.value)) {
|
|
144
144
|
o.add(s.measureId);
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
@@ -148,34 +148,34 @@ function te(e, r, t) {
|
|
|
148
148
|
});
|
|
149
149
|
const n = { ...t.measureFormats };
|
|
150
150
|
for (const { id: s } of a) {
|
|
151
|
-
const
|
|
151
|
+
const l = o.has(s) ? re : 0;
|
|
152
152
|
n[s] = {
|
|
153
153
|
type: "number",
|
|
154
|
-
minimumFractionDigits:
|
|
155
|
-
maximumFractionDigits:
|
|
154
|
+
minimumFractionDigits: l,
|
|
155
|
+
maximumFractionDigits: l,
|
|
156
156
|
useGrouping: !0
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
return { ...t, measureFormats: n };
|
|
160
160
|
}
|
|
161
161
|
function P(e) {
|
|
162
|
-
return
|
|
162
|
+
return T(e.slice(0, -1));
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
return r.length > e.length &&
|
|
164
|
+
function ae(e, r) {
|
|
165
|
+
return r.length > e.length && T(r.slice(0, e.length)) === T(e);
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function se(e) {
|
|
168
168
|
return e.map((r, t) => {
|
|
169
169
|
if (t === 0 || r.kind !== "layout") return !1;
|
|
170
170
|
const a = e[t - 1];
|
|
171
171
|
if (a.kind !== "layout") return !1;
|
|
172
|
-
if (r.role !== "member" ||
|
|
172
|
+
if (r.role !== "member" || ae(a.rowPath, r.rowPath)) return !0;
|
|
173
173
|
const o = e[t - 2];
|
|
174
174
|
return a.role === "member" && (!o || o.kind !== "layout" || o.role !== "member" || P(o.rowPath) !== P(a.rowPath)) && r.rowPath.length === a.rowPath.length && P(r.rowPath) === P(a.rowPath);
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
|
-
const
|
|
178
|
-
function
|
|
177
|
+
const ne = "pdf-group-continuation";
|
|
178
|
+
function le(e) {
|
|
179
179
|
if (!e.previousRow || e.row.isSubtotal === !0 || e.row.isGrandTotal === !0 || e.previousRow.isSubtotal === !0 || e.previousRow.isGrandTotal === !0)
|
|
180
180
|
return !0;
|
|
181
181
|
for (let r = 0; r <= e.levelIndex; r++)
|
|
@@ -183,94 +183,116 @@ function ne(e) {
|
|
|
183
183
|
return !0;
|
|
184
184
|
return !1;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
|
|
186
|
+
function B(e, r, t) {
|
|
187
|
+
return !(t != null && t.hasTextAffixes) && r.kind === "value" && (typeof r.value == "number" || O(r.value)) ? e : E(e);
|
|
188
|
+
}
|
|
189
|
+
function ie(e, r, t) {
|
|
190
|
+
const a = F(e.descriptors, r.presentation, t), o = e.columns.map((i) => {
|
|
188
191
|
var c;
|
|
189
|
-
return
|
|
190
|
-
}), n = (
|
|
191
|
-
if (
|
|
192
|
-
const c =
|
|
193
|
-
return
|
|
192
|
+
return i.kind === "measure" && ((c = a.measureSemantics.get(i.measureId)) == null ? void 0 : c.isNumeric) === !0;
|
|
193
|
+
}), n = (i) => S([i], a.levels), s = (i, c, f) => V(i, c, r.presentation.totals[f], a.levels), l = e.columns.map((i) => {
|
|
194
|
+
if (i.kind !== "measure") return i.label;
|
|
195
|
+
const c = i.columnPath.map(n);
|
|
196
|
+
return i.role !== "member" && c.push(s(i.columnPath, i.role, "columns")), [...c, i.label].join(" / ");
|
|
194
197
|
}), m = Math.min(r.spec.columns.length, Math.max(
|
|
195
198
|
0,
|
|
196
|
-
...e.columns.map((
|
|
197
|
-
)), u = Array.from({ length: m + 1 }, (
|
|
198
|
-
path:
|
|
199
|
-
role:
|
|
199
|
+
...e.columns.map((i) => i.kind === "measure" ? i.columnPath.length + (i.role !== "member" ? 1 : 0) : 0)
|
|
200
|
+
)), u = Array.from({ length: m + 1 }, (i, c) => e.columns.map((f) => c === m ? f.label : f.kind !== "measure" ? "" : c < f.columnPath.length ? n(f.columnPath[c]) : c === f.columnPath.length && f.role !== "member" ? s(f.columnPath, f.role, "columns") : "")), g = (i, c) => W({
|
|
201
|
+
path: i.rowPath,
|
|
202
|
+
role: i.kind === "layout" ? i.role : "member",
|
|
200
203
|
levelCount: Math.max(1, r.spec.rows.length),
|
|
201
204
|
repeatLabels: r.presentation.layout.kind !== "tabular" || r.presentation.layout.repeatLabels,
|
|
202
205
|
previousPath: c == null ? void 0 : c.rowPath
|
|
203
|
-
}), d = (
|
|
204
|
-
if (
|
|
205
|
-
if (
|
|
206
|
-
const f = g(
|
|
207
|
-
return e.columns.map((
|
|
208
|
-
if (
|
|
209
|
-
return `${" ".repeat(Math.max(0,
|
|
210
|
-
if (
|
|
211
|
-
const
|
|
212
|
-
return
|
|
206
|
+
}), d = (i, c) => {
|
|
207
|
+
if (i.kind !== "layout") throw new Error("Layout presentation requires layout rows.");
|
|
208
|
+
if (i.values.length !== e.columns.length) throw new Error("Matrix row does not match its frozen layout.");
|
|
209
|
+
const f = g(i, c);
|
|
210
|
+
return e.columns.map((h, p) => {
|
|
211
|
+
if (h.kind === "hierarchy")
|
|
212
|
+
return `${" ".repeat(Math.max(0, i.rowPath.length - 1))}${s(i.rowPath, i.role, "rows")}`;
|
|
213
|
+
if (h.kind === "level") {
|
|
214
|
+
const L = r.spec.rows.findIndex((X) => X.id === h.levelId), b = f[L];
|
|
215
|
+
return b != null && b.visible ? b.total ? s(i.rowPath, i.role, "rows") : S(b.path, a.levels) : "";
|
|
213
216
|
}
|
|
214
|
-
const
|
|
215
|
-
if (
|
|
217
|
+
const x = i.values[p], y = a.measures.get(h.measureId);
|
|
218
|
+
if (x.kind === "value" && !y)
|
|
216
219
|
throw new Error("Matrix value is missing its measure descriptor.");
|
|
217
|
-
return
|
|
220
|
+
return D(x, y, r.presentation.absence);
|
|
218
221
|
});
|
|
219
|
-
},
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
return b.kind === "measure" && !((y = a.measureSemantics.get(b.measureId)) != null && y.hasTextAffixes) && h.kind === "value" && (typeof h.value == "number" || C(h.value)) ? f : S(f);
|
|
222
|
+
}, w = (i, c) => d(i, c).map((f, h) => {
|
|
223
|
+
const p = e.columns[h];
|
|
224
|
+
return p.kind === "measure" ? B(f, i.values[h], a.measureSemantics.get(p.measureId)) : E(f);
|
|
223
225
|
});
|
|
224
226
|
return {
|
|
225
|
-
headers:
|
|
227
|
+
headers: l,
|
|
226
228
|
headerBands: u,
|
|
227
229
|
numericColumns: o,
|
|
228
230
|
/** A row's cells; after `previous`, a tabular layout prints each label once. */
|
|
229
|
-
row: (
|
|
231
|
+
row: (i, c) => d(i, c),
|
|
230
232
|
/**
|
|
231
233
|
* Level columns whose group label the row above shows, so this row
|
|
232
234
|
* continues the group (Plan 2, 2d, C8). Only a member row after a member
|
|
233
235
|
* row continues one: a total prints as a band, and its rules stay whole
|
|
234
236
|
* above and below it.
|
|
235
237
|
*/
|
|
236
|
-
continuedColumns: (
|
|
237
|
-
const f = (
|
|
238
|
-
if (!f(
|
|
239
|
-
const
|
|
240
|
-
return e.columns.flatMap((
|
|
241
|
-
var
|
|
242
|
-
if (
|
|
243
|
-
const
|
|
244
|
-
return
|
|
238
|
+
continuedColumns: (i, c) => {
|
|
239
|
+
const f = (p) => (p == null ? void 0 : p.kind) === "layout" && p.role === "member";
|
|
240
|
+
if (!f(i) || !f(c)) return [];
|
|
241
|
+
const h = g(i, c);
|
|
242
|
+
return e.columns.flatMap((p, x) => {
|
|
243
|
+
var L;
|
|
244
|
+
if (p.kind !== "level") return [];
|
|
245
|
+
const y = r.spec.rows.findIndex((b) => b.id === p.levelId);
|
|
246
|
+
return y < i.rowPath.length && ((L = h[y]) == null ? void 0 : L.visible) === !1 ? [x] : [];
|
|
245
247
|
});
|
|
246
248
|
},
|
|
247
|
-
csvRow: (
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
csvRow: (i) => w(i),
|
|
250
|
+
/**
|
|
251
|
+
* `previousRow` is the row before `data[0]`, carried by the export's
|
|
252
|
+
* continuation, so a tabular layout prints each label once across the
|
|
253
|
+
* whole file. Retries are pure: suppression never relies on mutable
|
|
254
|
+
* formatter state or an earlier worker. Without it, the first row prints
|
|
255
|
+
* its labels.
|
|
256
|
+
*/
|
|
257
|
+
csvRows: (i, c) => i.map((f, h) => w(f, h ? i[h - 1] : c ?? void 0))
|
|
251
258
|
};
|
|
252
259
|
}
|
|
253
|
-
function Ve(e) {
|
|
254
|
-
return e.columns.map((r) => S(r.label));
|
|
255
|
-
}
|
|
256
260
|
function De(e) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
261
|
+
return e.columns.map((r) => E(r.label));
|
|
262
|
+
}
|
|
263
|
+
function Oe(e, r, t) {
|
|
264
|
+
if (e.kind !== "flat") throw new Error("Flat Matrix CSV requires flat rows.");
|
|
265
|
+
if (e.values.length !== r.columns.length) throw new Error("Matrix row does not match its frozen layout.");
|
|
266
|
+
const a = [...e.rowPath, ...e.columnPath];
|
|
267
|
+
return r.columns.map((o, n) => {
|
|
268
|
+
if (o.kind === "measure") {
|
|
269
|
+
const l = e.values[n], m = t.measures.get(o.measureId);
|
|
270
|
+
if (l.kind === "value" && !m) throw new Error("Matrix value is missing its measure descriptor.");
|
|
271
|
+
return B(
|
|
272
|
+
D(l, m, t.absence),
|
|
273
|
+
l,
|
|
274
|
+
t.measureSemantics.get(o.measureId)
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
const s = o.kind === "level" ? a.find((l) => l.levelId === o.levelId) : void 0;
|
|
278
|
+
if (!s) throw new Error("Flat Matrix row does not match its frozen layout.");
|
|
279
|
+
return E(S([s], t.levels));
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
function ue(e) {
|
|
283
|
+
const r = ie(e.layout, e.request, e.report), t = e.layout.columns.map((s, l) => ({
|
|
284
|
+
index: l,
|
|
285
|
+
columnId: `matrix:${l}`,
|
|
286
|
+
label: r.headers[l],
|
|
287
|
+
isNumeric: r.numericColumns[l]
|
|
288
|
+
})), a = (s, l, m) => ({
|
|
267
289
|
text: s,
|
|
268
290
|
colspan: 1,
|
|
269
291
|
rowspan: 1,
|
|
270
|
-
columnId: t[
|
|
292
|
+
columnId: t[l].columnId,
|
|
271
293
|
isHeader: m,
|
|
272
|
-
isNumeric: t[
|
|
273
|
-
className: t[
|
|
294
|
+
isNumeric: t[l].isNumeric,
|
|
295
|
+
className: t[l].isNumeric ? "numeric" : e.layout.columns[l].kind === "hierarchy" ? "matrix-hierarchy" : ""
|
|
274
296
|
}), o = [], n = e.layout.columns.findIndex((s) => s.kind === "measure");
|
|
275
297
|
e.request.spec.columns.length && n >= 0 && o.push({
|
|
276
298
|
repeatHeader: !0,
|
|
@@ -279,31 +301,31 @@ function ie(e) {
|
|
|
279
301
|
cells: [
|
|
280
302
|
...n ? [{ ...a("", 0, !0), colspan: n }] : [],
|
|
281
303
|
{
|
|
282
|
-
...a(e.request.spec.columns.map((s) =>
|
|
304
|
+
...a(e.request.spec.columns.map((s) => N(s, e.request.presentation)).join(" / "), n, !0),
|
|
283
305
|
colspan: e.layout.columns.length - n,
|
|
284
306
|
isNumeric: !1,
|
|
285
307
|
className: ""
|
|
286
308
|
}
|
|
287
309
|
]
|
|
288
310
|
});
|
|
289
|
-
for (const [s,
|
|
311
|
+
for (const [s, l] of r.headerBands.entries())
|
|
290
312
|
o.push({
|
|
291
313
|
repeatHeader: !0,
|
|
292
314
|
headerType: s === r.headerBands.length - 1 ? "metrics" : "pivot-level",
|
|
293
315
|
headerRowIndex: o.length,
|
|
294
|
-
cells:
|
|
316
|
+
cells: l.map((m, u) => a(m, u, !0))
|
|
295
317
|
});
|
|
296
318
|
return {
|
|
297
319
|
headers: o,
|
|
298
|
-
rows: e.rows.map((s,
|
|
299
|
-
const m = new Set(r.continuedColumns(s, e.rows[
|
|
320
|
+
rows: e.rows.map((s, l) => {
|
|
321
|
+
const m = new Set(r.continuedColumns(s, e.rows[l - 1]));
|
|
300
322
|
return {
|
|
301
|
-
index:
|
|
323
|
+
index: l,
|
|
302
324
|
type: s.kind === "layout" && s.role !== "member" ? "subtotal" : "data",
|
|
303
325
|
subtotalLevel: String(s.rowPath.length),
|
|
304
326
|
// A tabular layout prints each label once unless it repeats them; the
|
|
305
327
|
// blank cell continues its group, so a grid draws no rule above it.
|
|
306
|
-
cells: r.row(s, e.rows[
|
|
328
|
+
cells: r.row(s, e.rows[l - 1]).map((u, g) => m.has(g) ? { ...a(u, g, !1), className: ne } : a(u, g, !1))
|
|
307
329
|
};
|
|
308
330
|
}),
|
|
309
331
|
grandTotal: null,
|
|
@@ -320,38 +342,38 @@ function ie(e) {
|
|
|
320
342
|
}
|
|
321
343
|
};
|
|
322
344
|
}
|
|
323
|
-
function
|
|
324
|
-
const { levels: a } =
|
|
345
|
+
function ce(e, r, t) {
|
|
346
|
+
const { levels: a } = F(e.descriptors, r.presentation, t), o = r.spec.columns.length > 0, n = [], s = [], l = e.columns.map((u, g) => {
|
|
325
347
|
if (u.kind !== "measure") return null;
|
|
326
|
-
const d = o ? `${u.role}:${
|
|
327
|
-
let
|
|
328
|
-
return
|
|
348
|
+
const d = o ? `${u.role}:${T(u.columnPath)}` : `measure:${g}`;
|
|
349
|
+
let w = n.indexOf(d);
|
|
350
|
+
return w < 0 && (w = n.push(d) - 1, s.push(o ? V(u.columnPath, u.role, r.presentation.totals.columns, a) : u.label)), w;
|
|
329
351
|
}), m = r.spec.columns[r.spec.columns.length - 1];
|
|
330
352
|
return {
|
|
331
|
-
columnGroups:
|
|
353
|
+
columnGroups: l,
|
|
332
354
|
groupLabels: s,
|
|
333
355
|
/** What bands name their groups by: the innermost column level, or "Measures". */
|
|
334
|
-
groupLevelLabel: m ?
|
|
356
|
+
groupLevelLabel: m ? N(m, r.presentation) : "Measures"
|
|
335
357
|
};
|
|
336
358
|
}
|
|
337
|
-
function
|
|
359
|
+
function Ne(e) {
|
|
338
360
|
const { layout: r, rows: t, report: a } = e, o = {
|
|
339
361
|
...e.request,
|
|
340
|
-
presentation:
|
|
341
|
-
}, n =
|
|
362
|
+
presentation: oe(r, t, e.request.presentation)
|
|
363
|
+
}, n = ue({ layout: r, rows: t, request: o, report: a }), s = se(t), l = ce(r, o, a), m = {
|
|
342
364
|
...n,
|
|
343
365
|
rows: n.rows.map((u, g) => ({ ...u, keepWithPrevious: s[g] })),
|
|
344
|
-
metadata: { ...n.metadata, ...
|
|
366
|
+
metadata: { ...n.metadata, ...l }
|
|
345
367
|
};
|
|
346
|
-
return { request: o, table: m, ...
|
|
368
|
+
return { request: o, table: m, ...l };
|
|
347
369
|
}
|
|
348
|
-
class
|
|
370
|
+
class me extends Error {
|
|
349
371
|
constructor() {
|
|
350
372
|
super(...arguments);
|
|
351
|
-
|
|
373
|
+
M(this, "code", $);
|
|
352
374
|
}
|
|
353
375
|
}
|
|
354
|
-
function
|
|
376
|
+
function R(e) {
|
|
355
377
|
if (!e || typeof e != "object")
|
|
356
378
|
return;
|
|
357
379
|
const { error: r, message: t, detail: a } = e;
|
|
@@ -359,12 +381,12 @@ function F(e) {
|
|
|
359
381
|
if (typeof o == "string" && o.trim())
|
|
360
382
|
return o.trim();
|
|
361
383
|
}
|
|
362
|
-
async function
|
|
384
|
+
async function fe(e) {
|
|
363
385
|
const r = `PDF request failed: ${e.status} ${e.statusText}`.trim(), t = e.headers.get("content-type") || "";
|
|
364
386
|
try {
|
|
365
387
|
if (t.includes("application/json")) {
|
|
366
388
|
const o = await e.json(), n = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
|
|
367
|
-
return { message:
|
|
389
|
+
return { message: R(o) || r, code: n };
|
|
368
390
|
}
|
|
369
391
|
const a = await e.text();
|
|
370
392
|
if (!a.trim())
|
|
@@ -372,7 +394,7 @@ async function me(e) {
|
|
|
372
394
|
try {
|
|
373
395
|
const o = JSON.parse(a), n = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
|
|
374
396
|
return {
|
|
375
|
-
message:
|
|
397
|
+
message: R(o) || a.trim(),
|
|
376
398
|
code: n
|
|
377
399
|
};
|
|
378
400
|
} catch {
|
|
@@ -382,9 +404,9 @@ async function me(e) {
|
|
|
382
404
|
return { message: r };
|
|
383
405
|
}
|
|
384
406
|
}
|
|
385
|
-
async function
|
|
407
|
+
async function $e(e) {
|
|
386
408
|
if (!e.token) throw new Error("Missing auth token for PDF export");
|
|
387
|
-
if (
|
|
409
|
+
if (q(e.serializedPayload) > J.maxRequestBytes)
|
|
388
410
|
throw new Error("Fast-path PDF request exceeds the structured body limit");
|
|
389
411
|
const r = await (e.fetchImpl ?? fetch)(e.url, {
|
|
390
412
|
method: "POST",
|
|
@@ -393,8 +415,8 @@ async function Ne(e) {
|
|
|
393
415
|
signal: e.signal
|
|
394
416
|
});
|
|
395
417
|
if (!r.ok) {
|
|
396
|
-
const a = await
|
|
397
|
-
throw a.code ===
|
|
418
|
+
const a = await fe(r);
|
|
419
|
+
throw a.code === $ ? new me(a.message) : new Error(a.message);
|
|
398
420
|
}
|
|
399
421
|
const t = await r.json();
|
|
400
422
|
if (t != null && t.error) throw new Error(t.error);
|
|
@@ -402,25 +424,25 @@ async function Ne(e) {
|
|
|
402
424
|
throw new Error("Fast-path PDF response missing download URL");
|
|
403
425
|
return t;
|
|
404
426
|
}
|
|
405
|
-
const
|
|
406
|
-
function
|
|
427
|
+
const ge = "__TOTAL__";
|
|
428
|
+
function A(e) {
|
|
407
429
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
408
430
|
}
|
|
409
|
-
function
|
|
410
|
-
return e ===
|
|
431
|
+
function C(e) {
|
|
432
|
+
return e === ge;
|
|
411
433
|
}
|
|
412
|
-
function
|
|
434
|
+
function Be(e) {
|
|
413
435
|
const r = /* @__PURE__ */ new Map(), t = (e.groupByColumns ?? []).map((o, n) => {
|
|
414
436
|
var u, g, d;
|
|
415
|
-
if (!
|
|
437
|
+
if (!A(o))
|
|
416
438
|
throw new Error(`Aggregate groupByColumns[${n}] is invalid`);
|
|
417
|
-
const s = typeof o.id == "string" && o.id.length > 0 ? o.id : void 0,
|
|
439
|
+
const s = typeof o.id == "string" && o.id.length > 0 ? o.id : void 0, l = s ? (d = (g = (u = e.columnKeyMap) == null ? void 0 : u.byRole) == null ? void 0 : g.groupby) == null ? void 0 : d[s] : void 0, m = (l == null ? void 0 : l.outputKey) || (l == null ? void 0 : l.rawKey) || (typeof o.alias == "string" && o.alias.length > 0 ? o.alias : typeof o.name == "string" && o.name.length > 0 ? o.name : void 0);
|
|
418
440
|
if (!m)
|
|
419
441
|
throw new Error(`Aggregate groupByColumns[${n}] has no output key`);
|
|
420
|
-
return [s, o.alias, o.name, m].forEach((
|
|
421
|
-
typeof
|
|
442
|
+
return [s, o.alias, o.name, m].forEach((w) => {
|
|
443
|
+
typeof w == "string" && w.length > 0 && r.set(w, m);
|
|
422
444
|
}), m;
|
|
423
|
-
}), a = (e.rowAggregates ?? []).flatMap((o) => !
|
|
445
|
+
}), a = (e.rowAggregates ?? []).flatMap((o) => !A(o) || typeof o.function != "string" || typeof o.groupLevel != "string" ? [] : [
|
|
424
446
|
{
|
|
425
447
|
function: o.function,
|
|
426
448
|
groupLevel: o.groupLevel === "ALL" ? "ALL" : r.get(o.groupLevel) || o.groupLevel,
|
|
@@ -429,14 +451,14 @@ function $e(e) {
|
|
|
429
451
|
]);
|
|
430
452
|
return { groupColumnKeys: t, rowAggregates: a };
|
|
431
453
|
}
|
|
432
|
-
function
|
|
454
|
+
function G(e) {
|
|
433
455
|
return e === "SUM" ? "Total" : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
|
|
434
456
|
}
|
|
435
|
-
function
|
|
457
|
+
function de(e) {
|
|
436
458
|
var t;
|
|
437
459
|
if (e.customLabel) return e.customLabel;
|
|
438
|
-
const r =
|
|
439
|
-
if (e.levelValue !== void 0 && !
|
|
460
|
+
const r = G(e.aggregateFunction);
|
|
461
|
+
if (e.levelValue !== void 0 && !C(e.levelValue)) {
|
|
440
462
|
if (e.levelValue === null) {
|
|
441
463
|
const o = (t = e.formatValue) == null ? void 0 : t.call(e, null);
|
|
442
464
|
return o ? `Subtotal ${o}` : `Subtotal ${r}`;
|
|
@@ -446,23 +468,23 @@ function ge(e) {
|
|
|
446
468
|
}
|
|
447
469
|
return `Subtotal ${r}`;
|
|
448
470
|
}
|
|
449
|
-
function
|
|
450
|
-
return r || `Grand ${
|
|
471
|
+
function he(e, r) {
|
|
472
|
+
return r || `Grand ${G(e)}`;
|
|
451
473
|
}
|
|
452
|
-
function
|
|
474
|
+
function Ge(e) {
|
|
453
475
|
const r = e.context.groupColumnKeys.indexOf(e.columnKey);
|
|
454
476
|
if (r < 0)
|
|
455
477
|
throw new Error(
|
|
456
478
|
`Aggregate group column "${e.columnKey}" is unknown`
|
|
457
479
|
);
|
|
458
|
-
return
|
|
480
|
+
return le({
|
|
459
481
|
row: e.row,
|
|
460
482
|
previousRow: e.previousRow,
|
|
461
483
|
levelIndex: r,
|
|
462
484
|
getValue: (t, a) => t[e.context.groupColumnKeys[a]]
|
|
463
485
|
});
|
|
464
486
|
}
|
|
465
|
-
function
|
|
487
|
+
function U(e) {
|
|
466
488
|
var a, o;
|
|
467
489
|
const r = e.context.groupColumnKeys, t = typeof e.row.aggregate == "string" ? e.row.aggregate : "SUM";
|
|
468
490
|
if (e.row.isGrandTotal === !0) {
|
|
@@ -471,11 +493,11 @@ function B(e) {
|
|
|
471
493
|
)) == null ? void 0 : a.label;
|
|
472
494
|
return {
|
|
473
495
|
kind: "grand-total",
|
|
474
|
-
cells: r.map((s,
|
|
496
|
+
cells: r.map((s, l) => ({
|
|
475
497
|
columnKey: s,
|
|
476
|
-
text:
|
|
477
|
-
placement:
|
|
478
|
-
colSpan:
|
|
498
|
+
text: l === 0 ? he(t, n) : "",
|
|
499
|
+
placement: l === 0 ? "label" : "empty",
|
|
500
|
+
colSpan: l === 0 ? r.length : 1
|
|
479
501
|
}))
|
|
480
502
|
};
|
|
481
503
|
}
|
|
@@ -487,7 +509,7 @@ function B(e) {
|
|
|
487
509
|
throw new Error(
|
|
488
510
|
`Aggregate subtotal level "${e.row.subtotalLevel}" has no group column`
|
|
489
511
|
);
|
|
490
|
-
const s =
|
|
512
|
+
const s = A(e.row.subtotalContext) ? e.row.subtotalContext : void 0, l = A(s == null ? void 0 : s.groupByValues) ? s.groupByValues : {}, m = (o = e.context.rowAggregates.find(
|
|
491
513
|
(u) => u.groupLevel === e.row.subtotalLevel && u.function === t
|
|
492
514
|
)) == null ? void 0 : o.label;
|
|
493
515
|
return {
|
|
@@ -504,17 +526,17 @@ function B(e) {
|
|
|
504
526
|
const d = e.row[u];
|
|
505
527
|
return {
|
|
506
528
|
columnKey: u,
|
|
507
|
-
text: d === void 0 ||
|
|
529
|
+
text: d === void 0 || C(d) ? "" : e.formatValue(d, u),
|
|
508
530
|
placement: "value",
|
|
509
531
|
colSpan: 1
|
|
510
532
|
};
|
|
511
533
|
}
|
|
512
534
|
return {
|
|
513
535
|
columnKey: u,
|
|
514
|
-
text:
|
|
536
|
+
text: de({
|
|
515
537
|
aggregateFunction: t,
|
|
516
538
|
customLabel: m,
|
|
517
|
-
levelValue:
|
|
539
|
+
levelValue: l[u],
|
|
518
540
|
formatValue: (d) => e.formatLabelValue ? e.formatLabelValue(d, u) : String(e.formatValue(d, u) ?? "")
|
|
519
541
|
}),
|
|
520
542
|
placement: "label",
|
|
@@ -529,44 +551,44 @@ function B(e) {
|
|
|
529
551
|
const s = e.row[n];
|
|
530
552
|
return {
|
|
531
553
|
columnKey: n,
|
|
532
|
-
text: s === void 0 ||
|
|
554
|
+
text: s === void 0 || C(s) ? "" : e.formatValue(s, n),
|
|
533
555
|
placement: "value",
|
|
534
556
|
colSpan: 1
|
|
535
557
|
};
|
|
536
558
|
})
|
|
537
559
|
};
|
|
538
560
|
}
|
|
539
|
-
function
|
|
540
|
-
const r =
|
|
561
|
+
function Ue(e) {
|
|
562
|
+
const r = U(e).cells.find(
|
|
541
563
|
(t) => t.columnKey === e.columnKey
|
|
542
564
|
);
|
|
543
565
|
if (!r)
|
|
544
566
|
throw new Error(`Aggregate group column "${e.columnKey}" is unknown`);
|
|
545
567
|
return r.text;
|
|
546
568
|
}
|
|
547
|
-
function
|
|
548
|
-
return
|
|
569
|
+
function Xe(e) {
|
|
570
|
+
return U(e).cells.map((r) => r.text);
|
|
549
571
|
}
|
|
550
|
-
class
|
|
572
|
+
class pe extends Error {
|
|
551
573
|
constructor(t, a) {
|
|
552
574
|
super(`${t}: ${a}`);
|
|
553
|
-
|
|
575
|
+
M(this, "deliveryBlocking", !0);
|
|
554
576
|
this.code = t, this.name = "PivotHeaderPresentationError";
|
|
555
577
|
}
|
|
556
578
|
}
|
|
557
|
-
function
|
|
579
|
+
function je(e) {
|
|
558
580
|
var o;
|
|
559
581
|
const r = e.mode ?? "formatted", t = e.members.map((n) => {
|
|
560
|
-
var
|
|
582
|
+
var l;
|
|
561
583
|
if (r === "canonical" || !n.temporalBucket)
|
|
562
584
|
return n.value === null ? "" : String(n.value);
|
|
563
|
-
const s = (
|
|
585
|
+
const s = (l = e.resolveTemporalFormat) == null ? void 0 : l.call(e, n.fieldId);
|
|
564
586
|
if (!s)
|
|
565
|
-
throw new
|
|
587
|
+
throw new pe(
|
|
566
588
|
"missing_resolved_temporal_format",
|
|
567
589
|
`Missing resolved temporal presentation for pivot field "${n.fieldId}"`
|
|
568
590
|
);
|
|
569
|
-
return
|
|
591
|
+
return Z({
|
|
570
592
|
value: n.value,
|
|
571
593
|
metadata: n.temporalBucket,
|
|
572
594
|
format: s
|
|
@@ -582,37 +604,37 @@ function Xe(e) {
|
|
|
582
604
|
};
|
|
583
605
|
}
|
|
584
606
|
export {
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
607
|
+
ge as A,
|
|
608
|
+
je as B,
|
|
609
|
+
le as C,
|
|
610
|
+
ee as D,
|
|
611
|
+
Se as F,
|
|
612
|
+
Ce as M,
|
|
613
|
+
ne as P,
|
|
614
|
+
Ie as a,
|
|
593
615
|
_e as b,
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
616
|
+
Oe as c,
|
|
617
|
+
ue as d,
|
|
618
|
+
Ne as e,
|
|
619
|
+
ke as f,
|
|
620
|
+
Fe as g,
|
|
621
|
+
Ve as h,
|
|
622
|
+
re as i,
|
|
623
|
+
oe as j,
|
|
624
|
+
se as k,
|
|
625
|
+
me as l,
|
|
626
|
+
De as m,
|
|
627
|
+
fe as n,
|
|
628
|
+
$e as o,
|
|
629
|
+
ie as p,
|
|
630
|
+
C as q,
|
|
631
|
+
Re as r,
|
|
632
|
+
Be as s,
|
|
633
|
+
de as t,
|
|
634
|
+
he as u,
|
|
635
|
+
Ge as v,
|
|
636
|
+
U as w,
|
|
637
|
+
Ue as x,
|
|
638
|
+
Xe as y,
|
|
639
|
+
pe as z
|
|
618
640
|
};
|