energy-components 1.22.0 → 1.24.0

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,4 +1,4 @@
1
- import { defineComponent as H, toRefs as F, ref as i, watch as M, watchEffect as N, createElementBlock as g, openBlock as u, createBlock as V, withDirectives as K, Fragment as z, renderList as h, unref as S, renderSlot as P, mergeProps as q, createSlots as B, withCtx as C, normalizeProps as w, guardReactiveProps as A, createVNode as G, vShow as J } from "vue";
1
+ import { defineComponent as H, toRefs as V, ref as s, watch as F, watchEffect as M, createElementBlock as h, openBlock as m, createBlock as N, withDirectives as K, Fragment as z, renderList as b, unref as A, renderSlot as P, mergeProps as q, createSlots as B, withCtx as C, normalizeProps as w, guardReactiveProps as E, createVNode as G, vShow as J } from "vue";
2
2
  import Q from "./tableslotedcomponent.es.js";
3
3
  import U from "./pagination.es.js";
4
4
  import { _ as W } from "./_plugin-vue_export-helper-CHgC5LLL.js";
@@ -30,19 +30,19 @@ import './style/tablepaginatedcomponent.css';const X = { class: "table_paginated
30
30
  disableFirstLoad: { type: Boolean }
31
31
  },
32
32
  emits: ["update:options", "update:reset", "update:selection", "update:selectedAll", "update:sort", "onItemExpansion"],
33
- setup(c, { expose: E, emit: x }) {
34
- const t = c, s = x, {
35
- loading: I,
33
+ setup(u, { expose: I, emit: x }) {
34
+ const t = u, i = x, {
35
+ loading: L,
36
36
  items: d,
37
- selectableKey: L,
37
+ selectableKey: y,
38
38
  header: $,
39
- asynchrone: b
40
- } = F(t), m = i(), p = i([]), n = i([]), y = i({
39
+ asynchrone: k
40
+ } = V(t), v = s(), r = s([]), n = s([]), p = s({
41
41
  item: {
42
42
  header: $,
43
- items: p
43
+ items: r
44
44
  },
45
- selectableKey: L,
45
+ selectableKey: y,
46
46
  listChecked: n,
47
47
  checkedAll: t.checkedAll,
48
48
  initChecked: [],
@@ -53,68 +53,74 @@ import './style/tablepaginatedcomponent.css';const X = { class: "table_paginated
53
53
  hideSelectAll: t.hideSelectAll,
54
54
  showEmptyState: t.showEmptyState,
55
55
  mockItems: t.itemsPerPage[0]
56
- }), k = i(null), f = i(1), r = i(), D = () => {
57
- p.value = [], f.value = 1, r.value = void 0, s("update:reset");
56
+ }), S = s(null), f = s(1), c = s(), D = () => {
57
+ r.value = [], f.value = 1, c.value = void 0, i("update:reset");
58
58
  }, O = () => {
59
- p.value = d.value;
59
+ r.value = d.value;
60
60
  }, T = (e) => {
61
- const a = {};
61
+ const l = {};
62
62
  if ("pagination" in e) {
63
- const l = e.pagination;
64
- l.reset && D();
63
+ const a = e.pagination;
64
+ a.reset && D();
65
65
  let o = !1;
66
- r.value = l, (l.page ?? 0) > f.value && (f.value = l.page ?? 0, o = !0), r.value && (r.value.isNewPage = o);
66
+ c.value = a, (a.page ?? 0) > f.value && (f.value = a.page ?? 0, o = !0), c.value && (c.value.isNewPage = o);
67
67
  }
68
- r.value && Object.assign(a, r.value), m.value && m.value.clearVisibleDetails(), s("update:options", a);
68
+ c.value && Object.assign(l, c.value), v.value && v.value.clearVisibleDetails(), i("update:options", l);
69
69
  }, _ = (e) => {
70
- const a = n.value.indexOf(e);
71
- a > -1 ? n.value.splice(a, 1) : n.value.push(e), s("update:selection", n.value);
70
+ if (p.value.checkedAll && n.value.length === 0) {
71
+ const a = r.value.map(
72
+ (o) => String(o[y.value || "id"])
73
+ );
74
+ n.value = [...a], p.value.checkedAll = !1, i("update:selectedAll", !1);
75
+ }
76
+ const l = n.value.indexOf(e);
77
+ l > -1 ? n.value.splice(l, 1) : n.value.push(e), i("update:selection", n.value);
72
78
  }, j = () => {
73
79
  var e;
74
- (e = k.value) == null || e.resetPagination();
80
+ (e = S.value) == null || e.resetPagination();
75
81
  }, R = (e) => {
76
- e && (n.value = []), y.value.checkedAll = e, s("update:selectedAll", e);
82
+ e && (n.value = []), p.value.checkedAll = e, i("update:selectedAll", e);
77
83
  };
78
- return n.value = [...t.initChecked], b.value || (p.value = d.value), M(d, () => {
84
+ return n.value = [...t.initChecked], k.value || (r.value = d.value), F(d, () => {
79
85
  O();
80
- }, { deep: !0 }), N(() => {
81
- if (!b.value && d.value.length >= 0) {
82
- const e = (t.activePage - 1) * t.itemsPerPage[0], a = e + t.itemsPerPage[0];
83
- p.value = d.value.slice(e, a);
86
+ }, { deep: !0 }), M(() => {
87
+ if (!k.value && d.value.length >= 0) {
88
+ const e = (t.activePage - 1) * t.itemsPerPage[0], l = e + t.itemsPerPage[0];
89
+ r.value = d.value.slice(e, l);
84
90
  }
85
- }), E({
91
+ }), I({
86
92
  /** Fuerza a refrescar la paginacion y la tabla */
87
93
  $reset: j
88
- }), (e, a) => (u(), g("div", X, [
89
- e.$slots.mobile && c.isMobileDevice ? (u(!0), g(z, { key: 0 }, h(S(d), (l, o) => (u(), g("div", {
94
+ }), (e, l) => (m(), h("div", X, [
95
+ e.$slots.mobile && u.isMobileDevice ? (m(!0), h(z, { key: 0 }, b(A(d), (a, o) => (m(), h("div", {
90
96
  key: `mobile-${o}`,
91
- class: "table_paginted__mobile_item"
97
+ class: "table_paginated__mobile_item"
92
98
  }, [
93
- P(e.$slots, "mobile", { item: l }, void 0, !0)
94
- ]))), 128)) : (u(), V(Q, q({
99
+ P(e.$slots, "mobile", { item: a }, void 0, !0)
100
+ ]))), 128)) : (m(), N(Q, q({
95
101
  key: 1,
96
102
  ref_key: "tableSloted",
97
- ref: m,
103
+ ref: v,
98
104
  class: "mb-5"
99
- }, y.value, {
100
- loading: S(I),
101
- "is-mobile-device": c.isMobileDevice,
102
- "items-expanded": c.itemsExpanded,
105
+ }, p.value, {
106
+ loading: A(L),
107
+ "is-mobile-device": u.isMobileDevice,
108
+ "items-expanded": u.itemsExpanded,
103
109
  onOnClickCheckbox: _,
104
110
  onSelectAll: R,
105
- onOnItemExpansion: a[0] || (a[0] = (l) => s("onItemExpansion", l)),
106
- onOnHeaderSort: a[1] || (a[1] = (l) => s("update:sort", l))
111
+ onOnItemExpansion: l[0] || (l[0] = (a) => i("onItemExpansion", a)),
112
+ onOnHeaderSort: l[1] || (l[1] = (a) => i("update:sort", a))
107
113
  }), B({ _: 2 }, [
108
- h(e.$slots, (l, o) => ({
114
+ b(e.$slots, (a, o) => ({
109
115
  name: o,
110
- fn: C((v) => [
111
- P(e.$slots, o, w(A(v || {})), void 0, !0)
116
+ fn: C((g) => [
117
+ P(e.$slots, o, w(E(g || {})), void 0, !0)
112
118
  ])
113
119
  }))
114
120
  ]), 1040, ["loading", "is-mobile-device", "items-expanded"])),
115
121
  K(G(U, {
116
122
  ref_key: "paginationComponentRef",
117
- ref: k,
123
+ ref: S,
118
124
  class: "rds-mt-16",
119
125
  "total-items": t.totalItemsLength,
120
126
  "current-page": t.activePage,
@@ -123,20 +129,20 @@ import './style/tablepaginatedcomponent.css';const X = { class: "table_paginated
123
129
  "jump-to": t.jumpTo,
124
130
  selected: !0,
125
131
  "disable-first-load": t.disableFirstLoad,
126
- onPageChanged: a[2] || (a[2] = (l) => T({ pagination: l }))
132
+ onPageChanged: l[2] || (l[2] = (a) => T({ pagination: a }))
127
133
  }, B({ _: 2 }, [
128
- h(e.$slots, (l, o) => ({
134
+ b(e.$slots, (a, o) => ({
129
135
  name: o,
130
- fn: C((v) => [
131
- P(e.$slots, o, w(A(v || {})), void 0, !0)
136
+ fn: C((g) => [
137
+ P(e.$slots, o, w(E(g || {})), void 0, !0)
132
138
  ])
133
139
  }))
134
140
  ]), 1032, ["total-items", "current-page", "items-per-page", "hide-leyend", "jump-to", "disable-first-load"]), [
135
- [J, !c.hidePagination]
141
+ [J, !u.hidePagination]
136
142
  ])
137
143
  ]));
138
144
  }
139
- }), le = /* @__PURE__ */ W(Y, [["__scopeId", "data-v-862118a8"]]);
145
+ }), le = /* @__PURE__ */ W(Y, [["__scopeId", "data-v-6be5535e"]]);
140
146
  export {
141
147
  le as default
142
148
  };