mediacube-ui 0.1.379 → 0.1.381
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.381](https://github.com/MediaCubeCo/mcui/compare/v0.1.380...v0.1.381) (2025-05-30)
|
|
6
|
+
|
|
7
|
+
### [0.1.380](https://github.com/MediaCubeCo/mcui/compare/v0.1.379...v0.1.380) (2025-05-29)
|
|
8
|
+
|
|
5
9
|
### [0.1.379](https://github.com/MediaCubeCo/mcui/compare/v0.1.378...v0.1.379) (2025-05-14)
|
|
6
10
|
|
|
7
11
|
### [0.1.378](https://github.com/MediaCubeCo/mcui/compare/v0.1.377...v0.1.378) (2025-05-08)
|
package/package.json
CHANGED
|
@@ -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,
|
|
@@ -592,7 +598,8 @@ export default {
|
|
|
592
598
|
/**
|
|
593
599
|
* Remove leading zero from input if length > 1 && number isn't decimal
|
|
594
600
|
* */
|
|
595
|
-
|
|
601
|
+
handleRemoveLeadingZero(val) {
|
|
602
|
+
if (!this.removeLeadingZero) return val
|
|
596
603
|
let result = val
|
|
597
604
|
const [first_char] = val || []
|
|
598
605
|
if (val.length > 1 && +first_char === 0 && val.indexOf('.') === -1) result = val.slice(1)
|
|
@@ -607,21 +614,21 @@ export default {
|
|
|
607
614
|
case 'num': {
|
|
608
615
|
let [num] = /-?\d*[\.]?\d*/.exec(String(value)) || []
|
|
609
616
|
num = this.setDecimalsLimit(num)
|
|
610
|
-
num = this.
|
|
617
|
+
num = this.handleRemoveLeadingZero(num)
|
|
611
618
|
value = num
|
|
612
619
|
e.target.value = num
|
|
613
620
|
break
|
|
614
621
|
}
|
|
615
622
|
case 'int': {
|
|
616
623
|
let [int] = /-?\d*/.exec(String(e.target.value)) || []
|
|
617
|
-
int = this.
|
|
624
|
+
int = this.handleRemoveLeadingZero(int)
|
|
618
625
|
value = int
|
|
619
626
|
e.target.value = int
|
|
620
627
|
break
|
|
621
628
|
}
|
|
622
629
|
case 'amount_format': {
|
|
623
630
|
value = this.setDecimalsLimit(value)
|
|
624
|
-
value = this.
|
|
631
|
+
value = this.handleRemoveLeadingZero(value)
|
|
625
632
|
const cursor_position = this.getCaretPos(e.target)?.start
|
|
626
633
|
const prepared_value = this.formattedToNumber(value)
|
|
627
634
|
|
|
@@ -418,6 +418,12 @@ export default {
|
|
|
418
418
|
})
|
|
419
419
|
}
|
|
420
420
|
},
|
|
421
|
+
items: {
|
|
422
|
+
handler(value) {
|
|
423
|
+
if (value && value.length) this.checkOccupancy()
|
|
424
|
+
},
|
|
425
|
+
immediate: true,
|
|
426
|
+
},
|
|
421
427
|
},
|
|
422
428
|
mounted() {
|
|
423
429
|
this.setFirstColsWidth()
|
|
@@ -454,6 +460,14 @@ export default {
|
|
|
454
460
|
}),
|
|
455
461
|
]
|
|
456
462
|
},
|
|
463
|
+
checkOccupancy() {
|
|
464
|
+
if (!this.$refs.xTable) return
|
|
465
|
+
const tableHeight = this.$refs.xTable.$el.getBoundingClientRect().height
|
|
466
|
+
const tableDataHeight = this.$refs.xTable.rowHeight * this.items.length
|
|
467
|
+
if (tableHeight >= tableDataHeight && this.hasMore) {
|
|
468
|
+
this.load()
|
|
469
|
+
}
|
|
470
|
+
},
|
|
457
471
|
load() {
|
|
458
472
|
/**
|
|
459
473
|
* Событие по подгрузке данных
|