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