lumen-plus 0.0.3 → 0.0.5
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/dist/index.js +2 -0
- package/dist/theme-chalk/_index.scss +69 -0
- package/dist/theme-chalk/_reset.scss +16 -0
- package/dist/theme-chalk/_variables.scss +91 -0
- package/dist/theme-chalk/affix.scss +8 -0
- package/dist/theme-chalk/alert.scss +140 -0
- package/dist/theme-chalk/autocomplete.scss +238 -0
- package/dist/theme-chalk/avatar.scss +49 -0
- package/dist/theme-chalk/backtop.scss +55 -0
- package/dist/theme-chalk/badge.scss +47 -0
- package/dist/theme-chalk/breadcrumb.scss +50 -0
- package/dist/theme-chalk/button.scss +472 -0
- package/dist/theme-chalk/calendar.scss +166 -0
- package/dist/theme-chalk/card.scss +70 -0
- package/dist/theme-chalk/carousel.scss +167 -0
- package/dist/theme-chalk/cascader.scss +265 -0
- package/dist/theme-chalk/checkbox.scss +127 -0
- package/dist/theme-chalk/collapse.scss +100 -0
- package/dist/theme-chalk/color-picker.scss +247 -0
- package/dist/theme-chalk/container.scss +79 -0
- package/dist/theme-chalk/date-picker.scss +352 -0
- package/dist/theme-chalk/date-time-picker.scss +396 -0
- package/dist/theme-chalk/descriptions.scss +160 -0
- package/dist/theme-chalk/dialog.scss +154 -0
- package/dist/theme-chalk/divider.scss +61 -0
- package/dist/theme-chalk/drawer.scss +211 -0
- package/dist/theme-chalk/dropdown.scss +230 -0
- package/dist/theme-chalk/empty.scss +36 -0
- package/dist/theme-chalk/form.scss +187 -0
- package/dist/theme-chalk/icon.scss +16 -0
- package/dist/theme-chalk/image.scss +171 -0
- package/dist/theme-chalk/input-number.scss +229 -0
- package/dist/theme-chalk/input-tag.scss +119 -0
- package/dist/theme-chalk/input.scss +249 -0
- package/dist/theme-chalk/link.scss +28 -0
- package/dist/theme-chalk/loading.scss +68 -0
- package/dist/theme-chalk/menu.scss +239 -0
- package/dist/theme-chalk/message.scss +150 -0
- package/dist/theme-chalk/messagebox.scss +76 -0
- package/dist/theme-chalk/mixins/_bem.scss +103 -0
- package/dist/theme-chalk/mixins/_function.scss +12 -0
- package/dist/theme-chalk/notification.scss +164 -0
- package/dist/theme-chalk/pagination.scss +130 -0
- package/dist/theme-chalk/pin-input.scss +192 -0
- package/dist/theme-chalk/popconfirm.scss +194 -0
- package/dist/theme-chalk/popover.scss +196 -0
- package/dist/theme-chalk/progress.scss +51 -0
- package/dist/theme-chalk/radio.scss +128 -0
- package/dist/theme-chalk/rating.scss +227 -0
- package/dist/theme-chalk/result.scss +80 -0
- package/dist/theme-chalk/segmented.scss +108 -0
- package/dist/theme-chalk/select.scss +301 -0
- package/dist/theme-chalk/skeleton.scss +113 -0
- package/dist/theme-chalk/slider.scss +259 -0
- package/dist/theme-chalk/space.scss +44 -0
- package/dist/theme-chalk/statistic.scss +49 -0
- package/dist/theme-chalk/steps.scss +255 -0
- package/dist/theme-chalk/switch.scss +277 -0
- package/dist/theme-chalk/table.scss +343 -0
- package/dist/theme-chalk/tabs.scss +433 -0
- package/dist/theme-chalk/tag.scss +143 -0
- package/dist/theme-chalk/textarea.scss +125 -0
- package/dist/theme-chalk/time-picker.scss +321 -0
- package/dist/theme-chalk/timeline.scss +119 -0
- package/dist/theme-chalk/tooltip.scss +165 -0
- package/dist/theme-chalk/transfer.scss +219 -0
- package/dist/theme-chalk/tree-select.scss +384 -0
- package/dist/theme-chalk/tree.scss +101 -0
- package/dist/theme-chalk/upload.scss +457 -0
- package/dist/theme-chalk/watermark.scss +30 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/transitions.js +31 -0
- package/package.json +8 -2
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
@use './variables' as *;
|
|
2
|
+
@use './mixins/bem' as *;
|
|
3
|
+
@use './mixins/function' as *;
|
|
4
|
+
|
|
5
|
+
@keyframes lm-input-autofill {
|
|
6
|
+
from {
|
|
7
|
+
}
|
|
8
|
+
to {
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@include b(input) {
|
|
13
|
+
position: relative;
|
|
14
|
+
display: inline-block;
|
|
15
|
+
width: 100%;
|
|
16
|
+
font-size: $font-size-base;
|
|
17
|
+
line-height: 1.5;
|
|
18
|
+
|
|
19
|
+
@include m(small) {
|
|
20
|
+
font-size: $font-size-small;
|
|
21
|
+
|
|
22
|
+
.#{$namespace}-input__inner {
|
|
23
|
+
height: 24px;
|
|
24
|
+
padding: 0 11px;
|
|
25
|
+
line-height: 24px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.#{$namespace}-input__clear {
|
|
29
|
+
width: 14px;
|
|
30
|
+
height: 14px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@include m(medium) {
|
|
35
|
+
.#{$namespace}-input__inner {
|
|
36
|
+
height: 32px;
|
|
37
|
+
padding: 0 11px;
|
|
38
|
+
line-height: 32px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.#{$namespace}-input__clear {
|
|
42
|
+
width: 16px;
|
|
43
|
+
height: 16px;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@include m(large) {
|
|
48
|
+
font-size: $font-size-large;
|
|
49
|
+
|
|
50
|
+
.#{$namespace}-input__inner {
|
|
51
|
+
height: 40px;
|
|
52
|
+
padding: 0 11px;
|
|
53
|
+
line-height: 40px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.#{$namespace}-input__clear {
|
|
57
|
+
width: 20px;
|
|
58
|
+
height: 20px;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@include when(disabled) {
|
|
63
|
+
cursor: not-allowed;
|
|
64
|
+
|
|
65
|
+
.#{$namespace}-input__inner {
|
|
66
|
+
background-color: #f5f7fa;
|
|
67
|
+
color: #a8abb2;
|
|
68
|
+
cursor: not-allowed;
|
|
69
|
+
border-color: $border-color-lighter;
|
|
70
|
+
|
|
71
|
+
&:hover,
|
|
72
|
+
&:focus {
|
|
73
|
+
border-color: $border-color-lighter;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@include when(focused) {
|
|
79
|
+
.#{$namespace}-input__inner {
|
|
80
|
+
border-color: $color-primary;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&.has-prefix {
|
|
85
|
+
.#{$namespace}-input__inner {
|
|
86
|
+
padding-left: 36px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&.has-suffix {
|
|
91
|
+
.#{$namespace}-input__inner {
|
|
92
|
+
padding-right: 36px;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&.has-suffix-2 {
|
|
97
|
+
.#{$namespace}-input__inner {
|
|
98
|
+
padding-right: 60px;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&.has-suffix-3 {
|
|
103
|
+
.#{$namespace}-input__inner {
|
|
104
|
+
padding-right: 84px;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@include e(inner) {
|
|
109
|
+
width: 100%;
|
|
110
|
+
height: 40px;
|
|
111
|
+
padding: 0 11px;
|
|
112
|
+
border: 1px solid $border-color-base;
|
|
113
|
+
border-radius: $border-radius-medium;
|
|
114
|
+
background-color: $bg-color;
|
|
115
|
+
color: $color-text-primary;
|
|
116
|
+
outline: none;
|
|
117
|
+
transition: border-color 0.2s;
|
|
118
|
+
box-sizing: border-box;
|
|
119
|
+
|
|
120
|
+
&::placeholder {
|
|
121
|
+
color: $color-text-placeholder;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&:hover:not(:disabled):not(:focus) {
|
|
125
|
+
border-color: #c0c4cc;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&:focus {
|
|
129
|
+
border-color: $color-primary;
|
|
130
|
+
outline: none;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Chrome/Safari: 通过 animationstart 事件探测 autofill(避免 JS 轮询)
|
|
134
|
+
&:-webkit-autofill {
|
|
135
|
+
animation-name: lm-input-autofill;
|
|
136
|
+
animation-duration: 0.01s;
|
|
137
|
+
animation-iteration-count: 1;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@include e(prefix) {
|
|
142
|
+
position: absolute;
|
|
143
|
+
left: 12px;
|
|
144
|
+
top: 50%;
|
|
145
|
+
transform: translateY(-50%);
|
|
146
|
+
display: flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
color: $color-text-secondary;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@include e(suffix) {
|
|
152
|
+
position: absolute;
|
|
153
|
+
right: 12px;
|
|
154
|
+
top: 50%;
|
|
155
|
+
transform: translateY(-50%);
|
|
156
|
+
display: flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
gap: 8px;
|
|
159
|
+
color: $color-text-secondary;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@include e(clear) {
|
|
163
|
+
display: flex;
|
|
164
|
+
align-items: center;
|
|
165
|
+
justify-content: center;
|
|
166
|
+
border: none;
|
|
167
|
+
background: transparent;
|
|
168
|
+
color: $color-text-secondary;
|
|
169
|
+
cursor: pointer;
|
|
170
|
+
padding: 0;
|
|
171
|
+
transition: color 0.2s;
|
|
172
|
+
|
|
173
|
+
&:hover {
|
|
174
|
+
color: $color-text-primary;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
svg {
|
|
178
|
+
width: 100%;
|
|
179
|
+
height: 100%;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
@include e(password) {
|
|
184
|
+
display: flex;
|
|
185
|
+
align-items: center;
|
|
186
|
+
justify-content: center;
|
|
187
|
+
border: none;
|
|
188
|
+
background: transparent;
|
|
189
|
+
color: $color-text-secondary;
|
|
190
|
+
cursor: pointer;
|
|
191
|
+
padding: 0;
|
|
192
|
+
transition: color 0.2s;
|
|
193
|
+
|
|
194
|
+
&:hover {
|
|
195
|
+
color: $color-text-primary;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
svg {
|
|
199
|
+
width: 100%;
|
|
200
|
+
height: 100%;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.dark {
|
|
206
|
+
.#{$namespace}-input {
|
|
207
|
+
.#{$namespace}-input__inner {
|
|
208
|
+
background-color: $bg-color-dark-light;
|
|
209
|
+
border-color: color-mix(in oklab, $bg-color-dark-lighter 70%, $color-text-dark-secondary);
|
|
210
|
+
color: $color-text-dark;
|
|
211
|
+
|
|
212
|
+
&::placeholder {
|
|
213
|
+
color: $color-text-dark-secondary;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
&:hover:not(:disabled):not(:focus) {
|
|
217
|
+
border-color: color-mix(in oklab, $bg-color-dark-lighter 55%, $color-text-dark-secondary);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
&:focus {
|
|
221
|
+
border-color: $color-primary;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
&.is-focused {
|
|
226
|
+
.#{$namespace}-input__inner {
|
|
227
|
+
border-color: $color-primary;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
&.is-disabled {
|
|
232
|
+
.#{$namespace}-input__inner {
|
|
233
|
+
background-color: $bg-color-dark-lighter;
|
|
234
|
+
color: $color-text-dark-secondary;
|
|
235
|
+
border-color: color-mix(in oklab, $bg-color-dark-lighter 75%, $color-text-dark-secondary);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.#{$namespace}-input__prefix,
|
|
240
|
+
.#{$namespace}-input__suffix,
|
|
241
|
+
.#{$namespace}-input__clear {
|
|
242
|
+
color: $color-text-dark-secondary;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.#{$namespace}-input__clear:hover {
|
|
246
|
+
color: $color-text-dark;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@use './variables' as *;
|
|
2
|
+
@use './mixins/bem' as *;
|
|
3
|
+
|
|
4
|
+
@include b('link') {
|
|
5
|
+
color: $color-text-regular;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
text-decoration: none;
|
|
8
|
+
transition: color 0.15s ease;
|
|
9
|
+
|
|
10
|
+
&:hover { opacity: 0.9; }
|
|
11
|
+
|
|
12
|
+
@include when('underline') { text-decoration: underline; }
|
|
13
|
+
@include when('disabled') { color: $color-text-placeholder; cursor: not-allowed; opacity: 0.7; }
|
|
14
|
+
|
|
15
|
+
@include m('default') { color: $color-text-regular; }
|
|
16
|
+
@include m('primary') { color: $color-primary; }
|
|
17
|
+
@include m('success') { color: $color-success; }
|
|
18
|
+
@include m('warning') { color: $color-warning; }
|
|
19
|
+
@include m('danger') { color: $color-danger; }
|
|
20
|
+
@include m('info') { color: $color-info; }
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.dark {
|
|
24
|
+
.#{$namespace}-link {
|
|
25
|
+
@include m('default') { color: $color-text-dark; }
|
|
26
|
+
@include when('disabled') { color: $color-text-dark-secondary; }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
@use './variables' as *;
|
|
2
|
+
@use './mixins/bem' as *;
|
|
3
|
+
|
|
4
|
+
@include b('loading') {
|
|
5
|
+
--#{$namespace}-loading-mask-bg: rgba(255, 255, 255, 0.9);
|
|
6
|
+
--#{$namespace}-loading-icon-color: #{$color-primary};
|
|
7
|
+
--#{$namespace}-loading-text-color: #{$color-primary};
|
|
8
|
+
--#{$namespace}-loading-z-index: #{$z-index-popper};
|
|
9
|
+
|
|
10
|
+
position: relative;
|
|
11
|
+
|
|
12
|
+
@include when('fullscreen') {
|
|
13
|
+
position: static;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@include e('mask') {
|
|
17
|
+
position: absolute;
|
|
18
|
+
top: 0;
|
|
19
|
+
left: 0;
|
|
20
|
+
right: 0;
|
|
21
|
+
bottom: 0;
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
z-index: var(--#{$namespace}-loading-z-index);
|
|
26
|
+
background: var(--#{$namespace}-loading-mask-bg);
|
|
27
|
+
backdrop-filter: blur(0px);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@include when('fullscreen') {
|
|
31
|
+
@include e('mask') {
|
|
32
|
+
position: fixed;
|
|
33
|
+
inset: 0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@include e('spinner') {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
align-items: center;
|
|
41
|
+
gap: 12px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@include e('icon') {
|
|
45
|
+
color: var(--#{$namespace}-loading-icon-color);
|
|
46
|
+
animation: loading-rotate 2s linear infinite;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@include e('text') {
|
|
50
|
+
margin: 0;
|
|
51
|
+
font-size: $font-size-base;
|
|
52
|
+
color: var(--#{$namespace}-loading-text-color);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@keyframes loading-rotate {
|
|
57
|
+
100% {
|
|
58
|
+
transform: rotate(360deg);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.dark {
|
|
63
|
+
.#{$namespace}-loading {
|
|
64
|
+
--#{$namespace}-loading-mask-bg: rgba(0, 0, 0, 0.45);
|
|
65
|
+
--#{$namespace}-loading-icon-color: #{$color-primary};
|
|
66
|
+
--#{$namespace}-loading-text-color: #{$color-primary};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
@use './variables' as *;
|
|
2
|
+
@use './mixins/bem' as *;
|
|
3
|
+
|
|
4
|
+
// Variables
|
|
5
|
+
$menu-easing: cubic-bezier(0.4, 0, 0.2, 1);
|
|
6
|
+
$menu-bg: #fff;
|
|
7
|
+
$menu-bg-hover: #f5f7fa;
|
|
8
|
+
$menu-bg-active: rgba($color-primary, 0.08);
|
|
9
|
+
|
|
10
|
+
@include b('menu') {
|
|
11
|
+
--menu-bg: #{$menu-bg};
|
|
12
|
+
--menu-bg-hover: #{$menu-bg-hover};
|
|
13
|
+
--menu-bg-active: #{$menu-bg-active};
|
|
14
|
+
--menu-text: #{$color-text};
|
|
15
|
+
--menu-text-secondary: #{$color-text-secondary};
|
|
16
|
+
--menu-text-disabled: #{$color-text-disabled};
|
|
17
|
+
--menu-border: #{$border-color-light};
|
|
18
|
+
|
|
19
|
+
background-color: var(--menu-bg);
|
|
20
|
+
margin: 0;
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
|
|
23
|
+
// 基础元素
|
|
24
|
+
@include e('list') { list-style: none; padding: 0; margin: 0; }
|
|
25
|
+
|
|
26
|
+
@include e('item') {
|
|
27
|
+
list-style: none;
|
|
28
|
+
margin: 0;
|
|
29
|
+
padding: 0;
|
|
30
|
+
position: relative;
|
|
31
|
+
|
|
32
|
+
&.is-active > .#{$namespace}-menu__item-content { color: $color-primary; }
|
|
33
|
+
&.has-active-child > .#{$namespace}-menu__item-content { color: $color-primary; background-color: transparent; }
|
|
34
|
+
&.is-disabled > .#{$namespace}-menu__item-content {
|
|
35
|
+
color: var(--menu-text-disabled);
|
|
36
|
+
cursor: not-allowed;
|
|
37
|
+
opacity: 0.6;
|
|
38
|
+
&:hover { background-color: transparent; color: var(--menu-text-disabled); }
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@include e('item-content') {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
color: var(--menu-text);
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
user-select: none;
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
transition: background-color 0.2s, color 0.2s, padding 0.3s $menu-easing, opacity 0.15s;
|
|
50
|
+
|
|
51
|
+
&:hover { color: $color-primary; }
|
|
52
|
+
&:focus { outline: none; }
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@include e('item-icon') {
|
|
56
|
+
display: inline-flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: center;
|
|
59
|
+
margin-right: 8px;
|
|
60
|
+
flex-shrink: 0;
|
|
61
|
+
color: inherit;
|
|
62
|
+
transition: margin 0.3s $menu-easing;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@include e('item-label') {
|
|
66
|
+
flex: 1;
|
|
67
|
+
font-size: 14px;
|
|
68
|
+
line-height: 1.5;
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
transition: opacity 0.25s $menu-easing, width 0.3s $menu-easing;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@include e('item-arrow') {
|
|
75
|
+
display: inline-flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
margin-left: 6px;
|
|
79
|
+
color: inherit;
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
padding: 0;
|
|
82
|
+
border: none;
|
|
83
|
+
background: transparent;
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
transition: transform 0.2s, opacity 0.25s $menu-easing, width 0.3s $menu-easing;
|
|
86
|
+
|
|
87
|
+
&.is-open { transform: rotate(180deg); }
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@include e('submenu') {
|
|
91
|
+
list-style: none;
|
|
92
|
+
padding: 4px 0 0 12px;
|
|
93
|
+
margin: 0;
|
|
94
|
+
transform-origin: top;
|
|
95
|
+
|
|
96
|
+
.#{$namespace}-menu__item { margin-bottom: 4px; &:last-child { margin-bottom: 0; } }
|
|
97
|
+
.#{$namespace}-menu__item-content { padding: 8px 16px; }
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@include e('popup') {
|
|
101
|
+
position: absolute;
|
|
102
|
+
list-style: none;
|
|
103
|
+
padding: 6px;
|
|
104
|
+
margin: 0;
|
|
105
|
+
min-width: 160px;
|
|
106
|
+
background-color: var(--menu-bg);
|
|
107
|
+
border: 1px solid var(--menu-border);
|
|
108
|
+
border-radius: $border-radius-base;
|
|
109
|
+
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
|
110
|
+
z-index: 100;
|
|
111
|
+
transform-origin: top left;
|
|
112
|
+
|
|
113
|
+
.#{$namespace}-menu__item { margin-bottom: 4px; &:last-child { margin-bottom: 0; } }
|
|
114
|
+
.#{$namespace}-menu__item-content {
|
|
115
|
+
padding: 10px 16px;
|
|
116
|
+
border-radius: $border-radius-base;
|
|
117
|
+
&:hover { background-color: var(--menu-bg-hover); }
|
|
118
|
+
}
|
|
119
|
+
.#{$namespace}-menu__item.is-active > .#{$namespace}-menu__item-content {
|
|
120
|
+
color: $color-primary;
|
|
121
|
+
background-color: var(--menu-bg-active);
|
|
122
|
+
}
|
|
123
|
+
.#{$namespace}-menu__item-arrow { margin-left: auto; &.is-open { transform: none; } }
|
|
124
|
+
|
|
125
|
+
&--nested { top: 0; left: 100%; margin-left: 4px; transform-origin: left top; }
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@include e('group') {
|
|
129
|
+
display: block;
|
|
130
|
+
padding: 8px 16px;
|
|
131
|
+
font-size: 12px;
|
|
132
|
+
color: var(--menu-text-secondary);
|
|
133
|
+
user-select: none;
|
|
134
|
+
cursor: default;
|
|
135
|
+
list-style: none;
|
|
136
|
+
white-space: nowrap;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// 垂直模式
|
|
140
|
+
&--vertical {
|
|
141
|
+
padding: 8px;
|
|
142
|
+
width: 220px;
|
|
143
|
+
transition: width 0.3s $menu-easing;
|
|
144
|
+
|
|
145
|
+
> .#{$namespace}-menu__list > .#{$namespace}-menu__group {
|
|
146
|
+
margin: 16px 0 4px;
|
|
147
|
+
max-height: 40px;
|
|
148
|
+
overflow: hidden;
|
|
149
|
+
opacity: 1;
|
|
150
|
+
transition: max-height 0.3s $menu-easing, opacity 0.2s $menu-easing, padding 0.3s $menu-easing, margin 0.3s $menu-easing;
|
|
151
|
+
&:first-child { margin-top: 8px; }
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
> .#{$namespace}-menu__list > .#{$namespace}-menu__item { margin-bottom: 4px; &:last-child { margin-bottom: 0; } }
|
|
155
|
+
|
|
156
|
+
.#{$namespace}-menu__item-content {
|
|
157
|
+
padding: 10px 16px;
|
|
158
|
+
border-radius: $border-radius-base;
|
|
159
|
+
&:hover { background-color: var(--menu-bg-hover); }
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.#{$namespace}-menu__item.is-active > .#{$namespace}-menu__item-content { background-color: var(--menu-bg-active); }
|
|
163
|
+
.#{$namespace}-menu__item.has-active-child > .#{$namespace}-menu__item-content {
|
|
164
|
+
background-color: transparent;
|
|
165
|
+
&:hover { background-color: var(--menu-bg-hover); }
|
|
166
|
+
}
|
|
167
|
+
.#{$namespace}-menu__item-arrow.is-open { transform: rotate(90deg); }
|
|
168
|
+
|
|
169
|
+
// 折叠状态
|
|
170
|
+
&.is-collapsed {
|
|
171
|
+
width: 64px;
|
|
172
|
+
|
|
173
|
+
> .#{$namespace}-menu__list > .#{$namespace}-menu__item { margin-bottom: 4px; &:last-child, &.is-open { margin-bottom: 4px; } &:last-child { margin-bottom: 0; } }
|
|
174
|
+
> .#{$namespace}-menu__list > .#{$namespace}-menu__group { max-height: 0; opacity: 0; padding: 0; margin: 0; pointer-events: none; }
|
|
175
|
+
|
|
176
|
+
> .#{$namespace}-menu__list > .#{$namespace}-menu__item > .#{$namespace}-menu__item-content {
|
|
177
|
+
padding: 12px 8px;
|
|
178
|
+
> .#{$namespace}-menu__item-label, > .#{$namespace}-menu__item-arrow { opacity: 0; width: 0; flex: 0; }
|
|
179
|
+
> .#{$namespace}-menu__item-arrow { margin-left: 0; }
|
|
180
|
+
> .#{$namespace}-menu__item-icon { margin: 0 auto; }
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.#{$namespace}-menu__popup {
|
|
184
|
+
top: 0;
|
|
185
|
+
left: 100%;
|
|
186
|
+
margin-left: 12px;
|
|
187
|
+
.#{$namespace}-menu__item-label { opacity: 1; width: auto; flex: 1; }
|
|
188
|
+
.#{$namespace}-menu__item-icon { margin-right: 8px; }
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// 水平模式
|
|
194
|
+
&--horizontal {
|
|
195
|
+
border-bottom: 1px solid var(--menu-border);
|
|
196
|
+
width: 100%;
|
|
197
|
+
height: 60px;
|
|
198
|
+
display: flex;
|
|
199
|
+
align-items: center;
|
|
200
|
+
|
|
201
|
+
> .#{$namespace}-menu__list { display: flex; align-items: center; height: 100%; }
|
|
202
|
+
|
|
203
|
+
> .#{$namespace}-menu__list > .#{$namespace}-menu__item {
|
|
204
|
+
height: 100%;
|
|
205
|
+
display: flex;
|
|
206
|
+
align-items: center;
|
|
207
|
+
|
|
208
|
+
> .#{$namespace}-menu__item-content {
|
|
209
|
+
height: 100%;
|
|
210
|
+
padding: 0 20px;
|
|
211
|
+
border-bottom: 2px solid transparent;
|
|
212
|
+
display: flex;
|
|
213
|
+
align-items: center;
|
|
214
|
+
&:hover { background-color: transparent; border-bottom-color: $color-primary; }
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
&.is-active > .#{$namespace}-menu__item-content,
|
|
218
|
+
&.has-active-child > .#{$namespace}-menu__item-content {
|
|
219
|
+
border-bottom-color: $color-primary;
|
|
220
|
+
background-color: transparent;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.#{$namespace}-menu__popup { top: 100%; left: 0; &--nested { top: 0; left: 100%; margin-left: 4px; } }
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// 暗色模式
|
|
229
|
+
.dark .#{$namespace}-menu {
|
|
230
|
+
--menu-bg: #{$bg-color-dark-light};
|
|
231
|
+
--menu-bg-hover: #{$bg-color-dark-lighter};
|
|
232
|
+
--menu-bg-active: #{rgba($color-primary, 0.12)};
|
|
233
|
+
--menu-text: #{$color-text-dark};
|
|
234
|
+
--menu-text-secondary: #{$color-text-dark-secondary};
|
|
235
|
+
--menu-text-disabled: #{$color-text-dark-secondary};
|
|
236
|
+
--menu-border: #{$bg-color-dark-lighter};
|
|
237
|
+
|
|
238
|
+
.#{$namespace}-menu__popup { box-shadow: $box-shadow-dark; }
|
|
239
|
+
}
|