@opengis/admin 0.1.32 → 0.1.34

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,7 +1,7 @@
1
1
  import { u as $ } from "./userMenu-CT1xO2Pt.js";
2
- import { _ as V, a as z } from "./import-file-BtyRoYT7.js";
3
- import { resolveComponent as N, openBlock as n, createElementBlock as c, createElementVNode as u, toDisplayString as j, createVNode as q, withCtx as B, createTextVNode as E, normalizeClass as T, Fragment as k, renderList as M, createBlock as L, resolveDynamicComponent as H, createCommentVNode as v } from "vue";
4
- const A = {
2
+ import { _ as V, a as m } from "./import-file-TPXyIRQU.js";
3
+ import { resolveComponent as z, openBlock as n, createElementBlock as c, createElementVNode as d, toDisplayString as C, createVNode as N, withCtx as q, createTextVNode as B, normalizeClass as T, Fragment as k, renderList as M, createBlock as L, resolveDynamicComponent as H, createCommentVNode as v } from "vue";
4
+ const E = {
5
5
  data() {
6
6
  return {
7
7
  objectData: null,
@@ -19,17 +19,17 @@ const A = {
19
19
  return r || this.$router.replace("/404"), r == null ? void 0 : r.path;
20
20
  },
21
21
  getTitle() {
22
- var t, r, a, l, s, h, i, x, g, d, o, C, w, e, y;
22
+ var t, r, a, l, s, h, i, x, g, u, o, j, w, e, y;
23
23
  if ((a = (r = (t = this.objectData) == null ? void 0 : t.rows) == null ? void 0 : r[0]) != null && a.name)
24
- return ((i = (h = (s = (l = this.objectData) == null ? void 0 : l.rows) == null ? void 0 : s[0]) == null ? void 0 : h.name) == null ? void 0 : i.length) < 35 ? (d = (g = (x = this.objectData) == null ? void 0 : x.rows) == null ? void 0 : g[0]) == null ? void 0 : d.name : ((e = (w = (C = (o = this.objectData) == null ? void 0 : o.rows) == null ? void 0 : C[0]) == null ? void 0 : w.name) == null ? void 0 : e.slice(0, 35)) + " ...";
24
+ return ((i = (h = (s = (l = this.objectData) == null ? void 0 : l.rows) == null ? void 0 : s[0]) == null ? void 0 : h.name) == null ? void 0 : i.length) < 35 ? (u = (g = (x = this.objectData) == null ? void 0 : x.rows) == null ? void 0 : g[0]) == null ? void 0 : u.name : ((e = (w = (j = (o = this.objectData) == null ? void 0 : o.rows) == null ? void 0 : j[0]) == null ? void 0 : w.name) == null ? void 0 : e.slice(0, 35)) + " ...";
25
25
  {
26
- const p = (y = this.flattenMenu($.value)) == null ? void 0 : y.find(
27
- (b) => {
26
+ const b = (y = this.flattenMenu($.value)) == null ? void 0 : y.find(
27
+ (p) => {
28
28
  var f, _;
29
- return (b == null ? void 0 : b.table) === ((_ = (f = this.$route) == null ? void 0 : f.params) == null ? void 0 : _.table);
29
+ return (p == null ? void 0 : p.table) === ((_ = (f = this.$route) == null ? void 0 : f.params) == null ? void 0 : _.table);
30
30
  }
31
31
  );
32
- return p == null ? void 0 : p.ua;
32
+ return b == null ? void 0 : b.ua;
33
33
  }
34
34
  }
35
35
  },
@@ -47,7 +47,7 @@ const A = {
47
47
  const { table: t, id: r } = (a = this.$route) == null ? void 0 : a.params;
48
48
  (!t || !r) && this.$router.replace("/404");
49
49
  try {
50
- const { data: l } = await z.get(`/api/table-data/${t}/${r}`);
50
+ const { data: l } = await m.get(`/api/table-data/${t}/${r}`);
51
51
  this.objectData = l;
52
52
  } catch (l) {
53
53
  console.error(l);
@@ -64,8 +64,8 @@ const A = {
64
64
  if ((r = (t = this.$route) == null ? void 0 : t.query) != null && r.tab)
65
65
  this.component = (l = (a = this.$route) == null ? void 0 : a.query) == null ? void 0 : l.tab;
66
66
  else {
67
- const d = (h = (s = this.objectData) == null ? void 0 : s.panels) == null ? void 0 : h.find((o) => (o == null ? void 0 : o.type) === "tabs");
68
- (i = d == null ? void 0 : d.items) != null && i.length && (this.component = ((x = d.items[0]) == null ? void 0 : x.component) || ((g = d.items[0]) == null ? void 0 : g.name));
67
+ const u = (h = (s = this.objectData) == null ? void 0 : s.panels) == null ? void 0 : h.find((o) => (o == null ? void 0 : o.type) === "tabs");
68
+ (i = u == null ? void 0 : u.items) != null && i.length && (this.component = ((x = u.items[0]) == null ? void 0 : x.component) || ((g = u.items[0]) == null ? void 0 : g.name));
69
69
  }
70
70
  },
71
71
  flattenMenu(t) {
@@ -75,10 +75,10 @@ const A = {
75
75
  }), r;
76
76
  }
77
77
  }
78
- }, G = {
78
+ }, A = {
79
79
  style: { width: "calc(100vw - 260px)", height: "calc(100vh - 60px)" },
80
80
  class: "bg-gray-50 overflow-y-auto"
81
- }, O = { class: "h-[76px] bg-gray-50 flex items-center justify-between px-[30px]" }, R = { class: "" }, m = { class: "text-lg md:text-xl font-semibold text-stone-800 dark:text-neutral-200" }, F = { class: "flex items-center gap-[6px]" }, I = {
81
+ }, G = { class: "h-[76px] bg-gray-50 flex items-center justify-between px-[30px]" }, O = { class: "" }, R = { class: "text-lg md:text-xl font-semibold text-stone-800 dark:text-neutral-200" }, F = { class: "flex items-center gap-[6px]" }, I = {
82
82
  key: 0,
83
83
  class: "border rounded-xl bg-white"
84
84
  }, P = { class: "p-[10px] pl-[20px] text-xl" }, S = ["innerHTML"], J = { key: 1 }, K = { class: "p-[10px] pl-[20px] text-xl" }, Q = {
@@ -87,72 +87,72 @@ const A = {
87
87
  }, U = {
88
88
  key: 1,
89
89
  class: "p-[20px] border-t"
90
- }, W = ["innerHTML"], X = { class: "flex space-x-1 w-full bg-white border rounded-xl h-[60px] items-center pl-[20px]" }, Y = ["onClick"], Z = {
90
+ }, W = ["innerHTML"], X = { class: "flex space-x-1 w-full bg-white border border-b-0 rounded-tr-xl rounded-tl-xl h-[60px] items-center pl-[20px]" }, Y = ["onClick"], Z = {
91
91
  key: 0,
92
- class: "border rounded-xl bg-white mt-[20px]"
93
- }, ee = { class: "p-[10px] pl-[20px] text-xl" }, te = {
92
+ class: "border rounded-bl-xl border-t-0 rounded-br-xl bg-white"
93
+ }, ee = {
94
94
  key: 0,
95
95
  class: "p-[20px] border-t"
96
- }, oe = {
96
+ }, te = {
97
97
  key: 1,
98
98
  class: "p-[20px] border-t"
99
- }, re = ["innerHTML"];
100
- function se(t, r, a, l, s, h) {
101
- var x, g, d;
102
- const i = N("router-link");
103
- return n(), c("div", G, [
104
- u("div", O, [
105
- u("div", R, [
106
- u("button", {
99
+ }, oe = ["innerHTML"];
100
+ function re(t, r, a, l, s, h) {
101
+ var x, g, u;
102
+ const i = z("router-link");
103
+ return n(), c("div", A, [
104
+ d("div", G, [
105
+ d("div", O, [
106
+ d("button", {
107
107
  onClick: r[0] || (r[0] = (o) => t.$router.back()),
108
108
  class: "text-sm h-[20px] text-blue-600 font-medium hover:border-b hover:border-b-2 hover:border-b-blue-500"
109
109
  }, " До таблиці "),
110
- u("h2", m, j(h.getTitle), 1)
110
+ d("h2", R, C(h.getTitle), 1)
111
111
  ]),
112
- u("div", F, [
113
- q(i, {
112
+ d("div", F, [
113
+ N(i, {
114
114
  to: `/edit?table=${h.getRoute}&id=${(g = (x = t.$route) == null ? void 0 : x.params) == null ? void 0 : g.id}`,
115
115
  class: "py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 hover:text-white duration-300"
116
116
  }, {
117
- default: B(() => r[1] || (r[1] = [
118
- E(" Редагувати ")
117
+ default: q(() => r[1] || (r[1] = [
118
+ B(" Редагувати ")
119
119
  ])),
120
120
  _: 1
121
121
  }, 8, ["to"])
122
122
  ])
123
123
  ]),
124
- u("div", {
124
+ d("div", {
125
125
  class: T(["grid gap-[20px]", h.getGridClass()])
126
126
  }, [
127
- (n(!0), c(k, null, M((d = s.objectData) == null ? void 0 : d.panels, (o, C) => {
127
+ (n(!0), c(k, null, M((u = s.objectData) == null ? void 0 : u.panels, (o, j) => {
128
128
  var w;
129
129
  return n(), c("div", {
130
- key: C,
130
+ key: j,
131
131
  class: T([h.getColClass(o.col), "p-4"])
132
132
  }, [
133
133
  o != null && o.name ? (n(), c("div", I, [
134
- u("h2", P, j((o == null ? void 0 : o.title) || "Панель"), 1),
135
- u("div", {
134
+ d("h2", P, C((o == null ? void 0 : o.title) || "Панель"), 1),
135
+ d("div", {
136
136
  class: "p-[20px] border-t",
137
137
  innerHTML: (w = s.objectData) == null ? void 0 : w.data[o == null ? void 0 : o.name]
138
138
  }, null, 8, S)
139
139
  ])) : o.type === "container" ? (n(), c("div", J, [
140
140
  (n(!0), c(k, null, M(o.items, (e, y) => {
141
- var p, b, f, _, D;
141
+ var b, p, f, _, D;
142
142
  return n(), c("div", {
143
143
  key: y,
144
144
  class: "border rounded-xl bg-white mb-[20px]"
145
145
  }, [
146
- u("h2", K, j((e == null ? void 0 : e.title) || "Панель"), 1),
146
+ d("h2", K, C((e == null ? void 0 : e.title) || "Панель"), 1),
147
147
  e != null && e.component ? (n(), c("div", Q, [
148
148
  (n(), L(H(e.component), {
149
- geometry: (b = (p = s.objectData) == null ? void 0 : p.rows[0]) == null ? void 0 : b.geom,
149
+ geometry: (p = (b = s.objectData) == null ? void 0 : b.rows[0]) == null ? void 0 : p.geom,
150
150
  zoom: 16,
151
151
  id: (_ = (f = t.$route) == null ? void 0 : f.params) == null ? void 0 : _.id
152
152
  }, null, 8, ["geometry", "id"]))
153
153
  ])) : v("", !0),
154
154
  e != null && e.name ? (n(), c("div", U, [
155
- u("div", {
155
+ d("div", {
156
156
  innerHTML: (D = s.objectData) == null ? void 0 : D.data[e == null ? void 0 : e.name]
157
157
  }, null, 8, W)
158
158
  ])) : v("", !0)
@@ -160,7 +160,7 @@ function se(t, r, a, l, s, h) {
160
160
  }), 128))
161
161
  ])) : v("", !0),
162
162
  (o == null ? void 0 : o.type) === "tabs" ? (n(), c(k, { key: 2 }, [
163
- u("nav", X, [
163
+ d("nav", X, [
164
164
  (n(!0), c(k, null, M(o == null ? void 0 : o.items, (e) => (n(), c("button", {
165
165
  key: (e == null ? void 0 : e.name) || (e == null ? void 0 : e.component),
166
166
  onClick: (y) => s.component = (e == null ? void 0 : e.component) || (e == null ? void 0 : e.name),
@@ -168,24 +168,23 @@ function se(t, r, a, l, s, h) {
168
168
  " font-semibold after:absolute after:bottom-[-14px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800": s.component === (e == null ? void 0 : e.component) || s.component === (e == null ? void 0 : e.name),
169
169
  "": s.component !== (e == null ? void 0 : e.component) && s.component !== (e == null ? void 0 : e.name)
170
170
  }])
171
- }, j(e == null ? void 0 : e.title), 11, Y))), 128))
171
+ }, C(e == null ? void 0 : e.title), 11, Y))), 128))
172
172
  ]),
173
173
  (n(!0), c(k, null, M(o.items, (e, y) => {
174
- var p, b, f, _, D;
174
+ var b, p, f, _, D;
175
175
  return n(), c(k, { key: y }, [
176
176
  s.component === (e == null ? void 0 : e.component) || s.component === (e == null ? void 0 : e.name) ? (n(), c("div", Z, [
177
- u("h2", ee, j((e == null ? void 0 : e.title) || "Панель"), 1),
178
- e != null && e.component ? (n(), c("div", te, [
177
+ e != null && e.component ? (n(), c("div", ee, [
179
178
  (n(), L(H(e.component), {
180
- geometry: (b = (p = s.objectData) == null ? void 0 : p.rows[0]) == null ? void 0 : b.geom,
179
+ geometry: (p = (b = s.objectData) == null ? void 0 : b.rows[0]) == null ? void 0 : p.geom,
181
180
  zoom: 16,
182
181
  id: (_ = (f = t.$route) == null ? void 0 : f.params) == null ? void 0 : _.id
183
182
  }, null, 8, ["geometry", "id"]))
184
183
  ])) : v("", !0),
185
- e != null && e.name ? (n(), c("div", oe, [
186
- u("div", {
184
+ e != null && e.name ? (n(), c("div", te, [
185
+ d("div", {
187
186
  innerHTML: (D = s.objectData) == null ? void 0 : D.data[e == null ? void 0 : e.name]
188
- }, null, 8, re)
187
+ }, null, 8, oe)
189
188
  ])) : v("", !0)
190
189
  ])) : v("", !0)
191
190
  ], 64);
@@ -196,7 +195,7 @@ function se(t, r, a, l, s, h) {
196
195
  ], 2)
197
196
  ]);
198
197
  }
199
- const le = /* @__PURE__ */ V(A, [["render", se], ["__scopeId", "data-v-e7d9ada1"]]);
198
+ const ce = /* @__PURE__ */ V(E, [["render", re], ["__scopeId", "data-v-9b7dd8fb"]]);
200
199
  export {
201
- le as default
200
+ ce as default
202
201
  };
@@ -1,5 +1,5 @@
1
1
  import { resolveComponent as e, openBlock as r, createBlock as t } from "vue";
2
- import { _ as c } from "./import-file-BtyRoYT7.js";
2
+ import { _ as c } from "./import-file-TPXyIRQU.js";
3
3
  const n = {};
4
4
  function s(_, p, a, i, f, m) {
5
5
  const o = e("router-view");
@@ -1,5 +1,5 @@
1
1
  import { u as m } from "./userMenu-CT1xO2Pt.js";
2
- import { _ as b, a as n } from "./import-file-BtyRoYT7.js";
2
+ import { _ as b, a as n } from "./import-file-TPXyIRQU.js";
3
3
  import { resolveComponent as d, openBlock as u, createElementBlock as h, createElementVNode as i, createBlock as p, createCommentVNode as f } from "vue";
4
4
  const g = {
5
5
  data() {
@@ -3577,17 +3577,17 @@ function PI(t, e) {
3577
3577
  return [i, n, s];
3578
3578
  }
3579
3579
  const II = [
3580
- { name: "edit", path: "/edit", component: () => import("./edit-page-DxYGPaLO.js") },
3581
- { name: "add", path: "/add", component: () => import("./add-page-D_Fg9HXW.js") },
3580
+ { name: "edit", path: "/edit", component: () => import("./edit-page-BQeZdV0L.js") },
3581
+ { name: "add", path: "/add", component: () => import("./add-page-Bv_wvATF.js") },
3582
3582
  {
3583
3583
  name: "card-view",
3584
3584
  path: "/card",
3585
- component: () => import("./card-view-BqFARR8P.js"),
3585
+ component: () => import("./card-view-1snBXBlI.js"),
3586
3586
  children: [{
3587
3587
  name: "table",
3588
3588
  path: ":table",
3589
- component: () => import("./card-view-BqFARR8P.js"),
3590
- children: [{ name: "card", path: ":id", component: () => import("./card-page-DBDmzwDl.js") }]
3589
+ component: () => import("./card-view-1snBXBlI.js"),
3590
+ children: [{ name: "card", path: ":id", component: () => import("./card-page-g1grg09l.js") }]
3591
3591
  }]
3592
3592
  }
3593
3593
  ], DI = {}, OI = { class: "bg-gray-200 w-full px-16 md:px-0 h-screen flex items-center justify-center" }, zI = { class: "bg-white border border-gray-200 flex flex-col items-center justify-center px-4 md:px-8 lg:px-24 py-8 rounded-lg shadow-2xl" };
@@ -3635,13 +3635,13 @@ const LI = /* @__PURE__ */ ai(DI, [["render", RI]]), FI = (t) => {
3635
3635
  {
3636
3636
  path: "/",
3637
3637
  name: "global",
3638
- component: () => import("./admin-view-DEPFLjx8.js"),
3638
+ component: () => import("./admin-view-D3h6obEF.js"),
3639
3639
  children: [
3640
3640
  ...e,
3641
3641
  ...t,
3642
3642
  {
3643
3643
  path: "/:catchAll(.*)",
3644
- component: () => import("./admin-interface-BRAtve0X.js")
3644
+ component: () => import("./admin-interface-BAVzcGBR.js")
3645
3645
  }
3646
3646
  ]
3647
3647
  }
@@ -45749,7 +45749,7 @@ const d8 = /* @__PURE__ */ ai(r8, [["render", h8]]), p8 = {
45749
45749
  this.commentContent = t;
45750
45750
  }
45751
45751
  }
45752
- }, f8 = { class: "w-full widget-comment-form" }, m8 = { class: "mb-4 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700" }, g8 = { class: "flex justify-end" };
45752
+ }, f8 = { class: "w-full widget-comment-form" }, m8 = { class: "mb-4 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700" }, g8 = { class: "flex" };
45753
45753
  function y8(t, e, i, n, s, l) {
45754
45754
  const u = Ri("VsTextEditor");
45755
45755
  return Fe(), Ye("div", f8, [
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .map-popup__vertical[data-v-3f5a9aff]{overflow:auto;max-height:300px}.map-popup__vertical[data-v-3f5a9aff]::-webkit-scrollbar{width:6px;height:6px;background-color:#f5f5f5}.map-popup__vertical[data-v-3f5a9aff]::-webkit-scrollbar-thumb{border-radius:5px;background-color:#dedede}.map-popup__vertical[data-v-3f5a9aff]::-webkit-scrollbar-track{background-color:#f5f5f5}.map__popup-body[data-v-3f5a9aff]{table-layout:fixed;width:100%}.map__popup-body-item[data-v-3f5a9aff]:not(:last-child){border-bottom:1px solid #eeeeee}.map__popup-body-item td[data-v-3f5a9aff]{width:50%;word-wrap:break-word;text-align:start}.map__popup-body-item td[data-v-3f5a9aff]:first-child{font-weight:600}.popup-image[data-v-deb51e0a]{max-width:100%;max-height:220px;margin-bottom:10px;object-fit:contain}.maplibregl-ctrl-bottom-right,.maplibregl-popup-close-button{display:none}.widget-file .vs-button{background-color:#2563eb;color:#fff;font-size:.875rem;line-height:1.25rem;font-weight:600}.ui-dialog__modal div.flex.justify-between.items-center.py-3.px-4.border-b{border-bottom-width:0px;--tw-text-opacity: 1;color:#1f2937;font-weight:500;font-size:1.125rem;line-height:1.75rem;padding-bottom:0rem}.ui-dialog__modal .ui-dialog__content .p-4{padding-top:0rem}.widget-images__item-desc span:first-child:after{content:"";width:2px;height:2px;border-radius:50%;display:flex;align-items:center;background:#676a6c;margin:0 5px}.disabled{cursor:not-allowed!important}.item__text-content,.item{transition:all .5s cubic-bezier(.4,0,.2,1)}.item:hover .item__text-content{opacity:.8}.vs-widget-images .vs-button{background-color:#2563eb;color:#fff;font-size:.875rem;line-height:1.25rem;font-weight:600}.editor-container{max-width:800px;margin:0 auto}.ProseMirror-focused{outline:none}.editor-toolbar{background-color:#f9fafb}.editor-content{min-height:200px}button{transition:background-color .2s ease;outline:none}button:focus{outline:none}.editor-content ul{margin-left:20px}.editor-content ul>li{list-style:disc}.editor-content ol{list-style-type:decimal;margin-left:20px}code{background-color:#d3d1d1;border-radius:4px}.mention-popup{background-color:#fafafa;padding:10px;border-radius:10px;box-shadow:0 4px 6px #0000001a;z-index:1000;max-width:200px;overflow-y:auto;width:auto}.mention-option{padding:5px 10px;cursor:pointer;transition:background-color .2s;border-radius:8px}.mention-option:hover{background-color:#f0f0f0}.border-top:not(:first-child){--tw-border-opacity: 1;border-color:#e5e7eb;border-top-width:1px}.widget-comment-form .vs-button{padding:.625rem 1rem;font-size:.75rem;line-height:1rem;font-weight:500}.widget-comment-form .vs-button:focus{border:transparent;--tw-ring-opacity: 1;--tw-ring-color: rgb(191 219 254);--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 rgba(0, 0, 0, 0))}.grid[data-v-e7d9ada1]{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:1rem}.admin-wrapper[data-v-3d7ecdff]{display:flex;height:100vh;align-items:start}.vs-popover__content>div{padding:.25rem}
1
+ .map-popup__vertical[data-v-3f5a9aff]{overflow:auto;max-height:300px}.map-popup__vertical[data-v-3f5a9aff]::-webkit-scrollbar{width:6px;height:6px;background-color:#f5f5f5}.map-popup__vertical[data-v-3f5a9aff]::-webkit-scrollbar-thumb{border-radius:5px;background-color:#dedede}.map-popup__vertical[data-v-3f5a9aff]::-webkit-scrollbar-track{background-color:#f5f5f5}.map__popup-body[data-v-3f5a9aff]{table-layout:fixed;width:100%}.map__popup-body-item[data-v-3f5a9aff]:not(:last-child){border-bottom:1px solid #eeeeee}.map__popup-body-item td[data-v-3f5a9aff]{width:50%;word-wrap:break-word;text-align:start}.map__popup-body-item td[data-v-3f5a9aff]:first-child{font-weight:600}.popup-image[data-v-deb51e0a]{max-width:100%;max-height:220px;margin-bottom:10px;object-fit:contain}.maplibregl-ctrl-bottom-right,.maplibregl-popup-close-button{display:none}.widget-file .vs-button{background-color:#2563eb;color:#fff;font-size:.875rem;line-height:1.25rem;font-weight:600}.ui-dialog__modal div.flex.justify-between.items-center.py-3.px-4.border-b{border-bottom-width:0px;--tw-text-opacity: 1;color:#1f2937;font-weight:500;font-size:1.125rem;line-height:1.75rem;padding-bottom:0rem}.ui-dialog__modal .ui-dialog__content .p-4{padding-top:0rem}.widget-images__item-desc span:first-child:after{content:"";width:2px;height:2px;border-radius:50%;display:flex;align-items:center;background:#676a6c;margin:0 5px}.disabled{cursor:not-allowed!important}.item__text-content,.item{transition:all .5s cubic-bezier(.4,0,.2,1)}.item:hover .item__text-content{opacity:.8}.vs-widget-images .vs-button{background-color:#2563eb;color:#fff;font-size:.875rem;line-height:1.25rem;font-weight:600}.editor-container{max-width:800px;margin:0 auto}.ProseMirror-focused{outline:none}.editor-toolbar{background-color:#f9fafb}.editor-content{min-height:200px}button{transition:background-color .2s ease;outline:none}button:focus{outline:none}.editor-content ul{margin-left:20px}.editor-content ul>li{list-style:disc}.editor-content ol{list-style-type:decimal;margin-left:20px}code{background-color:#d3d1d1;border-radius:4px}.mention-popup{background-color:#fafafa;padding:10px;border-radius:10px;box-shadow:0 4px 6px #0000001a;z-index:1000;max-width:200px;overflow-y:auto;width:auto}.mention-option{padding:5px 10px;cursor:pointer;transition:background-color .2s;border-radius:8px}.mention-option:hover{background-color:#f0f0f0}.border-top:not(:first-child){--tw-border-opacity: 1;border-color:#e5e7eb;border-top-width:1px}.widget-comment-form .vs-button{padding:.625rem 1rem;font-size:.75rem;line-height:1rem;font-weight:500}.widget-comment-form .vs-button:focus{border:transparent;--tw-ring-opacity: 1;--tw-ring-color: rgb(191 219 254);--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 rgba(0, 0, 0, 0))}.grid[data-v-9b7dd8fb]{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:1rem}.admin-wrapper[data-v-3d7ecdff]{display:flex;height:100vh;align-items:start}.vs-popover__content>div{padding:.25rem}
@@ -0,0 +1,71 @@
1
+ {
2
+ "property_key": {
3
+ "ua": "Ключ",
4
+ "type": "Text",
5
+ "validators": [
6
+ "required"
7
+ ],
8
+ "col": 6
9
+ },
10
+ "property_type": {
11
+ "ua": "Тип",
12
+ "type": "Select",
13
+ "options": [
14
+ {
15
+ "id": "filter",
16
+ "text": "Filter"
17
+ },
18
+ {
19
+ "id": "column",
20
+ "text": "Column"
21
+ }
22
+ ],
23
+ "validators": [
24
+ "required"
25
+ ],
26
+ "col": 6
27
+ },
28
+ "property_entity": {
29
+ "ua": "Таблиця",
30
+ "type": "Text",
31
+ "validators": [
32
+ "required"
33
+ ],
34
+ "col": 6
35
+ },
36
+ "property_title": {
37
+ "ua": "Назва",
38
+ "type": "Text",
39
+ "validators": [
40
+ "required"
41
+ ],
42
+ "col": 6
43
+ },
44
+ "property_format": {
45
+ "ua": "Формат",
46
+ "type": "Select",
47
+ "options": [
48
+ {
49
+ "id": "text",
50
+ "text": "Text"
51
+ },
52
+ {
53
+ "id": "select",
54
+ "text": "Select"
55
+ },
56
+ {
57
+ "id": "date",
58
+ "text": "Date"
59
+ }
60
+ ],
61
+ "validators": [
62
+ "required"
63
+ ],
64
+ "col": 6
65
+ },
66
+ "property_data": {
67
+ "ua": "Випадаючий список",
68
+ "type": "Text",
69
+ "col": 6
70
+ }
71
+ }
@@ -33,7 +33,13 @@
33
33
  "path": "admin.user_properties",
34
34
  "table": "admin.user_properties.table",
35
35
  "ua": "Налаштування користувача",
36
- "en": "Settings"
36
+ "en": "User settings"
37
+ },
38
+ {
39
+ "path": "admin.table_properties",
40
+ "table": "admin.table_properties.table",
41
+ "ua": "Налаштування таблиць користувача",
42
+ "en": "User table settings"
37
43
  }
38
44
  ]
39
45
  }
@@ -0,0 +1,82 @@
1
+ {
2
+ "ua": "Налаштування таблиць користувача",
3
+ "key": "property_id",
4
+ "form": "admin.table_properties.form",
5
+ "table": "admin.table_properties",
6
+ "order": "cdate desc",
7
+ "meta": {
8
+ "search": "property_key"
9
+ },
10
+ "columns": [
11
+ {
12
+ "name": "property_key",
13
+ "title": "Ключ",
14
+ "format": "text"
15
+ },
16
+ {
17
+ "name": "property_type",
18
+ "title": "Тип",
19
+ "format": "text"
20
+ },
21
+ {
22
+ "name": "property_entity",
23
+ "title": "Таблиця",
24
+ "format": "text"
25
+ },
26
+ {
27
+ "name": "property_title",
28
+ "title": "Назва",
29
+ "format": "text"
30
+ },
31
+ {
32
+ "name": "property_format",
33
+ "title": "Формат",
34
+ "format": "text"
35
+ },
36
+ {
37
+ "name": "property_data",
38
+ "title": "Випадаючий список",
39
+ "format": "text"
40
+ },
41
+ {
42
+ "name": "uid",
43
+ "title": "Користувач",
44
+ "option": "core.user_uid",
45
+ "format": "select"
46
+ }
47
+
48
+ ],
49
+ "filters": [
50
+ {
51
+ "ua": "Ключ",
52
+ "name": "property_key",
53
+ "type": "text"
54
+ },
55
+ {
56
+ "ua": "Тип",
57
+ "name": "property_type",
58
+ "type": "Text"
59
+ },
60
+ {
61
+ "ua": "Таблиця",
62
+ "name": "property_entity",
63
+ "type": "text"
64
+ },
65
+ {
66
+ "ua": "Назва",
67
+ "name": "property_title",
68
+ "type": "text"
69
+ },
70
+ {
71
+ "name": "property_format",
72
+ "ua": "Формат",
73
+ "type": "Text"
74
+ },
75
+ {
76
+ "name": "uid",
77
+ "title": "Користувач",
78
+ "data": "core.user_uid",
79
+ "type": "Text"
80
+ }
81
+ ]
82
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/admin",
3
- "version": "0.1.32",
3
+ "version": "0.1.34",
4
4
  "description": "This project Softpro Admin",
5
5
  "main": "dist/admin.js",
6
6
  "type": "module",
package/plugin.js CHANGED
@@ -2,7 +2,7 @@ import fp from 'fastify-plugin';
2
2
  import fs from 'node:fs';
3
3
  import path from 'node:path';
4
4
 
5
- import { userTemplateDir, getTemplate, pgClients } from '@opengis/fastify-table/utils.js';
5
+ import { getTemplatePath, getTemplate, pgClients } from '@opengis/fastify-table/utils.js';
6
6
 
7
7
  import config from './config.js';
8
8
  import getMenu from './server/routes/menu/controllers/getMenu.js';
@@ -55,30 +55,30 @@ async function plugin(fastify, opts = config) {
55
55
  const clsQuery = [];
56
56
  if (!pg.pk?.['admin.cls']) return;
57
57
 
58
- const cls = userTemplateDir
59
- ?.reduce((acc, curr) => { [`${curr}/cls`, `${curr}/select`].forEach((el) => acc.push(el)); return acc; }, [])
60
- ?.filter((el) => fs.existsSync(el))
61
- ?.map((el) => ({ module: path.basename(path.dirname(el)), files: fs.readdirSync(el)?.filter((item) => el === 'cls' ? true : path.extname(item) === '.sql') }))
62
- ?.filter((el) => el.files?.length);
58
+ const selectList = await getTemplatePath('select');
59
+ const clsList = (await getTemplatePath('cls'))?.filter((el) => !(selectList?.map((el) => el?.[0]) || []).includes(el[0]));
60
+ const cls = (selectList || []).concat(clsList || [])
61
+ ?.map((el) => ({ name: el[0], module: path.basename(path.dirname(path.dirname(el[1]))), type: { 'json': 'cls', 'sql': 'select' }[el[2]] }))
63
62
  if (!cls?.length) return;
64
63
 
64
+ const dupes = cls.filter((el, idx, arr) => arr.map((item) => item.name).indexOf(el.name) !== idx);
65
+ console.log('cls insert skip dupes', dupes.map((el) => el.name));
66
+
65
67
  try {
66
- await Promise.all(cls.map(async (el1) => {
67
- const { module, files } = el1;
68
- await Promise.all((files.map(async (el) => {
69
- const { ext, name } = path.parse(el);
70
- const type = { '.json': 'cls', '.sql': 'select' }[ext];
68
+ await Promise.all(cls.filter((el, idx, arr) => arr.map((item) => item.name).indexOf(el.name) === idx).map(async (el) => {
69
+ const { name, module, type } = el;
71
70
  const loadTemplate = await getTemplate(type, name);
72
71
  console.log(name, type);
73
72
  if (type === 'select') {
74
73
  clsQuery.push(`insert into admin.cls(name,type,data,module) values('${name}','sql','${(loadTemplate?.sql || loadTemplate)?.replace(/'/g, "''")}', '${module?.replace(/'/g, "''")}')`);
75
- } else if (type === 'cls') {
74
+ } else if (type === 'cls' && loadTemplate?.length) {
76
75
  clsQuery.push(`insert into admin.cls(name,type) values('${name}','json');
77
76
  insert into admin.cls(code,name,parent,icon)
78
77
  select value->>'id',value->>'text','${name}',value->>'icon'
79
78
  from json_array_elements('${JSON.stringify(loadTemplate).replace(/'/g, "''")}'::json)`);
79
+ } else {
80
+ console.log(name, type, 'empty');
80
81
  }
81
- })));
82
82
  }));
83
83
 
84
84
  await pg.query('truncate admin.cls');
@@ -2,15 +2,13 @@ import { getTemplate } from "@opengis/fastify-table/utils.js";
2
2
 
3
3
  export default async function tableFilter(req) {
4
4
  const time = Date.now();
5
- const { pg, funcs = {}, params = {}, query = {} } = req;
5
+ const { pg, funcs = {}, params = {}, query = {}, session = {} } = req;
6
+ const { uid } = session.passport?.user || {};
6
7
 
7
8
  if (!params.name) {
8
9
  return { message: 'not enouggh params: name', status: 400 };
9
10
  }
10
11
 
11
-
12
-
13
-
14
12
  const loadTable = await getTemplate('table', params.name);
15
13
 
16
14
  if (!loadTable) {
@@ -22,13 +20,16 @@ export default async function tableFilter(req) {
22
20
  const filters = loadTable?.filter_list || loadTable?.filters || loadTable?.filterList || [];
23
21
  filters.forEach(el => {
24
22
  Object.assign(el, { id: el.name || el.id, name: el.name || el.id });
25
- })
23
+ });
26
24
 
27
- await Promise.all(filters.filter((el) => el.data).map(async (el) => {
25
+ // table_properties - user filter
26
+ const { rows: properties = [] } = await pg.query(`select property_id, property_key, property_title, property_format, property_data from admin.table_properties where property_type='filter' and property_entity=$1 and uid=$2`, [params.name, uid]);
27
+ properties.forEach((row) => filters.push({ id: row.property_key, name: row.property_key, ua: row.property_title, type: row.property_format, data: row.property_data }));
28
28
 
29
- const cls = await getTemplate(['cls', 'select'], el.data)
30
- const name = el.name || el.id
29
+ await Promise.all(filters.filter((el) => el.data).map(async (el) => {
31
30
 
31
+ const cls = await getTemplate(['cls', 'select'], el.data);
32
+ const name = el.name || el.id;
32
33
 
33
34
  if (!cls?.length || !Array.isArray(cls) || !loadTable.table || !name) return;
34
35
  const { dataTypeID } = columns.find((item) => item.name === name) || {};