@opengis/widgets 0.0.13 → 0.0.15
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/components.d.ts.map +1 -1
- package/dist/composables/i18n.d.ts +3 -0
- package/dist/composables/i18n.d.ts.map +1 -0
- package/dist/composables/useLocale.d.ts +2 -0
- package/dist/composables/useLocale.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1188 -1003
- package/dist/index.umd.cjs +27 -32
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/widgets/card/Card.vue.d.ts +8 -8
- package/dist/widgets/card/Card.vue.d.ts.map +1 -1
- package/dist/widgets/card/CardItem.vue.d.ts +13 -9
- package/dist/widgets/card/CardItem.vue.d.ts.map +1 -1
- package/dist/widgets/gallery/GalleryContent.vue.d.ts +8 -0
- package/dist/widgets/gallery/GalleryContent.vue.d.ts.map +1 -0
- package/dist/widgets/gallery/GalleryWidget.vue.d.ts +16 -2
- package/dist/widgets/gallery/GalleryWidget.vue.d.ts.map +1 -1
- package/dist/widgets/gallery/{GalleryModal.vue.d.ts → widgetHeader.vue.d.ts} +5 -6
- package/dist/widgets/gallery/widgetHeader.vue.d.ts.map +1 -0
- package/dist/widgets/map/MapWidget.vue.d.ts.map +1 -1
- package/dist/widgets/table/TableWidget.vue.d.ts +4 -0
- package/dist/widgets/table/TableWidget.vue.d.ts.map +1 -0
- package/package.json +4 -4
- package/dist/widgets/gallery/GalleryModal.vue.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { h as
|
|
1
|
+
import { h as te, defineComponent as j, mergeModels as X, useModel as ae, ref as $, createElementBlock as i, openBlock as s, createElementVNode as t, createVNode as M, unref as w, withDirectives as R, vModelText as fe, createCommentVNode as b, createTextVNode as F, onMounted as re, onUnmounted as ye, resolveComponent as Q, normalizeClass as D, createBlock as A, toDisplayString as x, Fragment as I, renderList as E, normalizeStyle as Z, resolveDynamicComponent as B, withModifiers as U, computed as N, renderSlot as q, vModelRadio as Y, vModelCheckbox as Te, getCurrentInstance as De, createStaticVNode as Ie, mergeProps as K, vShow as je, Teleport as Ve, TransitionGroup as Ae, withCtx as ze } 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 pe = (a) => a.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), He = (a) => a.replace(
|
|
9
9
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
10
|
-
(
|
|
11
|
-
),
|
|
12
|
-
const
|
|
13
|
-
return
|
|
14
|
-
},
|
|
10
|
+
(l, o, e) => e ? e.toUpperCase() : o.toLowerCase()
|
|
11
|
+
), Ee = (a) => {
|
|
12
|
+
const l = He(a);
|
|
13
|
+
return l.charAt(0).toUpperCase() + l.slice(1);
|
|
14
|
+
}, Fe = (...a) => a.filter((l, o, e) => !!l && l.trim() !== "" && e.indexOf(l) === o).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 J = {
|
|
22
22
|
xmlns: "http://www.w3.org/2000/svg",
|
|
23
23
|
width: 24,
|
|
24
24
|
height: 24,
|
|
@@ -35,21 +35,21 @@ var Z = {
|
|
|
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 Se = ({ size: a, strokeWidth: l = 2, absoluteStrokeWidth: o, color: e, iconNode: n, name: g, class: d, ...y }, { slots: v }) => te(
|
|
39
39
|
"svg",
|
|
40
40
|
{
|
|
41
|
-
...
|
|
42
|
-
width:
|
|
43
|
-
height:
|
|
44
|
-
stroke:
|
|
45
|
-
"stroke-width":
|
|
46
|
-
class:
|
|
41
|
+
...J,
|
|
42
|
+
width: a || J.width,
|
|
43
|
+
height: a || J.height,
|
|
44
|
+
stroke: e || J.stroke,
|
|
45
|
+
"stroke-width": o ? Number(l) * 24 / Number(a) : l,
|
|
46
|
+
class: Fe(
|
|
47
47
|
"lucide",
|
|
48
|
-
...
|
|
48
|
+
...g ? [`lucide-${pe(Ee(g))}-icon`, `lucide-${pe(g)}`] : ["lucide-icon"]
|
|
49
49
|
),
|
|
50
|
-
...
|
|
50
|
+
...y
|
|
51
51
|
},
|
|
52
|
-
[...
|
|
52
|
+
[...n.map((p) => te(...p)), ...v.default ? [v.default()] : []]
|
|
53
53
|
);
|
|
54
54
|
/**
|
|
55
55
|
* @license lucide-vue-next v0.535.0 - ISC
|
|
@@ -57,14 +57,14 @@ const Fe = ({ size: l, strokeWidth: i = 2, absoluteStrokeWidth: n, 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 V = (a, l) => (o, { slots: e }) => te(
|
|
61
|
+
Se,
|
|
62
62
|
{
|
|
63
|
-
...
|
|
64
|
-
iconNode:
|
|
65
|
-
name:
|
|
63
|
+
...o,
|
|
64
|
+
iconNode: l,
|
|
65
|
+
name: a
|
|
66
66
|
},
|
|
67
|
-
|
|
67
|
+
e
|
|
68
68
|
);
|
|
69
69
|
/**
|
|
70
70
|
* @license lucide-vue-next v0.535.0 - ISC
|
|
@@ -72,7 +72,7 @@ const T = (l, i) => (n, { slots: t }) => Y(
|
|
|
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 Ne = V("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 He = T("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 Oe = V("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 Ae = T("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 Be = V("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 Se = T("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 ve = V("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 ce = T("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 Pe = V("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 Ee = T("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 G = V("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 q = T("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 Re = V("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 Oe = T("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 Ue = V("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 Be = T("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 We = V("heart", [
|
|
165
165
|
[
|
|
166
166
|
"path",
|
|
167
167
|
{
|
|
@@ -176,7 +176,7 @@ const Ne = T("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 qe = V("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 Re = T("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 me = V("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 ge = T("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 Ge = V("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 Ue = T("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 be = V("plus", [
|
|
216
216
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
217
217
|
["path", { d: "M12 5v14", key: "s699le" }]
|
|
218
218
|
]);
|
|
@@ -222,7 +222,7 @@ const Pe = T("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 Ke = V("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 We = T("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 xe =
|
|
235
|
+
const xe = V("send", [
|
|
236
236
|
[
|
|
237
237
|
"path",
|
|
238
238
|
{
|
|
@@ -248,18 +248,7 @@ const xe = T("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
|
|
252
|
-
["path", { d: "M12 2v13", key: "1km8f5" }],
|
|
253
|
-
["path", { d: "m16 6-4-4-4 4", key: "13yo43" }],
|
|
254
|
-
["path", { d: "M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8", key: "1b2hhj" }]
|
|
255
|
-
]);
|
|
256
|
-
/**
|
|
257
|
-
* @license lucide-vue-next v0.535.0 - ISC
|
|
258
|
-
*
|
|
259
|
-
* This source code is licensed under the ISC license.
|
|
260
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
-
*/
|
|
262
|
-
const qe = T("sheet", [
|
|
251
|
+
const Ze = V("sheet", [
|
|
263
252
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
|
|
264
253
|
["line", { x1: "3", x2: "21", y1: "9", y2: "9", key: "1vqk6q" }],
|
|
265
254
|
["line", { x1: "3", x2: "21", y1: "15", y2: "15", key: "o2sbyz" }],
|
|
@@ -272,7 +261,7 @@ const qe = T("sheet", [
|
|
|
272
261
|
* This source code is licensed under the ISC license.
|
|
273
262
|
* See the LICENSE file in the root directory of this source tree.
|
|
274
263
|
*/
|
|
275
|
-
const
|
|
264
|
+
const Je = V("square-pen", [
|
|
276
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" }],
|
|
277
266
|
[
|
|
278
267
|
"path",
|
|
@@ -288,7 +277,7 @@ const Ke = T("square-pen", [
|
|
|
288
277
|
* This source code is licensed under the ISC license.
|
|
289
278
|
* See the LICENSE file in the root directory of this source tree.
|
|
290
279
|
*/
|
|
291
|
-
const
|
|
280
|
+
const de = V("trash-2", [
|
|
292
281
|
["path", { d: "M10 11v6", key: "nco0om" }],
|
|
293
282
|
["path", { d: "M14 11v6", key: "outv1u" }],
|
|
294
283
|
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
@@ -301,7 +290,7 @@ const ue = T("trash-2", [
|
|
|
301
290
|
* This source code is licensed under the ISC license.
|
|
302
291
|
* See the LICENSE file in the root directory of this source tree.
|
|
303
292
|
*/
|
|
304
|
-
const
|
|
293
|
+
const Xe = V("user-check", [
|
|
305
294
|
["path", { d: "m16 11 2 2 4-4", key: "9rsbq5" }],
|
|
306
295
|
["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
|
|
307
296
|
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }]
|
|
@@ -312,7 +301,7 @@ const Ze = T("user-check", [
|
|
|
312
301
|
* This source code is licensed under the ISC license.
|
|
313
302
|
* See the LICENSE file in the root directory of this source tree.
|
|
314
303
|
*/
|
|
315
|
-
const
|
|
304
|
+
const ce = V("user", [
|
|
316
305
|
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
317
306
|
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
318
307
|
]);
|
|
@@ -322,7 +311,7 @@ const pe = T("user", [
|
|
|
322
311
|
* This source code is licensed under the ISC license.
|
|
323
312
|
* See the LICENSE file in the root directory of this source tree.
|
|
324
313
|
*/
|
|
325
|
-
const
|
|
314
|
+
const Qe = V("video", [
|
|
326
315
|
[
|
|
327
316
|
"path",
|
|
328
317
|
{
|
|
@@ -338,234 +327,234 @@ const Je = T("video", [
|
|
|
338
327
|
* This source code is licensed under the ISC license.
|
|
339
328
|
* See the LICENSE file in the root directory of this source tree.
|
|
340
329
|
*/
|
|
341
|
-
const
|
|
330
|
+
const ue = V("x", [
|
|
342
331
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
343
332
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
344
|
-
]),
|
|
333
|
+
]), Ye = { class: "border-t pt-3 mt-4" }, et = { class: "flex gap-2" }, tt = { class: "relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200" }, st = { class: "flex-1 space-y-2" }, ot = { class: "flex justify-between items-center" }, nt = { class: "flex gap-2" }, it = ["disabled"], ke = /* @__PURE__ */ j({
|
|
345
334
|
__name: "CommentInputZone",
|
|
346
335
|
props: {
|
|
347
336
|
isReply: { type: Boolean, required: !1, default: !1 },
|
|
348
337
|
isReplyModifiers: {}
|
|
349
338
|
},
|
|
350
|
-
emits: /* @__PURE__ */
|
|
351
|
-
setup(
|
|
352
|
-
const
|
|
353
|
-
|
|
354
|
-
},
|
|
355
|
-
(
|
|
339
|
+
emits: /* @__PURE__ */ X(["sendComment"], ["update:isReply"]),
|
|
340
|
+
setup(a, { emit: l }) {
|
|
341
|
+
const o = ae(a, "isReply"), e = $(""), n = l, g = () => {
|
|
342
|
+
e.value.trim() && (n("sendComment", e.value), e.value = "");
|
|
343
|
+
}, d = (y) => {
|
|
344
|
+
(y.ctrlKey || y.metaKey) && y.key === "Enter" && (y.preventDefault(), g());
|
|
356
345
|
};
|
|
357
|
-
return (
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
w(
|
|
346
|
+
return (y, v) => (s(), i("div", Ye, [
|
|
347
|
+
t("div", et, [
|
|
348
|
+
t("span", tt, [
|
|
349
|
+
M(w(ce), { class: "h-3 w-3 text-gray-500" })
|
|
361
350
|
]),
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
"onUpdate:modelValue": v[0] || (v[0] = (
|
|
365
|
-
onKeydown:
|
|
351
|
+
t("div", st, [
|
|
352
|
+
R(t("textarea", {
|
|
353
|
+
"onUpdate:modelValue": v[0] || (v[0] = (p) => e.value = p),
|
|
354
|
+
onKeydown: d,
|
|
366
355
|
placeholder: "Add a comment...",
|
|
367
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"
|
|
368
357
|
}, null, 544), [
|
|
369
|
-
[
|
|
358
|
+
[fe, e.value]
|
|
370
359
|
]),
|
|
371
|
-
|
|
372
|
-
v[4] || (v[4] =
|
|
373
|
-
|
|
374
|
-
|
|
360
|
+
t("div", ot, [
|
|
361
|
+
v[4] || (v[4] = t("span", { class: "text-xs text-gray-500 hidden sm:inline" }, "Cmd+Enter to send", -1)),
|
|
362
|
+
t("div", nt, [
|
|
363
|
+
o.value ? (s(), i("button", {
|
|
375
364
|
key: 0,
|
|
376
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",
|
|
377
|
-
onClick: v[1] || (v[1] = (
|
|
366
|
+
onClick: v[1] || (v[1] = (p) => o.value = !1)
|
|
378
367
|
}, [
|
|
379
|
-
w(
|
|
380
|
-
v[2] || (v[2] =
|
|
381
|
-
])) :
|
|
382
|
-
|
|
368
|
+
M(w(ue), { class: "h-3 w-3" }),
|
|
369
|
+
v[2] || (v[2] = F(" Cancel ", -1))
|
|
370
|
+
])) : b("", !0),
|
|
371
|
+
t("button", {
|
|
383
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",
|
|
384
|
-
disabled: !
|
|
385
|
-
onClick:
|
|
373
|
+
disabled: !e.value.trim(),
|
|
374
|
+
onClick: g
|
|
386
375
|
}, [
|
|
387
|
-
w(
|
|
388
|
-
v[3] || (v[3] =
|
|
389
|
-
], 8,
|
|
376
|
+
M(w(xe), { class: "h-3 w-3 mr-1" }),
|
|
377
|
+
v[3] || (v[3] = F(" Send ", -1))
|
|
378
|
+
], 8, it)
|
|
390
379
|
])
|
|
391
380
|
])
|
|
392
381
|
])
|
|
393
382
|
])
|
|
394
383
|
]));
|
|
395
384
|
}
|
|
396
|
-
}),
|
|
385
|
+
}), lt = { 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" }, at = /* @__PURE__ */ j({
|
|
397
386
|
__name: "CommentDetails",
|
|
398
387
|
props: {
|
|
399
388
|
showMoreOptions: { type: Boolean, required: !0, default: !1 },
|
|
400
389
|
showMoreOptionsModifiers: {}
|
|
401
390
|
},
|
|
402
|
-
emits: /* @__PURE__ */
|
|
403
|
-
setup(
|
|
404
|
-
const
|
|
405
|
-
|
|
406
|
-
},
|
|
407
|
-
|
|
391
|
+
emits: /* @__PURE__ */ X(["edit", "delete"], ["update:showMoreOptions"]),
|
|
392
|
+
setup(a, { emit: l }) {
|
|
393
|
+
const o = l, e = ae(a, "showMoreOptions"), n = $(), g = $(!0), d = async (p) => {
|
|
394
|
+
e.value && n.value && !n.value.contains(p.target) && !g.value && (e.value = !1), g.value = !1;
|
|
395
|
+
}, y = () => {
|
|
396
|
+
e.value = !1, o("edit");
|
|
408
397
|
}, v = () => {
|
|
409
|
-
|
|
398
|
+
e.value = !1, o("delete");
|
|
410
399
|
};
|
|
411
400
|
return re(() => {
|
|
412
|
-
document.addEventListener("click",
|
|
413
|
-
}),
|
|
414
|
-
document.removeEventListener("click",
|
|
415
|
-
}), (
|
|
401
|
+
document.addEventListener("click", d);
|
|
402
|
+
}), ye(() => {
|
|
403
|
+
document.removeEventListener("click", d);
|
|
404
|
+
}), (p, r) => (s(), i("div", {
|
|
416
405
|
class: "absolute bg-white left-0 top-full transform min-w-max z-50",
|
|
417
406
|
ref_key: "moreOptionsRef",
|
|
418
|
-
ref:
|
|
407
|
+
ref: n
|
|
419
408
|
}, [
|
|
420
|
-
|
|
421
|
-
|
|
409
|
+
t("div", lt, [
|
|
410
|
+
t("div", {
|
|
422
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",
|
|
423
|
-
onClick:
|
|
412
|
+
onClick: y
|
|
424
413
|
}, [
|
|
425
|
-
w(
|
|
426
|
-
|
|
414
|
+
M(w(Je), { class: "h-3 w-3 mr-2" }),
|
|
415
|
+
r[0] || (r[0] = F(" Edit ", -1))
|
|
427
416
|
]),
|
|
428
|
-
|
|
417
|
+
t("div", {
|
|
429
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",
|
|
430
419
|
onClick: v
|
|
431
420
|
}, [
|
|
432
|
-
w(
|
|
433
|
-
|
|
421
|
+
M(w(de), { class: "h-3 w-3 mr-2" }),
|
|
422
|
+
r[1] || (r[1] = F(" Delete ", -1))
|
|
434
423
|
])
|
|
435
424
|
])
|
|
436
425
|
], 512));
|
|
437
426
|
}
|
|
438
|
-
}),
|
|
427
|
+
}), rt = { class: "space-y-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 min-w-0 space-y-1 relative" }, ut = { class: "flex items-center gap-2" }, pt = { class: "font-medium text-xs" }, mt = { class: "text-xs text-gray-500" }, gt = {
|
|
439
428
|
key: 0,
|
|
440
429
|
class: "text-xs text-gray-700 leading-relaxed"
|
|
441
|
-
},
|
|
430
|
+
}, ht = { class: "flex justify-between text-xs" }, ft = { class: "flex items-center gap-2" }, yt = {
|
|
442
431
|
key: 0,
|
|
443
432
|
class: "flex gap-2"
|
|
444
|
-
},
|
|
433
|
+
}, vt = ["disabled"], bt = {
|
|
445
434
|
key: 0,
|
|
446
435
|
class: "ml-8 space-y-1 border-l-2 border-gray-100 pl-3"
|
|
447
|
-
},
|
|
436
|
+
}, xt = /* @__PURE__ */ j({
|
|
448
437
|
__name: "CommentItem",
|
|
449
438
|
props: {
|
|
450
439
|
comment: {},
|
|
451
440
|
isInside: { type: Boolean }
|
|
452
441
|
},
|
|
453
442
|
emits: ["like", "reply", "edit", "delete"],
|
|
454
|
-
setup(
|
|
455
|
-
const
|
|
456
|
-
const
|
|
457
|
-
(
|
|
443
|
+
setup(a, { emit: l }) {
|
|
444
|
+
const o = l, e = a, n = $(e.comment.text), g = $("w-full p-2 rounded text-xs resize-none bg-transparent outline-none"), d = $("w-full min-h-[60px] p-2 border border-gray-200 rounded text-xs resize-none focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent"), y = $(!1), v = $(!1), p = $(!1), r = $(!1), f = (c) => {
|
|
445
|
+
const u = /* @__PURE__ */ new Date(), T = Math.floor(
|
|
446
|
+
(u.getTime() - c.getTime()) / (1e3 * 60 * 60)
|
|
458
447
|
);
|
|
459
|
-
return
|
|
460
|
-
(
|
|
461
|
-
)}m` :
|
|
462
|
-
},
|
|
463
|
-
|
|
464
|
-
},
|
|
465
|
-
|
|
466
|
-
},
|
|
467
|
-
|
|
468
|
-
},
|
|
469
|
-
|
|
448
|
+
return T < 1 ? `${Math.floor(
|
|
449
|
+
(u.getTime() - c.getTime()) / 6e4
|
|
450
|
+
)}m` : T < 24 ? `${T}h` : `${Math.floor(T / 24)}d`;
|
|
451
|
+
}, m = () => {
|
|
452
|
+
r.value = !r.value, r.value ? o("like", e.comment.id, "add") : o("like", e.comment.id, "delete");
|
|
453
|
+
}, C = () => {
|
|
454
|
+
o("edit", e.comment.id, n.value), p.value = !1;
|
|
455
|
+
}, O = (c, u) => {
|
|
456
|
+
o("like", c, u);
|
|
457
|
+
}, z = (c, u) => {
|
|
458
|
+
o("edit", c, u);
|
|
470
459
|
};
|
|
471
|
-
return (c,
|
|
472
|
-
const
|
|
473
|
-
return
|
|
474
|
-
|
|
475
|
-
class: D(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative",
|
|
460
|
+
return (c, u) => {
|
|
461
|
+
const T = Q("CommentItem", !0);
|
|
462
|
+
return s(), i("div", rt, [
|
|
463
|
+
t("div", {
|
|
464
|
+
class: D(["group flex gap-2 p-2 rounded hover:bg-gray-50 transition-colors relative", p.value ? "bg-gray-50" : ""])
|
|
476
465
|
}, [
|
|
477
|
-
|
|
478
|
-
w(
|
|
466
|
+
t("span", dt, [
|
|
467
|
+
M(w(ce), { class: "h-3 w-3 text-gray-500" })
|
|
479
468
|
]),
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
469
|
+
t("div", ct, [
|
|
470
|
+
t("div", ut, [
|
|
471
|
+
t("span", pt, x(c.comment?.author), 1),
|
|
472
|
+
t("span", mt, x(f(c.comment?.createdAt)), 1)
|
|
484
473
|
]),
|
|
485
|
-
|
|
474
|
+
p.value ? R((s(), i("textarea", {
|
|
486
475
|
key: 1,
|
|
487
|
-
"onUpdate:modelValue":
|
|
488
|
-
class: D(
|
|
476
|
+
"onUpdate:modelValue": u[0] || (u[0] = (k) => n.value = k),
|
|
477
|
+
class: D(p.value ? d.value : g.value)
|
|
489
478
|
}, null, 2)), [
|
|
490
|
-
[
|
|
491
|
-
]) : (
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
class: D(["flex items-center gap-1",
|
|
496
|
-
onClick:
|
|
479
|
+
[fe, n.value]
|
|
480
|
+
]) : (s(), i("p", gt, x(c.comment?.text), 1)),
|
|
481
|
+
t("div", ht, [
|
|
482
|
+
t("div", ft, [
|
|
483
|
+
t("button", {
|
|
484
|
+
class: D(["flex items-center gap-1", r.value ? "text-blue-600" : "text-gray-500 hover:text-blue-600 transition-colors"]),
|
|
485
|
+
onClick: u[1] || (u[1] = (k) => m())
|
|
497
486
|
}, [
|
|
498
|
-
w(
|
|
499
|
-
class: D(["h-3 w-3",
|
|
487
|
+
M(w(We), {
|
|
488
|
+
class: D(["h-3 w-3", r.value ? "fill-blue-600" : ""])
|
|
500
489
|
}, null, 8, ["class"]),
|
|
501
|
-
|
|
490
|
+
F(" " + x(c.comment?.likes), 1)
|
|
502
491
|
], 2),
|
|
503
|
-
c.isInside ?
|
|
492
|
+
c.isInside ? b("", !0) : (s(), i("button", {
|
|
504
493
|
key: 0,
|
|
505
494
|
class: "text-gray-500 hover:text-blue-600 transition-colors",
|
|
506
|
-
onClick:
|
|
495
|
+
onClick: u[2] || (u[2] = (k) => v.value = !0)
|
|
507
496
|
}, [
|
|
508
|
-
w(
|
|
497
|
+
M(w(Ke), { class: "h-3 w-3" })
|
|
509
498
|
])),
|
|
510
|
-
|
|
499
|
+
t("button", {
|
|
511
500
|
class: "text-gray-400 hover:text-gray-600 transition-colors opacity-0 group-hover:opacity-100",
|
|
512
501
|
type: "button",
|
|
513
|
-
onClick:
|
|
502
|
+
onClick: u[3] || (u[3] = (k) => y.value = !0)
|
|
514
503
|
}, [
|
|
515
|
-
w(
|
|
504
|
+
M(w(Pe), { class: "h-3 w-3" })
|
|
516
505
|
])
|
|
517
506
|
]),
|
|
518
|
-
|
|
519
|
-
|
|
507
|
+
p.value ? (s(), i("div", yt, [
|
|
508
|
+
t("button", {
|
|
520
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",
|
|
521
|
-
onClick:
|
|
510
|
+
onClick: u[4] || (u[4] = (k) => p.value = !1)
|
|
522
511
|
}, [
|
|
523
|
-
w(
|
|
524
|
-
|
|
512
|
+
M(w(ue), { class: "h-3 w-3" }),
|
|
513
|
+
u[11] || (u[11] = F(" Cancel ", -1))
|
|
525
514
|
]),
|
|
526
|
-
|
|
515
|
+
t("button", {
|
|
527
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",
|
|
528
|
-
disabled: !
|
|
529
|
-
onClick:
|
|
517
|
+
disabled: !n.value.trim(),
|
|
518
|
+
onClick: u[5] || (u[5] = (k) => C())
|
|
530
519
|
}, [
|
|
531
|
-
w(
|
|
532
|
-
|
|
533
|
-
], 8,
|
|
534
|
-
])) :
|
|
520
|
+
M(w(xe), { class: "h-3 w-3 mr-1" }),
|
|
521
|
+
u[12] || (u[12] = F(" Send ", -1))
|
|
522
|
+
], 8, vt)
|
|
523
|
+
])) : b("", !0)
|
|
535
524
|
])
|
|
536
525
|
]),
|
|
537
|
-
|
|
526
|
+
y.value ? (s(), A(at, {
|
|
538
527
|
key: 0,
|
|
539
|
-
showMoreOptions:
|
|
540
|
-
"onUpdate:showMoreOptions":
|
|
541
|
-
onEdit:
|
|
542
|
-
onDelete:
|
|
528
|
+
showMoreOptions: y.value,
|
|
529
|
+
"onUpdate:showMoreOptions": u[6] || (u[6] = (k) => y.value = k),
|
|
530
|
+
onEdit: u[7] || (u[7] = (k) => p.value = !0),
|
|
531
|
+
onDelete: u[8] || (u[8] = (k) => c.$emit("delete", c.comment?.id)),
|
|
543
532
|
comment: c.comment
|
|
544
|
-
}, null, 8, ["showMoreOptions", "comment"])) :
|
|
533
|
+
}, null, 8, ["showMoreOptions", "comment"])) : b("", !0)
|
|
545
534
|
], 2),
|
|
546
|
-
c.isInside ?
|
|
547
|
-
(
|
|
548
|
-
key:
|
|
549
|
-
comment:
|
|
535
|
+
c.isInside ? b("", !0) : (s(), i("div", bt, [
|
|
536
|
+
(s(!0), i(I, null, E(c.comment?.replies, (k) => (s(), A(T, {
|
|
537
|
+
key: k.id,
|
|
538
|
+
comment: k,
|
|
550
539
|
isInside: !0,
|
|
551
|
-
onDelete: (
|
|
552
|
-
onLike:
|
|
553
|
-
onEdit:
|
|
540
|
+
onDelete: (_) => c.$emit("delete", k.id),
|
|
541
|
+
onLike: O,
|
|
542
|
+
onEdit: z
|
|
554
543
|
}, null, 8, ["comment", "onDelete"]))), 128)),
|
|
555
|
-
v.value && !c.isInside ? (
|
|
544
|
+
v.value && !c.isInside ? (s(), A(ke, {
|
|
556
545
|
key: 0,
|
|
557
|
-
onSendComment:
|
|
546
|
+
onSendComment: u[9] || (u[9] = (k) => c.$emit("reply", c.comment?.id, k)),
|
|
558
547
|
isReply: v.value,
|
|
559
|
-
"onUpdate:isReply":
|
|
560
|
-
}, null, 8, ["isReply"])) :
|
|
548
|
+
"onUpdate:isReply": u[10] || (u[10] = (k) => v.value = k)
|
|
549
|
+
}, null, 8, ["isReply"])) : b("", !0)
|
|
561
550
|
]))
|
|
562
551
|
]);
|
|
563
552
|
};
|
|
564
553
|
}
|
|
565
|
-
}),
|
|
554
|
+
}), kt = ["id"], _t = {
|
|
566
555
|
key: 0,
|
|
567
556
|
class: "text-xl font-semibold text-gray-900 mb-4"
|
|
568
|
-
}, se = /* @__PURE__ */
|
|
557
|
+
}, se = /* @__PURE__ */ j({
|
|
569
558
|
__name: "CommentsWidget",
|
|
570
559
|
props: {
|
|
571
560
|
title: {},
|
|
@@ -581,79 +570,79 @@ const X = T("x", [
|
|
|
581
570
|
style: {}
|
|
582
571
|
},
|
|
583
572
|
emits: ["add", "reply", "like", "delete", "edit"],
|
|
584
|
-
setup(
|
|
585
|
-
const
|
|
586
|
-
|
|
587
|
-
},
|
|
588
|
-
|
|
589
|
-
},
|
|
590
|
-
|
|
591
|
-
},
|
|
592
|
-
|
|
593
|
-
}, v = (
|
|
594
|
-
|
|
573
|
+
setup(a, { emit: l }) {
|
|
574
|
+
const o = a, e = l, n = (p) => {
|
|
575
|
+
o?.onAddComment?.(p), e("add", p);
|
|
576
|
+
}, g = (p, r) => {
|
|
577
|
+
o?.onLike?.(p, r), e("like", p, r);
|
|
578
|
+
}, d = (p, r) => {
|
|
579
|
+
o.onReply?.(p, r), e("reply", p, r);
|
|
580
|
+
}, y = (p, r) => {
|
|
581
|
+
o.onEdit?.(p, r), e("edit", p, r);
|
|
582
|
+
}, v = (p) => {
|
|
583
|
+
o.onDelete?.(p), e("delete", p);
|
|
595
584
|
};
|
|
596
|
-
return (
|
|
597
|
-
class: D(["mx-auto font-sans",
|
|
598
|
-
id:
|
|
599
|
-
style:
|
|
585
|
+
return (p, r) => (s(), i("div", {
|
|
586
|
+
class: D(["mx-auto font-sans", p.className]),
|
|
587
|
+
id: p.id,
|
|
588
|
+
style: Z(p.style)
|
|
600
589
|
}, [
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
class: D([
|
|
604
|
-
style:
|
|
590
|
+
p.title ? (s(), i("h3", _t, x(p.title), 1)) : b("", !0),
|
|
591
|
+
t("div", {
|
|
592
|
+
class: D([p.maxHeight ? "overflow-y-auto" : "", "space-y-3"]),
|
|
593
|
+
style: Z({ maxHeight: p.maxHeight + "px" })
|
|
605
594
|
}, [
|
|
606
|
-
(
|
|
607
|
-
key:
|
|
608
|
-
comment:
|
|
609
|
-
onReply:
|
|
610
|
-
onLike:
|
|
611
|
-
onDelete:
|
|
612
|
-
onEdit:
|
|
595
|
+
(s(!0), i(I, null, E(p.comments, (f) => (s(), A(xt, {
|
|
596
|
+
key: f.id,
|
|
597
|
+
comment: f,
|
|
598
|
+
onReply: d,
|
|
599
|
+
onLike: g,
|
|
600
|
+
onDelete: r[0] || (r[0] = (m) => v(m)),
|
|
601
|
+
onEdit: y
|
|
613
602
|
}, null, 8, ["comment"]))), 128))
|
|
614
603
|
], 6),
|
|
615
|
-
|
|
616
|
-
onSendComment:
|
|
604
|
+
M(ke, {
|
|
605
|
+
onSendComment: r[1] || (r[1] = (f) => n(f))
|
|
617
606
|
})
|
|
618
|
-
], 14,
|
|
607
|
+
], 14, kt));
|
|
619
608
|
}
|
|
620
|
-
}),
|
|
609
|
+
}), ge = /* @__PURE__ */ new Map([
|
|
621
610
|
["file", {
|
|
622
611
|
name: "File",
|
|
623
612
|
color: "bg-green-100 text-green-700 border-green-200",
|
|
624
|
-
icon:
|
|
613
|
+
icon: G
|
|
625
614
|
}],
|
|
626
615
|
["post", {
|
|
627
616
|
name: "Post",
|
|
628
617
|
color: "bg-blue-100 text-blue-700 border-blue-200",
|
|
629
|
-
icon:
|
|
618
|
+
icon: Ze
|
|
630
619
|
}],
|
|
631
620
|
["user", {
|
|
632
621
|
name: "User",
|
|
633
622
|
color: "bg-purple-100 text-purple-700 border-purple-200",
|
|
634
|
-
icon:
|
|
623
|
+
icon: Xe
|
|
635
624
|
}],
|
|
636
625
|
["custom", {
|
|
637
626
|
name: "Custom",
|
|
638
627
|
color: "bg-gray-100 text-gray-700 border-gray-200",
|
|
639
|
-
icon:
|
|
628
|
+
icon: qe
|
|
640
629
|
}]
|
|
641
|
-
]),
|
|
630
|
+
]), wt = { class: "mx-auto font-sans" }, $t = {
|
|
642
631
|
key: 0,
|
|
643
632
|
class: "text-xl font-semibold text-gray-900 mb-4"
|
|
644
|
-
},
|
|
633
|
+
}, Ct = { class: "relative" }, Mt = { class: "space-y-3" }, Lt = { class: "flex-1 min-w-0 pb-2" }, Tt = { class: "flex items-center gap-1.5 mb-1 mt-0.5" }, Dt = { class: "relative flex items-center justify-center shrink-0 overflow-hidden rounded-full h-5 w-5 bg-gray-200" }, It = { class: "font-medium text-xs" }, jt = { class: "text-xs text-gray-500" }, Vt = { class: "space-y-1" }, At = { class: "text-xs text-gray-700" }, zt = { class: "capitalize mr-1" }, Ht = {
|
|
645
634
|
key: 0,
|
|
646
635
|
class: "inline-flex items-center rounded-full border py-0.5 font-semibold transition-colors text-foreground text-xs h-4 px-1 capitalize"
|
|
647
|
-
},
|
|
636
|
+
}, Et = {
|
|
648
637
|
key: 0,
|
|
649
638
|
class: "flex items-center gap-1 text-xs"
|
|
650
|
-
},
|
|
639
|
+
}, Ft = {
|
|
651
640
|
key: 0,
|
|
652
641
|
class: "bg-red-50 text-red-600 px-1.5 py-0.5 rounded text-xs border border-red-200"
|
|
653
|
-
},
|
|
642
|
+
}, St = {
|
|
654
643
|
key: 2,
|
|
655
644
|
class: "bg-green-50 text-green-600 px-1.5 py-0.5 rounded text-xs border border-green-200"
|
|
656
|
-
}, oe = /* @__PURE__ */
|
|
645
|
+
}, oe = /* @__PURE__ */ j({
|
|
657
646
|
__name: "HistoryWidget",
|
|
658
647
|
props: {
|
|
659
648
|
data: {},
|
|
@@ -663,57 +652,57 @@ const X = T("x", [
|
|
|
663
652
|
className: {},
|
|
664
653
|
style: {}
|
|
665
654
|
},
|
|
666
|
-
setup(
|
|
667
|
-
const
|
|
668
|
-
|
|
669
|
-
async function
|
|
670
|
-
const
|
|
671
|
-
if (!
|
|
655
|
+
setup(a) {
|
|
656
|
+
const l = a, o = $(Array.isArray(l.data) ? l.data : []);
|
|
657
|
+
o.value.length === 0 && l.id && e();
|
|
658
|
+
async function e() {
|
|
659
|
+
const n = await fetch(`/api/widget/history/${l.id}`);
|
|
660
|
+
if (!n.ok)
|
|
672
661
|
return { data: [] };
|
|
673
|
-
const
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
}),
|
|
662
|
+
const g = await n.json();
|
|
663
|
+
g.rows.forEach((d) => {
|
|
664
|
+
d.timestamp = new Date(d.cdate), d.id = d.entity_id, d.entityType = d.entity_type, d.entityId = d.entity_id, 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;
|
|
665
|
+
}), o.value = g.rows;
|
|
677
666
|
}
|
|
678
|
-
return (
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
class: D(
|
|
682
|
-
style:
|
|
667
|
+
return (n, g) => (s(), i("div", wt, [
|
|
668
|
+
n.title ? (s(), i("h3", $t, x(n.title), 1)) : b("", !0),
|
|
669
|
+
t("div", {
|
|
670
|
+
class: D(n.maxHeight ? "overflow-y-auto" : ""),
|
|
671
|
+
style: Z({ maxHeight: n.maxHeight + "px" })
|
|
683
672
|
}, [
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
(
|
|
673
|
+
t("div", Ct, [
|
|
674
|
+
g[0] || (g[0] = t("div", { class: "absolute left-3 top-0 bottom-0 w-0.5 bg-gray-200" }, null, -1)),
|
|
675
|
+
t("div", Mt, [
|
|
676
|
+
(s(!0), i(I, null, E(o.value, (d) => (s(), i("div", {
|
|
688
677
|
class: "relative flex items-start gap-2",
|
|
689
|
-
key:
|
|
678
|
+
key: d?.id
|
|
690
679
|
}, [
|
|
691
|
-
|
|
692
|
-
class: D(`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center border bg-white relative z-10 ${
|
|
680
|
+
t("div", {
|
|
681
|
+
class: D(`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center border bg-white relative z-10 ${w(ge).get(d?.entityType)?.color}`)
|
|
693
682
|
}, [
|
|
694
|
-
(
|
|
683
|
+
(s(), A(B(w(ge).get(d?.entityType)?.icon), { class: "h-3 w-3" }))
|
|
695
684
|
], 2),
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
w(
|
|
685
|
+
t("div", Lt, [
|
|
686
|
+
t("div", Tt, [
|
|
687
|
+
t("span", Dt, [
|
|
688
|
+
M(w(ce), { class: "h-3 w-3 text-gray-500" })
|
|
700
689
|
]),
|
|
701
|
-
|
|
702
|
-
|
|
690
|
+
t("span", It, x(d?.userName), 1),
|
|
691
|
+
t("span", jt, x(d?.timestamp.toLocaleTimeString("ua-UA", { hour: "2-digit", minute: "2-digit" })), 1)
|
|
703
692
|
]),
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
693
|
+
t("div", Vt, [
|
|
694
|
+
t("div", At, [
|
|
695
|
+
t("span", zt, x(d?.action), 1),
|
|
696
|
+
d?.entityId ? (s(), i("span", Ht, x(d?.entityId), 1)) : b("", !0)
|
|
708
697
|
]),
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
698
|
+
d?.changes?.[d?.entityId] ? (s(), i("div", Et, [
|
|
699
|
+
d?.changes?.[d?.entityId]?.old ? (s(), i("span", Ft, x(d?.changes?.[d?.entityId]?.old), 1)) : b("", !0),
|
|
700
|
+
d?.changes?.[d?.entityId]?.old && d?.changes?.[d?.entityId]?.new ? (s(), A(w(Oe), {
|
|
712
701
|
key: 1,
|
|
713
702
|
class: "h-2 w-2 text-gray-400"
|
|
714
|
-
})) :
|
|
715
|
-
|
|
716
|
-
])) :
|
|
703
|
+
})) : b("", !0),
|
|
704
|
+
d?.changes?.[d?.entityId]?.new ? (s(), i("span", St, x(d?.changes?.[d?.entityId]?.new), 1)) : b("", !0)
|
|
705
|
+
])) : b("", !0)
|
|
717
706
|
])
|
|
718
707
|
])
|
|
719
708
|
]))), 128))
|
|
@@ -722,209 +711,209 @@ const X = T("x", [
|
|
|
722
711
|
], 6)
|
|
723
712
|
]));
|
|
724
713
|
}
|
|
725
|
-
}),
|
|
714
|
+
}), Nt = {
|
|
726
715
|
key: 0,
|
|
727
716
|
class: "text-xl font-semibold"
|
|
728
|
-
},
|
|
717
|
+
}, Ot = { class: "flex gap-1" }, Bt = { 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" }, Pt = /* @__PURE__ */ j({
|
|
729
718
|
__name: "FileHeader",
|
|
730
|
-
props: /* @__PURE__ */
|
|
719
|
+
props: /* @__PURE__ */ X({
|
|
731
720
|
title: {}
|
|
732
721
|
}, {
|
|
733
722
|
modelValue: {},
|
|
734
723
|
modelModifiers: {}
|
|
735
724
|
}),
|
|
736
|
-
emits: /* @__PURE__ */
|
|
737
|
-
setup(
|
|
738
|
-
const
|
|
725
|
+
emits: /* @__PURE__ */ X(["onAddFile"], ["update:modelValue"]),
|
|
726
|
+
setup(a) {
|
|
727
|
+
const l = ae(a, "modelValue"), o = {
|
|
739
728
|
active: "bg-blue-100 text-black hover:bg-blue-100",
|
|
740
729
|
inactive: "bg-white text-black hover:bg-blue-100"
|
|
741
730
|
};
|
|
742
|
-
return (
|
|
743
|
-
class: D(["flex flex-col sm:flex-row gap-3 mb-4",
|
|
731
|
+
return (e, n) => (s(), i("div", {
|
|
732
|
+
class: D(["flex flex-col sm:flex-row gap-3 mb-4", e.title ? "justify-between sm:items-center" : "justify-end sm:items-center"])
|
|
744
733
|
}, [
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
class: D(["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",
|
|
749
|
-
onClick:
|
|
734
|
+
e.title ? (s(), i("h3", Nt, x(e.title), 1)) : b("", !0),
|
|
735
|
+
t("div", Ot, [
|
|
736
|
+
t("button", {
|
|
737
|
+
class: D(["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" ? o.active : o.inactive]),
|
|
738
|
+
onClick: n[0] || (n[0] = (g) => l.value = "list")
|
|
750
739
|
}, [
|
|
751
|
-
w(
|
|
740
|
+
M(w(Ge), { class: "h-4 w-4" })
|
|
752
741
|
], 2),
|
|
753
|
-
|
|
754
|
-
class: D(["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",
|
|
755
|
-
onClick:
|
|
742
|
+
t("button", {
|
|
743
|
+
class: D(["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" ? o.active : o.inactive]),
|
|
744
|
+
onClick: n[1] || (n[1] = (g) => l.value = "grid")
|
|
756
745
|
}, [
|
|
757
|
-
w(
|
|
746
|
+
M(w(Ue), { class: "h-4 w-4" })
|
|
758
747
|
], 2),
|
|
759
|
-
|
|
760
|
-
|
|
748
|
+
t("label", null, [
|
|
749
|
+
t("input", {
|
|
761
750
|
type: "file",
|
|
762
751
|
class: "hidden",
|
|
763
|
-
onChange:
|
|
752
|
+
onChange: n[2] || (n[2] = (g) => e.$emit("onAddFile", g))
|
|
764
753
|
}, null, 32),
|
|
765
|
-
|
|
766
|
-
w(
|
|
767
|
-
|
|
754
|
+
t("div", Bt, [
|
|
755
|
+
M(w(be), { class: "h-4 w-4" }),
|
|
756
|
+
n[3] || (n[3] = F(" Додати файл ", -1))
|
|
768
757
|
])
|
|
769
758
|
])
|
|
770
759
|
])
|
|
771
760
|
], 2));
|
|
772
761
|
}
|
|
773
|
-
}),
|
|
762
|
+
}), ee = {
|
|
774
763
|
pdf: {
|
|
775
764
|
color: "bg-red-100 text-red-700 border-red-200",
|
|
776
|
-
icon:
|
|
765
|
+
icon: G,
|
|
777
766
|
label: "PDF"
|
|
778
767
|
},
|
|
779
768
|
sketch: {
|
|
780
769
|
color: "bg-gray-100 text-gray-700 border-gray-200",
|
|
781
|
-
icon:
|
|
770
|
+
icon: Re,
|
|
782
771
|
label: "SKETCH"
|
|
783
772
|
},
|
|
784
773
|
mp4: {
|
|
785
774
|
color: "bg-purple-100 text-purple-700 border-purple-200",
|
|
786
|
-
icon:
|
|
775
|
+
icon: Qe,
|
|
787
776
|
label: "VIDEO"
|
|
788
777
|
},
|
|
789
778
|
docx: {
|
|
790
779
|
color: "bg-blue-100 text-blue-700 border-blue-200",
|
|
791
|
-
icon:
|
|
780
|
+
icon: G,
|
|
792
781
|
label: "DOC"
|
|
793
782
|
},
|
|
794
783
|
zip: {
|
|
795
784
|
color: "bg-orange-100 text-orange-700 border-orange-200",
|
|
796
|
-
icon:
|
|
785
|
+
icon: Ne,
|
|
797
786
|
label: "ARCHIVE"
|
|
798
787
|
},
|
|
799
788
|
png: {
|
|
800
789
|
color: "bg-green-100 text-green-700 border-green-200",
|
|
801
|
-
icon:
|
|
790
|
+
icon: me,
|
|
802
791
|
label: "IMAGE"
|
|
803
792
|
},
|
|
804
793
|
jpg: {
|
|
805
794
|
color: "bg-green-100 text-green-700 border-green-200",
|
|
806
|
-
icon:
|
|
795
|
+
icon: me,
|
|
807
796
|
label: "IMAGE"
|
|
808
797
|
},
|
|
809
798
|
xlsx: {
|
|
810
799
|
color: "bg-emerald-100 text-emerald-700 border-emerald-200",
|
|
811
|
-
icon:
|
|
800
|
+
icon: G,
|
|
812
801
|
label: "EXCEL"
|
|
813
802
|
},
|
|
814
803
|
pptx: {
|
|
815
804
|
color: "bg-amber-100 text-amber-700 border-amber-200",
|
|
816
|
-
icon:
|
|
805
|
+
icon: G,
|
|
817
806
|
label: "PPT"
|
|
818
807
|
}
|
|
819
808
|
};
|
|
820
|
-
function _e(
|
|
821
|
-
const
|
|
809
|
+
function _e(a, l = "en") {
|
|
810
|
+
const o = {
|
|
822
811
|
month: "short",
|
|
823
812
|
day: "numeric"
|
|
824
813
|
};
|
|
825
|
-
return new Intl.DateTimeFormat(
|
|
814
|
+
return new Intl.DateTimeFormat(l, o).format(a);
|
|
826
815
|
}
|
|
827
|
-
function we(
|
|
828
|
-
if (
|
|
829
|
-
const
|
|
830
|
-
return `${parseFloat((
|
|
816
|
+
function we(a) {
|
|
817
|
+
if (a === 0) return "0 B";
|
|
818
|
+
const l = 1024, o = ["B", "KB", "MB", "GB", "TB"], e = Math.floor(Math.log(a) / Math.log(l));
|
|
819
|
+
return `${parseFloat((a / Math.pow(l, e)).toFixed(1))} ${o[e]}`;
|
|
831
820
|
}
|
|
832
|
-
const
|
|
821
|
+
const Rt = { class: "space-y-0.5" }, Ut = ["onClick"], Wt = ["onClick"], qt = { class: "flex items-center gap-2" }, Gt = { class: "font-medium text-xs truncate hover:text-blue-600 cursor-pointer" }, Kt = { class: "hidden sm:block text-xs text-gray-500 w-16 text-right" }, Zt = { class: "hidden md:block text-xs text-gray-500 w-12 text-right" }, Jt = { class: "flex items-center gap-1" }, Xt = ["onClick"], Qt = ["onClick"], $e = /* @__PURE__ */ j({
|
|
833
822
|
__name: "FileList",
|
|
834
823
|
props: {
|
|
835
824
|
files: {}
|
|
836
825
|
},
|
|
837
826
|
emits: ["delete", "download", "openLightbox"],
|
|
838
|
-
setup(
|
|
839
|
-
return (
|
|
840
|
-
(
|
|
827
|
+
setup(a) {
|
|
828
|
+
return (l, o) => (s(), i("div", Rt, [
|
|
829
|
+
(s(!0), i(I, null, E(l.files, (e) => (s(), i("div", {
|
|
841
830
|
class: "flex items-center gap-2 p-1.5 rounded hover:bg-gray-50 group border-b border-gray-100 last:border-b-0",
|
|
842
|
-
key:
|
|
843
|
-
onClick:
|
|
831
|
+
key: e.id,
|
|
832
|
+
onClick: U((n) => l.$emit("openLightbox", e), ["stop"])
|
|
844
833
|
}, [
|
|
845
|
-
|
|
846
|
-
class: D(["p-1 rounded",
|
|
834
|
+
t("div", {
|
|
835
|
+
class: D(["p-1 rounded", w(ee)[e?.ext]?.color || "bg-blue-100 text-blue-700 border-blue-200"])
|
|
847
836
|
}, [
|
|
848
|
-
(
|
|
837
|
+
(s(), A(B(w(ee)[e?.ext]?.icon || w(ee).pdf.icon), { class: "h-3 w-3" }))
|
|
849
838
|
], 2),
|
|
850
|
-
|
|
839
|
+
t("div", {
|
|
851
840
|
class: "flex-1 min-w-0",
|
|
852
|
-
onClick: (
|
|
841
|
+
onClick: (n) => l.$emit("openLightbox", e)
|
|
853
842
|
}, [
|
|
854
|
-
|
|
855
|
-
|
|
843
|
+
t("div", qt, [
|
|
844
|
+
t("span", Gt, x(e?.uploaded_name || e?.name), 1)
|
|
856
845
|
])
|
|
857
|
-
], 8,
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
onClick:
|
|
846
|
+
], 8, Wt),
|
|
847
|
+
t("div", Kt, x(w(we)(e.size)), 1),
|
|
848
|
+
t("div", Zt, x(w(_e)(e.createdAt)), 1),
|
|
849
|
+
t("div", Jt, [
|
|
850
|
+
t("button", {
|
|
851
|
+
onClick: U((n) => l.$emit("download", e), ["stop"]),
|
|
863
852
|
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"
|
|
864
853
|
}, [
|
|
865
|
-
w(
|
|
866
|
-
], 8,
|
|
867
|
-
|
|
854
|
+
M(w(ve), { class: "h-3 w-3" })
|
|
855
|
+
], 8, Xt),
|
|
856
|
+
t("button", {
|
|
868
857
|
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",
|
|
869
|
-
onClick:
|
|
858
|
+
onClick: U((n) => l.$emit("delete", n, e?.file_id), ["stop"])
|
|
870
859
|
}, [
|
|
871
|
-
w(
|
|
872
|
-
], 8,
|
|
860
|
+
M(w(de), { class: "h-3 w-3" })
|
|
861
|
+
], 8, Qt)
|
|
873
862
|
])
|
|
874
|
-
], 8,
|
|
863
|
+
], 8, Ut))), 128))
|
|
875
864
|
]));
|
|
876
865
|
}
|
|
877
|
-
}),
|
|
866
|
+
}), Yt = { class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3" }, es = ["onClick"], ts = { class: "space-y-2" }, ss = { class: "flex justify-center items-center w-full aspect-[4/3] bg-gray-100 rounded overflow-hidden" }, os = ["src"], ns = { class: "space-y-1" }, is = ["title"], ls = { class: "text-xs text-gray-500 text-left" }, as = { class: "absolute top-2 right-1 flex items-center gap-1" }, rs = ["onClick"], ds = ["onClick"], cs = /* @__PURE__ */ j({
|
|
878
867
|
__name: "FileGrid",
|
|
879
868
|
props: {
|
|
880
869
|
files: {}
|
|
881
870
|
},
|
|
882
871
|
emits: ["delete", "download", "openLightbox"],
|
|
883
|
-
setup(
|
|
884
|
-
return (
|
|
885
|
-
(
|
|
886
|
-
key:
|
|
887
|
-
onClick:
|
|
872
|
+
setup(a) {
|
|
873
|
+
return (l, o) => (s(), i("div", Yt, [
|
|
874
|
+
(s(!0), i(I, null, E(l.files, (e) => (s(), i("div", {
|
|
875
|
+
key: e.id,
|
|
876
|
+
onClick: U((n) => l.$emit("openLightbox", e), ["stop"]),
|
|
888
877
|
class: "group relative border rounded-lg p-2 hover:shadow-md transition-all bg-white hover:bg-gray-50 cursor-pointer"
|
|
889
878
|
}, [
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
879
|
+
t("div", ts, [
|
|
880
|
+
t("div", ss, [
|
|
881
|
+
e.ext === "png" || e.ext === "jpg" || e.ext === "jpeg" || e.ext === "gif" || e.ext === "svg" || e.ext === "webp" ? (s(), i("img", {
|
|
893
882
|
key: 0,
|
|
894
|
-
src: `/file/resize?filepath=${
|
|
883
|
+
src: `/file/resize?filepath=${e?.file_path}&w=500`,
|
|
895
884
|
alt: "file",
|
|
896
885
|
class: "w-full h-full object-cover"
|
|
897
|
-
}, null, 8,
|
|
886
|
+
}, null, 8, os)) : (s(), A(w(G), {
|
|
898
887
|
key: 1,
|
|
899
888
|
class: "h-10 w-10 text-gray-500"
|
|
900
889
|
}))
|
|
901
890
|
]),
|
|
902
|
-
|
|
903
|
-
|
|
891
|
+
t("div", ns, [
|
|
892
|
+
t("h3", {
|
|
904
893
|
class: "font-medium text-xs leading-tight text-left",
|
|
905
|
-
title:
|
|
906
|
-
},
|
|
907
|
-
|
|
894
|
+
title: e.uploaded_name || e.name
|
|
895
|
+
}, x(e.uploaded_name || e.name), 9, is),
|
|
896
|
+
t("p", ls, x(w(_e)(e.createdAt)) + ", " + x(w(we)(e.size)), 1)
|
|
908
897
|
])
|
|
909
898
|
]),
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
onClick:
|
|
899
|
+
t("div", as, [
|
|
900
|
+
t("button", {
|
|
901
|
+
onClick: U((n) => l.$emit("download", e), ["stop"]),
|
|
913
902
|
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"
|
|
914
903
|
}, [
|
|
915
|
-
w(
|
|
916
|
-
], 8,
|
|
917
|
-
|
|
904
|
+
M(w(ve), { class: "h-3 w-3" })
|
|
905
|
+
], 8, rs),
|
|
906
|
+
t("button", {
|
|
918
907
|
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",
|
|
919
|
-
onClick:
|
|
908
|
+
onClick: U((n) => l.$emit("delete", n, e?.file_id), ["stop"])
|
|
920
909
|
}, [
|
|
921
|
-
w(
|
|
922
|
-
], 8,
|
|
910
|
+
M(w(de), { class: "h-3 w-3" })
|
|
911
|
+
], 8, ds)
|
|
923
912
|
])
|
|
924
|
-
], 8,
|
|
913
|
+
], 8, es))), 128))
|
|
925
914
|
]));
|
|
926
915
|
}
|
|
927
|
-
}),
|
|
916
|
+
}), us = { class: "mx-auto font-sans" }, ps = { key: 1 }, he = /* @__PURE__ */ j({
|
|
928
917
|
__name: "FilesWidget",
|
|
929
918
|
props: {
|
|
930
919
|
title: {},
|
|
@@ -938,392 +927,363 @@ const Nt = { class: "space-y-0.5" }, Rt = ["onClick"], Ut = ["onClick"], Pt = {
|
|
|
938
927
|
onDelete: {}
|
|
939
928
|
},
|
|
940
929
|
emits: ["delete", "add", "openLightbox"],
|
|
941
|
-
setup(
|
|
942
|
-
const
|
|
943
|
-
|
|
944
|
-
const
|
|
945
|
-
|
|
946
|
-
},
|
|
947
|
-
|
|
948
|
-
},
|
|
949
|
-
const
|
|
950
|
-
|
|
951
|
-
},
|
|
952
|
-
|
|
953
|
-
},
|
|
954
|
-
|
|
955
|
-
},
|
|
956
|
-
const
|
|
957
|
-
|
|
958
|
-
}, c =
|
|
959
|
-
async function
|
|
960
|
-
if (!
|
|
930
|
+
setup(a, { emit: l }) {
|
|
931
|
+
const o = a, e = $(!1), n = $(null), g = $(!1), d = $(0), y = $(o.files ?? []), v = l;
|
|
932
|
+
y.value.length === 0 && u();
|
|
933
|
+
const p = (_, h) => {
|
|
934
|
+
n.value = h, e.value = !0;
|
|
935
|
+
}, r = () => {
|
|
936
|
+
n.value && (O(n.value), n.value = null, e.value = !1);
|
|
937
|
+
}, f = N(() => Array.isArray(y.value) ? y.value.map((_) => _?.file_path) : []), m = (_) => {
|
|
938
|
+
const h = f.value.findIndex((S) => S === _.file_path);
|
|
939
|
+
h !== -1 && (g.value = !0, d.value = h);
|
|
940
|
+
}, C = (_) => {
|
|
941
|
+
o.onAddFile ? o.onAddFile(_) : T(_), v("add", _);
|
|
942
|
+
}, O = (_) => {
|
|
943
|
+
o.onDelete ? o.onDelete(_) : k(_), v("delete", _);
|
|
944
|
+
}, z = (_) => {
|
|
945
|
+
const h = document.createElement("a");
|
|
946
|
+
h.setAttribute("download", _?.uploaded_name || _?.name), h.href = _?.file_path || _?.path, h.click();
|
|
947
|
+
}, c = $("list");
|
|
948
|
+
async function u() {
|
|
949
|
+
if (!o.id)
|
|
961
950
|
return;
|
|
962
|
-
const
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
}),
|
|
951
|
+
const _ = await fetch(`/api/widget/file/${o.id}`).then((h) => h.json());
|
|
952
|
+
_.rows.forEach((h) => {
|
|
953
|
+
h.timestamp = new Date(h.cdate), h.id = h.entity_id, h.entityType = h.entity_type, h.entityId = h.entity_id, h.entityType = h.entity_type, h.action = h.change_type, h.userId = h.change_user_id, h.userName = h.username, h.timestamp = new Date(h.cdate), h.description = h.username, h.status = h.username;
|
|
954
|
+
}), y.value = _.rows;
|
|
966
955
|
}
|
|
967
|
-
const
|
|
968
|
-
if (!(!
|
|
956
|
+
const T = async (_) => {
|
|
957
|
+
if (!(!_.target || !_.target.files || _.target.files.length === 0))
|
|
969
958
|
try {
|
|
970
959
|
await Promise.all(
|
|
971
|
-
Array.from(
|
|
972
|
-
const
|
|
973
|
-
|
|
974
|
-
const
|
|
960
|
+
Array.from(_.target.files).map(async (h) => {
|
|
961
|
+
const S = new FormData();
|
|
962
|
+
S.append("file", h);
|
|
963
|
+
const P = `/api/widget/file/${o.id}`, H = await fetch(P, {
|
|
975
964
|
method: "POST",
|
|
976
|
-
body:
|
|
965
|
+
body: S
|
|
977
966
|
});
|
|
978
|
-
if (!
|
|
979
|
-
throw new Error(`HTTP error! status: ${
|
|
980
|
-
return
|
|
967
|
+
if (!H.ok)
|
|
968
|
+
throw new Error(`HTTP error! status: ${H.status}`);
|
|
969
|
+
return h;
|
|
981
970
|
})
|
|
982
|
-
), await
|
|
983
|
-
} catch (
|
|
984
|
-
console.error("Помилка при завантаженні файлів:",
|
|
971
|
+
), await u();
|
|
972
|
+
} catch (h) {
|
|
973
|
+
console.error("Помилка при завантаженні файлів:", h);
|
|
985
974
|
}
|
|
986
|
-
},
|
|
975
|
+
}, k = async (_) => {
|
|
987
976
|
try {
|
|
988
977
|
await fetch(
|
|
989
|
-
`/api/widget/file/${
|
|
978
|
+
`/api/widget/file/${o.id}/${_}`,
|
|
990
979
|
{
|
|
991
980
|
method: "DELETE"
|
|
992
981
|
}
|
|
993
|
-
), await
|
|
994
|
-
} catch (
|
|
995
|
-
console.error(
|
|
982
|
+
), await u();
|
|
983
|
+
} catch (h) {
|
|
984
|
+
console.error(h);
|
|
996
985
|
}
|
|
997
986
|
};
|
|
998
|
-
return (
|
|
999
|
-
const
|
|
1000
|
-
return
|
|
1001
|
-
|
|
1002
|
-
|
|
987
|
+
return (_, h) => {
|
|
988
|
+
const S = Q("MessageBox"), P = Q("Lightbox");
|
|
989
|
+
return s(), i(I, null, [
|
|
990
|
+
t("div", us, [
|
|
991
|
+
M(Pt, {
|
|
1003
992
|
modelValue: c.value,
|
|
1004
|
-
"onUpdate:modelValue":
|
|
1005
|
-
title:
|
|
1006
|
-
onOnAddFile:
|
|
993
|
+
"onUpdate:modelValue": h[0] || (h[0] = (H) => c.value = H),
|
|
994
|
+
title: o.title,
|
|
995
|
+
onOnAddFile: h[1] || (h[1] = (H) => C(H))
|
|
1007
996
|
}, null, 8, ["modelValue", "title"]),
|
|
1008
|
-
|
|
997
|
+
y.value.length > 0 ? (s(), i("div", {
|
|
1009
998
|
key: 0,
|
|
1010
|
-
class: D(
|
|
1011
|
-
style:
|
|
999
|
+
class: D(_.maxHeight ? "overflow-y-auto" : ""),
|
|
1000
|
+
style: Z({ maxHeight: _.maxHeight + "px" })
|
|
1012
1001
|
}, [
|
|
1013
|
-
c.value === "list" ? (
|
|
1002
|
+
c.value === "list" ? (s(), A($e, {
|
|
1014
1003
|
key: 0,
|
|
1015
|
-
onDelete:
|
|
1016
|
-
onDownload:
|
|
1017
|
-
onOpenLightbox:
|
|
1018
|
-
files:
|
|
1019
|
-
}, null, 8, ["files"])) :
|
|
1020
|
-
c.value === "grid" ? (
|
|
1004
|
+
onDelete: p,
|
|
1005
|
+
onDownload: z,
|
|
1006
|
+
onOpenLightbox: h[2] || (h[2] = (H) => m(H)),
|
|
1007
|
+
files: y.value
|
|
1008
|
+
}, null, 8, ["files"])) : b("", !0),
|
|
1009
|
+
c.value === "grid" ? (s(), A(cs, {
|
|
1021
1010
|
key: 1,
|
|
1022
|
-
onDelete:
|
|
1023
|
-
onDownload:
|
|
1024
|
-
onOpenLightbox:
|
|
1025
|
-
files:
|
|
1026
|
-
}, null, 8, ["files"])) :
|
|
1027
|
-
], 6)) : (
|
|
1028
|
-
|
|
1029
|
-
|
|
1011
|
+
onDelete: p,
|
|
1012
|
+
onDownload: z,
|
|
1013
|
+
onOpenLightbox: h[3] || (h[3] = (H) => m(H)),
|
|
1014
|
+
files: y.value
|
|
1015
|
+
}, null, 8, ["files"])) : b("", !0)
|
|
1016
|
+
], 6)) : (s(), i("div", ps, [...h[6] || (h[6] = [
|
|
1017
|
+
t("div", { class: "flex items-center justify-center h-full" }, [
|
|
1018
|
+
t("p", { class: "text-gray-500 leading-[3]" }, "Файлів не знайдено")
|
|
1030
1019
|
], -1)
|
|
1031
|
-
])))
|
|
1020
|
+
])]))
|
|
1032
1021
|
]),
|
|
1033
|
-
|
|
1034
|
-
modelValue:
|
|
1035
|
-
"onUpdate:modelValue":
|
|
1036
|
-
onConfirm:
|
|
1022
|
+
M(S, {
|
|
1023
|
+
modelValue: e.value,
|
|
1024
|
+
"onUpdate:modelValue": h[4] || (h[4] = (H) => e.value = H),
|
|
1025
|
+
onConfirm: r,
|
|
1037
1026
|
title: "Ви впевнені?",
|
|
1038
1027
|
message: "Ви впевнені, що хочете видалити цей файл?",
|
|
1039
1028
|
confirmButtonText: "Так, я впевнена/ий",
|
|
1040
1029
|
cancelButtonText: "Скасувати"
|
|
1041
1030
|
}, null, 8, ["modelValue"]),
|
|
1042
|
-
|
|
1043
|
-
modelValue:
|
|
1044
|
-
"onUpdate:modelValue":
|
|
1045
|
-
images:
|
|
1046
|
-
"start-index":
|
|
1031
|
+
M(P, {
|
|
1032
|
+
modelValue: g.value,
|
|
1033
|
+
"onUpdate:modelValue": h[5] || (h[5] = (H) => g.value = H),
|
|
1034
|
+
images: f.value,
|
|
1035
|
+
"start-index": d.value
|
|
1047
1036
|
}, null, 8, ["modelValue", "images", "start-index"])
|
|
1048
1037
|
], 64);
|
|
1049
1038
|
};
|
|
1050
1039
|
}
|
|
1051
|
-
}),
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
f(o.id);
|
|
1065
|
-
}, 1500)
|
|
1066
|
-
};
|
|
1067
|
-
n.value.push(o);
|
|
1068
|
-
}, f = (o) => {
|
|
1069
|
-
const m = n.value.findIndex((v) => v.id === o);
|
|
1070
|
-
if (m !== -1) {
|
|
1071
|
-
const v = n.value[m];
|
|
1072
|
-
clearTimeout(v.timer), n.value.splice(m, 1);
|
|
1073
|
-
}
|
|
1074
|
-
};
|
|
1075
|
-
return i({
|
|
1076
|
-
addNotification: s
|
|
1077
|
-
}), de(() => {
|
|
1078
|
-
n.value.forEach((o) => {
|
|
1079
|
-
clearTimeout(o.timer);
|
|
1080
|
-
});
|
|
1081
|
-
}), (o, m) => (a(), j(be, { to: "body" }, [
|
|
1082
|
-
w(Me, {
|
|
1083
|
-
name: "notification",
|
|
1084
|
-
tag: "div",
|
|
1085
|
-
class: "fixed top-4 right-4 z-50 space-y-2"
|
|
1086
|
-
}, {
|
|
1087
|
-
default: Le(() => [
|
|
1088
|
-
(a(!0), r(A, null, S(n.value, (v) => (a(), r("div", {
|
|
1089
|
-
key: v.id,
|
|
1090
|
-
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"
|
|
1091
|
-
}, [
|
|
1092
|
-
w(_(Se), { class: "h-5 w-5 text-green-100 flex-shrink-0" }),
|
|
1093
|
-
m[0] || (m[0] = e("div", { class: "flex-1" }, [
|
|
1094
|
-
e("p", { class: "font-medium text-sm" }, "Ссылка скопирована!"),
|
|
1095
|
-
e("p", { class: "text-xs text-green-100 opacity-90" }, "Файл добавлен в буфер обмена")
|
|
1096
|
-
], -1)),
|
|
1097
|
-
e("button", {
|
|
1098
|
-
onClick: (g) => f(v.id),
|
|
1099
|
-
class: "text-green-100 hover:text-white transition-colors flex-shrink-0"
|
|
1100
|
-
}, [
|
|
1101
|
-
w(_(X), { class: "h-4 w-4" })
|
|
1102
|
-
], 8, ps)
|
|
1103
|
-
]))), 128))
|
|
1104
|
-
]),
|
|
1105
|
-
_: 1
|
|
1106
|
-
})
|
|
1107
|
-
]));
|
|
1108
|
-
}
|
|
1109
|
-
}), P = (l, i) => {
|
|
1110
|
-
const n = l.__vccOpts || l;
|
|
1111
|
-
for (const [t, s] of i)
|
|
1112
|
-
n[t] = s;
|
|
1113
|
-
return n;
|
|
1114
|
-
}, $e = /* @__PURE__ */ P(ms, [["__scopeId", "data-v-55903525"]]), gs = { class: "fixed inset-0 z-50 bg-black/80" }, hs = { class: "fixed bg-white left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background shadow-lg duration-200 sm:rounded-lg max-w-4xl max-h-[90vh] p-0" }, fs = { class: "flex flex-col space-y-1.5 text-center sm:text-left p-4 pb-2" }, vs = { class: "flex items-center justify-between" }, ys = { class: "flex items-center gap-2" }, bs = { class: "tracking-tight text-base font-medium" }, xs = { class: "p-4 pt-0" }, ks = { class: "flex flex-col items-center" }, _s = ["src", "alt"], ws = { class: "mt-3 flex items-center gap-4 text-sm text-gray-600" }, $s = { class: "mt-3 flex gap-2" }, Cs = /* @__PURE__ */ I({
|
|
1115
|
-
__name: "GalleryModal",
|
|
1040
|
+
}), ms = {
|
|
1041
|
+
key: 0,
|
|
1042
|
+
class: "image-wrapper h-full max-h-[400px]",
|
|
1043
|
+
id: "lightbox-gallery"
|
|
1044
|
+
}, gs = ["onClick"], hs = {
|
|
1045
|
+
key: 0,
|
|
1046
|
+
rel: "noreferrer",
|
|
1047
|
+
class: "relative block h-full w-full"
|
|
1048
|
+
}, fs = ["src"], ys = {
|
|
1049
|
+
key: 0,
|
|
1050
|
+
class: "thumb-cover"
|
|
1051
|
+
}, vs = /* @__PURE__ */ j({
|
|
1052
|
+
__name: "GalleryContent",
|
|
1116
1053
|
props: {
|
|
1117
|
-
|
|
1054
|
+
title: {},
|
|
1055
|
+
items: {},
|
|
1056
|
+
columns: {},
|
|
1057
|
+
maxHeight: {},
|
|
1058
|
+
onAddImage: { type: Function },
|
|
1059
|
+
onDelete: { type: Function },
|
|
1060
|
+
id: {},
|
|
1061
|
+
className: {},
|
|
1062
|
+
style: {}
|
|
1118
1063
|
},
|
|
1119
|
-
emits: ["
|
|
1120
|
-
setup(l) {
|
|
1121
|
-
const
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
try {
|
|
1129
|
-
const g = await (await fetch(o)).blob(), d = window.URL.createObjectURL(g), y = document.createElement("a");
|
|
1130
|
-
y.href = d, y.download = m, document.body.appendChild(y), y.click(), window.URL.revokeObjectURL(d), document.body.removeChild(y);
|
|
1131
|
-
} catch (v) {
|
|
1132
|
-
console.error("Download failed:", v), alert("Download failed. Please try opening the image in a new tab.");
|
|
1133
|
-
}
|
|
1064
|
+
emits: ["delete"],
|
|
1065
|
+
setup(a, { emit: l }) {
|
|
1066
|
+
const o = l, e = $(!1), n = $(0), g = a, d = N(
|
|
1067
|
+
() => Array.isArray(g.items) ? g.items.map((v) => v?.file_path) : []
|
|
1068
|
+
), y = (v) => {
|
|
1069
|
+
const p = d.value.findIndex(
|
|
1070
|
+
(r) => r === v.file_path
|
|
1071
|
+
);
|
|
1072
|
+
p !== -1 && (e.value = !0, n.value = p);
|
|
1134
1073
|
};
|
|
1135
|
-
return (
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
class:
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
e("span", null, "Size: " + k(t(o.item.size)), 1),
|
|
1153
|
-
m[3] || (m[3] = e("span", null, "•", -1)),
|
|
1154
|
-
e("span", null, "Date: " + k(n(o.item.createdAt)), 1)
|
|
1155
|
-
]),
|
|
1156
|
-
e("div", $s, [
|
|
1157
|
-
e("button", {
|
|
1158
|
-
onClick: m[0] || (m[0] = (v) => f(o.item.path, o.item.name)),
|
|
1159
|
-
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 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 h-9 rounded-md px-3"
|
|
1160
|
-
}, [
|
|
1161
|
-
w(_(ce), { class: "h-3 w-3 mr-1" }),
|
|
1162
|
-
m[4] || (m[4] = H(" Download ", -1))
|
|
1163
|
-
]),
|
|
1164
|
-
e("button", {
|
|
1165
|
-
onClick: m[1] || (m[1] = (v) => s(o.item.path)),
|
|
1166
|
-
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 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 h-9 rounded-md px-3"
|
|
1167
|
-
}, [
|
|
1168
|
-
w(_(Ge), { class: "h-3 w-3 mr-1" }),
|
|
1169
|
-
m[5] || (m[5] = H(" Share ", -1))
|
|
1074
|
+
return (v, p) => {
|
|
1075
|
+
const r = Q("Lightbox");
|
|
1076
|
+
return v.items?.length >= 1 ? (s(), i("div", ms, [
|
|
1077
|
+
(s(!0), i(I, null, E(v.items, (f, m) => (s(), i("div", {
|
|
1078
|
+
class: D(["h-full w-full image" + m, "cursor-pointer bg-teal-500 rounded-[3px]"]),
|
|
1079
|
+
key: m,
|
|
1080
|
+
onClick: U((C) => y(f), ["stop"])
|
|
1081
|
+
}, [
|
|
1082
|
+
m < 5 ? (s(), i("div", hs, [
|
|
1083
|
+
t("img", {
|
|
1084
|
+
src: `/file/resize?filepath=${f?.file_path}&w=500`,
|
|
1085
|
+
alt: "alt",
|
|
1086
|
+
height: "auto",
|
|
1087
|
+
width: "100%",
|
|
1088
|
+
class: D([
|
|
1089
|
+
"object-cover h-full w-full bg-gray-200 rounded-[3px]",
|
|
1090
|
+
m === 0 ? "max-h-[411px]" : "max-h-[calc((411px-3px)/2)]"
|
|
1170
1091
|
])
|
|
1171
|
-
|
|
1092
|
+
}, null, 10, fs),
|
|
1093
|
+
m === 4 && v.items?.length > 5 ? (s(), i("div", ys, " +" + x(v.items?.length - 5), 1)) : b("", !0)
|
|
1094
|
+
])) : b("", !0)
|
|
1095
|
+
], 10, gs))), 128)),
|
|
1096
|
+
(s(!0), i(I, null, E(Math.max(0, 5 - v.items.length), (f) => (s(), i("div", {
|
|
1097
|
+
key: "empty-" + f,
|
|
1098
|
+
class: D(["h-full w-full image" + (v.items.length + f - 1), "bg-gray-300 rounded-[3px]"])
|
|
1099
|
+
}, null, 2))), 128)),
|
|
1100
|
+
M(r, {
|
|
1101
|
+
modelValue: e.value,
|
|
1102
|
+
"onUpdate:modelValue": p[0] || (p[0] = (f) => e.value = f),
|
|
1103
|
+
images: d.value,
|
|
1104
|
+
"start-index": n.value,
|
|
1105
|
+
delete: "true",
|
|
1106
|
+
download: "true",
|
|
1107
|
+
onDelete: p[1] || (p[1] = (f) => o("delete", f))
|
|
1108
|
+
}, null, 8, ["modelValue", "images", "start-index"])
|
|
1109
|
+
])) : b("", !0);
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1112
|
+
}), bs = {
|
|
1113
|
+
key: 0,
|
|
1114
|
+
class: "text-xl font-semibold"
|
|
1115
|
+
}, xs = { class: "flex gap-1" }, ks = { 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" }, _s = /* @__PURE__ */ j({
|
|
1116
|
+
__name: "widgetHeader",
|
|
1117
|
+
props: {
|
|
1118
|
+
title: {}
|
|
1119
|
+
},
|
|
1120
|
+
emits: ["onAddImage"],
|
|
1121
|
+
setup(a) {
|
|
1122
|
+
return (l, o) => (s(), i("div", {
|
|
1123
|
+
class: D(["flex flex-col sm:flex-row gap-3 mb-4", l.title ? "justify-between sm:items-center" : "justify-end sm:items-center"])
|
|
1124
|
+
}, [
|
|
1125
|
+
l.title ? (s(), i("h3", bs, x(l.title), 1)) : b("", !0),
|
|
1126
|
+
t("div", xs, [
|
|
1127
|
+
t("label", null, [
|
|
1128
|
+
t("input", {
|
|
1129
|
+
type: "file",
|
|
1130
|
+
class: "hidden",
|
|
1131
|
+
onChange: o[0] || (o[0] = (e) => l.$emit("onAddImage", e))
|
|
1132
|
+
}, null, 32),
|
|
1133
|
+
t("div", ks, [
|
|
1134
|
+
M(w(be), { class: "h-4 w-4" }),
|
|
1135
|
+
o[1] || (o[1] = F(" Додати зображення ", -1))
|
|
1172
1136
|
])
|
|
1173
|
-
]),
|
|
1174
|
-
e("button", {
|
|
1175
|
-
type: "button",
|
|
1176
|
-
onClick: m[2] || (m[2] = (v) => o.$emit("close")),
|
|
1177
|
-
class: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"
|
|
1178
|
-
}, [
|
|
1179
|
-
w(_(X), { class: "h-4 w-4" }),
|
|
1180
|
-
m[6] || (m[6] = e("span", { class: "sr-only" }, "Close", -1))
|
|
1181
1137
|
])
|
|
1182
|
-
])
|
|
1183
|
-
|
|
1184
|
-
ref_key: "copyNotificationRef",
|
|
1185
|
-
ref: i
|
|
1186
|
-
}, null, 512)
|
|
1187
|
-
]));
|
|
1138
|
+
])
|
|
1139
|
+
], 2));
|
|
1188
1140
|
}
|
|
1189
|
-
}),
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
},
|
|
1141
|
+
}), ws = {
|
|
1142
|
+
class: "w-full mx-auto font-sans",
|
|
1143
|
+
ref: "containerRef"
|
|
1144
|
+
}, $s = { key: 1 }, ne = /* @__PURE__ */ j({
|
|
1193
1145
|
__name: "GalleryWidget",
|
|
1194
1146
|
props: {
|
|
1195
1147
|
title: {},
|
|
1196
|
-
items: {},
|
|
1148
|
+
items: { default: () => [] },
|
|
1197
1149
|
columns: {},
|
|
1198
1150
|
maxHeight: {},
|
|
1151
|
+
onAddImage: {},
|
|
1152
|
+
onDelete: {},
|
|
1199
1153
|
id: {},
|
|
1200
1154
|
className: {},
|
|
1201
1155
|
style: {}
|
|
1202
1156
|
},
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
}
|
|
1210
|
-
|
|
1157
|
+
emits: ["delete", "add", "openLightbox"],
|
|
1158
|
+
setup(a, { emit: l }) {
|
|
1159
|
+
const o = a, e = $(o.items ?? []), n = l;
|
|
1160
|
+
e.value.length === 0 && v();
|
|
1161
|
+
const g = (r) => {
|
|
1162
|
+
o.onAddImage ? o.onAddImage(r) : y(r), n("add", r);
|
|
1163
|
+
}, d = (r) => {
|
|
1164
|
+
const f = e.value.find(
|
|
1165
|
+
(m) => m.file_path === r
|
|
1166
|
+
)?.file_id;
|
|
1167
|
+
f && (o.onDelete ? o.onDelete(f) : p(f));
|
|
1168
|
+
}, y = async (r) => {
|
|
1169
|
+
if (!(!r.target || !r.target.files || r.target.files.length === 0))
|
|
1170
|
+
try {
|
|
1171
|
+
await Promise.all(
|
|
1172
|
+
Array.from(r.target.files).map(async (f) => {
|
|
1173
|
+
const m = new FormData();
|
|
1174
|
+
m.append("file", f);
|
|
1175
|
+
const C = `/api/widget/file/${o.id}`, O = await fetch(C, {
|
|
1176
|
+
method: "POST",
|
|
1177
|
+
body: m
|
|
1178
|
+
});
|
|
1179
|
+
if (!O.ok)
|
|
1180
|
+
throw new Error(`HTTP error! status: ${O.status}`);
|
|
1181
|
+
return f;
|
|
1182
|
+
})
|
|
1183
|
+
), await v();
|
|
1184
|
+
} catch (f) {
|
|
1185
|
+
console.error("Помилка при завантаженні файлів:", f);
|
|
1186
|
+
}
|
|
1211
1187
|
};
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
}
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1188
|
+
async function v() {
|
|
1189
|
+
if (!o.id)
|
|
1190
|
+
return;
|
|
1191
|
+
const r = await fetch(`/api/widget/file/${o.id}`).then(
|
|
1192
|
+
(f) => f.json()
|
|
1193
|
+
);
|
|
1194
|
+
e.value = r.rows;
|
|
1195
|
+
}
|
|
1196
|
+
const p = async (r) => {
|
|
1197
|
+
try {
|
|
1198
|
+
await fetch(`/api/widget/file/${o.id}/${r}`, {
|
|
1199
|
+
method: "DELETE"
|
|
1200
|
+
}), await v();
|
|
1201
|
+
} catch (f) {
|
|
1202
|
+
console.error(f);
|
|
1203
|
+
}
|
|
1224
1204
|
};
|
|
1225
|
-
return (
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
}, [
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
(a(!0), r(A, null, S(d.items, (p) => (a(), r("div", {
|
|
1240
|
-
key: p.id,
|
|
1241
|
-
onClick: (b) => g(p),
|
|
1242
|
-
class: "group relative break-inside-avoid bg-gray-200 rounded-lg overflow-hidden cursor-pointer hover:shadow-md transition-all mb-3"
|
|
1243
|
-
}, [
|
|
1244
|
-
e("img", {
|
|
1245
|
-
src: p.path,
|
|
1246
|
-
alt: p.name,
|
|
1247
|
-
class: "w-full h-auto min-h-40 rounded-md object-contain"
|
|
1248
|
-
}, null, 8, Ds),
|
|
1249
|
-
y[1] || (y[1] = e("div", { class: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent p-4 pt-12" }, [
|
|
1250
|
-
e("h3", { class: "text-white font-medium text-base leading-tight mb-1" }, "Mountain Landscape"),
|
|
1251
|
-
e("p", { class: "text-white/90 text-sm" }, "2.4 MB")
|
|
1252
|
-
], -1)),
|
|
1253
|
-
y[2] || (y[2] = e("div", { class: "absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-colors duration-200" }, null, -1))
|
|
1254
|
-
], 8, Ls))), 128))
|
|
1255
|
-
], 4)
|
|
1256
|
-
], 6),
|
|
1257
|
-
(a(), j(be, { to: "body" }, [
|
|
1258
|
-
n.value && t.value ? (a(), j(Cs, {
|
|
1259
|
-
key: 0,
|
|
1260
|
-
item: t.value,
|
|
1261
|
-
onClose: y[0] || (y[0] = (p) => n.value = !1)
|
|
1262
|
-
}, null, 8, ["item"])) : $("", !0)
|
|
1263
|
-
]))
|
|
1205
|
+
return (r, f) => (s(), i("div", ws, [
|
|
1206
|
+
M(_s, {
|
|
1207
|
+
title: r.title,
|
|
1208
|
+
onOnAddImage: f[0] || (f[0] = (m) => g(m))
|
|
1209
|
+
}, null, 8, ["title"]),
|
|
1210
|
+
e.value.length > 0 ? (s(), A(vs, {
|
|
1211
|
+
key: 0,
|
|
1212
|
+
items: e.value,
|
|
1213
|
+
onDelete: f[1] || (f[1] = (m) => d(m))
|
|
1214
|
+
}, null, 8, ["items"])) : (s(), i("div", $s, [...f[2] || (f[2] = [
|
|
1215
|
+
t("div", { class: "flex items-center justify-center h-full" }, [
|
|
1216
|
+
t("p", { class: "text-gray-500 leading-[3]" }, "Зображень не знайдено")
|
|
1217
|
+
], -1)
|
|
1218
|
+
])]))
|
|
1264
1219
|
], 512));
|
|
1265
1220
|
}
|
|
1266
|
-
}),
|
|
1221
|
+
}), Cs = { class: "text-value" }, Ms = { class: "text-sm text-gray-900" }, Ls = /* @__PURE__ */ j({
|
|
1267
1222
|
__name: "TextValue",
|
|
1268
1223
|
props: {
|
|
1269
1224
|
item: {}
|
|
1270
1225
|
},
|
|
1271
|
-
setup(
|
|
1272
|
-
const
|
|
1273
|
-
const
|
|
1274
|
-
return typeof
|
|
1226
|
+
setup(a) {
|
|
1227
|
+
const l = a, o = N(() => {
|
|
1228
|
+
const e = l.item.value;
|
|
1229
|
+
return typeof e == "boolean" ? e ? "Так" : "Ні" : e == null ? "—" : String(e);
|
|
1275
1230
|
});
|
|
1276
|
-
return (
|
|
1277
|
-
|
|
1231
|
+
return (e, n) => (s(), i("div", Cs, [
|
|
1232
|
+
t("span", Ms, x(o.value), 1)
|
|
1278
1233
|
]));
|
|
1279
1234
|
}
|
|
1280
|
-
}),
|
|
1235
|
+
}), W = (a, l) => {
|
|
1236
|
+
const o = a.__vccOpts || a;
|
|
1237
|
+
for (const [e, n] of l)
|
|
1238
|
+
o[e] = n;
|
|
1239
|
+
return o;
|
|
1240
|
+
}, Ts = /* @__PURE__ */ W(Ls, [["__scopeId", "data-v-c14550b7"]]), Ds = { class: "link-value" }, Is = ["href"], js = /* @__PURE__ */ j({
|
|
1281
1241
|
__name: "LinkValue",
|
|
1282
1242
|
props: {
|
|
1283
1243
|
item: {}
|
|
1284
1244
|
},
|
|
1285
|
-
setup(
|
|
1286
|
-
const
|
|
1287
|
-
const
|
|
1245
|
+
setup(a) {
|
|
1246
|
+
const l = a, o = N(() => {
|
|
1247
|
+
const e = String(l.item.value);
|
|
1288
1248
|
try {
|
|
1289
|
-
const
|
|
1290
|
-
return
|
|
1249
|
+
const n = new URL(e);
|
|
1250
|
+
return n.hostname + n.pathname;
|
|
1291
1251
|
} catch {
|
|
1292
|
-
return
|
|
1252
|
+
return e;
|
|
1293
1253
|
}
|
|
1294
1254
|
});
|
|
1295
|
-
return (
|
|
1296
|
-
|
|
1297
|
-
href: String(
|
|
1255
|
+
return (e, n) => (s(), i("div", Ds, [
|
|
1256
|
+
t("a", {
|
|
1257
|
+
href: String(e.item.value),
|
|
1298
1258
|
target: "_blank",
|
|
1299
1259
|
rel: "noopener noreferrer",
|
|
1300
1260
|
class: "text-blue-600 hover:text-blue-800 underline text-sm"
|
|
1301
1261
|
}, [
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
], 8,
|
|
1262
|
+
F(x(o.value) + " ", 1),
|
|
1263
|
+
n[0] || (n[0] = t("i", { class: "fas fa-external-link-alt ml-1 text-xs" }, null, -1))
|
|
1264
|
+
], 8, Is)
|
|
1305
1265
|
]));
|
|
1306
1266
|
}
|
|
1307
|
-
}),
|
|
1267
|
+
}), Vs = /* @__PURE__ */ W(js, [["__scopeId", "data-v-e6eb07a6"]]), As = { class: "date-value" }, zs = { class: "text-sm text-gray-900" }, Hs = /* @__PURE__ */ j({
|
|
1308
1268
|
__name: "DateValue",
|
|
1309
1269
|
props: {
|
|
1310
1270
|
item: {}
|
|
1311
1271
|
},
|
|
1312
|
-
setup(
|
|
1313
|
-
const
|
|
1314
|
-
const
|
|
1315
|
-
if (
|
|
1316
|
-
return
|
|
1272
|
+
setup(a) {
|
|
1273
|
+
const l = a, o = N(() => {
|
|
1274
|
+
const e = l.item.value;
|
|
1275
|
+
if (e instanceof Date)
|
|
1276
|
+
return e.toLocaleDateString("uk-UA", {
|
|
1317
1277
|
year: "numeric",
|
|
1318
1278
|
month: "long",
|
|
1319
1279
|
day: "numeric",
|
|
1320
1280
|
hour: "2-digit",
|
|
1321
1281
|
minute: "2-digit"
|
|
1322
1282
|
});
|
|
1323
|
-
if (typeof
|
|
1324
|
-
const
|
|
1325
|
-
if (!isNaN(
|
|
1326
|
-
return
|
|
1283
|
+
if (typeof e == "string") {
|
|
1284
|
+
const n = new Date(e);
|
|
1285
|
+
if (!isNaN(n.getTime()))
|
|
1286
|
+
return n.toLocaleDateString("uk-UA", {
|
|
1327
1287
|
year: "numeric",
|
|
1328
1288
|
month: "long",
|
|
1329
1289
|
day: "numeric",
|
|
@@ -1331,23 +1291,23 @@ const Nt = { class: "space-y-0.5" }, Rt = ["onClick"], Ut = ["onClick"], Pt = {
|
|
|
1331
1291
|
minute: "2-digit"
|
|
1332
1292
|
});
|
|
1333
1293
|
}
|
|
1334
|
-
return String(
|
|
1294
|
+
return String(e);
|
|
1335
1295
|
});
|
|
1336
|
-
return (
|
|
1337
|
-
|
|
1296
|
+
return (e, n) => (s(), i("div", As, [
|
|
1297
|
+
t("span", zs, x(o.value), 1)
|
|
1338
1298
|
]));
|
|
1339
1299
|
}
|
|
1340
|
-
}),
|
|
1300
|
+
}), Es = /* @__PURE__ */ W(Hs, [["__scopeId", "data-v-b9600618"]]), Fs = { class: "status-value" }, Ss = {
|
|
1341
1301
|
key: 0,
|
|
1342
1302
|
class: "mr-1"
|
|
1343
|
-
},
|
|
1303
|
+
}, Ns = /* @__PURE__ */ j({
|
|
1344
1304
|
__name: "StatusValue",
|
|
1345
1305
|
props: {
|
|
1346
1306
|
item: {}
|
|
1347
1307
|
},
|
|
1348
|
-
setup(
|
|
1349
|
-
const
|
|
1350
|
-
switch (String(
|
|
1308
|
+
setup(a) {
|
|
1309
|
+
const l = a, o = N(() => {
|
|
1310
|
+
switch (String(l.item.value).toLowerCase()) {
|
|
1351
1311
|
case "active":
|
|
1352
1312
|
case "активний":
|
|
1353
1313
|
case "успішно":
|
|
@@ -1369,8 +1329,8 @@ const Nt = { class: "space-y-0.5" }, Rt = ["onClick"], Ut = ["onClick"], Pt = {
|
|
|
1369
1329
|
default:
|
|
1370
1330
|
return "bg-blue-100 text-blue-800";
|
|
1371
1331
|
}
|
|
1372
|
-
}),
|
|
1373
|
-
switch (String(
|
|
1332
|
+
}), e = N(() => {
|
|
1333
|
+
switch (String(l.item.value).toLowerCase()) {
|
|
1374
1334
|
case "active":
|
|
1375
1335
|
case "активний":
|
|
1376
1336
|
case "успішно":
|
|
@@ -1393,50 +1353,50 @@ const Nt = { class: "space-y-0.5" }, Rt = ["onClick"], Ut = ["onClick"], Pt = {
|
|
|
1393
1353
|
return "fas fa-info-circle";
|
|
1394
1354
|
}
|
|
1395
1355
|
});
|
|
1396
|
-
return (
|
|
1397
|
-
|
|
1398
|
-
class: D(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",
|
|
1356
|
+
return (n, g) => (s(), i("div", Fs, [
|
|
1357
|
+
t("span", {
|
|
1358
|
+
class: D(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium", o.value])
|
|
1399
1359
|
}, [
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
class: D(
|
|
1360
|
+
e.value ? (s(), i("span", Ss, [
|
|
1361
|
+
t("i", {
|
|
1362
|
+
class: D(e.value)
|
|
1403
1363
|
}, null, 2)
|
|
1404
|
-
])) :
|
|
1405
|
-
|
|
1364
|
+
])) : b("", !0),
|
|
1365
|
+
F(" " + x(String(n.item.value)), 1)
|
|
1406
1366
|
], 2)
|
|
1407
1367
|
]));
|
|
1408
1368
|
}
|
|
1409
|
-
}),
|
|
1369
|
+
}), Os = /* @__PURE__ */ W(Ns, [["__scopeId", "data-v-c72e0b01"]]), Bs = { class: "custom-value" }, Ps = { class: "text-sm text-gray-900" }, Rs = /* @__PURE__ */ j({
|
|
1410
1370
|
__name: "CustomValue",
|
|
1411
1371
|
props: {
|
|
1412
1372
|
item: {}
|
|
1413
1373
|
},
|
|
1414
|
-
setup(
|
|
1415
|
-
return (
|
|
1416
|
-
|
|
1417
|
-
item:
|
|
1418
|
-
value:
|
|
1374
|
+
setup(a) {
|
|
1375
|
+
return (l, o) => (s(), i("div", Bs, [
|
|
1376
|
+
q(l.$slots, "default", {
|
|
1377
|
+
item: l.item,
|
|
1378
|
+
value: l.item.value
|
|
1419
1379
|
}, () => [
|
|
1420
|
-
|
|
1380
|
+
t("span", Ps, x(String(l.item.value)), 1)
|
|
1421
1381
|
], !0)
|
|
1422
1382
|
]));
|
|
1423
1383
|
}
|
|
1424
|
-
}),
|
|
1384
|
+
}), Us = /* @__PURE__ */ W(Rs, [["__scopeId", "data-v-11a73810"]]), Ws = ["id"], qs = {
|
|
1425
1385
|
key: 0,
|
|
1426
1386
|
class: "text-xl font-semibold text-gray-900 mb-4"
|
|
1427
|
-
},
|
|
1387
|
+
}, Gs = {
|
|
1428
1388
|
key: 1,
|
|
1429
1389
|
class: "overflow-x-auto"
|
|
1430
|
-
},
|
|
1390
|
+
}, Ks = { class: "min-w-full divide-y divide-gray-200" }, Zs = { class: "bg-white divide-y divide-gray-200" }, Js = { class: "px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900" }, Xs = { class: "flex items-center gap-2" }, Qs = ["title"], Ys = { class: "px-6 py-4 whitespace-nowrap text-sm text-gray-500" }, eo = {
|
|
1431
1391
|
key: 2,
|
|
1432
1392
|
class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"
|
|
1433
|
-
},
|
|
1393
|
+
}, to = { class: "flex items-start gap-3" }, so = {
|
|
1434
1394
|
key: 0,
|
|
1435
1395
|
class: "flex-shrink-0"
|
|
1436
|
-
},
|
|
1396
|
+
}, oo = { class: "flex-1 min-w-0" }, no = { class: "flex items-center gap-2 mb-2" }, io = { class: "text-sm font-medium text-gray-900" }, lo = ["title"], ao = {
|
|
1437
1397
|
key: 3,
|
|
1438
1398
|
class: "overflow-x-auto"
|
|
1439
|
-
},
|
|
1399
|
+
}, ro = { class: "min-w-full divide-y divide-gray-200" }, co = { class: "bg-white divide-y divide-gray-200" }, uo = { class: "px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900" }, po = { class: "flex items-center gap-2" }, mo = ["title"], go = { class: "px-6 py-4 whitespace-nowrap text-sm text-gray-500" }, ho = /* @__PURE__ */ j({
|
|
1440
1400
|
__name: "DescriptionListWidget",
|
|
1441
1401
|
props: {
|
|
1442
1402
|
title: {},
|
|
@@ -1446,113 +1406,113 @@ const Nt = { class: "space-y-0.5" }, Rt = ["onClick"], Ut = ["onClick"], Pt = {
|
|
|
1446
1406
|
className: {},
|
|
1447
1407
|
style: {}
|
|
1448
1408
|
},
|
|
1449
|
-
setup(
|
|
1450
|
-
const
|
|
1451
|
-
switch (
|
|
1409
|
+
setup(a) {
|
|
1410
|
+
const l = (o) => {
|
|
1411
|
+
switch (o.type) {
|
|
1452
1412
|
case "link":
|
|
1453
|
-
return
|
|
1413
|
+
return Vs;
|
|
1454
1414
|
case "date":
|
|
1455
|
-
return
|
|
1415
|
+
return Es;
|
|
1456
1416
|
case "status":
|
|
1457
|
-
return
|
|
1417
|
+
return Os;
|
|
1458
1418
|
case "custom":
|
|
1459
|
-
return
|
|
1419
|
+
return Us;
|
|
1460
1420
|
default:
|
|
1461
|
-
return
|
|
1421
|
+
return Ts;
|
|
1462
1422
|
}
|
|
1463
1423
|
};
|
|
1464
|
-
return (
|
|
1465
|
-
class: D(["description-list-widget",
|
|
1466
|
-
id:
|
|
1467
|
-
style:
|
|
1424
|
+
return (o, e) => (s(), i("div", {
|
|
1425
|
+
class: D(["description-list-widget", o.className]),
|
|
1426
|
+
id: o.id,
|
|
1427
|
+
style: Z(o.style)
|
|
1468
1428
|
}, [
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
(
|
|
1474
|
-
key:
|
|
1429
|
+
o.title ? (s(), i("h3", qs, x(o.title), 1)) : b("", !0),
|
|
1430
|
+
o.view === "table" ? (s(), i("div", Gs, [
|
|
1431
|
+
t("table", Ks, [
|
|
1432
|
+
t("tbody", Zs, [
|
|
1433
|
+
(s(!0), i(I, null, E(o.items, (n) => (s(), i("tr", {
|
|
1434
|
+
key: n.id || n.label
|
|
1475
1435
|
}, [
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1436
|
+
t("td", Js, [
|
|
1437
|
+
t("div", Xs, [
|
|
1438
|
+
n.icon ? (s(), i("i", {
|
|
1479
1439
|
key: 0,
|
|
1480
|
-
class: D([
|
|
1481
|
-
}, null, 2)) :
|
|
1482
|
-
|
|
1483
|
-
|
|
1440
|
+
class: D([n.icon, "text-gray-500"])
|
|
1441
|
+
}, null, 2)) : b("", !0),
|
|
1442
|
+
F(" " + x(n.label) + " ", 1),
|
|
1443
|
+
n.tooltip ? (s(), i("span", {
|
|
1484
1444
|
key: 1,
|
|
1485
1445
|
class: "text-gray-400 cursor-help",
|
|
1486
|
-
title:
|
|
1487
|
-
},
|
|
1488
|
-
|
|
1489
|
-
]), 8,
|
|
1446
|
+
title: n.tooltip
|
|
1447
|
+
}, [...e[0] || (e[0] = [
|
|
1448
|
+
t("i", { class: "fas fa-info-circle text-xs" }, null, -1)
|
|
1449
|
+
])], 8, Qs)) : b("", !0)
|
|
1490
1450
|
])
|
|
1491
1451
|
]),
|
|
1492
|
-
|
|
1493
|
-
(
|
|
1452
|
+
t("td", Ys, [
|
|
1453
|
+
(s(), A(B(l(n)), { item: n }, null, 8, ["item"]))
|
|
1494
1454
|
])
|
|
1495
1455
|
]))), 128))
|
|
1496
1456
|
])
|
|
1497
1457
|
])
|
|
1498
|
-
])) :
|
|
1499
|
-
(
|
|
1500
|
-
key:
|
|
1458
|
+
])) : o.view === "grid" ? (s(), i("div", eo, [
|
|
1459
|
+
(s(!0), i(I, null, E(o.items, (n) => (s(), i("div", {
|
|
1460
|
+
key: n.id || n.label,
|
|
1501
1461
|
class: "description-item-card bg-white border border-gray-200 rounded-lg p-4"
|
|
1502
1462
|
}, [
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
class: D([
|
|
1463
|
+
t("div", to, [
|
|
1464
|
+
n.icon ? (s(), i("div", so, [
|
|
1465
|
+
t("i", {
|
|
1466
|
+
class: D([n.icon, "text-gray-500 text-lg"])
|
|
1507
1467
|
}, null, 2)
|
|
1508
|
-
])) :
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1468
|
+
])) : b("", !0),
|
|
1469
|
+
t("div", oo, [
|
|
1470
|
+
t("div", no, [
|
|
1471
|
+
t("h4", io, x(n.label), 1),
|
|
1472
|
+
n.tooltip ? (s(), i("span", {
|
|
1513
1473
|
key: 0,
|
|
1514
1474
|
class: "text-gray-400 cursor-help",
|
|
1515
|
-
title:
|
|
1516
|
-
},
|
|
1517
|
-
|
|
1518
|
-
]), 8,
|
|
1475
|
+
title: n.tooltip
|
|
1476
|
+
}, [...e[1] || (e[1] = [
|
|
1477
|
+
t("i", { class: "fas fa-info-circle text-xs" }, null, -1)
|
|
1478
|
+
])], 8, lo)) : b("", !0)
|
|
1519
1479
|
]),
|
|
1520
|
-
(
|
|
1480
|
+
(s(), A(B(l(n)), { item: n }, null, 8, ["item"]))
|
|
1521
1481
|
])
|
|
1522
1482
|
])
|
|
1523
1483
|
]))), 128))
|
|
1524
|
-
])) : (
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
(
|
|
1528
|
-
key:
|
|
1484
|
+
])) : (s(), i("div", ao, [
|
|
1485
|
+
t("table", ro, [
|
|
1486
|
+
t("tbody", co, [
|
|
1487
|
+
(s(!0), i(I, null, E(o.items, (n) => (s(), i("tr", {
|
|
1488
|
+
key: n.id || n.label
|
|
1529
1489
|
}, [
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1490
|
+
t("td", uo, [
|
|
1491
|
+
t("div", po, [
|
|
1492
|
+
n.icon ? (s(), i("i", {
|
|
1533
1493
|
key: 0,
|
|
1534
|
-
class: D([
|
|
1535
|
-
}, null, 2)) :
|
|
1536
|
-
|
|
1537
|
-
|
|
1494
|
+
class: D([n.icon, "text-gray-500"])
|
|
1495
|
+
}, null, 2)) : b("", !0),
|
|
1496
|
+
F(" " + x(n.label) + " ", 1),
|
|
1497
|
+
n.tooltip ? (s(), i("span", {
|
|
1538
1498
|
key: 1,
|
|
1539
1499
|
class: "text-gray-400 cursor-help",
|
|
1540
|
-
title:
|
|
1541
|
-
},
|
|
1542
|
-
|
|
1543
|
-
]), 8,
|
|
1500
|
+
title: n.tooltip
|
|
1501
|
+
}, [...e[2] || (e[2] = [
|
|
1502
|
+
t("i", { class: "fas fa-info-circle text-xs" }, null, -1)
|
|
1503
|
+
])], 8, mo)) : b("", !0)
|
|
1544
1504
|
])
|
|
1545
1505
|
]),
|
|
1546
|
-
|
|
1547
|
-
(
|
|
1506
|
+
t("td", go, [
|
|
1507
|
+
(s(), A(B(l(n)), { item: n }, null, 8, ["item"]))
|
|
1548
1508
|
])
|
|
1549
1509
|
]))), 128))
|
|
1550
1510
|
])
|
|
1551
1511
|
])
|
|
1552
1512
|
]))
|
|
1553
|
-
], 14,
|
|
1513
|
+
], 14, Ws));
|
|
1554
1514
|
}
|
|
1555
|
-
}), Ce = /* @__PURE__ */
|
|
1515
|
+
}), Ce = /* @__PURE__ */ W(ho, [["__scopeId", "data-v-36d43e50"]]), fo = {
|
|
1556
1516
|
draw: {
|
|
1557
1517
|
toolbar: {
|
|
1558
1518
|
actions: {
|
|
@@ -1660,24 +1620,24 @@ const Nt = { class: "space-y-0.5" }, Rt = ["onClick"], Ut = ["onClick"], Pt = {
|
|
|
1660
1620
|
}
|
|
1661
1621
|
}
|
|
1662
1622
|
};
|
|
1663
|
-
function
|
|
1664
|
-
return
|
|
1623
|
+
function yo(a) {
|
|
1624
|
+
return a ? a.type === "FeatureCollection" || a.type === "Feature" ? a : a.geom ? {
|
|
1665
1625
|
type: "Feature",
|
|
1666
1626
|
geometry: {
|
|
1667
|
-
type:
|
|
1668
|
-
coordinates:
|
|
1627
|
+
type: a.geom.type,
|
|
1628
|
+
coordinates: a.geom.coordinates
|
|
1669
1629
|
},
|
|
1670
1630
|
properties: {}
|
|
1671
|
-
} :
|
|
1631
|
+
} : a.type && a.coordinates ? {
|
|
1672
1632
|
type: "Feature",
|
|
1673
|
-
geometry:
|
|
1633
|
+
geometry: a,
|
|
1674
1634
|
properties: {}
|
|
1675
1635
|
} : null : null;
|
|
1676
1636
|
}
|
|
1677
|
-
const
|
|
1637
|
+
const vo = { class: "relative min-h-[300px] h-full pb-[3.25rem]" }, bo = {
|
|
1678
1638
|
key: 1,
|
|
1679
1639
|
class: "bg-white absolute top-[10px] right-[10px] z-[500] border rounded-lg cursor-pointer"
|
|
1680
|
-
},
|
|
1640
|
+
}, xo = { class: "flex items-center justify-between p-2 border-b" }, ko = { class: "p-2 border-b" }, _o = { class: "flex items-center" }, wo = { class: "flex items-center" }, $o = { class: "flex items-center" }, Co = { class: "p-2" }, Mo = { class: "flex items-center" }, ie = /* @__PURE__ */ j({
|
|
1681
1641
|
__name: "MapWidget",
|
|
1682
1642
|
props: {
|
|
1683
1643
|
geom: {},
|
|
@@ -1685,10 +1645,10 @@ const _o = { class: "relative min-h-[300px] pb-[3.25rem]" }, wo = {
|
|
|
1685
1645
|
className: {},
|
|
1686
1646
|
style: {}
|
|
1687
1647
|
},
|
|
1688
|
-
setup(
|
|
1689
|
-
const
|
|
1690
|
-
let
|
|
1691
|
-
const
|
|
1648
|
+
setup(a) {
|
|
1649
|
+
const l = a, o = $(null);
|
|
1650
|
+
let e, n;
|
|
1651
|
+
const g = {
|
|
1692
1652
|
topo100: {
|
|
1693
1653
|
url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png"
|
|
1694
1654
|
},
|
|
@@ -1698,69 +1658,69 @@ const _o = { class: "relative min-h-[300px] pb-[3.25rem]" }, wo = {
|
|
|
1698
1658
|
osmb: {
|
|
1699
1659
|
url: "https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png"
|
|
1700
1660
|
}
|
|
1701
|
-
},
|
|
1702
|
-
let
|
|
1703
|
-
const v =
|
|
1704
|
-
function
|
|
1705
|
-
return new Promise((
|
|
1706
|
-
if (window.L && window.L.Draw) return
|
|
1707
|
-
const
|
|
1708
|
-
if (Array.from(document.styleSheets).some((
|
|
1709
|
-
const
|
|
1710
|
-
|
|
1711
|
-
},
|
|
1712
|
-
const
|
|
1713
|
-
if (
|
|
1714
|
-
|
|
1661
|
+
}, d = $("topo100");
|
|
1662
|
+
let y;
|
|
1663
|
+
const v = $(!0), p = $(!1);
|
|
1664
|
+
function r() {
|
|
1665
|
+
return new Promise((z, c) => {
|
|
1666
|
+
if (window.L && window.L.Draw) return z(0);
|
|
1667
|
+
const u = (k) => {
|
|
1668
|
+
if (Array.from(document.styleSheets).some((S) => S?.href?.includes(k))) return;
|
|
1669
|
+
const h = document.createElement("link");
|
|
1670
|
+
h.rel = "stylesheet", h.href = k, document.head.appendChild(h);
|
|
1671
|
+
}, T = (k) => new Promise((_, h) => {
|
|
1672
|
+
const S = Array.from(document.scripts).find((H) => H.src === k);
|
|
1673
|
+
if (S) {
|
|
1674
|
+
S.addEventListener("load", () => _()), S.addEventListener("error", (H) => h(H));
|
|
1715
1675
|
return;
|
|
1716
1676
|
}
|
|
1717
|
-
const
|
|
1718
|
-
|
|
1677
|
+
const P = document.createElement("script");
|
|
1678
|
+
P.src = k, P.async = !0, P.onload = () => _(), P.onerror = (H) => h(H), document.body.appendChild(P);
|
|
1719
1679
|
});
|
|
1720
|
-
|
|
1680
|
+
u("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), u("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), T("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => T("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() => z(0)).catch(c);
|
|
1721
1681
|
});
|
|
1722
1682
|
}
|
|
1723
1683
|
re(async () => {
|
|
1724
|
-
await
|
|
1725
|
-
const
|
|
1726
|
-
if (
|
|
1684
|
+
await r(), L.drawLocal = fo, e = L.map(o.value, { zoomControl: !1 }).setView([50, 30], 10), L.control.zoom({ position: "bottomright" }).addTo(e), y = L.tileLayer(g.topo100.url, { maxZoom: 19 }).addTo(e), d.value = "topo100", n = new L.FeatureGroup().addTo(e);
|
|
1685
|
+
const z = yo(l.geom);
|
|
1686
|
+
if (z) {
|
|
1727
1687
|
const c = [];
|
|
1728
|
-
L.geoJSON(
|
|
1688
|
+
L.geoJSON(z).eachLayer((u) => c.push(u)), c.length && n.addLayer(c[0]), n.toGeoJSON(), f();
|
|
1729
1689
|
}
|
|
1730
1690
|
});
|
|
1731
|
-
function
|
|
1732
|
-
const c =
|
|
1691
|
+
function f(z = 30) {
|
|
1692
|
+
const c = n.getLayers();
|
|
1733
1693
|
if (!c.length) return;
|
|
1734
|
-
const
|
|
1735
|
-
|
|
1694
|
+
const T = L.featureGroup(c).getBounds();
|
|
1695
|
+
T && T.isValid() && e.fitBounds(T, { padding: [z, z] });
|
|
1736
1696
|
}
|
|
1737
|
-
function
|
|
1738
|
-
|
|
1739
|
-
const c =
|
|
1740
|
-
|
|
1697
|
+
function m(z) {
|
|
1698
|
+
y && y.removeFrom(e);
|
|
1699
|
+
const c = g[z];
|
|
1700
|
+
y = L.tileLayer(c.url, c.options || {}).addTo(e), d.value = z;
|
|
1741
1701
|
}
|
|
1742
|
-
function
|
|
1743
|
-
|
|
1702
|
+
function C() {
|
|
1703
|
+
m(d.value);
|
|
1744
1704
|
}
|
|
1745
|
-
function
|
|
1746
|
-
|
|
1705
|
+
function O() {
|
|
1706
|
+
n && (v.value ? n.addTo(e) : n.removeFrom(e));
|
|
1747
1707
|
}
|
|
1748
|
-
return (
|
|
1749
|
-
|
|
1708
|
+
return (z, c) => (s(), i("div", vo, [
|
|
1709
|
+
t("div", {
|
|
1750
1710
|
ref_key: "mapContainer",
|
|
1751
|
-
ref:
|
|
1752
|
-
class: "w-full h-full"
|
|
1711
|
+
ref: o,
|
|
1712
|
+
class: "w-full h-full min-h-[300px]"
|
|
1753
1713
|
}, null, 512),
|
|
1754
|
-
|
|
1714
|
+
p.value ? b("", !0) : (s(), i("div", {
|
|
1755
1715
|
key: 0,
|
|
1756
|
-
onClick: c[0] || (c[0] = (
|
|
1716
|
+
onClick: c[0] || (c[0] = (u) => p.value = !0),
|
|
1757
1717
|
class: "z-[500] bg-white absolute top-[10px] right-[10px] p-2 border rounded-lg cursor-pointer"
|
|
1758
1718
|
}, " Шари ")),
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
c[7] || (c[7] =
|
|
1762
|
-
(
|
|
1763
|
-
onClick: c[1] || (c[1] = (
|
|
1719
|
+
p.value ? (s(), i("div", bo, [
|
|
1720
|
+
t("div", xo, [
|
|
1721
|
+
c[7] || (c[7] = t("div", null, "Шари", -1)),
|
|
1722
|
+
(s(), i("svg", {
|
|
1723
|
+
onClick: c[1] || (c[1] = (u) => p.value = !1),
|
|
1764
1724
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1765
1725
|
viewBox: "0 0 24 24",
|
|
1766
1726
|
fill: "none",
|
|
@@ -1769,92 +1729,288 @@ const _o = { class: "relative min-h-[300px] pb-[3.25rem]" }, wo = {
|
|
|
1769
1729
|
"stroke-linecap": "round",
|
|
1770
1730
|
"stroke-linejoin": "round",
|
|
1771
1731
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-x w-4 h-4"
|
|
1772
|
-
}, c[6] || (c[6] = [
|
|
1773
|
-
|
|
1732
|
+
}, [...c[6] || (c[6] = [
|
|
1733
|
+
t("path", {
|
|
1774
1734
|
stroke: "none",
|
|
1775
1735
|
d: "M0 0h24v24H0z",
|
|
1776
1736
|
fill: "none"
|
|
1777
1737
|
}, null, -1),
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
])))
|
|
1738
|
+
t("path", { d: "M18 6l-12 12" }, null, -1),
|
|
1739
|
+
t("path", { d: "M6 6l12 12" }, null, -1)
|
|
1740
|
+
])]))
|
|
1781
1741
|
]),
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1742
|
+
t("div", ko, [
|
|
1743
|
+
t("div", null, [
|
|
1744
|
+
t("label", _o, [
|
|
1745
|
+
R(t("input", {
|
|
1786
1746
|
type: "radio",
|
|
1787
1747
|
name: "base-layer",
|
|
1788
1748
|
value: "topo100",
|
|
1789
|
-
"onUpdate:modelValue": c[2] || (c[2] = (
|
|
1790
|
-
onChange:
|
|
1749
|
+
"onUpdate:modelValue": c[2] || (c[2] = (u) => d.value = u),
|
|
1750
|
+
onChange: C
|
|
1791
1751
|
}, null, 544), [
|
|
1792
|
-
[
|
|
1752
|
+
[Y, d.value]
|
|
1793
1753
|
]),
|
|
1794
|
-
c[8] || (c[8] =
|
|
1754
|
+
c[8] || (c[8] = t("span", { class: "ml-2" }, "Карта України", -1))
|
|
1795
1755
|
])
|
|
1796
1756
|
]),
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1757
|
+
t("div", null, [
|
|
1758
|
+
t("label", wo, [
|
|
1759
|
+
R(t("input", {
|
|
1800
1760
|
type: "radio",
|
|
1801
1761
|
name: "base-layer",
|
|
1802
1762
|
value: "orto10",
|
|
1803
|
-
"onUpdate:modelValue": c[3] || (c[3] = (
|
|
1804
|
-
onChange:
|
|
1763
|
+
"onUpdate:modelValue": c[3] || (c[3] = (u) => d.value = u),
|
|
1764
|
+
onChange: C
|
|
1805
1765
|
}, null, 544), [
|
|
1806
|
-
[
|
|
1766
|
+
[Y, d.value]
|
|
1807
1767
|
]),
|
|
1808
|
-
c[9] || (c[9] =
|
|
1768
|
+
c[9] || (c[9] = t("span", { class: "ml-2" }, "Ortophoto 1:10К", -1))
|
|
1809
1769
|
])
|
|
1810
1770
|
]),
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1771
|
+
t("div", null, [
|
|
1772
|
+
t("label", $o, [
|
|
1773
|
+
R(t("input", {
|
|
1814
1774
|
type: "radio",
|
|
1815
1775
|
name: "base-layer",
|
|
1816
1776
|
value: "osmb",
|
|
1817
|
-
"onUpdate:modelValue": c[4] || (c[4] = (
|
|
1818
|
-
onChange:
|
|
1777
|
+
"onUpdate:modelValue": c[4] || (c[4] = (u) => d.value = u),
|
|
1778
|
+
onChange: C
|
|
1819
1779
|
}, null, 544), [
|
|
1820
|
-
[
|
|
1780
|
+
[Y, d.value]
|
|
1821
1781
|
]),
|
|
1822
|
-
c[10] || (c[10] =
|
|
1782
|
+
c[10] || (c[10] = t("span", { class: "ml-2" }, "Open Street Map", -1))
|
|
1823
1783
|
])
|
|
1824
1784
|
])
|
|
1825
1785
|
]),
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1786
|
+
t("div", Co, [
|
|
1787
|
+
t("label", Mo, [
|
|
1788
|
+
R(t("input", {
|
|
1829
1789
|
type: "checkbox",
|
|
1830
|
-
"onUpdate:modelValue": c[5] || (c[5] = (
|
|
1831
|
-
onChange:
|
|
1790
|
+
"onUpdate:modelValue": c[5] || (c[5] = (u) => v.value = u),
|
|
1791
|
+
onChange: O
|
|
1832
1792
|
}, null, 544), [
|
|
1833
1793
|
[Te, v.value]
|
|
1834
1794
|
]),
|
|
1835
|
-
c[11] || (c[11] =
|
|
1795
|
+
c[11] || (c[11] = t("span", { class: "ml-2" }, " Показати геометрію ", -1))
|
|
1796
|
+
])
|
|
1797
|
+
])
|
|
1798
|
+
])) : b("", !0)
|
|
1799
|
+
]));
|
|
1800
|
+
}
|
|
1801
|
+
}), Lo = { class: "flex justify-between items-center mb-[15px]" }, To = { class: "font-semibold text-[16px]" }, Do = { class: "overflow-x-auto" }, Io = { 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" }, jo = { class: "text-left font-medium text-gray-700" }, Vo = { class: "py-2 min-w-[200px]" }, Ao = {
|
|
1802
|
+
key: 0,
|
|
1803
|
+
class: "py-2 min-w-[200px]"
|
|
1804
|
+
}, zo = { class: "divide-y divide-gray-200" }, Ho = { class: "bg-white odd:bg-gray-50" }, Eo = { class: "py-2 pr-5" }, Fo = ["href"], So = { class: "py-2 pr-5 gap-2 inline-flex" }, No = ["onClick"], Oo = ["onClick"], Bo = /* @__PURE__ */ j({
|
|
1805
|
+
__name: "TableWidget",
|
|
1806
|
+
props: {
|
|
1807
|
+
name: {},
|
|
1808
|
+
label: {},
|
|
1809
|
+
component: {},
|
|
1810
|
+
slot: {},
|
|
1811
|
+
col: {},
|
|
1812
|
+
width: {},
|
|
1813
|
+
html: {},
|
|
1814
|
+
title: {},
|
|
1815
|
+
type: {},
|
|
1816
|
+
token: {},
|
|
1817
|
+
count: {},
|
|
1818
|
+
items: {}
|
|
1819
|
+
},
|
|
1820
|
+
setup(a) {
|
|
1821
|
+
const l = De(), o = $([]), e = $([]), n = a, g = $([]), d = $(""), y = $("");
|
|
1822
|
+
async function v() {
|
|
1823
|
+
const c = await fetch("/api/data/" + n.token).then((u) => u.json());
|
|
1824
|
+
o.value = c.rows, e.value = c.columns, g.value = c.actions, d.value = c.form, y.value = c.addToken;
|
|
1825
|
+
}
|
|
1826
|
+
const { $notify: p = console.log, $confirm: r, $form: f } = l?.appContext?.config?.globalProperties || {};
|
|
1827
|
+
async function m(c) {
|
|
1828
|
+
await f({ token: c.token }), v();
|
|
1829
|
+
}
|
|
1830
|
+
function C() {
|
|
1831
|
+
f({ token: y.value });
|
|
1832
|
+
}
|
|
1833
|
+
function O(c) {
|
|
1834
|
+
r({
|
|
1835
|
+
title: "Підтвердіть дію",
|
|
1836
|
+
type: "error",
|
|
1837
|
+
message: "Ви впевненні що бажаєте видалити даний рядок?",
|
|
1838
|
+
onConfirm: async () => {
|
|
1839
|
+
const u = await fetch(`/api/table/${c.token}`, { method: "DELETE" });
|
|
1840
|
+
if (!u.ok) {
|
|
1841
|
+
const { error: T, code: k } = await u.json();
|
|
1842
|
+
p({ title: "Помилка", type: "warning", message: T });
|
|
1843
|
+
return;
|
|
1844
|
+
}
|
|
1845
|
+
p({ title: "Видаленно", message: "Успішно видалено" }), await v();
|
|
1846
|
+
}
|
|
1847
|
+
});
|
|
1848
|
+
}
|
|
1849
|
+
re(async () => {
|
|
1850
|
+
await v();
|
|
1851
|
+
});
|
|
1852
|
+
function z(c, u) {
|
|
1853
|
+
return u.format?.toLowerCase() === "text" ? c[u.name] : c[u.name + "_data"] ?? c[u.name + "_text"] ?? "-";
|
|
1854
|
+
}
|
|
1855
|
+
return (c, u) => (s(), i("div", null, [
|
|
1856
|
+
t("div", Lo, [
|
|
1857
|
+
t("div", To, x(c.title), 1),
|
|
1858
|
+
g.value.includes("add") && y.value ? (s(), i("button", {
|
|
1859
|
+
key: 0,
|
|
1860
|
+
onClick: C,
|
|
1861
|
+
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"
|
|
1862
|
+
}, "Додати")) : b("", !0)
|
|
1863
|
+
]),
|
|
1864
|
+
t("div", Do, [
|
|
1865
|
+
t("table", Io, [
|
|
1866
|
+
t("thead", jo, [
|
|
1867
|
+
t("tr", null, [
|
|
1868
|
+
(s(!0), i(I, null, E(e.value, (T) => (s(), i("th", Vo, x(T.ua), 1))), 256)),
|
|
1869
|
+
g.value.includes("edit") ? (s(), i("th", Ao, " Дії ")) : b("", !0)
|
|
1870
|
+
])
|
|
1871
|
+
]),
|
|
1872
|
+
t("tbody", zo, [
|
|
1873
|
+
(s(!0), i(I, null, E(o.value, (T) => (s(), i("tr", Ho, [
|
|
1874
|
+
(s(!0), i(I, null, E(e.value, (k) => (s(), i("td", Eo, [
|
|
1875
|
+
k.link ? (s(), i("a", {
|
|
1876
|
+
key: 0,
|
|
1877
|
+
href: k.link.replace("{{id}}", T.id),
|
|
1878
|
+
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"
|
|
1879
|
+
}, x(z(T, k)), 9, Fo)) : (s(), i(I, { key: 1 }, [
|
|
1880
|
+
F(x(z(T, k)), 1)
|
|
1881
|
+
], 64))
|
|
1882
|
+
]))), 256)),
|
|
1883
|
+
t("td", So, [
|
|
1884
|
+
T.token ? (s(), i("button", {
|
|
1885
|
+
key: 0,
|
|
1886
|
+
onClick: (k) => m(T),
|
|
1887
|
+
class: "inline-flex items-center justify-center bg-white border rounded-md size-7 gap-x-2 hover:bg-gray-100"
|
|
1888
|
+
}, [...u[0] || (u[0] = [
|
|
1889
|
+
t("svg", {
|
|
1890
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1891
|
+
width: "12px",
|
|
1892
|
+
height: "24",
|
|
1893
|
+
viewBox: "0 0 24 24",
|
|
1894
|
+
fill: "none",
|
|
1895
|
+
stroke: "currentColor",
|
|
1896
|
+
"stroke-width": "2",
|
|
1897
|
+
"stroke-linecap": "round",
|
|
1898
|
+
"stroke-linejoin": "round"
|
|
1899
|
+
}, [
|
|
1900
|
+
t("path", {
|
|
1901
|
+
d: "M20,16v4a2,2,0,0,1-2,2H4a2,2,0,0,1-2-2V6A2,2,0,0,1,4,4H8",
|
|
1902
|
+
fill: "none",
|
|
1903
|
+
stroke: "#000000",
|
|
1904
|
+
"stroke-linecap": "round",
|
|
1905
|
+
"stroke-linejoin": "round",
|
|
1906
|
+
"stroke-width": "2"
|
|
1907
|
+
}),
|
|
1908
|
+
t("polygon", {
|
|
1909
|
+
fill: "none",
|
|
1910
|
+
points: "12.5 15.8 22 6.2 17.8 2 8.3 11.5 8 16 12.5 15.8",
|
|
1911
|
+
stroke: "#000000",
|
|
1912
|
+
"stroke-linecap": "round",
|
|
1913
|
+
"stroke-linejoin": "round",
|
|
1914
|
+
"stroke-width": "2"
|
|
1915
|
+
})
|
|
1916
|
+
], -1)
|
|
1917
|
+
])], 8, No)) : b("", !0),
|
|
1918
|
+
T.token ? (s(), i("button", {
|
|
1919
|
+
key: 1,
|
|
1920
|
+
onClick: (k) => O(T),
|
|
1921
|
+
class: "inline-flex items-center justify-center bg-white border rounded-md size-7 gap-x-2 hover:bg-gray-100"
|
|
1922
|
+
}, [...u[1] || (u[1] = [
|
|
1923
|
+
Ie('<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)
|
|
1924
|
+
])], 8, Oo)) : b("", !0)
|
|
1925
|
+
])
|
|
1926
|
+
]))), 256))
|
|
1836
1927
|
])
|
|
1837
1928
|
])
|
|
1838
|
-
])
|
|
1929
|
+
])
|
|
1839
1930
|
]));
|
|
1840
1931
|
}
|
|
1841
|
-
}),
|
|
1842
|
-
"vs-widget-map":
|
|
1932
|
+
}), Me = {
|
|
1933
|
+
"vs-widget-map": ie,
|
|
1843
1934
|
"vs-widget-comments": se,
|
|
1844
1935
|
"vs-widget-history": oe,
|
|
1845
|
-
"vs-widget-gallery":
|
|
1846
|
-
"vs-widget-file":
|
|
1847
|
-
"vs-widget-list": Ce
|
|
1848
|
-
|
|
1936
|
+
"vs-widget-gallery": ne,
|
|
1937
|
+
"vs-widget-file": $e,
|
|
1938
|
+
"vs-widget-list": Ce,
|
|
1939
|
+
"vs-widget-table": Bo
|
|
1940
|
+
}, Po = {
|
|
1849
1941
|
key: 0,
|
|
1850
|
-
class: "
|
|
1851
|
-
},
|
|
1852
|
-
key: 1,
|
|
1853
|
-
class: "p-1"
|
|
1854
|
-
}, Eo = { class: "grid grid-cols-12 gap-4" }, Oo = {
|
|
1942
|
+
class: "mb-4 pb-2 border-b border-gray-200"
|
|
1943
|
+
}, Ro = { class: "text-lg font-semibold text-gray-900" }, Uo = ["innerHTML"], Wo = {
|
|
1855
1944
|
key: 0,
|
|
1856
1945
|
class: "mb-4 pb-2 border-b border-gray-200"
|
|
1857
|
-
},
|
|
1946
|
+
}, qo = { class: "text-lg font-semibold text-gray-900" }, Go = ["innerHTML"], Le = /* @__PURE__ */ j({
|
|
1947
|
+
__name: "CardItem",
|
|
1948
|
+
props: {
|
|
1949
|
+
items: {},
|
|
1950
|
+
type: {},
|
|
1951
|
+
col: {},
|
|
1952
|
+
data: {},
|
|
1953
|
+
html: {},
|
|
1954
|
+
title: {},
|
|
1955
|
+
name: {},
|
|
1956
|
+
label: {},
|
|
1957
|
+
component: {},
|
|
1958
|
+
slot: {},
|
|
1959
|
+
id: {},
|
|
1960
|
+
className: {},
|
|
1961
|
+
style: {}
|
|
1962
|
+
},
|
|
1963
|
+
setup(a) {
|
|
1964
|
+
const l = a, o = N(() => l.col ? {
|
|
1965
|
+
[`lg:col-span-${l.col}`]: !0
|
|
1966
|
+
} : {});
|
|
1967
|
+
function e(g) {
|
|
1968
|
+
return Me[g] || g;
|
|
1969
|
+
}
|
|
1970
|
+
const n = N(() => {
|
|
1971
|
+
const g = {};
|
|
1972
|
+
return g.col && (g.col = g.col), g;
|
|
1973
|
+
});
|
|
1974
|
+
return (g, d) => (s(), i("div", {
|
|
1975
|
+
class: D(["w-full bg-gray-50 rounded-lg p-4 col-span-12", o.value])
|
|
1976
|
+
}, [
|
|
1977
|
+
g.title ? (s(), i("div", Po, [
|
|
1978
|
+
t("h3", Ro, x(g.title), 1)
|
|
1979
|
+
])) : b("", !0),
|
|
1980
|
+
g.html ? (s(), i("div", {
|
|
1981
|
+
key: 1,
|
|
1982
|
+
innerHTML: g.html,
|
|
1983
|
+
class: "text-gray-900 leading-relaxed [&>h1]:font-semibold [&>h1]:text-gray-900 [&>h1]:mb-2 [&>h2]:font-semibold [&>h2]:text-gray-900 [&>h2]:mb-2 [&>h3]:font-semibold [&>h3]:text-gray-900 [&>h3]:mb-2 [&>h4]:font-semibold [&>h4]:text-gray-900 [&>h4]:mb-2 [&>h5]:font-semibold [&>h5]:text-gray-900 [&>h5]:mb-2 [&>h6]:font-semibold [&>h6]:text-gray-900 [&>h6]:mb-2 [&>p]:mb-3 [&>ul]:mb-3 [&>ul]:pl-5 [&>ol]:mb-3 [&>ol]:pl-5 [&>li]:mb-1"
|
|
1984
|
+
}, null, 8, Uo)) : g.type?.includes("tabs") ? (s(), A(le, {
|
|
1985
|
+
key: 2,
|
|
1986
|
+
view: "tab",
|
|
1987
|
+
panels: g.items,
|
|
1988
|
+
data: g.data
|
|
1989
|
+
}, null, 8, ["panels", "data"])) : (s(!0), i(I, { key: 3 }, E(g.items, (y) => (s(), i(I, null, [
|
|
1990
|
+
y.title || y.label ? (s(), i("div", Wo, [
|
|
1991
|
+
t("h3", qo, x(y.title || y.label), 1)
|
|
1992
|
+
])) : b("", !0),
|
|
1993
|
+
y.html ? (s(), i("div", {
|
|
1994
|
+
key: 1,
|
|
1995
|
+
innerHTML: y.html,
|
|
1996
|
+
class: "text-gray-900 leading-relaxed [&>h1]:font-semibold [&>h1]:text-gray-900 [&>h1]:mb-2 [&>h2]:font-semibold [&>h2]:text-gray-900 [&>h2]:mb-2 [&>h3]:font-semibold [&>h3]:text-gray-900 [&>h3]:mb-2 [&>h4]:font-semibold [&>h4]:text-gray-900 [&>h4]:mb-2 [&>h5]:font-semibold [&>h5]:text-gray-900 [&>h5]:mb-2 [&>h6]:font-semibold [&>h6]:text-gray-900 [&>h6]:mb-2 [&>p]:mb-3 [&>ul]:mb-3 [&>ul]:pl-5 [&>ol]:mb-3 [&>ol]:pl-5 [&>li]:mb-1"
|
|
1997
|
+
}, null, 8, Go)) : y.component ? (s(), A(B(e(y.component)), K({
|
|
1998
|
+
key: 2,
|
|
1999
|
+
ref_for: !0
|
|
2000
|
+
}, { ...n.value, ...g.data }, { class: "w-full" }), null, 16)) : q(g.$slots, "default", { key: 3 })
|
|
2001
|
+
], 64))), 256))
|
|
2002
|
+
], 2));
|
|
2003
|
+
}
|
|
2004
|
+
}), Ko = { class: "md:flex gap-[20px]" }, Zo = {
|
|
2005
|
+
key: 0,
|
|
2006
|
+
class: "col-span-4"
|
|
2007
|
+
}, Jo = ["innerHTML"], Xo = {
|
|
2008
|
+
key: 1,
|
|
2009
|
+
class: "overflow-hidden w-full"
|
|
2010
|
+
}, Qo = { class: "flex border-b border-gray-200 bg-gray-50" }, Yo = ["onClick"], en = { class: "p-1" }, tn = ["innerHTML"], sn = {
|
|
2011
|
+
key: 2,
|
|
2012
|
+
class: "p-1 w-full"
|
|
2013
|
+
}, on = { class: "grid grid-cols-12 gap-4" }, le = /* @__PURE__ */ j({
|
|
1858
2014
|
__name: "Card",
|
|
1859
2015
|
props: {
|
|
1860
2016
|
panels: { default: () => [] },
|
|
@@ -1862,161 +2018,190 @@ const _o = { class: "relative min-h-[300px] pb-[3.25rem]" }, wo = {
|
|
|
1862
2018
|
view: { default: "plain" },
|
|
1863
2019
|
classWrapper: { default: "" },
|
|
1864
2020
|
classPanel: {},
|
|
1865
|
-
normalizeTabs: { type: Boolean, default: !
|
|
2021
|
+
normalizeTabs: { type: Boolean, default: !0 },
|
|
1866
2022
|
id: {},
|
|
1867
2023
|
className: {},
|
|
1868
2024
|
style: {}
|
|
1869
2025
|
},
|
|
1870
|
-
setup(
|
|
1871
|
-
const
|
|
1872
|
-
function
|
|
1873
|
-
return
|
|
2026
|
+
setup(a) {
|
|
2027
|
+
const l = a, o = $(0), e = $([]);
|
|
2028
|
+
function n(r) {
|
|
2029
|
+
return Me[r] || r;
|
|
1874
2030
|
}
|
|
1875
|
-
function
|
|
1876
|
-
|
|
1877
|
-
for (const p of d) {
|
|
1878
|
-
if (!p?.items) {
|
|
1879
|
-
y.push(p);
|
|
1880
|
-
continue;
|
|
1881
|
-
}
|
|
1882
|
-
if (p.items.length === 1) {
|
|
1883
|
-
let b = p.items[0];
|
|
1884
|
-
delete p.items, b = { ...p, ...b }, y.push(b);
|
|
1885
|
-
} else {
|
|
1886
|
-
const b = p;
|
|
1887
|
-
b.component = "Card", p.type && (b.view = p.type.includes("tab") ? "tab" : "plain"), b.panels = p.items, b.data = i.data, b.normalizeTabs = !1, y.push(b);
|
|
1888
|
-
}
|
|
1889
|
-
}
|
|
1890
|
-
return y;
|
|
2031
|
+
function g(r) {
|
|
2032
|
+
return e.value = r.filter((f) => f.type === "pin"), r.filter((f) => f.type !== "pin");
|
|
1891
2033
|
}
|
|
1892
|
-
const
|
|
1893
|
-
[`view-${
|
|
1894
|
-
})),
|
|
1895
|
-
const
|
|
1896
|
-
return
|
|
1897
|
-
}
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
return (d, y) => (a(), r("div", {
|
|
1901
|
-
class: D(m.value + d.classWrapper)
|
|
2034
|
+
const d = N(() => l.panels && l.panels.length > 0 ? l.normalizeTabs ? g(l.panels) : l.panels : l.data && Array.isArray(l.data) ? l.data.filter((f) => f.type === "tabs")[0]?.items || [] : []), y = N(() => l.panels && l.panels.length > 0 ? l.normalizeTabs ? g(l.panels) : l.panels : l.data && Array.isArray(l.data) ? l.data : []), v = N(() => ({
|
|
2035
|
+
[`view-${l.view}`]: !0
|
|
2036
|
+
})), p = (r) => {
|
|
2037
|
+
const f = {};
|
|
2038
|
+
return r.count && (f.count = r.count), r.col && (f.col = r.col), r.html && (f.html = r.html), r.title && (f.title = r.title), r.type && (f.type = r.type), r.token && (f.token = r.token), l.data && (f.data = l.data), f;
|
|
2039
|
+
};
|
|
2040
|
+
return (r, f) => (s(), i("div", {
|
|
2041
|
+
class: D(r.classWrapper || v.value)
|
|
1902
2042
|
}, [
|
|
1903
|
-
|
|
1904
|
-
e("div",
|
|
1905
|
-
(
|
|
1906
|
-
key:
|
|
1907
|
-
|
|
1908
|
-
class: D([
|
|
1909
|
-
"px-4 py-3 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-100 transition-colors",
|
|
1910
|
-
{ "text-blue-600 bg-white border-b-2 border-blue-600": n.value === b }
|
|
1911
|
-
])
|
|
1912
|
-
}, k(p.title || p.label || p.name || `Tab ${b + 1}`), 11, Fo))), 128))
|
|
1913
|
-
]),
|
|
1914
|
-
e("div", Ho, [
|
|
1915
|
-
(a(!0), r(A, null, S(f.value, (p, b) => U((a(), r("div", {
|
|
1916
|
-
key: p.name || b,
|
|
1917
|
-
class: D([
|
|
1918
|
-
d.classPanel || "w-full border-gray-100",
|
|
1919
|
-
`col-span-${p.col || 12}`
|
|
1920
|
-
])
|
|
2043
|
+
t("div", Ko, [
|
|
2044
|
+
e.value.length !== 0 ? (s(), i("div", Zo, [
|
|
2045
|
+
(s(!0), i(I, null, E(e.value[0].items, (m, C) => (s(), i("div", {
|
|
2046
|
+
key: m.name || C,
|
|
2047
|
+
class: "w-full bg-gray-50 rounded-lg p-4 col-span-12 w-full m-1 mb-3"
|
|
1921
2048
|
}, [
|
|
1922
|
-
|
|
2049
|
+
m.html ? (s(), i("div", {
|
|
1923
2050
|
key: 0,
|
|
1924
|
-
innerHTML:
|
|
1925
|
-
class: "text-gray-900 leading-relaxed
|
|
1926
|
-
}, null, 8,
|
|
1927
|
-
key: 1,
|
|
1928
|
-
item: p,
|
|
1929
|
-
data: d.data
|
|
1930
|
-
}) : p.component ? (a(), j(N(p.component), te({
|
|
1931
|
-
key: 2,
|
|
1932
|
-
ref_for: !0
|
|
1933
|
-
}, p.component === "Card" ? p : v(p), { class: "w-full h-full" }), null, 16)) : G(d.$slots, p.slot || `tab-${b}`, {
|
|
1934
|
-
key: 3,
|
|
1935
|
-
item: p,
|
|
1936
|
-
data: d.data
|
|
1937
|
-
})
|
|
1938
|
-
], 2)), [
|
|
1939
|
-
[Ie, n.value === b]
|
|
1940
|
-
])), 128))
|
|
1941
|
-
])
|
|
1942
|
-
])) : (a(), r("div", So, [
|
|
1943
|
-
e("div", Eo, [
|
|
1944
|
-
(a(!0), r(A, null, S(o.value, (p, b) => (a(), r("div", {
|
|
1945
|
-
key: p.name || b,
|
|
1946
|
-
class: D([
|
|
1947
|
-
d.classPanel || "bg-gray-50 rounded-lg p-4 border-gray-100",
|
|
1948
|
-
`col-span-${p.col || 12}`
|
|
1949
|
-
]),
|
|
1950
|
-
style: R(g(p))
|
|
1951
|
-
}, [
|
|
1952
|
-
p.title || p.label ? (a(), r("div", Oo, [
|
|
1953
|
-
e("h3", Bo, k(p.title || p.label), 1)
|
|
1954
|
-
])) : $("", !0),
|
|
1955
|
-
p.html ? (a(), r("div", {
|
|
2051
|
+
innerHTML: m.html,
|
|
2052
|
+
class: "text-gray-900 leading-relaxed"
|
|
2053
|
+
}, null, 8, Jo)) : m.component ? (s(), A(B(n(m.component)), K({
|
|
1956
2054
|
key: 1,
|
|
1957
|
-
innerHTML: p.html,
|
|
1958
|
-
class: "text-gray-900 leading-relaxed [&>h1]:font-semibold [&>h1]:text-gray-900 [&>h1]:mb-2 [&>h2]:font-semibold [&>h2]:text-gray-900 [&>h2]:mb-2 [&>h3]:font-semibold [&>h3]:text-gray-900 [&>h3]:mb-2 [&>h4]:font-semibold [&>h4]:text-gray-900 [&>h4]:mb-2 [&>h5]:font-semibold [&>h5]:text-gray-900 [&>h5]:mb-2 [&>h6]:font-semibold [&>h6]:text-gray-900 [&>h6]:mb-2 [&>p]:mb-3 [&>ul]:mb-3 [&>ul]:pl-5 [&>ol]:mb-3 [&>ol]:pl-5 [&>li]:mb-1"
|
|
1959
|
-
}, null, 8, No)) : d.$slots[`panel-${b}`] ? G(d.$slots, `panel-${b}`, {
|
|
1960
|
-
key: 2,
|
|
1961
|
-
item: p,
|
|
1962
|
-
data: d.data
|
|
1963
|
-
}) : p.component ? (a(), j(N(t(p.component)), te({
|
|
1964
|
-
key: 3,
|
|
1965
2055
|
ref_for: !0
|
|
1966
|
-
},
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
2056
|
+
}, m.component === "Card" ? m : p(m), {
|
|
2057
|
+
id: r.data.id,
|
|
2058
|
+
class: "w-full h-full"
|
|
2059
|
+
}), null, 16, ["id"])) : b("", !0)
|
|
2060
|
+
]))), 128))
|
|
2061
|
+
])) : b("", !0),
|
|
2062
|
+
r.view === "tab" ? (s(), i("div", Xo, [
|
|
2063
|
+
t("div", Qo, [
|
|
2064
|
+
(s(!0), i(I, null, E(d.value, (m, C) => (s(), i("button", {
|
|
2065
|
+
key: m.name || C,
|
|
2066
|
+
onClick: (O) => o.value = C,
|
|
2067
|
+
class: D([
|
|
2068
|
+
"px-4 py-3 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-100 transition-colors",
|
|
2069
|
+
{ "text-blue-600 bg-white border-b-2 border-blue-600": o.value === C }
|
|
2070
|
+
])
|
|
2071
|
+
}, x(m.title || m.label || m.name || `Tab ${C + 1}`), 11, Yo))), 128))
|
|
2072
|
+
]),
|
|
2073
|
+
t("div", en, [
|
|
2074
|
+
(s(!0), i(I, null, E(d.value, (m, C) => R((s(), i("div", {
|
|
2075
|
+
key: m.name || C,
|
|
2076
|
+
class: D([
|
|
2077
|
+
r.classPanel || "w-full border-gray-100 py-2",
|
|
2078
|
+
`col-span-${m.col || 12}`
|
|
2079
|
+
])
|
|
2080
|
+
}, [
|
|
2081
|
+
m.html ? (s(), i("div", {
|
|
2082
|
+
key: 0,
|
|
2083
|
+
innerHTML: m.html,
|
|
2084
|
+
class: "text-gray-900 leading-relaxed"
|
|
2085
|
+
}, null, 8, tn)) : r.$slots[`tab-${C}`] ? q(r.$slots, `tab-${C}`, {
|
|
2086
|
+
key: 1,
|
|
2087
|
+
item: m,
|
|
2088
|
+
data: r.data
|
|
2089
|
+
}) : m.component || m.name ? (s(), A(B(n(m.component || m.name)), K({
|
|
2090
|
+
key: 2,
|
|
2091
|
+
ref_for: !0
|
|
2092
|
+
}, m.component === "Card" ? m : p(m), {
|
|
2093
|
+
id: r.data.id,
|
|
2094
|
+
class: "w-full h-full"
|
|
2095
|
+
}), null, 16, ["id"])) : q(r.$slots, m.slot || `tab-${C}`, {
|
|
2096
|
+
key: 3,
|
|
2097
|
+
item: m,
|
|
2098
|
+
data: r.data
|
|
2099
|
+
})
|
|
2100
|
+
], 2)), [
|
|
2101
|
+
[je, o.value === C]
|
|
2102
|
+
])), 128))
|
|
2103
|
+
])
|
|
2104
|
+
])) : (s(), i("div", sn, [
|
|
2105
|
+
t("div", on, [
|
|
2106
|
+
(s(!0), i(I, null, E(y.value, (m, C) => (s(), i(I, {
|
|
2107
|
+
key: m.name || C
|
|
2108
|
+
}, [
|
|
2109
|
+
r.$slots[`panel-${C}`] ? q(r.$slots, `panel-${C}`, {
|
|
2110
|
+
key: 0,
|
|
2111
|
+
item: m,
|
|
2112
|
+
data: r.data
|
|
2113
|
+
}) : m.items || m.html ? (s(), A(B(Le), K({
|
|
2114
|
+
key: 1,
|
|
2115
|
+
ref_for: !0
|
|
2116
|
+
}, p(m), {
|
|
2117
|
+
items: m.items,
|
|
2118
|
+
class: "w-full h-full"
|
|
2119
|
+
}), null, 16, ["items"])) : m.component ? (s(), A(B(n(m.component)), K({
|
|
2120
|
+
key: 2,
|
|
2121
|
+
ref_for: !0
|
|
2122
|
+
}, p(m), { class: "w-full h-full" }), null, 16)) : q(r.$slots, m.slot || `panel-${C}`, {
|
|
2123
|
+
key: 3,
|
|
2124
|
+
item: m,
|
|
2125
|
+
data: r.data
|
|
2126
|
+
})
|
|
2127
|
+
], 64))), 128))
|
|
2128
|
+
])
|
|
2129
|
+
]))
|
|
2130
|
+
])
|
|
1974
2131
|
], 2));
|
|
1975
2132
|
}
|
|
1976
|
-
}),
|
|
1977
|
-
__name: "
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
}
|
|
1994
|
-
const
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
}
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2133
|
+
}), nn = ["onClick"], ln = /* @__PURE__ */ j({
|
|
2134
|
+
__name: "CopyNotification",
|
|
2135
|
+
setup(a, { expose: l }) {
|
|
2136
|
+
const o = $([]);
|
|
2137
|
+
let e = 1;
|
|
2138
|
+
const n = () => {
|
|
2139
|
+
if (o.value.length >= 10) {
|
|
2140
|
+
const y = o.value[0];
|
|
2141
|
+
clearTimeout(y.timer), o.value.shift();
|
|
2142
|
+
}
|
|
2143
|
+
const d = {
|
|
2144
|
+
id: e++,
|
|
2145
|
+
timer: setTimeout(() => {
|
|
2146
|
+
g(d.id);
|
|
2147
|
+
}, 1500)
|
|
2148
|
+
};
|
|
2149
|
+
o.value.push(d);
|
|
2150
|
+
}, g = (d) => {
|
|
2151
|
+
const y = o.value.findIndex((v) => v.id === d);
|
|
2152
|
+
if (y !== -1) {
|
|
2153
|
+
const v = o.value[y];
|
|
2154
|
+
clearTimeout(v.timer), o.value.splice(y, 1);
|
|
2155
|
+
}
|
|
2156
|
+
};
|
|
2157
|
+
return l({
|
|
2158
|
+
addNotification: n
|
|
2159
|
+
}), ye(() => {
|
|
2160
|
+
o.value.forEach((d) => {
|
|
2161
|
+
clearTimeout(d.timer);
|
|
2162
|
+
});
|
|
2163
|
+
}), (d, y) => (s(), A(Ve, { to: "body" }, [
|
|
2164
|
+
M(Ae, {
|
|
2165
|
+
name: "notification",
|
|
2166
|
+
tag: "div",
|
|
2167
|
+
class: "fixed top-4 right-4 z-50 space-y-2"
|
|
2168
|
+
}, {
|
|
2169
|
+
default: ze(() => [
|
|
2170
|
+
(s(!0), i(I, null, E(o.value, (v) => (s(), i("div", {
|
|
2171
|
+
key: v.id,
|
|
2172
|
+
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"
|
|
2173
|
+
}, [
|
|
2174
|
+
M(w(Be), { class: "h-5 w-5 text-green-100 flex-shrink-0" }),
|
|
2175
|
+
y[0] || (y[0] = t("div", { class: "flex-1" }, [
|
|
2176
|
+
t("p", { class: "font-medium text-sm" }, "Ссылка скопирована!"),
|
|
2177
|
+
t("p", { class: "text-xs text-green-100 opacity-90" }, "Файл добавлен в буфер обмена")
|
|
2178
|
+
], -1)),
|
|
2179
|
+
t("button", {
|
|
2180
|
+
onClick: (p) => g(v.id),
|
|
2181
|
+
class: "text-green-100 hover:text-white transition-colors flex-shrink-0"
|
|
2182
|
+
}, [
|
|
2183
|
+
M(w(ue), { class: "h-4 w-4" })
|
|
2184
|
+
], 8, nn)
|
|
2185
|
+
]))), 128))
|
|
2186
|
+
]),
|
|
2187
|
+
_: 1
|
|
2188
|
+
})
|
|
2189
|
+
]));
|
|
2006
2190
|
}
|
|
2007
|
-
});
|
|
2008
|
-
|
|
2009
|
-
|
|
2191
|
+
}), an = /* @__PURE__ */ W(ln, [["__scopeId", "data-v-55903525"]]);
|
|
2192
|
+
le.install = function(a) {
|
|
2193
|
+
a.component("vs-widget-file", he), a.component("vs-widget-comments", se), a.component("vs-widget-history", oe), a.component("vs-widget-gallery", ne), a.component("vs-widget-map", ie), a.component("CommentsWidget", se), a.component("HistoryWidget", oe), a.component("GalleryWidget", ne), a.component("FilesWidget", he), a.component("MapWidget", ie), a.component("Card", le), a.component("CardItem", Le), a.component("DescriptionListWidget", Ce), a.component("CopyNotification", an);
|
|
2010
2194
|
};
|
|
2011
2195
|
export {
|
|
2012
|
-
|
|
2013
|
-
|
|
2196
|
+
le as Card,
|
|
2197
|
+
Le as CardItem,
|
|
2014
2198
|
se as CommentsWidget,
|
|
2015
|
-
|
|
2199
|
+
an as CopyNotification,
|
|
2016
2200
|
Ce as DescriptionListWidget,
|
|
2017
|
-
|
|
2018
|
-
|
|
2201
|
+
he as FilesWidget,
|
|
2202
|
+
ne as GalleryWidget,
|
|
2019
2203
|
oe as HistoryWidget,
|
|
2020
|
-
|
|
2021
|
-
|
|
2204
|
+
ie as MapWidget,
|
|
2205
|
+
Bo as TableWidget,
|
|
2206
|
+
le as default
|
|
2022
2207
|
};
|