mediacube-ui-v2 0.0.343 → 0.0.345

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.343",
3
+ "libraryVersion": "0.0.345",
4
4
  "packageName": "mediacube-ui-v2",
5
5
  "pathHash": "9b6f3b8016b22ac7",
6
6
  "componentCount": 76,
@@ -1,29 +1,29 @@
1
- import { defineComponent as He, defineAsyncComponent as q, useSlots as je, inject as Ie, ref as p, computed as i, onBeforeUnmount as Ye, watch as K, openBlock as s, createElementBlock as O, normalizeStyle as Ge, normalizeClass as ue, createElementVNode as T, renderSlot as $, createBlock as u, unref as a, withCtx as r, createTextVNode as E, toDisplayString as f, createCommentVNode as _, createVNode as S, mergeProps as Ue, createSlots as J, nextTick as de } from "vue";
2
- import Xe from "vue-multiselect";
3
- import { Directions as me } from "../../../enums/ui/Directions2.js";
4
- import { useFieldErrors as Ke } from "../../../composables/useFieldErrors2.js";
5
- import { SelectGroupKeys as w, SelectListDirections as Je } from "../../../enums/Select2.js";
6
- import { PreviewSizes as pe } from "../../../enums/Preview2.js";
7
- import { TitleVariations as fe } from "../../../enums/Title2.js";
8
- import { TooltipPositions as Qe } from "../../../enums/Tooltip2.js";
9
- import { Weights as Q } from "../../../enums/ui/Weights2.js";
10
- import { ChipSize as Ze } from "../../../enums/Chip2.js";
11
- import { useTheme as et } from "../../../composables/useTheme2.js";
12
- import { useThrottleFn as tt } from "@vueuse/core";
1
+ import { defineComponent as Ie, defineAsyncComponent as q, useSlots as Ye, inject as Ge, ref as d, computed as i, onBeforeUnmount as Ue, watch as J, openBlock as s, createElementBlock as O, normalizeStyle as Xe, normalizeClass as de, createElementVNode as T, renderSlot as $, createBlock as u, unref as a, withCtx as r, createTextVNode as E, toDisplayString as f, createCommentVNode as _, createVNode as S, mergeProps as Ke, createSlots as Q, nextTick as me } from "vue";
2
+ import Je from "vue-multiselect";
3
+ import { Directions as pe } from "../../../enums/ui/Directions2.js";
4
+ import { useFieldErrors as Qe } from "../../../composables/useFieldErrors2.js";
5
+ import { SelectGroupKeys as w, SelectListDirections as Ze } from "../../../enums/Select2.js";
6
+ import { PreviewSizes as fe } from "../../../enums/Preview2.js";
7
+ import { TitleVariations as ve } from "../../../enums/Title2.js";
8
+ import { TooltipPositions as et } from "../../../enums/Tooltip2.js";
9
+ import { Weights as Z } from "../../../enums/ui/Weights2.js";
10
+ import { ChipSize as tt } from "../../../enums/Chip2.js";
11
+ import { useTheme as lt } from "../../../composables/useTheme2.js";
12
+ import { useThrottleFn as ot } from "@vueuse/core";
13
13
  import h from "../McTitle/McTitle.vue2.js";
14
14
  import '../../../assets/components/elements/McSvgIcon/index.css';import '../../../assets/components/elements/McTitle/index.css';/* empty css */
15
- import H from "../McSvgIcon/McSvgIcon.vue2.js";
15
+ import j from "../McSvgIcon/McSvgIcon.vue2.js";
16
16
  /* empty css */
17
- const lt = ["dir"], ot = { class: "mc-field-select__header" }, nt = { class: "mc-field-select__main" }, at = {
17
+ const nt = ["dir"], at = { class: "mc-field-select__header" }, rt = { class: "mc-field-select__main" }, it = {
18
18
  key: 1,
19
19
  class: "mc-field-select__single-label"
20
- }, rt = {
20
+ }, st = {
21
21
  key: 0,
22
22
  class: "mc-field-select__prepend"
23
- }, it = {
23
+ }, ct = {
24
24
  key: 0,
25
25
  class: "mc-field-select__footer"
26
- }, st = { key: 1 }, xt = /* @__PURE__ */ He({
26
+ }, ut = { key: 1 }, Vt = /* @__PURE__ */ Ie({
27
27
  __name: "McFieldSelect",
28
28
  props: {
29
29
  /**
@@ -250,7 +250,7 @@ const lt = ["dir"], ot = { class: "mc-field-select__header" }, nt = { class: "mc
250
250
  },
251
251
  dir: {
252
252
  type: String,
253
- default: me.Ltr
253
+ default: pe.Ltr
254
254
  },
255
255
  /**
256
256
  * На какое после смотреть что бы считать его заголовком строки
@@ -268,11 +268,11 @@ const lt = ["dir"], ot = { class: "mc-field-select__header" }, nt = { class: "mc
268
268
  }
269
269
  },
270
270
  emits: ["original-input", "tag", "search-change", "update:modelValue", "handle-open", "handle-close"],
271
- setup(k, { emit: ve }) {
272
- const j = q(() => import("../McAvatar/McAvatar.vue.js")), ge = q(() => import("../McTooltip/McTooltip.vue.js")), Z = q(() => import("../../patterns/McPreview/McPreview.vue.js")), he = q(() => import("../McChip/McChip.vue.js")), C = ve, ye = je(), ee = Ie("dsOptions", {}), e = k, d = et("select"), y = Ke(e.errors), L = p(null), x = p(null), I = p(null), A = p([]), g = p(null), z = p(), F = p(!1), N = p(null), Y = p(null), P = p(null), B = i(() => e.options.some(
271
+ setup(k, { emit: ge }) {
272
+ const H = q(() => import("../McAvatar/McAvatar.vue.js")), he = q(() => import("../McTooltip/McTooltip.vue.js")), ee = q(() => import("../../patterns/McPreview/McPreview.vue.js")), ye = q(() => import("../McChip/McChip.vue.js")), C = ge, be = Ye(), te = Ge("dsOptions", {}), e = k, m = lt("select"), y = Qe(e.errors), L = d(null), x = d(null), I = d(null), A = d([]), g = d(null), z = d(), F = d(!1), N = d(null), Y = d(null), P = d(null), B = i(() => e.options.some(
273
273
  (t) => Object.prototype.hasOwnProperty.call(t, w.Label) && Object.prototype.hasOwnProperty.call(t, w.Values) && //@ts-ignore
274
274
  Array.isArray(t[w.Values])
275
- )), te = i(() => !!e.title), le = i(() => e.avatar || e.icon), V = i(() => e.multiple), be = i(() => V.value ? !!(e.modelValue || [])?.length : !!e.modelValue), _e = i(() => e.noResultsText ?? ee.componentTranslations?.select?.noResultsText), Se = i(() => e.emptyList ?? ee.componentTranslations?.select?.emptyList), we = i(() => ({
275
+ )), le = i(() => !!e.title), oe = i(() => e.avatar || e.icon), V = i(() => e.multiple), _e = i(() => V.value ? !!(e.modelValue || [])?.length : !!e.modelValue), Se = i(() => e.noResultsText ?? te.componentTranslations?.select?.noResultsText), we = i(() => e.emptyList ?? te.componentTranslations?.select?.emptyList), ke = i(() => ({
276
276
  label: e.titleField,
277
277
  trackBy: e.valueField,
278
278
  loading: e.loading,
@@ -301,33 +301,33 @@ const lt = ["dir"], ot = { class: "mc-field-select__header" }, nt = { class: "mc
301
301
  const n = l[e.valueField];
302
302
  return t.has(String(n)) ? !1 : (t.add(String(n)), !0);
303
303
  });
304
- }), oe = i(() => B.value ? R.value.map((t) => t[w.Values]).flat() : R.value), ke = i(() => new Map(oe.value.map((t) => [String(t[e.valueField]), t]))), Ce = i(() => e.dir === me.Rtl), xe = i(() => ({
304
+ }), ne = i(() => B.value ? R.value.map((t) => t[w.Values]).flat() : R.value), Ce = i(() => new Map(ne.value.map((t) => [String(t[e.valueField]), t]))), xe = i(() => e.dir === pe.Rtl), Be = i(() => ({
305
305
  "mc-field-select": !0,
306
306
  "mc-field-select--error": !!y.errorText.value,
307
307
  "mc-field-select--disabled": e.disabled,
308
308
  [`mc-field-select--bg-${e.backgroundColor}`]: !!e.backgroundColor,
309
- "mc-field-select--is-empty-options-list": Te.value || e.loading,
310
- "mc-field-select--with-preview": e.optionWithPreview && be.value,
309
+ "mc-field-select--is-empty-options-list": Ee.value || e.loading,
310
+ "mc-field-select--with-preview": e.optionWithPreview && _e.value,
311
311
  "mc-field-select--max-height": !!e.maxHeight,
312
- "mc-field-select--rtl": Ce.value,
313
- "mc-field-select--hide-arrow": !!ye.arrow
314
- })), Be = i(() => `${e.title}${e.required ? " *" : ""}`), Ve = i(() => {
312
+ "mc-field-select--rtl": xe.value,
313
+ "mc-field-select--hide-arrow": !!be.arrow
314
+ })), Ve = i(() => `${e.title}${e.required ? " *" : ""}`), Te = i(() => {
315
315
  const t = ["gray", "dark-gray", "black"], o = ["white"];
316
- let l = "gray", n = e.backgroundColor, c = e.backgroundColor, m = "black";
317
- return (!e.backgroundColor || o.includes(e.backgroundColor)) && (n = d.component.color), t.includes(e.backgroundColor) && (m = "white", l = "white", n = "black"), e.disabled && !e.backgroundColor && (c = "hover-gray"), {
316
+ let l = "gray", n = e.backgroundColor, c = e.backgroundColor, p = "black";
317
+ return (!e.backgroundColor || o.includes(e.backgroundColor)) && (n = m.component.color), t.includes(e.backgroundColor) && (p = "white", l = "white", n = "black"), e.disabled && !e.backgroundColor && (c = "hover-gray"), {
318
318
  "--mc-field-select-max-height": e.maxHeight,
319
- "--mc-field-select-bg-color": c && d.colors[c],
320
- "--mc-field-select-color": d.colors[d.component.color],
321
- "--mc-field-select-selected-color": d.colors[d.component.selected],
322
- "--mc-field-select-border-color": n && d.colors[n],
323
- "--mc-field-select-label-color": d.colors[m],
324
- "--mc-field-select-placeholder-color": d.colors[l]
319
+ "--mc-field-select-bg-color": c && m.colors[c],
320
+ "--mc-field-select-color": m.colors[m.component.color],
321
+ "--mc-field-select-selected-color": m.colors[m.component.selected],
322
+ "--mc-field-select-border-color": n && m.colors[n],
323
+ "--mc-field-select-label-color": m.colors[p],
324
+ "--mc-field-select-placeholder-color": m.colors[l]
325
325
  };
326
- }), Te = i(() => e.hideSelected && !L.value || !e.options.length ? e.multiple ? B.value ? !1 : Array.isArray(e.modelValue) && e.options.length === e.modelValue.length : !!e.modelValue && R.value?.length === 1 && !L.value : e.options.length === 0 ? !e.options.length : !1), M = i({
326
+ }), Ee = i(() => e.hideSelected && !L.value || !e.options.length ? e.multiple ? B.value ? !1 : Array.isArray(e.modelValue) && e.options.length === e.modelValue.length : !!e.modelValue && R.value?.length === 1 && !L.value : e.options.length === 0 ? !e.options.length : !1), M = i({
327
327
  get() {
328
328
  let t = V.value ? e.modelValue || [] : [e.modelValue].filter(Boolean);
329
329
  t = t.map((l) => {
330
- const n = ke.value.get(String(l));
330
+ const n = Ce.value.get(String(l));
331
331
  return {
332
332
  [e.titleField]: n?.[e.titleField] || l,
333
333
  [e.valueField]: n?.[e.valueField] || l,
@@ -344,25 +344,25 @@ const lt = ["dir"], ot = { class: "mc-field-select__header" }, nt = { class: "mc
344
344
  let o = V.value ? Array.isArray(t) ? t : [] : [t];
345
345
  o = o.filter(Boolean).map((n) => n[e.valueField]);
346
346
  const [l] = o;
347
- $e(t), Oe(V.value ? o : l);
347
+ Ae(t), $e(V.value ? o : l);
348
348
  }
349
- }), ne = (t = e.options) => {
349
+ }), ae = (t = e.options) => {
350
350
  const o = /* @__PURE__ */ new Set(), l = B.value ? t.flatMap((c) => c[w.Values] ?? []) : t, n = [...A.value, ...l];
351
351
  A.value = n.filter((c) => {
352
- const m = c[e.valueField];
353
- if (o.has(String(m))) return !1;
354
- const b = e.modelValue?.constructor === Array ? e.modelValue.map((U) => String(U)).includes(String(c[e.valueField])) : String(c[e.valueField]) === String(e.modelValue);
355
- return b && o.add(String(m)), b;
352
+ const p = c[e.valueField];
353
+ if (o.has(String(p))) return !1;
354
+ const b = e.modelValue?.constructor === Array ? e.modelValue.map((X) => String(X)).includes(String(c[e.valueField])) : String(c[e.valueField]) === String(e.modelValue);
355
+ return b && o.add(String(p)), b;
356
356
  });
357
- }, ae = (t) => {
357
+ }, re = (t) => {
358
358
  if (!t || t.nodeType !== Node.ELEMENT_NODE || t === document.documentElement)
359
359
  return document.documentElement;
360
360
  const { overflow: o, overflowY: l } = getComputedStyle(t);
361
- if (["auto", "scroll"].some((m) => [o, l].includes(m)))
361
+ if (["auto", "scroll"].some((p) => [o, l].includes(p)))
362
362
  return t;
363
363
  const c = t.parentNode;
364
- return !c || c.nodeType !== Node.ELEMENT_NODE ? document.documentElement : ae(c);
365
- }, Ee = (t) => {
364
+ return !c || c.nodeType !== Node.ELEMENT_NODE ? document.documentElement : re(c);
365
+ }, Le = (t) => {
366
366
  if (!t) return null;
367
367
  let o = t.parentElement;
368
368
  for (; o && o !== document.body; ) {
@@ -371,7 +371,7 @@ const lt = ["dir"], ot = { class: "mc-field-select__header" }, nt = { class: "mc
371
371
  o = o.parentElement;
372
372
  }
373
373
  return null;
374
- }, re = i(() => ["iPhone", "iPad"].some((t) => navigator?.platform?.includes(t)) && window.visualViewport?.offsetTop || 0), D = tt(() => {
374
+ }, ie = i(() => ["iPhone", "iPad"].some((t) => navigator?.platform?.includes(t)) && window.visualViewport?.offsetTop || 0), D = ot(() => {
375
375
  if (!g.value || !x.value) return;
376
376
  const {
377
377
  top: t = 0,
@@ -379,38 +379,38 @@ const lt = ["dir"], ot = { class: "mc-field-select__header" }, nt = { class: "mc
379
379
  height: l = 0,
380
380
  width: n = 0,
381
381
  left: c = 0
382
- } = I.value?.getBoundingClientRect() || {}, m = g.value.getBoundingClientRect(), b = x.value;
382
+ } = I.value?.getBoundingClientRect() || {}, p = g.value.getBoundingClientRect(), b = x.value;
383
383
  if (!b) return;
384
- const U = t - m.top, Re = o - m.bottom;
385
- if (U >= -l && Re < l) {
386
- const v = b.$refs.list, W = Ee(v), Me = W ? W.left : 0, ce = W ? W.top : 0;
387
- v.style.width = `${n}px`, v.style.position = "fixed", v.style.left = `${c - Me}px`;
388
- const De = I.value?.querySelector(".mc-field-select__header")?.offsetHeight, We = 8;
389
- let X = e.openDirection;
390
- switch (X === Je.Auto && (X = b?.isAbove ? "top" : "bottom"), X) {
384
+ const X = t - p.top, De = o - p.bottom;
385
+ if (X >= -l && De < l) {
386
+ const v = b.$refs.list, W = Le(v), We = W ? W.left : 0, ue = W ? W.top : 0;
387
+ v.style.width = `${n}px`, v.style.position = "fixed", v.style.left = `${c - We}px`;
388
+ const qe = I.value?.querySelector(".mc-field-select__header")?.offsetHeight, je = 8;
389
+ let K = e.openDirection;
390
+ switch (K === Ze.Auto && (K = b?.isAbove ? "top" : "bottom"), K) {
391
391
  case "top": {
392
- const qe = t + (te.value ? De + We : 0) + re.value - v.getBoundingClientRect().height - 8;
393
- v.style.top = `${qe - ce}px`, v.style.bottom = "auto";
392
+ const He = t + (le.value ? qe + je : 0) + ie.value - v.getBoundingClientRect().height - 8;
393
+ v.style.top = `${He - ue}px`, v.style.bottom = "auto";
394
394
  break;
395
395
  }
396
396
  case "bottom":
397
- v.style.bottom = "auto", v.style.top = `${t + re.value + l - ce}px`;
397
+ v.style.bottom = "auto", v.style.top = `${t + ie.value + l - ue}px`;
398
398
  break;
399
399
  }
400
400
  } else if (!/Android/i.test(navigator.userAgent))
401
401
  return b.deactivate();
402
- }, 16), Le = () => {
403
- G(), g.value = ae(x.value.$el) || document.documentElement, g.value.addEventListener("scroll", D), z.value?.disconnect(), z.value = new ResizeObserver(D), z.value.observe(g.value);
404
- }, ie = (t) => {
402
+ }, 16), Fe = () => {
403
+ G(), g.value = re(x.value.$el) || document.documentElement, g.value.addEventListener("scroll", D), z.value?.disconnect(), z.value = new ResizeObserver(D), z.value.observe(g.value);
404
+ }, se = (t) => {
405
405
  const o = { [e.titleField]: t, [e.valueField]: t };
406
406
  A.value.push(o), M.value = V.value ? [...M.value, o] : o, C("tag", t);
407
- }, Fe = (t) => {
408
- L.value = t, C("search-change", t);
409
407
  }, Oe = (t) => {
410
- y.toggleErrorVisible(), C("update:modelValue", t);
408
+ L.value = t, C("search-change", t);
411
409
  }, $e = (t) => {
410
+ y.toggleErrorVisible(), C("update:modelValue", t);
411
+ }, Ae = (t) => {
412
412
  C("original-input", t);
413
- }, Ae = () => {
413
+ }, ze = () => {
414
414
  const t = x.value;
415
415
  if (!t?.$refs?.list) return;
416
416
  const o = t.$refs.list;
@@ -419,38 +419,40 @@ const lt = ["dir"], ot = { class: "mc-field-select__header" }, nt = { class: "mc
419
419
  const l = document.createElement("div");
420
420
  l.className = "mc-field-select mc-field-select--list-portal";
421
421
  const n = document.createElement("div");
422
- n.className = "multiselect", n.appendChild(o), l.appendChild(n), document.body.appendChild(l), P.value = l, F.value = !0, de(D);
423
- }, se = () => {
422
+ n.className = "multiselect", n.appendChild(o), l.appendChild(n), document.body.appendChild(l), P.value = l, F.value = !0, me(D);
423
+ }, ce = () => {
424
424
  if (!F.value || !N.value) return;
425
425
  const o = x.value?.$refs?.list, l = P.value;
426
426
  o && l?.contains(o) && N.value.insertBefore(o, Y.value), l?.remove(), F.value = !1, N.value = null, Y.value = null, P.value = null;
427
- }, ze = () => {
428
- C("handle-open"), e.renderAbsoluteList && (Le(), de(Ae));
427
+ }, Ne = () => {
428
+ C("handle-open"), e.renderAbsoluteList && (Fe(), me(ze));
429
429
  }, G = () => {
430
430
  z.value?.disconnect(), g.value && (g.value.removeEventListener("scroll", D), g.value = null);
431
- }, Ne = () => {
432
- e.taggable && Pe(), F.value && se(), G(), C("handle-close");
433
- }, Pe = () => {
431
+ }, U = d(!1), Pe = () => {
432
+ U.value = !0;
433
+ }, Re = () => {
434
+ U.value ? U.value = !1 : e.taggable && Me(), F.value && ce(), G(), C("handle-close");
435
+ }, Me = () => {
434
436
  const t = L.value?.trim();
435
- !t || oe.value.some(
437
+ !t || ne.value.some(
436
438
  (l) => String(l[e.titleField]).toLowerCase() === t.toLowerCase()
437
- ) || (ie(t), L.value = "");
439
+ ) || (se(t), L.value = "");
438
440
  };
439
- return Ye(() => {
440
- F.value && se(), G();
441
- }), K(
441
+ return Ue(() => {
442
+ F.value && ce(), G();
443
+ }), J(
442
444
  () => e.options,
443
445
  (t) => {
444
- ne(t);
446
+ ae(t);
445
447
  },
446
448
  { immediate: !0 }
447
- ), K(
449
+ ), J(
448
450
  () => e.modelValue,
449
451
  () => {
450
- ne();
452
+ ae();
451
453
  },
452
454
  { immediate: !0, deep: !0 }
453
- ), K(
455
+ ), J(
454
456
  () => e.errors,
455
457
  (t) => {
456
458
  y.setError(t);
@@ -459,44 +461,45 @@ const lt = ["dir"], ot = { class: "mc-field-select__header" }, nt = { class: "mc
459
461
  ref_key: "field_select_wrapper_ref",
460
462
  ref: I,
461
463
  dir: k.dir,
462
- class: ue(xe.value),
463
- style: Ge(Ve.value)
464
+ class: de(Be.value),
465
+ style: Xe(Te.value)
464
466
  }, [
465
- T("div", ot, [
467
+ T("div", at, [
466
468
  $(t.$slots, "header", {}, () => [
467
- te.value ? (s(), u(h, {
469
+ le.value ? (s(), u(h, {
468
470
  key: 0,
469
471
  "max-width": "100%",
470
- weight: a(Q).Medium
472
+ weight: a(Z).Medium
471
473
  }, {
472
474
  default: r(() => [
473
- E(f(Be.value), 1)
475
+ E(f(Ve.value), 1)
474
476
  ]),
475
477
  _: 1
476
478
  }, 8, ["weight"])) : _("", !0)
477
479
  ])
478
480
  ]),
479
- T("div", nt, [
480
- S(a(Xe), Ue({
481
+ T("div", rt, [
482
+ S(a(Je), Ke({
481
483
  ref_key: "field_select_ref",
482
484
  ref: x,
483
485
  modelValue: M.value,
484
486
  "onUpdate:modelValue": o[0] || (o[0] = (l) => M.value = l)
485
- }, we.value, {
486
- onTag: ie,
487
- onSearchChange: Fe,
488
- onOpen: ze,
489
- onClose: Ne
490
- }), J({
487
+ }, ke.value, {
488
+ onTag: se,
489
+ onSelect: Pe,
490
+ onSearchChange: Oe,
491
+ onOpen: Ne,
492
+ onClose: Re
493
+ }), Q({
491
494
  singleLabel: r(({ option: l }) => [
492
- e.optionWithPreview ? (s(), u(a(Z), {
495
+ e.optionWithPreview ? (s(), u(a(ee), {
493
496
  key: 0,
494
497
  class: "option__desc",
495
- size: a(pe).L
496
- }, J({
498
+ size: a(fe).L
499
+ }, Q({
497
500
  top: r(() => [
498
501
  S(h, {
499
- weight: a(Q).SemiBold,
502
+ weight: a(Z).SemiBold,
500
503
  "html-data": l[e.titleField]
501
504
  }, null, 8, ["weight", "html-data"])
502
505
  ]),
@@ -508,12 +511,12 @@ const lt = ["dir"], ot = { class: "mc-field-select__header" }, nt = { class: "mc
508
511
  l.icon || l.avatar ? {
509
512
  name: "left",
510
513
  fn: r(() => [
511
- l.icon ? (s(), u(H, {
514
+ l.icon ? (s(), u(j, {
512
515
  key: 0,
513
516
  name: l.icon,
514
517
  color: l.iconColor || "main",
515
518
  size: "400"
516
- }, null, 8, ["name", "color"])) : (s(), u(a(j), {
519
+ }, null, 8, ["name", "color"])) : (s(), u(a(H), {
517
520
  key: 1,
518
521
  src: l.avatar,
519
522
  size: "400",
@@ -537,43 +540,43 @@ const lt = ["dir"], ot = { class: "mc-field-select__header" }, nt = { class: "mc
537
540
  ]),
538
541
  key: "1"
539
542
  } : void 0
540
- ]), 1032, ["size"])) : (s(), O("div", at, [
541
- le.value ? (s(), O("div", rt, [
542
- k.avatar ? (s(), u(a(j), {
543
+ ]), 1032, ["size"])) : (s(), O("div", it, [
544
+ oe.value ? (s(), O("div", st, [
545
+ k.avatar ? (s(), u(a(H), {
543
546
  key: 0,
544
547
  src: k.avatar
545
- }, null, 8, ["src"])) : (s(), u(H, {
548
+ }, null, 8, ["src"])) : (s(), u(j, {
546
549
  key: 1,
547
550
  color: l.iconColor || "main",
548
551
  name: e.icon
549
552
  }, null, 8, ["color", "name"]))
550
553
  ])) : _("", !0),
551
554
  T("div", {
552
- class: ue(["mc-field-select__label-text", le.value ? "mc-field-select__label-text--indent-left" : ""])
555
+ class: de(["mc-field-select__label-text", oe.value ? "mc-field-select__label-text--indent-left" : ""])
553
556
  }, f(l ? l[e.titleField] : k.placeholder), 3)
554
557
  ]))
555
558
  ]),
556
559
  noResult: r(() => [
557
560
  $(t.$slots, "noResult", {}, () => [
558
- T("span", null, f(_e.value), 1)
561
+ T("span", null, f(Se.value), 1)
559
562
  ])
560
563
  ]),
561
564
  noOptions: r(() => [
562
565
  $(t.$slots, "noOptions", {}, () => [
563
- T("span", null, f(Se.value), 1)
566
+ T("span", null, f(we.value), 1)
564
567
  ])
565
568
  ]),
566
569
  tag: r((l) => [
567
- S(a(he), {
568
- size: a(Ze).Xs,
570
+ S(a(ye), {
571
+ size: a(tt).Xs,
569
572
  class: "multiselect__tag",
570
- variation: `${a(d).component.selected}-invert`,
573
+ variation: `${a(m).component.selected}-invert`,
571
574
  "text-color": "black",
572
575
  closable: !l?.option?.hasOwnProperty("is_closable") || l?.option?.is_closable,
573
576
  onClose: (n) => l.remove(l.option)
574
577
  }, {
575
578
  button: r(() => [
576
- S(H, {
579
+ S(j, {
577
580
  size: "250",
578
581
  name: "cancel"
579
582
  })
@@ -598,14 +601,14 @@ const lt = ["dir"], ot = { class: "mc-field-select__header" }, nt = { class: "mc
598
601
  ]),
599
602
  _: 2
600
603
  }, 1024)) : _("", !0),
601
- e.optionWithPreview ? (s(), u(a(Z), {
604
+ e.optionWithPreview ? (s(), u(a(ee), {
602
605
  key: 1,
603
606
  class: "option__desc",
604
- size: a(pe).L
605
- }, J({
607
+ size: a(fe).L
608
+ }, Q({
606
609
  top: r(() => [
607
610
  S(h, {
608
- weight: a(Q).SemiBold,
611
+ weight: a(Z).SemiBold,
609
612
  "html-data": l[e.titleField]
610
613
  }, null, 8, ["weight", "html-data"])
611
614
  ]),
@@ -614,12 +617,12 @@ const lt = ["dir"], ot = { class: "mc-field-select__header" }, nt = { class: "mc
614
617
  l.icon || l.avatar ? {
615
618
  name: "left",
616
619
  fn: r(() => [
617
- l.icon ? (s(), u(H, {
620
+ l.icon ? (s(), u(j, {
618
621
  key: 0,
619
622
  name: l.icon,
620
623
  color: l.iconColor || "main",
621
624
  size: "400"
622
- }, null, 8, ["name", "color"])) : (s(), u(a(j), {
625
+ }, null, 8, ["name", "color"])) : (s(), u(a(H), {
623
626
  key: 1,
624
627
  src: l.avatar,
625
628
  size: "400",
@@ -640,12 +643,12 @@ const lt = ["dir"], ot = { class: "mc-field-select__header" }, nt = { class: "mc
640
643
  ]),
641
644
  key: "1"
642
645
  } : void 0
643
- ]), 1032, ["size"])) : (s(), u(a(ge), {
646
+ ]), 1032, ["size"])) : (s(), u(a(he), {
644
647
  key: 2,
645
648
  class: "mc-field-select__options-tooltip-target",
646
649
  "max-width": "m",
647
650
  color: "black",
648
- placement: a(Qe).Top,
651
+ placement: a(et).Top,
649
652
  content: l[e.titleField]
650
653
  }, {
651
654
  default: r(() => [
@@ -658,21 +661,21 @@ const lt = ["dir"], ot = { class: "mc-field-select__header" }, nt = { class: "mc
658
661
  } : void 0
659
662
  ]), 1040, ["modelValue"])
660
663
  ]),
661
- a(y).errorText.value || e.helpText || t.$slots.footer ? (s(), O("div", it, [
664
+ a(y).errorText.value || e.helpText || t.$slots.footer ? (s(), O("div", ct, [
662
665
  a(y).errorText.value ? (s(), u(h, {
663
666
  key: 0,
664
667
  "tag-name": "div",
665
668
  color: "red",
666
- variation: a(fe).Overline,
669
+ variation: a(ve).Overline,
667
670
  "max-width": "100%",
668
671
  "html-data": a(y).errorText.value
669
672
  }, null, 8, ["variation", "html-data"])) : _("", !0),
670
- a(y).errorText.value ? (s(), O("br", st)) : _("", !0),
673
+ a(y).errorText.value ? (s(), O("br", ut)) : _("", !0),
671
674
  $(t.$slots, "footer", {}, () => [
672
675
  e.helpText ? (s(), u(h, {
673
676
  key: 0,
674
677
  "tag-name": "div",
675
- variation: a(fe).Overline,
678
+ variation: a(ve).Overline,
676
679
  color: "gray",
677
680
  "max-width": "100%",
678
681
  "pre-line": ""
@@ -684,9 +687,9 @@ const lt = ["dir"], ot = { class: "mc-field-select__header" }, nt = { class: "mc
684
687
  }, 8, ["variation"])) : _("", !0)
685
688
  ])
686
689
  ])) : _("", !0)
687
- ], 14, lt));
690
+ ], 14, nt));
688
691
  }
689
692
  });
690
693
  export {
691
- xt as default
694
+ Vt as default
692
695
  };
@@ -382,7 +382,17 @@
382
382
  }
383
383
  }
384
384
 
385
- @mixin editor-default-styles($main-font-size: $font-size-300, $main-line-height: $line-height-300) {
385
+ /**
386
+ * $preserve-empty-lines — сохранять пустые строки, набранные в редакторе (Enter x2 / Shift+Enter).
387
+ * По умолчанию выключено: пустые параграфы прячутся, как и раньше.
388
+ * Включать только там, где рендерится контент из визуального редактора, и пустая строка —
389
+ * осмысленная часть вёрстки автора. Для текстов из бэка/переводов оставлять false.
390
+ */
391
+ @mixin editor-default-styles(
392
+ $main-font-size: $font-size-300,
393
+ $main-line-height: $line-height-300,
394
+ $preserve-empty-lines: false
395
+ ) {
386
396
  p,
387
397
  strong,
388
398
  em,
@@ -395,6 +405,21 @@
395
405
  display: none;
396
406
  }
397
407
  }
408
+ @if $preserve-empty-lines {
409
+ /**
410
+ * Пустой <p> без контента имеет нулевую высоту, а висящий <br> в конце абзаца
411
+ * браузер не отрисовывает вовсе. Zero-width space даёт последней строке содержимое,
412
+ * поэтому отступ, который автор видит в редакторе, не схлопывается при показе.
413
+ */
414
+ p {
415
+ &:empty {
416
+ display: block;
417
+ }
418
+ &::after {
419
+ content: '\200B';
420
+ }
421
+ }
422
+ }
398
423
  ol,
399
424
  ul {
400
425
  margin-block-start: 0;
@@ -704,8 +729,8 @@
704
729
  }
705
730
 
706
731
 
707
- @mixin editor-notification-styles {
708
- @include editor-default-styles;
732
+ @mixin editor-notification-styles($preserve-empty-lines: false) {
733
+ @include editor-default-styles($preserve-empty-lines: $preserve-empty-lines);
709
734
  h1 {
710
735
  margin-bottom: $space-250;
711
736
  img {
@@ -751,7 +776,7 @@
751
776
  }
752
777
  }
753
778
 
754
- @mixin editor-assist-styles {
779
+ @mixin editor-assist-styles($preserve-empty-lines: false) {
755
780
  img {
756
781
  max-width: 100%;
757
782
  width: 100%;
@@ -759,5 +784,5 @@
759
784
  object-fit: cover;
760
785
  margin: 16px 0;
761
786
  }
762
- @include editor-default-styles;
787
+ @include editor-default-styles($preserve-empty-lines: $preserve-empty-lines);
763
788
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediacube-ui-v2",
3
- "version": "0.0.343",
3
+ "version": "0.0.345",
4
4
  "license": "MIT",
5
5
  "description": "Design system for Mediacube services",
6
6
  "sideEffects": [