@caipira/tamandua 0.0.29 → 0.0.30

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,5 +1,5 @@
1
1
  import './Table.css';
2
- import { defineComponent as L, useSlots as M, ref as k, reactive as F, computed as x, resolveComponent as K, openBlock as a, createElementBlock as s, createElementVNode as m, normalizeClass as p, createCommentVNode as c, createVNode as E, Fragment as h, renderList as V, toDisplayString as T, createBlock as b, renderSlot as $, createTextVNode as P } from "vue";
2
+ import { defineComponent as M, useSlots as O, ref as k, reactive as F, computed as x, resolveComponent as K, openBlock as a, createElementBlock as s, createElementVNode as m, normalizeClass as p, createCommentVNode as c, createVNode as E, Fragment as h, renderList as V, toDisplayString as T, createBlock as b, renderSlot as $, createTextVNode as P } from "vue";
3
3
  import { _ as q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  const G = { class: "min-w-full relative color-text" }, J = ["onClick"], Q = {
5
5
  key: 0,
@@ -10,7 +10,7 @@ const G = { class: "min-w-full relative color-text" }, J = ["onClick"], Q = {
10
10
  }, X = {
11
11
  key: 0,
12
12
  class: "border-b"
13
- }, Y = ["colspan"], Z = /* @__PURE__ */ L({
13
+ }, Y = ["colspan"], Z = /* @__PURE__ */ M({
14
14
  name: "TTable",
15
15
  __name: "Table",
16
16
  props: {
@@ -25,38 +25,40 @@ const G = { class: "min-w-full relative color-text" }, J = ["onClick"], Q = {
25
25
  tableDataClass: { default: "px-2 py-2" }
26
26
  },
27
27
  emits: ["selected", "row-click", "action-click"],
28
- setup(j, { expose: z, emit: H }) {
29
- const e = j, f = H, w = M(), u = k(!1), n = k({}), y = k({}), _ = k(!1), v = k(!1), d = F({}), R = (t) => {
28
+ setup(z, { expose: H, emit: R }) {
29
+ const e = z, f = R, w = O(), d = k(!1), n = k({}), y = k({}), _ = k(!1), v = k(!1);
30
+ let r = F({});
31
+ const U = (t) => {
30
32
  t.stopPropagation();
31
- }, U = x(() => e.columns.length + (e.selectable ? 1 : 0) + (e.actionable ? 1 : 0) + (w.details ? 1 : 0) + 1), D = () => {
32
- let t = 0, r = 0;
33
- e.data.forEach((i) => {
34
- n.value[i[e.rowKey]] ? t++ : r++;
35
- }), r === 0 && t > 0 ? (v.value = !1, u.value = !0) : t === 0 ? (v.value = !1, u.value = !1) : r !== t && (v.value = !0, u.value = void 0), _.value = Object.keys(n.value).some(
36
- (i) => n.value[i]
33
+ }, j = x(() => e.columns.length + (e.selectable ? 1 : 0) + (e.actionable ? 1 : 0) + (w.details ? 1 : 0) + 1), D = () => {
34
+ let t = 0, i = 0;
35
+ e.data.forEach((u) => {
36
+ n.value[u[e.rowKey]] ? t++ : i++;
37
+ }), i === 0 && t > 0 ? (v.value = !1, d.value = !0) : t === 0 ? (v.value = !1, d.value = !1) : i !== t && (v.value = !0, d.value = void 0), _.value = Object.keys(n.value).some(
38
+ (u) => n.value[u]
37
39
  );
38
- }, N = async (t, r) => {
39
- r ? d[t] = e.data.find(
40
- (i) => i[e.rowKey] === t
41
- ) : delete d[t], f("selected", d), D();
40
+ }, N = async (t, i) => {
41
+ i ? r[t] = e.data.find(
42
+ (u) => u[e.rowKey] === t
43
+ ) : delete r[t], f("selected", r), D();
42
44
  }, I = () => {
43
45
  Object.keys(n.value).forEach((t) => {
44
- n.value[t] = !1, u.value = !1, v.value = !1, _.value = !1;
45
- }), Object.assign(d, {}), f("selected", {});
46
- }, O = () => {
47
- u.value ? e.data.forEach((t) => {
48
- n.value[t[e.rowKey]] = !0, d[t[e.rowKey]] = t;
46
+ n.value[t] = !1, d.value = !1, v.value = !1, _.value = !1;
47
+ });
48
+ for (const t in r)
49
+ r[t] = void 0;
50
+ f("selected", r);
51
+ }, L = () => {
52
+ d.value ? e.data.forEach((t) => {
53
+ n.value[t[e.rowKey]] = !0, r[t[e.rowKey]] = t;
49
54
  }) : e.data.forEach((t) => {
50
- n.value[t[e.rowKey]] = !1, delete d[t[e.rowKey]], _.value = !1;
51
- }), D(), f("selected", d);
52
- }, S = x(() => e.loading && e.data.length === 0 ? Array.from({ length: 5 }, (t, r) => ({})) : e.data), C = x(() => w.details ? S.value.some(
55
+ n.value[t[e.rowKey]] = !1, delete r[t[e.rowKey]], _.value = !1;
56
+ }), D(), f("selected", r);
57
+ }, S = x(() => e.loading && e.data.length === 0 ? Array.from({ length: 5 }, (t, i) => ({})) : e.data), C = x(() => w.details ? S.value.some(
53
58
  (t) => !("hasDetails" in t) || t?.hasDetails
54
59
  ) : !1);
55
- return z({
56
- clearSelection: I,
57
- inSelectionMode: _
58
- }), (t, r) => {
59
- const i = K("t-input-checkbox"), g = K("t-skeleton"), B = K("t-button");
60
+ return H({ clearSelection: I, inSelectionMode: _ }), (t, i) => {
61
+ const u = K("t-input-checkbox"), g = K("t-skeleton"), B = K("t-button");
60
62
  return a(), s("table", G, [
61
63
  m("thead", null, [
62
64
  m("tr", null, [
@@ -74,11 +76,11 @@ const G = { class: "min-w-full relative color-text" }, J = ["onClick"], Q = {
74
76
  [e.tableDataClass]: !0
75
77
  }])
76
78
  }, [
77
- E(i, {
78
- modelValue: u.value,
79
- "onUpdate:modelValue": r[0] || (r[0] = (l) => u.value = l),
79
+ E(u, {
80
+ modelValue: d.value,
81
+ "onUpdate:modelValue": i[0] || (i[0] = (l) => d.value = l),
80
82
  "is-indeterminate": v.value,
81
- onInput: O
83
+ onInput: L
82
84
  }, null, 8, ["modelValue", "is-indeterminate"])
83
85
  ], 2)) : c("", !0),
84
86
  (a(!0), s(h, null, V(e.columns, (l, A) => (a(), s("th", {
@@ -125,11 +127,11 @@ const G = { class: "min-w-full relative color-text" }, J = ["onClick"], Q = {
125
127
  key: 1,
126
128
  class: p(["text-center w-12", [e.tableDataClass]])
127
129
  }, [
128
- E(i, {
130
+ E(u, {
129
131
  modelValue: n.value[l[e.rowKey]],
130
132
  "onUpdate:modelValue": (o) => n.value[l[e.rowKey]] = o,
131
133
  "initialize-value": !0,
132
- onClick: R,
134
+ onClick: U,
133
135
  onInput: (o) => N(l[e.rowKey], o)
134
136
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onInput"])
135
137
  ], 2)) : c("", !0),
@@ -160,7 +162,7 @@ const G = { class: "min-w-full relative color-text" }, J = ["onClick"], Q = {
160
162
  ])) : c("", !0)
161
163
  ], 10, J),
162
164
  C.value && y.value[l[e.rowKey]] ? (a(), s("tr", X, [
163
- m("td", { colspan: U.value }, [
165
+ m("td", { colspan: j.value }, [
164
166
  $(t.$slots, "details", { row: l }, void 0, !0)
165
167
  ], 8, Y)
166
168
  ])) : c("", !0)
@@ -169,7 +171,7 @@ const G = { class: "min-w-full relative color-text" }, J = ["onClick"], Q = {
169
171
  ]);
170
172
  };
171
173
  }
172
- }), ae = /* @__PURE__ */ q(Z, [["__scopeId", "data-v-57618d46"]]);
174
+ }), ae = /* @__PURE__ */ q(Z, [["__scopeId", "data-v-e12b2794"]]);
173
175
  export {
174
176
  ae as T
175
177
  };
package/dist/Table.css CHANGED
@@ -1 +1 @@
1
- table>thead>tr[data-v-57618d46]{border-top:1px solid var(--border-color)}table th[data-v-57618d46],table td[data-v-57618d46]{border-bottom:1px solid var(--border-color)}
1
+ table>thead>tr[data-v-e12b2794]{border-top:1px solid var(--border-color)}table th[data-v-e12b2794],table td[data-v-e12b2794]{border-bottom:1px solid var(--border-color)}
package/dist/Table.js CHANGED
@@ -1,5 +1,5 @@
1
- import { T as o } from "./Table-CgcSkg9A.js";
2
- import { p as l } from "./plugin-ChoiQIkG.js";
1
+ import { T as o } from "./Table-COkg498M.js";
2
+ import { p as l } from "./plugin-B2fe1hFi.js";
3
3
  export {
4
4
  o as Table,
5
5
  l as TablePlugin
@@ -39,7 +39,7 @@ import { P as yr } from "./ProgressLine-CY6aDj-H.js";
39
39
  import { _ as Cr } from "./SensitiveInfo.vue_vue_type_script_setup_true_lang-lCdRDxvZ.js";
40
40
  import { _ as Gr } from "./Skeleton.vue_vue_type_script_setup_true_lang-BZItfVoN.js";
41
41
  import { _ as gr } from "./Tab.vue_vue_type_script_setup_true_lang-VzvYvoqa.js";
42
- import { T as vr } from "./Table-CgcSkg9A.js";
42
+ import { T as vr } from "./Table-COkg498M.js";
43
43
  import { _ as Fr } from "./Tag.vue_vue_type_script_setup_true_lang-0p-7UEvO.js";
44
44
  import { _ as Br } from "./Toast.vue_vue_type_script_setup_true_lang-Dezwl4qF.js";
45
45
  export {
@@ -1,5 +1,5 @@
1
1
  import { r } from "./register-component-B-fdqewb.js";
2
- import { T as t } from "./Table-CgcSkg9A.js";
2
+ import { T as t } from "./Table-COkg498M.js";
3
3
  const a = {
4
4
  install(o) {
5
5
  r(o, t);
@@ -53,8 +53,8 @@ import { p as A } from "./plugin-Bk8QZgpY.js";
53
53
  import { p as B } from "./plugin-cvHKUGjm.js";
54
54
  import { p as z } from "./plugin-B9wG8DUw.js";
55
55
  import { p as E } from "./plugin-5vn4G57V.js";
56
- import "./Table-CgcSkg9A.js";
57
- import { p as O } from "./plugin-ChoiQIkG.js";
56
+ import "./Table-COkg498M.js";
57
+ import { p as O } from "./plugin-B2fe1hFi.js";
58
58
  import "./Tag.vue_vue_type_script_setup_true_lang-0p-7UEvO.js";
59
59
  import { p as q } from "./plugin-CClGi0co.js";
60
60
  import { p as R } from "./plugin-Dn96hI0e.js";
package/dist/plugins.js CHANGED
@@ -53,8 +53,8 @@ import { p as jr } from "./plugin-Bk8QZgpY.js";
53
53
  import { p as zr } from "./plugin-cvHKUGjm.js";
54
54
  import { p as Jr } from "./plugin-B9wG8DUw.js";
55
55
  import { p as Nr } from "./plugin-5vn4G57V.js";
56
- import "./Table-CgcSkg9A.js";
57
- import { p as Qr } from "./plugin-ChoiQIkG.js";
56
+ import "./Table-COkg498M.js";
57
+ import { p as Qr } from "./plugin-B2fe1hFi.js";
58
58
  import "./Tag.vue_vue_type_script_setup_true_lang-0p-7UEvO.js";
59
59
  import { p as Vr } from "./plugin-CClGi0co.js";
60
60
  import { p as Xr } from "./plugin-Dn96hI0e.js";
package/dist/tamandua.js CHANGED
@@ -1,4 +1,4 @@
1
- import { p as n } from "./plugins-DRYVrk16.js";
1
+ import { p as n } from "./plugins-CxgvV4Py.js";
2
2
  const o = {
3
3
  install(s) {
4
4
  for (const i in n)
@@ -3,6 +3,7 @@ declare const _default: {
3
3
  args: {
4
4
  loading: boolean;
5
5
  actionable: boolean;
6
+ selectable: boolean;
6
7
  data: any;
7
8
  columns: {
8
9
  title: string;
@@ -14,6 +15,8 @@ export default _default;
14
15
  export declare const Table: (args: any) => {
15
16
  setup(): {
16
17
  args: any;
18
+ inSelectionMode: import('vue').ComputedRef<any>;
19
+ tableRef: import('vue').Ref<any>;
17
20
  };
18
21
  template: string;
19
22
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caipira/tamandua",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "private": false,
5
5
  "description": "UI library for the Caipira ecosystem",
6
6
  "license": "GPL-3.0-only",