@opengis/filter 0.1.15 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createElementBlock as w, openBlock as
|
|
2
|
-
import { notify as
|
|
3
|
-
const te = (
|
|
4
|
-
const
|
|
5
|
-
for (const [
|
|
6
|
-
|
|
7
|
-
return
|
|
1
|
+
import { createElementBlock as w, openBlock as s, createElementVNode as r, defineComponent as W, ref as A, withModifiers as se, normalizeClass as _, createCommentVNode as $, toDisplayString as B, computed as E, watch as I, createStaticVNode as Ne, Fragment as T, renderList as X, unref as e, createBlock as O, createVNode as q, createTextVNode as G, withDirectives as Y, vShow as J, getCurrentInstance as Pe, vModelText as ee, onBeforeUnmount as me, onMounted as de, isRef as Ye, Teleport as ge, normalizeStyle as be, renderSlot as ue, nextTick as pe, withCtx as ne, resolveDynamicComponent as oe, mergeProps as Z, toRaw as ce, cloneVNode as We, useSlots as fe, reactive as qe, withKeys as Ae, createSlots as Qe, normalizeProps as He, guardReactiveProps as Ge } from "vue";
|
|
2
|
+
import { notify as Be } from "@opengis/core";
|
|
3
|
+
const te = (t, o) => {
|
|
4
|
+
const p = t.__vccOpts || t;
|
|
5
|
+
for (const [l, i] of o)
|
|
6
|
+
p[l] = i;
|
|
7
|
+
return p;
|
|
8
8
|
}, Xe = {}, Ze = {
|
|
9
9
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10
10
|
width: "15px",
|
|
@@ -17,26 +17,26 @@ const te = (f, a) => {
|
|
|
17
17
|
"stroke-linejoin": "round",
|
|
18
18
|
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"
|
|
19
19
|
};
|
|
20
|
-
function Je(
|
|
21
|
-
return
|
|
22
|
-
|
|
20
|
+
function Je(t, o) {
|
|
21
|
+
return s(), w("svg", Ze, [...o[0] || (o[0] = [
|
|
22
|
+
r("path", {
|
|
23
23
|
stroke: "none",
|
|
24
24
|
d: "M0 0h24v24H0z",
|
|
25
25
|
fill: "none"
|
|
26
26
|
}, null, -1),
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
]));
|
|
27
|
+
r("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),
|
|
28
|
+
r("path", { d: "M20 4v5h-5" }, null, -1)
|
|
29
|
+
])]);
|
|
30
30
|
}
|
|
31
|
-
const et = /* @__PURE__ */ te(Xe, [["render", Je]]), tt = { class: "flex items-center justify-between w-full text-sm" }, lt = { class: "flex items-center cursor-pointer w-full" },
|
|
31
|
+
const et = /* @__PURE__ */ te(Xe, [["render", Je]]), tt = { class: "flex items-center justify-between w-full text-sm" }, lt = { class: "flex items-center cursor-pointer w-full" }, at = {
|
|
32
32
|
key: 0,
|
|
33
33
|
width: "16",
|
|
34
34
|
height: "auto",
|
|
35
35
|
src: "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTYgMTYnIGZpbGw9J3doaXRlJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMi4yMDcgNC43OTNhMSAxIDAgMDEwIDEuNDE0bC01IDVhMSAxIDAgMDEtMS40MTQgMGwtMi0yYTEgMSAwIDAxMS40MTQtMS40MTRMNi41IDkuMDg2bDQuMjkzLTQuMjkzYTEgMSAwIDAxMS40MTQgMHonLz48L3N2Zz4="
|
|
36
|
-
},
|
|
36
|
+
}, nt = ["value"], ot = { class: "w-[calc(100%-18px)] flex flex-row items-center justify-between pl-[10px]" }, rt = { class: "flex flex-row items-center font-normal text-gray-800 gap-x-1" }, st = {
|
|
37
37
|
key: 0,
|
|
38
38
|
class: "text-xs text-gray-500 dark:text-neutral-500 pr-1"
|
|
39
|
-
},
|
|
39
|
+
}, xe = /* @__PURE__ */ W({
|
|
40
40
|
__name: "list-item",
|
|
41
41
|
props: {
|
|
42
42
|
layout: {},
|
|
@@ -49,44 +49,44 @@ const et = /* @__PURE__ */ te(Xe, [["render", Je]]), tt = { class: "flex items-c
|
|
|
49
49
|
highlighted: { type: Boolean }
|
|
50
50
|
},
|
|
51
51
|
emits: ["itemClick"],
|
|
52
|
-
setup(
|
|
53
|
-
const
|
|
54
|
-
function
|
|
55
|
-
|
|
52
|
+
setup(t, { expose: o, emit: p }) {
|
|
53
|
+
const l = t, i = p;
|
|
54
|
+
function a() {
|
|
55
|
+
i("itemClick", l.value);
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
return
|
|
57
|
+
const v = A(null);
|
|
58
|
+
return o({ el: v }), (d, f) => (s(), w("div", {
|
|
59
59
|
class: "flex items-center w-full rounded-sm group hover:bg-gray-100",
|
|
60
60
|
ref_key: "el",
|
|
61
|
-
ref:
|
|
61
|
+
ref: v
|
|
62
62
|
}, [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
r("div", tt, [
|
|
64
|
+
r("div", lt, [
|
|
65
|
+
r("label", {
|
|
66
66
|
for: "radio-9740",
|
|
67
|
-
class:
|
|
68
|
-
["inline", "popover"].includes(
|
|
69
|
-
{ "bg-blue-100":
|
|
67
|
+
class: _([
|
|
68
|
+
["inline", "popover"].includes(t.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",
|
|
69
|
+
{ "bg-blue-100": t.highlighted }
|
|
70
70
|
]),
|
|
71
|
-
onClick: se(
|
|
71
|
+
onClick: se(a, ["stop", "prevent"])
|
|
72
72
|
}, [
|
|
73
|
-
|
|
74
|
-
class:
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
r("div", {
|
|
74
|
+
class: _(["w-[18px] h-[18px] border flex items-center justify-center", [
|
|
75
|
+
t.type == "checkbox" ? "rounded-[4px]" : "rounded-full",
|
|
76
|
+
t.color ? `bg-[${t.color}] border-[#ffffff]` : t.isSelected ? "bg-[#2563eb] border-[#ffffff]" : "bg-[#ffffff] border-[#d9d9d9]"
|
|
77
77
|
]])
|
|
78
78
|
}, [
|
|
79
|
-
|
|
79
|
+
t.isSelected ? (s(), w("img", at)) : $("", !0)
|
|
80
80
|
], 2),
|
|
81
|
-
|
|
81
|
+
r("input", {
|
|
82
82
|
type: "checkbox",
|
|
83
83
|
class: "hidden",
|
|
84
84
|
id: "radio-9740",
|
|
85
|
-
value:
|
|
86
|
-
}, null, 8,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
value: t.value
|
|
86
|
+
}, null, 8, nt),
|
|
87
|
+
r("div", ot, [
|
|
88
|
+
r("span", rt, B(t.label ?? "Відсутні данні"), 1),
|
|
89
|
+
t.count ? (s(), w("div", st, " (" + B(t.count) + ") ", 1)) : $("", !0)
|
|
90
90
|
])
|
|
91
91
|
], 2)
|
|
92
92
|
])
|
|
@@ -94,56 +94,56 @@ const et = /* @__PURE__ */ te(Xe, [["render", Je]]), tt = { class: "flex items-c
|
|
|
94
94
|
], 512));
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
|
-
function
|
|
97
|
+
function he(t, o) {
|
|
98
98
|
const {
|
|
99
|
-
options:
|
|
100
|
-
limit:
|
|
101
|
-
} =
|
|
102
|
-
function
|
|
103
|
-
return Array.isArray(
|
|
104
|
-
}
|
|
105
|
-
const
|
|
106
|
-
function k(
|
|
107
|
-
const b =
|
|
108
|
-
return { autoValueKey:
|
|
109
|
-
}
|
|
110
|
-
if (
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
const
|
|
115
|
-
const
|
|
116
|
-
return
|
|
99
|
+
options: p = [],
|
|
100
|
+
limit: l = 20
|
|
101
|
+
} = t;
|
|
102
|
+
function i(g) {
|
|
103
|
+
return Array.isArray(g) ? g[0] : g;
|
|
104
|
+
}
|
|
105
|
+
const a = A(i(t.modelValue)), v = A(""), d = A(!1), f = A([]), h = A("id"), c = A("text"), m = A(!1), y = A(t.layout !== "popover" && p.length > l);
|
|
106
|
+
function k(g) {
|
|
107
|
+
const b = g.find(Boolean) ?? {}, M = ["id", "value", "code", "key"].find((j) => j in b) ?? "id", U = ["text", "label", "name", "title"].find((j) => j in b) ?? "text";
|
|
108
|
+
return { autoValueKey: M, autoLabelKey: U };
|
|
109
|
+
}
|
|
110
|
+
if (p.length > 0) {
|
|
111
|
+
const g = k(p);
|
|
112
|
+
h.value = g.autoValueKey, c.value = g.autoLabelKey;
|
|
113
|
+
}
|
|
114
|
+
const V = E(() => {
|
|
115
|
+
const g = f.value;
|
|
116
|
+
return t.layout === "popover" || m.value ? g : g.slice(0, l);
|
|
117
117
|
});
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}, { immediate: !0 }),
|
|
121
|
-
function C(
|
|
122
|
-
return
|
|
118
|
+
I(() => t.modelValue, (g) => {
|
|
119
|
+
a.value = i(g);
|
|
120
|
+
}, { immediate: !0 }), f.value = [...p].sort((g, b) => t.sort === "count" ? b.count && g.count ? b.count - g.count : 0 : t.sort === "name" ? String(g[c.value] ?? "").localeCompare(String(b[c.value] ?? "")) : 0);
|
|
121
|
+
function C(g) {
|
|
122
|
+
return a.value === g[h.value];
|
|
123
123
|
}
|
|
124
|
-
function
|
|
125
|
-
|
|
124
|
+
function n(g) {
|
|
125
|
+
a.value = g[h.value], o("update:modelValue", a.value), o("change", { name: t.name, value: a.value });
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
|
|
127
|
+
function u() {
|
|
128
|
+
a.value = void 0, o("update:modelValue", a.value), o("clear", t.name);
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
|
|
130
|
+
function x() {
|
|
131
|
+
m.value = !m.value;
|
|
132
132
|
}
|
|
133
133
|
return {
|
|
134
|
-
innerValue:
|
|
135
|
-
searchTerm:
|
|
136
|
-
filteredOptions:
|
|
134
|
+
innerValue: a,
|
|
135
|
+
searchTerm: v,
|
|
136
|
+
filteredOptions: V,
|
|
137
137
|
isSelected: C,
|
|
138
|
-
selectItem:
|
|
139
|
-
clear:
|
|
140
|
-
toggleShowAll:
|
|
141
|
-
isReqProc:
|
|
142
|
-
showAll:
|
|
143
|
-
isEnableShowAll:
|
|
144
|
-
labelKey:
|
|
145
|
-
valueKey:
|
|
146
|
-
allOptions:
|
|
138
|
+
selectItem: n,
|
|
139
|
+
clear: u,
|
|
140
|
+
toggleShowAll: x,
|
|
141
|
+
isReqProc: d,
|
|
142
|
+
showAll: m,
|
|
143
|
+
isEnableShowAll: y,
|
|
144
|
+
labelKey: c,
|
|
145
|
+
valueKey: h,
|
|
146
|
+
allOptions: f
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
149
|
const it = {}, ut = {
|
|
@@ -152,12 +152,12 @@ const it = {}, ut = {
|
|
|
152
152
|
fill: "none",
|
|
153
153
|
xmlns: "http://www.w3.org/2000/svg"
|
|
154
154
|
};
|
|
155
|
-
function
|
|
156
|
-
return
|
|
155
|
+
function ct(t, o) {
|
|
156
|
+
return s(), w("svg", ut, [...o[0] || (o[0] = [
|
|
157
157
|
Ne('<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)
|
|
158
|
-
]));
|
|
158
|
+
])]);
|
|
159
159
|
}
|
|
160
|
-
const we = /* @__PURE__ */ te(it, [["render",
|
|
160
|
+
const we = /* @__PURE__ */ te(it, [["render", ct]]), dt = {}, ft = {
|
|
161
161
|
xmlns: "http://www.w3.org/2000/svg",
|
|
162
162
|
width: "24",
|
|
163
163
|
height: "24",
|
|
@@ -169,17 +169,17 @@ const we = /* @__PURE__ */ te(it, [["render", dt]]), ct = {}, ft = {
|
|
|
169
169
|
"stroke-linejoin": "round",
|
|
170
170
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate"
|
|
171
171
|
};
|
|
172
|
-
function
|
|
173
|
-
return
|
|
174
|
-
|
|
172
|
+
function mt(t, o) {
|
|
173
|
+
return s(), w("svg", ft, [...o[0] || (o[0] = [
|
|
174
|
+
r("path", {
|
|
175
175
|
stroke: "none",
|
|
176
176
|
d: "M0 0h24v24H0z",
|
|
177
177
|
fill: "none"
|
|
178
178
|
}, null, -1),
|
|
179
|
-
|
|
180
|
-
]));
|
|
179
|
+
r("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
180
|
+
])]);
|
|
181
181
|
}
|
|
182
|
-
const ve = /* @__PURE__ */ te(
|
|
182
|
+
const ve = /* @__PURE__ */ te(dt, [["render", mt]]), pt = {}, vt = {
|
|
183
183
|
xmlns: "http://www.w3.org/2000/svg",
|
|
184
184
|
width: "24",
|
|
185
185
|
height: "24",
|
|
@@ -191,26 +191,26 @@ const ve = /* @__PURE__ */ te(ct, [["render", pt]]), mt = {}, vt = {
|
|
|
191
191
|
"stroke-linejoin": "round",
|
|
192
192
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate-[180deg]"
|
|
193
193
|
};
|
|
194
|
-
function yt(
|
|
195
|
-
return
|
|
196
|
-
|
|
194
|
+
function yt(t, o) {
|
|
195
|
+
return s(), w("svg", vt, [...o[0] || (o[0] = [
|
|
196
|
+
r("path", {
|
|
197
197
|
stroke: "none",
|
|
198
198
|
d: "M0 0h24v24H0z",
|
|
199
199
|
fill: "none"
|
|
200
200
|
}, null, -1),
|
|
201
|
-
|
|
202
|
-
]));
|
|
201
|
+
r("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
202
|
+
])]);
|
|
203
203
|
}
|
|
204
|
-
const ke = /* @__PURE__ */ te(
|
|
204
|
+
const ke = /* @__PURE__ */ te(pt, [["render", yt]]), gt = {
|
|
205
205
|
key: 0,
|
|
206
206
|
class: "w-full"
|
|
207
|
-
}, bt = { class: "flex flex-col items-center justify-center p-5 text-center" },
|
|
207
|
+
}, bt = { class: "flex flex-col items-center justify-center p-5 text-center" }, xt = {
|
|
208
208
|
key: 0,
|
|
209
209
|
class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
|
|
210
|
-
},
|
|
210
|
+
}, ht = {
|
|
211
211
|
key: 1,
|
|
212
212
|
class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
|
|
213
|
-
}, wt = /* @__PURE__ */
|
|
213
|
+
}, wt = /* @__PURE__ */ W({
|
|
214
214
|
__name: "radio",
|
|
215
215
|
props: {
|
|
216
216
|
id: {},
|
|
@@ -239,161 +239,161 @@ const ke = /* @__PURE__ */ te(mt, [["render", yt]]), gt = {
|
|
|
239
239
|
itemClass: {}
|
|
240
240
|
},
|
|
241
241
|
emits: ["update:modelValue", "change", "clear"],
|
|
242
|
-
setup(
|
|
243
|
-
const
|
|
244
|
-
innerValue:
|
|
245
|
-
filteredOptions:
|
|
246
|
-
isSelected:
|
|
247
|
-
selectItem:
|
|
248
|
-
clear:
|
|
249
|
-
toggleShowAll:
|
|
250
|
-
isReqProc:
|
|
242
|
+
setup(t, { expose: o, emit: p }) {
|
|
243
|
+
const l = t, i = A(null), a = p, {
|
|
244
|
+
innerValue: v,
|
|
245
|
+
filteredOptions: d,
|
|
246
|
+
isSelected: f,
|
|
247
|
+
selectItem: h,
|
|
248
|
+
clear: c,
|
|
249
|
+
toggleShowAll: m,
|
|
250
|
+
isReqProc: y,
|
|
251
251
|
showAll: k,
|
|
252
|
-
isEnableShowAll:
|
|
252
|
+
isEnableShowAll: V,
|
|
253
253
|
labelKey: C,
|
|
254
|
-
valueKey:
|
|
255
|
-
allOptions:
|
|
256
|
-
} =
|
|
257
|
-
...
|
|
258
|
-
modelValue:
|
|
259
|
-
},
|
|
260
|
-
return
|
|
261
|
-
clear:
|
|
262
|
-
inputTextRef:
|
|
263
|
-
}),
|
|
264
|
-
() =>
|
|
265
|
-
(
|
|
266
|
-
|
|
254
|
+
valueKey: n,
|
|
255
|
+
allOptions: u
|
|
256
|
+
} = he({
|
|
257
|
+
...l,
|
|
258
|
+
modelValue: l.modelValue ?? l.default ?? ""
|
|
259
|
+
}, a);
|
|
260
|
+
return o({
|
|
261
|
+
clear: c,
|
|
262
|
+
inputTextRef: i
|
|
263
|
+
}), I(
|
|
264
|
+
() => l.modelValue,
|
|
265
|
+
(x) => {
|
|
266
|
+
x === void 0 && (v.value = void 0);
|
|
267
267
|
}
|
|
268
|
-
), (
|
|
269
|
-
class:
|
|
268
|
+
), (x, g) => (s(), w("div", {
|
|
269
|
+
class: _([t.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox"])
|
|
270
270
|
}, [
|
|
271
|
-
|
|
272
|
-
class:
|
|
273
|
-
|
|
274
|
-
|
|
271
|
+
r("div", {
|
|
272
|
+
class: _([
|
|
273
|
+
t.layout === "popover" ? "flex-1 overflow-y-auto p-2" : "",
|
|
274
|
+
t.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
|
|
275
275
|
])
|
|
276
276
|
}, [
|
|
277
|
-
(
|
|
278
|
-
layout:
|
|
279
|
-
key: b[e(
|
|
277
|
+
(s(!0), w(T, null, X(e(d), (b) => (s(), O(xe, {
|
|
278
|
+
layout: t.layout,
|
|
279
|
+
key: b[e(n)],
|
|
280
280
|
count: b.count,
|
|
281
281
|
label: b[e(C)],
|
|
282
282
|
color: b.color,
|
|
283
283
|
type: "radio",
|
|
284
|
-
value: b[e(
|
|
285
|
-
"is-selected": e(
|
|
286
|
-
onItemClick: (
|
|
284
|
+
value: b[e(n)],
|
|
285
|
+
"is-selected": e(f)(b),
|
|
286
|
+
onItemClick: (M) => e(h)(b)
|
|
287
287
|
}, null, 8, ["layout", "count", "label", "color", "value", "is-selected", "onItemClick"]))), 128))
|
|
288
288
|
], 2),
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
289
|
+
t.type === "select" && e(d).length === 0 && !e(y) ? (s(), w("div", gt, [
|
|
290
|
+
r("div", bt, [
|
|
291
|
+
q(we),
|
|
292
|
+
g[4] || (g[4] = r("div", { class: "max-w-sm mx-auto mt-6" }, [
|
|
293
|
+
r("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
|
|
294
|
+
r("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
|
|
295
295
|
], -1))
|
|
296
296
|
])
|
|
297
|
-
])) :
|
|
298
|
-
|
|
299
|
-
!e(k) && e(
|
|
297
|
+
])) : $("", !0),
|
|
298
|
+
t.layout !== "popover" && t.type !== "select" ? (s(), w(T, { key: 1 }, [
|
|
299
|
+
!e(k) && e(V) ? (s(), w("div", {
|
|
300
300
|
key: 0,
|
|
301
|
-
onClick:
|
|
302
|
-
(...b) => e(
|
|
301
|
+
onClick: g[0] || (g[0] = //@ts-ignore
|
|
302
|
+
(...b) => e(m) && e(m)(...b)),
|
|
303
303
|
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"
|
|
304
304
|
}, [
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
])) :
|
|
308
|
-
e(k) ? (
|
|
305
|
+
g[5] || (g[5] = G(" Показати більше ", -1)),
|
|
306
|
+
q(ve)
|
|
307
|
+
])) : $("", !0),
|
|
308
|
+
e(k) ? (s(), w("div", {
|
|
309
309
|
key: 1,
|
|
310
|
-
onClick:
|
|
311
|
-
(...b) => e(
|
|
310
|
+
onClick: g[1] || (g[1] = //@ts-ignore
|
|
311
|
+
(...b) => e(m) && e(m)(...b)),
|
|
312
312
|
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"
|
|
313
313
|
}, [
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
])) :
|
|
317
|
-
], 64)) :
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
G(B(e(
|
|
321
|
-
|
|
314
|
+
g[6] || (g[6] = G(" Показати менше ", -1)),
|
|
315
|
+
q(ke)
|
|
316
|
+
])) : $("", !0)
|
|
317
|
+
], 64)) : $("", !0),
|
|
318
|
+
t.cleanable ? (s(), w(T, { key: 2 }, [
|
|
319
|
+
t.layout === "inline" ? (s(), w("div", xt, [
|
|
320
|
+
G(B(e(v) || e(v) === null ? 1 : 0) + " з " + B(e(u).length) + " обрано ", 1),
|
|
321
|
+
Y(r("button", {
|
|
322
322
|
class: "text-gray-600 hover:text-gray-800",
|
|
323
|
-
onClick:
|
|
324
|
-
(...b) => e(
|
|
323
|
+
onClick: g[2] || (g[2] = //@ts-ignore
|
|
324
|
+
(...b) => e(c) && e(c)(...b))
|
|
325
325
|
}, " Очистити ", 512), [
|
|
326
|
-
[J, e(
|
|
326
|
+
[J, e(v) !== "" && e(v) !== void 0]
|
|
327
327
|
])
|
|
328
|
-
])) :
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
328
|
+
])) : $("", !0),
|
|
329
|
+
t.layout === "popover" ? (s(), w("div", ht, [
|
|
330
|
+
r("span", null, B(e(v) || e(v) === null ? 1 : 0) + " з " + B(e(u).length) + " обрано", 1),
|
|
331
|
+
Y(r("button", {
|
|
332
332
|
class: "text-gray-600 hover:text-gray-800",
|
|
333
|
-
onClick:
|
|
334
|
-
(...b) => e(
|
|
333
|
+
onClick: g[3] || (g[3] = //@ts-ignore
|
|
334
|
+
(...b) => e(c) && e(c)(...b))
|
|
335
335
|
}, " Очистити ", 512), [
|
|
336
|
-
[J, e(
|
|
336
|
+
[J, e(v) !== "" && e(v) !== void 0]
|
|
337
337
|
])
|
|
338
|
-
])) :
|
|
339
|
-
], 64)) :
|
|
338
|
+
])) : $("", !0)
|
|
339
|
+
], 64)) : $("", !0)
|
|
340
340
|
], 2));
|
|
341
341
|
}
|
|
342
342
|
});
|
|
343
|
-
function
|
|
343
|
+
function Le(t, o) {
|
|
344
344
|
const {
|
|
345
|
-
options:
|
|
346
|
-
limit:
|
|
347
|
-
} =
|
|
348
|
-
function
|
|
349
|
-
return Array.isArray(
|
|
350
|
-
}
|
|
351
|
-
const
|
|
352
|
-
function k(
|
|
353
|
-
const b =
|
|
354
|
-
return { autoValueKey:
|
|
355
|
-
}
|
|
356
|
-
if (
|
|
357
|
-
const
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
const
|
|
361
|
-
const
|
|
362
|
-
return
|
|
345
|
+
options: p = [],
|
|
346
|
+
limit: l = 20
|
|
347
|
+
} = t;
|
|
348
|
+
function i(g) {
|
|
349
|
+
return Array.isArray(g) ? g : g ? [g] : [];
|
|
350
|
+
}
|
|
351
|
+
const a = A(i(t.modelValue)), v = A(""), d = A(!1), f = A([]), h = A("id"), c = A("text"), m = A(!1), y = A(t.layout !== "popover" && p.length > l);
|
|
352
|
+
function k(g) {
|
|
353
|
+
const b = g.find(Boolean) ?? {}, M = ["id", "value", "code", "key"].find((j) => j in b) ?? "id", U = ["text", "label", "name", "title"].find((j) => j in b) ?? "text";
|
|
354
|
+
return { autoValueKey: M, autoLabelKey: U };
|
|
355
|
+
}
|
|
356
|
+
if (p.length > 0) {
|
|
357
|
+
const g = k(p);
|
|
358
|
+
h.value = g.autoValueKey, c.value = g.autoLabelKey;
|
|
359
|
+
}
|
|
360
|
+
const V = E(() => {
|
|
361
|
+
const g = f.value;
|
|
362
|
+
return t.layout === "popover" || m.value ? g : g.slice(0, l);
|
|
363
363
|
});
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
}, { immediate: !0 }),
|
|
367
|
-
function C(
|
|
368
|
-
return
|
|
364
|
+
I(() => t.modelValue, (g) => {
|
|
365
|
+
a.value = i(g);
|
|
366
|
+
}, { immediate: !0 }), f.value = [...p].sort((g, b) => t.sort === "count" ? b.count && g.count ? b.count - g.count : 0 : t.sort === "name" ? String(g[c.value]).localeCompare(String(b[c.value])) : 0);
|
|
367
|
+
function C(g) {
|
|
368
|
+
return a.value && a.value.includes(g[h.value]);
|
|
369
369
|
}
|
|
370
|
-
function
|
|
371
|
-
const b =
|
|
372
|
-
|
|
370
|
+
function n(g) {
|
|
371
|
+
const b = a.value.includes(g[h.value]);
|
|
372
|
+
a.value = b ? a.value.filter((M) => M !== g[h.value]) : [...a.value, g[h.value]], o("update:modelValue", a.value), o("change", { name: t.name, value: a.value });
|
|
373
373
|
}
|
|
374
|
-
function
|
|
375
|
-
|
|
374
|
+
function u() {
|
|
375
|
+
a.value = [], o("update:modelValue", a.value), o("clear", t.name);
|
|
376
376
|
}
|
|
377
|
-
function
|
|
378
|
-
|
|
377
|
+
function x() {
|
|
378
|
+
m.value = !m.value;
|
|
379
379
|
}
|
|
380
380
|
return {
|
|
381
|
-
innerValue:
|
|
382
|
-
searchTerm:
|
|
383
|
-
filteredOptions:
|
|
381
|
+
innerValue: a,
|
|
382
|
+
searchTerm: v,
|
|
383
|
+
filteredOptions: V,
|
|
384
384
|
isSelected: C,
|
|
385
|
-
selectItem:
|
|
386
|
-
clear:
|
|
387
|
-
toggleShowAll:
|
|
388
|
-
isReqProc:
|
|
389
|
-
showAll:
|
|
390
|
-
isEnableShowAll:
|
|
391
|
-
labelKey:
|
|
392
|
-
valueKey:
|
|
393
|
-
allOptions:
|
|
385
|
+
selectItem: n,
|
|
386
|
+
clear: u,
|
|
387
|
+
toggleShowAll: x,
|
|
388
|
+
isReqProc: d,
|
|
389
|
+
showAll: m,
|
|
390
|
+
isEnableShowAll: y,
|
|
391
|
+
labelKey: c,
|
|
392
|
+
valueKey: h,
|
|
393
|
+
allOptions: f
|
|
394
394
|
};
|
|
395
395
|
}
|
|
396
|
-
const
|
|
396
|
+
const Se = {
|
|
397
397
|
en: {
|
|
398
398
|
search: "Search",
|
|
399
399
|
more: "Show more",
|
|
@@ -431,29 +431,29 @@ const Be = {
|
|
|
431
431
|
selectFieldHelp: "Оберіть поле, щоб розпочати створення фільтра."
|
|
432
432
|
}
|
|
433
433
|
};
|
|
434
|
-
function
|
|
435
|
-
const
|
|
436
|
-
return (
|
|
434
|
+
function je(t) {
|
|
435
|
+
const o = t.split(".")[1], p = typeof window < "u" && window.localStorage ? localStorage.locale : null;
|
|
436
|
+
return (Se[p || navigator.language] || Se.uk)[o];
|
|
437
437
|
}
|
|
438
|
-
function
|
|
439
|
-
const
|
|
440
|
-
if (!
|
|
441
|
-
const
|
|
442
|
-
return (
|
|
443
|
-
const
|
|
444
|
-
return
|
|
438
|
+
function ae() {
|
|
439
|
+
const t = Pe();
|
|
440
|
+
if (!t.appContext.config.globalProperties.$i18n) return je;
|
|
441
|
+
const o = t.appContext.config.globalProperties.$t;
|
|
442
|
+
return (p) => {
|
|
443
|
+
const l = o(p);
|
|
444
|
+
return l === p ? je(p) : l;
|
|
445
445
|
};
|
|
446
446
|
}
|
|
447
447
|
const kt = {
|
|
448
448
|
key: 0,
|
|
449
449
|
class: "w-full"
|
|
450
|
-
}, Ct = { class: "flex flex-col items-center justify-center p-5 text-center" },
|
|
450
|
+
}, Ct = { class: "flex flex-col items-center justify-center p-5 text-center" }, Vt = { class: "max-w-sm mx-auto mt-6" }, $t = { class: "font-medium text-gray-800 dark:text-neutral-200" }, At = {
|
|
451
451
|
key: 0,
|
|
452
452
|
class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
|
|
453
|
-
},
|
|
453
|
+
}, Bt = {
|
|
454
454
|
key: 1,
|
|
455
455
|
class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
|
|
456
|
-
},
|
|
456
|
+
}, De = /* @__PURE__ */ W({
|
|
457
457
|
__name: "checkbox",
|
|
458
458
|
props: {
|
|
459
459
|
id: {},
|
|
@@ -482,105 +482,105 @@ const kt = {
|
|
|
482
482
|
itemClass: {}
|
|
483
483
|
},
|
|
484
484
|
emits: ["update:modelValue", "change", "clear"],
|
|
485
|
-
setup(
|
|
486
|
-
const
|
|
487
|
-
innerValue:
|
|
488
|
-
filteredOptions:
|
|
489
|
-
isSelected:
|
|
490
|
-
selectItem:
|
|
491
|
-
clear:
|
|
492
|
-
toggleShowAll:
|
|
493
|
-
isReqProc:
|
|
485
|
+
setup(t, { expose: o, emit: p }) {
|
|
486
|
+
const l = ae(), i = t, a = p, {
|
|
487
|
+
innerValue: v,
|
|
488
|
+
filteredOptions: d,
|
|
489
|
+
isSelected: f,
|
|
490
|
+
selectItem: h,
|
|
491
|
+
clear: c,
|
|
492
|
+
toggleShowAll: m,
|
|
493
|
+
isReqProc: y,
|
|
494
494
|
showAll: k,
|
|
495
|
-
isEnableShowAll:
|
|
495
|
+
isEnableShowAll: V,
|
|
496
496
|
labelKey: C,
|
|
497
|
-
valueKey:
|
|
498
|
-
allOptions:
|
|
499
|
-
} =
|
|
500
|
-
...
|
|
501
|
-
modelValue:
|
|
502
|
-
},
|
|
503
|
-
return
|
|
504
|
-
() =>
|
|
505
|
-
(
|
|
506
|
-
|
|
497
|
+
valueKey: n,
|
|
498
|
+
allOptions: u
|
|
499
|
+
} = Le({
|
|
500
|
+
...i,
|
|
501
|
+
modelValue: i.modelValue
|
|
502
|
+
}, a);
|
|
503
|
+
return I(
|
|
504
|
+
() => i.modelValue,
|
|
505
|
+
(x) => {
|
|
506
|
+
x === void 0 && (v.value = []);
|
|
507
507
|
}
|
|
508
|
-
),
|
|
509
|
-
clear:
|
|
510
|
-
}), (
|
|
511
|
-
class:
|
|
508
|
+
), o({
|
|
509
|
+
clear: c
|
|
510
|
+
}), (x, g) => (s(), w("div", {
|
|
511
|
+
class: _([t.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
|
|
512
512
|
}, [
|
|
513
|
-
|
|
514
|
-
class:
|
|
515
|
-
|
|
516
|
-
|
|
513
|
+
r("div", {
|
|
514
|
+
class: _([
|
|
515
|
+
t.layout === "popover" ? "flex-1 overflow-y-auto p-2" : "",
|
|
516
|
+
t.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
|
|
517
517
|
])
|
|
518
518
|
}, [
|
|
519
|
-
(
|
|
520
|
-
layout:
|
|
519
|
+
(s(!0), w(T, null, X(e(d), (b) => (s(), O(xe, {
|
|
520
|
+
layout: t.layout,
|
|
521
521
|
count: b.count,
|
|
522
522
|
label: b[e(C)],
|
|
523
523
|
color: b.color,
|
|
524
524
|
type: "checkbox",
|
|
525
|
-
value: b[e(
|
|
526
|
-
"is-selected": e(
|
|
527
|
-
onItemClick: (
|
|
525
|
+
value: b[e(n)],
|
|
526
|
+
"is-selected": e(f)(b),
|
|
527
|
+
onItemClick: (M) => e(h)(b)
|
|
528
528
|
}, null, 8, ["layout", "count", "label", "color", "value", "is-selected", "onItemClick"]))), 256))
|
|
529
529
|
], 2),
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
530
|
+
t.type === "select" && e(d).length === 0 && !e(y) ? (s(), w("div", kt, [
|
|
531
|
+
r("div", Ct, [
|
|
532
|
+
q(we),
|
|
533
|
+
r("div", Vt, [
|
|
534
|
+
r("p", $t, B(e(l)("filter.notfound")), 1),
|
|
535
|
+
g[4] || (g[4] = r("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" }, null, -1))
|
|
536
536
|
])
|
|
537
537
|
])
|
|
538
|
-
])) :
|
|
539
|
-
|
|
540
|
-
!e(k) && e(
|
|
538
|
+
])) : $("", !0),
|
|
539
|
+
t.layout !== "popover" && t.type !== "select" ? (s(), w(T, { key: 1 }, [
|
|
540
|
+
!e(k) && e(V) ? (s(), w("div", {
|
|
541
541
|
key: 0,
|
|
542
|
-
onClick:
|
|
543
|
-
(...b) => e(
|
|
542
|
+
onClick: g[0] || (g[0] = //@ts-ignore
|
|
543
|
+
(...b) => e(m) && e(m)(...b)),
|
|
544
544
|
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"
|
|
545
545
|
}, [
|
|
546
|
-
G(B(e(
|
|
547
|
-
|
|
548
|
-
])) :
|
|
549
|
-
e(k) ? (
|
|
546
|
+
G(B(e(l)("filter.more")) + " ", 1),
|
|
547
|
+
q(ve)
|
|
548
|
+
])) : $("", !0),
|
|
549
|
+
e(k) ? (s(), w("div", {
|
|
550
550
|
key: 1,
|
|
551
|
-
onClick:
|
|
552
|
-
(...b) => e(
|
|
551
|
+
onClick: g[1] || (g[1] = //@ts-ignore
|
|
552
|
+
(...b) => e(m) && e(m)(...b)),
|
|
553
553
|
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"
|
|
554
554
|
}, [
|
|
555
|
-
G(B(e(
|
|
556
|
-
|
|
557
|
-
])) :
|
|
558
|
-
], 64)) :
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
G(B(e(
|
|
562
|
-
|
|
555
|
+
G(B(e(l)("filter.less")) + " ", 1),
|
|
556
|
+
q(ke)
|
|
557
|
+
])) : $("", !0)
|
|
558
|
+
], 64)) : $("", !0),
|
|
559
|
+
t.cleanable ? (s(), w(T, { key: 2 }, [
|
|
560
|
+
t.layout === "inline" ? (s(), w("div", At, [
|
|
561
|
+
G(B(e(v).length) + " / " + B(e(u).length) + " " + B(e(l)("filter.selected")) + " ", 1),
|
|
562
|
+
Y(r("button", {
|
|
563
563
|
class: "text-gray-600 hover:text-gray-800",
|
|
564
|
-
onClick:
|
|
565
|
-
(...b) => e(
|
|
566
|
-
}, B(e(
|
|
567
|
-
[J, e(
|
|
564
|
+
onClick: g[2] || (g[2] = //@ts-ignore
|
|
565
|
+
(...b) => e(c) && e(c)(...b))
|
|
566
|
+
}, B(e(l)("filter.clear")), 513), [
|
|
567
|
+
[J, e(v).length !== 0]
|
|
568
568
|
])
|
|
569
|
-
])) :
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
569
|
+
])) : $("", !0),
|
|
570
|
+
t.layout === "popover" ? (s(), w("div", Bt, [
|
|
571
|
+
r("span", null, B(e(v).length) + " / " + B(e(u).length) + " " + B(e(l)("filter.selected")), 1),
|
|
572
|
+
Y(r("button", {
|
|
573
573
|
class: "text-gray-600 hover:text-gray-800",
|
|
574
|
-
onClick:
|
|
575
|
-
(...b) => e(
|
|
576
|
-
}, B(e(
|
|
577
|
-
[J, e(
|
|
574
|
+
onClick: g[3] || (g[3] = //@ts-ignore
|
|
575
|
+
(...b) => e(c) && e(c)(...b))
|
|
576
|
+
}, B(e(l)("filter.clear")), 513), [
|
|
577
|
+
[J, e(v).length !== 0]
|
|
578
578
|
])
|
|
579
|
-
])) :
|
|
580
|
-
], 64)) :
|
|
579
|
+
])) : $("", !0)
|
|
580
|
+
], 64)) : $("", !0)
|
|
581
581
|
], 2));
|
|
582
582
|
}
|
|
583
|
-
}),
|
|
583
|
+
}), St = {}, jt = {
|
|
584
584
|
xmlns: "http://www.w3.org/2000/svg",
|
|
585
585
|
width: "15px",
|
|
586
586
|
height: "15px",
|
|
@@ -592,18 +592,18 @@ const kt = {
|
|
|
592
592
|
"stroke-linejoin": "round",
|
|
593
593
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"
|
|
594
594
|
};
|
|
595
|
-
function
|
|
596
|
-
return
|
|
597
|
-
|
|
595
|
+
function Dt(t, o) {
|
|
596
|
+
return s(), w("svg", jt, [...o[0] || (o[0] = [
|
|
597
|
+
r("path", {
|
|
598
598
|
stroke: "none",
|
|
599
599
|
d: "M0 0h24v24H0z",
|
|
600
600
|
fill: "none"
|
|
601
601
|
}, null, -1),
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
]));
|
|
602
|
+
r("path", { d: "M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" }, null, -1),
|
|
603
|
+
r("path", { d: "M21 21l-6 -6" }, null, -1)
|
|
604
|
+
])]);
|
|
605
605
|
}
|
|
606
|
-
const
|
|
606
|
+
const _e = /* @__PURE__ */ te(St, [["render", Dt]]), Rt = {}, Ft = {
|
|
607
607
|
xmlns: "http://www.w3.org/2000/svg",
|
|
608
608
|
viewBox: "0 0 24 24",
|
|
609
609
|
fill: "none",
|
|
@@ -615,24 +615,24 @@ const Le = /* @__PURE__ */ te(Bt, [["render", jt]]), Dt = {}, Rt = {
|
|
|
615
615
|
width: "15px",
|
|
616
616
|
height: "15px"
|
|
617
617
|
};
|
|
618
|
-
function
|
|
619
|
-
return
|
|
620
|
-
|
|
618
|
+
function Kt(t, o) {
|
|
619
|
+
return s(), w("svg", Ft, [...o[0] || (o[0] = [
|
|
620
|
+
r("path", {
|
|
621
621
|
stroke: "none",
|
|
622
622
|
d: "M0 0h24v24H0z",
|
|
623
623
|
fill: "none"
|
|
624
624
|
}, null, -1),
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
]));
|
|
625
|
+
r("path", { d: "M18 6l-12 12" }, null, -1),
|
|
626
|
+
r("path", { d: "M6 6l12 12" }, null, -1)
|
|
627
|
+
])]);
|
|
628
628
|
}
|
|
629
|
-
const Ce = /* @__PURE__ */ te(
|
|
629
|
+
const Ce = /* @__PURE__ */ te(Rt, [["render", Kt]]);
|
|
630
630
|
class Ee {
|
|
631
|
-
static getWidthClass(
|
|
632
|
-
return typeof
|
|
631
|
+
static getWidthClass(o) {
|
|
632
|
+
return typeof o == "number" ? `max-w-[${o}px] min-w-[${o}px]` : typeof o == "string" ? o.endsWith("%") || o.endsWith("px") ? `max-w-[${o}]` : `max-w-${o}` : "w-full";
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
|
-
const
|
|
635
|
+
const Mt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3" }, Lt = ["placeholder"], _t = /* @__PURE__ */ W({
|
|
636
636
|
__name: "text-input",
|
|
637
637
|
props: {
|
|
638
638
|
id: {},
|
|
@@ -661,60 +661,60 @@ const Kt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"
|
|
|
661
661
|
itemClass: {}
|
|
662
662
|
},
|
|
663
663
|
emits: ["update:modelValue", "change", "clear"],
|
|
664
|
-
setup(
|
|
665
|
-
const
|
|
666
|
-
|
|
667
|
-
() =>
|
|
668
|
-
(
|
|
669
|
-
|
|
664
|
+
setup(t, { emit: o }) {
|
|
665
|
+
const p = t, l = A((p.placeholder || p.label || p.title || p.name || "search").toString()), i = o, a = A(p.modelValue?.toString() ?? "");
|
|
666
|
+
I(
|
|
667
|
+
() => p.modelValue,
|
|
668
|
+
(h) => {
|
|
669
|
+
h !== a.value && (a.value = h?.toString() ?? "");
|
|
670
670
|
}
|
|
671
671
|
);
|
|
672
|
-
let
|
|
673
|
-
function
|
|
674
|
-
if (
|
|
675
|
-
|
|
672
|
+
let v = null;
|
|
673
|
+
function d() {
|
|
674
|
+
if (a.value = a.value.trimStart(), a.value.length === 0) {
|
|
675
|
+
f();
|
|
676
676
|
return;
|
|
677
677
|
}
|
|
678
|
-
|
|
679
|
-
|
|
678
|
+
v && clearTimeout(v), v = setTimeout(() => {
|
|
679
|
+
i("update:modelValue", a.value), i("change", { name: p.name, value: a.value });
|
|
680
680
|
}, 300);
|
|
681
681
|
}
|
|
682
|
-
function
|
|
683
|
-
|
|
682
|
+
function f() {
|
|
683
|
+
a.value = "", i("update:modelValue", ""), i("clear", p.name);
|
|
684
684
|
}
|
|
685
|
-
return (
|
|
686
|
-
class:
|
|
685
|
+
return (h, c) => (s(), w("div", {
|
|
686
|
+
class: _([
|
|
687
687
|
"vs-form-text relative bg-white rounded-sm [&>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-sm [&>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",
|
|
688
|
-
|
|
688
|
+
t.layout === "inline" ? e(Ee).getWidthClass(t.width) : "mb-2" + (t.layout === "popover" ? " m-2" : "")
|
|
689
689
|
])
|
|
690
690
|
}, [
|
|
691
|
-
|
|
692
|
-
|
|
691
|
+
r("div", Mt, [
|
|
692
|
+
q(_e)
|
|
693
693
|
]),
|
|
694
|
-
|
|
694
|
+
a.value !== "" ? (s(), w("div", {
|
|
695
695
|
key: 0,
|
|
696
|
-
onClick:
|
|
696
|
+
onClick: f,
|
|
697
697
|
class: "absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer"
|
|
698
698
|
}, [
|
|
699
|
-
|
|
700
|
-
])) :
|
|
701
|
-
|
|
699
|
+
q(Ce)
|
|
700
|
+
])) : $("", !0),
|
|
701
|
+
Y(r("input", {
|
|
702
702
|
type: "text",
|
|
703
|
-
"onUpdate:modelValue":
|
|
704
|
-
onInput:
|
|
705
|
-
placeholder:
|
|
703
|
+
"onUpdate:modelValue": c[0] || (c[0] = (m) => a.value = m),
|
|
704
|
+
onInput: d,
|
|
705
|
+
placeholder: l.value,
|
|
706
706
|
class: "!pr-7 !pl-8 bg-white h-[38px] min-w-[100px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-sm 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"
|
|
707
|
-
}, null, 40,
|
|
708
|
-
[ee,
|
|
707
|
+
}, null, 40, Lt), [
|
|
708
|
+
[ee, a.value]
|
|
709
709
|
])
|
|
710
710
|
], 2));
|
|
711
711
|
}
|
|
712
712
|
});
|
|
713
|
-
function Oe(
|
|
714
|
-
return
|
|
715
|
-
const
|
|
713
|
+
function Oe(t = { color: "blue" }) {
|
|
714
|
+
return E(() => {
|
|
715
|
+
const p = `w-full px-3 py-2 border-solid border border-gray-300 text-sm rounded focus:outline-none focus:ring-2 focus:ring-${t.color}-500 focus:border-transparent
|
|
716
716
|
text-gray-800 bg-white dark:text-neutral-300 dark:bg-neutral-800 dark:border-neutral-600`;
|
|
717
|
-
return
|
|
717
|
+
return t?.size === "sm" ? `${p}h-[32px]` : `${p}h-[38px]`;
|
|
718
718
|
});
|
|
719
719
|
}
|
|
720
720
|
function Et() {
|
|
@@ -723,8 +723,8 @@ function Et() {
|
|
|
723
723
|
function Ot() {
|
|
724
724
|
return "font-medium border border-gray-200 border-solid disabled:pointer-events-none disabled:opacity-50 h-7 rounded-md text-xs px-2 py-1 text-gray-800 bg-white hover:bg-gray-100 dark:text-neutral-300 dark:bg-neutral-800 dark:hover:bg-neutral-700 dark:border-neutral-600";
|
|
725
725
|
}
|
|
726
|
-
function Te(
|
|
727
|
-
return
|
|
726
|
+
function Te(t) {
|
|
727
|
+
return t === "ghost" ? "inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-sm border 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" : t === "soft" ? "inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-sm border bg-white-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-1 bg-transparent h-[38px]";
|
|
728
728
|
}
|
|
729
729
|
const Tt = {
|
|
730
730
|
key: 0,
|
|
@@ -736,7 +736,7 @@ const Tt = {
|
|
|
736
736
|
key: 0,
|
|
737
737
|
class: "block text-xs font-medium text-gray-600 mb-1"
|
|
738
738
|
}, Nt = ["placeholder", "disabled"], Pt = ["disabled"];
|
|
739
|
-
const Yt = /* @__PURE__ */
|
|
739
|
+
const Yt = /* @__PURE__ */ W({
|
|
740
740
|
__name: "range-input",
|
|
741
741
|
props: {
|
|
742
742
|
id: {},
|
|
@@ -765,208 +765,208 @@ const Yt = /* @__PURE__ */ q({
|
|
|
765
765
|
itemClass: {}
|
|
766
766
|
},
|
|
767
767
|
emits: ["update:modelValue", "change", "clear"],
|
|
768
|
-
setup(
|
|
769
|
-
const
|
|
770
|
-
|
|
771
|
-
),
|
|
772
|
-
get: () =>
|
|
773
|
-
set: (
|
|
774
|
-
|
|
768
|
+
setup(t, { expose: o, emit: p }) {
|
|
769
|
+
const l = Oe(), i = Et(), a = ae(), v = t, d = A(
|
|
770
|
+
v.modelValue ?? v.default ?? []
|
|
771
|
+
), f = p, h = E({
|
|
772
|
+
get: () => v.modelValue ?? d.value,
|
|
773
|
+
set: (y) => {
|
|
774
|
+
v.modelValue !== void 0 ? f("update:modelValue", y) : d.value = y;
|
|
775
775
|
}
|
|
776
776
|
});
|
|
777
|
-
function
|
|
778
|
-
|
|
777
|
+
function c() {
|
|
778
|
+
f("change", { name: v.name, value: h.value || d.value });
|
|
779
779
|
}
|
|
780
|
-
function
|
|
781
|
-
|
|
780
|
+
function m() {
|
|
781
|
+
d.value = [], h.value = d.value, f("clear", v.name);
|
|
782
782
|
}
|
|
783
|
-
return
|
|
784
|
-
|
|
785
|
-
}),
|
|
786
|
-
clear:
|
|
787
|
-
currentValue:
|
|
788
|
-
}), (
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
class:
|
|
783
|
+
return I(() => v.modelValue, (y) => {
|
|
784
|
+
y !== void 0 && v.layout !== "popover" ? (d.value = y, f("update:modelValue", y)) : d.value = [];
|
|
785
|
+
}), o({
|
|
786
|
+
clear: m,
|
|
787
|
+
currentValue: h
|
|
788
|
+
}), (y, k) => (s(), w(T, null, [
|
|
789
|
+
r("div", null, [
|
|
790
|
+
r("div", {
|
|
791
|
+
class: _(t.layout === "vertical" ? "inline-flex items-center gap-2" : "space-y-3 p-2")
|
|
792
792
|
}, [
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
793
|
+
r("div", null, [
|
|
794
|
+
t.layout !== "vertical" ? (s(), w("label", Tt, B(e(a)("filter.from")), 1)) : $("", !0),
|
|
795
|
+
Y(r("input", {
|
|
796
796
|
type: "number",
|
|
797
|
-
class:
|
|
798
|
-
placeholder:
|
|
797
|
+
class: _(e(l)),
|
|
798
|
+
placeholder: t.placeholder?.[0] ?? "min",
|
|
799
799
|
step: "1",
|
|
800
800
|
style: { outline: "none" },
|
|
801
|
-
"onUpdate:modelValue": k[0] || (k[0] = (
|
|
802
|
-
disabled:
|
|
801
|
+
"onUpdate:modelValue": k[0] || (k[0] = (V) => h.value[0] = V),
|
|
802
|
+
disabled: t.disabled
|
|
803
803
|
}, null, 10, It), [
|
|
804
|
-
[ee,
|
|
804
|
+
[ee, h.value[0]]
|
|
805
805
|
])
|
|
806
806
|
]),
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
807
|
+
t.layout === "vertical" ? (s(), w("label", Ut, " - ")) : $("", !0),
|
|
808
|
+
r("div", null, [
|
|
809
|
+
t.layout !== "vertical" ? (s(), w("label", zt, B(e(a)("filter.to")), 1)) : $("", !0),
|
|
810
|
+
Y(r("input", {
|
|
811
811
|
type: "number",
|
|
812
|
-
class:
|
|
813
|
-
placeholder:
|
|
812
|
+
class: _(e(l)),
|
|
813
|
+
placeholder: t.placeholder?.[1] ?? "max",
|
|
814
814
|
min: "0",
|
|
815
815
|
max: "1000000000000000",
|
|
816
816
|
step: "1",
|
|
817
817
|
style: { outline: "none" },
|
|
818
|
-
"onUpdate:modelValue": k[1] || (k[1] = (
|
|
819
|
-
disabled:
|
|
818
|
+
"onUpdate:modelValue": k[1] || (k[1] = (V) => h.value[1] = V),
|
|
819
|
+
disabled: t.disabled
|
|
820
820
|
}, null, 10, Nt), [
|
|
821
|
-
[ee,
|
|
821
|
+
[ee, h.value[1]]
|
|
822
822
|
])
|
|
823
823
|
]),
|
|
824
|
-
["popover", "inline", "vertical"].includes(
|
|
824
|
+
["popover", "inline", "vertical"].includes(t.layout) ? (s(), w("button", {
|
|
825
825
|
key: 1,
|
|
826
|
-
onClick:
|
|
827
|
-
class:
|
|
828
|
-
}, B(
|
|
829
|
-
["popover", "inline"].includes(
|
|
826
|
+
onClick: c,
|
|
827
|
+
class: _(e(i) + (t.layout === "vertical" ? " w-[50px]" : " bg-blue-100 hover:bg-blue-200"))
|
|
828
|
+
}, B(t.layout === "vertical" ? "Ok" : e(a)("filter.apply")), 3)) : $("", !0),
|
|
829
|
+
["popover", "inline"].includes(t.layout) ? (s(), w("button", {
|
|
830
830
|
key: 2,
|
|
831
|
-
disabled: !(
|
|
832
|
-
onClick:
|
|
833
|
-
class:
|
|
834
|
-
}, B(e(
|
|
831
|
+
disabled: !(h.value[0] || h.value[1]),
|
|
832
|
+
onClick: m,
|
|
833
|
+
class: _(e(i) + " hover:bg-gray-100")
|
|
834
|
+
}, B(e(a)("filter.clear")), 11, Pt)) : $("", !0)
|
|
835
835
|
], 2)
|
|
836
836
|
]),
|
|
837
|
-
(
|
|
837
|
+
(t.cleanable && d.value.length, $("", !0))
|
|
838
838
|
], 64));
|
|
839
839
|
}
|
|
840
840
|
});
|
|
841
841
|
class H {
|
|
842
|
-
static format(
|
|
843
|
-
const
|
|
844
|
-
return `${
|
|
845
|
-
}
|
|
846
|
-
static getShiftedDay(
|
|
847
|
-
const
|
|
848
|
-
return
|
|
849
|
-
}
|
|
850
|
-
static getLastWeekRange(
|
|
851
|
-
if (
|
|
852
|
-
const
|
|
853
|
-
return
|
|
842
|
+
static format(o) {
|
|
843
|
+
const p = o.getFullYear(), l = (o.getMonth() + 1).toString().padStart(2, "0"), i = o.getDate().toString().padStart(2, "0");
|
|
844
|
+
return `${p}-${l}-${i}`;
|
|
845
|
+
}
|
|
846
|
+
static getShiftedDay(o, p = 0) {
|
|
847
|
+
const l = o ? new Date(o) : /* @__PURE__ */ new Date();
|
|
848
|
+
return l.setDate(l.getDate() + p), this.format(l);
|
|
849
|
+
}
|
|
850
|
+
static getLastWeekRange(o, p, l = 0) {
|
|
851
|
+
if (o && p) {
|
|
852
|
+
const h = new Date(o), c = new Date(p);
|
|
853
|
+
return h.setDate(h.getDate() + l * 7), c.setDate(c.getDate() + l * 7), [this.format(h), this.format(c)];
|
|
854
854
|
}
|
|
855
|
-
const
|
|
856
|
-
|
|
857
|
-
const
|
|
858
|
-
return
|
|
859
|
-
}
|
|
860
|
-
static getMonthRange(
|
|
861
|
-
let
|
|
862
|
-
|
|
863
|
-
const
|
|
864
|
-
return [this.format(
|
|
865
|
-
}
|
|
866
|
-
static getQuarterRange(
|
|
867
|
-
const
|
|
868
|
-
let
|
|
869
|
-
|
|
870
|
-
const
|
|
871
|
-
return [this.format(
|
|
872
|
-
}
|
|
873
|
-
static getYear(
|
|
874
|
-
let
|
|
875
|
-
return
|
|
876
|
-
}
|
|
877
|
-
static getYearRange(
|
|
878
|
-
let
|
|
879
|
-
return
|
|
880
|
-
this.format(new Date(
|
|
881
|
-
this.format(new Date(
|
|
855
|
+
const i = /* @__PURE__ */ new Date(), a = i.getDay(), v = a === 0 ? 13 : a - 1 + 7, d = new Date(i);
|
|
856
|
+
d.setDate(i.getDate() - v + l * 7);
|
|
857
|
+
const f = new Date(d);
|
|
858
|
+
return f.setDate(d.getDate() + 6), [this.format(d), this.format(f)];
|
|
859
|
+
}
|
|
860
|
+
static getMonthRange(o, p, l = 0) {
|
|
861
|
+
let i;
|
|
862
|
+
o ? i = new Date(o) : i = /* @__PURE__ */ new Date(), i = new Date(i.getFullYear(), i.getMonth() + l, 1);
|
|
863
|
+
const a = i, v = new Date(i.getFullYear(), i.getMonth() + 1, 0);
|
|
864
|
+
return [this.format(a), this.format(v)];
|
|
865
|
+
}
|
|
866
|
+
static getQuarterRange(o, p, l = 0) {
|
|
867
|
+
const i = o || p, a = i ? new Date(i) : /* @__PURE__ */ new Date();
|
|
868
|
+
let v = Math.floor(a.getMonth() / 3);
|
|
869
|
+
v += l;
|
|
870
|
+
const d = (v % 4 + 4) % 4 * 3, f = a.getFullYear() + Math.floor(v / 4), h = new Date(f, d, 1), c = new Date(f, d + 3, 0);
|
|
871
|
+
return [this.format(h), this.format(c)];
|
|
872
|
+
}
|
|
873
|
+
static getYear(o, p = 0) {
|
|
874
|
+
let l;
|
|
875
|
+
return o && /^\d{4}$/.test(o) ? l = parseInt(o, 10) : o ? l = new Date(o).getFullYear() : l = (/* @__PURE__ */ new Date()).getFullYear(), String(l + p);
|
|
876
|
+
}
|
|
877
|
+
static getYearRange(o, p = 0) {
|
|
878
|
+
let l;
|
|
879
|
+
return o && /^\d{4}$/.test(o) ? l = parseInt(o, 10) : o ? l = new Date(o).getFullYear() : l = (/* @__PURE__ */ new Date()).getFullYear(), [
|
|
880
|
+
this.format(new Date(l + p, 0, 1)),
|
|
881
|
+
this.format(new Date(l + p + 1, 0, 0))
|
|
882
882
|
];
|
|
883
883
|
}
|
|
884
|
-
static getRangeFromDaysBefore(
|
|
885
|
-
const
|
|
886
|
-
return
|
|
884
|
+
static getRangeFromDaysBefore(o) {
|
|
885
|
+
const p = /* @__PURE__ */ new Date(), l = new Date(p.getTime());
|
|
886
|
+
return l.setDate(p.getDate() - o), [this.format(l), this.format(p)];
|
|
887
887
|
}
|
|
888
888
|
}
|
|
889
|
-
function Ie(
|
|
889
|
+
function Ie(t, o) {
|
|
890
890
|
const {
|
|
891
|
-
popoverRef:
|
|
892
|
-
} =
|
|
893
|
-
|
|
894
|
-
),
|
|
895
|
-
function
|
|
896
|
-
const
|
|
897
|
-
return
|
|
891
|
+
popoverRef: p
|
|
892
|
+
} = t, l = ae(), i = A(""), a = A(
|
|
893
|
+
t.modelValue ?? t.default ?? []
|
|
894
|
+
), v = A(0);
|
|
895
|
+
function d() {
|
|
896
|
+
const u = H.getRangeFromDaysBefore(v.value);
|
|
897
|
+
return a.value = [...u], o("change", { name: t.name, value: a.value }), o("update:modelValue", a.value), u;
|
|
898
898
|
}
|
|
899
|
-
function
|
|
900
|
-
|
|
901
|
-
const
|
|
902
|
-
switch (
|
|
899
|
+
function f(u) {
|
|
900
|
+
i.value = u, p.value?.close();
|
|
901
|
+
const x = [];
|
|
902
|
+
switch (i.value) {
|
|
903
903
|
case "today":
|
|
904
|
-
|
|
904
|
+
x.push(H.getShiftedDay()), x.push(H.getShiftedDay());
|
|
905
905
|
break;
|
|
906
906
|
case "week":
|
|
907
|
-
|
|
907
|
+
x.push(...H.getLastWeekRange());
|
|
908
908
|
break;
|
|
909
909
|
case "month":
|
|
910
|
-
|
|
910
|
+
x.push(...H.getMonthRange());
|
|
911
911
|
break;
|
|
912
912
|
case "quarter":
|
|
913
|
-
|
|
913
|
+
x.push(...H.getQuarterRange());
|
|
914
914
|
break;
|
|
915
915
|
case "year":
|
|
916
|
-
|
|
916
|
+
x.push(...H.getYearRange());
|
|
917
917
|
break;
|
|
918
918
|
case "last_7_days":
|
|
919
|
-
|
|
919
|
+
v.value = 7, d();
|
|
920
920
|
break;
|
|
921
921
|
case "range":
|
|
922
|
-
|
|
922
|
+
v.value = 7, x.push(...d());
|
|
923
923
|
break;
|
|
924
924
|
}
|
|
925
|
-
|
|
925
|
+
a.value = [...x], o("change", { name: t.name, value: a.value }), o("update:modelValue", a.value);
|
|
926
926
|
}
|
|
927
|
-
function
|
|
928
|
-
const
|
|
929
|
-
switch (
|
|
927
|
+
function h() {
|
|
928
|
+
const u = [];
|
|
929
|
+
switch (i.value) {
|
|
930
930
|
case "today":
|
|
931
|
-
|
|
931
|
+
u.push(H.getShiftedDay(a.value[0], 1));
|
|
932
932
|
break;
|
|
933
933
|
case "week":
|
|
934
|
-
|
|
934
|
+
u.push(...H.getLastWeekRange(a.value[0], a.value[1], 1));
|
|
935
935
|
break;
|
|
936
936
|
case "month":
|
|
937
|
-
|
|
937
|
+
u.push(...H.getMonthRange(a.value[0], a.value[1], 1));
|
|
938
938
|
break;
|
|
939
939
|
case "quarter":
|
|
940
|
-
|
|
940
|
+
u.push(...H.getQuarterRange(a.value[0], a.value[1], 1));
|
|
941
941
|
break;
|
|
942
942
|
case "year":
|
|
943
|
-
|
|
943
|
+
u.push(...H.getYearRange(a.value[0], 1));
|
|
944
944
|
break;
|
|
945
945
|
}
|
|
946
|
-
|
|
946
|
+
a.value = [...u], o("change", { name: t.name, value: a.value }), o("update:modelValue", a.value);
|
|
947
947
|
}
|
|
948
|
-
function
|
|
949
|
-
const
|
|
950
|
-
switch (
|
|
948
|
+
function c() {
|
|
949
|
+
const u = [];
|
|
950
|
+
switch (i.value) {
|
|
951
951
|
case "today":
|
|
952
|
-
|
|
952
|
+
u.push(H.getShiftedDay(a.value[0], -1));
|
|
953
953
|
break;
|
|
954
954
|
case "week":
|
|
955
|
-
|
|
955
|
+
u.push(...H.getLastWeekRange(a.value[0], a.value[1], -1));
|
|
956
956
|
break;
|
|
957
957
|
case "month":
|
|
958
|
-
|
|
958
|
+
u.push(...H.getMonthRange(a.value[0], a.value[1], -1));
|
|
959
959
|
break;
|
|
960
960
|
case "quarter":
|
|
961
|
-
|
|
961
|
+
u.push(...H.getQuarterRange(a.value[0], a.value[1], -1));
|
|
962
962
|
break;
|
|
963
963
|
case "year":
|
|
964
|
-
|
|
964
|
+
u.push(...H.getYearRange(a.value[0], -1));
|
|
965
965
|
break;
|
|
966
966
|
}
|
|
967
|
-
|
|
967
|
+
a.value = [...u], o("change", { name: t.name, value: a.value }), o("update:modelValue", a.value);
|
|
968
968
|
}
|
|
969
|
-
const
|
|
969
|
+
const m = [
|
|
970
970
|
"Січень",
|
|
971
971
|
"Лютий",
|
|
972
972
|
"Березень",
|
|
@@ -980,60 +980,60 @@ function Ie(f, a) {
|
|
|
980
980
|
"Листопад",
|
|
981
981
|
"Грудень"
|
|
982
982
|
];
|
|
983
|
-
function
|
|
984
|
-
const [
|
|
985
|
-
return `${b}.${
|
|
983
|
+
function y(u) {
|
|
984
|
+
const [x, g, b] = u.split("-");
|
|
985
|
+
return `${b}.${g}.${x}`;
|
|
986
986
|
}
|
|
987
|
-
function k(
|
|
988
|
-
const
|
|
989
|
-
return new Intl.DateTimeFormat(localStorage.locale, { month:
|
|
987
|
+
function k(u, x = "long") {
|
|
988
|
+
const g = new Date(Date.UTC(2e3, u - 1, 1));
|
|
989
|
+
return new Intl.DateTimeFormat(localStorage.locale, { month: x, timeZone: "UTC" }).format(g);
|
|
990
990
|
}
|
|
991
|
-
function
|
|
992
|
-
const { value:
|
|
993
|
-
switch (
|
|
991
|
+
function V(u) {
|
|
992
|
+
const { value: x } = a;
|
|
993
|
+
switch (u) {
|
|
994
994
|
case "today":
|
|
995
|
-
return
|
|
995
|
+
return y(x[0]);
|
|
996
996
|
case "range":
|
|
997
997
|
return "Період";
|
|
998
998
|
case "week":
|
|
999
|
-
return
|
|
999
|
+
return x[0] && x[1] ? `${y(x[0])} – ${y(x[1])}` : "";
|
|
1000
1000
|
case "quarter":
|
|
1001
|
-
if (
|
|
1002
|
-
const
|
|
1003
|
-
return `${Math.floor(
|
|
1001
|
+
if (x[0]) {
|
|
1002
|
+
const g = new Date(x[0]), b = g.getFullYear(), M = g.getMonth();
|
|
1003
|
+
return `${Math.floor(M / 3) + 1} ${l("filter.quarter")} ${b}`;
|
|
1004
1004
|
}
|
|
1005
1005
|
return "";
|
|
1006
1006
|
case "month":
|
|
1007
|
-
if (
|
|
1008
|
-
const [
|
|
1009
|
-
return `${k(parseInt(b, 10))} ${
|
|
1007
|
+
if (x[0]) {
|
|
1008
|
+
const [g, b] = x[0].split("-");
|
|
1009
|
+
return `${k(parseInt(b, 10))} ${g}`;
|
|
1010
1010
|
}
|
|
1011
1011
|
return "";
|
|
1012
1012
|
case "year":
|
|
1013
|
-
return
|
|
1013
|
+
return x[0] || "";
|
|
1014
1014
|
case "last_7_days":
|
|
1015
1015
|
return "За останні дні";
|
|
1016
1016
|
default:
|
|
1017
|
-
return
|
|
1017
|
+
return t.label ?? "";
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
|
-
const C =
|
|
1021
|
-
function
|
|
1022
|
-
|
|
1020
|
+
const C = E(() => i.value ? V(i.value) : t.label ?? "");
|
|
1021
|
+
function n() {
|
|
1022
|
+
i.value = "", a.value = [], o("update:modelValue", []), o("clear", t.name);
|
|
1023
1023
|
}
|
|
1024
1024
|
return {
|
|
1025
|
-
activeMode:
|
|
1026
|
-
innerValue:
|
|
1027
|
-
daysBefore:
|
|
1028
|
-
onDaysBeforeChange:
|
|
1029
|
-
onSelectChange:
|
|
1030
|
-
nextClick:
|
|
1031
|
-
prevClick:
|
|
1032
|
-
ukMonths:
|
|
1033
|
-
formatDisplayDate:
|
|
1034
|
-
getModeLabel:
|
|
1025
|
+
activeMode: i,
|
|
1026
|
+
innerValue: a,
|
|
1027
|
+
daysBefore: v,
|
|
1028
|
+
onDaysBeforeChange: d,
|
|
1029
|
+
onSelectChange: f,
|
|
1030
|
+
nextClick: h,
|
|
1031
|
+
prevClick: c,
|
|
1032
|
+
ukMonths: m,
|
|
1033
|
+
formatDisplayDate: y,
|
|
1034
|
+
getModeLabel: V,
|
|
1035
1035
|
currentLabel: C,
|
|
1036
|
-
clear:
|
|
1036
|
+
clear: n
|
|
1037
1037
|
};
|
|
1038
1038
|
}
|
|
1039
1039
|
const Wt = {
|
|
@@ -1052,7 +1052,7 @@ const Wt = {
|
|
|
1052
1052
|
key: 0,
|
|
1053
1053
|
class: "block text-xs font-medium text-gray-600 mb-1"
|
|
1054
1054
|
}, el = ["min", "disabled"], tl = { class: "flex gap-1 pt-2" }, ll = ["onClick"];
|
|
1055
|
-
const
|
|
1055
|
+
const al = /* @__PURE__ */ W({
|
|
1056
1056
|
__name: "date-input",
|
|
1057
1057
|
props: {
|
|
1058
1058
|
id: {},
|
|
@@ -1081,241 +1081,241 @@ const ol = /* @__PURE__ */ q({
|
|
|
1081
1081
|
itemClass: {}
|
|
1082
1082
|
},
|
|
1083
1083
|
emits: ["update:modelValue", "change", "clear"],
|
|
1084
|
-
setup(
|
|
1085
|
-
const
|
|
1086
|
-
activeMode:
|
|
1087
|
-
innerValue:
|
|
1088
|
-
onSelectChange:
|
|
1089
|
-
nextClick:
|
|
1084
|
+
setup(t, { expose: o, emit: p }) {
|
|
1085
|
+
const l = t, i = Oe(), a = Ot(), v = ae(), d = p, f = A(null), {
|
|
1086
|
+
activeMode: h,
|
|
1087
|
+
innerValue: c,
|
|
1088
|
+
onSelectChange: m,
|
|
1089
|
+
nextClick: y,
|
|
1090
1090
|
prevClick: k,
|
|
1091
|
-
clear:
|
|
1091
|
+
clear: V
|
|
1092
1092
|
} = Ie({
|
|
1093
|
-
...
|
|
1094
|
-
popoverRef:
|
|
1095
|
-
},
|
|
1096
|
-
return
|
|
1097
|
-
C !== void 0 ? (
|
|
1098
|
-
}),
|
|
1099
|
-
clear:
|
|
1100
|
-
popoverRef:
|
|
1101
|
-
}), (C,
|
|
1102
|
-
|
|
1103
|
-
e(
|
|
1104
|
-
|
|
1093
|
+
...l,
|
|
1094
|
+
popoverRef: f
|
|
1095
|
+
}, d);
|
|
1096
|
+
return I(() => l.modelValue, (C) => {
|
|
1097
|
+
C !== void 0 ? (c.value = C, d("update:modelValue", C)) : (h.value = "", c.value = []);
|
|
1098
|
+
}), o({
|
|
1099
|
+
clear: V,
|
|
1100
|
+
popoverRef: f
|
|
1101
|
+
}), (C, n) => (s(), w(T, null, [
|
|
1102
|
+
t.layout === "inline" ? (s(), w("div", Wt, [
|
|
1103
|
+
e(h) !== "" && e(h) === "range" ? (s(), w("div", qt, [
|
|
1104
|
+
Y(r("input", {
|
|
1105
1105
|
type: "date",
|
|
1106
|
-
max: e(
|
|
1106
|
+
max: e(c)[1],
|
|
1107
1107
|
locale: "uk-UA",
|
|
1108
|
-
"onUpdate:modelValue":
|
|
1108
|
+
"onUpdate:modelValue": n[0] || (n[0] = (u) => e(c)[0] = u),
|
|
1109
1109
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-sm focus:outline-blue-600",
|
|
1110
|
-
disabled:
|
|
1110
|
+
disabled: t.disabled
|
|
1111
1111
|
}, null, 8, Qt), [
|
|
1112
|
-
[ee, e(
|
|
1112
|
+
[ee, e(c)[0]]
|
|
1113
1113
|
]),
|
|
1114
|
-
|
|
1114
|
+
Y(r("input", {
|
|
1115
1115
|
type: "date",
|
|
1116
|
-
min: e(
|
|
1116
|
+
min: e(c)[0],
|
|
1117
1117
|
locale: "uk-UA",
|
|
1118
|
-
"onUpdate:modelValue":
|
|
1118
|
+
"onUpdate:modelValue": n[1] || (n[1] = (u) => e(c)[1] = u),
|
|
1119
1119
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-sm focus:outline-blue-600 appearance-auto",
|
|
1120
|
-
disabled:
|
|
1120
|
+
disabled: t.disabled
|
|
1121
1121
|
}, null, 8, Ht), [
|
|
1122
|
-
[ee, e(
|
|
1122
|
+
[ee, e(c)[1]]
|
|
1123
1123
|
])
|
|
1124
|
-
])) :
|
|
1125
|
-
])) :
|
|
1126
|
-
|
|
1127
|
-
class:
|
|
1124
|
+
])) : $("", !0)
|
|
1125
|
+
])) : $("", !0),
|
|
1126
|
+
r("div", {
|
|
1127
|
+
class: _(t.layout === "popover" ? "space-y-3 p-2" : "flex items-center gap-2")
|
|
1128
1128
|
}, [
|
|
1129
|
-
|
|
1130
|
-
class:
|
|
1129
|
+
r("div", {
|
|
1130
|
+
class: _(t.layout !== "popover" ? "w-[48%]" : "")
|
|
1131
1131
|
}, [
|
|
1132
|
-
|
|
1133
|
-
|
|
1132
|
+
t.layout === "popover" ? (s(), w("label", Gt, B(e(v)("filter.from")), 1)) : $("", !0),
|
|
1133
|
+
Y(r("input", {
|
|
1134
1134
|
type: "date",
|
|
1135
|
-
max: e(
|
|
1135
|
+
max: e(c)[1],
|
|
1136
1136
|
locale: "uk-UA",
|
|
1137
|
-
"onUpdate:modelValue":
|
|
1138
|
-
class:
|
|
1139
|
-
disabled:
|
|
1137
|
+
"onUpdate:modelValue": n[2] || (n[2] = (u) => e(c)[0] = u),
|
|
1138
|
+
class: _(e(i)),
|
|
1139
|
+
disabled: t.disabled
|
|
1140
1140
|
}, null, 10, Xt), [
|
|
1141
|
-
[ee, e(
|
|
1141
|
+
[ee, e(c)[0]]
|
|
1142
1142
|
])
|
|
1143
1143
|
], 2),
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
class:
|
|
1144
|
+
t.layout !== "popover" ? (s(), w("label", Zt, " - ")) : $("", !0),
|
|
1145
|
+
r("div", {
|
|
1146
|
+
class: _(t.layout !== "popover" ? "w-[48%]" : "")
|
|
1147
1147
|
}, [
|
|
1148
|
-
|
|
1149
|
-
|
|
1148
|
+
t.layout === "popover" ? (s(), w("label", Jt, B(e(v)("filter.to")), 1)) : $("", !0),
|
|
1149
|
+
Y(r("input", {
|
|
1150
1150
|
type: "date",
|
|
1151
|
-
min: e(
|
|
1151
|
+
min: e(c)[0],
|
|
1152
1152
|
locale: "uk-UA",
|
|
1153
|
-
"onUpdate:modelValue":
|
|
1154
|
-
class:
|
|
1155
|
-
disabled:
|
|
1153
|
+
"onUpdate:modelValue": n[3] || (n[3] = (u) => e(c)[1] = u),
|
|
1154
|
+
class: _(e(i)),
|
|
1155
|
+
disabled: t.disabled
|
|
1156
1156
|
}, null, 10, el), [
|
|
1157
|
-
[ee, e(
|
|
1157
|
+
[ee, e(c)[1]]
|
|
1158
1158
|
])
|
|
1159
1159
|
], 2)
|
|
1160
1160
|
], 2),
|
|
1161
|
-
|
|
1162
|
-
(
|
|
1163
|
-
key:
|
|
1164
|
-
class:
|
|
1165
|
-
onClick: (
|
|
1166
|
-
}, B(e(
|
|
1167
|
-
|
|
1168
|
-
class:
|
|
1169
|
-
onClick:
|
|
1170
|
-
(...
|
|
1161
|
+
r("div", tl, [
|
|
1162
|
+
(s(), w(T, null, X(["today", "week", "month", "quarter", "year"], (u) => r("button", {
|
|
1163
|
+
key: u,
|
|
1164
|
+
class: _(e(a) + (e(h) === u ? " bg-blue-100" : "")),
|
|
1165
|
+
onClick: (x) => e(m)(u)
|
|
1166
|
+
}, B(e(v)("filter." + u)), 11, ll)), 64)),
|
|
1167
|
+
r("button", {
|
|
1168
|
+
class: _(e(a)),
|
|
1169
|
+
onClick: n[4] || (n[4] = //@ts-ignore
|
|
1170
|
+
(...u) => e(k) && e(k)(...u))
|
|
1171
1171
|
}, " <", 2),
|
|
1172
|
-
|
|
1173
|
-
class:
|
|
1174
|
-
onClick:
|
|
1175
|
-
(...
|
|
1172
|
+
r("button", {
|
|
1173
|
+
class: _(e(a)),
|
|
1174
|
+
onClick: n[5] || (n[5] = //@ts-ignore
|
|
1175
|
+
(...u) => e(y) && e(y)(...u))
|
|
1176
1176
|
}, " >", 2)
|
|
1177
1177
|
]),
|
|
1178
|
-
(
|
|
1178
|
+
(t.cleanable, $("", !0))
|
|
1179
1179
|
], 64));
|
|
1180
1180
|
}
|
|
1181
1181
|
});
|
|
1182
|
-
function
|
|
1182
|
+
function nl(t, o) {
|
|
1183
1183
|
const {
|
|
1184
|
-
api:
|
|
1185
|
-
options:
|
|
1186
|
-
limit:
|
|
1187
|
-
dataKey:
|
|
1188
|
-
} =
|
|
1189
|
-
function
|
|
1190
|
-
return
|
|
1191
|
-
}
|
|
1192
|
-
const
|
|
1193
|
-
function
|
|
1194
|
-
const L =
|
|
1195
|
-
return { autoValueKey:
|
|
1196
|
-
}
|
|
1197
|
-
if (
|
|
1198
|
-
const
|
|
1199
|
-
|
|
1200
|
-
}
|
|
1201
|
-
const
|
|
1202
|
-
if (
|
|
1203
|
-
const
|
|
1204
|
-
if (
|
|
1205
|
-
if (!
|
|
1206
|
-
return
|
|
1207
|
-
const L =
|
|
1208
|
-
return
|
|
1184
|
+
api: p,
|
|
1185
|
+
options: l = [],
|
|
1186
|
+
limit: i = 20,
|
|
1187
|
+
dataKey: a = "data"
|
|
1188
|
+
} = t, v = t.multi;
|
|
1189
|
+
function d(D) {
|
|
1190
|
+
return v ? Array.isArray(D) ? D : D ? [D] : [] : Array.isArray(D) ? D[0] : D;
|
|
1191
|
+
}
|
|
1192
|
+
const f = A(d(t.modelValue)), h = A(""), c = A(!1), m = A(l), y = A("id"), k = A("text"), V = A(!1), C = A(t.layout !== "popover" && l.length > i), n = A([]), u = A(0);
|
|
1193
|
+
function x(D) {
|
|
1194
|
+
const L = D.find(Boolean) ?? {}, N = ["id", "value", "code", "key"].find((ie) => ie in L) ?? "id", P = ["text", "label", "name", "title"].find((ie) => ie in L) ?? "text";
|
|
1195
|
+
return { autoValueKey: N, autoLabelKey: P };
|
|
1196
|
+
}
|
|
1197
|
+
if (l.length > 0) {
|
|
1198
|
+
const D = x(l);
|
|
1199
|
+
y.value = D.autoValueKey, k.value = D.autoLabelKey;
|
|
1200
|
+
}
|
|
1201
|
+
const g = E(() => {
|
|
1202
|
+
if (p) return m.value;
|
|
1203
|
+
const D = m.value;
|
|
1204
|
+
if (t.layout === "popover") return D;
|
|
1205
|
+
if (!h.value)
|
|
1206
|
+
return V.value ? D : D.slice(0, i);
|
|
1207
|
+
const L = h.value.toLowerCase();
|
|
1208
|
+
return D.filter((N) => N[k.value].toLowerCase().includes(L));
|
|
1209
1209
|
});
|
|
1210
1210
|
let b = null;
|
|
1211
|
-
async function
|
|
1212
|
-
if (
|
|
1213
|
-
|
|
1211
|
+
async function M(D) {
|
|
1212
|
+
if (p) {
|
|
1213
|
+
c.value = !0;
|
|
1214
1214
|
try {
|
|
1215
|
-
const L = new URL(
|
|
1216
|
-
L.searchParams.set("json", "1"), L.searchParams.set("key",
|
|
1217
|
-
const
|
|
1218
|
-
if (!
|
|
1219
|
-
|
|
1215
|
+
const L = new URL(p, window.location.origin);
|
|
1216
|
+
L.searchParams.set("json", "1"), L.searchParams.set("key", D), L.searchParams.set("limit", i.toString());
|
|
1217
|
+
const N = await fetch(L.toString());
|
|
1218
|
+
if (!N.ok) {
|
|
1219
|
+
Be({ type: "error", title: "Error", message: "Failed to fetch remote options" }), m.value = [];
|
|
1220
1220
|
return;
|
|
1221
1221
|
}
|
|
1222
|
-
const
|
|
1223
|
-
if (!
|
|
1224
|
-
|
|
1222
|
+
const P = await N.json();
|
|
1223
|
+
if (!P[a]) {
|
|
1224
|
+
Be({ type: "error", title: "Error", message: P }), m.value = [];
|
|
1225
1225
|
return;
|
|
1226
1226
|
}
|
|
1227
|
-
if (
|
|
1228
|
-
const ie =
|
|
1229
|
-
|
|
1227
|
+
if (m.value = P[a], m.value.length > 0) {
|
|
1228
|
+
const ie = x(m.value);
|
|
1229
|
+
y.value = ie.autoValueKey, k.value = ie.autoLabelKey;
|
|
1230
1230
|
}
|
|
1231
|
-
|
|
1231
|
+
u.value = P.total;
|
|
1232
1232
|
} catch (L) {
|
|
1233
1233
|
console.error("Failed to fetch remote options:", L);
|
|
1234
1234
|
} finally {
|
|
1235
|
-
|
|
1235
|
+
c.value = !1;
|
|
1236
1236
|
}
|
|
1237
1237
|
}
|
|
1238
1238
|
}
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1239
|
+
I(h, (D) => {
|
|
1240
|
+
p && (b && clearTimeout(b), b = setTimeout(() => {
|
|
1241
|
+
M(D);
|
|
1242
1242
|
}, 200));
|
|
1243
|
-
}),
|
|
1244
|
-
|
|
1243
|
+
}), I(() => t.modelValue, (D) => {
|
|
1244
|
+
f.value = d(D);
|
|
1245
1245
|
}, { immediate: !0 });
|
|
1246
|
-
function
|
|
1247
|
-
return
|
|
1246
|
+
function U(D) {
|
|
1247
|
+
return v && Array.isArray(f.value) ? f.value.includes(D[y.value]) : f.value && f.value === D[y.value];
|
|
1248
1248
|
}
|
|
1249
|
-
function
|
|
1250
|
-
if (
|
|
1251
|
-
const L =
|
|
1252
|
-
|
|
1249
|
+
function j(D) {
|
|
1250
|
+
if (v && !Array.isArray(f.value) && (f.value = []), v && Array.isArray(f.value)) {
|
|
1251
|
+
const L = f.value.includes(D[y.value]);
|
|
1252
|
+
f.value = L ? f.value.filter((N) => N !== D[y.value]) : [...f.value, D[y.value]], n.value = L ? n.value.filter((N) => N !== D[k.value]) : [...n.value, D[k.value]];
|
|
1253
1253
|
} else
|
|
1254
|
-
|
|
1255
|
-
|
|
1254
|
+
f.value = D[y.value], n.value = D[k.value];
|
|
1255
|
+
o("update:modelValue", f.value), o("change", { name: t.name, value: f.value });
|
|
1256
1256
|
}
|
|
1257
1257
|
function S() {
|
|
1258
|
-
|
|
1258
|
+
v ? (f.value = [], n.value = []) : (f.value = void 0, n.value = []), o("update:modelValue", f.value), o("clear", t.name);
|
|
1259
1259
|
}
|
|
1260
|
-
function
|
|
1261
|
-
b && clearTimeout(b),
|
|
1260
|
+
function K() {
|
|
1261
|
+
b && clearTimeout(b), h.value = "", V.value = !1;
|
|
1262
1262
|
}
|
|
1263
|
-
function
|
|
1264
|
-
|
|
1263
|
+
function R() {
|
|
1264
|
+
V.value = !V.value;
|
|
1265
1265
|
}
|
|
1266
|
-
|
|
1266
|
+
me(() => {
|
|
1267
1267
|
b && clearTimeout(b);
|
|
1268
1268
|
});
|
|
1269
|
-
const
|
|
1270
|
-
|
|
1271
|
-
|
|
1269
|
+
const F = A(-1);
|
|
1270
|
+
I(g, () => {
|
|
1271
|
+
F.value = g.value.length > 0 ? 0 : -1;
|
|
1272
1272
|
});
|
|
1273
|
-
function
|
|
1274
|
-
const L =
|
|
1275
|
-
if (
|
|
1276
|
-
|
|
1277
|
-
else if (
|
|
1278
|
-
|
|
1279
|
-
else if (
|
|
1280
|
-
const
|
|
1281
|
-
|
|
1273
|
+
function z(D) {
|
|
1274
|
+
const L = g.value.length;
|
|
1275
|
+
if (D.key === "ArrowDown")
|
|
1276
|
+
D.preventDefault(), F.value = (F.value + 1) % L;
|
|
1277
|
+
else if (D.key === "ArrowUp")
|
|
1278
|
+
D.preventDefault(), F.value = (F.value - 1 + L) % L;
|
|
1279
|
+
else if (D.key === "Enter" && (D.preventDefault(), F.value >= 0 && F.value < g.value.length)) {
|
|
1280
|
+
const N = g.value[F.value];
|
|
1281
|
+
j(N);
|
|
1282
1282
|
}
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1285
|
-
|
|
1284
|
+
function Q() {
|
|
1285
|
+
p && m.value.length === 0 && h.value.length === 0 && M(h.value);
|
|
1286
1286
|
}
|
|
1287
1287
|
return {
|
|
1288
|
-
innerValue:
|
|
1289
|
-
searchTerm:
|
|
1290
|
-
filteredOptions:
|
|
1291
|
-
isSelected:
|
|
1292
|
-
selectItem:
|
|
1288
|
+
innerValue: f,
|
|
1289
|
+
searchTerm: h,
|
|
1290
|
+
filteredOptions: g,
|
|
1291
|
+
isSelected: U,
|
|
1292
|
+
selectItem: j,
|
|
1293
1293
|
clear: S,
|
|
1294
|
-
resetSearch:
|
|
1295
|
-
toggleShowAll:
|
|
1296
|
-
isReqProc:
|
|
1297
|
-
showAll:
|
|
1294
|
+
resetSearch: K,
|
|
1295
|
+
toggleShowAll: R,
|
|
1296
|
+
isReqProc: c,
|
|
1297
|
+
showAll: V,
|
|
1298
1298
|
isEnableShowAll: C,
|
|
1299
1299
|
labelKey: k,
|
|
1300
|
-
valueKey:
|
|
1301
|
-
allOptions:
|
|
1302
|
-
highlightedIndex:
|
|
1303
|
-
onKeyDown:
|
|
1304
|
-
selectedLabels:
|
|
1305
|
-
totalCount:
|
|
1306
|
-
loadData:
|
|
1300
|
+
valueKey: y,
|
|
1301
|
+
allOptions: m,
|
|
1302
|
+
highlightedIndex: F,
|
|
1303
|
+
onKeyDown: z,
|
|
1304
|
+
selectedLabels: n,
|
|
1305
|
+
totalCount: u,
|
|
1306
|
+
loadData: Q
|
|
1307
1307
|
};
|
|
1308
1308
|
}
|
|
1309
|
-
const
|
|
1309
|
+
const ol = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relative justify-center" }, rl = ["placeholder"], sl = {
|
|
1310
1310
|
key: 0,
|
|
1311
1311
|
class: "w-full"
|
|
1312
|
-
}, il = { class: "flex flex-col items-center justify-center p-5 text-center" }, ul = { class: "max-w-sm mx-auto mt-6" },
|
|
1312
|
+
}, il = { class: "flex flex-col items-center justify-center p-5 text-center" }, ul = { class: "max-w-sm mx-auto mt-6" }, cl = { class: "font-medium text-gray-800 dark:text-neutral-200" }, dl = {
|
|
1313
1313
|
key: 0,
|
|
1314
1314
|
class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
|
|
1315
1315
|
}, fl = {
|
|
1316
1316
|
key: 1,
|
|
1317
1317
|
class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
|
|
1318
|
-
},
|
|
1318
|
+
}, ml = /* @__PURE__ */ W({
|
|
1319
1319
|
__name: "select",
|
|
1320
1320
|
props: {
|
|
1321
1321
|
id: {},
|
|
@@ -1344,154 +1344,154 @@ const nl = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1344
1344
|
itemClass: {}
|
|
1345
1345
|
},
|
|
1346
1346
|
emits: ["update:modelValue", "change", "clear"],
|
|
1347
|
-
setup(
|
|
1348
|
-
const
|
|
1349
|
-
innerValue:
|
|
1350
|
-
filteredOptions:
|
|
1351
|
-
isSelected:
|
|
1352
|
-
selectItem:
|
|
1353
|
-
clear:
|
|
1354
|
-
resetSearch:
|
|
1347
|
+
setup(t, { expose: o, emit: p }) {
|
|
1348
|
+
const l = ae(), i = t, a = p, v = A(null), {
|
|
1349
|
+
innerValue: d,
|
|
1350
|
+
filteredOptions: f,
|
|
1351
|
+
isSelected: h,
|
|
1352
|
+
selectItem: c,
|
|
1353
|
+
clear: m,
|
|
1354
|
+
resetSearch: y,
|
|
1355
1355
|
toggleShowAll: k,
|
|
1356
|
-
isReqProc:
|
|
1356
|
+
isReqProc: V,
|
|
1357
1357
|
showAll: C,
|
|
1358
|
-
isEnableShowAll:
|
|
1359
|
-
searchTerm:
|
|
1360
|
-
labelKey:
|
|
1361
|
-
valueKey:
|
|
1358
|
+
isEnableShowAll: n,
|
|
1359
|
+
searchTerm: u,
|
|
1360
|
+
labelKey: x,
|
|
1361
|
+
valueKey: g,
|
|
1362
1362
|
highlightedIndex: b,
|
|
1363
|
-
onKeyDown:
|
|
1364
|
-
selectedLabels:
|
|
1365
|
-
totalCount:
|
|
1363
|
+
onKeyDown: M,
|
|
1364
|
+
selectedLabels: U,
|
|
1365
|
+
totalCount: j,
|
|
1366
1366
|
loadData: S
|
|
1367
|
-
} =
|
|
1368
|
-
...
|
|
1369
|
-
modelValue:
|
|
1370
|
-
},
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
}),
|
|
1374
|
-
() =>
|
|
1375
|
-
(
|
|
1376
|
-
|
|
1367
|
+
} = nl({
|
|
1368
|
+
...i,
|
|
1369
|
+
modelValue: i.modelValue
|
|
1370
|
+
}, a);
|
|
1371
|
+
de(() => {
|
|
1372
|
+
y(), i.layout !== "inline" && (S(), v.value && i.layout === "popover" && v.value.focus());
|
|
1373
|
+
}), I(
|
|
1374
|
+
() => i.modelValue,
|
|
1375
|
+
(R) => {
|
|
1376
|
+
R === void 0 && (i.multi ? d.value = [] : d.value = void 0);
|
|
1377
1377
|
}
|
|
1378
1378
|
);
|
|
1379
|
-
const
|
|
1380
|
-
return
|
|
1381
|
-
|
|
1379
|
+
const K = A([]);
|
|
1380
|
+
return I(b, (R) => {
|
|
1381
|
+
R >= 0 && K.value[R] && K.value[R]?.scrollIntoView({
|
|
1382
1382
|
block: "nearest",
|
|
1383
1383
|
behavior: "smooth"
|
|
1384
1384
|
});
|
|
1385
|
-
}),
|
|
1386
|
-
|
|
1387
|
-
}),
|
|
1388
|
-
clear:
|
|
1389
|
-
inputTextRef:
|
|
1390
|
-
selectedLabels:
|
|
1385
|
+
}), I(f, () => {
|
|
1386
|
+
K.value = [];
|
|
1387
|
+
}), o({
|
|
1388
|
+
clear: m,
|
|
1389
|
+
inputTextRef: v,
|
|
1390
|
+
selectedLabels: U,
|
|
1391
1391
|
loadData: S
|
|
1392
|
-
}), (
|
|
1393
|
-
class:
|
|
1392
|
+
}), (R, F) => (s(), w("div", {
|
|
1393
|
+
class: _([t.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
|
|
1394
1394
|
}, [
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
"onUpdate:modelValue":
|
|
1398
|
-
onKeydown:
|
|
1399
|
-
(...
|
|
1395
|
+
r("div", ol, [
|
|
1396
|
+
Y(r("input", {
|
|
1397
|
+
"onUpdate:modelValue": F[0] || (F[0] = (z) => Ye(u) ? u.value = z : null),
|
|
1398
|
+
onKeydown: F[1] || (F[1] = //@ts-ignore
|
|
1399
|
+
(...z) => e(M) && e(M)(...z)),
|
|
1400
1400
|
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 text-gray-700",
|
|
1401
|
-
placeholder: e(
|
|
1401
|
+
placeholder: e(l)("filter.search"),
|
|
1402
1402
|
type: "text",
|
|
1403
1403
|
ref_key: "inputTextRef",
|
|
1404
|
-
ref:
|
|
1404
|
+
ref: v
|
|
1405
1405
|
}, null, 40, rl), [
|
|
1406
|
-
[ee, e(
|
|
1406
|
+
[ee, e(u)]
|
|
1407
1407
|
]),
|
|
1408
|
-
|
|
1409
|
-
e(
|
|
1408
|
+
q(_e, { class: "absolute text-gray-400 -translate-y-1/2 left-4 top-1/2" }),
|
|
1409
|
+
e(u) != "" ? (s(), O(Ce, {
|
|
1410
1410
|
key: 0,
|
|
1411
|
-
onClick:
|
|
1411
|
+
onClick: F[2] || (F[2] = (z) => u.value = ""),
|
|
1412
1412
|
class: "absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"
|
|
1413
|
-
})) :
|
|
1413
|
+
})) : $("", !0)
|
|
1414
1414
|
]),
|
|
1415
|
-
|
|
1416
|
-
class:
|
|
1417
|
-
|
|
1418
|
-
|
|
1415
|
+
r("div", {
|
|
1416
|
+
class: _([
|
|
1417
|
+
t.layout === "popover" ? "flex-1 overflow-y-auto p-2" : "",
|
|
1418
|
+
t.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
|
|
1419
1419
|
])
|
|
1420
1420
|
}, [
|
|
1421
|
-
(
|
|
1422
|
-
layout:
|
|
1423
|
-
count:
|
|
1424
|
-
label:
|
|
1425
|
-
color:
|
|
1426
|
-
type:
|
|
1427
|
-
value:
|
|
1428
|
-
"is-selected": e(
|
|
1429
|
-
highlighted:
|
|
1430
|
-
onItemClick: (
|
|
1421
|
+
(s(!0), w(T, null, X(e(f), (z, Q) => (s(), O(xe, {
|
|
1422
|
+
layout: t.layout,
|
|
1423
|
+
count: z.count,
|
|
1424
|
+
label: z[e(x)],
|
|
1425
|
+
color: z.color,
|
|
1426
|
+
type: t.multi ? "checkbox" : "radio",
|
|
1427
|
+
value: z[e(g)],
|
|
1428
|
+
"is-selected": e(h)(z),
|
|
1429
|
+
highlighted: Q === e(b),
|
|
1430
|
+
onItemClick: (D) => e(c)(z),
|
|
1431
1431
|
ref_for: !0,
|
|
1432
|
-
ref: (
|
|
1432
|
+
ref: (D) => K.value[Q] = D?.el
|
|
1433
1433
|
}, null, 8, ["layout", "count", "label", "color", "type", "value", "is-selected", "highlighted", "onItemClick"]))), 256))
|
|
1434
1434
|
], 2),
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1435
|
+
t.type === "select" && e(f).length === 0 && !e(V) ? (s(), w("div", sl, [
|
|
1436
|
+
r("div", il, [
|
|
1437
|
+
q(we),
|
|
1438
|
+
r("div", ul, [
|
|
1439
|
+
r("p", cl, B(e(l)("filter.notfound")), 1),
|
|
1440
|
+
F[7] || (F[7] = r("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" }, null, -1))
|
|
1441
1441
|
])
|
|
1442
1442
|
])
|
|
1443
|
-
])) :
|
|
1444
|
-
|
|
1445
|
-
!e(C) && e(
|
|
1443
|
+
])) : $("", !0),
|
|
1444
|
+
t.layout !== "popover" && t.type !== "select" ? (s(), w(T, { key: 1 }, [
|
|
1445
|
+
!e(C) && e(n) ? (s(), w("div", {
|
|
1446
1446
|
key: 0,
|
|
1447
|
-
onClick:
|
|
1448
|
-
(...
|
|
1447
|
+
onClick: F[3] || (F[3] = //@ts-ignore
|
|
1448
|
+
(...z) => e(k) && e(k)(...z)),
|
|
1449
1449
|
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"
|
|
1450
1450
|
}, [
|
|
1451
|
-
G(B(e(
|
|
1452
|
-
|
|
1453
|
-
])) :
|
|
1454
|
-
e(C) ? (
|
|
1451
|
+
G(B(e(l)("filter.more")) + " ", 1),
|
|
1452
|
+
q(ve)
|
|
1453
|
+
])) : $("", !0),
|
|
1454
|
+
e(C) ? (s(), w("div", {
|
|
1455
1455
|
key: 1,
|
|
1456
|
-
onClick:
|
|
1457
|
-
(...
|
|
1456
|
+
onClick: F[4] || (F[4] = //@ts-ignore
|
|
1457
|
+
(...z) => e(k) && e(k)(...z)),
|
|
1458
1458
|
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"
|
|
1459
1459
|
}, [
|
|
1460
|
-
G(B(e(
|
|
1461
|
-
|
|
1462
|
-
])) :
|
|
1463
|
-
], 64)) :
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
G(B(
|
|
1467
|
-
|
|
1460
|
+
G(B(e(l)("filter.less")) + " ", 1),
|
|
1461
|
+
q(ke)
|
|
1462
|
+
])) : $("", !0)
|
|
1463
|
+
], 64)) : $("", !0),
|
|
1464
|
+
t.cleanable ? (s(), w(T, { key: 2 }, [
|
|
1465
|
+
t.layout === "inline" ? (s(), w("div", dl, [
|
|
1466
|
+
G(B(t.multi && Array.isArray(e(d)) ? e(d)?.length : e(d) !== void 0 && (e(d) || e(d) === null) ? 1 : 0) + " / " + B(e(j)) + " " + B(e(l)("filter.selected")) + " ", 1),
|
|
1467
|
+
Y(r("button", {
|
|
1468
1468
|
class: "text-gray-600 hover:text-gray-800",
|
|
1469
|
-
onClick:
|
|
1470
|
-
(...
|
|
1471
|
-
}, B(e(
|
|
1472
|
-
[J, e(
|
|
1469
|
+
onClick: F[5] || (F[5] = //@ts-ignore
|
|
1470
|
+
(...z) => e(m) && e(m)(...z))
|
|
1471
|
+
}, B(e(l)("filter.clear")), 513), [
|
|
1472
|
+
[J, e(d) !== "" && e(d) !== void 0 || e(d)]
|
|
1473
1473
|
])
|
|
1474
|
-
])) :
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1474
|
+
])) : $("", !0),
|
|
1475
|
+
t.layout === "popover" ? (s(), w("div", fl, [
|
|
1476
|
+
r("span", null, B(t.multi && Array.isArray(e(d)) ? e(d)?.length : e(d) !== void 0 && (e(d) || e(d) === null) ? 1 : 0) + " / " + B(e(j)) + " " + B(e(l)("filter.selected")), 1),
|
|
1477
|
+
Y(r("button", {
|
|
1478
1478
|
class: "text-gray-600 hover:text-gray-800",
|
|
1479
|
-
onClick:
|
|
1480
|
-
(...
|
|
1481
|
-
}, B(e(
|
|
1482
|
-
[J, e(
|
|
1479
|
+
onClick: F[6] || (F[6] = //@ts-ignore
|
|
1480
|
+
(...z) => e(m) && e(m)(...z))
|
|
1481
|
+
}, B(e(l)("filter.clear")), 513), [
|
|
1482
|
+
[J, e(d) !== "" && e(d) !== void 0 || e(d)]
|
|
1483
1483
|
])
|
|
1484
|
-
])) :
|
|
1485
|
-
], 64)) :
|
|
1484
|
+
])) : $("", !0)
|
|
1485
|
+
], 64)) : $("", !0)
|
|
1486
1486
|
], 2));
|
|
1487
1487
|
}
|
|
1488
|
-
}),
|
|
1488
|
+
}), pl = ["for", "onClick"], vl = ["id", "name", "value"], yl = { class: "block" }, gl = {
|
|
1489
1489
|
key: 0,
|
|
1490
1490
|
class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
|
|
1491
1491
|
}, bl = {
|
|
1492
1492
|
key: 1,
|
|
1493
1493
|
class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
|
|
1494
|
-
},
|
|
1494
|
+
}, xl = /* @__PURE__ */ W({
|
|
1495
1495
|
__name: "tag-field",
|
|
1496
1496
|
props: {
|
|
1497
1497
|
id: {},
|
|
@@ -1520,77 +1520,77 @@ const nl = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1520
1520
|
itemClass: {}
|
|
1521
1521
|
},
|
|
1522
1522
|
emits: ["update:modelValue", "change", "clear"],
|
|
1523
|
-
setup(
|
|
1524
|
-
const
|
|
1525
|
-
innerValue:
|
|
1526
|
-
isSelected:
|
|
1527
|
-
selectItem:
|
|
1528
|
-
clear:
|
|
1529
|
-
labelKey:
|
|
1530
|
-
valueKey:
|
|
1531
|
-
allOptions:
|
|
1532
|
-
} =
|
|
1533
|
-
...
|
|
1534
|
-
modelValue:
|
|
1535
|
-
},
|
|
1536
|
-
...
|
|
1537
|
-
modelValue:
|
|
1538
|
-
},
|
|
1539
|
-
return
|
|
1540
|
-
clear:
|
|
1541
|
-
}),
|
|
1542
|
-
() =>
|
|
1543
|
-
(
|
|
1544
|
-
|
|
1523
|
+
setup(t, { expose: o, emit: p }) {
|
|
1524
|
+
const l = t, i = p, {
|
|
1525
|
+
innerValue: a,
|
|
1526
|
+
isSelected: v,
|
|
1527
|
+
selectItem: d,
|
|
1528
|
+
clear: f,
|
|
1529
|
+
labelKey: h,
|
|
1530
|
+
valueKey: c,
|
|
1531
|
+
allOptions: m
|
|
1532
|
+
} = l.multi ? Le({
|
|
1533
|
+
...l,
|
|
1534
|
+
modelValue: l.modelValue ?? l.default ?? []
|
|
1535
|
+
}, i) : he({
|
|
1536
|
+
...l,
|
|
1537
|
+
modelValue: l.modelValue !== void 0 ? l.modelValue : l.default ?? ""
|
|
1538
|
+
}, i);
|
|
1539
|
+
return o({
|
|
1540
|
+
clear: f
|
|
1541
|
+
}), I(
|
|
1542
|
+
() => l.modelValue,
|
|
1543
|
+
(y) => {
|
|
1544
|
+
y === void 0 && (l.multi ? a.value = [] : a.value = void 0);
|
|
1545
1545
|
}
|
|
1546
|
-
), (
|
|
1547
|
-
|
|
1548
|
-
class:
|
|
1546
|
+
), (y, k) => (s(), w(T, null, [
|
|
1547
|
+
r("div", {
|
|
1548
|
+
class: _(["grid grid-cols-3 gap-2 mx-[1px]", t.layout === "popover" ? "m-1" : "mb-1"])
|
|
1549
1549
|
}, [
|
|
1550
|
-
(
|
|
1551
|
-
key: `item-${
|
|
1552
|
-
for: `item-${
|
|
1553
|
-
onClick: se((C) => e(
|
|
1554
|
-
class:
|
|
1550
|
+
(s(!0), w(T, null, X(e(m), (V) => (s(), w("label", {
|
|
1551
|
+
key: `item-${V[e(c)]}`,
|
|
1552
|
+
for: `item-${V[e(c)]}`,
|
|
1553
|
+
onClick: se((C) => e(d)(V), ["stop", "prevent"]),
|
|
1554
|
+
class: _([e(v)(V) ? "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-sm 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%)]"])
|
|
1555
1555
|
}, [
|
|
1556
|
-
|
|
1556
|
+
r("input", {
|
|
1557
1557
|
type: "checkbox",
|
|
1558
|
-
id: `item-${
|
|
1558
|
+
id: `item-${V[e(c)]}`,
|
|
1559
1559
|
class: "hidden w4poy border-gray-200 g41z1 g22e3 axcnw dark:text-indigo-500 dark:border-neutral-700 dark:focus:ring-neutral-900",
|
|
1560
|
-
name: `item-${
|
|
1561
|
-
value:
|
|
1560
|
+
name: `item-${V[e(c)]}`,
|
|
1561
|
+
value: V[e(c)]
|
|
1562
1562
|
}, null, 8, vl),
|
|
1563
|
-
|
|
1564
|
-
], 10,
|
|
1563
|
+
r("span", yl, B(V[e(h)]), 1)
|
|
1564
|
+
], 10, pl))), 128))
|
|
1565
1565
|
], 2),
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
G(B(
|
|
1569
|
-
|
|
1566
|
+
t.cleanable ? (s(), w(T, { key: 0 }, [
|
|
1567
|
+
t.layout === "inline" ? (s(), w("div", gl, [
|
|
1568
|
+
G(B(t.multi && Array.isArray(e(a)) ? e(a)?.length : e(a) !== void 0 && (e(a) || e(a) === null) ? 1 : 0) + " з " + B(e(m).length) + " обрано ", 1),
|
|
1569
|
+
Y(r("button", {
|
|
1570
1570
|
class: "text-gray-600 hover:text-gray-800",
|
|
1571
1571
|
onClick: k[0] || (k[0] = //@ts-ignore
|
|
1572
|
-
(...
|
|
1572
|
+
(...V) => e(f) && e(f)(...V))
|
|
1573
1573
|
}, " Очистити ", 512), [
|
|
1574
|
-
[J, e(
|
|
1574
|
+
[J, e(a) !== "" && e(a) !== void 0 || e(a)]
|
|
1575
1575
|
])
|
|
1576
|
-
])) :
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1576
|
+
])) : $("", !0),
|
|
1577
|
+
t.layout === "popover" ? (s(), w("div", bl, [
|
|
1578
|
+
r("span", null, B(t.multi && Array.isArray(e(a)) ? e(a)?.length : e(a) !== void 0 && (e(a) || e(a) === null) ? 1 : 0) + " з " + B(e(m).length) + " обрано", 1),
|
|
1579
|
+
Y(r("button", {
|
|
1580
1580
|
class: "text-gray-600 hover:text-gray-800",
|
|
1581
1581
|
onClick: k[1] || (k[1] = //@ts-ignore
|
|
1582
|
-
(...
|
|
1582
|
+
(...V) => e(f) && e(f)(...V))
|
|
1583
1583
|
}, " Очистити ", 512), [
|
|
1584
|
-
[J, e(
|
|
1584
|
+
[J, e(a) !== void 0 && e(a) !== "" || e(a)]
|
|
1585
1585
|
])
|
|
1586
|
-
])) :
|
|
1587
|
-
], 64)) :
|
|
1586
|
+
])) : $("", !0)
|
|
1587
|
+
], 64)) : $("", !0)
|
|
1588
1588
|
], 64));
|
|
1589
1589
|
}
|
|
1590
|
-
}),
|
|
1590
|
+
}), hl = ["disabled", "title"], wl = { class: "flex w-full items-center justify-between gap-1 overflow-hidden text-left" }, kl = { class: "truncate text-ellipsis text-sm" }, Cl = {
|
|
1591
1591
|
key: 0,
|
|
1592
1592
|
class: "inline-flex min-h-[18px] min-w-[18px] items-center justify-center rounded-sm bg-blue-100 px-2 text-[11px] font-semibold text-blue-600"
|
|
1593
|
-
},
|
|
1593
|
+
}, Vl = { class: "w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-sm 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" }, $l = { 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" }, Ve = /* @__PURE__ */ W({
|
|
1594
1594
|
__name: "popover-field",
|
|
1595
1595
|
props: {
|
|
1596
1596
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -1607,91 +1607,91 @@ const nl = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1607
1607
|
mode: {},
|
|
1608
1608
|
layout: {}
|
|
1609
1609
|
},
|
|
1610
|
-
setup(
|
|
1611
|
-
const
|
|
1612
|
-
function
|
|
1613
|
-
const b =
|
|
1614
|
-
if (!b || !
|
|
1615
|
-
const
|
|
1616
|
-
let { left:
|
|
1617
|
-
|
|
1610
|
+
setup(t, { expose: o }) {
|
|
1611
|
+
const p = t, l = E(() => Te(p.mode)), i = A(!1), a = A({ top: 0, left: 0 }), v = A(null), d = A(null), f = A(null);
|
|
1612
|
+
function h() {
|
|
1613
|
+
const b = d.value, M = f.value;
|
|
1614
|
+
if (!b || !M) return;
|
|
1615
|
+
const U = b.getBoundingClientRect(), j = M.offsetWidth, S = window.innerWidth, K = U.bottom + 8;
|
|
1616
|
+
let { left: R } = U;
|
|
1617
|
+
R + j > S && (R = Math.max(S - j - 10, 10)), a.value = { top: K, left: R };
|
|
1618
1618
|
}
|
|
1619
|
-
function
|
|
1620
|
-
|
|
1621
|
-
|
|
1619
|
+
function c() {
|
|
1620
|
+
i.value = !i.value, i.value && pe(() => {
|
|
1621
|
+
h(), p.fieldRef?.inputTextRef && p.fieldRef?.inputTextRef?.focus?.(), p.fieldRef?.loadData && p.fieldRef?.loadData?.();
|
|
1622
1622
|
});
|
|
1623
1623
|
}
|
|
1624
|
-
function
|
|
1625
|
-
!
|
|
1624
|
+
function m(b) {
|
|
1625
|
+
!v.value?.contains(b.target) && !f.value?.contains(b.target) && !d.value?.contains(b.target) && (i.value = !1);
|
|
1626
1626
|
}
|
|
1627
|
-
function
|
|
1628
|
-
b.key === "Escape" && (
|
|
1627
|
+
function y(b) {
|
|
1628
|
+
b.key === "Escape" && (i.value = !1);
|
|
1629
1629
|
}
|
|
1630
|
-
const k = A(!1),
|
|
1631
|
-
b.detail.key === "locale" && (
|
|
1630
|
+
const k = A(!1), V = A("ua"), C = (b) => {
|
|
1631
|
+
b.detail.key === "locale" && (V.value = b.detail.newValue);
|
|
1632
1632
|
};
|
|
1633
|
-
|
|
1634
|
-
k.value = !0,
|
|
1635
|
-
}),
|
|
1636
|
-
window.removeEventListener("resize", C), document.removeEventListener("click",
|
|
1633
|
+
de(() => {
|
|
1634
|
+
k.value = !0, V.value = localStorage.locale, window.addEventListener("storage", C), document.addEventListener("click", m, !0), document.addEventListener("keydown", y), window.addEventListener("scroll", h, !0);
|
|
1635
|
+
}), me(() => {
|
|
1636
|
+
window.removeEventListener("resize", C), document.removeEventListener("click", m, !0), document.removeEventListener("keydown", y), window.removeEventListener("scroll", h, !0);
|
|
1637
1637
|
});
|
|
1638
|
-
function
|
|
1639
|
-
|
|
1638
|
+
function n() {
|
|
1639
|
+
i.value = !1;
|
|
1640
1640
|
}
|
|
1641
|
-
|
|
1642
|
-
function
|
|
1643
|
-
return Array.isArray(b) ? b.filter((
|
|
1641
|
+
o({ close: n });
|
|
1642
|
+
function u(b) {
|
|
1643
|
+
return Array.isArray(b) ? b.filter((M) => M != null && M !== "").length : b && typeof b == "object" ? Object.values(b).filter((M) => M != null && M !== "").length : typeof b == "string" ? b.trim() === "" ? 0 : 1 : typeof b == "number" ? Number.isNaN(b) ? 0 : 1 : b === null || b !== void 0 ? 1 : 0;
|
|
1644
1644
|
}
|
|
1645
|
-
const
|
|
1646
|
-
const b =
|
|
1647
|
-
return
|
|
1648
|
-
}),
|
|
1649
|
-
const b =
|
|
1650
|
-
return !b || ["inline"].includes(
|
|
1645
|
+
const x = E(() => {
|
|
1646
|
+
const b = p.fieldRef?.selectedLabels, M = u(b);
|
|
1647
|
+
return M > 0 ? M : u(p.currentValue);
|
|
1648
|
+
}), g = E(() => {
|
|
1649
|
+
const b = p.fieldRef?.selectedLabels;
|
|
1650
|
+
return !b || ["inline"].includes(p.layout || "") ? p[V.value] || (p.label ?? "") : Array.isArray(b) ? b.length > 0 ? b.join(", ") : p.label ?? "" : String(b);
|
|
1651
1651
|
});
|
|
1652
|
-
return (b,
|
|
1653
|
-
|
|
1654
|
-
onClick:
|
|
1655
|
-
disabled:
|
|
1652
|
+
return (b, M) => (s(), w("div", null, [
|
|
1653
|
+
r("button", {
|
|
1654
|
+
onClick: c,
|
|
1655
|
+
disabled: t.disabled,
|
|
1656
1656
|
ref_key: "triggerRef",
|
|
1657
|
-
ref:
|
|
1658
|
-
title:
|
|
1659
|
-
class:
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1657
|
+
ref: d,
|
|
1658
|
+
title: t.label,
|
|
1659
|
+
class: _([
|
|
1660
|
+
l.value,
|
|
1661
|
+
t.width ? e(Ee).getWidthClass(t.width) : "w-full",
|
|
1662
|
+
t.layout === "inline" && x.value > 0 ? "border border-blue-400 bg-blue-50 text-blue-600" : ""
|
|
1663
1663
|
]),
|
|
1664
1664
|
type: "button"
|
|
1665
1665
|
}, [
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1666
|
+
r("span", wl, [
|
|
1667
|
+
r("span", kl, B(g.value), 1),
|
|
1668
|
+
t.layout === "inline" && x.value > 0 ? (s(), w("span", Cl, B(x.value), 1)) : $("", !0)
|
|
1669
1669
|
]),
|
|
1670
|
-
|
|
1671
|
-
], 10,
|
|
1672
|
-
k.value ? (
|
|
1670
|
+
q(ve, { class: "h-4 w-4 text-neutral-500" })
|
|
1671
|
+
], 10, hl),
|
|
1672
|
+
k.value ? (s(), O(ge, {
|
|
1673
1673
|
key: 0,
|
|
1674
1674
|
to: "body"
|
|
1675
1675
|
}, [
|
|
1676
|
-
|
|
1676
|
+
Y(r("div", {
|
|
1677
1677
|
ref_key: "popperRef",
|
|
1678
|
-
ref:
|
|
1678
|
+
ref: f,
|
|
1679
1679
|
class: "vsTailwind vs-popover__content bottom-right w-fit fixed z-[1000]",
|
|
1680
|
-
style: be({ top: `${
|
|
1680
|
+
style: be({ top: `${a.value.top}px`, left: `${a.value.left}px` }),
|
|
1681
1681
|
"data-inside-popover": ""
|
|
1682
1682
|
}, [
|
|
1683
|
-
|
|
1684
|
-
|
|
1683
|
+
r("div", Vl, [
|
|
1684
|
+
r("div", $l, [
|
|
1685
1685
|
ue(b.$slots, "default")
|
|
1686
1686
|
])
|
|
1687
1687
|
])
|
|
1688
1688
|
], 4), [
|
|
1689
|
-
[J,
|
|
1689
|
+
[J, i.value]
|
|
1690
1690
|
])
|
|
1691
|
-
])) :
|
|
1691
|
+
])) : $("", !0)
|
|
1692
1692
|
]));
|
|
1693
1693
|
}
|
|
1694
|
-
}),
|
|
1694
|
+
}), Al = {}, Bl = {
|
|
1695
1695
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1696
1696
|
width: "24",
|
|
1697
1697
|
height: "24",
|
|
@@ -1703,12 +1703,12 @@ const nl = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1703
1703
|
"stroke-linejoin": "round",
|
|
1704
1704
|
class: "text-blue-600 w-[16px] h-[16px]"
|
|
1705
1705
|
};
|
|
1706
|
-
function
|
|
1707
|
-
return
|
|
1708
|
-
|
|
1709
|
-
]));
|
|
1706
|
+
function Sl(t, o) {
|
|
1707
|
+
return s(), w("svg", Bl, [...o[0] || (o[0] = [
|
|
1708
|
+
r("path", { d: "M20 6 9 17l-5-5" }, null, -1)
|
|
1709
|
+
])]);
|
|
1710
1710
|
}
|
|
1711
|
-
const re = /* @__PURE__ */ te(
|
|
1711
|
+
const re = /* @__PURE__ */ te(Al, [["render", Sl]]), jl = {}, Dl = {
|
|
1712
1712
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1713
1713
|
width: "15px",
|
|
1714
1714
|
height: "24",
|
|
@@ -1720,17 +1720,17 @@ const re = /* @__PURE__ */ te($l, [["render", Bl]]), Sl = {}, jl = {
|
|
|
1720
1720
|
"stroke-linejoin": "round",
|
|
1721
1721
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[90deg]"
|
|
1722
1722
|
};
|
|
1723
|
-
function
|
|
1724
|
-
return
|
|
1725
|
-
|
|
1723
|
+
function Rl(t, o) {
|
|
1724
|
+
return s(), w("svg", Dl, [...o[0] || (o[0] = [
|
|
1725
|
+
r("path", {
|
|
1726
1726
|
stroke: "none",
|
|
1727
1727
|
d: "M0 0h24v24H0z",
|
|
1728
1728
|
fill: "none"
|
|
1729
1729
|
}, null, -1),
|
|
1730
|
-
|
|
1731
|
-
]));
|
|
1730
|
+
r("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
1731
|
+
])]);
|
|
1732
1732
|
}
|
|
1733
|
-
const
|
|
1733
|
+
const Fl = /* @__PURE__ */ te(jl, [["render", Rl]]), Kl = {}, Ml = {
|
|
1734
1734
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1735
1735
|
width: "15px",
|
|
1736
1736
|
height: "24",
|
|
@@ -1742,21 +1742,21 @@ const Rl = /* @__PURE__ */ te(Sl, [["render", Dl]]), Fl = {}, Kl = {
|
|
|
1742
1742
|
"stroke-linejoin": "round",
|
|
1743
1743
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[270deg]"
|
|
1744
1744
|
};
|
|
1745
|
-
function
|
|
1746
|
-
return
|
|
1747
|
-
|
|
1745
|
+
function Ll(t, o) {
|
|
1746
|
+
return s(), w("svg", Ml, [...o[0] || (o[0] = [
|
|
1747
|
+
r("path", {
|
|
1748
1748
|
stroke: "none",
|
|
1749
1749
|
d: "M0 0h24v24H0z",
|
|
1750
1750
|
fill: "none"
|
|
1751
1751
|
}, null, -1),
|
|
1752
|
-
|
|
1753
|
-
]));
|
|
1752
|
+
r("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
1753
|
+
])]);
|
|
1754
1754
|
}
|
|
1755
|
-
const
|
|
1755
|
+
const _l = /* @__PURE__ */ te(Kl, [["render", Ll]]), El = { class: "flex gap-1" }, Ol = { class: "mb-1" }, Tl = { class: "mb-1" }, Il = { class: "inline-flex rounded-sm shrink-0 pl-1" }, Ul = ["title"], zl = { class: "inline-flex rounded-sm shrink-0 pl-1" }, Nl = ["title"], Pl = {
|
|
1756
1756
|
key: 1,
|
|
1757
1757
|
class: "flex gap-1 !w-[75%] rounded-sm"
|
|
1758
1758
|
}, Yl = ["max", "disabled"], Wl = ["min", "disabled"];
|
|
1759
|
-
const ql = /* @__PURE__ */
|
|
1759
|
+
const ql = /* @__PURE__ */ W({
|
|
1760
1760
|
__name: "date-input-inline",
|
|
1761
1761
|
props: {
|
|
1762
1762
|
id: {},
|
|
@@ -1785,168 +1785,167 @@ const ql = /* @__PURE__ */ q({
|
|
|
1785
1785
|
itemClass: {}
|
|
1786
1786
|
},
|
|
1787
1787
|
emits: ["update:modelValue", "change", "clear"],
|
|
1788
|
-
setup(
|
|
1789
|
-
const
|
|
1790
|
-
activeMode:
|
|
1791
|
-
innerValue:
|
|
1792
|
-
onSelectChange:
|
|
1793
|
-
nextClick:
|
|
1794
|
-
prevClick:
|
|
1795
|
-
currentLabel:
|
|
1788
|
+
setup(t, { expose: o, emit: p }) {
|
|
1789
|
+
const l = ae(), i = t, a = p, v = A(null), {
|
|
1790
|
+
activeMode: d,
|
|
1791
|
+
innerValue: f,
|
|
1792
|
+
onSelectChange: h,
|
|
1793
|
+
nextClick: c,
|
|
1794
|
+
prevClick: m,
|
|
1795
|
+
currentLabel: y,
|
|
1796
1796
|
clear: k
|
|
1797
1797
|
} = Ie({
|
|
1798
|
-
...
|
|
1799
|
-
popoverRef:
|
|
1800
|
-
},
|
|
1801
|
-
return
|
|
1802
|
-
|
|
1803
|
-
}),
|
|
1798
|
+
...i,
|
|
1799
|
+
popoverRef: v
|
|
1800
|
+
}, a);
|
|
1801
|
+
return I(() => i.modelValue, (V) => {
|
|
1802
|
+
V !== void 0 ? (f.value = V, a("update:modelValue", V)) : (d.value = "", f.value = []);
|
|
1803
|
+
}), o({
|
|
1804
1804
|
clear: k,
|
|
1805
|
-
popoverRef:
|
|
1806
|
-
}), (
|
|
1807
|
-
|
|
1808
|
-
|
|
1805
|
+
popoverRef: v
|
|
1806
|
+
}), (V, C) => (s(), w(T, null, [
|
|
1807
|
+
r("div", El, [
|
|
1808
|
+
q(Ve, {
|
|
1809
1809
|
ref_key: "popoverRef",
|
|
1810
|
-
ref:
|
|
1811
|
-
label: e(
|
|
1812
|
-
"current-value": e(
|
|
1813
|
-
mode:
|
|
1814
|
-
width: typeof
|
|
1810
|
+
ref: v,
|
|
1811
|
+
label: e(y),
|
|
1812
|
+
"current-value": e(f),
|
|
1813
|
+
mode: t.mode,
|
|
1814
|
+
width: typeof t.width == "number" && e(f).length ? t.width - 70 : t.width,
|
|
1815
1815
|
onClear: e(k),
|
|
1816
|
-
layout:
|
|
1816
|
+
layout: t.layout
|
|
1817
1817
|
}, {
|
|
1818
|
-
default:
|
|
1819
|
-
|
|
1820
|
-
|
|
1818
|
+
default: ne(() => [
|
|
1819
|
+
r("div", null, [
|
|
1820
|
+
r("button", {
|
|
1821
1821
|
type: "button",
|
|
1822
|
-
onClick: C[0] || (C[0] = (
|
|
1822
|
+
onClick: C[0] || (C[0] = (n) => e(h)("range")),
|
|
1823
1823
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
|
1824
1824
|
}, [
|
|
1825
|
-
G(B(e(
|
|
1826
|
-
e(
|
|
1825
|
+
G(B(e(l)("filter.period")) + " ", 1),
|
|
1826
|
+
e(d) === "range" ? (s(), O(re, { key: 0 })) : $("", !0)
|
|
1827
1827
|
])
|
|
1828
1828
|
]),
|
|
1829
|
-
C[12] || (C[12] =
|
|
1830
|
-
|
|
1829
|
+
C[12] || (C[12] = r("div", null, [
|
|
1830
|
+
r("div", { class: "pt-1 mt-1 border-t" })
|
|
1831
1831
|
], -1)),
|
|
1832
|
-
|
|
1833
|
-
|
|
1832
|
+
r("div", null, [
|
|
1833
|
+
r("button", {
|
|
1834
1834
|
type: "button",
|
|
1835
|
-
onClick: C[1] || (C[1] = (
|
|
1835
|
+
onClick: C[1] || (C[1] = (n) => e(h)("today")),
|
|
1836
1836
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
|
1837
1837
|
}, [
|
|
1838
|
-
G(B(e(
|
|
1839
|
-
e(
|
|
1838
|
+
G(B(e(l)("filter.today")) + " ", 1),
|
|
1839
|
+
e(d) === "today" ? (s(), O(re, { key: 0 })) : $("", !0)
|
|
1840
1840
|
])
|
|
1841
1841
|
]),
|
|
1842
|
-
|
|
1843
|
-
|
|
1842
|
+
r("div", null, [
|
|
1843
|
+
r("button", {
|
|
1844
1844
|
type: "button",
|
|
1845
|
-
onClick: C[2] || (C[2] = (
|
|
1845
|
+
onClick: C[2] || (C[2] = (n) => e(h)("week")),
|
|
1846
1846
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
|
1847
1847
|
}, [
|
|
1848
|
-
G(B(e(
|
|
1849
|
-
e(
|
|
1848
|
+
G(B(e(l)("filter.week")) + " ", 1),
|
|
1849
|
+
e(d) === "week" ? (s(), O(re, { key: 0 })) : $("", !0)
|
|
1850
1850
|
])
|
|
1851
1851
|
]),
|
|
1852
|
-
|
|
1853
|
-
|
|
1852
|
+
r("div", null, [
|
|
1853
|
+
r("button", {
|
|
1854
1854
|
type: "button",
|
|
1855
|
-
onClick: C[3] || (C[3] = (
|
|
1855
|
+
onClick: C[3] || (C[3] = (n) => e(h)("month")),
|
|
1856
1856
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
|
1857
1857
|
}, [
|
|
1858
|
-
G(B(e(
|
|
1859
|
-
e(
|
|
1858
|
+
G(B(e(l)("filter.month")) + " ", 1),
|
|
1859
|
+
e(d) === "month" ? (s(), O(re, { key: 0 })) : $("", !0)
|
|
1860
1860
|
])
|
|
1861
1861
|
]),
|
|
1862
|
-
|
|
1863
|
-
|
|
1862
|
+
r("div", null, [
|
|
1863
|
+
r("button", {
|
|
1864
1864
|
type: "button",
|
|
1865
|
-
onClick: C[4] || (C[4] = (
|
|
1865
|
+
onClick: C[4] || (C[4] = (n) => e(h)("quarter")),
|
|
1866
1866
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
|
1867
1867
|
}, [
|
|
1868
|
-
G(B(e(
|
|
1869
|
-
e(
|
|
1868
|
+
G(B(e(l)("filter.quarter")) + " ", 1),
|
|
1869
|
+
e(d) === "quarter" ? (s(), O(re, { key: 0 })) : $("", !0)
|
|
1870
1870
|
])
|
|
1871
1871
|
]),
|
|
1872
|
-
|
|
1873
|
-
|
|
1872
|
+
r("div", Ol, [
|
|
1873
|
+
r("button", {
|
|
1874
1874
|
type: "button",
|
|
1875
|
-
onClick: C[5] || (C[5] = (
|
|
1875
|
+
onClick: C[5] || (C[5] = (n) => e(h)("year")),
|
|
1876
1876
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
|
1877
1877
|
}, [
|
|
1878
|
-
G(B(e(
|
|
1879
|
-
e(
|
|
1878
|
+
G(B(e(l)("filter.year")) + " ", 1),
|
|
1879
|
+
e(d) === "year" ? (s(), O(re, { key: 0 })) : $("", !0)
|
|
1880
1880
|
])
|
|
1881
1881
|
]),
|
|
1882
|
-
|
|
1883
|
-
|
|
1882
|
+
r("div", Tl, [
|
|
1883
|
+
r("button", {
|
|
1884
1884
|
type: "button",
|
|
1885
|
-
onClick: C[6] || (C[6] = (
|
|
1885
|
+
onClick: C[6] || (C[6] = (n) => e(k)()),
|
|
1886
1886
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
|
1887
1887
|
}, [
|
|
1888
|
-
G(B(e(
|
|
1889
|
-
e(
|
|
1888
|
+
G(B(e(l)("filter.alltime")) + " ", 1),
|
|
1889
|
+
e(f)[0] ? $("", !0) : (s(), O(re, { key: 0 }))
|
|
1890
1890
|
])
|
|
1891
1891
|
])
|
|
1892
1892
|
]),
|
|
1893
|
-
_: 1
|
|
1894
|
-
__: [12]
|
|
1893
|
+
_: 1
|
|
1895
1894
|
}, 8, ["label", "current-value", "mode", "width", "onClear", "layout"]),
|
|
1896
|
-
e(
|
|
1897
|
-
|
|
1898
|
-
|
|
1895
|
+
e(d) !== "" && e(d) !== "range" && e(d) !== "last_7_days" ? (s(), w(T, { key: 0 }, [
|
|
1896
|
+
r("div", Il, [
|
|
1897
|
+
r("button", {
|
|
1899
1898
|
type: "button",
|
|
1900
|
-
title: e(
|
|
1899
|
+
title: e(l)("filter.prev"),
|
|
1901
1900
|
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",
|
|
1902
1901
|
onClick: C[7] || (C[7] = //@ts-ignore
|
|
1903
|
-
(...
|
|
1902
|
+
(...n) => e(m) && e(m)(...n))
|
|
1904
1903
|
}, [
|
|
1905
|
-
|
|
1904
|
+
q(Fl)
|
|
1906
1905
|
], 8, Ul)
|
|
1907
1906
|
]),
|
|
1908
|
-
|
|
1909
|
-
|
|
1907
|
+
r("div", zl, [
|
|
1908
|
+
r("button", {
|
|
1910
1909
|
type: "button",
|
|
1911
|
-
title: e(
|
|
1910
|
+
title: e(l)("filter.next"),
|
|
1912
1911
|
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",
|
|
1913
1912
|
onClick: C[8] || (C[8] = //@ts-ignore
|
|
1914
|
-
(...
|
|
1913
|
+
(...n) => e(c) && e(c)(...n))
|
|
1915
1914
|
}, [
|
|
1916
|
-
|
|
1915
|
+
q(_l)
|
|
1917
1916
|
], 8, Nl)
|
|
1918
1917
|
])
|
|
1919
|
-
], 64)) :
|
|
1920
|
-
e(
|
|
1921
|
-
|
|
1918
|
+
], 64)) : $("", !0),
|
|
1919
|
+
e(d) !== "" && e(d) === "range" ? (s(), w("div", Pl, [
|
|
1920
|
+
Y(r("input", {
|
|
1922
1921
|
type: "date",
|
|
1923
|
-
max: e(
|
|
1922
|
+
max: e(f)[1],
|
|
1924
1923
|
locale: "uk-UA",
|
|
1925
|
-
"onUpdate:modelValue": C[9] || (C[9] = (
|
|
1924
|
+
"onUpdate:modelValue": C[9] || (C[9] = (n) => e(f)[0] = n),
|
|
1926
1925
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-sm focus:outline-blue-600",
|
|
1927
|
-
disabled:
|
|
1926
|
+
disabled: t.disabled
|
|
1928
1927
|
}, null, 8, Yl), [
|
|
1929
|
-
[ee, e(
|
|
1928
|
+
[ee, e(f)[0]]
|
|
1930
1929
|
]),
|
|
1931
|
-
|
|
1930
|
+
Y(r("input", {
|
|
1932
1931
|
type: "date",
|
|
1933
|
-
min: e(
|
|
1932
|
+
min: e(f)[0],
|
|
1934
1933
|
locale: "uk-UA",
|
|
1935
|
-
"onUpdate:modelValue": C[10] || (C[10] = (
|
|
1934
|
+
"onUpdate:modelValue": C[10] || (C[10] = (n) => e(f)[1] = n),
|
|
1936
1935
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-sm focus:outline-blue-600 appearance-auto",
|
|
1937
|
-
disabled:
|
|
1936
|
+
disabled: t.disabled
|
|
1938
1937
|
}, null, 8, Wl), [
|
|
1939
|
-
[ee, e(
|
|
1938
|
+
[ee, e(f)[1]]
|
|
1940
1939
|
])
|
|
1941
|
-
])) :
|
|
1940
|
+
])) : $("", !0)
|
|
1942
1941
|
]),
|
|
1943
|
-
(
|
|
1942
|
+
(t.cleanable, $("", !0))
|
|
1944
1943
|
], 64));
|
|
1945
1944
|
}
|
|
1946
1945
|
}), Ql = { class: "flex flex-wrap items-center gap-2" }, Hl = ["disabled", "onClick"], Gl = {
|
|
1947
1946
|
key: 0,
|
|
1948
1947
|
class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
|
|
1949
|
-
}, Xl = /* @__PURE__ */
|
|
1948
|
+
}, Xl = /* @__PURE__ */ W({
|
|
1950
1949
|
__name: "button-field",
|
|
1951
1950
|
props: {
|
|
1952
1951
|
id: {},
|
|
@@ -1975,84 +1974,84 @@ const ql = /* @__PURE__ */ q({
|
|
|
1975
1974
|
itemClass: {}
|
|
1976
1975
|
},
|
|
1977
1976
|
emits: ["update:modelValue", "change", "clear"],
|
|
1978
|
-
setup(
|
|
1979
|
-
const
|
|
1980
|
-
innerValue:
|
|
1981
|
-
isSelected:
|
|
1982
|
-
selectItem:
|
|
1983
|
-
clear:
|
|
1984
|
-
labelKey:
|
|
1985
|
-
valueKey:
|
|
1986
|
-
allOptions:
|
|
1987
|
-
} =
|
|
1988
|
-
...
|
|
1989
|
-
modelValue:
|
|
1990
|
-
},
|
|
1991
|
-
function
|
|
1992
|
-
return
|
|
1977
|
+
setup(t, { expose: o, emit: p }) {
|
|
1978
|
+
const l = t, i = p, {
|
|
1979
|
+
innerValue: a,
|
|
1980
|
+
isSelected: v,
|
|
1981
|
+
selectItem: d,
|
|
1982
|
+
clear: f,
|
|
1983
|
+
labelKey: h,
|
|
1984
|
+
valueKey: c,
|
|
1985
|
+
allOptions: m
|
|
1986
|
+
} = he({
|
|
1987
|
+
...l,
|
|
1988
|
+
modelValue: l.modelValue ?? l.default ?? ""
|
|
1989
|
+
}, i), y = E(() => a.value !== void 0 && !(typeof a.value == "string" && a.value === "")), k = E(() => y.value ? 1 : 0);
|
|
1990
|
+
function V(n) {
|
|
1991
|
+
return v(n) ? ["bg-blue-600 text-white"].filter((u) => typeof u == "string" && u.trim().length > 0).join(" ") : ["text-gray-700 hover:bg-gray-200 bg-gray-50 "].filter((u) => typeof u == "string" && u.trim().length > 0).join(" ");
|
|
1993
1992
|
}
|
|
1994
|
-
function C(
|
|
1995
|
-
|
|
1993
|
+
function C(n) {
|
|
1994
|
+
l.disabled || d(n);
|
|
1996
1995
|
}
|
|
1997
|
-
return
|
|
1998
|
-
clear:
|
|
1999
|
-
}),
|
|
2000
|
-
() =>
|
|
2001
|
-
(
|
|
2002
|
-
|
|
1996
|
+
return o({
|
|
1997
|
+
clear: f
|
|
1998
|
+
}), I(
|
|
1999
|
+
() => l.modelValue,
|
|
2000
|
+
(n) => {
|
|
2001
|
+
n === void 0 && (a.value = void 0);
|
|
2003
2002
|
}
|
|
2004
|
-
), (
|
|
2005
|
-
|
|
2006
|
-
(
|
|
2007
|
-
key:
|
|
2003
|
+
), (n, u) => (s(), w(T, null, [
|
|
2004
|
+
r("div", Ql, [
|
|
2005
|
+
(s(!0), w(T, null, X(e(m), (x) => (s(), w("button", {
|
|
2006
|
+
key: x[e(c)],
|
|
2008
2007
|
type: "button",
|
|
2009
|
-
class:
|
|
2010
|
-
disabled:
|
|
2011
|
-
onClick: (
|
|
2012
|
-
}, B(
|
|
2008
|
+
class: _(["px-3 py-2 text-sm font-medium rounded-md transition-colors", V(x)]),
|
|
2009
|
+
disabled: t.disabled,
|
|
2010
|
+
onClick: (g) => C(x)
|
|
2011
|
+
}, B(x[e(h)]), 11, Hl))), 128))
|
|
2013
2012
|
]),
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2013
|
+
t.cleanable && t.layout === "popover" ? (s(), w("div", Gl, [
|
|
2014
|
+
r("span", null, B(k.value) + " з " + B(e(m).length) + " обрано", 1),
|
|
2015
|
+
Y(r("button", {
|
|
2017
2016
|
class: "text-gray-600 hover:text-gray-800",
|
|
2018
|
-
onClick:
|
|
2019
|
-
(...
|
|
2017
|
+
onClick: u[0] || (u[0] = //@ts-ignore
|
|
2018
|
+
(...x) => e(f) && e(f)(...x))
|
|
2020
2019
|
}, " Очистити ", 512), [
|
|
2021
|
-
[J,
|
|
2020
|
+
[J, y.value]
|
|
2022
2021
|
])
|
|
2023
|
-
])) :
|
|
2022
|
+
])) : $("", !0)
|
|
2024
2023
|
], 64));
|
|
2025
2024
|
}
|
|
2026
|
-
}),
|
|
2025
|
+
}), Re = {
|
|
2027
2026
|
radio: wt,
|
|
2028
|
-
checkbox:
|
|
2029
|
-
check:
|
|
2030
|
-
text:
|
|
2027
|
+
checkbox: De,
|
|
2028
|
+
check: De,
|
|
2029
|
+
text: _t,
|
|
2031
2030
|
range: Yt,
|
|
2032
|
-
date:
|
|
2033
|
-
select:
|
|
2034
|
-
tag:
|
|
2031
|
+
date: al,
|
|
2032
|
+
select: ml,
|
|
2033
|
+
tag: xl,
|
|
2035
2034
|
button: Xl,
|
|
2036
2035
|
"date:inline": ql
|
|
2037
2036
|
};
|
|
2038
|
-
function
|
|
2039
|
-
let
|
|
2040
|
-
switch (
|
|
2037
|
+
function $e(t, o) {
|
|
2038
|
+
let p;
|
|
2039
|
+
switch (t.toLowerCase()) {
|
|
2041
2040
|
case "autocomplete":
|
|
2042
|
-
|
|
2041
|
+
p = "select";
|
|
2043
2042
|
break;
|
|
2044
2043
|
case "check":
|
|
2045
|
-
|
|
2044
|
+
p = "checkbox";
|
|
2046
2045
|
break;
|
|
2047
2046
|
default:
|
|
2048
|
-
|
|
2047
|
+
p = t?.toString().toLowerCase();
|
|
2049
2048
|
}
|
|
2050
|
-
return
|
|
2051
|
-
component:
|
|
2052
|
-
type:
|
|
2049
|
+
return p === "date" && o && o === "inline" && (p = "date:inline"), {
|
|
2050
|
+
component: Re[p] || Re.text,
|
|
2051
|
+
type: p
|
|
2053
2052
|
};
|
|
2054
2053
|
}
|
|
2055
|
-
const Zl = { style: { display: "inline-flex", margin: "0px", width: "100%" } }, Jl = { class: "relative w-full mb-2 p-4 bg-white rounded-lg shadow-sm" },
|
|
2054
|
+
const Zl = { style: { display: "inline-flex", margin: "0px", width: "100%" } }, Jl = { class: "relative w-full mb-2 p-4 bg-white rounded-lg shadow-sm" }, ea = { class: "block mb-3 text-sm font-medium text-gray-800 dark:text-neutral-200" }, ta = { class: "flex items-center" }, la = { class: "text-sm font-medium max-w-[80%] text-gray-800 flex items-center gap-x-1" }, aa = { class: "filter-layout__body" }, na = /* @__PURE__ */ W({
|
|
2056
2055
|
__name: "vertical-layout",
|
|
2057
2056
|
props: {
|
|
2058
2057
|
id: {},
|
|
@@ -2081,71 +2080,71 @@ const Zl = { style: { display: "inline-flex", margin: "0px", width: "100%" } },
|
|
|
2081
2080
|
itemClass: {}
|
|
2082
2081
|
},
|
|
2083
2082
|
emits: ["update:modelValue", "change", "clear"],
|
|
2084
|
-
setup(
|
|
2085
|
-
const
|
|
2086
|
-
get: () =>
|
|
2087
|
-
set: (
|
|
2083
|
+
setup(t, { expose: o, emit: p }) {
|
|
2084
|
+
const l = t, i = p, a = A(), v = $e(l.type, l.layout), d = E({
|
|
2085
|
+
get: () => l.modelValue,
|
|
2086
|
+
set: (m) => i("update:modelValue", m)
|
|
2088
2087
|
});
|
|
2089
|
-
function m
|
|
2090
|
-
|
|
2088
|
+
function f(m) {
|
|
2089
|
+
i("clear", m);
|
|
2091
2090
|
}
|
|
2092
|
-
function
|
|
2093
|
-
|
|
2091
|
+
function h(m, y) {
|
|
2092
|
+
i("change", { name: m, value: y }), l.modelValue !== void 0 && i("update:modelValue", y);
|
|
2094
2093
|
}
|
|
2095
|
-
function
|
|
2096
|
-
|
|
2094
|
+
function c() {
|
|
2095
|
+
i("clear", l.name);
|
|
2097
2096
|
}
|
|
2098
|
-
return
|
|
2099
|
-
() =>
|
|
2100
|
-
(
|
|
2101
|
-
|
|
2097
|
+
return I(
|
|
2098
|
+
() => l.default,
|
|
2099
|
+
(m) => {
|
|
2100
|
+
d.value = m;
|
|
2102
2101
|
}
|
|
2103
|
-
),
|
|
2104
|
-
() =>
|
|
2105
|
-
(
|
|
2106
|
-
|
|
2102
|
+
), I(
|
|
2103
|
+
() => l.modelValue,
|
|
2104
|
+
(m) => {
|
|
2105
|
+
d.value = m;
|
|
2107
2106
|
}
|
|
2108
|
-
),
|
|
2109
|
-
filterRef:
|
|
2110
|
-
}), (
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2107
|
+
), o({
|
|
2108
|
+
filterRef: a
|
|
2109
|
+
}), (m, y) => (s(), w("div", Zl, [
|
|
2110
|
+
r("div", Jl, [
|
|
2111
|
+
r("div", ea, [
|
|
2112
|
+
r("div", ta, [
|
|
2113
|
+
r("span", la, B(t.label), 1)
|
|
2115
2114
|
]),
|
|
2116
|
-
typeof
|
|
2115
|
+
typeof d.value == "string" && d.value.trim() !== "" || Array.isArray(d.value) && d.value.length > 0 && d.value.some((k) => k !== void 0) || d.value === null ? (s(), O(et, {
|
|
2117
2116
|
key: 0,
|
|
2118
|
-
onClick:
|
|
2119
|
-
})) :
|
|
2117
|
+
onClick: c
|
|
2118
|
+
})) : $("", !0)
|
|
2120
2119
|
]),
|
|
2121
|
-
|
|
2122
|
-
e(
|
|
2123
|
-
type: e(
|
|
2124
|
-
class:
|
|
2125
|
-
onChange:
|
|
2126
|
-
onClear:
|
|
2120
|
+
r("div", aa, [
|
|
2121
|
+
e(v)?.type !== "select" ? (s(), O(oe(e(v)?.component), Z({ key: 0 }, l, {
|
|
2122
|
+
type: e(v)?.type,
|
|
2123
|
+
class: l.itemClass,
|
|
2124
|
+
onChange: y[0] || (y[0] = (k) => h(k.name, k.value)),
|
|
2125
|
+
onClear: y[1] || (y[1] = (k) => f(k)),
|
|
2127
2126
|
ref_key: "filterRef",
|
|
2128
|
-
ref:
|
|
2129
|
-
}), null, 16, ["type", "class"])) : (
|
|
2127
|
+
ref: a
|
|
2128
|
+
}), null, 16, ["type", "class"])) : (s(), O(Ve, {
|
|
2130
2129
|
key: 1,
|
|
2131
|
-
"current-value":
|
|
2132
|
-
label:
|
|
2133
|
-
mode:
|
|
2134
|
-
onClear:
|
|
2135
|
-
fieldRef:
|
|
2130
|
+
"current-value": d.value,
|
|
2131
|
+
label: t.label,
|
|
2132
|
+
mode: t.mode,
|
|
2133
|
+
onClear: c,
|
|
2134
|
+
fieldRef: a.value,
|
|
2136
2135
|
width: void 0,
|
|
2137
|
-
disabled:
|
|
2136
|
+
disabled: t.disabled,
|
|
2138
2137
|
layout: "vertical"
|
|
2139
2138
|
}, {
|
|
2140
|
-
default:
|
|
2141
|
-
(
|
|
2139
|
+
default: ne(() => [
|
|
2140
|
+
(s(), O(oe(e(v)?.component), Z({
|
|
2142
2141
|
ref_key: "filterRef",
|
|
2143
|
-
ref:
|
|
2144
|
-
},
|
|
2145
|
-
type: e(
|
|
2146
|
-
class:
|
|
2147
|
-
onChange:
|
|
2148
|
-
onClear:
|
|
2142
|
+
ref: a
|
|
2143
|
+
}, l, {
|
|
2144
|
+
type: e(v)?.type,
|
|
2145
|
+
class: l.itemClass,
|
|
2146
|
+
onChange: y[2] || (y[2] = (k) => h(k.name, k.value)),
|
|
2147
|
+
onClear: y[3] || (y[3] = (k) => f(k))
|
|
2149
2148
|
}), null, 16, ["type", "class"]))
|
|
2150
2149
|
]),
|
|
2151
2150
|
_: 1
|
|
@@ -2154,7 +2153,7 @@ const Zl = { style: { display: "inline-flex", margin: "0px", width: "100%" } },
|
|
|
2154
2153
|
])
|
|
2155
2154
|
]));
|
|
2156
2155
|
}
|
|
2157
|
-
}),
|
|
2156
|
+
}), Fe = /* @__PURE__ */ W({
|
|
2158
2157
|
__name: "inline-layout",
|
|
2159
2158
|
props: {
|
|
2160
2159
|
id: {},
|
|
@@ -2183,65 +2182,65 @@ const Zl = { style: { display: "inline-flex", margin: "0px", width: "100%" } },
|
|
|
2183
2182
|
itemClass: {}
|
|
2184
2183
|
},
|
|
2185
2184
|
emits: ["update:modelValue", "change", "clear"],
|
|
2186
|
-
setup(
|
|
2187
|
-
const
|
|
2188
|
-
get: () =>
|
|
2189
|
-
set: (
|
|
2185
|
+
setup(t, { expose: o, emit: p }) {
|
|
2186
|
+
const l = t, i = p, a = A(), v = $e(l.type, l.layout), d = E({
|
|
2187
|
+
get: () => l.modelValue,
|
|
2188
|
+
set: (c) => i("update:modelValue", c)
|
|
2190
2189
|
});
|
|
2191
|
-
function
|
|
2192
|
-
|
|
2190
|
+
function f(c = l.name) {
|
|
2191
|
+
i("clear", c);
|
|
2193
2192
|
}
|
|
2194
|
-
function
|
|
2195
|
-
|
|
2193
|
+
function h(c, m) {
|
|
2194
|
+
i("change", { name: c, value: m }), l.modelValue !== void 0 && i("update:modelValue", m);
|
|
2196
2195
|
}
|
|
2197
|
-
return
|
|
2198
|
-
() =>
|
|
2199
|
-
(
|
|
2200
|
-
|
|
2196
|
+
return I(
|
|
2197
|
+
() => l.default,
|
|
2198
|
+
(c) => {
|
|
2199
|
+
d.value = c;
|
|
2201
2200
|
}
|
|
2202
|
-
),
|
|
2203
|
-
() =>
|
|
2204
|
-
(
|
|
2205
|
-
|
|
2201
|
+
), I(
|
|
2202
|
+
() => l.modelValue,
|
|
2203
|
+
(c) => {
|
|
2204
|
+
d.value = c;
|
|
2206
2205
|
}
|
|
2207
|
-
),
|
|
2208
|
-
filterRef:
|
|
2209
|
-
}), (
|
|
2210
|
-
type: e(
|
|
2211
|
-
class:
|
|
2212
|
-
onChange:
|
|
2213
|
-
onClear:
|
|
2214
|
-
disabled:
|
|
2215
|
-
modelValue:
|
|
2216
|
-
"onUpdate:modelValue":
|
|
2217
|
-
}), null, 16, ["type", "class", "disabled", "modelValue"])) : (
|
|
2206
|
+
), o({
|
|
2207
|
+
filterRef: a
|
|
2208
|
+
}), (c, m) => ["text", "date", "button"].includes(t.type.toLocaleLowerCase()) ? (s(), O(oe(e(v)?.component), Z({ key: 0 }, l, {
|
|
2209
|
+
type: e(v)?.type,
|
|
2210
|
+
class: l.itemClass,
|
|
2211
|
+
onChange: m[0] || (m[0] = (y) => h(y.name, y.value)),
|
|
2212
|
+
onClear: m[1] || (m[1] = (y) => f(y)),
|
|
2213
|
+
disabled: t.disabled,
|
|
2214
|
+
modelValue: d.value,
|
|
2215
|
+
"onUpdate:modelValue": m[2] || (m[2] = (y) => d.value = y)
|
|
2216
|
+
}), null, 16, ["type", "class", "disabled", "modelValue"])) : (s(), O(Ve, {
|
|
2218
2217
|
key: 1,
|
|
2219
|
-
"current-value":
|
|
2220
|
-
label:
|
|
2221
|
-
mode:
|
|
2222
|
-
onClear:
|
|
2223
|
-
fieldRef:
|
|
2224
|
-
width:
|
|
2225
|
-
disabled:
|
|
2218
|
+
"current-value": d.value,
|
|
2219
|
+
label: t.label,
|
|
2220
|
+
mode: t.mode,
|
|
2221
|
+
onClear: f,
|
|
2222
|
+
fieldRef: a.value,
|
|
2223
|
+
width: l.width,
|
|
2224
|
+
disabled: t.disabled,
|
|
2226
2225
|
layout: "inline"
|
|
2227
2226
|
}, {
|
|
2228
|
-
default:
|
|
2229
|
-
(
|
|
2227
|
+
default: ne(() => [
|
|
2228
|
+
(s(), O(oe(e(v)?.component), Z({
|
|
2230
2229
|
ref_key: "filterRef",
|
|
2231
|
-
ref:
|
|
2232
|
-
},
|
|
2233
|
-
modelValue:
|
|
2234
|
-
"onUpdate:modelValue":
|
|
2235
|
-
type: e(
|
|
2236
|
-
class:
|
|
2237
|
-
onChange:
|
|
2238
|
-
onClear:
|
|
2230
|
+
ref: a
|
|
2231
|
+
}, l, {
|
|
2232
|
+
modelValue: d.value,
|
|
2233
|
+
"onUpdate:modelValue": m[3] || (m[3] = (y) => d.value = y),
|
|
2234
|
+
type: e(v)?.type,
|
|
2235
|
+
class: l.itemClass,
|
|
2236
|
+
onChange: m[4] || (m[4] = (y) => h(y.name, y.value)),
|
|
2237
|
+
onClear: m[5] || (m[5] = (y) => f(y))
|
|
2239
2238
|
}), null, 16, ["modelValue", "type", "class"]))
|
|
2240
2239
|
]),
|
|
2241
2240
|
_: 1
|
|
2242
2241
|
}, 8, ["current-value", "label", "mode", "fieldRef", "width", "disabled"]));
|
|
2243
2242
|
}
|
|
2244
|
-
}),
|
|
2243
|
+
}), oa = /* @__PURE__ */ W({
|
|
2245
2244
|
__name: "popover-layout",
|
|
2246
2245
|
props: {
|
|
2247
2246
|
id: {},
|
|
@@ -2270,46 +2269,46 @@ const Zl = { style: { display: "inline-flex", margin: "0px", width: "100%" } },
|
|
|
2270
2269
|
itemClass: {}
|
|
2271
2270
|
},
|
|
2272
2271
|
emits: ["update:modelValue", "change", "clear"],
|
|
2273
|
-
setup(
|
|
2274
|
-
const
|
|
2275
|
-
get: () =>
|
|
2276
|
-
set: (
|
|
2272
|
+
setup(t, { expose: o, emit: p }) {
|
|
2273
|
+
const l = t, i = p, a = A(), v = A($e(l.type, l.layout)), d = E({
|
|
2274
|
+
get: () => l.modelValue,
|
|
2275
|
+
set: (c) => i("update:modelValue", c)
|
|
2277
2276
|
});
|
|
2278
|
-
function
|
|
2279
|
-
|
|
2277
|
+
function f(c) {
|
|
2278
|
+
i("clear", c);
|
|
2280
2279
|
}
|
|
2281
|
-
function
|
|
2282
|
-
|
|
2280
|
+
function h(c, m) {
|
|
2281
|
+
i("change", { name: c, value: m }), l.modelValue !== void 0 && i("update:modelValue", m);
|
|
2283
2282
|
}
|
|
2284
|
-
return
|
|
2285
|
-
() =>
|
|
2286
|
-
(
|
|
2287
|
-
|
|
2283
|
+
return I(
|
|
2284
|
+
() => l.default,
|
|
2285
|
+
(c) => {
|
|
2286
|
+
d.value = c;
|
|
2288
2287
|
}
|
|
2289
|
-
),
|
|
2290
|
-
() =>
|
|
2291
|
-
(
|
|
2292
|
-
|
|
2288
|
+
), I(
|
|
2289
|
+
() => l.modelValue,
|
|
2290
|
+
(c) => {
|
|
2291
|
+
d.value = c;
|
|
2293
2292
|
}
|
|
2294
|
-
),
|
|
2295
|
-
() =>
|
|
2296
|
-
(
|
|
2297
|
-
|
|
2293
|
+
), I(
|
|
2294
|
+
() => l,
|
|
2295
|
+
(c) => {
|
|
2296
|
+
d.value = c;
|
|
2298
2297
|
}
|
|
2299
|
-
),
|
|
2300
|
-
filterRef:
|
|
2301
|
-
}), (
|
|
2302
|
-
type:
|
|
2303
|
-
class:
|
|
2304
|
-
modelValue:
|
|
2305
|
-
"onUpdate:modelValue":
|
|
2306
|
-
onChange:
|
|
2307
|
-
onClear:
|
|
2298
|
+
), o({
|
|
2299
|
+
filterRef: a
|
|
2300
|
+
}), (c, m) => (s(), O(oe(v.value?.component), Z(l, {
|
|
2301
|
+
type: v.value?.type,
|
|
2302
|
+
class: l.itemClass,
|
|
2303
|
+
modelValue: d.value,
|
|
2304
|
+
"onUpdate:modelValue": m[0] || (m[0] = (y) => d.value = y),
|
|
2305
|
+
onChange: m[1] || (m[1] = (y) => h(y.name, y.value)),
|
|
2306
|
+
onClear: m[2] || (m[2] = (y) => f(y)),
|
|
2308
2307
|
ref_key: "filterRef",
|
|
2309
|
-
ref:
|
|
2308
|
+
ref: a
|
|
2310
2309
|
}), null, 16, ["type", "class", "modelValue"]));
|
|
2311
2310
|
}
|
|
2312
|
-
}), le = /* @__PURE__ */
|
|
2311
|
+
}), le = /* @__PURE__ */ W({
|
|
2313
2312
|
__name: "filter-field",
|
|
2314
2313
|
props: {
|
|
2315
2314
|
id: {},
|
|
@@ -2338,184 +2337,184 @@ const Zl = { style: { display: "inline-flex", margin: "0px", width: "100%" } },
|
|
|
2338
2337
|
itemClass: {}
|
|
2339
2338
|
},
|
|
2340
2339
|
emits: ["update:modelValue", "change", "clear"],
|
|
2341
|
-
setup(
|
|
2342
|
-
const
|
|
2343
|
-
get: () =>
|
|
2344
|
-
set: (
|
|
2340
|
+
setup(t, { expose: o, emit: p }) {
|
|
2341
|
+
const l = t, i = p, a = A(), v = E({
|
|
2342
|
+
get: () => l.modelValue,
|
|
2343
|
+
set: (c) => i("update:modelValue", c)
|
|
2345
2344
|
});
|
|
2346
|
-
function
|
|
2347
|
-
|
|
2345
|
+
function d(c) {
|
|
2346
|
+
i("clear", c);
|
|
2348
2347
|
}
|
|
2349
|
-
function
|
|
2350
|
-
|
|
2348
|
+
function f(c, m) {
|
|
2349
|
+
i("change", { name: c, value: m }), l.modelValue !== void 0 && i("update:modelValue", m);
|
|
2351
2350
|
}
|
|
2352
|
-
|
|
2353
|
-
() =>
|
|
2354
|
-
(
|
|
2355
|
-
|
|
2351
|
+
I(
|
|
2352
|
+
() => l.default,
|
|
2353
|
+
(c) => {
|
|
2354
|
+
v.value = c;
|
|
2356
2355
|
}
|
|
2357
|
-
),
|
|
2358
|
-
() =>
|
|
2359
|
-
(
|
|
2360
|
-
|
|
2356
|
+
), I(
|
|
2357
|
+
() => l.modelValue,
|
|
2358
|
+
(c) => {
|
|
2359
|
+
v.value = c;
|
|
2361
2360
|
}
|
|
2362
|
-
),
|
|
2363
|
-
filterRef:
|
|
2361
|
+
), o({
|
|
2362
|
+
filterRef: a
|
|
2364
2363
|
});
|
|
2365
|
-
function
|
|
2366
|
-
switch (
|
|
2364
|
+
function h() {
|
|
2365
|
+
switch (l.layout) {
|
|
2367
2366
|
case "inline":
|
|
2368
|
-
return
|
|
2367
|
+
return Fe;
|
|
2369
2368
|
case "vertical":
|
|
2370
|
-
return
|
|
2369
|
+
return na;
|
|
2371
2370
|
case "popover":
|
|
2372
|
-
return
|
|
2371
|
+
return oa;
|
|
2373
2372
|
default:
|
|
2374
|
-
return
|
|
2373
|
+
return Fe;
|
|
2375
2374
|
}
|
|
2376
2375
|
}
|
|
2377
|
-
return (
|
|
2378
|
-
onChange:
|
|
2379
|
-
onClear:
|
|
2380
|
-
modelValue:
|
|
2381
|
-
"onUpdate:modelValue":
|
|
2376
|
+
return (c, m) => (s(), O(oe(h()), Z(l, {
|
|
2377
|
+
onChange: m[0] || (m[0] = (y) => f(y.name, y.value)),
|
|
2378
|
+
onClear: m[1] || (m[1] = (y) => d(y)),
|
|
2379
|
+
modelValue: v.value,
|
|
2380
|
+
"onUpdate:modelValue": m[2] || (m[2] = (y) => v.value = y)
|
|
2382
2381
|
}), null, 16, ["modelValue"]));
|
|
2383
2382
|
}
|
|
2384
2383
|
});
|
|
2385
|
-
function ye(
|
|
2384
|
+
function ye(t, o) {
|
|
2386
2385
|
const {
|
|
2387
|
-
slots:
|
|
2388
|
-
} =
|
|
2389
|
-
function
|
|
2390
|
-
delete
|
|
2391
|
-
data:
|
|
2392
|
-
name:
|
|
2386
|
+
slots: p
|
|
2387
|
+
} = t, l = A(t.value ?? {}), i = E(() => (ce(p?.default?.()) ?? []).flatMap((u) => Array.isArray(u.children) ? u.children : [u]));
|
|
2388
|
+
function a(n) {
|
|
2389
|
+
delete l.value[n], o("clear", {
|
|
2390
|
+
data: ce(l.value),
|
|
2391
|
+
name: n
|
|
2393
2392
|
});
|
|
2394
2393
|
}
|
|
2395
|
-
function
|
|
2396
|
-
|
|
2397
|
-
...
|
|
2398
|
-
[
|
|
2399
|
-
},
|
|
2400
|
-
data:
|
|
2401
|
-
name:
|
|
2402
|
-
value:
|
|
2394
|
+
function v(n, u) {
|
|
2395
|
+
u === void 0 ? a(n) : l.value = {
|
|
2396
|
+
...l.value,
|
|
2397
|
+
[n]: u
|
|
2398
|
+
}, o("change", {
|
|
2399
|
+
data: ce(l.value),
|
|
2400
|
+
name: n,
|
|
2401
|
+
value: u
|
|
2403
2402
|
});
|
|
2404
2403
|
}
|
|
2405
|
-
const
|
|
2406
|
-
const
|
|
2407
|
-
return We(
|
|
2408
|
-
...
|
|
2409
|
-
layout:
|
|
2404
|
+
const d = E(() => i.value.map((n) => {
|
|
2405
|
+
const u = n.props?.name;
|
|
2406
|
+
return We(n, {
|
|
2407
|
+
...n.props,
|
|
2408
|
+
layout: t.view,
|
|
2410
2409
|
showClean: !0,
|
|
2411
|
-
modelValue:
|
|
2412
|
-
"onUpdate:modelValue": (
|
|
2413
|
-
|
|
2410
|
+
modelValue: l.value[u],
|
|
2411
|
+
"onUpdate:modelValue": (x) => {
|
|
2412
|
+
v(u, x);
|
|
2414
2413
|
},
|
|
2415
|
-
onClear: () =>
|
|
2416
|
-
class: [
|
|
2417
|
-
itemClass: [
|
|
2414
|
+
onClear: () => a(u),
|
|
2415
|
+
class: [t.itemClass, n.props?.class],
|
|
2416
|
+
itemClass: [t.itemClass, n.props?.itemClass].filter((x) => typeof x == "string" && x.trim().length > 0).join(" ") || void 0
|
|
2418
2417
|
});
|
|
2419
|
-
})),
|
|
2418
|
+
})), f = E(
|
|
2420
2419
|
() => new Map(
|
|
2421
|
-
|
|
2422
|
-
const
|
|
2423
|
-
return
|
|
2424
|
-
}).filter((
|
|
2420
|
+
d.value.map((n) => {
|
|
2421
|
+
const u = n.props?.name;
|
|
2422
|
+
return u ? [u, n] : null;
|
|
2423
|
+
}).filter((n) => n !== null)
|
|
2425
2424
|
)
|
|
2426
2425
|
);
|
|
2427
|
-
function
|
|
2428
|
-
|
|
2429
|
-
data:
|
|
2426
|
+
function h(n = !1) {
|
|
2427
|
+
l.value = {}, n || o("clearAll", {
|
|
2428
|
+
data: ce(l.value),
|
|
2430
2429
|
name: "ALL"
|
|
2431
2430
|
});
|
|
2432
2431
|
}
|
|
2433
|
-
const
|
|
2434
|
-
|
|
2435
|
-
await
|
|
2432
|
+
const c = A(""), m = E(() => t.schema?.value ? Object.entries(l.value).filter(([n, u]) => t.schema && !(n in t.schema.value) ? !1 : Array.isArray(u) ? u.some((x) => x !== "" && x !== void 0) : u !== "" && u !== void 0).length : 0), y = A();
|
|
2433
|
+
I(c, async () => {
|
|
2434
|
+
await pe(), y?.value?.filterRef?.inputTextRef && y.value.filterRef.inputTextRef.focus();
|
|
2436
2435
|
});
|
|
2437
|
-
const k =
|
|
2438
|
-
if (
|
|
2439
|
-
let
|
|
2440
|
-
if (
|
|
2441
|
-
const
|
|
2442
|
-
|
|
2436
|
+
const k = E(() => t.schema?.value ? Object.fromEntries(Object.entries(t.schema?.value).slice(0, t.limit)) : {}), V = E(() => {
|
|
2437
|
+
if (d.value.length === 0) return [];
|
|
2438
|
+
let n = 0;
|
|
2439
|
+
if (t.schema?.value) {
|
|
2440
|
+
const u = Object.entries(t.schema.value).length;
|
|
2441
|
+
t.limit && u < t.limit ? n = t.limit - u : n = 0;
|
|
2443
2442
|
}
|
|
2444
|
-
return
|
|
2445
|
-
}), C =
|
|
2443
|
+
return d.value.slice(0, n);
|
|
2444
|
+
}), C = E(() => d.value.length === 0 ? [] : t.view !== "inline" ? d.value : d.value.slice(V.value.length));
|
|
2446
2445
|
return {
|
|
2447
|
-
activeFilter:
|
|
2448
|
-
activeFilterCount:
|
|
2449
|
-
onFilterChange:
|
|
2450
|
-
clearFilter:
|
|
2451
|
-
clearAllFilters:
|
|
2446
|
+
activeFilter: l,
|
|
2447
|
+
activeFilterCount: m,
|
|
2448
|
+
onFilterChange: v,
|
|
2449
|
+
clearFilter: a,
|
|
2450
|
+
clearAllFilters: h,
|
|
2452
2451
|
limitedSchema: k,
|
|
2453
|
-
filtersSlot:
|
|
2454
|
-
limitedFiltersSlot:
|
|
2452
|
+
filtersSlot: d,
|
|
2453
|
+
limitedFiltersSlot: V,
|
|
2455
2454
|
popoverFiltersSlot: C,
|
|
2456
|
-
vnodeMap:
|
|
2457
|
-
selectedFilter:
|
|
2458
|
-
filterRef:
|
|
2455
|
+
vnodeMap: f,
|
|
2456
|
+
selectedFilter: c,
|
|
2457
|
+
filterRef: y
|
|
2459
2458
|
};
|
|
2460
2459
|
}
|
|
2461
|
-
const
|
|
2460
|
+
const ra = /* @__PURE__ */ W({
|
|
2462
2461
|
__name: "popover",
|
|
2463
2462
|
emits: ["open", "close"],
|
|
2464
|
-
setup(
|
|
2465
|
-
const
|
|
2466
|
-
function
|
|
2467
|
-
|
|
2463
|
+
setup(t, { emit: o }) {
|
|
2464
|
+
const p = A(!1), l = A(null), i = A(null), a = A(null), v = A({ top: "0px", left: "0px", position: "absolute" });
|
|
2465
|
+
function d() {
|
|
2466
|
+
p.value = !p.value;
|
|
2468
2467
|
}
|
|
2469
|
-
function
|
|
2470
|
-
const k =
|
|
2471
|
-
if (!k || !
|
|
2472
|
-
const C = k.getBoundingClientRect(),
|
|
2473
|
-
let
|
|
2474
|
-
|
|
2468
|
+
function f() {
|
|
2469
|
+
const k = a.value, V = l.value;
|
|
2470
|
+
if (!k || !V) return;
|
|
2471
|
+
const C = k.getBoundingClientRect(), n = V.offsetWidth, u = window.innerWidth - C.left;
|
|
2472
|
+
let x = C.left + window.scrollX;
|
|
2473
|
+
n > u && (x = window.innerWidth - n - 8, x < 8 && (x = 8)), v.value = {
|
|
2475
2474
|
position: "absolute",
|
|
2476
2475
|
top: `${C.bottom + window.scrollY + 8}px`,
|
|
2477
|
-
left: `${
|
|
2476
|
+
left: `${x}px`
|
|
2478
2477
|
};
|
|
2479
2478
|
}
|
|
2480
|
-
const
|
|
2481
|
-
function
|
|
2482
|
-
const
|
|
2483
|
-
!
|
|
2479
|
+
const h = E(() => Object.entries(v.value).map((k) => k.join(":")).join(";"));
|
|
2480
|
+
function c(k) {
|
|
2481
|
+
const V = k.target;
|
|
2482
|
+
!a.value?.contains(k.target) && !l.value?.contains(k.target) && !V.closest("[data-inside-popover]") && (p.value = !1);
|
|
2484
2483
|
}
|
|
2485
|
-
const
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
}),
|
|
2489
|
-
|
|
2490
|
-
}),
|
|
2491
|
-
|
|
2484
|
+
const m = A(!1);
|
|
2485
|
+
de(() => {
|
|
2486
|
+
m.value = !0;
|
|
2487
|
+
}), de(() => {
|
|
2488
|
+
a.value = i.value?.querySelector("[data-popover-trigger]") || null, a.value?.addEventListener("click", d), document.addEventListener("click", c), window.addEventListener("resize", f), window.addEventListener("scroll", f, !0);
|
|
2489
|
+
}), me(() => {
|
|
2490
|
+
a.value?.removeEventListener("click", d), document.removeEventListener("click", c), window.removeEventListener("resize", f), window.removeEventListener("scroll", f, !0);
|
|
2492
2491
|
});
|
|
2493
|
-
const
|
|
2494
|
-
return
|
|
2495
|
-
k ? (
|
|
2496
|
-
}), (k,
|
|
2492
|
+
const y = o;
|
|
2493
|
+
return I(p, async (k) => {
|
|
2494
|
+
k ? (y("open"), await pe(), f()) : y("close");
|
|
2495
|
+
}), (k, V) => (s(), w("div", {
|
|
2497
2496
|
ref_key: "wrapperRef",
|
|
2498
|
-
ref:
|
|
2497
|
+
ref: i
|
|
2499
2498
|
}, [
|
|
2500
2499
|
ue(k.$slots, "trigger"),
|
|
2501
|
-
|
|
2500
|
+
m.value ? (s(), O(ge, {
|
|
2502
2501
|
key: 0,
|
|
2503
2502
|
to: "body"
|
|
2504
2503
|
}, [
|
|
2505
|
-
|
|
2504
|
+
Y(r("div", {
|
|
2506
2505
|
ref_key: "popoverRef",
|
|
2507
|
-
ref:
|
|
2506
|
+
ref: l,
|
|
2508
2507
|
class: "absolute z-[50] w-[600px] rounded-md border bg-white shadow-md",
|
|
2509
|
-
style: be(
|
|
2508
|
+
style: be(h.value)
|
|
2510
2509
|
}, [
|
|
2511
2510
|
ue(k.$slots, "default")
|
|
2512
2511
|
], 4), [
|
|
2513
|
-
[J,
|
|
2512
|
+
[J, p.value]
|
|
2514
2513
|
])
|
|
2515
|
-
])) :
|
|
2514
|
+
])) : $("", !0)
|
|
2516
2515
|
], 512));
|
|
2517
2516
|
}
|
|
2518
|
-
}),
|
|
2517
|
+
}), sa = {}, ia = {
|
|
2519
2518
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2520
2519
|
width: "24",
|
|
2521
2520
|
height: "24",
|
|
@@ -2527,27 +2526,27 @@ const ro = /* @__PURE__ */ q({
|
|
|
2527
2526
|
"stroke-linejoin": "round",
|
|
2528
2527
|
class: "lucide lucide-filter h-4 w-4"
|
|
2529
2528
|
};
|
|
2530
|
-
function
|
|
2531
|
-
return
|
|
2532
|
-
|
|
2533
|
-
]));
|
|
2529
|
+
function ua(t, o) {
|
|
2530
|
+
return s(), w("svg", ia, [...o[0] || (o[0] = [
|
|
2531
|
+
r("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" }, null, -1)
|
|
2532
|
+
])]);
|
|
2534
2533
|
}
|
|
2535
|
-
const Ue = /* @__PURE__ */ te(
|
|
2534
|
+
const Ue = /* @__PURE__ */ te(sa, [["render", ua]]), ca = { class: "flex items-center gap-2 overflow-hidden" }, da = {
|
|
2536
2535
|
key: 0,
|
|
2537
2536
|
class: "inline-flex min-h-[18px] min-w-[18px] items-center justify-center rounded-[4px] bg-blue-500 px-1 text-[11px] font-semibold text-white"
|
|
2538
|
-
},
|
|
2537
|
+
}, fa = { class: "flex max-h-[calc(100dvh-240px)]" }, ma = { class: "w-64 border-r border-gray-200 overflow-y-auto" }, pa = { class: "p-4 border-b" }, va = { class: "text-sm text-gray-600" }, ya = { class: "p-2" }, ga = ["onClick"], ba = { class: "flex items-center gap-2" }, xa = { class: "text-sm font-medium" }, ha = {
|
|
2539
2538
|
key: 0,
|
|
2540
2539
|
class: "inline-flex min-h-[18px] min-w-[18px] items-center justify-center rounded-[4px] bg-blue-100 px-1 text-[11px] font-semibold text-blue-600"
|
|
2541
|
-
},
|
|
2540
|
+
}, wa = ["onClick"], ka = { class: "flex items-center gap-2" }, Ca = { class: "text-sm font-medium" }, Va = {
|
|
2542
2541
|
key: 0,
|
|
2543
2542
|
class: "inline-flex min-h-[18px] min-w-[18px] items-center justify-center rounded-[4px] bg-blue-100 px-1 text-[11px] font-semibold text-blue-600"
|
|
2544
|
-
}, $
|
|
2543
|
+
}, $a = {
|
|
2545
2544
|
key: 0,
|
|
2546
2545
|
class: "p-2 border-t"
|
|
2547
|
-
},
|
|
2546
|
+
}, Aa = { class: "flex-1 min-h-[300px] overflow-y-auto" }, Ba = {
|
|
2548
2547
|
key: 0,
|
|
2549
2548
|
class: "flex items-center justify-center h-full text-gray-500"
|
|
2550
|
-
},
|
|
2549
|
+
}, Sa = { class: "text-sm" }, ze = /* @__PURE__ */ W({
|
|
2551
2550
|
__name: "popover-filter-layout",
|
|
2552
2551
|
props: {
|
|
2553
2552
|
badgeCount: {},
|
|
@@ -2564,163 +2563,163 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2564
2563
|
itemClass: {}
|
|
2565
2564
|
},
|
|
2566
2565
|
emits: ["change", "clear", "clearAll"],
|
|
2567
|
-
setup(
|
|
2568
|
-
const
|
|
2569
|
-
activeFilter:
|
|
2570
|
-
activeFilterCount:
|
|
2571
|
-
onFilterChange:
|
|
2566
|
+
setup(t, { expose: o, emit: p }) {
|
|
2567
|
+
const l = ae(), i = t, a = Te(i.mode), v = fe(), d = p, f = A({}), h = E(() => f?.value ? i.view !== "inline" ? f?.value : Object.fromEntries(Object.entries(f?.value).slice(i.limit)) : {}), {
|
|
2568
|
+
activeFilter: c,
|
|
2569
|
+
activeFilterCount: m,
|
|
2570
|
+
onFilterChange: y,
|
|
2572
2571
|
clearFilter: k,
|
|
2573
|
-
clearAllFilters:
|
|
2572
|
+
clearAllFilters: V,
|
|
2574
2573
|
popoverFiltersSlot: C,
|
|
2575
|
-
selectedFilter:
|
|
2576
|
-
filterRef:
|
|
2574
|
+
selectedFilter: n,
|
|
2575
|
+
filterRef: u
|
|
2577
2576
|
} = ye({
|
|
2578
|
-
...
|
|
2579
|
-
schema:
|
|
2580
|
-
slots:
|
|
2581
|
-
},
|
|
2582
|
-
function
|
|
2583
|
-
return Array.isArray(
|
|
2577
|
+
...i,
|
|
2578
|
+
schema: f,
|
|
2579
|
+
slots: v
|
|
2580
|
+
}, d), x = E(() => i.badgeCount ?? m.value);
|
|
2581
|
+
function g(U) {
|
|
2582
|
+
return Array.isArray(U) ? U.filter((j) => j != null && j !== "").length : U && typeof U == "object" ? Object.values(U).filter((j) => j != null && j !== "").length : U === null || U !== void 0 && U !== "" ? 1 : 0;
|
|
2584
2583
|
}
|
|
2585
|
-
function b(
|
|
2586
|
-
return
|
|
2584
|
+
function b(U) {
|
|
2585
|
+
return c.value ? g(c.value[U]) : 0;
|
|
2587
2586
|
}
|
|
2588
|
-
function
|
|
2589
|
-
if (
|
|
2590
|
-
const [
|
|
2591
|
-
|
|
2592
|
-
} else C.value.length > 0 ?
|
|
2587
|
+
function M() {
|
|
2588
|
+
if (h.value) {
|
|
2589
|
+
const [U] = Object.keys(h.value);
|
|
2590
|
+
n.value = U;
|
|
2591
|
+
} else C.value.length > 0 ? n.value = C.value[0].props.name : n.value = "";
|
|
2593
2592
|
}
|
|
2594
|
-
return
|
|
2595
|
-
() =>
|
|
2596
|
-
(
|
|
2597
|
-
|
|
2593
|
+
return I(
|
|
2594
|
+
() => i.schema,
|
|
2595
|
+
(U) => {
|
|
2596
|
+
f.value = U ?? {};
|
|
2598
2597
|
},
|
|
2599
2598
|
{ deep: !0, immediate: !0 }
|
|
2600
|
-
),
|
|
2599
|
+
), o({
|
|
2601
2600
|
clearFilter: k,
|
|
2602
|
-
clearAllFilters:
|
|
2603
|
-
}), (
|
|
2604
|
-
onOpen:
|
|
2605
|
-
onClose:
|
|
2601
|
+
clearAllFilters: V
|
|
2602
|
+
}), (U, j) => (s(), O(ra, {
|
|
2603
|
+
onOpen: M,
|
|
2604
|
+
onClose: j[5] || (j[5] = (S) => n.value = "")
|
|
2606
2605
|
}, {
|
|
2607
|
-
trigger:
|
|
2608
|
-
|
|
2606
|
+
trigger: ne(() => [
|
|
2607
|
+
r("button", {
|
|
2609
2608
|
"data-popover-trigger": "",
|
|
2610
2609
|
"aria-haspopup": "dialog",
|
|
2611
2610
|
"aria-expanded": "false",
|
|
2612
|
-
class:
|
|
2613
|
-
|
|
2614
|
-
e(
|
|
2611
|
+
class: _([
|
|
2612
|
+
t.itemClass,
|
|
2613
|
+
e(a),
|
|
2615
2614
|
"flex items-center justify-between gap-2",
|
|
2616
|
-
|
|
2615
|
+
x.value > 0 ? "border border-blue-400 bg-blue-50 text-blue-600 hover:border-blue-500" : "text-neutral-700 hover:border-neutral-400"
|
|
2617
2616
|
]),
|
|
2618
2617
|
type: "button"
|
|
2619
2618
|
}, [
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2619
|
+
r("span", ca, [
|
|
2620
|
+
q(Ue, { class: "h-4 w-4" }),
|
|
2621
|
+
j[6] || (j[6] = r("span", { class: "text-sm font-medium" }, "Фільтр", -1))
|
|
2623
2622
|
]),
|
|
2624
|
-
|
|
2623
|
+
x.value > 0 ? (s(), w("span", da, B(x.value), 1)) : $("", !0)
|
|
2625
2624
|
], 2)
|
|
2626
2625
|
]),
|
|
2627
|
-
default:
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2626
|
+
default: ne(() => [
|
|
2627
|
+
r("div", fa, [
|
|
2628
|
+
r("div", ma, [
|
|
2629
|
+
r("div", pa, [
|
|
2630
|
+
r("p", va, B(e(l)("filter.selectFieldHelp")), 1)
|
|
2632
2631
|
]),
|
|
2633
|
-
|
|
2634
|
-
|
|
2632
|
+
r("div", ya, [
|
|
2633
|
+
t.schema ? (s(!0), w(T, { key: 0 }, X(Object.entries(h.value), ([S, K]) => (s(), w("button", {
|
|
2635
2634
|
key: S,
|
|
2636
2635
|
onClick: () => {
|
|
2637
|
-
|
|
2636
|
+
n.value = S;
|
|
2638
2637
|
},
|
|
2639
|
-
class:
|
|
2638
|
+
class: _([
|
|
2640
2639
|
"flex w-full items-center justify-between px-3 py-2 text-left transition-colors hover:bg-gray-50",
|
|
2641
|
-
e(
|
|
2640
|
+
e(n) === S ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : "text-neutral-700"
|
|
2642
2641
|
])
|
|
2643
2642
|
}, [
|
|
2644
|
-
|
|
2645
|
-
|
|
2643
|
+
r("div", ba, [
|
|
2644
|
+
r("span", xa, B(K.label), 1)
|
|
2646
2645
|
]),
|
|
2647
|
-
b(S) > 0 ? (
|
|
2648
|
-
], 10,
|
|
2649
|
-
(
|
|
2650
|
-
key: "slot-" +
|
|
2651
|
-
onClick: (
|
|
2652
|
-
class:
|
|
2646
|
+
b(S) > 0 ? (s(), w("div", ha, B(b(S)), 1)) : $("", !0)
|
|
2647
|
+
], 10, ga))), 128)) : $("", !0),
|
|
2648
|
+
(s(!0), w(T, null, X(e(C), (S, K) => (s(), w("button", {
|
|
2649
|
+
key: "slot-" + K,
|
|
2650
|
+
onClick: (R) => n.value = S.props.name,
|
|
2651
|
+
class: _([
|
|
2653
2652
|
"flex items-center justify-between px-3 py-2 text-left transition-colors hover:bg-gray-50",
|
|
2654
|
-
e(
|
|
2653
|
+
e(n) === S.props.name ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : "text-neutral-700"
|
|
2655
2654
|
])
|
|
2656
2655
|
}, [
|
|
2657
|
-
|
|
2658
|
-
|
|
2656
|
+
r("div", ka, [
|
|
2657
|
+
r("span", Ca, B(S.props.label), 1)
|
|
2659
2658
|
]),
|
|
2660
|
-
b(S.props.name) > 0 ? (
|
|
2661
|
-
], 10,
|
|
2659
|
+
b(S.props.name) > 0 ? (s(), w("div", Va, B(b(S.props.name)), 1)) : $("", !0)
|
|
2660
|
+
], 10, wa))), 128))
|
|
2662
2661
|
]),
|
|
2663
|
-
e(
|
|
2664
|
-
|
|
2665
|
-
class:
|
|
2666
|
-
onClick:
|
|
2662
|
+
e(m) > 0 ? (s(), w("div", $a, [
|
|
2663
|
+
r("button", {
|
|
2664
|
+
class: _([t.itemClass, "w-full px-3 py-2 text-left text-sm text-gray-600 hover:bg-gray-50 transition-colors"]),
|
|
2665
|
+
onClick: j[0] || (j[0] = (S) => e(V)()),
|
|
2667
2666
|
"data-inside-popover": ""
|
|
2668
2667
|
}, " Очистити всі ", 2)
|
|
2669
|
-
])) :
|
|
2668
|
+
])) : $("", !0)
|
|
2670
2669
|
]),
|
|
2671
|
-
|
|
2672
|
-
e(
|
|
2673
|
-
|
|
2674
|
-
])) :
|
|
2675
|
-
e(
|
|
2676
|
-
|
|
2677
|
-
e(
|
|
2670
|
+
r("div", Aa, [
|
|
2671
|
+
e(n) === "" ? (s(), w("div", Ba, [
|
|
2672
|
+
r("p", Sa, B(e(l)("filter.selectFieldHelp")), 1)
|
|
2673
|
+
])) : $("", !0),
|
|
2674
|
+
e(n) ? (s(), w(T, { key: 1 }, [
|
|
2675
|
+
h.value ? (s(!0), w(T, { key: 0 }, X(Object.entries(h.value), ([S, K]) => (s(), w(T, null, [
|
|
2676
|
+
e(n) === S ? (s(), O(le, Z({
|
|
2678
2677
|
key: S,
|
|
2679
2678
|
layout: "popover",
|
|
2680
2679
|
ref_for: !0,
|
|
2681
2680
|
ref_key: "filterRef",
|
|
2682
|
-
ref:
|
|
2683
|
-
}, { ref_for: !0 },
|
|
2684
|
-
class: [
|
|
2685
|
-
"item-class": [
|
|
2686
|
-
onChange:
|
|
2687
|
-
onClear:
|
|
2688
|
-
e(k)(
|
|
2681
|
+
ref: u
|
|
2682
|
+
}, { ref_for: !0 }, K, {
|
|
2683
|
+
class: [t.itemClass, K?.class],
|
|
2684
|
+
"item-class": [t.itemClass, K?.itemClass].filter(Boolean).join(" ") || void 0,
|
|
2685
|
+
onChange: j[1] || (j[1] = (R) => e(y)(R.name, R.value)),
|
|
2686
|
+
onClear: j[2] || (j[2] = (R) => {
|
|
2687
|
+
e(k)(R), e(y)(R, void 0);
|
|
2689
2688
|
}),
|
|
2690
|
-
modelValue: e(
|
|
2691
|
-
"onUpdate:modelValue": (
|
|
2689
|
+
modelValue: e(c)[S],
|
|
2690
|
+
"onUpdate:modelValue": (R) => e(c)[S] = R,
|
|
2692
2691
|
cleanable: !0
|
|
2693
|
-
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"])) :
|
|
2694
|
-
], 64))), 256)) :
|
|
2695
|
-
(
|
|
2696
|
-
key: "slot-" +
|
|
2692
|
+
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"])) : $("", !0)
|
|
2693
|
+
], 64))), 256)) : $("", !0),
|
|
2694
|
+
(s(!0), w(T, null, X(e(C), (S, K) => (s(), w(T, {
|
|
2695
|
+
key: "slot-" + K
|
|
2697
2696
|
}, [
|
|
2698
|
-
e(
|
|
2697
|
+
e(n) === S.props.name ? (s(), O(le, Z({
|
|
2699
2698
|
key: 0,
|
|
2700
2699
|
layout: "popover"
|
|
2701
2700
|
}, { ref_for: !0 }, S.props, {
|
|
2702
2701
|
ref_for: !0,
|
|
2703
2702
|
ref_key: "filterRef",
|
|
2704
|
-
ref:
|
|
2705
|
-
class: [
|
|
2706
|
-
"item-class": [
|
|
2707
|
-
onChange:
|
|
2708
|
-
onClear:
|
|
2709
|
-
e(k)(
|
|
2703
|
+
ref: u,
|
|
2704
|
+
class: [t.itemClass, S.props?.class],
|
|
2705
|
+
"item-class": [t.itemClass, S.props?.itemClass].filter(Boolean).join(" ") || void 0,
|
|
2706
|
+
onChange: j[3] || (j[3] = (R) => e(y)(R.name, R.value)),
|
|
2707
|
+
onClear: j[4] || (j[4] = (R) => {
|
|
2708
|
+
e(k)(R), e(y)(R, void 0);
|
|
2710
2709
|
}),
|
|
2711
|
-
modelValue: e(
|
|
2712
|
-
"onUpdate:modelValue": (
|
|
2710
|
+
modelValue: e(c)[S.props.name],
|
|
2711
|
+
"onUpdate:modelValue": (R) => e(c)[S.props.name] = R,
|
|
2713
2712
|
cleanable: !0
|
|
2714
|
-
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"])) :
|
|
2713
|
+
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"])) : $("", !0)
|
|
2715
2714
|
], 64))), 128))
|
|
2716
|
-
], 64)) :
|
|
2715
|
+
], 64)) : $("", !0)
|
|
2717
2716
|
])
|
|
2718
2717
|
])
|
|
2719
2718
|
]),
|
|
2720
2719
|
_: 1
|
|
2721
2720
|
}));
|
|
2722
2721
|
}
|
|
2723
|
-
}),
|
|
2722
|
+
}), ja = { class: "flex gap-1 items-center flex-wrap" }, Ke = /* @__PURE__ */ W({
|
|
2724
2723
|
__name: "inline-filter-layout",
|
|
2725
2724
|
props: {
|
|
2726
2725
|
schema: {},
|
|
@@ -2736,106 +2735,106 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2736
2735
|
itemClass: {}
|
|
2737
2736
|
},
|
|
2738
2737
|
emits: ["change", "clear", "clearAll"],
|
|
2739
|
-
setup(
|
|
2740
|
-
const
|
|
2741
|
-
activeFilter:
|
|
2742
|
-
activeFilterCount:
|
|
2743
|
-
onFilterChange:
|
|
2744
|
-
clearFilter:
|
|
2738
|
+
setup(t, { expose: o, emit: p }) {
|
|
2739
|
+
const l = ae(), i = t, a = p, v = fe(), d = A({}), f = E(() => Object.keys(i.schema).length > i.limit), {
|
|
2740
|
+
activeFilter: h,
|
|
2741
|
+
activeFilterCount: c,
|
|
2742
|
+
onFilterChange: m,
|
|
2743
|
+
clearFilter: y,
|
|
2745
2744
|
clearAllFilters: k,
|
|
2746
|
-
limitedSchema:
|
|
2745
|
+
limitedSchema: V,
|
|
2747
2746
|
filtersSlot: C,
|
|
2748
|
-
limitedFiltersSlot:
|
|
2747
|
+
limitedFiltersSlot: n
|
|
2749
2748
|
} = ye(
|
|
2750
2749
|
{
|
|
2751
|
-
...
|
|
2752
|
-
schema:
|
|
2753
|
-
slots:
|
|
2750
|
+
...i,
|
|
2751
|
+
schema: d,
|
|
2752
|
+
slots: v
|
|
2754
2753
|
},
|
|
2755
|
-
|
|
2754
|
+
a
|
|
2756
2755
|
);
|
|
2757
|
-
function
|
|
2758
|
-
return Array.isArray(
|
|
2756
|
+
function u(j) {
|
|
2757
|
+
return Array.isArray(j) ? j.some((S) => S !== "" && S !== void 0 && S !== null) : j === null ? !0 : j && typeof j == "object" ? Object.values(j).some((S) => S !== "" && S !== void 0 && S !== null) : j !== "" && j !== void 0;
|
|
2759
2758
|
}
|
|
2760
|
-
const
|
|
2761
|
-
const
|
|
2762
|
-
return /* @__PURE__ */ new Set([
|
|
2763
|
-
}),
|
|
2764
|
-
const
|
|
2765
|
-
return Math.max(
|
|
2766
|
-
}),
|
|
2767
|
-
function
|
|
2768
|
-
|
|
2759
|
+
const x = E(() => {
|
|
2760
|
+
const j = Object.keys(V.value ?? {}), S = n.value.map((K) => K.props?.name).filter((K) => typeof K == "string");
|
|
2761
|
+
return /* @__PURE__ */ new Set([...j, ...S]);
|
|
2762
|
+
}), g = E(() => Object.entries(h.value ?? {}).filter(([j, S]) => x.value.has(j) && u(S)).length), b = E(() => {
|
|
2763
|
+
const j = c.value ?? 0, S = g.value ?? 0;
|
|
2764
|
+
return Math.max(j - S, 0);
|
|
2765
|
+
}), M = A();
|
|
2766
|
+
function U() {
|
|
2767
|
+
M.value && M.value.clearAllFilters(!0), k();
|
|
2769
2768
|
}
|
|
2770
|
-
return
|
|
2771
|
-
() =>
|
|
2772
|
-
(
|
|
2773
|
-
|
|
2769
|
+
return I(
|
|
2770
|
+
() => i.schema,
|
|
2771
|
+
(j) => {
|
|
2772
|
+
d.value = j;
|
|
2774
2773
|
},
|
|
2775
2774
|
{ deep: !0, immediate: !0 }
|
|
2776
|
-
),
|
|
2777
|
-
clearFilter:
|
|
2775
|
+
), o({
|
|
2776
|
+
clearFilter: y,
|
|
2778
2777
|
clearAllFilters: k
|
|
2779
|
-
}), (
|
|
2780
|
-
|
|
2781
|
-
key:
|
|
2782
|
-
mode:
|
|
2783
|
-
width:
|
|
2784
|
-
}, { ref_for: !0 },
|
|
2785
|
-
class: [
|
|
2786
|
-
"item-class": [
|
|
2787
|
-
onChange: S[0] || (S[0] = (
|
|
2788
|
-
onClear: e(
|
|
2778
|
+
}), (j, S) => (s(), w("div", ja, [
|
|
2779
|
+
t.schema ? (s(!0), w(T, { key: 0 }, X(Object.entries(e(V)), ([K, R]) => (s(), O(le, Z({
|
|
2780
|
+
key: K,
|
|
2781
|
+
mode: t.mode,
|
|
2782
|
+
width: t.width ? t.width : R?.width
|
|
2783
|
+
}, { ref_for: !0 }, R, {
|
|
2784
|
+
class: [t.itemClass, R?.class],
|
|
2785
|
+
"item-class": [t.itemClass, R?.itemClass].filter(Boolean).join(" ") || void 0,
|
|
2786
|
+
onChange: S[0] || (S[0] = (F) => e(m)(F.name, F.value)),
|
|
2787
|
+
onClear: e(y),
|
|
2789
2788
|
layout: "inline",
|
|
2790
2789
|
cleanable: !0,
|
|
2791
|
-
modelValue: e(
|
|
2792
|
-
"onUpdate:modelValue": (
|
|
2793
|
-
}), null, 16, ["mode", "width", "class", "item-class", "onClear", "modelValue", "onUpdate:modelValue"]))), 128)) :
|
|
2794
|
-
(
|
|
2795
|
-
key: "slot-" +
|
|
2790
|
+
modelValue: e(h)[K],
|
|
2791
|
+
"onUpdate:modelValue": (F) => e(h)[K] = F
|
|
2792
|
+
}), null, 16, ["mode", "width", "class", "item-class", "onClear", "modelValue", "onUpdate:modelValue"]))), 128)) : $("", !0),
|
|
2793
|
+
(s(!0), w(T, null, X(e(n), (K, R) => (s(), O(le, Z({
|
|
2794
|
+
key: "slot-" + R,
|
|
2796
2795
|
layout: "inline"
|
|
2797
|
-
}, { ref_for: !0 },
|
|
2798
|
-
class: [
|
|
2799
|
-
"item-class": [
|
|
2800
|
-
onChange: S[1] || (S[1] = (
|
|
2801
|
-
onClear: S[2] || (S[2] = (
|
|
2802
|
-
e(
|
|
2796
|
+
}, { ref_for: !0 }, K.props, {
|
|
2797
|
+
class: [t.itemClass, K.props?.class],
|
|
2798
|
+
"item-class": [t.itemClass, K.props?.itemClass].filter(Boolean).join(" ") || void 0,
|
|
2799
|
+
onChange: S[1] || (S[1] = (F) => e(m)(F.name, F.value)),
|
|
2800
|
+
onClear: S[2] || (S[2] = (F) => {
|
|
2801
|
+
e(y)(F), e(m)(F, void 0);
|
|
2803
2802
|
}),
|
|
2804
2803
|
cleanable: !0,
|
|
2805
|
-
modelValue: e(
|
|
2806
|
-
"onUpdate:modelValue": (
|
|
2804
|
+
modelValue: e(h)[K.props.name],
|
|
2805
|
+
"onUpdate:modelValue": (F) => e(h)[K.props.name] = F
|
|
2807
2806
|
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"]))), 128)),
|
|
2808
|
-
|
|
2809
|
-
schema:
|
|
2810
|
-
limit:
|
|
2811
|
-
onChange: S[3] || (S[3] = (
|
|
2812
|
-
onClearAll: S[4] || (S[4] = (
|
|
2813
|
-
onClear: S[5] || (S[5] = (
|
|
2814
|
-
mode:
|
|
2807
|
+
f.value ? (s(), O(ze, Z({ key: 1 }, i, {
|
|
2808
|
+
schema: t.schema,
|
|
2809
|
+
limit: t.limit,
|
|
2810
|
+
onChange: S[3] || (S[3] = (K) => e(m)(K.name, K.value)),
|
|
2811
|
+
onClearAll: S[4] || (S[4] = (K) => e(k)()),
|
|
2812
|
+
onClear: S[5] || (S[5] = (K) => e(y)(K.name)),
|
|
2813
|
+
mode: t.mode,
|
|
2815
2814
|
ref_key: "popoverRef",
|
|
2816
|
-
ref:
|
|
2815
|
+
ref: M,
|
|
2817
2816
|
cleanable: !0,
|
|
2818
2817
|
"badge-count": b.value
|
|
2819
2818
|
}), {
|
|
2820
|
-
default:
|
|
2821
|
-
(
|
|
2822
|
-
key: "slot-" +
|
|
2819
|
+
default: ne(() => [
|
|
2820
|
+
(s(!0), w(T, null, X(e(C), (K, R) => (s(), O(oe(K), Z({
|
|
2821
|
+
key: "slot-" + R,
|
|
2823
2822
|
layout: "popover"
|
|
2824
|
-
}, { ref_for: !0 },
|
|
2823
|
+
}, { ref_for: !0 }, K.props, { cleanable: !0 }), null, 16))), 128))
|
|
2825
2824
|
]),
|
|
2826
2825
|
_: 1
|
|
2827
|
-
}, 16, ["schema", "limit", "mode", "badge-count"])) :
|
|
2828
|
-
e(
|
|
2826
|
+
}, 16, ["schema", "limit", "mode", "badge-count"])) : $("", !0),
|
|
2827
|
+
e(c) > 0 ? (s(), w("button", {
|
|
2829
2828
|
key: 2,
|
|
2830
|
-
onClick:
|
|
2831
|
-
class:
|
|
2832
|
-
}, B(e(
|
|
2829
|
+
onClick: U,
|
|
2830
|
+
class: _([t.itemClass, "relative py-2 px-3 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-md bg-gray-50 border text-gray-800 hover:bg-gray-200 focus:bg-gray-200"])
|
|
2831
|
+
}, B(e(l)("filter.clear")), 3)) : $("", !0)
|
|
2833
2832
|
]));
|
|
2834
2833
|
}
|
|
2835
|
-
}),
|
|
2834
|
+
}), Da = {
|
|
2836
2835
|
key: 0,
|
|
2837
2836
|
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"
|
|
2838
|
-
},
|
|
2837
|
+
}, Ra = { class: "flex items-center vst-filters vsTailwind flex-col w-full" }, Fa = /* @__PURE__ */ W({
|
|
2839
2838
|
__name: "vertical-filter-layout",
|
|
2840
2839
|
props: {
|
|
2841
2840
|
schema: {},
|
|
@@ -2851,67 +2850,67 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2851
2850
|
itemClass: {}
|
|
2852
2851
|
},
|
|
2853
2852
|
emits: ["change", "clear", "clearAll"],
|
|
2854
|
-
setup(
|
|
2855
|
-
const
|
|
2856
|
-
activeFilter:
|
|
2857
|
-
activeFilterCount:
|
|
2858
|
-
onFilterChange:
|
|
2859
|
-
clearFilter:
|
|
2860
|
-
clearAllFilters:
|
|
2861
|
-
filtersSlot:
|
|
2853
|
+
setup(t, { expose: o, emit: p }) {
|
|
2854
|
+
const l = t, i = p, a = fe(), {
|
|
2855
|
+
activeFilter: v,
|
|
2856
|
+
activeFilterCount: d,
|
|
2857
|
+
onFilterChange: f,
|
|
2858
|
+
clearFilter: h,
|
|
2859
|
+
clearAllFilters: c,
|
|
2860
|
+
filtersSlot: m
|
|
2862
2861
|
} = ye({
|
|
2863
|
-
...
|
|
2864
|
-
slots:
|
|
2865
|
-
},
|
|
2866
|
-
return
|
|
2867
|
-
clearFilter:
|
|
2868
|
-
clearAllFilters:
|
|
2869
|
-
}), (
|
|
2870
|
-
|
|
2871
|
-
e(
|
|
2862
|
+
...l,
|
|
2863
|
+
slots: a
|
|
2864
|
+
}, i);
|
|
2865
|
+
return o({
|
|
2866
|
+
clearFilter: h,
|
|
2867
|
+
clearAllFilters: c
|
|
2868
|
+
}), (y, k) => t.view === "vertical" ? (s(), w("div", Da, [
|
|
2869
|
+
r("div", Ra, [
|
|
2870
|
+
e(d) > 0 ? (s(), w("button", {
|
|
2872
2871
|
key: 0,
|
|
2873
|
-
onClick: k[0] || (k[0] = (
|
|
2872
|
+
onClick: k[0] || (k[0] = (V) => e(c)()),
|
|
2874
2873
|
"data-popover-trigger": "",
|
|
2875
2874
|
"aria-haspopup": "dialog",
|
|
2876
2875
|
"aria-expanded": "false",
|
|
2877
|
-
class:
|
|
2876
|
+
class: _([t.itemClass, "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"]),
|
|
2878
2877
|
type: "button"
|
|
2879
|
-
}, " Очистити ", 2)) :
|
|
2880
|
-
|
|
2881
|
-
class: [
|
|
2882
|
-
"item-class": [
|
|
2883
|
-
onChange: k[1] || (k[1] = (
|
|
2884
|
-
onClear: k[2] || (k[2] = (
|
|
2885
|
-
e(
|
|
2878
|
+
}, " Очистити ", 2)) : $("", !0),
|
|
2879
|
+
t.schema ? (s(!0), w(T, { key: 1 }, X(Object.entries(t.schema), ([V, C]) => (s(), O(le, Z({ layout: "vertical" }, { ref_for: !0 }, C, {
|
|
2880
|
+
class: [t.itemClass, C?.class],
|
|
2881
|
+
"item-class": [t.itemClass, C?.itemClass].filter(Boolean).join(" ") || void 0,
|
|
2882
|
+
onChange: k[1] || (k[1] = (n) => e(f)(n.name, n.value)),
|
|
2883
|
+
onClear: k[2] || (k[2] = (n) => {
|
|
2884
|
+
e(h)(n), e(f)(n, void 0);
|
|
2886
2885
|
}),
|
|
2887
|
-
modelValue: e(
|
|
2888
|
-
"onUpdate:modelValue": (
|
|
2886
|
+
modelValue: e(v)[V],
|
|
2887
|
+
"onUpdate:modelValue": (n) => e(v)[V] = n,
|
|
2889
2888
|
showClean: !0
|
|
2890
|
-
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"]))), 256)) :
|
|
2891
|
-
(
|
|
2889
|
+
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"]))), 256)) : $("", !0),
|
|
2890
|
+
(s(!0), w(T, null, X(e(m), (V, C) => (s(), O(le, Z({
|
|
2892
2891
|
key: "slot-" + C,
|
|
2893
2892
|
layout: "vertical"
|
|
2894
|
-
}, { ref_for: !0 },
|
|
2895
|
-
class: [
|
|
2896
|
-
"item-class": [
|
|
2897
|
-
onChange: k[3] || (k[3] = (
|
|
2898
|
-
onClear: k[4] || (k[4] = (
|
|
2899
|
-
e(
|
|
2893
|
+
}, { ref_for: !0 }, V.props, {
|
|
2894
|
+
class: [t.itemClass, V.props?.class],
|
|
2895
|
+
"item-class": [t.itemClass, V.props?.itemClass].filter(Boolean).join(" ") || void 0,
|
|
2896
|
+
onChange: k[3] || (k[3] = (n) => e(f)(n.name, n.value)),
|
|
2897
|
+
onClear: k[4] || (k[4] = (n) => {
|
|
2898
|
+
e(h)(n), e(f)(n, void 0);
|
|
2900
2899
|
}),
|
|
2901
|
-
modelValue: e(
|
|
2902
|
-
"onUpdate:modelValue": (
|
|
2900
|
+
modelValue: e(v)[V.props.name],
|
|
2901
|
+
"onUpdate:modelValue": (n) => e(v)[V.props.name] = n,
|
|
2903
2902
|
showClean: !0
|
|
2904
2903
|
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"]))), 128))
|
|
2905
2904
|
])
|
|
2906
|
-
])) :
|
|
2905
|
+
])) : $("", !0);
|
|
2907
2906
|
}
|
|
2908
|
-
}),
|
|
2907
|
+
}), Ka = ["onKeydown"], Ma = ["disabled"], La = {
|
|
2909
2908
|
key: 0,
|
|
2910
2909
|
class: "ml-2 inline-flex min-h-[18px] min-w-[18px] items-center justify-center rounded-full bg-blue-500 px-1.5 text-[11px] font-semibold text-white"
|
|
2911
|
-
},
|
|
2910
|
+
}, _a = { class: "rounded-2xl border border-slate-300/35 bg-white/95 p-4 shadow-2xl backdrop-blur-sm" }, Ea = { class: "mb-3 flex items-center justify-between" }, Oa = { class: "text-[15px] font-semibold text-slate-800" }, Ta = { "aria-hidden": "true" }, Ia = { class: "flex max-h-80 flex-col gap-1 overflow-y-auto" }, Ua = {
|
|
2912
2911
|
key: 0,
|
|
2913
2912
|
class: "mt-3 flex justify-end"
|
|
2914
|
-
},
|
|
2913
|
+
}, za = /* @__PURE__ */ W({
|
|
2915
2914
|
__name: "popover-inline-filter-layout",
|
|
2916
2915
|
props: {
|
|
2917
2916
|
schema: {},
|
|
@@ -2927,177 +2926,177 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2927
2926
|
itemClass: {}
|
|
2928
2927
|
},
|
|
2929
2928
|
emits: ["change", "clear", "clearAll"],
|
|
2930
|
-
setup(
|
|
2931
|
-
const
|
|
2932
|
-
activeFilter:
|
|
2933
|
-
activeFilterCount:
|
|
2934
|
-
onFilterChange:
|
|
2935
|
-
clearFilter:
|
|
2936
|
-
clearAllFilters:
|
|
2937
|
-
filtersSlot:
|
|
2929
|
+
setup(t, { emit: o }) {
|
|
2930
|
+
const p = ae(), l = t, i = o, a = A({}), v = fe(), {
|
|
2931
|
+
activeFilter: d,
|
|
2932
|
+
activeFilterCount: f,
|
|
2933
|
+
onFilterChange: h,
|
|
2934
|
+
clearFilter: c,
|
|
2935
|
+
clearAllFilters: m,
|
|
2936
|
+
filtersSlot: y
|
|
2938
2937
|
} = ye(
|
|
2939
2938
|
{
|
|
2940
|
-
...
|
|
2941
|
-
schema:
|
|
2942
|
-
slots:
|
|
2939
|
+
...l,
|
|
2940
|
+
schema: a.value,
|
|
2941
|
+
slots: v
|
|
2943
2942
|
},
|
|
2944
|
-
|
|
2945
|
-
), k = A(null),
|
|
2943
|
+
i
|
|
2944
|
+
), k = A(null), V = A(null), C = qe({ open: !1, top: 0, left: 0 }), n = E(() => C.open), u = E(() => !!l.disabled), x = E(() => a.value || {}), g = E(() => l.title ?? "Фільтр"), b = E(() => !!v.trigger), M = E(() => [
|
|
2946
2945
|
"inline-flex h-9 items-center justify-center gap-2 rounded-lg border border-transparent bg-slate-200/70 px-3 text-sm font-medium text-slate-700 transition-colors hover:bg-blue-100 hover:text-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-200 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-slate-200/70 disabled:hover:text-slate-700",
|
|
2947
|
-
|
|
2948
|
-
]),
|
|
2946
|
+
u.value ? "cursor-not-allowed opacity-60" : "cursor-pointer"
|
|
2947
|
+
]), U = E(() => C.open ? {
|
|
2949
2948
|
position: "absolute",
|
|
2950
2949
|
top: `${C.top}px`,
|
|
2951
2950
|
left: `${C.left}px`,
|
|
2952
2951
|
transform: "translateX(-50%)",
|
|
2953
2952
|
zIndex: 1e3
|
|
2954
2953
|
} : { display: "none" });
|
|
2955
|
-
function
|
|
2954
|
+
function j() {
|
|
2956
2955
|
C.open = !1;
|
|
2957
2956
|
}
|
|
2958
2957
|
function S() {
|
|
2959
2958
|
if (!k.value) return;
|
|
2960
|
-
const
|
|
2961
|
-
C.top =
|
|
2959
|
+
const Q = k.value.getBoundingClientRect();
|
|
2960
|
+
C.top = Q.bottom + window.scrollY + 8, C.left = Q.left + Q.width / 2 + window.scrollX;
|
|
2962
2961
|
}
|
|
2963
|
-
function
|
|
2964
|
-
C.open = !C.open, C.open &&
|
|
2965
|
-
}
|
|
2966
|
-
function D() {
|
|
2967
|
-
c.value || F();
|
|
2962
|
+
function K() {
|
|
2963
|
+
C.open = !C.open, C.open && pe(S);
|
|
2968
2964
|
}
|
|
2969
2965
|
function R() {
|
|
2966
|
+
u.value || K();
|
|
2967
|
+
}
|
|
2968
|
+
function F() {
|
|
2970
2969
|
C.open && S();
|
|
2971
2970
|
}
|
|
2972
|
-
function
|
|
2973
|
-
|
|
2971
|
+
function z() {
|
|
2972
|
+
m();
|
|
2974
2973
|
}
|
|
2975
|
-
return
|
|
2976
|
-
window.addEventListener("resize",
|
|
2977
|
-
}),
|
|
2978
|
-
window.removeEventListener("resize",
|
|
2979
|
-
}),
|
|
2980
|
-
() =>
|
|
2981
|
-
(
|
|
2982
|
-
if (!
|
|
2983
|
-
|
|
2974
|
+
return de(() => {
|
|
2975
|
+
window.addEventListener("resize", F), window.addEventListener("scroll", F, !0);
|
|
2976
|
+
}), me(() => {
|
|
2977
|
+
window.removeEventListener("resize", F), window.removeEventListener("scroll", F, !0);
|
|
2978
|
+
}), I(
|
|
2979
|
+
() => l.schema,
|
|
2980
|
+
(Q) => {
|
|
2981
|
+
if (!Q) {
|
|
2982
|
+
a.value = {};
|
|
2984
2983
|
return;
|
|
2985
2984
|
}
|
|
2986
|
-
if (Array.isArray(
|
|
2987
|
-
const
|
|
2988
|
-
const
|
|
2989
|
-
return [
|
|
2985
|
+
if (Array.isArray(Q)) {
|
|
2986
|
+
const D = Q.filter((L) => L && (L.name || L.id)).map((L) => {
|
|
2987
|
+
const N = L.name || L.id;
|
|
2988
|
+
return [N, { ...L, name: N }];
|
|
2990
2989
|
});
|
|
2991
|
-
|
|
2990
|
+
a.value = Object.fromEntries(D);
|
|
2992
2991
|
return;
|
|
2993
2992
|
}
|
|
2994
|
-
|
|
2993
|
+
a.value = Q;
|
|
2995
2994
|
},
|
|
2996
2995
|
{ deep: !0, immediate: !0 }
|
|
2997
|
-
),
|
|
2998
|
-
() =>
|
|
2999
|
-
(
|
|
3000
|
-
|
|
2996
|
+
), I(
|
|
2997
|
+
() => l.disabled,
|
|
2998
|
+
(Q) => {
|
|
2999
|
+
Q && j();
|
|
3001
3000
|
}
|
|
3002
|
-
), (
|
|
3001
|
+
), (Q, D) => (s(), w("div", {
|
|
3003
3002
|
class: "relative inline-flex",
|
|
3004
3003
|
ref_key: "anchor",
|
|
3005
3004
|
ref: k
|
|
3006
3005
|
}, [
|
|
3007
|
-
b.value ? (
|
|
3006
|
+
b.value ? (s(), w("span", {
|
|
3008
3007
|
key: 0,
|
|
3009
|
-
class:
|
|
3008
|
+
class: _(["inline-flex", u.value ? "cursor-not-allowed opacity-60 pointer-events-none" : "cursor-pointer"]),
|
|
3010
3009
|
role: "button",
|
|
3011
3010
|
tabindex: "0",
|
|
3012
3011
|
"data-popover-trigger": "",
|
|
3013
|
-
onClick: se(
|
|
3012
|
+
onClick: se(R, ["prevent", "stop"]),
|
|
3014
3013
|
onKeydown: [
|
|
3015
|
-
|
|
3016
|
-
|
|
3014
|
+
Ae(se(R, ["prevent", "stop"]), ["enter"]),
|
|
3015
|
+
Ae(se(R, ["prevent", "stop"]), ["space"])
|
|
3017
3016
|
]
|
|
3018
3017
|
}, [
|
|
3019
|
-
ue(
|
|
3020
|
-
toggle:
|
|
3021
|
-
open:
|
|
3022
|
-
disabled:
|
|
3023
|
-
activeCount: e(
|
|
3018
|
+
ue(Q.$slots, "trigger", {
|
|
3019
|
+
toggle: R,
|
|
3020
|
+
open: n.value,
|
|
3021
|
+
disabled: u.value,
|
|
3022
|
+
activeCount: e(f)
|
|
3024
3023
|
})
|
|
3025
|
-
], 42,
|
|
3024
|
+
], 42, Ka)) : (s(), w("button", {
|
|
3026
3025
|
key: 1,
|
|
3027
|
-
class:
|
|
3026
|
+
class: _(M.value),
|
|
3028
3027
|
type: "button",
|
|
3029
|
-
disabled:
|
|
3030
|
-
onClick: se(
|
|
3028
|
+
disabled: u.value,
|
|
3029
|
+
onClick: se(R, ["prevent", "stop"]),
|
|
3031
3030
|
"data-popover-trigger": ""
|
|
3032
3031
|
}, [
|
|
3033
|
-
|
|
3034
|
-
e(
|
|
3035
|
-
], 10,
|
|
3036
|
-
(
|
|
3037
|
-
|
|
3032
|
+
q(Ue, { class: "h-4 w-4" }),
|
|
3033
|
+
e(f) > 0 ? (s(), w("div", La, B(e(f)), 1)) : $("", !0)
|
|
3034
|
+
], 10, Ma)),
|
|
3035
|
+
(s(), O(ge, { to: "body" }, [
|
|
3036
|
+
n.value ? (s(), w("div", {
|
|
3038
3037
|
key: 0,
|
|
3039
|
-
class:
|
|
3040
|
-
style: be(
|
|
3038
|
+
class: _(["absolute", typeof t.width == "number" ? `min-w-[${t.width + 32 + (Object.keys(x.value).length > 7 ? 20 : 0)}px]` : "min-w-[268px] "]),
|
|
3039
|
+
style: be(U.value),
|
|
3041
3040
|
ref_key: "panel",
|
|
3042
|
-
ref:
|
|
3043
|
-
onClick:
|
|
3041
|
+
ref: V,
|
|
3042
|
+
onClick: D[4] || (D[4] = se(() => {
|
|
3044
3043
|
}, ["stop"]))
|
|
3045
3044
|
}, [
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3045
|
+
r("div", _a, [
|
|
3046
|
+
r("div", Ea, [
|
|
3047
|
+
r("h3", Oa, B(g.value), 1),
|
|
3048
|
+
r("button", {
|
|
3050
3049
|
type: "button",
|
|
3051
3050
|
class: "inline-flex h-6 w-6 items-center justify-center rounded-full border-0 bg-slate-300/40 text-slate-600 transition-colors hover:bg-blue-200/60 hover:text-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-200",
|
|
3052
|
-
onClick:
|
|
3051
|
+
onClick: j
|
|
3053
3052
|
}, [
|
|
3054
|
-
|
|
3055
|
-
|
|
3053
|
+
r("span", Ta, [
|
|
3054
|
+
q(Ce, { class: "h-4 w-4" })
|
|
3056
3055
|
]),
|
|
3057
|
-
|
|
3056
|
+
D[5] || (D[5] = r("span", { class: "sr-only" }, "Закрити", -1))
|
|
3058
3057
|
])
|
|
3059
3058
|
]),
|
|
3060
|
-
|
|
3061
|
-
Object.keys(
|
|
3062
|
-
width:
|
|
3063
|
-
class: [
|
|
3064
|
-
"item-class": [
|
|
3059
|
+
r("div", Ia, [
|
|
3060
|
+
Object.keys(x.value).length ? (s(!0), w(T, { key: 0 }, X(Object.entries(x.value), ([L, N]) => (s(), O(le, Z({ key: L }, { ref_for: !0 }, { ...N, layout: "inline" }, {
|
|
3061
|
+
width: t.width ? t.width : N?.width,
|
|
3062
|
+
class: [t.itemClass, N?.class],
|
|
3063
|
+
"item-class": [t.itemClass, N?.itemClass].filter(Boolean).join(" ") || void 0,
|
|
3065
3064
|
cleanable: !0,
|
|
3066
|
-
modelValue: e(
|
|
3067
|
-
"onUpdate:modelValue": (
|
|
3068
|
-
onChange:
|
|
3069
|
-
onClear:
|
|
3070
|
-
e(
|
|
3065
|
+
modelValue: e(d)[L],
|
|
3066
|
+
"onUpdate:modelValue": (P) => e(d)[L] = P,
|
|
3067
|
+
onChange: D[0] || (D[0] = (P) => e(h)(P.name, P.value)),
|
|
3068
|
+
onClear: D[1] || (D[1] = (P) => {
|
|
3069
|
+
e(c)(P), e(h)(P, void 0);
|
|
3071
3070
|
})
|
|
3072
|
-
}), null, 16, ["width", "class", "item-class", "modelValue", "onUpdate:modelValue"]))), 128)) :
|
|
3073
|
-
(
|
|
3074
|
-
key: "slot-" +
|
|
3071
|
+
}), null, 16, ["width", "class", "item-class", "modelValue", "onUpdate:modelValue"]))), 128)) : $("", !0),
|
|
3072
|
+
(s(!0), w(T, null, X(e(y), (L, N) => (s(), O(le, Z({
|
|
3073
|
+
key: "slot-" + N,
|
|
3075
3074
|
ref_for: !0
|
|
3076
3075
|
}, { ...L.props, layout: "inline" }, {
|
|
3077
|
-
class: [
|
|
3078
|
-
"item-class": [
|
|
3076
|
+
class: [t.itemClass, L.props?.class],
|
|
3077
|
+
"item-class": [t.itemClass, L.props?.itemClass].filter(Boolean).join(" ") || void 0,
|
|
3079
3078
|
cleanable: !0,
|
|
3080
|
-
modelValue: e(
|
|
3081
|
-
"onUpdate:modelValue": (
|
|
3082
|
-
onChange:
|
|
3083
|
-
onClear:
|
|
3084
|
-
e(
|
|
3079
|
+
modelValue: e(d)[L.props.name],
|
|
3080
|
+
"onUpdate:modelValue": (P) => e(d)[L.props.name] = P,
|
|
3081
|
+
onChange: D[2] || (D[2] = (P) => e(h)(P.name, P.value)),
|
|
3082
|
+
onClear: D[3] || (D[3] = (P) => {
|
|
3083
|
+
e(c)(P), e(h)(P, void 0);
|
|
3085
3084
|
})
|
|
3086
3085
|
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"]))), 128))
|
|
3087
3086
|
]),
|
|
3088
|
-
e(
|
|
3089
|
-
|
|
3087
|
+
e(f) > 0 ? (s(), w("div", Ua, [
|
|
3088
|
+
r("button", {
|
|
3090
3089
|
type: "button",
|
|
3091
|
-
class:
|
|
3092
|
-
onClick:
|
|
3093
|
-
}, B(e(
|
|
3094
|
-
])) :
|
|
3090
|
+
class: _([t.itemClass, "text-sm font-semibold text-blue-600 transition-colors hover:text-blue-700 focus:outline-none"]),
|
|
3091
|
+
onClick: z
|
|
3092
|
+
}, B(e(p)("filter.clear")), 3)
|
|
3093
|
+
])) : $("", !0)
|
|
3095
3094
|
])
|
|
3096
|
-
], 6)) :
|
|
3095
|
+
], 6)) : $("", !0)
|
|
3097
3096
|
]))
|
|
3098
3097
|
], 512));
|
|
3099
3098
|
}
|
|
3100
|
-
}),
|
|
3099
|
+
}), Me = /* @__PURE__ */ W({
|
|
3101
3100
|
__name: "filter",
|
|
3102
3101
|
props: {
|
|
3103
3102
|
schema: {},
|
|
@@ -3113,133 +3112,133 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
3113
3112
|
itemClass: {}
|
|
3114
3113
|
},
|
|
3115
3114
|
emits: ["change", "clear", "clearAll"],
|
|
3116
|
-
setup(
|
|
3117
|
-
const
|
|
3118
|
-
function
|
|
3119
|
-
if (Array.isArray(
|
|
3120
|
-
return
|
|
3121
|
-
if (
|
|
3122
|
-
const
|
|
3123
|
-
for (const
|
|
3124
|
-
|
|
3125
|
-
return
|
|
3115
|
+
setup(t, { expose: o, emit: p }) {
|
|
3116
|
+
const l = t, i = A(l.value ?? {}), a = p, v = A(), d = fe();
|
|
3117
|
+
function f(n) {
|
|
3118
|
+
if (Array.isArray(n))
|
|
3119
|
+
return n.map((u) => f(u));
|
|
3120
|
+
if (n !== null && typeof n == "object") {
|
|
3121
|
+
const u = ce(n), x = {};
|
|
3122
|
+
for (const g in u)
|
|
3123
|
+
x[g] = f(u[g]);
|
|
3124
|
+
return x;
|
|
3126
3125
|
}
|
|
3127
|
-
return
|
|
3126
|
+
return n;
|
|
3128
3127
|
}
|
|
3129
|
-
function
|
|
3130
|
-
|
|
3131
|
-
...
|
|
3132
|
-
[
|
|
3133
|
-
} : delete
|
|
3134
|
-
data:
|
|
3135
|
-
name:
|
|
3136
|
-
value:
|
|
3128
|
+
function h(n, u) {
|
|
3129
|
+
u !== void 0 ? i.value = {
|
|
3130
|
+
...i.value,
|
|
3131
|
+
[n]: u
|
|
3132
|
+
} : delete i.value[n], a("change", {
|
|
3133
|
+
data: f(i.value),
|
|
3134
|
+
name: n,
|
|
3135
|
+
value: f(u)
|
|
3137
3136
|
});
|
|
3138
3137
|
}
|
|
3139
|
-
function
|
|
3140
|
-
delete
|
|
3141
|
-
data:
|
|
3142
|
-
name:
|
|
3143
|
-
}),
|
|
3144
|
-
data:
|
|
3145
|
-
name:
|
|
3138
|
+
function c(n) {
|
|
3139
|
+
delete i.value[n], a("clear", {
|
|
3140
|
+
data: f(i.value),
|
|
3141
|
+
name: n
|
|
3142
|
+
}), a("change", {
|
|
3143
|
+
data: f(i.value),
|
|
3144
|
+
name: n,
|
|
3146
3145
|
value: null
|
|
3147
3146
|
});
|
|
3148
3147
|
}
|
|
3149
|
-
function
|
|
3150
|
-
|
|
3151
|
-
data:
|
|
3148
|
+
function m() {
|
|
3149
|
+
i.value = {}, a("clear", {
|
|
3150
|
+
data: f(i.value),
|
|
3152
3151
|
name: "ALL"
|
|
3153
|
-
}),
|
|
3154
|
-
data:
|
|
3152
|
+
}), a("change", {
|
|
3153
|
+
data: f(i.value),
|
|
3155
3154
|
name: "ALL",
|
|
3156
3155
|
value: null
|
|
3157
3156
|
});
|
|
3158
3157
|
}
|
|
3159
|
-
const
|
|
3158
|
+
const y = A({});
|
|
3160
3159
|
function k() {
|
|
3161
|
-
switch (
|
|
3160
|
+
switch (l.view) {
|
|
3162
3161
|
case "inline":
|
|
3163
|
-
return
|
|
3162
|
+
return Ke;
|
|
3164
3163
|
case "vertical":
|
|
3165
|
-
return
|
|
3164
|
+
return Fa;
|
|
3166
3165
|
case "popover":
|
|
3167
3166
|
return ze;
|
|
3168
3167
|
case "popover-inline":
|
|
3169
|
-
return
|
|
3168
|
+
return za;
|
|
3170
3169
|
default:
|
|
3171
|
-
return
|
|
3170
|
+
return Ke;
|
|
3172
3171
|
}
|
|
3173
3172
|
}
|
|
3174
|
-
|
|
3175
|
-
() =>
|
|
3176
|
-
(
|
|
3177
|
-
if (!
|
|
3178
|
-
|
|
3173
|
+
I(
|
|
3174
|
+
() => l.schema,
|
|
3175
|
+
(n) => {
|
|
3176
|
+
if (!n) {
|
|
3177
|
+
y.value = {};
|
|
3179
3178
|
return;
|
|
3180
3179
|
}
|
|
3181
|
-
if (Array.isArray(
|
|
3182
|
-
|
|
3180
|
+
if (Array.isArray(n) && !n.length) {
|
|
3181
|
+
y.value = {};
|
|
3183
3182
|
return;
|
|
3184
3183
|
}
|
|
3185
|
-
Array.isArray(
|
|
3186
|
-
name:
|
|
3187
|
-
type: { datepicker: "date" }[
|
|
3188
|
-
label:
|
|
3189
|
-
}),
|
|
3190
|
-
Object.assign(
|
|
3191
|
-
}),
|
|
3184
|
+
Array.isArray(n) ? y.value = n.filter((u) => u.type).reduce((u, x) => (Object.assign(x, {
|
|
3185
|
+
name: x.id || x.name,
|
|
3186
|
+
type: { datepicker: "date" }[x.type.toLowerCase()] || x.type.toLowerCase(),
|
|
3187
|
+
label: x.label || x.ua
|
|
3188
|
+
}), u[x.name] = x, x.data && !x.api && !x.options && Object.assign(x, { api: `/api/suggest/${x.data}` }), u), {}) : (Object.entries(n).forEach(([u, x]) => {
|
|
3189
|
+
Object.assign(x, { name: u || x.name || x.id, type: x.type.toLowerCase() });
|
|
3190
|
+
}), y.value = { ...n });
|
|
3192
3191
|
},
|
|
3193
3192
|
{ immediate: !0, deep: !0 }
|
|
3194
3193
|
);
|
|
3195
|
-
function
|
|
3196
|
-
|
|
3194
|
+
function V(n) {
|
|
3195
|
+
v.value.clearFilter(n), c(n);
|
|
3197
3196
|
}
|
|
3198
3197
|
function C() {
|
|
3199
|
-
|
|
3198
|
+
v.value.clearAllFilters(), m();
|
|
3200
3199
|
}
|
|
3201
|
-
return
|
|
3202
|
-
() =>
|
|
3203
|
-
(
|
|
3204
|
-
if (
|
|
3205
|
-
const
|
|
3206
|
-
Object.keys(
|
|
3200
|
+
return I(
|
|
3201
|
+
() => i.value,
|
|
3202
|
+
(n) => {
|
|
3203
|
+
if (l.history) {
|
|
3204
|
+
const u = new URL(window.location.href), x = new URLSearchParams(window.location.search);
|
|
3205
|
+
Object.keys(n).length > 0 ? x.set(
|
|
3207
3206
|
"filter",
|
|
3208
|
-
Object.entries(
|
|
3209
|
-
) :
|
|
3207
|
+
Object.entries(n).filter(([, g]) => g).map(([g, b]) => `${g}=${b}`).join("|")
|
|
3208
|
+
) : x.delete("filter"), u.search = decodeURI(x.toString()), window.history.pushState({}, "", u);
|
|
3210
3209
|
}
|
|
3211
3210
|
}
|
|
3212
|
-
),
|
|
3211
|
+
), o({
|
|
3213
3212
|
clearAllFilters: C,
|
|
3214
|
-
clearFilter:
|
|
3215
|
-
}), (
|
|
3216
|
-
schema:
|
|
3217
|
-
onChange:
|
|
3218
|
-
onClear:
|
|
3219
|
-
onClearAll:
|
|
3213
|
+
clearFilter: V
|
|
3214
|
+
}), (n, u) => (s(), O(oe(k()), Z(l, {
|
|
3215
|
+
schema: y.value,
|
|
3216
|
+
onChange: u[0] || (u[0] = (x) => h(x.name, x.value)),
|
|
3217
|
+
onClear: u[1] || (u[1] = (x) => c(x.name)),
|
|
3218
|
+
onClearAll: m,
|
|
3220
3219
|
ref_key: "filterRef",
|
|
3221
|
-
ref:
|
|
3220
|
+
ref: v
|
|
3222
3221
|
}), Qe({
|
|
3223
|
-
default:
|
|
3224
|
-
ue(
|
|
3222
|
+
default: ne(() => [
|
|
3223
|
+
ue(n.$slots, "default")
|
|
3225
3224
|
]),
|
|
3226
3225
|
_: 2
|
|
3227
3226
|
}, [
|
|
3228
|
-
e(
|
|
3227
|
+
e(d).trigger ? {
|
|
3229
3228
|
name: "trigger",
|
|
3230
|
-
fn:
|
|
3231
|
-
ue(
|
|
3229
|
+
fn: ne((x) => [
|
|
3230
|
+
ue(n.$slots, "trigger", He(Ge(x)))
|
|
3232
3231
|
]),
|
|
3233
3232
|
key: "0"
|
|
3234
3233
|
} : void 0
|
|
3235
3234
|
]), 1040, ["schema"]));
|
|
3236
3235
|
}
|
|
3237
3236
|
});
|
|
3238
|
-
|
|
3239
|
-
|
|
3237
|
+
Me.install = function(o) {
|
|
3238
|
+
o.component("Filter", Me), o.component("FilterField", le);
|
|
3240
3239
|
};
|
|
3241
3240
|
export {
|
|
3242
|
-
|
|
3241
|
+
Me as Filter,
|
|
3243
3242
|
le as FilterField,
|
|
3244
|
-
|
|
3243
|
+
Me as default
|
|
3245
3244
|
};
|