@opengis/bi 1.2.30 → 1.2.32

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 (75) hide show
  1. package/README.md +92 -92
  2. package/dist/bi.js +1 -1
  3. package/dist/bi.umd.cjs +88 -86
  4. package/dist/{import-file-B4o9p2_2.js → import-file-D-ISqB7l.js} +1772 -1593
  5. package/dist/style.css +1 -1
  6. package/dist/{vs-funnel-bar-BOWwPnjW.js → vs-funnel-bar-aoZzvriV.js} +3 -3
  7. package/dist/{vs-list-D8jGusRT.js → vs-list-CBkyJSBj.js} +53 -32
  8. package/dist/{vs-map-BGplOwpB.js → vs-map-C3C11qmT.js} +102 -91
  9. package/dist/{vs-map-cluster-CHQJV2As.js → vs-map-cluster-BsPmHIMx.js} +91 -81
  10. package/dist/{vs-number-jPqxFQ6d.js → vs-number-d58ftpH5.js} +3 -3
  11. package/dist/{vs-table-BDgIvJbY.js → vs-table-BHa5Velm.js} +6 -6
  12. package/dist/{vs-text-DcHOffy9.js → vs-text-Bq87gMTx.js} +4 -4
  13. package/package.json +77 -75
  14. package/plugin.js +21 -22
  15. package/server/helpers/mdToHTML.js +17 -17
  16. package/server/migrations/bi.dataset.sql +46 -46
  17. package/server/migrations/bi.sql +115 -112
  18. package/server/plugins/docs.js +48 -48
  19. package/server/plugins/hook.js +89 -89
  20. package/server/plugins/vite.js +81 -81
  21. package/server/routes/dashboard/controllers/dashboard.import.js +103 -103
  22. package/server/routes/dashboard/controllers/dashboard.js +158 -157
  23. package/server/routes/dashboard/controllers/dashboard.list.js +60 -60
  24. package/server/routes/dashboard/controllers/utils/yaml.js +11 -11
  25. package/server/routes/dashboard/index.mjs +26 -26
  26. package/server/routes/data/controllers/data.js +230 -229
  27. package/server/routes/data/controllers/util/chartSQL.js +49 -49
  28. package/server/routes/data/controllers/util/normalizeData.js +65 -65
  29. package/server/routes/data/index.mjs +38 -38
  30. package/server/routes/dataset/controllers/bi.dataset.list.js +29 -29
  31. package/server/routes/dataset/controllers/bi.db.list.js +19 -19
  32. package/server/routes/dataset/controllers/comment.js +55 -55
  33. package/server/routes/dataset/controllers/createDatasetPost.js +134 -134
  34. package/server/routes/dataset/controllers/data.js +149 -149
  35. package/server/routes/dataset/controllers/dbTablePreview.js +58 -58
  36. package/server/routes/dataset/controllers/dbTables.js +34 -34
  37. package/server/routes/dataset/controllers/delete.js +40 -40
  38. package/server/routes/dataset/controllers/deleteDataset.js +52 -52
  39. package/server/routes/dataset/controllers/editDataset.js +90 -90
  40. package/server/routes/dataset/controllers/export.js +214 -214
  41. package/server/routes/dataset/controllers/form.js +99 -99
  42. package/server/routes/dataset/controllers/format.js +46 -46
  43. package/server/routes/dataset/controllers/insert.js +47 -47
  44. package/server/routes/dataset/controllers/table.js +68 -68
  45. package/server/routes/dataset/controllers/update.js +43 -43
  46. package/server/routes/dataset/index.mjs +132 -132
  47. package/server/routes/dataset/utils/convertJSONToCSV.js +17 -17
  48. package/server/routes/dataset/utils/convertJSONToXls.js +47 -47
  49. package/server/routes/dataset/utils/createTableQuery.js +59 -59
  50. package/server/routes/dataset/utils/datasetForms.js +1 -1
  51. package/server/routes/dataset/utils/descriptionList.js +45 -45
  52. package/server/routes/dataset/utils/downloadRemoteFile.js +58 -58
  53. package/server/routes/dataset/utils/executeQuery.js +46 -46
  54. package/server/routes/dataset/utils/getLayersData.js +106 -106
  55. package/server/routes/dataset/utils/getTableData.js +46 -46
  56. package/server/routes/dataset/utils/insertDataQuery.js +12 -12
  57. package/server/routes/dataset/utils/metaFormat.js +24 -24
  58. package/server/routes/edit/controllers/dashboard.add.js +36 -36
  59. package/server/routes/edit/controllers/dashboard.delete.js +39 -39
  60. package/server/routes/edit/controllers/dashboard.edit.js +61 -61
  61. package/server/routes/edit/controllers/widget.add.js +78 -78
  62. package/server/routes/edit/controllers/widget.del.js +58 -58
  63. package/server/routes/edit/controllers/widget.edit.js +115 -115
  64. package/server/routes/edit/index.mjs +33 -33
  65. package/server/routes/map/controllers/cluster.js +125 -125
  66. package/server/routes/map/controllers/clusterVtile.js +166 -166
  67. package/server/routes/map/controllers/geojson.js +127 -127
  68. package/server/routes/map/controllers/heatmap.js +118 -118
  69. package/server/routes/map/controllers/map.js +69 -69
  70. package/server/routes/map/controllers/utils/downloadClusterData.js +44 -44
  71. package/server/routes/map/controllers/vtile.js +183 -183
  72. package/server/routes/map/index.mjs +32 -32
  73. package/server/templates/page/login.html +58 -58
  74. package/server/utils/getWidget.js +118 -117
  75. package/utils.js +12 -12
@@ -1,13 +1,13 @@
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-D8jGusRT.js";
2
- import { e as W, _ as H, V as J, c as Q, g as U, h as X, i as Y } from "./import-file-B4o9p2_2.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";
1
+ import { _ as O, a as A, p as T, c as F, V as P, b as G, d as W, e as Z, l as q } from "./vs-list-CBkyJSBj.js";
2
+ import { e as K, _ as H, V as J, c as Q, g as U, h as X, i as Y } from "./import-file-D-ISqB7l.js";
3
+ import { openBlock as p, createElementBlock as x, createElementVNode as l, normalizeClass as C, Fragment as D, renderList as R, toDisplayString as N, normalizeStyle as $, createCommentVNode as S, createBlock as z, unref as j, mergeProps as ee, resolveComponent as v, resolveDynamicComponent as te, withDirectives as M, createVNode as w, vShow as I } from "vue";
4
4
  /**
5
5
  * @license lucide-vue-next v0.577.0 - ISC
6
6
  *
7
7
  * This source code is licensed under the ISC license.
8
8
  * See the LICENSE file in the root directory of this source tree.
9
9
  */
10
- const se = W("map", [
10
+ const se = K("map", [
11
11
  [
12
12
  "path",
13
13
  {
@@ -18,7 +18,7 @@ const se = W("map", [
18
18
  ["path", { d: "M15 5.764v15", key: "1pn4in" }],
19
19
  ["path", { d: "M9 3.236v15", key: "1uimfh" }]
20
20
  ]), oe = {
21
- components: { legendIcon: F, closeIcon: A },
21
+ components: { legendIcon: A, closeIcon: O },
22
22
  props: {
23
23
  mapId: { type: String },
24
24
  colors: { type: Array },
@@ -42,11 +42,11 @@ const se = W("map", [
42
42
  return this.cluster ? "rounded-sm" : "rounded-full";
43
43
  },
44
44
  sortedSizes() {
45
- return [...this.sizes].sort((t, s) => t - s);
45
+ return [...this.sizes].sort((t, a) => t - a);
46
46
  },
47
47
  maxWidht() {
48
- var o;
49
- const t = ((o = this.sizes) == null ? void 0 : o.length) - 1;
48
+ var r;
49
+ const t = ((r = this.sizes) == null ? void 0 : r.length) - 1;
50
50
  return this.calcSize(t);
51
51
  }
52
52
  },
@@ -65,26 +65,26 @@ const se = W("map", [
65
65
  key: 0,
66
66
  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
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) {
69
- var d;
70
- return (d = o.sizes) != null && d.length ? (p(), g("div", ae, [
68
+ function le(t, a, r, o, e, s) {
69
+ var g;
70
+ return (g = r.sizes) != null && g.length ? (p(), x("div", ae, [
71
71
  l("div", re, [
72
- s[0] || (s[0] = l("p", { class: "text-[10px] mb-[2px] text-[#1F2937] leading-[1.2]" }, " Дані відсутні ", -1)),
72
+ a[0] || (a[0] = l("p", { class: "text-[10px] mb-[2px] text-[#1F2937] leading-[1.2]" }, " Дані відсутні ", -1)),
73
73
  l("div", {
74
- class: V([r.sizeClass(t.index), "w-full border border-gray-500"])
74
+ class: C([s.sizeClass(t.index), "w-full border border-gray-500"])
75
75
  }, null, 2)
76
76
  ]),
77
- r.sortedSizes.length ? (p(!0), g(R, { key: 0 }, N(r.sortedSizes, (c, n) => {
78
- var h, u, v, y, f, _, b, x;
79
- return p(), g("div", {
77
+ s.sortedSizes.length ? (p(!0), x(D, { key: 0 }, R(s.sortedSizes, (c, n) => {
78
+ var y, f, b, d, _, h, u, m;
79
+ return p(), x("div", {
80
80
  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]
81
+ title: n === ((y = s.sortedSizes) == null ? void 0 : y.length) - 1 ? ">" + c : n == ((f = s.sortedSizes) == null ? void 0 : f.length) - 1 ? ">" + s.sortedSizes[((b = s.sortedSizes) == null ? void 0 : b.length) - 1] : c + "-" + s.sortedSizes[n + 1]
82
82
  }, [
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),
83
+ l("p", ne, N(n === ((d = s.sortedSizes) == null ? void 0 : d.length) - 1 ? ">" + parseInt(c) : n == ((_ = s.sortedSizes) == null ? void 0 : _.length) - 1 ? ">" + parseInt(s.sortedSizes[((h = s.sortedSizes) == null ? void 0 : h.length) - 1]) : parseInt(c) + "-" + parseInt(s.sortedSizes[n + 1])), 1),
84
84
  l("div", {
85
- class: V([r.sizeClass(n), "w-full border border-r-0 border-gray-500"]),
86
- style: j({
87
- backgroundColor: ((x = (b = e.palette) == null ? void 0 : b[o.color]) == null ? void 0 : x[n]) || o.color
85
+ class: C([s.sizeClass(n), "w-full border border-r-0 border-gray-500"]),
86
+ style: $({
87
+ backgroundColor: ((m = (u = e.palette) == null ? void 0 : u[r.color]) == null ? void 0 : m[n]) || r.color
88
88
  })
89
89
  }, null, 6)
90
90
  ], 8, ie);
@@ -94,16 +94,16 @@ function le(t, s, o, a, e, r) {
94
94
  const pe = /* @__PURE__ */ H(oe, [["render", le]]), ce = {
95
95
  __name: "icon-map",
96
96
  setup(t) {
97
- return (s, o) => (p(), z($(se), ee(s.$attrs, { size: 24 }), null, 16));
97
+ return (a, r) => (p(), z(j(se), ee(a.$attrs, { size: 24 }), null, 16));
98
98
  }
99
99
  }, de = {
100
- mixins: [Q, D],
100
+ mixins: [Q, Z],
101
101
  components: {
102
- VsMapSetting: q,
102
+ VsMapSetting: W,
103
103
  VsClusterLegend: pe,
104
- VsMapGoHome: Z,
104
+ VsMapGoHome: G,
105
105
  VsList: P,
106
- VsMapSlotLayers: G,
106
+ VsMapSlotLayers: F,
107
107
  // VsListbar,
108
108
  VsBar: J
109
109
  },
@@ -139,52 +139,62 @@ const pe = /* @__PURE__ */ H(oe, [["render", le]]), ce = {
139
139
  },
140
140
  methods: {
141
141
  async getMapData() {
142
- const t = await U.get(
143
- `/bi-cluster?widget=${this.widget}&dashboard=${this.dashboard}`
142
+ var o, e;
143
+ if (this.prefetchedData) {
144
+ this.data = this.prefetchedData, this.$emit("update:widgetData", this.data), setTimeout(() => {
145
+ var s;
146
+ return (s = this.map) == null ? void 0 : s.resize();
147
+ });
148
+ return;
149
+ }
150
+ const t = ((o = this.resolveWidgetId) == null ? void 0 : o.call(this)) || this.widget, a = ((e = this.resolveDashboardId) == null ? void 0 : e.call(this)) || this.dashboard, r = await U.get(
151
+ `/bi-cluster?widget=${t}&dashboard=${a}`
144
152
  );
145
- this.data = t, this.$emit("update:widgetData", this.data), setTimeout(() => {
153
+ this.data = r, this.$emit("update:widgetData", this.data), setTimeout(() => {
146
154
  var s;
147
155
  return (s = this.map) == null ? void 0 : s.resize();
148
156
  });
149
157
  },
150
158
  async loadHandler() {
151
- var a, e, r, d;
152
- this.baseColor = ((a = this.data.style) == null ? void 0 : a.color) || "blue";
159
+ var g, c, n, y, f, b, d;
160
+ this.baseColor = ((g = this.data.style) == null ? void 0 : g.color) || "blue";
153
161
  const t = ["case"];
154
- (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++;
162
+ (y = (n = (c = this.data) == null ? void 0 : c.sizes) == null ? void 0 : n.toReversed()) == null || y.forEach((_, h) => {
163
+ var u, m;
164
+ t.push([">", ["get", "metric"], _]), t.push((m = (u = T[this.baseColor]) == null ? void 0 : u.toReversed()) == null ? void 0 : m[h]), h++;
157
165
  }), t.push("gray");
158
- const s = {
166
+ const a = {
159
167
  type: "polygon",
160
168
  color: t,
161
169
  opacity: 0.4
162
170
  };
163
- Object.assign(s, this.data.style || {}), this.map.getSource("bi") || this.addVtileLayer({
171
+ Object.assign(a, this.data.style || {});
172
+ const r = ((f = this.resolveWidgetId) == null ? void 0 : f.call(this)) || this.widget, o = ((b = this.resolveDashboardId) == null ? void 0 : b.call(this)) || this.dashboard, e = ((d = this.resolvePrefix) == null ? void 0 : d.call(this)) || "/api";
173
+ this.map.getSource("bi") || this.addVtileLayer({
164
174
  id: "bi",
165
- url: `${window.location.origin}/api/bi-cluster-vtile/{z}/{x}/{y}.vmt?widget=${this.widget}&dashboard=${this.dashboard}&nocache=1`,
166
- style: s
175
+ url: `${window.location.origin}${e}/bi-cluster-vtile/{z}/{x}/{y}.vmt?widget=${r}&dashboard=${o}&nocache=1`,
176
+ style: a
167
177
  }), this.map.getLayer("highlighted") && this.map.removeLayer("highlighted"), this.map.getSource("highlighted") && this.map.removeSource("highlighted");
168
- const o = ["case"];
169
- this.kattotg && o.push(
178
+ const s = ["case"];
179
+ this.kattotg && s.push(
170
180
  ["==", ["to-string", ["get", "name"]], String(this.kattotg)],
171
181
  "red"
172
- ), o.push("transparent"), this.map.addLayer({
182
+ ), s.push("transparent"), this.map.addLayer({
173
183
  id: "highlighted",
174
184
  type: "fill",
175
185
  source: "bi",
176
186
  "source-layer": "bi",
177
187
  paint: {
178
- "fill-color": o,
188
+ "fill-color": s,
179
189
  "fill-opacity": 0.6
180
190
  }
181
191
  });
182
192
  },
183
193
  async createMap() {
184
- var o, a;
185
- const t = await K();
194
+ var r, o;
195
+ const t = await q();
186
196
  if (!t) return;
187
- const s = {
197
+ const a = {
188
198
  version: 8,
189
199
  glyphs: "https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",
190
200
  sources: {},
@@ -192,9 +202,9 @@ const pe = /* @__PURE__ */ H(oe, [["render", le]]), ce = {
192
202
  };
193
203
  this.map = await new t.Map({
194
204
  container: this.mapId,
195
- style: s,
205
+ style: a,
196
206
  center: [31, 48.5],
197
- zoom: ((a = (o = this.data) == null ? void 0 : o.style) == null ? void 0 : a.zoom) || 5,
207
+ zoom: ((o = (r = this.data) == null ? void 0 : r.style) == null ? void 0 : o.zoom) || 5,
198
208
  minZoom: 3,
199
209
  maxZoom: 20,
200
210
  attributionControl: !1
@@ -212,40 +222,40 @@ const pe = /* @__PURE__ */ H(oe, [["render", le]]), ce = {
212
222
  });
213
223
  },
214
224
  moveMouseHadler(t) {
215
- var s;
225
+ var a;
216
226
  try {
217
- const o = this.map.queryRenderedFeatures(t.point), a = ((s = o[0]) == null ? void 0 : s.properties) || {};
218
- if (!o.length) {
227
+ const r = this.map.queryRenderedFeatures(t.point), o = ((a = r[0]) == null ? void 0 : a.properties) || {};
228
+ if (!r.length) {
219
229
  this.map.getCanvas().style.cursor = "", this.popupElement && this.popupElement.remove();
220
230
  return;
221
231
  }
222
232
  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">
223
- ${(a == null ? void 0 : a.x) || (a == null ? void 0 : a.title) || (a == null ? void 0 : a.name) || ""}
233
+ ${(o == null ? void 0 : o.x) || (o == null ? void 0 : o.title) || (o == null ? void 0 : o.name) || ""}
224
234
  </div>
225
235
 
226
236
  <div class="flex justify-between items-center text-xs px-2 py-0.5 text-gray-500 ">
227
237
  <span class="flex items-center">
228
238
  <span class="font-medium mr-[6px]">Значення</span>
229
239
  </span>
230
- <span>${(a == null ? void 0 : a.metric) || 0}</span>
240
+ <span>${(o == null ? void 0 : o.metric) || 0}</span>
231
241
  </div>`;
232
242
  const e = this.map.project(t.lngLat);
233
243
  this.popupElement.style.left = `${e.x}px`, this.popupElement.style.top = `${e.y - 60}px`, this.map.getContainer().appendChild(this.popupElement);
234
- } catch (o) {
235
- console.error(o);
244
+ } catch (r) {
245
+ console.error(r);
236
246
  }
237
247
  }
238
248
  }
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, [
249
+ }, 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"], be = ["id"], _e = { class: "absolute flex flex-col right-[10px] top-[105px] gap-1" }, ve = { class: "h-[calc(250px)]" };
250
+ function xe(t, a, r, o, e, s) {
251
+ var d, _, h, u, m, V, k, L, E, B;
252
+ const g = v("VsMapSetting"), c = v("VsMapSlotLayers"), n = v("VsMapGoHome"), y = v("VsClusterLegend"), f = v("VsList"), b = v("VsBar");
253
+ return p(), x("div", he, [
244
254
  l("div", ue, [
245
- l("h3", me, O(t.title), 1),
255
+ l("h3", me, N(t.title), 1),
246
256
  l("div", ge, [
247
- (p(!0), g(R, null, N(e.options, (i) => (p(), g("button", {
248
- class: V(["p-1 text-gray-700 border rounded", [e.activeTab === (i == null ? void 0 : i.id) ? "ring-2 ring-blue-500" : ""]]),
257
+ (p(!0), x(D, null, R(e.options, (i) => (p(), x("button", {
258
+ class: C(["p-1 text-gray-700 border rounded", [e.activeTab === (i == null ? void 0 : i.id) ? "ring-2 ring-blue-500" : ""]]),
249
259
  onClick: (we) => e.activeTab = i == null ? void 0 : i.id
250
260
  }, [
251
261
  (p(), z(te(i == null ? void 0 : i.component), {
@@ -262,41 +272,41 @@ function ve(t, s, o, a, e, r) {
262
272
  l("div", {
263
273
  id: e.mapId,
264
274
  class: "h-full w-full flex items-end min-h-[250px]"
265
- }, null, 8, _e),
266
- e.showSetting ? (p(), z(d, {
275
+ }, null, 8, be),
276
+ e.showSetting ? (p(), z(g, {
267
277
  key: 0,
268
278
  map: e.map,
269
279
  coordinates: e.coordinatesByMouse
270
280
  }, null, 8, ["map", "coordinates"])) : S("", !0),
271
281
  w(c, { map: e.map }, null, 8, ["map"]),
272
- l("div", be, [
282
+ l("div", _e, [
273
283
  w(n, {
274
284
  map: e.map,
275
- bbox: (y = e.data) == null ? void 0 : y.bounds
285
+ bbox: (d = e.data) == null ? void 0 : d.bounds
276
286
  }, null, 8, ["map", "bbox"])
277
287
  ]),
278
- w(h, {
288
+ w(y, {
279
289
  mapId: e.mapId,
280
- colors: (f = e.data) == null ? void 0 : f.colors,
281
- sizes: (_ = e.data) == null ? void 0 : _.sizes,
290
+ colors: (_ = e.data) == null ? void 0 : _.colors,
291
+ sizes: (h = e.data) == null ? void 0 : h.sizes,
282
292
  color: e.baseColor,
283
293
  changeOpacityItem: "true",
284
294
  cluster: "true"
285
295
  }, null, 8, ["mapId", "colors", "sizes", "color"])
286
296
  ], 8, fe), [
287
- [C, e.activeTab == "map"]
297
+ [I, e.activeTab == "map"]
288
298
  ]),
289
- M(w(u, {
299
+ M(w(f, {
290
300
  mapId: e.mapId,
291
- source: (b = e.data) == null ? void 0 : b.rows,
292
- total: ((x = e.data) == null ? void 0 : x.total) || 0,
293
- count: ((I = e.data) == null ? void 0 : I.count) || 0,
294
- onKattotg: s[0] || (s[0] = (i) => e.kattotg = i)
301
+ source: (u = e.data) == null ? void 0 : u.rows,
302
+ total: ((m = e.data) == null ? void 0 : m.total) || 0,
303
+ count: ((V = e.data) == null ? void 0 : V.count) || 0,
304
+ onKattotg: a[0] || (a[0] = (i) => e.kattotg = i)
295
305
  }, null, 8, ["mapId", "source", "total", "count"]), [
296
- [C, e.activeTab == "table"]
306
+ [I, e.activeTab == "table"]
297
307
  ]),
298
- M(l("div", xe, [
299
- (L = (k = e.data) == null ? void 0 : k.rows) != null && L.length ? (p(), z(v, {
308
+ M(l("div", ve, [
309
+ (L = (k = e.data) == null ? void 0 : k.rows) != null && L.length ? (p(), z(b, {
300
310
  key: 0,
301
311
  source: (B = (E = e.data) == null ? void 0 : E.rows) == null ? void 0 : B.map((i) => ({
302
312
  title: i == null ? void 0 : i.title,
@@ -304,11 +314,11 @@ function ve(t, s, o, a, e, r) {
304
314
  }))
305
315
  }, null, 8, ["source"])) : S("", !0)
306
316
  ], 512), [
307
- [C, e.activeTab == "chart"]
317
+ [I, e.activeTab == "chart"]
308
318
  ])
309
319
  ]);
310
320
  }
311
- const Ce = /* @__PURE__ */ H(de, [["render", ve]]);
321
+ const Ie = /* @__PURE__ */ H(de, [["render", xe]]);
312
322
  export {
313
- Ce as default
323
+ Ie as default
314
324
  };
@@ -1,5 +1,5 @@
1
- import { _ as c, c as o, f as n } from "./import-file-B4o9p2_2.js";
2
- import { createElementBlock as i, openBlock as m, toDisplayString as s } from "vue";
1
+ import { _ as c, c as o, f as n } from "./import-file-D-ISqB7l.js";
2
+ import { openBlock as i, createElementBlock as m, toDisplayString as s } from "vue";
3
3
  const u = {
4
4
  name: "VsNumber",
5
5
  mixins: [o],
@@ -47,7 +47,7 @@ const u = {
47
47
  }
48
48
  }, h = { class: "text-lg lg:text-xl xl:text-2xl text-gray-800 h-[32px] flex items-center" };
49
49
  function x(e, t, r, f, l, a) {
50
- return m(), i("div", h, s(a.prefix) + s(a.formattedNumber), 1);
50
+ return i(), m("div", h, s(a.prefix) + s(a.formattedNumber), 1);
51
51
  }
52
52
  const b = /* @__PURE__ */ c(u, [["render", x]]);
53
53
  export {
@@ -1,5 +1,5 @@
1
- import { _ as m, c as f, b as _, d as b } from "./import-file-B4o9p2_2.js";
2
- import { createElementBlock as a, openBlock as r, createElementVNode as s, Fragment as n, renderList as c, toDisplayString as d } from "vue";
1
+ import { _ as m, c as f, b as _, d as b } from "./import-file-D-ISqB7l.js";
2
+ import { openBlock as a, createElementBlock as r, createElementVNode as s, Fragment as n, renderList as c, toDisplayString as d } from "vue";
3
3
  const x = {
4
4
  name: "VsTable",
5
5
  mixins: [f],
@@ -39,20 +39,20 @@ const x = {
39
39
  class: "xl:min-w-[120px] min-w-48"
40
40
  }, F = { class: "flex items-center px-1 py-3 font-medium text-gray-800 text-start gap-x-1" }, T = { class: "divide-y divide-gray-200" }, B = { class: "text-gray-600" };
41
41
  function E(t, e, o, l, N, S) {
42
- return r(), a("div", y, [
42
+ return a(), r("div", y, [
43
43
  s("div", g, [
44
44
  s("div", w, [
45
45
  s("table", k, [
46
46
  s("thead", v, [
47
47
  s("tr", D, [
48
- (r(!0), a(n, null, c(t.dimensions, (i) => (r(), a("th", $, [
48
+ (a(!0), r(n, null, c(t.dimensions, (i) => (a(), r("th", $, [
49
49
  s("div", F, d(i), 1)
50
50
  ]))), 256))
51
51
  ])
52
52
  ]),
53
53
  s("tbody", T, [
54
- (r(!0), a(n, null, c(t.sourceData, (i, p) => (r(), a("tr", { key: p }, [
55
- (r(!0), a(n, null, c(t.dimensions, (u, h) => (r(), a("td", {
54
+ (a(!0), r(n, null, c(t.sourceData, (i, p) => (a(), r("tr", { key: p }, [
55
+ (a(!0), r(n, null, c(t.dimensions, (u, h) => (a(), r("td", {
56
56
  key: h,
57
57
  class: "py-3 whitespace-nowrap"
58
58
  }, [
@@ -1,5 +1,5 @@
1
- import { _ as s, c as a, m as d } from "./import-file-B4o9p2_2.js";
2
- import { createElementBlock as n, openBlock as o, createCommentVNode as c } from "vue";
1
+ import { _ as s, c as a, m as d } from "./import-file-D-ISqB7l.js";
2
+ import { openBlock as n, createElementBlock as o, createCommentVNode as c } from "vue";
3
3
  const u = {
4
4
  name: "VsText",
5
5
  mixins: [a],
@@ -35,11 +35,11 @@ const u = {
35
35
  }
36
36
  }, l = ["id"], m = ["innerHTML"];
37
37
  function x(e, t, i, h, r, p) {
38
- return o(), n("div", {
38
+ return n(), o("div", {
39
39
  id: r.uniqueID,
40
40
  class: "relative select-auto h-full rounded-xl text-[12px] box-border bg-white custom-scrollbar text-widget"
41
41
  }, [
42
- r.markedText ? (o(), n("div", {
42
+ r.markedText ? (n(), o("div", {
43
43
  key: 0,
44
44
  innerHTML: r.markedText
45
45
  }, null, 8, m)) : c("", !0)
package/package.json CHANGED
@@ -1,75 +1,77 @@
1
- {
2
- "name": "@opengis/bi",
3
- "version": "1.2.30",
4
- "description": "BI data visualization module",
5
- "main": "dist/bi.js",
6
- "browser": "dist/bi.umd.cjs",
7
- "type": "module",
8
- "files": [
9
- "dist",
10
- "server",
11
- "plugin.js",
12
- "utils.js"
13
- ],
14
- "scripts": {
15
- "patch": "npm version patch && git push && npm publish",
16
- "prepublishOnly": "npm run build:lib",
17
- "debug": "node --watch-path=server server",
18
- "dev": "vite",
19
- "type-check": "vue-tsc --noEmit",
20
- "build": "vite build",
21
- "build:lib": "cross-env APP=true vite build",
22
- "build-app": "vite build",
23
- "lint": "eslint .",
24
- "format": "prettier --write .",
25
- "test": "node --test",
26
- "test21": "node --test ./test/plugins/*",
27
- "start": "node server.js",
28
- "prod": "NODE_ENV=production npm run start",
29
- "docs:i": "npm install --prefix ./docs",
30
- "docs:dev": "npm run --prefix ./docs docs:dev",
31
- "docs:build": "npm run --prefix ./docs docs:build",
32
- "docs:preview": "npm run --prefix ./docs docs:preview",
33
- "adduser": "node script/adduser.js"
34
- },
35
- "keywords": [
36
- "bi",
37
- "data visualization",
38
- "chart",
39
- "opengis",
40
- "vue",
41
- "fastify"
42
- ],
43
- "author": "Softpro",
44
- "license": "ISC",
45
- "dependencies": {
46
- "@mapbox/sphericalmercator": "^1.2.0",
47
- "@opengis/table": "^0.0.30",
48
- "lucide-vue-next": "^0.577.0"
49
- },
50
- "devDependencies": {
51
- "@opengis/core": "^0.0.33",
52
- "@opengis/fastify-table": "^2.0.33",
53
- "@opengis/form": "0.0.137",
54
- "@turf/turf": "^7.1.0",
55
- "@types/node": "^22.7.5",
56
- "@typescript-eslint/eslint-plugin": "^6.21.0",
57
- "@typescript-eslint/parser": "^6.21.0",
58
- "@vitejs/plugin-vue": "^5.1.4",
59
- "cross-env": "^10.1.0",
60
- "eslint": "^8.57.1",
61
- "eslint-config-airbnb-base": "^15.0.0",
62
- "eslint-config-prettier": "^9.1.0",
63
- "eslint-plugin-vue": "^9.29.0",
64
- "globals": "^15.10.0",
65
- "marked": "^14.1.2",
66
- "prettier": "^3.3.3",
67
- "rollup-plugin-visualizer": "^7.0.0",
68
- "sass-embedded": "1.89.2",
69
- "typescript": "^5.4.5",
70
- "vite": "^5.1.5",
71
- "vue": "^3.4.27",
72
- "vue-router": "^4.4.3",
73
- "vue-tsc": "^2.1.6"
74
- }
75
- }
1
+ {
2
+ "name": "@opengis/bi",
3
+ "version": "1.2.32",
4
+ "description": "BI data visualization module",
5
+ "main": "dist/bi.js",
6
+ "browser": "dist/bi.umd.cjs",
7
+ "type": "module",
8
+ "files": [
9
+ "dist",
10
+ "server",
11
+ "plugin.js",
12
+ "utils.js"
13
+ ],
14
+ "scripts": {
15
+ "patch": "npm version patch && git push && npm publish",
16
+ "prepublishOnly": "npm run build:lib",
17
+ "debug": "node --watch-path=server server",
18
+ "dev": "vite",
19
+ "type-check": "vue-tsc --noEmit",
20
+ "build": "vite build",
21
+ "build:lib": "cross-env APP=true vite build",
22
+ "build-app": "vite build",
23
+ "lint": "eslint .",
24
+ "format": "prettier --write .",
25
+ "test": "node --test",
26
+ "test21": "node --test ./test/plugins/*",
27
+ "start": "bun --env-file=.env.bi server.js",
28
+ "prod": "NODE_ENV=production npm run start",
29
+ "docs:i": "npm install --prefix ./docs",
30
+ "docs:dev": "npm run --prefix ./docs docs:dev",
31
+ "docs:build": "npm run --prefix ./docs docs:build",
32
+ "docs:preview": "npm run --prefix ./docs docs:preview",
33
+ "adduser": "node script/adduser.js"
34
+ },
35
+ "keywords": [
36
+ "bi",
37
+ "data visualization",
38
+ "chart",
39
+ "opengis",
40
+ "vue",
41
+ "fastify"
42
+ ],
43
+ "author": "Softpro",
44
+ "license": "ISC",
45
+ "dependencies": {
46
+ "@mapbox/sphericalmercator": "^1.2.0",
47
+ "@opengis/table": "^0.0.30",
48
+ "lucide-vue-next": "^0.577.0"
49
+ },
50
+ "peerDependencies": {
51
+ "@opengis/fastify-table": "^2.1.3"
52
+ },
53
+ "devDependencies": {
54
+ "@opengis/core": "^0.0.33",
55
+ "@opengis/form": "0.0.137",
56
+ "@turf/turf": "^7.3.4",
57
+ "@types/node": "^22.19.17",
58
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
59
+ "@typescript-eslint/parser": "^6.21.0",
60
+ "@vitejs/plugin-vue": "^5.2.4",
61
+ "cross-env": "^10.1.0",
62
+ "eslint": "^8.57.1",
63
+ "eslint-config-airbnb-base": "^15.0.0",
64
+ "eslint-config-prettier": "^9.1.2",
65
+ "eslint-plugin-vue": "^9.33.0",
66
+ "globals": "^15.15.0",
67
+ "marked": "^14.1.4",
68
+ "prettier": "^3.8.1",
69
+ "rollup-plugin-visualizer": "^7.0.1",
70
+ "sass-embedded": "1.89.2",
71
+ "typescript": "^5.9.3",
72
+ "vite": "^5.4.21",
73
+ "vue": "^3.5.32",
74
+ "vue-router": "^4.6.4",
75
+ "vue-tsc": "^2.2.12"
76
+ }
77
+ }
package/plugin.js CHANGED
@@ -1,22 +1,21 @@
1
- import fp from 'fastify-plugin';
2
- // import path from 'node:path';
3
- // import { fileURLToPath } from 'url';
4
-
5
- //import { config, addTemplateDir, execMigrations } from '@opengis/fastify-table/utils.js';
6
-
7
- //const fileName = fileURLToPath(import.meta.url);
8
- // const dirName = path.dirname(fileName);
9
-
10
- async function plugin(fastify, opt) {
11
- fastify.register(import('./server/routes/dashboard/index.mjs'), opt);
12
- fastify.register(import('./server/routes/dataset/index.mjs'), opt);
13
-
14
- fastify.register(import('./server/routes/data/index.mjs'), opt);
15
- fastify.register(import('./server/routes/edit/index.mjs'), opt);
16
- fastify.register(import('./server/routes/map/index.mjs'), opt);
17
- // config.templates?.forEach(el => addTemplateDir(el));
18
-
19
- // const dir = path.join(dirName, 'server/migrations');
20
- // execMigrations(dir).catch(err => console.log(err));
21
- }
22
- export default fp(plugin);
1
+ import fp from 'fastify-plugin';
2
+ import path from 'node:path';
3
+ import { fileURLToPath } from 'url';
4
+
5
+ import { /*config, addTemplateDir,*/ pgClients, execMigrations } from '@opengis/fastify-table/utils.js';
6
+
7
+ const dirName = path.dirname(fileURLToPath(import.meta.url));
8
+
9
+ async function plugin(fastify, opt) {
10
+ fastify.register(import('./server/routes/dashboard/index.mjs'), opt);
11
+ fastify.register(import('./server/routes/dataset/index.mjs'), opt);
12
+
13
+ fastify.register(import('./server/routes/data/index.mjs'), opt);
14
+ fastify.register(import('./server/routes/edit/index.mjs'), opt);
15
+ fastify.register(import('./server/routes/map/index.mjs'), opt);
16
+ // config.templates?.forEach(el => addTemplateDir(el));
17
+
18
+ const dir = path.join(dirName, 'server/migrations');
19
+ execMigrations(dir, pgClients.client).catch(err => console.log(err));
20
+ }
21
+ export default fp(plugin);
@@ -1,17 +1,17 @@
1
- import md from 'markdown-it';
2
-
3
- const md1 = md({ html: true });
4
-
5
- /**
6
- * Перетворення з файла readme.md до формату HTML.
7
- * Потрабно вставити в хелпер шлях до файла або текст readme.md і за допомогою бібліотеки markdown-it перетвориться в HTML.
8
-
9
- * @returns {String} Returns HTML
10
- */
11
- export default function mdToHTML(data, options) {
12
- // auto detect HTML or MD
13
- // const result = md().render(data);
14
- if (!data) return 'empty data';
15
- const result = md1.render(data);
16
- return result;
17
- };
1
+ import md from 'markdown-it';
2
+
3
+ const md1 = md({ html: true });
4
+
5
+ /**
6
+ * Перетворення з файла readme.md до формату HTML.
7
+ * Потрабно вставити в хелпер шлях до файла або текст readme.md і за допомогою бібліотеки markdown-it перетвориться в HTML.
8
+
9
+ * @returns {String} Returns HTML
10
+ */
11
+ export default function mdToHTML(data, options) {
12
+ // auto detect HTML or MD
13
+ // const result = md().render(data);
14
+ if (!data) return 'empty data';
15
+ const result = md1.render(data);
16
+ return result;
17
+ };