@qsxy/element-plus-react 1.0.2 → 1.0.3

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.
Files changed (216) hide show
  1. package/dist/Alert/Alert.d.ts +7 -0
  2. package/dist/Alert/Alert.js +98 -0
  3. package/dist/Alert/index.d.ts +2 -0
  4. package/dist/Alert/index.js +1 -0
  5. package/dist/Alert/typings.d.ts +45 -0
  6. package/dist/Alert/typings.js +1 -0
  7. package/dist/Card/Card.js +5 -3
  8. package/dist/Cascader/useCascader.d.ts +0 -14
  9. package/dist/Cascader/useCascader.js +33 -32
  10. package/dist/Checkbox/Checkbox.js +3 -2
  11. package/dist/ConfigProvider/ConfigProvider.js +2 -24
  12. package/dist/ConfigProvider/ConfigProviderContext.js +1 -1
  13. package/dist/ConfigProvider/typings.d.ts +1 -1
  14. package/dist/Container/Main.d.ts +1 -1
  15. package/dist/Container/typings.d.ts +1 -1
  16. package/dist/Dialog/Dialog.js +5 -12
  17. package/dist/Input/Input.js +68 -43
  18. package/dist/Input/TextArea.js +1 -1
  19. package/dist/Input/typings.d.ts +42 -1
  20. package/dist/Input/utils.d.ts +1 -0
  21. package/dist/Input/utils.js +5 -1
  22. package/dist/InputNumber/InputNumber.js +351 -141
  23. package/dist/InputNumber/typings.d.ts +15 -1
  24. package/dist/Loading/Loading.js +5 -2
  25. package/dist/Menu/Menu.js +25 -1
  26. package/dist/Menu/MenuItem.js +4 -2
  27. package/dist/Menu/SubMenu.js +2 -2
  28. package/dist/Menu/SubMenuCollapseTransition.js +14 -9
  29. package/dist/Menu/typings.d.ts +2 -1
  30. package/dist/Message/Message.js +51 -23
  31. package/dist/Message/index.js +8 -10
  32. package/dist/Message/typings.d.ts +8 -5
  33. package/dist/MessageBox/MessageBox.js +52 -30
  34. package/dist/MessageBox/index.d.ts +2 -1
  35. package/dist/MessageBox/index.js +4 -2
  36. package/dist/MessageBox/typings.d.ts +3 -0
  37. package/dist/Notification/Notification.js +26 -19
  38. package/dist/Select/SelectContext.d.ts +2 -1
  39. package/dist/Select/SelectContext.js +2 -1
  40. package/dist/Select/SelectCore.js +13 -7
  41. package/dist/Select/SelectDropdown.js +23 -15
  42. package/dist/Select/index.d.ts +1 -1
  43. package/dist/Select/typings.d.ts +13 -9
  44. package/dist/Select/useSelect.d.ts +13 -10
  45. package/dist/Select/useSelect.js +34 -26
  46. package/dist/Space/Space.d.ts +4 -0
  47. package/dist/Space/Space.js +128 -0
  48. package/dist/Space/SpaceItem.d.ts +7 -0
  49. package/dist/Space/SpaceItem.js +14 -0
  50. package/dist/Space/index.d.ts +3 -0
  51. package/dist/Space/index.js +2 -0
  52. package/dist/Space/typings.d.ts +26 -0
  53. package/dist/Space/typings.js +1 -0
  54. package/dist/Space/useSpace.d.ts +7 -0
  55. package/dist/Space/useSpace.js +104 -0
  56. package/dist/Statistic/Statistic.d.ts +4 -0
  57. package/dist/Statistic/Statistic.js +92 -0
  58. package/dist/Statistic/index.d.ts +2 -0
  59. package/dist/Statistic/index.js +1 -0
  60. package/dist/Statistic/typings.d.ts +28 -0
  61. package/dist/Statistic/typings.js +1 -0
  62. package/dist/Switch/Switch.js +2 -2
  63. package/dist/Table/Table.js +3 -0
  64. package/dist/Table/typings.d.ts +2 -0
  65. package/dist/Tag/typings.d.ts +1 -1
  66. package/dist/Text/Text.d.ts +4 -0
  67. package/dist/Text/Text.js +84 -0
  68. package/dist/Text/index.d.ts +2 -0
  69. package/dist/Text/index.js +1 -0
  70. package/dist/Text/typings.d.ts +15 -0
  71. package/dist/Text/typings.js +1 -0
  72. package/dist/Tree/CollapseTransition.d.ts +7 -0
  73. package/dist/Tree/CollapseTransition.js +60 -0
  74. package/dist/Tree/Tree.d.ts +3 -140
  75. package/dist/Tree/Tree.js +350 -77
  76. package/dist/Tree/TreeContext.d.ts +9 -0
  77. package/dist/Tree/TreeContext.js +14 -0
  78. package/dist/Tree/TreeNode.d.ts +5 -3
  79. package/dist/Tree/TreeNode.js +321 -331
  80. package/dist/Tree/TreeNodeContent.d.ts +9 -0
  81. package/dist/Tree/TreeNodeContent.js +22 -0
  82. package/dist/Tree/index.d.ts +3 -8
  83. package/dist/Tree/index.js +1 -4
  84. package/dist/Tree/model/node.d.ts +62 -0
  85. package/dist/Tree/model/node.js +601 -0
  86. package/dist/Tree/model/tree-store.d.ts +52 -0
  87. package/dist/Tree/model/tree-store.js +510 -0
  88. package/dist/Tree/model/useDragNode.d.ts +30 -0
  89. package/dist/Tree/model/useDragNode.js +293 -0
  90. package/dist/Tree/model/useKeydown.d.ts +0 -0
  91. package/dist/Tree/model/useKeydown.js +104 -0
  92. package/dist/Tree/model/useNodeExpandEventBroadcast.d.ts +15 -0
  93. package/dist/Tree/model/useNodeExpandEventBroadcast.js +54 -0
  94. package/dist/Tree/model/util.d.ts +7 -0
  95. package/dist/Tree/model/util.js +24 -0
  96. package/dist/Tree/typings.d.ts +225 -114
  97. package/dist/TreeSelect/TreeSelect.d.ts +2 -10
  98. package/dist/TreeSelect/TreeSelect.js +90 -566
  99. package/dist/TreeSelect/TreeSelectOption.d.ts +6 -0
  100. package/dist/TreeSelect/TreeSelectOption.js +62 -0
  101. package/dist/TreeSelect/cacheOptions.d.ts +9 -0
  102. package/dist/TreeSelect/cacheOptions.js +22 -0
  103. package/dist/TreeSelect/index.d.ts +0 -1
  104. package/dist/TreeSelect/typings.d.ts +11 -63
  105. package/dist/TreeSelect/useSelect.d.ts +125 -0
  106. package/dist/TreeSelect/useSelect.js +104 -0
  107. package/dist/TreeSelect/useTree.d.ts +130 -0
  108. package/dist/TreeSelect/useTree.js +285 -0
  109. package/dist/TreeSelect/utils.d.ts +10 -0
  110. package/dist/TreeSelect/utils.js +38 -0
  111. package/dist/Upload/UploadContent.js +2 -0
  112. package/dist/Upload/ajax.js +3 -0
  113. package/dist/Upload/typings.d.ts +4 -0
  114. package/dist/Util/aria.js +12 -12
  115. package/dist/Util/base.d.ts +5 -0
  116. package/dist/Util/base.js +140 -1
  117. package/dist/config/Constants.d.ts +3 -0
  118. package/dist/config/Constants.js +8 -0
  119. package/dist/hooks/index.d.ts +1 -0
  120. package/dist/hooks/index.js +1 -0
  121. package/dist/hooks/popperPropsUtils.js +1 -1
  122. package/dist/hooks/treePropsUtils.d.ts +3 -3
  123. package/dist/hooks/treePropsUtils.js +2 -2
  124. package/dist/hooks/useConfigProvider.d.ts +27 -0
  125. package/dist/hooks/useConfigProvider.js +78 -0
  126. package/dist/hooks/useResizeObserver.js +6 -6
  127. package/dist/index.css +1 -1
  128. package/dist/index.d.ts +18 -11
  129. package/dist/index.js +11 -5
  130. package/package.json +1 -1
  131. package/theme-chalk/alert.scss +115 -0
  132. package/theme-chalk/aside.scss +8 -8
  133. package/theme-chalk/button-group.scss +80 -80
  134. package/theme-chalk/button.scss +304 -304
  135. package/theme-chalk/calendar/date-table.scss +164 -164
  136. package/theme-chalk/checkbox.scss +34 -0
  137. package/theme-chalk/color/index.scss +20 -20
  138. package/theme-chalk/common/transition.scss +142 -142
  139. package/theme-chalk/container.scss +14 -14
  140. package/theme-chalk/dark/css-vars.scss +39 -39
  141. package/theme-chalk/dark/var.scss +225 -225
  142. package/theme-chalk/date-picker.scss +12 -12
  143. package/theme-chalk/drawer.scss +1 -0
  144. package/theme-chalk/footer.scss +12 -12
  145. package/theme-chalk/header.scss +12 -12
  146. package/theme-chalk/index.scss +4 -0
  147. package/theme-chalk/input/input-range.scss +2 -1
  148. package/theme-chalk/input/input.scss +439 -424
  149. package/theme-chalk/input-number.bak +172 -0
  150. package/theme-chalk/input-number.scss +192 -172
  151. package/theme-chalk/link.scss +87 -87
  152. package/theme-chalk/main.scss +14 -14
  153. package/theme-chalk/menu.scss +353 -353
  154. package/theme-chalk/message.scss +104 -178
  155. package/theme-chalk/mixins/_button.scss +224 -224
  156. package/theme-chalk/mixins/_col.scss +33 -33
  157. package/theme-chalk/mixins/_var.scss +67 -67
  158. package/theme-chalk/mixins/config.scss +5 -5
  159. package/theme-chalk/mixins/function.scss +99 -99
  160. package/theme-chalk/mixins/mixins.scss +240 -240
  161. package/theme-chalk/mixins/utils.scss +39 -39
  162. package/theme-chalk/notification.bak +156 -0
  163. package/theme-chalk/notification.scss +109 -156
  164. package/theme-chalk/popper.scss +104 -104
  165. package/theme-chalk/radio-button.scss +169 -169
  166. package/theme-chalk/select/index.scss +278 -272
  167. package/theme-chalk/space.scss +20 -0
  168. package/theme-chalk/statistic.scss +35 -0
  169. package/theme-chalk/switch.scss +300 -300
  170. package/theme-chalk/tag.scss +181 -181
  171. package/theme-chalk/text.scss +48 -0
  172. package/theme-chalk/transition.scss +34 -4
  173. package/theme-chalk/tree-select.scss +41 -25
  174. package/theme-chalk/tree.scss +136 -0
  175. package/theme-chalk/var.scss +83 -83
  176. package/dist/Input/Input.1.d.ts +0 -16
  177. package/dist/Input/Input.1.js +0 -376
  178. package/dist/Tree/DirectoryTree.d.ts +0 -15
  179. package/dist/Tree/DirectoryTree.js +0 -183
  180. package/dist/Tree/DropIndicator.d.ts +0 -8
  181. package/dist/Tree/DropIndicator.js +0 -34
  182. package/dist/Tree/Indent.d.ts +0 -9
  183. package/dist/Tree/Indent.js +0 -25
  184. package/dist/Tree/MotionTreeNode.d.ts +0 -14
  185. package/dist/Tree/MotionTreeNode.js +0 -125
  186. package/dist/Tree/NodeList.d.ts +0 -50
  187. package/dist/Tree/NodeList.js +0 -301
  188. package/dist/Tree/RCTree.d.ts +0 -248
  189. package/dist/Tree/RCTree.js +0 -1216
  190. package/dist/Tree/contextTypes.d.ts +0 -69
  191. package/dist/Tree/contextTypes.js +0 -9
  192. package/dist/Tree/typings.tsx--bak +0 -245
  193. package/dist/Tree/useUnmount.d.ts +0 -5
  194. package/dist/Tree/useUnmount.js +0 -34
  195. package/dist/Tree/util.d.ts +0 -51
  196. package/dist/Tree/util.js +0 -303
  197. package/dist/Tree/utils/conductUtil.d.ts +0 -17
  198. package/dist/Tree/utils/conductUtil.js +0 -209
  199. package/dist/Tree/utils/dictUtil.d.ts +0 -13
  200. package/dist/Tree/utils/dictUtil.js +0 -75
  201. package/dist/Tree/utils/diffUtil.d.ts +0 -7
  202. package/dist/Tree/utils/diffUtil.js +0 -48
  203. package/dist/Tree/utils/dropIndicator.d.ts +0 -11
  204. package/dist/Tree/utils/dropIndicator.js +0 -36
  205. package/dist/Tree/utils/iconUtil.d.ts +0 -5
  206. package/dist/Tree/utils/iconUtil.js +0 -62
  207. package/dist/Tree/utils/keyUtil.d.ts +0 -2
  208. package/dist/Tree/utils/keyUtil.js +0 -3
  209. package/dist/Tree/utils/motion.d.ts +0 -10
  210. package/dist/Tree/utils/motion.js +0 -54
  211. package/dist/Tree/utils/pickAttrs.d.ts +0 -11
  212. package/dist/Tree/utils/pickAttrs.js +0 -51
  213. package/dist/Tree/utils/treeUtil.d.ts +0 -86
  214. package/dist/Tree/utils/treeUtil.js +0 -364
  215. package/dist/TreeSelect/Utils.d.ts +0 -3
  216. package/dist/TreeSelect/Utils.js +0 -20
@@ -1,424 +1,439 @@
1
- @use 'sass:map';
2
-
3
- @use '../mixins/mixins' as *;
4
- @use '../mixins/var' as *;
5
- @use '../common/var' as *;
6
-
7
- @mixin inset-prepend-border($color) {
8
- box-shadow: 1px 0 0 0 $color inset, 0 1px 0 0 $color inset, 0 -1px 0 0 $color inset;
9
- }
10
-
11
- @mixin inset-append-border($color) {
12
- box-shadow: 0 1px 0 0 $color inset, 0 -1px 0 0 $color inset, -1px 0 0 0 $color inset;
13
- }
14
-
15
- @mixin inset-prepend-input-border($color) {
16
- box-shadow: 1px 0 0 0 $color inset, 1px 0 0 0 $color, 0 1px 0 0 $color inset, 0 -1px 0 0 $color inset !important;
17
- }
18
-
19
- @mixin inset-append-input-border($color) {
20
- box-shadow: -1px 0 0 0 $color, -1px 0 0 0 $color inset, 0 1px 0 0 $color inset, 0 -1px 0 0 $color inset !important;
21
- }
22
-
23
- @mixin mixed-input-border($color) {
24
- box-shadow: 0 0 0 1px $color inset;
25
- }
26
-
27
- @include b(textarea) {
28
- @include set-component-css-var('input', $input);
29
- }
30
-
31
- @include b(textarea) {
32
- position: relative;
33
- display: inline-block;
34
- width: 100%;
35
- vertical-align: bottom;
36
- font-size: getCssVar('font-size', 'base');
37
-
38
- @include e(inner) {
39
- position: relative;
40
- display: block;
41
- resize: vertical;
42
- padding: 5px map.get($input-padding-horizontal, 'default')-$border-width;
43
- line-height: 1.5;
44
- box-sizing: border-box;
45
- width: 100%;
46
- font-size: inherit;
47
- font-family: inherit;
48
- color: var(#{getCssVarName('input-text-color')}, map.get($input, 'text-color'));
49
- background-color: var(#{getCssVarName('input-bg-color')}, map.get($input, 'bg-color'));
50
- background-image: none;
51
- -webkit-appearance: none;
52
- @include inset-input-border(var(#{getCssVarName('input-border-color')}, map.get($input, 'border-color')));
53
- border-radius: getCssVarWithDefault('input-border-radius', map.get($input, 'border-radius'));
54
- transition: getCssVar('transition-box-shadow');
55
- border: none;
56
-
57
- &::placeholder {
58
- color: getCssVarWithDefault('input-placeholder-color', map.get($input, 'placeholder-color'));
59
- }
60
-
61
- &:hover {
62
- @include inset-input-border(#{getCssVar('input', 'hover-border-color')});
63
- }
64
-
65
- &:focus {
66
- outline: none;
67
- @include inset-input-border(#{getCssVar('input', 'focus-border-color')});
68
- }
69
- }
70
-
71
- & .#{$namespace}-input__count,
72
- & .#{$namespace}-textarea__count {
73
- color: getCssVar('color-info');
74
- background: getCssVar('fill-color', 'blank');
75
- position: absolute;
76
- font-size: 12px;
77
- line-height: 14px;
78
- bottom: 5px;
79
- right: 10px;
80
- }
81
-
82
- @include when(disabled) {
83
- .#{$namespace}-textarea__inner {
84
- @include inset-input-border(#{getCssVar('disabled-border-color')});
85
- background-color: map.get($input-disabled, 'fill');
86
- color: map.get($input-disabled, 'text-color');
87
- cursor: not-allowed;
88
-
89
- &::placeholder {
90
- color: map.get($input-disabled, 'placeholder-color');
91
- }
92
- }
93
- }
94
-
95
- @include when(exceed) {
96
- .#{$namespace}-textarea__inner {
97
- @include mixed-input-border(#{getCssVar('color-danger')});
98
- }
99
-
100
- .#{$namespace}-input__count {
101
- color: getCssVar('color-danger');
102
- }
103
- }
104
- }
105
-
106
- @include b(input) {
107
- @include set-component-css-var('input', $input);
108
- }
109
-
110
- @include b(input) {
111
- @include css-var-from-global('input-height', 'component-size');
112
-
113
- position: relative;
114
- font-size: getCssVar('font-size', 'base');
115
- display: inline-flex;
116
- width: getCssVar('input-width');
117
- line-height: getCssVar('input-height');
118
- box-sizing: border-box;
119
- vertical-align: middle;
120
- @include scroll-bar;
121
-
122
- & .#{$namespace}-input__clear,
123
- & .#{$namespace}-input__password {
124
- color: getCssVar('input-icon-color');
125
- font-size: map.get($input-font-size, 'default');
126
- cursor: pointer;
127
-
128
- &:hover {
129
- color: getCssVar('input-clear-hover-color');
130
- }
131
- }
132
-
133
- & .#{$namespace}-input__count {
134
- height: 100%;
135
- display: inline-flex;
136
- align-items: center;
137
- color: getCssVar('color-info');
138
- font-size: 12px;
139
-
140
- .#{$namespace}-input__count-inner {
141
- background: getCssVar('fill-color', 'blank');
142
- line-height: initial;
143
- display: inline-block;
144
- padding-left: 8px;
145
- }
146
- }
147
-
148
- @include e(wrapper) {
149
- display: inline-flex;
150
- flex-grow: 1;
151
- align-items: center;
152
- justify-content: center;
153
- padding: $border-width map.get($input-padding-horizontal, 'default')-$border-width;
154
- background-color: var(#{getCssVarName('input-bg-color')}, map.get($input, 'bg-color'));
155
- background-image: none;
156
- border-radius: getCssVarWithDefault('input-border-radius', map.get($input, 'border-radius'));
157
- cursor: text;
158
- transition: getCssVar('transition-box-shadow');
159
- transform: translate3d(0, 0, 0);
160
- @include inset-input-border(var(#{getCssVarName('input-border-color')}, map.get($input, 'border-color')));
161
-
162
- &:hover {
163
- @include inset-input-border(#{getCssVar('input', 'hover-border-color')});
164
- }
165
-
166
- @include when(focus) {
167
- @include inset-input-border(#{getCssVar('input', 'focus-border-color')});
168
- }
169
- }
170
-
171
- & {
172
- // use map.get as default value for date picker range
173
- @include set-css-var-value('input-inner-height', calc(var(#{getCssVarName('input-height')}, #{map.get($input-height, 'default')}) - $border-width * 2));
174
- }
175
-
176
- @include e(inner) {
177
- width: 100%;
178
- flex-grow: 1;
179
- -webkit-appearance: none;
180
- color: var(#{getCssVarName('input-text-color')}, map.get($input, 'text-color'));
181
- font-size: inherit;
182
- height: getCssVar('input-inner-height');
183
- line-height: getCssVar('input-inner-height');
184
- padding: 0;
185
- outline: none;
186
- border: none;
187
- background: none;
188
- box-sizing: border-box;
189
-
190
- &:focus {
191
- outline: none;
192
- }
193
-
194
- &::placeholder {
195
- color: getCssVarWithDefault('input-placeholder-color', map.get($input, 'placeholder-color'));
196
- }
197
-
198
- // override edge default style
199
- &[type='password']::-ms-reveal {
200
- display: none;
201
- }
202
-
203
- &[type='number'] {
204
- line-height: 1;
205
- }
206
- }
207
-
208
- @each $slot in (prefix, suffix) {
209
- @include e($slot) {
210
- display: inline-flex;
211
- white-space: nowrap;
212
- flex-shrink: 0;
213
- flex-wrap: nowrap;
214
- height: 100%;
215
- line-height: getCssVar('input-inner-height');
216
- text-align: center;
217
- color: var(#{getCssVarName('input-icon-color')}, map.get($input, 'icon-color'));
218
- transition: all getCssVar('transition-duration');
219
- pointer-events: none;
220
- }
221
-
222
- @include e(#{$slot}-inner) {
223
- pointer-events: all;
224
- display: inline-flex;
225
- align-items: center;
226
- justify-content: center;
227
-
228
- @if $slot == prefix {
229
- > :last-child {
230
- margin-right: 8px;
231
- }
232
-
233
- > :first-child {
234
- &,
235
- &.#{$namespace}-input__icon {
236
- margin-left: 0;
237
- }
238
- }
239
- } @else {
240
- > :first-child {
241
- margin-left: 8px;
242
- }
243
- }
244
- }
245
- }
246
-
247
- & .#{$namespace}-input__icon {
248
- height: inherit;
249
- line-height: inherit;
250
- display: flex;
251
- justify-content: center;
252
- align-items: center;
253
- transition: all getCssVar('transition-duration');
254
- margin-left: 8px;
255
- }
256
-
257
- @include e(validateIcon) {
258
- pointer-events: none;
259
- }
260
-
261
- @include when(active) {
262
- .#{$namespace}-input__wrapper {
263
- @include mixed-input-border(var(#{getCssVarName('input-focus-color')}, map.get($input, 'focus-color')));
264
- }
265
- }
266
-
267
- @include when(disabled) {
268
- cursor: not-allowed;
269
-
270
- .#{$namespace}-input__wrapper {
271
- background-color: map.get($input-disabled, 'fill');
272
- cursor: not-allowed;
273
- @include mixed-input-border(map.get($input-disabled, 'border'));
274
- }
275
-
276
- .#{$namespace}-input__inner {
277
- color: map.get($input-disabled, 'text-color');
278
- -webkit-text-fill-color: map.get($input-disabled, 'text-color');
279
- cursor: not-allowed;
280
-
281
- &::placeholder {
282
- color: map.get($input-disabled, 'placeholder-color');
283
- }
284
- }
285
-
286
- .#{$namespace}-input__icon {
287
- cursor: not-allowed;
288
- }
289
-
290
- .#{$namespace}-input__prefix-inner,
291
- .#{$namespace}-input__suffix-inner {
292
- pointer-events: none;
293
- }
294
- }
295
-
296
- @include when(exceed) {
297
- .#{$namespace}-input__wrapper {
298
- @include mixed-input-border(#{getCssVar('color-danger')});
299
- }
300
-
301
- .#{$namespace}-input__suffix {
302
- .#{$namespace}-input__count {
303
- color: getCssVar('color-danger');
304
- }
305
- }
306
- }
307
-
308
- @each $size in (large, small) {
309
- @include m($size) {
310
- @include css-var-from-global('input-height', ('component-size', $size));
311
-
312
- font-size: map.get($input-font-size, $size);
313
-
314
- @include e(wrapper) {
315
- padding: $border-width map.get($input-padding-horizontal, $size)-$border-width;
316
- }
317
- & {
318
- @include set-css-var-value('input-inner-height', calc(var(#{getCssVarName('input-height')}, #{map.get($input-height, $size)}) - $border-width * 2));
319
- }
320
- }
321
- }
322
- }
323
-
324
- @include b(input-group) {
325
- display: inline-flex;
326
- width: 100%;
327
- align-items: stretch;
328
-
329
- @include e((append, prepend)) {
330
- background-color: getCssVar('fill-color', 'light');
331
- color: getCssVar('color-info');
332
- position: relative;
333
- display: inline-flex;
334
- align-items: center;
335
- justify-content: center;
336
- min-height: 100%;
337
- border-radius: getCssVar('input-border-radius');
338
- padding: 0 20px;
339
- white-space: nowrap;
340
-
341
- &:focus {
342
- outline: none;
343
- }
344
-
345
- .#{$namespace}-select,
346
- .#{$namespace}-button {
347
- display: inline-block;
348
- flex: 1;
349
- margin: 0 -20px;
350
- }
351
-
352
- button.#{$namespace}-button,
353
- button.#{$namespace}-button:hover,
354
- div.#{$namespace}-select .#{$namespace}-select__wrapper,
355
- div.#{$namespace}-select:hover .#{$namespace}-select__wrapper {
356
- border-color: transparent;
357
- background-color: transparent;
358
- color: inherit;
359
- }
360
-
361
- .#{$namespace}-button,
362
- .#{$namespace}-input {
363
- font-size: inherit;
364
- }
365
- }
366
-
367
- @include e(prepend) {
368
- border-right: 0;
369
- border-top-right-radius: 0;
370
- border-bottom-right-radius: 0;
371
- @include inset-prepend-border(#{getCssVar('input-border-color')});
372
- }
373
-
374
- @include e(append) {
375
- border-left: 0;
376
- border-top-left-radius: 0;
377
- border-bottom-left-radius: 0;
378
- @include inset-append-border(#{getCssVar('input-border-color')});
379
- }
380
-
381
- @include m(prepend) {
382
- > .#{$namespace}-input__wrapper {
383
- border-top-left-radius: 0;
384
- border-bottom-left-radius: 0;
385
- }
386
-
387
- @include e(prepend) {
388
- .#{$namespace}-select {
389
- .#{$namespace}-select__wrapper {
390
- border-top-right-radius: 0;
391
- border-bottom-right-radius: 0;
392
- @include inset-prepend-border(#{getCssVar('input-border-color')});
393
- }
394
- }
395
- }
396
- :has(> .#{$namespace}-select) {
397
- background-color: var(--el-fill-color-blank);
398
- }
399
- }
400
-
401
- @include m(append) {
402
- > .#{$namespace}-input__wrapper {
403
- border-top-right-radius: 0;
404
- border-bottom-right-radius: 0;
405
- }
406
-
407
- @include e(append) {
408
- .#{$namespace}-select {
409
- .#{$namespace}-select__wrapper {
410
- border-top-left-radius: 0;
411
- border-bottom-left-radius: 0;
412
- @include inset-append-border(#{getCssVar('input-border-color')});
413
- }
414
- }
415
- }
416
- :has(> .#{$namespace}-select) {
417
- background-color: var(--el-fill-color-blank);
418
- }
419
- }
420
- }
421
-
422
- @include b(input-hidden) {
423
- display: none !important;
424
- }
1
+ @use 'sass:map';
2
+
3
+ @use '../mixins/mixins' as *;
4
+ @use '../mixins/var' as *;
5
+ @use '../common/var' as *;
6
+
7
+ @mixin inset-prepend-border($color) {
8
+ box-shadow: 1px 0 0 0 $color inset, 0 1px 0 0 $color inset, 0 -1px 0 0 $color inset;
9
+ }
10
+
11
+ @mixin inset-append-border($color) {
12
+ box-shadow: 0 1px 0 0 $color inset, 0 -1px 0 0 $color inset, -1px 0 0 0 $color inset;
13
+ }
14
+
15
+ @mixin inset-prepend-input-border($color) {
16
+ box-shadow: 1px 0 0 0 $color inset, 1px 0 0 0 $color, 0 1px 0 0 $color inset, 0 -1px 0 0 $color inset !important;
17
+ }
18
+
19
+ @mixin inset-append-input-border($color) {
20
+ box-shadow: -1px 0 0 0 $color, -1px 0 0 0 $color inset, 0 1px 0 0 $color inset, 0 -1px 0 0 $color inset !important;
21
+ }
22
+
23
+ @mixin mixed-input-border($color) {
24
+ box-shadow: 0 0 0 1px $color inset;
25
+ }
26
+
27
+ @include b(textarea) {
28
+ @include set-component-css-var('input', $input);
29
+ }
30
+
31
+ @include b(textarea) {
32
+ position: relative;
33
+ display: inline-block;
34
+ width: 100%;
35
+ vertical-align: bottom;
36
+ font-size: getCssVar('font-size', 'base');
37
+
38
+ @include e(inner) {
39
+ position: relative;
40
+ display: block;
41
+ resize: vertical;
42
+ padding: 5px map.get($input-padding-horizontal, 'default')-$border-width;
43
+ line-height: 1.5;
44
+ box-sizing: border-box;
45
+ width: 100%;
46
+ font-size: inherit;
47
+ font-family: inherit;
48
+ color: var(#{getCssVarName('input-text-color')}, map.get($input, 'text-color'));
49
+ background-color: var(#{getCssVarName('input-bg-color')}, map.get($input, 'bg-color'));
50
+ background-image: none;
51
+ -webkit-appearance: none;
52
+ @include inset-input-border(var(#{getCssVarName('input-border-color')}, map.get($input, 'border-color')));
53
+ border-radius: getCssVarWithDefault('input-border-radius', map.get($input, 'border-radius'));
54
+ transition: getCssVar('transition-box-shadow');
55
+ border: none;
56
+
57
+ &::placeholder {
58
+ color: getCssVarWithDefault('input-placeholder-color', map.get($input, 'placeholder-color'));
59
+ }
60
+
61
+ &:hover {
62
+ @include inset-input-border(#{getCssVar('input', 'hover-border-color')});
63
+ }
64
+
65
+ &:focus {
66
+ outline: none;
67
+ @include inset-input-border(#{getCssVar('input', 'focus-border-color')});
68
+ }
69
+ }
70
+
71
+ & .#{$namespace}-input__count,
72
+ & .#{$namespace}-textarea__count {
73
+ color: getCssVar('color-info');
74
+ background: getCssVar('fill-color', 'blank');
75
+ position: absolute;
76
+ font-size: 12px;
77
+ line-height: 14px;
78
+ bottom: 5px;
79
+ right: 10px;
80
+ }
81
+
82
+ @include when(plain) {
83
+ .#{$namespace}-textarea__inner {
84
+ box-shadow: none;
85
+ resize: none;
86
+ padding: 0;
87
+ }
88
+ }
89
+
90
+ @include when(disabled) {
91
+ .#{$namespace}-textarea__inner {
92
+ @include inset-input-border(#{getCssVar('disabled-border-color')});
93
+ background-color: map.get($input-disabled, 'fill');
94
+ color: map.get($input-disabled, 'text-color');
95
+ cursor: not-allowed;
96
+
97
+ &::placeholder {
98
+ color: map.get($input-disabled, 'placeholder-color');
99
+ }
100
+ }
101
+ }
102
+
103
+ @include when(exceed) {
104
+ .#{$namespace}-textarea__inner {
105
+ @include mixed-input-border(#{getCssVar('color-danger')});
106
+ }
107
+
108
+ .#{$namespace}-input__count {
109
+ color: getCssVar('color-danger');
110
+ }
111
+ }
112
+ }
113
+
114
+ @include b(input) {
115
+ @include set-component-css-var('input', $input);
116
+ }
117
+
118
+ @include b(input) {
119
+ @include css-var-from-global('input-height', 'component-size');
120
+
121
+ position: relative;
122
+ font-size: getCssVar('font-size', 'base');
123
+ display: inline-flex;
124
+ width: getCssVar('input-width');
125
+ line-height: getCssVar('input-height');
126
+ box-sizing: border-box;
127
+ vertical-align: middle;
128
+ @include scroll-bar;
129
+
130
+ & .#{$namespace}-input__clear,
131
+ & .#{$namespace}-input__password {
132
+ color: getCssVar('input-icon-color');
133
+ font-size: map.get($input-font-size, 'default');
134
+ cursor: pointer;
135
+
136
+ &:hover {
137
+ color: getCssVar('input-clear-hover-color');
138
+ }
139
+ }
140
+
141
+ & .#{$namespace}-input__count {
142
+ height: 100%;
143
+ display: inline-flex;
144
+ align-items: center;
145
+ color: getCssVar('color-info');
146
+ font-size: 12px;
147
+
148
+ .#{$namespace}-input__count-inner {
149
+ background: getCssVar('fill-color', 'blank');
150
+ line-height: initial;
151
+ display: inline-block;
152
+ padding-left: 8px;
153
+ }
154
+ }
155
+
156
+ @include e(wrapper) {
157
+ display: inline-flex;
158
+ flex-grow: 1;
159
+ align-items: center;
160
+ justify-content: center;
161
+ padding: $border-width map.get($input-padding-horizontal, 'default')-$border-width;
162
+ background-color: var(#{getCssVarName('input-bg-color')}, map.get($input, 'bg-color'));
163
+ background-image: none;
164
+ border-radius: getCssVarWithDefault('input-border-radius', map.get($input, 'border-radius'));
165
+ cursor: text;
166
+ transition: getCssVar('transition-box-shadow');
167
+ transform: translate3d(0, 0, 0);
168
+ @include inset-input-border(var(#{getCssVarName('input-border-color')}, map.get($input, 'border-color')));
169
+
170
+ &:hover {
171
+ @include inset-input-border(#{getCssVar('input', 'hover-border-color')});
172
+ }
173
+
174
+ @include when(focus) {
175
+ @include inset-input-border(#{getCssVar('input', 'focus-border-color')});
176
+ }
177
+ }
178
+
179
+ & {
180
+ // use map.get as default value for date picker range
181
+ @include set-css-var-value('input-inner-height', calc(var(#{getCssVarName('input-height')}, #{map.get($input-height, 'default')}) - $border-width * 2));
182
+ }
183
+
184
+ @include e(inner) {
185
+ width: 100%;
186
+ flex-grow: 1;
187
+ -webkit-appearance: none;
188
+ color: var(#{getCssVarName('input-text-color')}, map.get($input, 'text-color'));
189
+ font-size: inherit;
190
+ height: getCssVar('input-inner-height');
191
+ line-height: getCssVar('input-inner-height');
192
+ padding: 0;
193
+ outline: none;
194
+ border: none;
195
+ background: none;
196
+ box-sizing: border-box;
197
+
198
+ &:focus {
199
+ outline: none;
200
+ }
201
+
202
+ &::placeholder {
203
+ color: getCssVarWithDefault('input-placeholder-color', map.get($input, 'placeholder-color'));
204
+ }
205
+
206
+ // override edge default style
207
+ &[type='password']::-ms-reveal {
208
+ display: none;
209
+ }
210
+
211
+ &[type='number'] {
212
+ line-height: 1;
213
+ }
214
+ }
215
+
216
+ @each $slot in (prefix, suffix) {
217
+ @include e($slot) {
218
+ display: inline-flex;
219
+ white-space: nowrap;
220
+ flex-shrink: 0;
221
+ flex-wrap: nowrap;
222
+ height: 100%;
223
+ line-height: getCssVar('input-inner-height');
224
+ text-align: center;
225
+ color: var(#{getCssVarName('input-icon-color')}, map.get($input, 'icon-color'));
226
+ transition: all getCssVar('transition-duration');
227
+ pointer-events: none;
228
+ }
229
+
230
+ @include e(#{$slot}-inner) {
231
+ pointer-events: all;
232
+ display: inline-flex;
233
+ align-items: center;
234
+ justify-content: center;
235
+
236
+ @if $slot == prefix {
237
+ > :last-child {
238
+ margin-right: 8px;
239
+ }
240
+
241
+ > :first-child {
242
+ &,
243
+ &.#{$namespace}-input__icon {
244
+ margin-left: 0;
245
+ }
246
+ }
247
+ } @else {
248
+ > :first-child {
249
+ margin-left: 8px;
250
+ }
251
+ }
252
+ }
253
+ }
254
+
255
+ & .#{$namespace}-input__icon {
256
+ height: inherit;
257
+ line-height: inherit;
258
+ display: flex;
259
+ justify-content: center;
260
+ align-items: center;
261
+ transition: all getCssVar('transition-duration');
262
+ margin-left: 8px;
263
+ }
264
+
265
+ @include e(validateIcon) {
266
+ pointer-events: none;
267
+ }
268
+
269
+ @include when(active) {
270
+ .#{$namespace}-input__wrapper {
271
+ @include mixed-input-border(var(#{getCssVarName('input-focus-color')}, map.get($input, 'focus-color')));
272
+ }
273
+ }
274
+
275
+ @include when(plain) {
276
+ .#{$namespace}-input__wrapper {
277
+ box-shadow: none;
278
+ padding: 0;
279
+ }
280
+ }
281
+
282
+ @include when(disabled) {
283
+ cursor: not-allowed;
284
+
285
+ .#{$namespace}-input__wrapper {
286
+ background-color: map.get($input-disabled, 'fill');
287
+ cursor: not-allowed;
288
+ @include mixed-input-border(map.get($input-disabled, 'border'));
289
+ }
290
+
291
+ .#{$namespace}-input__inner {
292
+ color: map.get($input-disabled, 'text-color');
293
+ -webkit-text-fill-color: map.get($input-disabled, 'text-color');
294
+ cursor: not-allowed;
295
+
296
+ &::placeholder {
297
+ color: map.get($input-disabled, 'placeholder-color');
298
+ }
299
+ }
300
+
301
+ .#{$namespace}-input__icon {
302
+ cursor: not-allowed;
303
+ }
304
+
305
+ .#{$namespace}-input__prefix-inner,
306
+ .#{$namespace}-input__suffix-inner {
307
+ pointer-events: none;
308
+ }
309
+ }
310
+
311
+ @include when(exceed) {
312
+ .#{$namespace}-input__wrapper {
313
+ @include mixed-input-border(#{getCssVar('color-danger')});
314
+ }
315
+
316
+ .#{$namespace}-input__suffix {
317
+ .#{$namespace}-input__count {
318
+ color: getCssVar('color-danger');
319
+ }
320
+ }
321
+ }
322
+
323
+ @each $size in (large, small) {
324
+ @include m($size) {
325
+ @include css-var-from-global('input-height', ('component-size', $size));
326
+
327
+ font-size: map.get($input-font-size, $size);
328
+
329
+ @include e(wrapper) {
330
+ padding: $border-width map.get($input-padding-horizontal, $size)-$border-width;
331
+ }
332
+ & {
333
+ @include set-css-var-value('input-inner-height', calc(var(#{getCssVarName('input-height')}, #{map.get($input-height, $size)}) - $border-width * 2));
334
+ }
335
+ }
336
+ }
337
+ }
338
+
339
+ @include b(input-group) {
340
+ display: inline-flex;
341
+ width: 100%;
342
+ align-items: stretch;
343
+
344
+ @include e((append, prepend)) {
345
+ background-color: getCssVar('fill-color', 'light');
346
+ color: getCssVar('color-info');
347
+ position: relative;
348
+ display: inline-flex;
349
+ align-items: center;
350
+ justify-content: center;
351
+ min-height: 100%;
352
+ border-radius: getCssVar('input-border-radius');
353
+ padding: 0 20px;
354
+ white-space: nowrap;
355
+
356
+ &:focus {
357
+ outline: none;
358
+ }
359
+
360
+ .#{$namespace}-select,
361
+ .#{$namespace}-button {
362
+ display: inline-block;
363
+ flex: 1;
364
+ margin: 0 -20px;
365
+ }
366
+
367
+ button.#{$namespace}-button,
368
+ button.#{$namespace}-button:hover,
369
+ div.#{$namespace}-select .#{$namespace}-select__wrapper,
370
+ div.#{$namespace}-select:hover .#{$namespace}-select__wrapper {
371
+ border-color: transparent;
372
+ background-color: transparent;
373
+ color: inherit;
374
+ }
375
+
376
+ .#{$namespace}-button,
377
+ .#{$namespace}-input {
378
+ font-size: inherit;
379
+ }
380
+ }
381
+
382
+ @include e(prepend) {
383
+ border-right: 0;
384
+ border-top-right-radius: 0;
385
+ border-bottom-right-radius: 0;
386
+ @include inset-prepend-border(#{getCssVar('input-border-color')});
387
+ }
388
+
389
+ @include e(append) {
390
+ border-left: 0;
391
+ border-top-left-radius: 0;
392
+ border-bottom-left-radius: 0;
393
+ @include inset-append-border(#{getCssVar('input-border-color')});
394
+ }
395
+
396
+ @include m(prepend) {
397
+ > .#{$namespace}-input__wrapper {
398
+ border-top-left-radius: 0;
399
+ border-bottom-left-radius: 0;
400
+ }
401
+
402
+ @include e(prepend) {
403
+ .#{$namespace}-select {
404
+ .#{$namespace}-select__wrapper {
405
+ border-top-right-radius: 0;
406
+ border-bottom-right-radius: 0;
407
+ @include inset-prepend-border(#{getCssVar('input-border-color')});
408
+ }
409
+ }
410
+ }
411
+ :has(> .#{$namespace}-select) {
412
+ background-color: var(--el-fill-color-blank);
413
+ }
414
+ }
415
+
416
+ @include m(append) {
417
+ > .#{$namespace}-input__wrapper {
418
+ border-top-right-radius: 0;
419
+ border-bottom-right-radius: 0;
420
+ }
421
+
422
+ @include e(append) {
423
+ .#{$namespace}-select {
424
+ .#{$namespace}-select__wrapper {
425
+ border-top-left-radius: 0;
426
+ border-bottom-left-radius: 0;
427
+ @include inset-append-border(#{getCssVar('input-border-color')});
428
+ }
429
+ }
430
+ }
431
+ :has(> .#{$namespace}-select) {
432
+ background-color: var(--el-fill-color-blank);
433
+ }
434
+ }
435
+ }
436
+
437
+ @include b(input-hidden) {
438
+ display: none !important;
439
+ }