react-semaphor 0.1.584 → 0.1.585

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.
Files changed (50) hide show
  1. package/dist/analytics-protocol/index.js +477 -440
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/briefings/index.js +2 -2
  4. package/dist/chunks/{assistant-chat-nmycV1Se.js → assistant-chat-BdbLmAnK.js} +7 -7
  5. package/dist/chunks/{bookmark-impact-CI3gmxi0.js → bookmark-impact-BhT3k379.js} +2 -2
  6. package/dist/chunks/{bookmark-state-D9-RFkDg.js → bookmark-state-CL4WEpgB.js} +2 -2
  7. package/dist/chunks/{card-filter-builder-C7QyPqRy.js → card-filter-builder-CEcKF6Fw.js} +50 -50
  8. package/dist/chunks/{comparison-window-caption-BAnsTI8y.js → comparison-window-caption-CoART8BC.js} +530 -633
  9. package/dist/chunks/{dashboard-inJy_V78.js → dashboard-MPku_x1M.js} +1 -1
  10. package/dist/chunks/{dashboard-briefing-launcher-DXs0XA1O.js → dashboard-briefing-launcher-CkFNlkr1.js} +8 -8
  11. package/dist/chunks/{dashboard-controls-6Zoo8d8Y.js → dashboard-controls-Clt4ovXS.js} +9 -9
  12. package/dist/chunks/{dashboard-json-D5eJhVA9.js → dashboard-json-DSmXazIg.js} +1 -1
  13. package/dist/chunks/{dates-B3_GWc_Y.js → dates-CYZW9owO.js} +6 -6
  14. package/dist/chunks/{edit-dashboard-visual-DR03SYeW.js → edit-dashboard-visual-Dn2ECRbX.js} +2751 -2686
  15. package/dist/chunks/filter-line-Cu2u1K36.js +131 -0
  16. package/dist/chunks/{filter-reach-copy-CZwzrxBp.js → filter-reach-copy-CmJpPa4G.js} +1627 -1371
  17. package/dist/chunks/{filter-value-text-DtOvqcjn.js → filter-value-text-xefXzZlf.js} +10 -10
  18. package/dist/chunks/{index-BgT1L0p5.js → index-0WYn6RMz.js} +35 -35
  19. package/dist/chunks/{matrix-analytical-definition-Cs2v43FM.js → matrix-analytical-definition-QjBgUYhP.js} +382 -544
  20. package/dist/chunks/{metric-comparison-Be4uS3Ql.js → metric-comparison-ZmurmEIs.js} +2 -2
  21. package/dist/chunks/{pivot-header-presentation-uH06jiZD.js → pivot-header-presentation-CdeTU96P.js} +1 -1
  22. package/dist/chunks/{pivot-result-contract-expectations-DvZY4eJM.js → pivot-result-contract-expectations-Bx_BCu-7.js} +1010 -1005
  23. package/dist/chunks/{pivot-result-identity-BZexMfmL.js → pivot-result-identity-Bvs6Uq3v.js} +1 -1
  24. package/dist/chunks/raw-temporal-value-DH-feMc2.js +322 -0
  25. package/dist/chunks/{report-preferences-dialog-DWeVe2so.js → report-preferences-dialog-BRaeufEi.js} +119 -119
  26. package/dist/chunks/{resolve-dashboard-input-context-uATCuOP7.js → resolve-dashboard-input-context-Cn9jumxl.js} +304 -299
  27. package/dist/chunks/{saved-dashboard-context-DSVV9iqW.js → saved-dashboard-context-CfqkUMzR.js} +5 -5
  28. package/dist/chunks/{semaphor-ready-indicator-B9vvRMnJ.js → semaphor-ready-indicator-D6WjdTGl.js} +19776 -19620
  29. package/dist/chunks/{shelf-drop-preview-context-BHOnp5Bo.js → shelf-drop-preview-context-Bbbrr9u4.js} +2 -2
  30. package/dist/chunks/{stored-dashboard-xc5iidHL.js → stored-dashboard-sPkTjxYf.js} +7 -7
  31. package/dist/chunks/{table-export-sheet-Cv_94obr.js → table-export-sheet-Dmtqi5NV.js} +1 -1
  32. package/dist/chunks/{variable-draft-C3CjhsJQ.js → variable-draft-D1RotIEG.js} +3 -3
  33. package/dist/dashboard/index.js +2 -2
  34. package/dist/dashboard-authoring/index.js +707 -704
  35. package/dist/format-utils/index.js +145 -142
  36. package/dist/index.js +14 -14
  37. package/dist/style.css +1 -1
  38. package/dist/surfboard/index.js +2 -2
  39. package/dist/types/index.js +2 -2
  40. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  41. package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +191 -0
  42. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +3 -0
  43. package/dist/types/shared/dashboard-authoring/see-records/measure-kind.d.ts +5 -2
  44. package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +37 -4
  45. package/dist/types/shared/format-utils/semantic-format.d.ts +0 -1
  46. package/dist/types/shared/format-utils/temporal-bucket.d.ts +20 -0
  47. package/dist/types/shared/temporal/calendar-periods.d.ts +15 -0
  48. package/dist/types/shared/temporal/raw-temporal-equality.d.ts +14 -0
  49. package/package.json +1 -1
  50. package/dist/chunks/raw-temporal-value-DdT0s47W.js +0 -159
@@ -0,0 +1,131 @@
1
+ import { j as N, r as g } from "./validators-CJ8Jh0E8.js";
2
+ import "./matrix-operation-contract-BM5TveR3.js";
3
+ import "./analytics-base-schemas-BaIQrEzX.js";
4
+ import { r as b } from "./metric-comparison-ZmurmEIs.js";
5
+ import { c as F } from "./raw-temporal-value-DH-feMc2.js";
6
+ import "../value-format-preferences/index.js";
7
+ const C = /^\d{4}-\d{2}-\d{2}$/;
8
+ function D(n) {
9
+ const r = n.split(".");
10
+ return r[r.length - 1].replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").split(" ").map((e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join(" ");
11
+ }
12
+ const T = 10;
13
+ function h(n, r) {
14
+ const s = n.slice(0, T).map(r).join(", "), o = n.length - T;
15
+ return o > 0 ? `${s}, and ${o} more` : s;
16
+ }
17
+ function E(n) {
18
+ if (n.valueType !== "date" || n.operation !== "between" && n.operation !== "not between")
19
+ return;
20
+ const r = g(n.relativeMeta);
21
+ return r && b(r).printsByName ? r : void 0;
22
+ }
23
+ function _(n, r) {
24
+ if (r !== "label") return E(n);
25
+ if (!(n.valueType !== "date" || n.operation !== "between" && n.operation !== "not between"))
26
+ return g(n.relativeMeta);
27
+ }
28
+ function y(n, r = {}) {
29
+ const { name: s, operation: o, values: e, valueType: m } = n, t = r.label ?? D(s), c = _(n, r.relativeDates);
30
+ if (c) {
31
+ const a = N(c).label;
32
+ if (a)
33
+ return o === "between" ? `${t}: ${a}` : `${t} not in ${a}`;
34
+ }
35
+ if (!e || e.length === 0)
36
+ return o === "is null" ? `${t} is empty` : o === "is not null" ? `${t} is not empty` : "";
37
+ const u = g(n.relativeMeta), $ = n.temporalPrecision === "minute" || !!(u && b(u).subDay), i = (a) => {
38
+ if (m === "date" && a) {
39
+ const d = {
40
+ year: "numeric",
41
+ month: "short",
42
+ day: "numeric",
43
+ ...$ ? {
44
+ hour: "numeric",
45
+ minute: "2-digit"
46
+ } : {}
47
+ };
48
+ if (typeof a == "string" && C.test(a)) {
49
+ const [p, f, w] = a.split("-").map(Number);
50
+ return new Intl.DateTimeFormat(void 0, {
51
+ year: "numeric",
52
+ month: "short",
53
+ day: "numeric",
54
+ timeZone: "UTC"
55
+ }).format(new Date(Date.UTC(p, f - 1, w)));
56
+ }
57
+ if (typeof a == "string" && F(a) === "wall_datetime") {
58
+ const [p, f, w, v, L] = a.split(/[-T :.]/).map(Number);
59
+ return new Intl.DateTimeFormat(void 0, {
60
+ ...d,
61
+ timeZone: "UTC"
62
+ }).format(new Date(Date.UTC(p, f - 1, w, v, L)));
63
+ }
64
+ const l = new Date(a);
65
+ if (!isNaN(l.getTime()))
66
+ try {
67
+ return new Intl.DateTimeFormat(void 0, {
68
+ ...d,
69
+ ...r.timezone ? { timeZone: r.timezone } : {}
70
+ }).format(l);
71
+ } catch {
72
+ return $ ? l.toLocaleString(void 0, d) : l.toLocaleDateString(void 0, d);
73
+ }
74
+ }
75
+ return String(a);
76
+ };
77
+ switch (o) {
78
+ case "=":
79
+ return `${t}: ${i(e[0])}`;
80
+ case "!=":
81
+ return `${t} ≠ ${i(e[0])}`;
82
+ case ">":
83
+ return `${t} > ${i(e[0])}`;
84
+ case "<":
85
+ return `${t} < ${i(e[0])}`;
86
+ case ">=":
87
+ return `${t} ≥ ${i(e[0])}`;
88
+ case "<=":
89
+ return `${t} ≤ ${i(e[0])}`;
90
+ case "between":
91
+ case "not between": {
92
+ const a = `${i(e[0])} - ${i(e[1])}`;
93
+ return o === "between" ? `${t}: ${a}` : `${t} not in ${a}`;
94
+ }
95
+ case "in":
96
+ return e.length === 1 ? `${t}: ${i(e[0])}` : `${t}: ${h(e, i)}`;
97
+ case "not in":
98
+ return `${t} not in (${h(e, i)})`;
99
+ case "like":
100
+ return `${t} contains "${e[0]}"`;
101
+ case "not like":
102
+ return `${t} doesn't contain "${e[0]}"`;
103
+ default:
104
+ return `${t}: ${h(e, i)}`;
105
+ }
106
+ }
107
+ function S(n, r = {}) {
108
+ if (!n || n.length === 0)
109
+ return "";
110
+ const s = /* @__PURE__ */ new Map();
111
+ n.forEach((e) => {
112
+ const m = s.get(e.name) || [];
113
+ m.push(e), s.set(e.name, m);
114
+ });
115
+ const o = [];
116
+ return s.forEach((e, m) => {
117
+ if (e.length === 1) {
118
+ const t = y(e[0], r);
119
+ t && o.push(t);
120
+ } else {
121
+ const t = D(m), c = e.map((u) => y(u, r).replace(`${t}: `, "").replace(`${t} `, "")).filter(Boolean);
122
+ c.length > 0 && o.push(`${t}: ${c.join(" and ")}`);
123
+ }
124
+ }), o.join(" | ");
125
+ }
126
+ export {
127
+ T as F,
128
+ S as a,
129
+ y as f,
130
+ E as r
131
+ };