@opengis/bi 1.0.53 → 1.1.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.
@@ -1,294 +0,0 @@
1
- import { l as L, c as $, p as T, V as B, a as H, b as O, d as F, m as S, e as N } from "./vs-list-ACq4fLEf.js";
2
- import { _ as C, c as P } from "./import-file-lDlptYTO.js";
3
- import { resolveComponent as u, openBlock as i, createElementBlock as c, Fragment as w, createElementVNode as l, createVNode as x, createBlock as E, Teleport as R, toDisplayString as f, createCommentVNode as m, renderList as k, normalizeStyle as I, normalizeClass as V } from "vue";
4
- const A = {
5
- components: { legendIcon: L, closeIcon: $ },
6
- props: {
7
- mapId: { type: String },
8
- colors: { type: Array },
9
- sizes: { type: Array, default: () => [] },
10
- cluster: { type: [Boolean, String] },
11
- color: { type: String, default: "gray" },
12
- colorTitle: { type: String },
13
- sizesTitle: { type: String },
14
- resizeItem: { type: [Boolean, String], default: !1 },
15
- changeOpacityItem: { type: [Boolean, String], default: !1 }
16
- },
17
- data() {
18
- return {
19
- isOpenLegend: !1,
20
- palette: T
21
- // palette: ['#69D2E7', 'yellow', '#FE4365'],
22
- };
23
- },
24
- computed: {
25
- borderRadius() {
26
- return this.cluster ? "rounded-sm" : "rounded-full";
27
- },
28
- sortedSizes() {
29
- return [...this.sizes].sort((e, o) => e - o);
30
- },
31
- maxWidht() {
32
- var t;
33
- const e = ((t = this.sizes) == null ? void 0 : t.length) - 1;
34
- return this.calcSize(e);
35
- }
36
- },
37
- methods: {
38
- sizeClass(e) {
39
- return this.resizeItem ? `h-[${this.calcSize(e)}] w-[${this.calcSize(e)}] ${this.borderRadius}` : `h-[18px] w-[18px] ${this.borderRadius}`;
40
- },
41
- calcSize(e) {
42
- return `${10 + e * 2}px`;
43
- },
44
- getOpacity(e) {
45
- return (e + 1) / this.sortedSizes.length;
46
- }
47
- }
48
- }, G = { class: "w-full absolute max-w-[200px] bg-white border rounded-lg bottom-[10px] right-[50px]" }, W = { class: "flex items-center justify-between border-b border-[#0000001A] px-2" }, Z = { class: "w-full flex flex-col gap-[8px] px-2 py-2 max-h-[200px] overflow-auto [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent" }, j = {
49
- key: 0,
50
- class: "flex flex-col w-full"
51
- }, q = {
52
- key: 0,
53
- class: "text-xs font-semibold leading-[1.2] text-[#1F2937] mb-[8px]"
54
- }, D = { class: "flex flex-col gap-[6px]" }, J = { class: "text-xs text-[#1F2937] font-normal leading-[1.2]" }, K = {
55
- key: 1,
56
- class: "flex flex-col w-full"
57
- }, Q = {
58
- key: 0,
59
- class: "text-xs font-semibold leading-[1.2] text-[#1F2937] mb-[8px]"
60
- }, U = { class: "flex flex-col gap-[6px]" }, X = { class: "flex flex-row items-center justify-start" }, Y = { class: "text-xs text-[#1F2937] font-normal leading-[1.2]" };
61
- function ee(e, o, t, s, r, a) {
62
- var y, b;
63
- const n = u("legendIcon"), h = u("closeIcon");
64
- return i(), c(w, null, [
65
- l("div", {
66
- class: "flex justify-center items-center rounded-md w-[32px] h-[32px] cursor-pointer bg-white p-1 border-[2px]",
67
- onClick: o[0] || (o[0] = (d) => r.isOpenLegend = !r.isOpenLegend)
68
- }, [
69
- x(n)
70
- ]),
71
- r.isOpenLegend ? (i(), E(R, {
72
- key: 0,
73
- to: `#wrapper-${t.mapId}`
74
- }, [
75
- l("div", G, [
76
- l("div", W, [
77
- o[2] || (o[2] = l("h3", { class: "text-[16px] font-normal text-black" }, "Легенда", -1)),
78
- l("button", {
79
- type: "button",
80
- class: "inline-flex items-center text-sm font-medium text-gray-500 rounded-lg gap-x-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 dark:hover:text-blue-500 dark:focus:text-blue-500",
81
- onClick: o[1] || (o[1] = (d) => r.isOpenLegend = !1)
82
- }, [
83
- x(h, { class: "w-[20px]" })
84
- ])
85
- ]),
86
- l("div", Z, [
87
- (y = t.colors) != null && y.length ? (i(), c("div", j, [
88
- t.colorTitle ? (i(), c("h4", q, f(t.colorTitle), 1)) : m("", !0),
89
- l("div", D, [
90
- (i(!0), c(w, null, k(t.colors, (d, p) => (i(), c("div", {
91
- key: p,
92
- class: "flex items-center gap-[10px]"
93
- }, [
94
- d.color ? (i(), c("div", {
95
- key: 0,
96
- class: "w-[12px] h-[12px] rounded-full",
97
- style: I({
98
- backgroundColor: d.color
99
- })
100
- }, null, 4)) : m("", !0),
101
- l("p", J, f(d.text || d.val), 1)
102
- ]))), 128))
103
- ])
104
- ])) : m("", !0),
105
- (b = t.sizes) != null && b.length ? (i(), c("div", K, [
106
- e.sizeTitle ? (i(), c("h4", Q, f(e.sizeTitle), 1)) : m("", !0),
107
- l("div", U, [
108
- a.sortedSizes.length ? (i(!0), c(w, { key: 0 }, k(a.sortedSizes, (d, p) => {
109
- var g, v, _, z, M;
110
- return i(), c("div", null, [
111
- l("div", X, [
112
- l("div", {
113
- class: V([a.maxWidht ? `w-[${a.maxWidht}]` : "", "mr-[10px]"])
114
- }, [
115
- l("div", {
116
- class: V(a.sizeClass(p)),
117
- style: I({
118
- backgroundColor: ((v = (g = r.palette) == null ? void 0 : g[t.color]) == null ? void 0 : v[p]) || t.color
119
- })
120
- }, null, 6)
121
- ], 2),
122
- l("p", Y, f(p === ((_ = a.sortedSizes) == null ? void 0 : _.length) - 1 ? ">" + d : p == ((z = a.sortedSizes) == null ? void 0 : z.length) - 1 ? ">" + a.sortedSizes[((M = a.sortedSizes) == null ? void 0 : M.length) - 1] : d + "-" + a.sortedSizes[p + 1]), 1)
123
- ])
124
- ]);
125
- }), 256)) : m("", !0)
126
- ])
127
- ])) : m("", !0)
128
- ])
129
- ])
130
- ], 8, ["to"])) : m("", !0)
131
- ], 64);
132
- }
133
- const te = /* @__PURE__ */ C(A, [["render", ee]]), se = {
134
- components: {
135
- VsMapSetting: B,
136
- VsMapSlotLayers: H,
137
- VsMapLegend: te,
138
- VsMapGoHome: O,
139
- VsList: F
140
- },
141
- data() {
142
- return {
143
- mapId: `map-${Math.floor(Math.random() * 1e3)}`,
144
- layerId: `layer${Math.floor(Math.random() * 1e3)}`,
145
- map: null,
146
- hoverData: null,
147
- data: null,
148
- coordinatesByMouse: [],
149
- showSetting: !1,
150
- popup: null,
151
- color: "#69D2E7"
152
- };
153
- },
154
- methods: {
155
- async createMap() {
156
- var o, t;
157
- const e = {
158
- version: 8,
159
- glyphs: "https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",
160
- sources: {},
161
- layers: []
162
- };
163
- this.map = await new S.Map({
164
- container: this.mapId,
165
- style: e,
166
- center: [31, 48.5],
167
- zoom: ((t = (o = this.data) == null ? void 0 : o.style) == null ? void 0 : t.zoom) || 5,
168
- minZoom: 3,
169
- maxZoom: 20,
170
- attributionControl: !1
171
- }), this.map.addControl(
172
- new S.NavigationControl({
173
- visualizePitch: !0
174
- })
175
- ), this.map.on("load", () => {
176
- this.loadHandler();
177
- }), this.map.on("mousemove", (s) => {
178
- this.moveMouseHadler(s);
179
- }), this.map.on("mouseout", () => {
180
- var s;
181
- this.showLegend = !1, this.showSetting = !1, this.coordinatesByMouse = 0, (s = this.popup) == null || s.remove();
182
- });
183
- },
184
- getPopoverTitle(e) {
185
- var o, t, s, r, a;
186
- return (t = (o = this.data) == null ? void 0 : o.colors) != null && t.find((n) => n.val === e) ? (a = (r = (s = this.data) == null ? void 0 : s.colors) == null ? void 0 : r.find((n) => n.val === e)) == null ? void 0 : a.text : e;
187
- },
188
- moveMouseHadler(e) {
189
- var o;
190
- try {
191
- const t = this.map.queryRenderedFeatures(e.point), s = ((o = t[0]) == null ? void 0 : o.properties) || {};
192
- if (!t.length) {
193
- this.map.getCanvas().style.cursor = "", this.popupElement && this.popupElement.remove();
194
- return;
195
- }
196
- this.map.getCanvas().style.cursor = "pointer", this.popupElement && this.popupElement.remove(), this.popupElement = document.createElement("div"), this.popupElement.className = "absolute text-gray-800 border border-gray-200 rounded-lg shadow-md min-w-28", this.popupElement.style.backgroundColor = "rgba(255, 255, 255, 0.7)", this.popupElement.innerHTML = `<div class="font-semibold text-sm border-b border-solid border-gray-200 text-gray-800 rounded-t-lg px-2 py-1">
197
- ${this.getPopoverTitle((s == null ? void 0 : s.x) || (s == null ? void 0 : s.title) || (s == null ? void 0 : s.name)) || ""}
198
- </div>
199
-
200
- <div class="flex justify-between items-center text-xs px-2 py-0.5 text-gray-500 ">
201
- <span class="flex items-center">
202
- <span class="font-medium mr-[6px]">Значення</span>
203
- </span>
204
- <span>${(s == null ? void 0 : s.metric) || 0}</span>
205
- </div>`;
206
- const r = this.map.project(e.lngLat);
207
- this.popupElement.style.left = `${r.x}px`, this.popupElement.style.top = `${r.y - 60}px`, this.map.getContainer().appendChild(this.popupElement);
208
- } catch (t) {
209
- console.error(t);
210
- }
211
- }
212
- }
213
- }, oe = {
214
- mixins: [P, N, se],
215
- name: "VsMap",
216
- async mounted() {
217
- await this.getMapData(), await this.createMap();
218
- },
219
- methods: {
220
- async getMapData() {
221
- const o = await (await fetch(
222
- `/api/bi-map?widget=${this.widget}&dashboard=${this.dashboard}`
223
- )).json();
224
- this.data = o, this.$emit("update:widgetData", o), setTimeout(() => {
225
- var t;
226
- return (t = this.map) == null ? void 0 : t.resize();
227
- });
228
- },
229
- async loadHandler() {
230
- const e = ["#69D2E7", "yellow", "#FE4365"], o = this.data.colors ? ["match", ["get", "x"]].concat(
231
- this.data.colors.reduce(
232
- (a, n, h) => a.concat(n.val, (n == null ? void 0 : n.color) || e[h]),
233
- []
234
- )
235
- ).concat(["gray"]) : "blue", t = [5, 7, 9, 11, 13], s = this.data.sizes ? ["case"] : 5;
236
- this.data.sizes && (this.data.sizes.reverse().forEach((a, n) => {
237
- s.push([">", ["get", "metric"], a]), s.push(t[n]);
238
- }), s.push(5));
239
- const r = {
240
- type: "circle",
241
- color: o,
242
- width: 2,
243
- radius: s,
244
- stroke: "#eee"
245
- };
246
- Object.assign(r, this.data.style || {}), this.addVtileLayer({
247
- id: "bi",
248
- url: `${window.top.location.origin}/api/bi-vtile/{z}/{x}/{y}.vmt?widget=${this.widget}&dashboard=${this.dashboard}&nocache=1`,
249
- style: r
250
- });
251
- }
252
- }
253
- }, ae = { class: "w-full h-full" }, le = { class: "flex items-start justify-between mb-[6px] w-full" }, re = { class: "text-gray-800 font-[600]" }, ne = ["id"], ie = ["id"], de = { class: "absolute flex flex-col right-[10px] top-[105px] gap-1" };
254
- function ce(e, o, t, s, r, a) {
255
- var d, p, g;
256
- const n = u("VsMapSetting"), h = u("VsMapSlotLayers"), y = u("VsMapLegend"), b = u("VsMapGoHome");
257
- return i(), c("div", ae, [
258
- l("div", le, [
259
- l("h5", re, f(e.title), 1)
260
- ]),
261
- l("div", {
262
- class: "relative w-full h-[calc(100%-40px)]",
263
- id: `wrapper-${e.mapId}`
264
- }, [
265
- l("div", {
266
- id: e.mapId,
267
- class: "w-full flex items-end relative h-full min-h-[250px]"
268
- }, null, 8, ie),
269
- e.showSetting ? (i(), E(n, {
270
- key: 0,
271
- map: e.map,
272
- coordinates: e.coordinatesByMouse
273
- }, null, 8, ["map", "coordinates"])) : m("", !0),
274
- x(h, { map: e.map }, null, 8, ["map"]),
275
- l("div", de, [
276
- x(y, {
277
- mapId: e.mapId,
278
- colors: (d = e.data) == null ? void 0 : d.colors,
279
- sizes: (p = e.data) == null ? void 0 : p.sizes,
280
- color: e.color,
281
- resizeItem: "true"
282
- }, null, 8, ["mapId", "colors", "sizes", "color"]),
283
- x(b, {
284
- map: e.map,
285
- bbox: (g = e.data) == null ? void 0 : g.bounds
286
- }, null, 8, ["map", "bbox"])
287
- ])
288
- ], 8, ne)
289
- ]);
290
- }
291
- const he = /* @__PURE__ */ C(oe, [["render", ce]]);
292
- export {
293
- he as default
294
- };
@@ -1,315 +0,0 @@
1
- import { l as G, c as A, p as R, e as P, V as Z, b as q, d as D, a as K, m as H } from "./vs-list-ACq4fLEf.js";
2
- import { _ as V, c as W, V as J, I as Q, e as U, g as X } from "./import-file-lDlptYTO.js";
3
- import { openBlock as p, createElementBlock as m, createElementVNode as n, normalizeClass as I, Fragment as N, renderList as O, toDisplayString as F, normalizeStyle as Y, createCommentVNode as S, resolveComponent as g, createBlock as z, resolveDynamicComponent as j, withDirectives as M, createVNode as w, vShow as C } from "vue";
4
- const $ = {
5
- components: { legendIcon: G, closeIcon: A },
6
- props: {
7
- mapId: { type: String },
8
- colors: { type: Array },
9
- sizes: { type: Array, default: () => [] },
10
- cluster: { type: [Boolean, String] },
11
- color: { type: String, default: "gray" },
12
- colorTitle: { type: String },
13
- sizesTitle: { type: String },
14
- resizeItem: { type: [Boolean, String], default: !1 },
15
- changeOpacityItem: { type: [Boolean, String], default: !1 }
16
- },
17
- data() {
18
- return {
19
- isOpenLegend: !1,
20
- palette: R
21
- // palette: ['#69D2E7', 'yellow', '#FE4365'],
22
- };
23
- },
24
- computed: {
25
- borderRadius() {
26
- return this.cluster ? "rounded-sm" : "rounded-full";
27
- },
28
- sortedSizes() {
29
- return [...this.sizes].sort((t, s) => t - s);
30
- },
31
- maxWidht() {
32
- var r;
33
- const t = ((r = this.sizes) == null ? void 0 : r.length) - 1;
34
- return this.calcSize(t);
35
- }
36
- },
37
- methods: {
38
- sizeClass(t) {
39
- return this.resizeItem ? `h-[${this.calcSize(t)}] w-[${this.calcSize(t)}] ${this.borderRadius}` : `h-[10px] ${this.borderRadius}`;
40
- },
41
- calcSize(t) {
42
- return `${10 + t * 2}px`;
43
- },
44
- getOpacity(t) {
45
- return (t + 1) / this.sortedSizes.length;
46
- }
47
- }
48
- }, ee = {
49
- key: 0,
50
- class: "absolute flex items-end w-fit bottom-[10px] max-w-[80%] left-[50%] translate-x-[-50%] bg-[rgba(255,255,255,0.7)] p-[10px] rounded"
51
- }, te = { class: "w-[80px] mr-[10px]" }, se = ["title"], oe = { class: "text-[10px] mb-[2px] text-[#1F2937] font-normal leading-[1.2]" };
52
- function re(t, s, r, o, e, a) {
53
- var d;
54
- return (d = r.sizes) != null && d.length ? (p(), m("div", ee, [
55
- n("div", te, [
56
- s[0] || (s[0] = n("p", { class: "text-[10px] mb-[2px] text-[#1F2937] leading-[1.2]" }, " Дані відсутні ", -1)),
57
- n("div", {
58
- class: I([a.sizeClass(t.index), "w-full border border-gray-500"])
59
- }, null, 2)
60
- ]),
61
- a.sortedSizes.length ? (p(!0), m(N, { key: 0 }, O(a.sortedSizes, (c, i) => {
62
- var h, u, _, y, f, b, v, x;
63
- return p(), m("div", {
64
- class: "w-[80px]",
65
- title: i === ((h = a.sortedSizes) == null ? void 0 : h.length) - 1 ? ">" + c : i == ((u = a.sortedSizes) == null ? void 0 : u.length) - 1 ? ">" + a.sortedSizes[((_ = a.sortedSizes) == null ? void 0 : _.length) - 1] : c + "-" + a.sortedSizes[i + 1]
66
- }, [
67
- n("p", oe, F(i === ((y = a.sortedSizes) == null ? void 0 : y.length) - 1 ? ">" + parseInt(c) : i == ((f = a.sortedSizes) == null ? void 0 : f.length) - 1 ? ">" + parseInt(a.sortedSizes[((b = a.sortedSizes) == null ? void 0 : b.length) - 1]) : parseInt(c) + "-" + parseInt(a.sortedSizes[i + 1])), 1),
68
- n("div", {
69
- class: I([a.sizeClass(i), "w-full border border-r-0 border-gray-500"]),
70
- style: Y({
71
- backgroundColor: ((x = (v = e.palette) == null ? void 0 : v[r.color]) == null ? void 0 : x[i]) || r.color
72
- })
73
- }, null, 6)
74
- ], 8, se);
75
- }), 256)) : S("", !0)
76
- ])) : S("", !0);
77
- }
78
- const ae = /* @__PURE__ */ V($, [["render", re]]), le = {}, ne = {
79
- xmlns: "http://www.w3.org/2000/svg",
80
- width: "24",
81
- height: "24",
82
- viewBox: "0 0 24 24",
83
- fill: "none",
84
- stroke: "currentColor",
85
- "stroke-width": "2",
86
- "stroke-linecap": "round",
87
- "stroke-linejoin": "round",
88
- class: "icon icon-tabler icons-tabler-outline icon-tabler-map"
89
- };
90
- function ie(t, s) {
91
- return p(), m("svg", ne, s[0] || (s[0] = [
92
- n("path", {
93
- stroke: "none",
94
- d: "M0 0h24v24H0z",
95
- fill: "none"
96
- }, null, -1),
97
- n("path", { d: "M3 7l6 -3l6 3l6 -3v13l-6 3l-6 -3l-6 3v-13" }, null, -1),
98
- n("path", { d: "M9 4v13" }, null, -1),
99
- n("path", { d: "M15 7v13" }, null, -1)
100
- ]));
101
- }
102
- const pe = /* @__PURE__ */ V(le, [["render", ie]]), ce = {
103
- mixins: [W, P],
104
- components: {
105
- VsMapSetting: Z,
106
- VsClusterLegend: ae,
107
- VsMapGoHome: q,
108
- VsList: D,
109
- VsMapSlotLayers: K,
110
- // VsListbar,
111
- VsBar: J
112
- },
113
- data() {
114
- return {
115
- baseColor: "pink",
116
- kattotg: "",
117
- options: [
118
- { id: "map", text: "Карта", component: pe },
119
- { id: "table", text: "Таблиця", component: Q },
120
- { id: "chart", text: "Віджет", component: U }
121
- ],
122
- activeTab: "map",
123
- mapId: `map-${Math.floor(Math.random() * 1e3)}`,
124
- layerId: `layer${Math.floor(Math.random() * 1e3)}`,
125
- map: null,
126
- hoverData: null,
127
- data: null,
128
- coordinatesByMouse: [],
129
- showSetting: !1,
130
- popup: null,
131
- color: "#69D2E7",
132
- label: "<div><icon-map/></div>"
133
- };
134
- },
135
- async mounted() {
136
- await this.getMapData(), await this.createMap();
137
- },
138
- watch: {
139
- kattotg() {
140
- this.loadHandler();
141
- }
142
- },
143
- methods: {
144
- async getMapData() {
145
- const t = await X.get(
146
- `/bi-cluster?widget=${this.widget}&dashboard=${this.dashboard}`
147
- );
148
- this.data = t.data, this.$emit("update:widgetData", this.data), setTimeout(() => {
149
- var s;
150
- return (s = this.map) == null ? void 0 : s.resize();
151
- });
152
- },
153
- async loadHandler() {
154
- var o, e, a, d;
155
- this.baseColor = ((o = this.data.style) == null ? void 0 : o.color) || "blue";
156
- const t = ["case"];
157
- (d = (a = (e = this.data) == null ? void 0 : e.sizes) == null ? void 0 : a.toReversed()) == null || d.forEach((c, i) => {
158
- var h, u;
159
- t.push([">", ["get", "metric"], c]), t.push((u = (h = R[this.baseColor]) == null ? void 0 : h.toReversed()) == null ? void 0 : u[i]), i++;
160
- }), t.push("gray");
161
- const s = {
162
- type: "polygon",
163
- color: t,
164
- opacity: 0.4
165
- };
166
- Object.assign(s, this.data.style || {}), this.map.getSource("bi") || this.addVtileLayer({
167
- id: "bi",
168
- url: `${window.location.origin}/api/bi-cluster-vtile/{z}/{x}/{y}.vmt?widget=${this.widget}&dashboard=${this.dashboard}&nocache=1`,
169
- style: s
170
- }), this.map.getLayer("highlighted") && this.map.removeLayer("highlighted"), this.map.getSource("highlighted") && this.map.removeSource("highlighted");
171
- const r = ["case"];
172
- this.kattotg && r.push(
173
- ["==", ["to-string", ["get", "name"]], String(this.kattotg)],
174
- "red"
175
- ), r.push("transparent"), this.map.addLayer({
176
- id: "highlighted",
177
- type: "fill",
178
- source: "bi",
179
- "source-layer": "bi",
180
- paint: {
181
- "fill-color": r,
182
- "fill-opacity": 0.6
183
- }
184
- });
185
- },
186
- async createMap() {
187
- var s, r;
188
- const t = {
189
- version: 8,
190
- glyphs: "https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",
191
- sources: {},
192
- layers: []
193
- };
194
- this.map = await new H.Map({
195
- container: this.mapId,
196
- style: t,
197
- center: [31, 48.5],
198
- zoom: ((r = (s = this.data) == null ? void 0 : s.style) == null ? void 0 : r.zoom) || 5,
199
- minZoom: 3,
200
- maxZoom: 20,
201
- attributionControl: !1
202
- }), this.map.addControl(
203
- new H.NavigationControl({
204
- visualizePitch: !0
205
- })
206
- ), this.map.on("load", () => {
207
- this.loadHandler();
208
- }), this.map.on("mousemove", (o) => {
209
- this.moveMouseHadler(o);
210
- }), this.map.on("mouseout", () => {
211
- var o;
212
- this.showLegend = !1, this.showSetting = !1, this.coordinatesByMouse = 0, (o = this.popup) == null || o.remove();
213
- });
214
- },
215
- moveMouseHadler(t) {
216
- var s;
217
- try {
218
- const r = this.map.queryRenderedFeatures(t.point), o = ((s = r[0]) == null ? void 0 : s.properties) || {};
219
- if (!r.length) {
220
- this.map.getCanvas().style.cursor = "", this.popupElement && this.popupElement.remove();
221
- return;
222
- }
223
- this.map.getCanvas().style.cursor = "pointer", this.popupElement && this.popupElement.remove(), this.popupElement = document.createElement("div"), this.popupElement.className = "absolute text-gray-800 border border-gray-200 rounded-lg shadow-md min-w-28", this.popupElement.style.backgroundColor = "rgba(255, 255, 255, 0.7)", this.popupElement.innerHTML = `<div class="px-2 py-1 text-sm font-semibold text-gray-800 border-b border-gray-200 border-solid rounded-t-lg">
224
- ${(o == null ? void 0 : o.x) || (o == null ? void 0 : o.title) || (o == null ? void 0 : o.name) || ""}
225
- </div>
226
-
227
- <div class="flex justify-between items-center text-xs px-2 py-0.5 text-gray-500 ">
228
- <span class="flex items-center">
229
- <span class="font-medium mr-[6px]">Значення</span>
230
- </span>
231
- <span>${(o == null ? void 0 : o.metric) || 0}</span>
232
- </div>`;
233
- const e = this.map.project(t.lngLat);
234
- this.popupElement.style.left = `${e.x}px`, this.popupElement.style.top = `${e.y - 60}px`, this.map.getContainer().appendChild(this.popupElement);
235
- } catch (r) {
236
- console.error(r);
237
- }
238
- }
239
- }
240
- }, de = { class: "h-full" }, he = { class: "flex items-start justify-between mb-[6px] w-full" }, ue = { class: "text-gray-800 font-[600]" }, me = { class: "flex gap-2" }, ge = ["onClick"], ye = ["id"], fe = ["id"], be = { class: "absolute flex flex-col right-[10px] top-[105px] gap-1" }, ve = { class: "h-[calc(250px)]" };
241
- function xe(t, s, r, o, e, a) {
242
- var y, f, b, v, x, k, L, E, B, T;
243
- const d = g("VsMapSetting"), c = g("VsMapSlotLayers"), i = g("VsMapGoHome"), h = g("VsClusterLegend"), u = g("VsList"), _ = g("VsBar");
244
- return p(), m("div", de, [
245
- n("div", he, [
246
- n("h3", ue, F(t.title), 1),
247
- n("div", me, [
248
- (p(!0), m(N, null, O(e.options, (l) => (p(), m("button", {
249
- class: I(["p-1 text-gray-700 border rounded", [e.activeTab === (l == null ? void 0 : l.id) ? "ring-2 ring-blue-500" : ""]]),
250
- onClick: (_e) => e.activeTab = l == null ? void 0 : l.id
251
- }, [
252
- (p(), z(j(l == null ? void 0 : l.component), {
253
- height: "16",
254
- width: "16"
255
- }))
256
- ], 10, ge))), 256))
257
- ])
258
- ]),
259
- M(n("div", {
260
- class: "relative w-full h-[calc(100%-40px)]",
261
- id: `wrapper-${e.mapId}`
262
- }, [
263
- n("div", {
264
- id: e.mapId,
265
- class: "h-full w-full flex items-end min-h-[250px]"
266
- }, null, 8, fe),
267
- e.showSetting ? (p(), z(d, {
268
- key: 0,
269
- map: e.map,
270
- coordinates: e.coordinatesByMouse
271
- }, null, 8, ["map", "coordinates"])) : S("", !0),
272
- w(c, { map: e.map }, null, 8, ["map"]),
273
- n("div", be, [
274
- w(i, {
275
- map: e.map,
276
- bbox: (y = e.data) == null ? void 0 : y.bounds
277
- }, null, 8, ["map", "bbox"])
278
- ]),
279
- w(h, {
280
- mapId: e.mapId,
281
- colors: (f = e.data) == null ? void 0 : f.colors,
282
- sizes: (b = e.data) == null ? void 0 : b.sizes,
283
- color: e.baseColor,
284
- changeOpacityItem: "true",
285
- cluster: "true"
286
- }, null, 8, ["mapId", "colors", "sizes", "color"])
287
- ], 8, ye), [
288
- [C, e.activeTab == "map"]
289
- ]),
290
- M(w(u, {
291
- mapId: e.mapId,
292
- source: (v = e.data) == null ? void 0 : v.rows,
293
- total: ((x = e.data) == null ? void 0 : x.total) || 0,
294
- count: ((k = e.data) == null ? void 0 : k.count) || 0,
295
- onKattotg: s[0] || (s[0] = (l) => e.kattotg = l)
296
- }, null, 8, ["mapId", "source", "total", "count"]), [
297
- [C, e.activeTab == "table"]
298
- ]),
299
- M(n("div", ve, [
300
- (E = (L = e.data) == null ? void 0 : L.rows) != null && E.length ? (p(), z(_, {
301
- key: 0,
302
- source: (T = (B = e.data) == null ? void 0 : B.rows) == null ? void 0 : T.map((l) => ({
303
- title: l == null ? void 0 : l.title,
304
- metric: l == null ? void 0 : l.metric
305
- }))
306
- }, null, 8, ["source"])) : S("", !0)
307
- ], 512), [
308
- [C, e.activeTab == "chart"]
309
- ])
310
- ]);
311
- }
312
- const Me = /* @__PURE__ */ V(ce, [["render", xe]]);
313
- export {
314
- Me as default
315
- };
@@ -1,55 +0,0 @@
1
- import { _ as c, c as o, f as n } from "./import-file-lDlptYTO.js";
2
- import { openBlock as i, createElementBlock as m, toDisplayString as s } from "vue";
3
- const u = {
4
- name: "VsNumber",
5
- mixins: [o],
6
- data() {
7
- return {
8
- number: ""
9
- };
10
- },
11
- computed: {
12
- formattedNumber() {
13
- return n(this.number);
14
- },
15
- prefix() {
16
- var e, t;
17
- return (e = this.styleData) != null && e.prefix ? (t = this.styleData) == null ? void 0 : t.prefix : "";
18
- }
19
- },
20
- watch: {
21
- sourceData: {
22
- async handler() {
23
- this.getNumber();
24
- },
25
- deep: !0
26
- }
27
- },
28
- async mounted() {
29
- await this.getData(), this.getNumber();
30
- },
31
- methods: {
32
- onChangedData() {
33
- try {
34
- this.sourceData && this.getNumber();
35
- } catch (e) {
36
- console.error(e);
37
- }
38
- },
39
- async getNumber() {
40
- var e, t;
41
- try {
42
- this.number = ((t = this.sourceData[0]) == null ? void 0 : t[Object.keys((e = this.sourceData) == null ? void 0 : e[0])]) || 0;
43
- } catch (r) {
44
- console.error(r);
45
- }
46
- }
47
- }
48
- }, h = { class: "text-lg lg:text-xl xl:text-2xl text-gray-800 h-[32px] flex items-center" };
49
- function x(e, t, r, f, l, a) {
50
- return i(), m("div", h, s(a.prefix) + s(a.formattedNumber), 1);
51
- }
52
- const b = /* @__PURE__ */ c(u, [["render", x]]);
53
- export {
54
- b as default
55
- };