mali-applet-ui 1.0.50 → 1.0.52

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.
@@ -1,21 +1,34 @@
1
1
  <template>
2
2
  <view class="ml-chunk-item" :class="[className || '', span && !width ? `span-${span}` : '', itemAlign ? `align-${itemAlign}` : '', {'is-fixed': span || width, 'is-vertical': isVertical}]" :style="styles" @click="clickEvent" @tap="tapEvent">
3
- <slot></slot>
3
+ <slot>
4
+ <view class="ml-chunk-item-num">
5
+ <ml-amount-text v-if="type === 'amount'" :value="value" :simplify="simplify" />
6
+ <text v-else>{{ currNum }}</text>
7
+ </view>
8
+ <view class="ml-chunk-item-name">{{ title || '' }}</view>
9
+ </slot>
4
10
  </view>
5
11
  </template>
6
12
 
7
13
  <script>
14
+ import XEUtils from 'xe-utils'
15
+
8
16
  export default {
9
17
  name: 'MlChunkItem',
10
18
  options: {
11
19
  virtualHost: true
12
20
  },
13
21
  props: {
22
+ value: [String, Number],
23
+ amount: [String, Number],
24
+ simplify: Boolean,
25
+ type: String,
14
26
  span: [String, Number],
15
27
  url: String,
16
28
  redirect: Boolean,
17
29
  align: String,
18
30
  width: String,
31
+ title: String,
19
32
  className: String
20
33
  },
21
34
  inject: {
@@ -25,6 +38,10 @@ export default {
25
38
  }
26
39
  },
27
40
  computed: {
41
+ currNum () {
42
+ const num = XEUtils.toValueString(this.value)
43
+ return num || 0
44
+ },
28
45
  isVertical () {
29
46
  return this.chunk ? this.chunk.vertical : ''
30
47
  },
@@ -97,5 +114,19 @@ export default {
97
114
  border: 0;
98
115
  }
99
116
  }
117
+ .ml-chunk-item-num {
118
+ display: block;
119
+ font-size: $ml-base-font-size;
120
+ font-weight: bold;
121
+ overflow: hidden;
122
+ text-overflow: ellipsis;
123
+ white-space: nowrap;
124
+ }
125
+ .ml-chunk-item-name {
126
+ display: block;
127
+ overflow: hidden;
128
+ text-overflow: ellipsis;
129
+ white-space: nowrap;
130
+ }
100
131
  }
101
132
  </style>
@@ -0,0 +1,47 @@
1
+ <template>
2
+ <view class="ml-list-item-describe">
3
+ <view class="ml-list-item-describe-left">{{ title || '' }}</view>
4
+ <view class="ml-list-item-describe-content">
5
+ <slot>
6
+ <text>{{ content || '' }}</text>
7
+ </slot>
8
+ </view>
9
+ <view class="ml-list-item-describe-right">
10
+ <slot name="extra"></slot>
11
+ </view>
12
+ </view>
13
+ </template>
14
+
15
+ <script>
16
+ export default {
17
+ name: 'MlListItemDescribe',
18
+ props: {
19
+ title: String,
20
+ content: String
21
+ }
22
+ }
23
+ </script>
24
+
25
+ <style lang="scss">
26
+ .ml-list-item-describe {
27
+ display: flex;
28
+ flex-direction: row;
29
+ width: 100%;
30
+ font-size: $ml-describe-font-size;
31
+ color: rgba(23, 26, 29, 0.6);
32
+ overflow: hidden;
33
+ padding-bottom: 8rpx;
34
+ .ml-list-item-describe-left {
35
+ flex-shrink: 0;
36
+ }
37
+ .ml-list-item-describe-content {
38
+ flex-grow: 1;
39
+ overflow: hidden;
40
+ text-overflow: ellipsis;
41
+ white-space: nowrap;
42
+ }
43
+ .ml-list-item-describe-right {
44
+ flex-shrink: 0;
45
+ }
46
+ }
47
+ </style>
@@ -0,0 +1,37 @@
1
+ <template>
2
+ <view class="ml-list-item-menu" @tap.stop="openAction">
3
+ <ml-icon name="menu" :status="status || 'primary'" />
4
+ </view>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ name: 'MlListItemMenu',
10
+ props: {
11
+ options: Array,
12
+ status: String,
13
+ params: Object
14
+ },
15
+ methods: {
16
+ openAction () {
17
+ uni.showActionSheet({
18
+ itemList: this.options.map(item => item.label),
19
+ success: (res) => {
20
+ const index = res.tapIndex
21
+ const item = this.options[index]
22
+ const value = item.value
23
+ this.$emit('change', { ...this.params, value, option: item })
24
+ }
25
+ })
26
+ }
27
+ }
28
+ }
29
+ </script>
30
+
31
+ <style lang="scss">
32
+ .ml-list-item-menu {
33
+ display: inline-block;
34
+ padding: 0 20rpx;
35
+ font-size: 36rpx;
36
+ }
37
+ </style>
@@ -0,0 +1,71 @@
1
+ <template>
2
+ <view class="ml-list-item-title">
3
+ <view class="ml-list-item-title-left">
4
+ <text v-if="showSeq" class="ml-list-item-title-seq">{{ itemIndex + 1 }}</text>
5
+ <text v-if="icon" class="ml-list-item-title-icon">
6
+ <ml-icon :name="icon" status="primary" />
7
+ </text>
8
+ <text class="ml-list-item-title-content">{{ currTitle }}</text>
9
+ </view>
10
+ <view class="ml-list-item-title-right">
11
+ <slot name="extra"></slot>
12
+ </view>
13
+ </view>
14
+ </template>
15
+
16
+ <script>
17
+ import XEUtils from 'xe-utils'
18
+
19
+ export default {
20
+ name: 'MlListItemTitle',
21
+ props: {
22
+ showSeq: Boolean,
23
+ itemIndex: Number,
24
+ icon: String,
25
+ content: String,
26
+ max: {
27
+ type: [String, Number],
28
+ default: 30
29
+ }
30
+ },
31
+ computed: {
32
+ currTitle () {
33
+ const text = XEUtils.toValueString(this.content)
34
+ if (text.length > this.max) {
35
+ return `${text.substring(0, this.max)}...`
36
+ }
37
+ return text
38
+ }
39
+ }
40
+ }
41
+ </script>
42
+
43
+ <style lang="scss">
44
+ .ml-list-item-title {
45
+ display: flex;
46
+ flex-direction: row;
47
+ width: 100%;
48
+ font-size: $ml-base-font-size;
49
+ padding-bottom: 16rpx;
50
+ color: $ml-font-color;
51
+ .ml-list-item-title-left {
52
+ flex-grow: 1;
53
+ word-break: break-all;
54
+ white-space: normal;
55
+ }
56
+ .ml-list-item-title-right {
57
+ flex-shrink: 0;
58
+ }
59
+ .ml-list-item-title-seq {
60
+ color: $uni-color-primary;
61
+ }
62
+ .ml-list-item-title-seq,
63
+ .ml-list-item-title-icon {
64
+ display: inline;
65
+ padding-right: 10rpx;
66
+ }
67
+ .ml-list-item-title-content {
68
+ display: inline;
69
+ }
70
+ }
71
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "1.0.50",
3
+ "version": "1.0.52",
4
4
  "description": "码里云小程序组件库",
5
5
  "files": [
6
6
  "lib",