oxy-uni-ui 2.1.0 → 2.1.2

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 (269) hide show
  1. package/attributes.json +1 -1
  2. package/components/common/abstracts/variable.scss +145 -100
  3. package/components/common/util.ts +25 -0
  4. package/components/composables/useDynamicVirtualScroll.ts +80 -0
  5. package/components/oxy-action-sheet/index.scss +6 -6
  6. package/components/oxy-backtop/index.scss +1 -1
  7. package/components/oxy-badge/index.scss +2 -2
  8. package/components/oxy-button/index.scss +3 -6
  9. package/components/oxy-calendar/index.scss +2 -2
  10. package/components/oxy-calendar/oxy-calendar.vue +3 -3
  11. package/components/oxy-calendar-view/monthPanel/month-panel.vue +72 -37
  12. package/components/oxy-calendar-view/monthPanel/types.ts +43 -1
  13. package/components/oxy-calendar-view/types.ts +1 -1
  14. package/components/oxy-calendar-view/utils.ts +12 -1
  15. package/components/oxy-calendar-view/yearPanel/types.ts +36 -2
  16. package/components/oxy-calendar-view/yearPanel/year-panel.vue +64 -45
  17. package/components/oxy-card/index.scss +4 -4
  18. package/components/oxy-cell/index.scss +1 -1
  19. package/components/oxy-cell-group/index.scss +2 -2
  20. package/components/oxy-checkbox/index.scss +87 -197
  21. package/components/oxy-collapse/index.scss +1 -1
  22. package/components/oxy-collapse-item/index.scss +2 -2
  23. package/components/oxy-corner/index.scss +3 -3
  24. package/components/oxy-count-to/oxy-count-to.vue +3 -3
  25. package/components/oxy-count-to/types.ts +1 -1
  26. package/components/oxy-date-strip-item/index.scss +4 -4
  27. package/components/oxy-datetime-picker/types.ts +1 -1
  28. package/components/oxy-datetime-picker-view/types.ts +2 -2
  29. package/components/oxy-fab/index.scss +1 -5
  30. package/components/oxy-file-list/index.scss +2 -2
  31. package/components/oxy-footer/index.scss +2 -2
  32. package/components/oxy-footer/oxy-footer.vue +2 -3
  33. package/components/oxy-form-item/index.scss +0 -5
  34. package/components/oxy-grid/oxy-grid.vue +1 -1
  35. package/components/oxy-grid-item/index.scss +1 -1
  36. package/components/oxy-guidance/index.scss +2 -2
  37. package/components/oxy-img/index.scss +2 -2
  38. package/components/oxy-img-cropper/index.scss +0 -2
  39. package/components/oxy-img-lazy/index.scss +0 -1
  40. package/components/oxy-index-anchor/index.scss +3 -3
  41. package/components/oxy-input/index.scss +2 -2
  42. package/components/oxy-input-number/index.scss +21 -3
  43. package/components/oxy-input-number/oxy-input-number.vue +9 -1
  44. package/components/oxy-keyboard/index.scss +1 -1
  45. package/components/oxy-link/index.scss +11 -10
  46. package/components/oxy-loading/index.scss +1 -1
  47. package/components/oxy-loadmore/index.scss +1 -1
  48. package/components/oxy-message-box/index.scss +7 -7
  49. package/components/oxy-navbar/index.scss +1 -1
  50. package/components/oxy-navbar/oxy-navbar.vue +2 -3
  51. package/components/oxy-password-input/index.scss +4 -4
  52. package/components/oxy-picker/types.ts +1 -1
  53. package/components/oxy-picker-view/oxy-picker-view.vue +8 -5
  54. package/components/oxy-picker-view/types.ts +2 -2
  55. package/components/oxy-progress/index.scss +2 -2
  56. package/components/oxy-radio/index.scss +8 -4
  57. package/components/oxy-radio-group/index.scss +0 -1
  58. package/components/oxy-rich-text/index.scss +2 -6
  59. package/components/oxy-rich-text/mp-html/mp-html.d.ts +2 -0
  60. package/components/oxy-rich-text/mp-html/mp-html.vue +2 -1
  61. package/components/oxy-rich-text/mp-html/node/node.vue +23 -0
  62. package/components/oxy-rich-text/mp-html/parser.js +6 -6
  63. package/components/oxy-rich-text/oxy-rich-text.vue +23 -0
  64. package/components/oxy-search/index.scss +1 -1
  65. package/components/oxy-segmented/index.scss +4 -8
  66. package/components/oxy-select/index.scss +6 -6
  67. package/components/oxy-sidebar-item/index.scss +20 -11
  68. package/components/oxy-slider/index.scss +4 -5
  69. package/components/oxy-sort-button/index.scss +6 -9
  70. package/components/oxy-splitter-panel/index.scss +8 -8
  71. package/components/oxy-step/index.scss +9 -9
  72. package/components/oxy-swiper-nav/index.scss +2 -2
  73. package/components/oxy-switch/index.scss +3 -3
  74. package/components/oxy-tab/index.scss +8 -2
  75. package/components/oxy-tabbar/index.scss +3 -3
  76. package/components/oxy-tabbar/oxy-tabbar.vue +3 -3
  77. package/components/oxy-table/index.scss +0 -1
  78. package/components/oxy-table-col/index.scss +1 -2
  79. package/components/oxy-tabs/index.scss +3 -3
  80. package/components/oxy-tag/index.scss +160 -20
  81. package/components/oxy-tag/oxy-tag.vue +14 -2
  82. package/components/oxy-tag/types.ts +9 -0
  83. package/components/oxy-text/index.scss +1 -1
  84. package/components/oxy-textarea/index.scss +2 -6
  85. package/components/oxy-toast/index.scss +1 -1
  86. package/components/oxy-tree/index.scss +31 -11
  87. package/components/oxy-tree/oxy-tree.vue +113 -2
  88. package/components/oxy-tree/types.ts +1 -0
  89. package/components/oxy-upload/index.scss +3 -3
  90. package/components/oxy-video-preview/index.scss +3 -3
  91. package/components/oxy-virtual-scroll/index.scss +1 -1
  92. package/components/oxy-voice-player/index.scss +36 -36
  93. package/components/oxy-watermark/index.scss +1 -1
  94. package/dev-tools.ts +2 -0
  95. package/devTools/components/DevToolsOverlay.vue +56 -0
  96. package/devTools/components/DevToolsUiHost.vue +589 -0
  97. package/devTools/config.js +55 -0
  98. package/devTools/core/components/mpDevBubble.vue +174 -0
  99. package/devTools/core/libs/createH5Bubble.js +156 -0
  100. package/devTools/core/libs/devCache.js +151 -0
  101. package/devTools/core/libs/devOptions.js +163 -0
  102. package/devTools/core/libs/devUi.js +219 -0
  103. package/devTools/core/libs/drawView.js +140 -0
  104. package/devTools/core/libs/errorReport.js +64 -0
  105. package/devTools/core/libs/jsonCompress.js +334 -0
  106. package/devTools/core/libs/logReport.js +59 -0
  107. package/devTools/core/libs/pageLinkList.js +125 -0
  108. package/devTools/core/libs/timeFormat.js +94 -0
  109. package/devTools/core/proxy/console.js +430 -0
  110. package/devTools/core/proxy/index.js +36 -0
  111. package/devTools/core/proxy/request.js +495 -0
  112. package/devTools/core/proxy/storage.js +113 -0
  113. package/devTools/core/proxy/uniBus.js +153 -0
  114. package/devTools/core/proxy/uniListen.js +192 -0
  115. package/devTools/core/proxy/vueMixin.js +120 -0
  116. package/devTools/index.js +168 -0
  117. package/devTools/page/components/bottomTools.vue +1046 -0
  118. package/devTools/page/components/dialog/addStorage.vue +204 -0
  119. package/devTools/page/components/dialog/createDir.vue +366 -0
  120. package/devTools/page/components/dialog/editDialog.vue +192 -0
  121. package/devTools/page/components/dialog/routeDialog.vue +184 -0
  122. package/devTools/page/components/dialog/sendRequest.vue +603 -0
  123. package/devTools/page/components/dialog/textFileEditDialog.vue +391 -0
  124. package/devTools/page/components/libs/appDelDir.js +86 -0
  125. package/devTools/page/components/libs/dirReader.js +248 -0
  126. package/devTools/page/components/libs/fileSize.js +15 -0
  127. package/devTools/page/components/libs/getRuntimeInfo.js +134 -0
  128. package/devTools/page/components/listItem/consoleItem.vue +314 -0
  129. package/devTools/page/components/listItem/errorItem.vue +292 -0
  130. package/devTools/page/components/listItem/fileSysItem.vue +533 -0
  131. package/devTools/page/components/listItem/infoList.vue +100 -0
  132. package/devTools/page/components/listItem/jsRunnerItem.vue +255 -0
  133. package/devTools/page/components/listItem/logItem.vue +193 -0
  134. package/devTools/page/components/listItem/networkItem.vue +398 -0
  135. package/devTools/page/components/listItem/objectAnalysis.vue +651 -0
  136. package/devTools/page/components/listItem/pages.vue +319 -0
  137. package/devTools/page/components/listItem/routeItem.vue +153 -0
  138. package/devTools/page/components/listItem/setting.vue +734 -0
  139. package/devTools/page/components/listItem/storageList.vue +681 -0
  140. package/devTools/page/components/listItem/tools.vue +315 -0
  141. package/devTools/page/components/listItem/vuexList.vue +599 -0
  142. package/devTools/page/components/main.vue +1867 -0
  143. package/devTools/page/components/mixins/animationControl.js +91 -0
  144. package/devTools/page/components/mixins/mp.js +83 -0
  145. package/devTools/page/components/ui/btnTabs.vue +90 -0
  146. package/devTools/page/components/ui/codeHisPicker.vue +172 -0
  147. package/devTools/page/components/ui/h5Cell.vue +13 -0
  148. package/devTools/page/components/ui/menuBtn.vue +94 -0
  149. package/devTools/page/components/ui/mobileSwiperScroll.vue +74 -0
  150. package/devTools/page/components/ui/requestSpeedLimit.vue +52 -0
  151. package/devTools/page/components/ui/requestTimeoutMock.vue +55 -0
  152. package/devTools/page/components/ui/subTitleBar.vue +101 -0
  153. package/devTools/page/static/copy.png +0 -0
  154. package/devTools/page/static/delete.png +0 -0
  155. package/devTools/page/static/fileSys/AI.png +0 -0
  156. package/devTools/page/static/fileSys/DWG.png +0 -0
  157. package/devTools/page/static/fileSys/EXE.png +0 -0
  158. package/devTools/page/static/fileSys/GIF.png +0 -0
  159. package/devTools/page/static/fileSys/HTML.png +0 -0
  160. package/devTools/page/static/fileSys/PSD.png +0 -0
  161. package/devTools/page/static/fileSys/RVT.png +0 -0
  162. package/devTools/page/static/fileSys/SKP.png +0 -0
  163. package/devTools/page/static/fileSys/SVG.png +0 -0
  164. package/devTools/page/static/fileSys/excel.png +0 -0
  165. package/devTools/page/static/fileSys/pdf.png +0 -0
  166. package/devTools/page/static/fileSys/pptl.png +0 -0
  167. package/devTools/page/static/fileSys/shipin.png +0 -0
  168. package/devTools/page/static/fileSys/tupian.png +0 -0
  169. package/devTools/page/static/fileSys/txt.png +0 -0
  170. package/devTools/page/static/fileSys/weizhiwenjian.png +0 -0
  171. package/devTools/page/static/fileSys/wenjianjia.png +0 -0
  172. package/devTools/page/static/fileSys/word.png +0 -0
  173. package/devTools/page/static/fileSys/yasuo.png +0 -0
  174. package/devTools/page/static/fileSys/yinpin.png +0 -0
  175. package/devTools/page/static/fold.png +0 -0
  176. package/devTools/page/static/menu.png +0 -0
  177. package/devTools/page/static/refresh.png +0 -0
  178. package/devTools/page/static/unfold.png +0 -0
  179. package/devTools/tools.vue +25 -0
  180. package/devTools/type/devTools.d.ts +406 -0
  181. package/oxy-dev-tools/components/DevToolsUiHost.vue +555 -0
  182. package/oxy-dev-tools/config.js +61 -0
  183. package/oxy-dev-tools/core/components/mpDevBubble.vue +176 -0
  184. package/oxy-dev-tools/core/libs/createH5Bubble.js +156 -0
  185. package/oxy-dev-tools/core/libs/devCache.js +149 -0
  186. package/oxy-dev-tools/core/libs/devOptions.js +160 -0
  187. package/oxy-dev-tools/core/libs/devUi.js +219 -0
  188. package/oxy-dev-tools/core/libs/drawView.js +144 -0
  189. package/oxy-dev-tools/core/libs/errorReport.js +60 -0
  190. package/oxy-dev-tools/core/libs/jsonCompress.js +328 -0
  191. package/oxy-dev-tools/core/libs/logReport.js +55 -0
  192. package/oxy-dev-tools/core/libs/pageLinkList.js +121 -0
  193. package/oxy-dev-tools/core/libs/timeFormat.js +93 -0
  194. package/oxy-dev-tools/core/proxy/console.js +398 -0
  195. package/oxy-dev-tools/core/proxy/index.js +33 -0
  196. package/oxy-dev-tools/core/proxy/request.js +473 -0
  197. package/oxy-dev-tools/core/proxy/storage.js +96 -0
  198. package/oxy-dev-tools/core/proxy/uniBus.js +148 -0
  199. package/oxy-dev-tools/core/proxy/uniListen.js +190 -0
  200. package/oxy-dev-tools/core/proxy/vueMixin.js +115 -0
  201. package/oxy-dev-tools/index.ts +183 -0
  202. package/oxy-dev-tools/oxy-dev-tools.vue +62 -0
  203. package/oxy-dev-tools/page/components/bottomTools.vue +933 -0
  204. package/oxy-dev-tools/page/components/dialog/addStorage.vue +184 -0
  205. package/oxy-dev-tools/page/components/dialog/createDir.vue +352 -0
  206. package/oxy-dev-tools/page/components/dialog/editDialog.vue +178 -0
  207. package/oxy-dev-tools/page/components/dialog/routeDialog.vue +170 -0
  208. package/oxy-dev-tools/page/components/dialog/sendRequest.vue +530 -0
  209. package/oxy-dev-tools/page/components/dialog/textFileEditDialog.vue +379 -0
  210. package/oxy-dev-tools/page/components/libs/appDelDir.js +77 -0
  211. package/oxy-dev-tools/page/components/libs/dirReader.js +239 -0
  212. package/oxy-dev-tools/page/components/libs/fileSize.js +15 -0
  213. package/oxy-dev-tools/page/components/libs/getRuntimeInfo.js +132 -0
  214. package/oxy-dev-tools/page/components/listItem/consoleItem.vue +292 -0
  215. package/oxy-dev-tools/page/components/listItem/errorItem.vue +268 -0
  216. package/oxy-dev-tools/page/components/listItem/fileSysItem.vue +511 -0
  217. package/oxy-dev-tools/page/components/listItem/infoList.vue +89 -0
  218. package/oxy-dev-tools/page/components/listItem/jsRunnerItem.vue +236 -0
  219. package/oxy-dev-tools/page/components/listItem/logItem.vue +185 -0
  220. package/oxy-dev-tools/page/components/listItem/networkItem.vue +362 -0
  221. package/oxy-dev-tools/page/components/listItem/objectAnalysis.vue +642 -0
  222. package/oxy-dev-tools/page/components/listItem/pages.vue +285 -0
  223. package/oxy-dev-tools/page/components/listItem/routeItem.vue +140 -0
  224. package/oxy-dev-tools/page/components/listItem/setting.vue +687 -0
  225. package/oxy-dev-tools/page/components/listItem/storageList.vue +623 -0
  226. package/oxy-dev-tools/page/components/listItem/tools.vue +273 -0
  227. package/oxy-dev-tools/page/components/listItem/vuexList.vue +559 -0
  228. package/oxy-dev-tools/page/components/main.vue +1824 -0
  229. package/oxy-dev-tools/page/components/mixins/animationControl.js +80 -0
  230. package/oxy-dev-tools/page/components/mixins/mp.js +76 -0
  231. package/oxy-dev-tools/page/components/ui/btnTabs.vue +77 -0
  232. package/oxy-dev-tools/page/components/ui/codeHisPicker.vue +161 -0
  233. package/oxy-dev-tools/page/components/ui/h5Cell.vue +13 -0
  234. package/oxy-dev-tools/page/components/ui/menuBtn.vue +87 -0
  235. package/oxy-dev-tools/page/components/ui/mobileSwiperScroll.vue +71 -0
  236. package/oxy-dev-tools/page/components/ui/requestSpeedLimit.vue +47 -0
  237. package/oxy-dev-tools/page/components/ui/requestTimeoutMock.vue +50 -0
  238. package/oxy-dev-tools/page/components/ui/subTitleBar.vue +87 -0
  239. package/oxy-dev-tools/page/static/copy.png +0 -0
  240. package/oxy-dev-tools/page/static/delete.png +0 -0
  241. package/oxy-dev-tools/page/static/fileSys/AI.png +0 -0
  242. package/oxy-dev-tools/page/static/fileSys/DWG.png +0 -0
  243. package/oxy-dev-tools/page/static/fileSys/EXE.png +0 -0
  244. package/oxy-dev-tools/page/static/fileSys/GIF.png +0 -0
  245. package/oxy-dev-tools/page/static/fileSys/HTML.png +0 -0
  246. package/oxy-dev-tools/page/static/fileSys/PSD.png +0 -0
  247. package/oxy-dev-tools/page/static/fileSys/RVT.png +0 -0
  248. package/oxy-dev-tools/page/static/fileSys/SKP.png +0 -0
  249. package/oxy-dev-tools/page/static/fileSys/SVG.png +0 -0
  250. package/oxy-dev-tools/page/static/fileSys/excel.png +0 -0
  251. package/oxy-dev-tools/page/static/fileSys/pdf.png +0 -0
  252. package/oxy-dev-tools/page/static/fileSys/pptl.png +0 -0
  253. package/oxy-dev-tools/page/static/fileSys/shipin.png +0 -0
  254. package/oxy-dev-tools/page/static/fileSys/tupian.png +0 -0
  255. package/oxy-dev-tools/page/static/fileSys/txt.png +0 -0
  256. package/oxy-dev-tools/page/static/fileSys/weizhiwenjian.png +0 -0
  257. package/oxy-dev-tools/page/static/fileSys/wenjianjia.png +0 -0
  258. package/oxy-dev-tools/page/static/fileSys/word.png +0 -0
  259. package/oxy-dev-tools/page/static/fileSys/yasuo.png +0 -0
  260. package/oxy-dev-tools/page/static/fileSys/yinpin.png +0 -0
  261. package/oxy-dev-tools/page/static/fold.png +0 -0
  262. package/oxy-dev-tools/page/static/menu.png +0 -0
  263. package/oxy-dev-tools/page/static/refresh.png +0 -0
  264. package/oxy-dev-tools/page/static/unfold.png +0 -0
  265. package/oxy-dev-tools/tools.vue +22 -0
  266. package/oxy-dev-tools/type/devTools.d.ts +406 -0
  267. package/package.json +1 -1
  268. package/tags.json +1 -1
  269. package/web-types.json +1 -1
@@ -1,28 +1,24 @@
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
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
- >
11
- <view v-for="(item, index) in years" :key="index" :id="`year${index}`">
12
- <year
13
- :type="type"
14
- :date="item.date"
15
- :value="value"
16
- :min-date="minDate"
17
- :max-date="maxDate"
18
- :max-range="maxRange"
19
- :formatter="formatter"
20
- :range-prompt="rangePrompt"
21
- :allow-same-day="allowSameDay"
22
- :default-time="defaultTime"
23
- :showTitle="index !== 0"
24
- @change="handleDateChange"
25
- />
4
+ <scroll-view class="oxy-year-panel__container" :style="`height: ${scrollHeight}px`" scroll-y @scroll="yearScroll" :scroll-top="scrollTop">
5
+ <view class="oxy-year-panel__list" :style="`height: ${totalHeight}px; position: relative;`">
6
+ <view v-for="item in visibleYears" :key="item.date" :id="`year${item.index}`" :style="`position: absolute; top: ${item.top}px; width: 100%;`">
7
+ <year
8
+ :type="type"
9
+ :date="item.date"
10
+ :value="value"
11
+ :min-date="minDate"
12
+ :max-date="maxDate"
13
+ :max-range="maxRange"
14
+ :formatter="formatter"
15
+ :range-prompt="rangePrompt"
16
+ :allow-same-day="allowSameDay"
17
+ :default-time="defaultTime"
18
+ :showTitle="item.index !== 0"
19
+ @change="handleDateChange"
20
+ />
21
+ </view>
26
22
  </view>
27
23
  </scroll-view>
28
24
  </view>
@@ -39,8 +35,19 @@ export default {
39
35
 
40
36
  <script lang="ts" setup>
41
37
  import { computed, ref, onMounted } from 'vue'
42
- import { compareYear, formatYearTitle, getYears } from '../utils'
38
+ import {
39
+ compareYear,
40
+ formatYearTitle,
41
+ getYears,
42
+ designPxToRuntimePx,
43
+ YEAR_HEIGHT_WITH_TITLE,
44
+ YEAR_HEIGHT_WITHOUT_TITLE,
45
+ PANEL_EXTRA_NO_TITLE,
46
+ PANEL_EXTRA_WITH_TITLE,
47
+ YEAR_TITLE_HEIGHT
48
+ } from '../utils'
43
49
  import { isArray, isNumber, pause, unitConvert } from '../../common/util'
50
+ import { useDynamicVirtualScroll } from '../../composables/useDynamicVirtualScroll'
44
51
  import Year from '../year/year.vue'
45
52
  import { yearPanelProps, type YearInfo, type YearPanelExpose } from './types'
46
53
 
@@ -48,34 +55,47 @@ const props = defineProps(yearPanelProps)
48
55
  const emit = defineEmits(['change'])
49
56
 
50
57
  const scrollTop = ref<number>(0) // 滚动位置
58
+ const currentScrollTop = ref<number>(0) // 当前虚拟渲染滚动位置
51
59
  const scrollIndex = ref<number>(0) // 当前显示的年份索引
52
60
 
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
-
62
61
  // 滚动区域的高度
63
62
  const scrollHeight = computed(() => {
64
63
  const panelHeight = designPxToRuntimePx(props.panelHeight)
65
- const scrollHeight: number = panelHeight + (props.showPanelTitle ? PANEL_EXTRA_WITH_TITLE : PANEL_EXTRA_NO_TITLE)
64
+ const scrollHeight: number = panelHeight - (props.showPanelTitle ? YEAR_TITLE_HEIGHT : 0)
66
65
  return scrollHeight
67
66
  })
68
67
 
69
68
  // 年份信息
70
69
  const years = computed<YearInfo[]>(() => {
70
+ let top = 0
71
71
  return getYears(props.minDate, props.maxDate).map((year, index) => {
72
+ const height = index === 0 ? YEAR_HEIGHT_WITHOUT_TITLE : YEAR_HEIGHT_WITH_TITLE
73
+ const currentTop = top
74
+ top += height
72
75
  return {
73
76
  date: year,
74
- height: index === 0 ? YEAR_HEIGHT_WITHOUT_TITLE : YEAR_HEIGHT_WITH_TITLE
77
+ height,
78
+ top: currentTop
75
79
  }
76
80
  })
77
81
  })
78
82
 
83
+ const totalHeight = computed(() => {
84
+ if (years.value.length === 0) return 0
85
+ const last = years.value[years.value.length - 1]
86
+ return last.top + last.height
87
+ })
88
+
89
+ // 滚动区域的高度(用于计算可视区域)
90
+ const viewportHeight = computed(() => designPxToRuntimePx(props.panelHeight))
91
+
92
+ // 引入动态虚拟滚动 Hook
93
+ const { visibleData: visibleYears, getTargetIndex } = useDynamicVirtualScroll<YearInfo>({
94
+ data: years,
95
+ scrollTop: currentScrollTop,
96
+ viewportHeight
97
+ })
98
+
79
99
  // 标题
80
100
  const title = computed(() => {
81
101
  return formatYearTitle(years.value[scrollIndex.value].date)
@@ -107,8 +127,13 @@ async function scrollIntoView() {
107
127
  }
108
128
  scrollTop.value = 0
109
129
  if (top > 0) {
130
+ const targetTop = top + (activeDate && compareYear(years.value[0].date, activeDate) !== 0 ? YEAR_TITLE_HEIGHT : 0)
131
+ currentScrollTop.value = targetTop
132
+ // 在首次渲染前同步 currentScrollTop,避免闪烁
133
+ scrollTop.value = targetTop
110
134
  await pause()
111
- scrollTop.value = top + YEAR_TITLE_HEIGHT
135
+ } else {
136
+ currentScrollTop.value = 0
112
137
  }
113
138
  }
114
139
 
@@ -116,8 +141,9 @@ const yearScroll = (event: { detail: { scrollTop: number } }) => {
116
141
  if (years.value.length <= 1) {
117
142
  return
118
143
  }
119
- const scrollTop = Math.max(0, event.detail.scrollTop)
120
- doSetSubtitle(scrollTop)
144
+ const st = Math.max(0, event.detail.scrollTop)
145
+ currentScrollTop.value = st
146
+ doSetSubtitle(st)
121
147
  }
122
148
 
123
149
  /**
@@ -125,14 +151,7 @@ const yearScroll = (event: { detail: { scrollTop: number } }) => {
125
151
  * scrollTop 滚动条位置
126
152
  */
127
153
  function doSetSubtitle(scrollTop: number) {
128
- let height: number = 0 // 月份高度和
129
- for (let index = 0; index < years.value.length; index++) {
130
- height = height + years.value[index].height
131
- if (scrollTop < height) {
132
- scrollIndex.value = index
133
- return
134
- }
135
- }
154
+ scrollIndex.value = getTargetIndex(scrollTop)
136
155
  }
137
156
 
138
157
  function handleDateChange({ value }: { value: number[] }) {
@@ -5,7 +5,7 @@
5
5
  background-color: $-dark-background2;
6
6
 
7
7
  @include when(rectangle) {
8
-
8
+
9
9
  .oxy-card__content {
10
10
  @include halfPixelBorder('top', 0, $-dark-border-color);
11
11
  }
@@ -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: 24rpx;
34
+ margin-bottom: $-spacing-24;
35
35
 
36
36
  @include when(rectangle) {
37
37
  margin-left: 0;
@@ -40,7 +40,7 @@
40
40
  box-shadow: none;
41
41
 
42
42
  .oxy-card__title-content {
43
- font-size: $-card-fs;
43
+ font-size: $-card-title-fs;
44
44
  }
45
45
  .oxy-card__content {
46
46
  position: relative;
@@ -68,4 +68,4 @@
68
68
  padding: $-card-footer-padding;
69
69
  text-align: right;
70
70
  }
71
- }
71
+ }
@@ -151,7 +151,7 @@
151
151
 
152
152
  @include edeep(arrow-right) {
153
153
  display: block;
154
- margin-left: 16rpx;
154
+ margin-left: $-spacing-16;
155
155
  width: $-cell-arrow-size;
156
156
  font-size: $-cell-arrow-size;
157
157
  color: $-cell-arrow-color;
@@ -44,7 +44,7 @@
44
44
  font-size: $-cell-group-title-fs;
45
45
  color: $-cell-group-title-color;
46
46
  font-weight: $-fw-medium;
47
- line-height: 1.43;
47
+ line-height: $-line-height-loose;
48
48
  }
49
49
  @include e(right) {
50
50
  color: $-cell-group-value-color;
@@ -53,4 +53,4 @@
53
53
  @include e(body) {
54
54
  background: $-color-white;
55
55
  }
56
- }
56
+ }
@@ -1,102 +1,45 @@
1
- @import './../common/abstracts/_mixin.scss';
2
- @import './../common/abstracts/variable.scss';
3
-
1
+ @import '../common/abstracts/variable.scss';
2
+ @import '../common/abstracts/_mixin.scss';
4
3
  .oxy-theme-dark {
5
4
  @include b(checkbox) {
6
5
  @include e(shape) {
7
- background: transparent;
8
- border-color: $-checkbox-border-color;
9
- color: $-checkbox-check-color;
6
+ background-color: $-dark-background;
7
+ border-color: $-color-gray-6;
10
8
  }
11
-
12
- @include e(label) {
9
+ @include e(txt) {
13
10
  color: $-dark-color;
14
11
  }
15
-
16
- @include when(disabled) {
17
- .oxy-checkbox__shape {
18
- border-color: $-dark-color-gray;
19
- background: $-dark-background4;
20
- }
21
-
22
- .oxy-checkbox__label {
23
- color: $-dark-color-gray;
24
- }
25
-
26
- :deep(.oxy-checkbox__check) {
27
- color: $-dark-color-gray;
28
- }
29
-
30
- @include when(checked) {
31
- .oxy-checkbox__shape {
32
- color: $-dark-color-gray;
33
- }
34
-
35
- .oxy-checkbox__label {
36
- color: $-dark-color-gray;
37
- }
38
- }
39
-
40
- @include when(button) {
41
- .oxy-checkbox__label {
42
- border-color: $-color-gray-5;
43
- background: $-dark-border-color;
44
- color: $-dark-color-gray;
45
- }
46
-
47
- @include when(checked) {
48
- .oxy-checkbox__label {
49
- border-color: $-color-gray-5;
50
- background: $-dark-border-color;
51
- color: $-color-gray-5;
52
- }
53
- }
54
- }
55
- }
56
-
57
- @include when(button) {
58
- .oxy-checkbox__label {
59
- background-color: $-dark-background;
60
- }
61
-
62
- @include when(checked) {
63
- .oxy-checkbox__label {
64
- background-color: $-dark-background2;
65
- }
66
- }
12
+ @include e(label) {
13
+ color: $-dark-color3;
67
14
  }
68
15
  }
69
16
  }
70
-
71
17
  @include b(checkbox) {
72
18
  display: block;
73
19
  margin-bottom: $-checkbox-margin;
74
- font-size: 0;
75
20
  -webkit-tap-highlight-color: transparent;
76
21
  // line-height: 1.2;
77
-
78
22
  @include when(last-child) {
79
23
  margin-bottom: 0;
80
24
  }
81
-
82
25
  @include e(shape) {
83
26
  position: relative;
84
- display: inline-block;
27
+ display: inline-flex;
28
+ align-items: center;
29
+ justify-content: center;
85
30
  width: $-checkbox-size;
86
31
  height: $-checkbox-size;
87
32
  border: 4rpx solid $-checkbox-border-color;
88
- border-radius: 50%;
33
+ border-radius: $-radius-circle;
89
34
  color: $-checkbox-check-color;
90
35
  background: $-checkbox-bg;
91
36
  vertical-align: middle;
92
37
  transition: background 0.2s;
93
38
  box-sizing: border-box;
94
-
95
39
  @include when(square) {
96
40
  border-radius: $-checkbox-square-radius;
97
41
  }
98
42
  }
99
-
100
43
  @include e(input) {
101
44
  position: absolute;
102
45
  width: 0;
@@ -104,21 +47,22 @@
104
47
  margin: 0;
105
48
  opacity: 0;
106
49
  }
107
-
50
+ @include edeep(check, indeterminate) {
51
+ font-size: $-checkbox-icon-size;
52
+ }
108
53
  @include edeep(btn-check) {
109
54
  display: inline-block;
110
55
  font-size: $-checkbox-icon-size;
111
56
  margin-right: 8rpx;
112
57
  vertical-align: middle;
58
+ color: currentColor;
113
59
  }
114
-
115
60
  @include e(txt) {
116
61
  display: inline-block;
117
62
  vertical-align: middle;
118
- line-height: 48rpx;
63
+ line-height: $-lh-base;
119
64
  @include lineEllipsis;
120
65
  }
121
-
122
66
  @include e(label) {
123
67
  position: relative;
124
68
  display: inline-block;
@@ -127,62 +71,14 @@
127
71
  font-size: $-checkbox-label-fs;
128
72
  color: $-checkbox-label-color;
129
73
  }
130
-
131
- @include edeep(check) {
132
- color: $-checkbox-check-color;
133
- font-size: $-checkbox-icon-size;
134
- opacity: 0;
135
- transition: opacity 0.2s;
136
- }
137
-
138
- @include edeep(indeterminate) {
139
- color: $-checkbox-check-color;
140
- font-size: $-checkbox-icon-size;
141
- opacity: 0;
142
- transition: opacity 0.2s;
143
- }
144
-
145
- @include when(indeterminate) {
146
- .oxy-checkbox__shape {
147
- color: $-checkbox-checked-color;
148
- background: currentColor;
149
- border-color: currentColor;
150
- }
151
-
152
- :deep(.oxy-checkbox__indeterminate) {
153
- opacity: 1;
154
- position: absolute;
155
- left: 50%;
156
- top: 50%;
157
- transform: translate(-50%, -50%);
158
- }
159
- :deep(.oxy-checkbox__check) {
160
- display: none;
161
- }
162
- }
163
-
164
- @include when(checked) {
165
- .oxy-checkbox__shape {
166
- display: inline-block;
167
- color: $-checkbox-checked-color;
168
- background: currentColor;
169
- border-color: currentColor;
170
- }
171
-
172
- :deep(.oxy-checkbox__check) {
173
- opacity: 1;
174
- position: absolute;
175
- left: 50%;
176
- top: 50%;
177
- transform: translate(-50%, -50%);
178
- }
179
-
180
- :deep(.oxy-checkbox__indeterminate) {
181
- display: none;
74
+ @include e(icon) {
75
+ background: $-color-white;
76
+ border-radius: $-checkbox-square-radius;
77
+ @include when(icon-checked) {
78
+ background: $-checkbox-checked-color;
79
+ border-color: $-checkbox-checked-color;
182
80
  }
183
81
  }
184
-
185
-
186
82
  @include when(button) {
187
83
  display: inline-block;
188
84
  margin-bottom: 0;
@@ -194,41 +90,45 @@
194
90
  margin-right: 0;
195
91
  }
196
92
 
197
- .oxy-checkbox__shape {
198
- width: 0;
199
- height: 0;
200
- overflow: hidden;
201
- opacity: 0;
202
- border: none;
203
- }
204
-
205
93
  .oxy-checkbox__label {
206
- display: inline-flex;
207
- flex-direction: row;
208
- justify-content: center;
94
+ display: flex;
209
95
  align-items: center;
210
- min-width: $-checkbox-button-min-width;
96
+ justify-content: center;
211
97
  height: $-checkbox-button-height;
212
- font-size: $-checkbox-button-font-size;
213
- margin-left: 0;
98
+ min-width: $-checkbox-button-min-width;
214
99
  padding: 16rpx 32rpx;
100
+ margin-left: 0;
215
101
  border: 1px solid $-checkbox-button-border;
216
- background-color: $-checkbox-button-bg;
217
- border-radius: $-checkbox-button-radius;
218
- transition: color 0.2s, border 0.2s;
219
102
  box-sizing: border-box;
103
+ border-radius: $-checkbox-button-radius;
104
+ background: $-checkbox-button-bg;
105
+ transition: all 0.2s;
106
+ line-height: 1.2;
107
+ text-align: center;
108
+ }
109
+ @include when(disabled) {
110
+ .oxy-checkbox__label {
111
+ border-color: $-checkbox-button-disabled-border;
112
+ color: $-checkbox-disabled-label-color;
113
+ }
220
114
  }
221
-
222
115
  @include when(checked) {
223
116
  .oxy-checkbox__label {
224
- color: $-checkbox-checked-color;
225
- background-color: $-checkbox-bg;
226
117
  border-color: $-checkbox-checked-color;
227
- border-color: currentColor;
118
+ background: $-color-white;
119
+ color: $-checkbox-checked-color;
120
+ }
121
+ }
122
+ @include when(checked) {
123
+ @include when(disabled) {
124
+ .oxy-checkbox__label {
125
+ border-color: $-checkbox-disabled-check-bg;
126
+ background: $-checkbox-disabled-check-bg;
127
+ color: $-checkbox-disabled-check-color;
128
+ }
228
129
  }
229
130
  }
230
131
  }
231
-
232
132
  @include when(inline) {
233
133
  display: inline-block;
234
134
  margin-bottom: 0;
@@ -238,78 +138,68 @@
238
138
  margin-right: 0;
239
139
  }
240
140
  }
241
-
242
- @include when(disabled) {
243
- .oxy-checkbox__shape {
244
- border-color: $-checkbox-border-color;
245
- background: $-checkbox-disabled-check-bg;
246
- }
247
-
248
- .oxy-checkbox__label {
249
- color: $-checkbox-disabled-label-color;
250
- }
251
-
252
- @include when(checked) {
253
- .oxy-checkbox__shape {
254
- color: $-checkbox-disabled-check-color;
255
- }
256
-
257
- .oxy-checkbox__label {
258
- color: $-checkbox-disabled-label-color;
259
- }
260
- }
261
-
262
- @include when(button) {
263
- .oxy-checkbox__label {
264
- background: $-checkbox-disabled-color;
265
- border-color: $-checkbox-button-border;
266
- color: $-checkbox-disabled-label-color;
267
- }
268
-
269
- @include when(checked) {
270
- .oxy-checkbox__label {
271
- border-color: $-checkbox-button-disabled-border;
272
- }
273
- }
274
- }
275
- }
276
-
277
- // 以下内容用于解决父子组件样式隔离的问题 —— START
278
141
  @include when(cell-box) {
142
+ display: inline-block;
279
143
  padding: 32rpx 32rpx;
144
+ width: 33.3333%;
280
145
  margin: 0;
281
-
146
+ box-sizing: border-box;
147
+ font-size: 0;
282
148
  @include when(large) {
283
149
  padding: 32rpx 32rpx;
284
150
  }
151
+ @include when(checked) {
152
+ color: $-checkbox-checked-color;
153
+ }
285
154
  }
286
-
287
- @include when(button-box) {
155
+ &.is-cell-box.is-button-box {
288
156
  display: inline-flex;
289
157
  width: 33.3333%;
158
+ margin-right: 0;
290
159
  padding: 24rpx 24rpx 0 0;
291
160
  box-sizing: border-box;
292
161
 
293
162
  .oxy-checkbox__label {
294
163
  width: 100%;
295
- }
296
-
297
- &:last-child::after {
298
- content: '';
299
- display: table;
300
- clear: both;
164
+ max-width: inherit;
301
165
  }
302
166
  }
303
-
304
167
  @include when(large) {
305
168
  .oxy-checkbox__shape {
306
169
  width: $-checkbox-large-size;
307
170
  height: $-checkbox-large-size;
308
- font-size: $-checkbox-large-size;
309
171
  }
310
-
311
172
  .oxy-checkbox__label {
312
173
  font-size: $-checkbox-large-label-fs;
313
174
  }
175
+ @include edeep(check, indeterminate, btn-check) {
176
+ font-size: $-checkbox-large-icon-size;
177
+ }
178
+ }
179
+ @include when(checked) {
180
+ .oxy-checkbox__shape {
181
+ background-color: $-checkbox-checked-color;
182
+ border-color: $-checkbox-checked-color;
183
+ }
184
+ .oxy-checkbox__icon {
185
+ background: $-checkbox-checked-color;
186
+ border-color: $-checkbox-checked-color;
187
+ }
188
+ }
189
+ @include when(indeterminate) {
190
+ .oxy-checkbox__shape {
191
+ background-color: $-checkbox-checked-color;
192
+ border-color: $-checkbox-checked-color;
193
+ }
194
+ }
195
+ @include when(disabled) {
196
+ .oxy-checkbox__shape {
197
+ border-color: $-checkbox-disabled-check-bg;
198
+ background: $-checkbox-disabled-color;
199
+ color: $-checkbox-disabled-check-color;
200
+ }
201
+ .oxy-checkbox__label {
202
+ color: $-checkbox-disabled-label-color;
203
+ }
314
204
  }
315
205
  }
@@ -31,7 +31,7 @@
31
31
  @include e(more) {
32
32
  display: inline-block;
33
33
  font-size: $-collapse-retract-fs;
34
- margin-top: 16rpx;
34
+ margin-top: $-spacing-16;
35
35
  color: $-collapse-more-color;
36
36
  user-select: none;
37
37
  }
@@ -59,7 +59,7 @@
59
59
  display: block;
60
60
  font-size: $-collapse-arrow-size;
61
61
  color: $-collapse-arrow-color;
62
- transition: transform 0.3s;
62
+ transition: transform $-transition-duration-slow;
63
63
 
64
64
  @include when(retract) {
65
65
  transform: rotate(-180deg);
@@ -76,7 +76,7 @@
76
76
  color: $-collapse-body-color;
77
77
  font-size: $-collapse-body-fs;
78
78
  padding: $-collapse-body-padding;
79
- line-height: 1.43;
79
+ line-height: $-line-height-loose;
80
80
  }
81
81
 
82
82
  @include when(disabled) {
@@ -160,7 +160,7 @@
160
160
  border-bottom-left-radius: 0;
161
161
  border-bottom-right-radius: 64rpx;
162
162
  padding-left: 0;
163
- padding-right: 24rpx;
163
+ padding-right: $-spacing-24;
164
164
  }
165
165
  }
166
166
  &.is-bottom-left{
@@ -177,7 +177,7 @@
177
177
  border-bottom-left-radius: 0;
178
178
  border-top-right-radius: 64rpx;
179
179
  padding-left: 0;
180
- padding-right: 24rpx;
180
+ padding-right: $-spacing-24;
181
181
  > span{
182
182
  transform: none;
183
183
  }
@@ -247,7 +247,7 @@
247
247
  right: 0;
248
248
  top: 0;
249
249
  transform: none;
250
- padding-left: 24rpx;
250
+ padding-left: $-spacing-24;
251
251
  box-sizing: border-box;
252
252
  font-size: $-corner-embedded-font-size;
253
253
  font-weight: $-corner-embedded-font-weight;
@@ -2,15 +2,15 @@
2
2
  <view :class="rootClass">
3
3
  <!-- 前缀插槽 -->
4
4
  <slot name="prefix">
5
- <oxy-text :type="props.type" :color="props.color" :size="`${props.fontSize * 1.4}rpx`" :text="props.prefix"></oxy-text>
5
+ <oxy-text :type="props.type" :color="props.color" :size="`${props.fontSize * 0.7}rpx`" :text="props.prefix"></oxy-text>
6
6
  </slot>
7
7
  <!-- 默认文本插槽 -->
8
8
  <slot>
9
- <oxy-text :type="props.type" :color="props.color" :size="`${props.fontSize * 2}rpx`" :text="timeText"></oxy-text>
9
+ <oxy-text :type="props.type" :color="props.color" :size="`${props.fontSize}rpx`" :text="timeText"></oxy-text>
10
10
  </slot>
11
11
  <!-- 后缀插槽 -->
12
12
  <slot name="suffix">
13
- <oxy-text :type="props.type" :color="props.color" :size="`${props.fontSize * 1.4}rpx`" :text="props.suffix"></oxy-text>
13
+ <oxy-text :type="props.type" :color="props.color" :size="`${props.fontSize * 0.7}rpx`" :text="props.suffix"></oxy-text>
14
14
  </slot>
15
15
  </view>
16
16
  </template>