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