@qsxy/element-plus-react 1.0.1 → 1.0.2

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 (66) hide show
  1. package/dist/Calendar/Calendar.js +12 -3
  2. package/dist/Calendar/Footer.js +4 -2
  3. package/dist/Calendar/QuarterPanel.d.ts +4 -0
  4. package/dist/Calendar/QuarterPanel.js +109 -0
  5. package/dist/Calendar/WeekPanel.js +1 -1
  6. package/dist/Calendar/typings.d.ts +1 -1
  7. package/dist/Card/Card.js +9 -4
  8. package/dist/Card/typings.d.ts +1 -1
  9. package/dist/Cascader/Cascader.js +1 -1
  10. package/dist/DatePicker/DatePicker.js +38 -12
  11. package/dist/DatePicker/DateRangePicker.js +27 -9
  12. package/dist/DatePicker/main.js +1 -1
  13. package/dist/DatePicker/typings.d.ts +1 -1
  14. package/dist/DateTimePicker/DateTimePicker.js +2 -2
  15. package/dist/Input/Input.1.d.ts +16 -0
  16. package/dist/Input/Input.1.js +376 -0
  17. package/dist/Input/Input.js +137 -121
  18. package/dist/Input/InputRange.js +1 -1
  19. package/dist/Input/TextArea.js +87 -12
  20. package/dist/Input/typings.d.ts +15 -5
  21. package/dist/Input/useComposition.d.ts +23 -0
  22. package/dist/Input/useComposition.js +63 -0
  23. package/dist/Input/utils.d.ts +6 -0
  24. package/dist/Input/utils.js +91 -0
  25. package/dist/InputNumber/InputNumber.js +1 -1
  26. package/dist/InputNumber/typings.d.ts +1 -1
  27. package/dist/Select/Option.js +30 -14
  28. package/dist/Select/SelectContext.d.ts +3 -4
  29. package/dist/Select/SelectCore.d.ts +2 -2
  30. package/dist/Select/SelectCore.js +164 -447
  31. package/dist/Select/SelectDropdown.js +67 -145
  32. package/dist/Select/typings.d.ts +47 -21
  33. package/dist/Select/useSelect.d.ts +125 -0
  34. package/dist/Select/useSelect.js +516 -0
  35. package/dist/Table/util.js +6 -5
  36. package/dist/Tag/Tag.js +22 -17
  37. package/dist/TimePicker/TimePicker.js +2 -2
  38. package/dist/TreeSelect/TreeSelect.js +2 -2
  39. package/dist/Util/aria.d.ts +25 -0
  40. package/dist/Util/aria.js +118 -0
  41. package/dist/hooks/useCalcInputWidth.d.ts +8 -0
  42. package/dist/hooks/useCalcInputWidth.js +30 -0
  43. package/dist/hooks/useComposition.d.ts +16 -0
  44. package/dist/hooks/useComposition.js +39 -0
  45. package/dist/hooks/useCursor.d.ts +2 -0
  46. package/dist/hooks/useCursor.js +52 -0
  47. package/dist/hooks/useFocusController.d.ts +27 -0
  48. package/dist/hooks/useFocusController.js +72 -0
  49. package/dist/index.css +1 -1
  50. package/dist/locale/en.d.ts +15 -0
  51. package/dist/locale/en.js +15 -0
  52. package/dist/locale/zhCn.d.ts +15 -0
  53. package/dist/locale/zhCn.js +15 -0
  54. package/package.json +1 -1
  55. package/theme-chalk/calendar/index.scss +1 -0
  56. package/theme-chalk/calendar/quarter-table.scss +78 -0
  57. package/theme-chalk/common/var.scss +1 -1
  58. package/theme-chalk/input/input.scss +424 -578
  59. package/theme-chalk/input/input.scss--bak +578 -0
  60. package/theme-chalk/select/index.scss +272 -247
  61. package/theme-chalk/select/index.scss--bak +247 -0
  62. package/theme-chalk/select/option-group.scss +2 -2
  63. package/theme-chalk/select/option.scss +2 -2
  64. package/theme-chalk/select/select-dropdown.scss +2 -2
  65. package/theme-chalk/tag.scss +181 -203
  66. package/theme-chalk/tag.scss--bak +203 -0
@@ -1,247 +1,272 @@
1
- @use '../mixins/config' as *;
2
-
3
- .#{$namespace}-select {
4
- --#{$namespace}-select-border-color-hover: var(--#{$namespace}-border-color-hover);
5
- --#{$namespace}-select-disabled-border: var(--#{$namespace}-disabled-border-color);
6
- --#{$namespace}-select-close-hover-color: var(--#{$namespace}-text-color-secondary);
7
- --#{$namespace}-select-input-color: var(--#{$namespace}-text-color-placeholder);
8
- --#{$namespace}-select-multiple-input-color: var(--#{$namespace}-text-color-regular);
9
- --#{$namespace}-select-input-focus-border-color: var(--#{$namespace}-color-primary);
10
- }
11
-
12
- .#{$namespace}-select {
13
- display: inline-block;
14
- position: relative;
15
- // height: 32px;
16
- // line-height: 32px;
17
- font-size: 14px;
18
- zoom: 1;
19
- *display: inline;
20
- width: 100%;
21
-
22
- .#{$namespace}-select__trigger {
23
- cursor: pointer;
24
- }
25
-
26
- .#{$namespace}-input__inner {
27
- cursor: pointer;
28
- display: inline-flex;
29
- }
30
-
31
- &.is-disabled {
32
- .#{$namespace}-input__inner {
33
- cursor: not-allowed;
34
- }
35
-
36
- .#{$namespace}-select__tags .#{$namespace}-tag--info {
37
- background-color: var(--#{$namespace}-fill-color-darker);
38
- }
39
- }
40
-
41
- .#{$namespace}-select__tags {
42
- & > span {
43
- display: inline-block;
44
- }
45
-
46
- .#{$namespace}-tag {
47
- box-sizing: border-box;
48
- border-color: transparent;
49
- margin: 2px 6px 2px 0;
50
- }
51
- }
52
-
53
- .#{$namespace}-select-tags-wrapper.has-prefix {
54
- margin-left: 6px;
55
- }
56
- }
57
-
58
- // .#{$namespace}-select--large {
59
- // height: var(--#{$namespace}-component-size-large);
60
- // line-height: var(--#{$namespace}-component-size-large);
61
- // }
62
-
63
- // .#{$namespace}-select--small {
64
- // height: var(--#{$namespace}-component-size-small);
65
- // line-height: var(--#{$namespace}-component-size-small);
66
- // }
67
-
68
- .#{$namespace}-select__tags {
69
- position: absolute;
70
- line-height: normal;
71
- white-space: normal;
72
- z-index: 1;
73
- top: 50%;
74
- transform: translateY(-50%);
75
- display: flex;
76
- align-items: center;
77
- flex-wrap: wrap;
78
- margin-right: 30px;
79
- }
80
-
81
- .#{$namespace}-select .#{$namespace}-select__tags .#{$namespace}-tag--info {
82
- background-color: var(--#{$namespace}-fill-color);
83
- }
84
-
85
- .#{$namespace}-select-dorpdown {
86
- .#{$namespace}-select-dropdown__wrap {
87
- max-height: 274px;
88
- }
89
-
90
- .#{$namespace}-select-dropdown__list {
91
- // box-sizing: border-box;
92
- // width: 100%;
93
- // border-radius: 4px;
94
- // background-clip: padding-box;
95
-
96
- position: relative;
97
- // overflow-x: hidden;
98
- // overflow-y: auto;
99
- margin: 4px 0;
100
- padding: 0;
101
- max-height: 240px;
102
- -webkit-overflow-scrolling: touch;
103
- font-size: 14px;
104
-
105
- .#{$namespace}-select-dropdown__item {
106
- display: list-item;
107
- cursor: pointer;
108
- margin: 0;
109
- padding: 0 15px;
110
- list-style: none;
111
- -webkit-touch-callout: none;
112
- position: relative;
113
- white-space: nowrap;
114
- overflow: hidden;
115
- text-overflow: ellipsis;
116
- color: var(--#{$namespace}-text-color-regular);
117
- height: 34px;
118
- line-height: 34px;
119
- box-sizing: border-box;
120
- cursor: pointer;
121
-
122
- &.selected {
123
- color: var(--#{$namespace}-color-primary);
124
- }
125
-
126
- &.hover {
127
- background-color: var(--#{$namespace}-fill-color-light);
128
- }
129
-
130
- &.is-disabled {
131
- color: var(--#{$namespace}-text-color-placeholder);
132
- cursor: not-allowed;
133
-
134
- &.hover {
135
- background-color: transparent;
136
- color: var(--#{$namespace}-text-color-placeholder);
137
- }
138
- }
139
-
140
- &.no-data,
141
- &.loading {
142
- text-align: center;
143
- margin: -4px 0;
144
- }
145
- }
146
- }
147
-
148
- .#{$namespace}-select__search {
149
- position: relative;
150
- z-index: 1010;
151
- margin: 0;
152
- padding: 3px 4px;
153
- white-space: nowrap;
154
-
155
- .#{$namespace}-clear {
156
- cursor: pointer;
157
- pointer-events: unset;
158
- }
159
- }
160
-
161
- &.is-multiple .#{$namespace}-select-dropdown__item.selected:after {
162
- content: '';
163
- position: absolute;
164
- top: 50%;
165
- right: 20px;
166
- border-top: none;
167
- border-right: none;
168
- background-repeat: no-repeat;
169
- background-position: center;
170
- background: var(--#{$namespace}-bg-color-primary, var(--#{$namespace}-color-primary));
171
- mask: url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E")
172
- no-repeat;
173
- mask-size: 100% 100%;
174
- -webkit-mask: url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E")
175
- no-repeat;
176
- -webkit-mask-size: 100% 100%;
177
- transform: translateY(-50%);
178
- width: 16px;
179
- height: 16px;
180
- }
181
- }
182
-
183
- .#{$namespace}-select-group {
184
- margin: 0;
185
- padding: 0;
186
-
187
- & .#{$namespace}-select-dropdown__item {
188
- padding-left: 20px;
189
- }
190
- }
191
-
192
- .#{$namespace}-select-group__wrap {
193
- position: relative;
194
- list-style: none;
195
- margin: 0;
196
- padding: 0;
197
-
198
- &:not(:last-of-type) {
199
- padding-bottom: 24px;
200
-
201
- &::after {
202
- content: '';
203
- position: absolute;
204
- display: block;
205
- left: 20px;
206
- right: 20px;
207
- bottom: 12px;
208
- height: 1px;
209
- background: var(--#{$namespace}-border-color-light);
210
- }
211
- }
212
- }
213
-
214
- .#{$namespace}-select-group__split {
215
- .#{$namespace}-select-group__split-dash {
216
- position: absolute;
217
- left: 20px;
218
- right: 20px;
219
- height: 1px;
220
- background: #e4e7ed;
221
- }
222
- }
223
-
224
- .#{$namespace}-select-group__title {
225
- padding-left: 20px;
226
- font-size: 12px;
227
- color: var(--#{$namespace}-color-info);
228
- line-height: 30px;
229
- }
230
-
231
- .#{$namespace}-select__input {
232
- border: none;
233
- outline: none;
234
- padding: 0;
235
- margin-left: 15px;
236
- color: var(--#{$namespace}-select-multiple-input-color);
237
- font-size: 14px;
238
- appearance: none;
239
- height: 28px;
240
- background-color: transparent;
241
- }
242
-
243
- .#{$namespace}-select__tooltip {
244
- .#{$namespace}-tag {
245
- margin: 5px;
246
- }
247
- }
1
+ @use 'sass:map';
2
+
3
+ @use '../mixins/mixins' as *;
4
+ @use '../mixins/utils' as *;
5
+ @use '../mixins/var' as *;
6
+ @use '../common/var' as *;
7
+ @use './select-dropdown.scss';
8
+ @use './option.scss';
9
+ @use './option-group.scss';
10
+
11
+ @mixin mixed-input-border($color) {
12
+ box-shadow: 0 0 0 1px $color inset;
13
+ }
14
+
15
+ @include b(select) {
16
+ @include set-component-css-var('select', $select);
17
+ }
18
+
19
+ @include b(select) {
20
+ display: inline-block;
21
+ position: relative;
22
+ vertical-align: middle;
23
+ width: getCssVar('select-width');
24
+
25
+ @include e(wrapper) {
26
+ display: flex;
27
+ align-items: center;
28
+ position: relative;
29
+ box-sizing: border-box;
30
+ cursor: pointer;
31
+ text-align: left;
32
+ font-size: map.get($input-font-size, 'default');
33
+ padding: map.get($select-wrapper-padding, 'default');
34
+ gap: map.get($select-item-gap, 'default');
35
+ min-height: map.get($input-height, 'default');
36
+ line-height: map.get($select-item-height, 'default');
37
+ border-radius: getCssVar('border-radius-base');
38
+ background-color: getCssVar('fill-color', 'blank');
39
+ transition: getCssVar('transition', 'duration');
40
+ transform: translate3d(0, 0, 0);
41
+ @include mixed-input-border(#{getCssVar('border-color')});
42
+
43
+ @include when(filterable) {
44
+ cursor: text;
45
+ }
46
+
47
+ @include when(focused) {
48
+ @include mixed-input-border(#{getCssVar('color-primary')});
49
+ }
50
+
51
+ @include when(hovering) {
52
+ &:not(.is-focused) {
53
+ @include mixed-input-border(#{getCssVar('border-color-hover')});
54
+ }
55
+ }
56
+
57
+ @include when(disabled) {
58
+ cursor: not-allowed;
59
+
60
+ background-color: getCssVar('fill-color', 'light');
61
+ color: getCssVar('text-color', 'placeholder');
62
+ @include mixed-input-border(#{getCssVar('select-disabled-border')});
63
+
64
+ &:hover {
65
+ @include mixed-input-border(#{getCssVar('select-disabled-border')});
66
+ }
67
+
68
+ &.is-focus {
69
+ @include mixed-input-border(#{getCssVar('input-focus-border-color')});
70
+ }
71
+
72
+ @include e(selected-item) {
73
+ color: getCssVar('select-disabled-color');
74
+ }
75
+
76
+ @include e(caret) {
77
+ cursor: not-allowed;
78
+ }
79
+
80
+ .#{$namespace}-tag {
81
+ cursor: not-allowed;
82
+ }
83
+
84
+ // When the native input tag is disabled, the cursor value is the 'default'.
85
+ input {
86
+ cursor: not-allowed;
87
+ }
88
+
89
+ .#{$namespace}-select__prefix,
90
+ .#{$namespace}-select__suffix {
91
+ pointer-events: none;
92
+ }
93
+ }
94
+ }
95
+
96
+ @include e(prefix) {
97
+ display: flex;
98
+ align-items: center;
99
+ flex-shrink: 0;
100
+ gap: map.get($select-item-gap, 'default');
101
+ color: var(#{getCssVarName('input-icon-color')}, map.get($input, 'icon-color'));
102
+ }
103
+
104
+ @include e(suffix) {
105
+ display: flex;
106
+ align-items: center;
107
+ flex-shrink: 0;
108
+ gap: map.get($select-item-gap, 'default');
109
+ color: var(#{getCssVarName('input-icon-color')}, map.get($input, 'icon-color'));
110
+
111
+ @include when(hidden-clear) {
112
+ .#{$namespace}-select__clear {
113
+ display: none;
114
+ }
115
+ }
116
+
117
+ @include when(hidden-arrow) {
118
+ .#{$namespace}-select__arrow {
119
+ display: none;
120
+ }
121
+ }
122
+ }
123
+
124
+ @include e(caret) {
125
+ color: getCssVar('select-input-color');
126
+ font-size: getCssVar('select-input-font-size');
127
+ transition: getCssVar('transition', 'duration');
128
+ transform: rotateZ(0deg);
129
+ cursor: pointer;
130
+
131
+ @include when(reverse) {
132
+ transform: rotateZ(180deg);
133
+ }
134
+ }
135
+
136
+ @include e(clear) {
137
+ cursor: pointer;
138
+
139
+ &:hover {
140
+ color: getCssVar('select-close-hover-color');
141
+ }
142
+ }
143
+
144
+ @include e(selection) {
145
+ position: relative;
146
+ display: flex;
147
+ flex-wrap: wrap;
148
+ align-items: center;
149
+ flex: 1;
150
+ min-width: 0;
151
+ gap: map.get($select-item-gap, 'default');
152
+
153
+ @include when(near) {
154
+ margin-left: map.get($select-near-margin-left, 'default');
155
+ }
156
+
157
+ .#{$namespace}-tag {
158
+ cursor: pointer;
159
+ border-color: transparent;
160
+
161
+ &.#{$namespace}-tag--plain {
162
+ border-color: getCssVar('tag', 'border-color');
163
+ }
164
+
165
+ .#{$namespace}-tag__content {
166
+ min-width: 0;
167
+ }
168
+ }
169
+ }
170
+
171
+ @include e(selected-item) {
172
+ display: flex;
173
+ flex-wrap: wrap;
174
+ user-select: none;
175
+ }
176
+
177
+ @include e(tags-text) {
178
+ display: block;
179
+ line-height: normal;
180
+ @include utils-ellipsis;
181
+ }
182
+
183
+ @include e(placeholder) {
184
+ position: absolute;
185
+ z-index: -1;
186
+ display: block;
187
+ top: 50%;
188
+ transform: translateY(-50%);
189
+ width: 100%;
190
+ @include utils-ellipsis;
191
+ color: var(#{getCssVarName('input-text-color')}, map.get($input, 'text-color'));
192
+
193
+ @include when(transparent) {
194
+ user-select: none;
195
+ color: getCssVar('text-color', 'placeholder');
196
+ }
197
+ }
198
+
199
+ @include e(popper) {
200
+ @include picker-popper(map.get($select-dropdown, 'bg-color'), map.get($select-dropdown, 'border'), map.get($select-dropdown, 'shadow'));
201
+ }
202
+
203
+ @include e(input-wrapper) {
204
+ flex: 1;
205
+
206
+ @include when(hidden) {
207
+ // Out of the document flow
208
+ position: absolute;
209
+ opacity: 0;
210
+ z-index: -1;
211
+ }
212
+ }
213
+
214
+ @include e(input) {
215
+ border: none;
216
+ outline: none;
217
+ padding: 0;
218
+ color: getCssVar('select-multiple-input-color');
219
+ font-size: inherit;
220
+ font-family: inherit;
221
+ appearance: none;
222
+ height: map.get($select-item-height, 'default');
223
+ width: 100%;
224
+ background-color: transparent;
225
+
226
+ @include when(disabled) {
227
+ cursor: not-allowed;
228
+ }
229
+ }
230
+
231
+ @include e(input-calculator) {
232
+ position: absolute;
233
+ left: 0;
234
+ top: 0;
235
+ max-width: 100%;
236
+ visibility: hidden;
237
+ white-space: pre;
238
+ overflow: hidden;
239
+ }
240
+
241
+ @each $size in (large, small) {
242
+ @include m($size) {
243
+ @include e(wrapper) {
244
+ gap: map.get($select-item-gap, $size);
245
+ padding: map.get($select-wrapper-padding, $size);
246
+ min-height: map.get($input-height, $size);
247
+ line-height: map.get($select-item-height, $size);
248
+ font-size: map.get($input-font-size, $size);
249
+ }
250
+
251
+ @include e(selection) {
252
+ gap: map.get($select-item-gap, $size);
253
+
254
+ @include when(near) {
255
+ margin-left: map.get($select-near-margin-left, $size);
256
+ }
257
+ }
258
+
259
+ @include e(prefix) {
260
+ gap: map.get($select-item-gap, $size);
261
+ }
262
+
263
+ @include e(suffix) {
264
+ gap: map.get($select-item-gap, $size);
265
+ }
266
+
267
+ @include e(input) {
268
+ height: map.get($select-item-height, $size);
269
+ }
270
+ }
271
+ }
272
+ }