@mpxjs/webpack-plugin 2.9.69 → 2.9.70-alpha.0

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 (138) hide show
  1. package/README.md +1 -1
  2. package/lib/config.js +14 -0
  3. package/lib/dependencies/AddEntryDependency.js +24 -0
  4. package/lib/dependencies/ResolveDependency.js +5 -0
  5. package/lib/index.js +38 -7
  6. package/lib/json-compiler/helper.js +3 -3
  7. package/lib/loader.js +53 -0
  8. package/lib/platform/template/wx/component-config/button.js +14 -2
  9. package/lib/platform/template/wx/component-config/image.js +4 -0
  10. package/lib/platform/template/wx/component-config/input.js +5 -1
  11. package/lib/platform/template/wx/component-config/rich-text.js +4 -0
  12. package/lib/platform/template/wx/component-config/scroll-view.js +4 -0
  13. package/lib/platform/template/wx/component-config/swiper.js +1 -1
  14. package/lib/platform/template/wx/component-config/switch.js +4 -0
  15. package/lib/platform/template/wx/component-config/text.js +4 -0
  16. package/lib/platform/template/wx/component-config/textarea.js +6 -1
  17. package/lib/platform/template/wx/component-config/view.js +4 -0
  18. package/lib/platform/template/wx/index.js +127 -1
  19. package/lib/react/processTemplate.js +3 -0
  20. package/lib/resolve-loader.js +4 -1
  21. package/lib/runtime/components/react/context.ts +4 -0
  22. package/lib/runtime/components/react/dist/context.js +1 -0
  23. package/lib/runtime/components/react/dist/event.config.js +24 -24
  24. package/lib/runtime/components/react/dist/getInnerListeners.js +183 -165
  25. package/lib/runtime/components/react/dist/mpx-button.jsx +35 -42
  26. package/lib/runtime/components/react/dist/mpx-canvas/index.jsx +30 -12
  27. package/lib/runtime/components/react/dist/mpx-checkbox-group.jsx +13 -19
  28. package/lib/runtime/components/react/dist/mpx-checkbox.jsx +29 -38
  29. package/lib/runtime/components/react/dist/mpx-form.jsx +16 -19
  30. package/lib/runtime/components/react/dist/mpx-icon.jsx +8 -16
  31. package/lib/runtime/components/react/dist/mpx-image.jsx +291 -0
  32. package/lib/runtime/components/react/dist/mpx-input.jsx +54 -27
  33. package/lib/runtime/components/react/dist/mpx-label.jsx +15 -22
  34. package/lib/runtime/components/react/dist/mpx-movable-area.jsx +13 -16
  35. package/lib/runtime/components/react/dist/mpx-movable-view.jsx +13 -13
  36. package/lib/runtime/components/react/dist/mpx-navigator.jsx +2 -4
  37. package/lib/runtime/components/react/dist/mpx-picker/date.jsx +6 -2
  38. package/lib/runtime/components/react/dist/mpx-picker/index.jsx +5 -3
  39. package/lib/runtime/components/react/dist/mpx-picker/multiSelector.jsx +6 -2
  40. package/lib/runtime/components/react/dist/mpx-picker/region.jsx +6 -2
  41. package/lib/runtime/components/react/dist/mpx-picker/selector.jsx +6 -2
  42. package/lib/runtime/components/react/dist/mpx-picker/time.jsx +10 -15
  43. package/lib/runtime/components/react/dist/mpx-picker-view-column-item.jsx +39 -0
  44. package/lib/runtime/components/react/dist/mpx-picker-view-column.jsx +110 -97
  45. package/lib/runtime/components/react/dist/mpx-picker-view.jsx +32 -29
  46. package/lib/runtime/components/react/dist/mpx-radio-group.jsx +11 -19
  47. package/lib/runtime/components/react/dist/mpx-radio.jsx +27 -42
  48. package/lib/runtime/components/react/dist/mpx-rich-text/html.js +39 -0
  49. package/lib/runtime/components/react/dist/mpx-rich-text/index.jsx +63 -0
  50. package/lib/runtime/components/react/dist/mpx-root-portal.jsx +6 -4
  51. package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +47 -41
  52. package/lib/runtime/components/react/dist/mpx-simple-text.jsx +11 -0
  53. package/lib/runtime/components/react/dist/mpx-swiper-item.jsx +4 -2
  54. package/lib/runtime/components/react/dist/mpx-swiper.jsx +606 -0
  55. package/lib/runtime/components/react/dist/mpx-switch.jsx +20 -10
  56. package/lib/runtime/components/react/dist/mpx-text.jsx +11 -10
  57. package/lib/runtime/components/react/dist/mpx-textarea.jsx +8 -3
  58. package/lib/runtime/components/react/dist/mpx-view.jsx +29 -44
  59. package/lib/runtime/components/react/dist/mpx-web-view.jsx +105 -42
  60. package/lib/runtime/components/react/dist/pickerFaces.js +12 -6
  61. package/lib/runtime/components/react/dist/pickerVIewContext.js +9 -0
  62. package/lib/runtime/components/react/dist/pickerViewMask.jsx +18 -0
  63. package/lib/runtime/components/react/dist/{pickerOverlay.jsx → pickerViewOverlay.jsx} +5 -3
  64. package/lib/runtime/components/react/dist/useAnimationHooks.js +35 -9
  65. package/lib/runtime/components/react/dist/utils.jsx +20 -24
  66. package/lib/runtime/components/react/getInnerListeners.ts +35 -28
  67. package/lib/runtime/components/react/mpx-button.tsx +55 -36
  68. package/lib/runtime/components/react/mpx-canvas/index.tsx +2 -2
  69. package/lib/runtime/components/react/mpx-checkbox-group.tsx +13 -12
  70. package/lib/runtime/components/react/mpx-checkbox.tsx +28 -28
  71. package/lib/runtime/components/react/mpx-form.tsx +10 -8
  72. package/lib/runtime/components/react/mpx-icon.tsx +10 -15
  73. package/lib/runtime/components/react/mpx-image.tsx +396 -0
  74. package/lib/runtime/components/react/mpx-input.tsx +61 -33
  75. package/lib/runtime/components/react/mpx-label.tsx +14 -13
  76. package/lib/runtime/components/react/mpx-movable-area.tsx +8 -7
  77. package/lib/runtime/components/react/mpx-movable-view.tsx +1 -1
  78. package/lib/runtime/components/react/mpx-picker/date.tsx +5 -2
  79. package/lib/runtime/components/react/mpx-picker/index.tsx +3 -2
  80. package/lib/runtime/components/react/mpx-picker/multiSelector.tsx +5 -2
  81. package/lib/runtime/components/react/mpx-picker/region.tsx +5 -2
  82. package/lib/runtime/components/react/mpx-picker/selector.tsx +5 -2
  83. package/lib/runtime/components/react/mpx-picker/time.tsx +10 -15
  84. package/lib/runtime/components/react/mpx-picker/type.ts +48 -43
  85. package/lib/runtime/components/react/mpx-picker-view-column.tsx +4 -1
  86. package/lib/runtime/components/react/mpx-picker-view.tsx +7 -1
  87. package/lib/runtime/components/react/mpx-radio-group.tsx +11 -12
  88. package/lib/runtime/components/react/mpx-radio.tsx +26 -29
  89. package/lib/runtime/components/react/mpx-scroll-view.tsx +32 -30
  90. package/lib/runtime/components/react/mpx-simple-text.tsx +18 -0
  91. package/lib/runtime/components/react/mpx-swiper/carouse.tsx +4 -2
  92. package/lib/runtime/components/react/mpx-swiper-item.tsx +3 -2
  93. package/lib/runtime/components/react/mpx-switch.tsx +10 -8
  94. package/lib/runtime/components/react/mpx-text.tsx +6 -2
  95. package/lib/runtime/components/react/mpx-view.tsx +37 -45
  96. package/lib/runtime/components/react/mpx-web-view.tsx +25 -15
  97. package/lib/runtime/components/react/types/global.d.ts +1 -16
  98. package/lib/runtime/components/react/utils.tsx +24 -24
  99. package/lib/runtime/components/tenon/getInnerListeners.js +334 -0
  100. package/lib/runtime/components/tenon/tenon-button.vue +309 -0
  101. package/lib/runtime/components/tenon/tenon-image.vue +66 -0
  102. package/lib/runtime/components/tenon/tenon-input.vue +171 -0
  103. package/lib/runtime/components/tenon/tenon-rich-text.vue +26 -0
  104. package/lib/runtime/components/tenon/tenon-scroll-view.vue +127 -0
  105. package/lib/runtime/components/tenon/tenon-switch.vue +96 -0
  106. package/lib/runtime/components/tenon/tenon-text.vue +70 -0
  107. package/lib/runtime/components/tenon/tenon-textarea.vue +86 -0
  108. package/lib/runtime/components/tenon/tenon-view.vue +93 -0
  109. package/lib/runtime/components/web/getInnerListeners.js +6 -6
  110. package/lib/runtime/components/web/mpx-movable-view.vue +334 -344
  111. package/lib/runtime/components/web/mpx-picker-view-column.vue +75 -75
  112. package/lib/runtime/components/web/mpx-picker.vue +382 -385
  113. package/lib/runtime/components/web/mpx-web-view.vue +162 -162
  114. package/lib/runtime/optionProcessor.js +7 -16
  115. package/lib/runtime/optionProcessor.tenon.js +84 -0
  116. package/lib/runtime/utils.js +2 -0
  117. package/lib/style-compiler/index.js +1 -1
  118. package/lib/style-compiler/plugins/hm.js +20 -0
  119. package/lib/template-compiler/bind-this.js +7 -2
  120. package/lib/template-compiler/compiler.js +67 -40
  121. package/lib/template-compiler/gen-node-react.js +2 -2
  122. package/lib/tenon/index.js +117 -0
  123. package/lib/tenon/processJSON.js +352 -0
  124. package/lib/tenon/processScript.js +203 -0
  125. package/lib/tenon/processStyles.js +21 -0
  126. package/lib/tenon/processTemplate.js +126 -0
  127. package/lib/tenon/script-helper.js +223 -0
  128. package/lib/utils/env.js +6 -1
  129. package/lib/utils/get-relative-path.js +25 -0
  130. package/package.json +7 -3
  131. package/LICENSE +0 -433
  132. package/lib/runtime/components/react/dist/mpx-image/index.jsx +0 -226
  133. package/lib/runtime/components/react/dist/mpx-image/svg.jsx +0 -7
  134. package/lib/runtime/components/react/dist/mpx-swiper/carouse.jsx +0 -478
  135. package/lib/runtime/components/react/dist/mpx-swiper/index.jsx +0 -68
  136. package/lib/runtime/components/react/dist/mpx-swiper/type.js +0 -1
  137. package/lib/runtime/components/react/mpx-image/index.tsx +0 -345
  138. package/lib/runtime/components/react/mpx-image/svg.tsx +0 -22
@@ -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">