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