@ac-design/design-system 2.6.1 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +2 -2
  2. package/dist/lib/charts/graph.d.ts +9 -15
  3. package/dist/lib/charts/graph.js +79 -75
  4. package/dist/lib/charts/index.d.ts +4 -2
  5. package/dist/lib/charts/index.js +2 -1
  6. package/dist/lib/charts/nodeSymbol.d.ts +15 -0
  7. package/dist/lib/charts/nodeSymbol.js +27 -0
  8. package/dist/lib/charts/tree.d.ts +15 -0
  9. package/dist/lib/charts/tree.js +89 -0
  10. package/dist/lib/compat.css +113 -0
  11. package/dist/lib/components/AcAccordionItem.vue.d.ts +3 -1
  12. package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +35 -26
  13. package/dist/lib/components/AcAlert.vue.d.ts +1 -1
  14. package/dist/lib/components/AcBadge.vue.d.ts +1 -1
  15. package/dist/lib/components/AcBanner.vue.d.ts +1 -1
  16. package/dist/lib/components/AcCard.vue.d.ts +1 -1
  17. package/dist/lib/components/AcCellValue.vue.d.ts +1 -1
  18. package/dist/lib/components/AcCheckList.vue.d.ts +1 -1
  19. package/dist/lib/components/AcConfirmModal.vue.d.ts +1 -1
  20. package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
  21. package/dist/lib/components/AcFeatureCard.vue.d.ts +1 -1
  22. package/dist/lib/components/AcGraphChart.vue.d.ts +53 -3
  23. package/dist/lib/components/AcGraphChart.vue_vue_type_script_setup_true_lang.js +401 -233
  24. package/dist/lib/components/AcList.js +5 -0
  25. package/dist/lib/components/AcList.vue.d.ts +56 -0
  26. package/dist/lib/components/AcList.vue_vue_type_script_setup_true_lang.js +74 -0
  27. package/dist/lib/components/AcListItem.js +5 -0
  28. package/dist/lib/components/AcListItem.vue.d.ts +53 -0
  29. package/dist/lib/components/AcListItem.vue_vue_type_script_setup_true_lang.js +105 -0
  30. package/dist/lib/components/AcMapChart.vue.d.ts +66 -3
  31. package/dist/lib/components/AcMapChart.vue_vue_type_script_setup_true_lang.js +403 -201
  32. package/dist/lib/components/AcMonthPicker.js +5 -0
  33. package/dist/lib/components/AcMonthPicker.vue.d.ts +102 -0
  34. package/dist/lib/components/AcMonthPicker.vue_vue_type_script_setup_true_lang.js +595 -0
  35. package/dist/lib/components/AcNavbarItem.vue.d.ts +1 -1
  36. package/dist/lib/components/AcResourceCard.vue.d.ts +1 -1
  37. package/dist/lib/components/AcSideTabs.vue.d.ts +3 -1
  38. package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +53 -33
  39. package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
  40. package/dist/lib/components/AcStatCard.vue.d.ts +1 -1
  41. package/dist/lib/components/AcTreeChart.js +5 -0
  42. package/dist/lib/components/AcTreeChart.vue.d.ts +135 -0
  43. package/dist/lib/components/AcTreeChart.vue_vue_type_script_setup_true_lang.js +809 -0
  44. package/dist/lib/components/AcUsageCard.vue.d.ts +1 -1
  45. package/dist/lib/components/index.d.ts +5 -2
  46. package/dist/lib/composables/copyText.d.ts +5 -1
  47. package/dist/lib/composables/copyText.js +15 -3
  48. package/dist/lib/index.d.ts +3 -0
  49. package/dist/lib/index.js +85 -81
  50. package/package.json +1 -1
@@ -3,23 +3,32 @@ import { statusMeta as t } from "./status.js";
3
3
  import n from "../charts/ChartFrame.js";
4
4
  import { bindItemHover as r, loadOnce as i, useEChart as a } from "../charts/echarts.js";
5
5
  import { chartColor as o, formatCompact as s } from "../charts/shared.js";
6
- import { computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createSlots as p, createTextVNode as ee, createVNode as m, defineComponent as h, getCurrentInstance as te, normalizeStyle as g, openBlock as _, ref as v, renderSlot as ne, shallowRef as re, toDisplayString as y, unref as b, useId as ie, watch as x, withCtx as S } from "vue";
7
- import { MapPinOff as ae, Minus as oe, Plus as se, RotateCcw as ce } from "@lucide/vue";
8
- import { registerMap as C, use as le } from "echarts/core";
9
- import { EffectScatterChart as ue, ScatterChart as de } from "echarts/charts";
10
- import { GeoComponent as fe } from "echarts/components";
11
- import { LabelLayout as pe } from "echarts/features";
6
+ import { computed as c, createBlock as ee, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createSlots as te, createTextVNode as f, createVNode as p, defineComponent as m, getCurrentInstance as ne, normalizeStyle as h, openBlock as g, ref as _, renderSlot as re, shallowRef as ie, toDisplayString as v, unref as y, useId as ae, watch as b, withCtx as x } from "vue";
7
+ import { MapPinOff as oe, Minus as se, Plus as ce, RotateCcw as le } from "@lucide/vue";
8
+ import { registerMap as S, use as ue } from "echarts/core";
9
+ import { EffectScatterChart as de, ScatterChart as fe } from "echarts/charts";
10
+ import { GeoComponent as pe } from "echarts/components";
11
+ import { LabelLayout as me } from "echarts/features";
12
12
  //#region src/lib/components/AcMapChart.vue?vue&type=script&setup=true&lang.ts
13
- var me = { class: "absolute top-2 right-2 flex flex-col gap-1" }, he = { class: "font-medium text-heading" }, ge = {
13
+ var he = { class: "absolute top-2 right-2 flex flex-col gap-1" }, ge = { class: "flex items-center gap-1.5 font-medium text-heading" }, _e = {
14
14
  key: 0,
15
15
  class: "mt-0.5 text-muted"
16
- }, _e = {
16
+ }, ve = { class: "font-medium text-heading" }, ye = {
17
+ key: 0,
18
+ class: "mt-0.5 text-muted"
19
+ }, be = {
17
20
  key: 2,
18
21
  class: "mt-1.5 flex justify-between gap-4 border-t border-border pt-1.5"
19
- }, ve = { class: "text-muted" }, ye = { class: "font-medium text-heading tabular-nums" }, w = 2, be = 1.9, T = .75, E = 8, D = 8, xe = .7, O = /*@__PURE__*/ h({
22
+ }, xe = { class: "text-muted" }, Se = { class: "font-medium text-heading tabular-nums" }, C = 2, Ce = 1.9, w = .75, T = 8, we = 8, Te = .7, Ee = 111.32, De = 4, Oe = /*@__PURE__*/ m({
20
23
  __name: "AcMapChart",
21
24
  props: {
22
25
  points: {},
26
+ areas: { default: () => [] },
27
+ areaLabels: {
28
+ type: Boolean,
29
+ default: !0
30
+ },
31
+ selected: { default: void 0 },
23
32
  height: { default: 360 },
24
33
  pointSize: {
25
34
  type: [Number, Function],
@@ -56,6 +65,7 @@ var me = { class: "absolute top-2 right-2 flex flex-col gap-1" }, he = { class:
56
65
  default: void 0
57
66
  },
58
67
  pointsLabel: { default: "locations" },
68
+ areasLabel: { default: "areas" },
59
69
  tooltip: {
60
70
  type: Boolean,
61
71
  default: !0
@@ -73,75 +83,115 @@ var me = { class: "absolute top-2 right-2 flex flex-col gap-1" }, he = { class:
73
83
  default: !0
74
84
  }
75
85
  },
76
- emits: ["point-click"],
77
- setup(h, { emit: O }) {
78
- le([
86
+ emits: ["point-click", "area-click"],
87
+ setup(m, { expose: Oe, emit: ke }) {
88
+ ue([
89
+ pe,
79
90
  fe,
80
91
  de,
81
- ue,
82
- pe
92
+ me
83
93
  ]);
84
- let k = h, Se = O, A = [
94
+ let E = m, Ae = ke, D = [
85
95
  "success",
86
96
  "info",
87
97
  "pending",
88
98
  "warning",
89
99
  "danger",
90
100
  "neutral"
91
- ], Ce = {
101
+ ], je = {
92
102
  success: o("success", 0),
93
103
  info: o("info", 0),
94
104
  pending: o("pending", 0),
95
105
  warning: o("warning", 0),
96
106
  danger: o("danger", 0),
97
107
  neutral: o("chart-7", 0)
98
- }, we = {
108
+ }, Me = {
99
109
  success: "Healthy",
100
110
  info: "Info",
101
111
  pending: "Pending",
102
112
  warning: "Degraded",
103
113
  danger: "Down",
104
114
  neutral: "Unknown"
105
- }, Te = ie(), Ee = !!te()?.vnode.props?.onPointClick, j = v(), M = v([]), N = v(0), P = v(null), F = v(), I = re(), De = 0, L = null;
106
- function R(e) {
115
+ }, Ne = ae(), Pe = ne()?.vnode.props, Fe = !!Pe?.onPointClick, Ie = !!Pe?.onAreaClick, Le = _(), O = _([]), k = _(0), A = _(null), j = _("point"), M = _(), N = ie(), Re = 0, P = null;
116
+ function F(e) {
107
117
  return e.status?.trim() || "neutral";
108
118
  }
109
- function z(e) {
110
- if (A.includes(e)) return e;
119
+ function I(e) {
120
+ if (D.includes(e)) return e;
111
121
  let n = t(e).tone;
112
122
  return n === "default" ? "neutral" : n;
113
123
  }
114
- function B(e) {
115
- return k.statusLabels?.[e] ?? we[e] ?? t(e).label;
124
+ function L(e) {
125
+ return E.statusLabels?.[e] ?? Me[e] ?? t(e).label;
116
126
  }
117
- function V(e) {
118
- let t = k.statusColors?.[e];
119
- return t ? o(t, 0) : Ce[z(e)];
127
+ function ze(e) {
128
+ let t = E.statusColors?.[e];
129
+ return t ? o(t, 0) : je[I(e)];
120
130
  }
121
- function H(e) {
122
- return e.color ? o(e.color, 0) : V(R(e));
131
+ function Be(e) {
132
+ return e.color ? o(e.color, 0) : ze(F(e));
123
133
  }
124
- function Oe(e) {
125
- return typeof k.pointSize == "function" ? k.pointSize(e) : k.pointSize;
134
+ function Ve(e) {
135
+ return typeof E.pointSize == "function" ? E.pointSize(e) : E.pointSize;
126
136
  }
127
- function U(e) {
128
- return k.valueFormatter ? k.valueFormatter(e) : s(e);
137
+ function R(e) {
138
+ return E.valueFormatter ? E.valueFormatter(e) : s(e);
129
139
  }
130
- function ke(e) {
131
- if (!k.pulse) return !1;
132
- let t = R(e);
133
- return k.pulse === !0 ? z(t) === "success" : k.pulse.includes(t) || k.pulse.includes(z(t));
140
+ function He(e) {
141
+ if (!E.pulse) return !1;
142
+ let t = F(e);
143
+ return E.pulse === !0 ? I(t) === "success" : E.pulse.includes(t) || E.pulse.includes(I(t));
134
144
  }
135
- function Ae(e) {
145
+ function Ue(e) {
136
146
  return /^.[a-z]/.test(e) ? e.charAt(0).toLowerCase() + e.slice(1) : e;
137
147
  }
138
- function je(e) {
148
+ function z(e) {
139
149
  return `${`${Math.abs(e.latitude).toFixed(2)}° ${e.latitude >= 0 ? "N" : "S"}`}, ${`${Math.abs(e.longitude).toFixed(2)}° ${e.longitude >= 0 ? "E" : "W"}`}`;
140
150
  }
141
- function W(e) {
142
- return Math.min(k.zoomExtent[1], Math.max(k.zoomExtent[0], e));
151
+ function B(e) {
152
+ return Math.min(E.zoomExtent[1], Math.max(E.zoomExtent[0], e));
153
+ }
154
+ function V(e) {
155
+ let t = E.selected;
156
+ return Array.isArray(t) ? t.includes(e) : t === e;
157
+ }
158
+ function H(e) {
159
+ return o(e.color, E.areas.indexOf(e));
160
+ }
161
+ function U(e) {
162
+ return e.replace(/[{}]/g, "");
163
+ }
164
+ function W() {
165
+ let e = N.value;
166
+ if (!e || !k.value) return 0;
167
+ let t = k.value - 16, n = q.value - 16;
168
+ return Math.min(t / ((e[2] - e[0]) * w), n / (e[3] - e[1]));
143
169
  }
144
170
  function G(e) {
171
+ let t = e.radius / Ee, n = t / w;
172
+ return [
173
+ e.longitude - n,
174
+ e.longitude + n,
175
+ e.latitude - t,
176
+ e.latitude + t
177
+ ];
178
+ }
179
+ function We(e, t) {
180
+ return 2 * e.radius * W() * t / Ee;
181
+ }
182
+ function K([e, t, n, r]) {
183
+ let i = [(e + t) / 2, (n + r) / 2], a = W();
184
+ if (!a) return {
185
+ zoom: B(1),
186
+ center: i
187
+ };
188
+ let o = k.value - 16, s = q.value - 16;
189
+ return {
190
+ zoom: B(Math.min(o / (Math.max(t - e, we) * a * w), s / (Math.max(r - n, we) * a)) * Te),
191
+ center: i
192
+ };
193
+ }
194
+ function Ge(e) {
145
195
  let t = [
146
196
  Infinity,
147
197
  Infinity,
@@ -160,14 +210,14 @@ var me = { class: "absolute top-2 right-2 flex flex-col gap-1" }, he = { class:
160
210
  for (let t of e.features) n(t.geometry?.coordinates);
161
211
  return t;
162
212
  }
163
- function K(e, t, n) {
213
+ function Ke(e, t, n) {
164
214
  let r = (e) => n ? e[0] >= t : e[0] <= t, i = [];
165
215
  return e.forEach((n, a) => {
166
216
  let o = e[(a + e.length - 1) % e.length];
167
217
  r(o) !== r(n) && i.push([t, o[1] + (n[1] - o[1]) * (t - o[0]) / (n[0] - o[0])]), r(n) && i.push(n);
168
218
  }), i;
169
219
  }
170
- function Me(e) {
220
+ function qe(e) {
171
221
  if (!e.some((e) => e.some((t, n) => n > 0 && Math.abs(t[0] - e[n - 1][0]) > 180))) return [e];
172
222
  let t = e.map((e) => {
173
223
  let t = e[0][0];
@@ -183,11 +233,11 @@ var me = { class: "absolute top-2 right-2 flex flex-col gap-1" }, he = { class:
183
233
  0,
184
234
  360
185
235
  ].flatMap((e) => {
186
- let n = t.map((t) => K(K(t.map((t) => [t[0] + e, t[1]]), -180, !0), 180, !1)).filter((e) => e.length >= 3);
236
+ let n = t.map((t) => Ke(Ke(t.map((t) => [t[0] + e, t[1]]), -180, !0), 180, !1)).filter((e) => e.length >= 3);
187
237
  return n.length ? [n] : [];
188
238
  });
189
239
  }
190
- async function Ne() {
240
+ async function Je() {
191
241
  let [{ feature: e }, t] = await Promise.all([import("topojson-client"), import("world-atlas/countries-110m.json")]), n = t.default, r = {
192
242
  type: "FeatureCollection",
193
243
  features: e(n, n.objects.countries).features.filter((e) => e.properties?.name !== "Antarctica").map((e) => {
@@ -198,105 +248,187 @@ var me = { class: "absolute top-2 right-2 flex flex-col gap-1" }, he = { class:
198
248
  ...e,
199
249
  geometry: {
200
250
  type: "MultiPolygon",
201
- coordinates: n.flatMap(Me)
251
+ coordinates: n.flatMap(qe)
202
252
  }
203
253
  };
204
254
  })
205
255
  };
206
- return C("ac-world", r), r;
256
+ return S("ac-world", r), r;
207
257
  }
208
- async function q() {
209
- let e = k.geoJson;
258
+ async function Ye() {
259
+ let e = E.geoJson;
210
260
  if (e) {
211
- let t = `ac-map-${Te}-${++De}`;
212
- C(t, e), I.value = G(e), F.value = t;
261
+ let t = `ac-map-${Ne}-${++Re}`;
262
+ S(t, e), N.value = Ge(e), M.value = t;
213
263
  return;
214
264
  }
215
- let t = await i("world-map", Ne);
216
- k.geoJson || (I.value = G(t), F.value = "ac-world");
265
+ let t = await i("world-map", Je);
266
+ E.geoJson || (N.value = Ge(t), M.value = "ac-world");
217
267
  }
218
- let J = c(() => {
268
+ let Xe = c(() => {
219
269
  let e = /* @__PURE__ */ new Map();
220
- for (let t of k.points) e.set(R(t), (e.get(R(t)) ?? 0) + 1);
270
+ for (let t of E.points) e.set(F(t), (e.get(F(t)) ?? 0) + 1);
221
271
  let t = [...e.keys()];
222
- return t.sort((e, t) => A.indexOf(z(e)) - A.indexOf(z(t))), t.map((t) => ({
272
+ return t.sort((e, t) => D.indexOf(I(e)) - D.indexOf(I(t))), t.map((t) => ({
223
273
  key: t,
224
- label: B(t),
225
- color: V(t),
274
+ label: L(t),
275
+ color: ze(t),
226
276
  count: e.get(t)
227
277
  }));
228
- }), Pe = c(() => J.value.map((e) => ({
278
+ }), Ze = c(() => Xe.value.map((e) => ({
229
279
  key: e.key,
230
280
  name: e.label,
231
281
  color: e.color,
232
- value: k.legendValues ? String(e.count) : void 0
233
- }))), Y = c(() => k.fitToPoints || !N.value ? k.height : Math.min(k.height, Math.round(N.value / be))), X = c(() => k.points.some((e) => e.status)), Z = c(() => k.points.some((e) => e.description)), Q = c(() => k.points.some((e) => typeof e.value == "number")), Fe = c(() => ({
282
+ value: E.legendValues ? String(e.count) : void 0
283
+ }))), q = c(() => E.fitToPoints || !k.value ? E.height : Math.min(E.height, Math.round(k.value / Ce))), J = c(() => E.points.some((e) => e.status)), Y = c(() => E.points.some((e) => e.description) || E.areas.some((e) => e.description)), X = c(() => E.points.some((e) => typeof e.value == "number")), Qe = c(() => ({
234
284
  columns: [
235
285
  "Name",
236
- ...X.value ? ["Status"] : [],
237
- ...Z.value ? ["Details"] : [],
238
- ...Q.value ? [k.valueLabel] : [],
239
- "Coordinates"
286
+ ...J.value ? ["Status"] : [],
287
+ ...Y.value ? ["Details"] : [],
288
+ ...X.value ? [E.valueLabel] : [],
289
+ "Coordinates",
290
+ ...E.areas.length ? ["Radius"] : []
240
291
  ],
241
- rows: k.points.map((e) => [
292
+ rows: [...E.areas.map((e) => [
242
293
  e.label,
243
- ...X.value ? [B(R(e))] : [],
244
- ...Z.value ? [e.description ?? ""] : [],
245
- ...Q.value ? [typeof e.value == "number" ? U(e.value) : "–"] : [],
246
- je(e)
247
- ])
248
- })), Ie = c(() => {
249
- let e = J.value.map((e) => `${e.count} ${Ae(e.label)}`).join(", "), t = `World map, ${k.points.length} ${k.pointsLabel}${X.value ? `: ${e}` : ""}.`;
250
- return [k.title, k.description || t].filter(Boolean).join(". ");
251
- }), Le = c(() => {
252
- let e = I.value;
294
+ ...J.value ? ["–"] : [],
295
+ ...Y.value ? [e.description ?? ""] : [],
296
+ ...X.value ? ["–"] : [],
297
+ z(e),
298
+ `${Math.round(e.radius).toLocaleString()} km`
299
+ ]), ...E.points.map((e) => [
300
+ e.label,
301
+ ...J.value ? [L(F(e))] : [],
302
+ ...Y.value ? [e.description ?? ""] : [],
303
+ ...X.value ? [typeof e.value == "number" ? R(e.value) : "–"] : [],
304
+ z(e),
305
+ ...E.areas.length ? ["–"] : []
306
+ ])]
307
+ })), $e = c(() => {
308
+ let e = Xe.value.map((e) => `${e.count} ${Ue(e.label)}`).join(", "), t = E.areas.length ? ` in ${E.areas.length} ${E.areasLabel}` : "", n = `World map, ${E.points.length} ${E.pointsLabel}${t}${J.value ? `: ${e}` : ""}.`;
309
+ return [E.title, E.description || n].filter(Boolean).join(". ");
310
+ }), Z = c(() => {
311
+ let e = N.value;
253
312
  if (!e) return {
254
- zoom: W(1),
313
+ zoom: B(1),
255
314
  center: void 0
256
315
  };
257
316
  let t = {
258
- zoom: W(1),
317
+ zoom: B(1),
259
318
  center: [(e[0] + e[2]) / 2, (e[1] + e[3]) / 2]
260
- };
261
- if (!k.fitToPoints || !k.points.length || !N.value) return t;
262
- let n = k.points.map((e) => e.longitude), r = k.points.map((e) => e.latitude), [i, a, o, s] = [
263
- Math.min(...n),
264
- Math.max(...n),
265
- Math.min(...r),
266
- Math.max(...r)
267
- ], c = N.value - 16, l = Y.value - 16, u = e[2] - e[0], d = e[3] - e[1], f = Math.min(c, u / d * l * T) / u, p = f / T;
268
- return {
269
- zoom: W(Math.min(c / (Math.max(a - i, D) * f), l / (Math.max(s - o, D) * p)) * xe),
270
- center: [(i + a) / 2, (o + s) / 2]
271
- };
319
+ }, n = [...E.points.map((e) => [
320
+ e.longitude,
321
+ e.longitude,
322
+ e.latitude,
323
+ e.latitude
324
+ ]), ...E.areas.map(G)];
325
+ return !E.fitToPoints || !n.length || !k.value ? t : K([
326
+ Math.min(...n.map((e) => e[0])),
327
+ Math.max(...n.map((e) => e[1])),
328
+ Math.min(...n.map((e) => e[2])),
329
+ Math.max(...n.map((e) => e[3]))
330
+ ]);
272
331
  });
273
- function Re(e, t) {
274
- let n = H(t);
332
+ function et(e, t) {
333
+ let n = Be(t), r = V(t.id);
275
334
  return {
276
335
  name: t.label,
277
336
  value: [t.longitude, t.latitude],
278
- point: k.points.indexOf(t),
279
- symbolSize: Oe(t),
280
- itemStyle: { color: e.color(n) },
337
+ point: E.points.indexOf(t),
338
+ symbolSize: Ve(t) + (r ? De : 0),
339
+ itemStyle: r ? {
340
+ color: e.color(n),
341
+ borderColor: e.heading,
342
+ borderWidth: 2
343
+ } : { color: e.color(n) },
281
344
  emphasis: { itemStyle: {
282
345
  shadowBlur: 10,
283
346
  shadowColor: e.alpha(n, .6)
284
347
  } }
285
348
  };
286
349
  }
287
- function ze(e) {
288
- if (!F.value) return {};
289
- let t = L ?? Le.value, n = k.animation && !e.reducedMotion, r = k.points.filter((e) => !M.value.includes(R(e))), i = e.reducedMotion ? [] : r.filter(ke), a = r.filter((e) => !i.includes(e)), o = {
350
+ function tt(e, t) {
351
+ return [...t.filter((e) => !V(e.id)), ...t.filter((e) => V(e.id))].map((t) => et(e, t));
352
+ }
353
+ function Q(e, t) {
354
+ return E.areas.map((n, r) => {
355
+ let i = H(n), a = V(n.id);
356
+ return {
357
+ name: n.label,
358
+ value: [n.longitude, n.latitude],
359
+ area: r,
360
+ symbolSize: We(n, t),
361
+ itemStyle: {
362
+ color: e.alpha(i, a ? .16 : .07),
363
+ borderColor: e.alpha(i, a ? 1 : .45),
364
+ borderWidth: a ? 2 : 1.5
365
+ },
366
+ emphasis: { itemStyle: {
367
+ color: e.alpha(i, .16),
368
+ borderColor: e.alpha(i, a ? 1 : .75),
369
+ borderWidth: 2
370
+ } }
371
+ };
372
+ });
373
+ }
374
+ function nt(e, t) {
375
+ let n = {
376
+ fontFamily: e.font,
377
+ textBorderColor: e.surface,
378
+ textBorderWidth: 2
379
+ };
380
+ return {
381
+ id: "areas",
382
+ type: "scatter",
290
383
  coordinateSystem: "geo",
291
384
  symbol: "circle",
292
- cursor: Ee ? "pointer" : "default",
385
+ z: 1,
386
+ cursor: Ie ? "pointer" : "default",
387
+ animationDurationUpdate: 0,
388
+ emphasis: { scale: !1 },
389
+ data: Q(e, t),
390
+ label: {
391
+ show: E.areaLabels,
392
+ position: "bottom",
393
+ distance: 4,
394
+ align: "center",
395
+ formatter: (e) => {
396
+ let t = E.areas[e.data.area ?? -1];
397
+ return t ? t.description ? `{name|${U(t.label)}}\n{note|${U(t.description)}}` : `{name|${U(t.label)}}` : "";
398
+ },
399
+ rich: {
400
+ name: {
401
+ ...n,
402
+ color: e.heading,
403
+ fontSize: 11,
404
+ fontWeight: 500,
405
+ lineHeight: 15
406
+ },
407
+ note: {
408
+ ...n,
409
+ color: e.muted,
410
+ fontSize: 10,
411
+ lineHeight: 13
412
+ }
413
+ }
414
+ },
415
+ labelLayout: { hideOverlap: !0 }
416
+ };
417
+ }
418
+ function rt(e) {
419
+ if (!M.value) return {};
420
+ let t = P ?? Z.value, n = E.animation && !e.reducedMotion, r = E.points.filter((e) => !O.value.includes(F(e))), i = e.reducedMotion ? [] : r.filter(He), a = r.filter((e) => !i.includes(e)), o = {
421
+ coordinateSystem: "geo",
422
+ symbol: "circle",
423
+ cursor: Fe ? "pointer" : "default",
424
+ animationDurationUpdate: 0,
293
425
  itemStyle: {
294
426
  borderColor: e.surface,
295
427
  borderWidth: 1.5
296
428
  },
297
429
  emphasis: { scale: 1.4 },
298
430
  label: {
299
- show: k.labels,
431
+ show: E.labels,
300
432
  position: "bottom",
301
433
  distance: 4,
302
434
  formatter: "{b}",
@@ -311,20 +443,20 @@ var me = { class: "absolute top-2 right-2 flex flex-col gap-1" }, he = { class:
311
443
  return {
312
444
  animation: n,
313
445
  geo: {
314
- map: F.value,
315
- roam: k.zoom,
446
+ map: M.value,
447
+ roam: E.zoom,
316
448
  silent: !0,
317
449
  zoom: t.zoom,
318
450
  center: t.center,
319
451
  scaleLimit: {
320
- min: k.zoomExtent[0],
321
- max: k.zoomExtent[1]
452
+ min: E.zoomExtent[0],
453
+ max: E.zoomExtent[1]
322
454
  },
323
- aspectScale: T,
324
- left: E,
325
- right: E,
326
- top: E,
327
- bottom: E,
455
+ aspectScale: w,
456
+ left: T,
457
+ right: T,
458
+ top: T,
459
+ bottom: T,
328
460
  preserveAspect: "contain",
329
461
  label: { show: !1 },
330
462
  itemStyle: {
@@ -335,64 +467,92 @@ var me = { class: "absolute top-2 right-2 flex flex-col gap-1" }, he = { class:
335
467
  emphasis: { disabled: !0 },
336
468
  select: { disabled: !0 }
337
469
  },
338
- series: [{
339
- ...o,
340
- id: "still",
341
- type: "scatter",
342
- data: a.map((t) => Re(e, t))
343
- }, {
344
- ...o,
345
- id: "pulsing",
346
- type: "effectScatter",
347
- data: i.map((t) => Re(e, t)),
348
- showEffectOn: "render",
349
- rippleEffect: {
350
- brushType: "stroke",
351
- scale: 3,
352
- period: 2.5
470
+ series: [
471
+ nt(e, t.zoom),
472
+ {
473
+ ...o,
474
+ id: "still",
475
+ type: "scatter",
476
+ data: tt(e, a)
477
+ },
478
+ {
479
+ ...o,
480
+ id: "pulsing",
481
+ type: "effectScatter",
482
+ data: tt(e, i),
483
+ showEffectOn: "render",
484
+ rippleEffect: {
485
+ brushType: "stroke",
486
+ scale: 3,
487
+ period: 2.5
488
+ }
353
489
  }
354
- }]
490
+ ]
355
491
  };
356
492
  }
357
- function Be(e, t, n) {
358
- let r = e ? k.points[e.point] : void 0;
359
- if (!r || !k.tooltip) return;
360
- let i = R(r), a = typeof r.value == "number" ? r.value : null;
361
- P.value = {
493
+ function it(e, t, n) {
494
+ if (!E.tooltip || !e) return;
495
+ if (e.area !== void 0) return at(e.area, t, n);
496
+ let r = E.points[e.point ?? -1];
497
+ if (!r) return;
498
+ let i = F(r), a = typeof r.value == "number" ? r.value : null;
499
+ j.value = "point", A.value = {
362
500
  clientX: t,
363
501
  clientY: n,
364
502
  title: r.label,
365
503
  items: [{
366
504
  key: i,
367
- name: B(i),
368
- color: H(r),
505
+ name: L(i),
506
+ color: Be(r),
369
507
  value: a,
370
- formatted: a === null ? "" : U(a)
508
+ formatted: a === null ? "" : R(a)
371
509
  }],
372
510
  datum: r,
373
511
  index: e.point
374
512
  };
375
513
  }
376
- let { chart: Ve } = a({
377
- host: j,
378
- renderer: () => k.renderer,
379
- prepare: q,
380
- option: ze,
514
+ function at(e, t, n) {
515
+ let r = E.areas[e];
516
+ r && (j.value = "area", A.value = {
517
+ clientX: t,
518
+ clientY: n,
519
+ title: r.label,
520
+ items: [{
521
+ key: r.id,
522
+ name: r.label,
523
+ color: H(r),
524
+ value: null,
525
+ formatted: ""
526
+ }],
527
+ datum: r,
528
+ index: e
529
+ });
530
+ }
531
+ let { chart: ot, theme: $ } = a({
532
+ host: Le,
533
+ renderer: () => E.renderer,
534
+ prepare: Ye,
535
+ option: rt,
381
536
  setup: (e) => {
382
- r(e, (e) => Be(e.data, e.clientX, e.clientY), () => P.value = null), e.on("click", (e) => {
383
- let t = k.points[e.data?.point ?? -1];
384
- t && Se("point-click", t);
537
+ r(e, (e) => it(e.data, e.clientX, e.clientY), () => A.value = null), e.on("click", (e) => {
538
+ let t = e.data, n = E.areas[t?.area ?? -1];
539
+ if (n) return Ae("area-click", n);
540
+ let r = E.points[t?.point ?? -1];
541
+ r && Ae("point-click", r);
385
542
  }), e.on("georoam", () => {
386
543
  let t = e.getOption().geo?.[0];
387
- t?.zoom !== void 0 && t.center && (L = {
544
+ t?.zoom !== void 0 && t.center && (P = {
388
545
  zoom: t.zoom,
389
546
  center: [...t.center]
390
- });
547
+ }, E.areas.length && $.value && e.setOption({ series: [{
548
+ id: "areas",
549
+ data: Q($.value, t.zoom)
550
+ }] }));
391
551
  });
392
552
  }
393
553
  });
394
- function $(e) {
395
- let t = Ve.value;
554
+ function st(e) {
555
+ let t = ot.value;
396
556
  t && t.dispatchAction({
397
557
  type: "geoRoam",
398
558
  geoIndex: 0,
@@ -401,96 +561,138 @@ var me = { class: "absolute top-2 right-2 flex flex-col gap-1" }, he = { class:
401
561
  originY: t.getHeight() / 2
402
562
  });
403
563
  }
404
- function He() {
405
- $(w);
406
- }
407
- function Ue() {
408
- $(1 / w);
409
- }
410
- function We() {
411
- L = null;
412
- let e = Le.value;
413
- Ve.value?.setOption({ geo: [{
414
- zoom: e.zoom,
415
- center: e.center
416
- }] });
417
- }
418
- return x(() => k.geoJson, () => void q()), x([() => k.zoom, () => k.fitToPoints], () => L = null), (t, r) => (_(), l(n, {
419
- hidden: M.value,
420
- "onUpdate:hidden": r[0] ||= (e) => M.value = e,
421
- width: N.value,
422
- "onUpdate:width": r[1] ||= (e) => N.value = e,
564
+ function ct() {
565
+ st(C);
566
+ }
567
+ function lt() {
568
+ st(1 / C);
569
+ }
570
+ function ut(e) {
571
+ let t = ot.value;
572
+ if (!t) return;
573
+ let n = $.value ? { series: [{
574
+ id: "areas",
575
+ data: Q($.value, e.zoom)
576
+ }] } : {};
577
+ t.setOption({
578
+ geo: [{
579
+ zoom: e.zoom,
580
+ center: e.center
581
+ }],
582
+ ...n
583
+ });
584
+ }
585
+ function dt(e) {
586
+ let t = ft(e);
587
+ t && (P = t, ut(t));
588
+ }
589
+ function ft(e) {
590
+ if (!e) return;
591
+ if (typeof e != "string") return {
592
+ zoom: B(e.zoom ?? P?.zoom ?? Z.value.zoom),
593
+ center: [e.longitude, e.latitude]
594
+ };
595
+ let t = E.areas.find((t) => t.id === e);
596
+ if (t) return K(G(t));
597
+ let n = E.points.find((t) => t.id === e);
598
+ if (n) return K([
599
+ n.longitude,
600
+ n.longitude,
601
+ n.latitude,
602
+ n.latitude
603
+ ]);
604
+ }
605
+ function pt() {
606
+ P = null, ut(Z.value);
607
+ }
608
+ return b(() => E.geoJson, () => void Ye()), b([() => E.zoom, () => E.fitToPoints], () => P = null), Oe({
609
+ focus: dt,
610
+ resetView: pt,
611
+ zoomIn: ct,
612
+ zoomOut: lt
613
+ }), (t, r) => (g(), ee(n, {
614
+ hidden: O.value,
615
+ "onUpdate:hidden": r[0] ||= (e) => O.value = e,
616
+ width: k.value,
617
+ "onUpdate:width": r[1] ||= (e) => k.value = e,
423
618
  testid: "ac-map-chart",
424
- height: Y.value,
425
- loading: h.loading,
426
- empty: !h.points.length,
427
- "empty-text": h.emptyText,
428
- "empty-icon": b(ae),
429
- legend: h.legend,
430
- "legend-items": Pe.value,
431
- summary: Ie.value,
432
- title: h.title,
433
- description: h.description,
434
- table: Fe.value,
435
- tip: P.value,
436
- tooltip: h.tooltip
437
- }, p({
438
- tooltip: S(({ datum: e, items: n }) => [ne(t.$slots, "tooltip", {
619
+ height: q.value,
620
+ loading: m.loading,
621
+ empty: !m.points.length && !m.areas.length,
622
+ "empty-text": m.emptyText,
623
+ "empty-icon": y(oe),
624
+ legend: m.legend,
625
+ "legend-items": Ze.value,
626
+ summary: $e.value,
627
+ title: m.title,
628
+ description: m.description,
629
+ table: Qe.value,
630
+ tip: A.value,
631
+ tooltip: m.tooltip
632
+ }, te({
633
+ tooltip: x(({ datum: e, items: n }) => [j.value === "area" ? re(t.$slots, "area-tooltip", {
634
+ area: e,
635
+ color: n[0]?.color ?? ""
636
+ }, () => [d("p", ge, [d("span", {
637
+ class: "size-2 shrink-0 rounded-full",
638
+ style: h({ backgroundColor: n[0]?.color }),
639
+ "aria-hidden": "true"
640
+ }, null, 4), f(" " + v(e.label), 1)]), e.description ? (g(), u("p", _e, v(e.description), 1)) : l("", !0)], void 0, 0) : re(t.$slots, "tooltip", {
439
641
  point: e,
440
642
  statusLabel: n[0]?.name ?? "",
441
643
  color: n[0]?.color ?? "",
442
644
  formattedValue: n[0]?.formatted ?? ""
443
645
  }, () => [
444
- f("p", he, y(e.label), 1),
445
- e.description ? (_(), d("p", ge, y(e.description), 1)) : u("", !0),
446
- e.status && n[0] ? (_(), d("p", {
646
+ d("p", ve, v(e.label), 1),
647
+ e.description ? (g(), u("p", ye, v(e.description), 1)) : l("", !0),
648
+ e.status && n[0] ? (g(), u("p", {
447
649
  key: 1,
448
650
  class: "mt-2 inline-flex h-5 items-center gap-1.5 rounded-full px-2 font-medium text-heading",
449
- style: g({ backgroundColor: `color-mix(in srgb, ${n[0].color} 14%, transparent)` })
450
- }, [f("span", {
651
+ style: h({ backgroundColor: `color-mix(in srgb, ${n[0].color} 14%, transparent)` })
652
+ }, [d("span", {
451
653
  class: "size-1.5 shrink-0 rounded-full",
452
- style: g({ backgroundColor: n[0].color }),
654
+ style: h({ backgroundColor: n[0].color }),
453
655
  "aria-hidden": "true"
454
- }, null, 4), ee(" " + y(n[0].name), 1)], 4)) : u("", !0),
455
- n[0]?.formatted ? (_(), d("p", _e, [f("span", ve, y(h.valueLabel), 1), f("span", ye, y(n[0].formatted), 1)])) : u("", !0)
456
- ])]),
457
- default: S(() => [f("div", {
656
+ }, null, 4), f(" " + v(n[0].name), 1)], 4)) : l("", !0),
657
+ n[0]?.formatted ? (g(), u("p", be, [d("span", xe, v(m.valueLabel), 1), d("span", Se, v(n[0].formatted), 1)])) : l("", !0)
658
+ ], void 0, 1)]),
659
+ default: x(() => [d("div", {
458
660
  ref_key: "host",
459
- ref: j,
661
+ ref: Le,
460
662
  class: "size-full"
461
663
  }, null, 512)]),
462
664
  _: 2
463
- }, [h.zoom ? {
665
+ }, [m.zoom ? {
464
666
  name: "controls",
465
- fn: S(() => [f("div", me, [
466
- m(e, {
667
+ fn: x(() => [d("div", he, [
668
+ p(e, {
467
669
  color: "white",
468
670
  size: "xs",
469
671
  "icon-only": "",
470
672
  title: "Zoom in",
471
- onClick: He
673
+ onClick: ct
472
674
  }, {
473
- icon: S(() => [m(b(se), { "aria-hidden": "true" })]),
675
+ icon: x(() => [p(y(ce), { "aria-hidden": "true" })]),
474
676
  _: 1
475
677
  }),
476
- m(e, {
678
+ p(e, {
477
679
  color: "white",
478
680
  size: "xs",
479
681
  "icon-only": "",
480
682
  title: "Zoom out",
481
- onClick: Ue
683
+ onClick: lt
482
684
  }, {
483
- icon: S(() => [m(b(oe), { "aria-hidden": "true" })]),
685
+ icon: x(() => [p(y(se), { "aria-hidden": "true" })]),
484
686
  _: 1
485
687
  }),
486
- m(e, {
688
+ p(e, {
487
689
  color: "white",
488
690
  size: "xs",
489
691
  "icon-only": "",
490
692
  title: "Reset view",
491
- onClick: We
693
+ onClick: pt
492
694
  }, {
493
- icon: S(() => [m(b(ce), { "aria-hidden": "true" })]),
695
+ icon: x(() => [p(y(le), { "aria-hidden": "true" })]),
494
696
  _: 1
495
697
  })
496
698
  ])]),
@@ -515,4 +717,4 @@ var me = { class: "absolute top-2 right-2 flex flex-col gap-1" }, he = { class:
515
717
  }
516
718
  });
517
719
  //#endregion
518
- export { O as default };
720
+ export { Oe as default };