@wikicasa-dev/components 1.7.7 → 1.7.9

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,4 +1,4 @@
1
- import { _ as f } from "./chunks/BaseTabView.vue_vue_type_script_setup_true_lang.CJk6dPgk.js";
1
+ import { _ as f } from "./chunks/BaseTabView.vue_vue_type_script_setup_true_lang.Ci7XSq3x.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -0,0 +1,88 @@
1
+ import { defineComponent as L, mergeModels as M, useModel as N, ref as _, useSlots as x, computed as S, watch as z, openBlock as r, createElementBlock as s, normalizeClass as p, createElementVNode as T, unref as v, toDisplayString as I, Fragment as $, renderList as g, createBlock as m, resolveDynamicComponent as C, createCommentVNode as F, withCtx as U } from "vue";
2
+ import { _ as j } from "./BaseTabPanel.vue_vue_type_script_setup_true_lang.DoZHWHt1.js";
3
+ import { getUID as q } from "../utils.js";
4
+ const G = ["id"], H = ["aria-labelledby"], J = ["id", "aria-selected", "aria-controls", "tabindex", "onClick"], K = { key: 0 }, X = /* @__PURE__ */ L({
5
+ inheritAttrs: !1,
6
+ __name: "BaseTabView",
7
+ props: /* @__PURE__ */ M({
8
+ tabViewDescription: {},
9
+ tabListClasses: { default: "" }
10
+ }, {
11
+ activeIdx: { default: 0 },
12
+ activeIdxModifiers: {}
13
+ }),
14
+ emits: ["update:activeIdx"],
15
+ setup(B) {
16
+ const i = q(), o = N(B, "activeIdx"), P = _(""), f = _(""), h = x(), c = (e) => e.props ?? null, k = (e) => e.type.__name === "BaseTab", y = (e, a) => ({
17
+ renderFn: e,
18
+ tabId: u(a),
19
+ "active-tab-panel-idx": c(e)?.["active-tab-panel-idx"] ?? a,
20
+ "header-title": c(e)?.["header-title"] || "",
21
+ class: c(e)?.class || ""
22
+ }), l = S(() => h.default ? h.default().reduce((e, a) => (a.children && Array.isArray(a.children) ? a.children.forEach((t) => {
23
+ k(t) && e.push(y(t, e.length));
24
+ }) : k(a) && e.push(y(a, e.length)), e), []) : []), d = (e) => o.value === e, w = (e) => f.value === e, u = (e) => `base-tab-${e}-${i}`, b = (e) => `base-tab-panel-${e}-${i}`, A = (e) => l.value.find((a) => a["active-tab-panel-idx"] === e)?.tabId, V = (e) => {
25
+ P.value = u(e);
26
+ }, D = (e) => {
27
+ const a = l.value.at(e ?? -1), t = b(a?.["active-tab-panel-idx"] ?? -1);
28
+ t && (f.value = t);
29
+ }, E = (e) => {
30
+ V(e), o.value = e;
31
+ };
32
+ return z(
33
+ o,
34
+ (e) => {
35
+ D(e ?? -1);
36
+ },
37
+ {
38
+ immediate: !0
39
+ }
40
+ ), (e, a) => (r(), s("div", {
41
+ class: p(e.$attrs.class)
42
+ }, [
43
+ T("span", {
44
+ id: `tablist-${v(i)}`,
45
+ class: "uikit-sr-only"
46
+ }, I(e.tabViewDescription), 9, G),
47
+ T("div", {
48
+ role: "tablist",
49
+ "aria-labelledby": `tablist-${v(i)}`,
50
+ class: p(e.tabListClasses)
51
+ }, [
52
+ (r(!0), s($, null, g(l.value, (t, n) => (r(), s("button", {
53
+ key: n,
54
+ id: u(n),
55
+ type: "button",
56
+ role: "tab",
57
+ "aria-selected": d(n),
58
+ "aria-controls": `base-tab-panel-${n}-${v(i)}`,
59
+ tabindex: d(n) ? void 0 : -1,
60
+ class: p([
61
+ "uikit-bg-transparent uikit-p-5px",
62
+ {
63
+ "uikit-border-b-2 uikit-border-solid uikit-border-w-primary uikit-font-semibold": d(n)
64
+ },
65
+ t.class
66
+ ]),
67
+ onClick: (O) => E(n)
68
+ }, [
69
+ t["header-title"] ? (r(), s("span", K, I(t["header-title"]), 1)) : t.renderFn.children && t.renderFn.children.header ? (r(), m(C(t.renderFn.children.header), { key: 1 })) : F("", !0)
70
+ ], 10, J))), 128))
71
+ ], 10, H),
72
+ (r(!0), s($, null, g(l.value, (t, n) => (r(), m(j, {
73
+ key: n,
74
+ id: b(n),
75
+ "labelled-by": A(n) || "",
76
+ active: w(b(n))
77
+ }, {
78
+ default: U(() => [
79
+ t.renderFn.children && t.renderFn.children.default ? (r(), m(C(t.renderFn.children.default), { key: 0 })) : F("", !0)
80
+ ]),
81
+ _: 2
82
+ }, 1032, ["id", "labelled-by", "active"]))), 128))
83
+ ], 2));
84
+ }
85
+ });
86
+ export {
87
+ X as _
88
+ };
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.CJk6dPgk.js";
10
+ import { _ as b } from "./chunks/BaseTabView.vue_vue_type_script_setup_true_lang.Ci7XSq3x.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";
@@ -0,0 +1 @@
1
+ export declare const getUID: (prefix?: string) => string;
package/dist/utils.js ADDED
@@ -0,0 +1,5 @@
1
+ let t = 0;
2
+ const i = (e = "uikit_id_") => (t++, `${e}${t}`);
3
+ export {
4
+ i as getUID
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "1.7.7",
3
+ "version": "1.7.9",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,86 +0,0 @@
1
- import { defineComponent as E, mergeModels as M, useModel as N, getCurrentInstance as L, ref as v, useSlots as S, computed as z, watch as j, openBlock as i, createElementBlock as l, normalizeClass as y, createElementVNode as T, toDisplayString as I, Fragment as $, renderList as g, createBlock as p, resolveDynamicComponent as C, createCommentVNode as F, 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 }, W = /* @__PURE__ */ E({
4
- inheritAttrs: !1,
5
- __name: "BaseTabView",
6
- props: /* @__PURE__ */ M({
7
- tabViewDescription: {},
8
- tabListClasses: { default: "" }
9
- }, {
10
- activeIdx: { default: 0 },
11
- activeIdxModifiers: {}
12
- }),
13
- emits: ["update:activeIdx"],
14
- setup(B) {
15
- const c = N(B, "activeIdx"), h = L(), r = v(h ? h.uid : null), P = v(""), m = v(""), f = S(), o = (e) => e.props ?? null, _ = (e) => e.type.__name === "BaseTab", k = (e, a) => ({
16
- renderFn: e,
17
- tabId: u(a),
18
- "active-tab-panel-idx": o(e)?.["active-tab-panel-idx"] ?? a,
19
- "header-title": o(e)?.["header-title"] || "",
20
- class: o(e)?.class || ""
21
- }), s = z(() => f.default ? f.default().reduce((e, a) => (a.children && Array.isArray(a.children) ? a.children.forEach((t) => {
22
- _(t) && e.push(k(t, e.length));
23
- }) : _(a) && e.push(k(a, e.length)), e), []) : []), d = (e) => c.value === e, w = (e) => m.value === e, u = (e) => `base-tab-${e}-${r.value}`, b = (e) => `base-tab-panel-${e}-${r.value}`, A = (e) => s.value.find((a) => a["active-tab-panel-idx"] === e)?.tabId, V = (e) => {
24
- P.value = u(e);
25
- }, D = (e) => {
26
- const a = s.value.at(e ?? -1), t = b(a?.["active-tab-panel-idx"] ?? -1);
27
- t && (m.value = t);
28
- }, x = (e) => {
29
- V(e), c.value = e;
30
- };
31
- return j(
32
- c,
33
- (e) => {
34
- D(e ?? -1);
35
- },
36
- {
37
- immediate: !0
38
- }
39
- ), (e, a) => (i(), l("div", {
40
- class: y(e.$attrs.class)
41
- }, [
42
- T("span", {
43
- id: `tablist-${r.value}`,
44
- class: "uikit-sr-only"
45
- }, I(e.tabViewDescription), 9, H),
46
- T("div", {
47
- role: "tablist",
48
- "aria-labelledby": `tablist-${r.value}`
49
- }, [
50
- (i(!0), l($, null, g(s.value, (t, n) => (i(), l("button", {
51
- key: n,
52
- id: u(n),
53
- type: "button",
54
- role: "tab",
55
- "aria-selected": d(n),
56
- "aria-controls": `base-tab-panel-${n}-${r.value}`,
57
- tabindex: d(n) ? void 0 : -1,
58
- class: y([
59
- "uikit-bg-transparent uikit-p-5px",
60
- {
61
- "uikit-border-b-2 uikit-border-solid uikit-border-w-primary uikit-font-semibold": d(n)
62
- },
63
- t.class
64
- ]),
65
- onClick: (Q) => x(n)
66
- }, [
67
- t["header-title"] ? (i(), l("span", O, I(t["header-title"]), 1)) : t.renderFn.children && t.renderFn.children.header ? (i(), p(C(t.renderFn.children.header), { key: 1 })) : F("", !0)
68
- ], 10, K))), 128))
69
- ], 8, J),
70
- (i(!0), l($, null, g(s.value, (t, n) => (i(), p(G, {
71
- key: n,
72
- id: b(n),
73
- "labelled-by": A(n) || "",
74
- active: w(b(n))
75
- }, {
76
- default: q(() => [
77
- t.renderFn.children && t.renderFn.children.default ? (i(), p(C(t.renderFn.children.default), { key: 0 })) : F("", !0)
78
- ]),
79
- _: 2
80
- }, 1032, ["id", "labelled-by", "active"]))), 128))
81
- ], 2));
82
- }
83
- });
84
- export {
85
- W as _
86
- };