oxy-uni-ui 1.2.0 → 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 (306) hide show
  1. package/attributes.json +1 -1
  2. package/components/common/abstracts/variable.scss +396 -321
  3. package/components/common/path.ts +9 -0
  4. package/components/common/util.ts +200 -5
  5. package/components/composables/index.ts +1 -0
  6. package/components/composables/useGlobalLoading.ts +42 -0
  7. package/components/composables/useGlobalMessage.ts +48 -0
  8. package/components/composables/useGlobalToast.ts +84 -0
  9. package/components/composables/usePopover.ts +24 -20
  10. package/components/composables/useVirtualScroll.ts +13 -11
  11. package/components/composables/useWindowResize.ts +35 -0
  12. package/components/oxy-action-sheet/index.scss +24 -11
  13. package/components/oxy-action-sheet/oxy-action-sheet.vue +27 -19
  14. package/components/oxy-action-sheet/types.ts +7 -0
  15. package/components/oxy-backtop/index.scss +3 -3
  16. package/components/oxy-backtop/oxy-backtop.vue +9 -6
  17. package/components/oxy-backtop/types.ts +7 -7
  18. package/components/oxy-badge/index.scss +4 -4
  19. package/components/oxy-badge/oxy-badge.vue +3 -3
  20. package/components/oxy-badge/types.ts +2 -2
  21. package/components/oxy-button/index.scss +5 -5
  22. package/components/oxy-button/oxy-button.vue +5 -1
  23. package/components/oxy-calendar/index.scss +11 -11
  24. package/components/oxy-calendar/oxy-calendar.vue +1 -0
  25. package/components/oxy-calendar/types.ts +5 -0
  26. package/components/oxy-calendar-view/month/index.scss +4 -4
  27. package/components/oxy-calendar-view/month/types.ts +36 -0
  28. package/components/oxy-calendar-view/monthPanel/index.scss +7 -7
  29. package/components/oxy-calendar-view/monthPanel/month-panel.vue +14 -8
  30. package/components/oxy-calendar-view/year/index.scss +4 -4
  31. package/components/oxy-calendar-view/yearPanel/index.scss +4 -4
  32. package/components/oxy-calendar-view/yearPanel/year-panel.vue +21 -5
  33. package/components/oxy-card/index.scss +2 -2
  34. package/components/oxy-cell/index.scss +8 -8
  35. package/components/oxy-cell/oxy-cell.vue +15 -2
  36. package/components/oxy-cell/types.ts +4 -0
  37. package/components/oxy-checkbox/index.scss +8 -8
  38. package/components/oxy-checkbox/oxy-checkbox.vue +2 -2
  39. package/components/oxy-checkbox-group/index.scss +2 -2
  40. package/components/oxy-circle/oxy-circle.vue +10 -7
  41. package/components/oxy-circle/types.ts +5 -5
  42. package/components/oxy-col/oxy-col.vue +2 -2
  43. package/components/oxy-col-picker/index.scss +4 -4
  44. package/components/oxy-col-picker/oxy-col-picker.vue +9 -5
  45. package/components/oxy-col-picker/types.ts +12 -3
  46. package/components/oxy-collapse/index.scss +2 -2
  47. package/components/oxy-collapse-item/oxy-collapse-item.vue +3 -3
  48. package/components/oxy-corner/index.scss +32 -32
  49. package/components/oxy-corner/oxy-corner.vue +15 -3
  50. package/components/oxy-corner/types.ts +15 -1
  51. package/components/oxy-count-to/oxy-count-to.vue +3 -3
  52. package/components/oxy-curtain/index.scss +15 -15
  53. package/components/oxy-curtain/oxy-curtain.vue +4 -2
  54. package/components/oxy-curtain/types.ts +6 -1
  55. package/components/oxy-date-strip/index.scss +10 -0
  56. package/components/oxy-date-strip/oxy-date-strip.vue +198 -0
  57. package/components/oxy-date-strip/types.ts +98 -0
  58. package/components/oxy-date-strip/utils.ts +67 -0
  59. package/components/oxy-date-strip-item/index.scss +94 -0
  60. package/components/oxy-date-strip-item/oxy-date-strip-item.vue +102 -0
  61. package/components/oxy-date-strip-item/types.ts +53 -0
  62. package/components/oxy-datetime-picker/index.scss +11 -11
  63. package/components/oxy-datetime-picker/oxy-datetime-picker.vue +4 -1
  64. package/components/oxy-datetime-picker/types.ts +10 -1
  65. package/components/oxy-drop-menu/index.scss +3 -3
  66. package/components/oxy-drop-menu/oxy-drop-menu.vue +3 -3
  67. package/components/oxy-drop-menu-item/index.scss +1 -1
  68. package/components/oxy-drop-menu-item/oxy-drop-menu-item.vue +4 -3
  69. package/components/oxy-drop-menu-item/types.ts +5 -0
  70. package/components/oxy-echarts/index.scss +17 -0
  71. package/components/oxy-echarts/index.ts +1 -0
  72. package/components/oxy-echarts/oxy-echarts.vue +32 -0
  73. package/components/oxy-echarts/types.ts +18 -0
  74. package/components/oxy-fab/index.scss +8 -8
  75. package/components/oxy-fab/oxy-fab.vue +22 -3
  76. package/components/oxy-file-list/index.scss +42 -15
  77. package/components/oxy-file-list/oxy-file-list.vue +208 -34
  78. package/components/oxy-file-list/types.ts +58 -2
  79. package/components/oxy-floating-panel/oxy-floating-panel.vue +13 -9
  80. package/components/oxy-floating-panel/{type.ts → types.ts} +8 -8
  81. package/components/oxy-footer/index.scss +19 -0
  82. package/components/oxy-footer/oxy-footer.vue +78 -0
  83. package/components/oxy-footer/types.ts +17 -0
  84. package/components/oxy-form-item/types.ts +22 -1
  85. package/components/oxy-gap/oxy-gap.vue +2 -2
  86. package/components/oxy-gap/types.ts +2 -2
  87. package/components/oxy-global-loading/oxy-global-loading.vue +53 -0
  88. package/components/oxy-global-message/oxy-global-message.vue +64 -0
  89. package/components/oxy-global-toast/oxy-global-toast.vue +53 -0
  90. package/components/oxy-grid/oxy-grid.vue +1 -1
  91. package/components/oxy-grid/types.ts +1 -1
  92. package/components/oxy-grid-item/index.scss +1 -1
  93. package/components/oxy-grid-item/oxy-grid-item.vue +7 -5
  94. package/components/oxy-grid-item/types.ts +1 -1
  95. package/components/oxy-guidance/index.scss +75 -0
  96. package/components/oxy-guidance/oxy-guidance.vue +201 -0
  97. package/components/oxy-guidance/types.ts +33 -0
  98. package/components/oxy-icon/oxy-icon.vue +2 -2
  99. package/components/oxy-icon/types.ts +1 -1
  100. package/components/oxy-img/oxy-img.vue +4 -4
  101. package/components/oxy-img/types.ts +3 -3
  102. package/components/oxy-img-cropper/index.scss +12 -12
  103. package/components/oxy-img-cropper/oxy-img-cropper.vue +97 -52
  104. package/components/oxy-img-cropper/types.ts +2 -2
  105. package/components/oxy-img-lazy/index.scss +17 -0
  106. package/components/oxy-img-lazy/oxy-img-lazy.vue +332 -0
  107. package/components/oxy-img-lazy/types.ts +69 -0
  108. package/components/oxy-index-anchor/index.scss +2 -2
  109. package/components/oxy-index-anchor/oxy-index-anchor.vue +2 -2
  110. package/components/oxy-index-anchor/{type.ts → types.ts} +3 -0
  111. package/components/oxy-index-bar/index.scss +3 -3
  112. package/components/oxy-index-bar/oxy-index-bar.vue +3 -3
  113. package/components/oxy-index-bar/{type.ts → types.ts} +2 -2
  114. package/components/oxy-input/index.scss +1 -1
  115. package/components/oxy-input-number/index.scss +5 -5
  116. package/components/oxy-input-number/oxy-input-number.vue +2 -2
  117. package/components/oxy-input-number/types.ts +3 -2
  118. package/components/oxy-keyboard/index.scss +5 -5
  119. package/components/oxy-keyboard/key/index.scss +3 -3
  120. package/components/oxy-keyboard/key/index.vue +2 -2
  121. package/components/oxy-keyboard/key/types.ts +15 -0
  122. package/components/oxy-keyboard/oxy-keyboard.vue +1 -0
  123. package/components/oxy-keyboard/types.ts +5 -0
  124. package/components/oxy-link/index.scss +57 -0
  125. package/components/oxy-link/oxy-link.vue +130 -0
  126. package/components/oxy-link/types.ts +81 -0
  127. package/components/oxy-list/index.scss +7 -1
  128. package/components/oxy-list/oxy-list.vue +4 -3
  129. package/components/oxy-list/types.ts +1 -1
  130. package/components/oxy-loading/oxy-loading.vue +8 -4
  131. package/components/oxy-loading/types.ts +1 -1
  132. package/components/oxy-loadmore/index.scss +3 -3
  133. package/components/oxy-long-press-menu/index.scss +93 -0
  134. package/components/oxy-long-press-menu/oxy-long-press-menu.vue +338 -0
  135. package/components/oxy-long-press-menu/types.ts +34 -0
  136. package/components/oxy-message-box/index.scss +12 -11
  137. package/components/oxy-message-box/oxy-message-box.vue +11 -3
  138. package/components/oxy-message-box/types.ts +14 -0
  139. package/components/oxy-navbar/index.scss +2 -2
  140. package/components/oxy-navbar/oxy-navbar.vue +58 -13
  141. package/components/oxy-navbar/types.ts +8 -1
  142. package/components/oxy-navbar-capsule/types.ts +3 -0
  143. package/components/oxy-notice-bar/index.scss +3 -3
  144. package/components/oxy-notice-bar/oxy-notice-bar.vue +9 -5
  145. package/components/oxy-notice-bar/types.ts +3 -3
  146. package/components/oxy-notify/index.ts +1 -0
  147. package/components/oxy-notify/oxy-notify.vue +3 -2
  148. package/components/oxy-notify/types.ts +7 -0
  149. package/components/oxy-pagination/index.scss +1 -1
  150. package/components/oxy-password-input/oxy-password-input.vue +2 -2
  151. package/components/oxy-password-input/types.ts +1 -1
  152. package/components/oxy-picker/index.scss +45 -2
  153. package/components/oxy-picker/oxy-picker.vue +103 -14
  154. package/components/oxy-picker/types.ts +33 -1
  155. package/components/oxy-picker-view/index.scss +3 -3
  156. package/components/oxy-picker-view/oxy-picker-view.vue +4 -4
  157. package/components/oxy-popover/index.scss +9 -9
  158. package/components/oxy-popup/index.scss +2 -2
  159. package/components/oxy-popup/oxy-popup.vue +35 -2
  160. package/components/oxy-popup/types.ts +8 -1
  161. package/components/oxy-progress/index.scss +3 -3
  162. package/components/oxy-qrcode/draw.ts +398 -0
  163. package/components/oxy-qrcode/index.scss +2 -0
  164. package/components/oxy-qrcode/oxy-qrcode.vue +124 -0
  165. package/components/oxy-qrcode/qrcode.ts +936 -0
  166. package/components/oxy-qrcode/types.ts +42 -0
  167. package/components/oxy-radio/index.scss +13 -13
  168. package/components/oxy-radio/oxy-radio.vue +1 -1
  169. package/components/oxy-radio-group/index.scss +2 -2
  170. package/components/oxy-rate/types.ts +4 -4
  171. package/components/oxy-resize/index.scss +2 -2
  172. package/components/oxy-resize/oxy-resize.vue +4 -4
  173. package/components/oxy-resize/types.ts +3 -0
  174. package/components/oxy-rich-text/icon/emjio.svg +1 -0
  175. package/components/oxy-rich-text/icon/quote.svg +1 -0
  176. package/components/oxy-rich-text/icon/text.svg +1 -0
  177. package/components/oxy-rich-text/icon/title.svg +1 -0
  178. package/components/oxy-rich-text/index.scss +160 -0
  179. package/components/oxy-rich-text/mp-html/card/card.vue +122 -0
  180. package/components/oxy-rich-text/mp-html/card/index.js +7 -0
  181. package/components/oxy-rich-text/mp-html/editable/config.js +15 -0
  182. package/components/oxy-rich-text/mp-html/editable/index.js +553 -0
  183. package/components/oxy-rich-text/mp-html/emoji/index.js +203 -0
  184. package/components/oxy-rich-text/mp-html/highlight/config.js +5 -0
  185. package/components/oxy-rich-text/mp-html/highlight/index.js +96 -0
  186. package/components/oxy-rich-text/mp-html/highlight/prism.css +1 -0
  187. package/components/oxy-rich-text/mp-html/highlight/prism.min.js +7 -0
  188. package/components/oxy-rich-text/mp-html/img-cache/index.js +138 -0
  189. package/components/oxy-rich-text/mp-html/latex/index.js +80 -0
  190. package/components/oxy-rich-text/mp-html/latex/katex.css +1 -0
  191. package/components/oxy-rich-text/mp-html/latex/katex.min.js +1 -0
  192. package/components/oxy-rich-text/mp-html/markdown/index.js +50 -0
  193. package/components/oxy-rich-text/mp-html/markdown/marked.min.js +71 -0
  194. package/components/oxy-rich-text/mp-html/mp-html.d.ts +184 -0
  195. package/components/oxy-rich-text/mp-html/mp-html.vue +684 -0
  196. package/components/oxy-rich-text/mp-html/node/node.vue +1172 -0
  197. package/components/oxy-rich-text/mp-html/parser.js +1428 -0
  198. package/components/oxy-rich-text/mp-html/search/index.js +132 -0
  199. package/components/oxy-rich-text/mp-html/style/index.js +129 -0
  200. package/components/oxy-rich-text/mp-html/style/parser.js +175 -0
  201. package/components/oxy-rich-text/mp-html/template/index.js +67 -0
  202. package/components/oxy-rich-text/mp-html/txv-video/index.js +46 -0
  203. package/components/oxy-rich-text/oxy-rich-text.vue +642 -0
  204. package/components/oxy-rich-text/types.ts +76 -0
  205. package/components/oxy-row/oxy-row.vue +3 -3
  206. package/components/oxy-row/types.ts +1 -1
  207. package/components/oxy-search/index.scss +3 -3
  208. package/components/oxy-segmented/index.scss +16 -16
  209. package/components/oxy-segmented/oxy-segmented.vue +23 -3
  210. package/components/oxy-select/index.scss +331 -0
  211. package/components/oxy-select/oxy-select.vue +456 -0
  212. package/components/oxy-select/types.ts +83 -0
  213. package/components/oxy-select-picker/index.scss +7 -7
  214. package/components/oxy-select-picker/oxy-select-picker.vue +4 -0
  215. package/components/oxy-select-picker/types.ts +7 -1
  216. package/components/oxy-sidebar-item/index.scss +1 -1
  217. package/components/oxy-signature/oxy-signature.vue +18 -10
  218. package/components/oxy-signature/types.ts +106 -13
  219. package/components/oxy-skeleton/oxy-skeleton.vue +6 -6
  220. package/components/oxy-skeleton/types.ts +1 -1
  221. package/components/oxy-slider/index.scss +3 -3
  222. package/components/oxy-sort-button/index.scss +8 -8
  223. package/components/oxy-status-tip/index.scss +4 -4
  224. package/components/oxy-status-tip/oxy-status-tip.vue +5 -5
  225. package/components/oxy-status-tip/types.ts +3 -3
  226. package/components/oxy-step/index.scss +14 -14
  227. package/components/oxy-sticky/oxy-sticky.vue +6 -6
  228. package/components/oxy-stream-render/index.scss +6 -0
  229. package/components/oxy-stream-render/oxy-stream-render.vue +204 -0
  230. package/components/oxy-stream-render/types.ts +8 -0
  231. package/components/oxy-swipe-action/oxy-swipe-action.vue +27 -2
  232. package/components/oxy-swiper/oxy-swiper.vue +6 -6
  233. package/components/oxy-swiper/types.ts +5 -5
  234. package/components/oxy-switch/index.scss +8 -8
  235. package/components/oxy-switch/oxy-switch.vue +2 -2
  236. package/components/oxy-switch/types.ts +1 -1
  237. package/components/oxy-tab/index.scss +11 -1
  238. package/components/oxy-tabbar/index.scss +1 -1
  239. package/components/oxy-tabbar/oxy-tabbar.vue +39 -10
  240. package/components/oxy-table/index.scss +5 -5
  241. package/components/oxy-table/oxy-table.vue +8 -6
  242. package/components/oxy-table/types.ts +2 -2
  243. package/components/oxy-table-col/oxy-table-col.vue +3 -3
  244. package/components/oxy-table-col/types.ts +2 -2
  245. package/components/oxy-tabs/index.scss +43 -15
  246. package/components/oxy-tabs/oxy-tabs.vue +53 -19
  247. package/components/oxy-tabs/types.ts +15 -3
  248. package/components/oxy-tag/index.scss +15 -15
  249. package/components/oxy-text/index.scss +5 -1
  250. package/components/oxy-text/oxy-text.vue +76 -7
  251. package/components/oxy-text/types.ts +12 -0
  252. package/components/oxy-textarea/index.scss +6 -6
  253. package/components/oxy-toast/oxy-toast.vue +24 -8
  254. package/components/oxy-tooltip/index.scss +9 -9
  255. package/components/oxy-tree/index.scss +61 -9
  256. package/components/oxy-tree/oxy-tree.vue +102 -17
  257. package/components/oxy-tree/types.ts +23 -10
  258. package/components/oxy-upload/index.scss +21 -21
  259. package/components/oxy-upload/types.ts +2 -2
  260. package/components/oxy-verification-code/index.scss +6 -0
  261. package/components/oxy-verification-code/oxy-verification-code.vue +187 -0
  262. package/components/oxy-verification-code/types.ts +82 -0
  263. package/components/oxy-video-preview/index.scss +4 -4
  264. package/components/oxy-virtual-scroll/index.scss +4 -4
  265. package/components/oxy-virtual-scroll/oxy-virtual-scroll.vue +11 -7
  266. package/components/oxy-virtual-scroll/types.ts +14 -14
  267. package/components/oxy-voice-player/index.scss +908 -0
  268. package/components/oxy-voice-player/oxy-voice-player.vue +821 -0
  269. package/components/oxy-voice-player/types.ts +567 -0
  270. package/components/oxy-waterfall/index.scss +18 -0
  271. package/components/oxy-waterfall/oxy-waterfall.vue +218 -0
  272. package/components/oxy-waterfall/types.ts +90 -0
  273. package/components/oxy-waterfall-item/index.scss +8 -0
  274. package/components/oxy-waterfall-item/oxy-waterfall-item.vue +89 -0
  275. package/components/oxy-waterfall-item/types.ts +16 -0
  276. package/components/oxy-watermark/oxy-watermark.vue +35 -13
  277. package/components/oxy-watermark/types.ts +14 -14
  278. package/global.d.ts +9 -0
  279. package/index.ts +3 -0
  280. package/locale/lang/ar-SA.ts +3 -0
  281. package/locale/lang/en-US.ts +29 -0
  282. package/locale/lang/zh-CN.ts +29 -0
  283. package/package.json +97 -1
  284. package/tags.json +1 -1
  285. package/uni-echarts/changelog.md +2 -0
  286. package/uni-echarts/components/index.js +1 -0
  287. package/uni-echarts/components/uni-echarts/events.js +95 -0
  288. package/uni-echarts/components/uni-echarts/types.d.ts +183 -0
  289. package/uni-echarts/components/uni-echarts/types.js +1 -0
  290. package/uni-echarts/components/uni-echarts/uni-echarts.vue +530 -0
  291. package/uni-echarts/components/uni-echarts/uni-echarts.vue.d.ts +19 -0
  292. package/uni-echarts/global.d.ts +7 -0
  293. package/uni-echarts/index.d.ts +440 -0
  294. package/uni-echarts/index.js +2 -0
  295. package/uni-echarts/package.json +105 -0
  296. package/uni-echarts/shared-core.d.ts +269 -0
  297. package/uni-echarts/shared-core.js +900 -0
  298. package/web-types.json +1 -1
  299. package/components/oxy-number-keyboard/index.scss +0 -78
  300. package/components/oxy-number-keyboard/key/index.scss +0 -81
  301. package/components/oxy-number-keyboard/key/index.vue +0 -78
  302. package/components/oxy-number-keyboard/key/types.ts +0 -11
  303. package/components/oxy-number-keyboard/oxy-number-keyboard.vue +0 -151
  304. package/components/oxy-number-keyboard/types.ts +0 -83
  305. package/components/oxy-tree/components/tree-node-content.vue +0 -72
  306. package/components/oxy-tree/index.ts +0 -51
@@ -8,7 +8,7 @@
8
8
  </view>
9
9
  <scroll-view
10
10
  :class="`oxy-month-panel__container ${!!timeType ? 'oxy-month-panel__container--time' : ''}`"
11
- :style="`height: ${scrollHeight}px`"
11
+ :style="`height: ${unitConvert(scrollHeight, 0, { output: 'px' })}`"
12
12
  scroll-y
13
13
  @scroll="monthScroll"
14
14
  :scroll-top="scrollTop"
@@ -64,7 +64,7 @@ export default {
64
64
  <script lang="ts" setup>
65
65
  import OxyPickerView from '../../oxy-picker-view/oxy-picker-view.vue'
66
66
  import { computed, ref, watch, onMounted } from 'vue'
67
- import { debounce, isArray, isEqual, isNumber, pause } from '../../common/util'
67
+ import { debounce, isArray, isEqual, isNumber, pause, unitConvert } from '../../common/util'
68
68
  import { compareMonth, formatMonthTitle, getMonthEndDay, getMonths, getTimeData, getWeekLabel } from '../utils'
69
69
  import Month from '../month/month.vue'
70
70
  import { monthPanelProps, type MonthInfo, type MonthPanelTimeType, type MonthPanelExpose } from './types'
@@ -83,6 +83,12 @@ const timeValue = ref<number[]>([]) // 当前选中的时分秒
83
83
  const timeType = ref<MonthPanelTimeType>('') // 当前时间类型,是开始还是结束
84
84
  const innerValue = ref<string | number | (number | null)[]>('') // 内部保存一个值,用于判断新老值,避免监听器触发
85
85
 
86
+ const designPxToRuntimePx = (designPx: number): number => unitConvert(`${designPx * 2}rpx`)
87
+ const MONTH_ROW_HEIGHT = designPxToRuntimePx(64)
88
+ const MONTH_ROW_GAP = designPxToRuntimePx(4)
89
+ const MONTH_TITLE_HEIGHT = designPxToRuntimePx(45)
90
+ const TIME_PICKER_HEIGHT = designPxToRuntimePx(125)
91
+
86
92
  const handleChange = debounce((value) => {
87
93
  emit('change', {
88
94
  value
@@ -132,7 +138,8 @@ const weekLabel = computed(() => {
132
138
 
133
139
  // 滚动区域的高度
134
140
  const scrollHeight = computed(() => {
135
- const scrollHeight: number = timeType.value ? props.panelHeight - 125 : props.panelHeight
141
+ const panelHeight = designPxToRuntimePx(props.panelHeight)
142
+ const scrollHeight: number = timeType.value ? panelHeight - TIME_PICKER_HEIGHT : panelHeight
136
143
  return scrollHeight
137
144
  })
138
145
 
@@ -143,7 +150,7 @@ const months = computed<MonthInfo[]>(() => {
143
150
  const totalDay = getMonthEndDay(new Date(month).getFullYear(), new Date(month).getMonth() + 1)
144
151
  const rows = Math.ceil((offset + totalDay) / 7)
145
152
  return {
146
- height: rows * 64 + (rows - 1) * 4 + (index === 0 ? 0 : 45), // 每行64px高度,除最后一行外每行加4px margin,加上标题45px
153
+ height: rows * MONTH_ROW_HEIGHT + (rows - 1) * MONTH_ROW_GAP + (index === 0 ? 0 : MONTH_TITLE_HEIGHT),
147
154
  date: month
148
155
  }
149
156
  })
@@ -214,8 +221,8 @@ async function scrollIntoView() {
214
221
  const firstDay = new Date(date.getFullYear(), date.getMonth(), 1)
215
222
  const offset = (7 + firstDay.getDay() - props.firstDayOfWeek) % 7
216
223
  const row = Math.floor((offset + day - 1) / 7)
217
- // 每行高度64px,每行加4px margin
218
- top += row * 64 + row * 4
224
+ // 每行高度与行间距按 rpx 基线换算为运行时 px
225
+ top += row * (MONTH_ROW_HEIGHT + MONTH_ROW_GAP)
219
226
  break
220
227
  }
221
228
  top += months.value[index] ? Number(months.value[index].height) : 0
@@ -223,8 +230,7 @@ async function scrollIntoView() {
223
230
  scrollTop.value = 0
224
231
  if (top > 0) {
225
232
  await pause()
226
- // 如果不是第一个月才加45
227
- scrollTop.value = top + (activeMonthIndex > 0 ? 45 : 0)
233
+ scrollTop.value = top + (activeMonthIndex > 0 ? MONTH_TITLE_HEIGHT : 0)
228
234
  }
229
235
  }
230
236
  /**
@@ -27,7 +27,7 @@
27
27
  display: flex;
28
28
  align-items: center;
29
29
  justify-content: center;
30
- height: 45px;
30
+ height: 90rpx;
31
31
  font-size: $-calendar-panel-title-fs;
32
32
  color: $-calendar-panel-title-color;
33
33
  }
@@ -133,7 +133,7 @@
133
133
 
134
134
  @include e(month-top) {
135
135
  position: absolute;
136
- top: 10px;
136
+ top: 20rpx;
137
137
  left: 0;
138
138
  right: 0;
139
139
  line-height: 1.1;
@@ -143,11 +143,11 @@
143
143
 
144
144
  @include e(month-bottom) {
145
145
  position: absolute;
146
- bottom: 10px;
146
+ bottom: 20rpx;
147
147
  left: 0;
148
148
  right: 0;
149
149
  line-height: 1.1;
150
150
  font-size: $-calendar-info-fs;
151
151
  text-align: center;
152
152
  }
153
- }
153
+ }
@@ -5,7 +5,7 @@
5
5
  @include b(year-panel) {
6
6
  @include e(title) {
7
7
  color: $-dark-color;
8
- box-shadow: 0px 4px 8px 0 rgba(255, 255,255, 0.02);
8
+ box-shadow: 0 8rpx 16rpx 0 rgba(255, 255,255, 0.02);
9
9
  }
10
10
  }
11
11
  }
@@ -15,10 +15,10 @@
15
15
  padding: $-calendar-panel-padding;
16
16
 
17
17
  @include e(title) {
18
- padding: 5px 0;
18
+ padding: 10rpx 0;
19
19
  text-align: center;
20
20
  font-size: $-calendar-panel-title-fs;
21
21
  color: $-calendar-panel-title-color;
22
- box-shadow: 0px 4px 8px 0 rgba(0, 0, 0, 0.02);
22
+ box-shadow: 0 8rpx 16rpx 0 rgba(0, 0, 0, 0.02);
23
23
  }
24
- }
24
+ }
@@ -1,7 +1,13 @@
1
1
  <template>
2
2
  <view class="oxy-year-panel">
3
3
  <view v-if="showPanelTitle" class="oxy-year-panel__title">{{ title }}</view>
4
- <scroll-view class="oxy-year-panel__container" :style="`height: ${scrollHeight}px`" scroll-y @scroll="yearScroll" :scroll-top="scrollTop">
4
+ <scroll-view
5
+ class="oxy-year-panel__container"
6
+ :style="`height: ${unitConvert(scrollHeight, 0, { output: 'px' })}`"
7
+ scroll-y
8
+ @scroll="yearScroll"
9
+ :scroll-top="scrollTop"
10
+ >
5
11
  <view v-for="(item, index) in years" :key="index" :id="`year${index}`">
6
12
  <year
7
13
  :type="type"
@@ -34,7 +40,7 @@ export default {
34
40
  <script lang="ts" setup>
35
41
  import { computed, ref, onMounted } from 'vue'
36
42
  import { compareYear, formatYearTitle, getYears } from '../utils'
37
- import { isArray, isNumber, pause } from '../../common/util'
43
+ import { isArray, isNumber, pause, unitConvert } from '../../common/util'
38
44
  import Year from '../year/year.vue'
39
45
  import { yearPanelProps, type YearInfo, type YearPanelExpose } from './types'
40
46
 
@@ -44,9 +50,19 @@ const emit = defineEmits(['change'])
44
50
  const scrollTop = ref<number>(0) // 滚动位置
45
51
  const scrollIndex = ref<number>(0) // 当前显示的年份索引
46
52
 
53
+ const designPxToRuntimePx = (designPx: number): number => unitConvert(`${designPx * 2}rpx`)
54
+ const YEAR_MONTH_HEIGHT = designPxToRuntimePx(64)
55
+ const YEAR_MONTH_GAP = designPxToRuntimePx(4)
56
+ const YEAR_TITLE_HEIGHT = designPxToRuntimePx(45)
57
+ const PANEL_EXTRA_WITH_TITLE = designPxToRuntimePx(26)
58
+ const PANEL_EXTRA_NO_TITLE = designPxToRuntimePx(16)
59
+ const YEAR_HEIGHT_WITHOUT_TITLE = YEAR_MONTH_HEIGHT * 3 + YEAR_MONTH_GAP * 2
60
+ const YEAR_HEIGHT_WITH_TITLE = YEAR_HEIGHT_WITHOUT_TITLE + YEAR_TITLE_HEIGHT
61
+
47
62
  // 滚动区域的高度
48
63
  const scrollHeight = computed(() => {
49
- const scrollHeight: number = props.panelHeight + (props.showPanelTitle ? 26 : 16)
64
+ const panelHeight = designPxToRuntimePx(props.panelHeight)
65
+ const scrollHeight: number = panelHeight + (props.showPanelTitle ? PANEL_EXTRA_WITH_TITLE : PANEL_EXTRA_NO_TITLE)
50
66
  return scrollHeight
51
67
  })
52
68
 
@@ -55,7 +71,7 @@ const years = computed<YearInfo[]>(() => {
55
71
  return getYears(props.minDate, props.maxDate).map((year, index) => {
56
72
  return {
57
73
  date: year,
58
- height: index === 0 ? 200 : 245
74
+ height: index === 0 ? YEAR_HEIGHT_WITHOUT_TITLE : YEAR_HEIGHT_WITH_TITLE
59
75
  }
60
76
  })
61
77
  })
@@ -92,7 +108,7 @@ async function scrollIntoView() {
92
108
  scrollTop.value = 0
93
109
  if (top > 0) {
94
110
  await pause()
95
- scrollTop.value = top + 45
111
+ scrollTop.value = top + YEAR_TITLE_HEIGHT
96
112
  }
97
113
  }
98
114
 
@@ -31,7 +31,7 @@
31
31
  border-radius: $-card-radius;
32
32
  box-shadow: $-card-shadow-color;
33
33
  font-size: $-card-fs;
34
- margin-bottom: 12px;
34
+ margin-bottom: 24rpx;
35
35
 
36
36
  @include when(rectangle) {
37
37
  margin-left: 0;
@@ -56,7 +56,7 @@
56
56
  }
57
57
  }
58
58
  @include e(title-content) {
59
- padding: 16px 0;
59
+ padding: 32rpx 0;
60
60
  color: $-card-title-color;
61
61
  font-size: $-card-title-fs;
62
62
  }
@@ -40,7 +40,7 @@
40
40
  -webkit-tap-highlight-color: transparent;
41
41
  box-sizing: border-box;
42
42
  width: 100%;
43
- overflow: hidden;
43
+ // overflow: hidden;
44
44
 
45
45
  @include when(border) {
46
46
  .oxy-cell__wrapper {
@@ -54,7 +54,7 @@
54
54
  padding: $-cell-wrapper-padding $-cell-padding $-cell-wrapper-padding 0;
55
55
  justify-content: space-between;
56
56
  align-items: flex-start;
57
- overflow: hidden;
57
+ // overflow: hidden;
58
58
 
59
59
  @include when(vertical) {
60
60
  display: block;
@@ -109,7 +109,7 @@
109
109
  }
110
110
 
111
111
  @include e(label) {
112
- margin-top: 2px;
112
+ margin-top: 4rpx;
113
113
  font-size: $-cell-label-fs;
114
114
  color: $-cell-label-color;
115
115
  }
@@ -134,15 +134,15 @@
134
134
  font-size: $-cell-value-fs;
135
135
  color: $-cell-value-color;
136
136
  vertical-align: middle;
137
-
137
+
138
138
  @include m(left) {
139
139
  text-align: left;
140
140
  }
141
-
141
+
142
142
  @include m(right) {
143
143
  text-align: right;
144
144
  }
145
-
145
+
146
146
  @include m(ellipsis) {
147
147
  @include lineEllipsis;
148
148
  min-width: 0;
@@ -151,7 +151,7 @@
151
151
 
152
152
  @include edeep(arrow-right) {
153
153
  display: block;
154
- margin-left: 8px;
154
+ margin-left: 16rpx;
155
155
  width: $-cell-arrow-size;
156
156
  font-size: $-cell-arrow-size;
157
157
  color: $-cell-arrow-color;
@@ -203,4 +203,4 @@
203
203
  align-items: center;
204
204
  }
205
205
  }
206
- }
206
+ }
@@ -7,7 +7,7 @@
7
7
  @click="onClick"
8
8
  >
9
9
  <view :class="['oxy-cell__wrapper', vertical ? 'is-vertical' : '']">
10
- <view v-if="showLeft" class="oxy-cell__left" :style="titleWidth ? 'min-width:' + titleWidth + ';max-width:' + titleWidth + ';' : ''">
10
+ <view v-if="showLeft" class="oxy-cell__left" :style="leftStyle">
11
11
  <text v-if="isRequired && markerSide === 'before'" class="oxy-cell__required oxy-cell__required--left">*</text>
12
12
  <!--左侧icon部位-->
13
13
  <slot name="icon">
@@ -65,7 +65,7 @@ import { useCell } from '../composables/useCell'
65
65
  import { useParent } from '../composables/useParent'
66
66
  import { FORM_KEY } from '../oxy-form/types'
67
67
  import { cellProps } from './types'
68
- import { isDef } from '../common/util'
68
+ import { isDef, objToStyle } from '../common/util'
69
69
 
70
70
  const props = defineProps(cellProps)
71
71
  const emit = defineEmits(['click'])
@@ -116,6 +116,19 @@ const showLeft = computed(() => {
116
116
  return hasIcon || hasTitle || hasLabel
117
117
  })
118
118
 
119
+ const leftStyle = computed(() => {
120
+ const leftStyle: Record<string, any> = {}
121
+ if (props.titleWidth) {
122
+ leftStyle['min-width'] = props.titleWidth
123
+ leftStyle['max-width'] = props.titleWidth
124
+ }
125
+ if (props.titlePercent) {
126
+ leftStyle['flex'] = 'none'
127
+ leftStyle['width'] = props.titlePercent
128
+ }
129
+ return objToStyle(leftStyle)
130
+ })
131
+
119
132
  /**
120
133
  * @description 点击cell的handle
121
134
  */
@@ -53,6 +53,10 @@ export const cellProps = {
53
53
  * 设置左侧标题宽度
54
54
  */
55
55
  titleWidth: String,
56
+ /**
57
+ * 设置左侧标题占比
58
+ */
59
+ titlePercent: String,
56
60
  /**
57
61
  * 是否垂直居中,默认顶部居中
58
62
  */
@@ -73,7 +73,7 @@
73
73
  margin-bottom: $-checkbox-margin;
74
74
  font-size: 0;
75
75
  -webkit-tap-highlight-color: transparent;
76
- line-height: 1.2;
76
+ // line-height: 1.2;
77
77
 
78
78
  @include when(last-child) {
79
79
  margin-bottom: 0;
@@ -84,7 +84,7 @@
84
84
  display: inline-block;
85
85
  width: $-checkbox-size;
86
86
  height: $-checkbox-size;
87
- border: 2px solid $-checkbox-border-color;
87
+ border: 4rpx solid $-checkbox-border-color;
88
88
  border-radius: 50%;
89
89
  color: $-checkbox-check-color;
90
90
  background: $-checkbox-bg;
@@ -108,14 +108,14 @@
108
108
  @include edeep(btn-check) {
109
109
  display: inline-block;
110
110
  font-size: $-checkbox-icon-size;
111
- margin-right: 4px;
111
+ margin-right: 8rpx;
112
112
  vertical-align: middle;
113
113
  }
114
114
 
115
115
  @include e(txt) {
116
116
  display: inline-block;
117
117
  vertical-align: middle;
118
- line-height: 20px;
118
+ line-height: 40rpx;
119
119
  @include lineEllipsis;
120
120
  }
121
121
 
@@ -211,7 +211,7 @@
211
211
  height: $-checkbox-button-height;
212
212
  font-size: $-checkbox-button-font-size;
213
213
  margin-left: 0;
214
- padding: 5px 15px;
214
+ padding: 10rpx 30rpx;
215
215
  border: 1px solid $-checkbox-button-border;
216
216
  background-color: $-checkbox-button-bg;
217
217
  border-radius: $-checkbox-button-radius;
@@ -276,18 +276,18 @@
276
276
 
277
277
  // 以下内容用于解决父子组件样式隔离的问题 —— START
278
278
  @include when(cell-box) {
279
- padding: 13px 15px;
279
+ padding: 26rpx 30rpx;
280
280
  margin: 0;
281
281
 
282
282
  @include when(large) {
283
- padding: 14px 15px;
283
+ padding: 28rpx 30rpx;
284
284
  }
285
285
  }
286
286
 
287
287
  @include when(button-box) {
288
288
  display: inline-flex;
289
289
  width: 33.3333%;
290
- padding: 12px 12px 0 0;
290
+ padding: 24rpx 24rpx 0 0;
291
291
  box-sizing: border-box;
292
292
 
293
293
  .oxy-checkbox__label {
@@ -14,8 +14,8 @@
14
14
  :class="`oxy-checkbox__shape ${innerShape === 'square' ? 'is-square' : ''} ${customShapeClass}`"
15
15
  :style="isChecked && !innerDisabled && innerCheckedColor ? 'color :' + innerCheckedColor : ''"
16
16
  >
17
- <oxy-icon custom-class="oxy-checkbox__indeterminate" name="decrease" />
18
- <oxy-icon custom-class="oxy-checkbox__check" name="check-bold" />
17
+ <oxy-icon v-if="indeterminate" custom-class="oxy-checkbox__indeterminate" name="decrease" />
18
+ <oxy-icon v-else custom-class="oxy-checkbox__check" name="check-bold" />
19
19
  </view>
20
20
  <!--shape为button时只保留oxy-checkbox__label-->
21
21
  <view
@@ -9,10 +9,10 @@
9
9
  @include b(checkbox-group) {
10
10
  background-color: $-checkbox-bg;
11
11
 
12
- // 上下20px 左右15px 内部间隔12px
12
+ // 上下40rpx 左右30rpx 内部间隔24rpx
13
13
  @include when(button) {
14
14
  width: 100%;
15
- padding: 8px 3px 20px 15px;
15
+ padding: 16rpx 6rpx 40rpx 30rpx;
16
16
  box-sizing: border-box;
17
17
  overflow: hidden;
18
18
  height: auto;
@@ -29,7 +29,7 @@ export default {
29
29
  </script>
30
30
  <script lang="ts" setup>
31
31
  import { computed, getCurrentInstance, onBeforeMount, onMounted, onUnmounted, ref, watch } from 'vue'
32
- import { addUnit, isObj, objToStyle, uuid } from '../common/util'
32
+ import { isObj, objToStyle, unitConvert, unitConvertWithDefault, withDefaultUnit, uuid } from '../common/util'
33
33
  import { circleProps } from './types'
34
34
  // #ifdef MP-WEIXIN
35
35
  import { canvas2dAdapter } from '../common/canvasHelper'
@@ -55,10 +55,12 @@ const interval = ref<any>(null) // 定时器
55
55
  const pixelRatio = ref<number>(1) // 像素比
56
56
  const canvasId = ref<string>(`oxy-circle${uuid()}`) // canvasId
57
57
  let ctx: UniApp.CanvasContext | null = null
58
+ const toNumber = (value: number | string | null | undefined) => unitConvertWithDefault(value, { defaultUnit: 'rpx' })
59
+ const toPx = (value: number | string | null | undefined) => unitConvert(withDefaultUnit(value, 'rpx'), 0, { output: 'px' })
58
60
 
59
61
  // canvas渲染大小
60
62
  const canvasSize = computed(() => {
61
- let size = props.size
63
+ let size = toNumber(props.size)
62
64
  // #ifdef MP-ALIPAY
63
65
  size = size * pixelRatio.value
64
66
  // #endif
@@ -68,7 +70,7 @@ const canvasSize = computed(() => {
68
70
 
69
71
  // 进度条宽度
70
72
  const sWidth = computed(() => {
71
- let sWidth = props.strokeWidth
73
+ let sWidth = toNumber(props.strokeWidth)
72
74
  // #ifdef MP-ALIPAY
73
75
  sWidth = sWidth * pixelRatio.value
74
76
  // #endif
@@ -78,8 +80,8 @@ const sWidth = computed(() => {
78
80
  // Circle 样式
79
81
  const canvasStyle = computed(() => {
80
82
  const style = {
81
- width: addUnit(props.size),
82
- height: addUnit(props.size)
83
+ width: toPx(props.size),
84
+ height: toPx(props.size)
83
85
  }
84
86
  return `${objToStyle(style)}`
85
87
  })
@@ -148,8 +150,9 @@ function getContext() {
148
150
  if (res && res.node) {
149
151
  const canvas = res.node
150
152
  ctx = canvas2dAdapter(canvas.getContext('2d') as CanvasRenderingContext2D)
151
- canvas.width = props.size * pixelRatio.value
152
- canvas.height = props.size * pixelRatio.value
153
+ const size = toNumber(props.size)
154
+ canvas.width = size * pixelRatio.value
155
+ canvas.height = size * pixelRatio.value
153
156
  ctx.scale(pixelRatio.value, pixelRatio.value)
154
157
  resolve(ctx)
155
158
  }
@@ -1,5 +1,5 @@
1
1
  import type { ExtractPropTypes, PropType } from 'vue'
2
- import { baseProps, makeBooleanProp, makeNumberProp, makeStringProp } from '../common/props'
2
+ import { baseProps, makeBooleanProp, makeNumberProp, makeNumericProp, makeStringProp } from '../common/props'
3
3
 
4
4
  // 进度条端点的形状,可选值为 "butt" | "round" | "square"
5
5
  export type StrokeLinecapType = 'butt' | 'round' | 'square'
@@ -11,9 +11,9 @@ export const circleProps = {
11
11
  */
12
12
  modelValue: makeNumberProp(0),
13
13
  /**
14
- * 圆环直径,默认单位为 px
14
+ * 圆环直径,支持 number / string(如 `200rpx`、`100px`),number 与纯数字字符串按 rpx 处理
15
15
  */
16
- size: makeNumberProp(100),
16
+ size: makeNumericProp(200),
17
17
  /**
18
18
  * 进度条颜色,传入对象格式可以定义渐变色
19
19
  */
@@ -38,9 +38,9 @@ export const circleProps = {
38
38
  */
39
39
  text: String,
40
40
  /**
41
- * 进度条宽度 单位px
41
+ * 进度条宽度,支持 number / string(如 `20rpx`、`10px`),number 与纯数字字符串按 rpx 处理
42
42
  */
43
- strokeWidth: makeNumberProp(10),
43
+ strokeWidth: makeNumericProp(20),
44
44
  /**
45
45
  * 进度条端点的形状,可选值为 "butt" | "round" | "square"
46
46
  */
@@ -20,14 +20,14 @@ import { computed, watch } from 'vue'
20
20
  import { useParent } from '../composables/useParent'
21
21
  import { ROW_KEY } from '../oxy-row/types'
22
22
  import { colProps } from './types'
23
- import { isDef } from '../common/util'
23
+ import { isDef, withDefaultUnit } from '../common/util'
24
24
 
25
25
  const props = defineProps(colProps)
26
26
  const { parent: row } = useParent(ROW_KEY)
27
27
 
28
28
  const rootStyle = computed(() => {
29
29
  const gutter = isDef(row) ? row.props.gutter || 0 : 0
30
- const padding = `${gutter / 2}px`
30
+ const padding = withDefaultUnit(gutter / 2)
31
31
  const style = gutter > 0 ? `padding-left: ${padding}; padding-right: ${padding};background-clip: content-box;` : ''
32
32
  return `${style}${props.customStyle}`
33
33
  })
@@ -95,7 +95,7 @@
95
95
 
96
96
  @include e(selected-line) {
97
97
  position: absolute;
98
- bottom: 5px;
98
+ bottom: 10rpx;
99
99
  width: $-col-picker-line-width;
100
100
  left: 0;
101
101
  height: $-col-picker-line-height;
@@ -141,18 +141,18 @@
141
141
  }
142
142
 
143
143
  @include e(list-item-tip) {
144
- margin-top: 2px;
144
+ margin-top: 4rpx;
145
145
  font-size: $-col-picker-list-fs-tip;
146
146
  color: $-col-picker-list-color-tip;
147
147
  }
148
148
 
149
149
  @include e(confirm) {
150
- padding: 12px 25px 14px;
150
+ padding: 24rpx 50rpx 28rpx;
151
151
  }
152
152
 
153
153
  @include edeep(checked) {
154
154
  display: block;
155
- margin-left: 4px;
155
+ margin-left: 8rpx;
156
156
  font-size: $-col-picker-list-checked-icon-size;
157
157
  color: $-col-picker-list-color-checked;
158
158
  opacity: 0;
@@ -36,6 +36,7 @@
36
36
  :title="title || translate('title')"
37
37
  :close-on-click-modal="closeOnClickModal"
38
38
  :z-index="zIndex"
39
+ :max-width="popupMaxWidth"
39
40
  :safe-area-inset-bottom="safeAreaInsetBottom"
40
41
  :root-portal="rootPortal"
41
42
  @open="handlePickerOpend"
@@ -106,7 +107,7 @@ import OxyLoading from '../oxy-loading/oxy-loading.vue'
106
107
  import OxyActionSheet from '../oxy-action-sheet/oxy-action-sheet.vue'
107
108
  import OxyCell from '../oxy-cell/oxy-cell.vue'
108
109
  import { computed, getCurrentInstance, onMounted, ref, watch, type CSSProperties, type ComponentPublicInstance, reactive } from 'vue'
109
- import { addUnit, debounce, getRect, isArray, isBoolean, isDef, isFunction, objToStyle } from '../common/util'
110
+ import { withDefaultUnit, debounce, getRect, isArray, isBoolean, isDef, isFunction, objToStyle, unitConvert } from '../common/util'
110
111
  import { useTranslate } from '../composables/useTranslate'
111
112
  import { colPickerProps, type ColPickerExpose } from './types'
112
113
 
@@ -294,6 +295,9 @@ function showPicker() {
294
295
  const { disabled, readonly } = props
295
296
 
296
297
  if (disabled || readonly) return
298
+ if (isFunction(props.beforeOpen) && !props.beforeOpen()) {
299
+ return
300
+ }
297
301
  pickerShow.value = true
298
302
  lastPickerColSelected.value = pickerColSelected.value.slice(0)
299
303
  lastSelectList.value = selectList.value.slice(0)
@@ -450,15 +454,15 @@ function setLineStyle(animation: boolean = true) {
450
454
  .then((rects) => {
451
455
  const lineStyle: CSSProperties = {}
452
456
  if (isDef(lineWidth)) {
453
- lineStyle.width = addUnit(lineWidth)
457
+ lineStyle.width = withDefaultUnit(lineWidth)
454
458
  }
455
459
  if (isDef(lineHeight)) {
456
- lineStyle.height = addUnit(lineHeight)
457
- lineStyle.borderRadius = `calc(${addUnit(lineHeight)} / 2)`
460
+ lineStyle.height = withDefaultUnit(lineHeight)
461
+ lineStyle.borderRadius = `calc(${withDefaultUnit(lineHeight)} / 2)`
458
462
  }
459
463
  const rect = rects[currentCol.value]
460
464
  let left = rects.slice(0, currentCol.value).reduce((prev, curr) => prev + Number(curr.width), 0) + Number(rect.width) / 2
461
- lineStyle.transform = `translateX(${left}px) translateX(-50%)`
465
+ lineStyle.transform = `translateX(${unitConvert(left, 0, { output: 'px' })}) translateX(-50%)`
462
466
 
463
467
  if (animation) {
464
468
  lineStyle.transition = 'width 300ms ease, transform 300ms ease'
@@ -100,6 +100,11 @@ export const colPickerProps = {
100
100
  * 弹窗层级
101
101
  */
102
102
  zIndex: makeNumberProp(15),
103
+ /**
104
+ * 弹层最大宽度,支持 `rpx`、`px`、`%` 等单位;
105
+ * `%` 在弹层打开时按屏幕宽度换算为 `rpx`
106
+ */
107
+ popupMaxWidth: makeStringProp('1200rpx'),
103
108
  /**
104
109
  * 是否显示确定按钮
105
110
  */
@@ -129,11 +134,11 @@ export const colPickerProps = {
129
134
  */
130
135
  rules: makeArrayProp<FormItemRule>(),
131
136
  /**
132
- * 底部条宽度,单位像素
137
+ * 底部条宽度,支持 `px/rpx`
133
138
  */
134
139
  lineWidth: numericProp,
135
140
  /**
136
- * 底部条高度,单位像素
141
+ * 底部条高度,支持 `px/rpx`
137
142
  */
138
143
  lineHeight: numericProp,
139
144
  /**
@@ -152,7 +157,11 @@ export const colPickerProps = {
152
157
  /**
153
158
  * 必填标记位置,可选值:before、after
154
159
  */
155
- markerSide: makeStringProp<'before' | 'after'>('before')
160
+ markerSide: makeStringProp<'before' | 'after'>('before'),
161
+ /**
162
+ * 打开pop之前的校验
163
+ */
164
+ beforeOpen: Function as PropType<() => boolean>
156
165
  }
157
166
 
158
167
  export type ColPickerProps = ExtractPropTypes<typeof colPickerProps>
@@ -31,14 +31,14 @@
31
31
  @include e(more) {
32
32
  display: inline-block;
33
33
  font-size: $-collapse-retract-fs;
34
- margin-top: 8px;
34
+ margin-top: 16rpx;
35
35
  color: $-collapse-more-color;
36
36
  user-select: none;
37
37
  }
38
38
  @include e(more-txt) {
39
39
  display: inline-block;
40
40
  vertical-align: middle;
41
- margin-right: 4px;
41
+ margin-right: 8rpx;
42
42
  }
43
43
  @include e(arrow) {
44
44
  display: inline-block;
@@ -32,7 +32,7 @@ export default {
32
32
  <script lang="ts" setup>
33
33
  import OxyIcon from '../oxy-icon/oxy-icon.vue'
34
34
  import { computed, getCurrentInstance, onMounted, ref, watch, type CSSProperties } from 'vue'
35
- import { addUnit, getRect, isArray, isDef, isPromise, isString, objToStyle, pause, uuid } from '../common/util'
35
+ import { getRect, isArray, isDef, isPromise, isString, objToStyle, pause, unitConvert, uuid } from '../common/util'
36
36
  import { useParent } from '../composables/useParent'
37
37
  import { COLLAPSE_KEY } from '../oxy-collapse/types'
38
38
  import { collapseItemProps, type CollapseItemExpose } from './types'
@@ -64,9 +64,9 @@ const contentStyle = computed(() => {
64
64
  style.transition = 'height 0.3s ease-in-out'
65
65
  }
66
66
  if (!expanded.value) {
67
- style.height = '0px'
67
+ style.height = '0'
68
68
  } else if (height.value) {
69
- style.height = addUnit(height.value)
69
+ style.height = unitConvert(height.value, 0, { output: 'px' })
70
70
  }
71
71
  return objToStyle(style)
72
72
  })