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.
Files changed (107) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/mediacube-ui.common.js +384 -0
  3. package/package.json +11 -4
  4. package/src/elements/McAvatar/McAvatar.vue +276 -0
  5. package/src/elements/McBadge/McBadge.vue +153 -0
  6. package/src/elements/McButton/McButton.vue +850 -0
  7. package/src/elements/McChip/McChip.vue +305 -0
  8. package/src/elements/McCropper/McCropper.vue +135 -0
  9. package/src/elements/McDate/McDate.vue +107 -0
  10. package/src/elements/McDatePicker/McDatePicker.vue +910 -0
  11. package/src/elements/McField/McFieldCheckbox/McFieldCheckbox.vue +339 -0
  12. package/src/elements/McField/McFieldRadio/McFieldRadioButton/McFieldRadioButton.vue +207 -0
  13. package/src/elements/McField/McFieldRadio/McFieldRadioGroup/McFieldRadioGroup.vue +198 -0
  14. package/src/elements/McField/McFieldSelect/McFieldSelect.vue +1088 -0
  15. package/src/elements/McField/McFieldText/McFieldText.vue +977 -0
  16. package/src/elements/McField/McFieldToggle/McFieldToggle.vue +273 -0
  17. package/src/elements/McInfinityLoadingIndicator/McInfinityLoadingIndicator.vue +97 -0
  18. package/src/elements/McNotification/McNotification.vue +215 -0
  19. package/src/elements/McProgress/McProgress.vue +223 -0
  20. package/src/elements/McRangeSlider/McRangeSlider.vue +199 -0
  21. package/src/elements/McSeparator/McSeparator.vue +143 -0
  22. package/src/elements/McSlideUpDown/McSlideUpDown.vue +157 -0
  23. package/src/elements/McSvgIcon/McSvgIcon.vue +128 -0
  24. package/src/elements/McTabs/McTab/McTab.vue +189 -0
  25. package/src/elements/McTabs/McTabs/McTabs.vue +538 -0
  26. package/src/elements/McTitle/McTitle.vue +370 -0
  27. package/src/elements/McTooltip/McTooltip.vue +339 -0
  28. package/src/helpers/consts.js +3 -0
  29. package/src/helpers/delayedAction.js +26 -0
  30. package/src/helpers/storybookFunctions.js +19 -0
  31. package/src/helpers/storybookVariables.js +24 -0
  32. package/src/mixins/equalFieldHeight.js +59 -0
  33. package/src/mixins/fieldErrors.js +28 -0
  34. package/src/patterns/McAccordion/McAccordion.vue +53 -0
  35. package/src/patterns/McCells/McCell/McCell.vue +102 -0
  36. package/src/patterns/McChat/McChat.vue +306 -0
  37. package/src/patterns/McChat/McChatComment/McChatComment.vue +268 -0
  38. package/src/patterns/McChat/McChatForm/McChatForm.vue +150 -0
  39. package/src/patterns/McCollapse/McCollapse.vue +282 -0
  40. package/src/patterns/McDrawer/McDrawer.vue +150 -0
  41. package/src/patterns/McDropdown/McDropdown.vue +249 -0
  42. package/src/patterns/McDropdown/McDropdownPanel/McDropdownPanel.vue +44 -0
  43. package/src/patterns/McFakeScroll/McFakeScroll.vue +279 -0
  44. package/src/patterns/McFilter/McFilter.vue +847 -0
  45. package/src/patterns/McFilter/McFilterChip/McFilterChip.vue +85 -0
  46. package/src/patterns/McFilter/McFilterTags/McFilterTags.vue +376 -0
  47. package/src/patterns/McFilter/McFilterTypeDate/McFilterTypeDate.vue +70 -0
  48. package/src/patterns/McFilter/McFilterTypeRange/McFilterTypeRange.vue +133 -0
  49. package/src/patterns/McFilter/McFilterTypeRelation/McFilterTypeRelation.vue +224 -0
  50. package/src/patterns/McFilter/McFilterTypeSimple/McFilterTypeSimple.vue +164 -0
  51. package/src/patterns/McFilter/McFilterTypeText/McFilterTypeText.vue +62 -0
  52. package/src/patterns/McGrid/McGridCol/McGridCol.vue +166 -0
  53. package/src/patterns/McGrid/McGridRow/McGridRow.vue +158 -0
  54. package/src/patterns/McModal/McModal.vue +686 -0
  55. package/src/patterns/McOverlay/McOverlay.vue +79 -0
  56. package/src/patterns/McPreview/McPreview.vue +119 -0
  57. package/src/patterns/McSideBar/McSideBar/McSideBar.vue +389 -0
  58. package/src/patterns/McSideBar/McSideBarBottom/McSideBarBottom.vue +126 -0
  59. package/src/patterns/McSideBar/McSideBarButton/McSideBarButton.vue +257 -0
  60. package/src/patterns/McSideBar/McSideBarCenter/McSideBarCenter.vue +369 -0
  61. package/src/patterns/McSideBar/McSideBarTop/McSideBarTop.vue +243 -0
  62. package/src/patterns/McStack/McStack.vue +163 -0
  63. package/src/patterns/McTable/McTable/McTable.vue +860 -0
  64. package/src/patterns/McTable/McTableCol/McTableCol.vue +299 -0
  65. package/src/patterns/McTableCard/McTableCard.vue +138 -0
  66. package/src/patterns/McTableCard/McTableCardHeader/McTableCardHeader.vue +76 -0
  67. package/src/patterns/McTopBar/McTopBar.vue +155 -0
  68. package/src/patterns/McWrapScroll/McWrapScroll.vue +293 -0
  69. package/src/styles/_functions.scss +189 -0
  70. package/src/styles/_mixins.scss +619 -0
  71. package/src/styles/_spacing.scss +33 -0
  72. package/src/styles/_variables.scss +23 -0
  73. package/src/styles/global.scss +311 -0
  74. package/src/styles/main.scss +4 -0
  75. package/src/styles/table.scss +12 -0
  76. package/src/styles/toast.scss +59 -0
  77. package/src/templates/layouts/McContentFixed/McContentFixed.vue +60 -0
  78. package/src/templates/layouts/McMain/McMain.vue +115 -0
  79. package/src/templates/layouts/McRoot/McRoot.vue +45 -0
  80. package/src/tokens/animations.scss +9 -0
  81. package/src/tokens/border-radius.scss +26 -0
  82. package/src/tokens/box-shadows.scss +28 -0
  83. package/src/tokens/colors.scss +82 -0
  84. package/src/tokens/durations.scss +7 -0
  85. package/src/tokens/easings.scss +6 -0
  86. package/src/tokens/font-families.scss +8 -0
  87. package/src/tokens/font-sizes.scss +23 -0
  88. package/src/tokens/font-weights.scss +9 -0
  89. package/src/tokens/gradients.scss +19 -0
  90. package/src/tokens/letter-spacings.scss +6 -0
  91. package/src/tokens/line-heights.scss +22 -0
  92. package/src/tokens/media-queries.scss +32 -0
  93. package/src/tokens/opacities.scss +8 -0
  94. package/src/tokens/sizes.scss +47 -0
  95. package/src/tokens/spacings.scss +38 -0
  96. package/src/tokens/z-indexes.scss +14 -0
  97. package/src/utils/dayjs.js +19 -0
  98. package/src/utils/filters.js +11 -0
  99. package/src/utils/getTokens.js +41 -0
  100. package/src/utils/load-icons.js +3 -0
  101. package/src/utils/treeSearch.js +30 -0
  102. package/src/utils/webFontLoader.js +12 -0
  103. package/dist/0.mediacube-ui.umd.js +0 -50
  104. package/dist/assets/img/icons.3b7d59b2f49c67a2a3a4566b8ab233fd.svg +0 -1
  105. package/dist/assets/img/no_table_data.236cd56f46cfb71fc363b008d4ca70d5.png +0 -0
  106. package/dist/assets/img/no_user.e0030d6e54e2400e1181fd22b83cf8ae.png +0 -0
  107. package/dist/mediacube-ui.umd.js +0 -1
@@ -0,0 +1,128 @@
1
+ <template>
2
+ <svg :class="classes" :style="styles">
3
+ <use :xlink:href="`${spritePath}#${name}`"></use>
4
+ </svg>
5
+ </template>
6
+
7
+ <script>
8
+ import iconsSpriteIcon from '../../assets/icons.svg'
9
+
10
+ export default {
11
+ name: 'McSvgIcon',
12
+ props: {
13
+ /**
14
+ * Путь к спрайту с иконками
15
+ * */
16
+ spritePath: {
17
+ type: String,
18
+ default: iconsSpriteIcon,
19
+ },
20
+ /**
21
+ * Имя иконки
22
+ * из assets
23
+ */
24
+ name: {
25
+ type: String,
26
+ required: true,
27
+ },
28
+ /**
29
+ * Цвет иконки
30
+ * (по токенам)
31
+ */
32
+ color: {
33
+ type: String,
34
+ default: '',
35
+ },
36
+ /**
37
+ * Заливка иконки
38
+ */
39
+ fill: {
40
+ type: String,
41
+ default: 'currentColor',
42
+ },
43
+ /**
44
+ * Размер
45
+ */
46
+ size: {
47
+ type: String,
48
+ default: '250',
49
+ },
50
+ /**
51
+ * Толщина линий 0-5 если нужно больше, нужно дописать список в стилях
52
+ * stroke-width
53
+ */
54
+ weight: {
55
+ type: Number,
56
+ default: 1.5,
57
+ },
58
+ /**
59
+ * Отображение иконки,
60
+ * если не найдена по имени
61
+ * в 'name'
62
+ */
63
+ defaultName: {
64
+ type: String,
65
+ default: '',
66
+ },
67
+ dir: {
68
+ type: String,
69
+ default: 'ltr',
70
+ validator(value) {
71
+ return ['ltr', 'rtl'].includes(value)
72
+ },
73
+ },
74
+ },
75
+ data() {
76
+ return {
77
+ svg: null,
78
+ }
79
+ },
80
+ computed: {
81
+ classes() {
82
+ return {
83
+ 'mc-svg-icon': true,
84
+ [`mc-svg-icon--dir-${this.dir}`]: !!this.dir,
85
+ }
86
+ },
87
+ styles() {
88
+ return {
89
+ ['--mc-svg-icon-size']: `var(--size-${this.size})`,
90
+ ['--mc-svg-icon-weight']: String(this.weight)
91
+ ?.replace('.', '')
92
+ ?.split('')
93
+ ?.join('.'),
94
+ ['--mc-svg-icon-color']: this.color && `var(--color-${this.color})`,
95
+ }
96
+ },
97
+ },
98
+ }
99
+ </script>
100
+
101
+ <style lang="scss">
102
+ @import '../../styles/mixins';
103
+ @import '../../tokens/sizes';
104
+ .mc-svg-icon {
105
+ --mc-svg-icon-size: #{$size-250};
106
+ --mc-svg-icon-weight: 1.5;
107
+ --mc-svg-icon-color: initial;
108
+ @include reset();
109
+ @include reset-text-indents();
110
+
111
+ @include size(inherit);
112
+ width: var(--mc-svg-icon-size);
113
+ height: var(--mc-svg-icon-size);
114
+ min-width: var(--mc-svg-icon-size);
115
+ min-height: var(--mc-svg-icon-size);
116
+ stroke-width: var(--mc-svg-icon-weight);
117
+ use {
118
+ stroke-width: var(--mc-svg-icon-weight);
119
+ }
120
+ color: var(--mc-svg-icon-color);
121
+
122
+ &--dir {
123
+ &-rtl {
124
+ transform: scale(-1, 1);
125
+ }
126
+ }
127
+ }
128
+ </style>
@@ -0,0 +1,189 @@
1
+ <template>
2
+ <section
3
+ v-show="isActive"
4
+ :id="id"
5
+ :aria-hidden="!isActive"
6
+ class="tabs-component-panel"
7
+ role="tabpanel"
8
+ :href="href"
9
+ :to="to"
10
+ >
11
+ <!-- @slot контента -->
12
+ <slot v-if="visible" />
13
+ </section>
14
+ </template>
15
+
16
+ <script>
17
+ /**
18
+ * Смотреть McTabs
19
+ */
20
+ export default {
21
+ name: 'McTab',
22
+ props: {
23
+ /**
24
+ * Если нужен иной фрагмент в url после #
25
+ * (по умолчанию берётся из 'name')
26
+ */
27
+ id: {
28
+ type: String,
29
+ default: '',
30
+ },
31
+ /**
32
+ * Имя таба
33
+ */
34
+ // eslint-disable-next-line vue/require-prop-types
35
+ name: {
36
+ required: true,
37
+ },
38
+ /**
39
+ * Вставка в начало имени таба
40
+ * (не влияет на значение вставленное в url)
41
+ */
42
+ prefix: {
43
+ type: String,
44
+ default: '',
45
+ },
46
+ /**
47
+ * Вставка в конец имени таба
48
+ * (не влияет на значение вставленное в url)
49
+ */
50
+ suffix: {
51
+ type: [String, Number],
52
+ default: '',
53
+ },
54
+ appendCount: {
55
+ type: Number,
56
+ default: null,
57
+ },
58
+ appendCountColor: {
59
+ type: String,
60
+ default: 'black',
61
+ },
62
+ /**
63
+ * Отключенное состояние
64
+ */
65
+ isDisabled: {
66
+ type: Boolean,
67
+ default: false,
68
+ },
69
+ /**
70
+ * Виден ли таб
71
+ */
72
+ visible: {
73
+ type: Boolean,
74
+ default: true,
75
+ },
76
+ /**
77
+ * Классы иконки в начале
78
+ */
79
+ iconPrependClasses: {
80
+ type: String,
81
+ default: '',
82
+ },
83
+ /**
84
+ * Классы иконки в конце
85
+ */
86
+ iconAppendClasses: {
87
+ type: String,
88
+ default: '',
89
+ },
90
+ /**
91
+ * Цвет иконки в начале
92
+ */
93
+ iconPrependColor: {
94
+ type: String,
95
+ default: '',
96
+ },
97
+ /**
98
+ * Цвет иконки в конце
99
+ */
100
+ iconAppendColor: {
101
+ type: String,
102
+ default: '',
103
+ },
104
+ /**
105
+ * Если нужна ссылка внутри приложения:
106
+ * `{name: 'test', params: { id: test.id }}`
107
+ */
108
+ // eslint-disable-next-line vue/require-prop-types
109
+ to: {
110
+ default: null,
111
+ },
112
+ /**
113
+ * Если нужна обычная ссылка:
114
+ * `https://mediacube.agency/`
115
+ */
116
+ href: {
117
+ type: String,
118
+ default: '',
119
+ },
120
+ },
121
+ data: () => ({
122
+ isActive: false,
123
+ isVisible: true,
124
+ }),
125
+ computed: {
126
+ computedId() {
127
+ return this.id ? this.id : this.name.toLowerCase().replace(/ /g, '-')
128
+ },
129
+
130
+ hash() {
131
+ if (this.isDisabled) {
132
+ return '#'
133
+ }
134
+
135
+ return '#' + this.computedId
136
+ },
137
+ computedPrefix() {
138
+ let styles
139
+ if (this.iconPrependClasses) styles = `--mc-tab-icon-prepend-color: var(--color-${this.iconPrependColor})`
140
+ const classes = `${this.iconPrependClasses} tabs-component-tab__icon-prepend`
141
+ return this.iconPrependClasses ? `<span class="${classes}" style="${styles}"></span>` : this.prefix
142
+ },
143
+ computedSuffix() {
144
+ let styles
145
+ if (this.iconAppendColor) styles = `--mc-tab-icon-append-color: var(--color-${this.iconAppendColor})`
146
+ const classes = `${this.iconAppendClasses} tabs-component-tab__icon-append`
147
+ return this.iconAppendClasses ? `<span class="${classes}" style="${styles}"></span>` : this.suffix
148
+ },
149
+ hasAppendCount() {
150
+ return this.appendCount || this.appendCount === 0
151
+ },
152
+ computedTabName() {
153
+ return (
154
+ `${this.computedPrefix}` +
155
+ `<span class="tabs-component-tab__tab-name" data-name="${this.name}">${this.name}</span>` +
156
+ `${this.computedSuffix}` +
157
+ (this.hasAppendCount
158
+ ? `<span class="tabs-component-tab__tab-name-append-count" style="${this.appendCountStyles}">
159
+ ${this.appendCount}
160
+ </span>`
161
+ : '')
162
+ )
163
+ },
164
+ header() {
165
+ return this.visible ? this.computedTabName : ''
166
+ },
167
+ appendCountStyles() {
168
+ return `--mc-tab-append-count-color: var(--color-${this.appendCountColor})`
169
+ },
170
+ },
171
+ }
172
+ </script>
173
+
174
+ <style lang="scss">
175
+ .tabs-component-panel {
176
+ $block-name: &;
177
+ }
178
+ .tabs-component-tab {
179
+ &__tab {
180
+ &-name-append-count {
181
+ color: var(--mc-tab-append-count-color);
182
+ }
183
+ }
184
+ a:empty {
185
+ margin: 0;
186
+ padding: 0;
187
+ }
188
+ }
189
+ </style>