@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.
- package/dist/{Table-CgcSkg9A.js → Table-COkg498M.js} +37 -35
- package/dist/Table.css +1 -1
- package/dist/Table.js +2 -2
- package/dist/components.js +1 -1
- package/dist/{plugin-ChoiQIkG.js → plugin-B2fe1hFi.js} +1 -1
- package/dist/{plugins-DRYVrk16.js → plugins-CxgvV4Py.js} +2 -2
- package/dist/plugins.js +2 -2
- package/dist/tamandua.js +1 -1
- package/dist/types/components/Table/Table.story.d.ts +3 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './Table.css';
|
|
2
|
-
import { defineComponent as
|
|
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__ */
|
|
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(
|
|
29
|
-
const e =
|
|
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
|
-
},
|
|
32
|
-
let t = 0,
|
|
33
|
-
e.data.forEach((
|
|
34
|
-
n.value[
|
|
35
|
-
}),
|
|
36
|
-
(
|
|
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,
|
|
39
|
-
|
|
40
|
-
(
|
|
41
|
-
) : delete
|
|
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,
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
|
51
|
-
}), D(), f("selected",
|
|
52
|
-
}, S = x(() => e.loading && e.data.length === 0 ? Array.from({ length: 5 }, (t,
|
|
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
|
|
56
|
-
|
|
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(
|
|
78
|
-
modelValue:
|
|
79
|
-
"onUpdate:modelValue":
|
|
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:
|
|
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(
|
|
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:
|
|
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:
|
|
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-
|
|
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-
|
|
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
package/dist/components.js
CHANGED
|
@@ -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-
|
|
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 {
|
|
@@ -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-
|
|
57
|
-
import { p as O } from "./plugin-
|
|
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-
|
|
57
|
-
import { p as Qr } from "./plugin-
|
|
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
|
@@ -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
|
};
|