@studio-west/component-sw 0.11.18 → 0.11.19
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/SwAlert-BN8mwcp_.js +89 -0
- package/dist/SwButton-B6iaLa_y.js +45 -0
- package/dist/SwButtonGroup-Dmsbam44.js +59 -0
- package/dist/SwCollapse-Dy2XxzJg.js +31 -0
- package/dist/SwDatePicker-CNGIsEmm.js +262 -0
- package/dist/SwDropdown-DMkEn-su.js +114 -0
- package/dist/SwDropdownItem-CscV8R77.js +36 -0
- package/dist/SwDropdownNew-TXu5V6xZ.js +107 -0
- package/dist/SwFormItem-DQJohClb.js +24 -0
- package/dist/SwGide-9v0z3Y49.js +125 -0
- package/dist/SwIcon-0PtPyq2k.js +35 -0
- package/dist/SwInput-fqZBIN92.js +102 -0
- package/dist/SwMessage-BvvbQ1cP.js +55 -0
- package/dist/SwSection-fNuXuePo.js +32 -0
- package/dist/SwSelect-CuBxoXju.js +1594 -0
- package/dist/SwSkeleton-DIwAcNfp.js +28 -0
- package/dist/SwSkeletonItem-D3Wjgl7J.js +35 -0
- package/dist/SwSlider-CyLU7COn.js +179 -0
- package/dist/SwSwitch-DluxsVEW.js +56 -0
- package/dist/SwTable-D5v0TIuo.js +133 -0
- package/dist/SwTableColumn-CCqBUIhN.js +28 -0
- package/dist/SwTabs-zHhFxzck.js +32 -0
- package/dist/SwTabsPane-BY5KEs_h.js +36 -0
- package/dist/component-sw.css +2 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +58 -7
- package/dist/utils-CGgSSFR1.js +52 -0
- package/package.json +1 -1
- package/src/components/SwButton.vue +1 -0
- package/src/components/SwButtonGroup.vue +1 -0
- package/src/components/SwTable.vue +14 -5
- package/dist/SwButton-yS_tKW9w.js +0 -4
- package/dist/SwButton.vue_vue_type_script_setup_true_lang-aODPwFa6.js +0 -34
- package/dist/SwButtonGroup-D9HH5POO.js +0 -49
- package/dist/SwCollapse-CuN3EbT6.js +0 -33
- package/dist/SwDatePicker-DHP73Q1c.js +0 -366
- package/dist/SwDropdown-DQGTnnKw.js +0 -111
- package/dist/SwDropdownItem-Cua7E0JN.js +0 -31
- package/dist/SwDropdownNew-CYfjZFd2.js +0 -107
- package/dist/SwFormItem-CaA4jsoa.js +0 -24
- package/dist/SwGide-BcLOtvRd.js +0 -138
- package/dist/SwInput-m4LDJuNs.js +0 -90
- package/dist/SwMessage-yOG9UmvF.js +0 -57
- package/dist/SwSection-CQe2kE0O.js +0 -34
- package/dist/SwSelect-BxbCfof-.js +0 -1883
- package/dist/SwSkeleton-B7ysp8L9.js +0 -26
- package/dist/SwSkeletonItem-CU7LvihY.js +0 -29
- package/dist/SwSlider--meCHr2D.js +0 -158
- package/dist/SwSwitch-DeMdyD0-.js +0 -47
- package/dist/SwTable-BSCqB4nS.js +0 -156
- package/dist/SwTableColumn-BLF5bPuJ.js +0 -28
- package/dist/SwTabs-DkSI4oAh.js +0 -38
- package/dist/SwTabsPane-Dwtj8g7T.js +0 -38
- package/dist/index-DX9QZTeL.js +0 -188
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { renderSlot as l, createElementBlock as a, openBlock as o, normalizeClass as n, createVNode as r } from "vue";
|
|
2
|
-
import c from "./SwSkeletonItem-CU7LvihY.js";
|
|
3
|
-
const f = {
|
|
4
|
-
__name: "SwSkeleton",
|
|
5
|
-
props: {
|
|
6
|
-
class: { type: String, default: "" },
|
|
7
|
-
visual: { type: Boolean, default: !1 }
|
|
8
|
-
},
|
|
9
|
-
setup(t) {
|
|
10
|
-
const e = t;
|
|
11
|
-
return (s, i) => e.visual ? l(s.$slots, "default", { key: 0 }) : (o(), a("div", {
|
|
12
|
-
key: 1,
|
|
13
|
-
class: n(["sw-skeleton", e.class])
|
|
14
|
-
}, [
|
|
15
|
-
l(s.$slots, "skeleton", {}, () => [
|
|
16
|
-
r(c, {
|
|
17
|
-
animate: "",
|
|
18
|
-
size: "small"
|
|
19
|
-
})
|
|
20
|
-
])
|
|
21
|
-
], 2));
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
f as default
|
|
26
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { computed as s, createElementBlock as a, openBlock as n, normalizeStyle as r, normalizeClass as c, createCommentVNode as u } from "vue";
|
|
2
|
-
const m = { key: 0 }, f = {
|
|
3
|
-
__name: "SwSkeletonItem",
|
|
4
|
-
props: {
|
|
5
|
-
width: { type: String, default: "100" },
|
|
6
|
-
class: { type: String, default: "" },
|
|
7
|
-
animate: { type: Boolean, default: !1 },
|
|
8
|
-
size: { type: String, default: "" }
|
|
9
|
-
},
|
|
10
|
-
setup(l) {
|
|
11
|
-
const e = l, i = s(
|
|
12
|
-
() => {
|
|
13
|
-
let t = ["sw-skeleton-item"];
|
|
14
|
-
return e.size.length > 0 && t.push("sw-" + e.size), e.animate && t.push("sw-animate"), e.class.length > 0 && t.push(e.class), t;
|
|
15
|
-
}
|
|
16
|
-
), o = s(() => ({
|
|
17
|
-
width: e.width + "%"
|
|
18
|
-
}));
|
|
19
|
-
return (t, p) => (n(), a("div", {
|
|
20
|
-
class: c(i.value),
|
|
21
|
-
style: r(o.value)
|
|
22
|
-
}, [
|
|
23
|
-
e.animate ? (n(), a("div", m)) : u("", !0)
|
|
24
|
-
], 6));
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
export {
|
|
28
|
-
f as default
|
|
29
|
-
};
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { mergeModels as F, useModel as I, ref as p, computed as v, onMounted as q, onUnmounted as U, createElementBlock as M, openBlock as x, normalizeClass as D, createElementVNode as N, withModifiers as P, normalizeStyle as B, Fragment as j, renderList as G, renderSlot as H, createCommentVNode as J, toDisplayString as K } from "vue";
|
|
2
|
-
import { c as O } from "./index-DX9QZTeL.js";
|
|
3
|
-
const Q = ["onMouseenter", "onMouseleave", "onFocus", "onBlur", "onMousedown", "onTouchstart"], _ = {
|
|
4
|
-
__name: "SwSlider",
|
|
5
|
-
props: /* @__PURE__ */ F({
|
|
6
|
-
class: { type: String, default: "" },
|
|
7
|
-
size: { type: String, default: "" },
|
|
8
|
-
min: { type: Number, default: 0 },
|
|
9
|
-
max: { type: Number, default: 100 },
|
|
10
|
-
step: { type: Number, default: 1 },
|
|
11
|
-
vertical: { type: Boolean, default: !1 },
|
|
12
|
-
showValue: { type: Boolean, default: !1 }
|
|
13
|
-
}, {
|
|
14
|
-
modelValue: { type: [Number, Array], required: !0 },
|
|
15
|
-
modelModifiers: {}
|
|
16
|
-
}),
|
|
17
|
-
emits: ["update:modelValue"],
|
|
18
|
-
setup($) {
|
|
19
|
-
const m = I($, "modelValue"), n = $, u = p([]), f = p([]), R = v(
|
|
20
|
-
() => {
|
|
21
|
-
let e = ["sw-slider"];
|
|
22
|
-
return n.size.length > 0 && e.push("sw-" + n.size), n.class.length > 0 && e.push(n.class), n.vertical && e.push("vertical"), e;
|
|
23
|
-
}
|
|
24
|
-
), L = (e) => {
|
|
25
|
-
const t = [...u.value];
|
|
26
|
-
t[e] = !0, u.value = t;
|
|
27
|
-
}, k = (e) => {
|
|
28
|
-
const t = [...u.value];
|
|
29
|
-
t[e] = !1, u.value = t;
|
|
30
|
-
}, S = (e) => {
|
|
31
|
-
const t = document.querySelector(".sw-slider");
|
|
32
|
-
return t ? O(t, n.vertical) : n.vertical ? { right: "100%", marginRight: "10px" } : { bottom: "100%", marginBottom: "10px" };
|
|
33
|
-
}, d = v(() => Array.isArray(m.value)), r = v({
|
|
34
|
-
get() {
|
|
35
|
-
return d.value ? [...m.value] : [m.value];
|
|
36
|
-
},
|
|
37
|
-
set(e) {
|
|
38
|
-
d.value ? m.value = [...e].sort((t, l) => t - l) : m.value = e[0];
|
|
39
|
-
}
|
|
40
|
-
}), i = v(() => {
|
|
41
|
-
const e = n.max - n.min;
|
|
42
|
-
return r.value.map((t) => e === 0 ? 0 : (t - n.min) / e * 100);
|
|
43
|
-
}), X = v(() => {
|
|
44
|
-
if (n.vertical)
|
|
45
|
-
if (d.value) {
|
|
46
|
-
const e = i.value[0] || 0, t = i.value[i.value.length - 1] || 0, l = Math.min(e, t);
|
|
47
|
-
return {
|
|
48
|
-
height: `${Math.max(e, t) - l}%`,
|
|
49
|
-
top: `${l}%`,
|
|
50
|
-
left: "0",
|
|
51
|
-
width: "100%"
|
|
52
|
-
};
|
|
53
|
-
} else
|
|
54
|
-
return {
|
|
55
|
-
height: `${i.value[0] || 0}%`,
|
|
56
|
-
top: "0",
|
|
57
|
-
left: "0",
|
|
58
|
-
width: "100%"
|
|
59
|
-
};
|
|
60
|
-
else if (d.value) {
|
|
61
|
-
const e = i.value[0] || 0, t = i.value[i.value.length - 1] || 0, l = Math.min(e, t);
|
|
62
|
-
return {
|
|
63
|
-
width: `${Math.max(e, t) - l}%`,
|
|
64
|
-
left: `${l}%`,
|
|
65
|
-
top: "0",
|
|
66
|
-
height: "100%"
|
|
67
|
-
};
|
|
68
|
-
} else
|
|
69
|
-
return {
|
|
70
|
-
width: `${i.value[0] || 0}%`,
|
|
71
|
-
left: "0",
|
|
72
|
-
top: "0",
|
|
73
|
-
height: "100%"
|
|
74
|
-
};
|
|
75
|
-
}), Y = v(() => i.value.map((e, t) => n.vertical ? { top: `${e}%`, zIndex: r.value.length - t } : { left: `${e}%`, zIndex: r.value.length - t }));
|
|
76
|
-
function A(e) {
|
|
77
|
-
if (d.value) return;
|
|
78
|
-
const t = e.currentTarget.closest(".sw-slider");
|
|
79
|
-
if (!t) return;
|
|
80
|
-
const l = t.getBoundingClientRect(), o = n.vertical ? (e.clientY - l.top) / l.height : (e.clientX - l.left) / l.width, s = Math.max(0, Math.min(1, o)), b = n.max - n.min;
|
|
81
|
-
let a = n.min + s * b;
|
|
82
|
-
const T = Math.round((a - n.min) / n.step);
|
|
83
|
-
a = n.min + T * n.step, a = Math.max(n.min, Math.min(n.max, a)), r.value = [a], setTimeout(() => {
|
|
84
|
-
const h = [...f.value];
|
|
85
|
-
h[0] = S(), f.value = h;
|
|
86
|
-
}, 0);
|
|
87
|
-
}
|
|
88
|
-
const E = p(!1), c = p(null), V = p(null);
|
|
89
|
-
function g(e, t) {
|
|
90
|
-
const l = e.target.closest(".sw-slider");
|
|
91
|
-
l && (V.value = l.getBoundingClientRect(), c.value = t, E.value = !0, z(e.clientX || e.touches?.[0]?.clientX, e.clientY || e.touches?.[0]?.clientY));
|
|
92
|
-
}
|
|
93
|
-
function w(e) {
|
|
94
|
-
if (!E.value) return;
|
|
95
|
-
e.preventDefault?.();
|
|
96
|
-
const t = e.clientX || e.touches?.[0]?.clientX, l = e.clientY || e.touches?.[0]?.clientY;
|
|
97
|
-
z(t, l);
|
|
98
|
-
}
|
|
99
|
-
function y() {
|
|
100
|
-
E.value = !1, c.value = null;
|
|
101
|
-
}
|
|
102
|
-
function z(e, t) {
|
|
103
|
-
if (!V.value || c.value === null) return;
|
|
104
|
-
const l = V.value, o = n.vertical ? (t - l.top) / l.height : (e - l.left) / l.width, s = Math.max(0, Math.min(1, o)), b = n.max - n.min;
|
|
105
|
-
let a = n.min + s * b;
|
|
106
|
-
const T = Math.round((a - n.min) / n.step);
|
|
107
|
-
a = n.min + T * n.step, a = Math.max(n.min, Math.min(n.max, a));
|
|
108
|
-
const h = [...r.value];
|
|
109
|
-
h[c.value] = a, r.value = h, setTimeout(() => {
|
|
110
|
-
const C = [...f.value];
|
|
111
|
-
C[c.value] = S(c.value), f.value = C;
|
|
112
|
-
}, 0);
|
|
113
|
-
}
|
|
114
|
-
return q(() => {
|
|
115
|
-
window.addEventListener("mousemove", w), window.addEventListener("mouseup", y), window.addEventListener("touchmove", w, { passive: !1 }), window.addEventListener("touchend", y), u.value = new Array(r.value.length).fill(!1);
|
|
116
|
-
}), U(() => {
|
|
117
|
-
window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", y), window.removeEventListener("touchmove", w), window.removeEventListener("touchend", y);
|
|
118
|
-
}), (e, t) => (x(), M("div", {
|
|
119
|
-
class: D(R.value)
|
|
120
|
-
}, [
|
|
121
|
-
N("div", {
|
|
122
|
-
class: "track",
|
|
123
|
-
onClick: A,
|
|
124
|
-
onMousedown: t[0] || (t[0] = P((l) => g(l, 0), ["prevent"])),
|
|
125
|
-
onTouchstart: t[1] || (t[1] = P((l) => g(l.touches[0], 0), ["prevent"]))
|
|
126
|
-
}, [
|
|
127
|
-
N("div", {
|
|
128
|
-
class: "fill",
|
|
129
|
-
style: B(X.value)
|
|
130
|
-
}, null, 4)
|
|
131
|
-
], 32),
|
|
132
|
-
(x(!0), M(j, null, G(r.value, (l, o) => (x(), M("div", {
|
|
133
|
-
class: "thumb",
|
|
134
|
-
key: o,
|
|
135
|
-
style: B(Y.value[o]),
|
|
136
|
-
onMouseenter: (s) => L(o),
|
|
137
|
-
onMouseleave: (s) => k(o),
|
|
138
|
-
onFocus: (s) => L(o),
|
|
139
|
-
onBlur: (s) => k(o),
|
|
140
|
-
onMousedown: P((s) => g(s, o), ["prevent"]),
|
|
141
|
-
onTouchstart: P((s) => g(s.touches[0], o), ["prevent"])
|
|
142
|
-
}, [
|
|
143
|
-
H(e.$slots, "default", {
|
|
144
|
-
index: o,
|
|
145
|
-
value: l
|
|
146
|
-
}),
|
|
147
|
-
u.value[o] && $.showValue ? (x(), M("div", {
|
|
148
|
-
key: 0,
|
|
149
|
-
class: D(["tooltip", { "tooltip-vertical": n.vertical }]),
|
|
150
|
-
style: B(S())
|
|
151
|
-
}, K(l), 7)) : J("", !0)
|
|
152
|
-
], 44, Q))), 128))
|
|
153
|
-
], 2));
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
export {
|
|
157
|
-
_ as default
|
|
158
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { defineComponent as n, mergeModels as d, useModel as u, computed as f, createElementBlock as i, openBlock as h, normalizeClass as r, createElementVNode as t, renderSlot as m } from "vue";
|
|
2
|
-
const p = ["name", "id", "checked"], b = ["for", "data-onlabel", "data-offlabel"], _ = /* @__PURE__ */ n({
|
|
3
|
-
__name: "SwSwitch",
|
|
4
|
-
props: /* @__PURE__ */ d({
|
|
5
|
-
id: { default: "checkbox" },
|
|
6
|
-
class: { default: "" },
|
|
7
|
-
name: { default: "" },
|
|
8
|
-
on: { default: "" },
|
|
9
|
-
off: { default: "" },
|
|
10
|
-
size: { default: "" },
|
|
11
|
-
checkbox: { type: Boolean, default: !1 }
|
|
12
|
-
}, {
|
|
13
|
-
modelValue: { type: Boolean },
|
|
14
|
-
modelModifiers: {}
|
|
15
|
-
}),
|
|
16
|
-
emits: ["update:modelValue"],
|
|
17
|
-
setup(a) {
|
|
18
|
-
const o = u(a, "modelValue"), e = a, s = f(() => {
|
|
19
|
-
let l = ["sw-switch"];
|
|
20
|
-
return e.size.length > 0 && l.push("sw-" + e.size), e.checkbox && l.push("sw-checkbox"), e.class.length > 0 && l.push(e.class), l;
|
|
21
|
-
}), c = (l) => {
|
|
22
|
-
o.value = l.target.checked;
|
|
23
|
-
};
|
|
24
|
-
return (l, k) => (h(), i("div", {
|
|
25
|
-
class: r(s.value)
|
|
26
|
-
}, [
|
|
27
|
-
t("input", {
|
|
28
|
-
type: "checkbox",
|
|
29
|
-
name: e.name,
|
|
30
|
-
class: "sw-control",
|
|
31
|
-
id: e.id,
|
|
32
|
-
checked: o.value,
|
|
33
|
-
onChange: c
|
|
34
|
-
}, null, 40, p),
|
|
35
|
-
t("label", {
|
|
36
|
-
for: e.id,
|
|
37
|
-
class: "sw-label",
|
|
38
|
-
"data-onlabel": e.on,
|
|
39
|
-
"data-offlabel": e.off
|
|
40
|
-
}, null, 8, b),
|
|
41
|
-
m(l.$slots, "default")
|
|
42
|
-
], 2));
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
export {
|
|
46
|
-
_ as default
|
|
47
|
-
};
|
package/dist/SwTable-BSCqB4nS.js
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { useSlots as F, ref as W, onMounted as G, computed as m, createElementBlock as p, openBlock as i, createElementVNode as D, Fragment as g, renderList as w, normalizeStyle as N, toDisplayString as R, renderSlot as J, createTextVNode as K } from "vue";
|
|
2
|
-
import O from "./SwTableColumn-BLF5bPuJ.js";
|
|
3
|
-
const P = { class: "sw-table" }, Q = ["colspan", "rowspan"], U = ["colspan", "rowspan"], Z = {
|
|
4
|
-
__name: "SwTable",
|
|
5
|
-
props: {
|
|
6
|
-
data: {
|
|
7
|
-
type: Array,
|
|
8
|
-
required: !0
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
setup(M) {
|
|
12
|
-
const T = M, x = F(), h = W([]);
|
|
13
|
-
function C(l) {
|
|
14
|
-
const o = [];
|
|
15
|
-
for (const e of l)
|
|
16
|
-
if (e.type === O || e.type.__name === "SwTableColumn" || e.type.name === "SwTableColumn" || typeof e.type == "object" && e.props?.prop !== void 0) {
|
|
17
|
-
const t = {
|
|
18
|
-
...e.props,
|
|
19
|
-
children: []
|
|
20
|
-
};
|
|
21
|
-
let s = [];
|
|
22
|
-
typeof e.children?.default == "function" ? s = e.children.default() : Array.isArray(e.children) && (s = e.children), s && s.length > 0 && (t.children = C(s)), o.push(t);
|
|
23
|
-
}
|
|
24
|
-
return o;
|
|
25
|
-
}
|
|
26
|
-
function k(l) {
|
|
27
|
-
if (!l || l.length === 0) return 1;
|
|
28
|
-
let o = 1;
|
|
29
|
-
for (const e of l)
|
|
30
|
-
if (e.children && e.children.length > 0) {
|
|
31
|
-
const n = k(e.children);
|
|
32
|
-
o = Math.max(o, 1 + n);
|
|
33
|
-
}
|
|
34
|
-
return o;
|
|
35
|
-
}
|
|
36
|
-
function A(l, o) {
|
|
37
|
-
const e = Array.from({ length: o }, () => []);
|
|
38
|
-
function n(t, s, u = "") {
|
|
39
|
-
for (let c = 0; c < t.length; c++) {
|
|
40
|
-
const r = t[c], d = u ? `${u}-${r.prop || c}` : r.prop || c;
|
|
41
|
-
if (r.children && r.children.length > 0) {
|
|
42
|
-
const a = E(r.children);
|
|
43
|
-
e[s].push({
|
|
44
|
-
key: d,
|
|
45
|
-
label: r.label,
|
|
46
|
-
colspan: a,
|
|
47
|
-
rowspan: 1,
|
|
48
|
-
width: r.width,
|
|
49
|
-
height: r.height
|
|
50
|
-
}), n(r.children, s + 1, d);
|
|
51
|
-
} else
|
|
52
|
-
e[s].push({
|
|
53
|
-
key: r.prop,
|
|
54
|
-
label: r.label,
|
|
55
|
-
colspan: 1,
|
|
56
|
-
rowspan: o - s,
|
|
57
|
-
width: r.width,
|
|
58
|
-
height: r.height,
|
|
59
|
-
prop: r.prop
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return n(l, 0), e;
|
|
64
|
-
}
|
|
65
|
-
function E(l) {
|
|
66
|
-
let o = 0;
|
|
67
|
-
function e(n) {
|
|
68
|
-
for (const t of n)
|
|
69
|
-
t.children && t.children.length > 0 ? e(t.children) : o++;
|
|
70
|
-
}
|
|
71
|
-
return e(l), o;
|
|
72
|
-
}
|
|
73
|
-
function j(l) {
|
|
74
|
-
const o = [];
|
|
75
|
-
function e(n) {
|
|
76
|
-
for (const t of n)
|
|
77
|
-
t.children && t.children.length > 0 ? e(t.children) : o.push(t);
|
|
78
|
-
}
|
|
79
|
-
return e(l), o;
|
|
80
|
-
}
|
|
81
|
-
function B(l, o) {
|
|
82
|
-
const e = [], n = /* @__PURE__ */ new Map();
|
|
83
|
-
return l.forEach((t, s) => {
|
|
84
|
-
const u = [];
|
|
85
|
-
o.forEach((c, r) => {
|
|
86
|
-
const d = `${s}-${c.prop}`;
|
|
87
|
-
if (n.has(d))
|
|
88
|
-
return;
|
|
89
|
-
const a = t[c.prop];
|
|
90
|
-
let S = a, b = 1, _ = 1, V = {};
|
|
91
|
-
a && typeof a == "object" && a !== null && (S = a.label || a.value || "", b = a.colspan || 1, _ = a.rowspan || 1, V = a.style || {});
|
|
92
|
-
const z = {
|
|
93
|
-
key: d,
|
|
94
|
-
label: S,
|
|
95
|
-
prop: c.prop,
|
|
96
|
-
colspan: b,
|
|
97
|
-
rowspan: _,
|
|
98
|
-
style: V,
|
|
99
|
-
originalRow: t,
|
|
100
|
-
rowIndex: s
|
|
101
|
-
};
|
|
102
|
-
u.push(z);
|
|
103
|
-
for (let f = 0; f < _; f++)
|
|
104
|
-
for (let y = 0; y < b; y++) {
|
|
105
|
-
if (f === 0 && y === 0) continue;
|
|
106
|
-
const $ = `${s + f}-${o[r + y]?.prop}`;
|
|
107
|
-
$ && n.set($, !0);
|
|
108
|
-
}
|
|
109
|
-
}), u.length > 0 && e.push(u);
|
|
110
|
-
}), e;
|
|
111
|
-
}
|
|
112
|
-
G(() => {
|
|
113
|
-
const l = x.default?.() || [];
|
|
114
|
-
console.log("Raw slot VNodes:", l);
|
|
115
|
-
const o = l.filter((e) => {
|
|
116
|
-
console.log("VNode type:", e.type, "props:", e.props);
|
|
117
|
-
const n = e.type && (typeof e.type == "object" || typeof e.type == "function");
|
|
118
|
-
return console.log("Is component:", n), n;
|
|
119
|
-
});
|
|
120
|
-
console.log("Valid VNodes:", o), h.value = C(o), console.log("SwTable mounted - columnTree:", h.value), console.log("SwTable mounted - flatColumns:", v.value), console.log("SwTable mounted - data:", T.data);
|
|
121
|
-
});
|
|
122
|
-
const L = m(() => k(h.value)), H = m(() => A(h.value, L.value)), v = m(() => j(h.value)), q = m(() => B(T.data, v.value));
|
|
123
|
-
return (l, o) => (i(), p("table", P, [
|
|
124
|
-
D("thead", null, [
|
|
125
|
-
(i(!0), p(g, null, w(H.value, (e, n) => (i(), p("tr", { key: n }, [
|
|
126
|
-
(i(!0), p(g, null, w(e, (t) => (i(), p("th", {
|
|
127
|
-
key: t.key,
|
|
128
|
-
colspan: t.colspan,
|
|
129
|
-
rowspan: t.rowspan,
|
|
130
|
-
style: N({ minWidth: t.width, minHeight: t.height })
|
|
131
|
-
}, R(t.label), 13, Q))), 128))
|
|
132
|
-
]))), 128))
|
|
133
|
-
]),
|
|
134
|
-
D("tbody", null, [
|
|
135
|
-
(i(!0), p(g, null, w(q.value, (e, n) => (i(), p("tr", { key: n }, [
|
|
136
|
-
(i(!0), p(g, null, w(e, (t) => (i(), p("td", {
|
|
137
|
-
key: t.key,
|
|
138
|
-
colspan: t.colspan,
|
|
139
|
-
rowspan: t.rowspan,
|
|
140
|
-
style: N(t.style)
|
|
141
|
-
}, [
|
|
142
|
-
J(l.$slots, t.prop, {
|
|
143
|
-
row: t.originalRow,
|
|
144
|
-
$index: t.rowIndex
|
|
145
|
-
}, () => [
|
|
146
|
-
K(R(t.label), 1)
|
|
147
|
-
])
|
|
148
|
-
], 12, U))), 128))
|
|
149
|
-
]))), 128))
|
|
150
|
-
])
|
|
151
|
-
]));
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
export {
|
|
155
|
-
Z as default
|
|
156
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { createElementBlock as t, openBlock as e } from "vue";
|
|
2
|
-
const r = { style: { display: "none" } }, l = {
|
|
3
|
-
__name: "SwTableColumn",
|
|
4
|
-
props: {
|
|
5
|
-
prop: {
|
|
6
|
-
type: String,
|
|
7
|
-
required: !0
|
|
8
|
-
},
|
|
9
|
-
label: {
|
|
10
|
-
type: String,
|
|
11
|
-
default: ""
|
|
12
|
-
},
|
|
13
|
-
width: {
|
|
14
|
-
type: String,
|
|
15
|
-
default: "auto"
|
|
16
|
-
},
|
|
17
|
-
height: {
|
|
18
|
-
type: String,
|
|
19
|
-
default: "auto"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
setup(o) {
|
|
23
|
-
return (n, p) => (e(), t("div", r));
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
export {
|
|
27
|
-
l as default
|
|
28
|
-
};
|
package/dist/SwTabs-DkSI4oAh.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { mergeModels as u, ref as m, useModel as k, provide as l, createElementBlock as s, openBlock as r, normalizeClass as d, createCommentVNode as _, renderSlot as h, Fragment as T, renderList as y, toDisplayString as C } from "vue";
|
|
2
|
-
const S = { key: 0 }, V = ["onClick"], B = {
|
|
3
|
-
__name: "SwTabs",
|
|
4
|
-
props: /* @__PURE__ */ u({
|
|
5
|
-
class: { type: String, default: "" }
|
|
6
|
-
}, {
|
|
7
|
-
modelValue: {},
|
|
8
|
-
modelModifiers: {}
|
|
9
|
-
}),
|
|
10
|
-
emits: /* @__PURE__ */ u(["tab-click"], ["update:modelValue"]),
|
|
11
|
-
setup(n, { emit: p }) {
|
|
12
|
-
m(0);
|
|
13
|
-
const e = m([]), v = n, o = k(n, "modelValue"), b = p;
|
|
14
|
-
function f(t) {
|
|
15
|
-
e.value.push(t);
|
|
16
|
-
}
|
|
17
|
-
function g(t) {
|
|
18
|
-
e.value = e.value.filter((c) => c !== t);
|
|
19
|
-
}
|
|
20
|
-
return l("registerTab", f), l("unregisterTab", g), l("activeTab", o), l("tabs", e), (t, c) => (r(), s("div", {
|
|
21
|
-
class: d("sw-tabs " + v.class)
|
|
22
|
-
}, [
|
|
23
|
-
e.value.length !== 0 ? (r(), s("header", S, [
|
|
24
|
-
(r(!0), s(T, null, y(e.value, (i, a) => (r(), s("span", {
|
|
25
|
-
key: a,
|
|
26
|
-
class: d([{ active: o.value === a }]),
|
|
27
|
-
onClick: (M) => {
|
|
28
|
-
o.value = a, b("tab-click", a);
|
|
29
|
-
}
|
|
30
|
-
}, C(i.label || i.title), 11, V))), 128))
|
|
31
|
-
])) : _("", !0),
|
|
32
|
-
h(t.$slots, "default")
|
|
33
|
-
], 2));
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
export {
|
|
37
|
-
B as default
|
|
38
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { inject as t, onMounted as b, onUnmounted as d, computed as n, createElementBlock as p, createCommentVNode as m, openBlock as v, renderSlot as T } from "vue";
|
|
2
|
-
const _ = {
|
|
3
|
-
key: 0,
|
|
4
|
-
class: "tab-content"
|
|
5
|
-
}, S = {
|
|
6
|
-
__name: "SwTabsPane",
|
|
7
|
-
props: {
|
|
8
|
-
title: {
|
|
9
|
-
type: String,
|
|
10
|
-
required: !0
|
|
11
|
-
},
|
|
12
|
-
label: {
|
|
13
|
-
type: String,
|
|
14
|
-
default: ""
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
setup(l) {
|
|
18
|
-
const e = l, o = t("registerTab"), r = t("unregisterTab");
|
|
19
|
-
b(() => {
|
|
20
|
-
o({
|
|
21
|
-
title: e.title,
|
|
22
|
-
label: e.label
|
|
23
|
-
});
|
|
24
|
-
}), d(() => {
|
|
25
|
-
r({
|
|
26
|
-
title: e.title,
|
|
27
|
-
label: e.label
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
const s = t("activeTab"), i = t("tabs"), c = n(() => i.value.findIndex((a) => a.title === e.title)), u = n(() => s.value === c.value);
|
|
31
|
-
return (a, f) => u.value ? (v(), p("div", _, [
|
|
32
|
-
T(a.$slots, "default")
|
|
33
|
-
])) : m("", !0);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
export {
|
|
37
|
-
S as default
|
|
38
|
-
};
|