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