mediacube-ui-v2 0.0.328 → 0.0.330

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
1
  {
2
2
  "catalogSchemaVersion": 2,
3
- "libraryVersion": "0.0.328",
3
+ "libraryVersion": "0.0.330",
4
4
  "packageName": "mediacube-ui-v2",
5
5
  "pathHash": "9b6f3b8016b22ac7",
6
6
  "componentCount": 76,
@@ -1,6 +1,6 @@
1
- import { defineComponent as y, inject as S, useAttrs as g, ref as u, computed as t, onMounted as A, withDirectives as x, openBlock as T, createElementBlock as P, renderSlot as k, createCommentVNode as B, vShow as D } from "vue";
2
- import { useTheme as w } from "../../../composables/useTheme2.js";
3
- const M = ["id", "aria-hidden", "href", "to"], j = /* @__PURE__ */ y({
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 i = S("selfRegisterTabMethod", () => {
105
- }), r = g(), e = n, l = w("tab"), o = u(!1), s = u(!0), p = t(() => e.appendCountColor || l.component.count), d = t(() => e.id ? e.id : e.name.toLowerCase().replace(/ /g, "-")), c = t(() => e.isDisabled ? "#" : `#${d.value}`), f = t(() => !!e.appendCount || e.appendCount === 0), C = t(() => `--mc-tab-append-count-color: ${l.colors[p.value]}`), m = t(() => [e.prefix, e.name, e.suffix].filter(Boolean).join("")), h = t(() => e.visible ? m.value : "");
106
- A(() => {
107
- if (i) {
108
- const a = {
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: s.value,
111
- computedId: d.value,
112
- hash: c.value,
113
- hasAppendCount: f.value,
114
- appendCountStyles: C.value,
115
- header: h.value,
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: p.value,
127
+ appendCountColor: s.value,
127
128
  appendCount: e.appendCount,
128
129
  suffix: e.suffix,
129
130
  prefix: e.prefix,
130
- showTab: v,
131
- hideTab: b,
132
- onClick: r.onClick,
133
- ...r
131
+ showTab: y,
132
+ hideTab: g,
133
+ onClick: l.onClick,
134
+ ...l
134
135
  };
135
- i(a);
136
+ r(i);
136
137
  }
138
+ }), x(() => {
139
+ c(a.value);
137
140
  });
138
- const v = () => {
141
+ const y = () => {
139
142
  o.value = !0;
140
- }, b = () => {
143
+ }, g = () => {
141
144
  o.value = !1;
142
145
  };
143
- return (a, N) => x((T(), P("section", {
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(a.$slots, "default", { key: 0 }) : B("", !0)
152
- ], 8, M)), [
153
- [D, o.value]
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
- j as default
161
+ I as default
159
162
  };
@@ -1,9 +1,9 @@
1
- import { defineComponent as P, defineAsyncComponent as d, inject as j, ref as F, computed as c, onMounted as K, onUpdated as O, watch as R, nextTick as $, provide as L, openBlock as a, createElementBlock as u, normalizeStyle as U, normalizeClass as _, 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";
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 oe } from "../../../enums/Chip2.js";
5
- import { useDebounceFn as te } 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" }, ue = /* @__PURE__ */ P({
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: g }) {
65
- const T = d(() => import("../../elements/McChip/McChip.vue.js")), h = d(() => import("../../elements/McSvgIcon/McSvgIcon.vue.js")), V = d(() => import("../McWrapScroll/McWrapScroll.vue.js")), v = g, C = j("dsOptions", {}), n = k, r = ee("tabs"), s = F([]), S = c(() => n.color || r.component.color), A = c(() => n.accentColor || r.component.accentColor), D = c(() => ({
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
- })), w = c(() => ({
71
- "--mc-tabs-color": r.colors[S.value],
72
- "--mc-tabs-accent-color": r.colors[A.value]
73
- })), z = c({
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)), M = (e) => {
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
- }, y = () => {
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 && p(e);
91
- }, I = (e, t) => {
92
+ t && !t.isDisabled && (e = t), e && d(e);
93
+ }, E = (e, t) => {
92
94
  v("tab-changed", { tab: e, event: t });
93
- }, x = te(() => {
95
+ }, N = oe(() => {
94
96
  if (n.loading || !s.value?.find((o) => o.isActive)?.isDisabled) return;
95
97
  const [t] = b.value;
96
- p(t);
97
- }, 100), p = (e, t) => {
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
- I(e, t), M(e.computedId), z.value = e.computedId;
110
+ E(e, t), z(e.computedId), w.value = e.computedId;
109
111
  }
110
112
  };
111
- return K(y), O(x), R(
113
+ return K(_), O(N), R(
112
114
  () => n.loading,
113
115
  (e, t) => {
114
116
  !e && t && $(() => {
115
- y();
117
+ _();
116
118
  });
117
119
  }
118
- ), L("selfRegisterTabMethod", B), (e, t) => (a(), u("div", {
119
- class: _(D.value),
120
- style: U(w.value)
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(V), {
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), u(G, null, H(s.value, (o, E) => J((a(), u("li", {
131
- key: E,
132
- class: _([{ "is-active": o.isActive, "is-disabled": o.isDisabled, "is-hidden": !o.visible }, "tabs-component-tab"]),
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: (N) => p(o, N)
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(T), {
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(oe).S,
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
- ue as default
182
+ pe as default
181
183
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as oe, defineAsyncComponent as ae, useSlots as ne, ref as u, reactive as se, computed as S, watch as H, openBlock as i, createElementBlock as d, withModifiers as k, createCommentVNode as m, createElementVNode as h, normalizeStyle as re, normalizeClass as M, renderSlot as w, createVNode as T, unref as $ } from "vue";
1
+ import { defineComponent as oe, defineAsyncComponent as ae, useSlots as ne, ref as u, reactive as se, computed as k, watch as H, openBlock as i, createElementBlock as d, withModifiers as w, createCommentVNode as m, createElementVNode as h, normalizeStyle as re, normalizeClass as M, renderSlot as B, createVNode as T, unref as $ } from "vue";
2
2
  import { LineHeights as p } from "../../../types/styles/LineHeights.js";
3
3
  import { Sizes as f } from "../../../types/styles/Sizes.js";
4
4
  import { Spaces as _ } from "../../../types/styles/Spaces.js";
@@ -120,10 +120,10 @@ const ce = {
120
120
  },
121
121
  emits: ["before-open", "before-close", "opened", "closed", "back", "update:modelValue"],
122
122
  setup(g, { emit: E }) {
123
- const B = ae(() => import("../../elements/McSvgIcon/McSvgIcon.vue.js")), F = ne(), r = E, l = g, b = u(0), O = ie(b, {
123
+ const V = ae(() => import("../../elements/McSvgIcon/McSvgIcon.vue.js")), F = ne(), r = E, l = g, b = u(0), O = ie(b, {
124
124
  duration: l.duration || 300,
125
125
  transition: de.easeOutQuart
126
- }), s = u(null), V = u(null), c = u(null), e = se({
126
+ }), s = u(null), C = u(null), c = u(null), e = se({
127
127
  scrolled_top: !1,
128
128
  scrolled_bottom: !1,
129
129
  small_indents: !1,
@@ -148,8 +148,8 @@ const ce = {
148
148
  }
149
149
  }
150
150
  });
151
- S(() => !!F.title);
152
- const P = S(() => ({
151
+ k(() => !!F.title);
152
+ const P = k(() => ({
153
153
  "mc-modal--arrow-visible": l.arrowVisible,
154
154
  "mc-modal--scrolled-top": e.scrolled_top,
155
155
  "mc-modal--scrolled-bottom": e.scrolled_bottom,
@@ -158,7 +158,7 @@ const ce = {
158
158
  "mc-modal--small-indents": e.small_indents,
159
159
  [`mc-modal--variation-${l.variation}`]: !!l.variation,
160
160
  [`mc-modal--header-align-${l.headerAlign}`]: (l.closeVisible || l.arrowVisible) && !!l.headerAlign
161
- })), A = S(() => ({
161
+ })), A = k(() => ({
162
162
  "--mc-modal-padding": _[e.indent.regular],
163
163
  "--mc-modal-padding-small": _[e.indent.small],
164
164
  "--mc-modal-header-line-height": p[e.header.title.line_height.regular],
@@ -170,7 +170,7 @@ const ce = {
170
170
  "--mc-modal-state-number": O.value
171
171
  })), N = () => {
172
172
  e.scrolled_top = !1, e.scrolled_bottom = !1, e.small_indents = !1, e.can_shorten_modal = !1;
173
- }, D = () => V.value?.parentElement ?? null, I = (t, o) => {
173
+ }, D = () => C.value?.parentElement ?? null, I = (t, o) => {
174
174
  const n = getComputedStyle(t).getPropertyValue(o).trim();
175
175
  if (!n) return 0;
176
176
  const a = parseFloat(n);
@@ -188,10 +188,10 @@ const ce = {
188
188
  me(s, "scroll", () => {
189
189
  l.separators && W();
190
190
  }, { passive: !0 });
191
- const C = () => {
191
+ const z = () => {
192
192
  c.value?.disconnect(), c.value = null;
193
193
  }, x = () => {
194
- !s.value || !l.separators || (C(), c.value = new ResizeObserver(G), c.value.observe(s.value));
194
+ !s.value || !l.separators || (z(), c.value = new ResizeObserver(G), c.value.observe(s.value));
195
195
  }, R = () => {
196
196
  requestAnimationFrame(() => {
197
197
  requestAnimationFrame(() => {
@@ -226,10 +226,10 @@ const ce = {
226
226
  (!e.small_indents || t === 0) && (e.can_shorten_modal = o - n > a);
227
227
  }, G = () => {
228
228
  y(), v();
229
- }, z = () => {
229
+ }, S = () => {
230
230
  r("before-close"), r("closed"), r("update:modelValue", !1);
231
231
  }, J = () => {
232
- l.clickBackdropToClose && z();
232
+ l.clickBackdropToClose && S();
233
233
  };
234
234
  return H(
235
235
  () => l.modelValue,
@@ -239,7 +239,7 @@ const ce = {
239
239
  b.value = 1, r("before-open");
240
240
  return;
241
241
  }
242
- C(), N(), b.value = 0;
242
+ z(), N(), b.value = 0, S();
243
243
  }
244
244
  },
245
245
  { immediate: !0 }
@@ -253,7 +253,7 @@ const ce = {
253
253
  l.showOverlay ? (i(), d("div", {
254
254
  key: 0,
255
255
  class: "mc-modal__overlay",
256
- onClick: k(J, ["stop"])
256
+ onClick: w(J, ["stop"])
257
257
  })) : m("", !0),
258
258
  h("div", {
259
259
  class: M(["mc-modal", P.value]),
@@ -261,12 +261,12 @@ const ce = {
261
261
  }, [
262
262
  h("div", {
263
263
  ref_key: "modalInner",
264
- ref: V,
264
+ ref: C,
265
265
  class: M(["mc-modal__inner", { "mc-modal__inner--with-title": t.$slots.title }])
266
266
  }, [
267
267
  t.$slots.title ? (i(), d("div", ue, [
268
268
  h("div", he, [
269
- w(t.$slots, "title")
269
+ B(t.$slots, "title")
270
270
  ])
271
271
  ])) : m("", !0),
272
272
  h("div", {
@@ -274,18 +274,18 @@ const ce = {
274
274
  ref: s,
275
275
  class: "mc-modal__body"
276
276
  }, [
277
- w(t.$slots, "default")
277
+ B(t.$slots, "default")
278
278
  ], 512),
279
279
  t.$slots.footer ? (i(), d("div", pe, [
280
- w(t.$slots, "footer")
280
+ B(t.$slots, "footer")
281
281
  ])) : m("", !0),
282
282
  g.arrowVisible ? (i(), d("button", {
283
283
  key: 2,
284
284
  type: "button",
285
285
  class: "mc-modal__btn-back",
286
- onClick: k(Q, ["prevent"])
286
+ onClick: w(Q, ["prevent"])
287
287
  }, [
288
- T($(B), {
288
+ T($(V), {
289
289
  name: "arrow_leftward",
290
290
  class: "mc-modal__icon-back"
291
291
  })
@@ -294,9 +294,9 @@ const ce = {
294
294
  key: 3,
295
295
  type: "button",
296
296
  class: "mc-modal__btn-close",
297
- onClick: k(z, ["prevent"])
297
+ onClick: w(S, ["prevent"])
298
298
  }, [
299
- T($(B), {
299
+ T($(V), {
300
300
  class: "mc-modal__icon-close",
301
301
  width: "24",
302
302
  height: "24",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediacube-ui-v2",
3
- "version": "0.0.328",
3
+ "version": "0.0.330",
4
4
  "license": "MIT",
5
5
  "description": "Design system for Mediacube services",
6
6
  "sideEffects": [