mediacube-ui 0.1.353 → 0.1.355
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.
- package/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/assets/icons.svg +1 -1
- package/src/elements/McButton/McButton.vue +12 -83
- package/src/elements/McDatePicker/McDatePicker.vue +36 -2
- package/src/patterns/McModal/McModal.vue +28 -13
- package/src/patterns/McSideBar/McSideBarButton/McSideBarButton.vue +1 -0
- package/src/patterns/McTable/McTableCol/McTableCol.vue +2 -2
- package/src/styles/global.scss +3 -2
- package/src/tokens/gradients.scss +1 -1
- package/src/utils/checkColor.js +0 -38
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
<script>
|
|
36
36
|
import McSvgIcon from '../McSvgIcon/McSvgIcon'
|
|
37
37
|
import { VTooltip } from 'v-tooltip'
|
|
38
|
-
import { checkContrastColor } from '../../utils/checkColor'
|
|
39
38
|
|
|
40
39
|
VTooltip.options.defaultBoundariesElement = 'window'
|
|
41
40
|
export default {
|
|
@@ -273,7 +272,6 @@ export default {
|
|
|
273
272
|
'mc-button--disabled': this.disabled,
|
|
274
273
|
'mc-button--rounded': this.rounded && /-compact$/.test(this.size),
|
|
275
274
|
'mc-button--semi-rounded': this.semiRounded,
|
|
276
|
-
'mc-button--contrast': this.isContrast,
|
|
277
275
|
'mc-button--full-width': this.fullWidth,
|
|
278
276
|
'mc-button--uppercase': this.uppercase,
|
|
279
277
|
'mc-button--shadow': this.shadow,
|
|
@@ -305,26 +303,13 @@ export default {
|
|
|
305
303
|
type: currentStyle,
|
|
306
304
|
}
|
|
307
305
|
},
|
|
308
|
-
/**
|
|
309
|
-
* Так как сейчас мы используем светлую тему, то проверяем контраст цвета на основе белого
|
|
310
|
-
* Проверяем только для main цветов, так как остальные должны подходить по стандарту
|
|
311
|
-
* TODO: сделать проверку контраста для темных тем + убрать проверку на process.client
|
|
312
|
-
* */
|
|
313
|
-
isContrast() {
|
|
314
|
-
if (!process.client) return
|
|
315
|
-
let [color] = this.variation.split('-') || []
|
|
316
|
-
return color.includes('main') && checkContrastColor(color, [255, 255, 255])
|
|
317
|
-
},
|
|
318
306
|
styles() {
|
|
319
307
|
let hoverBrightness
|
|
320
308
|
let textColor
|
|
321
309
|
switch (this.buttonVariation.type) {
|
|
322
310
|
case 'flat':
|
|
323
311
|
case 'outline':
|
|
324
|
-
case 'invert':
|
|
325
|
-
if (this.isContrast) textColor = 'black'
|
|
326
|
-
break
|
|
327
|
-
}
|
|
312
|
+
case 'invert':
|
|
328
313
|
case 'link':
|
|
329
314
|
textColor = this.buttonVariation.color
|
|
330
315
|
break
|
|
@@ -339,7 +324,7 @@ export default {
|
|
|
339
324
|
break
|
|
340
325
|
}
|
|
341
326
|
default: {
|
|
342
|
-
textColor =
|
|
327
|
+
textColor = 'main-contrast'
|
|
343
328
|
}
|
|
344
329
|
}
|
|
345
330
|
break
|
|
@@ -384,15 +369,15 @@ export default {
|
|
|
384
369
|
tooltipOptions() {
|
|
385
370
|
return this.tooltip
|
|
386
371
|
? {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
372
|
+
content: this.tooltip,
|
|
373
|
+
placement: 'top',
|
|
374
|
+
classes: 'mc-tooltip mc-tooltip--width-m mc-tooltip--size-s',
|
|
375
|
+
trigger: 'hover focus',
|
|
376
|
+
show: false,
|
|
377
|
+
container: 'body',
|
|
378
|
+
template: `<div class="tooltip" role="tooltip"> <div class="tooltip-arrow"></div> <div class="tooltip-inner"><div class="tooltip-inner__content"></div></div> </div>`,
|
|
379
|
+
innerSelector: '.tooltip-inner__content',
|
|
380
|
+
}
|
|
396
381
|
: null
|
|
397
382
|
},
|
|
398
383
|
},
|
|
@@ -405,7 +390,7 @@ export default {
|
|
|
405
390
|
animateUp() {
|
|
406
391
|
if (this.animation) {
|
|
407
392
|
this.customAnimation?.text &&
|
|
408
|
-
|
|
393
|
+
(this.$refs['mc-button'].querySelector('.mc-button__text').innerHTML = this.customAnimation?.text)
|
|
409
394
|
this.custom_background = this.customAnimation?.background
|
|
410
395
|
}
|
|
411
396
|
},
|
|
@@ -466,7 +451,6 @@ export default {
|
|
|
466
451
|
-webkit-appearance: none;
|
|
467
452
|
-webkit-text-fill-color: currentColor;
|
|
468
453
|
z-index: 0;
|
|
469
|
-
|
|
470
454
|
&__loader {
|
|
471
455
|
display: none;
|
|
472
456
|
@include align(true, true, absolute);
|
|
@@ -481,18 +465,6 @@ export default {
|
|
|
481
465
|
align-items: center;
|
|
482
466
|
z-index: 1;
|
|
483
467
|
}
|
|
484
|
-
&--contrast {
|
|
485
|
-
color: var(--mc-button-text-color) !important;
|
|
486
|
-
#{$block-name} {
|
|
487
|
-
&--is-active,
|
|
488
|
-
&.nuxt-link-active {
|
|
489
|
-
color: var(--color-main-dark);
|
|
490
|
-
background-color: transparent;
|
|
491
|
-
border-color: transparent;
|
|
492
|
-
pointer-events: none;
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
468
|
&__text {
|
|
497
469
|
@include ellipsis($display: inline-block);
|
|
498
470
|
@include layout-flex-fix();
|
|
@@ -509,7 +481,6 @@ export default {
|
|
|
509
481
|
}
|
|
510
482
|
}
|
|
511
483
|
}
|
|
512
|
-
|
|
513
484
|
&:active {
|
|
514
485
|
#{$block-name}__background {
|
|
515
486
|
@content;
|
|
@@ -519,7 +490,6 @@ export default {
|
|
|
519
490
|
@include hoverMixin {
|
|
520
491
|
filter: brightness(var(--mc-button-hover-brightness));
|
|
521
492
|
}
|
|
522
|
-
|
|
523
493
|
&--size {
|
|
524
494
|
&-xxs {
|
|
525
495
|
height: $size-300;
|
|
@@ -527,7 +497,6 @@ export default {
|
|
|
527
497
|
letter-spacing: normal;
|
|
528
498
|
font-size: $font-size-200;
|
|
529
499
|
line-height: $line-height-200;
|
|
530
|
-
|
|
531
500
|
&-compact {
|
|
532
501
|
@include size($size-300);
|
|
533
502
|
padding: $space-50;
|
|
@@ -538,7 +507,6 @@ export default {
|
|
|
538
507
|
.mc-svg-icon {
|
|
539
508
|
@include size($size-200);
|
|
540
509
|
}
|
|
541
|
-
|
|
542
510
|
#{$block-name} {
|
|
543
511
|
&__prepend {
|
|
544
512
|
margin-inline-end: $space-50;
|
|
@@ -554,7 +522,6 @@ export default {
|
|
|
554
522
|
letter-spacing: normal;
|
|
555
523
|
font-size: $font-size-200;
|
|
556
524
|
line-height: $line-height-200;
|
|
557
|
-
|
|
558
525
|
&-compact {
|
|
559
526
|
@include size($size-400);
|
|
560
527
|
padding: 6px;
|
|
@@ -565,7 +532,6 @@ export default {
|
|
|
565
532
|
.mc-svg-icon {
|
|
566
533
|
@include size($size-250);
|
|
567
534
|
}
|
|
568
|
-
|
|
569
535
|
#{$block-name} {
|
|
570
536
|
&__prepend {
|
|
571
537
|
margin-inline-end: $space-50;
|
|
@@ -581,7 +547,6 @@ export default {
|
|
|
581
547
|
letter-spacing: normal;
|
|
582
548
|
font-size: $font-size-200;
|
|
583
549
|
line-height: $line-height-200;
|
|
584
|
-
|
|
585
550
|
&-compact {
|
|
586
551
|
@include size($size-500);
|
|
587
552
|
padding: $space-150;
|
|
@@ -592,7 +557,6 @@ export default {
|
|
|
592
557
|
.mc-svg-icon {
|
|
593
558
|
@include size($size-250);
|
|
594
559
|
}
|
|
595
|
-
|
|
596
560
|
#{$block-name} {
|
|
597
561
|
&__prepend {
|
|
598
562
|
margin-inline-end: $space-50;
|
|
@@ -607,7 +571,6 @@ export default {
|
|
|
607
571
|
padding: 0 $space-200;
|
|
608
572
|
font-size: $font-size-200;
|
|
609
573
|
line-height: $line-height-200;
|
|
610
|
-
|
|
611
574
|
&-compact {
|
|
612
575
|
@include size($size-500);
|
|
613
576
|
padding: $space-100;
|
|
@@ -618,7 +581,6 @@ export default {
|
|
|
618
581
|
.mc-svg-icon {
|
|
619
582
|
@include size($size-300);
|
|
620
583
|
}
|
|
621
|
-
|
|
622
584
|
#{$block-name} {
|
|
623
585
|
&__prepend {
|
|
624
586
|
margin-inline-end: $space-50;
|
|
@@ -633,7 +595,6 @@ export default {
|
|
|
633
595
|
padding: $space-150 $space-300;
|
|
634
596
|
font-size: $font-size-200;
|
|
635
597
|
line-height: $line-height-200;
|
|
636
|
-
|
|
637
598
|
&-compact {
|
|
638
599
|
@include size($size-600);
|
|
639
600
|
padding: $space-150;
|
|
@@ -644,7 +605,6 @@ export default {
|
|
|
644
605
|
.mc-svg-icon {
|
|
645
606
|
@include size($size-300);
|
|
646
607
|
}
|
|
647
|
-
|
|
648
608
|
#{$block-name} {
|
|
649
609
|
&__prepend {
|
|
650
610
|
margin-inline-end: $space-100;
|
|
@@ -654,7 +614,6 @@ export default {
|
|
|
654
614
|
}
|
|
655
615
|
}
|
|
656
616
|
}
|
|
657
|
-
|
|
658
617
|
&-s,
|
|
659
618
|
&-m,
|
|
660
619
|
&-l {
|
|
@@ -668,7 +627,6 @@ export default {
|
|
|
668
627
|
}
|
|
669
628
|
}
|
|
670
629
|
}
|
|
671
|
-
|
|
672
630
|
&__background {
|
|
673
631
|
position: absolute;
|
|
674
632
|
top: 0;
|
|
@@ -710,22 +668,9 @@ export default {
|
|
|
710
668
|
opacity: 0.1 !important;
|
|
711
669
|
}
|
|
712
670
|
}
|
|
713
|
-
// TODO check contast colors
|
|
714
|
-
//&#{$block-name}--contrast {
|
|
715
|
-
// #{$block-name} {
|
|
716
|
-
// &__background {
|
|
717
|
-
// opacity: 0.4 !important;
|
|
718
|
-
// }
|
|
719
|
-
// }
|
|
720
|
-
//}
|
|
721
671
|
@include hoverMixin {
|
|
722
672
|
opacity: 0.2 !important;
|
|
723
673
|
}
|
|
724
|
-
//&#{$block-name}--contrast {
|
|
725
|
-
// @include hoverMixin {
|
|
726
|
-
// opacity: 0.6 !important;
|
|
727
|
-
// }
|
|
728
|
-
//}
|
|
729
674
|
}
|
|
730
675
|
&-flat {
|
|
731
676
|
color: var(--mc-button-background-color);
|
|
@@ -745,9 +690,6 @@ export default {
|
|
|
745
690
|
&#{$block-name}--size-l {
|
|
746
691
|
line-height: $line-height-250;
|
|
747
692
|
}
|
|
748
|
-
&#{$block-name}--contrast {
|
|
749
|
-
filter: brightness(80%);
|
|
750
|
-
}
|
|
751
693
|
&#{$block-name} {
|
|
752
694
|
&--disabled {
|
|
753
695
|
opacity: $opacity-disabled;
|
|
@@ -761,7 +703,6 @@ export default {
|
|
|
761
703
|
filter: brightness(0.85);
|
|
762
704
|
}
|
|
763
705
|
}
|
|
764
|
-
|
|
765
706
|
&:active {
|
|
766
707
|
filter: brightness(0.85);
|
|
767
708
|
}
|
|
@@ -787,7 +728,6 @@ export default {
|
|
|
787
728
|
text-decoration: underline !important;
|
|
788
729
|
}
|
|
789
730
|
}
|
|
790
|
-
|
|
791
731
|
&--secondary-color {
|
|
792
732
|
@media #{$media-desktop} {
|
|
793
733
|
&:hover {
|
|
@@ -798,12 +738,10 @@ export default {
|
|
|
798
738
|
color: var(--mc-button-secondary-color);
|
|
799
739
|
}
|
|
800
740
|
}
|
|
801
|
-
|
|
802
741
|
&--uppercase {
|
|
803
742
|
text-transform: uppercase;
|
|
804
743
|
letter-spacing: $letter-spacing-m;
|
|
805
744
|
}
|
|
806
|
-
|
|
807
745
|
&--is-active,
|
|
808
746
|
&.nuxt-link-active {
|
|
809
747
|
color: var(--color-main);
|
|
@@ -811,19 +749,15 @@ export default {
|
|
|
811
749
|
border-color: transparent;
|
|
812
750
|
pointer-events: none;
|
|
813
751
|
}
|
|
814
|
-
|
|
815
752
|
&--rounded {
|
|
816
753
|
border-radius: $radius-circle;
|
|
817
754
|
}
|
|
818
|
-
|
|
819
755
|
&--semi-rounded {
|
|
820
756
|
border-radius: 50px;
|
|
821
757
|
}
|
|
822
|
-
|
|
823
758
|
&--full-width {
|
|
824
759
|
width: 100%;
|
|
825
760
|
}
|
|
826
|
-
|
|
827
761
|
&--text-align {
|
|
828
762
|
&-left {
|
|
829
763
|
justify-content: flex-start;
|
|
@@ -835,20 +769,17 @@ export default {
|
|
|
835
769
|
justify-content: flex-end;
|
|
836
770
|
}
|
|
837
771
|
}
|
|
838
|
-
|
|
839
772
|
&--loading,
|
|
840
773
|
&--icon-loading,
|
|
841
774
|
&--disabled {
|
|
842
775
|
pointer-events: none;
|
|
843
776
|
}
|
|
844
|
-
|
|
845
777
|
&--loading {
|
|
846
778
|
#{$block-name} {
|
|
847
779
|
&__loader {
|
|
848
780
|
display: inline-block;
|
|
849
781
|
}
|
|
850
782
|
}
|
|
851
|
-
|
|
852
783
|
> *:not(#{$block-name}__loader) {
|
|
853
784
|
opacity: 0;
|
|
854
785
|
}
|
|
@@ -863,7 +794,6 @@ export default {
|
|
|
863
794
|
}
|
|
864
795
|
}
|
|
865
796
|
}
|
|
866
|
-
|
|
867
797
|
&--disabled {
|
|
868
798
|
color: $color-outline-gray;
|
|
869
799
|
cursor: not-allowed;
|
|
@@ -874,7 +804,6 @@ export default {
|
|
|
874
804
|
}
|
|
875
805
|
}
|
|
876
806
|
}
|
|
877
|
-
|
|
878
807
|
&--inactive {
|
|
879
808
|
pointer-events: none;
|
|
880
809
|
}
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
<template v-else>
|
|
66
66
|
<mc-button
|
|
67
67
|
v-if="placeholders.week"
|
|
68
|
+
:disabled="checkDisablePeriod('week')"
|
|
68
69
|
variation="black-link"
|
|
69
70
|
secondary-color="main"
|
|
70
71
|
@click="selectPeriod('week')"
|
|
@@ -73,6 +74,7 @@
|
|
|
73
74
|
</mc-button>
|
|
74
75
|
<mc-button
|
|
75
76
|
v-if="placeholders.month"
|
|
77
|
+
:disabled="checkDisablePeriod('month')"
|
|
76
78
|
variation="black-link"
|
|
77
79
|
secondary-color="main"
|
|
78
80
|
@click="selectPeriod('month')"
|
|
@@ -81,6 +83,7 @@
|
|
|
81
83
|
</mc-button>
|
|
82
84
|
<mc-button
|
|
83
85
|
v-if="placeholders.quarter"
|
|
86
|
+
:disabled="checkDisablePeriod('quarter')"
|
|
84
87
|
variation="black-link"
|
|
85
88
|
secondary-color="main"
|
|
86
89
|
@click="selectPeriod('quarter')"
|
|
@@ -89,6 +92,7 @@
|
|
|
89
92
|
</mc-button>
|
|
90
93
|
<mc-button
|
|
91
94
|
v-if="placeholders.year"
|
|
95
|
+
:disabled="checkDisablePeriod('year')"
|
|
92
96
|
variation="black-link"
|
|
93
97
|
secondary-color="main"
|
|
94
98
|
@click="selectPeriod('year')"
|
|
@@ -503,7 +507,14 @@ export default {
|
|
|
503
507
|
}
|
|
504
508
|
}
|
|
505
509
|
},
|
|
506
|
-
|
|
510
|
+
/**
|
|
511
|
+
* Проверяем доступность выбора периода по досупной дате, если есть ограничения
|
|
512
|
+
* */
|
|
513
|
+
checkDisablePeriod(period) {
|
|
514
|
+
const [start] = this.selectPeriod(period)
|
|
515
|
+
return this.disabledDate(start)
|
|
516
|
+
},
|
|
517
|
+
selectPeriod(key, isReturn = false) {
|
|
507
518
|
let start = new Date()
|
|
508
519
|
const end = this.pickDate || new Date()
|
|
509
520
|
switch (key) {
|
|
@@ -536,7 +547,9 @@ export default {
|
|
|
536
547
|
start.setFullYear(end.getFullYear() - 1, end.getMonth(), end.getDate())
|
|
537
548
|
break
|
|
538
549
|
}
|
|
539
|
-
|
|
550
|
+
const period = [dayjs ? start.toDate() : start, end]
|
|
551
|
+
if (isReturn) return period
|
|
552
|
+
this.$refs.input.currentValue = period
|
|
540
553
|
},
|
|
541
554
|
handlerPreselectRange(period) {
|
|
542
555
|
const [start, end] = period
|
|
@@ -717,12 +730,25 @@ export default {
|
|
|
717
730
|
left: $space-200 !important;
|
|
718
731
|
right: $space-200;
|
|
719
732
|
width: fit-content;
|
|
733
|
+
.mx-range-wrapper {
|
|
734
|
+
max-height: 80vh;
|
|
735
|
+
overflow-y: auto;
|
|
736
|
+
}
|
|
737
|
+
.mx-datepicker-footer {
|
|
738
|
+
position: sticky;
|
|
739
|
+
bottom: 0;
|
|
740
|
+
background-color: $color-white;
|
|
741
|
+
}
|
|
720
742
|
}
|
|
721
743
|
|
|
722
744
|
.mx-calendar + .mx-calendar {
|
|
723
745
|
border-left: none;
|
|
724
746
|
}
|
|
725
747
|
|
|
748
|
+
.mx-range-wrapper {
|
|
749
|
+
align-items: center;
|
|
750
|
+
}
|
|
751
|
+
|
|
726
752
|
.mx-calendar {
|
|
727
753
|
width: 256px;
|
|
728
754
|
padding: $space-200;
|
|
@@ -794,6 +820,14 @@ export default {
|
|
|
794
820
|
> * {
|
|
795
821
|
@include child-indent-right($space-300);
|
|
796
822
|
}
|
|
823
|
+
&-periods {
|
|
824
|
+
@include child-indent-right(0);
|
|
825
|
+
column-gap: $space-300;
|
|
826
|
+
row-gap: $space-100;
|
|
827
|
+
align-items: center;
|
|
828
|
+
display: flex;
|
|
829
|
+
flex-wrap: wrap;
|
|
830
|
+
}
|
|
797
831
|
.mc-button {
|
|
798
832
|
@include child-indent-right($space-zero);
|
|
799
833
|
}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<slot />
|
|
28
28
|
</div>
|
|
29
29
|
<!-- @slot Слот футера -->
|
|
30
|
-
<div class="mc-modal__control"><slot name="footer" /><portal-target name="mcModalFooter" slim /></div>
|
|
30
|
+
<div ref="mcModalFooter" class="mc-modal__control"><slot name="footer" /><portal-target name="mcModalFooter" slim /></div>
|
|
31
31
|
</div>
|
|
32
32
|
<button v-if="arrowVisible" type="button" class="mc-modal__btn-back" @click.prevent="handleBack">
|
|
33
33
|
<mc-svg-icon name="arrow_leftward" class="mc-modal__icon-back" />
|
|
@@ -133,6 +133,7 @@ export default {
|
|
|
133
133
|
indent: {
|
|
134
134
|
regular: 400,
|
|
135
135
|
small: 150,
|
|
136
|
+
extra_small: 50,
|
|
136
137
|
},
|
|
137
138
|
footer: {
|
|
138
139
|
button: {
|
|
@@ -168,6 +169,7 @@ export default {
|
|
|
168
169
|
return {
|
|
169
170
|
'--mc-modal-padding': `var(--space-${this.indent.regular})`,
|
|
170
171
|
'--mc-modal-padding-small': `var(--space-${this.indent.small})`,
|
|
172
|
+
'--mc-modal-padding-extra-small': `var(--space-${this.indent.extra_small})`,
|
|
171
173
|
'--mc-modal-header-line-height': `var(--line-height-${this.header.title.line_height.regular})`,
|
|
172
174
|
'--mc-modal-header-line-height-small': `var(--line-height-${this.header.title.line_height.small})`,
|
|
173
175
|
'--mc-modal-button-height': `var(--size-${this.footer.button.regular})`,
|
|
@@ -236,19 +238,32 @@ export default {
|
|
|
236
238
|
},
|
|
237
239
|
|
|
238
240
|
calculateIndents() {
|
|
239
|
-
/* Если шапка уже маленькая, то отключаем при отключении сепаратора
|
|
240
|
-
* Иначе смотрим, чтобы отступ был > чем убираемые отступы, т.к. нет смысла сжимать шапку, если <
|
|
241
|
-
*/
|
|
242
|
-
const indentDifferences =
|
|
243
|
-
(this.modal_params?.['--mc-modal-padding'] - this.modal_params?.['--mc-modal-padding-small']) * 3 +
|
|
244
|
-
this.modal_params?.['--mc-modal-padding-small']
|
|
245
|
-
const lineHeightDifferences =
|
|
246
|
-
this.modal_params?.['--mc-modal-header-line-height'] -
|
|
247
|
-
this.modal_params?.['--mc-modal-header-line-height-small']
|
|
248
|
-
const buttonDifferences =
|
|
249
|
-
this.modal_params?.['--mc-modal-button-height'] - this.modal_params?.['--mc-modal-button-height-small']
|
|
250
|
-
const sizeDifferences = indentDifferences + lineHeightDifferences + buttonDifferences
|
|
251
241
|
if (!this.small_indents) {
|
|
242
|
+
/* Если шапка уже маленькая, то отключаем при отключении сепаратора
|
|
243
|
+
* Иначе смотрим, чтобы отступ был > чем убираемые отступы, т.к. нет смысла сжимать шапку, если <
|
|
244
|
+
* 1,2 - отступы в шапке уменьшаются с 32 до 12 сверху и снизу
|
|
245
|
+
* 3 - отступы в футере: нижний уменьшается с 32 до 12
|
|
246
|
+
* 4 - отступ в футере верхний уменьшается с 16 до 12
|
|
247
|
+
* 5 - отступ в боди уменьшается с 16 до 4
|
|
248
|
+
* итого (32 - 12) * 3 + 12 + 4 - тотал уменьшения отступов
|
|
249
|
+
* если футер пустой, то умножаем на 2
|
|
250
|
+
*/
|
|
251
|
+
const totalBtns = this.$refs.mcModalFooter?.querySelectorAll('.mc-button')?.length
|
|
252
|
+
const smallerElementsAmount = totalBtns ? 3 : 2
|
|
253
|
+
const indentDifferences =
|
|
254
|
+
(this.modal_params?.['--mc-modal-padding'] - this.modal_params?.['--mc-modal-padding-small']) *
|
|
255
|
+
smallerElementsAmount +
|
|
256
|
+
(this.modal_params?.['--mc-modal-padding-small'] +
|
|
257
|
+
this.modal_params?.['--mc-modal-padding-extra-small'])
|
|
258
|
+
const lineHeightDifferences =
|
|
259
|
+
this.modal_params?.['--mc-modal-header-line-height'] -
|
|
260
|
+
this.modal_params?.['--mc-modal-header-line-height-small']
|
|
261
|
+
const buttonDifferences =
|
|
262
|
+
this.modal_params?.['--mc-modal-button-height'] -
|
|
263
|
+
this.modal_params?.['--mc-modal-button-height-small']
|
|
264
|
+
// Смотрим разницу размеров с учетом кол-ва кнопок в модалке + добавляем за каждую кнопку 1px погрешности для отображения бордера
|
|
265
|
+
const sizeDifferences =
|
|
266
|
+
indentDifferences + lineHeightDifferences + buttonDifferences * totalBtns + totalBtns
|
|
252
267
|
const body = this.$refs.mcModalBody
|
|
253
268
|
this.can_shorten_modal = body?.scrollHeight - body?.clientHeight > sizeDifferences
|
|
254
269
|
}
|
|
@@ -276,12 +276,12 @@ export default {
|
|
|
276
276
|
}
|
|
277
277
|
@include col-right-color($vxe-table-row-hover-background-color);
|
|
278
278
|
&.row--current {
|
|
279
|
-
@include col-right-color(
|
|
279
|
+
@include col-right-color(transparent);
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
&.row--current {
|
|
283
283
|
background-color: var(--color-main-alpha-10) !important;
|
|
284
|
-
@include col-right-color(
|
|
284
|
+
@include col-right-color(transparent);
|
|
285
285
|
}
|
|
286
286
|
// описка названия в библиотеке таблицы
|
|
287
287
|
&.row--cheched {
|
package/src/styles/global.scss
CHANGED
|
@@ -123,12 +123,12 @@ a {
|
|
|
123
123
|
|
|
124
124
|
::selection {
|
|
125
125
|
background: var(--color-main);
|
|
126
|
-
color:
|
|
126
|
+
color: var(--color-main-contrast);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
::-moz-selection {
|
|
130
130
|
background: var(--color-main);
|
|
131
|
-
color:
|
|
131
|
+
color: var(--color-main-contrast);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
input,
|
|
@@ -289,6 +289,7 @@ pre {
|
|
|
289
289
|
#{'--color-'}#{$name}: #{$color};
|
|
290
290
|
}
|
|
291
291
|
// Default main project colors
|
|
292
|
+
--color-main-contrast: $color-white;
|
|
292
293
|
--color-main: $color-purple;
|
|
293
294
|
--color-main-dark: $color-hover-purple;
|
|
294
295
|
@for $i from 1 through 10 {
|
|
@@ -8,7 +8,7 @@ $gradient-blue: linear-gradient(180deg, #1ADBFE 0%, #3580F8 100%); /* Нотиф
|
|
|
8
8
|
$gradient-yellow: linear-gradient(180deg, #FEE41A 0%, #F89B35 100%); /* Столбики в графике 3 порядка */
|
|
9
9
|
$gradient-green: linear-gradient(180deg, #C9DD4C 0%, #63BE7E 100%); /* Столбики в графике 2 порядка */
|
|
10
10
|
$gradient-red: linear-gradient(180deg, #F26567 0%, #F79440 100%); /* Столбики в графике 1 порядка */
|
|
11
|
-
$gradient-purple: linear-gradient(270deg, var(--color-main
|
|
11
|
+
$gradient-purple: linear-gradient(270deg, var(--color-main) 0%, var(--color-main-dark) 100%); /* Основной градиент для MCPay */
|
|
12
12
|
$gradient-purple-pink: linear-gradient(90deg, var(--color-main) 2%, #fe6ffc 100%); /*Градиент промоакции*/
|
|
13
13
|
$gradient-blue-purple: linear-gradient(90deg, #18bfe3 20%, var(--color-main) 70%); /*Градиент промоакции*/
|
|
14
14
|
$gradient-dark-blue: linear-gradient(90deg, #5550EF 0%, var(--color-main) 100%); /*Градиент автоплатежей*/
|
package/src/utils/checkColor.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export function hexToRGB(hex, alpha, byArray = false) {
|
|
2
|
-
const r = parseInt(hex.slice(1, 3), 16)
|
|
3
|
-
const g = parseInt(hex.slice(3, 5), 16)
|
|
4
|
-
const b = parseInt(hex.slice(5, 7), 16)
|
|
5
|
-
if (byArray) return [r, g, b]
|
|
6
|
-
const rgb_color = `${r}, ${g}, ${b}`
|
|
7
|
-
return alpha ? `rgba(${rgb_color}, ${alpha})` : `rgb(${rgb_color})`
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Проверяем контрастность по формуле
|
|
12
|
-
* https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-procedure
|
|
13
|
-
* bgColor -
|
|
14
|
-
* */
|
|
15
|
-
export function checkContrastColor(colorName, bgColor) {
|
|
16
|
-
const RED = 0.2126
|
|
17
|
-
const GREEN = 0.7152
|
|
18
|
-
const BLUE = 0.0722
|
|
19
|
-
const GAMMA = 2.4
|
|
20
|
-
|
|
21
|
-
function luminance(r, g, b) {
|
|
22
|
-
const a = [r, g, b].map(v => {
|
|
23
|
-
v /= 255
|
|
24
|
-
return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, GAMMA)
|
|
25
|
-
})
|
|
26
|
-
return a[0] * RED + a[1] * GREEN + a[2] * BLUE
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function contrast(rgb1, rgb2) {
|
|
30
|
-
const lum1 = luminance(...rgb2)
|
|
31
|
-
const lum2 = luminance(...rgb1)
|
|
32
|
-
const brightest = Math.max(lum1, lum2)
|
|
33
|
-
const darkest = Math.min(lum1, lum2)
|
|
34
|
-
return (brightest + 0.05) / (darkest + 0.05)
|
|
35
|
-
}
|
|
36
|
-
const color = getComputedStyle(document.querySelector(':root')).getPropertyValue(`--color-${colorName}`) || colorName
|
|
37
|
-
return contrast(hexToRGB(color, null, true), bgColor) < 4
|
|
38
|
-
}
|