oxy-uni-ui 1.2.3 → 2.1.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 (246) hide show
  1. package/attributes.json +1 -1
  2. package/components/common/abstracts/variable.scss +512 -343
  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 +48 -21
  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 +4 -4
  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 +15 -15
  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 -8
  25. package/components/oxy-calendar-view/monthPanel/month-panel.vue +14 -8
  26. package/components/oxy-calendar-view/year/index.scss +5 -5
  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 +12 -12
  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 +33 -33
  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 +5 -5
  53. package/components/oxy-drop-menu/oxy-drop-menu.vue +3 -3
  54. package/components/oxy-drop-menu-item/index.scss +3 -3
  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 +30 -29
  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 +23 -23
  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 +9 -2
  113. package/components/oxy-message-box/types.ts +9 -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 +6 -5
  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 +4 -4
  131. package/components/oxy-picker-view/oxy-picker-view.vue +4 -4
  132. package/components/oxy-popover/index.scss +13 -13
  133. package/components/oxy-popup/index.scss +4 -4
  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 +25 -19
  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 +37 -36
  149. package/components/oxy-rich-text/mp-html/card/card.vue +3 -3
  150. package/components/oxy-rich-text/mp-html/mp-html.vue +33 -24
  151. package/components/oxy-rich-text/mp-html/node/node.vue +30 -19
  152. package/components/oxy-rich-text/oxy-rich-text.vue +31 -31
  153. package/components/oxy-rich-text/types.ts +6 -1
  154. package/components/oxy-row/oxy-row.vue +3 -3
  155. package/components/oxy-row/types.ts +1 -1
  156. package/components/oxy-search/index.scss +7 -7
  157. package/components/oxy-segmented/index.scss +19 -16
  158. package/components/oxy-segmented/oxy-segmented.vue +23 -3
  159. package/components/oxy-select/index.scss +213 -89
  160. package/components/oxy-select/oxy-select.vue +106 -58
  161. package/components/oxy-select/types.ts +13 -1
  162. package/components/oxy-select-picker/index.scss +7 -7
  163. package/components/oxy-select-picker/oxy-select-picker.vue +1 -0
  164. package/components/oxy-select-picker/types.ts +2 -0
  165. package/components/oxy-sidebar-item/index.scss +2 -2
  166. package/components/oxy-signature/oxy-signature.vue +18 -10
  167. package/components/oxy-signature/types.ts +106 -13
  168. package/components/oxy-skeleton/index.scss +1 -1
  169. package/components/oxy-skeleton/oxy-skeleton.vue +6 -6
  170. package/components/oxy-skeleton/types.ts +1 -1
  171. package/components/oxy-slider/index.scss +6 -6
  172. package/components/oxy-sort-button/index.scss +8 -8
  173. package/components/oxy-splitter/index.scss +19 -0
  174. package/components/oxy-splitter/oxy-splitter.vue +409 -0
  175. package/components/oxy-splitter/types.ts +75 -0
  176. package/components/oxy-splitter-panel/index.scss +366 -0
  177. package/components/oxy-splitter-panel/oxy-splitter-panel.vue +432 -0
  178. package/components/oxy-splitter-panel/types.ts +63 -0
  179. package/components/oxy-status-tip/index.scss +4 -4
  180. package/components/oxy-status-tip/oxy-status-tip.vue +5 -5
  181. package/components/oxy-status-tip/types.ts +3 -3
  182. package/components/oxy-step/index.scss +16 -16
  183. package/components/oxy-sticky/oxy-sticky.vue +6 -6
  184. package/components/oxy-stream-render/oxy-stream-render.vue +230 -4
  185. package/components/oxy-stream-render/types.ts +4 -1
  186. package/components/oxy-swipe-action/oxy-swipe-action.vue +27 -2
  187. package/components/oxy-swiper/oxy-swiper.vue +6 -6
  188. package/components/oxy-swiper/types.ts +5 -5
  189. package/components/oxy-swiper-nav/index.scss +3 -3
  190. package/components/oxy-switch/index.scss +10 -10
  191. package/components/oxy-switch/oxy-switch.vue +2 -2
  192. package/components/oxy-switch/types.ts +1 -1
  193. package/components/oxy-tab/index.scss +11 -1
  194. package/components/oxy-tabbar/index.scss +2 -2
  195. package/components/oxy-tabbar/oxy-tabbar.vue +39 -10
  196. package/components/oxy-table/index.scss +8 -8
  197. package/components/oxy-table/oxy-table.vue +8 -6
  198. package/components/oxy-table/types.ts +2 -2
  199. package/components/oxy-table-col/index.scss +3 -3
  200. package/components/oxy-table-col/oxy-table-col.vue +3 -3
  201. package/components/oxy-table-col/types.ts +2 -2
  202. package/components/oxy-tabs/index.scss +52 -22
  203. package/components/oxy-tabs/oxy-tabs.vue +53 -19
  204. package/components/oxy-tabs/types.ts +15 -3
  205. package/components/oxy-tag/index.scss +111 -36
  206. package/components/oxy-text/index.scss +5 -1
  207. package/components/oxy-text/oxy-text.vue +76 -7
  208. package/components/oxy-text/types.ts +12 -0
  209. package/components/oxy-textarea/index.scss +6 -6
  210. package/components/oxy-toast/oxy-toast.vue +24 -8
  211. package/components/oxy-tooltip/index.scss +9 -9
  212. package/components/oxy-tree/index.scss +51 -15
  213. package/components/oxy-tree/oxy-tree.vue +13 -9
  214. package/components/oxy-tree/types.ts +12 -9
  215. package/components/oxy-upload/index.scss +23 -23
  216. package/components/oxy-upload/types.ts +2 -2
  217. package/components/oxy-verification-code/index.scss +6 -0
  218. package/components/oxy-verification-code/oxy-verification-code.vue +187 -0
  219. package/components/oxy-verification-code/types.ts +82 -0
  220. package/components/oxy-video-preview/index.scss +4 -4
  221. package/components/oxy-virtual-scroll/index.scss +5 -5
  222. package/components/oxy-virtual-scroll/oxy-virtual-scroll.vue +11 -7
  223. package/components/oxy-virtual-scroll/types.ts +14 -14
  224. package/components/oxy-voice-player/index.scss +937 -0
  225. package/components/oxy-voice-player/oxy-voice-player.vue +821 -0
  226. package/components/oxy-voice-player/types.ts +567 -0
  227. package/components/oxy-waterfall/oxy-waterfall.vue +6 -6
  228. package/components/oxy-waterfall/types.ts +6 -6
  229. package/components/oxy-watermark/oxy-watermark.vue +35 -13
  230. package/components/oxy-watermark/types.ts +14 -14
  231. package/global.d.ts +4 -0
  232. package/locale/lang/ar-SA.ts +3 -0
  233. package/locale/lang/en-US.ts +3 -0
  234. package/locale/lang/zh-CN.ts +3 -0
  235. package/package.json +97 -1
  236. package/tags.json +1 -1
  237. package/web-types.json +1 -1
  238. package/components/oxy-number-keyboard/index.scss +0 -78
  239. package/components/oxy-number-keyboard/key/index.scss +0 -81
  240. package/components/oxy-number-keyboard/key/index.vue +0 -78
  241. package/components/oxy-number-keyboard/key/types.ts +0 -11
  242. package/components/oxy-number-keyboard/oxy-number-keyboard.vue +0 -151
  243. package/components/oxy-number-keyboard/types.ts +0 -83
  244. package/components/oxy-tree/components/tree-node-content.vue +0 -72
  245. package/components/oxy-tree/index.ts +0 -51
  246. package/oxy-uni-ui.zip +0 -0
@@ -38,11 +38,11 @@ export const imgCropperProps = {
38
38
  */
39
39
  imgSrc: makeStringProp(''),
40
40
  /**
41
- * 图片宽
41
+ * 图片宽,支持 `px/rpx/%`,number 与纯数字字符串按 rpx 处理
42
42
  */
43
43
  imgWidth: makeNumericProp(''),
44
44
  /**
45
- * 图片高
45
+ * 图片高,支持 `px/rpx/%`,number 与纯数字字符串按 rpx 处理
46
46
  */
47
47
  imgHeight: makeNumericProp(''),
48
48
  /**
@@ -64,7 +64,7 @@ export default {
64
64
 
65
65
  <script lang="ts" setup>
66
66
  import { computed, getCurrentInstance, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
67
- import { addUnit, isDef, objToStyle } from '../common/util'
67
+ import { withDefaultUnit, isDef, objToStyle } from '../common/util'
68
68
  import { imgLazyProps } from './types'
69
69
 
70
70
  const props = defineProps(imgLazyProps)
@@ -73,10 +73,10 @@ const emit = defineEmits(['show', 'load', 'error', 'destroyed'])
73
73
  const rootStyle = computed(() => {
74
74
  const style: Record<string, string | number> = {}
75
75
  if (isDef(props.height)) {
76
- style['height'] = addUnit(props.height)
76
+ style['height'] = withDefaultUnit(props.height)
77
77
  }
78
78
  if (isDef(props.width)) {
79
- style['width'] = addUnit(props.width)
79
+ style['width'] = withDefaultUnit(props.width)
80
80
  }
81
81
  return `${objToStyle(style)}${props.customStyle}`
82
82
  })
@@ -28,15 +28,15 @@ export const imgLazyProps = {
28
28
  */
29
29
  mode: makeStringProp<ImageMode>('aspectFill'),
30
30
  /**
31
- * 宽度,默认单位为px
31
+ * 宽度,number 类型按 `rpx` 语义处理,也支持 `px/rpx`
32
32
  */
33
33
  width: numericProp,
34
34
  /**
35
- * 高度,默认单位为px
35
+ * 高度,number 类型按 `rpx` 语义处理,也支持 `px/rpx`
36
36
  */
37
37
  height: numericProp,
38
38
  /**
39
- * 圆角大小,默认单位为px
39
+ * 圆角大小,number 类型按 `rpx` 语义处理,也支持 `px/rpx`
40
40
  */
41
41
  borderRadius: makeStringProp('0'),
42
42
  /**
@@ -22,8 +22,8 @@
22
22
 
23
23
  @include b(index-anchor) {
24
24
  background-color: $-color-gray-2;
25
- padding: 10px;
26
- font-size: 14px;
25
+ padding: 24rpx;
26
+ font-size: $-fs-content;
27
27
  color: $-color-title;
28
28
 
29
29
  @include when(sticky){
@@ -13,9 +13,9 @@
13
13
  </template>
14
14
 
15
15
  <script setup lang="ts">
16
- import { indexAnchorProps } from './type'
16
+ import { indexAnchorProps } from './types'
17
17
  import { onMounted, getCurrentInstance, ref, computed } from 'vue'
18
- import { indexBarInjectionKey } from '../oxy-index-bar/type'
18
+ import { indexBarInjectionKey } from '../oxy-index-bar/types'
19
19
  import { getRect, isDef, uuid } from '../common/util'
20
20
  import { useParent } from '../composables/useParent'
21
21
 
@@ -3,6 +3,9 @@ import { baseProps, makeRequiredProp } from '../common/props'
3
3
 
4
4
  export const indexAnchorProps = {
5
5
  ...baseProps,
6
+ /**
7
+ * 索引项标识,可用于字母索引或数字索引
8
+ */
6
9
  index: makeRequiredProp([String, Number])
7
10
  }
8
11
 
@@ -22,15 +22,15 @@
22
22
  @include e(sidebar) {
23
23
  position: absolute;
24
24
  top: 50%;
25
- right: 4px;
25
+ right: 12rpx;
26
26
  transform: translateY(-50%);
27
27
  }
28
28
 
29
29
  @include e(index) {
30
- font-size: 12px;
30
+ font-size: $-index-bar-index-font-size;
31
31
  font-weight: $-fw-medium;
32
32
  color: $-color-title;
33
- padding: 4px 6px;
33
+ padding: 12rpx 16rpx;
34
34
 
35
35
  @include when(active) {
36
36
  color: $-color-theme;
@@ -24,8 +24,8 @@
24
24
  </template>
25
25
 
26
26
  <script setup lang="ts">
27
- import type { AnchorIndex } from './type'
28
- import { indexBarInjectionKey, indexBarProps } from './type'
27
+ import type { AnchorIndex } from './types'
28
+ import { indexBarInjectionKey, indexBarProps } from './types'
29
29
  import { ref, getCurrentInstance, onMounted, reactive, nextTick, watch } from 'vue'
30
30
  import { getRect, isDef, uuid, pause } from '../common/util'
31
31
  import { useChildren } from '../composables/useChildren'
@@ -71,7 +71,7 @@ let offsetTop = 0
71
71
  let sidebarInfo = {
72
72
  // 侧边栏距离顶部的高度
73
73
  offsetTop: 0,
74
- // 高度固定24px
74
+ // 高度固定48rpx
75
75
  indexHeight: 24
76
76
  }
77
77
 
@@ -6,7 +6,7 @@ export type AnchorIndex = number | string
6
6
 
7
7
  export const indexBarProps = {
8
8
  /**
9
- * @description 索引是否吸顶
9
+ * 索引栏是否启用吸顶效果
10
10
  */
11
11
  sticky: makeBooleanProp(false)
12
12
  }
@@ -16,7 +16,7 @@ export type IndexBarProps = ExtractPropTypes<typeof indexBarProps>
16
16
  export type InderBarProvide = {
17
17
  props: { sticky?: boolean }
18
18
  anchorState: {
19
- activeIndex: AnchorIndex | null // 当前激活的索引
19
+ activeIndex: AnchorIndex | null
20
20
  }
21
21
  }
22
22
 
@@ -301,7 +301,7 @@
301
301
  }
302
302
 
303
303
  @include e(count) {
304
- margin-left: 15px;
304
+ margin-left: 32rpx;
305
305
  font-size: $-input-count-fs;
306
306
  color: $-input-count-color;
307
307
  vertical-align: middle;
@@ -45,8 +45,8 @@
45
45
  &::after {
46
46
  position: absolute;
47
47
  content: "";
48
- width: calc(200% - 2px);
49
- height: calc(200% - 2px);
48
+ width: calc(200% - 4rpx);
49
+ height: calc(200% - 4rpx);
50
50
  left: 0;
51
51
  top: 0;
52
52
  border: 1px solid $-input-number-border-color;
@@ -77,7 +77,7 @@
77
77
  display: block;
78
78
  width: $-input-number-input-width;
79
79
  height: $-input-number-height;
80
- padding: 0 2px;
80
+ padding: 0 4rpx;
81
81
  box-sizing: border-box;
82
82
  z-index: 1;
83
83
  background: transparent;
@@ -93,7 +93,7 @@
93
93
  @include e(input-border) {
94
94
  position: absolute;
95
95
  width: 100%;
96
- height: calc(200% - 2px);
96
+ height: calc(200% - 4rpx);
97
97
  left: 0;
98
98
  top: 0;
99
99
  border-top: 1px solid $-input-number-border-color;
@@ -129,4 +129,4 @@
129
129
  border-left: none;
130
130
  }
131
131
  }
132
- }
132
+ }
@@ -13,7 +13,7 @@
13
13
  <view v-if="!withoutInput" class="oxy-input-number__inner" @click.stop="">
14
14
  <input
15
15
  class="oxy-input-number__input"
16
- :style="`${inputWidth ? 'width: ' + inputWidth : ''}`"
16
+ :style="`${inputWidth ? 'width: ' + withDefaultUnit(inputWidth) : ''}`"
17
17
  :type="inputType"
18
18
  :input-mode="precision ? 'decimal' : 'numeric'"
19
19
  :disabled="disabled || disableInput"
@@ -52,7 +52,7 @@ export default {
52
52
  <script lang="ts" setup>
53
53
  import OxyIcon from '../oxy-icon/oxy-icon.vue'
54
54
  import { computed, nextTick, ref, watch } from 'vue'
55
- import { isDef, isEqual } from '../common/util'
55
+ import { isDef, isEqual, withDefaultUnit } from '../common/util'
56
56
  import { inputNumberProps, type OperationType } from './types'
57
57
  import { callInterceptor } from '../common/interceptor'
58
58
 
@@ -57,9 +57,10 @@ export const inputNumberProps = {
57
57
  */
58
58
  withoutInput: makeBooleanProp(false),
59
59
  /**
60
- * 输入框宽度
60
+ * 输入框宽度。
61
+ * number 或纯数字字符串默认按 rpx 处理,支持传入带单位字符串(如 `px`、`rpx`、`%`)。
61
62
  */
62
- inputWidth: makeNumericProp(36),
63
+ inputWidth: makeNumericProp(72),
63
64
  /**
64
65
  * 是否允许为空
65
66
  */
@@ -18,7 +18,7 @@
18
18
  user-select: none;
19
19
 
20
20
  @include m(with-title) {
21
- border-radius: 20px 20px 0 0;
21
+ border-radius: $-keyboard-panel-radius $-keyboard-panel-radius 0 0;
22
22
  }
23
23
 
24
24
  @include e(header) {
@@ -28,7 +28,7 @@
28
28
  justify-content: center;
29
29
  box-sizing: content-box;
30
30
  height: $-keyboard-title-height;
31
- padding-top: 6px;
31
+ padding-top: 12rpx;
32
32
  color: $-keyboard-title-color;
33
33
  font-size: $-keyboard-title-font-size;
34
34
  }
@@ -45,7 +45,7 @@
45
45
 
46
46
  @include e(body) {
47
47
  display: flex;
48
- padding: 6px 0 0 6px;
48
+ padding: 12rpx 0 0 12rpx;
49
49
  }
50
50
 
51
51
  @include e(keys) {
@@ -57,7 +57,7 @@
57
57
  &-car {
58
58
  @include e(body) {
59
59
  display: flex;
60
- padding: 6px 0 0 6px;
60
+ padding: 12rpx 0 0 12rpx;
61
61
  }
62
62
  }
63
63
 
@@ -68,7 +68,7 @@
68
68
  flex-wrap: wrap;
69
69
 
70
70
  .oxy-key-wrapper {
71
- --oxy-keyboard-key-font-size: 18px;
71
+ --oxy-keyboard-key-font-size: #{$-keyboard-car-key-font-size};
72
72
  flex-basis: 10%;
73
73
 
74
74
  @include m(wider) {
@@ -21,7 +21,7 @@
21
21
  flex: 1;
22
22
  flex-basis: 33%;
23
23
  box-sizing: border-box;
24
- padding: 0 6px 6px 0;
24
+ padding: 0 12rpx 12rpx 0;
25
25
 
26
26
  @include m(wider) {
27
27
  flex-basis: 66%;
@@ -45,8 +45,8 @@
45
45
  @include m(large) {
46
46
  position: absolute;
47
47
  top: 0;
48
- right: 6px;
49
- bottom: 6px;
48
+ right: 12rpx;
49
+ bottom: 12rpx;
50
50
  left: 0;
51
51
  height: auto;
52
52
  }
@@ -11,13 +11,13 @@
11
11
  <template v-if="text">
12
12
  {{ text }}
13
13
  </template>
14
- <oxy-icon v-else custom-class="oxy-key__icon" name="keyboard-delete" size="22px"></oxy-icon>
14
+ <oxy-icon v-else custom-class="oxy-key__icon" name="keyboard-delete" size="44rpx"></oxy-icon>
15
15
  </template>
16
16
  <template v-else-if="type === 'extra'">
17
17
  <template v-if="text">
18
18
  {{ text }}
19
19
  </template>
20
- <oxy-icon v-else custom-class="oxy-key__icon" name="keyboard-collapse" size="22px"></oxy-icon>
20
+ <oxy-icon v-else custom-class="oxy-key__icon" name="keyboard-collapse" size="44rpx"></oxy-icon>
21
21
  </template>
22
22
  <template v-else>{{ text }}</template>
23
23
  </view>
@@ -3,9 +3,24 @@ import { makeBooleanProp, makeNumericProp, makeStringProp } from '../../common/p
3
3
  export type NumberKeyType = '' | 'delete' | 'extra' | 'close'
4
4
 
5
5
  export const keyProps = {
6
+ /**
7
+ * 按键类型
8
+ */
6
9
  type: makeStringProp<NumberKeyType>(''),
10
+ /**
11
+ * 按键显示文本
12
+ */
7
13
  text: makeNumericProp(''),
14
+ /**
15
+ * 是否为加宽按键
16
+ */
8
17
  wider: makeBooleanProp(false),
18
+ /**
19
+ * 是否为大号按键
20
+ */
9
21
  large: makeBooleanProp(false),
22
+ /**
23
+ * 是否显示加载状态
24
+ */
10
25
  loading: makeBooleanProp(false)
11
26
  }
@@ -3,6 +3,7 @@
3
3
  v-model="show"
4
4
  position="bottom"
5
5
  :z-index="zIndex"
6
+ :max-width="popupMaxWidth"
6
7
  :safe-area-inset-bottom="safeAreaInsetBottom"
7
8
  :modal-style="modal ? '' : 'opacity: 0;'"
8
9
  :modal="hideOnClickOutside"
@@ -33,6 +33,11 @@ export const keyboardProps = {
33
33
  * 层级
34
34
  */
35
35
  zIndex: makeNumberProp(100),
36
+ /**
37
+ * 弹层最大宽度,支持 `rpx`、`px`、`%` 等单位;
38
+ * `%` 在弹层打开时按屏幕宽度换算为 `rpx`
39
+ */
40
+ popupMaxWidth: makeStringProp('1200rpx'),
36
41
  /**
37
42
  * 最大长度
38
43
  */
@@ -48,10 +48,10 @@
48
48
  }
49
49
 
50
50
  &__prefix-icon:not(:empty) + &__content:not(:empty) {
51
- padding-left: 4px;
51
+ padding-left: 8rpx;
52
52
  }
53
53
 
54
54
  &__content:not(:empty) + &__suffix-icon:not(:empty) {
55
- padding-left: 4px;
55
+ padding-left: 8rpx;
56
56
  }
57
57
  }
@@ -28,8 +28,8 @@
28
28
  @refresherrestore="onRestore"
29
29
  @refresherabort="onAbort"
30
30
  >
31
- <view class="oxy-virtual-scroll__container" :style="{ height: totalHeight + 'px' }">
32
- <view class="oxy-virtual-scroll__items" :style="{ transform: `translateY(${virtualOffsetY}px)` }">
31
+ <view class="oxy-virtual-scroll__container" :style="{ height: unitConvert(totalHeight, 0, { output: 'px' }) }">
32
+ <view class="oxy-virtual-scroll__items" :style="{ transform: `translateY(${unitConvert(virtualOffsetY, 0, { output: 'px' })})` }">
33
33
  <view v-for="(item, index) in virtualData" :key="index">
34
34
  <slot name="item" :item="item" :index="startIndex + index"></slot>
35
35
  </view>
@@ -54,7 +54,7 @@
54
54
 
55
55
  <!-- 回到顶部按钮 -->
56
56
  <view v-if="showBackToTop && showBackTopBtn" class="oxy-virtual-scroll__back-top" @click="scrollToTop">
57
- <oxy-icon name="backtop" color="#fff" size="20px"></oxy-icon>
57
+ <oxy-icon name="backtop" color="#fff" size="40rpx"></oxy-icon>
58
58
  </view>
59
59
  </view>
60
60
  </template>
@@ -80,6 +80,7 @@ import type {
80
80
  ScrollViewOnScrollEvent
81
81
  } from '@uni-helper/uni-app-types/index'
82
82
  import { useVirtualScroll } from '../composables/useVirtualScroll'
83
+ import { unitConvert } from '../common/util'
83
84
 
84
85
  const props = defineProps(listProps)
85
86
 
@@ -19,7 +19,7 @@ export default {
19
19
  <script lang="ts" setup>
20
20
  import { computed, onBeforeMount, ref, watch, type CSSProperties } from 'vue'
21
21
  import base64 from '../common/base64'
22
- import { gradient, context, objToStyle, addUnit, isDef } from '../common/util'
22
+ import { withDefaultUnit, gradient, context, objToStyle, isDef } from '../common/util'
23
23
  import { loadingProps } from './types'
24
24
 
25
25
  const svgDefineId = context.id++
@@ -44,7 +44,11 @@ const iconSize = ref<string | number | null>(null)
44
44
  watch(
45
45
  () => props.size,
46
46
  (newVal) => {
47
- iconSize.value = addUnit(newVal)
47
+ if (!isDef(newVal) || newVal === '') {
48
+ iconSize.value = null
49
+ return
50
+ }
51
+ iconSize.value = withDefaultUnit(newVal)
48
52
  },
49
53
  {
50
54
  deep: true,
@@ -66,8 +70,8 @@ watch(
66
70
  const rootStyle = computed(() => {
67
71
  const style: CSSProperties = {}
68
72
  if (isDef(iconSize.value)) {
69
- style.height = addUnit(iconSize.value)
70
- style.width = addUnit(iconSize.value)
73
+ style.height = iconSize.value
74
+ style.width = iconSize.value
71
75
  }
72
76
  return `${objToStyle(style)} ${props.customStyle}`
73
77
  })
@@ -14,7 +14,7 @@ export const loadingProps = {
14
14
  */
15
15
  color: makeStringProp('#4D80F0'),
16
16
  /**
17
- * 设置加载指示器大小
17
+ * 设置加载指示器大小,number 类型按 `rpx` 语义处理
18
18
  */
19
19
  size: makeNumericProp('')
20
20
  }
@@ -15,7 +15,7 @@
15
15
 
16
16
  @include edeep(loading) {
17
17
  display: inline-block;
18
- margin-right: 8px;
18
+ margin-right: 16rpx;
19
19
  vertical-align: middle;
20
20
  width: $-loadmore-loading-size;
21
21
  height: $-loadmore-loading-size;
@@ -26,7 +26,7 @@
26
26
  vertical-align: middle;
27
27
 
28
28
  @include when(light) {
29
- margin: 0 6px;
29
+ margin: 0 12rpx;
30
30
  color: $-loadmore-error-color;
31
31
  }
32
32
  }
@@ -36,4 +36,4 @@
36
36
  vertical-align: middle;
37
37
  font-size: $-loadmore-refresh-fs;
38
38
  }
39
- }
39
+ }
@@ -0,0 +1,93 @@
1
+ @import './../common/abstracts/_mixin.scss';
2
+ @import './../common/abstracts/variable.scss';
3
+
4
+ @include b(long-press-menu) {
5
+ position: relative;
6
+ display: inline-block; /* 让容器适应内容宽度 */
7
+ user-select: none;
8
+ -webkit-user-select: none;
9
+
10
+ @include e(trigger) {
11
+ position: relative;
12
+ transition: background-color 0.2s;
13
+ border-radius: $-long-press-menu-radius;
14
+ /* 默认为 inline-block,减少空白占据 */
15
+ display: inline-block;
16
+ width: 100%;
17
+
18
+ @include when(active) {
19
+ background-color: $-long-press-menu-active-bg; /* 长按时的高亮背景 */
20
+ }
21
+ }
22
+
23
+ @include e(mask) {
24
+ position: fixed;
25
+ top: 0;
26
+ left: 0;
27
+ right: 0;
28
+ bottom: 0;
29
+ z-index: 998;
30
+ background-color: transparent; /* 透明遮罩,点击关闭 */
31
+ }
32
+
33
+ @include e(popover) {
34
+ position: fixed;
35
+ z-index: $-long-press-menu-z-index;
36
+ background-color: $-long-press-menu-bg;
37
+ border-radius: $-long-press-menu-radius;
38
+ padding: $-long-press-menu-padding;
39
+ min-width: 200rpx;
40
+ }
41
+
42
+ @include e(content) {
43
+ display: flex;
44
+ align-items: center;
45
+ flex-wrap: nowrap;
46
+ }
47
+
48
+ @include e(item) {
49
+ padding: $-long-press-menu-item-padding;
50
+ position: relative;
51
+ &:not(:last-child)::after {
52
+ content: '';
53
+ position: absolute;
54
+ right: 0;
55
+ top: 24rpx;
56
+ bottom: 24rpx;
57
+ width: 1px;
58
+ background-color: $-long-press-menu-divider-color;
59
+ }
60
+ }
61
+
62
+ @include e(text) {
63
+ color: $-long-press-menu-color;
64
+ font-size: $-long-press-menu-fs;
65
+ white-space: nowrap;
66
+ }
67
+
68
+ @include e(arrow) {
69
+ left: 24rpx;
70
+ }
71
+ @include triangleArrow($-long-press-menu-arrow-size, $-long-press-menu-bg);
72
+
73
+ @include when(selectable) {
74
+ /* 移除 user-select,改为控制 trigger */
75
+ .oxy-long-press-menu__trigger {
76
+ user-select: text;
77
+ -webkit-user-select: text;
78
+ -webkit-touch-callout: none; /* 禁用系统默认长按菜单 */
79
+ cursor: text;
80
+ }
81
+ }
82
+ }
83
+
84
+ @keyframes fadeIn {
85
+ from {
86
+ opacity: 0;
87
+ transform: translateX(-50%) scale(0.9);
88
+ }
89
+ to {
90
+ opacity: 1;
91
+ transform: translateX(-50%) scale(1);
92
+ }
93
+ }