mali-applet-ui 0.0.27 → 0.0.30

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 (32) hide show
  1. package/components/ml-amount-input/ml-amount-input.vue +3 -0
  2. package/components/ml-amount-text/ml-amount-text.vue +3 -0
  3. package/components/ml-checkbox/ml-checkbox.vue +3 -0
  4. package/components/ml-checkbox-group/ml-checkbox-group.vue +3 -0
  5. package/components/ml-date-picker/ml-date-picker.vue +3 -0
  6. package/components/ml-date-range-picker/ml-date-range-picker.vue +3 -0
  7. package/components/ml-datetime-picker/ml-datetime-picker.vue +3 -0
  8. package/components/ml-datetime-range-picker/ml-datetime-range-picker.vue +3 -0
  9. package/components/ml-echarts/ml-echarts.vue +3 -0
  10. package/components/ml-form/ml-form.vue +3 -0
  11. package/components/ml-form-item/ml-form-item.vue +3 -0
  12. package/components/ml-full-watermark/ml-full-watermark.vue +3 -0
  13. package/components/ml-icon/ml-icon.vue +3 -0
  14. package/components/ml-input/ml-input.vue +3 -0
  15. package/components/ml-list-menu/ml-list-menu.vue +65 -0
  16. package/components/ml-month-picker/ml-month-picker.vue +3 -0
  17. package/components/ml-number-input/ml-number-input.vue +3 -0
  18. package/components/ml-progress-bar/ml-progress-bar.vue +3 -0
  19. package/components/ml-province-city-picker/ml-province-city-picker.vue +1 -1
  20. package/components/ml-province-city-picker/{provinceCity.json → province-city.json} +0 -0
  21. package/components/ml-radio/ml-radio.vue +3 -0
  22. package/components/ml-radio-button/ml-radio-button.vue +3 -0
  23. package/components/ml-radio-group/ml-radio-group.vue +3 -0
  24. package/components/ml-section/ml-section.vue +3 -0
  25. package/components/ml-select-picker/ml-select-picker.vue +3 -0
  26. package/components/ml-tabbar/ml-tabbar.vue +44 -40
  27. package/components/ml-table/ml-table.vue +3 -0
  28. package/components/ml-tabs/ml-tabs.vue +3 -0
  29. package/components/ml-textarea/ml-textarea.vue +3 -0
  30. package/components/ml-textarea/voice-input.vue +3 -0
  31. package/components/ml-year-picker/ml-year-picker.vue +3 -0
  32. package/package.json +1 -1
@@ -8,6 +8,9 @@ import { toNumMoneyToChinese } from '../../utils'
8
8
 
9
9
  export default {
10
10
  name: 'MlAmountInput',
11
+ options: {
12
+ virtualHost: true
13
+ },
11
14
  props: {
12
15
  value: String,
13
16
  align: String,
@@ -17,6 +17,9 @@ import { toAmountString, toWanAmountString } from '../../utils'
17
17
 
18
18
  export default {
19
19
  name: 'MlAmountText',
20
+ options: {
21
+ virtualHost: true
22
+ },
20
23
  props: {
21
24
  value: [String, Number],
22
25
  simplify: Boolean,
@@ -12,6 +12,9 @@
12
12
  <script>
13
13
  export default {
14
14
  name: 'MlCheckbox',
15
+ options: {
16
+ virtualHost: true
17
+ },
15
18
  props: {
16
19
  value: [Boolean, Number, String],
17
20
  label: {
@@ -9,6 +9,9 @@
9
9
  <script>
10
10
  export default {
11
11
  name: 'MlCheckboxGroup',
12
+ options: {
13
+ virtualHost: true
14
+ },
12
15
  props: {
13
16
  value: Array,
14
17
  options: Array,
@@ -5,6 +5,9 @@
5
5
  <script>
6
6
  export default {
7
7
  name: 'MlDatePicker',
8
+ options: {
9
+ virtualHost: true
10
+ },
8
11
  props: {
9
12
  value: String,
10
13
  border: Boolean,
@@ -5,6 +5,9 @@
5
5
  <script>
6
6
  export default {
7
7
  name: 'MlDateRangePicker',
8
+ options: {
9
+ virtualHost: true
10
+ },
8
11
  props: {
9
12
  border: Boolean,
10
13
  startDate: String,
@@ -5,6 +5,9 @@
5
5
  <script>
6
6
  export default {
7
7
  name: 'MlDatePicker',
8
+ options: {
9
+ virtualHost: true
10
+ },
8
11
  props: {
9
12
  value: String,
10
13
  border: Boolean,
@@ -5,6 +5,9 @@
5
5
  <script>
6
6
  export default {
7
7
  name: 'MlDatetimeRangePicker',
8
+ options: {
9
+ virtualHost: true
10
+ },
8
11
  props: {
9
12
  border: Boolean,
10
13
  startDate: String,
@@ -36,6 +36,9 @@ function compareVersion(v1, v2) {
36
36
 
37
37
  export default {
38
38
  name: 'MlEcharts',
39
+ options: {
40
+ virtualHost: true
41
+ },
39
42
  props: {
40
43
  options: Object,
41
44
  height:String,
@@ -11,6 +11,9 @@ import XEUtils from 'xe-utils'
11
11
 
12
12
  export default {
13
13
  name: 'MlForm',
14
+ options: {
15
+ virtualHost: true
16
+ },
14
17
  props: {
15
18
  data: Object,
16
19
  items: Array,
@@ -7,6 +7,9 @@
7
7
  <script>
8
8
  export default {
9
9
  name: 'MlFormItem',
10
+ options: {
11
+ virtualHost: true
12
+ },
10
13
  props: {
11
14
  title: String,
12
15
  field: String
@@ -7,6 +7,9 @@
7
7
  <script>
8
8
  export default {
9
9
  name: 'MlFullWatermark',
10
+ options: {
11
+ virtualHost: true
12
+ },
10
13
  props: {
11
14
  content: String
12
15
  }
@@ -5,6 +5,9 @@
5
5
  <script>
6
6
  export default {
7
7
  name: 'MlIcon',
8
+ options: {
9
+ virtualHost: true
10
+ },
8
11
  props: {
9
12
  name: String,
10
13
  className: String
@@ -19,6 +19,9 @@
19
19
  <script>
20
20
  export default {
21
21
  name: 'MlInput',
22
+ options: {
23
+ virtualHost: true
24
+ },
22
25
  props: {
23
26
  value: [Number, String],
24
27
  type: String,
@@ -0,0 +1,65 @@
1
+ <template>
2
+ <view class="ml-list-menu" @click="clickEvent" @tap="tapEvent">
3
+ <view v-if="prefixIcon" class="ml-list-menu-left-icon">
4
+ <ml-icon :className="prefixIcon"></ml-icon>
5
+ </view>
6
+ <view class="ml-list-menu-content">
7
+ <slot>
8
+ <text>{{ name }}</text>
9
+ </slot>
10
+ </view>
11
+ <view class="ml-list-menu-right-icon">
12
+ <ml-icon class="right-icon" name="arrow-right"></ml-icon>
13
+ </view>
14
+ </view>
15
+ </template>
16
+
17
+ <script>
18
+ export default {
19
+ name: 'MlListMenu',
20
+ options: {
21
+ virtualHost: true
22
+ },
23
+ props: {
24
+ name: String,
25
+ prefixIcon: String,
26
+ suffixIcon: String,
27
+ },
28
+ methods: {
29
+ clickEvent () {
30
+ this.$emit('click', {})
31
+ },
32
+ tapEvent () {
33
+ this.$emit('tap', {})
34
+ }
35
+ }
36
+ }
37
+ </script>
38
+
39
+ <style lang="scss">
40
+ .ml-list-menu {
41
+ display: flex;
42
+ flex-direction: row;
43
+ border-bottom: 1px solid #e5e5e5;
44
+ line-height: 90rpx;
45
+ font-size: 30rpx;
46
+ padding: 0 20rpx;
47
+ .ml-list-menu-content {
48
+ flex-grow: 1;
49
+ overflow: hidden;
50
+ text-overflow: ellipsis;
51
+ white-space: nowrap;
52
+ }
53
+ .ml-list-menu-left-icon,
54
+ .ml-list-menu-right-icon {
55
+ flex-shrink: 0;
56
+ padding: 0 10rpx;
57
+ }
58
+ .ml-list-menu-left-icon {
59
+ font-size: 38rpx;
60
+ }
61
+ .ml-list-menu-right-icon {
62
+ font-size: 30rpx;
63
+ }
64
+ }
65
+ </style>
@@ -10,6 +10,9 @@
10
10
  <script>
11
11
  export default {
12
12
  name: 'MlMonthPicker',
13
+ options: {
14
+ virtualHost: true
15
+ },
13
16
  props: {
14
17
  value: String,
15
18
  border: Boolean
@@ -5,6 +5,9 @@
5
5
  <script>
6
6
  export default {
7
7
  name: 'MlNumberInput',
8
+ options: {
9
+ virtualHost: true
10
+ },
8
11
  props: {
9
12
  value: String,
10
13
  align: String,
@@ -26,6 +26,9 @@ import XEUtils from 'xe-utils'
26
26
 
27
27
  export default {
28
28
  name: 'MlProgressBar',
29
+ options: {
30
+ virtualHost: true
31
+ },
29
32
  props: {
30
33
  value: Number,
31
34
  max: {
@@ -14,7 +14,7 @@
14
14
  </template>
15
15
 
16
16
  <script>
17
- import provinceCity from './provinceCity.json'
17
+ import provinceCity from './province-city.json'
18
18
 
19
19
  export default {
20
20
  name: 'MlProvinceCityPicker',
@@ -12,6 +12,9 @@
12
12
  <script>
13
13
  export default {
14
14
  name: 'MlRadio',
15
+ options: {
16
+ virtualHost: true
17
+ },
15
18
  props: {
16
19
  value: [Boolean, Number, String],
17
20
  label: {
@@ -7,6 +7,9 @@
7
7
  <script>
8
8
  export default {
9
9
  name: 'MlRadioButton',
10
+ options: {
11
+ virtualHost: true
12
+ },
10
13
  props: {
11
14
  value: [Boolean, Number, String],
12
15
  options: Array,
@@ -9,6 +9,9 @@
9
9
  <script>
10
10
  export default {
11
11
  name: 'MlRadioGroup',
12
+ options: {
13
+ virtualHost: true
14
+ },
12
15
  props: {
13
16
  value: [Boolean, Number, String],
14
17
  options: Array,
@@ -14,6 +14,9 @@
14
14
  <script>
15
15
  export default {
16
16
  name: 'MlSection',
17
+ options: {
18
+ virtualHost: true
19
+ },
17
20
  props: {
18
21
  title: String,
19
22
  type: String
@@ -13,6 +13,9 @@
13
13
  <script>
14
14
  export default {
15
15
  name: 'MlSelectPicker',
16
+ options: {
17
+ virtualHost: true
18
+ },
16
19
  props: {
17
20
  value: [Number, String],
18
21
  border: Boolean,
@@ -1,13 +1,11 @@
1
1
  <template>
2
2
  <view class="ml-tabbar">
3
- <view class="ml-tabbar-list">
4
- <view class="ml-tabbar-item" v-for="(item) in options" :key="item.value" :class="{'is-active': value == item.value}" @click="clickEvent(item)">
5
- <view class="ml-tabbar-icon">
6
- <ml-icon class="icon" :name="value == item.value ? item.activeIcon : item.icon"></ml-icon>
7
- </view>
8
- <view class="ml-tabbar-name">{{ item.name }}</view>
3
+ <view class="ml-tabbar-item" v-for="(item) in options" :key="item.value" :class="{'is-active': value == item.value}" @tap="tapEvent(item)">
4
+ <view class="ml-tabbar-icon">
5
+ <ml-icon class="icon" :name="value == item.value ? item.activeIcon : item.icon"></ml-icon>
9
6
  <view v-if="item.showNum && item.num > 0" class="ml-tabbar-num">{{ item.num }}</view>
10
7
  </view>
8
+ <view class="ml-tabbar-name">{{ item.name }}</view>
11
9
  </view>
12
10
  </view>
13
11
  </template>
@@ -24,16 +22,34 @@ export default {
24
22
 
25
23
  }
26
24
  },
25
+ computed: {
26
+ selectItem () {
27
+ return this.options.find(item => item.value === this.value)
28
+ }
29
+ },
30
+ watch: {
31
+ value () {
32
+ this.updateTitle(this.selectItem)
33
+ }
34
+ },
35
+ created () {
36
+ this.$nextTick(() => {
37
+ this.updateTitle(this.selectItem)
38
+ })
39
+ },
27
40
  methods: {
28
- clickEvent (option) {
41
+ updateTitle (option) {
42
+ if (option && option.name) {
43
+ uni.setNavigationBarTitle({
44
+ title: option.name
45
+ })
46
+ }
47
+ },
48
+ tapEvent (option) {
29
49
  const value = option.value
50
+ this.updateTitle(option)
30
51
  this.$emit('input', value)
31
52
  this.$emit('change', { value, option })
32
- if (option.url) {
33
- uni.redirectTo({
34
- url: option.url
35
- })
36
- }
37
53
  }
38
54
  }
39
55
  }
@@ -41,25 +57,20 @@ export default {
41
57
 
42
58
  <style lang="scss">
43
59
  .ml-tabbar {
60
+ display: flex;
61
+ flex-direction: row;
44
62
  width: 100%;
45
63
  position: fixed;
46
64
  left: 0;
47
65
  bottom: 0;
48
66
  z-index: 88;
67
+ padding: 6rpx 0 12rpx 0;
49
68
  color: $uni-text-color;
50
69
  background: #FFFFFF;
51
- .ml-tabbar-list {
52
- width: 100%;
53
- height: 120rpx;
54
- display: flex;
55
- align-items: center;
56
- align-content: center;
57
- justify-content: space-between;
58
- box-sizing: border-box;
59
- }
70
+ border-top: 1px solid #e5e5e5;
60
71
  .ml-tabbar-item {
61
- position: relative;
62
- flex: 1;
72
+ flex-grow: 1;
73
+ text-align: center;
63
74
  &.is-active {
64
75
  border: 0;
65
76
  color: $uni-color-primary;
@@ -67,34 +78,27 @@ export default {
67
78
  }
68
79
  .ml-tabbar-num {
69
80
  position: absolute;
70
- top: -4px;
71
- right: 40rpx;
72
- background-color: red;
81
+ top: 0;
82
+ left: 114rpx;
83
+ background-color: #f56c6c;
73
84
  color: #fff;
74
85
  border-radius: 20rpx;
75
- padding: 4rpx 10rpx;
86
+ padding: 0 10rpx;
76
87
  display: inline-block;
77
- min-width: 40rpx;
88
+ min-width: 30rpx;
78
89
  text-align: center;
79
- font-size: 24rpx;
90
+ font-size: 22rpx;
91
+ line-height: 32rpx;
80
92
  }
81
93
  .ml-tabbar-icon {
82
- width: 45rpx;
83
- height: 45rpx;
84
- margin: 0 auto;
85
- text-align: center;
86
- .icon{
87
- font-size: 40rpx;
88
- }
94
+ position: relative;
95
+ font-size: 40rpx;
89
96
  }
90
97
  .ml-tabbar-name {
91
98
  width: 100%;
92
- height: 30rpx;
93
99
  text-align: center;
94
100
  font-size: 24rpx;
95
- font-family: PingFangSC-Medium;
96
- letter-spacing: 2rpx;
97
- line-height: 48rpx;
101
+ line-height: 40rpx;
98
102
  }
99
103
  }
100
104
  </style>
@@ -70,6 +70,9 @@ import XEUtils from 'xe-utils'
70
70
  */
71
71
  export default {
72
72
  name: 'MlTable',
73
+ options: {
74
+ virtualHost: true
75
+ },
73
76
  props: {
74
77
  loading: Boolean,
75
78
  height: [Number, String],
@@ -11,6 +11,9 @@
11
11
  <script>
12
12
  export default {
13
13
  name: 'MlTabs',
14
+ options: {
15
+ virtualHost: true
16
+ },
14
17
  props: {
15
18
  value: [String, Number],
16
19
  options: Array
@@ -16,6 +16,9 @@ import VoiceInput from './voice-input.vue'
16
16
 
17
17
  export default {
18
18
  name: 'MlTextarea',
19
+ options: {
20
+ virtualHost: true
21
+ },
19
22
  components: {
20
23
  VoiceInput
21
24
  },
@@ -25,6 +25,9 @@
25
25
 
26
26
  <script>
27
27
  export default {
28
+ options: {
29
+ virtualHost: true
30
+ },
28
31
  props: {
29
32
  value: String
30
33
  },
@@ -10,6 +10,9 @@
10
10
  <script>
11
11
  export default {
12
12
  name: 'MlYearPicker',
13
+ options: {
14
+ virtualHost: true
15
+ },
13
16
  props: {
14
17
  value: String,
15
18
  border: Boolean
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "0.0.27",
3
+ "version": "0.0.30",
4
4
  "description": "码里云小程序组件库",
5
5
  "files": [
6
6
  "components",