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