@agrotools1/at-components 0.6.93 → 0.6.94
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 +4 -1
- package/dist/Input/Input.core.vue.js +8 -7
- package/dist/Input/Input.core.vue2.js +88 -73
- package/dist/Input/Input.core.vue3.js +2 -2
- package/dist/Input/index.d.ts +4 -1
- package/dist/Select/Select.core.d.ts +26 -0
- package/dist/Select/Select.core.vue.js +48 -34
- package/dist/Select/Select.core.vue2.js +53 -25
- package/dist/Select/Select.core.vue3.js +4 -0
- package/dist/Select/Single/Select.single.d.ts +11 -0
- package/dist/Select/Single/Select.single.vue.js +22 -21
- package/dist/Select/Single/Select.single.vue2.js +26 -21
- package/dist/Select/index.d.ts +11 -0
- package/dist/Tooltip/Tooltip.d.ts +12 -0
- package/dist/Tooltip/Tooltip.vue.js +20 -17
- package/dist/Tooltip/Tooltip.vue2.js +44 -39
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -6259,7 +6259,9 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
6259
6259
|
}[];
|
|
6260
6260
|
}>;
|
|
6261
6261
|
resizeSelectedItems: () => Promise<void>;
|
|
6262
|
-
|
|
6262
|
+
inputClass: import('vue').ComputedRef<"" | "AT-ITEMS_input">;
|
|
6263
|
+
checkOverflow: () => Promise<void>;
|
|
6264
|
+
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("input" | "update:modelValue" | "mouseover" | "clickOutside" | "clearInput" | "overflow")[], "input" | "update:modelValue" | "mouseover" | "clickOutside" | "clearInput" | "overflow", import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, Readonly<import('vue').ExtractPropTypes<{
|
|
6263
6265
|
modelValue: {
|
|
6264
6266
|
type: StringConstructor;
|
|
6265
6267
|
required: false;
|
|
@@ -6355,6 +6357,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
6355
6357
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
6356
6358
|
onClickOutside?: ((...args: any[]) => any) | undefined;
|
|
6357
6359
|
onClearInput?: ((...args: any[]) => any) | undefined;
|
|
6360
|
+
onOverflow?: ((...args: any[]) => any) | undefined;
|
|
6358
6361
|
}, {
|
|
6359
6362
|
type: string;
|
|
6360
6363
|
required: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import I from "./Input.core.vue2.js";
|
|
2
|
-
import { resolveComponent as
|
|
2
|
+
import { resolveComponent as C, openBlock as n, createElementBlock as l, createElementVNode as i, createTextVNode as a, toDisplayString as t, createCommentVNode as r, Fragment as k, 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 f from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const $ = ["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 = {
|
|
@@ -13,7 +13,7 @@ const f = ["data-mode", "disabled"], A = ["for"], N = {
|
|
|
13
13
|
class: "AT-INPUT_error-message"
|
|
14
14
|
}, U = ["src"];
|
|
15
15
|
function B(e, s, M, S, z, E) {
|
|
16
|
-
const u =
|
|
16
|
+
const u = C("AtCircleXMarkSolidIcon");
|
|
17
17
|
return n(), l("div", null, [
|
|
18
18
|
i("div", {
|
|
19
19
|
ref: "wrapperEl",
|
|
@@ -36,7 +36,7 @@ function B(e, s, M, S, z, E) {
|
|
|
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(k, null, v(e.selectedItemsController.itemsToRender, (o) => (n(), l("span", {
|
|
40
40
|
key: o.value,
|
|
41
41
|
ref_for: !0,
|
|
42
42
|
ref: "selectedItemsEl",
|
|
@@ -58,6 +58,7 @@ function B(e, s, M, S, z, E) {
|
|
|
58
58
|
id: e.id,
|
|
59
59
|
ref: "inputEl",
|
|
60
60
|
style: { cursor: e.cursor },
|
|
61
|
+
class: e.inputClass,
|
|
61
62
|
disabled: e.$props.disabled || void 0,
|
|
62
63
|
readonly: e.$props.readonly || void 0,
|
|
63
64
|
type: e.type,
|
|
@@ -94,7 +95,7 @@ function B(e, s, M, S, z, E) {
|
|
|
94
95
|
color: e.iconColor
|
|
95
96
|
}, null, 8, ["size", "color"]))
|
|
96
97
|
], 2)) : r("", !0)
|
|
97
|
-
], 40,
|
|
98
|
+
], 40, $),
|
|
98
99
|
e.error.value ? (n(), l("span", h, [
|
|
99
100
|
i("img", {
|
|
100
101
|
src: e.icons.error,
|
|
@@ -104,7 +105,7 @@ function B(e, s, M, S, z, E) {
|
|
|
104
105
|
])) : r("", !0)
|
|
105
106
|
]);
|
|
106
107
|
}
|
|
107
|
-
const X = /* @__PURE__ */
|
|
108
|
+
const X = /* @__PURE__ */ f(I, [["render", B], ["__scopeId", "data-v-5ed72fcb"]]);
|
|
108
109
|
export {
|
|
109
110
|
X as default
|
|
110
111
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { AtCircleXMarkSolidIcon as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as P, ref as u, computed as i, onMounted as X, onBeforeUnmount as H, watchEffect as G, watch as B, nextTick as b } from "vue";
|
|
2
|
+
import { AtCircleXMarkSolidIcon as J } from "../node_modules/.pnpm/@agrotools1_at-icons@0.2.11/node_modules/@agrotools1/at-icons/dist/AtCircleXMarkSolidIcon/index.js";
|
|
3
|
+
import K from "../Icons/icons.js";
|
|
4
|
+
import Q from "./imgs/error.svg.js";
|
|
5
|
+
const ee = P({
|
|
6
6
|
name: "AtCoreInput",
|
|
7
7
|
components: {
|
|
8
|
-
AtCircleXMarkSolidIcon:
|
|
8
|
+
AtCircleXMarkSolidIcon: J
|
|
9
9
|
},
|
|
10
10
|
props: {
|
|
11
11
|
modelValue: {
|
|
@@ -99,125 +99,140 @@ const Z = z({
|
|
|
99
99
|
"input",
|
|
100
100
|
"clickOutside",
|
|
101
101
|
"clearInput",
|
|
102
|
-
"mouseover"
|
|
102
|
+
"mouseover",
|
|
103
|
+
"overflow"
|
|
103
104
|
],
|
|
104
|
-
setup(e, { emit:
|
|
105
|
-
const
|
|
106
|
-
() => e.useClearButton && a.value && e.modelValue && !
|
|
107
|
-
),
|
|
108
|
-
() => e.useSideClearButton && !e.useClearButton && e.modelValue && !
|
|
109
|
-
),
|
|
105
|
+
setup(e, { emit: s }) {
|
|
106
|
+
const q = { ...K }, E = u(null), f = u(null), v = u(null), S = u(null), F = i(() => e.error), a = u(!1), d = u(""), c = u(!1), L = u(!1), k = i(
|
|
107
|
+
() => e.useClearButton && a.value && e.modelValue && !c.value
|
|
108
|
+
), T = i(
|
|
109
|
+
() => e.useSideClearButton && !e.useClearButton && e.modelValue && !c.value
|
|
110
|
+
), h = u({
|
|
110
111
|
supportedItems: e.selectedItems.length,
|
|
111
112
|
isCounterActive: !1,
|
|
112
113
|
itemsToRender: e.selectedItems
|
|
113
|
-
}),
|
|
114
|
+
}), _ = Math.random().toString(36).substring(2), o = u(!1), W = () => {
|
|
114
115
|
o.value = !0;
|
|
115
|
-
},
|
|
116
|
+
}, x = () => {
|
|
116
117
|
o.value = !1;
|
|
117
118
|
}, g = () => {
|
|
118
119
|
a.value = !0;
|
|
119
|
-
},
|
|
120
|
-
e.forceFocus || (e.forceEventClearButton ? a.value = !0 :
|
|
120
|
+
}, m = () => {
|
|
121
|
+
e.forceFocus || (e.forceEventClearButton ? a.value = !0 : A(() => {
|
|
121
122
|
a.value = !1;
|
|
122
123
|
}, 100)());
|
|
123
|
-
},
|
|
124
|
-
var
|
|
125
|
-
|
|
126
|
-
const t = (
|
|
124
|
+
}, I = async () => {
|
|
125
|
+
var M;
|
|
126
|
+
h.value.itemsToRender = e.selectedItems, await b();
|
|
127
|
+
const t = (M = v.value) == null ? void 0 : M.clientWidth;
|
|
127
128
|
if (t === void 0)
|
|
128
129
|
return;
|
|
129
130
|
let l = 50, n = 0;
|
|
130
|
-
const r =
|
|
131
|
+
const r = S.value;
|
|
131
132
|
if (r)
|
|
132
|
-
for (let
|
|
133
|
-
l += r[
|
|
134
|
-
let
|
|
135
|
-
l >= t ?
|
|
133
|
+
for (let y = 0; y < r.length; y++)
|
|
134
|
+
l += r[y].clientWidth + 10, l <= t && (n = y + 1);
|
|
135
|
+
let w;
|
|
136
|
+
l >= t ? w = {
|
|
136
137
|
isCounterActive: l > (t || 0),
|
|
137
138
|
supportedItems: n,
|
|
138
139
|
itemsToRender: e.selectedItems.slice(0, n)
|
|
139
|
-
} :
|
|
140
|
+
} : w = {
|
|
140
141
|
isCounterActive: l > (t || 0),
|
|
141
142
|
supportedItems: e.selectedItems.length,
|
|
142
143
|
itemsToRender: e.selectedItems
|
|
143
|
-
},
|
|
144
|
-
},
|
|
144
|
+
}, h.value = w;
|
|
145
|
+
}, O = (t) => {
|
|
145
146
|
var l, n;
|
|
146
|
-
!((l =
|
|
147
|
+
!((l = E.value) != null && l.contains(t.target)) && !((n = f.value) != null && n.contains(t.target)) && !k.value && !c.value && (m(), a.value = !1, s("clickOutside"));
|
|
148
|
+
}, C = async () => {
|
|
149
|
+
if (await b(), f.value) {
|
|
150
|
+
const t = f.value.scrollWidth > f.value.clientWidth;
|
|
151
|
+
L.value = t, s("overflow", t);
|
|
152
|
+
}
|
|
147
153
|
};
|
|
148
|
-
|
|
154
|
+
X(() => {
|
|
149
155
|
var t;
|
|
150
|
-
(e.modelValue !== void 0 && ((t = e.modelValue) != null && t.length) || e.forceFocus) && g(), document.addEventListener("click",
|
|
151
|
-
}),
|
|
152
|
-
document.removeEventListener("click",
|
|
156
|
+
(e.modelValue !== void 0 && ((t = e.modelValue) != null && t.length) || e.forceFocus) && g(), document.addEventListener("click", O), window.addEventListener("resize", I);
|
|
157
|
+
}), H(() => {
|
|
158
|
+
document.removeEventListener("click", O), window.removeEventListener("resize", I);
|
|
153
159
|
});
|
|
154
|
-
const
|
|
160
|
+
const R = (t) => {
|
|
155
161
|
e.preventInputEvent && t.preventDefault();
|
|
156
162
|
const l = t.target.value;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
163
|
+
s("input", t), e.debounce > 0 ? A(() => V(l), e.debounce)() : V(l), b(() => {
|
|
164
|
+
C();
|
|
165
|
+
});
|
|
166
|
+
}, V = (t) => {
|
|
167
|
+
s("update:modelValue", t), e.modelValue === void 0 && (d.value = t);
|
|
160
168
|
};
|
|
161
|
-
function
|
|
169
|
+
function A(t, l) {
|
|
162
170
|
let n;
|
|
163
171
|
return function() {
|
|
164
172
|
clearTimeout(n), n = setTimeout(t, l);
|
|
165
173
|
};
|
|
166
174
|
}
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
e.forceEventClearButton ||
|
|
175
|
+
const j = () => {
|
|
176
|
+
c.value = !0, a.value = !1, s("clearInput"), setTimeout(() => {
|
|
177
|
+
e.forceEventClearButton || V(""), c.value = !1;
|
|
170
178
|
}, 100);
|
|
171
179
|
};
|
|
172
|
-
|
|
180
|
+
G(() => {
|
|
173
181
|
var t, l;
|
|
174
|
-
e.separator && ((e.modelValue !== void 0 ? e.modelValue.split(e.separator).filter((r) => r.length > 1) :
|
|
175
|
-
}),
|
|
182
|
+
e.separator && ((e.modelValue !== void 0 ? e.modelValue.split(e.separator).filter((r) => r.length > 1) : d.value.split(e.separator).filter((r) => r.length > 1)).length ? (t = v.value) == null || t.classList.remove("AT-INPUT_items_empty") : ((l = v.value) == null || l.classList.add("AT-INPUT_items_empty"), m(), a.value = !1)), e.forceFocus ? g() : (m(), a.value = !1);
|
|
183
|
+
}), B(
|
|
176
184
|
() => e.selectedItems,
|
|
177
185
|
async () => {
|
|
178
|
-
await
|
|
186
|
+
await I();
|
|
179
187
|
},
|
|
180
188
|
{ deep: !0 }
|
|
181
|
-
),
|
|
189
|
+
), B(
|
|
182
190
|
() => o.value,
|
|
183
191
|
() => {
|
|
184
|
-
|
|
192
|
+
s("mouseover", o.value);
|
|
193
|
+
}
|
|
194
|
+
), B(
|
|
195
|
+
() => e.modelValue,
|
|
196
|
+
() => {
|
|
197
|
+
C();
|
|
185
198
|
}
|
|
186
199
|
);
|
|
187
|
-
const
|
|
200
|
+
const z = i(() => {
|
|
188
201
|
var t;
|
|
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 ||
|
|
190
|
-
}),
|
|
202
|
+
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 || d.value.length > 0 ? "var(--at-black)" : "var(--at-dark-grey)";
|
|
203
|
+
}), N = i(() => 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 || d.value.length > 0 ? "filled" : "default"), U = i(() => e.modelValue !== void 0 ? e.modelValue : d.value ? d.value : null), D = i(() => T.value === !0 ? "AT-ITEMS_input" : "");
|
|
191
204
|
return {
|
|
192
|
-
wrapperEl:
|
|
193
|
-
inputEl:
|
|
194
|
-
inputError:
|
|
195
|
-
inputId: e.id ??
|
|
205
|
+
wrapperEl: E,
|
|
206
|
+
inputEl: f,
|
|
207
|
+
inputError: F,
|
|
208
|
+
inputId: e.id ?? _,
|
|
196
209
|
handleOnFocus: g,
|
|
197
|
-
handleOnFocusOut:
|
|
210
|
+
handleOnFocusOut: m,
|
|
198
211
|
icons: {
|
|
199
|
-
error:
|
|
200
|
-
...
|
|
212
|
+
error: Q,
|
|
213
|
+
...q
|
|
201
214
|
},
|
|
202
|
-
clickedClear:
|
|
203
|
-
showClearButton:
|
|
204
|
-
showSideClearButton:
|
|
205
|
-
clearInput:
|
|
206
|
-
containerItemsEl:
|
|
207
|
-
onInput:
|
|
208
|
-
iconColor:
|
|
215
|
+
clickedClear: c,
|
|
216
|
+
showClearButton: k,
|
|
217
|
+
showSideClearButton: T,
|
|
218
|
+
clearInput: j,
|
|
219
|
+
containerItemsEl: v,
|
|
220
|
+
onInput: R,
|
|
221
|
+
iconColor: z,
|
|
209
222
|
isFocused: a,
|
|
210
|
-
handleMouseOver:
|
|
211
|
-
handleMouseLeave:
|
|
223
|
+
handleMouseOver: W,
|
|
224
|
+
handleMouseLeave: x,
|
|
212
225
|
isHovered: o,
|
|
213
|
-
inputComputedValue:
|
|
214
|
-
currentMode:
|
|
215
|
-
selectedItemsEl:
|
|
216
|
-
selectedItemsController:
|
|
217
|
-
resizeSelectedItems:
|
|
226
|
+
inputComputedValue: U,
|
|
227
|
+
currentMode: N,
|
|
228
|
+
selectedItemsEl: S,
|
|
229
|
+
selectedItemsController: h,
|
|
230
|
+
resizeSelectedItems: I,
|
|
231
|
+
inputClass: D,
|
|
232
|
+
checkOverflow: C
|
|
218
233
|
};
|
|
219
234
|
}
|
|
220
235
|
});
|
|
221
236
|
export {
|
|
222
|
-
|
|
237
|
+
ee as default
|
|
223
238
|
};
|
package/dist/Input/index.d.ts
CHANGED
|
@@ -6246,7 +6246,9 @@ export declare const AtInput: {
|
|
|
6246
6246
|
}[];
|
|
6247
6247
|
}>;
|
|
6248
6248
|
resizeSelectedItems: () => Promise<void>;
|
|
6249
|
-
|
|
6249
|
+
inputClass: import('vue').ComputedRef<"" | "AT-ITEMS_input">;
|
|
6250
|
+
checkOverflow: () => Promise<void>;
|
|
6251
|
+
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("input" | "update:modelValue" | "mouseover" | "clickOutside" | "clearInput" | "overflow")[], "input" | "update:modelValue" | "mouseover" | "clickOutside" | "clearInput" | "overflow", import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, Readonly<import('vue').ExtractPropTypes<{
|
|
6250
6252
|
modelValue: {
|
|
6251
6253
|
type: StringConstructor;
|
|
6252
6254
|
required: false;
|
|
@@ -6348,6 +6350,7 @@ export declare const AtInput: {
|
|
|
6348
6350
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
6349
6351
|
onClickOutside?: ((...args: any[]) => any) | undefined;
|
|
6350
6352
|
onClearInput?: ((...args: any[]) => any) | undefined;
|
|
6353
|
+
onOverflow?: ((...args: any[]) => any) | undefined;
|
|
6351
6354
|
}, {
|
|
6352
6355
|
type: string;
|
|
6353
6356
|
required: boolean;
|
|
@@ -63,6 +63,17 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
63
63
|
required: false;
|
|
64
64
|
default: boolean;
|
|
65
65
|
};
|
|
66
|
+
showTooltipOnOverflow: {
|
|
67
|
+
type: BooleanConstructor;
|
|
68
|
+
required: false;
|
|
69
|
+
default: boolean;
|
|
70
|
+
};
|
|
71
|
+
tooltipPosition: {
|
|
72
|
+
required: false;
|
|
73
|
+
type: () => "bottom-left" | "bottom-center" | "bottom-right" | "top-left" | "top-center" | "top-right" | "left-bottom" | "left-center" | "right-bottom" | "right-center" | undefined;
|
|
74
|
+
default: string;
|
|
75
|
+
validator: (value: string) => boolean;
|
|
76
|
+
};
|
|
66
77
|
}, {
|
|
67
78
|
id: string;
|
|
68
79
|
handleValue: () => string;
|
|
@@ -78,6 +89,8 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
78
89
|
type: import('vue').ComputedRef<"button" | undefined>;
|
|
79
90
|
inputClass: string;
|
|
80
91
|
isTypable: boolean;
|
|
92
|
+
isOverflowing: import('vue').Ref<boolean>;
|
|
93
|
+
handleOverflow: (value: boolean) => void;
|
|
81
94
|
}, 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<{
|
|
82
95
|
value: {
|
|
83
96
|
type: PropType<string | SelectItemProps>;
|
|
@@ -130,6 +143,17 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
130
143
|
required: false;
|
|
131
144
|
default: boolean;
|
|
132
145
|
};
|
|
146
|
+
showTooltipOnOverflow: {
|
|
147
|
+
type: BooleanConstructor;
|
|
148
|
+
required: false;
|
|
149
|
+
default: boolean;
|
|
150
|
+
};
|
|
151
|
+
tooltipPosition: {
|
|
152
|
+
required: false;
|
|
153
|
+
type: () => "bottom-left" | "bottom-center" | "bottom-right" | "top-left" | "top-center" | "top-right" | "left-bottom" | "left-center" | "right-bottom" | "right-center" | undefined;
|
|
154
|
+
default: string;
|
|
155
|
+
validator: (value: string) => boolean;
|
|
156
|
+
};
|
|
133
157
|
}>> & {
|
|
134
158
|
onClearInput?: ((...args: any[]) => any) | undefined;
|
|
135
159
|
"onUpdate:model-value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -143,5 +167,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
143
167
|
isMultiple: boolean;
|
|
144
168
|
customClass: string;
|
|
145
169
|
isTypable: boolean;
|
|
170
|
+
showTooltipOnOverflow: boolean;
|
|
171
|
+
tooltipPosition: "bottom-left" | "bottom-center" | "bottom-right" | "top-left" | "top-center" | "top-right" | "left-bottom" | "left-center" | "right-bottom" | "right-center" | undefined;
|
|
146
172
|
}, {}>;
|
|
147
173
|
export default _default;
|
|
@@ -1,37 +1,51 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
e.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import i from "./Select.core.vue2.js";
|
|
2
|
+
import { resolveComponent as l, openBlock as s, createElementBlock as d, createVNode as t, withCtx as p, mergeProps as u } from "vue";
|
|
3
|
+
import "./Select.core.vue3.js";
|
|
4
|
+
import m from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
function c(e, o, f, b, C, v) {
|
|
6
|
+
const n = l("AtInput"), r = l("AtTooltip");
|
|
7
|
+
return s(), d("div", null, [
|
|
8
|
+
t(r, {
|
|
9
|
+
disable: !e.isOverflowing || !e.showTooltipOnOverflow,
|
|
10
|
+
text: e.inputModelValue,
|
|
11
|
+
position: e.tooltipPosition,
|
|
12
|
+
style: { width: "100%" }
|
|
13
|
+
}, {
|
|
14
|
+
default: p(() => [
|
|
15
|
+
t(n, u(e.$props, {
|
|
16
|
+
ref: "atInput",
|
|
17
|
+
modelValue: e.inputModelValue,
|
|
18
|
+
"onUpdate:modelValue": [
|
|
19
|
+
o[0] || (o[0] = (a) => e.inputModelValue = a),
|
|
20
|
+
e.handleTyping
|
|
21
|
+
],
|
|
22
|
+
role: "combobox",
|
|
23
|
+
type: e.type,
|
|
24
|
+
cursor: "pointer",
|
|
25
|
+
"prevent-input-event": !0,
|
|
26
|
+
"on-selected-item-click": e.onSelectedItemClick,
|
|
27
|
+
"selected-items": e.selectedItems,
|
|
28
|
+
label: e.label,
|
|
29
|
+
"aria-controls": e.id,
|
|
30
|
+
"aria-label": e.label,
|
|
31
|
+
separator: e.separator,
|
|
32
|
+
required: e.required,
|
|
33
|
+
disabled: e.disabled,
|
|
34
|
+
error: e.getError,
|
|
35
|
+
icon: { name: "AtAngleDownSolidIcon" },
|
|
36
|
+
"aria-autocomplete": "none",
|
|
37
|
+
class: ["AT-SELECT_container", e.inputClass],
|
|
38
|
+
"use-side-clear-button": e.showClearButton,
|
|
39
|
+
onClearInput: e.handleClearInput,
|
|
40
|
+
onClickOutside: e.handleClickOutside,
|
|
41
|
+
onOverflow: e.handleOverflow
|
|
42
|
+
}), 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", "onOverflow"])
|
|
43
|
+
]),
|
|
44
|
+
_: 1
|
|
45
|
+
}, 8, ["disable", "text", "position"])
|
|
46
|
+
]);
|
|
33
47
|
}
|
|
34
|
-
const
|
|
48
|
+
const A = /* @__PURE__ */ m(i, [["render", c], ["__scopeId", "data-v-ade5f307"]]);
|
|
35
49
|
export {
|
|
36
|
-
|
|
50
|
+
A as default
|
|
37
51
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { AtInput as
|
|
1
|
+
import { defineComponent as h, ref as o, computed as u, watch as g, inject as I } from "vue";
|
|
2
|
+
import { AtInput as T } from "../Input/index.js";
|
|
3
|
+
import q from "../Tooltip/Tooltip.vue.js";
|
|
3
4
|
import "./Item/Item.vue2.js";
|
|
4
5
|
import "./Item/Item.vue3.js";
|
|
5
|
-
const
|
|
6
|
+
const A = h({
|
|
6
7
|
name: "AtSelect",
|
|
7
8
|
components: {
|
|
8
|
-
AtInput:
|
|
9
|
+
AtInput: T.Text,
|
|
10
|
+
AtTooltip: q
|
|
9
11
|
},
|
|
10
12
|
props: {
|
|
11
13
|
value: {
|
|
@@ -58,55 +60,81 @@ const S = m({
|
|
|
58
60
|
type: Boolean,
|
|
59
61
|
required: !1,
|
|
60
62
|
default: !1
|
|
63
|
+
},
|
|
64
|
+
showTooltipOnOverflow: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
required: !1,
|
|
67
|
+
default: !1
|
|
68
|
+
},
|
|
69
|
+
tooltipPosition: {
|
|
70
|
+
required: !1,
|
|
71
|
+
type: String,
|
|
72
|
+
default: "bottom-center",
|
|
73
|
+
validator: (e) => [
|
|
74
|
+
"bottom-left",
|
|
75
|
+
"bottom-center",
|
|
76
|
+
"bottom-right",
|
|
77
|
+
"top-left",
|
|
78
|
+
"top-center",
|
|
79
|
+
"top-right",
|
|
80
|
+
"left-bottom",
|
|
81
|
+
"left-center",
|
|
82
|
+
"right-bottom",
|
|
83
|
+
"right-center"
|
|
84
|
+
].includes(e)
|
|
61
85
|
}
|
|
62
86
|
},
|
|
63
87
|
emits: ["update:model-value", "clearInput"],
|
|
64
88
|
setup(e, { emit: a }) {
|
|
65
|
-
const
|
|
89
|
+
const d = o(null), l = o(""), r = u(() => {
|
|
66
90
|
var t;
|
|
67
91
|
return typeof e.value == "string" ? e.value : (t = e.value) == null ? void 0 : t.value;
|
|
68
|
-
}),
|
|
92
|
+
}), i = o(!1), f = u(() => {
|
|
69
93
|
if (!e.isTypable)
|
|
70
94
|
return "button";
|
|
71
|
-
}),
|
|
95
|
+
}), c = (t) => {
|
|
72
96
|
a("update:model-value", t);
|
|
73
|
-
}, c = () => {
|
|
74
|
-
a("clearInput");
|
|
75
97
|
}, p = () => {
|
|
98
|
+
a("clearInput");
|
|
99
|
+
}, m = () => {
|
|
76
100
|
!e.value && e.isTypable && (l.value = "", a("clearInput"));
|
|
77
|
-
},
|
|
78
|
-
var
|
|
101
|
+
}, n = () => {
|
|
102
|
+
var s;
|
|
79
103
|
if (e.isMultiple)
|
|
80
104
|
return "";
|
|
81
|
-
const t = (
|
|
82
|
-
(
|
|
105
|
+
const t = (s = e.items) == null ? void 0 : s.find(
|
|
106
|
+
(b) => b.value === r.value
|
|
83
107
|
);
|
|
84
108
|
return t ? t.text : (console.warn(
|
|
85
109
|
`The default value "${r.value}" is not included in the items array.`
|
|
86
110
|
), "");
|
|
111
|
+
}, v = (t) => {
|
|
112
|
+
i.value = t;
|
|
87
113
|
};
|
|
88
|
-
|
|
114
|
+
g(
|
|
89
115
|
() => e.value,
|
|
90
116
|
() => {
|
|
91
|
-
e.value !== "" && (l.value =
|
|
117
|
+
e.value !== "" && (l.value = n() || "");
|
|
92
118
|
}
|
|
93
|
-
), l.value =
|
|
94
|
-
const y =
|
|
119
|
+
), l.value = n() || "";
|
|
120
|
+
const y = u(() => I("error"));
|
|
95
121
|
return {
|
|
96
122
|
id: `at-select-${Math.random().toString(36).substr(2, 9)}`,
|
|
97
|
-
handleValue:
|
|
123
|
+
handleValue: n,
|
|
98
124
|
getError: y,
|
|
99
|
-
atInput:
|
|
125
|
+
atInput: d,
|
|
100
126
|
inputModelValue: l,
|
|
101
|
-
handleTyping:
|
|
102
|
-
handleClearInput:
|
|
103
|
-
handleClickOutside:
|
|
104
|
-
type:
|
|
127
|
+
handleTyping: c,
|
|
128
|
+
handleClearInput: p,
|
|
129
|
+
handleClickOutside: m,
|
|
130
|
+
type: f,
|
|
105
131
|
inputClass: e.customClass,
|
|
106
|
-
isTypable: e.isTypable
|
|
132
|
+
isTypable: e.isTypable,
|
|
133
|
+
isOverflowing: i,
|
|
134
|
+
handleOverflow: v
|
|
107
135
|
};
|
|
108
136
|
}
|
|
109
137
|
});
|
|
110
138
|
export {
|
|
111
|
-
|
|
139
|
+
A as default
|
|
112
140
|
};
|
|
@@ -44,6 +44,11 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
44
44
|
type: BooleanConstructor;
|
|
45
45
|
default: boolean;
|
|
46
46
|
};
|
|
47
|
+
showTooltipOnOverflow: {
|
|
48
|
+
type: BooleanConstructor;
|
|
49
|
+
required: false;
|
|
50
|
+
default: boolean;
|
|
51
|
+
};
|
|
47
52
|
error: {
|
|
48
53
|
type: ObjectConstructor;
|
|
49
54
|
default: () => void;
|
|
@@ -125,6 +130,11 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
125
130
|
type: BooleanConstructor;
|
|
126
131
|
default: boolean;
|
|
127
132
|
};
|
|
133
|
+
showTooltipOnOverflow: {
|
|
134
|
+
type: BooleanConstructor;
|
|
135
|
+
required: false;
|
|
136
|
+
default: boolean;
|
|
137
|
+
};
|
|
128
138
|
error: {
|
|
129
139
|
type: ObjectConstructor;
|
|
130
140
|
default: () => void;
|
|
@@ -146,6 +156,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
146
156
|
items: SelectItemProps[];
|
|
147
157
|
showClearButton: boolean;
|
|
148
158
|
msgNoResult: string;
|
|
159
|
+
showTooltipOnOverflow: boolean;
|
|
149
160
|
emitValue: boolean;
|
|
150
161
|
hasAutocomplete: boolean;
|
|
151
162
|
}, {}>;
|