sadais-piui 1.2.7-beta15 → 1.2.7-beta151

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