oxy-uni-ui 2.1.1 → 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 (434) hide show
  1. package/attributes.json +1 -1
  2. package/components/common/AbortablePromise.ts +4 -0
  3. package/components/common/abstracts/variable.scss +185 -68
  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 +41 -6
  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 +6 -5
  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 +176 -17
  223. package/components/oxy-tag/oxy-tag.vue +29 -2
  224. package/components/oxy-tag/types.ts +16 -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/dev-tools.ts +2 -0
  254. package/devTools/components/DevToolsOverlay.vue +56 -0
  255. package/devTools/components/DevToolsUiHost.vue +589 -0
  256. package/devTools/config.js +55 -0
  257. package/devTools/core/components/mpDevBubble.vue +174 -0
  258. package/devTools/core/libs/createH5Bubble.js +156 -0
  259. package/devTools/core/libs/devCache.js +151 -0
  260. package/devTools/core/libs/devOptions.js +163 -0
  261. package/devTools/core/libs/devUi.js +219 -0
  262. package/devTools/core/libs/drawView.js +140 -0
  263. package/devTools/core/libs/errorReport.js +64 -0
  264. package/devTools/core/libs/jsonCompress.js +334 -0
  265. package/devTools/core/libs/logReport.js +59 -0
  266. package/devTools/core/libs/pageLinkList.js +125 -0
  267. package/devTools/core/libs/timeFormat.js +94 -0
  268. package/devTools/core/proxy/console.js +430 -0
  269. package/devTools/core/proxy/index.js +36 -0
  270. package/devTools/core/proxy/request.js +495 -0
  271. package/devTools/core/proxy/storage.js +113 -0
  272. package/devTools/core/proxy/uniBus.js +153 -0
  273. package/devTools/core/proxy/uniListen.js +192 -0
  274. package/devTools/core/proxy/vueMixin.js +120 -0
  275. package/devTools/index.js +168 -0
  276. package/devTools/page/components/bottomTools.vue +1046 -0
  277. package/devTools/page/components/dialog/addStorage.vue +204 -0
  278. package/devTools/page/components/dialog/createDir.vue +366 -0
  279. package/devTools/page/components/dialog/editDialog.vue +192 -0
  280. package/devTools/page/components/dialog/routeDialog.vue +184 -0
  281. package/devTools/page/components/dialog/sendRequest.vue +603 -0
  282. package/devTools/page/components/dialog/textFileEditDialog.vue +391 -0
  283. package/devTools/page/components/libs/appDelDir.js +86 -0
  284. package/devTools/page/components/libs/dirReader.js +248 -0
  285. package/devTools/page/components/libs/fileSize.js +15 -0
  286. package/devTools/page/components/libs/getRuntimeInfo.js +134 -0
  287. package/devTools/page/components/listItem/consoleItem.vue +314 -0
  288. package/devTools/page/components/listItem/errorItem.vue +292 -0
  289. package/devTools/page/components/listItem/fileSysItem.vue +533 -0
  290. package/devTools/page/components/listItem/infoList.vue +100 -0
  291. package/devTools/page/components/listItem/jsRunnerItem.vue +255 -0
  292. package/devTools/page/components/listItem/logItem.vue +193 -0
  293. package/devTools/page/components/listItem/networkItem.vue +398 -0
  294. package/devTools/page/components/listItem/objectAnalysis.vue +651 -0
  295. package/devTools/page/components/listItem/pages.vue +319 -0
  296. package/devTools/page/components/listItem/routeItem.vue +153 -0
  297. package/devTools/page/components/listItem/setting.vue +734 -0
  298. package/devTools/page/components/listItem/storageList.vue +681 -0
  299. package/devTools/page/components/listItem/tools.vue +315 -0
  300. package/devTools/page/components/listItem/vuexList.vue +599 -0
  301. package/devTools/page/components/main.vue +1867 -0
  302. package/devTools/page/components/mixins/animationControl.js +91 -0
  303. package/devTools/page/components/mixins/mp.js +83 -0
  304. package/devTools/page/components/ui/btnTabs.vue +90 -0
  305. package/devTools/page/components/ui/codeHisPicker.vue +172 -0
  306. package/devTools/page/components/ui/h5Cell.vue +13 -0
  307. package/devTools/page/components/ui/menuBtn.vue +94 -0
  308. package/devTools/page/components/ui/mobileSwiperScroll.vue +74 -0
  309. package/devTools/page/components/ui/requestSpeedLimit.vue +52 -0
  310. package/devTools/page/components/ui/requestTimeoutMock.vue +55 -0
  311. package/devTools/page/components/ui/subTitleBar.vue +101 -0
  312. package/devTools/page/static/copy.png +0 -0
  313. package/devTools/page/static/delete.png +0 -0
  314. package/devTools/page/static/fileSys/AI.png +0 -0
  315. package/devTools/page/static/fileSys/DWG.png +0 -0
  316. package/devTools/page/static/fileSys/EXE.png +0 -0
  317. package/devTools/page/static/fileSys/GIF.png +0 -0
  318. package/devTools/page/static/fileSys/HTML.png +0 -0
  319. package/devTools/page/static/fileSys/PSD.png +0 -0
  320. package/devTools/page/static/fileSys/RVT.png +0 -0
  321. package/devTools/page/static/fileSys/SKP.png +0 -0
  322. package/devTools/page/static/fileSys/SVG.png +0 -0
  323. package/devTools/page/static/fileSys/excel.png +0 -0
  324. package/devTools/page/static/fileSys/pdf.png +0 -0
  325. package/devTools/page/static/fileSys/pptl.png +0 -0
  326. package/devTools/page/static/fileSys/shipin.png +0 -0
  327. package/devTools/page/static/fileSys/tupian.png +0 -0
  328. package/devTools/page/static/fileSys/txt.png +0 -0
  329. package/devTools/page/static/fileSys/weizhiwenjian.png +0 -0
  330. package/devTools/page/static/fileSys/wenjianjia.png +0 -0
  331. package/devTools/page/static/fileSys/word.png +0 -0
  332. package/devTools/page/static/fileSys/yasuo.png +0 -0
  333. package/devTools/page/static/fileSys/yinpin.png +0 -0
  334. package/devTools/page/static/fold.png +0 -0
  335. package/devTools/page/static/menu.png +0 -0
  336. package/devTools/page/static/refresh.png +0 -0
  337. package/devTools/page/static/unfold.png +0 -0
  338. package/devTools/tools.vue +25 -0
  339. package/devTools/type/devTools.d.ts +406 -0
  340. package/global.d.ts +2 -0
  341. package/index.ts +2 -0
  342. package/locale/lang/en-US.ts +51 -2
  343. package/locale/lang/zh-CN.ts +51 -2
  344. package/oxy-dev-tools/components/DevToolsUiHost.vue +555 -0
  345. package/oxy-dev-tools/config.js +61 -0
  346. package/oxy-dev-tools/core/components/mpDevBubble.vue +176 -0
  347. package/oxy-dev-tools/core/libs/createH5Bubble.js +156 -0
  348. package/oxy-dev-tools/core/libs/devCache.js +149 -0
  349. package/oxy-dev-tools/core/libs/devOptions.js +160 -0
  350. package/oxy-dev-tools/core/libs/devUi.js +219 -0
  351. package/oxy-dev-tools/core/libs/drawView.js +144 -0
  352. package/oxy-dev-tools/core/libs/errorReport.js +60 -0
  353. package/oxy-dev-tools/core/libs/jsonCompress.js +328 -0
  354. package/oxy-dev-tools/core/libs/logReport.js +55 -0
  355. package/oxy-dev-tools/core/libs/pageLinkList.js +121 -0
  356. package/oxy-dev-tools/core/libs/timeFormat.js +93 -0
  357. package/oxy-dev-tools/core/proxy/console.js +398 -0
  358. package/oxy-dev-tools/core/proxy/index.js +33 -0
  359. package/oxy-dev-tools/core/proxy/request.js +473 -0
  360. package/oxy-dev-tools/core/proxy/storage.js +96 -0
  361. package/oxy-dev-tools/core/proxy/uniBus.js +148 -0
  362. package/oxy-dev-tools/core/proxy/uniListen.js +190 -0
  363. package/oxy-dev-tools/core/proxy/vueMixin.js +115 -0
  364. package/oxy-dev-tools/index.ts +183 -0
  365. package/oxy-dev-tools/oxy-dev-tools.vue +62 -0
  366. package/oxy-dev-tools/page/components/bottomTools.vue +933 -0
  367. package/oxy-dev-tools/page/components/dialog/addStorage.vue +184 -0
  368. package/oxy-dev-tools/page/components/dialog/createDir.vue +352 -0
  369. package/oxy-dev-tools/page/components/dialog/editDialog.vue +178 -0
  370. package/oxy-dev-tools/page/components/dialog/routeDialog.vue +170 -0
  371. package/oxy-dev-tools/page/components/dialog/sendRequest.vue +530 -0
  372. package/oxy-dev-tools/page/components/dialog/textFileEditDialog.vue +379 -0
  373. package/oxy-dev-tools/page/components/libs/appDelDir.js +77 -0
  374. package/oxy-dev-tools/page/components/libs/dirReader.js +239 -0
  375. package/oxy-dev-tools/page/components/libs/fileSize.js +15 -0
  376. package/oxy-dev-tools/page/components/libs/getRuntimeInfo.js +132 -0
  377. package/oxy-dev-tools/page/components/listItem/consoleItem.vue +292 -0
  378. package/oxy-dev-tools/page/components/listItem/errorItem.vue +268 -0
  379. package/oxy-dev-tools/page/components/listItem/fileSysItem.vue +511 -0
  380. package/oxy-dev-tools/page/components/listItem/infoList.vue +89 -0
  381. package/oxy-dev-tools/page/components/listItem/jsRunnerItem.vue +236 -0
  382. package/oxy-dev-tools/page/components/listItem/logItem.vue +185 -0
  383. package/oxy-dev-tools/page/components/listItem/networkItem.vue +362 -0
  384. package/oxy-dev-tools/page/components/listItem/objectAnalysis.vue +642 -0
  385. package/oxy-dev-tools/page/components/listItem/pages.vue +285 -0
  386. package/oxy-dev-tools/page/components/listItem/routeItem.vue +140 -0
  387. package/oxy-dev-tools/page/components/listItem/setting.vue +687 -0
  388. package/oxy-dev-tools/page/components/listItem/storageList.vue +623 -0
  389. package/oxy-dev-tools/page/components/listItem/tools.vue +273 -0
  390. package/oxy-dev-tools/page/components/listItem/vuexList.vue +559 -0
  391. package/oxy-dev-tools/page/components/main.vue +1824 -0
  392. package/oxy-dev-tools/page/components/mixins/animationControl.js +80 -0
  393. package/oxy-dev-tools/page/components/mixins/mp.js +76 -0
  394. package/oxy-dev-tools/page/components/ui/btnTabs.vue +77 -0
  395. package/oxy-dev-tools/page/components/ui/codeHisPicker.vue +161 -0
  396. package/oxy-dev-tools/page/components/ui/h5Cell.vue +13 -0
  397. package/oxy-dev-tools/page/components/ui/menuBtn.vue +87 -0
  398. package/oxy-dev-tools/page/components/ui/mobileSwiperScroll.vue +71 -0
  399. package/oxy-dev-tools/page/components/ui/requestSpeedLimit.vue +47 -0
  400. package/oxy-dev-tools/page/components/ui/requestTimeoutMock.vue +50 -0
  401. package/oxy-dev-tools/page/components/ui/subTitleBar.vue +87 -0
  402. package/oxy-dev-tools/page/static/copy.png +0 -0
  403. package/oxy-dev-tools/page/static/delete.png +0 -0
  404. package/oxy-dev-tools/page/static/fileSys/AI.png +0 -0
  405. package/oxy-dev-tools/page/static/fileSys/DWG.png +0 -0
  406. package/oxy-dev-tools/page/static/fileSys/EXE.png +0 -0
  407. package/oxy-dev-tools/page/static/fileSys/GIF.png +0 -0
  408. package/oxy-dev-tools/page/static/fileSys/HTML.png +0 -0
  409. package/oxy-dev-tools/page/static/fileSys/PSD.png +0 -0
  410. package/oxy-dev-tools/page/static/fileSys/RVT.png +0 -0
  411. package/oxy-dev-tools/page/static/fileSys/SKP.png +0 -0
  412. package/oxy-dev-tools/page/static/fileSys/SVG.png +0 -0
  413. package/oxy-dev-tools/page/static/fileSys/excel.png +0 -0
  414. package/oxy-dev-tools/page/static/fileSys/pdf.png +0 -0
  415. package/oxy-dev-tools/page/static/fileSys/pptl.png +0 -0
  416. package/oxy-dev-tools/page/static/fileSys/shipin.png +0 -0
  417. package/oxy-dev-tools/page/static/fileSys/tupian.png +0 -0
  418. package/oxy-dev-tools/page/static/fileSys/txt.png +0 -0
  419. package/oxy-dev-tools/page/static/fileSys/weizhiwenjian.png +0 -0
  420. package/oxy-dev-tools/page/static/fileSys/wenjianjia.png +0 -0
  421. package/oxy-dev-tools/page/static/fileSys/word.png +0 -0
  422. package/oxy-dev-tools/page/static/fileSys/yasuo.png +0 -0
  423. package/oxy-dev-tools/page/static/fileSys/yinpin.png +0 -0
  424. package/oxy-dev-tools/page/static/fold.png +0 -0
  425. package/oxy-dev-tools/page/static/menu.png +0 -0
  426. package/oxy-dev-tools/page/static/refresh.png +0 -0
  427. package/oxy-dev-tools/page/static/unfold.png +0 -0
  428. package/oxy-dev-tools/tools.vue +22 -0
  429. package/oxy-dev-tools/type/devTools.d.ts +406 -0
  430. package/package.json +2 -2
  431. package/styles/all.scss +125 -0
  432. package/tags.json +1 -1
  433. package/vite-plugins/vite-plugin-host-class.ts +166 -0
  434. package/web-types.json +1 -1
@@ -20,7 +20,9 @@
20
20
  export default {
21
21
  name: 'oxy-notify',
22
22
  options: {
23
+ // #ifndef MP-TOUTIAO
23
24
  virtualHost: true,
25
+ // #endif
24
26
  addGlobalClass: true,
25
27
  styleIsolation: 'shared'
26
28
  }
@@ -29,9 +31,9 @@ export default {
29
31
 
30
32
  <script lang="ts" setup>
31
33
  import OxyPopup from '../oxy-popup/oxy-popup.vue'
32
- import { inject, computed, watch, ref } from 'vue'
33
- import { notifyProps, type NotifyProps } from './types'
34
- import { getNotifyOptionKey } from '.'
34
+ import { computed, onUnmounted, watch } from 'vue'
35
+ import { notifyProps } from './types'
36
+ import { initNotifyOptions, removeNotifyOptions, resolveNotifyScopeId } from '.'
35
37
  import { isFunction, unitConvert } from '../common/util'
36
38
 
37
39
  const props = defineProps(notifyProps)
@@ -41,7 +43,12 @@ const emits = defineEmits<{
41
43
  (e: 'closed'): void
42
44
  (e: 'opened'): void
43
45
  }>()
44
- const state = inject(getNotifyOptionKey(props.selector), ref<NotifyProps>(props))
46
+ const scopeId = resolveNotifyScopeId()
47
+ const state = initNotifyOptions(props.selector, scopeId)
48
+
49
+ onUnmounted(() => {
50
+ removeNotifyOptions(props.selector, scopeId)
51
+ })
45
52
 
46
53
  const customStyle = computed(() => {
47
54
  const { safeHeight, position } = state.value
@@ -2,11 +2,17 @@
2
2
  <oxy-transition
3
3
  :show="show"
4
4
  name="fade"
5
- custom-class="oxy-overlay"
5
+ :custom-class="`oxy-overlay ${customClass}`"
6
6
  :duration="duration"
7
7
  :custom-style="`z-index: ${zIndex}; ${customStyle}`"
8
8
  :disable-touch-move="lockScroll"
9
9
  @click="handleClick"
10
+ @before-enter="handleBeforeEnter"
11
+ @enter="handleEnter"
12
+ @after-enter="handleAfterEnter"
13
+ @before-leave="handleBeforeLeave"
14
+ @leave="handleLeave"
15
+ @after-leave="handleAfterLeave"
10
16
  >
11
17
  <slot></slot>
12
18
  </oxy-transition>
@@ -15,7 +21,9 @@
15
21
  export default {
16
22
  name: 'oxy-overlay',
17
23
  options: {
24
+ // #ifndef MP-TOUTIAO
18
25
  virtualHost: true,
26
+ // #endif
19
27
  addGlobalClass: true,
20
28
  styleIsolation: 'shared'
21
29
  }
@@ -31,12 +39,36 @@ import { useLockScroll } from '../composables/useLockScroll'
31
39
 
32
40
  const props = defineProps(overlayProps)
33
41
 
34
- const emit = defineEmits(['click'])
42
+ const emit = defineEmits(['click', 'before-enter', 'enter', 'after-enter', 'before-leave', 'leave', 'after-leave'])
35
43
 
36
44
  function handleClick() {
37
45
  emit('click')
38
46
  }
39
47
 
48
+ function handleBeforeEnter() {
49
+ emit('before-enter')
50
+ }
51
+
52
+ function handleEnter() {
53
+ emit('enter')
54
+ }
55
+
56
+ function handleAfterEnter() {
57
+ emit('after-enter')
58
+ }
59
+
60
+ function handleBeforeLeave() {
61
+ emit('before-leave')
62
+ }
63
+
64
+ function handleLeave() {
65
+ emit('leave')
66
+ }
67
+
68
+ function handleAfterLeave() {
69
+ emit('after-leave')
70
+ }
71
+
40
72
  // #ifdef H5
41
73
  useLockScroll(() => props.show && props.lockScroll)
42
74
  // #endif
@@ -42,7 +42,9 @@
42
42
  export default {
43
43
  name: 'oxy-pagination',
44
44
  options: {
45
+ // #ifndef MP-TOUTIAO
45
46
  virtualHost: true,
47
+ // #endif
46
48
  addGlobalClass: true,
47
49
  styleIsolation: 'shared'
48
50
  }
@@ -24,7 +24,9 @@
24
24
  export default {
25
25
  name: 'oxy-password-input',
26
26
  options: {
27
+ // #ifndef MP-TOUTIAO
27
28
  virtualHost: true,
29
+ // #endif
28
30
  addGlobalClass: true,
29
31
  styleIsolation: 'shared'
30
32
  }
@@ -57,7 +57,7 @@
57
57
  }
58
58
  }
59
59
  }
60
-
60
+
61
61
  @include edeep(arrow, clear) {
62
62
  display: block;
63
63
  font-size: $-cell-icon-size;
@@ -91,7 +91,7 @@
91
91
  font-size: $-picker-toolbar-fs;
92
92
  color: $-picker-toolbar-finish-color;
93
93
  background: transparent;
94
- padding: 48rpx 32rpx 32rpx 32rpx;
94
+ padding: $-spacing-48 $-spacing-32 $-spacing-32 $-spacing-32;
95
95
 
96
96
  @include m(cancel) {
97
97
  color: $-picker-toolbar-cancel-color;
@@ -101,7 +101,7 @@
101
101
  color: $-picker-loading-button-color;
102
102
  }
103
103
  }
104
-
104
+
105
105
  @include e(title) {
106
106
  display: block;
107
107
  float: 1;
@@ -109,7 +109,7 @@
109
109
  }
110
110
 
111
111
  @include e(search) {
112
- padding: 0 32rpx 28rpx 32rpx;
112
+ padding: 0 $-spacing-32 $-spacing-24 $-spacing-32;
113
113
  background: $-picker-search-bg;
114
114
  }
115
115
 
@@ -117,14 +117,14 @@
117
117
  display: flex;
118
118
  align-items: center;
119
119
  height: 80rpx;
120
- padding: 0 24rpx;
120
+ padding: 0 $-spacing-24;
121
121
  background: $-picker-column-select-bg;
122
122
  border-radius: $-picker-search-radius;
123
123
 
124
124
  input {
125
125
  flex: 1;
126
126
  height: 100%;
127
- margin-left: 20rpx;
127
+ margin-left: $-spacing-20;
128
128
  font-size: $-fs-content;
129
129
  background: transparent;
130
130
  border: none;
@@ -143,7 +143,7 @@
143
143
  justify-content: center;
144
144
  width: 32rpx;
145
145
  height: 32rpx;
146
- margin-left: 12rpx;
146
+ margin-left: $-spacing-12;
147
147
  }
148
148
 
149
149
  @include e(search-clear-icon) {
@@ -94,7 +94,9 @@
94
94
  export default {
95
95
  name: 'oxy-picker',
96
96
  options: {
97
+ // #ifndef MP-TOUTIAO
97
98
  virtualHost: true,
99
+ // #endif
98
100
  addGlobalClass: true,
99
101
  styleIsolation: 'shared'
100
102
  }
@@ -357,6 +359,9 @@ function onConfirm() {
357
359
  handleConfirm()
358
360
  }
359
361
  }
362
+ /**
363
+ * 确认选择。检查搜索结果是否为空,非空时关闭弹窗并 emit confirm 事件。
364
+ */
360
365
  function handleConfirm() {
361
366
  if (isLoading.value || props.disabled) {
362
367
  popupShow.value = false
@@ -414,6 +419,9 @@ function noop() {}
414
419
  function onPickStart() {
415
420
  isPicking.value = true
416
421
  }
422
+ /**
423
+ * 滑动结束回调。若在滑动过程中用户点击了确认,则自动触发确认。
424
+ */
417
425
  function onPickEnd() {
418
426
  isPicking.value = false
419
427
 
@@ -450,6 +458,9 @@ function clearSearch() {
450
458
  debouncedFilterColumns()
451
459
  }
452
460
 
461
+ /**
462
+ * 搜索过滤列数据。支持自定义 filterMethod 或默认按 searchKey/labelKey 过滤。
463
+ */
453
464
  function filterColumns() {
454
465
  const keyword = searchKeyword.value.trim().toLowerCase()
455
466
  emit('search', { keyword } as PickerSearchEvent)
@@ -26,7 +26,7 @@
26
26
 
27
27
  @include b(picker-view) {
28
28
  position: relative;
29
- padding: 24rpx 0;
29
+ padding: $-spacing-24 0;
30
30
 
31
31
  @include e(columns) {
32
32
  position: relative;
@@ -36,7 +36,9 @@
36
36
  export default {
37
37
  name: 'oxy-picker-view',
38
38
  options: {
39
+ // #ifndef MP-TOUTIAO
39
40
  virtualHost: true,
41
+ // #endif
40
42
  addGlobalClass: true,
41
43
  styleIsolation: 'shared'
42
44
  }
@@ -35,7 +35,7 @@
35
35
  @include edeep(icon) {
36
36
  vertical-align: middle;
37
37
  font-size: $-popover-trigger-icon-size;
38
- margin-right: 12rpx;
38
+ margin-right: $-spacing-12;
39
39
  }
40
40
 
41
41
  @include e(menu-inner) {
@@ -109,7 +109,7 @@
109
109
  right: -16rpx;
110
110
  top: -20rpx;
111
111
  transform: scale(0.5);
112
- padding: 20rpx;
112
+ padding: $-spacing-20;
113
113
  }
114
114
 
115
115
  @include squareArrow($-popover-arrow-size, $-popover-bg, $-popover-z-index - 1, $-popover-arrow-box-shadow);
@@ -1,6 +1,5 @@
1
1
  <template>
2
2
  <view :class="`oxy-popover ${customClass}`" :style="customStyle" id="popover" @click.stop="popover.noop">
3
- <!-- 使用插槽时无法获取正确宽高 -->
4
3
  <view class="oxy-popover__pos oxy-popover__hidden" id="pos">
5
4
  <view :class="`oxy-popover__container ${customPop}`">
6
5
  <view v-if="!useContentSlot && mode === 'normal'" class="oxy-popover__inner">
@@ -12,6 +11,8 @@
12
11
  <text>{{ item.content }}</text>
13
12
  </view>
14
13
  </view>
14
+ <!-- 自定义插槽内容副本,用于获取正确宽高 -->
15
+ <slot name="content" v-if="useContentSlot" />
15
16
  </view>
16
17
  </view>
17
18
  <oxy-transition custom-class="oxy-popover__pos" :custom-style="popover.popStyle.value" :show="showPopover" name="fade" :duration="200">
@@ -53,7 +54,9 @@
53
54
  export default {
54
55
  name: 'oxy-popover',
55
56
  options: {
57
+ // #ifndef MP-TOUTIAO
56
58
  virtualHost: true,
59
+ // #endif
57
60
  addGlobalClass: true,
58
61
  styleIsolation: 'shared'
59
62
  }
@@ -19,6 +19,7 @@
19
19
  :show="modelValue"
20
20
  :name="transitionName"
21
21
  :destroy="hideWhenClose"
22
+ :disable-touch-move="lockScroll"
22
23
  @before-enter="emit('before-enter')"
23
24
  @enter="emit('enter')"
24
25
  @after-enter="emit('after-enter')"
@@ -52,6 +53,7 @@
52
53
  :show="modelValue"
53
54
  :name="transitionName"
54
55
  :destroy="hideWhenClose"
56
+ :disable-touch-move="lockScroll"
55
57
  @before-enter="emit('before-enter')"
56
58
  @enter="emit('enter')"
57
59
  @after-enter="emit('after-enter')"
@@ -69,7 +71,9 @@
69
71
  export default {
70
72
  name: 'oxy-popup',
71
73
  options: {
74
+ // #ifndef MP-TOUTIAO
72
75
  virtualHost: true,
76
+ // #endif
73
77
  addGlobalClass: true,
74
78
  styleIsolation: 'shared'
75
79
  }
@@ -166,6 +170,10 @@ const rootClass = computed(() => {
166
170
  return `oxy-popup oxy-popup--${props.position} ${!props.transition && props.position === 'center' ? 'is-deep' : ''} ${props.customClass || ''}`
167
171
  })
168
172
 
173
+ /**
174
+ * 初始化安全区域底部距离。
175
+ * 微信小程序使用 screenHeight - safeArea.bottom 计算,其他端使用 safeAreaInsets.bottom。
176
+ */
169
177
  onBeforeMount(() => {
170
178
  if (props.safeAreaInsetBottom) {
171
179
  const { safeArea, screenHeight, safeAreaInsets } = uni.getSystemInfoSync()
@@ -47,8 +47,8 @@
47
47
  }
48
48
  }
49
49
  @include edeep(label) {
50
- width: 60rpx;
51
- margin-left: 20rpx;
50
+ width: 80rpx;
51
+ margin-left: $-spacing-20;
52
52
  color: $-progress-label-color;
53
53
  font-size: $-progress-label-fs;
54
54
  }
@@ -17,7 +17,9 @@
17
17
  export default {
18
18
  name: 'oxy-progress',
19
19
  options: {
20
+ // #ifndef MP-TOUTIAO
20
21
  virtualHost: true,
22
+ // #endif
21
23
  addGlobalClass: true,
22
24
  styleIsolation: 'shared'
23
25
  }
@@ -176,6 +178,11 @@ function createPartList(colorArray: string[] | ProgressColor[]) {
176
178
  }))
177
179
  }
178
180
 
181
+ /**
182
+ * 分步更新进度到目标百分比。使用 setTimeout 链式调用,依次完成每一段颜色的进度变化。
183
+ * @param targetPercent - 目标百分比
184
+ * @param color - 对应颜色
185
+ */
179
186
  function update(targetPercent: number, color: string) {
180
187
  if (timer) return
181
188
  const { duration } = props
@@ -380,7 +380,21 @@ export function canvasToPng(canvas: HTMLCanvasElement): Promise<string> {
380
380
  // #ifdef MP
381
381
  const data = canvas.toDataURL('image/png', 1)
382
382
  const fileMg = uni.getFileSystemManager()
383
- const filepath = `${wx.env.USER_DATA_PATH}/${uuid()}.png`
383
+ const envInfo = (uni as any).getEnvInfoSync?.() ?? {}
384
+ const runtimeGlobal = globalThis as any
385
+ const userDataPath =
386
+ envInfo.USER_DATA_PATH ||
387
+ runtimeGlobal?.wx?.env?.USER_DATA_PATH ||
388
+ runtimeGlobal?.tt?.env?.USER_DATA_PATH ||
389
+ runtimeGlobal?.my?.env?.USER_DATA_PATH ||
390
+ runtimeGlobal?.qq?.env?.USER_DATA_PATH ||
391
+ runtimeGlobal?.swan?.env?.USER_DATA_PATH ||
392
+ ''
393
+ if (!userDataPath) {
394
+ resolve('')
395
+ return
396
+ }
397
+ const filepath = `${userDataPath}/${uuid()}.png`
384
398
  fileMg.writeFile({
385
399
  filePath: filepath,
386
400
  data: data.split(',')[1],
@@ -7,7 +7,9 @@
7
7
  export default {
8
8
  name: 'oxy-qrcode',
9
9
  options: {
10
+ // #ifndef MP-TOUTIAO
10
11
  virtualHost: true,
12
+ // #endif
11
13
  addGlobalClass: true,
12
14
  styleIsolation: 'shared'
13
15
  }
@@ -25,14 +27,16 @@ const props = defineProps(qrcodeProps)
25
27
  const qrcodeId = ref<string>('oxy-qrcode-' + uuid())
26
28
 
27
29
  /**
28
- * 主绘制方法,根据当前 props 生成二维码并绘制到 canvas。
29
- * 支持多平台(APP、H5、微信小程序),自动适配高分屏。
30
- * 内部调用 drawQrcode 进行二维码点阵绘制。
30
+ * 将尺寸值转换为数值(默认 rpx),用于二维码计算。
31
31
  */
32
32
  function getUnitNumber(value: number | string) {
33
33
  return unitConvertWithDefault(value, { defaultUnit: 'rpx' })
34
34
  }
35
35
 
36
+ /**
37
+ * 主绘制方法,根据当前 props 生成二维码并绘制到 canvas。
38
+ * 支持多平台(APP、H5、微信小程序),自动适配高清屏(dpr 缩放)。
39
+ */
36
40
  function drawer() {
37
41
  const data = {
38
42
  text: props.text,
@@ -102,6 +106,9 @@ function getUnit(value: number | string) {
102
106
  return unitConvert(withDefaultUnit(value, 'rpx'), 0, { output: 'px' })
103
107
  }
104
108
 
109
+ /**
110
+ * 延迟绘制二维码。HarmonyOS / iOS App 需要 50ms 延迟以确保 canvas 节点就绪。
111
+ */
105
112
  onMounted(() => {
106
113
  setTimeout(
107
114
  () => {
@@ -159,7 +159,7 @@
159
159
  height: $-radio-button-height;
160
160
  min-width: $-radio-button-min-width;
161
161
  max-width: $-radio-button-max-width;
162
- padding: 16rpx 32rpx;
162
+ padding: $-radio-button-padding;
163
163
  margin-right: 0;
164
164
  line-height: 1.2;
165
165
  text-align: center;
@@ -169,7 +169,7 @@
169
169
  font-size: $-radio-button-fs;
170
170
  box-sizing: border-box;
171
171
  border: 1px solid $-radio-button-border;
172
- transition: all 0.2s;
172
+ transition: all $-transition-duration-base;
173
173
  @include lineEllipsis;
174
174
  }
175
175
  @include when(checked) {
@@ -195,7 +195,7 @@
195
195
  }
196
196
  .oxy-radio__shape {
197
197
  display: block;
198
- margin-right: 8rpx;
198
+ margin-right: $-spacing-8;
199
199
  float: left;
200
200
  &::after {
201
201
  content: "";
@@ -206,7 +206,7 @@
206
206
 
207
207
  @include when(dot) {
208
208
  .oxy-radio__shape {
209
- margin-top: 4rpx;
209
+ margin-top: $-spacing-4;
210
210
  }
211
211
  @include when(large) {
212
212
  .oxy-radio__shape {
@@ -218,7 +218,7 @@
218
218
  &.icon-placement-right {
219
219
  .oxy-radio__shape {
220
220
  margin-right: 0;
221
- margin-left: 8rpx;
221
+ margin-left: $-spacing-8;
222
222
  float: right;
223
223
  }
224
224
  }
@@ -265,18 +265,18 @@
265
265
 
266
266
  // 以下内容用于解决父子组件样式隔离的问题 —— START
267
267
  @include when(cell-radio) {
268
- padding: 32rpx 32rpx;
268
+ padding: $-cell-wrapper-padding $-cell-padding;
269
269
  margin: 0;
270
270
 
271
271
  @include when(large) {
272
- padding: 32rpx 32rpx;
272
+ padding: $-cell-wrapper-padding-large $-cell-padding;
273
273
  }
274
274
  }
275
275
 
276
276
  @include when(button-radio) {
277
277
  display: inline-flex;
278
278
  width: 33.3333%;
279
- padding: 24rpx 24rpx 0 0;
279
+ padding: $-cell-wrapper-padding $-cell-padding 0 0;
280
280
  box-sizing: border-box;
281
281
 
282
282
  .oxy-radio__label {
@@ -25,7 +25,9 @@
25
25
  export default {
26
26
  name: 'oxy-radio',
27
27
  options: {
28
+ // #ifndef MP-TOUTIAO
28
29
  virtualHost: true,
30
+ // #endif
29
31
  addGlobalClass: true,
30
32
  styleIsolation: 'shared'
31
33
  }
@@ -44,26 +46,26 @@ const props = defineProps(radioProps)
44
46
  const { parent: radioGroup } = useParent(RADIO_GROUP_KEY)
45
47
 
46
48
  const isChecked = computed(() => {
47
- if (radioGroup) {
48
- return props.value === radioGroup.props.modelValue
49
+ if (radioGroup.value) {
50
+ return props.value === radioGroup.value.props.modelValue
49
51
  } else {
50
52
  return false
51
53
  }
52
54
  })
53
55
 
54
56
  const shapeValue = computed(() => {
55
- return props.shape || getPropByPath(radioGroup, 'props.shape')
57
+ return props.shape || getPropByPath(radioGroup.value, 'props.shape')
56
58
  })
57
59
 
58
60
  const checkedColorValue = computed(() => {
59
- return props.checkedColor || getPropByPath(radioGroup, 'props.checkedColor')
61
+ return props.checkedColor || getPropByPath(radioGroup.value, 'props.checkedColor')
60
62
  })
61
63
 
62
64
  const disabledValue = computed(() => {
63
65
  if (isDef(props.disabled)) {
64
66
  return props.disabled
65
67
  } else {
66
- return getPropByPath(radioGroup, 'props.disabled')
68
+ return getPropByPath(radioGroup.value, 'props.disabled')
67
69
  }
68
70
  })
69
71
 
@@ -71,19 +73,19 @@ const inlineValue = computed(() => {
71
73
  if (isDef(props.inline)) {
72
74
  return props.inline
73
75
  } else {
74
- return getPropByPath(radioGroup, 'props.inline')
76
+ return getPropByPath(radioGroup.value, 'props.inline')
75
77
  }
76
78
  })
77
79
 
78
80
  const sizeValue = computed(() => {
79
- return props.size || getPropByPath(radioGroup, 'props.size')
81
+ return props.size || getPropByPath(radioGroup.value, 'props.size')
80
82
  })
81
83
 
82
84
  const cellValue = computed(() => {
83
85
  if (isDef(props.cell)) {
84
86
  return props.cell
85
87
  } else {
86
- return getPropByPath(radioGroup, 'props.cell')
88
+ return getPropByPath(radioGroup.value, 'props.cell')
87
89
  }
88
90
  })
89
91
 
@@ -91,7 +93,7 @@ const iconPlacement = computed<RadioIconPlacement>(() => {
91
93
  if (isDef(props.iconPlacement)) {
92
94
  return props.iconPlacement
93
95
  } else {
94
- return getPropByPath(radioGroup, 'props.iconPlacement')
96
+ return getPropByPath(radioGroup.value, 'props.iconPlacement')
95
97
  }
96
98
  })
97
99
 
@@ -108,8 +110,8 @@ watch(
108
110
  */
109
111
  function handleClick() {
110
112
  const { value } = props
111
- if (!disabledValue.value && radioGroup && isDef(value)) {
112
- radioGroup.updateValue(value)
113
+ if (!disabledValue.value && radioGroup.value && isDef(value)) {
114
+ radioGroup.value.updateValue(value)
113
115
  }
114
116
  }
115
117
  </script>
@@ -14,7 +14,7 @@
14
14
  // 顶部与两侧留白适当放大,避免按钮组在16px基准字号下过于紧凑
15
15
  @include when(button) {
16
16
  width: 100%;
17
- padding: 24rpx 32rpx 40rpx 32rpx;
17
+ padding: $-cell-wrapper-padding $-cell-padding $-spacing-32 $-cell-padding;
18
18
  box-sizing: border-box;
19
19
  overflow: hidden;
20
20
  height: auto;
@@ -7,7 +7,9 @@
7
7
  export default {
8
8
  name: 'oxy-radio-group',
9
9
  options: {
10
+ // #ifndef MP-TOUTIAO
10
11
  virtualHost: true,
12
+ // #endif
11
13
  addGlobalClass: true,
12
14
  styleIsolation: 'shared'
13
15
  }
@@ -31,7 +31,9 @@ export default {
31
31
  name: 'oxy-rate',
32
32
  options: {
33
33
  addGlobalClass: true,
34
+ // #ifndef MP-TOUTIAO
34
35
  virtualHost: true,
36
+ // #endif
35
37
  styleIsolation: 'shared'
36
38
  }
37
39
  }
@@ -155,6 +157,9 @@ function updateValue(value: number) {
155
157
  })
156
158
  }
157
159
 
160
+ /**
161
+ * 触摸滑动评分。根据触摸点的 clientX 和每个星的 rect 判断当前触摸的星级和半星,实时更新评分。
162
+ */
158
163
  async function onTouchMove(event: TouchEvent) {
159
164
  const { clientX } = event.touches[0]
160
165
  const rateItems = await getRect('.oxy-rate__item', true, proxy)
@@ -31,9 +31,9 @@ export const rateProps = {
31
31
  /**
32
32
  * 图标大小
33
33
  * 类型: string
34
- * 默认值: '32rpx'
34
+ * 默认值: '36rpx'
35
35
  */
36
- size: makeStringProp('32rpx'),
36
+ size: makeStringProp('36rpx'),
37
37
 
38
38
  /**
39
39
  * 图标间距
@@ -34,7 +34,9 @@
34
34
  export default {
35
35
  name: 'oxy-resize',
36
36
  options: {
37
+ // #ifndef MP-TOUTIAO
37
38
  virtualHost: true,
39
+ // #endif
38
40
  addGlobalClass: true,
39
41
  styleIsolation: 'shared'
40
42
  }
@@ -69,6 +71,12 @@ const { proxy } = getCurrentInstance() as any
69
71
 
70
72
  const resizeId = ref<string>(`resize${uuid()}`)
71
73
 
74
+ /**
75
+ * 初始化尺寸监听。通过双 scroll-view 滚动到底部的技巧模拟 ResizeObserver:
76
+ * - 插槽内容变化 → 容器尺寸变化 → scroll-view 自动滚动到底部 → 触发 @scroll
77
+ * - 前 3 次 scroll 事件为初始化/滚动到底部的副作用,第 4 次起才是真正的尺寸变化
78
+ * - 宽高变化时 emit('resize') 通知外部
79
+ */
72
80
  onMounted(() => {
73
81
  // 初始化数据获取
74
82
  const query = uni.createSelectorQuery().in(proxy).select(`#${resizeId.value}`).boundingClientRect()
@@ -132,6 +140,10 @@ onMounted(() => {
132
140
  })
133
141
  })
134
142
 
143
+ /**
144
+ * 将双 scroll-view 滚动到底部。expand 滚动到远超容器的位置确保始终在底部,
145
+ * shrink 滚动到相对较近的位置以便检测尺寸缩小。
146
+ */
135
147
  function scrollToBottom({ lastWidth, lastHeight }: { lastWidth: number; lastHeight: number }) {
136
148
  expandScrollTop.value = 100000 + lastHeight
137
149
  shrinkScrollTop.value = 3 * height.value + lastHeight