mediacube-ui 0.1.406 → 0.1.409
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,12 @@
|
|
|
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.409](https://github.com/MediaCubeCo/mcui/compare/v0.1.408...v0.1.409) (2025-09-16)
|
|
6
|
+
|
|
7
|
+
### [0.1.408](https://github.com/MediaCubeCo/mcui/compare/v0.1.407...v0.1.408) (2025-09-16)
|
|
8
|
+
|
|
9
|
+
### [0.1.407](https://github.com/MediaCubeCo/mcui/compare/v0.1.406...v0.1.407) (2025-09-02)
|
|
10
|
+
|
|
5
11
|
### [0.1.406](https://github.com/MediaCubeCo/mcui/compare/v0.1.405...v0.1.406) (2025-09-02)
|
|
6
12
|
|
|
7
13
|
### [0.1.405](https://github.com/MediaCubeCo/mcui/compare/v0.1.404...v0.1.405) (2025-09-02)
|
package/package.json
CHANGED
|
@@ -52,7 +52,18 @@
|
|
|
52
52
|
</div>
|
|
53
53
|
</div>
|
|
54
54
|
</template>
|
|
55
|
-
|
|
55
|
+
<template slot="tag" slot-scope="{ option, remove }">
|
|
56
|
+
<mc-chip
|
|
57
|
+
variation="main-alpha-10-invert"
|
|
58
|
+
class="multiselect__tag"
|
|
59
|
+
text-color="black"
|
|
60
|
+
size="s"
|
|
61
|
+
:closable="!option.hasOwnProperty('is_closable') || option.is_closable"
|
|
62
|
+
@click="remove(option)"
|
|
63
|
+
>
|
|
64
|
+
{{ option.name }}
|
|
65
|
+
</mc-chip>
|
|
66
|
+
</template>
|
|
56
67
|
<template
|
|
57
68
|
v-if="optionsTooltip || optionWithPreview || optionWithPreviewOnly"
|
|
58
69
|
slot="option"
|
|
@@ -124,6 +135,7 @@
|
|
|
124
135
|
<script>
|
|
125
136
|
import MultiSelect from 'vue-multiselect'
|
|
126
137
|
import McTitle from '../../McTitle/McTitle'
|
|
138
|
+
import McChip from '../../McChip/McChip'
|
|
127
139
|
import McTooltip from '../../McTooltip/McTooltip'
|
|
128
140
|
import McAvatar from '../../McAvatar/McAvatar'
|
|
129
141
|
import McSvgIcon from '../../McSvgIcon/McSvgIcon'
|
|
@@ -134,7 +146,7 @@ import { LANGUAGES } from '../../../helpers/consts'
|
|
|
134
146
|
|
|
135
147
|
export default {
|
|
136
148
|
name: 'McFieldSelect',
|
|
137
|
-
components: { McSvgIcon, McAvatar, McTitle, McTooltip, MultiSelect, McPreview },
|
|
149
|
+
components: { McSvgIcon, McAvatar, McTitle, McTooltip, MultiSelect, McPreview, McChip },
|
|
138
150
|
mixins: [fieldErrors, equalFieldHeight],
|
|
139
151
|
props: {
|
|
140
152
|
/**
|
|
@@ -836,7 +848,28 @@ export default {
|
|
|
836
848
|
color: $color-gray;
|
|
837
849
|
}
|
|
838
850
|
}
|
|
839
|
-
|
|
851
|
+
&__tag {
|
|
852
|
+
padding-left: 2px !important;
|
|
853
|
+
.mc-chip__button {
|
|
854
|
+
background-color: $color-white;
|
|
855
|
+
border-radius: $radius-circle;
|
|
856
|
+
opacity: 1;
|
|
857
|
+
.mc-svg-icon {
|
|
858
|
+
min-width: $space-250;
|
|
859
|
+
width: $space-250;
|
|
860
|
+
min-height: $space-250;
|
|
861
|
+
height: $space-250;
|
|
862
|
+
}
|
|
863
|
+
&:hover {
|
|
864
|
+
.mc-svg-icon {
|
|
865
|
+
fill: var(--color-red);
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
.mc-svg-icon {
|
|
869
|
+
fill: var(--color-main);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
}
|
|
840
873
|
&__input {
|
|
841
874
|
padding-inline-start: $space-50;
|
|
842
875
|
margin-bottom: $space-150 - 2px;
|
|
@@ -393,6 +393,7 @@ export default {
|
|
|
393
393
|
prependWidth: 0,
|
|
394
394
|
appendWidth: 0,
|
|
395
395
|
prettyType: this.type,
|
|
396
|
+
is_backspace: false,
|
|
396
397
|
}
|
|
397
398
|
},
|
|
398
399
|
|
|
@@ -515,13 +516,13 @@ export default {
|
|
|
515
516
|
},
|
|
516
517
|
inputClasses() {
|
|
517
518
|
return {
|
|
518
|
-
|
|
519
|
-
|
|
519
|
+
'mc-field-text__input': true,
|
|
520
|
+
'mc-field-text__input--text-normalized': this.isPhoneType && this.isRtl,
|
|
520
521
|
}
|
|
521
522
|
},
|
|
522
|
-
|
|
523
|
+
|
|
523
524
|
isPhoneType() {
|
|
524
|
-
|
|
525
|
+
return this.type === 'phone_number'
|
|
525
526
|
},
|
|
526
527
|
|
|
527
528
|
isPasswordType() {
|
|
@@ -631,7 +632,6 @@ export default {
|
|
|
631
632
|
value = this.handleRemoveLeadingZero(value)
|
|
632
633
|
const cursor_position = this.getCaretPos(e.target)?.start
|
|
633
634
|
const prepared_value = this.formattedToNumber(value)
|
|
634
|
-
|
|
635
635
|
const float_value = parseFloat(prepared_value)
|
|
636
636
|
const without_spaces_value = prepared_value.replace(/ /gm, '')
|
|
637
637
|
|
|
@@ -641,9 +641,14 @@ export default {
|
|
|
641
641
|
: without_spaces_value || float_value || prepared_value
|
|
642
642
|
: null
|
|
643
643
|
const formatted_value = this.getAmountFormat(prepared_value)
|
|
644
|
+
|
|
645
|
+
const value_without_last_symbol = this.getAmountFormat(
|
|
646
|
+
prepared_value.slice(0, prepared_value.length - 1),
|
|
647
|
+
)
|
|
648
|
+
|
|
649
|
+
const diff = this.is_backspace ? 0 : formatted_value.length - value_without_last_symbol.length - 1
|
|
644
650
|
e.target.value = this.isRtl ? formatted_value.replace(/ /gm, '') : formatted_value
|
|
645
|
-
|
|
646
|
-
this.setCaretPos(e.target, cursor_position + space_length, cursor_position + space_length)
|
|
651
|
+
this.setCaretPos(e.target, cursor_position + diff, cursor_position + diff)
|
|
647
652
|
break
|
|
648
653
|
}
|
|
649
654
|
case 'uppercase': {
|
|
@@ -680,10 +685,17 @@ export default {
|
|
|
680
685
|
switch (this.type) {
|
|
681
686
|
case 'amount_format':
|
|
682
687
|
case 'num': {
|
|
683
|
-
|
|
688
|
+
this.is_backspace = e.key?.match(/Backspace/)
|
|
689
|
+
const excluded_symbols = ['.', ',']
|
|
690
|
+
const is_excluded_symbol = excluded_symbols.includes(e.key)
|
|
691
|
+
|
|
692
|
+
if (isNaN(+e.key) && !e.key?.match(/Arrow|Backspace|\.,/) && !is_excluded_symbol) {
|
|
693
|
+
e.preventDefault()
|
|
694
|
+
}
|
|
695
|
+
|
|
684
696
|
const already_has_symbol =
|
|
685
|
-
typeof this.value === 'string' &&
|
|
686
|
-
if (
|
|
697
|
+
typeof this.value === 'string' && excluded_symbols.some(symbol => this.value.includes(symbol))
|
|
698
|
+
if (is_excluded_symbol && already_has_symbol) {
|
|
687
699
|
e.preventDefault()
|
|
688
700
|
}
|
|
689
701
|
break
|