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.
- package/attributes.json +1 -1
- package/components/common/abstracts/variable.scss +512 -343
- package/components/common/util.ts +185 -32
- package/components/composables/index.ts +1 -0
- package/components/composables/usePopover.ts +24 -20
- package/components/composables/useVirtualScroll.ts +48 -21
- package/components/composables/useWindowResize.ts +35 -0
- package/components/oxy-action-sheet/index.scss +24 -11
- package/components/oxy-action-sheet/oxy-action-sheet.vue +27 -19
- package/components/oxy-action-sheet/types.ts +7 -0
- package/components/oxy-backtop/index.scss +4 -4
- package/components/oxy-backtop/oxy-backtop.vue +9 -6
- package/components/oxy-backtop/types.ts +7 -7
- package/components/oxy-badge/index.scss +4 -4
- package/components/oxy-badge/oxy-badge.vue +3 -3
- package/components/oxy-badge/types.ts +2 -2
- package/components/oxy-button/index.scss +5 -5
- package/components/oxy-button/oxy-button.vue +5 -1
- package/components/oxy-calendar/index.scss +15 -15
- package/components/oxy-calendar/oxy-calendar.vue +1 -0
- package/components/oxy-calendar/types.ts +5 -0
- package/components/oxy-calendar-view/month/index.scss +4 -4
- package/components/oxy-calendar-view/month/types.ts +36 -0
- package/components/oxy-calendar-view/monthPanel/index.scss +7 -8
- package/components/oxy-calendar-view/monthPanel/month-panel.vue +14 -8
- package/components/oxy-calendar-view/year/index.scss +5 -5
- package/components/oxy-calendar-view/yearPanel/index.scss +4 -4
- package/components/oxy-calendar-view/yearPanel/year-panel.vue +21 -5
- package/components/oxy-card/index.scss +2 -2
- package/components/oxy-cell/index.scss +8 -8
- package/components/oxy-checkbox/index.scss +12 -12
- package/components/oxy-checkbox-group/index.scss +2 -2
- package/components/oxy-circle/oxy-circle.vue +10 -7
- package/components/oxy-circle/types.ts +5 -5
- package/components/oxy-col/oxy-col.vue +2 -2
- package/components/oxy-col-picker/index.scss +4 -4
- package/components/oxy-col-picker/oxy-col-picker.vue +6 -5
- package/components/oxy-col-picker/types.ts +7 -2
- package/components/oxy-collapse/index.scss +2 -2
- package/components/oxy-collapse-item/oxy-collapse-item.vue +3 -3
- package/components/oxy-corner/index.scss +33 -33
- package/components/oxy-count-to/oxy-count-to.vue +3 -3
- package/components/oxy-curtain/index.scss +15 -15
- package/components/oxy-curtain/oxy-curtain.vue +4 -2
- package/components/oxy-curtain/types.ts +6 -1
- package/components/oxy-date-strip/oxy-date-strip.vue +2 -2
- package/components/oxy-date-strip/types.ts +1 -1
- package/components/oxy-date-strip-item/index.scss +3 -3
- package/components/oxy-datetime-picker/index.scss +11 -11
- package/components/oxy-datetime-picker/oxy-datetime-picker.vue +1 -0
- package/components/oxy-datetime-picker/types.ts +5 -0
- package/components/oxy-drop-menu/index.scss +5 -5
- package/components/oxy-drop-menu/oxy-drop-menu.vue +3 -3
- package/components/oxy-drop-menu-item/index.scss +3 -3
- package/components/oxy-drop-menu-item/oxy-drop-menu-item.vue +4 -3
- package/components/oxy-drop-menu-item/types.ts +5 -0
- package/components/oxy-echarts/types.ts +6 -0
- package/components/oxy-fab/index.scss +8 -8
- package/components/oxy-fab/oxy-fab.vue +22 -3
- package/components/oxy-file-list/index.scss +30 -29
- package/components/oxy-file-list/oxy-file-list.vue +2 -2
- package/components/oxy-floating-panel/oxy-floating-panel.vue +13 -9
- package/components/oxy-floating-panel/{type.ts → types.ts} +8 -8
- package/components/oxy-footer/index.scss +19 -0
- package/components/oxy-footer/oxy-footer.vue +78 -0
- package/components/oxy-footer/types.ts +17 -0
- package/components/oxy-form-item/types.ts +22 -1
- package/components/oxy-gap/oxy-gap.vue +2 -2
- package/components/oxy-gap/types.ts +2 -2
- package/components/oxy-grid/oxy-grid.vue +1 -1
- package/components/oxy-grid/types.ts +1 -1
- package/components/oxy-grid-item/index.scss +1 -1
- package/components/oxy-grid-item/oxy-grid-item.vue +7 -5
- package/components/oxy-grid-item/types.ts +1 -1
- package/components/oxy-guidance/index.scss +75 -0
- package/components/oxy-guidance/oxy-guidance.vue +201 -0
- package/components/oxy-guidance/types.ts +33 -0
- package/components/oxy-icon/oxy-icon.vue +2 -2
- package/components/oxy-icon/types.ts +1 -1
- package/components/oxy-img/oxy-img.vue +4 -4
- package/components/oxy-img/types.ts +3 -3
- package/components/oxy-img-cropper/index.scss +23 -23
- package/components/oxy-img-cropper/oxy-img-cropper.vue +97 -52
- package/components/oxy-img-cropper/types.ts +2 -2
- package/components/oxy-img-lazy/oxy-img-lazy.vue +3 -3
- package/components/oxy-img-lazy/types.ts +3 -3
- package/components/oxy-index-anchor/index.scss +2 -2
- package/components/oxy-index-anchor/oxy-index-anchor.vue +2 -2
- package/components/oxy-index-anchor/{type.ts → types.ts} +3 -0
- package/components/oxy-index-bar/index.scss +3 -3
- package/components/oxy-index-bar/oxy-index-bar.vue +3 -3
- package/components/oxy-index-bar/{type.ts → types.ts} +2 -2
- package/components/oxy-input/index.scss +1 -1
- package/components/oxy-input-number/index.scss +5 -5
- package/components/oxy-input-number/oxy-input-number.vue +2 -2
- package/components/oxy-input-number/types.ts +3 -2
- package/components/oxy-keyboard/index.scss +5 -5
- package/components/oxy-keyboard/key/index.scss +3 -3
- package/components/oxy-keyboard/key/index.vue +2 -2
- package/components/oxy-keyboard/key/types.ts +15 -0
- package/components/oxy-keyboard/oxy-keyboard.vue +1 -0
- package/components/oxy-keyboard/types.ts +5 -0
- package/components/oxy-link/index.scss +2 -2
- package/components/oxy-list/oxy-list.vue +4 -3
- package/components/oxy-loading/oxy-loading.vue +8 -4
- package/components/oxy-loading/types.ts +1 -1
- package/components/oxy-loadmore/index.scss +3 -3
- package/components/oxy-long-press-menu/index.scss +93 -0
- package/components/oxy-long-press-menu/oxy-long-press-menu.vue +338 -0
- package/components/oxy-long-press-menu/types.ts +34 -0
- package/components/oxy-message-box/index.scss +12 -11
- package/components/oxy-message-box/oxy-message-box.vue +9 -2
- package/components/oxy-message-box/types.ts +9 -0
- package/components/oxy-navbar/index.scss +2 -2
- package/components/oxy-navbar/oxy-navbar.vue +58 -13
- package/components/oxy-navbar/types.ts +8 -1
- package/components/oxy-navbar-capsule/types.ts +3 -0
- package/components/oxy-notice-bar/index.scss +3 -3
- package/components/oxy-notice-bar/oxy-notice-bar.vue +9 -5
- package/components/oxy-notice-bar/types.ts +3 -3
- package/components/oxy-notify/index.ts +1 -0
- package/components/oxy-notify/oxy-notify.vue +3 -2
- package/components/oxy-notify/types.ts +7 -0
- package/components/oxy-pagination/index.scss +6 -5
- package/components/oxy-password-input/oxy-password-input.vue +2 -2
- package/components/oxy-password-input/types.ts +1 -1
- package/components/oxy-picker/index.scss +45 -2
- package/components/oxy-picker/oxy-picker.vue +100 -14
- package/components/oxy-picker/types.ts +29 -1
- package/components/oxy-picker-view/index.scss +4 -4
- package/components/oxy-picker-view/oxy-picker-view.vue +4 -4
- package/components/oxy-popover/index.scss +13 -13
- package/components/oxy-popup/index.scss +4 -4
- package/components/oxy-popup/oxy-popup.vue +35 -2
- package/components/oxy-popup/types.ts +8 -1
- package/components/oxy-progress/index.scss +3 -3
- package/components/oxy-qrcode/draw.ts +398 -0
- package/components/oxy-qrcode/index.scss +2 -0
- package/components/oxy-qrcode/oxy-qrcode.vue +124 -0
- package/components/oxy-qrcode/qrcode.ts +936 -0
- package/components/oxy-qrcode/types.ts +42 -0
- package/components/oxy-radio/index.scss +25 -19
- package/components/oxy-radio-group/index.scss +2 -2
- package/components/oxy-rate/types.ts +4 -4
- package/components/oxy-resize/index.scss +2 -2
- package/components/oxy-resize/oxy-resize.vue +4 -4
- package/components/oxy-resize/types.ts +3 -0
- package/components/oxy-rich-text/index.scss +37 -36
- package/components/oxy-rich-text/mp-html/card/card.vue +3 -3
- package/components/oxy-rich-text/mp-html/mp-html.vue +33 -24
- package/components/oxy-rich-text/mp-html/node/node.vue +30 -19
- package/components/oxy-rich-text/oxy-rich-text.vue +31 -31
- package/components/oxy-rich-text/types.ts +6 -1
- package/components/oxy-row/oxy-row.vue +3 -3
- package/components/oxy-row/types.ts +1 -1
- package/components/oxy-search/index.scss +7 -7
- package/components/oxy-segmented/index.scss +19 -16
- package/components/oxy-segmented/oxy-segmented.vue +23 -3
- package/components/oxy-select/index.scss +213 -89
- package/components/oxy-select/oxy-select.vue +106 -58
- package/components/oxy-select/types.ts +13 -1
- package/components/oxy-select-picker/index.scss +7 -7
- package/components/oxy-select-picker/oxy-select-picker.vue +1 -0
- package/components/oxy-select-picker/types.ts +2 -0
- package/components/oxy-sidebar-item/index.scss +2 -2
- package/components/oxy-signature/oxy-signature.vue +18 -10
- package/components/oxy-signature/types.ts +106 -13
- package/components/oxy-skeleton/index.scss +1 -1
- package/components/oxy-skeleton/oxy-skeleton.vue +6 -6
- package/components/oxy-skeleton/types.ts +1 -1
- package/components/oxy-slider/index.scss +6 -6
- package/components/oxy-sort-button/index.scss +8 -8
- package/components/oxy-splitter/index.scss +19 -0
- package/components/oxy-splitter/oxy-splitter.vue +409 -0
- package/components/oxy-splitter/types.ts +75 -0
- package/components/oxy-splitter-panel/index.scss +366 -0
- package/components/oxy-splitter-panel/oxy-splitter-panel.vue +432 -0
- package/components/oxy-splitter-panel/types.ts +63 -0
- package/components/oxy-status-tip/index.scss +4 -4
- package/components/oxy-status-tip/oxy-status-tip.vue +5 -5
- package/components/oxy-status-tip/types.ts +3 -3
- package/components/oxy-step/index.scss +16 -16
- package/components/oxy-sticky/oxy-sticky.vue +6 -6
- package/components/oxy-stream-render/oxy-stream-render.vue +230 -4
- package/components/oxy-stream-render/types.ts +4 -1
- package/components/oxy-swipe-action/oxy-swipe-action.vue +27 -2
- package/components/oxy-swiper/oxy-swiper.vue +6 -6
- package/components/oxy-swiper/types.ts +5 -5
- package/components/oxy-swiper-nav/index.scss +3 -3
- package/components/oxy-switch/index.scss +10 -10
- package/components/oxy-switch/oxy-switch.vue +2 -2
- package/components/oxy-switch/types.ts +1 -1
- package/components/oxy-tab/index.scss +11 -1
- package/components/oxy-tabbar/index.scss +2 -2
- package/components/oxy-tabbar/oxy-tabbar.vue +39 -10
- package/components/oxy-table/index.scss +8 -8
- package/components/oxy-table/oxy-table.vue +8 -6
- package/components/oxy-table/types.ts +2 -2
- package/components/oxy-table-col/index.scss +3 -3
- package/components/oxy-table-col/oxy-table-col.vue +3 -3
- package/components/oxy-table-col/types.ts +2 -2
- package/components/oxy-tabs/index.scss +52 -22
- package/components/oxy-tabs/oxy-tabs.vue +53 -19
- package/components/oxy-tabs/types.ts +15 -3
- package/components/oxy-tag/index.scss +111 -36
- package/components/oxy-text/index.scss +5 -1
- package/components/oxy-text/oxy-text.vue +76 -7
- package/components/oxy-text/types.ts +12 -0
- package/components/oxy-textarea/index.scss +6 -6
- package/components/oxy-toast/oxy-toast.vue +24 -8
- package/components/oxy-tooltip/index.scss +9 -9
- package/components/oxy-tree/index.scss +51 -15
- package/components/oxy-tree/oxy-tree.vue +13 -9
- package/components/oxy-tree/types.ts +12 -9
- package/components/oxy-upload/index.scss +23 -23
- package/components/oxy-upload/types.ts +2 -2
- package/components/oxy-verification-code/index.scss +6 -0
- package/components/oxy-verification-code/oxy-verification-code.vue +187 -0
- package/components/oxy-verification-code/types.ts +82 -0
- package/components/oxy-video-preview/index.scss +4 -4
- package/components/oxy-virtual-scroll/index.scss +5 -5
- package/components/oxy-virtual-scroll/oxy-virtual-scroll.vue +11 -7
- package/components/oxy-virtual-scroll/types.ts +14 -14
- package/components/oxy-voice-player/index.scss +937 -0
- package/components/oxy-voice-player/oxy-voice-player.vue +821 -0
- package/components/oxy-voice-player/types.ts +567 -0
- package/components/oxy-waterfall/oxy-waterfall.vue +6 -6
- package/components/oxy-waterfall/types.ts +6 -6
- package/components/oxy-watermark/oxy-watermark.vue +35 -13
- package/components/oxy-watermark/types.ts +14 -14
- package/global.d.ts +4 -0
- package/locale/lang/ar-SA.ts +3 -0
- package/locale/lang/en-US.ts +3 -0
- package/locale/lang/zh-CN.ts +3 -0
- package/package.json +97 -1
- package/tags.json +1 -1
- package/web-types.json +1 -1
- package/components/oxy-number-keyboard/index.scss +0 -78
- package/components/oxy-number-keyboard/key/index.scss +0 -81
- package/components/oxy-number-keyboard/key/index.vue +0 -78
- package/components/oxy-number-keyboard/key/types.ts +0 -11
- package/components/oxy-number-keyboard/oxy-number-keyboard.vue +0 -151
- package/components/oxy-number-keyboard/types.ts +0 -83
- package/components/oxy-tree/components/tree-node-content.vue +0 -72
- package/components/oxy-tree/index.ts +0 -51
- 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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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(
|
|
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(
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
987
|
-
height:
|
|
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:
|
|
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:
|
|
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:
|
|
1158
|
-
height:
|
|
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="
|
|
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:
|
|
114
|
-
'<div style="width: 100%; box-sizing: border-box; border-radius:
|
|
115
|
-
'<div style="border: 1px solid gray; box-shadow:
|
|
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:
|
|
146
|
+
font-size: 32rpx;
|
|
147
147
|
color: var(--oxy-rich-text-primary-color, #262626);
|
|
148
148
|
`,
|
|
149
149
|
h1: `
|
|
150
|
-
margin:
|
|
151
|
-
font-size:
|
|
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:
|
|
157
|
-
font-size:
|
|
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:
|
|
163
|
-
font-size:
|
|
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:
|
|
169
|
-
font-size:
|
|
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:
|
|
175
|
-
font-size:
|
|
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:
|
|
181
|
-
font-size:
|
|
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:
|
|
186
|
-
padding:
|
|
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:
|
|
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
|
|
196
|
+
margin: 0 0 20rpx 0;
|
|
197
197
|
color: var(--oxy-rich-text-list-color, #444);
|
|
198
198
|
`,
|
|
199
199
|
li: `
|
|
200
|
-
margin:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
240
|
+
padding: 16rpx 24rpx;
|
|
241
241
|
`,
|
|
242
242
|
pre: `
|
|
243
|
-
border-radius:
|
|
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:
|
|
247
|
+
font-size: 30rpx;
|
|
248
248
|
line-height: 1.65;
|
|
249
|
-
padding:
|
|
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 {
|
|
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 =
|
|
35
|
-
style.marginRight =
|
|
34
|
+
style.marginLeft = withDefaultUnit(gutter / 2)
|
|
35
|
+
style.marginRight = withDefaultUnit(gutter / 2)
|
|
36
36
|
}
|
|
37
37
|
return `${objToStyle(style)}${props.customStyle}`
|
|
38
38
|
})
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
display: flex;
|
|
49
49
|
padding: $-search-padding;
|
|
50
50
|
align-items: center;
|
|
51
|
-
background:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
138
|
+
background: $-search-light-input-bg;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
.oxy-search__cover {
|
|
142
|
-
background:
|
|
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:
|
|
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:
|
|
53
|
+
border-radius: $-segmented-radius;
|
|
51
54
|
flex: 1;
|
|
52
55
|
min-width: 0;
|
|
53
56
|
z-index: 1;
|
|
54
|
-
min-height:
|
|
55
|
-
line-height:
|
|
56
|
-
padding: 0
|
|
57
|
-
font-size:
|
|
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:
|
|
67
|
-
line-height:
|
|
68
|
-
padding: 0
|
|
69
|
-
font-size:
|
|
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:
|
|
75
|
-
line-height:
|
|
76
|
-
padding: 0
|
|
77
|
-
font-size:
|
|
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:
|
|
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,
|
|
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
|
-
|
|
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}
|
|
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)'
|