@agrotools1/at-components 0.6.37 → 0.6.39

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.
@@ -2,10 +2,10 @@ import m from "./Input.core.vue2.js";
2
2
  import { resolveComponent as I, openBlock as n, createElementBlock as l, createElementVNode as r, createTextVNode as u, toDisplayString as i, createCommentVNode as d, Fragment as v, renderList as k, mergeProps as C, normalizeClass as T, createBlock as p, resolveDynamicComponent as y } from "vue";
3
3
  import "./Input.core.vue3.js";
4
4
  import f from "../_virtual/_plugin-vue_export-helper.js";
5
- const $ = ["data-mode", "disabled"], b = ["for"], h = {
5
+ const $ = ["data-mode", "disabled"], h = ["for"], A = {
6
6
  key: 0,
7
7
  class: "AT-INPUT_required"
8
- }, A = ["title"], F = { class: "AT-INPUT_item_slot" }, N = ["onClick"], O = {
8
+ }, F = ["title"], N = { class: "AT-INPUT_item_slot" }, O = ["onClick"], b = {
9
9
  key: 0,
10
10
  class: "AT-INPUT_items_length"
11
11
  }, g = ["id", "disabled", "readonly", "type", "placeholder", "name", "value"], P = {
@@ -28,8 +28,8 @@ function U(e, s, B, E, z, S) {
28
28
  onClick: s[0] || (s[0] = (...o) => e.handleOnFocus && e.handleOnFocus(...o))
29
29
  }, [
30
30
  u(i(e.label) + " ", 1),
31
- e.$props.required ? (n(), l("span", h, "*")) : d("", !0)
32
- ], 8, b),
31
+ e.$props.required ? (n(), l("span", A, "*")) : d("", !0)
32
+ ], 8, h),
33
33
  e.separator ? (n(), l("div", {
34
34
  key: 0,
35
35
  ref: "containerItemsEl",
@@ -43,7 +43,7 @@ function U(e, s, B, E, z, S) {
43
43
  title: o.text,
44
44
  class: "AT-INPUT_item"
45
45
  }, [
46
- r("span", F, i(o.text), 1),
46
+ r("span", N, i(o.text), 1),
47
47
  r("span", {
48
48
  class: "AT-INPUT_item_slot_x",
49
49
  style: { padding: "1px 5px" },
@@ -51,9 +51,9 @@ function U(e, s, B, E, z, S) {
51
51
  var t;
52
52
  (t = e.onSelectedItemClick) == null || t.call(e, o == null ? void 0 : o.value);
53
53
  }
54
- }, "x", 8, N)
55
- ], 8, A))), 128)),
56
- e.selectedItems.length > e.selectedItemsController.supportedItems ? (n(), l("span", O, "+ " + i(e.selectedItems.length - e.selectedItemsController.supportedItems), 1)) : d("", !0)
54
+ }, "x", 8, O)
55
+ ], 8, F))), 128)),
56
+ e.selectedItems.length > e.selectedItemsController.supportedItems ? (n(), l("span", b, "+ " + i(e.selectedItems.length - e.selectedItemsController.supportedItems), 1)) : d("", !0)
57
57
  ], 512)) : (n(), l("input", C({ key: 1 }, e.$attrs, {
58
58
  id: e.id,
59
59
  ref: "inputEl",
@@ -93,7 +93,7 @@ function U(e, s, B, E, z, S) {
93
93
  ])) : d("", !0)
94
94
  ]);
95
95
  }
96
- const D = /* @__PURE__ */ f(m, [["render", U], ["__scopeId", "data-v-e3bd096b"]]);
96
+ const D = /* @__PURE__ */ f(m, [["render", U], ["__scopeId", "data-v-65f8dafb"]]);
97
97
  export {
98
98
  D as default
99
99
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as j, ref as u, computed as s, onMounted as z, onBeforeUnmount as N, watchEffect as U, watch as S, nextTick as D } from "vue";
1
+ import { defineComponent as j, ref as u, computed as c, onMounted as z, onBeforeUnmount as N, watchEffect as U, watch as T, nextTick as D } from "vue";
2
2
  import { AtCircleXMarkSolidIcon as P } from "../node_modules/.pnpm/agrotools-icons@0.2.6/node_modules/agrotools-icons/dist/AtCircleXMarkSolidIcon/index.js";
3
3
  import X from "../Icons/icons.js";
4
4
  import H from "./imgs/error.svg.js";
@@ -98,8 +98,8 @@ const Y = j({
98
98
  "mouseover"
99
99
  ],
100
100
  setup(e, { emit: d }) {
101
- const T = { ...X }, b = u(null), V = u(null), c = u(null), E = u(null), A = s(() => e.error), a = u(!1), i = u(""), f = u(!1), O = s(
102
- () => e.useClearButton && a.value && e.modelValue && !f.value
101
+ const A = { ...X }, b = u(null), V = u(null), f = u(null), E = u(null), O = c(() => e.error), a = u(!1), i = u(""), s = u(!1), k = c(
102
+ () => e.useClearButton && a.value && e.modelValue && !s.value
103
103
  ), y = u({
104
104
  supportedItems: e.selectedItems.length,
105
105
  isCounterActive: !1,
@@ -111,13 +111,13 @@ const Y = j({
111
111
  }, g = () => {
112
112
  a.value = !0;
113
113
  }, v = () => {
114
- e.forceFocus || (e.forceEventClearButton ? a.value = !0 : B(() => {
114
+ e.forceFocus || (e.forceEventClearButton ? a.value = !0 : w(() => {
115
115
  a.value = !1;
116
116
  }, 100)());
117
117
  }, m = async () => {
118
- var w;
118
+ var S;
119
119
  y.value.itemsToRender = e.selectedItems, await D();
120
- const t = (w = c.value) == null ? void 0 : w.clientWidth;
120
+ const t = (S = f.value) == null ? void 0 : S.clientWidth;
121
121
  if (t === void 0)
122
122
  return;
123
123
  let l = 50, n = 0;
@@ -135,68 +135,68 @@ const Y = j({
135
135
  supportedItems: e.selectedItems.length,
136
136
  itemsToRender: e.selectedItems
137
137
  }, y.value = C;
138
- }, k = (t) => {
138
+ }, B = (t) => {
139
139
  var l, n;
140
- !((l = b.value) != null && l.contains(t.target)) && !((n = V.value) != null && n.contains(t.target)) && (v(), a.value = !1, d("clickOutside"));
140
+ !((l = b.value) != null && l.contains(t.target)) && !((n = V.value) != null && n.contains(t.target)) && !k.value && !s.value && (v(), a.value = !1, d("clickOutside"));
141
141
  };
142
142
  z(() => {
143
143
  var t;
144
- (e.modelValue !== void 0 && ((t = e.modelValue) != null && t.length) || e.forceFocus) && g(), document.addEventListener("click", k), window.addEventListener("resize", m);
144
+ (e.modelValue !== void 0 && ((t = e.modelValue) != null && t.length) || e.forceFocus) && g(), document.addEventListener("click", B), window.addEventListener("resize", m);
145
145
  }), N(() => {
146
- document.removeEventListener("click", k), window.removeEventListener("resize", m);
146
+ document.removeEventListener("click", B), window.removeEventListener("resize", m);
147
147
  });
148
148
  const L = (t) => {
149
149
  e.preventInputEvent && t.preventDefault();
150
150
  const l = t.target.value;
151
- d("input", t), e.debounce > 0 ? B(() => h(l), e.debounce)() : h(l);
151
+ d("input", t), e.debounce > 0 ? w(() => h(l), e.debounce)() : h(l);
152
152
  }, h = (t) => {
153
153
  d("update:modelValue", t), e.modelValue === void 0 && (i.value = t);
154
154
  };
155
- function B(t, l) {
155
+ function w(t, l) {
156
156
  let n;
157
157
  return function() {
158
158
  clearTimeout(n), n = setTimeout(t, l);
159
159
  };
160
160
  }
161
161
  const _ = () => {
162
- f.value = !0, a.value = !1, d("clearInput"), setTimeout(() => {
163
- e.forceEventClearButton || h(""), f.value = !1;
162
+ s.value = !0, a.value = !1, d("clearInput"), setTimeout(() => {
163
+ e.forceEventClearButton || h(""), s.value = !1;
164
164
  }, 100);
165
165
  };
166
166
  U(() => {
167
167
  var t, l;
168
- e.separator && ((e.modelValue !== void 0 ? e.modelValue.split(e.separator).filter((o) => o.length > 1) : i.value.split(e.separator).filter((o) => o.length > 1)).length ? (t = c.value) == null || t.classList.remove("AT-INPUT_items_empty") : ((l = c.value) == null || l.classList.add("AT-INPUT_items_empty"), v(), a.value = !1)), e.forceFocus ? g() : (v(), a.value = !1);
169
- }), S(
168
+ e.separator && ((e.modelValue !== void 0 ? e.modelValue.split(e.separator).filter((o) => o.length > 1) : i.value.split(e.separator).filter((o) => o.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
+ }), T(
170
170
  () => e.selectedItems,
171
171
  async () => {
172
172
  await m();
173
173
  },
174
174
  { deep: !0 }
175
- ), S(
175
+ ), T(
176
176
  () => r.value,
177
177
  () => {
178
178
  d("mouseover", r.value);
179
179
  }
180
180
  );
181
- const x = s(() => {
181
+ const x = c(() => {
182
182
  var t;
183
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)" : r.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)";
184
- }), R = s(() => e.disabled ? "disabled" : e.selectedItems.length > 0 ? "filled" : a.value ? "focused" : e.error.value ? "error" : r.value ? "hover" : e.modelValue !== void 0 && e.modelValue.length > 0 || i.value.length > 0 ? "filled" : "default"), W = s(() => e.modelValue !== void 0 ? e.modelValue : i.value ? i.value : null);
184
+ }), R = c(() => e.disabled ? "disabled" : e.selectedItems.length > 0 ? "filled" : a.value ? "focused" : e.error.value ? "error" : r.value ? "hover" : e.modelValue !== void 0 && e.modelValue.length > 0 || i.value.length > 0 ? "filled" : "default"), W = c(() => e.modelValue !== void 0 ? e.modelValue : i.value ? i.value : null);
185
185
  return {
186
186
  wrapperEl: b,
187
187
  inputEl: V,
188
- inputError: A,
188
+ inputError: O,
189
189
  inputId: e.id ?? q,
190
190
  handleOnFocus: g,
191
191
  handleOnFocusOut: v,
192
192
  icons: {
193
193
  error: H,
194
- ...T
194
+ ...A
195
195
  },
196
- clickedClear: f,
197
- showClearButton: O,
196
+ clickedClear: s,
197
+ showClearButton: k,
198
198
  clearInput: _,
199
- containerItemsEl: c,
199
+ containerItemsEl: f,
200
200
  onInput: L,
201
201
  iconColor: x,
202
202
  isFocused: a,
@@ -1,4 +1,4 @@
1
- const e = "";
1
+ const _ = "";
2
2
  export {
3
- e as default
3
+ _ as default
4
4
  };