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