oxy-uni-ui 2.1.2 → 2.1.3
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/AbortablePromise.ts +4 -0
- package/components/common/abstracts/variable.scss +172 -66
- package/components/common/base64.ts +6 -0
- package/components/common/clickoutside.ts +5 -0
- package/components/common/interceptor.ts +9 -0
- package/components/common/path.ts +4 -0
- package/components/common/props.ts +23 -0
- package/components/common/util.ts +18 -1
- package/components/composables/index.ts +2 -0
- package/components/composables/useCell.ts +8 -1
- package/components/composables/useChildren.ts +27 -1
- package/components/composables/useCountDown.ts +10 -1
- package/components/composables/useDynamicVirtualScroll.ts +9 -0
- package/components/composables/useGlobalLoading.ts +6 -0
- package/components/composables/useGlobalMessage.ts +6 -0
- package/components/composables/useGlobalToast.ts +6 -0
- package/components/composables/useLockScroll.ts +9 -0
- package/components/composables/useParent.ts +65 -14
- package/components/composables/usePopover.ts +9 -0
- package/components/composables/useQueue.ts +8 -0
- package/components/composables/useRaf.ts +10 -0
- package/components/composables/useSharedState.ts +284 -0
- package/components/composables/useTouch.ts +8 -0
- package/components/composables/useTranslate.ts +9 -0
- package/components/composables/useUpload.ts +83 -11
- package/components/composables/useVirtualScroll.ts +7 -0
- package/components/composables/useWindowResize.ts +9 -0
- package/components/oxy-action-sheet/index.scss +5 -5
- package/components/oxy-action-sheet/oxy-action-sheet.vue +11 -0
- package/components/oxy-backtop/index.scss +2 -2
- package/components/oxy-backtop/oxy-backtop.vue +2 -0
- package/components/oxy-badge/oxy-badge.vue +2 -0
- package/components/oxy-badge/types.ts +3 -0
- package/components/oxy-button/index.scss +13 -13
- package/components/oxy-button/oxy-button.vue +11 -0
- package/components/oxy-button/types.ts +3 -3
- package/components/oxy-calendar/index.scss +17 -17
- package/components/oxy-calendar/oxy-calendar.vue +31 -0
- package/components/oxy-calendar/types.ts +3 -0
- package/components/oxy-calendar-view/month/month.vue +2 -0
- package/components/oxy-calendar-view/monthPanel/month-panel.vue +3 -1
- package/components/oxy-calendar-view/monthPanel/types.ts +10 -7
- package/components/oxy-calendar-view/oxy-calendar-view.vue +2 -0
- package/components/oxy-calendar-view/types.ts +3 -1
- package/components/oxy-calendar-view/year/types.ts +33 -1
- package/components/oxy-calendar-view/year/year.vue +2 -0
- package/components/oxy-calendar-view/yearPanel/year-panel.vue +2 -0
- package/components/oxy-card/index.scss +1 -1
- package/components/oxy-card/oxy-card.vue +2 -0
- package/components/oxy-cell/index.scss +3 -1
- package/components/oxy-cell/oxy-cell.vue +6 -4
- package/components/oxy-cell-group/oxy-cell-group.vue +2 -0
- package/components/oxy-checkbox/index.scss +7 -7
- package/components/oxy-checkbox/oxy-checkbox.vue +22 -16
- package/components/oxy-checkbox/types.ts +9 -0
- package/components/oxy-checkbox-group/index.scss +1 -1
- package/components/oxy-checkbox-group/oxy-checkbox-group.vue +2 -0
- package/components/oxy-circle/oxy-circle.vue +2 -0
- package/components/oxy-col/oxy-col.vue +3 -1
- package/components/oxy-col-picker/index.scss +3 -3
- package/components/oxy-col-picker/oxy-col-picker.vue +17 -1
- package/components/oxy-col-picker/types.ts +3 -0
- package/components/oxy-collapse/index.scss +2 -2
- package/components/oxy-collapse/oxy-collapse.vue +9 -0
- package/components/oxy-collapse-item/oxy-collapse-item.vue +4 -2
- package/components/oxy-config-provider/oxy-config-provider.vue +18 -0
- package/components/oxy-config-provider/types.ts +18 -0
- package/components/oxy-corner/index.scss +50 -32
- package/components/oxy-corner/oxy-corner.vue +2 -0
- package/components/oxy-count-down/oxy-count-down.vue +2 -0
- package/components/oxy-count-to/oxy-count-to.vue +12 -1
- package/components/oxy-count-to/types.ts +14 -4
- package/components/oxy-curtain/index.scss +10 -9
- package/components/oxy-curtain/oxy-curtain.vue +2 -0
- package/components/oxy-date-strip/oxy-date-strip.vue +22 -1
- package/components/oxy-date-strip-item/index.scss +4 -4
- package/components/oxy-date-strip-item/oxy-date-strip-item.vue +2 -0
- package/components/oxy-datetime-picker/index.scss +3 -3
- package/components/oxy-datetime-picker/oxy-datetime-picker.vue +11 -1
- package/components/oxy-datetime-picker-view/oxy-datetime-picker-view.vue +2 -0
- package/components/oxy-divider/oxy-divider.vue +2 -0
- package/components/oxy-drop-menu/index.scss +2 -2
- package/components/oxy-drop-menu/oxy-drop-menu.vue +3 -0
- package/components/oxy-drop-menu-item/index.scss +1 -1
- package/components/oxy-drop-menu-item/oxy-drop-menu-item.vue +17 -9
- package/components/oxy-echarts/oxy-echarts.vue +2 -0
- package/components/oxy-fab/index.scss +1 -1
- package/components/oxy-fab/oxy-fab.vue +27 -0
- package/components/oxy-file-list/index.scss +9 -9
- package/components/oxy-file-list/oxy-file-list.vue +29 -17
- package/components/oxy-floating-panel/oxy-floating-panel.vue +34 -10
- package/components/oxy-footer/index.scss +7 -0
- package/components/oxy-footer/oxy-footer.vue +4 -2
- package/components/oxy-footer/types.ts +9 -6
- package/components/oxy-form/oxy-form.vue +13 -1
- package/components/oxy-form-item/oxy-form-item.vue +5 -3
- package/components/oxy-gap/oxy-gap.vue +2 -0
- package/components/oxy-global-loading/oxy-global-loading.vue +18 -5
- package/components/oxy-global-message/oxy-global-message.vue +30 -17
- package/components/oxy-global-toast/oxy-global-toast.vue +18 -5
- package/components/oxy-grid/oxy-grid.vue +6 -0
- package/components/oxy-grid-item/index.scss +1 -1
- package/components/oxy-grid-item/oxy-grid-item.vue +22 -20
- package/components/oxy-guidance/index.scss +9 -9
- package/components/oxy-guidance/oxy-guidance.vue +22 -16
- package/components/oxy-icon/oxy-icon.vue +2 -0
- package/components/oxy-icon/types.ts +3 -0
- package/components/oxy-image-preview/index.scss +75 -0
- package/components/oxy-image-preview/index.ts +56 -0
- package/components/oxy-image-preview/oxy-image-preview.vue +221 -0
- package/components/oxy-image-preview/types.ts +164 -0
- package/components/oxy-img/oxy-img.vue +2 -0
- package/components/oxy-img-cropper/index.scss +2 -2
- package/components/oxy-img-cropper/oxy-img-cropper.vue +6 -0
- package/components/oxy-img-lazy/oxy-img-lazy.vue +9 -0
- package/components/oxy-index-anchor/index.scss +1 -1
- package/components/oxy-index-anchor/oxy-index-anchor.vue +2 -2
- package/components/oxy-index-bar/index.scss +1 -1
- package/components/oxy-index-bar/oxy-index-bar.vue +18 -0
- package/components/oxy-input/index.scss +2 -1
- package/components/oxy-input/oxy-input.vue +18 -4
- package/components/oxy-input/types.ts +6 -0
- package/components/oxy-input-number/index.scss +3 -1
- package/components/oxy-input-number/oxy-input-number.vue +2 -0
- package/components/oxy-keyboard/index.scss +3 -3
- package/components/oxy-keyboard/key/index.vue +2 -0
- package/components/oxy-keyboard/oxy-keyboard.vue +11 -2
- package/components/oxy-link/index.scss +8 -4
- package/components/oxy-link/oxy-link.vue +9 -3
- package/components/oxy-link/types.ts +2 -2
- package/components/oxy-list/oxy-list.vue +2 -0
- package/components/oxy-list/types.ts +7 -0
- package/components/oxy-loading/oxy-loading.vue +6 -0
- package/components/oxy-loadmore/index.scss +1 -1
- package/components/oxy-loadmore/oxy-loadmore.vue +2 -0
- package/components/oxy-long-press-menu/index.scss +1 -1
- package/components/oxy-long-press-menu/oxy-long-press-menu.vue +42 -13
- package/components/oxy-message-box/index.scss +223 -36
- package/components/oxy-message-box/index.ts +49 -23
- package/components/oxy-message-box/oxy-message-box.vue +181 -56
- package/components/oxy-message-box/types.ts +60 -2
- package/components/oxy-navbar/index.scss +1 -1
- package/components/oxy-navbar/oxy-navbar.vue +9 -6
- package/components/oxy-navbar-capsule/oxy-navbar-capsule.vue +2 -0
- package/components/oxy-notice-bar/index.scss +1 -1
- package/components/oxy-notice-bar/oxy-notice-bar.vue +29 -0
- package/components/oxy-notify/index.ts +16 -12
- package/components/oxy-notify/oxy-notify.vue +11 -4
- package/components/oxy-overlay/oxy-overlay.vue +34 -2
- package/components/oxy-pagination/oxy-pagination.vue +2 -0
- package/components/oxy-password-input/oxy-password-input.vue +2 -0
- package/components/oxy-picker/index.scss +7 -7
- package/components/oxy-picker/oxy-picker.vue +11 -0
- package/components/oxy-picker-view/index.scss +1 -1
- package/components/oxy-picker-view/oxy-picker-view.vue +2 -0
- package/components/oxy-popover/index.scss +2 -2
- package/components/oxy-popover/oxy-popover.vue +4 -1
- package/components/oxy-popup/oxy-popup.vue +8 -0
- package/components/oxy-progress/index.scss +2 -2
- package/components/oxy-progress/oxy-progress.vue +7 -0
- package/components/oxy-qrcode/draw.ts +15 -1
- package/components/oxy-qrcode/oxy-qrcode.vue +10 -3
- package/components/oxy-radio/index.scss +8 -8
- package/components/oxy-radio/oxy-radio.vue +13 -11
- package/components/oxy-radio-group/index.scss +1 -1
- package/components/oxy-radio-group/oxy-radio-group.vue +2 -0
- package/components/oxy-rate/oxy-rate.vue +5 -0
- package/components/oxy-rate/types.ts +2 -2
- package/components/oxy-resize/oxy-resize.vue +12 -0
- package/components/oxy-rich-text/index.scss +9 -9
- package/components/oxy-rich-text/oxy-rich-text.vue +6 -0
- package/components/oxy-rich-text/types.ts +15 -0
- package/components/oxy-root-portal/oxy-root-portal.vue +23 -15
- package/components/oxy-row/oxy-row.vue +2 -0
- package/components/oxy-search/index.scss +3 -3
- package/components/oxy-search/oxy-search.vue +19 -0
- package/components/oxy-segmented/index.scss +4 -4
- package/components/oxy-segmented/oxy-segmented.vue +2 -0
- package/components/oxy-select/index.scss +25 -25
- package/components/oxy-select/oxy-select.vue +27 -0
- package/components/oxy-select/types.ts +3 -0
- package/components/oxy-select-picker/index.scss +5 -5
- package/components/oxy-select-picker/oxy-select-picker.vue +7 -0
- package/components/oxy-sidebar/oxy-sidebar.vue +2 -0
- package/components/oxy-sidebar-item/index.scss +3 -3
- package/components/oxy-sidebar-item/oxy-sidebar-item.vue +17 -31
- package/components/oxy-signature/oxy-signature.vue +17 -0
- package/components/oxy-skeleton/oxy-skeleton.vue +7 -1
- package/components/oxy-slide-verify/index.scss +95 -0
- package/components/oxy-slide-verify/oxy-slide-verify.vue +244 -0
- package/components/oxy-slide-verify/types.ts +98 -0
- package/components/oxy-slider/oxy-slider.vue +3 -0
- package/components/oxy-sort-button/index.scss +10 -8
- package/components/oxy-sort-button/oxy-sort-button.vue +6 -0
- package/components/oxy-splitter/index.scss +9 -0
- package/components/oxy-splitter/oxy-splitter.vue +23 -2
- package/components/oxy-splitter-panel/index.scss +7 -5
- package/components/oxy-splitter-panel/oxy-splitter-panel.vue +93 -89
- package/components/oxy-status-tip/index.scss +3 -3
- package/components/oxy-status-tip/oxy-status-tip.vue +2 -0
- package/components/oxy-step/index.scss +4 -4
- package/components/oxy-step/oxy-step.vue +15 -13
- package/components/oxy-steps/oxy-steps.vue +2 -0
- package/components/oxy-sticky/oxy-sticky.vue +5 -3
- package/components/oxy-stream-render/oxy-stream-render.vue +29 -0
- package/components/oxy-swipe-action/oxy-swipe-action.vue +8 -0
- package/components/oxy-swiper/oxy-swiper.vue +6 -0
- package/components/oxy-swiper-nav/index.scss +4 -4
- package/components/oxy-switch/index.scss +6 -3
- package/components/oxy-switch/oxy-switch.vue +10 -0
- package/components/oxy-tab/index.scss +1 -7
- package/components/oxy-tab/oxy-tab.vue +12 -10
- package/components/oxy-tabbar/oxy-tabbar.vue +5 -0
- package/components/oxy-tabbar-item/oxy-tabbar-item.vue +11 -9
- package/components/oxy-table/index.scss +1 -1
- package/components/oxy-table/oxy-table.vue +8 -0
- package/components/oxy-table/types.ts +3 -0
- package/components/oxy-table-col/oxy-table-col.vue +21 -19
- package/components/oxy-tabs/index.scss +11 -11
- package/components/oxy-tabs/oxy-tabs.vue +17 -0
- package/components/oxy-tag/index.scss +24 -5
- package/components/oxy-tag/oxy-tag.vue +17 -2
- package/components/oxy-tag/types.ts +7 -0
- package/components/oxy-text/oxy-text.vue +12 -1
- package/components/oxy-textarea/index.scss +3 -2
- package/components/oxy-textarea/oxy-textarea.vue +10 -4
- package/components/oxy-toast/index.ts +21 -20
- package/components/oxy-toast/oxy-toast.vue +30 -5
- package/components/oxy-toast/types.ts +20 -9
- package/components/oxy-tooltip/index.scss +1 -1
- package/components/oxy-tooltip/oxy-tooltip.vue +2 -0
- package/components/oxy-transition/index.scss +3 -1
- package/components/oxy-transition/oxy-transition.vue +14 -0
- package/components/oxy-tree/index.scss +3 -3
- package/components/oxy-tree/oxy-tree.vue +28 -5
- package/components/oxy-tree/types.ts +57 -1
- package/components/oxy-upload/index.scss +9 -9
- package/components/oxy-upload/oxy-upload.vue +5 -3
- package/components/oxy-verification-code/oxy-verification-code.vue +24 -0
- package/components/oxy-video-preview/index.scss +12 -7
- package/components/oxy-video-preview/index.ts +64 -0
- package/components/oxy-video-preview/oxy-video-preview.vue +102 -31
- package/components/oxy-video-preview/types.ts +54 -8
- package/components/oxy-virtual-scroll/index.scss +1 -1
- package/components/oxy-virtual-scroll/oxy-virtual-scroll.vue +2 -0
- package/components/oxy-voice-player/index.scss +64 -64
- package/components/oxy-voice-player/oxy-voice-player.vue +38 -10
- package/components/oxy-waterfall/oxy-waterfall.vue +13 -0
- package/components/oxy-waterfall/types.ts +7 -0
- package/components/oxy-waterfall-item/oxy-waterfall-item.vue +9 -0
- package/components/oxy-watermark/oxy-watermark.vue +2 -0
- package/global.d.ts +2 -0
- package/index.ts +2 -0
- package/locale/lang/en-US.ts +51 -2
- package/locale/lang/zh-CN.ts +51 -2
- package/package.json +2 -2
- package/styles/all.scss +125 -0
- package/tags.json +1 -1
- package/vite-plugins/vite-plugin-host-class.ts +166 -0
- package/web-types.json +1 -1
|
@@ -20,7 +20,9 @@
|
|
|
20
20
|
export default {
|
|
21
21
|
name: 'oxy-notify',
|
|
22
22
|
options: {
|
|
23
|
+
// #ifndef MP-TOUTIAO
|
|
23
24
|
virtualHost: true,
|
|
25
|
+
// #endif
|
|
24
26
|
addGlobalClass: true,
|
|
25
27
|
styleIsolation: 'shared'
|
|
26
28
|
}
|
|
@@ -29,9 +31,9 @@ export default {
|
|
|
29
31
|
|
|
30
32
|
<script lang="ts" setup>
|
|
31
33
|
import OxyPopup from '../oxy-popup/oxy-popup.vue'
|
|
32
|
-
import {
|
|
33
|
-
import { notifyProps
|
|
34
|
-
import {
|
|
34
|
+
import { computed, onUnmounted, watch } from 'vue'
|
|
35
|
+
import { notifyProps } from './types'
|
|
36
|
+
import { initNotifyOptions, removeNotifyOptions, resolveNotifyScopeId } from '.'
|
|
35
37
|
import { isFunction, unitConvert } from '../common/util'
|
|
36
38
|
|
|
37
39
|
const props = defineProps(notifyProps)
|
|
@@ -41,7 +43,12 @@ const emits = defineEmits<{
|
|
|
41
43
|
(e: 'closed'): void
|
|
42
44
|
(e: 'opened'): void
|
|
43
45
|
}>()
|
|
44
|
-
const
|
|
46
|
+
const scopeId = resolveNotifyScopeId()
|
|
47
|
+
const state = initNotifyOptions(props.selector, scopeId)
|
|
48
|
+
|
|
49
|
+
onUnmounted(() => {
|
|
50
|
+
removeNotifyOptions(props.selector, scopeId)
|
|
51
|
+
})
|
|
45
52
|
|
|
46
53
|
const customStyle = computed(() => {
|
|
47
54
|
const { safeHeight, position } = state.value
|
|
@@ -2,11 +2,17 @@
|
|
|
2
2
|
<oxy-transition
|
|
3
3
|
:show="show"
|
|
4
4
|
name="fade"
|
|
5
|
-
custom-class="oxy-overlay"
|
|
5
|
+
:custom-class="`oxy-overlay ${customClass}`"
|
|
6
6
|
:duration="duration"
|
|
7
7
|
:custom-style="`z-index: ${zIndex}; ${customStyle}`"
|
|
8
8
|
:disable-touch-move="lockScroll"
|
|
9
9
|
@click="handleClick"
|
|
10
|
+
@before-enter="handleBeforeEnter"
|
|
11
|
+
@enter="handleEnter"
|
|
12
|
+
@after-enter="handleAfterEnter"
|
|
13
|
+
@before-leave="handleBeforeLeave"
|
|
14
|
+
@leave="handleLeave"
|
|
15
|
+
@after-leave="handleAfterLeave"
|
|
10
16
|
>
|
|
11
17
|
<slot></slot>
|
|
12
18
|
</oxy-transition>
|
|
@@ -15,7 +21,9 @@
|
|
|
15
21
|
export default {
|
|
16
22
|
name: 'oxy-overlay',
|
|
17
23
|
options: {
|
|
24
|
+
// #ifndef MP-TOUTIAO
|
|
18
25
|
virtualHost: true,
|
|
26
|
+
// #endif
|
|
19
27
|
addGlobalClass: true,
|
|
20
28
|
styleIsolation: 'shared'
|
|
21
29
|
}
|
|
@@ -31,12 +39,36 @@ import { useLockScroll } from '../composables/useLockScroll'
|
|
|
31
39
|
|
|
32
40
|
const props = defineProps(overlayProps)
|
|
33
41
|
|
|
34
|
-
const emit = defineEmits(['click'])
|
|
42
|
+
const emit = defineEmits(['click', 'before-enter', 'enter', 'after-enter', 'before-leave', 'leave', 'after-leave'])
|
|
35
43
|
|
|
36
44
|
function handleClick() {
|
|
37
45
|
emit('click')
|
|
38
46
|
}
|
|
39
47
|
|
|
48
|
+
function handleBeforeEnter() {
|
|
49
|
+
emit('before-enter')
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function handleEnter() {
|
|
53
|
+
emit('enter')
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function handleAfterEnter() {
|
|
57
|
+
emit('after-enter')
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function handleBeforeLeave() {
|
|
61
|
+
emit('before-leave')
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function handleLeave() {
|
|
65
|
+
emit('leave')
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function handleAfterLeave() {
|
|
69
|
+
emit('after-leave')
|
|
70
|
+
}
|
|
71
|
+
|
|
40
72
|
// #ifdef H5
|
|
41
73
|
useLockScroll(() => props.show && props.lockScroll)
|
|
42
74
|
// #endif
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
|
|
61
61
|
@include edeep(arrow, clear) {
|
|
62
62
|
display: block;
|
|
63
63
|
font-size: $-cell-icon-size;
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
font-size: $-picker-toolbar-fs;
|
|
92
92
|
color: $-picker-toolbar-finish-color;
|
|
93
93
|
background: transparent;
|
|
94
|
-
padding:
|
|
94
|
+
padding: $-spacing-48 $-spacing-32 $-spacing-32 $-spacing-32;
|
|
95
95
|
|
|
96
96
|
@include m(cancel) {
|
|
97
97
|
color: $-picker-toolbar-cancel-color;
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
color: $-picker-loading-button-color;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
|
|
104
|
+
|
|
105
105
|
@include e(title) {
|
|
106
106
|
display: block;
|
|
107
107
|
float: 1;
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
@include e(search) {
|
|
112
|
-
padding: 0
|
|
112
|
+
padding: 0 $-spacing-32 $-spacing-24 $-spacing-32;
|
|
113
113
|
background: $-picker-search-bg;
|
|
114
114
|
}
|
|
115
115
|
|
|
@@ -117,14 +117,14 @@
|
|
|
117
117
|
display: flex;
|
|
118
118
|
align-items: center;
|
|
119
119
|
height: 80rpx;
|
|
120
|
-
padding: 0
|
|
120
|
+
padding: 0 $-spacing-24;
|
|
121
121
|
background: $-picker-column-select-bg;
|
|
122
122
|
border-radius: $-picker-search-radius;
|
|
123
123
|
|
|
124
124
|
input {
|
|
125
125
|
flex: 1;
|
|
126
126
|
height: 100%;
|
|
127
|
-
margin-left:
|
|
127
|
+
margin-left: $-spacing-20;
|
|
128
128
|
font-size: $-fs-content;
|
|
129
129
|
background: transparent;
|
|
130
130
|
border: none;
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
justify-content: center;
|
|
144
144
|
width: 32rpx;
|
|
145
145
|
height: 32rpx;
|
|
146
|
-
margin-left:
|
|
146
|
+
margin-left: $-spacing-12;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
@include e(search-clear-icon) {
|
|
@@ -94,7 +94,9 @@
|
|
|
94
94
|
export default {
|
|
95
95
|
name: 'oxy-picker',
|
|
96
96
|
options: {
|
|
97
|
+
// #ifndef MP-TOUTIAO
|
|
97
98
|
virtualHost: true,
|
|
99
|
+
// #endif
|
|
98
100
|
addGlobalClass: true,
|
|
99
101
|
styleIsolation: 'shared'
|
|
100
102
|
}
|
|
@@ -357,6 +359,9 @@ function onConfirm() {
|
|
|
357
359
|
handleConfirm()
|
|
358
360
|
}
|
|
359
361
|
}
|
|
362
|
+
/**
|
|
363
|
+
* 确认选择。检查搜索结果是否为空,非空时关闭弹窗并 emit confirm 事件。
|
|
364
|
+
*/
|
|
360
365
|
function handleConfirm() {
|
|
361
366
|
if (isLoading.value || props.disabled) {
|
|
362
367
|
popupShow.value = false
|
|
@@ -414,6 +419,9 @@ function noop() {}
|
|
|
414
419
|
function onPickStart() {
|
|
415
420
|
isPicking.value = true
|
|
416
421
|
}
|
|
422
|
+
/**
|
|
423
|
+
* 滑动结束回调。若在滑动过程中用户点击了确认,则自动触发确认。
|
|
424
|
+
*/
|
|
417
425
|
function onPickEnd() {
|
|
418
426
|
isPicking.value = false
|
|
419
427
|
|
|
@@ -450,6 +458,9 @@ function clearSearch() {
|
|
|
450
458
|
debouncedFilterColumns()
|
|
451
459
|
}
|
|
452
460
|
|
|
461
|
+
/**
|
|
462
|
+
* 搜索过滤列数据。支持自定义 filterMethod 或默认按 searchKey/labelKey 过滤。
|
|
463
|
+
*/
|
|
453
464
|
function filterColumns() {
|
|
454
465
|
const keyword = searchKeyword.value.trim().toLowerCase()
|
|
455
466
|
emit('search', { keyword } as PickerSearchEvent)
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
@include edeep(icon) {
|
|
36
36
|
vertical-align: middle;
|
|
37
37
|
font-size: $-popover-trigger-icon-size;
|
|
38
|
-
margin-right:
|
|
38
|
+
margin-right: $-spacing-12;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
@include e(menu-inner) {
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
right: -16rpx;
|
|
110
110
|
top: -20rpx;
|
|
111
111
|
transform: scale(0.5);
|
|
112
|
-
padding:
|
|
112
|
+
padding: $-spacing-20;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
@include squareArrow($-popover-arrow-size, $-popover-bg, $-popover-z-index - 1, $-popover-arrow-box-shadow);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view :class="`oxy-popover ${customClass}`" :style="customStyle" id="popover" @click.stop="popover.noop">
|
|
3
|
-
<!-- 使用插槽时无法获取正确宽高 -->
|
|
4
3
|
<view class="oxy-popover__pos oxy-popover__hidden" id="pos">
|
|
5
4
|
<view :class="`oxy-popover__container ${customPop}`">
|
|
6
5
|
<view v-if="!useContentSlot && mode === 'normal'" class="oxy-popover__inner">
|
|
@@ -12,6 +11,8 @@
|
|
|
12
11
|
<text>{{ item.content }}</text>
|
|
13
12
|
</view>
|
|
14
13
|
</view>
|
|
14
|
+
<!-- 自定义插槽内容副本,用于获取正确宽高 -->
|
|
15
|
+
<slot name="content" v-if="useContentSlot" />
|
|
15
16
|
</view>
|
|
16
17
|
</view>
|
|
17
18
|
<oxy-transition custom-class="oxy-popover__pos" :custom-style="popover.popStyle.value" :show="showPopover" name="fade" :duration="200">
|
|
@@ -53,7 +54,9 @@
|
|
|
53
54
|
export default {
|
|
54
55
|
name: 'oxy-popover',
|
|
55
56
|
options: {
|
|
57
|
+
// #ifndef MP-TOUTIAO
|
|
56
58
|
virtualHost: true,
|
|
59
|
+
// #endif
|
|
57
60
|
addGlobalClass: true,
|
|
58
61
|
styleIsolation: 'shared'
|
|
59
62
|
}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
:show="modelValue"
|
|
20
20
|
:name="transitionName"
|
|
21
21
|
:destroy="hideWhenClose"
|
|
22
|
+
:disable-touch-move="lockScroll"
|
|
22
23
|
@before-enter="emit('before-enter')"
|
|
23
24
|
@enter="emit('enter')"
|
|
24
25
|
@after-enter="emit('after-enter')"
|
|
@@ -52,6 +53,7 @@
|
|
|
52
53
|
:show="modelValue"
|
|
53
54
|
:name="transitionName"
|
|
54
55
|
:destroy="hideWhenClose"
|
|
56
|
+
:disable-touch-move="lockScroll"
|
|
55
57
|
@before-enter="emit('before-enter')"
|
|
56
58
|
@enter="emit('enter')"
|
|
57
59
|
@after-enter="emit('after-enter')"
|
|
@@ -69,7 +71,9 @@
|
|
|
69
71
|
export default {
|
|
70
72
|
name: 'oxy-popup',
|
|
71
73
|
options: {
|
|
74
|
+
// #ifndef MP-TOUTIAO
|
|
72
75
|
virtualHost: true,
|
|
76
|
+
// #endif
|
|
73
77
|
addGlobalClass: true,
|
|
74
78
|
styleIsolation: 'shared'
|
|
75
79
|
}
|
|
@@ -166,6 +170,10 @@ const rootClass = computed(() => {
|
|
|
166
170
|
return `oxy-popup oxy-popup--${props.position} ${!props.transition && props.position === 'center' ? 'is-deep' : ''} ${props.customClass || ''}`
|
|
167
171
|
})
|
|
168
172
|
|
|
173
|
+
/**
|
|
174
|
+
* 初始化安全区域底部距离。
|
|
175
|
+
* 微信小程序使用 screenHeight - safeArea.bottom 计算,其他端使用 safeAreaInsets.bottom。
|
|
176
|
+
*/
|
|
169
177
|
onBeforeMount(() => {
|
|
170
178
|
if (props.safeAreaInsetBottom) {
|
|
171
179
|
const { safeArea, screenHeight, safeAreaInsets } = uni.getSystemInfoSync()
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
export default {
|
|
18
18
|
name: 'oxy-progress',
|
|
19
19
|
options: {
|
|
20
|
+
// #ifndef MP-TOUTIAO
|
|
20
21
|
virtualHost: true,
|
|
22
|
+
// #endif
|
|
21
23
|
addGlobalClass: true,
|
|
22
24
|
styleIsolation: 'shared'
|
|
23
25
|
}
|
|
@@ -176,6 +178,11 @@ function createPartList(colorArray: string[] | ProgressColor[]) {
|
|
|
176
178
|
}))
|
|
177
179
|
}
|
|
178
180
|
|
|
181
|
+
/**
|
|
182
|
+
* 分步更新进度到目标百分比。使用 setTimeout 链式调用,依次完成每一段颜色的进度变化。
|
|
183
|
+
* @param targetPercent - 目标百分比
|
|
184
|
+
* @param color - 对应颜色
|
|
185
|
+
*/
|
|
179
186
|
function update(targetPercent: number, color: string) {
|
|
180
187
|
if (timer) return
|
|
181
188
|
const { duration } = props
|
|
@@ -380,7 +380,21 @@ export function canvasToPng(canvas: HTMLCanvasElement): Promise<string> {
|
|
|
380
380
|
// #ifdef MP
|
|
381
381
|
const data = canvas.toDataURL('image/png', 1)
|
|
382
382
|
const fileMg = uni.getFileSystemManager()
|
|
383
|
-
const
|
|
383
|
+
const envInfo = (uni as any).getEnvInfoSync?.() ?? {}
|
|
384
|
+
const runtimeGlobal = globalThis as any
|
|
385
|
+
const userDataPath =
|
|
386
|
+
envInfo.USER_DATA_PATH ||
|
|
387
|
+
runtimeGlobal?.wx?.env?.USER_DATA_PATH ||
|
|
388
|
+
runtimeGlobal?.tt?.env?.USER_DATA_PATH ||
|
|
389
|
+
runtimeGlobal?.my?.env?.USER_DATA_PATH ||
|
|
390
|
+
runtimeGlobal?.qq?.env?.USER_DATA_PATH ||
|
|
391
|
+
runtimeGlobal?.swan?.env?.USER_DATA_PATH ||
|
|
392
|
+
''
|
|
393
|
+
if (!userDataPath) {
|
|
394
|
+
resolve('')
|
|
395
|
+
return
|
|
396
|
+
}
|
|
397
|
+
const filepath = `${userDataPath}/${uuid()}.png`
|
|
384
398
|
fileMg.writeFile({
|
|
385
399
|
filePath: filepath,
|
|
386
400
|
data: data.split(',')[1],
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
export default {
|
|
8
8
|
name: 'oxy-qrcode',
|
|
9
9
|
options: {
|
|
10
|
+
// #ifndef MP-TOUTIAO
|
|
10
11
|
virtualHost: true,
|
|
12
|
+
// #endif
|
|
11
13
|
addGlobalClass: true,
|
|
12
14
|
styleIsolation: 'shared'
|
|
13
15
|
}
|
|
@@ -25,14 +27,16 @@ const props = defineProps(qrcodeProps)
|
|
|
25
27
|
const qrcodeId = ref<string>('oxy-qrcode-' + uuid())
|
|
26
28
|
|
|
27
29
|
/**
|
|
28
|
-
*
|
|
29
|
-
* 支持多平台(APP、H5、微信小程序),自动适配高分屏。
|
|
30
|
-
* 内部调用 drawQrcode 进行二维码点阵绘制。
|
|
30
|
+
* 将尺寸值转换为数值(默认 rpx),用于二维码计算。
|
|
31
31
|
*/
|
|
32
32
|
function getUnitNumber(value: number | string) {
|
|
33
33
|
return unitConvertWithDefault(value, { defaultUnit: 'rpx' })
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* 主绘制方法,根据当前 props 生成二维码并绘制到 canvas。
|
|
38
|
+
* 支持多平台(APP、H5、微信小程序),自动适配高清屏(dpr 缩放)。
|
|
39
|
+
*/
|
|
36
40
|
function drawer() {
|
|
37
41
|
const data = {
|
|
38
42
|
text: props.text,
|
|
@@ -102,6 +106,9 @@ function getUnit(value: number | string) {
|
|
|
102
106
|
return unitConvert(withDefaultUnit(value, 'rpx'), 0, { output: 'px' })
|
|
103
107
|
}
|
|
104
108
|
|
|
109
|
+
/**
|
|
110
|
+
* 延迟绘制二维码。HarmonyOS / iOS App 需要 50ms 延迟以确保 canvas 节点就绪。
|
|
111
|
+
*/
|
|
105
112
|
onMounted(() => {
|
|
106
113
|
setTimeout(
|
|
107
114
|
() => {
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
height: $-radio-button-height;
|
|
160
160
|
min-width: $-radio-button-min-width;
|
|
161
161
|
max-width: $-radio-button-max-width;
|
|
162
|
-
padding:
|
|
162
|
+
padding: $-radio-button-padding;
|
|
163
163
|
margin-right: 0;
|
|
164
164
|
line-height: 1.2;
|
|
165
165
|
text-align: center;
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
font-size: $-radio-button-fs;
|
|
170
170
|
box-sizing: border-box;
|
|
171
171
|
border: 1px solid $-radio-button-border;
|
|
172
|
-
transition: all
|
|
172
|
+
transition: all $-transition-duration-base;
|
|
173
173
|
@include lineEllipsis;
|
|
174
174
|
}
|
|
175
175
|
@include when(checked) {
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
}
|
|
196
196
|
.oxy-radio__shape {
|
|
197
197
|
display: block;
|
|
198
|
-
margin-right:
|
|
198
|
+
margin-right: $-spacing-8;
|
|
199
199
|
float: left;
|
|
200
200
|
&::after {
|
|
201
201
|
content: "";
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
|
|
207
207
|
@include when(dot) {
|
|
208
208
|
.oxy-radio__shape {
|
|
209
|
-
margin-top:
|
|
209
|
+
margin-top: $-spacing-4;
|
|
210
210
|
}
|
|
211
211
|
@include when(large) {
|
|
212
212
|
.oxy-radio__shape {
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
&.icon-placement-right {
|
|
219
219
|
.oxy-radio__shape {
|
|
220
220
|
margin-right: 0;
|
|
221
|
-
margin-left:
|
|
221
|
+
margin-left: $-spacing-8;
|
|
222
222
|
float: right;
|
|
223
223
|
}
|
|
224
224
|
}
|
|
@@ -265,18 +265,18 @@
|
|
|
265
265
|
|
|
266
266
|
// 以下内容用于解决父子组件样式隔离的问题 —— START
|
|
267
267
|
@include when(cell-radio) {
|
|
268
|
-
padding:
|
|
268
|
+
padding: $-cell-wrapper-padding $-cell-padding;
|
|
269
269
|
margin: 0;
|
|
270
270
|
|
|
271
271
|
@include when(large) {
|
|
272
|
-
padding:
|
|
272
|
+
padding: $-cell-wrapper-padding-large $-cell-padding;
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
|
|
276
276
|
@include when(button-radio) {
|
|
277
277
|
display: inline-flex;
|
|
278
278
|
width: 33.3333%;
|
|
279
|
-
padding:
|
|
279
|
+
padding: $-cell-wrapper-padding $-cell-padding 0 0;
|
|
280
280
|
box-sizing: border-box;
|
|
281
281
|
|
|
282
282
|
.oxy-radio__label {
|
|
@@ -25,7 +25,9 @@
|
|
|
25
25
|
export default {
|
|
26
26
|
name: 'oxy-radio',
|
|
27
27
|
options: {
|
|
28
|
+
// #ifndef MP-TOUTIAO
|
|
28
29
|
virtualHost: true,
|
|
30
|
+
// #endif
|
|
29
31
|
addGlobalClass: true,
|
|
30
32
|
styleIsolation: 'shared'
|
|
31
33
|
}
|
|
@@ -44,26 +46,26 @@ const props = defineProps(radioProps)
|
|
|
44
46
|
const { parent: radioGroup } = useParent(RADIO_GROUP_KEY)
|
|
45
47
|
|
|
46
48
|
const isChecked = computed(() => {
|
|
47
|
-
if (radioGroup) {
|
|
48
|
-
return props.value === radioGroup.props.modelValue
|
|
49
|
+
if (radioGroup.value) {
|
|
50
|
+
return props.value === radioGroup.value.props.modelValue
|
|
49
51
|
} else {
|
|
50
52
|
return false
|
|
51
53
|
}
|
|
52
54
|
})
|
|
53
55
|
|
|
54
56
|
const shapeValue = computed(() => {
|
|
55
|
-
return props.shape || getPropByPath(radioGroup, 'props.shape')
|
|
57
|
+
return props.shape || getPropByPath(radioGroup.value, 'props.shape')
|
|
56
58
|
})
|
|
57
59
|
|
|
58
60
|
const checkedColorValue = computed(() => {
|
|
59
|
-
return props.checkedColor || getPropByPath(radioGroup, 'props.checkedColor')
|
|
61
|
+
return props.checkedColor || getPropByPath(radioGroup.value, 'props.checkedColor')
|
|
60
62
|
})
|
|
61
63
|
|
|
62
64
|
const disabledValue = computed(() => {
|
|
63
65
|
if (isDef(props.disabled)) {
|
|
64
66
|
return props.disabled
|
|
65
67
|
} else {
|
|
66
|
-
return getPropByPath(radioGroup, 'props.disabled')
|
|
68
|
+
return getPropByPath(radioGroup.value, 'props.disabled')
|
|
67
69
|
}
|
|
68
70
|
})
|
|
69
71
|
|
|
@@ -71,19 +73,19 @@ const inlineValue = computed(() => {
|
|
|
71
73
|
if (isDef(props.inline)) {
|
|
72
74
|
return props.inline
|
|
73
75
|
} else {
|
|
74
|
-
return getPropByPath(radioGroup, 'props.inline')
|
|
76
|
+
return getPropByPath(radioGroup.value, 'props.inline')
|
|
75
77
|
}
|
|
76
78
|
})
|
|
77
79
|
|
|
78
80
|
const sizeValue = computed(() => {
|
|
79
|
-
return props.size || getPropByPath(radioGroup, 'props.size')
|
|
81
|
+
return props.size || getPropByPath(radioGroup.value, 'props.size')
|
|
80
82
|
})
|
|
81
83
|
|
|
82
84
|
const cellValue = computed(() => {
|
|
83
85
|
if (isDef(props.cell)) {
|
|
84
86
|
return props.cell
|
|
85
87
|
} else {
|
|
86
|
-
return getPropByPath(radioGroup, 'props.cell')
|
|
88
|
+
return getPropByPath(radioGroup.value, 'props.cell')
|
|
87
89
|
}
|
|
88
90
|
})
|
|
89
91
|
|
|
@@ -91,7 +93,7 @@ const iconPlacement = computed<RadioIconPlacement>(() => {
|
|
|
91
93
|
if (isDef(props.iconPlacement)) {
|
|
92
94
|
return props.iconPlacement
|
|
93
95
|
} else {
|
|
94
|
-
return getPropByPath(radioGroup, 'props.iconPlacement')
|
|
96
|
+
return getPropByPath(radioGroup.value, 'props.iconPlacement')
|
|
95
97
|
}
|
|
96
98
|
})
|
|
97
99
|
|
|
@@ -108,8 +110,8 @@ watch(
|
|
|
108
110
|
*/
|
|
109
111
|
function handleClick() {
|
|
110
112
|
const { value } = props
|
|
111
|
-
if (!disabledValue.value && radioGroup && isDef(value)) {
|
|
112
|
-
radioGroup.updateValue(value)
|
|
113
|
+
if (!disabledValue.value && radioGroup.value && isDef(value)) {
|
|
114
|
+
radioGroup.value.updateValue(value)
|
|
113
115
|
}
|
|
114
116
|
}
|
|
115
117
|
</script>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// 顶部与两侧留白适当放大,避免按钮组在16px基准字号下过于紧凑
|
|
15
15
|
@include when(button) {
|
|
16
16
|
width: 100%;
|
|
17
|
-
padding:
|
|
17
|
+
padding: $-cell-wrapper-padding $-cell-padding $-spacing-32 $-cell-padding;
|
|
18
18
|
box-sizing: border-box;
|
|
19
19
|
overflow: hidden;
|
|
20
20
|
height: auto;
|
|
@@ -31,7 +31,9 @@ export default {
|
|
|
31
31
|
name: 'oxy-rate',
|
|
32
32
|
options: {
|
|
33
33
|
addGlobalClass: true,
|
|
34
|
+
// #ifndef MP-TOUTIAO
|
|
34
35
|
virtualHost: true,
|
|
36
|
+
// #endif
|
|
35
37
|
styleIsolation: 'shared'
|
|
36
38
|
}
|
|
37
39
|
}
|
|
@@ -155,6 +157,9 @@ function updateValue(value: number) {
|
|
|
155
157
|
})
|
|
156
158
|
}
|
|
157
159
|
|
|
160
|
+
/**
|
|
161
|
+
* 触摸滑动评分。根据触摸点的 clientX 和每个星的 rect 判断当前触摸的星级和半星,实时更新评分。
|
|
162
|
+
*/
|
|
158
163
|
async function onTouchMove(event: TouchEvent) {
|
|
159
164
|
const { clientX } = event.touches[0]
|
|
160
165
|
const rateItems = await getRect('.oxy-rate__item', true, proxy)
|
|
@@ -34,7 +34,9 @@
|
|
|
34
34
|
export default {
|
|
35
35
|
name: 'oxy-resize',
|
|
36
36
|
options: {
|
|
37
|
+
// #ifndef MP-TOUTIAO
|
|
37
38
|
virtualHost: true,
|
|
39
|
+
// #endif
|
|
38
40
|
addGlobalClass: true,
|
|
39
41
|
styleIsolation: 'shared'
|
|
40
42
|
}
|
|
@@ -69,6 +71,12 @@ const { proxy } = getCurrentInstance() as any
|
|
|
69
71
|
|
|
70
72
|
const resizeId = ref<string>(`resize${uuid()}`)
|
|
71
73
|
|
|
74
|
+
/**
|
|
75
|
+
* 初始化尺寸监听。通过双 scroll-view 滚动到底部的技巧模拟 ResizeObserver:
|
|
76
|
+
* - 插槽内容变化 → 容器尺寸变化 → scroll-view 自动滚动到底部 → 触发 @scroll
|
|
77
|
+
* - 前 3 次 scroll 事件为初始化/滚动到底部的副作用,第 4 次起才是真正的尺寸变化
|
|
78
|
+
* - 宽高变化时 emit('resize') 通知外部
|
|
79
|
+
*/
|
|
72
80
|
onMounted(() => {
|
|
73
81
|
// 初始化数据获取
|
|
74
82
|
const query = uni.createSelectorQuery().in(proxy).select(`#${resizeId.value}`).boundingClientRect()
|
|
@@ -132,6 +140,10 @@ onMounted(() => {
|
|
|
132
140
|
})
|
|
133
141
|
})
|
|
134
142
|
|
|
143
|
+
/**
|
|
144
|
+
* 将双 scroll-view 滚动到底部。expand 滚动到远超容器的位置确保始终在底部,
|
|
145
|
+
* shrink 滚动到相对较近的位置以便检测尺寸缩小。
|
|
146
|
+
*/
|
|
135
147
|
function scrollToBottom({ lastWidth, lastHeight }: { lastWidth: number; lastHeight: number }) {
|
|
136
148
|
expandScrollTop.value = 100000 + lastHeight
|
|
137
149
|
shrinkScrollTop.value = 3 * height.value + lastHeight
|