mali-applet-ui 1.0.19 → 1.0.21
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/README.md +2 -0
- package/config/index.js +1 -1
- package/config/store.js +7 -7
- package/lib/components/ml-amount-input/ml-amount-input.vue +2 -2
- package/lib/components/ml-approval-type/ml-approval-type.vue +2 -2
- package/lib/components/ml-button/ml-button.vue +21 -2
- package/lib/components/ml-card/ml-card.vue +5 -1
- package/lib/components/ml-chunk-item/ml-chunk-item.vue +1 -1
- package/lib/components/ml-col/ml-col.vue +2 -2
- package/lib/components/ml-date-range-picker/ml-date-range-picker.vue +1 -1
- package/lib/components/ml-datetime-picker/ml-datetime-picker.vue +1 -1
- package/lib/components/ml-datetime-range-picker/ml-datetime-range-picker.vue +1 -1
- package/lib/components/ml-echart2/ec-canvas.vue +140 -0
- package/lib/components/ml-echart2/echarts.js +11 -0
- package/lib/components/ml-echart2/echarts.simple.min.js +18 -0
- package/lib/components/ml-echart2/ml-echart2.vue +182 -0
- package/lib/components/ml-echart2/wx-canvas.js +111 -0
- package/lib/components/ml-echarts/echarts.js +14 -14
- package/lib/components/ml-echarts/echarts.min.js +46 -46
- package/lib/components/ml-echarts/echarts.simple.min.js +18 -18
- package/lib/components/ml-echarts/ml-echarts.vue +5 -0
- package/lib/components/ml-echarts/wx-canvas.js +168 -168
- package/lib/components/ml-form/ml-form.vue +0 -1
- package/lib/components/ml-form-group/ml-form-group.vue +1 -0
- package/lib/components/ml-form-item/ml-form-item.vue +4 -7
- package/lib/components/ml-icon/iconfont.css +757 -757
- package/lib/components/ml-input/ml-input.vue +37 -13
- package/lib/components/ml-list-group/ml-list-group.vue +1 -0
- package/lib/components/ml-list-item/ml-list-item.vue +9 -1
- package/lib/components/ml-list-menu-group/ml-list-menu-group.vue +0 -1
- package/lib/components/ml-list-menu-item/ml-list-menu-item.vue +26 -5
- package/lib/components/ml-location-pick/location.js +12 -0
- package/lib/components/ml-location-pick/ml-location-pick.vue +73 -0
- package/lib/components/ml-modal/ml-modal.vue +1 -0
- package/lib/components/ml-month-picker/ml-month-picker.vue +1 -1
- package/lib/components/ml-navbar/ml-navbar.vue +1 -1
- package/lib/components/ml-number-input/ml-number-input.vue +2 -2
- package/lib/components/ml-progress-bar/ml-progress-bar.vue +1 -1
- package/lib/components/ml-rich-text/ml-rich-text.vue +1 -1
- package/lib/components/ml-search-bar/ml-search-bar.vue +8 -8
- package/lib/components/ml-select-picker/ml-select-picker.vue +1 -1
- package/lib/components/ml-status-tag/ml-status-tag.vue +11 -3
- package/lib/components/ml-switch/ml-switch.vue +1 -1
- package/lib/components/ml-tab-pane/ml-tab-pane.vue +1 -1
- package/lib/components/ml-tabbar/ml-tabbar.vue +1 -1
- package/lib/components/ml-tabs/ml-tabs.vue +1 -1
- package/lib/components/ml-text/ml-text.vue +1 -1
- package/lib/components/ml-textarea/ml-textarea.vue +3 -4
- package/lib/components/ml-textarea/voice-input.vue +1 -1
- package/lib/components/ml-toast/ml-toast.vue +1 -1
- package/lib/components/ml-upload/ml-upload.vue +5 -9
- package/lib/components/ml-year-picker/ml-year-picker.vue +1 -1
- package/package.json +1 -1
- package/theme.scss +9 -0
|
@@ -1,168 +1,168 @@
|
|
|
1
|
-
function strLen (str) {
|
|
2
|
-
let len = 0
|
|
3
|
-
for (let i = 0; i < str.length; i++) {
|
|
4
|
-
if (str.charCodeAt(i) > 0 && str.charCodeAt(i) < 128) {
|
|
5
|
-
len++
|
|
6
|
-
} else {
|
|
7
|
-
len += 2
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
return len
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export default class WxCanvas {
|
|
14
|
-
constructor (ctx, canvasId, isNew, canvasNode) {
|
|
15
|
-
this.ctx = ctx
|
|
16
|
-
this.canvasId = canvasId
|
|
17
|
-
this.chart = null
|
|
18
|
-
this.isNew = isNew
|
|
19
|
-
|
|
20
|
-
if (isNew) {
|
|
21
|
-
this.canvasNode = canvasNode
|
|
22
|
-
} else {
|
|
23
|
-
this._initCanvas(ctx)
|
|
24
|
-
this._initStyle(ctx)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
this._initEvent()
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
getContext (contextType) {
|
|
31
|
-
if (contextType === '2d') {
|
|
32
|
-
return this.ctx
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
setChart (chart) {
|
|
37
|
-
this.chart = chart
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
attachEvent () {
|
|
41
|
-
// noop
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
detachEvent () {
|
|
45
|
-
// noop
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
_initCanvas (ctx) {
|
|
49
|
-
// #ifdef MP-ALIPAY
|
|
50
|
-
if (!ctx.measureText) {
|
|
51
|
-
// 钉钉钉钉小程序框架不支持 measureText 方法,用此方法 mock
|
|
52
|
-
ctx.measureText = (text) => {
|
|
53
|
-
let fontSize = 12
|
|
54
|
-
const font = ctx.__font
|
|
55
|
-
if (font) {
|
|
56
|
-
fontSize = parseInt(font.split(' ')[3], 10)
|
|
57
|
-
}
|
|
58
|
-
fontSize /= 2
|
|
59
|
-
return {
|
|
60
|
-
width: strLen(text) * fontSize
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
// #endif
|
|
65
|
-
|
|
66
|
-
if (!ctx.transform) {
|
|
67
|
-
ctx.transform = () => {
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (!ctx.setLineDash) {
|
|
72
|
-
ctx.setLineDash = () => {
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
_initStyle (ctx) {
|
|
78
|
-
// #ifdef MP-ALIPAY
|
|
79
|
-
const styles = [
|
|
80
|
-
'fillStyle',
|
|
81
|
-
'strokeStyle',
|
|
82
|
-
'globalAlpha',
|
|
83
|
-
'textAlign',
|
|
84
|
-
'textBaseAlign',
|
|
85
|
-
'shadow',
|
|
86
|
-
'lineWidth',
|
|
87
|
-
'lineCap',
|
|
88
|
-
'lineJoin',
|
|
89
|
-
'lineDash',
|
|
90
|
-
'miterLimit',
|
|
91
|
-
'fontSize'
|
|
92
|
-
]
|
|
93
|
-
styles.forEach(key => {
|
|
94
|
-
Object.defineProperty(ctx, key, {
|
|
95
|
-
get () {
|
|
96
|
-
return styles[key]
|
|
97
|
-
},
|
|
98
|
-
set (value) {
|
|
99
|
-
if ((key !== 'fillStyle' && key !== 'strokeStyle') || (value !== 'none' && value !== null)) {
|
|
100
|
-
ctx['set' + key.charAt(0).toUpperCase() + key.slice(1)](value)
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
})
|
|
104
|
-
})
|
|
105
|
-
// #endif
|
|
106
|
-
|
|
107
|
-
ctx.createRadialGradient = (...args) => {
|
|
108
|
-
return ctx.createCircularGradient(...args)
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
_initEvent () {
|
|
113
|
-
this.event = {}
|
|
114
|
-
const eventNames = [
|
|
115
|
-
{
|
|
116
|
-
wxName: 'touchStart',
|
|
117
|
-
ecName: 'mousedown'
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
wxName: 'touchMove',
|
|
121
|
-
ecName: 'mousemove'
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
wxName: 'touchEnd',
|
|
125
|
-
ecName: 'mouseup'
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
wxName: 'touchEnd',
|
|
129
|
-
ecName: 'click'
|
|
130
|
-
}
|
|
131
|
-
]
|
|
132
|
-
eventNames.forEach(name => {
|
|
133
|
-
this.event[name.wxName] = e => {
|
|
134
|
-
const touch = e.touches[0]
|
|
135
|
-
this.chart.getZr().handler.dispatch(name.ecName, {
|
|
136
|
-
zrX: name.wxName === 'tap' ? touch.clientX : touch.x,
|
|
137
|
-
zrY: name.wxName === 'tap' ? touch.clientY : touch.y
|
|
138
|
-
})
|
|
139
|
-
}
|
|
140
|
-
})
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
set width (w) {
|
|
144
|
-
if (this.canvasNode) {
|
|
145
|
-
this.canvasNode.width = w
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
set height (h) {
|
|
150
|
-
if (this.canvasNode) {
|
|
151
|
-
this.canvasNode.height = h
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
get width () {
|
|
156
|
-
if (this.canvasNode) {
|
|
157
|
-
return this.canvasNode.width
|
|
158
|
-
}
|
|
159
|
-
return 0
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
get height () {
|
|
163
|
-
if (this.canvasNode) {
|
|
164
|
-
return this.canvasNode.height
|
|
165
|
-
}
|
|
166
|
-
return 0
|
|
167
|
-
}
|
|
168
|
-
}
|
|
1
|
+
function strLen (str) {
|
|
2
|
+
let len = 0
|
|
3
|
+
for (let i = 0; i < str.length; i++) {
|
|
4
|
+
if (str.charCodeAt(i) > 0 && str.charCodeAt(i) < 128) {
|
|
5
|
+
len++
|
|
6
|
+
} else {
|
|
7
|
+
len += 2
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
return len
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default class WxCanvas {
|
|
14
|
+
constructor (ctx, canvasId, isNew, canvasNode) {
|
|
15
|
+
this.ctx = ctx
|
|
16
|
+
this.canvasId = canvasId
|
|
17
|
+
this.chart = null
|
|
18
|
+
this.isNew = isNew
|
|
19
|
+
|
|
20
|
+
if (isNew) {
|
|
21
|
+
this.canvasNode = canvasNode
|
|
22
|
+
} else {
|
|
23
|
+
this._initCanvas(ctx)
|
|
24
|
+
this._initStyle(ctx)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
this._initEvent()
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
getContext (contextType) {
|
|
31
|
+
if (contextType === '2d') {
|
|
32
|
+
return this.ctx
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
setChart (chart) {
|
|
37
|
+
this.chart = chart
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
attachEvent () {
|
|
41
|
+
// noop
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
detachEvent () {
|
|
45
|
+
// noop
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
_initCanvas (ctx) {
|
|
49
|
+
// #ifdef MP-ALIPAY
|
|
50
|
+
if (!ctx.measureText) {
|
|
51
|
+
// 钉钉钉钉小程序框架不支持 measureText 方法,用此方法 mock
|
|
52
|
+
ctx.measureText = (text) => {
|
|
53
|
+
let fontSize = 12
|
|
54
|
+
const font = ctx.__font
|
|
55
|
+
if (font) {
|
|
56
|
+
fontSize = parseInt(font.split(' ')[3], 10)
|
|
57
|
+
}
|
|
58
|
+
fontSize /= 2
|
|
59
|
+
return {
|
|
60
|
+
width: strLen(text) * fontSize
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// #endif
|
|
65
|
+
|
|
66
|
+
if (!ctx.transform) {
|
|
67
|
+
ctx.transform = () => {
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (!ctx.setLineDash) {
|
|
72
|
+
ctx.setLineDash = () => {
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
_initStyle (ctx) {
|
|
78
|
+
// #ifdef MP-ALIPAY
|
|
79
|
+
const styles = [
|
|
80
|
+
'fillStyle',
|
|
81
|
+
'strokeStyle',
|
|
82
|
+
'globalAlpha',
|
|
83
|
+
'textAlign',
|
|
84
|
+
'textBaseAlign',
|
|
85
|
+
'shadow',
|
|
86
|
+
'lineWidth',
|
|
87
|
+
'lineCap',
|
|
88
|
+
'lineJoin',
|
|
89
|
+
'lineDash',
|
|
90
|
+
'miterLimit',
|
|
91
|
+
'fontSize'
|
|
92
|
+
]
|
|
93
|
+
styles.forEach(key => {
|
|
94
|
+
Object.defineProperty(ctx, key, {
|
|
95
|
+
get () {
|
|
96
|
+
return styles[key]
|
|
97
|
+
},
|
|
98
|
+
set (value) {
|
|
99
|
+
if ((key !== 'fillStyle' && key !== 'strokeStyle') || (value !== 'none' && value !== null)) {
|
|
100
|
+
ctx['set' + key.charAt(0).toUpperCase() + key.slice(1)](value)
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
})
|
|
105
|
+
// #endif
|
|
106
|
+
|
|
107
|
+
ctx.createRadialGradient = (...args) => {
|
|
108
|
+
return ctx.createCircularGradient(...args)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
_initEvent () {
|
|
113
|
+
this.event = {}
|
|
114
|
+
const eventNames = [
|
|
115
|
+
{
|
|
116
|
+
wxName: 'touchStart',
|
|
117
|
+
ecName: 'mousedown'
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
wxName: 'touchMove',
|
|
121
|
+
ecName: 'mousemove'
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
wxName: 'touchEnd',
|
|
125
|
+
ecName: 'mouseup'
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
wxName: 'touchEnd',
|
|
129
|
+
ecName: 'click'
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
eventNames.forEach(name => {
|
|
133
|
+
this.event[name.wxName] = e => {
|
|
134
|
+
const touch = e.touches[0]
|
|
135
|
+
this.chart.getZr().handler.dispatch(name.ecName, {
|
|
136
|
+
zrX: name.wxName === 'tap' ? touch.clientX : touch.x,
|
|
137
|
+
zrY: name.wxName === 'tap' ? touch.clientY : touch.y
|
|
138
|
+
})
|
|
139
|
+
}
|
|
140
|
+
})
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
set width (w) {
|
|
144
|
+
if (this.canvasNode) {
|
|
145
|
+
this.canvasNode.width = w
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
set height (h) {
|
|
150
|
+
if (this.canvasNode) {
|
|
151
|
+
this.canvasNode.height = h
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
get width () {
|
|
156
|
+
if (this.canvasNode) {
|
|
157
|
+
return this.canvasNode.width
|
|
158
|
+
}
|
|
159
|
+
return 0
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
get height () {
|
|
163
|
+
if (this.canvasNode) {
|
|
164
|
+
return this.canvasNode.height
|
|
165
|
+
}
|
|
166
|
+
return 0
|
|
167
|
+
}
|
|
168
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="ml-form-item" :class="[className || '', itemTitleAlign ? `title-align-${itemTitleAlign}` : '', itemAlign ? `align-${itemAlign}` : '', {'is-border': isFormBorder, 'is-vertical': itemVertical, 'is-required': isRequired, 'is-error': itemErrRule}]">
|
|
3
|
-
<view class="ml-form-item-header" :style="titleStyle">
|
|
3
|
+
<view v-if="title || $slots.title" class="ml-form-item-header" :style="titleStyle">
|
|
4
4
|
<view v-if="isRequired" class="ml-form-item-header-asterisk">*</view>
|
|
5
5
|
<view class="ml-form-item-header-title">
|
|
6
6
|
<slot name="title">{{ title }}</slot>
|
|
@@ -185,8 +185,8 @@ export default {
|
|
|
185
185
|
position: relative;
|
|
186
186
|
display: flex;
|
|
187
187
|
flex-direction: row;
|
|
188
|
-
font-size: $uni-font-size-base;
|
|
189
188
|
padding: 10rpx 20rpx;
|
|
189
|
+
font-size: $ml-base-font-size;
|
|
190
190
|
&.is-border {
|
|
191
191
|
border-bottom: 1px solid #e5e5e5;
|
|
192
192
|
}
|
|
@@ -207,6 +207,7 @@ export default {
|
|
|
207
207
|
}
|
|
208
208
|
.ml-form-item-header-title {
|
|
209
209
|
display: inline;
|
|
210
|
+
color: #171A1D;
|
|
210
211
|
}
|
|
211
212
|
&.is-vertical {
|
|
212
213
|
flex-direction: column;
|
|
@@ -256,12 +257,11 @@ export default {
|
|
|
256
257
|
.ml-form-item-content {
|
|
257
258
|
position: relative;
|
|
258
259
|
display: flex;
|
|
259
|
-
|
|
260
|
+
justify-content: center;
|
|
260
261
|
flex-direction: column;
|
|
261
262
|
flex-grow: 1;
|
|
262
263
|
}
|
|
263
264
|
.ml-form-item-content-warpper {
|
|
264
|
-
flex-grow: 1;
|
|
265
265
|
width: 100%;
|
|
266
266
|
padding: 10rpx 0;
|
|
267
267
|
}
|
|
@@ -269,9 +269,6 @@ export default {
|
|
|
269
269
|
vertical-align: middle;
|
|
270
270
|
}
|
|
271
271
|
.ml-form-item-content-error {
|
|
272
|
-
position: absolute;
|
|
273
|
-
left: 0;
|
|
274
|
-
bottom: -20rpx;
|
|
275
272
|
width: 100%;
|
|
276
273
|
color: $uni-color-error;
|
|
277
274
|
font-size: 24rpx;
|