oxy-uni-ui 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/components/common/abstracts/variable.scss +396 -321
- package/components/common/path.ts +9 -0
- package/components/common/util.ts +200 -5
- package/components/composables/index.ts +1 -0
- package/components/composables/useGlobalLoading.ts +42 -0
- package/components/composables/useGlobalMessage.ts +48 -0
- package/components/composables/useGlobalToast.ts +84 -0
- package/components/composables/usePopover.ts +24 -20
- package/components/composables/useVirtualScroll.ts +13 -11
- 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 +3 -3
- 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 +11 -11
- 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 -7
- package/components/oxy-calendar-view/monthPanel/month-panel.vue +14 -8
- package/components/oxy-calendar-view/year/index.scss +4 -4
- 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-cell/oxy-cell.vue +15 -2
- package/components/oxy-cell/types.ts +4 -0
- package/components/oxy-checkbox/index.scss +8 -8
- package/components/oxy-checkbox/oxy-checkbox.vue +2 -2
- 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 +9 -5
- package/components/oxy-col-picker/types.ts +12 -3
- 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 +32 -32
- package/components/oxy-corner/oxy-corner.vue +15 -3
- package/components/oxy-corner/types.ts +15 -1
- 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/index.scss +10 -0
- package/components/oxy-date-strip/oxy-date-strip.vue +198 -0
- package/components/oxy-date-strip/types.ts +98 -0
- package/components/oxy-date-strip/utils.ts +67 -0
- package/components/oxy-date-strip-item/index.scss +94 -0
- package/components/oxy-date-strip-item/oxy-date-strip-item.vue +102 -0
- package/components/oxy-date-strip-item/types.ts +53 -0
- package/components/oxy-datetime-picker/index.scss +11 -11
- package/components/oxy-datetime-picker/oxy-datetime-picker.vue +4 -1
- package/components/oxy-datetime-picker/types.ts +10 -1
- package/components/oxy-drop-menu/index.scss +3 -3
- package/components/oxy-drop-menu/oxy-drop-menu.vue +3 -3
- package/components/oxy-drop-menu-item/index.scss +1 -1
- 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/index.scss +17 -0
- package/components/oxy-echarts/index.ts +1 -0
- package/components/oxy-echarts/oxy-echarts.vue +32 -0
- package/components/oxy-echarts/types.ts +18 -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 +42 -15
- package/components/oxy-file-list/oxy-file-list.vue +208 -34
- package/components/oxy-file-list/types.ts +58 -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-global-loading/oxy-global-loading.vue +53 -0
- package/components/oxy-global-message/oxy-global-message.vue +64 -0
- package/components/oxy-global-toast/oxy-global-toast.vue +53 -0
- 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 +12 -12
- 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/index.scss +17 -0
- package/components/oxy-img-lazy/oxy-img-lazy.vue +332 -0
- package/components/oxy-img-lazy/types.ts +69 -0
- 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 +57 -0
- package/components/oxy-link/oxy-link.vue +130 -0
- package/components/oxy-link/types.ts +81 -0
- package/components/oxy-list/index.scss +7 -1
- package/components/oxy-list/oxy-list.vue +4 -3
- package/components/oxy-list/types.ts +1 -1
- 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 +11 -3
- package/components/oxy-message-box/types.ts +14 -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 +1 -1
- 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 +103 -14
- package/components/oxy-picker/types.ts +33 -1
- package/components/oxy-picker-view/index.scss +3 -3
- package/components/oxy-picker-view/oxy-picker-view.vue +4 -4
- package/components/oxy-popover/index.scss +9 -9
- package/components/oxy-popup/index.scss +2 -2
- 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 +13 -13
- package/components/oxy-radio/oxy-radio.vue +1 -1
- 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/icon/emjio.svg +1 -0
- package/components/oxy-rich-text/icon/quote.svg +1 -0
- package/components/oxy-rich-text/icon/text.svg +1 -0
- package/components/oxy-rich-text/icon/title.svg +1 -0
- package/components/oxy-rich-text/index.scss +160 -0
- package/components/oxy-rich-text/mp-html/card/card.vue +122 -0
- package/components/oxy-rich-text/mp-html/card/index.js +7 -0
- package/components/oxy-rich-text/mp-html/editable/config.js +15 -0
- package/components/oxy-rich-text/mp-html/editable/index.js +553 -0
- package/components/oxy-rich-text/mp-html/emoji/index.js +203 -0
- package/components/oxy-rich-text/mp-html/highlight/config.js +5 -0
- package/components/oxy-rich-text/mp-html/highlight/index.js +96 -0
- package/components/oxy-rich-text/mp-html/highlight/prism.css +1 -0
- package/components/oxy-rich-text/mp-html/highlight/prism.min.js +7 -0
- package/components/oxy-rich-text/mp-html/img-cache/index.js +138 -0
- package/components/oxy-rich-text/mp-html/latex/index.js +80 -0
- package/components/oxy-rich-text/mp-html/latex/katex.css +1 -0
- package/components/oxy-rich-text/mp-html/latex/katex.min.js +1 -0
- package/components/oxy-rich-text/mp-html/markdown/index.js +50 -0
- package/components/oxy-rich-text/mp-html/markdown/marked.min.js +71 -0
- package/components/oxy-rich-text/mp-html/mp-html.d.ts +184 -0
- package/components/oxy-rich-text/mp-html/mp-html.vue +684 -0
- package/components/oxy-rich-text/mp-html/node/node.vue +1172 -0
- package/components/oxy-rich-text/mp-html/parser.js +1428 -0
- package/components/oxy-rich-text/mp-html/search/index.js +132 -0
- package/components/oxy-rich-text/mp-html/style/index.js +129 -0
- package/components/oxy-rich-text/mp-html/style/parser.js +175 -0
- package/components/oxy-rich-text/mp-html/template/index.js +67 -0
- package/components/oxy-rich-text/mp-html/txv-video/index.js +46 -0
- package/components/oxy-rich-text/oxy-rich-text.vue +642 -0
- package/components/oxy-rich-text/types.ts +76 -0
- package/components/oxy-row/oxy-row.vue +3 -3
- package/components/oxy-row/types.ts +1 -1
- package/components/oxy-search/index.scss +3 -3
- package/components/oxy-segmented/index.scss +16 -16
- package/components/oxy-segmented/oxy-segmented.vue +23 -3
- package/components/oxy-select/index.scss +331 -0
- package/components/oxy-select/oxy-select.vue +456 -0
- package/components/oxy-select/types.ts +83 -0
- package/components/oxy-select-picker/index.scss +7 -7
- package/components/oxy-select-picker/oxy-select-picker.vue +4 -0
- package/components/oxy-select-picker/types.ts +7 -1
- package/components/oxy-sidebar-item/index.scss +1 -1
- package/components/oxy-signature/oxy-signature.vue +18 -10
- package/components/oxy-signature/types.ts +106 -13
- package/components/oxy-skeleton/oxy-skeleton.vue +6 -6
- package/components/oxy-skeleton/types.ts +1 -1
- package/components/oxy-slider/index.scss +3 -3
- package/components/oxy-sort-button/index.scss +8 -8
- 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 +14 -14
- package/components/oxy-sticky/oxy-sticky.vue +6 -6
- package/components/oxy-stream-render/index.scss +6 -0
- package/components/oxy-stream-render/oxy-stream-render.vue +204 -0
- package/components/oxy-stream-render/types.ts +8 -0
- 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-switch/index.scss +8 -8
- 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 +1 -1
- package/components/oxy-tabbar/oxy-tabbar.vue +39 -10
- package/components/oxy-table/index.scss +5 -5
- package/components/oxy-table/oxy-table.vue +8 -6
- package/components/oxy-table/types.ts +2 -2
- 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 +43 -15
- package/components/oxy-tabs/oxy-tabs.vue +53 -19
- package/components/oxy-tabs/types.ts +15 -3
- package/components/oxy-tag/index.scss +15 -15
- 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 +61 -9
- package/components/oxy-tree/oxy-tree.vue +102 -17
- package/components/oxy-tree/types.ts +23 -10
- package/components/oxy-upload/index.scss +21 -21
- 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 +4 -4
- 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 +908 -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/index.scss +18 -0
- package/components/oxy-waterfall/oxy-waterfall.vue +218 -0
- package/components/oxy-waterfall/types.ts +90 -0
- package/components/oxy-waterfall-item/index.scss +8 -0
- package/components/oxy-waterfall-item/oxy-waterfall-item.vue +89 -0
- package/components/oxy-waterfall-item/types.ts +16 -0
- package/components/oxy-watermark/oxy-watermark.vue +35 -13
- package/components/oxy-watermark/types.ts +14 -14
- package/global.d.ts +9 -0
- package/index.ts +3 -0
- package/locale/lang/ar-SA.ts +3 -0
- package/locale/lang/en-US.ts +29 -0
- package/locale/lang/zh-CN.ts +29 -0
- package/package.json +97 -1
- package/tags.json +1 -1
- package/uni-echarts/changelog.md +2 -0
- package/uni-echarts/components/index.js +1 -0
- package/uni-echarts/components/uni-echarts/events.js +95 -0
- package/uni-echarts/components/uni-echarts/types.d.ts +183 -0
- package/uni-echarts/components/uni-echarts/types.js +1 -0
- package/uni-echarts/components/uni-echarts/uni-echarts.vue +530 -0
- package/uni-echarts/components/uni-echarts/uni-echarts.vue.d.ts +19 -0
- package/uni-echarts/global.d.ts +7 -0
- package/uni-echarts/index.d.ts +440 -0
- package/uni-echarts/index.js +2 -0
- package/uni-echarts/package.json +105 -0
- package/uni-echarts/shared-core.d.ts +269 -0
- package/uni-echarts/shared-core.js +900 -0
- 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
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
@import '../common/abstracts/variable';
|
|
2
|
+
@import '../common/abstracts/mixin';
|
|
3
|
+
|
|
4
|
+
@include b(link) {
|
|
5
|
+
display: inline-block;
|
|
6
|
+
@include e(medium) {
|
|
7
|
+
font-size: $-link-font-size-medium;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@include e(small) {
|
|
11
|
+
font-size: $-link-font-size-small;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@include e(large) {
|
|
15
|
+
font-size: $-link-font-size-large;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@include e(icon) {
|
|
19
|
+
display: inline-block;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@include when(underline) {
|
|
23
|
+
text-decoration: underline;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@include when(default) {
|
|
27
|
+
color: $-link-info-color;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@include when(primary) {
|
|
31
|
+
color: $-link-primary-color;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@include when(error) {
|
|
35
|
+
color: $-link-error-color;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@include when(warning) {
|
|
39
|
+
color: $-link-warning-color;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@include when(success) {
|
|
43
|
+
color: $-link-success-color;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@include when(disabled) {
|
|
47
|
+
opacity: .6;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&__prefix-icon:not(:empty) + &__content:not(:empty) {
|
|
51
|
+
padding-left: 8rpx;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&__content:not(:empty) + &__suffix-icon:not(:empty) {
|
|
55
|
+
padding-left: 8rpx;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<navigator
|
|
3
|
+
:class="rootClass"
|
|
4
|
+
:style="rootStyle"
|
|
5
|
+
:url="!disabled ? navigatorProps?.['url'] || url : ''"
|
|
6
|
+
:target="navigatorProps?.['target']"
|
|
7
|
+
:open-type="navigatorProps?.['openType'] || openType"
|
|
8
|
+
:delta="navigatorProps?.['delta']"
|
|
9
|
+
:app-id="navigatorProps?.['appId']"
|
|
10
|
+
:path="navigatorProps?.['path']"
|
|
11
|
+
:extra-data="navigatorProps?.['extraData']"
|
|
12
|
+
:version="navigatorProps?.['version']"
|
|
13
|
+
:short-link="navigatorProps?.['shortLink']"
|
|
14
|
+
:hover-class="hover && !disabled ? 'oxy-link__hover' : ''"
|
|
15
|
+
:hover-stop-propagation="navigatorProps?.['hoverStopPropagation']"
|
|
16
|
+
:hover-start-time="navigatorProps?.['hoverStartTime']"
|
|
17
|
+
:hover-stay-time="navigatorProps?.['hoverStayTime']"
|
|
18
|
+
@click="handleClick"
|
|
19
|
+
>
|
|
20
|
+
<slot name="prefix-icon">
|
|
21
|
+
<view class="oxy-link__icon oxy-link__prefix-icon" v-if="prefixIcon">
|
|
22
|
+
<oxy-icon :size="fontSize" :color="color" :name="prefixIcon"></oxy-icon>
|
|
23
|
+
</view>
|
|
24
|
+
</slot>
|
|
25
|
+
<text class="oxy-link__content" ref="textRef">
|
|
26
|
+
<slot>{{ content }}</slot>
|
|
27
|
+
</text>
|
|
28
|
+
<slot name="suffix-icon">
|
|
29
|
+
<view class="oxy-link__icon oxy-link__suffix-icon" v-if="suffixIcon">
|
|
30
|
+
<oxy-icon :size="fontSize" :color="color" :name="suffixIcon"></oxy-icon>
|
|
31
|
+
</view>
|
|
32
|
+
</slot>
|
|
33
|
+
</navigator>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script lang="ts">
|
|
37
|
+
export default {
|
|
38
|
+
name: 'oxy-link',
|
|
39
|
+
options: {
|
|
40
|
+
virtualHost: true,
|
|
41
|
+
addGlobalClass: true,
|
|
42
|
+
styleIsolation: 'shared'
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<script lang="ts" setup>
|
|
48
|
+
import { computed, ref, watch } from 'vue'
|
|
49
|
+
import { objToStyle } from '../common/util'
|
|
50
|
+
import { linkProps } from './types'
|
|
51
|
+
|
|
52
|
+
// 获取组件的 props 和 emit 函数
|
|
53
|
+
const props = defineProps(linkProps)
|
|
54
|
+
const emit = defineEmits(['click', 'success', 'fail', 'complete'])
|
|
55
|
+
|
|
56
|
+
// 存储超链接类名的响应式变量
|
|
57
|
+
const linkClass = ref<string>('')
|
|
58
|
+
const fontSize = computed<string>(() => {
|
|
59
|
+
if (!['small', 'medium', 'large'].includes(props.size)) {
|
|
60
|
+
return props.size
|
|
61
|
+
}
|
|
62
|
+
return ''
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
// 监听 props 变化,合并 watch 逻辑
|
|
66
|
+
watch(
|
|
67
|
+
() => ({
|
|
68
|
+
size: props.size,
|
|
69
|
+
type: props.type,
|
|
70
|
+
disabled: props.disabled,
|
|
71
|
+
underline: props.underline
|
|
72
|
+
}),
|
|
73
|
+
({ type }) => {
|
|
74
|
+
// 验证 type 属性
|
|
75
|
+
const types = ['primary', 'danger', 'warning', 'success', 'default']
|
|
76
|
+
if (type && !types.includes(type)) {
|
|
77
|
+
console.error(`type must be one of ${types.toString()}`)
|
|
78
|
+
}
|
|
79
|
+
computeLinkClass()
|
|
80
|
+
},
|
|
81
|
+
{ deep: true, immediate: true }
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
// 计算根元素的类名
|
|
85
|
+
const rootClass = computed(() => {
|
|
86
|
+
return `oxy-link ${props.customClass} ${linkClass.value}`
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
// 计算根元素的样式
|
|
90
|
+
const rootStyle = computed(() => {
|
|
91
|
+
const rootStyle: Record<string, any> = {}
|
|
92
|
+
if (props.color) {
|
|
93
|
+
rootStyle['color'] = props.color
|
|
94
|
+
}
|
|
95
|
+
if (fontSize.value) {
|
|
96
|
+
rootStyle['font-size'] = fontSize.value
|
|
97
|
+
}
|
|
98
|
+
return `${objToStyle(rootStyle)}${props.customStyle}`
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
// 计算超链接类名的函数
|
|
102
|
+
function computeLinkClass() {
|
|
103
|
+
const { size, type, disabled, underline } = props
|
|
104
|
+
const linkClassList: string[] = []
|
|
105
|
+
size && linkClassList.push(`oxy-link__${size}`)
|
|
106
|
+
type && linkClassList.push(`is-${type}`)
|
|
107
|
+
disabled && linkClassList.push('is-disabled')
|
|
108
|
+
underline && linkClassList.push('is-underline')
|
|
109
|
+
linkClass.value = linkClassList.join(' ')
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function handleClick(event: Event) {
|
|
113
|
+
if (!props.url && props.href) {
|
|
114
|
+
// #ifdef APP-PLUS
|
|
115
|
+
plus.runtime.openURL(props.href)
|
|
116
|
+
// #endif
|
|
117
|
+
// #ifdef H5
|
|
118
|
+
window.open(props.href)
|
|
119
|
+
// #endif
|
|
120
|
+
// #ifdef MP
|
|
121
|
+
uni.setClipboardData({ data: props.href })
|
|
122
|
+
// #endif
|
|
123
|
+
}
|
|
124
|
+
emit('click', event)
|
|
125
|
+
}
|
|
126
|
+
</script>
|
|
127
|
+
|
|
128
|
+
<style lang="scss" scoped>
|
|
129
|
+
@import './index.scss';
|
|
130
|
+
</style>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue'
|
|
2
|
+
import { baseProps, makeBooleanProp, makeStringProp } from '../common/props'
|
|
3
|
+
|
|
4
|
+
export type OpenType = 'navigate' | 'redirect' | 'switchTab' | 'reLaunch' | 'navigateBack' | 'exit'
|
|
5
|
+
export type LinkType = 'default' | 'primary' | 'error' | 'warning' | 'success'
|
|
6
|
+
export type SizeEnum = 'small' | 'medium' | 'large'
|
|
7
|
+
|
|
8
|
+
export const linkProps = {
|
|
9
|
+
...baseProps,
|
|
10
|
+
/**
|
|
11
|
+
* 应用内跳转的链接
|
|
12
|
+
*/
|
|
13
|
+
url: makeStringProp(''),
|
|
14
|
+
/**
|
|
15
|
+
* 应用外跳转的链接
|
|
16
|
+
*/
|
|
17
|
+
href: makeStringProp(''),
|
|
18
|
+
/**
|
|
19
|
+
* 跳转方式
|
|
20
|
+
*/
|
|
21
|
+
openType: makeStringProp<OpenType>('navigate'),
|
|
22
|
+
/**
|
|
23
|
+
* 链接内容
|
|
24
|
+
* 类型:string
|
|
25
|
+
*/
|
|
26
|
+
content: makeStringProp(''),
|
|
27
|
+
/**
|
|
28
|
+
* 是否禁用
|
|
29
|
+
* 类型:boolean
|
|
30
|
+
* 默认值:false
|
|
31
|
+
*/
|
|
32
|
+
disabled: makeBooleanProp(false),
|
|
33
|
+
/**
|
|
34
|
+
* 是否开启点击反馈
|
|
35
|
+
* 类型:boolean
|
|
36
|
+
* 默认值:false
|
|
37
|
+
*/
|
|
38
|
+
hover: makeBooleanProp(false),
|
|
39
|
+
/**
|
|
40
|
+
* 是否显示链接下划线
|
|
41
|
+
* 类型:boolean
|
|
42
|
+
* 默认值:false
|
|
43
|
+
*/
|
|
44
|
+
underline: makeBooleanProp(false),
|
|
45
|
+
/**
|
|
46
|
+
* 主题类型
|
|
47
|
+
* 类型:string
|
|
48
|
+
* 可选值:'default' /'primary' / 'error' / 'warning' / 'success'
|
|
49
|
+
* 默认值:'default'
|
|
50
|
+
*/
|
|
51
|
+
type: makeStringProp<LinkType>('default'),
|
|
52
|
+
/**
|
|
53
|
+
* 字体大小
|
|
54
|
+
* 类型:string
|
|
55
|
+
* 默认值:'空字符串'
|
|
56
|
+
*/
|
|
57
|
+
size: makeStringProp<SizeEnum>('medium'),
|
|
58
|
+
/**
|
|
59
|
+
* 文本颜色
|
|
60
|
+
* 类型:string
|
|
61
|
+
* 默认值:''
|
|
62
|
+
*/
|
|
63
|
+
color: makeStringProp(''),
|
|
64
|
+
/**
|
|
65
|
+
* 前置图标
|
|
66
|
+
*/
|
|
67
|
+
prefixIcon: makeStringProp(''),
|
|
68
|
+
/**
|
|
69
|
+
* 后置图标
|
|
70
|
+
*/
|
|
71
|
+
suffixIcon: makeStringProp(''),
|
|
72
|
+
/**
|
|
73
|
+
* 与 navigator 原生组件属性保持一致,具体使用参考:[微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html)。使用时请将形如 `open-type` 风格的属性名改为 `openType` 风格
|
|
74
|
+
*/
|
|
75
|
+
navigatorProps: {
|
|
76
|
+
type: Object,
|
|
77
|
+
default: null
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type LinkProps = ExtractPropTypes<typeof linkProps>
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
@refresherrestore="onRestore"
|
|
29
29
|
@refresherabort="onAbort"
|
|
30
30
|
>
|
|
31
|
-
<view class="oxy-virtual-scroll__container" :style="{ height: totalHeight
|
|
32
|
-
<view class="oxy-virtual-scroll__items" :style="{ transform: `translateY(${virtualOffsetY}
|
|
31
|
+
<view class="oxy-virtual-scroll__container" :style="{ height: unitConvert(totalHeight, 0, { output: 'px' }) }">
|
|
32
|
+
<view class="oxy-virtual-scroll__items" :style="{ transform: `translateY(${unitConvert(virtualOffsetY, 0, { output: 'px' })})` }">
|
|
33
33
|
<view v-for="(item, index) in virtualData" :key="index">
|
|
34
34
|
<slot name="item" :item="item" :index="startIndex + index"></slot>
|
|
35
35
|
</view>
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
|
|
55
55
|
<!-- 回到顶部按钮 -->
|
|
56
56
|
<view v-if="showBackToTop && showBackTopBtn" class="oxy-virtual-scroll__back-top" @click="scrollToTop">
|
|
57
|
-
<oxy-icon name="backtop" color="#fff" size="
|
|
57
|
+
<oxy-icon name="backtop" color="#fff" size="40rpx"></oxy-icon>
|
|
58
58
|
</view>
|
|
59
59
|
</view>
|
|
60
60
|
</template>
|
|
@@ -80,6 +80,7 @@ import type {
|
|
|
80
80
|
ScrollViewOnScrollEvent
|
|
81
81
|
} from '@uni-helper/uni-app-types/index'
|
|
82
82
|
import { useVirtualScroll } from '../composables/useVirtualScroll'
|
|
83
|
+
import { unitConvert } from '../common/util'
|
|
83
84
|
|
|
84
85
|
const props = defineProps(listProps)
|
|
85
86
|
|
|
@@ -19,7 +19,7 @@ export default {
|
|
|
19
19
|
<script lang="ts" setup>
|
|
20
20
|
import { computed, onBeforeMount, ref, watch, type CSSProperties } from 'vue'
|
|
21
21
|
import base64 from '../common/base64'
|
|
22
|
-
import { gradient, context, objToStyle,
|
|
22
|
+
import { withDefaultUnit, gradient, context, objToStyle, isDef } from '../common/util'
|
|
23
23
|
import { loadingProps } from './types'
|
|
24
24
|
|
|
25
25
|
const svgDefineId = context.id++
|
|
@@ -44,7 +44,11 @@ const iconSize = ref<string | number | null>(null)
|
|
|
44
44
|
watch(
|
|
45
45
|
() => props.size,
|
|
46
46
|
(newVal) => {
|
|
47
|
-
|
|
47
|
+
if (!isDef(newVal) || newVal === '') {
|
|
48
|
+
iconSize.value = null
|
|
49
|
+
return
|
|
50
|
+
}
|
|
51
|
+
iconSize.value = withDefaultUnit(newVal)
|
|
48
52
|
},
|
|
49
53
|
{
|
|
50
54
|
deep: true,
|
|
@@ -66,8 +70,8 @@ watch(
|
|
|
66
70
|
const rootStyle = computed(() => {
|
|
67
71
|
const style: CSSProperties = {}
|
|
68
72
|
if (isDef(iconSize.value)) {
|
|
69
|
-
style.height =
|
|
70
|
-
style.width =
|
|
73
|
+
style.height = iconSize.value
|
|
74
|
+
style.width = iconSize.value
|
|
71
75
|
}
|
|
72
76
|
return `${objToStyle(style)} ${props.customStyle}`
|
|
73
77
|
})
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
@include edeep(loading) {
|
|
17
17
|
display: inline-block;
|
|
18
|
-
margin-right:
|
|
18
|
+
margin-right: 16rpx;
|
|
19
19
|
vertical-align: middle;
|
|
20
20
|
width: $-loadmore-loading-size;
|
|
21
21
|
height: $-loadmore-loading-size;
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
vertical-align: middle;
|
|
27
27
|
|
|
28
28
|
@include when(light) {
|
|
29
|
-
margin: 0
|
|
29
|
+
margin: 0 12rpx;
|
|
30
30
|
color: $-loadmore-error-color;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -36,4 +36,4 @@
|
|
|
36
36
|
vertical-align: middle;
|
|
37
37
|
font-size: $-loadmore-refresh-fs;
|
|
38
38
|
}
|
|
39
|
-
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
@import './../common/abstracts/_mixin.scss';
|
|
2
|
+
@import './../common/abstracts/variable.scss';
|
|
3
|
+
|
|
4
|
+
@include b(long-press-menu) {
|
|
5
|
+
position: relative;
|
|
6
|
+
display: inline-block; /* 让容器适应内容宽度 */
|
|
7
|
+
user-select: none;
|
|
8
|
+
-webkit-user-select: none;
|
|
9
|
+
|
|
10
|
+
@include e(trigger) {
|
|
11
|
+
position: relative;
|
|
12
|
+
transition: background-color 0.2s;
|
|
13
|
+
border-radius: $-long-press-menu-radius;
|
|
14
|
+
/* 默认为 inline-block,减少空白占据 */
|
|
15
|
+
display: inline-block;
|
|
16
|
+
width: 100%;
|
|
17
|
+
|
|
18
|
+
@include when(active) {
|
|
19
|
+
background-color: rgba(0, 0, 0, 0.05); /* 长按时的高亮背景 */
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@include e(mask) {
|
|
24
|
+
position: fixed;
|
|
25
|
+
top: 0;
|
|
26
|
+
left: 0;
|
|
27
|
+
right: 0;
|
|
28
|
+
bottom: 0;
|
|
29
|
+
z-index: 998;
|
|
30
|
+
background-color: transparent; /* 透明遮罩,点击关闭 */
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@include e(popover) {
|
|
34
|
+
position: fixed;
|
|
35
|
+
z-index: $-long-press-menu-z-index;
|
|
36
|
+
background-color: $-long-press-menu-bg;
|
|
37
|
+
border-radius: $-long-press-menu-radius;
|
|
38
|
+
padding: $-long-press-menu-padding;
|
|
39
|
+
min-width: 200rpx;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@include e(content) {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
flex-wrap: nowrap;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@include e(item) {
|
|
49
|
+
padding: $-long-press-menu-item-padding;
|
|
50
|
+
position: relative;
|
|
51
|
+
&:not(:last-child)::after {
|
|
52
|
+
content: '';
|
|
53
|
+
position: absolute;
|
|
54
|
+
right: 0;
|
|
55
|
+
top: 24rpx;
|
|
56
|
+
bottom: 24rpx;
|
|
57
|
+
width: 1px;
|
|
58
|
+
background-color: rgba(255, 255, 255, 0.2);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@include e(text) {
|
|
63
|
+
color: $-long-press-menu-color;
|
|
64
|
+
font-size: $-long-press-menu-fs;
|
|
65
|
+
white-space: nowrap;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@include e(arrow) {
|
|
69
|
+
left: 24rpx;
|
|
70
|
+
}
|
|
71
|
+
@include triangleArrow($-long-press-menu-arrow-size, $-long-press-menu-bg);
|
|
72
|
+
|
|
73
|
+
@include when(selectable) {
|
|
74
|
+
/* 移除 user-select,改为控制 trigger */
|
|
75
|
+
.oxy-long-press-menu__trigger {
|
|
76
|
+
user-select: text;
|
|
77
|
+
-webkit-user-select: text;
|
|
78
|
+
-webkit-touch-callout: none; /* 禁用系统默认长按菜单 */
|
|
79
|
+
cursor: text;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@keyframes fadeIn {
|
|
85
|
+
from {
|
|
86
|
+
opacity: 0;
|
|
87
|
+
transform: translateX(-50%) scale(0.9);
|
|
88
|
+
}
|
|
89
|
+
to {
|
|
90
|
+
opacity: 1;
|
|
91
|
+
transform: translateX(-50%) scale(1);
|
|
92
|
+
}
|
|
93
|
+
}
|