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