@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
|
@@ -8,6 +8,8 @@ export interface SelectCoreProps {
|
|
|
8
8
|
selectedItems?: Array<SelectItemProps>;
|
|
9
9
|
separator?: string;
|
|
10
10
|
onSelectedItemClick: (separatedValue: string) => void;
|
|
11
|
+
isTypable: boolean;
|
|
12
|
+
showClearButton: false;
|
|
11
13
|
}
|
|
12
14
|
declare const _default: import('vue').DefineComponent<{
|
|
13
15
|
value: {
|
|
@@ -46,6 +48,21 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
46
48
|
required: false;
|
|
47
49
|
default: boolean;
|
|
48
50
|
};
|
|
51
|
+
customClass: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
required: false;
|
|
54
|
+
default: string;
|
|
55
|
+
};
|
|
56
|
+
isTypable: {
|
|
57
|
+
type: BooleanConstructor;
|
|
58
|
+
required: false;
|
|
59
|
+
default: boolean;
|
|
60
|
+
};
|
|
61
|
+
showClearButton: {
|
|
62
|
+
type: BooleanConstructor;
|
|
63
|
+
required: false;
|
|
64
|
+
default: boolean;
|
|
65
|
+
};
|
|
49
66
|
}, {
|
|
50
67
|
id: string;
|
|
51
68
|
handleValue: () => string;
|
|
@@ -55,7 +72,13 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
55
72
|
} | undefined>;
|
|
56
73
|
atInput: import('vue').Ref<null>;
|
|
57
74
|
inputModelValue: import('vue').Ref<string>;
|
|
58
|
-
|
|
75
|
+
handleTyping: (text: string) => void;
|
|
76
|
+
handleClearInput: () => void;
|
|
77
|
+
handleClickOutside: () => void;
|
|
78
|
+
type: import('vue').ComputedRef<"button" | undefined>;
|
|
79
|
+
inputClass: string;
|
|
80
|
+
isTypable: boolean;
|
|
81
|
+
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("clearInput" | "update:model-value")[], "clearInput" | "update:model-value", import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, Readonly<import('vue').ExtractPropTypes<{
|
|
59
82
|
value: {
|
|
60
83
|
type: PropType<string | SelectItemProps>;
|
|
61
84
|
};
|
|
@@ -92,12 +115,33 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
92
115
|
required: false;
|
|
93
116
|
default: boolean;
|
|
94
117
|
};
|
|
95
|
-
|
|
118
|
+
customClass: {
|
|
119
|
+
type: StringConstructor;
|
|
120
|
+
required: false;
|
|
121
|
+
default: string;
|
|
122
|
+
};
|
|
123
|
+
isTypable: {
|
|
124
|
+
type: BooleanConstructor;
|
|
125
|
+
required: false;
|
|
126
|
+
default: boolean;
|
|
127
|
+
};
|
|
128
|
+
showClearButton: {
|
|
129
|
+
type: BooleanConstructor;
|
|
130
|
+
required: false;
|
|
131
|
+
default: boolean;
|
|
132
|
+
};
|
|
133
|
+
}>> & {
|
|
134
|
+
onClearInput?: ((...args: any[]) => any) | undefined;
|
|
135
|
+
"onUpdate:model-value"?: ((...args: any[]) => any) | undefined;
|
|
136
|
+
}, {
|
|
96
137
|
required: boolean;
|
|
97
138
|
label: string;
|
|
98
139
|
disabled: boolean;
|
|
99
140
|
separator: string;
|
|
100
141
|
selectedItems: SelectItemProps[];
|
|
142
|
+
showClearButton: boolean;
|
|
101
143
|
isMultiple: boolean;
|
|
144
|
+
customClass: string;
|
|
145
|
+
isTypable: boolean;
|
|
102
146
|
}, {}>;
|
|
103
147
|
export default _default;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as a, openBlock as
|
|
3
|
-
import
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
return
|
|
1
|
+
import n from "./Select.core.vue2.js";
|
|
2
|
+
import { resolveComponent as a, openBlock as t, createBlock as i, mergeProps as s } from "vue";
|
|
3
|
+
import d from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
function p(e, o, u, m, c, b) {
|
|
5
|
+
const l = a("AtInput");
|
|
6
|
+
return t(), i(l, s(e.$props, {
|
|
7
7
|
ref: "atInput",
|
|
8
8
|
modelValue: e.inputModelValue,
|
|
9
|
-
"onUpdate:modelValue":
|
|
10
|
-
|
|
9
|
+
"onUpdate:modelValue": [
|
|
10
|
+
o[0] || (o[0] = (r) => e.inputModelValue = r),
|
|
11
|
+
e.handleTyping
|
|
12
|
+
],
|
|
11
13
|
role: "combobox",
|
|
14
|
+
type: e.type,
|
|
12
15
|
cursor: "pointer",
|
|
13
16
|
"prevent-input-event": !0,
|
|
14
17
|
"on-selected-item-click": e.onSelectedItemClick,
|
|
@@ -22,10 +25,13 @@ function d(e, o, u, m, c, b) {
|
|
|
22
25
|
error: e.getError,
|
|
23
26
|
icon: { name: "AtAngleDownSolidIcon" },
|
|
24
27
|
"aria-autocomplete": "none",
|
|
25
|
-
class: "AT-SELECT_container"
|
|
26
|
-
|
|
28
|
+
class: ["AT-SELECT_container", e.inputClass],
|
|
29
|
+
"use-side-clear-button": e.showClearButton,
|
|
30
|
+
onClearInput: e.handleClearInput,
|
|
31
|
+
onClickOutside: e.handleClickOutside
|
|
32
|
+
}), null, 16, ["modelValue", "type", "on-selected-item-click", "selected-items", "label", "aria-controls", "aria-label", "separator", "required", "disabled", "error", "class", "use-side-clear-button", "onUpdate:modelValue", "onClearInput", "onClickOutside"]);
|
|
27
33
|
}
|
|
28
|
-
const k = /* @__PURE__ */
|
|
34
|
+
const k = /* @__PURE__ */ d(n, [["render", p]]);
|
|
29
35
|
export {
|
|
30
36
|
k as default
|
|
31
37
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { AtInput as
|
|
1
|
+
import { defineComponent as m, ref as s, computed as n, watch as b, inject as I } from "vue";
|
|
2
|
+
import { AtInput as h } from "../Input/index.js";
|
|
3
3
|
import "./Item/Item.vue2.js";
|
|
4
4
|
import "./Item/Item.vue3.js";
|
|
5
|
-
const S =
|
|
5
|
+
const S = m({
|
|
6
6
|
name: "AtSelect",
|
|
7
7
|
components: {
|
|
8
|
-
AtInput:
|
|
8
|
+
AtInput: h.Text
|
|
9
9
|
},
|
|
10
10
|
props: {
|
|
11
11
|
value: {
|
|
@@ -43,36 +43,67 @@ const S = f({
|
|
|
43
43
|
type: Boolean,
|
|
44
44
|
required: !1,
|
|
45
45
|
default: !1
|
|
46
|
+
},
|
|
47
|
+
customClass: {
|
|
48
|
+
type: String,
|
|
49
|
+
required: !1,
|
|
50
|
+
default: ""
|
|
51
|
+
},
|
|
52
|
+
isTypable: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
required: !1,
|
|
55
|
+
default: !1
|
|
56
|
+
},
|
|
57
|
+
showClearButton: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
required: !1,
|
|
60
|
+
default: !1
|
|
46
61
|
}
|
|
47
62
|
},
|
|
48
|
-
|
|
49
|
-
|
|
63
|
+
emits: ["update:model-value", "clearInput"],
|
|
64
|
+
setup(e, { emit: a }) {
|
|
65
|
+
const o = s(null), l = s(""), r = n(() => {
|
|
50
66
|
var t;
|
|
51
67
|
return typeof e.value == "string" ? e.value : (t = e.value) == null ? void 0 : t.value;
|
|
52
|
-
}),
|
|
53
|
-
|
|
68
|
+
}), d = n(() => {
|
|
69
|
+
if (!e.isTypable)
|
|
70
|
+
return "button";
|
|
71
|
+
}), f = (t) => {
|
|
72
|
+
a("update:model-value", t);
|
|
73
|
+
}, c = () => {
|
|
74
|
+
a("clearInput");
|
|
75
|
+
}, p = () => {
|
|
76
|
+
!e.value && e.isTypable && (l.value = "", a("clearInput"));
|
|
77
|
+
}, u = () => {
|
|
78
|
+
var i;
|
|
54
79
|
if (e.isMultiple)
|
|
55
80
|
return "";
|
|
56
|
-
const t = (
|
|
57
|
-
(
|
|
81
|
+
const t = (i = e.items) == null ? void 0 : i.find(
|
|
82
|
+
(v) => v.value === r.value
|
|
58
83
|
);
|
|
59
84
|
return t ? t.text : (console.warn(
|
|
60
|
-
`The default value "${
|
|
85
|
+
`The default value "${r.value}" is not included in the items array.`
|
|
61
86
|
), "");
|
|
62
87
|
};
|
|
63
|
-
|
|
88
|
+
b(
|
|
64
89
|
() => e.value,
|
|
65
90
|
() => {
|
|
66
|
-
l.value =
|
|
91
|
+
e.value !== "" && (l.value = u() || "");
|
|
67
92
|
}
|
|
68
|
-
), l.value =
|
|
69
|
-
const
|
|
93
|
+
), l.value = u() || "";
|
|
94
|
+
const y = n(() => I("error"));
|
|
70
95
|
return {
|
|
71
96
|
id: `at-select-${Math.random().toString(36).substr(2, 9)}`,
|
|
72
|
-
handleValue:
|
|
73
|
-
getError:
|
|
97
|
+
handleValue: u,
|
|
98
|
+
getError: y,
|
|
74
99
|
atInput: o,
|
|
75
|
-
inputModelValue: l
|
|
100
|
+
inputModelValue: l,
|
|
101
|
+
handleTyping: f,
|
|
102
|
+
handleClearInput: c,
|
|
103
|
+
handleClickOutside: p,
|
|
104
|
+
type: d,
|
|
105
|
+
inputClass: e.customClass,
|
|
106
|
+
isTypable: e.isTypable
|
|
76
107
|
};
|
|
77
108
|
}
|
|
78
109
|
});
|
|
@@ -32,10 +32,22 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
32
32
|
type: BooleanConstructor;
|
|
33
33
|
default: boolean;
|
|
34
34
|
};
|
|
35
|
+
hasAutocomplete: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
default: boolean;
|
|
38
|
+
};
|
|
39
|
+
showClearButton: {
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
default: boolean;
|
|
42
|
+
};
|
|
35
43
|
error: {
|
|
36
44
|
type: ObjectConstructor;
|
|
37
45
|
default: () => void;
|
|
38
46
|
};
|
|
47
|
+
msgNoResult: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
39
51
|
}, {
|
|
40
52
|
onSelectedValueChange: (item: SelectItemProps) => void;
|
|
41
53
|
selectedValue: import('vue').Ref<string | {
|
|
@@ -53,7 +65,21 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
53
65
|
containerRef: import('vue').Ref<HTMLDivElement | null>;
|
|
54
66
|
isInternalChange: import('vue').Ref<boolean>;
|
|
55
67
|
rotateIcon: () => void;
|
|
56
|
-
|
|
68
|
+
handleTyping: (value: string) => void;
|
|
69
|
+
filteredItems: import('vue').Ref<{
|
|
70
|
+
text: string;
|
|
71
|
+
value: string;
|
|
72
|
+
onClick?: ((payload: MouseEvent) => void) | undefined;
|
|
73
|
+
onCheckboxChange?: ((payload: import('../Item/Item').CheckboxProps) => void) | undefined;
|
|
74
|
+
checkboxValue?: boolean | undefined;
|
|
75
|
+
isSelected?: boolean | undefined;
|
|
76
|
+
type?: "text" | "multiple" | "with-icon" | undefined;
|
|
77
|
+
icon?: string | undefined;
|
|
78
|
+
}[]>;
|
|
79
|
+
textValue: import('vue').Ref<string>;
|
|
80
|
+
showNoResult: import('vue').ComputedRef<boolean>;
|
|
81
|
+
handleClearInput: () => void;
|
|
82
|
+
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("update:modelValue" | "clearValue")[], "update:modelValue" | "clearValue", import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, Readonly<import('vue').ExtractPropTypes<{
|
|
57
83
|
modelValue: {
|
|
58
84
|
type: PropType<string | SelectItemProps>;
|
|
59
85
|
required: false;
|
|
@@ -81,12 +107,25 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
81
107
|
type: BooleanConstructor;
|
|
82
108
|
default: boolean;
|
|
83
109
|
};
|
|
110
|
+
hasAutocomplete: {
|
|
111
|
+
type: BooleanConstructor;
|
|
112
|
+
default: boolean;
|
|
113
|
+
};
|
|
114
|
+
showClearButton: {
|
|
115
|
+
type: BooleanConstructor;
|
|
116
|
+
default: boolean;
|
|
117
|
+
};
|
|
84
118
|
error: {
|
|
85
119
|
type: ObjectConstructor;
|
|
86
120
|
default: () => void;
|
|
87
121
|
};
|
|
122
|
+
msgNoResult: {
|
|
123
|
+
type: StringConstructor;
|
|
124
|
+
default: string;
|
|
125
|
+
};
|
|
88
126
|
}>> & {
|
|
89
127
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
128
|
+
onClearValue?: ((...args: any[]) => any) | undefined;
|
|
90
129
|
}, {
|
|
91
130
|
required: boolean;
|
|
92
131
|
label: string;
|
|
@@ -94,6 +133,9 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
94
133
|
disabled: boolean;
|
|
95
134
|
modelValue: string | SelectItemProps;
|
|
96
135
|
items: SelectItemProps[];
|
|
136
|
+
showClearButton: boolean;
|
|
137
|
+
msgNoResult: string;
|
|
97
138
|
emitValue: boolean;
|
|
139
|
+
hasAutocomplete: boolean;
|
|
98
140
|
}, {}>;
|
|
99
141
|
export default _default;
|
|
@@ -1,36 +1,52 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as
|
|
1
|
+
import m from "./Select.single.vue2.js";
|
|
2
|
+
import { resolveComponent as n, openBlock as o, createElementBlock as l, createVNode as s, withModifiers as C, withCtx as f, createTextVNode as b, toDisplayString as h, createCommentVNode as i, Fragment as v, renderList as g, createBlock as k } from "vue";
|
|
3
3
|
import "./Select.single.vue3.js";
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import y from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const A = ["aria-disabled"], I = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "noResult"
|
|
8
|
+
};
|
|
9
|
+
function w(e, t, S, V, T, $) {
|
|
10
|
+
const d = n("AtSingleCore"), u = n("AtParagraph"), p = n("AtItem");
|
|
8
11
|
return o(), l("div", {
|
|
9
12
|
ref: "containerRef",
|
|
10
13
|
class: "AT-SELECT_wrapper",
|
|
11
14
|
"aria-disabled": e.disabled,
|
|
12
|
-
onClick:
|
|
15
|
+
onClick: t[1] || (t[1] = (a) => {
|
|
13
16
|
e.open = !e.open, e.rotateIcon();
|
|
14
17
|
})
|
|
15
18
|
}, [
|
|
16
|
-
|
|
19
|
+
s(d, {
|
|
17
20
|
value: e.selectedValue,
|
|
18
21
|
required: e.required,
|
|
19
22
|
disabled: e.disabled,
|
|
20
23
|
label: e.label,
|
|
21
|
-
items: e.items
|
|
22
|
-
|
|
24
|
+
items: e.items,
|
|
25
|
+
"custom-class": e.hasAutocomplete ? "showCaret" : "",
|
|
26
|
+
"is-typable": !!e.hasAutocomplete,
|
|
27
|
+
"show-clear-button": e.showClearButton,
|
|
28
|
+
"onUpdate:modelValue": e.handleTyping,
|
|
29
|
+
onClearInput: e.handleClearInput
|
|
30
|
+
}, null, 8, ["value", "required", "disabled", "label", "items", "custom-class", "is-typable", "show-clear-button", "onUpdate:modelValue", "onClearInput"]),
|
|
23
31
|
e.open ? (o(), l("div", {
|
|
24
32
|
key: 0,
|
|
25
33
|
role: "group",
|
|
26
34
|
"aria-orientation": "vertical",
|
|
27
35
|
tabindex: "-1",
|
|
28
36
|
class: "AT-SELECT_items-container",
|
|
29
|
-
onClick:
|
|
37
|
+
onClick: t[0] || (t[0] = C((a) => {
|
|
30
38
|
e.open = !1, e.rotateIcon();
|
|
31
39
|
}, ["stop"]))
|
|
32
40
|
}, [
|
|
33
|
-
|
|
41
|
+
e.showNoResult ? (o(), l("section", I, [
|
|
42
|
+
s(u, { size: "p2" }, {
|
|
43
|
+
default: f(() => [
|
|
44
|
+
b(h(e.msgNoResult), 1)
|
|
45
|
+
]),
|
|
46
|
+
_: 1
|
|
47
|
+
})
|
|
48
|
+
])) : i("", !0),
|
|
49
|
+
(o(!0), l(v, null, g(e.filteredItems, (a) => (o(), k(p, {
|
|
34
50
|
key: a.value,
|
|
35
51
|
text: a.text,
|
|
36
52
|
value: a.value,
|
|
@@ -38,15 +54,15 @@ function g(e, n, A, I, S, y) {
|
|
|
38
54
|
icon: a.icon,
|
|
39
55
|
"aria-selected": a.value === e.valueOfModel,
|
|
40
56
|
"data-text": a.text,
|
|
41
|
-
"on-click": async (
|
|
57
|
+
"on-click": async (c) => {
|
|
42
58
|
var r;
|
|
43
|
-
e.isInternalChange = !0, await e.onSelectedValueChange(a), (r = a.onClick) == null || r.call(a,
|
|
59
|
+
e.isInternalChange = !0, await e.onSelectedValueChange(a), (r = a.onClick) == null || r.call(a, c), e.isInternalChange = !1;
|
|
44
60
|
}
|
|
45
61
|
}, null, 8, ["text", "value", "type", "icon", "aria-selected", "data-text", "on-click"]))), 128))
|
|
46
|
-
])) :
|
|
47
|
-
], 8,
|
|
62
|
+
])) : i("", !0)
|
|
63
|
+
], 8, A);
|
|
48
64
|
}
|
|
49
|
-
const q = /* @__PURE__ */
|
|
65
|
+
const q = /* @__PURE__ */ y(m, [["render", w], ["__scopeId", "data-v-31b7600e"]]);
|
|
50
66
|
export {
|
|
51
67
|
q as default
|
|
52
68
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as q, ref as r, provide as w, watch as A, computed as S, onMounted as O } from "vue";
|
|
2
|
+
import { AtTipograph as T } from "../../Tipograph/index.js";
|
|
3
|
+
import _ from "../Item/Item.vue.js";
|
|
4
|
+
import j from "../Select.core.vue.js";
|
|
5
|
+
const k = q({
|
|
5
6
|
name: "AtSingleSelect",
|
|
6
7
|
components: {
|
|
7
|
-
AtSingleCore:
|
|
8
|
-
AtItem:
|
|
8
|
+
AtSingleCore: j,
|
|
9
|
+
AtItem: _,
|
|
10
|
+
AtParagraph: T.Paragraph
|
|
9
11
|
},
|
|
10
12
|
props: {
|
|
11
13
|
modelValue: {
|
|
@@ -35,64 +37,109 @@ const O = p({
|
|
|
35
37
|
type: Boolean,
|
|
36
38
|
default: !1
|
|
37
39
|
},
|
|
40
|
+
hasAutocomplete: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: !1
|
|
43
|
+
},
|
|
44
|
+
showClearButton: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: !1
|
|
47
|
+
},
|
|
38
48
|
error: {
|
|
39
49
|
type: Object,
|
|
40
50
|
default: () => {
|
|
41
51
|
}
|
|
52
|
+
},
|
|
53
|
+
msgNoResult: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: "Dado não encontrado"
|
|
42
56
|
}
|
|
43
57
|
},
|
|
44
|
-
emits: ["update:modelValue"],
|
|
58
|
+
emits: ["update:modelValue", "clearValue"],
|
|
45
59
|
setup(t, { emit: i }) {
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
60
|
+
const n = r(null), o = r(!1), l = r(t.modelValue), u = r(""), c = r(!1), f = r(d(t.items));
|
|
61
|
+
w("error", t.error), A(t.error, () => w("error", t.error));
|
|
62
|
+
const v = (e) => {
|
|
63
|
+
l.value = e, o.value = !1, y(), i(
|
|
50
64
|
"update:modelValue",
|
|
51
|
-
t.emitValue ?
|
|
65
|
+
t.emitValue ? l.value.value : l.value
|
|
52
66
|
);
|
|
53
|
-
},
|
|
67
|
+
}, L = (e) => {
|
|
68
|
+
l.value !== "" && (u.value = "", l.value = "", m()), u.value = e;
|
|
69
|
+
const a = t.items.filter((s) => s.text.toLowerCase().includes(e.toLowerCase()));
|
|
70
|
+
f.value = d(a, e), o.value = !0;
|
|
71
|
+
}, V = S(() => {
|
|
54
72
|
var e;
|
|
55
|
-
return typeof
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
73
|
+
return typeof l.value == "string" ? l.value : (e = l.value) == null ? void 0 : e.value;
|
|
74
|
+
}), b = () => {
|
|
75
|
+
u.value = "", l.value = "", m(), i("clearValue");
|
|
76
|
+
};
|
|
77
|
+
function d(e, a) {
|
|
78
|
+
return e.sort((s, B) => {
|
|
79
|
+
const h = s.text.toLowerCase(), g = B.text.toLowerCase();
|
|
80
|
+
if (a) {
|
|
81
|
+
const p = h.startsWith(a.toLowerCase()), C = g.startsWith(a.toLowerCase());
|
|
82
|
+
if (p && !C)
|
|
83
|
+
return -1;
|
|
84
|
+
if (!p && C)
|
|
85
|
+
return 1;
|
|
86
|
+
}
|
|
87
|
+
return h.localeCompare(g);
|
|
88
|
+
});
|
|
60
89
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
90
|
+
const I = S(
|
|
91
|
+
() => {
|
|
92
|
+
var e;
|
|
93
|
+
return !((e = f.value) != null && e.length) && t.hasAutocomplete;
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
function x(e) {
|
|
97
|
+
var a;
|
|
98
|
+
o.value === !0 && !((a = n == null ? void 0 : n.value) != null && a.contains(e.target)) && (o.value = !1), l.value === "" && (u.value = "", m());
|
|
99
|
+
}
|
|
100
|
+
const m = () => {
|
|
101
|
+
f.value = d(t.items);
|
|
102
|
+
};
|
|
103
|
+
O(() => {
|
|
104
|
+
document.addEventListener("click", x);
|
|
105
|
+
}), A(
|
|
64
106
|
() => t.modelValue,
|
|
65
107
|
async (e) => {
|
|
66
|
-
if (
|
|
108
|
+
if (c.value)
|
|
67
109
|
return;
|
|
68
|
-
const
|
|
69
|
-
(
|
|
110
|
+
const a = t.items.find(
|
|
111
|
+
(s) => s.value === (typeof e == "string" ? e : e.value)
|
|
70
112
|
);
|
|
71
|
-
if (!
|
|
113
|
+
if (!a) {
|
|
72
114
|
console.warn(
|
|
73
115
|
"O valor ao qual você alterou o v-model não está contida nos itens disponíveis"
|
|
74
|
-
),
|
|
116
|
+
), l.value = "";
|
|
75
117
|
return;
|
|
76
118
|
}
|
|
77
|
-
|
|
119
|
+
c.value = !0, await v(a), c.value = !1;
|
|
78
120
|
}
|
|
79
121
|
);
|
|
80
|
-
const
|
|
81
|
-
var
|
|
82
|
-
const e = (
|
|
83
|
-
e instanceof HTMLElement && e.setAttribute("data-rotate",
|
|
122
|
+
const y = () => {
|
|
123
|
+
var a;
|
|
124
|
+
const e = (a = n.value) == null ? void 0 : a.querySelector(".AT_INPUT_icon_slot");
|
|
125
|
+
e instanceof HTMLElement && e.setAttribute("data-rotate", o.value.toString());
|
|
84
126
|
};
|
|
85
127
|
return {
|
|
86
|
-
onSelectedValueChange:
|
|
87
|
-
selectedValue:
|
|
88
|
-
open:
|
|
89
|
-
valueOfModel:
|
|
90
|
-
containerRef:
|
|
91
|
-
isInternalChange:
|
|
92
|
-
rotateIcon:
|
|
128
|
+
onSelectedValueChange: v,
|
|
129
|
+
selectedValue: l,
|
|
130
|
+
open: o,
|
|
131
|
+
valueOfModel: V,
|
|
132
|
+
containerRef: n,
|
|
133
|
+
isInternalChange: c,
|
|
134
|
+
rotateIcon: y,
|
|
135
|
+
handleTyping: L,
|
|
136
|
+
filteredItems: f,
|
|
137
|
+
textValue: u,
|
|
138
|
+
showNoResult: I,
|
|
139
|
+
handleClearInput: b
|
|
93
140
|
};
|
|
94
141
|
}
|
|
95
142
|
});
|
|
96
143
|
export {
|
|
97
|
-
|
|
144
|
+
k as default
|
|
98
145
|
};
|
package/dist/Select/index.d.ts
CHANGED
|
@@ -32,10 +32,22 @@ export declare const AtSelect: {
|
|
|
32
32
|
type: BooleanConstructor;
|
|
33
33
|
default: boolean;
|
|
34
34
|
};
|
|
35
|
+
hasAutocomplete: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
default: boolean;
|
|
38
|
+
};
|
|
39
|
+
showClearButton: {
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
default: boolean;
|
|
42
|
+
};
|
|
35
43
|
error: {
|
|
36
44
|
type: ObjectConstructor;
|
|
37
45
|
default: () => void;
|
|
38
46
|
};
|
|
47
|
+
msgNoResult: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
39
51
|
}, {
|
|
40
52
|
onSelectedValueChange: (item: ISelectItemProps) => void;
|
|
41
53
|
selectedValue: import('vue').Ref<string | {
|
|
@@ -53,7 +65,21 @@ export declare const AtSelect: {
|
|
|
53
65
|
containerRef: import('vue').Ref<HTMLDivElement | null>;
|
|
54
66
|
isInternalChange: import('vue').Ref<boolean>;
|
|
55
67
|
rotateIcon: () => void;
|
|
56
|
-
|
|
68
|
+
handleTyping: (value: string) => void;
|
|
69
|
+
filteredItems: import('vue').Ref<{
|
|
70
|
+
text: string;
|
|
71
|
+
value: string;
|
|
72
|
+
onClick?: ((payload: MouseEvent) => void) | undefined;
|
|
73
|
+
onCheckboxChange?: ((payload: import('./Item/Item').CheckboxProps) => void) | undefined;
|
|
74
|
+
checkboxValue?: boolean | undefined;
|
|
75
|
+
isSelected?: boolean | undefined;
|
|
76
|
+
type?: "text" | "multiple" | "with-icon" | undefined;
|
|
77
|
+
icon?: string | undefined;
|
|
78
|
+
}[]>;
|
|
79
|
+
textValue: import('vue').Ref<string>;
|
|
80
|
+
showNoResult: import('vue').ComputedRef<boolean>;
|
|
81
|
+
handleClearInput: () => void;
|
|
82
|
+
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("update:modelValue" | "clearValue")[], "update:modelValue" | "clearValue", import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, Readonly<import('vue').ExtractPropTypes<{
|
|
57
83
|
modelValue: {
|
|
58
84
|
type: import('vue').PropType<string | ISelectItemProps>;
|
|
59
85
|
required: false;
|
|
@@ -81,12 +107,25 @@ export declare const AtSelect: {
|
|
|
81
107
|
type: BooleanConstructor;
|
|
82
108
|
default: boolean;
|
|
83
109
|
};
|
|
110
|
+
hasAutocomplete: {
|
|
111
|
+
type: BooleanConstructor;
|
|
112
|
+
default: boolean;
|
|
113
|
+
};
|
|
114
|
+
showClearButton: {
|
|
115
|
+
type: BooleanConstructor;
|
|
116
|
+
default: boolean;
|
|
117
|
+
};
|
|
84
118
|
error: {
|
|
85
119
|
type: ObjectConstructor;
|
|
86
120
|
default: () => void;
|
|
87
121
|
};
|
|
122
|
+
msgNoResult: {
|
|
123
|
+
type: StringConstructor;
|
|
124
|
+
default: string;
|
|
125
|
+
};
|
|
88
126
|
}>> & {
|
|
89
127
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
128
|
+
onClearValue?: ((...args: any[]) => any) | undefined;
|
|
90
129
|
}, {
|
|
91
130
|
required: boolean;
|
|
92
131
|
label: string;
|
|
@@ -94,7 +133,10 @@ export declare const AtSelect: {
|
|
|
94
133
|
disabled: boolean;
|
|
95
134
|
modelValue: string | ISelectItemProps;
|
|
96
135
|
items: ISelectItemProps[];
|
|
136
|
+
showClearButton: boolean;
|
|
137
|
+
msgNoResult: string;
|
|
97
138
|
emitValue: boolean;
|
|
139
|
+
hasAutocomplete: boolean;
|
|
98
140
|
}, {}>;
|
|
99
141
|
Multiple: import('vue').DefineComponent<{
|
|
100
142
|
label: {
|