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