@agrotools1/at-components 0.6.0 → 0.6.12

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.
@@ -12,6 +12,7 @@ export interface SearchProps {
12
12
  value: boolean;
13
13
  message: string;
14
14
  };
15
+ isLoading: boolean;
15
16
  }
16
17
  declare const _default: import("vue").DefineComponent<{
17
18
  label: {
@@ -54,6 +55,10 @@ declare const _default: import("vue").DefineComponent<{
54
55
  type: StringConstructor;
55
56
  required: false;
56
57
  };
58
+ isLoading: {
59
+ type: () => SearchProps["isLoading"];
60
+ default: boolean;
61
+ };
57
62
  }, {
58
63
  atSearch: import("vue").Ref<HTMLDivElement | null>;
59
64
  autocompleteListIsOpen: ComputedRef<boolean>;
@@ -67,7 +72,7 @@ declare const _default: import("vue").DefineComponent<{
67
72
  closeList: () => void;
68
73
  handleChangeValue: (value: string) => Promise<void>;
69
74
  handleSelectedItem: (item: DropdownListItem) => void;
70
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "onSelectedItem")[], "update:modelValue" | "onSelectedItem", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
75
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "onSelectedItem" | "onClear")[], "update:modelValue" | "onSelectedItem" | "onClear", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
71
76
  label: {
72
77
  type: StringConstructor;
73
78
  default: string;
@@ -108,9 +113,14 @@ declare const _default: import("vue").DefineComponent<{
108
113
  type: StringConstructor;
109
114
  required: false;
110
115
  };
116
+ isLoading: {
117
+ type: () => SearchProps["isLoading"];
118
+ default: boolean;
119
+ };
111
120
  }>> & {
112
121
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
113
122
  onOnSelectedItem?: ((...args: any[]) => any) | undefined;
123
+ onOnClear?: ((...args: any[]) => any) | undefined;
114
124
  }, {
115
125
  label: string;
116
126
  error: {
@@ -119,6 +129,7 @@ declare const _default: import("vue").DefineComponent<{
119
129
  } | undefined;
120
130
  withIcon: boolean;
121
131
  modelValue: string;
132
+ isLoading: boolean;
122
133
  autoCompleteList: DropdownListItem[];
123
134
  isDisabled: boolean | undefined;
124
135
  hasAutoComplete: boolean;
@@ -43,7 +43,7 @@ function h(e, f, b, I, S, C) {
43
43
  }, 8, ["id", "drop-down-list", "is-open", "show-no-result-message", "onOnSave"])
44
44
  ], 2);
45
45
  }
46
- const V = /* @__PURE__ */ m(r, [["render", h], ["__scopeId", "data-v-3933bd5b"]]);
46
+ const V = /* @__PURE__ */ m(r, [["render", h], ["__scopeId", "data-v-f5e71e70"]]);
47
47
  export {
48
48
  V as default
49
49
  };
@@ -1,17 +1,17 @@
1
- import { defineComponent as g, ref as l, computed as o } from "vue";
1
+ import { defineComponent as A, ref as o, computed as n } 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
3
  import { AtSearchIcon as O } from "../node_modules/.pnpm/agrotools-icons@0.2.6/node_modules/agrotools-icons/dist/AtSearchIcon/index.js";
4
4
  import { AtInput as w } from "../Input/index.js";
5
5
  import x from "../List/components/List.vue.js";
6
- const F = {
6
+ const B = {
7
7
  AtSearchIcon: O,
8
8
  AtCircleXMarkSolidIcon: V
9
- }, D = g({
9
+ }, D = A({
10
10
  name: "AtSearch",
11
11
  components: {
12
12
  AtInput: w.Text,
13
13
  AtLista: x,
14
- ...F
14
+ ...B
15
15
  },
16
16
  props: {
17
17
  label: {
@@ -54,55 +54,62 @@ const F = {
54
54
  id: {
55
55
  type: String,
56
56
  required: !1
57
+ },
58
+ isLoading: {
59
+ type: Boolean,
60
+ default: !1
57
61
  }
58
62
  },
59
- emits: ["update:modelValue", "onSelectedItem"],
60
- setup(t, { emit: n }) {
61
- const s = l([]), u = l(!1), c = l(null), f = o(
62
- () => u.value && t.hasAutoComplete && (!!t.modelValue || t.hasFilterOption)
63
- ), p = () => {
63
+ emits: ["update:modelValue", "onSelectedItem", "onClear"],
64
+ setup(t, { emit: l }) {
65
+ const s = o([]), u = o(!1), c = o(null), h = n(
66
+ () => {
67
+ var e;
68
+ return u.value && t.hasAutoComplete && (!!t.modelValue || t.hasFilterOption) && !(!((e = m.value) != null && e.length) && f.value);
69
+ }
70
+ ), v = () => {
64
71
  var e;
65
72
  u.value = !0, (e = c.value) == null || e.classList.add("focused");
66
- }, h = () => {
73
+ }, I = () => {
67
74
  var e;
68
75
  setTimeout(() => {
69
76
  u.value = !1;
70
77
  }, 200), (e = c.value) == null || e.classList.remove("focused");
71
- }, a = l(!1), v = async (e) => {
72
- n("update:modelValue", e), t.searchEndpoint && (a.value = !0, s.value = await t.searchEndpoint(e), a.value = !1);
73
- }, I = o(() => {
78
+ }, a = o(!1), L = async (e) => {
79
+ l("update:modelValue", e), t.searchEndpoint && (a.value = !0, s.value = await t.searchEndpoint(e), a.value = !1);
80
+ }, m = n(() => {
74
81
  var e;
75
82
  if (t.hasFilterOption) {
76
- const i = (d, m) => d.text.toUpperCase().includes(m.toUpperCase());
83
+ const i = (d, p) => d.text.toUpperCase().includes(p.toUpperCase());
77
84
  return t.autoCompleteList.filter(
78
85
  (d) => i(d, t.modelValue)
79
86
  );
80
87
  }
81
88
  return (e = s.value) != null && e.length ? s.value : t.autoCompleteList;
82
- }), r = l(), S = (e) => {
89
+ }), r = o(), S = (e) => {
83
90
  const i = e.text;
84
- r.value = e, n("onSelectedItem", e), n("update:modelValue", i);
85
- }, L = () => {
86
- n("onSelectedItem", null), a.value = !1, r.value = null;
87
- }, y = o(
88
- () => t.withIcon && a.value && !r.value
89
- ), C = o(
91
+ r.value = e, l("onSelectedItem", e), l("update:modelValue", i);
92
+ }, C = () => {
93
+ l("onSelectedItem", null), l("onClear"), a.value = !1, r.value = null;
94
+ }, f = n(
95
+ () => t.withIcon && a.value && !r.value || t.isLoading
96
+ ), y = n(
90
97
  () => t.isDisabled ? "var(--at-medium-grey)" : ""
91
- ), A = o(
98
+ ), g = n(
92
99
  () => !!t.modelValue && !a.value
93
100
  );
94
101
  return {
95
102
  atSearch: c,
96
- autocompleteListIsOpen: f,
97
- autoCompleteListFiltered: I,
103
+ autocompleteListIsOpen: h,
104
+ autoCompleteListFiltered: m,
98
105
  isLoading: a,
99
- showSearchIcon: y,
100
- getShowNoResultMessage: A,
101
- getSearchIconColor: C,
102
- clear: L,
103
- openList: p,
104
- closeList: h,
105
- handleChangeValue: v,
106
+ showSearchIcon: f,
107
+ getShowNoResultMessage: g,
108
+ getSearchIconColor: y,
109
+ clear: C,
110
+ openList: v,
111
+ closeList: I,
112
+ handleChangeValue: L,
106
113
  handleSelectedItem: S
107
114
  };
108
115
  }
@@ -1,11 +1,11 @@
1
- import f from "./TableConfig.vue2.js";
2
- import { resolveComponent as n, openBlock as m, createElementBlock as C, createVNode as t, withCtx as e, createElementVNode as s, createTextVNode as i, toDisplayString as a } from "vue";
1
+ import m from "./TableConfig.vue2.js";
2
+ import { resolveComponent as n, openBlock as f, createElementBlock as C, createVNode as t, withCtx as e, createElementVNode as s, createTextVNode as i, toDisplayString as a } from "vue";
3
3
  import "./TableConfig.vue3.js";
4
4
  import k from "../_virtual/_plugin-vue_export-helper.js";
5
5
  const g = { class: "tableConfig" }, v = { class: "at-dropdown-footer" };
6
- function h(o, r, A, b, S, _) {
6
+ function b(o, r, h, A, S, _) {
7
7
  const d = n("AtSettingsSolidIcon"), l = n("AtButton"), c = n("AtChecklist"), p = n("AtDropdown");
8
- return m(), C("section", null, [
8
+ return f(), C("section", null, [
9
9
  t(p, {
10
10
  id: o.id,
11
11
  "is-open": o.isDialogOpen,
@@ -63,7 +63,7 @@ function h(o, r, A, b, S, _) {
63
63
  }, 8, ["id", "is-open", "position"])
64
64
  ]);
65
65
  }
66
- const D = /* @__PURE__ */ k(f, [["render", h], ["__scopeId", "data-v-5038cf10"]]);
66
+ const D = /* @__PURE__ */ k(m, [["render", b], ["__scopeId", "data-v-c768db66"]]);
67
67
  export {
68
68
  D as default
69
69
  };
@@ -1,11 +1,11 @@
1
- import { defineComponent as g, ref as l, computed as v } from "vue";
1
+ import { defineComponent as v, ref as i, computed as m } from "vue";
2
2
  import { AtSettingsSolidIcon as y } from "../node_modules/.pnpm/agrotools-icons@0.2.6/node_modules/agrotools-icons/dist/AtSettingsSolidIcon/index.js";
3
3
  import h from "../Button/Button.vue.js";
4
4
  import x from "../Dropdown/Checklist/Dropdown.Checklist.vue.js";
5
5
  import A from "../Dropdown/Dropdown.core.vue.js";
6
6
  const C = {
7
7
  AtSettingsSolidIcon: y
8
- }, q = g({
8
+ }, q = v({
9
9
  name: "AtTableConfig",
10
10
  components: {
11
11
  AtChecklist: x,
@@ -56,33 +56,33 @@ const C = {
56
56
  }
57
57
  },
58
58
  emits: ["onSave"],
59
- setup(i, { emit: c }) {
60
- const t = l(!1), p = () => t.value = !t.value, u = v(
61
- () => t.value ? "primary" : "secondary"
62
- ), s = l([]), n = l([]), a = () => {
63
- s.value = JSON.parse(JSON.stringify(i.dropDownList)), n.value = JSON.parse(JSON.stringify(s.value));
59
+ setup(c, { emit: p }) {
60
+ const o = i(!1), u = () => o.value = !o.value, d = m(
61
+ () => o.value ? "primary" : "secondary"
62
+ ), s = i([]), n = i([]), a = () => {
63
+ s.value = JSON.parse(JSON.stringify(c.dropDownList)), n.value = JSON.parse(JSON.stringify(s.value));
64
64
  };
65
65
  a();
66
- const r = () => t.value = !1, d = () => {
66
+ const r = () => o.value = !1, f = () => {
67
67
  r();
68
- }, f = () => {
68
+ }, S = () => {
69
69
  const e = [];
70
- return n.value.forEach((o, m) => {
71
- e[m] = s.value.find((S) => S.text === o.text) ?? {};
72
- }), i.resumedResponse ? e.filter((o) => o.value).map((o) => o.text) : e;
70
+ return n.value.forEach((t, g) => {
71
+ e[g] = s.value.find((l) => (l == null ? void 0 : l.text) === (t == null ? void 0 : t.text)) ?? {};
72
+ }), c.resumedResponse ? e.filter((t) => t.value).map((t) => t.text) : e;
73
73
  };
74
74
  return {
75
- isDialogOpen: t,
76
- getButtonColor: u,
75
+ isDialogOpen: o,
76
+ getButtonColor: d,
77
77
  list: s,
78
- toggleDropdown: p,
79
- handleClose: d,
78
+ toggleDropdown: u,
79
+ handleClose: f,
80
80
  handleSorted: (e) => {
81
81
  n.value = e;
82
82
  },
83
83
  save: () => {
84
- const e = f();
85
- c("onSave", e), r();
84
+ const e = S();
85
+ p("onSave", e), r();
86
86
  },
87
87
  cancel: () => {
88
88
  a(), r();
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from "./ColorPicker";
7
7
  export * from "./DataTable";
8
8
  export * from "./DatePicker";
9
9
  export * from "./Faq";
10
+ export * from "./Faq/FaqItem";
10
11
  export * from "./Filter";
11
12
  export * from "./Illustration";
12
13
  export * from "./Input";
package/dist/index.js CHANGED
@@ -1,64 +1,66 @@
1
1
  import { default as e } from "./Accordion/Accordion.vue.js";
2
- import { default as a } from "./Avatar/Avatar.vue.js";
2
+ import { default as r } from "./Avatar/Avatar.vue.js";
3
3
  import { default as l } from "./Button/Button.vue.js";
4
4
  import { default as s } from "./CardWithInsights/CardWithInsights.vue.js";
5
- import { default as x } from "./Checkbox/Checkbox.vue.js";
5
+ import { default as m } from "./Checkbox/Checkbox.vue.js";
6
6
  import { default as u } from "./ColorPicker/ColorPicker.vue.js";
7
7
  import { AtDataTable as i } from "./DataTable/index.js";
8
8
  import { default as g } from "./DatePicker/DatePicker.vue.js";
9
9
  import { default as T } from "./Faq/Faq.vue.js";
10
- import { default as b } from "./Filter/components/Filter.vue.js";
11
- import { default as C } from "./Illustration/Illustration.vue.js";
12
- import { AtInput as B } from "./Input/index.js";
13
- import { default as L } from "./Legend/Legend.vue.js";
10
+ import { default as b } from "./Faq/FaqItem/FaqItem.vue.js";
11
+ import { default as C } from "./Filter/components/Filter.vue.js";
12
+ import { default as S } from "./Illustration/Illustration.vue.js";
13
+ import { AtInput as F } from "./Input/index.js";
14
+ import { default as P } from "./Legend/Legend.vue.js";
14
15
  import { default as D } from "./List/components/List.vue.js";
15
- import { default as M } from "./Loading/Loading.vue.js";
16
- import { default as v } from "./Map/Map.vue.js";
17
- import { default as R } from "./Modal/Modal.vue.js";
18
- import { default as W } from "./Notifications/Notifications.vue.js";
19
- import { default as w } from "./ProgressBar/ProgressBar.vue.js";
20
- import { default as z } from "./RadioButton/RadioButton.vue.js";
21
- import { default as G } from "./Search/Search.vue.js";
22
- import { AtSelect as J } from "./Select/index.js";
23
- import { default as O } from "./Skeleton/Skeleton.vue.js";
24
- import { default as V } from "./Stepper/Stepper.vue.js";
25
- import { default as Y } from "./TableConfig/TableConfig.vue.js";
26
- import { default as _ } from "./Tabs/Tabs.vue.js";
27
- import { default as tt } from "./Tag/Tag.vue.js";
28
- import { AtTipograph as et } from "./Tipograph/index.js";
29
- import { default as at } from "./Toggle/Toggle.vue.js";
30
- import { default as lt } from "./Tooltip/Tooltip.vue.js";
31
- import { default as st } from "./Upload/Upload.vue.js";
16
+ import { default as v } from "./Loading/Loading.vue.js";
17
+ import { default as R } from "./Map/Map.vue.js";
18
+ import { default as W } from "./Modal/Modal.vue.js";
19
+ import { default as w } from "./Notifications/Notifications.vue.js";
20
+ import { default as z } from "./ProgressBar/ProgressBar.vue.js";
21
+ import { default as G } from "./RadioButton/RadioButton.vue.js";
22
+ import { default as J } from "./Search/Search.vue.js";
23
+ import { AtSelect as O } from "./Select/index.js";
24
+ import { default as V } from "./Skeleton/Skeleton.vue.js";
25
+ import { default as Y } from "./Stepper/Stepper.vue.js";
26
+ import { default as _ } from "./TableConfig/TableConfig.vue.js";
27
+ import { default as tt } from "./Tabs/Tabs.vue.js";
28
+ import { default as et } from "./Tag/Tag.vue.js";
29
+ import { AtTipograph as rt } from "./Tipograph/index.js";
30
+ import { default as lt } from "./Toggle/Toggle.vue.js";
31
+ import { default as st } from "./Tooltip/Tooltip.vue.js";
32
+ import { default as mt } from "./Upload/Upload.vue.js";
32
33
  export {
33
34
  e as AtAccordion,
34
- a as AtAvatar,
35
+ r as AtAvatar,
35
36
  l as AtButton,
36
37
  s as AtCardWithInsights,
37
- x as AtCheckbox,
38
+ m as AtCheckbox,
38
39
  i as AtDataTable,
39
40
  g as AtDatePicker,
40
- b as AtFilter,
41
- C as AtIllustration,
42
- B as AtInput,
43
- L as AtLegend,
41
+ b as AtFaqItem,
42
+ C as AtFilter,
43
+ S as AtIllustration,
44
+ F as AtInput,
45
+ P as AtLegend,
44
46
  D as AtList,
45
- M as AtLoading,
46
- v as AtMap,
47
- R as AtModal,
48
- W as AtNotifications,
49
- w as AtProgressBar,
50
- z as AtRadioButton,
51
- G as AtSearch,
52
- J as AtSelect,
53
- O as AtSkeleton,
54
- Y as AtTableConfig,
55
- _ as AtTabs,
56
- tt as AtTag,
57
- et as AtTipograph,
58
- at as AtToggle,
59
- lt as AtTooltip,
47
+ v as AtLoading,
48
+ R as AtMap,
49
+ W as AtModal,
50
+ w as AtNotifications,
51
+ z as AtProgressBar,
52
+ G as AtRadioButton,
53
+ J as AtSearch,
54
+ O as AtSelect,
55
+ V as AtSkeleton,
56
+ _ as AtTableConfig,
57
+ tt as AtTabs,
58
+ et as AtTag,
59
+ rt as AtTipograph,
60
+ lt as AtToggle,
61
+ st as AtTooltip,
60
62
  u as ColorPicker,
61
63
  T as Faq,
62
- V as Stepper,
63
- st as Upload
64
+ Y as Stepper,
65
+ mt as Upload
64
66
  };