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