mediacube-ui 0.1.345 → 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.
- package/CHANGELOG.md +4 -0
- package/dist/0.mediacube-ui.umd.js +50 -0
- package/dist/assets/img/icons.3b7d59b2f49c67a2a3a4566b8ab233fd.svg +1 -0
- 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 +1 -0
- package/package.json +14 -16
- package/src/assets/icons.svg +1 -1
- package/src/assets/tokens/tokens.json +5 -0
- package/dist/mediacube-ui.common.js +0 -378
- package/src/elements/McAvatar/McAvatar.vue +0 -274
- package/src/elements/McBadge/McBadge.vue +0 -148
- package/src/elements/McButton/McButton.vue +0 -841
- package/src/elements/McChip/McChip.vue +0 -300
- package/src/elements/McCropper/McCropper.vue +0 -133
- package/src/elements/McDate/McDate.vue +0 -105
- package/src/elements/McDatePicker/McDatePicker.vue +0 -902
- package/src/elements/McField/McFieldCheckbox/McFieldCheckbox.vue +0 -332
- package/src/elements/McField/McFieldRadio/McFieldRadioButton/McFieldRadioButton.vue +0 -201
- package/src/elements/McField/McFieldRadio/McFieldRadioGroup/McFieldRadioGroup.vue +0 -194
- package/src/elements/McField/McFieldSelect/McFieldSelect.vue +0 -1087
- package/src/elements/McField/McFieldText/McFieldText.vue +0 -969
- package/src/elements/McField/McFieldToggle/McFieldToggle.vue +0 -268
- package/src/elements/McInfinityLoadingIndicator/McInfinityLoadingIndicator.vue +0 -97
- package/src/elements/McNotification/McNotification.vue +0 -209
- package/src/elements/McProgress/McProgress.vue +0 -218
- package/src/elements/McRangeSlider/McRangeSlider.vue +0 -195
- package/src/elements/McSeparator/McSeparator.vue +0 -143
- package/src/elements/McSlideUpDown/McSlideUpDown.vue +0 -157
- package/src/elements/McSvgIcon/McSvgIcon.vue +0 -127
- package/src/elements/McTabs/McTab/McTab.vue +0 -187
- package/src/elements/McTabs/McTabs/McTabs.vue +0 -531
- package/src/elements/McTitle/McTitle.vue +0 -365
- package/src/elements/McTooltip/McTooltip.vue +0 -334
- package/src/helpers/consts.js +0 -3
- package/src/helpers/delayedAction.js +0 -26
- package/src/helpers/storybookFunctions.js +0 -20
- package/src/helpers/storybookVariables.js +0 -24
- package/src/mixins/equalFieldHeight.js +0 -59
- package/src/mixins/fieldErrors.js +0 -28
- package/src/patterns/McAccordion/McAccordion.vue +0 -53
- package/src/patterns/McCells/McCell/McCell.vue +0 -101
- package/src/patterns/McChat/McChat.vue +0 -305
- package/src/patterns/McChat/McChatComment/McChatComment.vue +0 -265
- package/src/patterns/McChat/McChatForm/McChatForm.vue +0 -147
- package/src/patterns/McCollapse/McCollapse.vue +0 -280
- package/src/patterns/McDrawer/McDrawer.vue +0 -146
- package/src/patterns/McDropdown/McDropdown.vue +0 -247
- package/src/patterns/McDropdown/McDropdownPanel/McDropdownPanel.vue +0 -40
- package/src/patterns/McFakeScroll/McFakeScroll.vue +0 -277
- package/src/patterns/McFilter/McFilter.vue +0 -847
- package/src/patterns/McFilter/McFilterChip/McFilterChip.vue +0 -83
- package/src/patterns/McFilter/McFilterTags/McFilterTags.vue +0 -374
- package/src/patterns/McFilter/McFilterTypeDate/McFilterTypeDate.vue +0 -70
- package/src/patterns/McFilter/McFilterTypeRange/McFilterTypeRange.vue +0 -132
- package/src/patterns/McFilter/McFilterTypeRelation/McFilterTypeRelation.vue +0 -221
- package/src/patterns/McFilter/McFilterTypeSimple/McFilterTypeSimple.vue +0 -161
- package/src/patterns/McFilter/McFilterTypeText/McFilterTypeText.vue +0 -62
- package/src/patterns/McGrid/McGridCol/McGridCol.vue +0 -165
- package/src/patterns/McGrid/McGridRow/McGridRow.vue +0 -158
- package/src/patterns/McModal/McModal.vue +0 -680
- package/src/patterns/McOverlay/McOverlay.vue +0 -78
- package/src/patterns/McPreview/McPreview.vue +0 -118
- package/src/patterns/McSideBar/McSideBar/McSideBar.vue +0 -387
- package/src/patterns/McSideBar/McSideBarBottom/McSideBarBottom.vue +0 -125
- package/src/patterns/McSideBar/McSideBarButton/McSideBarButton.vue +0 -252
- package/src/patterns/McSideBar/McSideBarCenter/McSideBarCenter.vue +0 -367
- package/src/patterns/McSideBar/McSideBarTop/McSideBarTop.vue +0 -238
- package/src/patterns/McStack/McStack.vue +0 -158
- package/src/patterns/McTable/McTable/McTable.vue +0 -854
- package/src/patterns/McTable/McTableCol/McTableCol.vue +0 -296
- package/src/patterns/McTableCard/McTableCard.vue +0 -135
- package/src/patterns/McTableCard/McTableCardHeader/McTableCardHeader.vue +0 -74
- package/src/patterns/McTopBar/McTopBar.vue +0 -153
- package/src/patterns/McWrapScroll/McWrapScroll.vue +0 -291
- package/src/styles/_functions.scss +0 -187
- package/src/styles/_mixins.scss +0 -612
- package/src/styles/_spacing.scss +0 -33
- package/src/styles/_variables.scss +0 -23
- package/src/styles/global.scss +0 -308
- package/src/styles/main.scss +0 -4
- package/src/styles/table.scss +0 -10
- package/src/styles/toast.scss +0 -55
- package/src/templates/layouts/McContentFixed/McContentFixed.vue +0 -60
- package/src/templates/layouts/McMain/McMain.vue +0 -115
- package/src/templates/layouts/McRoot/McRoot.vue +0 -45
- package/src/tokens/animations.scss +0 -9
- package/src/tokens/border-radius.scss +0 -26
- package/src/tokens/box-shadows.scss +0 -28
- package/src/tokens/colors.scss +0 -82
- package/src/tokens/durations.scss +0 -7
- package/src/tokens/easings.scss +0 -6
- package/src/tokens/font-families.scss +0 -8
- package/src/tokens/font-sizes.scss +0 -23
- package/src/tokens/font-weights.scss +0 -9
- package/src/tokens/gradients.scss +0 -18
- package/src/tokens/letter-spacings.scss +0 -6
- package/src/tokens/line-heights.scss +0 -22
- package/src/tokens/media-queries.scss +0 -32
- package/src/tokens/opacities.scss +0 -8
- package/src/tokens/sizes.scss +0 -47
- package/src/tokens/spacings.scss +0 -38
- package/src/tokens/z-indexes.scss +0 -14
- package/src/utils/dayjs.js +0 -19
- package/src/utils/filters.js +0 -11
- package/src/utils/getTokens.js +0 -41
- package/src/utils/load-icons.js +0 -3
- package/src/utils/treeSearch.js +0 -30
- package/src/utils/webFontLoader.js +0 -12
|
@@ -1,365 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import _upperFirst from 'lodash/upperFirst'
|
|
3
|
-
import DOMPurify from 'isomorphic-dompurify'
|
|
4
|
-
|
|
5
|
-
const values = ['variation', 'weight']
|
|
6
|
-
const sizes = ['xs', 's', 'm', 'l', 'xl', 'xxl']
|
|
7
|
-
const variationProps = {}
|
|
8
|
-
|
|
9
|
-
values.forEach(value => {
|
|
10
|
-
sizes.forEach(size => {
|
|
11
|
-
variationProps[`${value}-${size}`] = { type: String }
|
|
12
|
-
})
|
|
13
|
-
})
|
|
14
|
-
export default {
|
|
15
|
-
name: 'McTitle',
|
|
16
|
-
functional: true,
|
|
17
|
-
props: {
|
|
18
|
-
...variationProps,
|
|
19
|
-
/**
|
|
20
|
-
* Уровень: `h1`, `h2`, `h3`, `h4`, `subtitle`, `body`, `overline`, `article`, 'info'.
|
|
21
|
-
*/
|
|
22
|
-
variation: {
|
|
23
|
-
type: String,
|
|
24
|
-
default: 'body',
|
|
25
|
-
},
|
|
26
|
-
/**
|
|
27
|
-
* В одну строку с точками в конце, если не вмещается
|
|
28
|
-
*/
|
|
29
|
-
ellipsis: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
default: true,
|
|
32
|
-
},
|
|
33
|
-
/**
|
|
34
|
-
* Если нужен другой тэг
|
|
35
|
-
*/
|
|
36
|
-
tagName: {
|
|
37
|
-
type: String,
|
|
38
|
-
default: 'div',
|
|
39
|
-
},
|
|
40
|
-
/**
|
|
41
|
-
* Заглавные буквы
|
|
42
|
-
*/
|
|
43
|
-
uppercase: {
|
|
44
|
-
type: Boolean,
|
|
45
|
-
default: false,
|
|
46
|
-
},
|
|
47
|
-
/**
|
|
48
|
-
* Цвет
|
|
49
|
-
*/
|
|
50
|
-
color: {
|
|
51
|
-
type: String,
|
|
52
|
-
default: 'black',
|
|
53
|
-
},
|
|
54
|
-
/**
|
|
55
|
-
* Позиция текста:
|
|
56
|
-
* `left, center, right`
|
|
57
|
-
*/
|
|
58
|
-
textAlign: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: 'left',
|
|
61
|
-
},
|
|
62
|
-
/**
|
|
63
|
-
* Если нужна иная высота строки: `100`, `200`, `300` и т.д.
|
|
64
|
-
*/
|
|
65
|
-
lineHeight: {
|
|
66
|
-
type: String,
|
|
67
|
-
default: '',
|
|
68
|
-
},
|
|
69
|
-
/**
|
|
70
|
-
* Толщина текста:
|
|
71
|
-
* normal, medium, semi-bold
|
|
72
|
-
*/
|
|
73
|
-
weight: {
|
|
74
|
-
type: String,
|
|
75
|
-
default: '',
|
|
76
|
-
},
|
|
77
|
-
/**
|
|
78
|
-
* Если нужно указать свою
|
|
79
|
-
* максимальную ширину
|
|
80
|
-
*/
|
|
81
|
-
maxWidth: {
|
|
82
|
-
type: String,
|
|
83
|
-
default: '',
|
|
84
|
-
},
|
|
85
|
-
preLine: {
|
|
86
|
-
type: Boolean,
|
|
87
|
-
default: false,
|
|
88
|
-
},
|
|
89
|
-
nowrap: {
|
|
90
|
-
type: Boolean,
|
|
91
|
-
default: false,
|
|
92
|
-
},
|
|
93
|
-
plainText: {
|
|
94
|
-
type: Boolean,
|
|
95
|
-
default: false,
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
render(h, { props, slots, data, listeners }) {
|
|
99
|
-
let contentStyle = {}
|
|
100
|
-
if (props.maxWidth) {
|
|
101
|
-
contentStyle = { 'max-width': props.maxWidth }
|
|
102
|
-
}
|
|
103
|
-
const contentOptions = {
|
|
104
|
-
class: 'mc-title__text',
|
|
105
|
-
style: contentStyle,
|
|
106
|
-
is: props.tagName,
|
|
107
|
-
}
|
|
108
|
-
if (data.domProps && data.domProps.innerHTML) {
|
|
109
|
-
contentOptions.domProps = {
|
|
110
|
-
innerHTML: DOMPurify.sanitize(data.domProps.innerHTML),
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
const responsivePropsClasses = {}
|
|
114
|
-
responsivePropsClasses[`mc-title--variation-${props.variation}`] = props.variation
|
|
115
|
-
values.forEach(value => {
|
|
116
|
-
sizes.forEach(size => {
|
|
117
|
-
const sizeValue = props[`${value}${_upperFirst(size)}`]
|
|
118
|
-
responsivePropsClasses[`mc-title--${value}-${size}-${sizeValue}`] = sizeValue
|
|
119
|
-
})
|
|
120
|
-
})
|
|
121
|
-
const classes = {
|
|
122
|
-
'mc-title': true,
|
|
123
|
-
['mc-title--ellipsis']: props.ellipsis,
|
|
124
|
-
[`mc-title--text-align-${props.textAlign}`]: props.textAlign,
|
|
125
|
-
[`mc-title--pre-line`]: props.preLine,
|
|
126
|
-
[`mc-title--nowrap`]: props.nowrap,
|
|
127
|
-
'mc-title--uppercase': props.uppercase,
|
|
128
|
-
'mc-title--line-height': props.lineHeight,
|
|
129
|
-
'mc-title--weight': props.weight,
|
|
130
|
-
'mc-title--plain-text': props.plainText,
|
|
131
|
-
...(data.class || {}),
|
|
132
|
-
...responsivePropsClasses,
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (data.staticClass) {
|
|
136
|
-
const staticClasses = data.staticClass.split(' ')
|
|
137
|
-
staticClasses.forEach(c => {
|
|
138
|
-
if (c) {
|
|
139
|
-
classes[c] = true
|
|
140
|
-
}
|
|
141
|
-
})
|
|
142
|
-
}
|
|
143
|
-
let style = {}
|
|
144
|
-
if (props.color) style['--mc-title-color'] = `var(--color-${props.color})`
|
|
145
|
-
if (props.weight) style['--mc-title-weight'] = `var(--font-weight-${props.weight})`
|
|
146
|
-
if (props.lineHeight) style['--mc-title-line-height'] = `var(--line-height-${props.lineHeight})`
|
|
147
|
-
if (data.staticStyle) {
|
|
148
|
-
style = {
|
|
149
|
-
...data.staticStyle,
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
return h(
|
|
153
|
-
'div',
|
|
154
|
-
{
|
|
155
|
-
attrs: {
|
|
156
|
-
id: data.attrs?.id,
|
|
157
|
-
},
|
|
158
|
-
class: classes,
|
|
159
|
-
style,
|
|
160
|
-
on: listeners,
|
|
161
|
-
},
|
|
162
|
-
[slots()['icon-prepend'], h('component', contentOptions, slots()['default']), slots()['icon-append']],
|
|
163
|
-
)
|
|
164
|
-
},
|
|
165
|
-
}
|
|
166
|
-
</script>
|
|
167
|
-
|
|
168
|
-
<style lang="scss">
|
|
169
|
-
@import '../../styles/mixins';
|
|
170
|
-
@import '../../tokens/font-families';
|
|
171
|
-
@import '../../tokens/letter-spacings';
|
|
172
|
-
.mc-title {
|
|
173
|
-
$block-name: &;
|
|
174
|
-
--mc-title-color: initial;
|
|
175
|
-
--mc-title-weight: initial;
|
|
176
|
-
--mc-title-line-height: initial;
|
|
177
|
-
color: var(--mc-title-color);
|
|
178
|
-
@mixin variations() {
|
|
179
|
-
font-family: $font-family-main;
|
|
180
|
-
&-h1 {
|
|
181
|
-
font-size: $font-size-700;
|
|
182
|
-
line-height: $line-height-600;
|
|
183
|
-
font-weight: $font-weight-semi-bold;
|
|
184
|
-
#{$block-name}__text {
|
|
185
|
-
max-width: 920px;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
&-h2 {
|
|
189
|
-
font-size: $font-size-600;
|
|
190
|
-
line-height: $line-height-500;
|
|
191
|
-
font-weight: $font-weight-semi-bold;
|
|
192
|
-
#{$block-name}__text {
|
|
193
|
-
max-width: 820px;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
&-h3 {
|
|
197
|
-
font-size: $font-size-500;
|
|
198
|
-
line-height: $line-height-400;
|
|
199
|
-
font-weight: $font-weight-semi-bold;
|
|
200
|
-
#{$block-name}__text {
|
|
201
|
-
max-width: 720px;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
&-h4 {
|
|
205
|
-
font-size: $font-size-400;
|
|
206
|
-
line-height: $line-height-300;
|
|
207
|
-
font-weight: $font-weight-bold;
|
|
208
|
-
#{$block-name}__text {
|
|
209
|
-
max-width: 700px;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
&-subtitle {
|
|
214
|
-
font-size: $font-size-300;
|
|
215
|
-
line-height: $line-height-250;
|
|
216
|
-
#{$block-name}__text {
|
|
217
|
-
max-width: 640px;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
&-article {
|
|
221
|
-
font-size: $font-size-200;
|
|
222
|
-
line-height: $line-height-250;
|
|
223
|
-
#{$block-name}__text {
|
|
224
|
-
max-width: 536px;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
&-info {
|
|
228
|
-
font-size: $font-size-300;
|
|
229
|
-
line-height: $line-height-300;
|
|
230
|
-
}
|
|
231
|
-
&-body {
|
|
232
|
-
font-size: $font-size-200;
|
|
233
|
-
line-height: $line-height-200;
|
|
234
|
-
#{$block-name}__text {
|
|
235
|
-
max-width: 330px;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
&-overline {
|
|
239
|
-
font-size: $font-size-100;
|
|
240
|
-
line-height: $line-height-150;
|
|
241
|
-
font-weight: $font-weight-medium;
|
|
242
|
-
#{$block-name}__text {
|
|
243
|
-
max-width: 330px;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
margin-top: 0;
|
|
249
|
-
margin-bottom: 0;
|
|
250
|
-
display: inline-flex;
|
|
251
|
-
max-width: 100%;
|
|
252
|
-
width: 100%;
|
|
253
|
-
text-decoration: none;
|
|
254
|
-
//@include child-indent-right($space-50);
|
|
255
|
-
|
|
256
|
-
&__text {
|
|
257
|
-
padding-bottom: 1px; // fix overflow
|
|
258
|
-
margin-bottom: -1px; // fix overflow
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
> *:not(:empty):not(:last-child) {
|
|
262
|
-
margin-inline-end: $space-50;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.mc-svg-icon,
|
|
266
|
-
.mc-button {
|
|
267
|
-
@include reset-text-indents();
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
&--pre-line {
|
|
271
|
-
#{$block-name}__text {
|
|
272
|
-
white-space: pre-line !important;
|
|
273
|
-
word-break: normal;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
&--nowrap {
|
|
278
|
-
#{$block-name}__text {
|
|
279
|
-
white-space: nowrap;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
&--variation {
|
|
284
|
-
@include variations;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
&--ellipsis {
|
|
288
|
-
align-items: center;
|
|
289
|
-
|
|
290
|
-
#{$block-name} {
|
|
291
|
-
&__text {
|
|
292
|
-
@include ellipsis($display: inline-block);
|
|
293
|
-
@include layout-flex-fix();
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
&--uppercase {
|
|
299
|
-
text-transform: uppercase;
|
|
300
|
-
letter-spacing: $letter-spacing-m;
|
|
301
|
-
}
|
|
302
|
-
&--plain-text {
|
|
303
|
-
#{$block-name} {
|
|
304
|
-
&__text {
|
|
305
|
-
unicode-bidi: plaintext;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
&--text-align {
|
|
311
|
-
&-left {
|
|
312
|
-
justify-content: flex-start;
|
|
313
|
-
text-align: start;
|
|
314
|
-
}
|
|
315
|
-
&-center {
|
|
316
|
-
justify-content: center;
|
|
317
|
-
text-align: center;
|
|
318
|
-
}
|
|
319
|
-
&-right {
|
|
320
|
-
justify-content: flex-end;
|
|
321
|
-
text-align: end;
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
&--line-height {
|
|
325
|
-
line-height: var(--mc-title-line-height);
|
|
326
|
-
}
|
|
327
|
-
&--weight {
|
|
328
|
-
font-weight: var(--mc-title-weight);
|
|
329
|
-
}
|
|
330
|
-
@each $media, $value in $token-media-queries {
|
|
331
|
-
@media #{$value} {
|
|
332
|
-
&--variation-#{$media} {
|
|
333
|
-
@include variations;
|
|
334
|
-
}
|
|
335
|
-
&--weight-#{$media} {
|
|
336
|
-
&-normal {
|
|
337
|
-
font-weight: $font-weight-normal;
|
|
338
|
-
}
|
|
339
|
-
&-medium {
|
|
340
|
-
font-weight: $font-weight-medium;
|
|
341
|
-
}
|
|
342
|
-
&-semi-bold {
|
|
343
|
-
font-weight: $font-weight-semi-bold;
|
|
344
|
-
}
|
|
345
|
-
&-bold {
|
|
346
|
-
font-weight: $font-weight-bold;
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
h1,
|
|
352
|
-
h2,
|
|
353
|
-
h3,
|
|
354
|
-
h4,
|
|
355
|
-
h5,
|
|
356
|
-
h6 {
|
|
357
|
-
font-weight: inherit;
|
|
358
|
-
font-style: inherit;
|
|
359
|
-
font-size: inherit;
|
|
360
|
-
line-height: inherit;
|
|
361
|
-
margin-block-start: 0;
|
|
362
|
-
margin-block-end: 0;
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
</style>
|
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div ref="tooltipTarget" v-tooltip="tooltipProps" class="mc-tooltip-target" @mouseenter.stop="handleHide">
|
|
3
|
-
<!-- @slot Слот для элемента, у которого будет всплывать тултип -->
|
|
4
|
-
<slot />
|
|
5
|
-
</div>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script>
|
|
9
|
-
import { VTooltip } from 'v-tooltip'
|
|
10
|
-
|
|
11
|
-
VTooltip.options.defaultBoundariesElement = 'window'
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
name: 'McTooltip',
|
|
15
|
-
directives: {
|
|
16
|
-
tooltip: VTooltip,
|
|
17
|
-
},
|
|
18
|
-
props: {
|
|
19
|
-
/**
|
|
20
|
-
* Текст подсказки:
|
|
21
|
-
*/
|
|
22
|
-
content: {
|
|
23
|
-
type: String,
|
|
24
|
-
required: true,
|
|
25
|
-
},
|
|
26
|
-
/**
|
|
27
|
-
* Расположение:
|
|
28
|
-
*/
|
|
29
|
-
placement: {
|
|
30
|
-
type: String,
|
|
31
|
-
default: 'top',
|
|
32
|
-
},
|
|
33
|
-
/**
|
|
34
|
-
* Цвет:
|
|
35
|
-
*/
|
|
36
|
-
color: {
|
|
37
|
-
type: String,
|
|
38
|
-
default: '',
|
|
39
|
-
},
|
|
40
|
-
/**
|
|
41
|
-
* Максимальная ширина
|
|
42
|
-
*/
|
|
43
|
-
maxWidth: {
|
|
44
|
-
type: String,
|
|
45
|
-
default: 's',
|
|
46
|
-
},
|
|
47
|
-
/**
|
|
48
|
-
* Отключить стрелку
|
|
49
|
-
*/
|
|
50
|
-
arrowDisabled: {
|
|
51
|
-
type: Boolean,
|
|
52
|
-
default: false,
|
|
53
|
-
},
|
|
54
|
-
/**
|
|
55
|
-
* Размеры:
|
|
56
|
-
* `s, m`
|
|
57
|
-
*/
|
|
58
|
-
size: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: 's',
|
|
61
|
-
},
|
|
62
|
-
/**
|
|
63
|
-
* Событие по отображению:
|
|
64
|
-
* 'hover', 'click', 'focus' or 'manual'
|
|
65
|
-
* (можно комбинировать)
|
|
66
|
-
*/
|
|
67
|
-
trigger: {
|
|
68
|
-
type: String,
|
|
69
|
-
default: 'hover focus',
|
|
70
|
-
},
|
|
71
|
-
/**
|
|
72
|
-
* Ручное отображение
|
|
73
|
-
*/
|
|
74
|
-
show: {
|
|
75
|
-
type: Boolean,
|
|
76
|
-
default: false,
|
|
77
|
-
},
|
|
78
|
-
/**
|
|
79
|
-
* В каком контенере отображать
|
|
80
|
-
*/
|
|
81
|
-
container: {
|
|
82
|
-
default: 'body', //Boolean, String, HTMLElement,
|
|
83
|
-
},
|
|
84
|
-
maxLines: {
|
|
85
|
-
type: Number,
|
|
86
|
-
default: null,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
computed: {
|
|
90
|
-
tooltipProps() {
|
|
91
|
-
return {
|
|
92
|
-
content: this.content,
|
|
93
|
-
placement: this.placement,
|
|
94
|
-
classes: this.tooltipClasses,
|
|
95
|
-
trigger: this.trigger,
|
|
96
|
-
show: this.show,
|
|
97
|
-
container: this.container,
|
|
98
|
-
template: `<div class="tooltip" style="${this.tooltipVariables}" role="tooltip"> <div class="tooltip-arrow"></div> <div class="tooltip-inner"><div class="tooltip-inner__content"></div></div> </div>`,
|
|
99
|
-
innerSelector: '.tooltip-inner__content',
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
tooltipClasses() {
|
|
103
|
-
return [
|
|
104
|
-
'mc-tooltip',
|
|
105
|
-
`mc-tooltip--width-${this.maxWidth}`,
|
|
106
|
-
`mc-tooltip--size-${this.size}`,
|
|
107
|
-
this.maxLines ? 'mc-tooltip--lines-limit' : '',
|
|
108
|
-
this.arrowDisabled ? 'mc-tooltip--arrow-disabled' : '',
|
|
109
|
-
]
|
|
110
|
-
},
|
|
111
|
-
tooltipVariables() {
|
|
112
|
-
let textColor
|
|
113
|
-
if (this.color === 'white') textColor = 'black'
|
|
114
|
-
|
|
115
|
-
const variables = [
|
|
116
|
-
this.maxLines && `--mc-tooltip-content-max-lines: ${this.maxLines}`,
|
|
117
|
-
this.color && `--mc-tooltip-arrow-color: var(--color-${this.color})`,
|
|
118
|
-
textColor && `--mc-tooltip-color: var(--color-${textColor})`,
|
|
119
|
-
this.color && `--mc-tooltip-background-color: var(--color-${this.color})`,
|
|
120
|
-
].filter(i => i)
|
|
121
|
-
|
|
122
|
-
return variables.join('; ')
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
methods: {
|
|
126
|
-
handleHide() {
|
|
127
|
-
setTimeout(() => {
|
|
128
|
-
const tooltipID = this.$refs.tooltipTarget?.getAttribute('aria-describedby')
|
|
129
|
-
const tooltips = document.documentElement.querySelectorAll('.tooltip.mc-tooltip')
|
|
130
|
-
tooltips.forEach(tooltip => {
|
|
131
|
-
tooltip.style.visibility = tooltip.id === tooltipID ? 'visible' : 'hidden'
|
|
132
|
-
})
|
|
133
|
-
}, 1)
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
}
|
|
137
|
-
</script>
|
|
138
|
-
|
|
139
|
-
<style lang="scss">
|
|
140
|
-
@import '../../styles/mixins';
|
|
141
|
-
@import '../../styles/spacing';
|
|
142
|
-
@import '../../tokens/durations';
|
|
143
|
-
@import '../../tokens/font-families';
|
|
144
|
-
@import '../../tokens/box-shadows';
|
|
145
|
-
.mc-tooltip-target {
|
|
146
|
-
display: inline-flex;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.mc-tooltip {
|
|
150
|
-
$arrow-size: $space-100 - 1;
|
|
151
|
-
$arrow-position: $arrow-size - 2; // наслаивает стрелку на тултип и прячет рандомные бордеры между ними
|
|
152
|
-
--mc-tooltip-arrow-color: #{$color-black};
|
|
153
|
-
--mc-tooltip-color: #{$color-white};
|
|
154
|
-
--mc-tooltip-background-color: #{$color-black};
|
|
155
|
-
--mc-tooltip-content-max-lines: initial;
|
|
156
|
-
&.tooltip {
|
|
157
|
-
display: block !important;
|
|
158
|
-
z-index: 10005 !important;
|
|
159
|
-
|
|
160
|
-
.tooltip-inner {
|
|
161
|
-
@include inset-squish-space($space-300);
|
|
162
|
-
background: $color-black;
|
|
163
|
-
border-radius: $radius-100;
|
|
164
|
-
box-shadow: $shadow-s;
|
|
165
|
-
padding: $space-100 $space-150;
|
|
166
|
-
background-color: var(--mc-tooltip-background-color);
|
|
167
|
-
&__content {
|
|
168
|
-
color: var(--mc-tooltip-color);
|
|
169
|
-
font-family: $font-family-main;
|
|
170
|
-
line-height: $line-height-250;
|
|
171
|
-
font-size: $font-size-300;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.tooltip-arrow {
|
|
176
|
-
@include size(0);
|
|
177
|
-
border-style: solid;
|
|
178
|
-
position: absolute;
|
|
179
|
-
margin: $arrow-size;
|
|
180
|
-
border-color: var(--mc-tooltip-arrow-color);
|
|
181
|
-
z-index: 1;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
&[x-placement^='top'] {
|
|
185
|
-
margin-bottom: $arrow-size;
|
|
186
|
-
|
|
187
|
-
.tooltip-arrow {
|
|
188
|
-
border-width: $arrow-size $arrow-size 0 $arrow-size;
|
|
189
|
-
border-left-color: transparent !important;
|
|
190
|
-
border-right-color: transparent !important;
|
|
191
|
-
border-bottom-color: transparent !important;
|
|
192
|
-
bottom: -$arrow-position;
|
|
193
|
-
left: calc(50% - #{$arrow-size});
|
|
194
|
-
margin-top: -1px !important;
|
|
195
|
-
margin-bottom: 0;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
&[x-placement^='bottom'] {
|
|
200
|
-
margin-top: $arrow-size;
|
|
201
|
-
|
|
202
|
-
.tooltip-arrow {
|
|
203
|
-
border-width: 0 $arrow-size $arrow-size $arrow-size;
|
|
204
|
-
border-left-color: transparent !important;
|
|
205
|
-
border-right-color: transparent !important;
|
|
206
|
-
border-top-color: transparent !important;
|
|
207
|
-
top: -$arrow-position;
|
|
208
|
-
left: calc(50% - #{$arrow-size});
|
|
209
|
-
margin-top: 0;
|
|
210
|
-
margin-bottom: 0;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
&[x-placement^='right'] {
|
|
215
|
-
margin-left: $arrow-size;
|
|
216
|
-
|
|
217
|
-
.tooltip-arrow {
|
|
218
|
-
border-width: $arrow-size $arrow-size $arrow-size 0;
|
|
219
|
-
border-left-color: transparent !important;
|
|
220
|
-
border-top-color: transparent !important;
|
|
221
|
-
border-bottom-color: transparent !important;
|
|
222
|
-
left: -$arrow-position;
|
|
223
|
-
top: calc(50% - #{$arrow-size});
|
|
224
|
-
margin-left: 0;
|
|
225
|
-
margin-right: 0;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
&[x-placement^='left'] {
|
|
230
|
-
margin-right: $arrow-size;
|
|
231
|
-
|
|
232
|
-
.tooltip-arrow {
|
|
233
|
-
border-width: $arrow-size 0 $arrow-size $arrow-size;
|
|
234
|
-
border-top-color: transparent !important;
|
|
235
|
-
border-right-color: transparent !important;
|
|
236
|
-
border-bottom-color: transparent !important;
|
|
237
|
-
right: -$arrow-position;
|
|
238
|
-
top: calc(50% - #{$arrow-size});
|
|
239
|
-
margin-left: 0;
|
|
240
|
-
margin-right: 0;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
&[aria-hidden='true'] {
|
|
245
|
-
visibility: hidden !important;
|
|
246
|
-
opacity: 0;
|
|
247
|
-
transition: opacity $duration-s;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
&[aria-hidden='false'] {
|
|
251
|
-
visibility: visible !important;
|
|
252
|
-
opacity: 1;
|
|
253
|
-
transition: opacity $duration-s;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
&--width-xs {
|
|
258
|
-
&.tooltip {
|
|
259
|
-
max-width: 180px;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
&--width-s {
|
|
264
|
-
&.tooltip {
|
|
265
|
-
max-width: 250px;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
&--width-m {
|
|
270
|
-
&.tooltip {
|
|
271
|
-
max-width: 320px;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
&--width-l {
|
|
276
|
-
&.tooltip {
|
|
277
|
-
max-width: 380px;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
&--width-xl {
|
|
282
|
-
&.tooltip {
|
|
283
|
-
max-width: 500px;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
&--size {
|
|
288
|
-
&-s {
|
|
289
|
-
&.tooltip {
|
|
290
|
-
.tooltip-inner {
|
|
291
|
-
@include inset-squish-space($space-200);
|
|
292
|
-
|
|
293
|
-
&__content {
|
|
294
|
-
font-size: $font-size-200;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
&-m {
|
|
300
|
-
&.tooltip {
|
|
301
|
-
.tooltip-inner {
|
|
302
|
-
@include inset-squish-space($space-300);
|
|
303
|
-
|
|
304
|
-
&__content {
|
|
305
|
-
font-size: $font-size-300;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
&--lines-limit {
|
|
313
|
-
&.tooltip {
|
|
314
|
-
.tooltip-inner {
|
|
315
|
-
&__content {
|
|
316
|
-
display: -webkit-box;
|
|
317
|
-
-webkit-box-orient: vertical;
|
|
318
|
-
-webkit-line-clamp: var(--mc-tooltip-content-max-lines);
|
|
319
|
-
overflow: hidden;
|
|
320
|
-
text-overflow: ellipsis;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
&--arrow-disabled {
|
|
327
|
-
&.tooltip {
|
|
328
|
-
.tooltip-arrow {
|
|
329
|
-
display: none;
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
</style>
|
package/src/helpers/consts.js
DELETED