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
|
@@ -44,12 +44,13 @@ import OxyButton from '../oxy-button/oxy-button.vue'
|
|
|
44
44
|
import OxyIcon from '../oxy-icon/oxy-icon.vue'
|
|
45
45
|
import OxyTransition from '../oxy-transition/oxy-transition.vue'
|
|
46
46
|
import { type CSSProperties, computed, ref, watch, inject, getCurrentInstance, onBeforeUnmount, onMounted, nextTick } from 'vue'
|
|
47
|
-
import { getRect, isDef, isH5, objToStyle } from '../common/util'
|
|
47
|
+
import { getRect, isDef, isH5, objToStyle, unitConvert } from '../common/util'
|
|
48
48
|
import { type Queue, queueKey } from '../composables/useQueue'
|
|
49
49
|
import { closeOther, pushToQueue, removeFromQueue } from '../common/clickoutside'
|
|
50
50
|
import { fabProps, type FabExpose } from './types'
|
|
51
51
|
import { reactive } from 'vue'
|
|
52
52
|
import { useRaf } from '../composables/useRaf'
|
|
53
|
+
import { useWindowResize } from '../composables/useWindowResize'
|
|
53
54
|
|
|
54
55
|
const props = defineProps(fabProps)
|
|
55
56
|
const emit = defineEmits(['update:active', 'click'])
|
|
@@ -121,6 +122,24 @@ async function getBounding() {
|
|
|
121
122
|
bounding.maxTop = screen.height - fabSize.height - bottom
|
|
122
123
|
}
|
|
123
124
|
|
|
125
|
+
function clampPosition() {
|
|
126
|
+
if (!inited.value) return
|
|
127
|
+
const { minLeft, minTop, maxLeft, maxTop } = bounding
|
|
128
|
+
left.value = Math.min(Math.max(left.value, minLeft), maxLeft)
|
|
129
|
+
top.value = Math.min(Math.max(top.value, minTop), maxTop)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const handleWindowResize = async () => {
|
|
133
|
+
await getBounding()
|
|
134
|
+
if (props.draggable) {
|
|
135
|
+
clampPosition()
|
|
136
|
+
return
|
|
137
|
+
}
|
|
138
|
+
initPosition()
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
useWindowResize(handleWindowResize)
|
|
142
|
+
|
|
124
143
|
function initPosition() {
|
|
125
144
|
const pos = props.position
|
|
126
145
|
const { minLeft, minTop, maxLeft, maxTop } = bounding
|
|
@@ -210,8 +229,8 @@ function handleTouchEnd() {
|
|
|
210
229
|
|
|
211
230
|
const rootStyle = computed(() => {
|
|
212
231
|
const style: CSSProperties = {
|
|
213
|
-
top: top.value
|
|
214
|
-
left: left.value
|
|
232
|
+
top: unitConvert(top.value, 0, { output: 'px' }),
|
|
233
|
+
left: unitConvert(left.value, 0, { output: 'px' }),
|
|
215
234
|
transition: attractTransition.value ? 'all ease 0.3s' : 'none'
|
|
216
235
|
}
|
|
217
236
|
if (isDef(props.zIndex)) {
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
position: relative;
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-wrap: wrap;
|
|
8
|
-
margin: 0 -
|
|
8
|
+
margin: 0 -16rpx;
|
|
9
9
|
@include e(item) {
|
|
10
10
|
position: relative;
|
|
11
|
-
width: calc(33.33% -
|
|
11
|
+
width: calc(33.33% - 32rpx);
|
|
12
12
|
height: $-file-list-height;
|
|
13
|
-
margin: 0
|
|
13
|
+
margin: 0 16rpx 64rpx;
|
|
14
14
|
}
|
|
15
15
|
@include e(content) {
|
|
16
16
|
display: flex;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
width: 100%;
|
|
21
21
|
height: 100%;
|
|
22
22
|
border: 1px solid $-color-border;
|
|
23
|
-
border-radius:
|
|
23
|
+
border-radius: $-file-list-card-radius;
|
|
24
24
|
position: relative;
|
|
25
25
|
}
|
|
26
26
|
@include e(picture) {
|
|
@@ -28,20 +28,20 @@
|
|
|
28
28
|
display: block;
|
|
29
29
|
width: 100%;
|
|
30
30
|
height: 100%;
|
|
31
|
-
border-radius:
|
|
31
|
+
border-radius: $-file-list-card-radius;
|
|
32
32
|
}
|
|
33
33
|
@include e(icon) {
|
|
34
|
-
width:
|
|
35
|
-
height:
|
|
34
|
+
width: 64rpx;
|
|
35
|
+
height: 64rpx;
|
|
36
36
|
}
|
|
37
37
|
@include e(name) {
|
|
38
38
|
display: block;
|
|
39
39
|
width: 100%;
|
|
40
|
-
font-size: $-
|
|
41
|
-
color: $-
|
|
42
|
-
padding: 0
|
|
40
|
+
font-size: $-file-list-file-name-fs;
|
|
41
|
+
color: $-file-list-file-name-color;
|
|
42
|
+
padding: 0 12rpx;
|
|
43
43
|
text-align: center;
|
|
44
|
-
margin-top:
|
|
44
|
+
margin-top: 20rpx;
|
|
45
45
|
white-space: nowrap;
|
|
46
46
|
overflow: hidden;
|
|
47
47
|
text-overflow: ellipsis;
|
|
@@ -59,16 +59,16 @@
|
|
|
59
59
|
margin: 0;
|
|
60
60
|
.oxy-file-list__list--item {
|
|
61
61
|
width: 100%;
|
|
62
|
-
background:
|
|
63
|
-
padding:
|
|
64
|
-
border-radius:
|
|
62
|
+
background: $-file-list-bg;
|
|
63
|
+
padding: 20rpx 24rpx;
|
|
64
|
+
border-radius: $-file-list-list-item-radius;
|
|
65
65
|
display: flex;
|
|
66
66
|
flex-direction: row;
|
|
67
67
|
align-items: center;
|
|
68
68
|
.oxy-file-list__icon {
|
|
69
|
-
width:
|
|
70
|
-
height:
|
|
71
|
-
margin-right:
|
|
69
|
+
width: 48rpx;
|
|
70
|
+
height: 48rpx;
|
|
71
|
+
margin-right: 20rpx;
|
|
72
72
|
}
|
|
73
73
|
.oxy-file-list__name {
|
|
74
74
|
flex: 1;
|
|
@@ -77,33 +77,34 @@
|
|
|
77
77
|
padding: 0;
|
|
78
78
|
}
|
|
79
79
|
.oxy-file-list__download {
|
|
80
|
-
font-size:
|
|
81
|
-
color: $-
|
|
80
|
+
font-size: $-file-list-action-icon-size;
|
|
81
|
+
color: $-file-list-action-icon-color;
|
|
82
82
|
}
|
|
83
83
|
.oxy-file-list__delete {
|
|
84
|
-
font-size:
|
|
85
|
-
color: $-
|
|
86
|
-
margin-left:
|
|
84
|
+
font-size: $-file-list-action-icon-size;
|
|
85
|
+
color: $-file-list-action-icon-color;
|
|
86
|
+
margin-left: 24rpx;
|
|
87
87
|
}
|
|
88
88
|
& + .oxy-file-list__list--item {
|
|
89
|
-
margin-top:
|
|
89
|
+
margin-top: 20rpx;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
.oxy-file-list__download-btn {
|
|
95
95
|
position: absolute;
|
|
96
|
-
top:
|
|
97
|
-
right:
|
|
98
|
-
background:
|
|
99
|
-
border-radius:
|
|
100
|
-
padding:
|
|
96
|
+
top: 16rpx;
|
|
97
|
+
right: 16rpx;
|
|
98
|
+
background: $-file-list-download-bg;
|
|
99
|
+
border-radius: $-file-list-card-radius;
|
|
100
|
+
padding: 12rpx 16rpx;
|
|
101
|
+
display: flex;
|
|
101
102
|
}
|
|
102
103
|
.oxy-file-list__download {
|
|
103
104
|
color: $-color-white;
|
|
104
105
|
}
|
|
105
106
|
.oxy-file-list__delete {
|
|
106
107
|
color: $-color-white;
|
|
107
|
-
margin-left:
|
|
108
|
+
margin-left: 12rpx;
|
|
108
109
|
}
|
|
109
110
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<view v-for="(file, index) in props.data" :key="index" class="oxy-file-list__list--item" @click="handleClick(file, index)">
|
|
5
5
|
<image :src="getUploadImage(file)" mode="aspectFill" class="oxy-file-list__icon" />
|
|
6
6
|
<text class="oxy-file-list__name">{{ file.name }}</text>
|
|
7
|
-
<oxy-loading v-if="props.enableDownload && isDownloading(file)" size="
|
|
7
|
+
<oxy-loading v-if="props.enableDownload && isDownloading(file)" size="36rpx" custom-class="oxy-file-list__download" />
|
|
8
8
|
<view @tap.stop="onDownload(file)" v-if="props.enableDownload && !isDownloading(file)">
|
|
9
9
|
<oxy-icon name="download" custom-class="oxy-file-list__download" />
|
|
10
10
|
</view>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<image v-else :src="getUploadImage(file)" mode="aspectFill" class="oxy-file-list__icon" @click="handleClick(file, index)" />
|
|
21
21
|
<view v-if="props.enableDownload || props.enableDelete" class="oxy-file-list__download-btn">
|
|
22
22
|
<template v-if="props.enableDownload">
|
|
23
|
-
<oxy-loading v-if="isDownloading(file)" size="
|
|
23
|
+
<oxy-loading v-if="isDownloading(file)" size="36rpx" color="#ffffff" custom-class="oxy-file-list__download" />
|
|
24
24
|
<view @tap.stop="onDownload(file)">
|
|
25
25
|
<oxy-icon name="download" custom-class="oxy-file-list__download" />
|
|
26
26
|
</view>
|
|
@@ -35,10 +35,11 @@ export default {
|
|
|
35
35
|
</script>
|
|
36
36
|
|
|
37
37
|
<script lang="ts" setup>
|
|
38
|
-
import { computed,
|
|
39
|
-
import { floatingPanelProps } from './
|
|
40
|
-
import {
|
|
38
|
+
import { computed, ref, watch, type CSSProperties } from 'vue'
|
|
39
|
+
import { floatingPanelProps } from './types'
|
|
40
|
+
import { closest, objToStyle, unitConvert } from '../common/util'
|
|
41
41
|
import { useTouch } from '../composables/useTouch'
|
|
42
|
+
import { useWindowResize, type WindowResizeResult } from '../composables/useWindowResize'
|
|
42
43
|
|
|
43
44
|
const touch = useTouch()
|
|
44
45
|
|
|
@@ -61,8 +62,8 @@ const anchors = computed(() => (props.anchors.length >= 2 ? props.anchors : [bou
|
|
|
61
62
|
|
|
62
63
|
const rootStyle = computed(() => {
|
|
63
64
|
const style: CSSProperties = {
|
|
64
|
-
height:
|
|
65
|
-
transform: `translateY(calc(100% + ${
|
|
65
|
+
height: unitConvert(boundary.value.max, 0, { output: 'px' }),
|
|
66
|
+
transform: `translateY(calc(100% + ${unitConvert(-heightValue.value, 0, { output: 'px' })}))`,
|
|
66
67
|
transition: !dragging.value ? `transform ${props.duration}ms cubic-bezier(0.18, 0.89, 0.32, 1.28)` : 'none'
|
|
67
68
|
}
|
|
68
69
|
|
|
@@ -129,10 +130,13 @@ watch(
|
|
|
129
130
|
{ immediate: true }
|
|
130
131
|
)
|
|
131
132
|
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
const syncWindowHeight = (res?: WindowResizeResult) => {
|
|
134
|
+
const resizeHeight = Number(res?.size?.windowHeight ?? res?.windowHeight)
|
|
135
|
+
const systemHeight = uni.getSystemInfoSync().windowHeight
|
|
136
|
+
windowHeight.value = Number.isFinite(resizeHeight) && resizeHeight > 0 ? resizeHeight : systemHeight
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
useWindowResize(syncWindowHeight, { immediate: true })
|
|
136
140
|
</script>
|
|
137
141
|
|
|
138
142
|
<style lang="scss" scoped>
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import type { ExtractPropTypes } from 'vue'
|
|
2
|
-
import { baseProps, makeArrayProp, makeBooleanProp, makeNumberProp,
|
|
2
|
+
import { baseProps, makeArrayProp, makeBooleanProp, makeNumberProp, truthProp } from '../common/props'
|
|
3
3
|
|
|
4
4
|
export const floatingPanelProps = {
|
|
5
5
|
...baseProps,
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* 面板当前高度
|
|
8
8
|
*/
|
|
9
9
|
height: makeNumberProp(0),
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* 拖拽吸附锚点列表
|
|
12
12
|
*/
|
|
13
13
|
anchors: makeArrayProp<number>(),
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* 是否预留底部安全区
|
|
16
16
|
*/
|
|
17
17
|
safeAreaInsetBottom: makeBooleanProp(false),
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* 内容区是否显示滚动条
|
|
20
20
|
*/
|
|
21
21
|
showScrollbar: truthProp,
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* 高度变化动画时长,单位毫秒
|
|
24
24
|
*/
|
|
25
|
-
duration:
|
|
25
|
+
duration: makeNumberProp(300),
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* 内容区是否允许拖拽
|
|
28
28
|
*/
|
|
29
29
|
contentDraggable: truthProp
|
|
30
30
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@import './../common/abstracts/_mixin.scss';
|
|
2
|
+
@import './../common/abstracts/variable.scss';
|
|
3
|
+
@include b(footer-wrapper) {
|
|
4
|
+
position: fixed;
|
|
5
|
+
bottom: 0;
|
|
6
|
+
left: 0;
|
|
7
|
+
width: 100%;
|
|
8
|
+
overflow: visible;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@include b(footer) {
|
|
12
|
+
overflow: visible;
|
|
13
|
+
padding: 0;
|
|
14
|
+
background-color: $--footer-bg;
|
|
15
|
+
@include e(content) {
|
|
16
|
+
overflow: visible;
|
|
17
|
+
padding: $--footer-padding;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="oxy-footer-placeholder" :style="{ height: placeholderHeight }"></view>
|
|
3
|
+
<view class="oxy-footer-wrapper">
|
|
4
|
+
<view :class="`oxy-footer ${customClass}`" :style="`background-color: ${backgroundColor};${customStyle}`">
|
|
5
|
+
<view class="oxy-footer__content" :style="contentStyle">
|
|
6
|
+
<slot></slot>
|
|
7
|
+
</view>
|
|
8
|
+
</view>
|
|
9
|
+
</view>
|
|
10
|
+
</template>
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
export default {
|
|
13
|
+
name: 'oxy-footer',
|
|
14
|
+
options: {
|
|
15
|
+
addGlobalClass: true,
|
|
16
|
+
virtualHost: true,
|
|
17
|
+
styleIsolation: 'shared'
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
import { getCurrentInstance, nextTick, onMounted, ref, computed, watch } from 'vue'
|
|
23
|
+
import { footerProps } from './types'
|
|
24
|
+
import { withDefaultUnit } from '../common/util'
|
|
25
|
+
import NodeInfo = UniNamespace.NodeInfo
|
|
26
|
+
|
|
27
|
+
const props = defineProps(footerProps)
|
|
28
|
+
|
|
29
|
+
// 占位高度
|
|
30
|
+
const placeholderHeight = ref('')
|
|
31
|
+
|
|
32
|
+
// 内容样式
|
|
33
|
+
const contentStyle = computed(() => {
|
|
34
|
+
const style: { height?: string } = {}
|
|
35
|
+
|
|
36
|
+
if (props.height && props.height != 0) {
|
|
37
|
+
style['height'] = withDefaultUnit(props.height)
|
|
38
|
+
}
|
|
39
|
+
return style
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
// 设置内容高度(rpx 语义)
|
|
43
|
+
function setHeight(val: number) {
|
|
44
|
+
const pxPer100Rpx = uni.upx2px(100)
|
|
45
|
+
const heightInRpx = pxPer100Rpx ? (val / pxPer100Rpx) * 100 : val * 2
|
|
46
|
+
placeholderHeight.value = `${heightInRpx}rpx`
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const { proxy } = getCurrentInstance()!
|
|
50
|
+
|
|
51
|
+
// 获取内容高度
|
|
52
|
+
function getHeight() {
|
|
53
|
+
nextTick(() => {
|
|
54
|
+
setTimeout(() => {
|
|
55
|
+
uni
|
|
56
|
+
.createSelectorQuery()
|
|
57
|
+
.in(proxy)
|
|
58
|
+
.select('.oxy-footer')
|
|
59
|
+
.boundingClientRect((res) => {
|
|
60
|
+
setHeight(Number((res as NodeInfo).height ?? 0))
|
|
61
|
+
})
|
|
62
|
+
.exec()
|
|
63
|
+
}, 0)
|
|
64
|
+
})
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
onMounted(() => {
|
|
68
|
+
getHeight()
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
watch([() => props.height, () => props.customStyle, () => props.customClass, () => props.backgroundColor], () => {
|
|
72
|
+
getHeight()
|
|
73
|
+
})
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<style lang="scss" scoped>
|
|
77
|
+
@import './index.scss';
|
|
78
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { baseProps, makeStringProp, makeNumberProp } from '../common/props'
|
|
2
|
+
|
|
3
|
+
export const footerProps = {
|
|
4
|
+
...baseProps,
|
|
5
|
+
/**
|
|
6
|
+
* 固定的内容高度
|
|
7
|
+
* 类型:number
|
|
8
|
+
* 默认值:'id'
|
|
9
|
+
*/
|
|
10
|
+
height: makeNumberProp(0),
|
|
11
|
+
/**
|
|
12
|
+
* 背景色
|
|
13
|
+
* 类型:string
|
|
14
|
+
* 默认值:''
|
|
15
|
+
*/
|
|
16
|
+
backgroundColor: makeStringProp('')
|
|
17
|
+
}
|
|
@@ -4,12 +4,33 @@ import type { FormItemRule } from '../oxy-form/types'
|
|
|
4
4
|
|
|
5
5
|
export const formItemProps = {
|
|
6
6
|
...baseProps,
|
|
7
|
+
/**
|
|
8
|
+
* 表单字段标识
|
|
9
|
+
*/
|
|
7
10
|
prop: makeRequiredProp(String),
|
|
11
|
+
/**
|
|
12
|
+
* 当前表单项校验规则
|
|
13
|
+
*/
|
|
8
14
|
rules: makeArrayProp<FormItemRule>(),
|
|
15
|
+
/**
|
|
16
|
+
* 是否必填
|
|
17
|
+
*/
|
|
9
18
|
required: Boolean,
|
|
19
|
+
/**
|
|
20
|
+
* 是否垂直居中
|
|
21
|
+
*/
|
|
10
22
|
center: makeBooleanProp(false),
|
|
23
|
+
/**
|
|
24
|
+
* 标签文案
|
|
25
|
+
*/
|
|
11
26
|
label: String,
|
|
12
|
-
|
|
27
|
+
/**
|
|
28
|
+
* 标签宽度
|
|
29
|
+
*/
|
|
30
|
+
labelWidth: makeStringProp('200rpx'),
|
|
31
|
+
/**
|
|
32
|
+
* 是否显示右箭头
|
|
33
|
+
*/
|
|
13
34
|
isLink: Boolean
|
|
14
35
|
}
|
|
15
36
|
|
|
@@ -15,7 +15,7 @@ export default {
|
|
|
15
15
|
|
|
16
16
|
<script setup lang="ts">
|
|
17
17
|
import { type CSSProperties, computed } from 'vue'
|
|
18
|
-
import {
|
|
18
|
+
import { withDefaultUnit, isDef, objToStyle } from '../common/util'
|
|
19
19
|
import { gapProps } from './types'
|
|
20
20
|
|
|
21
21
|
const props = defineProps(gapProps)
|
|
@@ -26,7 +26,7 @@ const rootStyle = computed(() => {
|
|
|
26
26
|
rootStyle['background'] = props.bgColor
|
|
27
27
|
}
|
|
28
28
|
if (isDef(props.height)) {
|
|
29
|
-
rootStyle['height'] =
|
|
29
|
+
rootStyle['height'] = withDefaultUnit(props.height)
|
|
30
30
|
}
|
|
31
31
|
return `${objToStyle(rootStyle)}${props.customStyle}`
|
|
32
32
|
})
|
|
@@ -73,7 +73,7 @@ watch(
|
|
|
73
73
|
)
|
|
74
74
|
|
|
75
75
|
const rootStyle = computed(() => {
|
|
76
|
-
return `${props.gutter ? 'padding-left:' + props.gutter + '
|
|
76
|
+
return `${props.gutter ? 'padding-left:' + props.gutter * 2 + 'rpx;' + 'padding-bottom:' + props.gutter * 2 + 'rpx;' : ''}${props.customStyle}`
|
|
77
77
|
})
|
|
78
78
|
|
|
79
79
|
const handleChildrenChange = debounce(() => {
|
|
@@ -37,7 +37,7 @@ import OxyBadge from '../oxy-badge/oxy-badge.vue'
|
|
|
37
37
|
import { onMounted, ref, watch, computed } from 'vue'
|
|
38
38
|
import { useParent } from '../composables/useParent'
|
|
39
39
|
import { GRID_KEY } from '../oxy-grid/types'
|
|
40
|
-
import { deepAssign, isDef, isUndefined, omitBy } from '../common/util'
|
|
40
|
+
import { withDefaultUnit, deepAssign, isDef, isUndefined, omitBy } from '../common/util'
|
|
41
41
|
import { gridItemProps } from './types'
|
|
42
42
|
import type { BadgeProps } from '../oxy-badge/types'
|
|
43
43
|
|
|
@@ -81,8 +81,9 @@ watch(
|
|
|
81
81
|
() => {
|
|
82
82
|
if (!grid) return
|
|
83
83
|
const width = grid.props.column ? 100 / grid.props.column + '%' : 100 / (childCount.value || 1) + '%'
|
|
84
|
+
const gutterSize = grid.props.gutter ? withDefaultUnit(grid.props.gutter) : ''
|
|
84
85
|
// 单独定义间隔
|
|
85
|
-
const gutterStyle =
|
|
86
|
+
const gutterStyle = gutterSize ? `padding:${gutterSize} ${gutterSize} 0 0; background-color: transparent;` : ''
|
|
86
87
|
// 单独定义正方形
|
|
87
88
|
const squareStyle = grid.props.square ? `background-color:transparent; padding-bottom: 0; padding-top:${width}` : ''
|
|
88
89
|
style.value = `width: ${width}; ${squareStyle || gutterStyle}`
|
|
@@ -101,14 +102,15 @@ function init() {
|
|
|
101
102
|
if (!grid) return
|
|
102
103
|
const children = grid.children
|
|
103
104
|
const width = grid.props.column ? 100 / grid.props.column + '%' : 100 / children.length + '%'
|
|
105
|
+
const gutterSize = grid.props.gutter ? withDefaultUnit(grid.props.gutter) : ''
|
|
104
106
|
// 单独定义间隔
|
|
105
|
-
const gutterStyle =
|
|
107
|
+
const gutterStyle = gutterSize ? `padding:${gutterSize} ${gutterSize} 0 0; background-color: transparent;` : ''
|
|
106
108
|
// 单独定义正方形
|
|
107
109
|
const squareStyle = grid.props.square ? `background-color:transparent; padding-bottom: 0; padding-top:${width}` : ''
|
|
108
110
|
// 间隔+正方形
|
|
109
111
|
gutterContentStyle.value =
|
|
110
|
-
|
|
111
|
-
? `right: ${
|
|
112
|
+
gutterSize && grid.props.square
|
|
113
|
+
? `right: ${gutterSize}; bottom:${gutterSize};height: auto; background-color: ${grid.props.bgColor}`
|
|
112
114
|
: `background-color: ${grid.props.bgColor}`
|
|
113
115
|
|
|
114
116
|
border.value = Boolean(grid.props.border)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
@import '../common/abstracts/variable';
|
|
2
|
+
@import '../common/abstracts/mixin';
|
|
3
|
+
|
|
4
|
+
@include b(guide){
|
|
5
|
+
z-index: 1001;
|
|
6
|
+
@include e(box) {
|
|
7
|
+
position: absolute;
|
|
8
|
+
z-index: 10001;
|
|
9
|
+
transition: all 0.2s;
|
|
10
|
+
|
|
11
|
+
&::before {
|
|
12
|
+
content: '';
|
|
13
|
+
box-sizing: content-box;
|
|
14
|
+
height: 100%;
|
|
15
|
+
width: 100%;
|
|
16
|
+
border: 1px dashed $-guide-highlight-border-color;
|
|
17
|
+
border-radius: $-guide-highlight-radius;
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: -8rpx;
|
|
20
|
+
left: -8rpx;
|
|
21
|
+
padding: 8rpx;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@include e(arrow) {
|
|
25
|
+
height: 20rpx;
|
|
26
|
+
width: 20rpx;
|
|
27
|
+
background: $-guide-tip-bg;
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 144rpx;
|
|
30
|
+
left: 45%;
|
|
31
|
+
z-index: 10000;
|
|
32
|
+
transform: rotate(45deg);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@include e(tips) {
|
|
36
|
+
width: 400rpx;
|
|
37
|
+
box-shadow: $-guide-tip-shadow;
|
|
38
|
+
color: $-guide-tip-color;
|
|
39
|
+
position: absolute;
|
|
40
|
+
top: 152rpx;
|
|
41
|
+
z-index: 10001;
|
|
42
|
+
padding: 16rpx 20rpx;
|
|
43
|
+
font-size: $-fs-content;
|
|
44
|
+
border-radius: $-guide-tip-radius;
|
|
45
|
+
text-align: justify;
|
|
46
|
+
|
|
47
|
+
@include e(tool-btn) {
|
|
48
|
+
display: flex;
|
|
49
|
+
justify-content: space-between;
|
|
50
|
+
align-items: center;
|
|
51
|
+
padding-right: 0;
|
|
52
|
+
margin-top: 20rpx;
|
|
53
|
+
|
|
54
|
+
@include e(next) {
|
|
55
|
+
background: $-guide-tip-action-bg;
|
|
56
|
+
height: 48rpx;
|
|
57
|
+
width: 100rpx;
|
|
58
|
+
text-align: center;
|
|
59
|
+
border-radius: $-guide-tip-action-radius;
|
|
60
|
+
color: $-guide-tip-action-color;
|
|
61
|
+
line-height: 48rpx;
|
|
62
|
+
font-size: $-fs-secondary;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
@include e(model) {
|
|
68
|
+
position: fixed;
|
|
69
|
+
left: 0;
|
|
70
|
+
top: 0;
|
|
71
|
+
width: 100%;
|
|
72
|
+
height: 100%;
|
|
73
|
+
z-index: 1000;
|
|
74
|
+
}
|
|
75
|
+
}
|