@mixd-id/web-scaffold 0.1.230406205 → 0.1.230406207

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.1.230406205",
4
+ "version": "0.1.230406207",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -102,14 +102,20 @@ export default{
102
102
  index: 0,
103
103
  timeoutId: null,
104
104
  scrollPosition: null,
105
+ swiping: false,
105
106
  }
106
107
  },
107
108
 
108
109
  mounted(){
110
+ window.addEventListener('touchmove', this.onTouchMove, { passive: false });
109
111
  if(this.autoPlay > 0)
110
112
  this.play()
111
113
  },
112
114
 
115
+ unmounted() {
116
+ window.removeEventListener('touchmove', this.onTouchMove, { passive: false });
117
+ },
118
+
113
119
  watch:{
114
120
 
115
121
  index(to){
@@ -125,6 +131,14 @@ export default{
125
131
 
126
132
  methods:{
127
133
 
134
+ onTouchMove(e){
135
+ if(this.swiping && e.cancelable) {
136
+ e.preventDefault();
137
+ e.returnValue = false;
138
+ return false;
139
+ }
140
+ },
141
+
128
142
  setPosition(noAnimation) {
129
143
  if(!this.$refs.inner) return
130
144
 
@@ -210,7 +224,7 @@ export default{
210
224
  }
211
225
  else if(Math.abs(dx) > 3){
212
226
  this._props['direction'] = 'horizontal'
213
- this.disableBodyScroll()
227
+ this.swiping = true
214
228
  }
215
229
  }
216
230
  else if(this._props['direction'] === 'horizontal'){
@@ -237,7 +251,7 @@ export default{
237
251
  this.setPosition()
238
252
  }
239
253
 
240
- this.enableBodyScroll()
254
+ this.swiping = false
241
255
  }
242
256
 
243
257
  window.removeEventListener('mousemove', this.mouseMove)
@@ -755,6 +755,13 @@ export default{
755
755
  }
756
756
  }
757
757
 
758
+ const whitelistProps = [ 'containerVariant' ]
759
+ whitelistProps.forEach((key) => {
760
+ if(component.props[key]){
761
+ instance[key] = component.props[key]
762
+ }
763
+ })
764
+
758
765
  if(Array.isArray(component.items)){
759
766
  instance.items = component.items.map((_) => this.createComponentInstance(_)).filter(_=>_)
760
767
  }