@agrotools1/at-components 0.5.6 → 0.5.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.
Files changed (35) hide show
  1. package/dist/DatePicker/DatePicker.d.ts +31 -0
  2. package/dist/DatePicker/DatePicker.helper.d.ts +6 -0
  3. package/dist/DatePicker/DatePicker.vue.js +111 -100
  4. package/dist/DatePicker/DatePicker.vue2.js +82 -64
  5. package/dist/Dropdown/Dropdown.core.vue.js +28 -22
  6. package/dist/Dropdown/Dropdown.core.vue2.js +48 -42
  7. package/dist/Dropdown/DropdownContent/DropdownContent.d.ts +2 -0
  8. package/dist/Dropdown/DropdownContent/DropdownContent.vue.js +12 -0
  9. package/dist/Dropdown/DropdownContent/DropdownContent.vue2.js +9 -0
  10. package/dist/Modal/Modal.d.ts +17 -3
  11. package/dist/Modal/Modal.vue.js +82 -56
  12. package/dist/Modal/Modal.vue2.js +26 -13
  13. package/dist/Search/Search.d.ts +16 -0
  14. package/dist/Search/Search.vue.js +4 -3
  15. package/dist/Search/Search.vue2.js +24 -19
  16. package/dist/Select/Multiple/Select.multiple.d.ts +9 -0
  17. package/dist/Select/Multiple/Select.multiple.vue.js +4 -4
  18. package/dist/Select/Multiple/Select.multiple.vue2.js +19 -12
  19. package/dist/Select/Select.core.d.ts +4 -0
  20. package/dist/Select/Select.core.vue.js +5 -4
  21. package/dist/Select/Select.core.vue2.js +13 -10
  22. package/dist/Select/Single/Select.single.d.ts +9 -0
  23. package/dist/Select/Single/Select.single.vue.js +7 -7
  24. package/dist/Select/Single/Select.single.vue2.js +33 -26
  25. package/dist/Select/index.d.ts +18 -0
  26. package/dist/Stepper/Stepper.vue.js +11 -11
  27. package/dist/Tabs/Tabs.vue.js +6 -6
  28. package/dist/Tabs/Tabs.vue3.js +2 -2
  29. package/dist/Upload/MultipleUpload/MultipleUpload.vue.js +2 -2
  30. package/dist/Upload/SingleUpload/SingleUpload.vue.js +1 -1
  31. package/dist/Upload/UploaderInput/UploaderInput.d.ts +4 -1
  32. package/dist/Upload/UploaderInput/UploaderInput.vue.js +24 -25
  33. package/dist/Upload/UploaderInput/UploaderInput.vue2.js +11 -8
  34. package/dist/style.css +1 -1
  35. package/package.json +1 -1
@@ -1,6 +1,8 @@
1
- import { defineComponent as Y, ref as t, watch as k, onMounted as E, computed as L } from "vue";
2
- const b = Y({
1
+ import { defineComponent as A, ref as n, watch as E, onMounted as H, computed as I } from "vue";
2
+ import L from "./DropdownContent/DropdownContent.vue.js";
3
+ const q = A({
3
4
  name: "AtDropdown",
5
+ components: { DropdownContent: L },
4
6
  props: {
5
7
  isOpen: {
6
8
  type: Boolean,
@@ -20,62 +22,66 @@ const b = Y({
20
22
  }
21
23
  },
22
24
  emits: ["update:isOpen"],
23
- setup(d, { emit: r }) {
24
- const o = t(!1);
25
- o.value = d.isOpen;
26
- const l = t(), a = t(), n = t(), h = t(0), i = t(), p = t(), g = () => {
27
- var x, O, w, m, C, D;
28
- h.value = window.scrollY, i.value = (x = a.value) == null ? void 0 : x.getBoundingClientRect();
29
- const e = (((O = i.value) == null ? void 0 : O.y) ?? 0) + (((w = i.value) == null ? void 0 : w.height) ?? 0) + 8 + h.value, v = {
25
+ setup(p, { emit: f }) {
26
+ const i = n(!1);
27
+ i.value = p.isOpen;
28
+ const l = n(), t = n(), o = n(), h = n(0), a = n(), r = n(), g = () => {
29
+ var m, x, O, w, C, D, S, W, $;
30
+ h.value = window.scrollY;
31
+ const e = (x = (m = t.value) == null ? void 0 : m.children[0]) == null ? void 0 : x.querySelector(
32
+ ".AT-INPUT_error-message"
33
+ );
34
+ a.value = (O = t.value) == null ? void 0 : O.getBoundingClientRect();
35
+ const s = (((w = a.value) == null ? void 0 : w.y) ?? 0) + (((D = (C = t.value) == null ? void 0 : C.children[0]) == null ? void 0 : D.clientHeight) ?? 0) - ((e == null ? void 0 : e.clientHeight) ?? 0) + 8 + h.value, v = {
30
36
  left: () => {
31
- var s, u, c;
32
- n.value = {
33
- x: ((s = i.value) == null ? void 0 : s.left) ?? 0,
34
- y: e
35
- }, p.value = {
36
- top: `${((u = n.value) == null ? void 0 : u.y) || 0}px`,
37
- left: `${((c = n.value) == null ? void 0 : c.x) || 0}px`
37
+ var u, c, d;
38
+ o.value = {
39
+ x: ((u = a.value) == null ? void 0 : u.left) ?? 0,
40
+ y: s
41
+ }, r.value = {
42
+ top: `${((c = o.value) == null ? void 0 : c.y) || 0}px`,
43
+ left: `${((d = o.value) == null ? void 0 : d.x) || 0}px`
38
44
  };
39
45
  },
40
46
  right: () => {
41
- var s, u, c, S, W;
42
- n.value = {
43
- x: (((s = i.value) == null ? void 0 : s.left) ?? 0) - ((((u = l.value) == null ? void 0 : u.clientWidth) ?? 0) - (((c = a.value) == null ? void 0 : c.clientWidth) ?? 0)),
44
- y: e
45
- }, p.value = {
46
- top: `${((S = n.value) == null ? void 0 : S.y) || 0}px`,
47
- left: `${((W = n.value) == null ? void 0 : W.x) || 0}px`
47
+ var u, c, d, P, z;
48
+ o.value = {
49
+ x: (((u = a.value) == null ? void 0 : u.left) ?? 0) - ((((c = l.value) == null ? void 0 : c.clientWidth) ?? 0) - (((d = t.value) == null ? void 0 : d.clientWidth) ?? 0)),
50
+ y: s
51
+ }, r.value = {
52
+ top: `${((P = o.value) == null ? void 0 : P.y) || 0}px`,
53
+ left: `${((z = o.value) == null ? void 0 : z.x) || 0}px`
48
54
  };
49
55
  }
50
- }, f = window.innerWidth - (((m = i.value) == null ? void 0 : m.right) ?? 0) <= (((C = l.value) == null ? void 0 : C.offsetWidth) ?? 0) ? "right" : d.position;
51
- v[f](), d.fullSize && (p.value.width = `${((D = a.value) == null ? void 0 : D.clientWidth) ?? 0}px`);
56
+ }, k = window.innerWidth - (((S = a.value) == null ? void 0 : S.right) ?? 0) <= (((W = l.value) == null ? void 0 : W.offsetWidth) ?? 0) ? "right" : p.position;
57
+ v[k](), p.fullSize && (r.value.width = `${(($ = t.value) == null ? void 0 : $.clientWidth) ?? 0}px`);
52
58
  };
53
- k(
54
- () => d.isOpen,
59
+ E(
60
+ () => p.isOpen,
55
61
  (e) => {
56
- o.value = e, e && g();
62
+ i.value = e, e && setTimeout(() => g(), 10);
57
63
  }
58
64
  );
59
- const $ = async () => r("update:isOpen", !0), y = async () => r("update:isOpen", !1), z = (e) => {
60
- var v, f;
61
- o.value && !((v = l == null ? void 0 : l.value) != null && v.contains(e.target)) && !((f = a.value) != null && f.contains(e.target)) && y();
62
- }, B = () => r("update:isOpen", !o.value);
63
- E(() => {
64
- document.addEventListener("click", z), window.addEventListener("resize", g), g();
65
+ const B = async () => f("update:isOpen", !0), y = async () => f("update:isOpen", !1), T = (e) => {
66
+ var s, v;
67
+ i.value && !((s = l == null ? void 0 : l.value) != null && s.contains(e.target)) && !((v = t.value) != null && v.contains(e.target)) && y();
68
+ }, Y = () => f("update:isOpen", !i.value);
69
+ H(() => {
70
+ document.addEventListener("click", T), window.addEventListener("resize", g), g();
65
71
  });
66
- const P = L(() => ["dialog"]);
72
+ const _ = I(() => ["dialog"]);
67
73
  return {
68
- dialogIsOpen: o,
69
- getDialogClass: P,
74
+ dialogIsOpen: i,
75
+ getDialogClass: _,
70
76
  dialogElem: l,
71
- triggerElem: a,
72
- dialogStyle: p,
73
- toggleDialog: B,
74
- openDialog: $,
77
+ triggerElem: t,
78
+ dialogStyle: r,
79
+ toggleDialog: Y,
80
+ openDialog: B,
75
81
  closeDialog: y
76
82
  };
77
83
  }
78
84
  });
79
85
  export {
80
- b as default
86
+ q as default
81
87
  };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import e from "./DropdownContent.vue2.js";
2
+ import { openBlock as r, createElementBlock as t, renderSlot as n } from "vue";
3
+ import p from "../../_virtual/_plugin-vue_export-helper.js";
4
+ function c(o, s, f, l, a, d) {
5
+ return r(), t("div", null, [
6
+ n(o.$slots, "default")
7
+ ]);
8
+ }
9
+ const u = /* @__PURE__ */ p(e, [["render", c]]);
10
+ export {
11
+ u as default
12
+ };
@@ -0,0 +1,9 @@
1
+ import { defineComponent as n } from "vue";
2
+ const e = n({
3
+ name: "DropdownContent",
4
+ setup() {
5
+ }
6
+ });
7
+ export {
8
+ e as default
9
+ };
@@ -17,6 +17,7 @@ export interface ModalProps {
17
17
  title: string;
18
18
  buttons: IModalButtons[];
19
19
  dontShowOption: IDontShowOption;
20
+ hideCloseButton: boolean;
20
21
  }
21
22
  declare const _default: import("vue").DefineComponent<{
22
23
  isOpen: {
@@ -52,13 +53,20 @@ declare const _default: import("vue").DefineComponent<{
52
53
  type: PropType<IModalButtons[]>;
53
54
  default: undefined;
54
55
  };
56
+ hideCloseButton: {
57
+ required: false;
58
+ type: BooleanConstructor;
59
+ default: boolean;
60
+ };
55
61
  }, {
56
- target: import("vue").Ref<null>;
62
+ dontShowAgain: import("vue").Ref<boolean>;
63
+ firstButton: import("vue").ComputedRef<IModalButtons | undefined>;
64
+ hasSlotFooter: import("vue").ComputedRef<boolean>;
57
65
  icons: {
58
66
  close: string;
59
67
  };
60
- hasSlotFooter: import("vue").ComputedRef<boolean>;
61
- dontShowAgain: import("vue").Ref<boolean>;
68
+ remainingButtons: import("vue").ComputedRef<IModalButtons[] | undefined>;
69
+ target: import("vue").Ref<null>;
62
70
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "close"[], "close", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
63
71
  isOpen: {
64
72
  required: true;
@@ -93,6 +101,11 @@ declare const _default: import("vue").DefineComponent<{
93
101
  type: PropType<IModalButtons[]>;
94
102
  default: undefined;
95
103
  };
104
+ hideCloseButton: {
105
+ required: false;
106
+ type: BooleanConstructor;
107
+ default: boolean;
108
+ };
96
109
  }>> & {
97
110
  onClose?: ((...args: any[]) => any) | undefined;
98
111
  }, {
@@ -102,5 +115,6 @@ declare const _default: import("vue").DefineComponent<{
102
115
  isOpen: boolean;
103
116
  dontShowOption: IDontShowOption;
104
117
  buttons: IModalButtons[];
118
+ hideCloseButton: boolean;
105
119
  }, {}>;
106
120
  export default _default;
@@ -1,96 +1,122 @@
1
- import g from "./Modal.vue2.js";
2
- import { resolveComponent as p, openBlock as s, createBlock as h, Transition as y, withCtx as c, createElementBlock as n, createElementVNode as t, normalizeClass as v, toDisplayString as l, renderSlot as u, normalizeStyle as i, createVNode as S, createCommentVNode as d, Fragment as C, renderList as b, createTextVNode as A } from "vue";
1
+ import S from "./Modal.vue2.js";
2
+ import { resolveComponent as k, openBlock as e, createBlock as m, Transition as $, withCtx as p, createElementBlock as s, createElementVNode as n, normalizeClass as y, toDisplayString as r, createCommentVNode as i, renderSlot as c, normalizeStyle as d, createVNode as b, createTextVNode as B, Fragment as A, renderList as O } from "vue";
3
3
  import "./Modal.vue3.js";
4
- import _ from "../_virtual/_plugin-vue_export-helper.js";
5
- const O = {
4
+ import F from "../_virtual/_plugin-vue_export-helper.js";
5
+ const z = {
6
6
  key: 0,
7
7
  class: "at-modal-mask"
8
- }, B = {
8
+ }, N = {
9
9
  ref: "target",
10
10
  class: "at-modal-container"
11
- }, F = { class: "at-modal-header" }, z = { class: "at-modal-title" }, N = { class: "at-modal-exit-button" }, V = ["src"], E = { class: "at-modal-body" }, T = {
11
+ }, V = { class: "at-modal-header" }, E = { class: "at-modal-title" }, T = {
12
+ key: 0,
13
+ class: "at-modal-exit-button"
14
+ }, j = ["src"], D = { class: "at-modal-body" }, I = {
12
15
  key: 0,
13
16
  class: "at-modal-footer-left"
17
+ }, L = {
18
+ key: 1,
19
+ class: "at-modal-remainingButtonsContainer"
14
20
  };
15
- function j(o, a, D, I, L, M) {
16
- const f = p("AtCheckbox"), k = p("AtButton");
17
- return s(), h(y, { name: "at-modal-transition" }, {
18
- default: c(() => {
19
- var r;
21
+ function M(o, a, q, G, H, J) {
22
+ const w = k("AtCheckbox"), u = k("AtButton");
23
+ return e(), m($, { name: "at-modal-transition" }, {
24
+ default: p(() => {
25
+ var h, g, v;
20
26
  return [
21
- o.isOpen ? (s(), n("div", O, [
22
- t("div", {
23
- class: v(["at-modal", [`at-modal-${o.$props.size}`]])
27
+ o.isOpen ? (e(), s("div", z, [
28
+ n("div", {
29
+ class: y(["at-modal", [`at-modal-${o.$props.size}`]])
24
30
  }, [
25
- t("div", {
26
- class: v(["at-modal-badge", [`at-modal-${o.$props.type}`]])
31
+ n("div", {
32
+ class: y(["at-modal-badge", [`at-modal-${o.$props.type}`]])
27
33
  }, null, 2),
28
- t("div", B, [
29
- t("div", F, [
30
- t("span", z, l(o.title), 1),
31
- t("span", N, [
32
- t("img", {
34
+ n("div", N, [
35
+ n("div", V, [
36
+ n("span", E, r(o.title), 1),
37
+ o.hideCloseButton ? i("", !0) : (e(), s("span", T, [
38
+ n("img", {
33
39
  src: o.icons.close,
34
40
  alt: "Fechar modal",
35
- onClick: a[0] || (a[0] = (e) => o.$emit("close"))
36
- }, null, 8, V)
37
- ])
41
+ onClick: a[0] || (a[0] = (t) => o.$emit("close"))
42
+ }, null, 8, j)
43
+ ]))
38
44
  ]),
39
- t("div", E, [
40
- u(o.$slots, "default", {}, void 0, !0)
45
+ n("div", D, [
46
+ c(o.$slots, "default", {}, void 0, !0)
41
47
  ]),
42
- t("div", {
48
+ n("div", {
43
49
  class: "at-modal-footer",
44
- style: i({
50
+ style: d({
45
51
  "grid-template-columns": o.hasSlotFooter || !o.dontShowOption.show ? "1fr" : void 0
46
52
  })
47
53
  }, [
48
- !o.hasSlotFooter && o.dontShowOption.show ? (s(), n("div", T, [
49
- S(f, {
54
+ !o.hasSlotFooter && o.dontShowOption.show ? (e(), s("div", I, [
55
+ b(w, {
50
56
  size: "20",
51
57
  class: "at-modal-dont-show-btn",
52
58
  style: { "margin-right": "8px" },
53
- onClick: a[1] || (a[1] = (e) => o.dontShowAgain = !o.dontShowAgain)
59
+ onClick: a[1] || (a[1] = (t) => o.dontShowAgain = !o.dontShowAgain)
54
60
  }),
55
- t("span", null, l((r = o.$props.dontShowOption) == null ? void 0 : r.text), 1)
56
- ])) : d("", !0),
57
- o.hasSlotFooter ? d("", !0) : (s(), n("div", {
61
+ n("span", null, r((h = o.$props.dontShowOption) == null ? void 0 : h.text), 1)
62
+ ])) : i("", !0),
63
+ o.hasSlotFooter ? i("", !0) : (e(), s("div", {
58
64
  key: 1,
59
65
  class: "at-modal-footer-right",
60
- style: i({
66
+ style: d({
61
67
  width: o.dontShowOption.show ? void 0 : "100%",
62
68
  justifyContent: o.dontShowOption.show ? void 0 : "space-between"
63
69
  })
64
70
  }, [
65
- (s(!0), n(C, null, b(o.$props.buttons, (e, w) => {
66
- var m;
67
- return s(), h(k, {
68
- key: e.key,
69
- variant: e.variant,
70
- style: i({
71
- "margin-right": w + 1 === ((m = o.$props.buttons) == null ? void 0 : m.length) ? void 0 : "16px"
72
- }),
73
- disabled: e.disabled,
74
- onClick: ($) => e.onClick($, o.dontShowAgain)
75
- }, {
76
- default: c(() => [
77
- A(l(e.label), 1)
78
- ]),
79
- _: 2
80
- }, 1032, ["variant", "style", "disabled", "onClick"]);
81
- }), 128))
71
+ o.firstButton ? (e(), m(u, {
72
+ key: 0,
73
+ variant: o.firstButton.variant,
74
+ style: d({
75
+ "margin-left": o.remainingButtons && ((g = o.remainingButtons) == null ? void 0 : g.length) > 0 ? void 0 : "auto",
76
+ "margin-right": ((v = o.$props.buttons) == null ? void 0 : v.length) === 1 ? void 0 : "16px"
77
+ }),
78
+ disabled: o.firstButton.disabled,
79
+ onClick: a[2] || (a[2] = (t) => {
80
+ var l;
81
+ return (l = o.firstButton) == null ? void 0 : l.onClick(t, o.dontShowAgain);
82
+ })
83
+ }, {
84
+ default: p(() => [
85
+ B(r(o.firstButton.label), 1)
86
+ ]),
87
+ _: 1
88
+ }, 8, ["variant", "style", "disabled"])) : i("", !0),
89
+ o.remainingButtons && o.remainingButtons.length > 0 ? (e(), s("div", L, [
90
+ (e(!0), s(A, null, O(o.remainingButtons, (t, l) => {
91
+ var f;
92
+ return e(), m(u, {
93
+ key: t.key,
94
+ variant: t.variant,
95
+ style: d({
96
+ "margin-right": l + 1 === ((f = o.remainingButtons) == null ? void 0 : f.length) ? void 0 : "16px"
97
+ }),
98
+ disabled: t.disabled,
99
+ onClick: (C) => t.onClick(C, o.dontShowAgain)
100
+ }, {
101
+ default: p(() => [
102
+ B(r(t.label), 1)
103
+ ]),
104
+ _: 2
105
+ }, 1032, ["variant", "style", "disabled", "onClick"]);
106
+ }), 128))
107
+ ])) : i("", !0)
82
108
  ], 4)),
83
- u(o.$slots, "footer", {}, void 0, !0)
109
+ c(o.$slots, "footer", {}, void 0, !0)
84
110
  ], 4)
85
111
  ], 512)
86
112
  ], 2)
87
- ])) : d("", !0)
113
+ ])) : i("", !0)
88
114
  ];
89
115
  }),
90
116
  _: 3
91
117
  });
92
118
  }
93
- const K = /* @__PURE__ */ _(g, [["render", j], ["__scopeId", "data-v-57a73f13"]]);
119
+ const U = /* @__PURE__ */ F(S, [["render", M], ["__scopeId", "data-v-dc3b76a4"]]);
94
120
  export {
95
- K as default
121
+ U as default
96
122
  };
@@ -1,14 +1,13 @@
1
- import { defineComponent as p, ref as t, computed as m } from "vue";
2
- import e from "./images/cross.svg.js";
1
+ import { defineComponent as a, ref as i, computed as o } from "vue";
3
2
  import "../Accordion/Accordion.vue2.js";
4
3
  import "../Accordion/Accordion.vue3.js";
5
4
  import "../Avatar/Avatar.vue2.js";
6
5
  import "../Avatar/Avatar.vue3.js";
7
- import n from "../Button/Button.vue.js";
6
+ import l from "../Button/Button.vue.js";
8
7
  import "../CardWithInsights/CardWithInsights.vue2.js";
9
8
  import "../CardWithInsights/CardWithInsights.vue3.js";
10
9
  import "../CardWithInsights/CardWithInsights.vue4.js";
11
- import s from "../Checkbox/Checkbox.vue.js";
10
+ import u from "../Checkbox/Checkbox.vue.js";
12
11
  import "../ColorPicker/ColorPicker.vue2.js";
13
12
  import "../ColorPicker/ColorPicker.vue3.js";
14
13
  import "../DataTable/DataTable.vue2.js";
@@ -68,9 +67,10 @@ import "../Tooltip/Tooltip.vue2.js";
68
67
  import "../Tooltip/Tooltip.vue3.js";
69
68
  import "../Upload/Upload.vue2.js";
70
69
  import "../Upload/Upload.vue3.js";
71
- const Bt = p({
70
+ import f from "./images/cross.svg.js";
71
+ const jt = a({
72
72
  name: "AtModal",
73
- components: { AtButton: n, AtCheckbox: s },
73
+ components: { AtButton: l, AtCheckbox: u },
74
74
  props: {
75
75
  isOpen: {
76
76
  required: !0,
@@ -101,21 +101,34 @@ const Bt = p({
101
101
  required: !1,
102
102
  type: Array,
103
103
  default: void 0
104
+ },
105
+ hideCloseButton: {
106
+ required: !1,
107
+ type: Boolean,
108
+ default: !1
104
109
  }
105
110
  },
106
111
  emits: ["close"],
107
- setup(a, { slots: o }) {
108
- const r = t(null), i = t(!1);
112
+ setup(r, { slots: p }) {
113
+ const m = i(null), e = i(!1), n = o(() => {
114
+ var t;
115
+ return (t = r.buttons) == null ? void 0 : t.at(0);
116
+ }), s = o(() => {
117
+ var t;
118
+ return (t = r.buttons) == null ? void 0 : t.slice(1);
119
+ });
109
120
  return {
110
- target: r,
121
+ dontShowAgain: e,
122
+ firstButton: n,
123
+ hasSlotFooter: o(() => !!p.footer),
111
124
  icons: {
112
- close: e
125
+ close: f
113
126
  },
114
- hasSlotFooter: m(() => !!o.footer),
115
- dontShowAgain: i
127
+ remainingButtons: s,
128
+ target: m
116
129
  };
117
130
  }
118
131
  });
119
132
  export {
120
- Bt as default
133
+ jt as default
121
134
  };
@@ -8,6 +8,10 @@ export interface SearchProps {
8
8
  hasAutoComplete?: boolean | true;
9
9
  hasFilterOption?: boolean | true;
10
10
  isDisabled?: boolean | false;
11
+ error?: {
12
+ value: boolean;
13
+ message: string;
14
+ };
11
15
  }
12
16
  declare const _default: import("vue").DefineComponent<{
13
17
  label: {
@@ -42,6 +46,10 @@ declare const _default: import("vue").DefineComponent<{
42
46
  type: PropType<boolean | undefined>;
43
47
  default: boolean;
44
48
  };
49
+ error: {
50
+ type: () => SearchProps["error"];
51
+ default: () => void;
52
+ };
45
53
  id: {
46
54
  type: StringConstructor;
47
55
  required: false;
@@ -92,6 +100,10 @@ declare const _default: import("vue").DefineComponent<{
92
100
  type: PropType<boolean | undefined>;
93
101
  default: boolean;
94
102
  };
103
+ error: {
104
+ type: () => SearchProps["error"];
105
+ default: () => void;
106
+ };
95
107
  id: {
96
108
  type: StringConstructor;
97
109
  required: false;
@@ -101,6 +113,10 @@ declare const _default: import("vue").DefineComponent<{
101
113
  onOnSelectedItem?: ((...args: any[]) => any) | undefined;
102
114
  }, {
103
115
  label: string;
116
+ error: {
117
+ value: boolean;
118
+ message: string;
119
+ } | undefined;
104
120
  withIcon: boolean;
105
121
  modelValue: string;
106
122
  autoCompleteList: DropdownListItem[];
@@ -29,20 +29,21 @@ function h(e, f, b, I, S, C) {
29
29
  autocomplete: "off",
30
30
  disabled: e.isDisabled,
31
31
  "use-clear-button": !0,
32
- icon: { name: "AtSearchIcon" }
32
+ icon: { name: "AtSearchIcon" },
33
+ error: e.error
33
34
  }, e.$attrs, {
34
35
  "onUpdate:modelValue": e.handleChangeValue,
35
36
  onFocus: e.openList,
36
37
  onFocusout: e.closeList,
37
38
  onClearInput: e.clear
38
- }), null, 16, ["id", "label", "model-value", "disabled", "onUpdate:modelValue", "onFocus", "onFocusout", "onClearInput"]),
39
+ }), null, 16, ["id", "label", "model-value", "disabled", "error", "onUpdate:modelValue", "onFocus", "onFocusout", "onClearInput"]),
39
40
  e.showSearchIcon ? (s(), a("span", c)) : u("", !0)
40
41
  ]),
41
42
  _: 1
42
43
  }, 8, ["id", "drop-down-list", "is-open", "show-no-result-message", "onOnSave"])
43
44
  ], 2);
44
45
  }
45
- const V = /* @__PURE__ */ m(r, [["render", h], ["__scopeId", "data-v-7882f79d"]]);
46
+ const V = /* @__PURE__ */ m(r, [["render", h], ["__scopeId", "data-v-3933bd5b"]]);
46
47
  export {
47
48
  V as default
48
49
  };
@@ -1,17 +1,17 @@
1
1
  import { defineComponent as g, ref as l, computed as o } from "vue";
2
2
  import { AtCircleXMarkSolidIcon as V } from "../node_modules/.pnpm/agrotools-icons@0.2.6/node_modules/agrotools-icons/dist/AtCircleXMarkSolidIcon/index.js";
3
- import { AtSearchIcon as w } from "../node_modules/.pnpm/agrotools-icons@0.2.6/node_modules/agrotools-icons/dist/AtSearchIcon/index.js";
4
- import { AtInput as x } from "../Input/index.js";
5
- import F from "../List/components/List.vue.js";
6
- const O = {
7
- AtSearchIcon: w,
3
+ import { AtSearchIcon as O } from "../node_modules/.pnpm/agrotools-icons@0.2.6/node_modules/agrotools-icons/dist/AtSearchIcon/index.js";
4
+ import { AtInput as w } from "../Input/index.js";
5
+ import x from "../List/components/List.vue.js";
6
+ const F = {
7
+ AtSearchIcon: O,
8
8
  AtCircleXMarkSolidIcon: V
9
9
  }, D = g({
10
10
  name: "AtSearch",
11
11
  components: {
12
- AtInput: x.Text,
13
- AtLista: F,
14
- ...O
12
+ AtInput: w.Text,
13
+ AtLista: x,
14
+ ...F
15
15
  },
16
16
  props: {
17
17
  label: {
@@ -46,6 +46,11 @@ const O = {
46
46
  type: Boolean,
47
47
  default: !1
48
48
  },
49
+ error: {
50
+ type: Object,
51
+ default: () => {
52
+ }
53
+ },
49
54
  id: {
50
55
  type: String,
51
56
  required: !1
@@ -68,20 +73,20 @@ const O = {
68
73
  }, I = o(() => {
69
74
  var e;
70
75
  if (t.hasFilterOption) {
71
- const r = (d, m) => d.text.toUpperCase().includes(m.toUpperCase());
76
+ const i = (d, m) => d.text.toUpperCase().includes(m.toUpperCase());
72
77
  return t.autoCompleteList.filter(
73
- (d) => r(d, t.modelValue)
78
+ (d) => i(d, t.modelValue)
74
79
  );
75
80
  }
76
81
  return (e = s.value) != null && e.length ? s.value : t.autoCompleteList;
77
- }), i = l(), S = (e) => {
78
- const r = e.text;
79
- i.value = e, n("onSelectedItem", e), n("update:modelValue", r);
82
+ }), r = l(), S = (e) => {
83
+ const i = e.text;
84
+ r.value = e, n("onSelectedItem", e), n("update:modelValue", i);
80
85
  }, L = () => {
81
- n("onSelectedItem", null), a.value = !1, i.value = null;
82
- }, C = o(
83
- () => t.withIcon && a.value && !i.value
84
- ), y = o(
86
+ n("onSelectedItem", null), a.value = !1, r.value = null;
87
+ }, y = o(
88
+ () => t.withIcon && a.value && !r.value
89
+ ), C = o(
85
90
  () => t.isDisabled ? "var(--at-medium-grey)" : ""
86
91
  ), A = o(
87
92
  () => !!t.modelValue && !a.value
@@ -91,9 +96,9 @@ const O = {
91
96
  autocompleteListIsOpen: f,
92
97
  autoCompleteListFiltered: I,
93
98
  isLoading: a,
94
- showSearchIcon: C,
99
+ showSearchIcon: y,
95
100
  getShowNoResultMessage: A,
96
- getSearchIconColor: y,
101
+ getSearchIconColor: C,
97
102
  clear: L,
98
103
  openList: p,
99
104
  closeList: h,
@@ -34,6 +34,10 @@ declare const _default: import("vue").DefineComponent<{
34
34
  type: StringConstructor;
35
35
  default: string;
36
36
  };
37
+ error: {
38
+ type: ObjectConstructor;
39
+ default: () => void;
40
+ };
37
41
  }, {
38
42
  onSelectedValueChange: (item: SelectItemProps, isChecked: boolean) => void;
39
43
  onSelectedItemClick: (selectedValue: string, isOpen?: boolean) => void;
@@ -96,6 +100,10 @@ declare const _default: import("vue").DefineComponent<{
96
100
  type: StringConstructor;
97
101
  default: string;
98
102
  };
103
+ error: {
104
+ type: ObjectConstructor;
105
+ default: () => void;
106
+ };
99
107
  }>> & {
100
108
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
101
109
  "onUpdate:items"?: ((...args: any[]) => any) | undefined;
@@ -103,6 +111,7 @@ declare const _default: import("vue").DefineComponent<{
103
111
  }, {
104
112
  required: boolean;
105
113
  label: string;
114
+ error: Record<string, any>;
106
115
  disabled: boolean;
107
116
  modelValue: string[] | SelectItemProps[];
108
117
  items: SelectItemProps[];