mediacube-ui 0.1.346 → 0.1.347

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.
Files changed (108) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/0.mediacube-ui.umd.js +50 -0
  3. package/dist/assets/img/icons.3b7d59b2f49c67a2a3a4566b8ab233fd.svg +1 -0
  4. package/dist/assets/img/no_table_data.236cd56f46cfb71fc363b008d4ca70d5.png +0 -0
  5. package/dist/assets/img/no_user.e0030d6e54e2400e1181fd22b83cf8ae.png +0 -0
  6. package/dist/mediacube-ui.umd.js +1 -0
  7. package/package.json +14 -16
  8. package/src/assets/tokens/tokens.json +5 -0
  9. package/dist/mediacube-ui.common.js +0 -378
  10. package/src/elements/McAvatar/McAvatar.vue +0 -274
  11. package/src/elements/McBadge/McBadge.vue +0 -148
  12. package/src/elements/McButton/McButton.vue +0 -841
  13. package/src/elements/McChip/McChip.vue +0 -300
  14. package/src/elements/McCropper/McCropper.vue +0 -133
  15. package/src/elements/McDate/McDate.vue +0 -105
  16. package/src/elements/McDatePicker/McDatePicker.vue +0 -902
  17. package/src/elements/McField/McFieldCheckbox/McFieldCheckbox.vue +0 -332
  18. package/src/elements/McField/McFieldRadio/McFieldRadioButton/McFieldRadioButton.vue +0 -201
  19. package/src/elements/McField/McFieldRadio/McFieldRadioGroup/McFieldRadioGroup.vue +0 -194
  20. package/src/elements/McField/McFieldSelect/McFieldSelect.vue +0 -1087
  21. package/src/elements/McField/McFieldText/McFieldText.vue +0 -969
  22. package/src/elements/McField/McFieldToggle/McFieldToggle.vue +0 -268
  23. package/src/elements/McInfinityLoadingIndicator/McInfinityLoadingIndicator.vue +0 -97
  24. package/src/elements/McNotification/McNotification.vue +0 -209
  25. package/src/elements/McProgress/McProgress.vue +0 -218
  26. package/src/elements/McRangeSlider/McRangeSlider.vue +0 -195
  27. package/src/elements/McSeparator/McSeparator.vue +0 -143
  28. package/src/elements/McSlideUpDown/McSlideUpDown.vue +0 -157
  29. package/src/elements/McSvgIcon/McSvgIcon.vue +0 -127
  30. package/src/elements/McTabs/McTab/McTab.vue +0 -187
  31. package/src/elements/McTabs/McTabs/McTabs.vue +0 -531
  32. package/src/elements/McTitle/McTitle.vue +0 -365
  33. package/src/elements/McTooltip/McTooltip.vue +0 -334
  34. package/src/helpers/consts.js +0 -3
  35. package/src/helpers/delayedAction.js +0 -26
  36. package/src/helpers/storybookFunctions.js +0 -20
  37. package/src/helpers/storybookVariables.js +0 -24
  38. package/src/mixins/equalFieldHeight.js +0 -59
  39. package/src/mixins/fieldErrors.js +0 -28
  40. package/src/patterns/McAccordion/McAccordion.vue +0 -53
  41. package/src/patterns/McCells/McCell/McCell.vue +0 -101
  42. package/src/patterns/McChat/McChat.vue +0 -305
  43. package/src/patterns/McChat/McChatComment/McChatComment.vue +0 -265
  44. package/src/patterns/McChat/McChatForm/McChatForm.vue +0 -147
  45. package/src/patterns/McCollapse/McCollapse.vue +0 -280
  46. package/src/patterns/McDrawer/McDrawer.vue +0 -146
  47. package/src/patterns/McDropdown/McDropdown.vue +0 -247
  48. package/src/patterns/McDropdown/McDropdownPanel/McDropdownPanel.vue +0 -40
  49. package/src/patterns/McFakeScroll/McFakeScroll.vue +0 -277
  50. package/src/patterns/McFilter/McFilter.vue +0 -847
  51. package/src/patterns/McFilter/McFilterChip/McFilterChip.vue +0 -83
  52. package/src/patterns/McFilter/McFilterTags/McFilterTags.vue +0 -374
  53. package/src/patterns/McFilter/McFilterTypeDate/McFilterTypeDate.vue +0 -70
  54. package/src/patterns/McFilter/McFilterTypeRange/McFilterTypeRange.vue +0 -132
  55. package/src/patterns/McFilter/McFilterTypeRelation/McFilterTypeRelation.vue +0 -221
  56. package/src/patterns/McFilter/McFilterTypeSimple/McFilterTypeSimple.vue +0 -161
  57. package/src/patterns/McFilter/McFilterTypeText/McFilterTypeText.vue +0 -62
  58. package/src/patterns/McGrid/McGridCol/McGridCol.vue +0 -165
  59. package/src/patterns/McGrid/McGridRow/McGridRow.vue +0 -158
  60. package/src/patterns/McModal/McModal.vue +0 -680
  61. package/src/patterns/McOverlay/McOverlay.vue +0 -78
  62. package/src/patterns/McPreview/McPreview.vue +0 -118
  63. package/src/patterns/McSideBar/McSideBar/McSideBar.vue +0 -387
  64. package/src/patterns/McSideBar/McSideBarBottom/McSideBarBottom.vue +0 -125
  65. package/src/patterns/McSideBar/McSideBarButton/McSideBarButton.vue +0 -252
  66. package/src/patterns/McSideBar/McSideBarCenter/McSideBarCenter.vue +0 -367
  67. package/src/patterns/McSideBar/McSideBarTop/McSideBarTop.vue +0 -238
  68. package/src/patterns/McStack/McStack.vue +0 -158
  69. package/src/patterns/McTable/McTable/McTable.vue +0 -854
  70. package/src/patterns/McTable/McTableCol/McTableCol.vue +0 -296
  71. package/src/patterns/McTableCard/McTableCard.vue +0 -135
  72. package/src/patterns/McTableCard/McTableCardHeader/McTableCardHeader.vue +0 -74
  73. package/src/patterns/McTopBar/McTopBar.vue +0 -153
  74. package/src/patterns/McWrapScroll/McWrapScroll.vue +0 -291
  75. package/src/styles/_functions.scss +0 -187
  76. package/src/styles/_mixins.scss +0 -612
  77. package/src/styles/_spacing.scss +0 -33
  78. package/src/styles/_variables.scss +0 -23
  79. package/src/styles/global.scss +0 -308
  80. package/src/styles/main.scss +0 -4
  81. package/src/styles/table.scss +0 -10
  82. package/src/styles/toast.scss +0 -55
  83. package/src/templates/layouts/McContentFixed/McContentFixed.vue +0 -60
  84. package/src/templates/layouts/McMain/McMain.vue +0 -115
  85. package/src/templates/layouts/McRoot/McRoot.vue +0 -45
  86. package/src/tokens/animations.scss +0 -9
  87. package/src/tokens/border-radius.scss +0 -26
  88. package/src/tokens/box-shadows.scss +0 -28
  89. package/src/tokens/colors.scss +0 -82
  90. package/src/tokens/durations.scss +0 -7
  91. package/src/tokens/easings.scss +0 -6
  92. package/src/tokens/font-families.scss +0 -8
  93. package/src/tokens/font-sizes.scss +0 -23
  94. package/src/tokens/font-weights.scss +0 -9
  95. package/src/tokens/gradients.scss +0 -19
  96. package/src/tokens/letter-spacings.scss +0 -6
  97. package/src/tokens/line-heights.scss +0 -22
  98. package/src/tokens/media-queries.scss +0 -32
  99. package/src/tokens/opacities.scss +0 -8
  100. package/src/tokens/sizes.scss +0 -47
  101. package/src/tokens/spacings.scss +0 -38
  102. package/src/tokens/z-indexes.scss +0 -14
  103. package/src/utils/dayjs.js +0 -19
  104. package/src/utils/filters.js +0 -11
  105. package/src/utils/getTokens.js +0 -41
  106. package/src/utils/load-icons.js +0 -3
  107. package/src/utils/treeSearch.js +0 -30
  108. package/src/utils/webFontLoader.js +0 -12
@@ -1,296 +0,0 @@
1
- <template>
2
- <vxe-table-column v-bind="attrs" class="mc-table-col" v-on="$listeners">
3
- <template v-slot="{ row, rowIndex }">
4
- <!-- @slot Слот для mc-table-col -->
5
- <slot :row="row">
6
- <mc-title
7
- :text-align="textAlign"
8
- :ellipsis="ellipsis"
9
- weight="normal"
10
- class="mc-table-col__title"
11
- v-html="$attrs.type === 'seq' ? rowIndex + 1 : row[defaultTitle]"
12
- />
13
- </slot>
14
- <div v-if="$scopedSlots.right" class="mc-table-col__right">
15
- <!-- @slot Слот справа в ячейке (абсолютно спозиционированный, с бэкграундом) -->
16
- <slot :row="row" name="right" />
17
- </div>
18
- </template>
19
- <template v-slot:header="{ column }">
20
- <!-- @slot Слот заголовка столбца -->
21
- <slot :column="column" name="header">
22
- <mc-title :text-align="textAlign" class="mc-table-col__title" weight="semi-bold">
23
- <mc-svg-icon
24
- v-if="isSortable"
25
- slot="icon-prepend"
26
- :name="getSortIcon(column)"
27
- :color="getSortColor(column)"
28
- size="200"
29
- />{{
30
- $attrs.type === 'seq' ? '#' : column.title
31
- }}<div slot="icon-append" class="mc-table-col__header-append">
32
- <!-- @slot Слот для вставки в конец после заголовка столбца -->
33
- <slot name="header-append" />
34
- </div>
35
- </mc-title>
36
- <div v-if="$scopedSlots['header-right'] || headerRight" class="mc-table-col__header-right">
37
- <!-- @slot Слот справа в ячейке хедера (абсолютно спозиционированный, с бэкграундом) -->
38
- <slot :column="column" name="header-right">
39
- <mc-chip
40
- v-if="headerRight"
41
- class="mc-table-col__total"
42
- variation="gray-invert"
43
- size="s-compact"
44
- >
45
- {{ headerRight }}
46
- </mc-chip>
47
- </slot>
48
- </div>
49
- </slot>
50
- </template>
51
- <template v-slot:footer="{ columnIndex, items }">
52
- <mc-title
53
- v-if="items[columnIndex]"
54
- :text-align="textAlign"
55
- weight="semi-bold"
56
- v-html="`${items[columnIndex]} ${totalAppend}`"
57
- />
58
- <template v-else-if="getVisibilityCommonInfo(columnIndex, items)">
59
- <mc-title v-if="!provideData.canShowLoader" class="mc-table-col__title" weight="semi-bold">
60
- {{ firstColFooter }}
61
- </mc-title>
62
- <span v-if="provideData.canShowLoader" ref="loader" class="mc-table-col__loader"></span>
63
- </template>
64
- </template>
65
- </vxe-table-column>
66
- </template>
67
-
68
- <script>
69
- import McTitle from '../../../elements/McTitle/McTitle'
70
- import McSvgIcon from '../../../elements/McSvgIcon/McSvgIcon'
71
- import McChip from '../../../elements/McChip/McChip'
72
-
73
- /**
74
- * Смотреть mc-table
75
- */
76
- export default {
77
- name: 'McTableCol',
78
- components: {
79
- McTitle,
80
- McSvgIcon,
81
- McChip,
82
- },
83
- inject: ['provideData'],
84
- props: {
85
- /**
86
- * Если нужен бордер
87
- * справа от столбца
88
- */
89
- hasBorder: {
90
- type: Boolean,
91
- default: false,
92
- },
93
- /**
94
- * Если нужна доп инфа
95
- * в ячейке заголовка справа
96
- */
97
- headerRight: {
98
- type: [Number, String],
99
- default: null,
100
- },
101
- /**
102
- * Нужно ли применять фильтры для тотала колонки
103
- * */
104
- modifyTotal: {
105
- type: Boolean,
106
- default: true,
107
- },
108
- },
109
- computed: {
110
- attrs() {
111
- const classes = {
112
- 'class-name': this.handleClassName,
113
- 'header-class-name': this.handleClassName,
114
- 'footer-class-name': this.handleFooterClassName,
115
- }
116
- return {
117
- ...classes,
118
- ...this.$attrs,
119
- params: {
120
- ...this.$attrs.params,
121
- modifyTotal: this.modifyTotal,
122
- },
123
- }
124
- },
125
- defaultTitle() {
126
- return this.$attrs.field
127
- },
128
- textAlign() {
129
- return this.$attrs.align || 'left'
130
- },
131
- totalAppend() {
132
- return this.$attrs['total-append'] || ''
133
- },
134
- isSortable() {
135
- // eslint-disable-next-line no-prototype-builtins
136
- return this.$attrs.hasOwnProperty('sortable') && this.$attrs.sortable !== false
137
- },
138
- ellipsis() {
139
- // eslint-disable-next-line no-prototype-builtins
140
- if (!this.$attrs.hasOwnProperty('show-overflow')) return true
141
- return this.$attrs['show-overflow'] !== false
142
- },
143
- firstColFooter() {
144
- switch (this.provideData.footerInfo) {
145
- case 'total':
146
- return this.provideData.placeholders.total
147
- case 'loaded':
148
- return this.provideData.placeholders.all_loaded
149
- default:
150
- return ''
151
- }
152
- },
153
- },
154
- methods: {
155
- getVisibilityCommonInfo(columnIndex, items) {
156
- const index = items.indexOf(null)
157
- return columnIndex === index
158
- },
159
- getSortIcon(column) {
160
- if (this.provideData.sortedBy && column.property === this.provideData.sortedBy) {
161
- return this.provideData.sortedDescending ? 'arrow_downward' : 'arrow_upward'
162
- }
163
- return 'arrow_up_down'
164
- },
165
- getSortColor(column) {
166
- if (this.provideData.sortedBy && column.property === this.provideData.sortedBy) {
167
- return 'black'
168
- }
169
- return 'outline-gray'
170
- },
171
- handleClassName() {
172
- const classes = []
173
- if (this.hasBorder && !this.provideData.cardIsOpen) {
174
- classes.push('mc-table-col--border-right')
175
- }
176
- if (this.$attrs['show-overflow'] === false) {
177
- classes.push('mc-table-col--overflow-visible')
178
- }
179
- return classes
180
- },
181
- handleFooterClassName() {
182
- if (this.hasBorder && !this.provideData.cardIsOpen) {
183
- return 'mc-table-col--border-right'
184
- }
185
- },
186
- },
187
- }
188
- </script>
189
-
190
- <style lang="scss">
191
- @import '../../../styles/mixins';
192
- @import '~vxe-table/styles/variable.scss';
193
- //override variables:
194
- @import '../../../styles/table.scss';
195
-
196
- @mixin col-right-color($color) {
197
- .mc-table-col__right {
198
- background-color: $color;
199
- &::before {
200
- background: linear-gradient(90deg, hsla(0, 0%, 100%, 0) 0, $color);
201
- }
202
- }
203
- }
204
- .mc-table-col {
205
- $block-name: &;
206
-
207
- &--border-right {
208
- border-inline-end: 1px solid $color-hover-gray;
209
- }
210
- &--border-top {
211
- border-top: 1px solid $color-hover-gray;
212
- }
213
- &--border-bottom {
214
- border-bottom: 1px solid $color-hover-gray;
215
- }
216
- &--overflow-visible {
217
- .vxe-cell {
218
- overflow: visible !important;
219
- }
220
- }
221
-
222
- &__total {
223
- margin-inline-start: auto;
224
- color: $color-gray;
225
- }
226
-
227
- &__title {
228
- width: auto;
229
- max-width: 101%;
230
- }
231
- &__header-append {
232
- display: flex;
233
- align-items: center;
234
- }
235
- &__right {
236
- display: flex;
237
- opacity: 0;
238
- pointer-events: none;
239
- align-items: center;
240
- flex-wrap: nowrap;
241
- @include position(absolute, 0 $space-200 0 null);
242
- @include child-indent-right($space-50);
243
- background-color: $color-white;
244
-
245
- &::before {
246
- @include pseudo();
247
- @include position(null, 0 100% 0 null);
248
- width: $size-300;
249
- background: linear-gradient(90deg, hsla(0, 0%, 100%, 0) 0, $color-white);
250
- }
251
- }
252
- &__header-right {
253
- @extend .mc-table-col__right;
254
- display: flex;
255
- opacity: 1;
256
- pointer-events: unset;
257
- }
258
- }
259
-
260
- .vxe-cell {
261
- &--title {
262
- font-weight: $font-weight-semi-bold;
263
- }
264
- &.c--tooltip,
265
- &.c--title {
266
- text-overflow: clip !important;
267
- white-space: normal !important;
268
- }
269
- }
270
- .vxe-body--row {
271
- transition: background-color 0s;
272
- &.row--stripe {
273
- @include col-right-color($vxe-table-row-striped-background-color);
274
- }
275
- &.row--hover {
276
- .mc-table-col__right {
277
- opacity: 1;
278
- pointer-events: unset;
279
- }
280
- @include col-right-color($vxe-table-row-hover-background-color);
281
- &.row--current {
282
- @include col-right-color($vxe-table-row-hover-current-background-color);
283
- }
284
- }
285
- &.row--current {
286
- @include col-right-color($vxe-table-row-current-background-color);
287
- }
288
- // описка названия в библиотеке таблицы
289
- &.row--cheched {
290
- @include col-right-color($vxe-table-row-cheched-background-color);
291
- &.row--hover {
292
- @include col-right-color($vxe-table-row-hover-cheched-background-color);
293
- }
294
- }
295
- }
296
- </style>
@@ -1,135 +0,0 @@
1
- <template>
2
- <div class="mc-table-card" :style="{ marginLeft: ml }">
3
- <div v-if="$slots.header" class="mc-table-card__header">
4
- <!-- @slot Слот заголовка -->
5
- <slot name="header" />
6
- </div>
7
- <div class="mc-table-card__body">
8
- <!-- @slot Слот контента -->
9
- <slot />
10
- </div>
11
- <div v-if="$slots.footer || footerBlur" :class="computedFooterClasses">
12
- <!-- @slot Слот футера -->
13
- <slot name="footer" />
14
- </div>
15
- </div>
16
- </template>
17
-
18
- <script>
19
- export default {
20
- name: 'McTableCard',
21
- props: {
22
- ml: {
23
- type: String,
24
- default: '251px',
25
- },
26
- footerBlur: {
27
- type: Boolean,
28
- default: false,
29
- },
30
- },
31
- data() {
32
- return {
33
- bodyEl: null,
34
- body_scrolled_to_bottom: true,
35
- }
36
- },
37
- computed: {
38
- computedFooterClasses() {
39
- return {
40
- 'mc-table-card__footer': this.$slots.footer,
41
- 'mc-table-card__footer--with-blur': this.footerBlur && !this.body_scrolled_to_bottom,
42
- }
43
- },
44
- },
45
- watch: {
46
- footerBlur(val) {
47
- if (val) {
48
- this.initBlur()
49
- } else {
50
- this.bodyEl && this.bodyEl.removeEventListener('scroll', this.handlerScroll)
51
- }
52
- },
53
- },
54
- mounted() {
55
- if (this.footerBlur) {
56
- this.initBlur()
57
- }
58
- },
59
- beforeDestroy() {
60
- this.bodyEl && this.bodyEl.removeEventListener('scroll', this.handlerScroll)
61
- },
62
- methods: {
63
- initBlur() {
64
- try {
65
- this.body_scrolled_to_bottom = false
66
- this.bodyEl = document.querySelector('.mc-table-card__body')
67
- this.bodyEl && this.bodyEl.addEventListener('scroll', this.handlerScroll)
68
- } catch (e) {
69
- console.error(e)
70
- }
71
- },
72
- handlerScroll(e) {
73
- try {
74
- this.body_scrolled_to_bottom = e.target.offsetHeight + e.target.scrollTop === e.target.scrollHeight
75
- } catch (e) {
76
- this.body_scrolled_to_bottom = true
77
- console.error(e)
78
- }
79
- },
80
- },
81
- }
82
- </script>
83
-
84
- <style lang="scss">
85
- @import '../../styles/mixins';
86
- .mc-table-card {
87
- $block-name: &;
88
-
89
- @include position(absolute, 0);
90
- z-index: 10;
91
- background-color: $color-white;
92
- border-inline-start: 1px solid $color-hover-gray;
93
- display: flex;
94
- flex-direction: column;
95
- @include custom-scroll();
96
-
97
- &__header {
98
- height: $size-500;
99
- border-bottom: 1px solid $color-hover-gray;
100
- flex-shrink: 0;
101
- }
102
-
103
- &__body {
104
- position: relative;
105
- flex-grow: 1;
106
- display: flex;
107
- flex-direction: column;
108
- min-height: 0;
109
- overflow-y: auto;
110
- }
111
-
112
- &__footer {
113
- border-top: 1px solid $color-hover-gray;
114
- flex-shrink: 0;
115
- padding: $space-200;
116
- @include child-indent-right($space-150);
117
- &:empty {
118
- display: none;
119
- }
120
- &--with-blur {
121
- position: relative;
122
- &::after {
123
- @include pseudo;
124
- height: $space-900;
125
- background: linear-gradient(to top, $color-white, transparent);
126
- position: absolute;
127
- width: 100%;
128
- inset-inline-start: 0;
129
- bottom: 100%;
130
- pointer-events: none;
131
- }
132
- }
133
- }
134
- }
135
- </style>
@@ -1,74 +0,0 @@
1
- <template>
2
- <section class="mc-table-card-header">
3
- <div class="mc-table-card-header__left">
4
- <!-- @slot Слот контента -->
5
- <slot>
6
- <mc-button :to="backTo" exact variation="purple-link" size="xs">
7
- <mc-svg-icon slot="icon-prepend" name="keyboard_arrow_left" />
8
- {{ buttonBackText }}
9
- </mc-button>
10
- </slot>
11
- </div>
12
- <div class="mc-table-card-header__right">
13
- <!-- @slot right -->
14
- <slot name="right" />
15
- </div>
16
- </section>
17
- </template>
18
-
19
- <script>
20
- import McButton from '../../../elements/McButton/McButton'
21
- import McSvgIcon from '../../../elements/McSvgIcon/McSvgIcon'
22
- export default {
23
- name: 'McTableCardHeader',
24
- components: {
25
- McButton,
26
- McSvgIcon,
27
- },
28
- props: {
29
- buttonBackText: {
30
- type: String,
31
- default: 'Back',
32
- },
33
- backTo: {
34
- type: String,
35
- default: '#',
36
- },
37
- },
38
- }
39
- </script>
40
-
41
- <style lang="scss">
42
- @import '../../../styles/mixins';
43
- .mc-table-card-header {
44
- $block-name: &;
45
-
46
- display: flex;
47
- flex-wrap: nowrap;
48
- background-color: $color-white;
49
- padding: 0;
50
- padding-inline: $space-150 $space-200;
51
- align-items: center;
52
- height: 100%;
53
-
54
- &__left,
55
- &__right {
56
- @include layout-flex-fix();
57
- display: flex;
58
- flex-wrap: nowrap;
59
- @include child-indent-right($space-200);
60
-
61
- &:empty {
62
- display: none;
63
- }
64
- }
65
-
66
- &__left {
67
- margin-inline-end: auto;
68
- }
69
-
70
- &__right {
71
- margin-inline-start: auto;
72
- }
73
- }
74
- </style>
@@ -1,153 +0,0 @@
1
- <template>
2
- <div class="mc-top-bar">
3
- <div class="mc-top-bar__inner">
4
- <div v-if="$slots.left" class="mc-top-bar__left">
5
- <slot name="left" />
6
- </div>
7
- <div class="mc-top-bar__right">
8
- <slot name="right" />
9
- <mc-dropdown
10
- v-if="menuLangs && menuLangs.length"
11
- ref="menuLangs"
12
- v-model="localesDropdownOpen"
13
- list-min-width="auto"
14
- class="mc-top-bar__menu-langs"
15
- >
16
- <mc-button slot="activator" variation="black-link" uppercase>
17
- {{ currentLang || defaultLang }}
18
- <mc-svg-icon slot="icon-append" class="rotate" name="arrow_drop_down" />
19
- </mc-button>
20
- <mc-dropdown-panel>
21
- <mc-button
22
- v-for="locale in menuLangs"
23
- :key="locale.name"
24
- :to="locale.to || locale.href"
25
- :exact="locale.exact"
26
- variation="black-flat"
27
- text-align="left"
28
- full-width
29
- >
30
- <mc-svg-icon slot="icon-prepend" :name="`flag_${locale.name.toLowerCase()}`" />
31
- {{ locale.name }}
32
- </mc-button>
33
- </mc-dropdown-panel>
34
- </mc-dropdown>
35
- <slot name="user">
36
- <mc-dropdown v-if="user" v-model="userDropdownOpen" position="right">
37
- <mc-button slot="activator" variation="white-flat" size="m-compact">
38
- <mc-avatar slot="icon-prepend" :src="user.avatar" rounded size="400" />
39
- </mc-button>
40
- <slot name="user-dropdown-panel" />
41
- </mc-dropdown>
42
- </slot>
43
- </div>
44
- </div>
45
- <mc-separator color="hover-gray" indent-top="100" />
46
- <slot name="bottom" />
47
- </div>
48
- </template>
49
-
50
- <script>
51
- import McAvatar from '../../elements/McAvatar/McAvatar'
52
- import McButton from '../../elements/McButton/McButton'
53
- import McSvgIcon from '../../elements/McSvgIcon/McSvgIcon'
54
- import McSeparator from '../../elements/McSeparator/McSeparator'
55
- import McDropdown from '../McDropdown/McDropdown'
56
- import McDropdownPanel from '../McDropdown/McDropdownPanel/McDropdownPanel'
57
- export default {
58
- name: 'McTopBar',
59
- components: {
60
- McAvatar,
61
- McButton,
62
- McSvgIcon,
63
- McSeparator,
64
- McDropdown,
65
- McDropdownPanel,
66
- },
67
- props: {
68
- /**
69
- * Данные пользователя
70
- *
71
- */
72
- user: {
73
- type: Object,
74
- default: null,
75
- },
76
- /**
77
- * Меню языков
78
- *
79
- */
80
- menuLangs: {
81
- type: Array,
82
- default: () => [],
83
- },
84
- /**
85
- * Локализация или текст по умолчанию
86
- *
87
- */
88
- defaultLang: {
89
- type: String,
90
- default: 'Выберите язык',
91
- },
92
- /**
93
- * Текущая локализация
94
- *
95
- */
96
- currentLang: {
97
- type: String,
98
- default: null,
99
- },
100
- },
101
- data() {
102
- return {
103
- localesDropdownOpen: false,
104
- userDropdownOpen: false,
105
- }
106
- },
107
- watch: {
108
- currentLang() {
109
- this.localesDropdownOpen && this.$refs['menuLangs'] && this.$refs['menuLangs'].closeDropdown()
110
- },
111
- },
112
- }
113
- </script>
114
-
115
- <style lang="scss">
116
- @import '../../styles/mixins';
117
- .mc-top-bar {
118
- $block-name: &;
119
-
120
- width: 100%;
121
-
122
- &__inner {
123
- display: flex;
124
- justify-content: space-between;
125
- align-items: center;
126
- padding: $space-100 $space-150 0 $space-150;
127
- @include child-indent-right($space-100);
128
- }
129
-
130
- &__left,
131
- &__right {
132
- display: flex;
133
- flex-wrap: nowrap;
134
- align-items: center;
135
- @include child-indent-right($space-100);
136
- }
137
-
138
- &__right {
139
- min-width: 0;
140
- flex: 1 1 auto;
141
- justify-content: flex-end;
142
- }
143
- &__menu-langs {
144
- .mc-svg-icon {
145
- svg {
146
- rect {
147
- stroke: $color-hover-gray;
148
- }
149
- }
150
- }
151
- }
152
- }
153
- </style>