@agrotools1/at-components 0.6.7 → 0.6.8
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/Dropdown/Dropdown.core.vue.js +2 -2
- package/dist/Dropdown/Dropdown.core.vue2.js +60 -54
- package/dist/Dropdown/Dropdown.core.vue3.js +2 -2
- package/dist/Input/Input.core.d.ts +10 -0
- package/dist/Input/Input.core.vue.js +48 -37
- package/dist/Input/Input.core.vue2.js +63 -56
- package/dist/Input/Input.core.vue3.js +2 -2
- package/dist/Input/index.d.ts +10 -0
- package/dist/Menu/Menu.d.ts +25 -7
- package/dist/Menu/Menu.vue.js +110 -101
- package/dist/Menu/Menu.vue2.js +37 -30
- package/dist/Search/Search.d.ts +1 -1
- package/dist/Search/Search.vue.js +5 -5
- package/dist/Search/Search.vue2.js +46 -44
- package/dist/Select/Select.core.d.ts +46 -2
- package/dist/Select/Select.core.vue.js +17 -11
- package/dist/Select/Select.core.vue2.js +49 -18
- package/dist/Select/Single/Select.single.d.ts +43 -1
- package/dist/Select/Single/Select.single.vue.js +33 -17
- package/dist/Select/Single/Select.single.vue2.js +86 -39
- package/dist/Select/index.d.ts +43 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/Menu/Menu.vue.js
CHANGED
|
@@ -1,149 +1,158 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { openBlock as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import f from "./Menu.vue2.js";
|
|
2
|
+
import { openBlock as o, createElementBlock as a, createElementVNode as n, Fragment as i, renderList as d, normalizeClass as k, withModifiers as r, createBlock as C, resolveDynamicComponent as y, createCommentVNode as u, toDisplayString as _, createStaticVNode as b, pushScopeId as m, popScopeId as I } from "vue";
|
|
3
|
+
import $ from "./assets/at.svg.js";
|
|
4
|
+
import q from "./assets/agrotools.svg.js";
|
|
5
5
|
import "./Menu.vue3.js";
|
|
6
|
-
import
|
|
7
|
-
const
|
|
6
|
+
import z from "../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
+
const E = (e) => (m("data-v-996c20ba"), e = e(), I(), e), B = { class: "aside-container" }, L = /* @__PURE__ */ b('<div class="item" data-v-996c20ba><div class="uniq logo" style="height:48px;" data-v-996c20ba><span class="at-icon-logo" data-v-996c20ba><img alt="at logo" src="' + $ + '" data-v-996c20ba></span><span class="at-logo" data-v-996c20ba><img alt="agrotools" src="' + q + '" data-v-996c20ba></span></div><div class="divider" data-v-996c20ba></div></div>', 1), N = { class: "item menu-scroll-container" }, V = { class: "uniq menu-scroll" }, w = {
|
|
8
8
|
class: "actions",
|
|
9
9
|
"aria-label": "Site menu"
|
|
10
|
-
},
|
|
10
|
+
}, A = { class: "menu" }, D = ["data-active", "disabled", "onClick"], F = ["onClick"], j = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "menu-icon"
|
|
13
|
-
},
|
|
13
|
+
}, G = { class: "menu-title" }, H = { key: 0 }, J = ["data-active"], K = ["onClick"], O = { class: "submenu-title" }, P = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "submenu"
|
|
16
|
-
},
|
|
16
|
+
}, Q = ["data-active"], R = ["onClick"], T = /* @__PURE__ */ E(() => /* @__PURE__ */ n("div", { class: "divider" }, null, -1)), U = { class: "uniq" }, W = { class: "menu" }, X = ["data-active", "onClick"], Y = ["onClick"], Z = {
|
|
17
17
|
key: 0,
|
|
18
18
|
class: "menu-icon"
|
|
19
|
-
},
|
|
19
|
+
}, S = { class: "menu-title" }, x = { key: 0 }, ss = ["onClick"], es = { class: "submenu-title" }, ns = { class: "item" }, os = { class: "uniq" }, as = { class: "actions" }, ts = {
|
|
20
20
|
class: "actions",
|
|
21
21
|
"aria-label": "Site menu"
|
|
22
|
-
},
|
|
22
|
+
}, cs = { class: "menu" }, ls = ["data-active", "onClick"], is = ["onClick"], ds = {
|
|
23
23
|
key: 0,
|
|
24
24
|
class: "menu-icon"
|
|
25
|
-
},
|
|
26
|
-
function
|
|
27
|
-
return
|
|
25
|
+
}, rs = { class: "menu-title" }, us = { key: 0 }, _s = ["onClick"], vs = { class: "submenu-title" };
|
|
26
|
+
function hs(e, p, ks, ps, Cs, ys) {
|
|
27
|
+
return o(), a("div", {
|
|
28
28
|
class: "at-menu collapsed",
|
|
29
|
-
onMouseenter:
|
|
30
|
-
onMouseleave:
|
|
29
|
+
onMouseenter: p[0] || (p[0] = (...s) => e.onMouseEnter && e.onMouseEnter(...s)),
|
|
30
|
+
onMouseleave: p[1] || (p[1] = (...s) => e.onMouseLeave && e.onMouseLeave(...s))
|
|
31
31
|
}, [
|
|
32
|
-
n("div",
|
|
33
|
-
|
|
34
|
-
n("div",
|
|
35
|
-
n("div",
|
|
36
|
-
n("nav",
|
|
37
|
-
n("ul",
|
|
38
|
-
(
|
|
39
|
-
key:
|
|
32
|
+
n("div", B, [
|
|
33
|
+
L,
|
|
34
|
+
n("div", N, [
|
|
35
|
+
n("div", V, [
|
|
36
|
+
n("nav", w, [
|
|
37
|
+
n("ul", A, [
|
|
38
|
+
(o(!0), a(i, null, d(e.menu, (s, h) => (o(), a("li", {
|
|
39
|
+
key: h,
|
|
40
40
|
"data-active": e.isItemActive(s),
|
|
41
|
-
class:
|
|
41
|
+
class: k(["main-submenu", [{ "sub-menu": s.subItems }]]),
|
|
42
42
|
disabled: s.disabled,
|
|
43
43
|
onClick: s == null ? void 0 : s.onClick
|
|
44
44
|
}, [
|
|
45
45
|
n("a", {
|
|
46
|
-
onClick:
|
|
46
|
+
onClick: r((t) => e.handleMenuItemClick(t, s), ["prevent"])
|
|
47
47
|
}, [
|
|
48
|
-
s.icon ? (
|
|
49
|
-
(
|
|
48
|
+
s.icon ? (o(), a("span", j, [
|
|
49
|
+
(o(), C(y(e.getIcon(s)), { size: "16" }))
|
|
50
50
|
])) : u("", !0),
|
|
51
|
-
n("span",
|
|
52
|
-
], 8,
|
|
53
|
-
s.subItems ? (
|
|
54
|
-
(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
onClick: d((c) => e.handleMenuItemClick(c, a), ["prevent"])
|
|
51
|
+
n("span", G, _(s.text), 1)
|
|
52
|
+
], 8, F),
|
|
53
|
+
s.subItems ? (o(), a("ul", H, [
|
|
54
|
+
(o(!0), a(i, null, d(s.subItems || [], (t, l) => {
|
|
55
|
+
var v;
|
|
56
|
+
return o(), a("li", {
|
|
57
|
+
key: `sub-${l}`,
|
|
58
|
+
"data-active": ((v = e.state) == null ? void 0 : v.activeItem) === (t == null ? void 0 : t.id),
|
|
59
|
+
class: k([{ "sub-menu": t.subItems }])
|
|
61
60
|
}, [
|
|
62
|
-
n("
|
|
63
|
-
|
|
64
|
-
a.subItems ? (t(), o("ul", J, [
|
|
65
|
-
(t(!0), o(l, null, i(a.subItems, (c) => (t(), o("li", {
|
|
66
|
-
key: c.id,
|
|
67
|
-
"data-active": e.state.activeItem === c.id,
|
|
68
|
-
class: "sub-sub-menu"
|
|
61
|
+
n("a", {
|
|
62
|
+
onClick: r((c) => e.handleMenuItemClick(c, t), ["prevent"])
|
|
69
63
|
}, [
|
|
70
|
-
n("
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
64
|
+
n("span", O, _(t.text), 1)
|
|
65
|
+
], 8, K),
|
|
66
|
+
t.subItems ? (o(), a("ul", P, [
|
|
67
|
+
(o(!0), a(i, null, d(t.subItems, (c) => {
|
|
68
|
+
var M;
|
|
69
|
+
return o(), a("li", {
|
|
70
|
+
key: c == null ? void 0 : c.id,
|
|
71
|
+
"data-active": ((M = e.state) == null ? void 0 : M.activeItem) === (c == null ? void 0 : c.id),
|
|
72
|
+
class: "sub-sub-menu"
|
|
73
|
+
}, [
|
|
74
|
+
n("a", {
|
|
75
|
+
onClick: r((g) => e.handleMenuItemClick(g, c), ["prevent"])
|
|
76
|
+
}, " - " + _(c.text), 9, R)
|
|
77
|
+
], 8, Q);
|
|
78
|
+
}), 128))
|
|
79
|
+
])) : u("", !0)
|
|
80
|
+
], 10, J);
|
|
81
|
+
}), 128))
|
|
76
82
|
])) : u("", !0)
|
|
77
|
-
], 10,
|
|
83
|
+
], 10, D))), 128))
|
|
78
84
|
])
|
|
79
85
|
])
|
|
80
86
|
]),
|
|
81
|
-
|
|
82
|
-
n("div",
|
|
83
|
-
n("ul",
|
|
84
|
-
(
|
|
85
|
-
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
onClick: d((a) => e.handleMenuItemClick(a, s), ["prevent"])
|
|
87
|
+
T,
|
|
88
|
+
n("div", U, [
|
|
89
|
+
n("ul", W, [
|
|
90
|
+
(o(!0), a(i, null, d(e.configuration, (s, h) => {
|
|
91
|
+
var t;
|
|
92
|
+
return o(), a("li", {
|
|
93
|
+
key: h,
|
|
94
|
+
"data-active": ((t = e.state) == null ? void 0 : t.activeItem) === (s == null ? void 0 : s.id),
|
|
95
|
+
class: k({ "sub-menu": s.subItems }),
|
|
96
|
+
onClick: s == null ? void 0 : s.onClick
|
|
92
97
|
}, [
|
|
93
|
-
|
|
94
|
-
(
|
|
95
|
-
])) : u("", !0),
|
|
96
|
-
n("span", X, r(s.text), 1)
|
|
97
|
-
], 8, U),
|
|
98
|
-
s.subItems ? (t(), o("ul", Y, [
|
|
99
|
-
(t(!0), o(l, null, i(s.subItems, (a, v) => (t(), o("li", {
|
|
100
|
-
key: `sub-${v}`,
|
|
101
|
-
class: "sub-menu"
|
|
98
|
+
n("a", {
|
|
99
|
+
onClick: r((l) => e.handleMenuItemClick(l, s), ["prevent"])
|
|
102
100
|
}, [
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
s.icon ? (o(), a("span", Z, [
|
|
102
|
+
(o(), C(y(e.getIcon(s)), { size: "16" }))
|
|
103
|
+
])) : u("", !0),
|
|
104
|
+
n("span", S, _(s.text), 1)
|
|
105
|
+
], 8, Y),
|
|
106
|
+
s.subItems ? (o(), a("ul", x, [
|
|
107
|
+
(o(!0), a(i, null, d(s.subItems, (l, v) => (o(), a("li", {
|
|
108
|
+
key: `sub-${v}`,
|
|
109
|
+
class: "sub-menu"
|
|
105
110
|
}, [
|
|
106
|
-
n("
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
n("a", {
|
|
112
|
+
onClick: r((c) => e.handleMenuItemClick(c, s), ["prevent"])
|
|
113
|
+
}, [
|
|
114
|
+
n("span", es, _(l.text), 1)
|
|
115
|
+
], 8, ss)
|
|
116
|
+
]))), 128))
|
|
117
|
+
])) : u("", !0)
|
|
118
|
+
], 10, X);
|
|
119
|
+
}), 128))
|
|
111
120
|
])
|
|
112
121
|
])
|
|
113
122
|
]),
|
|
114
|
-
n("div",
|
|
115
|
-
n("div",
|
|
116
|
-
n("div",
|
|
123
|
+
n("div", ns, [
|
|
124
|
+
n("div", os, [
|
|
125
|
+
n("div", as, [
|
|
117
126
|
n("nav", ts, [
|
|
118
|
-
n("ul",
|
|
119
|
-
(
|
|
120
|
-
key:
|
|
127
|
+
n("ul", cs, [
|
|
128
|
+
(o(!0), a(i, null, d(e.footer, (s, h) => (o(), a("li", {
|
|
129
|
+
key: h,
|
|
121
130
|
"data-active": e.isItemActive(s),
|
|
122
|
-
class:
|
|
131
|
+
class: k([{ "sub-menu": s.subItems }]),
|
|
123
132
|
onClick: s == null ? void 0 : s.onClick
|
|
124
133
|
}, [
|
|
125
134
|
n("a", {
|
|
126
|
-
class:
|
|
127
|
-
onClick:
|
|
135
|
+
class: k(s == null ? void 0 : s.class),
|
|
136
|
+
onClick: r((t) => e.handleMenuItemClick(t, s), ["prevent"])
|
|
128
137
|
}, [
|
|
129
|
-
s.icon ? (
|
|
130
|
-
(
|
|
138
|
+
s.icon ? (o(), a("span", ds, [
|
|
139
|
+
(o(), C(y(e.getIcon(s)), { size: "16" }))
|
|
131
140
|
])) : u("", !0),
|
|
132
|
-
n("span",
|
|
133
|
-
], 10,
|
|
134
|
-
s.subItems ? (
|
|
135
|
-
(
|
|
136
|
-
key: `sub-${
|
|
141
|
+
n("span", rs, _(s.text), 1)
|
|
142
|
+
], 10, is),
|
|
143
|
+
s.subItems ? (o(), a("ul", us, [
|
|
144
|
+
(o(!0), a(i, null, d(s.subItems, (t, l) => (o(), a("li", {
|
|
145
|
+
key: `sub-${l}`,
|
|
137
146
|
class: "sub-menu"
|
|
138
147
|
}, [
|
|
139
148
|
n("a", {
|
|
140
|
-
onClick:
|
|
149
|
+
onClick: r((v) => e.handleMenuItemClick(v, s), ["prevent"])
|
|
141
150
|
}, [
|
|
142
|
-
n("span",
|
|
143
|
-
], 8,
|
|
151
|
+
n("span", vs, _(t.text), 1)
|
|
152
|
+
], 8, _s)
|
|
144
153
|
]))), 128))
|
|
145
154
|
])) : u("", !0)
|
|
146
|
-
], 10,
|
|
155
|
+
], 10, ls))), 128))
|
|
147
156
|
])
|
|
148
157
|
])
|
|
149
158
|
])
|
|
@@ -152,7 +161,7 @@ function _s(e, k, vs, hs, ks, ps) {
|
|
|
152
161
|
])
|
|
153
162
|
], 32);
|
|
154
163
|
}
|
|
155
|
-
const
|
|
164
|
+
const $s = /* @__PURE__ */ z(f, [["render", hs], ["__scopeId", "data-v-996c20ba"]]);
|
|
156
165
|
export {
|
|
157
|
-
|
|
166
|
+
$s as default
|
|
158
167
|
};
|
package/dist/Menu/Menu.vue2.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import
|
|
4
|
-
const k =
|
|
1
|
+
import * as A from "../node_modules/.pnpm/@agrotools1_at-icons@0.2.11/node_modules/@agrotools1/at-icons/dist/index.js";
|
|
2
|
+
import { defineComponent as y, reactive as M, ref as d, watch as L } from "vue";
|
|
3
|
+
import b from "../Search/Search.vue.js";
|
|
4
|
+
const k = y({
|
|
5
5
|
name: "AtMenu",
|
|
6
6
|
components: {
|
|
7
|
-
...
|
|
8
|
-
AtSearch:
|
|
7
|
+
...A,
|
|
8
|
+
AtSearch: b
|
|
9
9
|
},
|
|
10
10
|
props: {
|
|
11
|
-
|
|
12
|
-
type:
|
|
13
|
-
default: () =>
|
|
14
|
-
|
|
11
|
+
menu: {
|
|
12
|
+
type: Array,
|
|
13
|
+
default: () => []
|
|
14
|
+
},
|
|
15
|
+
configuration: {
|
|
16
|
+
type: Array,
|
|
17
|
+
default: () => []
|
|
18
|
+
},
|
|
19
|
+
footer: {
|
|
20
|
+
type: Array,
|
|
21
|
+
default: () => []
|
|
15
22
|
},
|
|
16
23
|
activeItemId: {
|
|
17
24
|
type: String,
|
|
@@ -19,56 +26,56 @@ const k = A({
|
|
|
19
26
|
}
|
|
20
27
|
},
|
|
21
28
|
emits: ["click"],
|
|
22
|
-
setup(l, { emit:
|
|
23
|
-
const
|
|
29
|
+
setup(l, { emit: f }) {
|
|
30
|
+
const s = M({
|
|
24
31
|
activeItem: l.activeItemId
|
|
25
|
-
}),
|
|
32
|
+
}), i = d(null), u = d(null), p = (e) => r(e) && e.iconActive ? e.iconActive : e.icon, m = (e) => {
|
|
26
33
|
const t = e.currentTarget;
|
|
27
|
-
|
|
34
|
+
i.value = t, t.classList.remove("collapsed"), u.value = t.querySelector(".menu-scroll");
|
|
28
35
|
}, v = () => {
|
|
29
36
|
var e, t;
|
|
30
|
-
(e =
|
|
37
|
+
(e = i.value) == null || e.classList.add("collapsed"), (t = u.value) == null || t.scrollTo(0, 0);
|
|
31
38
|
}, a = (e, t) => {
|
|
32
39
|
const n = t ? Array.from(e.children).reduce(
|
|
33
|
-
(
|
|
40
|
+
(c, o) => c + o.scrollHeight,
|
|
34
41
|
0
|
|
35
42
|
) : e.children[0].scrollHeight;
|
|
36
43
|
e.style.height = `${n}px`;
|
|
37
44
|
}, g = (e, t) => {
|
|
38
|
-
const n = e.currentTarget.parentNode,
|
|
39
|
-
if (n.classList.toggle("open",
|
|
40
|
-
a(n,
|
|
45
|
+
const n = e.currentTarget.parentNode, c = !n.classList.contains("open");
|
|
46
|
+
if (n.classList.toggle("open", c), t)
|
|
47
|
+
a(n, c);
|
|
41
48
|
else {
|
|
42
|
-
const
|
|
43
|
-
a(
|
|
49
|
+
const o = n.closest(".main-submenu");
|
|
50
|
+
a(o, !0);
|
|
44
51
|
}
|
|
45
52
|
}, I = (e, t) => {
|
|
46
|
-
var
|
|
53
|
+
var o;
|
|
47
54
|
if (t.disabled) {
|
|
48
55
|
e.preventDefault();
|
|
49
56
|
return;
|
|
50
57
|
}
|
|
51
|
-
const n = (
|
|
52
|
-
|
|
58
|
+
const n = (o = e.currentTarget) == null ? void 0 : o.parentNode, c = n.classList.contains("main-submenu");
|
|
59
|
+
c && !n.classList.contains("open") && h(), n.classList.contains("sub-menu") ? g(e, c) : (f("click", t), s.activeItem && (s.activeItem = (t == null ? void 0 : t.id) ?? "undefined"));
|
|
53
60
|
};
|
|
54
|
-
|
|
61
|
+
L(
|
|
55
62
|
() => l.activeItemId,
|
|
56
63
|
(e) => {
|
|
57
|
-
|
|
64
|
+
s.activeItem && (s.activeItem = e);
|
|
58
65
|
}
|
|
59
66
|
);
|
|
60
67
|
const h = () => {
|
|
61
68
|
document.querySelectorAll(".main-submenu.open").forEach((t) => {
|
|
62
69
|
t.classList.toggle("open", !1), a(t, !1);
|
|
63
70
|
});
|
|
64
|
-
},
|
|
71
|
+
}, r = (e) => (e == null ? void 0 : e.id) === (s == null ? void 0 : s.activeItem) ? !0 : e.subItems ? e.subItems.some((t) => r(t)) : !1;
|
|
65
72
|
return {
|
|
66
|
-
onMouseEnter:
|
|
73
|
+
onMouseEnter: m,
|
|
67
74
|
onMouseLeave: v,
|
|
68
75
|
getIcon: p,
|
|
69
76
|
handleMenuItemClick: I,
|
|
70
|
-
isItemActive:
|
|
71
|
-
state:
|
|
77
|
+
isItemActive: r,
|
|
78
|
+
state: s
|
|
72
79
|
};
|
|
73
80
|
}
|
|
74
81
|
});
|
package/dist/Search/Search.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
87
87
|
clear: () => void;
|
|
88
88
|
openList: () => void;
|
|
89
89
|
closeList: () => void;
|
|
90
|
-
handleChangeValue: (value: string) =>
|
|
90
|
+
handleChangeValue: (value: string) => void;
|
|
91
91
|
handleSelectedItem: (item: DropdownListItem) => void;
|
|
92
92
|
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("update:modelValue" | "onSelectedItem" | "onClear")[], "update:modelValue" | "onSelectedItem" | "onClear", import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, Readonly<import('vue').ExtractPropTypes<{
|
|
93
93
|
label: {
|
|
@@ -6,13 +6,13 @@ const c = {
|
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "spinner"
|
|
8
8
|
};
|
|
9
|
-
function
|
|
10
|
-
const
|
|
9
|
+
function f(e, h, b, g, I, C) {
|
|
10
|
+
const a = o("AtInput"), r = o("AtLista");
|
|
11
11
|
return s(), t("section", {
|
|
12
12
|
ref: "atSearch",
|
|
13
13
|
class: u(["atSearch", { disabled: e.isDisabled }])
|
|
14
14
|
}, [
|
|
15
|
-
n(
|
|
15
|
+
n(r, {
|
|
16
16
|
id: e.id,
|
|
17
17
|
"drop-down-list": e.autoCompleteListFiltered,
|
|
18
18
|
"is-open": e.autocompleteListIsOpen,
|
|
@@ -23,7 +23,7 @@ function h(e, f, b, g, I, C) {
|
|
|
23
23
|
onOnSave: e.handleSelectedItem
|
|
24
24
|
}, {
|
|
25
25
|
default: i(() => [
|
|
26
|
-
n(
|
|
26
|
+
n(a, d({
|
|
27
27
|
id: e.label,
|
|
28
28
|
label: e.label,
|
|
29
29
|
"model-value": e.modelValue,
|
|
@@ -46,7 +46,7 @@ function h(e, f, b, g, I, C) {
|
|
|
46
46
|
}, 8, ["id", "drop-down-list", "is-open", "show-no-result-message", "msg-no-result", "onOnSave"])
|
|
47
47
|
], 2);
|
|
48
48
|
}
|
|
49
|
-
const V = /* @__PURE__ */ m(l, [["render",
|
|
49
|
+
const V = /* @__PURE__ */ m(l, [["render", f], ["__scopeId", "data-v-0f71a2af"]]);
|
|
50
50
|
export {
|
|
51
51
|
V as default
|
|
52
52
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as B, ref as
|
|
2
|
-
import { AtCircleXMarkSolidIcon as
|
|
3
|
-
import { AtSearchIcon as
|
|
4
|
-
import { AtInput as
|
|
5
|
-
import
|
|
1
|
+
import { defineComponent as B, ref as n, computed as u } from "vue";
|
|
2
|
+
import { AtCircleXMarkSolidIcon as b } from "../node_modules/.pnpm/@agrotools1_at-icons@0.2.11/node_modules/@agrotools1/at-icons/dist/AtCircleXMarkSolidIcon/index.js";
|
|
3
|
+
import { AtSearchIcon as E } from "../node_modules/.pnpm/@agrotools1_at-icons@0.2.11/node_modules/@agrotools1/at-icons/dist/AtSearchIcon/index.js";
|
|
4
|
+
import { AtInput as O } from "../Input/index.js";
|
|
5
|
+
import x from "../List/components/List.vue.js";
|
|
6
6
|
const F = {
|
|
7
|
-
AtSearchIcon:
|
|
8
|
-
AtCircleXMarkSolidIcon:
|
|
9
|
-
},
|
|
7
|
+
AtSearchIcon: E,
|
|
8
|
+
AtCircleXMarkSolidIcon: b
|
|
9
|
+
}, R = B({
|
|
10
10
|
name: "AtSearch",
|
|
11
11
|
components: {
|
|
12
|
-
AtInput:
|
|
13
|
-
AtLista:
|
|
12
|
+
AtInput: O.Text,
|
|
13
|
+
AtLista: x,
|
|
14
14
|
...F
|
|
15
15
|
},
|
|
16
16
|
props: {
|
|
@@ -74,69 +74,71 @@ const F = {
|
|
|
74
74
|
},
|
|
75
75
|
emits: ["update:modelValue", "onSelectedItem", "onClear"],
|
|
76
76
|
setup(t, { emit: a }) {
|
|
77
|
-
const r =
|
|
77
|
+
const r = n([]), c = n(!1), s = n(null), i = n(null), S = u(
|
|
78
78
|
() => {
|
|
79
79
|
var e;
|
|
80
80
|
return c.value && t.hasAutoComplete && (!!t.modelValue || t.hasFilterOption) && !(!((e = p.value) != null && e.length) && I.value);
|
|
81
81
|
}
|
|
82
|
-
),
|
|
82
|
+
), h = (e = "false") => {
|
|
83
83
|
var l;
|
|
84
84
|
if (t.arrowIcon) {
|
|
85
|
-
const
|
|
86
|
-
if (!(
|
|
85
|
+
const f = (l = s.value) == null ? void 0 : l.querySelector(".AT_INPUT_icon_slot");
|
|
86
|
+
if (!(f instanceof HTMLElement))
|
|
87
87
|
return;
|
|
88
|
-
|
|
88
|
+
f.setAttribute("data-rotate", e);
|
|
89
89
|
}
|
|
90
|
-
},
|
|
90
|
+
}, y = u(
|
|
91
91
|
() => t.arrowIcon ? { name: "AtAngleDownSolidIcon" } : { name: "AtSearchIcon" }
|
|
92
|
-
),
|
|
92
|
+
), g = () => {
|
|
93
93
|
var e;
|
|
94
|
-
c.value = !0, (e =
|
|
95
|
-
},
|
|
94
|
+
c.value = !0, (e = s.value) == null || e.classList.add("focused"), h("true");
|
|
95
|
+
}, A = () => {
|
|
96
96
|
var e;
|
|
97
97
|
setTimeout(() => {
|
|
98
98
|
c.value = !1;
|
|
99
|
-
}, 200), (e =
|
|
100
|
-
}, o =
|
|
101
|
-
a("update:modelValue", e), t.searchEndpoint && (o.value = !0,
|
|
102
|
-
|
|
99
|
+
}, 200), (e = s.value) == null || e.classList.remove("focused"), h();
|
|
100
|
+
}, o = n(!1), L = (e) => {
|
|
101
|
+
a("update:modelValue", e), t.searchEndpoint && (o.value = !0, i.value && clearTimeout(i.value), i.value = setTimeout(async () => {
|
|
102
|
+
t.searchEndpoint && (r.value = await t.searchEndpoint(e)), o.value = !1;
|
|
103
|
+
}, 300));
|
|
104
|
+
}, p = u(() => {
|
|
103
105
|
var e;
|
|
104
106
|
if (t.hasFilterOption) {
|
|
105
|
-
const l = (
|
|
107
|
+
const l = (m, v) => m.text.toUpperCase().includes(v.toUpperCase());
|
|
106
108
|
return t.autoCompleteList.filter(
|
|
107
|
-
(
|
|
109
|
+
(m) => l(m, t.modelValue)
|
|
108
110
|
);
|
|
109
111
|
}
|
|
110
112
|
return (e = r.value) != null && e.length ? r.value : t.autoCompleteList;
|
|
111
|
-
}),
|
|
113
|
+
}), d = n(), C = (e) => {
|
|
112
114
|
const l = e.text;
|
|
113
|
-
|
|
114
|
-
},
|
|
115
|
-
a("onSelectedItem", null), a("onClear"), a("update:modelValue", ""), o.value = !1,
|
|
116
|
-
}, I =
|
|
117
|
-
() => t.withIcon && o.value && !
|
|
118
|
-
),
|
|
115
|
+
d.value = e, a("onSelectedItem", e), a("update:modelValue", l);
|
|
116
|
+
}, V = () => {
|
|
117
|
+
a("onSelectedItem", null), a("onClear"), a("update:modelValue", ""), o.value = !1, d.value = null;
|
|
118
|
+
}, I = u(
|
|
119
|
+
() => t.withIcon && o.value && !d.value || t.isLoading
|
|
120
|
+
), w = u(
|
|
119
121
|
() => t.isDisabled ? "var(--at-medium-grey)" : ""
|
|
120
|
-
),
|
|
122
|
+
), T = u(
|
|
121
123
|
() => !!t.modelValue && !o.value
|
|
122
124
|
);
|
|
123
125
|
return {
|
|
124
|
-
atSearch:
|
|
125
|
-
autocompleteListIsOpen:
|
|
126
|
+
atSearch: s,
|
|
127
|
+
autocompleteListIsOpen: S,
|
|
126
128
|
autoCompleteListFiltered: p,
|
|
127
129
|
isLoading: o,
|
|
128
130
|
showSearchIcon: I,
|
|
129
|
-
getShowNoResultMessage:
|
|
130
|
-
getSearchIconColor:
|
|
131
|
-
getInputIcon:
|
|
132
|
-
clear:
|
|
133
|
-
openList:
|
|
134
|
-
closeList:
|
|
135
|
-
handleChangeValue:
|
|
136
|
-
handleSelectedItem:
|
|
131
|
+
getShowNoResultMessage: T,
|
|
132
|
+
getSearchIconColor: w,
|
|
133
|
+
getInputIcon: y,
|
|
134
|
+
clear: V,
|
|
135
|
+
openList: g,
|
|
136
|
+
closeList: A,
|
|
137
|
+
handleChangeValue: L,
|
|
138
|
+
handleSelectedItem: C
|
|
137
139
|
};
|
|
138
140
|
}
|
|
139
141
|
});
|
|
140
142
|
export {
|
|
141
|
-
|
|
143
|
+
R as default
|
|
142
144
|
};
|