@opengis/filter 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/filter.js +1093 -1093
- package/dist/filter.umd.cjs +1 -1
- package/package.json +8 -3
package/dist/filter.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as O, ref as _, createElementBlock as w, openBlock as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as O, ref as _, createElementBlock as w, openBlock as f, createElementVNode as u, withModifiers as _e, normalizeClass as D, createCommentVNode as V, toDisplayString as F, computed as I, watch as M, createStaticVNode as Le, Fragment as R, renderList as W, unref as e, createBlock as S, createVNode as N, createTextVNode as z, withDirectives as T, vShow as X, vModelText as G, onMounted as ne, onBeforeUnmount as ce, Teleport as $e, normalizeStyle as Ae, renderSlot as ue, nextTick as fe, isRef as Ee, withCtx as le, resolveDynamicComponent as ee, mergeProps as P, toRaw as Z, cloneVNode as Ie, useSlots as pe } from "vue";
|
|
2
|
+
const Te = { class: "flex items-center justify-between w-full text-sm" }, Oe = { class: "flex items-center cursor-pointer w-full" }, Ue = {
|
|
3
3
|
key: 0,
|
|
4
4
|
width: "16",
|
|
5
5
|
height: "auto",
|
|
6
6
|
src: "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTYgMTYnIGZpbGw9J3doaXRlJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMi4yMDcgNC43OTNhMSAxIDAgMDEwIDEuNDE0bC01IDVhMSAxIDAgMDEtMS40MTQgMGwtMi0yYTEgMSAwIDAxMS40MTQtMS40MTRMNi41IDkuMDg2bDQuMjkzLTQuMjkzYTEgMSAwIDAxMS40MTQgMHonLz48L3N2Zz4="
|
|
7
|
-
},
|
|
7
|
+
}, ze = ["value"], Ne = { class: "w-[calc(100%-18px)] flex flex-row items-center justify-between pl-[10px]" }, He = { class: "flex flex-row items-center font-normal text-gray-800 gap-x-1" }, Ye = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "text-xs text-gray-500 dark:text-neutral-500 pr-1"
|
|
10
10
|
}, me = /* @__PURE__ */ O({
|
|
@@ -20,44 +20,44 @@ const Ie = { class: "flex items-center justify-between w-full text-sm" }, Te = {
|
|
|
20
20
|
highlighted: { type: Boolean }
|
|
21
21
|
},
|
|
22
22
|
emits: ["itemClick"],
|
|
23
|
-
setup(
|
|
24
|
-
const t =
|
|
23
|
+
setup(i, { expose: n, emit: v }) {
|
|
24
|
+
const t = i, s = v;
|
|
25
25
|
function r() {
|
|
26
26
|
s("itemClick", t.value);
|
|
27
27
|
}
|
|
28
|
-
const
|
|
29
|
-
return
|
|
28
|
+
const d = _(null);
|
|
29
|
+
return n({ el: d }), (m, c) => (f(), 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: d
|
|
33
33
|
}, [
|
|
34
|
-
u("div",
|
|
35
|
-
u("div",
|
|
34
|
+
u("div", Te, [
|
|
35
|
+
u("div", Oe, [
|
|
36
36
|
u("label", {
|
|
37
37
|
for: "radio-9740",
|
|
38
38
|
class: D([
|
|
39
39
|
["inline", "popover"].includes(m.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
40
|
{ "bg-blue-100": m.highlighted }
|
|
41
41
|
]),
|
|
42
|
-
onClick:
|
|
42
|
+
onClick: _e(r, ["stop", "prevent"])
|
|
43
43
|
}, [
|
|
44
44
|
u("div", {
|
|
45
|
-
class: D(["w-[18px] h-[18px] border
|
|
46
|
-
m.type
|
|
45
|
+
class: D(["w-[18px] h-[18px] border flex items-center justify-center", [
|
|
46
|
+
m.type == "checkbox" ? "rounded-[4px]" : "rounded-full",
|
|
47
47
|
m.color ? `bg-[${m.color}] border-[#ffffff]` : m.isSelected ? "bg-[#2563eb] border-[#ffffff]" : "bg-[#ffffff] border-[#d9d9d9]"
|
|
48
48
|
]])
|
|
49
49
|
}, [
|
|
50
|
-
m.isSelected ? (
|
|
50
|
+
m.isSelected ? (f(), w("img", Ue)) : V("", !0)
|
|
51
51
|
], 2),
|
|
52
52
|
u("input", {
|
|
53
53
|
type: "checkbox",
|
|
54
54
|
class: "hidden",
|
|
55
55
|
id: "radio-9740",
|
|
56
56
|
value: m.value
|
|
57
|
-
}, null, 8,
|
|
58
|
-
u("div",
|
|
59
|
-
u("span",
|
|
60
|
-
m.count ? (
|
|
57
|
+
}, null, 8, ze),
|
|
58
|
+
u("div", Ne, [
|
|
59
|
+
u("span", He, F(m.label ?? "Відсутні данні"), 1),
|
|
60
|
+
m.count ? (f(), w("div", Ye, " (" + F(m.count) + ") ", 1)) : V("", !0)
|
|
61
61
|
])
|
|
62
62
|
], 2)
|
|
63
63
|
])
|
|
@@ -65,75 +65,75 @@ const Ie = { class: "flex items-center justify-between w-full text-sm" }, Te = {
|
|
|
65
65
|
], 512));
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
|
-
function
|
|
68
|
+
function Be(i, n) {
|
|
69
69
|
const {
|
|
70
70
|
options: v = [],
|
|
71
71
|
limit: t = 20
|
|
72
|
-
} =
|
|
73
|
-
function s(
|
|
74
|
-
return
|
|
72
|
+
} = i;
|
|
73
|
+
function s(l) {
|
|
74
|
+
return Array.isArray(l) ? l[0] : l;
|
|
75
75
|
}
|
|
76
|
-
const r = _(s(
|
|
77
|
-
function
|
|
78
|
-
const
|
|
76
|
+
const r = _(s(i.modelValue)), d = _(""), m = _(!1), c = _([]), x = _("id"), p = _("text"), a = _(!1), o = _(i.layout !== "popover" && v.length > t);
|
|
77
|
+
function h(l) {
|
|
78
|
+
const b = l.find(Boolean) ?? {}, K = ["id", "value", "code", "key"].find((Y) => Y in b) ?? "id", A = ["text", "label", "name", "title"].find((Y) => Y in b) ?? "text";
|
|
79
79
|
return { autoValueKey: K, autoLabelKey: A };
|
|
80
80
|
}
|
|
81
81
|
if (v.length > 0) {
|
|
82
|
-
const
|
|
83
|
-
|
|
82
|
+
const l = h(v);
|
|
83
|
+
x.value = l.autoValueKey, p.value = l.autoLabelKey;
|
|
84
84
|
}
|
|
85
|
-
const
|
|
86
|
-
const
|
|
87
|
-
return
|
|
85
|
+
const g = I(() => {
|
|
86
|
+
const l = c.value;
|
|
87
|
+
return i.layout === "popover" || a.value ? l : l.slice(0, t);
|
|
88
88
|
});
|
|
89
|
-
M(() =>
|
|
90
|
-
r.value = s(
|
|
91
|
-
}, { immediate: !0 }),
|
|
92
|
-
function k(
|
|
93
|
-
return r.value ===
|
|
89
|
+
M(() => i.modelValue, (l) => {
|
|
90
|
+
r.value = s(l);
|
|
91
|
+
}, { immediate: !0 }), c.value = [...v].sort((l, b) => i.sort === "count" ? b.count && l.count ? b.count - l.count : 0 : i.sort === "name" ? String(l[p.value] ?? "").localeCompare(String(b[p.value] ?? "")) : 0);
|
|
92
|
+
function k(l) {
|
|
93
|
+
return r.value === l[x.value];
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
r.value =
|
|
95
|
+
function y(l) {
|
|
96
|
+
r.value = l[x.value], n("update:modelValue", r.value), n("change", { name: i.name, value: r.value });
|
|
97
97
|
}
|
|
98
98
|
function $() {
|
|
99
|
-
r.value = void 0,
|
|
99
|
+
r.value = void 0, n("update:modelValue", r.value), n("clear", i.name);
|
|
100
100
|
}
|
|
101
101
|
function C() {
|
|
102
|
-
|
|
102
|
+
a.value = !a.value;
|
|
103
103
|
}
|
|
104
104
|
return {
|
|
105
105
|
innerValue: r,
|
|
106
|
-
searchTerm:
|
|
107
|
-
filteredOptions:
|
|
106
|
+
searchTerm: d,
|
|
107
|
+
filteredOptions: g,
|
|
108
108
|
isSelected: k,
|
|
109
|
-
selectItem:
|
|
109
|
+
selectItem: y,
|
|
110
110
|
clear: $,
|
|
111
111
|
toggleShowAll: C,
|
|
112
112
|
isReqProc: m,
|
|
113
|
-
showAll:
|
|
114
|
-
isEnableShowAll:
|
|
115
|
-
labelKey:
|
|
116
|
-
valueKey:
|
|
117
|
-
allOptions:
|
|
113
|
+
showAll: a,
|
|
114
|
+
isEnableShowAll: o,
|
|
115
|
+
labelKey: p,
|
|
116
|
+
valueKey: x,
|
|
117
|
+
allOptions: c
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
const J = (
|
|
121
|
-
const v =
|
|
122
|
-
for (const [t, s] of
|
|
120
|
+
const J = (i, n) => {
|
|
121
|
+
const v = i.__vccOpts || i;
|
|
122
|
+
for (const [t, s] of n)
|
|
123
123
|
v[t] = s;
|
|
124
124
|
return v;
|
|
125
|
-
},
|
|
125
|
+
}, Pe = {}, We = {
|
|
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
|
|
133
|
-
|
|
131
|
+
function qe(i, n) {
|
|
132
|
+
return f(), w("svg", We, n[0] || (n[0] = [
|
|
133
|
+
Le('<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 ve = /* @__PURE__ */ J(
|
|
136
|
+
const ve = /* @__PURE__ */ J(Pe, [["render", qe]]), Qe = {}, Ge = {
|
|
137
137
|
xmlns: "http://www.w3.org/2000/svg",
|
|
138
138
|
width: "24",
|
|
139
139
|
height: "24",
|
|
@@ -145,8 +145,8 @@ const ve = /* @__PURE__ */ J(Ye, [["render", We]]), qe = {}, Qe = {
|
|
|
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
|
|
148
|
+
function Xe(i, n) {
|
|
149
|
+
return f(), w("svg", Ge, n[0] || (n[0] = [
|
|
150
150
|
u("path", {
|
|
151
151
|
stroke: "none",
|
|
152
152
|
d: "M0 0h24v24H0z",
|
|
@@ -155,7 +155,7 @@ function Ge(p, a) {
|
|
|
155
155
|
u("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
156
156
|
]));
|
|
157
157
|
}
|
|
158
|
-
const ie = /* @__PURE__ */ J(
|
|
158
|
+
const ie = /* @__PURE__ */ J(Qe, [["render", Xe]]), Je = {}, Ze = {
|
|
159
159
|
xmlns: "http://www.w3.org/2000/svg",
|
|
160
160
|
width: "24",
|
|
161
161
|
height: "24",
|
|
@@ -167,8 +167,8 @@ const ie = /* @__PURE__ */ J(qe, [["render", Ge]]), Xe = {}, Je = {
|
|
|
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
|
|
170
|
+
function et(i, n) {
|
|
171
|
+
return f(), w("svg", Ze, n[0] || (n[0] = [
|
|
172
172
|
u("path", {
|
|
173
173
|
stroke: "none",
|
|
174
174
|
d: "M0 0h24v24H0z",
|
|
@@ -177,13 +177,13 @@ function Ze(p, a) {
|
|
|
177
177
|
u("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
178
178
|
]));
|
|
179
179
|
}
|
|
180
|
-
const
|
|
180
|
+
const ye = /* @__PURE__ */ J(Je, [["render", et]]), tt = {
|
|
181
181
|
key: 0,
|
|
182
182
|
class: "w-full"
|
|
183
|
-
},
|
|
183
|
+
}, lt = { class: "flex flex-col items-center justify-center p-5 text-center" }, ot = {
|
|
184
184
|
key: 0,
|
|
185
185
|
class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
|
|
186
|
-
},
|
|
186
|
+
}, at = {
|
|
187
187
|
key: 1,
|
|
188
188
|
class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
|
|
189
189
|
}, nt = /* @__PURE__ */ O({
|
|
@@ -212,33 +212,33 @@ const ge = /* @__PURE__ */ J(Xe, [["render", Ze]]), et = {
|
|
|
212
212
|
sort: {}
|
|
213
213
|
},
|
|
214
214
|
emits: ["update:modelValue", "change", "clear"],
|
|
215
|
-
setup(
|
|
216
|
-
const t =
|
|
217
|
-
innerValue:
|
|
215
|
+
setup(i, { expose: n, emit: v }) {
|
|
216
|
+
const t = i, s = _(null), r = v, {
|
|
217
|
+
innerValue: d,
|
|
218
218
|
filteredOptions: m,
|
|
219
|
-
isSelected:
|
|
220
|
-
selectItem:
|
|
221
|
-
clear:
|
|
222
|
-
toggleShowAll:
|
|
223
|
-
isReqProc:
|
|
224
|
-
showAll:
|
|
225
|
-
isEnableShowAll:
|
|
219
|
+
isSelected: c,
|
|
220
|
+
selectItem: x,
|
|
221
|
+
clear: p,
|
|
222
|
+
toggleShowAll: a,
|
|
223
|
+
isReqProc: o,
|
|
224
|
+
showAll: h,
|
|
225
|
+
isEnableShowAll: g,
|
|
226
226
|
labelKey: k,
|
|
227
|
-
valueKey:
|
|
227
|
+
valueKey: y,
|
|
228
228
|
allOptions: $
|
|
229
|
-
} =
|
|
229
|
+
} = Be({
|
|
230
230
|
...t,
|
|
231
231
|
modelValue: t.modelValue ?? t.default ?? ""
|
|
232
232
|
}, r);
|
|
233
|
-
return
|
|
234
|
-
clear:
|
|
233
|
+
return n({
|
|
234
|
+
clear: p,
|
|
235
235
|
inputTextRef: s
|
|
236
236
|
}), M(
|
|
237
237
|
() => t.modelValue,
|
|
238
238
|
(C) => {
|
|
239
|
-
C === void 0 && (
|
|
239
|
+
C === void 0 && (d.value = void 0);
|
|
240
240
|
}
|
|
241
|
-
), (C,
|
|
241
|
+
), (C, l) => (f(), w("div", {
|
|
242
242
|
class: D([C.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox"])
|
|
243
243
|
}, [
|
|
244
244
|
u("div", {
|
|
@@ -247,196 +247,132 @@ const ge = /* @__PURE__ */ J(Xe, [["render", Ze]]), et = {
|
|
|
247
247
|
C.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
|
|
248
248
|
])
|
|
249
249
|
}, [
|
|
250
|
-
(
|
|
250
|
+
(f(!0), w(R, null, W(e(m), (b) => (f(), S(me, {
|
|
251
251
|
layout: C.layout,
|
|
252
|
-
key:
|
|
253
|
-
count:
|
|
254
|
-
label:
|
|
255
|
-
color:
|
|
252
|
+
key: b[e(y)],
|
|
253
|
+
count: b.count,
|
|
254
|
+
label: b[e(k)],
|
|
255
|
+
color: b.color,
|
|
256
256
|
type: "radio",
|
|
257
|
-
value:
|
|
258
|
-
"is-selected": e(
|
|
259
|
-
onItemClick: (K) => e(
|
|
257
|
+
value: b[e(y)],
|
|
258
|
+
"is-selected": e(c)(b),
|
|
259
|
+
onItemClick: (K) => e(x)(b)
|
|
260
260
|
}, null, 8, ["layout", "count", "label", "color", "value", "is-selected", "onItemClick"]))), 128))
|
|
261
261
|
], 2),
|
|
262
|
-
C.type === "select" && e(m).length === 0 && !e(
|
|
263
|
-
u("div",
|
|
262
|
+
C.type === "select" && e(m).length === 0 && !e(o) ? (f(), w("div", tt, [
|
|
263
|
+
u("div", lt, [
|
|
264
264
|
N(ve),
|
|
265
|
-
|
|
265
|
+
l[4] || (l[4] = u("div", { class: "max-w-sm mx-auto mt-6" }, [
|
|
266
266
|
u("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
|
|
267
267
|
u("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
|
|
268
268
|
], -1))
|
|
269
269
|
])
|
|
270
270
|
])) : V("", !0),
|
|
271
|
-
C.layout !== "popover" && C.type !== "select" ? (
|
|
272
|
-
!e(
|
|
271
|
+
C.layout !== "popover" && C.type !== "select" ? (f(), w(R, { key: 1 }, [
|
|
272
|
+
!e(h) && e(g) ? (f(), w("div", {
|
|
273
273
|
key: 0,
|
|
274
|
-
onClick:
|
|
275
|
-
(...
|
|
274
|
+
onClick: l[0] || (l[0] = //@ts-ignore
|
|
275
|
+
(...b) => e(a) && e(a)(...b)),
|
|
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
|
-
|
|
278
|
+
l[5] || (l[5] = z(" Показати більше ")),
|
|
279
279
|
N(ie)
|
|
280
280
|
])) : V("", !0),
|
|
281
|
-
e(
|
|
281
|
+
e(h) ? (f(), w("div", {
|
|
282
282
|
key: 1,
|
|
283
|
-
onClick:
|
|
284
|
-
(...
|
|
283
|
+
onClick: l[1] || (l[1] = //@ts-ignore
|
|
284
|
+
(...b) => e(a) && e(a)(...b)),
|
|
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
|
-
N(
|
|
287
|
+
l[6] || (l[6] = z(" Показати менше ")),
|
|
288
|
+
N(ye)
|
|
289
289
|
])) : V("", !0)
|
|
290
290
|
], 64)) : V("", !0),
|
|
291
|
-
C.cleanable ? (
|
|
292
|
-
C.layout === "inline" ? (
|
|
293
|
-
z(
|
|
291
|
+
C.cleanable ? (f(), w(R, { key: 2 }, [
|
|
292
|
+
C.layout === "inline" ? (f(), w("div", ot, [
|
|
293
|
+
z(F(e(d) || e(d) === null ? 1 : 0) + " з " + F(e($).length) + " обрано ", 1),
|
|
294
294
|
T(u("button", {
|
|
295
295
|
class: "text-gray-600 hover:text-gray-800",
|
|
296
|
-
onClick:
|
|
297
|
-
(...
|
|
296
|
+
onClick: l[2] || (l[2] = //@ts-ignore
|
|
297
|
+
(...b) => e(p) && e(p)(...b))
|
|
298
298
|
}, " Очистити ", 512), [
|
|
299
|
-
[X, e(
|
|
299
|
+
[X, e(d) !== "" && e(d) !== void 0]
|
|
300
300
|
])
|
|
301
301
|
])) : V("", !0),
|
|
302
|
-
C.layout === "popover" ? (
|
|
303
|
-
u("span", null,
|
|
302
|
+
C.layout === "popover" ? (f(), w("div", at, [
|
|
303
|
+
u("span", null, F(e(d) || e(d) === null ? 1 : 0) + " з " + F(e($).length) + " обрано", 1),
|
|
304
304
|
T(u("button", {
|
|
305
305
|
class: "text-gray-600 hover:text-gray-800",
|
|
306
|
-
onClick:
|
|
307
|
-
(...
|
|
306
|
+
onClick: l[3] || (l[3] = //@ts-ignore
|
|
307
|
+
(...b) => e(p) && e(p)(...b))
|
|
308
308
|
}, " Очистити ", 512), [
|
|
309
|
-
[X, e(
|
|
309
|
+
[X, e(d) !== "" && e(d) !== void 0]
|
|
310
310
|
])
|
|
311
311
|
])) : V("", !0)
|
|
312
312
|
], 64)) : V("", !0)
|
|
313
313
|
], 2));
|
|
314
314
|
}
|
|
315
315
|
});
|
|
316
|
-
function
|
|
316
|
+
function Se(i, n) {
|
|
317
317
|
const {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
function m(B) {
|
|
324
|
-
return i ? Array.isArray(B) ? B : B ? [B] : [] : B !== void 0 ? B : "";
|
|
325
|
-
}
|
|
326
|
-
const d = _(m(p.modelValue)), h = _(""), f = _(!1), n = _([]), l = _("id"), b = _("text"), y = _(!1), k = _(p.layout !== "popover" && t.length > s), g = _([]), $ = _(0);
|
|
327
|
-
function C(B) {
|
|
328
|
-
const U = B.find(Boolean) ?? {}, q = ["id", "value", "code", "key"].find((oe) => oe in U) ?? "id", se = ["text", "label", "name", "title"].find((oe) => oe in U) ?? "text";
|
|
329
|
-
return { autoValueKey: q, autoLabelKey: se };
|
|
330
|
-
}
|
|
331
|
-
if (t.length > 0) {
|
|
332
|
-
const B = C(t);
|
|
333
|
-
l.value = B.autoValueKey, b.value = B.autoLabelKey;
|
|
334
|
-
}
|
|
335
|
-
const o = I(() => {
|
|
336
|
-
if (v) return n.value;
|
|
337
|
-
const B = n.value;
|
|
338
|
-
if (p.layout === "popover") return B;
|
|
339
|
-
if (!h.value)
|
|
340
|
-
return y.value ? B : B.slice(0, s);
|
|
341
|
-
const U = h.value.toLowerCase();
|
|
342
|
-
return B.filter((q) => q[b.value].toLowerCase().includes(U));
|
|
343
|
-
});
|
|
344
|
-
let x = null;
|
|
345
|
-
async function K(B) {
|
|
346
|
-
if (v) {
|
|
347
|
-
f.value = !0;
|
|
348
|
-
try {
|
|
349
|
-
const U = new URL(v, window.location.origin);
|
|
350
|
-
U.searchParams.set("json", "1"), U.searchParams.set("key", B), U.searchParams.set("limit", s.toString());
|
|
351
|
-
const q = await fetch(U.toString());
|
|
352
|
-
if (!q.ok)
|
|
353
|
-
throw new Error(`HTTP error! status: ${q.status}`);
|
|
354
|
-
const se = await q.json();
|
|
355
|
-
if (n.value = se[r], n.value.length > 0) {
|
|
356
|
-
const oe = C(n.value);
|
|
357
|
-
l.value = oe.autoValueKey, b.value = oe.autoLabelKey;
|
|
358
|
-
}
|
|
359
|
-
$.value = se.total;
|
|
360
|
-
} catch (U) {
|
|
361
|
-
console.error("Failed to fetch remote options:", U);
|
|
362
|
-
} finally {
|
|
363
|
-
f.value = !1;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
318
|
+
options: v = [],
|
|
319
|
+
limit: t = 20
|
|
320
|
+
} = i;
|
|
321
|
+
function s(l) {
|
|
322
|
+
return Array.isArray(l) ? l : l ? [l] : [];
|
|
366
323
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
}), M(() => p.modelValue, (B) => {
|
|
372
|
-
d.value = m(B);
|
|
373
|
-
}, { immediate: !0 }), v ? K("") : n.value = t;
|
|
374
|
-
function A(B) {
|
|
375
|
-
return i && Array.isArray(d.value) ? d.value.includes(B[l.value]) : d.value === B[l.value];
|
|
324
|
+
const r = _(s(i.modelValue)), d = _(""), m = _(!1), c = _([]), x = _("id"), p = _("text"), a = _(!1), o = _(i.layout !== "popover" && v.length > t);
|
|
325
|
+
function h(l) {
|
|
326
|
+
const b = l.find(Boolean) ?? {}, K = ["id", "value", "code", "key"].find((Y) => Y in b) ?? "id", A = ["text", "label", "name", "title"].find((Y) => Y in b) ?? "text";
|
|
327
|
+
return { autoValueKey: K, autoLabelKey: A };
|
|
376
328
|
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
d.value = U ? d.value.filter((q) => q !== B[l.value]) : [...d.value, B[l.value]], g.value = U ? g.value.filter((q) => q !== B[b.value]) : [...g.value, B[b.value]];
|
|
381
|
-
} else
|
|
382
|
-
d.value = B[l.value], g.value = B[b.value];
|
|
383
|
-
a("update:modelValue", d.value), a("change", { name: p.name, value: d.value });
|
|
329
|
+
if (v.length > 0) {
|
|
330
|
+
const l = h(v);
|
|
331
|
+
x.value = l.autoValueKey, p.value = l.autoLabelKey;
|
|
384
332
|
}
|
|
385
|
-
|
|
386
|
-
|
|
333
|
+
const g = I(() => {
|
|
334
|
+
const l = c.value;
|
|
335
|
+
return i.layout === "popover" || a.value ? l : l.slice(0, t);
|
|
336
|
+
});
|
|
337
|
+
M(() => i.modelValue, (l) => {
|
|
338
|
+
r.value = s(l);
|
|
339
|
+
}, { immediate: !0 }), c.value = [...v].sort((l, b) => i.sort === "count" ? b.count && l.count ? b.count - l.count : 0 : i.sort === "name" ? String(l[p.value]).localeCompare(String(b[p.value])) : 0);
|
|
340
|
+
function k(l) {
|
|
341
|
+
return r.value && r.value.includes(l[x.value]);
|
|
387
342
|
}
|
|
388
|
-
function
|
|
389
|
-
|
|
343
|
+
function y(l) {
|
|
344
|
+
const b = r.value.includes(l[x.value]);
|
|
345
|
+
r.value = b ? r.value.filter((K) => K !== l[x.value]) : [...r.value, l[x.value]], n("update:modelValue", r.value), n("change", { name: i.name, value: r.value });
|
|
390
346
|
}
|
|
391
|
-
function
|
|
392
|
-
|
|
347
|
+
function $() {
|
|
348
|
+
r.value = [], n("update:modelValue", r.value), n("clear", i.name);
|
|
393
349
|
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
});
|
|
397
|
-
const Q = _(-1);
|
|
398
|
-
M(o, () => {
|
|
399
|
-
Q.value = o.value.length > 0 ? 0 : -1;
|
|
400
|
-
});
|
|
401
|
-
function re(B) {
|
|
402
|
-
const U = o.value.length;
|
|
403
|
-
if (B.key === "ArrowDown")
|
|
404
|
-
B.preventDefault(), Q.value = (Q.value + 1) % U;
|
|
405
|
-
else if (B.key === "ArrowUp")
|
|
406
|
-
B.preventDefault(), Q.value = (Q.value - 1 + U) % U;
|
|
407
|
-
else if (B.key === "Enter" && (B.preventDefault(), Q.value >= 0 && Q.value < o.value.length)) {
|
|
408
|
-
const q = o.value[Q.value];
|
|
409
|
-
Y(q);
|
|
410
|
-
}
|
|
350
|
+
function C() {
|
|
351
|
+
a.value = !a.value;
|
|
411
352
|
}
|
|
412
353
|
return {
|
|
413
|
-
innerValue:
|
|
414
|
-
searchTerm:
|
|
415
|
-
filteredOptions:
|
|
416
|
-
isSelected:
|
|
417
|
-
selectItem:
|
|
418
|
-
clear:
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
allOptions: n,
|
|
427
|
-
highlightedIndex: Q,
|
|
428
|
-
onKeyDown: re,
|
|
429
|
-
selectedLabels: g,
|
|
430
|
-
totalCount: $
|
|
354
|
+
innerValue: r,
|
|
355
|
+
searchTerm: d,
|
|
356
|
+
filteredOptions: g,
|
|
357
|
+
isSelected: k,
|
|
358
|
+
selectItem: y,
|
|
359
|
+
clear: $,
|
|
360
|
+
toggleShowAll: C,
|
|
361
|
+
isReqProc: m,
|
|
362
|
+
showAll: a,
|
|
363
|
+
isEnableShowAll: o,
|
|
364
|
+
labelKey: p,
|
|
365
|
+
valueKey: x,
|
|
366
|
+
allOptions: c
|
|
431
367
|
};
|
|
432
368
|
}
|
|
433
|
-
const
|
|
369
|
+
const rt = {
|
|
434
370
|
key: 0,
|
|
435
371
|
class: "w-full"
|
|
436
|
-
},
|
|
372
|
+
}, st = { class: "flex flex-col items-center justify-center p-5 text-center" }, ut = {
|
|
437
373
|
key: 0,
|
|
438
374
|
class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
|
|
439
|
-
},
|
|
375
|
+
}, it = {
|
|
440
376
|
key: 1,
|
|
441
377
|
class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
|
|
442
378
|
}, xe = /* @__PURE__ */ O({
|
|
@@ -465,21 +401,21 @@ const at = {
|
|
|
465
401
|
sort: {}
|
|
466
402
|
},
|
|
467
403
|
emits: ["update:modelValue", "change", "clear"],
|
|
468
|
-
setup(
|
|
469
|
-
const t =
|
|
404
|
+
setup(i, { expose: n, emit: v }) {
|
|
405
|
+
const t = i, s = v, {
|
|
470
406
|
innerValue: r,
|
|
471
|
-
filteredOptions:
|
|
407
|
+
filteredOptions: d,
|
|
472
408
|
isSelected: m,
|
|
473
|
-
selectItem:
|
|
474
|
-
clear:
|
|
475
|
-
toggleShowAll:
|
|
476
|
-
isReqProc:
|
|
477
|
-
showAll:
|
|
478
|
-
isEnableShowAll:
|
|
479
|
-
labelKey:
|
|
409
|
+
selectItem: c,
|
|
410
|
+
clear: x,
|
|
411
|
+
toggleShowAll: p,
|
|
412
|
+
isReqProc: a,
|
|
413
|
+
showAll: o,
|
|
414
|
+
isEnableShowAll: h,
|
|
415
|
+
labelKey: g,
|
|
480
416
|
valueKey: k,
|
|
481
|
-
allOptions:
|
|
482
|
-
} =
|
|
417
|
+
allOptions: y
|
|
418
|
+
} = Se({
|
|
483
419
|
...t,
|
|
484
420
|
modelValue: t.modelValue
|
|
485
421
|
}, s);
|
|
@@ -488,9 +424,9 @@ const at = {
|
|
|
488
424
|
($) => {
|
|
489
425
|
$ === void 0 && (r.value = []);
|
|
490
426
|
}
|
|
491
|
-
),
|
|
492
|
-
clear:
|
|
493
|
-
}), ($, C) => (
|
|
427
|
+
), n({
|
|
428
|
+
clear: x
|
|
429
|
+
}), ($, C) => (f(), w("div", {
|
|
494
430
|
class: D([$.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
|
|
495
431
|
}, [
|
|
496
432
|
u("div", {
|
|
@@ -499,19 +435,19 @@ const at = {
|
|
|
499
435
|
$.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
|
|
500
436
|
])
|
|
501
437
|
}, [
|
|
502
|
-
(
|
|
438
|
+
(f(!0), w(R, null, W(e(d), (l) => (f(), S(me, {
|
|
503
439
|
layout: $.layout,
|
|
504
|
-
count:
|
|
505
|
-
label:
|
|
506
|
-
color:
|
|
440
|
+
count: l.count,
|
|
441
|
+
label: l[e(g)],
|
|
442
|
+
color: l.color,
|
|
507
443
|
type: "checkbox",
|
|
508
|
-
value:
|
|
509
|
-
"is-selected": e(m)(
|
|
510
|
-
onItemClick: (
|
|
444
|
+
value: l[e(k)],
|
|
445
|
+
"is-selected": e(m)(l),
|
|
446
|
+
onItemClick: (b) => e(c)(l)
|
|
511
447
|
}, null, 8, ["layout", "count", "label", "color", "value", "is-selected", "onItemClick"]))), 256))
|
|
512
448
|
], 2),
|
|
513
|
-
$.type === "select" && e(
|
|
514
|
-
u("div",
|
|
449
|
+
$.type === "select" && e(d).length === 0 && !e(a) ? (f(), w("div", rt, [
|
|
450
|
+
u("div", st, [
|
|
515
451
|
N(ve),
|
|
516
452
|
C[4] || (C[4] = u("div", { class: "max-w-sm mx-auto mt-6" }, [
|
|
517
453
|
u("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
|
|
@@ -519,43 +455,43 @@ const at = {
|
|
|
519
455
|
], -1))
|
|
520
456
|
])
|
|
521
457
|
])) : V("", !0),
|
|
522
|
-
$.layout !== "popover" && $.type !== "select" ? (
|
|
523
|
-
!e(
|
|
458
|
+
$.layout !== "popover" && $.type !== "select" ? (f(), w(R, { key: 1 }, [
|
|
459
|
+
!e(o) && e(h) ? (f(), w("div", {
|
|
524
460
|
key: 0,
|
|
525
461
|
onClick: C[0] || (C[0] = //@ts-ignore
|
|
526
|
-
(...
|
|
462
|
+
(...l) => e(p) && e(p)(...l)),
|
|
527
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"
|
|
528
464
|
}, [
|
|
529
|
-
C[5] || (C[5] = z(" Показати більше "
|
|
465
|
+
C[5] || (C[5] = z(" Показати більше ")),
|
|
530
466
|
N(ie)
|
|
531
467
|
])) : V("", !0),
|
|
532
|
-
e(
|
|
468
|
+
e(o) ? (f(), w("div", {
|
|
533
469
|
key: 1,
|
|
534
470
|
onClick: C[1] || (C[1] = //@ts-ignore
|
|
535
|
-
(...
|
|
471
|
+
(...l) => e(p) && e(p)(...l)),
|
|
536
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"
|
|
537
473
|
}, [
|
|
538
|
-
C[6] || (C[6] = z(" Показати менше "
|
|
539
|
-
N(
|
|
474
|
+
C[6] || (C[6] = z(" Показати менше ")),
|
|
475
|
+
N(ye)
|
|
540
476
|
])) : V("", !0)
|
|
541
477
|
], 64)) : V("", !0),
|
|
542
|
-
$.cleanable ? (
|
|
543
|
-
$.layout === "inline" ? (
|
|
544
|
-
z(
|
|
478
|
+
$.cleanable ? (f(), w(R, { key: 2 }, [
|
|
479
|
+
$.layout === "inline" ? (f(), w("div", ut, [
|
|
480
|
+
z(F(e(r).length) + " з " + F(e(y).length) + " обрано ", 1),
|
|
545
481
|
T(u("button", {
|
|
546
482
|
class: "text-gray-600 hover:text-gray-800",
|
|
547
483
|
onClick: C[2] || (C[2] = //@ts-ignore
|
|
548
|
-
(...
|
|
484
|
+
(...l) => e(x) && e(x)(...l))
|
|
549
485
|
}, " Очистити ", 512), [
|
|
550
486
|
[X, e(r).length !== 0]
|
|
551
487
|
])
|
|
552
488
|
])) : V("", !0),
|
|
553
|
-
$.layout === "popover" ? (
|
|
554
|
-
u("span", null,
|
|
489
|
+
$.layout === "popover" ? (f(), w("div", it, [
|
|
490
|
+
u("span", null, F(e(r).length) + " з " + F(e(y).length) + " обрано", 1),
|
|
555
491
|
T(u("button", {
|
|
556
492
|
class: "text-gray-600 hover:text-gray-800",
|
|
557
493
|
onClick: C[3] || (C[3] = //@ts-ignore
|
|
558
|
-
(...
|
|
494
|
+
(...l) => e(x) && e(x)(...l))
|
|
559
495
|
}, " Очистити ", 512), [
|
|
560
496
|
[X, e(r).length !== 0]
|
|
561
497
|
])
|
|
@@ -563,7 +499,7 @@ const at = {
|
|
|
563
499
|
], 64)) : V("", !0)
|
|
564
500
|
], 2));
|
|
565
501
|
}
|
|
566
|
-
}),
|
|
502
|
+
}), dt = {}, ct = {
|
|
567
503
|
xmlns: "http://www.w3.org/2000/svg",
|
|
568
504
|
width: "15px",
|
|
569
505
|
height: "15px",
|
|
@@ -575,8 +511,8 @@ const at = {
|
|
|
575
511
|
"stroke-linejoin": "round",
|
|
576
512
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"
|
|
577
513
|
};
|
|
578
|
-
function
|
|
579
|
-
return
|
|
514
|
+
function ft(i, n) {
|
|
515
|
+
return f(), w("svg", ct, n[0] || (n[0] = [
|
|
580
516
|
u("path", {
|
|
581
517
|
stroke: "none",
|
|
582
518
|
d: "M0 0h24v24H0z",
|
|
@@ -586,7 +522,7 @@ function ct(p, a) {
|
|
|
586
522
|
u("path", { d: "M21 21l-6 -6" }, null, -1)
|
|
587
523
|
]));
|
|
588
524
|
}
|
|
589
|
-
const
|
|
525
|
+
const De = /* @__PURE__ */ J(dt, [["render", ft]]), pt = {}, mt = {
|
|
590
526
|
xmlns: "http://www.w3.org/2000/svg",
|
|
591
527
|
viewBox: "0 0 24 24",
|
|
592
528
|
fill: "none",
|
|
@@ -598,8 +534,8 @@ const Se = /* @__PURE__ */ J(it, [["render", ct]]), ft = {}, pt = {
|
|
|
598
534
|
width: "15px",
|
|
599
535
|
height: "15px"
|
|
600
536
|
};
|
|
601
|
-
function
|
|
602
|
-
return
|
|
537
|
+
function vt(i, n) {
|
|
538
|
+
return f(), w("svg", mt, n[0] || (n[0] = [
|
|
603
539
|
u("path", {
|
|
604
540
|
stroke: "none",
|
|
605
541
|
d: "M0 0h24v24H0z",
|
|
@@ -609,13 +545,13 @@ function mt(p, a) {
|
|
|
609
545
|
u("path", { d: "M6 6l12 12" }, null, -1)
|
|
610
546
|
]));
|
|
611
547
|
}
|
|
612
|
-
const
|
|
548
|
+
const Re = /* @__PURE__ */ J(pt, [["render", vt]]);
|
|
613
549
|
class de {
|
|
614
|
-
static getWidthClass(
|
|
615
|
-
return typeof
|
|
550
|
+
static getWidthClass(n) {
|
|
551
|
+
return typeof n == "number" ? `max-w-[${n}px]` : typeof n == "string" ? n.endsWith("%") || n.endsWith("px") ? `max-w-[${n}]` : `max-w-${n}` : "w-full";
|
|
616
552
|
}
|
|
617
553
|
}
|
|
618
|
-
const
|
|
554
|
+
const yt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3" }, gt = ["placeholder"], bt = /* @__PURE__ */ O({
|
|
619
555
|
__name: "text-input",
|
|
620
556
|
props: {
|
|
621
557
|
id: {},
|
|
@@ -641,40 +577,40 @@ const vt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"
|
|
|
641
577
|
sort: {}
|
|
642
578
|
},
|
|
643
579
|
emits: ["update:modelValue", "change", "clear"],
|
|
644
|
-
setup(
|
|
645
|
-
const v =
|
|
580
|
+
setup(i, { emit: n }) {
|
|
581
|
+
const v = i, t = _((v.placeHolder || v.label || v.name).toString()), s = n, r = _(v.modelValue ?? "");
|
|
646
582
|
M(
|
|
647
583
|
() => v.modelValue,
|
|
648
|
-
(
|
|
649
|
-
|
|
584
|
+
(c) => {
|
|
585
|
+
c !== r.value && (r.value = c ?? "");
|
|
650
586
|
}
|
|
651
587
|
);
|
|
652
|
-
function
|
|
588
|
+
function d() {
|
|
653
589
|
s("update:modelValue", r.value), s("change", { name: v.name, value: r.value });
|
|
654
590
|
}
|
|
655
591
|
function m() {
|
|
656
592
|
r.value = "", s("update:modelValue", ""), s("clear", v.name);
|
|
657
593
|
}
|
|
658
|
-
return (
|
|
594
|
+
return (c, x) => (f(), w("div", {
|
|
659
595
|
class: D([
|
|
660
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",
|
|
661
|
-
|
|
597
|
+
c.layout === "inline" ? e(de).getWidthClass(c.width) : "w-full mb-2"
|
|
662
598
|
])
|
|
663
599
|
}, [
|
|
664
|
-
u("div",
|
|
665
|
-
N(
|
|
600
|
+
u("div", yt, [
|
|
601
|
+
N(De)
|
|
666
602
|
]),
|
|
667
|
-
r.value !== "" ? (
|
|
603
|
+
r.value !== "" ? (f(), w("div", {
|
|
668
604
|
key: 0,
|
|
669
605
|
onClick: m,
|
|
670
606
|
class: "absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer"
|
|
671
607
|
}, [
|
|
672
|
-
N(
|
|
608
|
+
N(Re)
|
|
673
609
|
])) : V("", !0),
|
|
674
610
|
T(u("input", {
|
|
675
611
|
type: "text",
|
|
676
|
-
"onUpdate:modelValue":
|
|
677
|
-
onInput:
|
|
612
|
+
"onUpdate:modelValue": x[0] || (x[0] = (p) => r.value = p),
|
|
613
|
+
onInput: d,
|
|
678
614
|
placeholder: t.value,
|
|
679
615
|
class: "!pr-7 !pl-8 bg-white h-[38px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:border-2 focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
|
|
680
616
|
}, null, 40, gt), [
|
|
@@ -683,32 +619,32 @@ const vt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"
|
|
|
683
619
|
], 2));
|
|
684
620
|
}
|
|
685
621
|
});
|
|
686
|
-
function
|
|
622
|
+
function Me(i = { color: "blue" }) {
|
|
687
623
|
return I(() => {
|
|
688
|
-
const v = `w-full px-3 py-2 border-solid border border-gray-300 text-sm rounded focus:outline-none focus:ring-2 focus:ring-${
|
|
689
|
-
return
|
|
624
|
+
const v = `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?.size === "sm" ? `${v}h-[32px]` : `${v}h-[38px]`;
|
|
690
626
|
});
|
|
691
627
|
}
|
|
692
|
-
function
|
|
628
|
+
function ht() {
|
|
693
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]";
|
|
694
630
|
}
|
|
695
|
-
function
|
|
631
|
+
function xt() {
|
|
696
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";
|
|
697
633
|
}
|
|
698
|
-
function
|
|
699
|
-
return
|
|
634
|
+
function Ke(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]";
|
|
700
636
|
}
|
|
701
|
-
const
|
|
637
|
+
const kt = {
|
|
702
638
|
key: 0,
|
|
703
639
|
class: "block text-xs font-medium text-gray-600 mb-1"
|
|
704
|
-
},
|
|
640
|
+
}, wt = ["placeholder", "disabled"], Ct = {
|
|
705
641
|
key: 0,
|
|
706
642
|
class: "block text-xs font-medium text-gray-600 mb-1"
|
|
707
|
-
},
|
|
643
|
+
}, Vt = {
|
|
708
644
|
key: 0,
|
|
709
645
|
class: "block text-xs font-medium text-gray-600 mb-1"
|
|
710
|
-
},
|
|
711
|
-
const
|
|
646
|
+
}, _t = ["placeholder", "disabled"], $t = ["disabled"];
|
|
647
|
+
const At = /* @__PURE__ */ O({
|
|
712
648
|
__name: "range-input",
|
|
713
649
|
props: {
|
|
714
650
|
id: {},
|
|
@@ -734,82 +670,82 @@ const $t = /* @__PURE__ */ O({
|
|
|
734
670
|
sort: {}
|
|
735
671
|
},
|
|
736
672
|
emits: ["update:modelValue", "change", "clear"],
|
|
737
|
-
setup(
|
|
738
|
-
const t =
|
|
673
|
+
setup(i, { expose: n, emit: v }) {
|
|
674
|
+
const t = Me(), s = ht(), r = i, d = _(
|
|
739
675
|
r.modelValue ?? r.default ?? []
|
|
740
|
-
), m = v,
|
|
741
|
-
get: () => r.modelValue ??
|
|
742
|
-
set: (
|
|
743
|
-
r.modelValue !== void 0 ? m("update:modelValue",
|
|
676
|
+
), m = v, c = I({
|
|
677
|
+
get: () => r.modelValue ?? d.value,
|
|
678
|
+
set: (a) => {
|
|
679
|
+
r.modelValue !== void 0 ? m("update:modelValue", a) : d.value = a;
|
|
744
680
|
}
|
|
745
681
|
});
|
|
746
|
-
function
|
|
747
|
-
m("change", { name: r.name, value:
|
|
682
|
+
function x() {
|
|
683
|
+
m("change", { name: r.name, value: c.value || d.value });
|
|
748
684
|
}
|
|
749
|
-
function
|
|
750
|
-
|
|
685
|
+
function p() {
|
|
686
|
+
d.value = [], c.value = d.value, m("clear", r.name);
|
|
751
687
|
}
|
|
752
|
-
return M(() => r.modelValue, (
|
|
753
|
-
|
|
754
|
-
}),
|
|
755
|
-
clear:
|
|
756
|
-
currentValue:
|
|
757
|
-
}), (
|
|
688
|
+
return M(() => r.modelValue, (a) => {
|
|
689
|
+
a !== void 0 && r.layout !== "popover" ? (d.value = a, m("update:modelValue", a)) : d.value = [];
|
|
690
|
+
}), n({
|
|
691
|
+
clear: p,
|
|
692
|
+
currentValue: c
|
|
693
|
+
}), (a, o) => (f(), w(R, null, [
|
|
758
694
|
u("div", null, [
|
|
759
695
|
u("div", {
|
|
760
|
-
class: D(
|
|
696
|
+
class: D(a.layout === "vertical" ? "inline-flex items-center gap-2" : "space-y-3 p-2")
|
|
761
697
|
}, [
|
|
762
698
|
u("div", null, [
|
|
763
|
-
|
|
699
|
+
a.layout !== "vertical" ? (f(), w("label", kt, "Від")) : V("", !0),
|
|
764
700
|
T(u("input", {
|
|
765
701
|
type: "number",
|
|
766
702
|
class: D(e(t)),
|
|
767
|
-
placeholder:
|
|
703
|
+
placeholder: a.placeHolder?.[0] ?? "min",
|
|
768
704
|
step: "1",
|
|
769
705
|
style: { outline: "none" },
|
|
770
|
-
"onUpdate:modelValue":
|
|
771
|
-
disabled:
|
|
772
|
-
}, null, 10,
|
|
773
|
-
[G,
|
|
706
|
+
"onUpdate:modelValue": o[0] || (o[0] = (h) => c.value[0] = h),
|
|
707
|
+
disabled: a.disabled
|
|
708
|
+
}, null, 10, wt), [
|
|
709
|
+
[G, c.value[0]]
|
|
774
710
|
])
|
|
775
711
|
]),
|
|
776
|
-
|
|
712
|
+
a.layout === "vertical" ? (f(), w("label", Ct, " - ")) : V("", !0),
|
|
777
713
|
u("div", null, [
|
|
778
|
-
|
|
714
|
+
a.layout !== "vertical" ? (f(), w("label", Vt, "До")) : V("", !0),
|
|
779
715
|
T(u("input", {
|
|
780
716
|
type: "number",
|
|
781
717
|
class: D(e(t)),
|
|
782
|
-
placeholder:
|
|
718
|
+
placeholder: a.placeHolder?.[1] ?? "max",
|
|
783
719
|
min: "0",
|
|
784
720
|
max: "1000000000000000",
|
|
785
721
|
step: "1",
|
|
786
722
|
style: { outline: "none" },
|
|
787
|
-
"onUpdate:modelValue":
|
|
788
|
-
disabled:
|
|
789
|
-
}, null, 10,
|
|
790
|
-
[G,
|
|
723
|
+
"onUpdate:modelValue": o[1] || (o[1] = (h) => c.value[1] = h),
|
|
724
|
+
disabled: a.disabled
|
|
725
|
+
}, null, 10, _t), [
|
|
726
|
+
[G, c.value[1]]
|
|
791
727
|
])
|
|
792
728
|
]),
|
|
793
|
-
["popover", "inline", "vertical"].includes(
|
|
729
|
+
["popover", "inline", "vertical"].includes(a.layout) ? (f(), w("button", {
|
|
794
730
|
key: 1,
|
|
795
|
-
onClick:
|
|
796
|
-
class: D(e(s) + (
|
|
797
|
-
},
|
|
798
|
-
["popover", "inline"].includes(
|
|
731
|
+
onClick: x,
|
|
732
|
+
class: D(e(s) + (a.layout === "vertical" ? " w-[50px]" : " bg-blue-100 hover:bg-blue-200"))
|
|
733
|
+
}, F(a.layout === "vertical" ? "Ok" : "Застосувати"), 3)) : V("", !0),
|
|
734
|
+
["popover", "inline"].includes(a.layout) ? (f(), w("button", {
|
|
799
735
|
key: 2,
|
|
800
|
-
disabled: !(
|
|
801
|
-
onClick:
|
|
736
|
+
disabled: !(c.value[0] || c.value[1]),
|
|
737
|
+
onClick: p,
|
|
802
738
|
class: D(e(s) + " hover:bg-gray-100")
|
|
803
|
-
}, "Очистити", 10,
|
|
739
|
+
}, "Очистити", 10, $t)) : V("", !0)
|
|
804
740
|
], 2)
|
|
805
741
|
]),
|
|
806
|
-
(
|
|
742
|
+
(a.cleanable && d.value.length, V("", !0))
|
|
807
743
|
], 64));
|
|
808
744
|
}
|
|
809
|
-
}),
|
|
745
|
+
}), Bt = ["disabled", "title"], St = {
|
|
810
746
|
key: 0,
|
|
811
747
|
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"
|
|
812
|
-
},
|
|
748
|
+
}, Dt = { 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" }, Rt = { 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" }, ge = /* @__PURE__ */ O({
|
|
813
749
|
__name: "popover-field",
|
|
814
750
|
props: {
|
|
815
751
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -820,71 +756,71 @@ const $t = /* @__PURE__ */ O({
|
|
|
820
756
|
mode: {},
|
|
821
757
|
layout: {}
|
|
822
758
|
},
|
|
823
|
-
setup(
|
|
824
|
-
const v =
|
|
825
|
-
function
|
|
826
|
-
const
|
|
827
|
-
if (!
|
|
828
|
-
const C =
|
|
759
|
+
setup(i, { expose: n }) {
|
|
760
|
+
const v = i, t = I(() => Ke(v.mode)), s = _(!1), r = _({ top: 0, left: 0 }), d = _(null), m = _(null), c = _(null);
|
|
761
|
+
function x() {
|
|
762
|
+
const y = m.value, $ = c.value;
|
|
763
|
+
if (!y || !$) return;
|
|
764
|
+
const C = y.getBoundingClientRect(), l = $.offsetWidth, b = window.innerWidth, K = C.bottom + 8;
|
|
829
765
|
let { left: A } = C;
|
|
830
|
-
A +
|
|
766
|
+
A + l > b && (A = Math.max(b - l - 10, 10)), r.value = { top: K, left: A };
|
|
831
767
|
}
|
|
832
|
-
function
|
|
768
|
+
function p() {
|
|
833
769
|
s.value = !s.value, s.value && fe(() => {
|
|
834
|
-
|
|
770
|
+
x(), v.fieldRef?.inputTextRef && v.fieldRef?.inputTextRef.focus();
|
|
835
771
|
});
|
|
836
772
|
}
|
|
837
|
-
function
|
|
838
|
-
!
|
|
773
|
+
function a(y) {
|
|
774
|
+
!d.value?.contains(y.target) && !c.value?.contains(y.target) && (s.value = !1);
|
|
839
775
|
}
|
|
840
|
-
function
|
|
841
|
-
|
|
776
|
+
function o(y) {
|
|
777
|
+
y.key === "Escape" && (s.value = !1);
|
|
842
778
|
}
|
|
843
|
-
const
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
}),
|
|
847
|
-
document.addEventListener("click",
|
|
779
|
+
const h = _(!1);
|
|
780
|
+
ne(() => {
|
|
781
|
+
h.value = !0;
|
|
782
|
+
}), ne(() => {
|
|
783
|
+
document.addEventListener("click", a, !0), document.addEventListener("keydown", o), window.addEventListener("scroll", x, !0);
|
|
848
784
|
}), ce(() => {
|
|
849
|
-
document.removeEventListener("click",
|
|
785
|
+
document.removeEventListener("click", a, !0), document.removeEventListener("keydown", o), window.removeEventListener("scroll", x, !0);
|
|
850
786
|
});
|
|
851
|
-
function
|
|
787
|
+
function g() {
|
|
852
788
|
s.value = !1;
|
|
853
789
|
}
|
|
854
|
-
|
|
790
|
+
n({ close: g });
|
|
855
791
|
const k = I(() => {
|
|
856
|
-
const
|
|
857
|
-
return
|
|
792
|
+
const y = v.fieldRef?.selectedLabels;
|
|
793
|
+
return y ? Array.isArray(y) ? y.length > 0 ? y.join(", ") : v.label ?? "" : String(y) : v.label ?? "";
|
|
858
794
|
});
|
|
859
|
-
return (
|
|
795
|
+
return (y, $) => (f(), w("div", null, [
|
|
860
796
|
u("button", {
|
|
861
|
-
onClick:
|
|
862
|
-
disabled:
|
|
797
|
+
onClick: p,
|
|
798
|
+
disabled: y.disabled,
|
|
863
799
|
ref_key: "triggerRef",
|
|
864
800
|
ref: m,
|
|
865
|
-
title:
|
|
866
|
-
class: D(t.value + " " + (
|
|
801
|
+
title: y.label,
|
|
802
|
+
class: D(t.value + " " + (y.width ? e(de).getWidthClass(y.width) : "w-full"))
|
|
867
803
|
}, [
|
|
868
804
|
u("span", {
|
|
869
|
-
class: D(["truncate text-ellipsis block",
|
|
870
|
-
},
|
|
805
|
+
class: D(["truncate text-ellipsis block", y.width ? e(de).getWidthClass(y.width - 50) : "w-full"])
|
|
806
|
+
}, F(k.value), 3),
|
|
871
807
|
N(ie, { class: "h-4 w-4" }),
|
|
872
|
-
(Array.isArray(
|
|
873
|
-
], 10,
|
|
874
|
-
|
|
808
|
+
(Array.isArray(y.currentValue) ? y.currentValue === null || y.currentValue.length > 0 : y.currentValue === null || y.currentValue) && y.layout === "inline" ? (f(), w("span", St)) : V("", !0)
|
|
809
|
+
], 10, Bt),
|
|
810
|
+
h.value ? (f(), S($e, {
|
|
875
811
|
key: 0,
|
|
876
812
|
to: "body"
|
|
877
813
|
}, [
|
|
878
814
|
T(u("div", {
|
|
879
815
|
ref_key: "popperRef",
|
|
880
|
-
ref:
|
|
816
|
+
ref: c,
|
|
881
817
|
class: "vsTailwind vs-popover__content bottom-right w-fit fixed z-[1000]",
|
|
882
|
-
style:
|
|
818
|
+
style: Ae({ top: `${r.value.top}px`, left: `${r.value.left}px` }),
|
|
883
819
|
"data-inside-popover": ""
|
|
884
820
|
}, [
|
|
885
|
-
u("div",
|
|
886
|
-
u("div",
|
|
887
|
-
ue(
|
|
821
|
+
u("div", Dt, [
|
|
822
|
+
u("div", Rt, [
|
|
823
|
+
ue(y.$slots, "default")
|
|
888
824
|
])
|
|
889
825
|
])
|
|
890
826
|
], 4), [
|
|
@@ -894,96 +830,96 @@ const $t = /* @__PURE__ */ O({
|
|
|
894
830
|
]));
|
|
895
831
|
}
|
|
896
832
|
});
|
|
897
|
-
function
|
|
898
|
-
return String(
|
|
833
|
+
function Mt(i) {
|
|
834
|
+
return String(i).charAt(0).toUpperCase() + String(i).slice(1);
|
|
899
835
|
}
|
|
900
836
|
class H {
|
|
901
|
-
static format(
|
|
902
|
-
const v =
|
|
837
|
+
static format(n) {
|
|
838
|
+
const v = n.getFullYear(), t = (n.getMonth() + 1).toString().padStart(2, "0"), s = n.getDate().toString().padStart(2, "0");
|
|
903
839
|
return `${v}-${t}-${s}`;
|
|
904
840
|
}
|
|
905
|
-
static getShiftedDay(
|
|
906
|
-
const t =
|
|
841
|
+
static getShiftedDay(n, v = 0) {
|
|
842
|
+
const t = n ? new Date(n) : /* @__PURE__ */ new Date();
|
|
907
843
|
return t.setDate(t.getDate() + v), this.format(t);
|
|
908
844
|
}
|
|
909
|
-
static getLastWeekRange(
|
|
910
|
-
if (
|
|
911
|
-
const
|
|
912
|
-
return
|
|
845
|
+
static getLastWeekRange(n, v, t = 0) {
|
|
846
|
+
if (n && v) {
|
|
847
|
+
const x = new Date(n), p = new Date(v);
|
|
848
|
+
return x.setDate(x.getDate() + t * 7), p.setDate(p.getDate() + t * 7), [this.format(x), this.format(p)];
|
|
913
849
|
}
|
|
914
|
-
const s = /* @__PURE__ */ new Date(), r = s.getDay(),
|
|
915
|
-
m.setDate(s.getDate() -
|
|
916
|
-
const
|
|
917
|
-
return
|
|
850
|
+
const s = /* @__PURE__ */ new Date(), r = s.getDay(), d = r === 0 ? 13 : r - 1 + 7, m = new Date(s);
|
|
851
|
+
m.setDate(s.getDate() - d + t * 7);
|
|
852
|
+
const c = new Date(m);
|
|
853
|
+
return c.setDate(m.getDate() + 6), [this.format(m), this.format(c)];
|
|
918
854
|
}
|
|
919
|
-
static getMonthRange(
|
|
855
|
+
static getMonthRange(n, v, t = 0) {
|
|
920
856
|
let s;
|
|
921
|
-
|
|
922
|
-
const r = s,
|
|
923
|
-
return [this.format(r), this.format(
|
|
924
|
-
}
|
|
925
|
-
static getQuarterRange(
|
|
926
|
-
const s =
|
|
927
|
-
let
|
|
928
|
-
|
|
929
|
-
const m = (
|
|
930
|
-
return [this.format(
|
|
931
|
-
}
|
|
932
|
-
static getYear(
|
|
857
|
+
n ? s = new Date(n) : s = /* @__PURE__ */ new Date(), s = new Date(s.getFullYear(), s.getMonth() + t, 1);
|
|
858
|
+
const r = s, d = new Date(s.getFullYear(), s.getMonth() + 1, 0);
|
|
859
|
+
return [this.format(r), this.format(d)];
|
|
860
|
+
}
|
|
861
|
+
static getQuarterRange(n, v, t = 0) {
|
|
862
|
+
const s = n || v, r = s ? new Date(s) : /* @__PURE__ */ new Date();
|
|
863
|
+
let d = Math.floor(r.getMonth() / 3);
|
|
864
|
+
d += t;
|
|
865
|
+
const m = (d % 4 + 4) % 4 * 3, c = r.getFullYear() + Math.floor(d / 4), x = new Date(c, m, 1), p = new Date(c, m + 3, 0);
|
|
866
|
+
return [this.format(x), this.format(p)];
|
|
867
|
+
}
|
|
868
|
+
static getYear(n, v = 0) {
|
|
933
869
|
let t;
|
|
934
|
-
return
|
|
870
|
+
return n && /^\d{4}$/.test(n) ? t = parseInt(n, 10) : n ? t = new Date(n).getFullYear() : t = (/* @__PURE__ */ new Date()).getFullYear(), String(t + v);
|
|
935
871
|
}
|
|
936
|
-
static getYearRange(
|
|
872
|
+
static getYearRange(n, v = 0) {
|
|
937
873
|
let t;
|
|
938
|
-
return
|
|
874
|
+
return n && /^\d{4}$/.test(n) ? t = parseInt(n, 10) : n ? t = new Date(n).getFullYear() : t = (/* @__PURE__ */ new Date()).getFullYear(), [
|
|
939
875
|
this.format(new Date(t + v, 0, 1)),
|
|
940
876
|
this.format(new Date(t + v + 1, 0, 0))
|
|
941
877
|
];
|
|
942
878
|
}
|
|
943
|
-
static getRangeFromDaysBefore(
|
|
879
|
+
static getRangeFromDaysBefore(n) {
|
|
944
880
|
const v = /* @__PURE__ */ new Date(), t = new Date(v.getTime());
|
|
945
|
-
return t.setDate(v.getDate() -
|
|
881
|
+
return t.setDate(v.getDate() - n), [this.format(t), this.format(v)];
|
|
946
882
|
}
|
|
947
883
|
}
|
|
948
|
-
function
|
|
884
|
+
function Fe(i, n) {
|
|
949
885
|
const {
|
|
950
886
|
popoverRef: v
|
|
951
|
-
} =
|
|
952
|
-
|
|
887
|
+
} = i, t = _(""), s = _(
|
|
888
|
+
i.modelValue ?? i.default ?? []
|
|
953
889
|
), r = _(0);
|
|
954
|
-
function
|
|
890
|
+
function d() {
|
|
955
891
|
const k = H.getRangeFromDaysBefore(r.value);
|
|
956
|
-
return s.value = [...k],
|
|
892
|
+
return s.value = [...k], n("change", { name: i.name, value: s.value }), n("update:modelValue", s.value), k;
|
|
957
893
|
}
|
|
958
894
|
function m(k) {
|
|
959
895
|
t.value = k, v.value?.close();
|
|
960
|
-
const
|
|
896
|
+
const y = [];
|
|
961
897
|
switch (t.value) {
|
|
962
898
|
case "today":
|
|
963
|
-
|
|
899
|
+
y.push(H.getShiftedDay()), y.push(H.getShiftedDay());
|
|
964
900
|
break;
|
|
965
901
|
case "week":
|
|
966
|
-
|
|
902
|
+
y.push(...H.getLastWeekRange());
|
|
967
903
|
break;
|
|
968
904
|
case "month":
|
|
969
|
-
|
|
905
|
+
y.push(...H.getMonthRange());
|
|
970
906
|
break;
|
|
971
907
|
case "quarter":
|
|
972
|
-
|
|
908
|
+
y.push(...H.getQuarterRange());
|
|
973
909
|
break;
|
|
974
910
|
case "year":
|
|
975
|
-
|
|
911
|
+
y.push(...H.getYearRange());
|
|
976
912
|
break;
|
|
977
913
|
case "last_7_days":
|
|
978
|
-
r.value = 7,
|
|
914
|
+
r.value = 7, d();
|
|
979
915
|
break;
|
|
980
916
|
case "range":
|
|
981
|
-
r.value = 7,
|
|
917
|
+
r.value = 7, y.push(...d());
|
|
982
918
|
break;
|
|
983
919
|
}
|
|
984
|
-
s.value = [...
|
|
920
|
+
s.value = [...y], n("change", { name: i.name, value: s.value }), n("update:modelValue", s.value);
|
|
985
921
|
}
|
|
986
|
-
function
|
|
922
|
+
function c() {
|
|
987
923
|
const k = [];
|
|
988
924
|
switch (t.value) {
|
|
989
925
|
case "today":
|
|
@@ -1002,9 +938,9 @@ function Ke(p, a) {
|
|
|
1002
938
|
k.push(...H.getYearRange(s.value[0], 1));
|
|
1003
939
|
break;
|
|
1004
940
|
}
|
|
1005
|
-
s.value = [...k],
|
|
941
|
+
s.value = [...k], n("change", { name: i.name, value: s.value }), n("update:modelValue", s.value);
|
|
1006
942
|
}
|
|
1007
|
-
function
|
|
943
|
+
function x() {
|
|
1008
944
|
const k = [];
|
|
1009
945
|
switch (t.value) {
|
|
1010
946
|
case "today":
|
|
@@ -1023,9 +959,9 @@ function Ke(p, a) {
|
|
|
1023
959
|
k.push(...H.getYearRange(s.value[0], -1));
|
|
1024
960
|
break;
|
|
1025
961
|
}
|
|
1026
|
-
s.value = [...k],
|
|
962
|
+
s.value = [...k], n("change", { name: i.name, value: s.value }), n("update:modelValue", s.value);
|
|
1027
963
|
}
|
|
1028
|
-
const
|
|
964
|
+
const p = [
|
|
1029
965
|
"Січень",
|
|
1030
966
|
"Лютий",
|
|
1031
967
|
"Березень",
|
|
@@ -1039,75 +975,75 @@ function Ke(p, a) {
|
|
|
1039
975
|
"Листопад",
|
|
1040
976
|
"Грудень"
|
|
1041
977
|
];
|
|
1042
|
-
function
|
|
1043
|
-
const [
|
|
1044
|
-
return `${C}.${$}.${
|
|
978
|
+
function a(k) {
|
|
979
|
+
const [y, $, C] = k.split("-");
|
|
980
|
+
return `${C}.${$}.${y}`;
|
|
1045
981
|
}
|
|
1046
|
-
function
|
|
1047
|
-
const { value:
|
|
982
|
+
function o(k) {
|
|
983
|
+
const { value: y } = s;
|
|
1048
984
|
switch (k) {
|
|
1049
985
|
case "today":
|
|
1050
|
-
return
|
|
986
|
+
return a(y[0]);
|
|
1051
987
|
case "range":
|
|
1052
988
|
return "Період";
|
|
1053
989
|
case "week":
|
|
1054
|
-
return
|
|
990
|
+
return y[0] && y[1] ? `${a(y[0])} – ${a(y[1])}` : "";
|
|
1055
991
|
case "quarter":
|
|
1056
|
-
if (
|
|
1057
|
-
const $ = new Date(
|
|
1058
|
-
return `${Math.floor(
|
|
992
|
+
if (y[0]) {
|
|
993
|
+
const $ = new Date(y[0]), C = $.getFullYear(), l = $.getMonth();
|
|
994
|
+
return `${Math.floor(l / 3) + 1} квартал ${C}`;
|
|
1059
995
|
}
|
|
1060
996
|
return "";
|
|
1061
997
|
case "month":
|
|
1062
|
-
if (
|
|
1063
|
-
const [$, C] =
|
|
1064
|
-
return `${
|
|
998
|
+
if (y[0]) {
|
|
999
|
+
const [$, C] = y[0].split("-");
|
|
1000
|
+
return `${p[parseInt(C, 10) - 1]} ${$}`;
|
|
1065
1001
|
}
|
|
1066
1002
|
return "";
|
|
1067
1003
|
case "year":
|
|
1068
|
-
return
|
|
1004
|
+
return y[0] || "";
|
|
1069
1005
|
case "last_7_days":
|
|
1070
1006
|
return "За останні дні";
|
|
1071
1007
|
default:
|
|
1072
|
-
return
|
|
1008
|
+
return i.label ?? "";
|
|
1073
1009
|
}
|
|
1074
1010
|
}
|
|
1075
|
-
const
|
|
1076
|
-
function
|
|
1077
|
-
t.value = "", s.value = [],
|
|
1011
|
+
const h = I(() => t.value ? o(t.value) : i.label ?? "");
|
|
1012
|
+
function g() {
|
|
1013
|
+
t.value = "", s.value = [], n("update:modelValue", []), n("clear", i.name);
|
|
1078
1014
|
}
|
|
1079
1015
|
return {
|
|
1080
1016
|
activeMode: t,
|
|
1081
1017
|
innerValue: s,
|
|
1082
1018
|
daysBefore: r,
|
|
1083
|
-
onDaysBeforeChange:
|
|
1019
|
+
onDaysBeforeChange: d,
|
|
1084
1020
|
onSelectChange: m,
|
|
1085
|
-
nextClick:
|
|
1086
|
-
prevClick:
|
|
1087
|
-
ukMonths:
|
|
1088
|
-
formatDisplayDate:
|
|
1089
|
-
getModeLabel:
|
|
1090
|
-
currentLabel:
|
|
1091
|
-
clear:
|
|
1021
|
+
nextClick: c,
|
|
1022
|
+
prevClick: x,
|
|
1023
|
+
ukMonths: p,
|
|
1024
|
+
formatDisplayDate: a,
|
|
1025
|
+
getModeLabel: o,
|
|
1026
|
+
currentLabel: h,
|
|
1027
|
+
clear: g
|
|
1092
1028
|
};
|
|
1093
1029
|
}
|
|
1094
|
-
const
|
|
1030
|
+
const Kt = {
|
|
1095
1031
|
key: 0,
|
|
1096
1032
|
class: "relative flex w-full h-auto gap-2 filter-date m-2 flex-wrap"
|
|
1097
|
-
},
|
|
1033
|
+
}, Ft = {
|
|
1098
1034
|
key: 0,
|
|
1099
1035
|
class: "flex gap-1 !w-[75%] rounded-lg"
|
|
1100
|
-
}, jt = ["max", "disabled"],
|
|
1036
|
+
}, jt = ["max", "disabled"], Lt = ["min", "disabled"], Et = {
|
|
1101
1037
|
key: 0,
|
|
1102
1038
|
class: "block text-xs font-medium text-gray-600 mb-1"
|
|
1103
|
-
},
|
|
1039
|
+
}, It = ["max", "disabled"], Tt = {
|
|
1104
1040
|
key: 0,
|
|
1105
1041
|
class: "block text-xs font-medium text-gray-600 mb-1"
|
|
1106
|
-
},
|
|
1042
|
+
}, Ot = {
|
|
1107
1043
|
key: 0,
|
|
1108
1044
|
class: "block text-xs font-medium text-gray-600 mb-1"
|
|
1109
|
-
},
|
|
1110
|
-
const
|
|
1045
|
+
}, Ut = ["min", "disabled"], zt = { class: "flex gap-1 pt-2" }, Nt = ["onClick"];
|
|
1046
|
+
const Ht = /* @__PURE__ */ O({
|
|
1111
1047
|
__name: "date-input",
|
|
1112
1048
|
props: {
|
|
1113
1049
|
id: {},
|
|
@@ -1133,116 +1069,231 @@ const Nt = /* @__PURE__ */ O({
|
|
|
1133
1069
|
sort: {}
|
|
1134
1070
|
},
|
|
1135
1071
|
emits: ["update:modelValue", "change", "clear"],
|
|
1136
|
-
setup(
|
|
1137
|
-
const t =
|
|
1138
|
-
activeMode:
|
|
1139
|
-
innerValue:
|
|
1140
|
-
onSelectChange:
|
|
1141
|
-
nextClick:
|
|
1142
|
-
prevClick:
|
|
1143
|
-
clear:
|
|
1144
|
-
} =
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
)
|
|
1151
|
-
|
|
1152
|
-
y !== void 0 ? (h.value = y, i("update:modelValue", y)) : (d.value = "", h.value = []);
|
|
1153
|
-
}), a({
|
|
1154
|
-
clear: b,
|
|
1072
|
+
setup(i, { expose: n, emit: v }) {
|
|
1073
|
+
const t = i, s = Me(), r = xt(), d = v, m = _(null), {
|
|
1074
|
+
activeMode: c,
|
|
1075
|
+
innerValue: x,
|
|
1076
|
+
onSelectChange: p,
|
|
1077
|
+
nextClick: a,
|
|
1078
|
+
prevClick: o,
|
|
1079
|
+
clear: h
|
|
1080
|
+
} = Fe({
|
|
1081
|
+
...t,
|
|
1082
|
+
popoverRef: m
|
|
1083
|
+
}, d);
|
|
1084
|
+
return M(() => t.modelValue, (g) => {
|
|
1085
|
+
g !== void 0 ? (x.value = g, d("update:modelValue", g)) : (c.value = "", x.value = []);
|
|
1086
|
+
}), n({
|
|
1087
|
+
clear: h,
|
|
1155
1088
|
popoverRef: m
|
|
1156
|
-
}), (
|
|
1157
|
-
|
|
1158
|
-
e(
|
|
1089
|
+
}), (g, k) => (f(), w(R, null, [
|
|
1090
|
+
g.layout === "inline" ? (f(), w("div", Kt, [
|
|
1091
|
+
e(c) !== "" && e(c) === "range" ? (f(), w("div", Ft, [
|
|
1159
1092
|
T(u("input", {
|
|
1160
1093
|
type: "date",
|
|
1161
|
-
max: e(
|
|
1094
|
+
max: e(x)[1],
|
|
1162
1095
|
locale: "uk-UA",
|
|
1163
|
-
"onUpdate:modelValue": k[0] || (k[0] = (
|
|
1096
|
+
"onUpdate:modelValue": k[0] || (k[0] = (y) => e(x)[0] = y),
|
|
1164
1097
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",
|
|
1165
|
-
disabled:
|
|
1098
|
+
disabled: g.disabled
|
|
1166
1099
|
}, null, 8, jt), [
|
|
1167
|
-
[G, e(
|
|
1100
|
+
[G, e(x)[0]]
|
|
1168
1101
|
]),
|
|
1169
1102
|
T(u("input", {
|
|
1170
1103
|
type: "date",
|
|
1171
|
-
min: e(
|
|
1104
|
+
min: e(x)[0],
|
|
1172
1105
|
locale: "uk-UA",
|
|
1173
|
-
"onUpdate:modelValue": k[1] || (k[1] = (
|
|
1106
|
+
"onUpdate:modelValue": k[1] || (k[1] = (y) => e(x)[1] = y),
|
|
1174
1107
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",
|
|
1175
|
-
disabled:
|
|
1176
|
-
}, null, 8,
|
|
1177
|
-
[G, e(
|
|
1108
|
+
disabled: g.disabled
|
|
1109
|
+
}, null, 8, Lt), [
|
|
1110
|
+
[G, e(x)[1]]
|
|
1178
1111
|
])
|
|
1179
1112
|
])) : V("", !0)
|
|
1180
1113
|
])) : V("", !0),
|
|
1181
1114
|
u("div", {
|
|
1182
|
-
class: D(
|
|
1115
|
+
class: D(g.layout === "popover" ? "space-y-3 p-2" : "flex items-center gap-2")
|
|
1183
1116
|
}, [
|
|
1184
1117
|
u("div", {
|
|
1185
|
-
class: D(
|
|
1118
|
+
class: D(g.layout !== "popover" ? "w-[48%]" : "")
|
|
1186
1119
|
}, [
|
|
1187
|
-
|
|
1120
|
+
g.layout === "popover" ? (f(), w("label", Et, "Від")) : V("", !0),
|
|
1188
1121
|
T(u("input", {
|
|
1189
1122
|
type: "date",
|
|
1190
|
-
max: e(
|
|
1123
|
+
max: e(x)[1],
|
|
1191
1124
|
locale: "uk-UA",
|
|
1192
|
-
"onUpdate:modelValue": k[2] || (k[2] = (
|
|
1125
|
+
"onUpdate:modelValue": k[2] || (k[2] = (y) => e(x)[0] = y),
|
|
1193
1126
|
class: D(e(s)),
|
|
1194
|
-
disabled:
|
|
1195
|
-
}, null, 10,
|
|
1196
|
-
[G, e(
|
|
1127
|
+
disabled: g.disabled
|
|
1128
|
+
}, null, 10, It), [
|
|
1129
|
+
[G, e(x)[0]]
|
|
1197
1130
|
])
|
|
1198
1131
|
], 2),
|
|
1199
|
-
|
|
1132
|
+
g.layout !== "popover" ? (f(), w("label", Tt, " - ")) : V("", !0),
|
|
1200
1133
|
u("div", {
|
|
1201
|
-
class: D(
|
|
1134
|
+
class: D(g.layout !== "popover" ? "w-[48%]" : "")
|
|
1202
1135
|
}, [
|
|
1203
|
-
|
|
1136
|
+
g.layout === "popover" ? (f(), w("label", Ot, "До")) : V("", !0),
|
|
1204
1137
|
T(u("input", {
|
|
1205
1138
|
type: "date",
|
|
1206
|
-
min: e(
|
|
1139
|
+
min: e(x)[0],
|
|
1207
1140
|
locale: "uk-UA",
|
|
1208
|
-
"onUpdate:modelValue": k[3] || (k[3] = (
|
|
1141
|
+
"onUpdate:modelValue": k[3] || (k[3] = (y) => e(x)[1] = y),
|
|
1209
1142
|
class: D(e(s)),
|
|
1210
|
-
disabled:
|
|
1211
|
-
}, null, 10,
|
|
1212
|
-
[G, e(
|
|
1143
|
+
disabled: g.disabled
|
|
1144
|
+
}, null, 10, Ut), [
|
|
1145
|
+
[G, e(x)[1]]
|
|
1213
1146
|
])
|
|
1214
1147
|
], 2)
|
|
1215
1148
|
], 2),
|
|
1216
|
-
u("div",
|
|
1217
|
-
(
|
|
1218
|
-
key:
|
|
1219
|
-
class: D(e(r) + (e(
|
|
1220
|
-
onClick: ($) => e(
|
|
1221
|
-
},
|
|
1149
|
+
u("div", zt, [
|
|
1150
|
+
(f(), w(R, null, W(["today", "week", "month", "quarter", "year"], (y) => u("button", {
|
|
1151
|
+
key: y,
|
|
1152
|
+
class: D(e(r) + (e(c) === y ? " bg-blue-100" : "")),
|
|
1153
|
+
onClick: ($) => e(p)(y)
|
|
1154
|
+
}, F(e(Mt)(y)), 11, Nt)), 64)),
|
|
1222
1155
|
u("button", {
|
|
1223
1156
|
class: D(e(r)),
|
|
1224
1157
|
onClick: k[4] || (k[4] = //@ts-ignore
|
|
1225
|
-
(...
|
|
1158
|
+
(...y) => e(o) && e(o)(...y))
|
|
1226
1159
|
}, " <", 2),
|
|
1227
1160
|
u("button", {
|
|
1228
1161
|
class: D(e(r)),
|
|
1229
1162
|
onClick: k[5] || (k[5] = //@ts-ignore
|
|
1230
|
-
(...
|
|
1163
|
+
(...y) => e(a) && e(a)(...y))
|
|
1231
1164
|
}, " >", 2)
|
|
1232
1165
|
]),
|
|
1233
|
-
(
|
|
1166
|
+
(g.cleanable, V("", !0))
|
|
1234
1167
|
], 64));
|
|
1235
1168
|
}
|
|
1236
|
-
})
|
|
1169
|
+
});
|
|
1170
|
+
function Yt(i, n) {
|
|
1171
|
+
const {
|
|
1172
|
+
api: v,
|
|
1173
|
+
options: t = [],
|
|
1174
|
+
limit: s = 20,
|
|
1175
|
+
dataKey: r = "data"
|
|
1176
|
+
} = i, d = i.multi;
|
|
1177
|
+
function m(B) {
|
|
1178
|
+
return d ? Array.isArray(B) ? B : B ? [B] : [] : Array.isArray(B) ? B[0] : B;
|
|
1179
|
+
}
|
|
1180
|
+
const c = _(m(i.modelValue)), x = _(""), p = _(!1), a = _([]), o = _("id"), h = _("text"), g = _(!1), k = _(i.layout !== "popover" && t.length > s), y = _([]), $ = _(0);
|
|
1181
|
+
function C(B) {
|
|
1182
|
+
const U = B.find(Boolean) ?? {}, q = ["id", "value", "code", "key"].find((oe) => oe in U) ?? "id", se = ["text", "label", "name", "title"].find((oe) => oe in U) ?? "text";
|
|
1183
|
+
return { autoValueKey: q, autoLabelKey: se };
|
|
1184
|
+
}
|
|
1185
|
+
if (t.length > 0) {
|
|
1186
|
+
const B = C(t);
|
|
1187
|
+
o.value = B.autoValueKey, h.value = B.autoLabelKey;
|
|
1188
|
+
}
|
|
1189
|
+
const l = I(() => {
|
|
1190
|
+
if (v) return a.value;
|
|
1191
|
+
const B = a.value;
|
|
1192
|
+
if (i.layout === "popover") return B;
|
|
1193
|
+
if (!x.value)
|
|
1194
|
+
return g.value ? B : B.slice(0, s);
|
|
1195
|
+
const U = x.value.toLowerCase();
|
|
1196
|
+
return B.filter((q) => q[h.value].toLowerCase().includes(U));
|
|
1197
|
+
});
|
|
1198
|
+
let b = null;
|
|
1199
|
+
async function K(B) {
|
|
1200
|
+
if (v) {
|
|
1201
|
+
p.value = !0;
|
|
1202
|
+
try {
|
|
1203
|
+
const U = new URL(v, window.location.origin);
|
|
1204
|
+
U.searchParams.set("json", "1"), U.searchParams.set("key", B), U.searchParams.set("limit", s.toString());
|
|
1205
|
+
const q = await fetch(U.toString());
|
|
1206
|
+
if (!q.ok)
|
|
1207
|
+
throw new Error(`HTTP error! status: ${q.status}`);
|
|
1208
|
+
const se = await q.json();
|
|
1209
|
+
if (a.value = se[r], a.value.length > 0) {
|
|
1210
|
+
const oe = C(a.value);
|
|
1211
|
+
o.value = oe.autoValueKey, h.value = oe.autoLabelKey;
|
|
1212
|
+
}
|
|
1213
|
+
$.value = se.total;
|
|
1214
|
+
} catch (U) {
|
|
1215
|
+
console.error("Failed to fetch remote options:", U);
|
|
1216
|
+
} finally {
|
|
1217
|
+
p.value = !1;
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
M(x, (B) => {
|
|
1222
|
+
v && (b && clearTimeout(b), b = setTimeout(() => {
|
|
1223
|
+
K(B);
|
|
1224
|
+
}, 200));
|
|
1225
|
+
}), M(() => i.modelValue, (B) => {
|
|
1226
|
+
c.value = m(B);
|
|
1227
|
+
}, { immediate: !0 }), v ? K("") : a.value = t;
|
|
1228
|
+
function A(B) {
|
|
1229
|
+
return d && Array.isArray(c.value) ? c.value.includes(B[o.value]) : c.value && c.value === B[o.value];
|
|
1230
|
+
}
|
|
1231
|
+
function Y(B) {
|
|
1232
|
+
if (d && !Array.isArray(c.value) && (c.value = []), d && Array.isArray(c.value)) {
|
|
1233
|
+
const U = c.value.includes(B[o.value]);
|
|
1234
|
+
c.value = U ? c.value.filter((q) => q !== B[o.value]) : [...c.value, B[o.value]], y.value = U ? y.value.filter((q) => q !== B[h.value]) : [...y.value, B[h.value]];
|
|
1235
|
+
} else
|
|
1236
|
+
c.value = B[o.value], y.value = B[h.value];
|
|
1237
|
+
n("update:modelValue", c.value), n("change", { name: i.name, value: c.value });
|
|
1238
|
+
}
|
|
1239
|
+
function L() {
|
|
1240
|
+
d ? (c.value = [], y.value = []) : (c.value = void 0, y.value = []), n("update:modelValue", c.value), n("clear", i.name);
|
|
1241
|
+
}
|
|
1242
|
+
function j() {
|
|
1243
|
+
b && clearTimeout(b), x.value = "", g.value = !1;
|
|
1244
|
+
}
|
|
1245
|
+
function E() {
|
|
1246
|
+
g.value = !g.value;
|
|
1247
|
+
}
|
|
1248
|
+
ce(() => {
|
|
1249
|
+
b && clearTimeout(b);
|
|
1250
|
+
});
|
|
1251
|
+
const Q = _(-1);
|
|
1252
|
+
M(l, () => {
|
|
1253
|
+
Q.value = l.value.length > 0 ? 0 : -1;
|
|
1254
|
+
});
|
|
1255
|
+
function re(B) {
|
|
1256
|
+
const U = l.value.length;
|
|
1257
|
+
if (B.key === "ArrowDown")
|
|
1258
|
+
B.preventDefault(), Q.value = (Q.value + 1) % U;
|
|
1259
|
+
else if (B.key === "ArrowUp")
|
|
1260
|
+
B.preventDefault(), Q.value = (Q.value - 1 + U) % U;
|
|
1261
|
+
else if (B.key === "Enter" && (B.preventDefault(), Q.value >= 0 && Q.value < l.value.length)) {
|
|
1262
|
+
const q = l.value[Q.value];
|
|
1263
|
+
Y(q);
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
return {
|
|
1267
|
+
innerValue: c,
|
|
1268
|
+
searchTerm: x,
|
|
1269
|
+
filteredOptions: l,
|
|
1270
|
+
isSelected: A,
|
|
1271
|
+
selectItem: Y,
|
|
1272
|
+
clear: L,
|
|
1273
|
+
resetSearch: j,
|
|
1274
|
+
toggleShowAll: E,
|
|
1275
|
+
isReqProc: p,
|
|
1276
|
+
showAll: g,
|
|
1277
|
+
isEnableShowAll: k,
|
|
1278
|
+
labelKey: h,
|
|
1279
|
+
valueKey: o,
|
|
1280
|
+
allOptions: a,
|
|
1281
|
+
highlightedIndex: Q,
|
|
1282
|
+
onKeyDown: re,
|
|
1283
|
+
selectedLabels: y,
|
|
1284
|
+
totalCount: $
|
|
1285
|
+
};
|
|
1286
|
+
}
|
|
1287
|
+
const Pt = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relative justify-center" }, Wt = {
|
|
1237
1288
|
key: 0,
|
|
1238
1289
|
class: "w-full"
|
|
1239
|
-
},
|
|
1290
|
+
}, qt = { class: "flex flex-col items-center justify-center p-5 text-center" }, Qt = {
|
|
1240
1291
|
key: 0,
|
|
1241
1292
|
class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
|
|
1242
|
-
},
|
|
1293
|
+
}, Gt = {
|
|
1243
1294
|
key: 1,
|
|
1244
1295
|
class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
|
|
1245
|
-
},
|
|
1296
|
+
}, Xt = /* @__PURE__ */ O({
|
|
1246
1297
|
__name: "select",
|
|
1247
1298
|
props: {
|
|
1248
1299
|
id: {},
|
|
@@ -1268,68 +1319,68 @@ const Nt = /* @__PURE__ */ O({
|
|
|
1268
1319
|
sort: {}
|
|
1269
1320
|
},
|
|
1270
1321
|
emits: ["update:modelValue", "change", "clear"],
|
|
1271
|
-
setup(
|
|
1272
|
-
const t =
|
|
1273
|
-
innerValue:
|
|
1322
|
+
setup(i, { expose: n, emit: v }) {
|
|
1323
|
+
const t = i, s = v, r = _(null), {
|
|
1324
|
+
innerValue: d,
|
|
1274
1325
|
filteredOptions: m,
|
|
1275
|
-
isSelected:
|
|
1276
|
-
selectItem:
|
|
1277
|
-
clear:
|
|
1278
|
-
resetSearch:
|
|
1279
|
-
toggleShowAll:
|
|
1280
|
-
isReqProc:
|
|
1281
|
-
showAll:
|
|
1326
|
+
isSelected: c,
|
|
1327
|
+
selectItem: x,
|
|
1328
|
+
clear: p,
|
|
1329
|
+
resetSearch: a,
|
|
1330
|
+
toggleShowAll: o,
|
|
1331
|
+
isReqProc: h,
|
|
1332
|
+
showAll: g,
|
|
1282
1333
|
isEnableShowAll: k,
|
|
1283
|
-
searchTerm:
|
|
1334
|
+
searchTerm: y,
|
|
1284
1335
|
labelKey: $,
|
|
1285
1336
|
valueKey: C,
|
|
1286
|
-
highlightedIndex:
|
|
1287
|
-
onKeyDown:
|
|
1337
|
+
highlightedIndex: l,
|
|
1338
|
+
onKeyDown: b,
|
|
1288
1339
|
selectedLabels: K,
|
|
1289
1340
|
totalCount: A
|
|
1290
|
-
} =
|
|
1341
|
+
} = Yt({
|
|
1291
1342
|
...t,
|
|
1292
1343
|
modelValue: t.modelValue
|
|
1293
1344
|
}, s);
|
|
1294
|
-
|
|
1295
|
-
|
|
1345
|
+
ne(() => {
|
|
1346
|
+
a();
|
|
1296
1347
|
}), M(
|
|
1297
1348
|
() => t.modelValue,
|
|
1298
1349
|
(L) => {
|
|
1299
|
-
L === void 0 && (t.multi ?
|
|
1350
|
+
L === void 0 && (t.multi ? d.value = [] : d.value = void 0);
|
|
1300
1351
|
}
|
|
1301
1352
|
);
|
|
1302
1353
|
const Y = _([]);
|
|
1303
|
-
return M(
|
|
1354
|
+
return M(l, (L) => {
|
|
1304
1355
|
L >= 0 && Y.value[L] && Y.value[L]?.scrollIntoView({
|
|
1305
1356
|
block: "nearest",
|
|
1306
1357
|
behavior: "smooth"
|
|
1307
1358
|
});
|
|
1308
1359
|
}), M(m, () => {
|
|
1309
1360
|
Y.value = [];
|
|
1310
|
-
}),
|
|
1311
|
-
clear:
|
|
1361
|
+
}), n({
|
|
1362
|
+
clear: p,
|
|
1312
1363
|
inputTextRef: r,
|
|
1313
1364
|
selectedLabels: K
|
|
1314
|
-
}), (L,
|
|
1365
|
+
}), (L, j) => (f(), w("div", {
|
|
1315
1366
|
class: D([L.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
|
|
1316
1367
|
}, [
|
|
1317
|
-
u("div",
|
|
1368
|
+
u("div", Pt, [
|
|
1318
1369
|
T(u("input", {
|
|
1319
|
-
"onUpdate:modelValue":
|
|
1320
|
-
onKeydown:
|
|
1321
|
-
(...E) => e(
|
|
1370
|
+
"onUpdate:modelValue": j[0] || (j[0] = (E) => Ee(y) ? y.value = E : null),
|
|
1371
|
+
onKeydown: j[1] || (j[1] = //@ts-ignore
|
|
1372
|
+
(...E) => e(b) && e(b)(...E)),
|
|
1322
1373
|
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",
|
|
1323
1374
|
placeholder: "Пошук",
|
|
1324
1375
|
type: "text",
|
|
1325
1376
|
ref_key: "inputTextRef",
|
|
1326
1377
|
ref: r
|
|
1327
1378
|
}, null, 544), [
|
|
1328
|
-
[G, e(
|
|
1379
|
+
[G, e(y)]
|
|
1329
1380
|
]),
|
|
1330
|
-
N(
|
|
1331
|
-
N(
|
|
1332
|
-
onClick:
|
|
1381
|
+
N(De, { class: "absolute text-gray-400 -translate-y-1/2 left-4 top-1/2" }),
|
|
1382
|
+
N(Re, {
|
|
1383
|
+
onClick: j[2] || (j[2] = (E) => y.value = ""),
|
|
1333
1384
|
class: "absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"
|
|
1334
1385
|
})
|
|
1335
1386
|
]),
|
|
@@ -1339,134 +1390,80 @@ const Nt = /* @__PURE__ */ O({
|
|
|
1339
1390
|
L.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
|
|
1340
1391
|
])
|
|
1341
1392
|
}, [
|
|
1342
|
-
(
|
|
1393
|
+
(f(!0), w(R, null, W(e(m), (E, Q) => (f(), S(me, {
|
|
1343
1394
|
layout: L.layout,
|
|
1344
1395
|
count: E.count,
|
|
1345
1396
|
label: E[e($)],
|
|
1346
1397
|
color: E.color,
|
|
1347
1398
|
type: L.multi ? "checkbox" : "radio",
|
|
1348
1399
|
value: E[e(C)],
|
|
1349
|
-
"is-selected": e(
|
|
1350
|
-
highlighted: Q === e(
|
|
1351
|
-
onItemClick: (re) => e(
|
|
1400
|
+
"is-selected": e(c)(E),
|
|
1401
|
+
highlighted: Q === e(l),
|
|
1402
|
+
onItemClick: (re) => e(x)(E),
|
|
1352
1403
|
ref_for: !0,
|
|
1353
1404
|
ref: (re) => Y.value[Q] = re?.el
|
|
1354
1405
|
}, null, 8, ["layout", "count", "label", "color", "type", "value", "is-selected", "highlighted", "onItemClick"]))), 256))
|
|
1355
1406
|
], 2),
|
|
1356
|
-
L.type === "select" && e(m).length === 0 && !e(
|
|
1357
|
-
u("div",
|
|
1407
|
+
L.type === "select" && e(m).length === 0 && !e(h) ? (f(), w("div", Wt, [
|
|
1408
|
+
u("div", qt, [
|
|
1358
1409
|
N(ve),
|
|
1359
|
-
|
|
1410
|
+
j[7] || (j[7] = u("div", { class: "max-w-sm mx-auto mt-6" }, [
|
|
1360
1411
|
u("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
|
|
1361
1412
|
u("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
|
|
1362
1413
|
], -1))
|
|
1363
1414
|
])
|
|
1364
1415
|
])) : V("", !0),
|
|
1365
|
-
L.layout !== "popover" && L.type !== "select" ? (
|
|
1366
|
-
!e(
|
|
1416
|
+
L.layout !== "popover" && L.type !== "select" ? (f(), w(R, { key: 1 }, [
|
|
1417
|
+
!e(g) && e(k) ? (f(), w("div", {
|
|
1367
1418
|
key: 0,
|
|
1368
|
-
onClick:
|
|
1369
|
-
(...E) => e(
|
|
1419
|
+
onClick: j[3] || (j[3] = //@ts-ignore
|
|
1420
|
+
(...E) => e(o) && e(o)(...E)),
|
|
1370
1421
|
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"
|
|
1371
1422
|
}, [
|
|
1372
|
-
|
|
1423
|
+
j[8] || (j[8] = z(" Показати більше ")),
|
|
1373
1424
|
N(ie)
|
|
1374
1425
|
])) : V("", !0),
|
|
1375
|
-
e(
|
|
1426
|
+
e(g) ? (f(), w("div", {
|
|
1376
1427
|
key: 1,
|
|
1377
|
-
onClick:
|
|
1378
|
-
(...E) => e(
|
|
1428
|
+
onClick: j[4] || (j[4] = //@ts-ignore
|
|
1429
|
+
(...E) => e(o) && e(o)(...E)),
|
|
1379
1430
|
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"
|
|
1380
1431
|
}, [
|
|
1381
|
-
|
|
1382
|
-
N(
|
|
1432
|
+
j[9] || (j[9] = z(" Показати менше ")),
|
|
1433
|
+
N(ye)
|
|
1383
1434
|
])) : V("", !0)
|
|
1384
1435
|
], 64)) : V("", !0),
|
|
1385
|
-
L.cleanable ? (
|
|
1386
|
-
L.layout === "inline" ? (
|
|
1387
|
-
z(
|
|
1436
|
+
L.cleanable ? (f(), w(R, { key: 2 }, [
|
|
1437
|
+
L.layout === "inline" ? (f(), w("div", Qt, [
|
|
1438
|
+
z(F(L.multi && Array.isArray(e(d)) ? e(d)?.length : e(d) !== void 0 && (e(d) || e(d) === null) ? 1 : 0) + " з " + F(e(A)) + " обрано ", 1),
|
|
1388
1439
|
T(u("button", {
|
|
1389
1440
|
class: "text-gray-600 hover:text-gray-800",
|
|
1390
|
-
onClick:
|
|
1391
|
-
(...E) => e(
|
|
1441
|
+
onClick: j[5] || (j[5] = //@ts-ignore
|
|
1442
|
+
(...E) => e(p) && e(p)(...E))
|
|
1392
1443
|
}, " Очистити ", 512), [
|
|
1393
|
-
[X, e(
|
|
1444
|
+
[X, e(d) !== "" && e(d) !== void 0 || e(d)]
|
|
1394
1445
|
])
|
|
1395
1446
|
])) : V("", !0),
|
|
1396
|
-
L.layout === "popover" ? (
|
|
1397
|
-
u("span", null,
|
|
1447
|
+
L.layout === "popover" ? (f(), w("div", Gt, [
|
|
1448
|
+
u("span", null, F(L.multi && Array.isArray(e(d)) ? e(d)?.length : e(d) !== void 0 && (e(d) || e(d) === null) ? 1 : 0) + " з " + F(e(A)) + " обрано", 1),
|
|
1398
1449
|
T(u("button", {
|
|
1399
1450
|
class: "text-gray-600 hover:text-gray-800",
|
|
1400
|
-
onClick:
|
|
1401
|
-
(...E) => e(
|
|
1451
|
+
onClick: j[6] || (j[6] = //@ts-ignore
|
|
1452
|
+
(...E) => e(p) && e(p)(...E))
|
|
1402
1453
|
}, " Очистити ", 512), [
|
|
1403
|
-
[X, e(
|
|
1454
|
+
[X, e(d) !== "" && e(d) !== void 0 || e(d)]
|
|
1404
1455
|
])
|
|
1405
1456
|
])) : V("", !0)
|
|
1406
1457
|
], 64)) : V("", !0)
|
|
1407
1458
|
], 2));
|
|
1408
1459
|
}
|
|
1409
|
-
})
|
|
1410
|
-
function Gt(p, a) {
|
|
1411
|
-
const {
|
|
1412
|
-
options: v = [],
|
|
1413
|
-
limit: t = 20
|
|
1414
|
-
} = p;
|
|
1415
|
-
function s(o) {
|
|
1416
|
-
return Array.isArray(o) ? o : o ? [o] : [];
|
|
1417
|
-
}
|
|
1418
|
-
const r = _(s(p.modelValue)), i = _(""), m = _(!1), d = _([]), h = _("id"), f = _("text"), n = _(!1), l = _(p.layout !== "popover" && v.length > t);
|
|
1419
|
-
function b(o) {
|
|
1420
|
-
const x = o.find(Boolean) ?? {}, K = ["id", "value", "code", "key"].find((Y) => Y in x) ?? "id", A = ["text", "label", "name", "title"].find((Y) => Y in x) ?? "text";
|
|
1421
|
-
return { autoValueKey: K, autoLabelKey: A };
|
|
1422
|
-
}
|
|
1423
|
-
if (v.length > 0) {
|
|
1424
|
-
const o = b(v);
|
|
1425
|
-
h.value = o.autoValueKey, f.value = o.autoLabelKey;
|
|
1426
|
-
}
|
|
1427
|
-
const y = I(() => {
|
|
1428
|
-
const o = d.value;
|
|
1429
|
-
return p.layout === "popover" || n.value ? o : o.slice(0, t);
|
|
1430
|
-
});
|
|
1431
|
-
M(() => p.modelValue, (o) => {
|
|
1432
|
-
r.value = s(o);
|
|
1433
|
-
}, { immediate: !0 }), d.value = [...v].sort((o, x) => p.sort === "count" ? x.count && o.count ? x.count - o.count : 0 : p.sort === "name" ? String(o[f.value]).localeCompare(String(x[f.value])) : 0);
|
|
1434
|
-
function k(o) {
|
|
1435
|
-
return r.value && r.value.includes(o[h.value]);
|
|
1436
|
-
}
|
|
1437
|
-
function g(o) {
|
|
1438
|
-
const x = r.value.includes(o[h.value]);
|
|
1439
|
-
r.value = x ? r.value.filter((K) => K !== o[h.value]) : [...r.value, o[h.value]], a("update:modelValue", r.value), a("change", { name: p.name, value: r.value });
|
|
1440
|
-
}
|
|
1441
|
-
function $() {
|
|
1442
|
-
r.value = [], a("update:modelValue", r.value), a("clear", p.name);
|
|
1443
|
-
}
|
|
1444
|
-
function C() {
|
|
1445
|
-
n.value = !n.value;
|
|
1446
|
-
}
|
|
1447
|
-
return {
|
|
1448
|
-
innerValue: r,
|
|
1449
|
-
searchTerm: i,
|
|
1450
|
-
filteredOptions: y,
|
|
1451
|
-
isSelected: k,
|
|
1452
|
-
selectItem: g,
|
|
1453
|
-
clear: $,
|
|
1454
|
-
toggleShowAll: C,
|
|
1455
|
-
isReqProc: m,
|
|
1456
|
-
showAll: n,
|
|
1457
|
-
isEnableShowAll: l,
|
|
1458
|
-
labelKey: f,
|
|
1459
|
-
valueKey: h,
|
|
1460
|
-
allOptions: d
|
|
1461
|
-
};
|
|
1462
|
-
}
|
|
1463
|
-
const Xt = ["for", "onClick"], Jt = ["id", "name", "value"], Zt = { class: "block" }, el = {
|
|
1460
|
+
}), Jt = ["for", "onClick"], Zt = ["id", "name", "value"], el = { class: "block" }, tl = {
|
|
1464
1461
|
key: 0,
|
|
1465
1462
|
class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
|
|
1466
|
-
},
|
|
1463
|
+
}, ll = {
|
|
1467
1464
|
key: 1,
|
|
1468
1465
|
class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
|
|
1469
|
-
},
|
|
1466
|
+
}, ol = /* @__PURE__ */ O({
|
|
1470
1467
|
__name: "tag-field",
|
|
1471
1468
|
props: {
|
|
1472
1469
|
id: {},
|
|
@@ -1492,66 +1489,66 @@ const Xt = ["for", "onClick"], Jt = ["id", "name", "value"], Zt = { class: "bloc
|
|
|
1492
1489
|
sort: {}
|
|
1493
1490
|
},
|
|
1494
1491
|
emits: ["update:modelValue", "change", "clear"],
|
|
1495
|
-
setup(
|
|
1496
|
-
const t =
|
|
1492
|
+
setup(i, { expose: n, emit: v }) {
|
|
1493
|
+
const t = i, s = v, {
|
|
1497
1494
|
innerValue: r,
|
|
1498
|
-
isSelected:
|
|
1495
|
+
isSelected: d,
|
|
1499
1496
|
selectItem: m,
|
|
1500
|
-
clear:
|
|
1501
|
-
labelKey:
|
|
1502
|
-
valueKey:
|
|
1503
|
-
allOptions:
|
|
1504
|
-
} = t.multi ?
|
|
1497
|
+
clear: c,
|
|
1498
|
+
labelKey: x,
|
|
1499
|
+
valueKey: p,
|
|
1500
|
+
allOptions: a
|
|
1501
|
+
} = t.multi ? Se({
|
|
1505
1502
|
...t,
|
|
1506
1503
|
modelValue: t.modelValue ?? t.default ?? []
|
|
1507
|
-
}, s) :
|
|
1504
|
+
}, s) : Be({
|
|
1508
1505
|
...t,
|
|
1509
1506
|
modelValue: t.modelValue !== void 0 ? t.modelValue : t.default ?? ""
|
|
1510
1507
|
}, s);
|
|
1511
|
-
return
|
|
1512
|
-
clear:
|
|
1508
|
+
return n({
|
|
1509
|
+
clear: c
|
|
1513
1510
|
}), M(
|
|
1514
1511
|
() => t.modelValue,
|
|
1515
|
-
(
|
|
1516
|
-
|
|
1512
|
+
(o) => {
|
|
1513
|
+
o === void 0 && (t.multi ? r.value = [] : r.value = void 0);
|
|
1517
1514
|
}
|
|
1518
|
-
), (
|
|
1515
|
+
), (o, h) => (f(), w(R, null, [
|
|
1519
1516
|
u("div", {
|
|
1520
|
-
class: D(["grid grid-cols-3 gap-2 mx-[1px]",
|
|
1517
|
+
class: D(["grid grid-cols-3 gap-2 mx-[1px]", o.layout === "popover" ? "m-1" : "mb-1"])
|
|
1521
1518
|
}, [
|
|
1522
|
-
(
|
|
1523
|
-
key: `item-${
|
|
1524
|
-
for: `item-${
|
|
1525
|
-
onClick:
|
|
1526
|
-
class: D([e(
|
|
1519
|
+
(f(!0), w(R, null, W(e(a), (g) => (f(), w("label", {
|
|
1520
|
+
key: `item-${g[e(p)]}`,
|
|
1521
|
+
for: `item-${g[e(p)]}`,
|
|
1522
|
+
onClick: _e((k) => e(m)(g), ["stop", "prevent"]),
|
|
1523
|
+
class: D([e(d)(g) ? "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%)]"])
|
|
1527
1524
|
}, [
|
|
1528
1525
|
u("input", {
|
|
1529
1526
|
type: "checkbox",
|
|
1530
|
-
id: `item-${
|
|
1527
|
+
id: `item-${g[e(p)]}`,
|
|
1531
1528
|
class: "hidden w4poy border-gray-200 g41z1 g22e3 axcnw dark:text-indigo-500 dark:border-neutral-700 dark:focus:ring-neutral-900",
|
|
1532
|
-
name: `item-${
|
|
1533
|
-
value:
|
|
1534
|
-
}, null, 8,
|
|
1535
|
-
u("span",
|
|
1536
|
-
], 10,
|
|
1529
|
+
name: `item-${g[e(p)]}`,
|
|
1530
|
+
value: g[e(p)]
|
|
1531
|
+
}, null, 8, Zt),
|
|
1532
|
+
u("span", el, F(g[e(x)]), 1)
|
|
1533
|
+
], 10, Jt))), 128))
|
|
1537
1534
|
], 2),
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
z(
|
|
1535
|
+
o.cleanable ? (f(), w(R, { key: 0 }, [
|
|
1536
|
+
o.layout === "inline" ? (f(), w("div", tl, [
|
|
1537
|
+
z(F(o.multi && Array.isArray(e(r)) ? e(r)?.length : e(r) !== void 0 && (e(r) || e(r) === null) ? 1 : 0) + " з " + F(e(a).length) + " обрано ", 1),
|
|
1541
1538
|
T(u("button", {
|
|
1542
1539
|
class: "text-gray-600 hover:text-gray-800",
|
|
1543
|
-
onClick:
|
|
1544
|
-
(...
|
|
1540
|
+
onClick: h[0] || (h[0] = //@ts-ignore
|
|
1541
|
+
(...g) => e(c) && e(c)(...g))
|
|
1545
1542
|
}, " Очистити ", 512), [
|
|
1546
1543
|
[X, e(r) !== "" && e(r) !== void 0 || e(r)]
|
|
1547
1544
|
])
|
|
1548
1545
|
])) : V("", !0),
|
|
1549
|
-
|
|
1550
|
-
u("span", null,
|
|
1546
|
+
o.layout === "popover" ? (f(), w("div", ll, [
|
|
1547
|
+
u("span", null, F(o.multi && Array.isArray(e(r)) ? e(r)?.length : e(r) !== void 0 && (e(r) || e(r) === null) ? 1 : 0) + " з " + F(e(a).length) + " обрано", 1),
|
|
1551
1548
|
T(u("button", {
|
|
1552
1549
|
class: "text-gray-600 hover:text-gray-800",
|
|
1553
|
-
onClick:
|
|
1554
|
-
(...
|
|
1550
|
+
onClick: h[1] || (h[1] = //@ts-ignore
|
|
1551
|
+
(...g) => e(c) && e(c)(...g))
|
|
1555
1552
|
}, " Очистити ", 512), [
|
|
1556
1553
|
[X, e(r) !== void 0 && e(r) !== "" || e(r)]
|
|
1557
1554
|
])
|
|
@@ -1559,7 +1556,7 @@ const Xt = ["for", "onClick"], Jt = ["id", "name", "value"], Zt = { class: "bloc
|
|
|
1559
1556
|
], 64)) : V("", !0)
|
|
1560
1557
|
], 64));
|
|
1561
1558
|
}
|
|
1562
|
-
}),
|
|
1559
|
+
}), al = {}, nl = {
|
|
1563
1560
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1564
1561
|
width: "24",
|
|
1565
1562
|
height: "24",
|
|
@@ -1571,12 +1568,12 @@ const Xt = ["for", "onClick"], Jt = ["id", "name", "value"], Zt = { class: "bloc
|
|
|
1571
1568
|
"stroke-linejoin": "round",
|
|
1572
1569
|
class: "text-blue-600 w-[16px] h-[16px]"
|
|
1573
1570
|
};
|
|
1574
|
-
function
|
|
1575
|
-
return
|
|
1571
|
+
function rl(i, n) {
|
|
1572
|
+
return f(), w("svg", nl, n[0] || (n[0] = [
|
|
1576
1573
|
u("path", { d: "M20 6 9 17l-5-5" }, null, -1)
|
|
1577
1574
|
]));
|
|
1578
1575
|
}
|
|
1579
|
-
const te = /* @__PURE__ */ J(
|
|
1576
|
+
const te = /* @__PURE__ */ J(al, [["render", rl]]), sl = {}, ul = {
|
|
1580
1577
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1581
1578
|
width: "15px",
|
|
1582
1579
|
height: "24",
|
|
@@ -1588,8 +1585,8 @@ const te = /* @__PURE__ */ J(ol, [["render", al]]), rl = {}, sl = {
|
|
|
1588
1585
|
"stroke-linejoin": "round",
|
|
1589
1586
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[90deg]"
|
|
1590
1587
|
};
|
|
1591
|
-
function
|
|
1592
|
-
return
|
|
1588
|
+
function il(i, n) {
|
|
1589
|
+
return f(), w("svg", ul, n[0] || (n[0] = [
|
|
1593
1590
|
u("path", {
|
|
1594
1591
|
stroke: "none",
|
|
1595
1592
|
d: "M0 0h24v24H0z",
|
|
@@ -1598,7 +1595,7 @@ function ul(p, a) {
|
|
|
1598
1595
|
u("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
1599
1596
|
]));
|
|
1600
1597
|
}
|
|
1601
|
-
const
|
|
1598
|
+
const dl = /* @__PURE__ */ J(sl, [["render", il]]), cl = {}, fl = {
|
|
1602
1599
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1603
1600
|
width: "15px",
|
|
1604
1601
|
height: "24",
|
|
@@ -1610,8 +1607,8 @@ const il = /* @__PURE__ */ J(rl, [["render", ul]]), dl = {}, cl = {
|
|
|
1610
1607
|
"stroke-linejoin": "round",
|
|
1611
1608
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[270deg]"
|
|
1612
1609
|
};
|
|
1613
|
-
function
|
|
1614
|
-
return
|
|
1610
|
+
function pl(i, n) {
|
|
1611
|
+
return f(), w("svg", fl, n[0] || (n[0] = [
|
|
1615
1612
|
u("path", {
|
|
1616
1613
|
stroke: "none",
|
|
1617
1614
|
d: "M0 0h24v24H0z",
|
|
@@ -1620,11 +1617,11 @@ function fl(p, a) {
|
|
|
1620
1617
|
u("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
1621
1618
|
]));
|
|
1622
1619
|
}
|
|
1623
|
-
const
|
|
1620
|
+
const ml = /* @__PURE__ */ J(cl, [["render", pl]]), vl = { class: "flex" }, yl = { class: "mb-1" }, gl = { class: "mb-1" }, bl = { class: "inline-flex rounded-lg shrink-0 pl-1" }, hl = { class: "inline-flex rounded-lg shrink-0 pl-1" }, xl = {
|
|
1624
1621
|
key: 1,
|
|
1625
1622
|
class: "flex gap-1 !w-[75%] rounded-lg"
|
|
1626
|
-
},
|
|
1627
|
-
const
|
|
1623
|
+
}, kl = ["max", "disabled"], wl = ["min", "disabled"];
|
|
1624
|
+
const Cl = /* @__PURE__ */ O({
|
|
1628
1625
|
__name: "date-input-inline",
|
|
1629
1626
|
props: {
|
|
1630
1627
|
id: {},
|
|
@@ -1650,177 +1647,177 @@ const wl = /* @__PURE__ */ O({
|
|
|
1650
1647
|
sort: {}
|
|
1651
1648
|
},
|
|
1652
1649
|
emits: ["update:modelValue", "change", "clear"],
|
|
1653
|
-
setup(
|
|
1654
|
-
const t =
|
|
1655
|
-
activeMode:
|
|
1650
|
+
setup(i, { expose: n, emit: v }) {
|
|
1651
|
+
const t = i, s = v, r = _(null), {
|
|
1652
|
+
activeMode: d,
|
|
1656
1653
|
innerValue: m,
|
|
1657
|
-
onSelectChange:
|
|
1658
|
-
nextClick:
|
|
1659
|
-
prevClick:
|
|
1660
|
-
currentLabel:
|
|
1661
|
-
clear:
|
|
1662
|
-
} =
|
|
1654
|
+
onSelectChange: c,
|
|
1655
|
+
nextClick: x,
|
|
1656
|
+
prevClick: p,
|
|
1657
|
+
currentLabel: a,
|
|
1658
|
+
clear: o
|
|
1659
|
+
} = Fe({
|
|
1663
1660
|
...t,
|
|
1664
1661
|
popoverRef: r
|
|
1665
1662
|
}, s);
|
|
1666
|
-
return M(() => t.modelValue, (
|
|
1667
|
-
|
|
1668
|
-
}),
|
|
1669
|
-
clear:
|
|
1663
|
+
return M(() => t.modelValue, (h) => {
|
|
1664
|
+
h !== void 0 ? (m.value = h, s("update:modelValue", h)) : (d.value = "", m.value = []);
|
|
1665
|
+
}), n({
|
|
1666
|
+
clear: o,
|
|
1670
1667
|
popoverRef: r
|
|
1671
|
-
}), (
|
|
1672
|
-
u("div",
|
|
1673
|
-
N(
|
|
1668
|
+
}), (h, g) => (f(), w(R, null, [
|
|
1669
|
+
u("div", vl, [
|
|
1670
|
+
N(ge, {
|
|
1674
1671
|
ref_key: "popoverRef",
|
|
1675
1672
|
ref: r,
|
|
1676
|
-
label: e(
|
|
1673
|
+
label: e(a),
|
|
1677
1674
|
"current-value": e(m),
|
|
1678
|
-
mode:
|
|
1679
|
-
onClear: e(
|
|
1680
|
-
layout:
|
|
1675
|
+
mode: h.mode,
|
|
1676
|
+
onClear: e(o),
|
|
1677
|
+
layout: h.layout
|
|
1681
1678
|
}, {
|
|
1682
1679
|
default: le(() => [
|
|
1683
1680
|
u("div", null, [
|
|
1684
1681
|
u("button", {
|
|
1685
1682
|
type: "button",
|
|
1686
|
-
onClick:
|
|
1683
|
+
onClick: g[0] || (g[0] = (k) => e(c)("range")),
|
|
1687
1684
|
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"
|
|
1688
1685
|
}, [
|
|
1689
|
-
|
|
1690
|
-
e(
|
|
1686
|
+
g[12] || (g[12] = z(" Період ")),
|
|
1687
|
+
e(d) === "range" ? (f(), S(te, { key: 0 })) : V("", !0)
|
|
1691
1688
|
])
|
|
1692
1689
|
]),
|
|
1693
|
-
|
|
1690
|
+
g[19] || (g[19] = u("div", null, [
|
|
1694
1691
|
u("div", { class: "pt-1 mt-1 border-t" })
|
|
1695
1692
|
], -1)),
|
|
1696
1693
|
u("div", null, [
|
|
1697
1694
|
u("button", {
|
|
1698
1695
|
type: "button",
|
|
1699
|
-
onClick:
|
|
1696
|
+
onClick: g[1] || (g[1] = (k) => e(c)("today")),
|
|
1700
1697
|
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"
|
|
1701
1698
|
}, [
|
|
1702
|
-
|
|
1703
|
-
e(
|
|
1699
|
+
g[13] || (g[13] = z(" Сьогодні ")),
|
|
1700
|
+
e(d) === "today" ? (f(), S(te, { key: 0 })) : V("", !0)
|
|
1704
1701
|
])
|
|
1705
1702
|
]),
|
|
1706
1703
|
u("div", null, [
|
|
1707
1704
|
u("button", {
|
|
1708
1705
|
type: "button",
|
|
1709
|
-
onClick:
|
|
1706
|
+
onClick: g[2] || (g[2] = (k) => e(c)("week")),
|
|
1710
1707
|
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"
|
|
1711
1708
|
}, [
|
|
1712
|
-
|
|
1713
|
-
e(
|
|
1709
|
+
g[14] || (g[14] = z(" Тиждень ")),
|
|
1710
|
+
e(d) === "week" ? (f(), S(te, { key: 0 })) : V("", !0)
|
|
1714
1711
|
])
|
|
1715
1712
|
]),
|
|
1716
1713
|
u("div", null, [
|
|
1717
1714
|
u("button", {
|
|
1718
1715
|
type: "button",
|
|
1719
|
-
onClick:
|
|
1716
|
+
onClick: g[3] || (g[3] = (k) => e(c)("month")),
|
|
1720
1717
|
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"
|
|
1721
1718
|
}, [
|
|
1722
|
-
|
|
1723
|
-
e(
|
|
1719
|
+
g[15] || (g[15] = z(" Місяць ")),
|
|
1720
|
+
e(d) === "month" ? (f(), S(te, { key: 0 })) : V("", !0)
|
|
1724
1721
|
])
|
|
1725
1722
|
]),
|
|
1726
1723
|
u("div", null, [
|
|
1727
1724
|
u("button", {
|
|
1728
1725
|
type: "button",
|
|
1729
|
-
onClick:
|
|
1726
|
+
onClick: g[4] || (g[4] = (k) => e(c)("quarter")),
|
|
1730
1727
|
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"
|
|
1731
1728
|
}, [
|
|
1732
|
-
|
|
1733
|
-
e(
|
|
1729
|
+
g[16] || (g[16] = z(" Квартал ")),
|
|
1730
|
+
e(d) === "quarter" ? (f(), S(te, { key: 0 })) : V("", !0)
|
|
1734
1731
|
])
|
|
1735
1732
|
]),
|
|
1736
|
-
u("div",
|
|
1733
|
+
u("div", yl, [
|
|
1737
1734
|
u("button", {
|
|
1738
1735
|
type: "button",
|
|
1739
|
-
onClick:
|
|
1736
|
+
onClick: g[5] || (g[5] = (k) => e(c)("year")),
|
|
1740
1737
|
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"
|
|
1741
1738
|
}, [
|
|
1742
|
-
|
|
1743
|
-
e(
|
|
1739
|
+
g[17] || (g[17] = z(" Рік ")),
|
|
1740
|
+
e(d) === "year" ? (f(), S(te, { key: 0 })) : V("", !0)
|
|
1744
1741
|
])
|
|
1745
1742
|
]),
|
|
1746
1743
|
u("div", gl, [
|
|
1747
1744
|
u("button", {
|
|
1748
1745
|
type: "button",
|
|
1749
|
-
onClick:
|
|
1746
|
+
onClick: g[6] || (g[6] = (k) => e(o)()),
|
|
1750
1747
|
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"
|
|
1751
1748
|
}, [
|
|
1752
|
-
|
|
1753
|
-
e(m)[0] ? V("", !0) : (
|
|
1749
|
+
g[18] || (g[18] = z(" Весь час ")),
|
|
1750
|
+
e(m)[0] ? V("", !0) : (f(), S(te, { key: 0 }))
|
|
1754
1751
|
])
|
|
1755
1752
|
])
|
|
1756
1753
|
]),
|
|
1757
1754
|
_: 1,
|
|
1758
1755
|
__: [19]
|
|
1759
1756
|
}, 8, ["label", "current-value", "mode", "onClear", "layout"]),
|
|
1760
|
-
e(
|
|
1761
|
-
u("div",
|
|
1757
|
+
e(d) !== "" && e(d) !== "range" && e(d) !== "last_7_days" ? (f(), w(R, { key: 0 }, [
|
|
1758
|
+
u("div", bl, [
|
|
1762
1759
|
u("button", {
|
|
1763
1760
|
type: "button",
|
|
1764
1761
|
title: "Попередній період",
|
|
1765
1762
|
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",
|
|
1766
|
-
onClick:
|
|
1767
|
-
(...k) => e(
|
|
1763
|
+
onClick: g[7] || (g[7] = //@ts-ignore
|
|
1764
|
+
(...k) => e(p) && e(p)(...k))
|
|
1768
1765
|
}, [
|
|
1769
|
-
N(
|
|
1766
|
+
N(dl)
|
|
1770
1767
|
])
|
|
1771
1768
|
]),
|
|
1772
|
-
u("div",
|
|
1769
|
+
u("div", hl, [
|
|
1773
1770
|
u("button", {
|
|
1774
1771
|
type: "button",
|
|
1775
1772
|
title: "Наступний період",
|
|
1776
1773
|
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",
|
|
1777
|
-
onClick:
|
|
1778
|
-
(...k) => e(
|
|
1774
|
+
onClick: g[8] || (g[8] = //@ts-ignore
|
|
1775
|
+
(...k) => e(x) && e(x)(...k))
|
|
1779
1776
|
}, [
|
|
1780
|
-
N(
|
|
1777
|
+
N(ml)
|
|
1781
1778
|
])
|
|
1782
1779
|
])
|
|
1783
1780
|
], 64)) : V("", !0),
|
|
1784
|
-
e(
|
|
1781
|
+
e(d) !== "" && e(d) === "range" ? (f(), w("div", xl, [
|
|
1785
1782
|
T(u("input", {
|
|
1786
1783
|
type: "date",
|
|
1787
1784
|
max: e(m)[1],
|
|
1788
1785
|
locale: "uk-UA",
|
|
1789
|
-
"onUpdate:modelValue":
|
|
1786
|
+
"onUpdate:modelValue": g[9] || (g[9] = (k) => e(m)[0] = k),
|
|
1790
1787
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",
|
|
1791
|
-
disabled:
|
|
1792
|
-
}, null, 8,
|
|
1788
|
+
disabled: h.disabled
|
|
1789
|
+
}, null, 8, kl), [
|
|
1793
1790
|
[G, e(m)[0]]
|
|
1794
1791
|
]),
|
|
1795
1792
|
T(u("input", {
|
|
1796
1793
|
type: "date",
|
|
1797
1794
|
min: e(m)[0],
|
|
1798
1795
|
locale: "uk-UA",
|
|
1799
|
-
"onUpdate:modelValue":
|
|
1796
|
+
"onUpdate:modelValue": g[10] || (g[10] = (k) => e(m)[1] = k),
|
|
1800
1797
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",
|
|
1801
|
-
disabled:
|
|
1802
|
-
}, null, 8,
|
|
1798
|
+
disabled: h.disabled
|
|
1799
|
+
}, null, 8, wl), [
|
|
1803
1800
|
[G, e(m)[1]]
|
|
1804
1801
|
])
|
|
1805
1802
|
])) : V("", !0)
|
|
1806
1803
|
]),
|
|
1807
|
-
(
|
|
1804
|
+
(h.cleanable, V("", !0))
|
|
1808
1805
|
], 64));
|
|
1809
1806
|
}
|
|
1810
1807
|
}), ke = {
|
|
1811
1808
|
radio: nt,
|
|
1812
1809
|
checkbox: xe,
|
|
1813
1810
|
check: xe,
|
|
1814
|
-
text:
|
|
1815
|
-
range:
|
|
1816
|
-
date:
|
|
1817
|
-
select:
|
|
1818
|
-
tag:
|
|
1819
|
-
"date:inline":
|
|
1811
|
+
text: bt,
|
|
1812
|
+
range: At,
|
|
1813
|
+
date: Ht,
|
|
1814
|
+
select: Xt,
|
|
1815
|
+
tag: ol,
|
|
1816
|
+
"date:inline": Cl
|
|
1820
1817
|
};
|
|
1821
|
-
function be(
|
|
1818
|
+
function be(i, n) {
|
|
1822
1819
|
let v;
|
|
1823
|
-
switch (
|
|
1820
|
+
switch (i.toLowerCase()) {
|
|
1824
1821
|
case "autocomplete":
|
|
1825
1822
|
v = "select";
|
|
1826
1823
|
break;
|
|
@@ -1828,14 +1825,14 @@ function be(p, a) {
|
|
|
1828
1825
|
v = "checkbox";
|
|
1829
1826
|
break;
|
|
1830
1827
|
default:
|
|
1831
|
-
v =
|
|
1828
|
+
v = i?.toString().toLowerCase();
|
|
1832
1829
|
}
|
|
1833
|
-
return v === "date" &&
|
|
1830
|
+
return v === "date" && n && n === "inline" && (v = "date:inline"), {
|
|
1834
1831
|
component: ke[v] || ke.text,
|
|
1835
1832
|
type: v
|
|
1836
1833
|
};
|
|
1837
1834
|
}
|
|
1838
|
-
const
|
|
1835
|
+
const Vl = {}, _l = {
|
|
1839
1836
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1840
1837
|
width: "15px",
|
|
1841
1838
|
height: "24",
|
|
@@ -1847,8 +1844,8 @@ const Cl = {}, Vl = {
|
|
|
1847
1844
|
"stroke-linejoin": "round",
|
|
1848
1845
|
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"
|
|
1849
1846
|
};
|
|
1850
|
-
function
|
|
1851
|
-
return
|
|
1847
|
+
function $l(i, n) {
|
|
1848
|
+
return f(), w("svg", _l, n[0] || (n[0] = [
|
|
1852
1849
|
u("path", {
|
|
1853
1850
|
stroke: "none",
|
|
1854
1851
|
d: "M0 0h24v24H0z",
|
|
@@ -1858,7 +1855,7 @@ function _l(p, a) {
|
|
|
1858
1855
|
u("path", { d: "M20 4v5h-5" }, null, -1)
|
|
1859
1856
|
]));
|
|
1860
1857
|
}
|
|
1861
|
-
const
|
|
1858
|
+
const Al = /* @__PURE__ */ J(Vl, [["render", $l]]), Bl = { style: { display: "inline-flex", margin: "0px", width: "100%" } }, Sl = { class: "relative w-full mb-2 p-4 bg-white rounded-lg shadow-sm" }, Dl = { class: "block mb-3 text-sm font-medium text-gray-800 dark:text-neutral-200" }, Rl = { class: "flex items-center" }, Ml = { class: "text-sm font-medium max-w-[80%] text-gray-800 flex items-center gap-x-1" }, Kl = { class: "filter-layout__body" }, Fl = /* @__PURE__ */ O({
|
|
1862
1859
|
__name: "vertical-layout",
|
|
1863
1860
|
props: {
|
|
1864
1861
|
id: {},
|
|
@@ -1884,69 +1881,69 @@ const $l = /* @__PURE__ */ J(Cl, [["render", _l]]), Al = { style: { display: "in
|
|
|
1884
1881
|
sort: {}
|
|
1885
1882
|
},
|
|
1886
1883
|
emits: ["update:modelValue", "change", "clear"],
|
|
1887
|
-
setup(
|
|
1888
|
-
const t =
|
|
1884
|
+
setup(i, { expose: n, emit: v }) {
|
|
1885
|
+
const t = i, s = v, r = _(), d = be(t.type, t.layout), m = I({
|
|
1889
1886
|
get: () => t.modelValue,
|
|
1890
|
-
set: (
|
|
1887
|
+
set: (a) => s("update:modelValue", a)
|
|
1891
1888
|
});
|
|
1892
|
-
function
|
|
1893
|
-
s("clear",
|
|
1889
|
+
function c(a) {
|
|
1890
|
+
s("clear", a);
|
|
1894
1891
|
}
|
|
1895
|
-
function
|
|
1896
|
-
s("change", { name:
|
|
1892
|
+
function x(a, o) {
|
|
1893
|
+
s("change", { name: a, value: o }), t.modelValue !== void 0 && s("update:modelValue", o);
|
|
1897
1894
|
}
|
|
1898
|
-
function
|
|
1895
|
+
function p() {
|
|
1899
1896
|
r.value && r.value.clear(), s("clear", t.name);
|
|
1900
1897
|
}
|
|
1901
1898
|
return M(
|
|
1902
1899
|
() => t.default,
|
|
1903
|
-
(
|
|
1904
|
-
m.value =
|
|
1900
|
+
(a) => {
|
|
1901
|
+
m.value = a;
|
|
1905
1902
|
}
|
|
1906
1903
|
), M(
|
|
1907
1904
|
() => t.modelValue,
|
|
1908
|
-
(
|
|
1909
|
-
m.value =
|
|
1905
|
+
(a) => {
|
|
1906
|
+
m.value = a;
|
|
1910
1907
|
}
|
|
1911
|
-
),
|
|
1908
|
+
), n({
|
|
1912
1909
|
filterRef: r
|
|
1913
|
-
}), (
|
|
1914
|
-
u("div",
|
|
1915
|
-
u("div",
|
|
1916
|
-
u("div",
|
|
1917
|
-
u("span",
|
|
1910
|
+
}), (a, o) => (f(), w("div", Bl, [
|
|
1911
|
+
u("div", Sl, [
|
|
1912
|
+
u("div", Dl, [
|
|
1913
|
+
u("div", Rl, [
|
|
1914
|
+
u("span", Ml, F(a.label), 1)
|
|
1918
1915
|
]),
|
|
1919
|
-
typeof m.value == "string" && m.value.trim() !== "" || Array.isArray(m.value) && m.value.length > 0 && m.value.some((
|
|
1916
|
+
typeof m.value == "string" && m.value.trim() !== "" || Array.isArray(m.value) && m.value.length > 0 && m.value.some((h) => h !== void 0) || m.value === null ? (f(), S(Al, {
|
|
1920
1917
|
key: 0,
|
|
1921
|
-
onClick:
|
|
1918
|
+
onClick: p
|
|
1922
1919
|
})) : V("", !0)
|
|
1923
1920
|
]),
|
|
1924
|
-
u("div",
|
|
1925
|
-
e(
|
|
1926
|
-
type: e(
|
|
1927
|
-
onChange:
|
|
1928
|
-
onClear:
|
|
1921
|
+
u("div", Kl, [
|
|
1922
|
+
e(d)?.type !== "select" ? (f(), S(ee(e(d)?.component), P({ key: 0 }, t, {
|
|
1923
|
+
type: e(d)?.type,
|
|
1924
|
+
onChange: o[0] || (o[0] = (h) => x(h.name, h.value)),
|
|
1925
|
+
onClear: o[1] || (o[1] = (h) => c(h)),
|
|
1929
1926
|
ref_key: "filterRef",
|
|
1930
1927
|
ref: r
|
|
1931
|
-
}), null, 16, ["type"])) : (
|
|
1928
|
+
}), null, 16, ["type"])) : (f(), S(ge, {
|
|
1932
1929
|
key: 1,
|
|
1933
1930
|
"current-value": m.value,
|
|
1934
|
-
label:
|
|
1935
|
-
mode:
|
|
1936
|
-
onClear:
|
|
1931
|
+
label: a.label,
|
|
1932
|
+
mode: a.mode,
|
|
1933
|
+
onClear: p,
|
|
1937
1934
|
fieldRef: r.value,
|
|
1938
1935
|
width: void 0,
|
|
1939
|
-
disabled:
|
|
1936
|
+
disabled: a.disabled,
|
|
1940
1937
|
layout: "vertical"
|
|
1941
1938
|
}, {
|
|
1942
1939
|
default: le(() => [
|
|
1943
|
-
(
|
|
1940
|
+
(f(), S(ee(e(d)?.component), P({
|
|
1944
1941
|
ref_key: "filterRef",
|
|
1945
1942
|
ref: r
|
|
1946
1943
|
}, t, {
|
|
1947
|
-
type: e(
|
|
1948
|
-
onChange:
|
|
1949
|
-
onClear:
|
|
1944
|
+
type: e(d)?.type,
|
|
1945
|
+
onChange: o[2] || (o[2] = (h) => x(h.name, h.value)),
|
|
1946
|
+
onClear: o[3] || (o[3] = (h) => c(h))
|
|
1950
1947
|
}), null, 16, ["type"]))
|
|
1951
1948
|
]),
|
|
1952
1949
|
_: 1
|
|
@@ -1981,60 +1978,60 @@ const $l = /* @__PURE__ */ J(Cl, [["render", _l]]), Al = { style: { display: "in
|
|
|
1981
1978
|
sort: {}
|
|
1982
1979
|
},
|
|
1983
1980
|
emits: ["update:modelValue", "change", "clear"],
|
|
1984
|
-
setup(
|
|
1985
|
-
const t =
|
|
1981
|
+
setup(i, { expose: n, emit: v }) {
|
|
1982
|
+
const t = i, s = v, r = _(), d = be(t.type, t.layout), m = I({
|
|
1986
1983
|
get: () => t.modelValue,
|
|
1987
|
-
set: (
|
|
1984
|
+
set: (a) => s("update:modelValue", a)
|
|
1988
1985
|
});
|
|
1989
|
-
function
|
|
1990
|
-
s("clear",
|
|
1986
|
+
function c(a) {
|
|
1987
|
+
s("clear", a);
|
|
1991
1988
|
}
|
|
1992
|
-
function
|
|
1993
|
-
s("change", { name:
|
|
1989
|
+
function x(a, o) {
|
|
1990
|
+
s("change", { name: a, value: o }), t.modelValue !== void 0 && s("update:modelValue", o);
|
|
1994
1991
|
}
|
|
1995
|
-
function
|
|
1992
|
+
function p() {
|
|
1996
1993
|
r.value && r.value.clear(), s("clear", t.name);
|
|
1997
1994
|
}
|
|
1998
1995
|
return M(
|
|
1999
1996
|
() => t.default,
|
|
2000
|
-
(
|
|
2001
|
-
m.value =
|
|
1997
|
+
(a) => {
|
|
1998
|
+
m.value = a;
|
|
2002
1999
|
}
|
|
2003
2000
|
), M(
|
|
2004
2001
|
() => t.modelValue,
|
|
2005
|
-
(
|
|
2006
|
-
m.value =
|
|
2002
|
+
(a) => {
|
|
2003
|
+
m.value = a;
|
|
2007
2004
|
}
|
|
2008
|
-
),
|
|
2005
|
+
), n({
|
|
2009
2006
|
filterRef: r
|
|
2010
|
-
}), (
|
|
2011
|
-
type: e(
|
|
2012
|
-
onChange:
|
|
2013
|
-
onClear:
|
|
2014
|
-
disabled:
|
|
2007
|
+
}), (a, o) => ["text", "date"].includes(a.type.toLocaleLowerCase()) ? (f(), S(ee(e(d)?.component), P({ key: 0 }, t, {
|
|
2008
|
+
type: e(d)?.type,
|
|
2009
|
+
onChange: o[0] || (o[0] = (h) => x(h.name, h.value)),
|
|
2010
|
+
onClear: o[1] || (o[1] = (h) => c(h)),
|
|
2011
|
+
disabled: a.disabled,
|
|
2015
2012
|
modelValue: m.value,
|
|
2016
|
-
"onUpdate:modelValue":
|
|
2017
|
-
}), null, 16, ["type", "disabled", "modelValue"])) : (
|
|
2013
|
+
"onUpdate:modelValue": o[2] || (o[2] = (h) => m.value = h)
|
|
2014
|
+
}), null, 16, ["type", "disabled", "modelValue"])) : (f(), S(ge, {
|
|
2018
2015
|
key: 1,
|
|
2019
2016
|
"current-value": m.value,
|
|
2020
|
-
label:
|
|
2021
|
-
mode:
|
|
2022
|
-
onClear:
|
|
2017
|
+
label: a.label,
|
|
2018
|
+
mode: a.mode,
|
|
2019
|
+
onClear: p,
|
|
2023
2020
|
fieldRef: r.value,
|
|
2024
2021
|
width: t.width,
|
|
2025
|
-
disabled:
|
|
2022
|
+
disabled: a.disabled,
|
|
2026
2023
|
layout: "inline"
|
|
2027
2024
|
}, {
|
|
2028
2025
|
default: le(() => [
|
|
2029
|
-
(
|
|
2026
|
+
(f(), S(ee(e(d)?.component), P({
|
|
2030
2027
|
ref_key: "filterRef",
|
|
2031
2028
|
ref: r
|
|
2032
2029
|
}, t, {
|
|
2033
2030
|
modelValue: m.value,
|
|
2034
|
-
"onUpdate:modelValue":
|
|
2035
|
-
type: e(
|
|
2036
|
-
onChange:
|
|
2037
|
-
onClear:
|
|
2031
|
+
"onUpdate:modelValue": o[3] || (o[3] = (h) => m.value = h),
|
|
2032
|
+
type: e(d)?.type,
|
|
2033
|
+
onChange: o[4] || (o[4] = (h) => x(h.name, h.value)),
|
|
2034
|
+
onClear: o[5] || (o[5] = (h) => c(h))
|
|
2038
2035
|
}), null, 16, ["modelValue", "type"]))
|
|
2039
2036
|
]),
|
|
2040
2037
|
_: 1
|
|
@@ -2066,45 +2063,45 @@ const $l = /* @__PURE__ */ J(Cl, [["render", _l]]), Al = { style: { display: "in
|
|
|
2066
2063
|
sort: {}
|
|
2067
2064
|
},
|
|
2068
2065
|
emits: ["update:modelValue", "change", "clear"],
|
|
2069
|
-
setup(
|
|
2070
|
-
const t =
|
|
2066
|
+
setup(i, { expose: n, emit: v }) {
|
|
2067
|
+
const t = i, s = v, r = _(), d = _(be(t.type, t.layout)), m = I({
|
|
2071
2068
|
get: () => t.modelValue,
|
|
2072
|
-
set: (
|
|
2069
|
+
set: (p) => s("update:modelValue", p)
|
|
2073
2070
|
});
|
|
2074
|
-
function
|
|
2075
|
-
s("clear",
|
|
2071
|
+
function c(p) {
|
|
2072
|
+
s("clear", p);
|
|
2076
2073
|
}
|
|
2077
|
-
function
|
|
2078
|
-
s("change", { name:
|
|
2074
|
+
function x(p, a) {
|
|
2075
|
+
s("change", { name: p, value: a }), t.modelValue !== void 0 && s("update:modelValue", a);
|
|
2079
2076
|
}
|
|
2080
2077
|
return M(
|
|
2081
2078
|
() => t.default,
|
|
2082
|
-
(
|
|
2083
|
-
m.value =
|
|
2079
|
+
(p) => {
|
|
2080
|
+
m.value = p;
|
|
2084
2081
|
}
|
|
2085
2082
|
), M(
|
|
2086
2083
|
() => t.modelValue,
|
|
2087
|
-
(
|
|
2088
|
-
m.value =
|
|
2084
|
+
(p) => {
|
|
2085
|
+
m.value = p;
|
|
2089
2086
|
}
|
|
2090
2087
|
), M(
|
|
2091
2088
|
() => t,
|
|
2092
|
-
(
|
|
2093
|
-
m.value =
|
|
2089
|
+
(p) => {
|
|
2090
|
+
m.value = p;
|
|
2094
2091
|
}
|
|
2095
|
-
),
|
|
2092
|
+
), n({
|
|
2096
2093
|
filterRef: r
|
|
2097
|
-
}), (
|
|
2098
|
-
type:
|
|
2094
|
+
}), (p, a) => (f(), S(ee(d.value?.component), P(t, {
|
|
2095
|
+
type: d.value?.type,
|
|
2099
2096
|
modelValue: m.value,
|
|
2100
|
-
"onUpdate:modelValue":
|
|
2101
|
-
onChange:
|
|
2102
|
-
onClear:
|
|
2097
|
+
"onUpdate:modelValue": a[0] || (a[0] = (o) => m.value = o),
|
|
2098
|
+
onChange: a[1] || (a[1] = (o) => x(o.name, o.value)),
|
|
2099
|
+
onClear: a[2] || (a[2] = (o) => c(o)),
|
|
2103
2100
|
ref_key: "filterRef",
|
|
2104
2101
|
ref: r
|
|
2105
2102
|
}), null, 16, ["type", "modelValue"]));
|
|
2106
2103
|
}
|
|
2107
|
-
}),
|
|
2104
|
+
}), ae = /* @__PURE__ */ O({
|
|
2108
2105
|
__name: "filter-field",
|
|
2109
2106
|
props: {
|
|
2110
2107
|
id: {},
|
|
@@ -2127,181 +2124,179 @@ const $l = /* @__PURE__ */ J(Cl, [["render", _l]]), Al = { style: { display: "in
|
|
|
2127
2124
|
valueKey: {},
|
|
2128
2125
|
mode: {},
|
|
2129
2126
|
labelKey: {},
|
|
2130
|
-
sort: { default: "
|
|
2127
|
+
sort: { default: "name" }
|
|
2131
2128
|
},
|
|
2132
2129
|
emits: ["update:modelValue", "change", "clear"],
|
|
2133
|
-
setup(
|
|
2134
|
-
const t =
|
|
2130
|
+
setup(i, { expose: n, emit: v }) {
|
|
2131
|
+
const t = i, s = v, r = _(), d = I({
|
|
2135
2132
|
get: () => t.modelValue,
|
|
2136
|
-
set: (
|
|
2133
|
+
set: (p) => s("update:modelValue", p)
|
|
2137
2134
|
});
|
|
2138
|
-
function m(
|
|
2139
|
-
s("clear",
|
|
2135
|
+
function m(p) {
|
|
2136
|
+
s("clear", p);
|
|
2140
2137
|
}
|
|
2141
|
-
function
|
|
2142
|
-
s("change", { name:
|
|
2138
|
+
function c(p, a) {
|
|
2139
|
+
s("change", { name: p, value: a }), t.modelValue !== void 0 && s("update:modelValue", a);
|
|
2143
2140
|
}
|
|
2144
2141
|
M(
|
|
2145
2142
|
() => t.default,
|
|
2146
|
-
(
|
|
2147
|
-
|
|
2143
|
+
(p) => {
|
|
2144
|
+
d.value = p;
|
|
2148
2145
|
}
|
|
2149
2146
|
), M(
|
|
2150
2147
|
() => t.modelValue,
|
|
2151
|
-
(
|
|
2152
|
-
|
|
2148
|
+
(p) => {
|
|
2149
|
+
d.value = p;
|
|
2153
2150
|
}
|
|
2154
|
-
),
|
|
2151
|
+
), n({
|
|
2155
2152
|
filterRef: r
|
|
2156
2153
|
});
|
|
2157
|
-
function
|
|
2154
|
+
function x() {
|
|
2158
2155
|
switch (t.layout) {
|
|
2159
2156
|
case "inline":
|
|
2160
2157
|
return we;
|
|
2161
2158
|
case "vertical":
|
|
2162
|
-
return
|
|
2159
|
+
return Fl;
|
|
2163
2160
|
case "popover":
|
|
2164
2161
|
return jl;
|
|
2165
2162
|
default:
|
|
2166
2163
|
return we;
|
|
2167
2164
|
}
|
|
2168
2165
|
}
|
|
2169
|
-
return (
|
|
2170
|
-
onChange:
|
|
2171
|
-
onClear:
|
|
2172
|
-
modelValue:
|
|
2173
|
-
"onUpdate:modelValue":
|
|
2166
|
+
return (p, a) => (f(), S(ee(x()), P(t, {
|
|
2167
|
+
onChange: a[0] || (a[0] = (o) => c(o.name, o.value)),
|
|
2168
|
+
onClear: a[1] || (a[1] = (o) => m(o)),
|
|
2169
|
+
modelValue: d.value,
|
|
2170
|
+
"onUpdate:modelValue": a[2] || (a[2] = (o) => d.value = o)
|
|
2174
2171
|
}), null, 16, ["modelValue"]));
|
|
2175
2172
|
}
|
|
2176
2173
|
});
|
|
2177
|
-
function he(
|
|
2174
|
+
function he(i, n) {
|
|
2178
2175
|
const {
|
|
2179
2176
|
slots: v
|
|
2180
|
-
} =
|
|
2177
|
+
} = i, t = _(i.value ?? {}), s = I(() => (Z(v?.default?.()) ?? []).flatMap((l) => Array.isArray(l.children) ? l.children : [l]));
|
|
2181
2178
|
function r(C) {
|
|
2182
|
-
delete t.value[C],
|
|
2179
|
+
delete t.value[C], n("clear", {
|
|
2183
2180
|
data: Z(t.value),
|
|
2184
2181
|
name: C
|
|
2185
2182
|
});
|
|
2186
2183
|
}
|
|
2187
|
-
function
|
|
2188
|
-
|
|
2184
|
+
function d(C, l) {
|
|
2185
|
+
l === void 0 ? (r(C), n("change", {
|
|
2189
2186
|
data: Z(t.value),
|
|
2190
2187
|
name: C,
|
|
2191
2188
|
undefined: void 0
|
|
2192
2189
|
})) : t.value = {
|
|
2193
2190
|
...t.value,
|
|
2194
|
-
[C]:
|
|
2195
|
-
},
|
|
2191
|
+
[C]: l
|
|
2192
|
+
}, n("change", {
|
|
2196
2193
|
data: Z(t.value),
|
|
2197
2194
|
name: C,
|
|
2198
|
-
value:
|
|
2195
|
+
value: l
|
|
2199
2196
|
});
|
|
2200
2197
|
}
|
|
2201
2198
|
const m = I(() => s.value.map((C) => {
|
|
2202
|
-
const
|
|
2203
|
-
return
|
|
2199
|
+
const l = C.props?.name;
|
|
2200
|
+
return Ie(C, {
|
|
2204
2201
|
...C.props,
|
|
2205
|
-
layout:
|
|
2202
|
+
layout: i.view,
|
|
2206
2203
|
showClean: !0,
|
|
2207
|
-
modelValue: t[
|
|
2208
|
-
"onUpdate:modelValue": (
|
|
2209
|
-
|
|
2204
|
+
modelValue: t[l],
|
|
2205
|
+
"onUpdate:modelValue": (b) => {
|
|
2206
|
+
d(l, b);
|
|
2210
2207
|
},
|
|
2211
|
-
onClear: () => r(
|
|
2208
|
+
onClear: () => r(l)
|
|
2212
2209
|
});
|
|
2213
|
-
})),
|
|
2210
|
+
})), c = I(
|
|
2214
2211
|
() => new Map(
|
|
2215
2212
|
m.value.map((C) => {
|
|
2216
|
-
const
|
|
2217
|
-
return
|
|
2213
|
+
const l = C.props?.name;
|
|
2214
|
+
return l ? [l, C] : null;
|
|
2218
2215
|
}).filter((C) => C !== null)
|
|
2219
2216
|
)
|
|
2220
2217
|
);
|
|
2221
|
-
function
|
|
2222
|
-
t.value = {},
|
|
2218
|
+
function x() {
|
|
2219
|
+
t.value = {}, n("clearAll", {
|
|
2223
2220
|
data: Z(t.value),
|
|
2224
2221
|
name: "ALL"
|
|
2225
2222
|
});
|
|
2226
2223
|
}
|
|
2227
|
-
const
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
M(f, async () => {
|
|
2231
|
-
await fe(), l?.value?.filterRef?.inputTextRef && l.value.filterRef.inputTextRef.focus();
|
|
2224
|
+
const p = _(""), a = I(() => i.schema?.value ? Object.entries(t.value).filter(([C, l]) => i.schema && !(C in i.schema.value) ? !1 : Array.isArray(l) ? l.some((b) => b !== "" && b !== void 0) : l !== "" && l !== void 0).length : 0), o = _();
|
|
2225
|
+
M(p, async () => {
|
|
2226
|
+
await fe(), o?.value?.filterRef?.inputTextRef && o.value.filterRef.inputTextRef.focus();
|
|
2232
2227
|
});
|
|
2233
|
-
const
|
|
2228
|
+
const h = I(() => i.schema?.value ? Object.fromEntries(Object.entries(i.schema?.value).slice(0, i.limit)) : {}), g = I(() => i.schema?.value ? i.view !== "inline" ? i.schema?.value : Object.fromEntries(Object.entries(i.schema?.value).slice(i.limit)) : {}), k = I(() => {
|
|
2234
2229
|
if (m.value.length === 0) return [];
|
|
2235
2230
|
let C = 0;
|
|
2236
|
-
if (
|
|
2237
|
-
const
|
|
2238
|
-
|
|
2231
|
+
if (i.schema?.value) {
|
|
2232
|
+
const l = Object.entries(i.schema.value).length;
|
|
2233
|
+
l < i.limit ? C = i.limit - l : C = 0;
|
|
2239
2234
|
}
|
|
2240
2235
|
return m.value.slice(0, C);
|
|
2241
|
-
}),
|
|
2236
|
+
}), y = I(() => m.value.length === 0 ? [] : i.view !== "inline" ? m.value : m.value.slice(k.value.length));
|
|
2242
2237
|
function $() {
|
|
2243
|
-
if (
|
|
2244
|
-
const [C] = Object.keys(
|
|
2245
|
-
|
|
2246
|
-
} else
|
|
2238
|
+
if (g.value) {
|
|
2239
|
+
const [C] = Object.keys(g.value);
|
|
2240
|
+
p.value = C;
|
|
2241
|
+
} else y.value.length > 0 ? p.value = y.value[0].props.name : p.value = "";
|
|
2247
2242
|
}
|
|
2248
2243
|
return {
|
|
2249
2244
|
activeFilter: t,
|
|
2250
|
-
activeFilterCount:
|
|
2251
|
-
onFilterChange:
|
|
2245
|
+
activeFilterCount: a,
|
|
2246
|
+
onFilterChange: d,
|
|
2252
2247
|
clearFilter: r,
|
|
2253
|
-
clearAllFilters:
|
|
2254
|
-
limitedSchema:
|
|
2255
|
-
popoverSchema:
|
|
2248
|
+
clearAllFilters: x,
|
|
2249
|
+
limitedSchema: h,
|
|
2250
|
+
popoverSchema: g,
|
|
2256
2251
|
filtersSlot: m,
|
|
2257
2252
|
limitedFiltersSlot: k,
|
|
2258
|
-
popoverFiltersSlot:
|
|
2259
|
-
vnodeMap:
|
|
2253
|
+
popoverFiltersSlot: y,
|
|
2254
|
+
vnodeMap: c,
|
|
2260
2255
|
onPopoverOpen: $,
|
|
2261
|
-
selectedFilter:
|
|
2262
|
-
filterRef:
|
|
2256
|
+
selectedFilter: p,
|
|
2257
|
+
filterRef: o
|
|
2263
2258
|
};
|
|
2264
2259
|
}
|
|
2265
|
-
const
|
|
2260
|
+
const Ll = /* @__PURE__ */ O({
|
|
2266
2261
|
__name: "popover",
|
|
2267
2262
|
emits: ["open", "close"],
|
|
2268
|
-
setup(
|
|
2269
|
-
const v = _(!1), t = _(null), s = _(null), r = _(null),
|
|
2263
|
+
setup(i, { emit: n }) {
|
|
2264
|
+
const v = _(!1), t = _(null), s = _(null), r = _(null), d = _({ top: "0px", left: "0px", position: "absolute" });
|
|
2270
2265
|
function m() {
|
|
2271
2266
|
v.value = !v.value;
|
|
2272
2267
|
}
|
|
2273
|
-
function
|
|
2274
|
-
const
|
|
2275
|
-
if (!
|
|
2276
|
-
const
|
|
2277
|
-
let $ =
|
|
2278
|
-
k >
|
|
2268
|
+
function c() {
|
|
2269
|
+
const o = r.value, h = t.value;
|
|
2270
|
+
if (!o || !h) return;
|
|
2271
|
+
const g = o.getBoundingClientRect(), k = h.offsetWidth, y = window.innerWidth - g.left;
|
|
2272
|
+
let $ = g.left + window.scrollX;
|
|
2273
|
+
k > y && ($ = window.innerWidth - k - 8, $ < 8 && ($ = 8)), d.value = {
|
|
2279
2274
|
position: "absolute",
|
|
2280
|
-
top: `${
|
|
2275
|
+
top: `${g.bottom + window.scrollY + 8}px`,
|
|
2281
2276
|
left: `${$}px`
|
|
2282
2277
|
};
|
|
2283
2278
|
}
|
|
2284
|
-
function
|
|
2285
|
-
const
|
|
2286
|
-
!r.value?.contains(
|
|
2279
|
+
function x(o) {
|
|
2280
|
+
const h = o.target;
|
|
2281
|
+
!r.value?.contains(o.target) && !t.value?.contains(o.target) && !h.closest("[data-inside-popover]") && (v.value = !1);
|
|
2287
2282
|
}
|
|
2288
|
-
const
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
}),
|
|
2292
|
-
r.value = s.value?.querySelector("[data-popover-trigger]") || null, r.value?.addEventListener("click", m), document.addEventListener("click",
|
|
2283
|
+
const p = _(!1);
|
|
2284
|
+
ne(() => {
|
|
2285
|
+
p.value = !0;
|
|
2286
|
+
}), ne(() => {
|
|
2287
|
+
r.value = s.value?.querySelector("[data-popover-trigger]") || null, r.value?.addEventListener("click", m), document.addEventListener("click", x), window.addEventListener("resize", c), window.addEventListener("scroll", c, !0);
|
|
2293
2288
|
}), ce(() => {
|
|
2294
|
-
r.value?.removeEventListener("click", m), document.removeEventListener("click",
|
|
2289
|
+
r.value?.removeEventListener("click", m), document.removeEventListener("click", x), window.removeEventListener("resize", c), window.removeEventListener("scroll", c, !0);
|
|
2295
2290
|
});
|
|
2296
|
-
const
|
|
2297
|
-
return M(v, async (
|
|
2298
|
-
|
|
2299
|
-
}), (
|
|
2291
|
+
const a = n;
|
|
2292
|
+
return M(v, async (o) => {
|
|
2293
|
+
o ? (a("open"), await fe(), c()) : a("close");
|
|
2294
|
+
}), (o, h) => (f(), w("div", {
|
|
2300
2295
|
ref_key: "wrapperRef",
|
|
2301
2296
|
ref: s
|
|
2302
2297
|
}, [
|
|
2303
|
-
ue(
|
|
2304
|
-
|
|
2298
|
+
ue(o.$slots, "trigger"),
|
|
2299
|
+
p.value ? (f(), S($e, {
|
|
2305
2300
|
key: 0,
|
|
2306
2301
|
to: "body"
|
|
2307
2302
|
}, [
|
|
@@ -2309,16 +2304,16 @@ const Fl = /* @__PURE__ */ O({
|
|
|
2309
2304
|
ref_key: "popoverRef",
|
|
2310
2305
|
ref: t,
|
|
2311
2306
|
class: "absolute z-[50] w-[600px] rounded-md border bg-white shadow-md",
|
|
2312
|
-
style:
|
|
2307
|
+
style: Ae(d.value)
|
|
2313
2308
|
}, [
|
|
2314
|
-
ue(
|
|
2309
|
+
ue(o.$slots, "default")
|
|
2315
2310
|
], 4), [
|
|
2316
2311
|
[X, v.value]
|
|
2317
2312
|
])
|
|
2318
2313
|
])) : V("", !0)
|
|
2319
2314
|
], 512));
|
|
2320
2315
|
}
|
|
2321
|
-
}),
|
|
2316
|
+
}), El = {}, Il = {
|
|
2322
2317
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2323
2318
|
width: "24",
|
|
2324
2319
|
height: "24",
|
|
@@ -2330,24 +2325,24 @@ const Fl = /* @__PURE__ */ O({
|
|
|
2330
2325
|
"stroke-linejoin": "round",
|
|
2331
2326
|
class: "lucide lucide-filter h-4 w-4"
|
|
2332
2327
|
};
|
|
2333
|
-
function
|
|
2334
|
-
return
|
|
2328
|
+
function Tl(i, n) {
|
|
2329
|
+
return f(), w("svg", Il, n[0] || (n[0] = [
|
|
2335
2330
|
u("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" }, null, -1)
|
|
2336
2331
|
]));
|
|
2337
2332
|
}
|
|
2338
|
-
const
|
|
2333
|
+
const Ol = /* @__PURE__ */ J(El, [["render", Tl]]), Ul = {
|
|
2339
2334
|
key: 0,
|
|
2340
|
-
class: "inline-flex items-center
|
|
2341
|
-
},
|
|
2335
|
+
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"
|
|
2336
|
+
}, zl = { class: "flex" }, Nl = { class: "w-64 border-r border-gray-200" }, Hl = { class: "p-2" }, Yl = ["onClick"], Pl = { class: "flex items-center gap-2" }, Wl = { class: "text-sm font-medium" }, ql = {
|
|
2342
2337
|
key: 0,
|
|
2343
2338
|
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"
|
|
2344
|
-
},
|
|
2339
|
+
}, Ql = ["onClick"], Gl = { class: "flex items-center gap-2" }, Xl = { class: "text-sm font-medium" }, Jl = {
|
|
2345
2340
|
key: 0,
|
|
2346
2341
|
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"
|
|
2347
|
-
},
|
|
2342
|
+
}, Zl = {
|
|
2348
2343
|
key: 0,
|
|
2349
2344
|
class: "p-2 border-t"
|
|
2350
|
-
},
|
|
2345
|
+
}, eo = { class: "flex-1 min-h-[300px] overflow-y-auto" }, to = {
|
|
2351
2346
|
key: 0,
|
|
2352
2347
|
class: "flex items-center justify-center h-full text-gray-500"
|
|
2353
2348
|
}, je = /* @__PURE__ */ O({
|
|
@@ -2361,35 +2356,35 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
|
|
|
2361
2356
|
limit: { default: 3 }
|
|
2362
2357
|
},
|
|
2363
2358
|
emits: ["change", "clear", "clearAll"],
|
|
2364
|
-
setup(
|
|
2365
|
-
const t =
|
|
2366
|
-
activeFilter:
|
|
2367
|
-
activeFilterCount:
|
|
2368
|
-
onFilterChange:
|
|
2369
|
-
clearFilter:
|
|
2370
|
-
clearAllFilters:
|
|
2371
|
-
popoverSchema:
|
|
2372
|
-
popoverFiltersSlot:
|
|
2359
|
+
setup(i, { expose: n, emit: v }) {
|
|
2360
|
+
const t = i, s = Ke(t.mode), r = pe(), d = v, m = _({}), {
|
|
2361
|
+
activeFilter: c,
|
|
2362
|
+
activeFilterCount: x,
|
|
2363
|
+
onFilterChange: p,
|
|
2364
|
+
clearFilter: a,
|
|
2365
|
+
clearAllFilters: o,
|
|
2366
|
+
popoverSchema: h,
|
|
2367
|
+
popoverFiltersSlot: g,
|
|
2373
2368
|
onPopoverOpen: k,
|
|
2374
|
-
selectedFilter:
|
|
2369
|
+
selectedFilter: y,
|
|
2375
2370
|
filterRef: $
|
|
2376
2371
|
} = he({
|
|
2377
2372
|
...t,
|
|
2378
2373
|
schema: m,
|
|
2379
2374
|
slots: r
|
|
2380
|
-
},
|
|
2375
|
+
}, d);
|
|
2381
2376
|
return M(
|
|
2382
2377
|
() => t.schema,
|
|
2383
2378
|
(C) => {
|
|
2384
2379
|
m.value = C;
|
|
2385
2380
|
},
|
|
2386
2381
|
{ deep: !0, immediate: !0 }
|
|
2387
|
-
),
|
|
2388
|
-
clearFilter:
|
|
2389
|
-
clearAllFilters:
|
|
2390
|
-
}), (C,
|
|
2382
|
+
), n({
|
|
2383
|
+
clearFilter: a,
|
|
2384
|
+
clearAllFilters: o
|
|
2385
|
+
}), (C, l) => (f(), S(Ll, {
|
|
2391
2386
|
onOpen: e(k),
|
|
2392
|
-
onClose:
|
|
2387
|
+
onClose: l[5] || (l[5] = (b) => y.value = "")
|
|
2393
2388
|
}, {
|
|
2394
2389
|
trigger: le(() => [
|
|
2395
2390
|
u("button", {
|
|
@@ -2397,99 +2392,99 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
|
|
|
2397
2392
|
"aria-haspopup": "dialog",
|
|
2398
2393
|
"aria-expanded": "false",
|
|
2399
2394
|
class: D(
|
|
2400
|
-
e(s) + (e(
|
|
2395
|
+
e(s) + (e(x) > 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")
|
|
2401
2396
|
),
|
|
2402
2397
|
type: "button"
|
|
2403
2398
|
}, [
|
|
2404
|
-
N(
|
|
2405
|
-
|
|
2406
|
-
e(
|
|
2399
|
+
N(Ol),
|
|
2400
|
+
l[6] || (l[6] = z(" Фільтр ")),
|
|
2401
|
+
e(x) > 0 ? (f(), w("div", Ul, F(e(x)), 1)) : V("", !0)
|
|
2407
2402
|
], 2)
|
|
2408
2403
|
]),
|
|
2409
2404
|
default: le(() => [
|
|
2410
|
-
u("div",
|
|
2411
|
-
u("div",
|
|
2412
|
-
|
|
2405
|
+
u("div", zl, [
|
|
2406
|
+
u("div", Nl, [
|
|
2407
|
+
l[7] || (l[7] = u("div", { class: "p-4 border-b" }, [
|
|
2413
2408
|
u("p", { class: "text-sm text-gray-600" }, "Select a field to start creating a filter.")
|
|
2414
2409
|
], -1)),
|
|
2415
|
-
u("div",
|
|
2416
|
-
C.schema ? (
|
|
2417
|
-
key:
|
|
2410
|
+
u("div", Hl, [
|
|
2411
|
+
C.schema ? (f(!0), w(R, { key: 0 }, W(Object.entries(e(h)), ([b, K]) => (f(), w("button", {
|
|
2412
|
+
key: b,
|
|
2418
2413
|
onClick: () => {
|
|
2419
|
-
|
|
2414
|
+
y.value = b;
|
|
2420
2415
|
},
|
|
2421
2416
|
class: D([
|
|
2422
2417
|
"w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",
|
|
2423
|
-
e(
|
|
2418
|
+
e(y) === b ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
|
|
2424
2419
|
])
|
|
2425
2420
|
}, [
|
|
2426
|
-
u("div",
|
|
2427
|
-
u("span",
|
|
2421
|
+
u("div", Pl, [
|
|
2422
|
+
u("span", Wl, F(K.label), 1)
|
|
2428
2423
|
]),
|
|
2429
|
-
(Array.isArray(e(
|
|
2430
|
-
], 10,
|
|
2431
|
-
(
|
|
2424
|
+
(Array.isArray(e(c)[b]) ? e(c)[b]?.length > 0 : e(c)[b] || e(c)[b] === null) ? (f(), w("div", ql)) : V("", !0)
|
|
2425
|
+
], 10, Yl))), 128)) : V("", !0),
|
|
2426
|
+
(f(!0), w(R, null, W(e(g), (b, K) => (f(), w("button", {
|
|
2432
2427
|
key: "slot-" + K,
|
|
2433
|
-
onClick: (A) =>
|
|
2428
|
+
onClick: (A) => y.value = b.props.name,
|
|
2434
2429
|
class: D([
|
|
2435
2430
|
"w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",
|
|
2436
|
-
e(
|
|
2431
|
+
e(y) === b.props.name ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
|
|
2437
2432
|
])
|
|
2438
2433
|
}, [
|
|
2439
|
-
u("div",
|
|
2440
|
-
u("span",
|
|
2434
|
+
u("div", Gl, [
|
|
2435
|
+
u("span", Xl, F(b.props.label), 1)
|
|
2441
2436
|
]),
|
|
2442
|
-
e(
|
|
2443
|
-
], 10,
|
|
2437
|
+
e(c)[b.props.name]?.length > 0 ? (f(), w("div", Jl)) : V("", !0)
|
|
2438
|
+
], 10, Ql))), 128))
|
|
2444
2439
|
]),
|
|
2445
|
-
e(
|
|
2440
|
+
e(x) > 0 ? (f(), w("div", Zl, [
|
|
2446
2441
|
u("button", {
|
|
2447
2442
|
class: "w-full px-3 py-2 text-left text-sm text-gray-600 hover:bg-gray-50 transition-colors",
|
|
2448
|
-
onClick:
|
|
2449
|
-
(...
|
|
2443
|
+
onClick: l[0] || (l[0] = //@ts-ignore
|
|
2444
|
+
(...b) => e(o) && e(o)(...b)),
|
|
2450
2445
|
"data-inside-popover": ""
|
|
2451
2446
|
}, " Очистити всі ")
|
|
2452
2447
|
])) : V("", !0)
|
|
2453
2448
|
]),
|
|
2454
|
-
u("div",
|
|
2455
|
-
e(
|
|
2449
|
+
u("div", eo, [
|
|
2450
|
+
e(y) === "" ? (f(), w("div", to, l[8] || (l[8] = [
|
|
2456
2451
|
u("p", { class: "text-sm" }, "Select a field to start creating a filter.", -1)
|
|
2457
2452
|
]))) : V("", !0),
|
|
2458
|
-
e(
|
|
2459
|
-
e(
|
|
2460
|
-
e(
|
|
2461
|
-
name:
|
|
2462
|
-
key:
|
|
2453
|
+
e(y) ? (f(), w(R, { key: 1 }, [
|
|
2454
|
+
e(h) ? (f(!0), w(R, { key: 0 }, W(Object.entries(e(h)), ([b, K]) => (f(), w(R, null, [
|
|
2455
|
+
e(y) === b ? (f(), S(ae, P({
|
|
2456
|
+
name: b,
|
|
2457
|
+
key: b,
|
|
2463
2458
|
layout: "popover",
|
|
2464
2459
|
ref_for: !0,
|
|
2465
2460
|
ref_key: "filterRef",
|
|
2466
2461
|
ref: $
|
|
2467
2462
|
}, { ref_for: !0 }, K, {
|
|
2468
|
-
onChange:
|
|
2469
|
-
onClear:
|
|
2470
|
-
e(
|
|
2463
|
+
onChange: l[1] || (l[1] = (A) => e(p)(A.name, A.value)),
|
|
2464
|
+
onClear: l[2] || (l[2] = (A) => {
|
|
2465
|
+
e(a)(A), e(p)(A, void 0);
|
|
2471
2466
|
}),
|
|
2472
|
-
modelValue: e(
|
|
2473
|
-
"onUpdate:modelValue": (A) => e(
|
|
2467
|
+
modelValue: e(c)[b],
|
|
2468
|
+
"onUpdate:modelValue": (A) => e(c)[b] = A,
|
|
2474
2469
|
cleanable: !0
|
|
2475
2470
|
}), null, 16, ["name", "modelValue", "onUpdate:modelValue"])) : V("", !0)
|
|
2476
2471
|
], 64))), 256)) : V("", !0),
|
|
2477
|
-
(
|
|
2472
|
+
(f(!0), w(R, null, W(e(g), (b, K) => (f(), w(R, {
|
|
2478
2473
|
key: "slot-" + K
|
|
2479
2474
|
}, [
|
|
2480
|
-
e(
|
|
2475
|
+
e(y) === b.props.name ? (f(), S(ae, P({
|
|
2481
2476
|
key: 0,
|
|
2482
2477
|
layout: "popover"
|
|
2483
|
-
}, { ref_for: !0 },
|
|
2478
|
+
}, { ref_for: !0 }, b.props, {
|
|
2484
2479
|
ref_for: !0,
|
|
2485
2480
|
ref_key: "filterRef",
|
|
2486
2481
|
ref: $,
|
|
2487
|
-
onChange:
|
|
2488
|
-
onClear:
|
|
2489
|
-
e(
|
|
2482
|
+
onChange: l[3] || (l[3] = (A) => e(p)(A.name, A.value)),
|
|
2483
|
+
onClear: l[4] || (l[4] = (A) => {
|
|
2484
|
+
e(a)(A), e(p)(A, void 0);
|
|
2490
2485
|
}),
|
|
2491
|
-
modelValue: e(
|
|
2492
|
-
"onUpdate:modelValue": (A) => e(
|
|
2486
|
+
modelValue: e(c)[b.props.name],
|
|
2487
|
+
"onUpdate:modelValue": (A) => e(c)[b.props.name] = A,
|
|
2493
2488
|
cleanable: !0
|
|
2494
2489
|
}), null, 16, ["modelValue", "onUpdate:modelValue"])) : V("", !0)
|
|
2495
2490
|
], 64))), 128))
|
|
@@ -2500,7 +2495,7 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
|
|
|
2500
2495
|
_: 1
|
|
2501
2496
|
}, 8, ["onOpen"]));
|
|
2502
2497
|
}
|
|
2503
|
-
}),
|
|
2498
|
+
}), lo = { class: "flex gap-1 items-center flex-wrap" }, Ce = /* @__PURE__ */ O({
|
|
2504
2499
|
__name: "inline-filter-layout",
|
|
2505
2500
|
props: {
|
|
2506
2501
|
schema: {},
|
|
@@ -2511,17 +2506,17 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
|
|
|
2511
2506
|
limit: { default: 3 }
|
|
2512
2507
|
},
|
|
2513
2508
|
emits: ["change", "clear", "clearAll"],
|
|
2514
|
-
setup(
|
|
2515
|
-
const v =
|
|
2516
|
-
activeFilter:
|
|
2509
|
+
setup(i, { emit: n }) {
|
|
2510
|
+
const v = i, t = n, s = pe(), r = _({}), {
|
|
2511
|
+
activeFilter: d,
|
|
2517
2512
|
activeFilterCount: m,
|
|
2518
|
-
onFilterChange:
|
|
2519
|
-
clearFilter:
|
|
2520
|
-
clearAllFilters:
|
|
2521
|
-
limitedSchema:
|
|
2522
|
-
popoverSchema:
|
|
2523
|
-
filtersSlot:
|
|
2524
|
-
limitedFiltersSlot:
|
|
2513
|
+
onFilterChange: c,
|
|
2514
|
+
clearFilter: x,
|
|
2515
|
+
clearAllFilters: p,
|
|
2516
|
+
limitedSchema: a,
|
|
2517
|
+
popoverSchema: o,
|
|
2518
|
+
filtersSlot: h,
|
|
2519
|
+
limitedFiltersSlot: g,
|
|
2525
2520
|
popoverFiltersSlot: k
|
|
2526
2521
|
} = he(
|
|
2527
2522
|
{
|
|
@@ -2530,9 +2525,9 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
|
|
|
2530
2525
|
slots: s
|
|
2531
2526
|
},
|
|
2532
2527
|
t
|
|
2533
|
-
),
|
|
2528
|
+
), y = _();
|
|
2534
2529
|
function $() {
|
|
2535
|
-
|
|
2530
|
+
y.value && y.value.clearAllFilters(), p();
|
|
2536
2531
|
}
|
|
2537
2532
|
return M(
|
|
2538
2533
|
() => v.schema,
|
|
@@ -2540,61 +2535,63 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
|
|
|
2540
2535
|
r.value = C;
|
|
2541
2536
|
},
|
|
2542
2537
|
{ deep: !0, immediate: !0 }
|
|
2543
|
-
), (C,
|
|
2544
|
-
C.schema ? (
|
|
2545
|
-
key:
|
|
2546
|
-
name:
|
|
2538
|
+
), (C, l) => (f(), w("div", lo, [
|
|
2539
|
+
C.schema ? (f(!0), w(R, { key: 0 }, W(Object.entries(e(a)), ([b, K]) => (f(), S(ae, P({
|
|
2540
|
+
key: b,
|
|
2541
|
+
name: b,
|
|
2547
2542
|
mode: C.mode
|
|
2548
2543
|
}, { ref_for: !0 }, K, {
|
|
2549
|
-
onChange:
|
|
2550
|
-
onClear:
|
|
2551
|
-
e(
|
|
2544
|
+
onChange: l[0] || (l[0] = (A) => e(c)(A.name, A.value)),
|
|
2545
|
+
onClear: l[1] || (l[1] = (A) => {
|
|
2546
|
+
e(x)(A), e(c)(A, void 0);
|
|
2552
2547
|
}),
|
|
2553
2548
|
layout: "inline",
|
|
2554
2549
|
cleanable: !0,
|
|
2555
|
-
modelValue: e(
|
|
2556
|
-
"onUpdate:modelValue": (A) => e(
|
|
2550
|
+
modelValue: e(d)[b],
|
|
2551
|
+
"onUpdate:modelValue": (A) => e(d)[b] = A
|
|
2557
2552
|
}), null, 16, ["name", "mode", "modelValue", "onUpdate:modelValue"]))), 128)) : V("", !0),
|
|
2558
|
-
(
|
|
2553
|
+
(f(!0), w(R, null, W(e(g), (b, K) => (f(), S(ae, P({
|
|
2559
2554
|
key: "slot-" + K,
|
|
2560
|
-
layout: "
|
|
2561
|
-
}, { ref_for: !0 },
|
|
2562
|
-
onChange:
|
|
2563
|
-
onClear:
|
|
2564
|
-
e(
|
|
2555
|
+
layout: "inline"
|
|
2556
|
+
}, { ref_for: !0 }, b.props, {
|
|
2557
|
+
onChange: l[2] || (l[2] = (A) => e(c)(A.name, A.value)),
|
|
2558
|
+
onClear: l[3] || (l[3] = (A) => {
|
|
2559
|
+
e(x)(A), e(c)(A, void 0);
|
|
2565
2560
|
}),
|
|
2566
2561
|
cleanable: !0,
|
|
2567
|
-
modelValue: e(
|
|
2568
|
-
"onUpdate:modelValue": (A) => e(
|
|
2562
|
+
modelValue: e(d)[b.props.name],
|
|
2563
|
+
"onUpdate:modelValue": (A) => e(d)[b.props.name] = A
|
|
2569
2564
|
}), null, 16, ["modelValue", "onUpdate:modelValue"]))), 128)),
|
|
2570
|
-
Object.entries(e(
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2565
|
+
Object.entries(e(o)).length > 0 || e(k).length > 0 ? (f(), S(je, P({ key: 1 }, v, {
|
|
2566
|
+
schema: e(o),
|
|
2567
|
+
limit: 0,
|
|
2568
|
+
onChange: l[4] || (l[4] = (b) => e(c)(b.name, b.value)),
|
|
2569
|
+
onClearAll: e(p),
|
|
2570
|
+
onClear: l[5] || (l[5] = (b) => e(x)(b.name)),
|
|
2574
2571
|
mode: C.mode,
|
|
2575
2572
|
ref_key: "popoverRef",
|
|
2576
|
-
ref:
|
|
2573
|
+
ref: y,
|
|
2577
2574
|
cleanable: !0
|
|
2578
2575
|
}), {
|
|
2579
2576
|
default: le(() => [
|
|
2580
|
-
(
|
|
2577
|
+
(f(!0), w(R, null, W(e(h), (b, K) => (f(), S(ee(b), P({
|
|
2581
2578
|
key: "slot-" + K,
|
|
2582
|
-
layout: "
|
|
2583
|
-
}, { ref_for: !0 },
|
|
2579
|
+
layout: "popover"
|
|
2580
|
+
}, { ref_for: !0 }, b.props, { cleanable: !0 }), null, 16))), 128))
|
|
2584
2581
|
]),
|
|
2585
2582
|
_: 1
|
|
2586
|
-
}, 16, ["onClearAll", "mode"])) : V("", !0),
|
|
2587
|
-
e(m) > 0 ? (
|
|
2583
|
+
}, 16, ["schema", "onClearAll", "mode"])) : V("", !0),
|
|
2584
|
+
e(m) > 0 ? (f(), w("button", {
|
|
2588
2585
|
key: 2,
|
|
2589
2586
|
onClick: $,
|
|
2590
2587
|
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"
|
|
2591
2588
|
}, " Очистити ")) : V("", !0)
|
|
2592
2589
|
]));
|
|
2593
2590
|
}
|
|
2594
|
-
}),
|
|
2591
|
+
}), oo = {
|
|
2595
2592
|
key: 0,
|
|
2596
2593
|
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"
|
|
2597
|
-
},
|
|
2594
|
+
}, ao = { class: "flex items-center vst-filters vsTailwind flex-col w-full" }, no = /* @__PURE__ */ O({
|
|
2598
2595
|
__name: "vertical-filter-layout",
|
|
2599
2596
|
props: {
|
|
2600
2597
|
schema: {},
|
|
@@ -2605,58 +2602,58 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
|
|
|
2605
2602
|
limit: { default: 3 }
|
|
2606
2603
|
},
|
|
2607
2604
|
emits: ["change", "clear", "clearAll"],
|
|
2608
|
-
setup(
|
|
2609
|
-
const v =
|
|
2605
|
+
setup(i, { emit: n }) {
|
|
2606
|
+
const v = i, t = n, s = pe(), {
|
|
2610
2607
|
activeFilter: r,
|
|
2611
|
-
activeFilterCount:
|
|
2608
|
+
activeFilterCount: d,
|
|
2612
2609
|
onFilterChange: m,
|
|
2613
|
-
clearFilter:
|
|
2614
|
-
clearAllFilters:
|
|
2615
|
-
filtersSlot:
|
|
2610
|
+
clearFilter: c,
|
|
2611
|
+
clearAllFilters: x,
|
|
2612
|
+
filtersSlot: p
|
|
2616
2613
|
} = he({
|
|
2617
2614
|
...v,
|
|
2618
2615
|
slots: s
|
|
2619
2616
|
}, t);
|
|
2620
|
-
return (
|
|
2621
|
-
u("div",
|
|
2622
|
-
e(
|
|
2617
|
+
return (a, o) => a.view === "vertical" ? (f(), w("div", oo, [
|
|
2618
|
+
u("div", ao, [
|
|
2619
|
+
e(d) > 0 ? (f(), w("button", {
|
|
2623
2620
|
key: 0,
|
|
2624
|
-
onClick:
|
|
2625
|
-
(...
|
|
2621
|
+
onClick: o[0] || (o[0] = //@ts-ignore
|
|
2622
|
+
(...h) => e(x) && e(x)(...h)),
|
|
2626
2623
|
"data-popover-trigger": "",
|
|
2627
2624
|
"aria-haspopup": "dialog",
|
|
2628
2625
|
"aria-expanded": "false",
|
|
2629
2626
|
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",
|
|
2630
2627
|
type: "button"
|
|
2631
2628
|
}, " Очистити ")) : V("", !0),
|
|
2632
|
-
|
|
2633
|
-
name:
|
|
2629
|
+
a.schema ? (f(!0), w(R, { key: 1 }, W(Object.entries(a.schema), ([h, g]) => (f(), S(ae, P({
|
|
2630
|
+
name: h,
|
|
2634
2631
|
layout: "vertical"
|
|
2635
|
-
}, { ref_for: !0 },
|
|
2636
|
-
onChange:
|
|
2637
|
-
onClear:
|
|
2638
|
-
e(
|
|
2632
|
+
}, { ref_for: !0 }, g, {
|
|
2633
|
+
onChange: o[1] || (o[1] = (k) => e(m)(k.name, k.value)),
|
|
2634
|
+
onClear: o[2] || (o[2] = (k) => {
|
|
2635
|
+
e(c)(k), e(m)(k, void 0);
|
|
2639
2636
|
}),
|
|
2640
|
-
modelValue: e(r)[
|
|
2641
|
-
"onUpdate:modelValue": (k) => e(r)[
|
|
2637
|
+
modelValue: e(r)[h],
|
|
2638
|
+
"onUpdate:modelValue": (k) => e(r)[h] = k,
|
|
2642
2639
|
showClean: !0
|
|
2643
2640
|
}), null, 16, ["name", "modelValue", "onUpdate:modelValue"]))), 256)) : V("", !0),
|
|
2644
|
-
(
|
|
2645
|
-
key: "slot-" +
|
|
2641
|
+
(f(!0), w(R, null, W(e(p), (h, g) => (f(), S(ae, P({
|
|
2642
|
+
key: "slot-" + g,
|
|
2646
2643
|
layout: "vertical"
|
|
2647
|
-
}, { ref_for: !0 },
|
|
2648
|
-
onChange:
|
|
2649
|
-
onClear:
|
|
2650
|
-
e(
|
|
2644
|
+
}, { ref_for: !0 }, h.props, {
|
|
2645
|
+
onChange: o[3] || (o[3] = (k) => e(m)(k.name, k.value)),
|
|
2646
|
+
onClear: o[4] || (o[4] = (k) => {
|
|
2647
|
+
e(c)(k), e(m)(k, void 0);
|
|
2651
2648
|
}),
|
|
2652
|
-
modelValue: e(r)[
|
|
2653
|
-
"onUpdate:modelValue": (k) => e(r)[
|
|
2649
|
+
modelValue: e(r)[h.props.name],
|
|
2650
|
+
"onUpdate:modelValue": (k) => e(r)[h.props.name] = k,
|
|
2654
2651
|
showClean: !0
|
|
2655
2652
|
}), null, 16, ["modelValue", "onUpdate:modelValue"]))), 128))
|
|
2656
2653
|
])
|
|
2657
2654
|
])) : V("", !0);
|
|
2658
2655
|
}
|
|
2659
|
-
}),
|
|
2656
|
+
}), Ve = /* @__PURE__ */ O({
|
|
2660
2657
|
__name: "filter",
|
|
2661
2658
|
props: {
|
|
2662
2659
|
schema: {},
|
|
@@ -2667,22 +2664,22 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
|
|
|
2667
2664
|
limit: { default: 3 }
|
|
2668
2665
|
},
|
|
2669
2666
|
emits: ["change", "clear", "clearAll"],
|
|
2670
|
-
setup(
|
|
2671
|
-
const v =
|
|
2672
|
-
function r(
|
|
2667
|
+
setup(i, { emit: n }) {
|
|
2668
|
+
const v = i, t = _(v.value ?? {}), s = n;
|
|
2669
|
+
function r(p, a) {
|
|
2673
2670
|
t.value = {
|
|
2674
2671
|
...t.value,
|
|
2675
|
-
[
|
|
2672
|
+
[p]: a
|
|
2676
2673
|
}, s("change", {
|
|
2677
2674
|
data: Z(t.value),
|
|
2678
|
-
name:
|
|
2679
|
-
value:
|
|
2675
|
+
name: p,
|
|
2676
|
+
value: a
|
|
2680
2677
|
});
|
|
2681
2678
|
}
|
|
2682
|
-
function
|
|
2683
|
-
delete t.value[
|
|
2679
|
+
function d(p) {
|
|
2680
|
+
delete t.value[p], s("clear", {
|
|
2684
2681
|
data: Z(t.value),
|
|
2685
|
-
name:
|
|
2682
|
+
name: p
|
|
2686
2683
|
});
|
|
2687
2684
|
}
|
|
2688
2685
|
function m() {
|
|
@@ -2695,8 +2692,8 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
|
|
|
2695
2692
|
value: null
|
|
2696
2693
|
});
|
|
2697
2694
|
}
|
|
2698
|
-
const
|
|
2699
|
-
function
|
|
2695
|
+
const c = _({});
|
|
2696
|
+
function x() {
|
|
2700
2697
|
switch (v.view) {
|
|
2701
2698
|
case "inline":
|
|
2702
2699
|
return Ce;
|
|
@@ -2710,35 +2707,38 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
|
|
|
2710
2707
|
}
|
|
2711
2708
|
return M(
|
|
2712
2709
|
() => v.schema,
|
|
2713
|
-
(
|
|
2714
|
-
if (!
|
|
2715
|
-
|
|
2710
|
+
(p) => {
|
|
2711
|
+
if (!p) {
|
|
2712
|
+
c.value = {};
|
|
2716
2713
|
return;
|
|
2717
2714
|
}
|
|
2718
|
-
if (Array.isArray(
|
|
2719
|
-
|
|
2715
|
+
if (Array.isArray(p) && !p.length) {
|
|
2716
|
+
c.value = {};
|
|
2720
2717
|
return;
|
|
2721
2718
|
}
|
|
2722
|
-
Array.isArray(
|
|
2723
|
-
Object.assign(
|
|
2724
|
-
}),
|
|
2719
|
+
Array.isArray(p) ? c.value = p.filter((a) => a.type).reduce((a, o) => (Object.assign(o, { name: o.id || o.name, type: o.type.toLowerCase() }), a[o.name] = o, o.data && !o.api && !o.options && Object.assign(o, { api: `/api/suggest/${o.data}` }), a), {}) : (Object.entries(p).forEach(([a, o]) => {
|
|
2720
|
+
Object.assign(o, { name: a || o.name || o.id, type: o.type.toLowerCase() });
|
|
2721
|
+
}), c.value = { ...p });
|
|
2725
2722
|
},
|
|
2726
2723
|
{ immediate: !0, deep: !0 }
|
|
2727
|
-
), (
|
|
2728
|
-
schema:
|
|
2729
|
-
onChange:
|
|
2730
|
-
onClear:
|
|
2724
|
+
), (p, a) => (f(), S(ee(x()), P(v, {
|
|
2725
|
+
schema: c.value,
|
|
2726
|
+
onChange: a[0] || (a[0] = (o) => r(o.name, o.value)),
|
|
2727
|
+
onClear: a[1] || (a[1] = (o) => d(o.name)),
|
|
2731
2728
|
onClearAll: m
|
|
2732
2729
|
}), {
|
|
2733
2730
|
default: le(() => [
|
|
2734
|
-
ue(
|
|
2731
|
+
ue(p.$slots, "default")
|
|
2735
2732
|
]),
|
|
2736
2733
|
_: 3
|
|
2737
2734
|
}, 16, ["schema"]));
|
|
2738
2735
|
}
|
|
2739
2736
|
});
|
|
2737
|
+
Ve.install = function(n) {
|
|
2738
|
+
n.component("VsFilter", Ve);
|
|
2739
|
+
};
|
|
2740
2740
|
export {
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2741
|
+
Ve as Filter,
|
|
2742
|
+
ae as FilterField,
|
|
2743
|
+
Ve as default
|
|
2744
2744
|
};
|