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,8 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view>
|
|
3
3
|
<oxy-popup
|
|
4
|
-
custom-class="
|
|
5
|
-
:custom-style="
|
|
4
|
+
:custom-class="popupClass"
|
|
5
|
+
:custom-style="customStyle"
|
|
6
|
+
:max-width="maxWidth"
|
|
6
7
|
v-model="showPopup"
|
|
7
8
|
:duration="duration"
|
|
8
9
|
position="bottom"
|
|
@@ -17,20 +18,13 @@
|
|
|
17
18
|
@click-modal="handleClickModal"
|
|
18
19
|
:z-index="zIndex"
|
|
19
20
|
>
|
|
20
|
-
<view
|
|
21
|
-
:class="`oxy-action-sheet ${customClass}`"
|
|
22
|
-
:style="`${
|
|
23
|
-
(actions && actions.length) || (panels && panels.length)
|
|
24
|
-
? 'margin: 0 10px calc(var(--window-bottom) + 10px) 10px; border-radius: 16px;'
|
|
25
|
-
: 'margin-bottom: var(--window-bottom);'
|
|
26
|
-
} ${customStyle}`"
|
|
27
|
-
>
|
|
21
|
+
<view :class="['oxy-action-sheet', { 'is-float': isFloatMode }, customClass]">
|
|
28
22
|
<view v-if="title" :class="`oxy-action-sheet__header ${customHeaderClass}`">
|
|
29
23
|
{{ title }}
|
|
30
24
|
<oxy-icon custom-class="oxy-action-sheet__close" name="add" @click="close" />
|
|
31
25
|
</view>
|
|
32
26
|
<view class="oxy-action-sheet__actions" v-if="actions && actions.length">
|
|
33
|
-
<
|
|
27
|
+
<view
|
|
34
28
|
v-for="(action, rowIndex) in actions"
|
|
35
29
|
:key="rowIndex"
|
|
36
30
|
:class="`oxy-action-sheet__action ${action.disabled ? 'oxy-action-sheet__action--disabled' : ''} ${
|
|
@@ -42,20 +36,20 @@
|
|
|
42
36
|
<oxy-loading custom-class="`oxy-action-sheet__action-loading" v-if="action.loading" />
|
|
43
37
|
<view v-else class="oxy-action-sheet__name">{{ action.name }}</view>
|
|
44
38
|
<view v-if="!action.loading && action.subname" class="oxy-action-sheet__subname">{{ action.subname }}</view>
|
|
45
|
-
</
|
|
39
|
+
</view>
|
|
46
40
|
</view>
|
|
47
41
|
<view v-if="formatPanels && formatPanels.length">
|
|
48
42
|
<view v-for="(panel, rowIndex) in formatPanels" :key="rowIndex" class="oxy-action-sheet__panels">
|
|
49
43
|
<view class="oxy-action-sheet__panels-content">
|
|
50
44
|
<view v-for="(col, colIndex) in panel" :key="colIndex" class="oxy-action-sheet__panel" @click="select(rowIndex, 'panels', colIndex)">
|
|
51
|
-
<image class="oxy-action-sheet__panel-img" :src="
|
|
52
|
-
<view class="oxy-action-sheet__panel-title">{{
|
|
45
|
+
<image class="oxy-action-sheet__panel-img" :src="col.iconUrl" />
|
|
46
|
+
<view class="oxy-action-sheet__panel-title">{{ col.title }}</view>
|
|
53
47
|
</view>
|
|
54
48
|
</view>
|
|
55
49
|
</view>
|
|
56
50
|
</view>
|
|
57
51
|
<slot />
|
|
58
|
-
<
|
|
52
|
+
<view v-if="cancelText" class="oxy-action-sheet__cancel" @click="handleCancel">{{ cancelText }}</view>
|
|
59
53
|
</view>
|
|
60
54
|
</oxy-popup>
|
|
61
55
|
</view>
|
|
@@ -75,17 +69,25 @@ export default {
|
|
|
75
69
|
import OxyPopup from '../oxy-popup/oxy-popup.vue'
|
|
76
70
|
import OxyIcon from '../oxy-icon/oxy-icon.vue'
|
|
77
71
|
import OxyLoading from '../oxy-loading/oxy-loading.vue'
|
|
78
|
-
import { watch, ref } from 'vue'
|
|
72
|
+
import { computed, watch, ref } from 'vue'
|
|
79
73
|
import { actionSheetProps, type Panel } from './types'
|
|
80
74
|
import { isArray } from '../common/util'
|
|
81
75
|
|
|
82
76
|
const props = defineProps(actionSheetProps)
|
|
83
77
|
const emit = defineEmits(['select', 'click-modal', 'cancel', 'closed', 'close', 'open', 'opened', 'update:modelValue'])
|
|
84
78
|
|
|
85
|
-
const formatPanels = ref<
|
|
79
|
+
const formatPanels = ref<Panel[][]>([])
|
|
86
80
|
|
|
87
81
|
const showPopup = ref<boolean>(false)
|
|
88
82
|
|
|
83
|
+
const isFloatMode = computed(() => {
|
|
84
|
+
return !!((props.actions && props.actions.length) || (props.panels && props.panels.length))
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
const popupClass = computed(() => {
|
|
88
|
+
return `oxy-action-sheet__popup ${isFloatMode.value ? 'oxy-action-sheet__popup--float' : ''}`
|
|
89
|
+
})
|
|
90
|
+
|
|
89
91
|
watch(() => props.panels, computedValue, { deep: true, immediate: true })
|
|
90
92
|
|
|
91
93
|
watch(
|
|
@@ -113,13 +115,19 @@ function select(rowIndex: number, type: 'action' | 'panels', colIndex?: number)
|
|
|
113
115
|
index: rowIndex
|
|
114
116
|
})
|
|
115
117
|
} else if (isPanelArray()) {
|
|
118
|
+
if (typeof colIndex !== 'number') {
|
|
119
|
+
return
|
|
120
|
+
}
|
|
116
121
|
emit('select', {
|
|
117
|
-
item: props.panels[
|
|
122
|
+
item: props.panels[colIndex],
|
|
118
123
|
index: colIndex
|
|
119
124
|
})
|
|
120
125
|
} else {
|
|
126
|
+
if (typeof colIndex !== 'number') {
|
|
127
|
+
return
|
|
128
|
+
}
|
|
121
129
|
emit('select', {
|
|
122
|
-
item: (props.panels as Panel[][])[rowIndex][
|
|
130
|
+
item: (props.panels as Panel[][])[rowIndex][colIndex],
|
|
123
131
|
rowIndex,
|
|
124
132
|
colIndex
|
|
125
133
|
})
|
|
@@ -95,6 +95,13 @@ export const actionSheetProps = {
|
|
|
95
95
|
* @type {number}
|
|
96
96
|
*/
|
|
97
97
|
zIndex: makeNumberProp(10),
|
|
98
|
+
/**
|
|
99
|
+
* 面板最大宽度,支持 `rpx`、`px`、`%` 等单位;
|
|
100
|
+
* `%` 在弹层打开时按屏幕宽度换算为 `rpx`
|
|
101
|
+
* @default '1200rpx'
|
|
102
|
+
* @type {string}
|
|
103
|
+
*/
|
|
104
|
+
maxWidth: makeStringProp('1200rpx'),
|
|
98
105
|
/**
|
|
99
106
|
* 弹层内容懒渲染,触发展示时才渲染内容
|
|
100
107
|
* @default true
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
@include b(backtop) {
|
|
5
5
|
position: fixed;
|
|
6
6
|
background-color: $-backtop-bg;
|
|
7
|
-
width:
|
|
8
|
-
height:
|
|
7
|
+
width: 80rpx;
|
|
8
|
+
height: 80rpx;
|
|
9
9
|
display: flex;
|
|
10
10
|
justify-content: center;
|
|
11
11
|
align-items: center;
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
@include when(square) {
|
|
23
|
-
border-radius:
|
|
23
|
+
border-radius: $-backtop-square-radius;
|
|
24
24
|
}
|
|
25
|
-
}
|
|
25
|
+
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<oxy-transition :show="show" name="fade">
|
|
3
|
-
<view
|
|
4
|
-
:class="`oxy-backtop ${customClass} is-${shape}`"
|
|
5
|
-
:style="`z-index: ${zIndex}; bottom: ${bottom}px; right: ${right}px; ${customStyle}`"
|
|
6
|
-
@click="handleBacktop"
|
|
7
|
-
>
|
|
3
|
+
<view :class="`oxy-backtop ${customClass} is-${shape}`" :style="rootStyle" @click="handleBacktop">
|
|
8
4
|
<slot v-if="$slots.default"></slot>
|
|
9
5
|
<oxy-icon v-else custom-class="oxy-backtop__backicon" name="backtop" :custom-style="iconStyle" />
|
|
10
6
|
</view>
|
|
@@ -26,11 +22,18 @@ export default {
|
|
|
26
22
|
import OxyTransition from '../oxy-transition/oxy-transition.vue'
|
|
27
23
|
import OxyIcon from '../oxy-icon/oxy-icon.vue'
|
|
28
24
|
import { computed } from 'vue'
|
|
25
|
+
import { unitConvertWithDefault, withDefaultUnit } from '../common/util'
|
|
29
26
|
import { backtopProps } from './types'
|
|
30
27
|
|
|
31
28
|
const props = defineProps(backtopProps)
|
|
32
29
|
|
|
33
|
-
const
|
|
30
|
+
const thresholdTop = computed(() => unitConvertWithDefault(props.top, { defaultUnit: 'rpx' }))
|
|
31
|
+
const show = computed(() => props.scrollTop > thresholdTop.value)
|
|
32
|
+
const rootStyle = computed(() => {
|
|
33
|
+
return `z-index: ${props.zIndex}; bottom: ${withDefaultUnit(props.bottom, 'rpx')}; right: ${withDefaultUnit(props.right, 'rpx')}; ${
|
|
34
|
+
props.customStyle
|
|
35
|
+
}`
|
|
36
|
+
})
|
|
34
37
|
|
|
35
38
|
function handleBacktop() {
|
|
36
39
|
uni.pageScrollTo({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { baseProps, makeNumberProp, makeRequiredProp, makeStringProp } from '../common/props'
|
|
1
|
+
import { baseProps, makeNumberProp, makeNumericProp, makeRequiredProp, makeStringProp } from '../common/props'
|
|
2
2
|
|
|
3
3
|
export const backtopProps = {
|
|
4
4
|
...baseProps,
|
|
@@ -7,9 +7,9 @@ export const backtopProps = {
|
|
|
7
7
|
*/
|
|
8
8
|
scrollTop: makeRequiredProp(Number),
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* 距离顶部多少距离时显示,支持 `px/rpx`;number 或纯数字字符串按 `rpx` 处理
|
|
11
11
|
*/
|
|
12
|
-
top:
|
|
12
|
+
top: makeNumericProp(600),
|
|
13
13
|
/**
|
|
14
14
|
* 返回顶部滚动时间
|
|
15
15
|
*/
|
|
@@ -27,11 +27,11 @@ export const backtopProps = {
|
|
|
27
27
|
*/
|
|
28
28
|
shape: makeStringProp('circle'),
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* 距离屏幕底部距离,支持 `px/rpx`;number 或纯数字字符串按 `rpx` 处理
|
|
31
31
|
*/
|
|
32
|
-
bottom:
|
|
32
|
+
bottom: makeNumericProp(200),
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* 距离屏幕右边距离,支持 `px/rpx`;number 或纯数字字符串按 `rpx` 处理
|
|
35
35
|
*/
|
|
36
|
-
right:
|
|
36
|
+
right: makeNumericProp(40)
|
|
37
37
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
line-height: $-badge-height;
|
|
23
23
|
padding: $-badge-padding;
|
|
24
24
|
background-color: $-badge-bg;
|
|
25
|
-
border-radius: calc($-badge-height / 2 +
|
|
25
|
+
border-radius: calc($-badge-height / 2 + 4rpx);
|
|
26
26
|
color: $-badge-color;
|
|
27
27
|
font-size: $-badge-fs;
|
|
28
28
|
text-align: center;
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
|
|
33
33
|
@include when(fixed) {
|
|
34
34
|
position: absolute;
|
|
35
|
-
top:
|
|
36
|
-
right:
|
|
35
|
+
top: 0;
|
|
36
|
+
right: 0;
|
|
37
37
|
transform: translateY(-50%) translateX(50%);
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -60,4 +60,4 @@
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
}
|
|
63
|
+
}
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
<script lang="ts" setup>
|
|
24
24
|
import { computed, type CSSProperties } from 'vue'
|
|
25
25
|
import { badgeProps } from './types'
|
|
26
|
-
import {
|
|
26
|
+
import { withDefaultUnit, isDef, isNumber, objToStyle } from '../common/util'
|
|
27
27
|
|
|
28
28
|
const props = defineProps(badgeProps)
|
|
29
29
|
const content = computed(() => {
|
|
@@ -43,11 +43,11 @@ const contentStyle = computed(() => {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
if (isDef(props.top)) {
|
|
46
|
-
style.top =
|
|
46
|
+
style.top = withDefaultUnit(props.top)
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
if (isDef(props.right)) {
|
|
50
|
-
style.right =
|
|
50
|
+
style.right = withDefaultUnit(props.right)
|
|
51
51
|
}
|
|
52
52
|
return objToStyle(style)
|
|
53
53
|
})
|
|
@@ -29,11 +29,11 @@ export const badgeProps = {
|
|
|
29
29
|
*/
|
|
30
30
|
type: makeStringProp<BadgeType | undefined>(undefined),
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* 为正时,角标向下偏移距离,支持 `px/rpx`
|
|
33
33
|
*/
|
|
34
34
|
top: numericProp,
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* 为正时,角标向左偏移距离,支持 `px/rpx`
|
|
37
37
|
*/
|
|
38
38
|
right: numericProp
|
|
39
39
|
}
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
@include e(loading) {
|
|
100
|
-
margin-right:
|
|
100
|
+
margin-right: 12rpx;
|
|
101
101
|
animation: oxy-rotate 0.8s linear infinite;
|
|
102
102
|
animation-duration: 2s;
|
|
103
103
|
}
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
padding: $-button-medium-padding;
|
|
155
155
|
border-radius: $-button-medium-radius;
|
|
156
156
|
font-size: $-button-medium-fs;
|
|
157
|
-
min-width:
|
|
157
|
+
min-width: 240rpx;
|
|
158
158
|
|
|
159
159
|
|
|
160
160
|
@include when(round) {
|
|
@@ -194,13 +194,13 @@
|
|
|
194
194
|
|
|
195
195
|
|
|
196
196
|
@include when(round) {
|
|
197
|
-
border-radius:
|
|
197
|
+
border-radius: $-button-round-radius;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
@include when(text) {
|
|
201
201
|
color: $-button-primary-bg-color;
|
|
202
202
|
min-width: 0;
|
|
203
|
-
padding:
|
|
203
|
+
padding: 8rpx 0;
|
|
204
204
|
|
|
205
205
|
&::after {
|
|
206
206
|
display: none;
|
|
@@ -314,7 +314,7 @@
|
|
|
314
314
|
|
|
315
315
|
@include edeep(icon) {
|
|
316
316
|
display: block;
|
|
317
|
-
margin-right:
|
|
317
|
+
margin-right: 12rpx;
|
|
318
318
|
font-size: $-button-icon-fs;
|
|
319
319
|
vertical-align: middle;
|
|
320
320
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
]"
|
|
18
18
|
:hover-start-time="hoverStartTime"
|
|
19
19
|
:hover-stay-time="hoverStayTime"
|
|
20
|
-
:open-type="
|
|
20
|
+
:open-type="openTypeValue"
|
|
21
21
|
:send-message-title="sendMessageTitle"
|
|
22
22
|
:send-message-path="sendMessagePath"
|
|
23
23
|
:send-message-img="sendMessageImg"
|
|
@@ -98,6 +98,10 @@ const loadingStyle = computed(() => {
|
|
|
98
98
|
return `background-image: url(${loadingIconSvg.value});`
|
|
99
99
|
})
|
|
100
100
|
|
|
101
|
+
const openTypeValue = computed(() => {
|
|
102
|
+
return (props.disabled || props.loading ? undefined : props.openType) as any
|
|
103
|
+
})
|
|
104
|
+
|
|
101
105
|
watch(
|
|
102
106
|
() => props.loading,
|
|
103
107
|
() => {
|
|
@@ -61,25 +61,25 @@
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
@include e(tabs) {
|
|
64
|
-
width:
|
|
65
|
-
margin:
|
|
64
|
+
width: 444rpx;
|
|
65
|
+
margin: 24rpx auto 28rpx;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
@include e(shortcuts) {
|
|
69
|
-
padding:
|
|
69
|
+
padding: 40rpx 0;
|
|
70
70
|
text-align: center;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
@include edeep(tag) {
|
|
74
|
-
margin-right:
|
|
74
|
+
margin-right: 16rpx;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
@include e(view) {
|
|
78
78
|
@include when(show-confirm) {
|
|
79
|
-
height:
|
|
79
|
+
height: 788rpx;
|
|
80
80
|
|
|
81
81
|
@include when(range) {
|
|
82
|
-
height:
|
|
82
|
+
height: 768rpx;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -88,30 +88,30 @@
|
|
|
88
88
|
display: flex;
|
|
89
89
|
justify-content: center;
|
|
90
90
|
align-items: center;
|
|
91
|
-
font-size:
|
|
91
|
+
font-size: $-fs-content;
|
|
92
92
|
|
|
93
93
|
@include when(monthrange) {
|
|
94
|
-
padding-bottom:
|
|
95
|
-
box-shadow:
|
|
94
|
+
padding-bottom: 24rpx;
|
|
95
|
+
box-shadow: $-calendar-panel-shadow-light;
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
@include e(range-label-item) {
|
|
100
100
|
flex: 1;
|
|
101
|
-
color:
|
|
101
|
+
color: $-calendar-day-color;
|
|
102
102
|
|
|
103
103
|
@include when(placeholder) {
|
|
104
|
-
color:
|
|
104
|
+
color: $-calendar-disabled-color;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
@include e(range-sperator) {
|
|
109
|
-
margin: 0
|
|
110
|
-
color:
|
|
109
|
+
margin: 0 48rpx;
|
|
110
|
+
color: $-calendar-disabled-color;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
@include e(confirm) {
|
|
114
|
-
padding:
|
|
114
|
+
padding: 28rpx 52rpx 32rpx;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
@include edeep(cell) {
|
|
@@ -155,4 +155,4 @@
|
|
|
155
155
|
color: $-cell-clear-color;
|
|
156
156
|
line-height: $-cell-line-height;
|
|
157
157
|
}
|
|
158
|
-
}
|
|
158
|
+
}
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
display: flex;
|
|
27
27
|
align-items: center;
|
|
28
28
|
justify-content: center;
|
|
29
|
-
height:
|
|
29
|
+
height: 90rpx;
|
|
30
30
|
font-size: $-calendar-panel-title-fs;
|
|
31
31
|
color: $-calendar-panel-title-color;
|
|
32
32
|
}
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
|
|
143
143
|
@include e(day-top) {
|
|
144
144
|
position: absolute;
|
|
145
|
-
top:
|
|
145
|
+
top: 20rpx;
|
|
146
146
|
left: 0;
|
|
147
147
|
right: 0;
|
|
148
148
|
line-height: 1.1;
|
|
@@ -152,11 +152,11 @@
|
|
|
152
152
|
|
|
153
153
|
@include e(day-bottom) {
|
|
154
154
|
position: absolute;
|
|
155
|
-
bottom:
|
|
155
|
+
bottom: 20rpx;
|
|
156
156
|
left: 0;
|
|
157
157
|
right: 0;
|
|
158
158
|
line-height: 1.1;
|
|
159
159
|
font-size: $-calendar-info-fs;
|
|
160
160
|
text-align: center;
|
|
161
161
|
}
|
|
162
|
-
}
|
|
162
|
+
}
|
|
@@ -3,18 +3,54 @@ import { makeBooleanProp, makeRequiredProp } from '../../common/props'
|
|
|
3
3
|
import type { CalendarFormatter, CalendarType } from '../types'
|
|
4
4
|
|
|
5
5
|
export const monthProps = {
|
|
6
|
+
/**
|
|
7
|
+
* 日历选择类型
|
|
8
|
+
*/
|
|
6
9
|
type: makeRequiredProp(String as PropType<CalendarType>),
|
|
10
|
+
/**
|
|
11
|
+
* 当前月份时间戳
|
|
12
|
+
*/
|
|
7
13
|
date: makeRequiredProp(Number),
|
|
14
|
+
/**
|
|
15
|
+
* 已选中的值
|
|
16
|
+
*/
|
|
8
17
|
value: makeRequiredProp([Number, Array, null] as PropType<number | (number | null)[] | null>),
|
|
18
|
+
/**
|
|
19
|
+
* 可选最小日期
|
|
20
|
+
*/
|
|
9
21
|
minDate: makeRequiredProp(Number),
|
|
22
|
+
/**
|
|
23
|
+
* 可选最大日期
|
|
24
|
+
*/
|
|
10
25
|
maxDate: makeRequiredProp(Number),
|
|
26
|
+
/**
|
|
27
|
+
* 每周起始日
|
|
28
|
+
*/
|
|
11
29
|
firstDayOfWeek: makeRequiredProp(Number),
|
|
30
|
+
/**
|
|
31
|
+
* 日期单元格格式化函数
|
|
32
|
+
*/
|
|
12
33
|
formatter: Function as PropType<CalendarFormatter>,
|
|
34
|
+
/**
|
|
35
|
+
* 范围选择最大天数
|
|
36
|
+
*/
|
|
13
37
|
maxRange: Number,
|
|
38
|
+
/**
|
|
39
|
+
* 超出范围提示文案
|
|
40
|
+
*/
|
|
14
41
|
rangePrompt: String,
|
|
42
|
+
/**
|
|
43
|
+
* 范围选择是否允许同一天
|
|
44
|
+
*/
|
|
15
45
|
allowSameDay: makeBooleanProp(false),
|
|
46
|
+
/**
|
|
47
|
+
* 默认时间配置
|
|
48
|
+
*/
|
|
16
49
|
defaultTime: {
|
|
17
50
|
type: [Array] as PropType<Array<number[]>>
|
|
18
51
|
},
|
|
52
|
+
/**
|
|
53
|
+
* 是否显示标题
|
|
54
|
+
*/
|
|
19
55
|
showTitle: makeBooleanProp(true)
|
|
20
56
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
@include e(weeks) {
|
|
11
|
-
box-shadow:
|
|
11
|
+
box-shadow: $-calendar-panel-shadow-dark;
|
|
12
12
|
color: $-dark-color;
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -25,18 +25,17 @@
|
|
|
25
25
|
font-size: $-calendar-fs;
|
|
26
26
|
|
|
27
27
|
@include e(title) {
|
|
28
|
-
padding:
|
|
28
|
+
padding: 16rpx 24rpx;
|
|
29
29
|
text-align: center;
|
|
30
30
|
font-size: $-calendar-panel-title-fs;
|
|
31
31
|
color: $-calendar-panel-title-color;
|
|
32
|
-
padding: $-calendar-panel-padding;
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
@include e(weeks) {
|
|
36
35
|
display: flex;
|
|
37
36
|
height: $-calendar-week-height;
|
|
38
37
|
line-height: $-calendar-week-height;
|
|
39
|
-
box-shadow:
|
|
38
|
+
box-shadow: $-calendar-panel-shadow-light;
|
|
40
39
|
color: $-calendar-week-color;
|
|
41
40
|
font-size: $-calendar-week-fs;
|
|
42
41
|
padding: $-calendar-panel-padding;
|
|
@@ -54,7 +53,7 @@
|
|
|
54
53
|
|
|
55
54
|
@include e(time) {
|
|
56
55
|
display: flex;
|
|
57
|
-
box-shadow:
|
|
56
|
+
box-shadow: $-calendar-panel-shadow-reverse-light;
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
@include e(time-label) {
|
|
@@ -62,13 +61,13 @@
|
|
|
62
61
|
flex: 1;
|
|
63
62
|
font-size: $-picker-column-fs;
|
|
64
63
|
text-align: center;
|
|
65
|
-
line-height:
|
|
64
|
+
line-height: 250rpx;
|
|
66
65
|
color: $-picker-column-color;
|
|
67
66
|
|
|
68
67
|
&::after {
|
|
69
68
|
position: absolute;
|
|
70
69
|
content: '';
|
|
71
|
-
height:
|
|
70
|
+
height: 70rpx;
|
|
72
71
|
top: 50%;
|
|
73
72
|
left: 0;
|
|
74
73
|
right: 0;
|
|
@@ -86,4 +85,4 @@
|
|
|
86
85
|
@include e(time-picker) {
|
|
87
86
|
flex: 3;
|
|
88
87
|
}
|
|
89
|
-
}
|
|
88
|
+
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
</view>
|
|
9
9
|
<scroll-view
|
|
10
10
|
:class="`oxy-month-panel__container ${!!timeType ? 'oxy-month-panel__container--time' : ''}`"
|
|
11
|
-
:style="`height: ${scrollHeight}
|
|
11
|
+
:style="`height: ${unitConvert(scrollHeight, 0, { output: 'px' })}`"
|
|
12
12
|
scroll-y
|
|
13
13
|
@scroll="monthScroll"
|
|
14
14
|
:scroll-top="scrollTop"
|
|
@@ -64,7 +64,7 @@ export default {
|
|
|
64
64
|
<script lang="ts" setup>
|
|
65
65
|
import OxyPickerView from '../../oxy-picker-view/oxy-picker-view.vue'
|
|
66
66
|
import { computed, ref, watch, onMounted } from 'vue'
|
|
67
|
-
import { debounce, isArray, isEqual, isNumber, pause } from '../../common/util'
|
|
67
|
+
import { debounce, isArray, isEqual, isNumber, pause, unitConvert } from '../../common/util'
|
|
68
68
|
import { compareMonth, formatMonthTitle, getMonthEndDay, getMonths, getTimeData, getWeekLabel } from '../utils'
|
|
69
69
|
import Month from '../month/month.vue'
|
|
70
70
|
import { monthPanelProps, type MonthInfo, type MonthPanelTimeType, type MonthPanelExpose } from './types'
|
|
@@ -83,6 +83,12 @@ const timeValue = ref<number[]>([]) // 当前选中的时分秒
|
|
|
83
83
|
const timeType = ref<MonthPanelTimeType>('') // 当前时间类型,是开始还是结束
|
|
84
84
|
const innerValue = ref<string | number | (number | null)[]>('') // 内部保存一个值,用于判断新老值,避免监听器触发
|
|
85
85
|
|
|
86
|
+
const designPxToRuntimePx = (designPx: number): number => unitConvert(`${designPx * 2}rpx`)
|
|
87
|
+
const MONTH_ROW_HEIGHT = designPxToRuntimePx(64)
|
|
88
|
+
const MONTH_ROW_GAP = designPxToRuntimePx(4)
|
|
89
|
+
const MONTH_TITLE_HEIGHT = designPxToRuntimePx(45)
|
|
90
|
+
const TIME_PICKER_HEIGHT = designPxToRuntimePx(125)
|
|
91
|
+
|
|
86
92
|
const handleChange = debounce((value) => {
|
|
87
93
|
emit('change', {
|
|
88
94
|
value
|
|
@@ -132,7 +138,8 @@ const weekLabel = computed(() => {
|
|
|
132
138
|
|
|
133
139
|
// 滚动区域的高度
|
|
134
140
|
const scrollHeight = computed(() => {
|
|
135
|
-
const
|
|
141
|
+
const panelHeight = designPxToRuntimePx(props.panelHeight)
|
|
142
|
+
const scrollHeight: number = timeType.value ? panelHeight - TIME_PICKER_HEIGHT : panelHeight
|
|
136
143
|
return scrollHeight
|
|
137
144
|
})
|
|
138
145
|
|
|
@@ -143,7 +150,7 @@ const months = computed<MonthInfo[]>(() => {
|
|
|
143
150
|
const totalDay = getMonthEndDay(new Date(month).getFullYear(), new Date(month).getMonth() + 1)
|
|
144
151
|
const rows = Math.ceil((offset + totalDay) / 7)
|
|
145
152
|
return {
|
|
146
|
-
height: rows *
|
|
153
|
+
height: rows * MONTH_ROW_HEIGHT + (rows - 1) * MONTH_ROW_GAP + (index === 0 ? 0 : MONTH_TITLE_HEIGHT),
|
|
147
154
|
date: month
|
|
148
155
|
}
|
|
149
156
|
})
|
|
@@ -214,8 +221,8 @@ async function scrollIntoView() {
|
|
|
214
221
|
const firstDay = new Date(date.getFullYear(), date.getMonth(), 1)
|
|
215
222
|
const offset = (7 + firstDay.getDay() - props.firstDayOfWeek) % 7
|
|
216
223
|
const row = Math.floor((offset + day - 1) / 7)
|
|
217
|
-
//
|
|
218
|
-
top += row *
|
|
224
|
+
// 每行高度与行间距按 rpx 基线换算为运行时 px
|
|
225
|
+
top += row * (MONTH_ROW_HEIGHT + MONTH_ROW_GAP)
|
|
219
226
|
break
|
|
220
227
|
}
|
|
221
228
|
top += months.value[index] ? Number(months.value[index].height) : 0
|
|
@@ -223,8 +230,7 @@ async function scrollIntoView() {
|
|
|
223
230
|
scrollTop.value = 0
|
|
224
231
|
if (top > 0) {
|
|
225
232
|
await pause()
|
|
226
|
-
|
|
227
|
-
scrollTop.value = top + (activeMonthIndex > 0 ? 45 : 0)
|
|
233
|
+
scrollTop.value = top + (activeMonthIndex > 0 ? MONTH_TITLE_HEIGHT : 0)
|
|
228
234
|
}
|
|
229
235
|
}
|
|
230
236
|
/**
|