@12-apps/ui 6.85.0 → 6.86.1
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/_internal/components/data-display/Alert/Alert.js +2 -2
- package/dist/_internal/components/data-display/CardKit/card-actions-context.js +3 -3
- package/dist/_internal/components/data-display/CardKit/use-remove-confirm.js +4 -4
- package/dist/_internal/components/data-display/Carousel/Carousel.js +2 -2
- package/dist/_internal/components/data-display/DataGrid/DataGrid.js +2 -2
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +20 -20
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +24 -24
- package/dist/_internal/components/data-display/DataViews/base-list-card-geometry.js +1 -1
- package/dist/_internal/components/data-display/DataViews/base-list-card-layout.js +1 -1
- package/dist/_internal/components/data-display/DataViews/base-list-card.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-grid-bodies.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +13 -13
- package/dist/_internal/components/data-display/DataViews/data-views-scope-tabs.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +4 -4
- package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +3 -3
- package/dist/_internal/components/data-display/DataViews/use-data-views-state.js +2 -2
- package/dist/_internal/components/data-display/FleetMap/FleetBody.js +13 -13
- package/dist/_internal/components/data-display/FleetMap/FleetCanvas.js +12 -12
- package/dist/_internal/components/data-display/FleetMap/FleetMap.js +14 -14
- package/dist/_internal/components/data-display/Lightbox/Lightbox.js +4 -4
- package/dist/_internal/components/data-display/MapPreview/MapDecorations.js +2 -2
- package/dist/_internal/components/data-display/MapPreview/MapLayers.js +2 -2
- package/dist/_internal/components/data-display/MapPreview/MapMarkers.js +2 -2
- package/dist/_internal/components/data-display/MapPreview/MapPreview.hooks.js +2 -2
- package/dist/_internal/components/data-display/MapPreview/MapPreview.js +11 -11
- package/dist/_internal/components/data-display/MapPreview/MapTiles.js +2 -2
- package/dist/_internal/components/data-display/MapPreview/StaticMapView.js +4 -4
- package/dist/_internal/components/data-display/MapPreview/useMapPreview.js +3 -3
- package/dist/_internal/components/data-display/RegionMap/RegionMap.js +3 -2
- package/dist/_internal/components/data-display/RegionMap/RegionMap.labels.js +12 -0
- package/dist/_internal/components/data-display/RegionMap/RegionMap.labels.js.map +1 -0
- package/dist/_internal/components/data-display/RegionMap/RegionMapDrawing.js +2 -1
- package/dist/_internal/components/data-display/index.js +27 -26
- package/dist/_internal/components/feedback/NotificationStatusNotice/NotificationStatusNotice.js +3 -3
- package/dist/_internal/components/feedback/SequenceResolver/SequenceResolver.js +4 -4
- package/dist/_internal/components/feedback/SequenceResolver/SequenceResolver.parts.js +3 -3
- package/dist/_internal/components/feedback/index.js +5 -5
- package/dist/_internal/components/form/total-form/Fields/SelectField.js +1 -1
- package/dist/_internal/components/form/total-form/Fields/ToggleField.js +1 -1
- package/dist/_internal/components/form/total-form/Fields/index.js +3 -3
- package/dist/_internal/components/index.js +30 -29
- package/dist/{chunk-T6QVM5Q5.js → chunk-4LUWZ6UE.js} +2 -2
- package/dist/{chunk-JKIKHWD2.js → chunk-5NT2M2JI.js} +4 -4
- package/dist/{chunk-I7JUAHUO.js → chunk-65KJLPF5.js} +3 -3
- package/dist/{chunk-C74PDNTF.js → chunk-67ADHGA2.js} +2 -2
- package/dist/{chunk-GCBWZ3MX.js → chunk-6YSGP2WS.js} +2 -1
- package/dist/{chunk-GCBWZ3MX.js.map → chunk-6YSGP2WS.js.map} +1 -1
- package/dist/{chunk-ZLVRCQPG.js → chunk-A5CKUJP2.js} +5 -5
- package/dist/{chunk-A63WU4UZ.js → chunk-AKE6KVQG.js} +70 -41
- package/dist/chunk-AKE6KVQG.js.map +1 -0
- package/dist/{chunk-75I42HHE.js → chunk-AYJGRQT4.js} +2 -1
- package/dist/{chunk-75I42HHE.js.map → chunk-AYJGRQT4.js.map} +1 -1
- package/dist/{chunk-XMWTVDQN.js → chunk-B32554CQ.js} +12 -12
- package/dist/{chunk-OA6T2ME3.js → chunk-BLZDSCIZ.js} +4 -4
- package/dist/{chunk-OZYUE2BI.js → chunk-CJUK32UH.js} +4 -4
- package/dist/{chunk-HWPQKHN2.js → chunk-COKPPU42.js} +7 -7
- package/dist/{chunk-U4WAAZXJ.js → chunk-DVX4HDNP.js} +2 -2
- package/dist/{chunk-CESGZRVQ.js → chunk-EMSMJRP3.js} +4 -4
- package/dist/{chunk-IFX5KP65.js → chunk-EXVCVXFX.js} +4 -4
- package/dist/{chunk-U3HGQHEO.js → chunk-H7CZRKN7.js} +4 -4
- package/dist/{chunk-5ZC7CNU4.js → chunk-I2LMLQGQ.js} +2 -2
- package/dist/chunk-J3AWGTJY.js +29 -0
- package/dist/chunk-J3AWGTJY.js.map +1 -0
- package/dist/{chunk-K6VEN5VN.js → chunk-K3PMMW23.js} +4 -4
- package/dist/{chunk-YHPSPFU5.js → chunk-LIN4A2BW.js} +4 -4
- package/dist/{chunk-LXMFHD7M.js → chunk-LTSVYILY.js} +4 -4
- package/dist/{chunk-IEAPXS57.js → chunk-MW7P2C2C.js} +2 -2
- package/dist/{chunk-JVTZ7FWR.js → chunk-NCI74EOS.js} +4 -4
- package/dist/{chunk-IMCSY2SI.js → chunk-OKRITX4S.js} +7 -7
- package/dist/{chunk-LRQT4MQO.js → chunk-PJNIJIE6.js} +2 -2
- package/dist/{chunk-2WVHZIWP.js → chunk-QSRZOXQI.js} +2 -2
- package/dist/{chunk-IF5UY3CT.js → chunk-QVDEGBME.js} +4 -4
- package/dist/{chunk-XNMU32XC.js → chunk-TMUGBHHG.js} +2 -2
- package/dist/{chunk-LH3YT5NL.js → chunk-TVDHA7BT.js} +3 -3
- package/dist/{chunk-AWUFS2ZC.js → chunk-U2DRE36S.js} +4 -4
- package/dist/{chunk-NEYZV6V5.js → chunk-UAOE3ZPC.js} +6 -6
- package/dist/{chunk-VHGHF537.js → chunk-V4CWJ7Q6.js} +2 -2
- package/dist/{chunk-3OL2TSEJ.js → chunk-WNNA6YYE.js} +2 -2
- package/dist/{chunk-T6YTDEY4.js → chunk-WXZCNHBX.js} +2 -2
- package/dist/{chunk-5XTPEA3O.js → chunk-ZHYLOB7Q.js} +2 -2
- package/dist/{chunk-ARMKSYEQ.js → chunk-ZO2GZRZS.js} +2 -2
- package/dist/data-display/Alert.js +2 -2
- package/dist/data-display/CardKit.js +7 -7
- package/dist/data-display/Carousel.js +2 -2
- package/dist/data-display/DataGrid.js +2 -2
- package/dist/data-display/DataViews.js +31 -31
- package/dist/data-display/FleetMap.js +14 -14
- package/dist/data-display/Lightbox.js +4 -4
- package/dist/data-display/MapPreview.js +11 -11
- package/dist/data-display/RegionMap.js +3 -2
- package/dist/feedback/NotificationStatusNotice.js +3 -3
- package/dist/feedback/SequenceResolver.js +4 -4
- package/dist/form/total-form.js +3 -3
- package/dist/types/components/data-display/RegionMap/RegionMap.labels.d.ts +42 -0
- package/dist/types/components/data-display/RegionMap/RegionMap.labels.d.ts.map +1 -0
- package/dist/types/components/data-display/RegionMap/RegionMapDrawing.d.ts.map +1 -1
- package/dist/types/components/form/total-form/Fields/SelectField.d.ts.map +1 -1
- package/dist/types/components/form/total-form/Fields/ToggleField.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/data-display/RegionMap/RegionMap.labels.ts +60 -0
- package/src/components/data-display/RegionMap/RegionMapDrawing.tsx +87 -45
- package/src/components/form/total-form/Fields/SelectField.tsx +4 -0
- package/src/components/form/total-form/Fields/ToggleField.tsx +3 -0
- package/dist/chunk-A63WU4UZ.js.map +0 -1
- /package/dist/{chunk-T6QVM5Q5.js.map → chunk-4LUWZ6UE.js.map} +0 -0
- /package/dist/{chunk-JKIKHWD2.js.map → chunk-5NT2M2JI.js.map} +0 -0
- /package/dist/{chunk-I7JUAHUO.js.map → chunk-65KJLPF5.js.map} +0 -0
- /package/dist/{chunk-C74PDNTF.js.map → chunk-67ADHGA2.js.map} +0 -0
- /package/dist/{chunk-ZLVRCQPG.js.map → chunk-A5CKUJP2.js.map} +0 -0
- /package/dist/{chunk-XMWTVDQN.js.map → chunk-B32554CQ.js.map} +0 -0
- /package/dist/{chunk-OA6T2ME3.js.map → chunk-BLZDSCIZ.js.map} +0 -0
- /package/dist/{chunk-OZYUE2BI.js.map → chunk-CJUK32UH.js.map} +0 -0
- /package/dist/{chunk-HWPQKHN2.js.map → chunk-COKPPU42.js.map} +0 -0
- /package/dist/{chunk-U4WAAZXJ.js.map → chunk-DVX4HDNP.js.map} +0 -0
- /package/dist/{chunk-CESGZRVQ.js.map → chunk-EMSMJRP3.js.map} +0 -0
- /package/dist/{chunk-IFX5KP65.js.map → chunk-EXVCVXFX.js.map} +0 -0
- /package/dist/{chunk-U3HGQHEO.js.map → chunk-H7CZRKN7.js.map} +0 -0
- /package/dist/{chunk-5ZC7CNU4.js.map → chunk-I2LMLQGQ.js.map} +0 -0
- /package/dist/{chunk-K6VEN5VN.js.map → chunk-K3PMMW23.js.map} +0 -0
- /package/dist/{chunk-YHPSPFU5.js.map → chunk-LIN4A2BW.js.map} +0 -0
- /package/dist/{chunk-LXMFHD7M.js.map → chunk-LTSVYILY.js.map} +0 -0
- /package/dist/{chunk-IEAPXS57.js.map → chunk-MW7P2C2C.js.map} +0 -0
- /package/dist/{chunk-JVTZ7FWR.js.map → chunk-NCI74EOS.js.map} +0 -0
- /package/dist/{chunk-IMCSY2SI.js.map → chunk-OKRITX4S.js.map} +0 -0
- /package/dist/{chunk-LRQT4MQO.js.map → chunk-PJNIJIE6.js.map} +0 -0
- /package/dist/{chunk-2WVHZIWP.js.map → chunk-QSRZOXQI.js.map} +0 -0
- /package/dist/{chunk-IF5UY3CT.js.map → chunk-QVDEGBME.js.map} +0 -0
- /package/dist/{chunk-XNMU32XC.js.map → chunk-TMUGBHHG.js.map} +0 -0
- /package/dist/{chunk-LH3YT5NL.js.map → chunk-TVDHA7BT.js.map} +0 -0
- /package/dist/{chunk-AWUFS2ZC.js.map → chunk-U2DRE36S.js.map} +0 -0
- /package/dist/{chunk-NEYZV6V5.js.map → chunk-UAOE3ZPC.js.map} +0 -0
- /package/dist/{chunk-VHGHF537.js.map → chunk-V4CWJ7Q6.js.map} +0 -0
- /package/dist/{chunk-3OL2TSEJ.js.map → chunk-WNNA6YYE.js.map} +0 -0
- /package/dist/{chunk-T6YTDEY4.js.map → chunk-WXZCNHBX.js.map} +0 -0
- /package/dist/{chunk-5XTPEA3O.js.map → chunk-ZHYLOB7Q.js.map} +0 -0
- /package/dist/{chunk-ARMKSYEQ.js.map → chunk-ZO2GZRZS.js.map} +0 -0
|
@@ -1,39 +1,40 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DataViewsTableBase
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-A5CKUJP2.js";
|
|
4
|
+
import "../chunk-CPZGFIFH.js";
|
|
4
5
|
import {
|
|
5
6
|
DataViewsGrid
|
|
6
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-65KJLPF5.js";
|
|
7
8
|
import {
|
|
8
9
|
BaseCard
|
|
9
10
|
} from "../chunk-D34PZJH3.js";
|
|
10
|
-
import "../chunk-CPZGFIFH.js";
|
|
11
11
|
import {
|
|
12
12
|
BaseListCard
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-LIN4A2BW.js";
|
|
14
14
|
import "../chunk-E6K2UZGR.js";
|
|
15
15
|
import "../chunk-QO7UJXXO.js";
|
|
16
16
|
import "../chunk-UMOHHWXY.js";
|
|
17
|
+
import "../chunk-CSJ7WNXU.js";
|
|
17
18
|
import "../chunk-2JCRNWHE.js";
|
|
18
19
|
import "../chunk-KLCSVYHL.js";
|
|
19
|
-
import "../chunk-CSJ7WNXU.js";
|
|
20
20
|
import {
|
|
21
21
|
DragContainerProvider,
|
|
22
22
|
DropIndicator,
|
|
23
23
|
useDragItem
|
|
24
24
|
} from "../chunk-K4EKTMTC.js";
|
|
25
25
|
import "../chunk-ZOLAYP2D.js";
|
|
26
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-B32554CQ.js";
|
|
27
27
|
import "../chunk-NTRWUDP6.js";
|
|
28
|
+
import "../chunk-52RHAAIH.js";
|
|
29
|
+
import "../chunk-QLJU7UUI.js";
|
|
28
30
|
import "../chunk-X3AFXHY5.js";
|
|
29
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-67ADHGA2.js";
|
|
30
32
|
import {
|
|
31
33
|
DataViewsBoard
|
|
32
34
|
} from "../chunk-7TCOYCD7.js";
|
|
33
35
|
import "../chunk-KR4TN3OF.js";
|
|
34
36
|
import "../chunk-OPY2AGAU.js";
|
|
35
|
-
import "../chunk-
|
|
36
|
-
import "../chunk-QLJU7UUI.js";
|
|
37
|
+
import "../chunk-K6WY2CHG.js";
|
|
37
38
|
import "../chunk-WWH674WU.js";
|
|
38
39
|
import "../chunk-OQN2FHEL.js";
|
|
39
40
|
import "../chunk-V6KQ5R4T.js";
|
|
@@ -46,26 +47,36 @@ import "../chunk-YOPMXGHY.js";
|
|
|
46
47
|
import "../chunk-AT6UKTH4.js";
|
|
47
48
|
import "../chunk-7D7CJRL7.js";
|
|
48
49
|
import "../chunk-CBOB5AV6.js";
|
|
49
|
-
import "../chunk-K6WY2CHG.js";
|
|
50
50
|
import "../chunk-5YDS6HO3.js";
|
|
51
51
|
import "../chunk-GLR5MSU3.js";
|
|
52
52
|
import "../chunk-ACBHZG3Z.js";
|
|
53
|
-
import "../chunk-
|
|
53
|
+
import "../chunk-K3PMMW23.js";
|
|
54
54
|
import "../chunk-O5UGAL2V.js";
|
|
55
55
|
import "../chunk-GCZJH4XL.js";
|
|
56
56
|
import "../chunk-G6EJLEVV.js";
|
|
57
|
-
import "../chunk-
|
|
57
|
+
import "../chunk-4LUWZ6UE.js";
|
|
58
58
|
import "../chunk-WMAS6DZR.js";
|
|
59
59
|
import "../chunk-FZEDQNUN.js";
|
|
60
60
|
import "../chunk-5M4TYFR3.js";
|
|
61
|
-
import "../chunk-
|
|
62
|
-
import "../chunk-
|
|
61
|
+
import "../chunk-I2LMLQGQ.js";
|
|
62
|
+
import "../chunk-U2DRE36S.js";
|
|
63
|
+
import "../chunk-VYQZ5U3N.js";
|
|
63
64
|
import "../chunk-FCLON3MO.js";
|
|
64
65
|
import "../chunk-WSAUWJFO.js";
|
|
65
66
|
import "../chunk-YEGZIYVM.js";
|
|
66
67
|
import "../chunk-YLGY3D52.js";
|
|
67
|
-
import "../chunk-VYQZ5U3N.js";
|
|
68
68
|
import "../chunk-4IE66GY2.js";
|
|
69
|
+
import "../chunk-H7CZRKN7.js";
|
|
70
|
+
import "../chunk-ULAZDF6D.js";
|
|
71
|
+
import "../chunk-YGQX7BNI.js";
|
|
72
|
+
import "../chunk-LLZWB32X.js";
|
|
73
|
+
import {
|
|
74
|
+
DataViewsScopeTabs,
|
|
75
|
+
assertNoScopePillOverlap,
|
|
76
|
+
resolveScope
|
|
77
|
+
} from "../chunk-PL2AB5HJ.js";
|
|
78
|
+
import "../chunk-WTOA52EQ.js";
|
|
79
|
+
import "../chunk-IMLIIW77.js";
|
|
69
80
|
import "../chunk-DUVH273U.js";
|
|
70
81
|
import {
|
|
71
82
|
DEFAULT_RAILS,
|
|
@@ -81,21 +92,10 @@ import {
|
|
|
81
92
|
DEFAULT_CELL_WIDTH
|
|
82
93
|
} from "../chunk-F5S5UFGD.js";
|
|
83
94
|
import "../chunk-ZMUXC3VB.js";
|
|
95
|
+
import "../chunk-OOLES6RR.js";
|
|
84
96
|
import "../chunk-ENJOBJPK.js";
|
|
85
97
|
import "../chunk-B2JSUFDX.js";
|
|
86
98
|
import "../chunk-DZEC6RFM.js";
|
|
87
|
-
import "../chunk-U3HGQHEO.js";
|
|
88
|
-
import "../chunk-ULAZDF6D.js";
|
|
89
|
-
import "../chunk-YGQX7BNI.js";
|
|
90
|
-
import {
|
|
91
|
-
DataViewsScopeTabs,
|
|
92
|
-
assertNoScopePillOverlap,
|
|
93
|
-
resolveScope
|
|
94
|
-
} from "../chunk-PL2AB5HJ.js";
|
|
95
|
-
import "../chunk-WTOA52EQ.js";
|
|
96
|
-
import "../chunk-IMLIIW77.js";
|
|
97
|
-
import "../chunk-LLZWB32X.js";
|
|
98
|
-
import "../chunk-OOLES6RR.js";
|
|
99
99
|
import {
|
|
100
100
|
CARD_ASPECT_RATIOS,
|
|
101
101
|
DATA_VIEWS_LAYOUTS,
|
|
@@ -190,20 +190,20 @@ import "../chunk-AL5E624U.js";
|
|
|
190
190
|
import "../chunk-GYXUCS37.js";
|
|
191
191
|
import "../chunk-LV7LSPBF.js";
|
|
192
192
|
import "../chunk-L5CPOEDP.js";
|
|
193
|
-
import "../chunk-
|
|
193
|
+
import "../chunk-BLZDSCIZ.js";
|
|
194
|
+
import "../chunk-LDROG4QI.js";
|
|
194
195
|
import "../chunk-5RYPVYWP.js";
|
|
195
196
|
import "../chunk-K6FW4YDA.js";
|
|
196
197
|
import "../chunk-EARWC6PD.js";
|
|
197
|
-
import "../chunk-LDROG4QI.js";
|
|
198
198
|
import "../chunk-G3E66C6J.js";
|
|
199
199
|
import "../chunk-SNCSGLJ6.js";
|
|
200
200
|
import "../chunk-UMICTXMP.js";
|
|
201
201
|
import "../chunk-NUGT7LMR.js";
|
|
202
|
-
import "../chunk-
|
|
202
|
+
import "../chunk-QVDEGBME.js";
|
|
203
203
|
import "../chunk-7HZ36QDH.js";
|
|
204
204
|
import "../chunk-L5RS6QAT.js";
|
|
205
|
-
import "../chunk-QXUXO22M.js";
|
|
206
205
|
import "../chunk-L7VH6IMR.js";
|
|
206
|
+
import "../chunk-QXUXO22M.js";
|
|
207
207
|
import "../chunk-2IBFEHIX.js";
|
|
208
208
|
import "../chunk-ZYZPSBNQ.js";
|
|
209
209
|
import "../chunk-COK65GX2.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../chunk-RQWZYD6H.js";
|
|
2
2
|
import {
|
|
3
3
|
FleetMap
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-TMUGBHHG.js";
|
|
5
5
|
import "../chunk-ZCPSND5Y.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-ZO2GZRZS.js";
|
|
7
|
+
import "../chunk-MW7P2C2C.js";
|
|
8
8
|
import "../chunk-7VUXSNVZ.js";
|
|
9
9
|
import "../chunk-BTQZ3EX3.js";
|
|
10
10
|
import {
|
|
@@ -18,21 +18,21 @@ import "../chunk-3DPPDGOF.js";
|
|
|
18
18
|
import "../chunk-7WDPC46N.js";
|
|
19
19
|
import "../chunk-QD4TM6UK.js";
|
|
20
20
|
import "../chunk-EMPVMZAB.js";
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-OKRITX4S.js";
|
|
22
|
+
import "../chunk-CJUK32UH.js";
|
|
23
|
+
import "../chunk-EXVCVXFX.js";
|
|
24
24
|
import "../chunk-ZZ4MMUBY.js";
|
|
25
25
|
import "../chunk-6WHIJPEF.js";
|
|
26
|
-
import "../chunk-NEYZV6V5.js";
|
|
27
|
-
import "../chunk-LXMFHD7M.js";
|
|
28
|
-
import "../chunk-CESGZRVQ.js";
|
|
29
|
-
import "../chunk-MIUPTZS6.js";
|
|
30
26
|
import "../chunk-CSGBHYW6.js";
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-
|
|
34
|
-
import "../chunk-H2J2MTRE.js";
|
|
27
|
+
import "../chunk-UAOE3ZPC.js";
|
|
28
|
+
import "../chunk-LTSVYILY.js";
|
|
29
|
+
import "../chunk-EMSMJRP3.js";
|
|
35
30
|
import "../chunk-4YYFZ6TE.js";
|
|
31
|
+
import "../chunk-MIUPTZS6.js";
|
|
32
|
+
import "../chunk-QSRZOXQI.js";
|
|
33
|
+
import "../chunk-5NT2M2JI.js";
|
|
34
|
+
import "../chunk-H2J2MTRE.js";
|
|
35
|
+
import "../chunk-CB6DTWD5.js";
|
|
36
36
|
import "../chunk-FEKWKWGK.js";
|
|
37
37
|
import "../chunk-PZS7N74L.js";
|
|
38
38
|
import "../chunk-AA2X5GOT.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import "../chunk-UM35GGCS.js";
|
|
2
2
|
import {
|
|
3
3
|
Lightbox_default
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-COKPPU42.js";
|
|
5
|
+
import "../chunk-T2G4LDU5.js";
|
|
5
6
|
import "../chunk-RBGUS7WO.js";
|
|
6
7
|
import "../chunk-IOCY5G43.js";
|
|
8
|
+
import "../chunk-P772HCHI.js";
|
|
7
9
|
import "../chunk-UOS7DEQZ.js";
|
|
8
10
|
import "../chunk-HZBDTPPV.js";
|
|
9
11
|
import "../chunk-WZERH7E3.js";
|
|
10
12
|
import "../chunk-BP3ZKIPE.js";
|
|
11
|
-
import "../chunk-SYGM4SHY.js";
|
|
12
|
-
import "../chunk-T2G4LDU5.js";
|
|
13
|
-
import "../chunk-P772HCHI.js";
|
|
14
13
|
import "../chunk-TEQYTEM2.js";
|
|
14
|
+
import "../chunk-SYGM4SHY.js";
|
|
15
15
|
import "../chunk-VQU3CBAL.js";
|
|
16
16
|
import "../chunk-XJAD6E3V.js";
|
|
17
17
|
import "../chunk-F5H2ZXST.js";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import "../chunk-EJDOH7IN.js";
|
|
2
2
|
import {
|
|
3
3
|
MapPreview
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-OKRITX4S.js";
|
|
5
|
+
import "../chunk-CJUK32UH.js";
|
|
6
|
+
import "../chunk-EXVCVXFX.js";
|
|
7
7
|
import "../chunk-ZZ4MMUBY.js";
|
|
8
8
|
import "../chunk-6WHIJPEF.js";
|
|
9
|
-
import "../chunk-NEYZV6V5.js";
|
|
10
|
-
import "../chunk-LXMFHD7M.js";
|
|
11
|
-
import "../chunk-CESGZRVQ.js";
|
|
12
|
-
import "../chunk-MIUPTZS6.js";
|
|
13
9
|
import "../chunk-CSGBHYW6.js";
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-H2J2MTRE.js";
|
|
10
|
+
import "../chunk-UAOE3ZPC.js";
|
|
11
|
+
import "../chunk-LTSVYILY.js";
|
|
12
|
+
import "../chunk-EMSMJRP3.js";
|
|
18
13
|
import "../chunk-4YYFZ6TE.js";
|
|
14
|
+
import "../chunk-MIUPTZS6.js";
|
|
15
|
+
import "../chunk-QSRZOXQI.js";
|
|
16
|
+
import "../chunk-5NT2M2JI.js";
|
|
17
|
+
import "../chunk-H2J2MTRE.js";
|
|
18
|
+
import "../chunk-CB6DTWD5.js";
|
|
19
19
|
import "../chunk-FEKWKWGK.js";
|
|
20
20
|
import "../chunk-PZS7N74L.js";
|
|
21
21
|
import "../chunk-AA2X5GOT.js";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import "../chunk-ACFKPE2T.js";
|
|
2
2
|
import {
|
|
3
3
|
RegionMap
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-WNNA6YYE.js";
|
|
5
|
+
import "../chunk-AKE6KVQG.js";
|
|
6
|
+
import "../chunk-J3AWGTJY.js";
|
|
6
7
|
import "../chunk-GMRQPNG3.js";
|
|
7
8
|
import {
|
|
8
9
|
decodePolyline,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import "../chunk-JQRKXMSH.js";
|
|
2
2
|
import {
|
|
3
3
|
NotificationStatusNotice
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-V4CWJ7Q6.js";
|
|
5
5
|
import "../chunk-55FFONIV.js";
|
|
6
6
|
import {
|
|
7
7
|
detectNotificationBrowser,
|
|
8
8
|
notificationUnblockSteps
|
|
9
9
|
} from "../chunk-L7BRU4UF.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-QVDEGBME.js";
|
|
11
11
|
import "../chunk-7HZ36QDH.js";
|
|
12
12
|
import "../chunk-L5RS6QAT.js";
|
|
13
|
-
import "../chunk-QXUXO22M.js";
|
|
14
13
|
import "../chunk-L7VH6IMR.js";
|
|
14
|
+
import "../chunk-QXUXO22M.js";
|
|
15
15
|
import "../chunk-5ZY3IIIG.js";
|
|
16
16
|
import "../chunk-HJJR2WGL.js";
|
|
17
17
|
import "../chunk-TAMIZE4Q.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../chunk-TWAKMV5B.js";
|
|
2
2
|
import {
|
|
3
3
|
SequenceResolver
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-ZHYLOB7Q.js";
|
|
5
5
|
import "../chunk-3LUT2C5M.js";
|
|
6
6
|
import "../chunk-5UBP2DJ4.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-WXZCNHBX.js";
|
|
8
8
|
import "../chunk-CHP3QIS3.js";
|
|
9
9
|
import "../chunk-HHPFWEJY.js";
|
|
10
10
|
import "../chunk-QOB473HS.js";
|
|
@@ -20,11 +20,11 @@ import "../chunk-AL5E624U.js";
|
|
|
20
20
|
import "../chunk-GYXUCS37.js";
|
|
21
21
|
import "../chunk-LV7LSPBF.js";
|
|
22
22
|
import "../chunk-NUGT7LMR.js";
|
|
23
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-QVDEGBME.js";
|
|
24
24
|
import "../chunk-7HZ36QDH.js";
|
|
25
25
|
import "../chunk-L5RS6QAT.js";
|
|
26
|
-
import "../chunk-QXUXO22M.js";
|
|
27
26
|
import "../chunk-L7VH6IMR.js";
|
|
27
|
+
import "../chunk-QXUXO22M.js";
|
|
28
28
|
import "../chunk-5ZY3IIIG.js";
|
|
29
29
|
import "../chunk-BA4RHQ3B.js";
|
|
30
30
|
import "../chunk-HJJR2WGL.js";
|
package/dist/form/total-form.js
CHANGED
|
@@ -9,18 +9,18 @@ import {
|
|
|
9
9
|
} from "../chunk-CPAJYJUD.js";
|
|
10
10
|
import {
|
|
11
11
|
Fields_exports
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-TVDHA7BT.js";
|
|
13
13
|
import "../chunk-YGWLMTPB.js";
|
|
14
14
|
import {
|
|
15
15
|
CategoryField
|
|
16
16
|
} from "../chunk-P4Q7JK4L.js";
|
|
17
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-AYJGRQT4.js";
|
|
18
18
|
import {
|
|
19
19
|
TextField
|
|
20
20
|
} from "../chunk-3IX2TP4I.js";
|
|
21
21
|
import {
|
|
22
22
|
SelectField
|
|
23
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-6YSGP2WS.js";
|
|
24
24
|
import {
|
|
25
25
|
FormContext,
|
|
26
26
|
useFormContext
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** Where a label's centre may go along one axis so the whole label stays in view. */
|
|
2
|
+
export declare function clampCentre(wanted: number, half: number, span: number, gap: number): number;
|
|
3
|
+
/** An area that may carry a label, as {@link labelOrder} ranks it. */
|
|
4
|
+
interface Labelable {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
excluded?: boolean;
|
|
8
|
+
geometry: {
|
|
9
|
+
area: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The order labels claim their place in: highlighted first (what the person is
|
|
14
|
+
* looking for), then excluded, then the larger area, then by name. When two
|
|
15
|
+
* labels would overlap, the earlier one is drawn and the later one hidden.
|
|
16
|
+
*/
|
|
17
|
+
export declare function labelOrder<T extends Labelable>(areas: readonly T[], highlighted: ReadonlySet<string>): T[];
|
|
18
|
+
/** A label measured in the drawing: where it wants to be (fractions), and its size in px. */
|
|
19
|
+
export interface LabelBox {
|
|
20
|
+
fractionX: number;
|
|
21
|
+
fractionY: number;
|
|
22
|
+
spanX: number;
|
|
23
|
+
spanY: number;
|
|
24
|
+
}
|
|
25
|
+
/** Where each label goes, in px, and whether it is drawn at all. */
|
|
26
|
+
export interface PlacedLabel {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
visible: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Lay labels out in priority order ({@link labelOrder}): each is pulled inside
|
|
33
|
+
* the drawing by its own size, and one whose box would overlap a label already
|
|
34
|
+
* drawn is hidden — the area keeps its name in its `<title>` and in the list,
|
|
35
|
+
* so hiding costs nothing but the clutter two names over each other made.
|
|
36
|
+
*/
|
|
37
|
+
export declare function placeLabels(labels: readonly LabelBox[], box: {
|
|
38
|
+
spanX: number;
|
|
39
|
+
spanY: number;
|
|
40
|
+
}, gap: number): PlacedLabel[];
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=RegionMap.labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RegionMap.labels.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/RegionMap/RegionMap.labels.ts"],"names":[],"mappings":"AAEA,qFAAqF;AACrF,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAG3F;AAED,sEAAsE;AACtE,UAAU,SAAS;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAK1G;AAED,6FAA6F;AAC7F,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oEAAoE;AACpE,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,EAAE,GAAG,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,EAAE,MAAM,GAAG,WAAW,EAAE,CAU1H"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegionMapDrawing.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/RegionMap/RegionMapDrawing.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAsD,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACxG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"RegionMapDrawing.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/RegionMap/RegionMapDrawing.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAsD,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACxG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGxD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,cAAc,GAAG;QAAE,IAAI,EAAE,QAAQ,CAAA;KAAE,CAAC;IAC3C,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;CACd;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,UAAU,EACV,cAAc,EACd,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAM,EACN,KAAK,GACN,EAAE,qBAAqB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA4D3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/total-form/Fields/SelectField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,sDAAsD;AACtD,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,gBAAgB,GAAG,KAAK,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"SelectField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/total-form/Fields/SelectField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,sDAAsD;AACtD,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,gBAAgB,GAAG,KAAK,CAAC,YAAY,CA+BvG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/total-form/Fields/ToggleField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,sDAAsD;AACtD,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,gBAAgB,GAAG,KAAK,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"ToggleField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/total-form/Fields/ToggleField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,sDAAsD;AACtD,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,gBAAgB,GAAG,KAAK,CAAC,YAAY,CAgC1F"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// How the labels over a RegionMap drawing are ranked and laid out.
|
|
2
|
+
|
|
3
|
+
/** Where a label's centre may go along one axis so the whole label stays in view. */
|
|
4
|
+
export function clampCentre(wanted: number, half: number, span: number, gap: number): number {
|
|
5
|
+
if (span <= 2 * (half + gap)) return span / 2;
|
|
6
|
+
return Math.min(span - half - gap, Math.max(half + gap, wanted));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** An area that may carry a label, as {@link labelOrder} ranks it. */
|
|
10
|
+
interface Labelable {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
excluded?: boolean;
|
|
14
|
+
geometry: { area: number };
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The order labels claim their place in: highlighted first (what the person is
|
|
19
|
+
* looking for), then excluded, then the larger area, then by name. When two
|
|
20
|
+
* labels would overlap, the earlier one is drawn and the later one hidden.
|
|
21
|
+
*/
|
|
22
|
+
export function labelOrder<T extends Labelable>(areas: readonly T[], highlighted: ReadonlySet<string>): T[] {
|
|
23
|
+
const rank = (area: T): number => (highlighted.has(area.id) ? 0 : area.excluded ? 1 : 2);
|
|
24
|
+
return [...areas].sort(
|
|
25
|
+
(a, b) => rank(a) - rank(b) || b.geometry.area - a.geometry.area || a.name.localeCompare(b.name),
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** A label measured in the drawing: where it wants to be (fractions), and its size in px. */
|
|
30
|
+
export interface LabelBox {
|
|
31
|
+
fractionX: number;
|
|
32
|
+
fractionY: number;
|
|
33
|
+
spanX: number;
|
|
34
|
+
spanY: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Where each label goes, in px, and whether it is drawn at all. */
|
|
38
|
+
export interface PlacedLabel {
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
visible: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Lay labels out in priority order ({@link labelOrder}): each is pulled inside
|
|
46
|
+
* the drawing by its own size, and one whose box would overlap a label already
|
|
47
|
+
* drawn is hidden — the area keeps its name in its `<title>` and in the list,
|
|
48
|
+
* so hiding costs nothing but the clutter two names over each other made.
|
|
49
|
+
*/
|
|
50
|
+
export function placeLabels(labels: readonly LabelBox[], box: { spanX: number; spanY: number }, gap: number): PlacedLabel[] {
|
|
51
|
+
const kept: { x0: number; y0: number; x1: number; y1: number }[] = [];
|
|
52
|
+
return labels.map((label) => {
|
|
53
|
+
const x = clampCentre(label.fractionX * box.spanX, label.spanX / 2, box.spanX, gap);
|
|
54
|
+
const y = clampCentre(label.fractionY * box.spanY, label.spanY / 2, box.spanY, gap);
|
|
55
|
+
const rect = { x0: x - label.spanX / 2, y0: y - label.spanY / 2, x1: x + label.spanX / 2, y1: y + label.spanY / 2 };
|
|
56
|
+
const visible = !kept.some((o) => rect.x0 < o.x1 && o.x0 < rect.x1 && rect.y0 < o.y1 && o.y0 < rect.y1);
|
|
57
|
+
if (visible) kept.push(rect);
|
|
58
|
+
return { x, y, visible };
|
|
59
|
+
});
|
|
60
|
+
}
|
|
@@ -7,6 +7,7 @@ import { rem, remPx } from '../../../tokens/relative';
|
|
|
7
7
|
|
|
8
8
|
import { labelPosition, type AreaGeometry, type DrawnRegion, type PlaneBox } from './RegionMap.helpers';
|
|
9
9
|
import type { RegionMapModel } from './RegionMap.hooks';
|
|
10
|
+
import { labelOrder, placeLabels } from './RegionMap.labels';
|
|
10
11
|
|
|
11
12
|
export interface RegionMapDrawingProps {
|
|
12
13
|
model: RegionMapModel & { view: PlaneBox };
|
|
@@ -43,7 +44,11 @@ export function RegionMapDrawing({
|
|
|
43
44
|
const { view, drawn } = model;
|
|
44
45
|
const wanted = new Set(highlightedIds);
|
|
45
46
|
const highlighted = drawn.filter((d) => wanted.has(d.id));
|
|
46
|
-
|
|
47
|
+
// Highlighted, then excluded, then larger, then by name: the order labels
|
|
48
|
+
// claim their place in, so a collision hides the less important one.
|
|
49
|
+
const labelled = labelOrder(drawn.filter((d) => d.excluded || wanted.has(d.id)), wanted);
|
|
50
|
+
const boxRef = React.useRef<HTMLDivElement>(null);
|
|
51
|
+
useLabelPlacement(boxRef, labelled.map((d) => d.id).join('|'), remPx(theme, 4));
|
|
47
52
|
const base = drawn.map((d) => ({ id: d.id, name: d.name, geometry: d.geometry, outside: d.outside === true }));
|
|
48
53
|
return (
|
|
49
54
|
<Box
|
|
@@ -60,6 +65,7 @@ export function RegionMapDrawing({
|
|
|
60
65
|
bgcolor: 'background.paper',
|
|
61
66
|
}}
|
|
62
67
|
data-testid={`${testId}-canvas`}
|
|
68
|
+
ref={boxRef}
|
|
63
69
|
>
|
|
64
70
|
<svg
|
|
65
71
|
viewBox={`${view.minX} ${view.minY} ${view.spanX} ${view.spanY}`}
|
|
@@ -73,19 +79,7 @@ export function RegionMapDrawing({
|
|
|
73
79
|
<BaseAreas areas={base} testId={testId} theme={theme} />
|
|
74
80
|
<ExcludedAreas drawn={drawn} hatchId={hatchId} testId={testId} theme={theme} />
|
|
75
81
|
<Circles radii={model.radii} theme={theme} />
|
|
76
|
-
{highlighted
|
|
77
|
-
<path
|
|
78
|
-
key={`h-${d.id}`}
|
|
79
|
-
d={d.geometry.path}
|
|
80
|
-
fillRule="evenodd"
|
|
81
|
-
vectorEffect="non-scaling-stroke"
|
|
82
|
-
fill={alpha(theme.palette.primary.main, 0.3)}
|
|
83
|
-
stroke={theme.palette.primary.main}
|
|
84
|
-
strokeWidth={2.5}
|
|
85
|
-
pointerEvents="none"
|
|
86
|
-
data-testid={`${testId}-highlight-${d.id}`}
|
|
87
|
-
/>
|
|
88
|
-
))}
|
|
82
|
+
<Highlights areas={highlighted} testId={testId} theme={theme} />
|
|
89
83
|
{showCenter && (
|
|
90
84
|
<circle
|
|
91
85
|
cx={0}
|
|
@@ -107,6 +101,35 @@ export function RegionMapDrawing({
|
|
|
107
101
|
);
|
|
108
102
|
}
|
|
109
103
|
|
|
104
|
+
/** The highlighted areas, drawn over everything but the centre. */
|
|
105
|
+
function Highlights({
|
|
106
|
+
areas,
|
|
107
|
+
testId,
|
|
108
|
+
theme,
|
|
109
|
+
}: {
|
|
110
|
+
areas: readonly DrawnRegion[];
|
|
111
|
+
testId: string;
|
|
112
|
+
theme: Theme;
|
|
113
|
+
}): React.JSX.Element {
|
|
114
|
+
return (
|
|
115
|
+
<>
|
|
116
|
+
{areas.map((d) => (
|
|
117
|
+
<path
|
|
118
|
+
key={`h-${d.id}`}
|
|
119
|
+
d={d.geometry.path}
|
|
120
|
+
fillRule="evenodd"
|
|
121
|
+
vectorEffect="non-scaling-stroke"
|
|
122
|
+
fill={alpha(theme.palette.primary.main, 0.3)}
|
|
123
|
+
stroke={theme.palette.primary.main}
|
|
124
|
+
strokeWidth={2.5}
|
|
125
|
+
pointerEvents="none"
|
|
126
|
+
data-testid={`${testId}-highlight-${d.id}`}
|
|
127
|
+
/>
|
|
128
|
+
))}
|
|
129
|
+
</>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
110
133
|
/** The hatch an excluded area is filled with: lines, not a colour. */
|
|
111
134
|
function Hatch({ id, pitch, theme }: { id: string; pitch: number; theme: Theme }): React.JSX.Element {
|
|
112
135
|
return (
|
|
@@ -225,16 +248,52 @@ function Circles({ radii, theme }: { radii: readonly number[]; theme: Theme }):
|
|
|
225
248
|
);
|
|
226
249
|
}
|
|
227
250
|
|
|
228
|
-
/**
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
251
|
+
/**
|
|
252
|
+
* Places every label the drawing carries, in their DOM order (the priority
|
|
253
|
+
* order), and hides one that would overlap a label already drawn
|
|
254
|
+
* (`placeLabels`). Measured by a ResizeObserver, never in a layout effect: its
|
|
255
|
+
* first call comes after the browser's own layout, so mounting a label on a
|
|
256
|
+
* tap forces no synchronous reflow of the drawing.
|
|
257
|
+
*/
|
|
258
|
+
function useLabelPlacement(boxRef: React.RefObject<HTMLDivElement | null>, key: string, gap: number): void {
|
|
259
|
+
React.useEffect(() => {
|
|
260
|
+
const box = boxRef.current;
|
|
261
|
+
if (!box || typeof ResizeObserver === 'undefined') return undefined;
|
|
262
|
+
const labels = Array.from(box.querySelectorAll<HTMLElement>('[data-region-label]'));
|
|
263
|
+
const place = (): void => {
|
|
264
|
+
const spanX = box.clientWidth;
|
|
265
|
+
const spanY = box.clientHeight;
|
|
266
|
+
if (spanX === 0 || spanY === 0) return;
|
|
267
|
+
const placed = placeLabels(
|
|
268
|
+
labels.map((label) => ({
|
|
269
|
+
fractionX: Number(label.dataset.fractionX),
|
|
270
|
+
fractionY: Number(label.dataset.fractionY),
|
|
271
|
+
spanX: label.offsetWidth,
|
|
272
|
+
spanY: label.offsetHeight,
|
|
273
|
+
})),
|
|
274
|
+
{ spanX, spanY },
|
|
275
|
+
gap,
|
|
276
|
+
);
|
|
277
|
+
placed.forEach(({ x, y, visible }, index) => {
|
|
278
|
+
const label = labels[index]!;
|
|
279
|
+
label.style.left = `${(x / spanX) * 100}%`;
|
|
280
|
+
label.style.top = `${(y / spanY) * 100}%`;
|
|
281
|
+
label.style.visibility = visible ? 'visible' : 'hidden';
|
|
282
|
+
label.dataset.hidden = visible ? 'false' : 'true';
|
|
283
|
+
});
|
|
284
|
+
};
|
|
285
|
+
const observer = new ResizeObserver(place);
|
|
286
|
+
observer.observe(box);
|
|
287
|
+
for (const label of labels) observer.observe(label);
|
|
288
|
+
return () => observer.disconnect();
|
|
289
|
+
}, [boxRef, key, gap]);
|
|
232
290
|
}
|
|
233
291
|
|
|
234
292
|
/**
|
|
235
293
|
* An area's name over the drawing, at the theme's type size whatever the
|
|
236
|
-
* width — and
|
|
237
|
-
* the
|
|
294
|
+
* width. Placed — and hidden on a collision — by {@link useLabelPlacement}.
|
|
295
|
+
* Decorative (`aria-hidden`): the area's name is its `<title>` and its row in
|
|
296
|
+
* the list.
|
|
238
297
|
*/
|
|
239
298
|
function AreaLabel({
|
|
240
299
|
area,
|
|
@@ -248,42 +307,25 @@ function AreaLabel({
|
|
|
248
307
|
theme: Theme;
|
|
249
308
|
}): React.JSX.Element {
|
|
250
309
|
const at = labelPosition(area.geometry.rings, view);
|
|
251
|
-
const ref = React.useRef<HTMLSpanElement>(null);
|
|
252
|
-
const gap = remPx(theme, 4);
|
|
253
|
-
// Measured by a ResizeObserver, never in a layout effect: the observer's
|
|
254
|
-
// first call comes after the browser's own layout, so mounting a label on a
|
|
255
|
-
// tap forces no synchronous reflow of the drawing.
|
|
256
|
-
React.useEffect(() => {
|
|
257
|
-
const label = ref.current;
|
|
258
|
-
const box = label?.parentElement;
|
|
259
|
-
if (!label || !box || typeof ResizeObserver === 'undefined') return undefined;
|
|
260
|
-
const observer = new ResizeObserver(() => {
|
|
261
|
-
const width = box.clientWidth;
|
|
262
|
-
const height = box.clientHeight;
|
|
263
|
-
if (width === 0 || height === 0) return;
|
|
264
|
-
const x = clampCentre(at.fractionX * width, label.offsetWidth / 2, width, gap);
|
|
265
|
-
const y = clampCentre(at.fractionY * height, label.offsetHeight / 2, height, gap);
|
|
266
|
-
label.style.left = `${(x / width) * 100}%`;
|
|
267
|
-
label.style.top = `${(y / height) * 100}%`;
|
|
268
|
-
});
|
|
269
|
-
observer.observe(box);
|
|
270
|
-
observer.observe(label);
|
|
271
|
-
return () => observer.disconnect();
|
|
272
|
-
}, [at.fractionX, at.fractionY, gap]);
|
|
273
310
|
const halo = `0 0 ${rem(theme, 3)} ${theme.palette.background.paper}`;
|
|
274
311
|
return (
|
|
275
312
|
<Typography
|
|
276
|
-
ref={ref}
|
|
277
313
|
component="span"
|
|
278
314
|
aria-hidden
|
|
279
315
|
data-testid={`${testId}-label-${area.id}`}
|
|
316
|
+
data-region-label=""
|
|
317
|
+
data-fraction-x={at.fractionX}
|
|
318
|
+
data-fraction-y={at.fractionY}
|
|
280
319
|
// Position as an inline style, not `sx`: a per-label class would insert
|
|
281
320
|
// a new CSS rule (and a style recalculation) on every tap.
|
|
282
|
-
style={{
|
|
321
|
+
style={{
|
|
322
|
+
left: `${(at.fractionX * 100).toFixed(2)}%`,
|
|
323
|
+
top: `${(at.fractionY * 100).toFixed(2)}%`,
|
|
324
|
+
}}
|
|
283
325
|
sx={{
|
|
284
326
|
position: 'absolute',
|
|
285
327
|
transform: 'translate(-50%, -50%)',
|
|
286
|
-
fontSize: rem(theme,
|
|
328
|
+
fontSize: rem(theme, 12),
|
|
287
329
|
fontWeight: 700,
|
|
288
330
|
lineHeight: 1.1,
|
|
289
331
|
textAlign: 'center',
|