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
@@ -0,0 +1,42 @@
1
+ import type { PropType } from 'vue'
2
+ import { baseProps, makeNumberProp, makeNumericProp, makeStringProp } from '../common/props'
3
+
4
+ // 二维码样式
5
+ export type ClQrcodeMode = 'rect' | 'circular' | 'line' | 'rectSmall'
6
+
7
+ export const qrcodeProps = {
8
+ ...baseProps,
9
+ /** 二维码内容 */
10
+ text: makeStringProp(''),
11
+ /** 二维码中心图标 */
12
+ logo: makeStringProp(''),
13
+ /** 二维码宽度,number 与纯数字字符串按 rpx 处理 */
14
+ width: makeNumericProp(400),
15
+ /** 二维码高度,number 与纯数字字符串按 rpx 处理 */
16
+ height: makeNumericProp(400),
17
+ /** 二维码中心图标大小,number 与纯数字字符串按 rpx 处理 */
18
+ logoSize: makeNumericProp(80),
19
+ /** 二维码内边距,number 与纯数字字符串按 rpx 处理 */
20
+ padding: makeNumericProp(0),
21
+ /** 二维码前景色 */
22
+ foreground: makeStringProp('#000'),
23
+ /** 二维码背景颜色 */
24
+ background: makeStringProp('#FFFFFF'),
25
+ /** 二维码错误级别
26
+ * 默认值:H
27
+ * 可选值:L、M、Q、H
28
+ * */
29
+ ecc: {
30
+ type: String as PropType<'L' | 'M' | 'Q' | 'H'>,
31
+ default: 'H'
32
+ },
33
+ /** 二维码样式 rect 普通矩形、circular 小圆点、line 线条、rectSmall 小方格*/
34
+ mode: {
35
+ type: String as PropType<ClQrcodeMode>,
36
+ default: 'circular'
37
+ },
38
+ /** 二维码边框颜色 */
39
+ pdColor: makeStringProp(''),
40
+ /** 二维码边框圆角,number 与纯数字字符串按 rpx 处理 */
41
+ pdRadius: makeNumericProp(0)
42
+ }
@@ -32,25 +32,25 @@
32
32
 
33
33
  @include when(button) {
34
34
  .oxy-radio__label {
35
- border-color: #c8c9cc;
36
- background: #3a3a3c;
35
+ border-color: $-color-gray-5;
36
+ background: $-dark-border-color;
37
37
  color: $-dark-color-gray;
38
38
  }
39
39
  @include when(checked) {
40
40
  .oxy-radio__label {
41
- border-color: #c8c9cc;
42
- background: #3a3a3c;
43
- color: #c8c9cc;
41
+ border-color: $-color-gray-5;
42
+ background: $-dark-border-color;
43
+ color: $-color-gray-5;
44
44
  }
45
45
  }
46
46
  }
47
47
 
48
48
  @include when(dot) {
49
49
  .oxy-radio__shape {
50
- border-color: #c8c9cc;
51
- background: #3a3a3c;
50
+ border-color: $-color-gray-5;
51
+ background: $-dark-border-color;
52
52
  &::before {
53
- background-color: #c8c9cc;
53
+ background-color: $-color-gray-5;
54
54
  }
55
55
  }
56
56
  }
@@ -92,7 +92,7 @@
92
92
  vertical-align: top;
93
93
  font-size: $-radio-label-fs;
94
94
  color: $-radio-label-color;
95
- line-height: 20px;
95
+ line-height: 48rpx;
96
96
  word-break: break-all;
97
97
  }
98
98
  @include when(checked) {
@@ -109,7 +109,7 @@
109
109
 
110
110
  @include when(dot) {
111
111
  .oxy-radio__shape {
112
- border: 2px solid $-radio-dot-border-color;
112
+ border: 4rpx solid $-radio-dot-border-color;
113
113
  border-radius: 50%;
114
114
  position: relative;
115
115
  display: inline-block;
@@ -124,7 +124,7 @@
124
124
  left: calc(50% - #{$-radio-dot-size / 2});
125
125
  top: calc(50% - #{$-radio-dot-size / 2});
126
126
  border-radius: 50%;
127
- background-color: #fff;
127
+ background-color: $-color-white;
128
128
  transform: scale(0);
129
129
  transition: transform .2s ease-in;
130
130
  }
@@ -145,17 +145,23 @@
145
145
  @include when(button) {
146
146
  display: inline-block;
147
147
  margin-top: 0;
148
- margin-right: 10px;
148
+ margin-right: 24rpx;
149
149
 
150
150
  .oxy-radio__shape {
151
151
  display: none;
152
152
  }
153
153
  .oxy-radio__label {
154
+ display: inline-flex;
155
+ align-items: center;
156
+ justify-content: center;
154
157
  height: $-radio-button-height;
155
158
  min-width: $-radio-button-min-width;
156
159
  max-width: $-radio-button-max-width;
157
- padding: 5px 15px;
160
+ padding: 16rpx 32rpx;
158
161
  margin-right: 0;
162
+ line-height: 1.2;
163
+ text-align: center;
164
+ vertical-align: middle;
159
165
  border-radius: $-radio-button-radius;
160
166
  background-color: $-radio-button-bg;
161
167
  font-size: $-radio-button-fs;
@@ -187,7 +193,7 @@
187
193
  }
188
194
  .oxy-radio__shape {
189
195
  display: block;
190
- margin-right: 4px;
196
+ margin-right: 8rpx;
191
197
  float: left;
192
198
  &::after {
193
199
  content: "";
@@ -198,7 +204,7 @@
198
204
 
199
205
  @include when(dot) {
200
206
  .oxy-radio__shape {
201
- margin-top: 2px;
207
+ margin-top: 4rpx;
202
208
  }
203
209
  @include when(large) {
204
210
  .oxy-radio__shape {
@@ -210,7 +216,7 @@
210
216
  &.icon-placement-right {
211
217
  .oxy-radio__shape {
212
218
  margin-right: 0;
213
- margin-left: 4px;
219
+ margin-left: 8rpx;
214
220
  float: right;
215
221
  }
216
222
  }
@@ -257,18 +263,18 @@
257
263
 
258
264
  // 以下内容用于解决父子组件样式隔离的问题 —— START
259
265
  @include when(cell-radio) {
260
- padding: 13px 15px;
266
+ padding: 32rpx 32rpx;
261
267
  margin: 0;
262
268
 
263
269
  @include when(large) {
264
- padding: 14px 15px;
270
+ padding: 32rpx 32rpx;
265
271
  }
266
272
  }
267
273
 
268
274
  @include when(button-radio) {
269
275
  display: inline-flex;
270
276
  width: 33.3333%;
271
- padding: 12px 12px 0px 0px;
277
+ padding: 24rpx 24rpx 0 0;
272
278
  box-sizing: border-box;
273
279
 
274
280
  .oxy-radio__label {
@@ -11,11 +11,11 @@
11
11
  background-color: $-radio-bg;
12
12
  font-size: 0;
13
13
 
14
- // 上下20px 左右15px 内部间隔12px
14
+ // 顶部与两侧留白适当放大,避免按钮组在16px基准字号下过于紧凑
15
15
  @include when(button) {
16
16
  width: 100%;
17
17
  height: 100%;
18
- padding: 8px 3px 20px 15px;
18
+ padding: 24rpx 32rpx 40rpx 32rpx;
19
19
  box-sizing: border-box;
20
20
  overflow: hidden;
21
21
  height: auto;
@@ -31,16 +31,16 @@ export const rateProps = {
31
31
  /**
32
32
  * 图标大小
33
33
  * 类型: string
34
- * 默认值: '16px'
34
+ * 默认值: '32rpx'
35
35
  */
36
- size: makeStringProp('16px'),
36
+ size: makeStringProp('32rpx'),
37
37
 
38
38
  /**
39
39
  * 图标间距
40
40
  * 类型: string
41
- * 默认值: '4px'
41
+ * 默认值: '8rpx'
42
42
  */
43
- space: makeStringProp('4px'),
43
+ space: makeStringProp('8rpx'),
44
44
 
45
45
  /**
46
46
  * 未选中的图标颜色
@@ -5,8 +5,8 @@
5
5
 
6
6
  @include e(container) {
7
7
  position: absolute;
8
- min-width: 1px;
9
- min-height: 1px;
8
+ min-width: 2rpx;
9
+ min-height: 2rpx;
10
10
  }
11
11
 
12
12
  @include e(wrapper) {
@@ -13,7 +13,7 @@
13
13
  :scroll-left="expandScrollLeft"
14
14
  @scroll="onScrollHandler"
15
15
  >
16
- <view class="oxy-resize__wrapper--placeholder" style="height: 100000px; width: 100000px"></view>
16
+ <view class="oxy-resize__wrapper--placeholder" style="height: 200000rpx; width: 200000rpx"></view>
17
17
  </scroll-view>
18
18
  <!--监听插槽变小-->
19
19
  <scroll-view
@@ -43,7 +43,7 @@ export default {
43
43
 
44
44
  <script lang="ts" setup>
45
45
  import { computed, getCurrentInstance, onMounted, ref } from 'vue'
46
- import { addUnit, objToStyle, uuid } from '../common/util'
46
+ import { objToStyle, unitConvert, uuid } from '../common/util'
47
47
  import { resizeProps } from './types'
48
48
 
49
49
  const props = defineProps(resizeProps)
@@ -59,8 +59,8 @@ const scrollEventCount = ref<number>(0)
59
59
 
60
60
  const rootStyle = computed(() => {
61
61
  const style: Record<string, string | number> = {
62
- width: addUnit(width.value),
63
- height: addUnit(height.value)
62
+ width: unitConvert(width.value, 0, { output: 'px' }),
63
+ height: unitConvert(height.value, 0, { output: 'px' })
64
64
  }
65
65
  return `${objToStyle(style)}${props.customStyle}`
66
66
  })
@@ -2,5 +2,8 @@ import { baseProps, makeStringProp } from '../common/props'
2
2
 
3
3
  export const resizeProps = {
4
4
  ...baseProps,
5
+ /**
6
+ * 自定义容器类名
7
+ */
5
8
  customContainerClass: makeStringProp('')
6
9
  }
@@ -6,6 +6,7 @@
6
6
  flex-direction: column;
7
7
  overflow: hidden;
8
8
  height: 100%;
9
+ text-align: left;
9
10
 
10
11
  &.editable {
11
12
  border: 1px solid $-rich-text-editable-border-color;
@@ -15,7 +16,7 @@
15
16
  .rich-text-main {
16
17
  flex: 1;
17
18
  overflow-y: auto;
18
- padding: 8px;
19
+ padding: 16rpx;
19
20
  position: relative;
20
21
 
21
22
  }
@@ -26,76 +27,76 @@
26
27
 
27
28
  .editor_toolbox {
28
29
  width: 100%;
29
- background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
30
- padding: 4px 8px;
30
+ background: $-rich-text-toolbox-bg-gradient;
31
+ padding: 8rpx 16rpx;
31
32
  box-sizing: border-box;
32
33
  flex-wrap: wrap;
33
- gap: 4px;
34
+ gap: 8rpx;
34
35
  display: flex;
35
36
  align-items: center;
36
37
  border-bottom: 1px solid $-color-border-light;
37
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
38
+ box-shadow: $-rich-text-toolbox-shadow;
38
39
 
39
40
  .oxy-icon {
40
41
  cursor: pointer;
41
- width: 32px;
42
- height: 32px;
42
+ width: 64rpx;
43
+ height: 64rpx;
43
44
  display: inline-flex;
44
45
  align-items: center;
45
46
  justify-content: center;
46
- border-radius: 6px;
47
+ border-radius: $-rich-text-toolbox-icon-radius;
47
48
  transition: all 0.2s ease;
48
49
  color: $-color-secondary;
49
- font-size: 18px;
50
+ font-size: $-rich-text-toolbox-icon-size;
50
51
 
51
52
  &:hover {
52
- background-color: rgba(0, 0, 0, 0.05);
53
+ background-color: $-rich-text-toolbox-icon-hover-bg;
53
54
  color: $-color-theme;
54
55
  }
55
56
 
56
57
  &:active {
57
- background-color: rgba(0, 0, 0, 0.08);
58
+ background-color: $-rich-text-toolbox-icon-active-bg;
58
59
  }
59
60
  }
60
61
 
61
62
  image {
62
- width: 16px;
63
- height: 16px;
63
+ width: 32rpx;
64
+ height: 32rpx;
64
65
  cursor: pointer;
65
- padding: 8px;
66
- border-radius: 6px;
66
+ padding: 16rpx;
67
+ border-radius: $-rich-text-toolbox-icon-radius;
67
68
  transition: all 0.2s ease;
68
69
  box-sizing: content-box;
69
70
  display: inline-block;
70
71
  vertical-align: middle;
71
72
 
72
73
  &:hover {
73
- background-color: rgba(0, 0, 0, 0.05);
74
+ background-color: $-rich-text-toolbox-icon-hover-bg;
74
75
  }
75
76
 
76
77
  &:active {
77
- background-color: rgba(0, 0, 0, 0.08);
78
+ background-color: $-rich-text-toolbox-icon-active-bg;
78
79
  }
79
80
  }
80
81
 
81
82
  svg {
82
83
  cursor: pointer;
83
- width: 16px;
84
- height: 16px;
85
- padding: 8px;
86
- border-radius: 6px;
84
+ width: 32rpx;
85
+ height: 32rpx;
86
+ padding: 16rpx;
87
+ border-radius: $-rich-text-toolbox-icon-radius;
87
88
  transition: all 0.2s ease;
88
89
  box-sizing: content-box;
89
90
  display: inline-block;
90
91
  vertical-align: middle;
91
92
 
92
93
  &:hover {
93
- background-color: rgba(0, 0, 0, 0.05);
94
- transform: translateY(-1px);
94
+ background-color: $-rich-text-toolbox-icon-hover-bg;
95
+ transform: translateY(-2rpx);
95
96
  }
96
97
 
97
98
  &:active {
98
- background-color: rgba(0, 0, 0, 0.08);
99
+ background-color: $-rich-text-toolbox-icon-active-bg;
99
100
  transform: translateY(0);
100
101
  }
101
102
  }
@@ -106,22 +107,22 @@
106
107
  }
107
108
 
108
109
  .dialog-title {
109
- font-size: 16px;
110
- line-height: 46px;
110
+ font-size: $-fs-title;
111
+ line-height: 100rpx;
111
112
  text-align: center;
112
- height: 46px;
113
+ height: 100rpx;
113
114
  font-weight: $-fw-semibold;
114
115
  color: $-color-black;
115
116
 
116
117
  }
117
118
 
118
119
  .oxy-rich-text__popup {
119
- padding: 0 12px 12px 12px;
120
+ padding: 0 24rpx 24rpx 24rpx;
120
121
 
121
122
  .oxy-rich-text__emoji-content {
122
123
  display: flex;
123
- font-size: 20px;
124
- line-height: 35px;
124
+ font-size: $-rich-text-emoji-fs;
125
+ line-height: 80rpx;
125
126
  text-align: center;
126
127
 
127
128
  .oxy-rich-text__emoji-block {
@@ -133,23 +134,23 @@
133
134
  border-top: 1px dashed $-rich-text-popup-divider-color;
134
135
  width: 80%;
135
136
  height: 0;
136
- margin: 20px auto;
137
+ margin: 40rpx auto;
137
138
  }
138
139
 
139
140
  .oxy-rich-text__link-input {
140
- margin-bottom: 16px;
141
+ margin-bottom: 32rpx;
141
142
 
142
143
  .oxy-rich-text__link-label {
143
- font-size: 14px;
144
+ font-size: $-fs-content;
144
145
  color: $-color-secondary;
145
- margin-bottom: 8px;
146
+ margin-bottom: 16rpx;
146
147
  }
147
148
  }
148
149
 
149
150
  .oxy-rich-text__link-buttons {
150
151
  display: flex;
151
- gap: 12px;
152
- margin-top: 20px;
152
+ gap: 24rpx;
153
+ margin-top: 40rpx;
153
154
 
154
155
  .oxy-button {
155
156
  flex: 1;
@@ -71,7 +71,7 @@
71
71
  .card {
72
72
 
73
73
  width: 80%;
74
- margin: 10rpx auto;
74
+ margin: 12rpx auto;
75
75
  max-width: 700rpx;
76
76
  max-height: 140rpx;
77
77
 
@@ -82,7 +82,7 @@
82
82
  justify-content: space-between;
83
83
  align-items: center;
84
84
 
85
- padding: 20rpx 0 20rpx 10rpx;
85
+ padding: 20rpx 0 20rpx 12rpx;
86
86
  border-radius: 12rpx;
87
87
 
88
88
  &-img {
@@ -119,4 +119,4 @@
119
119
  line-height: 37rpx;
120
120
  }
121
121
  }
122
- </style>
122
+ </style>
@@ -3,7 +3,7 @@
3
3
  id="_root"
4
4
  class="mp-html"
5
5
  :class="(selectable ? '_select ' : '') + '_root'"
6
- :style="(editable ? 'min-height:200px;' : '') + containerStyle"
6
+ :style="(editable ? 'min-height:400rpx;' : '') + containerStyle"
7
7
  @tap="_containTap"
8
8
  >
9
9
  <slot v-if="!nodes[0]" />
@@ -11,14 +11,19 @@
11
11
  <node v-else :childs="nodes" :opts="[lazyLoad, loadingImg, errorImg, showImgMenu, selectable, editable, placeholder, 'nodes']" name="span" />
12
12
  <!-- #endif -->
13
13
  <!-- #ifdef APP-PLUS-NVUE -->
14
- <web-view ref="web" src="/static/app-plus/mp-html/local.html" :style="'margin-top:-2px;height:' + height + 'px'" @onPostMessage="_onMessage" />
14
+ <web-view
15
+ ref="web"
16
+ src="/static/app-plus/mp-html/local.html"
17
+ :style="'margin-top:' + toPx(-2) + ';height:' + toPx(height)"
18
+ @onPostMessage="_onMessage"
19
+ />
15
20
  <!-- #endif -->
16
- <view v-if="tooltip" class="_tooltip_contain" :style="'top:' + tooltip.top + 'px'">
21
+ <view v-if="tooltip" class="_tooltip_contain" :style="'top:' + toPx(tooltip.top)">
17
22
  <view class="_tooltip">
18
23
  <view v-for="(item, index) in tooltip.items" v-bind:key="index" class="_tooltip_item" :data-i="index" @tap="_tooltipTap">{{ item }}</view>
19
24
  </view>
20
25
  </view>
21
- <view v-if="slider" class="_slider" :style="'top:' + slider.top + 'px'">
26
+ <view v-if="slider" class="_slider" :style="'top:' + toPx(slider.top)">
22
27
  <slider
23
28
  :value="slider.value"
24
29
  :min="slider.min"
@@ -27,12 +32,12 @@
27
32
  block-size="14"
28
33
  show-value
29
34
  activeColor="white"
30
- style="padding: 3px"
35
+ style="padding: 6rpx"
31
36
  @changing="_sliderChanging"
32
37
  @change="_sliderChange"
33
38
  />
34
39
  </view>
35
- <view v-if="color" class="_tooltip_contain" :style="'top:' + color.top + 'px'">
40
+ <view v-if="color" class="_tooltip_contain" :style="'top:' + toPx(color.top)">
36
41
  <view class="_tooltip" style="overflow-y: hidden">
37
42
  <view
38
43
  v-for="(item, index) in color.items"
@@ -85,6 +90,7 @@ import highlight from './highlight/index.js'
85
90
  import latex from './latex/index.js'
86
91
  import style from './style/index.js'
87
92
  import editable from './editable/index.js'
93
+ import { unitConvert } from '../../common/util'
88
94
  const plugins = [markdown, highlight, latex, style, editable]
89
95
  // #ifdef APP-PLUS-NVUE
90
96
  const dom = weex.requireModule('dom')
@@ -184,6 +190,9 @@ export default {
184
190
  this._hook('onDetached')
185
191
  },
186
192
  methods: {
193
+ toPx(value) {
194
+ return unitConvert(value, 0, { output: 'px' })
195
+ },
187
196
  _containTap() {
188
197
  if (!this._lock && !this.slider && !this.color) {
189
198
  this._edit = undefined
@@ -587,7 +596,7 @@ export default {
587
596
  /* #ifndef APP-PLUS-NVUE */
588
597
  /* 根节点样式 */
589
598
  ._root {
590
- padding: 1px 0;
599
+ padding: 4rpx 0;
591
600
  overflow-x: auto;
592
601
  overflow-y: hidden;
593
602
  -webkit-overflow-scrolling: touch;
@@ -602,8 +611,8 @@ export default {
602
611
  /* 提示条 */
603
612
  ._tooltip_contain {
604
613
  position: absolute;
605
- right: 20px;
606
- left: 20px;
614
+ right: 40rpx;
615
+ left: 40rpx;
607
616
  text-align: center;
608
617
  }
609
618
 
@@ -612,29 +621,29 @@ export default {
612
621
  display: inline-block;
613
622
  width: auto;
614
623
  max-width: 100%;
615
- height: 30px;
616
- padding: 0 3px;
624
+ height: 60rpx;
625
+ padding: 0 8rpx;
617
626
  overflow-x: auto;
618
627
  overflow-y: hidden;
619
- font-size: 14px;
620
- line-height: 30px;
628
+ font-size: var(--oxy-fs-content, 32rpx);
629
+ line-height: 60rpx;
621
630
  white-space: nowrap;
622
- padding-bottom: 2px;
631
+ padding-bottom: 4rpx;
623
632
  border: 1px solid transparent;
624
633
  }
625
634
 
626
635
  ._tooltip::-webkit-scrollbar {
627
- height: 4px;
636
+ height: 8rpx;
628
637
  }
629
638
 
630
639
  ._tooltip::-webkit-scrollbar-track {
631
640
  background: rgba(255, 255, 255, 0.1);
632
- border-radius: 2px;
641
+ border-radius: 4rpx;
633
642
  }
634
643
 
635
644
  ._tooltip::-webkit-scrollbar-thumb {
636
645
  background: rgba(255, 255, 255, 1);
637
- border-radius: 2px;
646
+ border-radius: 4rpx;
638
647
  }
639
648
 
640
649
  ._tooltip::-webkit-scrollbar-thumb:hover {
@@ -645,16 +654,16 @@ export default {
645
654
  display: inline-block;
646
655
  width: auto;
647
656
  padding: 0 2vw;
648
- line-height: 30px;
657
+ line-height: 60rpx;
649
658
  background-color: black;
650
659
  color: white;
651
660
  }
652
661
 
653
662
  ._color_item {
654
663
  display: inline-block;
655
- width: 18px;
656
- height: 18px;
657
- margin: 5px 2vw;
664
+ width: 36rpx;
665
+ height: 36rpx;
666
+ margin: 12rpx 2vw;
658
667
  border: 1px solid #dfe2e5;
659
668
  border-radius: 50%;
660
669
  }
@@ -662,14 +671,14 @@ export default {
662
671
  /* 图片宽度滚动条 */
663
672
  ._slider {
664
673
  position: absolute;
665
- left: 20px;
666
- width: 220px;
674
+ left: 40rpx;
675
+ width: 440rpx;
667
676
  }
668
677
 
669
678
  ._tooltip,
670
679
  ._slider {
671
680
  background-color: black;
672
- border-radius: 3px;
681
+ border-radius: 6rpx;
673
682
  opacity: 0.75;
674
683
  }
675
684
  </style>