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