|
1 | 1 | @import '../../style/mixins/index'; |
2 | 2 |
|
3 | 3 | @tree-prefix-cls: ~'@{ant-prefix}-tree'; |
4 | | -@tree-node-prefix-cls: ~'@{tree-prefix-cls}-treenode'; |
5 | 4 | @select-tree-prefix-cls: ~'@{ant-prefix}-select-tree'; |
6 | 5 | @tree-motion: ~'@{ant-prefix}-motion-collapse'; |
7 | 6 | @tree-node-padding: (@padding-xs / 2); |
|
13 | 12 | display: inline-block; |
14 | 13 | font-size: 10px; |
15 | 14 | vertical-align: baseline; |
| 15 | + |
16 | 16 | svg { |
17 | 17 | transition: transform 0.3s; |
18 | 18 | } |
|
28 | 28 | background-color: @primary-color; |
29 | 29 | border-radius: 1px; |
30 | 30 | pointer-events: none; |
| 31 | + |
31 | 32 | &::after { |
32 | 33 | position: absolute; |
33 | 34 | top: -3px; |
|
66 | 67 | .@{custom-tree-prefix-cls}-node-content-wrapper { |
67 | 68 | flex: auto; |
68 | 69 | } |
| 70 | + |
| 71 | + // >>> Drag |
| 72 | + .@{custom-tree-node-prefix-cls}.dragging { |
| 73 | + position: relative; |
| 74 | + |
| 75 | + &::after { |
| 76 | + position: absolute; |
| 77 | + top: 0; |
| 78 | + right: 0; |
| 79 | + bottom: @tree-node-padding; |
| 80 | + left: 0; |
| 81 | + border: 1px solid @primary-color; |
| 82 | + opacity: 0; |
| 83 | + animation: ant-tree-node-fx-do-not-use 0.3s; |
| 84 | + animation-play-state: running; |
| 85 | + animation-fill-mode: forwards; |
| 86 | + content: ''; |
| 87 | + pointer-events: none; |
| 88 | + } |
| 89 | + } |
69 | 90 | } |
70 | 91 | } |
71 | 92 |
|
|
110 | 131 | } |
111 | 132 | } |
112 | 133 |
|
| 134 | + // >>> Drag Handler |
| 135 | + &-draggable-icon { |
| 136 | + width: @tree-title-height; |
| 137 | + line-height: @tree-title-height; |
| 138 | + text-align: center; |
| 139 | + opacity: 0.2; |
| 140 | + transition: opacity @animation-duration-slow; |
| 141 | + |
| 142 | + .@{custom-tree-node-prefix-cls}:hover & { |
| 143 | + opacity: 0.45; |
| 144 | + } |
| 145 | + } |
| 146 | + |
113 | 147 | // >>> Switcher |
114 | 148 | &-switcher { |
115 | 149 | .antTreeSwitcherIcon(); |
|
145 | 179 | display: inline-block; |
146 | 180 | width: 100%; |
147 | 181 | height: 100%; |
| 182 | + // https://github.com/ant-design/ant-design/issues/31884 |
148 | 183 | &::before { |
149 | 184 | position: absolute; |
150 | 185 | top: 0; |
| 186 | + right: 12px; |
151 | 187 | bottom: -@tree-node-padding; |
152 | 188 | margin-left: -1px; |
153 | | - border-left: 1px solid @normal-color; |
| 189 | + border-right: 1px solid @normal-color; |
154 | 190 | content: ' '; |
155 | 191 | } |
| 192 | + |
156 | 193 | &::after { |
157 | 194 | position: absolute; |
158 | 195 | width: @tree-title-height - 14px; |
159 | 196 | height: @tree-title-height - 10px; |
160 | | - margin-left: -1px; |
161 | 197 | border-bottom: 1px solid @normal-color; |
162 | 198 | content: ' '; |
163 | 199 | } |
|
200 | 236 | line-height: @tree-title-height; |
201 | 237 | text-align: center; |
202 | 238 | vertical-align: top; |
| 239 | + |
203 | 240 | &:empty { |
204 | 241 | display: none; |
205 | 242 | } |
|
212 | 249 | } |
213 | 250 |
|
214 | 251 | // ==================== Draggable ===================== |
215 | | - &-node-content-wrapper[draggable='true'] { |
| 252 | + &-node-content-wrapper { |
216 | 253 | line-height: @tree-title-height; |
217 | 254 | user-select: none; |
218 | 255 |
|
|
255 | 292 | background: @component-background; |
256 | 293 |
|
257 | 294 | &-line-icon { |
258 | | - vertical-align: -0.225em; |
| 295 | + // https://github.com/ant-design/ant-design/issues/32813 |
| 296 | + vertical-align: -0.15em; |
259 | 297 | } |
260 | 298 | } |
261 | 299 | } |
262 | | -} |
263 | 300 |
|
264 | | -.@{tree-node-prefix-cls}-leaf-last { |
265 | | - .@{tree-prefix-cls}-switcher { |
266 | | - &-leaf-line { |
267 | | - &::before { |
268 | | - top: auto !important; |
269 | | - bottom: auto !important; |
270 | | - height: @tree-title-height - 10px !important; |
| 301 | + .@{custom-tree-node-prefix-cls}-leaf-last { |
| 302 | + .@{custom-tree-prefix-cls}-switcher { |
| 303 | + &-leaf-line { |
| 304 | + &::before { |
| 305 | + top: auto !important; |
| 306 | + bottom: auto !important; |
| 307 | + height: @tree-title-height - 10px !important; |
| 308 | + } |
271 | 309 | } |
272 | 310 | } |
273 | 311 | } |
274 | 312 | } |
| 313 | + |
| 314 | +@keyframes ant-tree-node-fx-do-not-use { |
| 315 | + 0% { |
| 316 | + opacity: 0; |
| 317 | + } |
| 318 | + |
| 319 | + 100% { |
| 320 | + opacity: 1; |
| 321 | + } |
| 322 | +} |
0 commit comments