sadais-piui 1.2.7-beta1 → 1.2.7-beta100

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 (61) hide show
  1. package/.prettierrc +8 -0
  2. package/components/pi-badge/index.vue +11 -1
  3. package/components/pi-bottom-bar/index.vue +1 -1
  4. package/components/pi-calendar/index.vue +187 -182
  5. package/components/pi-calendar-input/index.vue +43 -27
  6. package/components/pi-calendar-panel/components/calendar-days/index.vue +410 -0
  7. package/components/pi-calendar-panel/index.vue +201 -163
  8. package/components/pi-cascader/index.vue +601 -0
  9. package/components/pi-checkbox/index.vue +3 -4
  10. package/components/pi-checkbox-group/index.vue +6 -8
  11. package/components/pi-circle-progress/index.vue +108 -21
  12. package/components/pi-collapse/index.vue +124 -0
  13. package/components/pi-collapse-item/index.vue +352 -0
  14. package/components/pi-date-picker/index.vue +504 -377
  15. package/components/pi-date-picker-input/index.vue +43 -27
  16. package/components/pi-dropdown/components/dropdown-tab.vue +33 -24
  17. package/components/pi-dropdown/index.vue +58 -22
  18. package/components/pi-dropdown-item/index.vue +74 -55
  19. package/components/pi-form/index.vue +18 -2
  20. package/components/pi-form-item/index.vue +13 -5
  21. package/components/pi-grid/index.vue +1 -1
  22. package/components/pi-grid-item/index.vue +4 -4
  23. package/components/pi-img/index.vue +0 -1
  24. package/components/pi-img-cropper/index.vue +110 -110
  25. package/components/pi-input/index.vue +69 -22
  26. package/components/pi-list-item/index.vue +1 -1
  27. package/components/pi-popup/index.vue +4 -1
  28. package/components/pi-popup-select/index.vue +8 -1
  29. package/components/pi-radio/index.vue +6 -9
  30. package/components/pi-radio-group/index.vue +22 -4
  31. package/components/pi-regions-select/index.vue +6 -1
  32. package/components/pi-regions-select-input/index.vue +54 -30
  33. package/components/pi-search/index.vue +29 -2
  34. package/components/pi-section/index.vue +1 -1
  35. package/components/pi-select/index.vue +237 -22
  36. package/components/pi-select-input/index.vue +91 -40
  37. package/components/pi-stepper/index.vue +135 -121
  38. package/components/pi-steps/index.vue +115 -36
  39. package/components/pi-table/index.vue +351 -0
  40. package/components/pi-tabs/index.vue +50 -13
  41. package/components/pi-tag/index.vue +488 -0
  42. package/components/pi-upload-img/index.vue +401 -33
  43. package/components/pi-webview/index.vue +92 -82
  44. package/config/actionSheet.js +0 -1
  45. package/config/calendarPanel.js +4 -1
  46. package/config/cascader.js +22 -0
  47. package/config/circleProgress.js +17 -10
  48. package/config/collapse.js +7 -0
  49. package/config/collapseItem.js +11 -0
  50. package/config/datePicker.js +29 -23
  51. package/config/dropdown.js +4 -1
  52. package/config/input.js +2 -1
  53. package/config/select.js +13 -1
  54. package/config/steps.js +1 -1
  55. package/config/table.js +9 -0
  56. package/config/tag.js +21 -0
  57. package/config/uploadImg.js +23 -10
  58. package/package.json +5 -2
  59. package/scss/common.scss +11 -13
  60. package/scss/icon/icon.scss +2 -1
  61. package/scss/mixin.scss +1 -1
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
+ }
@@ -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>
@@ -1,182 +1,187 @@
1
- <template>
2
- <pi-popup
3
- ref="popup"
4
- :value="val"
5
- :custom-class="getPopup.customClass"
6
- :custom-style="getPopup.customStyle"
7
- :position="getPopup.position"
8
- :border-radius="getPopup.borderRadius"
9
- :show-close-icon="showTitle && getPopup.showCloseIcon"
10
- :close-icon="getPopup.closeIcon"
11
- :safe-area-inset-bottom="getPopup.safeAreaInsetBottom"
12
- :mask="getPopup.mask"
13
- :hide-tab-bar="getPopup.hideTabBar"
14
- :append-to-body="getPopup.appendToBody"
15
- :z-index="getPopup.zIndex"
16
- :background="getPopup.background"
17
- @close="handlePopupClose"
18
- >
19
- <view class="pi-calendar" :style="[customStyle]" :class="[customClass]">
20
- <!-- 标题栏 -->
21
- <view class="pi-justify-center pi-fz-32 pi-fw-500" :style="[{ padding: getTitlePadding }]">
22
- <slot v-if="$slots.title" name="title" />
23
- <template v-else>{{ title }}</template>
24
- </view>
25
- <pi-calendar-panel
26
- v-model="calendarValue"
27
- :type="getCalendarPanel.type"
28
- :min-year="getCalendarPanel.minYear"
29
- :max-year="getCalendarPanel.maxYear"
30
- :min-date="getCalendarPanel.minDate"
31
- :max-date="getCalendarPanel.maxDate"
32
- :show-back-today="getCalendarPanel.showBackToday"
33
- :today-active-border-color="getCalendarPanel.todayActiveBorderColor"
34
- :active-color="getCalendarPanel.activeColor"
35
- :active-bg="getCalendarPanel.activeBg"
36
- :active-border-radius="getCalendarPanel.activeBorderRadius"
37
- :range-color="getCalendarPanel.rangeColor"
38
- :range-bg="getCalendarPanel.rangeBg"
39
- :start-text="getCalendarPanel.startText"
40
- :end-text="getCalendarPanel.endText"
41
- :date-format="getCalendarPanel.dateFormat"
42
- />
43
- <!-- footer -->
44
- <view class="pi-w-100P pi-align-center pi-pd-24 pi-solid-top-1">
45
- <view class="pi-flex-sub pi-fz-30 pi-fw-500">{{ getDisplayValue }}</view>
46
- <pi-button type="primary" size="medium" @click="handleConfirm">确定</pi-button>
47
- </view>
48
- </view>
49
- </pi-popup>
50
- </template>
51
-
52
- <script>
53
- import ValueSync from '../../mixin/value-sync'
54
- import { getConfig } from '../../config'
55
-
56
- const TAG = 'PiCalendar'
57
- const { calendar } = getConfig()
58
-
59
- export default {
60
- name: 'PiCalendar',
61
- // 混入v-model
62
- mixins: [ValueSync],
63
- props: {
64
- // 初始值
65
- value: {
66
- required: false
67
- },
68
- // 自定义样式,对象形式
69
- customStyle: {
70
- type: Object,
71
- // {}
72
- default() {
73
- return calendar.customStyle
74
- }
75
- },
76
- // 自定义样式类,字符串形式
77
- customClass: {
78
- type: String,
79
- // ''
80
- default() {
81
- return calendar.customClass
82
- }
83
- },
84
- // 是否显示title
85
- showTitle: {
86
- type: Boolean,
87
- // true
88
- default: calendar.showTitle
89
- },
90
- // 标题
91
- title: {
92
- type: String,
93
- // '日期选择'
94
- default: calendar.title
95
- },
96
- // 标题 padding
97
- titlePadding: {
98
- type: [String, Number],
99
- // 24
100
- default: calendar.titlePadding
101
- },
102
- // 日历面板参数设置
103
- calendarPanel: {
104
- type: Object,
105
- default() {
106
- // 参照calendarPanel
107
- return calendar.calendarPanel
108
- }
109
- },
110
- // 弹窗参数设置
111
- popup: {
112
- type: Object,
113
- default() {
114
- // 参照popup
115
- return calendar.popup
116
- }
117
- }
118
- },
119
- data() {
120
- const mergeCalendarPanel = this.$pi.lang.mergeDeep(calendar.calendarPanel, this.calendarPanel)
121
- return {
122
- calendarValue: mergeCalendarPanel.value
123
- }
124
- },
125
- computed: {
126
- getCalendarPanel() {
127
- return this.$pi.lang.mergeDeep(calendar.calendarPanel, this.calendarPanel)
128
- },
129
- getPopup() {
130
- return this.$pi.lang.mergeDeep(calendar.popup, this.popup)
131
- },
132
- getTitlePadding() {
133
- return this.$pi.common.addUnit(this.titlePadding)
134
- },
135
- getDisplayValue() {
136
- return [].concat(this.calendarValue).join(' - ')
137
- }
138
- },
139
- watch: {
140
- 'getCalendarPanel.value'(val) {
141
- this.calendarValue = val
142
- }
143
- },
144
- methods: {
145
- handlePopupClose() {
146
- this.val = false
147
- // 关闭
148
- this.$emit('close')
149
- this.handleEmitChange()
150
- },
151
- /**
152
- * @vuese
153
- * 确认选择
154
- */
155
- handleConfirm() {
156
- this.$emit('confirm', this.calendarValue)
157
- this.handlePopupClose()
158
- }
159
- }
160
- }
161
- </script>
162
-
163
- <style lang="scss" scoped>
164
- .pi-calendar {
165
- max-width: 960rpx;
166
- margin: 0 auto;
167
- }
168
- .date-item {
169
- position: relative;
170
- z-index: 2;
171
- width: calc(100% / 7);
172
- overflow: hidden;
173
- }
174
- .back-today {
175
- padding: 12rpx 24rpx;
176
- overflow: hidden;
177
- font-size: 20rpx;
178
- color: #ffffff;
179
- background: $pi-primary-color;
180
- border-radius: 50rpx 0 0 50rpx;
181
- }
182
- </style>
1
+ <template>
2
+ <pi-popup
3
+ ref="popup"
4
+ :value="val"
5
+ :custom-class="getPopup.customClass"
6
+ :custom-style="getPopup.customStyle"
7
+ :position="getPopup.position"
8
+ :border-radius="getPopup.borderRadius"
9
+ :show-close-icon="showTitle && getPopup.showCloseIcon"
10
+ :close-icon="getPopup.closeIcon"
11
+ :safe-area-inset-bottom="getPopup.safeAreaInsetBottom"
12
+ :mask="getPopup.mask"
13
+ :hide-tab-bar="getPopup.hideTabBar"
14
+ :append-to-body="getPopup.appendToBody"
15
+ :z-index="getPopup.zIndex"
16
+ :background="getPopup.background"
17
+ @close="handlePopupClose"
18
+ @closed="$emit('closed', $event)"
19
+ @show="$emit('show', $event)"
20
+ @showed="$emit('showed', $event)"
21
+ >
22
+ <view class="pi-calendar" :style="[customStyle]" :class="[customClass]">
23
+ <!-- 标题栏 -->
24
+ <view class="pi-justify-center pi-fz-32 pi-fw-500" :style="[{ padding: getTitlePadding }]">
25
+ <slot v-if="$slots.title" name="title" />
26
+ <template v-else>{{ title }}</template>
27
+ </view>
28
+ <pi-calendar-panel
29
+ v-model="calendarValue"
30
+ :type="getCalendarPanel.type"
31
+ :min-year="getCalendarPanel.minYear"
32
+ :max-year="getCalendarPanel.maxYear"
33
+ :min-date="getCalendarPanel.minDate"
34
+ :max-date="getCalendarPanel.maxDate"
35
+ :show-back-today="getCalendarPanel.showBackToday"
36
+ :today-active-border-color="getCalendarPanel.todayActiveBorderColor"
37
+ :active-color="getCalendarPanel.activeColor"
38
+ :active-bg="getCalendarPanel.activeBg"
39
+ :active-border-radius="getCalendarPanel.activeBorderRadius"
40
+ :range-color="getCalendarPanel.rangeColor"
41
+ :range-bg="getCalendarPanel.rangeBg"
42
+ :start-text="getCalendarPanel.startText"
43
+ :end-text="getCalendarPanel.endText"
44
+ :marks="getCalendarPanel.marks"
45
+ :date-format="getCalendarPanel.dateFormat"
46
+ @date-change="$emit('date-change', $event)"
47
+ />
48
+ <!-- footer -->
49
+ <view class="pi-w-100P pi-align-center pi-pd-24 pi-solid-top-1">
50
+ <view class="pi-flex-sub pi-fz-30 pi-fw-500">{{ getDisplayValue }}</view>
51
+ <pi-button type="primary" size="medium" @click="handleConfirm">确定</pi-button>
52
+ </view>
53
+ </view>
54
+ </pi-popup>
55
+ </template>
56
+
57
+ <script>
58
+ import ValueSync from '../../mixin/value-sync'
59
+ import { getConfig } from '../../config'
60
+
61
+ const TAG = 'PiCalendar'
62
+ const { calendar } = getConfig()
63
+
64
+ export default {
65
+ name: 'PiCalendar',
66
+ // 混入v-model
67
+ mixins: [ValueSync],
68
+ props: {
69
+ // 初始值
70
+ value: {
71
+ required: false
72
+ },
73
+ // 自定义样式,对象形式
74
+ customStyle: {
75
+ type: Object,
76
+ // {}
77
+ default() {
78
+ return calendar.customStyle
79
+ }
80
+ },
81
+ // 自定义样式类,字符串形式
82
+ customClass: {
83
+ type: String,
84
+ // ''
85
+ default() {
86
+ return calendar.customClass
87
+ }
88
+ },
89
+ // 是否显示title
90
+ showTitle: {
91
+ type: Boolean,
92
+ // true
93
+ default: calendar.showTitle
94
+ },
95
+ // 标题
96
+ title: {
97
+ type: String,
98
+ // '日期选择'
99
+ default: calendar.title
100
+ },
101
+ // 标题 padding
102
+ titlePadding: {
103
+ type: [String, Number],
104
+ // 24
105
+ default: calendar.titlePadding
106
+ },
107
+ // 日历面板参数设置
108
+ calendarPanel: {
109
+ type: Object,
110
+ default() {
111
+ // 参照calendarPanel
112
+ return calendar.calendarPanel
113
+ }
114
+ },
115
+ // 弹窗参数设置
116
+ popup: {
117
+ type: Object,
118
+ default() {
119
+ // 参照popup
120
+ return calendar.popup
121
+ }
122
+ }
123
+ },
124
+ data() {
125
+ const mergeCalendarPanel = this.$pi.lang.mergeDeep(calendar.calendarPanel, this.calendarPanel)
126
+ return {
127
+ calendarValue: mergeCalendarPanel.value
128
+ }
129
+ },
130
+ computed: {
131
+ getCalendarPanel() {
132
+ return this.$pi.lang.mergeDeep(calendar.calendarPanel, this.calendarPanel)
133
+ },
134
+ getPopup() {
135
+ return this.$pi.lang.mergeDeep(calendar.popup, this.popup)
136
+ },
137
+ getTitlePadding() {
138
+ return this.$pi.common.addUnit(this.titlePadding)
139
+ },
140
+ getDisplayValue() {
141
+ return [].concat(this.calendarValue).join(' - ')
142
+ }
143
+ },
144
+ watch: {
145
+ 'getCalendarPanel.value'(val) {
146
+ this.calendarValue = val
147
+ }
148
+ },
149
+ methods: {
150
+ handlePopupClose() {
151
+ this.val = false
152
+ // 关闭
153
+ this.$emit('close')
154
+ this.handleEmitChange()
155
+ },
156
+ /**
157
+ * @vuese
158
+ * 确认选择
159
+ */
160
+ handleConfirm() {
161
+ this.$emit('confirm', this.calendarValue)
162
+ this.handlePopupClose()
163
+ }
164
+ }
165
+ }
166
+ </script>
167
+
168
+ <style lang="scss" scoped>
169
+ .pi-calendar {
170
+ max-width: 960rpx;
171
+ margin: 0 auto;
172
+ }
173
+ .date-item {
174
+ position: relative;
175
+ z-index: 2;
176
+ width: calc(100% / 7);
177
+ overflow: hidden;
178
+ }
179
+ .back-today {
180
+ padding: 12rpx 24rpx;
181
+ overflow: hidden;
182
+ font-size: 20rpx;
183
+ color: #ffffff;
184
+ background: $pi-primary-color;
185
+ border-radius: 50rpx 0 0 50rpx;
186
+ }
187
+ </style>
@@ -1,10 +1,10 @@
1
1
  <!--
2
2
  * @Author: zhangzhenfei
3
3
  * @Date: 2022-05-18 11:08:49
4
- * @LastEditTime: 2022-05-21 15:00:48
4
+ * @LastEditTime: 2023-09-02 11:40:12
5
5
  * @LastEditors: zhangzhenfei
6
6
  * @Description: 日历输入
7
- * @FilePath: /hfmp-checkin-front/Users/feilin/workspace/piui/piui-awesome/src/piui/components/pi-calendar-input/index.vue
7
+ * @FilePath: \piui-awesome\src\piui\components\pi-calendar-input\index.vue
8
8
  -->
9
9
 
10
10
  <template>
@@ -17,32 +17,33 @@
17
17
  v-else
18
18
  type="text"
19
19
  :value="getInputValue"
20
- :custom-class="input.customClass"
21
- :custom-style="input.customStyle"
22
- :placeholder="input.placeholder"
23
- :placeholder-style="input.placeholderStyle"
24
- :placeholder-class="input.placeholderClass"
25
- :disabled="input.disabled"
26
- :border="input.border"
27
- :maxlength="input.maxlength"
28
- :password="input.password"
29
- :cursor-spacing="input.cursorSpacing"
30
- :focus="input.focus"
31
- :confirm-type="input.confirmType"
32
- :confirm-hold="input.confirmHold"
33
- :cursor="input.cursor"
34
- :selection-start="input.selectionStart"
35
- :selection-end="input.selectionEnd"
36
- :adjust-position="input.adjustPosition"
37
- :hold-keyboard="input.holdKeyboard"
38
- :auto-blur="input.autoBlur"
39
- :show-confirmbar="input.showConfirmbar"
40
- :auto-height="input.autoHeight"
41
- :fixed="input.fixed"
42
- :disable-default-padding="input.disableDefaultPadding"
43
- :clearable="input.clearable"
44
- :clear-icon="input.clearIcon"
20
+ :custom-class="getInput.customClass"
21
+ :custom-style="getInput.customStyle"
22
+ :placeholder="getInput.placeholder"
23
+ :placeholder-style="getInput.placeholderStyle"
24
+ :placeholder-class="getInput.placeholderClass"
25
+ :disabled="getInput.disabled"
26
+ :border="getInput.border"
27
+ :maxlength="getInput.maxlength"
28
+ :password="getInput.password"
29
+ :cursor-spacing="getInput.cursorSpacing"
30
+ :focus="getInput.focus"
31
+ :confirm-type="getInput.confirmType"
32
+ :confirm-hold="getInput.confirmHold"
33
+ :cursor="getInput.cursor"
34
+ :selection-start="getInput.selectionStart"
35
+ :selection-end="getInput.selectionEnd"
36
+ :adjust-position="getInput.adjustPosition"
37
+ :hold-keyboard="getInput.holdKeyboard"
38
+ :auto-blur="getInput.autoBlur"
39
+ :show-confirmbar="getInput.showConfirmbar"
40
+ :auto-height="getInput.autoHeight"
41
+ :fixed="getInput.fixed"
42
+ :disable-default-padding="getInput.disableDefaultPadding"
43
+ :clearable="getInput.clearable"
44
+ :clear-icon="getInput.clearIcon"
45
45
  @click="show = true"
46
+ @clear="handleClearValue"
46
47
  />
47
48
 
48
49
  <!-- 日历弹出框 -->
@@ -61,6 +62,10 @@
61
62
  }"
62
63
  :popup="getCalendar.popup"
63
64
  @confirm="handleCalendarConfirm"
65
+ @close="$emit('close', $event)"
66
+ @closed="$emit('closed', $event)"
67
+ @show="$emit('show', $event)"
68
+ @showed="$emit('showed', $event)"
64
69
  />
65
70
  </view>
66
71
  </template>
@@ -144,6 +149,9 @@ export default {
144
149
  }
145
150
  },
146
151
  computed: {
152
+ getInput() {
153
+ return this.$pi.lang.mergeDeep(calendarInput.input, this.input)
154
+ },
147
155
  getCalendar() {
148
156
  return this.$pi.lang.mergeDeep(calendarInput.calendar, this.calendar)
149
157
  },
@@ -187,6 +195,14 @@ export default {
187
195
  handleCalendarConfirm(value) {
188
196
  this.val = value
189
197
  this.handleEmitChange()
198
+ },
199
+ handleClearValue() {
200
+ if (this.calendar.calendarPanel.type === 'date') {
201
+ this.handleCalendarConfirm('')
202
+ }
203
+ if (this.calendar.calendarPanel.type === 'range') {
204
+ this.handleCalendarConfirm([])
205
+ }
190
206
  }
191
207
  }
192
208
  }