select.less 7.9 KB
Newer Older
Y
yiminghe 已提交
1

A
afc163 已提交
2
@select-prefix-cls: ant-select;
然则 已提交
3

Y
yiminghe 已提交
4
@import "../mixins/iconfont";
然则 已提交
5
//mixin
Y
yiminghe 已提交
6
.selection__clear() {
然则 已提交
7 8 9 10
  cursor: pointer;
  float: right;
  font-weight: bold;
}
Z
zhujun24 已提交
11

然则 已提交
12 13 14
.selected_icon() {
  position: relative;
  &:after {
15
    .iconfont-size-under-12px(10px);
然则 已提交
16 17 18 19 20
    display: inline-block;
    content: '\e613';
    font-family: 'anticon';
    font-weight: bold;
    position: absolute;
A
afc163 已提交
21
    top: 7px;
然则 已提交
22
    right: 0;
A
afc163 已提交
23
    padding-right: 15px;
然则 已提交
24 25 26
    color: @primary-color;
  }
}
然则 已提交
27

A
afc163 已提交
28
.@{select-prefix-cls} {
然则 已提交
29 30 31 32 33 34
  box-sizing: border-box;
  display: inline-block;
  margin: 0;
  position: relative;
  vertical-align: middle;
  color: #666;
A
afc163 已提交
35
  font-size: @font-size-base;
然则 已提交
36 37 38 39 40 41 42 43

  > ul > li > a {
    padding: 0;
    background-color: #fff;
  }

  // arrow
  &-arrow {
Y
yiminghe 已提交
44
    .iconfont-mixin();
然则 已提交
45
    position: absolute;
46 47 48 49
    top: 50%;
    right: 8px;
    line-height: 1;
    margin-top: -5px;
Y
yiminghe 已提交
50
    .iconfont-size-under-12px(8px);
Y
yiminghe 已提交
51 52 53 54

    * {
      display: none;
    }
然则 已提交
55 56

    &:before {
然则 已提交
57
      content: '\e600';
A
afc163 已提交
58
      transition: transform 0.2s ease;
然则 已提交
59 60 61
    }
  }

然则 已提交
62 63
  &-selection {
    outline: none;
然则 已提交
64 65 66
    user-select: none;
    -webkit-user-select: none;

然则 已提交
67 68 69
    box-sizing: border-box;
    display: block;

然则 已提交
70
    background-color: #fff;
然则 已提交
71
    border-radius: 6px;
然则 已提交
72
    border: 1px solid #d9d9d9;
A
afc163 已提交
73 74
    .transition(all .3s @ease-in-out);

然则 已提交
75
    &:hover {
Y
yiminghe 已提交
76
      .hover;
然则 已提交
77 78
    }
    &:active {
Y
yiminghe 已提交
79
      .active;
然则 已提交
80 81 82
    }
  }

然则 已提交
83 84 85 86 87 88 89 90 91 92 93 94
  &-disabled {
    color: #ccc;
    cursor: not-allowed;
    pointer-events: none;
  }

  &-disabled &-selection {
    &:hover, &:active {
      border-color: #d9d9d9;
    }
  }

然则 已提交
95 96 97
  &-selection--single {
    height: 28px;
    cursor: pointer;
然则 已提交
98

A
afc163 已提交
99
    .@{select-prefix-cls}-selection__rendered {
然则 已提交
100 101 102
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
然则 已提交
103 104
      padding-left: 10px;
      padding-right: 20px;
A
afc163 已提交
105
      line-height: 26px;
然则 已提交
106 107
    }

A
afc163 已提交
108
    .@{select-prefix-cls}-selection__clear {
然则 已提交
109
      .selection__clear();
然则 已提交
110
    }
A
afc163 已提交
111

A
afc163 已提交
112
    .@{select-prefix-cls}-selection__placeholder {
A
afc163 已提交
113 114
      color: #ccc;
    }
然则 已提交
115 116
  }

Z
zhujun24 已提交
117
  &-lg {
Y
yiminghe 已提交
118
    .ant-select-selection--single {
Z
zhujun24 已提交
119
      height: 32px;
Y
yiminghe 已提交
120
      .ant-select-selection__rendered {
Z
zhujun24 已提交
121 122 123 124
        line-height: 30px;
      }
    }

Y
yiminghe 已提交
125
    .ant-select-selection--multiple {
Z
zhujun24 已提交
126
      min-height: 32px;
Y
yiminghe 已提交
127
      .ant-select-selection__rendered {
Z
zhujun24 已提交
128
        li {
Z
zhujun24 已提交
129
          height: 24px;
Y
yiminghe 已提交
130
          .ant-select-selection__choice__content {
Z
zhujun24 已提交
131 132 133 134 135 136 137 138
            font-size: 14px;
            line-height: 24px;
          }
        }
      }
    }
  }

Z
zhujun24 已提交
139
  &-sm {
Y
yiminghe 已提交
140
    .ant-select-selection--single {
Z
zhujun24 已提交
141
      height: 22px;
Y
yiminghe 已提交
142
      .ant-select-selection__rendered {
Z
zhujun24 已提交
143 144 145
        line-height: 20px;
      }
    }
Y
yiminghe 已提交
146
    .ant-select-selection--multiple {
Z
zhujun24 已提交
147
      min-height: 22px;
Y
yiminghe 已提交
148
      .ant-select-selection__rendered {
Z
zhujun24 已提交
149
        li {
Z
zhujun24 已提交
150
          height: 14px;
Y
yiminghe 已提交
151
          .ant-select-selection__choice__content {
Z
zhujun24 已提交
152 153 154 155
            line-height: 14px;
            position: relative;
            top: -3px;
          }
Y
yiminghe 已提交
156
          .ant-select-selection__choice__remove {
Z
zhujun24 已提交
157 158 159
            position: relative;
            top: -4px;
          }
Z
zhujun24 已提交
160 161 162 163 164
        }
      }
    }
  }

Y
yiminghe 已提交
165 166 167 168 169 170 171 172
  &-disabled &-selection__choice__remove {
    color: #ccc;
    cursor: default;
    &:hover {
      color: #ccc;
    }
  }

A
afc163 已提交
173
  .@{select-prefix-cls}-search__field__wrap {
174 175 176 177
    display: inline-block;
    position: relative;
  }

A
afc163 已提交
178
  .@{select-prefix-cls}-search__field__placeholder {
179 180 181 182 183 184
    position: absolute;
    top: 0;
    left: 3px;
    color: #aaa;
  }

Y
yiminghe 已提交
185 186 187
  &-search--inline {
    float: left;

A
afc163 已提交
188
    .@{select-prefix-cls}-search__field {
Y
yiminghe 已提交
189 190 191 192 193 194 195 196 197 198
      border: none;
      font-size: 100%;
      background: transparent;
      outline: 0;
    }
    > i {
      float: right;
    }
  }

然则 已提交
199
  &-selection--multiple {
然则 已提交
200
    min-height: 28px;
然则 已提交
201 202
    cursor: text;

A
afc163 已提交
203
    .@{select-prefix-cls}-search--inline {
Y
yiminghe 已提交
204
      width: auto;
A
afc163 已提交
205
      .@{select-prefix-cls}-search__field {
Y
yiminghe 已提交
206 207 208 209
        width: 0.75em;
      }
    }

A
afc163 已提交
210
    .@{select-prefix-cls}-selection__rendered {
然则 已提交
211 212
      overflow: hidden;
      text-overflow: ellipsis;
然则 已提交
213
      padding-left: 4px;
A
afc163 已提交
214
      padding-bottom: 4px;
然则 已提交
215 216
    }

A
afc163 已提交
217
    .@{select-prefix-cls}-selection__clear {
然则 已提交
218
      .selection__clear();
然则 已提交
219 220 221 222
      margin-top: 5px;
      margin-right: 10px;
    }

然则 已提交
223 224 225 226 227 228
    > ul > li {
      margin-top: 4px;
      height: 20px;
      line-height: 20px;
    }

A
afc163 已提交
229
    .@{select-prefix-cls}-selection__choice {
然则 已提交
230 231 232 233
      background-color: #f3f3f3;
      border-radius: 4px;
      cursor: default;
      float: left;
然则 已提交
234
      padding: 0 8px;
然则 已提交
235 236 237
      margin-right: 4px;
    }

A
afc163 已提交
238
    .@{select-prefix-cls}-selection__choice__remove {
Y
yiminghe 已提交
239
      .iconfont-mixin();
然则 已提交
240 241 242 243
      color: #919191;
      cursor: pointer;
      display: inline-block;
      font-weight: bold;
Y
yiminghe 已提交
244
      .iconfont-size-under-12px(8px);
A
afc163 已提交
245 246 247 248
      padding: 0 0 0 4px;
      position: relative;
      top: -1px;
      left: 4px;
然则 已提交
249 250 251
      &:hover {
        color: #333;
      }
Y
yiminghe 已提交
252 253 254 255

      &:before {
        content: "\e61e";
      }
然则 已提交
256 257 258
    }
  }

A
afc163 已提交
259 260 261
  &-open {
    .@{select-prefix-cls}-arrow {
      .ie-rotate(2);
Y
yiminghe 已提交
262 263 264 265
      -ms-transform: rotate(180deg);
      &:before {
        .rotate(180deg);
      }
266
    }
A
afc163 已提交
267 268
    .@{select-prefix-cls}-selection {
      .active();
然则 已提交
269 270 271
    }
  }

A
afc163 已提交
272 273
  &-combobox {
    .@{select-prefix-cls}-arrow {
Y
yiminghe 已提交
274 275
      display: none;
    }
A
afc163 已提交
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
    .@{select-prefix-cls}-search--inline {
      height: 100%;
      float: none;
    }
    .@{select-prefix-cls}-search__field__placeholder {
      left: 10px;
      cursor: text;
    }
    .@{select-prefix-cls}-search__field__wrap {
      width: 100%;
      height: 100%;
    }
    .@{select-prefix-cls}-search__field {
      padding: 0 10px;
      width: 100%;
      height: 100%;
      position: relative;
      z-index: 1;
    }
    .@{select-prefix-cls}-selection__rendered {
      padding: 0;
      height: 100%;
    }
  }
}

.@{select-prefix-cls}-dropdown {

  &--single &-menu-item-selected {
    background-color: tint(@primary-color, 90%);
    .selected_icon();
  }

  &--multiple &-menu-item {
    padding: 7px 33px 7px 16px;
  }

  &--multiple &-menu-item-selected {
A
afc163 已提交
314
    background-color: tint(@primary-color, 90%);
A
afc163 已提交
315 316 317 318 319 320 321 322 323 324 325 326
    .selected_icon();
  }

  &-hidden {
    display: none;
  }

  background-color: white;
  border: 1px solid #d9d9d9;
  box-shadow: @overlay-shadow;
  border-radius: 4px;
  box-sizing: border-box;
A
afc163 已提交
327
  z-index: 1070;
A
afc163 已提交
328 329 330 331 332
  left: -9999px;
  top: -9999px;
  position: absolute;
  outline: none;
  overflow: hidden;
A
afc163 已提交
333
  font-size: @font-size-base;
A
afc163 已提交
334 335

  &-menu {
然则 已提交
336
    outline: none;
A
afc163 已提交
337 338 339 340 341
    margin-bottom: 0;
    padding-left: 0; // Override default ul/ol
    list-style: none;
    max-height: 250px;
    overflow: auto;
Y
yiminghe 已提交
342

A
afc163 已提交
343 344 345 346 347 348
    &-item-group-list {
      margin: 0;
      padding: 0;

      > .@{select-prefix-cls}-dropdown-menu-item {
        padding-left: 24px;
Y
yiminghe 已提交
349
      }
A
afc163 已提交
350
    }
Y
yiminghe 已提交
351

A
afc163 已提交
352 353 354 355 356
    &-item-group-title {
      color: #999;
      line-height: 1.5;
      padding: 8px 16px;
    }
fix #99  
然则 已提交
357

A
afc163 已提交
358 359 360 361 362 363 364 365
    &-item {
      position: relative;
      display: block;
      padding: 7px 16px;
      font-weight: normal;
      color: #666;
      white-space: nowrap;
      cursor: pointer;
fix #99  
然则 已提交
366

A
afc163 已提交
367 368 369 370 371 372 373 374 375 376
      &:first-child {
        border-top-left-radius: 4px;
        border-top-right-radius: 4px;
      }
      &:last-child {
        border-bottom-left-radius: 4px;
        border-bottom-right-radius: 4px;
      }
      &:hover, &-active {
        background-color: tint(@primary-color, 90%) !important;
fix #99  
然则 已提交
377 378
      }

A
afc163 已提交
379 380 381 382
      &-disabled {
        color: #ccc;
        cursor: not-allowed;
        pointer-events: none;
Y
yiminghe 已提交
383

A
afc163 已提交
384
        &:hover {
Y
yiminghe 已提交
385
          color: #ccc;
A
afc163 已提交
386
          background-color: #fff;
Y
yiminghe 已提交
387 388
          cursor: not-allowed;
        }
A
afc163 已提交
389
      }
Y
yiminghe 已提交
390

A
afc163 已提交
391 392 393 394 395 396
      &-divider {
        height: 1px;
        margin: 1px 0;
        overflow: hidden;
        background-color: #e5e5e5;
        line-height: 0;
Y
yiminghe 已提交
397 398 399 400
      }
    }
  }

A
afc163 已提交
401
  &-container-open, &-open {
A
afc163 已提交
402
    .@{select-prefix-cls}-dropdown {
Y
yiminghe 已提交
403
      display: block;
然则 已提交
404 405 406
    }
  }

A
afc163 已提交
407
  .@{select-prefix-cls}-search--dropdown {
然则 已提交
408 409
    display: block;
    padding: 4px;
A
afc163 已提交
410
    .@{select-prefix-cls}-search__field__placeholder {
411 412
      left: 4px;
    }
A
afc163 已提交
413
    .@{select-prefix-cls}-search__field__wrap {
414 415
      width: 100%;
    }
A
afc163 已提交
416
    .@{select-prefix-cls}-search__field {
然则 已提交
417 418 419 420 421 422 423
      padding: 4px;
      width: 100%;
      box-sizing: border-box;
      border: 1px solid #d9d9d9;
      border-radius: 4px;
      outline: none;
    }
A
afc163 已提交
424
    &.@{select-prefix-cls}-search--hide {
然则 已提交
425 426 427
      display: none;
    }
  }
A
afc163 已提交
428
}