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
@@ -33,6 +33,11 @@ export const keyboardProps = {
33
33
  * 层级
34
34
  */
35
35
  zIndex: makeNumberProp(100),
36
+ /**
37
+ * 弹层最大宽度,支持 `rpx`、`px`、`%` 等单位;
38
+ * `%` 在弹层打开时按屏幕宽度换算为 `rpx`
39
+ */
40
+ popupMaxWidth: makeStringProp('1200rpx'),
36
41
  /**
37
42
  * 最大长度
38
43
  */
@@ -0,0 +1,57 @@
1
+ @import '../common/abstracts/variable';
2
+ @import '../common/abstracts/mixin';
3
+
4
+ @include b(link) {
5
+ display: inline-block;
6
+ @include e(medium) {
7
+ font-size: $-link-font-size-medium;
8
+ }
9
+
10
+ @include e(small) {
11
+ font-size: $-link-font-size-small;
12
+ }
13
+
14
+ @include e(large) {
15
+ font-size: $-link-font-size-large;
16
+ }
17
+
18
+ @include e(icon) {
19
+ display: inline-block;
20
+ }
21
+
22
+ @include when(underline) {
23
+ text-decoration: underline;
24
+ }
25
+
26
+ @include when(default) {
27
+ color: $-link-info-color;
28
+ }
29
+
30
+ @include when(primary) {
31
+ color: $-link-primary-color;
32
+ }
33
+
34
+ @include when(error) {
35
+ color: $-link-error-color;
36
+ }
37
+
38
+ @include when(warning) {
39
+ color: $-link-warning-color;
40
+ }
41
+
42
+ @include when(success) {
43
+ color: $-link-success-color;
44
+ }
45
+
46
+ @include when(disabled) {
47
+ opacity: .6;
48
+ }
49
+
50
+ &__prefix-icon:not(:empty) + &__content:not(:empty) {
51
+ padding-left: 8rpx;
52
+ }
53
+
54
+ &__content:not(:empty) + &__suffix-icon:not(:empty) {
55
+ padding-left: 8rpx;
56
+ }
57
+ }
@@ -0,0 +1,130 @@
1
+ <template>
2
+ <navigator
3
+ :class="rootClass"
4
+ :style="rootStyle"
5
+ :url="!disabled ? navigatorProps?.['url'] || url : ''"
6
+ :target="navigatorProps?.['target']"
7
+ :open-type="navigatorProps?.['openType'] || openType"
8
+ :delta="navigatorProps?.['delta']"
9
+ :app-id="navigatorProps?.['appId']"
10
+ :path="navigatorProps?.['path']"
11
+ :extra-data="navigatorProps?.['extraData']"
12
+ :version="navigatorProps?.['version']"
13
+ :short-link="navigatorProps?.['shortLink']"
14
+ :hover-class="hover && !disabled ? 'oxy-link__hover' : ''"
15
+ :hover-stop-propagation="navigatorProps?.['hoverStopPropagation']"
16
+ :hover-start-time="navigatorProps?.['hoverStartTime']"
17
+ :hover-stay-time="navigatorProps?.['hoverStayTime']"
18
+ @click="handleClick"
19
+ >
20
+ <slot name="prefix-icon">
21
+ <view class="oxy-link__icon oxy-link__prefix-icon" v-if="prefixIcon">
22
+ <oxy-icon :size="fontSize" :color="color" :name="prefixIcon"></oxy-icon>
23
+ </view>
24
+ </slot>
25
+ <text class="oxy-link__content" ref="textRef">
26
+ <slot>{{ content }}</slot>
27
+ </text>
28
+ <slot name="suffix-icon">
29
+ <view class="oxy-link__icon oxy-link__suffix-icon" v-if="suffixIcon">
30
+ <oxy-icon :size="fontSize" :color="color" :name="suffixIcon"></oxy-icon>
31
+ </view>
32
+ </slot>
33
+ </navigator>
34
+ </template>
35
+
36
+ <script lang="ts">
37
+ export default {
38
+ name: 'oxy-link',
39
+ options: {
40
+ virtualHost: true,
41
+ addGlobalClass: true,
42
+ styleIsolation: 'shared'
43
+ }
44
+ }
45
+ </script>
46
+
47
+ <script lang="ts" setup>
48
+ import { computed, ref, watch } from 'vue'
49
+ import { objToStyle } from '../common/util'
50
+ import { linkProps } from './types'
51
+
52
+ // 获取组件的 props 和 emit 函数
53
+ const props = defineProps(linkProps)
54
+ const emit = defineEmits(['click', 'success', 'fail', 'complete'])
55
+
56
+ // 存储超链接类名的响应式变量
57
+ const linkClass = ref<string>('')
58
+ const fontSize = computed<string>(() => {
59
+ if (!['small', 'medium', 'large'].includes(props.size)) {
60
+ return props.size
61
+ }
62
+ return ''
63
+ })
64
+
65
+ // 监听 props 变化,合并 watch 逻辑
66
+ watch(
67
+ () => ({
68
+ size: props.size,
69
+ type: props.type,
70
+ disabled: props.disabled,
71
+ underline: props.underline
72
+ }),
73
+ ({ type }) => {
74
+ // 验证 type 属性
75
+ const types = ['primary', 'danger', 'warning', 'success', 'default']
76
+ if (type && !types.includes(type)) {
77
+ console.error(`type must be one of ${types.toString()}`)
78
+ }
79
+ computeLinkClass()
80
+ },
81
+ { deep: true, immediate: true }
82
+ )
83
+
84
+ // 计算根元素的类名
85
+ const rootClass = computed(() => {
86
+ return `oxy-link ${props.customClass} ${linkClass.value}`
87
+ })
88
+
89
+ // 计算根元素的样式
90
+ const rootStyle = computed(() => {
91
+ const rootStyle: Record<string, any> = {}
92
+ if (props.color) {
93
+ rootStyle['color'] = props.color
94
+ }
95
+ if (fontSize.value) {
96
+ rootStyle['font-size'] = fontSize.value
97
+ }
98
+ return `${objToStyle(rootStyle)}${props.customStyle}`
99
+ })
100
+
101
+ // 计算超链接类名的函数
102
+ function computeLinkClass() {
103
+ const { size, type, disabled, underline } = props
104
+ const linkClassList: string[] = []
105
+ size && linkClassList.push(`oxy-link__${size}`)
106
+ type && linkClassList.push(`is-${type}`)
107
+ disabled && linkClassList.push('is-disabled')
108
+ underline && linkClassList.push('is-underline')
109
+ linkClass.value = linkClassList.join(' ')
110
+ }
111
+
112
+ function handleClick(event: Event) {
113
+ if (!props.url && props.href) {
114
+ // #ifdef APP-PLUS
115
+ plus.runtime.openURL(props.href)
116
+ // #endif
117
+ // #ifdef H5
118
+ window.open(props.href)
119
+ // #endif
120
+ // #ifdef MP
121
+ uni.setClipboardData({ data: props.href })
122
+ // #endif
123
+ }
124
+ emit('click', event)
125
+ }
126
+ </script>
127
+
128
+ <style lang="scss" scoped>
129
+ @import './index.scss';
130
+ </style>
@@ -0,0 +1,81 @@
1
+ import type { ExtractPropTypes } from 'vue'
2
+ import { baseProps, makeBooleanProp, makeStringProp } from '../common/props'
3
+
4
+ export type OpenType = 'navigate' | 'redirect' | 'switchTab' | 'reLaunch' | 'navigateBack' | 'exit'
5
+ export type LinkType = 'default' | 'primary' | 'error' | 'warning' | 'success'
6
+ export type SizeEnum = 'small' | 'medium' | 'large'
7
+
8
+ export const linkProps = {
9
+ ...baseProps,
10
+ /**
11
+ * 应用内跳转的链接
12
+ */
13
+ url: makeStringProp(''),
14
+ /**
15
+ * 应用外跳转的链接
16
+ */
17
+ href: makeStringProp(''),
18
+ /**
19
+ * 跳转方式
20
+ */
21
+ openType: makeStringProp<OpenType>('navigate'),
22
+ /**
23
+ * 链接内容
24
+ * 类型:string
25
+ */
26
+ content: makeStringProp(''),
27
+ /**
28
+ * 是否禁用
29
+ * 类型:boolean
30
+ * 默认值:false
31
+ */
32
+ disabled: makeBooleanProp(false),
33
+ /**
34
+ * 是否开启点击反馈
35
+ * 类型:boolean
36
+ * 默认值:false
37
+ */
38
+ hover: makeBooleanProp(false),
39
+ /**
40
+ * 是否显示链接下划线
41
+ * 类型:boolean
42
+ * 默认值:false
43
+ */
44
+ underline: makeBooleanProp(false),
45
+ /**
46
+ * 主题类型
47
+ * 类型:string
48
+ * 可选值:'default' /'primary' / 'error' / 'warning' / 'success'
49
+ * 默认值:'default'
50
+ */
51
+ type: makeStringProp<LinkType>('default'),
52
+ /**
53
+ * 字体大小
54
+ * 类型:string
55
+ * 默认值:'空字符串'
56
+ */
57
+ size: makeStringProp<SizeEnum>('medium'),
58
+ /**
59
+ * 文本颜色
60
+ * 类型:string
61
+ * 默认值:''
62
+ */
63
+ color: makeStringProp(''),
64
+ /**
65
+ * 前置图标
66
+ */
67
+ prefixIcon: makeStringProp(''),
68
+ /**
69
+ * 后置图标
70
+ */
71
+ suffixIcon: makeStringProp(''),
72
+ /**
73
+ * 与 navigator 原生组件属性保持一致,具体使用参考:[微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html)。使用时请将形如 `open-type` 风格的属性名改为 `openType` 风格
74
+ */
75
+ navigatorProps: {
76
+ type: Object,
77
+ default: null
78
+ }
79
+ }
80
+
81
+ export type LinkProps = ExtractPropTypes<typeof linkProps>
@@ -2,4 +2,10 @@
2
2
  @import './../common/abstracts/variable.scss';
3
3
  @import './../oxy-virtual-scroll/index.scss';
4
4
 
5
- @include b(list) {}
5
+ @include b(list) {
6
+ :deep(.oxy-loadmore) {
7
+ .oxy-divider {
8
+ margin: 0
9
+ }
10
+ }
11
+ }
@@ -28,8 +28,8 @@
28
28
  @refresherrestore="onRestore"
29
29
  @refresherabort="onAbort"
30
30
  >
31
- <view class="oxy-virtual-scroll__container" :style="{ height: totalHeight + 'px' }">
32
- <view class="oxy-virtual-scroll__items" :style="{ transform: `translateY(${virtualOffsetY}px)` }">
31
+ <view class="oxy-virtual-scroll__container" :style="{ height: unitConvert(totalHeight, 0, { output: 'px' }) }">
32
+ <view class="oxy-virtual-scroll__items" :style="{ transform: `translateY(${unitConvert(virtualOffsetY, 0, { output: 'px' })})` }">
33
33
  <view v-for="(item, index) in virtualData" :key="index">
34
34
  <slot name="item" :item="item" :index="startIndex + index"></slot>
35
35
  </view>
@@ -54,7 +54,7 @@
54
54
 
55
55
  <!-- 回到顶部按钮 -->
56
56
  <view v-if="showBackToTop && showBackTopBtn" class="oxy-virtual-scroll__back-top" @click="scrollToTop">
57
- <oxy-icon name="backtop" color="#fff" size="20px"></oxy-icon>
57
+ <oxy-icon name="backtop" color="#fff" size="40rpx"></oxy-icon>
58
58
  </view>
59
59
  </view>
60
60
  </template>
@@ -80,6 +80,7 @@ import type {
80
80
  ScrollViewOnScrollEvent
81
81
  } from '@uni-helper/uni-app-types/index'
82
82
  import { useVirtualScroll } from '../composables/useVirtualScroll'
83
+ import { unitConvert } from '../common/util'
83
84
 
84
85
  const props = defineProps(listProps)
85
86
 
@@ -7,7 +7,7 @@ import { virtualScrollProps } from '../oxy-virtual-scroll/types'
7
7
  export const listProps = {
8
8
  ...virtualScrollProps,
9
9
 
10
- loadmoreState: String as PropType<LoadMoreState>,
10
+ loadmoreState: String as PropType<LoadMoreState | ''>,
11
11
 
12
12
  /**
13
13
  * 加载提示文案
@@ -19,7 +19,7 @@ export default {
19
19
  <script lang="ts" setup>
20
20
  import { computed, onBeforeMount, ref, watch, type CSSProperties } from 'vue'
21
21
  import base64 from '../common/base64'
22
- import { gradient, context, objToStyle, addUnit, isDef } from '../common/util'
22
+ import { withDefaultUnit, gradient, context, objToStyle, isDef } from '../common/util'
23
23
  import { loadingProps } from './types'
24
24
 
25
25
  const svgDefineId = context.id++
@@ -44,7 +44,11 @@ const iconSize = ref<string | number | null>(null)
44
44
  watch(
45
45
  () => props.size,
46
46
  (newVal) => {
47
- iconSize.value = addUnit(newVal)
47
+ if (!isDef(newVal) || newVal === '') {
48
+ iconSize.value = null
49
+ return
50
+ }
51
+ iconSize.value = withDefaultUnit(newVal)
48
52
  },
49
53
  {
50
54
  deep: true,
@@ -66,8 +70,8 @@ watch(
66
70
  const rootStyle = computed(() => {
67
71
  const style: CSSProperties = {}
68
72
  if (isDef(iconSize.value)) {
69
- style.height = addUnit(iconSize.value)
70
- style.width = addUnit(iconSize.value)
73
+ style.height = iconSize.value
74
+ style.width = iconSize.value
71
75
  }
72
76
  return `${objToStyle(style)} ${props.customStyle}`
73
77
  })
@@ -14,7 +14,7 @@ export const loadingProps = {
14
14
  */
15
15
  color: makeStringProp('#4D80F0'),
16
16
  /**
17
- * 设置加载指示器大小
17
+ * 设置加载指示器大小,number 类型按 `rpx` 语义处理
18
18
  */
19
19
  size: makeNumericProp('')
20
20
  }
@@ -15,7 +15,7 @@
15
15
 
16
16
  @include edeep(loading) {
17
17
  display: inline-block;
18
- margin-right: 8px;
18
+ margin-right: 16rpx;
19
19
  vertical-align: middle;
20
20
  width: $-loadmore-loading-size;
21
21
  height: $-loadmore-loading-size;
@@ -26,7 +26,7 @@
26
26
  vertical-align: middle;
27
27
 
28
28
  @include when(light) {
29
- margin: 0 6px;
29
+ margin: 0 12rpx;
30
30
  color: $-loadmore-error-color;
31
31
  }
32
32
  }
@@ -36,4 +36,4 @@
36
36
  vertical-align: middle;
37
37
  font-size: $-loadmore-refresh-fs;
38
38
  }
39
- }
39
+ }
@@ -0,0 +1,93 @@
1
+ @import './../common/abstracts/_mixin.scss';
2
+ @import './../common/abstracts/variable.scss';
3
+
4
+ @include b(long-press-menu) {
5
+ position: relative;
6
+ display: inline-block; /* 让容器适应内容宽度 */
7
+ user-select: none;
8
+ -webkit-user-select: none;
9
+
10
+ @include e(trigger) {
11
+ position: relative;
12
+ transition: background-color 0.2s;
13
+ border-radius: $-long-press-menu-radius;
14
+ /* 默认为 inline-block,减少空白占据 */
15
+ display: inline-block;
16
+ width: 100%;
17
+
18
+ @include when(active) {
19
+ background-color: rgba(0, 0, 0, 0.05); /* 长按时的高亮背景 */
20
+ }
21
+ }
22
+
23
+ @include e(mask) {
24
+ position: fixed;
25
+ top: 0;
26
+ left: 0;
27
+ right: 0;
28
+ bottom: 0;
29
+ z-index: 998;
30
+ background-color: transparent; /* 透明遮罩,点击关闭 */
31
+ }
32
+
33
+ @include e(popover) {
34
+ position: fixed;
35
+ z-index: $-long-press-menu-z-index;
36
+ background-color: $-long-press-menu-bg;
37
+ border-radius: $-long-press-menu-radius;
38
+ padding: $-long-press-menu-padding;
39
+ min-width: 200rpx;
40
+ }
41
+
42
+ @include e(content) {
43
+ display: flex;
44
+ align-items: center;
45
+ flex-wrap: nowrap;
46
+ }
47
+
48
+ @include e(item) {
49
+ padding: $-long-press-menu-item-padding;
50
+ position: relative;
51
+ &:not(:last-child)::after {
52
+ content: '';
53
+ position: absolute;
54
+ right: 0;
55
+ top: 24rpx;
56
+ bottom: 24rpx;
57
+ width: 1px;
58
+ background-color: rgba(255, 255, 255, 0.2);
59
+ }
60
+ }
61
+
62
+ @include e(text) {
63
+ color: $-long-press-menu-color;
64
+ font-size: $-long-press-menu-fs;
65
+ white-space: nowrap;
66
+ }
67
+
68
+ @include e(arrow) {
69
+ left: 24rpx;
70
+ }
71
+ @include triangleArrow($-long-press-menu-arrow-size, $-long-press-menu-bg);
72
+
73
+ @include when(selectable) {
74
+ /* 移除 user-select,改为控制 trigger */
75
+ .oxy-long-press-menu__trigger {
76
+ user-select: text;
77
+ -webkit-user-select: text;
78
+ -webkit-touch-callout: none; /* 禁用系统默认长按菜单 */
79
+ cursor: text;
80
+ }
81
+ }
82
+ }
83
+
84
+ @keyframes fadeIn {
85
+ from {
86
+ opacity: 0;
87
+ transform: translateX(-50%) scale(0.9);
88
+ }
89
+ to {
90
+ opacity: 1;
91
+ transform: translateX(-50%) scale(1);
92
+ }
93
+ }