@wikicasa-dev/components 1.7.51 → 1.7.52
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,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { _ as
|
|
3
|
-
import './assets/BaseComplexToggle.css';const
|
|
1
|
+
import { defineComponent as v, mergeModels as y, useModel as B, ref as a, openBlock as n, createElementBlock as u, normalizeClass as s, createElementVNode as i, withModifiers as c, renderSlot as f, createCommentVNode as k } from "vue";
|
|
2
|
+
import { _ as C } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
3
|
+
import './assets/BaseComplexToggle.css';const w = ["id", "data-cy"], $ = ["data-cy"], L = ["src", "alt"], M = ["innerHTML"], z = ["data-cy"], V = ["src", "alt"], H = ["innerHTML"], j = /* @__PURE__ */ v({
|
|
4
4
|
__name: "BaseComplexToggle",
|
|
5
|
-
props: /* @__PURE__ */
|
|
5
|
+
props: /* @__PURE__ */ y({
|
|
6
6
|
labels: {},
|
|
7
7
|
type: { default: "full" },
|
|
8
8
|
mode: { default: "" },
|
|
@@ -16,101 +16,100 @@ import './assets/BaseComplexToggle.css';const x = ["id", "data-cy"], V = ["data-
|
|
|
16
16
|
modelModifiers: {}
|
|
17
17
|
}),
|
|
18
18
|
emits: ["update:modelValue"],
|
|
19
|
-
setup(
|
|
20
|
-
const l =
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
"base-complex-toggle-active",
|
|
25
|
-
t.value
|
|
26
|
-
), s.value?.classList.remove(
|
|
27
|
-
"base-complex-toggle-active",
|
|
28
|
-
t.value
|
|
29
|
-
);
|
|
30
|
-
}, p = () => {
|
|
31
|
-
i.value?.classList.remove("translateX-left"), i.value?.classList.add("translateX-right"), s.value?.classList.add(
|
|
32
|
-
"base-complex-toggle-active",
|
|
33
|
-
t.value
|
|
34
|
-
), o.value?.classList.remove(
|
|
35
|
-
"base-complex-toggle-active",
|
|
36
|
-
t.value
|
|
37
|
-
);
|
|
38
|
-
}, T = () => {
|
|
39
|
-
b.value = l.labels.leftToggle;
|
|
40
|
-
}, y = () => {
|
|
41
|
-
b.value = l.labels.rightToggle;
|
|
19
|
+
setup(b) {
|
|
20
|
+
const l = b, t = B(b, "modelValue"), r = a("uikit-text-white"), m = a(null), p = a(null), h = a(null), g = () => {
|
|
21
|
+
t.value = l.labels.leftToggle;
|
|
22
|
+
}, d = () => {
|
|
23
|
+
t.value = l.labels.rightToggle;
|
|
42
24
|
};
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
25
|
+
return (() => {
|
|
26
|
+
if (l.labels.leftToggle.checked) {
|
|
27
|
+
g();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (l.labels.rightToggle.checked) {
|
|
31
|
+
d();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
g();
|
|
35
|
+
})(), [
|
|
36
|
+
"uikit-bg-w-gray",
|
|
37
|
+
"uikit-bg-w-warning",
|
|
38
|
+
"uikit-bg-w-lavender"
|
|
39
|
+
].includes(l.btnBgColor) && (r.value = "uikit-text-w-black"), (e, o) => (n(), u("div", {
|
|
52
40
|
id: e.$attrs.id || "",
|
|
53
41
|
"data-cy": e.$attrs["data-cy"] || "",
|
|
54
|
-
class:
|
|
42
|
+
class: s(["base-complex-toggle uikit-relative uikit-flex uikit-justify-center uikit-p-0", [e.mode, e.borderContainerColor, e.size]])
|
|
55
43
|
}, [
|
|
56
|
-
|
|
44
|
+
i("div", {
|
|
57
45
|
ref_key: "leftBtn",
|
|
58
|
-
ref:
|
|
46
|
+
ref: m,
|
|
59
47
|
"data-cy": `bct-left-btn${e.labels.leftToggle.label ? `-${e.labels.leftToggle.label}` : ""}`,
|
|
60
|
-
class: "left-button uikit-flex uikit-flex-1 uikit-items-center uikit-justify-center hover:uikit-cursor-pointer",
|
|
61
|
-
|
|
48
|
+
class: s(["left-button uikit-flex uikit-flex-1 uikit-items-center uikit-justify-center hover:uikit-cursor-pointer", [
|
|
49
|
+
{
|
|
50
|
+
"base-complex-toggle-active": t.value?.label === e.labels.leftToggle.label
|
|
51
|
+
},
|
|
52
|
+
r.value
|
|
53
|
+
]]),
|
|
54
|
+
onClick: o[0] || (o[0] = c((T) => g(), ["stop"]))
|
|
62
55
|
}, [
|
|
63
|
-
|
|
64
|
-
e.labels.leftToggle.icon ? (
|
|
56
|
+
f(e.$slots, "left_icon", {}, () => [
|
|
57
|
+
e.labels.leftToggle.icon ? (n(), u("img", {
|
|
65
58
|
key: 0,
|
|
66
59
|
class: "base-complex-toggle-icon uikit-relative uikit-z-10 uikit-mr-10px",
|
|
67
60
|
src: e.labels.leftToggle.icon.src,
|
|
68
61
|
alt: e.labels.leftToggle.icon.alt,
|
|
69
62
|
width: "15",
|
|
70
63
|
height: "15"
|
|
71
|
-
}, null, 8,
|
|
64
|
+
}, null, 8, L)) : k("", !0)
|
|
72
65
|
], !0),
|
|
73
|
-
|
|
66
|
+
i("span", {
|
|
74
67
|
ref: "leftToggleLabel",
|
|
75
68
|
class: "base-complex-toggle-label uikit-relative uikit-z-10",
|
|
76
69
|
innerHTML: e.labels.leftToggle.label
|
|
77
|
-
}, null, 8,
|
|
78
|
-
],
|
|
79
|
-
|
|
70
|
+
}, null, 8, M)
|
|
71
|
+
], 10, $),
|
|
72
|
+
i("div", {
|
|
80
73
|
ref_key: "rightBtn",
|
|
81
|
-
ref:
|
|
74
|
+
ref: p,
|
|
82
75
|
"data-cy": `bct-right-btn${e.labels.rightToggle.label ? `-${e.labels.rightToggle.label}` : ""}`,
|
|
83
|
-
class: "right-button uikit-flex uikit-flex-1 uikit-items-center uikit-justify-center hover:uikit-cursor-pointer",
|
|
84
|
-
|
|
76
|
+
class: s(["right-button uikit-flex uikit-flex-1 uikit-items-center uikit-justify-center hover:uikit-cursor-pointer", [
|
|
77
|
+
{
|
|
78
|
+
"base-complex-toggle-active": t.value?.label === e.labels.rightToggle.label
|
|
79
|
+
},
|
|
80
|
+
r.value
|
|
81
|
+
]]),
|
|
82
|
+
onClick: o[1] || (o[1] = c((T) => d(), ["stop"]))
|
|
85
83
|
}, [
|
|
86
|
-
|
|
87
|
-
e.labels.rightToggle.icon ? (
|
|
84
|
+
f(e.$slots, "right_icon", {}, () => [
|
|
85
|
+
e.labels.rightToggle.icon ? (n(), u("img", {
|
|
88
86
|
key: 0,
|
|
89
87
|
class: "base-complex-toggle-icon uikit-relative uikit-z-10 uikit-mr-10px",
|
|
90
88
|
src: e.labels.rightToggle.icon.src,
|
|
91
89
|
alt: e.labels.rightToggle.icon.alt,
|
|
92
90
|
width: "15",
|
|
93
91
|
height: "15"
|
|
94
|
-
}, null, 8,
|
|
92
|
+
}, null, 8, V)) : k("", !0)
|
|
95
93
|
], !0),
|
|
96
|
-
|
|
94
|
+
i("span", {
|
|
97
95
|
ref: "rightToggleLabel",
|
|
98
96
|
class: "base-complex-toggle-label uikit-relative uikit-z-10",
|
|
99
97
|
innerHTML: e.labels.rightToggle.label
|
|
100
|
-
}, null, 8,
|
|
101
|
-
],
|
|
102
|
-
|
|
98
|
+
}, null, 8, H)
|
|
99
|
+
], 10, z),
|
|
100
|
+
i("div", {
|
|
103
101
|
ref_key: "dynamicBg",
|
|
104
|
-
ref:
|
|
105
|
-
class:
|
|
102
|
+
ref: h,
|
|
103
|
+
class: s(["uikit-absolute uikit-transition-all uikit-duration-200 uikit-ease-out", [
|
|
106
104
|
e.type === "full" ? "base-complex-toggle-active-bg" : "base-complex-toggle-active-padded-bg",
|
|
107
105
|
e.btnBgColor,
|
|
108
|
-
e.mode
|
|
106
|
+
e.mode,
|
|
107
|
+
t.value?.label === e.labels.leftToggle.label ? "translateX-left" : "translateX-right"
|
|
109
108
|
]])
|
|
110
109
|
}, null, 2)
|
|
111
|
-
], 10,
|
|
110
|
+
], 10, w));
|
|
112
111
|
}
|
|
113
|
-
}), A = /* @__PURE__ */
|
|
112
|
+
}), A = /* @__PURE__ */ C(j, [["__scopeId", "data-v-6ed68051"]]);
|
|
114
113
|
export {
|
|
115
114
|
A as default
|
|
116
115
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.base-complex-toggle[data-v-
|
|
1
|
+
.base-complex-toggle[data-v-6ed68051]{--base-complex-toggle-height: 42px;--base-complex-toggle-width: 230px;--base-complex-toggle-radius: 23px;--base-complex-toggle-border-width: 1px;--base-complex-toggle-active: #E9EFFE;--base-complex-border-color: #B4C2F0;--padding-x-bg: 7px;--padding-y-bg: 8px;--base-complex-toggle-bg-height: var(--base-complex-toggle-height);--base-complex-toggle-bg-width: calc(var(--base-complex-toggle-width) / 2);--base-complex-toggle-bg-padded-width: calc( var(--base-complex-toggle-bg-width) - var(--padding-x-bg) );--base-complex-toggle-bg-padded-height: calc( var(--base-complex-toggle-bg-height) - var(--padding-y-bg) );--padded-bg-dist-from-top: calc(var(--padding-y-bg) / 2);--round-interval: 1px;--translateX-value: calc(var(--base-complex-toggle-bg-width) / 2);--left-translateX: translateX(calc(var(--translateX-value) * -1));--right-translateX: translateX(var(--translateX-value));--toggle-width: var(--base-complex-toggle-width);--toggle-height: var(--base-complex-toggle-height);--toggle-border: var(--base-complex-toggle-border-width) var(--base-complex-toggle-active) solid;--toggle-border-radius: var(--base-complex-toggle-radius)}.base-complex-toggle.lg[data-v-6ed68051]{--base-complex-toggle-height: 56px;--base-complex-toggle-width: 342px;--base-complex-toggle-radius: 28px}@media screen and (max-width: 576px){.base-complex-toggle.mobile[data-v-6ed68051]{--base-complex-toggle-width: 342px }}.base-complex-toggle[data-v-6ed68051]{width:var(--toggle-width);height:var(--toggle-height);border:var(--toggle-border);border-radius:var(--toggle-border-radius)}.left-button.base-complex-toggle-active[data-v-6ed68051],.right-button.base-complex-toggle-active[data-v-6ed68051]{cursor:default}.base-complex-toggle-active[data-v-6ed68051]{font-weight:500}.base-complex-toggle-active-bg[data-v-6ed68051]{--toggle-bg-width: var(--base-complex-toggle-bg-width);--toggle-bg-height: calc( var(--base-complex-toggle-bg-height) - (2 * var(--base-complex-toggle-border-width)) )}@media screen and (max-width: 576px){.base-complex-toggle-active-bg .mobile[data-v-6ed68051]{--toggle-bg-width: var(--base-complex-toggle-bg-lg-width) }}.base-complex-toggle-active-bg[data-v-6ed68051]{width:var(--toggle-bg-width);height:var(--toggle-bg-height);border-radius:var(--base-complex-toggle-radius);z-index:1}.base-complex-toggle-active-padded-bg[data-v-6ed68051]{--toggle-bg-width: var(--base-complex-toggle-bg-padded-width);--toggle-bg-height: calc( var(--base-complex-toggle-bg-padded-height) - (2 * var(--base-complex-toggle-border-width)) )}@media screen and (max-width: 576px){.base-complex-toggle-active-padded-bg.mobile[data-v-6ed68051]{--toggle-bg-width: var(--base-complex-toggle-bg-padded-width) }}.base-complex-toggle-active-padded-bg[data-v-6ed68051]{border-radius:var(--base-complex-toggle-radius);z-index:1;top:var(--padded-bg-dist-from-top);width:var(--toggle-bg-width);height:var(--toggle-bg-height)}.translateX-left[data-v-6ed68051]{transform:var(--left-translateX)}@media screen and (max-width: 576px){.translateX-left.mobile[data-v-6ed68051]{transform:var(--left-translateX)}}.translateX-right[data-v-6ed68051]{transform:var(--right-translateX)}@media screen and (max-width: 576px){.translateX-right.mobile[data-v-6ed68051]{transform:var(--right-translateX)}}.uikit-bg-w-lavender-bordered[data-v-6ed68051]{--tw-border-opacity: 1;border-color:rgb(180 194 240 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(233 239 254 / var(--tw-bg-opacity))}.uikit-bg-w-cultured-bordered[data-v-6ed68051]{border-width:1px;--tw-border-opacity: 1;border-color:rgb(180 194 240 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(244 247 255 / var(--tw-bg-opacity))}.uikit-bg-facile[data-v-6ed68051]{--tw-bg-opacity: 1;background-color:rgb(255 102 0 / var(--tw-bg-opacity))}.border-facile[data-v-6ed68051]{--tw-border-opacity: 1;border-color:rgb(255 102 0 / var(--tw-border-opacity))}
|