oxy-uni-ui 1.2.3 → 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 +353 -328
- 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 +10 -9
- 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-checkbox/index.scss +7 -7
- 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 +32 -32
- 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 +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/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 +24 -23
- 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 +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/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 +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 +100 -14
- package/components/oxy-picker/types.ts +29 -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 +10 -10
- 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 +30 -29
- 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 +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 +144 -68
- package/components/oxy-select/oxy-select.vue +85 -50
- 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 +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/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-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 +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 +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/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 +2 -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
|
@@ -8,9 +8,13 @@
|
|
|
8
8
|
flex: 1;
|
|
9
9
|
box-sizing: border-box;
|
|
10
10
|
position: relative;
|
|
11
|
+
text-align: left;
|
|
11
12
|
.oxy-select__label {
|
|
12
13
|
margin: auto 0;
|
|
13
|
-
|
|
14
|
+
color: $-cell-title-color;
|
|
15
|
+
margin-right: $-cell-padding;
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
font-size: $-input-fs;
|
|
14
18
|
}
|
|
15
19
|
.oxy-select__icon {
|
|
16
20
|
position: absolute;
|
|
@@ -33,31 +37,46 @@
|
|
|
33
37
|
}
|
|
34
38
|
.oxy-select__wrapper {
|
|
35
39
|
font-size: $-input-fs;
|
|
36
|
-
|
|
40
|
+
color: $-input-color;
|
|
41
|
+
border: 1px solid $-color-border;
|
|
37
42
|
box-sizing: border-box;
|
|
38
|
-
border-radius:
|
|
39
|
-
padding: 0
|
|
40
|
-
padding-left: $-input-cell-padding;
|
|
43
|
+
border-radius: 8rpx;
|
|
44
|
+
padding: 0 $-input-cell-padding;
|
|
41
45
|
position: relative;
|
|
42
46
|
/* #ifndef APP-NVUE */
|
|
43
47
|
display: flex;
|
|
44
48
|
user-select: none;
|
|
45
49
|
/* #endif */
|
|
46
50
|
flex-direction: row;
|
|
47
|
-
align-items: center;
|
|
48
|
-
border-bottom: solid 1px $-input-border-color;
|
|
49
51
|
width: 100%;
|
|
50
52
|
flex: 1;
|
|
51
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
|
+
}
|
|
52
64
|
|
|
53
65
|
&.is-disabled {
|
|
54
|
-
background-color: $-
|
|
66
|
+
background-color: $-color-bg;
|
|
67
|
+
border-color: $-color-border-light;
|
|
55
68
|
cursor: not-allowed;
|
|
69
|
+
color: $-color-tip;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&.is-readonly {
|
|
73
|
+
background-color: transparent;
|
|
74
|
+
border-color: transparent;
|
|
75
|
+
padding: 0;
|
|
56
76
|
}
|
|
57
77
|
}
|
|
58
78
|
.oxy-select__input-box {
|
|
59
79
|
width: 100%;
|
|
60
|
-
// height: $-input-inner-height;
|
|
61
80
|
position: relative;
|
|
62
81
|
/* #ifndef APP-NVUE */
|
|
63
82
|
display: flex;
|
|
@@ -65,71 +84,83 @@
|
|
|
65
84
|
flex: 1;
|
|
66
85
|
flex-direction: row;
|
|
67
86
|
align-items: center;
|
|
87
|
+
overflow: hidden;
|
|
68
88
|
}
|
|
69
89
|
|
|
70
90
|
.oxy-select__tags {
|
|
71
91
|
width: 100%;
|
|
72
92
|
display: flex;
|
|
73
93
|
flex-wrap: wrap;
|
|
94
|
+
padding: 8rpx 0;
|
|
95
|
+
|
|
74
96
|
&-item {
|
|
75
|
-
font-size:
|
|
76
|
-
border:
|
|
77
|
-
border-radius: 4px;
|
|
97
|
+
font-size: 24rpx;
|
|
98
|
+
border-radius: 8rpx;
|
|
78
99
|
white-space: nowrap;
|
|
79
|
-
height:
|
|
80
|
-
padding: 0
|
|
81
|
-
line-height:
|
|
100
|
+
height: 48rpx;
|
|
101
|
+
padding: 0 16rpx;
|
|
102
|
+
line-height: 44rpx;
|
|
82
103
|
box-sizing: border-box;
|
|
83
|
-
margin:
|
|
104
|
+
margin: 4rpx 8rpx 4rpx 0;
|
|
84
105
|
display: flex;
|
|
85
106
|
max-width: 100%;
|
|
86
107
|
align-items: center;
|
|
87
|
-
background-color:
|
|
88
|
-
border
|
|
89
|
-
color:
|
|
90
|
-
|
|
91
|
-
|
|
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;
|
|
92
116
|
}
|
|
117
|
+
|
|
93
118
|
&-text {
|
|
94
|
-
font-size:
|
|
119
|
+
font-size: 24rpx;
|
|
95
120
|
white-space: nowrap;
|
|
96
|
-
line-height:
|
|
97
|
-
color: #909399;
|
|
121
|
+
line-height: 44rpx;
|
|
98
122
|
overflow: hidden;
|
|
99
123
|
text-overflow: ellipsis;
|
|
100
124
|
}
|
|
101
125
|
}
|
|
102
126
|
.oxy-select__icon-error{
|
|
103
|
-
margin-left:
|
|
127
|
+
margin-left: 8rpx;
|
|
128
|
+
font-size: 28rpx;
|
|
129
|
+
color: $-color-aid;
|
|
130
|
+
cursor: pointer;
|
|
131
|
+
|
|
132
|
+
&:hover {
|
|
133
|
+
color: $-color-danger;
|
|
134
|
+
}
|
|
104
135
|
}
|
|
105
136
|
}
|
|
106
137
|
|
|
107
138
|
.oxy-select__input {
|
|
108
139
|
flex: 1;
|
|
109
|
-
font-size:
|
|
110
|
-
height:
|
|
111
|
-
line-height:
|
|
140
|
+
font-size: $-fs-content;
|
|
141
|
+
height: 44rpx;
|
|
142
|
+
line-height: 44rpx;
|
|
112
143
|
}
|
|
113
144
|
|
|
114
145
|
.oxy-select__input-plac {
|
|
115
|
-
color: $-
|
|
146
|
+
color: $-color-tip;
|
|
116
147
|
}
|
|
117
148
|
|
|
118
149
|
.oxy-select__selector__down {
|
|
119
|
-
top: calc(100% +
|
|
150
|
+
top: calc(100% + 24rpx);
|
|
120
151
|
|
|
121
152
|
.oxy-select__selector-arrow {
|
|
122
153
|
transform: rotateX(0deg);
|
|
123
|
-
top: -
|
|
154
|
+
top: -12rpx;
|
|
124
155
|
}
|
|
125
156
|
}
|
|
126
157
|
|
|
127
158
|
.oxy-select__selector__upwards {
|
|
128
|
-
bottom: calc(100% +
|
|
159
|
+
bottom: calc(100% + 24rpx);
|
|
129
160
|
|
|
130
161
|
.oxy-select__selector-arrow {
|
|
131
162
|
transform: rotateX(180deg);
|
|
132
|
-
bottom: -
|
|
163
|
+
bottom: -12rpx;
|
|
133
164
|
}
|
|
134
165
|
}
|
|
135
166
|
|
|
@@ -140,17 +171,18 @@
|
|
|
140
171
|
position: absolute;
|
|
141
172
|
left: 0;
|
|
142
173
|
width: 100%;
|
|
143
|
-
background-color:
|
|
144
|
-
border: 1px solid
|
|
145
|
-
border-radius:
|
|
146
|
-
box-shadow: 0
|
|
147
|
-
z-index:
|
|
148
|
-
padding:
|
|
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;
|
|
149
181
|
}
|
|
150
182
|
|
|
151
183
|
.oxy-select__selector-scroll {
|
|
152
184
|
/* #ifndef APP-NVUE */
|
|
153
|
-
max-height:
|
|
185
|
+
max-height: 480rpx;
|
|
154
186
|
box-sizing: border-box;
|
|
155
187
|
/* #endif */
|
|
156
188
|
}
|
|
@@ -159,36 +191,56 @@
|
|
|
159
191
|
.oxy-select__selector-item {
|
|
160
192
|
/* #ifndef APP-NVUE */
|
|
161
193
|
display: flex;
|
|
162
|
-
// cursor: pointer;
|
|
163
194
|
/* #endif */
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
padding:
|
|
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;
|
|
168
201
|
}
|
|
169
202
|
|
|
170
203
|
.oxy-select__selector-item {
|
|
171
204
|
display: flex;
|
|
172
205
|
justify-content: space-between;
|
|
173
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
|
+
}
|
|
174
219
|
}
|
|
175
220
|
|
|
176
|
-
.oxy-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
/* #endif */
|
|
221
|
+
.oxy-select__selector__disabled {
|
|
222
|
+
color: $-color-tip;
|
|
223
|
+
cursor: not-allowed;
|
|
224
|
+
background-color: transparent !important;
|
|
181
225
|
}
|
|
182
226
|
|
|
183
|
-
.oxy-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
+
}
|
|
187
239
|
}
|
|
188
240
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
241
|
+
@keyframes rotate {
|
|
242
|
+
from { transform: rotate(0deg); }
|
|
243
|
+
to { transform: rotate(360deg); }
|
|
192
244
|
}
|
|
193
245
|
|
|
194
246
|
/* picker 弹出层通用的指示小三角 */
|
|
@@ -200,44 +252,57 @@
|
|
|
200
252
|
height: 0;
|
|
201
253
|
border-color: transparent;
|
|
202
254
|
border-style: solid;
|
|
203
|
-
border-width:
|
|
255
|
+
border-width: 12rpx;
|
|
204
256
|
}
|
|
205
257
|
|
|
206
258
|
.oxy-select__selector-arrow {
|
|
207
|
-
filter: drop-shadow(0
|
|
259
|
+
filter: drop-shadow(0 4rpx 24rpx rgba(0, 0, 0, 0.03));
|
|
208
260
|
|
|
209
261
|
left: 10%;
|
|
210
|
-
margin-right:
|
|
262
|
+
margin-right: 6rpx;
|
|
211
263
|
border-top-width: 0;
|
|
212
|
-
border-bottom-color:
|
|
264
|
+
border-bottom-color: $-color-border-light;
|
|
213
265
|
}
|
|
214
266
|
|
|
215
267
|
.oxy-select__selector-arrow::after {
|
|
216
268
|
content: " ";
|
|
217
|
-
top:
|
|
218
|
-
margin-left: -
|
|
269
|
+
top: 2rpx;
|
|
270
|
+
margin-left: -12rpx;
|
|
219
271
|
border-top-width: 0;
|
|
220
|
-
border-bottom-color:
|
|
272
|
+
border-bottom-color: $-color-white;
|
|
221
273
|
}
|
|
222
274
|
|
|
223
275
|
.oxy-select__input-text {
|
|
224
|
-
|
|
225
|
-
|
|
276
|
+
width: 100%;
|
|
277
|
+
font-size: $-input-fs;
|
|
226
278
|
color: $-input-color;
|
|
279
|
+
outline: none;
|
|
280
|
+
border: none;
|
|
281
|
+
background: none;
|
|
227
282
|
white-space: nowrap;
|
|
228
283
|
text-overflow: ellipsis;
|
|
229
|
-
-o-text-overflow: ellipsis;
|
|
230
284
|
overflow: hidden;
|
|
231
285
|
}
|
|
232
286
|
|
|
233
287
|
.oxy-select__input-selector {
|
|
234
288
|
position: absolute;
|
|
235
289
|
z-index: 1;
|
|
290
|
+
left: 20rpx;
|
|
291
|
+
right: 60rpx;
|
|
292
|
+
width: auto;
|
|
293
|
+
&::-webkit-input-placeholder {
|
|
294
|
+
color: $-input-placeholder-color;
|
|
295
|
+
}
|
|
236
296
|
}
|
|
237
297
|
|
|
238
298
|
.oxy-select__input-filter {
|
|
239
299
|
width: auto;
|
|
240
|
-
|
|
300
|
+
min-width: 80rpx;
|
|
301
|
+
margin-left: 8rpx;
|
|
302
|
+
flex: 1;
|
|
303
|
+
&::-webkit-input-placeholder {
|
|
304
|
+
color: $-input-placeholder-color;
|
|
305
|
+
}
|
|
241
306
|
}
|
|
242
307
|
|
|
243
308
|
.oxy-select__input-placeholder {
|
|
@@ -252,4 +317,15 @@
|
|
|
252
317
|
left: 0;
|
|
253
318
|
z-index: 2;
|
|
254
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
|
+
}
|
|
255
331
|
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view :class="
|
|
2
|
+
<view :class="rootClass" :style="rootStyle">
|
|
3
3
|
<view v-if="label" class="oxy-select__label" :style="labelStyle">
|
|
4
4
|
<slot name="label">{{ label }}</slot>
|
|
5
5
|
</view>
|
|
6
6
|
<view class="oxy-select__box">
|
|
7
|
-
<view :class="['oxy-select__wrapper', { 'is-disabled': disabled, 'is-readonly': readonly }]">
|
|
7
|
+
<view :class="['oxy-select__wrapper', { 'is-disabled': disabled, 'is-readonly': readonly, 'is-focus': showSelector }]">
|
|
8
8
|
<view class="oxy-select__input-box" @click="toggleSelector">
|
|
9
9
|
<view class="oxy-select__tags" v-if="multiple && currentList.length > 0">
|
|
10
10
|
<view class="oxy-select__tags-item" v-for="item in displayTags" :key="item[valueKey]">
|
|
11
|
-
<span class="oxy-select__tags-item-text">{{ item
|
|
11
|
+
<span class="oxy-select__tags-item-text">{{ formatItemName(item) }}</span>
|
|
12
12
|
<view v-if="!disabled && !readonly" @click.stop="delItem(item)">
|
|
13
|
-
<oxy-icon custom-class="oxy-select__icon-error" name="
|
|
13
|
+
<oxy-icon custom-class="oxy-select__icon-error" name="close" />
|
|
14
14
|
</view>
|
|
15
15
|
</view>
|
|
16
16
|
<view v-if="currentList.length > collapseTagsNum && collapseTags" class="oxy-select__tags-item">
|
|
17
17
|
<span class="oxy-select__tags-item-text">+{{ currentList.length - collapseTagsNum }}</span>
|
|
18
18
|
</view>
|
|
19
19
|
<input
|
|
20
|
-
v-if="filterable &&
|
|
20
|
+
v-if="filterable && !disabled && !readonly"
|
|
21
21
|
@input="inputChange"
|
|
22
22
|
class="oxy-select__input-text oxy-select__input-filter"
|
|
23
23
|
type="text"
|
|
24
|
-
placeholder="
|
|
24
|
+
:placeholder="currentList.length === 0 ? typePlaceholder : ''"
|
|
25
25
|
v-model="filterInput"
|
|
26
26
|
/>
|
|
27
27
|
</view>
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
:readonly="readonly"
|
|
37
37
|
class="oxy-select__input-text oxy-select__input-selector"
|
|
38
38
|
type="text"
|
|
39
|
-
:placeholder="placeholderOld"
|
|
39
|
+
:placeholder="placeholderOld || typePlaceholder"
|
|
40
40
|
v-model="filterInput"
|
|
41
41
|
/>
|
|
42
42
|
<view v-else-if="!disabled && !readonly" class="oxy-select__input-text oxy-select__input-placeholder">{{ typePlaceholder }}</view>
|
|
43
43
|
<oxy-icon
|
|
44
44
|
v-if="(current.length > 0 && clear && !disabled && !readonly) || (currentArr.length > 0 && clear && !disabled && !readonly)"
|
|
45
45
|
custom-class="oxy-select__icon oxy-select__icon-clear"
|
|
46
|
-
name="
|
|
47
|
-
@click="clearVal"
|
|
46
|
+
name="close-circle-filled"
|
|
47
|
+
@click.stop="clearVal"
|
|
48
48
|
/>
|
|
49
49
|
<oxy-icon
|
|
50
50
|
:custom-class="`oxy-select__icon oxy-select__icon-arrow ${showSelector ? 'is-open' : ''}`"
|
|
@@ -52,24 +52,33 @@
|
|
|
52
52
|
name="arrow-down"
|
|
53
53
|
/>
|
|
54
54
|
</view>
|
|
55
|
-
<oxy-transition :show="showSelector" name="fade" :duration="duration">
|
|
55
|
+
<oxy-transition :show="showSelector" name="fade" :duration="duration" :lazy-render="false">
|
|
56
56
|
<view class="oxy-select--mask" @click="toggleSelector" />
|
|
57
57
|
<view class="oxy-select__selector" :class="isDown ? 'oxy-select__selector__down' : 'oxy-select__selector__upwards'">
|
|
58
58
|
<view class="oxy-select__selector-arrow"></view>
|
|
59
59
|
<scroll-view :scroll-y="true" class="oxy-select__selector-scroll">
|
|
60
|
-
<view
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
<view
|
|
64
|
-
v-else
|
|
65
|
-
:class="['oxy-select__selector-item', { 'oxy-select_selector-item_active': multiple && currentArr.includes(item[valueKey]) }]"
|
|
66
|
-
v-for="(item, index) in filterMixinDatacomResData"
|
|
67
|
-
:key="index"
|
|
68
|
-
@click="change(item)"
|
|
69
|
-
>
|
|
70
|
-
<span :class="{ 'oxy-select__selector__disabled': item.disabled }">{{ formatItemName(item) }}</span>
|
|
71
|
-
<oxy-icon v-if="multiple && currentArr.includes(item[valueKey])" name="check" />
|
|
60
|
+
<view v-if="loading" class="oxy-select__loading">
|
|
61
|
+
<oxy-icon name="refresh" custom-class="oxy-select__loading-icon" />
|
|
62
|
+
<text>{{ loadingText }}</text>
|
|
72
63
|
</view>
|
|
64
|
+
<template v-else>
|
|
65
|
+
<view class="oxy-select__selector-empty" v-if="filterMixinDatacomResData.length === 0">
|
|
66
|
+
<span>{{ emptyTips }}</span>
|
|
67
|
+
</view>
|
|
68
|
+
<view
|
|
69
|
+
v-else
|
|
70
|
+
:class="[
|
|
71
|
+
'oxy-select__selector-item',
|
|
72
|
+
{ 'oxy-select_selector-item_active': multiple ? currentArr.includes(item[valueKey]) : modelValue === item[valueKey] }
|
|
73
|
+
]"
|
|
74
|
+
v-for="(item, index) in filterMixinDatacomResData"
|
|
75
|
+
:key="index"
|
|
76
|
+
@click="change(item)"
|
|
77
|
+
>
|
|
78
|
+
<span :class="{ 'oxy-select__selector__disabled': item.disabled }">{{ formatItemName(item) }}</span>
|
|
79
|
+
<oxy-icon v-if="multiple && currentArr.includes(item[valueKey])" name="check" />
|
|
80
|
+
</view>
|
|
81
|
+
</template>
|
|
73
82
|
</scroll-view>
|
|
74
83
|
</view>
|
|
75
84
|
</oxy-transition>
|
|
@@ -89,8 +98,9 @@ export default {
|
|
|
89
98
|
</script>
|
|
90
99
|
|
|
91
100
|
<script lang="ts" setup>
|
|
92
|
-
import { getCurrentInstance, ref, watch,
|
|
101
|
+
import { getCurrentInstance, ref, watch, computed } from 'vue'
|
|
93
102
|
import { objToStyle } from '../common/util'
|
|
103
|
+
import { useWindowResize, type WindowResizeResult } from '../composables/useWindowResize'
|
|
94
104
|
import { selectProps, type SelectProps } from './types'
|
|
95
105
|
import OxyTransition from '../oxy-transition/oxy-transition.vue'
|
|
96
106
|
|
|
@@ -114,8 +124,23 @@ const rootStyle = ref('')
|
|
|
114
124
|
const duration = ref<number>(200)
|
|
115
125
|
let overlayTimer: ReturnType<typeof setTimeout> | null
|
|
116
126
|
|
|
117
|
-
|
|
118
|
-
|
|
127
|
+
const syncWindowHeight = (res?: WindowResizeResult) => {
|
|
128
|
+
const resizeHeight = Number(res?.size?.windowHeight ?? res?.windowHeight)
|
|
129
|
+
const systemHeight = uni.getSystemInfoSync().windowHeight
|
|
130
|
+
windowHeight.value = Number.isFinite(resizeHeight) && resizeHeight > 0 ? resizeHeight : systemHeight
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const handleWindowResize = (res?: WindowResizeResult) => {
|
|
134
|
+
syncWindowHeight(res)
|
|
135
|
+
if (showSelector.value) {
|
|
136
|
+
void getIsDown()
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
useWindowResize(handleWindowResize, { immediate: true })
|
|
141
|
+
|
|
142
|
+
const rootClass = computed(() => {
|
|
143
|
+
return `oxy-select ${props.noBorder ? 'is-no-border' : ''} ${props.customClass}`
|
|
119
144
|
})
|
|
120
145
|
|
|
121
146
|
const labelStyle = computed(() => {
|
|
@@ -212,18 +237,28 @@ watch(
|
|
|
212
237
|
)
|
|
213
238
|
|
|
214
239
|
function getIsDown() {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
240
|
+
return new Promise((resolve) => {
|
|
241
|
+
const query = uni.createSelectorQuery().in(instance)
|
|
242
|
+
query
|
|
243
|
+
.select('.oxy-select__box')
|
|
244
|
+
.boundingClientRect((data) => {
|
|
245
|
+
const rect = data as UniApp.NodeInfo
|
|
246
|
+
if (rect) {
|
|
247
|
+
const bottomSpace = windowHeight.value - (rect.bottom || 0)
|
|
248
|
+
const topSpace = rect.top || 0
|
|
249
|
+
const threshold = 280 // max-height 240 + padding/arrow space
|
|
250
|
+
|
|
251
|
+
// 如果下方空间不足,且上方空间比下方空间大,则向上弹出
|
|
252
|
+
if (bottomSpace < threshold && topSpace > bottomSpace) {
|
|
253
|
+
isDown.value = false
|
|
254
|
+
} else {
|
|
255
|
+
isDown.value = true
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
resolve(isDown.value)
|
|
259
|
+
})
|
|
260
|
+
.exec()
|
|
261
|
+
})
|
|
227
262
|
}
|
|
228
263
|
|
|
229
264
|
function initDefVal() {
|
|
@@ -367,13 +402,16 @@ function handleEmit(val: any) {
|
|
|
367
402
|
emit('change', _current)
|
|
368
403
|
}
|
|
369
404
|
}
|
|
370
|
-
function toggleSelector() {
|
|
405
|
+
async function toggleSelector() {
|
|
371
406
|
if (props.disabled || props.readonly) {
|
|
372
407
|
return
|
|
373
408
|
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
409
|
+
const nextShow = !showSelector.value
|
|
410
|
+
if (nextShow) {
|
|
411
|
+
await getIsDown()
|
|
412
|
+
}
|
|
413
|
+
showSelector.value = nextShow
|
|
414
|
+
isFocus.value = nextShow
|
|
377
415
|
if (props.filterable && current.value && showSelector.value) {
|
|
378
416
|
if (!props.multiple) {
|
|
379
417
|
if (typeof current.value === 'string') {
|
|
@@ -394,21 +432,18 @@ function formatItemName(item: any) {
|
|
|
394
432
|
if (!item) {
|
|
395
433
|
return ''
|
|
396
434
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
let { channel_code } = item
|
|
400
|
-
channel_code = channel_code ? `(${channel_code})` : ''
|
|
435
|
+
const label = item[props.labelKey]
|
|
436
|
+
|
|
401
437
|
if (props.format) {
|
|
402
438
|
// 格式化输出
|
|
403
|
-
let str =
|
|
404
|
-
|
|
405
|
-
for (let key in item) {
|
|
439
|
+
let str = props.format
|
|
440
|
+
for (const key in item) {
|
|
406
441
|
str = str.replace(new RegExp(`{${key}}`, 'g'), item[key])
|
|
407
442
|
}
|
|
408
443
|
return str
|
|
409
|
-
} else {
|
|
410
|
-
return text ? text : `未命名${channel_code}`
|
|
411
444
|
}
|
|
445
|
+
|
|
446
|
+
return label !== undefined && label !== null ? String(label) : ''
|
|
412
447
|
}
|
|
413
448
|
|
|
414
449
|
// 获取当前加载的数据
|
|
@@ -61,11 +61,23 @@ export const selectProps = {
|
|
|
61
61
|
* 是否可清除
|
|
62
62
|
*/
|
|
63
63
|
clear: makeBooleanProp(true),
|
|
64
|
+
/**
|
|
65
|
+
* 是否加载中
|
|
66
|
+
*/
|
|
67
|
+
loading: makeBooleanProp(false),
|
|
68
|
+
/**
|
|
69
|
+
* 加载中文字
|
|
70
|
+
*/
|
|
71
|
+
loadingText: makeStringProp('加载中...'),
|
|
64
72
|
/**
|
|
65
73
|
* 格式化输出
|
|
66
74
|
*/
|
|
67
75
|
format: makeStringProp(''),
|
|
68
|
-
defItem: makeNumberProp(0)
|
|
76
|
+
defItem: makeNumberProp(0),
|
|
77
|
+
/**
|
|
78
|
+
* 是否隐藏边框
|
|
79
|
+
*/
|
|
80
|
+
noBorder: makeBooleanProp(false)
|
|
69
81
|
}
|
|
70
82
|
|
|
71
83
|
export type SelectProps = ExtractPropTypes<typeof selectProps>
|
|
@@ -73,19 +73,19 @@
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
@include edeep(header) {
|
|
76
|
-
height:
|
|
77
|
-
line-height:
|
|
76
|
+
height: 144rpx;
|
|
77
|
+
line-height: 144rpx;
|
|
78
78
|
}
|
|
79
79
|
@include e(wrapper) {
|
|
80
|
-
padding: 0
|
|
80
|
+
padding: 0 20rpx;
|
|
81
81
|
position: relative;
|
|
82
|
-
max-height:
|
|
82
|
+
max-height: 712rpx;
|
|
83
83
|
box-sizing: border-box;
|
|
84
84
|
overflow: auto;
|
|
85
85
|
|
|
86
86
|
@include when(filterable) {
|
|
87
|
-
height:
|
|
88
|
-
max-height:
|
|
87
|
+
height: 628rpx;
|
|
88
|
+
max-height: 628rpx;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
@include when(loading) {
|
|
@@ -97,6 +97,6 @@
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
@include e(footer) {
|
|
100
|
-
padding:
|
|
100
|
+
padding: 48rpx 30rpx;
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -72,6 +72,8 @@ export const selectPickerProps = {
|
|
|
72
72
|
beforeConfirm: Function as PropType<SelectPickerBeforeConfirm>,
|
|
73
73
|
/** 弹窗层级 */
|
|
74
74
|
zIndex: makeNumberProp(15),
|
|
75
|
+
/** 弹层最大宽度,支持 `rpx`、`px`、`%` 等单位;`%` 在弹层打开时按屏幕宽度换算为 `rpx` */
|
|
76
|
+
popupMaxWidth: makeStringProp('1200rpx'),
|
|
75
77
|
/** 弹出面板是否设置底部安全距离(iphone X 类型的机型) */
|
|
76
78
|
safeAreaInsetBottom: makeBooleanProp(true),
|
|
77
79
|
/** 可搜索(目前只支持本地搜索) */
|