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