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,238 +0,0 @@
1
- <template>
2
- <div class="mc-side-bar-top" :class="`mc-side-bar-top--theme-${themeConfig.dropdownActivator}`">
3
- <mc-preview v-if="!computedMenuApps" slot="activator">
4
- <img
5
- v-if="logoSrc"
6
- slot="left"
7
- class="mc-side-bar-top__img"
8
- :src="logoSrc"
9
- width="24"
10
- height="24"
11
- :alt="logoTitle"
12
- />
13
- <mc-title slot="top" weight="semi-bold" :variation="logoTitleVariation">
14
- <template v-if="!compact">
15
- {{ logoTitle }}
16
- <slot slot="icon-append" name="title-append" />
17
- </template>
18
- </mc-title>
19
- </mc-preview>
20
- <mc-dropdown v-else v-model="dropIsOpen" :position="dropdownPosition">
21
- <mc-preview slot="activator">
22
- <img
23
- v-if="logoSrc"
24
- slot="left"
25
- class="mc-side-bar-top__img"
26
- :src="logoSrc"
27
- width="24"
28
- height="24"
29
- :alt="logoTitle"
30
- />
31
- <mc-svg-icon v-else-if="logoIcon" slot="left" class="rotate" :name="logoIcon" />
32
- <mc-button
33
- slot="top"
34
- :variation="`${themeConfig.dropdownActivator}-link`"
35
- :size="compact ? 'l-compact' : 'l'"
36
- class="mc-side-bar-top__activator-btn"
37
- >
38
- <mc-title v-if="!compact" weight="semi-bold" :variation="logoTitleVariation">
39
- {{ logoTitle }}
40
- <slot slot="icon-append" name="title-append" />
41
- </mc-title>
42
- <mc-svg-icon slot="icon-append" class="rotate" name="arrow_drop_down" color="gray" />
43
- </mc-button>
44
- </mc-preview>
45
- <mc-dropdown-panel>
46
- <mc-button
47
- v-for="menuAppsItem in computedMenuApps"
48
- :key="`menu-apps-item-${menuAppsItem.key}`"
49
- full-width
50
- text-align="left"
51
- variation="black-flat"
52
- :href="menuAppsItem.href"
53
- :to="menuAppsItem.to"
54
- :target="menuAppsItem.target"
55
- :is-active="menuAppsItem.isActive"
56
- :exact="menuAppsItem.exact"
57
- >
58
- <mc-svg-icon v-if="menuAppsItem.icon" slot="icon-prepend" :name="menuAppsItem.icon" />
59
- <img
60
- v-else-if="menuAppsItem.image"
61
- slot="icon-prepend"
62
- :src="menuAppsItem.image"
63
- width="24"
64
- height="24"
65
- alt="service image"
66
- />
67
- {{ menuAppsItem.name }}
68
- </mc-button>
69
- </mc-dropdown-panel>
70
- </mc-dropdown>
71
- </div>
72
- </template>
73
-
74
- <script>
75
- import _XEUtils from 'xe-utils'
76
- import _isEmpty from 'lodash/isEmpty'
77
- import McDropdown from '../../McDropdown/McDropdown'
78
- import McDropdownPanel from '../../McDropdown/McDropdownPanel/McDropdownPanel'
79
- import McButton from '../../../elements/McButton/McButton'
80
- import McSvgIcon from '../../../elements/McSvgIcon/McSvgIcon'
81
- import McPreview from '../../McPreview/McPreview'
82
- import McTitle from '../../../elements/McTitle/McTitle'
83
-
84
- export default {
85
- name: 'McSideBarTop',
86
- components: {
87
- McDropdown,
88
- McDropdownPanel,
89
- McButton,
90
- McPreview,
91
- McSvgIcon,
92
- McTitle,
93
- },
94
- inject: ['provideData'],
95
- props: {
96
- /**
97
- * Меню приложений
98
- *
99
- */
100
- menuApps: {
101
- type: Array,
102
- default: () => [],
103
- },
104
- /**
105
- * Название сервиса
106
- *
107
- */
108
- logoTitle: {
109
- type: String,
110
- default: 'Dashboard',
111
- },
112
- /**
113
- * Размер текста названия сервиса
114
- *
115
- */
116
- logoTitleVariation: {
117
- type: String,
118
- default: 'subtitle',
119
- },
120
- /**
121
- * Путь до изображения
122
- */
123
- logoSrc: {
124
- type: String,
125
- default: '',
126
- },
127
- /**
128
- * Имя иконки
129
- * заголовка
130
- */
131
- logoIcon: {
132
- type: String,
133
- default: '',
134
- },
135
- dropdownPosition: {
136
- type: String,
137
- default: 'left',
138
- },
139
- /**
140
- * Компактный вид
141
- */
142
- compact: {
143
- type: Boolean,
144
- default: false,
145
- },
146
- },
147
- data() {
148
- return {
149
- dropIsOpen: false,
150
- }
151
- },
152
- computed: {
153
- themeConfig() {
154
- return this.provideData
155
- ? this.provideData.currentThemeConfig
156
- : {
157
- mode: 'black',
158
- className: 'mc-side-bar--color-theme-black',
159
- dropdownActivator: 'white',
160
- mainMenuLinks: {
161
- variable: 'gray-flat',
162
- secondaryColor: 'white',
163
- },
164
- }
165
- },
166
- computedMenuApps() {
167
- if (_isEmpty(this.menuApps)) return null
168
- const apps = []
169
- this.menuApps.forEach(app => {
170
- if (app.isVisible) {
171
- apps.push({
172
- key: _XEUtils.uniqueId(),
173
- ...app,
174
- })
175
- }
176
- })
177
- return apps
178
- },
179
- },
180
- }
181
- </script>
182
-
183
- <style lang="scss">
184
- @import '../../../styles/mixins';
185
- .mc-side-bar-top {
186
- $block-name: &;
187
- @include reset-text-indents();
188
- position: sticky;
189
- top: -($space-250);
190
- padding: $space-250 $space-100;
191
- background: $color-white;
192
- margin: -($space-250) (-($space-100)) $space-150 !important;
193
- z-index: 2;
194
- .mc-dropdown__toggle {
195
- &:hover {
196
- cursor: pointer;
197
- }
198
- .mc-preview__left {
199
- margin-inline-end: 0;
200
- }
201
- .mc-button {
202
- line-height: $line-height-250;
203
- &__text {
204
- margin-inline-start: $space-100;
205
- }
206
- &__append {
207
- margin-inline-start: 0;
208
- }
209
- .rotate {
210
- @include size($size-200);
211
- }
212
- }
213
- }
214
- &__img {
215
- margin-inline-start: $space-100;
216
- }
217
- &__activator-btn {
218
- font-size: $font-size-400;
219
- line-height: $line-height-300;
220
- }
221
- &--theme-white {
222
- background: $color-black;
223
- .mc-preview__top {
224
- .mc-title {
225
- color: $color-white;
226
- }
227
- }
228
- }
229
- &--theme-black {
230
- background: $color-white;
231
- .mc-preview__top {
232
- .mc-title {
233
- color: $color-black;
234
- }
235
- }
236
- }
237
- }
238
- </style>
@@ -1,158 +0,0 @@
1
- <template>
2
- <div ref="stack" class="mc-stack">
3
- <div v-show="loaded" ref="mc-stack-body" class="mc-stack__body">
4
- <slot />
5
- </div>
6
- <div v-if="more" ref="counter" class="mc-stack__counter">
7
- {{ counterText }}
8
- </div>
9
- </div>
10
- </template>
11
-
12
- <script>
13
- export default {
14
- name: 'McStack',
15
- /**
16
- * Количество отрисованных
17
- * единиц списка
18
- * или число для макс. лимита
19
- * или строка "auto" для расчета по доступной ширине
20
- */
21
- props: {
22
- limit: {
23
- type: [Number, String],
24
- default: null,
25
- },
26
- collapsed: {
27
- type: Boolean,
28
- default: false,
29
- },
30
- },
31
- data: () => ({
32
- children: null,
33
- more: 0,
34
- loaded: false,
35
- custom_limit: 0,
36
- }),
37
- computed: {
38
- classes() {
39
- return {
40
- 'mc-stack': true,
41
- 'mc-stack--collapsed': this.collapsed,
42
- }
43
- },
44
- isAutoLimit() {
45
- return this.limit === 'auto'
46
- },
47
- counterText() {
48
- return `+${this.more}`
49
- },
50
- },
51
- mounted() {
52
- this.init()
53
- },
54
- beforeDestroy() {
55
- if (this.isAutoLimit) window.removeEventListener('resize', this.calcLimit)
56
- },
57
- methods: {
58
- init() {
59
- if (this.isAutoLimit) {
60
- window.addEventListener('resize', this.calcLimit)
61
- this.calcLimit()
62
- // setTimeout из-за случаев, когда элемент рендерится с 0 шириной, а потом она устанавливается динамически
63
- if (!this.$refs.stack?.clientWidth) {
64
- setTimeout(() => this.calcLimit(), 1)
65
- }
66
- } else {
67
- this.toggleChilds(true, this.limit)
68
- }
69
- },
70
- calcLimit(showAll, limit) {
71
- if (showAll) this.toggleChilds()
72
- this.custom_limit = Infinity
73
- let childWidth = 0
74
- // ширина родителя без учета счетчика
75
- const parentWidth = +this.$refs.stack?.clientWidth - (+this.$refs.counter?.clientWidth || 0)
76
- for (let i = 0; i < this.children?.length; i++) {
77
- const elemStyle = window.getComputedStyle(this.children[i])
78
- childWidth += +this.children[i]?.clientWidth + +parseInt(elemStyle.marginRight)
79
- // считаем занимаемую дочерними элементами ширину, если превышает родительскую, то выходим из цикла и ставим лимит
80
- if (childWidth > parentWidth) {
81
- this.custom_limit = i
82
- break
83
- }
84
- }
85
- // Сравниваем переданный лимит с заново выставленным, если они не равны, то ререндерим потомков
86
- if (this.custom_limit !== limit) this.toggleChilds(true, this.custom_limit)
87
- },
88
- setStyles(elem, opacity = 1, visibility = 'visible', position = 'relative') {
89
- elem.style.opacity = opacity
90
- elem.style.visibility = visibility
91
- elem.style.position = position
92
- },
93
- toggleChilds(hide, limit = 0) {
94
- this.loaded = true
95
- this.more = 0
96
- this.children = this.$refs?.['mc-stack-body']?.children
97
- let elementsLimit = hide ? limit - 1 : this.children.length
98
- for (let i = 0; i < this.children?.length; i++) {
99
- this.setStyles(this.children[i])
100
- if (i > elementsLimit) {
101
- this.setStyles(this.children[i], 0, 'hidden', 'absolute')
102
- this.more++
103
- }
104
- }
105
- // Передаем в $nextTick лимит для пересчета, т.к. рендерится counter, который занимает доп место и обрезает элементы
106
- if (hide && this.isAutoLimit) this.$nextTick(() => this.calcLimit(false, limit))
107
- },
108
- },
109
- }
110
- </script>
111
-
112
- <style lang="scss">
113
- @import '../../styles/mixins';
114
- @import '../../tokens/font-families';
115
- .mc-stack {
116
- $block-name: &;
117
-
118
- position: relative;
119
- @include reset-text-indents();
120
- display: flex;
121
- align-items: center;
122
- flex-wrap: nowrap;
123
-
124
- &--collapsed {
125
- #{$block-name}__body {
126
- @include child-indent-right(-$space-200);
127
- > * {
128
- border: 2px solid $color-white;
129
- }
130
- }
131
- }
132
-
133
- &__body {
134
- min-width: 0;
135
- overflow: hidden;
136
- display: flex;
137
- flex-wrap: nowrap;
138
- flex-direction: row;
139
- @include child-indent-right($space-150);
140
- > * {
141
- justify-content: center;
142
- }
143
- }
144
-
145
- &__counter {
146
- width: auto;
147
- position: sticky;
148
- right: 0;
149
- margin-inline-start: $space-50;
150
- flex: 0 0 auto;
151
- font-size: $font-size-200;
152
- line-height: $line-height-200;
153
- color: $color-gray;
154
- font-weight: $font-weight-semi-bold;
155
- font-family: $font-family-main;
156
- }
157
- }
158
- </style>