oxy-uni-ui 1.2.3 → 2.0.0

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 (235) hide show
  1. package/attributes.json +1 -1
  2. package/components/common/abstracts/variable.scss +353 -328
  3. package/components/common/util.ts +185 -32
  4. package/components/composables/index.ts +1 -0
  5. package/components/composables/usePopover.ts +24 -20
  6. package/components/composables/useVirtualScroll.ts +10 -9
  7. package/components/composables/useWindowResize.ts +35 -0
  8. package/components/oxy-action-sheet/index.scss +24 -11
  9. package/components/oxy-action-sheet/oxy-action-sheet.vue +27 -19
  10. package/components/oxy-action-sheet/types.ts +7 -0
  11. package/components/oxy-backtop/index.scss +3 -3
  12. package/components/oxy-backtop/oxy-backtop.vue +9 -6
  13. package/components/oxy-backtop/types.ts +7 -7
  14. package/components/oxy-badge/index.scss +4 -4
  15. package/components/oxy-badge/oxy-badge.vue +3 -3
  16. package/components/oxy-badge/types.ts +2 -2
  17. package/components/oxy-button/index.scss +5 -5
  18. package/components/oxy-button/oxy-button.vue +5 -1
  19. package/components/oxy-calendar/index.scss +11 -11
  20. package/components/oxy-calendar/oxy-calendar.vue +1 -0
  21. package/components/oxy-calendar/types.ts +5 -0
  22. package/components/oxy-calendar-view/month/index.scss +4 -4
  23. package/components/oxy-calendar-view/month/types.ts +36 -0
  24. package/components/oxy-calendar-view/monthPanel/index.scss +7 -7
  25. package/components/oxy-calendar-view/monthPanel/month-panel.vue +14 -8
  26. package/components/oxy-calendar-view/year/index.scss +4 -4
  27. package/components/oxy-calendar-view/yearPanel/index.scss +4 -4
  28. package/components/oxy-calendar-view/yearPanel/year-panel.vue +21 -5
  29. package/components/oxy-card/index.scss +2 -2
  30. package/components/oxy-cell/index.scss +8 -8
  31. package/components/oxy-checkbox/index.scss +7 -7
  32. package/components/oxy-checkbox-group/index.scss +2 -2
  33. package/components/oxy-circle/oxy-circle.vue +10 -7
  34. package/components/oxy-circle/types.ts +5 -5
  35. package/components/oxy-col/oxy-col.vue +2 -2
  36. package/components/oxy-col-picker/index.scss +4 -4
  37. package/components/oxy-col-picker/oxy-col-picker.vue +6 -5
  38. package/components/oxy-col-picker/types.ts +7 -2
  39. package/components/oxy-collapse/index.scss +2 -2
  40. package/components/oxy-collapse-item/oxy-collapse-item.vue +3 -3
  41. package/components/oxy-corner/index.scss +32 -32
  42. package/components/oxy-count-to/oxy-count-to.vue +3 -3
  43. package/components/oxy-curtain/index.scss +15 -15
  44. package/components/oxy-curtain/oxy-curtain.vue +4 -2
  45. package/components/oxy-curtain/types.ts +6 -1
  46. package/components/oxy-date-strip/oxy-date-strip.vue +2 -2
  47. package/components/oxy-date-strip/types.ts +1 -1
  48. package/components/oxy-date-strip-item/index.scss +3 -3
  49. package/components/oxy-datetime-picker/index.scss +11 -11
  50. package/components/oxy-datetime-picker/oxy-datetime-picker.vue +1 -0
  51. package/components/oxy-datetime-picker/types.ts +5 -0
  52. package/components/oxy-drop-menu/index.scss +3 -3
  53. package/components/oxy-drop-menu/oxy-drop-menu.vue +3 -3
  54. package/components/oxy-drop-menu-item/index.scss +1 -1
  55. package/components/oxy-drop-menu-item/oxy-drop-menu-item.vue +4 -3
  56. package/components/oxy-drop-menu-item/types.ts +5 -0
  57. package/components/oxy-echarts/types.ts +6 -0
  58. package/components/oxy-fab/index.scss +8 -8
  59. package/components/oxy-fab/oxy-fab.vue +22 -3
  60. package/components/oxy-file-list/index.scss +24 -23
  61. package/components/oxy-file-list/oxy-file-list.vue +2 -2
  62. package/components/oxy-floating-panel/oxy-floating-panel.vue +13 -9
  63. package/components/oxy-floating-panel/{type.ts → types.ts} +8 -8
  64. package/components/oxy-footer/index.scss +19 -0
  65. package/components/oxy-footer/oxy-footer.vue +78 -0
  66. package/components/oxy-footer/types.ts +17 -0
  67. package/components/oxy-form-item/types.ts +22 -1
  68. package/components/oxy-gap/oxy-gap.vue +2 -2
  69. package/components/oxy-gap/types.ts +2 -2
  70. package/components/oxy-grid/oxy-grid.vue +1 -1
  71. package/components/oxy-grid/types.ts +1 -1
  72. package/components/oxy-grid-item/index.scss +1 -1
  73. package/components/oxy-grid-item/oxy-grid-item.vue +7 -5
  74. package/components/oxy-grid-item/types.ts +1 -1
  75. package/components/oxy-guidance/index.scss +75 -0
  76. package/components/oxy-guidance/oxy-guidance.vue +201 -0
  77. package/components/oxy-guidance/types.ts +33 -0
  78. package/components/oxy-icon/oxy-icon.vue +2 -2
  79. package/components/oxy-icon/types.ts +1 -1
  80. package/components/oxy-img/oxy-img.vue +4 -4
  81. package/components/oxy-img/types.ts +3 -3
  82. package/components/oxy-img-cropper/index.scss +12 -12
  83. package/components/oxy-img-cropper/oxy-img-cropper.vue +97 -52
  84. package/components/oxy-img-cropper/types.ts +2 -2
  85. package/components/oxy-img-lazy/oxy-img-lazy.vue +3 -3
  86. package/components/oxy-img-lazy/types.ts +3 -3
  87. package/components/oxy-index-anchor/index.scss +2 -2
  88. package/components/oxy-index-anchor/oxy-index-anchor.vue +2 -2
  89. package/components/oxy-index-anchor/{type.ts → types.ts} +3 -0
  90. package/components/oxy-index-bar/index.scss +3 -3
  91. package/components/oxy-index-bar/oxy-index-bar.vue +3 -3
  92. package/components/oxy-index-bar/{type.ts → types.ts} +2 -2
  93. package/components/oxy-input/index.scss +1 -1
  94. package/components/oxy-input-number/index.scss +5 -5
  95. package/components/oxy-input-number/oxy-input-number.vue +2 -2
  96. package/components/oxy-input-number/types.ts +3 -2
  97. package/components/oxy-keyboard/index.scss +5 -5
  98. package/components/oxy-keyboard/key/index.scss +3 -3
  99. package/components/oxy-keyboard/key/index.vue +2 -2
  100. package/components/oxy-keyboard/key/types.ts +15 -0
  101. package/components/oxy-keyboard/oxy-keyboard.vue +1 -0
  102. package/components/oxy-keyboard/types.ts +5 -0
  103. package/components/oxy-link/index.scss +2 -2
  104. package/components/oxy-list/oxy-list.vue +4 -3
  105. package/components/oxy-loading/oxy-loading.vue +8 -4
  106. package/components/oxy-loading/types.ts +1 -1
  107. package/components/oxy-loadmore/index.scss +3 -3
  108. package/components/oxy-long-press-menu/index.scss +93 -0
  109. package/components/oxy-long-press-menu/oxy-long-press-menu.vue +338 -0
  110. package/components/oxy-long-press-menu/types.ts +34 -0
  111. package/components/oxy-message-box/index.scss +12 -11
  112. package/components/oxy-message-box/oxy-message-box.vue +11 -3
  113. package/components/oxy-message-box/types.ts +14 -0
  114. package/components/oxy-navbar/index.scss +2 -2
  115. package/components/oxy-navbar/oxy-navbar.vue +58 -13
  116. package/components/oxy-navbar/types.ts +8 -1
  117. package/components/oxy-navbar-capsule/types.ts +3 -0
  118. package/components/oxy-notice-bar/index.scss +3 -3
  119. package/components/oxy-notice-bar/oxy-notice-bar.vue +9 -5
  120. package/components/oxy-notice-bar/types.ts +3 -3
  121. package/components/oxy-notify/index.ts +1 -0
  122. package/components/oxy-notify/oxy-notify.vue +3 -2
  123. package/components/oxy-notify/types.ts +7 -0
  124. package/components/oxy-pagination/index.scss +1 -1
  125. package/components/oxy-password-input/oxy-password-input.vue +2 -2
  126. package/components/oxy-password-input/types.ts +1 -1
  127. package/components/oxy-picker/index.scss +45 -2
  128. package/components/oxy-picker/oxy-picker.vue +100 -14
  129. package/components/oxy-picker/types.ts +29 -1
  130. package/components/oxy-picker-view/index.scss +3 -3
  131. package/components/oxy-picker-view/oxy-picker-view.vue +4 -4
  132. package/components/oxy-popover/index.scss +9 -9
  133. package/components/oxy-popup/index.scss +2 -2
  134. package/components/oxy-popup/oxy-popup.vue +35 -2
  135. package/components/oxy-popup/types.ts +8 -1
  136. package/components/oxy-progress/index.scss +3 -3
  137. package/components/oxy-qrcode/draw.ts +398 -0
  138. package/components/oxy-qrcode/index.scss +2 -0
  139. package/components/oxy-qrcode/oxy-qrcode.vue +124 -0
  140. package/components/oxy-qrcode/qrcode.ts +936 -0
  141. package/components/oxy-qrcode/types.ts +42 -0
  142. package/components/oxy-radio/index.scss +10 -10
  143. package/components/oxy-radio-group/index.scss +2 -2
  144. package/components/oxy-rate/types.ts +4 -4
  145. package/components/oxy-resize/index.scss +2 -2
  146. package/components/oxy-resize/oxy-resize.vue +4 -4
  147. package/components/oxy-resize/types.ts +3 -0
  148. package/components/oxy-rich-text/index.scss +30 -29
  149. package/components/oxy-rich-text/mp-html/mp-html.vue +33 -24
  150. package/components/oxy-rich-text/mp-html/node/node.vue +30 -19
  151. package/components/oxy-rich-text/oxy-rich-text.vue +31 -31
  152. package/components/oxy-rich-text/types.ts +6 -1
  153. package/components/oxy-row/oxy-row.vue +3 -3
  154. package/components/oxy-row/types.ts +1 -1
  155. package/components/oxy-search/index.scss +3 -3
  156. package/components/oxy-segmented/index.scss +16 -16
  157. package/components/oxy-segmented/oxy-segmented.vue +23 -3
  158. package/components/oxy-select/index.scss +144 -68
  159. package/components/oxy-select/oxy-select.vue +85 -50
  160. package/components/oxy-select/types.ts +13 -1
  161. package/components/oxy-select-picker/index.scss +7 -7
  162. package/components/oxy-select-picker/oxy-select-picker.vue +1 -0
  163. package/components/oxy-select-picker/types.ts +2 -0
  164. package/components/oxy-sidebar-item/index.scss +1 -1
  165. package/components/oxy-signature/oxy-signature.vue +18 -10
  166. package/components/oxy-signature/types.ts +106 -13
  167. package/components/oxy-skeleton/oxy-skeleton.vue +6 -6
  168. package/components/oxy-skeleton/types.ts +1 -1
  169. package/components/oxy-slider/index.scss +3 -3
  170. package/components/oxy-sort-button/index.scss +8 -8
  171. package/components/oxy-status-tip/index.scss +4 -4
  172. package/components/oxy-status-tip/oxy-status-tip.vue +5 -5
  173. package/components/oxy-status-tip/types.ts +3 -3
  174. package/components/oxy-step/index.scss +14 -14
  175. package/components/oxy-sticky/oxy-sticky.vue +6 -6
  176. package/components/oxy-stream-render/types.ts +4 -1
  177. package/components/oxy-swipe-action/oxy-swipe-action.vue +27 -2
  178. package/components/oxy-swiper/oxy-swiper.vue +6 -6
  179. package/components/oxy-swiper/types.ts +5 -5
  180. package/components/oxy-switch/index.scss +8 -8
  181. package/components/oxy-switch/oxy-switch.vue +2 -2
  182. package/components/oxy-switch/types.ts +1 -1
  183. package/components/oxy-tab/index.scss +11 -1
  184. package/components/oxy-tabbar/index.scss +1 -1
  185. package/components/oxy-tabbar/oxy-tabbar.vue +39 -10
  186. package/components/oxy-table/index.scss +5 -5
  187. package/components/oxy-table/oxy-table.vue +8 -6
  188. package/components/oxy-table/types.ts +2 -2
  189. package/components/oxy-table-col/oxy-table-col.vue +3 -3
  190. package/components/oxy-table-col/types.ts +2 -2
  191. package/components/oxy-tabs/index.scss +43 -15
  192. package/components/oxy-tabs/oxy-tabs.vue +53 -19
  193. package/components/oxy-tabs/types.ts +15 -3
  194. package/components/oxy-tag/index.scss +15 -15
  195. package/components/oxy-text/index.scss +5 -1
  196. package/components/oxy-text/oxy-text.vue +76 -7
  197. package/components/oxy-text/types.ts +12 -0
  198. package/components/oxy-textarea/index.scss +6 -6
  199. package/components/oxy-toast/oxy-toast.vue +24 -8
  200. package/components/oxy-tooltip/index.scss +9 -9
  201. package/components/oxy-tree/index.scss +51 -15
  202. package/components/oxy-tree/oxy-tree.vue +13 -9
  203. package/components/oxy-tree/types.ts +12 -9
  204. package/components/oxy-upload/index.scss +21 -21
  205. package/components/oxy-upload/types.ts +2 -2
  206. package/components/oxy-verification-code/index.scss +6 -0
  207. package/components/oxy-verification-code/oxy-verification-code.vue +187 -0
  208. package/components/oxy-verification-code/types.ts +82 -0
  209. package/components/oxy-video-preview/index.scss +4 -4
  210. package/components/oxy-virtual-scroll/index.scss +4 -4
  211. package/components/oxy-virtual-scroll/oxy-virtual-scroll.vue +11 -7
  212. package/components/oxy-virtual-scroll/types.ts +14 -14
  213. package/components/oxy-voice-player/index.scss +908 -0
  214. package/components/oxy-voice-player/oxy-voice-player.vue +821 -0
  215. package/components/oxy-voice-player/types.ts +567 -0
  216. package/components/oxy-waterfall/oxy-waterfall.vue +6 -6
  217. package/components/oxy-waterfall/types.ts +6 -6
  218. package/components/oxy-watermark/oxy-watermark.vue +35 -13
  219. package/components/oxy-watermark/types.ts +14 -14
  220. package/global.d.ts +2 -0
  221. package/locale/lang/ar-SA.ts +3 -0
  222. package/locale/lang/en-US.ts +3 -0
  223. package/locale/lang/zh-CN.ts +3 -0
  224. package/package.json +97 -1
  225. package/tags.json +1 -1
  226. package/web-types.json +1 -1
  227. package/components/oxy-number-keyboard/index.scss +0 -78
  228. package/components/oxy-number-keyboard/key/index.scss +0 -81
  229. package/components/oxy-number-keyboard/key/index.vue +0 -78
  230. package/components/oxy-number-keyboard/key/types.ts +0 -11
  231. package/components/oxy-number-keyboard/oxy-number-keyboard.vue +0 -151
  232. package/components/oxy-number-keyboard/types.ts +0 -83
  233. package/components/oxy-tree/components/tree-node-content.vue +0 -72
  234. package/components/oxy-tree/index.ts +0 -51
  235. package/oxy-uni-ui.zip +0 -0
@@ -8,9 +8,13 @@
8
8
  flex: 1;
9
9
  box-sizing: border-box;
10
10
  position: relative;
11
+ text-align: left;
11
12
  .oxy-select__label {
12
13
  margin: auto 0;
13
- margin-right: $-input-cell-padding;
14
+ color: $-cell-title-color;
15
+ margin-right: $-cell-padding;
16
+ box-sizing: border-box;
17
+ font-size: $-input-fs;
14
18
  }
15
19
  .oxy-select__icon {
16
20
  position: absolute;
@@ -33,31 +37,46 @@
33
37
  }
34
38
  .oxy-select__wrapper {
35
39
  font-size: $-input-fs;
36
- border: 1px solid $-input-border-color;
40
+ color: $-input-color;
41
+ border: 1px solid $-color-border;
37
42
  box-sizing: border-box;
38
- border-radius: 4px;
39
- padding: 0 5px;
40
- padding-left: $-input-cell-padding;
43
+ border-radius: 8rpx;
44
+ padding: 0 $-input-cell-padding;
41
45
  position: relative;
42
46
  /* #ifndef APP-NVUE */
43
47
  display: flex;
44
48
  user-select: none;
45
49
  /* #endif */
46
50
  flex-direction: row;
47
- align-items: center;
48
- border-bottom: solid 1px $-input-border-color;
49
51
  width: 100%;
50
52
  flex: 1;
51
53
  min-height: $-input-inner-height;
54
+ transition: all 0.2s;
55
+
56
+ &:hover:not(.is-disabled):not(.is-readonly) {
57
+ border-color: $-color-theme;
58
+ }
59
+
60
+ &.is-focus:not(.is-disabled):not(.is-readonly) {
61
+ border-color: $-color-theme;
62
+ box-shadow: 0 0 0 4rpx rgba($-color-theme, 0.1);
63
+ }
52
64
 
53
65
  &.is-disabled {
54
- background-color: $-input-disabled-color;
66
+ background-color: $-color-bg;
67
+ border-color: $-color-border-light;
55
68
  cursor: not-allowed;
69
+ color: $-color-tip;
70
+ }
71
+
72
+ &.is-readonly {
73
+ background-color: transparent;
74
+ border-color: transparent;
75
+ padding: 0;
56
76
  }
57
77
  }
58
78
  .oxy-select__input-box {
59
79
  width: 100%;
60
- // height: $-input-inner-height;
61
80
  position: relative;
62
81
  /* #ifndef APP-NVUE */
63
82
  display: flex;
@@ -65,71 +84,83 @@
65
84
  flex: 1;
66
85
  flex-direction: row;
67
86
  align-items: center;
87
+ overflow: hidden;
68
88
  }
69
89
 
70
90
  .oxy-select__tags {
71
91
  width: 100%;
72
92
  display: flex;
73
93
  flex-wrap: wrap;
94
+ padding: 8rpx 0;
95
+
74
96
  &-item {
75
- font-size: 12px;
76
- border: 1px solid #d9ecff;
77
- border-radius: 4px;
97
+ font-size: 24rpx;
98
+ border-radius: 8rpx;
78
99
  white-space: nowrap;
79
- height: 24px;
80
- padding: 0 4px;
81
- line-height: 22px;
100
+ height: 48rpx;
101
+ padding: 0 16rpx;
102
+ line-height: 44rpx;
82
103
  box-sizing: border-box;
83
- margin: 2px 2px;
104
+ margin: 4rpx 8rpx 4rpx 0;
84
105
  display: flex;
85
106
  max-width: 100%;
86
107
  align-items: center;
87
- background-color: #f4f4f5;
88
- border-color: #e9e9eb;
89
- color: #909399;
90
- &:first-child {
91
- margin-left: 0;
108
+ background-color: $-color-bg;
109
+ border: 1px solid $-color-border-light;
110
+ color: $-color-secondary;
111
+ transition: all 0.2s;
112
+
113
+ &:hover {
114
+ border-color: $-color-theme;
115
+ color: $-color-theme;
92
116
  }
117
+
93
118
  &-text {
94
- font-size: 12px;
119
+ font-size: 24rpx;
95
120
  white-space: nowrap;
96
- line-height: 22px;
97
- color: #909399;
121
+ line-height: 44rpx;
98
122
  overflow: hidden;
99
123
  text-overflow: ellipsis;
100
124
  }
101
125
  }
102
126
  .oxy-select__icon-error{
103
- margin-left: 4px;
127
+ margin-left: 8rpx;
128
+ font-size: 28rpx;
129
+ color: $-color-aid;
130
+ cursor: pointer;
131
+
132
+ &:hover {
133
+ color: $-color-danger;
134
+ }
104
135
  }
105
136
  }
106
137
 
107
138
  .oxy-select__input {
108
139
  flex: 1;
109
- font-size: 14px;
110
- height: 22px;
111
- line-height: 22px;
140
+ font-size: $-fs-content;
141
+ height: 44rpx;
142
+ line-height: 44rpx;
112
143
  }
113
144
 
114
145
  .oxy-select__input-plac {
115
- color: $-input-placeholder-color;
146
+ color: $-color-tip;
116
147
  }
117
148
 
118
149
  .oxy-select__selector__down {
119
- top: calc(100% + 12px);
150
+ top: calc(100% + 24rpx);
120
151
 
121
152
  .oxy-select__selector-arrow {
122
153
  transform: rotateX(0deg);
123
- top: -6px;
154
+ top: -12rpx;
124
155
  }
125
156
  }
126
157
 
127
158
  .oxy-select__selector__upwards {
128
- bottom: calc(100% + 12px);
159
+ bottom: calc(100% + 24rpx);
129
160
 
130
161
  .oxy-select__selector-arrow {
131
162
  transform: rotateX(180deg);
132
- bottom: -6px;
163
+ bottom: -12rpx;
133
164
  }
134
165
  }
135
166
 
@@ -140,17 +171,18 @@
140
171
  position: absolute;
141
172
  left: 0;
142
173
  width: 100%;
143
- background-color: #FFFFFF;
144
- border: 1px solid #EBEEF5;
145
- border-radius: 6px;
146
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
147
- z-index: 3;
148
- padding: 4px 0;
174
+ background-color: $-color-white;
175
+ border: 1px solid $-color-border-light;
176
+ border-radius: 16rpx;
177
+ box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.1);
178
+ z-index: 100;
179
+ padding: 12rpx 0;
180
+ overflow: hidden;
149
181
  }
150
182
 
151
183
  .oxy-select__selector-scroll {
152
184
  /* #ifndef APP-NVUE */
153
- max-height: 200px;
185
+ max-height: 480rpx;
154
186
  box-sizing: border-box;
155
187
  /* #endif */
156
188
  }
@@ -159,36 +191,56 @@
159
191
  .oxy-select__selector-item {
160
192
  /* #ifndef APP-NVUE */
161
193
  display: flex;
162
- // cursor: pointer;
163
194
  /* #endif */
164
- line-height: $-input-inner-height;
165
- font-size: 14px;
166
- text-align: center;
167
- padding: 0px 10px;
195
+ min-height: 80rpx;
196
+ line-height: 1.4;
197
+ font-size: $-fs-content;
198
+ padding: 16rpx 32rpx;
199
+ box-sizing: border-box;
200
+ transition: background-color 0.2s;
168
201
  }
169
202
 
170
203
  .oxy-select__selector-item {
171
204
  display: flex;
172
205
  justify-content: space-between;
173
206
  align-items: center;
207
+ color: $-color-content;
208
+ cursor: pointer;
209
+
210
+ &:hover:not(.oxy-select__selector__disabled) {
211
+ background-color: $-color-bg;
212
+ }
213
+
214
+ &.oxy-select_selector-item_active {
215
+ color: $-color-theme;
216
+ background-color: rgba($-color-theme, 0.05);
217
+ font-weight: 500;
218
+ }
174
219
  }
175
220
 
176
- .oxy-select__selector-empty:last-child,
177
- .oxy-select__selector-item:last-child {
178
- /* #ifndef APP-NVUE */
179
- border-bottom: none;
180
- /* #endif */
221
+ .oxy-select__selector__disabled {
222
+ color: $-color-tip;
223
+ cursor: not-allowed;
224
+ background-color: transparent !important;
181
225
  }
182
226
 
183
- .oxy-select_selector-item_active {
184
- color: $-color-theme;
185
- font-weight: bold;
186
- border-radius: 3px;
227
+ .oxy-select__loading {
228
+ display: flex;
229
+ align-items: center;
230
+ justify-content: center;
231
+ padding: 40rpx 0;
232
+ color: $-color-aid;
233
+ font-size: $-fs-secondary;
234
+
235
+ &-icon {
236
+ margin-right: 16rpx;
237
+ animation: rotate 1s linear infinite;
238
+ }
187
239
  }
188
240
 
189
- .oxy-select__selector__disabled {
190
- opacity: 0.4;
191
- cursor: default;
241
+ @keyframes rotate {
242
+ from { transform: rotate(0deg); }
243
+ to { transform: rotate(360deg); }
192
244
  }
193
245
 
194
246
  /* picker 弹出层通用的指示小三角 */
@@ -200,44 +252,57 @@
200
252
  height: 0;
201
253
  border-color: transparent;
202
254
  border-style: solid;
203
- border-width: 6px;
255
+ border-width: 12rpx;
204
256
  }
205
257
 
206
258
  .oxy-select__selector-arrow {
207
- filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
259
+ filter: drop-shadow(0 4rpx 24rpx rgba(0, 0, 0, 0.03));
208
260
 
209
261
  left: 10%;
210
- margin-right: 3px;
262
+ margin-right: 6rpx;
211
263
  border-top-width: 0;
212
- border-bottom-color: #EBEEF5;
264
+ border-bottom-color: $-color-border-light;
213
265
  }
214
266
 
215
267
  .oxy-select__selector-arrow::after {
216
268
  content: " ";
217
- top: 1px;
218
- margin-left: -6px;
269
+ top: 2rpx;
270
+ margin-left: -12rpx;
219
271
  border-top-width: 0;
220
- border-bottom-color: #fff;
272
+ border-bottom-color: $-color-white;
221
273
  }
222
274
 
223
275
  .oxy-select__input-text {
224
- // width: 280px;
225
- width: 90%;
276
+ width: 100%;
277
+ font-size: $-input-fs;
226
278
  color: $-input-color;
279
+ outline: none;
280
+ border: none;
281
+ background: none;
227
282
  white-space: nowrap;
228
283
  text-overflow: ellipsis;
229
- -o-text-overflow: ellipsis;
230
284
  overflow: hidden;
231
285
  }
232
286
 
233
287
  .oxy-select__input-selector {
234
288
  position: absolute;
235
289
  z-index: 1;
290
+ left: 20rpx;
291
+ right: 60rpx;
292
+ width: auto;
293
+ &::-webkit-input-placeholder {
294
+ color: $-input-placeholder-color;
295
+ }
236
296
  }
237
297
 
238
298
  .oxy-select__input-filter {
239
299
  width: auto;
240
- margin-left: 6px;
300
+ min-width: 80rpx;
301
+ margin-left: 8rpx;
302
+ flex: 1;
303
+ &::-webkit-input-placeholder {
304
+ color: $-input-placeholder-color;
305
+ }
241
306
  }
242
307
 
243
308
  .oxy-select__input-placeholder {
@@ -252,4 +317,15 @@
252
317
  left: 0;
253
318
  z-index: 2;
254
319
  }
320
+
321
+ @include when(no-border) {
322
+ .oxy-select__wrapper {
323
+ border: 0;
324
+ padding: 0;
325
+ min-height: $-input-cell-height;
326
+ &.is-focus:not(.is-disabled):not(.is-readonly) {
327
+ box-shadow: none;
328
+ }
329
+ }
330
+ }
255
331
  }
@@ -1,27 +1,27 @@
1
1
  <template>
2
- <view :class="`oxy-select ${customClass}`" :style="rootStyle">
2
+ <view :class="rootClass" :style="rootStyle">
3
3
  <view v-if="label" class="oxy-select__label" :style="labelStyle">
4
4
  <slot name="label">{{ label }}</slot>
5
5
  </view>
6
6
  <view class="oxy-select__box">
7
- <view :class="['oxy-select__wrapper', { 'is-disabled': disabled, 'is-readonly': readonly }]">
7
+ <view :class="['oxy-select__wrapper', { 'is-disabled': disabled, 'is-readonly': readonly, 'is-focus': showSelector }]">
8
8
  <view class="oxy-select__input-box" @click="toggleSelector">
9
9
  <view class="oxy-select__tags" v-if="multiple && currentList.length > 0">
10
10
  <view class="oxy-select__tags-item" v-for="item in displayTags" :key="item[valueKey]">
11
- <span class="oxy-select__tags-item-text">{{ item[labelKey] }}</span>
11
+ <span class="oxy-select__tags-item-text">{{ formatItemName(item) }}</span>
12
12
  <view v-if="!disabled && !readonly" @click.stop="delItem(item)">
13
- <oxy-icon custom-class="oxy-select__icon-error" name="error-fill" />
13
+ <oxy-icon custom-class="oxy-select__icon-error" name="close" />
14
14
  </view>
15
15
  </view>
16
16
  <view v-if="currentList.length > collapseTagsNum && collapseTags" class="oxy-select__tags-item">
17
17
  <span class="oxy-select__tags-item-text">+{{ currentList.length - collapseTagsNum }}</span>
18
18
  </view>
19
19
  <input
20
- v-if="filterable && (!disabled || !readonly)"
20
+ v-if="filterable && !disabled && !readonly"
21
21
  @input="inputChange"
22
22
  class="oxy-select__input-text oxy-select__input-filter"
23
23
  type="text"
24
- placeholder="请输入"
24
+ :placeholder="currentList.length === 0 ? typePlaceholder : ''"
25
25
  v-model="filterInput"
26
26
  />
27
27
  </view>
@@ -36,15 +36,15 @@
36
36
  :readonly="readonly"
37
37
  class="oxy-select__input-text oxy-select__input-selector"
38
38
  type="text"
39
- :placeholder="placeholderOld"
39
+ :placeholder="placeholderOld || typePlaceholder"
40
40
  v-model="filterInput"
41
41
  />
42
42
  <view v-else-if="!disabled && !readonly" class="oxy-select__input-text oxy-select__input-placeholder">{{ typePlaceholder }}</view>
43
43
  <oxy-icon
44
44
  v-if="(current.length > 0 && clear && !disabled && !readonly) || (currentArr.length > 0 && clear && !disabled && !readonly)"
45
45
  custom-class="oxy-select__icon oxy-select__icon-clear"
46
- name="error-fill"
47
- @click="clearVal"
46
+ name="close-circle-filled"
47
+ @click.stop="clearVal"
48
48
  />
49
49
  <oxy-icon
50
50
  :custom-class="`oxy-select__icon oxy-select__icon-arrow ${showSelector ? 'is-open' : ''}`"
@@ -52,24 +52,33 @@
52
52
  name="arrow-down"
53
53
  />
54
54
  </view>
55
- <oxy-transition :show="showSelector" name="fade" :duration="duration">
55
+ <oxy-transition :show="showSelector" name="fade" :duration="duration" :lazy-render="false">
56
56
  <view class="oxy-select--mask" @click="toggleSelector" />
57
57
  <view class="oxy-select__selector" :class="isDown ? 'oxy-select__selector__down' : 'oxy-select__selector__upwards'">
58
58
  <view class="oxy-select__selector-arrow"></view>
59
59
  <scroll-view :scroll-y="true" class="oxy-select__selector-scroll">
60
- <view class="oxy-select__selector-empty" v-if="filterMixinDatacomResData.length === 0">
61
- <span>{{ emptyTips }}</span>
62
- </view>
63
- <view
64
- v-else
65
- :class="['oxy-select__selector-item', { 'oxy-select_selector-item_active': multiple && currentArr.includes(item[valueKey]) }]"
66
- v-for="(item, index) in filterMixinDatacomResData"
67
- :key="index"
68
- @click="change(item)"
69
- >
70
- <span :class="{ 'oxy-select__selector__disabled': item.disabled }">{{ formatItemName(item) }}</span>
71
- <oxy-icon v-if="multiple && currentArr.includes(item[valueKey])" name="check" />
60
+ <view v-if="loading" class="oxy-select__loading">
61
+ <oxy-icon name="refresh" custom-class="oxy-select__loading-icon" />
62
+ <text>{{ loadingText }}</text>
72
63
  </view>
64
+ <template v-else>
65
+ <view class="oxy-select__selector-empty" v-if="filterMixinDatacomResData.length === 0">
66
+ <span>{{ emptyTips }}</span>
67
+ </view>
68
+ <view
69
+ v-else
70
+ :class="[
71
+ 'oxy-select__selector-item',
72
+ { 'oxy-select_selector-item_active': multiple ? currentArr.includes(item[valueKey]) : modelValue === item[valueKey] }
73
+ ]"
74
+ v-for="(item, index) in filterMixinDatacomResData"
75
+ :key="index"
76
+ @click="change(item)"
77
+ >
78
+ <span :class="{ 'oxy-select__selector__disabled': item.disabled }">{{ formatItemName(item) }}</span>
79
+ <oxy-icon v-if="multiple && currentArr.includes(item[valueKey])" name="check" />
80
+ </view>
81
+ </template>
73
82
  </scroll-view>
74
83
  </view>
75
84
  </oxy-transition>
@@ -89,8 +98,9 @@ export default {
89
98
  </script>
90
99
 
91
100
  <script lang="ts" setup>
92
- import { getCurrentInstance, ref, watch, onMounted, computed } from 'vue'
101
+ import { getCurrentInstance, ref, watch, computed } from 'vue'
93
102
  import { objToStyle } from '../common/util'
103
+ import { useWindowResize, type WindowResizeResult } from '../composables/useWindowResize'
94
104
  import { selectProps, type SelectProps } from './types'
95
105
  import OxyTransition from '../oxy-transition/oxy-transition.vue'
96
106
 
@@ -114,8 +124,23 @@ const rootStyle = ref('')
114
124
  const duration = ref<number>(200)
115
125
  let overlayTimer: ReturnType<typeof setTimeout> | null
116
126
 
117
- onMounted(() => {
118
- windowHeight.value = uni.getSystemInfoSync().windowHeight
127
+ const syncWindowHeight = (res?: WindowResizeResult) => {
128
+ const resizeHeight = Number(res?.size?.windowHeight ?? res?.windowHeight)
129
+ const systemHeight = uni.getSystemInfoSync().windowHeight
130
+ windowHeight.value = Number.isFinite(resizeHeight) && resizeHeight > 0 ? resizeHeight : systemHeight
131
+ }
132
+
133
+ const handleWindowResize = (res?: WindowResizeResult) => {
134
+ syncWindowHeight(res)
135
+ if (showSelector.value) {
136
+ void getIsDown()
137
+ }
138
+ }
139
+
140
+ useWindowResize(handleWindowResize, { immediate: true })
141
+
142
+ const rootClass = computed(() => {
143
+ return `oxy-select ${props.noBorder ? 'is-no-border' : ''} ${props.customClass}`
119
144
  })
120
145
 
121
146
  const labelStyle = computed(() => {
@@ -212,18 +237,28 @@ watch(
212
237
  )
213
238
 
214
239
  function getIsDown() {
215
- const query = uni.createSelectorQuery().in(instance)
216
- query
217
- .select('.oxy-select__box')
218
- .boundingClientRect((data) => {
219
- const rect = data as UniApp.NodeInfo
220
- if (rect && windowHeight.value - (rect.top || 0) > 200) {
221
- isDown.value = true
222
- } else {
223
- isDown.value = false
224
- }
225
- })
226
- .exec()
240
+ return new Promise((resolve) => {
241
+ const query = uni.createSelectorQuery().in(instance)
242
+ query
243
+ .select('.oxy-select__box')
244
+ .boundingClientRect((data) => {
245
+ const rect = data as UniApp.NodeInfo
246
+ if (rect) {
247
+ const bottomSpace = windowHeight.value - (rect.bottom || 0)
248
+ const topSpace = rect.top || 0
249
+ const threshold = 280 // max-height 240 + padding/arrow space
250
+
251
+ // 如果下方空间不足,且上方空间比下方空间大,则向上弹出
252
+ if (bottomSpace < threshold && topSpace > bottomSpace) {
253
+ isDown.value = false
254
+ } else {
255
+ isDown.value = true
256
+ }
257
+ }
258
+ resolve(isDown.value)
259
+ })
260
+ .exec()
261
+ })
227
262
  }
228
263
 
229
264
  function initDefVal() {
@@ -367,13 +402,16 @@ function handleEmit(val: any) {
367
402
  emit('change', _current)
368
403
  }
369
404
  }
370
- function toggleSelector() {
405
+ async function toggleSelector() {
371
406
  if (props.disabled || props.readonly) {
372
407
  return
373
408
  }
374
- getIsDown()
375
- showSelector.value = !showSelector.value
376
- isFocus.value = showSelector.value
409
+ const nextShow = !showSelector.value
410
+ if (nextShow) {
411
+ await getIsDown()
412
+ }
413
+ showSelector.value = nextShow
414
+ isFocus.value = nextShow
377
415
  if (props.filterable && current.value && showSelector.value) {
378
416
  if (!props.multiple) {
379
417
  if (typeof current.value === 'string') {
@@ -394,21 +432,18 @@ function formatItemName(item: any) {
394
432
  if (!item) {
395
433
  return ''
396
434
  }
397
- let text = item[props.labelKey]
398
- let value = item[props.valueKey]
399
- let { channel_code } = item
400
- channel_code = channel_code ? `(${channel_code})` : ''
435
+ const label = item[props.labelKey]
436
+
401
437
  if (props.format) {
402
438
  // 格式化输出
403
- let str = ''
404
- str = props.format
405
- for (let key in item) {
439
+ let str = props.format
440
+ for (const key in item) {
406
441
  str = str.replace(new RegExp(`{${key}}`, 'g'), item[key])
407
442
  }
408
443
  return str
409
- } else {
410
- return text ? text : `未命名${channel_code}`
411
444
  }
445
+
446
+ return label !== undefined && label !== null ? String(label) : ''
412
447
  }
413
448
 
414
449
  // 获取当前加载的数据
@@ -61,11 +61,23 @@ export const selectProps = {
61
61
  * 是否可清除
62
62
  */
63
63
  clear: makeBooleanProp(true),
64
+ /**
65
+ * 是否加载中
66
+ */
67
+ loading: makeBooleanProp(false),
68
+ /**
69
+ * 加载中文字
70
+ */
71
+ loadingText: makeStringProp('加载中...'),
64
72
  /**
65
73
  * 格式化输出
66
74
  */
67
75
  format: makeStringProp(''),
68
- defItem: makeNumberProp(0)
76
+ defItem: makeNumberProp(0),
77
+ /**
78
+ * 是否隐藏边框
79
+ */
80
+ noBorder: makeBooleanProp(false)
69
81
  }
70
82
 
71
83
  export type SelectProps = ExtractPropTypes<typeof selectProps>
@@ -73,19 +73,19 @@
73
73
  }
74
74
 
75
75
  @include edeep(header) {
76
- height: 72px;
77
- line-height: 72px;
76
+ height: 144rpx;
77
+ line-height: 144rpx;
78
78
  }
79
79
  @include e(wrapper) {
80
- padding: 0 10px;
80
+ padding: 0 20rpx;
81
81
  position: relative;
82
- max-height: 356px;
82
+ max-height: 712rpx;
83
83
  box-sizing: border-box;
84
84
  overflow: auto;
85
85
 
86
86
  @include when(filterable) {
87
- height: 314px;
88
- max-height: 314px;
87
+ height: 628rpx;
88
+ max-height: 628rpx;
89
89
  }
90
90
 
91
91
  @include when(loading) {
@@ -97,6 +97,6 @@
97
97
  }
98
98
 
99
99
  @include e(footer) {
100
- padding: 24px 15px;
100
+ padding: 48rpx 30rpx;
101
101
  }
102
102
  }
@@ -40,6 +40,7 @@
40
40
  :title="title || translate('title')"
41
41
  :close-on-click-modal="closeOnClickModal"
42
42
  :z-index="zIndex"
43
+ :max-width="popupMaxWidth"
43
44
  :safe-area-inset-bottom="safeAreaInsetBottom"
44
45
  :root-portal="rootPortal"
45
46
  @close="close"
@@ -72,6 +72,8 @@ export const selectPickerProps = {
72
72
  beforeConfirm: Function as PropType<SelectPickerBeforeConfirm>,
73
73
  /** 弹窗层级 */
74
74
  zIndex: makeNumberProp(15),
75
+ /** 弹层最大宽度,支持 `rpx`、`px`、`%` 等单位;`%` 在弹层打开时按屏幕宽度换算为 `rpx` */
76
+ popupMaxWidth: makeStringProp('1200rpx'),
75
77
  /** 弹出面板是否设置底部安全距离(iphone X 类型的机型) */
76
78
  safeAreaInsetBottom: makeBooleanProp(true),
77
79
  /** 可搜索(目前只支持本地搜索) */
@@ -91,7 +91,7 @@
91
91
 
92
92
  @include edeep(icon) {
93
93
  font-size: $-sidebar-icon-size;
94
- margin-right: 2px;
94
+ margin-right: 4rpx;
95
95
  }
96
96
 
97
97
  }