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