@wikicasa-dev/components 1.7.14 → 1.7.15
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/BaseTabView.js
CHANGED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { defineComponent as N, mergeModels as U, useModel as x, ref as v, computed as T, useSlots as z, watch as R, withDirectives as j, openBlock as n, createElementBlock as s, normalizeClass as p, createElementVNode as I, toDisplayString as $, Fragment as C, renderList as F, createBlock as h, resolveDynamicComponent as w, createCommentVNode as B, withCtx as q } from "vue";
|
|
2
|
+
import { _ as G } from "./BaseTabPanel.vue_vue_type_script_setup_true_lang.DoZHWHt1.js";
|
|
3
|
+
const H = ["id"], J = ["aria-labelledby"], K = ["id", "aria-selected", "aria-controls", "tabindex", "onClick"], O = { key: 0 }, Y = /* @__PURE__ */ N({
|
|
4
|
+
inheritAttrs: !1,
|
|
5
|
+
__name: "BaseTabView",
|
|
6
|
+
props: /* @__PURE__ */ U({
|
|
7
|
+
tabViewDescription: {},
|
|
8
|
+
tabListClasses: { default: "" }
|
|
9
|
+
}, {
|
|
10
|
+
activeIdx: { default: 0 },
|
|
11
|
+
activeIdxModifiers: {}
|
|
12
|
+
}),
|
|
13
|
+
emits: ["update:activeIdx"],
|
|
14
|
+
setup(D) {
|
|
15
|
+
const o = x(D, "activeIdx"), P = v(""), f = v(""), m = v(null), r = T(() => m.value?.id ?? ""), k = z(), c = (e) => e.props ?? null, y = (e) => e.type.__name === "BaseTab", _ = (e, a) => ({
|
|
16
|
+
renderFn: e,
|
|
17
|
+
tabId: u(a),
|
|
18
|
+
"active-tab-panel-idx": c(e)?.["active-tab-panel-idx"] ?? a,
|
|
19
|
+
"header-title": c(e)?.["header-title"] || "",
|
|
20
|
+
class: c(e)?.class || ""
|
|
21
|
+
}), l = T(() => k.default ? k.default().reduce((e, a) => (a.children && Array.isArray(a.children) ? a.children.forEach((t) => {
|
|
22
|
+
y(t) && e.push(_(t, e.length));
|
|
23
|
+
}) : y(a) && e.push(_(a, e.length)), e), []) : []), d = (e) => o.value === e, A = (e) => f.value === e, u = (e) => `base-tab-${e}-${r.value}`, b = (e) => `base-tab-panel-${e}-${r.value}`, S = (e) => l.value.find((a) => a["active-tab-panel-idx"] === e)?.tabId, V = (e) => {
|
|
24
|
+
P.value = u(e);
|
|
25
|
+
}, M = (e) => {
|
|
26
|
+
const a = l.value.at(e ?? -1), t = b(a?.["active-tab-panel-idx"] ?? -1);
|
|
27
|
+
t && (f.value = t);
|
|
28
|
+
}, E = (e) => {
|
|
29
|
+
V(e), o.value = e;
|
|
30
|
+
};
|
|
31
|
+
R(
|
|
32
|
+
o,
|
|
33
|
+
(e) => {
|
|
34
|
+
M(e ?? -1);
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
immediate: !0
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
const g = () => Date.now().toString(36) + Math.random().toString(36).substring(2), L = {
|
|
41
|
+
created(e) {
|
|
42
|
+
console.log("v-uid:directive", e.id), e.setAttribute("id", e.id || g());
|
|
43
|
+
},
|
|
44
|
+
getSSRProps() {
|
|
45
|
+
return {
|
|
46
|
+
id: g()
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
return (e, a) => j((n(), s("div", {
|
|
51
|
+
ref_key: "root",
|
|
52
|
+
ref: m,
|
|
53
|
+
class: p(e.$attrs.class)
|
|
54
|
+
}, [
|
|
55
|
+
I("span", {
|
|
56
|
+
id: `tablist-${r.value}`,
|
|
57
|
+
class: "uikit-sr-only"
|
|
58
|
+
}, $(e.tabViewDescription), 9, H),
|
|
59
|
+
I("div", {
|
|
60
|
+
role: "tablist",
|
|
61
|
+
"aria-labelledby": `tablist-${r.value}`,
|
|
62
|
+
class: p(e.tabListClasses)
|
|
63
|
+
}, [
|
|
64
|
+
(n(!0), s(C, null, F(l.value, (t, i) => (n(), s("button", {
|
|
65
|
+
key: i,
|
|
66
|
+
id: u(i),
|
|
67
|
+
type: "button",
|
|
68
|
+
role: "tab",
|
|
69
|
+
"aria-selected": d(i),
|
|
70
|
+
"aria-controls": `base-tab-panel-${i}-${r.value}`,
|
|
71
|
+
tabindex: d(i) ? void 0 : -1,
|
|
72
|
+
class: p([
|
|
73
|
+
"uikit-bg-transparent uikit-p-5px",
|
|
74
|
+
{
|
|
75
|
+
"uikit-border-b-2 uikit-border-solid uikit-border-w-primary uikit-font-semibold": d(i)
|
|
76
|
+
},
|
|
77
|
+
t.class
|
|
78
|
+
]),
|
|
79
|
+
onClick: (Q) => E(i)
|
|
80
|
+
}, [
|
|
81
|
+
t["header-title"] ? (n(), s("span", O, $(t["header-title"]), 1)) : t.renderFn.children && t.renderFn.children.header ? (n(), h(w(t.renderFn.children.header), { key: 1 })) : B("", !0)
|
|
82
|
+
], 10, K))), 128))
|
|
83
|
+
], 10, J),
|
|
84
|
+
(n(!0), s(C, null, F(l.value, (t, i) => (n(), h(G, {
|
|
85
|
+
key: i,
|
|
86
|
+
id: b(i),
|
|
87
|
+
"labelled-by": S(i) || "",
|
|
88
|
+
active: A(b(i))
|
|
89
|
+
}, {
|
|
90
|
+
default: q(() => [
|
|
91
|
+
t.renderFn.children && t.renderFn.children.default ? (n(), h(w(t.renderFn.children.default), { key: 0 })) : B("", !0)
|
|
92
|
+
]),
|
|
93
|
+
_: 2
|
|
94
|
+
}, 1032, ["id", "labelled-by", "active"]))), 128))
|
|
95
|
+
], 2)), [
|
|
96
|
+
[L]
|
|
97
|
+
]);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
export {
|
|
101
|
+
Y as _
|
|
102
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { _ as l } from "./chunks/SelectItem.vue_vue_type_script_setup_true_lang.
|
|
|
7
7
|
import { default as d } from "./CheckboxBtn.js";
|
|
8
8
|
import { _ } from "./chunks/CheckboxGroup.vue_vue_type_script_setup_true_lang.DDtN9_Bg.js";
|
|
9
9
|
import { _ as i } from "./chunks/BaseTab.vue_vue_type_script_setup_true_lang.BRubYI9e.js";
|
|
10
|
-
import { _ as b } from "./chunks/BaseTabView.vue_vue_type_script_setup_true_lang.
|
|
10
|
+
import { _ as b } from "./chunks/BaseTabView.vue_vue_type_script_setup_true_lang.liN0ALtl.js";
|
|
11
11
|
import { _ as C } from "./chunks/RadioButton.vue_vue_type_script_setup_true_lang.DR6a7QAi.js";
|
|
12
12
|
import { _ as I } from "./chunks/RadioGroup.vue_vue_type_script_setup_true_lang.DTUA_Q5e.js";
|
|
13
13
|
import { _ as T } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.5pqk7vlZ.js";
|
package/package.json
CHANGED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { defineComponent as L, mergeModels as N, useModel as U, ref as p, useSlots as x, computed as z, watch as R, withDirectives as j, openBlock as n, createElementBlock as l, normalizeClass as h, createElementVNode as T, toDisplayString as I, Fragment as $, renderList as C, createBlock as f, resolveDynamicComponent as F, createCommentVNode as w, withCtx as q } from "vue";
|
|
2
|
-
import { _ as G } from "./BaseTabPanel.vue_vue_type_script_setup_true_lang.DoZHWHt1.js";
|
|
3
|
-
const H = ["id"], J = ["aria-labelledby"], K = ["id", "aria-selected", "aria-controls", "tabindex", "onClick"], O = { key: 0 }, Y = /* @__PURE__ */ L({
|
|
4
|
-
inheritAttrs: !1,
|
|
5
|
-
__name: "BaseTabView",
|
|
6
|
-
props: /* @__PURE__ */ N({
|
|
7
|
-
tabViewDescription: {},
|
|
8
|
-
tabListClasses: { default: "" }
|
|
9
|
-
}, {
|
|
10
|
-
activeIdx: { default: 0 },
|
|
11
|
-
activeIdxModifiers: {}
|
|
12
|
-
}),
|
|
13
|
-
emits: ["update:activeIdx"],
|
|
14
|
-
setup(B) {
|
|
15
|
-
const c = U(B, "activeIdx"), D = p(""), m = p(""), r = p(null), s = (e) => e?.id ?? "", k = x(), d = (e) => e.props ?? null, y = (e) => e.type.__name === "BaseTab", _ = (e, a) => ({
|
|
16
|
-
renderFn: e,
|
|
17
|
-
tabId: b(a),
|
|
18
|
-
"active-tab-panel-idx": d(e)?.["active-tab-panel-idx"] ?? a,
|
|
19
|
-
"header-title": d(e)?.["header-title"] || "",
|
|
20
|
-
class: d(e)?.class || ""
|
|
21
|
-
}), o = z(() => k.default ? k.default().reduce((e, a) => (a.children && Array.isArray(a.children) ? a.children.forEach((t) => {
|
|
22
|
-
y(t) && e.push(_(t, e.length));
|
|
23
|
-
}) : y(a) && e.push(_(a, e.length)), e), []) : []), u = (e) => c.value === e, P = (e) => m.value === e, b = (e) => `base-tab-${e}-${s(r.value)}`, v = (e) => `base-tab-panel-${e}-${s(r.value)}`, A = (e) => o.value.find((a) => a["active-tab-panel-idx"] === e)?.tabId, S = (e) => {
|
|
24
|
-
D.value = b(e);
|
|
25
|
-
}, V = (e) => {
|
|
26
|
-
const a = o.value.at(e ?? -1), t = v(a?.["active-tab-panel-idx"] ?? -1);
|
|
27
|
-
t && (m.value = t);
|
|
28
|
-
}, M = (e) => {
|
|
29
|
-
S(e), c.value = e;
|
|
30
|
-
};
|
|
31
|
-
R(
|
|
32
|
-
c,
|
|
33
|
-
(e) => {
|
|
34
|
-
V(e ?? -1);
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
immediate: !0
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
const g = () => Date.now().toString(36) + Math.random().toString(36).substring(2), E = {
|
|
41
|
-
created(e) {
|
|
42
|
-
console.log("v-uid:directive", e.id), e.setAttribute("id", e.id || g());
|
|
43
|
-
},
|
|
44
|
-
getSSRProps() {
|
|
45
|
-
return {
|
|
46
|
-
id: g()
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
return (e, a) => j((n(), l("div", {
|
|
51
|
-
ref_key: "root",
|
|
52
|
-
ref: r,
|
|
53
|
-
class: h(e.$attrs.class)
|
|
54
|
-
}, [
|
|
55
|
-
T("span", {
|
|
56
|
-
id: `tablist-${s(r.value)}`,
|
|
57
|
-
class: "uikit-sr-only"
|
|
58
|
-
}, I(e.tabViewDescription), 9, H),
|
|
59
|
-
T("div", {
|
|
60
|
-
role: "tablist",
|
|
61
|
-
"aria-labelledby": `tablist-${s(r.value)}`,
|
|
62
|
-
class: h(e.tabListClasses)
|
|
63
|
-
}, [
|
|
64
|
-
(n(!0), l($, null, C(o.value, (t, i) => (n(), l("button", {
|
|
65
|
-
key: i,
|
|
66
|
-
id: b(i),
|
|
67
|
-
type: "button",
|
|
68
|
-
role: "tab",
|
|
69
|
-
"aria-selected": u(i),
|
|
70
|
-
"aria-controls": `base-tab-panel-${i}-${s(r.value)}`,
|
|
71
|
-
tabindex: u(i) ? void 0 : -1,
|
|
72
|
-
class: h([
|
|
73
|
-
"uikit-bg-transparent uikit-p-5px",
|
|
74
|
-
{
|
|
75
|
-
"uikit-border-b-2 uikit-border-solid uikit-border-w-primary uikit-font-semibold": u(i)
|
|
76
|
-
},
|
|
77
|
-
t.class
|
|
78
|
-
]),
|
|
79
|
-
onClick: (Q) => M(i)
|
|
80
|
-
}, [
|
|
81
|
-
t["header-title"] ? (n(), l("span", O, I(t["header-title"]), 1)) : t.renderFn.children && t.renderFn.children.header ? (n(), f(F(t.renderFn.children.header), { key: 1 })) : w("", !0)
|
|
82
|
-
], 10, K))), 128))
|
|
83
|
-
], 10, J),
|
|
84
|
-
(n(!0), l($, null, C(o.value, (t, i) => (n(), f(G, {
|
|
85
|
-
key: i,
|
|
86
|
-
id: v(i),
|
|
87
|
-
"labelled-by": A(i) || "",
|
|
88
|
-
active: P(v(i))
|
|
89
|
-
}, {
|
|
90
|
-
default: q(() => [
|
|
91
|
-
t.renderFn.children && t.renderFn.children.default ? (n(), f(F(t.renderFn.children.default), { key: 0 })) : w("", !0)
|
|
92
|
-
]),
|
|
93
|
-
_: 2
|
|
94
|
-
}, 1032, ["id", "labelled-by", "active"]))), 128))
|
|
95
|
-
], 2)), [
|
|
96
|
-
[E]
|
|
97
|
-
]);
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
export {
|
|
101
|
-
Y as _
|
|
102
|
-
};
|