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