mediacube-ui 0.1.99 → 0.1.100

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,8 @@
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.100](https://github.com/MediaCubeCo/mcui/compare/v0.1.99...v0.1.100) (2023-08-04)
6
+
5
7
  ### [0.1.99](https://github.com/MediaCubeCo/mcui/compare/v0.1.98...v0.1.99) (2023-08-02)
6
8
 
7
9
  ### [0.1.98](https://github.com/MediaCubeCo/mcui/compare/v0.1.97...v0.1.98) (2023-08-01)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediacube-ui",
3
- "version": "0.1.99",
3
+ "version": "0.1.100",
4
4
  "description": "Design system for Mediacube services",
5
5
  "author": "Mediacube",
6
6
  "private": false,
@@ -115,6 +115,7 @@
115
115
  "storybook-addon-designs": "^5.4.0",
116
116
  "storybook-design-token": "^0.7.7",
117
117
  "style-loader": "^1.2.1",
118
+ "svgstore": "^3.0.1",
118
119
  "vue-lazyload": "^1.3.3",
119
120
  "vue-loader": "^15.9.5",
120
121
  "vue-slider-component": "^3.2.2",
@@ -1469,6 +1469,13 @@
1469
1469
  </symbol><symbol id="fullscreen" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></symbol><symbol id="get_app" viewBox="0 0 24 24">
1470
1470
  <path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/>
1471
1471
  <path d="M0 0h24v24H0z" fill="none"/>
1472
+ </symbol><symbol id="gift_solid" viewBox="0 0 24 24">
1473
+ <rect width="24" height="24" rx="12" fill="currentColor"/>
1474
+ <path d="M13.5556 11.2222H17.8333C18.1428 11.2222 18.4395 11.0993 18.6583 10.8805C18.8771 10.6617 19 10.3649 19 10.0555V9.27775C19 8.96833 18.8771 8.67159 18.6583 8.45279C18.4395 8.234 18.1428 8.11108 17.8333 8.11108H6.16667C5.85725 8.11108 5.5605 8.234 5.34171 8.45279C5.12292 8.67159 5 8.96833 5 9.27775V10.0555C5 10.3649 5.12292 10.6617 5.34171 10.8805C5.5605 11.0993 5.85725 11.2222 6.16667 11.2222H10.4444" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1475
+ <path d="M18.2218 11.2222V17.4445C18.2218 17.857 18.0579 18.2527 17.7662 18.5444C17.4745 18.8361 17.0788 19 16.6662 19H7.3329C6.92034 19 6.52468 18.8361 6.23296 18.5444C5.94123 18.2527 5.77734 17.857 5.77734 17.4445V11.2222" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1476
+ <path d="M10.4442 5C10.8568 5 11.2524 5.16389 11.5442 5.45561C11.8359 5.74733 11.9998 6.143 11.9998 6.55556V8.11111H10.4442C10.0317 8.11111 9.63601 7.94722 9.34428 7.6555C9.05256 7.36378 8.88867 6.96811 8.88867 6.55556C8.88867 6.143 9.05256 5.74733 9.34428 5.45561C9.63601 5.16389 10.0317 5 10.4442 5Z" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1477
+ <path d="M13.5556 5C13.9681 5 14.3638 5.16389 14.6555 5.45561C14.9472 5.74733 15.1111 6.143 15.1111 6.55556C15.1111 6.96811 14.9472 7.36378 14.6555 7.6555C14.3638 7.94722 13.9681 8.11111 13.5556 8.11111H12V6.55556C12 6.143 12.1639 5.74733 12.4556 5.45561C12.7473 5.16389 13.143 5 13.5556 5Z" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1478
+ <path d="M12.7786 8.11108H11.2231C10.7935 8.11108 10.4453 8.45931 10.4453 8.88886V18.2222C10.4453 18.6518 10.7935 19 11.2231 19H12.7786C13.2082 19 13.5564 18.6518 13.5564 18.2222V8.88886C13.5564 8.45931 13.2082 8.11108 12.7786 8.11108Z" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1472
1479
  </symbol><symbol id="glasses" viewBox="0 0 24 24">
1473
1480
  <path d="M17.903 4L19.574 5.142C20.056 5.471 20.37 5.995 20.434 6.576L21.464 16M9.50001 16.473C9.50001 15.161 10.619 14.098 12 14.098C13.381 14.098 14.5 15.161 14.5 16.473M6.09701 4L4.42601 5.142C3.94401 5.471 3.63001 5.995 3.56701 6.576L2.53601 16M20.4749 14.0251C21.8417 15.3919 21.8417 17.608 20.4749 18.9748C19.1081 20.3417 16.892 20.3417 15.5252 18.9748C14.1583 17.608 14.1583 15.3919 15.5252 14.0251C16.892 12.6583 19.1081 12.6583 20.4749 14.0251ZM8.47488 14.0251C9.84172 15.3919 9.84172 17.608 8.47488 18.9748C7.10804 20.3417 4.89197 20.3417 3.52513 18.9748C2.15829 17.608 2.15829 15.3919 3.52513 14.0251C4.89197 12.6583 7.10804 12.6583 8.47488 14.0251Z" stroke="currentColor" fill="none" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1474
1481
  </symbol><symbol id="google_colored" viewBox="0 0 24 24">
@@ -155,6 +155,7 @@ import McFilterTypeRelation from './McFilterTypeRelation/McFilterTypeRelation'
155
155
  import McFilterTypeText from './McFilterTypeText/McFilterTypeText'
156
156
  import McFilterTypeRange from './McFilterTypeRange/McFilterTypeRange'
157
157
  import McFilterTypeDate from './McFilterTypeDate/McFilterTypeDate'
158
+ import McFilterTypeLabels from './McFilterTypeLabels/McFilterTypeLabels'
158
159
  import McFilterTags from './McFilterTags/McFilterTags'
159
160
  import McChip from '../../elements/McChip/McChip'
160
161
 
@@ -166,6 +167,7 @@ export default {
166
167
  McFilterTypeText,
167
168
  McFilterTypeRange,
168
169
  McFilterTypeDate,
170
+ McFilterTypeLabels,
169
171
  McSvgIcon,
170
172
  McButton,
171
173
  McTitle,
@@ -197,7 +199,7 @@ export default {
197
199
  * [{
198
200
  name: Filter title,
199
201
  value: [String] - Filter value(key),
200
- type: [String] - Filter type(relation / date / text / fast),
202
+ type: [String] - Filter type(relation / date / text / fast / labels),
201
203
  options: [Array] - Filter options,
202
204
  getAjaxOne: [Function] - Method for get selected options when filter initialize,
203
205
  getAjaxOptions: [Function] - Method for get options by API,
@@ -440,11 +442,32 @@ export default {
440
442
  this.activeTag ? this.editTag() : this.addTag()
441
443
  },
442
444
  editTag() {
443
- this.currentFilter.type === 'relation' ? this.editRelationValue() : this.addSimpleValue()
445
+ switch (this.currentFilter.type) {
446
+ case 'relation':
447
+ case 'labels': {
448
+ this.editRelationValue()
449
+ break
450
+ }
451
+ default: {
452
+ this.addSimpleValue()
453
+ break
454
+ }
455
+ }
444
456
  this.activeTag = null
445
457
  },
446
458
  addTag() {
447
- this.currentFilter.type === 'relation' ? this.addRelationValue() : this.addSimpleValue()
459
+ switch (this.currentFilter.type) {
460
+ case 'relation':
461
+ case 'labels': {
462
+ this.addRelationValue()
463
+ break
464
+ }
465
+ default: {
466
+ this.addSimpleValue()
467
+ break
468
+ }
469
+ }
470
+ this.activeTag = null
448
471
  },
449
472
  editRelationValue() {
450
473
  const tagRelationValue = this.activeTag.relationKey === 'exists' ? [0] : [this.activeTag.value]
@@ -536,6 +559,8 @@ export default {
536
559
  setEmptyCondition() {
537
560
  switch (this.currentFilter.type) {
538
561
  case 'relation':
562
+ case 'date':
563
+ case 'labels':
539
564
  this.handleConditionChange()
540
565
  break
541
566
  case 'text':
@@ -544,9 +569,6 @@ export default {
544
569
  case 'range':
545
570
  this.handleConditionChange({})
546
571
  break
547
- case 'date':
548
- this.handleConditionChange()
549
- break
550
572
  default:
551
573
  break
552
574
  }
@@ -0,0 +1,131 @@
1
+ <template>
2
+ <mc-field-text
3
+ v-model="selectedOptionValue"
4
+ :placeholder="filter.placeholder || placeholders.choose"
5
+ class="mc-filter-type-labels"
6
+ name="labels_text"
7
+ >
8
+ <div slot="header" class="mc-filter-type-labels__header">
9
+ <mc-title>{{ placeholders.condition }}</mc-title>
10
+ <div class="mc-filter-type-labels__buttons">
11
+ <mc-button
12
+ v-for="relation in relations"
13
+ :key="relation"
14
+ :variation="relation_type === relation ? 'purple' : 'dark-gray-outline'"
15
+ @click="() => changeRelationType(relation)"
16
+ >
17
+ {{ placeholders.actions[relation] }}
18
+ </mc-button>
19
+ </div>
20
+ </div>
21
+ </mc-field-text>
22
+ </template>
23
+
24
+ <script>
25
+ import McButton from '../../../elements/McButton/McButton'
26
+ import McTitle from '../../../elements/McTitle/McTitle'
27
+ import McFieldText from '../../../elements/McField/McFieldText/McFieldText'
28
+
29
+ export default {
30
+ name: 'McFilterTypeLabels',
31
+ components: {
32
+ McButton,
33
+ McTitle,
34
+ McFieldText,
35
+ },
36
+ props: {
37
+ /**
38
+ * Значение
39
+ */
40
+ value: {
41
+ // type: [String, Number],
42
+ default: null,
43
+ },
44
+ /**
45
+ * Объект выбранного
46
+ * фильтра
47
+ */
48
+ filter: {
49
+ type: Object,
50
+ default: () => {},
51
+ },
52
+ /**
53
+ * Переводы локализаций
54
+ */
55
+ placeholders: {
56
+ type: Object,
57
+ required: true,
58
+ },
59
+ /**
60
+ * Текущее значение
61
+ * добавленных фильтров
62
+ */
63
+ currentValues: {
64
+ type: Object,
65
+ default: () => {},
66
+ },
67
+ },
68
+ data() {
69
+ return {
70
+ relations: ['is', 'is_not'],
71
+ relation_type: 'is',
72
+ }
73
+ },
74
+ computed: {
75
+ selectedOptionValue: {
76
+ get() {
77
+ let val = this.value
78
+ if (val) {
79
+ for (let [relationKey, relationVal] of Object.entries(this.value)) {
80
+ [val] = relationVal || []
81
+ }
82
+ }
83
+ return val
84
+ },
85
+ set(val) {
86
+ let currentValue = null
87
+ let currentValueName = null
88
+ if (val) {
89
+ currentValue = { [this.relation_type]: [val] }
90
+ currentValueName = { [this.relation_type]: { [val]: val } }
91
+ }
92
+
93
+ this.$emit('input', currentValue, currentValueName)
94
+ },
95
+ },
96
+ },
97
+ watch: {
98
+ filter() {
99
+ this.relation_type = 'is'
100
+ },
101
+ },
102
+ methods: {
103
+ changeRelationType(relation) {
104
+ if (this.relation_type === relation) return
105
+ this.relation_type = relation
106
+ },
107
+ },
108
+ }
109
+ </script>
110
+
111
+ <style lang="scss">
112
+ .mc-filter-type-labels {
113
+ $block-name: &;
114
+ width: 300px;
115
+ &__header {
116
+ display: flex;
117
+ align-items: center;
118
+ justify-content: space-between;
119
+ margin-bottom: -$space-50;
120
+ margin-top: -$space-50;
121
+ }
122
+ &__buttons {
123
+ display: flex;
124
+ @include child-indent-right($space-50);
125
+ .mc-button {
126
+ height: $size-300;
127
+ padding: $space-50 $space-150;
128
+ }
129
+ }
130
+ }
131
+ </style>
@@ -5,8 +5,9 @@
5
5
  $z-index-sticky-tabs: 49;
6
6
  $z-index-dropdown: 100;
7
7
  $z-index-sticky: 100;
8
- $z-index-modal: 9999;
9
- $z-index-top-line: 9999;
8
+ $z-index-overlay-page: 7000;
9
+ $z-index-modal: 8000;
10
+ $z-index-top-line: 8000;
10
11
  $z-index-header: 10000;
11
12
  $z-index-notification: 10001;
12
13
  $z-index-overlay: 10002;