@nmorph/nmorph-ui-kit 2.2.19 → 2.2.21
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/assets/icons/circle-close.svg.js +4 -4
- package/dist/assets/icons/clock.svg.js +2 -2
- package/dist/assets/icons/folder-opened.svg.js +8 -8
- package/dist/assets/icons/forward-filled.svg.js +21 -0
- package/dist/assets/icons/forward.svg.js +24 -0
- package/dist/assets/icons/reply-filled.svg.js +21 -0
- package/dist/assets/icons/reply.svg.js +24 -0
- package/dist/assets/icons/send-filled.svg.js +21 -0
- package/dist/assets/icons/send.svg.js +21 -0
- package/dist/components/basic/nmorph-button/NmorphButton.css +1 -1
- package/dist/components/basic/nmorph-link/NmorphLink.vue.js +16 -15
- package/dist/components/basic/nmorph-link/NmorphLink.vue2.js +17 -14
- package/dist/components/data/nmorph-badge/NmorphBadge.css +1 -1
- package/dist/components/data/nmorph-badge/NmorphBadge.vue.js +23 -23
- package/dist/components/data/nmorph-badge/NmorphBadge.vue2.js +27 -23
- package/dist/components/data/nmorph-calendar/NmorphCalendar.vue.js +14 -13
- package/dist/components/data/nmorph-calendar/NmorphCalendar.vue2.js +68 -65
- package/dist/components/data/nmorph-calendar/utils.js +4 -3
- package/dist/components/data/nmorph-card/NmorphCard.css +1 -1
- package/dist/components/data/nmorph-card/NmorphCard.vue.js +27 -26
- package/dist/components/data/nmorph-card/NmorphCard.vue2.js +21 -13
- package/dist/components/data/nmorph-carousel/NmorphCarousel.vue.js +39 -42
- package/dist/components/data/nmorph-carousel/NmorphCarousel.vue2.js +25 -36
- package/dist/components/data/nmorph-carousel/components/nmorph-carousel-item/NmorphCarouselItem.vue2.js +15 -11
- package/dist/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.css +1 -1
- package/dist/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue.js +14 -13
- package/dist/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue2.js +42 -27
- package/dist/components/data/nmorph-empty/NmorphEmpty.css +1 -0
- package/dist/components/data/nmorph-empty/NmorphEmpty.vue.js +64 -0
- package/dist/components/data/nmorph-empty/NmorphEmpty.vue2.js +43 -0
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.css +1 -1
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +51 -45
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +74 -62
- package/dist/components/data/nmorph-progress/NmorphProgress.vue.js +24 -29
- package/dist/components/data/nmorph-progress/NmorphProgress.vue2.js +25 -14
- package/dist/components/data/nmorph-skeleton/NmorphSkeleton.vue.js +20 -19
- package/dist/components/data/nmorph-skeleton/NmorphSkeleton.vue2.js +15 -12
- package/dist/components/data/nmorph-table/NmorphTable.vue.js +35 -31
- package/dist/components/data/nmorph-table/NmorphTable.vue2.js +64 -50
- package/dist/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.css +1 -1
- package/dist/components/feedback/nmorph-alert/NmorphAlert.vue.js +8 -8
- package/dist/components/feedback/nmorph-alert/NmorphAlert.vue2.js +26 -22
- package/dist/components/feedback/nmorph-callout/NmorphCallout.css +1 -1
- package/dist/components/feedback/nmorph-callout/NmorphCallout.vue.js +16 -15
- package/dist/components/feedback/nmorph-callout/NmorphCallout.vue2.js +11 -8
- package/dist/components/feedback/nmorph-tooltip/NmorphTooltip.css +1 -1
- package/dist/components/feedback/nmorph-tooltip/NmorphTooltip.vue.js +13 -13
- package/dist/components/feedback/nmorph-tooltip/NmorphTooltip.vue2.js +33 -19
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.js +1 -1
- package/dist/components/form/nmorph-date-picker/NmorphDatePicker.css +1 -1
- package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue.js +16 -15
- package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue2.js +39 -32
- package/dist/components/form/nmorph-number-input/NmorphNumberInput.css +1 -1
- package/dist/components/form/nmorph-number-input/NmorphNumberInput.vue.js +7 -7
- package/dist/components/form/nmorph-select/NmorphSelect.vue.js +40 -39
- package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +53 -50
- package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.js +16 -15
- package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +21 -16
- package/dist/components/form/nmorph-select-button/NmorphSelectButton.vue.js +16 -15
- package/dist/components/form/nmorph-select-button/NmorphSelectButton.vue2.js +26 -19
- package/dist/components/form/nmorph-slider/NmorphSlider.vue.js +4 -4
- package/dist/components/form/nmorph-slider/NmorphSlider.vue2.js +48 -38
- package/dist/components/form/nmorph-switch/NmorphSwitch.css +1 -1
- package/dist/components/form/nmorph-switch/NmorphSwitch.vue.js +18 -17
- package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +38 -27
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.css +1 -0
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue.js +183 -0
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +111 -0
- package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.css +1 -1
- package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.js +9 -8
- package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue2.js +14 -14
- package/dist/hooks/use-common-styles.js +75 -9
- package/dist/hooks/use-virtual-list.js +3 -1
- package/dist/icons.js +377 -365
- package/dist/index.es.js +666 -650
- package/dist/index.umd.js +99 -33
- package/dist/locales/en.js +1 -0
- package/dist/locales/ru.js +1 -0
- package/dist/locales/zh.js +1 -0
- package/dist/package.json.js +1 -1
- package/dist/src/components/basic/nmorph-icon/NmorphIcons.d.ts +6 -0
- package/dist/src/components/basic/nmorph-link/NmorphLink.vue.d.ts +2 -0
- package/dist/src/components/data/index.d.ts +1 -0
- package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +2 -0
- package/dist/src/components/data/nmorph-calendar/NmorphCalendar.vue.d.ts +2 -0
- package/dist/src/components/data/nmorph-card/NmorphCard.vue.d.ts +7 -5
- package/dist/src/components/data/nmorph-carousel/NmorphCarousel.vue.d.ts +1 -3
- package/dist/src/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue.d.ts +2 -0
- package/dist/src/components/data/nmorph-empty/NmorphEmpty.vue.d.ts +36 -0
- package/dist/src/components/data/nmorph-image-preview/NmorphImagePreview.vue.d.ts +10 -0
- package/dist/src/components/data/nmorph-progress/NmorphProgress.vue.d.ts +6 -0
- package/dist/src/components/data/nmorph-skeleton/NmorphSkeleton.vue.d.ts +2 -0
- package/dist/src/components/data/nmorph-table/NmorphTable.vue.d.ts +6 -0
- package/dist/src/components/feedback/nmorph-alert/NmorphAlert.vue.d.ts +1 -0
- package/dist/src/components/feedback/nmorph-alert/types.d.ts +1 -0
- package/dist/src/components/feedback/nmorph-callout/NmorphCallout.vue.d.ts +2 -0
- package/dist/src/components/feedback/nmorph-tooltip/NmorphTooltip.vue.d.ts +8 -0
- package/dist/src/components/form/index.d.ts +2 -0
- package/dist/src/components/form/nmorph-date-picker/NmorphDatePicker.vue.d.ts +4 -0
- package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +2 -0
- package/dist/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.d.ts +2 -0
- package/dist/src/components/form/nmorph-select/types.d.ts +2 -0
- package/dist/src/components/form/nmorph-select-button/NmorphSelectButton.vue.d.ts +6 -0
- package/dist/src/components/form/nmorph-slider/types.d.ts +4 -0
- package/dist/src/components/form/nmorph-switch/NmorphSwitch.vue.d.ts +8 -0
- package/dist/src/components/form/nmorph-time-picker/NmorphTimePicker.vue.d.ts +44 -0
- package/dist/src/components/form/nmorph-time-picker/types.d.ts +6 -0
- package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +3 -3
- package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +2 -2
- package/dist/src/outside-hooks/use-nmorph-notification.d.ts +2 -0
- package/dist/style.css +1 -1
- package/package.json +6 -5
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import './NmorphSelect.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { NmorphComponentHeight as
|
|
4
|
-
import { useModifiers as
|
|
5
|
-
import { useI18n as
|
|
6
|
-
import { useFormItemInput as
|
|
7
|
-
import { useVirtualList as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
const
|
|
2
|
+
import { defineComponent as ue, computed as a, ref as d, watch as f, nextTick as L, onMounted as oe, onUnmounted as ie, provide as R } from "vue";
|
|
3
|
+
import { NmorphComponentHeight as se } from "../../../types/index.js";
|
|
4
|
+
import { useModifiers as de } from "../../../utils/create-modifiers.js";
|
|
5
|
+
import { useI18n as ve } from "vue-i18n";
|
|
6
|
+
import { useFormItemInput as ce } from "../nmorph-form/use-form-item-input.js";
|
|
7
|
+
import { useVirtualList as fe } from "../../../hooks/use-virtual-list.js";
|
|
8
|
+
import pe from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
|
|
9
|
+
import me from "./components/nmorph-select-option/NmorphSelectOption.vue.js";
|
|
10
|
+
import he from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
11
|
+
import ge from "../../data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.js";
|
|
12
|
+
import ye from "../../../assets/icons/chevron-down.svg.js";
|
|
13
|
+
import He from "../../../assets/icons/loader.svg.js";
|
|
14
|
+
const Pe = /* @__PURE__ */ ue({
|
|
15
15
|
__name: "NmorphSelect",
|
|
16
16
|
props: {
|
|
17
17
|
noElementPlaceholder: { type: String, required: !1, default: "" },
|
|
@@ -29,6 +29,7 @@ const Ce = /* @__PURE__ */ ne({
|
|
|
29
29
|
virtualMaxHeight: { type: [Number, String], required: !1, default: 240 },
|
|
30
30
|
virtualOverscan: { type: Number, required: !1, default: 5 },
|
|
31
31
|
virtualDynamicHeight: { type: Boolean, required: !1, default: !1 },
|
|
32
|
+
width: { type: [Number, String], required: !1, default: void 0 },
|
|
32
33
|
id: { type: String, required: !1 },
|
|
33
34
|
name: { type: String, required: !1 },
|
|
34
35
|
autocomplete: { type: String, required: !1 },
|
|
@@ -39,14 +40,14 @@ const Ce = /* @__PURE__ */ ne({
|
|
|
39
40
|
emits: ["update:model-value"],
|
|
40
41
|
setup(T, { expose: C, emit: P }) {
|
|
41
42
|
C();
|
|
42
|
-
const { t: M } =
|
|
43
|
+
const { t: M } = ve(), l = T, $ = a(
|
|
43
44
|
() => l.noElementPlaceholder ? l.noElementPlaceholder : M("noElementPlaceholder")
|
|
44
|
-
), m = P, t = d(l.modelValue), r = d(l.open), v = a(() => l.disabled || l.loading), h = a(() => l.optionsWidth === "auto"), g = d(!0), { id: y, name: k, autocomplete: W, tabindex: U } =
|
|
45
|
+
), m = P, t = d(l.modelValue), r = d(l.open), v = a(() => l.disabled || l.loading), h = a(() => l.optionsWidth === "auto"), g = d(!0), { id: y, name: k, autocomplete: W, tabindex: U } = ce(l), H = (e) => {
|
|
45
46
|
if (!v.value) {
|
|
46
47
|
if (r.value = !1, typeof t.value == "string" && (!l.valueRequired && t.value === e ? t.value = "" : t.value = e, m("update:model-value", t.value)), Array.isArray(t.value)) {
|
|
47
|
-
const n = t.value.includes(e),
|
|
48
|
-
if (l.valueRequired &&
|
|
49
|
-
n ? t.value = t.value.filter((
|
|
48
|
+
const n = t.value.includes(e), w = t.value.length === 1 && n;
|
|
49
|
+
if (l.valueRequired && w) return;
|
|
50
|
+
n ? t.value = t.value.filter((ne) => ne !== e) : t.value = [...t.value, e];
|
|
50
51
|
}
|
|
51
52
|
m("update:model-value", t.value);
|
|
52
53
|
}
|
|
@@ -55,8 +56,8 @@ const Ce = /* @__PURE__ */ ne({
|
|
|
55
56
|
}, F = () => {
|
|
56
57
|
p.value = !1;
|
|
57
58
|
}, j = a(
|
|
58
|
-
() =>
|
|
59
|
-
nmorph: [
|
|
59
|
+
() => de({
|
|
60
|
+
nmorph: [se[l.height]],
|
|
60
61
|
"nmorph-select": [
|
|
61
62
|
`${l.disabled && "disabled"}`,
|
|
62
63
|
`${l.modelValue ? "on" : "off"}`,
|
|
@@ -68,7 +69,9 @@ const Ce = /* @__PURE__ */ ne({
|
|
|
68
69
|
`${p.value && "focus"}`
|
|
69
70
|
]
|
|
70
71
|
})
|
|
71
|
-
), Y = () => {
|
|
72
|
+
), b = (e) => typeof e == "number" ? `${e}px` : e, Y = a(() => ({
|
|
73
|
+
...l.width !== void 0 && { "--base-width": b(l.width) }
|
|
74
|
+
})), G = () => {
|
|
72
75
|
v.value || (r.value = !r.value);
|
|
73
76
|
};
|
|
74
77
|
f(
|
|
@@ -78,7 +81,7 @@ const Ce = /* @__PURE__ */ ne({
|
|
|
78
81
|
},
|
|
79
82
|
{ immediate: !0 }
|
|
80
83
|
);
|
|
81
|
-
const
|
|
84
|
+
const q = () => {
|
|
82
85
|
r.value = !1;
|
|
83
86
|
};
|
|
84
87
|
f(
|
|
@@ -87,24 +90,24 @@ const Ce = /* @__PURE__ */ ne({
|
|
|
87
90
|
e && (r.value = !1);
|
|
88
91
|
}
|
|
89
92
|
);
|
|
90
|
-
const i = a(() => l.options.length > 0 ? l.options : l.optionsMap),
|
|
93
|
+
const i = a(() => l.options.length > 0 ? l.options : l.optionsMap), x = d(null), I = d([]), N = a(() => l.options), c = a(() => l.virtual && N.value.length > 0), D = a(() => ({
|
|
91
94
|
basic: 30,
|
|
92
95
|
thick: 38,
|
|
93
96
|
thin: 22
|
|
94
|
-
})[l.height || "basic"]),
|
|
97
|
+
})[l.height || "basic"]), A = a(() => l.virtualItemHeight || D.value), E = a(() => l.virtualOverscan), V = a(() => l.virtualDynamicHeight), s = fe(N, {
|
|
95
98
|
enabled: c,
|
|
96
|
-
itemHeight:
|
|
97
|
-
overscan:
|
|
98
|
-
dynamic:
|
|
99
|
-
}),
|
|
99
|
+
itemHeight: A,
|
|
100
|
+
overscan: E,
|
|
101
|
+
dynamic: V
|
|
102
|
+
}), J = a(() => s.virtualItems.value), K = a(() => ({
|
|
100
103
|
height: `${s.totalHeight.value}px`
|
|
101
|
-
})),
|
|
104
|
+
})), Q = a(() => ({
|
|
102
105
|
transform: `translateY(${s.offsetTop.value}px)`
|
|
103
|
-
})),
|
|
104
|
-
i.value.length > 0 || !
|
|
106
|
+
})), X = a(() => b(l.virtualMaxHeight)), O = () => {
|
|
107
|
+
i.value.length > 0 || !x.value || (I.value = Array.from(x.value.querySelectorAll(".nmorph-select-option")).map((e) => e.getAttribute("value")).filter((e) => !!e));
|
|
105
108
|
}, o = a(
|
|
106
|
-
() => i.value.length > 0 ? i.value.map((e) => e.value) :
|
|
107
|
-
),
|
|
109
|
+
() => i.value.length > 0 ? i.value.map((e) => e.value) : I.value
|
|
110
|
+
), Z = a(() => c.value ? Array.isArray(t.value) ? t.value : t.value ? [t.value] : [] : o.value), u = d(0), S = a(() => o.value[u.value] || ""), ee = a(() => `${y.value}-listbox`), te = (e) => `${y.value}-option-${e.replace(/\s+/g, "-")}`;
|
|
108
111
|
f(u, (e) => {
|
|
109
112
|
r.value && c.value && s.scrollToIndex(e);
|
|
110
113
|
}), f(
|
|
@@ -121,26 +124,26 @@ const Ce = /* @__PURE__ */ ne({
|
|
|
121
124
|
}
|
|
122
125
|
s.refresh(), c.value && s.scrollToIndex(u.value);
|
|
123
126
|
}
|
|
124
|
-
}),
|
|
125
|
-
await L(), O(), document.addEventListener("click",
|
|
126
|
-
}),
|
|
127
|
-
document.removeEventListener("click",
|
|
127
|
+
}), oe(async () => {
|
|
128
|
+
await L(), O(), document.addEventListener("click", q);
|
|
129
|
+
}), ie(() => {
|
|
130
|
+
document.removeEventListener("click", q);
|
|
128
131
|
});
|
|
129
|
-
const
|
|
132
|
+
const le = a(() => typeof t.value == "string" ? t.value === "" ? $.value : i.value.find((e) => e.value === t.value)?.label : i.value.find((e) => e.value === t.value)?.label), ae = a(() => i.value.length > 0 ? i.value.filter((n) => t.value.includes(n.value)).map((n) => ({ text: n.label, value: n.value })) : Array.isArray(t.value) ? t.value.map((n) => ({ text: n, value: n })) : [{ text: t.value, value: t.value }]);
|
|
130
133
|
R("select-selected-value", t), R("select-change-selected-value", H);
|
|
131
|
-
const _ = d(null),
|
|
134
|
+
const _ = d(null), re = a(
|
|
132
135
|
() => h.value ? `${_.value?.clientWidth || 0}px` : void 0
|
|
133
|
-
), B = { t: M, props: l, computedNoElementPlaceholder: $, emit: m, initialValue: t, open: r, disabledInput: v, autoOptionsWidth: h, selectedLineOutset: g, id: y, name: k, autocomplete: W, tabindex: U, changeHandler: H, focus: p, focusHandler: z, blurHandler: F, modifiers: j,
|
|
136
|
+
), B = { t: M, props: l, computedNoElementPlaceholder: $, emit: m, initialValue: t, open: r, disabledInput: v, autoOptionsWidth: h, selectedLineOutset: g, id: y, name: k, autocomplete: W, tabindex: U, changeHandler: H, focus: p, focusHandler: z, blurHandler: F, modifiers: j, getCssSize: b, styles: Y, clickHandler: G, closeHandler: q, optionsMap: i, optionsDOMRef: x, slotDomOptions: I, renderedOptions: N, virtualEnabled: c, defaultOptionHeight: D, virtualItemHeight: A, virtualOverscan: E, virtualDynamicHeight: V, virtualList: s, virtualOptions: J, virtualSpacerStyle: K, virtualContentStyle: Q, virtualMaxHeight: X, refreshDomOptions: O, domOptions: o, nativeOptions: Z, currentIndex: u, currentFocusedEl: S, listboxId: ee, getOptionId: te, selectedValueTitle: le, tags: ae, nmorphSelectDOMRef: _, optionsMinWidth: re, spaceHandler: () => {
|
|
134
137
|
v.value || (r.value = !r.value);
|
|
135
138
|
}, arrowDownHandler: () => {
|
|
136
139
|
v.value || o.value.length !== 0 && (r.value || (r.value = !0), u.value = (u.value + 1) % o.value.length);
|
|
137
140
|
}, arrowUpHandler: () => {
|
|
138
141
|
v.value || o.value.length !== 0 && (r.value || (r.value = !0), u.value = (u.value - 1 + o.value.length) % o.value.length);
|
|
139
142
|
}, enterHandler: () => {
|
|
140
|
-
r.value &&
|
|
143
|
+
r.value && S.value && H(S.value);
|
|
141
144
|
}, setVirtualOptionRef: (e, n) => {
|
|
142
|
-
const
|
|
143
|
-
s.measureElement(n,
|
|
145
|
+
const w = e instanceof Element ? e : e?.$el;
|
|
146
|
+
s.measureElement(n, w);
|
|
144
147
|
}, escapeHandler: () => {
|
|
145
148
|
r.value = !1;
|
|
146
149
|
}, homeHandler: () => {
|
|
@@ -148,21 +151,21 @@ const Ce = /* @__PURE__ */ ne({
|
|
|
148
151
|
}, endHandler: () => {
|
|
149
152
|
u.value = Math.max(o.value.length - 1, 0);
|
|
150
153
|
}, get NmorphTagItem() {
|
|
151
|
-
return
|
|
154
|
+
return ge;
|
|
152
155
|
}, get NmorphIcon() {
|
|
153
|
-
return
|
|
156
|
+
return he;
|
|
154
157
|
}, get NmorphSelectOption() {
|
|
155
|
-
return
|
|
158
|
+
return me;
|
|
156
159
|
}, get NmorphDropdown() {
|
|
157
|
-
return
|
|
160
|
+
return pe;
|
|
158
161
|
}, get NmorphIconLoader() {
|
|
159
|
-
return
|
|
162
|
+
return He;
|
|
160
163
|
}, get NmorphIconChevronDown() {
|
|
161
|
-
return
|
|
164
|
+
return ye;
|
|
162
165
|
} };
|
|
163
166
|
return Object.defineProperty(B, "__isScriptSetup", { enumerable: !1, value: !0 }), B;
|
|
164
167
|
}
|
|
165
168
|
});
|
|
166
169
|
export {
|
|
167
|
-
|
|
170
|
+
Pe as default
|
|
168
171
|
};
|
package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.js
CHANGED
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
import './NmorphSelectOption.css';
|
|
2
|
-
import
|
|
3
|
-
import { openBlock as o, createElementBlock as l,
|
|
2
|
+
import c from "./NmorphSelectOption.vue2.js";
|
|
3
|
+
import { openBlock as o, createElementBlock as l, normalizeStyle as n, normalizeClass as a, createElementVNode as r, toDisplayString as i, renderSlot as s, createBlock as d, withCtx as m, createVNode as p, createCommentVNode as _ } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
function
|
|
5
|
+
import h from "../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const f = ["value", "aria-selected", "aria-disabled"], k = { class: "nmorph-select-option__content" };
|
|
7
|
+
function v(t, N, b, e, y, S) {
|
|
8
8
|
return o(), l("div", {
|
|
9
|
-
class:
|
|
9
|
+
class: a(e.modifiers),
|
|
10
|
+
style: n(e.styles),
|
|
10
11
|
value: e.props.value,
|
|
11
12
|
role: "option",
|
|
12
13
|
"aria-selected": e.checked,
|
|
13
14
|
"aria-disabled": e.props.disabled,
|
|
14
15
|
onClick: e.clickHandler
|
|
15
16
|
}, [
|
|
16
|
-
r("div",
|
|
17
|
+
r("div", k, [
|
|
17
18
|
r(
|
|
18
19
|
"span",
|
|
19
20
|
null,
|
|
20
|
-
|
|
21
|
+
i(e.props.label),
|
|
21
22
|
1
|
|
22
23
|
/* TEXT */
|
|
23
24
|
),
|
|
24
|
-
|
|
25
|
+
s(t.$slots, "default")
|
|
25
26
|
]),
|
|
26
|
-
e.checked ? (o(),
|
|
27
|
+
e.checked ? (o(), d(e.NmorphIcon, {
|
|
27
28
|
key: 0,
|
|
28
29
|
class: "nmorph-select-option__checked"
|
|
29
30
|
}, {
|
|
30
|
-
default:
|
|
31
|
+
default: m(() => [
|
|
31
32
|
p(e.NmorphIconSuccess)
|
|
32
33
|
]),
|
|
33
34
|
_: 1
|
|
34
35
|
/* STABLE */
|
|
35
|
-
})) :
|
|
36
|
-
],
|
|
36
|
+
})) : _("v-if", !0)
|
|
37
|
+
], 14, f);
|
|
37
38
|
}
|
|
38
|
-
const
|
|
39
|
+
const V = /* @__PURE__ */ h(c, [["render", v], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue"]]);
|
|
39
40
|
export {
|
|
40
|
-
|
|
41
|
+
V as default
|
|
41
42
|
};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import './NmorphSelectOption.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { NmorphComponentHeight as
|
|
2
|
+
import { defineComponent as h, inject as i, computed as o } from "vue";
|
|
3
|
+
import { NmorphComponentHeight as v } from "../../../../../types/index.js";
|
|
4
4
|
import { useModifiers as g } from "../../../../../utils/create-modifiers.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
5
|
+
import y from "../../../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
6
|
+
import S from "../../../../../assets/icons/success.svg.js";
|
|
7
|
+
const C = /* @__PURE__ */ h({
|
|
8
8
|
__name: "NmorphSelectOption",
|
|
9
9
|
props: {
|
|
10
10
|
value: { type: String, required: !0 },
|
|
11
11
|
label: { type: String, required: !0, default: "" },
|
|
12
12
|
focused: { type: Boolean, required: !1, default: !1 },
|
|
13
|
+
hoverBackground: { type: String, required: !1, default: void 0 },
|
|
14
|
+
hoverColor: { type: String, required: !1, default: void 0 },
|
|
13
15
|
id: { type: String, required: !1 },
|
|
14
16
|
name: { type: String, required: !1 },
|
|
15
17
|
autocomplete: { type: String, required: !1 },
|
|
@@ -18,13 +20,13 @@ const I = /* @__PURE__ */ m({
|
|
|
18
20
|
tabindex: { type: Number, required: !1 }
|
|
19
21
|
},
|
|
20
22
|
emits: ["change-value"],
|
|
21
|
-
setup(
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
e.disabled || (l("change-value", e.value),
|
|
25
|
-
}, a =
|
|
23
|
+
setup(n, { expose: s, emit: c }) {
|
|
24
|
+
s();
|
|
25
|
+
const r = i("select-selected-value"), t = i("select-change-selected-value"), e = n, l = c, d = () => {
|
|
26
|
+
e.disabled || (l("change-value", e.value), t && t(e.value));
|
|
27
|
+
}, a = o(() => typeof r?.value == "string" ? r.value === e.value : Array.isArray(r?.value) ? r.value.some((m) => m === e.value) : !1), p = o(
|
|
26
28
|
() => g({
|
|
27
|
-
nmorph: [
|
|
29
|
+
nmorph: [v[e.height]],
|
|
28
30
|
"nmorph-select-option": [
|
|
29
31
|
`${e.disabled && "disabled"}`,
|
|
30
32
|
`${e.label && "with-label"}`,
|
|
@@ -32,14 +34,17 @@ const I = /* @__PURE__ */ m({
|
|
|
32
34
|
`${e.focused && "focused"}`
|
|
33
35
|
]
|
|
34
36
|
})
|
|
35
|
-
),
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
), f = o(() => ({
|
|
38
|
+
...e.hoverBackground !== void 0 && { "--hover-bg": e.hoverBackground },
|
|
39
|
+
...e.hoverColor !== void 0 && { "--hover-color": e.hoverColor }
|
|
40
|
+
})), u = { selectSelectedValue: r, selectChangeSelectedValue: t, props: e, emit: l, clickHandler: d, checked: a, modifiers: p, styles: f, get NmorphIcon() {
|
|
38
41
|
return y;
|
|
42
|
+
}, get NmorphIconSuccess() {
|
|
43
|
+
return S;
|
|
39
44
|
} };
|
|
40
|
-
return Object.defineProperty(
|
|
45
|
+
return Object.defineProperty(u, "__isScriptSetup", { enumerable: !1, value: !0 }), u;
|
|
41
46
|
}
|
|
42
47
|
});
|
|
43
48
|
export {
|
|
44
|
-
|
|
49
|
+
C as default
|
|
45
50
|
};
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import './NmorphSelectButton.css';
|
|
2
2
|
import n from "./NmorphSelectButton.vue2.js";
|
|
3
|
-
import { openBlock as
|
|
3
|
+
import { openBlock as r, createElementBlock as l, normalizeStyle as s, normalizeClass as m, Fragment as c, renderList as i, createBlock as d, withCtx as u, createTextVNode as f, toDisplayString as p, renderSlot as _ } from "vue";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import
|
|
6
|
-
function
|
|
7
|
-
return
|
|
5
|
+
import b from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
function h(o, v, a, t, y, B) {
|
|
7
|
+
return r(), l(
|
|
8
8
|
"div",
|
|
9
9
|
{
|
|
10
|
-
class:
|
|
10
|
+
class: m(t.modifiers),
|
|
11
|
+
style: s(t.styles)
|
|
11
12
|
},
|
|
12
13
|
[
|
|
13
|
-
(
|
|
14
|
+
(r(!0), l(
|
|
14
15
|
c,
|
|
15
16
|
null,
|
|
16
|
-
|
|
17
|
+
i(a.options, (e) => (r(), d(t.NmorphSelectButtonItem, {
|
|
17
18
|
key: e.value,
|
|
18
19
|
value: e.value,
|
|
19
20
|
disabled: e.disabled
|
|
20
21
|
}, {
|
|
21
|
-
default:
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
default: u(() => [
|
|
23
|
+
f(
|
|
24
|
+
p(e.label),
|
|
24
25
|
1
|
|
25
26
|
/* TEXT */
|
|
26
27
|
)
|
|
@@ -31,13 +32,13 @@ function b(l, h, a, r, v, B) {
|
|
|
31
32
|
128
|
|
32
33
|
/* KEYED_FRAGMENT */
|
|
33
34
|
)),
|
|
34
|
-
|
|
35
|
+
_(o.$slots, "default")
|
|
35
36
|
],
|
|
36
|
-
|
|
37
|
-
/* CLASS */
|
|
37
|
+
6
|
|
38
|
+
/* CLASS, STYLE */
|
|
38
39
|
);
|
|
39
40
|
}
|
|
40
|
-
const
|
|
41
|
+
const g = /* @__PURE__ */ b(n, [["render", h], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-select-button/NmorphSelectButton.vue"]]);
|
|
41
42
|
export {
|
|
42
|
-
|
|
43
|
+
g as default
|
|
43
44
|
};
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import './NmorphSelectButton.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
2
|
+
import { defineComponent as c, ref as S, watch as g, computed as o, provide as n } from "vue";
|
|
3
|
+
import { useModifiers as y } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import b from "./components/nmorph-select-button-item/NmorphSelectButtonItem.vue.js";
|
|
5
|
+
const _ = /* @__PURE__ */ c({
|
|
6
6
|
__name: "NmorphSelectButton",
|
|
7
7
|
props: {
|
|
8
8
|
modelValue: { type: String, required: !1, default: "" },
|
|
9
9
|
options: { type: Array, required: !1, default: () => [] },
|
|
10
10
|
fill: { type: Boolean, required: !1, default: !1 },
|
|
11
|
+
trackPadding: { type: [Number, String], required: !1, default: void 0 },
|
|
12
|
+
itemSize: { type: [Number, String], required: !1, default: void 0 },
|
|
13
|
+
itemFontSize: { type: String, required: !1, default: void 0 },
|
|
11
14
|
id: { type: String, required: !1 },
|
|
12
15
|
name: { type: String, required: !1 },
|
|
13
16
|
autocomplete: { type: String, required: !1 },
|
|
@@ -16,29 +19,33 @@ const q = /* @__PURE__ */ p({
|
|
|
16
19
|
tabindex: { type: Number, required: !1 }
|
|
17
20
|
},
|
|
18
21
|
emits: ["update:model-value"],
|
|
19
|
-
setup(u, { expose:
|
|
20
|
-
|
|
21
|
-
const e = u,
|
|
22
|
-
|
|
22
|
+
setup(u, { expose: s, emit: m }) {
|
|
23
|
+
s();
|
|
24
|
+
const e = u, l = m, i = S(e.modelValue);
|
|
25
|
+
g(
|
|
23
26
|
() => e.modelValue,
|
|
24
|
-
(
|
|
25
|
-
|
|
27
|
+
(t) => {
|
|
28
|
+
i.value = t;
|
|
26
29
|
}
|
|
27
30
|
);
|
|
28
|
-
const
|
|
29
|
-
() =>
|
|
31
|
+
const f = o(
|
|
32
|
+
() => y({
|
|
30
33
|
"nmorph-select-button": [`${e.disabled && "disabled"}`, `${e.fill && "fill"}`, e.height]
|
|
31
34
|
})
|
|
32
|
-
),
|
|
33
|
-
e.
|
|
35
|
+
), r = (t) => typeof t == "number" ? `${t}px` : t, p = o(() => ({
|
|
36
|
+
...e.trackPadding !== void 0 && { "--track-padding": r(e.trackPadding) },
|
|
37
|
+
...e.itemSize !== void 0 && { "--item-size": r(e.itemSize) },
|
|
38
|
+
...e.itemFontSize !== void 0 && { "--item-font-size": e.itemFontSize }
|
|
39
|
+
})), a = (t) => {
|
|
40
|
+
e.disabled || (i.value = t, l("update:model-value", t));
|
|
34
41
|
};
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
return
|
|
42
|
+
n("select-button-selected-value", i), n("select-button-change-handler", a);
|
|
43
|
+
const d = { props: e, emit: l, initialValue: i, modifiers: f, getCssSize: r, styles: p, changeHandler: a, get NmorphSelectButtonItem() {
|
|
44
|
+
return b;
|
|
38
45
|
} };
|
|
39
|
-
return Object.defineProperty(
|
|
46
|
+
return Object.defineProperty(d, "__isScriptSetup", { enumerable: !1, value: !0 }), d;
|
|
40
47
|
}
|
|
41
48
|
});
|
|
42
49
|
export {
|
|
43
|
-
|
|
50
|
+
_ as default
|
|
44
51
|
};
|
|
@@ -4,12 +4,12 @@ import { openBlock as n, createElementBlock as l, normalizeStyle as r, normalize
|
|
|
4
4
|
/* empty css */
|
|
5
5
|
import s from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
6
|
const m = { class: "nmorph-slider__content" }, c = { class: "nmorph-slider__input-wrapper" }, p = ["id", "name", "tabindex", "value", "min", "max", "step", "disabled"];
|
|
7
|
-
function h
|
|
7
|
+
function _(h, f, b, o, v, x) {
|
|
8
8
|
return n(), l(
|
|
9
9
|
"div",
|
|
10
10
|
{
|
|
11
11
|
class: i(o.modifiers),
|
|
12
|
-
style: r(
|
|
12
|
+
style: r(o.styles)
|
|
13
13
|
},
|
|
14
14
|
[
|
|
15
15
|
e("div", m, [
|
|
@@ -67,7 +67,7 @@ function h(_, b, f, o, v, x) {
|
|
|
67
67
|
/* CLASS, STYLE */
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
|
-
const
|
|
70
|
+
const P = /* @__PURE__ */ s(t, [["render", _], ["__file", "/builds/ketjo/nmorph/library/src/components/form/nmorph-slider/NmorphSlider.vue"]]);
|
|
71
71
|
export {
|
|
72
|
-
|
|
72
|
+
P as default
|
|
73
73
|
};
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import './NmorphSlider.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { useFormItemInput as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
2
|
+
import { defineComponent as k, computed as m, ref as o, watch as I, onMounted as A, onUnmounted as G } from "vue";
|
|
3
|
+
import { useModifiers as J } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { useFormItemInput as K } from "../nmorph-form/use-form-item-input.js";
|
|
5
|
+
import Q from "../../feedback/nmorph-tooltip/NmorphTooltip.vue.js";
|
|
6
|
+
const se = /* @__PURE__ */ k({
|
|
7
7
|
__name: "NmorphSlider",
|
|
8
8
|
props: {
|
|
9
9
|
modelValue: { type: Number, required: !1, default: 0 },
|
|
10
10
|
max: { type: Number, required: !1, default: 100 },
|
|
11
11
|
min: { type: Number, required: !1, default: 0 },
|
|
12
12
|
step: { type: Number, required: !1, default: 1 },
|
|
13
|
+
fill: { type: Boolean, required: !1, default: !0 },
|
|
13
14
|
showTooltip: { type: Boolean, required: !1, default: !0 },
|
|
15
|
+
thumbWidth: { type: Number, required: !1, default: 50 },
|
|
16
|
+
sliderHeight: { type: [Number, String], required: !1, default: void 0 },
|
|
17
|
+
valueFixedContainerHeight: { type: [Number, String], required: !1, default: void 0 },
|
|
14
18
|
id: { type: String, required: !1 },
|
|
15
19
|
name: { type: String, required: !1 },
|
|
16
20
|
autocomplete: { type: String, required: !1 },
|
|
@@ -18,66 +22,72 @@ const m = 50, re = /* @__PURE__ */ U({
|
|
|
18
22
|
tabindex: { type: Number, required: !1 }
|
|
19
23
|
},
|
|
20
24
|
emits: ["update:model-value"],
|
|
21
|
-
setup(
|
|
22
|
-
|
|
23
|
-
const e =
|
|
24
|
-
() =>
|
|
25
|
+
setup(H, { expose: L, emit: M }) {
|
|
26
|
+
L();
|
|
27
|
+
const e = H, { id: N, name: T, tabindex: S } = K(e), _ = m(
|
|
28
|
+
() => J({
|
|
25
29
|
nmorph: [],
|
|
26
30
|
"nmorph-slider": [`${e.disabled && "disabled"}`]
|
|
27
31
|
})
|
|
28
|
-
),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}),
|
|
32
|
+
), g = m(() => `${e.thumbWidth}px`), p = o(e.showTooltip), x = M, n = o(e.modelValue), c = o(null);
|
|
33
|
+
I(n, () => {
|
|
34
|
+
x("update:model-value", n.value);
|
|
35
|
+
}), I(
|
|
32
36
|
() => e.modelValue,
|
|
33
37
|
(t) => {
|
|
34
38
|
n.value = t;
|
|
35
39
|
}
|
|
36
40
|
);
|
|
37
|
-
const
|
|
38
|
-
const t = s.value - s.value, r = e.max - e.min + t,
|
|
39
|
-
let D =
|
|
40
|
-
const
|
|
41
|
+
const y = o(null), C = m(() => {
|
|
42
|
+
const t = s.value - s.value, r = e.max - e.min + t, u = (n.value - e.min) / r * 100, a = c.value?.clientWidth || 0, d = e.thumbWidth / a * 100, R = d / 2;
|
|
43
|
+
let D = u - R;
|
|
44
|
+
const W = `${Math.max(0, Math.min(100 - d, D))}%`, q = a / 100, X = e.thumbWidth / 2 / q, E = (y.value?.tooltipBody.clientWidth ?? 24) / 2 / q, j = E === 1 / 0 ? 1.714 : E, U = `${parseFloat(W) + X - j}%`;
|
|
41
45
|
return {
|
|
42
|
-
thumb:
|
|
43
|
-
tooltip:
|
|
46
|
+
thumb: W,
|
|
47
|
+
tooltip: U
|
|
44
48
|
};
|
|
45
49
|
}), s = o(0), f = o(0), h = () => {
|
|
46
50
|
s.value = window.innerWidth, f.value = window.innerHeight;
|
|
47
51
|
};
|
|
48
|
-
|
|
52
|
+
A(() => {
|
|
49
53
|
typeof window < "u" && (s.value = window.innerWidth, f.value = window.innerHeight, window.addEventListener("resize", h));
|
|
50
|
-
}),
|
|
51
|
-
typeof window < "u" && (document.removeEventListener("pointermove",
|
|
54
|
+
}), G(() => {
|
|
55
|
+
typeof window < "u" && (document.removeEventListener("pointermove", l), document.removeEventListener("pointerup", i), document.removeEventListener("pointercancel", i), window.removeEventListener("resize", h));
|
|
52
56
|
});
|
|
53
57
|
const v = (t) => {
|
|
54
58
|
b.value = !1;
|
|
55
|
-
const r =
|
|
56
|
-
let
|
|
59
|
+
const r = c.value?.getBoundingClientRect();
|
|
60
|
+
let u = 0;
|
|
57
61
|
if (r) {
|
|
58
|
-
const
|
|
59
|
-
|
|
62
|
+
const a = t - r.left, d = r.width;
|
|
63
|
+
u = Math.max(0, Math.min(1, a / d)), n.value = e.min + u * (e.max - e.min);
|
|
60
64
|
}
|
|
61
65
|
n.value = Math.round(n.value / e.step) * e.step, n.value = Math.max(e.min, Math.min(e.max, n.value));
|
|
62
|
-
},
|
|
66
|
+
}, l = (t) => {
|
|
63
67
|
t.preventDefault(), v(t.clientX);
|
|
64
68
|
}, i = () => {
|
|
65
|
-
document.removeEventListener("pointermove",
|
|
66
|
-
},
|
|
67
|
-
e.disabled || t.pointerType === "mouse" && t.button !== 0 || (t.preventDefault(), v(t.clientX), document.addEventListener("pointermove",
|
|
68
|
-
},
|
|
69
|
-
e.showTooltip && (
|
|
70
|
-
},
|
|
71
|
-
e.showTooltip && (
|
|
72
|
-
},
|
|
69
|
+
document.removeEventListener("pointermove", l), document.removeEventListener("pointerup", i), document.removeEventListener("pointercancel", i), b.value = !0;
|
|
70
|
+
}, z = (t) => {
|
|
71
|
+
e.disabled || t.pointerType === "mouse" && t.button !== 0 || (t.preventDefault(), v(t.clientX), document.addEventListener("pointermove", l), document.addEventListener("pointerup", i), document.addEventListener("pointercancel", i));
|
|
72
|
+
}, F = o(null), O = () => {
|
|
73
|
+
e.showTooltip && (p.value = !0);
|
|
74
|
+
}, V = () => {
|
|
75
|
+
e.showTooltip && (p.value = !1);
|
|
76
|
+
}, B = (t) => {
|
|
73
77
|
const r = t.target;
|
|
74
78
|
n.value = Number(r.value);
|
|
75
|
-
}, b = o(!0),
|
|
76
|
-
|
|
79
|
+
}, b = o(!0), w = (t) => typeof t == "number" ? `${t}px` : t, $ = m(() => ({
|
|
80
|
+
"--nmorph-slider-thumb-width": g.value,
|
|
81
|
+
...e.sliderHeight !== void 0 && { "--slider-height": w(e.sliderHeight) },
|
|
82
|
+
...e.valueFixedContainerHeight !== void 0 && {
|
|
83
|
+
"--value-fixed-container-height": w(e.valueFixedContainerHeight)
|
|
84
|
+
}
|
|
85
|
+
})), P = { props: e, id: N, name: T, tabindex: S, modifiers: _, thumbWidthCss: g, tooltipVisible: p, emit: x, thumbValue: n, sliderContainer: c, tooltipRootRef: y, thumbXPercentPosition: C, windowWidth: s, windowHeight: f, resizeWindowHandler: h, updateThumbValue: v, pointerMove: l, pointerUp: i, pointerDownHandler: z, sliderFirst: F, handleMouseEnter: O, handleMouseLeave: V, nativeInputHandler: B, transitionEnabled: b, getCssSize: w, styles: $, get NmorphTooltip() {
|
|
86
|
+
return Q;
|
|
77
87
|
} };
|
|
78
88
|
return Object.defineProperty(P, "__isScriptSetup", { enumerable: !1, value: !0 }), P;
|
|
79
89
|
}
|
|
80
90
|
});
|
|
81
91
|
export {
|
|
82
|
-
|
|
92
|
+
se as default
|
|
83
93
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-switch{--height: 20px;--offset: 3px;--thumb-height: 14px;width:
|
|
1
|
+
.nmorph-switch{--width: 40px;--height: 20px;--offset: 3px;--thumb-height: 14px;width:var(--width);height:var(--height);overflow:hidden;border-radius:var(--border-radius-999);cursor:pointer}.nmorph-switch .nmorph-switch__content{position:relative;height:100%;font-weight:400;font-size:var(--font-size-small);line-height:var(--line-height-regular);background:var(--nmorph-main-color);border-radius:var(--border-radius-999);box-shadow:inset var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),inset calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color)}.nmorph-switch .nmorph-switch__bg-content{position:absolute;top:0;left:0;display:flex;justify-content:flex-end;align-items:center;width:100%;height:100%;padding:8px}.nmorph-switch .nmorph-switch__bg-content.nmorph-switch__bg-content--enable{justify-content:flex-start;color:var(--nmorph-focus-text-color)}.nmorph-switch input{width:100%;height:var(--height);opacity:0}.nmorph-switch .nmorph-switch-thumb{position:absolute;top:var(--offset);left:var(--offset);display:flex;justify-content:center;align-items:center;width:var(--thumb-height);height:var(--thumb-height);background:var(--nmorph-main-color);border-radius:var(--border-radius-999);box-shadow:var(--base-shadow-width) var(--base-shadow-width) var(--base-shadow-blur) var(--nmorph-dark-shade-color),calc(-1 * var(--base-shadow-width)) calc(-1 * var(--base-shadow-width)) var(--base-shadow-blur) var(--nmorph-light-shade-color);transition:left ease-in-out var(--transition-02)}.nmorph-switch.nmorph-switch--disabled{cursor:not-allowed;opacity:.6}.nmorph-switch.nmorph-switch--disabled .nmorph-switch__input-content{pointer-events:none}.nmorph-switch.nmorph-switch--on .nmorph-switch__content{background:var(--nmorph-accent-color);box-shadow:none}.nmorph-switch.nmorph-switch--on .nmorph-switch-thumb{left:calc(100% - var(--thumb-height) - var(--offset));box-shadow:none}.nmorph-switch.nmorph-switch--loading{cursor:not-allowed;opacity:.6}.nmorph-switch.nmorph-switch--loading .nmorph-switch__input-content{pointer-events:none}.nmorph-switch.nmorph-switch--focus{outline:2px solid var(--nmorph-accent-color)}.nmorph-switch.nmorph-switch--focus .nmorph-switch__content{scale:.95}
|