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