oxy-uni-ui 2.1.2 → 2.1.3

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 +2 -0
  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
@@ -52,7 +52,7 @@
52
52
  border: none;
53
53
  border-radius: 0;
54
54
  color: $-button-normal-color;
55
- transition: opacity 0.2s;
55
+ transition: opacity $-transition-duration-base;
56
56
  user-select: none;
57
57
  font-weight: normal;
58
58
 
@@ -96,7 +96,7 @@
96
96
  }
97
97
 
98
98
  @include e(loading) {
99
- margin-right: 12rpx;
99
+ margin-right: $-spacing-12;
100
100
  animation: oxy-rotate 0.8s linear infinite;
101
101
  animation-duration: 2s;
102
102
  }
@@ -146,11 +146,11 @@
146
146
  }
147
147
  }
148
148
 
149
- @include when(medium) {
150
- height: $-button-medium-height;
151
- padding: $-button-medium-padding;
152
- border-radius: $-button-medium-radius;
153
- font-size: $-button-medium-fs;
149
+ @include when(default) {
150
+ height: $-button-default-height;
151
+ padding: $-button-default-padding;
152
+ border-radius: $-button-default-radius;
153
+ font-size: $-button-default-fs;
154
154
  min-width: 240rpx;
155
155
 
156
156
 
@@ -168,8 +168,8 @@
168
168
  }
169
169
 
170
170
  .oxy-button__loading {
171
- width: $-button-medium-loading;
172
- height: $-button-medium-loading;
171
+ width: $-button-default-loading;
172
+ height: $-button-default-loading;
173
173
  }
174
174
  }
175
175
 
@@ -197,7 +197,7 @@
197
197
  @include when(text) {
198
198
  color: $-button-primary-bg-color;
199
199
  min-width: 0;
200
- padding: 8rpx 0;
200
+ padding: $-spacing-8 0;
201
201
 
202
202
  &::after {
203
203
  display: none;
@@ -270,9 +270,9 @@
270
270
  }
271
271
  }
272
272
 
273
- &.is-medium {
273
+ &.is-default {
274
274
  &::after {
275
- border-radius: calc(2 * $-button-medium-radius);
275
+ border-radius: calc(2 * $-button-default-radius);
276
276
  }
277
277
  }
278
278
 
@@ -311,7 +311,7 @@
311
311
 
312
312
  @include edeep(icon) {
313
313
  display: block;
314
- margin-right: 12rpx;
314
+ margin-right: $-spacing-12;
315
315
  font-size: $-button-icon-fs;
316
316
  vertical-align: middle;
317
317
  }
@@ -54,7 +54,9 @@ export default {
54
54
  name: 'oxy-button',
55
55
  options: {
56
56
  addGlobalClass: true,
57
+ // #ifndef MP-TOUTIAO
57
58
  virtualHost: true,
59
+ // #endif
58
60
  styleIsolation: 'shared'
59
61
  }
60
62
  }
@@ -67,6 +69,11 @@ import { ref } from 'vue'
67
69
  import base64 from '../common/base64'
68
70
  import { buttonProps } from './types'
69
71
 
72
+ /**
73
+ * 生成 loading 状态的 SVG 图标。
74
+ * @param color 图标颜色
75
+ * @param reverse 是否反转颜色
76
+ */
70
77
  const loadingIcon = (color = '#4D80F0', reverse = true) => {
71
78
  return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 42"><defs><linearGradient x1="100%" y1="0%" x2="0%" y2="0%" id="a"><stop stop-color="${
72
79
  reverse ? color : '#fff'
@@ -163,6 +170,10 @@ function handleChooseavatar(event: any) {
163
170
  function handleAgreePrivacyAuthorization(event: any) {
164
171
  emit('agreeprivacyauthorization', event.detail)
165
172
  }
173
+ /**
174
+ * 根据按钮类型和状态构建 loading 图标 SVG 的 base64 编码。
175
+ * 当未指定 loadingColor 时,根据按钮 type 使用对应颜色。
176
+ */
166
177
  function buildLoadingSvg() {
167
178
  const { loadingColor, type, plain } = props
168
179
  let color = loadingColor
@@ -2,7 +2,7 @@ import type { ExtractPropTypes, PropType } from 'vue'
2
2
  import { baseProps, makeBooleanProp, makeStringProp } from '../common/props'
3
3
 
4
4
  export type ButtonType = 'primary' | 'success' | 'info' | 'warning' | 'error' | 'default' | 'text' | 'icon'
5
- export type ButtonSize = 'small' | 'medium' | 'large'
5
+ export type ButtonSize = 'small' | 'default' | 'large'
6
6
  export type ButtonLang = 'zh_CN' | 'zh_TW' | 'en'
7
7
 
8
8
  export type ButtonOpenType =
@@ -64,9 +64,9 @@ export const buttonProps = {
64
64
  */
65
65
  type: makeStringProp<ButtonType>('primary'),
66
66
  /**
67
- * 按钮尺寸,可选值:small / medium / large
67
+ * 按钮尺寸,可选值:small / default / large
68
68
  */
69
- size: makeStringProp<ButtonSize>('medium'),
69
+ size: makeStringProp<ButtonSize>('default'),
70
70
  /**
71
71
  * 图标类名
72
72
  */
@@ -42,31 +42,31 @@
42
42
  }
43
43
 
44
44
  @include e(title) {
45
- color: $-action-sheet-color;
46
- height: $-action-sheet-title-height;
47
- line-height: $-action-sheet-title-height;
45
+ color: $-calendar-title-color;
46
+ height: $-calendar-title-height;
47
+ line-height: $-calendar-title-height;
48
48
  text-align: center;
49
- font-size: $-action-sheet-title-fs;
50
- font-weight: $-action-sheet-weight;
49
+ font-size: $-calendar-title-fs;
50
+ font-weight: $-calendar-title-fw;
51
51
  }
52
52
 
53
53
  @include edeep(close) {
54
54
  position: absolute;
55
- top: $-action-sheet-close-top;
56
- right: $-action-sheet-close-right;
57
- color: $-action-sheet-close-color;
58
- font-size: $-action-sheet-close-fs;
55
+ top: $-calendar-close-top;
56
+ right: $-calendar-close-right;
57
+ color: $-calendar-close-color;
58
+ font-size: $-calendar-close-fs;
59
59
  transform: rotate(-45deg);
60
60
  line-height: 1.1;
61
61
  }
62
62
 
63
63
  @include e(tabs) {
64
64
  width: 444rpx;
65
- margin: 24rpx auto 28rpx;
65
+ margin: $-spacing-24 auto 28rpx;
66
66
  }
67
67
 
68
68
  @include e(shortcuts) {
69
- padding: 40rpx 0;
69
+ padding: $-spacing-40 0;
70
70
  text-align: center;
71
71
  }
72
72
 
@@ -78,9 +78,9 @@
78
78
  @include when(show-confirm) {
79
79
  height: 788rpx;
80
80
 
81
- @include when(range) {
82
- height: 768rpx;
83
- }
81
+ // @include when(range) {
82
+ // height: 768rpx;
83
+ // }
84
84
  }
85
85
  }
86
86
 
@@ -106,12 +106,12 @@
106
106
  }
107
107
 
108
108
  @include e(range-sperator) {
109
- margin: 0 48rpx;
109
+ margin: 0 $-spacing-48;
110
110
  color: $-calendar-disabled-color;
111
111
  }
112
112
 
113
113
  @include e(confirm) {
114
- padding: 28rpx 52rpx 32rpx;
114
+ padding: $-spacing-24 $-spacing-48 $-spacing-32;
115
115
  }
116
116
 
117
117
  @include edeep(cell) {
@@ -141,7 +141,7 @@
141
141
  }
142
142
  }
143
143
  }
144
-
144
+
145
145
  @include edeep(arrow) {
146
146
  display: block;
147
147
  font-size: $-cell-icon-size;
@@ -119,7 +119,9 @@ export default {
119
119
  name: 'oxy-calendar',
120
120
  options: {
121
121
  addGlobalClass: true,
122
+ // #ifndef MP-TOUTIAO
122
123
  virtualHost: true,
124
+ // #endif
123
125
  styleIsolation: 'shared'
124
126
  }
125
127
  }
@@ -142,6 +144,14 @@ import { calendarProps, type CalendarExpose } from './types'
142
144
  import type { CalendarType } from '../oxy-calendar-view/types'
143
145
  const { translate } = useTranslate('calendar')
144
146
 
147
+ /**
148
+ * 默认的展示值格式化函数,将选中值转换为可读的展示文案。
149
+ * 根据不同 calendar type 格式化:date/dates/daterange/datetime/datetimerange/week/weekrange/month/monthrange。
150
+ *
151
+ * @param value 选中的值,可能是单个时间戳或时间戳数组
152
+ * @param type 日历类型
153
+ * @returns 格式化后的展示字符串
154
+ */
145
155
  const defaultDisplayFormat = (value: number | number[], type: CalendarType): string => {
146
156
  switch (type) {
147
157
  case 'date':
@@ -203,6 +213,12 @@ const defaultDisplayFormat = (value: number | number[], type: CalendarType): str
203
213
  }
204
214
  }
205
215
 
216
+ /**
217
+ * 范围选择时格式化单个端点日期。
218
+ * @param value 端点时间戳,为 0 或 undefined 时返回占位文案
219
+ * @param rangeType 'start' | 'end'
220
+ * @param type 日历类型
221
+ */
206
222
  const formatRange = (value: number, rangeType: 'start' | 'end', type: CalendarType) => {
207
223
  switch (type) {
208
224
  case 'daterange':
@@ -339,6 +355,10 @@ function scrollIntoView() {
339
355
  calendarView.value && calendarView.value && calendarView.value.$.exposed.scrollIntoView()
340
356
  }
341
357
  // 对外暴露方法
358
+ /**
359
+ * 打开日历面板。设置面板可见、克隆当前值用于取消时恢复,等待渲染完成后自动滚动到选中日期。
360
+ * showTypeSwitch 模式下额外延迟滚动 tab 到可视区域。
361
+ */
342
362
  async function open() {
343
363
  const { disabled, readonly } = props
344
364
 
@@ -378,6 +398,12 @@ function handleTypeChange({ index }: { index: number }) {
378
398
  currentTab.value = index
379
399
  currentType.value = type as CalendarType
380
400
  }
401
+ /**
402
+ * 判断确认按钮是否应该禁用。
403
+ * - 范围选择未选满两端
404
+ * - dates 类型未选择任何日期
405
+ * - 值为空
406
+ */
381
407
  function getConfirmBtnStatus(value: number | number[] | null) {
382
408
  let confirmBtnDisabled = false
383
409
  // 范围选择未选择满,或者多日期选择未选择日期,按钮置灰不可点击
@@ -403,6 +429,11 @@ function handleChange({ value }: { value: number | number[] | null }) {
403
429
  handleConfirm()
404
430
  }
405
431
  }
432
+ /**
433
+ * 确认选择。支持 beforeConfirm 异步校验:
434
+ * 若传入 beforeConfirm 回调,提供 resolve(isPass) 让调用方控制是否确认;
435
+ * 否则直接提交。
436
+ */
406
437
  function handleConfirm() {
407
438
  if (props.beforeConfirm) {
408
439
  props.beforeConfirm({
@@ -160,6 +160,9 @@ export const calendarProps = {
160
160
  * 表单验证规则,结合oxy-form组件使用
161
161
  */
162
162
  rules: makeArrayProp<FormItemRule>(),
163
+ /**
164
+ * pickerView 外部自定义样式
165
+ */
163
166
  customViewClass: makeStringProp(''),
164
167
  /**
165
168
  * label 外部自定义样式
@@ -32,7 +32,9 @@
32
32
  export default {
33
33
  options: {
34
34
  addGlobalClass: true,
35
+ // #ifndef MP-TOUTIAO
35
36
  virtualHost: true,
37
+ // #endif
36
38
  styleIsolation: 'shared'
37
39
  }
38
40
  }
@@ -47,7 +47,7 @@
47
47
  v-if="timeData.length"
48
48
  v-model="timeValue"
49
49
  :columns="timeData"
50
- :columns-height="125"
50
+ :columns-height="260"
51
51
  :immediate-change="immediateChange"
52
52
  @change="handleTimeChange"
53
53
  @pickstart="handlePickStart"
@@ -62,7 +62,9 @@
62
62
  export default {
63
63
  options: {
64
64
  addGlobalClass: true,
65
+ // #ifndef MP-TOUTIAO
65
66
  virtualHost: true,
67
+ // #endif
66
68
  styleIsolation: 'shared'
67
69
  }
68
70
  }
@@ -1,5 +1,5 @@
1
1
  import type { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue'
2
- import { makeBooleanProp, makeRequiredProp } from '../../common/props'
2
+ import { makeBooleanProp, makeNumberProp, makeStringProp } from '../../common/props'
3
3
  import type { CalendarFormatter, CalendarTimeFilter, CalendarType } from '../types'
4
4
 
5
5
  /**
@@ -15,23 +15,26 @@ export const monthPanelProps = {
15
15
  /**
16
16
  * 日期类型
17
17
  */
18
- type: makeRequiredProp(String as PropType<CalendarType>),
18
+ type: makeStringProp<CalendarType>('date'),
19
19
  /**
20
20
  * 选中值
21
21
  */
22
- value: makeRequiredProp([Number, Array, null] as PropType<number | (number | null)[] | null>),
22
+ value: {
23
+ type: [Number, Array, null] as PropType<number | (number | null)[] | null>,
24
+ default: null
25
+ },
23
26
  /**
24
27
  * 最小日期时间戳
25
28
  */
26
- minDate: makeRequiredProp(Number),
29
+ minDate: makeNumberProp(new Date(new Date().getFullYear(), new Date().getMonth() - 6, new Date().getDate()).getTime()),
27
30
  /**
28
31
  * 最大日期时间戳
29
32
  */
30
- maxDate: makeRequiredProp(Number),
33
+ maxDate: makeNumberProp(new Date(new Date().getFullYear(), new Date().getMonth() + 6, new Date().getDate(), 23, 59, 59).getTime()),
31
34
  /**
32
35
  * 一周的第一天
33
36
  */
34
- firstDayOfWeek: makeRequiredProp(Number),
37
+ firstDayOfWeek: makeNumberProp(0),
35
38
  /**
36
39
  * 格式化函数
37
40
  */
@@ -61,7 +64,7 @@ export const monthPanelProps = {
61
64
  /**
62
65
  * 面板高度
63
66
  */
64
- panelHeight: makeRequiredProp(Number),
67
+ panelHeight: makeNumberProp(756),
65
68
  /**
66
69
  * 用于过滤时间选择器的数据
67
70
  */
@@ -45,7 +45,9 @@ export default {
45
45
  name: 'oxy-calendar-view',
46
46
  options: {
47
47
  addGlobalClass: true,
48
+ // #ifndef MP-TOUTIAO
48
49
  virtualHost: true,
50
+ // #endif
49
51
  styleIsolation: 'shared'
50
52
  }
51
53
  }
@@ -41,7 +41,9 @@ export const calendarViewProps = {
41
41
  * type 为范围选择时有效,是否允许选择同一天
42
42
  */
43
43
  allowSameDay: makeBooleanProp(false),
44
- // 是否展示面板标题,自动计算当前滚动的日期月份
44
+ /**
45
+ * 是否展示面板标题,自动计算当前滚动的日期月份
46
+ */
45
47
  showPanelTitle: makeBooleanProp(true),
46
48
  /**
47
49
  * 选中日期所使用的当日内具体时刻
@@ -3,18 +3,50 @@ import { makeBooleanProp, makeRequiredProp } from '../../common/props'
3
3
  import type { CalendarFormatter, CalendarType } from '../types'
4
4
 
5
5
  export const yearProps = {
6
+ /**
7
+ * 日历类型
8
+ */
6
9
  type: makeRequiredProp(String as PropType<CalendarType>),
10
+ /**
11
+ * 当前日期(13位时间戳)
12
+ */
7
13
  date: makeRequiredProp(Number),
14
+ /**
15
+ * 选中值,单选为时间戳,范围选择为时间戳数组
16
+ */
8
17
  value: makeRequiredProp([Number, Array] as PropType<number | (number | null)[] | null>),
18
+ /**
19
+ * 最小日期(13位时间戳)
20
+ */
9
21
  minDate: makeRequiredProp(Number),
22
+ /**
23
+ * 最大日期(13位时间戳)
24
+ */
10
25
  maxDate: makeRequiredProp(Number),
11
- // 日期格式化函数
26
+ /**
27
+ * 日期格式化函数
28
+ */
12
29
  formatter: Function as PropType<CalendarFormatter>,
30
+ /**
31
+ * 最大日期范围
32
+ */
13
33
  maxRange: Number,
34
+ /**
35
+ * 超出最大范围时的错误提示
36
+ */
14
37
  rangePrompt: String,
38
+ /**
39
+ * 是否允许选择同一天
40
+ */
15
41
  allowSameDay: makeBooleanProp(false),
42
+ /**
43
+ * 选中日期所使用的当日内具体时刻
44
+ */
16
45
  defaultTime: {
17
46
  type: [Array] as PropType<Array<number[]>>
18
47
  },
48
+ /**
49
+ * 是否显示标题
50
+ */
19
51
  showTitle: makeBooleanProp(true)
20
52
  }
@@ -23,7 +23,9 @@
23
23
  export default {
24
24
  options: {
25
25
  addGlobalClass: true,
26
+ // #ifndef MP-TOUTIAO
26
27
  virtualHost: true,
28
+ // #endif
27
29
  styleIsolation: 'shared'
28
30
  }
29
31
  }
@@ -27,7 +27,9 @@
27
27
  export default {
28
28
  options: {
29
29
  addGlobalClass: true,
30
+ // #ifndef MP-TOUTIAO
30
31
  virtualHost: true,
32
+ // #endif
31
33
  styleIsolation: 'shared'
32
34
  }
33
35
  }
@@ -56,7 +56,7 @@
56
56
  }
57
57
  }
58
58
  @include e(title-content) {
59
- padding: 32rpx 0;
59
+ padding: $-spacing-32 0;
60
60
  color: $-card-title-color;
61
61
  font-size: $-card-title-fs;
62
62
  }
@@ -20,7 +20,9 @@ export default {
20
20
  name: 'oxy-card',
21
21
  options: {
22
22
  addGlobalClass: true,
23
+ // #ifndef MP-TOUTIAO
23
24
  virtualHost: true,
25
+ // #endif
24
26
  styleIsolation: 'shared'
25
27
  }
26
28
  }
@@ -109,7 +109,7 @@
109
109
  }
110
110
 
111
111
  @include e(label) {
112
- margin-top: 8rpx;
112
+ margin-top: $-spacing-8;
113
113
  font-size: $-cell-label-fs;
114
114
  color: $-cell-label-color;
115
115
  }
@@ -147,6 +147,8 @@
147
147
  @include lineEllipsis;
148
148
  min-width: 0;
149
149
  }
150
+
151
+
150
152
  }
151
153
 
152
154
  @include edeep(arrow-right) {
@@ -52,7 +52,9 @@ export default {
52
52
  name: 'oxy-cell',
53
53
  options: {
54
54
  addGlobalClass: true,
55
+ // #ifndef MP-TOUTIAO
55
56
  virtualHost: true,
57
+ // #endif
56
58
  styleIsolation: 'shared'
57
59
  }
58
60
  }
@@ -82,8 +84,8 @@ const isBorder = computed(() => {
82
84
  const { parent: form } = useParent(FORM_KEY)
83
85
 
84
86
  const errorMessage = computed(() => {
85
- if (form && props.prop && form.errorMessages && form.errorMessages[props.prop]) {
86
- return form.errorMessages[props.prop]
87
+ if (form.value && props.prop && form.value.errorMessages && form.value.errorMessages[props.prop]) {
88
+ return form.value.errorMessages[props.prop]
87
89
  } else {
88
90
  return ''
89
91
  }
@@ -92,8 +94,8 @@ const errorMessage = computed(() => {
92
94
  // 是否展示必填
93
95
  const isRequired = computed(() => {
94
96
  let formRequired = false
95
- if (form && form.props.rules) {
96
- const rules = form.props.rules
97
+ if (form.value && form.value.props.rules) {
98
+ const rules = form.value.props.rules
97
99
  for (const key in rules) {
98
100
  if (Object.prototype.hasOwnProperty.call(rules, key) && key === props.prop && Array.isArray(rules[key])) {
99
101
  formRequired = rules[key].some((rule) => rule.required)
@@ -23,7 +23,9 @@ export default {
23
23
  name: 'oxy-cell-group',
24
24
  options: {
25
25
  addGlobalClass: true,
26
+ // #ifndef MP-TOUTIAO
26
27
  virtualHost: true,
28
+ // #endif
27
29
  styleIsolation: 'shared'
28
30
  }
29
31
  }
@@ -53,7 +53,7 @@
53
53
  @include edeep(btn-check) {
54
54
  display: inline-block;
55
55
  font-size: $-checkbox-icon-size;
56
- margin-right: 8rpx;
56
+ margin-right: $-spacing-8;
57
57
  vertical-align: middle;
58
58
  color: currentColor;
59
59
  }
@@ -96,13 +96,13 @@
96
96
  justify-content: center;
97
97
  height: $-checkbox-button-height;
98
98
  min-width: $-checkbox-button-min-width;
99
- padding: 16rpx 32rpx;
99
+ padding: $-spacing-16 $-spacing-32;
100
100
  margin-left: 0;
101
101
  border: 1px solid $-checkbox-button-border;
102
102
  box-sizing: border-box;
103
103
  border-radius: $-checkbox-button-radius;
104
104
  background: $-checkbox-button-bg;
105
- transition: all 0.2s;
105
+ transition: all $-transition-duration-base;
106
106
  line-height: 1.2;
107
107
  text-align: center;
108
108
  }
@@ -140,13 +140,13 @@
140
140
  }
141
141
  @include when(cell-box) {
142
142
  display: inline-block;
143
- padding: 32rpx 32rpx;
144
- width: 33.3333%;
143
+ padding: $-cell-wrapper-padding $-cell-padding;
144
+ // width: 33.3333%;
145
145
  margin: 0;
146
146
  box-sizing: border-box;
147
147
  font-size: 0;
148
148
  @include when(large) {
149
- padding: 32rpx 32rpx;
149
+ padding: $-cell-wrapper-padding-large $-cell-padding;
150
150
  }
151
151
  @include when(checked) {
152
152
  color: $-checkbox-checked-color;
@@ -156,7 +156,7 @@
156
156
  display: inline-flex;
157
157
  width: 33.3333%;
158
158
  margin-right: 0;
159
- padding: 24rpx 24rpx 0 0;
159
+ padding: $-cell-wrapper-padding $-cell-padding 0 0;
160
160
  box-sizing: border-box;
161
161
 
162
162
  .oxy-checkbox__label {