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