@douyinfe/semi-foundation 2.3.1 → 2.4.0-beta.0
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.
- package/input/textarea.scss +11 -7
- package/inputNumber/constants.ts +1 -0
- package/inputNumber/foundation.ts +15 -1
- package/lib/cjs/input/textarea.css +12 -9
- package/lib/cjs/input/textarea.scss +11 -7
- package/lib/cjs/inputNumber/constants.d.ts +1 -0
- package/lib/cjs/inputNumber/constants.js +2 -1
- package/lib/cjs/inputNumber/foundation.d.ts +5 -0
- package/lib/cjs/inputNumber/foundation.js +19 -0
- package/lib/cjs/table/table.css +3 -0
- package/lib/cjs/table/table.scss +4 -0
- package/lib/cjs/timePicker/foundation.d.ts +2 -1
- package/lib/cjs/timePicker/foundation.js +7 -1
- package/lib/es/input/textarea.css +12 -9
- package/lib/es/input/textarea.scss +11 -7
- package/lib/es/inputNumber/constants.d.ts +1 -0
- package/lib/es/inputNumber/constants.js +2 -1
- package/lib/es/inputNumber/foundation.d.ts +5 -0
- package/lib/es/inputNumber/foundation.js +18 -0
- package/lib/es/table/table.css +3 -0
- package/lib/es/table/table.scss +4 -0
- package/lib/es/timePicker/foundation.d.ts +2 -1
- package/lib/es/timePicker/foundation.js +7 -1
- package/package.json +3 -3
- package/table/table.scss +4 -0
- package/timePicker/foundation.ts +8 -3
package/input/textarea.scss
CHANGED
|
@@ -55,11 +55,7 @@ $module: #{$prefix}-input;
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
&-readonly {
|
|
59
|
-
cursor: default;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&-disabled {
|
|
58
|
+
&-disabled, &-readonly {
|
|
63
59
|
cursor: not-allowed;
|
|
64
60
|
// border: $border-thickness-control $color-input_disabled-border-default solid;
|
|
65
61
|
color: $color-input_disabled-text-default;
|
|
@@ -74,6 +70,10 @@ $module: #{$prefix}-input;
|
|
|
74
70
|
}
|
|
75
71
|
}
|
|
76
72
|
|
|
73
|
+
&-readonly {
|
|
74
|
+
cursor: text;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
77
|
&-error {
|
|
78
78
|
background-color: $color-input_danger-bg-default;
|
|
79
79
|
border-color: $color-input_danger-border-default;
|
|
@@ -151,7 +151,7 @@ $module: #{$prefix}-input;
|
|
|
151
151
|
padding-right: $spacing-textarea_withShowClear-paddingRight;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
&-disabled {
|
|
154
|
+
&-disabled, &-readonly {
|
|
155
155
|
cursor: not-allowed;
|
|
156
156
|
color: $color-input_disabled-text-default;
|
|
157
157
|
background-color: transparent;
|
|
@@ -165,10 +165,14 @@ $module: #{$prefix}-input;
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
&-readonly {
|
|
169
|
+
cursor: text;
|
|
170
|
+
}
|
|
171
|
+
|
|
168
172
|
&-autosize {
|
|
169
173
|
overflow: hidden;
|
|
170
174
|
}
|
|
171
|
-
|
|
175
|
+
|
|
172
176
|
&-counter {
|
|
173
177
|
@include font-size-small;
|
|
174
178
|
display: flex;
|
package/inputNumber/constants.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import BaseFoundation, { DefaultAdapter } from '../base/foundation';
|
|
5
5
|
import keyCode from '../utils/keyCode';
|
|
6
6
|
import { numbers } from './constants';
|
|
7
|
-
import { toNumber, toString } from 'lodash';
|
|
7
|
+
import { toNumber, toString, get } from 'lodash';
|
|
8
8
|
import { minus as numberMinus } from '../utils/number';
|
|
9
9
|
|
|
10
10
|
export interface InputNumberAdapter extends DefaultAdapter {
|
|
@@ -286,6 +286,9 @@ class InputNumberFoundation extends BaseFoundation<InputNumberAdapter> {
|
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
handleUpClick(event: any) {
|
|
289
|
+
if (!this._isMouseButtonLeft(event)) {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
289
292
|
this._adapter.setClickUpOrDown(true);
|
|
290
293
|
if (event) {
|
|
291
294
|
event.persist();
|
|
@@ -303,6 +306,9 @@ class InputNumberFoundation extends BaseFoundation<InputNumberAdapter> {
|
|
|
303
306
|
}
|
|
304
307
|
|
|
305
308
|
handleDownClick(event: any) {
|
|
309
|
+
if (!this._isMouseButtonLeft(event)) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
306
312
|
this._adapter.setClickUpOrDown(true);
|
|
307
313
|
if (event) {
|
|
308
314
|
event.persist();
|
|
@@ -317,6 +323,14 @@ class InputNumberFoundation extends BaseFoundation<InputNumberAdapter> {
|
|
|
317
323
|
});
|
|
318
324
|
}
|
|
319
325
|
|
|
326
|
+
/**
|
|
327
|
+
* Whether it is a left mouse button click
|
|
328
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
|
|
329
|
+
*/
|
|
330
|
+
_isMouseButtonLeft(event: any) {
|
|
331
|
+
return get(event, 'button') === numbers.MOUSE_BUTTON_LEFT;
|
|
332
|
+
}
|
|
333
|
+
|
|
320
334
|
_preventDefault(event: any) {
|
|
321
335
|
const keepFocus = this._adapter.getProp('keepFocus');
|
|
322
336
|
if (keepFocus) {
|
|
@@ -44,20 +44,20 @@
|
|
|
44
44
|
.semi-input-textarea-wrapper .semi-input-clearbtn-hidden {
|
|
45
45
|
visibility: hidden;
|
|
46
46
|
}
|
|
47
|
-
.semi-input-textarea-wrapper-readonly {
|
|
48
|
-
cursor: default;
|
|
49
|
-
}
|
|
50
|
-
.semi-input-textarea-wrapper-disabled {
|
|
47
|
+
.semi-input-textarea-wrapper-disabled, .semi-input-textarea-wrapper-readonly {
|
|
51
48
|
cursor: not-allowed;
|
|
52
49
|
color: var(--semi-color-disabled-text);
|
|
53
50
|
background-color: var(--semi-color-disabled-fill);
|
|
54
51
|
}
|
|
55
|
-
.semi-input-textarea-wrapper-disabled:hover {
|
|
52
|
+
.semi-input-textarea-wrapper-disabled:hover, .semi-input-textarea-wrapper-readonly:hover {
|
|
56
53
|
background-color: var(--semi-color-disabled-fill);
|
|
57
54
|
}
|
|
58
|
-
.semi-input-textarea-wrapper-disabled::placeholder {
|
|
55
|
+
.semi-input-textarea-wrapper-disabled::placeholder, .semi-input-textarea-wrapper-readonly::placeholder {
|
|
59
56
|
color: var(--semi-color-disabled-text);
|
|
60
57
|
}
|
|
58
|
+
.semi-input-textarea-wrapper-readonly {
|
|
59
|
+
cursor: text;
|
|
60
|
+
}
|
|
61
61
|
.semi-input-textarea-wrapper-error {
|
|
62
62
|
background-color: var(--semi-color-danger-light-default);
|
|
63
63
|
border-color: var(--semi-color-danger-light-default);
|
|
@@ -114,17 +114,20 @@
|
|
|
114
114
|
.semi-input-textarea-showClear {
|
|
115
115
|
padding-right: 36px;
|
|
116
116
|
}
|
|
117
|
-
.semi-input-textarea-disabled {
|
|
117
|
+
.semi-input-textarea-disabled, .semi-input-textarea-readonly {
|
|
118
118
|
cursor: not-allowed;
|
|
119
119
|
color: var(--semi-color-disabled-text);
|
|
120
120
|
background-color: transparent;
|
|
121
121
|
}
|
|
122
|
-
.semi-input-textarea-disabled:hover {
|
|
122
|
+
.semi-input-textarea-disabled:hover, .semi-input-textarea-readonly:hover {
|
|
123
123
|
background-color: transparent;
|
|
124
124
|
}
|
|
125
|
-
.semi-input-textarea-disabled::placeholder {
|
|
125
|
+
.semi-input-textarea-disabled::placeholder, .semi-input-textarea-readonly::placeholder {
|
|
126
126
|
color: var(--semi-color-disabled-text);
|
|
127
127
|
}
|
|
128
|
+
.semi-input-textarea-readonly {
|
|
129
|
+
cursor: text;
|
|
130
|
+
}
|
|
128
131
|
.semi-input-textarea-autosize {
|
|
129
132
|
overflow: hidden;
|
|
130
133
|
}
|
|
@@ -55,11 +55,7 @@ $module: #{$prefix}-input;
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
&-readonly {
|
|
59
|
-
cursor: default;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&-disabled {
|
|
58
|
+
&-disabled, &-readonly {
|
|
63
59
|
cursor: not-allowed;
|
|
64
60
|
// border: $border-thickness-control $color-input_disabled-border-default solid;
|
|
65
61
|
color: $color-input_disabled-text-default;
|
|
@@ -74,6 +70,10 @@ $module: #{$prefix}-input;
|
|
|
74
70
|
}
|
|
75
71
|
}
|
|
76
72
|
|
|
73
|
+
&-readonly {
|
|
74
|
+
cursor: text;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
77
|
&-error {
|
|
78
78
|
background-color: $color-input_danger-bg-default;
|
|
79
79
|
border-color: $color-input_danger-border-default;
|
|
@@ -151,7 +151,7 @@ $module: #{$prefix}-input;
|
|
|
151
151
|
padding-right: $spacing-textarea_withShowClear-paddingRight;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
&-disabled {
|
|
154
|
+
&-disabled, &-readonly {
|
|
155
155
|
cursor: not-allowed;
|
|
156
156
|
color: $color-input_disabled-text-default;
|
|
157
157
|
background-color: transparent;
|
|
@@ -165,10 +165,14 @@ $module: #{$prefix}-input;
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
&-readonly {
|
|
169
|
+
cursor: text;
|
|
170
|
+
}
|
|
171
|
+
|
|
168
172
|
&-autosize {
|
|
169
173
|
overflow: hidden;
|
|
170
174
|
}
|
|
171
|
-
|
|
175
|
+
|
|
172
176
|
&-counter {
|
|
173
177
|
@include font-size-small;
|
|
174
178
|
display: flex;
|
|
@@ -20,7 +20,8 @@ const numbers = (0, _assign.default)((0, _assign.default)({}, _constants.numbers
|
|
|
20
20
|
DEFAULT_STEP: 1,
|
|
21
21
|
DEFAULT_SHIFT_STEP: 1,
|
|
22
22
|
DEFAULT_PRESS_TIMEOUT: 250,
|
|
23
|
-
DEFAULT_PRESS_INTERVAL: 0
|
|
23
|
+
DEFAULT_PRESS_INTERVAL: 0,
|
|
24
|
+
MOUSE_BUTTON_LEFT: 0
|
|
24
25
|
});
|
|
25
26
|
exports.numbers = numbers;
|
|
26
27
|
const strings = (0, _assign.default)({}, _constants.strings);
|
|
@@ -47,6 +47,11 @@ declare class InputNumberFoundation extends BaseFoundation<InputNumberAdapter> {
|
|
|
47
47
|
handleMouseUp(e?: any): void;
|
|
48
48
|
handleUpClick(event: any): void;
|
|
49
49
|
handleDownClick(event: any): void;
|
|
50
|
+
/**
|
|
51
|
+
* Whether it is a left mouse button click
|
|
52
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
|
|
53
|
+
*/
|
|
54
|
+
_isMouseButtonLeft(event: any): boolean;
|
|
50
55
|
_preventDefault(event: any): void;
|
|
51
56
|
handleMouseLeave(event: any): void;
|
|
52
57
|
upClick(event: any): void;
|
|
@@ -22,6 +22,8 @@ var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
|
|
|
22
22
|
|
|
23
23
|
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
24
24
|
|
|
25
|
+
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
26
|
+
|
|
25
27
|
var _toString2 = _interopRequireDefault(require("lodash/toString"));
|
|
26
28
|
|
|
27
29
|
var _toNumber2 = _interopRequireDefault(require("lodash/toNumber"));
|
|
@@ -315,6 +317,10 @@ class InputNumberFoundation extends _foundation.default {
|
|
|
315
317
|
}
|
|
316
318
|
|
|
317
319
|
handleUpClick(event) {
|
|
320
|
+
if (!this._isMouseButtonLeft(event)) {
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
|
|
318
324
|
this._adapter.setClickUpOrDown(true);
|
|
319
325
|
|
|
320
326
|
if (event) {
|
|
@@ -334,6 +340,10 @@ class InputNumberFoundation extends _foundation.default {
|
|
|
334
340
|
}
|
|
335
341
|
|
|
336
342
|
handleDownClick(event) {
|
|
343
|
+
if (!this._isMouseButtonLeft(event)) {
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
|
|
337
347
|
this._adapter.setClickUpOrDown(true);
|
|
338
348
|
|
|
339
349
|
if (event) {
|
|
@@ -351,6 +361,15 @@ class InputNumberFoundation extends _foundation.default {
|
|
|
351
361
|
});
|
|
352
362
|
});
|
|
353
363
|
}
|
|
364
|
+
/**
|
|
365
|
+
* Whether it is a left mouse button click
|
|
366
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
|
|
367
|
+
*/
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
_isMouseButtonLeft(event) {
|
|
371
|
+
return (0, _get2.default)(event, 'button') === _constants.numbers.MOUSE_BUTTON_LEFT;
|
|
372
|
+
}
|
|
354
373
|
|
|
355
374
|
_preventDefault(event) {
|
|
356
375
|
const keepFocus = this._adapter.getProp('keepFocus');
|
package/lib/cjs/table/table.css
CHANGED
package/lib/cjs/table/table.scss
CHANGED
|
@@ -6,7 +6,8 @@ export interface TimePickerAdapter<P = Record<string, any>, S = Record<string, a
|
|
|
6
6
|
setInputValue: (inputValue: string, cb?: () => void) => void;
|
|
7
7
|
unregisterClickOutSide: () => void;
|
|
8
8
|
notifyOpenChange: (open: boolean) => void;
|
|
9
|
-
notifyChange
|
|
9
|
+
notifyChange(value: Date | Date[], input: string | string[]): void;
|
|
10
|
+
notifyChange(input: string | string[], value: Date | Date[]): void;
|
|
10
11
|
notifyFocus: (e: any) => void;
|
|
11
12
|
notifyBlur: (e: any) => void;
|
|
12
13
|
isRangePicker: () => boolean;
|
|
@@ -440,7 +440,13 @@ class TimePickerFoundation extends _foundation.default {
|
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
442
|
|
|
443
|
-
this.
|
|
443
|
+
const onChangeWithDateFirst = this.getProp('onChangeWithDateFirst');
|
|
444
|
+
|
|
445
|
+
if (onChangeWithDateFirst) {
|
|
446
|
+
this._adapter.notifyChange(_value, str);
|
|
447
|
+
} else {
|
|
448
|
+
this._adapter.notifyChange(str, _value);
|
|
449
|
+
}
|
|
444
450
|
}
|
|
445
451
|
|
|
446
452
|
_hasChanged() {
|
|
@@ -44,20 +44,20 @@
|
|
|
44
44
|
.semi-input-textarea-wrapper .semi-input-clearbtn-hidden {
|
|
45
45
|
visibility: hidden;
|
|
46
46
|
}
|
|
47
|
-
.semi-input-textarea-wrapper-readonly {
|
|
48
|
-
cursor: default;
|
|
49
|
-
}
|
|
50
|
-
.semi-input-textarea-wrapper-disabled {
|
|
47
|
+
.semi-input-textarea-wrapper-disabled, .semi-input-textarea-wrapper-readonly {
|
|
51
48
|
cursor: not-allowed;
|
|
52
49
|
color: var(--semi-color-disabled-text);
|
|
53
50
|
background-color: var(--semi-color-disabled-fill);
|
|
54
51
|
}
|
|
55
|
-
.semi-input-textarea-wrapper-disabled:hover {
|
|
52
|
+
.semi-input-textarea-wrapper-disabled:hover, .semi-input-textarea-wrapper-readonly:hover {
|
|
56
53
|
background-color: var(--semi-color-disabled-fill);
|
|
57
54
|
}
|
|
58
|
-
.semi-input-textarea-wrapper-disabled::placeholder {
|
|
55
|
+
.semi-input-textarea-wrapper-disabled::placeholder, .semi-input-textarea-wrapper-readonly::placeholder {
|
|
59
56
|
color: var(--semi-color-disabled-text);
|
|
60
57
|
}
|
|
58
|
+
.semi-input-textarea-wrapper-readonly {
|
|
59
|
+
cursor: text;
|
|
60
|
+
}
|
|
61
61
|
.semi-input-textarea-wrapper-error {
|
|
62
62
|
background-color: var(--semi-color-danger-light-default);
|
|
63
63
|
border-color: var(--semi-color-danger-light-default);
|
|
@@ -114,17 +114,20 @@
|
|
|
114
114
|
.semi-input-textarea-showClear {
|
|
115
115
|
padding-right: 36px;
|
|
116
116
|
}
|
|
117
|
-
.semi-input-textarea-disabled {
|
|
117
|
+
.semi-input-textarea-disabled, .semi-input-textarea-readonly {
|
|
118
118
|
cursor: not-allowed;
|
|
119
119
|
color: var(--semi-color-disabled-text);
|
|
120
120
|
background-color: transparent;
|
|
121
121
|
}
|
|
122
|
-
.semi-input-textarea-disabled:hover {
|
|
122
|
+
.semi-input-textarea-disabled:hover, .semi-input-textarea-readonly:hover {
|
|
123
123
|
background-color: transparent;
|
|
124
124
|
}
|
|
125
|
-
.semi-input-textarea-disabled::placeholder {
|
|
125
|
+
.semi-input-textarea-disabled::placeholder, .semi-input-textarea-readonly::placeholder {
|
|
126
126
|
color: var(--semi-color-disabled-text);
|
|
127
127
|
}
|
|
128
|
+
.semi-input-textarea-readonly {
|
|
129
|
+
cursor: text;
|
|
130
|
+
}
|
|
128
131
|
.semi-input-textarea-autosize {
|
|
129
132
|
overflow: hidden;
|
|
130
133
|
}
|
|
@@ -55,11 +55,7 @@ $module: #{$prefix}-input;
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
&-readonly {
|
|
59
|
-
cursor: default;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&-disabled {
|
|
58
|
+
&-disabled, &-readonly {
|
|
63
59
|
cursor: not-allowed;
|
|
64
60
|
// border: $border-thickness-control $color-input_disabled-border-default solid;
|
|
65
61
|
color: $color-input_disabled-text-default;
|
|
@@ -74,6 +70,10 @@ $module: #{$prefix}-input;
|
|
|
74
70
|
}
|
|
75
71
|
}
|
|
76
72
|
|
|
73
|
+
&-readonly {
|
|
74
|
+
cursor: text;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
77
|
&-error {
|
|
78
78
|
background-color: $color-input_danger-bg-default;
|
|
79
79
|
border-color: $color-input_danger-border-default;
|
|
@@ -151,7 +151,7 @@ $module: #{$prefix}-input;
|
|
|
151
151
|
padding-right: $spacing-textarea_withShowClear-paddingRight;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
&-disabled {
|
|
154
|
+
&-disabled, &-readonly {
|
|
155
155
|
cursor: not-allowed;
|
|
156
156
|
color: $color-input_disabled-text-default;
|
|
157
157
|
background-color: transparent;
|
|
@@ -165,10 +165,14 @@ $module: #{$prefix}-input;
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
&-readonly {
|
|
169
|
+
cursor: text;
|
|
170
|
+
}
|
|
171
|
+
|
|
168
172
|
&-autosize {
|
|
169
173
|
overflow: hidden;
|
|
170
174
|
}
|
|
171
|
-
|
|
175
|
+
|
|
172
176
|
&-counter {
|
|
173
177
|
@include font-size-small;
|
|
174
178
|
display: flex;
|
|
@@ -7,7 +7,8 @@ const numbers = _Object$assign(_Object$assign({}, inputNumbers), {
|
|
|
7
7
|
DEFAULT_STEP: 1,
|
|
8
8
|
DEFAULT_SHIFT_STEP: 1,
|
|
9
9
|
DEFAULT_PRESS_TIMEOUT: 250,
|
|
10
|
-
DEFAULT_PRESS_INTERVAL: 0
|
|
10
|
+
DEFAULT_PRESS_INTERVAL: 0,
|
|
11
|
+
MOUSE_BUTTON_LEFT: 0
|
|
11
12
|
});
|
|
12
13
|
|
|
13
14
|
const strings = _Object$assign({}, inputStrings);
|
|
@@ -47,6 +47,11 @@ declare class InputNumberFoundation extends BaseFoundation<InputNumberAdapter> {
|
|
|
47
47
|
handleMouseUp(e?: any): void;
|
|
48
48
|
handleUpClick(event: any): void;
|
|
49
49
|
handleDownClick(event: any): void;
|
|
50
|
+
/**
|
|
51
|
+
* Whether it is a left mouse button click
|
|
52
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
|
|
53
|
+
*/
|
|
54
|
+
_isMouseButtonLeft(event: any): boolean;
|
|
50
55
|
_preventDefault(event: any): void;
|
|
51
56
|
handleMouseLeave(event: any): void;
|
|
52
57
|
upClick(event: any): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _get from "lodash/get";
|
|
1
2
|
import _toString from "lodash/toString";
|
|
2
3
|
import _toNumber from "lodash/toNumber";
|
|
3
4
|
import _setInterval from "@babel/runtime-corejs3/core-js-stable/set-interval";
|
|
@@ -293,6 +294,10 @@ class InputNumberFoundation extends BaseFoundation {
|
|
|
293
294
|
}
|
|
294
295
|
|
|
295
296
|
handleUpClick(event) {
|
|
297
|
+
if (!this._isMouseButtonLeft(event)) {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
|
|
296
301
|
this._adapter.setClickUpOrDown(true);
|
|
297
302
|
|
|
298
303
|
if (event) {
|
|
@@ -312,6 +317,10 @@ class InputNumberFoundation extends BaseFoundation {
|
|
|
312
317
|
}
|
|
313
318
|
|
|
314
319
|
handleDownClick(event) {
|
|
320
|
+
if (!this._isMouseButtonLeft(event)) {
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
|
|
315
324
|
this._adapter.setClickUpOrDown(true);
|
|
316
325
|
|
|
317
326
|
if (event) {
|
|
@@ -329,6 +338,15 @@ class InputNumberFoundation extends BaseFoundation {
|
|
|
329
338
|
});
|
|
330
339
|
});
|
|
331
340
|
}
|
|
341
|
+
/**
|
|
342
|
+
* Whether it is a left mouse button click
|
|
343
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
|
|
344
|
+
*/
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
_isMouseButtonLeft(event) {
|
|
348
|
+
return _get(event, 'button') === numbers.MOUSE_BUTTON_LEFT;
|
|
349
|
+
}
|
|
332
350
|
|
|
333
351
|
_preventDefault(event) {
|
|
334
352
|
const keepFocus = this._adapter.getProp('keepFocus');
|
package/lib/es/table/table.css
CHANGED
package/lib/es/table/table.scss
CHANGED
|
@@ -6,7 +6,8 @@ export interface TimePickerAdapter<P = Record<string, any>, S = Record<string, a
|
|
|
6
6
|
setInputValue: (inputValue: string, cb?: () => void) => void;
|
|
7
7
|
unregisterClickOutSide: () => void;
|
|
8
8
|
notifyOpenChange: (open: boolean) => void;
|
|
9
|
-
notifyChange
|
|
9
|
+
notifyChange(value: Date | Date[], input: string | string[]): void;
|
|
10
|
+
notifyChange(input: string | string[], value: Date | Date[]): void;
|
|
10
11
|
notifyFocus: (e: any) => void;
|
|
11
12
|
notifyBlur: (e: any) => void;
|
|
12
13
|
isRangePicker: () => boolean;
|
|
@@ -418,7 +418,13 @@ class TimePickerFoundation extends BaseFoundation {
|
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
|
|
421
|
-
this.
|
|
421
|
+
const onChangeWithDateFirst = this.getProp('onChangeWithDateFirst');
|
|
422
|
+
|
|
423
|
+
if (onChangeWithDateFirst) {
|
|
424
|
+
this._adapter.notifyChange(_value, str);
|
|
425
|
+
} else {
|
|
426
|
+
this._adapter.notifyChange(str, _value);
|
|
427
|
+
}
|
|
422
428
|
}
|
|
423
429
|
|
|
424
430
|
_hasChanged() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-foundation",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0-beta.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build:lib": "node ./scripts/compileLib.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@babel/runtime-corejs3": "^7.15.4",
|
|
11
|
-
"@douyinfe/semi-animation": "2.
|
|
11
|
+
"@douyinfe/semi-animation": "2.4.0-beta.0",
|
|
12
12
|
"async-validator": "^3.5.0",
|
|
13
13
|
"classnames": "^2.2.6",
|
|
14
14
|
"date-fns": "^2.9.0",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"*.scss",
|
|
25
25
|
"*.css"
|
|
26
26
|
],
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "ebf8a78f5152f9733af771cd567f042eccb8c4b9",
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
30
30
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
package/table/table.scss
CHANGED
package/timePicker/foundation.ts
CHANGED
|
@@ -37,7 +37,8 @@ export interface TimePickerAdapter<P = Record<string, any>, S = Record<string, a
|
|
|
37
37
|
setInputValue: (inputValue: string, cb?: () => void) => void;
|
|
38
38
|
unregisterClickOutSide: () => void;
|
|
39
39
|
notifyOpenChange: (open: boolean) => void;
|
|
40
|
-
notifyChange
|
|
40
|
+
notifyChange(value: Date | Date[], input: string | string[]): void;
|
|
41
|
+
notifyChange(input: string | string[], value: Date | Date[]): void;
|
|
41
42
|
notifyFocus: (e: any) => void;
|
|
42
43
|
notifyBlur: (e: any) => void;
|
|
43
44
|
isRangePicker: () => boolean;
|
|
@@ -413,8 +414,12 @@ class TimePickerFoundation<P = Record<string, any>, S = Record<string, any>> ext
|
|
|
413
414
|
str = format(_value, formatToken);
|
|
414
415
|
}
|
|
415
416
|
}
|
|
416
|
-
|
|
417
|
-
|
|
417
|
+
const onChangeWithDateFirst = this.getProp('onChangeWithDateFirst');
|
|
418
|
+
if (onChangeWithDateFirst) {
|
|
419
|
+
this._adapter.notifyChange(_value, str);
|
|
420
|
+
} else {
|
|
421
|
+
this._adapter.notifyChange(str, _value);
|
|
422
|
+
}
|
|
418
423
|
}
|
|
419
424
|
|
|
420
425
|
_hasChanged(dates: Date[] = [], oldDates: Date[] = []) {
|