oxy-uni-ui 1.2.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/components/common/abstracts/variable.scss +512 -343
- package/components/common/util.ts +185 -32
- package/components/composables/index.ts +1 -0
- package/components/composables/usePopover.ts +24 -20
- package/components/composables/useVirtualScroll.ts +48 -21
- package/components/composables/useWindowResize.ts +35 -0
- package/components/oxy-action-sheet/index.scss +24 -11
- package/components/oxy-action-sheet/oxy-action-sheet.vue +27 -19
- package/components/oxy-action-sheet/types.ts +7 -0
- package/components/oxy-backtop/index.scss +4 -4
- package/components/oxy-backtop/oxy-backtop.vue +9 -6
- package/components/oxy-backtop/types.ts +7 -7
- package/components/oxy-badge/index.scss +4 -4
- package/components/oxy-badge/oxy-badge.vue +3 -3
- package/components/oxy-badge/types.ts +2 -2
- package/components/oxy-button/index.scss +5 -5
- package/components/oxy-button/oxy-button.vue +5 -1
- package/components/oxy-calendar/index.scss +15 -15
- package/components/oxy-calendar/oxy-calendar.vue +1 -0
- package/components/oxy-calendar/types.ts +5 -0
- package/components/oxy-calendar-view/month/index.scss +4 -4
- package/components/oxy-calendar-view/month/types.ts +36 -0
- package/components/oxy-calendar-view/monthPanel/index.scss +7 -8
- package/components/oxy-calendar-view/monthPanel/month-panel.vue +14 -8
- package/components/oxy-calendar-view/year/index.scss +5 -5
- package/components/oxy-calendar-view/yearPanel/index.scss +4 -4
- package/components/oxy-calendar-view/yearPanel/year-panel.vue +21 -5
- package/components/oxy-card/index.scss +2 -2
- package/components/oxy-cell/index.scss +8 -8
- package/components/oxy-checkbox/index.scss +12 -12
- package/components/oxy-checkbox-group/index.scss +2 -2
- package/components/oxy-circle/oxy-circle.vue +10 -7
- package/components/oxy-circle/types.ts +5 -5
- package/components/oxy-col/oxy-col.vue +2 -2
- package/components/oxy-col-picker/index.scss +4 -4
- package/components/oxy-col-picker/oxy-col-picker.vue +6 -5
- package/components/oxy-col-picker/types.ts +7 -2
- package/components/oxy-collapse/index.scss +2 -2
- package/components/oxy-collapse-item/oxy-collapse-item.vue +3 -3
- package/components/oxy-corner/index.scss +33 -33
- package/components/oxy-count-to/oxy-count-to.vue +3 -3
- package/components/oxy-curtain/index.scss +15 -15
- package/components/oxy-curtain/oxy-curtain.vue +4 -2
- package/components/oxy-curtain/types.ts +6 -1
- package/components/oxy-date-strip/oxy-date-strip.vue +2 -2
- package/components/oxy-date-strip/types.ts +1 -1
- package/components/oxy-date-strip-item/index.scss +3 -3
- package/components/oxy-datetime-picker/index.scss +11 -11
- package/components/oxy-datetime-picker/oxy-datetime-picker.vue +1 -0
- package/components/oxy-datetime-picker/types.ts +5 -0
- package/components/oxy-drop-menu/index.scss +5 -5
- package/components/oxy-drop-menu/oxy-drop-menu.vue +3 -3
- package/components/oxy-drop-menu-item/index.scss +3 -3
- package/components/oxy-drop-menu-item/oxy-drop-menu-item.vue +4 -3
- package/components/oxy-drop-menu-item/types.ts +5 -0
- package/components/oxy-echarts/types.ts +6 -0
- package/components/oxy-fab/index.scss +8 -8
- package/components/oxy-fab/oxy-fab.vue +22 -3
- package/components/oxy-file-list/index.scss +30 -29
- package/components/oxy-file-list/oxy-file-list.vue +2 -2
- package/components/oxy-floating-panel/oxy-floating-panel.vue +13 -9
- package/components/oxy-floating-panel/{type.ts → types.ts} +8 -8
- package/components/oxy-footer/index.scss +19 -0
- package/components/oxy-footer/oxy-footer.vue +78 -0
- package/components/oxy-footer/types.ts +17 -0
- package/components/oxy-form-item/types.ts +22 -1
- package/components/oxy-gap/oxy-gap.vue +2 -2
- package/components/oxy-gap/types.ts +2 -2
- package/components/oxy-grid/oxy-grid.vue +1 -1
- package/components/oxy-grid/types.ts +1 -1
- package/components/oxy-grid-item/index.scss +1 -1
- package/components/oxy-grid-item/oxy-grid-item.vue +7 -5
- package/components/oxy-grid-item/types.ts +1 -1
- package/components/oxy-guidance/index.scss +75 -0
- package/components/oxy-guidance/oxy-guidance.vue +201 -0
- package/components/oxy-guidance/types.ts +33 -0
- package/components/oxy-icon/oxy-icon.vue +2 -2
- package/components/oxy-icon/types.ts +1 -1
- package/components/oxy-img/oxy-img.vue +4 -4
- package/components/oxy-img/types.ts +3 -3
- package/components/oxy-img-cropper/index.scss +23 -23
- package/components/oxy-img-cropper/oxy-img-cropper.vue +97 -52
- package/components/oxy-img-cropper/types.ts +2 -2
- package/components/oxy-img-lazy/oxy-img-lazy.vue +3 -3
- package/components/oxy-img-lazy/types.ts +3 -3
- package/components/oxy-index-anchor/index.scss +2 -2
- package/components/oxy-index-anchor/oxy-index-anchor.vue +2 -2
- package/components/oxy-index-anchor/{type.ts → types.ts} +3 -0
- package/components/oxy-index-bar/index.scss +3 -3
- package/components/oxy-index-bar/oxy-index-bar.vue +3 -3
- package/components/oxy-index-bar/{type.ts → types.ts} +2 -2
- package/components/oxy-input/index.scss +1 -1
- package/components/oxy-input-number/index.scss +5 -5
- package/components/oxy-input-number/oxy-input-number.vue +2 -2
- package/components/oxy-input-number/types.ts +3 -2
- package/components/oxy-keyboard/index.scss +5 -5
- package/components/oxy-keyboard/key/index.scss +3 -3
- package/components/oxy-keyboard/key/index.vue +2 -2
- package/components/oxy-keyboard/key/types.ts +15 -0
- package/components/oxy-keyboard/oxy-keyboard.vue +1 -0
- package/components/oxy-keyboard/types.ts +5 -0
- package/components/oxy-link/index.scss +2 -2
- package/components/oxy-list/oxy-list.vue +4 -3
- package/components/oxy-loading/oxy-loading.vue +8 -4
- package/components/oxy-loading/types.ts +1 -1
- package/components/oxy-loadmore/index.scss +3 -3
- package/components/oxy-long-press-menu/index.scss +93 -0
- package/components/oxy-long-press-menu/oxy-long-press-menu.vue +338 -0
- package/components/oxy-long-press-menu/types.ts +34 -0
- package/components/oxy-message-box/index.scss +12 -11
- package/components/oxy-message-box/oxy-message-box.vue +9 -2
- package/components/oxy-message-box/types.ts +9 -0
- package/components/oxy-navbar/index.scss +2 -2
- package/components/oxy-navbar/oxy-navbar.vue +58 -13
- package/components/oxy-navbar/types.ts +8 -1
- package/components/oxy-navbar-capsule/types.ts +3 -0
- package/components/oxy-notice-bar/index.scss +3 -3
- package/components/oxy-notice-bar/oxy-notice-bar.vue +9 -5
- package/components/oxy-notice-bar/types.ts +3 -3
- package/components/oxy-notify/index.ts +1 -0
- package/components/oxy-notify/oxy-notify.vue +3 -2
- package/components/oxy-notify/types.ts +7 -0
- package/components/oxy-pagination/index.scss +6 -5
- package/components/oxy-password-input/oxy-password-input.vue +2 -2
- package/components/oxy-password-input/types.ts +1 -1
- package/components/oxy-picker/index.scss +45 -2
- package/components/oxy-picker/oxy-picker.vue +100 -14
- package/components/oxy-picker/types.ts +29 -1
- package/components/oxy-picker-view/index.scss +4 -4
- package/components/oxy-picker-view/oxy-picker-view.vue +4 -4
- package/components/oxy-popover/index.scss +13 -13
- package/components/oxy-popup/index.scss +4 -4
- package/components/oxy-popup/oxy-popup.vue +35 -2
- package/components/oxy-popup/types.ts +8 -1
- package/components/oxy-progress/index.scss +3 -3
- package/components/oxy-qrcode/draw.ts +398 -0
- package/components/oxy-qrcode/index.scss +2 -0
- package/components/oxy-qrcode/oxy-qrcode.vue +124 -0
- package/components/oxy-qrcode/qrcode.ts +936 -0
- package/components/oxy-qrcode/types.ts +42 -0
- package/components/oxy-radio/index.scss +25 -19
- package/components/oxy-radio-group/index.scss +2 -2
- package/components/oxy-rate/types.ts +4 -4
- package/components/oxy-resize/index.scss +2 -2
- package/components/oxy-resize/oxy-resize.vue +4 -4
- package/components/oxy-resize/types.ts +3 -0
- package/components/oxy-rich-text/index.scss +37 -36
- package/components/oxy-rich-text/mp-html/card/card.vue +3 -3
- package/components/oxy-rich-text/mp-html/mp-html.vue +33 -24
- package/components/oxy-rich-text/mp-html/node/node.vue +30 -19
- package/components/oxy-rich-text/oxy-rich-text.vue +31 -31
- package/components/oxy-rich-text/types.ts +6 -1
- package/components/oxy-row/oxy-row.vue +3 -3
- package/components/oxy-row/types.ts +1 -1
- package/components/oxy-search/index.scss +7 -7
- package/components/oxy-segmented/index.scss +19 -16
- package/components/oxy-segmented/oxy-segmented.vue +23 -3
- package/components/oxy-select/index.scss +213 -89
- package/components/oxy-select/oxy-select.vue +106 -58
- package/components/oxy-select/types.ts +13 -1
- package/components/oxy-select-picker/index.scss +7 -7
- package/components/oxy-select-picker/oxy-select-picker.vue +1 -0
- package/components/oxy-select-picker/types.ts +2 -0
- package/components/oxy-sidebar-item/index.scss +2 -2
- package/components/oxy-signature/oxy-signature.vue +18 -10
- package/components/oxy-signature/types.ts +106 -13
- package/components/oxy-skeleton/index.scss +1 -1
- package/components/oxy-skeleton/oxy-skeleton.vue +6 -6
- package/components/oxy-skeleton/types.ts +1 -1
- package/components/oxy-slider/index.scss +6 -6
- package/components/oxy-sort-button/index.scss +8 -8
- package/components/oxy-splitter/index.scss +19 -0
- package/components/oxy-splitter/oxy-splitter.vue +409 -0
- package/components/oxy-splitter/types.ts +75 -0
- package/components/oxy-splitter-panel/index.scss +366 -0
- package/components/oxy-splitter-panel/oxy-splitter-panel.vue +432 -0
- package/components/oxy-splitter-panel/types.ts +63 -0
- package/components/oxy-status-tip/index.scss +4 -4
- package/components/oxy-status-tip/oxy-status-tip.vue +5 -5
- package/components/oxy-status-tip/types.ts +3 -3
- package/components/oxy-step/index.scss +16 -16
- package/components/oxy-sticky/oxy-sticky.vue +6 -6
- package/components/oxy-stream-render/oxy-stream-render.vue +230 -4
- package/components/oxy-stream-render/types.ts +4 -1
- package/components/oxy-swipe-action/oxy-swipe-action.vue +27 -2
- package/components/oxy-swiper/oxy-swiper.vue +6 -6
- package/components/oxy-swiper/types.ts +5 -5
- package/components/oxy-swiper-nav/index.scss +3 -3
- package/components/oxy-switch/index.scss +10 -10
- package/components/oxy-switch/oxy-switch.vue +2 -2
- package/components/oxy-switch/types.ts +1 -1
- package/components/oxy-tab/index.scss +11 -1
- package/components/oxy-tabbar/index.scss +2 -2
- package/components/oxy-tabbar/oxy-tabbar.vue +39 -10
- package/components/oxy-table/index.scss +8 -8
- package/components/oxy-table/oxy-table.vue +8 -6
- package/components/oxy-table/types.ts +2 -2
- package/components/oxy-table-col/index.scss +3 -3
- package/components/oxy-table-col/oxy-table-col.vue +3 -3
- package/components/oxy-table-col/types.ts +2 -2
- package/components/oxy-tabs/index.scss +52 -22
- package/components/oxy-tabs/oxy-tabs.vue +53 -19
- package/components/oxy-tabs/types.ts +15 -3
- package/components/oxy-tag/index.scss +111 -36
- package/components/oxy-text/index.scss +5 -1
- package/components/oxy-text/oxy-text.vue +76 -7
- package/components/oxy-text/types.ts +12 -0
- package/components/oxy-textarea/index.scss +6 -6
- package/components/oxy-toast/oxy-toast.vue +24 -8
- package/components/oxy-tooltip/index.scss +9 -9
- package/components/oxy-tree/index.scss +51 -15
- package/components/oxy-tree/oxy-tree.vue +13 -9
- package/components/oxy-tree/types.ts +12 -9
- package/components/oxy-upload/index.scss +23 -23
- package/components/oxy-upload/types.ts +2 -2
- package/components/oxy-verification-code/index.scss +6 -0
- package/components/oxy-verification-code/oxy-verification-code.vue +187 -0
- package/components/oxy-verification-code/types.ts +82 -0
- package/components/oxy-video-preview/index.scss +4 -4
- package/components/oxy-virtual-scroll/index.scss +5 -5
- package/components/oxy-virtual-scroll/oxy-virtual-scroll.vue +11 -7
- package/components/oxy-virtual-scroll/types.ts +14 -14
- package/components/oxy-voice-player/index.scss +937 -0
- package/components/oxy-voice-player/oxy-voice-player.vue +821 -0
- package/components/oxy-voice-player/types.ts +567 -0
- package/components/oxy-waterfall/oxy-waterfall.vue +6 -6
- package/components/oxy-waterfall/types.ts +6 -6
- package/components/oxy-watermark/oxy-watermark.vue +35 -13
- package/components/oxy-watermark/types.ts +14 -14
- package/global.d.ts +4 -0
- package/locale/lang/ar-SA.ts +3 -0
- package/locale/lang/en-US.ts +3 -0
- package/locale/lang/zh-CN.ts +3 -0
- package/package.json +97 -1
- package/tags.json +1 -1
- package/web-types.json +1 -1
- package/components/oxy-number-keyboard/index.scss +0 -78
- package/components/oxy-number-keyboard/key/index.scss +0 -81
- package/components/oxy-number-keyboard/key/index.vue +0 -78
- package/components/oxy-number-keyboard/key/types.ts +0 -11
- package/components/oxy-number-keyboard/oxy-number-keyboard.vue +0 -151
- package/components/oxy-number-keyboard/types.ts +0 -83
- package/components/oxy-tree/components/tree-node-content.vue +0 -72
- package/components/oxy-tree/index.ts +0 -51
- package/oxy-uni-ui.zip +0 -0
|
@@ -1,30 +1,53 @@
|
|
|
1
1
|
@import '../common/abstracts/variable';
|
|
2
2
|
@import '../common/abstracts/mixin';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
.oxy-theme-dark {
|
|
5
|
+
@include b(tag) {
|
|
6
|
+
@include when(default) {
|
|
7
|
+
background: $-dark-background4;
|
|
8
|
+
color: $-dark-color3;
|
|
9
|
+
|
|
10
|
+
@include when(plain) {
|
|
11
|
+
background: transparent;
|
|
12
|
+
border-color: $-dark-background7;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@include when(round) {
|
|
16
|
+
color: $-dark-color3;
|
|
17
|
+
border-color: $-dark-background7;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@include when(dynamic-input) {
|
|
22
|
+
border-color: $-dark-background7;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@mixin tag-type-style($normalColor, $normalBg) {
|
|
5
28
|
background: $normalBg;
|
|
6
29
|
|
|
7
30
|
@include when(plain) {
|
|
8
31
|
background: transparent;
|
|
9
32
|
color: $normalColor;
|
|
10
|
-
border:
|
|
11
|
-
padding:
|
|
33
|
+
border-color: $normalColor;
|
|
34
|
+
padding: 12rpx 20rpx;
|
|
12
35
|
}
|
|
36
|
+
|
|
13
37
|
@include when(round) {
|
|
14
|
-
|
|
15
|
-
font-size: $-tag-fs;
|
|
16
|
-
padding: 4px 11px;
|
|
38
|
+
padding: 12rpx 24rpx;
|
|
17
39
|
background: transparent;
|
|
18
40
|
color: if($normalColor != $-tag-info-color, $normalColor, $-tag-round-color);
|
|
19
|
-
border:
|
|
41
|
+
border-color: if($normalColor != $-tag-info-color, $normalColor, $-tag-round-border-color);
|
|
20
42
|
border-radius: $-tag-round-radius;
|
|
21
43
|
}
|
|
44
|
+
|
|
22
45
|
@include when(mark) {
|
|
23
|
-
padding:
|
|
46
|
+
padding: 12rpx 20rpx;
|
|
24
47
|
border-radius: $-tag-mark-radius;
|
|
25
48
|
|
|
26
49
|
@include when(plain) {
|
|
27
|
-
padding:
|
|
50
|
+
padding: 8rpx 20rpx;
|
|
28
51
|
}
|
|
29
52
|
}
|
|
30
53
|
@include when(active) {
|
|
@@ -32,15 +55,24 @@
|
|
|
32
55
|
border-color: $-tag-primary-color;
|
|
33
56
|
}
|
|
34
57
|
}
|
|
58
|
+
|
|
35
59
|
@include b(tag) {
|
|
36
|
-
|
|
37
|
-
|
|
60
|
+
position: relative;
|
|
61
|
+
font-size: $-tag-fs;
|
|
62
|
+
display: inline-flex;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
align-items: center;
|
|
65
|
+
max-width: 100%;
|
|
66
|
+
box-sizing: border-box;
|
|
38
67
|
color: $-tag-color;
|
|
39
|
-
padding:
|
|
40
|
-
|
|
41
|
-
|
|
68
|
+
padding: 12rpx 20rpx;
|
|
69
|
+
min-height: 64rpx;
|
|
70
|
+
border: 1px solid transparent;
|
|
71
|
+
border-radius: $-tag-radius;
|
|
72
|
+
transition: opacity .2s, color .2s, border-color .2s, background-color .2s;
|
|
42
73
|
vertical-align: middle;
|
|
43
|
-
line-height:
|
|
74
|
+
line-height: 1.4;
|
|
75
|
+
white-space: nowrap;
|
|
44
76
|
|
|
45
77
|
@include when(default) {
|
|
46
78
|
@include tag-type-style($-tag-info-color, $-tag-info-bg);
|
|
@@ -58,58 +90,101 @@
|
|
|
58
90
|
@include tag-type-style($-tag-success-color, $-tag-success-bg);
|
|
59
91
|
}
|
|
60
92
|
@include when(icon) {
|
|
61
|
-
|
|
62
|
-
line-height: 1.2;
|
|
63
|
-
padding: 2px 5px;
|
|
93
|
+
padding: 12rpx 20rpx;
|
|
64
94
|
}
|
|
95
|
+
|
|
65
96
|
@include when(dynamic) {
|
|
66
97
|
box-sizing: border-box;
|
|
67
|
-
width:
|
|
68
|
-
|
|
98
|
+
width: auto;
|
|
99
|
+
min-width: 176rpx;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
transition: color .3s, border-color .3s, background-color .3s;
|
|
102
|
+
|
|
103
|
+
.oxy-tag__text {
|
|
104
|
+
display: inline-flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
line-height: inherit;
|
|
108
|
+
|
|
109
|
+
:deep(text) {
|
|
110
|
+
display: inline-block;
|
|
111
|
+
line-height: inherit;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
69
114
|
|
|
70
115
|
&:active {
|
|
71
116
|
color: $-tag-primary-color;
|
|
72
117
|
border-color: $-tag-primary-color;
|
|
73
118
|
}
|
|
74
119
|
}
|
|
120
|
+
|
|
75
121
|
@include when(dynamic-input) {
|
|
76
122
|
border-color: $-tag-primary-color;
|
|
123
|
+
justify-content: flex-start;
|
|
77
124
|
}
|
|
125
|
+
|
|
78
126
|
@include edeep(icon) {
|
|
79
|
-
display: inline-
|
|
80
|
-
|
|
127
|
+
display: inline-flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
justify-content: center;
|
|
130
|
+
margin-right: 12rpx;
|
|
81
131
|
font-size: $-tag-fs;
|
|
82
|
-
line-height: 1
|
|
83
|
-
vertical-align:
|
|
132
|
+
line-height: 1;
|
|
133
|
+
vertical-align: middle;
|
|
84
134
|
}
|
|
135
|
+
|
|
85
136
|
@include e(text) {
|
|
86
137
|
display: inline-block;
|
|
87
|
-
|
|
138
|
+
max-width: 100%;
|
|
139
|
+
overflow: hidden;
|
|
140
|
+
text-overflow: ellipsis;
|
|
141
|
+
white-space: nowrap;
|
|
142
|
+
vertical-align: middle;
|
|
88
143
|
}
|
|
144
|
+
|
|
89
145
|
@include e(add-text) {
|
|
90
|
-
width:
|
|
91
|
-
|
|
92
|
-
|
|
146
|
+
width: 100%;
|
|
147
|
+
min-width: 0;
|
|
148
|
+
height: 56rpx;
|
|
149
|
+
min-height: 56rpx;
|
|
93
150
|
display: inline-block;
|
|
94
151
|
font-size: $-tag-fs;
|
|
152
|
+
line-height: 56rpx;
|
|
95
153
|
vertical-align: middle;
|
|
154
|
+
color: inherit;
|
|
96
155
|
padding: 0;
|
|
156
|
+
border: none;
|
|
157
|
+
background: transparent;
|
|
158
|
+
text-align: left;
|
|
159
|
+
|
|
160
|
+
&::placeholder {
|
|
161
|
+
color: $-font-gray-3;
|
|
162
|
+
}
|
|
97
163
|
}
|
|
164
|
+
|
|
98
165
|
@include e(close) {
|
|
99
|
-
display: inline-
|
|
100
|
-
|
|
101
|
-
|
|
166
|
+
display: inline-flex;
|
|
167
|
+
align-items: center;
|
|
168
|
+
justify-content: center;
|
|
169
|
+
margin-left: 16rpx;
|
|
170
|
+
margin-right: 0;
|
|
102
171
|
font-size: $-tag-close-size;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
172
|
+
width: $-tag-close-size;
|
|
173
|
+
height: $-tag-close-size;
|
|
174
|
+
line-height: 1;
|
|
175
|
+
vertical-align: middle;
|
|
106
176
|
color: $-tag-close-color;
|
|
177
|
+
opacity: 0.7;
|
|
178
|
+
transition: opacity .2s, color .2s;
|
|
107
179
|
|
|
108
180
|
&:active {
|
|
181
|
+
opacity: 1;
|
|
109
182
|
color: $-tag-close-active-color;
|
|
110
183
|
}
|
|
111
184
|
}
|
|
185
|
+
|
|
112
186
|
@include edeep(add) {
|
|
113
|
-
vertical-align:
|
|
187
|
+
vertical-align: middle;
|
|
188
|
+
line-height: 1;
|
|
114
189
|
}
|
|
115
|
-
}
|
|
190
|
+
}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<oxy-tooltip v-if="props.tooltip && isTextOverflow" :content="formattedText">
|
|
3
|
+
<text @click="handleClick" :class="`${rootClass} is-lines-${props.lines}`" :style="rootStyle">
|
|
4
|
+
<slot v-if="$slots.prefix || prefix" name="prefix">{{ prefix }}</slot>
|
|
5
|
+
<text>{{ formattedText }}</text>
|
|
6
|
+
<slot v-if="$slots.suffix || suffix" name="suffix">{{ suffix }}</slot>
|
|
7
|
+
</text>
|
|
8
|
+
</oxy-tooltip>
|
|
9
|
+
<text v-else :id="textId" @click="handleClick" :class="rootClass" :style="rootStyle">
|
|
3
10
|
<slot v-if="$slots.prefix || prefix" name="prefix">{{ prefix }}</slot>
|
|
4
|
-
<text>{{ formattedText }}</text>
|
|
11
|
+
<text>{{ props.toggleExpand && isTextOverflow && !expanded ? realText : formattedText }}</text>
|
|
5
12
|
<slot v-if="$slots.suffix || suffix" name="suffix">{{ suffix }}</slot>
|
|
13
|
+
<text v-if="props.toggleExpand && isTextOverflow" class="oxy-text__btn" @click.stop="handleToggle">{{ expanded ? '收起' : '展开' }}</text>
|
|
6
14
|
</text>
|
|
7
15
|
</template>
|
|
8
16
|
|
|
@@ -18,15 +26,24 @@ export default {
|
|
|
18
26
|
</script>
|
|
19
27
|
|
|
20
28
|
<script lang="ts" setup>
|
|
21
|
-
import { computed, ref, watch } from 'vue'
|
|
22
|
-
import { isDef, objToStyle } from '../common/util'
|
|
29
|
+
import { computed, ref, watch, nextTick, getCurrentInstance } from 'vue'
|
|
30
|
+
import { isDef, objToStyle, uuid, getRect } from '../common/util'
|
|
23
31
|
import { textProps } from './types'
|
|
24
32
|
import dayjs from '../../dayjs'
|
|
33
|
+
import OxyTooltip from '../oxy-tooltip/oxy-tooltip.vue'
|
|
25
34
|
|
|
26
35
|
// 获取组件的 props 和 emit 函数
|
|
27
36
|
const props = defineProps(textProps)
|
|
28
37
|
const emit = defineEmits(['click'])
|
|
29
38
|
|
|
39
|
+
const { proxy } = getCurrentInstance() as any
|
|
40
|
+
const textId = ref<string>(`oxy-text${uuid()}`)
|
|
41
|
+
const expanded = ref<boolean>(false)
|
|
42
|
+
const isTextOverflow = ref<boolean>(false)
|
|
43
|
+
const realText = ref<string>('')
|
|
44
|
+
const offset = ref<number>(0)
|
|
45
|
+
const showTooltip = ref<boolean>(false)
|
|
46
|
+
|
|
30
47
|
// 存储文本类名的响应式变量
|
|
31
48
|
const textClass = ref<string>('')
|
|
32
49
|
|
|
@@ -39,7 +56,9 @@ watch(
|
|
|
39
56
|
color: props.color,
|
|
40
57
|
bold: props.bold,
|
|
41
58
|
lines: props.lines,
|
|
42
|
-
format: props.format
|
|
59
|
+
format: props.format,
|
|
60
|
+
toggleExpand: props.toggleExpand,
|
|
61
|
+
tooltip: props.tooltip
|
|
43
62
|
}),
|
|
44
63
|
({ type }) => {
|
|
45
64
|
// 验证 type 属性
|
|
@@ -77,12 +96,12 @@ const rootStyle = computed(() => {
|
|
|
77
96
|
|
|
78
97
|
// 计算文本类名的函数
|
|
79
98
|
function computeTextClass() {
|
|
80
|
-
const { type, color, bold, lines } = props
|
|
99
|
+
const { type, color, bold, lines, toggleExpand, tooltip } = props
|
|
81
100
|
const textClassList: string[] = []
|
|
82
101
|
if (!color) {
|
|
83
102
|
textClassList.push(`is-${type}`)
|
|
84
103
|
}
|
|
85
|
-
if (isDef(lines)) {
|
|
104
|
+
if (isDef(lines) && !toggleExpand && !tooltip) {
|
|
86
105
|
textClassList.push(`is-lines-${lines}`)
|
|
87
106
|
}
|
|
88
107
|
bold && textClassList.push('is-bold')
|
|
@@ -128,6 +147,56 @@ const formattedText = computed(() => {
|
|
|
128
147
|
return formatText(`${text}`, format, mode)
|
|
129
148
|
})
|
|
130
149
|
|
|
150
|
+
watch(
|
|
151
|
+
formattedText,
|
|
152
|
+
(value) => {
|
|
153
|
+
nextTick(() => {
|
|
154
|
+
if (props.toggleExpand || props.tooltip) {
|
|
155
|
+
realText.value = value
|
|
156
|
+
offset.value = realText.value.length
|
|
157
|
+
const view = uni.createSelectorQuery().in(proxy).select(`#${textId.value}`)
|
|
158
|
+
view
|
|
159
|
+
.fields({ computedStyle: ['fontSize', 'lineHeight'] }, (res: any) => {
|
|
160
|
+
getRect(`#${textId.value}`, true, proxy)
|
|
161
|
+
.then((rects: any) => {
|
|
162
|
+
if (res && Array.isArray(rects) && rects.length && props.lines) {
|
|
163
|
+
const lines = rects[0].height / Number.parseFloat(res.lineHeight.replace('px', ''))
|
|
164
|
+
isTextOverflow.value = lines > props.lines
|
|
165
|
+
if (props.toggleExpand && isTextOverflow.value) {
|
|
166
|
+
const size = Math.floor(rects[0].width / Number.parseFloat(res.fontSize.replace('px', '')))
|
|
167
|
+
// 中英文字符长度区分
|
|
168
|
+
const length = size * props.lines - 4
|
|
169
|
+
let realOffset = 0
|
|
170
|
+
let realLength = 0
|
|
171
|
+
for (let i = 0; i < offset.value; i++) {
|
|
172
|
+
if (realText.value.charCodeAt(i) > 127) {
|
|
173
|
+
realLength += 1
|
|
174
|
+
} else {
|
|
175
|
+
realLength += 0.5
|
|
176
|
+
}
|
|
177
|
+
realOffset++
|
|
178
|
+
if (realLength >= length) {
|
|
179
|
+
offset.value = realOffset
|
|
180
|
+
break
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
realText.value = `${value.substring(0, offset.value)}...`
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
})
|
|
187
|
+
.catch(() => {})
|
|
188
|
+
})
|
|
189
|
+
.exec()
|
|
190
|
+
}
|
|
191
|
+
})
|
|
192
|
+
},
|
|
193
|
+
{ deep: true, immediate: true }
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
function handleToggle() {
|
|
197
|
+
expanded.value = !expanded.value
|
|
198
|
+
}
|
|
199
|
+
|
|
131
200
|
// 处理点击事件
|
|
132
201
|
function handleClick(event: Event) {
|
|
133
202
|
emit('click', event)
|
|
@@ -79,6 +79,18 @@ export const textProps = {
|
|
|
79
79
|
* 文本显示的行数,如果设置,超出此行数,将会显示省略号。最大值为5。
|
|
80
80
|
*/
|
|
81
81
|
lines: Number,
|
|
82
|
+
/**
|
|
83
|
+
* 文本超出,展开收起显示全部
|
|
84
|
+
* 类型:boolean
|
|
85
|
+
* 默认值:false
|
|
86
|
+
*/
|
|
87
|
+
toggleExpand: makeBooleanProp(false),
|
|
88
|
+
/**
|
|
89
|
+
* 文本超出,tooltip显示全部
|
|
90
|
+
* 类型:boolean
|
|
91
|
+
* 默认值:false
|
|
92
|
+
*/
|
|
93
|
+
tooltip: makeBooleanProp(false),
|
|
82
94
|
/**
|
|
83
95
|
* 文本行高
|
|
84
96
|
* 类型:string
|
|
@@ -144,11 +144,11 @@
|
|
|
144
144
|
box-sizing: border-box;
|
|
145
145
|
|
|
146
146
|
@include when(show-limit) {
|
|
147
|
-
padding-bottom:
|
|
147
|
+
padding-bottom: 72rpx;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
@include when(suffix) {
|
|
151
|
-
padding-right: calc($-textarea-icon-size +
|
|
151
|
+
padding-right: calc($-textarea-icon-size + 16rpx);
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
border: none;
|
|
165
165
|
box-sizing: border-box;
|
|
166
166
|
word-break: break-word;
|
|
167
|
-
min-height:
|
|
167
|
+
min-height: 56rpx;
|
|
168
168
|
|
|
169
169
|
&::-webkit-input-placeholder {
|
|
170
170
|
color: $-input-placeholder-color;
|
|
@@ -198,12 +198,12 @@
|
|
|
198
198
|
|
|
199
199
|
@include e(count) {
|
|
200
200
|
position: absolute;
|
|
201
|
-
bottom:
|
|
201
|
+
bottom: 16rpx;
|
|
202
202
|
right: 0;
|
|
203
203
|
font-size: $-textarea-count-fs;
|
|
204
204
|
color: $-textarea-count-color;
|
|
205
205
|
background: $-textarea-bg;
|
|
206
|
-
line-height:
|
|
206
|
+
line-height: 48rpx;
|
|
207
207
|
display: inline-flex;
|
|
208
208
|
}
|
|
209
209
|
|
|
@@ -258,7 +258,7 @@
|
|
|
258
258
|
|
|
259
259
|
@include when(auto-height) {
|
|
260
260
|
&:not(.is-cell) {
|
|
261
|
-
padding:
|
|
261
|
+
padding: 16rpx 0;
|
|
262
262
|
}
|
|
263
263
|
|
|
264
264
|
&::after {
|
|
@@ -31,8 +31,10 @@
|
|
|
31
31
|
:class-prefix="classPrefix"
|
|
32
32
|
:name="iconClass"
|
|
33
33
|
></oxy-icon>
|
|
34
|
-
|
|
35
|
-
<view v-if="
|
|
34
|
+
<!--文本/插槽内容-->
|
|
35
|
+
<view v-if="hasContent" class="oxy-toast__msg">
|
|
36
|
+
<slot>{{ msg }}</slot>
|
|
37
|
+
</view>
|
|
36
38
|
</view>
|
|
37
39
|
</oxy-transition>
|
|
38
40
|
</template>
|
|
@@ -54,13 +56,14 @@ import OxyLoading from '../oxy-loading/oxy-loading.vue'
|
|
|
54
56
|
import OxyOverlay from '../oxy-overlay/oxy-overlay.vue'
|
|
55
57
|
import OxyTransition from '../oxy-transition/oxy-transition.vue'
|
|
56
58
|
|
|
57
|
-
import { computed, inject, onBeforeMount, ref, watch, type CSSProperties } from 'vue'
|
|
59
|
+
import { computed, inject, onBeforeMount, ref, useSlots, watch, type CSSProperties } from 'vue'
|
|
58
60
|
import base64 from '../common/base64'
|
|
59
61
|
import { defaultOptions, getToastOptionKey, toastIcon } from '.'
|
|
60
62
|
import { toastProps, type ToastDirection, type ToastLoadingType, type ToastOptions, type ToastProps } from './types'
|
|
61
|
-
import {
|
|
63
|
+
import { withDefaultUnit, isDef, isFunction, objToStyle } from '../common/util'
|
|
62
64
|
|
|
63
65
|
const props = defineProps(toastProps)
|
|
66
|
+
const slots = useSlots()
|
|
64
67
|
const iconName = ref<string>('') // 图标类型
|
|
65
68
|
const msg = ref<string>('') // 消息内容
|
|
66
69
|
const position = ref<string>('middle')
|
|
@@ -124,10 +127,19 @@ const transitionStyle = computed(() => {
|
|
|
124
127
|
return objToStyle(style)
|
|
125
128
|
})
|
|
126
129
|
|
|
130
|
+
const hasCustomContent = computed(() => {
|
|
131
|
+
const slotNodes = slots.default?.()
|
|
132
|
+
return !!slotNodes?.length
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
const hasContent = computed(() => {
|
|
136
|
+
return !!msg.value || hasCustomContent.value
|
|
137
|
+
})
|
|
138
|
+
|
|
127
139
|
const rootClass = computed(() => {
|
|
128
140
|
return `oxy-toast ${props.customClass} oxy-toast--${position.value} ${
|
|
129
|
-
(iconName.value !== 'loading' ||
|
|
130
|
-
} ${iconName.value === 'loading' && !
|
|
141
|
+
(iconName.value !== 'loading' || hasContent.value) && (iconName.value || iconClass.value) ? 'oxy-toast--with-icon' : ''
|
|
142
|
+
} ${iconName.value === 'loading' && !hasContent.value ? 'oxy-toast--loading' : ''} ${direction.value === 'vertical' ? 'is-vertical' : ''}`
|
|
131
143
|
})
|
|
132
144
|
|
|
133
145
|
const svgStyle = computed(() => {
|
|
@@ -184,8 +196,12 @@ function mergeOptionsWithProps(option: ToastOptions, props: ToastProps) {
|
|
|
184
196
|
zIndex.value = isDef(option.zIndex!) ? option.zIndex! : props.zIndex
|
|
185
197
|
loadingType.value = isDef(option.loadingType!) ? option.loadingType! : props.loadingType
|
|
186
198
|
loadingColor.value = isDef(option.loadingColor!) ? option.loadingColor! : props.loadingColor
|
|
187
|
-
iconSize.value = isDef(option.iconSize) ?
|
|
188
|
-
loadingSize.value = isDef(option.loadingSize)
|
|
199
|
+
iconSize.value = isDef(option.iconSize) ? withDefaultUnit(option.iconSize) : isDef(props.iconSize) ? withDefaultUnit(props.iconSize) : undefined
|
|
200
|
+
loadingSize.value = isDef(option.loadingSize)
|
|
201
|
+
? withDefaultUnit(option.loadingSize)
|
|
202
|
+
: isDef(props.loadingSize)
|
|
203
|
+
? withDefaultUnit(props.loadingSize)
|
|
204
|
+
: undefined
|
|
189
205
|
cover.value = isDef(option.cover!) ? option.cover! : props.cover
|
|
190
206
|
classPrefix.value = isDef(option.classPrefix) ? option.classPrefix : props.classPrefix
|
|
191
207
|
direction.value = isDef(option.direction) ? option.direction : props.direction
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
|
|
23
23
|
@include edeep(pos) {
|
|
24
24
|
position: absolute;
|
|
25
|
-
min-width:
|
|
26
|
-
min-height:
|
|
25
|
+
min-width: 276rpx;
|
|
26
|
+
min-height: 72rpx;
|
|
27
27
|
font-size: $-tooltip-fs;
|
|
28
28
|
backdrop-filter: blur($-tooltip-blur);
|
|
29
29
|
background-clip: padding-box;
|
|
30
30
|
border-radius: $-tooltip-radius;
|
|
31
31
|
background: $-tooltip-bg;
|
|
32
32
|
color: $-tooltip-color;
|
|
33
|
-
text-align: center;
|
|
33
|
+
// text-align: center;
|
|
34
34
|
box-sizing: border-box;
|
|
35
35
|
z-index: $-tooltip-z-index;
|
|
36
36
|
}
|
|
@@ -49,18 +49,18 @@
|
|
|
49
49
|
|
|
50
50
|
@include e(inner) {
|
|
51
51
|
padding: $-tooltip-padding;
|
|
52
|
-
white-space: nowrap;
|
|
52
|
+
// white-space: nowrap;
|
|
53
53
|
line-height: $-tooltip-line-height;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
@include edeep(close-icon) {
|
|
57
|
-
font-size:
|
|
57
|
+
font-size: calc(2 * #{$-tooltip-close-size});
|
|
58
58
|
position: absolute;
|
|
59
|
-
right: -
|
|
60
|
-
top: -
|
|
59
|
+
right: -16rpx;
|
|
60
|
+
top: -20rpx;
|
|
61
61
|
transform: scale(0.5);
|
|
62
|
-
padding:
|
|
62
|
+
padding: 20rpx;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
@include triangleArrow($-tooltip-arrow-size, $-tooltip-bg);
|
|
66
|
-
}
|
|
66
|
+
}
|
|
@@ -26,15 +26,18 @@
|
|
|
26
26
|
.oxy-tree__search{
|
|
27
27
|
display: flex;
|
|
28
28
|
:deep(.oxy-button){
|
|
29
|
-
min-width:
|
|
29
|
+
min-width: 120rpx;
|
|
30
30
|
}
|
|
31
31
|
:deep(.oxy-tree__search-input) {
|
|
32
32
|
flex: 1;
|
|
33
33
|
background-color: $-tree-search-input-color;
|
|
34
|
-
padding:
|
|
35
|
-
border-radius:
|
|
36
|
-
margin-bottom:
|
|
37
|
-
margin-right:
|
|
34
|
+
padding: 16rpx 24rpx;
|
|
35
|
+
border-radius: $-tree-search-input-radius;
|
|
36
|
+
margin-bottom: 20rpx;
|
|
37
|
+
margin-right: 24rpx;
|
|
38
|
+
.oxy-input__icon{
|
|
39
|
+
background: transparent;
|
|
40
|
+
}
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
43
|
|
|
@@ -43,18 +46,20 @@
|
|
|
43
46
|
|
|
44
47
|
.oxy-tree-node-content {
|
|
45
48
|
display: flex;
|
|
46
|
-
width: fit-content;
|
|
47
49
|
width: 100%;
|
|
48
|
-
white-space: nowrap;
|
|
49
50
|
align-items: center;
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
padding-right: $-tree-node-padding-right;
|
|
53
|
+
border-radius: $-tree-node-radius;
|
|
54
|
+
color: $-color-secondary;
|
|
55
|
+
font-size: $-tree-node-font-size;
|
|
56
|
+
transition: background-color .2s ease, color .2s ease, opacity .2s ease;
|
|
50
57
|
|
|
51
|
-
&.
|
|
52
|
-
|
|
53
|
-
|
|
58
|
+
&.is-leaf {
|
|
59
|
+
.oxy-tree-node-toggle {
|
|
60
|
+
pointer-events: none;
|
|
54
61
|
}
|
|
55
|
-
}
|
|
56
62
|
|
|
57
|
-
&.is-leaf {
|
|
58
63
|
:deep(.oxy-tree-node-icon) {
|
|
59
64
|
opacity: 0;
|
|
60
65
|
}
|
|
@@ -63,14 +68,31 @@
|
|
|
63
68
|
&.is-current {
|
|
64
69
|
background-color: $-tree-node-current-bg;
|
|
65
70
|
color: $-tree-node-current-color;
|
|
71
|
+
font-weight: $-fw-medium;
|
|
72
|
+
|
|
73
|
+
:deep(.oxy-tree-node-icon) {
|
|
74
|
+
color: $-tree-node-icon-active-color;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&.checked {
|
|
79
|
+
:deep(.oxy-tree-node-icon) {
|
|
80
|
+
color: $-tree-node-icon-active-color;
|
|
81
|
+
}
|
|
66
82
|
}
|
|
67
83
|
|
|
68
84
|
&.is-disabled {
|
|
69
85
|
color: $-tree-node-disabled-color;
|
|
86
|
+
opacity: $-tree-disabled-opacity;
|
|
87
|
+
|
|
88
|
+
:deep(.oxy-tree-node-icon) {
|
|
89
|
+
color: $-tree-node-disabled-color;
|
|
90
|
+
}
|
|
70
91
|
}
|
|
71
92
|
|
|
72
93
|
:deep(.oxy-checkbox) {
|
|
73
|
-
margin-right:
|
|
94
|
+
margin-right: $-size-side-padding-small;
|
|
95
|
+
flex-shrink: 0;
|
|
74
96
|
|
|
75
97
|
.oxy-checkbox__label {
|
|
76
98
|
display: none;
|
|
@@ -90,10 +112,24 @@
|
|
|
90
112
|
}
|
|
91
113
|
|
|
92
114
|
:deep(.oxy-tree-node-icon) {
|
|
93
|
-
|
|
115
|
+
color: $-tree-node-icon-color;
|
|
116
|
+
font-size: $-tree-node-icon-size;
|
|
117
|
+
transition: none;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.oxy-tree-node-toggle {
|
|
121
|
+
width: $-tree-node-icon-box-size;
|
|
122
|
+
height: 100%;
|
|
123
|
+
display: flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
justify-content: center;
|
|
126
|
+
margin-right: $-tree-node-icon-gap;
|
|
127
|
+
flex-shrink: 0;
|
|
94
128
|
}
|
|
95
129
|
|
|
96
130
|
.oxy-tree-node {
|
|
97
131
|
flex: 1;
|
|
132
|
+
min-width: 0;
|
|
133
|
+
@include lineEllipsis;
|
|
98
134
|
}
|
|
99
|
-
}
|
|
135
|
+
}
|