oxy-uni-ui 1.2.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/attributes.json +1 -1
  2. package/components/common/abstracts/variable.scss +396 -321
  3. package/components/common/path.ts +9 -0
  4. package/components/common/util.ts +200 -5
  5. package/components/composables/index.ts +1 -0
  6. package/components/composables/useGlobalLoading.ts +42 -0
  7. package/components/composables/useGlobalMessage.ts +48 -0
  8. package/components/composables/useGlobalToast.ts +84 -0
  9. package/components/composables/usePopover.ts +24 -20
  10. package/components/composables/useVirtualScroll.ts +13 -11
  11. package/components/composables/useWindowResize.ts +35 -0
  12. package/components/oxy-action-sheet/index.scss +24 -11
  13. package/components/oxy-action-sheet/oxy-action-sheet.vue +27 -19
  14. package/components/oxy-action-sheet/types.ts +7 -0
  15. package/components/oxy-backtop/index.scss +3 -3
  16. package/components/oxy-backtop/oxy-backtop.vue +9 -6
  17. package/components/oxy-backtop/types.ts +7 -7
  18. package/components/oxy-badge/index.scss +4 -4
  19. package/components/oxy-badge/oxy-badge.vue +3 -3
  20. package/components/oxy-badge/types.ts +2 -2
  21. package/components/oxy-button/index.scss +5 -5
  22. package/components/oxy-button/oxy-button.vue +5 -1
  23. package/components/oxy-calendar/index.scss +11 -11
  24. package/components/oxy-calendar/oxy-calendar.vue +1 -0
  25. package/components/oxy-calendar/types.ts +5 -0
  26. package/components/oxy-calendar-view/month/index.scss +4 -4
  27. package/components/oxy-calendar-view/month/types.ts +36 -0
  28. package/components/oxy-calendar-view/monthPanel/index.scss +7 -7
  29. package/components/oxy-calendar-view/monthPanel/month-panel.vue +14 -8
  30. package/components/oxy-calendar-view/year/index.scss +4 -4
  31. package/components/oxy-calendar-view/yearPanel/index.scss +4 -4
  32. package/components/oxy-calendar-view/yearPanel/year-panel.vue +21 -5
  33. package/components/oxy-card/index.scss +2 -2
  34. package/components/oxy-cell/index.scss +8 -8
  35. package/components/oxy-cell/oxy-cell.vue +15 -2
  36. package/components/oxy-cell/types.ts +4 -0
  37. package/components/oxy-checkbox/index.scss +8 -8
  38. package/components/oxy-checkbox/oxy-checkbox.vue +2 -2
  39. package/components/oxy-checkbox-group/index.scss +2 -2
  40. package/components/oxy-circle/oxy-circle.vue +10 -7
  41. package/components/oxy-circle/types.ts +5 -5
  42. package/components/oxy-col/oxy-col.vue +2 -2
  43. package/components/oxy-col-picker/index.scss +4 -4
  44. package/components/oxy-col-picker/oxy-col-picker.vue +9 -5
  45. package/components/oxy-col-picker/types.ts +12 -3
  46. package/components/oxy-collapse/index.scss +2 -2
  47. package/components/oxy-collapse-item/oxy-collapse-item.vue +3 -3
  48. package/components/oxy-corner/index.scss +32 -32
  49. package/components/oxy-corner/oxy-corner.vue +15 -3
  50. package/components/oxy-corner/types.ts +15 -1
  51. package/components/oxy-count-to/oxy-count-to.vue +3 -3
  52. package/components/oxy-curtain/index.scss +15 -15
  53. package/components/oxy-curtain/oxy-curtain.vue +4 -2
  54. package/components/oxy-curtain/types.ts +6 -1
  55. package/components/oxy-date-strip/index.scss +10 -0
  56. package/components/oxy-date-strip/oxy-date-strip.vue +198 -0
  57. package/components/oxy-date-strip/types.ts +98 -0
  58. package/components/oxy-date-strip/utils.ts +67 -0
  59. package/components/oxy-date-strip-item/index.scss +94 -0
  60. package/components/oxy-date-strip-item/oxy-date-strip-item.vue +102 -0
  61. package/components/oxy-date-strip-item/types.ts +53 -0
  62. package/components/oxy-datetime-picker/index.scss +11 -11
  63. package/components/oxy-datetime-picker/oxy-datetime-picker.vue +4 -1
  64. package/components/oxy-datetime-picker/types.ts +10 -1
  65. package/components/oxy-drop-menu/index.scss +3 -3
  66. package/components/oxy-drop-menu/oxy-drop-menu.vue +3 -3
  67. package/components/oxy-drop-menu-item/index.scss +1 -1
  68. package/components/oxy-drop-menu-item/oxy-drop-menu-item.vue +4 -3
  69. package/components/oxy-drop-menu-item/types.ts +5 -0
  70. package/components/oxy-echarts/index.scss +17 -0
  71. package/components/oxy-echarts/index.ts +1 -0
  72. package/components/oxy-echarts/oxy-echarts.vue +32 -0
  73. package/components/oxy-echarts/types.ts +18 -0
  74. package/components/oxy-fab/index.scss +8 -8
  75. package/components/oxy-fab/oxy-fab.vue +22 -3
  76. package/components/oxy-file-list/index.scss +42 -15
  77. package/components/oxy-file-list/oxy-file-list.vue +208 -34
  78. package/components/oxy-file-list/types.ts +58 -2
  79. package/components/oxy-floating-panel/oxy-floating-panel.vue +13 -9
  80. package/components/oxy-floating-panel/{type.ts → types.ts} +8 -8
  81. package/components/oxy-footer/index.scss +19 -0
  82. package/components/oxy-footer/oxy-footer.vue +78 -0
  83. package/components/oxy-footer/types.ts +17 -0
  84. package/components/oxy-form-item/types.ts +22 -1
  85. package/components/oxy-gap/oxy-gap.vue +2 -2
  86. package/components/oxy-gap/types.ts +2 -2
  87. package/components/oxy-global-loading/oxy-global-loading.vue +53 -0
  88. package/components/oxy-global-message/oxy-global-message.vue +64 -0
  89. package/components/oxy-global-toast/oxy-global-toast.vue +53 -0
  90. package/components/oxy-grid/oxy-grid.vue +1 -1
  91. package/components/oxy-grid/types.ts +1 -1
  92. package/components/oxy-grid-item/index.scss +1 -1
  93. package/components/oxy-grid-item/oxy-grid-item.vue +7 -5
  94. package/components/oxy-grid-item/types.ts +1 -1
  95. package/components/oxy-guidance/index.scss +75 -0
  96. package/components/oxy-guidance/oxy-guidance.vue +201 -0
  97. package/components/oxy-guidance/types.ts +33 -0
  98. package/components/oxy-icon/oxy-icon.vue +2 -2
  99. package/components/oxy-icon/types.ts +1 -1
  100. package/components/oxy-img/oxy-img.vue +4 -4
  101. package/components/oxy-img/types.ts +3 -3
  102. package/components/oxy-img-cropper/index.scss +12 -12
  103. package/components/oxy-img-cropper/oxy-img-cropper.vue +97 -52
  104. package/components/oxy-img-cropper/types.ts +2 -2
  105. package/components/oxy-img-lazy/index.scss +17 -0
  106. package/components/oxy-img-lazy/oxy-img-lazy.vue +332 -0
  107. package/components/oxy-img-lazy/types.ts +69 -0
  108. package/components/oxy-index-anchor/index.scss +2 -2
  109. package/components/oxy-index-anchor/oxy-index-anchor.vue +2 -2
  110. package/components/oxy-index-anchor/{type.ts → types.ts} +3 -0
  111. package/components/oxy-index-bar/index.scss +3 -3
  112. package/components/oxy-index-bar/oxy-index-bar.vue +3 -3
  113. package/components/oxy-index-bar/{type.ts → types.ts} +2 -2
  114. package/components/oxy-input/index.scss +1 -1
  115. package/components/oxy-input-number/index.scss +5 -5
  116. package/components/oxy-input-number/oxy-input-number.vue +2 -2
  117. package/components/oxy-input-number/types.ts +3 -2
  118. package/components/oxy-keyboard/index.scss +5 -5
  119. package/components/oxy-keyboard/key/index.scss +3 -3
  120. package/components/oxy-keyboard/key/index.vue +2 -2
  121. package/components/oxy-keyboard/key/types.ts +15 -0
  122. package/components/oxy-keyboard/oxy-keyboard.vue +1 -0
  123. package/components/oxy-keyboard/types.ts +5 -0
  124. package/components/oxy-link/index.scss +57 -0
  125. package/components/oxy-link/oxy-link.vue +130 -0
  126. package/components/oxy-link/types.ts +81 -0
  127. package/components/oxy-list/index.scss +7 -1
  128. package/components/oxy-list/oxy-list.vue +4 -3
  129. package/components/oxy-list/types.ts +1 -1
  130. package/components/oxy-loading/oxy-loading.vue +8 -4
  131. package/components/oxy-loading/types.ts +1 -1
  132. package/components/oxy-loadmore/index.scss +3 -3
  133. package/components/oxy-long-press-menu/index.scss +93 -0
  134. package/components/oxy-long-press-menu/oxy-long-press-menu.vue +338 -0
  135. package/components/oxy-long-press-menu/types.ts +34 -0
  136. package/components/oxy-message-box/index.scss +12 -11
  137. package/components/oxy-message-box/oxy-message-box.vue +11 -3
  138. package/components/oxy-message-box/types.ts +14 -0
  139. package/components/oxy-navbar/index.scss +2 -2
  140. package/components/oxy-navbar/oxy-navbar.vue +58 -13
  141. package/components/oxy-navbar/types.ts +8 -1
  142. package/components/oxy-navbar-capsule/types.ts +3 -0
  143. package/components/oxy-notice-bar/index.scss +3 -3
  144. package/components/oxy-notice-bar/oxy-notice-bar.vue +9 -5
  145. package/components/oxy-notice-bar/types.ts +3 -3
  146. package/components/oxy-notify/index.ts +1 -0
  147. package/components/oxy-notify/oxy-notify.vue +3 -2
  148. package/components/oxy-notify/types.ts +7 -0
  149. package/components/oxy-pagination/index.scss +1 -1
  150. package/components/oxy-password-input/oxy-password-input.vue +2 -2
  151. package/components/oxy-password-input/types.ts +1 -1
  152. package/components/oxy-picker/index.scss +45 -2
  153. package/components/oxy-picker/oxy-picker.vue +103 -14
  154. package/components/oxy-picker/types.ts +33 -1
  155. package/components/oxy-picker-view/index.scss +3 -3
  156. package/components/oxy-picker-view/oxy-picker-view.vue +4 -4
  157. package/components/oxy-popover/index.scss +9 -9
  158. package/components/oxy-popup/index.scss +2 -2
  159. package/components/oxy-popup/oxy-popup.vue +35 -2
  160. package/components/oxy-popup/types.ts +8 -1
  161. package/components/oxy-progress/index.scss +3 -3
  162. package/components/oxy-qrcode/draw.ts +398 -0
  163. package/components/oxy-qrcode/index.scss +2 -0
  164. package/components/oxy-qrcode/oxy-qrcode.vue +124 -0
  165. package/components/oxy-qrcode/qrcode.ts +936 -0
  166. package/components/oxy-qrcode/types.ts +42 -0
  167. package/components/oxy-radio/index.scss +13 -13
  168. package/components/oxy-radio/oxy-radio.vue +1 -1
  169. package/components/oxy-radio-group/index.scss +2 -2
  170. package/components/oxy-rate/types.ts +4 -4
  171. package/components/oxy-resize/index.scss +2 -2
  172. package/components/oxy-resize/oxy-resize.vue +4 -4
  173. package/components/oxy-resize/types.ts +3 -0
  174. package/components/oxy-rich-text/icon/emjio.svg +1 -0
  175. package/components/oxy-rich-text/icon/quote.svg +1 -0
  176. package/components/oxy-rich-text/icon/text.svg +1 -0
  177. package/components/oxy-rich-text/icon/title.svg +1 -0
  178. package/components/oxy-rich-text/index.scss +160 -0
  179. package/components/oxy-rich-text/mp-html/card/card.vue +122 -0
  180. package/components/oxy-rich-text/mp-html/card/index.js +7 -0
  181. package/components/oxy-rich-text/mp-html/editable/config.js +15 -0
  182. package/components/oxy-rich-text/mp-html/editable/index.js +553 -0
  183. package/components/oxy-rich-text/mp-html/emoji/index.js +203 -0
  184. package/components/oxy-rich-text/mp-html/highlight/config.js +5 -0
  185. package/components/oxy-rich-text/mp-html/highlight/index.js +96 -0
  186. package/components/oxy-rich-text/mp-html/highlight/prism.css +1 -0
  187. package/components/oxy-rich-text/mp-html/highlight/prism.min.js +7 -0
  188. package/components/oxy-rich-text/mp-html/img-cache/index.js +138 -0
  189. package/components/oxy-rich-text/mp-html/latex/index.js +80 -0
  190. package/components/oxy-rich-text/mp-html/latex/katex.css +1 -0
  191. package/components/oxy-rich-text/mp-html/latex/katex.min.js +1 -0
  192. package/components/oxy-rich-text/mp-html/markdown/index.js +50 -0
  193. package/components/oxy-rich-text/mp-html/markdown/marked.min.js +71 -0
  194. package/components/oxy-rich-text/mp-html/mp-html.d.ts +184 -0
  195. package/components/oxy-rich-text/mp-html/mp-html.vue +684 -0
  196. package/components/oxy-rich-text/mp-html/node/node.vue +1172 -0
  197. package/components/oxy-rich-text/mp-html/parser.js +1428 -0
  198. package/components/oxy-rich-text/mp-html/search/index.js +132 -0
  199. package/components/oxy-rich-text/mp-html/style/index.js +129 -0
  200. package/components/oxy-rich-text/mp-html/style/parser.js +175 -0
  201. package/components/oxy-rich-text/mp-html/template/index.js +67 -0
  202. package/components/oxy-rich-text/mp-html/txv-video/index.js +46 -0
  203. package/components/oxy-rich-text/oxy-rich-text.vue +642 -0
  204. package/components/oxy-rich-text/types.ts +76 -0
  205. package/components/oxy-row/oxy-row.vue +3 -3
  206. package/components/oxy-row/types.ts +1 -1
  207. package/components/oxy-search/index.scss +3 -3
  208. package/components/oxy-segmented/index.scss +16 -16
  209. package/components/oxy-segmented/oxy-segmented.vue +23 -3
  210. package/components/oxy-select/index.scss +331 -0
  211. package/components/oxy-select/oxy-select.vue +456 -0
  212. package/components/oxy-select/types.ts +83 -0
  213. package/components/oxy-select-picker/index.scss +7 -7
  214. package/components/oxy-select-picker/oxy-select-picker.vue +4 -0
  215. package/components/oxy-select-picker/types.ts +7 -1
  216. package/components/oxy-sidebar-item/index.scss +1 -1
  217. package/components/oxy-signature/oxy-signature.vue +18 -10
  218. package/components/oxy-signature/types.ts +106 -13
  219. package/components/oxy-skeleton/oxy-skeleton.vue +6 -6
  220. package/components/oxy-skeleton/types.ts +1 -1
  221. package/components/oxy-slider/index.scss +3 -3
  222. package/components/oxy-sort-button/index.scss +8 -8
  223. package/components/oxy-status-tip/index.scss +4 -4
  224. package/components/oxy-status-tip/oxy-status-tip.vue +5 -5
  225. package/components/oxy-status-tip/types.ts +3 -3
  226. package/components/oxy-step/index.scss +14 -14
  227. package/components/oxy-sticky/oxy-sticky.vue +6 -6
  228. package/components/oxy-stream-render/index.scss +6 -0
  229. package/components/oxy-stream-render/oxy-stream-render.vue +204 -0
  230. package/components/oxy-stream-render/types.ts +8 -0
  231. package/components/oxy-swipe-action/oxy-swipe-action.vue +27 -2
  232. package/components/oxy-swiper/oxy-swiper.vue +6 -6
  233. package/components/oxy-swiper/types.ts +5 -5
  234. package/components/oxy-switch/index.scss +8 -8
  235. package/components/oxy-switch/oxy-switch.vue +2 -2
  236. package/components/oxy-switch/types.ts +1 -1
  237. package/components/oxy-tab/index.scss +11 -1
  238. package/components/oxy-tabbar/index.scss +1 -1
  239. package/components/oxy-tabbar/oxy-tabbar.vue +39 -10
  240. package/components/oxy-table/index.scss +5 -5
  241. package/components/oxy-table/oxy-table.vue +8 -6
  242. package/components/oxy-table/types.ts +2 -2
  243. package/components/oxy-table-col/oxy-table-col.vue +3 -3
  244. package/components/oxy-table-col/types.ts +2 -2
  245. package/components/oxy-tabs/index.scss +43 -15
  246. package/components/oxy-tabs/oxy-tabs.vue +53 -19
  247. package/components/oxy-tabs/types.ts +15 -3
  248. package/components/oxy-tag/index.scss +15 -15
  249. package/components/oxy-text/index.scss +5 -1
  250. package/components/oxy-text/oxy-text.vue +76 -7
  251. package/components/oxy-text/types.ts +12 -0
  252. package/components/oxy-textarea/index.scss +6 -6
  253. package/components/oxy-toast/oxy-toast.vue +24 -8
  254. package/components/oxy-tooltip/index.scss +9 -9
  255. package/components/oxy-tree/index.scss +61 -9
  256. package/components/oxy-tree/oxy-tree.vue +102 -17
  257. package/components/oxy-tree/types.ts +23 -10
  258. package/components/oxy-upload/index.scss +21 -21
  259. package/components/oxy-upload/types.ts +2 -2
  260. package/components/oxy-verification-code/index.scss +6 -0
  261. package/components/oxy-verification-code/oxy-verification-code.vue +187 -0
  262. package/components/oxy-verification-code/types.ts +82 -0
  263. package/components/oxy-video-preview/index.scss +4 -4
  264. package/components/oxy-virtual-scroll/index.scss +4 -4
  265. package/components/oxy-virtual-scroll/oxy-virtual-scroll.vue +11 -7
  266. package/components/oxy-virtual-scroll/types.ts +14 -14
  267. package/components/oxy-voice-player/index.scss +908 -0
  268. package/components/oxy-voice-player/oxy-voice-player.vue +821 -0
  269. package/components/oxy-voice-player/types.ts +567 -0
  270. package/components/oxy-waterfall/index.scss +18 -0
  271. package/components/oxy-waterfall/oxy-waterfall.vue +218 -0
  272. package/components/oxy-waterfall/types.ts +90 -0
  273. package/components/oxy-waterfall-item/index.scss +8 -0
  274. package/components/oxy-waterfall-item/oxy-waterfall-item.vue +89 -0
  275. package/components/oxy-waterfall-item/types.ts +16 -0
  276. package/components/oxy-watermark/oxy-watermark.vue +35 -13
  277. package/components/oxy-watermark/types.ts +14 -14
  278. package/global.d.ts +9 -0
  279. package/index.ts +3 -0
  280. package/locale/lang/ar-SA.ts +3 -0
  281. package/locale/lang/en-US.ts +29 -0
  282. package/locale/lang/zh-CN.ts +29 -0
  283. package/package.json +97 -1
  284. package/tags.json +1 -1
  285. package/uni-echarts/changelog.md +2 -0
  286. package/uni-echarts/components/index.js +1 -0
  287. package/uni-echarts/components/uni-echarts/events.js +95 -0
  288. package/uni-echarts/components/uni-echarts/types.d.ts +183 -0
  289. package/uni-echarts/components/uni-echarts/types.js +1 -0
  290. package/uni-echarts/components/uni-echarts/uni-echarts.vue +530 -0
  291. package/uni-echarts/components/uni-echarts/uni-echarts.vue.d.ts +19 -0
  292. package/uni-echarts/global.d.ts +7 -0
  293. package/uni-echarts/index.d.ts +440 -0
  294. package/uni-echarts/index.js +2 -0
  295. package/uni-echarts/package.json +105 -0
  296. package/uni-echarts/shared-core.d.ts +269 -0
  297. package/uni-echarts/shared-core.js +900 -0
  298. package/web-types.json +1 -1
  299. package/components/oxy-number-keyboard/index.scss +0 -78
  300. package/components/oxy-number-keyboard/key/index.scss +0 -81
  301. package/components/oxy-number-keyboard/key/index.vue +0 -78
  302. package/components/oxy-number-keyboard/key/types.ts +0 -11
  303. package/components/oxy-number-keyboard/oxy-number-keyboard.vue +0 -151
  304. package/components/oxy-number-keyboard/types.ts +0 -83
  305. package/components/oxy-tree/components/tree-node-content.vue +0 -72
  306. package/components/oxy-tree/index.ts +0 -51
@@ -22,15 +22,15 @@
22
22
 
23
23
  @include edeep(pos) {
24
24
  position: absolute;
25
- min-width: 138px;
26
- min-height: 36px;
25
+ min-width: 276rpx;
26
+ min-height: 72rpx;
27
27
  font-size: $-tooltip-fs;
28
28
  backdrop-filter: blur($-tooltip-blur);
29
29
  background-clip: padding-box;
30
30
  border-radius: $-tooltip-radius;
31
31
  background: $-tooltip-bg;
32
32
  color: $-tooltip-color;
33
- text-align: center;
33
+ // text-align: center;
34
34
  box-sizing: border-box;
35
35
  z-index: $-tooltip-z-index;
36
36
  }
@@ -49,18 +49,18 @@
49
49
 
50
50
  @include e(inner) {
51
51
  padding: $-tooltip-padding;
52
- white-space: nowrap;
52
+ // white-space: nowrap;
53
53
  line-height: $-tooltip-line-height;
54
54
  }
55
55
 
56
56
  @include edeep(close-icon) {
57
- font-size: 12px;
57
+ font-size: 24rpx;
58
58
  position: absolute;
59
- right: -8px;
60
- top: -10px;
59
+ right: -16rpx;
60
+ top: -20rpx;
61
61
  transform: scale(0.5);
62
- padding: 10px;
62
+ padding: 20rpx;
63
63
  }
64
64
 
65
65
  @include triangleArrow($-tooltip-arrow-size, $-tooltip-bg);
66
- }
66
+ }
@@ -23,22 +23,43 @@
23
23
  left: 0;
24
24
  right: 0;
25
25
  }
26
+ .oxy-tree__search{
27
+ display: flex;
28
+ :deep(.oxy-button){
29
+ min-width: 120rpx;
30
+ }
31
+ :deep(.oxy-tree__search-input) {
32
+ flex: 1;
33
+ background-color: $-tree-search-input-color;
34
+ padding: 12rpx 24rpx;
35
+ border-radius: 8rpx;
36
+ margin-bottom: 16rpx;
37
+ margin-right: 24rpx;
38
+ .oxy-input__icon{
39
+ background: transparent;
40
+ }
41
+ }
42
+ }
43
+
44
+
26
45
  }
27
46
 
28
47
  .oxy-tree-node-content {
29
48
  display: flex;
30
- width: fit-content;
31
49
  width: 100%;
32
- white-space: nowrap;
33
50
  align-items: center;
51
+ box-sizing: border-box;
52
+ padding-right: $-tree-node-padding-right;
53
+ border-radius: $-tree-node-radius;
54
+ color: $-color-secondary;
55
+ font-size: $-tree-node-font-size;
56
+ transition: background-color .2s ease, color .2s ease, opacity .2s ease;
34
57
 
35
- &.expanded {
36
- :deep(.oxy-tree-node-icon) {
37
- transform: rotate(0deg);
58
+ &.is-leaf {
59
+ .oxy-tree-node-toggle {
60
+ pointer-events: none;
38
61
  }
39
- }
40
62
 
41
- &.is-leaf {
42
63
  :deep(.oxy-tree-node-icon) {
43
64
  opacity: 0;
44
65
  }
@@ -47,14 +68,31 @@
47
68
  &.is-current {
48
69
  background-color: $-tree-node-current-bg;
49
70
  color: $-tree-node-current-color;
71
+ font-weight: $-fw-medium;
72
+
73
+ :deep(.oxy-tree-node-icon) {
74
+ color: $-tree-node-icon-active-color;
75
+ }
76
+ }
77
+
78
+ &.checked {
79
+ :deep(.oxy-tree-node-icon) {
80
+ color: $-tree-node-icon-active-color;
81
+ }
50
82
  }
51
83
 
52
84
  &.is-disabled {
53
85
  color: $-tree-node-disabled-color;
86
+ opacity: $-button-disabled-opacity;
87
+
88
+ :deep(.oxy-tree-node-icon) {
89
+ color: $-tree-node-disabled-color;
90
+ }
54
91
  }
55
92
 
56
93
  :deep(.oxy-checkbox) {
57
- margin-right: 6px;
94
+ margin-right: $-size-side-padding-small;
95
+ flex-shrink: 0;
58
96
 
59
97
  .oxy-checkbox__label {
60
98
  display: none;
@@ -74,10 +112,24 @@
74
112
  }
75
113
 
76
114
  :deep(.oxy-tree-node-icon) {
77
- transform: rotate(-90deg);
115
+ color: $-tree-node-icon-color;
116
+ font-size: $-tree-node-icon-size;
117
+ transition: none;
118
+ }
119
+
120
+ .oxy-tree-node-toggle {
121
+ width: $-tree-node-icon-box-size;
122
+ height: 100%;
123
+ display: flex;
124
+ align-items: center;
125
+ justify-content: center;
126
+ margin-right: $-tree-node-icon-gap;
127
+ flex-shrink: 0;
78
128
  }
79
129
 
80
130
  .oxy-tree-node {
81
131
  flex: 1;
132
+ min-width: 0;
133
+ @include lineEllipsis;
82
134
  }
83
135
  }
@@ -1,14 +1,32 @@
1
1
  <template>
2
2
  <view class="oxy-tree" :class="customClass" :style="customStyle">
3
+ <slot name="search-button" v-if="showFilter">
4
+ <view class="oxy-tree__search">
5
+ <oxy-input
6
+ type="text"
7
+ no-border
8
+ class="oxy-tree__search-input"
9
+ prefix-icon="search"
10
+ :placeholder="filterPlaceholder"
11
+ v-model="searchValue"
12
+ @confirm="handleFilter"
13
+ />
14
+ <oxy-button :round="false" @click="handleFilter">筛选</oxy-button>
15
+ </view>
16
+ </slot>
17
+
3
18
  <view v-if="data.length" class="oxy-tree__virtual-scroll" :style="{ height: height }">
4
19
  <scroll-view class="oxy-tree__view" scroll-y :scroll-x="true" :scroll-top="scrollTop" @scroll="handleScroll">
5
- <view class="oxy-tree__container" :style="{ height: totalHeight + 'px' }">
6
- <view class="oxy-tree__items" :style="{ transform: `translateY(${virtualOffsetY}px)` }">
20
+ <view class="oxy-tree__container" :style="{ height: unitConvert(totalHeight, 0, { output: 'px' }) }">
21
+ <view class="oxy-tree__items" :style="{ transform: `translateY(${unitConvert(virtualOffsetY, 0, { output: 'px' })})` }">
7
22
  <view v-for="(item, index) in virtualData" :key="index">
8
23
  <view class="oxy-tree-node-content" :style="getNodeStyle(item)" :class="getNodeClass(item)" @click="handleNodeClick(item)">
9
24
  <!-- 兼容支付宝、微信小程序 -->
10
- <view @tap.stop="handleClickExpand(item)">
11
- <oxy-icon name="fill-arrow-down" custom-class="oxy-tree-node-icon" size="22px"></oxy-icon>
25
+ <view class="oxy-tree-node-toggle" @tap.stop="handleClickExpand(item)">
26
+ <oxy-icon
27
+ :name="expandedKeySet.has(item.key) ? 'chevron-down-circle' : 'chevron-right-circle'"
28
+ custom-class="oxy-tree-node-icon"
29
+ ></oxy-icon>
12
30
  </view>
13
31
  <oxy-checkbox
14
32
  v-if="showCheckbox"
@@ -34,7 +52,7 @@
34
52
 
35
53
  <!-- 回到顶部按钮 -->
36
54
  <view v-if="showBackToTop && showBackTopBtn" class="oxy-virtual-scroll__back-top" @click="scrollToTop">
37
- <oxy-icon name="backtop" color="#fff" size="20px"></oxy-icon>
55
+ <oxy-icon name="backtop" color="#fff" size="40rpx"></oxy-icon>
38
56
  </view>
39
57
  </view>
40
58
  </template>
@@ -56,6 +74,7 @@ import type { RawTreeNode, Tree, TreeInstance, TreeNode } from './types'
56
74
  import { treeProps, type TreeExpose } from './types'
57
75
  import { isSetsEqual, useTreeMethods } from './utils'
58
76
  import { useVirtualScroll } from '../composables/useVirtualScroll'
77
+ import { withDefaultUnit, unitConvert, unitConvertWithDefault } from '../common/util'
59
78
 
60
79
  // 获取组件的 props 和 emit 函数
61
80
  const props = defineProps(treeProps)
@@ -82,11 +101,12 @@ const emit = defineEmits<{
82
101
 
83
102
  const { getDisabled, getChildren, getLabel, getKey } = useTreeMethods(props)
84
103
  const expandedKeySet = ref<Set<string>>(new Set())
104
+ const bakExpandedKeySet = ref<Set<string> | null>(null)
85
105
  const hiddenNodeKeySet = ref<Set<string>>(new Set())
86
106
  const checkedKeys = ref<Set<string>>(new Set())
87
107
  const immediateKeySet = ref<Set<string>>(new Set())
88
108
  const currentNode = ref<TreeNode>()
89
-
109
+ const searchValue = ref('')
90
110
  const tree = ref<Tree>() as Ref<Tree>
91
111
  const flattenTree = computed<TreeNode[]>(() => {
92
112
  const expandedKeys = expandedKeySet.value
@@ -169,7 +189,6 @@ const createTree = (data: RawTreeNode[]) => {
169
189
  node.checked = checkedKeys.value.has(value)
170
190
  }
171
191
  if (expandAll.value) {
172
- node.expanded = true
173
192
  expandedKeySet.value.add(value)
174
193
  }
175
194
  const children = getChildren(rawNode)
@@ -202,9 +221,8 @@ const createTree = (data: RawTreeNode[]) => {
202
221
  }
203
222
 
204
223
  const toggleExpand = (node: TreeNode, flag: boolean) => {
205
- node.expanded = flag
206
224
  const key = node.key
207
- if (node.expanded) {
225
+ if (flag) {
208
226
  expandedKeySet.value.add(key)
209
227
  emit('node-expand', node)
210
228
  } else {
@@ -279,7 +297,6 @@ const updateNode = (node: TreeNode | undefined) => {
279
297
  const expandNode = (node: TreeNode | undefined) => {
280
298
  if (!node) return
281
299
  !node.isLeaf && expandedKeySet.value.add(node.key)
282
- node.expanded = true
283
300
  if (node.parent) {
284
301
  expandNode(node.parent)
285
302
  }
@@ -287,6 +304,12 @@ const expandNode = (node: TreeNode | undefined) => {
287
304
  const initValue = () => {
288
305
  if (showCheckbox.value) {
289
306
  if (isSetsEqual(checkedKeys.value, new Set(modelValue.value as string[]))) return
307
+ Array.from(checkedKeys.value).map((value) => {
308
+ const node = tree.value?.treeNodeMap.get(value as string)
309
+ if (node) {
310
+ toggleChecked(node, false)
311
+ }
312
+ })
290
313
  checkedKeys.value = new Set(modelValue.value as string[])
291
314
 
292
315
  Array.isArray(modelValue.value) &&
@@ -315,14 +338,14 @@ const updateValue = () => {
315
338
  }
316
339
  const getNodeStyle = (item: TreeNode) => {
317
340
  return {
318
- height: itemHeight.value,
319
- paddingLeft: `${(item.level - 1) * (props.indent || 16)}px`
341
+ height: withDefaultUnit(itemHeight.value, 'rpx'),
342
+ paddingLeft: withDefaultUnit((item.level - 1) * (props.indent || 16))
320
343
  }
321
344
  }
322
345
  const getNodeClass = (item: TreeNode) => {
323
346
  const currentValue = currentNode?.value
324
347
  return {
325
- expanded: item.expanded,
348
+ expanded: expandedKeySet.value.has(item.key),
326
349
  checked: item.checked,
327
350
  'is-leaf': item.isLeaf,
328
351
  immediate: item.immediate,
@@ -335,7 +358,7 @@ const handleNodeClick = (item: TreeNode) => {
335
358
  handleClick(item)
336
359
  }
337
360
  const handleClickExpand = (item: TreeNode) => {
338
- toggleExpand(item, !item.expanded)
361
+ toggleExpand(item, !expandedKeySet.value.has(item.key))
339
362
  }
340
363
  watch(
341
364
  () => data.value,
@@ -365,8 +388,8 @@ const scrollToTop = () => {
365
388
  }
366
389
  const scrollToBottom = () => {
367
390
  const visibleCount = flattenTree.value.length
368
- const containerHeight = parseFloat(height.value || '0')
369
- const targetScrollTop = Math.max(visibleCount * parseFloat(itemHeight.value) - containerHeight, 0)
391
+ const containerHeight = unitConvert(height.value)
392
+ const targetScrollTop = Math.max(visibleCount * unitConvertWithDefault(itemHeight.value, { defaultUnit: 'rpx' }) - containerHeight, 0)
370
393
  virtualScrollToPosition(targetScrollTop)
371
394
  }
372
395
  const scrollToPosition = (position: number | string) => {
@@ -387,17 +410,79 @@ const scrollToElementById = (id: string | number) => {
387
410
  })
388
411
  }
389
412
  }
413
+ const getCheckedNodes = (): (TreeNode | any)[] => {
414
+ const checkNodes = Array.from(checkedKeys.value).map((key) => {
415
+ return tree.value?.treeNodeMap.get(key as string) || { [props.nodeKey]: key }
416
+ })
417
+ return checkNodes
418
+ }
419
+
420
+ const filter = (query: string) => {
421
+ if (bakExpandedKeySet.value === null) {
422
+ bakExpandedKeySet.value = new Set(expandedKeySet.value)
423
+ }
424
+ const keys = doFilter(query)
425
+ if (query && keys) {
426
+ expandedKeySet.value = keys
427
+ } else if (!query) {
428
+ bakExpandedKeySet.value && (expandedKeySet.value = new Set(bakExpandedKeySet.value))
429
+ bakExpandedKeySet.value = null
430
+ }
431
+ }
432
+
433
+ const doFilter = (query: string) => {
434
+ if (typeof props.filterMethod !== 'function') {
435
+ return
436
+ }
437
+ const expandKeySet = new Set<string>()
438
+ const hiddenKeys = hiddenNodeKeySet.value
439
+ const family: TreeNode[] = []
440
+ const nodes = tree.value.treeNodes || []
441
+ const filter = props.filterMethod
442
+ hiddenKeys.clear()
443
+ function traverse(nodes: TreeNode[]) {
444
+ nodes.forEach((node: TreeNode) => {
445
+ family.push(node)
446
+ if (filter(query, node.data)) {
447
+ family.forEach((member) => {
448
+ expandKeySet.add(member.key)
449
+ })
450
+ } else if (node.isLeaf) {
451
+ hiddenKeys.add(node.key)
452
+ }
453
+ const children = node.children
454
+ if (children) {
455
+ traverse(children)
456
+ }
457
+ if (!node.isLeaf) {
458
+ if (!expandKeySet.has(node.key)) {
459
+ hiddenKeys.add(node.key)
460
+ }
461
+ }
462
+ family.pop()
463
+ })
464
+ }
465
+ traverse(nodes)
466
+ return expandKeySet
467
+ }
468
+ const handleFilter = () => {
469
+ filter(searchValue.value)
470
+ }
471
+
390
472
  defineExpose<TreeExpose>({
391
473
  toggleExpand,
392
474
  toggleChecked,
393
475
  getNodeById,
476
+ getCheckedNodes,
477
+ getCurrentNode: () => currentNode.value,
394
478
  useTree: () => tree.value,
395
479
  getTree: () => tree,
396
480
  scrollToTop,
397
481
  scrollToBottom,
398
482
  scrollToPosition,
399
483
  scrollToElement,
400
- scrollToElementById
484
+ scrollToElementById,
485
+ filter
401
486
  })
402
487
  </script>
403
488
 
@@ -1,5 +1,6 @@
1
1
  import type { ComponentPublicInstance, ExtractPropTypes, Ref } from 'vue'
2
2
  import { baseProps, makeArrayProp, makeBooleanProp, makeNumberProp, makeNumericProp, makeStringProp } from '../common/props'
3
+ import { type PropType } from 'vue'
3
4
 
4
5
  // 树结构类型定义
5
6
  export type Tree = {
@@ -47,7 +48,7 @@ export const treeProps = {
47
48
  default: ''
48
49
  },
49
50
  emptyText: makeStringProp('暂无数据'),
50
- height: makeStringProp('300px'),
51
+ height: makeStringProp('600rpx'),
51
52
  /**
52
53
  * 是否显示回到顶部按钮
53
54
  * 类型:boolean
@@ -56,23 +57,34 @@ export const treeProps = {
56
57
  showBackToTop: makeBooleanProp(false),
57
58
  /**
58
59
  * 滚动多远显示backToTop
59
- * 类型:number
60
- * 默认值:'300px'
60
+ * 类型:string(支持 `px/rpx`,纯数字字符串按 rpx 处理)
61
+ * 默认值:'600rpx'
61
62
  */
62
- backToTopThreshold: makeStringProp('300px'),
63
+ backToTopThreshold: makeStringProp('600rpx'),
63
64
  /**
64
- * 单个项目高度
65
- * 类型:number
66
- * 默认值:'44px'
65
+ * 列表项的预估高度,需带单位
66
+ * @description 虚拟列表会根据此值计算占位高度,越准确滚动越平滑。支持如 '44px' 或 '88rpx',纯数字字符串按 rpx 处理。
67
+ * 默认值:'88rpx'
67
68
  */
68
- itemHeight: makeStringProp('44px'),
69
- indent: makeNumberProp(16),
70
- selectionLeafOnly: makeBooleanProp(false)
69
+ itemHeight: makeStringProp('88rpx'),
70
+ /**
71
+ * 相邻级节点间的水平缩进,number 类型按 `rpx` 语义处理
72
+ */
73
+ indent: makeNumberProp(32),
74
+ selectionLeafOnly: makeBooleanProp(false),
75
+ filterMethod: {
76
+ type: Function as PropType<(keyword: string, node: RawTreeNode) => boolean>,
77
+ default: null
78
+ },
79
+ showFilter: makeBooleanProp(false),
80
+ filterPlaceholder: makeStringProp('请输入节点名称')
71
81
  }
72
82
  export type TreeExpose = {
73
83
  toggleExpand: (node: TreeNode, flag: boolean) => void
74
84
  toggleChecked: (node: TreeNode, flag: boolean, isClick: boolean) => void
75
85
  getNodeById: (id: string | number) => TreeNode | undefined
86
+ getCheckedNodes: () => TreeNode[] | any
87
+ getCurrentNode: () => TreeNode | undefined
76
88
  useTree: () => Tree
77
89
  getTree: () => Ref<Tree>
78
90
  scrollToTop: () => void
@@ -80,6 +92,7 @@ export type TreeExpose = {
80
92
  scrollToPosition: (position: number | string) => void
81
93
  scrollToElement: (item: any) => void
82
94
  scrollToElementById: (id: string | number) => void
95
+ filter: (keyword: string) => void
83
96
  }
84
97
  export type TreeProps = ExtractPropTypes<typeof treeProps>
85
98
  export type TreeInstance = ComponentPublicInstance<TreeProps, TreeExpose>
@@ -39,7 +39,7 @@
39
39
  font-size: $-upload-evoke-icon-size;
40
40
  background-color: $-upload-evoke-bg;
41
41
  color: $-upload-evoke-color;
42
- margin-bottom: 12px;
42
+ margin-bottom: 24rpx;
43
43
 
44
44
  @include when(disabled) {
45
45
  color: $-upload-evoke-disabled-color;
@@ -47,18 +47,18 @@
47
47
  }
48
48
 
49
49
  @include e(evoke-file) {
50
- border-radius: 8px;
50
+ border-radius: 16rpx;
51
51
  }
52
52
 
53
53
  @include e(evoke-num) {
54
- font-size: 14px;
55
- line-height: 14px;
56
- margin-top: 8px;
54
+ font-size: 28rpx;
55
+ line-height: 28rpx;
56
+ margin-top: 16rpx;
57
57
  }
58
58
 
59
59
  @include edeep(evoke-icon) {
60
- width: 32px;
61
- height: 32px;
60
+ width: 64rpx;
61
+ height: 64rpx;
62
62
  }
63
63
 
64
64
  @include e(input) {
@@ -75,7 +75,7 @@
75
75
  position: relative;
76
76
  width: $-upload-size;
77
77
  height: $-upload-size;
78
- margin: 0 12px 12px 0;
78
+ margin: 0 24rpx 24rpx 0;
79
79
  }
80
80
 
81
81
  @include e(preview-list) {
@@ -106,9 +106,9 @@
106
106
  font-size: $-upload-file-fs;
107
107
  color: $-upload-file-color;
108
108
  box-sizing: border-box;
109
- padding: 0 4px;
109
+ padding: 0 8rpx;
110
110
  text-align: center;
111
- margin-top: 8px;
111
+ margin-top: 16rpx;
112
112
  @include lineEllipsis()
113
113
  }
114
114
 
@@ -117,7 +117,7 @@
117
117
  top: 50%;
118
118
  left: 50%;
119
119
  transform: translate(-50%, -50%);
120
- font-size: 24px;
120
+ font-size: 48rpx;
121
121
  color: $-color-white;
122
122
 
123
123
  &::before {
@@ -159,7 +159,7 @@
159
159
  @include e(progress-txt) {
160
160
  font-size: $-upload-progress-fs;
161
161
  line-height: $-upload-progress-fs;
162
- margin-top: 9px;
162
+ margin-top: 18rpx;
163
163
  color: $-color-white;
164
164
  }
165
165
 
@@ -178,21 +178,21 @@
178
178
  }
179
179
 
180
180
  @include e(preview-file) {
181
- margin-bottom: 32px;
181
+ margin-bottom: 64rpx;
182
182
  .oxy-upload__status-content:not(.oxy-upload__mask) {
183
183
  border: 1px solid $-color-border;
184
184
  box-sizing: border-box;
185
- border-radius: 8px;
185
+ border-radius: 16rpx;
186
186
  .oxy-upload__picture {
187
- border-radius: 8px;
187
+ border-radius: 16rpx;
188
188
  }
189
189
  .oxy-upload__picture-icon {
190
- width: 32px;
191
- height: 32px;
190
+ width: 64rpx;
191
+ height: 64rpx;
192
192
  }
193
193
  }
194
194
  .oxy-upload__mask {
195
- border-radius: 8px;
195
+ border-radius: 16rpx;
196
196
  }
197
197
  :deep(.oxy-tooltip) {
198
198
  width: 100%;
@@ -208,9 +208,9 @@
208
208
  font-size: $-upload-file-fs;
209
209
  color: $-upload-file-color;
210
210
  box-sizing: border-box;
211
- padding: 0 4px;
211
+ padding: 0 8rpx;
212
212
  text-align: center;
213
- margin-top: 8px;
213
+ margin-top: 16rpx;
214
214
  white-space: nowrap;
215
215
  overflow: hidden;
216
216
  text-overflow: ellipsis;
@@ -219,7 +219,7 @@
219
219
 
220
220
  &.oxy-upload__position-right {
221
221
  .oxy-upload__evoke {
222
- margin-right: 12px;
222
+ margin-right: 24rpx;
223
223
  }
224
224
  }
225
225
  }
@@ -283,9 +283,9 @@ export const uploadProps = {
283
283
  /**
284
284
  * 加载中图标尺寸
285
285
  * 类型:string
286
- * 默认值:'24px'
286
+ * 默认值:'48rpx'
287
287
  */
288
- loadingSize: makeStringProp('24px'),
288
+ loadingSize: makeStringProp('48rpx'),
289
289
  /**
290
290
  * 是否压缩视频,当 accept 为 video 时生效。
291
291
  * 类型:boolean
@@ -0,0 +1,6 @@
1
+ @import './../common/abstracts/_mixin.scss';
2
+ @import './../common/abstracts/variable.scss';
3
+
4
+ @include b(verification-code) {
5
+ display: inline-block;
6
+ }