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