@opengis/bi 1.2.15 → 1.2.16

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,24 +1,9 @@
1
- import { _ as A, a as F, p as T, c as G, V as P, b as Z, d as q, e as D, l as K } from "./vs-list-D3q94mc0.js";
2
- import { e as W, _ as H, V as J, c as Q, g as U, h as X, j as Y } from "./import-file-CMuG5tbq.js";
3
- import { createElementBlock as g, createCommentVNode as S, openBlock as p, createElementVNode as l, normalizeClass as V, Fragment as R, renderList as N, toDisplayString as O, normalizeStyle as j, createBlock as z, unref as $, mergeProps as ee, resolveComponent as m, withDirectives as M, resolveDynamicComponent as te, createVNode as w, vShow as C } from "vue";
4
- /**
5
- * @license lucide-vue-next v0.546.0 - ISC
6
- *
7
- * This source code is licensed under the ISC license.
8
- * See the LICENSE file in the root directory of this source tree.
9
- */
10
- const se = W("map", [
11
- [
12
- "path",
13
- {
14
- d: "M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",
15
- key: "169xi5"
16
- }
17
- ],
18
- ["path", { d: "M15 5.764v15", key: "1pn4in" }],
19
- ["path", { d: "M9 3.236v15", key: "1uimfh" }]
20
- ]), oe = {
21
- components: { legendIcon: F, closeIcon: A },
1
+ import { _ as F, a as G, p as T, V as P, b as A, c as Z, d as q, l as D, e as K } from "./vs-list-CkH5cu3X.js";
2
+ import { _ as H, V as W, c as J, g as Q, h as U, j as X } from "./import-file-BAgOJvMq.js";
3
+ import { createElementBlock as g, createCommentVNode as z, openBlock as p, createElementVNode as l, normalizeClass as V, Fragment as R, renderList as N, toDisplayString as O, normalizeStyle as Y, createBlock as S, unref as j, mergeProps as $, resolveComponent as u, withDirectives as M, resolveDynamicComponent as ee, createVNode as w, vShow as C } from "vue";
4
+ import { M as te } from "./map-DxWxxzQ5.js";
5
+ const se = {
6
+ components: { legendIcon: G, closeIcon: F },
22
7
  props: {
23
8
  mapId: { type: String },
24
9
  colors: { type: Array },
@@ -61,60 +46,60 @@ const se = W("map", [
61
46
  return (t + 1) / this.sortedSizes.length;
62
47
  }
63
48
  }
64
- }, ae = {
49
+ }, oe = {
65
50
  key: 0,
66
51
  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"
67
- }, re = { class: "w-[80px] mr-[10px]" }, ie = ["title"], ne = { class: "text-[10px] mb-[2px] text-[#1F2937] font-normal leading-[1.2]" };
68
- function le(t, s, o, a, e, r) {
52
+ }, ae = { class: "w-[80px] mr-[10px]" }, re = ["title"], ie = { class: "text-[10px] mb-[2px] text-[#1F2937] font-normal leading-[1.2]" };
53
+ function ne(t, s, o, a, e, r) {
69
54
  var d;
70
- return (d = o.sizes) != null && d.length ? (p(), g("div", ae, [
71
- l("div", re, [
55
+ return (d = o.sizes) != null && d.length ? (p(), g("div", oe, [
56
+ l("div", ae, [
72
57
  s[0] || (s[0] = l("p", { class: "text-[10px] mb-[2px] text-[#1F2937] leading-[1.2]" }, " Дані відсутні ", -1)),
73
58
  l("div", {
74
59
  class: V([r.sizeClass(t.index), "w-full border border-gray-500"])
75
60
  }, null, 2)
76
61
  ]),
77
62
  r.sortedSizes.length ? (p(!0), g(R, { key: 0 }, N(r.sortedSizes, (c, n) => {
78
- var h, u, v, y, f, _, b, x;
63
+ var h, m, v, y, f, _, b, x;
79
64
  return p(), g("div", {
80
65
  class: "w-[80px]",
81
- title: n === ((h = r.sortedSizes) == null ? void 0 : h.length) - 1 ? ">" + c : n == ((u = r.sortedSizes) == null ? void 0 : u.length) - 1 ? ">" + r.sortedSizes[((v = r.sortedSizes) == null ? void 0 : v.length) - 1] : c + "-" + r.sortedSizes[n + 1]
66
+ title: n === ((h = r.sortedSizes) == null ? void 0 : h.length) - 1 ? ">" + c : n == ((m = r.sortedSizes) == null ? void 0 : m.length) - 1 ? ">" + r.sortedSizes[((v = r.sortedSizes) == null ? void 0 : v.length) - 1] : c + "-" + r.sortedSizes[n + 1]
82
67
  }, [
83
- l("p", ne, O(n === ((y = r.sortedSizes) == null ? void 0 : y.length) - 1 ? ">" + parseInt(c) : n == ((f = r.sortedSizes) == null ? void 0 : f.length) - 1 ? ">" + parseInt(r.sortedSizes[((_ = r.sortedSizes) == null ? void 0 : _.length) - 1]) : parseInt(c) + "-" + parseInt(r.sortedSizes[n + 1])), 1),
68
+ l("p", ie, O(n === ((y = r.sortedSizes) == null ? void 0 : y.length) - 1 ? ">" + parseInt(c) : n == ((f = r.sortedSizes) == null ? void 0 : f.length) - 1 ? ">" + parseInt(r.sortedSizes[((_ = r.sortedSizes) == null ? void 0 : _.length) - 1]) : parseInt(c) + "-" + parseInt(r.sortedSizes[n + 1])), 1),
84
69
  l("div", {
85
70
  class: V([r.sizeClass(n), "w-full border border-r-0 border-gray-500"]),
86
- style: j({
71
+ style: Y({
87
72
  backgroundColor: ((x = (b = e.palette) == null ? void 0 : b[o.color]) == null ? void 0 : x[n]) || o.color
88
73
  })
89
74
  }, null, 6)
90
- ], 8, ie);
91
- }), 256)) : S("", !0)
92
- ])) : S("", !0);
75
+ ], 8, re);
76
+ }), 256)) : z("", !0)
77
+ ])) : z("", !0);
93
78
  }
94
- const pe = /* @__PURE__ */ H(oe, [["render", le]]), ce = {
79
+ const le = /* @__PURE__ */ H(se, [["render", ne]]), pe = {
95
80
  __name: "icon-map",
96
81
  setup(t) {
97
- return (s, o) => (p(), z($(se), ee(s.$attrs, { size: 24 }), null, 16));
82
+ return (s, o) => (p(), S(j(te), $(s.$attrs, { size: 24 }), null, 16));
98
83
  }
99
- }, de = {
100
- mixins: [Q, D],
84
+ }, ce = {
85
+ mixins: [J, D],
101
86
  components: {
102
87
  VsMapSetting: q,
103
- VsClusterLegend: pe,
88
+ VsClusterLegend: le,
104
89
  VsMapGoHome: Z,
105
- VsList: P,
106
- VsMapSlotLayers: G,
90
+ VsList: A,
91
+ VsMapSlotLayers: P,
107
92
  // VsListbar,
108
- VsBar: J
93
+ VsBar: W
109
94
  },
110
95
  data() {
111
96
  return {
112
97
  baseColor: "pink",
113
98
  kattotg: "",
114
99
  options: [
115
- { id: "map", text: "Карта", component: ce },
116
- { id: "table", text: "Таблиця", component: X },
117
- { id: "chart", text: "Віджет", component: Y }
100
+ { id: "map", text: "Карта", component: pe },
101
+ { id: "table", text: "Таблиця", component: U },
102
+ { id: "chart", text: "Віджет", component: X }
118
103
  ],
119
104
  activeTab: "map",
120
105
  mapId: `map-${Math.floor(Math.random() * 1e3)}`,
@@ -139,7 +124,7 @@ const pe = /* @__PURE__ */ H(oe, [["render", le]]), ce = {
139
124
  },
140
125
  methods: {
141
126
  async getMapData() {
142
- const t = await U.get(
127
+ const t = await Q.get(
143
128
  `/bi-cluster?widget=${this.widget}&dashboard=${this.dashboard}`
144
129
  );
145
130
  this.data = t, this.$emit("update:widgetData", this.data), setTimeout(() => {
@@ -152,8 +137,8 @@ const pe = /* @__PURE__ */ H(oe, [["render", le]]), ce = {
152
137
  this.baseColor = ((a = this.data.style) == null ? void 0 : a.color) || "blue";
153
138
  const t = ["case"];
154
139
  (d = (r = (e = this.data) == null ? void 0 : e.sizes) == null ? void 0 : r.toReversed()) == null || d.forEach((c, n) => {
155
- var h, u;
156
- t.push([">", ["get", "metric"], c]), t.push((u = (h = T[this.baseColor]) == null ? void 0 : h.toReversed()) == null ? void 0 : u[n]), n++;
140
+ var h, m;
141
+ t.push([">", ["get", "metric"], c]), t.push((m = (h = T[this.baseColor]) == null ? void 0 : h.toReversed()) == null ? void 0 : m[n]), n++;
157
142
  }), t.push("gray");
158
143
  const s = {
159
144
  type: "polygon",
@@ -236,23 +221,23 @@ const pe = /* @__PURE__ */ H(oe, [["render", le]]), ce = {
236
221
  }
237
222
  }
238
223
  }
239
- }, he = { class: "h-full" }, ue = { class: "flex items-start justify-between mb-[6px] w-full" }, me = { class: "text-gray-800 font-[600]" }, ge = { class: "flex gap-2" }, ye = ["onClick"], fe = ["id"], _e = ["id"], be = { class: "absolute flex flex-col right-[10px] top-[105px] gap-1" }, xe = { class: "h-[calc(250px)]" };
240
- function ve(t, s, o, a, e, r) {
241
- var y, f, _, b, x, I, k, L, E, B;
242
- const d = m("VsMapSetting"), c = m("VsMapSlotLayers"), n = m("VsMapGoHome"), h = m("VsClusterLegend"), u = m("VsList"), v = m("VsBar");
243
- return p(), g("div", he, [
244
- l("div", ue, [
224
+ }, de = { class: "h-full" }, he = { class: "flex items-start justify-between mb-[6px] w-full" }, me = { class: "text-gray-800 font-[600]" }, ue = { class: "flex gap-2" }, ge = ["onClick"], ye = ["id"], fe = ["id"], _e = { class: "absolute flex flex-col right-[10px] top-[105px] gap-1" }, be = { class: "h-[calc(250px)]" };
225
+ function xe(t, s, o, a, e, r) {
226
+ var y, f, _, b, x, I, L, k, E, B;
227
+ const d = u("VsMapSetting"), c = u("VsMapSlotLayers"), n = u("VsMapGoHome"), h = u("VsClusterLegend"), m = u("VsList"), v = u("VsBar");
228
+ return p(), g("div", de, [
229
+ l("div", he, [
245
230
  l("h3", me, O(t.title), 1),
246
- l("div", ge, [
231
+ l("div", ue, [
247
232
  (p(!0), g(R, null, N(e.options, (i) => (p(), g("button", {
248
233
  class: V(["p-1 text-gray-700 border rounded", [e.activeTab === (i == null ? void 0 : i.id) ? "ring-2 ring-blue-500" : ""]]),
249
- onClick: (we) => e.activeTab = i == null ? void 0 : i.id
234
+ onClick: (ve) => e.activeTab = i == null ? void 0 : i.id
250
235
  }, [
251
- (p(), z(te(i == null ? void 0 : i.component), {
236
+ (p(), S(ee(i == null ? void 0 : i.component), {
252
237
  height: "16",
253
238
  width: "16"
254
239
  }))
255
- ], 10, ye))), 256))
240
+ ], 10, ge))), 256))
256
241
  ])
257
242
  ]),
258
243
  M(l("div", {
@@ -262,14 +247,14 @@ function ve(t, s, o, a, e, r) {
262
247
  l("div", {
263
248
  id: e.mapId,
264
249
  class: "h-full w-full flex items-end min-h-[250px]"
265
- }, null, 8, _e),
266
- e.showSetting ? (p(), z(d, {
250
+ }, null, 8, fe),
251
+ e.showSetting ? (p(), S(d, {
267
252
  key: 0,
268
253
  map: e.map,
269
254
  coordinates: e.coordinatesByMouse
270
- }, null, 8, ["map", "coordinates"])) : S("", !0),
255
+ }, null, 8, ["map", "coordinates"])) : z("", !0),
271
256
  w(c, { map: e.map }, null, 8, ["map"]),
272
- l("div", be, [
257
+ l("div", _e, [
273
258
  w(n, {
274
259
  map: e.map,
275
260
  bbox: (y = e.data) == null ? void 0 : y.bounds
@@ -283,10 +268,10 @@ function ve(t, s, o, a, e, r) {
283
268
  changeOpacityItem: "true",
284
269
  cluster: "true"
285
270
  }, null, 8, ["mapId", "colors", "sizes", "color"])
286
- ], 8, fe), [
271
+ ], 8, ye), [
287
272
  [C, e.activeTab == "map"]
288
273
  ]),
289
- M(w(u, {
274
+ M(w(m, {
290
275
  mapId: e.mapId,
291
276
  source: (b = e.data) == null ? void 0 : b.rows,
292
277
  total: ((x = e.data) == null ? void 0 : x.total) || 0,
@@ -295,20 +280,20 @@ function ve(t, s, o, a, e, r) {
295
280
  }, null, 8, ["mapId", "source", "total", "count"]), [
296
281
  [C, e.activeTab == "table"]
297
282
  ]),
298
- M(l("div", xe, [
299
- (L = (k = e.data) == null ? void 0 : k.rows) != null && L.length ? (p(), z(v, {
283
+ M(l("div", be, [
284
+ (k = (L = e.data) == null ? void 0 : L.rows) != null && k.length ? (p(), S(v, {
300
285
  key: 0,
301
286
  source: (B = (E = e.data) == null ? void 0 : E.rows) == null ? void 0 : B.map((i) => ({
302
287
  title: i == null ? void 0 : i.title,
303
288
  metric: i == null ? void 0 : i.metric
304
289
  }))
305
- }, null, 8, ["source"])) : S("", !0)
290
+ }, null, 8, ["source"])) : z("", !0)
306
291
  ], 512), [
307
292
  [C, e.activeTab == "chart"]
308
293
  ])
309
294
  ]);
310
295
  }
311
- const Ce = /* @__PURE__ */ H(de, [["render", ve]]);
296
+ const Ce = /* @__PURE__ */ H(ce, [["render", xe]]);
312
297
  export {
313
298
  Ce as default
314
299
  };
@@ -1,4 +1,4 @@
1
- import { _ as c, c as o, f as n } from "./import-file-CMuG5tbq.js";
1
+ import { _ as c, c as o, f as n } from "./import-file-BAgOJvMq.js";
2
2
  import { createElementBlock as i, openBlock as m, toDisplayString as s } from "vue";
3
3
  const u = {
4
4
  name: "VsNumber",
@@ -1,4 +1,4 @@
1
- import { _ as m, c as f, b as _, d as b } from "./import-file-CMuG5tbq.js";
1
+ import { _ as m, c as f, b as _, d as b } from "./import-file-BAgOJvMq.js";
2
2
  import { createElementBlock as a, openBlock as r, createElementVNode as s, Fragment as n, renderList as c, toDisplayString as d } from "vue";
3
3
  const x = {
4
4
  name: "VsTable",
@@ -1,4 +1,4 @@
1
- import { _ as o, c as s, m as i } from "./import-file-CMuG5tbq.js";
1
+ import { _ as o, c as s, m as i } from "./import-file-BAgOJvMq.js";
2
2
  import { createElementBlock as r, openBlock as n, createCommentVNode as a } from "vue";
3
3
  const c = {
4
4
  name: "VsText",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/bi",
3
- "version": "1.2.15",
3
+ "version": "1.2.16",
4
4
  "description": "BI data visualization module",
5
5
  "main": "dist/bi.js",
6
6
  "browser": "dist/bi.umd.cjs",
@@ -13,12 +13,13 @@
13
13
  ],
14
14
  "scripts": {
15
15
  "patch": "npm version patch && git push && npm publish",
16
- "prepublishOnly": "npm run build",
16
+ "prepublishOnly": "npm run build:lib",
17
17
  "debug": "node --watch-path=server server",
18
18
  "dev": "vite",
19
19
  "type-check": "vue-tsc --noEmit",
20
20
  "build": "vite build",
21
- "build-app": "cross-env APP=true vite build",
21
+ "build:lib": "cross-env APP=true vite build",
22
+ "build-app": "vite build",
22
23
  "lint": "eslint .",
23
24
  "format": "prettier --write .",
24
25
  "test": "node --test",
@@ -47,15 +48,13 @@
47
48
  "lucide-vue-next": "^0.546.0"
48
49
  },
49
50
  "devDependencies": {
50
- "@highlightjs/vue-plugin": "github:highlightjs/vue-plugin",
51
51
  "@opengis/fastify-table": "^2.0.33",
52
52
  "@opengis/core": "^0.0.32",
53
- "@opengis/form": "^0.0.103",
53
+ "@opengis/form": "^0.0.117",
54
54
  "@opengis/v3-filter": "^0.0.71",
55
55
  "cross-env": "^10.1.0",
56
56
  "@turf/turf": "^7.1.0",
57
57
  "echarts": "^5.5.1",
58
- "highlight.js": "^11.10.0",
59
58
  "marked": "^14.1.2",
60
59
  "vite": "^5.1.5",
61
60
  "vue": "^3.4.27",
@@ -1,7 +1,13 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
+ import { fileURLToPath } from 'url';
3
4
  import config from '../../config.js';
4
5
 
6
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
+ const rootDir = path.resolve(__dirname, '../..');
8
+ const distIndexPath = path.join(rootDir, 'dist', 'index.html');
9
+ const distAssetsDir = path.join(rootDir, 'dist', 'assets');
10
+
5
11
  const { disableAuth } = config;
6
12
  const isProduction = process.env.NODE_ENV === 'production';
7
13
 
@@ -38,14 +44,20 @@ async function plugin(fastify) {
38
44
  fastify.get('*', async (req, reply) => {
39
45
  // console.log(disableAuth)
40
46
  if (!req.user && !disableAuth) return reply.redirect('/login');
41
- const stream = fs.createReadStream('dist/index.html');
47
+ if (!fs.existsSync(distIndexPath)) {
48
+ return reply
49
+ .code(503)
50
+ .type('text/plain')
51
+ .send('index.html not found in dist. Run: npm run build-app');
52
+ }
53
+ const stream = fs.createReadStream(distIndexPath);
42
54
  return reply
43
55
  .headers({ 'Cache-Control': 'public, no-cache' })
44
56
  .type('text/html')
45
57
  .send(stream);
46
58
  });
47
59
  fastify.get('/assets/:file', async (req, reply) => {
48
- const stream = fs.createReadStream(`dist/assets/${req.params.file}`);
60
+ const stream = fs.createReadStream(path.join(distAssetsDir, req.params.file));
49
61
  const ext = path.extname(req.params.file);
50
62
  const mime = {
51
63
  '.js': 'text/javascript',