@opengis/partsmap 0.1.1 → 0.1.2
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/index.js +1479 -1476
- package/index.umd.cjs +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
import { defineComponent as
|
2
|
-
const
|
1
|
+
import { defineComponent as Y, ref as V, watch as A, createBlock as z, openBlock as p, resolveDynamicComponent as oe, mergeProps as Z, withCtx as re, renderSlot as ee, computed as E, useSlots as we, createElementBlock as w, createCommentVNode as S, Fragment as F, renderList as q, unref as e, createElementVNode as o, normalizeClass as j, toDisplayString as K, createVNode as P, createTextVNode as W, toRaw as fe, cloneVNode as Ge, nextTick as ke, onMounted as ue, onBeforeUnmount as he, Teleport as Ue, withDirectives as I, normalizeStyle as _e, vShow as X, vModelText as te, withModifiers as Oe, isRef as Qe, createStaticVNode as Pe, resolveDirective as Ze } from "vue";
|
2
|
+
const Je = { class: "flex items-center justify-between w-full text-sm" }, Xe = { class: "flex items-center cursor-pointer w-full" }, et = {
|
3
3
|
key: 0,
|
4
4
|
width: "16",
|
5
5
|
height: "auto",
|
6
6
|
src: "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTYgMTYnIGZpbGw9J3doaXRlJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMi4yMDcgNC43OTNhMSAxIDAgMDEwIDEuNDE0bC01IDVhMSAxIDAgMDEtMS40MTQgMGwtMi0yYTEgMSAwIDAxMS40MTQtMS40MTRMNi41IDkuMDg2bDQuMjkzLTQuMjkzYTEgMSAwIDAxMS40MTQgMHonLz48L3N2Zz4="
|
7
|
-
},
|
7
|
+
}, tt = ["value"], lt = { class: "w-[calc(100%-18px)] flex flex-row items-center justify-between pl-[10px]" }, at = { class: "flex flex-row items-center font-normal text-gray-800 gap-x-1" }, ot = {
|
8
8
|
key: 0,
|
9
9
|
class: "text-xs text-gray-500 dark:text-neutral-500 pr-1"
|
10
|
-
}, Ce = /* @__PURE__ */
|
10
|
+
}, Ce = /* @__PURE__ */ Y({
|
11
11
|
__name: "list-item",
|
12
12
|
props: {
|
13
13
|
layout: {},
|
@@ -20,44 +20,44 @@ const Ge = { class: "flex items-center justify-between w-full text-sm" }, Qe = {
|
|
20
20
|
highlighted: { type: Boolean }
|
21
21
|
},
|
22
22
|
emits: ["itemClick"],
|
23
|
-
setup(
|
24
|
-
const l =
|
25
|
-
function
|
26
|
-
|
23
|
+
setup(i, { expose: r, emit: d }) {
|
24
|
+
const l = i, a = d;
|
25
|
+
function n() {
|
26
|
+
a("itemClick", l.value);
|
27
27
|
}
|
28
|
-
const
|
29
|
-
return
|
28
|
+
const m = V(null);
|
29
|
+
return r({ el: m }), (h, g) => (p(), w("div", {
|
30
30
|
class: "flex items-center w-full rounded-lg group hover:bg-gray-100",
|
31
31
|
ref_key: "el",
|
32
|
-
ref:
|
32
|
+
ref: m
|
33
33
|
}, [
|
34
|
-
o("div",
|
35
|
-
o("div",
|
34
|
+
o("div", Je, [
|
35
|
+
o("div", Xe, [
|
36
36
|
o("label", {
|
37
37
|
for: "radio-9740",
|
38
|
-
class:
|
39
|
-
["inline", "popover"].includes(
|
40
|
-
{ "bg-blue-100":
|
38
|
+
class: j([
|
39
|
+
["inline", "popover"].includes(h.layout) ? "text-sm text-gray-500 px-2 w-full py-2 cursor-pointer !flex flex-row items-center" : "flex flex-row items-center w-full px-2 py-2 text-sm text-gray-500 cursor-pointer",
|
40
|
+
{ "bg-blue-100": h.highlighted }
|
41
41
|
]),
|
42
|
-
onClick:
|
42
|
+
onClick: Oe(n, ["stop", "prevent"])
|
43
43
|
}, [
|
44
44
|
o("div", {
|
45
|
-
class:
|
46
|
-
|
47
|
-
|
45
|
+
class: j(["w-[18px] h-[18px] border flex items-center justify-center", [
|
46
|
+
h.type == "checkbox" ? "rounded-[4px]" : "rounded-full",
|
47
|
+
h.color ? `bg-[${h.color}] border-[#ffffff]` : h.isSelected ? "bg-[#2563eb] border-[#ffffff]" : "bg-[#ffffff] border-[#d9d9d9]"
|
48
48
|
]])
|
49
49
|
}, [
|
50
|
-
|
50
|
+
h.isSelected ? (p(), w("img", et)) : S("", !0)
|
51
51
|
], 2),
|
52
52
|
o("input", {
|
53
53
|
type: "checkbox",
|
54
54
|
class: "hidden",
|
55
55
|
id: "radio-9740",
|
56
|
-
value:
|
57
|
-
}, null, 8,
|
58
|
-
o("div",
|
59
|
-
o("span",
|
60
|
-
|
56
|
+
value: h.value
|
57
|
+
}, null, 8, tt),
|
58
|
+
o("div", lt, [
|
59
|
+
o("span", at, K(h.label ?? "Відсутні данні"), 1),
|
60
|
+
h.count ? (p(), w("div", ot, " (" + K(h.count) + ") ", 1)) : S("", !0)
|
61
61
|
])
|
62
62
|
], 2)
|
63
63
|
])
|
@@ -65,75 +65,75 @@ const Ge = { class: "flex items-center justify-between w-full text-sm" }, Qe = {
|
|
65
65
|
], 512));
|
66
66
|
}
|
67
67
|
});
|
68
|
-
function
|
68
|
+
function Ie(i, r) {
|
69
69
|
const {
|
70
70
|
options: d = [],
|
71
71
|
limit: l = 20
|
72
|
-
} =
|
73
|
-
function
|
74
|
-
return Array.isArray(
|
72
|
+
} = i;
|
73
|
+
function a(u) {
|
74
|
+
return Array.isArray(u) ? u[0] : u;
|
75
75
|
}
|
76
|
-
const
|
77
|
-
function
|
78
|
-
const
|
79
|
-
return { autoValueKey: B, autoLabelKey:
|
76
|
+
const n = V(a(i.modelValue)), m = V(""), h = V(!1), g = V([]), k = V("id"), b = V("text"), f = V(!1), y = V(i.layout !== "popover" && d.length > l);
|
77
|
+
function C(u) {
|
78
|
+
const _ = u.find(Boolean) ?? {}, B = ["id", "value", "code", "key"].find((L) => L in _) ?? "id", M = ["text", "label", "name", "title"].find((L) => L in _) ?? "text";
|
79
|
+
return { autoValueKey: B, autoLabelKey: M };
|
80
80
|
}
|
81
81
|
if (d.length > 0) {
|
82
|
-
const
|
83
|
-
|
82
|
+
const u = C(d);
|
83
|
+
k.value = u.autoValueKey, b.value = u.autoLabelKey;
|
84
84
|
}
|
85
|
-
const c =
|
86
|
-
const
|
87
|
-
return
|
85
|
+
const c = E(() => {
|
86
|
+
const u = g.value;
|
87
|
+
return i.layout === "popover" || f.value ? u : u.slice(0, l);
|
88
88
|
});
|
89
|
-
A(() =>
|
90
|
-
|
91
|
-
}, { immediate: !0 }), g.value = [...d].sort((
|
92
|
-
function u
|
93
|
-
return
|
89
|
+
A(() => i.modelValue, (u) => {
|
90
|
+
n.value = a(u);
|
91
|
+
}, { immediate: !0 }), g.value = [...d].sort((u, _) => i.sort === "count" ? _.count && u.count ? _.count - u.count : 0 : i.sort === "name" ? String(u[b.value] ?? "").localeCompare(String(_[b.value] ?? "")) : 0);
|
92
|
+
function s(u) {
|
93
|
+
return n.value === u[k.value];
|
94
94
|
}
|
95
|
-
function t(
|
96
|
-
|
95
|
+
function t(u) {
|
96
|
+
n.value = u[k.value], r("update:modelValue", n.value), r("change", { name: i.name, value: n.value });
|
97
97
|
}
|
98
98
|
function x() {
|
99
|
-
|
99
|
+
n.value = void 0, r("update:modelValue", n.value), r("clear", i.name);
|
100
100
|
}
|
101
|
-
function
|
101
|
+
function v() {
|
102
102
|
f.value = !f.value;
|
103
103
|
}
|
104
104
|
return {
|
105
|
-
innerValue:
|
106
|
-
searchTerm:
|
105
|
+
innerValue: n,
|
106
|
+
searchTerm: m,
|
107
107
|
filteredOptions: c,
|
108
|
-
isSelected:
|
108
|
+
isSelected: s,
|
109
109
|
selectItem: t,
|
110
110
|
clear: x,
|
111
|
-
toggleShowAll:
|
112
|
-
isReqProc:
|
111
|
+
toggleShowAll: v,
|
112
|
+
isReqProc: h,
|
113
113
|
showAll: f,
|
114
|
-
isEnableShowAll:
|
114
|
+
isEnableShowAll: y,
|
115
115
|
labelKey: b,
|
116
|
-
valueKey:
|
116
|
+
valueKey: k,
|
117
117
|
allOptions: g
|
118
118
|
};
|
119
119
|
}
|
120
|
-
const
|
121
|
-
const d =
|
122
|
-
for (const [l,
|
123
|
-
d[l] =
|
120
|
+
const le = (i, r) => {
|
121
|
+
const d = i.__vccOpts || i;
|
122
|
+
for (const [l, a] of r)
|
123
|
+
d[l] = a;
|
124
124
|
return d;
|
125
|
-
},
|
125
|
+
}, rt = {}, nt = {
|
126
126
|
class: "w-48 mx-auto",
|
127
127
|
viewBox: "0 0 178 90",
|
128
128
|
fill: "none",
|
129
129
|
xmlns: "http://www.w3.org/2000/svg"
|
130
130
|
};
|
131
|
-
function
|
132
|
-
return p(),
|
133
|
-
|
131
|
+
function it(i, r) {
|
132
|
+
return p(), w("svg", nt, r[0] || (r[0] = [
|
133
|
+
Pe('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>', 12)
|
134
134
|
]));
|
135
135
|
}
|
136
|
-
const
|
136
|
+
const Ve = /* @__PURE__ */ le(rt, [["render", it]]), st = {}, ut = {
|
137
137
|
xmlns: "http://www.w3.org/2000/svg",
|
138
138
|
width: "24",
|
139
139
|
height: "24",
|
@@ -145,8 +145,8 @@ const _e = /* @__PURE__ */ X(lt, [["render", nt]]), at = {}, rt = {
|
|
145
145
|
"stroke-linejoin": "round",
|
146
146
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate"
|
147
147
|
};
|
148
|
-
function
|
149
|
-
return p(),
|
148
|
+
function dt(i, r) {
|
149
|
+
return p(), w("svg", ut, r[0] || (r[0] = [
|
150
150
|
o("path", {
|
151
151
|
stroke: "none",
|
152
152
|
d: "M0 0h24v24H0z",
|
@@ -155,7 +155,7 @@ function st(s, a) {
|
|
155
155
|
o("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
156
156
|
]));
|
157
157
|
}
|
158
|
-
const
|
158
|
+
const be = /* @__PURE__ */ le(st, [["render", dt]]), ct = {}, pt = {
|
159
159
|
xmlns: "http://www.w3.org/2000/svg",
|
160
160
|
width: "24",
|
161
161
|
height: "24",
|
@@ -167,8 +167,8 @@ const ye = /* @__PURE__ */ X(at, [["render", st]]), it = {}, ut = {
|
|
167
167
|
"stroke-linejoin": "round",
|
168
168
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate-[180deg]"
|
169
169
|
};
|
170
|
-
function
|
171
|
-
return p(),
|
170
|
+
function ft(i, r) {
|
171
|
+
return p(), w("svg", pt, r[0] || (r[0] = [
|
172
172
|
o("path", {
|
173
173
|
stroke: "none",
|
174
174
|
d: "M0 0h24v24H0z",
|
@@ -177,16 +177,16 @@ function dt(s, a) {
|
|
177
177
|
o("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
178
178
|
]));
|
179
179
|
}
|
180
|
-
const
|
180
|
+
const Se = /* @__PURE__ */ le(ct, [["render", ft]]), vt = {
|
181
181
|
key: 0,
|
182
182
|
class: "w-full"
|
183
|
-
},
|
183
|
+
}, mt = { class: "flex flex-col items-center justify-center p-5 text-center" }, gt = {
|
184
184
|
key: 0,
|
185
185
|
class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
|
186
|
-
},
|
186
|
+
}, ht = {
|
187
187
|
key: 1,
|
188
188
|
class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
|
189
|
-
},
|
189
|
+
}, bt = /* @__PURE__ */ Y({
|
190
190
|
__name: "radio",
|
191
191
|
props: {
|
192
192
|
id: {},
|
@@ -212,170 +212,170 @@ const $e = /* @__PURE__ */ X(it, [["render", dt]]), ct = {
|
|
212
212
|
sort: {}
|
213
213
|
},
|
214
214
|
emits: ["update:modelValue", "change", "clear"],
|
215
|
-
setup(
|
216
|
-
const l =
|
217
|
-
innerValue:
|
218
|
-
filteredOptions:
|
215
|
+
setup(i, { expose: r, emit: d }) {
|
216
|
+
const l = i, a = V(null), n = d, {
|
217
|
+
innerValue: m,
|
218
|
+
filteredOptions: h,
|
219
219
|
isSelected: g,
|
220
|
-
selectItem:
|
220
|
+
selectItem: k,
|
221
221
|
clear: b,
|
222
222
|
toggleShowAll: f,
|
223
|
-
isReqProc:
|
224
|
-
showAll:
|
223
|
+
isReqProc: y,
|
224
|
+
showAll: C,
|
225
225
|
isEnableShowAll: c,
|
226
|
-
labelKey:
|
226
|
+
labelKey: s,
|
227
227
|
valueKey: t,
|
228
228
|
allOptions: x
|
229
|
-
} =
|
229
|
+
} = Ie({
|
230
230
|
...l,
|
231
231
|
modelValue: l.modelValue ?? l.default ?? ""
|
232
|
-
},
|
233
|
-
return
|
232
|
+
}, n);
|
233
|
+
return r({
|
234
234
|
clear: b,
|
235
|
-
inputTextRef:
|
235
|
+
inputTextRef: a
|
236
236
|
}), A(
|
237
237
|
() => l.modelValue,
|
238
|
-
(
|
239
|
-
|
238
|
+
(v) => {
|
239
|
+
v === void 0 && (m.value = void 0);
|
240
240
|
}
|
241
|
-
), (
|
242
|
-
class:
|
241
|
+
), (v, u) => (p(), w("div", {
|
242
|
+
class: j([v.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox"])
|
243
243
|
}, [
|
244
244
|
o("div", {
|
245
|
-
class:
|
246
|
-
|
247
|
-
|
245
|
+
class: j([
|
246
|
+
v.layout === "popover" ? "flex-1 overflow-y-auto max-h-64 p-2" : "",
|
247
|
+
v.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
|
248
248
|
])
|
249
249
|
}, [
|
250
|
-
(p(!0),
|
251
|
-
layout:
|
252
|
-
key:
|
253
|
-
count:
|
254
|
-
label:
|
255
|
-
color:
|
250
|
+
(p(!0), w(F, null, q(e(h), (_) => (p(), z(Ce, {
|
251
|
+
layout: v.layout,
|
252
|
+
key: _[e(t)],
|
253
|
+
count: _.count,
|
254
|
+
label: _[e(s)],
|
255
|
+
color: _.color,
|
256
256
|
type: "radio",
|
257
|
-
value:
|
258
|
-
"is-selected": e(g)(
|
259
|
-
onItemClick: (B) => e(
|
257
|
+
value: _[e(t)],
|
258
|
+
"is-selected": e(g)(_),
|
259
|
+
onItemClick: (B) => e(k)(_)
|
260
260
|
}, null, 8, ["layout", "count", "label", "color", "value", "is-selected", "onItemClick"]))), 128))
|
261
261
|
], 2),
|
262
|
-
|
263
|
-
o("div",
|
264
|
-
|
265
|
-
|
262
|
+
v.type === "select" && e(h).length === 0 && !e(y) ? (p(), w("div", vt, [
|
263
|
+
o("div", mt, [
|
264
|
+
P(Ve),
|
265
|
+
u[4] || (u[4] = o("div", { class: "max-w-sm mx-auto mt-6" }, [
|
266
266
|
o("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
|
267
267
|
o("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
|
268
268
|
], -1))
|
269
269
|
])
|
270
|
-
])) :
|
271
|
-
|
272
|
-
!e(
|
270
|
+
])) : S("", !0),
|
271
|
+
v.layout !== "popover" && v.type !== "select" ? (p(), w(F, { key: 1 }, [
|
272
|
+
!e(C) && e(c) ? (p(), w("div", {
|
273
273
|
key: 0,
|
274
|
-
onClick:
|
275
|
-
(...
|
274
|
+
onClick: u[0] || (u[0] = //@ts-ignore
|
275
|
+
(..._) => e(f) && e(f)(..._)),
|
276
276
|
class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
|
277
277
|
}, [
|
278
|
-
|
279
|
-
|
280
|
-
])) :
|
281
|
-
e(
|
278
|
+
u[5] || (u[5] = W(" Показати більше ", -1)),
|
279
|
+
P(be)
|
280
|
+
])) : S("", !0),
|
281
|
+
e(C) ? (p(), w("div", {
|
282
282
|
key: 1,
|
283
|
-
onClick:
|
284
|
-
(...
|
283
|
+
onClick: u[1] || (u[1] = //@ts-ignore
|
284
|
+
(..._) => e(f) && e(f)(..._)),
|
285
285
|
class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
|
286
286
|
}, [
|
287
|
-
|
288
|
-
|
289
|
-
])) :
|
290
|
-
], 64)) :
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
287
|
+
u[6] || (u[6] = W(" Показати менше ", -1)),
|
288
|
+
P(Se)
|
289
|
+
])) : S("", !0)
|
290
|
+
], 64)) : S("", !0),
|
291
|
+
v.cleanable ? (p(), w(F, { key: 2 }, [
|
292
|
+
v.layout === "inline" ? (p(), w("div", gt, [
|
293
|
+
W(K(e(m) || e(m) === null ? 1 : 0) + " з " + K(e(x).length) + " обрано ", 1),
|
294
|
+
I(o("button", {
|
295
295
|
class: "text-gray-600 hover:text-gray-800",
|
296
|
-
onClick:
|
297
|
-
(...
|
296
|
+
onClick: u[2] || (u[2] = //@ts-ignore
|
297
|
+
(..._) => e(b) && e(b)(..._))
|
298
298
|
}, " Очистити ", 512), [
|
299
|
-
[
|
299
|
+
[X, e(m) !== "" && e(m) !== void 0]
|
300
300
|
])
|
301
|
-
])) :
|
302
|
-
|
303
|
-
o("span", null,
|
304
|
-
|
301
|
+
])) : S("", !0),
|
302
|
+
v.layout === "popover" ? (p(), w("div", ht, [
|
303
|
+
o("span", null, K(e(m) || e(m) === null ? 1 : 0) + " з " + K(e(x).length) + " обрано", 1),
|
304
|
+
I(o("button", {
|
305
305
|
class: "text-gray-600 hover:text-gray-800",
|
306
|
-
onClick:
|
307
|
-
(...
|
306
|
+
onClick: u[3] || (u[3] = //@ts-ignore
|
307
|
+
(..._) => e(b) && e(b)(..._))
|
308
308
|
}, " Очистити ", 512), [
|
309
|
-
[
|
309
|
+
[X, e(m) !== "" && e(m) !== void 0]
|
310
310
|
])
|
311
|
-
])) :
|
312
|
-
], 64)) :
|
311
|
+
])) : S("", !0)
|
312
|
+
], 64)) : S("", !0)
|
313
313
|
], 2));
|
314
314
|
}
|
315
315
|
});
|
316
|
-
function Te(
|
316
|
+
function Te(i, r) {
|
317
317
|
const {
|
318
318
|
options: d = [],
|
319
319
|
limit: l = 20
|
320
|
-
} =
|
321
|
-
function
|
322
|
-
return Array.isArray(
|
320
|
+
} = i;
|
321
|
+
function a(u) {
|
322
|
+
return Array.isArray(u) ? u : u ? [u] : [];
|
323
323
|
}
|
324
|
-
const
|
325
|
-
function
|
326
|
-
const
|
327
|
-
return { autoValueKey: B, autoLabelKey:
|
324
|
+
const n = V(a(i.modelValue)), m = V(""), h = V(!1), g = V([]), k = V("id"), b = V("text"), f = V(!1), y = V(i.layout !== "popover" && d.length > l);
|
325
|
+
function C(u) {
|
326
|
+
const _ = u.find(Boolean) ?? {}, B = ["id", "value", "code", "key"].find((L) => L in _) ?? "id", M = ["text", "label", "name", "title"].find((L) => L in _) ?? "text";
|
327
|
+
return { autoValueKey: B, autoLabelKey: M };
|
328
328
|
}
|
329
329
|
if (d.length > 0) {
|
330
|
-
const
|
331
|
-
|
330
|
+
const u = C(d);
|
331
|
+
k.value = u.autoValueKey, b.value = u.autoLabelKey;
|
332
332
|
}
|
333
|
-
const c =
|
334
|
-
const
|
335
|
-
return
|
333
|
+
const c = E(() => {
|
334
|
+
const u = g.value;
|
335
|
+
return i.layout === "popover" || f.value ? u : u.slice(0, l);
|
336
336
|
});
|
337
|
-
A(() =>
|
338
|
-
|
339
|
-
}, { immediate: !0 }), g.value = [...d].sort((
|
340
|
-
function u
|
341
|
-
return
|
337
|
+
A(() => i.modelValue, (u) => {
|
338
|
+
n.value = a(u);
|
339
|
+
}, { immediate: !0 }), g.value = [...d].sort((u, _) => i.sort === "count" ? _.count && u.count ? _.count - u.count : 0 : i.sort === "name" ? String(u[b.value]).localeCompare(String(_[b.value])) : 0);
|
340
|
+
function s(u) {
|
341
|
+
return n.value && n.value.includes(u[k.value]);
|
342
342
|
}
|
343
|
-
function t(
|
344
|
-
const
|
345
|
-
|
343
|
+
function t(u) {
|
344
|
+
const _ = n.value.includes(u[k.value]);
|
345
|
+
n.value = _ ? n.value.filter((B) => B !== u[k.value]) : [...n.value, u[k.value]], r("update:modelValue", n.value), r("change", { name: i.name, value: n.value });
|
346
346
|
}
|
347
347
|
function x() {
|
348
|
-
|
348
|
+
n.value = [], r("update:modelValue", n.value), r("clear", i.name);
|
349
349
|
}
|
350
|
-
function
|
350
|
+
function v() {
|
351
351
|
f.value = !f.value;
|
352
352
|
}
|
353
353
|
return {
|
354
|
-
innerValue:
|
355
|
-
searchTerm:
|
354
|
+
innerValue: n,
|
355
|
+
searchTerm: m,
|
356
356
|
filteredOptions: c,
|
357
|
-
isSelected:
|
357
|
+
isSelected: s,
|
358
358
|
selectItem: t,
|
359
359
|
clear: x,
|
360
|
-
toggleShowAll:
|
361
|
-
isReqProc:
|
360
|
+
toggleShowAll: v,
|
361
|
+
isReqProc: h,
|
362
362
|
showAll: f,
|
363
|
-
isEnableShowAll:
|
363
|
+
isEnableShowAll: y,
|
364
364
|
labelKey: b,
|
365
|
-
valueKey:
|
365
|
+
valueKey: k,
|
366
366
|
allOptions: g
|
367
367
|
};
|
368
368
|
}
|
369
|
-
const
|
369
|
+
const yt = {
|
370
370
|
key: 0,
|
371
371
|
class: "w-full"
|
372
|
-
},
|
372
|
+
}, xt = { class: "flex flex-col items-center justify-center p-5 text-center" }, wt = {
|
373
373
|
key: 0,
|
374
374
|
class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
|
375
|
-
},
|
375
|
+
}, kt = {
|
376
376
|
key: 1,
|
377
377
|
class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
|
378
|
-
},
|
378
|
+
}, ze = /* @__PURE__ */ Y({
|
379
379
|
__name: "checkbox",
|
380
380
|
props: {
|
381
381
|
id: {},
|
@@ -401,105 +401,105 @@ const gt = {
|
|
401
401
|
sort: {}
|
402
402
|
},
|
403
403
|
emits: ["update:modelValue", "change", "clear"],
|
404
|
-
setup(
|
405
|
-
const l =
|
406
|
-
innerValue:
|
407
|
-
filteredOptions:
|
408
|
-
isSelected:
|
404
|
+
setup(i, { expose: r, emit: d }) {
|
405
|
+
const l = i, a = d, {
|
406
|
+
innerValue: n,
|
407
|
+
filteredOptions: m,
|
408
|
+
isSelected: h,
|
409
409
|
selectItem: g,
|
410
|
-
clear:
|
410
|
+
clear: k,
|
411
411
|
toggleShowAll: b,
|
412
412
|
isReqProc: f,
|
413
|
-
showAll:
|
414
|
-
isEnableShowAll:
|
413
|
+
showAll: y,
|
414
|
+
isEnableShowAll: C,
|
415
415
|
labelKey: c,
|
416
|
-
valueKey:
|
416
|
+
valueKey: s,
|
417
417
|
allOptions: t
|
418
418
|
} = Te({
|
419
419
|
...l,
|
420
420
|
modelValue: l.modelValue
|
421
|
-
},
|
421
|
+
}, a);
|
422
422
|
return A(
|
423
423
|
() => l.modelValue,
|
424
424
|
(x) => {
|
425
|
-
x === void 0 && (
|
425
|
+
x === void 0 && (n.value = []);
|
426
426
|
}
|
427
|
-
),
|
428
|
-
clear:
|
429
|
-
}), (x,
|
430
|
-
class:
|
427
|
+
), r({
|
428
|
+
clear: k
|
429
|
+
}), (x, v) => (p(), w("div", {
|
430
|
+
class: j([x.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
|
431
431
|
}, [
|
432
432
|
o("div", {
|
433
|
-
class:
|
433
|
+
class: j([
|
434
434
|
x.layout === "popover" ? "flex-1 overflow-y-auto max-h-64 p-2" : "",
|
435
435
|
x.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
|
436
436
|
])
|
437
437
|
}, [
|
438
|
-
(p(!0),
|
438
|
+
(p(!0), w(F, null, q(e(m), (u) => (p(), z(Ce, {
|
439
439
|
layout: x.layout,
|
440
|
-
count:
|
441
|
-
label:
|
442
|
-
color:
|
440
|
+
count: u.count,
|
441
|
+
label: u[e(c)],
|
442
|
+
color: u.color,
|
443
443
|
type: "checkbox",
|
444
|
-
value:
|
445
|
-
"is-selected": e(
|
446
|
-
onItemClick: (
|
444
|
+
value: u[e(s)],
|
445
|
+
"is-selected": e(h)(u),
|
446
|
+
onItemClick: (_) => e(g)(u)
|
447
447
|
}, null, 8, ["layout", "count", "label", "color", "value", "is-selected", "onItemClick"]))), 256))
|
448
448
|
], 2),
|
449
|
-
x.type === "select" && e(
|
450
|
-
o("div",
|
451
|
-
|
452
|
-
|
449
|
+
x.type === "select" && e(m).length === 0 && !e(f) ? (p(), w("div", yt, [
|
450
|
+
o("div", xt, [
|
451
|
+
P(Ve),
|
452
|
+
v[4] || (v[4] = o("div", { class: "max-w-sm mx-auto mt-6" }, [
|
453
453
|
o("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
|
454
454
|
o("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
|
455
455
|
], -1))
|
456
456
|
])
|
457
|
-
])) :
|
458
|
-
x.layout !== "popover" && x.type !== "select" ? (p(),
|
459
|
-
!e(
|
457
|
+
])) : S("", !0),
|
458
|
+
x.layout !== "popover" && x.type !== "select" ? (p(), w(F, { key: 1 }, [
|
459
|
+
!e(y) && e(C) ? (p(), w("div", {
|
460
460
|
key: 0,
|
461
|
-
onClick:
|
462
|
-
(...
|
461
|
+
onClick: v[0] || (v[0] = //@ts-ignore
|
462
|
+
(...u) => e(b) && e(b)(...u)),
|
463
463
|
class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
|
464
464
|
}, [
|
465
|
-
|
466
|
-
|
467
|
-
])) :
|
468
|
-
e(
|
465
|
+
v[5] || (v[5] = W(" Показати більше ", -1)),
|
466
|
+
P(be)
|
467
|
+
])) : S("", !0),
|
468
|
+
e(y) ? (p(), w("div", {
|
469
469
|
key: 1,
|
470
|
-
onClick:
|
471
|
-
(...
|
470
|
+
onClick: v[1] || (v[1] = //@ts-ignore
|
471
|
+
(...u) => e(b) && e(b)(...u)),
|
472
472
|
class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
|
473
473
|
}, [
|
474
|
-
|
475
|
-
|
476
|
-
])) :
|
477
|
-
], 64)) :
|
478
|
-
x.cleanable ? (p(),
|
479
|
-
x.layout === "inline" ? (p(),
|
480
|
-
|
481
|
-
|
474
|
+
v[6] || (v[6] = W(" Показати менше ", -1)),
|
475
|
+
P(Se)
|
476
|
+
])) : S("", !0)
|
477
|
+
], 64)) : S("", !0),
|
478
|
+
x.cleanable ? (p(), w(F, { key: 2 }, [
|
479
|
+
x.layout === "inline" ? (p(), w("div", wt, [
|
480
|
+
W(K(e(n).length) + " з " + K(e(t).length) + " обрано ", 1),
|
481
|
+
I(o("button", {
|
482
482
|
class: "text-gray-600 hover:text-gray-800",
|
483
|
-
onClick:
|
484
|
-
(...
|
483
|
+
onClick: v[2] || (v[2] = //@ts-ignore
|
484
|
+
(...u) => e(k) && e(k)(...u))
|
485
485
|
}, " Очистити ", 512), [
|
486
|
-
[
|
486
|
+
[X, e(n).length !== 0]
|
487
487
|
])
|
488
|
-
])) :
|
489
|
-
x.layout === "popover" ? (p(),
|
490
|
-
o("span", null,
|
491
|
-
|
488
|
+
])) : S("", !0),
|
489
|
+
x.layout === "popover" ? (p(), w("div", kt, [
|
490
|
+
o("span", null, K(e(n).length) + " з " + K(e(t).length) + " обрано", 1),
|
491
|
+
I(o("button", {
|
492
492
|
class: "text-gray-600 hover:text-gray-800",
|
493
|
-
onClick:
|
494
|
-
(...
|
493
|
+
onClick: v[3] || (v[3] = //@ts-ignore
|
494
|
+
(...u) => e(k) && e(k)(...u))
|
495
495
|
}, " Очистити ", 512), [
|
496
|
-
[
|
496
|
+
[X, e(n).length !== 0]
|
497
497
|
])
|
498
|
-
])) :
|
499
|
-
], 64)) :
|
498
|
+
])) : S("", !0)
|
499
|
+
], 64)) : S("", !0)
|
500
500
|
], 2));
|
501
501
|
}
|
502
|
-
}),
|
502
|
+
}), _t = {}, Ct = {
|
503
503
|
xmlns: "http://www.w3.org/2000/svg",
|
504
504
|
width: "15px",
|
505
505
|
height: "15px",
|
@@ -511,8 +511,8 @@ const gt = {
|
|
511
511
|
"stroke-linejoin": "round",
|
512
512
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"
|
513
513
|
};
|
514
|
-
function
|
515
|
-
return p(),
|
514
|
+
function Vt(i, r) {
|
515
|
+
return p(), w("svg", Ct, r[0] || (r[0] = [
|
516
516
|
o("path", {
|
517
517
|
stroke: "none",
|
518
518
|
d: "M0 0h24v24H0z",
|
@@ -522,7 +522,7 @@ function kt(s, a) {
|
|
522
522
|
o("path", { d: "M21 21l-6 -6" }, null, -1)
|
523
523
|
]));
|
524
524
|
}
|
525
|
-
const
|
525
|
+
const He = /* @__PURE__ */ le(_t, [["render", Vt]]), St = {}, Mt = {
|
526
526
|
xmlns: "http://www.w3.org/2000/svg",
|
527
527
|
viewBox: "0 0 24 24",
|
528
528
|
fill: "none",
|
@@ -534,8 +534,8 @@ const Ie = /* @__PURE__ */ X(xt, [["render", kt]]), Ct = {}, _t = {
|
|
534
534
|
width: "15px",
|
535
535
|
height: "15px"
|
536
536
|
};
|
537
|
-
function
|
538
|
-
return p(),
|
537
|
+
function Bt(i, r) {
|
538
|
+
return p(), w("svg", Mt, r[0] || (r[0] = [
|
539
539
|
o("path", {
|
540
540
|
stroke: "none",
|
541
541
|
d: "M0 0h24v24H0z",
|
@@ -545,13 +545,13 @@ function $t(s, a) {
|
|
545
545
|
o("path", { d: "M6 6l12 12" }, null, -1)
|
546
546
|
]));
|
547
547
|
}
|
548
|
-
const
|
549
|
-
class
|
550
|
-
static getWidthClass(
|
551
|
-
return typeof
|
548
|
+
const Ee = /* @__PURE__ */ le(St, [["render", Bt]]);
|
549
|
+
class ye {
|
550
|
+
static getWidthClass(r) {
|
551
|
+
return typeof r == "number" ? `max-w-[${r}px]` : typeof r == "string" ? r.endsWith("%") || r.endsWith("px") ? `max-w-[${r}]` : `max-w-${r}` : "w-full";
|
552
552
|
}
|
553
553
|
}
|
554
|
-
const
|
554
|
+
const $t = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3" }, At = ["placeholder"], Rt = /* @__PURE__ */ Y({
|
555
555
|
__name: "text-input",
|
556
556
|
props: {
|
557
557
|
id: {},
|
@@ -577,74 +577,73 @@ const Vt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"
|
|
577
577
|
sort: {}
|
578
578
|
},
|
579
579
|
emits: ["update:modelValue", "change", "clear"],
|
580
|
-
setup(
|
581
|
-
const d =
|
580
|
+
setup(i, { emit: r }) {
|
581
|
+
const d = i, l = V((d.placeHolder || d.label || d.name || "search").toString()), a = r, n = V(d.modelValue ?? "");
|
582
582
|
A(
|
583
583
|
() => d.modelValue,
|
584
584
|
(g) => {
|
585
|
-
g !==
|
585
|
+
g !== n.value && (n.value = g ?? "");
|
586
586
|
}
|
587
587
|
);
|
588
|
-
function
|
589
|
-
|
588
|
+
function m() {
|
589
|
+
a("update:modelValue", n.value), a("change", { name: d.name, value: n.value });
|
590
590
|
}
|
591
|
-
function
|
592
|
-
|
591
|
+
function h() {
|
592
|
+
n.value = "", a("update:modelValue", ""), a("clear", d.name), a("change", { name: d.name, value: null });
|
593
593
|
}
|
594
|
-
return (g,
|
595
|
-
class:
|
594
|
+
return (g, k) => (p(), w("div", {
|
595
|
+
class: j([
|
596
596
|
"vs-form-text relative bg-white rounded-lg [&>input]:py-[7px] [&>input]:max-h-[38px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600",
|
597
|
-
g.layout === "inline" ? e(
|
597
|
+
g.layout === "inline" ? e(ye).getWidthClass(g.width) : "mb-2" + (g.layout === "popover" ? " m-2" : "")
|
598
598
|
])
|
599
599
|
}, [
|
600
|
-
o("div",
|
601
|
-
|
600
|
+
o("div", $t, [
|
601
|
+
P(He)
|
602
602
|
]),
|
603
|
-
|
603
|
+
n.value !== "" ? (p(), w("div", {
|
604
604
|
key: 0,
|
605
|
-
onClick:
|
605
|
+
onClick: h,
|
606
606
|
class: "absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer"
|
607
607
|
}, [
|
608
|
-
|
609
|
-
])) :
|
610
|
-
|
608
|
+
P(Ee)
|
609
|
+
])) : S("", !0),
|
610
|
+
I(o("input", {
|
611
611
|
type: "text",
|
612
|
-
"onUpdate:modelValue":
|
613
|
-
onInput:
|
612
|
+
"onUpdate:modelValue": k[0] || (k[0] = (b) => n.value = b),
|
613
|
+
onInput: m,
|
614
614
|
placeholder: l.value,
|
615
615
|
class: "!pr-7 !pl-8 bg-white h-[38px] min-w-[100px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:border-2 focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
|
616
|
-
}, null, 40,
|
617
|
-
[
|
616
|
+
}, null, 40, At), [
|
617
|
+
[te, n.value]
|
618
618
|
])
|
619
619
|
], 2));
|
620
620
|
}
|
621
621
|
});
|
622
|
-
function
|
623
|
-
return
|
624
|
-
const
|
625
|
-
return (
|
622
|
+
function Ye(i = { color: "blue" }) {
|
623
|
+
return E(() => {
|
624
|
+
const r = `w-full px-3 py-2 border-solid border border-gray-300 text-sm rounded focus:outline-none focus:ring-2 focus:ring-${i.color}-500 focus:border-transparent`;
|
625
|
+
return (i == null ? void 0 : i.size) === "sm" ? `${r}h-[32px]` : `${r}h-[38px]`;
|
626
626
|
});
|
627
627
|
}
|
628
|
-
function
|
628
|
+
function Dt() {
|
629
629
|
return "rounded-md font-medium border-gray-200 border-solid disabled:pointer-events-none disabled:opacity-50 px-4 py-2 w-full bg-transparent border text-black text-sm h-[38px]";
|
630
630
|
}
|
631
|
-
function
|
631
|
+
function zt() {
|
632
632
|
return "font-medium border-gray-200 border-solid disabled:pointer-events-none disabled:opacity-50 border h-7 rounded-md text-xs px-2 py-1 hover:bg-gray-100";
|
633
633
|
}
|
634
|
-
function
|
635
|
-
return
|
634
|
+
function We(i) {
|
635
|
+
return i === "ghost" ? "inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent text-gray-600 hover:bg-blue-100 hover:text-gray-800 focus:outline-hidden focus:bg-gray-100 focus:text-gray-800 disabled:opacity-50 disabled:pointer-events-none dark:text-gray-500 dark:hover:bg-blue-800/30 dark:hover:text-blue-400 dark:focus:bg-blue-800/30 dark:focus:text-blue-400" : i === "soft" ? "inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 hover:bg-gray-200 focus:outline-hidden focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:text-blue-400 dark:hover:bg-blue-900 dark:focus:bg-blue-900" : "relative border-solid border-gray-200 focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border-input hover:bg-gray-100 border px-4 py-2 gap-2 bg-transparent h-[38px]";
|
636
636
|
}
|
637
|
-
const
|
637
|
+
const jt = {
|
638
638
|
key: 0,
|
639
639
|
class: "block text-xs font-medium text-gray-600 mb-1"
|
640
|
-
},
|
640
|
+
}, Ft = ["placeholder", "disabled"], Kt = {
|
641
641
|
key: 0,
|
642
642
|
class: "block text-xs font-medium text-gray-600 mb-1"
|
643
|
-
},
|
643
|
+
}, Lt = {
|
644
644
|
key: 0,
|
645
645
|
class: "block text-xs font-medium text-gray-600 mb-1"
|
646
|
-
},
|
647
|
-
const Kt = /* @__PURE__ */ N({
|
646
|
+
}, Ut = ["placeholder", "disabled"], Ot = ["disabled"], Pt = /* @__PURE__ */ Y({
|
648
647
|
__name: "range-input",
|
649
648
|
props: {
|
650
649
|
id: {},
|
@@ -670,85 +669,85 @@ const Kt = /* @__PURE__ */ N({
|
|
670
669
|
sort: {}
|
671
670
|
},
|
672
671
|
emits: ["update:modelValue", "change", "clear"],
|
673
|
-
setup(
|
674
|
-
const l =
|
675
|
-
|
676
|
-
),
|
677
|
-
get: () =>
|
672
|
+
setup(i, { expose: r, emit: d }) {
|
673
|
+
const l = Ye(), a = Dt(), n = i, m = V(
|
674
|
+
n.modelValue ?? n.default ?? []
|
675
|
+
), h = d, g = E({
|
676
|
+
get: () => n.modelValue ?? m.value,
|
678
677
|
set: (f) => {
|
679
|
-
|
678
|
+
n.modelValue !== void 0 ? h("update:modelValue", f) : m.value = f;
|
680
679
|
}
|
681
680
|
});
|
682
|
-
function
|
683
|
-
|
681
|
+
function k() {
|
682
|
+
h("change", { name: n.name, value: g.value || m.value });
|
684
683
|
}
|
685
684
|
function b() {
|
686
|
-
|
685
|
+
m.value = [], g.value = m.value, h("clear", n.name);
|
687
686
|
}
|
688
|
-
return A(() =>
|
689
|
-
f !== void 0 &&
|
690
|
-
}),
|
687
|
+
return A(() => n.modelValue, (f) => {
|
688
|
+
f !== void 0 && n.layout !== "popover" ? (m.value = f, h("update:modelValue", f)) : m.value = [];
|
689
|
+
}), r({
|
691
690
|
clear: b,
|
692
691
|
currentValue: g
|
693
|
-
}), (f,
|
694
|
-
var
|
695
|
-
return p(),
|
692
|
+
}), (f, y) => {
|
693
|
+
var C, c;
|
694
|
+
return p(), w(F, null, [
|
696
695
|
o("div", null, [
|
697
696
|
o("div", {
|
698
|
-
class:
|
697
|
+
class: j(f.layout === "vertical" ? "inline-flex items-center gap-2" : "space-y-3 p-2")
|
699
698
|
}, [
|
700
699
|
o("div", null, [
|
701
|
-
f.layout !== "vertical" ? (p(),
|
702
|
-
|
700
|
+
f.layout !== "vertical" ? (p(), w("label", jt, "Від")) : S("", !0),
|
701
|
+
I(o("input", {
|
703
702
|
type: "number",
|
704
|
-
class:
|
705
|
-
placeholder: ((
|
703
|
+
class: j(e(l)),
|
704
|
+
placeholder: ((C = f.placeHolder) == null ? void 0 : C[0]) ?? "min",
|
706
705
|
step: "1",
|
707
706
|
style: { outline: "none" },
|
708
|
-
"onUpdate:modelValue":
|
707
|
+
"onUpdate:modelValue": y[0] || (y[0] = (s) => g.value[0] = s),
|
709
708
|
disabled: f.disabled
|
710
|
-
}, null, 10,
|
711
|
-
[
|
709
|
+
}, null, 10, Ft), [
|
710
|
+
[te, g.value[0]]
|
712
711
|
])
|
713
712
|
]),
|
714
|
-
f.layout === "vertical" ? (p(),
|
713
|
+
f.layout === "vertical" ? (p(), w("label", Kt, " - ")) : S("", !0),
|
715
714
|
o("div", null, [
|
716
|
-
f.layout !== "vertical" ? (p(),
|
717
|
-
|
715
|
+
f.layout !== "vertical" ? (p(), w("label", Lt, "До")) : S("", !0),
|
716
|
+
I(o("input", {
|
718
717
|
type: "number",
|
719
|
-
class:
|
718
|
+
class: j(e(l)),
|
720
719
|
placeholder: ((c = f.placeHolder) == null ? void 0 : c[1]) ?? "max",
|
721
720
|
min: "0",
|
722
721
|
max: "1000000000000000",
|
723
722
|
step: "1",
|
724
723
|
style: { outline: "none" },
|
725
|
-
"onUpdate:modelValue":
|
724
|
+
"onUpdate:modelValue": y[1] || (y[1] = (s) => g.value[1] = s),
|
726
725
|
disabled: f.disabled
|
727
|
-
}, null, 10,
|
728
|
-
[
|
726
|
+
}, null, 10, Ut), [
|
727
|
+
[te, g.value[1]]
|
729
728
|
])
|
730
729
|
]),
|
731
|
-
["popover", "inline", "vertical"].includes(f.layout) ? (p(),
|
730
|
+
["popover", "inline", "vertical"].includes(f.layout) ? (p(), w("button", {
|
732
731
|
key: 1,
|
733
|
-
onClick:
|
734
|
-
class:
|
735
|
-
},
|
736
|
-
["popover", "inline"].includes(f.layout) ? (p(),
|
732
|
+
onClick: k,
|
733
|
+
class: j(e(a) + (f.layout === "vertical" ? " w-[50px]" : " bg-blue-100 hover:bg-blue-200"))
|
734
|
+
}, K(f.layout === "vertical" ? "Ok" : "Застосувати"), 3)) : S("", !0),
|
735
|
+
["popover", "inline"].includes(f.layout) ? (p(), w("button", {
|
737
736
|
key: 2,
|
738
737
|
disabled: !(g.value[0] || g.value[1]),
|
739
738
|
onClick: b,
|
740
|
-
class:
|
741
|
-
}, "Очистити", 10,
|
739
|
+
class: j(e(a) + " hover:bg-gray-100")
|
740
|
+
}, "Очистити", 10, Ot)) : S("", !0)
|
742
741
|
], 2)
|
743
742
|
]),
|
744
|
-
(f.cleanable &&
|
743
|
+
(f.cleanable && m.value.length, S("", !0))
|
745
744
|
], 64);
|
746
745
|
};
|
747
746
|
}
|
748
|
-
}),
|
747
|
+
}), It = ["disabled", "title"], Tt = {
|
749
748
|
key: 0,
|
750
749
|
class: "absolute top-0 end-0 inline-flex min-h-[10px] min-w-[10px] z-10 items-center py-0.5 rounded-full text-xs font-medium transform -translate-y-1/2 translate-x-1/2 bg-blue-600 text-white px-1"
|
751
|
-
},
|
750
|
+
}, Ht = { class: "w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, Et = { class: "w-[360px] max-h-[500px] overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 before:w-full p-2" }, Me = /* @__PURE__ */ Y({
|
752
751
|
__name: "popover-field",
|
753
752
|
props: {
|
754
753
|
disabled: { type: Boolean, default: !1 },
|
@@ -759,214 +758,214 @@ const Kt = /* @__PURE__ */ N({
|
|
759
758
|
mode: {},
|
760
759
|
layout: {}
|
761
760
|
},
|
762
|
-
setup(
|
763
|
-
const d =
|
764
|
-
function
|
765
|
-
const t =
|
761
|
+
setup(i, { expose: r }) {
|
762
|
+
const d = i, l = E(() => We(d.mode)), a = V(!1), n = V({ top: 0, left: 0 }), m = V(null), h = V(null), g = V(null);
|
763
|
+
function k() {
|
764
|
+
const t = h.value, x = g.value;
|
766
765
|
if (!t || !x) return;
|
767
|
-
const
|
768
|
-
let { left:
|
769
|
-
|
766
|
+
const v = t.getBoundingClientRect(), u = x.offsetWidth, _ = window.innerWidth, B = v.bottom + 8;
|
767
|
+
let { left: M } = v;
|
768
|
+
M + u > _ && (M = Math.max(_ - u - 10, 10)), n.value = { top: B, left: M };
|
770
769
|
}
|
771
770
|
function b() {
|
772
|
-
|
771
|
+
a.value = !a.value, a.value && ke(() => {
|
773
772
|
var t, x;
|
774
|
-
|
773
|
+
k(), (t = d.fieldRef) != null && t.inputTextRef && ((x = d.fieldRef) == null || x.inputTextRef.focus());
|
775
774
|
});
|
776
775
|
}
|
777
776
|
function f(t) {
|
778
|
-
var x,
|
779
|
-
!((x =
|
777
|
+
var x, v;
|
778
|
+
!((x = m.value) != null && x.contains(t.target)) && !((v = g.value) != null && v.contains(t.target)) && (a.value = !1);
|
780
779
|
}
|
781
|
-
function
|
782
|
-
t.key === "Escape" && (
|
780
|
+
function y(t) {
|
781
|
+
t.key === "Escape" && (a.value = !1);
|
783
782
|
}
|
784
|
-
const
|
783
|
+
const C = V(!1);
|
785
784
|
ue(() => {
|
786
|
-
|
785
|
+
C.value = !0;
|
787
786
|
}), ue(() => {
|
788
|
-
document.addEventListener("click", f, !0), document.addEventListener("keydown",
|
789
|
-
}),
|
790
|
-
document.removeEventListener("click", f, !0), document.removeEventListener("keydown",
|
787
|
+
document.addEventListener("click", f, !0), document.addEventListener("keydown", y), window.addEventListener("scroll", k, !0);
|
788
|
+
}), he(() => {
|
789
|
+
document.removeEventListener("click", f, !0), document.removeEventListener("keydown", y), window.removeEventListener("scroll", k, !0);
|
791
790
|
});
|
792
791
|
function c() {
|
793
|
-
|
792
|
+
a.value = !1;
|
794
793
|
}
|
795
|
-
|
796
|
-
const
|
794
|
+
r({ close: c });
|
795
|
+
const s = E(() => {
|
797
796
|
var x;
|
798
797
|
const t = (x = d.fieldRef) == null ? void 0 : x.selectedLabels;
|
799
798
|
return t ? Array.isArray(t) ? t.length > 0 ? t.join(", ") : d.label ?? "" : String(t) : d.label ?? "";
|
800
799
|
});
|
801
|
-
return (t, x) => (p(),
|
800
|
+
return (t, x) => (p(), w("div", null, [
|
802
801
|
o("button", {
|
803
802
|
onClick: b,
|
804
803
|
disabled: t.disabled,
|
805
804
|
ref_key: "triggerRef",
|
806
|
-
ref:
|
805
|
+
ref: h,
|
807
806
|
title: t.label,
|
808
|
-
class:
|
807
|
+
class: j(l.value + " " + (t.width ? e(ye).getWidthClass(t.width) : "w-full"))
|
809
808
|
}, [
|
810
809
|
o("span", {
|
811
|
-
class:
|
812
|
-
},
|
813
|
-
|
814
|
-
(Array.isArray(t.currentValue) ? t.currentValue === null || t.currentValue.length > 0 : t.currentValue === null || t.currentValue) && t.layout === "inline" ? (p(),
|
815
|
-
], 10,
|
816
|
-
|
810
|
+
class: j(["truncate text-ellipsis block", t.width ? e(ye).getWidthClass(t.width - 50) : "w-full"])
|
811
|
+
}, K(s.value), 3),
|
812
|
+
P(be, { class: "h-4 w-4" }),
|
813
|
+
(Array.isArray(t.currentValue) ? t.currentValue === null || t.currentValue.length > 0 : t.currentValue === null || t.currentValue) && t.layout === "inline" ? (p(), w("span", Tt)) : S("", !0)
|
814
|
+
], 10, It),
|
815
|
+
C.value ? (p(), z(Ue, {
|
817
816
|
key: 0,
|
818
817
|
to: "body"
|
819
818
|
}, [
|
820
|
-
|
819
|
+
I(o("div", {
|
821
820
|
ref_key: "popperRef",
|
822
821
|
ref: g,
|
823
822
|
class: "vsTailwind vs-popover__content bottom-right w-fit fixed z-[1000]",
|
824
|
-
style:
|
823
|
+
style: _e({ top: `${n.value.top}px`, left: `${n.value.left}px` }),
|
825
824
|
"data-inside-popover": ""
|
826
825
|
}, [
|
827
|
-
o("div",
|
828
|
-
o("div",
|
829
|
-
|
826
|
+
o("div", Ht, [
|
827
|
+
o("div", Et, [
|
828
|
+
ee(t.$slots, "default")
|
830
829
|
])
|
831
830
|
])
|
832
831
|
], 4), [
|
833
|
-
[
|
832
|
+
[X, a.value]
|
834
833
|
])
|
835
|
-
])) :
|
834
|
+
])) : S("", !0)
|
836
835
|
]));
|
837
836
|
}
|
838
837
|
});
|
839
|
-
function
|
840
|
-
return String(
|
838
|
+
function Yt(i) {
|
839
|
+
return String(i).charAt(0).toUpperCase() + String(i).slice(1);
|
841
840
|
}
|
842
|
-
class
|
843
|
-
static format(
|
844
|
-
const d =
|
845
|
-
return `${d}-${l}-${
|
841
|
+
class N {
|
842
|
+
static format(r) {
|
843
|
+
const d = r.getFullYear(), l = (r.getMonth() + 1).toString().padStart(2, "0"), a = r.getDate().toString().padStart(2, "0");
|
844
|
+
return `${d}-${l}-${a}`;
|
846
845
|
}
|
847
|
-
static getShiftedDay(
|
848
|
-
const l =
|
846
|
+
static getShiftedDay(r, d = 0) {
|
847
|
+
const l = r ? new Date(r) : /* @__PURE__ */ new Date();
|
849
848
|
return l.setDate(l.getDate() + d), this.format(l);
|
850
849
|
}
|
851
|
-
static getLastWeekRange(
|
852
|
-
if (
|
853
|
-
const
|
854
|
-
return
|
850
|
+
static getLastWeekRange(r, d, l = 0) {
|
851
|
+
if (r && d) {
|
852
|
+
const k = new Date(r), b = new Date(d);
|
853
|
+
return k.setDate(k.getDate() + l * 7), b.setDate(b.getDate() + l * 7), [this.format(k), this.format(b)];
|
855
854
|
}
|
856
|
-
const
|
857
|
-
|
858
|
-
const g = new Date(
|
859
|
-
return g.setDate(
|
860
|
-
}
|
861
|
-
static getMonthRange(
|
862
|
-
let
|
863
|
-
|
864
|
-
const
|
865
|
-
return [this.format(
|
866
|
-
}
|
867
|
-
static getQuarterRange(
|
868
|
-
const
|
869
|
-
let
|
870
|
-
|
871
|
-
const
|
872
|
-
return [this.format(
|
873
|
-
}
|
874
|
-
static getYear(
|
855
|
+
const a = /* @__PURE__ */ new Date(), n = a.getDay(), m = n === 0 ? 13 : n - 1 + 7, h = new Date(a);
|
856
|
+
h.setDate(a.getDate() - m + l * 7);
|
857
|
+
const g = new Date(h);
|
858
|
+
return g.setDate(h.getDate() + 6), [this.format(h), this.format(g)];
|
859
|
+
}
|
860
|
+
static getMonthRange(r, d, l = 0) {
|
861
|
+
let a;
|
862
|
+
r ? a = new Date(r) : a = /* @__PURE__ */ new Date(), a = new Date(a.getFullYear(), a.getMonth() + l, 1);
|
863
|
+
const n = a, m = new Date(a.getFullYear(), a.getMonth() + 1, 0);
|
864
|
+
return [this.format(n), this.format(m)];
|
865
|
+
}
|
866
|
+
static getQuarterRange(r, d, l = 0) {
|
867
|
+
const a = r || d, n = a ? new Date(a) : /* @__PURE__ */ new Date();
|
868
|
+
let m = Math.floor(n.getMonth() / 3);
|
869
|
+
m += l;
|
870
|
+
const h = (m % 4 + 4) % 4 * 3, g = n.getFullYear() + Math.floor(m / 4), k = new Date(g, h, 1), b = new Date(g, h + 3, 0);
|
871
|
+
return [this.format(k), this.format(b)];
|
872
|
+
}
|
873
|
+
static getYear(r, d = 0) {
|
875
874
|
let l;
|
876
|
-
return
|
875
|
+
return r && /^\d{4}$/.test(r) ? l = parseInt(r, 10) : r ? l = new Date(r).getFullYear() : l = (/* @__PURE__ */ new Date()).getFullYear(), String(l + d);
|
877
876
|
}
|
878
|
-
static getYearRange(
|
877
|
+
static getYearRange(r, d = 0) {
|
879
878
|
let l;
|
880
|
-
return
|
879
|
+
return r && /^\d{4}$/.test(r) ? l = parseInt(r, 10) : r ? l = new Date(r).getFullYear() : l = (/* @__PURE__ */ new Date()).getFullYear(), [
|
881
880
|
this.format(new Date(l + d, 0, 1)),
|
882
881
|
this.format(new Date(l + d + 1, 0, 0))
|
883
882
|
];
|
884
883
|
}
|
885
|
-
static getRangeFromDaysBefore(
|
884
|
+
static getRangeFromDaysBefore(r) {
|
886
885
|
const d = /* @__PURE__ */ new Date(), l = new Date(d.getTime());
|
887
|
-
return l.setDate(d.getDate() -
|
886
|
+
return l.setDate(d.getDate() - r), [this.format(l), this.format(d)];
|
888
887
|
}
|
889
888
|
}
|
890
|
-
function
|
889
|
+
function qe(i, r) {
|
891
890
|
const {
|
892
891
|
popoverRef: d
|
893
|
-
} =
|
894
|
-
|
895
|
-
),
|
896
|
-
function
|
897
|
-
const
|
898
|
-
return
|
892
|
+
} = i, l = V(""), a = V(
|
893
|
+
i.modelValue ?? i.default ?? []
|
894
|
+
), n = V(0);
|
895
|
+
function m() {
|
896
|
+
const s = N.getRangeFromDaysBefore(n.value);
|
897
|
+
return a.value = [...s], r("change", { name: i.name, value: a.value }), r("update:modelValue", a.value), s;
|
899
898
|
}
|
900
|
-
function
|
899
|
+
function h(s) {
|
901
900
|
var x;
|
902
|
-
l.value =
|
901
|
+
l.value = s, (x = d.value) == null || x.close();
|
903
902
|
const t = [];
|
904
903
|
switch (l.value) {
|
905
904
|
case "today":
|
906
|
-
t.push(
|
905
|
+
t.push(N.getShiftedDay()), t.push(N.getShiftedDay());
|
907
906
|
break;
|
908
907
|
case "week":
|
909
|
-
t.push(...
|
908
|
+
t.push(...N.getLastWeekRange());
|
910
909
|
break;
|
911
910
|
case "month":
|
912
|
-
t.push(...
|
911
|
+
t.push(...N.getMonthRange());
|
913
912
|
break;
|
914
913
|
case "quarter":
|
915
|
-
t.push(...
|
914
|
+
t.push(...N.getQuarterRange());
|
916
915
|
break;
|
917
916
|
case "year":
|
918
|
-
t.push(...
|
917
|
+
t.push(...N.getYearRange());
|
919
918
|
break;
|
920
919
|
case "last_7_days":
|
921
|
-
|
920
|
+
n.value = 7, m();
|
922
921
|
break;
|
923
922
|
case "range":
|
924
|
-
|
923
|
+
n.value = 7, t.push(...m());
|
925
924
|
break;
|
926
925
|
}
|
927
|
-
|
926
|
+
a.value = [...t], r("change", { name: i.name, value: a.value }), r("update:modelValue", a.value);
|
928
927
|
}
|
929
928
|
function g() {
|
930
|
-
const
|
929
|
+
const s = [];
|
931
930
|
switch (l.value) {
|
932
931
|
case "today":
|
933
|
-
|
932
|
+
s.push(N.getShiftedDay(a.value[0], 1));
|
934
933
|
break;
|
935
934
|
case "week":
|
936
|
-
|
935
|
+
s.push(...N.getLastWeekRange(a.value[0], a.value[1], 1));
|
937
936
|
break;
|
938
937
|
case "month":
|
939
|
-
|
938
|
+
s.push(...N.getMonthRange(a.value[0], a.value[1], 1));
|
940
939
|
break;
|
941
940
|
case "quarter":
|
942
|
-
|
941
|
+
s.push(...N.getQuarterRange(a.value[0], a.value[1], 1));
|
943
942
|
break;
|
944
943
|
case "year":
|
945
|
-
|
944
|
+
s.push(...N.getYearRange(a.value[0], 1));
|
946
945
|
break;
|
947
946
|
}
|
948
|
-
|
947
|
+
a.value = [...s], r("change", { name: i.name, value: a.value }), r("update:modelValue", a.value);
|
949
948
|
}
|
950
|
-
function
|
951
|
-
const
|
949
|
+
function k() {
|
950
|
+
const s = [];
|
952
951
|
switch (l.value) {
|
953
952
|
case "today":
|
954
|
-
|
953
|
+
s.push(N.getShiftedDay(a.value[0], -1));
|
955
954
|
break;
|
956
955
|
case "week":
|
957
|
-
|
956
|
+
s.push(...N.getLastWeekRange(a.value[0], a.value[1], -1));
|
958
957
|
break;
|
959
958
|
case "month":
|
960
|
-
|
959
|
+
s.push(...N.getMonthRange(a.value[0], a.value[1], -1));
|
961
960
|
break;
|
962
961
|
case "quarter":
|
963
|
-
|
962
|
+
s.push(...N.getQuarterRange(a.value[0], a.value[1], -1));
|
964
963
|
break;
|
965
964
|
case "year":
|
966
|
-
|
965
|
+
s.push(...N.getYearRange(a.value[0], -1));
|
967
966
|
break;
|
968
967
|
}
|
969
|
-
|
968
|
+
a.value = [...s], r("change", { name: i.name, value: a.value }), r("update:modelValue", a.value);
|
970
969
|
}
|
971
970
|
const b = [
|
972
971
|
"Січень",
|
@@ -982,13 +981,13 @@ function He(s, a) {
|
|
982
981
|
"Листопад",
|
983
982
|
"Грудень"
|
984
983
|
];
|
985
|
-
function f(
|
986
|
-
const [t, x,
|
987
|
-
return `${
|
984
|
+
function f(s) {
|
985
|
+
const [t, x, v] = s.split("-");
|
986
|
+
return `${v}.${x}.${t}`;
|
988
987
|
}
|
989
|
-
function
|
990
|
-
const { value: t } =
|
991
|
-
switch (
|
988
|
+
function y(s) {
|
989
|
+
const { value: t } = a;
|
990
|
+
switch (s) {
|
992
991
|
case "today":
|
993
992
|
return f(t[0]);
|
994
993
|
case "range":
|
@@ -997,14 +996,14 @@ function He(s, a) {
|
|
997
996
|
return t[0] && t[1] ? `${f(t[0])} – ${f(t[1])}` : "";
|
998
997
|
case "quarter":
|
999
998
|
if (t[0]) {
|
1000
|
-
const x = new Date(t[0]),
|
1001
|
-
return `${Math.floor(
|
999
|
+
const x = new Date(t[0]), v = x.getFullYear(), u = x.getMonth();
|
1000
|
+
return `${Math.floor(u / 3) + 1} квартал ${v}`;
|
1002
1001
|
}
|
1003
1002
|
return "";
|
1004
1003
|
case "month":
|
1005
1004
|
if (t[0]) {
|
1006
|
-
const [x,
|
1007
|
-
return `${b[parseInt(
|
1005
|
+
const [x, v] = t[0].split("-");
|
1006
|
+
return `${b[parseInt(v, 10) - 1]} ${x}`;
|
1008
1007
|
}
|
1009
1008
|
return "";
|
1010
1009
|
case "year":
|
@@ -1012,45 +1011,44 @@ function He(s, a) {
|
|
1012
1011
|
case "last_7_days":
|
1013
1012
|
return "За останні дні";
|
1014
1013
|
default:
|
1015
|
-
return
|
1014
|
+
return i.label ?? "";
|
1016
1015
|
}
|
1017
1016
|
}
|
1018
|
-
const
|
1017
|
+
const C = E(() => l.value ? y(l.value) : i.label ?? "");
|
1019
1018
|
function c() {
|
1020
|
-
l.value = "",
|
1019
|
+
l.value = "", a.value = [], r("update:modelValue", []), r("clear", i.name);
|
1021
1020
|
}
|
1022
1021
|
return {
|
1023
1022
|
activeMode: l,
|
1024
|
-
innerValue:
|
1025
|
-
daysBefore:
|
1026
|
-
onDaysBeforeChange:
|
1027
|
-
onSelectChange:
|
1023
|
+
innerValue: a,
|
1024
|
+
daysBefore: n,
|
1025
|
+
onDaysBeforeChange: m,
|
1026
|
+
onSelectChange: h,
|
1028
1027
|
nextClick: g,
|
1029
|
-
prevClick:
|
1028
|
+
prevClick: k,
|
1030
1029
|
ukMonths: b,
|
1031
1030
|
formatDisplayDate: f,
|
1032
|
-
getModeLabel:
|
1033
|
-
currentLabel:
|
1031
|
+
getModeLabel: y,
|
1032
|
+
currentLabel: C,
|
1034
1033
|
clear: c
|
1035
1034
|
};
|
1036
1035
|
}
|
1037
|
-
const
|
1036
|
+
const Wt = {
|
1038
1037
|
key: 0,
|
1039
1038
|
class: "relative flex w-full h-auto gap-2 filter-date m-2 flex-wrap"
|
1040
|
-
},
|
1039
|
+
}, qt = {
|
1041
1040
|
key: 0,
|
1042
1041
|
class: "flex gap-1 !w-[75%] rounded-lg"
|
1043
|
-
}, Nt = ["max", "disabled"],
|
1042
|
+
}, Nt = ["max", "disabled"], Gt = ["min", "disabled"], Qt = {
|
1044
1043
|
key: 0,
|
1045
1044
|
class: "block text-xs font-medium text-gray-600 mb-1"
|
1046
|
-
},
|
1045
|
+
}, Zt = ["max", "disabled"], Jt = {
|
1047
1046
|
key: 0,
|
1048
1047
|
class: "block text-xs font-medium text-gray-600 mb-1"
|
1049
|
-
},
|
1048
|
+
}, Xt = {
|
1050
1049
|
key: 0,
|
1051
1050
|
class: "block text-xs font-medium text-gray-600 mb-1"
|
1052
|
-
},
|
1053
|
-
const el = /* @__PURE__ */ N({
|
1051
|
+
}, el = ["min", "disabled"], tl = { class: "flex gap-1 pt-2" }, ll = ["onClick"], al = /* @__PURE__ */ Y({
|
1054
1052
|
__name: "date-input",
|
1055
1053
|
props: {
|
1056
1054
|
id: {},
|
@@ -1076,231 +1074,231 @@ const el = /* @__PURE__ */ N({
|
|
1076
1074
|
sort: {}
|
1077
1075
|
},
|
1078
1076
|
emits: ["update:modelValue", "change", "clear"],
|
1079
|
-
setup(
|
1080
|
-
const l =
|
1077
|
+
setup(i, { expose: r, emit: d }) {
|
1078
|
+
const l = i, a = Ye(), n = zt(), m = d, h = V(null), {
|
1081
1079
|
activeMode: g,
|
1082
|
-
innerValue:
|
1080
|
+
innerValue: k,
|
1083
1081
|
onSelectChange: b,
|
1084
1082
|
nextClick: f,
|
1085
|
-
prevClick:
|
1086
|
-
clear:
|
1087
|
-
} =
|
1083
|
+
prevClick: y,
|
1084
|
+
clear: C
|
1085
|
+
} = qe({
|
1088
1086
|
...l,
|
1089
|
-
popoverRef:
|
1090
|
-
},
|
1087
|
+
popoverRef: h
|
1088
|
+
}, m);
|
1091
1089
|
return A(() => l.modelValue, (c) => {
|
1092
|
-
c !== void 0 ? (
|
1093
|
-
}),
|
1094
|
-
clear:
|
1095
|
-
popoverRef:
|
1096
|
-
}), (c,
|
1097
|
-
c.layout === "inline" ? (p(),
|
1098
|
-
e(g) !== "" && e(g) === "range" ? (p(),
|
1099
|
-
|
1090
|
+
c !== void 0 ? (k.value = c, m("update:modelValue", c)) : (g.value = "", k.value = []);
|
1091
|
+
}), r({
|
1092
|
+
clear: C,
|
1093
|
+
popoverRef: h
|
1094
|
+
}), (c, s) => (p(), w(F, null, [
|
1095
|
+
c.layout === "inline" ? (p(), w("div", Wt, [
|
1096
|
+
e(g) !== "" && e(g) === "range" ? (p(), w("div", qt, [
|
1097
|
+
I(o("input", {
|
1100
1098
|
type: "date",
|
1101
|
-
max: e(
|
1099
|
+
max: e(k)[1],
|
1102
1100
|
locale: "uk-UA",
|
1103
|
-
"onUpdate:modelValue":
|
1101
|
+
"onUpdate:modelValue": s[0] || (s[0] = (t) => e(k)[0] = t),
|
1104
1102
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",
|
1105
1103
|
disabled: c.disabled
|
1106
1104
|
}, null, 8, Nt), [
|
1107
|
-
[
|
1105
|
+
[te, e(k)[0]]
|
1108
1106
|
]),
|
1109
|
-
|
1107
|
+
I(o("input", {
|
1110
1108
|
type: "date",
|
1111
|
-
min: e(
|
1109
|
+
min: e(k)[0],
|
1112
1110
|
locale: "uk-UA",
|
1113
|
-
"onUpdate:modelValue":
|
1111
|
+
"onUpdate:modelValue": s[1] || (s[1] = (t) => e(k)[1] = t),
|
1114
1112
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",
|
1115
1113
|
disabled: c.disabled
|
1116
|
-
}, null, 8,
|
1117
|
-
[
|
1114
|
+
}, null, 8, Gt), [
|
1115
|
+
[te, e(k)[1]]
|
1118
1116
|
])
|
1119
|
-
])) :
|
1120
|
-
])) :
|
1117
|
+
])) : S("", !0)
|
1118
|
+
])) : S("", !0),
|
1121
1119
|
o("div", {
|
1122
|
-
class:
|
1120
|
+
class: j(c.layout === "popover" ? "space-y-3 p-2" : "flex items-center gap-2")
|
1123
1121
|
}, [
|
1124
1122
|
o("div", {
|
1125
|
-
class:
|
1123
|
+
class: j(c.layout !== "popover" ? "w-[48%]" : "")
|
1126
1124
|
}, [
|
1127
|
-
c.layout === "popover" ? (p(),
|
1128
|
-
|
1125
|
+
c.layout === "popover" ? (p(), w("label", Qt, "Від")) : S("", !0),
|
1126
|
+
I(o("input", {
|
1129
1127
|
type: "date",
|
1130
|
-
max: e(
|
1128
|
+
max: e(k)[1],
|
1131
1129
|
locale: "uk-UA",
|
1132
|
-
"onUpdate:modelValue":
|
1133
|
-
class:
|
1130
|
+
"onUpdate:modelValue": s[2] || (s[2] = (t) => e(k)[0] = t),
|
1131
|
+
class: j(e(a)),
|
1134
1132
|
disabled: c.disabled
|
1135
|
-
}, null, 10,
|
1136
|
-
[
|
1133
|
+
}, null, 10, Zt), [
|
1134
|
+
[te, e(k)[0]]
|
1137
1135
|
])
|
1138
1136
|
], 2),
|
1139
|
-
c.layout !== "popover" ? (p(),
|
1137
|
+
c.layout !== "popover" ? (p(), w("label", Jt, " - ")) : S("", !0),
|
1140
1138
|
o("div", {
|
1141
|
-
class:
|
1139
|
+
class: j(c.layout !== "popover" ? "w-[48%]" : "")
|
1142
1140
|
}, [
|
1143
|
-
c.layout === "popover" ? (p(),
|
1144
|
-
|
1141
|
+
c.layout === "popover" ? (p(), w("label", Xt, "До")) : S("", !0),
|
1142
|
+
I(o("input", {
|
1145
1143
|
type: "date",
|
1146
|
-
min: e(
|
1144
|
+
min: e(k)[0],
|
1147
1145
|
locale: "uk-UA",
|
1148
|
-
"onUpdate:modelValue":
|
1149
|
-
class:
|
1146
|
+
"onUpdate:modelValue": s[3] || (s[3] = (t) => e(k)[1] = t),
|
1147
|
+
class: j(e(a)),
|
1150
1148
|
disabled: c.disabled
|
1151
|
-
}, null, 10,
|
1152
|
-
[
|
1149
|
+
}, null, 10, el), [
|
1150
|
+
[te, e(k)[1]]
|
1153
1151
|
])
|
1154
1152
|
], 2)
|
1155
1153
|
], 2),
|
1156
|
-
o("div",
|
1157
|
-
(p(),
|
1154
|
+
o("div", tl, [
|
1155
|
+
(p(), w(F, null, q(["today", "week", "month", "quarter", "year"], (t) => o("button", {
|
1158
1156
|
key: t,
|
1159
|
-
class:
|
1157
|
+
class: j(e(n) + (e(g) === t ? " bg-blue-100" : "")),
|
1160
1158
|
onClick: (x) => e(b)(t)
|
1161
|
-
},
|
1159
|
+
}, K(e(Yt)(t)), 11, ll)), 64)),
|
1162
1160
|
o("button", {
|
1163
|
-
class:
|
1164
|
-
onClick:
|
1165
|
-
(...t) => e(
|
1161
|
+
class: j(e(n)),
|
1162
|
+
onClick: s[4] || (s[4] = //@ts-ignore
|
1163
|
+
(...t) => e(y) && e(y)(...t))
|
1166
1164
|
}, " <", 2),
|
1167
1165
|
o("button", {
|
1168
|
-
class:
|
1169
|
-
onClick:
|
1166
|
+
class: j(e(n)),
|
1167
|
+
onClick: s[5] || (s[5] = //@ts-ignore
|
1170
1168
|
(...t) => e(f) && e(f)(...t))
|
1171
1169
|
}, " >", 2)
|
1172
1170
|
]),
|
1173
|
-
(c.cleanable,
|
1171
|
+
(c.cleanable, S("", !0))
|
1174
1172
|
], 64));
|
1175
1173
|
}
|
1176
1174
|
});
|
1177
|
-
function
|
1175
|
+
function ol(i, r) {
|
1178
1176
|
const {
|
1179
1177
|
api: d,
|
1180
1178
|
options: l = [],
|
1181
|
-
limit:
|
1182
|
-
dataKey:
|
1183
|
-
} =
|
1184
|
-
function
|
1185
|
-
return
|
1179
|
+
limit: a = 20,
|
1180
|
+
dataKey: n = "data"
|
1181
|
+
} = i, m = i.multi;
|
1182
|
+
function h($) {
|
1183
|
+
return m ? Array.isArray($) ? $ : $ ? [$] : [] : Array.isArray($) ? $[0] : $;
|
1186
1184
|
}
|
1187
|
-
const g =
|
1188
|
-
function
|
1189
|
-
const
|
1190
|
-
return { autoValueKey: G, autoLabelKey:
|
1185
|
+
const g = V(h(i.modelValue)), k = V(""), b = V(!1), f = V([]), y = V("id"), C = V("text"), c = V(!1), s = V(i.layout !== "popover" && l.length > a), t = V([]), x = V(0);
|
1186
|
+
function v($) {
|
1187
|
+
const O = $.find(Boolean) ?? {}, G = ["id", "value", "code", "key"].find((ae) => ae in O) ?? "id", ie = ["text", "label", "name", "title"].find((ae) => ae in O) ?? "text";
|
1188
|
+
return { autoValueKey: G, autoLabelKey: ie };
|
1191
1189
|
}
|
1192
1190
|
if (l.length > 0) {
|
1193
|
-
const
|
1194
|
-
|
1191
|
+
const $ = v(l);
|
1192
|
+
y.value = $.autoValueKey, C.value = $.autoLabelKey;
|
1195
1193
|
}
|
1196
|
-
const
|
1194
|
+
const u = E(() => {
|
1197
1195
|
if (d) return f.value;
|
1198
|
-
const
|
1199
|
-
if (
|
1200
|
-
if (!
|
1201
|
-
return c.value ?
|
1202
|
-
const
|
1203
|
-
return
|
1196
|
+
const $ = f.value;
|
1197
|
+
if (i.layout === "popover") return $;
|
1198
|
+
if (!k.value)
|
1199
|
+
return c.value ? $ : $.slice(0, a);
|
1200
|
+
const O = k.value.toLowerCase();
|
1201
|
+
return $.filter((G) => G[C.value].toLowerCase().includes(O));
|
1204
1202
|
});
|
1205
|
-
let
|
1206
|
-
async function B(
|
1203
|
+
let _ = null;
|
1204
|
+
async function B($) {
|
1207
1205
|
if (d) {
|
1208
1206
|
b.value = !0;
|
1209
1207
|
try {
|
1210
|
-
const
|
1211
|
-
|
1212
|
-
const G = await fetch(
|
1208
|
+
const O = new URL(d, window.location.origin);
|
1209
|
+
O.searchParams.set("json", "1"), O.searchParams.set("key", $), O.searchParams.set("limit", a.toString());
|
1210
|
+
const G = await fetch(O.toString());
|
1213
1211
|
if (!G.ok)
|
1214
1212
|
throw new Error(`HTTP error! status: ${G.status}`);
|
1215
|
-
const
|
1216
|
-
if (f.value =
|
1217
|
-
const
|
1218
|
-
|
1213
|
+
const ie = await G.json();
|
1214
|
+
if (f.value = ie[n], f.value.length > 0) {
|
1215
|
+
const ae = v(f.value);
|
1216
|
+
y.value = ae.autoValueKey, C.value = ae.autoLabelKey;
|
1219
1217
|
}
|
1220
|
-
x.value =
|
1221
|
-
} catch (
|
1222
|
-
console.error("Failed to fetch remote options:",
|
1218
|
+
x.value = ie.total;
|
1219
|
+
} catch (O) {
|
1220
|
+
console.error("Failed to fetch remote options:", O);
|
1223
1221
|
} finally {
|
1224
1222
|
b.value = !1;
|
1225
1223
|
}
|
1226
1224
|
}
|
1227
1225
|
}
|
1228
|
-
A(
|
1229
|
-
d && (
|
1230
|
-
B(
|
1226
|
+
A(k, ($) => {
|
1227
|
+
d && (_ && clearTimeout(_), _ = setTimeout(() => {
|
1228
|
+
B($);
|
1231
1229
|
}, 200));
|
1232
|
-
}), A(() =>
|
1233
|
-
g.value =
|
1230
|
+
}), A(() => i.modelValue, ($) => {
|
1231
|
+
g.value = h($);
|
1234
1232
|
}, { immediate: !0 }), d ? B("") : f.value = l;
|
1235
|
-
function
|
1236
|
-
return
|
1233
|
+
function M($) {
|
1234
|
+
return m && Array.isArray(g.value) ? g.value.includes($[y.value]) : g.value && g.value === $[y.value];
|
1237
1235
|
}
|
1238
|
-
function
|
1239
|
-
if (
|
1240
|
-
const
|
1241
|
-
g.value =
|
1236
|
+
function L($) {
|
1237
|
+
if (m && !Array.isArray(g.value) && (g.value = []), m && Array.isArray(g.value)) {
|
1238
|
+
const O = g.value.includes($[y.value]);
|
1239
|
+
g.value = O ? g.value.filter((G) => G !== $[y.value]) : [...g.value, $[y.value]], t.value = O ? t.value.filter((G) => G !== $[C.value]) : [...t.value, $[C.value]];
|
1242
1240
|
} else
|
1243
|
-
g.value =
|
1244
|
-
|
1241
|
+
g.value = $[y.value], t.value = $[C.value];
|
1242
|
+
r("update:modelValue", g.value), r("change", { name: i.name, value: g.value });
|
1245
1243
|
}
|
1246
|
-
function
|
1247
|
-
|
1244
|
+
function T() {
|
1245
|
+
m ? (g.value = [], t.value = []) : (g.value = void 0, t.value = []), r("update:modelValue", g.value), r("clear", i.name);
|
1248
1246
|
}
|
1249
|
-
function
|
1250
|
-
|
1247
|
+
function U() {
|
1248
|
+
_ && clearTimeout(_), k.value = "", c.value = !1;
|
1251
1249
|
}
|
1252
1250
|
function de() {
|
1253
1251
|
c.value = !c.value;
|
1254
1252
|
}
|
1255
|
-
|
1256
|
-
|
1253
|
+
he(() => {
|
1254
|
+
_ && clearTimeout(_);
|
1257
1255
|
});
|
1258
|
-
const J =
|
1259
|
-
A(
|
1260
|
-
J.value =
|
1256
|
+
const J = V(-1);
|
1257
|
+
A(u, () => {
|
1258
|
+
J.value = u.value.length > 0 ? 0 : -1;
|
1261
1259
|
});
|
1262
|
-
function
|
1263
|
-
const
|
1264
|
-
if (
|
1265
|
-
|
1266
|
-
else if (
|
1267
|
-
|
1268
|
-
else if (
|
1269
|
-
const G =
|
1270
|
-
|
1260
|
+
function H($) {
|
1261
|
+
const O = u.value.length;
|
1262
|
+
if ($.key === "ArrowDown")
|
1263
|
+
$.preventDefault(), J.value = (J.value + 1) % O;
|
1264
|
+
else if ($.key === "ArrowUp")
|
1265
|
+
$.preventDefault(), J.value = (J.value - 1 + O) % O;
|
1266
|
+
else if ($.key === "Enter" && ($.preventDefault(), J.value >= 0 && J.value < u.value.length)) {
|
1267
|
+
const G = u.value[J.value];
|
1268
|
+
L(G);
|
1271
1269
|
}
|
1272
1270
|
}
|
1273
1271
|
return {
|
1274
1272
|
innerValue: g,
|
1275
|
-
searchTerm:
|
1276
|
-
filteredOptions:
|
1277
|
-
isSelected:
|
1278
|
-
selectItem:
|
1279
|
-
clear:
|
1280
|
-
resetSearch:
|
1273
|
+
searchTerm: k,
|
1274
|
+
filteredOptions: u,
|
1275
|
+
isSelected: M,
|
1276
|
+
selectItem: L,
|
1277
|
+
clear: T,
|
1278
|
+
resetSearch: U,
|
1281
1279
|
toggleShowAll: de,
|
1282
1280
|
isReqProc: b,
|
1283
1281
|
showAll: c,
|
1284
|
-
isEnableShowAll:
|
1285
|
-
labelKey:
|
1286
|
-
valueKey:
|
1282
|
+
isEnableShowAll: s,
|
1283
|
+
labelKey: C,
|
1284
|
+
valueKey: y,
|
1287
1285
|
allOptions: f,
|
1288
1286
|
highlightedIndex: J,
|
1289
|
-
onKeyDown:
|
1287
|
+
onKeyDown: H,
|
1290
1288
|
selectedLabels: t,
|
1291
1289
|
totalCount: x
|
1292
1290
|
};
|
1293
1291
|
}
|
1294
|
-
const
|
1292
|
+
const rl = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relative justify-center" }, nl = {
|
1295
1293
|
key: 0,
|
1296
1294
|
class: "w-full"
|
1297
|
-
},
|
1295
|
+
}, il = { class: "flex flex-col items-center justify-center p-5 text-center" }, sl = {
|
1298
1296
|
key: 0,
|
1299
1297
|
class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
|
1300
|
-
},
|
1298
|
+
}, ul = {
|
1301
1299
|
key: 1,
|
1302
1300
|
class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
|
1303
|
-
},
|
1301
|
+
}, dl = /* @__PURE__ */ Y({
|
1304
1302
|
__name: "select",
|
1305
1303
|
props: {
|
1306
1304
|
id: {},
|
@@ -1326,155 +1324,155 @@ const ll = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
1326
1324
|
sort: {}
|
1327
1325
|
},
|
1328
1326
|
emits: ["update:modelValue", "change", "clear"],
|
1329
|
-
setup(
|
1330
|
-
const l =
|
1331
|
-
innerValue:
|
1332
|
-
filteredOptions:
|
1327
|
+
setup(i, { expose: r, emit: d }) {
|
1328
|
+
const l = i, a = d, n = V(null), {
|
1329
|
+
innerValue: m,
|
1330
|
+
filteredOptions: h,
|
1333
1331
|
isSelected: g,
|
1334
|
-
selectItem:
|
1332
|
+
selectItem: k,
|
1335
1333
|
clear: b,
|
1336
1334
|
resetSearch: f,
|
1337
|
-
toggleShowAll:
|
1338
|
-
isReqProc:
|
1335
|
+
toggleShowAll: y,
|
1336
|
+
isReqProc: C,
|
1339
1337
|
showAll: c,
|
1340
|
-
isEnableShowAll:
|
1338
|
+
isEnableShowAll: s,
|
1341
1339
|
searchTerm: t,
|
1342
1340
|
labelKey: x,
|
1343
|
-
valueKey:
|
1344
|
-
highlightedIndex:
|
1345
|
-
onKeyDown:
|
1341
|
+
valueKey: v,
|
1342
|
+
highlightedIndex: u,
|
1343
|
+
onKeyDown: _,
|
1346
1344
|
selectedLabels: B,
|
1347
|
-
totalCount:
|
1348
|
-
} =
|
1345
|
+
totalCount: M
|
1346
|
+
} = ol({
|
1349
1347
|
...l,
|
1350
1348
|
modelValue: l.modelValue
|
1351
|
-
},
|
1349
|
+
}, a);
|
1352
1350
|
ue(() => {
|
1353
1351
|
f();
|
1354
1352
|
}), A(
|
1355
1353
|
() => l.modelValue,
|
1356
|
-
(
|
1357
|
-
|
1354
|
+
(T) => {
|
1355
|
+
T === void 0 && (l.multi ? m.value = [] : m.value = void 0);
|
1358
1356
|
}
|
1359
1357
|
);
|
1360
|
-
const
|
1361
|
-
return A(
|
1362
|
-
var
|
1363
|
-
|
1358
|
+
const L = V([]);
|
1359
|
+
return A(u, (T) => {
|
1360
|
+
var U;
|
1361
|
+
T >= 0 && L.value[T] && ((U = L.value[T]) == null || U.scrollIntoView({
|
1364
1362
|
block: "nearest",
|
1365
1363
|
behavior: "smooth"
|
1366
1364
|
}));
|
1367
|
-
}), A(
|
1368
|
-
|
1369
|
-
}),
|
1365
|
+
}), A(h, () => {
|
1366
|
+
L.value = [];
|
1367
|
+
}), r({
|
1370
1368
|
clear: b,
|
1371
|
-
inputTextRef:
|
1369
|
+
inputTextRef: n,
|
1372
1370
|
selectedLabels: B
|
1373
|
-
}), (
|
1371
|
+
}), (T, U) => {
|
1374
1372
|
var de, J;
|
1375
|
-
return p(),
|
1376
|
-
class:
|
1373
|
+
return p(), w("div", {
|
1374
|
+
class: j([T.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
|
1377
1375
|
}, [
|
1378
|
-
o("div",
|
1379
|
-
|
1380
|
-
"onUpdate:modelValue":
|
1381
|
-
onKeydown:
|
1382
|
-
(...
|
1376
|
+
o("div", rl, [
|
1377
|
+
I(o("input", {
|
1378
|
+
"onUpdate:modelValue": U[0] || (U[0] = (H) => Qe(t) ? t.value = H : null),
|
1379
|
+
onKeydown: U[1] || (U[1] = //@ts-ignore
|
1380
|
+
(...H) => e(_) && e(_)(...H)),
|
1383
1381
|
class: "w-full h-full text-[13px] px-4 border rounded-sm pl-9 focus:outline-none focus:ring-ring focus:ring-1 focus:ring-blue-500",
|
1384
1382
|
placeholder: "Пошук",
|
1385
1383
|
type: "text",
|
1386
1384
|
ref_key: "inputTextRef",
|
1387
|
-
ref:
|
1385
|
+
ref: n
|
1388
1386
|
}, null, 544), [
|
1389
|
-
[
|
1387
|
+
[te, e(t)]
|
1390
1388
|
]),
|
1391
|
-
|
1392
|
-
|
1393
|
-
onClick:
|
1389
|
+
P(He, { class: "absolute text-gray-400 -translate-y-1/2 left-4 top-1/2" }),
|
1390
|
+
P(Ee, {
|
1391
|
+
onClick: U[2] || (U[2] = (H) => t.value = ""),
|
1394
1392
|
class: "absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"
|
1395
1393
|
})
|
1396
1394
|
]),
|
1397
1395
|
o("div", {
|
1398
|
-
class:
|
1399
|
-
|
1400
|
-
|
1396
|
+
class: j([
|
1397
|
+
T.layout === "popover" ? "flex-1 overflow-y-auto max-h-64 p-2" : "",
|
1398
|
+
T.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
|
1401
1399
|
])
|
1402
1400
|
}, [
|
1403
|
-
(p(!0),
|
1404
|
-
layout:
|
1405
|
-
count:
|
1406
|
-
label:
|
1407
|
-
color:
|
1408
|
-
type:
|
1409
|
-
value:
|
1410
|
-
"is-selected": e(g)(
|
1411
|
-
highlighted:
|
1412
|
-
onItemClick: (
|
1401
|
+
(p(!0), w(F, null, q(e(h), (H, $) => (p(), z(Ce, {
|
1402
|
+
layout: T.layout,
|
1403
|
+
count: H.count,
|
1404
|
+
label: H[e(x)],
|
1405
|
+
color: H.color,
|
1406
|
+
type: T.multi ? "checkbox" : "radio",
|
1407
|
+
value: H[e(v)],
|
1408
|
+
"is-selected": e(g)(H),
|
1409
|
+
highlighted: $ === e(u),
|
1410
|
+
onItemClick: (O) => e(k)(H),
|
1413
1411
|
ref_for: !0,
|
1414
|
-
ref: (
|
1412
|
+
ref: (O) => L.value[$] = O == null ? void 0 : O.el
|
1415
1413
|
}, null, 8, ["layout", "count", "label", "color", "type", "value", "is-selected", "highlighted", "onItemClick"]))), 256))
|
1416
1414
|
], 2),
|
1417
|
-
|
1418
|
-
o("div",
|
1419
|
-
|
1420
|
-
|
1415
|
+
T.type === "select" && e(h).length === 0 && !e(C) ? (p(), w("div", nl, [
|
1416
|
+
o("div", il, [
|
1417
|
+
P(Ve),
|
1418
|
+
U[7] || (U[7] = o("div", { class: "max-w-sm mx-auto mt-6" }, [
|
1421
1419
|
o("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
|
1422
1420
|
o("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
|
1423
1421
|
], -1))
|
1424
1422
|
])
|
1425
|
-
])) :
|
1426
|
-
|
1427
|
-
!e(c) && e(
|
1423
|
+
])) : S("", !0),
|
1424
|
+
T.layout !== "popover" && T.type !== "select" ? (p(), w(F, { key: 1 }, [
|
1425
|
+
!e(c) && e(s) ? (p(), w("div", {
|
1428
1426
|
key: 0,
|
1429
|
-
onClick:
|
1430
|
-
(...
|
1427
|
+
onClick: U[3] || (U[3] = //@ts-ignore
|
1428
|
+
(...H) => e(y) && e(y)(...H)),
|
1431
1429
|
class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
|
1432
1430
|
}, [
|
1433
|
-
|
1434
|
-
|
1435
|
-
])) :
|
1436
|
-
e(c) ? (p(),
|
1431
|
+
U[8] || (U[8] = W(" Показати більше ", -1)),
|
1432
|
+
P(be)
|
1433
|
+
])) : S("", !0),
|
1434
|
+
e(c) ? (p(), w("div", {
|
1437
1435
|
key: 1,
|
1438
|
-
onClick:
|
1439
|
-
(...
|
1436
|
+
onClick: U[4] || (U[4] = //@ts-ignore
|
1437
|
+
(...H) => e(y) && e(y)(...H)),
|
1440
1438
|
class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
|
1441
1439
|
}, [
|
1442
|
-
|
1443
|
-
|
1444
|
-
])) :
|
1445
|
-
], 64)) :
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1440
|
+
U[9] || (U[9] = W(" Показати менше ", -1)),
|
1441
|
+
P(Se)
|
1442
|
+
])) : S("", !0)
|
1443
|
+
], 64)) : S("", !0),
|
1444
|
+
T.cleanable ? (p(), w(F, { key: 2 }, [
|
1445
|
+
T.layout === "inline" ? (p(), w("div", sl, [
|
1446
|
+
W(K(T.multi && Array.isArray(e(m)) ? (de = e(m)) == null ? void 0 : de.length : e(m) !== void 0 && (e(m) || e(m) === null) ? 1 : 0) + " з " + K(e(M)) + " обрано ", 1),
|
1447
|
+
I(o("button", {
|
1450
1448
|
class: "text-gray-600 hover:text-gray-800",
|
1451
|
-
onClick:
|
1452
|
-
(...
|
1449
|
+
onClick: U[5] || (U[5] = //@ts-ignore
|
1450
|
+
(...H) => e(b) && e(b)(...H))
|
1453
1451
|
}, " Очистити ", 512), [
|
1454
|
-
[
|
1452
|
+
[X, e(m) !== "" && e(m) !== void 0 || e(m)]
|
1455
1453
|
])
|
1456
|
-
])) :
|
1457
|
-
|
1458
|
-
o("span", null,
|
1459
|
-
|
1454
|
+
])) : S("", !0),
|
1455
|
+
T.layout === "popover" ? (p(), w("div", ul, [
|
1456
|
+
o("span", null, K(T.multi && Array.isArray(e(m)) ? (J = e(m)) == null ? void 0 : J.length : e(m) !== void 0 && (e(m) || e(m) === null) ? 1 : 0) + " з " + K(e(M)) + " обрано", 1),
|
1457
|
+
I(o("button", {
|
1460
1458
|
class: "text-gray-600 hover:text-gray-800",
|
1461
|
-
onClick:
|
1462
|
-
(...
|
1459
|
+
onClick: U[6] || (U[6] = //@ts-ignore
|
1460
|
+
(...H) => e(b) && e(b)(...H))
|
1463
1461
|
}, " Очистити ", 512), [
|
1464
|
-
[
|
1462
|
+
[X, e(m) !== "" && e(m) !== void 0 || e(m)]
|
1465
1463
|
])
|
1466
|
-
])) :
|
1467
|
-
], 64)) :
|
1464
|
+
])) : S("", !0)
|
1465
|
+
], 64)) : S("", !0)
|
1468
1466
|
], 2);
|
1469
1467
|
};
|
1470
1468
|
}
|
1471
|
-
}),
|
1469
|
+
}), cl = ["for", "onClick"], pl = ["id", "name", "value"], fl = { class: "block" }, vl = {
|
1472
1470
|
key: 0,
|
1473
1471
|
class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
|
1474
|
-
},
|
1472
|
+
}, ml = {
|
1475
1473
|
key: 1,
|
1476
1474
|
class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
|
1477
|
-
},
|
1475
|
+
}, gl = /* @__PURE__ */ Y({
|
1478
1476
|
__name: "tag-field",
|
1479
1477
|
props: {
|
1480
1478
|
id: {},
|
@@ -1500,40 +1498,40 @@ const ll = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
1500
1498
|
sort: {}
|
1501
1499
|
},
|
1502
1500
|
emits: ["update:modelValue", "change", "clear"],
|
1503
|
-
setup(
|
1504
|
-
const l =
|
1505
|
-
innerValue:
|
1506
|
-
isSelected:
|
1507
|
-
selectItem:
|
1501
|
+
setup(i, { expose: r, emit: d }) {
|
1502
|
+
const l = i, a = d, {
|
1503
|
+
innerValue: n,
|
1504
|
+
isSelected: m,
|
1505
|
+
selectItem: h,
|
1508
1506
|
clear: g,
|
1509
|
-
labelKey:
|
1507
|
+
labelKey: k,
|
1510
1508
|
valueKey: b,
|
1511
1509
|
allOptions: f
|
1512
1510
|
} = l.multi ? Te({
|
1513
1511
|
...l,
|
1514
1512
|
modelValue: l.modelValue ?? l.default ?? []
|
1515
|
-
},
|
1513
|
+
}, a) : Ie({
|
1516
1514
|
...l,
|
1517
1515
|
modelValue: l.modelValue !== void 0 ? l.modelValue : l.default ?? ""
|
1518
|
-
},
|
1519
|
-
return
|
1516
|
+
}, a);
|
1517
|
+
return r({
|
1520
1518
|
clear: g
|
1521
1519
|
}), A(
|
1522
1520
|
() => l.modelValue,
|
1523
|
-
(
|
1524
|
-
|
1521
|
+
(y) => {
|
1522
|
+
y === void 0 && (l.multi ? n.value = [] : n.value = void 0);
|
1525
1523
|
}
|
1526
|
-
), (
|
1527
|
-
var c,
|
1528
|
-
return p(),
|
1524
|
+
), (y, C) => {
|
1525
|
+
var c, s;
|
1526
|
+
return p(), w(F, null, [
|
1529
1527
|
o("div", {
|
1530
|
-
class:
|
1528
|
+
class: j(["grid grid-cols-3 gap-2 mx-[1px]", y.layout === "popover" ? "m-1" : "mb-1"])
|
1531
1529
|
}, [
|
1532
|
-
(p(!0),
|
1530
|
+
(p(!0), w(F, null, q(e(f), (t) => (p(), w("label", {
|
1533
1531
|
key: `item-${t[e(b)]}`,
|
1534
1532
|
for: `item-${t[e(b)]}`,
|
1535
|
-
onClick:
|
1536
|
-
class:
|
1533
|
+
onClick: Oe((x) => e(h)(t), ["stop", "prevent"]),
|
1534
|
+
class: j([e(m)(t) ? "ring-2 ring-indigo-600" : "", "p-2.5 group relative flex justify-center items-center gap-x-12 text-center text-xs bg-white text-gray-800 border border-gray-200 cursor-pointer rounded-lg dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-200 peer-checked:text-indigo-600 dark:has-checked:text-indigo-500 peer-checked:border-indigo-600 dark:has-checked:border-indigo-500 peer-checked:ring peer-checked:shadow focus:ring dark:has-checked:ring-indigo-500 has-disabled:pointer-events-none has-disabled:text-gray-200 dark:has-disabled:text-neutral-700 has-disabled:after:absolute has-disabled:after:inset-0 has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-gray-200)_calc(50%-1px),var(--color-gray-200)_50%,transparent_50%)] dark:has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-neutral-700)_calc(50%-1px),var(--color-neutral-700)_50%,transparent_50%)]"])
|
1537
1535
|
}, [
|
1538
1536
|
o("input", {
|
1539
1537
|
type: "checkbox",
|
@@ -1541,36 +1539,36 @@ const ll = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
1541
1539
|
class: "hidden w4poy border-gray-200 g41z1 g22e3 axcnw dark:text-indigo-500 dark:border-neutral-700 dark:focus:ring-neutral-900",
|
1542
1540
|
name: `item-${t[e(b)]}`,
|
1543
1541
|
value: t[e(b)]
|
1544
|
-
}, null, 8,
|
1545
|
-
o("span",
|
1546
|
-
], 10,
|
1542
|
+
}, null, 8, pl),
|
1543
|
+
o("span", fl, K(t[e(k)]), 1)
|
1544
|
+
], 10, cl))), 128))
|
1547
1545
|
], 2),
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1546
|
+
y.cleanable ? (p(), w(F, { key: 0 }, [
|
1547
|
+
y.layout === "inline" ? (p(), w("div", vl, [
|
1548
|
+
W(K(y.multi && Array.isArray(e(n)) ? (c = e(n)) == null ? void 0 : c.length : e(n) !== void 0 && (e(n) || e(n) === null) ? 1 : 0) + " з " + K(e(f).length) + " обрано ", 1),
|
1549
|
+
I(o("button", {
|
1552
1550
|
class: "text-gray-600 hover:text-gray-800",
|
1553
|
-
onClick:
|
1551
|
+
onClick: C[0] || (C[0] = //@ts-ignore
|
1554
1552
|
(...t) => e(g) && e(g)(...t))
|
1555
1553
|
}, " Очистити ", 512), [
|
1556
|
-
[
|
1554
|
+
[X, e(n) !== "" && e(n) !== void 0 || e(n)]
|
1557
1555
|
])
|
1558
|
-
])) :
|
1559
|
-
|
1560
|
-
o("span", null,
|
1561
|
-
|
1556
|
+
])) : S("", !0),
|
1557
|
+
y.layout === "popover" ? (p(), w("div", ml, [
|
1558
|
+
o("span", null, K(y.multi && Array.isArray(e(n)) ? (s = e(n)) == null ? void 0 : s.length : e(n) !== void 0 && (e(n) || e(n) === null) ? 1 : 0) + " з " + K(e(f).length) + " обрано", 1),
|
1559
|
+
I(o("button", {
|
1562
1560
|
class: "text-gray-600 hover:text-gray-800",
|
1563
|
-
onClick:
|
1561
|
+
onClick: C[1] || (C[1] = //@ts-ignore
|
1564
1562
|
(...t) => e(g) && e(g)(...t))
|
1565
1563
|
}, " Очистити ", 512), [
|
1566
|
-
[
|
1564
|
+
[X, e(n) !== void 0 && e(n) !== "" || e(n)]
|
1567
1565
|
])
|
1568
|
-
])) :
|
1569
|
-
], 64)) :
|
1566
|
+
])) : S("", !0)
|
1567
|
+
], 64)) : S("", !0)
|
1570
1568
|
], 64);
|
1571
1569
|
};
|
1572
1570
|
}
|
1573
|
-
}),
|
1571
|
+
}), hl = {}, bl = {
|
1574
1572
|
xmlns: "http://www.w3.org/2000/svg",
|
1575
1573
|
width: "24",
|
1576
1574
|
height: "24",
|
@@ -1582,12 +1580,12 @@ const ll = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
1582
1580
|
"stroke-linejoin": "round",
|
1583
1581
|
class: "text-blue-600 w-[16px] h-[16px]"
|
1584
1582
|
};
|
1585
|
-
function
|
1586
|
-
return p(),
|
1583
|
+
function yl(i, r) {
|
1584
|
+
return p(), w("svg", bl, r[0] || (r[0] = [
|
1587
1585
|
o("path", { d: "M20 6 9 17l-5-5" }, null, -1)
|
1588
1586
|
]));
|
1589
1587
|
}
|
1590
|
-
const
|
1588
|
+
const se = /* @__PURE__ */ le(hl, [["render", yl]]), xl = {}, wl = {
|
1591
1589
|
xmlns: "http://www.w3.org/2000/svg",
|
1592
1590
|
width: "15px",
|
1593
1591
|
height: "24",
|
@@ -1599,8 +1597,8 @@ const ie = /* @__PURE__ */ X(ml, [["render", gl]]), yl = {}, bl = {
|
|
1599
1597
|
"stroke-linejoin": "round",
|
1600
1598
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[90deg]"
|
1601
1599
|
};
|
1602
|
-
function
|
1603
|
-
return p(),
|
1600
|
+
function kl(i, r) {
|
1601
|
+
return p(), w("svg", wl, r[0] || (r[0] = [
|
1604
1602
|
o("path", {
|
1605
1603
|
stroke: "none",
|
1606
1604
|
d: "M0 0h24v24H0z",
|
@@ -1609,7 +1607,7 @@ function hl(s, a) {
|
|
1609
1607
|
o("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
1610
1608
|
]));
|
1611
1609
|
}
|
1612
|
-
const
|
1610
|
+
const _l = /* @__PURE__ */ le(xl, [["render", kl]]), Cl = {}, Vl = {
|
1613
1611
|
xmlns: "http://www.w3.org/2000/svg",
|
1614
1612
|
width: "15px",
|
1615
1613
|
height: "24",
|
@@ -1621,8 +1619,8 @@ const xl = /* @__PURE__ */ X(yl, [["render", hl]]), wl = {}, kl = {
|
|
1621
1619
|
"stroke-linejoin": "round",
|
1622
1620
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[270deg]"
|
1623
1621
|
};
|
1624
|
-
function
|
1625
|
-
return p(),
|
1622
|
+
function Sl(i, r) {
|
1623
|
+
return p(), w("svg", Vl, r[0] || (r[0] = [
|
1626
1624
|
o("path", {
|
1627
1625
|
stroke: "none",
|
1628
1626
|
d: "M0 0h24v24H0z",
|
@@ -1631,11 +1629,10 @@ function Cl(s, a) {
|
|
1631
1629
|
o("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
1632
1630
|
]));
|
1633
1631
|
}
|
1634
|
-
const
|
1632
|
+
const Ml = /* @__PURE__ */ le(Cl, [["render", Sl]]), Bl = { class: "flex" }, $l = { class: "mb-1" }, Al = { class: "mb-1" }, Rl = { class: "inline-flex rounded-lg shrink-0 pl-1" }, Dl = { class: "inline-flex rounded-lg shrink-0 pl-1" }, zl = {
|
1635
1633
|
key: 1,
|
1636
1634
|
class: "flex gap-1 !w-[75%] rounded-lg"
|
1637
|
-
},
|
1638
|
-
const jl = /* @__PURE__ */ N({
|
1635
|
+
}, jl = ["max", "disabled"], Fl = ["min", "disabled"], Kl = /* @__PURE__ */ Y({
|
1639
1636
|
__name: "date-input-inline",
|
1640
1637
|
props: {
|
1641
1638
|
id: {},
|
@@ -1661,44 +1658,44 @@ const jl = /* @__PURE__ */ N({
|
|
1661
1658
|
sort: {}
|
1662
1659
|
},
|
1663
1660
|
emits: ["update:modelValue", "change", "clear"],
|
1664
|
-
setup(
|
1665
|
-
const l =
|
1666
|
-
activeMode:
|
1667
|
-
innerValue:
|
1661
|
+
setup(i, { expose: r, emit: d }) {
|
1662
|
+
const l = i, a = d, n = V(null), {
|
1663
|
+
activeMode: m,
|
1664
|
+
innerValue: h,
|
1668
1665
|
onSelectChange: g,
|
1669
|
-
nextClick:
|
1666
|
+
nextClick: k,
|
1670
1667
|
prevClick: b,
|
1671
1668
|
currentLabel: f,
|
1672
|
-
clear:
|
1673
|
-
} =
|
1669
|
+
clear: y
|
1670
|
+
} = qe({
|
1674
1671
|
...l,
|
1675
|
-
popoverRef:
|
1676
|
-
},
|
1677
|
-
return A(() => l.modelValue, (
|
1678
|
-
|
1679
|
-
}),
|
1680
|
-
clear:
|
1681
|
-
popoverRef:
|
1682
|
-
}), (
|
1683
|
-
o("div",
|
1684
|
-
|
1672
|
+
popoverRef: n
|
1673
|
+
}, a);
|
1674
|
+
return A(() => l.modelValue, (C) => {
|
1675
|
+
C !== void 0 ? (h.value = C, a("update:modelValue", C)) : (m.value = "", h.value = []);
|
1676
|
+
}), r({
|
1677
|
+
clear: y,
|
1678
|
+
popoverRef: n
|
1679
|
+
}), (C, c) => (p(), w(F, null, [
|
1680
|
+
o("div", Bl, [
|
1681
|
+
P(Me, {
|
1685
1682
|
ref_key: "popoverRef",
|
1686
|
-
ref:
|
1683
|
+
ref: n,
|
1687
1684
|
label: e(f),
|
1688
|
-
"current-value": e(
|
1689
|
-
mode:
|
1690
|
-
onClear: e(
|
1691
|
-
layout:
|
1685
|
+
"current-value": e(h),
|
1686
|
+
mode: C.mode,
|
1687
|
+
onClear: e(y),
|
1688
|
+
layout: C.layout
|
1692
1689
|
}, {
|
1693
|
-
default:
|
1690
|
+
default: re(() => [
|
1694
1691
|
o("div", null, [
|
1695
1692
|
o("button", {
|
1696
1693
|
type: "button",
|
1697
|
-
onClick: c[0] || (c[0] = (
|
1694
|
+
onClick: c[0] || (c[0] = (s) => e(g)("range")),
|
1698
1695
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
1699
1696
|
}, [
|
1700
|
-
c[12] || (c[12] =
|
1701
|
-
e(
|
1697
|
+
c[12] || (c[12] = W(" Період ", -1)),
|
1698
|
+
e(m) === "range" ? (p(), z(se, { key: 0 })) : S("", !0)
|
1702
1699
|
])
|
1703
1700
|
]),
|
1704
1701
|
c[19] || (c[19] = o("div", null, [
|
@@ -1707,131 +1704,131 @@ const jl = /* @__PURE__ */ N({
|
|
1707
1704
|
o("div", null, [
|
1708
1705
|
o("button", {
|
1709
1706
|
type: "button",
|
1710
|
-
onClick: c[1] || (c[1] = (
|
1707
|
+
onClick: c[1] || (c[1] = (s) => e(g)("today")),
|
1711
1708
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
1712
1709
|
}, [
|
1713
|
-
c[13] || (c[13] =
|
1714
|
-
e(
|
1710
|
+
c[13] || (c[13] = W(" Сьогодні ", -1)),
|
1711
|
+
e(m) === "today" ? (p(), z(se, { key: 0 })) : S("", !0)
|
1715
1712
|
])
|
1716
1713
|
]),
|
1717
1714
|
o("div", null, [
|
1718
1715
|
o("button", {
|
1719
1716
|
type: "button",
|
1720
|
-
onClick: c[2] || (c[2] = (
|
1717
|
+
onClick: c[2] || (c[2] = (s) => e(g)("week")),
|
1721
1718
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
1722
1719
|
}, [
|
1723
|
-
c[14] || (c[14] =
|
1724
|
-
e(
|
1720
|
+
c[14] || (c[14] = W(" Тиждень ", -1)),
|
1721
|
+
e(m) === "week" ? (p(), z(se, { key: 0 })) : S("", !0)
|
1725
1722
|
])
|
1726
1723
|
]),
|
1727
1724
|
o("div", null, [
|
1728
1725
|
o("button", {
|
1729
1726
|
type: "button",
|
1730
|
-
onClick: c[3] || (c[3] = (
|
1727
|
+
onClick: c[3] || (c[3] = (s) => e(g)("month")),
|
1731
1728
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
1732
1729
|
}, [
|
1733
|
-
c[15] || (c[15] =
|
1734
|
-
e(
|
1730
|
+
c[15] || (c[15] = W(" Місяць ", -1)),
|
1731
|
+
e(m) === "month" ? (p(), z(se, { key: 0 })) : S("", !0)
|
1735
1732
|
])
|
1736
1733
|
]),
|
1737
1734
|
o("div", null, [
|
1738
1735
|
o("button", {
|
1739
1736
|
type: "button",
|
1740
|
-
onClick: c[4] || (c[4] = (
|
1737
|
+
onClick: c[4] || (c[4] = (s) => e(g)("quarter")),
|
1741
1738
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
1742
1739
|
}, [
|
1743
|
-
c[16] || (c[16] =
|
1744
|
-
e(
|
1740
|
+
c[16] || (c[16] = W(" Квартал ", -1)),
|
1741
|
+
e(m) === "quarter" ? (p(), z(se, { key: 0 })) : S("", !0)
|
1745
1742
|
])
|
1746
1743
|
]),
|
1747
|
-
o("div",
|
1744
|
+
o("div", $l, [
|
1748
1745
|
o("button", {
|
1749
1746
|
type: "button",
|
1750
|
-
onClick: c[5] || (c[5] = (
|
1747
|
+
onClick: c[5] || (c[5] = (s) => e(g)("year")),
|
1751
1748
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
1752
1749
|
}, [
|
1753
|
-
c[17] || (c[17] =
|
1754
|
-
e(
|
1750
|
+
c[17] || (c[17] = W(" Рік ", -1)),
|
1751
|
+
e(m) === "year" ? (p(), z(se, { key: 0 })) : S("", !0)
|
1755
1752
|
])
|
1756
1753
|
]),
|
1757
|
-
o("div",
|
1754
|
+
o("div", Al, [
|
1758
1755
|
o("button", {
|
1759
1756
|
type: "button",
|
1760
|
-
onClick: c[6] || (c[6] = (
|
1757
|
+
onClick: c[6] || (c[6] = (s) => e(y)()),
|
1761
1758
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
1762
1759
|
}, [
|
1763
|
-
c[18] || (c[18] =
|
1764
|
-
e(
|
1760
|
+
c[18] || (c[18] = W(" Весь час ", -1)),
|
1761
|
+
e(h)[0] ? S("", !0) : (p(), z(se, { key: 0 }))
|
1765
1762
|
])
|
1766
1763
|
])
|
1767
1764
|
]),
|
1768
1765
|
_: 1,
|
1769
1766
|
__: [19]
|
1770
1767
|
}, 8, ["label", "current-value", "mode", "onClear", "layout"]),
|
1771
|
-
e(
|
1772
|
-
o("div",
|
1768
|
+
e(m) !== "" && e(m) !== "range" && e(m) !== "last_7_days" ? (p(), w(F, { key: 0 }, [
|
1769
|
+
o("div", Rl, [
|
1773
1770
|
o("button", {
|
1774
1771
|
type: "button",
|
1775
1772
|
title: "Попередній період",
|
1776
1773
|
class: "inline-flex h-[38px] items-center px-2 text-sm text-gray-800 bg-gray-100 gap-x-2 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",
|
1777
1774
|
onClick: c[7] || (c[7] = //@ts-ignore
|
1778
|
-
(...
|
1775
|
+
(...s) => e(b) && e(b)(...s))
|
1779
1776
|
}, [
|
1780
|
-
|
1777
|
+
P(_l)
|
1781
1778
|
])
|
1782
1779
|
]),
|
1783
|
-
o("div",
|
1780
|
+
o("div", Dl, [
|
1784
1781
|
o("button", {
|
1785
1782
|
type: "button",
|
1786
1783
|
title: "Наступний період",
|
1787
1784
|
class: "inline-flex h-[38px] items-center px-2 text-sm text-gray-800 gap-x-2 bg-gray-100 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",
|
1788
1785
|
onClick: c[8] || (c[8] = //@ts-ignore
|
1789
|
-
(...
|
1786
|
+
(...s) => e(k) && e(k)(...s))
|
1790
1787
|
}, [
|
1791
|
-
|
1788
|
+
P(Ml)
|
1792
1789
|
])
|
1793
1790
|
])
|
1794
|
-
], 64)) :
|
1795
|
-
e(
|
1796
|
-
|
1791
|
+
], 64)) : S("", !0),
|
1792
|
+
e(m) !== "" && e(m) === "range" ? (p(), w("div", zl, [
|
1793
|
+
I(o("input", {
|
1797
1794
|
type: "date",
|
1798
|
-
max: e(
|
1795
|
+
max: e(h)[1],
|
1799
1796
|
locale: "uk-UA",
|
1800
|
-
"onUpdate:modelValue": c[9] || (c[9] = (
|
1797
|
+
"onUpdate:modelValue": c[9] || (c[9] = (s) => e(h)[0] = s),
|
1801
1798
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",
|
1802
|
-
disabled:
|
1803
|
-
}, null, 8,
|
1804
|
-
[
|
1799
|
+
disabled: C.disabled
|
1800
|
+
}, null, 8, jl), [
|
1801
|
+
[te, e(h)[0]]
|
1805
1802
|
]),
|
1806
|
-
|
1803
|
+
I(o("input", {
|
1807
1804
|
type: "date",
|
1808
|
-
min: e(
|
1805
|
+
min: e(h)[0],
|
1809
1806
|
locale: "uk-UA",
|
1810
|
-
"onUpdate:modelValue": c[10] || (c[10] = (
|
1807
|
+
"onUpdate:modelValue": c[10] || (c[10] = (s) => e(h)[1] = s),
|
1811
1808
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",
|
1812
|
-
disabled:
|
1813
|
-
}, null, 8,
|
1814
|
-
[
|
1809
|
+
disabled: C.disabled
|
1810
|
+
}, null, 8, Fl), [
|
1811
|
+
[te, e(h)[1]]
|
1815
1812
|
])
|
1816
|
-
])) :
|
1813
|
+
])) : S("", !0)
|
1817
1814
|
]),
|
1818
|
-
(
|
1815
|
+
(C.cleanable, S("", !0))
|
1819
1816
|
], 64));
|
1820
1817
|
}
|
1821
|
-
}),
|
1822
|
-
radio:
|
1823
|
-
checkbox:
|
1824
|
-
check:
|
1825
|
-
text:
|
1826
|
-
range:
|
1827
|
-
date:
|
1828
|
-
select:
|
1829
|
-
tag:
|
1830
|
-
"date:inline":
|
1818
|
+
}), je = {
|
1819
|
+
radio: bt,
|
1820
|
+
checkbox: ze,
|
1821
|
+
check: ze,
|
1822
|
+
text: Rt,
|
1823
|
+
range: Pt,
|
1824
|
+
date: al,
|
1825
|
+
select: dl,
|
1826
|
+
tag: gl,
|
1827
|
+
"date:inline": Kl
|
1831
1828
|
};
|
1832
|
-
function
|
1829
|
+
function Be(i, r) {
|
1833
1830
|
let d;
|
1834
|
-
switch (
|
1831
|
+
switch (i.toLowerCase()) {
|
1835
1832
|
case "autocomplete":
|
1836
1833
|
d = "select";
|
1837
1834
|
break;
|
@@ -1839,14 +1836,14 @@ function Se(s, a) {
|
|
1839
1836
|
d = "checkbox";
|
1840
1837
|
break;
|
1841
1838
|
default:
|
1842
|
-
d =
|
1839
|
+
d = i == null ? void 0 : i.toString().toLowerCase();
|
1843
1840
|
}
|
1844
|
-
return d === "date" &&
|
1845
|
-
component:
|
1841
|
+
return d === "date" && r && r === "inline" && (d = "date:inline"), {
|
1842
|
+
component: je[d] || je.text,
|
1846
1843
|
type: d
|
1847
1844
|
};
|
1848
1845
|
}
|
1849
|
-
const
|
1846
|
+
const Ll = {}, Ul = {
|
1850
1847
|
xmlns: "http://www.w3.org/2000/svg",
|
1851
1848
|
width: "15px",
|
1852
1849
|
height: "24",
|
@@ -1858,8 +1855,8 @@ const zl = {}, Fl = {
|
|
1858
1855
|
"stroke-linejoin": "round",
|
1859
1856
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-reload absolute inline mr-1 text-gray-800 transition-all cursor-pointer active:rotate-90 right-1 top-1 hover:text-blue-500"
|
1860
1857
|
};
|
1861
|
-
function
|
1862
|
-
return p(),
|
1858
|
+
function Ol(i, r) {
|
1859
|
+
return p(), w("svg", Ul, r[0] || (r[0] = [
|
1863
1860
|
o("path", {
|
1864
1861
|
stroke: "none",
|
1865
1862
|
d: "M0 0h24v24H0z",
|
@@ -1869,7 +1866,7 @@ function Ll(s, a) {
|
|
1869
1866
|
o("path", { d: "M20 4v5h-5" }, null, -1)
|
1870
1867
|
]));
|
1871
1868
|
}
|
1872
|
-
const
|
1869
|
+
const Pl = /* @__PURE__ */ le(Ll, [["render", Ol]]), Il = { style: { display: "inline-flex", margin: "0px", width: "100%" } }, Tl = { class: "relative w-full mb-2 p-4 bg-white rounded-lg shadow-sm" }, Hl = { class: "block mb-3 text-sm font-medium text-gray-800 dark:text-neutral-200" }, El = { class: "flex items-center" }, Yl = { class: "text-sm font-medium max-w-[80%] text-gray-800 flex items-center gap-x-1" }, Wl = { class: "filter-layout__body" }, ql = /* @__PURE__ */ Y({
|
1873
1870
|
__name: "vertical-layout",
|
1874
1871
|
props: {
|
1875
1872
|
id: {},
|
@@ -1895,73 +1892,73 @@ const Kl = /* @__PURE__ */ X(zl, [["render", Ll]]), El = { style: { display: "in
|
|
1895
1892
|
sort: {}
|
1896
1893
|
},
|
1897
1894
|
emits: ["update:modelValue", "change", "clear"],
|
1898
|
-
setup(
|
1899
|
-
const l =
|
1895
|
+
setup(i, { expose: r, emit: d }) {
|
1896
|
+
const l = i, a = d, n = V(), m = Be(l.type, l.layout), h = E({
|
1900
1897
|
get: () => l.modelValue,
|
1901
|
-
set: (f) =>
|
1898
|
+
set: (f) => a("update:modelValue", f)
|
1902
1899
|
});
|
1903
1900
|
function g(f) {
|
1904
|
-
|
1901
|
+
a("clear", f);
|
1905
1902
|
}
|
1906
|
-
function
|
1907
|
-
|
1903
|
+
function k(f, y) {
|
1904
|
+
a("change", { name: f, value: y }), l.modelValue !== void 0 && a("update:modelValue", y);
|
1908
1905
|
}
|
1909
1906
|
function b() {
|
1910
|
-
|
1907
|
+
n.value && n.value.clear(), a("clear", l.name);
|
1911
1908
|
}
|
1912
1909
|
return A(
|
1913
1910
|
() => l.default,
|
1914
1911
|
(f) => {
|
1915
|
-
|
1912
|
+
h.value = f;
|
1916
1913
|
}
|
1917
1914
|
), A(
|
1918
1915
|
() => l.modelValue,
|
1919
1916
|
(f) => {
|
1920
|
-
|
1917
|
+
h.value = f;
|
1921
1918
|
}
|
1922
|
-
),
|
1923
|
-
filterRef:
|
1924
|
-
}), (f,
|
1925
|
-
var
|
1926
|
-
return p(),
|
1919
|
+
), r({
|
1920
|
+
filterRef: n
|
1921
|
+
}), (f, y) => {
|
1922
|
+
var C, c, s;
|
1923
|
+
return p(), w("div", Il, [
|
1927
1924
|
o("div", Tl, [
|
1928
|
-
o("div",
|
1929
|
-
o("div",
|
1930
|
-
o("span",
|
1925
|
+
o("div", Hl, [
|
1926
|
+
o("div", El, [
|
1927
|
+
o("span", Yl, K(f.label), 1)
|
1931
1928
|
]),
|
1932
|
-
typeof
|
1929
|
+
typeof h.value == "string" && h.value.trim() !== "" || Array.isArray(h.value) && h.value.length > 0 && h.value.some((t) => t !== void 0) || h.value === null ? (p(), z(Pl, {
|
1933
1930
|
key: 0,
|
1934
1931
|
onClick: b
|
1935
|
-
})) :
|
1932
|
+
})) : S("", !0)
|
1936
1933
|
]),
|
1937
|
-
o("div",
|
1938
|
-
((
|
1939
|
-
type: (
|
1940
|
-
onChange:
|
1941
|
-
onClear:
|
1934
|
+
o("div", Wl, [
|
1935
|
+
((C = e(m)) == null ? void 0 : C.type) !== "select" ? (p(), z(oe((c = e(m)) == null ? void 0 : c.component), Z({ key: 0 }, l, {
|
1936
|
+
type: (s = e(m)) == null ? void 0 : s.type,
|
1937
|
+
onChange: y[0] || (y[0] = (t) => k(t.name, t.value)),
|
1938
|
+
onClear: y[1] || (y[1] = (t) => g(t)),
|
1942
1939
|
ref_key: "filterRef",
|
1943
|
-
ref:
|
1944
|
-
}), null, 16, ["type"])) : (p(),
|
1940
|
+
ref: n
|
1941
|
+
}), null, 16, ["type"])) : (p(), z(Me, {
|
1945
1942
|
key: 1,
|
1946
|
-
"current-value":
|
1943
|
+
"current-value": h.value,
|
1947
1944
|
label: f.label,
|
1948
1945
|
mode: f.mode,
|
1949
1946
|
onClear: b,
|
1950
|
-
fieldRef:
|
1947
|
+
fieldRef: n.value,
|
1951
1948
|
width: void 0,
|
1952
1949
|
disabled: f.disabled,
|
1953
1950
|
layout: "vertical"
|
1954
1951
|
}, {
|
1955
|
-
default:
|
1952
|
+
default: re(() => {
|
1956
1953
|
var t, x;
|
1957
1954
|
return [
|
1958
|
-
(p(),
|
1955
|
+
(p(), z(oe((t = e(m)) == null ? void 0 : t.component), Z({
|
1959
1956
|
ref_key: "filterRef",
|
1960
|
-
ref:
|
1957
|
+
ref: n
|
1961
1958
|
}, l, {
|
1962
|
-
type: (x = e(
|
1963
|
-
onChange:
|
1964
|
-
onClear:
|
1959
|
+
type: (x = e(m)) == null ? void 0 : x.type,
|
1960
|
+
onChange: y[2] || (y[2] = (v) => k(v.name, v.value)),
|
1961
|
+
onClear: y[3] || (y[3] = (v) => g(v))
|
1965
1962
|
}), null, 16, ["type"]))
|
1966
1963
|
];
|
1967
1964
|
}),
|
@@ -1972,7 +1969,7 @@ const Kl = /* @__PURE__ */ X(zl, [["render", Ll]]), El = { style: { display: "in
|
|
1972
1969
|
]);
|
1973
1970
|
};
|
1974
1971
|
}
|
1975
|
-
}),
|
1972
|
+
}), Fe = /* @__PURE__ */ Y({
|
1976
1973
|
__name: "inline-layout",
|
1977
1974
|
props: {
|
1978
1975
|
id: {},
|
@@ -1998,60 +1995,60 @@ const Kl = /* @__PURE__ */ X(zl, [["render", Ll]]), El = { style: { display: "in
|
|
1998
1995
|
sort: {}
|
1999
1996
|
},
|
2000
1997
|
emits: ["update:modelValue", "change", "clear"],
|
2001
|
-
setup(
|
2002
|
-
const l =
|
1998
|
+
setup(i, { expose: r, emit: d }) {
|
1999
|
+
const l = i, a = d, n = V(), m = Be(l.type, l.layout), h = E({
|
2003
2000
|
get: () => l.modelValue,
|
2004
|
-
set: (b) =>
|
2001
|
+
set: (b) => a("update:modelValue", b)
|
2005
2002
|
});
|
2006
2003
|
function g(b = l.name) {
|
2007
|
-
|
2004
|
+
a("clear", b);
|
2008
2005
|
}
|
2009
|
-
function
|
2010
|
-
|
2006
|
+
function k(b, f) {
|
2007
|
+
a("change", { name: b, value: f }), l.modelValue !== void 0 && a("update:modelValue", f);
|
2011
2008
|
}
|
2012
2009
|
return A(
|
2013
2010
|
() => l.default,
|
2014
2011
|
(b) => {
|
2015
|
-
|
2012
|
+
h.value = b;
|
2016
2013
|
}
|
2017
2014
|
), A(
|
2018
2015
|
() => l.modelValue,
|
2019
2016
|
(b) => {
|
2020
|
-
|
2017
|
+
h.value = b;
|
2021
2018
|
}
|
2022
|
-
),
|
2023
|
-
filterRef:
|
2019
|
+
), r({
|
2020
|
+
filterRef: n
|
2024
2021
|
}), (b, f) => {
|
2025
|
-
var
|
2026
|
-
return ["text", "date"].includes(b.type.toLocaleLowerCase()) ? (p(),
|
2027
|
-
type: (
|
2028
|
-
onChange: f[0] || (f[0] = (c) =>
|
2022
|
+
var y, C;
|
2023
|
+
return ["text", "date"].includes(b.type.toLocaleLowerCase()) ? (p(), z(oe((y = e(m)) == null ? void 0 : y.component), Z({ key: 0 }, l, {
|
2024
|
+
type: (C = e(m)) == null ? void 0 : C.type,
|
2025
|
+
onChange: f[0] || (f[0] = (c) => k(c.name, c.value)),
|
2029
2026
|
onClear: f[1] || (f[1] = (c) => g(c)),
|
2030
2027
|
disabled: b.disabled,
|
2031
|
-
modelValue:
|
2032
|
-
"onUpdate:modelValue": f[2] || (f[2] = (c) =>
|
2033
|
-
}), null, 16, ["type", "disabled", "modelValue"])) : (p(),
|
2028
|
+
modelValue: h.value,
|
2029
|
+
"onUpdate:modelValue": f[2] || (f[2] = (c) => h.value = c)
|
2030
|
+
}), null, 16, ["type", "disabled", "modelValue"])) : (p(), z(Me, {
|
2034
2031
|
key: 1,
|
2035
|
-
"current-value":
|
2032
|
+
"current-value": h.value,
|
2036
2033
|
label: b.label,
|
2037
2034
|
mode: b.mode,
|
2038
2035
|
onClear: g,
|
2039
|
-
fieldRef:
|
2036
|
+
fieldRef: n.value,
|
2040
2037
|
width: l.width,
|
2041
2038
|
disabled: b.disabled,
|
2042
2039
|
layout: "inline"
|
2043
2040
|
}, {
|
2044
|
-
default:
|
2045
|
-
var c,
|
2041
|
+
default: re(() => {
|
2042
|
+
var c, s;
|
2046
2043
|
return [
|
2047
|
-
(p(),
|
2044
|
+
(p(), z(oe((c = e(m)) == null ? void 0 : c.component), Z({
|
2048
2045
|
ref_key: "filterRef",
|
2049
|
-
ref:
|
2046
|
+
ref: n
|
2050
2047
|
}, l, {
|
2051
|
-
modelValue:
|
2052
|
-
"onUpdate:modelValue": f[3] || (f[3] = (t) =>
|
2053
|
-
type: (
|
2054
|
-
onChange: f[4] || (f[4] = (t) =>
|
2048
|
+
modelValue: h.value,
|
2049
|
+
"onUpdate:modelValue": f[3] || (f[3] = (t) => h.value = t),
|
2050
|
+
type: (s = e(m)) == null ? void 0 : s.type,
|
2051
|
+
onChange: f[4] || (f[4] = (t) => k(t.name, t.value)),
|
2055
2052
|
onClear: f[5] || (f[5] = (t) => g(t))
|
2056
2053
|
}), null, 16, ["modelValue", "type"]))
|
2057
2054
|
];
|
@@ -2060,7 +2057,7 @@ const Kl = /* @__PURE__ */ X(zl, [["render", Ll]]), El = { style: { display: "in
|
|
2060
2057
|
}, 8, ["current-value", "label", "mode", "fieldRef", "width", "disabled"]));
|
2061
2058
|
};
|
2062
2059
|
}
|
2063
|
-
}), Nl = /* @__PURE__ */
|
2060
|
+
}), Nl = /* @__PURE__ */ Y({
|
2064
2061
|
__name: "popover-layout",
|
2065
2062
|
props: {
|
2066
2063
|
id: {},
|
@@ -2086,48 +2083,48 @@ const Kl = /* @__PURE__ */ X(zl, [["render", Ll]]), El = { style: { display: "in
|
|
2086
2083
|
sort: {}
|
2087
2084
|
},
|
2088
2085
|
emits: ["update:modelValue", "change", "clear"],
|
2089
|
-
setup(
|
2090
|
-
const l =
|
2086
|
+
setup(i, { expose: r, emit: d }) {
|
2087
|
+
const l = i, a = d, n = V(), m = V(Be(l.type, l.layout)), h = E({
|
2091
2088
|
get: () => l.modelValue,
|
2092
|
-
set: (b) =>
|
2089
|
+
set: (b) => a("update:modelValue", b)
|
2093
2090
|
});
|
2094
2091
|
function g(b) {
|
2095
|
-
|
2092
|
+
a("clear", b);
|
2096
2093
|
}
|
2097
|
-
function
|
2098
|
-
|
2094
|
+
function k(b, f) {
|
2095
|
+
a("change", { name: b, value: f }), l.modelValue !== void 0 && a("update:modelValue", f);
|
2099
2096
|
}
|
2100
2097
|
return A(
|
2101
2098
|
() => l.default,
|
2102
2099
|
(b) => {
|
2103
|
-
|
2100
|
+
h.value = b;
|
2104
2101
|
}
|
2105
2102
|
), A(
|
2106
2103
|
() => l.modelValue,
|
2107
2104
|
(b) => {
|
2108
|
-
|
2105
|
+
h.value = b;
|
2109
2106
|
}
|
2110
2107
|
), A(
|
2111
2108
|
() => l,
|
2112
2109
|
(b) => {
|
2113
|
-
|
2110
|
+
h.value = b;
|
2114
2111
|
}
|
2115
|
-
),
|
2116
|
-
filterRef:
|
2112
|
+
), r({
|
2113
|
+
filterRef: n
|
2117
2114
|
}), (b, f) => {
|
2118
|
-
var
|
2119
|
-
return p(),
|
2120
|
-
type: (
|
2121
|
-
modelValue:
|
2122
|
-
"onUpdate:modelValue": f[0] || (f[0] = (c) =>
|
2123
|
-
onChange: f[1] || (f[1] = (c) =>
|
2115
|
+
var y, C;
|
2116
|
+
return p(), z(oe((y = m.value) == null ? void 0 : y.component), Z(l, {
|
2117
|
+
type: (C = m.value) == null ? void 0 : C.type,
|
2118
|
+
modelValue: h.value,
|
2119
|
+
"onUpdate:modelValue": f[0] || (f[0] = (c) => h.value = c),
|
2120
|
+
onChange: f[1] || (f[1] = (c) => k(c.name, c.value)),
|
2124
2121
|
onClear: f[2] || (f[2] = (c) => g(c)),
|
2125
2122
|
ref_key: "filterRef",
|
2126
|
-
ref:
|
2123
|
+
ref: n
|
2127
2124
|
}), null, 16, ["type", "modelValue"]);
|
2128
2125
|
};
|
2129
2126
|
}
|
2130
|
-
}),
|
2127
|
+
}), ne = /* @__PURE__ */ Y({
|
2131
2128
|
__name: "filter-field",
|
2132
2129
|
props: {
|
2133
2130
|
id: {},
|
@@ -2153,208 +2150,208 @@ const Kl = /* @__PURE__ */ X(zl, [["render", Ll]]), El = { style: { display: "in
|
|
2153
2150
|
sort: { default: "name" }
|
2154
2151
|
},
|
2155
2152
|
emits: ["update:modelValue", "change", "clear"],
|
2156
|
-
setup(
|
2157
|
-
const l =
|
2153
|
+
setup(i, { expose: r, emit: d }) {
|
2154
|
+
const l = i, a = d, n = V(), m = E({
|
2158
2155
|
get: () => l.modelValue,
|
2159
|
-
set: (b) =>
|
2156
|
+
set: (b) => a("update:modelValue", b)
|
2160
2157
|
});
|
2161
|
-
function
|
2162
|
-
|
2158
|
+
function h(b) {
|
2159
|
+
a("clear", b);
|
2163
2160
|
}
|
2164
2161
|
function g(b, f) {
|
2165
|
-
|
2162
|
+
a("change", { name: b, value: f }), l.modelValue !== void 0 && a("update:modelValue", f);
|
2166
2163
|
}
|
2167
2164
|
A(
|
2168
2165
|
() => l.default,
|
2169
2166
|
(b) => {
|
2170
|
-
|
2167
|
+
m.value = b;
|
2171
2168
|
}
|
2172
2169
|
), A(
|
2173
2170
|
() => l.modelValue,
|
2174
2171
|
(b) => {
|
2175
|
-
|
2172
|
+
m.value = b;
|
2176
2173
|
}
|
2177
|
-
),
|
2178
|
-
filterRef:
|
2174
|
+
), r({
|
2175
|
+
filterRef: n
|
2179
2176
|
});
|
2180
|
-
function
|
2177
|
+
function k() {
|
2181
2178
|
switch (l.layout) {
|
2182
2179
|
case "inline":
|
2183
|
-
return
|
2180
|
+
return Fe;
|
2184
2181
|
case "vertical":
|
2185
|
-
return
|
2182
|
+
return ql;
|
2186
2183
|
case "popover":
|
2187
2184
|
return Nl;
|
2188
2185
|
default:
|
2189
|
-
return
|
2186
|
+
return Fe;
|
2190
2187
|
}
|
2191
2188
|
}
|
2192
|
-
return (b, f) => (p(),
|
2193
|
-
onChange: f[0] || (f[0] = (
|
2194
|
-
onClear: f[1] || (f[1] = (
|
2195
|
-
modelValue:
|
2196
|
-
"onUpdate:modelValue": f[2] || (f[2] = (
|
2189
|
+
return (b, f) => (p(), z(oe(k()), Z(l, {
|
2190
|
+
onChange: f[0] || (f[0] = (y) => g(y.name, y.value)),
|
2191
|
+
onClear: f[1] || (f[1] = (y) => h(y)),
|
2192
|
+
modelValue: m.value,
|
2193
|
+
"onUpdate:modelValue": f[2] || (f[2] = (y) => m.value = y)
|
2197
2194
|
}), null, 16, ["modelValue"]));
|
2198
2195
|
}
|
2199
2196
|
});
|
2200
|
-
function
|
2197
|
+
function $e(i, r) {
|
2201
2198
|
const {
|
2202
2199
|
slots: d
|
2203
|
-
} =
|
2204
|
-
var
|
2205
|
-
return (fe((
|
2200
|
+
} = i, l = V(i.value ?? {}), a = E(() => {
|
2201
|
+
var v;
|
2202
|
+
return (fe((v = d == null ? void 0 : d.default) == null ? void 0 : v.call(d)) ?? []).flatMap((u) => Array.isArray(u.children) ? u.children : [u]);
|
2206
2203
|
});
|
2207
|
-
function
|
2208
|
-
delete l.value[
|
2204
|
+
function n(v) {
|
2205
|
+
delete l.value[v], r("clear", {
|
2209
2206
|
data: fe(l.value),
|
2210
|
-
name:
|
2207
|
+
name: v
|
2211
2208
|
});
|
2212
2209
|
}
|
2213
|
-
function v
|
2214
|
-
|
2210
|
+
function m(v, u) {
|
2211
|
+
u === void 0 ? n(v) : l.value = {
|
2215
2212
|
...l.value,
|
2216
|
-
[
|
2217
|
-
},
|
2213
|
+
[v]: u
|
2214
|
+
}, r("change", {
|
2218
2215
|
data: fe(l.value),
|
2219
|
-
name:
|
2220
|
-
value:
|
2216
|
+
name: v,
|
2217
|
+
value: u
|
2221
2218
|
});
|
2222
2219
|
}
|
2223
|
-
const
|
2224
|
-
var
|
2225
|
-
const
|
2226
|
-
return
|
2227
|
-
...
|
2228
|
-
layout:
|
2220
|
+
const h = E(() => a.value.map((v) => {
|
2221
|
+
var _;
|
2222
|
+
const u = (_ = v.props) == null ? void 0 : _.name;
|
2223
|
+
return Ge(v, {
|
2224
|
+
...v.props,
|
2225
|
+
layout: i.view,
|
2229
2226
|
showClean: !0,
|
2230
|
-
modelValue: l[
|
2227
|
+
modelValue: l[u],
|
2231
2228
|
"onUpdate:modelValue": (B) => {
|
2232
|
-
|
2229
|
+
m(u, B);
|
2233
2230
|
},
|
2234
|
-
onClear: () =>
|
2231
|
+
onClear: () => n(u)
|
2235
2232
|
});
|
2236
|
-
})), g =
|
2233
|
+
})), g = E(
|
2237
2234
|
() => new Map(
|
2238
|
-
|
2239
|
-
var
|
2240
|
-
const
|
2241
|
-
return
|
2242
|
-
}).filter((
|
2235
|
+
h.value.map((v) => {
|
2236
|
+
var _;
|
2237
|
+
const u = (_ = v.props) == null ? void 0 : _.name;
|
2238
|
+
return u ? [u, v] : null;
|
2239
|
+
}).filter((v) => v !== null)
|
2243
2240
|
)
|
2244
2241
|
);
|
2245
|
-
function
|
2246
|
-
l.value = {},
|
2242
|
+
function k(v = !1) {
|
2243
|
+
l.value = {}, v || r("clearAll", {
|
2247
2244
|
data: fe(l.value),
|
2248
2245
|
name: "ALL"
|
2249
2246
|
});
|
2250
2247
|
}
|
2251
|
-
const b =
|
2252
|
-
var
|
2253
|
-
return (
|
2254
|
-
}),
|
2248
|
+
const b = V(""), f = E(() => {
|
2249
|
+
var v;
|
2250
|
+
return (v = i.schema) != null && v.value ? Object.entries(l.value).filter(([u, _]) => i.schema && !(u in i.schema.value) ? !1 : Array.isArray(_) ? _.some((B) => B !== "" && B !== void 0) : _ !== "" && _ !== void 0).length : 0;
|
2251
|
+
}), y = V();
|
2255
2252
|
A(b, async () => {
|
2256
|
-
var
|
2257
|
-
await
|
2253
|
+
var v, u;
|
2254
|
+
await ke(), (u = (v = y == null ? void 0 : y.value) == null ? void 0 : v.filterRef) != null && u.inputTextRef && y.value.filterRef.inputTextRef.focus();
|
2258
2255
|
});
|
2259
|
-
const
|
2260
|
-
var
|
2261
|
-
return (
|
2262
|
-
}), c =
|
2263
|
-
var
|
2264
|
-
return (
|
2265
|
-
}),
|
2266
|
-
var
|
2267
|
-
if (
|
2268
|
-
let
|
2269
|
-
if ((
|
2270
|
-
const
|
2271
|
-
|
2256
|
+
const C = E(() => {
|
2257
|
+
var v, u;
|
2258
|
+
return (v = i.schema) != null && v.value ? Object.fromEntries(Object.entries((u = i.schema) == null ? void 0 : u.value).slice(0, i.limit)) : {};
|
2259
|
+
}), c = E(() => {
|
2260
|
+
var v, u, _;
|
2261
|
+
return (v = i.schema) != null && v.value ? i.view !== "inline" ? (u = i.schema) == null ? void 0 : u.value : Object.fromEntries(Object.entries((_ = i.schema) == null ? void 0 : _.value).slice(i.limit)) : {};
|
2262
|
+
}), s = E(() => {
|
2263
|
+
var u;
|
2264
|
+
if (h.value.length === 0) return [];
|
2265
|
+
let v = 0;
|
2266
|
+
if ((u = i.schema) != null && u.value) {
|
2267
|
+
const _ = Object.entries(i.schema.value).length;
|
2268
|
+
_ < i.limit ? v = i.limit - _ : v = 0;
|
2272
2269
|
}
|
2273
|
-
return
|
2274
|
-
}), t =
|
2270
|
+
return h.value.slice(0, v);
|
2271
|
+
}), t = E(() => h.value.length === 0 ? [] : i.view !== "inline" ? h.value : h.value.slice(s.value.length));
|
2275
2272
|
function x() {
|
2276
2273
|
if (c.value) {
|
2277
|
-
const [
|
2278
|
-
b.value =
|
2274
|
+
const [v] = Object.keys(c.value);
|
2275
|
+
b.value = v;
|
2279
2276
|
} else t.value.length > 0 ? b.value = t.value[0].props.name : b.value = "";
|
2280
2277
|
}
|
2281
2278
|
return {
|
2282
2279
|
activeFilter: l,
|
2283
2280
|
activeFilterCount: f,
|
2284
|
-
onFilterChange:
|
2285
|
-
clearFilter:
|
2286
|
-
clearAllFilters:
|
2287
|
-
limitedSchema:
|
2281
|
+
onFilterChange: m,
|
2282
|
+
clearFilter: n,
|
2283
|
+
clearAllFilters: k,
|
2284
|
+
limitedSchema: C,
|
2288
2285
|
popoverSchema: c,
|
2289
|
-
filtersSlot:
|
2290
|
-
limitedFiltersSlot:
|
2286
|
+
filtersSlot: h,
|
2287
|
+
limitedFiltersSlot: s,
|
2291
2288
|
popoverFiltersSlot: t,
|
2292
2289
|
vnodeMap: g,
|
2293
2290
|
onPopoverOpen: x,
|
2294
2291
|
selectedFilter: b,
|
2295
|
-
filterRef:
|
2292
|
+
filterRef: y
|
2296
2293
|
};
|
2297
2294
|
}
|
2298
|
-
const
|
2295
|
+
const Gl = /* @__PURE__ */ Y({
|
2299
2296
|
__name: "popover",
|
2300
2297
|
emits: ["open", "close"],
|
2301
|
-
setup(
|
2302
|
-
const d =
|
2303
|
-
function
|
2298
|
+
setup(i, { emit: r }) {
|
2299
|
+
const d = V(!1), l = V(null), a = V(null), n = V(null), m = V({ top: "0px", left: "0px", position: "absolute" });
|
2300
|
+
function h() {
|
2304
2301
|
d.value = !d.value;
|
2305
2302
|
}
|
2306
2303
|
function g() {
|
2307
|
-
const
|
2308
|
-
if (!
|
2309
|
-
const c =
|
2304
|
+
const y = n.value, C = l.value;
|
2305
|
+
if (!y || !C) return;
|
2306
|
+
const c = y.getBoundingClientRect(), s = C.offsetWidth, t = window.innerWidth - c.left;
|
2310
2307
|
let x = c.left + window.scrollX;
|
2311
|
-
|
2308
|
+
s > t && (x = window.innerWidth - s - 8, x < 8 && (x = 8)), m.value = {
|
2312
2309
|
position: "absolute",
|
2313
2310
|
top: `${c.bottom + window.scrollY + 8}px`,
|
2314
2311
|
left: `${x}px`
|
2315
2312
|
};
|
2316
2313
|
}
|
2317
|
-
function
|
2318
|
-
var c,
|
2319
|
-
const
|
2320
|
-
!((c =
|
2314
|
+
function k(y) {
|
2315
|
+
var c, s;
|
2316
|
+
const C = y.target;
|
2317
|
+
!((c = n.value) != null && c.contains(y.target)) && !((s = l.value) != null && s.contains(y.target)) && !C.closest("[data-inside-popover]") && (d.value = !1);
|
2321
2318
|
}
|
2322
|
-
const b =
|
2319
|
+
const b = V(!1);
|
2323
2320
|
ue(() => {
|
2324
2321
|
b.value = !0;
|
2325
2322
|
}), ue(() => {
|
2326
|
-
var
|
2327
|
-
|
2328
|
-
}),
|
2329
|
-
var
|
2330
|
-
(
|
2323
|
+
var y, C;
|
2324
|
+
n.value = ((y = a.value) == null ? void 0 : y.querySelector("[data-popover-trigger]")) || null, (C = n.value) == null || C.addEventListener("click", h), document.addEventListener("click", k), window.addEventListener("resize", g), window.addEventListener("scroll", g, !0);
|
2325
|
+
}), he(() => {
|
2326
|
+
var y;
|
2327
|
+
(y = n.value) == null || y.removeEventListener("click", h), document.removeEventListener("click", k), window.removeEventListener("resize", g), window.removeEventListener("scroll", g, !0);
|
2331
2328
|
});
|
2332
|
-
const f =
|
2333
|
-
return A(d, async (
|
2334
|
-
|
2335
|
-
}), (
|
2329
|
+
const f = r;
|
2330
|
+
return A(d, async (y) => {
|
2331
|
+
y ? (f("open"), await ke(), g()) : f("close");
|
2332
|
+
}), (y, C) => (p(), w("div", {
|
2336
2333
|
ref_key: "wrapperRef",
|
2337
|
-
ref:
|
2334
|
+
ref: a
|
2338
2335
|
}, [
|
2339
|
-
|
2340
|
-
b.value ? (p(),
|
2336
|
+
ee(y.$slots, "trigger"),
|
2337
|
+
b.value ? (p(), z(Ue, {
|
2341
2338
|
key: 0,
|
2342
2339
|
to: "body"
|
2343
2340
|
}, [
|
2344
|
-
|
2341
|
+
I(o("div", {
|
2345
2342
|
ref_key: "popoverRef",
|
2346
2343
|
ref: l,
|
2347
2344
|
class: "absolute z-[50] w-[600px] rounded-md border bg-white shadow-md",
|
2348
|
-
style:
|
2345
|
+
style: _e(m.value)
|
2349
2346
|
}, [
|
2350
|
-
|
2347
|
+
ee(y.$slots, "default")
|
2351
2348
|
], 4), [
|
2352
|
-
[
|
2349
|
+
[X, d.value]
|
2353
2350
|
])
|
2354
|
-
])) :
|
2351
|
+
])) : S("", !0)
|
2355
2352
|
], 512));
|
2356
2353
|
}
|
2357
|
-
}),
|
2354
|
+
}), Ql = {}, Zl = {
|
2358
2355
|
xmlns: "http://www.w3.org/2000/svg",
|
2359
2356
|
width: "24",
|
2360
2357
|
height: "24",
|
@@ -2366,27 +2363,27 @@ const Yl = /* @__PURE__ */ N({
|
|
2366
2363
|
"stroke-linejoin": "round",
|
2367
2364
|
class: "lucide lucide-filter h-4 w-4"
|
2368
2365
|
};
|
2369
|
-
function
|
2370
|
-
return p(),
|
2366
|
+
function Jl(i, r) {
|
2367
|
+
return p(), w("svg", Zl, r[0] || (r[0] = [
|
2371
2368
|
o("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" }, null, -1)
|
2372
2369
|
]));
|
2373
2370
|
}
|
2374
|
-
const
|
2371
|
+
const Xl = /* @__PURE__ */ le(Ql, [["render", Jl]]), ea = {
|
2375
2372
|
key: 0,
|
2376
2373
|
class: "inline-flex rounded-sm items-center border font-semibold border-transparent hover:bg-secondary/80 bg-blue-500 text-white text-xs px-1.5"
|
2377
|
-
},
|
2374
|
+
}, ta = { class: "flex" }, la = { class: "w-64 border-r border-gray-200" }, aa = { class: "p-2" }, oa = ["onClick"], ra = { class: "flex items-center gap-2" }, na = { class: "text-sm font-medium" }, ia = {
|
2378
2375
|
key: 0,
|
2379
2376
|
class: "inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 text-blue-700 text-xs p-2"
|
2380
|
-
},
|
2377
|
+
}, sa = ["onClick"], ua = { class: "flex items-center gap-2" }, da = { class: "text-sm font-medium" }, ca = {
|
2381
2378
|
key: 0,
|
2382
2379
|
class: "inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 text-blue-700 text-xs p-2"
|
2383
|
-
},
|
2380
|
+
}, pa = {
|
2384
2381
|
key: 0,
|
2385
2382
|
class: "p-2 border-t"
|
2386
|
-
},
|
2383
|
+
}, fa = { class: "flex-1 min-h-[300px] overflow-y-auto" }, va = {
|
2387
2384
|
key: 0,
|
2388
2385
|
class: "flex items-center justify-center h-full text-gray-500"
|
2389
|
-
}, Ne = /* @__PURE__ */
|
2386
|
+
}, Ne = /* @__PURE__ */ Y({
|
2390
2387
|
__name: "popover-filter-layout",
|
2391
2388
|
props: {
|
2392
2389
|
schema: {},
|
@@ -2397,151 +2394,151 @@ const Ql = /* @__PURE__ */ X(Wl, [["render", Gl]]), Zl = {
|
|
2397
2394
|
limit: { default: 3 }
|
2398
2395
|
},
|
2399
2396
|
emits: ["change", "clear", "clearAll"],
|
2400
|
-
setup(
|
2401
|
-
const l =
|
2397
|
+
setup(i, { expose: r, emit: d }) {
|
2398
|
+
const l = i, a = We(l.mode), n = we(), m = d, h = V({}), {
|
2402
2399
|
activeFilter: g,
|
2403
|
-
activeFilterCount:
|
2400
|
+
activeFilterCount: k,
|
2404
2401
|
onFilterChange: b,
|
2405
2402
|
clearFilter: f,
|
2406
|
-
clearAllFilters:
|
2407
|
-
popoverSchema:
|
2403
|
+
clearAllFilters: y,
|
2404
|
+
popoverSchema: C,
|
2408
2405
|
popoverFiltersSlot: c,
|
2409
|
-
onPopoverOpen:
|
2406
|
+
onPopoverOpen: s,
|
2410
2407
|
selectedFilter: t,
|
2411
2408
|
filterRef: x
|
2412
|
-
} =
|
2409
|
+
} = $e({
|
2413
2410
|
...l,
|
2414
|
-
schema:
|
2415
|
-
slots:
|
2416
|
-
},
|
2411
|
+
schema: h,
|
2412
|
+
slots: n
|
2413
|
+
}, m);
|
2417
2414
|
return A(
|
2418
2415
|
() => l.schema,
|
2419
|
-
(
|
2420
|
-
|
2416
|
+
(v) => {
|
2417
|
+
h.value = v;
|
2421
2418
|
},
|
2422
2419
|
{ deep: !0, immediate: !0 }
|
2423
|
-
),
|
2420
|
+
), r({
|
2424
2421
|
clearFilter: f,
|
2425
|
-
clearAllFilters:
|
2426
|
-
}), (
|
2427
|
-
onOpen: e(
|
2428
|
-
onClose:
|
2422
|
+
clearAllFilters: y
|
2423
|
+
}), (v, u) => (p(), z(Gl, {
|
2424
|
+
onOpen: e(s),
|
2425
|
+
onClose: u[5] || (u[5] = (_) => t.value = "")
|
2429
2426
|
}, {
|
2430
|
-
trigger:
|
2427
|
+
trigger: re(() => [
|
2431
2428
|
o("button", {
|
2432
2429
|
"data-popover-trigger": "",
|
2433
2430
|
"aria-haspopup": "dialog",
|
2434
2431
|
"aria-expanded": "false",
|
2435
|
-
class:
|
2436
|
-
e(
|
2432
|
+
class: j(
|
2433
|
+
e(a) + (e(k) > 0 ? "bg-blue-50 border-blue-200 text-blue-700 hover:bg-blue-100" : "text-gray-800 hover:bg-gray-200 focus:bg-gray-200")
|
2437
2434
|
),
|
2438
2435
|
type: "button"
|
2439
2436
|
}, [
|
2440
|
-
|
2441
|
-
|
2442
|
-
e(
|
2437
|
+
P(Xl),
|
2438
|
+
u[6] || (u[6] = W(" Фільтр ", -1)),
|
2439
|
+
e(k) > 0 ? (p(), w("div", ea, K(e(k)), 1)) : S("", !0)
|
2443
2440
|
], 2)
|
2444
2441
|
]),
|
2445
|
-
default:
|
2446
|
-
o("div",
|
2447
|
-
o("div",
|
2448
|
-
|
2442
|
+
default: re(() => [
|
2443
|
+
o("div", ta, [
|
2444
|
+
o("div", la, [
|
2445
|
+
u[7] || (u[7] = o("div", { class: "p-4 border-b" }, [
|
2449
2446
|
o("p", { class: "text-sm text-gray-600" }, "Select a field to start creating a filter.")
|
2450
2447
|
], -1)),
|
2451
|
-
o("div",
|
2452
|
-
|
2453
|
-
var
|
2454
|
-
return p(),
|
2455
|
-
key:
|
2448
|
+
o("div", aa, [
|
2449
|
+
v.schema ? (p(!0), w(F, { key: 0 }, q(Object.entries(e(C)), ([_, B]) => {
|
2450
|
+
var M;
|
2451
|
+
return p(), w("button", {
|
2452
|
+
key: _,
|
2456
2453
|
onClick: () => {
|
2457
|
-
t.value =
|
2454
|
+
t.value = _;
|
2458
2455
|
},
|
2459
|
-
class:
|
2456
|
+
class: j([
|
2460
2457
|
"w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",
|
2461
|
-
e(t) ===
|
2458
|
+
e(t) === _ ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
|
2462
2459
|
])
|
2463
2460
|
}, [
|
2464
|
-
o("div",
|
2465
|
-
o("span",
|
2461
|
+
o("div", ra, [
|
2462
|
+
o("span", na, K(B.label), 1)
|
2466
2463
|
]),
|
2467
|
-
(Array.isArray(e(g)[
|
2468
|
-
], 10,
|
2469
|
-
}), 128)) :
|
2470
|
-
(p(!0),
|
2471
|
-
var
|
2472
|
-
return p(),
|
2464
|
+
(Array.isArray(e(g)[_]) ? ((M = e(g)[_]) == null ? void 0 : M.length) > 0 : e(g)[_] || e(g)[_] === null) ? (p(), w("div", ia)) : S("", !0)
|
2465
|
+
], 10, oa);
|
2466
|
+
}), 128)) : S("", !0),
|
2467
|
+
(p(!0), w(F, null, q(e(c), (_, B) => {
|
2468
|
+
var M;
|
2469
|
+
return p(), w("button", {
|
2473
2470
|
key: "slot-" + B,
|
2474
|
-
onClick: (
|
2475
|
-
class:
|
2471
|
+
onClick: (L) => t.value = _.props.name,
|
2472
|
+
class: j([
|
2476
2473
|
"w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",
|
2477
|
-
e(t) ===
|
2474
|
+
e(t) === _.props.name ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
|
2478
2475
|
])
|
2479
2476
|
}, [
|
2480
|
-
o("div",
|
2481
|
-
o("span",
|
2477
|
+
o("div", ua, [
|
2478
|
+
o("span", da, K(_.props.label), 1)
|
2482
2479
|
]),
|
2483
|
-
((
|
2484
|
-
], 10,
|
2480
|
+
((M = e(g)[_.props.name]) == null ? void 0 : M.length) > 0 ? (p(), w("div", ca)) : S("", !0)
|
2481
|
+
], 10, sa);
|
2485
2482
|
}), 128))
|
2486
2483
|
]),
|
2487
|
-
e(
|
2484
|
+
e(k) > 0 ? (p(), w("div", pa, [
|
2488
2485
|
o("button", {
|
2489
2486
|
class: "w-full px-3 py-2 text-left text-sm text-gray-600 hover:bg-gray-50 transition-colors",
|
2490
|
-
onClick:
|
2487
|
+
onClick: u[0] || (u[0] = (_) => e(y)()),
|
2491
2488
|
"data-inside-popover": ""
|
2492
2489
|
}, " Очистити всі ")
|
2493
|
-
])) :
|
2490
|
+
])) : S("", !0)
|
2494
2491
|
]),
|
2495
|
-
o("div",
|
2496
|
-
e(t) === "" ? (p(),
|
2492
|
+
o("div", fa, [
|
2493
|
+
e(t) === "" ? (p(), w("div", va, u[8] || (u[8] = [
|
2497
2494
|
o("p", { class: "text-sm" }, "Select a field to start creating a filter.", -1)
|
2498
|
-
]))) :
|
2499
|
-
e(t) ? (p(),
|
2500
|
-
e(
|
2501
|
-
e(t) ===
|
2502
|
-
name:
|
2503
|
-
key:
|
2495
|
+
]))) : S("", !0),
|
2496
|
+
e(t) ? (p(), w(F, { key: 1 }, [
|
2497
|
+
e(C) ? (p(!0), w(F, { key: 0 }, q(Object.entries(e(C)), ([_, B]) => (p(), w(F, null, [
|
2498
|
+
e(t) === _ ? (p(), z(ne, Z({
|
2499
|
+
name: _,
|
2500
|
+
key: _,
|
2504
2501
|
layout: "popover",
|
2505
2502
|
ref_for: !0,
|
2506
2503
|
ref_key: "filterRef",
|
2507
2504
|
ref: x
|
2508
2505
|
}, { ref_for: !0 }, B, {
|
2509
|
-
onChange:
|
2510
|
-
onClear:
|
2511
|
-
e(f)(
|
2506
|
+
onChange: u[1] || (u[1] = (M) => e(b)(M.name, M.value)),
|
2507
|
+
onClear: u[2] || (u[2] = (M) => {
|
2508
|
+
e(f)(M), e(b)(M, void 0);
|
2512
2509
|
}),
|
2513
|
-
modelValue: e(g)[
|
2514
|
-
"onUpdate:modelValue": (
|
2510
|
+
modelValue: e(g)[_],
|
2511
|
+
"onUpdate:modelValue": (M) => e(g)[_] = M,
|
2515
2512
|
cleanable: !0
|
2516
|
-
}), null, 16, ["name", "modelValue", "onUpdate:modelValue"])) :
|
2517
|
-
], 64))), 256)) :
|
2518
|
-
(p(!0),
|
2513
|
+
}), null, 16, ["name", "modelValue", "onUpdate:modelValue"])) : S("", !0)
|
2514
|
+
], 64))), 256)) : S("", !0),
|
2515
|
+
(p(!0), w(F, null, q(e(c), (_, B) => (p(), w(F, {
|
2519
2516
|
key: "slot-" + B
|
2520
2517
|
}, [
|
2521
|
-
e(t) ===
|
2518
|
+
e(t) === _.props.name ? (p(), z(ne, Z({
|
2522
2519
|
key: 0,
|
2523
2520
|
layout: "popover"
|
2524
|
-
}, { ref_for: !0 },
|
2521
|
+
}, { ref_for: !0 }, _.props, {
|
2525
2522
|
ref_for: !0,
|
2526
2523
|
ref_key: "filterRef",
|
2527
2524
|
ref: x,
|
2528
|
-
onChange:
|
2529
|
-
onClear:
|
2530
|
-
e(f)(
|
2525
|
+
onChange: u[3] || (u[3] = (M) => e(b)(M.name, M.value)),
|
2526
|
+
onClear: u[4] || (u[4] = (M) => {
|
2527
|
+
e(f)(M), e(b)(M, void 0);
|
2531
2528
|
}),
|
2532
|
-
modelValue: e(g)[
|
2533
|
-
"onUpdate:modelValue": (
|
2529
|
+
modelValue: e(g)[_.props.name],
|
2530
|
+
"onUpdate:modelValue": (M) => e(g)[_.props.name] = M,
|
2534
2531
|
cleanable: !0
|
2535
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue"])) :
|
2532
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue"])) : S("", !0)
|
2536
2533
|
], 64))), 128))
|
2537
|
-
], 64)) :
|
2534
|
+
], 64)) : S("", !0)
|
2538
2535
|
])
|
2539
2536
|
])
|
2540
2537
|
]),
|
2541
2538
|
_: 1
|
2542
2539
|
}, 8, ["onOpen"]));
|
2543
2540
|
}
|
2544
|
-
}),
|
2541
|
+
}), ma = { class: "flex gap-1 items-center flex-wrap" }, Ke = /* @__PURE__ */ Y({
|
2545
2542
|
__name: "inline-filter-layout",
|
2546
2543
|
props: {
|
2547
2544
|
schema: {},
|
@@ -2552,93 +2549,93 @@ const Ql = /* @__PURE__ */ X(Wl, [["render", Gl]]), Zl = {
|
|
2552
2549
|
limit: { default: 3 }
|
2553
2550
|
},
|
2554
2551
|
emits: ["change", "clear", "clearAll"],
|
2555
|
-
setup(
|
2556
|
-
const l =
|
2557
|
-
activeFilter:
|
2552
|
+
setup(i, { expose: r, emit: d }) {
|
2553
|
+
const l = i, a = d, n = we(), m = V({}), {
|
2554
|
+
activeFilter: h,
|
2558
2555
|
activeFilterCount: g,
|
2559
|
-
onFilterChange:
|
2556
|
+
onFilterChange: k,
|
2560
2557
|
clearFilter: b,
|
2561
2558
|
clearAllFilters: f,
|
2562
|
-
limitedSchema:
|
2563
|
-
popoverSchema:
|
2559
|
+
limitedSchema: y,
|
2560
|
+
popoverSchema: C,
|
2564
2561
|
filtersSlot: c,
|
2565
|
-
limitedFiltersSlot:
|
2562
|
+
limitedFiltersSlot: s,
|
2566
2563
|
popoverFiltersSlot: t
|
2567
|
-
} =
|
2564
|
+
} = $e(
|
2568
2565
|
{
|
2569
2566
|
...l,
|
2570
|
-
schema:
|
2571
|
-
slots:
|
2567
|
+
schema: m,
|
2568
|
+
slots: n
|
2572
2569
|
},
|
2573
|
-
|
2574
|
-
), x =
|
2575
|
-
function
|
2570
|
+
a
|
2571
|
+
), x = V();
|
2572
|
+
function v() {
|
2576
2573
|
x.value && x.value.clearAllFilters(!0), f();
|
2577
2574
|
}
|
2578
2575
|
return A(
|
2579
2576
|
() => l.schema,
|
2580
|
-
(
|
2581
|
-
|
2577
|
+
(u) => {
|
2578
|
+
m.value = u;
|
2582
2579
|
},
|
2583
2580
|
{ deep: !0, immediate: !0 }
|
2584
|
-
),
|
2581
|
+
), r({
|
2585
2582
|
clearFilter: b,
|
2586
2583
|
clearAllFilters: f
|
2587
|
-
}), (
|
2588
|
-
|
2584
|
+
}), (u, _) => (p(), w("div", ma, [
|
2585
|
+
u.schema ? (p(!0), w(F, { key: 0 }, q(Object.entries(e(y)), ([B, M]) => (p(), z(ne, Z({
|
2589
2586
|
key: B,
|
2590
2587
|
name: B,
|
2591
|
-
mode:
|
2592
|
-
}, { ref_for: !0 },
|
2593
|
-
onChange:
|
2588
|
+
mode: u.mode
|
2589
|
+
}, { ref_for: !0 }, M, {
|
2590
|
+
onChange: _[0] || (_[0] = (L) => e(k)(L.name, L.value)),
|
2594
2591
|
onClear: e(b),
|
2595
2592
|
layout: "inline",
|
2596
2593
|
cleanable: !0,
|
2597
|
-
modelValue: e(
|
2598
|
-
"onUpdate:modelValue": (
|
2599
|
-
}), null, 16, ["name", "mode", "onClear", "modelValue", "onUpdate:modelValue"]))), 128)) :
|
2600
|
-
(p(!0),
|
2601
|
-
key: "slot-" +
|
2594
|
+
modelValue: e(h)[B],
|
2595
|
+
"onUpdate:modelValue": (L) => e(h)[B] = L
|
2596
|
+
}), null, 16, ["name", "mode", "onClear", "modelValue", "onUpdate:modelValue"]))), 128)) : S("", !0),
|
2597
|
+
(p(!0), w(F, null, q(e(s), (B, M) => (p(), z(ne, Z({
|
2598
|
+
key: "slot-" + M,
|
2602
2599
|
layout: "inline"
|
2603
2600
|
}, { ref_for: !0 }, B.props, {
|
2604
|
-
onChange:
|
2605
|
-
onClear:
|
2606
|
-
e(b)(
|
2601
|
+
onChange: _[1] || (_[1] = (L) => e(k)(L.name, L.value)),
|
2602
|
+
onClear: _[2] || (_[2] = (L) => {
|
2603
|
+
e(b)(L), e(k)(L, void 0);
|
2607
2604
|
}),
|
2608
2605
|
cleanable: !0,
|
2609
|
-
modelValue: e(
|
2610
|
-
"onUpdate:modelValue": (
|
2606
|
+
modelValue: e(h)[B.props.name],
|
2607
|
+
"onUpdate:modelValue": (L) => e(h)[B.props.name] = L
|
2611
2608
|
}), null, 16, ["modelValue", "onUpdate:modelValue"]))), 128)),
|
2612
|
-
Object.entries(e(
|
2613
|
-
schema: e(
|
2609
|
+
Object.entries(e(C)).length > 0 || e(t).length > 0 ? (p(), z(Ne, Z({ key: 1 }, l, {
|
2610
|
+
schema: e(C),
|
2614
2611
|
limit: 0,
|
2615
|
-
onChange:
|
2616
|
-
onClearAll:
|
2617
|
-
onClear:
|
2618
|
-
mode:
|
2612
|
+
onChange: _[3] || (_[3] = (B) => e(k)(B.name, B.value)),
|
2613
|
+
onClearAll: _[4] || (_[4] = (B) => e(f)()),
|
2614
|
+
onClear: _[5] || (_[5] = (B) => e(b)(B.name)),
|
2615
|
+
mode: u.mode,
|
2619
2616
|
ref_key: "popoverRef",
|
2620
2617
|
ref: x,
|
2621
2618
|
cleanable: !0
|
2622
2619
|
}), {
|
2623
|
-
default:
|
2624
|
-
(p(!0),
|
2625
|
-
key: "slot-" +
|
2620
|
+
default: re(() => [
|
2621
|
+
(p(!0), w(F, null, q(e(c), (B, M) => (p(), z(oe(B), Z({
|
2622
|
+
key: "slot-" + M,
|
2626
2623
|
layout: "popover"
|
2627
2624
|
}, { ref_for: !0 }, B.props, { cleanable: !0 }), null, 16))), 128))
|
2628
2625
|
]),
|
2629
2626
|
_: 1
|
2630
|
-
}, 16, ["schema", "mode"])) :
|
2631
|
-
e(g) > 0 ? (p(),
|
2627
|
+
}, 16, ["schema", "mode"])) : S("", !0),
|
2628
|
+
e(g) > 0 ? (p(), w("button", {
|
2632
2629
|
key: 2,
|
2633
|
-
onClick:
|
2630
|
+
onClick: v,
|
2634
2631
|
class: "relative py-2 px-3 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 border border-transparent text-gray-800 hover:bg-gray-200 focus:bg-gray-200"
|
2635
|
-
}, " Очистити ")) :
|
2632
|
+
}, " Очистити ")) : S("", !0)
|
2636
2633
|
]));
|
2637
2634
|
}
|
2638
|
-
}),
|
2635
|
+
}), ga = {
|
2639
2636
|
key: 0,
|
2640
2637
|
class: "p-2 overflow-y-auto overflow-hidden [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-800 max-h-[calc(100%-142px)] h-full bg-gray-100"
|
2641
|
-
},
|
2638
|
+
}, ha = { class: "flex items-center vst-filters vsTailwind flex-col w-full" }, ba = /* @__PURE__ */ Y({
|
2642
2639
|
__name: "vertical-filter-layout",
|
2643
2640
|
props: {
|
2644
2641
|
schema: {},
|
@@ -2649,60 +2646,60 @@ const Ql = /* @__PURE__ */ X(Wl, [["render", Gl]]), Zl = {
|
|
2649
2646
|
limit: { default: 3 }
|
2650
2647
|
},
|
2651
2648
|
emits: ["change", "clear", "clearAll"],
|
2652
|
-
setup(
|
2653
|
-
const l =
|
2654
|
-
activeFilter:
|
2655
|
-
activeFilterCount:
|
2649
|
+
setup(i, { expose: r, emit: d }) {
|
2650
|
+
const l = i, a = d, n = we(), {
|
2651
|
+
activeFilter: m,
|
2652
|
+
activeFilterCount: h,
|
2656
2653
|
onFilterChange: g,
|
2657
|
-
clearFilter:
|
2654
|
+
clearFilter: k,
|
2658
2655
|
clearAllFilters: b,
|
2659
2656
|
filtersSlot: f
|
2660
|
-
} =
|
2657
|
+
} = $e({
|
2661
2658
|
...l,
|
2662
|
-
slots:
|
2663
|
-
},
|
2664
|
-
return
|
2665
|
-
clearFilter:
|
2659
|
+
slots: n
|
2660
|
+
}, a);
|
2661
|
+
return r({
|
2662
|
+
clearFilter: k,
|
2666
2663
|
clearAllFilters: b
|
2667
|
-
}), (
|
2668
|
-
o("div",
|
2669
|
-
e(
|
2664
|
+
}), (y, C) => y.view === "vertical" ? (p(), w("div", ga, [
|
2665
|
+
o("div", ha, [
|
2666
|
+
e(h) > 0 ? (p(), w("button", {
|
2670
2667
|
key: 0,
|
2671
|
-
onClick:
|
2668
|
+
onClick: C[0] || (C[0] = (c) => e(b)()),
|
2672
2669
|
"data-popover-trigger": "",
|
2673
2670
|
"aria-haspopup": "dialog",
|
2674
2671
|
"aria-expanded": "false",
|
2675
2672
|
class: "w-full ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md 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 hover:text-accent-foreground border h-10 px-4 py-2 gap-2 m-2 bg-white text-gray-800 hover:bg-gray-200 focus:bg-gray-200",
|
2676
2673
|
type: "button"
|
2677
|
-
}, " Очистити ")) :
|
2678
|
-
|
2674
|
+
}, " Очистити ")) : S("", !0),
|
2675
|
+
y.schema ? (p(!0), w(F, { key: 1 }, q(Object.entries(y.schema), ([c, s]) => (p(), z(ne, Z({
|
2679
2676
|
name: c,
|
2680
2677
|
layout: "vertical"
|
2681
|
-
}, { ref_for: !0 },
|
2682
|
-
onChange:
|
2683
|
-
onClear:
|
2684
|
-
e(
|
2678
|
+
}, { ref_for: !0 }, s, {
|
2679
|
+
onChange: C[1] || (C[1] = (t) => e(g)(t.name, t.value)),
|
2680
|
+
onClear: C[2] || (C[2] = (t) => {
|
2681
|
+
e(k)(t), e(g)(t, void 0);
|
2685
2682
|
}),
|
2686
|
-
modelValue: e(
|
2687
|
-
"onUpdate:modelValue": (t) => e(
|
2683
|
+
modelValue: e(m)[c],
|
2684
|
+
"onUpdate:modelValue": (t) => e(m)[c] = t,
|
2688
2685
|
showClean: !0
|
2689
|
-
}), null, 16, ["name", "modelValue", "onUpdate:modelValue"]))), 256)) :
|
2690
|
-
(p(!0),
|
2691
|
-
key: "slot-" +
|
2686
|
+
}), null, 16, ["name", "modelValue", "onUpdate:modelValue"]))), 256)) : S("", !0),
|
2687
|
+
(p(!0), w(F, null, q(e(f), (c, s) => (p(), z(ne, Z({
|
2688
|
+
key: "slot-" + s,
|
2692
2689
|
layout: "vertical"
|
2693
2690
|
}, { ref_for: !0 }, c.props, {
|
2694
|
-
onChange:
|
2695
|
-
onClear:
|
2696
|
-
e(
|
2691
|
+
onChange: C[3] || (C[3] = (t) => e(g)(t.name, t.value)),
|
2692
|
+
onClear: C[4] || (C[4] = (t) => {
|
2693
|
+
e(k)(t), e(g)(t, void 0);
|
2697
2694
|
}),
|
2698
|
-
modelValue: e(
|
2699
|
-
"onUpdate:modelValue": (t) => e(
|
2695
|
+
modelValue: e(m)[c.props.name],
|
2696
|
+
"onUpdate:modelValue": (t) => e(m)[c.props.name] = t,
|
2700
2697
|
showClean: !0
|
2701
2698
|
}), null, 16, ["modelValue", "onUpdate:modelValue"]))), 128))
|
2702
2699
|
])
|
2703
|
-
])) :
|
2700
|
+
])) : S("", !0);
|
2704
2701
|
}
|
2705
|
-
}),
|
2702
|
+
}), xe = /* @__PURE__ */ Y({
|
2706
2703
|
__name: "filter",
|
2707
2704
|
props: {
|
2708
2705
|
schema: {},
|
@@ -2713,116 +2710,116 @@ const Ql = /* @__PURE__ */ X(Wl, [["render", Gl]]), Zl = {
|
|
2713
2710
|
limit: { default: 3 }
|
2714
2711
|
},
|
2715
2712
|
emits: ["change", "clear", "clearAll"],
|
2716
|
-
setup(
|
2717
|
-
const l =
|
2718
|
-
function
|
2719
|
-
if (Array.isArray(
|
2720
|
-
return
|
2721
|
-
if (
|
2722
|
-
const t = fe(
|
2723
|
-
for (const
|
2724
|
-
x[
|
2713
|
+
setup(i, { expose: r, emit: d }) {
|
2714
|
+
const l = i, a = V(l.value ?? {}), n = d, m = V();
|
2715
|
+
function h(s) {
|
2716
|
+
if (Array.isArray(s))
|
2717
|
+
return s.map((t) => h(t));
|
2718
|
+
if (s !== null && typeof s == "object") {
|
2719
|
+
const t = fe(s), x = {};
|
2720
|
+
for (const v in t)
|
2721
|
+
x[v] = h(t[v]);
|
2725
2722
|
return x;
|
2726
2723
|
}
|
2727
|
-
return
|
2724
|
+
return s;
|
2728
2725
|
}
|
2729
|
-
function g(
|
2730
|
-
t !== void 0 ?
|
2731
|
-
...
|
2732
|
-
[
|
2733
|
-
} : delete
|
2734
|
-
data:
|
2735
|
-
name:
|
2736
|
-
value:
|
2726
|
+
function g(s, t) {
|
2727
|
+
t !== void 0 ? a.value = {
|
2728
|
+
...a.value,
|
2729
|
+
[s]: t
|
2730
|
+
} : delete a.value[s], n("change", {
|
2731
|
+
data: h(a.value),
|
2732
|
+
name: s,
|
2733
|
+
value: h(t)
|
2737
2734
|
});
|
2738
2735
|
}
|
2739
|
-
function
|
2740
|
-
delete
|
2741
|
-
data:
|
2742
|
-
name:
|
2743
|
-
}),
|
2744
|
-
data:
|
2745
|
-
name:
|
2736
|
+
function k(s) {
|
2737
|
+
delete a.value[s], n("clear", {
|
2738
|
+
data: h(a.value),
|
2739
|
+
name: s
|
2740
|
+
}), n("change", {
|
2741
|
+
data: h(a.value),
|
2742
|
+
name: s,
|
2746
2743
|
value: null
|
2747
2744
|
});
|
2748
2745
|
}
|
2749
2746
|
function b() {
|
2750
|
-
|
2751
|
-
data:
|
2747
|
+
a.value = {}, n("clear", {
|
2748
|
+
data: h(a.value),
|
2752
2749
|
name: "ALL"
|
2753
|
-
}),
|
2754
|
-
data:
|
2750
|
+
}), n("change", {
|
2751
|
+
data: h(a.value),
|
2755
2752
|
name: "ALL",
|
2756
2753
|
value: null
|
2757
2754
|
});
|
2758
2755
|
}
|
2759
|
-
const f =
|
2760
|
-
function
|
2756
|
+
const f = V({});
|
2757
|
+
function y() {
|
2761
2758
|
switch (l.view) {
|
2762
2759
|
case "inline":
|
2763
|
-
return
|
2760
|
+
return Ke;
|
2764
2761
|
case "vertical":
|
2765
|
-
return
|
2762
|
+
return ba;
|
2766
2763
|
case "popover":
|
2767
2764
|
return Ne;
|
2768
2765
|
default:
|
2769
|
-
return
|
2766
|
+
return Ke;
|
2770
2767
|
}
|
2771
2768
|
}
|
2772
2769
|
A(
|
2773
2770
|
() => l.schema,
|
2774
|
-
(
|
2775
|
-
if (!
|
2771
|
+
(s) => {
|
2772
|
+
if (!s) {
|
2776
2773
|
f.value = {};
|
2777
2774
|
return;
|
2778
2775
|
}
|
2779
|
-
if (Array.isArray(
|
2776
|
+
if (Array.isArray(s) && !s.length) {
|
2780
2777
|
f.value = {};
|
2781
2778
|
return;
|
2782
2779
|
}
|
2783
|
-
Array.isArray(
|
2780
|
+
Array.isArray(s) ? f.value = s.filter((t) => t.type).reduce((t, x) => (Object.assign(x, { name: x.id || x.name, type: x.type.toLowerCase() }), t[x.name] = x, x.data && !x.api && !x.options && Object.assign(x, { api: `/api/suggest/${x.data}` }), t), {}) : (Object.entries(s).forEach(([t, x]) => {
|
2784
2781
|
Object.assign(x, { name: t || x.name || x.id, type: x.type.toLowerCase() });
|
2785
|
-
}), f.value = { ...
|
2782
|
+
}), f.value = { ...s });
|
2786
2783
|
},
|
2787
2784
|
{ immediate: !0, deep: !0 }
|
2788
2785
|
);
|
2789
|
-
function
|
2790
|
-
|
2786
|
+
function C(s) {
|
2787
|
+
m.value.clearFilter(s), k(s);
|
2791
2788
|
}
|
2792
2789
|
function c() {
|
2793
|
-
|
2790
|
+
m.value.clearAllFilters(), b();
|
2794
2791
|
}
|
2795
|
-
return
|
2792
|
+
return r({
|
2796
2793
|
clearAllFilters: c,
|
2797
|
-
clearFilter:
|
2798
|
-
}), (
|
2794
|
+
clearFilter: C
|
2795
|
+
}), (s, t) => (p(), z(oe(y()), Z(l, {
|
2799
2796
|
schema: f.value,
|
2800
2797
|
onChange: t[0] || (t[0] = (x) => g(x.name, x.value)),
|
2801
|
-
onClear: t[1] || (t[1] = (x) =>
|
2798
|
+
onClear: t[1] || (t[1] = (x) => k(x.name)),
|
2802
2799
|
onClearAll: b,
|
2803
2800
|
ref_key: "filterRef",
|
2804
|
-
ref:
|
2801
|
+
ref: m
|
2805
2802
|
}), {
|
2806
|
-
default:
|
2807
|
-
|
2803
|
+
default: re(() => [
|
2804
|
+
ee(s.$slots, "default")
|
2808
2805
|
]),
|
2809
2806
|
_: 3
|
2810
2807
|
}, 16, ["schema"]));
|
2811
2808
|
}
|
2812
2809
|
});
|
2813
|
-
|
2814
|
-
|
2810
|
+
xe.install = function(i) {
|
2811
|
+
i.component("Filter", xe), i.component("FilterField", ne);
|
2815
2812
|
};
|
2816
|
-
function
|
2817
|
-
const { page:
|
2818
|
-
|
2813
|
+
function ya(i) {
|
2814
|
+
const { page: r, id: d, filter: l } = i, a = new URL(window.location.href), n = new URLSearchParams(window.location.search);
|
2815
|
+
r ? n.set("page", r.toString()) : n.delete("page"), d ? n.set("id", d.toString()) : n.delete("id"), l ? n.set("filter", l) : n.delete("filter"), a.search = decodeURI(n.toString()), window.history.pushState({}, "", a);
|
2819
2816
|
}
|
2820
|
-
const
|
2817
|
+
const xa = { class: "flex items-center justify-between w-full gap-x-1" }, wa = { class: "flex items-center" }, ka = ["disabled"], _a = { class: "flex items-center gap-x-1" }, Ca = ["onClick"], Va = ["disabled"], Sa = { class: "flex justify-center items-center gap-x-5 ml-3" }, Ma = { class: "relative" }, Ba = {
|
2821
2818
|
class: "hs-dropdown-menu z-50 bg-white shadow-md rounded-lg p-1 space-y-0.5 dark:bg-neutral-800 dark:border dark:border-neutral-700 right-0 dark:divide-neutral-700 absolute bottom-[100%]",
|
2822
2819
|
role: "menu",
|
2823
2820
|
"aria-orientation": "vertical",
|
2824
2821
|
"aria-labelledby": "dropdown-button"
|
2825
|
-
},
|
2822
|
+
}, $a = ["onClick"], Aa = {
|
2826
2823
|
key: 0,
|
2827
2824
|
xmlns: "http://www.w3.org/2000/svg",
|
2828
2825
|
viewBox: "0 0 24 24",
|
@@ -2834,7 +2831,7 @@ const bo = { class: "flex items-center justify-between w-full gap-x-1" }, ho = {
|
|
2834
2831
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-check text-blue-600",
|
2835
2832
|
width: "14",
|
2836
2833
|
height: "14"
|
2837
|
-
},
|
2834
|
+
}, Ra = /* @__PURE__ */ Y({
|
2838
2835
|
__name: "pagination",
|
2839
2836
|
props: {
|
2840
2837
|
total: {},
|
@@ -2842,35 +2839,35 @@ const bo = { class: "flex items-center justify-between w-full gap-x-1" }, ho = {
|
|
2842
2839
|
pageSize: {}
|
2843
2840
|
},
|
2844
2841
|
emits: ["update:currentPage", "update:pageSize", "pageChange", "pageSizeChange"],
|
2845
|
-
setup(
|
2846
|
-
const d =
|
2847
|
-
A(() => d.pageSize, (
|
2848
|
-
|
2842
|
+
setup(i, { emit: r }) {
|
2843
|
+
const d = i, l = r, a = V(d.currentPage), n = V(d.pageSize), m = V(!1);
|
2844
|
+
A(() => d.pageSize, (C) => {
|
2845
|
+
n.value = C;
|
2849
2846
|
});
|
2850
|
-
const
|
2847
|
+
const h = E(() => Math.ceil(d.total / d.pageSize)), g = E(() => {
|
2851
2848
|
const c = Math.floor(3.5);
|
2852
|
-
let
|
2853
|
-
|
2849
|
+
let s = a.value - c, t = a.value + c;
|
2850
|
+
s < 1 && (t += 1 - s, s = 1), t > h.value && (s -= t - h.value, t = h.value), s = Math.max(1, s);
|
2854
2851
|
const x = [];
|
2855
|
-
for (let
|
2856
|
-
x.push(
|
2852
|
+
for (let v = s; v <= t; v += 1)
|
2853
|
+
x.push(v);
|
2857
2854
|
return x;
|
2858
|
-
}),
|
2859
|
-
|
2855
|
+
}), k = () => {
|
2856
|
+
a.value > 1 && (a.value -= 1, l("update:currentPage", a.value));
|
2860
2857
|
}, b = () => {
|
2861
|
-
|
2862
|
-
}, f = (
|
2863
|
-
|
2864
|
-
},
|
2865
|
-
|
2858
|
+
a.value < h.value && (a.value += 1, l("update:currentPage", a.value));
|
2859
|
+
}, f = (C) => {
|
2860
|
+
a.value = C, l("update:currentPage", C), l("pageChange", C);
|
2861
|
+
}, y = (C = n.value) => {
|
2862
|
+
n.value = C, m.value = !1, l("update:pageSize", n.value), l("update:currentPage", 1), l("pageSizeChange", n.value);
|
2866
2863
|
};
|
2867
|
-
return (
|
2868
|
-
o("div",
|
2864
|
+
return (C, c) => (p(), w("nav", xa, [
|
2865
|
+
o("div", wa, [
|
2869
2866
|
o("button", {
|
2870
2867
|
type: "button",
|
2871
2868
|
"aria-label": "Previous",
|
2872
|
-
onClick:
|
2873
|
-
disabled:
|
2869
|
+
onClick: k,
|
2870
|
+
disabled: a.value === 1,
|
2874
2871
|
class: "border-white last:rounded-e-lg text-base h-[38px] min-w-[38px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 border text-sm rounded-lg bg-white text-gray-800 hover:shadow-sm hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50 dark:bg-neutral-700 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-800 py-2"
|
2875
2872
|
}, c[1] || (c[1] = [
|
2876
2873
|
o("svg", {
|
@@ -2896,20 +2893,20 @@ const bo = { class: "flex items-center justify-between w-full gap-x-1" }, ho = {
|
|
2896
2893
|
"aria-hidden": "true",
|
2897
2894
|
class: "sr-only"
|
2898
2895
|
}, "Previous", -1)
|
2899
|
-
]), 8,
|
2900
|
-
o("div",
|
2901
|
-
(p(!0),
|
2896
|
+
]), 8, ka),
|
2897
|
+
o("div", _a, [
|
2898
|
+
(p(!0), w(F, null, q(g.value, (s) => (p(), w("button", {
|
2902
2899
|
type: "button",
|
2903
|
-
key:
|
2904
|
-
onClick: (t) => f(
|
2905
|
-
class:
|
2906
|
-
},
|
2900
|
+
key: s,
|
2901
|
+
onClick: (t) => f(s),
|
2902
|
+
class: j(a.value === s ? "flex justify-center items-center rounded-lg text-sm dark:text-neutral-300 py-2 px-3 focus:outline-none disabled:opacity-50 disabled:pointer-events-none bg-[#e5e7eb] dark:bg-[#242424] border border-gray-200 text-base h-[38px] min-w-[38px]" : "flex justify-center items-center rounded-lg text-sm dark:text-neutral-400 hover:bg-gray-100 py-2 px-3 focus:outline-none focus:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:hover:bg-neutral-800 dark:focus:bg-neutral-800 text-base h-[38px] min-w-[38px]")
|
2903
|
+
}, K(s), 11, Ca))), 128))
|
2907
2904
|
]),
|
2908
2905
|
o("button", {
|
2909
2906
|
type: "button",
|
2910
2907
|
"aria-label": "Next",
|
2911
2908
|
onClick: b,
|
2912
|
-
disabled:
|
2909
|
+
disabled: a.value === h.value,
|
2913
2910
|
class: "border-white last:rounded-e-lg text-base h-[38px] min-w-[38px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 border text-sm rounded-lg bg-white text-gray-800 hover:shadow-sm hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50 dark:bg-neutral-700 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-800 py-2"
|
2914
2911
|
}, c[2] || (c[2] = [
|
2915
2912
|
o("span", {
|
@@ -2935,29 +2932,29 @@ const bo = { class: "flex items-center justify-between w-full gap-x-1" }, ho = {
|
|
2935
2932
|
}),
|
2936
2933
|
o("path", { d: "M6 9l6 6l6 -6" })
|
2937
2934
|
], -1)
|
2938
|
-
]), 8,
|
2935
|
+
]), 8, Va)
|
2939
2936
|
]),
|
2940
|
-
o("div",
|
2941
|
-
o("div",
|
2942
|
-
|
2943
|
-
(p(),
|
2937
|
+
o("div", Sa, [
|
2938
|
+
o("div", Ma, [
|
2939
|
+
I(o("div", Ba, [
|
2940
|
+
(p(), w(F, null, q([10, 20, 30], (s) => o("button", {
|
2944
2941
|
type: "button",
|
2945
|
-
key:
|
2946
|
-
onClick: (t) =>
|
2942
|
+
key: s,
|
2943
|
+
onClick: (t) => y(s),
|
2947
2944
|
class: "w-full flex items-center gap-x-3.5 py-2 px-3 rounded-lg text-sm text-gray-800 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:hover:text-neutral-300 dark:focus:bg-neutral-700"
|
2948
2945
|
}, [
|
2949
|
-
|
2950
|
-
|
2946
|
+
W(K(s) + " ", 1),
|
2947
|
+
n.value === s ? (p(), w("svg", Aa, c[3] || (c[3] = [
|
2951
2948
|
o("path", {
|
2952
2949
|
stroke: "none",
|
2953
2950
|
d: "M0 0h24v24H0z",
|
2954
2951
|
fill: "none"
|
2955
2952
|
}, null, -1),
|
2956
2953
|
o("path", { d: "M5 12l5 5l10 -10" }, null, -1)
|
2957
|
-
]))) :
|
2958
|
-
], 8,
|
2954
|
+
]))) : S("", !0)
|
2955
|
+
], 8, $a)), 64))
|
2959
2956
|
], 512), [
|
2960
|
-
[
|
2957
|
+
[X, m.value]
|
2961
2958
|
]),
|
2962
2959
|
o("button", {
|
2963
2960
|
type: "button",
|
@@ -2965,9 +2962,9 @@ const bo = { class: "flex items-center justify-between w-full gap-x-1" }, ho = {
|
|
2965
2962
|
"aria-haspopup": "menu",
|
2966
2963
|
"aria-expanded": "false",
|
2967
2964
|
"aria-label": "Dropdown",
|
2968
|
-
onClick: c[0] || (c[0] = (
|
2965
|
+
onClick: c[0] || (c[0] = (s) => m.value = !m.value)
|
2969
2966
|
}, [
|
2970
|
-
|
2967
|
+
W(K(n.value) + " ", 1),
|
2971
2968
|
c[4] || (c[4] = o("svg", {
|
2972
2969
|
xmlns: "http://www.w3.org/2000/svg",
|
2973
2970
|
viewBox: "0 0 24 24",
|
@@ -2992,7 +2989,12 @@ const bo = { class: "flex items-center justify-between w-full gap-x-1" }, ho = {
|
|
2992
2989
|
])
|
2993
2990
|
]));
|
2994
2991
|
}
|
2995
|
-
}),
|
2992
|
+
}), ve = (i, r) => {
|
2993
|
+
const d = i.__vccOpts || i;
|
2994
|
+
for (const [l, a] of r)
|
2995
|
+
d[l] = a;
|
2996
|
+
return d;
|
2997
|
+
}, Da = {}, za = {
|
2996
2998
|
class: "w-48 mx-auto mb-4",
|
2997
2999
|
width: "178",
|
2998
3000
|
height: "90",
|
@@ -3000,12 +3002,12 @@ const bo = { class: "flex items-center justify-between w-full gap-x-1" }, ho = {
|
|
3000
3002
|
fill: "none",
|
3001
3003
|
xmlns: "http://www.w3.org/2000/svg"
|
3002
3004
|
};
|
3003
|
-
function
|
3004
|
-
return p(),
|
3005
|
-
|
3005
|
+
function ja(i, r) {
|
3006
|
+
return p(), w("svg", za, r[0] || (r[0] = [
|
3007
|
+
Pe('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-stone-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-stone-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-stone-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-stone-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-stone-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-stone-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-stone-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-stone-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter2)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-stone-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-stone-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-stone-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-stone-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter2" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>', 12)
|
3006
3008
|
]));
|
3007
3009
|
}
|
3008
|
-
const
|
3010
|
+
const Fa = /* @__PURE__ */ ve(Da, [["render", ja]]), Ka = {}, La = {
|
3009
3011
|
xmlns: "http://www.w3.org/2000/svg",
|
3010
3012
|
width: "21",
|
3011
3013
|
height: "20",
|
@@ -3017,8 +3019,8 @@ const jo = /* @__PURE__ */ X(Ao, [["render", Ro]]), zo = {}, Fo = {
|
|
3017
3019
|
"stroke-linejoin": "round",
|
3018
3020
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-layout-sidebar-right-collapse"
|
3019
3021
|
};
|
3020
|
-
function
|
3021
|
-
return p(),
|
3022
|
+
function Ua(i, r) {
|
3023
|
+
return p(), w("svg", La, r[0] || (r[0] = [
|
3022
3024
|
o("path", {
|
3023
3025
|
stroke: "none",
|
3024
3026
|
d: "M0 0h24v24H0z",
|
@@ -3029,7 +3031,7 @@ function Lo(s, a) {
|
|
3029
3031
|
o("path", { d: "M9 10l2 2l-2 2" }, null, -1)
|
3030
3032
|
]));
|
3031
3033
|
}
|
3032
|
-
const
|
3034
|
+
const Oa = /* @__PURE__ */ ve(Ka, [["render", Ua]]), Pa = {}, Ia = {
|
3033
3035
|
xmlns: "http://www.w3.org/2000/svg",
|
3034
3036
|
width: "21",
|
3035
3037
|
height: "20",
|
@@ -3041,8 +3043,8 @@ const Ko = /* @__PURE__ */ X(zo, [["render", Lo]]), Eo = {}, To = {
|
|
3041
3043
|
"stroke-linejoin": "round",
|
3042
3044
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-layout-sidebar-right-expand"
|
3043
3045
|
};
|
3044
|
-
function
|
3045
|
-
return p(),
|
3046
|
+
function Ta(i, r) {
|
3047
|
+
return p(), w("svg", Ia, r[0] || (r[0] = [
|
3046
3048
|
o("path", {
|
3047
3049
|
stroke: "none",
|
3048
3050
|
d: "M0 0h24v24H0z",
|
@@ -3053,7 +3055,7 @@ function Io(s, a) {
|
|
3053
3055
|
o("path", { d: "M10 10l-2 2l2 2" }, null, -1)
|
3054
3056
|
]));
|
3055
3057
|
}
|
3056
|
-
const
|
3058
|
+
const Ha = /* @__PURE__ */ ve(Pa, [["render", Ta]]), Ea = {}, Ya = {
|
3057
3059
|
xmlns: "http://www.w3.org/2000/svg",
|
3058
3060
|
width: "24",
|
3059
3061
|
height: "24",
|
@@ -3065,8 +3067,8 @@ const Oo = /* @__PURE__ */ X(Eo, [["render", Io]]), Uo = {}, Po = {
|
|
3065
3067
|
"stroke-linejoin": "round",
|
3066
3068
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-map"
|
3067
3069
|
};
|
3068
|
-
function
|
3069
|
-
return p(),
|
3070
|
+
function Wa(i, r) {
|
3071
|
+
return p(), w("svg", Ya, r[0] || (r[0] = [
|
3070
3072
|
o("path", {
|
3071
3073
|
stroke: "none",
|
3072
3074
|
d: "M0 0h24v24H0z",
|
@@ -3077,7 +3079,7 @@ function Ho(s, a) {
|
|
3077
3079
|
o("path", { d: "M15 7v13" }, null, -1)
|
3078
3080
|
]));
|
3079
3081
|
}
|
3080
|
-
const
|
3082
|
+
const qa = /* @__PURE__ */ ve(Ea, [["render", Wa]]), Na = {}, Ga = {
|
3081
3083
|
xmlns: "http://www.w3.org/2000/svg",
|
3082
3084
|
width: "24",
|
3083
3085
|
height: "24",
|
@@ -3089,8 +3091,8 @@ const No = /* @__PURE__ */ X(Uo, [["render", Ho]]), Yo = {}, Wo = {
|
|
3089
3091
|
"stroke-linejoin": "round",
|
3090
3092
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-table"
|
3091
3093
|
};
|
3092
|
-
function
|
3093
|
-
return p(),
|
3094
|
+
function Qa(i, r) {
|
3095
|
+
return p(), w("svg", Ga, r[0] || (r[0] = [
|
3094
3096
|
o("path", {
|
3095
3097
|
stroke: "none",
|
3096
3098
|
d: "M0 0h24v24H0z",
|
@@ -3101,27 +3103,27 @@ function qo(s, a) {
|
|
3101
3103
|
o("path", { d: "M10 3v18" }, null, -1)
|
3102
3104
|
]));
|
3103
3105
|
}
|
3104
|
-
const
|
3105
|
-
function
|
3106
|
+
const Za = /* @__PURE__ */ ve(Na, [["render", Qa]]);
|
3107
|
+
function Ja(i, r) {
|
3106
3108
|
let d;
|
3107
3109
|
return function(...l) {
|
3108
|
-
clearTimeout(d), d = setTimeout(() =>
|
3110
|
+
clearTimeout(d), d = setTimeout(() => i(...l), r);
|
3109
3111
|
};
|
3110
3112
|
}
|
3111
|
-
function
|
3112
|
-
|
3113
|
+
function Xa(i, r, d) {
|
3114
|
+
r && (r.addSource("vector", {
|
3113
3115
|
type: "vector",
|
3114
3116
|
tiles: [
|
3115
|
-
`http://${window.location.host}/api/vtile/${
|
3117
|
+
`http://${window.location.host}/api/vtile/${i}/ua/{z}/{x}/{y}.vmt?pointZoom=12`
|
3116
3118
|
],
|
3117
3119
|
minzoom: 0,
|
3118
3120
|
maxzoom: 12
|
3119
|
-
}),
|
3121
|
+
}), r.addLayer({
|
3120
3122
|
id: "vector-circle",
|
3121
3123
|
type: "circle",
|
3122
3124
|
maxzoom: 12,
|
3123
3125
|
source: "vector",
|
3124
|
-
"source-layer":
|
3126
|
+
"source-layer": i,
|
3125
3127
|
// must match the layer name in the vector tile source
|
3126
3128
|
paint: {
|
3127
3129
|
"circle-color": d,
|
@@ -3129,12 +3131,12 @@ function Zo(s, a, d) {
|
|
3129
3131
|
"circle-stroke-width": 1,
|
3130
3132
|
"circle-radius": ["interpolate", ["linear"], ["zoom"], 10, 5, 15, 12]
|
3131
3133
|
}
|
3132
|
-
}),
|
3134
|
+
}), r.addLayer({
|
3133
3135
|
id: "vector-fill",
|
3134
3136
|
type: "fill",
|
3135
3137
|
minzoom: 12,
|
3136
3138
|
source: "vector",
|
3137
|
-
"source-layer":
|
3139
|
+
"source-layer": i,
|
3138
3140
|
// must match the layer name in the vector tile source
|
3139
3141
|
paint: {
|
3140
3142
|
"fill-color": d,
|
@@ -3142,7 +3144,7 @@ function Zo(s, a, d) {
|
|
3142
3144
|
}
|
3143
3145
|
}));
|
3144
3146
|
}
|
3145
|
-
const
|
3147
|
+
const ge = [
|
3146
3148
|
{
|
3147
3149
|
name: "voyager",
|
3148
3150
|
label: "Базова карта (voyager)",
|
@@ -3167,10 +3169,10 @@ const ve = [
|
|
3167
3169
|
url: "https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
3168
3170
|
preview: "https://mt1.google.com/vt/lyrs=s&x=2422&y=1400&z=12"
|
3169
3171
|
}
|
3170
|
-
],
|
3172
|
+
], eo = { class: "relative w-auto h-full" }, to = { class: "absolute left-[20px] bottom-[74px] bg-white max-w-[250px] p-[10px] rounded-lg z-10 border" }, lo = { class: "flex justify-start items-center gap-2" }, ao = { class: "ml-1 text-[0.875rem]" }, oo = {
|
3171
3173
|
class: "vs-map-slot-layers z-10 select-none",
|
3172
3174
|
style: { display: "flex" }
|
3173
|
-
},
|
3175
|
+
}, ro = ["title", "onClick"], no = ["src"], io = { class: "absolute py-2 px-4 text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg top-[-46px] hidden whitespace-nowrap left-1/2 -translate-x-1/2" }, so = /* @__PURE__ */ Y({
|
3174
3176
|
__name: "map",
|
3175
3177
|
props: {
|
3176
3178
|
table: {},
|
@@ -3182,10 +3184,10 @@ const ve = [
|
|
3182
3184
|
map: {}
|
3183
3185
|
},
|
3184
3186
|
emits: ["update:modelValue", "update:map"],
|
3185
|
-
setup(
|
3186
|
-
const d =
|
3187
|
-
let
|
3188
|
-
const
|
3187
|
+
setup(i, { emit: r }) {
|
3188
|
+
const d = i, l = r;
|
3189
|
+
let a, n;
|
3190
|
+
const m = V(null), h = V(!1), g = V(ge[0].name), k = ge[0], b = V(null), f = V(null), y = [
|
3189
3191
|
"#2563EB",
|
3190
3192
|
// Primary Blue
|
3191
3193
|
"#60A5FA",
|
@@ -3207,25 +3209,25 @@ const ve = [
|
|
3207
3209
|
"#D1D5DB"
|
3208
3210
|
// Light Gray
|
3209
3211
|
];
|
3210
|
-
let
|
3212
|
+
let C;
|
3211
3213
|
const c = [30, 48];
|
3212
3214
|
return ue(async () => {
|
3213
|
-
|
3214
|
-
t.color || Object.assign(t, { color:
|
3215
|
-
}),
|
3215
|
+
C = (await fetch(`/api/data/${d.table}/${d.colorAttr}`).then((t) => t.json())).rows, C.forEach((t, x) => {
|
3216
|
+
t.color || Object.assign(t, { color: y[x % 10] });
|
3217
|
+
}), n = new maplibregl.Popup({
|
3216
3218
|
closeButton: !1,
|
3217
3219
|
closeOnClick: !1
|
3218
|
-
}),
|
3219
|
-
container:
|
3220
|
+
}), a = new maplibregl.Map({
|
3221
|
+
container: m.value,
|
3220
3222
|
style: {
|
3221
3223
|
version: 8,
|
3222
3224
|
sources: {
|
3223
|
-
[
|
3225
|
+
[k.name]: { type: "raster", tiles: [k.url], tileSize: 256 }
|
3224
3226
|
},
|
3225
3227
|
layers: [{
|
3226
|
-
id:
|
3228
|
+
id: k.name,
|
3227
3229
|
type: "raster",
|
3228
|
-
source:
|
3230
|
+
source: k.name,
|
3229
3231
|
minzoom: 0,
|
3230
3232
|
maxzoom: 19
|
3231
3233
|
}]
|
@@ -3236,61 +3238,63 @@ const ve = [
|
|
3236
3238
|
minZoom: 3,
|
3237
3239
|
maxZoom: 18,
|
3238
3240
|
attributionControl: !1
|
3239
|
-
}), l("update:map",
|
3240
|
-
|
3241
|
-
|
3242
|
-
|
3243
|
-
|
3244
|
-
|
3241
|
+
}), l("update:map", a), a.addControl(new maplibregl.NavigationControl(), "top-right"), a.on("zoom", () => {
|
3242
|
+
console.log("Zoom is changing:", a.getZoom());
|
3243
|
+
}), a.on("load", () => {
|
3244
|
+
a == null || a.resize(), h.value = !0;
|
3245
|
+
const t = C.filter((v) => v.id).reduce((v, u) => [u.id, u.color].concat(v), []), x = ["match", ["get", d.colorAttr], ...t, "#808080"];
|
3246
|
+
Xa(d.table, a, x);
|
3247
|
+
}), a.on("click", (t) => {
|
3248
|
+
const x = a.queryRenderedFeatures(t.point);
|
3245
3249
|
x.length && l("update:modelValue", x[0].properties.id);
|
3246
|
-
}),
|
3250
|
+
}), a.on("mousemove", (t) => {
|
3247
3251
|
var B;
|
3248
|
-
const x =
|
3252
|
+
const x = a.queryRenderedFeatures(t.point);
|
3249
3253
|
if (!x || !x.length) {
|
3250
|
-
|
3254
|
+
n.remove(), a.getCanvas().style.cursor = "";
|
3251
3255
|
return;
|
3252
3256
|
}
|
3253
|
-
|
3254
|
-
const
|
3255
|
-
f.value =
|
3257
|
+
a.getCanvas().style.cursor = "pointer";
|
3258
|
+
const v = x[0], { coordinates: u } = v.geometry, _ = v.geometry.type === "Point" ? u : u[0][0];
|
3259
|
+
f.value = v.properties, n.setLngLat(_).setHTML((B = b.value) == null ? void 0 : B.innerHTML).addTo(a);
|
3256
3260
|
});
|
3257
|
-
}), A(() => d.center, (
|
3258
|
-
|
3259
|
-
}), A(() => d.zoom, (
|
3260
|
-
|
3261
|
-
}), A(() => d.filter, (
|
3262
|
-
const t = `http://${window.location.host}/api/vtile/${d.table}/ua/{z}/{x}/{y}.vmt?pointZoom=12&filter=${
|
3263
|
-
|
3264
|
-
}), A(g, (
|
3265
|
-
const x =
|
3266
|
-
x && (
|
3261
|
+
}), A(() => d.center, (s) => {
|
3262
|
+
a && a.setCenter(s || c);
|
3263
|
+
}), A(() => d.zoom, (s) => {
|
3264
|
+
a && a.setZoom(s);
|
3265
|
+
}), A(() => d.filter, (s) => {
|
3266
|
+
const t = `http://${window.location.host}/api/vtile/${d.table}/ua/{z}/{x}/{y}.vmt?pointZoom=12&filter=${s}`;
|
3267
|
+
a.getSource("vector").setTiles([t]);
|
3268
|
+
}), A(g, (s, t) => {
|
3269
|
+
const x = ge.find((v) => v.name === s);
|
3270
|
+
x && (a.removeLayer(t), a.removeSource(t), a.addSource(s, { type: "raster", tiles: [x.url], tileSize: 256 }), a.addLayer({
|
3267
3271
|
id: x.name,
|
3268
3272
|
type: "raster",
|
3269
3273
|
source: x.name,
|
3270
3274
|
minzoom: 0,
|
3271
3275
|
maxzoom: 19
|
3272
3276
|
}, "vector-circle"));
|
3273
|
-
}),
|
3274
|
-
|
3275
|
-
}), (
|
3276
|
-
const x =
|
3277
|
-
return
|
3277
|
+
}), he(() => {
|
3278
|
+
a && a.remove();
|
3279
|
+
}), (s, t) => {
|
3280
|
+
const x = Ze("tooltip");
|
3281
|
+
return I((p(), w("div", eo, [
|
3278
3282
|
o("div", {
|
3279
3283
|
ref_key: "mapContainer",
|
3280
|
-
ref:
|
3284
|
+
ref: m,
|
3281
3285
|
class: "map-container w-auto relative"
|
3282
3286
|
}, null, 512),
|
3283
|
-
o("div",
|
3284
|
-
(p(!0),
|
3287
|
+
o("div", to, [
|
3288
|
+
(p(!0), w(F, null, q(e(C), (v) => (p(), w("div", {
|
3285
3289
|
class: "legend-item",
|
3286
|
-
key:
|
3290
|
+
key: v.id
|
3287
3291
|
}, [
|
3288
|
-
o("div",
|
3292
|
+
o("div", lo, [
|
3289
3293
|
o("div", {
|
3290
3294
|
class: "w-[15px] h-[15px] rounded-[50%] min-w-[15px]",
|
3291
|
-
style:
|
3295
|
+
style: _e("background-color:" + v.color)
|
3292
3296
|
}, null, 4),
|
3293
|
-
o("div",
|
3297
|
+
o("div", ao, K(v.text), 1)
|
3294
3298
|
])
|
3295
3299
|
]))), 128))
|
3296
3300
|
]),
|
@@ -3299,42 +3303,42 @@ const ve = [
|
|
3299
3303
|
ref: b,
|
3300
3304
|
style: { display: "none" }
|
3301
3305
|
}, [
|
3302
|
-
|
3306
|
+
ee(s.$slots, "default", { hoverData: f.value })
|
3303
3307
|
], 512),
|
3304
|
-
o("div",
|
3305
|
-
(p(!0),
|
3306
|
-
key:
|
3307
|
-
title:
|
3308
|
-
class:
|
3309
|
-
onClick: (
|
3308
|
+
o("div", oo, [
|
3309
|
+
(p(!0), w(F, null, q(e(ge), (v) => I((p(), w("div", {
|
3310
|
+
key: v.name,
|
3311
|
+
title: v.label || v.name,
|
3312
|
+
class: j(["vs-map-slot-layers__layer relative", { focused: g.value === v.name }]),
|
3313
|
+
onClick: (u) => g.value = v.name
|
3310
3314
|
}, [
|
3311
3315
|
o("img", {
|
3312
|
-
src:
|
3316
|
+
src: v.preview,
|
3313
3317
|
class: "vs-map-slot-layers__image"
|
3314
|
-
}, null, 8,
|
3315
|
-
o("div",
|
3316
|
-
], 10,
|
3317
|
-
[x,
|
3318
|
+
}, null, 8, no),
|
3319
|
+
o("div", io, K(v.label), 1)
|
3320
|
+
], 10, ro)), [
|
3321
|
+
[x, v.label || v.name]
|
3318
3322
|
])), 128))
|
3319
3323
|
])
|
3320
3324
|
], 512)), [
|
3321
|
-
[
|
3325
|
+
[X, h.value]
|
3322
3326
|
]);
|
3323
3327
|
};
|
3324
3328
|
}
|
3325
|
-
}),
|
3329
|
+
}), uo = { class: "pt-[20px]" }, co = { class: "w-full gap-5 inline-flex mb-[6px] pr-3" }, po = { class: "flex items-center" }, fo = ["title"], vo = { class: "max-[1000px]:flex gap-2 min-[1001px]:hidden" }, mo = { class: "flex" }, go = {
|
3326
3330
|
key: 0,
|
3327
3331
|
class: "py-[15px] pb-[24px] pl-2"
|
3328
|
-
},
|
3332
|
+
}, ho = { class: "font-bold text-2xl mr-[10px]" }, bo = { class: "text-sm text-stone-500 font-medium" }, yo = {
|
3329
3333
|
class: "wrapperTable flex flex-col",
|
3330
3334
|
style: { height: "calc(100vh - 302px)" }
|
3331
|
-
},
|
3335
|
+
}, xo = {
|
3332
3336
|
key: 1,
|
3333
3337
|
class: "text-center py-28"
|
3334
|
-
},
|
3338
|
+
}, wo = { key: 1 }, ko = {
|
3335
3339
|
key: 2,
|
3336
3340
|
class: "my-5 pr-2"
|
3337
|
-
},
|
3341
|
+
}, _o = { class: "flex justify-between" }, Co = { class: "w-full lg:w-1/2 relative" }, Le = /* @__PURE__ */ Y({
|
3338
3342
|
__name: "vs-parts-map",
|
3339
3343
|
props: {
|
3340
3344
|
title: {},
|
@@ -3350,89 +3354,89 @@ const ve = [
|
|
3350
3354
|
history: { type: Boolean }
|
3351
3355
|
},
|
3352
3356
|
emits: ["change:filter", "update:map"],
|
3353
|
-
setup(
|
3354
|
-
var G,
|
3355
|
-
function d(
|
3356
|
-
return (
|
3357
|
+
setup(i, { emit: r }) {
|
3358
|
+
var G, ie, ae, Ae, Re, De;
|
3359
|
+
function d(R) {
|
3360
|
+
return (R.type === "Point" ? R.coordinates : null) || (R.type.includes("Multi") ? R.coordinates[0][0][0] : R.coordinates[0][0]);
|
3357
3361
|
}
|
3358
|
-
const l =
|
3359
|
-
|
3360
|
-
const
|
3361
|
-
function B(
|
3362
|
-
return Object.entries(
|
3362
|
+
const l = i, a = r, n = V(0);
|
3363
|
+
n.value = l.initTotal ?? ((G = l.rows) == null ? void 0 : G.length) ?? 0;
|
3364
|
+
const m = V(""), h = V(null), g = V(!0), k = V(((ie = l.rows) == null ? void 0 : ie.length) === 1), b = V(0), f = V(l.rows), y = V(1), C = V(20), c = V(l.filters || []), s = V(""), t = V({}), x = V(((ae = l.rows) == null ? void 0 : ae.length) === 1 ? l.rows[0] : {}), v = V(((Ae = l.rows) == null ? void 0 : Ae.length) === 1 ? l.rows[0].id : ""), u = V(((Re = l.rows) == null ? void 0 : Re.length) === 1 ? d(l.rows[0].geom) : l.center || null), _ = V(((De = l.rows) == null ? void 0 : De.length) === 1 ? 14 : l.zoom || 5);
|
3365
|
+
function B(R) {
|
3366
|
+
return Object.entries(R).filter(([, D]) => D).map(([D, ce]) => `${D}=${ce}`).join("|");
|
3363
3367
|
}
|
3364
|
-
async function
|
3365
|
-
const
|
3366
|
-
|
3368
|
+
async function M() {
|
3369
|
+
const R = B(t.value);
|
3370
|
+
s.value = R;
|
3367
3371
|
try {
|
3368
|
-
const
|
3369
|
-
search:
|
3370
|
-
limit:
|
3371
|
-
page:
|
3372
|
-
filter:
|
3373
|
-
}, ce = new URL(`/api/data/${l.table}`, window.location.origin) + (
|
3374
|
-
if (
|
3372
|
+
const D = {
|
3373
|
+
search: m.value,
|
3374
|
+
limit: C.value.toString(),
|
3375
|
+
page: y.value.toString(),
|
3376
|
+
filter: R
|
3377
|
+
}, ce = new URL(`/api/data/${l.table}`, window.location.origin) + (v.value ? `/${v.value}` : ""), Q = new URLSearchParams(D).toString(), pe = await fetch(`${ce.toString()}?${Q}`).then((me) => me.json());
|
3378
|
+
if (v.value) {
|
3375
3379
|
const [me] = pe.rows;
|
3376
|
-
x.value = me,
|
3380
|
+
x.value = me, u.value = d(me.geom), _.value = 14, k.value = !0;
|
3377
3381
|
} else
|
3378
|
-
|
3379
|
-
|
3380
|
-
} catch (
|
3381
|
-
console.error(
|
3382
|
+
k.value = !1, _.value = l.zoom || 5, f.value = pe == null ? void 0 : pe.rows;
|
3383
|
+
n.value = pe.filtered, ya({ page: y.value, filter: R, id: v.value });
|
3384
|
+
} catch (D) {
|
3385
|
+
console.error(D.message);
|
3382
3386
|
}
|
3383
3387
|
}
|
3384
|
-
const
|
3385
|
-
function
|
3386
|
-
|
3388
|
+
const L = Ja(M, 300);
|
3389
|
+
function T(R) {
|
3390
|
+
C.value = R, y.value = 1, M();
|
3387
3391
|
}
|
3388
|
-
function
|
3389
|
-
|
3392
|
+
function U(R) {
|
3393
|
+
y.value = R, M();
|
3390
3394
|
}
|
3391
|
-
function de(
|
3392
|
-
t.value =
|
3395
|
+
function de(R) {
|
3396
|
+
t.value = R.data, y.value = 1, v.value ? v.value = "" : M(), a("change:filter", R);
|
3393
3397
|
}
|
3394
3398
|
async function J() {
|
3395
3399
|
if (l.filters) return;
|
3396
|
-
const
|
3397
|
-
c.value =
|
3400
|
+
const D = await (await fetch(`/api/filter/${l.table}`)).json();
|
3401
|
+
c.value = D.list;
|
3398
3402
|
}
|
3399
|
-
function
|
3400
|
-
t.value = {},
|
3403
|
+
function H() {
|
3404
|
+
t.value = {}, m.value = "", M();
|
3401
3405
|
}
|
3402
3406
|
ue(async () => {
|
3403
3407
|
b.value = window.innerWidth, b.value < 1e3 && (g.value = !1);
|
3404
|
-
const
|
3405
|
-
|
3408
|
+
const R = new URLSearchParams(window.location.search);
|
3409
|
+
y.value = Number(R.get("page")) || 1, C.value = Number(R.get("limit")) || C.value, v.value = R.get("id") || "", k.value = !!v.value, J(), !f.value && !v.value && M();
|
3406
3410
|
});
|
3407
|
-
function
|
3408
|
-
|
3411
|
+
function $() {
|
3412
|
+
k.value = !1, x.value = null, v.value = "", M();
|
3409
3413
|
}
|
3410
|
-
function
|
3411
|
-
|
3414
|
+
function O(R) {
|
3415
|
+
v.value = R.id;
|
3412
3416
|
}
|
3413
|
-
return A(
|
3414
|
-
|
3415
|
-
}), A(
|
3416
|
-
|
3417
|
-
}), A(
|
3418
|
-
|
3419
|
-
}), (
|
3417
|
+
return A(h, (R) => {
|
3418
|
+
a("update:map", R);
|
3419
|
+
}), A(m, (R) => {
|
3420
|
+
R || M();
|
3421
|
+
}), A(v, () => {
|
3422
|
+
M();
|
3423
|
+
}), (R, D) => {
|
3420
3424
|
var ce;
|
3421
|
-
return p(),
|
3422
|
-
|
3425
|
+
return p(), w("section", uo, [
|
3426
|
+
ee(R.$slots, "header", {
|
3423
3427
|
title: l.title,
|
3424
|
-
total:
|
3428
|
+
total: n.value
|
3425
3429
|
}),
|
3426
|
-
o("div",
|
3427
|
-
|
3430
|
+
o("div", co, [
|
3431
|
+
P(e(ne), {
|
3428
3432
|
type: "text",
|
3429
|
-
modelValue:
|
3430
|
-
"onUpdate:modelValue":
|
3433
|
+
modelValue: m.value,
|
3434
|
+
"onUpdate:modelValue": D[0] || (D[0] = (Q) => m.value = Q),
|
3431
3435
|
name: "search",
|
3432
3436
|
label: "Пошук",
|
3433
|
-
onChange: e(
|
3437
|
+
onChange: e(L)
|
3434
3438
|
}, null, 8, ["modelValue", "onChange"]),
|
3435
|
-
c.value.length ? (p(),
|
3439
|
+
c.value.length ? (p(), z(e(xe), {
|
3436
3440
|
key: 0,
|
3437
3441
|
schema: c.value,
|
3438
3442
|
view: "inline",
|
@@ -3440,123 +3444,123 @@ const ve = [
|
|
3440
3444
|
limit: 5,
|
3441
3445
|
value: t.value,
|
3442
3446
|
ref: "filterRef"
|
3443
|
-
}, null, 8, ["schema", "value"])) :
|
3444
|
-
o("div",
|
3447
|
+
}, null, 8, ["schema", "value"])) : S("", !0),
|
3448
|
+
o("div", po, [
|
3445
3449
|
o("button", {
|
3446
3450
|
type: "button",
|
3447
3451
|
class: "map-visible-button py-2 px-2 hidden min-[1001px]:inline-flex items-center gap-x-1.5 text-sm rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100",
|
3448
3452
|
title: g.value ? "Приховати карту" : "Показати карту",
|
3449
|
-
onClick:
|
3453
|
+
onClick: D[1] || (D[1] = (Q) => g.value = !g.value)
|
3450
3454
|
}, [
|
3451
|
-
g.value ? (p(),
|
3452
|
-
|
3453
|
-
], 8,
|
3454
|
-
o("div",
|
3455
|
+
g.value ? (p(), z(Oa, { key: 0 })) : (p(), z(Ha, { key: 1 })),
|
3456
|
+
D[8] || (D[8] = o("span", { class: "sr-only" }, "Відкрити мапу", -1))
|
3457
|
+
], 8, fo),
|
3458
|
+
o("div", vo, [
|
3455
3459
|
o("button", {
|
3456
|
-
onClick:
|
3460
|
+
onClick: D[2] || (D[2] = (Q) => g.value = !1),
|
3457
3461
|
class: "py-2 px-2 h-[38px] inline-flex items-center gap-x-1.5 text-sm rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100"
|
3458
3462
|
}, [
|
3459
|
-
|
3463
|
+
P(Za)
|
3460
3464
|
]),
|
3461
3465
|
o("button", {
|
3462
|
-
onClick:
|
3466
|
+
onClick: D[3] || (D[3] = (Q) => g.value = !0),
|
3463
3467
|
class: "py-2 px-2 h-[38px] inline-flex items-center gap-x-1.5 text-sm rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100"
|
3464
3468
|
}, [
|
3465
|
-
|
3469
|
+
P(qa)
|
3466
3470
|
])
|
3467
3471
|
])
|
3468
3472
|
])
|
3469
3473
|
]),
|
3470
|
-
o("div",
|
3474
|
+
o("div", mo, [
|
3471
3475
|
o("div", {
|
3472
|
-
class:
|
3476
|
+
class: j([
|
3473
3477
|
"relative overflow-hidden shrink-0",
|
3474
3478
|
g.value ? "w-2/4 mr-0" : "w-full mr-3",
|
3475
|
-
|
3479
|
+
k.value ? "hidden" : ""
|
3476
3480
|
])
|
3477
3481
|
}, [
|
3478
|
-
(ce =
|
3479
|
-
o("span",
|
3480
|
-
o("span",
|
3481
|
-
|
3482
|
+
(ce = R.$slots) != null && ce.header ? S("", !0) : (p(), w("h1", go, [
|
3483
|
+
o("span", ho, K(l.title), 1),
|
3484
|
+
o("span", bo, K(n.value), 1),
|
3485
|
+
D[9] || (D[9] = o("span", { class: "text-sm text-stone-500 font-medium" }, " об'єктів", -1))
|
3482
3486
|
])),
|
3483
|
-
o("div",
|
3484
|
-
|
3487
|
+
o("div", yo, [
|
3488
|
+
n.value >= 1 ? ee(R.$slots, "table", {
|
3485
3489
|
key: 0,
|
3486
3490
|
rows: f.value,
|
3487
|
-
selectRow:
|
3488
|
-
}) : (p(),
|
3489
|
-
|
3490
|
-
|
3491
|
-
|
3491
|
+
selectRow: O
|
3492
|
+
}) : (p(), w("div", xo, [
|
3493
|
+
P(Fa),
|
3494
|
+
D[10] || (D[10] = o("h2", { class: "font-medium text-base text-gray-500 rounded-xl" }, " За вашим запитом даних не знайдено! ", -1)),
|
3495
|
+
D[11] || (D[11] = o("p", { class: "font-normal text-sm text-gray-500 rounded-xl" }, " Введіть, будь ласка, інші значення для пошуку. ", -1)),
|
3492
3496
|
o("button", {
|
3493
3497
|
type: "button",
|
3494
3498
|
class: "mt-[10px] py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs rounded-lg border border-stone-200 bg-white text-stone-800 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100",
|
3495
|
-
onClick:
|
3499
|
+
onClick: H
|
3496
3500
|
}, " Очистити дані пошуку ")
|
3497
3501
|
]))
|
3498
3502
|
]),
|
3499
|
-
|
3500
|
-
|
3501
|
-
o("div",
|
3502
|
-
|
3503
|
-
total:
|
3504
|
-
currentPage:
|
3505
|
-
pageSize:
|
3506
|
-
onPageChange:
|
3507
|
-
onPageSizeChange:
|
3503
|
+
n.value >= 1 ? (p(), w("hr", wo)) : S("", !0),
|
3504
|
+
n.value >= 1 ? (p(), w("div", ko, [
|
3505
|
+
o("div", _o, [
|
3506
|
+
P(Ra, {
|
3507
|
+
total: n.value,
|
3508
|
+
currentPage: y.value ?? 1,
|
3509
|
+
pageSize: C.value,
|
3510
|
+
onPageChange: D[4] || (D[4] = (Q) => U(Q)),
|
3511
|
+
onPageSizeChange: D[5] || (D[5] = (Q) => T(Q))
|
3508
3512
|
}, null, 8, ["total", "currentPage", "pageSize"])
|
3509
3513
|
])
|
3510
|
-
])) :
|
3514
|
+
])) : S("", !0)
|
3511
3515
|
], 2),
|
3512
|
-
|
3516
|
+
k.value ? (p(), w("div", {
|
3513
3517
|
key: 0,
|
3514
|
-
class:
|
3518
|
+
class: j(
|
3515
3519
|
g.value ? "lg:static lg:w-1/2 mr-0 pb-5" : "pb-5 mr-3"
|
3516
3520
|
),
|
3517
3521
|
style: { height: "calc(100vh - 152px)" }
|
3518
3522
|
}, [
|
3519
|
-
|
3523
|
+
ee(R.$slots, "details", {
|
3520
3524
|
table: l.table,
|
3521
3525
|
selectedRow: x.value,
|
3522
|
-
closeObjCard:
|
3526
|
+
closeObjCard: $
|
3523
3527
|
})
|
3524
|
-
], 2)) :
|
3525
|
-
|
3526
|
-
|
3528
|
+
], 2)) : S("", !0),
|
3529
|
+
I(o("div", Co, [
|
3530
|
+
P(so, {
|
3527
3531
|
table: l.table,
|
3528
|
-
map:
|
3529
|
-
"onUpdate:map":
|
3530
|
-
zoom:
|
3532
|
+
map: h.value,
|
3533
|
+
"onUpdate:map": D[6] || (D[6] = (Q) => h.value = Q),
|
3534
|
+
zoom: _.value,
|
3531
3535
|
colorAttr: l.colorAttr,
|
3532
|
-
filter:
|
3533
|
-
center:
|
3534
|
-
modelValue:
|
3535
|
-
"onUpdate:modelValue":
|
3536
|
+
filter: s.value,
|
3537
|
+
center: u.value,
|
3538
|
+
modelValue: v.value,
|
3539
|
+
"onUpdate:modelValue": D[7] || (D[7] = (Q) => v.value = Q)
|
3536
3540
|
}, {
|
3537
|
-
default:
|
3538
|
-
|
3541
|
+
default: re(({ hoverData: Q }) => [
|
3542
|
+
ee(R.$slots, "popup", { data: Q })
|
3539
3543
|
]),
|
3540
3544
|
_: 3
|
3541
3545
|
}, 8, ["table", "map", "zoom", "colorAttr", "filter", "center", "modelValue"]),
|
3542
|
-
|
3546
|
+
ee(R.$slots, "default", {
|
3543
3547
|
table: l.table,
|
3544
|
-
map:
|
3548
|
+
map: h.value,
|
3545
3549
|
selectedRow: x.value
|
3546
3550
|
})
|
3547
3551
|
], 512), [
|
3548
|
-
[
|
3552
|
+
[X, g.value]
|
3549
3553
|
])
|
3550
3554
|
])
|
3551
3555
|
]);
|
3552
3556
|
};
|
3553
3557
|
}
|
3554
|
-
}),
|
3555
|
-
mounted(
|
3558
|
+
}), Vo = {
|
3559
|
+
mounted(i, r) {
|
3556
3560
|
if (typeof document > "u") return;
|
3557
3561
|
let d = null;
|
3558
3562
|
const l = () => {
|
3559
|
-
d = document.createElement("div"), d.textContent =
|
3563
|
+
d = document.createElement("div"), d.textContent = r.value, Object.assign(d.style, {
|
3560
3564
|
position: "absolute",
|
3561
3565
|
background: "#333",
|
3562
3566
|
color: "#fff",
|
@@ -3567,23 +3571,22 @@ const ve = [
|
|
3567
3571
|
pointerEvents: "none",
|
3568
3572
|
zIndex: "9999"
|
3569
3573
|
}), document.body.appendChild(d);
|
3570
|
-
const
|
3571
|
-
d.style.left = `${
|
3572
|
-
},
|
3574
|
+
const n = i.getBoundingClientRect();
|
3575
|
+
d.style.left = `${n.left + window.scrollX}px`, d.style.top = `${n.top + window.scrollY - d.offsetHeight - 5}px`;
|
3576
|
+
}, a = () => {
|
3573
3577
|
d && d.parentNode && (d.parentNode.removeChild(d), d = null);
|
3574
3578
|
};
|
3575
|
-
|
3579
|
+
i.addEventListener("mouseenter", l), i.addEventListener("mouseleave", a), Object.assign(i, { tooltipHandlers: { showTooltip: l, hideTooltip: a } });
|
3576
3580
|
},
|
3577
|
-
unmounted(
|
3581
|
+
unmounted(i) {
|
3578
3582
|
if (typeof document > "u") return;
|
3579
|
-
const
|
3580
|
-
|
3581
|
-
}
|
3582
|
-
}, Vn = {
|
3583
|
-
install: (s) => {
|
3584
|
-
s.component("VsPartsMap", Cn), s._context.directives.tooltip || s.directive("tooltip", _n);
|
3583
|
+
const r = i.tooltipHandlers;
|
3584
|
+
r && (i.removeEventListener("mouseenter", r.showTooltip), i.removeEventListener("mouseleave", r.hideTooltip));
|
3585
3585
|
}
|
3586
3586
|
};
|
3587
|
+
Le.install = (i) => {
|
3588
|
+
i.component("VsPartsMap", Le), i._context.directives.tooltip || i.directive("tooltip", Vo);
|
3589
|
+
};
|
3587
3590
|
export {
|
3588
|
-
|
3591
|
+
Le as default
|
3589
3592
|
};
|