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