@wikicasa-dev/components 1.7.50 → 1.7.51

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/BaseTab.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./chunks/BaseTab.vue_vue_type_script_setup_true_lang.BRubYI9e.js";
1
+ import { _ as f } from "./chunks/BaseTab.vue_vue_type_script_setup_true_lang.Cu67jd8K.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./chunks/BaseTabView.vue_vue_type_script_setup_true_lang.D9k4pe6N.js";
1
+ import { _ as f } from "./chunks/BaseTabView.vue_vue_type_script_setup_true_lang.Cs-5T5J3.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,12 +1,16 @@
1
+ import { ClassType } from '@wikicasa-dev/types';
2
+
1
3
  declare function __VLS_template(): {
2
4
  header?(_: {}): any;
3
5
  };
4
6
  declare const __VLS_component: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
5
7
  activeTabPanelIdx?: number;
6
8
  headerTitle?: string;
9
+ tabPanelClasses?: ClassType;
7
10
  }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
8
11
  activeTabPanelIdx?: number;
9
12
  headerTitle?: string;
13
+ tabPanelClasses?: ClassType;
10
14
  }>>>, {}, {}>;
11
15
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
12
16
  export default _default;
@@ -0,0 +1,15 @@
1
+ import { defineComponent as a, renderSlot as r } from "vue";
2
+ const o = /* @__PURE__ */ a({
3
+ __name: "BaseTab",
4
+ props: {
5
+ activeTabPanelIdx: {},
6
+ headerTitle: {},
7
+ tabPanelClasses: {}
8
+ },
9
+ setup(s) {
10
+ return (e, t) => r(e.$slots, "header");
11
+ }
12
+ });
13
+ export {
14
+ o as _
15
+ };
@@ -0,0 +1,85 @@
1
+ import { defineComponent as V, mergeModels as T, useModel as w, ref as r, onMounted as D, useSlots as L, computed as M, provide as u, watch as x, openBlock as l, createElementBlock as _, normalizeClass as y, createElementVNode as E, toDisplayString as N, createBlock as c, createCommentVNode as b, Fragment as S, renderList as z, withCtx as U, resolveDynamicComponent as j } from "vue";
2
+ import { _ as q } from "./BaseTabPanel.vue_vue_type_script_setup_true_lang.DoZHWHt1.js";
3
+ import { _ as k } from "./BaseTabList.vue_vue_type_script_setup_true_lang.BEX0zH-7.js";
4
+ import { getUID as G } from "../utils.js";
5
+ const H = ["id"], Y = /* @__PURE__ */ V({
6
+ inheritAttrs: !1,
7
+ __name: "BaseTabView",
8
+ props: /* @__PURE__ */ T({
9
+ tabsPosition: { default: "top" },
10
+ tabViewDescription: {},
11
+ tabListClasses: { default: "" }
12
+ }, {
13
+ activeIdx: { default: 0 },
14
+ activeIdxModifiers: {}
15
+ }),
16
+ emits: /* @__PURE__ */ T(["tabClick"], ["update:activeIdx"]),
17
+ setup(C, { emit: J }) {
18
+ const d = w(C, "activeIdx"), I = r(""), v = r(null), g = r(null), s = r("");
19
+ D(() => {
20
+ s.value = G();
21
+ });
22
+ const p = L(), i = (e) => e.props ?? null, m = (e) => e.type.__name === "BaseTab", f = (e, a) => ({
23
+ renderFn: e,
24
+ tabId: h(a),
25
+ "active-tab-panel-idx": i(e)?.["active-tab-panel-idx"] ?? a,
26
+ "header-title": i(e)?.["header-title"] || "",
27
+ class: i(e)?.class || "",
28
+ "tab-panel-classes": i(e)?.["tab-panel-classes"] || ""
29
+ }), n = M(() => p.default ? p.default().reduce((e, a) => (a.children && Array.isArray(a.children) ? a.children.forEach((t) => {
30
+ m(t) && e.push(f(t, e.length));
31
+ }) : m(a) && e.push(f(a, e.length)), e), []) : []);
32
+ u("tabs", n), u("isTabActive", (e) => d.value === e);
33
+ const P = (e) => v.value === e, h = (e) => `base-tab-${e}-${s.value}`, B = (e) => `base-tab-panel-${e}-${s.value}`, $ = (e) => n.value.find((a) => a["active-tab-panel-idx"] === e)?.tabId, A = (e) => {
34
+ I.value = h(e);
35
+ }, F = (e) => {
36
+ const a = n.value.at(e ?? -1);
37
+ v.value = a?.["active-tab-panel-idx"] ?? null;
38
+ };
39
+ return u("handleClick", (e) => {
40
+ A(e), d.value = e;
41
+ }), x(
42
+ d,
43
+ (e) => {
44
+ F(e ?? -1);
45
+ },
46
+ {
47
+ immediate: !0
48
+ }
49
+ ), (e, a) => (l(), _("div", {
50
+ ref_key: "root",
51
+ ref: g,
52
+ class: y(e.$attrs.class)
53
+ }, [
54
+ E("span", {
55
+ id: `tablist-${s.value}`,
56
+ class: "uikit-sr-only"
57
+ }, N(e.tabViewDescription), 9, H),
58
+ e.tabsPosition === "top" ? (l(), c(k, {
59
+ key: 0,
60
+ uid: s.value,
61
+ "tab-list-classes": e.tabListClasses
62
+ }, null, 8, ["uid", "tab-list-classes"])) : b("", !0),
63
+ (l(!0), _(S, null, z(n.value, (t, o) => (l(), c(q, {
64
+ key: o,
65
+ id: B(o),
66
+ "labelled-by": $(o) || "",
67
+ active: P(o),
68
+ class: y(t["tab-panel-classes"])
69
+ }, {
70
+ default: U(() => [
71
+ t.renderFn.children && t.renderFn.children.default ? (l(), c(j(t.renderFn.children.default), { key: 0 })) : b("", !0)
72
+ ]),
73
+ _: 2
74
+ }, 1032, ["id", "labelled-by", "active", "class"]))), 128)),
75
+ e.tabsPosition === "bottom" ? (l(), c(k, {
76
+ key: 1,
77
+ uid: s.value,
78
+ "tab-list-classes": e.tabListClasses
79
+ }, null, 8, ["uid", "tab-list-classes"])) : b("", !0)
80
+ ], 2));
81
+ }
82
+ });
83
+ export {
84
+ Y as _
85
+ };
package/dist/index.js CHANGED
@@ -5,8 +5,8 @@ import { _ as m } from "./chunks/BaseAccordionItem.vue_vue_type_script_setup_tru
5
5
  import { _ as l } from "./chunks/SelectItem.vue_vue_type_script_setup_true_lang.Colhxc7n.js";
6
6
  import { default as d } from "./CheckboxBtn.js";
7
7
  import { _ as n } from "./chunks/CheckboxGroup.vue_vue_type_script_setup_true_lang.Bn9HoCj4.js";
8
- import { _ } from "./chunks/BaseTab.vue_vue_type_script_setup_true_lang.BRubYI9e.js";
9
- import { _ as S } from "./chunks/BaseTabView.vue_vue_type_script_setup_true_lang.D9k4pe6N.js";
8
+ import { _ } from "./chunks/BaseTab.vue_vue_type_script_setup_true_lang.Cu67jd8K.js";
9
+ import { _ as S } from "./chunks/BaseTabView.vue_vue_type_script_setup_true_lang.Cs-5T5J3.js";
10
10
  import { _ as g } from "./chunks/RadioButton.vue_vue_type_script_setup_true_lang.DR6a7QAi.js";
11
11
  import { _ as h } from "./chunks/RadioGroup.vue_vue_type_script_setup_true_lang.BYlMCUWP.js";
12
12
  import { _ as I } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang._TveE6SF.js";
package/dist/types.d.ts CHANGED
@@ -1,8 +1,11 @@
1
+ import { ClassType } from '@wikicasa-dev/types';
2
+
1
3
  export type TwPrefix = "uikit-";
2
4
  export type BaseTabProps = Partial<{
3
5
  "header-title": string;
4
6
  class: string;
5
7
  "active-tab-panel-idx": number;
8
+ "tab-panel-classes": ClassType;
6
9
  }>;
7
10
  export type TabType = {
8
11
  renderFn: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "1.7.50",
3
+ "version": "1.7.51",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,14 +0,0 @@
1
- import { defineComponent as r, renderSlot as a } from "vue";
2
- const s = /* @__PURE__ */ r({
3
- __name: "BaseTab",
4
- props: {
5
- activeTabPanelIdx: {},
6
- headerTitle: {}
7
- },
8
- setup(t) {
9
- return (e, n) => a(e.$slots, "header");
10
- }
11
- });
12
- export {
13
- s as _
14
- };
@@ -1,83 +0,0 @@
1
- import { defineComponent as F, mergeModels as T, useModel as V, ref as o, onMounted as w, useSlots as D, computed as L, provide as u, watch as M, openBlock as i, createElementBlock as _, normalizeClass as x, createElementVNode as E, toDisplayString as N, createBlock as r, createCommentVNode as b, Fragment as S, renderList as z, withCtx as U, resolveDynamicComponent as j } from "vue";
2
- import { _ as q } from "./BaseTabPanel.vue_vue_type_script_setup_true_lang.DoZHWHt1.js";
3
- import { _ as y } from "./BaseTabList.vue_vue_type_script_setup_true_lang.BEX0zH-7.js";
4
- import { getUID as G } from "../utils.js";
5
- const H = ["id"], Y = /* @__PURE__ */ F({
6
- inheritAttrs: !1,
7
- __name: "BaseTabView",
8
- props: /* @__PURE__ */ T({
9
- tabsPosition: { default: "top" },
10
- tabViewDescription: {},
11
- tabListClasses: { default: "" }
12
- }, {
13
- activeIdx: { default: 0 },
14
- activeIdxModifiers: {}
15
- }),
16
- emits: /* @__PURE__ */ T(["tabClick"], ["update:activeIdx"]),
17
- setup(k, { emit: J }) {
18
- const c = V(k, "activeIdx"), C = o(""), v = o(null), I = o(null), a = o("");
19
- w(() => {
20
- a.value = G();
21
- });
22
- const p = D(), d = (e) => e.props ?? null, m = (e) => e.type.__name === "BaseTab", f = (e, t) => ({
23
- renderFn: e,
24
- tabId: h(t),
25
- "active-tab-panel-idx": d(e)?.["active-tab-panel-idx"] ?? t,
26
- "header-title": d(e)?.["header-title"] || "",
27
- class: d(e)?.class || ""
28
- }), l = L(() => p.default ? p.default().reduce((e, t) => (t.children && Array.isArray(t.children) ? t.children.forEach((s) => {
29
- m(s) && e.push(f(s, e.length));
30
- }) : m(t) && e.push(f(t, e.length)), e), []) : []);
31
- u("tabs", l), u("isTabActive", (e) => c.value === e);
32
- const g = (e) => v.value === e, h = (e) => `base-tab-${e}-${a.value}`, P = (e) => `base-tab-panel-${e}-${a.value}`, B = (e) => l.value.find((t) => t["active-tab-panel-idx"] === e)?.tabId, $ = (e) => {
33
- C.value = h(e);
34
- }, A = (e) => {
35
- const t = l.value.at(e ?? -1);
36
- v.value = t?.["active-tab-panel-idx"] ?? null;
37
- };
38
- return u("handleClick", (e) => {
39
- $(e), c.value = e;
40
- }), M(
41
- c,
42
- (e) => {
43
- A(e ?? -1);
44
- },
45
- {
46
- immediate: !0
47
- }
48
- ), (e, t) => (i(), _("div", {
49
- ref_key: "root",
50
- ref: I,
51
- class: x(e.$attrs.class)
52
- }, [
53
- E("span", {
54
- id: `tablist-${a.value}`,
55
- class: "uikit-sr-only"
56
- }, N(e.tabViewDescription), 9, H),
57
- e.tabsPosition === "top" ? (i(), r(y, {
58
- key: 0,
59
- uid: a.value,
60
- "tab-list-classes": e.tabListClasses
61
- }, null, 8, ["uid", "tab-list-classes"])) : b("", !0),
62
- (i(!0), _(S, null, z(l.value, (s, n) => (i(), r(q, {
63
- key: n,
64
- id: P(n),
65
- "labelled-by": B(n) || "",
66
- active: g(n)
67
- }, {
68
- default: U(() => [
69
- s.renderFn.children && s.renderFn.children.default ? (i(), r(j(s.renderFn.children.default), { key: 0 })) : b("", !0)
70
- ]),
71
- _: 2
72
- }, 1032, ["id", "labelled-by", "active"]))), 128)),
73
- e.tabsPosition === "bottom" ? (i(), r(y, {
74
- key: 1,
75
- uid: a.value,
76
- "tab-list-classes": e.tabListClasses
77
- }, null, 8, ["uid", "tab-list-classes"])) : b("", !0)
78
- ], 2));
79
- }
80
- });
81
- export {
82
- Y as _
83
- };