mali-applet-ui 0.0.22 → 0.0.25

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 (30) hide show
  1. package/components/ml-amount-input/ml-amount-input.vue +1 -1
  2. package/components/ml-button/ml-button.vue +5 -1
  3. package/components/ml-checkbox/ml-checkbox.vue +2 -2
  4. package/components/ml-checkbox-group/ml-checkbox-group.vue +1 -1
  5. package/components/ml-col/ml-col.vue +53 -0
  6. package/components/ml-date-picker/ml-date-picker.vue +1 -1
  7. package/components/ml-date-range-picker/ml-date-range-picker.vue +1 -1
  8. package/components/ml-datetime-picker/ml-datetime-picker.vue +1 -1
  9. package/components/ml-datetime-range-picker/ml-datetime-range-picker.vue +1 -1
  10. package/components/ml-echarts/ml-echarts.vue +1 -1
  11. package/components/ml-form/ml-form.vue +1 -1
  12. package/components/ml-form-item/ml-form-item.vue +1 -1
  13. package/components/ml-full-watermark/ml-full-watermark.vue +1 -1
  14. package/components/ml-icon/ml-icon.vue +1 -1
  15. package/components/ml-input/ml-input.vue +1 -1
  16. package/components/ml-month-picker/ml-month-picker.vue +1 -1
  17. package/components/ml-number-input/ml-number-input.vue +1 -1
  18. package/components/ml-progress-bar/ml-progress-bar.vue +1 -1
  19. package/components/ml-province-city-picker/ml-province-city-picker.vue +1 -1
  20. package/components/ml-radio/ml-radio.vue +2 -2
  21. package/components/ml-radio-button/ml-radio-button.vue +3 -3
  22. package/components/ml-radio-group/ml-radio-group.vue +3 -2
  23. package/components/ml-row/ml-row.vue +4 -1
  24. package/components/ml-section/ml-section.vue +41 -0
  25. package/components/ml-select-picker/ml-select-picker.vue +1 -1
  26. package/components/{ml-layout-tabbar/ml-layout-tabbar.vue → ml-tabbar/ml-tabbar.vue} +16 -16
  27. package/components/ml-tabs/ml-tabs.vue +15 -4
  28. package/components/ml-textarea/ml-textarea.vue +1 -1
  29. package/components/ml-year-picker/ml-year-picker.vue +1 -1
  30. package/package.json +1 -1
@@ -7,7 +7,7 @@ import XEUtils from 'xe-utils'
7
7
  import { toNumMoneyToChinese } from '../../utils'
8
8
 
9
9
  export default {
10
- name: 'ml-amount-input',
10
+ name: 'MlAmountInput',
11
11
  props: {
12
12
  value: String,
13
13
  align: String,
@@ -6,7 +6,10 @@
6
6
 
7
7
  <script>
8
8
  export default {
9
- name: 'ml-button',
9
+ name: 'MlButton',
10
+ options: {
11
+ virtualHost: true
12
+ },
10
13
  props: {
11
14
  content: String,
12
15
  status: String,
@@ -30,6 +33,7 @@ export default {
30
33
  <style lang="scss">
31
34
  .ml-button {
32
35
  width: 100%;
36
+ margin: 0 10rpx;
33
37
  &.type-button {
34
38
  line-height: 80rpx;
35
39
  border: 1px solid #e5e5e5;
@@ -11,7 +11,7 @@
11
11
 
12
12
  <script>
13
13
  export default {
14
- name: 'ml-checkbox',
14
+ name: 'MlCheckbox',
15
15
  props: {
16
16
  value: [Boolean, Number, String],
17
17
  label: {
@@ -50,7 +50,7 @@ export default {
50
50
  display: inline-block;
51
51
  margin-right: 20rpx;
52
52
  &.is-checked {
53
- color: #1890ff;
53
+ color: $uni-color-primary;
54
54
  }
55
55
  .checkbox-icon {
56
56
  display: inline-block;
@@ -8,7 +8,7 @@
8
8
 
9
9
  <script>
10
10
  export default {
11
- name: 'ml-checkbox-group',
11
+ name: 'MlCheckboxGroup',
12
12
  props: {
13
13
  value: Array,
14
14
  options: Array,
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <view class="ml-col" :class="[span && !width ? `span-${span}` : '', align ? `align-${align}` : '', width ? 'is-fixed' : '']" :style="styles">
3
+ <slot></slot>
4
+ </view>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ name: 'MlCol',
10
+ options: {
11
+ virtualHost: true
12
+ },
13
+ props: {
14
+ span: [String, Number],
15
+ align: String,
16
+ width: String
17
+ },
18
+ computed: {
19
+ styles () {
20
+ const rest = {}
21
+ if (this.width) {
22
+ rest.width = this.width
23
+ }
24
+ return rest
25
+ }
26
+ }
27
+ }
28
+ </script>
29
+
30
+ <style lang="scss">
31
+ .ml-col {
32
+ $spans: 4.16667%, 8.33333%, 12.5%, 16.66667%, 20.83333%, 25%, 29.16667%, 33.33333%,
33
+ 37.5%, 41.66667%, 45.83333%, 50%, 54.16667%, 58.33333%, 62.5%, 66.66667%,
34
+ 70.83333%, 75%, 79.16667%, 83.33333%, 87.5%, 91.66667%, 95.83333%, 100%;
35
+ &.align-left {
36
+ text-align: left;
37
+ }
38
+ &.align-center {
39
+ text-align: center;
40
+ }
41
+ &.align-right {
42
+ text-align: right;
43
+ }
44
+ &:not(.is-fixed) {
45
+ flex-grow: 1;
46
+ }
47
+ @for $index from 0 to length($spans) {
48
+ &.span-#{$index + 1} {
49
+ width: nth($spans, $index + 1);
50
+ }
51
+ }
52
+ }
53
+ </style>
@@ -4,7 +4,7 @@
4
4
 
5
5
  <script>
6
6
  export default {
7
- name: 'ml-date-picker',
7
+ name: 'MlDatePicker',
8
8
  props: {
9
9
  value: String,
10
10
  border: Boolean,
@@ -4,7 +4,7 @@
4
4
 
5
5
  <script>
6
6
  export default {
7
- name: 'ml-date-range-picker',
7
+ name: 'MlDateRangePicker',
8
8
  props: {
9
9
  border: Boolean,
10
10
  startDate: String,
@@ -4,7 +4,7 @@
4
4
 
5
5
  <script>
6
6
  export default {
7
- name: 'ml-date-picker',
7
+ name: 'MlDatePicker',
8
8
  props: {
9
9
  value: String,
10
10
  border: Boolean,
@@ -4,7 +4,7 @@
4
4
 
5
5
  <script>
6
6
  export default {
7
- name: 'ml-datetime-range-picker',
7
+ name: 'MlDatetimeRangePicker',
8
8
  props: {
9
9
  border: Boolean,
10
10
  startDate: String,
@@ -35,7 +35,7 @@ function compareVersion(v1, v2) {
35
35
  }
36
36
 
37
37
  export default {
38
- name: 'ml-echarts',
38
+ name: 'MlEcharts',
39
39
  props: {
40
40
  options: Object,
41
41
  height:String,
@@ -10,7 +10,7 @@
10
10
  import XEUtils from 'xe-utils'
11
11
 
12
12
  export default {
13
- name: 'ml-form',
13
+ name: 'MlForm',
14
14
  props: {
15
15
  data: Object,
16
16
  items: Array,
@@ -6,7 +6,7 @@
6
6
 
7
7
  <script>
8
8
  export default {
9
- name: 'ml-form-item',
9
+ name: 'MlFormItem',
10
10
  props: {
11
11
  title: String,
12
12
  field: String
@@ -6,7 +6,7 @@
6
6
 
7
7
  <script>
8
8
  export default {
9
- name: 'ml-full-watermark',
9
+ name: 'MlFullWatermark',
10
10
  props: {
11
11
  content: String
12
12
  }
@@ -4,7 +4,7 @@
4
4
 
5
5
  <script>
6
6
  export default {
7
- name: 'ml-icon',
7
+ name: 'MlIcon',
8
8
  props: {
9
9
  name: String,
10
10
  className: String
@@ -18,7 +18,7 @@
18
18
 
19
19
  <script>
20
20
  export default {
21
- name: 'ml-input',
21
+ name: 'MlInput',
22
22
  props: {
23
23
  value: [Number, String],
24
24
  type: String,
@@ -9,7 +9,7 @@
9
9
 
10
10
  <script>
11
11
  export default {
12
- name: 'ml-month-picker',
12
+ name: 'MlMonthPicker',
13
13
  props: {
14
14
  value: String,
15
15
  border: Boolean
@@ -4,7 +4,7 @@
4
4
 
5
5
  <script>
6
6
  export default {
7
- name: 'ml-number-input',
7
+ name: 'MlNumberInput',
8
8
  props: {
9
9
  value: String,
10
10
  align: String,
@@ -25,7 +25,7 @@
25
25
  import XEUtils from 'xe-utils'
26
26
 
27
27
  export default {
28
- name: 'ml-progress-bar',
28
+ name: 'MlProgressBar',
29
29
  props: {
30
30
  value: Number,
31
31
  max: {
@@ -17,7 +17,7 @@
17
17
  import provinceCity from './provinceCity.json'
18
18
 
19
19
  export default {
20
- name: 'ml-province-city-picker',
20
+ name: 'MlProvinceCityPicker',
21
21
  props: {
22
22
  value: Array,
23
23
  border: Boolean,
@@ -11,7 +11,7 @@
11
11
 
12
12
  <script>
13
13
  export default {
14
- name: 'ml-radio',
14
+ name: 'MlRadio',
15
15
  props: {
16
16
  value: [Boolean, Number, String],
17
17
  label: {
@@ -41,7 +41,7 @@ export default {
41
41
  display: inline-block;
42
42
  margin-right: 20rpx;
43
43
  &.is-checked {
44
- color: #1890ff;
44
+ color: $uni-color-primary;
45
45
  }
46
46
  .radio-icon {
47
47
  font-size: 1.1em;
@@ -13,10 +13,10 @@ export default {
13
13
  disabled: Boolean
14
14
  },
15
15
  methods: {
16
- changeEvent (item) {
17
- const value = item.value
16
+ changeEvent (option) {
17
+ const value = option.value
18
18
  this.$emit('input', value)
19
- this.$emit('change', { value })
19
+ this.$emit('change', { value, option })
20
20
  }
21
21
  }
22
22
  }
@@ -8,7 +8,7 @@
8
8
 
9
9
  <script>
10
10
  export default {
11
- name: 'ml-radio-group',
11
+ name: 'MlRadioGroup',
12
12
  props: {
13
13
  value: [Boolean, Number, String],
14
14
  options: Array,
@@ -17,8 +17,9 @@ export default {
17
17
  },
18
18
  methods: {
19
19
  changeEvent ({ value }) {
20
+ const option = this.options.find(item => item.value === value)
20
21
  this.$emit('input', value)
21
- this.$emit('change', { value })
22
+ this.$emit('change', { value, option })
22
23
  }
23
24
  }
24
25
  }
@@ -6,7 +6,10 @@
6
6
 
7
7
  <script>
8
8
  export default {
9
- name: 'ml-row',
9
+ name: 'MlRow',
10
+ options: {
11
+ virtualHost: true
12
+ },
10
13
  props: {
11
14
  vertical: Boolean
12
15
  }
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <view class="ml-section" :class="[type ? `type-${type}` : '']">
3
+ <view v-if="title || $slots.header" class="ml-section-header">
4
+ <slot name="header">
5
+ <text class="ml-section-header-title">{{ title }}</text>
6
+ </slot>
7
+ </view>
8
+ <view class="ml-section-content">
9
+ <slot></slot>
10
+ </view>
11
+ </view>
12
+ </template>
13
+
14
+ <script>
15
+ export default {
16
+ name: 'MlSection',
17
+ props: {
18
+ title: String,
19
+ type: String
20
+ }
21
+ }
22
+ </script>
23
+
24
+ <style lang="scss">
25
+ .ml-section {
26
+ &.type-line {
27
+ .ml-section-header-title {
28
+ border-left: 2px solid $uni-color-primary;
29
+ }
30
+ }
31
+ .ml-section-header {
32
+ padding: 10rpx 20rpx;
33
+ .ml-section-header-title {
34
+ padding-left: 20rpx;
35
+ }
36
+ }
37
+ .ml-section-content {
38
+ padding: 0 20rpx;
39
+ }
40
+ }
41
+ </style>
@@ -12,7 +12,7 @@
12
12
 
13
13
  <script>
14
14
  export default {
15
- name: 'ml-select-picker',
15
+ name: 'MlSelectPicker',
16
16
  props: {
17
17
  value: [Number, String],
18
18
  border: Boolean,
@@ -1,12 +1,12 @@
1
1
  <template>
2
- <view class="ml-layout-tabbar">
3
- <view class="ml-layout-tabbar-list">
4
- <view class="ml-layout-tabbar-item" v-for="(item) in options" :key="item.value" :class="{'is-active': value == item.value}" @click="clickEvent(item)">
5
- <view class="ml-layout-tabbar-icon">
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
6
  <ml-icon class="icon" :name="value == item.value ? item.activeIcon : item.icon"></ml-icon>
7
7
  </view>
8
- <view class="ml-layout-tabbar-name">{{ item.name }}</view>
9
- <view v-if="item.showNum && item.num > 0" class="ml-layout-tabbar-num">{{ item.num }}</view>
8
+ <view class="ml-tabbar-name">{{ item.name }}</view>
9
+ <view v-if="item.showNum && item.num > 0" class="ml-tabbar-num">{{ item.num }}</view>
10
10
  </view>
11
11
  </view>
12
12
  </view>
@@ -14,7 +14,7 @@
14
14
 
15
15
  <script>
16
16
  export default {
17
- name: 'MlLayoutTabbar',
17
+ name: 'MlTabbar',
18
18
  props: {
19
19
  value: [String, Number],
20
20
  options: Array
@@ -25,24 +25,24 @@ export default {
25
25
  }
26
26
  },
27
27
  methods: {
28
- clickEvent (item) {
29
- const value = item.value
28
+ clickEvent (option) {
29
+ const value = option.value
30
30
  this.$emit('input', value)
31
- this.$emit('change', { value })
31
+ this.$emit('change', { value, option })
32
32
  }
33
33
  }
34
34
  }
35
35
  </script>
36
36
 
37
37
  <style lang="scss">
38
- .ml-layout-tabbar {
38
+ .ml-tabbar {
39
39
  width: 100%;
40
40
  position: fixed;
41
41
  left: 0;
42
42
  bottom: 0;
43
43
  z-index: 88;
44
44
  background: #FFFFFF;
45
- .ml-layout-tabbar-list {
45
+ .ml-tabbar-list {
46
46
  width: 100%;
47
47
  height: 120rpx;
48
48
  display: flex;
@@ -51,7 +51,7 @@ export default {
51
51
  justify-content: space-between;
52
52
  box-sizing: border-box;
53
53
  }
54
- .ml-layout-tabbar-item {
54
+ .ml-tabbar-item {
55
55
  position: relative;
56
56
  flex: 1;
57
57
  &.is-active {
@@ -59,7 +59,7 @@ export default {
59
59
  color: #2497FF;
60
60
  }
61
61
  }
62
- .ml-layout-tabbar-num {
62
+ .ml-tabbar-num {
63
63
  position: absolute;
64
64
  top: -4px;
65
65
  right: 40rpx;
@@ -72,7 +72,7 @@ export default {
72
72
  text-align: center;
73
73
  font-size: 24rpx;
74
74
  }
75
- .ml-layout-tabbar-icon {
75
+ .ml-tabbar-icon {
76
76
  width: 45rpx;
77
77
  height: 45rpx;
78
78
  margin: 0 auto;
@@ -81,7 +81,7 @@ export default {
81
81
  font-size: 40rpx;
82
82
  }
83
83
  }
84
- .ml-layout-tabbar-name {
84
+ .ml-tabbar-name {
85
85
  width: 100%;
86
86
  height: 30rpx;
87
87
  text-align: center;
@@ -1,13 +1,16 @@
1
1
  <template>
2
2
  <view class="ml-tabs">
3
- <scroll-view class="ml-tabs-navs">
4
- <view class="ml-tabs-nav-item" v-for="(item, index) in options" :key="index" @tap="changeEvent(item)">{{ item.label }}</view>
3
+ <scroll-view scroll-x>
4
+ <view class="ml-tabs-navs">
5
+ <view class="ml-tabs-nav-item" v-for="(item, index) in options" :key="index" :class="{'is-active': value === item.value}" @tap="changeEvent(item)">{{ item.label }}</view>
6
+ </view>
5
7
  </scroll-view>
6
8
  </view>
7
9
  </template>
8
10
 
9
11
  <script>
10
12
  export default {
13
+ name: 'MlTabs',
11
14
  props: {
12
15
  value: [String, Number],
13
16
  options: Array
@@ -28,10 +31,18 @@ export default {
28
31
  <style lang="scss">
29
32
  .ml-tabs {
30
33
  .ml-tabs-navs {
31
- display: flex;
34
+ display: inline-block;
35
+ white-space: nowrap;
32
36
  }
33
37
  .ml-tabs-nav-item {
34
-
38
+ position: relative;
39
+ display: inline-block;
40
+ padding: 10rpx 20rpx;
41
+ margin: 0 10rpx;
42
+ &.is-active {
43
+ color: $uni-color-primary;
44
+ border-bottom: 1px solid $uni-color-primary;
45
+ }
35
46
  }
36
47
  }
37
48
  </style>
@@ -15,7 +15,7 @@
15
15
  import VoiceInput from './voice-input.vue'
16
16
 
17
17
  export default {
18
- name: 'ml-textarea',
18
+ name: 'MlTextarea',
19
19
  components: {
20
20
  VoiceInput
21
21
  },
@@ -9,7 +9,7 @@
9
9
 
10
10
  <script>
11
11
  export default {
12
- name: 'ml-year-picker',
12
+ name: 'MlYearPicker',
13
13
  props: {
14
14
  value: String,
15
15
  border: Boolean
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "0.0.22",
3
+ "version": "0.0.25",
4
4
  "description": "码里云小程序组件库",
5
5
  "files": [
6
6
  "components",