@hybridcore/ui 1.6.12 → 1.6.13

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 (105) hide show
  1. package/dist/assets/index.css +1 -1
  2. package/dist/assets/index2.css +1 -1
  3. package/dist/components/button/styled.js +1 -1
  4. package/dist/components/charts/_common/format.js +149 -41
  5. package/dist/components/charts/_common/utils.js +16 -11
  6. package/dist/components/collapsible-card/index.js +21 -30
  7. package/dist/components/collapsible-card/styled.js +16 -14
  8. package/dist/components/color-picker/index.js +2227 -3357
  9. package/dist/components/color-picker/styled.js +87 -7
  10. package/dist/components/confirm/dialog.js +89 -8
  11. package/dist/components/confirm/index.js +1 -1
  12. package/dist/components/data-map/index.js +1 -1
  13. package/dist/components/data-map/logic.js +20 -20
  14. package/dist/components/data-security-selectors/dissemination-list/index.js +32 -3117
  15. package/dist/components/date-picker-with-custom-range/index.js +86 -7
  16. package/dist/components/date-range-picker/index.js +464 -452
  17. package/dist/components/document-viewer/components/viewer/index.js +1 -1
  18. package/dist/components/duration-select/index.js +10 -10
  19. package/dist/components/duration-select/styled.js +1 -1
  20. package/dist/components/geometry-picker/coordinate/index.js +14 -14
  21. package/dist/components/geometry-picker/edit/index.js +1 -1
  22. package/dist/components/geometry-picker/geometry/index.js +1 -1
  23. package/dist/components/geometry-picker/kml/index.js +11 -11
  24. package/dist/components/geometry-picker/map/logic.js +145 -3656
  25. package/dist/components/geometry-picker/map/style.js +18 -17
  26. package/dist/components/geometry-picker/parser/coordinate-input/logic.js +43 -1255
  27. package/dist/components/heat-map/index.js +1 -1
  28. package/dist/components/heat-map/logic.js +77 -1924
  29. package/dist/components/instance-hierarchy-table/styled.js +18 -16
  30. package/dist/components/map/helpers/mapbox.js +17 -15
  31. package/dist/components/map/helpers/ol.js +386 -27
  32. package/dist/components/map/index.js +11 -10
  33. package/dist/components/map/logic.js +22 -22
  34. package/dist/components/map/styled.js +31 -27
  35. package/dist/components/metric-card/logic.js +46 -49
  36. package/dist/components/phone-input/index.js +10 -9
  37. package/dist/components/property-mapping/index.js +1 -1
  38. package/dist/components/prr-map/index.js +1 -1
  39. package/dist/components/prr-map/logic.js +27 -26
  40. package/dist/components/range-selector/styled.js +65 -4228
  41. package/dist/components/raster-grid-map/index.js +1 -1
  42. package/dist/components/raster-grid-map/logic.js +60 -57
  43. package/dist/components/simple-pivot-table/index.js +17 -17
  44. package/dist/components/simple-pivot-table/logic.js +67 -76
  45. package/dist/components/sortable-list/index.js +1091 -1264
  46. package/dist/components/template-form/components/property-list/index.js +36 -33
  47. package/dist/components/template-form/components/property-list/property-list-columns.js +19 -18
  48. package/dist/components/template-form/components/property-list/property-list-form.js +137 -601
  49. package/dist/components/template-form/components/recognition-property-list/index.js +40 -37
  50. package/dist/components/template-form/components/recognition-property-list/recognition-property-list-columns.js +11 -10
  51. package/dist/components/template-form/components/recognition-property-list/recognition-property-list-form.js +55 -63
  52. package/dist/components/tree-select/index.js +16 -16
  53. package/dist/index.esm-UfGMjYOL.js +197 -0
  54. package/dist/main.d.ts +54 -8
  55. package/dist/main.js +176 -175
  56. package/package.json +1 -1
  57. package/dist/AccordionSummary-CJppWeqF.js +0 -781
  58. package/dist/Add-CqcD1PWb.js +0 -403
  59. package/dist/Box-DqUMmZjL.js +0 -31
  60. package/dist/Button-C5yquWAB.js +0 -357
  61. package/dist/ButtonBase-BEF7oTOe.js +0 -887
  62. package/dist/Delete-BdyYpINH.js +0 -23
  63. package/dist/DialogContent-BvVjD9z3.js +0 -523
  64. package/dist/FormGroup-CpBsIyYR.js +0 -89
  65. package/dist/IconButton-BoGwbvrP.js +0 -184
  66. package/dist/InputLabel-Dd8RrneV.js +0 -341
  67. package/dist/MenuItem-DwqJqzuM.js +0 -233
  68. package/dist/Modal-MUZygjmQ.js +0 -1158
  69. package/dist/Paper-BkQLdsCI.js +0 -582
  70. package/dist/Select-DHUl_uG3.js +0 -3916
  71. package/dist/Source-BSZST_GH.js +0 -4410
  72. package/dist/SwitchBase-DTndTqI8.js +0 -235
  73. package/dist/Text-ChJRuaD8.js +0 -2197
  74. package/dist/TextField-e2oKaUN1.js +0 -669
  75. package/dist/TransitionGroupContext-BDAp2T0O.js +0 -96
  76. package/dist/Typography-DgsSLCFC.js +0 -178
  77. package/dist/Vector-BmuhQO4p.js +0 -3606
  78. package/dist/Vector-DfTqQEln.js +0 -1735
  79. package/dist/WKT-2wsDT-nq.js +0 -2310
  80. package/dist/assertThisInitialized-C1dAyb4j.js +0 -7
  81. package/dist/assets/index3.css +0 -1
  82. package/dist/assets/index4.css +0 -1
  83. package/dist/clsx-OuTLNxxd.js +0 -16
  84. package/dist/createChainedFunction-C0nujS3O.js +0 -9
  85. package/dist/createSvgIcon-Ch_cT8az.js +0 -185
  86. package/dist/createSvgIcon-DuDuASu1.js +0 -62
  87. package/dist/debounce-46wSf_lW.js +0 -15
  88. package/dist/dialog-BYRnCztH.js +0 -154
  89. package/dist/formControlState-vgaj2ksH.js +0 -10
  90. package/dist/generateUtilityClasses-C3ivN9Ie.js +0 -2973
  91. package/dist/index-DH6qsPBn.js +0 -153
  92. package/dist/index-e9xTIYWt.js +0 -1934
  93. package/dist/index.esm-BLLrbTzY.js +0 -318
  94. package/dist/math-Bvt2Ubuz.js +0 -704
  95. package/dist/objectWithoutPropertiesLoose-DJteAcBH.js +0 -22
  96. package/dist/ol-yOE-NV0X.js +0 -7465
  97. package/dist/ownerWindow-wg6foiOE.js +0 -10
  98. package/dist/setPrototypeOf-NPgp4cYc.js +0 -8
  99. package/dist/styled-SoqbyrkW.js +0 -350
  100. package/dist/unsupportedProp-DuqR2hj9.js +0 -36
  101. package/dist/useControlled-BYdyS7Pn.js +0 -31
  102. package/dist/useFormControl-CatNKXAi.js +0 -10
  103. package/dist/useId-BW-oWmul.js +0 -19
  104. package/dist/useMobilePicker-CY8ndYRL.js +0 -8279
  105. package/dist/useSlot-B_Q4vnX5.js +0 -42
@@ -1,7 +1,7 @@
1
1
  import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
2
  import { Typography as d } from "@mui/material";
3
3
  import { useEffect as l } from "react";
4
- import { u as h } from "../../index.esm-BLLrbTzY.js";
4
+ import { u as h } from "../../index.esm-UfGMjYOL.js";
5
5
  import { Map as u } from "../map/index.js";
6
6
  import { Controls as R } from "./components/controls/index.js";
7
7
  import { Legend as M } from "./components/legend/index.js";
@@ -1,17 +1,20 @@
1
1
  import { useThemeProps as gt, useTheme as xt } from "@mui/material";
2
2
  import { uniqueId as ht } from "lodash";
3
3
  import { Feature as yt } from "ol";
4
- import { b as wt, P as St, f as k, g as Tt } from "../../Source-BSZST_GH.js";
5
- import { V as Ct } from "../../Vector-BmuhQO4p.js";
6
- import { V as Lt } from "../../Vector-DfTqQEln.js";
7
- import { S as A, T as vt, F, I as Mt, a as bt, C as Xt } from "../../Text-ChJRuaD8.js";
4
+ import * as wt from "ol/extent";
5
+ import { Point as St } from "ol/geom";
6
+ import Tt from "ol/layer/Vector";
7
+ import * as B from "ol/proj";
8
+ import Lt from "ol/source/Vector";
9
+ import { Style as V, Text as vt, Fill as F, Icon as Ct, Stroke as Mt } from "ol/style";
10
+ import bt from "ol/style/Circle";
8
11
  import { useRef as m, useState as q, useEffect as O } from "react";
9
- import { DEFAULT_VIRIDIS_COOL as Yt } from "../charts/_common/utils.js";
10
- import { createMapboxLayer as Gt } from "../map/helpers/mapbox.js";
11
- import { createHeatMapScale as Rt } from "./helpers.js";
12
- const Et = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='93'%20height='93'%20viewBox='0%200%2093%2093'%3e%3ccircle%20id='Ellipse_748'%20data-name='Ellipse%20748'%20cx='46.5'%20cy='46.5'%20r='46.5'%20fill='%23fff'%20opacity='0.925'/%3e%3c/svg%3e", Ft = 0.25, It = (r) => {
13
- const u = r.getGeometry(), a = r.get("icon"), p = r.get("iconColor"), h = r.get("iconTextColor"), y = r.get("showText"), w = r.get("title"), S = r.get("scale");
14
- return u && u.getType() === "Point" && a ? new A({
12
+ import { DEFAULT_VIRIDIS_COOL as Xt } from "../charts/_common/utils.js";
13
+ import { createMapboxLayer as Yt } from "../map/helpers/mapbox.js";
14
+ import { createHeatMapScale as Et } from "./helpers.js";
15
+ const Gt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='93'%20height='93'%20viewBox='0%200%2093%2093'%3e%3ccircle%20id='Ellipse_748'%20data-name='Ellipse%20748'%20cx='46.5'%20cy='46.5'%20r='46.5'%20fill='%23fff'%20opacity='0.925'/%3e%3c/svg%3e", Rt = 0.25, Bt = (r) => {
16
+ const u = r.getGeometry(), i = r.get("icon"), p = r.get("iconColor"), h = r.get("iconTextColor"), y = r.get("showText"), w = r.get("title"), S = r.get("scale");
17
+ return u && u.getType() === "Point" && i ? new V({
15
18
  ...y && {
16
19
  text: new vt({
17
20
  text: w,
@@ -19,77 +22,77 @@ const Et = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20wid
19
22
  fill: new F({ color: h ?? "#ddd" })
20
23
  })
21
24
  },
22
- image: new Mt({
25
+ image: new Ct({
23
26
  anchor: [0.5, 0.5],
24
- src: a,
25
- scale: S ?? Ft,
27
+ src: i,
28
+ scale: S ?? Rt,
26
29
  color: p ?? "#b32f5b"
27
30
  }),
28
31
  zIndex: 2
29
- }) : new A({
32
+ }) : new V({
30
33
  fill: new F({ color: "rgba(255, 255, 255, 0.25)" }),
31
- stroke: new bt({ color: "#3069AA", width: 2 }),
32
- image: new Xt({
34
+ stroke: new Mt({ color: "#3069AA", width: 2 }),
35
+ image: new bt({
33
36
  radius: 5,
34
37
  fill: new F({ color: "#444" })
35
38
  })
36
39
  });
37
40
  }, Ut = (r) => {
38
41
  const u = gt({ props: r, name: "HCRasterGridMap" }), {
39
- data: a,
42
+ data: i,
40
43
  payload: p,
41
44
  onPayloadUpdate: h,
42
45
  accessToken: y,
43
- palette: w = Yt,
46
+ palette: w = Xt,
44
47
  sx: S,
45
48
  ...U
46
- } = u, T = xt(), I = m(ht("map-")), o = m(null), l = m(null), C = m(null), s = m(null), L = m(), [B, W] = q(!1), [Z, N] = q(null), z = () => {
49
+ } = u, T = xt(), I = m(ht("map-")), o = m(null), s = m(null), L = m(null), a = m(null), v = m(), [z, W] = q(!1), [Z, j] = q(null), _ = () => {
47
50
  let t = 3;
48
51
  if (o.current) {
49
52
  const e = o.current.getZoomLevel() || 3;
50
53
  e > 11 ? t = 6 : e > 9 ? t = 5 : e > 5 && (t = 4);
51
54
  }
52
55
  return t;
53
- }, j = () => {
54
- var P, D, H;
55
- if (!B || !o.current || !a) return;
56
- const { result: t, rowCount: e, columnCount: n, minX: c, minY: i, maxX: d, maxY: f } = a, v = [c, i, d, f], [nt, rt] = Tt(v), M = nt / n, b = rt / e, ct = ((P = o.current) == null ? void 0 : P.getZoomLevel()) || 3;
57
- (D = C.current) == null || D.clear();
58
- const X = Rt(a, {
56
+ }, N = () => {
57
+ var D, H, k;
58
+ if (!z || !o.current || !i) return;
59
+ const { result: t, rowCount: e, columnCount: n, minX: c, minY: l, maxX: d, maxY: f } = i, C = [c, l, d, f], [nt, rt] = wt.getSize(C), M = nt / n, b = rt / e, ct = ((D = o.current) == null ? void 0 : D.getZoomLevel()) || 3;
60
+ (H = L.current) == null || H.clear();
61
+ const X = Et(i, {
59
62
  palette: [...w].reverse(),
60
63
  mode: "log",
61
64
  nullColor: "transparent",
62
65
  zeroColor: "transparent"
63
66
  });
64
- if (N(X), t !== null)
67
+ if (j(X), t !== null)
65
68
  for (let g = 0; g < e; g++) {
66
- const V = t[g];
67
- if (V !== null)
69
+ const A = t[g];
70
+ if (A !== null)
68
71
  for (let x = 0; x < n; x++) {
69
- const Y = V[x];
72
+ const Y = A[x];
70
73
  if (Y < 2) continue;
71
- const G = c + x * M, R = i + (e - g - 1) * b, at = G + M, st = R + b, it = G + M / 2, lt = R + b / 2, mt = wt(
72
- [it, lt],
74
+ const E = c + x * M, G = l + (e - g - 1) * b, it = E + M, at = G + b, lt = E + M / 2, st = G + b / 2, mt = B.transform(
75
+ [lt, st],
73
76
  "EPSG:4326",
74
77
  "EPSG:3857"
75
78
  ), ut = {
76
- bottomLeft: { latitude: R, longitude: G },
77
- topRight: { latitude: st, longitude: at }
78
- }, pt = ct / z(), E = X.getBin(Y), dt = (((E == null ? void 0 : E.index) || 0) + 1) * 0.1, ft = new yt({
79
+ bottomLeft: { latitude: G, longitude: E },
80
+ topRight: { latitude: at, longitude: it }
81
+ }, pt = ct / _(), R = X.getBin(Y), dt = (((R == null ? void 0 : R.index) || 0) + 1) * 0.1, ft = new yt({
79
82
  geometry: new St(mt),
80
- icon: Et,
83
+ icon: Gt,
81
84
  iconColor: X.getColor(Y),
82
85
  iconTextColor: "#fff",
83
86
  showText: pt > 1.5,
84
87
  boundingBox: ut,
85
88
  scale: dt
86
89
  });
87
- (H = C.current) == null || H.addFeature(ft);
90
+ (k = L.current) == null || k.addFeature(ft);
88
91
  }
89
92
  }
90
93
  }, J = () => {
91
94
  let t = {
92
- gridLevel: z(),
95
+ gridLevel: _(),
93
96
  minX: -180,
94
97
  minY: -180,
95
98
  maxX: 180,
@@ -106,56 +109,56 @@ const Et = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20wid
106
109
  };
107
110
  }
108
111
  return t;
109
- }, _ = () => {
112
+ }, P = () => {
110
113
  const t = {
111
114
  ...p,
112
115
  heatGridMapFilter: J()
113
116
  };
114
117
  h(t);
115
118
  }, K = () => {
116
- L.current && clearTimeout(L.current), L.current = setTimeout(() => {
119
+ v.current && clearTimeout(v.current), v.current = setTimeout(() => {
117
120
  var t;
118
- (t = o.current) == null || t.updateSize(), l.current && l.current.map.resize();
121
+ (t = o.current) == null || t.updateSize(), s.current && s.current.map.resize();
119
122
  }, 100);
120
123
  }, Q = () => {
121
124
  var t, e;
122
125
  (t = o.current) == null || t.on("movestart", () => {
123
- s.current && (clearTimeout(s.current), s.current = null);
126
+ a.current && (clearTimeout(a.current), a.current = null);
124
127
  }), (e = o.current) == null || e.on("moveend", () => {
125
- s.current && (clearTimeout(s.current), s.current = null), s.current = setTimeout(_, 500);
128
+ a.current && (clearTimeout(a.current), a.current = null), a.current = setTimeout(P, 500);
126
129
  });
127
130
  };
128
131
  function $(t) {
129
- const [e, n] = k([t.minX, t.minY]), [c, i] = k([t.maxX, t.maxY]);
130
- return [e, n, c, i];
132
+ const [e, n] = B.fromLonLat([t.minX, t.minY]), [c, l] = B.fromLonLat([t.maxX, t.maxY]);
133
+ return [e, n, c, l];
131
134
  }
132
135
  const tt = () => {
133
136
  var d, f;
134
- const t = T.palette.mode === "light" ? "mapbox://styles/mapbox/light-v11" : "mapbox://styles/mapbox/dark-v11", e = Gt({
137
+ const t = T.palette.mode === "light" ? "mapbox://styles/mapbox/light-v11" : "mapbox://styles/mapbox/dark-v11", e = Yt({
135
138
  id: I.current,
136
139
  center: [0, 0],
137
140
  style: t,
138
141
  accessToken: y
139
142
  });
140
- (d = o.current) == null || d.addLayer(e.layer), l.current = e;
141
- const n = new Lt(), c = new Ct({
143
+ (d = o.current) == null || d.addLayer(e.layer), s.current = e;
144
+ const n = new Lt(), c = new Tt({
142
145
  source: n,
143
- style: It
146
+ style: Bt
144
147
  });
145
- (f = o.current) == null || f.addLayer(c), C.current = n, W(!0), Q(), _();
146
- const { heatGridMapFilter: i } = p;
147
- if (i && o.current) {
148
- const v = $(i);
149
- o.current.centerToExtent(v);
148
+ (f = o.current) == null || f.addLayer(c), L.current = n, W(!0), Q(), P();
149
+ const { heatGridMapFilter: l } = p;
150
+ if (l && o.current) {
151
+ const C = $(l);
152
+ o.current.centerToExtent(C);
150
153
  }
151
154
  }, et = () => {
152
155
  var n, c;
153
- if (!l.current) return;
154
- const t = T.palette.mode === "light" ? "mapbox://styles/mapbox/light-v11" : "mapbox://styles/mapbox/dark-v11", e = ((c = (n = l.current.layer.getSource()) == null ? void 0 : n.getMapboxMap) == null ? void 0 : c.call(n)) || l.current.map;
156
+ if (!s.current) return;
157
+ const t = T.palette.mode === "light" ? "mapbox://styles/mapbox/light-v11" : "mapbox://styles/mapbox/dark-v11", e = ((c = (n = s.current.layer.getSource()) == null ? void 0 : n.getMapboxMap) == null ? void 0 : c.call(n)) || s.current.map;
155
158
  e && e.setStyle(t);
156
159
  };
157
- O(() => (j(), () => {
158
- }), [a, B]), O(() => (et(), () => {
160
+ O(() => (N(), () => {
161
+ }), [i, z]), O(() => (et(), () => {
159
162
  }), [T.palette.mode]);
160
163
  const ot = { ...u };
161
164
  return {
@@ -1,5 +1,5 @@
1
1
  import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
- import { Typography as i, Divider as f, TableContainer as I, Table as R, TableHead as j, TableRow as g, TableCell as r, TableBody as w, Box as D, IconButton as G } from "@mui/material";
2
+ import { Typography as a, Divider as f, TableContainer as I, Table as R, TableHead as j, TableRow as g, TableCell as r, TableBody as w, Box as D, IconButton as G } from "@mui/material";
3
3
  import { useSimplePivotTableLogic as J } from "./logic.js";
4
4
  import { SimplePivotTableRoot as M, SimplePivotTableHeader as O, SimplePivotTableContent as V, SimplePivotTableFooter as X, SimplePivotTableScrollHint as q } from "./styled.js";
5
5
  import { I as A } from "../../IconX-C2wmVYSK.js";
@@ -41,11 +41,11 @@ const Z = (s) => {
41
41
  "data-snapshot": JSON.stringify(W),
42
42
  ...L,
43
43
  children: [
44
- /* @__PURE__ */ e(O, { ownerState: o, children: /* @__PURE__ */ e(i, { sx: { paddingLeft: "0.5rem" }, variant: "h3", children: m }) }),
44
+ /* @__PURE__ */ e(O, { ownerState: o, children: /* @__PURE__ */ e(a, { sx: { paddingLeft: "0.5rem" }, variant: "h3", children: m }) }),
45
45
  /* @__PURE__ */ e(f, {}),
46
46
  /* @__PURE__ */ e(V, { ownerState: o, children: /* @__PURE__ */ e(I, { ref: N, children: /* @__PURE__ */ t(R, { size: "small", stickyHeader: !0, children: [
47
47
  /* @__PURE__ */ e(j, { children: /* @__PURE__ */ t(g, { children: [
48
- n.map((l) => /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(i, { variant: "caption", fontWeight: 600, children: x(l) }) }, l.value)),
48
+ n.map((l) => /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(a, { variant: "caption", fontWeight: 600, children: x(l) }) }, l.value)),
49
49
  c.map((l) => /* @__PURE__ */ e(
50
50
  r,
51
51
  {
@@ -57,7 +57,7 @@ const Z = (s) => {
57
57
  backgroundColor: "action.selected"
58
58
  }
59
59
  },
60
- children: /* @__PURE__ */ e(i, { variant: "caption", fontWeight: 600, children: T(l) })
60
+ children: /* @__PURE__ */ e(a, { variant: "caption", fontWeight: 600, children: T(l) })
61
61
  },
62
62
  l.dataFieldName
63
63
  ))
@@ -68,17 +68,17 @@ const Z = (s) => {
68
68
  hover: !0,
69
69
  sx: { "&:last-child td": { borderBottom: 0 } },
70
70
  children: [
71
- n.map((a) => /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(i, { variant: "body2", children: y(l[a.value], a) }) }, a.value)),
72
- c.map((a) => {
71
+ n.map((i) => /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(a, { variant: "body2", children: y(l[i.value], i) }) }, i.value)),
72
+ c.map((i) => {
73
73
  const u = F(
74
- l[a.dataFieldName],
75
- a.format
76
- ), B = p === a.dataFieldName;
74
+ l[i.dataFieldName],
75
+ i.format
76
+ ), B = p === i.dataFieldName;
77
77
  return /* @__PURE__ */ e(
78
78
  r,
79
79
  {
80
80
  align: "right",
81
- onClick: () => b(a.dataFieldName),
81
+ onClick: () => b(i.dataFieldName),
82
82
  sx: {
83
83
  cursor: "pointer",
84
84
  // Conditional background wins; otherwise tint the
@@ -86,16 +86,16 @@ const Z = (s) => {
86
86
  backgroundColor: u.backgroundColor ?? (B ? "action.hover" : void 0)
87
87
  },
88
88
  children: /* @__PURE__ */ e(
89
- i,
89
+ a,
90
90
  {
91
91
  variant: "body2",
92
92
  fontWeight: 500,
93
93
  color: u.color ?? "text.primary",
94
- children: C(l[a.dataFieldName], a.format)
94
+ children: C(l[i.dataFieldName], i)
95
95
  }
96
96
  )
97
97
  },
98
- a.dataFieldName
98
+ i.dataFieldName
99
99
  );
100
100
  })
101
101
  ]
@@ -105,7 +105,7 @@ const Z = (s) => {
105
105
  ] }) }) }),
106
106
  /* @__PURE__ */ e(f, {}),
107
107
  /* @__PURE__ */ t(X, { ownerState: o, children: [
108
- k && /* @__PURE__ */ e(q, { ownerState: o, children: /* @__PURE__ */ t(i, { variant: "caption", children: [
108
+ k && /* @__PURE__ */ e(q, { ownerState: o, children: /* @__PURE__ */ t(a, { variant: "caption", children: [
109
109
  "Hold ",
110
110
  P,
111
111
  " to scroll"
@@ -121,8 +121,8 @@ const Z = (s) => {
121
121
  rowGap: 0.5
122
122
  },
123
123
  children: [
124
- /* @__PURE__ */ e(i, { variant: "caption", fontWeight: 600, children: d.name }),
125
- d.items.map((l) => /* @__PURE__ */ t(i, { variant: "caption", color: "text.secondary", children: [
124
+ /* @__PURE__ */ e(a, { variant: "caption", fontWeight: 600, children: d.name }),
125
+ d.items.map((l) => /* @__PURE__ */ t(a, { variant: "caption", color: "text.secondary", children: [
126
126
  l.label,
127
127
  ": ",
128
128
  l.value
@@ -130,7 +130,7 @@ const Z = (s) => {
130
130
  /* @__PURE__ */ e(G, { size: "small", onClick: S, sx: { p: 0.25 }, children: /* @__PURE__ */ e(A, { size: 14 }) })
131
131
  ]
132
132
  }
133
- ) : /* @__PURE__ */ e(i, { variant: "caption", color: "text.disabled", children: "Select a column to summarize" })
133
+ ) : /* @__PURE__ */ e(a, { variant: "caption", color: "text.disabled", children: "Select a column to summarize" })
134
134
  ] })
135
135
  ]
136
136
  }
@@ -1,65 +1,56 @@
1
- import { useThemeProps as z } from "@mui/material";
2
- import j from "dayjs";
3
- import { useRef as A, useState as h, useMemo as M, useEffect as w } from "react";
4
- import { humanizeLabel as y, formatValue as Y, resolveConditionalStyle as O } from "../charts/_common/format.js";
5
- const U = (t) => {
6
- const n = t.toLowerCase();
7
- return n.includes("year") ? "YYYY" : n.includes("month") ? "MMM YYYY" : n.includes("hour") || n.includes("minute") || n.includes("time") ? "DD MMM YYYY HH:mm" : "DD MMM YYYY";
8
- }, W = (t) => {
9
- var n;
10
- return ((n = t.label) == null ? void 0 : n.trim()) || y(t.value);
11
- }, g = (t) => {
12
- var n;
13
- return ((n = t.label) == null ? void 0 : n.trim()) || y(t.name);
14
- }, X = (t, n) => {
15
- if (t == null || t === "") return "—";
16
- if (n.type !== "date") return String(t);
17
- const s = j(t);
18
- return s.isValid() ? s.format(n.dateFormat || U(n.value)) : String(t);
19
- }, L = (t, n) => {
20
- const s = t.map((a) => Number(a[n])).filter((a) => Number.isFinite(a));
21
- if (s.length === 0) return null;
22
- const f = s.length, i = s.reduce((a, u) => a + u, 0);
1
+ import { useThemeProps as A } from "@mui/material";
2
+ import { useRef as O, useState as g, useMemo as w, useEffect as h } from "react";
3
+ import { humanizeLabel as y, formatDateValue as U, formatValue as L, resolveConditionalStyle as W } from "../charts/_common/format.js";
4
+ const X = (n) => {
5
+ var o;
6
+ return ((o = n.label) == null ? void 0 : o.trim()) || y(n.value);
7
+ }, M = (n) => {
8
+ var o;
9
+ return ((o = n.label) == null ? void 0 : o.trim()) || y(n.name);
10
+ }, Y = (n, o) => n == null || n === "" ? "—" : o.type !== "date" ? String(n) : U(n, o.dateFormat, o.value), C = (n, o) => {
11
+ const c = n.map((i) => Number(i[o])).filter((i) => Number.isFinite(i));
12
+ if (c.length === 0) return null;
13
+ const f = c.length, s = c.reduce((i, a) => i + a, 0);
23
14
  return {
24
15
  count: f,
25
- sum: i,
26
- avg: i / f,
27
- min: Math.min(...s),
28
- max: Math.max(...s)
16
+ sum: s,
17
+ avg: s / f,
18
+ min: Math.min(...c),
19
+ max: Math.max(...c)
29
20
  };
30
- }, C = (t) => t.key === "Meta" || t.key === "Control", J = (t) => {
31
- const n = z({ props: t, name: "HCSimplePivotTable" }), {
32
- title: s,
21
+ }, E = (n) => n.key === "Meta" || n.key === "Control", G = (n) => {
22
+ const o = A({ props: n, name: "HCSimplePivotTable" }), {
23
+ title: c,
33
24
  description: f,
34
- data: i = [],
35
- dimensions: a = [],
36
- values: u = [],
37
- sx: E,
38
- ...x
39
- } = n, b = A(null), [D, F] = h(!1), [c, S] = h(null), k = M(() => typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform) ? "⌘" : "Ctrl", []);
40
- w(() => {
25
+ data: s = [],
26
+ dimensions: i = [],
27
+ values: a = [],
28
+ sx: x,
29
+ ...F
30
+ } = o, b = O(null), [k, P] = g(!1), [u, S] = g(null), N = w(() => typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform) ? "⌘" : "Ctrl", []);
31
+ h(() => {
41
32
  const e = b.current;
42
33
  if (!e) return;
43
- const o = () => F(e.scrollHeight > e.clientHeight + 1);
44
- o();
45
- const l = new ResizeObserver(o);
34
+ const t = () => P(e.scrollHeight > e.clientHeight + 1);
35
+ t();
36
+ const l = new ResizeObserver(t);
46
37
  return l.observe(e), () => l.disconnect();
47
- }, [i, a, u]), w(() => {
38
+ }, [s, i, a]), h(() => {
48
39
  const e = b.current;
49
40
  if (!e) return;
50
- const o = () => {
41
+ const t = () => {
51
42
  e.style.overflow = "auto";
52
43
  }, l = () => {
53
44
  e.style.overflow = "hidden";
54
45
  };
55
46
  l();
56
47
  const m = (r) => {
57
- C(r) && o();
48
+ E(r) && t();
58
49
  }, v = (r) => {
59
- C(r) && l();
50
+ E(r) && l();
60
51
  }, p = (r) => {
61
52
  if (!(r.ctrlKey || r.metaKey)) return;
62
- r.preventDefault(), o();
53
+ r.preventDefault(), t();
63
54
  const d = r.deltaMode === 1 ? 16 : 1;
64
55
  e.scrollTop += r.deltaY * d, e.scrollLeft += r.deltaX * d;
65
56
  };
@@ -67,51 +58,51 @@ const U = (t) => {
67
58
  window.removeEventListener("keydown", m), window.removeEventListener("keyup", v), window.removeEventListener("blur", l), e.removeEventListener("wheel", p);
68
59
  };
69
60
  }, []);
70
- const P = M(
71
- () => u.map((e) => {
72
- const o = L(i, e.dataFieldName);
73
- return o ? { field: e.dataFieldName, name: e.name, ...o } : null;
61
+ const D = w(
62
+ () => a.map((e) => {
63
+ const t = C(s, e.dataFieldName);
64
+ return t ? { field: e.dataFieldName, name: e.name, ...t } : null;
74
65
  }).filter((e) => e !== null),
75
- [u, i]
76
- ), H = M(() => {
66
+ [a, s]
67
+ ), K = w(() => {
77
68
  var r;
78
- if (!c) return null;
79
- const e = u.find((d) => d.dataFieldName === c), o = e ? g(e) : y(c), l = L(i, c);
69
+ if (!u) return null;
70
+ const e = a.find((d) => d.dataFieldName === u), t = e ? M(e) : y(u), l = C(s, u);
80
71
  if (!l)
81
- return { field: c, name: o, items: [{ label: "Count", value: String(i.length) }] };
82
- const m = (d) => Y(d, e == null ? void 0 : e.format), v = !!((r = e == null ? void 0 : e.format) != null && r.suffix) && e.format.suffix.includes("%"), p = [
72
+ return { field: u, name: t, items: [{ label: "Count", value: String(s.length) }] };
73
+ const m = (d) => L(d, e == null ? void 0 : e.format), v = !!((r = e == null ? void 0 : e.format) != null && r.suffix) && e.format.suffix.includes("%"), p = [
83
74
  { label: "Count", value: String(l.count) },
84
75
  ...v ? [] : [{ label: "Sum", value: m(l.sum) }],
85
76
  { label: "Avg", value: m(l.avg) },
86
77
  { label: "Min", value: m(l.min) },
87
78
  { label: "Max", value: m(l.max) }
88
79
  ];
89
- return { field: c, name: o, items: p };
90
- }, [c, u, i]), N = (e, o) => Y(e, o), K = (e, o) => O(e, o), T = (e) => S((o) => o === e ? null : e), R = () => S(null), V = { ...n };
80
+ return { field: u, name: t, items: p };
81
+ }, [u, a, s]), T = (e, t) => L(e, t == null ? void 0 : t.format, void 0, t == null ? void 0 : t.name), H = (e, t) => W(e, t), R = (e) => S((t) => t === e ? null : e), V = () => S(null), z = { ...o };
91
82
  return {
92
- title: s,
83
+ title: c,
93
84
  description: f,
94
- dimensions: a,
95
- values: u,
96
- data: i,
97
- summaries: P,
98
- selectedField: c,
99
- selectedSummary: H,
100
- selectColumn: T,
101
- clearSelection: R,
102
- dimensionLabel: W,
103
- valueLabel: g,
104
- formatDimensionValue: X,
105
- formatCell: N,
106
- getCellStyle: K,
107
- ownerState: V,
85
+ dimensions: i,
86
+ values: a,
87
+ data: s,
88
+ summaries: D,
89
+ selectedField: u,
90
+ selectedSummary: K,
91
+ selectColumn: R,
92
+ clearSelection: V,
93
+ dimensionLabel: X,
94
+ valueLabel: M,
95
+ formatDimensionValue: Y,
96
+ formatCell: T,
97
+ getCellStyle: H,
98
+ ownerState: z,
108
99
  scrollRef: b,
109
- canScroll: D,
110
- scrollModifierLabel: k,
111
- sx: E,
112
- other: x
100
+ canScroll: k,
101
+ scrollModifierLabel: N,
102
+ sx: x,
103
+ other: F
113
104
  };
114
105
  };
115
106
  export {
116
- J as useSimplePivotTableLogic
107
+ G as useSimplePivotTableLogic
117
108
  };