mali-applet-ui 1.0.19 → 1.0.20

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 (54) hide show
  1. package/README.md +2 -0
  2. package/config/index.js +1 -1
  3. package/config/store.js +7 -7
  4. package/lib/components/ml-amount-input/ml-amount-input.vue +2 -2
  5. package/lib/components/ml-approval-type/ml-approval-type.vue +2 -2
  6. package/lib/components/ml-button/ml-button.vue +21 -2
  7. package/lib/components/ml-card/ml-card.vue +5 -1
  8. package/lib/components/ml-chunk-item/ml-chunk-item.vue +1 -1
  9. package/lib/components/ml-col/ml-col.vue +2 -2
  10. package/lib/components/ml-date-range-picker/ml-date-range-picker.vue +1 -1
  11. package/lib/components/ml-datetime-picker/ml-datetime-picker.vue +1 -1
  12. package/lib/components/ml-datetime-range-picker/ml-datetime-range-picker.vue +1 -1
  13. package/lib/components/ml-echart2/ec-canvas.vue +140 -0
  14. package/lib/components/ml-echart2/echarts.js +11 -0
  15. package/lib/components/ml-echart2/echarts.simple.min.js +18 -0
  16. package/lib/components/ml-echart2/ml-echart2.vue +182 -0
  17. package/lib/components/ml-echart2/wx-canvas.js +111 -0
  18. package/lib/components/ml-echarts/echarts.js +14 -14
  19. package/lib/components/ml-echarts/echarts.min.js +46 -46
  20. package/lib/components/ml-echarts/echarts.simple.min.js +18 -18
  21. package/lib/components/ml-echarts/ml-echarts.vue +5 -0
  22. package/lib/components/ml-echarts/wx-canvas.js +168 -168
  23. package/lib/components/ml-form/ml-form.vue +0 -1
  24. package/lib/components/ml-form-group/ml-form-group.vue +1 -0
  25. package/lib/components/ml-form-item/ml-form-item.vue +4 -7
  26. package/lib/components/ml-icon/iconfont.css +757 -757
  27. package/lib/components/ml-input/ml-input.vue +37 -13
  28. package/lib/components/ml-list-group/ml-list-group.vue +1 -0
  29. package/lib/components/ml-list-item/ml-list-item.vue +9 -1
  30. package/lib/components/ml-list-menu-group/ml-list-menu-group.vue +0 -1
  31. package/lib/components/ml-list-menu-item/ml-list-menu-item.vue +26 -5
  32. package/lib/components/ml-location-pick/location.js +12 -0
  33. package/lib/components/ml-location-pick/ml-location-pick.vue +72 -0
  34. package/lib/components/ml-modal/ml-modal.vue +1 -0
  35. package/lib/components/ml-month-picker/ml-month-picker.vue +1 -1
  36. package/lib/components/ml-navbar/ml-navbar.vue +1 -1
  37. package/lib/components/ml-number-input/ml-number-input.vue +2 -2
  38. package/lib/components/ml-progress-bar/ml-progress-bar.vue +1 -1
  39. package/lib/components/ml-rich-text/ml-rich-text.vue +1 -1
  40. package/lib/components/ml-search-bar/ml-search-bar.vue +8 -8
  41. package/lib/components/ml-select-picker/ml-select-picker.vue +1 -1
  42. package/lib/components/ml-status-tag/ml-status-tag.vue +11 -3
  43. package/lib/components/ml-switch/ml-switch.vue +1 -1
  44. package/lib/components/ml-tab-pane/ml-tab-pane.vue +1 -1
  45. package/lib/components/ml-tabbar/ml-tabbar.vue +1 -1
  46. package/lib/components/ml-tabs/ml-tabs.vue +1 -1
  47. package/lib/components/ml-text/ml-text.vue +1 -1
  48. package/lib/components/ml-textarea/ml-textarea.vue +3 -4
  49. package/lib/components/ml-textarea/voice-input.vue +1 -1
  50. package/lib/components/ml-toast/ml-toast.vue +1 -1
  51. package/lib/components/ml-upload/ml-upload.vue +5 -9
  52. package/lib/components/ml-year-picker/ml-year-picker.vue +1 -1
  53. package/package.json +1 -1
  54. package/theme.scss +9 -0
package/README.md CHANGED
@@ -4,6 +4,8 @@ Mali-Applet-UI 码里云小程序组件库
4
4
 
5
5
  ## 发布npm
6
6
 
7
+ 需要先登陆
8
+
7
9
  ```
8
10
  npm run release
9
11
  ```
package/config/index.js CHANGED
@@ -6,4 +6,4 @@ function config (options) {
6
6
  return globalStore
7
7
  }
8
8
 
9
- export default config
9
+ export default config
package/config/store.js CHANGED
@@ -28,13 +28,13 @@ const globalStore = {
28
28
  optionMethod: null
29
29
  },
30
30
  types: [
31
- { value: 0, label: '起草中', color: '#353535', background: '#F0F2F5' },
32
- { value: 1, label: '审批中', color: '#ffffff', background: '#246BFD' },
33
- { value: 2, label: '已通过', color: '#ffffff', background: '#00D35C' },
34
- { value: 3, label: '已驳回', color: '#ffffff', background: '#FF5064' },
35
- { value: 4, label: '会签中', color: '#ffffff', background: '#FF9C00' },
36
- { value: 5, label: '处理中', color: '#ffffff', background: '#246BFD' },
37
- { value: 6, label: '已完成', color: '#ffffff', background: '#00D35C' }
31
+ { value: 0, label: '起草中', color: '#353535', background: '#eaebed' },
32
+ { value: 1, label: '审批中', color: '#007FFF', background: '#e0efff' },
33
+ { value: 2, label: '已通过', color: '#00B042', background: '#e0f5e8' },
34
+ { value: 3, label: '已驳回', color: '#FF5064', background: '#ffeaec' },
35
+ { value: 4, label: '会签中', color: '#007FFF', background: '#e0efff' },
36
+ { value: 5, label: '处理中', color: '#007FFF', background: '#e0efff' },
37
+ { value: 6, label: '已完成', color: '#00B042', background: '#e0f5e8' }
38
38
  ]
39
39
  },
40
40
  // 上拉加载更多
@@ -215,7 +215,7 @@ export default {
215
215
  display: flex;
216
216
  flex-direction: row;
217
217
  .ml-amount-input-placeholder {
218
- color: $uni-text-color-placeholder;
218
+ color: $ml-input-color-placeholder;;
219
219
  }
220
220
  .ml-amount-input-readonly-content {
221
221
  padding: 20rpx 4rpx;
@@ -263,7 +263,7 @@ export default {
263
263
  }
264
264
  .ml-amount-input-inp,
265
265
  .ml-amount-input-simulate {
266
- font-size: $uni-font-size-base;
266
+ font-size: $ml-base-font-size;
267
267
  width: 100%;
268
268
  height: 70rpx;
269
269
  padding: 0 10rpx;
@@ -38,8 +38,8 @@ export default {
38
38
  <style lang="scss">
39
39
  .ml-approval-type {
40
40
  display: inline-block;
41
- padding: 8rpx 16rpx;
41
+ padding: 6rpx 20rpx;
42
42
  border-radius: $ml-border-radius;
43
- font-size: 24rpx;
43
+ font-size: $ml-describe-font-size;
44
44
  }
45
45
  </style>
@@ -1,5 +1,12 @@
1
1
  <template>
2
- <button class="ml-button" :class="[className || '', `type-${type}`, size ? `size-${size}` : '', status ? `ss-${status}` : '', {'is-round': round, 'is-underline': underline, 'is-disabled': disabled}]" :disabled="disabled" :open-type="openType" :style="styles" @tap="tapEvent" @click="clickEvent">
2
+ <button
3
+ class="ml-button"
4
+ :class="[className || '', `type-${type}`, size ? `size-${size}` : '', status ? `ss-${status}` : '', {'is-round': round, 'is-underline': underline, 'is-disabled': disabled}]"
5
+ :disabled="disabled"
6
+ :open-type="openType"
7
+ :style="styles"
8
+ @tap="tapEvent"
9
+ @click="clickEvent">
3
10
  <slot>{{ content }}</slot>
4
11
  </button>
5
12
  </template>
@@ -72,7 +79,19 @@ export default {
72
79
  line-height: 1.5;
73
80
  vertical-align: middle;
74
81
  background: transparent;
75
- font-size: $uni-font-size-base;
82
+ font-size: $ml-base-font-size;
83
+ &.size-large {
84
+ font-size: 40rpx;
85
+ }
86
+ &.size-medium {
87
+ font-size: 36rpx;
88
+ }
89
+ &.size-small {
90
+ font-size: 28rpx;
91
+ }
92
+ &.size-mini {
93
+ font-size: 24rpx;
94
+ }
76
95
  &.is-underline {
77
96
  text-decoration: underline;
78
97
  }
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view class="ml-card" :class="{'is-bg': background, 'is-padding': padding}">
2
+ <view class="ml-card" :class="{'is-bg': background, 'is-padding': padding, 'is-border': border}">
3
3
  <view v-if="title || showHeader" class="ml-card-header">
4
4
  <view class="ml-card-title">
5
5
  <slot name="title">{{ title }}</slot>
@@ -22,6 +22,7 @@ export default {
22
22
  },
23
23
  props: {
24
24
  title: String,
25
+ border: Boolean,
25
26
  background: {
26
27
  type: Boolean,
27
28
  default: true
@@ -42,6 +43,9 @@ export default {
42
43
  &.is-bg {
43
44
  background: #fff;
44
45
  }
46
+ &.is-border {
47
+ border: 1px solid #e5e5e5;
48
+ }
45
49
  &.is-padding {
46
50
  .ml-card-body {
47
51
  padding: 0 20rpx 20rpx 20rpx;
@@ -60,7 +60,7 @@ export default {
60
60
  flex-direction: column;
61
61
  padding: 20rpx;
62
62
  line-height: 50rpx;
63
- font-size: $uni-font-size-base;
63
+ font-size: $ml-describe-font-size;
64
64
  $spans: 4.16667%, 8.33333%, 12.5%, 16.66667%, 20.83333%, 25%, 29.16667%, 33.33333%,
65
65
  37.5%, 41.66667%, 45.83333%, 50%, 54.16667%, 58.33333%, 62.5%, 66.66667%,
66
66
  70.83333%, 75%, 79.16667%, 83.33333%, 87.5%, 91.66667%, 95.83333%, 100%;
@@ -51,9 +51,9 @@ export default {
51
51
  }
52
52
  &.is-important {
53
53
  padding-bottom: 10rpx;
54
- font-size: 30rpx;
54
+ font-size: $ml-base-font-size;
55
55
  }
56
- &.normal-shrink {
56
+ &.is-shrink {
57
57
  flex-shrink: 0;
58
58
  }
59
59
  &.is-ellipsis {
@@ -41,4 +41,4 @@ export default {
41
41
  }
42
42
  }
43
43
  }
44
- </script>
44
+ </script>
@@ -40,4 +40,4 @@ export default {
40
40
  }
41
41
  }
42
42
  }
43
- </script>
43
+ </script>
@@ -45,4 +45,4 @@ export default {
45
45
  }
46
46
  }
47
47
  }
48
- </script>
48
+ </script>
@@ -0,0 +1,140 @@
1
+ <template>
2
+ <view class="ml-echarts" :class="className" :style="{height: height || '400rpx', width: width || '100%'}">
3
+ <canvas class="ec-canvas ec-canvas ec-canvas-aaa" ref="saveChildRef0" :id="canvasId" :width="width" :height="height" @touchStart="touchStart" @touchMove="touchMove" @touchEnd="touchEnd" @init="init"></canvas>
4
+ </view>
5
+ </template>
6
+
7
+ <script>
8
+ /* eslint-disable */
9
+ import WxCanvas from './wx-canvas'
10
+ import echarts from './echarts'
11
+ import { getAppDpr } from '../../../utils'
12
+
13
+ let ctx
14
+
15
+ function wrapTouch (event) {
16
+ for (let i = 0; i < event.touches.length; ++i) {
17
+ const touch = event.touches[i]
18
+ touch.offsetX = touch.x
19
+ touch.offsetY = touch.y
20
+ }
21
+
22
+ return event
23
+ }
24
+
25
+ export default {
26
+ props: {
27
+ options: Object,
28
+ height: String,
29
+ width: String,
30
+ lazyLoad: Boolean,
31
+ formatLegend: Function,
32
+ className: String
33
+ },
34
+ data () {
35
+ return {
36
+ canvasId: 'aaa',
37
+ width: '',
38
+ height: ''
39
+ }
40
+ },
41
+ mounted () {
42
+ this.init()
43
+ },
44
+ methods: {
45
+ init: function () {
46
+ ctx = uni.createCanvasContext(this.canvasId, this)
47
+ const canvas = new WxCanvas(ctx, this.canvasId)
48
+ echarts.setCanvasCreator(() => {
49
+ return canvas
50
+ })
51
+
52
+ const query = uni.createSelectorQuery().in(this)
53
+
54
+ const selector = '.ec-canvas-' + this.canvasId
55
+ const ratio = getAppDpr()
56
+ query
57
+ .select(selector)
58
+ .boundingClientRect(res => {
59
+ const _w = ratio * res.width
60
+
61
+ const _h = ratio * res.height
62
+
63
+ const w = res.width
64
+ const h = res.height
65
+ this.width= _w
66
+ this.height= _h
67
+
68
+ const chart = echarts.init(canvas, null, {
69
+ width: w,
70
+ height: h
71
+ })
72
+ canvas.setChart(chart)
73
+ chart.setOption(this.options)
74
+ })
75
+ .exec()
76
+ },
77
+
78
+ canvasToTempFilePath (opt) {
79
+ if (!opt.canvasId) {
80
+ opt.canvasId = this.canvasId
81
+ }
82
+
83
+ ctx.draw(true, () => {
84
+ uni.canvasToTempFilePath(opt, this)
85
+ })
86
+ },
87
+
88
+ touchStart (e) {
89
+ if (this.chart && e.touches.length > 0) {
90
+ const touch = e.touches[0]
91
+ const handler = this.chart.getZr().handler
92
+ handler.dispatch('mousedown', {
93
+ zrX: touch.x,
94
+ zrY: touch.y
95
+ })
96
+ handler.dispatch('mousemove', {
97
+ zrX: touch.x,
98
+ zrY: touch.y
99
+ })
100
+ handler.processGesture(wrapTouch(e), 'start')
101
+ }
102
+ },
103
+
104
+ touchMove (e) {
105
+ if (this.chart && e.touches.length > 0) {
106
+ const touch = e.touches[0]
107
+ const handler = this.chart.getZr().handler
108
+ handler.dispatch('mousemove', {
109
+ zrX: touch.x,
110
+ zrY: touch.y
111
+ })
112
+ handler.processGesture(wrapTouch(e), 'change')
113
+ }
114
+ },
115
+
116
+ touchEnd (e) {
117
+ if (this.chart) {
118
+ const touch = e.changedTouches ? e.changedTouches[0] : {}
119
+ const handler = this.chart.getZr().handler
120
+ handler.dispatch('mouseup', {
121
+ zrX: touch.x,
122
+ zrY: touch.y
123
+ })
124
+ handler.dispatch('click', {
125
+ zrX: touch.x,
126
+ zrY: touch.y
127
+ })
128
+ handler.processGesture(wrapTouch(e), 'end')
129
+ }
130
+ }
131
+ }
132
+ }
133
+ </script>
134
+
135
+ <style lang="scss">
136
+ .ml-canvas {
137
+ width: 100%;
138
+ height: 100%;
139
+ }
140
+ </style>
@@ -0,0 +1,11 @@
1
+ import * as echarts from './echarts.simple.min.js'
2
+ import { getAppDpr } from '../../../utils'
3
+
4
+ /* eslint-disable */
5
+ const eInit = echarts.init
6
+ echarts.init = function (p1, p2, opts = {}) {
7
+ opts.devicePixelRatio = opts.devicePixelRatio || getAppDpr()
8
+ return eInit.call(this, p1, p2, opts)
9
+ }
10
+
11
+ export default echarts