@agrotools1/at-components 0.6.69 → 0.6.72
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/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/Search/Search.d.ts +1 -1
- package/dist/Search/Search.vue.js +1 -1
- 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/agrotools-theme.css +2 -2
- package/dist/agrotools-theme.css.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -103,6 +103,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
103
103
|
type: BooleanConstructor;
|
|
104
104
|
default: boolean;
|
|
105
105
|
};
|
|
106
|
+
useSideClearButton: {
|
|
107
|
+
type: BooleanConstructor;
|
|
108
|
+
default: boolean;
|
|
109
|
+
};
|
|
106
110
|
forceEventClearButton: {
|
|
107
111
|
type: BooleanConstructor;
|
|
108
112
|
default: boolean;
|
|
@@ -6227,6 +6231,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
6227
6231
|
};
|
|
6228
6232
|
clickedClear: import('vue').Ref<boolean>;
|
|
6229
6233
|
showClearButton: import('vue').ComputedRef<boolean | "" | undefined>;
|
|
6234
|
+
showSideClearButton: import('vue').ComputedRef<boolean | "" | undefined>;
|
|
6230
6235
|
clearInput: () => void;
|
|
6231
6236
|
containerItemsEl: import('vue').Ref<HTMLDivElement | null>;
|
|
6232
6237
|
onInput: (event: InputEvent) => void;
|
|
@@ -6335,6 +6340,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
6335
6340
|
type: BooleanConstructor;
|
|
6336
6341
|
default: boolean;
|
|
6337
6342
|
};
|
|
6343
|
+
useSideClearButton: {
|
|
6344
|
+
type: BooleanConstructor;
|
|
6345
|
+
default: boolean;
|
|
6346
|
+
};
|
|
6338
6347
|
forceEventClearButton: {
|
|
6339
6348
|
type: BooleanConstructor;
|
|
6340
6349
|
default: boolean;
|
|
@@ -6368,6 +6377,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
6368
6377
|
cursor: string;
|
|
6369
6378
|
selectedItems: import('../Select/Item/Item').SelectItemProps[];
|
|
6370
6379
|
useClearButton: boolean;
|
|
6380
|
+
useSideClearButton: boolean;
|
|
6371
6381
|
forceEventClearButton: boolean;
|
|
6372
6382
|
}, {}>;
|
|
6373
6383
|
export default _default;
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as
|
|
1
|
+
import I from "./Input.core.vue2.js";
|
|
2
|
+
import { resolveComponent as k, openBlock as n, createElementBlock as l, createElementVNode as i, createTextVNode as a, toDisplayString as t, createCommentVNode as r, Fragment as C, renderList as v, mergeProps as T, normalizeClass as m, createBlock as d, resolveDynamicComponent as y } from "vue";
|
|
3
3
|
import "./Input.core.vue3.js";
|
|
4
|
-
import
|
|
5
|
-
const
|
|
4
|
+
import $ from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const f = ["data-mode", "disabled"], A = ["for"], N = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "AT-INPUT_required"
|
|
8
|
-
},
|
|
8
|
+
}, b = ["title"], F = { class: "AT-INPUT_item_slot" }, O = ["onClick"], P = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "AT-INPUT_items_length"
|
|
11
|
-
}, g = ["id", "disabled", "readonly", "type", "placeholder", "name", "value"],
|
|
11
|
+
}, g = ["id", "disabled", "readonly", "type", "placeholder", "name", "value"], h = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "AT-INPUT_error-message"
|
|
14
|
-
},
|
|
15
|
-
function
|
|
16
|
-
const
|
|
14
|
+
}, U = ["src"];
|
|
15
|
+
function B(e, s, M, S, z, E) {
|
|
16
|
+
const u = k("AtCircleXMarkSolidIcon");
|
|
17
17
|
return n(), l("div", null, [
|
|
18
|
-
|
|
18
|
+
i("div", {
|
|
19
19
|
ref: "wrapperEl",
|
|
20
20
|
"data-mode": e.currentMode,
|
|
21
21
|
disabled: e.$props.disabled || void 0,
|
|
22
22
|
class: "AT-INPUT_core",
|
|
23
|
-
onMouseover: s[
|
|
24
|
-
onMouseleave: s[
|
|
23
|
+
onMouseover: s[9] || (s[9] = (...o) => e.handleMouseOver && e.handleMouseOver(...o)),
|
|
24
|
+
onMouseleave: s[10] || (s[10] = (...o) => e.handleMouseLeave && e.handleMouseLeave(...o))
|
|
25
25
|
}, [
|
|
26
|
-
|
|
26
|
+
i("label", {
|
|
27
27
|
for: e.id,
|
|
28
28
|
onClick: s[0] || (s[0] = (...o) => e.handleOnFocus && e.handleOnFocus(...o))
|
|
29
29
|
}, [
|
|
30
|
-
|
|
31
|
-
e.$props.required ? (n(), l("span",
|
|
32
|
-
], 8,
|
|
30
|
+
a(t(e.label) + " ", 1),
|
|
31
|
+
e.$props.required ? (n(), l("span", N, "*")) : r("", !0)
|
|
32
|
+
], 8, A),
|
|
33
33
|
e.separator ? (n(), l("div", {
|
|
34
34
|
key: 0,
|
|
35
35
|
ref: "containerItemsEl",
|
|
36
36
|
class: "AT-INPUT_items",
|
|
37
37
|
onClick: s[1] || (s[1] = (...o) => e.handleOnFocus && e.handleOnFocus(...o))
|
|
38
38
|
}, [
|
|
39
|
-
(n(!0), l(
|
|
39
|
+
(n(!0), l(C, null, v(e.selectedItemsController.itemsToRender, (o) => (n(), l("span", {
|
|
40
40
|
key: o.value,
|
|
41
41
|
ref_for: !0,
|
|
42
42
|
ref: "selectedItemsEl",
|
|
43
43
|
title: o.text,
|
|
44
44
|
class: "AT-INPUT_item"
|
|
45
45
|
}, [
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
i("span", F, t(o.text), 1),
|
|
47
|
+
i("span", {
|
|
48
48
|
class: "AT-INPUT_item_slot_x",
|
|
49
49
|
style: { padding: "1px 5px" },
|
|
50
50
|
onClick: () => {
|
|
51
|
-
var
|
|
52
|
-
(
|
|
51
|
+
var p;
|
|
52
|
+
(p = e.onSelectedItemClick) == null || p.call(e, o == null ? void 0 : o.value);
|
|
53
53
|
}
|
|
54
54
|
}, "x", 8, O)
|
|
55
|
-
], 8,
|
|
56
|
-
e.selectedItems.length > e.selectedItemsController.supportedItems ? (n(), l("span",
|
|
57
|
-
], 512)) : (n(), l("input",
|
|
55
|
+
], 8, b))), 128)),
|
|
56
|
+
e.selectedItems.length > e.selectedItemsController.supportedItems ? (n(), l("span", P, "+ " + t(e.selectedItems.length - e.selectedItemsController.supportedItems), 1)) : r("", !0)
|
|
57
|
+
], 512)) : (n(), l("input", T({ key: 1 }, e.$attrs, {
|
|
58
58
|
id: e.id,
|
|
59
59
|
ref: "inputEl",
|
|
60
60
|
style: { cursor: e.cursor },
|
|
@@ -70,30 +70,41 @@ function U(e, s, B, E, z, S) {
|
|
|
70
70
|
}), null, 16, g)),
|
|
71
71
|
e.$props.icon ? (n(), l("div", {
|
|
72
72
|
key: 2,
|
|
73
|
-
class:
|
|
74
|
-
onClick: s[6] || (s[6] = (o) => e.
|
|
73
|
+
class: m(["AT_INPUT_side_icon_slot", { clickable: e.useSideClearButton }]),
|
|
74
|
+
onClick: s[6] || (s[6] = (o) => e.showSideClearButton ? e.clearInput() : null)
|
|
75
75
|
}, [
|
|
76
|
-
e.
|
|
76
|
+
e.showSideClearButton ? (n(), d(u, {
|
|
77
77
|
key: 0,
|
|
78
78
|
size: "20",
|
|
79
79
|
onClick: s[5] || (s[5] = (o) => e.clearInput())
|
|
80
|
-
})) : (
|
|
80
|
+
})) : r("", !0)
|
|
81
|
+
], 2)) : r("", !0),
|
|
82
|
+
e.$props.icon ? (n(), l("div", {
|
|
83
|
+
key: 3,
|
|
84
|
+
class: m(["AT_INPUT_icon_slot", { clickable: e.useClearButton && e.isFocused }]),
|
|
85
|
+
onClick: s[8] || (s[8] = (o) => e.showClearButton ? e.clearInput() : null)
|
|
86
|
+
}, [
|
|
87
|
+
e.showClearButton ? (n(), d(u, {
|
|
88
|
+
key: 0,
|
|
89
|
+
size: "20",
|
|
90
|
+
onClick: s[7] || (s[7] = (o) => e.clearInput())
|
|
91
|
+
})) : (n(), d(y(e.icons[e.$props.icon.name]), {
|
|
81
92
|
key: 1,
|
|
82
93
|
size: e.$props.icon.size || "20",
|
|
83
94
|
color: e.iconColor
|
|
84
95
|
}, null, 8, ["size", "color"]))
|
|
85
|
-
], 2)) :
|
|
86
|
-
], 40,
|
|
87
|
-
e.error.value ? (n(), l("span",
|
|
88
|
-
|
|
96
|
+
], 2)) : r("", !0)
|
|
97
|
+
], 40, f),
|
|
98
|
+
e.error.value ? (n(), l("span", h, [
|
|
99
|
+
i("img", {
|
|
89
100
|
src: e.icons.error,
|
|
90
101
|
alt: "error icon"
|
|
91
|
-
}, null, 8,
|
|
92
|
-
|
|
93
|
-
])) :
|
|
102
|
+
}, null, 8, U),
|
|
103
|
+
a(" " + t(e.error.message), 1)
|
|
104
|
+
])) : r("", !0)
|
|
94
105
|
]);
|
|
95
106
|
}
|
|
96
|
-
const
|
|
107
|
+
const X = /* @__PURE__ */ $(I, [["render", B], ["__scopeId", "data-v-d7890dba"]]);
|
|
97
108
|
export {
|
|
98
|
-
|
|
109
|
+
X as default
|
|
99
110
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { AtCircleXMarkSolidIcon as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as z, ref as u, computed as s, onMounted as N, onBeforeUnmount as U, watchEffect as D, watch as T, nextTick as P } from "vue";
|
|
2
|
+
import { AtCircleXMarkSolidIcon as X } from "../node_modules/.pnpm/@agrotools1_at-icons@0.2.11/node_modules/@agrotools1/at-icons/dist/AtCircleXMarkSolidIcon/index.js";
|
|
3
|
+
import H from "../Icons/icons.js";
|
|
4
|
+
import G from "./imgs/error.svg.js";
|
|
5
|
+
const Z = z({
|
|
6
6
|
name: "AtCoreInput",
|
|
7
7
|
components: {
|
|
8
|
-
AtCircleXMarkSolidIcon:
|
|
8
|
+
AtCircleXMarkSolidIcon: X
|
|
9
9
|
},
|
|
10
10
|
props: {
|
|
11
11
|
modelValue: {
|
|
@@ -85,6 +85,10 @@ const Y = j({
|
|
|
85
85
|
type: Boolean,
|
|
86
86
|
default: !1
|
|
87
87
|
},
|
|
88
|
+
useSideClearButton: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: !1
|
|
91
|
+
},
|
|
88
92
|
forceEventClearButton: {
|
|
89
93
|
type: Boolean,
|
|
90
94
|
default: !1
|
|
@@ -97,34 +101,36 @@ const Y = j({
|
|
|
97
101
|
"clearInput",
|
|
98
102
|
"mouseover"
|
|
99
103
|
],
|
|
100
|
-
setup(e, { emit:
|
|
101
|
-
const A = { ...
|
|
102
|
-
() => e.useClearButton && a.value && e.modelValue && !
|
|
104
|
+
setup(e, { emit: c }) {
|
|
105
|
+
const A = { ...H }, B = u(null), V = u(null), f = u(null), b = u(null), O = s(() => e.error), a = u(!1), i = u(""), d = u(!1), E = s(
|
|
106
|
+
() => e.useClearButton && a.value && e.modelValue && !d.value
|
|
107
|
+
), q = s(
|
|
108
|
+
() => e.useSideClearButton && !e.useClearButton && e.modelValue && !d.value
|
|
103
109
|
), y = u({
|
|
104
110
|
supportedItems: e.selectedItems.length,
|
|
105
111
|
isCounterActive: !1,
|
|
106
112
|
itemsToRender: e.selectedItems
|
|
107
|
-
}),
|
|
108
|
-
|
|
109
|
-
},
|
|
110
|
-
|
|
113
|
+
}), F = Math.random().toString(36).substring(2), o = u(!1), M = () => {
|
|
114
|
+
o.value = !0;
|
|
115
|
+
}, L = () => {
|
|
116
|
+
o.value = !1;
|
|
111
117
|
}, g = () => {
|
|
112
118
|
a.value = !0;
|
|
113
119
|
}, v = () => {
|
|
114
|
-
e.forceFocus || (e.forceEventClearButton ? a.value = !0 :
|
|
120
|
+
e.forceFocus || (e.forceEventClearButton ? a.value = !0 : k(() => {
|
|
115
121
|
a.value = !1;
|
|
116
122
|
}, 100)());
|
|
117
123
|
}, m = async () => {
|
|
118
|
-
var
|
|
119
|
-
y.value.itemsToRender = e.selectedItems, await
|
|
120
|
-
const t = (
|
|
124
|
+
var w;
|
|
125
|
+
y.value.itemsToRender = e.selectedItems, await P();
|
|
126
|
+
const t = (w = f.value) == null ? void 0 : w.clientWidth;
|
|
121
127
|
if (t === void 0)
|
|
122
128
|
return;
|
|
123
129
|
let l = 50, n = 0;
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
for (let I = 0; I <
|
|
127
|
-
l +=
|
|
130
|
+
const r = b.value;
|
|
131
|
+
if (r)
|
|
132
|
+
for (let I = 0; I < r.length; I++)
|
|
133
|
+
l += r[I].clientWidth + 10, l <= t && (n = I + 1);
|
|
128
134
|
let C;
|
|
129
135
|
l >= t ? C = {
|
|
130
136
|
isCounterActive: l > (t || 0),
|
|
@@ -135,37 +141,37 @@ const Y = j({
|
|
|
135
141
|
supportedItems: e.selectedItems.length,
|
|
136
142
|
itemsToRender: e.selectedItems
|
|
137
143
|
}, y.value = C;
|
|
138
|
-
},
|
|
144
|
+
}, S = (t) => {
|
|
139
145
|
var l, n;
|
|
140
|
-
!((l =
|
|
146
|
+
!((l = B.value) != null && l.contains(t.target)) && !((n = V.value) != null && n.contains(t.target)) && !E.value && !d.value && (v(), a.value = !1, c("clickOutside"));
|
|
141
147
|
};
|
|
142
|
-
|
|
148
|
+
N(() => {
|
|
143
149
|
var t;
|
|
144
|
-
(e.modelValue !== void 0 && ((t = e.modelValue) != null && t.length) || e.forceFocus) && g(), document.addEventListener("click",
|
|
145
|
-
}),
|
|
146
|
-
document.removeEventListener("click",
|
|
150
|
+
(e.modelValue !== void 0 && ((t = e.modelValue) != null && t.length) || e.forceFocus) && g(), document.addEventListener("click", S), window.addEventListener("resize", m);
|
|
151
|
+
}), U(() => {
|
|
152
|
+
document.removeEventListener("click", S), window.removeEventListener("resize", m);
|
|
147
153
|
});
|
|
148
|
-
const
|
|
154
|
+
const _ = (t) => {
|
|
149
155
|
e.preventInputEvent && t.preventDefault();
|
|
150
156
|
const l = t.target.value;
|
|
151
|
-
|
|
157
|
+
c("input", t), e.debounce > 0 ? k(() => h(l), e.debounce)() : h(l);
|
|
152
158
|
}, h = (t) => {
|
|
153
|
-
|
|
159
|
+
c("update:modelValue", t), e.modelValue === void 0 && (i.value = t);
|
|
154
160
|
};
|
|
155
|
-
function
|
|
161
|
+
function k(t, l) {
|
|
156
162
|
let n;
|
|
157
163
|
return function() {
|
|
158
164
|
clearTimeout(n), n = setTimeout(t, l);
|
|
159
165
|
};
|
|
160
166
|
}
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
e.forceEventClearButton || h(""),
|
|
167
|
+
const x = () => {
|
|
168
|
+
d.value = !0, a.value = !1, c("clearInput"), setTimeout(() => {
|
|
169
|
+
e.forceEventClearButton || h(""), d.value = !1;
|
|
164
170
|
}, 100);
|
|
165
171
|
};
|
|
166
|
-
|
|
172
|
+
D(() => {
|
|
167
173
|
var t, l;
|
|
168
|
-
e.separator && ((e.modelValue !== void 0 ? e.modelValue.split(e.separator).filter((
|
|
174
|
+
e.separator && ((e.modelValue !== void 0 ? e.modelValue.split(e.separator).filter((r) => r.length > 1) : i.value.split(e.separator).filter((r) => r.length > 1)).length ? (t = f.value) == null || t.classList.remove("AT-INPUT_items_empty") : ((l = f.value) == null || l.classList.add("AT-INPUT_items_empty"), v(), a.value = !1)), e.forceFocus ? g() : (v(), a.value = !1);
|
|
169
175
|
}), T(
|
|
170
176
|
() => e.selectedItems,
|
|
171
177
|
async () => {
|
|
@@ -173,44 +179,45 @@ const Y = j({
|
|
|
173
179
|
},
|
|
174
180
|
{ deep: !0 }
|
|
175
181
|
), T(
|
|
176
|
-
() =>
|
|
182
|
+
() => o.value,
|
|
177
183
|
() => {
|
|
178
|
-
|
|
184
|
+
c("mouseover", o.value);
|
|
179
185
|
}
|
|
180
186
|
);
|
|
181
|
-
const
|
|
187
|
+
const R = s(() => {
|
|
182
188
|
var t;
|
|
183
|
-
return e.disabled ? "var(--at-medium-grey)" : e.selectedItems.length > 0 ? "var(--at-black)" : a.value ? "var(--at-primary-color-2)" : e.error.value ? "var(--at-error)" :
|
|
184
|
-
}),
|
|
189
|
+
return e.disabled ? "var(--at-medium-grey)" : e.selectedItems.length > 0 ? "var(--at-black)" : a.value ? "var(--at-primary-color-2)" : e.error.value ? "var(--at-error)" : o.value || (t = e.icon) != null && t.color || e.modelValue !== void 0 && e.modelValue.length > 0 || i.value.length > 0 ? "var(--at-black)" : "var(--at-dark-grey)";
|
|
190
|
+
}), W = s(() => e.disabled ? "disabled" : e.selectedItems.length > 0 ? "filled" : a.value ? "focused" : e.error.value ? "error" : o.value ? "hover" : e.modelValue !== void 0 && e.modelValue.length > 0 || i.value.length > 0 ? "filled" : "default"), j = s(() => e.modelValue !== void 0 ? e.modelValue : i.value ? i.value : null);
|
|
185
191
|
return {
|
|
186
|
-
wrapperEl:
|
|
192
|
+
wrapperEl: B,
|
|
187
193
|
inputEl: V,
|
|
188
194
|
inputError: O,
|
|
189
|
-
inputId: e.id ??
|
|
195
|
+
inputId: e.id ?? F,
|
|
190
196
|
handleOnFocus: g,
|
|
191
197
|
handleOnFocusOut: v,
|
|
192
198
|
icons: {
|
|
193
|
-
error:
|
|
199
|
+
error: G,
|
|
194
200
|
...A
|
|
195
201
|
},
|
|
196
|
-
clickedClear:
|
|
197
|
-
showClearButton:
|
|
198
|
-
|
|
202
|
+
clickedClear: d,
|
|
203
|
+
showClearButton: E,
|
|
204
|
+
showSideClearButton: q,
|
|
205
|
+
clearInput: x,
|
|
199
206
|
containerItemsEl: f,
|
|
200
|
-
onInput:
|
|
201
|
-
iconColor:
|
|
207
|
+
onInput: _,
|
|
208
|
+
iconColor: R,
|
|
202
209
|
isFocused: a,
|
|
203
|
-
handleMouseOver:
|
|
204
|
-
handleMouseLeave:
|
|
205
|
-
isHovered:
|
|
206
|
-
inputComputedValue:
|
|
207
|
-
currentMode:
|
|
208
|
-
selectedItemsEl:
|
|
210
|
+
handleMouseOver: M,
|
|
211
|
+
handleMouseLeave: L,
|
|
212
|
+
isHovered: o,
|
|
213
|
+
inputComputedValue: j,
|
|
214
|
+
currentMode: W,
|
|
215
|
+
selectedItemsEl: b,
|
|
209
216
|
selectedItemsController: y,
|
|
210
217
|
resizeSelectedItems: m
|
|
211
218
|
};
|
|
212
219
|
}
|
|
213
220
|
});
|
|
214
221
|
export {
|
|
215
|
-
|
|
222
|
+
Z as default
|
|
216
223
|
};
|
package/dist/Input/index.d.ts
CHANGED
|
@@ -90,6 +90,10 @@ export declare const AtInput: {
|
|
|
90
90
|
type: BooleanConstructor;
|
|
91
91
|
default: boolean;
|
|
92
92
|
};
|
|
93
|
+
useSideClearButton: {
|
|
94
|
+
type: BooleanConstructor;
|
|
95
|
+
default: boolean;
|
|
96
|
+
};
|
|
93
97
|
forceEventClearButton: {
|
|
94
98
|
type: BooleanConstructor;
|
|
95
99
|
default: boolean;
|
|
@@ -6214,6 +6218,7 @@ export declare const AtInput: {
|
|
|
6214
6218
|
};
|
|
6215
6219
|
clickedClear: import('vue').Ref<boolean>;
|
|
6216
6220
|
showClearButton: import('vue').ComputedRef<boolean | "" | undefined>;
|
|
6221
|
+
showSideClearButton: import('vue').ComputedRef<boolean | "" | undefined>;
|
|
6217
6222
|
clearInput: () => void;
|
|
6218
6223
|
containerItemsEl: import('vue').Ref<HTMLDivElement | null>;
|
|
6219
6224
|
onInput: (event: InputEvent) => void;
|
|
@@ -6328,6 +6333,10 @@ export declare const AtInput: {
|
|
|
6328
6333
|
type: BooleanConstructor;
|
|
6329
6334
|
default: boolean;
|
|
6330
6335
|
};
|
|
6336
|
+
useSideClearButton: {
|
|
6337
|
+
type: BooleanConstructor;
|
|
6338
|
+
default: boolean;
|
|
6339
|
+
};
|
|
6331
6340
|
forceEventClearButton: {
|
|
6332
6341
|
type: BooleanConstructor;
|
|
6333
6342
|
default: boolean;
|
|
@@ -6361,6 +6370,7 @@ export declare const AtInput: {
|
|
|
6361
6370
|
cursor: string;
|
|
6362
6371
|
selectedItems: import('../Select/Item/Item').SelectItemProps[];
|
|
6363
6372
|
useClearButton: boolean;
|
|
6373
|
+
useSideClearButton: boolean;
|
|
6364
6374
|
forceEventClearButton: boolean;
|
|
6365
6375
|
}, {}>;
|
|
6366
6376
|
};
|
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: {
|
|
@@ -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", h], ["__scopeId", "data-v-
|
|
49
|
+
const V = /* @__PURE__ */ m(l, [["render", h], ["__scopeId", "data-v-17f99334"]]);
|
|
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 && (
|
|
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 && (i.value && clearTimeout(i.value), i.value = setTimeout(async () => {
|
|
102
|
+
o.value = !0, 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
|
};
|