mediacube-ui 0.1.347 → 0.1.349
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/dist/mediacube-ui.common.js +384 -0
- package/package.json +11 -4
- package/src/elements/McAvatar/McAvatar.vue +276 -0
- package/src/elements/McBadge/McBadge.vue +153 -0
- package/src/elements/McButton/McButton.vue +850 -0
- package/src/elements/McChip/McChip.vue +305 -0
- package/src/elements/McCropper/McCropper.vue +135 -0
- package/src/elements/McDate/McDate.vue +107 -0
- package/src/elements/McDatePicker/McDatePicker.vue +910 -0
- package/src/elements/McField/McFieldCheckbox/McFieldCheckbox.vue +339 -0
- package/src/elements/McField/McFieldRadio/McFieldRadioButton/McFieldRadioButton.vue +207 -0
- package/src/elements/McField/McFieldRadio/McFieldRadioGroup/McFieldRadioGroup.vue +198 -0
- package/src/elements/McField/McFieldSelect/McFieldSelect.vue +1088 -0
- package/src/elements/McField/McFieldText/McFieldText.vue +977 -0
- package/src/elements/McField/McFieldToggle/McFieldToggle.vue +273 -0
- package/src/elements/McInfinityLoadingIndicator/McInfinityLoadingIndicator.vue +97 -0
- package/src/elements/McNotification/McNotification.vue +215 -0
- package/src/elements/McProgress/McProgress.vue +223 -0
- package/src/elements/McRangeSlider/McRangeSlider.vue +199 -0
- package/src/elements/McSeparator/McSeparator.vue +143 -0
- package/src/elements/McSlideUpDown/McSlideUpDown.vue +157 -0
- package/src/elements/McSvgIcon/McSvgIcon.vue +128 -0
- package/src/elements/McTabs/McTab/McTab.vue +189 -0
- package/src/elements/McTabs/McTabs/McTabs.vue +538 -0
- package/src/elements/McTitle/McTitle.vue +370 -0
- package/src/elements/McTooltip/McTooltip.vue +339 -0
- package/src/helpers/consts.js +3 -0
- package/src/helpers/delayedAction.js +26 -0
- package/src/helpers/storybookFunctions.js +19 -0
- package/src/helpers/storybookVariables.js +24 -0
- package/src/mixins/equalFieldHeight.js +59 -0
- package/src/mixins/fieldErrors.js +28 -0
- package/src/patterns/McAccordion/McAccordion.vue +53 -0
- package/src/patterns/McCells/McCell/McCell.vue +102 -0
- package/src/patterns/McChat/McChat.vue +306 -0
- package/src/patterns/McChat/McChatComment/McChatComment.vue +268 -0
- package/src/patterns/McChat/McChatForm/McChatForm.vue +150 -0
- package/src/patterns/McCollapse/McCollapse.vue +282 -0
- package/src/patterns/McDrawer/McDrawer.vue +150 -0
- package/src/patterns/McDropdown/McDropdown.vue +249 -0
- package/src/patterns/McDropdown/McDropdownPanel/McDropdownPanel.vue +44 -0
- package/src/patterns/McFakeScroll/McFakeScroll.vue +279 -0
- package/src/patterns/McFilter/McFilter.vue +847 -0
- package/src/patterns/McFilter/McFilterChip/McFilterChip.vue +85 -0
- package/src/patterns/McFilter/McFilterTags/McFilterTags.vue +376 -0
- package/src/patterns/McFilter/McFilterTypeDate/McFilterTypeDate.vue +70 -0
- package/src/patterns/McFilter/McFilterTypeRange/McFilterTypeRange.vue +133 -0
- package/src/patterns/McFilter/McFilterTypeRelation/McFilterTypeRelation.vue +224 -0
- package/src/patterns/McFilter/McFilterTypeSimple/McFilterTypeSimple.vue +164 -0
- package/src/patterns/McFilter/McFilterTypeText/McFilterTypeText.vue +62 -0
- package/src/patterns/McGrid/McGridCol/McGridCol.vue +166 -0
- package/src/patterns/McGrid/McGridRow/McGridRow.vue +158 -0
- package/src/patterns/McModal/McModal.vue +686 -0
- package/src/patterns/McOverlay/McOverlay.vue +79 -0
- package/src/patterns/McPreview/McPreview.vue +119 -0
- package/src/patterns/McSideBar/McSideBar/McSideBar.vue +389 -0
- package/src/patterns/McSideBar/McSideBarBottom/McSideBarBottom.vue +126 -0
- package/src/patterns/McSideBar/McSideBarButton/McSideBarButton.vue +257 -0
- package/src/patterns/McSideBar/McSideBarCenter/McSideBarCenter.vue +369 -0
- package/src/patterns/McSideBar/McSideBarTop/McSideBarTop.vue +243 -0
- package/src/patterns/McStack/McStack.vue +163 -0
- package/src/patterns/McTable/McTable/McTable.vue +860 -0
- package/src/patterns/McTable/McTableCol/McTableCol.vue +299 -0
- package/src/patterns/McTableCard/McTableCard.vue +138 -0
- package/src/patterns/McTableCard/McTableCardHeader/McTableCardHeader.vue +76 -0
- package/src/patterns/McTopBar/McTopBar.vue +155 -0
- package/src/patterns/McWrapScroll/McWrapScroll.vue +293 -0
- package/src/styles/_functions.scss +189 -0
- package/src/styles/_mixins.scss +619 -0
- package/src/styles/_spacing.scss +33 -0
- package/src/styles/_variables.scss +23 -0
- package/src/styles/global.scss +311 -0
- package/src/styles/main.scss +4 -0
- package/src/styles/table.scss +12 -0
- package/src/styles/toast.scss +59 -0
- package/src/templates/layouts/McContentFixed/McContentFixed.vue +60 -0
- package/src/templates/layouts/McMain/McMain.vue +115 -0
- package/src/templates/layouts/McRoot/McRoot.vue +45 -0
- package/src/tokens/animations.scss +9 -0
- package/src/tokens/border-radius.scss +26 -0
- package/src/tokens/box-shadows.scss +28 -0
- package/src/tokens/colors.scss +82 -0
- package/src/tokens/durations.scss +7 -0
- package/src/tokens/easings.scss +6 -0
- package/src/tokens/font-families.scss +8 -0
- package/src/tokens/font-sizes.scss +23 -0
- package/src/tokens/font-weights.scss +9 -0
- package/src/tokens/gradients.scss +19 -0
- package/src/tokens/letter-spacings.scss +6 -0
- package/src/tokens/line-heights.scss +22 -0
- package/src/tokens/media-queries.scss +32 -0
- package/src/tokens/opacities.scss +8 -0
- package/src/tokens/sizes.scss +47 -0
- package/src/tokens/spacings.scss +38 -0
- package/src/tokens/z-indexes.scss +14 -0
- package/src/utils/dayjs.js +19 -0
- package/src/utils/filters.js +11 -0
- package/src/utils/getTokens.js +41 -0
- package/src/utils/load-icons.js +3 -0
- package/src/utils/treeSearch.js +30 -0
- package/src/utils/webFontLoader.js +12 -0
- package/dist/0.mediacube-ui.umd.js +0 -50
- package/dist/assets/img/icons.3b7d59b2f49c67a2a3a4566b8ab233fd.svg +0 -1
- package/dist/assets/img/no_table_data.236cd56f46cfb71fc363b008d4ca70d5.png +0 -0
- package/dist/assets/img/no_user.e0030d6e54e2400e1181fd22b83cf8ae.png +0 -0
- package/dist/mediacube-ui.umd.js +0 -1
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section ref="overlay" class="mc-overlay" :style="styles">
|
|
3
|
+
<div class="mc-overlay__background" />
|
|
4
|
+
<section class="mc-overlay__spinner" />
|
|
5
|
+
</section>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
export default {
|
|
10
|
+
name: 'McOverlaySecond',
|
|
11
|
+
props: {
|
|
12
|
+
size: {
|
|
13
|
+
type: [String, Number],
|
|
14
|
+
default: 500,
|
|
15
|
+
},
|
|
16
|
+
backgroundColor: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: 'white',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
computed: {
|
|
22
|
+
styles() {
|
|
23
|
+
return {
|
|
24
|
+
'--mc-overlay-color': this.backgroundColor && `var(--color-${this.backgroundColor})`,
|
|
25
|
+
'--mc-overlay-spinner-size': this.size && `var(--size-${this.size})`,
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<style lang="scss">
|
|
33
|
+
@import '../../tokens/z-indexes';
|
|
34
|
+
@import '../../tokens/colors';
|
|
35
|
+
.mc-overlay {
|
|
36
|
+
$block-name: &;
|
|
37
|
+
--mc-overlay-spinner-size: initial;
|
|
38
|
+
--mc-overlay-color: initial;
|
|
39
|
+
position: absolute;
|
|
40
|
+
top: 0;
|
|
41
|
+
inset-inline-start: 0;
|
|
42
|
+
width: 100%;
|
|
43
|
+
height: 100%;
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
z-index: $z-index-overlay-page;
|
|
48
|
+
&__background {
|
|
49
|
+
position: absolute;
|
|
50
|
+
left: 0;
|
|
51
|
+
right: 0;
|
|
52
|
+
width: 100%;
|
|
53
|
+
height: 100%;
|
|
54
|
+
background-color: var(--mc-overlay-color);
|
|
55
|
+
opacity: 0.85;
|
|
56
|
+
}
|
|
57
|
+
&__spinner {
|
|
58
|
+
display: block;
|
|
59
|
+
border: 2px solid $color-purple;
|
|
60
|
+
border-inline-start-color: transparent;
|
|
61
|
+
border-radius: 50%;
|
|
62
|
+
animation: rotate 1.5s infinite linear;
|
|
63
|
+
|
|
64
|
+
width: var(--mc-overlay-spinner-size);
|
|
65
|
+
min-width: var(--mc-overlay-spinner-size);
|
|
66
|
+
height: var(--mc-overlay-spinner-size);
|
|
67
|
+
min-height: var(--mc-overlay-spinner-size);
|
|
68
|
+
|
|
69
|
+
@keyframes rotate {
|
|
70
|
+
from {
|
|
71
|
+
transform: rotate(0deg);
|
|
72
|
+
}
|
|
73
|
+
to {
|
|
74
|
+
transform: rotate(360deg);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
</style>
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section :class="classes">
|
|
3
|
+
<div v-if="$slots.left" class="mc-preview__left">
|
|
4
|
+
<!-- @slot Слот слева -->
|
|
5
|
+
<slot name="left" />
|
|
6
|
+
</div>
|
|
7
|
+
<div class="mc-preview__center">
|
|
8
|
+
<div class="mc-preview__top">
|
|
9
|
+
<!-- @slot Слот сверху -->
|
|
10
|
+
<slot name="top" />
|
|
11
|
+
</div>
|
|
12
|
+
<div class="mc-preview__bottom">
|
|
13
|
+
<!-- @slot Слот внизу -->
|
|
14
|
+
<slot name="bottom" />
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
<div v-if="$slots.right" class="mc-preview__right">
|
|
18
|
+
<!-- @slot Слот справа -->
|
|
19
|
+
<slot name="right" />
|
|
20
|
+
</div>
|
|
21
|
+
</section>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
export default {
|
|
26
|
+
name: 'McPreview',
|
|
27
|
+
props: {
|
|
28
|
+
/**
|
|
29
|
+
* Размеры:
|
|
30
|
+
* `s, m, l`
|
|
31
|
+
*/
|
|
32
|
+
size: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: 'm',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
computed: {
|
|
38
|
+
classes() {
|
|
39
|
+
return {
|
|
40
|
+
'mc-preview': true,
|
|
41
|
+
[`mc-preview--size-${this.size}`]: this.size,
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<style lang="scss">
|
|
49
|
+
@import '../../styles/mixins';
|
|
50
|
+
@import '../../tokens/spacings';
|
|
51
|
+
.mc-preview {
|
|
52
|
+
$block-name: &;
|
|
53
|
+
|
|
54
|
+
@include reset-text-indents();
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-wrap: nowrap;
|
|
57
|
+
max-width: 100%;
|
|
58
|
+
|
|
59
|
+
&__left {
|
|
60
|
+
flex: 0 0 auto;
|
|
61
|
+
&:empty {
|
|
62
|
+
display: none;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&__center {
|
|
67
|
+
@include layout-flex-fix();
|
|
68
|
+
flex: 1 1 auto;
|
|
69
|
+
align-self: center;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&__top {
|
|
73
|
+
&:empty {
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&__bottom {
|
|
79
|
+
&:empty {
|
|
80
|
+
display: none;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&__right {
|
|
85
|
+
flex: 0 0 auto;
|
|
86
|
+
&:empty {
|
|
87
|
+
display: none;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
@mixin previewIndents($indent, $bottom: '') {
|
|
91
|
+
#{$block-name}__left {
|
|
92
|
+
margin-inline-end: $indent;
|
|
93
|
+
}
|
|
94
|
+
#{$block-name}__right {
|
|
95
|
+
margin-inline-start: $indent;
|
|
96
|
+
}
|
|
97
|
+
@if $bottom {
|
|
98
|
+
#{$block-name}__bottom {
|
|
99
|
+
margin-top: $bottom;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&--size {
|
|
105
|
+
&-s {
|
|
106
|
+
@include previewIndents($space-50);
|
|
107
|
+
}
|
|
108
|
+
&-m {
|
|
109
|
+
@include previewIndents($space-100);
|
|
110
|
+
}
|
|
111
|
+
&-l {
|
|
112
|
+
@include previewIndents($space-150, $space-50);
|
|
113
|
+
}
|
|
114
|
+
&-xl {
|
|
115
|
+
@include previewIndents($space-200, $space-50);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
</style>
|
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<article ref="sidebar-wrapper" class="mc-side-bar-wrapper" :style="wrapperStyles">
|
|
3
|
+
<section class="mc-side-bar-wrapper__backdrop" :class="backdropClasses" @click.stop.prevent="handleToggleSize">
|
|
4
|
+
<div ref="sidebar" class="mc-side-bar" :class="sideBarClasses" :style="sideBarStyles" @click.stop>
|
|
5
|
+
<mc-side-bar-top
|
|
6
|
+
:logo-title="logoTitle"
|
|
7
|
+
:logo-title-variation="logoTitleVariation"
|
|
8
|
+
:logo-src="logoSrc"
|
|
9
|
+
:logo-icon="logoIcon"
|
|
10
|
+
:compact="prettyCompact"
|
|
11
|
+
:menu-apps="menuApps"
|
|
12
|
+
>
|
|
13
|
+
<slot slot="title-append" name="title-append" />
|
|
14
|
+
</mc-side-bar-top>
|
|
15
|
+
<section class="mc-side-bar__scrollable-container">
|
|
16
|
+
<mc-side-bar-center
|
|
17
|
+
:title="menuMainTitle"
|
|
18
|
+
:menu-main="menuMain"
|
|
19
|
+
:counts="counts"
|
|
20
|
+
:chatra-config="chatraConfig"
|
|
21
|
+
:user="user"
|
|
22
|
+
:compact="prettyCompact"
|
|
23
|
+
@handlerChatraClick="$emit('chatraClick')"
|
|
24
|
+
@open-side-bar="openSideBar"
|
|
25
|
+
/>
|
|
26
|
+
<mc-side-bar-bottom
|
|
27
|
+
:hide-text="hideText"
|
|
28
|
+
:compact="prettyCompact"
|
|
29
|
+
:hidden-mode="hiddenMode"
|
|
30
|
+
:sidebar-width="width"
|
|
31
|
+
@toggle-size="handleToggleSize"
|
|
32
|
+
>
|
|
33
|
+
<slot slot="bottom-message" name="bottom-message" />
|
|
34
|
+
</mc-side-bar-bottom>
|
|
35
|
+
</section>
|
|
36
|
+
</div>
|
|
37
|
+
</section>
|
|
38
|
+
</article>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script>
|
|
42
|
+
import McSideBarTop from '../McSideBarTop/McSideBarTop'
|
|
43
|
+
import McSideBarCenter from '../McSideBarCenter/McSideBarCenter'
|
|
44
|
+
import McSideBarBottom from '../McSideBarBottom/McSideBarBottom'
|
|
45
|
+
export default {
|
|
46
|
+
name: 'McSideBar',
|
|
47
|
+
components: {
|
|
48
|
+
McSideBarTop,
|
|
49
|
+
McSideBarCenter,
|
|
50
|
+
McSideBarBottom,
|
|
51
|
+
},
|
|
52
|
+
provide() {
|
|
53
|
+
const provideData = {}
|
|
54
|
+
const properties = ['currentThemeConfig']
|
|
55
|
+
properties.forEach(property => {
|
|
56
|
+
Object.defineProperty(provideData, property, {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: () => this[property],
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
return { provideData }
|
|
62
|
+
},
|
|
63
|
+
props: {
|
|
64
|
+
/**
|
|
65
|
+
* Название сервиса
|
|
66
|
+
*
|
|
67
|
+
*/
|
|
68
|
+
logoTitle: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: 'Dashboard',
|
|
71
|
+
},
|
|
72
|
+
/**
|
|
73
|
+
* Размер текста названия сервиса
|
|
74
|
+
*
|
|
75
|
+
*/
|
|
76
|
+
logoTitleVariation: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: 'subtitle',
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* Путь до изображения
|
|
82
|
+
*
|
|
83
|
+
*/
|
|
84
|
+
logoSrc: {
|
|
85
|
+
type: String,
|
|
86
|
+
default: '',
|
|
87
|
+
},
|
|
88
|
+
/**
|
|
89
|
+
* Имя иконки
|
|
90
|
+
* заголовка
|
|
91
|
+
*/
|
|
92
|
+
logoIcon: {
|
|
93
|
+
type: String,
|
|
94
|
+
default: '',
|
|
95
|
+
},
|
|
96
|
+
/**
|
|
97
|
+
* Заголовок
|
|
98
|
+
* центрального блока
|
|
99
|
+
*/
|
|
100
|
+
menuMainTitle: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: '',
|
|
103
|
+
},
|
|
104
|
+
/**
|
|
105
|
+
* Центральное меню
|
|
106
|
+
*
|
|
107
|
+
*/
|
|
108
|
+
menuMain: {
|
|
109
|
+
type: Array,
|
|
110
|
+
default: () => [],
|
|
111
|
+
},
|
|
112
|
+
/**
|
|
113
|
+
* Каунты для пунктов меню
|
|
114
|
+
* вставляются в пункты с ключем 'count_key'
|
|
115
|
+
*
|
|
116
|
+
*/
|
|
117
|
+
counts: {
|
|
118
|
+
type: Object,
|
|
119
|
+
default: () => ({}),
|
|
120
|
+
},
|
|
121
|
+
/**
|
|
122
|
+
* Меню приложений
|
|
123
|
+
*
|
|
124
|
+
*/
|
|
125
|
+
menuApps: {
|
|
126
|
+
type: Array,
|
|
127
|
+
default: () => [],
|
|
128
|
+
},
|
|
129
|
+
/**
|
|
130
|
+
* Id чатры
|
|
131
|
+
*
|
|
132
|
+
*/
|
|
133
|
+
chatraConfig: {
|
|
134
|
+
type: Object,
|
|
135
|
+
default: null,
|
|
136
|
+
},
|
|
137
|
+
/**
|
|
138
|
+
* Данные пользователя
|
|
139
|
+
*
|
|
140
|
+
*/
|
|
141
|
+
user: {
|
|
142
|
+
type: Object,
|
|
143
|
+
default: null,
|
|
144
|
+
},
|
|
145
|
+
/**
|
|
146
|
+
* Текст кнопки
|
|
147
|
+
* сворачивания меню
|
|
148
|
+
*/
|
|
149
|
+
hideText: {
|
|
150
|
+
type: String,
|
|
151
|
+
default: '',
|
|
152
|
+
},
|
|
153
|
+
/**
|
|
154
|
+
* Компактный вид
|
|
155
|
+
*/
|
|
156
|
+
compact: {
|
|
157
|
+
type: Boolean,
|
|
158
|
+
default: false,
|
|
159
|
+
},
|
|
160
|
+
/**
|
|
161
|
+
* Цветовая схема
|
|
162
|
+
*/
|
|
163
|
+
variable: {
|
|
164
|
+
type: String,
|
|
165
|
+
default: 'black',
|
|
166
|
+
},
|
|
167
|
+
/**
|
|
168
|
+
* Ширина сайдбара
|
|
169
|
+
*/
|
|
170
|
+
width: {
|
|
171
|
+
type: String,
|
|
172
|
+
default: '216px',
|
|
173
|
+
},
|
|
174
|
+
/**
|
|
175
|
+
* Ширина компактного сайдбара
|
|
176
|
+
*/
|
|
177
|
+
compactWidth: {
|
|
178
|
+
type: String,
|
|
179
|
+
default: '58px',
|
|
180
|
+
},
|
|
181
|
+
/**
|
|
182
|
+
* Брейкпоинт после которого
|
|
183
|
+
* сайдбар становится абсолютным и появляется затемненный бэкдроп
|
|
184
|
+
*/
|
|
185
|
+
absoluteBreakpoint: {
|
|
186
|
+
type: Number,
|
|
187
|
+
default: null,
|
|
188
|
+
},
|
|
189
|
+
/**
|
|
190
|
+
* Брейкпоинт после которого
|
|
191
|
+
* сайдбар полностью прячется
|
|
192
|
+
*/
|
|
193
|
+
hiddenBreakpoint: {
|
|
194
|
+
type: Number,
|
|
195
|
+
default: null,
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
data() {
|
|
199
|
+
return {
|
|
200
|
+
isHidden: false,
|
|
201
|
+
prettyCompact: this.compact,
|
|
202
|
+
hasCompactClass: this.compact,
|
|
203
|
+
windowWidth: null,
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
computed: {
|
|
207
|
+
sideBarClasses() {
|
|
208
|
+
return {
|
|
209
|
+
'mc-side-bar--compact': this.hasCompactClass,
|
|
210
|
+
[this.currentThemeConfig.className]: true,
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
sideBarStyles() {
|
|
214
|
+
return {
|
|
215
|
+
overflow: `${this.isHidden ? 'hidden' : 'visible'}`,
|
|
216
|
+
width: this.hasCompactClass ? this.compactWidth : this.width,
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
wrapperStyles() {
|
|
220
|
+
const position =
|
|
221
|
+
this.hiddenMode && this.hasCompactClass
|
|
222
|
+
? {
|
|
223
|
+
position: 'absolute',
|
|
224
|
+
left: `-${this.compactWidth}`,
|
|
225
|
+
}
|
|
226
|
+
: {}
|
|
227
|
+
|
|
228
|
+
let width = {
|
|
229
|
+
width: this.hasCompactClass ? this.compactWidth : this.width,
|
|
230
|
+
}
|
|
231
|
+
if (this.absoluteMode) {
|
|
232
|
+
width.width = this.compactWidth
|
|
233
|
+
}
|
|
234
|
+
if (this.hiddenMode) {
|
|
235
|
+
width.width = '0px'
|
|
236
|
+
}
|
|
237
|
+
return {
|
|
238
|
+
...width,
|
|
239
|
+
...position,
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
backdropClasses() {
|
|
243
|
+
return {
|
|
244
|
+
'mc-side-bar-wrapper__backdrop--full-width':
|
|
245
|
+
!this.hasCompactClass && this.windowWidth < this.absoluteBreakpoint,
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
absoluteMode() {
|
|
249
|
+
return this.absoluteBreakpoint && this.windowWidth < this.absoluteBreakpoint
|
|
250
|
+
},
|
|
251
|
+
hiddenMode() {
|
|
252
|
+
return this.hiddenBreakpoint && this.windowWidth < this.hiddenBreakpoint
|
|
253
|
+
},
|
|
254
|
+
currentThemeConfig() {
|
|
255
|
+
return this.sidebarThemeConfig[this.variable] || this.sidebarThemeConfig['black']
|
|
256
|
+
},
|
|
257
|
+
sidebarThemeConfig() {
|
|
258
|
+
return {
|
|
259
|
+
black: {
|
|
260
|
+
mode: 'black',
|
|
261
|
+
className: 'mc-side-bar--color-theme-black',
|
|
262
|
+
dropdownActivator: 'white',
|
|
263
|
+
mainMenuLinks: {
|
|
264
|
+
variable: 'gray-flat',
|
|
265
|
+
secondaryColor: 'white',
|
|
266
|
+
},
|
|
267
|
+
closeButton: {
|
|
268
|
+
variable: 'gray-link',
|
|
269
|
+
secondaryColor: 'white',
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
white: {
|
|
273
|
+
mode: 'white',
|
|
274
|
+
className: 'mc-side-bar--color-theme-white',
|
|
275
|
+
dropdownActivator: 'black',
|
|
276
|
+
mainMenuLinks: {
|
|
277
|
+
variable: 'black-flat',
|
|
278
|
+
secondaryColor: 'purple',
|
|
279
|
+
},
|
|
280
|
+
closeButton: {
|
|
281
|
+
variable: 'black-link',
|
|
282
|
+
secondaryColor: 'purple',
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
watch: {
|
|
289
|
+
hasCompactClass(newValue) {
|
|
290
|
+
if (newValue) {
|
|
291
|
+
setTimeout(() => {
|
|
292
|
+
this.prettyCompact = newValue
|
|
293
|
+
}, 280)
|
|
294
|
+
} else {
|
|
295
|
+
this.prettyCompact = newValue
|
|
296
|
+
}
|
|
297
|
+
this.isHidden = true
|
|
298
|
+
setTimeout(() => {
|
|
299
|
+
this.isHidden = false
|
|
300
|
+
}, 280)
|
|
301
|
+
},
|
|
302
|
+
compact(newValue) {
|
|
303
|
+
this.hasCompactClass = newValue
|
|
304
|
+
},
|
|
305
|
+
absoluteMode: {
|
|
306
|
+
immediate: true,
|
|
307
|
+
handler(val) {
|
|
308
|
+
this.$emit('absolute-mode', val)
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
hiddenMode: {
|
|
312
|
+
immediate: true,
|
|
313
|
+
handler(val) {
|
|
314
|
+
this.$emit('hidden-mode', val)
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
mounted() {
|
|
319
|
+
if (this.absoluteBreakpoint || (this.hiddenBreakpoint && window)) {
|
|
320
|
+
this.resize()
|
|
321
|
+
window.addEventListener('resize', this.resize)
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
beforeDestroy() {
|
|
325
|
+
window.removeEventListener('resize', this.resize)
|
|
326
|
+
},
|
|
327
|
+
methods: {
|
|
328
|
+
handleToggleSize() {
|
|
329
|
+
this.hasCompactClass = !this.hasCompactClass
|
|
330
|
+
this.$emit('compact', this.hasCompactClass)
|
|
331
|
+
},
|
|
332
|
+
openSideBar() {
|
|
333
|
+
this.hasCompactClass = false
|
|
334
|
+
this.$emit('compact', this.hasCompactClass)
|
|
335
|
+
},
|
|
336
|
+
resize() {
|
|
337
|
+
this.windowWidth = window.innerWidth
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
}
|
|
341
|
+
</script>
|
|
342
|
+
|
|
343
|
+
<style lang="scss">
|
|
344
|
+
@import '../../../styles/mixins';
|
|
345
|
+
@import '../../../tokens/colors';
|
|
346
|
+
@import '../../../tokens/spacings';
|
|
347
|
+
.mc-side-bar {
|
|
348
|
+
$block-name: &;
|
|
349
|
+
|
|
350
|
+
display: flex;
|
|
351
|
+
flex-direction: column;
|
|
352
|
+
padding: $space-250 $space-100 $space-400;
|
|
353
|
+
transition: width 300ms ease;
|
|
354
|
+
overflow-x: hidden;
|
|
355
|
+
overflow-y: auto;
|
|
356
|
+
@include child-indent-bottom($space-400);
|
|
357
|
+
&--color-theme-black {
|
|
358
|
+
background-color: $color-black;
|
|
359
|
+
}
|
|
360
|
+
&--color-theme-white {
|
|
361
|
+
background-color: $color-white;
|
|
362
|
+
border-inline-end: 1px solid $color-hover-gray;
|
|
363
|
+
}
|
|
364
|
+
&__scrollable-container {
|
|
365
|
+
@include hide-scrollbar;
|
|
366
|
+
overflow-y: auto;
|
|
367
|
+
overflow-x: hidden;
|
|
368
|
+
height: 100%;
|
|
369
|
+
display: flex;
|
|
370
|
+
flex-direction: column;
|
|
371
|
+
}
|
|
372
|
+
&-wrapper {
|
|
373
|
+
height: 100%;
|
|
374
|
+
transition: width 300ms ease;
|
|
375
|
+
&__backdrop {
|
|
376
|
+
position: absolute;
|
|
377
|
+
background-color: rgba($color-black, 0.6);
|
|
378
|
+
z-index: 25;
|
|
379
|
+
height: inherit;
|
|
380
|
+
.mc-side-bar {
|
|
381
|
+
height: inherit;
|
|
382
|
+
}
|
|
383
|
+
&--full-width {
|
|
384
|
+
width: 100%;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
</style>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="mc-side-bar-bottom" :class="classes">
|
|
3
|
+
<div
|
|
4
|
+
v-if="!compact && $slots['bottom-message']"
|
|
5
|
+
class="mc-side-bar-bottom__slot-message"
|
|
6
|
+
:style="messageStyles"
|
|
7
|
+
>
|
|
8
|
+
<slot name="bottom-message" />
|
|
9
|
+
</div>
|
|
10
|
+
<mc-side-bar-button
|
|
11
|
+
v-if="!hiddenMode"
|
|
12
|
+
class="mc-side-bar-bottom__hide-button"
|
|
13
|
+
icon="arrow_backward"
|
|
14
|
+
:title="hideText"
|
|
15
|
+
:compact="compact"
|
|
16
|
+
:variation="closeButtonProps.variable"
|
|
17
|
+
:secondary-color="closeButtonProps.secondaryColor"
|
|
18
|
+
@click="handleClick"
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
import McSideBarButton from '../McSideBarButton/McSideBarButton'
|
|
25
|
+
export default {
|
|
26
|
+
name: 'McSideBarBottom',
|
|
27
|
+
components: {
|
|
28
|
+
McSideBarButton,
|
|
29
|
+
},
|
|
30
|
+
inject: ['provideData'],
|
|
31
|
+
props: {
|
|
32
|
+
/**
|
|
33
|
+
* Текст кнопки
|
|
34
|
+
* сворачивания меню
|
|
35
|
+
*/
|
|
36
|
+
hideText: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: '',
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* Компактный вид
|
|
42
|
+
*/
|
|
43
|
+
compact: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false,
|
|
46
|
+
},
|
|
47
|
+
hiddenMode: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: false,
|
|
50
|
+
},
|
|
51
|
+
sidebarWidth: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: null,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
data() {
|
|
57
|
+
return {
|
|
58
|
+
hasCompactClass: this.compact,
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
computed: {
|
|
62
|
+
closeButtonProps() {
|
|
63
|
+
return this.provideData?.currentThemeConfig?.closeButton || {}
|
|
64
|
+
},
|
|
65
|
+
classes() {
|
|
66
|
+
return {
|
|
67
|
+
'mc-side-bar-bottom--compact': this.hasCompactClass,
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
messageStyles() {
|
|
71
|
+
return {
|
|
72
|
+
minWidth: this.sidebarWidth,
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
watch: {
|
|
77
|
+
compact(newValue) {
|
|
78
|
+
this.hasCompactClass = newValue
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
methods: {
|
|
82
|
+
handleClick() {
|
|
83
|
+
if (this.hasCompactClass !== this.compact) return
|
|
84
|
+
this.$emit('toggle-size', !this.compact)
|
|
85
|
+
this.hasCompactClass = !this.hasCompactClass
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
}
|
|
89
|
+
</script>
|
|
90
|
+
|
|
91
|
+
<style lang="scss">
|
|
92
|
+
@import '../../../tokens/durations';
|
|
93
|
+
@import '../../../tokens/spacings';
|
|
94
|
+
.mc-side-bar-bottom {
|
|
95
|
+
$block-name: &;
|
|
96
|
+
|
|
97
|
+
display: flex;
|
|
98
|
+
flex-direction: column;
|
|
99
|
+
flex: 1 1 auto;
|
|
100
|
+
justify-content: flex-end;
|
|
101
|
+
min-height: max-content;
|
|
102
|
+
|
|
103
|
+
&__hide-button {
|
|
104
|
+
.mc-side-bar-button__icon {
|
|
105
|
+
transition: transform $duration-s;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&--compact {
|
|
110
|
+
#{$block-name}__hide-button {
|
|
111
|
+
.mc-side-bar-button__icon {
|
|
112
|
+
transform: rotate(180deg);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
&__slot-message {
|
|
117
|
+
margin-inline-start: -$space-100;
|
|
118
|
+
margin-inline-end: -$space-100;
|
|
119
|
+
padding-inline-start: $space-100;
|
|
120
|
+
padding-inline-end: $space-100;
|
|
121
|
+
& + * {
|
|
122
|
+
margin-top: $space-500;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
</style>
|