adverich-kun-ui 0.1.606 → 0.1.607

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,12 +1,12 @@
1
- import { toRefs as Re, useModel as Ee, ref as w, watch as se, computed as te, onMounted as Me, openBlock as l, createElementBlock as a, mergeProps as L, unref as s, renderSlot as i, createCommentVNode as n, createElementVNode as b, toDisplayString as O, Fragment as oe, createBlock as F, withCtx as z, createVNode as T, normalizeClass as j, withDirectives as le, vModelText as Be, vShow as ae, normalizeProps as d, guardReactiveProps as h, createSlots as ne, renderList as re, isRef as Ve, mergeModels as ie, nextTick as He } from "vue";
2
- import { isMobile as u, smAndDown as Ke } from "../../../../utils/_platform.js";
1
+ import { toRefs as Re, useModel as Ee, ref as w, watch as se, computed as te, onMounted as Me, openBlock as l, createElementBlock as a, mergeProps as O, unref as s, renderSlot as i, createCommentVNode as r, createElementVNode as b, toDisplayString as z, Fragment as oe, createBlock as F, withCtx as D, createVNode as T, normalizeClass as U, withDirectives as le, vModelText as Be, vShow as ae, normalizeProps as d, guardReactiveProps as h, createSlots as re, renderList as ne, isRef as Ve, mergeModels as ie, nextTick as He } from "vue";
2
+ import { isMobile as u, mdAndUp as Ke } from "../../../../utils/_platform.js";
3
3
  import ce from "../../../KunIcon/src/components/KunIcon.vue.js";
4
- import De from "../../../../icons/IconFilter.vue.js";
5
- import Le from "../../../../icons/IconSearch.vue.js";
6
- import Oe from "./KunTableHeaders.vue.js";
7
- import ze from "./KunTableFooter.vue.js";
8
- import je from "./KunTableRows.vue.js";
9
- import Ue from "./KunTableIterators.vue.js";
4
+ import Le from "../../../../icons/IconFilter.vue.js";
5
+ import Oe from "../../../../icons/IconSearch.vue.js";
6
+ import ze from "./KunTableHeaders.vue.js";
7
+ import De from "./KunTableFooter.vue.js";
8
+ import Ue from "./KunTableRows.vue.js";
9
+ import je from "./KunTableIterators.vue.js";
10
10
  import xe from "../../../KunBtn/src/components/KunBtn.vue.js";
11
11
  import Ne from "./KunTableFilter.vue.js";
12
12
  import We from "../composables/useExpand.js";
@@ -24,10 +24,10 @@ const Ye = {
24
24
  }, _e = {
25
25
  key: 1,
26
26
  class: "inline-flex items-center justify-center whitespace-nowrap"
27
- }, es = { class: "pr-2" }, ss = { class: "min-w-1/3 flex h-full items-center justify-end" }, ts = ["placeholder"], os = { class: "flex-1 overflow-auto bg-surface" }, ls = { key: 0 }, as = { key: 5 }, ns = {
27
+ }, es = { class: "pr-2" }, ss = { class: "min-w-1/3 flex h-full items-center justify-end" }, ts = ["placeholder"], os = { class: "flex-1 overflow-auto bg-surface" }, ls = { key: 0 }, as = { key: 5 }, rs = {
28
28
  key: 1,
29
29
  class: "h-full flex justify-center items-center"
30
- }, rs = { class: "text-center text-4xl" }, is = {
30
+ }, ns = { class: "text-center text-4xl" }, is = {
31
31
  key: 1,
32
32
  class: "sticky bottom-0 z-10 print:hidden"
33
33
  }, cs = "overflow-hidden h-full w-full flex flex-col border border-slate-200 dark:border-slate-800 rounded", ds = "table-auto w-full h-fit text-sm text-left", Is = {
@@ -37,8 +37,8 @@ const Ye = {
37
37
  selectedItemsModifiers: {}
38
38
  }),
39
39
  emits: /* @__PURE__ */ ie(["update:page", "update:itemsPerPage", "update:sortBy", "update:search", "focusOnSearch"], ["update:selectedItems"]),
40
- setup(U, { emit: de }) {
41
- const S = de, p = U, P = Re(p), A = Ee(U, "selectedItems"), {
40
+ setup(j, { emit: de }) {
41
+ const S = de, p = j, P = Re(p), A = Ee(j, "selectedItems"), {
42
42
  headers: x,
43
43
  showExpand: I,
44
44
  showSelect: R,
@@ -60,8 +60,8 @@ const Ye = {
60
60
  var o;
61
61
  const t = { ...e };
62
62
  if (e.columnType === "function" && typeof e.columnFunction == "string") {
63
- const r = (o = p.functionMap) == null ? void 0 : o[e.columnFunction];
64
- typeof r == "function" ? t.columnFunction = r : t.columnFunction = () => "";
63
+ const n = (o = p.functionMap) == null ? void 0 : o[e.columnFunction];
64
+ typeof n == "function" ? t.columnFunction = n : t.columnFunction = () => "";
65
65
  }
66
66
  return t;
67
67
  })), { filteredItems: y, setSearch: ve, modalFilter: v, applyColumnFilters: we, clearFilters: be, appliedFilters: Se } = Ge(P, ye, k);
@@ -69,9 +69,9 @@ const Ye = {
69
69
  S("update:search", e), ve(e);
70
70
  });
71
71
  const { options: c, paginatedItems: m, updateSort: ke } = Qe(P, S, y, k), C = (e, t = -1) => Je(e, ue.value, t), Q = (e, t = -1) => C(e, t) ?? `kun-table-row-${t}`, q = (e, t = -1) => {
72
- var r;
72
+ var n;
73
73
  const o = C(e, t);
74
- return o === null ? !1 : ((r = p.actionLoadingMap) == null ? void 0 : r[o]) || !1;
74
+ return o === null ? !1 : ((n = p.actionLoadingMap) == null ? void 0 : n[o]) || !1;
75
75
  }, {
76
76
  isSelected: E,
77
77
  toggleSelect: M,
@@ -112,26 +112,26 @@ const Ye = {
112
112
  u.value && (K.value = "w-full border", $.value = !1, H.value = !0, S("focusOnSearch", !0));
113
113
  }
114
114
  const K = w("w-full border max-w-sm");
115
- return (e, t) => (l(), a("div", L({ class: Te }, e.$attrs, { style: { "user-select": "text" } }), [
115
+ return (e, t) => (l(), a("div", O({ class: Te }, e.$attrs, { style: { "user-select": "text" } }), [
116
116
  s(W) || e.filterable || e.$slots.prependHeader || e.$slots.prependSearch || e.$slots.appendSearch ? (l(), a("div", Ye, [
117
117
  $.value || !s(u) ? (l(), a("div", Ze, [
118
118
  i(e.$slots, "prependHeader")
119
- ])) : n("", !0),
120
- A.value.length && !s(Ke) ? (l(), a("div", _e, [
121
- b("span", es, "Se han seleccionado " + O(A.value.length) + " registros.", 1),
119
+ ])) : r("", !0),
120
+ A.value.length && s(Ke) ? (l(), a("div", _e, [
121
+ b("span", es, "Se han seleccionado " + z(A.value.length) + " registros.", 1),
122
122
  s(m).length !== s(y).length ? (l(), a(oe, { key: 0 }, [
123
123
  s(G) && !s(J) ? (l(), a("span", {
124
124
  key: 0,
125
125
  onClick: t[0] || (t[0] = (...o) => s(Y) && s(Y)(...o)),
126
126
  class: "bg-secondary hover:!bg-blue-500 rounded cursor-pointer px-2 ml-2"
127
- }, " Seleccionar todos los " + O(s(y).length) + " registros ", 1)) : n("", !0),
127
+ }, " Seleccionar todos los " + z(s(y).length) + " registros ", 1)) : r("", !0),
128
128
  s(J) ? (l(), a("span", {
129
129
  key: 1,
130
130
  onClick: t[1] || (t[1] = (...o) => s(X) && s(X)(...o)),
131
131
  class: "bg-secondary hover:!bg-blue-500 rounded cursor-pointer px-2 ml-2"
132
- }, " Anular selección ")) : n("", !0)
133
- ], 64)) : n("", !0)
134
- ])) : n("", !0),
132
+ }, " Anular selección ")) : r("", !0)
133
+ ], 64)) : r("", !0)
134
+ ])) : r("", !0),
135
135
  b("div", ss, [
136
136
  i(e.$slots, "prependSearch"),
137
137
  e.filterable && e.filters.length ? (l(), F(xe, {
@@ -142,24 +142,24 @@ const Ye = {
142
142
  size: "xs",
143
143
  bgColor: "bg-green-200 dark:bg-green-800"
144
144
  }, {
145
- default: z(() => [
145
+ default: D(() => [
146
146
  T(ce, {
147
147
  class: "h-fit",
148
- icon: De,
148
+ icon: Le,
149
149
  size: "text-lg"
150
150
  })
151
151
  ]),
152
152
  _: 1
153
- })) : n("", !0),
153
+ })) : r("", !0),
154
154
  s(W) ? (l(), a("div", {
155
155
  key: 1,
156
- class: j(["rounded flex mx-2", [K.value]])
156
+ class: U(["rounded flex mx-2", [K.value]])
157
157
  }, [
158
158
  le(b("input", {
159
159
  "onUpdate:modelValue": t[3] || (t[3] = (o) => g.value = o),
160
160
  type: "text",
161
161
  placeholder: e.searchPlaceholder,
162
- class: j(["w-full text-sm", s(u) ? "px-1" : "px-2 py-1"]),
162
+ class: U(["w-full text-sm", s(u) ? "px-1" : "px-2 py-1"]),
163
163
  ref_key: "searchRef",
164
164
  ref: Z,
165
165
  onFocus: ee,
@@ -169,24 +169,24 @@ const Ye = {
169
169
  [ae, H.value]
170
170
  ]),
171
171
  le(T(ce, {
172
- icon: Le,
172
+ icon: Oe,
173
173
  onClick: Ae
174
174
  }, null, 512), [
175
175
  [ae, $.value]
176
176
  ])
177
- ], 2)) : n("", !0),
177
+ ], 2)) : r("", !0),
178
178
  i(e.$slots, "appendSearch")
179
179
  ])
180
- ])) : n("", !0),
180
+ ])) : r("", !0),
181
181
  b("div", os, [
182
182
  s(m).length ? (l(), a("table", {
183
183
  key: 0,
184
- class: j(Pe)
184
+ class: U(Pe)
185
185
  }, [
186
186
  e.$slots.colgroup && !s(u) ? (l(), a("colgroup", ls, [
187
187
  i(e.$slots, "colgroup", d(h(f.value)))
188
- ])) : n("", !0),
189
- !s(me) && !s(u) ? (l(), F(Oe, {
188
+ ])) : r("", !0),
189
+ !s(me) && !s(u) ? (l(), F(ze, {
190
190
  key: 1,
191
191
  headers: s(x),
192
192
  "sort-by": s(c).sortBy,
@@ -203,8 +203,8 @@ const Ye = {
203
203
  onSort: s(ke),
204
204
  onToggleSelectAll: s(Ce),
205
205
  customHeaders: e.customSlots
206
- }, null, 8, ["headers", "sort-by", "show-select", "show-expand", "all-selected", "more-than-paginated", "some-selected", "thead-class", "tr-class", "th-class", "has-actions", "action-label", "onSort", "onToggleSelectAll", "customHeaders"])) : i(e.$slots, "thead", d(L({ key: 2 }, f.value))),
207
- s(u) ? (l(), F(Ue, {
206
+ }, null, 8, ["headers", "sort-by", "show-select", "show-expand", "all-selected", "more-than-paginated", "some-selected", "thead-class", "tr-class", "th-class", "has-actions", "action-label", "onSort", "onToggleSelectAll", "customHeaders"])) : i(e.$slots, "thead", d(O({ key: 2 }, f.value))),
207
+ s(u) ? (l(), F(je, {
208
208
  key: 4,
209
209
  items: s(m),
210
210
  headers: k.value,
@@ -221,16 +221,16 @@ const Ye = {
221
221
  onToggleSelect: s(M),
222
222
  customSlots: e.customSlots,
223
223
  "get-action-loading": q
224
- }, ne({ _: 2 }, [
225
- re(e.$slots, (o, r) => ({
226
- name: r,
227
- fn: z((D) => [
228
- i(e.$slots, r, d(h(D)))
224
+ }, re({ _: 2 }, [
225
+ ne(e.$slots, (o, n) => ({
226
+ name: n,
227
+ fn: D((L) => [
228
+ i(e.$slots, n, d(h(L)))
229
229
  ])
230
230
  }))
231
231
  ]), 1032, ["items", "headers", "row-class", "row-class-condition", "is-selected", "is-expanded", "show-select", "show-expand", "has-actions", "action-loading-map", "onToggleExpand", "onToggleSelect", "customSlots"])) : (l(), a(oe, { key: 3 }, [
232
232
  i(e.$slots, "body.prepend", d(h(f.value))),
233
- T(je, {
233
+ T(Ue, {
234
234
  items: s(m),
235
235
  headers: k.value,
236
236
  "tbody-class": e.tbodyClass,
@@ -251,11 +251,11 @@ const Ye = {
251
251
  onToggleSelect: s(M),
252
252
  customSlots: e.customSlots,
253
253
  "get-action-loading": q
254
- }, ne({ _: 2 }, [
255
- re(e.$slots, (o, r) => ({
256
- name: r,
257
- fn: z((D) => [
258
- i(e.$slots, r, d(h(D)))
254
+ }, re({ _: 2 }, [
255
+ ne(e.$slots, (o, n) => ({
256
+ name: n,
257
+ fn: D((L) => [
258
+ i(e.$slots, n, d(h(L)))
259
259
  ])
260
260
  }))
261
261
  ]), 1032, ["items", "headers", "tbody-class", "row-class", "row-class-condition", "tr-class", "td-class", "selected-class", "striped-class", "is-selected", "is-expanded", "show-select", "show-expand", "has-actions", "action-loading-map", "onToggleExpand", "onToggleSelect", "customSlots"]),
@@ -263,14 +263,14 @@ const Ye = {
263
263
  ], 64)),
264
264
  e.$slots.tfoot ? (l(), a("tfoot", as, [
265
265
  i(e.$slots, "tfoot", d(h(f.value)))
266
- ])) : n("", !0)
267
- ])) : n("", !0),
268
- s(m).length ? n("", !0) : (l(), a("div", ns, [
269
- b("div", rs, O(e.noDataText), 1)
266
+ ])) : r("", !0)
267
+ ])) : r("", !0),
268
+ s(m).length ? r("", !0) : (l(), a("div", rs, [
269
+ b("div", ns, z(e.noDataText), 1)
270
270
  ]))
271
271
  ]),
272
- s(pe) ? i(e.$slots, "footer", d(L({ key: 2 }, f.value))) : (l(), a("div", is, [
273
- T(ze, {
272
+ s(pe) ? i(e.$slots, "footer", d(O({ key: 2 }, f.value))) : (l(), a("div", is, [
273
+ T(De, {
274
274
  "items-length": s(y).length,
275
275
  "items-per-page": s(c).itemsPerPage,
276
276
  "current-page": s(c).page,
@@ -287,7 +287,7 @@ const Ye = {
287
287
  onApplyFilters: s(we),
288
288
  onClearFilters: s(be),
289
289
  activeFilters: s(Se).byColumn
290
- }, null, 8, ["filters", "modelValue", "onApplyFilters", "onClearFilters", "activeFilters"])) : n("", !0)
290
+ }, null, 8, ["filters", "modelValue", "onApplyFilters", "onClearFilters", "activeFilters"])) : r("", !0)
291
291
  ], 16));
292
292
  }
293
293
  };
@@ -1,14 +1,14 @@
1
1
  import { computed as i, ref as x } from "vue";
2
- const d = typeof window < "u";
2
+ const s = typeof window < "u";
3
3
  function f() {
4
4
  var t, a, u, r, v;
5
- if (!d)
5
+ if (!s)
6
6
  return { os: "Server", osVersion: "Unknown" };
7
- const o = window.navigator.userAgent;
8
- let l = "Unknown OS", s = "Unknown Version";
9
- return /Mac/.test(o) ? (l = "Mac OS", s = (a = (t = o.match(/Mac OS X (\d+[\._]\d+[\._]\d+)/)) == null ? void 0 : t[1]) == null ? void 0 : a.replace(/_/g, ".")) : /iPhone|iPad|iPod/.test(o) ? (l = "iOS", s = ((u = o.match(/OS (\d+)[._](\d+)[._]?(\d+)?/)) == null ? void 0 : u.slice(1, 4).join(".")) || "Unknown") : /Windows/.test(o) ? (l = "Windows", s = (r = o.match(/Windows NT (\d+\.\d+)/)) == null ? void 0 : r[1]) : /Android/.test(o) ? (l = "Android", s = (v = o.match(/Android (\d+\.\d+)/)) == null ? void 0 : v[1]) : /Linux/.test(o) && (l = "Linux"), { os: l, osVersion: s };
7
+ const l = window.navigator.userAgent;
8
+ let o = "Unknown OS", d = "Unknown Version";
9
+ return /Mac/.test(l) ? (o = "Mac OS", d = (a = (t = l.match(/Mac OS X (\d+[\._]\d+[\._]\d+)/)) == null ? void 0 : t[1]) == null ? void 0 : a.replace(/_/g, ".")) : /iPhone|iPad|iPod/.test(l) ? (o = "iOS", d = ((u = l.match(/OS (\d+)[._](\d+)[._]?(\d+)?/)) == null ? void 0 : u.slice(1, 4).join(".")) || "Unknown") : /Windows/.test(l) ? (o = "Windows", d = (r = l.match(/Windows NT (\d+\.\d+)/)) == null ? void 0 : r[1]) : /Android/.test(l) ? (o = "Android", d = (v = l.match(/Android (\d+\.\d+)/)) == null ? void 0 : v[1]) : /Linux/.test(l) && (o = "Linux"), { os: o, osVersion: d };
10
10
  }
11
- const e = x(d ? window.innerWidth : 1024), m = x(d ? window.innerHeight : 768), w = f(), h = i(
11
+ const e = x(s ? window.innerWidth : 1024), m = x(s ? window.innerHeight : 768), w = f(), h = i(
12
12
  () => w.os === "iOS" || w.os === "Android" || m.value > e.value
13
13
  ), n = {
14
14
  xs: 475,
@@ -26,26 +26,26 @@ i(() => e.value >= n.xl && e.value < n.xxl);
26
26
  i(() => e.value >= n.xxl);
27
27
  i(() => e.value >= n.xs);
28
28
  i(() => e.value >= n.sm);
29
- i(() => e.value >= n.md);
29
+ const S = i(() => e.value >= n.md);
30
30
  i(() => e.value >= n.lg);
31
31
  i(() => e.value >= n.xl);
32
32
  i(() => e.value >= n.xxl);
33
33
  i(() => e.value < n.sm);
34
- const S = i(() => e.value < n.md);
34
+ i(() => e.value < n.md);
35
35
  i(() => e.value < n.lg);
36
36
  i(() => e.value < n.xl);
37
37
  i(() => e.value < n.xxl);
38
38
  i(() => e.value < n.xxl);
39
39
  function c() {
40
- d && (e.value = window.innerWidth, m.value = window.innerHeight);
40
+ s && (e.value = window.innerWidth, m.value = window.innerHeight);
41
41
  }
42
- d && (window.addEventListener("resize", c), window.addEventListener("beforeunload", () => {
42
+ s && (window.addEventListener("resize", c), window.addEventListener("beforeunload", () => {
43
43
  window.removeEventListener("resize", c);
44
44
  }));
45
45
  export {
46
46
  h as isMobile,
47
47
  w as kunOS,
48
+ S as mdAndUp,
48
49
  m as screenHeight,
49
- e as screenWidth,
50
- S as smAndDown
50
+ e as screenWidth
51
51
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.606",
3
+ "version": "0.1.607",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",