oxy-uni-ui 1.2.3 → 2.1.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 (246) hide show
  1. package/attributes.json +1 -1
  2. package/components/common/abstracts/variable.scss +512 -343
  3. package/components/common/util.ts +185 -32
  4. package/components/composables/index.ts +1 -0
  5. package/components/composables/usePopover.ts +24 -20
  6. package/components/composables/useVirtualScroll.ts +48 -21
  7. package/components/composables/useWindowResize.ts +35 -0
  8. package/components/oxy-action-sheet/index.scss +24 -11
  9. package/components/oxy-action-sheet/oxy-action-sheet.vue +27 -19
  10. package/components/oxy-action-sheet/types.ts +7 -0
  11. package/components/oxy-backtop/index.scss +4 -4
  12. package/components/oxy-backtop/oxy-backtop.vue +9 -6
  13. package/components/oxy-backtop/types.ts +7 -7
  14. package/components/oxy-badge/index.scss +4 -4
  15. package/components/oxy-badge/oxy-badge.vue +3 -3
  16. package/components/oxy-badge/types.ts +2 -2
  17. package/components/oxy-button/index.scss +5 -5
  18. package/components/oxy-button/oxy-button.vue +5 -1
  19. package/components/oxy-calendar/index.scss +15 -15
  20. package/components/oxy-calendar/oxy-calendar.vue +1 -0
  21. package/components/oxy-calendar/types.ts +5 -0
  22. package/components/oxy-calendar-view/month/index.scss +4 -4
  23. package/components/oxy-calendar-view/month/types.ts +36 -0
  24. package/components/oxy-calendar-view/monthPanel/index.scss +7 -8
  25. package/components/oxy-calendar-view/monthPanel/month-panel.vue +14 -8
  26. package/components/oxy-calendar-view/year/index.scss +5 -5
  27. package/components/oxy-calendar-view/yearPanel/index.scss +4 -4
  28. package/components/oxy-calendar-view/yearPanel/year-panel.vue +21 -5
  29. package/components/oxy-card/index.scss +2 -2
  30. package/components/oxy-cell/index.scss +8 -8
  31. package/components/oxy-checkbox/index.scss +12 -12
  32. package/components/oxy-checkbox-group/index.scss +2 -2
  33. package/components/oxy-circle/oxy-circle.vue +10 -7
  34. package/components/oxy-circle/types.ts +5 -5
  35. package/components/oxy-col/oxy-col.vue +2 -2
  36. package/components/oxy-col-picker/index.scss +4 -4
  37. package/components/oxy-col-picker/oxy-col-picker.vue +6 -5
  38. package/components/oxy-col-picker/types.ts +7 -2
  39. package/components/oxy-collapse/index.scss +2 -2
  40. package/components/oxy-collapse-item/oxy-collapse-item.vue +3 -3
  41. package/components/oxy-corner/index.scss +33 -33
  42. package/components/oxy-count-to/oxy-count-to.vue +3 -3
  43. package/components/oxy-curtain/index.scss +15 -15
  44. package/components/oxy-curtain/oxy-curtain.vue +4 -2
  45. package/components/oxy-curtain/types.ts +6 -1
  46. package/components/oxy-date-strip/oxy-date-strip.vue +2 -2
  47. package/components/oxy-date-strip/types.ts +1 -1
  48. package/components/oxy-date-strip-item/index.scss +3 -3
  49. package/components/oxy-datetime-picker/index.scss +11 -11
  50. package/components/oxy-datetime-picker/oxy-datetime-picker.vue +1 -0
  51. package/components/oxy-datetime-picker/types.ts +5 -0
  52. package/components/oxy-drop-menu/index.scss +5 -5
  53. package/components/oxy-drop-menu/oxy-drop-menu.vue +3 -3
  54. package/components/oxy-drop-menu-item/index.scss +3 -3
  55. package/components/oxy-drop-menu-item/oxy-drop-menu-item.vue +4 -3
  56. package/components/oxy-drop-menu-item/types.ts +5 -0
  57. package/components/oxy-echarts/types.ts +6 -0
  58. package/components/oxy-fab/index.scss +8 -8
  59. package/components/oxy-fab/oxy-fab.vue +22 -3
  60. package/components/oxy-file-list/index.scss +30 -29
  61. package/components/oxy-file-list/oxy-file-list.vue +2 -2
  62. package/components/oxy-floating-panel/oxy-floating-panel.vue +13 -9
  63. package/components/oxy-floating-panel/{type.ts → types.ts} +8 -8
  64. package/components/oxy-footer/index.scss +19 -0
  65. package/components/oxy-footer/oxy-footer.vue +78 -0
  66. package/components/oxy-footer/types.ts +17 -0
  67. package/components/oxy-form-item/types.ts +22 -1
  68. package/components/oxy-gap/oxy-gap.vue +2 -2
  69. package/components/oxy-gap/types.ts +2 -2
  70. package/components/oxy-grid/oxy-grid.vue +1 -1
  71. package/components/oxy-grid/types.ts +1 -1
  72. package/components/oxy-grid-item/index.scss +1 -1
  73. package/components/oxy-grid-item/oxy-grid-item.vue +7 -5
  74. package/components/oxy-grid-item/types.ts +1 -1
  75. package/components/oxy-guidance/index.scss +75 -0
  76. package/components/oxy-guidance/oxy-guidance.vue +201 -0
  77. package/components/oxy-guidance/types.ts +33 -0
  78. package/components/oxy-icon/oxy-icon.vue +2 -2
  79. package/components/oxy-icon/types.ts +1 -1
  80. package/components/oxy-img/oxy-img.vue +4 -4
  81. package/components/oxy-img/types.ts +3 -3
  82. package/components/oxy-img-cropper/index.scss +23 -23
  83. package/components/oxy-img-cropper/oxy-img-cropper.vue +97 -52
  84. package/components/oxy-img-cropper/types.ts +2 -2
  85. package/components/oxy-img-lazy/oxy-img-lazy.vue +3 -3
  86. package/components/oxy-img-lazy/types.ts +3 -3
  87. package/components/oxy-index-anchor/index.scss +2 -2
  88. package/components/oxy-index-anchor/oxy-index-anchor.vue +2 -2
  89. package/components/oxy-index-anchor/{type.ts → types.ts} +3 -0
  90. package/components/oxy-index-bar/index.scss +3 -3
  91. package/components/oxy-index-bar/oxy-index-bar.vue +3 -3
  92. package/components/oxy-index-bar/{type.ts → types.ts} +2 -2
  93. package/components/oxy-input/index.scss +1 -1
  94. package/components/oxy-input-number/index.scss +5 -5
  95. package/components/oxy-input-number/oxy-input-number.vue +2 -2
  96. package/components/oxy-input-number/types.ts +3 -2
  97. package/components/oxy-keyboard/index.scss +5 -5
  98. package/components/oxy-keyboard/key/index.scss +3 -3
  99. package/components/oxy-keyboard/key/index.vue +2 -2
  100. package/components/oxy-keyboard/key/types.ts +15 -0
  101. package/components/oxy-keyboard/oxy-keyboard.vue +1 -0
  102. package/components/oxy-keyboard/types.ts +5 -0
  103. package/components/oxy-link/index.scss +2 -2
  104. package/components/oxy-list/oxy-list.vue +4 -3
  105. package/components/oxy-loading/oxy-loading.vue +8 -4
  106. package/components/oxy-loading/types.ts +1 -1
  107. package/components/oxy-loadmore/index.scss +3 -3
  108. package/components/oxy-long-press-menu/index.scss +93 -0
  109. package/components/oxy-long-press-menu/oxy-long-press-menu.vue +338 -0
  110. package/components/oxy-long-press-menu/types.ts +34 -0
  111. package/components/oxy-message-box/index.scss +12 -11
  112. package/components/oxy-message-box/oxy-message-box.vue +9 -2
  113. package/components/oxy-message-box/types.ts +9 -0
  114. package/components/oxy-navbar/index.scss +2 -2
  115. package/components/oxy-navbar/oxy-navbar.vue +58 -13
  116. package/components/oxy-navbar/types.ts +8 -1
  117. package/components/oxy-navbar-capsule/types.ts +3 -0
  118. package/components/oxy-notice-bar/index.scss +3 -3
  119. package/components/oxy-notice-bar/oxy-notice-bar.vue +9 -5
  120. package/components/oxy-notice-bar/types.ts +3 -3
  121. package/components/oxy-notify/index.ts +1 -0
  122. package/components/oxy-notify/oxy-notify.vue +3 -2
  123. package/components/oxy-notify/types.ts +7 -0
  124. package/components/oxy-pagination/index.scss +6 -5
  125. package/components/oxy-password-input/oxy-password-input.vue +2 -2
  126. package/components/oxy-password-input/types.ts +1 -1
  127. package/components/oxy-picker/index.scss +45 -2
  128. package/components/oxy-picker/oxy-picker.vue +100 -14
  129. package/components/oxy-picker/types.ts +29 -1
  130. package/components/oxy-picker-view/index.scss +4 -4
  131. package/components/oxy-picker-view/oxy-picker-view.vue +4 -4
  132. package/components/oxy-popover/index.scss +13 -13
  133. package/components/oxy-popup/index.scss +4 -4
  134. package/components/oxy-popup/oxy-popup.vue +35 -2
  135. package/components/oxy-popup/types.ts +8 -1
  136. package/components/oxy-progress/index.scss +3 -3
  137. package/components/oxy-qrcode/draw.ts +398 -0
  138. package/components/oxy-qrcode/index.scss +2 -0
  139. package/components/oxy-qrcode/oxy-qrcode.vue +124 -0
  140. package/components/oxy-qrcode/qrcode.ts +936 -0
  141. package/components/oxy-qrcode/types.ts +42 -0
  142. package/components/oxy-radio/index.scss +25 -19
  143. package/components/oxy-radio-group/index.scss +2 -2
  144. package/components/oxy-rate/types.ts +4 -4
  145. package/components/oxy-resize/index.scss +2 -2
  146. package/components/oxy-resize/oxy-resize.vue +4 -4
  147. package/components/oxy-resize/types.ts +3 -0
  148. package/components/oxy-rich-text/index.scss +37 -36
  149. package/components/oxy-rich-text/mp-html/card/card.vue +3 -3
  150. package/components/oxy-rich-text/mp-html/mp-html.vue +33 -24
  151. package/components/oxy-rich-text/mp-html/node/node.vue +30 -19
  152. package/components/oxy-rich-text/oxy-rich-text.vue +31 -31
  153. package/components/oxy-rich-text/types.ts +6 -1
  154. package/components/oxy-row/oxy-row.vue +3 -3
  155. package/components/oxy-row/types.ts +1 -1
  156. package/components/oxy-search/index.scss +7 -7
  157. package/components/oxy-segmented/index.scss +19 -16
  158. package/components/oxy-segmented/oxy-segmented.vue +23 -3
  159. package/components/oxy-select/index.scss +213 -89
  160. package/components/oxy-select/oxy-select.vue +106 -58
  161. package/components/oxy-select/types.ts +13 -1
  162. package/components/oxy-select-picker/index.scss +7 -7
  163. package/components/oxy-select-picker/oxy-select-picker.vue +1 -0
  164. package/components/oxy-select-picker/types.ts +2 -0
  165. package/components/oxy-sidebar-item/index.scss +2 -2
  166. package/components/oxy-signature/oxy-signature.vue +18 -10
  167. package/components/oxy-signature/types.ts +106 -13
  168. package/components/oxy-skeleton/index.scss +1 -1
  169. package/components/oxy-skeleton/oxy-skeleton.vue +6 -6
  170. package/components/oxy-skeleton/types.ts +1 -1
  171. package/components/oxy-slider/index.scss +6 -6
  172. package/components/oxy-sort-button/index.scss +8 -8
  173. package/components/oxy-splitter/index.scss +19 -0
  174. package/components/oxy-splitter/oxy-splitter.vue +409 -0
  175. package/components/oxy-splitter/types.ts +75 -0
  176. package/components/oxy-splitter-panel/index.scss +366 -0
  177. package/components/oxy-splitter-panel/oxy-splitter-panel.vue +432 -0
  178. package/components/oxy-splitter-panel/types.ts +63 -0
  179. package/components/oxy-status-tip/index.scss +4 -4
  180. package/components/oxy-status-tip/oxy-status-tip.vue +5 -5
  181. package/components/oxy-status-tip/types.ts +3 -3
  182. package/components/oxy-step/index.scss +16 -16
  183. package/components/oxy-sticky/oxy-sticky.vue +6 -6
  184. package/components/oxy-stream-render/oxy-stream-render.vue +230 -4
  185. package/components/oxy-stream-render/types.ts +4 -1
  186. package/components/oxy-swipe-action/oxy-swipe-action.vue +27 -2
  187. package/components/oxy-swiper/oxy-swiper.vue +6 -6
  188. package/components/oxy-swiper/types.ts +5 -5
  189. package/components/oxy-swiper-nav/index.scss +3 -3
  190. package/components/oxy-switch/index.scss +10 -10
  191. package/components/oxy-switch/oxy-switch.vue +2 -2
  192. package/components/oxy-switch/types.ts +1 -1
  193. package/components/oxy-tab/index.scss +11 -1
  194. package/components/oxy-tabbar/index.scss +2 -2
  195. package/components/oxy-tabbar/oxy-tabbar.vue +39 -10
  196. package/components/oxy-table/index.scss +8 -8
  197. package/components/oxy-table/oxy-table.vue +8 -6
  198. package/components/oxy-table/types.ts +2 -2
  199. package/components/oxy-table-col/index.scss +3 -3
  200. package/components/oxy-table-col/oxy-table-col.vue +3 -3
  201. package/components/oxy-table-col/types.ts +2 -2
  202. package/components/oxy-tabs/index.scss +52 -22
  203. package/components/oxy-tabs/oxy-tabs.vue +53 -19
  204. package/components/oxy-tabs/types.ts +15 -3
  205. package/components/oxy-tag/index.scss +111 -36
  206. package/components/oxy-text/index.scss +5 -1
  207. package/components/oxy-text/oxy-text.vue +76 -7
  208. package/components/oxy-text/types.ts +12 -0
  209. package/components/oxy-textarea/index.scss +6 -6
  210. package/components/oxy-toast/oxy-toast.vue +24 -8
  211. package/components/oxy-tooltip/index.scss +9 -9
  212. package/components/oxy-tree/index.scss +51 -15
  213. package/components/oxy-tree/oxy-tree.vue +13 -9
  214. package/components/oxy-tree/types.ts +12 -9
  215. package/components/oxy-upload/index.scss +23 -23
  216. package/components/oxy-upload/types.ts +2 -2
  217. package/components/oxy-verification-code/index.scss +6 -0
  218. package/components/oxy-verification-code/oxy-verification-code.vue +187 -0
  219. package/components/oxy-verification-code/types.ts +82 -0
  220. package/components/oxy-video-preview/index.scss +4 -4
  221. package/components/oxy-virtual-scroll/index.scss +5 -5
  222. package/components/oxy-virtual-scroll/oxy-virtual-scroll.vue +11 -7
  223. package/components/oxy-virtual-scroll/types.ts +14 -14
  224. package/components/oxy-voice-player/index.scss +937 -0
  225. package/components/oxy-voice-player/oxy-voice-player.vue +821 -0
  226. package/components/oxy-voice-player/types.ts +567 -0
  227. package/components/oxy-waterfall/oxy-waterfall.vue +6 -6
  228. package/components/oxy-waterfall/types.ts +6 -6
  229. package/components/oxy-watermark/oxy-watermark.vue +35 -13
  230. package/components/oxy-watermark/types.ts +14 -14
  231. package/global.d.ts +4 -0
  232. package/locale/lang/ar-SA.ts +3 -0
  233. package/locale/lang/en-US.ts +3 -0
  234. package/locale/lang/zh-CN.ts +3 -0
  235. package/package.json +97 -1
  236. package/tags.json +1 -1
  237. package/web-types.json +1 -1
  238. package/components/oxy-number-keyboard/index.scss +0 -78
  239. package/components/oxy-number-keyboard/key/index.scss +0 -81
  240. package/components/oxy-number-keyboard/key/index.vue +0 -78
  241. package/components/oxy-number-keyboard/key/types.ts +0 -11
  242. package/components/oxy-number-keyboard/oxy-number-keyboard.vue +0 -151
  243. package/components/oxy-number-keyboard/types.ts +0 -83
  244. package/components/oxy-tree/components/tree-node-content.vue +0 -72
  245. package/components/oxy-tree/index.ts +0 -51
  246. package/oxy-uni-ui.zip +0 -0
@@ -1,37 +1,37 @@
1
1
  <template>
2
- <view @tap="nodeTap" :id="attrs.id" :class="'_block _'+name+' '+attrs.class" :style="(ctrl.root&&opts[5]!=='simple'?'border:1px solid black;padding:5px;display:block;':'')+attrs.style">
2
+ <view @tap="nodeTap" :id="attrs.id" :class="'_block _'+name+' '+attrs.class" :style="(ctrl.root&&opts[5]!=='simple'?'border:1px solid black;padding:10rpx;display:block;':'')+attrs.style">
3
3
  <block v-for="(n, i) in nodes" v-bind:key="i">
4
4
  <!-- 图片 -->
5
5
  <!-- 占位图 -->
6
6
  <image v-if="n.name==='img'&&!n.t&&((opts[1]&&!ctrl[i])||ctrl[i]<0)" class="_img" :style="n.attrs.style" :src="ctrl[i]<0?opts[2]:opts[1]" mode="widthFix" />
7
7
  <!-- 显示图片 -->
8
8
  <!-- #ifdef H5 || (APP-PLUS && VUE2) -->
9
- <img v-if="n.name==='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl['e'+i]&&opts[5]!=='simple'?'border:1px dashed black;padding:3px;':'')+(ctrl[i]===-1?'display:none;':'')+n.attrs.style" :src="n.attrs.src||(ctrl.load?n.attrs['data-src']:'')" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
9
+ <img v-if="n.name==='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl['e'+i]&&opts[5]!=='simple'?'border:1px dashed black;padding:6rpx;':'')+(ctrl[i]===-1?'display:none;':'')+n.attrs.style" :src="n.attrs.src||(ctrl.load?n.attrs['data-src']:'')" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
10
10
  <!-- #endif -->
11
11
  <!-- #ifndef H5 || (APP-PLUS && VUE2) -->
12
12
  <!-- 表格中的图片,使用 rich-text 防止大小不正确 -->
13
13
  <rich-text v-if="n.name==='img'&&n.t" :style="'display:'+n.t" :nodes="[{attrs:{style:n.attrs.style||'',src:n.attrs.src},name:'img'}]" :data-i="i" @tap.stop="imgTap" />
14
14
  <!-- #endif -->
15
15
  <!-- #ifdef APP-HARMONY -->
16
- <image v-else-if="n.name==='img'" :id="n.attrs.id||('n'+i)" :class="'_img '+n.attrs.class" :style="(ctrl['e'+i]&&opts[5]!=='simple'?'border:1px dashed black;padding:3px;':'')+(ctrl[i]===-1?'display:none;':'')+'width:'+ctrl[i]+'px;'+n.attrs.style" :src="n.attrs.src||(ctrl.load?n.attrs['data-src']:'')" :mode="!n.h?'widthFix':(!n.w?'heightFix':(n.m||'scaleToFill'))" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
16
+ <image v-else-if="n.name==='img'" :id="n.attrs.id||('n'+i)" :class="'_img '+n.attrs.class" :style="(ctrl['e'+i]&&opts[5]!=='simple'?'border:1px dashed black;padding:6rpx;':'')+(ctrl[i]===-1?'display:none;':'')+'width:'+ctrl[i]+'px;'+n.attrs.style" :src="n.attrs.src||(ctrl.load?n.attrs['data-src']:'')" :mode="!n.h?'widthFix':(!n.w?'heightFix':(n.m||'scaleToFill'))" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
17
17
  <!-- #endif -->
18
18
  <!-- #ifndef H5 || APP-PLUS || MP-KUAISHOU -->
19
- <image v-else-if="n.name==='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl['e'+i]&&opts[5]!=='simple'?'border:1px dashed black;padding:3px;':'')+(ctrl[i]===-1?'display:none;':'')+'width:'+(ctrl[i]||1)+'px;height:'+(ctrl['h'+i]||1)+'px;'+n.attrs.style" :src="n.attrs.src" :mode="!n.h?'widthFix':(!n.w?'heightFix':(n.m||'scaleToFill'))" :lazy-load="opts[0]" :webp="n.webp" :show-menu-by-longpress="!opts[5]&&opts[3]&&!n.attrs.ignore" :image-menu-prevent="opts[5]||!opts[3]||n.attrs.ignore" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
19
+ <image v-else-if="n.name==='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl['e'+i]&&opts[5]!=='simple'?'border:1px dashed black;padding:6rpx;':'')+(ctrl[i]===-1?'display:none;':'')+'width:'+(ctrl[i]||1)+'px;height:'+(ctrl['h'+i]||1)+'px;'+n.attrs.style" :src="n.attrs.src" :mode="!n.h?'widthFix':(!n.w?'heightFix':(n.m||'scaleToFill'))" :lazy-load="opts[0]" :webp="n.webp" :show-menu-by-longpress="!opts[5]&&opts[3]&&!n.attrs.ignore" :image-menu-prevent="opts[5]||!opts[3]||n.attrs.ignore" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
20
20
  <!-- #endif -->
21
21
  <!-- #ifdef MP-KUAISHOU -->
22
- <image v-else-if="n.name==='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl['e'+i]&&opts[5]!=='simple'?'border:1px dashed black;padding:3px;':'')+(ctrl[i]===-1?'display:none;':'')+n.attrs.style" :src="n.attrs.src" :lazy-load="opts[0]" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap"></image>
22
+ <image v-else-if="n.name==='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl['e'+i]&&opts[5]!=='simple'?'border:1px dashed black;padding:6rpx;':'')+(ctrl[i]===-1?'display:none;':'')+n.attrs.style" :src="n.attrs.src" :lazy-load="opts[0]" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap"></image>
23
23
  <!-- #endif -->
24
24
  <!-- #ifdef APP-PLUS && VUE3 -->
25
- <image v-else-if="n.name==='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl['e'+i]&&opts[5]!=='simple'?'border:1px dashed black;padding:3px;':'')+(ctrl[i]===-1?'display:none;':'')+'width:'+(ctrl[i]||1)+'px;'+n.attrs.style" :src="n.attrs.src||(ctrl.load?n.attrs['data-src']:'')" :mode="!n.h?'widthFix':(!n.w?'heightFix':(n.m||''))" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
25
+ <image v-else-if="n.name==='img'" :id="n.attrs.id" :class="'_img '+n.attrs.class" :style="(ctrl['e'+i]&&opts[5]!=='simple'?'border:1px dashed black;padding:6rpx;':'')+(ctrl[i]===-1?'display:none;':'')+'width:'+(ctrl[i]||1)+'px;'+n.attrs.style" :src="n.attrs.src||(ctrl.load?n.attrs['data-src']:'')" :mode="!n.h?'widthFix':(!n.w?'heightFix':(n.m||''))" :data-i="i" @load="imgLoad" @error="mediaError" @tap.stop="imgTap" @longpress="imgLongTap" />
26
26
  <!-- #endif -->
27
27
  <!-- 文本 -->
28
28
  <text v-else-if="n.type==='text'&&!ctrl['e'+i]" :data-i="i" :user-select="opts[4]" :decode="!opts[5]" @tap="editStart">{{n.text}}
29
29
  <text v-if="!n.text" style="color:gray">{{opts[6]||'请输入'}}</text>
30
30
  </text>
31
- <text v-else-if="n.type==='text'&&ctrl['e'+i]===1" :data-i="i" style="border:1px dashed black;min-width:50px;width:auto;padding:5px;display:block" @tap.stop="editStart">{{n.text}}
31
+ <text v-else-if="n.type==='text'&&ctrl['e'+i]===1" :data-i="i" style="border:1px dashed black;min-width:100rpx;width:auto;padding:10rpx;display:block" @tap.stop="editStart">{{n.text}}
32
32
  <text v-if="!n.text" style="color:gray">{{opts[6]||'请输入'}}</text>
33
33
  </text>
34
- <textarea v-else-if="n.type==='text'" :style="opts[5]==='simple'?'':'border:1px dashed black;'+'min-width:50px;width:auto;padding:5px'" auto-height maxlength="-1" :focus="ctrl['e'+i]===3" :value="n.text" :data-i="i" @input="editInput" @blur="editEnd" />
34
+ <textarea v-else-if="n.type==='text'" :style="opts[5]==='simple'?'':'border:1px dashed black;'+'min-width:100rpx;width:auto;padding:10rpx'" auto-height maxlength="-1" :focus="ctrl['e'+i]===3" :value="n.text" :data-i="i" @input="editInput" @blur="editEnd" />
35
35
  <text v-else-if="n.name==='br'">\n</text>
36
36
  <!-- 链接 -->
37
37
  <view v-else-if="n.name==='a'" :id="n.attrs.id" :class="(n.attrs.href?'_a ':'')+n.attrs.class" hover-class="_hover" :style="'display:inline;'+n.attrs.style" :data-i="i" @tap.stop="linkTap">
@@ -114,6 +114,7 @@ module.exports = {
114
114
  </script>
115
115
  <script>
116
116
  import Parser from '../parser'
117
+ import { unitConvert } from '../../../common/util'
117
118
  function getTop(e) {
118
119
  let top
119
120
  top = e.currentTarget.offsetTop
@@ -393,13 +394,23 @@ export default {
393
394
  changing: val => {
394
395
  if (Math.abs(val - value) > 2) {
395
396
  // 字号变换超过 2 时更新到视图
396
- parent.changeStyle('font-size', i, val + 'px', value + 'px')
397
+ parent.changeStyle(
398
+ 'font-size',
399
+ i,
400
+ unitConvert(val, 0, { output: 'px' }),
401
+ unitConvert(value, 0, { output: 'px' })
402
+ )
397
403
  value = e.detail.value
398
404
  }
399
405
  },
400
406
  change: val => {
401
407
  if (val !== value) {
402
- parent.changeStyle('font-size', i, val + 'px', value + 'px')
408
+ parent.changeStyle(
409
+ 'font-size',
410
+ i,
411
+ unitConvert(val, 0, { output: 'px' }),
412
+ unitConvert(value, 0, { output: 'px' })
413
+ )
403
414
  }
404
415
  this.root._editVal(`${parent.opts[7]}.${i}.attrs.style`, style, parent.childs[i].attrs.style)
405
416
  }
@@ -915,7 +926,7 @@ export default {
915
926
 
916
927
  /deep/ .md-table,
917
928
  /deep/ .md-blockquote {
918
- margin-bottom: 16px;
929
+ margin-bottom: 32rpx;
919
930
  }
920
931
 
921
932
  /deep/ .md-table {
@@ -937,7 +948,7 @@ export default {
937
948
 
938
949
  /deep/ .md-th,
939
950
  /deep/ .md-td {
940
- padding: 6px 13px !important;
951
+ padding: 12rpx 28rpx !important;
941
952
  border: 1px solid #dfe2e5;
942
953
  }
943
954
 
@@ -956,7 +967,7 @@ export default {
956
967
  font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
957
968
  font-size: 85%;
958
969
  background-color: rgba(27, 31, 35, 0.05);
959
- border-radius: 3px;
970
+ border-radius: 6rpx;
960
971
  }
961
972
 
962
973
  /deep/ .md-pre .md-code {
@@ -983,14 +994,14 @@ export default {
983
994
 
984
995
  /* #endif */
985
996
  /deep/ ._video {
986
- width: 300px;
987
- height: 225px;
997
+ width: 600rpx;
998
+ height: 450rpx;
988
999
  display: inline-block;
989
1000
  background-color: black;
990
1001
  }
991
1002
  /* a 标签默认效果 */
992
1003
  ._a {
993
- padding: 1.5px 0 1.5px 0;
1004
+ padding: 4rpx 0 4rpx 0;
994
1005
  color: #366092;
995
1006
  word-break: break-all;
996
1007
  }
@@ -1080,7 +1091,7 @@ export default {
1080
1091
  ._ol,
1081
1092
  ._ul {
1082
1093
  display: block;
1083
- padding-left: 40px;
1094
+ padding-left: 80rpx;
1084
1095
  margin: 1em 0;
1085
1096
  }
1086
1097
 
@@ -1154,8 +1165,8 @@ export default {
1154
1165
 
1155
1166
  /* #ifdef APP-PLUS */
1156
1167
  ._video {
1157
- width: 300px;
1158
- height: 225px;
1168
+ width: 600rpx;
1169
+ height: 450rpx;
1159
1170
  }
1160
1171
  /* #endif */
1161
1172
  </style>
@@ -2,7 +2,7 @@
2
2
  <view class="oxy-rich-text" :style="customStyle" :class="{ editable }">
3
3
  <view v-if="editable" class="editor_toolbox">
4
4
  <template v-for="(button, index) in toolButtons" :key="index">
5
- <image width="16px" height="16px" v-if="button.icon" :src="button.icon" alt="" @click="button.tap()" />
5
+ <image width="32rpx" height="32rpx" v-if="button.icon" :src="button.icon" alt="" @click="button.tap()" />
6
6
  <oxy-icon v-else size="18" :name="button.name" :class="button.class" @click="button.tap()" />
7
7
  </template>
8
8
  </view>
@@ -20,7 +20,7 @@
20
20
  ></mp-html>
21
21
  </view>
22
22
 
23
- <oxy-popup v-model="dialog" position="bottom" closable @close="dialog = false">
23
+ <oxy-popup v-model="dialog" position="bottom" :max-width="popupMaxWidth" closable @close="dialog = false">
24
24
  <view class="oxy-rich-text__popup">
25
25
  <view class="dialog-title">{{ translate('insert' + (dialogType === 'emoji' ? 'Emoji' : 'Template')) }}</view>
26
26
  <template v-if="dialogType === 'emoji'">
@@ -40,7 +40,7 @@
40
40
  </template>
41
41
  </view>
42
42
  </oxy-popup>
43
- <oxy-popup v-model="linkDialog" position="bottom" closable @close="linkDialog = false">
43
+ <oxy-popup v-model="linkDialog" position="bottom" :max-width="popupMaxWidth" closable @close="linkDialog = false">
44
44
  <view class="oxy-rich-text__popup">
45
45
  <view class="dialog-title">{{ translate('insertLink') }}</view>
46
46
  <view class="oxy-rich-text__link-input">
@@ -110,9 +110,9 @@ const emit = defineEmits<{
110
110
  }>()
111
111
  const { translate } = useTranslate('richText')
112
112
  const templates = [
113
- '<section style="text-align: center; margin: 0px auto;"><section style="border-radius: 4px; border: 1px solid #757576; display: inline-block; padding: 5px 20px;"><span style="font-size: 18px; color: #595959;">标题</span></section></section>',
114
- '<div style="width: 100%; box-sizing: border-box; border-radius: 5px; background-color: #f6f6f6; padding: 10px; margin: 10px 0"><div>卡片</div><div style="font-size: 12px; color: gray">正文</div></div>',
115
- '<div style="border: 1px solid gray; box-shadow: 3px 3px 0px #cfcfce; padding: 10px; margin: 10px 0">段落</div>'
113
+ '<section style="text-align: center; margin: 0 auto;"><section style="border-radius: 8rpx; border: 1px solid #757576; display: inline-block; padding: 10rpx 40rpx;"><span style="font-size: 36rpx; color: #595959;">标题</span></section></section>',
114
+ '<div style="width: 100%; box-sizing: border-box; border-radius: 10rpx; background-color: #f6f6f6; padding: 20rpx; margin: 20rpx 0"><div>卡片</div><div style="font-size: 32rpx; color: gray">正文</div></div>',
115
+ '<div style="border: 1px solid gray; box-shadow: 6rpx 6rpx 0 #cfcfce; padding: 20rpx; margin: 20rpx 0">段落</div>'
116
116
  ]
117
117
  const emojis = [
118
118
  ['😄', '😷', '😂', '😝', '😳', '😱', '😔', '😒', '😉'],
@@ -143,61 +143,61 @@ const actions = ref([
143
143
 
144
144
  const customTagStyle = {
145
145
  p: `
146
- font-size: 16px;
146
+ font-size: 32rpx;
147
147
  color: var(--oxy-rich-text-primary-color, #262626);
148
148
  `,
149
149
  h1: `
150
- margin:18px 0 10px 0;
151
- font-size: 24px;
150
+ margin: 36rpx 0 20rpx 0;
151
+ font-size: 52rpx;
152
152
  font-weight: 700;
153
153
  color: var(--oxy-rich-text-title-color, #000);
154
154
  `,
155
155
  h2: `
156
- margin:14px 0 10px 0;
157
- font-size: 20px;
156
+ margin: 28rpx 0 20rpx 0;
157
+ font-size: 44rpx;
158
158
  font-weight: 600;
159
159
  color: var(--oxy-rich-text-title-color, #000);
160
160
  `,
161
161
  h3: `
162
- margin:12px 0 8px 0;
163
- font-size: 18px;
162
+ margin: 24rpx 0 16rpx 0;
163
+ font-size: 40rpx;
164
164
  font-weight: 600;
165
165
  color: var(--oxy-rich-text-title-color, #000);
166
166
  `,
167
167
  h4: `
168
- margin:12px 0 8px 0;
169
- font-size: 16px;
168
+ margin: 24rpx 0 16rpx 0;
169
+ font-size: 36rpx;
170
170
  font-weight: 600;
171
171
  color: var(--oxy-rich-text-title-color, #000);
172
172
  `,
173
173
  h5: `
174
- margin:10px 0 8px 0;
175
- font-size: 15px;
174
+ margin: 20rpx 0 16rpx 0;
175
+ font-size: 34rpx;
176
176
  font-weight: 600;
177
177
  color: var(--oxy-rich-text-title-color, #000);
178
178
  `,
179
179
  h6: `
180
- margin:8px 0 8px 0;
181
- font-size: 14px;
180
+ margin: 16rpx 0;
181
+ font-size: 32rpx;
182
182
  color: var(--oxy-rich-text-title-color, #000);
183
183
  `,
184
184
  blockquote: `
185
- margin:14px 0;
186
- padding: 10px 12px;
185
+ margin: 28rpx 0;
186
+ padding: 20rpx 24rpx;
187
187
  color: var(--oxy-rich-text-blockquote-color, #555);
188
188
  background: var(--oxy-rich-text-blockquote-bg, #f7f8fa);
189
- border-left: 4px solid var(--oxy-rich-text-blockquote-border-color, #007AFF);
189
+ border-left: 8rpx solid var(--oxy-rich-text-blockquote-border-color, #007AFF);
190
190
  `,
191
191
  'blockquote>p': `
192
192
  margin-block-start: 0;
193
193
  margin-block-end: 0;
194
194
  `,
195
195
  ul: `
196
- margin: 0 0 10px 0;
196
+ margin: 0 0 20rpx 0;
197
197
  color: var(--oxy-rich-text-list-color, #444);
198
198
  `,
199
199
  li: `
200
- margin: 6px 0;
200
+ margin: 12rpx 0;
201
201
  line-height: 1.65;
202
202
  color: var(--oxy-rich-text-list-color, #444);
203
203
  `,
@@ -218,35 +218,35 @@ const customTagStyle = {
218
218
  padding: 0;
219
219
  border: none;
220
220
  background: var(--oxy-rich-text-hr-color, #e5e6eb);
221
- margin: 18px 0;
221
+ margin: 36rpx 0;
222
222
  `,
223
223
  table: `
224
224
  border-spacing: 0;
225
225
  overflow: auto;
226
226
  min-width: 100%;
227
- margin: 12px 0;
227
+ margin: 24rpx 0;
228
228
  border-collapse: collapse;
229
229
  `,
230
230
  th: `
231
231
  border: 1px solid var(--oxy-rich-text-table-border-color, #e5e6eb);
232
232
  background: var(--oxy-rich-text-table-head-bg, #f7f8fa);
233
233
  color: var(--oxy-rich-text-table-head-color, #333);
234
- padding: 8px 12px;
234
+ padding: 16rpx 24rpx;
235
235
  font-weight: 600;
236
236
  `,
237
237
  td: `
238
238
  border: 1px solid var(--oxy-rich-text-table-border-color, #e5e6eb);
239
239
  color: var(--oxy-rich-text-table-text-color, #444);
240
- padding: 8px 12px;
240
+ padding: 16rpx 24rpx;
241
241
  `,
242
242
  pre: `
243
- border-radius: 6px;
243
+ border-radius: 12rpx;
244
244
  white-space: pre;
245
245
  background: var(--oxy-rich-text-code-bg, #2d2d2d);
246
246
  color: var(--oxy-rich-text-code-color, #f8f8f2);
247
- font-size: 13px;
247
+ font-size: 30rpx;
248
248
  line-height: 1.65;
249
- padding: 12px;
249
+ padding: 24rpx;
250
250
  overflow: auto;
251
251
  position: relative;
252
252
  `
@@ -1,5 +1,5 @@
1
1
  import type { ComponentPublicInstance, ExtractPropTypes } from 'vue'
2
- import { baseProps } from '../common/props'
2
+ import { baseProps, makeStringProp } from '../common/props'
3
3
 
4
4
  export const richTextProps = {
5
5
  ...baseProps,
@@ -15,6 +15,11 @@ export const richTextProps = {
15
15
  type: Boolean,
16
16
  default: false
17
17
  },
18
+ /**
19
+ * 弹层最大宽度,支持 `rpx`、`px`、`%` 等单位;
20
+ * `%` 在弹层打开时按屏幕宽度换算为 `rpx`
21
+ */
22
+ popupMaxWidth: makeStringProp('1200rpx'),
18
23
  uploadMethod: {
19
24
  type: Function as any,
20
25
  default: null
@@ -18,7 +18,7 @@ export default {
18
18
  import { computed, type CSSProperties } from 'vue'
19
19
  import { useChildren } from '../composables/useChildren'
20
20
  import { ROW_KEY, rowProps } from './types'
21
- import { addUnit, objToStyle } from '../common/util'
21
+ import { withDefaultUnit, objToStyle } from '../common/util'
22
22
 
23
23
  const props = defineProps(rowProps)
24
24
  const { linkChildren } = useChildren(ROW_KEY)
@@ -31,8 +31,8 @@ const rowStyle = computed(() => {
31
31
  if (gutter < 0) {
32
32
  console.error('[Oxy ui] warning(oxy-row): attribute gutter must be greater than or equal to 0')
33
33
  } else if (gutter) {
34
- style.marginLeft = addUnit(gutter / 2)
35
- style.marginRight = addUnit(gutter / 2)
34
+ style.marginLeft = withDefaultUnit(gutter / 2)
35
+ style.marginRight = withDefaultUnit(gutter / 2)
36
36
  }
37
37
  return `${objToStyle(style)}${props.customStyle}`
38
38
  })
@@ -10,7 +10,7 @@ export const ROW_KEY: InjectionKey<RowProvide> = Symbol('oxy-row')
10
10
  export const rowProps = {
11
11
  ...baseProps,
12
12
  /**
13
- * 列元素之间的间距(单位为px
13
+ * 列元素之间的间距(单位为rpx
14
14
  */
15
15
  gutter: makeNumberProp(0)
16
16
  }
@@ -48,7 +48,7 @@
48
48
  display: flex;
49
49
  padding: $-search-padding;
50
50
  align-items: center;
51
- background: #fff;
51
+ background: $-search-bg;
52
52
 
53
53
  @include e(block) {
54
54
  flex: 1;
@@ -97,7 +97,7 @@
97
97
  align-items: center;
98
98
  }
99
99
  @include edeep(search-icon) {
100
- margin-right: 8px;
100
+ margin-right: 16rpx;
101
101
  color: $-search-icon-color;
102
102
  font-size: $-search-icon-size;
103
103
  }
@@ -105,7 +105,7 @@
105
105
  position: absolute;
106
106
  font-size: $-search-icon-size;
107
107
  top: 50%;
108
- left: 16px;
108
+ left: 32rpx;
109
109
  transform: translateY(-50%);
110
110
  color: $-search-icon-color;
111
111
  }
@@ -116,7 +116,7 @@
116
116
  @include edeep(clear) {
117
117
  position: absolute;
118
118
  right: 0;
119
- padding: 6px 9px 6px 7px;
119
+ padding: 16rpx 24rpx 16rpx 20rpx;
120
120
  color: $-search-cancel-color;
121
121
  }
122
122
  @include edeep(clear-icon) {
@@ -135,14 +135,14 @@
135
135
  background: $-search-light-bg;
136
136
 
137
137
  .oxy-search__block {
138
- background: #fff;
138
+ background: $-search-light-input-bg;
139
139
  }
140
140
 
141
141
  .oxy-search__cover {
142
- background: #fff;
142
+ background: $-search-light-input-bg;
143
143
  }
144
144
  }
145
145
  @include when(without-cancel) {
146
146
  padding-right: $-search-side-padding;
147
147
  }
148
- }
148
+ }
@@ -40,21 +40,24 @@
40
40
  width: 100%;
41
41
  background-color: $-segmented-item-bg-color;
42
42
  padding: $-segmented-padding;
43
- border-radius: 4px;
43
+ border-radius: $-segmented-radius;
44
44
  box-sizing: border-box;
45
45
 
46
46
 
47
47
  @include e(item) {
48
48
  position: relative;
49
+ display: flex;
50
+ align-items: center;
51
+ justify-content: center;
49
52
  text-align: center;
50
- border-radius: 4px;
53
+ border-radius: $-segmented-radius;
51
54
  flex: 1;
52
55
  min-width: 0;
53
56
  z-index: 1;
54
- min-height: 28px;
55
- line-height: 28px;
56
- padding: 0 12px;
57
- font-size: 14px;
57
+ min-height: 56rpx;
58
+ line-height: 1.2;
59
+ padding: 0 24rpx;
60
+ font-size: $-fs-content;
58
61
  color: $-segmented-item-color;
59
62
  font-weight: 400;
60
63
 
@@ -63,18 +66,18 @@
63
66
  }
64
67
 
65
68
  @include when(large) {
66
- min-height: 32px;
67
- line-height: 32px;
68
- padding: 0 12px;
69
- font-size: 16px;
69
+ min-height: 64rpx;
70
+ line-height: 1.2;
71
+ padding: 0 24rpx;
72
+ font-size: $-fs-title;
70
73
  }
71
74
 
72
75
 
73
76
  @include when(small) {
74
- min-height: 24px;
75
- line-height: 24px;
76
- padding: 0 7px;
77
- font-size: 12px;
77
+ min-height: 48rpx;
78
+ line-height: 1.2;
79
+ padding: 0 16rpx;
80
+ font-size: $-fs-secondary;
78
81
  }
79
82
 
80
83
  @include when(disabled) {
@@ -84,7 +87,7 @@
84
87
 
85
88
  @include m(active) {
86
89
  background-color: $-segmented-item-acitve-bg;
87
- border-radius: 4px;
90
+ border-radius: $-segmented-radius;
88
91
  height: calc(100% - $-segmented-padding * 2);
89
92
  @include when(disabled) {
90
93
  opacity: 0.8;
@@ -98,4 +101,4 @@
98
101
  text-overflow: ellipsis;
99
102
  }
100
103
 
101
- }
104
+ }
@@ -32,9 +32,10 @@ export default {
32
32
 
33
33
  <script setup lang="ts">
34
34
  import { computed, getCurrentInstance, onMounted, reactive, watch } from 'vue'
35
- import { getRect, isObj, objToStyle, addUnit, pause, isEqual } from '../common/util'
35
+ import { getRect, isObj, objToStyle, pause, isEqual, unitConvert } from '../common/util'
36
36
  import type { CSSProperties } from 'vue'
37
37
  import { segmentedProps, type SegmentedExpose, type SegmentedOption } from './types'
38
+ import { useWindowResize } from '../composables/useWindowResize'
38
39
  const $item = '.oxy-segmented__item'
39
40
 
40
41
  const props = defineProps(segmentedProps)
@@ -63,7 +64,24 @@ watch(
63
64
  }
64
65
  )
65
66
 
67
+ watch(
68
+ () => props.options,
69
+ async () => {
70
+ updateCurrentIndex()
71
+ await pause()
72
+ updateActiveStyle(false)
73
+ },
74
+ {
75
+ deep: true
76
+ }
77
+ )
78
+
66
79
  const { proxy } = getCurrentInstance() as any
80
+ const handleWindowResize = async () => {
81
+ await pause()
82
+ updateActiveStyle(false)
83
+ }
84
+ useWindowResize(handleWindowResize)
67
85
 
68
86
  onMounted(async () => {
69
87
  updateCurrentIndex()
@@ -77,15 +95,17 @@ onMounted(async () => {
77
95
  */
78
96
  function updateActiveStyle(animation: boolean = true) {
79
97
  getRect($item, true, proxy).then((rects) => {
98
+ if (!Array.isArray(rects) || rects.length === 0 || !rects[state.activeIndex]) return
80
99
  const rect = rects[state.activeIndex]
81
100
  const style: CSSProperties = {
82
101
  position: 'absolute',
83
- width: addUnit(rect.width!),
102
+ // getRect 返回的是真实像素值,需按 px 输出避免宽屏下激活块尺寸偏大
103
+ width: unitConvert(rect.width, 0, { output: 'px' }),
84
104
  'z-index': 0
85
105
  }
86
106
  const left = rects.slice(0, state.activeIndex).reduce((prev, curr) => prev + Number(curr.width), 0)
87
107
  if (left) {
88
- style.transform = `translateX(${left}px)`
108
+ style.transform = `translateX(${unitConvert(left, 0, { output: 'px' })})`
89
109
  }
90
110
  if (animation) {
91
111
  style.transition = 'all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)'