mediacube-ui 0.1.30 → 0.1.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediacube-ui",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "description": "Design system for Mediacube services",
5
5
  "author": "Mediacube",
6
6
  "private": false,
@@ -545,16 +545,13 @@ export default {
545
545
  case 'amount_format':
546
546
  value = this.setDecimalsLimit(value)
547
547
  const cursor_position = this.getCaretPos(e.target)?.start
548
-
549
548
  const prepared_value = this.formattedToNumber(value)
550
- value = prepared_value ? parseFloat(prepared_value) : null
551
- e.target.value = this.isRtl ? value : this.getAmountFormat(prepared_value)
552
549
 
553
- if (!this.isRtl) {
554
- const space_length =
555
- e.target.value?.slice(0, cursor_position).replace(/[^ ]/gm, '')?.length || 0
556
- this.setCaretPos(e.target, cursor_position + space_length, cursor_position + space_length)
557
- }
550
+ value = prepared_value ? parseFloat(prepared_value) : null
551
+ const formatted_value = this.getAmountFormat(prepared_value)
552
+ e.target.value = this.isRtl ? formatted_value.replace(/ /gm, '') : formatted_value
553
+ const space_length = e.target.value?.slice(0, cursor_position).replace(/[^ ]/gm, '')?.length || 0
554
+ this.setCaretPos(e.target, cursor_position + space_length, cursor_position + space_length)
558
555
  break
559
556
  }
560
557