oxy-uni-ui 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/components/common/abstracts/variable.scss +396 -321
- package/components/common/path.ts +9 -0
- package/components/common/util.ts +200 -5
- package/components/composables/index.ts +1 -0
- package/components/composables/useGlobalLoading.ts +42 -0
- package/components/composables/useGlobalMessage.ts +48 -0
- package/components/composables/useGlobalToast.ts +84 -0
- package/components/composables/usePopover.ts +24 -20
- package/components/composables/useVirtualScroll.ts +13 -11
- package/components/composables/useWindowResize.ts +35 -0
- package/components/oxy-action-sheet/index.scss +24 -11
- package/components/oxy-action-sheet/oxy-action-sheet.vue +27 -19
- package/components/oxy-action-sheet/types.ts +7 -0
- package/components/oxy-backtop/index.scss +3 -3
- package/components/oxy-backtop/oxy-backtop.vue +9 -6
- package/components/oxy-backtop/types.ts +7 -7
- package/components/oxy-badge/index.scss +4 -4
- package/components/oxy-badge/oxy-badge.vue +3 -3
- package/components/oxy-badge/types.ts +2 -2
- package/components/oxy-button/index.scss +5 -5
- package/components/oxy-button/oxy-button.vue +5 -1
- package/components/oxy-calendar/index.scss +11 -11
- package/components/oxy-calendar/oxy-calendar.vue +1 -0
- package/components/oxy-calendar/types.ts +5 -0
- package/components/oxy-calendar-view/month/index.scss +4 -4
- package/components/oxy-calendar-view/month/types.ts +36 -0
- package/components/oxy-calendar-view/monthPanel/index.scss +7 -7
- package/components/oxy-calendar-view/monthPanel/month-panel.vue +14 -8
- package/components/oxy-calendar-view/year/index.scss +4 -4
- package/components/oxy-calendar-view/yearPanel/index.scss +4 -4
- package/components/oxy-calendar-view/yearPanel/year-panel.vue +21 -5
- package/components/oxy-card/index.scss +2 -2
- package/components/oxy-cell/index.scss +8 -8
- package/components/oxy-cell/oxy-cell.vue +15 -2
- package/components/oxy-cell/types.ts +4 -0
- package/components/oxy-checkbox/index.scss +8 -8
- package/components/oxy-checkbox/oxy-checkbox.vue +2 -2
- package/components/oxy-checkbox-group/index.scss +2 -2
- package/components/oxy-circle/oxy-circle.vue +10 -7
- package/components/oxy-circle/types.ts +5 -5
- package/components/oxy-col/oxy-col.vue +2 -2
- package/components/oxy-col-picker/index.scss +4 -4
- package/components/oxy-col-picker/oxy-col-picker.vue +9 -5
- package/components/oxy-col-picker/types.ts +12 -3
- package/components/oxy-collapse/index.scss +2 -2
- package/components/oxy-collapse-item/oxy-collapse-item.vue +3 -3
- package/components/oxy-corner/index.scss +32 -32
- package/components/oxy-corner/oxy-corner.vue +15 -3
- package/components/oxy-corner/types.ts +15 -1
- package/components/oxy-count-to/oxy-count-to.vue +3 -3
- package/components/oxy-curtain/index.scss +15 -15
- package/components/oxy-curtain/oxy-curtain.vue +4 -2
- package/components/oxy-curtain/types.ts +6 -1
- package/components/oxy-date-strip/index.scss +10 -0
- package/components/oxy-date-strip/oxy-date-strip.vue +198 -0
- package/components/oxy-date-strip/types.ts +98 -0
- package/components/oxy-date-strip/utils.ts +67 -0
- package/components/oxy-date-strip-item/index.scss +94 -0
- package/components/oxy-date-strip-item/oxy-date-strip-item.vue +102 -0
- package/components/oxy-date-strip-item/types.ts +53 -0
- package/components/oxy-datetime-picker/index.scss +11 -11
- package/components/oxy-datetime-picker/oxy-datetime-picker.vue +4 -1
- package/components/oxy-datetime-picker/types.ts +10 -1
- package/components/oxy-drop-menu/index.scss +3 -3
- package/components/oxy-drop-menu/oxy-drop-menu.vue +3 -3
- package/components/oxy-drop-menu-item/index.scss +1 -1
- package/components/oxy-drop-menu-item/oxy-drop-menu-item.vue +4 -3
- package/components/oxy-drop-menu-item/types.ts +5 -0
- package/components/oxy-echarts/index.scss +17 -0
- package/components/oxy-echarts/index.ts +1 -0
- package/components/oxy-echarts/oxy-echarts.vue +32 -0
- package/components/oxy-echarts/types.ts +18 -0
- package/components/oxy-fab/index.scss +8 -8
- package/components/oxy-fab/oxy-fab.vue +22 -3
- package/components/oxy-file-list/index.scss +42 -15
- package/components/oxy-file-list/oxy-file-list.vue +208 -34
- package/components/oxy-file-list/types.ts +58 -2
- package/components/oxy-floating-panel/oxy-floating-panel.vue +13 -9
- package/components/oxy-floating-panel/{type.ts → types.ts} +8 -8
- package/components/oxy-footer/index.scss +19 -0
- package/components/oxy-footer/oxy-footer.vue +78 -0
- package/components/oxy-footer/types.ts +17 -0
- package/components/oxy-form-item/types.ts +22 -1
- package/components/oxy-gap/oxy-gap.vue +2 -2
- package/components/oxy-gap/types.ts +2 -2
- package/components/oxy-global-loading/oxy-global-loading.vue +53 -0
- package/components/oxy-global-message/oxy-global-message.vue +64 -0
- package/components/oxy-global-toast/oxy-global-toast.vue +53 -0
- package/components/oxy-grid/oxy-grid.vue +1 -1
- package/components/oxy-grid/types.ts +1 -1
- package/components/oxy-grid-item/index.scss +1 -1
- package/components/oxy-grid-item/oxy-grid-item.vue +7 -5
- package/components/oxy-grid-item/types.ts +1 -1
- package/components/oxy-guidance/index.scss +75 -0
- package/components/oxy-guidance/oxy-guidance.vue +201 -0
- package/components/oxy-guidance/types.ts +33 -0
- package/components/oxy-icon/oxy-icon.vue +2 -2
- package/components/oxy-icon/types.ts +1 -1
- package/components/oxy-img/oxy-img.vue +4 -4
- package/components/oxy-img/types.ts +3 -3
- package/components/oxy-img-cropper/index.scss +12 -12
- package/components/oxy-img-cropper/oxy-img-cropper.vue +97 -52
- package/components/oxy-img-cropper/types.ts +2 -2
- package/components/oxy-img-lazy/index.scss +17 -0
- package/components/oxy-img-lazy/oxy-img-lazy.vue +332 -0
- package/components/oxy-img-lazy/types.ts +69 -0
- package/components/oxy-index-anchor/index.scss +2 -2
- package/components/oxy-index-anchor/oxy-index-anchor.vue +2 -2
- package/components/oxy-index-anchor/{type.ts → types.ts} +3 -0
- package/components/oxy-index-bar/index.scss +3 -3
- package/components/oxy-index-bar/oxy-index-bar.vue +3 -3
- package/components/oxy-index-bar/{type.ts → types.ts} +2 -2
- package/components/oxy-input/index.scss +1 -1
- package/components/oxy-input-number/index.scss +5 -5
- package/components/oxy-input-number/oxy-input-number.vue +2 -2
- package/components/oxy-input-number/types.ts +3 -2
- package/components/oxy-keyboard/index.scss +5 -5
- package/components/oxy-keyboard/key/index.scss +3 -3
- package/components/oxy-keyboard/key/index.vue +2 -2
- package/components/oxy-keyboard/key/types.ts +15 -0
- package/components/oxy-keyboard/oxy-keyboard.vue +1 -0
- package/components/oxy-keyboard/types.ts +5 -0
- package/components/oxy-link/index.scss +57 -0
- package/components/oxy-link/oxy-link.vue +130 -0
- package/components/oxy-link/types.ts +81 -0
- package/components/oxy-list/index.scss +7 -1
- package/components/oxy-list/oxy-list.vue +4 -3
- package/components/oxy-list/types.ts +1 -1
- package/components/oxy-loading/oxy-loading.vue +8 -4
- package/components/oxy-loading/types.ts +1 -1
- package/components/oxy-loadmore/index.scss +3 -3
- package/components/oxy-long-press-menu/index.scss +93 -0
- package/components/oxy-long-press-menu/oxy-long-press-menu.vue +338 -0
- package/components/oxy-long-press-menu/types.ts +34 -0
- package/components/oxy-message-box/index.scss +12 -11
- package/components/oxy-message-box/oxy-message-box.vue +11 -3
- package/components/oxy-message-box/types.ts +14 -0
- package/components/oxy-navbar/index.scss +2 -2
- package/components/oxy-navbar/oxy-navbar.vue +58 -13
- package/components/oxy-navbar/types.ts +8 -1
- package/components/oxy-navbar-capsule/types.ts +3 -0
- package/components/oxy-notice-bar/index.scss +3 -3
- package/components/oxy-notice-bar/oxy-notice-bar.vue +9 -5
- package/components/oxy-notice-bar/types.ts +3 -3
- package/components/oxy-notify/index.ts +1 -0
- package/components/oxy-notify/oxy-notify.vue +3 -2
- package/components/oxy-notify/types.ts +7 -0
- package/components/oxy-pagination/index.scss +1 -1
- package/components/oxy-password-input/oxy-password-input.vue +2 -2
- package/components/oxy-password-input/types.ts +1 -1
- package/components/oxy-picker/index.scss +45 -2
- package/components/oxy-picker/oxy-picker.vue +103 -14
- package/components/oxy-picker/types.ts +33 -1
- package/components/oxy-picker-view/index.scss +3 -3
- package/components/oxy-picker-view/oxy-picker-view.vue +4 -4
- package/components/oxy-popover/index.scss +9 -9
- package/components/oxy-popup/index.scss +2 -2
- package/components/oxy-popup/oxy-popup.vue +35 -2
- package/components/oxy-popup/types.ts +8 -1
- package/components/oxy-progress/index.scss +3 -3
- package/components/oxy-qrcode/draw.ts +398 -0
- package/components/oxy-qrcode/index.scss +2 -0
- package/components/oxy-qrcode/oxy-qrcode.vue +124 -0
- package/components/oxy-qrcode/qrcode.ts +936 -0
- package/components/oxy-qrcode/types.ts +42 -0
- package/components/oxy-radio/index.scss +13 -13
- package/components/oxy-radio/oxy-radio.vue +1 -1
- package/components/oxy-radio-group/index.scss +2 -2
- package/components/oxy-rate/types.ts +4 -4
- package/components/oxy-resize/index.scss +2 -2
- package/components/oxy-resize/oxy-resize.vue +4 -4
- package/components/oxy-resize/types.ts +3 -0
- package/components/oxy-rich-text/icon/emjio.svg +1 -0
- package/components/oxy-rich-text/icon/quote.svg +1 -0
- package/components/oxy-rich-text/icon/text.svg +1 -0
- package/components/oxy-rich-text/icon/title.svg +1 -0
- package/components/oxy-rich-text/index.scss +160 -0
- package/components/oxy-rich-text/mp-html/card/card.vue +122 -0
- package/components/oxy-rich-text/mp-html/card/index.js +7 -0
- package/components/oxy-rich-text/mp-html/editable/config.js +15 -0
- package/components/oxy-rich-text/mp-html/editable/index.js +553 -0
- package/components/oxy-rich-text/mp-html/emoji/index.js +203 -0
- package/components/oxy-rich-text/mp-html/highlight/config.js +5 -0
- package/components/oxy-rich-text/mp-html/highlight/index.js +96 -0
- package/components/oxy-rich-text/mp-html/highlight/prism.css +1 -0
- package/components/oxy-rich-text/mp-html/highlight/prism.min.js +7 -0
- package/components/oxy-rich-text/mp-html/img-cache/index.js +138 -0
- package/components/oxy-rich-text/mp-html/latex/index.js +80 -0
- package/components/oxy-rich-text/mp-html/latex/katex.css +1 -0
- package/components/oxy-rich-text/mp-html/latex/katex.min.js +1 -0
- package/components/oxy-rich-text/mp-html/markdown/index.js +50 -0
- package/components/oxy-rich-text/mp-html/markdown/marked.min.js +71 -0
- package/components/oxy-rich-text/mp-html/mp-html.d.ts +184 -0
- package/components/oxy-rich-text/mp-html/mp-html.vue +684 -0
- package/components/oxy-rich-text/mp-html/node/node.vue +1172 -0
- package/components/oxy-rich-text/mp-html/parser.js +1428 -0
- package/components/oxy-rich-text/mp-html/search/index.js +132 -0
- package/components/oxy-rich-text/mp-html/style/index.js +129 -0
- package/components/oxy-rich-text/mp-html/style/parser.js +175 -0
- package/components/oxy-rich-text/mp-html/template/index.js +67 -0
- package/components/oxy-rich-text/mp-html/txv-video/index.js +46 -0
- package/components/oxy-rich-text/oxy-rich-text.vue +642 -0
- package/components/oxy-rich-text/types.ts +76 -0
- package/components/oxy-row/oxy-row.vue +3 -3
- package/components/oxy-row/types.ts +1 -1
- package/components/oxy-search/index.scss +3 -3
- package/components/oxy-segmented/index.scss +16 -16
- package/components/oxy-segmented/oxy-segmented.vue +23 -3
- package/components/oxy-select/index.scss +331 -0
- package/components/oxy-select/oxy-select.vue +456 -0
- package/components/oxy-select/types.ts +83 -0
- package/components/oxy-select-picker/index.scss +7 -7
- package/components/oxy-select-picker/oxy-select-picker.vue +4 -0
- package/components/oxy-select-picker/types.ts +7 -1
- package/components/oxy-sidebar-item/index.scss +1 -1
- package/components/oxy-signature/oxy-signature.vue +18 -10
- package/components/oxy-signature/types.ts +106 -13
- package/components/oxy-skeleton/oxy-skeleton.vue +6 -6
- package/components/oxy-skeleton/types.ts +1 -1
- package/components/oxy-slider/index.scss +3 -3
- package/components/oxy-sort-button/index.scss +8 -8
- package/components/oxy-status-tip/index.scss +4 -4
- package/components/oxy-status-tip/oxy-status-tip.vue +5 -5
- package/components/oxy-status-tip/types.ts +3 -3
- package/components/oxy-step/index.scss +14 -14
- package/components/oxy-sticky/oxy-sticky.vue +6 -6
- package/components/oxy-stream-render/index.scss +6 -0
- package/components/oxy-stream-render/oxy-stream-render.vue +204 -0
- package/components/oxy-stream-render/types.ts +8 -0
- package/components/oxy-swipe-action/oxy-swipe-action.vue +27 -2
- package/components/oxy-swiper/oxy-swiper.vue +6 -6
- package/components/oxy-swiper/types.ts +5 -5
- package/components/oxy-switch/index.scss +8 -8
- package/components/oxy-switch/oxy-switch.vue +2 -2
- package/components/oxy-switch/types.ts +1 -1
- package/components/oxy-tab/index.scss +11 -1
- package/components/oxy-tabbar/index.scss +1 -1
- package/components/oxy-tabbar/oxy-tabbar.vue +39 -10
- package/components/oxy-table/index.scss +5 -5
- package/components/oxy-table/oxy-table.vue +8 -6
- package/components/oxy-table/types.ts +2 -2
- package/components/oxy-table-col/oxy-table-col.vue +3 -3
- package/components/oxy-table-col/types.ts +2 -2
- package/components/oxy-tabs/index.scss +43 -15
- package/components/oxy-tabs/oxy-tabs.vue +53 -19
- package/components/oxy-tabs/types.ts +15 -3
- package/components/oxy-tag/index.scss +15 -15
- package/components/oxy-text/index.scss +5 -1
- package/components/oxy-text/oxy-text.vue +76 -7
- package/components/oxy-text/types.ts +12 -0
- package/components/oxy-textarea/index.scss +6 -6
- package/components/oxy-toast/oxy-toast.vue +24 -8
- package/components/oxy-tooltip/index.scss +9 -9
- package/components/oxy-tree/index.scss +61 -9
- package/components/oxy-tree/oxy-tree.vue +102 -17
- package/components/oxy-tree/types.ts +23 -10
- package/components/oxy-upload/index.scss +21 -21
- package/components/oxy-upload/types.ts +2 -2
- package/components/oxy-verification-code/index.scss +6 -0
- package/components/oxy-verification-code/oxy-verification-code.vue +187 -0
- package/components/oxy-verification-code/types.ts +82 -0
- package/components/oxy-video-preview/index.scss +4 -4
- package/components/oxy-virtual-scroll/index.scss +4 -4
- package/components/oxy-virtual-scroll/oxy-virtual-scroll.vue +11 -7
- package/components/oxy-virtual-scroll/types.ts +14 -14
- package/components/oxy-voice-player/index.scss +908 -0
- package/components/oxy-voice-player/oxy-voice-player.vue +821 -0
- package/components/oxy-voice-player/types.ts +567 -0
- package/components/oxy-waterfall/index.scss +18 -0
- package/components/oxy-waterfall/oxy-waterfall.vue +218 -0
- package/components/oxy-waterfall/types.ts +90 -0
- package/components/oxy-waterfall-item/index.scss +8 -0
- package/components/oxy-waterfall-item/oxy-waterfall-item.vue +89 -0
- package/components/oxy-waterfall-item/types.ts +16 -0
- package/components/oxy-watermark/oxy-watermark.vue +35 -13
- package/components/oxy-watermark/types.ts +14 -14
- package/global.d.ts +9 -0
- package/index.ts +3 -0
- package/locale/lang/ar-SA.ts +3 -0
- package/locale/lang/en-US.ts +29 -0
- package/locale/lang/zh-CN.ts +29 -0
- package/package.json +97 -1
- package/tags.json +1 -1
- package/uni-echarts/changelog.md +2 -0
- package/uni-echarts/components/index.js +1 -0
- package/uni-echarts/components/uni-echarts/events.js +95 -0
- package/uni-echarts/components/uni-echarts/types.d.ts +183 -0
- package/uni-echarts/components/uni-echarts/types.js +1 -0
- package/uni-echarts/components/uni-echarts/uni-echarts.vue +530 -0
- package/uni-echarts/components/uni-echarts/uni-echarts.vue.d.ts +19 -0
- package/uni-echarts/global.d.ts +7 -0
- package/uni-echarts/index.d.ts +440 -0
- package/uni-echarts/index.js +2 -0
- package/uni-echarts/package.json +105 -0
- package/uni-echarts/shared-core.d.ts +269 -0
- package/uni-echarts/shared-core.js +900 -0
- package/web-types.json +1 -1
- package/components/oxy-number-keyboard/index.scss +0 -78
- package/components/oxy-number-keyboard/key/index.scss +0 -81
- package/components/oxy-number-keyboard/key/index.vue +0 -78
- package/components/oxy-number-keyboard/key/types.ts +0 -11
- package/components/oxy-number-keyboard/oxy-number-keyboard.vue +0 -151
- package/components/oxy-number-keyboard/types.ts +0 -83
- package/components/oxy-tree/components/tree-node-content.vue +0 -72
- package/components/oxy-tree/index.ts +0 -51
|
@@ -18,7 +18,7 @@ export default {
|
|
|
18
18
|
import { computed, type CSSProperties } from 'vue'
|
|
19
19
|
import { useChildren } from '../composables/useChildren'
|
|
20
20
|
import { ROW_KEY, rowProps } from './types'
|
|
21
|
-
import {
|
|
21
|
+
import { withDefaultUnit, objToStyle } from '../common/util'
|
|
22
22
|
|
|
23
23
|
const props = defineProps(rowProps)
|
|
24
24
|
const { linkChildren } = useChildren(ROW_KEY)
|
|
@@ -31,8 +31,8 @@ const rowStyle = computed(() => {
|
|
|
31
31
|
if (gutter < 0) {
|
|
32
32
|
console.error('[Oxy ui] warning(oxy-row): attribute gutter must be greater than or equal to 0')
|
|
33
33
|
} else if (gutter) {
|
|
34
|
-
style.marginLeft =
|
|
35
|
-
style.marginRight =
|
|
34
|
+
style.marginLeft = withDefaultUnit(gutter / 2)
|
|
35
|
+
style.marginRight = withDefaultUnit(gutter / 2)
|
|
36
36
|
}
|
|
37
37
|
return `${objToStyle(style)}${props.customStyle}`
|
|
38
38
|
})
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
align-items: center;
|
|
98
98
|
}
|
|
99
99
|
@include edeep(search-icon) {
|
|
100
|
-
margin-right:
|
|
100
|
+
margin-right: 16rpx;
|
|
101
101
|
color: $-search-icon-color;
|
|
102
102
|
font-size: $-search-icon-size;
|
|
103
103
|
}
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
position: absolute;
|
|
106
106
|
font-size: $-search-icon-size;
|
|
107
107
|
top: 50%;
|
|
108
|
-
left:
|
|
108
|
+
left: 32rpx;
|
|
109
109
|
transform: translateY(-50%);
|
|
110
110
|
color: $-search-icon-color;
|
|
111
111
|
}
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
@include edeep(clear) {
|
|
117
117
|
position: absolute;
|
|
118
118
|
right: 0;
|
|
119
|
-
padding:
|
|
119
|
+
padding: 12rpx 18rpx 12rpx 14rpx;
|
|
120
120
|
color: $-search-cancel-color;
|
|
121
121
|
}
|
|
122
122
|
@include edeep(clear-icon) {
|
|
@@ -40,21 +40,21 @@
|
|
|
40
40
|
width: 100%;
|
|
41
41
|
background-color: $-segmented-item-bg-color;
|
|
42
42
|
padding: $-segmented-padding;
|
|
43
|
-
border-radius:
|
|
43
|
+
border-radius: 8rpx;
|
|
44
44
|
box-sizing: border-box;
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
@include e(item) {
|
|
48
48
|
position: relative;
|
|
49
49
|
text-align: center;
|
|
50
|
-
border-radius:
|
|
50
|
+
border-radius: 8rpx;
|
|
51
51
|
flex: 1;
|
|
52
52
|
min-width: 0;
|
|
53
53
|
z-index: 1;
|
|
54
|
-
min-height:
|
|
55
|
-
line-height:
|
|
56
|
-
padding: 0
|
|
57
|
-
font-size:
|
|
54
|
+
min-height: 56rpx;
|
|
55
|
+
line-height: 56rpx;
|
|
56
|
+
padding: 0 24rpx;
|
|
57
|
+
font-size: 28rpx;
|
|
58
58
|
color: $-segmented-item-color;
|
|
59
59
|
font-weight: 400;
|
|
60
60
|
|
|
@@ -63,18 +63,18 @@
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
@include when(large) {
|
|
66
|
-
min-height:
|
|
67
|
-
line-height:
|
|
68
|
-
padding: 0
|
|
69
|
-
font-size:
|
|
66
|
+
min-height: 64rpx;
|
|
67
|
+
line-height: 64rpx;
|
|
68
|
+
padding: 0 24rpx;
|
|
69
|
+
font-size: 32rpx;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
@include when(small) {
|
|
74
|
-
min-height:
|
|
75
|
-
line-height:
|
|
76
|
-
padding: 0
|
|
77
|
-
font-size:
|
|
74
|
+
min-height: 48rpx;
|
|
75
|
+
line-height: 48rpx;
|
|
76
|
+
padding: 0 14rpx;
|
|
77
|
+
font-size: 24rpx;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
@include when(disabled) {
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
|
|
85
85
|
@include m(active) {
|
|
86
86
|
background-color: $-segmented-item-acitve-bg;
|
|
87
|
-
border-radius:
|
|
87
|
+
border-radius: 8rpx;
|
|
88
88
|
height: calc(100% - $-segmented-padding * 2);
|
|
89
89
|
@include when(disabled) {
|
|
90
90
|
opacity: 0.8;
|
|
@@ -98,4 +98,4 @@
|
|
|
98
98
|
text-overflow: ellipsis;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
}
|
|
101
|
+
}
|
|
@@ -32,9 +32,10 @@ export default {
|
|
|
32
32
|
|
|
33
33
|
<script setup lang="ts">
|
|
34
34
|
import { computed, getCurrentInstance, onMounted, reactive, watch } from 'vue'
|
|
35
|
-
import { getRect, isObj, objToStyle,
|
|
35
|
+
import { getRect, isObj, objToStyle, pause, isEqual, unitConvert } from '../common/util'
|
|
36
36
|
import type { CSSProperties } from 'vue'
|
|
37
37
|
import { segmentedProps, type SegmentedExpose, type SegmentedOption } from './types'
|
|
38
|
+
import { useWindowResize } from '../composables/useWindowResize'
|
|
38
39
|
const $item = '.oxy-segmented__item'
|
|
39
40
|
|
|
40
41
|
const props = defineProps(segmentedProps)
|
|
@@ -63,7 +64,24 @@ watch(
|
|
|
63
64
|
}
|
|
64
65
|
)
|
|
65
66
|
|
|
67
|
+
watch(
|
|
68
|
+
() => props.options,
|
|
69
|
+
async () => {
|
|
70
|
+
updateCurrentIndex()
|
|
71
|
+
await pause()
|
|
72
|
+
updateActiveStyle(false)
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
deep: true
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
|
|
66
79
|
const { proxy } = getCurrentInstance() as any
|
|
80
|
+
const handleWindowResize = async () => {
|
|
81
|
+
await pause()
|
|
82
|
+
updateActiveStyle(false)
|
|
83
|
+
}
|
|
84
|
+
useWindowResize(handleWindowResize)
|
|
67
85
|
|
|
68
86
|
onMounted(async () => {
|
|
69
87
|
updateCurrentIndex()
|
|
@@ -77,15 +95,17 @@ onMounted(async () => {
|
|
|
77
95
|
*/
|
|
78
96
|
function updateActiveStyle(animation: boolean = true) {
|
|
79
97
|
getRect($item, true, proxy).then((rects) => {
|
|
98
|
+
if (!Array.isArray(rects) || rects.length === 0 || !rects[state.activeIndex]) return
|
|
80
99
|
const rect = rects[state.activeIndex]
|
|
81
100
|
const style: CSSProperties = {
|
|
82
101
|
position: 'absolute',
|
|
83
|
-
|
|
102
|
+
// getRect 返回的是真实像素值,需按 px 输出避免宽屏下激活块尺寸偏大
|
|
103
|
+
width: unitConvert(rect.width, 0, { output: 'px' }),
|
|
84
104
|
'z-index': 0
|
|
85
105
|
}
|
|
86
106
|
const left = rects.slice(0, state.activeIndex).reduce((prev, curr) => prev + Number(curr.width), 0)
|
|
87
107
|
if (left) {
|
|
88
|
-
style.transform = `translateX(${left}
|
|
108
|
+
style.transform = `translateX(${unitConvert(left, 0, { output: 'px' })})`
|
|
89
109
|
}
|
|
90
110
|
if (animation) {
|
|
91
111
|
style.transition = 'all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
@import '../common/abstracts/variable';
|
|
2
|
+
@import '../common/abstracts/mixin';
|
|
3
|
+
|
|
4
|
+
@include b(select) {
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
width: 100%;
|
|
8
|
+
flex: 1;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
position: relative;
|
|
11
|
+
text-align: left;
|
|
12
|
+
.oxy-select__label {
|
|
13
|
+
margin: auto 0;
|
|
14
|
+
color: $-cell-title-color;
|
|
15
|
+
margin-right: $-cell-padding;
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
font-size: $-input-fs;
|
|
18
|
+
}
|
|
19
|
+
.oxy-select__icon {
|
|
20
|
+
position: absolute;
|
|
21
|
+
right: 0;
|
|
22
|
+
font-size: $-input-icon-size;
|
|
23
|
+
color: $-input-icon-color;
|
|
24
|
+
}
|
|
25
|
+
.oxy-select__icon-clear {
|
|
26
|
+
color: $-input-clear-color;
|
|
27
|
+
}
|
|
28
|
+
.oxy-select__icon-arrow {
|
|
29
|
+
transition: transform .2s;
|
|
30
|
+
}
|
|
31
|
+
.oxy-select__icon-arrow.is-open {
|
|
32
|
+
transform: rotate(180deg);
|
|
33
|
+
}
|
|
34
|
+
.oxy-select__box {
|
|
35
|
+
width: 100%;
|
|
36
|
+
flex: 1;
|
|
37
|
+
}
|
|
38
|
+
.oxy-select__wrapper {
|
|
39
|
+
font-size: $-input-fs;
|
|
40
|
+
color: $-input-color;
|
|
41
|
+
border: 1px solid $-color-border;
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
border-radius: 8rpx;
|
|
44
|
+
padding: 0 $-input-cell-padding;
|
|
45
|
+
position: relative;
|
|
46
|
+
/* #ifndef APP-NVUE */
|
|
47
|
+
display: flex;
|
|
48
|
+
user-select: none;
|
|
49
|
+
/* #endif */
|
|
50
|
+
flex-direction: row;
|
|
51
|
+
width: 100%;
|
|
52
|
+
flex: 1;
|
|
53
|
+
min-height: $-input-inner-height;
|
|
54
|
+
transition: all 0.2s;
|
|
55
|
+
|
|
56
|
+
&:hover:not(.is-disabled):not(.is-readonly) {
|
|
57
|
+
border-color: $-color-theme;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&.is-focus:not(.is-disabled):not(.is-readonly) {
|
|
61
|
+
border-color: $-color-theme;
|
|
62
|
+
box-shadow: 0 0 0 4rpx rgba($-color-theme, 0.1);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.is-disabled {
|
|
66
|
+
background-color: $-color-bg;
|
|
67
|
+
border-color: $-color-border-light;
|
|
68
|
+
cursor: not-allowed;
|
|
69
|
+
color: $-color-tip;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&.is-readonly {
|
|
73
|
+
background-color: transparent;
|
|
74
|
+
border-color: transparent;
|
|
75
|
+
padding: 0;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
.oxy-select__input-box {
|
|
79
|
+
width: 100%;
|
|
80
|
+
position: relative;
|
|
81
|
+
/* #ifndef APP-NVUE */
|
|
82
|
+
display: flex;
|
|
83
|
+
/* #endif */
|
|
84
|
+
flex: 1;
|
|
85
|
+
flex-direction: row;
|
|
86
|
+
align-items: center;
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.oxy-select__tags {
|
|
91
|
+
width: 100%;
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-wrap: wrap;
|
|
94
|
+
padding: 8rpx 0;
|
|
95
|
+
|
|
96
|
+
&-item {
|
|
97
|
+
font-size: 24rpx;
|
|
98
|
+
border-radius: 8rpx;
|
|
99
|
+
white-space: nowrap;
|
|
100
|
+
height: 48rpx;
|
|
101
|
+
padding: 0 16rpx;
|
|
102
|
+
line-height: 44rpx;
|
|
103
|
+
box-sizing: border-box;
|
|
104
|
+
margin: 4rpx 8rpx 4rpx 0;
|
|
105
|
+
display: flex;
|
|
106
|
+
max-width: 100%;
|
|
107
|
+
align-items: center;
|
|
108
|
+
background-color: $-color-bg;
|
|
109
|
+
border: 1px solid $-color-border-light;
|
|
110
|
+
color: $-color-secondary;
|
|
111
|
+
transition: all 0.2s;
|
|
112
|
+
|
|
113
|
+
&:hover {
|
|
114
|
+
border-color: $-color-theme;
|
|
115
|
+
color: $-color-theme;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&-text {
|
|
119
|
+
font-size: 24rpx;
|
|
120
|
+
white-space: nowrap;
|
|
121
|
+
line-height: 44rpx;
|
|
122
|
+
overflow: hidden;
|
|
123
|
+
text-overflow: ellipsis;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
.oxy-select__icon-error{
|
|
127
|
+
margin-left: 8rpx;
|
|
128
|
+
font-size: 28rpx;
|
|
129
|
+
color: $-color-aid;
|
|
130
|
+
cursor: pointer;
|
|
131
|
+
|
|
132
|
+
&:hover {
|
|
133
|
+
color: $-color-danger;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.oxy-select__input {
|
|
139
|
+
flex: 1;
|
|
140
|
+
font-size: $-fs-content;
|
|
141
|
+
height: 44rpx;
|
|
142
|
+
line-height: 44rpx;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.oxy-select__input-plac {
|
|
146
|
+
color: $-color-tip;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.oxy-select__selector__down {
|
|
150
|
+
top: calc(100% + 24rpx);
|
|
151
|
+
|
|
152
|
+
.oxy-select__selector-arrow {
|
|
153
|
+
transform: rotateX(0deg);
|
|
154
|
+
top: -12rpx;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.oxy-select__selector__upwards {
|
|
159
|
+
bottom: calc(100% + 24rpx);
|
|
160
|
+
|
|
161
|
+
.oxy-select__selector-arrow {
|
|
162
|
+
transform: rotateX(180deg);
|
|
163
|
+
bottom: -12rpx;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.oxy-select__selector {
|
|
168
|
+
/* #ifndef APP-NVUE */
|
|
169
|
+
box-sizing: border-box;
|
|
170
|
+
/* #endif */
|
|
171
|
+
position: absolute;
|
|
172
|
+
left: 0;
|
|
173
|
+
width: 100%;
|
|
174
|
+
background-color: $-color-white;
|
|
175
|
+
border: 1px solid $-color-border-light;
|
|
176
|
+
border-radius: 16rpx;
|
|
177
|
+
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.1);
|
|
178
|
+
z-index: 100;
|
|
179
|
+
padding: 12rpx 0;
|
|
180
|
+
overflow: hidden;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.oxy-select__selector-scroll {
|
|
184
|
+
/* #ifndef APP-NVUE */
|
|
185
|
+
max-height: 480rpx;
|
|
186
|
+
box-sizing: border-box;
|
|
187
|
+
/* #endif */
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.oxy-select__selector-empty,
|
|
191
|
+
.oxy-select__selector-item {
|
|
192
|
+
/* #ifndef APP-NVUE */
|
|
193
|
+
display: flex;
|
|
194
|
+
/* #endif */
|
|
195
|
+
min-height: 80rpx;
|
|
196
|
+
line-height: 1.4;
|
|
197
|
+
font-size: $-fs-content;
|
|
198
|
+
padding: 16rpx 32rpx;
|
|
199
|
+
box-sizing: border-box;
|
|
200
|
+
transition: background-color 0.2s;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.oxy-select__selector-item {
|
|
204
|
+
display: flex;
|
|
205
|
+
justify-content: space-between;
|
|
206
|
+
align-items: center;
|
|
207
|
+
color: $-color-content;
|
|
208
|
+
cursor: pointer;
|
|
209
|
+
|
|
210
|
+
&:hover:not(.oxy-select__selector__disabled) {
|
|
211
|
+
background-color: $-color-bg;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
&.oxy-select_selector-item_active {
|
|
215
|
+
color: $-color-theme;
|
|
216
|
+
background-color: rgba($-color-theme, 0.05);
|
|
217
|
+
font-weight: 500;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.oxy-select__selector__disabled {
|
|
222
|
+
color: $-color-tip;
|
|
223
|
+
cursor: not-allowed;
|
|
224
|
+
background-color: transparent !important;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.oxy-select__loading {
|
|
228
|
+
display: flex;
|
|
229
|
+
align-items: center;
|
|
230
|
+
justify-content: center;
|
|
231
|
+
padding: 40rpx 0;
|
|
232
|
+
color: $-color-aid;
|
|
233
|
+
font-size: $-fs-secondary;
|
|
234
|
+
|
|
235
|
+
&-icon {
|
|
236
|
+
margin-right: 16rpx;
|
|
237
|
+
animation: rotate 1s linear infinite;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
@keyframes rotate {
|
|
242
|
+
from { transform: rotate(0deg); }
|
|
243
|
+
to { transform: rotate(360deg); }
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/* picker 弹出层通用的指示小三角 */
|
|
247
|
+
.oxy-select__selector-arrow,
|
|
248
|
+
.oxy-select__selector-arrow::after {
|
|
249
|
+
position: absolute;
|
|
250
|
+
display: block;
|
|
251
|
+
width: 0;
|
|
252
|
+
height: 0;
|
|
253
|
+
border-color: transparent;
|
|
254
|
+
border-style: solid;
|
|
255
|
+
border-width: 12rpx;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.oxy-select__selector-arrow {
|
|
259
|
+
filter: drop-shadow(0 4rpx 24rpx rgba(0, 0, 0, 0.03));
|
|
260
|
+
|
|
261
|
+
left: 10%;
|
|
262
|
+
margin-right: 6rpx;
|
|
263
|
+
border-top-width: 0;
|
|
264
|
+
border-bottom-color: $-color-border-light;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.oxy-select__selector-arrow::after {
|
|
268
|
+
content: " ";
|
|
269
|
+
top: 2rpx;
|
|
270
|
+
margin-left: -12rpx;
|
|
271
|
+
border-top-width: 0;
|
|
272
|
+
border-bottom-color: $-color-white;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.oxy-select__input-text {
|
|
276
|
+
width: 100%;
|
|
277
|
+
font-size: $-input-fs;
|
|
278
|
+
color: $-input-color;
|
|
279
|
+
outline: none;
|
|
280
|
+
border: none;
|
|
281
|
+
background: none;
|
|
282
|
+
white-space: nowrap;
|
|
283
|
+
text-overflow: ellipsis;
|
|
284
|
+
overflow: hidden;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.oxy-select__input-selector {
|
|
288
|
+
position: absolute;
|
|
289
|
+
z-index: 1;
|
|
290
|
+
left: 20rpx;
|
|
291
|
+
right: 60rpx;
|
|
292
|
+
width: auto;
|
|
293
|
+
&::-webkit-input-placeholder {
|
|
294
|
+
color: $-input-placeholder-color;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.oxy-select__input-filter {
|
|
299
|
+
width: auto;
|
|
300
|
+
min-width: 80rpx;
|
|
301
|
+
margin-left: 8rpx;
|
|
302
|
+
flex: 1;
|
|
303
|
+
&::-webkit-input-placeholder {
|
|
304
|
+
color: $-input-placeholder-color;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.oxy-select__input-placeholder {
|
|
309
|
+
color: $-input-placeholder-color;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.oxy-select--mask {
|
|
313
|
+
position: fixed;
|
|
314
|
+
top: 0;
|
|
315
|
+
bottom: 0;
|
|
316
|
+
right: 0;
|
|
317
|
+
left: 0;
|
|
318
|
+
z-index: 2;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
@include when(no-border) {
|
|
322
|
+
.oxy-select__wrapper {
|
|
323
|
+
border: 0;
|
|
324
|
+
padding: 0;
|
|
325
|
+
min-height: $-input-cell-height;
|
|
326
|
+
&.is-focus:not(.is-disabled):not(.is-readonly) {
|
|
327
|
+
box-shadow: none;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|