oxy-uni-ui 2.1.2 → 2.1.4

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 (261) hide show
  1. package/attributes.json +1 -1
  2. package/components/common/AbortablePromise.ts +4 -0
  3. package/components/common/abstracts/variable.scss +172 -66
  4. package/components/common/base64.ts +6 -0
  5. package/components/common/clickoutside.ts +5 -0
  6. package/components/common/interceptor.ts +9 -0
  7. package/components/common/path.ts +4 -0
  8. package/components/common/props.ts +23 -0
  9. package/components/common/util.ts +18 -1
  10. package/components/composables/index.ts +2 -0
  11. package/components/composables/useCell.ts +8 -1
  12. package/components/composables/useChildren.ts +27 -1
  13. package/components/composables/useCountDown.ts +10 -1
  14. package/components/composables/useDynamicVirtualScroll.ts +9 -0
  15. package/components/composables/useGlobalLoading.ts +6 -0
  16. package/components/composables/useGlobalMessage.ts +6 -0
  17. package/components/composables/useGlobalToast.ts +6 -0
  18. package/components/composables/useLockScroll.ts +9 -0
  19. package/components/composables/useParent.ts +65 -14
  20. package/components/composables/usePopover.ts +9 -0
  21. package/components/composables/useQueue.ts +8 -0
  22. package/components/composables/useRaf.ts +10 -0
  23. package/components/composables/useSharedState.ts +284 -0
  24. package/components/composables/useTouch.ts +8 -0
  25. package/components/composables/useTranslate.ts +9 -0
  26. package/components/composables/useUpload.ts +83 -11
  27. package/components/composables/useVirtualScroll.ts +7 -0
  28. package/components/composables/useWindowResize.ts +9 -0
  29. package/components/oxy-action-sheet/index.scss +5 -5
  30. package/components/oxy-action-sheet/oxy-action-sheet.vue +11 -0
  31. package/components/oxy-backtop/index.scss +2 -2
  32. package/components/oxy-backtop/oxy-backtop.vue +2 -0
  33. package/components/oxy-badge/oxy-badge.vue +2 -0
  34. package/components/oxy-badge/types.ts +3 -0
  35. package/components/oxy-button/index.scss +13 -13
  36. package/components/oxy-button/oxy-button.vue +11 -0
  37. package/components/oxy-button/types.ts +3 -3
  38. package/components/oxy-calendar/index.scss +17 -17
  39. package/components/oxy-calendar/oxy-calendar.vue +31 -0
  40. package/components/oxy-calendar/types.ts +3 -0
  41. package/components/oxy-calendar-view/month/month.vue +2 -0
  42. package/components/oxy-calendar-view/monthPanel/month-panel.vue +3 -1
  43. package/components/oxy-calendar-view/monthPanel/types.ts +10 -7
  44. package/components/oxy-calendar-view/oxy-calendar-view.vue +2 -0
  45. package/components/oxy-calendar-view/types.ts +3 -1
  46. package/components/oxy-calendar-view/year/types.ts +33 -1
  47. package/components/oxy-calendar-view/year/year.vue +2 -0
  48. package/components/oxy-calendar-view/yearPanel/year-panel.vue +2 -0
  49. package/components/oxy-card/index.scss +1 -1
  50. package/components/oxy-card/oxy-card.vue +2 -0
  51. package/components/oxy-cell/index.scss +3 -1
  52. package/components/oxy-cell/oxy-cell.vue +6 -4
  53. package/components/oxy-cell-group/oxy-cell-group.vue +2 -0
  54. package/components/oxy-checkbox/index.scss +7 -7
  55. package/components/oxy-checkbox/oxy-checkbox.vue +22 -16
  56. package/components/oxy-checkbox/types.ts +9 -0
  57. package/components/oxy-checkbox-group/index.scss +1 -1
  58. package/components/oxy-checkbox-group/oxy-checkbox-group.vue +2 -0
  59. package/components/oxy-circle/oxy-circle.vue +2 -0
  60. package/components/oxy-col/oxy-col.vue +3 -1
  61. package/components/oxy-col-picker/index.scss +3 -3
  62. package/components/oxy-col-picker/oxy-col-picker.vue +17 -1
  63. package/components/oxy-col-picker/types.ts +3 -0
  64. package/components/oxy-collapse/index.scss +2 -2
  65. package/components/oxy-collapse/oxy-collapse.vue +9 -0
  66. package/components/oxy-collapse-item/oxy-collapse-item.vue +4 -2
  67. package/components/oxy-config-provider/oxy-config-provider.vue +18 -0
  68. package/components/oxy-config-provider/types.ts +18 -0
  69. package/components/oxy-corner/index.scss +50 -32
  70. package/components/oxy-corner/oxy-corner.vue +2 -0
  71. package/components/oxy-count-down/oxy-count-down.vue +2 -0
  72. package/components/oxy-count-to/oxy-count-to.vue +12 -1
  73. package/components/oxy-count-to/types.ts +14 -4
  74. package/components/oxy-curtain/index.scss +10 -9
  75. package/components/oxy-curtain/oxy-curtain.vue +2 -0
  76. package/components/oxy-date-strip/oxy-date-strip.vue +22 -1
  77. package/components/oxy-date-strip-item/index.scss +4 -4
  78. package/components/oxy-date-strip-item/oxy-date-strip-item.vue +2 -0
  79. package/components/oxy-datetime-picker/index.scss +3 -3
  80. package/components/oxy-datetime-picker/oxy-datetime-picker.vue +11 -1
  81. package/components/oxy-datetime-picker-view/oxy-datetime-picker-view.vue +2 -0
  82. package/components/oxy-divider/oxy-divider.vue +2 -0
  83. package/components/oxy-drop-menu/index.scss +2 -2
  84. package/components/oxy-drop-menu/oxy-drop-menu.vue +3 -0
  85. package/components/oxy-drop-menu-item/index.scss +1 -1
  86. package/components/oxy-drop-menu-item/oxy-drop-menu-item.vue +17 -9
  87. package/components/oxy-echarts/oxy-echarts.vue +4 -2
  88. package/components/oxy-fab/index.scss +1 -1
  89. package/components/oxy-fab/oxy-fab.vue +27 -0
  90. package/components/oxy-file-list/index.scss +9 -9
  91. package/components/oxy-file-list/oxy-file-list.vue +29 -17
  92. package/components/oxy-floating-panel/oxy-floating-panel.vue +34 -10
  93. package/components/oxy-footer/index.scss +7 -0
  94. package/components/oxy-footer/oxy-footer.vue +4 -2
  95. package/components/oxy-footer/types.ts +9 -6
  96. package/components/oxy-form/oxy-form.vue +13 -1
  97. package/components/oxy-form-item/oxy-form-item.vue +5 -3
  98. package/components/oxy-gap/oxy-gap.vue +2 -0
  99. package/components/oxy-global-loading/oxy-global-loading.vue +18 -5
  100. package/components/oxy-global-message/oxy-global-message.vue +30 -17
  101. package/components/oxy-global-toast/oxy-global-toast.vue +18 -5
  102. package/components/oxy-grid/oxy-grid.vue +6 -0
  103. package/components/oxy-grid-item/index.scss +1 -1
  104. package/components/oxy-grid-item/oxy-grid-item.vue +22 -20
  105. package/components/oxy-guidance/index.scss +9 -9
  106. package/components/oxy-guidance/oxy-guidance.vue +22 -16
  107. package/components/oxy-icon/oxy-icon.vue +2 -0
  108. package/components/oxy-icon/types.ts +3 -0
  109. package/components/oxy-image-preview/index.scss +75 -0
  110. package/components/oxy-image-preview/index.ts +56 -0
  111. package/components/oxy-image-preview/oxy-image-preview.vue +221 -0
  112. package/components/oxy-image-preview/types.ts +164 -0
  113. package/components/oxy-img/oxy-img.vue +2 -0
  114. package/components/oxy-img-cropper/index.scss +2 -2
  115. package/components/oxy-img-cropper/oxy-img-cropper.vue +6 -0
  116. package/components/oxy-img-lazy/oxy-img-lazy.vue +9 -0
  117. package/components/oxy-index-anchor/index.scss +1 -1
  118. package/components/oxy-index-anchor/oxy-index-anchor.vue +2 -2
  119. package/components/oxy-index-bar/index.scss +1 -1
  120. package/components/oxy-index-bar/oxy-index-bar.vue +18 -0
  121. package/components/oxy-input/index.scss +2 -1
  122. package/components/oxy-input/oxy-input.vue +18 -4
  123. package/components/oxy-input/types.ts +6 -0
  124. package/components/oxy-input-number/index.scss +3 -1
  125. package/components/oxy-input-number/oxy-input-number.vue +2 -0
  126. package/components/oxy-keyboard/index.scss +3 -3
  127. package/components/oxy-keyboard/key/index.vue +2 -0
  128. package/components/oxy-keyboard/oxy-keyboard.vue +11 -2
  129. package/components/oxy-link/index.scss +8 -4
  130. package/components/oxy-link/oxy-link.vue +9 -3
  131. package/components/oxy-link/types.ts +2 -2
  132. package/components/oxy-list/oxy-list.vue +2 -0
  133. package/components/oxy-list/types.ts +7 -0
  134. package/components/oxy-loading/oxy-loading.vue +6 -0
  135. package/components/oxy-loadmore/index.scss +1 -1
  136. package/components/oxy-loadmore/oxy-loadmore.vue +2 -0
  137. package/components/oxy-long-press-menu/index.scss +1 -1
  138. package/components/oxy-long-press-menu/oxy-long-press-menu.vue +42 -13
  139. package/components/oxy-message-box/index.scss +223 -36
  140. package/components/oxy-message-box/index.ts +49 -23
  141. package/components/oxy-message-box/oxy-message-box.vue +181 -56
  142. package/components/oxy-message-box/types.ts +60 -2
  143. package/components/oxy-navbar/index.scss +1 -1
  144. package/components/oxy-navbar/oxy-navbar.vue +9 -6
  145. package/components/oxy-navbar-capsule/oxy-navbar-capsule.vue +2 -0
  146. package/components/oxy-notice-bar/index.scss +1 -1
  147. package/components/oxy-notice-bar/oxy-notice-bar.vue +29 -0
  148. package/components/oxy-notify/index.ts +16 -12
  149. package/components/oxy-notify/oxy-notify.vue +11 -4
  150. package/components/oxy-overlay/oxy-overlay.vue +34 -2
  151. package/components/oxy-pagination/oxy-pagination.vue +2 -0
  152. package/components/oxy-password-input/oxy-password-input.vue +2 -0
  153. package/components/oxy-picker/index.scss +7 -7
  154. package/components/oxy-picker/oxy-picker.vue +11 -0
  155. package/components/oxy-picker-view/index.scss +1 -1
  156. package/components/oxy-picker-view/oxy-picker-view.vue +2 -0
  157. package/components/oxy-popover/index.scss +2 -2
  158. package/components/oxy-popover/oxy-popover.vue +4 -1
  159. package/components/oxy-popup/oxy-popup.vue +8 -0
  160. package/components/oxy-progress/index.scss +2 -2
  161. package/components/oxy-progress/oxy-progress.vue +7 -0
  162. package/components/oxy-qrcode/draw.ts +15 -1
  163. package/components/oxy-qrcode/oxy-qrcode.vue +10 -3
  164. package/components/oxy-radio/index.scss +8 -8
  165. package/components/oxy-radio/oxy-radio.vue +13 -11
  166. package/components/oxy-radio-group/index.scss +1 -1
  167. package/components/oxy-radio-group/oxy-radio-group.vue +2 -0
  168. package/components/oxy-rate/oxy-rate.vue +5 -0
  169. package/components/oxy-rate/types.ts +2 -2
  170. package/components/oxy-resize/oxy-resize.vue +12 -0
  171. package/components/oxy-rich-text/index.scss +9 -9
  172. package/components/oxy-rich-text/oxy-rich-text.vue +6 -0
  173. package/components/oxy-rich-text/types.ts +15 -0
  174. package/components/oxy-root-portal/oxy-root-portal.vue +23 -15
  175. package/components/oxy-row/oxy-row.vue +2 -0
  176. package/components/oxy-search/index.scss +3 -3
  177. package/components/oxy-search/oxy-search.vue +19 -0
  178. package/components/oxy-segmented/index.scss +4 -4
  179. package/components/oxy-segmented/oxy-segmented.vue +2 -0
  180. package/components/oxy-select/index.scss +25 -25
  181. package/components/oxy-select/oxy-select.vue +27 -0
  182. package/components/oxy-select/types.ts +3 -0
  183. package/components/oxy-select-picker/index.scss +5 -5
  184. package/components/oxy-select-picker/oxy-select-picker.vue +7 -0
  185. package/components/oxy-sidebar/oxy-sidebar.vue +2 -0
  186. package/components/oxy-sidebar-item/index.scss +3 -3
  187. package/components/oxy-sidebar-item/oxy-sidebar-item.vue +17 -31
  188. package/components/oxy-signature/oxy-signature.vue +17 -0
  189. package/components/oxy-skeleton/oxy-skeleton.vue +7 -1
  190. package/components/oxy-slide-verify/index.scss +95 -0
  191. package/components/oxy-slide-verify/oxy-slide-verify.vue +244 -0
  192. package/components/oxy-slide-verify/types.ts +98 -0
  193. package/components/oxy-slider/oxy-slider.vue +3 -0
  194. package/components/oxy-sort-button/index.scss +10 -8
  195. package/components/oxy-sort-button/oxy-sort-button.vue +6 -0
  196. package/components/oxy-splitter/index.scss +9 -0
  197. package/components/oxy-splitter/oxy-splitter.vue +23 -2
  198. package/components/oxy-splitter-panel/index.scss +7 -5
  199. package/components/oxy-splitter-panel/oxy-splitter-panel.vue +93 -89
  200. package/components/oxy-status-tip/index.scss +3 -3
  201. package/components/oxy-status-tip/oxy-status-tip.vue +2 -0
  202. package/components/oxy-step/index.scss +4 -4
  203. package/components/oxy-step/oxy-step.vue +15 -13
  204. package/components/oxy-steps/oxy-steps.vue +2 -0
  205. package/components/oxy-sticky/oxy-sticky.vue +5 -3
  206. package/components/oxy-stream-render/oxy-stream-render.vue +29 -0
  207. package/components/oxy-swipe-action/oxy-swipe-action.vue +8 -0
  208. package/components/oxy-swiper/oxy-swiper.vue +6 -0
  209. package/components/oxy-swiper-nav/index.scss +4 -4
  210. package/components/oxy-switch/index.scss +6 -3
  211. package/components/oxy-switch/oxy-switch.vue +10 -0
  212. package/components/oxy-tab/index.scss +1 -7
  213. package/components/oxy-tab/oxy-tab.vue +12 -10
  214. package/components/oxy-tabbar/oxy-tabbar.vue +5 -0
  215. package/components/oxy-tabbar-item/oxy-tabbar-item.vue +11 -9
  216. package/components/oxy-table/index.scss +1 -1
  217. package/components/oxy-table/oxy-table.vue +8 -0
  218. package/components/oxy-table/types.ts +3 -0
  219. package/components/oxy-table-col/oxy-table-col.vue +21 -19
  220. package/components/oxy-tabs/index.scss +11 -11
  221. package/components/oxy-tabs/oxy-tabs.vue +17 -0
  222. package/components/oxy-tag/index.scss +24 -5
  223. package/components/oxy-tag/oxy-tag.vue +17 -2
  224. package/components/oxy-tag/types.ts +7 -0
  225. package/components/oxy-text/oxy-text.vue +12 -1
  226. package/components/oxy-textarea/index.scss +3 -2
  227. package/components/oxy-textarea/oxy-textarea.vue +10 -4
  228. package/components/oxy-toast/index.ts +21 -20
  229. package/components/oxy-toast/oxy-toast.vue +30 -5
  230. package/components/oxy-toast/types.ts +20 -9
  231. package/components/oxy-tooltip/index.scss +1 -1
  232. package/components/oxy-tooltip/oxy-tooltip.vue +2 -0
  233. package/components/oxy-transition/index.scss +3 -1
  234. package/components/oxy-transition/oxy-transition.vue +14 -0
  235. package/components/oxy-tree/index.scss +3 -3
  236. package/components/oxy-tree/oxy-tree.vue +28 -5
  237. package/components/oxy-tree/types.ts +57 -1
  238. package/components/oxy-upload/index.scss +9 -9
  239. package/components/oxy-upload/oxy-upload.vue +5 -3
  240. package/components/oxy-verification-code/oxy-verification-code.vue +24 -0
  241. package/components/oxy-video-preview/index.scss +12 -7
  242. package/components/oxy-video-preview/index.ts +64 -0
  243. package/components/oxy-video-preview/oxy-video-preview.vue +102 -31
  244. package/components/oxy-video-preview/types.ts +54 -8
  245. package/components/oxy-virtual-scroll/index.scss +1 -1
  246. package/components/oxy-virtual-scroll/oxy-virtual-scroll.vue +2 -0
  247. package/components/oxy-voice-player/index.scss +64 -64
  248. package/components/oxy-voice-player/oxy-voice-player.vue +38 -10
  249. package/components/oxy-waterfall/oxy-waterfall.vue +13 -0
  250. package/components/oxy-waterfall/types.ts +7 -0
  251. package/components/oxy-waterfall-item/oxy-waterfall-item.vue +9 -0
  252. package/components/oxy-watermark/oxy-watermark.vue +2 -0
  253. package/global.d.ts +2 -0
  254. package/index.ts +2 -0
  255. package/locale/lang/en-US.ts +51 -2
  256. package/locale/lang/zh-CN.ts +51 -2
  257. package/package.json +2 -2
  258. package/styles/all.scss +125 -0
  259. package/tags.json +1 -1
  260. package/vite-plugins/vite-plugin-host-class.ts +166 -0
  261. package/web-types.json +1 -1
@@ -5,10 +5,14 @@ import type { TextType } from '../oxy-text/types'
5
5
  export const countToProps = {
6
6
  ...baseProps,
7
7
 
8
- // 字体大小
8
+ /**
9
+ * 字体大小
10
+ */
9
11
  fontSize: makeNumberProp(32),
10
12
 
11
- // 文本颜色
13
+ /**
14
+ * 文本颜色
15
+ */
12
16
  color: makeStringProp(''),
13
17
  /**
14
18
  * 主题类型
@@ -58,10 +62,16 @@ export const countToProps = {
58
62
  }
59
63
  },
60
64
 
61
- // 小数点
65
+ /**
66
+ * 小数点符号
67
+ * @default '.'
68
+ */
62
69
  decimal: makeStringProp('.'),
63
70
 
64
- // 三位三位的隔开效果
71
+ /**
72
+ * 千位分隔符
73
+ * @default ','
74
+ */
65
75
  separator: makeStringProp(','),
66
76
 
67
77
  /**
@@ -4,6 +4,7 @@
4
4
  @include b(curtain-wrapper){
5
5
  :deep(.oxy-curtain){
6
6
  display: inline-block;
7
+ text-align: center;
7
8
  border-radius: $-curtain-content-radius;
8
9
  overflow-y: visible !important;
9
10
  background: transparent;
@@ -33,29 +34,29 @@
33
34
  @include edeep(content-close) {
34
35
  position: absolute;
35
36
  margin: 0;
36
- padding: 12rpx;
37
- top: 20rpx;
38
- right: 20rpx;
37
+ padding: $-curtain-content-close-padding;
38
+ top: $-curtain-content-close-top;
39
+ right: $-curtain-content-close-right;
39
40
  color: $-curtain-content-close-color;
40
41
  font-size: $-curtain-content-close-fs;
41
42
  -webkit-tap-highlight-color: transparent;
42
43
  &.top {
43
44
  margin: 0 0 0 -36rpx;
44
- top: -124rpx;
45
+ top: -$-curtain-content-close-offset;
45
46
  right: unset;
46
47
  left: 50%;
47
48
  bottom: unset;
48
49
  }
49
50
  &.top-left {
50
51
  margin: 0;
51
- top: -124rpx;
52
+ top: -$-curtain-content-close-offset;
52
53
  right: unset;
53
54
  left: -12rpx;
54
55
  bottom: unset;
55
56
  }
56
57
  &.top-right {
57
58
  margin: 0;
58
- top: -124rpx;
59
+ top: -$-curtain-content-close-offset;
59
60
  right: -12rpx;
60
61
  left: unset;
61
62
  bottom: unset;
@@ -65,21 +66,21 @@
65
66
  top: unset;
66
67
  right: unset;
67
68
  left: 50%;
68
- bottom: -124rpx;
69
+ bottom: -$-curtain-content-close-offset;
69
70
  }
70
71
  &.bottom-left {
71
72
  margin: 0;
72
73
  top: unset;
73
74
  right: unset;
74
75
  left: -12rpx;
75
- bottom: -124rpx;
76
+ bottom: -$-curtain-content-close-offset;
76
77
  }
77
78
  &.bottom-right {
78
79
  margin: 0;
79
80
  top: unset;
80
81
  right: -12rpx;
81
82
  left: unset;
82
- bottom: -124rpx;
83
+ bottom: -$-curtain-content-close-offset;
83
84
  }
84
85
  }
85
86
  }
@@ -47,7 +47,9 @@
47
47
  export default {
48
48
  name: 'oxy-curtain',
49
49
  options: {
50
+ // #ifndef MP-TOUTIAO
50
51
  virtualHost: true,
52
+ // #endif
51
53
  addGlobalClass: true,
52
54
  styleIsolation: 'shared'
53
55
  }
@@ -49,7 +49,9 @@ export default {
49
49
  name: 'oxy-date-strip',
50
50
  options: {
51
51
  addGlobalClass: true,
52
+ // #ifndef MP-TOUTIAO
52
53
  virtualHost: true,
54
+ // #endif
53
55
  styleIsolation: 'shared'
54
56
  }
55
57
  }
@@ -95,6 +97,13 @@ const rootStyle = computed(() => {
95
97
  })
96
98
 
97
99
  const cache = new Map<number, WeekDateCollection>()
100
+ /**
101
+ * 创建一周(或指定天数)的日期集合,带缓存
102
+ * 包含每日的日期对象、文本、类型(禁用/选中/普通)和星期前缀
103
+ * @param currentStartDate - 起始日期
104
+ * @param length - 天数
105
+ * @returns 包含起止时间戳和日期数组的集合
106
+ */
98
107
  const createWeek = (currentStartDate: Date, length: number): WeekDateCollection => {
99
108
  const dates: DateStriPDay[] = []
100
109
  const time = currentStartDate.getTime()
@@ -130,7 +139,11 @@ const createWeek = (currentStartDate: Date, length: number): WeekDateCollection
130
139
 
131
140
  const currentDate = ref<Date>(today)
132
141
 
133
- // 计算要显示的三周数据
142
+ /**
143
+ * 计算要显示的数据集合
144
+ * 周模式:基于当前日期生成前、当前、后三周数据
145
+ * 非周模式:从 minDate 到 maxDate 生成连续日期
146
+ */
134
147
  const displayWeeks = computed((): WeekDateCollection[] => {
135
148
  const weeks: WeekDateCollection[] = []
136
149
  if (props.switchMode === 'week') {
@@ -151,6 +164,10 @@ const displayWeeks = computed((): WeekDateCollection[] => {
151
164
  return weeks
152
165
  })
153
166
 
167
+ /**
168
+ * Swiper 切换处理:根据滑动方向(delta)推算新的基准日期
169
+ * delta === 1 或 -2 表示向前滑动一周,否则向后滑动一周
170
+ */
154
171
  const swiperChange = (event: any) => {
155
172
  const delta = event.detail.current - currentWeekIndex.value
156
173
  const newDate = addWeeks(currentDate.value, delta == 1 || delta == -2 ? 1 : -1)
@@ -167,6 +184,10 @@ const onClick = (day: DateStriPDay) => {
167
184
  emit('update:modelValue', v)
168
185
  }
169
186
 
187
+ /**
188
+ * 程序化滚动到指定日期(仅非周模式生效)
189
+ * @param date - 目标日期
190
+ */
170
191
  const scrollToDate = (date: Date) => {
171
192
  currentDate.value = date
172
193
  if (props.switchMode !== 'none') return
@@ -26,7 +26,7 @@
26
26
  /* #endif */
27
27
  display: flex;
28
28
  flex-direction: column;
29
- margin: 0 4rpx;
29
+ margin: 0 $-spacing-4;
30
30
  transition-duration: $-transition-duration-slow;
31
31
  transition-property: background-color, color;
32
32
  transition-timing-function: linear;
@@ -43,13 +43,13 @@
43
43
  }
44
44
  &--none {
45
45
  .oxy-date-strip-item__grid-prefix {
46
- padding-bottom: 8rpx;
47
- padding-top: 8rpx;
46
+ padding-bottom: $-spacing-8;
47
+ padding-top: $-spacing-8;
48
48
  }
49
49
  }
50
50
  &--circle {
51
51
  .oxy-date-strip-item__grid-prefix {
52
- padding-bottom: 8rpx;
52
+ padding-bottom: $-spacing-8;
53
53
  }
54
54
  .oxy-date-strip-item__grid-info {
55
55
  border-radius: $-date-strip-grid-circle-radius;
@@ -70,7 +70,9 @@ export default {
70
70
  name: 'oxy-date-strip-item',
71
71
  options: {
72
72
  addGlobalClass: true,
73
+ // #ifndef MP-TOUTIAO
73
74
  virtualHost: true,
75
+ // #endif
74
76
  styleIsolation: 'shared'
75
77
  }
76
78
  }
@@ -110,7 +110,7 @@
110
110
  font-size: $-picker-toolbar-fs;
111
111
  color: $-picker-toolbar-finish-color;
112
112
  background: transparent;
113
- padding: 48rpx 32rpx 32rpx 32rpx;
113
+ padding: $-spacing-48 $-spacing-32 $-spacing-32 $-spacing-32;
114
114
 
115
115
  @include m(cancel) {
116
116
  color: $-picker-toolbar-cancel-color;
@@ -135,7 +135,7 @@
135
135
  display: inline-block;
136
136
  color: $-picker-region-color;
137
137
  text-align: center;
138
- padding: 32rpx 0;
138
+ padding: $-spacing-32 0;
139
139
  font-size: $-picker-region-fs;
140
140
  line-height: 32rpx;
141
141
  transition: all 0.15s ease-out;
@@ -148,7 +148,7 @@
148
148
 
149
149
  @include e(region-time) {
150
150
  font-size: $-picker-region-time-fs;
151
- margin-top: 8rpx;
151
+ margin-top: $-spacing-8;
152
152
  }
153
153
 
154
154
  @include e(hidden) {
@@ -157,7 +157,9 @@
157
157
  export default {
158
158
  name: 'oxy-datetime-picker',
159
159
  options: {
160
+ // #ifndef MP-TOUTIAO
160
161
  virtualHost: true,
162
+ // #endif
161
163
  addGlobalClass: true,
162
164
  styleIsolation: 'shared'
163
165
  }
@@ -626,7 +628,11 @@ function onCancel() {
626
628
  emit('cancel')
627
629
  }
628
630
 
629
- /** picker触发confirm事件,同步触发confirm事件 */
631
+ /**
632
+ * 确认选择。支持 beforeConfirm 异步校验,通过 resolve(true) 确认。
633
+ * 若 picker 仍在滑动中(isPicking),延迟确认至 pickend 事件触发后自动执行,
634
+ * 避免 pickerView 值尚未更新导致确认值错误。
635
+ */
630
636
  function onConfirm() {
631
637
  if (props.loading || isLoading.value) return
632
638
 
@@ -654,6 +660,10 @@ function onPickStart() {
654
660
  isPicking.value = true
655
661
  }
656
662
 
663
+ /**
664
+ * picker 滑动结束。重置滑动状态,若用户在滑动期间点击了确认(hasConfirmed),
665
+ * 延迟 50ms 后自动执行确认(等待嵌套组件的日期计算完成)。
666
+ */
657
667
  function onPickEnd() {
658
668
  isPicking.value = false
659
669
 
@@ -19,7 +19,9 @@
19
19
  <script lang="ts">
20
20
  export default {
21
21
  name: 'oxy-datetime-picker-view',
22
+ // #ifndef MP-TOUTIAO
22
23
  virtualHost: true,
24
+ // #endif
23
25
  addGlobalClass: true,
24
26
  styleIsolation: 'shared'
25
27
  }
@@ -7,7 +7,9 @@
7
7
  export default {
8
8
  name: 'oxy-divider',
9
9
  options: {
10
+ // #ifndef MP-TOUTIAO
10
11
  virtualHost: true,
12
+ // #endif
11
13
  addGlobalClass: true,
12
14
  styleIsolation: 'shared'
13
15
  }
@@ -73,7 +73,7 @@
73
73
  transform: translate(-50%, 0);
74
74
  background: $-drop-menu-line-color;
75
75
  border-radius: $-drop-menu-line-height;
76
- transition: opacity .15s;
76
+ transition: opacity $-transition-duration-fast;
77
77
  opacity: 0;
78
78
  }
79
79
  }
@@ -85,6 +85,6 @@
85
85
 
86
86
  @include edeep(arrow) {
87
87
  font-size: $-drop-menu-arrow-fs;
88
- margin-left: 8rpx;
88
+ margin-left: $-spacing-8;
89
89
  }
90
90
  }
@@ -36,7 +36,9 @@
36
36
  export default {
37
37
  name: 'oxy-drop-menu',
38
38
  options: {
39
+ // #ifndef MP-TOUTIAO
39
40
  virtualHost: true,
41
+ // #endif
40
42
  addGlobalClass: true,
41
43
  styleIsolation: 'shared'
42
44
  }
@@ -111,6 +113,7 @@ onBeforeMount(() => {
111
113
 
112
114
  function noop() {}
113
115
 
116
+ /** 获取下拉菜单项的展示标题,优先取 title,否则从 options 中匹配当前选中值的 label */
114
117
  function getDisplayTitle(child: any) {
115
118
  const { title, modelValue, options, valueKey, labelKey } = child
116
119
 
@@ -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: 4rpx;
51
+ margin-left: $-spacing-4;
52
52
  }
53
53
 
54
54
  @include edeep(icon) {
@@ -46,7 +46,9 @@
46
46
  export default {
47
47
  name: 'oxy-drop-menu-item',
48
48
  options: {
49
+ // #ifndef MP-TOUTIAO
49
50
  virtualHost: true,
51
+ // #endif
50
52
  addGlobalClass: true,
51
53
  styleIsolation: 'shared'
52
54
  }
@@ -88,13 +90,13 @@ const { proxy } = getCurrentInstance() as any
88
90
 
89
91
  const positionStyle = computed(() => {
90
92
  let style: string = ''
91
- if (showWrapper.value && dropMenu) {
93
+ if (showWrapper.value && dropMenu.value) {
92
94
  style =
93
- dropMenu.props.direction === 'down'
94
- ? `top: calc(var(--window-top) + ${unitConvert(dropMenu.offset.value, 0, { output: 'px' })}); bottom: 0;`
95
- : dropMenu.props.direction === 'bottom'
95
+ dropMenu.value.props.direction === 'down'
96
+ ? `top: calc(var(--window-top) + ${unitConvert(dropMenu.value.offset.value, 0, { output: 'px' })}); bottom: 0;`
97
+ : dropMenu.value.props.direction === 'bottom'
96
98
  ? 'top: calc(var(--window-top); bottom: 0;'
97
- : `top: 0; bottom: calc(var(--window-bottom) + ${unitConvert(dropMenu.offset.value, 0, { output: 'px' })})`
99
+ : `top: 0; bottom: calc(var(--window-bottom) + ${unitConvert(dropMenu.value.offset.value, 0, { output: 'px' })})`
98
100
  } else {
99
101
  style = ''
100
102
  }
@@ -133,7 +135,10 @@ onBeforeUnmount(() => {
133
135
  function getShowPop() {
134
136
  return showPop.value
135
137
  }
136
- // 模拟单选操作 默认根据 value 选中操作
138
+ /**
139
+ * 选择选项。从 item 中提取 valueKey 对应的值(若未定义则用 item 本身),emit update:modelValue 和 change 事件后关闭面板。
140
+ * @param index - 选项在 options 数组中的索引
141
+ */
137
142
  function choose(index: number) {
138
143
  if (props.disabled) return
139
144
  const { valueKey } = props
@@ -169,6 +174,9 @@ function handleClose() {
169
174
  }
170
175
  }
171
176
 
177
+ /**
178
+ * 打开下拉面板。支持 beforeToggle 异步校验,传入 resolve(isPass) 控制是否打开。
179
+ */
172
180
  function open() {
173
181
  if (showPop.value) {
174
182
  return
@@ -188,9 +196,9 @@ function open() {
188
196
  function handleOpen() {
189
197
  showWrapper.value = true
190
198
  showPop.value = true
191
- if (dropMenu) {
192
- duration.value = Number(dropMenu.props.duration)
193
- position.value = dropMenu.props.direction === 'down' ? 'top' : 'bottom'
199
+ if (dropMenu.value) {
200
+ duration.value = Number(dropMenu.value.props.duration)
201
+ position.value = dropMenu.value.props.direction === 'down' ? 'top' : 'bottom'
194
202
  }
195
203
  }
196
204
 
@@ -6,13 +6,15 @@
6
6
  <script lang="ts">
7
7
  import { ref } from 'vue'
8
8
  import { echartsProps } from './types'
9
- import UniEcharts from '../../../../uni_modules/oxy-uni-ui/uni-echarts/components/uni-echarts/uni-echarts.vue'
10
- import type { UniEchartsInst } from '../../../../uni_modules/oxy-uni-ui/uni-echarts'
9
+ import UniEcharts from '../../uni-echarts/components/uni-echarts/uni-echarts.vue'
10
+ import type { UniEchartsInst } from '../../uni-echarts'
11
11
 
12
12
  export default {
13
13
  name: 'oxy-echarts',
14
14
  options: {
15
+ // #ifndef MP-TOUTIAO
15
16
  virtualHost: true,
17
+ // #endif
16
18
  addGlobalClass: true,
17
19
  styleIsolation: 'shared'
18
20
  }
@@ -3,7 +3,7 @@
3
3
 
4
4
  @include b(fab) {
5
5
  position: fixed;
6
- z-index: 99;
6
+ z-index: $-z-index-fixed;
7
7
 
8
8
  @include edeep(trigger) {
9
9
  min-width: auto !important;
@@ -32,7 +32,9 @@
32
32
  export default {
33
33
  name: 'oxy-fab',
34
34
  options: {
35
+ // #ifndef MP-TOUTIAO
35
36
  virtualHost: true,
37
+ // #endif
36
38
  addGlobalClass: true,
37
39
  styleIsolation: 'shared'
38
40
  }
@@ -103,6 +105,10 @@ const bounding = reactive({
103
105
  maxLeft: 0
104
106
  })
105
107
 
108
+ /**
109
+ * 获取屏幕和按钮的边界信息
110
+ * 查询系统信息、按钮元素尺寸,计算安全操作区域
111
+ */
106
112
  async function getBounding() {
107
113
  const sysInfo = uni.getSystemInfoSync()
108
114
  try {
@@ -122,6 +128,9 @@ async function getBounding() {
122
128
  bounding.maxTop = screen.height - fabSize.height - bottom
123
129
  }
124
130
 
131
+ /**
132
+ * 将按钮位置约束在安全边界内
133
+ */
125
134
  function clampPosition() {
126
135
  if (!inited.value) return
127
136
  const { minLeft, minTop, maxLeft, maxTop } = bounding
@@ -129,6 +138,9 @@ function clampPosition() {
129
138
  top.value = Math.min(Math.max(top.value, minTop), maxTop)
130
139
  }
131
140
 
141
+ /**
142
+ * 窗口尺寸变化处理:重新计算边界并修正按钮位置
143
+ */
132
144
  const handleWindowResize = async () => {
133
145
  await getBounding()
134
146
  if (props.draggable) {
@@ -140,6 +152,9 @@ const handleWindowResize = async () => {
140
152
 
141
153
  useWindowResize(handleWindowResize)
142
154
 
155
+ /**
156
+ * 根据 position 属性初始化按钮位置(8 个方位 + Center 组合)
157
+ */
143
158
  function initPosition() {
144
159
  const pos = props.position
145
160
  const { minLeft, minTop, maxLeft, maxTop } = bounding
@@ -185,6 +200,9 @@ function initPosition() {
185
200
  // 按下时坐标相对于元素的偏移量
186
201
  const touchOffset = reactive({ x: 0, y: 0 })
187
202
  const attractTransition = ref<boolean>(false)
203
+ /**
204
+ * 触摸开始:记录手指与按钮的相对偏移量,关闭过渡动画
205
+ */
188
206
  function handleTouchStart(e: TouchEvent) {
189
207
  if (props.draggable === false) return
190
208
 
@@ -194,6 +212,9 @@ function handleTouchStart(e: TouchEvent) {
194
212
  attractTransition.value = false
195
213
  }
196
214
 
215
+ /**
216
+ * 触摸移动:根据手指位置实时更新按钮坐标,限制在安全边界内
217
+ */
197
218
  function handleTouchMove(e: TouchEvent) {
198
219
  if (props.draggable === false) return
199
220
 
@@ -212,6 +233,9 @@ function handleTouchMove(e: TouchEvent) {
212
233
  left.value = x
213
234
  }
214
235
 
236
+ /**
237
+ * 触摸结束:根据按钮中心在屏幕左右半区的位置,吸附到最近边缘
238
+ */
215
239
  function handleTouchEnd() {
216
240
  if (props.draggable === false) return
217
241
 
@@ -262,6 +286,9 @@ onBeforeUnmount(() => {
262
286
  }
263
287
  })
264
288
 
289
+ /**
290
+ * 点击触发按钮:非展开模式直接触发 click 事件,展开模式切换激活状态
291
+ */
265
292
  function handleClick() {
266
293
  if (props.disabled) {
267
294
  return
@@ -5,12 +5,12 @@
5
5
  position: relative;
6
6
  display: flex;
7
7
  flex-wrap: wrap;
8
- margin: 0 -16rpx;
8
+ margin: 0 (-$-spacing-16);
9
9
  @include e(item) {
10
10
  position: relative;
11
11
  width: calc(33.33% - 32rpx);
12
12
  height: $-file-list-height;
13
- margin: 0 16rpx 64rpx;
13
+ margin: 0 $-spacing-16 64rpx;
14
14
  }
15
15
  @include e(content) {
16
16
  display: flex;
@@ -39,9 +39,9 @@
39
39
  width: 100%;
40
40
  font-size: $-file-list-file-name-fs;
41
41
  color: $-file-list-file-name-color;
42
- padding: 0 12rpx;
42
+ padding: 0 $-spacing-12;
43
43
  text-align: center;
44
- margin-top: 20rpx;
44
+ margin-top: $-spacing-20;
45
45
  white-space: nowrap;
46
46
  overflow: hidden;
47
47
  text-overflow: ellipsis;
@@ -60,7 +60,7 @@
60
60
  .oxy-file-list__list--item {
61
61
  width: 100%;
62
62
  background: $-file-list-bg;
63
- padding: 20rpx 24rpx;
63
+ padding: $-spacing-20 $-spacing-24;
64
64
  border-radius: $-file-list-list-item-radius;
65
65
  display: flex;
66
66
  flex-direction: row;
@@ -68,7 +68,7 @@
68
68
  .oxy-file-list__icon {
69
69
  width: 48rpx;
70
70
  height: 48rpx;
71
- margin-right: 20rpx;
71
+ margin-right: $-spacing-20;
72
72
  }
73
73
  .oxy-file-list__name {
74
74
  flex: 1;
@@ -86,7 +86,7 @@
86
86
  margin-left: $-spacing-24;
87
87
  }
88
88
  & + .oxy-file-list__list--item {
89
- margin-top: 20rpx;
89
+ margin-top: $-spacing-20;
90
90
  }
91
91
  }
92
92
  }
@@ -97,7 +97,7 @@
97
97
  right: 16rpx;
98
98
  background: $-file-list-download-bg;
99
99
  border-radius: $-file-list-card-radius;
100
- padding: 12rpx 16rpx;
100
+ padding: $-spacing-12 $-spacing-16;
101
101
  display: flex;
102
102
  }
103
103
  .oxy-file-list__download {
@@ -105,6 +105,6 @@
105
105
  }
106
106
  .oxy-file-list__delete {
107
107
  color: $-color-white;
108
- margin-left: 12rpx;
108
+ margin-left: $-spacing-12;
109
109
  }
110
110
  }