@agrotools1/at-components 0.6.37 → 0.6.38
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.
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import l from "./Search.vue2.js";
|
|
2
|
-
import { resolveComponent as o, openBlock as s, createElementBlock as t, normalizeClass as u, createVNode as n, withCtx as
|
|
2
|
+
import { resolveComponent as o, openBlock as s, createElementBlock as t, normalizeClass as u, createVNode as n, withCtx as d, mergeProps as i, createCommentVNode as p } from "vue";
|
|
3
3
|
import "./Search.vue3.js";
|
|
4
4
|
import m from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
5
|
const c = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "spinner"
|
|
8
8
|
};
|
|
9
|
-
function
|
|
9
|
+
function f(e, h, b, g, I, C) {
|
|
10
10
|
const r = o("AtInput"), a = o("AtLista");
|
|
11
11
|
return s(), t("section", {
|
|
12
12
|
ref: "atSearch",
|
|
@@ -22,8 +22,8 @@ function h(e, f, b, g, I, C) {
|
|
|
22
22
|
style: { "max-height": "200px" },
|
|
23
23
|
onOnSave: e.handleSelectedItem
|
|
24
24
|
}, {
|
|
25
|
-
default:
|
|
26
|
-
n(r,
|
|
25
|
+
default: d(() => [
|
|
26
|
+
n(r, i({
|
|
27
27
|
id: e.label,
|
|
28
28
|
label: e.label,
|
|
29
29
|
"model-value": e.modelValue,
|
|
@@ -46,7 +46,7 @@ function h(e, f, b, g, I, C) {
|
|
|
46
46
|
}, 8, ["id", "drop-down-list", "is-open", "show-no-result-message", "msg-no-result", "onOnSave"])
|
|
47
47
|
], 2);
|
|
48
48
|
}
|
|
49
|
-
const V = /* @__PURE__ */ m(l, [["render",
|
|
49
|
+
const V = /* @__PURE__ */ m(l, [["render", f], ["__scopeId", "data-v-efb32df0"]]);
|
|
50
50
|
export {
|
|
51
51
|
V as default
|
|
52
52
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as B, ref as s, computed as
|
|
1
|
+
import { defineComponent as B, ref as s, computed as n } from "vue";
|
|
2
2
|
import { AtCircleXMarkSolidIcon as O } from "../node_modules/.pnpm/agrotools-icons@0.2.6/node_modules/agrotools-icons/dist/AtCircleXMarkSolidIcon/index.js";
|
|
3
3
|
import { AtSearchIcon as b } from "../node_modules/.pnpm/agrotools-icons@0.2.6/node_modules/agrotools-icons/dist/AtSearchIcon/index.js";
|
|
4
4
|
import { AtInput as x } from "../Input/index.js";
|
|
@@ -73,21 +73,21 @@ const F = {
|
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
emits: ["update:modelValue", "onSelectedItem", "onClear"],
|
|
76
|
-
setup(t, { emit:
|
|
77
|
-
const r = s([]), c = s(!1), u = s(null), v =
|
|
76
|
+
setup(t, { emit: a }) {
|
|
77
|
+
const r = s([]), c = s(!1), u = s(null), v = n(
|
|
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
|
), m = (e = "false") => {
|
|
83
|
-
var
|
|
83
|
+
var l;
|
|
84
84
|
if (t.arrowIcon) {
|
|
85
|
-
const d = (
|
|
85
|
+
const d = (l = u.value) == null ? void 0 : l.querySelector(".AT_INPUT_icon_slot");
|
|
86
86
|
if (!(d instanceof HTMLElement))
|
|
87
87
|
return;
|
|
88
88
|
d.setAttribute("data-rotate", e);
|
|
89
89
|
}
|
|
90
|
-
}, S =
|
|
90
|
+
}, S = n(
|
|
91
91
|
() => t.arrowIcon ? { name: "AtAngleDownSolidIcon" } : { name: "AtSearchIcon" }
|
|
92
92
|
), y = () => {
|
|
93
93
|
var e;
|
|
@@ -97,37 +97,37 @@ const F = {
|
|
|
97
97
|
setTimeout(() => {
|
|
98
98
|
c.value = !1;
|
|
99
99
|
}, 200), (e = u.value) == null || e.classList.remove("focused"), m();
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
}, p =
|
|
100
|
+
}, o = s(!1), A = async (e) => {
|
|
101
|
+
a("update:modelValue", e), t.searchEndpoint && (o.value = !0, r.value = await t.searchEndpoint(e), o.value = !1);
|
|
102
|
+
}, p = n(() => {
|
|
103
103
|
var e;
|
|
104
104
|
if (t.hasFilterOption) {
|
|
105
|
-
const
|
|
105
|
+
const l = (f, h) => f.text.toUpperCase().includes(h.toUpperCase());
|
|
106
106
|
return t.autoCompleteList.filter(
|
|
107
|
-
(f) =>
|
|
107
|
+
(f) => l(f, t.modelValue)
|
|
108
108
|
);
|
|
109
109
|
}
|
|
110
110
|
return (e = r.value) != null && e.length ? r.value : t.autoCompleteList;
|
|
111
111
|
}), i = s(), L = (e) => {
|
|
112
|
-
const
|
|
113
|
-
i.value = e,
|
|
112
|
+
const l = e.text;
|
|
113
|
+
i.value = e, a("onSelectedItem", e), a("update:modelValue", l);
|
|
114
114
|
}, C = () => {
|
|
115
|
-
|
|
116
|
-
}, I =
|
|
117
|
-
() => t.withIcon &&
|
|
118
|
-
),
|
|
115
|
+
a("onSelectedItem", null), a("onClear"), a("update:modelValue", ""), o.value = !1, i.value = null;
|
|
116
|
+
}, I = n(
|
|
117
|
+
() => t.withIcon && o.value && !i.value || t.isLoading
|
|
118
|
+
), V = n(
|
|
119
119
|
() => t.isDisabled ? "var(--at-medium-grey)" : ""
|
|
120
|
-
),
|
|
121
|
-
() => !!t.modelValue && !
|
|
120
|
+
), w = n(
|
|
121
|
+
() => !!t.modelValue && !o.value
|
|
122
122
|
);
|
|
123
123
|
return {
|
|
124
124
|
atSearch: u,
|
|
125
125
|
autocompleteListIsOpen: v,
|
|
126
126
|
autoCompleteListFiltered: p,
|
|
127
|
-
isLoading:
|
|
127
|
+
isLoading: o,
|
|
128
128
|
showSearchIcon: I,
|
|
129
|
-
getShowNoResultMessage:
|
|
130
|
-
getSearchIconColor:
|
|
129
|
+
getShowNoResultMessage: w,
|
|
130
|
+
getSearchIconColor: V,
|
|
131
131
|
getInputIcon: S,
|
|
132
132
|
clear: C,
|
|
133
133
|
openList: y,
|