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
@@ -0,0 +1,267 @@
1
+ <template>
2
+ <view
3
+ :style="[customStyle]"
4
+ class="pi-marquee-pure-css"
5
+ :class="[customClass, directionClass]"
6
+ >
7
+ <view
8
+ class="marquee-content"
9
+ :class="animationClass"
10
+ :style="animationStyle"
11
+ >
12
+ <!-- 第一组内容 -->
13
+ <view class="marquee-group">
14
+ <view
15
+ v-for="(item, index) in items"
16
+ :key="`first-${index}`"
17
+ class="marquee-item"
18
+ >
19
+ <slot name="item" :item="item" :index="index">
20
+ <text>{{ item }}</text>
21
+ </slot>
22
+ </view>
23
+ </view>
24
+
25
+ <!-- 第二组内容(用于无缝循环) -->
26
+ <view class="marquee-group">
27
+ <view
28
+ v-for="(item, index) in items"
29
+ :key="`second-${index}`"
30
+ class="marquee-item"
31
+ >
32
+ <slot name="item" :item="item" :index="index">
33
+ <text>{{ item }}</text>
34
+ </slot>
35
+ </view>
36
+ </view>
37
+ </view>
38
+ </view>
39
+ </template>
40
+
41
+ <script>
42
+ import { getConfig } from '../../config'
43
+
44
+ const TAG = 'PiMarqueePureCss'
45
+ const { marqueePureCss } = getConfig()
46
+
47
+ export default {
48
+ name: 'PiMarqueePureCss',
49
+ props: {
50
+ // 自定义样式
51
+ customStyle: {
52
+ type: Object,
53
+ default() {
54
+ return marqueePureCss.customStyle || {}
55
+ }
56
+ },
57
+ // 自定义样式类
58
+ customClass: {
59
+ type: String,
60
+ default() {
61
+ return marqueePureCss.customClass || ''
62
+ }
63
+ },
64
+ // 滚动方向: 'left', 'right', 'up', 'down'
65
+ direction: {
66
+ type: String,
67
+ default: marqueePureCss.direction,
68
+ validator: value => ['left', 'right', 'up', 'down'].includes(value)
69
+ },
70
+ // 动画持续时间(秒)
71
+ duration: {
72
+ type: [Number, String],
73
+ default: marqueePureCss.duration
74
+ },
75
+ // 动画速度曲线
76
+ timingFunction: {
77
+ type: String,
78
+ default: marqueePureCss.timingFunction
79
+ },
80
+ // 是否暂停动画
81
+ paused: {
82
+ type: Boolean,
83
+ default: marqueePureCss.paused
84
+ },
85
+ // 轮播数据
86
+ items: {
87
+ type: Array,
88
+ default: () => marqueePureCss.items
89
+ },
90
+ // 每个item之间的间距(单位:rpx)
91
+ itemGap: {
92
+ type: [Number, String],
93
+ default: marqueePureCss.itemGap
94
+ }
95
+ },
96
+ computed: {
97
+ directionClass() {
98
+ return `direction-${this.direction}`
99
+ },
100
+ animationClass() {
101
+ return `marquee-${this.direction}`
102
+ },
103
+ animationStyle() {
104
+ const style = {
105
+ animationDuration: `${this.duration}s`,
106
+ animationTimingFunction: this.timingFunction,
107
+ animationPlayState: this.paused ? 'paused' : 'running'
108
+ }
109
+
110
+ // 如果有间距,添加gap样式
111
+ if (this.itemGap && this.itemGap > 0) {
112
+ if (['left', 'right'].includes(this.direction)) {
113
+ style.gap = `${this.itemGap}rpx`
114
+ } else {
115
+ style.rowGap = `${this.itemGap}rpx`
116
+ }
117
+ }
118
+
119
+ return style
120
+ }
121
+ },
122
+ methods: {
123
+ /**
124
+ * 暂停动画
125
+ */
126
+ pause() {
127
+ this.$emit('update:paused', true)
128
+ },
129
+
130
+ /**
131
+ * 恢复动画
132
+ */
133
+ resume() {
134
+ this.$emit('update:paused', false)
135
+ }
136
+ }
137
+ }
138
+ </script>
139
+
140
+ <style lang="scss" scoped>
141
+ .pi-marquee-pure-css {
142
+ overflow: hidden;
143
+ position: relative;
144
+
145
+ &.direction-left,
146
+ &.direction-right {
147
+ width: 100%;
148
+ white-space: nowrap;
149
+ }
150
+
151
+ &.direction-up,
152
+ &.direction-down {
153
+ height: 100%;
154
+ }
155
+ }
156
+
157
+ .marquee-content {
158
+ display: flex;
159
+
160
+ .direction-left &,
161
+ .direction-right & {
162
+ flex-direction: row;
163
+ width: fit-content;
164
+ }
165
+
166
+ .direction-up &,
167
+ .direction-down & {
168
+ flex-direction: column;
169
+ height: fit-content;
170
+ }
171
+ }
172
+
173
+ .marquee-group {
174
+ display: flex;
175
+ flex-shrink: 0;
176
+
177
+ .direction-left &,
178
+ .direction-right & {
179
+ flex-direction: row;
180
+ }
181
+
182
+ .direction-up &,
183
+ .direction-down & {
184
+ flex-direction: column;
185
+ }
186
+ }
187
+
188
+ .marquee-item {
189
+ flex-shrink: 0;
190
+ display: flex;
191
+ align-items: center;
192
+
193
+ .direction-left &,
194
+ .direction-right & {
195
+ display: inline-flex;
196
+ white-space: nowrap;
197
+ }
198
+
199
+ .direction-up &,
200
+ .direction-down & {
201
+ width: 100%;
202
+ }
203
+ }
204
+
205
+ /* 左滚动动画 */
206
+ .marquee-left {
207
+ animation: marquee-scroll-left infinite;
208
+ }
209
+
210
+ @keyframes marquee-scroll-left {
211
+ 0% {
212
+ transform: translateX(0);
213
+ }
214
+ 100% {
215
+ transform: translateX(-50%);
216
+ }
217
+ }
218
+
219
+ /* 右滚动动画 */
220
+ .marquee-right {
221
+ animation: marquee-scroll-right infinite;
222
+ }
223
+
224
+ @keyframes marquee-scroll-right {
225
+ 0% {
226
+ transform: translateX(-50%);
227
+ }
228
+ 100% {
229
+ transform: translateX(0);
230
+ }
231
+ }
232
+
233
+ /* 上滚动动画 */
234
+ .marquee-up {
235
+ animation: marquee-scroll-up infinite;
236
+ }
237
+
238
+ @keyframes marquee-scroll-up {
239
+ 0% {
240
+ transform: translateY(0);
241
+ }
242
+ 100% {
243
+ transform: translateY(-50%);
244
+ }
245
+ }
246
+
247
+ /* 下滚动动画 */
248
+ .marquee-down {
249
+ animation: marquee-scroll-down infinite;
250
+ }
251
+
252
+ @keyframes marquee-scroll-down {
253
+ 0% {
254
+ transform: translateY(-50%);
255
+ }
256
+ 100% {
257
+ transform: translateY(0);
258
+ }
259
+ }
260
+
261
+ /* 响应式处理 */
262
+ @media screen and (max-width: 750px) {
263
+ .marquee-item {
264
+ font-size: 28rpx;
265
+ }
266
+ }
267
+ </style>
@@ -20,7 +20,9 @@
20
20
  @tap.stop.prevent="handleCloseMask"
21
21
  >
22
22
  <!-- 遮罩层内区域插槽 -->
23
- <view @tap.stop.prevent="() => {}"><slot /></view>
23
+ <view class="pi-w-100P pi-h-100P">
24
+ <slot />
25
+ </view>
24
26
  </view>
25
27
  </template>
26
28