mediacube-ui 0.1.122 → 0.1.124

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 CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.1.124](https://github.com/MediaCubeCo/mcui/compare/v0.1.123...v0.1.124) (2023-08-24)
6
+
7
+ ### [0.1.123](https://github.com/MediaCubeCo/mcui/compare/v0.1.122...v0.1.123) (2023-08-23)
8
+
5
9
  ### [0.1.122](https://github.com/MediaCubeCo/mcui/compare/v0.1.121...v0.1.122) (2023-08-22)
6
10
 
7
11
  ### [0.1.121](https://github.com/MediaCubeCo/mcui/compare/v0.1.120...v0.1.121) (2023-08-22)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediacube-ui",
3
- "version": "0.1.122",
3
+ "version": "0.1.124",
4
4
  "description": "Design system for Mediacube services",
5
5
  "author": "Mediacube",
6
6
  "private": false,
@@ -994,7 +994,7 @@
994
994
  },
995
995
  {
996
996
  "name": "$token-icon-sizes",
997
- "value": "( 200: $size-200, 250: $size-250, 300: $size-300, 400: $size-400, 500: $size-500, 600: $size-600, 700: $size-700, 800: $size-800, 900: $size-900, 1000: $size-1000, )",
997
+ "value": "( 100: $size-100, 150: $size-150, 200: $size-200, 250: $size-250, 300: $size-300, 400: $size-400, 500: $size-500, 600: $size-600, 700: $size-700, 800: $size-800, 900: $size-900, 1000: $size-1000, )",
998
998
  "compiledValue": ""
999
999
  },
1000
1000
  {
@@ -1042,6 +1042,11 @@
1042
1042
  "value": "32px",
1043
1043
  "compiledValue": ""
1044
1044
  },
1045
+ {
1046
+ "name": "$space-450",
1047
+ "value": "36px",
1048
+ "compiledValue": ""
1049
+ },
1045
1050
  {
1046
1051
  "name": "$space-500",
1047
1052
  "value": "40px",
@@ -1074,7 +1079,7 @@
1074
1079
  },
1075
1080
  {
1076
1081
  "name": "$token-spaces",
1077
- "value": "( 50: $space-50, /* Additional token */ 100: $space-100, 150: $space-150, /* Additional token */ 200: $space-200, 250: $space-250, /* Additional token */ 300: $space-300, 400: $space-400, 500: $space-500, 600: $space-600, 700: $space-700, 800: $space-800, 900: $space-900, 1000: $space-1000, )",
1082
+ "value": "( 50: $space-50, /* Additional token */ 100: $space-100, 150: $space-150, /* Additional token */ 200: $space-200, 250: $space-250, /* Additional token */ 300: $space-300, 400: $space-400, 450: $space-450, /* Additional token */ 500: $space-500, 600: $space-600, 700: $space-700, 800: $space-800, 900: $space-900, 1000: $space-1000, )",
1078
1083
  "compiledValue": ""
1079
1084
  },
1080
1085
  {
@@ -1092,14 +1097,19 @@
1092
1097
  "value": "100",
1093
1098
  "compiledValue": ""
1094
1099
  },
1100
+ {
1101
+ "name": "$z-index-overlay-page",
1102
+ "value": "7000",
1103
+ "compiledValue": ""
1104
+ },
1095
1105
  {
1096
1106
  "name": "$z-index-modal",
1097
- "value": "9999",
1107
+ "value": "8000",
1098
1108
  "compiledValue": ""
1099
1109
  },
1100
1110
  {
1101
1111
  "name": "$z-index-top-line",
1102
- "value": "9999",
1112
+ "value": "8000",
1103
1113
  "compiledValue": ""
1104
1114
  },
1105
1115
  {
@@ -1,13 +1,22 @@
1
1
  <template>
2
- <div class="mc-field-select" :class="classes" :style="styles" ref="field">
2
+ <div ref="field" class="mc-field-select" :class="classes" :style="styles">
3
3
  <div :for="name" class="mc-field-select__header">
4
4
  <!-- @slot Слот заголовка -->
5
5
  <slot name="header">
6
- <mc-title v-if="title" :ellipsis="false" max-width="100%" weight="medium">{{ computedTitle }}</mc-title>
6
+ <mc-title v-if="hasTitle" :ellipsis="false" max-width="100%" weight="medium">{{
7
+ computedTitle
8
+ }}</mc-title>
7
9
  </slot>
8
10
  </div>
9
11
  <div class="mc-field-select__main">
10
- <multi-select v-bind="tagBind" @input="handleChange" @tag="handleTag" @search-change="handleSearchChange">
12
+ <multi-select
13
+ :ref="key"
14
+ v-bind="tagBind"
15
+ @input="handleChange"
16
+ @tag="handleTag"
17
+ @search-change="handleSearchChange"
18
+ @open="repositionDropDown"
19
+ >
11
20
  <template slot="singleLabel" slot-scope="{ option }">
12
21
  <mc-preview v-if="optionWithPreview" class="option__desc" size="l">
13
22
  <mc-svg-icon slot="left" :name="option.icon" size="400" />
@@ -285,10 +294,18 @@ export default {
285
294
  type: String,
286
295
  default: null,
287
296
  },
297
+ /**
298
+ * Рендерить ли выпадающий список абсолютно, что бы помещался в ограниченном пространстве
299
+ * */
300
+ renderAbsoluteList: {
301
+ type: Boolean,
302
+ default: false,
303
+ },
288
304
  },
289
305
  data() {
290
306
  return {
291
307
  searchValue: null,
308
+ key: `field_select_${Date.now()}`,
292
309
  }
293
310
  },
294
311
  computed: {
@@ -314,6 +331,9 @@ export default {
314
331
  ...(this.groupKeys ? { groupValues: this.groupKeys.values } : {}),
315
332
  }
316
333
  },
334
+ hasTitle() {
335
+ return !!this.title
336
+ },
317
337
  /**
318
338
  * Если режим taggable && searchValueInOptions то добавлять введенный тег в опции
319
339
  * **/
@@ -387,6 +407,31 @@ export default {
387
407
  },
388
408
  },
389
409
  methods: {
410
+ repositionDropDown() {
411
+ if (!this.renderAbsoluteList) return
412
+ const { top, height, width, left } = this.$el.getBoundingClientRect()
413
+ const ref = this.$refs[this.key]
414
+
415
+ if (ref) {
416
+ ref.$refs.list.style.width = `${width}px`
417
+ ref.$refs.list.style.position = 'fixed'
418
+ ref.$refs.list.style.left = `${left}px`
419
+
420
+ const title_height = document.querySelector('.mc-field-select__header').offsetHeight
421
+ const title_margin = 8
422
+
423
+ switch (this.openDirection) {
424
+ case 'top':
425
+ ref.$refs.list.style.top = `${top + (this.hasTitle ? title_height + title_margin : 0) - 300}px`
426
+ ref.$refs.list.style.bottom = 'auto'
427
+ break
428
+ case 'bottom':
429
+ ref.$refs.list.style.bottom = 'auto'
430
+ ref.$refs.list.style.top = `${top + height}px`
431
+ break
432
+ }
433
+ }
434
+ },
390
435
  handleChange(value) {
391
436
  /**
392
437
  * Истинное значение инпута
@@ -611,6 +656,7 @@ $text-white: scale-color($color-white, $alpha: -10%);
611
656
  box-shadow: $shadow-s;
612
657
  overflow-y: auto;
613
658
  overflow-x: hidden;
659
+ max-height: 300px;
614
660
  }
615
661
 
616
662
  &--above {
@@ -28,7 +28,7 @@ export default {
28
28
  */
29
29
  placement: {
30
30
  type: String,
31
- default: 'bottom',
31
+ default: 'top',
32
32
  },
33
33
  /**
34
34
  * Цвет:
@@ -57,7 +57,7 @@ export default {
57
57
  */
58
58
  size: {
59
59
  type: String,
60
- default: 'm',
60
+ default: 's',
61
61
  },
62
62
  /**
63
63
  * Событие по отображению:
@@ -0,0 +1,79 @@
1
+ <template>
2
+ <section :class="classes" class="mc-overlay">
3
+ <section class="mc-overlay__spinner"></section>
4
+ </section>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ name: 'McOverlay',
10
+ props: {
11
+ size: {
12
+ type: [String, Number],
13
+ default: 500,
14
+ },
15
+ backgroundColor: {
16
+ type: String,
17
+ default: 'white',
18
+ },
19
+ },
20
+ computed: {
21
+ classes() {
22
+ return {
23
+ [`mc-overlay--${this.size}`]: !!this.size,
24
+ [`mc-overlay--${this.backgroundColor}`]: !this.transparent,
25
+ }
26
+ },
27
+ },
28
+ }
29
+ </script>
30
+
31
+ <style lang="scss">
32
+ .mc-overlay {
33
+ $block-name: &;
34
+ position: absolute;
35
+ top: 0;
36
+ left: 0;
37
+ width: 100%;
38
+ height: 100%;
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ z-index: $z-index-overlay-page;
43
+ &__spinner {
44
+ display: block;
45
+ border: 2px solid $color-purple;
46
+ border-left-color: transparent;
47
+ border-radius: 50%;
48
+ animation: rotate 1.5s infinite linear;
49
+
50
+ width: var(--spinner-size);
51
+ min-width: var(--spinner-size);
52
+ height: var(--spinner-size);
53
+ min-height: var(--spinner-size);
54
+
55
+ @keyframes rotate {
56
+ from {
57
+ transform: rotate(0deg);
58
+ }
59
+ to {
60
+ transform: rotate(360deg);
61
+ }
62
+ }
63
+ }
64
+ @each $color, $value in $token-colors {
65
+ &--#{$color} {
66
+ @if $color != 'transparent' {
67
+ background-color: rgba($value, 0.85);
68
+ } @else {
69
+ background-color: $value;
70
+ }
71
+ }
72
+ }
73
+ @each $size, $value in $token-icon-sizes {
74
+ &--#{$size} {
75
+ --spinner-size: #{$value};
76
+ }
77
+ }
78
+ }
79
+ </style>
@@ -48,6 +48,7 @@
48
48
  <mc-title color="outline-gray">{{ placeholders.loading }}</mc-title>
49
49
  </div>
50
50
  </div>
51
+ <mc-overlay v-if="overlayLoading" size="700" />
51
52
  </div>
52
53
  </template>
53
54
 
@@ -59,6 +60,7 @@ import _isEmpty from 'lodash/isEmpty'
59
60
  import McTitle from '../../../elements/McTitle/McTitle'
60
61
  import McSvgIcon from '../../../elements/McSvgIcon/McSvgIcon'
61
62
  import McTableCol from '../McTableCol/McTableCol'
63
+ import McOverlay from '../../McOverlay/McOverlay.vue'
62
64
 
63
65
  /**
64
66
  * More info: https://xuliangzhan.com/vxe-table, https://xuliangzhan.github.io/vxe-table
@@ -69,6 +71,7 @@ export default {
69
71
  McTitle,
70
72
  McSvgIcon,
71
73
  McTableCol,
74
+ McOverlay,
72
75
  },
73
76
  provide() {
74
77
  const provideData = {}
@@ -155,6 +158,13 @@ export default {
155
158
  type: Boolean,
156
159
  default: false,
157
160
  },
161
+ /**
162
+ * Оверлей со спиннером
163
+ */
164
+ overlayLoading: {
165
+ type: Boolean,
166
+ default: false,
167
+ },
158
168
  /**
159
169
  * По какому столбцу
160
170
  * выполнена сортировка