@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
|
@@ -35,7 +35,7 @@ function _(e, t, k, y, w, E) {
|
|
|
35
35
|
], 2)
|
|
36
36
|
]);
|
|
37
37
|
}
|
|
38
|
-
const
|
|
38
|
+
const h = /* @__PURE__ */ $(a, [["render", _], ["__scopeId", "data-v-09e205ca"]]);
|
|
39
39
|
export {
|
|
40
|
-
|
|
40
|
+
h as default
|
|
41
41
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as H, ref as n, watch as G, onMounted as J, onUnmounted as K, computed as M } from "vue";
|
|
2
|
+
import Q from "./DropdownContent/DropdownContent.vue.js";
|
|
3
|
+
const V = H({
|
|
4
4
|
name: "AtDropdown",
|
|
5
|
-
components: { DropdownContent:
|
|
5
|
+
components: { DropdownContent: Q },
|
|
6
6
|
props: {
|
|
7
7
|
isOpen: {
|
|
8
8
|
type: Boolean,
|
|
@@ -22,77 +22,83 @@ const M = q({
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
emits: ["update:isOpen"],
|
|
25
|
-
setup(
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
const i =
|
|
29
|
-
var
|
|
30
|
-
h.value = window.scrollY;
|
|
31
|
-
const
|
|
25
|
+
setup(d, { emit: g }) {
|
|
26
|
+
const c = n(!1);
|
|
27
|
+
c.value = d.isOpen;
|
|
28
|
+
const i = n(), a = n(), s = n(), h = n(0), l = n(), f = n(), r = n(null), u = () => {
|
|
29
|
+
var S, b, O, z, C, D, E, L, W, $, I, P, T;
|
|
30
|
+
h.value = ((S = r.value) == null ? void 0 : S.scrollTop) ?? window.scrollY;
|
|
31
|
+
const e = (O = (b = a.value) == null ? void 0 : b.children[0]) == null ? void 0 : O.querySelector(
|
|
32
32
|
".AT-INPUT_error-message"
|
|
33
|
-
),
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
y: h.value *
|
|
33
|
+
), o = 1 / (Number.parseFloat((z = window.getComputedStyle(document.body)) == null ? void 0 : z.zoom) || 1);
|
|
34
|
+
l.value = (C = a.value) == null ? void 0 : C.getBoundingClientRect();
|
|
35
|
+
const N = {
|
|
36
|
+
y: h.value * o
|
|
37
37
|
}, t = {
|
|
38
|
-
top: (((
|
|
39
|
-
right: (((
|
|
40
|
-
bottom: (((
|
|
41
|
-
left: (((
|
|
42
|
-
width: (((
|
|
43
|
-
height: (((
|
|
44
|
-
},
|
|
38
|
+
top: (((D = l.value) == null ? void 0 : D.top) ?? 0) * o,
|
|
39
|
+
right: (((E = l.value) == null ? void 0 : E.right) ?? 0) * o,
|
|
40
|
+
bottom: (((L = l.value) == null ? void 0 : L.bottom) ?? 0) * o,
|
|
41
|
+
left: (((W = l.value) == null ? void 0 : W.left) ?? 0) * o,
|
|
42
|
+
width: ((($ = l.value) == null ? void 0 : $.width) ?? 0) * o,
|
|
43
|
+
height: (((I = l.value) == null ? void 0 : I.height) ?? 0) * o
|
|
44
|
+
}, x = ((t == null ? void 0 : t.bottom) ?? 0) + ((e == null ? void 0 : e.clientHeight) ?? 0) + 8 + B(N), U = {
|
|
45
45
|
left: () => {
|
|
46
|
-
var
|
|
46
|
+
var v, p;
|
|
47
47
|
s.value = {
|
|
48
48
|
x: (t == null ? void 0 : t.left) ?? 0,
|
|
49
|
-
y
|
|
50
|
-
},
|
|
51
|
-
top: `${((
|
|
49
|
+
y: x
|
|
50
|
+
}, f.value = {
|
|
51
|
+
top: `${((v = s.value) == null ? void 0 : v.y) || 0}px`,
|
|
52
52
|
left: `${((p = s.value) == null ? void 0 : p.x) || 0}px`,
|
|
53
|
-
zIndex: "2147483641"
|
|
53
|
+
zIndex: "2147483641",
|
|
54
|
+
position: "absolute"
|
|
54
55
|
};
|
|
55
56
|
},
|
|
56
57
|
right: () => {
|
|
57
|
-
var
|
|
58
|
+
var v, p, k, A;
|
|
58
59
|
s.value = {
|
|
59
|
-
x: ((t == null ? void 0 : t.left) ?? 0) - ((((
|
|
60
|
-
y
|
|
61
|
-
},
|
|
62
|
-
top: `${((
|
|
63
|
-
left: `${((
|
|
64
|
-
zIndex: "2147483641"
|
|
60
|
+
x: ((t == null ? void 0 : t.left) ?? 0) - ((((v = i.value) == null ? void 0 : v.clientWidth) ?? 0) - (((p = a.value) == null ? void 0 : p.clientWidth) ?? 0)),
|
|
61
|
+
y: x
|
|
62
|
+
}, f.value = {
|
|
63
|
+
top: `${((k = s.value) == null ? void 0 : k.y) || 0}px`,
|
|
64
|
+
left: `${((A = s.value) == null ? void 0 : A.x) || 0}px`,
|
|
65
|
+
zIndex: "2147483641",
|
|
66
|
+
position: "absolute"
|
|
65
67
|
};
|
|
66
68
|
}
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
() =>
|
|
72
|
-
(
|
|
73
|
-
|
|
69
|
+
}, F = window.innerWidth - ((t == null ? void 0 : t.right) ?? 0) <= (((P = i.value) == null ? void 0 : P.offsetWidth) ?? 0) ? "right" : d.position;
|
|
70
|
+
U[F](), d.fullSize && (f.value.width = `${((T = a.value) == null ? void 0 : T.clientWidth) ?? 0}px`);
|
|
71
|
+
}, B = (e) => r.value ? 0 : e.y;
|
|
72
|
+
G(
|
|
73
|
+
() => d.isOpen,
|
|
74
|
+
(e) => {
|
|
75
|
+
c.value = e, e && setTimeout(() => u(), 10);
|
|
74
76
|
}
|
|
75
77
|
);
|
|
76
|
-
const Y = async () =>
|
|
77
|
-
var
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
const Y = async () => g("update:isOpen", !0), y = async () => g("update:isOpen", !1), w = (e) => {
|
|
79
|
+
var m, o;
|
|
80
|
+
c.value && !((m = i == null ? void 0 : i.value) != null && m.contains(e.target)) && !((o = a.value) != null && o.contains(e.target)) && y();
|
|
81
|
+
}, _ = () => g("update:isOpen", !c.value);
|
|
82
|
+
J(() => {
|
|
83
|
+
var e;
|
|
84
|
+
document.addEventListener("click", w), window.addEventListener("resize", u), r.value = document.querySelector(".at-scrollable-container") || null, (e = r.value) == null || e.addEventListener("scroll", u), u();
|
|
85
|
+
}), K(() => {
|
|
86
|
+
var e;
|
|
87
|
+
document.removeEventListener("click", w), window.removeEventListener("resize", u), (e = r.value) == null || e.removeEventListener("scroll", u);
|
|
82
88
|
});
|
|
83
|
-
const
|
|
89
|
+
const q = M(() => ["dialog"]);
|
|
84
90
|
return {
|
|
85
|
-
dialogIsOpen:
|
|
86
|
-
getDialogClass:
|
|
91
|
+
dialogIsOpen: c,
|
|
92
|
+
getDialogClass: q,
|
|
87
93
|
dialogElem: i,
|
|
88
94
|
triggerElem: a,
|
|
89
|
-
dialogStyle:
|
|
90
|
-
toggleDialog:
|
|
95
|
+
dialogStyle: f,
|
|
96
|
+
toggleDialog: _,
|
|
91
97
|
openDialog: Y,
|
|
92
|
-
closeDialog:
|
|
98
|
+
closeDialog: y
|
|
93
99
|
};
|
|
94
100
|
}
|
|
95
101
|
});
|
|
96
102
|
export {
|
|
97
|
-
|
|
103
|
+
V as default
|
|
98
104
|
};
|
|
@@ -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/Menu/Menu.d.ts
CHANGED
|
@@ -16,9 +16,17 @@ interface MenuItem {
|
|
|
16
16
|
onClick?: (e: MouseEvent) => void;
|
|
17
17
|
}
|
|
18
18
|
declare const _default: import('vue').DefineComponent<{
|
|
19
|
-
|
|
20
|
-
type: PropType<
|
|
21
|
-
default: () =>
|
|
19
|
+
menu: {
|
|
20
|
+
type: PropType<MenuItem[]>;
|
|
21
|
+
default: () => never[];
|
|
22
|
+
};
|
|
23
|
+
configuration: {
|
|
24
|
+
type: PropType<MenuItem[]>;
|
|
25
|
+
default: () => never[];
|
|
26
|
+
};
|
|
27
|
+
footer: {
|
|
28
|
+
type: PropType<MenuItem[]>;
|
|
29
|
+
default: () => never[];
|
|
22
30
|
};
|
|
23
31
|
activeItemId: {
|
|
24
32
|
type: StringConstructor;
|
|
@@ -34,9 +42,17 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
34
42
|
activeItem: string;
|
|
35
43
|
};
|
|
36
44
|
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "click"[], "click", import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, Readonly<import('vue').ExtractPropTypes<{
|
|
37
|
-
|
|
38
|
-
type: PropType<
|
|
39
|
-
default: () =>
|
|
45
|
+
menu: {
|
|
46
|
+
type: PropType<MenuItem[]>;
|
|
47
|
+
default: () => never[];
|
|
48
|
+
};
|
|
49
|
+
configuration: {
|
|
50
|
+
type: PropType<MenuItem[]>;
|
|
51
|
+
default: () => never[];
|
|
52
|
+
};
|
|
53
|
+
footer: {
|
|
54
|
+
type: PropType<MenuItem[]>;
|
|
55
|
+
default: () => never[];
|
|
40
56
|
};
|
|
41
57
|
activeItemId: {
|
|
42
58
|
type: StringConstructor;
|
|
@@ -45,7 +61,9 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
45
61
|
}>> & {
|
|
46
62
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
47
63
|
}, {
|
|
48
|
-
|
|
64
|
+
footer: MenuItem[];
|
|
65
|
+
menu: MenuItem[];
|
|
66
|
+
configuration: MenuItem[];
|
|
49
67
|
activeItemId: string;
|
|
50
68
|
}, {}>;
|
|
51
69
|
export default _default;
|