@mpxjs/webpack-plugin 2.9.69 → 2.9.70
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/lib/parser.js +1 -1
- package/lib/platform/json/wx/index.js +21 -8
- package/lib/platform/style/wx/index.js +51 -54
- package/lib/platform/template/wx/component-config/fix-component-name.js +15 -12
- package/lib/platform/template/wx/component-config/index.js +1 -1
- package/lib/platform/template/wx/component-config/input.js +1 -1
- package/lib/platform/template/wx/component-config/rich-text.js +8 -0
- package/lib/platform/template/wx/component-config/swiper.js +1 -1
- package/lib/platform/template/wx/component-config/textarea.js +1 -1
- package/lib/platform/template/wx/component-config/unsupported.js +1 -1
- package/lib/react/processTemplate.js +3 -0
- package/lib/runtime/components/react/context.ts +4 -0
- package/lib/runtime/components/react/dist/context.js +1 -0
- package/lib/runtime/components/react/dist/event.config.js +24 -24
- package/lib/runtime/components/react/dist/getInnerListeners.js +183 -166
- package/lib/runtime/components/react/dist/mpx-button.jsx +35 -42
- package/lib/runtime/components/react/dist/mpx-canvas/html.js +2 -4
- package/lib/runtime/components/react/dist/mpx-canvas/index.jsx +35 -13
- package/lib/runtime/components/react/dist/mpx-checkbox-group.jsx +13 -19
- package/lib/runtime/components/react/dist/mpx-checkbox.jsx +29 -38
- package/lib/runtime/components/react/dist/mpx-form.jsx +16 -19
- package/lib/runtime/components/react/dist/mpx-icon.jsx +8 -16
- package/lib/runtime/components/react/dist/mpx-image.jsx +291 -0
- package/lib/runtime/components/react/dist/mpx-input.jsx +54 -27
- package/lib/runtime/components/react/dist/mpx-label.jsx +15 -22
- package/lib/runtime/components/react/dist/mpx-movable-area.jsx +13 -16
- package/lib/runtime/components/react/dist/mpx-movable-view.jsx +13 -13
- package/lib/runtime/components/react/dist/mpx-navigator.jsx +2 -4
- package/lib/runtime/components/react/dist/mpx-picker/date.jsx +6 -2
- package/lib/runtime/components/react/dist/mpx-picker/index.jsx +5 -3
- package/lib/runtime/components/react/dist/mpx-picker/multiSelector.jsx +6 -2
- package/lib/runtime/components/react/dist/mpx-picker/region.jsx +6 -2
- package/lib/runtime/components/react/dist/mpx-picker/selector.jsx +6 -2
- package/lib/runtime/components/react/dist/mpx-picker/time.jsx +10 -15
- package/lib/runtime/components/react/dist/mpx-picker-view-column.jsx +3 -1
- package/lib/runtime/components/react/dist/mpx-picker-view.jsx +5 -3
- package/lib/runtime/components/react/dist/mpx-radio-group.jsx +11 -19
- package/lib/runtime/components/react/dist/mpx-radio.jsx +27 -42
- package/lib/runtime/components/react/dist/mpx-rich-text/html.js +39 -0
- package/lib/runtime/components/react/dist/mpx-rich-text/index.jsx +63 -0
- package/lib/runtime/components/react/dist/mpx-root-portal.jsx +6 -4
- package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +47 -41
- package/lib/runtime/components/react/dist/mpx-simple-text.jsx +11 -0
- package/lib/runtime/components/react/dist/mpx-swiper/carouse.jsx +4 -2
- package/lib/runtime/components/react/dist/mpx-swiper-item.jsx +4 -2
- package/lib/runtime/components/react/dist/mpx-switch.jsx +20 -10
- package/lib/runtime/components/react/dist/mpx-text.jsx +11 -10
- package/lib/runtime/components/react/dist/mpx-textarea.jsx +8 -3
- package/lib/runtime/components/react/dist/mpx-view.jsx +34 -46
- package/lib/runtime/components/react/dist/mpx-web-view.jsx +105 -42
- package/lib/runtime/components/react/dist/useAnimationHooks.js +35 -10
- package/lib/runtime/components/react/dist/utils.jsx +107 -82
- package/lib/runtime/components/react/event.config.ts +25 -26
- package/lib/runtime/components/react/getInnerListeners.ts +238 -188
- package/lib/runtime/components/react/mpx-button.tsx +64 -50
- package/lib/runtime/components/react/mpx-canvas/html.ts +2 -4
- package/lib/runtime/components/react/mpx-canvas/index.tsx +46 -48
- package/lib/runtime/components/react/mpx-checkbox-group.tsx +28 -25
- package/lib/runtime/components/react/mpx-checkbox.tsx +48 -49
- package/lib/runtime/components/react/mpx-form.tsx +25 -28
- package/lib/runtime/components/react/mpx-icon.tsx +12 -17
- package/lib/runtime/components/react/mpx-image.tsx +436 -0
- package/lib/runtime/components/react/mpx-input.tsx +77 -57
- package/lib/runtime/components/react/mpx-label.tsx +26 -27
- package/lib/runtime/components/react/mpx-movable-area.tsx +18 -23
- package/lib/runtime/components/react/mpx-movable-view.tsx +21 -25
- package/lib/runtime/components/react/mpx-navigator.tsx +2 -8
- package/lib/runtime/components/react/mpx-picker/date.tsx +5 -2
- package/lib/runtime/components/react/mpx-picker/index.tsx +3 -2
- package/lib/runtime/components/react/mpx-picker/multiSelector.tsx +5 -2
- package/lib/runtime/components/react/mpx-picker/region.tsx +5 -2
- package/lib/runtime/components/react/mpx-picker/selector.tsx +5 -2
- package/lib/runtime/components/react/mpx-picker/time.tsx +10 -15
- package/lib/runtime/components/react/mpx-picker/type.ts +48 -43
- package/lib/runtime/components/react/mpx-picker-view-column.tsx +4 -1
- package/lib/runtime/components/react/mpx-picker-view.tsx +7 -1
- package/lib/runtime/components/react/mpx-radio-group.tsx +24 -27
- package/lib/runtime/components/react/mpx-radio.tsx +45 -54
- package/lib/runtime/components/react/mpx-rich-text/html.ts +40 -0
- package/lib/runtime/components/react/mpx-rich-text/index.tsx +121 -0
- package/lib/runtime/components/react/mpx-root-portal.tsx +3 -5
- package/lib/runtime/components/react/mpx-scroll-view.tsx +72 -71
- package/lib/runtime/components/react/mpx-simple-text.tsx +18 -0
- package/lib/runtime/components/react/mpx-swiper/carouse.tsx +4 -2
- package/lib/runtime/components/react/mpx-swiper-item.tsx +3 -2
- package/lib/runtime/components/react/mpx-switch.tsx +29 -23
- package/lib/runtime/components/react/mpx-text.tsx +14 -18
- package/lib/runtime/components/react/mpx-textarea.tsx +11 -10
- package/lib/runtime/components/react/mpx-view.tsx +55 -65
- package/lib/runtime/components/react/mpx-web-view.tsx +108 -63
- package/lib/runtime/components/react/types/global.d.ts +3 -17
- package/lib/runtime/components/react/useAnimationHooks.ts +36 -12
- package/lib/runtime/components/react/utils.tsx +113 -82
- package/lib/runtime/components/web/getInnerListeners.js +6 -6
- package/lib/runtime/components/web/mpx-movable-view.vue +334 -344
- package/lib/runtime/components/web/mpx-picker-view-column.vue +75 -75
- package/lib/runtime/components/web/mpx-picker.vue +382 -385
- package/lib/runtime/components/web/mpx-web-view.vue +175 -161
- package/lib/runtime/optionProcessor.js +7 -38
- package/lib/runtime/utils.js +2 -0
- package/lib/style-compiler/plugins/scope-id.js +30 -2
- package/lib/template-compiler/bind-this.js +7 -2
- package/lib/template-compiler/compiler.js +77 -46
- package/lib/template-compiler/gen-node-react.js +2 -2
- package/lib/utils/pre-process-json.js +9 -5
- package/package.json +5 -4
- package/lib/runtime/components/react/dist/mpx-image/index.jsx +0 -226
- package/lib/runtime/components/react/dist/mpx-image/svg.jsx +0 -7
- package/lib/runtime/components/react/mpx-image/index.tsx +0 -345
- package/lib/runtime/components/react/mpx-image/svg.tsx +0 -22
- package/lib/runtime/components/web/event.js +0 -105
|
@@ -7,90 +7,90 @@
|
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script type="text/ecmascript-6">
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
import BScroll from '@better-scroll/core'
|
|
11
|
+
import Wheel from '@better-scroll/wheel'
|
|
12
|
+
import { extend } from '../../utils'
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
BScroll.use(Wheel)
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
16
|
+
export default {
|
|
17
|
+
name: 'mpx-picker-view-column',
|
|
18
|
+
props: {
|
|
19
|
+
value: Array,
|
|
20
|
+
scrollOptions: {
|
|
21
|
+
type: Object,
|
|
22
|
+
default: () => {
|
|
23
|
+
return {}
|
|
24
24
|
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
data () {
|
|
28
|
+
return {
|
|
29
|
+
wheels: [],
|
|
30
|
+
selectedIndex: [0]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
computed: {},
|
|
34
|
+
watch: {
|
|
35
|
+
selectedIndex (newVal) {
|
|
36
|
+
if (this.wheels[0]) {
|
|
37
|
+
this.$nextTick(() => {
|
|
38
|
+
// make sure the dom rendering is complete
|
|
39
|
+
this.wheels[0].refresh()
|
|
40
|
+
this.wheels[0].wheelTo(newVal[0])
|
|
41
|
+
})
|
|
30
42
|
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
mounted () {
|
|
46
|
+
this.wheels = []
|
|
47
|
+
this.refresh()
|
|
48
|
+
for (let i = 0; i < this.$refs.wheelScroll.children.length; i++) {
|
|
49
|
+
this.$refs.wheelScroll.children[i].style.height = `${this.$parent.$refs.indicatorMask.offsetHeight}px`
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
beforeDestroy () {
|
|
53
|
+
this.wheels.forEach((wheel) => {
|
|
54
|
+
wheel.destroy()
|
|
55
|
+
})
|
|
56
|
+
this.wheels = []
|
|
57
|
+
},
|
|
58
|
+
methods: {
|
|
59
|
+
refresh () {
|
|
60
|
+
if (this.refreshing) return
|
|
61
|
+
this.refreshing = true
|
|
62
|
+
this.$nextTick(() => {
|
|
63
|
+
const wheelWrapper = this.$refs.wheelWrapper
|
|
35
64
|
if (this.wheels[0]) {
|
|
36
|
-
this
|
|
37
|
-
|
|
38
|
-
this.wheels[0].refresh()
|
|
39
|
-
this.wheels[0].wheelTo(newVal[0])
|
|
40
|
-
})
|
|
65
|
+
this.wheels[0].refresh()
|
|
66
|
+
return
|
|
41
67
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
})
|
|
55
|
-
this.wheels = []
|
|
56
|
-
},
|
|
57
|
-
methods: {
|
|
58
|
-
refresh() {
|
|
59
|
-
if (this.refreshing) return
|
|
60
|
-
this.refreshing = true
|
|
61
|
-
this.$nextTick(() => {
|
|
62
|
-
const wheelWrapper = this.$refs.wheelWrapper
|
|
63
|
-
if (this.wheels[0]) {
|
|
64
|
-
this.wheels[0].refresh()
|
|
65
|
-
return
|
|
68
|
+
this.wheels[0] = new BScroll(wheelWrapper, extend({
|
|
69
|
+
wheel: {
|
|
70
|
+
selectedIndex: this.selectedIndex[0],
|
|
71
|
+
rotate: -5,
|
|
72
|
+
wheelWrapperClass: 'wheel-scroll'
|
|
73
|
+
},
|
|
74
|
+
probeType: 3,
|
|
75
|
+
bindToWrapper: true
|
|
76
|
+
}, this.scrollOptions))
|
|
77
|
+
this.wheels[0].on('scrollStart', function () {
|
|
78
|
+
if (this.pickerView) {
|
|
79
|
+
this.pickerView.notifyPickstart()
|
|
66
80
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
this.wheels[0].on('scrollStart', function () {
|
|
78
|
-
if (this.pickerView) {
|
|
79
|
-
this.pickerView.notifyPickstart()
|
|
80
|
-
}
|
|
81
|
-
}.bind(this))
|
|
82
|
-
this.wheels[0].on('scrollEnd', function () {
|
|
83
|
-
if (this.refreshing) return
|
|
84
|
-
if (this.pickerView) {
|
|
85
|
-
this.pickerView.notifyChange()
|
|
86
|
-
this.pickerView.notifyPickend()
|
|
87
|
-
}
|
|
88
|
-
}.bind(this))
|
|
89
|
-
this.refreshing = false
|
|
90
|
-
})
|
|
91
|
-
}
|
|
81
|
+
}.bind(this))
|
|
82
|
+
this.wheels[0].on('scrollEnd', function () {
|
|
83
|
+
if (this.refreshing) return
|
|
84
|
+
if (this.pickerView) {
|
|
85
|
+
this.pickerView.notifyChange()
|
|
86
|
+
this.pickerView.notifyPickend()
|
|
87
|
+
}
|
|
88
|
+
}.bind(this))
|
|
89
|
+
this.refreshing = false
|
|
90
|
+
})
|
|
92
91
|
}
|
|
93
92
|
}
|
|
93
|
+
}
|
|
94
94
|
</script>
|
|
95
95
|
|
|
96
96
|
<style scoped lang="stylus" rel="stylesheet/stylus">
|