mc-plus 1.0.113 → 1.0.114
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/es/index.js +2 -2
- package/dist/es/mc-switch-B1u_QGZj.js +18 -0
- package/dist/es/theme/mc-switch.css +1 -1
- package/dist/index.css +1 -1
- package/dist/types/mc-switch/types.d.ts +1 -0
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.css.gz +0 -0
- package/dist/umd/index.umd.cjs +1 -1
- package/dist/umd/index.umd.cjs.gz +0 -0
- package/package.json +1 -1
- package/dist/es/mc-switch-CJKHiSY9.js +0 -15
package/dist/es/index.js
CHANGED
|
@@ -95,8 +95,8 @@ import { a as Rs } from "./mc-step-child-item-plus-CbMY1UMS.js";
|
|
|
95
95
|
import { M as M6 } from "./mc-step-child-item-plus-CbMY1UMS.js";
|
|
96
96
|
import { M as Ss } from "./mc-success-icon-BgQB9Rmp.js";
|
|
97
97
|
import { a as a41 } from "./mc-success-icon-BgQB9Rmp.js";
|
|
98
|
-
import { M as us } from "./mc-switch-
|
|
99
|
-
import { a as a42, b as b8 } from "./mc-switch-
|
|
98
|
+
import { M as us } from "./mc-switch-B1u_QGZj.js";
|
|
99
|
+
import { a as a42, b as b8 } from "./mc-switch-B1u_QGZj.js";
|
|
100
100
|
import { M as Ns } from "./mc-tab-CT5ma0pR.js";
|
|
101
101
|
import { a as a43 } from "./mc-tab-CT5ma0pR.js";
|
|
102
102
|
import { a as Us } from "./mc-tab-item-BGbfpv43.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { _ as e, u as l } from "./utils-dWwt4JKv.js";
|
|
2
|
+
import { defineComponent as t, createElementBlock as a, openBlock as s, renderSlot as i, createCommentVNode as o, createElementVNode as c, toDisplayString as n, createVNode as h, unref as p, useSlots as d, computed as m, createBlock as v, createSlots as u, withCtx as b, normalizeStyle as r, normalizeClass as w, withKeys as y, withModifiers as f } from "vue";
|
|
3
|
+
import { M as x } from "./mc-tooltip-BlsZG-T8.js";
|
|
4
|
+
import { u as $ } from "./mc-form-DCKlCcDs.js";
|
|
5
|
+
const T = "mc-switch", g = "mc-switch-label", k = { class: "mc-switch-label-wrapper" }, I = { class: "mc-switch-label" }, _ = { class: "mc-switch-help" }, V = e(t({ name: g, __name: "mc-switch-label", props: { label: {}, helpText: {}, helpIcon: { default: "Info" } }, setup: (e2) => (l2, t2) => (s(), a("div", k, [e2.label || l2.$slots.label ? i(l2.$slots, "label", { key: 0 }, () => [c("span", I, n(e2.label), 1)], true) : o("", true), e2.helpText || l2.$slots.help ? i(l2.$slots, "help", { key: 1 }, () => [c("div", _, [h(p(x), { "icon-name": e2.helpIcon, content: e2.helpText, "icon-size": 22 }, null, 8, ["icon-name", "content"])])], true) : o("", true)])) }), [["__scopeId", "data-v-e1ce5008"]]), B = { class: "mc-switch" }, C = ["id", "disabled", "value", "onKeypress"], j = { class: "mc-switch-inner" }, z = { class: "mc-switch-inner-text" }, K = { class: "mc-switch-inner-text" }, M = l(e(t({ name: T, __name: "mc-switch", props: { modelValue: { type: Boolean, default: false }, width: {}, height: {}, activeText: {}, inactiveText: {}, disabled: { type: Boolean, default: false }, size: { default: "medium" }, label: {}, labelPosition: { default: "right" }, helpIcon: { default: "Info" }, helpText: {}, disableValidation: { type: Boolean }, hideValidationIcon: { type: Boolean }, activeColor: {} }, emits: ["update:modelValue", "change"], setup(e2, { emit: l2 }) {
|
|
6
|
+
const t2 = e2, h2 = l2, x2 = d(), { formId: T2, formDisabled: g2, validateStyle: k2, validateByTrigger: I2 } = $(), _2 = m(() => t2.modelValue), M2 = async () => {
|
|
7
|
+
g2.value || (h2("update:modelValue", !t2.modelValue), h2("change", !t2.modelValue), I2("input"));
|
|
8
|
+
}, P = m(() => x2.label || t2.label || x2.help || t2.helpText ? t2.labelPosition : void 0), q = m(() => "left" === P.value), D = m(() => "right" === P.value), S = m(() => {
|
|
9
|
+
const e3 = {};
|
|
10
|
+
return t2.width && (e3.width = t2.width), t2.height && (e3.height = t2.height), t2.activeColor && (e3["--mc-switch-active-color"] = t2.activeColor), e3;
|
|
11
|
+
});
|
|
12
|
+
return (l3, t3) => (s(), a("div", B, [q.value ? (s(), v(V, { key: 0, label: e2.label, "help-text": e2.helpText, "help-icon": e2.helpIcon }, u({ _: 2 }, [l3.$slots.label ? { name: "label", fn: b(() => [i(l3.$slots, "label", {}, void 0, true)]), key: "0" } : void 0, l3.$slots.help ? { name: "help", fn: b(() => [i(l3.$slots, "help", {}, void 0, true)]), key: "1" } : void 0]), 1032, ["label", "help-text", "help-icon"])) : o("", true), c("label", { class: w(["mc-switch-wrapper", [_2.value ? "mc-switch-actived" : "mc-switch-inactive", { "mc-switch-disabled": p(g2) }, `mc-switch-${e2.size}`, p(k2)]]), style: r(S.value) }, [c("input", { id: p(T2), type: "checkbox", class: "mc-switch-input", disabled: e2.disabled, value: e2.modelValue, onChange: M2, onKeypress: y(f(M2, ["prevent", "stop"]), ["enter"]) }, null, 40, C), c("div", j, [_2.value ? i(l3.$slots, "active", { key: 0 }, () => [c("span", z, n(e2.activeText), 1)], true) : i(l3.$slots, "inactive", { key: 1 }, () => [c("span", K, n(e2.inactiveText), 1)], true)])], 6), D.value ? (s(), v(V, { key: 1, label: e2.label, "help-text": e2.helpText, "help-icon": e2.helpIcon }, u({ _: 2 }, [l3.$slots.label ? { name: "label", fn: b(() => [i(l3.$slots, "label", {}, void 0, true)]), key: "0" } : void 0, l3.$slots.help ? { name: "help", fn: b(() => [i(l3.$slots, "help", {}, void 0, true)]), key: "1" } : void 0]), 1032, ["label", "help-text", "help-icon"])) : o("", true)]));
|
|
13
|
+
} }), [["__scopeId", "data-v-7034320b"]]));
|
|
14
|
+
export {
|
|
15
|
+
M,
|
|
16
|
+
T as a,
|
|
17
|
+
g as b
|
|
18
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.mc-switch-label-wrapper[data-v-e1ce5008]{padding-top:4px;box-sizing:border-box;color:var(--mc-gray-800);font-size:16px;font-weight:400;display:flex;flex-direction:row;justify-content:start;align-items:start;gap:16px;flex-wrap:nowrap}.mc-switch-label-wrapper .mc-switch-help[data-v-e1ce5008]{padding-top:2px;box-sizing:border-box}.mc-switch[data-v-
|
|
1
|
+
.mc-switch-label-wrapper[data-v-e1ce5008]{padding-top:4px;box-sizing:border-box;color:var(--mc-gray-800);font-size:16px;font-weight:400;display:flex;flex-direction:row;justify-content:start;align-items:start;gap:16px;flex-wrap:nowrap}.mc-switch-label-wrapper .mc-switch-help[data-v-e1ce5008]{padding-top:2px;box-sizing:border-box}.mc-switch[data-v-7034320b]{width:100%;display:flex;flex-direction:row;justify-content:start;align-items:start;gap:16px;flex-wrap:nowrap}.mc-switch .mc-switch-wrapper[data-v-7034320b]{width:fit-content;min-width:64px;height:32px;border-radius:24px;cursor:pointer;box-sizing:border-box;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:0;flex-wrap:nowrap;position:relative}.mc-switch .mc-switch-wrapper.mc-switch-small[data-v-7034320b]{width:64px}.mc-switch .mc-switch-wrapper.mc-switch-medium[data-v-7034320b]{width:72px}.mc-switch .mc-switch-wrapper.mc-switch-large[data-v-7034320b]{width:88px}.mc-switch .mc-switch-wrapper .mc-switch-input[data-v-7034320b]{position:absolute;width:0;height:0;opacity:0;margin:0;padding:0;outline:none;border:none}.mc-switch .mc-switch-wrapper .mc-switch-input:active+.mc-switch-inner[data-v-7034320b]:after{transform:scaleY(.8)}.mc-switch .mc-switch-wrapper .mc-switch-inner[data-v-7034320b]{width:100%;height:24px;padding:0 36px;box-sizing:border-box;position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:0;flex-wrap:nowrap}.mc-switch .mc-switch-wrapper .mc-switch-inner[data-v-7034320b]:after{content:"";position:absolute;top:0;width:24px;height:24px;border-radius:50%;background-color:var(--mc-white);transition:right .3s ease-in-out,transform .3s ease-in-out;box-shadow:0 1px 3px #0000001a}.mc-switch .mc-switch-wrapper .mc-switch-inner .mc-switch-inner-text[data-v-7034320b]{color:var(--mc-white);font-size:16px;font-weight:400;-webkit-user-select:none;user-select:none}.mc-switch .mc-switch-wrapper .mc-switch-inner:active .mc-switch-inner[data-v-7034320b]:after{transform:scale(.9)}.mc-switch .mc-switch-wrapper.mc-switch-actived[data-v-7034320b]{background-color:var(--mc-switch-active-color, var(--mc-teal-500))}.mc-switch .mc-switch-wrapper.mc-switch-actived .mc-switch-inner[data-v-7034320b]{padding-left:16px}.mc-switch .mc-switch-wrapper.mc-switch-actived .mc-switch-inner[data-v-7034320b]:after{right:4px}.mc-switch .mc-switch-wrapper.mc-switch-inactive[data-v-7034320b]{background-color:var(--mc-gray-600)}.mc-switch .mc-switch-wrapper.mc-switch-inactive .mc-switch-inner[data-v-7034320b]{padding-right:16px}.mc-switch .mc-switch-wrapper.mc-switch-inactive .mc-switch-inner[data-v-7034320b]:after{right:calc(100% - 28px)}.mc-switch .mc-switch-wrapper.mc-form-validate-error[data-v-7034320b]:not(.mc-switch-disabled){background-color:var(--mc-error)}.mc-switch .mc-switch-wrapper.mc-switch-disabled[data-v-7034320b]{background-color:var(--mc-gray-400);cursor:not-allowed}
|