mediacube-ui-v2 0.0.327 → 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
1
  {
2
2
  "catalogSchemaVersion": 2,
3
- "libraryVersion": "0.0.327",
3
+ "libraryVersion": "0.0.329",
4
4
  "packageName": "mediacube-ui-v2",
5
5
  "pathHash": "9b6f3b8016b22ac7",
6
6
  "componentCount": 76,
@@ -1 +1 @@
1
- @charset "UTF-8";.mc-modal{position:relative;--mc-modal-padding: 2rem;--mc-modal-padding-small: .75rem;--mc-modal-header-line-height: 1.5rem;--mc-modal-header-line-height-small: 1.25rem;--mc-modal-button-height: 3rem;--mc-modal-button-height-small: 2.5rem;--mc-modal-max-width: 510px;--mc-modal-min-width: 768px;--mc-modal-state-number: 0;width:100%;height:100%;display:flex;flex-direction:column;overflow:hidden;opacity:var(--mc-modal-state-number)}@media (min-width: 480px){.mc-modal{--modal-scale: calc(var(--mc-modal-state-number) * .1 + .9);padding:12px 0;height:auto;max-height:80%;max-width:var(--mc-modal-max-width);min-width:var(--mc-modal-min-width)}}.mc-modal__overlay{position:absolute;inset:0;background-color:#20242780;display:flex;justify-content:flex-start}.mc-modal__overlay--hidden{background:transparent}.mc-modal__wrapper{position:absolute;inset:0;z-index:1;overflow:hidden;display:flex;justify-content:center;align-items:center}.mc-modal__btn-close,.mc-modal__btn-back{transition:.15s all;box-sizing:border-box;display:block;margin:0;padding:0;white-space:nowrap;vertical-align:middle;user-select:none;text-align:center;text-decoration:none;text-transform:none;border-radius:0;border:none;background-color:transparent;background-image:none;cursor:pointer;outline:0;font-size:0;line-height:0;font-family:inherit;-webkit-appearance:none;-webkit-text-fill-color:currentColor}.mc-modal__btn-close:focus,.mc-modal__btn-back:focus{outline:0}.mc-modal__btn-close,.mc-modal__btn-back{color:#8f99a3}.mc-modal__btn-close:hover,.mc-modal__btn-close:focus,.mc-modal__btn-back:hover,.mc-modal__btn-back:focus{color:#202427}.mc-modal__btn-close:active,.mc-modal__btn-back:active{color:#202427!important}.mc-modal__btn-close{position:absolute;top:1.5rem;inset-inline-end:1.5rem;padding:0!important}@media (min-width: 480px){.mc-modal__btn-close{position:absolute;top:1.5rem;inset-inline-end:1.5rem}}.mc-modal__btn-back{position:absolute;top:1.5rem;inset-inline-start:1.5rem}@media (min-width: 480px){.mc-modal__btn-back{position:absolute;top:1.5rem;inset-inline-start:1.5rem}}.mc-modal__icon-close{height:1.5rem;width:1.5rem;transition:color .15s}.mc-modal.overlay-fade-enter-active .mc-modal__inner,.mc-modal.overlay-fade-leave-active .mc-modal__inner{transition:all .15s;transform:translateZ(0)}.mc-modal.overlay-fade-enter .mc-modal__inner,.mc-modal.overlay-fade-leave-active .mc-modal__inner{transform:translate3d(0,-20px,0)}.mc-modal.mc-modal--secondary .mc-modal__inner{border-radius:2rem;box-shadow:0 15px 30px #20008c28;padding:2rem}.mc-modal.mc-modal--secondary .mc-modal__btn-close,.mc-modal.mc-modal--secondary .mc-modal__btn-back{top:27px}.mc-modal.mc-modal--secondary .mc-modal__btn-close{inset-inline-end:2rem}.mc-modal.mc-modal--secondary .mc-modal__btn-back{inset-inline-start:2rem}.mc-modal.mc-modal--secondary .mc-modal__header{padding-bottom:9px;border-bottom:2px solid #EDF0F3;margin-bottom:var(--mc-modal-padding)}.mc-modal.mc-modal--secondary .mc-modal__control{display:flex;justify-content:space-between;align-items:center}.mc-modal.mc-modal--secondary .mc-modal__control .mc-button{border-radius:.75rem}.mc-modal__header{flex-shrink:0;transition:.15s all;padding:var(--mc-modal-padding) 1rem 1.75rem;border-color:#edf0f3}@media (min-width: 480px){.mc-modal__header{padding:1.75rem}.mc-modal__header .mc-title{transition:.15s all;line-height:var(--mc-modal-header-line-height)}}.mc-modal__header:has(.mc-modal__title:empty){display:none}.mc-modal__header:has(.mc-modal__title:empty)+.mc-modal__body{padding-top:2rem}.mc-modal__title{margin-top:0;margin-bottom:0;color:#212121;font-family:Inter,sans-serif;overflow-x:hidden;text-overflow:ellipsis}.mc-modal__body{padding:.25rem 1rem 1rem;flex-grow:1;min-height:0;overflow-x:hidden}.mc-modal__body>*:only-child{min-height:100%}@media (min-width: 480px){.mc-modal__body{padding:.25rem 2rem 1rem;overflow:visible}}.mc-modal__inner{position:relative;box-shadow:0 4px 12px #00000029;background-color:#fff;display:flex;flex-direction:column;overflow:hidden;height:100%!important}.mc-modal__inner>*:first-child{padding-top:var(--mc-modal-padding)}.mc-modal__inner>*:last-child{padding-bottom:var(--mc-modal-padding)}@media (min-width: 480px){.mc-modal__inner--with-title .mc-modal__btn-close{position:absolute;top:var(--mc-modal-padding);inset-inline-end:2rem}}@media (min-width: 480px){.mc-modal__inner--with-title .mc-modal__btn-back{position:absolute;top:var(--mc-modal-padding);inset-inline-start:2rem}}@media (min-width: 480px){.mc-modal__inner{overflow:visible;-ms-overflow-style:none;scrollbar-width:none;border-radius:.5rem;margin:0 .75rem}.mc-modal__inner::-webkit-scrollbar{display:none}}.mc-modal--scrollable{overflow:hidden!important}.mc-modal--scrollable .mc-modal__body{overflow-y:auto;overflow-x:hidden}.mc-modal--scrollable .mc-modal__inner{overflow-x:hidden}@media (min-width: 480px){.mc-modal--scrollable .mc-modal__inner{max-height:80vh}}.mc-modal--header-align-center .mc-modal__header{padding-inline:2.5rem;text-align:center}@media (min-width: 480px){.mc-modal--header-align-center .mc-modal__header{padding-inline:3.5rem}}.mc-modal--header-align-left .mc-modal__header{padding-bottom:.75rem}@media (min-width: 480px){.mc-modal--small-indents .mc-modal__control{padding-block:var(--mc-modal-padding-small)!important}.mc-modal--small-indents .mc-modal__control .mc-button{height:var(--mc-modal-button-height-small)}.mc-modal--small-indents .mc-modal__header{padding-block:var(--mc-modal-padding-small)!important}.mc-modal--small-indents .mc-modal__header .mc-title{font-weight:600;font-size:1rem;line-height:var(--mc-modal-header-line-height-small);align-items:center}.mc-modal--small-indents .mc-modal__body{padding-bottom:.25rem}}.mc-modal--small-indents .mc-modal__inner--with-title .mc-modal__btn-back,.mc-modal--small-indents .mc-modal__inner--with-title .mc-modal__btn-close{top:var(--mc-modal-padding-small)!important}.mc-modal--scrolled-top .mc-modal__header{border-bottom:1px solid #EDF0F3}.mc-modal--scrolled-bottom .mc-modal__control:not(:empty){border-top:1px solid #EDF0F3}.mc-modal--top-padding .mc-modal__inner:before{content:"";height:2rem;min-height:2rem}.mc-modal__control{flex-shrink:0;display:flex;justify-content:center;padding:1rem 1rem 2rem;transition:.15s all}@media (min-width: 480px){.mc-modal__control{padding:1rem 1.5rem 2rem}}.mc-modal__control .mc-button{width:100%}@media (min-width: 480px){.mc-modal__control .mc-button{min-width:100px;height:var(--mc-modal-button-height);transition:.15s all;width:unset}}.mc-modal__control:empty{position:relative;padding:1.75rem 0 0}.mc-modal__control:not(:empty){border-color:#edf0f3}.mc-modal:has(.mc-modal__control:empty) .mc-modal__body{padding-bottom:.25rem}@media (min-width: 480px){.mc-modal--variation-info .mc-modal__header{padding:1.5rem 1.5rem .75rem}}@media (min-width: 480px){.mc-modal--variation-info .mc-modal__btn-close{top:1.5rem}}@media (min-width: 480px){.mc-modal--variation-info .mc-modal__inner>*:first-child{padding-top:1.5rem}}@media (min-width: 480px){.mc-modal--variation-info .mc-modal__inner>*:last-child{padding-bottom:1.5rem}}.mc-modal--variation-info .mc-modal__body{padding-bottom:.25rem}@media (min-width: 480px){.mc-modal--variation-info .mc-modal__body{padding-inline:1.5rem}}.mc-modal--variation-info .mc-modal__control{padding-top:1.25rem}@media (min-width: 480px){.mc-modal--variation-info .mc-modal__control{padding-top:.75rem}}html[dir=rtl] .mc-modal__btn-back{transform:rotate(180deg)}
1
+ @charset "UTF-8";.mc-modal{position:relative;--mc-modal-padding: 2rem;--mc-modal-padding-small: .75rem;--mc-modal-header-line-height: 1.5rem;--mc-modal-header-line-height-small: 1.25rem;--mc-modal-button-height: 3rem;--mc-modal-button-height-small: 2.5rem;--mc-modal-max-width: 510px;--mc-modal-min-width: 768px;--mc-modal-state-number: 0;width:100%;height:100%;display:flex;flex-direction:column;overflow:hidden;opacity:var(--mc-modal-state-number)}@media (min-width: 480px){.mc-modal{--modal-scale: calc(var(--mc-modal-state-number) * .1 + .9);padding:12px 0;height:auto;max-height:80%;max-width:var(--mc-modal-max-width);min-width:var(--mc-modal-min-width)}}.mc-modal__overlay{position:absolute;inset:0;background-color:#20242780;display:flex;justify-content:flex-start}.mc-modal__overlay--hidden{background:transparent}.mc-modal__wrapper{position:absolute;inset:0;z-index:1;overflow:hidden;display:flex;justify-content:center;align-items:center}.mc-modal__btn-close,.mc-modal__btn-back{transition:.15s all;box-sizing:border-box;display:block;margin:0;padding:0;white-space:nowrap;vertical-align:middle;user-select:none;text-align:center;text-decoration:none;text-transform:none;border-radius:0;border:none;background-color:transparent;background-image:none;cursor:pointer;outline:0;font-size:0;line-height:0;font-family:inherit;-webkit-appearance:none;-webkit-text-fill-color:currentColor}.mc-modal__btn-close:focus,.mc-modal__btn-back:focus{outline:0}.mc-modal__btn-close,.mc-modal__btn-back{color:#8f99a3}.mc-modal__btn-close:hover,.mc-modal__btn-close:focus,.mc-modal__btn-back:hover,.mc-modal__btn-back:focus{color:#202427}.mc-modal__btn-close:active,.mc-modal__btn-back:active{color:#202427!important}.mc-modal__btn-close{position:absolute;top:1.5rem;inset-inline-end:1.5rem;padding:0!important}@media (min-width: 480px){.mc-modal__btn-close{position:absolute;top:1.5rem;inset-inline-end:1.5rem}}.mc-modal__btn-back{position:absolute;top:1.5rem;inset-inline-start:1.5rem}@media (min-width: 480px){.mc-modal__btn-back{position:absolute;top:1.5rem;inset-inline-start:1.5rem}}.mc-modal__icon-close{height:1.5rem;width:1.5rem;transition:color .15s}.mc-modal.overlay-fade-enter-active .mc-modal__inner,.mc-modal.overlay-fade-leave-active .mc-modal__inner{transition:all .15s;transform:translateZ(0)}.mc-modal.overlay-fade-enter .mc-modal__inner,.mc-modal.overlay-fade-leave-active .mc-modal__inner{transform:translate3d(0,-20px,0)}.mc-modal.mc-modal--secondary .mc-modal__inner{border-radius:2rem;box-shadow:0 15px 30px #20008c28;padding:2rem}.mc-modal.mc-modal--secondary .mc-modal__btn-close,.mc-modal.mc-modal--secondary .mc-modal__btn-back{top:27px}.mc-modal.mc-modal--secondary .mc-modal__btn-close{inset-inline-end:2rem}.mc-modal.mc-modal--secondary .mc-modal__btn-back{inset-inline-start:2rem}.mc-modal.mc-modal--secondary .mc-modal__header{padding-bottom:9px;border-bottom:2px solid #EDF0F3;margin-bottom:var(--mc-modal-padding)}.mc-modal.mc-modal--secondary .mc-modal__control{display:flex;justify-content:space-between;align-items:center}.mc-modal.mc-modal--secondary .mc-modal__control .mc-button{border-radius:.75rem}.mc-modal__header{flex-shrink:0;transition:.15s all;padding:var(--mc-modal-padding) 1rem 1.75rem;border-color:#edf0f3}@media (min-width: 480px){.mc-modal__header{padding:1.75rem}.mc-modal__header .mc-title{transition:.15s all;line-height:var(--mc-modal-header-line-height)}}.mc-modal__header:has(.mc-modal__title:empty){display:none}.mc-modal__header:has(.mc-modal__title:empty)+.mc-modal__body{padding-top:2rem}.mc-modal__title{margin-top:0;margin-bottom:0;color:#212121;font-family:Inter,sans-serif;overflow-x:hidden;text-overflow:ellipsis}.mc-modal__body{padding:.25rem 1rem 1rem;flex-grow:1;min-height:0;overflow-x:hidden}.mc-modal__body>*:only-child{min-height:100%}@media (min-width: 480px){.mc-modal__body{padding:.25rem 2rem 1rem;overflow:visible}}.mc-modal__inner{position:relative;box-shadow:0 4px 12px #00000029;background-color:#fff;display:flex;flex-direction:column;overflow:hidden;height:100%!important}.mc-modal__inner>*:first-child{padding-top:var(--mc-modal-padding)}.mc-modal__inner>*:last-child{padding-bottom:var(--mc-modal-padding)}@media (min-width: 480px){.mc-modal__inner--with-title .mc-modal__btn-close{position:absolute;top:var(--mc-modal-padding);inset-inline-end:2rem}}@media (min-width: 480px){.mc-modal__inner--with-title .mc-modal__btn-back{position:absolute;top:var(--mc-modal-padding);inset-inline-start:2rem}}@media (min-width: 480px){.mc-modal__inner{overflow:visible;-ms-overflow-style:none;scrollbar-width:none;border-radius:.5rem;margin:0 .75rem}.mc-modal__inner::-webkit-scrollbar{display:none}}.mc-modal--scrollable{overflow:hidden!important}.mc-modal--scrollable .mc-modal__body{overflow-y:auto;overflow-x:hidden;-ms-overflow-style:none;scrollbar-width:none}.mc-modal--scrollable .mc-modal__body::-webkit-scrollbar{display:none}.mc-modal--scrollable .mc-modal__inner{overflow-x:hidden}@media (min-width: 480px){.mc-modal--scrollable .mc-modal__inner{max-height:80vh}}.mc-modal--header-align-center .mc-modal__header{padding-inline:2.5rem;text-align:center}@media (min-width: 480px){.mc-modal--header-align-center .mc-modal__header{padding-inline:3.5rem}}.mc-modal--header-align-left .mc-modal__header{padding-bottom:.75rem}@media (min-width: 480px){.mc-modal--small-indents .mc-modal__control{padding-block:var(--mc-modal-padding-small)!important}.mc-modal--small-indents .mc-modal__control .mc-button{height:var(--mc-modal-button-height-small)}.mc-modal--small-indents .mc-modal__header{padding-block:var(--mc-modal-padding-small)!important}.mc-modal--small-indents .mc-modal__header .mc-title{font-weight:600;font-size:1rem;line-height:var(--mc-modal-header-line-height-small);align-items:center}.mc-modal--small-indents .mc-modal__body{padding-bottom:.25rem}}.mc-modal--small-indents .mc-modal__inner--with-title .mc-modal__btn-back,.mc-modal--small-indents .mc-modal__inner--with-title .mc-modal__btn-close{top:var(--mc-modal-padding-small)!important}.mc-modal--scrolled-top .mc-modal__header{border-bottom:1px solid #EDF0F3}.mc-modal--scrolled-bottom .mc-modal__control:not(:empty){border-top:1px solid #EDF0F3}.mc-modal--top-padding .mc-modal__inner:before{content:"";height:2rem;min-height:2rem}.mc-modal__control{flex-shrink:0;display:flex;justify-content:center;padding:1rem 1rem 2rem;transition:.15s all}@media (min-width: 480px){.mc-modal__control{padding:1rem 1.5rem 2rem}}.mc-modal__control .mc-button{width:100%}@media (min-width: 480px){.mc-modal__control .mc-button{min-width:100px;height:var(--mc-modal-button-height);transition:.15s all;width:unset}}.mc-modal__control:empty{position:relative;padding:1.75rem 0 0}.mc-modal__control:not(:empty){border-color:#edf0f3}.mc-modal:has(.mc-modal__control:empty) .mc-modal__body{padding-bottom:.25rem}@media (min-width: 480px){.mc-modal--variation-info .mc-modal__header{padding:1.5rem 1.5rem .75rem}}@media (min-width: 480px){.mc-modal--variation-info .mc-modal__btn-close{top:1.5rem}}@media (min-width: 480px){.mc-modal--variation-info .mc-modal__inner>*:first-child{padding-top:1.5rem}}@media (min-width: 480px){.mc-modal--variation-info .mc-modal__inner>*:last-child{padding-bottom:1.5rem}}.mc-modal--variation-info .mc-modal__body{padding-bottom:.25rem}@media (min-width: 480px){.mc-modal--variation-info .mc-modal__body{padding-inline:1.5rem}}.mc-modal--variation-info .mc-modal__control{padding-top:1.25rem}@media (min-width: 480px){.mc-modal--variation-info .mc-modal__control{padding-top:.75rem}}html[dir=rtl] .mc-modal__btn-back{transform:rotate(180deg)}
@@ -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,19 +1,19 @@
1
- import { defineComponent as Q, defineAsyncComponent as R, useSlots as q, ref as i, reactive as G, computed as g, watch as J, openBlock as n, createElementBlock as r, withModifiers as y, createCommentVNode as d, createElementVNode as c, normalizeStyle as K, normalizeClass as S, renderSlot as k, createVNode as M, unref as $, nextTick as U } from "vue";
2
- import { LineHeights as T } from "../../../types/styles/LineHeights.js";
3
- import { Sizes as z } from "../../../types/styles/Sizes.js";
4
- import { Spaces as H } from "../../../types/styles/Spaces.js";
5
- import { useTransition as X, TransitionPresets as Y } from "@vueuse/core";
6
- const Z = {
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";
2
+ import { LineHeights as p } from "../../../types/styles/LineHeights.js";
3
+ import { Sizes as f } from "../../../types/styles/Sizes.js";
4
+ import { Spaces as _ } from "../../../types/styles/Spaces.js";
5
+ import { useTransition as ie, TransitionPresets as de, useEventListener as me } from "@vueuse/core";
6
+ const ce = {
7
7
  key: 0,
8
8
  class: "mc-modal__wrapper"
9
- }, ee = {
9
+ }, ue = {
10
10
  key: 0,
11
11
  class: "mc-modal__header"
12
- }, le = { class: "mc-modal__title" }, oe = {
12
+ }, he = { class: "mc-modal__title" }, pe = {
13
13
  key: 1,
14
14
  class: "mc-modal__control",
15
15
  id: "mcModalFooter"
16
- }, de = /* @__PURE__ */ Q({
16
+ }, Se = /* @__PURE__ */ oe({
17
17
  __name: "McModal",
18
18
  props: {
19
19
  modelValue: {
@@ -119,11 +119,11 @@ const Z = {
119
119
  }
120
120
  },
121
121
  emits: ["before-open", "before-close", "opened", "closed", "back", "update:modelValue"],
122
- setup(u, { emit: O }) {
123
- const w = R(() => import("../../elements/McSvgIcon/McSvgIcon.vue.js")), E = q(), s = O, o = u, p = i(0), N = X(p, {
124
- duration: o.duration || 300,
125
- transition: Y.easeOutQuart
126
- }), t = i(null), f = i(null), m = i(null), e = G({
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, {
124
+ duration: l.duration || 300,
125
+ transition: de.easeOutQuart
126
+ }), s = u(null), V = u(null), c = u(null), e = se({
127
127
  scrolled_top: !1,
128
128
  scrolled_bottom: !1,
129
129
  small_indents: !1,
@@ -148,130 +148,166 @@ const Z = {
148
148
  }
149
149
  }
150
150
  });
151
- g(() => !!E.title);
152
- const P = g(() => ({
153
- "mc-modal--arrow-visible": o.arrowVisible,
151
+ S(() => !!F.title);
152
+ const P = S(() => ({
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,
156
- "mc-modal--scrollable": o.scrollableContent,
157
- "mc-modal--top-padding": o.topPadding,
156
+ "mc-modal--scrollable": l.scrollableContent,
157
+ "mc-modal--top-padding": l.topPadding,
158
158
  "mc-modal--small-indents": e.small_indents,
159
- [`mc-modal--variation-${o.variation}`]: !!o.variation,
160
- [`mc-modal--header-align-${o.headerAlign}`]: (o.closeVisible || o.arrowVisible) && !!o.headerAlign
161
- })), B = g(() => ({
162
- "--mc-modal-padding": H[e.indent.regular],
163
- "--mc-modal-padding-small": H[e.indent.small],
164
- "--mc-modal-header-line-height": T[e.header.title.line_height.regular],
165
- "--mc-modal-header-line-height-small": T[e.header.title.line_height.small],
166
- "--mc-modal-button-height": z[e.footer.button.regular],
167
- "--mc-modal-button-height-small": z[e.footer.button.small],
168
- "--mc-modal-max-width": `${o.maxWidth + 24}px`,
169
- "--mc-modal-min-width": `${o.minWidth - 24}px`,
170
- "--mc-modal-state-number": N.value
171
- })), h = (l = !0) => {
172
- l || (e.scrolled_top = !1, e.scrolled_bottom = !1, e.small_indents = !1), setTimeout(
173
- () => {
174
- if (t.value) {
175
- const { scrollTop: a, scrollHeight: v, clientHeight: b } = t.value, C = 2;
176
- e.scrolled_top = a > C, e.small_indents = e.scrolled_top && e.can_shorten_modal, e.scrolled_bottom = a + b < v - C;
177
- }
178
- },
179
- l ? 0 : 300
180
- );
181
- }, V = () => h(), A = () => {
182
- s("before-close"), t.value && (m.value && m.value.disconnect(), t.value.removeEventListener("scroll", V));
183
- }, D = () => {
184
- o.separators && (W(), t.value && (t.value.addEventListener("scroll", V, {
185
- passive: !0
186
- }), m.value = new ResizeObserver(L), m.value.observe(t.value)), h()), s("opened");
187
- }, I = (l) => {
188
- s("back", l);
159
+ [`mc-modal--variation-${l.variation}`]: !!l.variation,
160
+ [`mc-modal--header-align-${l.headerAlign}`]: (l.closeVisible || l.arrowVisible) && !!l.headerAlign
161
+ })), A = S(() => ({
162
+ "--mc-modal-padding": _[e.indent.regular],
163
+ "--mc-modal-padding-small": _[e.indent.small],
164
+ "--mc-modal-header-line-height": p[e.header.title.line_height.regular],
165
+ "--mc-modal-header-line-height-small": p[e.header.title.line_height.small],
166
+ "--mc-modal-button-height": f[e.footer.button.regular],
167
+ "--mc-modal-button-height-small": f[e.footer.button.small],
168
+ "--mc-modal-max-width": `${l.maxWidth + 24}px`,
169
+ "--mc-modal-min-width": `${l.minWidth - 24}px`,
170
+ "--mc-modal-state-number": O.value
171
+ })), N = () => {
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) => {
174
+ const n = getComputedStyle(t).getPropertyValue(o).trim();
175
+ if (!n) return 0;
176
+ const a = parseFloat(n);
177
+ return n.endsWith("rem") ? a * parseFloat(getComputedStyle(document.documentElement).fontSize) : a;
178
+ }, L = () => {
179
+ const t = parseFloat(getComputedStyle(document.documentElement).fontSize), o = (le) => parseFloat(le) * t, n = +e.modal_params["--mc-modal-padding"] || o(_[e.indent.regular]), a = +e.modal_params["--mc-modal-padding-small"] || o(_[e.indent.small]), K = +e.modal_params["--mc-modal-header-line-height"] || o(p[e.header.title.line_height.regular]), U = +e.modal_params["--mc-modal-header-line-height-small"] || o(p[e.header.title.line_height.small]), X = +e.modal_params["--mc-modal-button-height"] || o(f[e.footer.button.regular]), Y = +e.modal_params["--mc-modal-button-height-small"] || o(f[e.footer.button.small]), Z = (n - a) * 3 + a, ee = K - U, te = X - Y;
180
+ return Z + ee + te;
181
+ }, v = () => {
182
+ if (!s.value) return;
183
+ const { scrollTop: t, scrollHeight: o, clientHeight: n } = s.value, a = 2;
184
+ e.scrolled_top = t > a, e.small_indents ? e.small_indents = t > 0 : e.small_indents = t > a && e.can_shorten_modal, e.scrolled_bottom = t + n < o - a;
189
185
  }, W = () => {
186
+ y(), v();
187
+ };
188
+ me(s, "scroll", () => {
189
+ l.separators && W();
190
+ }, { passive: !0 });
191
+ const C = () => {
192
+ c.value?.disconnect(), c.value = null;
193
+ }, x = () => {
194
+ !s.value || !l.separators || (C(), c.value = new ResizeObserver(G), c.value.observe(s.value));
195
+ }, R = () => {
196
+ requestAnimationFrame(() => {
197
+ requestAnimationFrame(() => {
198
+ q();
199
+ });
200
+ });
201
+ }, q = () => {
202
+ s.value && (j(), s.value.scrollTop = 0, y(), v());
203
+ }, Q = (t) => {
204
+ r("back", t);
205
+ }, j = () => {
190
206
  try {
191
- f.value && Object.keys(B.value).forEach((l) => {
192
- const a = parseFloat(getComputedStyle(f.value)?.getPropertyValue(l)) * parseFloat(getComputedStyle(document.documentElement).fontSize);
193
- a && (e.modal_params[l] = a);
207
+ const t = D();
208
+ if (!t) return;
209
+ [
210
+ "--mc-modal-padding",
211
+ "--mc-modal-padding-small",
212
+ "--mc-modal-header-line-height",
213
+ "--mc-modal-header-line-height-small",
214
+ "--mc-modal-button-height",
215
+ "--mc-modal-button-height-small"
216
+ ].forEach((n) => {
217
+ const a = I(t, n);
218
+ a && (e.modal_params[n] = a);
194
219
  });
195
- } catch (l) {
196
- console.error(l);
220
+ } catch (t) {
221
+ console.error(t);
197
222
  }
198
- }, F = () => {
199
- const l = (+e.modal_params?.["--mc-modal-padding"] - +e.modal_params?.["--mc-modal-padding-small"]) * 3 + +e.modal_params?.["--mc-modal-padding-small"], a = +e.modal_params?.["--mc-modal-header-line-height"] - +e.modal_params?.["--mc-modal-header-line-height-small"], v = +e.modal_params?.["--mc-modal-button-height"] - +e.modal_params?.["--mc-modal-button-height-small"], b = l + a + v;
200
- !e.small_indents && t.value && (e.can_shorten_modal = t.value?.scrollHeight - t.value?.clientHeight > b);
201
- }, L = () => {
202
- F(), h();
203
- }, x = () => {
204
- p.value = 1, s("before-open"), s("update:modelValue", !0), U(D);
205
- }, _ = () => {
206
- p.value = 0, A(), s("closed"), s("update:modelValue", !1);
207
- }, j = () => {
208
- o.clickBackdropToClose && _();
223
+ }, y = () => {
224
+ if (!s.value) return;
225
+ const { scrollTop: t, scrollHeight: o, clientHeight: n } = s.value, a = L();
226
+ (!e.small_indents || t === 0) && (e.can_shorten_modal = o - n > a);
227
+ }, G = () => {
228
+ y(), v();
229
+ }, z = () => {
230
+ r("before-close"), r("closed"), r("update:modelValue", !1);
231
+ }, J = () => {
232
+ l.clickBackdropToClose && z();
209
233
  };
210
- return J(
211
- () => o.modelValue,
212
- (l, a) => {
213
- l !== a && (l ? x() : _());
234
+ return H(
235
+ () => l.modelValue,
236
+ (t, o) => {
237
+ if (t !== o) {
238
+ if (t) {
239
+ b.value = 1, r("before-open");
240
+ return;
241
+ }
242
+ C(), N(), b.value = 0;
243
+ }
214
244
  },
215
245
  { immediate: !0 }
216
- ), (l, a) => o.modelValue ? (n(), r("div", Z, [
217
- o.showOverlay ? (n(), r("div", {
246
+ ), H(
247
+ s,
248
+ (t, o) => {
249
+ !l.modelValue || !t || !l.separators || (x(), o || (R(), r("opened")));
250
+ },
251
+ { flush: "post" }
252
+ ), (t, o) => l.modelValue ? (i(), d("div", ce, [
253
+ l.showOverlay ? (i(), d("div", {
218
254
  key: 0,
219
255
  class: "mc-modal__overlay",
220
- onClick: y(j, ["stop"])
221
- })) : d("", !0),
222
- c("div", {
223
- class: S(["mc-modal", P.value]),
224
- style: K(B.value)
256
+ onClick: k(J, ["stop"])
257
+ })) : m("", !0),
258
+ h("div", {
259
+ class: M(["mc-modal", P.value]),
260
+ style: re(A.value)
225
261
  }, [
226
- c("div", {
262
+ h("div", {
227
263
  ref_key: "modalInner",
228
- ref: f,
229
- class: S(["mc-modal__inner", { "mc-modal__inner--with-title": l.$slots.title }])
264
+ ref: V,
265
+ class: M(["mc-modal__inner", { "mc-modal__inner--with-title": t.$slots.title }])
230
266
  }, [
231
- l.$slots.title ? (n(), r("div", ee, [
232
- c("div", le, [
233
- k(l.$slots, "title")
267
+ t.$slots.title ? (i(), d("div", ue, [
268
+ h("div", he, [
269
+ w(t.$slots, "title")
234
270
  ])
235
- ])) : d("", !0),
236
- c("div", {
271
+ ])) : m("", !0),
272
+ h("div", {
237
273
  ref_key: "mcModalBody",
238
- ref: t,
274
+ ref: s,
239
275
  class: "mc-modal__body"
240
276
  }, [
241
- k(l.$slots, "default")
277
+ w(t.$slots, "default")
242
278
  ], 512),
243
- l.$slots.footer ? (n(), r("div", oe, [
244
- k(l.$slots, "footer")
245
- ])) : d("", !0),
246
- u.arrowVisible ? (n(), r("button", {
279
+ t.$slots.footer ? (i(), d("div", pe, [
280
+ w(t.$slots, "footer")
281
+ ])) : m("", !0),
282
+ g.arrowVisible ? (i(), d("button", {
247
283
  key: 2,
248
284
  type: "button",
249
285
  class: "mc-modal__btn-back",
250
- onClick: y(I, ["prevent"])
286
+ onClick: k(Q, ["prevent"])
251
287
  }, [
252
- M($(w), {
288
+ T($(B), {
253
289
  name: "arrow_leftward",
254
290
  class: "mc-modal__icon-back"
255
291
  })
256
- ])) : d("", !0),
257
- u.closeVisible ? (n(), r("button", {
292
+ ])) : m("", !0),
293
+ g.closeVisible ? (i(), d("button", {
258
294
  key: 3,
259
295
  type: "button",
260
296
  class: "mc-modal__btn-close",
261
- onClick: y(_, ["prevent"])
297
+ onClick: k(z, ["prevent"])
262
298
  }, [
263
- M($(w), {
299
+ T($(B), {
264
300
  class: "mc-modal__icon-close",
265
301
  width: "24",
266
302
  height: "24",
267
303
  name: "close"
268
304
  })
269
- ])) : d("", !0)
305
+ ])) : m("", !0)
270
306
  ], 2)
271
307
  ], 6)
272
- ])) : d("", !0);
308
+ ])) : m("", !0);
273
309
  }
274
310
  });
275
311
  export {
276
- de as default
312
+ Se as default
277
313
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediacube-ui-v2",
3
- "version": "0.0.327",
3
+ "version": "0.0.329",
4
4
  "license": "MIT",
5
5
  "description": "Design system for Mediacube services",
6
6
  "sideEffects": [