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