mediacube-ui 0.1.217 → 0.1.218
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.218](https://github.com/MediaCubeCo/mcui/compare/v0.1.217...v0.1.218) (2024-02-06)
|
|
6
|
+
|
|
5
7
|
### [0.1.217](https://github.com/MediaCubeCo/mcui/compare/v0.1.216...v0.1.217) (2024-02-02)
|
|
6
8
|
|
|
7
9
|
### [0.1.216](https://github.com/MediaCubeCo/mcui/compare/v0.1.215...v0.1.216) (2024-02-02)
|
package/package.json
CHANGED
|
@@ -346,6 +346,8 @@ export default {
|
|
|
346
346
|
return {
|
|
347
347
|
pickDate: null,
|
|
348
348
|
phone: null,
|
|
349
|
+
currentTouchArea: null,
|
|
350
|
+
firstTouch: true,
|
|
349
351
|
}
|
|
350
352
|
},
|
|
351
353
|
computed: {
|
|
@@ -419,8 +421,14 @@ export default {
|
|
|
419
421
|
handler() {
|
|
420
422
|
this.setupDayjsLocale()
|
|
421
423
|
this.setupDatePickerLocale()
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
mounted() {
|
|
428
|
+
document.addEventListener('touchstart', this.handleTouch)
|
|
429
|
+
},
|
|
430
|
+
beforeDestroy() {
|
|
431
|
+
document.removeEventListener('touchstart', this.handleTouch)
|
|
424
432
|
},
|
|
425
433
|
methods: {
|
|
426
434
|
async setupDayjsLocale() {
|
|
@@ -539,6 +547,21 @@ export default {
|
|
|
539
547
|
closePopup() {
|
|
540
548
|
this.$refs.input.closePopup()
|
|
541
549
|
},
|
|
550
|
+
handleTouch(event) {
|
|
551
|
+
const currentArea = this.getTouchArea(event)
|
|
552
|
+
|
|
553
|
+
if (this.firstTouch && currentArea !== this.currentTouchArea) {
|
|
554
|
+
event.target.click()
|
|
555
|
+
this.firstTouch = true
|
|
556
|
+
this.currentTouchArea = currentArea
|
|
557
|
+
}
|
|
558
|
+
},
|
|
559
|
+
getTouchArea(event) {
|
|
560
|
+
// Определяем в какой области (минуты или секунды) произошло касание
|
|
561
|
+
const min = document.querySelector(`[data-type="minute"]`)
|
|
562
|
+
const sec = document.querySelector(`[data-type="second"]`)
|
|
563
|
+
return min?.contains(event.target) ? 'minute' : sec?.contains(event.target) ? 'second' : null
|
|
564
|
+
},
|
|
542
565
|
},
|
|
543
566
|
}
|
|
544
567
|
</script>
|