|
4 | 4 | position: relative; |
5 | 5 | display: inline-block; |
6 | 6 | width: 80px; |
7 | | - line-height: 38px; |
8 | | - margin-right: 12px; |
9 | 7 |
|
10 | | - &:hover:not(.#{$devui-prefix}-input-number--disabled) { |
11 | | - .#{$devui-prefix}-input-number__input-box { |
12 | | - border-color: var(--devui-form-control-line-hover); |
| 8 | + &:hover { |
| 9 | + .#{$devui-prefix}-input-number__input-box:not(.disabled) { |
| 10 | + border: 1px solid $devui-form-control-line-hover; |
| 11 | + padding-right: 24px; |
13 | 12 | } |
14 | 13 |
|
15 | | - .#{$devui-prefix}-input-number__control-button:not(.disabled) { |
| 14 | + .#{$devui-prefix}-input-number__control-buttons:not(.disabled) { |
16 | 15 | display: flex; |
17 | | - border-color: var(--devui-form-control-line-hover); |
| 16 | + border-color: $devui-form-control-line-hover; |
18 | 17 | } |
19 | 18 | } |
20 | 19 |
|
21 | 20 | &:focus-within { |
22 | | - .#{$devui-prefix}-input-number__control-button { |
23 | | - display: flex; |
24 | | - } |
25 | | - } |
26 | | - |
27 | | - .active { |
28 | | - border: 1px solid var(--devui-form-control-line-active) !important; |
29 | | - display: flex !important; |
30 | | - } |
31 | | - |
32 | | - &.#{$devui-prefix}-input-number--disabled { |
33 | | - .#{$devui-prefix}-subtract, |
34 | | - .#{$devui-prefix}-add, |
35 | | - .#{$devui-prefix}-input-number__input-style { |
36 | | - cursor: not-allowed; |
37 | | - border-color: #e4e7ed; |
38 | | - color: #e4e7ed; |
| 21 | + .#{$devui-prefix}-input-number__input-box:not(.disabled) { |
| 22 | + border: 1px solid $devui-form-control-line-active; |
| 23 | + padding-right: 24px; |
39 | 24 | } |
40 | 25 |
|
41 | | - .#{$devui-prefix}-input-number__input-style { |
42 | | - border-color: var(--devui-disabled-line) !important; |
43 | | - color: var(--devui-disabled-text) !important; |
44 | | - background-color: var(--devui-disabled-bg) !important; |
45 | | - } |
46 | | - } |
47 | | - |
48 | | - &.#{$devui-prefix}-input-number--sm { |
49 | | - width: 60px; |
50 | | - |
51 | | - .#{$devui-prefix}-input-number__input-box { |
52 | | - height: 26px; |
53 | | - line-height: 26px; |
| 26 | + .#{$devui-prefix}-input-number__control-buttons:not(.disabled) { |
| 27 | + display: flex; |
| 28 | + border-color: $devui-form-control-line-active; |
54 | 29 | } |
55 | 30 | } |
56 | 31 |
|
|
63 | 38 | } |
64 | 39 | } |
65 | 40 |
|
66 | | - &.#{$devui-prefix}-input-number--lg { |
67 | | - width: 100px; |
68 | | - |
69 | | - .#{$devui-prefix}-input-number__input-box { |
70 | | - height: 38px; |
71 | | - line-height: 38px; |
72 | | - } |
73 | | - } |
74 | | - |
75 | | - .#{$devui-prefix}-input-number__input-wrap { |
76 | | - line-height: 100%; |
77 | | - } |
78 | | - |
79 | | - .#{$devui-prefix}-input-number__input-style::-webkit-outer-spin-button, |
80 | | - .#{$devui-prefix}-input-number__input-style::-webkit-inner-spin-button { |
81 | | - -webkit-appearance: none; |
82 | | - margin: 0; |
83 | | - } |
84 | | - |
85 | | - .#{$devui-prefix}-add, |
86 | | - .#{$devui-prefix}-subtract { |
87 | | - display: inline-block; |
88 | | - width: 50px; |
89 | | - height: 38px; |
90 | | - line-height: 38px; |
91 | | - text-align: center; |
92 | | - font-size: 16px; |
93 | | - color: #333333; |
94 | | - background: #f5f7fa; |
95 | | - cursor: pointer; |
96 | | - border: 1px solid #dcdfe6; |
97 | | - } |
98 | | - |
99 | | - .#{$devui-prefix}-add { |
100 | | - float: right; |
101 | | - margin-left: -1px; |
102 | | - border-radius: 0 4px 4px 0; |
103 | | - } |
104 | | - |
105 | | - .#{$devui-prefix}-subtract { |
106 | | - float: left; |
107 | | - margin-right: -1px; |
108 | | - border-radius: 4px 0 0 4px; |
109 | | - } |
110 | | - |
111 | | - .#{$devui-prefix}-input-number__input-style { |
112 | | - display: block; |
113 | | - -moz-appearance: textfield; |
114 | | - } |
115 | | - |
116 | | - .#{$devui-prefix}-input-number__input-style { |
117 | | - outline: none; |
118 | | - background-color: var(--devui-base-bg); |
119 | | - border: 1px solid var(--devui-form-control-line); |
120 | | - border-radius: var(--devui-border-radius); |
121 | | - padding: 4px 8px; |
122 | | - line-height: 18px; |
123 | | - font-size: var(--devui-font-size); |
124 | | - color: var(--devui-text); |
125 | | - width: 100%; |
126 | | - display: block; |
127 | | - cursor: text; |
128 | | - height: 28px; |
129 | | - transition: border-color 0.3s var(--devui-animation-ease-in-out-smooth); |
130 | | - } |
131 | | - |
132 | 41 | .#{$devui-prefix}-input-number__input-box { |
133 | 42 | box-sizing: border-box; |
134 | 43 | padding: 4px 8px; |
135 | | - font-size: var(--devui-font-size); |
136 | | - vertical-align: middle; |
137 | | - border-radius: var(--devui-border-radius); |
| 44 | + font-size: $devui-font-size; |
| 45 | + border-radius: $devui-border-radius; |
| 46 | + border: 1px solid $devui-form-control-line; |
138 | 47 | outline: none; |
139 | 48 | width: 100%; |
140 | 49 | line-height: 20px; |
141 | 50 | height: 28px; |
142 | | - border-width: 1px; |
143 | | - border-style: solid; |
| 51 | + display: block; |
| 52 | + cursor: text; |
| 53 | + -moz-appearance: textfield; |
| 54 | + transition: border-color $devui-animation-duration-slow $devui-animation-ease-in-out-smooth; |
144 | 55 |
|
145 | 56 | &:not(.disabled) { |
146 | | - background-color: var(--devui-base-bg); |
147 | | - border-color: var(--devui-line); |
148 | | - color: var(--devui-text); |
| 57 | + background-color: $devui-base-bg; |
| 58 | + border-color: $devui-line; |
| 59 | + color: $devui-text; |
149 | 60 | } |
150 | | - } |
151 | 61 |
|
152 | | - .disabled { |
153 | | - cursor: not-allowed; |
| 62 | + &::-webkit-inner-spin-button, |
| 63 | + &::-webkit-outer-spin-button { |
| 64 | + -webkit-appearance: none; |
| 65 | + } |
154 | 66 | } |
155 | 67 |
|
156 | | - .#{$devui-prefix}-input-number__control-button { |
| 68 | + .#{$devui-prefix}-input-number__control-buttons { |
157 | 69 | display: none; |
158 | 70 | position: absolute; |
159 | 71 | right: 0; |
|
162 | 74 | flex-direction: column; |
163 | 75 | justify-content: center; |
164 | 76 | align-items: center; |
165 | | - border-left: 1px solid var(--devui-line); |
| 77 | + border: 1px solid transparent; |
| 78 | + border-left-color: $devui-line; |
166 | 79 | box-sizing: border-box; |
167 | 80 | line-height: 100%; |
168 | | - border-radius: 0 var(--devui-border-radius) var(--devui-border-radius) 0; |
| 81 | + border-radius: 0 $devui-border-radius $devui-border-radius 0; |
169 | 82 |
|
170 | | - &:not(.disabled) { |
171 | | - cursor: pointer; |
| 83 | + &.disabled { |
| 84 | + border-left-color: $devui-disabled-line; |
172 | 85 | } |
173 | 86 |
|
174 | | - & > span { |
| 87 | + .control-button { |
| 88 | + user-select: none; |
| 89 | + box-sizing: border-box; |
| 90 | + height: 50%; |
| 91 | + line-height: 50%; |
| 92 | + border-width: 0 1px; |
| 93 | + transition: transform $devui-animation-duration-slow $devui-animation-ease-in-out-smooth; |
175 | 94 | display: flex; |
| 95 | + justify-content: center; |
| 96 | + align-items: center; |
| 97 | + background-color: $devui-base-bg; |
| 98 | + |
| 99 | + &.control-inc svg { |
| 100 | + position: relative; |
| 101 | + top: 2px; |
| 102 | + transform: rotate(180deg); |
| 103 | + } |
| 104 | + |
| 105 | + &.control-dec svg { |
| 106 | + position: relative; |
| 107 | + bottom: 2px; |
| 108 | + } |
| 109 | + |
| 110 | + svg path { |
| 111 | + fill: $devui-text-weak; |
| 112 | + } |
| 113 | + |
| 114 | + &:not(.disabled) { |
| 115 | + cursor: pointer; |
| 116 | + |
| 117 | + &:hover { |
| 118 | + & > svg path { |
| 119 | + fill: $devui-icon-fill-active-hover; |
| 120 | + } |
| 121 | + } |
| 122 | + } |
| 123 | + |
| 124 | + &.disabled { |
| 125 | + & > svg path { |
| 126 | + fill: $devui-disabled-text; |
| 127 | + } |
| 128 | + } |
| 129 | + } |
| 130 | + } |
| 131 | + |
| 132 | + .#{$devui-prefix}-input-number--lg { |
| 133 | + & > .#{$devui-prefix}-input-number__input-box { |
| 134 | + font-size: $devui-font-size-lg; |
| 135 | + line-height: 24px; |
| 136 | + height: 46px; |
| 137 | + } |
| 138 | + |
| 139 | + &.#{$devui-prefix}-input-number__control-buttons .control-button .#{$devui-prefix}-input-number__icon-arrow { |
| 140 | + width: 16px; |
| 141 | + height: 16px; |
176 | 142 | } |
177 | 143 | } |
| 144 | + |
| 145 | + .#{$devui-prefix}-input-number--md { |
| 146 | + & > .#{$devui-prefix}-input-number__input-box { |
| 147 | + font-size: $devui-font-size; |
| 148 | + line-height: 20px; |
| 149 | + height: 28px; |
| 150 | + } |
| 151 | + } |
| 152 | + |
| 153 | + .#{$devui-prefix}-input-number--sm { |
| 154 | + & > .#{$devui-prefix}-input-number__input-box { |
| 155 | + font-size: $devui-font-size-sm; |
| 156 | + line-height: 18px; |
| 157 | + height: 26px; |
| 158 | + } |
| 159 | + |
| 160 | + &.#{$devui-prefix}-input-number__control-buttons .control-button { |
| 161 | + &:first-child .#{$devui-prefix}-input-number__icon-arrow { |
| 162 | + width: 14px; |
| 163 | + height: 14px; |
| 164 | + } |
| 165 | + |
| 166 | + &:last-child .#{$devui-prefix}-input-number__icon-arrow { |
| 167 | + width: 14px; |
| 168 | + height: 14px; |
| 169 | + } |
| 170 | + } |
| 171 | + } |
| 172 | + |
| 173 | + .#{$devui-prefix}-input-number__input-wrap { |
| 174 | + line-height: 100%; |
| 175 | + } |
| 176 | + |
| 177 | + .disabled { |
| 178 | + cursor: not-allowed; |
| 179 | + } |
178 | 180 | } |
0 commit comments