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