sadais-piui 1.2.7-beta14 → 1.2.7-beta141
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/.prettierrc +8 -0
- package/components/pi-action-sheet/index.vue +260 -247
- package/components/pi-badge/index.vue +11 -1
- package/components/pi-bottom-bar/index.vue +1 -1
- package/components/pi-calendar/index.vue +207 -182
- package/components/pi-calendar-input/index.vue +61 -30
- package/components/pi-calendar-panel/components/calendar-days/index.vue +91 -52
- package/components/pi-calendar-panel/index.vue +28 -12
- package/components/pi-canvas/index.vue +8 -1
- package/components/pi-cascader/index.vue +601 -0
- package/components/pi-checkbox/index.vue +8 -4
- package/components/pi-checkbox-group/index.vue +12 -11
- package/components/pi-circle-progress/index.vue +140 -120
- package/components/pi-code-input/index.vue +11 -3
- package/components/pi-collapse/index.vue +16 -6
- package/components/pi-collapse-item/index.vue +35 -22
- package/components/pi-date-picker/index.vue +512 -391
- package/components/pi-date-picker-input/index.vue +61 -30
- package/components/pi-dropdown/components/dropdown-tab.vue +33 -23
- package/components/pi-dropdown/index.vue +34 -19
- package/components/pi-dropdown-item/index.vue +70 -58
- package/components/pi-form-item/index.vue +99 -20
- package/components/pi-grid/index.vue +1 -1
- package/components/pi-grid-item/index.vue +4 -4
- package/components/pi-img/index.vue +275 -267
- package/components/pi-img-cropper/index.vue +110 -110
- package/components/pi-input/index.vue +97 -36
- package/components/pi-list-item/index.vue +1 -1
- package/components/pi-marquee/index.vue +322 -310
- package/components/pi-mask/index.vue +3 -1
- package/components/pi-pagination/index.vue +13 -0
- package/components/pi-picker/index.vue +332 -317
- package/components/pi-popup/index.vue +4 -1
- package/components/pi-popup-select/index.vue +13 -4
- package/components/pi-radio/index.vue +12 -11
- package/components/pi-radio-group/index.vue +25 -5
- package/components/pi-regions-select/index.vue +6 -1
- package/components/pi-regions-select-input/index.vue +69 -31
- package/components/pi-search/index.vue +37 -2
- package/components/pi-section/index.vue +1 -1
- package/components/pi-select/index.vue +237 -22
- package/components/pi-select-input/index.vue +106 -41
- package/components/pi-stepper/index.vue +135 -121
- package/components/pi-steps/index.vue +115 -36
- package/components/pi-swiper/index.vue +22 -7
- package/components/pi-switch/index.vue +5 -1
- package/components/pi-table/index.vue +351 -0
- package/components/pi-tabs/index.vue +46 -10
- package/components/pi-upload-img/index.vue +578 -39
- package/components/pi-webview/index.vue +95 -82
- package/config/actionSheet.js +0 -1
- package/config/calendarInput.js +2 -1
- package/config/calendarPanel.js +2 -1
- package/config/cascader.js +22 -0
- package/config/circleProgress.js +17 -13
- package/config/codeInput.js +2 -1
- package/config/datePicker.js +29 -24
- package/config/datePickerInput.js +2 -1
- package/config/dropdown.js +3 -1
- package/config/input.js +5 -3
- package/config/regionsSelectInput.js +2 -1
- package/config/select.js +13 -1
- package/config/selectInput.js +2 -1
- package/config/steps.js +1 -1
- package/config/table.js +9 -0
- package/config/uploadImg.js +31 -11
- package/mixin/emitter.js +8 -1
- package/mixin/value-sync.js +5 -0
- package/package.json +5 -2
- package/scss/common.scss +11 -14
- package/scss/icon/icon.scss +2 -1
- package/scss/mixin.scss +5 -5
package/.prettierrc
ADDED
|
@@ -1,247 +1,260 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<pi-popup-select
|
|
3
|
-
:value="val"
|
|
4
|
-
:custom-style="getPopupSelect.customStyle"
|
|
5
|
-
:custom-class="getPopupSelect.customClass"
|
|
6
|
-
:height="getPopupSelect.height"
|
|
7
|
-
:show-title="getPopupSelect.showTitle"
|
|
8
|
-
:title="getPopupSelect.title"
|
|
9
|
-
:title-padding="getPopupSelect.titlePadding"
|
|
10
|
-
:toolbar-position="getPopupSelect.toolbarPosition"
|
|
11
|
-
:on-confirm-close="getPopupSelect.onConfirmClose"
|
|
12
|
-
:on-cancel-close="getPopupSelect.onCancelClose"
|
|
13
|
-
:confirm-btn="getPopupSelect.confirmBtn"
|
|
14
|
-
:cancel-btn="getPopupSelect.cancelBtn"
|
|
15
|
-
:popup="getPopup"
|
|
16
|
-
@close="handlePopupClose"
|
|
17
|
-
@cancel="handleCancel"
|
|
18
|
-
@confirm="handleConfirm"
|
|
19
|
-
>
|
|
20
|
-
<slot name="header" />
|
|
21
|
-
<!-- 描述列 -->
|
|
22
|
-
<view
|
|
23
|
-
v-if="description"
|
|
24
|
-
class="pi-solid-bottom-2 pi-align-center pi-pd-32 pi-light-gray"
|
|
25
|
-
:style="[getItemAlignStyle]"
|
|
26
|
-
>
|
|
27
|
-
{{ description }}
|
|
28
|
-
</view>
|
|
29
|
-
<view
|
|
30
|
-
v-for="item in items"
|
|
31
|
-
:id="`id-${item[keyField]}`"
|
|
32
|
-
:key="item[keyField]"
|
|
33
|
-
:style="[
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
</
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
this
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
this.$emit('
|
|
229
|
-
this.
|
|
230
|
-
},
|
|
231
|
-
/**
|
|
232
|
-
* @vuese
|
|
233
|
-
*
|
|
234
|
-
*/
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
this
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
.
|
|
246
|
-
}
|
|
247
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<pi-popup-select
|
|
3
|
+
:value="val"
|
|
4
|
+
:custom-style="getPopupSelect.customStyle"
|
|
5
|
+
:custom-class="getPopupSelect.customClass"
|
|
6
|
+
:height="getPopupSelect.height"
|
|
7
|
+
:show-title="getPopupSelect.showTitle"
|
|
8
|
+
:title="getPopupSelect.title"
|
|
9
|
+
:title-padding="getPopupSelect.titlePadding"
|
|
10
|
+
:toolbar-position="getPopupSelect.toolbarPosition"
|
|
11
|
+
:on-confirm-close="getPopupSelect.onConfirmClose"
|
|
12
|
+
:on-cancel-close="getPopupSelect.onCancelClose"
|
|
13
|
+
:confirm-btn="getPopupSelect.confirmBtn"
|
|
14
|
+
:cancel-btn="getPopupSelect.cancelBtn"
|
|
15
|
+
:popup="getPopup"
|
|
16
|
+
@close="handlePopupClose"
|
|
17
|
+
@cancel="handleCancel"
|
|
18
|
+
@confirm="handleConfirm"
|
|
19
|
+
>
|
|
20
|
+
<slot name="header" />
|
|
21
|
+
<!-- 描述列 -->
|
|
22
|
+
<view
|
|
23
|
+
v-if="description"
|
|
24
|
+
class="pi-solid-bottom-2 pi-align-center pi-pd-32 pi-light-gray"
|
|
25
|
+
:style="[getItemAlignStyle]"
|
|
26
|
+
>
|
|
27
|
+
{{ description }}
|
|
28
|
+
</view>
|
|
29
|
+
<view
|
|
30
|
+
v-for="item in items"
|
|
31
|
+
:id="`id-${item[keyField]}`"
|
|
32
|
+
:key="item[keyField]"
|
|
33
|
+
:style="[
|
|
34
|
+
itemStyle,
|
|
35
|
+
getItemStyle,
|
|
36
|
+
getItemAlignStyle,
|
|
37
|
+
{ color: item.color }
|
|
38
|
+
]"
|
|
39
|
+
:class="{
|
|
40
|
+
'pi-solid-bottom-1': showItemBottomBorder,
|
|
41
|
+
'pi-disabled': item.disabled
|
|
42
|
+
}"
|
|
43
|
+
class="pi-align-center pi-fz-30 pi-pd-lr-32"
|
|
44
|
+
hover-class="pi-hover-class"
|
|
45
|
+
@tap.stop="handleSelectItem(item)"
|
|
46
|
+
>
|
|
47
|
+
<!-- 自定义列表项 -->
|
|
48
|
+
<slot name="item" :item="item" class="pi-w-100P">
|
|
49
|
+
<template v-if="!item.loading">
|
|
50
|
+
{{ item[displayField] }}
|
|
51
|
+
</template>
|
|
52
|
+
<pi-loading v-else show />
|
|
53
|
+
</slot>
|
|
54
|
+
</view>
|
|
55
|
+
<!-- 取消action -->
|
|
56
|
+
<template v-if="cancelText">
|
|
57
|
+
<pi-gap height="20" />
|
|
58
|
+
<view
|
|
59
|
+
class="pi-align-center pi-fz-30 pi-pd-32 pi-light-gray"
|
|
60
|
+
hover-class="pi-hover-class"
|
|
61
|
+
:style="[getItemAlignStyle]"
|
|
62
|
+
@tap="handleCancel"
|
|
63
|
+
>
|
|
64
|
+
{{ cancelText }}
|
|
65
|
+
</view>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<slot name="footer" />
|
|
69
|
+
</pi-popup-select>
|
|
70
|
+
</template>
|
|
71
|
+
|
|
72
|
+
<script>
|
|
73
|
+
import ValueSync from '../../mixin/value-sync'
|
|
74
|
+
import { getConfig } from '../../config'
|
|
75
|
+
|
|
76
|
+
const TAG = 'PiActionSheet'
|
|
77
|
+
const { actionSheet } = getConfig()
|
|
78
|
+
|
|
79
|
+
const alignFlexMap = {
|
|
80
|
+
left: 'flex-start',
|
|
81
|
+
center: 'center',
|
|
82
|
+
right: 'flex-end'
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export default {
|
|
86
|
+
name: 'PiActionSheet',
|
|
87
|
+
// 混入v-model
|
|
88
|
+
mixins: [ValueSync],
|
|
89
|
+
props: {
|
|
90
|
+
// 初始值
|
|
91
|
+
value: {
|
|
92
|
+
required: false
|
|
93
|
+
},
|
|
94
|
+
// 自定义样式
|
|
95
|
+
customStyle: {
|
|
96
|
+
type: Object,
|
|
97
|
+
// {}
|
|
98
|
+
default() {
|
|
99
|
+
return actionSheet.customStyle
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
// 自定义样式类
|
|
103
|
+
customClass: {
|
|
104
|
+
type: String,
|
|
105
|
+
// ''
|
|
106
|
+
default() {
|
|
107
|
+
return actionSheet.customClass
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
// 选项列表
|
|
111
|
+
items: {
|
|
112
|
+
type: Array,
|
|
113
|
+
// []
|
|
114
|
+
default() {
|
|
115
|
+
return actionSheet.items
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
// 选项id字段
|
|
119
|
+
keyField: {
|
|
120
|
+
type: String,
|
|
121
|
+
// 'id'
|
|
122
|
+
default: actionSheet.keyField
|
|
123
|
+
},
|
|
124
|
+
// 选项显示字段
|
|
125
|
+
displayField: {
|
|
126
|
+
type: String,
|
|
127
|
+
// 'text'
|
|
128
|
+
default: actionSheet.displayField
|
|
129
|
+
},
|
|
130
|
+
// 自定义多列联动模式的children属性名
|
|
131
|
+
childField: {
|
|
132
|
+
type: String,
|
|
133
|
+
// 'children'
|
|
134
|
+
default: actionSheet.childField
|
|
135
|
+
},
|
|
136
|
+
// 行高 单位默认rpx
|
|
137
|
+
itemHeight: {
|
|
138
|
+
type: [String, Number],
|
|
139
|
+
// 110
|
|
140
|
+
default: actionSheet.itemHeight
|
|
141
|
+
},
|
|
142
|
+
// 是否显示item下边框
|
|
143
|
+
showItemBottomBorder: {
|
|
144
|
+
type: Boolean,
|
|
145
|
+
// true
|
|
146
|
+
default: actionSheet.showItemBottomBorder
|
|
147
|
+
},
|
|
148
|
+
// 行样式
|
|
149
|
+
itemStyle: {
|
|
150
|
+
type: Object,
|
|
151
|
+
// {}
|
|
152
|
+
default() {
|
|
153
|
+
return actionSheet.itemStyle
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
itemAlign: {
|
|
157
|
+
type: String,
|
|
158
|
+
// 'center'
|
|
159
|
+
default: actionSheet.itemAlign,
|
|
160
|
+
validator: function(value) {
|
|
161
|
+
return ['left', 'center', 'right'].includes(value)
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
// 弹窗选择参数设置
|
|
165
|
+
popupSelect: {
|
|
166
|
+
type: Object,
|
|
167
|
+
default() {
|
|
168
|
+
// 参照popup
|
|
169
|
+
return actionSheet.popupSelect
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
// 弹窗参数设置
|
|
173
|
+
popup: {
|
|
174
|
+
type: Object,
|
|
175
|
+
default() {
|
|
176
|
+
// 参照popup
|
|
177
|
+
return actionSheet.popup
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
// 选项上方的描述信息,不填则不显示
|
|
181
|
+
description: {
|
|
182
|
+
type: String,
|
|
183
|
+
// ''
|
|
184
|
+
default: actionSheet.description
|
|
185
|
+
},
|
|
186
|
+
// 取消按钮文字,不填则不显示
|
|
187
|
+
cancelText: {
|
|
188
|
+
type: String,
|
|
189
|
+
// ''
|
|
190
|
+
default: actionSheet.cancelText
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
data() {
|
|
194
|
+
return {}
|
|
195
|
+
},
|
|
196
|
+
computed: {
|
|
197
|
+
getPopupSelect() {
|
|
198
|
+
return this.$pi.lang.mergeDeep(actionSheet.popupSelect, this.popupSelect)
|
|
199
|
+
},
|
|
200
|
+
getPopup() {
|
|
201
|
+
const actionSheetPopup = this.$pi.lang.mergeDeep(
|
|
202
|
+
actionSheet.popup,
|
|
203
|
+
this.popupSelect.popup
|
|
204
|
+
)
|
|
205
|
+
return this.$pi.lang.mergeDeep(actionSheetPopup, this.popup)
|
|
206
|
+
},
|
|
207
|
+
getItemAlignStyle() {
|
|
208
|
+
return {
|
|
209
|
+
justifyContent: alignFlexMap[this.itemAlign]
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
getItemStyle() {
|
|
213
|
+
const itemHeight = this.$pi.common.addUnit(this.itemHeight)
|
|
214
|
+
return {
|
|
215
|
+
height: itemHeight,
|
|
216
|
+
lineHeight: itemHeight
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
indicatorStyle() {
|
|
220
|
+
const itemHeight = uni.upx2px(this.itemHeight)
|
|
221
|
+
return `height: ${itemHeight}px;line-height: ${itemHeight}px;`
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
methods: {
|
|
225
|
+
handlePopupClose() {
|
|
226
|
+
this.val = false
|
|
227
|
+
// 弹窗关闭
|
|
228
|
+
this.$emit('close')
|
|
229
|
+
this.handleEmitChange()
|
|
230
|
+
},
|
|
231
|
+
/**
|
|
232
|
+
* @vuese
|
|
233
|
+
* 取消选择
|
|
234
|
+
*/
|
|
235
|
+
handleCancel() {
|
|
236
|
+
this.$emit('cancel')
|
|
237
|
+
this.getPopupSelect.onCancelClose && this.handlePopupClose()
|
|
238
|
+
},
|
|
239
|
+
/**
|
|
240
|
+
* @vuese
|
|
241
|
+
* 确认选择
|
|
242
|
+
*/
|
|
243
|
+
handleConfirm() {
|
|
244
|
+
this.$emit('confirm')
|
|
245
|
+
this.getPopupSelect.onConfirmClose && this.handlePopupClose()
|
|
246
|
+
},
|
|
247
|
+
/**
|
|
248
|
+
* @vuese
|
|
249
|
+
* 确认选择
|
|
250
|
+
*/
|
|
251
|
+
handleSelectItem(item) {
|
|
252
|
+
if (item.disabled) return
|
|
253
|
+
this.$emit('select', item)
|
|
254
|
+
this.getPopupSelect.onConfirmClose && this.handlePopupClose()
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
</script>
|
|
259
|
+
|
|
260
|
+
<style lang="scss" scoped></style>
|
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
<view class="badge-wrap" :style="[customStyle]" :class="[customClass]" @tap="handleClick">
|
|
3
3
|
<view
|
|
4
4
|
class="badge"
|
|
5
|
-
:class="[
|
|
5
|
+
:class="[
|
|
6
|
+
{
|
|
7
|
+
dot,
|
|
8
|
+
'abso': $slots.default || $slots.$default,
|
|
9
|
+
'hide-border': !dot && !getContent && !($slots.content || $slots.$content)
|
|
10
|
+
}
|
|
11
|
+
]"
|
|
6
12
|
:style="[badgeStyle]"
|
|
7
13
|
>
|
|
8
14
|
<slot name="content">
|
|
@@ -119,6 +125,10 @@ export default {
|
|
|
119
125
|
border: 1px solid #ffffff;
|
|
120
126
|
border-radius: 16px;
|
|
121
127
|
|
|
128
|
+
&.hide-border {
|
|
129
|
+
border: none;
|
|
130
|
+
}
|
|
131
|
+
|
|
122
132
|
&.dot {
|
|
123
133
|
min-width: 0;
|
|
124
134
|
background-color: #ee0a24;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<!-- fixed时候的占位空间 -->
|
|
19
19
|
<template v-if="fixed">
|
|
20
20
|
<view class="pi-bottom-bar-placeholder" :style="[{ height: barHeight }]" />
|
|
21
|
-
<view v-if="safeArea" class="pi-safearea" />
|
|
21
|
+
<!-- <view v-if="safeArea" class="pi-safearea" /> -->
|
|
22
22
|
</template>
|
|
23
23
|
</view>
|
|
24
24
|
</template>
|