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