@opengis/bi 1.1.1 → 1.1.2

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,8 +1,8 @@
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-B2mp3dCt.js";
2
- import { _ as C, c as P } from "./import-file-ZfIxjCYO.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";
1
+ import { c as L, l 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-1QDnN3pH.js";
2
+ import { _ as C, c as P } from "./import-file-XFI3CaVb.js";
3
+ import { resolveComponent as u, createElementBlock as p, openBlock as i, Fragment as v, createElementVNode as r, createBlock as E, createCommentVNode as m, createVNode as f, Teleport as R, toDisplayString as b, renderList as k, normalizeStyle as I, normalizeClass as V } from "vue";
4
4
  const A = {
5
- components: { legendIcon: L, closeIcon: $ },
5
+ components: { legendIcon: $, closeIcon: L },
6
6
  props: {
7
7
  mapId: { type: String },
8
8
  colors: { type: Array },
@@ -26,11 +26,11 @@ const A = {
26
26
  return this.cluster ? "rounded-sm" : "rounded-full";
27
27
  },
28
28
  sortedSizes() {
29
- return [...this.sizes].sort((e, o) => e - o);
29
+ return [...this.sizes].sort((e, t) => e - t);
30
30
  },
31
31
  maxWidht() {
32
- var t;
33
- const e = ((t = this.sizes) == null ? void 0 : t.length) - 1;
32
+ var s;
33
+ const e = ((s = this.sizes) == null ? void 0 : s.length) - 1;
34
34
  return this.calcSize(e);
35
35
  }
36
36
  },
@@ -45,81 +45,81 @@ const A = {
45
45
  return (e + 1) / this.sortedSizes.length;
46
46
  }
47
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 = {
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" }, q = {
49
49
  key: 0,
50
50
  class: "flex flex-col w-full"
51
- }, q = {
51
+ }, j = {
52
52
  key: 0,
53
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 = {
54
+ }, J = { class: "flex flex-col gap-[6px]" }, K = { class: "text-xs text-[#1F2937] font-normal leading-[1.2]" }, Q = {
55
55
  key: 1,
56
56
  class: "flex flex-col w-full"
57
- }, Q = {
57
+ }, U = {
58
58
  key: 0,
59
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;
60
+ }, X = { class: "flex flex-col gap-[6px]" }, Y = { class: "flex flex-row items-center justify-start" }, D = { class: "text-xs text-[#1F2937] font-normal leading-[1.2]" };
61
+ function ee(e, t, s, o, l, a) {
62
+ var x, y;
63
63
  const n = u("legendIcon"), h = u("closeIcon");
64
- return i(), c(w, null, [
65
- l("div", {
64
+ return i(), p(v, null, [
65
+ r("div", {
66
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)
67
+ onClick: t[0] || (t[0] = (d) => l.isOpenLegend = !l.isOpenLegend)
68
68
  }, [
69
- x(n)
69
+ f(n)
70
70
  ]),
71
- r.isOpenLegend ? (i(), E(R, {
71
+ l.isOpenLegend ? (i(), E(R, {
72
72
  key: 0,
73
- to: `#wrapper-${t.mapId}`
73
+ to: `#wrapper-${s.mapId}`
74
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", {
75
+ r("div", G, [
76
+ r("div", W, [
77
+ t[2] || (t[2] = r("h3", { class: "text-[16px] font-normal text-black" }, "Легенда", -1)),
78
+ r("button", {
79
79
  type: "button",
80
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)
81
+ onClick: t[1] || (t[1] = (d) => l.isOpenLegend = !1)
82
82
  }, [
83
- x(h, { class: "w-[20px]" })
83
+ f(h, { class: "w-[20px]" })
84
84
  ])
85
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,
86
+ r("div", Z, [
87
+ (x = s.colors) != null && x.length ? (i(), p("div", q, [
88
+ s.colorTitle ? (i(), p("h4", j, b(s.colorTitle), 1)) : m("", !0),
89
+ r("div", J, [
90
+ (i(!0), p(v, null, k(s.colors, (d, c) => (i(), p("div", {
91
+ key: c,
92
92
  class: "flex items-center gap-[10px]"
93
93
  }, [
94
- d.color ? (i(), c("div", {
94
+ d.color ? (i(), p("div", {
95
95
  key: 0,
96
96
  class: "w-[12px] h-[12px] rounded-full",
97
97
  style: I({
98
98
  backgroundColor: d.color
99
99
  })
100
100
  }, null, 4)) : m("", !0),
101
- l("p", J, f(d.text || d.val), 1)
101
+ r("p", K, b(d.text || d.val), 1)
102
102
  ]))), 128))
103
103
  ])
104
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", {
105
+ (y = s.sizes) != null && y.length ? (i(), p("div", Q, [
106
+ e.sizeTitle ? (i(), p("h4", U, b(e.sizeTitle), 1)) : m("", !0),
107
+ r("div", X, [
108
+ a.sortedSizes.length ? (i(!0), p(v, { key: 0 }, k(a.sortedSizes, (d, c) => {
109
+ var g, w, z, _, M;
110
+ return i(), p("div", null, [
111
+ r("div", Y, [
112
+ r("div", {
113
113
  class: V([a.maxWidht ? `w-[${a.maxWidht}]` : "", "mr-[10px]"])
114
114
  }, [
115
- l("div", {
116
- class: V(a.sizeClass(p)),
115
+ r("div", {
116
+ class: V(a.sizeClass(c)),
117
117
  style: I({
118
- backgroundColor: ((v = (g = r.palette) == null ? void 0 : g[t.color]) == null ? void 0 : v[p]) || t.color
118
+ backgroundColor: ((w = (g = l.palette) == null ? void 0 : g[s.color]) == null ? void 0 : w[c]) || s.color
119
119
  })
120
120
  }, null, 6)
121
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)
122
+ r("p", D, b(c === ((z = a.sortedSizes) == null ? void 0 : z.length) - 1 ? ">" + d : c == ((_ = a.sortedSizes) == null ? void 0 : _.length) - 1 ? ">" + a.sortedSizes[((M = a.sortedSizes) == null ? void 0 : M.length) - 1] : d + "-" + a.sortedSizes[c + 1]), 1)
123
123
  ])
124
124
  ]);
125
125
  }), 256)) : m("", !0)
@@ -132,11 +132,11 @@ function ee(e, o, t, s, r, a) {
132
132
  }
133
133
  const te = /* @__PURE__ */ C(A, [["render", ee]]), se = {
134
134
  components: {
135
- VsMapSetting: B,
136
- VsMapSlotLayers: H,
135
+ VsMapSetting: F,
136
+ VsMapSlotLayers: O,
137
137
  VsMapLegend: te,
138
- VsMapGoHome: O,
139
- VsList: F
138
+ VsMapGoHome: H,
139
+ VsList: B
140
140
  },
141
141
  data() {
142
142
  return {
@@ -153,7 +153,6 @@ const te = /* @__PURE__ */ C(A, [["render", ee]]), se = {
153
153
  },
154
154
  methods: {
155
155
  async createMap() {
156
- var o, t;
157
156
  const e = {
158
157
  version: 8,
159
158
  glyphs: "https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",
@@ -164,7 +163,7 @@ const te = /* @__PURE__ */ C(A, [["render", ee]]), se = {
164
163
  container: this.mapId,
165
164
  style: e,
166
165
  center: [31, 48.5],
167
- zoom: ((t = (o = this.data) == null ? void 0 : o.style) == null ? void 0 : t.zoom) || 5,
166
+ zoom: 5,
168
167
  minZoom: 3,
169
168
  maxZoom: 20,
170
169
  attributionControl: !1
@@ -174,39 +173,39 @@ const te = /* @__PURE__ */ C(A, [["render", ee]]), se = {
174
173
  })
175
174
  ), this.map.on("load", () => {
176
175
  this.loadHandler();
177
- }), this.map.on("mousemove", (s) => {
178
- this.moveMouseHadler(s);
176
+ }), this.map.on("mousemove", (t) => {
177
+ this.moveMouseHadler(t);
179
178
  }), this.map.on("mouseout", () => {
180
- var s;
181
- this.showLegend = !1, this.showSetting = !1, this.coordinatesByMouse = 0, (s = this.popup) == null || s.remove();
179
+ var t;
180
+ this.showLegend = !1, this.showSetting = !1, this.coordinatesByMouse = 0, (t = this.popup) == null || t.remove();
182
181
  });
183
182
  },
184
183
  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;
184
+ var t, s, o, l, a;
185
+ return (s = (t = this.data) == null ? void 0 : t.colors) != null && s.find((n) => n.val === e) ? (a = (l = (o = this.data) == null ? void 0 : o.colors) == null ? void 0 : l.find((n) => n.val === e)) == null ? void 0 : a.text : e;
187
186
  },
188
187
  moveMouseHadler(e) {
189
- var o;
188
+ var t;
190
189
  try {
191
- const t = this.map.queryRenderedFeatures(e.point), s = ((o = t[0]) == null ? void 0 : o.properties) || {};
192
- if (!t.length) {
190
+ const s = this.map.queryRenderedFeatures(e.point), o = ((t = s[0]) == null ? void 0 : t.properties) || {};
191
+ if (!s.length) {
193
192
  this.map.getCanvas().style.cursor = "", this.popupElement && this.popupElement.remove();
194
193
  return;
195
194
  }
196
195
  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)) || ""}
196
+ ${this.getPopoverTitle((o == null ? void 0 : o.x) || (o == null ? void 0 : o.title) || (o == null ? void 0 : o.name)) || ""}
198
197
  </div>
199
198
 
200
199
  <div class="flex justify-between items-center text-xs px-2 py-0.5 text-gray-500 ">
201
200
  <span class="flex items-center">
202
201
  <span class="font-medium mr-[6px]">Значення</span>
203
202
  </span>
204
- <span>${(s == null ? void 0 : s.metric) || 0}</span>
203
+ <span>${(o == null ? void 0 : o.metric) || 0}</span>
205
204
  </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);
205
+ const l = this.map.project(e.lngLat);
206
+ this.popupElement.style.left = `${l.x}px`, this.popupElement.style.top = `${l.y - 60}px`, this.map.getContainer().appendChild(this.popupElement);
207
+ } catch (s) {
208
+ console.error(s);
210
209
  }
211
210
  }
212
211
  }
@@ -218,77 +217,69 @@ const te = /* @__PURE__ */ C(A, [["render", ee]]), se = {
218
217
  },
219
218
  methods: {
220
219
  async getMapData() {
221
- const o = await (await fetch(
220
+ const t = await (await fetch(
222
221
  `/api/bi-map?widget=${this.widget}&dashboard=${this.dashboard}`
223
222
  )).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
- });
223
+ this.data = t;
228
224
  },
229
225
  async loadHandler() {
230
- const e = ["#69D2E7", "yellow", "#FE4365"], o = this.data.colors ? ["match", ["get", "x"]].concat(
226
+ const e = ["#69D2E7", "yellow", "#FE4365"], t = this.data.colors ? ["match", ["get", "x"]].concat(
231
227
  this.data.colors.reduce(
232
228
  (a, n, h) => a.concat(n.val, (n == null ? void 0 : n.color) || e[h]),
233
229
  []
234
230
  )
235
- ).concat(["gray"]) : "blue", t = [5, 7, 9, 11, 13], s = this.data.sizes ? ["case"] : 5;
231
+ ).concat(["gray"]) : "blue", s = [5, 7, 9, 11, 13], o = this.data.sizes ? ["case"] : 5;
236
232
  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 = {
233
+ o.push([">", ["get", "metric"], a]), o.push(s[n]);
234
+ }), o.push(5));
235
+ const l = {
240
236
  type: "circle",
241
- color: o,
237
+ color: t,
242
238
  width: 2,
243
- radius: s,
239
+ radius: o,
244
240
  stroke: "#eee"
245
241
  };
246
- Object.assign(r, this.data.style || {}), this.addVtileLayer({
242
+ Object.assign(l, this.data.style || {}), this.addVtileLayer({
247
243
  id: "bi",
248
244
  url: `${window.top.location.origin}/api/bi-vtile/{z}/{x}/{y}.vmt?widget=${this.widget}&dashboard=${this.dashboard}&nocache=1`,
249
- style: r
245
+ style: l
250
246
  });
251
247
  }
252
248
  }
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,
249
+ }, ae = ["id"], le = ["id"], re = { class: "absolute flex flex-col right-[10px] top-[105px] gap-1" };
250
+ function ne(e, t, s, o, l, a) {
251
+ var d, c, g;
252
+ const n = u("VsMapSetting"), h = u("VsMapSlotLayers"), x = u("VsMapLegend"), y = u("VsMapGoHome");
253
+ return i(), p("div", {
254
+ class: "relative w-full h-full",
255
+ id: `wrapper-${e.mapId}`
256
+ }, [
257
+ r("div", {
258
+ id: e.mapId,
259
+ class: "w-full flex items-end relative h-[250px]"
260
+ }, null, 8, le),
261
+ e.showSetting ? (i(), E(n, {
262
+ key: 0,
263
+ map: e.map,
264
+ coordinates: e.coordinatesByMouse
265
+ }, null, 8, ["map", "coordinates"])) : m("", !0),
266
+ f(h, { map: e.map }, null, 8, ["map"]),
267
+ r("div", re, [
268
+ f(x, {
269
+ mapId: e.mapId,
270
+ colors: (d = e.data) == null ? void 0 : d.colors,
271
+ sizes: (c = e.data) == null ? void 0 : c.sizes,
272
+ color: e.color,
273
+ resizeItem: "true"
274
+ }, null, 8, ["mapId", "colors", "sizes", "color"]),
275
+ f(y, {
271
276
  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
- ]);
277
+ bbox: (g = e.data) == null ? void 0 : g.bounds
278
+ }, null, 8, ["map", "bbox"])
279
+ ])
280
+ ], 8, ae);
290
281
  }
291
- const he = /* @__PURE__ */ C(oe, [["render", ce]]);
282
+ const ce = /* @__PURE__ */ C(oe, [["render", ne]]);
292
283
  export {
293
- he as default
284
+ ce as default
294
285
  };