@agrotools1/at-components 0.6.5-6.1 → 0.6.7

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,9 +1,9 @@
1
- import { defineComponent as k, ref as m, computed as v, watch as b } from "vue";
2
- import y from "./imgs/double-left-arrow.svg.js";
3
- import C from "./imgs/double-right-arrow.svg.js";
4
- import V from "./imgs/left-arrow.svg.js";
5
- import w from "./imgs/right-arrow.svg.js";
6
- const A = k({
1
+ import { defineComponent as p, ref as f, computed as o } from "vue";
2
+ import P from "./imgs/double-left-arrow.svg.js";
3
+ import k from "./imgs/double-right-arrow.svg.js";
4
+ import b from "./imgs/left-arrow.svg.js";
5
+ import C from "./imgs/right-arrow.svg.js";
6
+ const w = p({
7
7
  name: "AtPaginator",
8
8
  props: {
9
9
  total: {
@@ -17,80 +17,77 @@ const A = k({
17
17
  disable: {
18
18
  type: Boolean,
19
19
  default: !1
20
- },
21
- modelValue: {
22
- type: Number,
23
- default: 1
24
20
  }
25
21
  },
26
22
  emits: {
27
- "update:activePage": (l) => typeof l == "number"
23
+ "update:activePage": (a) => typeof a == "number"
28
24
  },
29
- setup(l, i) {
30
- const t = m(0), a = m(l.modelValue), r = v(() => l.disable), f = v(() => l.modelValue), d = v(
31
- () => Array.from({ length: l.total }, (e, u) => u + 1)
32
- ), n = v(() => {
33
- const e = d.value, u = [];
34
- for (let o = 0; o < e.length; o += l.pageSize)
35
- u.push(e.slice(o, o + l.pageSize));
36
- return u;
37
- }), g = v(() => n.value[t.value]), h = () => {
25
+ setup(a, n) {
26
+ const t = f(0), e = f(1), r = o(() => a.disable), h = o(
27
+ () => Array.from({ length: a.total }, (u, l) => l + 1)
28
+ ), i = o(() => {
29
+ const u = h.value, l = [];
30
+ for (let s = 0; s < u.length; s += a.pageSize)
31
+ l.push(u.slice(s, s + a.pageSize));
32
+ return l;
33
+ }), g = o(() => i.value[t.value]), m = () => {
38
34
  if (r.value)
39
35
  return;
40
- const e = n.value[t.value];
41
- if (a.value === e[0]) {
42
- if (a.value === 1)
36
+ const u = i.value[t.value];
37
+ if (e.value === u[0]) {
38
+ if (e.value === 1)
43
39
  return;
44
40
  c();
45
41
  return;
46
42
  }
47
- a.value = a.value - 1, i.emit("update:activePage", a.value);
48
- }, p = () => {
43
+ e.value = e.value - 1, n.emit("update:activePage", e.value);
44
+ }, d = () => {
49
45
  if (r.value)
50
46
  return;
51
- const e = n.value[t.value], u = e[e.length - 1];
52
- if (a.value === u) {
53
- if (t.value >= n.value.length)
47
+ const u = i.value[t.value], l = u[u.length - 1];
48
+ if (e.value === l) {
49
+ if (t.value >= i.value.length)
54
50
  return;
55
- s();
51
+ v();
56
52
  return;
57
53
  }
58
- a.value = a.value + 1, i.emit("update:activePage", a.value);
59
- }, s = () => {
60
- r.value || (t.value = t.value + 1, a.value = n.value[t.value][0], i.emit("update:activePage", a.value));
54
+ e.value = e.value + 1, n.emit("update:activePage", e.value);
55
+ }, v = () => {
56
+ r.value || (t.value = t.value + 1, e.value = i.value[t.value][0], n.emit("update:activePage", e.value));
61
57
  }, c = () => {
62
58
  if (r.value)
63
59
  return;
64
60
  t.value = t.value - 1;
65
- const e = n.value[t.value];
66
- a.value = e[e.length - 1], i.emit("update:activePage", a.value);
67
- }, P = (e) => {
68
- if (r.value)
69
- return;
70
- const u = n.value.findIndex((o) => o.includes(e));
71
- t.value = u === -1 ? 0 : u, a.value = e, i.emit("update:activePage", e);
61
+ const u = i.value[t.value];
62
+ e.value = u[u.length - 1], n.emit("update:activePage", e.value);
72
63
  };
73
- return b(f, (e) => {
74
- P(e);
75
- }), {
76
- activePage: a,
64
+ return {
65
+ activePage: e,
77
66
  activeChunk: t,
78
- pageChunks: n,
67
+ pageChunks: i,
79
68
  isDisabled: r,
80
69
  pages: g,
81
70
  icons: {
82
- arrowLeft: V,
83
- arrowRight: w,
84
- doubleLeft: y,
85
- doubleRight: C
71
+ arrowLeft: b,
72
+ arrowRight: C,
73
+ doubleLeft: P,
74
+ doubleRight: k
86
75
  },
87
- nextChunk: s,
88
- nextPage: p,
89
- previousPage: h,
76
+ nextChunk: v,
77
+ nextPage: d,
78
+ previousPage: m,
90
79
  previousChunk: c
91
80
  };
81
+ },
82
+ methods: {
83
+ setPage(a) {
84
+ if (this.isDisabled || a === this.activePage)
85
+ return;
86
+ const n = this.pageChunks.findIndex((t) => t.includes(a));
87
+ this.activeChunk = n === -1 ? 0 : n, this.activePage = a, this.$emit("update:activePage", a);
88
+ }
92
89
  }
93
90
  });
94
91
  export {
95
- A as default
92
+ w as default
96
93
  };
@@ -1,4 +1,4 @@
1
- const e = "";
1
+ const _ = "";
2
2
  export {
3
- e as default
3
+ _ as default
4
4
  };
@@ -28,6 +28,10 @@ declare const _default: import('vue').DefineComponent<{
28
28
  type: BooleanConstructor;
29
29
  default: boolean;
30
30
  };
31
+ disabled: {
32
+ type: BooleanConstructor;
33
+ default: boolean;
34
+ };
31
35
  error: {
32
36
  type: ObjectConstructor;
33
37
  default: () => void;
@@ -73,6 +77,10 @@ declare const _default: import('vue').DefineComponent<{
73
77
  type: BooleanConstructor;
74
78
  default: boolean;
75
79
  };
80
+ disabled: {
81
+ type: BooleanConstructor;
82
+ default: boolean;
83
+ };
76
84
  error: {
77
85
  type: ObjectConstructor;
78
86
  default: () => void;
@@ -83,6 +91,7 @@ declare const _default: import('vue').DefineComponent<{
83
91
  required: boolean;
84
92
  label: string;
85
93
  error: Record<string, any>;
94
+ disabled: boolean;
86
95
  modelValue: string | SelectItemProps;
87
96
  items: SelectItemProps[];
88
97
  emitValue: boolean;
@@ -1,49 +1,52 @@
1
- import u from "./Select.single.vue2.js";
2
- import { resolveComponent as l, openBlock as t, createElementBlock as r, createVNode as d, withModifiers as c, Fragment as f, renderList as v, createBlock as C, createCommentVNode as k } from "vue";
1
+ import p from "./Select.single.vue2.js";
2
+ import { resolveComponent as t, openBlock as o, createElementBlock as l, createVNode as u, withModifiers as c, Fragment as v, renderList as f, createBlock as C, createCommentVNode as b } from "vue";
3
3
  import "./Select.single.vue3.js";
4
- import m from "../../_virtual/_plugin-vue_export-helper.js";
5
- function g(e, o, A, I, S, y) {
6
- const i = l("AtSingleCore"), s = l("AtItem");
7
- return t(), r("div", {
4
+ import k from "../../_virtual/_plugin-vue_export-helper.js";
5
+ const m = ["aria-disabled"];
6
+ function g(e, n, A, I, S, y) {
7
+ const i = t("AtSingleCore"), s = t("AtItem");
8
+ return o(), l("div", {
8
9
  ref: "containerRef",
9
10
  class: "AT-SELECT_wrapper",
10
- onClick: o[1] || (o[1] = (n) => {
11
+ "aria-disabled": e.disabled,
12
+ onClick: n[1] || (n[1] = (a) => {
11
13
  e.open = !e.open, e.rotateIcon();
12
14
  })
13
15
  }, [
14
- d(i, {
16
+ u(i, {
15
17
  value: e.selectedValue,
16
18
  required: e.required,
19
+ disabled: e.disabled,
17
20
  label: e.label,
18
21
  items: e.items
19
- }, null, 8, ["value", "required", "label", "items"]),
20
- e.open ? (t(), r("div", {
22
+ }, null, 8, ["value", "required", "disabled", "label", "items"]),
23
+ e.open ? (o(), l("div", {
21
24
  key: 0,
22
25
  role: "group",
23
26
  "aria-orientation": "vertical",
24
27
  tabindex: "-1",
25
28
  class: "AT-SELECT_items-container",
26
- onClick: o[0] || (o[0] = c((n) => {
29
+ onClick: n[0] || (n[0] = c((a) => {
27
30
  e.open = !1, e.rotateIcon();
28
31
  }, ["stop"]))
29
32
  }, [
30
- (t(!0), r(f, null, v(e.items, (n) => (t(), C(s, {
31
- key: n.value,
32
- text: n.text,
33
- value: n.value,
34
- type: n.type,
35
- icon: n.icon,
36
- "aria-selected": n.value === e.valueOfModel,
37
- "data-text": n.text,
38
- "on-click": async (p) => {
39
- var a;
40
- e.isInternalChange = !0, await e.onSelectedValueChange(n), (a = n.onClick) == null || a.call(n, p), e.isInternalChange = !1;
33
+ (o(!0), l(v, null, f(e.items, (a) => (o(), C(s, {
34
+ key: a.value,
35
+ text: a.text,
36
+ value: a.value,
37
+ type: a.type,
38
+ icon: a.icon,
39
+ "aria-selected": a.value === e.valueOfModel,
40
+ "data-text": a.text,
41
+ "on-click": async (d) => {
42
+ var r;
43
+ e.isInternalChange = !0, await e.onSelectedValueChange(a), (r = a.onClick) == null || r.call(a, d), e.isInternalChange = !1;
41
44
  }
42
45
  }, null, 8, ["text", "value", "type", "icon", "aria-selected", "data-text", "on-click"]))), 128))
43
- ])) : k("", !0)
44
- ], 512);
46
+ ])) : b("", !0)
47
+ ], 8, m);
45
48
  }
46
- const V = /* @__PURE__ */ m(u, [["render", g], ["__scopeId", "data-v-323bf049"]]);
49
+ const q = /* @__PURE__ */ k(p, [["render", g], ["__scopeId", "data-v-a9cd00e1"]]);
47
50
  export {
48
- V as default
51
+ q as default
49
52
  };
@@ -1,11 +1,11 @@
1
- import { defineComponent as y, ref as r, provide as c, watch as d, computed as p } from "vue";
2
- import g from "../Item/Item.vue.js";
3
- import A from "../Select.core.vue.js";
4
- const q = y({
1
+ import { defineComponent as p, ref as u, provide as f, watch as c, computed as g, onMounted as A } from "vue";
2
+ import S from "../Item/Item.vue.js";
3
+ import V from "../Select.core.vue.js";
4
+ const O = p({
5
5
  name: "AtSingleSelect",
6
6
  components: {
7
- AtSingleCore: A,
8
- AtItem: g
7
+ AtSingleCore: V,
8
+ AtItem: S
9
9
  },
10
10
  props: {
11
11
  modelValue: {
@@ -25,12 +25,16 @@ const q = y({
25
25
  items: {
26
26
  type: Array,
27
27
  default: () => [],
28
- validator: (t) => Array.isArray(t) && t.every((n) => typeof n == "object")
28
+ validator: (t) => Array.isArray(t) && t.every((i) => typeof i == "object")
29
29
  },
30
30
  emitValue: {
31
31
  type: Boolean,
32
32
  default: !1
33
33
  },
34
+ disabled: {
35
+ type: Boolean,
36
+ default: !1
37
+ },
34
38
  error: {
35
39
  type: Object,
36
40
  default: () => {
@@ -38,25 +42,31 @@ const q = y({
38
42
  }
39
43
  },
40
44
  emits: ["update:modelValue"],
41
- setup(t, { emit: n }) {
42
- const i = r(null), u = r(!1), a = r(t.modelValue), o = r(!1);
43
- c("error", t.error), d(t.error, () => c("error", t.error));
45
+ setup(t, { emit: i }) {
46
+ const o = u(null), r = u(!1), a = u(t.modelValue), n = u(!1);
47
+ f("error", t.error), c(t.error, () => f("error", t.error));
44
48
  const s = (e) => {
45
- a.value = e, u.value = !1, f(), n(
49
+ a.value = e, r.value = !1, d(), i(
46
50
  "update:modelValue",
47
51
  t.emitValue ? a.value.value : a.value
48
52
  );
49
- }, m = p(() => {
53
+ }, v = g(() => {
50
54
  var e;
51
55
  return typeof a.value == "string" ? a.value : (e = a.value) == null ? void 0 : e.value;
52
56
  });
53
- d(
57
+ function m(e) {
58
+ var l;
59
+ r.value === !0 && !((l = o == null ? void 0 : o.value) != null && l.contains(e.target)) && (r.value = !1);
60
+ }
61
+ A(() => {
62
+ document.addEventListener("click", m);
63
+ }), c(
54
64
  () => t.modelValue,
55
65
  async (e) => {
56
- if (o.value)
66
+ if (n.value)
57
67
  return;
58
68
  const l = t.items.find(
59
- (v) => v.value === (typeof e == "string" ? e : e.value)
69
+ (y) => y.value === (typeof e == "string" ? e : e.value)
60
70
  );
61
71
  if (!l) {
62
72
  console.warn(
@@ -64,25 +74,25 @@ const q = y({
64
74
  ), a.value = "";
65
75
  return;
66
76
  }
67
- o.value = !0, await s(l), o.value = !1;
77
+ n.value = !0, await s(l), n.value = !1;
68
78
  }
69
79
  );
70
- const f = () => {
80
+ const d = () => {
71
81
  var l;
72
- const e = (l = i.value) == null ? void 0 : l.querySelector(".AT_INPUT_icon_slot");
73
- e instanceof HTMLElement && e.setAttribute("data-rotate", u.value.toString());
82
+ const e = (l = o.value) == null ? void 0 : l.querySelector(".AT_INPUT_icon_slot");
83
+ e instanceof HTMLElement && e.setAttribute("data-rotate", r.value.toString());
74
84
  };
75
85
  return {
76
86
  onSelectedValueChange: s,
77
87
  selectedValue: a,
78
- open: u,
79
- valueOfModel: m,
80
- containerRef: i,
81
- isInternalChange: o,
82
- rotateIcon: f
88
+ open: r,
89
+ valueOfModel: v,
90
+ containerRef: o,
91
+ isInternalChange: n,
92
+ rotateIcon: d
83
93
  };
84
94
  }
85
95
  });
86
96
  export {
87
- q as default
97
+ O as default
88
98
  };
@@ -28,6 +28,10 @@ export declare const AtSelect: {
28
28
  type: BooleanConstructor;
29
29
  default: boolean;
30
30
  };
31
+ disabled: {
32
+ type: BooleanConstructor;
33
+ default: boolean;
34
+ };
31
35
  error: {
32
36
  type: ObjectConstructor;
33
37
  default: () => void;
@@ -73,6 +77,10 @@ export declare const AtSelect: {
73
77
  type: BooleanConstructor;
74
78
  default: boolean;
75
79
  };
80
+ disabled: {
81
+ type: BooleanConstructor;
82
+ default: boolean;
83
+ };
76
84
  error: {
77
85
  type: ObjectConstructor;
78
86
  default: () => void;
@@ -83,6 +91,7 @@ export declare const AtSelect: {
83
91
  required: boolean;
84
92
  label: string;
85
93
  error: Record<string, any>;
94
+ disabled: boolean;
86
95
  modelValue: string | ISelectItemProps;
87
96
  items: ISelectItemProps[];
88
97
  emitValue: boolean;
@@ -1,4 +1,4 @@
1
- :root{--at-primary-color-1: rgba(85, 0, 115, 1);--at-primary-color-2: rgba(181, 101, 210, 1);--at-primary-color-3: rgba(251, 166, 255, 1);--at-primary-color-header: rgba(225, 206, 232, 1);--at-secondary-color-1: rgba(40, 42, 143, 1);--at-secondary-color-2: rgba(135, 118, 232, 1);--at-secondary-color-3: rgba(204, 181, 255, 1);--at-tertiary-color-1: rgba(123, 51, 226, 1);--at-tertiary-color-2: rgba(182, 130, 243, 1);--at-tertiary-color-3: rgba(228, 194, 255, 1);--at-black: rgba(22, 22, 23, 1);--at-dark-grey: #a0a0a0;--at-medium-grey: rgba(214, 214, 214, 1);--at-light-grey: #f1f1f1;--at-background: #fcfcfc;--at-white: rgba(255, 255, 255, 1);--at-hover: rgba(225, 206, 232, 1);--at-line: rgba(241, 237, 242, 1);--at-disabled-background: rgba(214, 214, 214, 1);--at-disabled-text: rgba(160, 160, 160, 1);--at-error: rgba(203, 74, 80, 1);--at-light-error: rgba(243, 232, 232, 1);--at-success: rgba(127, 202, 115, 1);--at-light-success: rgba(232, 243, 232, 1);--at-warning: rgba(238, 204, 85, 1);--at-light-warning: rgba(246, 242, 206, 1);--at-info: rgba(84, 186, 210, 1);--at-light-info: rgba(232, 241, 243, 1);--at-default-transition: all 0.2s;--at-primary-font-family: "Nunito", sans-serif;--at-background-divider: rgba(45, 47, 57, 1)}body{background:#f1f1f1 !important;font-family:"Nunito",sans-serif}:root{--at-primary-color-1: rgba(85, 0, 115, 1);--at-primary-color-2: rgba(181, 101, 210, 1);--at-primary-color-3: rgba(251, 166, 255, 1);--at-primary-color-header: rgba(225, 206, 232, 1);--at-secondary-color-1: rgba(40, 42, 143, 1);--at-secondary-color-2: rgba(135, 118, 232, 1);--at-secondary-color-3: rgba(204, 181, 255, 1);--at-tertiary-color-1: rgba(123, 51, 226, 1);--at-tertiary-color-2: rgba(182, 130, 243, 1);--at-tertiary-color-3: rgba(228, 194, 255, 1);--at-black: rgba(22, 22, 23, 1);--at-dark-grey: #a0a0a0;--at-medium-grey: rgba(214, 214, 214, 1);--at-light-grey: #f1f1f1;--at-background: #fcfcfc;--at-white: rgba(255, 255, 255, 1);--at-hover: rgba(225, 206, 232, 1);--at-line: rgba(241, 237, 242, 1);--at-disabled-background: rgba(214, 214, 214, 1);--at-disabled-text: rgba(160, 160, 160, 1);--at-error: rgba(203, 74, 80, 1);--at-light-error: rgba(243, 232, 232, 1);--at-success: rgba(127, 202, 115, 1);--at-light-success: rgba(232, 243, 232, 1);--at-warning: rgba(238, 204, 85, 1);--at-light-warning: rgba(246, 242, 206, 1);--at-info: rgba(84, 186, 210, 1);--at-light-info: rgba(232, 241, 243, 1);--at-default-transition: all 0.2s;--at-primary-font-family: "Nunito", sans-serif;--at-background-divider: rgba(45, 47, 57, 1)}.alert-s1{background-color:#282a8f;color:#fff}.alert-s2{background-color:#8776e8;color:#fff}.alert-s3{background-color:#ccb5ff;color:#fff}.alert-t1{background-color:#7b33e2;color:#fff}.alert-t2{background-color:#b682f3;color:#fff}.alert-t3{background-color:#e4c2ff;color:#fff}/*!
1
+ :root{--at-primary-color-1: rgba(85, 0, 115, 1);--at-primary-color-2: rgba(181, 101, 210, 1);--at-primary-color-3: rgba(251, 166, 255, 1);--at-primary-color-header: rgba(225, 206, 232, 1);--at-secondary-color-1: rgba(40, 42, 143, 1);--at-secondary-color-2: rgba(135, 118, 232, 1);--at-secondary-color-3: rgba(204, 181, 255, 1);--at-tertiary-color-1: rgba(123, 51, 226, 1);--at-tertiary-color-2: rgba(182, 130, 243, 1);--at-tertiary-color-3: rgba(228, 194, 255, 1);--at-black: rgba(22, 22, 23, 1);--at-dark-grey: #a0a0a0;--at-medium-grey: rgba(214, 214, 214, 1);--at-light-grey: #f1f1f1;--at-background: #fcfcfc;--at-white: rgba(255, 255, 255, 1);--at-hover: rgba(225, 206, 232, 1);--at-line: rgba(241, 237, 242, 1);--at-disabled-background: rgba(214, 214, 214, 1);--at-disabled-text: rgba(160, 160, 160, 1);--at-error: rgba(203, 74, 80, 1);--at-light-error: rgba(243, 232, 232, 1);--at-success: rgba(127, 202, 115, 1);--at-light-success: rgba(232, 243, 232, 1);--at-warning: rgba(238, 204, 85, 1);--at-light-warning: rgba(246, 242, 206, 1);--at-info: rgba(84, 186, 210, 1);--at-light-info: rgba(232, 241, 243, 1);--at-default-transition: all 0.2s;--at-primary-font-family: "Nunito", sans-serif;--at-background-divider: rgba(45, 47, 57, 1)}:root{--at-primary-color-1: rgba(85, 0, 115, 1);--at-primary-color-2: rgba(181, 101, 210, 1);--at-primary-color-3: rgba(251, 166, 255, 1);--at-primary-color-header: rgba(225, 206, 232, 1);--at-secondary-color-1: rgba(40, 42, 143, 1);--at-secondary-color-2: rgba(135, 118, 232, 1);--at-secondary-color-3: rgba(204, 181, 255, 1);--at-tertiary-color-1: rgba(123, 51, 226, 1);--at-tertiary-color-2: rgba(182, 130, 243, 1);--at-tertiary-color-3: rgba(228, 194, 255, 1);--at-black: rgba(22, 22, 23, 1);--at-dark-grey: #a0a0a0;--at-medium-grey: rgba(214, 214, 214, 1);--at-light-grey: #f1f1f1;--at-background: #fcfcfc;--at-white: rgba(255, 255, 255, 1);--at-hover: rgba(225, 206, 232, 1);--at-line: rgba(241, 237, 242, 1);--at-disabled-background: rgba(214, 214, 214, 1);--at-disabled-text: rgba(160, 160, 160, 1);--at-error: rgba(203, 74, 80, 1);--at-light-error: rgba(243, 232, 232, 1);--at-success: rgba(127, 202, 115, 1);--at-light-success: rgba(232, 243, 232, 1);--at-warning: rgba(238, 204, 85, 1);--at-light-warning: rgba(246, 242, 206, 1);--at-info: rgba(84, 186, 210, 1);--at-light-info: rgba(232, 241, 243, 1);--at-default-transition: all 0.2s;--at-primary-font-family: "Nunito", sans-serif;--at-background-divider: rgba(45, 47, 57, 1)}.alert-s1{background-color:#282a8f;color:#fff}.alert-s2{background-color:#8776e8;color:#fff}.alert-s3{background-color:#ccb5ff;color:#fff}.alert-t1{background-color:#7b33e2;color:#fff}.alert-t2{background-color:#b682f3;color:#fff}.alert-t3{background-color:#e4c2ff;color:#fff}/*!
2
2
  * Bootstrap v5.3.3 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2024 The Bootstrap Authors
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)