@opengis/widgets 0.0.17 → 0.0.19
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.
- package/dist/index.css +1 -1
- package/dist/index.js +1135 -1070
- package/dist/index.umd.cjs +27 -27
- package/dist/widgets/card/Card.vue.d.ts.map +1 -1
- package/dist/widgets/card/CardItem.vue.d.ts.map +1 -1
- package/dist/widgets/group-interface/GroupInterfaceWidget.vue.d.ts.map +1 -1
- package/dist/widgets/map/MapWidget.vue.d.ts.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { h as
|
|
1
|
+
import { h as re, defineComponent as H, mergeModels as oe, useModel as fe, ref as T, createElementBlock as a, openBlock as t, createElementVNode as e, createVNode as V, unref as I, withDirectives as U, vModelText as ye, createCommentVNode as C, createTextVNode as B, onMounted as se, onUnmounted as Le, resolveComponent as ae, normalizeClass as z, createBlock as S, toDisplayString as _, Fragment as j, renderList as A, normalizeStyle as Q, resolveDynamicComponent as W, withModifiers as Z, computed as P, renderSlot as R, getCurrentInstance as Te, watch as De, vModelRadio as Oe, vModelCheckbox as ke, createStaticVNode as Be, mergeProps as J, nextTick as _e, onBeforeUnmount as Pe, vShow as we, Teleport as Ne, TransitionGroup as We, withCtx as Re } from "vue";
|
|
2
|
+
import { notify as Ue } from "@opengis/core";
|
|
2
3
|
/**
|
|
3
4
|
* @license lucide-vue-next v0.535.0 - ISC
|
|
4
5
|
*
|
|
5
6
|
* This source code is licensed under the ISC license.
|
|
6
7
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
8
|
*/
|
|
8
|
-
const
|
|
9
|
+
const $e = (d) => d.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Ge = (d) => d.replace(
|
|
9
10
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
10
|
-
(
|
|
11
|
-
),
|
|
12
|
-
const
|
|
13
|
-
return
|
|
14
|
-
},
|
|
11
|
+
(l, s, n) => n ? n.toUpperCase() : s.toLowerCase()
|
|
12
|
+
), qe = (d) => {
|
|
13
|
+
const l = Ge(d);
|
|
14
|
+
return l.charAt(0).toUpperCase() + l.slice(1);
|
|
15
|
+
}, Ze = (...d) => d.filter((l, s, n) => !!l && l.trim() !== "" && n.indexOf(l) === s).join(" ").trim();
|
|
15
16
|
/**
|
|
16
17
|
* @license lucide-vue-next v0.535.0 - ISC
|
|
17
18
|
*
|
|
18
19
|
* This source code is licensed under the ISC license.
|
|
19
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
20
21
|
*/
|
|
21
|
-
var
|
|
22
|
+
var ne = {
|
|
22
23
|
xmlns: "http://www.w3.org/2000/svg",
|
|
23
24
|
width: 24,
|
|
24
25
|
height: 24,
|
|
@@ -35,21 +36,21 @@ var Y = {
|
|
|
35
36
|
* This source code is licensed under the ISC license.
|
|
36
37
|
* See the LICENSE file in the root directory of this source tree.
|
|
37
38
|
*/
|
|
38
|
-
const
|
|
39
|
+
const Ke = ({ size: d, strokeWidth: l = 2, absoluteStrokeWidth: s, color: n, iconNode: o, name: h, class: r, ...y }, { slots: m }) => re(
|
|
39
40
|
"svg",
|
|
40
41
|
{
|
|
41
|
-
...
|
|
42
|
-
width: d ||
|
|
43
|
-
height: d ||
|
|
44
|
-
stroke:
|
|
45
|
-
"stroke-width":
|
|
46
|
-
class:
|
|
42
|
+
...ne,
|
|
43
|
+
width: d || ne.width,
|
|
44
|
+
height: d || ne.height,
|
|
45
|
+
stroke: n || ne.stroke,
|
|
46
|
+
"stroke-width": s ? Number(l) * 24 / Number(d) : l,
|
|
47
|
+
class: Ze(
|
|
47
48
|
"lucide",
|
|
48
|
-
...
|
|
49
|
+
...h ? [`lucide-${$e(qe(h))}-icon`, `lucide-${$e(h)}`] : ["lucide-icon"]
|
|
49
50
|
),
|
|
50
|
-
...
|
|
51
|
+
...y
|
|
51
52
|
},
|
|
52
|
-
[...
|
|
53
|
+
[...o.map((k) => re(...k)), ...m.default ? [m.default()] : []]
|
|
53
54
|
);
|
|
54
55
|
/**
|
|
55
56
|
* @license lucide-vue-next v0.535.0 - ISC
|
|
@@ -57,14 +58,14 @@ const Pe = ({ size: d, strokeWidth: a = 2, absoluteStrokeWidth: o, color: t, ico
|
|
|
57
58
|
* This source code is licensed under the ISC license.
|
|
58
59
|
* See the LICENSE file in the root directory of this source tree.
|
|
59
60
|
*/
|
|
60
|
-
const
|
|
61
|
-
|
|
61
|
+
const F = (d, l) => (s, { slots: n }) => re(
|
|
62
|
+
Ke,
|
|
62
63
|
{
|
|
63
|
-
...
|
|
64
|
-
iconNode:
|
|
64
|
+
...s,
|
|
65
|
+
iconNode: l,
|
|
65
66
|
name: d
|
|
66
67
|
},
|
|
67
|
-
|
|
68
|
+
n
|
|
68
69
|
);
|
|
69
70
|
/**
|
|
70
71
|
* @license lucide-vue-next v0.535.0 - ISC
|
|
@@ -72,7 +73,7 @@ const H = (d, a) => (o, { slots: t }) => le(
|
|
|
72
73
|
* This source code is licensed under the ISC license.
|
|
73
74
|
* See the LICENSE file in the root directory of this source tree.
|
|
74
75
|
*/
|
|
75
|
-
const
|
|
76
|
+
const Je = F("archive", [
|
|
76
77
|
["rect", { width: "20", height: "5", x: "2", y: "3", rx: "1", key: "1wp1u1" }],
|
|
77
78
|
["path", { d: "M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8", key: "1s80jp" }],
|
|
78
79
|
["path", { d: "M10 12h4", key: "a56b0p" }]
|
|
@@ -83,7 +84,7 @@ const Ue = H("archive", [
|
|
|
83
84
|
* This source code is licensed under the ISC license.
|
|
84
85
|
* See the LICENSE file in the root directory of this source tree.
|
|
85
86
|
*/
|
|
86
|
-
const
|
|
87
|
+
const Xe = F("arrow-right", [
|
|
87
88
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
88
89
|
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
89
90
|
]);
|
|
@@ -93,7 +94,7 @@ const We = H("arrow-right", [
|
|
|
93
94
|
* This source code is licensed under the ISC license.
|
|
94
95
|
* See the LICENSE file in the root directory of this source tree.
|
|
95
96
|
*/
|
|
96
|
-
const
|
|
97
|
+
const Qe = F("circle-check-big", [
|
|
97
98
|
["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
|
|
98
99
|
["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
|
|
99
100
|
]);
|
|
@@ -103,7 +104,7 @@ const Re = H("circle-check-big", [
|
|
|
103
104
|
* This source code is licensed under the ISC license.
|
|
104
105
|
* See the LICENSE file in the root directory of this source tree.
|
|
105
106
|
*/
|
|
106
|
-
const
|
|
107
|
+
const je = F("download", [
|
|
107
108
|
["path", { d: "M12 15V3", key: "m9g1x1" }],
|
|
108
109
|
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
109
110
|
["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
|
|
@@ -114,7 +115,7 @@ const $e = H("download", [
|
|
|
114
115
|
* This source code is licensed under the ISC license.
|
|
115
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
116
117
|
*/
|
|
117
|
-
const
|
|
118
|
+
const Ye = F("ellipsis", [
|
|
118
119
|
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
119
120
|
["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
|
|
120
121
|
["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
|
|
@@ -125,7 +126,7 @@ const Ge = H("ellipsis", [
|
|
|
125
126
|
* This source code is licensed under the ISC license.
|
|
126
127
|
* See the LICENSE file in the root directory of this source tree.
|
|
127
128
|
*/
|
|
128
|
-
const
|
|
129
|
+
const X = F("file-text", [
|
|
129
130
|
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
130
131
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
131
132
|
["path", { d: "M10 9H8", key: "b1mrlr" }],
|
|
@@ -138,7 +139,7 @@ const K = H("file-text", [
|
|
|
138
139
|
* This source code is licensed under the ISC license.
|
|
139
140
|
* See the LICENSE file in the root directory of this source tree.
|
|
140
141
|
*/
|
|
141
|
-
const
|
|
142
|
+
const et = F("file", [
|
|
142
143
|
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
143
144
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }]
|
|
144
145
|
]);
|
|
@@ -148,7 +149,7 @@ const qe = H("file", [
|
|
|
148
149
|
* This source code is licensed under the ISC license.
|
|
149
150
|
* See the LICENSE file in the root directory of this source tree.
|
|
150
151
|
*/
|
|
151
|
-
const
|
|
152
|
+
const tt = F("grid-3x3", [
|
|
152
153
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
153
154
|
["path", { d: "M3 9h18", key: "1pudct" }],
|
|
154
155
|
["path", { d: "M3 15h18", key: "5xshup" }],
|
|
@@ -161,7 +162,7 @@ const Ke = H("grid-3x3", [
|
|
|
161
162
|
* This source code is licensed under the ISC license.
|
|
162
163
|
* See the LICENSE file in the root directory of this source tree.
|
|
163
164
|
*/
|
|
164
|
-
const
|
|
165
|
+
const st = F("heart", [
|
|
165
166
|
[
|
|
166
167
|
"path",
|
|
167
168
|
{
|
|
@@ -176,7 +177,7 @@ const Ze = H("heart", [
|
|
|
176
177
|
* This source code is licensed under the ISC license.
|
|
177
178
|
* See the LICENSE file in the root directory of this source tree.
|
|
178
179
|
*/
|
|
179
|
-
const
|
|
180
|
+
const nt = F("history", [
|
|
180
181
|
["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
|
|
181
182
|
["path", { d: "M3 3v5h5", key: "1xhq8a" }],
|
|
182
183
|
["path", { d: "M12 7v5l4 2", key: "1fdv2h" }]
|
|
@@ -187,7 +188,7 @@ const Je = H("history", [
|
|
|
187
188
|
* This source code is licensed under the ISC license.
|
|
188
189
|
* See the LICENSE file in the root directory of this source tree.
|
|
189
190
|
*/
|
|
190
|
-
const
|
|
191
|
+
const Ce = F("image", [
|
|
191
192
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
|
|
192
193
|
["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
|
|
193
194
|
["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
|
|
@@ -198,7 +199,7 @@ const xe = H("image", [
|
|
|
198
199
|
* This source code is licensed under the ISC license.
|
|
199
200
|
* See the LICENSE file in the root directory of this source tree.
|
|
200
201
|
*/
|
|
201
|
-
const
|
|
202
|
+
const ot = F("list", [
|
|
202
203
|
["path", { d: "M3 12h.01", key: "nlz23k" }],
|
|
203
204
|
["path", { d: "M3 18h.01", key: "1tta3j" }],
|
|
204
205
|
["path", { d: "M3 6h.01", key: "1rqtza" }],
|
|
@@ -212,7 +213,7 @@ const Xe = H("list", [
|
|
|
212
213
|
* This source code is licensed under the ISC license.
|
|
213
214
|
* See the LICENSE file in the root directory of this source tree.
|
|
214
215
|
*/
|
|
215
|
-
const
|
|
216
|
+
const Ie = F("plus", [
|
|
216
217
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
217
218
|
["path", { d: "M12 5v14", key: "s699le" }]
|
|
218
219
|
]);
|
|
@@ -222,7 +223,7 @@ const Ce = H("plus", [
|
|
|
222
223
|
* This source code is licensed under the ISC license.
|
|
223
224
|
* See the LICENSE file in the root directory of this source tree.
|
|
224
225
|
*/
|
|
225
|
-
const
|
|
226
|
+
const at = F("reply", [
|
|
226
227
|
["path", { d: "M20 18v-2a4 4 0 0 0-4-4H4", key: "5vmcpk" }],
|
|
227
228
|
["path", { d: "m9 17-5-5 5-5", key: "nvlc11" }]
|
|
228
229
|
]);
|
|
@@ -232,7 +233,7 @@ const Qe = H("reply", [
|
|
|
232
233
|
* This source code is licensed under the ISC license.
|
|
233
234
|
* See the LICENSE file in the root directory of this source tree.
|
|
234
235
|
*/
|
|
235
|
-
const
|
|
236
|
+
const ze = F("send", [
|
|
236
237
|
[
|
|
237
238
|
"path",
|
|
238
239
|
{
|
|
@@ -248,7 +249,7 @@ const Me = H("send", [
|
|
|
248
249
|
* This source code is licensed under the ISC license.
|
|
249
250
|
* See the LICENSE file in the root directory of this source tree.
|
|
250
251
|
*/
|
|
251
|
-
const
|
|
252
|
+
const lt = F("sheet", [
|
|
252
253
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
|
|
253
254
|
["line", { x1: "3", x2: "21", y1: "9", y2: "9", key: "1vqk6q" }],
|
|
254
255
|
["line", { x1: "3", x2: "21", y1: "15", y2: "15", key: "o2sbyz" }],
|
|
@@ -261,7 +262,7 @@ const Ye = H("sheet", [
|
|
|
261
262
|
* This source code is licensed under the ISC license.
|
|
262
263
|
* See the LICENSE file in the root directory of this source tree.
|
|
263
264
|
*/
|
|
264
|
-
const
|
|
265
|
+
const it = F("square-pen", [
|
|
265
266
|
["path", { d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7", key: "1m0v6g" }],
|
|
266
267
|
[
|
|
267
268
|
"path",
|
|
@@ -277,7 +278,7 @@ const et = H("square-pen", [
|
|
|
277
278
|
* This source code is licensed under the ISC license.
|
|
278
279
|
* See the LICENSE file in the root directory of this source tree.
|
|
279
280
|
*/
|
|
280
|
-
const
|
|
281
|
+
const ve = F("trash-2", [
|
|
281
282
|
["path", { d: "M10 11v6", key: "nco0om" }],
|
|
282
283
|
["path", { d: "M14 11v6", key: "outv1u" }],
|
|
283
284
|
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
@@ -290,7 +291,7 @@ const ge = H("trash-2", [
|
|
|
290
291
|
* This source code is licensed under the ISC license.
|
|
291
292
|
* See the LICENSE file in the root directory of this source tree.
|
|
292
293
|
*/
|
|
293
|
-
const
|
|
294
|
+
const rt = F("user-check", [
|
|
294
295
|
["path", { d: "m16 11 2 2 4-4", key: "9rsbq5" }],
|
|
295
296
|
["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
|
|
296
297
|
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }]
|
|
@@ -301,7 +302,7 @@ const tt = H("user-check", [
|
|
|
301
302
|
* This source code is licensed under the ISC license.
|
|
302
303
|
* See the LICENSE file in the root directory of this source tree.
|
|
303
304
|
*/
|
|
304
|
-
const
|
|
305
|
+
const be = F("user", [
|
|
305
306
|
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
306
307
|
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
307
308
|
]);
|
|
@@ -311,7 +312,7 @@ const he = H("user", [
|
|
|
311
312
|
* This source code is licensed under the ISC license.
|
|
312
313
|
* See the LICENSE file in the root directory of this source tree.
|
|
313
314
|
*/
|
|
314
|
-
const
|
|
315
|
+
const dt = F("video", [
|
|
315
316
|
[
|
|
316
317
|
"path",
|
|
317
318
|
{
|
|
@@ -327,234 +328,234 @@ const st = H("video", [
|
|
|
327
328
|
* This source code is licensed under the ISC license.
|
|
328
329
|
* See the LICENSE file in the root directory of this source tree.
|
|
329
330
|
*/
|
|
330
|
-
const
|
|
331
|
+
const xe = F("x", [
|
|
331
332
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
332
333
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
333
|
-
]),
|
|
334
|
+
]), ct = { class: "border-t pt-3 mt-4" }, ut = { class: "flex gap-2" }, pt = { class: "relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200" }, mt = { class: "flex-1 space-y-2" }, gt = { class: "flex justify-between items-center" }, ht = { class: "flex gap-2" }, ft = ["disabled"], Ae = /* @__PURE__ */ H({
|
|
334
335
|
__name: "CommentInputZone",
|
|
335
336
|
props: {
|
|
336
337
|
isReply: { type: Boolean, required: !1, default: !1 },
|
|
337
338
|
isReplyModifiers: {}
|
|
338
339
|
},
|
|
339
|
-
emits: /* @__PURE__ */
|
|
340
|
-
setup(d, { emit:
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
},
|
|
344
|
-
(
|
|
340
|
+
emits: /* @__PURE__ */ oe(["sendComment"], ["update:isReply"]),
|
|
341
|
+
setup(d, { emit: l }) {
|
|
342
|
+
const s = fe(d, "isReply"), n = T(""), o = l, h = () => {
|
|
343
|
+
n.value.trim() && (o("sendComment", n.value), n.value = "");
|
|
344
|
+
}, r = (y) => {
|
|
345
|
+
(y.ctrlKey || y.metaKey) && y.key === "Enter" && (y.preventDefault(), h());
|
|
345
346
|
};
|
|
346
|
-
return (
|
|
347
|
-
e("div",
|
|
348
|
-
e("span",
|
|
349
|
-
|
|
347
|
+
return (y, m) => (t(), a("div", ct, [
|
|
348
|
+
e("div", ut, [
|
|
349
|
+
e("span", pt, [
|
|
350
|
+
V(I(be), { class: "h-3 w-3 text-gray-500" })
|
|
350
351
|
]),
|
|
351
|
-
e("div",
|
|
352
|
-
|
|
353
|
-
"onUpdate:modelValue": m[0] || (m[0] = (
|
|
354
|
-
onKeydown:
|
|
352
|
+
e("div", mt, [
|
|
353
|
+
U(e("textarea", {
|
|
354
|
+
"onUpdate:modelValue": m[0] || (m[0] = (k) => n.value = k),
|
|
355
|
+
onKeydown: r,
|
|
355
356
|
placeholder: "Add a comment...",
|
|
356
357
|
class: "w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"
|
|
357
358
|
}, null, 544), [
|
|
358
|
-
[
|
|
359
|
+
[ye, n.value]
|
|
359
360
|
]),
|
|
360
|
-
e("div",
|
|
361
|
+
e("div", gt, [
|
|
361
362
|
m[4] || (m[4] = e("span", { class: "text-xs text-gray-500 hidden sm:inline" }, "Cmd+Enter to send", -1)),
|
|
362
|
-
e("div",
|
|
363
|
-
|
|
363
|
+
e("div", ht, [
|
|
364
|
+
s.value ? (t(), a("button", {
|
|
364
365
|
key: 0,
|
|
365
366
|
class: "inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",
|
|
366
|
-
onClick: m[1] || (m[1] = (
|
|
367
|
+
onClick: m[1] || (m[1] = (k) => s.value = !1)
|
|
367
368
|
}, [
|
|
368
|
-
|
|
369
|
-
m[2] || (m[2] =
|
|
369
|
+
V(I(xe), { class: "h-3 w-3" }),
|
|
370
|
+
m[2] || (m[2] = B(" Cancel ", -1))
|
|
370
371
|
])) : C("", !0),
|
|
371
372
|
e("button", {
|
|
372
373
|
class: "inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",
|
|
373
|
-
disabled: !
|
|
374
|
-
onClick:
|
|
374
|
+
disabled: !n.value.trim(),
|
|
375
|
+
onClick: h
|
|
375
376
|
}, [
|
|
376
|
-
|
|
377
|
-
m[3] || (m[3] =
|
|
378
|
-
], 8,
|
|
377
|
+
V(I(ze), { class: "h-3 w-3 mr-1" }),
|
|
378
|
+
m[3] || (m[3] = B(" Send ", -1))
|
|
379
|
+
], 8, ft)
|
|
379
380
|
])
|
|
380
381
|
])
|
|
381
382
|
])
|
|
382
383
|
])
|
|
383
384
|
]));
|
|
384
385
|
}
|
|
385
|
-
}),
|
|
386
|
+
}), yt = { class: "z-50 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md w-32 outline-none pointer-events-auto" }, vt = /* @__PURE__ */ H({
|
|
386
387
|
__name: "CommentDetails",
|
|
387
388
|
props: {
|
|
388
389
|
showMoreOptions: { type: Boolean, required: !0, default: !1 },
|
|
389
390
|
showMoreOptionsModifiers: {}
|
|
390
391
|
},
|
|
391
|
-
emits: /* @__PURE__ */
|
|
392
|
-
setup(d, { emit:
|
|
393
|
-
const
|
|
394
|
-
|
|
395
|
-
},
|
|
396
|
-
|
|
392
|
+
emits: /* @__PURE__ */ oe(["edit", "delete"], ["update:showMoreOptions"]),
|
|
393
|
+
setup(d, { emit: l }) {
|
|
394
|
+
const s = l, n = fe(d, "showMoreOptions"), o = T(), h = T(!0), r = async (k) => {
|
|
395
|
+
n.value && o.value && !o.value.contains(k.target) && !h.value && (n.value = !1), h.value = !1;
|
|
396
|
+
}, y = () => {
|
|
397
|
+
n.value = !1, s("edit");
|
|
397
398
|
}, m = () => {
|
|
398
|
-
|
|
399
|
+
n.value = !1, s("delete");
|
|
399
400
|
};
|
|
400
401
|
return se(() => {
|
|
401
|
-
document.addEventListener("click",
|
|
402
|
-
}),
|
|
403
|
-
document.removeEventListener("click",
|
|
404
|
-
}), (
|
|
402
|
+
document.addEventListener("click", r);
|
|
403
|
+
}), Le(() => {
|
|
404
|
+
document.removeEventListener("click", r);
|
|
405
|
+
}), (k, b) => (t(), a("div", {
|
|
405
406
|
class: "absolute bg-white left-0 top-full transform min-w-max z-50",
|
|
406
407
|
ref_key: "moreOptionsRef",
|
|
407
|
-
ref:
|
|
408
|
+
ref: o
|
|
408
409
|
}, [
|
|
409
|
-
e("div",
|
|
410
|
+
e("div", yt, [
|
|
410
411
|
e("div", {
|
|
411
412
|
class: "relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs hover:bg-gray-100 transition-colors duration-300",
|
|
412
|
-
onClick:
|
|
413
|
+
onClick: y
|
|
413
414
|
}, [
|
|
414
|
-
|
|
415
|
-
|
|
415
|
+
V(I(it), { class: "h-3 w-3 mr-2" }),
|
|
416
|
+
b[0] || (b[0] = B(" Edit ", -1))
|
|
416
417
|
]),
|
|
417
418
|
e("div", {
|
|
418
419
|
class: "relative cursor-pointer flex select-none items-center gap-2 rounded-sm px-2 py-2 outline-hidden transition-colors disabled:pointer-events-none disabled:opacity-50 text-xs text-red-600 hover:bg-gray-100 transition-colors duration-300",
|
|
419
420
|
onClick: m
|
|
420
421
|
}, [
|
|
421
|
-
|
|
422
|
-
|
|
422
|
+
V(I(ve), { class: "h-3 w-3 mr-2" }),
|
|
423
|
+
b[1] || (b[1] = B(" Delete ", -1))
|
|
423
424
|
])
|
|
424
425
|
])
|
|
425
426
|
], 512));
|
|
426
427
|
}
|
|
427
|
-
}),
|
|
428
|
+
}), bt = { class: "space-y-2" }, xt = { class: "relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200" }, kt = { class: "flex-1 min-w-0 space-y-1 relative" }, _t = { class: "flex items-center gap-2" }, wt = { class: "font-medium text-xs" }, $t = { class: "text-xs text-gray-500" }, Ct = {
|
|
428
429
|
key: 0,
|
|
429
430
|
class: "text-xs text-gray-700 leading-relaxed"
|
|
430
|
-
},
|
|
431
|
+
}, Mt = { class: "flex justify-between text-xs" }, Lt = { class: "flex items-center gap-2" }, Tt = {
|
|
431
432
|
key: 0,
|
|
432
433
|
class: "flex gap-2"
|
|
433
|
-
},
|
|
434
|
+
}, Dt = ["disabled"], jt = {
|
|
434
435
|
key: 0,
|
|
435
436
|
class: "ml-8 space-y-1 border-l-2 border-gray-100 pl-3"
|
|
436
|
-
},
|
|
437
|
+
}, It = /* @__PURE__ */ H({
|
|
437
438
|
__name: "CommentItem",
|
|
438
439
|
props: {
|
|
439
440
|
comment: {},
|
|
440
441
|
isInside: { type: Boolean }
|
|
441
442
|
},
|
|
442
443
|
emits: ["like", "reply", "edit", "delete"],
|
|
443
|
-
setup(d, { emit:
|
|
444
|
-
const
|
|
445
|
-
const
|
|
446
|
-
(
|
|
444
|
+
setup(d, { emit: l }) {
|
|
445
|
+
const s = l, n = d, o = T(n.comment.text), h = T("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"), r = T("w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"), y = T(!1), m = T(!1), k = T(!1), b = T(!1), p = (i) => {
|
|
446
|
+
const u = /* @__PURE__ */ new Date(), c = Math.floor(
|
|
447
|
+
(u.getTime() - i.getTime()) / (1e3 * 60 * 60)
|
|
447
448
|
);
|
|
448
|
-
return
|
|
449
|
-
(
|
|
450
|
-
)}m` :
|
|
451
|
-
},
|
|
452
|
-
|
|
453
|
-
},
|
|
454
|
-
|
|
455
|
-
},
|
|
456
|
-
|
|
457
|
-
}, M = (
|
|
458
|
-
|
|
449
|
+
return c < 1 ? `${Math.floor(
|
|
450
|
+
(u.getTime() - i.getTime()) / 6e4
|
|
451
|
+
)}m` : c < 24 ? `${c}h` : `${Math.floor(c / 24)}d`;
|
|
452
|
+
}, v = () => {
|
|
453
|
+
b.value = !b.value, b.value ? s("like", n.comment.id, "add") : s("like", n.comment.id, "delete");
|
|
454
|
+
}, O = () => {
|
|
455
|
+
s("edit", n.comment.id, o.value), k.value = !1;
|
|
456
|
+
}, w = (i, u) => {
|
|
457
|
+
s("like", i, u);
|
|
458
|
+
}, M = (i, u) => {
|
|
459
|
+
s("edit", i, u);
|
|
459
460
|
};
|
|
460
|
-
return (
|
|
461
|
-
const
|
|
462
|
-
return
|
|
461
|
+
return (i, u) => {
|
|
462
|
+
const c = ae("CommentItem", !0);
|
|
463
|
+
return t(), a("div", bt, [
|
|
463
464
|
e("div", {
|
|
464
|
-
class:
|
|
465
|
+
class: z(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative", k.value ? "bg-gray-50" : ""])
|
|
465
466
|
}, [
|
|
466
|
-
e("span",
|
|
467
|
-
|
|
467
|
+
e("span", xt, [
|
|
468
|
+
V(I(be), { class: "h-3 w-3 text-gray-500" })
|
|
468
469
|
]),
|
|
469
|
-
e("div",
|
|
470
|
-
e("div",
|
|
471
|
-
e("span",
|
|
472
|
-
e("span",
|
|
470
|
+
e("div", kt, [
|
|
471
|
+
e("div", _t, [
|
|
472
|
+
e("span", wt, _(i.comment?.author), 1),
|
|
473
|
+
e("span", $t, _(p(i.comment?.createdAt)), 1)
|
|
473
474
|
]),
|
|
474
|
-
|
|
475
|
+
k.value ? U((t(), a("textarea", {
|
|
475
476
|
key: 1,
|
|
476
|
-
"onUpdate:modelValue":
|
|
477
|
-
class:
|
|
477
|
+
"onUpdate:modelValue": u[0] || (u[0] = (g) => o.value = g),
|
|
478
|
+
class: z(k.value ? r.value : h.value)
|
|
478
479
|
}, null, 2)), [
|
|
479
|
-
[
|
|
480
|
-
]) : (
|
|
481
|
-
e("div",
|
|
482
|
-
e("div",
|
|
480
|
+
[ye, o.value]
|
|
481
|
+
]) : (t(), a("p", Ct, _(i.comment?.text), 1)),
|
|
482
|
+
e("div", Mt, [
|
|
483
|
+
e("div", Lt, [
|
|
483
484
|
e("button", {
|
|
484
|
-
class:
|
|
485
|
-
onClick:
|
|
485
|
+
class: z(["flex items-center gap-1", b.value ? "text-blue-600" : "text-gray-500 hover:text-blue-600 transition-colors"]),
|
|
486
|
+
onClick: u[1] || (u[1] = (g) => v())
|
|
486
487
|
}, [
|
|
487
|
-
|
|
488
|
-
class:
|
|
488
|
+
V(I(st), {
|
|
489
|
+
class: z(["h-3 w-3", b.value ? "fill-blue-600" : ""])
|
|
489
490
|
}, null, 8, ["class"]),
|
|
490
|
-
|
|
491
|
+
B(" " + _(i.comment?.likes), 1)
|
|
491
492
|
], 2),
|
|
492
|
-
|
|
493
|
+
i.isInside ? C("", !0) : (t(), a("button", {
|
|
493
494
|
key: 0,
|
|
494
495
|
class: "text-gray-500 hover:text-blue-600 transition-colors",
|
|
495
|
-
onClick:
|
|
496
|
+
onClick: u[2] || (u[2] = (g) => m.value = !0)
|
|
496
497
|
}, [
|
|
497
|
-
|
|
498
|
+
V(I(at), { class: "h-3 w-3" })
|
|
498
499
|
])),
|
|
499
500
|
e("button", {
|
|
500
501
|
class: "text-gray-400 hover:text-gray-600 transition-colors opacity-0 group-hover:opacity-100",
|
|
501
502
|
type: "button",
|
|
502
|
-
onClick:
|
|
503
|
+
onClick: u[3] || (u[3] = (g) => y.value = !0)
|
|
503
504
|
}, [
|
|
504
|
-
|
|
505
|
+
V(I(Ye), { class: "h-3 w-3" })
|
|
505
506
|
])
|
|
506
507
|
]),
|
|
507
|
-
|
|
508
|
+
k.value ? (t(), a("div", Tt, [
|
|
508
509
|
e("button", {
|
|
509
510
|
class: "inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-red-500 hover:bg-opacity-80 rounded-md h-6 text-xs px-2",
|
|
510
|
-
onClick:
|
|
511
|
+
onClick: u[4] || (u[4] = (g) => k.value = !1)
|
|
511
512
|
}, [
|
|
512
|
-
|
|
513
|
-
|
|
513
|
+
V(I(xe), { class: "h-3 w-3" }),
|
|
514
|
+
u[11] || (u[11] = B(" Cancel ", -1))
|
|
514
515
|
]),
|
|
515
516
|
e("button", {
|
|
516
517
|
class: "inline-flex items-center justify-center gap-2 text-white whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 bg-black text-primary-foreground hover:bg-opacity-80 rounded-md h-6 text-xs px-2",
|
|
517
|
-
disabled: !
|
|
518
|
-
onClick:
|
|
518
|
+
disabled: !o.value.trim(),
|
|
519
|
+
onClick: u[5] || (u[5] = (g) => O())
|
|
519
520
|
}, [
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
], 8,
|
|
521
|
+
V(I(ze), { class: "h-3 w-3 mr-1" }),
|
|
522
|
+
u[12] || (u[12] = B(" Send ", -1))
|
|
523
|
+
], 8, Dt)
|
|
523
524
|
])) : C("", !0)
|
|
524
525
|
])
|
|
525
526
|
]),
|
|
526
|
-
|
|
527
|
+
y.value ? (t(), S(vt, {
|
|
527
528
|
key: 0,
|
|
528
|
-
showMoreOptions:
|
|
529
|
-
"onUpdate:showMoreOptions":
|
|
530
|
-
onEdit:
|
|
531
|
-
onDelete:
|
|
532
|
-
comment:
|
|
529
|
+
showMoreOptions: y.value,
|
|
530
|
+
"onUpdate:showMoreOptions": u[6] || (u[6] = (g) => y.value = g),
|
|
531
|
+
onEdit: u[7] || (u[7] = (g) => k.value = !0),
|
|
532
|
+
onDelete: u[8] || (u[8] = (g) => i.$emit("delete", i.comment?.id)),
|
|
533
|
+
comment: i.comment
|
|
533
534
|
}, null, 8, ["showMoreOptions", "comment"])) : C("", !0)
|
|
534
535
|
], 2),
|
|
535
|
-
|
|
536
|
-
(
|
|
537
|
-
key:
|
|
538
|
-
comment:
|
|
536
|
+
i.isInside ? C("", !0) : (t(), a("div", jt, [
|
|
537
|
+
(t(!0), a(j, null, A(i.comment?.replies, (g) => (t(), S(c, {
|
|
538
|
+
key: g.id,
|
|
539
|
+
comment: g,
|
|
539
540
|
isInside: !0,
|
|
540
|
-
onDelete: (
|
|
541
|
-
onLike:
|
|
541
|
+
onDelete: ($) => i.$emit("delete", g.id),
|
|
542
|
+
onLike: w,
|
|
542
543
|
onEdit: M
|
|
543
544
|
}, null, 8, ["comment", "onDelete"]))), 128)),
|
|
544
|
-
m.value && !
|
|
545
|
+
m.value && !i.isInside ? (t(), S(Ae, {
|
|
545
546
|
key: 0,
|
|
546
|
-
onSendComment:
|
|
547
|
+
onSendComment: u[9] || (u[9] = (g) => i.$emit("reply", i.comment?.id, g)),
|
|
547
548
|
isReply: m.value,
|
|
548
|
-
"onUpdate:isReply":
|
|
549
|
+
"onUpdate:isReply": u[10] || (u[10] = (g) => m.value = g)
|
|
549
550
|
}, null, 8, ["isReply"])) : C("", !0)
|
|
550
551
|
]))
|
|
551
552
|
]);
|
|
552
553
|
};
|
|
553
554
|
}
|
|
554
|
-
}),
|
|
555
|
+
}), zt = ["id"], At = {
|
|
555
556
|
key: 0,
|
|
556
557
|
class: "text-xl font-semibold text-gray-900 mb-4"
|
|
557
|
-
},
|
|
558
|
+
}, de = /* @__PURE__ */ H({
|
|
558
559
|
__name: "CommentsWidget",
|
|
559
560
|
props: {
|
|
560
561
|
title: {},
|
|
@@ -570,101 +571,101 @@ const fe = H("x", [
|
|
|
570
571
|
style: {}
|
|
571
572
|
},
|
|
572
573
|
emits: ["add", "reply", "like", "delete", "edit"],
|
|
573
|
-
setup(d, { emit:
|
|
574
|
-
const
|
|
575
|
-
async function
|
|
576
|
-
if (!
|
|
577
|
-
const
|
|
578
|
-
|
|
579
|
-
id:
|
|
580
|
-
author:
|
|
581
|
-
text:
|
|
582
|
-
createdAt: new Date(
|
|
574
|
+
setup(d, { emit: l }) {
|
|
575
|
+
const s = d, n = l, o = T(s.comments ?? []);
|
|
576
|
+
async function h() {
|
|
577
|
+
if (!s.id) return;
|
|
578
|
+
const p = await fetch(`/api/widget/comment/${s.id}`).then((v) => v.json());
|
|
579
|
+
o.value = p.rows.map((v) => ({
|
|
580
|
+
id: v.communication_id,
|
|
581
|
+
author: v.username,
|
|
582
|
+
text: v.body,
|
|
583
|
+
createdAt: new Date(v.cdate)
|
|
583
584
|
}));
|
|
584
585
|
}
|
|
585
|
-
|
|
586
|
-
const
|
|
587
|
-
|
|
586
|
+
o.value.length === 0 && h();
|
|
587
|
+
const r = async (p) => {
|
|
588
|
+
s.onAddComment ? s.onAddComment(p) : s.id && (await fetch(`/api/widget/comment/${s.id}`, {
|
|
588
589
|
method: "POST",
|
|
589
590
|
headers: { "Content-Type": "application/json" },
|
|
590
|
-
body: JSON.stringify({ body:
|
|
591
|
-
}), await
|
|
592
|
-
},
|
|
593
|
-
|
|
594
|
-
}, m = (
|
|
595
|
-
|
|
596
|
-
},
|
|
597
|
-
|
|
591
|
+
body: JSON.stringify({ body: p })
|
|
592
|
+
}), await h()), n("add", p);
|
|
593
|
+
}, y = (p, v) => {
|
|
594
|
+
s?.onLike?.(p, v), n("like", p, v);
|
|
595
|
+
}, m = (p, v) => {
|
|
596
|
+
s.onReply?.(p, v), n("reply", p, v);
|
|
597
|
+
}, k = async (p, v) => {
|
|
598
|
+
s.onEdit ? s.onEdit(p, v) : s.id && (await fetch(`/api/widget/comment/${s.id}/${p}`, {
|
|
598
599
|
method: "POST",
|
|
599
600
|
headers: { "Content-Type": "application/json" },
|
|
600
|
-
body: JSON.stringify({ body:
|
|
601
|
-
}), await
|
|
602
|
-
},
|
|
603
|
-
|
|
601
|
+
body: JSON.stringify({ body: v })
|
|
602
|
+
}), await h()), n("edit", p, v);
|
|
603
|
+
}, b = async (p) => {
|
|
604
|
+
s.onDelete ? s.onDelete(p) : s.id && (await fetch(`/api/widget/comment/${s.id}/${p}`, {
|
|
604
605
|
method: "DELETE"
|
|
605
|
-
}), await
|
|
606
|
+
}), await h()), n("delete", p);
|
|
606
607
|
};
|
|
607
|
-
return (
|
|
608
|
-
class:
|
|
609
|
-
id:
|
|
610
|
-
style: Q(
|
|
608
|
+
return (p, v) => (t(), a("div", {
|
|
609
|
+
class: z(["mx-auto font-sans", p.className]),
|
|
610
|
+
id: p.id,
|
|
611
|
+
style: Q(p.style)
|
|
611
612
|
}, [
|
|
612
|
-
|
|
613
|
+
p.title ? (t(), a("h3", At, _(p.title), 1)) : C("", !0),
|
|
613
614
|
e("div", {
|
|
614
|
-
class:
|
|
615
|
-
style: Q({ maxHeight:
|
|
615
|
+
class: z([p.maxHeight ? "overflow-y-auto" : "", "space-y-3"]),
|
|
616
|
+
style: Q({ maxHeight: p.maxHeight + "px" })
|
|
616
617
|
}, [
|
|
617
|
-
(
|
|
618
|
-
key:
|
|
619
|
-
comment:
|
|
618
|
+
(t(!0), a(j, null, A(o.value, (O) => (t(), S(It, {
|
|
619
|
+
key: O.id,
|
|
620
|
+
comment: O,
|
|
620
621
|
onReply: m,
|
|
621
|
-
onLike:
|
|
622
|
-
onDelete:
|
|
623
|
-
onEdit:
|
|
622
|
+
onLike: y,
|
|
623
|
+
onDelete: v[0] || (v[0] = (w) => b(w)),
|
|
624
|
+
onEdit: k
|
|
624
625
|
}, null, 8, ["comment"]))), 128))
|
|
625
626
|
], 6),
|
|
626
|
-
|
|
627
|
-
onSendComment:
|
|
627
|
+
V(Ae, {
|
|
628
|
+
onSendComment: v[1] || (v[1] = (O) => r(O))
|
|
628
629
|
})
|
|
629
|
-
], 14,
|
|
630
|
+
], 14, zt));
|
|
630
631
|
}
|
|
631
|
-
}),
|
|
632
|
+
}), Me = /* @__PURE__ */ new Map([
|
|
632
633
|
["file", {
|
|
633
634
|
name: "File",
|
|
634
635
|
color: "bg-green-100 text-green-700 border-green-200",
|
|
635
|
-
icon:
|
|
636
|
+
icon: X
|
|
636
637
|
}],
|
|
637
638
|
["post", {
|
|
638
639
|
name: "Post",
|
|
639
640
|
color: "bg-blue-100 text-blue-700 border-blue-200",
|
|
640
|
-
icon:
|
|
641
|
+
icon: lt
|
|
641
642
|
}],
|
|
642
643
|
["user", {
|
|
643
644
|
name: "User",
|
|
644
645
|
color: "bg-purple-100 text-purple-700 border-purple-200",
|
|
645
|
-
icon:
|
|
646
|
+
icon: rt
|
|
646
647
|
}],
|
|
647
648
|
["custom", {
|
|
648
649
|
name: "Custom",
|
|
649
650
|
color: "bg-gray-100 text-gray-700 border-gray-200",
|
|
650
|
-
icon:
|
|
651
|
+
icon: nt
|
|
651
652
|
}]
|
|
652
|
-
]),
|
|
653
|
+
]), Vt = { class: "mx-auto font-sans" }, Et = {
|
|
653
654
|
key: 0,
|
|
654
655
|
class: "text-xl font-semibold text-gray-900 mb-4"
|
|
655
|
-
},
|
|
656
|
+
}, Ht = { class: "relative" }, St = { class: "space-y-3" }, Ft = { class: "flex-1 min-w-0 pb-2" }, Ot = { class: "flex items-center gap-1.5 mb-1 mt-0.5" }, Bt = { class: "relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200" }, Pt = { class: "font-medium text-xs" }, Nt = { class: "text-xs text-gray-500" }, Wt = { class: "space-y-1" }, Rt = { class: "text-xs text-gray-700" }, Ut = { class: "capitalize mr-1" }, Gt = {
|
|
656
657
|
key: 0,
|
|
657
658
|
class: "inline-flex items-center rounded-full border py-0.5 font-semibold transition-colors text-foreground text-xs h-4 px-1 capitalize"
|
|
658
|
-
},
|
|
659
|
+
}, qt = {
|
|
659
660
|
key: 0,
|
|
660
661
|
class: "flex items-center gap-1 text-xs"
|
|
661
|
-
},
|
|
662
|
+
}, Zt = {
|
|
662
663
|
key: 0,
|
|
663
664
|
class: "bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"
|
|
664
|
-
},
|
|
665
|
+
}, Kt = {
|
|
665
666
|
key: 2,
|
|
666
667
|
class: "bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"
|
|
667
|
-
},
|
|
668
|
+
}, ce = /* @__PURE__ */ H({
|
|
668
669
|
__name: "HistoryWidget",
|
|
669
670
|
props: {
|
|
670
671
|
data: {},
|
|
@@ -675,55 +676,55 @@ const fe = H("x", [
|
|
|
675
676
|
style: {}
|
|
676
677
|
},
|
|
677
678
|
setup(d) {
|
|
678
|
-
const
|
|
679
|
-
|
|
680
|
-
async function
|
|
681
|
-
const
|
|
682
|
-
if (!
|
|
679
|
+
const l = d, s = T(Array.isArray(l.data) ? l.data : []);
|
|
680
|
+
s.value.length === 0 && l.id && n();
|
|
681
|
+
async function n() {
|
|
682
|
+
const o = await fetch(`/api/widget/history/${l.id}`);
|
|
683
|
+
if (!o.ok)
|
|
683
684
|
return { data: [] };
|
|
684
|
-
const
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
}),
|
|
685
|
+
const h = await o.json();
|
|
686
|
+
h.rows.forEach((r) => {
|
|
687
|
+
r.timestamp = new Date(r.cdate), r.id = r.entity_id, r.entityType = r.entity_type, r.entityId = r.entity_id, r.action = r.change_type, r.userId = r.change_user_id, r.userName = r.username, r.timestamp = new Date(r.cdate), r.description = r.username, r.status = r.username;
|
|
688
|
+
}), s.value = h.rows;
|
|
688
689
|
}
|
|
689
|
-
return (
|
|
690
|
-
|
|
690
|
+
return (o, h) => (t(), a("div", Vt, [
|
|
691
|
+
o.title ? (t(), a("h3", Et, _(o.title), 1)) : C("", !0),
|
|
691
692
|
e("div", {
|
|
692
|
-
class:
|
|
693
|
-
style: Q({ maxHeight:
|
|
693
|
+
class: z(o.maxHeight ? "overflow-y-auto" : ""),
|
|
694
|
+
style: Q({ maxHeight: o.maxHeight + "px" })
|
|
694
695
|
}, [
|
|
695
|
-
e("div",
|
|
696
|
-
|
|
697
|
-
e("div",
|
|
698
|
-
(
|
|
696
|
+
e("div", Ht, [
|
|
697
|
+
h[0] || (h[0] = e("div", { class: "absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200" }, null, -1)),
|
|
698
|
+
e("div", St, [
|
|
699
|
+
(t(!0), a(j, null, A(s.value, (r) => (t(), a("div", {
|
|
699
700
|
class: "relative flex items-start gap-2",
|
|
700
|
-
key:
|
|
701
|
+
key: r?.id
|
|
701
702
|
}, [
|
|
702
703
|
e("div", {
|
|
703
|
-
class:
|
|
704
|
+
class: z(`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center border bg-white relative z-10 ${I(Me).get(r?.entityType)?.color}`)
|
|
704
705
|
}, [
|
|
705
|
-
(
|
|
706
|
+
(t(), S(W(I(Me).get(r?.entityType)?.icon), { class: "h-3 w-3" }))
|
|
706
707
|
], 2),
|
|
707
|
-
e("div",
|
|
708
|
-
e("div",
|
|
709
|
-
e("span",
|
|
710
|
-
|
|
708
|
+
e("div", Ft, [
|
|
709
|
+
e("div", Ot, [
|
|
710
|
+
e("span", Bt, [
|
|
711
|
+
V(I(be), { class: "h-3 w-3 text-gray-500" })
|
|
711
712
|
]),
|
|
712
|
-
e("span",
|
|
713
|
-
e("span",
|
|
713
|
+
e("span", Pt, _(r?.userName), 1),
|
|
714
|
+
e("span", Nt, _(r?.timestamp.toLocaleTimeString("ua-UA", { hour: "2-digit", minute: "2-digit" })), 1)
|
|
714
715
|
]),
|
|
715
|
-
e("div",
|
|
716
|
-
e("div",
|
|
717
|
-
e("span",
|
|
718
|
-
|
|
716
|
+
e("div", Wt, [
|
|
717
|
+
e("div", Rt, [
|
|
718
|
+
e("span", Ut, _(r?.action), 1),
|
|
719
|
+
r?.entityId ? (t(), a("span", Gt, _(r?.entityId), 1)) : C("", !0)
|
|
719
720
|
]),
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
721
|
+
r?.changes?.[r?.entityId] ? (t(), a("div", qt, [
|
|
722
|
+
r?.changes?.[r?.entityId]?.old ? (t(), a("span", Zt, _(r?.changes?.[r?.entityId]?.old), 1)) : C("", !0),
|
|
723
|
+
r?.changes?.[r?.entityId]?.old && r?.changes?.[r?.entityId]?.new ? (t(), S(I(Xe), {
|
|
723
724
|
key: 1,
|
|
724
725
|
class: "h-2 w-2 text-gray-400"
|
|
725
726
|
})) : C("", !0),
|
|
726
|
-
|
|
727
|
+
r?.changes?.[r?.entityId]?.new ? (t(), a("span", Kt, _(r?.changes?.[r?.entityId]?.new), 1)) : C("", !0)
|
|
727
728
|
])) : C("", !0)
|
|
728
729
|
])
|
|
729
730
|
])
|
|
@@ -733,209 +734,209 @@ const fe = H("x", [
|
|
|
733
734
|
], 6)
|
|
734
735
|
]));
|
|
735
736
|
}
|
|
736
|
-
}),
|
|
737
|
+
}), Jt = {
|
|
737
738
|
key: 0,
|
|
738
739
|
class: "text-xl font-semibold"
|
|
739
|
-
},
|
|
740
|
+
}, Xt = { class: "flex gap-1" }, Qt = { class: "ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background hover:bg-accent hover:text-accent-foreground border rounded-md text-xs h-7 px-2 cursor-pointer" }, Yt = /* @__PURE__ */ H({
|
|
740
741
|
__name: "FileHeader",
|
|
741
|
-
props: /* @__PURE__ */
|
|
742
|
+
props: /* @__PURE__ */ oe({
|
|
742
743
|
title: {}
|
|
743
744
|
}, {
|
|
744
745
|
modelValue: {},
|
|
745
746
|
modelModifiers: {}
|
|
746
747
|
}),
|
|
747
|
-
emits: /* @__PURE__ */
|
|
748
|
+
emits: /* @__PURE__ */ oe(["onAddFile"], ["update:modelValue"]),
|
|
748
749
|
setup(d) {
|
|
749
|
-
const
|
|
750
|
+
const l = fe(d, "modelValue"), s = {
|
|
750
751
|
active: "bg-blue-100 text-black hover:bg-blue-100",
|
|
751
752
|
inactive: "bg-white text-black hover:bg-blue-100"
|
|
752
753
|
};
|
|
753
|
-
return (
|
|
754
|
-
class:
|
|
754
|
+
return (n, o) => (t(), a("div", {
|
|
755
|
+
class: z(["flex flex-col sm:flex-row gap-3 mb-4", n.title ? "justify-between sm:items-center" : "justify-end sm:items-center"])
|
|
755
756
|
}, [
|
|
756
|
-
|
|
757
|
-
e("div",
|
|
757
|
+
n.title ? (t(), a("h3", Jt, _(n.title), 1)) : C("", !0),
|
|
758
|
+
e("div", Xt, [
|
|
758
759
|
e("button", {
|
|
759
|
-
class:
|
|
760
|
-
onClick:
|
|
760
|
+
class: z(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2", l.value === "list" ? s.active : s.inactive]),
|
|
761
|
+
onClick: o[0] || (o[0] = (h) => l.value = "list")
|
|
761
762
|
}, [
|
|
762
|
-
|
|
763
|
+
V(I(ot), { class: "h-4 w-4" })
|
|
763
764
|
], 2),
|
|
764
765
|
e("button", {
|
|
765
|
-
class:
|
|
766
|
-
onClick:
|
|
766
|
+
class: z(["ring-offset-background inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors border-input border rounded-md text-xs h-7 px-2", l.value === "grid" ? s.active : s.inactive]),
|
|
767
|
+
onClick: o[1] || (o[1] = (h) => l.value = "grid")
|
|
767
768
|
}, [
|
|
768
|
-
|
|
769
|
+
V(I(tt), { class: "h-4 w-4" })
|
|
769
770
|
], 2),
|
|
770
771
|
e("label", null, [
|
|
771
772
|
e("input", {
|
|
772
773
|
type: "file",
|
|
773
774
|
class: "hidden",
|
|
774
|
-
onChange:
|
|
775
|
+
onChange: o[2] || (o[2] = (h) => n.$emit("onAddFile", h))
|
|
775
776
|
}, null, 32),
|
|
776
|
-
e("div",
|
|
777
|
-
|
|
778
|
-
|
|
777
|
+
e("div", Qt, [
|
|
778
|
+
V(I(Ie), { class: "h-4 w-4" }),
|
|
779
|
+
o[3] || (o[3] = B(" Додати файл ", -1))
|
|
779
780
|
])
|
|
780
781
|
])
|
|
781
782
|
])
|
|
782
783
|
], 2));
|
|
783
784
|
}
|
|
784
|
-
}),
|
|
785
|
+
}), ie = {
|
|
785
786
|
pdf: {
|
|
786
787
|
color: "bg-red-100 text-red-700 border-red-200",
|
|
787
|
-
icon:
|
|
788
|
+
icon: X,
|
|
788
789
|
label: "PDF"
|
|
789
790
|
},
|
|
790
791
|
sketch: {
|
|
791
792
|
color: "bg-gray-100 text-gray-700 border-gray-200",
|
|
792
|
-
icon:
|
|
793
|
+
icon: et,
|
|
793
794
|
label: "SKETCH"
|
|
794
795
|
},
|
|
795
796
|
mp4: {
|
|
796
797
|
color: "bg-purple-100 text-purple-700 border-purple-200",
|
|
797
|
-
icon:
|
|
798
|
+
icon: dt,
|
|
798
799
|
label: "VIDEO"
|
|
799
800
|
},
|
|
800
801
|
docx: {
|
|
801
802
|
color: "bg-blue-100 text-blue-700 border-blue-200",
|
|
802
|
-
icon:
|
|
803
|
+
icon: X,
|
|
803
804
|
label: "DOC"
|
|
804
805
|
},
|
|
805
806
|
zip: {
|
|
806
807
|
color: "bg-orange-100 text-orange-700 border-orange-200",
|
|
807
|
-
icon:
|
|
808
|
+
icon: Je,
|
|
808
809
|
label: "ARCHIVE"
|
|
809
810
|
},
|
|
810
811
|
png: {
|
|
811
812
|
color: "bg-green-100 text-green-700 border-green-200",
|
|
812
|
-
icon:
|
|
813
|
+
icon: Ce,
|
|
813
814
|
label: "IMAGE"
|
|
814
815
|
},
|
|
815
816
|
jpg: {
|
|
816
817
|
color: "bg-green-100 text-green-700 border-green-200",
|
|
817
|
-
icon:
|
|
818
|
+
icon: Ce,
|
|
818
819
|
label: "IMAGE"
|
|
819
820
|
},
|
|
820
821
|
xlsx: {
|
|
821
822
|
color: "bg-emerald-100 text-emerald-700 border-emerald-200",
|
|
822
|
-
icon:
|
|
823
|
+
icon: X,
|
|
823
824
|
label: "EXCEL"
|
|
824
825
|
},
|
|
825
826
|
pptx: {
|
|
826
827
|
color: "bg-amber-100 text-amber-700 border-amber-200",
|
|
827
|
-
icon:
|
|
828
|
+
icon: X,
|
|
828
829
|
label: "PPT"
|
|
829
830
|
}
|
|
830
831
|
};
|
|
831
|
-
function
|
|
832
|
-
const
|
|
832
|
+
function Ve(d, l = "en") {
|
|
833
|
+
const s = {
|
|
833
834
|
month: "short",
|
|
834
835
|
day: "numeric"
|
|
835
836
|
};
|
|
836
|
-
return new Intl.DateTimeFormat(
|
|
837
|
+
return new Intl.DateTimeFormat(l, s).format(d);
|
|
837
838
|
}
|
|
838
|
-
function
|
|
839
|
+
function Ee(d) {
|
|
839
840
|
if (d === 0) return "0 B";
|
|
840
|
-
const
|
|
841
|
-
return `${parseFloat((d / Math.pow(
|
|
841
|
+
const l = 1024, s = ["B", "KB", "MB", "GB", "TB"], n = Math.floor(Math.log(d) / Math.log(l));
|
|
842
|
+
return `${parseFloat((d / Math.pow(l, n)).toFixed(1))} ${s[n]}`;
|
|
842
843
|
}
|
|
843
|
-
const
|
|
844
|
+
const es = { class: "space-y-0.5" }, ts = ["onClick"], ss = ["onClick"], ns = { class: "flex items-center gap-2" }, os = { class: "font-medium text-xs truncate hover:text-blue-600 cursor-pointer" }, as = { class: "hidden sm:block text-xs text-gray-500 w-16 text-right" }, ls = { class: "hidden md:block text-xs text-gray-500 w-12 text-right" }, is = { class: "flex items-center gap-1" }, rs = ["onClick"], ds = ["onClick"], cs = /* @__PURE__ */ H({
|
|
844
845
|
__name: "FileList",
|
|
845
846
|
props: {
|
|
846
847
|
files: {}
|
|
847
848
|
},
|
|
848
849
|
emits: ["delete", "download", "openLightbox"],
|
|
849
850
|
setup(d) {
|
|
850
|
-
return (
|
|
851
|
-
(
|
|
851
|
+
return (l, s) => (t(), a("div", es, [
|
|
852
|
+
(t(!0), a(j, null, A(l.files, (n) => (t(), a("div", {
|
|
852
853
|
class: "flex items-center gap-2 p-1.5 rounded hover:bg-gray-50 group border-b border-gray-100 last:border-b-0",
|
|
853
|
-
key:
|
|
854
|
-
onClick:
|
|
854
|
+
key: n.id,
|
|
855
|
+
onClick: Z((o) => l.$emit("openLightbox", n), ["stop"])
|
|
855
856
|
}, [
|
|
856
857
|
e("div", {
|
|
857
|
-
class:
|
|
858
|
+
class: z(["p-1 rounded", I(ie)[n?.ext]?.color || "bg-blue-100 text-blue-700 border-blue-200"])
|
|
858
859
|
}, [
|
|
859
|
-
(
|
|
860
|
+
(t(), S(W(I(ie)[n?.ext]?.icon || I(ie).pdf.icon), { class: "h-3 w-3" }))
|
|
860
861
|
], 2),
|
|
861
862
|
e("div", {
|
|
862
863
|
class: "flex-1 min-w-0",
|
|
863
|
-
onClick: (
|
|
864
|
+
onClick: (o) => l.$emit("openLightbox", n)
|
|
864
865
|
}, [
|
|
865
|
-
e("div",
|
|
866
|
-
e("span",
|
|
866
|
+
e("div", ns, [
|
|
867
|
+
e("span", os, _(n?.uploaded_name || n?.name), 1)
|
|
867
868
|
])
|
|
868
|
-
], 8,
|
|
869
|
-
e("div",
|
|
870
|
-
e("div",
|
|
871
|
-
e("div",
|
|
869
|
+
], 8, ss),
|
|
870
|
+
e("div", as, _(I(Ee)(n.size)), 1),
|
|
871
|
+
e("div", ls, _(I(Ve)(n.createdAt)), 1),
|
|
872
|
+
e("div", is, [
|
|
872
873
|
e("button", {
|
|
873
|
-
onClick:
|
|
874
|
+
onClick: Z((o) => l.$emit("download", n), ["stop"]),
|
|
874
875
|
class: "ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity"
|
|
875
876
|
}, [
|
|
876
|
-
|
|
877
|
-
], 8,
|
|
877
|
+
V(I(je), { class: "h-3 w-3" })
|
|
878
|
+
], 8, rs),
|
|
878
879
|
e("button", {
|
|
879
880
|
class: "ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700",
|
|
880
|
-
onClick:
|
|
881
|
+
onClick: Z((o) => l.$emit("delete", o, n?.file_id), ["stop"])
|
|
881
882
|
}, [
|
|
882
|
-
|
|
883
|
-
], 8,
|
|
883
|
+
V(I(ve), { class: "h-3 w-3" })
|
|
884
|
+
], 8, ds)
|
|
884
885
|
])
|
|
885
|
-
], 8,
|
|
886
|
+
], 8, ts))), 128))
|
|
886
887
|
]));
|
|
887
888
|
}
|
|
888
|
-
}),
|
|
889
|
+
}), us = { class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3" }, ps = ["onClick"], ms = { class: "space-y-2" }, gs = { class: "flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden" }, hs = ["src"], fs = { class: "space-y-1" }, ys = ["title"], vs = { class: "text-xs text-gray-500 text-left" }, bs = { class: "absolute top-2 right-1 flex items-center gap-1" }, xs = ["onClick"], ks = ["onClick"], _s = /* @__PURE__ */ H({
|
|
889
890
|
__name: "FileGrid",
|
|
890
891
|
props: {
|
|
891
892
|
files: {}
|
|
892
893
|
},
|
|
893
894
|
emits: ["delete", "download", "openLightbox"],
|
|
894
895
|
setup(d) {
|
|
895
|
-
return (
|
|
896
|
-
(
|
|
897
|
-
key:
|
|
898
|
-
onClick:
|
|
896
|
+
return (l, s) => (t(), a("div", us, [
|
|
897
|
+
(t(!0), a(j, null, A(l.files, (n) => (t(), a("div", {
|
|
898
|
+
key: n.id,
|
|
899
|
+
onClick: Z((o) => l.$emit("openLightbox", n), ["stop"]),
|
|
899
900
|
class: "group relative border rounded-lg p-2 hover:shadow-md transition-all bg-white hover:bg-gray-50 cursor-pointer"
|
|
900
901
|
}, [
|
|
901
|
-
e("div",
|
|
902
|
-
e("div",
|
|
903
|
-
|
|
902
|
+
e("div", ms, [
|
|
903
|
+
e("div", gs, [
|
|
904
|
+
n.ext === "png" || n.ext === "jpg" || n.ext === "jpeg" || n.ext === "gif" || n.ext === "svg" || n.ext === "webp" ? (t(), a("img", {
|
|
904
905
|
key: 0,
|
|
905
|
-
src: `/file/resize?filepath=${
|
|
906
|
+
src: `/file/resize?filepath=${n?.file_path}&w=500`,
|
|
906
907
|
alt: "file",
|
|
907
908
|
class: "w-full h-full object-cover"
|
|
908
|
-
}, null, 8,
|
|
909
|
+
}, null, 8, hs)) : (t(), S(I(X), {
|
|
909
910
|
key: 1,
|
|
910
911
|
class: "h-10 w-10 text-gray-500"
|
|
911
912
|
}))
|
|
912
913
|
]),
|
|
913
|
-
e("div",
|
|
914
|
+
e("div", fs, [
|
|
914
915
|
e("h3", {
|
|
915
916
|
class: "font-medium text-xs leading-tight text-left",
|
|
916
|
-
title:
|
|
917
|
-
},
|
|
918
|
-
e("p",
|
|
917
|
+
title: n.uploaded_name || n.name
|
|
918
|
+
}, _(n.uploaded_name || n.name), 9, ys),
|
|
919
|
+
e("p", vs, _(I(Ve)(n.createdAt)) + ", " + _(I(Ee)(n.size)), 1)
|
|
919
920
|
])
|
|
920
921
|
]),
|
|
921
|
-
e("div",
|
|
922
|
+
e("div", bs, [
|
|
922
923
|
e("button", {
|
|
923
|
-
onClick:
|
|
924
|
+
onClick: Z((o) => l.$emit("download", n), ["stop"]),
|
|
924
925
|
class: "ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:bg-accent hover:text-accent-foreground rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-50"
|
|
925
926
|
}, [
|
|
926
|
-
|
|
927
|
-
], 8,
|
|
927
|
+
V(I(je), { class: "h-3 w-3" })
|
|
928
|
+
], 8, xs),
|
|
928
929
|
e("button", {
|
|
929
930
|
class: "ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 rounded-md h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity text-red-600 hover:text-red-700 hover:bg-red-50",
|
|
930
|
-
onClick:
|
|
931
|
+
onClick: Z((o) => l.$emit("delete", o, n?.file_id), ["stop"])
|
|
931
932
|
}, [
|
|
932
|
-
|
|
933
|
-
], 8,
|
|
933
|
+
V(I(ve), { class: "h-3 w-3" })
|
|
934
|
+
], 8, ks)
|
|
934
935
|
])
|
|
935
|
-
], 8,
|
|
936
|
+
], 8, ps))), 128))
|
|
936
937
|
]));
|
|
937
938
|
}
|
|
938
|
-
}),
|
|
939
|
+
}), ws = { class: "mx-auto font-sans" }, $s = { key: 1 }, ue = /* @__PURE__ */ H({
|
|
939
940
|
__name: "FilesWidget",
|
|
940
941
|
props: {
|
|
941
942
|
title: {},
|
|
@@ -949,128 +950,128 @@ const qt = { class: "space-y-0.5" }, Kt = ["onClick"], Zt = ["onClick"], Jt = {
|
|
|
949
950
|
onDelete: {}
|
|
950
951
|
},
|
|
951
952
|
emits: ["delete", "add", "openLightbox"],
|
|
952
|
-
setup(d, { emit:
|
|
953
|
-
const
|
|
954
|
-
|
|
955
|
-
const
|
|
956
|
-
|
|
957
|
-
},
|
|
958
|
-
|
|
959
|
-
},
|
|
960
|
-
const
|
|
961
|
-
|
|
962
|
-
},
|
|
963
|
-
|
|
964
|
-
},
|
|
965
|
-
|
|
966
|
-
}, M = (
|
|
967
|
-
const
|
|
968
|
-
|
|
969
|
-
},
|
|
970
|
-
async function
|
|
971
|
-
if (!
|
|
953
|
+
setup(d, { emit: l }) {
|
|
954
|
+
const s = d, n = T(!1), o = T(null), h = T(!1), r = T(0), y = T(s.files ?? []), m = l;
|
|
955
|
+
y.value.length === 0 && u();
|
|
956
|
+
const k = ($, f) => {
|
|
957
|
+
o.value = f, n.value = !0;
|
|
958
|
+
}, b = () => {
|
|
959
|
+
o.value && (w(o.value), o.value = null, n.value = !1);
|
|
960
|
+
}, p = P(() => Array.isArray(y.value) ? y.value.map(($) => $?.file_path) : []), v = ($) => {
|
|
961
|
+
const f = p.value.findIndex((E) => E === $.file_path);
|
|
962
|
+
f !== -1 && (h.value = !0, r.value = f);
|
|
963
|
+
}, O = ($) => {
|
|
964
|
+
s.onAddFile ? s.onAddFile($) : c($), m("add", $);
|
|
965
|
+
}, w = ($) => {
|
|
966
|
+
s.onDelete ? s.onDelete($) : g($), m("delete", $);
|
|
967
|
+
}, M = ($) => {
|
|
968
|
+
const f = document.createElement("a");
|
|
969
|
+
f.setAttribute("download", $?.uploaded_name || $?.name), f.href = $?.file_path || $?.path, f.click();
|
|
970
|
+
}, i = T("list");
|
|
971
|
+
async function u() {
|
|
972
|
+
if (!s.id)
|
|
972
973
|
return;
|
|
973
|
-
const
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
}),
|
|
974
|
+
const $ = await fetch(`/api/widget/file/${s.id}`).then((f) => f.json());
|
|
975
|
+
$.rows.forEach((f) => {
|
|
976
|
+
f.timestamp = new Date(f.cdate), f.id = f.entity_id, f.entityType = f.entity_type, f.entityId = f.entity_id, f.entityType = f.entity_type, f.action = f.change_type, f.userId = f.change_user_id, f.userName = f.username, f.timestamp = new Date(f.cdate), f.description = f.username, f.status = f.username;
|
|
977
|
+
}), y.value = $.rows;
|
|
977
978
|
}
|
|
978
|
-
const
|
|
979
|
-
if (!(
|
|
979
|
+
const c = async ($) => {
|
|
980
|
+
if (!(!$.target || !$.target.files || $.target.files.length === 0))
|
|
980
981
|
try {
|
|
981
982
|
await Promise.all(
|
|
982
|
-
Array.from(
|
|
983
|
-
const
|
|
984
|
-
|
|
985
|
-
const
|
|
983
|
+
Array.from($.target.files).map(async (f) => {
|
|
984
|
+
const E = new FormData();
|
|
985
|
+
E.append("file", f);
|
|
986
|
+
const x = `/api/widget/file/${s.id}`, D = await fetch(x, {
|
|
986
987
|
method: "POST",
|
|
987
|
-
body:
|
|
988
|
+
body: E
|
|
988
989
|
});
|
|
989
|
-
if (!
|
|
990
|
-
throw new Error(`HTTP error! status: ${
|
|
991
|
-
return
|
|
990
|
+
if (!D.ok)
|
|
991
|
+
throw new Error(`HTTP error! status: ${D.status}`);
|
|
992
|
+
return f;
|
|
992
993
|
})
|
|
993
|
-
), await
|
|
994
|
-
} catch (
|
|
995
|
-
console.error("Помилка при завантаженні файлів:",
|
|
994
|
+
), await u();
|
|
995
|
+
} catch (f) {
|
|
996
|
+
console.error("Помилка при завантаженні файлів:", f);
|
|
996
997
|
}
|
|
997
|
-
},
|
|
998
|
+
}, g = async ($) => {
|
|
998
999
|
try {
|
|
999
1000
|
await fetch(
|
|
1000
|
-
`/api/widget/file/${
|
|
1001
|
+
`/api/widget/file/${s.id}/${$}`,
|
|
1001
1002
|
{
|
|
1002
1003
|
method: "DELETE"
|
|
1003
1004
|
}
|
|
1004
|
-
), await
|
|
1005
|
-
} catch (
|
|
1006
|
-
console.error(
|
|
1005
|
+
), await u();
|
|
1006
|
+
} catch (f) {
|
|
1007
|
+
console.error(f);
|
|
1007
1008
|
}
|
|
1008
1009
|
};
|
|
1009
|
-
return (
|
|
1010
|
-
const
|
|
1011
|
-
return
|
|
1012
|
-
e("div",
|
|
1013
|
-
|
|
1014
|
-
modelValue:
|
|
1015
|
-
"onUpdate:modelValue":
|
|
1016
|
-
title:
|
|
1017
|
-
onOnAddFile:
|
|
1010
|
+
return ($, f) => {
|
|
1011
|
+
const E = ae("MessageBox"), x = ae("Lightbox");
|
|
1012
|
+
return t(), a(j, null, [
|
|
1013
|
+
e("div", ws, [
|
|
1014
|
+
V(Yt, {
|
|
1015
|
+
modelValue: i.value,
|
|
1016
|
+
"onUpdate:modelValue": f[0] || (f[0] = (D) => i.value = D),
|
|
1017
|
+
title: s.title,
|
|
1018
|
+
onOnAddFile: f[1] || (f[1] = (D) => O(D))
|
|
1018
1019
|
}, null, 8, ["modelValue", "title"]),
|
|
1019
|
-
|
|
1020
|
+
y.value.length > 0 ? (t(), a("div", {
|
|
1020
1021
|
key: 0,
|
|
1021
|
-
class:
|
|
1022
|
-
style: Q({ maxHeight:
|
|
1022
|
+
class: z($.maxHeight ? "overflow-y-auto" : ""),
|
|
1023
|
+
style: Q({ maxHeight: $.maxHeight + "px" })
|
|
1023
1024
|
}, [
|
|
1024
|
-
|
|
1025
|
+
i.value === "list" ? (t(), S(cs, {
|
|
1025
1026
|
key: 0,
|
|
1026
|
-
onDelete:
|
|
1027
|
+
onDelete: k,
|
|
1027
1028
|
onDownload: M,
|
|
1028
|
-
onOpenLightbox:
|
|
1029
|
-
files:
|
|
1029
|
+
onOpenLightbox: f[2] || (f[2] = (D) => v(D)),
|
|
1030
|
+
files: y.value
|
|
1030
1031
|
}, null, 8, ["files"])) : C("", !0),
|
|
1031
|
-
|
|
1032
|
+
i.value === "grid" ? (t(), S(_s, {
|
|
1032
1033
|
key: 1,
|
|
1033
|
-
onDelete:
|
|
1034
|
+
onDelete: k,
|
|
1034
1035
|
onDownload: M,
|
|
1035
|
-
onOpenLightbox:
|
|
1036
|
-
files:
|
|
1036
|
+
onOpenLightbox: f[3] || (f[3] = (D) => v(D)),
|
|
1037
|
+
files: y.value
|
|
1037
1038
|
}, null, 8, ["files"])) : C("", !0)
|
|
1038
|
-
], 6)) : (
|
|
1039
|
+
], 6)) : (t(), a("div", $s, f[6] || (f[6] = [
|
|
1039
1040
|
e("div", { class: "flex items-center justify-center h-full" }, [
|
|
1040
1041
|
e("p", { class: "text-gray-500 leading-[3]" }, "Файлів не знайдено")
|
|
1041
1042
|
], -1)
|
|
1042
1043
|
])))
|
|
1043
1044
|
]),
|
|
1044
|
-
|
|
1045
|
-
modelValue:
|
|
1046
|
-
"onUpdate:modelValue":
|
|
1047
|
-
onConfirm:
|
|
1045
|
+
V(E, {
|
|
1046
|
+
modelValue: n.value,
|
|
1047
|
+
"onUpdate:modelValue": f[4] || (f[4] = (D) => n.value = D),
|
|
1048
|
+
onConfirm: b,
|
|
1048
1049
|
title: "Ви впевнені?",
|
|
1049
1050
|
message: "Ви впевнені, що хочете видалити цей файл?",
|
|
1050
1051
|
confirmButtonText: "Так, я впевнена/ий",
|
|
1051
1052
|
cancelButtonText: "Скасувати"
|
|
1052
1053
|
}, null, 8, ["modelValue"]),
|
|
1053
|
-
|
|
1054
|
-
modelValue:
|
|
1055
|
-
"onUpdate:modelValue":
|
|
1056
|
-
images:
|
|
1057
|
-
"start-index":
|
|
1054
|
+
V(x, {
|
|
1055
|
+
modelValue: h.value,
|
|
1056
|
+
"onUpdate:modelValue": f[5] || (f[5] = (D) => h.value = D),
|
|
1057
|
+
images: p.value,
|
|
1058
|
+
"start-index": r.value
|
|
1058
1059
|
}, null, 8, ["modelValue", "images", "start-index"])
|
|
1059
1060
|
], 64);
|
|
1060
1061
|
};
|
|
1061
1062
|
}
|
|
1062
|
-
}),
|
|
1063
|
+
}), Cs = {
|
|
1063
1064
|
key: 0,
|
|
1064
1065
|
class: "image-wrapper h-full max-h-[400px]",
|
|
1065
1066
|
id: "lightbox-gallery"
|
|
1066
|
-
},
|
|
1067
|
+
}, Ms = ["onClick"], Ls = {
|
|
1067
1068
|
key: 0,
|
|
1068
1069
|
rel: "noreferrer",
|
|
1069
1070
|
class: "relative block h-full w-full"
|
|
1070
|
-
},
|
|
1071
|
+
}, Ts = ["src"], Ds = {
|
|
1071
1072
|
key: 0,
|
|
1072
1073
|
class: "thumb-cover"
|
|
1073
|
-
},
|
|
1074
|
+
}, js = /* @__PURE__ */ H({
|
|
1074
1075
|
__name: "GalleryContent",
|
|
1075
1076
|
props: {
|
|
1076
1077
|
title: {},
|
|
@@ -1084,86 +1085,86 @@ const qt = { class: "space-y-0.5" }, Kt = ["onClick"], Zt = ["onClick"], Jt = {
|
|
|
1084
1085
|
style: {}
|
|
1085
1086
|
},
|
|
1086
1087
|
emits: ["delete"],
|
|
1087
|
-
setup(d, { emit:
|
|
1088
|
-
const
|
|
1089
|
-
() => Array.isArray(
|
|
1090
|
-
),
|
|
1091
|
-
const
|
|
1092
|
-
(
|
|
1088
|
+
setup(d, { emit: l }) {
|
|
1089
|
+
const s = l, n = T(!1), o = T(0), h = d, r = P(
|
|
1090
|
+
() => Array.isArray(h.items) ? h.items.map((m) => m?.file_path) : []
|
|
1091
|
+
), y = (m) => {
|
|
1092
|
+
const k = r.value.findIndex(
|
|
1093
|
+
(b) => b === m.file_path
|
|
1093
1094
|
);
|
|
1094
|
-
|
|
1095
|
+
k !== -1 && (n.value = !0, o.value = k);
|
|
1095
1096
|
};
|
|
1096
|
-
return (m,
|
|
1097
|
-
const
|
|
1098
|
-
return m.items?.length >= 1 ? (
|
|
1099
|
-
(
|
|
1100
|
-
class:
|
|
1101
|
-
key:
|
|
1102
|
-
onClick:
|
|
1097
|
+
return (m, k) => {
|
|
1098
|
+
const b = ae("Lightbox");
|
|
1099
|
+
return m.items?.length >= 1 ? (t(), a("div", Cs, [
|
|
1100
|
+
(t(!0), a(j, null, A(m.items, (p, v) => (t(), a("div", {
|
|
1101
|
+
class: z(["h-full w-full image" + v, "cursor-pointer bg-teal-500 rounded-[3px]"]),
|
|
1102
|
+
key: v,
|
|
1103
|
+
onClick: Z((O) => y(p), ["stop"])
|
|
1103
1104
|
}, [
|
|
1104
|
-
|
|
1105
|
+
v < 5 ? (t(), a("div", Ls, [
|
|
1105
1106
|
e("img", {
|
|
1106
|
-
src: `/file/resize?filepath=${
|
|
1107
|
+
src: `/file/resize?filepath=${p?.file_path}&w=500`,
|
|
1107
1108
|
alt: "alt",
|
|
1108
1109
|
height: "auto",
|
|
1109
1110
|
width: "100%",
|
|
1110
|
-
class:
|
|
1111
|
+
class: z([
|
|
1111
1112
|
"object-cover h-full w-full bg-gray-200 rounded-[3px]",
|
|
1112
|
-
|
|
1113
|
+
v === 0 ? "max-h-[411px]" : "max-h-[calc((411px-3px)/2)]"
|
|
1113
1114
|
])
|
|
1114
|
-
}, null, 10,
|
|
1115
|
-
|
|
1115
|
+
}, null, 10, Ts),
|
|
1116
|
+
v === 4 && m.items?.length > 5 ? (t(), a("div", Ds, " +" + _(m.items?.length - 5), 1)) : C("", !0)
|
|
1116
1117
|
])) : C("", !0)
|
|
1117
|
-
], 10,
|
|
1118
|
-
(
|
|
1119
|
-
key: "empty-" +
|
|
1120
|
-
class:
|
|
1118
|
+
], 10, Ms))), 128)),
|
|
1119
|
+
(t(!0), a(j, null, A(Math.max(0, 5 - m.items.length), (p) => (t(), a("div", {
|
|
1120
|
+
key: "empty-" + p,
|
|
1121
|
+
class: z(["h-full w-full image" + (m.items.length + p - 1), "bg-gray-300 rounded-[3px]"])
|
|
1121
1122
|
}, null, 2))), 128)),
|
|
1122
|
-
|
|
1123
|
-
modelValue:
|
|
1124
|
-
"onUpdate:modelValue":
|
|
1125
|
-
images:
|
|
1126
|
-
"start-index":
|
|
1123
|
+
V(b, {
|
|
1124
|
+
modelValue: n.value,
|
|
1125
|
+
"onUpdate:modelValue": k[0] || (k[0] = (p) => n.value = p),
|
|
1126
|
+
images: r.value,
|
|
1127
|
+
"start-index": o.value,
|
|
1127
1128
|
delete: "true",
|
|
1128
1129
|
download: "true",
|
|
1129
|
-
onDelete:
|
|
1130
|
+
onDelete: k[1] || (k[1] = (p) => s("delete", p))
|
|
1130
1131
|
}, null, 8, ["modelValue", "images", "start-index"])
|
|
1131
1132
|
])) : C("", !0);
|
|
1132
1133
|
};
|
|
1133
1134
|
}
|
|
1134
|
-
}),
|
|
1135
|
+
}), Is = {
|
|
1135
1136
|
key: 0,
|
|
1136
1137
|
class: "text-xl font-semibold"
|
|
1137
|
-
},
|
|
1138
|
+
}, zs = { class: "flex gap-1" }, As = { class: "ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background hover:bg-accent hover:text-accent-foreground border rounded-md text-xs h-7 px-2 cursor-pointer" }, Vs = /* @__PURE__ */ H({
|
|
1138
1139
|
__name: "widgetHeader",
|
|
1139
1140
|
props: {
|
|
1140
1141
|
title: {}
|
|
1141
1142
|
},
|
|
1142
1143
|
emits: ["onAddImage"],
|
|
1143
1144
|
setup(d) {
|
|
1144
|
-
return (
|
|
1145
|
-
class:
|
|
1145
|
+
return (l, s) => (t(), a("div", {
|
|
1146
|
+
class: z(["flex flex-col sm:flex-row gap-3 mb-4", l.title ? "justify-between sm:items-center" : "justify-end sm:items-center"])
|
|
1146
1147
|
}, [
|
|
1147
|
-
|
|
1148
|
-
e("div",
|
|
1148
|
+
l.title ? (t(), a("h3", Is, _(l.title), 1)) : C("", !0),
|
|
1149
|
+
e("div", zs, [
|
|
1149
1150
|
e("label", null, [
|
|
1150
1151
|
e("input", {
|
|
1151
1152
|
type: "file",
|
|
1152
1153
|
class: "hidden",
|
|
1153
|
-
onChange:
|
|
1154
|
+
onChange: s[0] || (s[0] = (n) => l.$emit("onAddImage", n))
|
|
1154
1155
|
}, null, 32),
|
|
1155
|
-
e("div",
|
|
1156
|
-
|
|
1157
|
-
|
|
1156
|
+
e("div", As, [
|
|
1157
|
+
V(I(Ie), { class: "h-4 w-4" }),
|
|
1158
|
+
s[1] || (s[1] = B(" Додати зображення ", -1))
|
|
1158
1159
|
])
|
|
1159
1160
|
])
|
|
1160
1161
|
])
|
|
1161
1162
|
], 2));
|
|
1162
1163
|
}
|
|
1163
|
-
}),
|
|
1164
|
+
}), Es = {
|
|
1164
1165
|
class: "w-full mx-auto font-sans",
|
|
1165
1166
|
ref: "containerRef"
|
|
1166
|
-
},
|
|
1167
|
+
}, Hs = { key: 1 }, pe = /* @__PURE__ */ H({
|
|
1167
1168
|
__name: "GalleryWidget",
|
|
1168
1169
|
props: {
|
|
1169
1170
|
title: {},
|
|
@@ -1177,135 +1178,135 @@ const qt = { class: "space-y-0.5" }, Kt = ["onClick"], Zt = ["onClick"], Jt = {
|
|
|
1177
1178
|
style: {}
|
|
1178
1179
|
},
|
|
1179
1180
|
emits: ["delete", "add", "openLightbox"],
|
|
1180
|
-
setup(d, { emit:
|
|
1181
|
-
const
|
|
1182
|
-
|
|
1183
|
-
const
|
|
1184
|
-
|
|
1185
|
-
},
|
|
1186
|
-
const
|
|
1187
|
-
(
|
|
1181
|
+
setup(d, { emit: l }) {
|
|
1182
|
+
const s = d, n = T(s.items ?? []), o = l;
|
|
1183
|
+
n.value.length === 0 && m();
|
|
1184
|
+
const h = (b) => {
|
|
1185
|
+
s.onAddImage ? s.onAddImage(b) : y(b), o("add", b);
|
|
1186
|
+
}, r = (b) => {
|
|
1187
|
+
const p = n.value.find(
|
|
1188
|
+
(v) => v.file_path === b
|
|
1188
1189
|
)?.file_id;
|
|
1189
|
-
|
|
1190
|
-
},
|
|
1191
|
-
if (!(!
|
|
1190
|
+
p && (s.onDelete ? s.onDelete(p) : k(p));
|
|
1191
|
+
}, y = async (b) => {
|
|
1192
|
+
if (!(!b.target || !b.target.files || b.target.files.length === 0))
|
|
1192
1193
|
try {
|
|
1193
1194
|
await Promise.all(
|
|
1194
|
-
Array.from(
|
|
1195
|
-
const
|
|
1196
|
-
|
|
1197
|
-
const
|
|
1195
|
+
Array.from(b.target.files).map(async (p) => {
|
|
1196
|
+
const v = new FormData();
|
|
1197
|
+
v.append("file", p);
|
|
1198
|
+
const O = `/api/widget/file/${s.id}`, w = await fetch(O, {
|
|
1198
1199
|
method: "POST",
|
|
1199
|
-
body:
|
|
1200
|
+
body: v
|
|
1200
1201
|
});
|
|
1201
|
-
if (
|
|
1202
|
-
throw new Error(`HTTP error! status: ${
|
|
1203
|
-
return
|
|
1202
|
+
if (!w.ok)
|
|
1203
|
+
throw new Error(`HTTP error! status: ${w.status}`);
|
|
1204
|
+
return p;
|
|
1204
1205
|
})
|
|
1205
1206
|
), await m();
|
|
1206
|
-
} catch (
|
|
1207
|
-
console.error("Помилка при завантаженні файлів:",
|
|
1207
|
+
} catch (p) {
|
|
1208
|
+
console.error("Помилка при завантаженні файлів:", p);
|
|
1208
1209
|
}
|
|
1209
1210
|
};
|
|
1210
1211
|
async function m() {
|
|
1211
|
-
if (!
|
|
1212
|
+
if (!s.id)
|
|
1212
1213
|
return;
|
|
1213
|
-
const
|
|
1214
|
-
(
|
|
1214
|
+
const b = await fetch(`/api/widget/file/${s.id}`).then(
|
|
1215
|
+
(p) => p.json()
|
|
1215
1216
|
);
|
|
1216
|
-
|
|
1217
|
+
n.value = b.rows;
|
|
1217
1218
|
}
|
|
1218
|
-
const
|
|
1219
|
+
const k = async (b) => {
|
|
1219
1220
|
try {
|
|
1220
|
-
await fetch(`/api/widget/file/${
|
|
1221
|
+
await fetch(`/api/widget/file/${s.id}/${b}`, {
|
|
1221
1222
|
method: "DELETE"
|
|
1222
1223
|
}), await m();
|
|
1223
|
-
} catch (
|
|
1224
|
-
console.error(
|
|
1224
|
+
} catch (p) {
|
|
1225
|
+
console.error(p);
|
|
1225
1226
|
}
|
|
1226
1227
|
};
|
|
1227
|
-
return (
|
|
1228
|
-
|
|
1229
|
-
title:
|
|
1230
|
-
onOnAddImage:
|
|
1228
|
+
return (b, p) => (t(), a("div", Es, [
|
|
1229
|
+
V(Vs, {
|
|
1230
|
+
title: b.title,
|
|
1231
|
+
onOnAddImage: p[0] || (p[0] = (v) => h(v))
|
|
1231
1232
|
}, null, 8, ["title"]),
|
|
1232
|
-
|
|
1233
|
+
n.value.length > 0 ? (t(), S(js, {
|
|
1233
1234
|
key: 0,
|
|
1234
|
-
items:
|
|
1235
|
-
onDelete:
|
|
1236
|
-
}, null, 8, ["items"])) : (
|
|
1235
|
+
items: n.value,
|
|
1236
|
+
onDelete: p[1] || (p[1] = (v) => r(v))
|
|
1237
|
+
}, null, 8, ["items"])) : (t(), a("div", Hs, p[2] || (p[2] = [
|
|
1237
1238
|
e("div", { class: "flex items-center justify-center h-full" }, [
|
|
1238
1239
|
e("p", { class: "text-gray-500 leading-[3]" }, "Зображень не знайдено")
|
|
1239
1240
|
], -1)
|
|
1240
1241
|
])))
|
|
1241
1242
|
], 512));
|
|
1242
1243
|
}
|
|
1243
|
-
}),
|
|
1244
|
+
}), Ss = { class: "text-value" }, Fs = { class: "text-sm text-gray-900" }, Os = /* @__PURE__ */ H({
|
|
1244
1245
|
__name: "TextValue",
|
|
1245
1246
|
props: {
|
|
1246
1247
|
item: {}
|
|
1247
1248
|
},
|
|
1248
1249
|
setup(d) {
|
|
1249
|
-
const
|
|
1250
|
-
const
|
|
1251
|
-
return typeof
|
|
1250
|
+
const l = d, s = P(() => {
|
|
1251
|
+
const n = l.item.value;
|
|
1252
|
+
return typeof n == "boolean" ? n ? "Так" : "Ні" : n == null ? "—" : String(n);
|
|
1252
1253
|
});
|
|
1253
|
-
return (
|
|
1254
|
-
e("span",
|
|
1254
|
+
return (n, o) => (t(), a("div", Ss, [
|
|
1255
|
+
e("span", Fs, _(s.value), 1)
|
|
1255
1256
|
]));
|
|
1256
1257
|
}
|
|
1257
|
-
}), G = (d,
|
|
1258
|
-
const
|
|
1259
|
-
for (const [
|
|
1260
|
-
|
|
1261
|
-
return
|
|
1262
|
-
},
|
|
1258
|
+
}), G = (d, l) => {
|
|
1259
|
+
const s = d.__vccOpts || d;
|
|
1260
|
+
for (const [n, o] of l)
|
|
1261
|
+
s[n] = o;
|
|
1262
|
+
return s;
|
|
1263
|
+
}, Bs = /* @__PURE__ */ G(Os, [["__scopeId", "data-v-c14550b7"]]), Ps = { class: "link-value" }, Ns = ["href"], Ws = /* @__PURE__ */ H({
|
|
1263
1264
|
__name: "LinkValue",
|
|
1264
1265
|
props: {
|
|
1265
1266
|
item: {}
|
|
1266
1267
|
},
|
|
1267
1268
|
setup(d) {
|
|
1268
|
-
const
|
|
1269
|
-
const
|
|
1269
|
+
const l = d, s = P(() => {
|
|
1270
|
+
const n = String(l.item.value);
|
|
1270
1271
|
try {
|
|
1271
|
-
const
|
|
1272
|
-
return
|
|
1272
|
+
const o = new URL(n);
|
|
1273
|
+
return o.hostname + o.pathname;
|
|
1273
1274
|
} catch {
|
|
1274
|
-
return
|
|
1275
|
+
return n;
|
|
1275
1276
|
}
|
|
1276
1277
|
});
|
|
1277
|
-
return (
|
|
1278
|
+
return (n, o) => (t(), a("div", Ps, [
|
|
1278
1279
|
e("a", {
|
|
1279
|
-
href: String(
|
|
1280
|
+
href: String(n.item.value),
|
|
1280
1281
|
target: "_blank",
|
|
1281
1282
|
rel: "noopener noreferrer",
|
|
1282
1283
|
class: "text-blue-600 hover:text-blue-800 underline text-sm"
|
|
1283
1284
|
}, [
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
], 8,
|
|
1285
|
+
B(_(s.value) + " ", 1),
|
|
1286
|
+
o[0] || (o[0] = e("i", { class: "fas fa-external-link-alt ml-1 text-xs" }, null, -1))
|
|
1287
|
+
], 8, Ns)
|
|
1287
1288
|
]));
|
|
1288
1289
|
}
|
|
1289
|
-
}),
|
|
1290
|
+
}), Rs = /* @__PURE__ */ G(Ws, [["__scopeId", "data-v-e6eb07a6"]]), Us = { class: "date-value" }, Gs = { class: "text-sm text-gray-900" }, qs = /* @__PURE__ */ H({
|
|
1290
1291
|
__name: "DateValue",
|
|
1291
1292
|
props: {
|
|
1292
1293
|
item: {}
|
|
1293
1294
|
},
|
|
1294
1295
|
setup(d) {
|
|
1295
|
-
const
|
|
1296
|
-
const
|
|
1297
|
-
if (
|
|
1298
|
-
return
|
|
1296
|
+
const l = d, s = P(() => {
|
|
1297
|
+
const n = l.item.value;
|
|
1298
|
+
if (n instanceof Date)
|
|
1299
|
+
return n.toLocaleDateString("uk-UA", {
|
|
1299
1300
|
year: "numeric",
|
|
1300
1301
|
month: "long",
|
|
1301
1302
|
day: "numeric",
|
|
1302
1303
|
hour: "2-digit",
|
|
1303
1304
|
minute: "2-digit"
|
|
1304
1305
|
});
|
|
1305
|
-
if (typeof
|
|
1306
|
-
const
|
|
1307
|
-
if (!isNaN(
|
|
1308
|
-
return
|
|
1306
|
+
if (typeof n == "string") {
|
|
1307
|
+
const o = new Date(n);
|
|
1308
|
+
if (!isNaN(o.getTime()))
|
|
1309
|
+
return o.toLocaleDateString("uk-UA", {
|
|
1309
1310
|
year: "numeric",
|
|
1310
1311
|
month: "long",
|
|
1311
1312
|
day: "numeric",
|
|
@@ -1313,23 +1314,23 @@ const qt = { class: "space-y-0.5" }, Kt = ["onClick"], Zt = ["onClick"], Jt = {
|
|
|
1313
1314
|
minute: "2-digit"
|
|
1314
1315
|
});
|
|
1315
1316
|
}
|
|
1316
|
-
return String(
|
|
1317
|
+
return String(n);
|
|
1317
1318
|
});
|
|
1318
|
-
return (
|
|
1319
|
-
e("span",
|
|
1319
|
+
return (n, o) => (t(), a("div", Us, [
|
|
1320
|
+
e("span", Gs, _(s.value), 1)
|
|
1320
1321
|
]));
|
|
1321
1322
|
}
|
|
1322
|
-
}),
|
|
1323
|
+
}), Zs = /* @__PURE__ */ G(qs, [["__scopeId", "data-v-b9600618"]]), Ks = { class: "status-value" }, Js = {
|
|
1323
1324
|
key: 0,
|
|
1324
1325
|
class: "mr-1"
|
|
1325
|
-
},
|
|
1326
|
+
}, Xs = /* @__PURE__ */ H({
|
|
1326
1327
|
__name: "StatusValue",
|
|
1327
1328
|
props: {
|
|
1328
1329
|
item: {}
|
|
1329
1330
|
},
|
|
1330
1331
|
setup(d) {
|
|
1331
|
-
const
|
|
1332
|
-
switch (String(
|
|
1332
|
+
const l = d, s = P(() => {
|
|
1333
|
+
switch (String(l.item.value).toLowerCase()) {
|
|
1333
1334
|
case "active":
|
|
1334
1335
|
case "активний":
|
|
1335
1336
|
case "успішно":
|
|
@@ -1351,8 +1352,8 @@ const qt = { class: "space-y-0.5" }, Kt = ["onClick"], Zt = ["onClick"], Jt = {
|
|
|
1351
1352
|
default:
|
|
1352
1353
|
return "bg-blue-100 text-blue-800";
|
|
1353
1354
|
}
|
|
1354
|
-
}),
|
|
1355
|
-
switch (String(
|
|
1355
|
+
}), n = P(() => {
|
|
1356
|
+
switch (String(l.item.value).toLowerCase()) {
|
|
1356
1357
|
case "active":
|
|
1357
1358
|
case "активний":
|
|
1358
1359
|
case "успішно":
|
|
@@ -1375,50 +1376,50 @@ const qt = { class: "space-y-0.5" }, Kt = ["onClick"], Zt = ["onClick"], Jt = {
|
|
|
1375
1376
|
return "fas fa-info-circle";
|
|
1376
1377
|
}
|
|
1377
1378
|
});
|
|
1378
|
-
return (
|
|
1379
|
+
return (o, h) => (t(), a("div", Ks, [
|
|
1379
1380
|
e("span", {
|
|
1380
|
-
class:
|
|
1381
|
+
class: z(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium", s.value])
|
|
1381
1382
|
}, [
|
|
1382
|
-
|
|
1383
|
+
n.value ? (t(), a("span", Js, [
|
|
1383
1384
|
e("i", {
|
|
1384
|
-
class:
|
|
1385
|
+
class: z(n.value)
|
|
1385
1386
|
}, null, 2)
|
|
1386
1387
|
])) : C("", !0),
|
|
1387
|
-
|
|
1388
|
+
B(" " + _(String(o.item.value)), 1)
|
|
1388
1389
|
], 2)
|
|
1389
1390
|
]));
|
|
1390
1391
|
}
|
|
1391
|
-
}),
|
|
1392
|
+
}), Qs = /* @__PURE__ */ G(Xs, [["__scopeId", "data-v-c72e0b01"]]), Ys = { class: "custom-value" }, en = { class: "text-sm text-gray-900" }, tn = /* @__PURE__ */ H({
|
|
1392
1393
|
__name: "CustomValue",
|
|
1393
1394
|
props: {
|
|
1394
1395
|
item: {}
|
|
1395
1396
|
},
|
|
1396
1397
|
setup(d) {
|
|
1397
|
-
return (
|
|
1398
|
-
|
|
1399
|
-
item:
|
|
1400
|
-
value:
|
|
1398
|
+
return (l, s) => (t(), a("div", Ys, [
|
|
1399
|
+
R(l.$slots, "default", {
|
|
1400
|
+
item: l.item,
|
|
1401
|
+
value: l.item.value
|
|
1401
1402
|
}, () => [
|
|
1402
|
-
e("span",
|
|
1403
|
+
e("span", en, _(String(l.item.value)), 1)
|
|
1403
1404
|
], !0)
|
|
1404
1405
|
]));
|
|
1405
1406
|
}
|
|
1406
|
-
}),
|
|
1407
|
+
}), sn = /* @__PURE__ */ G(tn, [["__scopeId", "data-v-11a73810"]]), nn = ["id"], on = {
|
|
1407
1408
|
key: 0,
|
|
1408
1409
|
class: "text-xl font-semibold text-gray-900 mb-4"
|
|
1409
|
-
},
|
|
1410
|
+
}, an = {
|
|
1410
1411
|
key: 1,
|
|
1411
1412
|
class: "overflow-x-auto"
|
|
1412
|
-
},
|
|
1413
|
+
}, ln = { class: "min-w-full divide-y divide-gray-200" }, rn = { class: "bg-white divide-y divide-gray-200" }, dn = { class: "px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900" }, cn = { class: "flex items-center gap-2" }, un = ["title"], pn = { class: "px-6 py-4 whitespace-nowrap text-sm text-gray-500" }, mn = {
|
|
1413
1414
|
key: 2,
|
|
1414
1415
|
class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"
|
|
1415
|
-
},
|
|
1416
|
+
}, gn = { class: "flex items-start gap-3" }, hn = {
|
|
1416
1417
|
key: 0,
|
|
1417
1418
|
class: "flex-shrink-0"
|
|
1418
|
-
},
|
|
1419
|
+
}, fn = { class: "flex-1 min-w-0" }, yn = { class: "flex items-center gap-2 mb-2" }, vn = { class: "text-sm font-medium text-gray-900" }, bn = ["title"], xn = {
|
|
1419
1420
|
key: 3,
|
|
1420
1421
|
class: "overflow-x-auto"
|
|
1421
|
-
},
|
|
1422
|
+
}, kn = { class: "min-w-full divide-y divide-gray-200" }, _n = { class: "bg-white divide-y divide-gray-200" }, wn = { class: "px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900" }, $n = { class: "flex items-center gap-2" }, Cn = ["title"], Mn = { class: "px-6 py-4 whitespace-nowrap text-sm text-gray-500" }, Ln = /* @__PURE__ */ H({
|
|
1422
1423
|
__name: "DescriptionListWidget",
|
|
1423
1424
|
props: {
|
|
1424
1425
|
title: {},
|
|
@@ -1429,112 +1430,112 @@ const qt = { class: "space-y-0.5" }, Kt = ["onClick"], Zt = ["onClick"], Jt = {
|
|
|
1429
1430
|
style: {}
|
|
1430
1431
|
},
|
|
1431
1432
|
setup(d) {
|
|
1432
|
-
const
|
|
1433
|
-
switch (
|
|
1433
|
+
const l = (s) => {
|
|
1434
|
+
switch (s.type) {
|
|
1434
1435
|
case "link":
|
|
1435
|
-
return
|
|
1436
|
+
return Rs;
|
|
1436
1437
|
case "date":
|
|
1437
|
-
return
|
|
1438
|
+
return Zs;
|
|
1438
1439
|
case "status":
|
|
1439
|
-
return
|
|
1440
|
+
return Qs;
|
|
1440
1441
|
case "custom":
|
|
1441
|
-
return
|
|
1442
|
+
return sn;
|
|
1442
1443
|
default:
|
|
1443
|
-
return
|
|
1444
|
+
return Bs;
|
|
1444
1445
|
}
|
|
1445
1446
|
};
|
|
1446
|
-
return (
|
|
1447
|
-
class:
|
|
1448
|
-
id:
|
|
1449
|
-
style: Q(
|
|
1447
|
+
return (s, n) => (t(), a("div", {
|
|
1448
|
+
class: z(["description-list-widget", s.className]),
|
|
1449
|
+
id: s.id,
|
|
1450
|
+
style: Q(s.style)
|
|
1450
1451
|
}, [
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
e("table",
|
|
1454
|
-
e("tbody",
|
|
1455
|
-
(
|
|
1456
|
-
key:
|
|
1452
|
+
s.title ? (t(), a("h3", on, _(s.title), 1)) : C("", !0),
|
|
1453
|
+
s.view === "table" ? (t(), a("div", an, [
|
|
1454
|
+
e("table", ln, [
|
|
1455
|
+
e("tbody", rn, [
|
|
1456
|
+
(t(!0), a(j, null, A(s.items, (o) => (t(), a("tr", {
|
|
1457
|
+
key: o.id || o.label
|
|
1457
1458
|
}, [
|
|
1458
|
-
e("td",
|
|
1459
|
-
e("div",
|
|
1460
|
-
|
|
1459
|
+
e("td", dn, [
|
|
1460
|
+
e("div", cn, [
|
|
1461
|
+
o.icon ? (t(), a("i", {
|
|
1461
1462
|
key: 0,
|
|
1462
|
-
class:
|
|
1463
|
+
class: z([o.icon, "text-gray-500"])
|
|
1463
1464
|
}, null, 2)) : C("", !0),
|
|
1464
|
-
|
|
1465
|
-
|
|
1465
|
+
B(" " + _(o.label) + " ", 1),
|
|
1466
|
+
o.tooltip ? (t(), a("span", {
|
|
1466
1467
|
key: 1,
|
|
1467
1468
|
class: "text-gray-400 cursor-help",
|
|
1468
|
-
title:
|
|
1469
|
-
},
|
|
1469
|
+
title: o.tooltip
|
|
1470
|
+
}, n[0] || (n[0] = [
|
|
1470
1471
|
e("i", { class: "fas fa-info-circle text-xs" }, null, -1)
|
|
1471
|
-
]), 8,
|
|
1472
|
+
]), 8, un)) : C("", !0)
|
|
1472
1473
|
])
|
|
1473
1474
|
]),
|
|
1474
|
-
e("td",
|
|
1475
|
-
(
|
|
1475
|
+
e("td", pn, [
|
|
1476
|
+
(t(), S(W(l(o)), { item: o }, null, 8, ["item"]))
|
|
1476
1477
|
])
|
|
1477
1478
|
]))), 128))
|
|
1478
1479
|
])
|
|
1479
1480
|
])
|
|
1480
|
-
])) :
|
|
1481
|
-
(
|
|
1482
|
-
key:
|
|
1481
|
+
])) : s.view === "grid" ? (t(), a("div", mn, [
|
|
1482
|
+
(t(!0), a(j, null, A(s.items, (o) => (t(), a("div", {
|
|
1483
|
+
key: o.id || o.label,
|
|
1483
1484
|
class: "description-item-card bg-white border border-gray-200 rounded-lg p-4"
|
|
1484
1485
|
}, [
|
|
1485
|
-
e("div",
|
|
1486
|
-
|
|
1486
|
+
e("div", gn, [
|
|
1487
|
+
o.icon ? (t(), a("div", hn, [
|
|
1487
1488
|
e("i", {
|
|
1488
|
-
class:
|
|
1489
|
+
class: z([o.icon, "text-gray-500 text-lg"])
|
|
1489
1490
|
}, null, 2)
|
|
1490
1491
|
])) : C("", !0),
|
|
1491
|
-
e("div",
|
|
1492
|
-
e("div",
|
|
1493
|
-
e("h4",
|
|
1494
|
-
|
|
1492
|
+
e("div", fn, [
|
|
1493
|
+
e("div", yn, [
|
|
1494
|
+
e("h4", vn, _(o.label), 1),
|
|
1495
|
+
o.tooltip ? (t(), a("span", {
|
|
1495
1496
|
key: 0,
|
|
1496
1497
|
class: "text-gray-400 cursor-help",
|
|
1497
|
-
title:
|
|
1498
|
-
},
|
|
1498
|
+
title: o.tooltip
|
|
1499
|
+
}, n[1] || (n[1] = [
|
|
1499
1500
|
e("i", { class: "fas fa-info-circle text-xs" }, null, -1)
|
|
1500
|
-
]), 8,
|
|
1501
|
+
]), 8, bn)) : C("", !0)
|
|
1501
1502
|
]),
|
|
1502
|
-
(
|
|
1503
|
+
(t(), S(W(l(o)), { item: o }, null, 8, ["item"]))
|
|
1503
1504
|
])
|
|
1504
1505
|
])
|
|
1505
1506
|
]))), 128))
|
|
1506
|
-
])) : (
|
|
1507
|
-
e("table",
|
|
1508
|
-
e("tbody",
|
|
1509
|
-
(
|
|
1510
|
-
key:
|
|
1507
|
+
])) : (t(), a("div", xn, [
|
|
1508
|
+
e("table", kn, [
|
|
1509
|
+
e("tbody", _n, [
|
|
1510
|
+
(t(!0), a(j, null, A(s.items, (o) => (t(), a("tr", {
|
|
1511
|
+
key: o.id || o.label
|
|
1511
1512
|
}, [
|
|
1512
|
-
e("td",
|
|
1513
|
-
e("div",
|
|
1514
|
-
|
|
1513
|
+
e("td", wn, [
|
|
1514
|
+
e("div", $n, [
|
|
1515
|
+
o.icon ? (t(), a("i", {
|
|
1515
1516
|
key: 0,
|
|
1516
|
-
class:
|
|
1517
|
+
class: z([o.icon, "text-gray-500"])
|
|
1517
1518
|
}, null, 2)) : C("", !0),
|
|
1518
|
-
|
|
1519
|
-
|
|
1519
|
+
B(" " + _(o.label) + " ", 1),
|
|
1520
|
+
o.tooltip ? (t(), a("span", {
|
|
1520
1521
|
key: 1,
|
|
1521
1522
|
class: "text-gray-400 cursor-help",
|
|
1522
|
-
title:
|
|
1523
|
-
},
|
|
1523
|
+
title: o.tooltip
|
|
1524
|
+
}, n[2] || (n[2] = [
|
|
1524
1525
|
e("i", { class: "fas fa-info-circle text-xs" }, null, -1)
|
|
1525
|
-
]), 8,
|
|
1526
|
+
]), 8, Cn)) : C("", !0)
|
|
1526
1527
|
])
|
|
1527
1528
|
]),
|
|
1528
|
-
e("td",
|
|
1529
|
-
(
|
|
1529
|
+
e("td", Mn, [
|
|
1530
|
+
(t(), S(W(l(o)), { item: o }, null, 8, ["item"]))
|
|
1530
1531
|
])
|
|
1531
1532
|
]))), 128))
|
|
1532
1533
|
])
|
|
1533
1534
|
])
|
|
1534
1535
|
]))
|
|
1535
|
-
], 14,
|
|
1536
|
+
], 14, nn));
|
|
1536
1537
|
}
|
|
1537
|
-
}),
|
|
1538
|
+
}), He = /* @__PURE__ */ G(Ln, [["__scopeId", "data-v-36d43e50"]]), Tn = {
|
|
1538
1539
|
draw: {
|
|
1539
1540
|
toolbar: {
|
|
1540
1541
|
actions: {
|
|
@@ -1642,7 +1643,7 @@ const qt = { class: "space-y-0.5" }, Kt = ["onClick"], Zt = ["onClick"], Jt = {
|
|
|
1642
1643
|
}
|
|
1643
1644
|
}
|
|
1644
1645
|
};
|
|
1645
|
-
function
|
|
1646
|
+
function Dn(d) {
|
|
1646
1647
|
return d ? d.type === "FeatureCollection" || d.type === "Feature" ? d : d.geom ? {
|
|
1647
1648
|
type: "Feature",
|
|
1648
1649
|
geometry: {
|
|
@@ -1656,10 +1657,10 @@ function ko(d) {
|
|
|
1656
1657
|
properties: {}
|
|
1657
1658
|
} : null : null;
|
|
1658
1659
|
}
|
|
1659
|
-
const
|
|
1660
|
+
const jn = {
|
|
1660
1661
|
key: 1,
|
|
1661
1662
|
class: "bg-white absolute top-[10px] right-[10px] z-[500] border rounded-lg cursor-pointer"
|
|
1662
|
-
},
|
|
1663
|
+
}, In = { class: "flex items-center justify-between p-2 border-b" }, zn = { class: "p-2 border-b" }, An = { class: "flex items-center" }, Vn = ["value"], En = { class: "ml-2" }, Hn = { class: "p-2" }, Sn = { class: "flex items-center" }, Fn = { class: "flex items-center" }, On = ["onUpdate:modelValue", "onChange"], Bn = { class: "ml-2" }, Pn = /* @__PURE__ */ H({
|
|
1663
1664
|
__name: "MapWidget",
|
|
1664
1665
|
props: {
|
|
1665
1666
|
pattern: {},
|
|
@@ -1668,88 +1669,105 @@ const _o = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, wo = {
|
|
|
1668
1669
|
tms: {}
|
|
1669
1670
|
},
|
|
1670
1671
|
setup(d) {
|
|
1671
|
-
const
|
|
1672
|
-
let
|
|
1673
|
-
const
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
url: "https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png"
|
|
1679
|
-
},
|
|
1680
|
-
osmb: {
|
|
1681
|
-
url: "https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png"
|
|
1682
|
-
}
|
|
1683
|
-
}, i = T("topo100");
|
|
1684
|
-
let b;
|
|
1685
|
-
const m = T(!0), x = T(!1), p = T(c());
|
|
1686
|
-
function c() {
|
|
1687
|
-
return a.tms ? (Array.isArray(a.tms) ? a.tms : a.tms?.split(",")).map((u, y) => ({ url: a.pattern ? a.pattern.replace("{{id}}", u) : u, name: "Шар " + y, visible: !0, i: y })) : [];
|
|
1672
|
+
const l = Te(), s = d, n = T(null);
|
|
1673
|
+
let o, h;
|
|
1674
|
+
const r = f(), y = T(Object.keys(r)[0]);
|
|
1675
|
+
let m;
|
|
1676
|
+
const k = T(!0), b = T(!1), p = T(!1), v = T(O());
|
|
1677
|
+
function O() {
|
|
1678
|
+
return s.tms ? (Array.isArray(s.tms) ? s.tms : s.tms?.split(",")).map((x, D) => ({ url: s.pattern ? s.pattern.replace("{{id}}", x) : x, name: "Шар " + D, visible: !0, i: D })) : [];
|
|
1688
1679
|
}
|
|
1689
|
-
function
|
|
1690
|
-
return new Promise((
|
|
1691
|
-
if (window.L && window.L.Draw) return
|
|
1692
|
-
const
|
|
1693
|
-
if (Array.from(document.styleSheets).some((
|
|
1694
|
-
const
|
|
1695
|
-
|
|
1696
|
-
},
|
|
1697
|
-
const
|
|
1698
|
-
if (
|
|
1699
|
-
|
|
1680
|
+
function w() {
|
|
1681
|
+
return new Promise((E, x) => {
|
|
1682
|
+
if (window.L && window.L.Draw) return E(0);
|
|
1683
|
+
const D = (q) => {
|
|
1684
|
+
if (Array.from(document.styleSheets).some((Y) => Y?.href?.includes(q))) return;
|
|
1685
|
+
const K = document.createElement("link");
|
|
1686
|
+
K.rel = "stylesheet", K.href = q, document.head.appendChild(K);
|
|
1687
|
+
}, N = (q) => new Promise((le, K) => {
|
|
1688
|
+
const Y = Array.from(document.scripts).find((te) => te.src === q);
|
|
1689
|
+
if (Y) {
|
|
1690
|
+
Y.addEventListener("load", () => le()), Y.addEventListener("error", (te) => K(te));
|
|
1700
1691
|
return;
|
|
1701
1692
|
}
|
|
1702
|
-
const
|
|
1703
|
-
|
|
1693
|
+
const ee = document.createElement("script");
|
|
1694
|
+
ee.src = q, ee.async = !0, ee.onload = () => le(), ee.onerror = (te) => K(te), document.body.appendChild(ee);
|
|
1704
1695
|
});
|
|
1705
|
-
|
|
1696
|
+
D("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), D("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), N("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => N("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() => E(0)).catch(x);
|
|
1706
1697
|
});
|
|
1707
1698
|
}
|
|
1699
|
+
let M = !1;
|
|
1708
1700
|
se(async () => {
|
|
1709
|
-
await
|
|
1710
|
-
const
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1701
|
+
await w(), L.drawLocal = Tn;
|
|
1702
|
+
const E = l?.appContext.config.globalProperties.$settings?.center || [50, 30];
|
|
1703
|
+
o = L.map(n.value, { zoomControl: !1 }).setView(E, 10), o.on("mousemove", (D) => {
|
|
1704
|
+
M || (o.invalidateSize(), M = !0);
|
|
1705
|
+
}), L.control.zoom({ position: "bottomright" }).addTo(o), m = L.tileLayer(r[y.value].url, { maxZoom: 19 }).addTo(o), y.value = "topo100", h = new L.FeatureGroup().addTo(o), v.value.length && $(0);
|
|
1706
|
+
const x = Dn(s.geom);
|
|
1707
|
+
if (x) {
|
|
1708
|
+
const D = [];
|
|
1709
|
+
L.geoJSON(x).eachLayer((N) => D.push(N)), D.length && h.addLayer(D[0]), h.toGeoJSON(), i();
|
|
1714
1710
|
}
|
|
1715
1711
|
});
|
|
1716
|
-
function
|
|
1717
|
-
const
|
|
1718
|
-
if (!
|
|
1719
|
-
const
|
|
1720
|
-
|
|
1712
|
+
function i(E = 30) {
|
|
1713
|
+
const x = h.getLayers();
|
|
1714
|
+
if (!x.length) return;
|
|
1715
|
+
const N = L.featureGroup(x).getBounds();
|
|
1716
|
+
N && N.isValid() && o.fitBounds(N, { padding: [E, E], maxZoom: 16 });
|
|
1721
1717
|
}
|
|
1722
|
-
function
|
|
1723
|
-
|
|
1724
|
-
const
|
|
1725
|
-
|
|
1718
|
+
function u(E) {
|
|
1719
|
+
m && m.removeFrom(o);
|
|
1720
|
+
const x = r[E];
|
|
1721
|
+
m = L.tileLayer(x.url, x.options || {}).addTo(o), y.value = E;
|
|
1726
1722
|
}
|
|
1727
|
-
function
|
|
1728
|
-
|
|
1723
|
+
function c() {
|
|
1724
|
+
u(y.value);
|
|
1729
1725
|
}
|
|
1730
1726
|
function g() {
|
|
1731
|
-
|
|
1727
|
+
h && (k.value ? h.addTo(o) : h.removeFrom(o));
|
|
1728
|
+
}
|
|
1729
|
+
function $(E) {
|
|
1730
|
+
const x = v.value[E];
|
|
1731
|
+
x.layer || (x.layer = L.tileLayer(x.url, { maxZoom: 19 })), x.visible ? x.layer.addTo(o) : x.layer.removeFrom(o);
|
|
1732
1732
|
}
|
|
1733
|
-
function f(
|
|
1734
|
-
|
|
1735
|
-
|
|
1733
|
+
function f() {
|
|
1734
|
+
return l?.appContext.config.globalProperties.$settings?.basemaps ? l?.appContext.config.globalProperties.$settings?.basemaps.map((E, x) => Object.assign(E, { key: `b${x}`, preview: E.preview || E.url.replace("{z}/{x}/{y}.png", "13/4790/2762.png") })).reduce((E, x) => ({ ...E, [x.key]: x }), {}) : {
|
|
1735
|
+
topo100: {
|
|
1736
|
+
url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",
|
|
1737
|
+
preview: "https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"
|
|
1738
|
+
},
|
|
1739
|
+
orto10: {
|
|
1740
|
+
url: "https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",
|
|
1741
|
+
preview: "https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4790/2762.png"
|
|
1742
|
+
},
|
|
1743
|
+
osmb: {
|
|
1744
|
+
url: "https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png",
|
|
1745
|
+
preview: "https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"
|
|
1746
|
+
}
|
|
1747
|
+
};
|
|
1736
1748
|
}
|
|
1737
|
-
return (
|
|
1749
|
+
return De(b, () => {
|
|
1750
|
+
setTimeout(() => {
|
|
1751
|
+
o.invalidateSize();
|
|
1752
|
+
}, 50);
|
|
1753
|
+
}), (E, x) => (t(), a("div", {
|
|
1754
|
+
class: z(["relative min-h-[300px] h-full", b.value ? "fullscreen" : "pb-[3.25rem]"])
|
|
1755
|
+
}, [
|
|
1738
1756
|
e("div", {
|
|
1739
1757
|
ref_key: "mapContainer",
|
|
1740
|
-
ref:
|
|
1758
|
+
ref: n,
|
|
1741
1759
|
class: "w-full h-full min-h-[300px]"
|
|
1742
1760
|
}, null, 512),
|
|
1743
|
-
|
|
1761
|
+
p.value ? C("", !0) : (t(), a("div", {
|
|
1744
1762
|
key: 0,
|
|
1745
|
-
onClick:
|
|
1763
|
+
onClick: x[0] || (x[0] = (D) => p.value = !0),
|
|
1746
1764
|
class: "z-[500] bg-white absolute top-[10px] right-[10px] p-2 border rounded-lg cursor-pointer"
|
|
1747
1765
|
}, " Шари ")),
|
|
1748
|
-
|
|
1749
|
-
e("div",
|
|
1750
|
-
|
|
1751
|
-
(
|
|
1752
|
-
onClick:
|
|
1766
|
+
p.value ? (t(), a("div", jn, [
|
|
1767
|
+
e("div", In, [
|
|
1768
|
+
x[6] || (x[6] = e("div", null, "Шари", -1)),
|
|
1769
|
+
(t(), a("svg", {
|
|
1770
|
+
onClick: x[1] || (x[1] = (D) => p.value = !1),
|
|
1753
1771
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1754
1772
|
viewBox: "0 0 24 24",
|
|
1755
1773
|
fill: "none",
|
|
@@ -1758,7 +1776,7 @@ const _o = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, wo = {
|
|
|
1758
1776
|
"stroke-linecap": "round",
|
|
1759
1777
|
"stroke-linejoin": "round",
|
|
1760
1778
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-x w-4 h-4"
|
|
1761
|
-
},
|
|
1779
|
+
}, x[5] || (x[5] = [
|
|
1762
1780
|
e("path", {
|
|
1763
1781
|
stroke: "none",
|
|
1764
1782
|
d: "M0 0h24v24H0z",
|
|
@@ -1768,79 +1786,70 @@ const _o = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, wo = {
|
|
|
1768
1786
|
e("path", { d: "M6 6l12 12" }, null, -1)
|
|
1769
1787
|
])))
|
|
1770
1788
|
]),
|
|
1771
|
-
e("div",
|
|
1772
|
-
|
|
1773
|
-
e("label",
|
|
1774
|
-
|
|
1775
|
-
type: "radio",
|
|
1776
|
-
name: "base-layer",
|
|
1777
|
-
value: "topo100",
|
|
1778
|
-
"onUpdate:modelValue": u[2] || (u[2] = (y) => i.value = y),
|
|
1779
|
-
onChange: M
|
|
1780
|
-
}, null, 544), [
|
|
1781
|
-
[oe, i.value]
|
|
1782
|
-
]),
|
|
1783
|
-
u[8] || (u[8] = e("span", { class: "ml-2" }, "Карта України", -1))
|
|
1784
|
-
])
|
|
1785
|
-
]),
|
|
1786
|
-
e("div", null, [
|
|
1787
|
-
e("label", Lo, [
|
|
1788
|
-
P(e("input", {
|
|
1789
|
+
e("div", zn, [
|
|
1790
|
+
(t(!0), a(j, null, A(I(r), (D, N) => (t(), a("div", null, [
|
|
1791
|
+
e("label", An, [
|
|
1792
|
+
U(e("input", {
|
|
1789
1793
|
type: "radio",
|
|
1790
1794
|
name: "base-layer",
|
|
1791
|
-
value:
|
|
1792
|
-
"onUpdate:modelValue":
|
|
1793
|
-
onChange:
|
|
1794
|
-
}, null,
|
|
1795
|
-
[
|
|
1795
|
+
value: N,
|
|
1796
|
+
"onUpdate:modelValue": x[2] || (x[2] = (q) => y.value = q),
|
|
1797
|
+
onChange: c
|
|
1798
|
+
}, null, 40, Vn), [
|
|
1799
|
+
[Oe, y.value]
|
|
1796
1800
|
]),
|
|
1797
|
-
|
|
1801
|
+
e("span", En, _(D.name || N), 1)
|
|
1798
1802
|
])
|
|
1799
|
-
]),
|
|
1800
|
-
e("div", null, [
|
|
1801
|
-
e("label", To, [
|
|
1802
|
-
P(e("input", {
|
|
1803
|
-
type: "radio",
|
|
1804
|
-
name: "base-layer",
|
|
1805
|
-
value: "osmb",
|
|
1806
|
-
"onUpdate:modelValue": u[4] || (u[4] = (y) => i.value = y),
|
|
1807
|
-
onChange: M
|
|
1808
|
-
}, null, 544), [
|
|
1809
|
-
[oe, i.value]
|
|
1810
|
-
]),
|
|
1811
|
-
u[10] || (u[10] = e("span", { class: "ml-2" }, "Open Street Map", -1))
|
|
1812
|
-
])
|
|
1813
|
-
])
|
|
1803
|
+
]))), 256))
|
|
1814
1804
|
]),
|
|
1815
|
-
e("div",
|
|
1816
|
-
e("label",
|
|
1817
|
-
|
|
1805
|
+
e("div", Hn, [
|
|
1806
|
+
e("label", Sn, [
|
|
1807
|
+
U(e("input", {
|
|
1818
1808
|
type: "checkbox",
|
|
1819
|
-
"onUpdate:modelValue":
|
|
1809
|
+
"onUpdate:modelValue": x[3] || (x[3] = (D) => k.value = D),
|
|
1820
1810
|
onChange: g
|
|
1821
1811
|
}, null, 544), [
|
|
1822
|
-
[
|
|
1812
|
+
[ke, k.value]
|
|
1823
1813
|
]),
|
|
1824
|
-
|
|
1814
|
+
x[7] || (x[7] = e("span", { class: "ml-2" }, " Геометрія/Межі ", -1))
|
|
1825
1815
|
]),
|
|
1826
|
-
|
|
1827
|
-
|
|
1816
|
+
s.tms ? (t(!0), a(j, { key: 0 }, A(v.value, (D) => (t(), a("label", Fn, [
|
|
1817
|
+
U(e("input", {
|
|
1828
1818
|
type: "checkbox",
|
|
1829
|
-
"onUpdate:modelValue": (
|
|
1830
|
-
onChange: (
|
|
1831
|
-
}, null, 40,
|
|
1832
|
-
[
|
|
1819
|
+
"onUpdate:modelValue": (N) => D.visible = N,
|
|
1820
|
+
onChange: (N) => $(D.i)
|
|
1821
|
+
}, null, 40, On), [
|
|
1822
|
+
[ke, D.visible]
|
|
1833
1823
|
]),
|
|
1834
|
-
e("span",
|
|
1824
|
+
e("span", Bn, _(D.name), 1)
|
|
1835
1825
|
]))), 256)) : C("", !0)
|
|
1836
1826
|
])
|
|
1837
|
-
])) : C("", !0)
|
|
1838
|
-
|
|
1827
|
+
])) : C("", !0),
|
|
1828
|
+
e("div", {
|
|
1829
|
+
class: z(["absolute z-[500] bg-white p-2 border rounded-lg cursor-pointer", b.value ? "bottom-[100px] right-[7px]" : "bottom-[150px] right-[7px]"]),
|
|
1830
|
+
onClick: x[4] || (x[4] = (D) => b.value = !b.value)
|
|
1831
|
+
}, x[8] || (x[8] = [
|
|
1832
|
+
e("svg", {
|
|
1833
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1834
|
+
fill: "none",
|
|
1835
|
+
viewBox: "0 0 24 24",
|
|
1836
|
+
"stroke-width": "2",
|
|
1837
|
+
stroke: "currentColor",
|
|
1838
|
+
class: "w-5 h-5"
|
|
1839
|
+
}, [
|
|
1840
|
+
e("path", {
|
|
1841
|
+
"stroke-linecap": "round",
|
|
1842
|
+
"stroke-linejoin": "round",
|
|
1843
|
+
d: "M4 8V4h4M20 8V4h-4M4 16v4h4m12-4v4h-4"
|
|
1844
|
+
})
|
|
1845
|
+
], -1)
|
|
1846
|
+
]), 2)
|
|
1847
|
+
], 2));
|
|
1839
1848
|
}
|
|
1840
|
-
}),
|
|
1849
|
+
}), me = /* @__PURE__ */ G(Pn, [["__scopeId", "data-v-d9c38ff0"]]), Nn = { class: "flex justify-between items-center mb-[15px]" }, Wn = { class: "font-semibold text-[16px]" }, Rn = { class: "overflow-x-auto" }, Un = { class: "min-w-full relative divide-y-2 divide-gray-200 bg-white min-w-full overflow-auto divide-y-2 divide-gray-200 bg-white text-[12px] text-gray-600" }, Gn = { class: "text-left font-medium text-gray-700" }, qn = { class: "py-2 min-w-[200px]" }, Zn = {
|
|
1841
1850
|
key: 0,
|
|
1842
1851
|
class: "py-2 min-w-[200px]"
|
|
1843
|
-
},
|
|
1852
|
+
}, Kn = { class: "divide-y divide-gray-200" }, Jn = { class: "bg-white odd:bg-gray-50" }, Xn = { class: "py-2 pr-5" }, Qn = ["href"], Yn = { class: "py-2 pr-5 gap-2 inline-flex" }, eo = ["onClick"], to = ["onClick"], so = /* @__PURE__ */ H({
|
|
1844
1853
|
__name: "TableWidget",
|
|
1845
1854
|
props: {
|
|
1846
1855
|
name: {},
|
|
@@ -1858,74 +1867,74 @@ const _o = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, wo = {
|
|
|
1858
1867
|
items: {}
|
|
1859
1868
|
},
|
|
1860
1869
|
setup(d) {
|
|
1861
|
-
const
|
|
1870
|
+
const l = Te(), s = T([]), n = T([]), o = d, h = T([]), r = T(""), y = T("");
|
|
1862
1871
|
async function m() {
|
|
1863
|
-
const
|
|
1864
|
-
|
|
1872
|
+
const i = await fetch("/api/data/" + o.token).then((u) => u.json());
|
|
1873
|
+
s.value = i.rows, n.value = i.columns, h.value = i.actions, r.value = i.form, y.value = i.addToken;
|
|
1865
1874
|
}
|
|
1866
|
-
const { $notify:
|
|
1867
|
-
async function
|
|
1868
|
-
await
|
|
1875
|
+
const { $notify: k = console.log, $confirm: b, $form: p } = l?.appContext?.config?.globalProperties || {};
|
|
1876
|
+
async function v(i) {
|
|
1877
|
+
await p({ token: i.token }), m();
|
|
1869
1878
|
}
|
|
1870
|
-
function
|
|
1871
|
-
|
|
1879
|
+
function O() {
|
|
1880
|
+
p({ token: y.value });
|
|
1872
1881
|
}
|
|
1873
|
-
function
|
|
1874
|
-
|
|
1882
|
+
function w(i) {
|
|
1883
|
+
b({
|
|
1875
1884
|
title: "Підтвердіть дію",
|
|
1876
1885
|
type: "error",
|
|
1877
1886
|
message: "Ви впевненні що бажаєте видалити даний рядок?",
|
|
1878
1887
|
onConfirm: async () => {
|
|
1879
|
-
const
|
|
1880
|
-
if (!
|
|
1881
|
-
const { error:
|
|
1882
|
-
|
|
1888
|
+
const u = await fetch(`/api/table/${i.token}`, { method: "DELETE" });
|
|
1889
|
+
if (!u.ok) {
|
|
1890
|
+
const { error: c, code: g } = await u.json();
|
|
1891
|
+
k({ title: "Помилка", type: "warning", message: c });
|
|
1883
1892
|
return;
|
|
1884
1893
|
}
|
|
1885
|
-
|
|
1894
|
+
k({ title: "Видаленно", message: "Успішно видалено" }), await m();
|
|
1886
1895
|
}
|
|
1887
1896
|
});
|
|
1888
1897
|
}
|
|
1889
1898
|
se(async () => {
|
|
1890
1899
|
await m();
|
|
1891
1900
|
});
|
|
1892
|
-
function M(
|
|
1893
|
-
return
|
|
1901
|
+
function M(i, u) {
|
|
1902
|
+
return u.format?.toLowerCase() === "text" ? i[u.name] : i[u.name + "_data"] ?? i[u.name + "_text"] ?? "-";
|
|
1894
1903
|
}
|
|
1895
|
-
return (
|
|
1896
|
-
e("div",
|
|
1897
|
-
e("div",
|
|
1898
|
-
|
|
1904
|
+
return (i, u) => (t(), a("div", null, [
|
|
1905
|
+
e("div", Nn, [
|
|
1906
|
+
e("div", Wn, _(i.title), 1),
|
|
1907
|
+
h.value.includes("add") && y.value ? (t(), a("button", {
|
|
1899
1908
|
key: 0,
|
|
1900
|
-
onClick:
|
|
1909
|
+
onClick: O,
|
|
1901
1910
|
class: "px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-blue-100 text-blue-500 hover:bg-blue-500 focus:ring-blue-500"
|
|
1902
1911
|
}, "Додати")) : C("", !0)
|
|
1903
1912
|
]),
|
|
1904
|
-
e("div",
|
|
1905
|
-
e("table",
|
|
1906
|
-
e("thead",
|
|
1913
|
+
e("div", Rn, [
|
|
1914
|
+
e("table", Un, [
|
|
1915
|
+
e("thead", Gn, [
|
|
1907
1916
|
e("tr", null, [
|
|
1908
|
-
(
|
|
1909
|
-
|
|
1917
|
+
(t(!0), a(j, null, A(n.value, (c) => (t(), a("th", qn, _(c.ua), 1))), 256)),
|
|
1918
|
+
h.value.includes("edit") ? (t(), a("th", Zn, " Дії ")) : C("", !0)
|
|
1910
1919
|
])
|
|
1911
1920
|
]),
|
|
1912
|
-
e("tbody",
|
|
1913
|
-
(
|
|
1914
|
-
(
|
|
1915
|
-
|
|
1921
|
+
e("tbody", Kn, [
|
|
1922
|
+
(t(!0), a(j, null, A(s.value, (c) => (t(), a("tr", Jn, [
|
|
1923
|
+
(t(!0), a(j, null, A(n.value, (g) => (t(), a("td", Xn, [
|
|
1924
|
+
g.link ? (t(), a("a", {
|
|
1916
1925
|
key: 0,
|
|
1917
|
-
href:
|
|
1926
|
+
href: g.link.replace("{{id}}", c.id),
|
|
1918
1927
|
class: "font-medium cursor-pointer text-start text-wrap text-cyan-800 decoration-2 focus:outline-none focus:underline hover:text-cyan-700 hover:underline"
|
|
1919
|
-
},
|
|
1920
|
-
|
|
1928
|
+
}, _(M(c, g)), 9, Qn)) : (t(), a(j, { key: 1 }, [
|
|
1929
|
+
B(_(M(c, g)), 1)
|
|
1921
1930
|
], 64))
|
|
1922
1931
|
]))), 256)),
|
|
1923
|
-
e("td",
|
|
1924
|
-
|
|
1932
|
+
e("td", Yn, [
|
|
1933
|
+
c.token ? (t(), a("button", {
|
|
1925
1934
|
key: 0,
|
|
1926
|
-
onClick: (
|
|
1935
|
+
onClick: (g) => v(c),
|
|
1927
1936
|
class: "inline-flex items-center justify-center bg-white border rounded-md size-7 gap-x-2 hover:bg-gray-100"
|
|
1928
|
-
},
|
|
1937
|
+
}, u[0] || (u[0] = [
|
|
1929
1938
|
e("svg", {
|
|
1930
1939
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1931
1940
|
width: "12px",
|
|
@@ -1954,14 +1963,14 @@ const _o = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, wo = {
|
|
|
1954
1963
|
"stroke-width": "2"
|
|
1955
1964
|
})
|
|
1956
1965
|
], -1)
|
|
1957
|
-
]), 8,
|
|
1958
|
-
|
|
1966
|
+
]), 8, eo)) : C("", !0),
|
|
1967
|
+
c.token ? (t(), a("button", {
|
|
1959
1968
|
key: 1,
|
|
1960
|
-
onClick: (
|
|
1969
|
+
onClick: (g) => w(c),
|
|
1961
1970
|
class: "inline-flex items-center justify-center bg-white border rounded-md size-7 gap-x-2 hover:bg-gray-100"
|
|
1962
|
-
},
|
|
1963
|
-
|
|
1964
|
-
]), 8,
|
|
1971
|
+
}, u[1] || (u[1] = [
|
|
1972
|
+
Be('<svg class="flex-shrink-0 size-3.5" xmlns="http://www.w3.org/2000/svg" width="12px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line></svg>', 1)
|
|
1973
|
+
]), 8, to)) : C("", !0)
|
|
1965
1974
|
])
|
|
1966
1975
|
]))), 256))
|
|
1967
1976
|
])
|
|
@@ -1969,169 +1978,169 @@ const _o = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, wo = {
|
|
|
1969
1978
|
])
|
|
1970
1979
|
]));
|
|
1971
1980
|
}
|
|
1972
|
-
}),
|
|
1981
|
+
}), no = { class: "p-[20px]" }, oo = { class: "flex gap-[6px] mb-5" }, ao = { class: "vs-form-text relative bg-white rounded-lg flex-grow" }, lo = { class: "grid p-3 lg:gap-x-3 md:gap-x-6 md:p-5 grid-cols-6" }, io = { class: "mt-2 text-sm font-medium text-gray-800 dark:text-neutral-200" }, ro = { class: "space-y-8" }, co = { key: 0 }, uo = { class: "grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6" }, po = ["onClick"], mo = { class: "md:col-span-2" }, go = { class: "text-sm font-medium text-gray-800 dark:text-neutral-200" }, ho = { class: "text-sm text-gray-500 dark:text-neutral-500" }, fo = { class: "grid items-center grid-cols-2 md:block text-end md:text-center" }, yo = ["checked", "onChange"], vo = { class: "grid p-3 bg-gray-100 rounded-lg md:gap-x-6 md:p-5 dark:bg-neutral-700 grid-cols-6" }, bo = { class: "md:col-span-2" }, xo = { class: "font-semibold text-gray-800 dark:text-neutral-200" }, ko = ["onClick"], _o = { class: "md:col-span-2" }, wo = { class: "text-sm font-medium text-gray-800 dark:text-neutral-200" }, $o = { class: "text-sm text-gray-500 dark:text-neutral-500" }, Co = { class: "grid items-center grid-cols-2 md:block text-end md:text-center" }, Mo = ["checked", "onChange"], ge = /* @__PURE__ */ H({
|
|
1973
1982
|
__name: "GroupInterfaceWidget",
|
|
1974
1983
|
props: {
|
|
1975
1984
|
data: {},
|
|
1976
1985
|
id: {}
|
|
1977
1986
|
},
|
|
1978
1987
|
setup(d) {
|
|
1979
|
-
const
|
|
1988
|
+
const l = d, s = T(""), n = ["view", "add", "edit", "del"], o = T({});
|
|
1980
1989
|
se(async () => {
|
|
1981
1990
|
const M = await (await fetch(
|
|
1982
|
-
`/api/access-group/${
|
|
1991
|
+
`/api/access-group/${l.id}?tab=vs-group-interface`
|
|
1983
1992
|
)).json();
|
|
1984
|
-
M.routes && M.routes.forEach((
|
|
1985
|
-
|
|
1993
|
+
M.routes && M.routes.forEach((i) => {
|
|
1994
|
+
o.value[i.path] = new Set(i.actions);
|
|
1986
1995
|
});
|
|
1987
1996
|
});
|
|
1988
|
-
const
|
|
1989
|
-
|
|
1990
|
-
},
|
|
1991
|
-
|
|
1992
|
-
|
|
1997
|
+
const h = (w, M) => o.value[w]?.has(M) ?? !1, r = (w, M) => {
|
|
1998
|
+
o.value[w] || (o.value[w] = /* @__PURE__ */ new Set()), o.value[w].has(M) ? o.value[w].delete(M) : o.value[w].add(M);
|
|
1999
|
+
}, y = (w, M) => {
|
|
2000
|
+
w.forEach((i) => {
|
|
2001
|
+
i.path && (o.value[i.path] || (o.value[i.path] = /* @__PURE__ */ new Set()), o.value[i.path].has(M) ? o.value[i.path].delete(M) : o.value[i.path].add(M));
|
|
1993
2002
|
});
|
|
1994
|
-
}, m =
|
|
1995
|
-
() => Object.entries(
|
|
1996
|
-
path:
|
|
2003
|
+
}, m = P(
|
|
2004
|
+
() => Object.entries(o.value).map(([w, M]) => ({
|
|
2005
|
+
path: w,
|
|
1997
2006
|
actions: Array.from(M)
|
|
1998
|
-
}))
|
|
1999
|
-
),
|
|
2007
|
+
})).filter((w) => w.actions.length)
|
|
2008
|
+
), k = async () => {
|
|
2000
2009
|
await fetch(
|
|
2001
|
-
`/api/access-group/${
|
|
2010
|
+
`/api/access-group/${l.id}?tab=vs-group-interface`,
|
|
2002
2011
|
{
|
|
2003
2012
|
method: "POST",
|
|
2004
2013
|
headers: { "Content-Type": "application/json" },
|
|
2005
2014
|
body: JSON.stringify({ routes: m.value })
|
|
2006
2015
|
}
|
|
2007
|
-
), console.log("Saved", m.value);
|
|
2008
|
-
},
|
|
2009
|
-
|
|
2010
|
-
},
|
|
2011
|
-
if (!
|
|
2012
|
-
const M =
|
|
2013
|
-
return
|
|
2014
|
-
(
|
|
2016
|
+
), console.log("Saved", m.value), Ue({ title: "Success!", message: "Permissions saved." });
|
|
2017
|
+
}, b = () => {
|
|
2018
|
+
o.value = {};
|
|
2019
|
+
}, p = (w) => {
|
|
2020
|
+
if (!s.value.trim()) return w;
|
|
2021
|
+
const M = s.value.toLowerCase();
|
|
2022
|
+
return w.filter(
|
|
2023
|
+
(i) => i.ua.toLowerCase().includes(M) || i.path && i.path.toLowerCase().includes(M)
|
|
2015
2024
|
);
|
|
2016
|
-
},
|
|
2017
|
-
() =>
|
|
2018
|
-
),
|
|
2019
|
-
() =>
|
|
2020
|
-
|
|
2021
|
-
menu:
|
|
2022
|
-
})).filter((
|
|
2025
|
+
}, v = P(
|
|
2026
|
+
() => p(l.data.routers.filter((w) => !w.menu))
|
|
2027
|
+
), O = P(
|
|
2028
|
+
() => l.data.routers.filter((w) => w.menu).map((w) => ({
|
|
2029
|
+
...w,
|
|
2030
|
+
menu: p(w.menu || [])
|
|
2031
|
+
})).filter((w) => w.menu && w.menu.length > 0)
|
|
2023
2032
|
);
|
|
2024
|
-
return (
|
|
2025
|
-
e("div",
|
|
2026
|
-
e("div",
|
|
2033
|
+
return (w, M) => (t(), a("div", no, [
|
|
2034
|
+
e("div", oo, [
|
|
2035
|
+
e("div", ao, [
|
|
2027
2036
|
M[1] || (M[1] = e("i", { class: "absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer ti" }, null, -1)),
|
|
2028
|
-
|
|
2037
|
+
U(e("input", {
|
|
2029
2038
|
type: "text",
|
|
2030
2039
|
placeholder: "Пошук",
|
|
2031
|
-
"onUpdate:modelValue": M[0] || (M[0] = (
|
|
2040
|
+
"onUpdate:modelValue": M[0] || (M[0] = (i) => s.value = i),
|
|
2032
2041
|
class: "bg-white h-[38px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
|
|
2033
2042
|
}, null, 512), [
|
|
2034
|
-
[
|
|
2043
|
+
[ye, s.value]
|
|
2035
2044
|
])
|
|
2036
2045
|
]),
|
|
2037
2046
|
e("button", {
|
|
2038
|
-
onClick:
|
|
2047
|
+
onClick: b,
|
|
2039
2048
|
class: "inline-flex items-center px-3 py-2 text-sm font-medium duration-300 bg-white border rounded-lg gap-x-2 hover:bg-gray-100"
|
|
2040
2049
|
}, " Скинути всі "),
|
|
2041
2050
|
e("button", {
|
|
2042
|
-
onClick:
|
|
2051
|
+
onClick: k,
|
|
2043
2052
|
class: "inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"
|
|
2044
2053
|
}, " Зберегти ")
|
|
2045
2054
|
]),
|
|
2046
|
-
e("div",
|
|
2055
|
+
e("div", lo, [
|
|
2047
2056
|
M[2] || (M[2] = e("div", { class: "self-center col-span-2" }, [
|
|
2048
2057
|
e("h2", { class: "font-semibold text-gray-800 dark:text-neutral-200" }, "Групи")
|
|
2049
2058
|
], -1)),
|
|
2050
|
-
(
|
|
2059
|
+
(t(), a(j, null, A(n, (i, u) => e("div", {
|
|
2051
2060
|
class: "col-span-1 text-center",
|
|
2052
|
-
key:
|
|
2061
|
+
key: u
|
|
2053
2062
|
}, [
|
|
2054
|
-
e("h3",
|
|
2063
|
+
e("h3", io, _(i), 1)
|
|
2055
2064
|
])), 64))
|
|
2056
2065
|
]),
|
|
2057
|
-
e("div",
|
|
2058
|
-
|
|
2059
|
-
e("ul",
|
|
2066
|
+
e("div", ro, [
|
|
2067
|
+
v.value.length ? (t(), a("div", co, [
|
|
2068
|
+
e("ul", uo, [
|
|
2060
2069
|
M[3] || (M[3] = e("li", { class: "md:col-span-2" }, [
|
|
2061
2070
|
e("h3", { class: "font-semibold text-gray-800 dark:text-neutral-200" }, "Без категорії")
|
|
2062
2071
|
], -1)),
|
|
2063
|
-
(
|
|
2064
|
-
key:
|
|
2072
|
+
(t(), a(j, null, A(n, (i, u) => e("li", {
|
|
2073
|
+
key: u,
|
|
2065
2074
|
class: "md:block md:col-span-1 md:text-center"
|
|
2066
2075
|
}, [
|
|
2067
2076
|
e("button", {
|
|
2068
2077
|
type: "button",
|
|
2069
2078
|
class: "text-xs font-medium text-blue-600 decoration-2 hover:underline",
|
|
2070
|
-
onClick: (
|
|
2071
|
-
}, " Toggle all ", 8,
|
|
2079
|
+
onClick: (c) => y(v.value, n[u])
|
|
2080
|
+
}, " Toggle all ", 8, po)
|
|
2072
2081
|
])), 64))
|
|
2073
2082
|
]),
|
|
2074
|
-
(
|
|
2075
|
-
key: "uncat-" +
|
|
2083
|
+
(t(!0), a(j, null, A(v.value, (i, u) => (t(), a("ul", {
|
|
2084
|
+
key: "uncat-" + u,
|
|
2076
2085
|
class: "grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"
|
|
2077
2086
|
}, [
|
|
2078
|
-
e("li",
|
|
2079
|
-
e("p",
|
|
2080
|
-
e("p",
|
|
2087
|
+
e("li", mo, [
|
|
2088
|
+
e("p", go, _(i.ua), 1),
|
|
2089
|
+
e("p", ho, _(i.path), 1)
|
|
2081
2090
|
]),
|
|
2082
|
-
(
|
|
2083
|
-
key:
|
|
2091
|
+
(t(), a(j, null, A(n, (c, g) => e("li", {
|
|
2092
|
+
key: g,
|
|
2084
2093
|
class: "col-span-1"
|
|
2085
2094
|
}, [
|
|
2086
|
-
e("div",
|
|
2095
|
+
e("div", fo, [
|
|
2087
2096
|
e("input", {
|
|
2088
2097
|
type: "checkbox",
|
|
2089
|
-
checked:
|
|
2090
|
-
onChange: (
|
|
2098
|
+
checked: h(i.path, c),
|
|
2099
|
+
onChange: ($) => r(i.path, c),
|
|
2091
2100
|
class: "text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"
|
|
2092
|
-
}, null, 40,
|
|
2101
|
+
}, null, 40, yo)
|
|
2093
2102
|
])
|
|
2094
2103
|
])), 64))
|
|
2095
2104
|
]))), 128))
|
|
2096
2105
|
])) : C("", !0),
|
|
2097
|
-
(
|
|
2098
|
-
key:
|
|
2106
|
+
(t(!0), a(j, null, A(O.value, (i, u) => (t(), a("div", {
|
|
2107
|
+
key: u,
|
|
2099
2108
|
class: "space-y-5"
|
|
2100
2109
|
}, [
|
|
2101
|
-
e("ul",
|
|
2102
|
-
e("li",
|
|
2103
|
-
e("h3",
|
|
2110
|
+
e("ul", vo, [
|
|
2111
|
+
e("li", bo, [
|
|
2112
|
+
e("h3", xo, _(i.ua), 1)
|
|
2104
2113
|
]),
|
|
2105
|
-
(
|
|
2106
|
-
key:
|
|
2114
|
+
(t(), a(j, null, A(n, (c, g) => e("li", {
|
|
2115
|
+
key: g,
|
|
2107
2116
|
class: "md:block md:col-span-1 md:text-center"
|
|
2108
2117
|
}, [
|
|
2109
2118
|
e("button", {
|
|
2110
2119
|
type: "button",
|
|
2111
2120
|
class: "text-xs font-medium text-blue-600 decoration-2 hover:underline",
|
|
2112
|
-
onClick: (
|
|
2113
|
-
}, " Toggle all ", 8,
|
|
2121
|
+
onClick: ($) => y(i.menu, n[g])
|
|
2122
|
+
}, " Toggle all ", 8, ko)
|
|
2114
2123
|
])), 64))
|
|
2115
2124
|
]),
|
|
2116
|
-
(
|
|
2117
|
-
key:
|
|
2125
|
+
(t(!0), a(j, null, A(i.menu, (c, g) => (t(), a("ul", {
|
|
2126
|
+
key: g,
|
|
2118
2127
|
class: "grid md:items-center gap-1.5 md:gap-6 px-3 md:px-5 mt-3 grid-cols-6"
|
|
2119
2128
|
}, [
|
|
2120
|
-
e("li",
|
|
2121
|
-
e("p",
|
|
2122
|
-
e("p",
|
|
2129
|
+
e("li", _o, [
|
|
2130
|
+
e("p", wo, _(c.ua), 1),
|
|
2131
|
+
e("p", $o, _(c.path), 1)
|
|
2123
2132
|
]),
|
|
2124
|
-
(
|
|
2125
|
-
key:
|
|
2133
|
+
(t(), a(j, null, A(n, ($, f) => e("li", {
|
|
2134
|
+
key: f,
|
|
2126
2135
|
class: "col-span-1"
|
|
2127
2136
|
}, [
|
|
2128
|
-
e("div",
|
|
2137
|
+
e("div", Co, [
|
|
2129
2138
|
e("input", {
|
|
2130
2139
|
type: "checkbox",
|
|
2131
|
-
checked:
|
|
2132
|
-
onChange: (
|
|
2140
|
+
checked: h(c.path, $),
|
|
2141
|
+
onChange: (E) => r(c.path, $),
|
|
2133
2142
|
class: "text-blue-600 border-gray-300 rounded shrink-0 focus:ring-blue-500"
|
|
2134
|
-
}, null, 40,
|
|
2143
|
+
}, null, 40, Mo)
|
|
2135
2144
|
])
|
|
2136
2145
|
])), 64))
|
|
2137
2146
|
]))), 128))
|
|
@@ -2139,22 +2148,22 @@ const _o = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, wo = {
|
|
|
2139
2148
|
])
|
|
2140
2149
|
]));
|
|
2141
2150
|
}
|
|
2142
|
-
}),
|
|
2143
|
-
"vs-widget-map":
|
|
2144
|
-
"vs-widget-comments":
|
|
2145
|
-
"vs-widget-history":
|
|
2146
|
-
"vs-widget-gallery":
|
|
2147
|
-
"vs-widget-file":
|
|
2148
|
-
"vs-widget-list":
|
|
2149
|
-
"vs-widget-table":
|
|
2150
|
-
"vs-group-interface":
|
|
2151
|
-
},
|
|
2151
|
+
}), Se = {
|
|
2152
|
+
"vs-widget-map": me,
|
|
2153
|
+
"vs-widget-comments": de,
|
|
2154
|
+
"vs-widget-history": ce,
|
|
2155
|
+
"vs-widget-gallery": pe,
|
|
2156
|
+
"vs-widget-file": ue,
|
|
2157
|
+
"vs-widget-list": He,
|
|
2158
|
+
"vs-widget-table": so,
|
|
2159
|
+
"vs-group-interface": ge
|
|
2160
|
+
}, Lo = {
|
|
2152
2161
|
key: 0,
|
|
2153
2162
|
class: "mb-4 pb-2 border-b border-gray-200"
|
|
2154
|
-
},
|
|
2163
|
+
}, To = { class: "text-lg font-semibold text-gray-900" }, Do = ["innerHTML"], jo = {
|
|
2155
2164
|
key: 0,
|
|
2156
2165
|
class: "mb-4 pb-2 border-b border-gray-200"
|
|
2157
|
-
},
|
|
2166
|
+
}, Io = { class: "text-lg font-semibold text-gray-900" }, zo = ["innerHTML"], Fe = /* @__PURE__ */ H({
|
|
2158
2167
|
__name: "CardItem",
|
|
2159
2168
|
props: {
|
|
2160
2169
|
items: {},
|
|
@@ -2172,65 +2181,68 @@ const _o = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, wo = {
|
|
|
2172
2181
|
style: {}
|
|
2173
2182
|
},
|
|
2174
2183
|
setup(d) {
|
|
2175
|
-
const
|
|
2176
|
-
console.log(
|
|
2177
|
-
const
|
|
2178
|
-
[`lg:col-span-${
|
|
2184
|
+
const l = d;
|
|
2185
|
+
console.log(l.data);
|
|
2186
|
+
const s = P(() => l.col ? {
|
|
2187
|
+
[`lg:col-span-${l.col}`]: !0
|
|
2179
2188
|
} : {});
|
|
2180
|
-
function
|
|
2181
|
-
return
|
|
2189
|
+
function n(r) {
|
|
2190
|
+
return Se[r] || r;
|
|
2182
2191
|
}
|
|
2183
|
-
const
|
|
2184
|
-
return
|
|
2185
|
-
|
|
2186
|
-
}),
|
|
2187
|
-
},
|
|
2188
|
-
const
|
|
2189
|
-
return
|
|
2192
|
+
const o = function(r = {}) {
|
|
2193
|
+
return r.props && Object.entries(r.props).forEach(([y, m]) => {
|
|
2194
|
+
r[y] = l.data[m];
|
|
2195
|
+
}), r;
|
|
2196
|
+
}, h = P(() => {
|
|
2197
|
+
const r = {};
|
|
2198
|
+
return l.col && (r.col = l.col), r;
|
|
2190
2199
|
});
|
|
2191
|
-
return (
|
|
2192
|
-
class:
|
|
2200
|
+
return (r, y) => (t(), a("div", {
|
|
2201
|
+
class: z(["w-full bg-gray-50 rounded-lg p-4 col-span-12", s.value])
|
|
2193
2202
|
}, [
|
|
2194
|
-
|
|
2195
|
-
e("h3",
|
|
2203
|
+
r.title ? (t(), a("div", Lo, [
|
|
2204
|
+
e("h3", To, _(r.title), 1)
|
|
2196
2205
|
])) : C("", !0),
|
|
2197
|
-
|
|
2206
|
+
r.html ? (t(), a("div", {
|
|
2198
2207
|
key: 1,
|
|
2199
|
-
innerHTML:
|
|
2200
|
-
class: "text-gray-900 leading-relaxed
|
|
2201
|
-
}, null, 8,
|
|
2208
|
+
innerHTML: r.html,
|
|
2209
|
+
class: "text-gray-900 leading-relaxed"
|
|
2210
|
+
}, null, 8, Do)) : r.type?.includes("tabs") ? (t(), S(he, {
|
|
2202
2211
|
key: 2,
|
|
2203
|
-
view:
|
|
2204
|
-
panels:
|
|
2205
|
-
data:
|
|
2206
|
-
}, null, 8, ["view", "panels", "data"])) : (
|
|
2207
|
-
m.title || m.label ? (
|
|
2208
|
-
e("h3",
|
|
2212
|
+
view: r.type,
|
|
2213
|
+
panels: r.items,
|
|
2214
|
+
data: r.data
|
|
2215
|
+
}, null, 8, ["view", "panels", "data"])) : (t(!0), a(j, { key: 3 }, A(r.items, (m) => (t(), a(j, null, [
|
|
2216
|
+
m.title || m.label ? (t(), a("div", jo, [
|
|
2217
|
+
e("h3", Io, _(m.title || m.label), 1)
|
|
2209
2218
|
])) : C("", !0),
|
|
2210
|
-
m.html ? (
|
|
2219
|
+
m.html ? (t(), a("div", {
|
|
2211
2220
|
key: 1,
|
|
2212
2221
|
innerHTML: m.html,
|
|
2213
|
-
class: "text-gray-900 leading-relaxed
|
|
2214
|
-
}, null, 8,
|
|
2222
|
+
class: "text-gray-900 leading-relaxed"
|
|
2223
|
+
}, null, 8, zo)) : m.component ? (t(), S(W(n(m.component)), J({
|
|
2215
2224
|
key: 2,
|
|
2216
2225
|
ref_for: !0
|
|
2217
|
-
}, { geom:
|
|
2226
|
+
}, { geom: r.data.geom, id: r.data.id, ...h.value, ...o(m), data: r.data }, { class: "w-full" }), null, 16)) : R(r.$slots, "default", { key: 3 })
|
|
2218
2227
|
], 64))), 256))
|
|
2219
2228
|
], 2));
|
|
2220
2229
|
}
|
|
2221
|
-
}),
|
|
2230
|
+
}), Ao = { class: "grid grid-cols-12 gap-[20px]" }, Vo = {
|
|
2222
2231
|
key: 0,
|
|
2223
2232
|
class: "col-span-4"
|
|
2224
|
-
},
|
|
2225
|
-
key:
|
|
2233
|
+
}, Eo = ["innerHTML"], Ho = {
|
|
2234
|
+
key: 0,
|
|
2226
2235
|
class: "overflow-hidden w-full"
|
|
2227
|
-
},
|
|
2228
|
-
key:
|
|
2236
|
+
}, So = { class: "flex border-b border-gray-200 bg-gray-50 relative" }, Fo = ["onClick"], Oo = { class: "p-1" }, Bo = ["innerHTML"], Po = {
|
|
2237
|
+
key: 1,
|
|
2229
2238
|
class: "flex w-full"
|
|
2230
|
-
},
|
|
2231
|
-
key:
|
|
2239
|
+
}, No = { class: "flex flex-col w-56 border-r border-gray-200 bg-gray-50 relative" }, Wo = ["onClick"], Ro = {
|
|
2240
|
+
key: 0,
|
|
2241
|
+
class: "absolute right-3 top-1/2 -translate-y-1/2 transition-all duration-300"
|
|
2242
|
+
}, Uo = { class: "flex-1 p-4" }, Go = ["innerHTML"], qo = {
|
|
2243
|
+
key: 2,
|
|
2232
2244
|
class: "p-1 w-full"
|
|
2233
|
-
},
|
|
2245
|
+
}, Zo = { class: "grid grid-cols-12 gap-4" }, he = /* @__PURE__ */ H({
|
|
2234
2246
|
__name: "Card",
|
|
2235
2247
|
props: {
|
|
2236
2248
|
panels: { default: () => [] },
|
|
@@ -2244,223 +2256,276 @@ const _o = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, wo = {
|
|
|
2244
2256
|
style: {}
|
|
2245
2257
|
},
|
|
2246
2258
|
setup(d) {
|
|
2247
|
-
const
|
|
2248
|
-
function
|
|
2249
|
-
return
|
|
2259
|
+
const l = d, s = T(0), n = T([]);
|
|
2260
|
+
function o(i) {
|
|
2261
|
+
return Se[i] || i;
|
|
2250
2262
|
}
|
|
2251
|
-
function
|
|
2252
|
-
return
|
|
2253
|
-
|
|
2254
|
-
}),
|
|
2263
|
+
function h(i) {
|
|
2264
|
+
return i.forEach((u) => {
|
|
2265
|
+
u.type && (u.view = u.type);
|
|
2266
|
+
}), n.value = i.filter((u) => u.type === "pin"), i.filter((u) => u.type !== "pin");
|
|
2255
2267
|
}
|
|
2256
|
-
const
|
|
2257
|
-
[`view-${
|
|
2258
|
-
})),
|
|
2259
|
-
const
|
|
2260
|
-
return
|
|
2261
|
-
};
|
|
2262
|
-
|
|
2263
|
-
|
|
2268
|
+
const r = P(() => l.panels && l.panels.length > 0 ? l.normalizeTabs ? h(l.panels) : l.panels : l.data && Array.isArray(l.data) ? l.data.filter((u) => u.type.includes("tabs"))[0]?.items || [] : []), y = P(() => l.panels && l.panels.length > 0 ? l.normalizeTabs ? h(l.panels) : l.panels : l.data && Array.isArray(l.data) ? l.data : []), m = P(() => ({
|
|
2269
|
+
[`view-${l.view}`]: !0
|
|
2270
|
+
})), k = (i) => {
|
|
2271
|
+
const u = { ...i };
|
|
2272
|
+
return l.data && (u.data = l.data), u;
|
|
2273
|
+
}, b = T([]), p = T([]), v = T([]);
|
|
2274
|
+
function O(i, u) {
|
|
2275
|
+
i && i instanceof HTMLElement && (b.value[u] = i);
|
|
2276
|
+
}
|
|
2277
|
+
function w() {
|
|
2278
|
+
p.value = b.value.map((i) => i.offsetWidth), v.value = b.value.map((i) => i.offsetLeft);
|
|
2279
|
+
}
|
|
2280
|
+
let M = null;
|
|
2281
|
+
return se(() => {
|
|
2282
|
+
_e(() => {
|
|
2283
|
+
w();
|
|
2284
|
+
}), M = new ResizeObserver(() => w()), M.observe(document.body);
|
|
2285
|
+
}), Pe(() => {
|
|
2286
|
+
M?.disconnect();
|
|
2287
|
+
}), De(s, () => {
|
|
2288
|
+
_e(() => {
|
|
2289
|
+
w();
|
|
2290
|
+
});
|
|
2291
|
+
}), (i, u) => (t(), a("div", {
|
|
2292
|
+
class: z(i.classWrapper || m.value)
|
|
2264
2293
|
}, [
|
|
2265
|
-
e("div",
|
|
2266
|
-
|
|
2267
|
-
(
|
|
2268
|
-
key:
|
|
2294
|
+
e("div", Ao, [
|
|
2295
|
+
n.value.length !== 0 ? (t(), a("div", Vo, [
|
|
2296
|
+
(t(!0), a(j, null, A(n.value[0].items, (c, g) => (t(), a("div", {
|
|
2297
|
+
key: c.name || g,
|
|
2269
2298
|
class: "w-full bg-gray-50 rounded-lg p-4 col-span-12 m-1 mb-3"
|
|
2270
2299
|
}, [
|
|
2271
|
-
|
|
2300
|
+
c.html ? (t(), a("div", {
|
|
2272
2301
|
key: 0,
|
|
2273
|
-
innerHTML:
|
|
2302
|
+
innerHTML: c.html,
|
|
2274
2303
|
class: "text-gray-900 leading-relaxed"
|
|
2275
|
-
}, null, 8,
|
|
2304
|
+
}, null, 8, Eo)) : c.component ? (t(), S(W(o(c.component)), J({
|
|
2276
2305
|
key: 1,
|
|
2277
2306
|
ref_for: !0
|
|
2278
|
-
},
|
|
2279
|
-
id:
|
|
2307
|
+
}, c.component === "Card" ? c : k(c), {
|
|
2308
|
+
id: i.data.id,
|
|
2280
2309
|
class: "w-full h-full"
|
|
2281
2310
|
}), null, 16, ["id"])) : C("", !0)
|
|
2282
2311
|
]))), 128))
|
|
2283
2312
|
])) : C("", !0),
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
"px-4 py-3 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-100 transition-colors",
|
|
2291
|
-
{ "text-blue-600 bg-white border-b-2 border-blue-600": o.value === k }
|
|
2292
|
-
])
|
|
2293
|
-
}, w(r.title || r.label || r.name || `Tab ${k + 1}`), 11, In))), 128))
|
|
2294
|
-
]),
|
|
2295
|
-
e("div", jn, [
|
|
2296
|
-
(s(!0), l(D, null, j(i.value, (r, k) => P((s(), l("div", {
|
|
2297
|
-
key: r.name || k,
|
|
2298
|
-
class: V([p.classPanel || "w-full border-gray-100 py-2", `col-span-${r.col || 12}`])
|
|
2299
|
-
}, [
|
|
2300
|
-
r.html ? (s(), l("div", {
|
|
2301
|
-
key: 0,
|
|
2302
|
-
innerHTML: r.html,
|
|
2303
|
-
class: "text-gray-900 leading-relaxed"
|
|
2304
|
-
}, null, 8, An)) : p.$slots[`tab-${k}`] ? U(p.$slots, `tab-${k}`, {
|
|
2305
|
-
key: 1,
|
|
2306
|
-
item: r,
|
|
2307
|
-
data: p.data
|
|
2308
|
-
}) : r.component || r.name ? (s(), E(B(n(r.component || r.name)), q({
|
|
2309
|
-
key: 2,
|
|
2310
|
-
ref_for: !0
|
|
2311
|
-
}, r.component === "Card" ? r : x(r), {
|
|
2312
|
-
id: p.data.id,
|
|
2313
|
-
class: "w-full h-full"
|
|
2314
|
-
}), null, 16, ["id"])) : U(p.$slots, r.slot || `tab-${k}`, {
|
|
2315
|
-
key: 3,
|
|
2316
|
-
item: r,
|
|
2317
|
-
data: p.data
|
|
2318
|
-
})
|
|
2319
|
-
], 2)), [
|
|
2320
|
-
[ve, o.value === k]
|
|
2321
|
-
])), 128))
|
|
2322
|
-
])
|
|
2323
|
-
])) : p.view === "vertical-tabs" ? (s(), l("div", Vn, [
|
|
2324
|
-
e("div", zn, [
|
|
2325
|
-
(s(!0), l(D, null, j(i.value, (r, k) => (s(), l("button", {
|
|
2326
|
-
key: r.name || k,
|
|
2327
|
-
onClick: ($) => o.value = k,
|
|
2328
|
-
class: V([
|
|
2329
|
-
"px-4 py-3 text-sm font-medium text-left text-gray-600 hover:text-gray-800 hover:bg-gray-100 transition-colors",
|
|
2330
|
-
{ "text-blue-600 bg-white border-r-4 border-blue-600": o.value === k }
|
|
2331
|
-
])
|
|
2332
|
-
}, w(r.title || r.label || r.name || `Tab ${k + 1}`), 11, En))), 128))
|
|
2333
|
-
]),
|
|
2334
|
-
e("div", Hn, [
|
|
2335
|
-
(s(!0), l(D, null, j(i.value, (r, k) => P((s(), l("div", {
|
|
2336
|
-
key: r.name || k,
|
|
2337
|
-
class: V([p.classPanel || "w-full border-gray-100 py-2", `col-span-${r.col || 12}`])
|
|
2338
|
-
}, [
|
|
2339
|
-
r.html ? (s(), l("div", {
|
|
2340
|
-
key: 0,
|
|
2341
|
-
innerHTML: r.html,
|
|
2342
|
-
class: "text-gray-900 leading-relaxed"
|
|
2343
|
-
}, null, 8, Sn)) : p.$slots[`tab-${k}`] ? U(p.$slots, `tab-${k}`, {
|
|
2344
|
-
key: 1,
|
|
2345
|
-
item: r,
|
|
2346
|
-
data: p.data
|
|
2347
|
-
}) : r.component || r.name ? (s(), E(B(n(r.component || r.name)), q({
|
|
2348
|
-
key: 2,
|
|
2349
|
-
ref_for: !0
|
|
2350
|
-
}, r.component === "Card" ? r : x(r), {
|
|
2351
|
-
id: p.data.id,
|
|
2352
|
-
class: "w-full h-full"
|
|
2353
|
-
}), null, 16, ["id"])) : U(p.$slots, r.slot || `tab-${k}`, {
|
|
2354
|
-
key: 3,
|
|
2355
|
-
item: r,
|
|
2356
|
-
data: p.data
|
|
2357
|
-
})
|
|
2358
|
-
], 2)), [
|
|
2359
|
-
[ve, o.value === k]
|
|
2360
|
-
])), 128))
|
|
2361
|
-
])
|
|
2362
|
-
])) : (s(), l("div", Fn, [
|
|
2363
|
-
e("div", On, [
|
|
2364
|
-
(s(!0), l(D, null, j(b.value, (r, k) => (s(), l(D, {
|
|
2365
|
-
key: r.name || k
|
|
2366
|
-
}, [
|
|
2367
|
-
p.$slots[`panel-${k}`] ? U(p.$slots, `panel-${k}`, {
|
|
2313
|
+
e("div", {
|
|
2314
|
+
class: z(n.value.length !== 0 ? "col-span-8" : "col-span-12")
|
|
2315
|
+
}, [
|
|
2316
|
+
i.view === "tabs" ? (t(), a("div", Ho, [
|
|
2317
|
+
e("div", So, [
|
|
2318
|
+
p.value.length ? (t(), a("div", {
|
|
2368
2319
|
key: 0,
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
},
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
})
|
|
2385
|
-
]
|
|
2386
|
-
|
|
2387
|
-
|
|
2320
|
+
class: "absolute bottom-0 h-[2px] bg-blue-600 transition-all duration-300",
|
|
2321
|
+
style: Q({
|
|
2322
|
+
width: p.value[s.value] + "px",
|
|
2323
|
+
left: v.value[s.value] + "px"
|
|
2324
|
+
})
|
|
2325
|
+
}, null, 4)) : C("", !0),
|
|
2326
|
+
(t(!0), a(j, null, A(r.value, (c, g) => (t(), a("button", {
|
|
2327
|
+
key: c.name || g,
|
|
2328
|
+
ref_for: !0,
|
|
2329
|
+
ref: ($) => O($, g),
|
|
2330
|
+
onClick: ($) => s.value = g,
|
|
2331
|
+
class: z([
|
|
2332
|
+
"relative px-4 py-3 text-sm font-medium transition-colors duration-300",
|
|
2333
|
+
s.value === g ? "text-blue-600" : "text-gray-600 hover:text-gray-800"
|
|
2334
|
+
])
|
|
2335
|
+
}, _(c.title || c.label || c.name || `Tab ${g + 1}`), 11, Fo))), 128))
|
|
2336
|
+
]),
|
|
2337
|
+
e("div", Oo, [
|
|
2338
|
+
(t(!0), a(j, null, A(r.value, (c, g) => U((t(), a("div", {
|
|
2339
|
+
key: c.name || g,
|
|
2340
|
+
class: z([
|
|
2341
|
+
"transition-all duration-300 ease-in-out",
|
|
2342
|
+
s.value === g ? "opacity-100 translate-y-0" : "opacity-0 -translate-y-2",
|
|
2343
|
+
i.classPanel || "w-full border-gray-100 py-2"
|
|
2344
|
+
])
|
|
2345
|
+
}, [
|
|
2346
|
+
c.html ? (t(), a("div", {
|
|
2347
|
+
key: 0,
|
|
2348
|
+
innerHTML: c.html,
|
|
2349
|
+
class: "text-gray-900 leading-relaxed"
|
|
2350
|
+
}, null, 8, Bo)) : i.$slots[`tab-${g}`] ? R(i.$slots, `tab-${g}`, {
|
|
2351
|
+
key: 1,
|
|
2352
|
+
item: c,
|
|
2353
|
+
data: i.data
|
|
2354
|
+
}) : c.component || c.name ? (t(), S(W(o(c.component || c.name)), J({
|
|
2355
|
+
key: 2,
|
|
2356
|
+
ref_for: !0
|
|
2357
|
+
}, c.component === "Card" ? c : k(c), {
|
|
2358
|
+
id: i.data.id,
|
|
2359
|
+
class: "w-full h-full"
|
|
2360
|
+
}), null, 16, ["id"])) : R(i.$slots, c.slot || `tab-${g}`, {
|
|
2361
|
+
key: 3,
|
|
2362
|
+
item: c,
|
|
2363
|
+
data: i.data
|
|
2364
|
+
})
|
|
2365
|
+
], 2)), [
|
|
2366
|
+
[we, s.value === g]
|
|
2367
|
+
])), 128))
|
|
2368
|
+
])
|
|
2369
|
+
])) : i.view === "vertical-tabs" ? (t(), a("div", Po, [
|
|
2370
|
+
e("div", No, [
|
|
2371
|
+
(t(!0), a(j, null, A(r.value, (c, g) => (t(), a("button", {
|
|
2372
|
+
key: c.name || g,
|
|
2373
|
+
onClick: ($) => s.value = g,
|
|
2374
|
+
class: z([
|
|
2375
|
+
"relative px-4 py-3 text-sm font-medium text-left transition-colors duration-300",
|
|
2376
|
+
s.value === g ? "text-blue-600 bg-white" : "text-gray-600 hover:text-gray-800 hover:bg-gray-100"
|
|
2377
|
+
])
|
|
2378
|
+
}, [
|
|
2379
|
+
B(_(c.title || c.label || c.name || `Tab ${g + 1}`) + " ", 1),
|
|
2380
|
+
s.value === g ? (t(), a("span", Ro, u[0] || (u[0] = [
|
|
2381
|
+
e("svg", {
|
|
2382
|
+
viewBox: "0 0 24 24",
|
|
2383
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2384
|
+
width: "20",
|
|
2385
|
+
height: "20",
|
|
2386
|
+
fill: "currentColor",
|
|
2387
|
+
class: "remixicon text-blue-600 rounded-full bg-white shadow scale-90 opacity-100 transition ease-out"
|
|
2388
|
+
}, [
|
|
2389
|
+
e("path", { d: "M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z" })
|
|
2390
|
+
], -1)
|
|
2391
|
+
]))) : C("", !0)
|
|
2392
|
+
], 10, Wo))), 128))
|
|
2393
|
+
]),
|
|
2394
|
+
e("div", Uo, [
|
|
2395
|
+
(t(!0), a(j, null, A(r.value, (c, g) => U((t(), a("div", {
|
|
2396
|
+
key: c.name || g,
|
|
2397
|
+
class: z([
|
|
2398
|
+
"transition-all duration-300 ease-in-out",
|
|
2399
|
+
s.value === g ? "opacity-100 translate-y-0" : "opacity-0 -translate-y-2",
|
|
2400
|
+
i.classPanel || "w-full border-gray-100 py-2"
|
|
2401
|
+
])
|
|
2402
|
+
}, [
|
|
2403
|
+
c.html ? (t(), a("div", {
|
|
2404
|
+
key: 0,
|
|
2405
|
+
innerHTML: c.html,
|
|
2406
|
+
class: "text-gray-900 leading-relaxed"
|
|
2407
|
+
}, null, 8, Go)) : i.$slots[`tab-${g}`] ? R(i.$slots, `tab-${g}`, {
|
|
2408
|
+
key: 1,
|
|
2409
|
+
item: c,
|
|
2410
|
+
data: i.data
|
|
2411
|
+
}) : c.component || c.name ? (t(), S(W(o(c.component || c.name)), J({
|
|
2412
|
+
key: 2,
|
|
2413
|
+
ref_for: !0
|
|
2414
|
+
}, c.component === "Card" ? c : k(c), {
|
|
2415
|
+
id: i.data.id,
|
|
2416
|
+
class: "w-full h-full"
|
|
2417
|
+
}), null, 16, ["id"])) : R(i.$slots, c.slot || `tab-${g}`, {
|
|
2418
|
+
key: 3,
|
|
2419
|
+
item: c,
|
|
2420
|
+
data: i.data
|
|
2421
|
+
})
|
|
2422
|
+
], 2)), [
|
|
2423
|
+
[we, s.value === g]
|
|
2424
|
+
])), 128))
|
|
2425
|
+
])
|
|
2426
|
+
])) : (t(), a("div", qo, [
|
|
2427
|
+
e("div", Zo, [
|
|
2428
|
+
(t(!0), a(j, null, A(y.value, (c, g) => (t(), a(j, {
|
|
2429
|
+
key: c.name || g
|
|
2430
|
+
}, [
|
|
2431
|
+
i.$slots[`panel-${g}`] ? R(i.$slots, `panel-${g}`, {
|
|
2432
|
+
key: 0,
|
|
2433
|
+
item: c,
|
|
2434
|
+
data: i.data
|
|
2435
|
+
}) : c.items || c.html ? (t(), S(W(Fe), J({
|
|
2436
|
+
key: 1,
|
|
2437
|
+
ref_for: !0
|
|
2438
|
+
}, k(c), {
|
|
2439
|
+
items: c.items,
|
|
2440
|
+
class: "w-full h-full"
|
|
2441
|
+
}), null, 16, ["items"])) : c.component ? (t(), S(W(o(c.component)), J({
|
|
2442
|
+
key: 2,
|
|
2443
|
+
ref_for: !0
|
|
2444
|
+
}, k(c), { class: "w-full h-full" }), null, 16)) : R(i.$slots, c.slot || `panel-${g}`, {
|
|
2445
|
+
key: 3,
|
|
2446
|
+
item: c,
|
|
2447
|
+
data: i.data
|
|
2448
|
+
})
|
|
2449
|
+
], 64))), 128))
|
|
2450
|
+
])
|
|
2451
|
+
]))
|
|
2452
|
+
], 2)
|
|
2388
2453
|
])
|
|
2389
2454
|
], 2));
|
|
2390
2455
|
}
|
|
2391
|
-
}),
|
|
2456
|
+
}), Ko = ["onClick"], Jo = /* @__PURE__ */ H({
|
|
2392
2457
|
__name: "CopyNotification",
|
|
2393
|
-
setup(d, { expose:
|
|
2394
|
-
const
|
|
2395
|
-
let
|
|
2396
|
-
const
|
|
2397
|
-
if (
|
|
2398
|
-
const
|
|
2399
|
-
clearTimeout(
|
|
2458
|
+
setup(d, { expose: l }) {
|
|
2459
|
+
const s = T([]);
|
|
2460
|
+
let n = 1;
|
|
2461
|
+
const o = () => {
|
|
2462
|
+
if (s.value.length >= 10) {
|
|
2463
|
+
const y = s.value[0];
|
|
2464
|
+
clearTimeout(y.timer), s.value.shift();
|
|
2400
2465
|
}
|
|
2401
|
-
const
|
|
2402
|
-
id:
|
|
2466
|
+
const r = {
|
|
2467
|
+
id: n++,
|
|
2403
2468
|
timer: setTimeout(() => {
|
|
2404
|
-
|
|
2469
|
+
h(r.id);
|
|
2405
2470
|
}, 1500)
|
|
2406
2471
|
};
|
|
2407
|
-
|
|
2408
|
-
},
|
|
2409
|
-
const
|
|
2410
|
-
if (
|
|
2411
|
-
const m =
|
|
2412
|
-
clearTimeout(m.timer),
|
|
2472
|
+
s.value.push(r);
|
|
2473
|
+
}, h = (r) => {
|
|
2474
|
+
const y = s.value.findIndex((m) => m.id === r);
|
|
2475
|
+
if (y !== -1) {
|
|
2476
|
+
const m = s.value[y];
|
|
2477
|
+
clearTimeout(m.timer), s.value.splice(y, 1);
|
|
2413
2478
|
}
|
|
2414
2479
|
};
|
|
2415
|
-
return
|
|
2416
|
-
addNotification:
|
|
2417
|
-
}),
|
|
2418
|
-
|
|
2419
|
-
clearTimeout(
|
|
2480
|
+
return l({
|
|
2481
|
+
addNotification: o
|
|
2482
|
+
}), Le(() => {
|
|
2483
|
+
s.value.forEach((r) => {
|
|
2484
|
+
clearTimeout(r.timer);
|
|
2420
2485
|
});
|
|
2421
|
-
}), (
|
|
2422
|
-
|
|
2486
|
+
}), (r, y) => (t(), S(Ne, { to: "body" }, [
|
|
2487
|
+
V(We, {
|
|
2423
2488
|
name: "notification",
|
|
2424
2489
|
tag: "div",
|
|
2425
2490
|
class: "fixed top-4 right-4 z-50 space-y-2"
|
|
2426
2491
|
}, {
|
|
2427
|
-
default:
|
|
2428
|
-
(
|
|
2492
|
+
default: Re(() => [
|
|
2493
|
+
(t(!0), a(j, null, A(s.value, (m) => (t(), a("div", {
|
|
2429
2494
|
key: m.id,
|
|
2430
2495
|
class: "bg-green-500 text-white px-4 py-3 rounded-lg shadow-lg flex items-center gap-3 min-w-64 max-w-sm"
|
|
2431
2496
|
}, [
|
|
2432
|
-
|
|
2433
|
-
|
|
2497
|
+
V(I(Qe), { class: "h-5 w-5 text-green-100 flex-shrink-0" }),
|
|
2498
|
+
y[0] || (y[0] = e("div", { class: "flex-1" }, [
|
|
2434
2499
|
e("p", { class: "font-medium text-sm" }, "Ссылка скопирована!"),
|
|
2435
2500
|
e("p", { class: "text-xs text-green-100 opacity-90" }, "Файл добавлен в буфер обмена")
|
|
2436
2501
|
], -1)),
|
|
2437
2502
|
e("button", {
|
|
2438
|
-
onClick: (
|
|
2503
|
+
onClick: (k) => h(m.id),
|
|
2439
2504
|
class: "text-green-100 hover:text-white transition-colors flex-shrink-0"
|
|
2440
2505
|
}, [
|
|
2441
|
-
|
|
2442
|
-
], 8,
|
|
2506
|
+
V(I(xe), { class: "h-4 w-4" })
|
|
2507
|
+
], 8, Ko)
|
|
2443
2508
|
]))), 128))
|
|
2444
2509
|
]),
|
|
2445
2510
|
_: 1
|
|
2446
2511
|
})
|
|
2447
2512
|
]));
|
|
2448
2513
|
}
|
|
2449
|
-
}),
|
|
2450
|
-
|
|
2451
|
-
d.component("vs-widget-file",
|
|
2514
|
+
}), Xo = /* @__PURE__ */ G(Jo, [["__scopeId", "data-v-55903525"]]);
|
|
2515
|
+
he.install = function(d) {
|
|
2516
|
+
d.component("vs-widget-file", ue), d.component("vs-widget-comments", de), d.component("vs-widget-history", ce), d.component("vs-widget-gallery", pe), d.component("vs-widget-map", me), d.component("vs-group-interface", ge), d.component("CommentsWidget", de), d.component("HistoryWidget", ce), d.component("GalleryWidget", pe), d.component("FilesWidget", ue), d.component("MapWidget", me), d.component("Card", he), d.component("CardItem", Fe), d.component("DescriptionListWidget", He), d.component("CopyNotification", Xo), d.component("GroupInterfaceWidget", ge);
|
|
2452
2517
|
};
|
|
2453
2518
|
export {
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2519
|
+
he as Card,
|
|
2520
|
+
Fe as CardItem,
|
|
2521
|
+
de as CommentsWidget,
|
|
2522
|
+
Xo as CopyNotification,
|
|
2523
|
+
He as DescriptionListWidget,
|
|
2524
|
+
ue as FilesWidget,
|
|
2525
|
+
pe as GalleryWidget,
|
|
2526
|
+
ge as GroupInterfaceWidget,
|
|
2527
|
+
ce as HistoryWidget,
|
|
2528
|
+
me as MapWidget,
|
|
2529
|
+
so as TableWidget,
|
|
2530
|
+
he as default
|
|
2466
2531
|
};
|