react-semaphor 0.1.598 → 0.1.600
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/analytics-protocol/index.js +336 -333
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +5 -5
- package/dist/brand-studio/index.js +8 -8
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/{add-to-dashboard-C86FsM8D.js → add-to-dashboard-ClhEIFst.js} +1 -1
- package/dist/chunks/{analytics-base-schemas-8wz9vqn_.js → analytics-base-schemas-DevrgqQb.js} +67 -60
- package/dist/chunks/{assistant-chat-DrI442Ld.js → assistant-chat-BULOkG9j.js} +88 -89
- package/dist/chunks/{bookmark-impact-C6uWtNWF.js → bookmark-impact-kdvXke8n.js} +3 -3
- package/dist/chunks/{bookmark-state-BfeKmj5s.js → bookmark-state-h1OLXVjE.js} +153 -153
- package/dist/chunks/{card-filter-builder-CSKCSpNo.js → card-filter-builder-CSCdSQQy.js} +1035 -1063
- package/dist/chunks/{comparison-window-caption-3bum5j00.js → comparison-window-caption-DJDwP9XO.js} +6 -6
- package/dist/chunks/{context-CVXTFljo.js → context-BJoEFgNl.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-C2AuKs10.js → dashboard-briefing-launcher-9YwUclHA.js} +255 -255
- package/dist/chunks/{dashboard-controls-BSbhyIkY.js → dashboard-controls-O6PNXMCp.js} +85 -85
- package/dist/chunks/{dashboard-json-Bd1rxD3y.js → dashboard-json-Bxf91TYq.js} +5 -5
- package/dist/chunks/{dashboard-PYd63LbL.js → dashboard-y9ON19ge.js} +1 -1
- package/dist/chunks/dates-DPTbpNxK.js +164 -0
- package/dist/chunks/{edit-dashboard-visual-D_0ZiWev.js → edit-dashboard-visual-CKwaW8H_.js} +5489 -5435
- package/dist/chunks/{filter-line-BdLyPYjH.js → filter-line-Dkg3yuOX.js} +6 -6
- package/dist/chunks/{filter-reach-copy-Dxn-mTuG.js → filter-reach-copy-ClzNcNhP.js} +1740 -1643
- package/dist/chunks/{filter-value-text-C6g-nDUW.js → filter-value-text-CXyuLW9Q.js} +4 -4
- package/dist/chunks/{index-BHSDE54O.js → index-CRo5--Y6.js} +7 -7
- package/dist/chunks/{layout-grid-CYR-LVpl.js → layout-grid-DSrBSfPM.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-C0IGLTZH.js → matrix-analytical-definition-i9PQY066.js} +443 -394
- package/dist/chunks/{matrix-member-presentation-D5BIYuy5.js → matrix-member-presentation-B_2beBc0.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-RckfqkQm.js → matrix-operation-contract-DdK0J_KU.js} +36 -36
- package/dist/chunks/{metric-comparison-DsE8wdRh.js → metric-comparison-Bhz0V841.js} +2 -2
- package/dist/chunks/{paintbrush-xDDRjIyF.js → paintbrush-1UiU-uTz.js} +1 -1
- package/dist/chunks/{palette-CbOgFCy2.js → palette-DFIFf_-m.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-Cnq55Uno.js → pivot-result-contract-expectations-Dk7WFR_u.js} +8 -8
- package/dist/chunks/{pivot-result-identity-b4-ugQhm.js → pivot-result-identity-CzzrJpEm.js} +1 -1
- package/dist/chunks/{raw-temporal-value-B9W38mi3.js → raw-temporal-value-BLvdaMng.js} +2 -2
- package/dist/chunks/{report-preferences-dialog-DTu3a7ce.js → report-preferences-dialog-DiDsYpng.js} +14 -14
- package/dist/chunks/{report-runtime-context-BvJkcbar.js → report-runtime-context-CEGluufW.js} +2 -2
- package/dist/chunks/{resolve-dashboard-input-context-Bw-DesV2.js → resolve-dashboard-input-context-BAv33KGg.js} +11811 -11331
- package/dist/chunks/{save-BgvAsp6X.js → save-CWQ02kHo.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-BFh0oOnF.js → saved-dashboard-context-CvzYqADe.js} +97 -97
- package/dist/chunks/{selection-filter-compiler-DHYsq3yM.js → selection-filter-compiler-SwrBvyyJ.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-WvgHMnj8.js → semaphor-ready-indicator-1PRI9Yh2.js} +59336 -58569
- package/dist/chunks/{shelf-drop-preview-context-D6HgYFJp.js → shelf-drop-preview-context-BLk5Nc6K.js} +6 -6
- package/dist/chunks/{stored-dashboard-vlG0Knxi.js → stored-dashboard-xhYYKBsO.js} +1200 -1183
- package/dist/chunks/{style-sheet-parts-ClmvtkSC.js → style-sheet-parts-BX7d7-2-.js} +198 -198
- package/dist/chunks/{table-export-sheet-Bv6tVuMu.js → table-export-sheet-BWSVTclx.js} +1 -1
- package/dist/chunks/{token-types-eMdcuB6j.js → token-types-CnlEiAdS.js} +1 -1
- package/dist/chunks/{upload-ClUeK8F0.js → upload-DsqUSS8l.js} +1 -1
- package/dist/chunks/{validators-DwhBEvnh.js → validators-D2Hm57lJ.js} +23 -13
- package/dist/chunks/{variable-draft-CauoSBN0.js → variable-draft-DcKj8T1b.js} +4 -4
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +2497 -2549
- package/dist/format-utils/index.js +14 -14
- package/dist/index.js +48 -48
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/surfboard/filter/types.d.ts +13 -1
- package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +0 -2
- package/dist/types/components/visual/data-table/types/data-table.d.ts +14 -21
- package/dist/types/index.js +5 -5
- package/dist/types/lib/dashboard-view-state/card-view-state.d.ts +11 -1
- package/dist/types/lib/dashboard-view-state/drill-path.d.ts +7 -0
- package/dist/types/lib/dashboard-viewer/table-view.d.ts +20 -0
- package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +8 -0
- package/dist/types/lib/matrix-table/matrix-runtime.d.ts +1 -0
- package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +2 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +3 -1
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +64 -0
- package/dist/types/shared/analytics-protocol/catalog-source-address.d.ts +16 -0
- package/dist/types/shared/analytics-protocol/column-filter-id.d.ts +4 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +26 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +12 -1
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +8 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +3 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +29 -1
- package/dist/types/shared/usage-events/attribution.d.ts +2 -2
- package/dist/types/shared/usage-events/envelope.d.ts +2 -2
- package/dist/usage-events/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/aggregate-measure-field-DtKcEjG5.js +0 -22
- package/dist/chunks/dates-DHMCf-F7.js +0 -115
- package/dist/chunks/list-filter-B67GsjTw.js +0 -15
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a7 as Y, f as Pe, r as Le, k as qe } from "./validators-
|
|
1
|
+
import { a7 as Y, f as Pe, r as Le, k as qe } from "./validators-D2Hm57lJ.js";
|
|
2
2
|
import { z as l } from "zod";
|
|
3
|
-
import { Q as B,
|
|
4
|
-
import { D as Ue, C as ze, a as j, r as We, e as Qe } from "./metric-comparison-
|
|
5
|
-
import "./analytics-base-schemas-
|
|
3
|
+
import { Q as B, E as Be, q as je } from "./matrix-operation-contract-DdK0J_KU.js";
|
|
4
|
+
import { D as Ue, C as ze, a as j, r as We, e as Qe } from "./metric-comparison-Bhz0V841.js";
|
|
5
|
+
import "./analytics-base-schemas-DevrgqQb.js";
|
|
6
6
|
import { a as N } from "./applied-constraints-DU-wndZ7.js";
|
|
7
|
-
import { r as Ge } from "./pivot-result-identity-
|
|
7
|
+
import { r as Ge } from "./pivot-result-identity-CzzrJpEm.js";
|
|
8
8
|
const re = 8, se = 6, V = Object.freeze([]);
|
|
9
9
|
function Ye(e) {
|
|
10
10
|
switch (e.type) {
|
|
@@ -1183,121 +1183,7 @@ const Jn = {
|
|
|
1183
1183
|
database: null,
|
|
1184
1184
|
schema: null,
|
|
1185
1185
|
table: null
|
|
1186
|
-
}, Hn = "__card_default__",
|
|
1187
|
-
date: /* @__PURE__ */ new Set([
|
|
1188
|
-
"between",
|
|
1189
|
-
"not between",
|
|
1190
|
-
"=",
|
|
1191
|
-
"!=",
|
|
1192
|
-
">",
|
|
1193
|
-
">=",
|
|
1194
|
-
"<",
|
|
1195
|
-
"<=",
|
|
1196
|
-
"is null",
|
|
1197
|
-
"is not null"
|
|
1198
|
-
]),
|
|
1199
|
-
number: /* @__PURE__ */ new Set([
|
|
1200
|
-
"between",
|
|
1201
|
-
"not between",
|
|
1202
|
-
"=",
|
|
1203
|
-
"!=",
|
|
1204
|
-
">",
|
|
1205
|
-
">=",
|
|
1206
|
-
"<",
|
|
1207
|
-
"<=",
|
|
1208
|
-
"in",
|
|
1209
|
-
"not in",
|
|
1210
|
-
"is null",
|
|
1211
|
-
"is not null"
|
|
1212
|
-
]),
|
|
1213
|
-
string: /* @__PURE__ */ new Set([
|
|
1214
|
-
"=",
|
|
1215
|
-
"!=",
|
|
1216
|
-
"in",
|
|
1217
|
-
"not in",
|
|
1218
|
-
"like",
|
|
1219
|
-
"not like",
|
|
1220
|
-
"is null",
|
|
1221
|
-
"is not null"
|
|
1222
|
-
]),
|
|
1223
|
-
boolean: /* @__PURE__ */ new Set(["=", "!=", "in", "not in", "is null", "is not null"])
|
|
1224
|
-
};
|
|
1225
|
-
function Mt(e) {
|
|
1226
|
-
const t = Y(e);
|
|
1227
|
-
return t === "number" || t === "boolean" ? t : t === "date" || t === "datetime" ? "date" : "string";
|
|
1228
|
-
}
|
|
1229
|
-
function Xn(e, t) {
|
|
1230
|
-
return typeof t != "string" ? !1 : xt[Mt(e)].has(t);
|
|
1231
|
-
}
|
|
1232
|
-
const Rt = /* @__PURE__ */ new Set([
|
|
1233
|
-
"=",
|
|
1234
|
-
">",
|
|
1235
|
-
"<",
|
|
1236
|
-
">=",
|
|
1237
|
-
"<=",
|
|
1238
|
-
"!=",
|
|
1239
|
-
"in",
|
|
1240
|
-
"not in",
|
|
1241
|
-
"like",
|
|
1242
|
-
"not like",
|
|
1243
|
-
"between",
|
|
1244
|
-
"not between",
|
|
1245
|
-
"is null",
|
|
1246
|
-
"is not null"
|
|
1247
|
-
]);
|
|
1248
|
-
function _t(e, t) {
|
|
1249
|
-
return t === "number" ? typeof e == "number" && Number.isFinite(e) : t === "boolean" ? typeof e == "boolean" : t === "date" ? e instanceof Date || typeof e == "string" && e.trim().length > 0 : typeof e == "string" || typeof e == "number" || typeof e == "boolean";
|
|
1250
|
-
}
|
|
1251
|
-
function Ft(e, t, n, r) {
|
|
1252
|
-
const s = Le(e.relativeMeta);
|
|
1253
|
-
if (s && We(s).dataAnchored) {
|
|
1254
|
-
r.push(
|
|
1255
|
-
`${n}.relativeMeta counts back from the latest data; a dashboard filter's dates run to now. Use a period counted back from today.`
|
|
1256
|
-
);
|
|
1257
|
-
return;
|
|
1258
|
-
}
|
|
1259
|
-
if (s && !qe(String(e.operation), s)) {
|
|
1260
|
-
r.push(
|
|
1261
|
-
`${n}.relativeMeta runs only under between, not between, before, after, on or before, or on or after.`
|
|
1262
|
-
);
|
|
1263
|
-
return;
|
|
1264
|
-
}
|
|
1265
|
-
Vt(e.operation, e.values, t, `${n}.values`, r);
|
|
1266
|
-
}
|
|
1267
|
-
function Vt(e, t, n, r, s) {
|
|
1268
|
-
if (e === "is null" || e === "is not null") {
|
|
1269
|
-
t.length !== 0 && s.push(`${r} must be empty for null filter operations.`);
|
|
1270
|
-
return;
|
|
1271
|
-
}
|
|
1272
|
-
if (e === "between" || e === "not between") {
|
|
1273
|
-
if (t.length !== 2) {
|
|
1274
|
-
s.push(
|
|
1275
|
-
`${r} must contain exactly two values for between operations.`
|
|
1276
|
-
);
|
|
1277
|
-
return;
|
|
1278
|
-
}
|
|
1279
|
-
} else if (e === "in" || e === "not in") {
|
|
1280
|
-
if (t.length === 0) {
|
|
1281
|
-
s.push(
|
|
1282
|
-
`${r} must contain at least one value for set operations.`
|
|
1283
|
-
);
|
|
1284
|
-
return;
|
|
1285
|
-
}
|
|
1286
|
-
} else if (t.length !== 1) {
|
|
1287
|
-
s.push(
|
|
1288
|
-
`${r} must contain exactly one value for '${String(e)}' operations.`
|
|
1289
|
-
);
|
|
1290
|
-
return;
|
|
1291
|
-
}
|
|
1292
|
-
for (const a of t)
|
|
1293
|
-
if (!_t(a, n)) {
|
|
1294
|
-
s.push(
|
|
1295
|
-
`${r} contains a value that is incompatible with valueType '${n}'.`
|
|
1296
|
-
);
|
|
1297
|
-
return;
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
const Q = {
|
|
1186
|
+
}, Hn = "__card_default__", Q = {
|
|
1301
1187
|
bookmarksPerViewerPerDashboard: 20,
|
|
1302
1188
|
bookmarkNameMaxChars: 100,
|
|
1303
1189
|
columnLabelMaxChars: 120,
|
|
@@ -1306,10 +1192,10 @@ const Q = {
|
|
|
1306
1192
|
rememberedTableSettingsMaxBytes: 262144,
|
|
1307
1193
|
bookmarkStateMaxBytes: 65536
|
|
1308
1194
|
}, Oe = 1;
|
|
1309
|
-
function
|
|
1195
|
+
function Xn(e) {
|
|
1310
1196
|
return new TextEncoder().encode(JSON.stringify(e ?? null)).length;
|
|
1311
1197
|
}
|
|
1312
|
-
function
|
|
1198
|
+
function xt(e) {
|
|
1313
1199
|
const t = encodeURIComponent;
|
|
1314
1200
|
switch (e.kind) {
|
|
1315
1201
|
case "dimension":
|
|
@@ -1330,7 +1216,7 @@ function D(e) {
|
|
|
1330
1216
|
return;
|
|
1331
1217
|
}
|
|
1332
1218
|
}
|
|
1333
|
-
function
|
|
1219
|
+
function Mt(e) {
|
|
1334
1220
|
if (typeof e != "string") return;
|
|
1335
1221
|
const t = e.split(":");
|
|
1336
1222
|
let n;
|
|
@@ -1344,12 +1230,12 @@ function Pt(e) {
|
|
|
1344
1230
|
const r = D(t[1]);
|
|
1345
1231
|
r && (n = { kind: "result", key: r });
|
|
1346
1232
|
}
|
|
1347
|
-
return n &&
|
|
1233
|
+
return n && xt(n) === e ? n : void 0;
|
|
1348
1234
|
}
|
|
1349
1235
|
function O(e) {
|
|
1350
|
-
return typeof e == "string" &&
|
|
1236
|
+
return typeof e == "string" && Mt(e) !== void 0;
|
|
1351
1237
|
}
|
|
1352
|
-
const he = l.array(l.string()).max(2e3),
|
|
1238
|
+
const he = l.array(l.string()).max(2e3), Rt = l.object({
|
|
1353
1239
|
order: he.optional(),
|
|
1354
1240
|
hidden: he.optional(),
|
|
1355
1241
|
labels: l.record(l.string(), l.string().max(Q.columnLabelMaxChars)).optional(),
|
|
@@ -1370,7 +1256,7 @@ function G(e) {
|
|
|
1370
1256
|
!O(r) || t.has(r) || (t.add(r), n.push(r));
|
|
1371
1257
|
return n;
|
|
1372
1258
|
}
|
|
1373
|
-
function
|
|
1259
|
+
function Zn(e) {
|
|
1374
1260
|
if (!Array.isArray(e)) return;
|
|
1375
1261
|
const t = G(
|
|
1376
1262
|
e.filter((n) => typeof n == "string")
|
|
@@ -1397,7 +1283,7 @@ function xe(e) {
|
|
|
1397
1283
|
direction: u
|
|
1398
1284
|
}))), i.length && (o.widths = Object.fromEntries(i)), Object.keys(o).length ? o : void 0;
|
|
1399
1285
|
}
|
|
1400
|
-
function
|
|
1286
|
+
function er(e) {
|
|
1401
1287
|
var t, n;
|
|
1402
1288
|
return !!((t = e == null ? void 0 : e.order) != null && t.length) || !!((n = e == null ? void 0 : e.hidden) != null && n.length) || Object.keys((e == null ? void 0 : e.labels) ?? {}).length > 0 || Object.keys((e == null ? void 0 : e.widths) ?? {}).length > 0;
|
|
1403
1289
|
}
|
|
@@ -1410,13 +1296,13 @@ function Re(e, t) {
|
|
|
1410
1296
|
ok: !1,
|
|
1411
1297
|
error: `Unsupported table settings version ${t}.`
|
|
1412
1298
|
};
|
|
1413
|
-
const n =
|
|
1299
|
+
const n = Rt.safeParse(e);
|
|
1414
1300
|
return n.success ? {
|
|
1415
1301
|
ok: !0,
|
|
1416
1302
|
value: xe(n.data) ?? {}
|
|
1417
1303
|
} : { ok: !1, error: "Table settings are invalid." };
|
|
1418
1304
|
}
|
|
1419
|
-
function
|
|
1305
|
+
function tr(e, t, n) {
|
|
1420
1306
|
if (!e || typeof e != "object" || Array.isArray(e)) return {};
|
|
1421
1307
|
const r = {};
|
|
1422
1308
|
for (const [s, a] of Object.entries(
|
|
@@ -1428,27 +1314,141 @@ function nr(e, t, n) {
|
|
|
1428
1314
|
}
|
|
1429
1315
|
return r;
|
|
1430
1316
|
}
|
|
1431
|
-
const
|
|
1317
|
+
const _t = /* @__PURE__ */ new Set([
|
|
1432
1318
|
"table",
|
|
1433
1319
|
"detailTable"
|
|
1434
1320
|
]);
|
|
1435
1321
|
function _e(e) {
|
|
1436
|
-
return
|
|
1322
|
+
return _t.has(e.type);
|
|
1437
1323
|
}
|
|
1438
|
-
function
|
|
1324
|
+
function Ft(e) {
|
|
1439
1325
|
var t, n;
|
|
1440
1326
|
return _e(e) && ((n = (t = e.preferences) == null ? void 0 : t.tablePrefs) == null ? void 0 : n.allowViewerColumnCustomization) !== !1;
|
|
1441
1327
|
}
|
|
1442
|
-
function
|
|
1328
|
+
function nr(e) {
|
|
1443
1329
|
return new Set(
|
|
1444
1330
|
T(e).filter(({ card: t }) => _e(t)).map(({ card: t }) => t.id)
|
|
1445
1331
|
);
|
|
1446
1332
|
}
|
|
1447
|
-
function
|
|
1333
|
+
function rr(e) {
|
|
1448
1334
|
return new Set(
|
|
1449
|
-
T(e).filter(({ card: t }) =>
|
|
1335
|
+
T(e).filter(({ card: t }) => Ft(t)).map(({ card: t }) => t.id)
|
|
1450
1336
|
);
|
|
1451
1337
|
}
|
|
1338
|
+
const Vt = {
|
|
1339
|
+
date: /* @__PURE__ */ new Set([
|
|
1340
|
+
"between",
|
|
1341
|
+
"not between",
|
|
1342
|
+
"=",
|
|
1343
|
+
"!=",
|
|
1344
|
+
">",
|
|
1345
|
+
">=",
|
|
1346
|
+
"<",
|
|
1347
|
+
"<=",
|
|
1348
|
+
"is null",
|
|
1349
|
+
"is not null"
|
|
1350
|
+
]),
|
|
1351
|
+
number: /* @__PURE__ */ new Set([
|
|
1352
|
+
"between",
|
|
1353
|
+
"not between",
|
|
1354
|
+
"=",
|
|
1355
|
+
"!=",
|
|
1356
|
+
">",
|
|
1357
|
+
">=",
|
|
1358
|
+
"<",
|
|
1359
|
+
"<=",
|
|
1360
|
+
"in",
|
|
1361
|
+
"not in",
|
|
1362
|
+
"is null",
|
|
1363
|
+
"is not null"
|
|
1364
|
+
]),
|
|
1365
|
+
string: /* @__PURE__ */ new Set([
|
|
1366
|
+
"=",
|
|
1367
|
+
"!=",
|
|
1368
|
+
"in",
|
|
1369
|
+
"not in",
|
|
1370
|
+
"like",
|
|
1371
|
+
"not like",
|
|
1372
|
+
"is null",
|
|
1373
|
+
"is not null"
|
|
1374
|
+
]),
|
|
1375
|
+
boolean: /* @__PURE__ */ new Set(["=", "!=", "in", "not in", "is null", "is not null"])
|
|
1376
|
+
};
|
|
1377
|
+
function $t(e) {
|
|
1378
|
+
const t = Y(e);
|
|
1379
|
+
return t === "number" || t === "boolean" ? t : t === "date" || t === "datetime" ? "date" : "string";
|
|
1380
|
+
}
|
|
1381
|
+
function sr(e, t) {
|
|
1382
|
+
return typeof t != "string" ? !1 : Vt[$t(e)].has(t);
|
|
1383
|
+
}
|
|
1384
|
+
const Pt = /* @__PURE__ */ new Set([
|
|
1385
|
+
"=",
|
|
1386
|
+
">",
|
|
1387
|
+
"<",
|
|
1388
|
+
">=",
|
|
1389
|
+
"<=",
|
|
1390
|
+
"!=",
|
|
1391
|
+
"in",
|
|
1392
|
+
"not in",
|
|
1393
|
+
"like",
|
|
1394
|
+
"not like",
|
|
1395
|
+
"between",
|
|
1396
|
+
"not between",
|
|
1397
|
+
"is null",
|
|
1398
|
+
"is not null"
|
|
1399
|
+
]);
|
|
1400
|
+
function Lt(e, t) {
|
|
1401
|
+
return t === "number" ? typeof e == "number" && Number.isFinite(e) : t === "boolean" ? typeof e == "boolean" : t === "date" ? e instanceof Date || typeof e == "string" && e.trim().length > 0 : typeof e == "string" || typeof e == "number" || typeof e == "boolean";
|
|
1402
|
+
}
|
|
1403
|
+
function qt(e, t, n, r) {
|
|
1404
|
+
const s = Le(e.relativeMeta);
|
|
1405
|
+
if (s && We(s).dataAnchored) {
|
|
1406
|
+
r.push(
|
|
1407
|
+
`${n}.relativeMeta counts back from the latest data; a dashboard filter's dates run to now. Use a period counted back from today.`
|
|
1408
|
+
);
|
|
1409
|
+
return;
|
|
1410
|
+
}
|
|
1411
|
+
if (s && !qe(String(e.operation), s)) {
|
|
1412
|
+
r.push(
|
|
1413
|
+
`${n}.relativeMeta runs only under between, not between, before, after, on or before, or on or after.`
|
|
1414
|
+
);
|
|
1415
|
+
return;
|
|
1416
|
+
}
|
|
1417
|
+
Bt(e.operation, e.values, t, `${n}.values`, r);
|
|
1418
|
+
}
|
|
1419
|
+
function Bt(e, t, n, r, s) {
|
|
1420
|
+
if (e === "is null" || e === "is not null") {
|
|
1421
|
+
t.length !== 0 && s.push(`${r} must be empty for null filter operations.`);
|
|
1422
|
+
return;
|
|
1423
|
+
}
|
|
1424
|
+
if (e === "between" || e === "not between") {
|
|
1425
|
+
if (t.length !== 2) {
|
|
1426
|
+
s.push(
|
|
1427
|
+
`${r} must contain exactly two values for between operations.`
|
|
1428
|
+
);
|
|
1429
|
+
return;
|
|
1430
|
+
}
|
|
1431
|
+
} else if (e === "in" || e === "not in") {
|
|
1432
|
+
if (t.length === 0) {
|
|
1433
|
+
s.push(
|
|
1434
|
+
`${r} must contain at least one value for set operations.`
|
|
1435
|
+
);
|
|
1436
|
+
return;
|
|
1437
|
+
}
|
|
1438
|
+
} else if (t.length !== 1) {
|
|
1439
|
+
s.push(
|
|
1440
|
+
`${r} must contain exactly one value for '${String(e)}' operations.`
|
|
1441
|
+
);
|
|
1442
|
+
return;
|
|
1443
|
+
}
|
|
1444
|
+
for (const a of t)
|
|
1445
|
+
if (!Lt(a, n)) {
|
|
1446
|
+
s.push(
|
|
1447
|
+
`${r} contains a value that is incompatible with valueType '${n}'.`
|
|
1448
|
+
);
|
|
1449
|
+
return;
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
1452
|
const L = 1, ar = ["PRIVATE", "TEAM", "DASHBOARD"], jt = l.object({
|
|
1453
1453
|
filterId: l.string().min(1),
|
|
1454
1454
|
name: l.string(),
|
|
@@ -1457,7 +1457,7 @@ const L = 1, ar = ["PRIVATE", "TEAM", "DASHBOARD"], jt = l.object({
|
|
|
1457
1457
|
values: l.array(l.unknown())
|
|
1458
1458
|
}).passthrough().superRefine((e, t) => {
|
|
1459
1459
|
const n = [];
|
|
1460
|
-
|
|
1460
|
+
Pt.has(e.operation) ? qt(e, e.valueType, "filterValue", n) : n.push("filterValue.operation must be a valid filter operation.");
|
|
1461
1461
|
for (const r of n) t.addIssue({ code: "custom", message: r });
|
|
1462
1462
|
}), q = l.unknown().superRefine((e, t) => {
|
|
1463
1463
|
for (const n of Qe(e).errors)
|
|
@@ -1590,9 +1590,9 @@ export {
|
|
|
1590
1590
|
pn as a7,
|
|
1591
1591
|
hn as a8,
|
|
1592
1592
|
In as a9,
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1593
|
+
sr as aA,
|
|
1594
|
+
Pt as aB,
|
|
1595
|
+
qt as aC,
|
|
1596
1596
|
$n as aD,
|
|
1597
1597
|
an as aE,
|
|
1598
1598
|
et as aF,
|
|
@@ -1604,9 +1604,9 @@ export {
|
|
|
1604
1604
|
ae as aL,
|
|
1605
1605
|
wn as aM,
|
|
1606
1606
|
gn as aN,
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1607
|
+
vn as aO,
|
|
1608
|
+
An as aP,
|
|
1609
|
+
Vn as aQ,
|
|
1610
1610
|
Xe as aR,
|
|
1611
1611
|
Pn as aS,
|
|
1612
1612
|
Ln as aT,
|
|
@@ -1637,7 +1637,7 @@ export {
|
|
|
1637
1637
|
wt as aw,
|
|
1638
1638
|
At as ax,
|
|
1639
1639
|
Fn as ay,
|
|
1640
|
-
|
|
1640
|
+
$t as az,
|
|
1641
1641
|
zn as b,
|
|
1642
1642
|
Ne as c,
|
|
1643
1643
|
De as d,
|
|
@@ -1647,20 +1647,20 @@ export {
|
|
|
1647
1647
|
Yn as h,
|
|
1648
1648
|
Gt as i,
|
|
1649
1649
|
Oe as j,
|
|
1650
|
-
|
|
1650
|
+
Mt as k,
|
|
1651
1651
|
xe as l,
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1652
|
+
Xn as m,
|
|
1653
|
+
Zn as n,
|
|
1654
|
+
er as o,
|
|
1655
1655
|
ir as p,
|
|
1656
1656
|
Me as q,
|
|
1657
1657
|
Un as r,
|
|
1658
1658
|
Re as s,
|
|
1659
|
-
|
|
1660
|
-
|
|
1659
|
+
xt as t,
|
|
1660
|
+
tr as u,
|
|
1661
1661
|
_e as v,
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1662
|
+
Ft as w,
|
|
1663
|
+
nr as x,
|
|
1664
|
+
rr as y,
|
|
1665
1665
|
ar as z
|
|
1666
1666
|
};
|