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,29 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { Directions as
|
|
4
|
-
import { useFieldErrors as
|
|
5
|
-
import { SelectGroupKeys as w, SelectListDirections as
|
|
6
|
-
import { PreviewSizes as
|
|
7
|
-
import { TitleVariations as
|
|
8
|
-
import { TooltipPositions as
|
|
9
|
-
import { Weights as
|
|
10
|
-
import { ChipSize as
|
|
11
|
-
import { useTheme as
|
|
12
|
-
import { useThrottleFn as
|
|
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
|
|
15
|
+
import j from "../McSvgIcon/McSvgIcon.vue2.js";
|
|
16
16
|
/* empty css */
|
|
17
|
-
const
|
|
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
|
-
},
|
|
20
|
+
}, st = {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: "mc-field-select__prepend"
|
|
23
|
-
},
|
|
23
|
+
}, ct = {
|
|
24
24
|
key: 0,
|
|
25
25
|
class: "mc-field-select__footer"
|
|
26
|
-
},
|
|
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:
|
|
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:
|
|
272
|
-
const
|
|
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
|
-
)),
|
|
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
|
-
}),
|
|
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":
|
|
310
|
-
"mc-field-select--with-preview": e.optionWithPreview &&
|
|
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":
|
|
313
|
-
"mc-field-select--hide-arrow": !!
|
|
314
|
-
})),
|
|
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,
|
|
317
|
-
return (!e.backgroundColor || o.includes(e.backgroundColor)) && (n =
|
|
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 &&
|
|
320
|
-
"--mc-field-select-color":
|
|
321
|
-
"--mc-field-select-selected-color":
|
|
322
|
-
"--mc-field-select-border-color": n &&
|
|
323
|
-
"--mc-field-select-label-color":
|
|
324
|
-
"--mc-field-select-placeholder-color":
|
|
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
|
-
}),
|
|
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 =
|
|
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
|
-
|
|
347
|
+
Ae(t), $e(V.value ? o : l);
|
|
348
348
|
}
|
|
349
|
-
}),
|
|
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
|
|
353
|
-
if (o.has(String(
|
|
354
|
-
const b = e.modelValue?.constructor === Array ? e.modelValue.map((
|
|
355
|
-
return b && o.add(String(
|
|
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
|
-
},
|
|
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((
|
|
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 :
|
|
365
|
-
},
|
|
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
|
-
},
|
|
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() || {},
|
|
382
|
+
} = I.value?.getBoundingClientRect() || {}, p = g.value.getBoundingClientRect(), b = x.value;
|
|
383
383
|
if (!b) return;
|
|
384
|
-
const
|
|
385
|
-
if (
|
|
386
|
-
const v = b.$refs.list, W =
|
|
387
|
-
v.style.width = `${n}px`, v.style.position = "fixed", v.style.left = `${c -
|
|
388
|
-
const
|
|
389
|
-
let
|
|
390
|
-
switch (
|
|
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
|
|
393
|
-
v.style.top = `${
|
|
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 +
|
|
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),
|
|
403
|
-
G(), g.value =
|
|
404
|
-
},
|
|
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
|
-
|
|
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
|
-
},
|
|
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,
|
|
423
|
-
},
|
|
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
|
-
},
|
|
428
|
-
C("handle-open"), e.renderAbsoluteList && (
|
|
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
|
-
},
|
|
432
|
-
|
|
433
|
-
},
|
|
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 ||
|
|
437
|
+
!t || ne.value.some(
|
|
436
438
|
(l) => String(l[e.titleField]).toLowerCase() === t.toLowerCase()
|
|
437
|
-
) || (
|
|
439
|
+
) || (se(t), L.value = "");
|
|
438
440
|
};
|
|
439
|
-
return
|
|
440
|
-
F.value &&
|
|
441
|
-
}),
|
|
441
|
+
return Ue(() => {
|
|
442
|
+
F.value && ce(), G();
|
|
443
|
+
}), J(
|
|
442
444
|
() => e.options,
|
|
443
445
|
(t) => {
|
|
444
|
-
|
|
446
|
+
ae(t);
|
|
445
447
|
},
|
|
446
448
|
{ immediate: !0 }
|
|
447
|
-
),
|
|
449
|
+
), J(
|
|
448
450
|
() => e.modelValue,
|
|
449
451
|
() => {
|
|
450
|
-
|
|
452
|
+
ae();
|
|
451
453
|
},
|
|
452
454
|
{ immediate: !0, deep: !0 }
|
|
453
|
-
),
|
|
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:
|
|
463
|
-
style:
|
|
464
|
+
class: de(Be.value),
|
|
465
|
+
style: Xe(Te.value)
|
|
464
466
|
}, [
|
|
465
|
-
T("div",
|
|
467
|
+
T("div", at, [
|
|
466
468
|
$(t.$slots, "header", {}, () => [
|
|
467
|
-
|
|
469
|
+
le.value ? (s(), u(h, {
|
|
468
470
|
key: 0,
|
|
469
471
|
"max-width": "100%",
|
|
470
|
-
weight: a(
|
|
472
|
+
weight: a(Z).Medium
|
|
471
473
|
}, {
|
|
472
474
|
default: r(() => [
|
|
473
|
-
E(f(
|
|
475
|
+
E(f(Ve.value), 1)
|
|
474
476
|
]),
|
|
475
477
|
_: 1
|
|
476
478
|
}, 8, ["weight"])) : _("", !0)
|
|
477
479
|
])
|
|
478
480
|
]),
|
|
479
|
-
T("div",
|
|
480
|
-
S(a(
|
|
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
|
-
},
|
|
486
|
-
onTag:
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
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(
|
|
495
|
+
e.optionWithPreview ? (s(), u(a(ee), {
|
|
493
496
|
key: 0,
|
|
494
497
|
class: "option__desc",
|
|
495
|
-
size: a(
|
|
496
|
-
},
|
|
498
|
+
size: a(fe).L
|
|
499
|
+
}, Q({
|
|
497
500
|
top: r(() => [
|
|
498
501
|
S(h, {
|
|
499
|
-
weight: a(
|
|
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(
|
|
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(
|
|
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",
|
|
541
|
-
|
|
542
|
-
k.avatar ? (s(), u(a(
|
|
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(
|
|
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:
|
|
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(
|
|
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(
|
|
566
|
+
T("span", null, f(we.value), 1)
|
|
564
567
|
])
|
|
565
568
|
]),
|
|
566
569
|
tag: r((l) => [
|
|
567
|
-
S(a(
|
|
568
|
-
size: a(
|
|
570
|
+
S(a(ye), {
|
|
571
|
+
size: a(tt).Xs,
|
|
569
572
|
class: "multiselect__tag",
|
|
570
|
-
variation: `${a(
|
|
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(
|
|
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(
|
|
604
|
+
e.optionWithPreview ? (s(), u(a(ee), {
|
|
602
605
|
key: 1,
|
|
603
606
|
class: "option__desc",
|
|
604
|
-
size: a(
|
|
605
|
-
},
|
|
607
|
+
size: a(fe).L
|
|
608
|
+
}, Q({
|
|
606
609
|
top: r(() => [
|
|
607
610
|
S(h, {
|
|
608
|
-
weight: a(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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",
|
|
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(
|
|
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",
|
|
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(
|
|
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,
|
|
690
|
+
], 14, nt));
|
|
688
691
|
}
|
|
689
692
|
});
|
|
690
693
|
export {
|
|
691
|
-
|
|
694
|
+
Vt as default
|
|
692
695
|
};
|
package/dist/styles/mixins.scss
CHANGED
|
@@ -382,7 +382,17 @@
|
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
|
|
385
|
-
|
|
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
|
}
|