mediacube-ui-v2 0.0.328 → 0.0.329
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,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTheme as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as S, inject as u, useAttrs as A, ref as d, computed as t, onMounted as T, onBeforeUnmount as x, withDirectives as B, openBlock as M, createElementBlock as P, renderSlot as k, createCommentVNode as D, vShow as w } from "vue";
|
|
2
|
+
import { useTheme as N } from "../../../composables/useTheme2.js";
|
|
3
|
+
const U = ["id", "aria-hidden", "href", "to"], I = /* @__PURE__ */ S({
|
|
4
4
|
__name: "McTab",
|
|
5
5
|
props: {
|
|
6
6
|
/**
|
|
@@ -101,18 +101,19 @@ const M = ["id", "aria-hidden", "href", "to"], j = /* @__PURE__ */ y({
|
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
103
|
setup(n) {
|
|
104
|
-
const
|
|
105
|
-
}),
|
|
106
|
-
A(() => {
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
const r = u("selfRegisterTabMethod", () => {
|
|
105
|
+
}), c = u("selfUnregisterTabMethod", () => {
|
|
106
|
+
}), l = A(), e = n, p = N("tab"), o = d(!1), f = d(!0), s = t(() => e.appendCountColor || p.component.count), a = t(() => e.id ? e.id : e.name.toLowerCase().replace(/ /g, "-")), m = t(() => e.isDisabled ? "#" : `#${a.value}`), C = t(() => !!e.appendCount || e.appendCount === 0), b = t(() => `--mc-tab-append-count-color: ${p.colors[s.value]}`), h = t(() => [e.prefix, e.name, e.suffix].filter(Boolean).join("")), v = t(() => e.visible ? h.value : "");
|
|
107
|
+
T(() => {
|
|
108
|
+
if (r) {
|
|
109
|
+
const i = {
|
|
109
110
|
isActive: o.value,
|
|
110
|
-
isVisible:
|
|
111
|
-
computedId:
|
|
112
|
-
hash:
|
|
113
|
-
hasAppendCount:
|
|
114
|
-
appendCountStyles:
|
|
115
|
-
header:
|
|
111
|
+
isVisible: f.value,
|
|
112
|
+
computedId: a.value,
|
|
113
|
+
hash: m.value,
|
|
114
|
+
hasAppendCount: C.value,
|
|
115
|
+
appendCountStyles: b.value,
|
|
116
|
+
header: v.value,
|
|
116
117
|
id: e.id,
|
|
117
118
|
name: e.name,
|
|
118
119
|
to: e.to,
|
|
@@ -123,24 +124,26 @@ const M = ["id", "aria-hidden", "href", "to"], j = /* @__PURE__ */ y({
|
|
|
123
124
|
iconPrepend: e.iconPrepend,
|
|
124
125
|
visible: e.visible,
|
|
125
126
|
isDisabled: e.isDisabled,
|
|
126
|
-
appendCountColor:
|
|
127
|
+
appendCountColor: s.value,
|
|
127
128
|
appendCount: e.appendCount,
|
|
128
129
|
suffix: e.suffix,
|
|
129
130
|
prefix: e.prefix,
|
|
130
|
-
showTab:
|
|
131
|
-
hideTab:
|
|
132
|
-
onClick:
|
|
133
|
-
...
|
|
131
|
+
showTab: y,
|
|
132
|
+
hideTab: g,
|
|
133
|
+
onClick: l.onClick,
|
|
134
|
+
...l
|
|
134
135
|
};
|
|
135
|
-
i
|
|
136
|
+
r(i);
|
|
136
137
|
}
|
|
138
|
+
}), x(() => {
|
|
139
|
+
c(a.value);
|
|
137
140
|
});
|
|
138
|
-
const
|
|
141
|
+
const y = () => {
|
|
139
142
|
o.value = !0;
|
|
140
|
-
},
|
|
143
|
+
}, g = () => {
|
|
141
144
|
o.value = !1;
|
|
142
145
|
};
|
|
143
|
-
return (
|
|
146
|
+
return (i, V) => B((M(), P("section", {
|
|
144
147
|
id: n.id,
|
|
145
148
|
"aria-hidden": !o.value,
|
|
146
149
|
class: "tabs-component-panel",
|
|
@@ -148,12 +151,12 @@ const M = ["id", "aria-hidden", "href", "to"], j = /* @__PURE__ */ y({
|
|
|
148
151
|
href: n.href,
|
|
149
152
|
to: n.to
|
|
150
153
|
}, [
|
|
151
|
-
n.visible ? k(
|
|
152
|
-
], 8,
|
|
153
|
-
[
|
|
154
|
+
n.visible ? k(i.$slots, "default", { key: 0 }) : D("", !0)
|
|
155
|
+
], 8, U)), [
|
|
156
|
+
[w, o.value]
|
|
154
157
|
]);
|
|
155
158
|
}
|
|
156
159
|
});
|
|
157
160
|
export {
|
|
158
|
-
|
|
161
|
+
I as default
|
|
159
162
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as U, defineAsyncComponent as u, inject as j, ref as F, computed as c, onMounted as K, onUpdated as O, watch as R, nextTick as $, provide as y, openBlock as a, createElementBlock as p, normalizeStyle as L, normalizeClass as g, createElementVNode as i, createVNode as W, unref as l, withCtx as q, Fragment as G, renderList as H, withDirectives as J, createBlock as m, createCommentVNode as f, toDisplayString as Q, vShow as X, renderSlot as Y } from "vue";
|
|
2
2
|
import { TabVariations as Z } from "../../../enums/Tab2.js";
|
|
3
3
|
import { useTheme as ee } from "../../../composables/useTheme2.js";
|
|
4
|
-
import { ChipSize as
|
|
5
|
-
import { useDebounceFn as
|
|
6
|
-
const ne = { class: "tabs-component" }, se = ["aria-controls", "aria-selected", "href", "onClick"], ce = { class: "tabs-component-tab__tab-name" }, ae = { class: "tabs-component-panels" },
|
|
4
|
+
import { ChipSize as te } from "../../../enums/Chip2.js";
|
|
5
|
+
import { useDebounceFn as oe } from "@vueuse/core";
|
|
6
|
+
const ne = { class: "tabs-component" }, se = ["aria-controls", "aria-selected", "href", "onClick"], ce = { class: "tabs-component-tab__tab-name" }, ae = { class: "tabs-component-panels" }, pe = /* @__PURE__ */ U({
|
|
7
7
|
__name: "McTabs",
|
|
8
8
|
props: {
|
|
9
9
|
modelValue: {
|
|
@@ -61,16 +61,16 @@ const ne = { class: "tabs-component" }, se = ["aria-controls", "aria-selected",
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
emits: ["update:modelValue", "tab-changed", "clicked"],
|
|
64
|
-
setup(k, { emit:
|
|
65
|
-
const
|
|
64
|
+
setup(k, { emit: T }) {
|
|
65
|
+
const V = u(() => import("../../elements/McChip/McChip.vue.js")), h = u(() => import("../../elements/McSvgIcon/McSvgIcon.vue.js")), S = u(() => import("../McWrapScroll/McWrapScroll.vue.js")), v = T, C = j("dsOptions", {}), n = k, r = ee("tabs"), s = F([]), A = c(() => n.color || r.component.color), D = c(() => n.accentColor || r.component.accentColor), I = c(() => ({
|
|
66
66
|
"mc-tabs": !0,
|
|
67
67
|
[`mc-tabs--tab-variation-${n.tabVariation}`]: !!n.tabVariation,
|
|
68
68
|
"mc-tabs--uppercase": !!n.uppercase,
|
|
69
69
|
"mc-tabs--sticky": !!n.sticky
|
|
70
|
-
})),
|
|
71
|
-
"--mc-tabs-color": r.colors[
|
|
72
|
-
"--mc-tabs-accent-color": r.colors[
|
|
73
|
-
})),
|
|
70
|
+
})), M = c(() => ({
|
|
71
|
+
"--mc-tabs-color": r.colors[A.value],
|
|
72
|
+
"--mc-tabs-accent-color": r.colors[D.value]
|
|
73
|
+
})), w = c({
|
|
74
74
|
// @ts-ignore
|
|
75
75
|
get() {
|
|
76
76
|
return n.modelValue;
|
|
@@ -78,23 +78,25 @@ const ne = { class: "tabs-component" }, se = ["aria-controls", "aria-selected",
|
|
|
78
78
|
set(e) {
|
|
79
79
|
v("update:modelValue", e);
|
|
80
80
|
}
|
|
81
|
-
}), b = c(() => s.value.filter((e) => e.visible && !e.isDisabled)),
|
|
81
|
+
}), b = c(() => s.value.filter((e) => e.visible && !e.isDisabled)), z = (e) => {
|
|
82
82
|
s.value.forEach((t) => {
|
|
83
83
|
t.isActive = t.computedId === e, t.isActive ? t.showTab() : t.hideTab();
|
|
84
84
|
});
|
|
85
85
|
}, B = (e) => {
|
|
86
|
-
s.value.push(e);
|
|
87
|
-
},
|
|
86
|
+
s.value.some((t) => t.computedId === e.computedId) || s.value.push(e);
|
|
87
|
+
}, x = (e) => {
|
|
88
|
+
s.value = s.value.filter((t) => t.computedId !== e);
|
|
89
|
+
}, _ = () => {
|
|
88
90
|
let [e] = b.value;
|
|
89
91
|
const t = s.value.find((o) => o.computedId === n.modelValue);
|
|
90
|
-
t && !t.isDisabled && (e = t), e &&
|
|
91
|
-
},
|
|
92
|
+
t && !t.isDisabled && (e = t), e && d(e);
|
|
93
|
+
}, E = (e, t) => {
|
|
92
94
|
v("tab-changed", { tab: e, event: t });
|
|
93
|
-
},
|
|
95
|
+
}, N = oe(() => {
|
|
94
96
|
if (n.loading || !s.value?.find((o) => o.isActive)?.isDisabled) return;
|
|
95
97
|
const [t] = b.value;
|
|
96
|
-
|
|
97
|
-
}, 100),
|
|
98
|
+
d(t);
|
|
99
|
+
}, 100), d = (e, t) => {
|
|
98
100
|
if (!((e.to || e.href) && (t?.metaKey || t?.ctrlKey)) && (t?.preventDefault(), !e.isDisabled)) {
|
|
99
101
|
if (e.onClick && typeof e.onClick == "function") return e.onClick(e, t);
|
|
100
102
|
if (e.href) {
|
|
@@ -105,31 +107,31 @@ const ne = { class: "tabs-component" }, se = ["aria-controls", "aria-selected",
|
|
|
105
107
|
C.meta.router_push(e.to);
|
|
106
108
|
return;
|
|
107
109
|
}
|
|
108
|
-
|
|
110
|
+
E(e, t), z(e.computedId), w.value = e.computedId;
|
|
109
111
|
}
|
|
110
112
|
};
|
|
111
|
-
return K(
|
|
113
|
+
return K(_), O(N), R(
|
|
112
114
|
() => n.loading,
|
|
113
115
|
(e, t) => {
|
|
114
116
|
!e && t && $(() => {
|
|
115
|
-
|
|
117
|
+
_();
|
|
116
118
|
});
|
|
117
119
|
}
|
|
118
|
-
),
|
|
119
|
-
class:
|
|
120
|
-
style:
|
|
120
|
+
), y("selfRegisterTabMethod", B), y("selfUnregisterTabMethod", x), (e, t) => (a(), p("div", {
|
|
121
|
+
class: g(I.value),
|
|
122
|
+
style: L(M.value)
|
|
121
123
|
}, [
|
|
122
124
|
i("div", ne, [
|
|
123
|
-
W(l(
|
|
125
|
+
W(l(S), {
|
|
124
126
|
"tag-name": "ul",
|
|
125
127
|
role: "tablist",
|
|
126
128
|
scrollable: "",
|
|
127
129
|
class: "tabs-component-tabs"
|
|
128
130
|
}, {
|
|
129
131
|
default: q(() => [
|
|
130
|
-
(a(!0),
|
|
131
|
-
key:
|
|
132
|
-
class:
|
|
132
|
+
(a(!0), p(G, null, H(s.value, (o) => J((a(), p("li", {
|
|
133
|
+
key: o.computedId,
|
|
134
|
+
class: g([{ "is-active": o.isActive, "is-disabled": o.isDisabled, "is-hidden": !o.visible }, "tabs-component-tab"]),
|
|
133
135
|
role: "presentation"
|
|
134
136
|
}, [
|
|
135
137
|
i("a", {
|
|
@@ -138,7 +140,7 @@ const ne = { class: "tabs-component" }, se = ["aria-controls", "aria-selected",
|
|
|
138
140
|
href: o.href || o.to || o.hash || "javascript:void(0)",
|
|
139
141
|
class: "tabs-component-tab-a",
|
|
140
142
|
role: "tab",
|
|
141
|
-
onClick: (
|
|
143
|
+
onClick: (P) => d(o, P)
|
|
142
144
|
}, [
|
|
143
145
|
i("span", ce, [
|
|
144
146
|
o.iconPrepend ? (a(), m(l(h), {
|
|
@@ -154,11 +156,11 @@ const ne = { class: "tabs-component" }, se = ["aria-controls", "aria-selected",
|
|
|
154
156
|
color: o.iconAppendColor,
|
|
155
157
|
size: "200"
|
|
156
158
|
}, null, 8, ["name", "color"])) : f("", !0),
|
|
157
|
-
o.hasAppendCount ? (a(), m(l(
|
|
159
|
+
o.hasAppendCount ? (a(), m(l(V), {
|
|
158
160
|
key: 2,
|
|
159
161
|
title: o.appendCount,
|
|
160
162
|
"text-color": o.appendCountColor,
|
|
161
|
-
size: l(
|
|
163
|
+
size: l(te).S,
|
|
162
164
|
class: "tabs-component-tab__tab-name_append-count"
|
|
163
165
|
}, null, 8, ["title", "text-color", "size"])) : f("", !0)
|
|
164
166
|
])
|
|
@@ -177,5 +179,5 @@ const ne = { class: "tabs-component" }, se = ["aria-controls", "aria-selected",
|
|
|
177
179
|
}
|
|
178
180
|
});
|
|
179
181
|
export {
|
|
180
|
-
|
|
182
|
+
pe as default
|
|
181
183
|
};
|