@hybridcore/ui 1.6.11 → 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.
- package/dist/{AnimatedTheme-D3VZKKNV.js → AnimatedTheme-ktdO3Bel.js} +6 -6
- package/dist/{AxisRenderer-Doyw-FTI.js → AxisRenderer-BCQoUJw6.js} +6 -6
- package/dist/{AxisRendererY-BylCU67e.js → AxisRendererY-AXWvGU6r.js} +3 -3
- package/dist/{Bullet-C6357hTv.js → Bullet-Djj7Vs9T.js} +1 -1
- package/dist/{Button-DGOT8RcT.js → Button-BLY4PVJC.js} +3 -3
- package/dist/{CategoryAxis-B5uTZjhL.js → CategoryAxis-B6NqW8qd.js} +3 -3
- package/dist/{Circle-DhzVdFBd.js → Circle-BnfBNKBD.js} +1 -1
- package/dist/{ColorSet-DGLMpbL3.js → ColorSet-cyPmWGwh.js} +1 -1
- package/dist/{ColumnSeries-CqJ-563p.js → ColumnSeries-CtRTsn-E.js} +28 -28
- package/dist/{DateAxis-lJZjbAS-.js → DateAxis-DEXKps1S.js} +4 -4
- package/dist/{Entity-4Lr2piVN.js → Entity-BJCuhdq_.js} +14 -14
- package/dist/GaplessDateAxis-B2g2jgSG.js +376 -0
- package/dist/{Hierarchy-DPEcTr0v.js → Hierarchy-CEOK8Gzh.js} +4 -4
- package/dist/{Legend-CTb6rZz_.js → Legend-CFvQiIfn.js} +4 -4
- package/dist/{LineSeries-Dg1aytHA.js → LineSeries-D_IL2qGF.js} +4 -4
- package/dist/{LinearGradient-D1hzMjaW.js → LinearGradient-CxQyCSEB.js} +2 -2
- package/dist/{PieSeries-C9YUWMnA.js → PieSeries-CMH0Z7pz.js} +8 -8
- package/dist/{RoundedRectangle-B23Oh_r6.js → RoundedRectangle-BKLX1LKM.js} +2 -2
- package/dist/{Scrollbar-CSoXoZSe.js → Scrollbar-CTI7_8Qw.js} +4 -4
- package/dist/{Slice-CIP7Vmzu.js → Slice-BUncQh1B.js} +11 -11
- package/dist/{Tick-CRu6rQQy.js → Tick--VhF0xlz.js} +2 -2
- package/dist/{Tooltip-RhAldW7s.js → Tooltip-vyZRZWih.js} +1 -1
- package/dist/{XYCursor-Z-Ral42q.js → XYCursor-CVUSpqb9.js} +3 -3
- package/dist/{ZoomableContainer-D1laxHnA.js → ZoomableContainer-Ca_pDVYQ.js} +2 -2
- package/dist/assets/index.css +1 -1
- package/dist/assets/index2.css +1 -1
- package/dist/components/button/styled.js +1 -1
- package/dist/components/charts/_common/format.js +149 -41
- package/dist/components/charts/_common/tooltip.js +2 -2
- package/dist/components/charts/_common/utils.js +16 -11
- package/dist/components/charts/candlestick/logic.js +34 -35
- package/dist/components/charts/column-line-mix/logic.js +40 -41
- package/dist/components/charts/donut-chart/logic.js +4 -4
- package/dist/components/charts/drill-down-treemap/logic.js +5 -5
- package/dist/components/charts/drill-down-voronoi-treemap/logic.js +5 -5
- package/dist/components/charts/forecast-cone/logic.js +134 -120
- package/dist/components/charts/heatmap/logic.js +9 -9
- package/dist/components/charts/highlighting-line-data/logic.js +10 -10
- package/dist/components/charts/line/logic.js +19 -20
- package/dist/components/charts/logaritmic-scale/logic.js +30 -31
- package/dist/components/charts/multiple-value-axes/logic.js +18 -19
- package/dist/components/charts/nested-pie/logic.js +3 -3
- package/dist/components/charts/packed-circles/logic.js +7 -7
- package/dist/components/charts/pie-chart/logic.js +4 -4
- package/dist/components/charts/stacked-area-radar/logic.js +9 -9
- package/dist/components/charts/stacked-column-chart/logic.js +10 -10
- package/dist/components/charts/xy-chart/logic.js +28 -29
- package/dist/components/collapsible-card/index.js +21 -30
- package/dist/components/collapsible-card/styled.js +16 -14
- package/dist/components/color-picker/index.js +2227 -3357
- package/dist/components/color-picker/styled.js +87 -7
- package/dist/components/confirm/dialog.js +89 -8
- package/dist/components/confirm/index.js +1 -1
- package/dist/components/data-map/index.js +1 -1
- package/dist/components/data-map/logic.js +20 -20
- package/dist/components/data-security-selectors/dissemination-list/index.js +32 -3117
- package/dist/components/date-picker-with-custom-range/index.js +86 -7
- package/dist/components/date-range-picker/index.js +464 -452
- package/dist/components/document-viewer/components/viewer/index.js +1 -1
- package/dist/components/duration-select/index.js +10 -10
- package/dist/components/duration-select/styled.js +1 -1
- package/dist/components/geometry-picker/coordinate/index.js +14 -14
- package/dist/components/geometry-picker/edit/index.js +1 -1
- package/dist/components/geometry-picker/geometry/index.js +1 -1
- package/dist/components/geometry-picker/kml/index.js +11 -11
- package/dist/components/geometry-picker/map/logic.js +145 -3656
- package/dist/components/geometry-picker/map/style.js +18 -17
- package/dist/components/geometry-picker/parser/coordinate-input/logic.js +43 -1255
- package/dist/components/heat-map/index.js +1 -1
- package/dist/components/heat-map/logic.js +77 -1924
- package/dist/components/instance-hierarchy-table/styled.js +18 -16
- package/dist/components/map/helpers/mapbox.js +17 -15
- package/dist/components/map/helpers/ol.js +386 -27
- package/dist/components/map/index.js +11 -10
- package/dist/components/map/logic.js +22 -22
- package/dist/components/map/styled.js +31 -27
- package/dist/components/metric-card/MetricChart.js +9 -9
- package/dist/components/metric-card/logic.js +46 -49
- package/dist/components/phone-input/index.js +10 -9
- package/dist/components/property-mapping/index.js +1 -1
- package/dist/components/prr-map/index.js +1 -1
- package/dist/components/prr-map/logic.js +27 -26
- package/dist/components/range-selector/styled.js +65 -4228
- package/dist/components/raster-grid-map/index.js +1 -1
- package/dist/components/raster-grid-map/logic.js +60 -57
- package/dist/components/simple-pivot-table/index.js +17 -17
- package/dist/components/simple-pivot-table/logic.js +67 -76
- package/dist/components/sortable-list/index.js +1091 -1264
- package/dist/components/template-form/components/property-list/index.js +36 -33
- package/dist/components/template-form/components/property-list/property-list-columns.js +19 -18
- package/dist/components/template-form/components/property-list/property-list-form.js +137 -601
- package/dist/components/template-form/components/recognition-property-list/index.js +40 -37
- package/dist/components/template-form/components/recognition-property-list/recognition-property-list-columns.js +11 -10
- package/dist/components/template-form/components/recognition-property-list/recognition-property-list-form.js +55 -63
- package/dist/components/tree-select/index.js +16 -16
- package/dist/index.esm-UfGMjYOL.js +197 -0
- package/dist/main.d.ts +67 -8
- package/dist/main.js +176 -175
- package/package.json +1 -1
- package/dist/AccordionSummary-CJppWeqF.js +0 -781
- package/dist/Add-CqcD1PWb.js +0 -403
- package/dist/Box-DqUMmZjL.js +0 -31
- package/dist/Button-C5yquWAB.js +0 -357
- package/dist/ButtonBase-BEF7oTOe.js +0 -887
- package/dist/DataProcessor-WXzhvIg6.js +0 -83
- package/dist/Delete-BdyYpINH.js +0 -23
- package/dist/DialogContent-BvVjD9z3.js +0 -523
- package/dist/FormGroup-CpBsIyYR.js +0 -89
- package/dist/GaplessDateAxis-DowssQ6y.js +0 -296
- package/dist/IconButton-BoGwbvrP.js +0 -184
- package/dist/InputLabel-Dd8RrneV.js +0 -341
- package/dist/MenuItem-DwqJqzuM.js +0 -233
- package/dist/Modal-MUZygjmQ.js +0 -1158
- package/dist/Paper-BkQLdsCI.js +0 -582
- package/dist/Select-DHUl_uG3.js +0 -3916
- package/dist/Source-BSZST_GH.js +0 -4410
- package/dist/SwitchBase-DTndTqI8.js +0 -235
- package/dist/Text-ChJRuaD8.js +0 -2197
- package/dist/TextField-e2oKaUN1.js +0 -669
- package/dist/TransitionGroupContext-BDAp2T0O.js +0 -96
- package/dist/Typography-DgsSLCFC.js +0 -178
- package/dist/Vector-BmuhQO4p.js +0 -3606
- package/dist/Vector-DfTqQEln.js +0 -1735
- package/dist/WKT-2wsDT-nq.js +0 -2310
- package/dist/assertThisInitialized-C1dAyb4j.js +0 -7
- package/dist/assets/index3.css +0 -1
- package/dist/assets/index4.css +0 -1
- package/dist/clsx-OuTLNxxd.js +0 -16
- package/dist/createChainedFunction-C0nujS3O.js +0 -9
- package/dist/createSvgIcon-Ch_cT8az.js +0 -185
- package/dist/createSvgIcon-DuDuASu1.js +0 -62
- package/dist/debounce-46wSf_lW.js +0 -15
- package/dist/dialog-BYRnCztH.js +0 -154
- package/dist/formControlState-vgaj2ksH.js +0 -10
- package/dist/generateUtilityClasses-C3ivN9Ie.js +0 -2973
- package/dist/index-DH6qsPBn.js +0 -153
- package/dist/index-e9xTIYWt.js +0 -1934
- package/dist/index.esm-BLLrbTzY.js +0 -318
- package/dist/math-Bvt2Ubuz.js +0 -704
- package/dist/objectWithoutPropertiesLoose-DJteAcBH.js +0 -22
- package/dist/ol-yOE-NV0X.js +0 -7465
- package/dist/ownerWindow-wg6foiOE.js +0 -10
- package/dist/setPrototypeOf-NPgp4cYc.js +0 -8
- package/dist/styled-SoqbyrkW.js +0 -350
- package/dist/unsupportedProp-DuqR2hj9.js +0 -36
- package/dist/useControlled-BYdyS7Pn.js +0 -31
- package/dist/useFormControl-CatNKXAi.js +0 -10
- package/dist/useId-BW-oWmul.js +0 -19
- package/dist/useMobilePicker-CY8ndYRL.js +0 -8279
- 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-
|
|
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
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
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
|
|
10
|
-
import { createMapboxLayer as
|
|
11
|
-
import { createHeatMapScale as
|
|
12
|
-
const
|
|
13
|
-
const u = r.getGeometry(),
|
|
14
|
-
return u && u.getType() === "Point" &&
|
|
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
|
|
25
|
+
image: new Ct({
|
|
23
26
|
anchor: [0.5, 0.5],
|
|
24
|
-
src:
|
|
25
|
-
scale: S ??
|
|
27
|
+
src: i,
|
|
28
|
+
scale: S ?? Rt,
|
|
26
29
|
color: p ?? "#b32f5b"
|
|
27
30
|
}),
|
|
28
31
|
zIndex: 2
|
|
29
|
-
}) : new
|
|
32
|
+
}) : new V({
|
|
30
33
|
fill: new F({ color: "rgba(255, 255, 255, 0.25)" }),
|
|
31
|
-
stroke: new
|
|
32
|
-
image: new
|
|
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:
|
|
42
|
+
data: i,
|
|
40
43
|
payload: p,
|
|
41
44
|
onPayloadUpdate: h,
|
|
42
45
|
accessToken: y,
|
|
43
|
-
palette: w =
|
|
46
|
+
palette: w = Xt,
|
|
44
47
|
sx: S,
|
|
45
48
|
...U
|
|
46
|
-
} = u, T = xt(), I = m(ht("map-")), o = m(null),
|
|
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
|
-
},
|
|
54
|
-
var
|
|
55
|
-
if (!
|
|
56
|
-
const { result: t, rowCount: e, columnCount: n, minX: c, minY:
|
|
57
|
-
(
|
|
58
|
-
const X =
|
|
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 (
|
|
67
|
+
if (j(X), t !== null)
|
|
65
68
|
for (let g = 0; g < e; g++) {
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
69
|
+
const A = t[g];
|
|
70
|
+
if (A !== null)
|
|
68
71
|
for (let x = 0; x < n; x++) {
|
|
69
|
-
const Y =
|
|
72
|
+
const Y = A[x];
|
|
70
73
|
if (Y < 2) continue;
|
|
71
|
-
const
|
|
72
|
-
[
|
|
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:
|
|
77
|
-
topRight: { latitude:
|
|
78
|
-
}, pt = ct /
|
|
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:
|
|
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
|
-
(
|
|
90
|
+
(k = L.current) == null || k.addFeature(ft);
|
|
88
91
|
}
|
|
89
92
|
}
|
|
90
93
|
}, J = () => {
|
|
91
94
|
let t = {
|
|
92
|
-
gridLevel:
|
|
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
|
-
|
|
119
|
+
v.current && clearTimeout(v.current), v.current = setTimeout(() => {
|
|
117
120
|
var t;
|
|
118
|
-
(t = o.current) == null || t.updateSize(),
|
|
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
|
-
|
|
126
|
+
a.current && (clearTimeout(a.current), a.current = null);
|
|
124
127
|
}), (e = o.current) == null || e.on("moveend", () => {
|
|
125
|
-
|
|
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] =
|
|
130
|
-
return [e, n, c,
|
|
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 =
|
|
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),
|
|
141
|
-
const n = new Lt(), c = new
|
|
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:
|
|
146
|
+
style: Bt
|
|
144
147
|
});
|
|
145
|
-
(f = o.current) == null || f.addLayer(c),
|
|
146
|
-
const { heatGridMapFilter:
|
|
147
|
-
if (
|
|
148
|
-
const
|
|
149
|
-
o.current.centerToExtent(
|
|
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 (!
|
|
154
|
-
const t = T.palette.mode === "light" ? "mapbox://styles/mapbox/light-v11" : "mapbox://styles/mapbox/dark-v11", e = ((c = (n =
|
|
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(() => (
|
|
158
|
-
}), [
|
|
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
|
|
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(
|
|
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(
|
|
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(
|
|
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((
|
|
72
|
-
c.map((
|
|
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[
|
|
75
|
-
|
|
76
|
-
), B = p ===
|
|
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(
|
|
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
|
-
|
|
89
|
+
a,
|
|
90
90
|
{
|
|
91
91
|
variant: "body2",
|
|
92
92
|
fontWeight: 500,
|
|
93
93
|
color: u.color ?? "text.primary",
|
|
94
|
-
children: C(l[
|
|
94
|
+
children: C(l[i.dataFieldName], i)
|
|
95
95
|
}
|
|
96
96
|
)
|
|
97
97
|
},
|
|
98
|
-
|
|
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(
|
|
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(
|
|
125
|
-
d.items.map((l) => /* @__PURE__ */ t(
|
|
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(
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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:
|
|
26
|
-
avg:
|
|
27
|
-
min: Math.min(...
|
|
28
|
-
max: Math.max(...
|
|
16
|
+
sum: s,
|
|
17
|
+
avg: s / f,
|
|
18
|
+
min: Math.min(...c),
|
|
19
|
+
max: Math.max(...c)
|
|
29
20
|
};
|
|
30
|
-
},
|
|
31
|
-
const
|
|
32
|
-
title:
|
|
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:
|
|
35
|
-
dimensions:
|
|
36
|
-
values:
|
|
37
|
-
sx:
|
|
38
|
-
...
|
|
39
|
-
} =
|
|
40
|
-
|
|
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
|
|
44
|
-
|
|
45
|
-
const l = new ResizeObserver(
|
|
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
|
|
38
|
+
}, [s, i, a]), h(() => {
|
|
48
39
|
const e = b.current;
|
|
49
40
|
if (!e) return;
|
|
50
|
-
const
|
|
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
|
-
|
|
48
|
+
E(r) && t();
|
|
58
49
|
}, v = (r) => {
|
|
59
|
-
|
|
50
|
+
E(r) && l();
|
|
60
51
|
}, p = (r) => {
|
|
61
52
|
if (!(r.ctrlKey || r.metaKey)) return;
|
|
62
|
-
r.preventDefault(),
|
|
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
|
|
71
|
-
() =>
|
|
72
|
-
const
|
|
73
|
-
return
|
|
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
|
-
[
|
|
76
|
-
),
|
|
66
|
+
[a, s]
|
|
67
|
+
), K = w(() => {
|
|
77
68
|
var r;
|
|
78
|
-
if (!
|
|
79
|
-
const e =
|
|
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:
|
|
82
|
-
const m = (d) =>
|
|
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:
|
|
90
|
-
}, [
|
|
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:
|
|
83
|
+
title: c,
|
|
93
84
|
description: f,
|
|
94
|
-
dimensions:
|
|
95
|
-
values:
|
|
96
|
-
data:
|
|
97
|
-
summaries:
|
|
98
|
-
selectedField:
|
|
99
|
-
selectedSummary:
|
|
100
|
-
selectColumn:
|
|
101
|
-
clearSelection:
|
|
102
|
-
dimensionLabel:
|
|
103
|
-
valueLabel:
|
|
104
|
-
formatDimensionValue:
|
|
105
|
-
formatCell:
|
|
106
|
-
getCellStyle:
|
|
107
|
-
ownerState:
|
|
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:
|
|
110
|
-
scrollModifierLabel:
|
|
111
|
-
sx:
|
|
112
|
-
other:
|
|
100
|
+
canScroll: k,
|
|
101
|
+
scrollModifierLabel: N,
|
|
102
|
+
sx: x,
|
|
103
|
+
other: F
|
|
113
104
|
};
|
|
114
105
|
};
|
|
115
106
|
export {
|
|
116
|
-
|
|
107
|
+
G as useSimplePivotTableLogic
|
|
117
108
|
};
|