mediacube-ui 0.1.378 → 0.1.380

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.380](https://github.com/MediaCubeCo/mcui/compare/v0.1.379...v0.1.380) (2025-05-29)
6
+
7
+ ### [0.1.379](https://github.com/MediaCubeCo/mcui/compare/v0.1.378...v0.1.379) (2025-05-14)
8
+
5
9
  ### [0.1.378](https://github.com/MediaCubeCo/mcui/compare/v0.1.377...v0.1.378) (2025-05-08)
6
10
 
7
11
  ### [0.1.377](https://github.com/MediaCubeCo/mcui/compare/v0.1.376...v0.1.377) (2025-05-08)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediacube-ui",
3
- "version": "0.1.378",
3
+ "version": "0.1.380",
4
4
  "description": "Design system for Mediacube services",
5
5
  "author": "Mediacube",
6
6
  "private": false,
@@ -816,17 +816,27 @@ export default {
816
816
  display: flex;
817
817
  justify-content: space-between;
818
818
  align-items: center;
819
- @include child-indent-right($space-200);
820
- > * {
821
- @include child-indent-right($space-300);
819
+ flex-direction: column;
820
+ row-gap: $space-150;
821
+ @media #{$media-query-m} {
822
+ flex-direction: row;
823
+ @include child-indent-right($space-200);
824
+ > * {
825
+ @include child-indent-right($space-300);
826
+ }
822
827
  }
823
828
  &-periods {
824
- @include child-indent-right(0);
825
- column-gap: $space-300;
826
829
  row-gap: $space-100;
827
830
  align-items: center;
828
831
  display: flex;
829
832
  flex-wrap: wrap;
833
+ width: 100%;
834
+ justify-content: space-between;
835
+ @media #{$media-query-m} {
836
+ width: auto;
837
+ column-gap: $space-300;
838
+ @include child-indent-right($space-zero);
839
+ }
830
840
  }
831
841
  .mc-button {
832
842
  @include child-indent-right($space-zero);
@@ -380,8 +380,14 @@ export default {
380
380
  type: Number,
381
381
  default: 2,
382
382
  },
383
+ /**
384
+ * Убираем ли лидирующий 0 01 -> 1 для числовых инпутов num/int/amount_format
385
+ */
386
+ removeLeadingZero: {
387
+ type: Boolean,
388
+ default: true,
389
+ },
383
390
  },
384
-
385
391
  data() {
386
392
  return {
387
393
  prependWidth: 0,
@@ -496,7 +502,7 @@ export default {
496
502
 
497
503
  inputAttrs() {
498
504
  return {
499
- class: 'mc-field-text__input',
505
+ class: this.inputClasses,
500
506
  style: this.inputStyles,
501
507
  placeholder: this.placeholder,
502
508
  value: this.computedValue,
@@ -507,6 +513,16 @@ export default {
507
513
  tabindex: this.tabindex,
508
514
  }
509
515
  },
516
+ inputClasses() {
517
+ return {
518
+ 'mc-field-text__input': true,
519
+ 'mc-field-text__input--text-normalized': this.isPhoneType && this.isRtl,
520
+ }
521
+ },
522
+
523
+ isPhoneType() {
524
+ return this.type === 'phone_number'
525
+ },
510
526
 
511
527
  isPasswordType() {
512
528
  return this.prettyType === 'password'
@@ -582,7 +598,8 @@ export default {
582
598
  /**
583
599
  * Remove leading zero from input if length > 1 && number isn't decimal
584
600
  * */
585
- removeLeadingZero(val) {
601
+ handleRemoveLeadingZero(val) {
602
+ if (!this.removeLeadingZero) return val
586
603
  let result = val
587
604
  const [first_char] = val || []
588
605
  if (val.length > 1 && +first_char === 0 && val.indexOf('.') === -1) result = val.slice(1)
@@ -597,21 +614,21 @@ export default {
597
614
  case 'num': {
598
615
  let [num] = /-?\d*[\.]?\d*/.exec(String(value)) || []
599
616
  num = this.setDecimalsLimit(num)
600
- num = this.removeLeadingZero(num)
617
+ num = this.handleRemoveLeadingZero(num)
601
618
  value = num
602
619
  e.target.value = num
603
620
  break
604
621
  }
605
622
  case 'int': {
606
623
  let [int] = /-?\d*/.exec(String(e.target.value)) || []
607
- int = this.removeLeadingZero(int)
624
+ int = this.handleRemoveLeadingZero(int)
608
625
  value = int
609
626
  e.target.value = int
610
627
  break
611
628
  }
612
629
  case 'amount_format': {
613
630
  value = this.setDecimalsLimit(value)
614
- value = this.removeLeadingZero(value)
631
+ value = this.handleRemoveLeadingZero(value)
615
632
  const cursor_position = this.getCaretPos(e.target)?.start
616
633
  const prepared_value = this.formattedToNumber(value)
617
634
 
@@ -892,6 +909,10 @@ export default {
892
909
  @include input-placeholder() {
893
910
  color: $color-gray;
894
911
  }
912
+ &--text-normalized {
913
+ text-align: right;
914
+ unicode-bidi: plaintext;
915
+ }
895
916
  }
896
917
 
897
918
  &__footer {
@@ -635,7 +635,7 @@ export default {
635
635
  display: flex;
636
636
  align-items: center;
637
637
  justify-content: center;
638
- height: $size-700;
638
+ height: $size-500;
639
639
  background-color: $color-white;
640
640
  color: $color-outline-gray;
641
641
  @include child-indent-right($space-100);
@@ -34,7 +34,10 @@
34
34
  margin-inline-end: $space-50;
35
35
  }
36
36
  &:first-of-type {
37
- margin-inline-start: $space-600;
37
+ margin-inline-start: auto;
38
+ @media #{$media-query-s} {
39
+ margin-inline-start: $space-600;
40
+ }
38
41
  }
39
42
  &:last-child {
40
43
  margin-inline-end: -$space-300; // TODO: refactor negative margin