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
@@ -58,7 +58,7 @@ export default {
58
58
  <script lang="ts" setup>
59
59
  import OxyDateStripItem from '../oxy-date-strip-item/oxy-date-strip-item.vue'
60
60
  import { ref, computed, watch, onMounted, nextTick, reactive } from 'vue'
61
- import { objToStyle, unitConvert } from '../common/util'
61
+ import { objToStyle, unitConvertWithDefault } from '../common/util'
62
62
  import { getWeekRange, addDays, addWeeks, calcType, daysBetween } from './utils'
63
63
  import { dateStripProps, type WeekDateCollection, type DateStriPDay } from './types'
64
64
 
@@ -170,7 +170,7 @@ const onClick = (day: DateStriPDay) => {
170
170
  const scrollToDate = (date: Date) => {
171
171
  currentDate.value = date
172
172
  if (props.switchMode !== 'none') return
173
- scrollLeft.value = unitConvert(props.gridWidth || 50) * daysBetween(date, minDate.value)
173
+ scrollLeft.value = unitConvertWithDefault(props.gridWidth, { defaultUnit: 'rpx' }) * daysBetween(date, minDate.value)
174
174
  }
175
175
 
176
176
  watch(
@@ -62,7 +62,7 @@ export const dateStripProps = {
62
62
  default: null
63
63
  },
64
64
  // 网格宽度
65
- gridWidth: makeStringProp(''),
65
+ gridWidth: makeStringProp('100rpx'),
66
66
  // 主题色,对底部按钮和选中日期生效
67
67
  color: makeStringProp(''),
68
68
  // 选中日期的背景色
@@ -43,13 +43,13 @@
43
43
  }
44
44
  &--none {
45
45
  .oxy-date-strip-item__grid-prefix {
46
- padding-bottom: 4px;
47
- padding-top: 4px;
46
+ padding-bottom: 8rpx;
47
+ padding-top: 8rpx;
48
48
  }
49
49
  }
50
50
  &--circle {
51
51
  .oxy-date-strip-item__grid-prefix {
52
- padding-bottom: 4px;
52
+ padding-bottom: 8rpx;
53
53
  }
54
54
  .oxy-date-strip-item__grid-info {
55
55
  border-radius: $-date-strip-grid-circle-radius;
@@ -21,7 +21,7 @@
21
21
 
22
22
  @include e(region) {
23
23
  color: $-dark-color;
24
-
24
+
25
25
  @include when(active) {
26
26
  background: $-picker-region-bg-active-color;
27
27
  color: $-dark-color;
@@ -29,7 +29,7 @@
29
29
  }
30
30
  }
31
31
  }
32
-
32
+
33
33
 
34
34
  @include b(datetime-picker) {
35
35
  @include edeep(cell) {
@@ -52,13 +52,13 @@
52
52
  font-size: $-cell-icon-size-large;
53
53
  }
54
54
  }
55
-
55
+
56
56
  .oxy-cell__value--ellipsis {
57
57
  view {
58
58
  @include lineEllipsis;
59
59
  width: 100%;
60
60
  }
61
-
61
+
62
62
  text {
63
63
  @include lineEllipsis;
64
64
  max-width: 100%;
@@ -69,7 +69,7 @@
69
69
  @include e(placeholder) {
70
70
  color: $-input-placeholder-color;
71
71
  }
72
-
72
+
73
73
  @include edeep(arrow) {
74
74
  display: block;
75
75
  font-size: $-cell-icon-size;
@@ -85,7 +85,7 @@
85
85
  }
86
86
 
87
87
  @include edeep(popup) {
88
- border-radius: 16px 16px 0px 0px;
88
+ border-radius: 32rpx 32rpx 0 0;
89
89
  }
90
90
 
91
91
  @include e(wraper) {
@@ -110,7 +110,7 @@
110
110
  font-size: $-picker-toolbar-fs;
111
111
  color: $-picker-toolbar-finish-color;
112
112
  background: transparent;
113
- padding: 24px 15px 14px 15px;
113
+ padding: 48rpx 30rpx 28rpx 30rpx;
114
114
 
115
115
  @include m(cancel) {
116
116
  color: $-picker-toolbar-cancel-color;
@@ -135,9 +135,9 @@
135
135
  display: inline-block;
136
136
  color: $-picker-region-color;
137
137
  text-align: center;
138
- padding: 14px 0;
138
+ padding: 28rpx 0;
139
139
  font-size: $-picker-region-fs;
140
- line-height: 16px;
140
+ line-height: 32rpx;
141
141
  transition: all 0.15s ease-out;
142
142
 
143
143
  @include when(active) {
@@ -147,8 +147,8 @@
147
147
  }
148
148
 
149
149
  @include e(region-time) {
150
- font-size: 16px;
151
- margin-top: 2px;
150
+ font-size: 32rpx;
151
+ margin-top: 4rpx;
152
152
  }
153
153
 
154
154
  @include e(hidden) {
@@ -57,6 +57,7 @@
57
57
  position="bottom"
58
58
  :hide-when-close="false"
59
59
  :close-on-click-modal="closeOnClickModal"
60
+ :max-width="popupMaxWidth"
60
61
  :safe-area-inset-bottom="safeAreaInsetBottom"
61
62
  :z-index="zIndex"
62
63
  :root-portal="rootPortal"
@@ -157,6 +157,11 @@ export const datetimePickerProps = {
157
157
  * 弹窗层级
158
158
  */
159
159
  zIndex: makeNumberProp(15),
160
+ /**
161
+ * 弹层最大宽度,支持 `rpx`、`px`、`%` 等单位;
162
+ * `%` 在弹层打开时按屏幕宽度换算为 `rpx`
163
+ */
164
+ popupMaxWidth: makeStringProp('1200rpx'),
160
165
  /**
161
166
  * 表单域 model 字段名,在使用表单校验功能的情况下,该属性是必填的
162
167
  */
@@ -66,9 +66,9 @@
66
66
  &::after {
67
67
  position: absolute;
68
68
  content: '';
69
- width: 19px;
69
+ width: 38rpx;
70
70
  height: $-drop-menu-line-height;
71
- bottom: 6px;
71
+ bottom: 12rpx;
72
72
  left: 50%;
73
73
  transform: translate(-50%, 0);
74
74
  background: $-drop-menu-line-color;
@@ -85,6 +85,6 @@
85
85
 
86
86
  @include edeep(arrow) {
87
87
  font-size: $-drop-menu-arrow-fs;
88
- margin-left: 2px;
88
+ margin-left: 4rpx;
89
89
  }
90
90
  }
@@ -47,7 +47,7 @@ export default {
47
47
  import { computed, getCurrentInstance, inject, onBeforeMount, ref, watch } from 'vue'
48
48
  import { closeOther } from '../common/clickoutside'
49
49
  import { type Queue, queueKey } from '../composables/useQueue'
50
- import { getRect, uuid } from '../common/util'
50
+ import { getRect, unitConvert, uuid } from '../common/util'
51
51
  import { useChildren } from '../composables/useChildren'
52
52
  import { DROP_MENU_KEY, dropMenuProps } from './types'
53
53
  import OxyOverlay from '../oxy-overlay/oxy-overlay.vue'
@@ -59,10 +59,10 @@ const offset = ref<number>(0)
59
59
  const windowHeight = ref<number>(0)
60
60
  const modalStyle = computed(() => {
61
61
  return props.direction === 'down'
62
- ? `top: calc(var(--window-top) + ${offset.value}px); bottom: 0;`
62
+ ? `top: calc(var(--window-top) + ${unitConvert(offset.value, 0, { output: 'px' })}); bottom: 0;`
63
63
  : props.direction === 'bottom'
64
64
  ? 'top: var(--window-top); bottom: 0;'
65
- : `top: 0; bottom: calc(var(--window-bottom) + ${offset.value}px)`
65
+ : `top: 0; bottom: calc(var(--window-bottom) + ${unitConvert(offset.value, 0, { output: 'px' })})`
66
66
  })
67
67
 
68
68
  const { proxy } = getCurrentInstance() as any
@@ -48,7 +48,7 @@
48
48
  display: inline-block;
49
49
  color: $-drop-menu-item-color-tip;
50
50
  font-size: $-drop-menu-item-fs-tip;
51
- margin-left: 2px;
51
+ margin-left: 4rpx;
52
52
  }
53
53
 
54
54
  @include edeep(icon) {
@@ -9,6 +9,7 @@
9
9
  :z-index="zIndex"
10
10
  :duration="duration"
11
11
  :position="position"
12
+ :max-width="popupMaxWidth"
12
13
  :custom-style="`position: absolute; pointer-events: auto; max-height: ${popupHeight ? popupHeight : '80%'}; ${customPopupStyle}`"
13
14
  :custom-class="customPopupClass"
14
15
  :modal="false"
@@ -61,7 +62,7 @@ import { type Queue, queueKey } from '../composables/useQueue'
61
62
  import type { PopupType } from '../oxy-popup/types'
62
63
  import { useParent } from '../composables/useParent'
63
64
  import { DROP_MENU_KEY } from '../oxy-drop-menu/types'
64
- import { isDef, isFunction } from '../common/util'
65
+ import { isDef, isFunction, unitConvert } from '../common/util'
65
66
  import { dorpMenuItemProps, type DropMenuItemExpose } from './types'
66
67
 
67
68
  const props = defineProps(dorpMenuItemProps)
@@ -90,10 +91,10 @@ const positionStyle = computed(() => {
90
91
  if (showWrapper.value && dropMenu) {
91
92
  style =
92
93
  dropMenu.props.direction === 'down'
93
- ? `top: calc(var(--window-top) + ${dropMenu.offset.value}px); bottom: 0;`
94
+ ? `top: calc(var(--window-top) + ${unitConvert(dropMenu.offset.value, 0, { output: 'px' })}); bottom: 0;`
94
95
  : dropMenu.props.direction === 'bottom'
95
96
  ? 'top: calc(var(--window-top); bottom: 0;'
96
- : `top: 0; bottom: calc(var(--window-bottom) + ${dropMenu.offset.value}px)`
97
+ : `top: 0; bottom: calc(var(--window-bottom) + ${unitConvert(dropMenu.offset.value, 0, { output: 'px' })})`
97
98
  } else {
98
99
  style = ''
99
100
  }
@@ -76,6 +76,11 @@ export const dorpMenuItemProps = {
76
76
  * 弹出层高度 这里设置了 就取这里的
77
77
  */
78
78
  popupHeight: makeStringProp(''),
79
+ /**
80
+ * 弹层最大宽度,支持 `rpx`、`px`、`%` 等单位;
81
+ * `%` 在弹层打开时按屏幕宽度换算为 `rpx`
82
+ */
83
+ popupMaxWidth: makeStringProp('1200rpx'),
79
84
  /**
80
85
  * 是否从页面中脱离出来,用于解决各种 fixed 失效问题 (H5: teleport, APP: renderjs, 小程序: root-portal)
81
86
  */
@@ -2,10 +2,16 @@ import type { ExtractPropTypes } from 'vue'
2
2
  import { type ComponentPublicInstance } from 'vue'
3
3
  import { type UniEchartsInst } from '../../uni-echarts'
4
4
 
5
+ /**
6
+ * Echarts 组件属性
7
+ */
5
8
  export const echartsProps = {}
6
9
 
7
10
  export type EchartsProps = ExtractPropTypes<typeof echartsProps>
8
11
  export type EchartsExpose = {
12
+ /**
13
+ * 当前图表实例
14
+ */
9
15
  echartsInstance: UniEchartsInst | null
10
16
  }
11
17
 
@@ -67,44 +67,44 @@
67
67
  @include e(transition-enter) {
68
68
  @include m(top) {
69
69
  opacity: 0;
70
- transform: translateY(40px);
70
+ transform: translateY(80rpx);
71
71
  }
72
72
 
73
73
  @include m(bottom) {
74
74
  opacity: 0;
75
- transform: translateY(-40px);
75
+ transform: translateY(-80rpx);
76
76
  }
77
77
 
78
78
  @include m(left) {
79
79
  opacity: 0;
80
- transform: translateX(40px);
80
+ transform: translateX(80rpx);
81
81
  }
82
82
 
83
83
  @include m(right) {
84
84
  opacity: 0;
85
- transform: translateX(-40px);
85
+ transform: translateX(-80rpx);
86
86
  }
87
87
  }
88
88
 
89
89
  @include e(transition-leave-to) {
90
90
  @include m(top) {
91
91
  opacity: 0;
92
- transform: translateY(40px);
92
+ transform: translateY(80rpx);
93
93
  }
94
94
 
95
95
  @include m(bottom) {
96
96
  opacity: 0;
97
- transform: translateY(-40px);
97
+ transform: translateY(-80rpx);
98
98
  }
99
99
 
100
100
  @include m(left) {
101
101
  opacity: 0;
102
- transform: translateX(40px);
102
+ transform: translateX(80rpx);
103
103
  }
104
104
 
105
105
  @include m(right) {
106
106
  opacity: 0;
107
- transform: translateX(-40px);
107
+ transform: translateX(-80rpx);
108
108
  }
109
109
  }
110
110
 
@@ -44,12 +44,13 @@ import OxyButton from '../oxy-button/oxy-button.vue'
44
44
  import OxyIcon from '../oxy-icon/oxy-icon.vue'
45
45
  import OxyTransition from '../oxy-transition/oxy-transition.vue'
46
46
  import { type CSSProperties, computed, ref, watch, inject, getCurrentInstance, onBeforeUnmount, onMounted, nextTick } from 'vue'
47
- import { getRect, isDef, isH5, objToStyle } from '../common/util'
47
+ import { getRect, isDef, isH5, objToStyle, unitConvert } from '../common/util'
48
48
  import { type Queue, queueKey } from '../composables/useQueue'
49
49
  import { closeOther, pushToQueue, removeFromQueue } from '../common/clickoutside'
50
50
  import { fabProps, type FabExpose } from './types'
51
51
  import { reactive } from 'vue'
52
52
  import { useRaf } from '../composables/useRaf'
53
+ import { useWindowResize } from '../composables/useWindowResize'
53
54
 
54
55
  const props = defineProps(fabProps)
55
56
  const emit = defineEmits(['update:active', 'click'])
@@ -121,6 +122,24 @@ async function getBounding() {
121
122
  bounding.maxTop = screen.height - fabSize.height - bottom
122
123
  }
123
124
 
125
+ function clampPosition() {
126
+ if (!inited.value) return
127
+ const { minLeft, minTop, maxLeft, maxTop } = bounding
128
+ left.value = Math.min(Math.max(left.value, minLeft), maxLeft)
129
+ top.value = Math.min(Math.max(top.value, minTop), maxTop)
130
+ }
131
+
132
+ const handleWindowResize = async () => {
133
+ await getBounding()
134
+ if (props.draggable) {
135
+ clampPosition()
136
+ return
137
+ }
138
+ initPosition()
139
+ }
140
+
141
+ useWindowResize(handleWindowResize)
142
+
124
143
  function initPosition() {
125
144
  const pos = props.position
126
145
  const { minLeft, minTop, maxLeft, maxTop } = bounding
@@ -210,8 +229,8 @@ function handleTouchEnd() {
210
229
 
211
230
  const rootStyle = computed(() => {
212
231
  const style: CSSProperties = {
213
- top: top.value + 'px',
214
- left: left.value + 'px',
232
+ top: unitConvert(top.value, 0, { output: 'px' }),
233
+ left: unitConvert(left.value, 0, { output: 'px' }),
215
234
  transition: attractTransition.value ? 'all ease 0.3s' : 'none'
216
235
  }
217
236
  if (isDef(props.zIndex)) {
@@ -5,12 +5,12 @@
5
5
  position: relative;
6
6
  display: flex;
7
7
  flex-wrap: wrap;
8
- margin: 0 -8px;
8
+ margin: 0 -16rpx;
9
9
  @include e(item) {
10
10
  position: relative;
11
- width: calc(33.33% - 16px);
11
+ width: calc(33.33% - 32rpx);
12
12
  height: $-file-list-height;
13
- margin: 0 8px 32px;
13
+ margin: 0 16rpx 64rpx;
14
14
  }
15
15
  @include e(content) {
16
16
  display: flex;
@@ -20,7 +20,7 @@
20
20
  width: 100%;
21
21
  height: 100%;
22
22
  border: 1px solid $-color-border;
23
- border-radius: 8px;
23
+ border-radius: 16rpx;
24
24
  position: relative;
25
25
  }
26
26
  @include e(picture) {
@@ -28,20 +28,20 @@
28
28
  display: block;
29
29
  width: 100%;
30
30
  height: 100%;
31
- border-radius: 8px;
31
+ border-radius: 16rpx;
32
32
  }
33
33
  @include e(icon) {
34
- width: 32px;
35
- height: 32px;
34
+ width: 64rpx;
35
+ height: 64rpx;
36
36
  }
37
37
  @include e(name) {
38
38
  display: block;
39
39
  width: 100%;
40
40
  font-size: $-upload-file-fs;
41
41
  color: $-upload-file-color;
42
- padding: 0 4px;
42
+ padding: 0 8rpx;
43
43
  text-align: center;
44
- margin-top: 8px;
44
+ margin-top: 16rpx;
45
45
  white-space: nowrap;
46
46
  overflow: hidden;
47
47
  text-overflow: ellipsis;
@@ -60,15 +60,15 @@
60
60
  .oxy-file-list__list--item {
61
61
  width: 100%;
62
62
  background: #f8f9ff;
63
- padding: 8px 12px;
64
- border-radius: 4px;
63
+ padding: 16rpx 24rpx;
64
+ border-radius: 8rpx;
65
65
  display: flex;
66
66
  flex-direction: row;
67
67
  align-items: center;
68
68
  .oxy-file-list__icon {
69
- width: 24px;
70
- height: 24px;
71
- margin-right: 8px;
69
+ width: 48rpx;
70
+ height: 48rpx;
71
+ margin-right: 16rpx;
72
72
  }
73
73
  .oxy-file-list__name {
74
74
  flex: 1;
@@ -77,33 +77,34 @@
77
77
  padding: 0;
78
78
  }
79
79
  .oxy-file-list__download {
80
- font-size: 18px;
80
+ font-size: 36rpx;
81
81
  color: $-cell-arrow-color;
82
82
  }
83
83
  .oxy-file-list__delete {
84
- font-size: 18px;
84
+ font-size: 36rpx;
85
85
  color: $-cell-arrow-color;
86
- margin-left: 12px;
86
+ margin-left: 24rpx;
87
87
  }
88
88
  & + .oxy-file-list__list--item {
89
- margin-top: 8px;
89
+ margin-top: 16rpx;
90
90
  }
91
91
  }
92
92
  }
93
93
 
94
94
  .oxy-file-list__download-btn {
95
95
  position: absolute;
96
- top: 6px;
97
- right: 6px;
96
+ top: 12rpx;
97
+ right: 12rpx;
98
98
  background: rgba(0, 0, 0, 0.45);
99
- border-radius: 6px;
100
- padding: 4px 5px;
99
+ border-radius: 12rpx;
100
+ padding: 8rpx 10rpx;
101
+ display: flex;
101
102
  }
102
103
  .oxy-file-list__download {
103
104
  color: $-color-white;
104
105
  }
105
106
  .oxy-file-list__delete {
106
107
  color: $-color-white;
107
- margin-left: 6px;
108
+ margin-left: 12rpx;
108
109
  }
109
110
  }
@@ -4,7 +4,7 @@
4
4
  <view v-for="(file, index) in props.data" :key="index" class="oxy-file-list__list--item" @click="handleClick(file, index)">
5
5
  <image :src="getUploadImage(file)" mode="aspectFill" class="oxy-file-list__icon" />
6
6
  <text class="oxy-file-list__name">{{ file.name }}</text>
7
- <oxy-loading v-if="props.enableDownload && isDownloading(file)" size="18px" custom-class="oxy-file-list__download" />
7
+ <oxy-loading v-if="props.enableDownload && isDownloading(file)" size="36rpx" custom-class="oxy-file-list__download" />
8
8
  <view @tap.stop="onDownload(file)" v-if="props.enableDownload && !isDownloading(file)">
9
9
  <oxy-icon name="download" custom-class="oxy-file-list__download" />
10
10
  </view>
@@ -20,7 +20,7 @@
20
20
  <image v-else :src="getUploadImage(file)" mode="aspectFill" class="oxy-file-list__icon" @click="handleClick(file, index)" />
21
21
  <view v-if="props.enableDownload || props.enableDelete" class="oxy-file-list__download-btn">
22
22
  <template v-if="props.enableDownload">
23
- <oxy-loading v-if="isDownloading(file)" size="18px" color="#ffffff" custom-class="oxy-file-list__download" />
23
+ <oxy-loading v-if="isDownloading(file)" size="36rpx" color="#ffffff" custom-class="oxy-file-list__download" />
24
24
  <view @tap.stop="onDownload(file)">
25
25
  <oxy-icon name="download" custom-class="oxy-file-list__download" />
26
26
  </view>
@@ -35,10 +35,11 @@ export default {
35
35
  </script>
36
36
 
37
37
  <script lang="ts" setup>
38
- import { computed, onBeforeMount, ref, watch, type CSSProperties } from 'vue'
39
- import { floatingPanelProps } from './type'
40
- import { addUnit, closest, objToStyle } from '../common/util'
38
+ import { computed, ref, watch, type CSSProperties } from 'vue'
39
+ import { floatingPanelProps } from './types'
40
+ import { closest, objToStyle, unitConvert } from '../common/util'
41
41
  import { useTouch } from '../composables/useTouch'
42
+ import { useWindowResize, type WindowResizeResult } from '../composables/useWindowResize'
42
43
 
43
44
  const touch = useTouch()
44
45
 
@@ -61,8 +62,8 @@ const anchors = computed(() => (props.anchors.length >= 2 ? props.anchors : [bou
61
62
 
62
63
  const rootStyle = computed(() => {
63
64
  const style: CSSProperties = {
64
- height: addUnit(boundary.value.max),
65
- transform: `translateY(calc(100% + ${addUnit(-heightValue.value)}))`,
65
+ height: unitConvert(boundary.value.max, 0, { output: 'px' }),
66
+ transform: `translateY(calc(100% + ${unitConvert(-heightValue.value, 0, { output: 'px' })}))`,
66
67
  transition: !dragging.value ? `transform ${props.duration}ms cubic-bezier(0.18, 0.89, 0.32, 1.28)` : 'none'
67
68
  }
68
69
 
@@ -129,10 +130,13 @@ watch(
129
130
  { immediate: true }
130
131
  )
131
132
 
132
- onBeforeMount(() => {
133
- const { windowHeight: _windowHeight } = uni.getSystemInfoSync()
134
- windowHeight.value = _windowHeight
135
- })
133
+ const syncWindowHeight = (res?: WindowResizeResult) => {
134
+ const resizeHeight = Number(res?.size?.windowHeight ?? res?.windowHeight)
135
+ const systemHeight = uni.getSystemInfoSync().windowHeight
136
+ windowHeight.value = Number.isFinite(resizeHeight) && resizeHeight > 0 ? resizeHeight : systemHeight
137
+ }
138
+
139
+ useWindowResize(syncWindowHeight, { immediate: true })
136
140
  </script>
137
141
 
138
142
  <style lang="scss" scoped>
@@ -1,30 +1,30 @@
1
1
  import type { ExtractPropTypes } from 'vue'
2
- import { baseProps, makeArrayProp, makeBooleanProp, makeNumberProp, makeNumericProp, truthProp } from '../common/props'
2
+ import { baseProps, makeArrayProp, makeBooleanProp, makeNumberProp, truthProp } from '../common/props'
3
3
 
4
4
  export const floatingPanelProps = {
5
5
  ...baseProps,
6
6
  /**
7
- * 面板的显示高度
7
+ * 面板当前高度
8
8
  */
9
9
  height: makeNumberProp(0),
10
10
  /**
11
- * 设置自定义锚点,默认值 [100, windowHeight * 0.6]
11
+ * 拖拽吸附锚点列表
12
12
  */
13
13
  anchors: makeArrayProp<number>(),
14
14
  /**
15
- * 弹出面板是否设置底部安全距离(iphone X 类型的机型)
15
+ * 是否预留底部安全区
16
16
  */
17
17
  safeAreaInsetBottom: makeBooleanProp(false),
18
18
  /**
19
- * 是否显示滚动条,默认值为 true
19
+ * 内容区是否显示滚动条
20
20
  */
21
21
  showScrollbar: truthProp,
22
22
  /**
23
- * 动画时长,单位毫秒,默认值为 300ms
23
+ * 高度变化动画时长,单位毫秒
24
24
  */
25
- duration: makeNumericProp(300),
25
+ duration: makeNumberProp(300),
26
26
  /**
27
- * 是否允许内容区容器拖拽,默认值为 true
27
+ * 内容区是否允许拖拽
28
28
  */
29
29
  contentDraggable: truthProp
30
30
  }
@@ -0,0 +1,19 @@
1
+ @import './../common/abstracts/_mixin.scss';
2
+ @import './../common/abstracts/variable.scss';
3
+ @include b(footer-wrapper) {
4
+ position: fixed;
5
+ bottom: 0;
6
+ left: 0;
7
+ width: 100%;
8
+ overflow: visible;
9
+ }
10
+
11
+ @include b(footer) {
12
+ overflow: visible;
13
+ padding: 0;
14
+ background-color: $--footer-bg;
15
+ @include e(content) {
16
+ overflow: visible;
17
+ padding: $--footer-padding;
18
+ }
19
+ }