@douyinfe/semi-ui 2.14.0 → 2.15.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/autoComplete/index.tsx +0 -1
- package/cascader/__test__/cascader.test.js +13 -10
- package/cascader/_story/cascader.stories.js +22 -0
- package/cascader/index.tsx +53 -35
- package/checkbox/checkbox.tsx +1 -0
- package/checkbox/checkboxInner.tsx +4 -1
- package/datePicker/datePicker.tsx +7 -5
- package/dist/css/semi.css +34 -6
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +1089 -329
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/dropdown/context.ts +2 -0
- package/dropdown/dropdownItem.tsx +2 -1
- package/dropdown/dropdownMenu.tsx +24 -1
- package/dropdown/index.tsx +10 -2
- package/form/_story/form.stories.tsx +23 -15
- package/form/hoc/withField.tsx +1 -1
- package/form/interface.ts +1 -1
- package/input/__test__/input.test.js +31 -0
- package/input/_story/input.stories.js +24 -1
- package/input/index.tsx +5 -2
- package/input/inputGroup.tsx +7 -6
- package/inputNumber/index.tsx +5 -3
- package/lib/cjs/autoComplete/index.d.ts +0 -1
- package/lib/cjs/autoComplete/index.js +0 -1
- package/lib/cjs/cascader/index.d.ts +1 -1
- package/lib/cjs/cascader/index.js +36 -9
- package/lib/cjs/checkbox/checkbox.d.ts +1 -0
- package/lib/cjs/checkbox/checkbox.js +2 -1
- package/lib/cjs/checkbox/checkboxInner.d.ts +2 -0
- package/lib/cjs/checkbox/checkboxInner.js +8 -2
- package/lib/cjs/datePicker/datePicker.d.ts +1 -1
- package/lib/cjs/datePicker/datePicker.js +21 -6
- package/lib/cjs/dropdown/context.d.ts +2 -0
- package/lib/cjs/dropdown/dropdownItem.js +3 -1
- package/lib/cjs/dropdown/dropdownMenu.d.ts +18 -1
- package/lib/cjs/dropdown/dropdownMenu.js +23 -2
- package/lib/cjs/dropdown/index.d.ts +4 -0
- package/lib/cjs/dropdown/index.js +13 -5
- package/lib/cjs/form/baseForm.d.ts +16 -15
- package/lib/cjs/form/field.d.ts +16 -15
- package/lib/cjs/form/hoc/withField.d.ts +1 -1
- package/lib/cjs/form/interface.d.ts +1 -1
- package/lib/cjs/input/index.d.ts +2 -1
- package/lib/cjs/input/index.js +11 -5
- package/lib/cjs/input/inputGroup.js +16 -9
- package/lib/cjs/inputNumber/index.d.ts +1 -0
- package/lib/cjs/inputNumber/index.js +8 -3
- package/lib/cjs/locale/source/de.d.ts +3 -0
- package/lib/cjs/locale/source/de.js +165 -0
- package/lib/cjs/locale/source/fr.d.ts +3 -0
- package/lib/cjs/locale/source/fr.js +165 -0
- package/lib/cjs/locale/source/it.d.ts +3 -0
- package/lib/cjs/locale/source/it.js +165 -0
- package/lib/cjs/modal/ModalContent.d.ts +1 -0
- package/lib/cjs/modal/ModalContent.js +17 -4
- package/lib/cjs/modal/confirm.d.ts +5 -0
- package/lib/cjs/radio/radio.d.ts +2 -0
- package/lib/cjs/radio/radio.js +2 -1
- package/lib/cjs/radio/radioInner.d.ts +2 -0
- package/lib/cjs/radio/radioInner.js +8 -2
- package/lib/cjs/rating/index.d.ts +7 -0
- package/lib/cjs/rating/index.js +135 -68
- package/lib/cjs/rating/item.d.ts +27 -3
- package/lib/cjs/rating/item.js +145 -38
- package/lib/cjs/select/index.d.ts +2 -0
- package/lib/cjs/select/index.js +15 -3
- package/lib/cjs/table/Body/index.js +1 -1
- package/lib/cjs/tabs/index.d.ts +1 -0
- package/lib/cjs/tabs/index.js +2 -1
- package/lib/cjs/tabs/interface.d.ts +1 -0
- package/lib/cjs/tag/index.js +4 -5
- package/lib/cjs/tag/interface.d.ts +1 -0
- package/lib/cjs/tagInput/index.d.ts +2 -0
- package/lib/cjs/tagInput/index.js +19 -5
- package/lib/cjs/timePicker/TimeInput.d.ts +2 -1
- package/lib/cjs/timePicker/TimeInput.js +7 -3
- package/lib/cjs/timePicker/TimePicker.d.ts +2 -0
- package/lib/cjs/timePicker/TimePicker.js +2 -1
- package/lib/cjs/timePicker/index.d.ts +1 -0
- package/lib/cjs/tooltip/index.d.ts +2 -0
- package/lib/cjs/tooltip/index.js +12 -4
- package/lib/cjs/tree/index.d.ts +1 -0
- package/lib/cjs/tree/index.js +9 -2
- package/lib/cjs/tree/treeNode.js +12 -18
- package/lib/cjs/treeSelect/index.js +8 -1
- package/lib/es/autoComplete/index.d.ts +0 -1
- package/lib/es/autoComplete/index.js +0 -1
- package/lib/es/cascader/index.d.ts +1 -1
- package/lib/es/cascader/index.js +36 -9
- package/lib/es/checkbox/checkbox.d.ts +1 -0
- package/lib/es/checkbox/checkbox.js +2 -1
- package/lib/es/checkbox/checkboxInner.d.ts +2 -0
- package/lib/es/checkbox/checkboxInner.js +8 -2
- package/lib/es/datePicker/datePicker.d.ts +1 -1
- package/lib/es/datePicker/datePicker.js +21 -6
- package/lib/es/dropdown/context.d.ts +2 -0
- package/lib/es/dropdown/dropdownItem.js +3 -1
- package/lib/es/dropdown/dropdownMenu.d.ts +18 -1
- package/lib/es/dropdown/dropdownMenu.js +21 -2
- package/lib/es/dropdown/index.d.ts +4 -0
- package/lib/es/dropdown/index.js +13 -5
- package/lib/es/form/baseForm.d.ts +16 -15
- package/lib/es/form/field.d.ts +16 -15
- package/lib/es/form/hoc/withField.d.ts +1 -1
- package/lib/es/form/interface.d.ts +1 -1
- package/lib/es/input/index.d.ts +2 -1
- package/lib/es/input/index.js +11 -5
- package/lib/es/input/inputGroup.js +15 -9
- package/lib/es/inputNumber/index.d.ts +1 -0
- package/lib/es/inputNumber/index.js +8 -3
- package/lib/es/locale/source/de.d.ts +3 -0
- package/lib/es/locale/source/de.js +153 -0
- package/lib/es/locale/source/fr.d.ts +3 -0
- package/lib/es/locale/source/fr.js +153 -0
- package/lib/es/locale/source/it.d.ts +3 -0
- package/lib/es/locale/source/it.js +153 -0
- package/lib/es/modal/ModalContent.d.ts +1 -0
- package/lib/es/modal/ModalContent.js +17 -4
- package/lib/es/modal/confirm.d.ts +5 -0
- package/lib/es/radio/radio.d.ts +2 -0
- package/lib/es/radio/radio.js +2 -1
- package/lib/es/radio/radioInner.d.ts +2 -0
- package/lib/es/radio/radioInner.js +8 -2
- package/lib/es/rating/index.d.ts +7 -0
- package/lib/es/rating/index.js +133 -65
- package/lib/es/rating/item.d.ts +27 -3
- package/lib/es/rating/item.js +145 -32
- package/lib/es/select/index.d.ts +2 -0
- package/lib/es/select/index.js +15 -3
- package/lib/es/table/Body/index.js +1 -1
- package/lib/es/tabs/index.d.ts +1 -0
- package/lib/es/tabs/index.js +2 -1
- package/lib/es/tabs/interface.d.ts +1 -0
- package/lib/es/tag/index.js +4 -5
- package/lib/es/tag/interface.d.ts +1 -0
- package/lib/es/tagInput/index.d.ts +2 -0
- package/lib/es/tagInput/index.js +19 -5
- package/lib/es/timePicker/TimeInput.d.ts +2 -1
- package/lib/es/timePicker/TimeInput.js +7 -3
- package/lib/es/timePicker/TimePicker.d.ts +2 -0
- package/lib/es/timePicker/TimePicker.js +2 -1
- package/lib/es/timePicker/index.d.ts +1 -0
- package/lib/es/tooltip/index.d.ts +2 -0
- package/lib/es/tooltip/index.js +13 -4
- package/lib/es/tree/index.d.ts +1 -0
- package/lib/es/tree/index.js +9 -2
- package/lib/es/tree/treeNode.js +11 -19
- package/lib/es/treeSelect/index.js +8 -1
- package/locale/source/de.ts +156 -0
- package/locale/source/fr.ts +156 -0
- package/locale/source/it.ts +156 -0
- package/modal/ModalContent.tsx +7 -4
- package/package.json +8 -8
- package/radio/radio.tsx +2 -0
- package/radio/radioInner.tsx +4 -1
- package/rating/__test__/rating.test.js +13 -31
- package/rating/_story/rating.stories.js +13 -2
- package/rating/index.tsx +63 -18
- package/rating/item.tsx +141 -26
- package/select/index.tsx +6 -2
- package/table/Body/index.tsx +1 -1
- package/table/_story/v2/FixedVirtualizedEmpty.tsx +76 -0
- package/table/_story/v2/index.js +2 -1
- package/tabs/index.tsx +1 -0
- package/tabs/interface.ts +1 -0
- package/tag/index.tsx +2 -3
- package/tag/interface.ts +1 -0
- package/tagInput/index.tsx +8 -4
- package/timePicker/TimeInput.tsx +5 -3
- package/timePicker/TimePicker.tsx +2 -0
- package/tooltip/index.tsx +7 -2
- package/tree/index.tsx +3 -1
- package/tree/treeNode.tsx +9 -12
- package/treeSelect/index.tsx +4 -1
- package/upload/_story/upload.stories.tsx +9 -6
package/lib/es/tag/index.js
CHANGED
|
@@ -17,10 +17,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
17
17
|
};
|
|
18
18
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
19
19
|
|
|
20
|
-
/* eslint-disable no-unused-vars */
|
|
21
|
-
|
|
22
|
-
/* eslint-disable max-len */
|
|
23
|
-
|
|
24
20
|
|
|
25
21
|
import React, { Component } from 'react';
|
|
26
22
|
import classNames from 'classnames';
|
|
@@ -85,7 +81,8 @@ export default class Tag extends Component {
|
|
|
85
81
|
handleKeyDown(event) {
|
|
86
82
|
const {
|
|
87
83
|
closable,
|
|
88
|
-
onClick
|
|
84
|
+
onClick,
|
|
85
|
+
onKeyDown
|
|
89
86
|
} = this.props;
|
|
90
87
|
|
|
91
88
|
switch (event.key) {
|
|
@@ -107,6 +104,8 @@ export default class Tag extends Component {
|
|
|
107
104
|
default:
|
|
108
105
|
break;
|
|
109
106
|
}
|
|
107
|
+
|
|
108
|
+
onKeyDown && onKeyDown(event);
|
|
110
109
|
}
|
|
111
110
|
|
|
112
111
|
renderAvatar() {
|
|
@@ -45,6 +45,7 @@ export interface TagInputProps {
|
|
|
45
45
|
value?: string[] | undefined;
|
|
46
46
|
autoFocus?: boolean;
|
|
47
47
|
'aria-label'?: string;
|
|
48
|
+
preventScroll?: boolean;
|
|
48
49
|
}
|
|
49
50
|
export interface TagInputState {
|
|
50
51
|
tagsArray?: string[];
|
|
@@ -88,6 +89,7 @@ declare class TagInput extends BaseComponent<TagInputProps, TagInputState> {
|
|
|
88
89
|
prefix: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
89
90
|
suffix: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
90
91
|
'aria-label': PropTypes.Requireable<string>;
|
|
92
|
+
preventScroll: PropTypes.Requireable<boolean>;
|
|
91
93
|
};
|
|
92
94
|
static defaultProps: {
|
|
93
95
|
showClear: boolean;
|
package/lib/es/tagInput/index.js
CHANGED
|
@@ -124,10 +124,15 @@ class TagInput extends BaseComponent {
|
|
|
124
124
|
});
|
|
125
125
|
},
|
|
126
126
|
toggleFocusing: isFocus => {
|
|
127
|
+
const {
|
|
128
|
+
preventScroll
|
|
129
|
+
} = this.props;
|
|
127
130
|
const input = this.inputRef && this.inputRef.current;
|
|
128
131
|
|
|
129
132
|
if (isFocus) {
|
|
130
|
-
input && input.focus(
|
|
133
|
+
input && input.focus({
|
|
134
|
+
preventScroll
|
|
135
|
+
});
|
|
131
136
|
} else {
|
|
132
137
|
input && input.blur();
|
|
133
138
|
}
|
|
@@ -168,11 +173,14 @@ class TagInput extends BaseComponent {
|
|
|
168
173
|
componentDidMount() {
|
|
169
174
|
const {
|
|
170
175
|
disabled,
|
|
171
|
-
autoFocus
|
|
176
|
+
autoFocus,
|
|
177
|
+
preventScroll
|
|
172
178
|
} = this.props;
|
|
173
179
|
|
|
174
180
|
if (!disabled && autoFocus) {
|
|
175
|
-
this.inputRef.current.focus(
|
|
181
|
+
this.inputRef.current.focus({
|
|
182
|
+
preventScroll
|
|
183
|
+
});
|
|
176
184
|
}
|
|
177
185
|
}
|
|
178
186
|
|
|
@@ -341,7 +349,12 @@ class TagInput extends BaseComponent {
|
|
|
341
349
|
}
|
|
342
350
|
|
|
343
351
|
focus() {
|
|
344
|
-
|
|
352
|
+
const {
|
|
353
|
+
preventScroll
|
|
354
|
+
} = this.props;
|
|
355
|
+
this.inputRef.current.focus({
|
|
356
|
+
preventScroll
|
|
357
|
+
});
|
|
345
358
|
}
|
|
346
359
|
|
|
347
360
|
render() {
|
|
@@ -441,7 +454,8 @@ TagInput.propTypes = {
|
|
|
441
454
|
validateStatus: PropTypes.oneOf(strings.STATUS),
|
|
442
455
|
prefix: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
443
456
|
suffix: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
444
|
-
'aria-label': PropTypes.string
|
|
457
|
+
'aria-label': PropTypes.string,
|
|
458
|
+
preventScroll: PropTypes.bool
|
|
445
459
|
};
|
|
446
460
|
TagInput.defaultProps = {
|
|
447
461
|
showClear: false,
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import BaseComponent, { BaseProps } from '../_base/baseComponent';
|
|
4
4
|
import InputFoundation, { TimeInputAdapter } from '@douyinfe/semi-foundation/lib/es/timePicker/inputFoundation';
|
|
5
5
|
import { TimePickerProps } from './TimePicker';
|
|
6
|
-
export declare type TimeInputProps = Pick<TimePickerProps, 'value' | 'format' | 'prefixCls' | 'placeholder' | 'clearText' | 'inputReadOnly' | 'disabled' | 'type' | 'timeZone' | 'defaultOpen' | 'disabledHours' | 'disabledMinutes' | 'disabledSeconds' | 'dateFnsLocale' | 'onFocus' | 'onBlur' | 'focusOnOpen' | 'locale' | 'localeCode' | 'insetLabel' | 'validateStatus'> & BaseProps & {
|
|
6
|
+
export declare type TimeInputProps = Pick<TimePickerProps, 'value' | 'format' | 'prefixCls' | 'placeholder' | 'clearText' | 'inputReadOnly' | 'disabled' | 'type' | 'timeZone' | 'defaultOpen' | 'disabledHours' | 'disabledMinutes' | 'disabledSeconds' | 'dateFnsLocale' | 'onFocus' | 'onBlur' | 'focusOnOpen' | 'locale' | 'localeCode' | 'insetLabel' | 'validateStatus' | 'preventScroll'> & BaseProps & {
|
|
7
7
|
onChange?: (value: string) => void;
|
|
8
8
|
onEsc?: () => void;
|
|
9
9
|
onClick?: React.MouseEventHandler;
|
|
@@ -38,6 +38,7 @@ declare class TimeInput extends BaseComponent<TimeInputProps, any> {
|
|
|
38
38
|
localeCode: PropTypes.Requireable<string>;
|
|
39
39
|
insetLabel: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
40
40
|
validateStatus: PropTypes.Requireable<string>;
|
|
41
|
+
preventScroll: PropTypes.Requireable<boolean>;
|
|
41
42
|
};
|
|
42
43
|
static defaultProps: {
|
|
43
44
|
inputReadOnly: boolean;
|
|
@@ -48,7 +48,8 @@ class TimeInput extends BaseComponent {
|
|
|
48
48
|
componentDidMount() {
|
|
49
49
|
super.componentDidMount();
|
|
50
50
|
const {
|
|
51
|
-
focusOnOpen
|
|
51
|
+
focusOnOpen,
|
|
52
|
+
preventScroll
|
|
52
53
|
} = this.props;
|
|
53
54
|
|
|
54
55
|
if (focusOnOpen) {
|
|
@@ -57,7 +58,9 @@ class TimeInput extends BaseComponent {
|
|
|
57
58
|
const inputNode = this.adapter.getCache('inputNode');
|
|
58
59
|
|
|
59
60
|
if (inputNode) {
|
|
60
|
-
inputNode.focus(
|
|
61
|
+
inputNode.focus({
|
|
62
|
+
preventScroll
|
|
63
|
+
});
|
|
61
64
|
inputNode.select();
|
|
62
65
|
}
|
|
63
66
|
});
|
|
@@ -186,7 +189,8 @@ TimeInput.propTypes = {
|
|
|
186
189
|
locale: PropTypes.object,
|
|
187
190
|
localeCode: PropTypes.string,
|
|
188
191
|
insetLabel: PropTypes.node,
|
|
189
|
-
validateStatus: PropTypes.string
|
|
192
|
+
validateStatus: PropTypes.string,
|
|
193
|
+
preventScroll: PropTypes.bool
|
|
190
194
|
};
|
|
191
195
|
TimeInput.defaultProps = {
|
|
192
196
|
inputReadOnly: false,
|
|
@@ -54,6 +54,7 @@ export declare type TimePickerProps = {
|
|
|
54
54
|
popupStyle?: React.CSSProperties;
|
|
55
55
|
position?: Position;
|
|
56
56
|
prefixCls?: string;
|
|
57
|
+
preventScroll?: boolean;
|
|
57
58
|
rangeSeparator?: string;
|
|
58
59
|
scrollItemProps?: ScrollItemProps<any>;
|
|
59
60
|
secondStep?: number;
|
|
@@ -88,6 +89,7 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
|
|
|
88
89
|
static contextType: React.Context<import("../configProvider/context").ContextValue>;
|
|
89
90
|
static propTypes: {
|
|
90
91
|
inputStyle: PropTypes.Requireable<object>;
|
|
92
|
+
preventScroll: PropTypes.Requireable<boolean>;
|
|
91
93
|
panelHeader: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
92
94
|
panelFooter: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
93
95
|
'aria-labelledby': PropTypes.Requireable<string>;
|
|
@@ -443,7 +443,8 @@ TimePicker.propTypes = _Object$assign(_Object$assign({
|
|
|
443
443
|
motion: PropTypes.oneOfType([PropTypes.bool, PropTypes.func, PropTypes.object]),
|
|
444
444
|
autoAdjustOverflow: PropTypes.bool
|
|
445
445
|
}, PanelShape), {
|
|
446
|
-
inputStyle: PropTypes.object
|
|
446
|
+
inputStyle: PropTypes.object,
|
|
447
|
+
preventScroll: PropTypes.bool
|
|
447
448
|
});
|
|
448
449
|
TimePicker.defaultProps = _Object$assign({
|
|
449
450
|
autoAdjustOverflow: true,
|
|
@@ -9,6 +9,7 @@ export declare type LocalePickerProps = BasePickerProps;
|
|
|
9
9
|
export default class LocaleTimePicker extends React.PureComponent<LocalePickerProps> {
|
|
10
10
|
static propTypes: {
|
|
11
11
|
inputStyle: import("prop-types").Requireable<object>;
|
|
12
|
+
preventScroll: import("prop-types").Requireable<boolean>;
|
|
12
13
|
panelHeader: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
13
14
|
panelFooter: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
14
15
|
'aria-labelledby': import("prop-types").Requireable<string>;
|
|
@@ -54,6 +54,7 @@ export interface TooltipProps extends BaseProps {
|
|
|
54
54
|
returnFocusOnClose?: boolean;
|
|
55
55
|
onEscKeyDown?: (e: React.KeyboardEvent) => void;
|
|
56
56
|
wrapperId?: string;
|
|
57
|
+
preventScroll?: boolean;
|
|
57
58
|
}
|
|
58
59
|
interface TooltipState {
|
|
59
60
|
visible: boolean;
|
|
@@ -109,6 +110,7 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
|
|
|
109
110
|
wrapWhenSpecial: PropTypes.Requireable<boolean>;
|
|
110
111
|
guardFocus: PropTypes.Requireable<boolean>;
|
|
111
112
|
returnFocusOnClose: PropTypes.Requireable<boolean>;
|
|
113
|
+
preventScroll: PropTypes.Requireable<boolean>;
|
|
112
114
|
};
|
|
113
115
|
static defaultProps: {
|
|
114
116
|
arrowBounding: {
|
package/lib/es/tooltip/index.js
CHANGED
|
@@ -251,7 +251,8 @@ export default class Tooltip extends BaseComponent {
|
|
|
251
251
|
|
|
252
252
|
if (block || _includesInstanceProperty(blockDisplays).call(blockDisplays, display)) {
|
|
253
253
|
style.width = '100%';
|
|
254
|
-
}
|
|
254
|
+
} // eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
255
|
+
|
|
255
256
|
|
|
256
257
|
return /*#__PURE__*/React.createElement("span", {
|
|
257
258
|
className: wrapperClassName,
|
|
@@ -554,10 +555,16 @@ export default class Tooltip extends BaseComponent {
|
|
|
554
555
|
return getActiveElement();
|
|
555
556
|
},
|
|
556
557
|
setInitialFocus: () => {
|
|
558
|
+
const {
|
|
559
|
+
preventScroll
|
|
560
|
+
} = this.props;
|
|
561
|
+
|
|
557
562
|
const focusRefNode = _get(this, 'initialFocusRef.current');
|
|
558
563
|
|
|
559
564
|
if (focusRefNode && 'focus' in focusRefNode) {
|
|
560
|
-
focusRefNode.focus(
|
|
565
|
+
focusRefNode.focus({
|
|
566
|
+
preventScroll
|
|
567
|
+
});
|
|
561
568
|
}
|
|
562
569
|
},
|
|
563
570
|
notifyEscKeydown: event => {
|
|
@@ -676,7 +683,8 @@ export default class Tooltip extends BaseComponent {
|
|
|
676
683
|
ref.current = node;
|
|
677
684
|
}
|
|
678
685
|
},
|
|
679
|
-
tabIndex:
|
|
686
|
+
tabIndex: 0,
|
|
687
|
+
'data-popupId': id
|
|
680
688
|
})); // If you do not add a layer of div, in order to bind the events and className in the tooltip, you need to cloneElement children, but this time it may overwrite the children's original ref reference
|
|
681
689
|
// So if the user adds ref to the content, you need to use callback ref: https://github.com/facebook/react/issues/8873
|
|
682
690
|
|
|
@@ -717,7 +725,8 @@ Tooltip.propTypes = {
|
|
|
717
725
|
role: PropTypes.string,
|
|
718
726
|
wrapWhenSpecial: PropTypes.bool,
|
|
719
727
|
guardFocus: PropTypes.bool,
|
|
720
|
-
returnFocusOnClose: PropTypes.bool
|
|
728
|
+
returnFocusOnClose: PropTypes.bool,
|
|
729
|
+
preventScroll: PropTypes.bool
|
|
721
730
|
};
|
|
722
731
|
Tooltip.defaultProps = {
|
|
723
732
|
arrowBounding: numbers.ARROW_BOUNDING,
|
package/lib/es/tree/index.d.ts
CHANGED
|
@@ -73,6 +73,7 @@ declare class Tree extends BaseComponent<TreeProps, TreeState> {
|
|
|
73
73
|
labelEllipsis: PropTypes.Requireable<boolean>;
|
|
74
74
|
checkRelation: PropTypes.Requireable<string>;
|
|
75
75
|
'aria-label': PropTypes.Requireable<string>;
|
|
76
|
+
preventScroll: PropTypes.Requireable<boolean>;
|
|
76
77
|
};
|
|
77
78
|
static defaultProps: {
|
|
78
79
|
showClear: boolean;
|
package/lib/es/tree/index.js
CHANGED
|
@@ -424,8 +424,14 @@ class Tree extends BaseComponent {
|
|
|
424
424
|
});
|
|
425
425
|
},
|
|
426
426
|
focusInput: () => {
|
|
427
|
+
const {
|
|
428
|
+
preventScroll
|
|
429
|
+
} = this.props;
|
|
430
|
+
|
|
427
431
|
if (this.inputRef && this.inputRef.current) {
|
|
428
|
-
this.inputRef.current.focus(
|
|
432
|
+
this.inputRef.current.focus({
|
|
433
|
+
preventScroll
|
|
434
|
+
});
|
|
429
435
|
}
|
|
430
436
|
}
|
|
431
437
|
};
|
|
@@ -731,7 +737,8 @@ Tree.propTypes = {
|
|
|
731
737
|
onDrop: PropTypes.func,
|
|
732
738
|
labelEllipsis: PropTypes.bool,
|
|
733
739
|
checkRelation: PropTypes.string,
|
|
734
|
-
'aria-label': PropTypes.string
|
|
740
|
+
'aria-label': PropTypes.string,
|
|
741
|
+
preventScroll: PropTypes.bool
|
|
735
742
|
};
|
|
736
743
|
Tree.defaultProps = {
|
|
737
744
|
showClear: true,
|
package/lib/es/tree/treeNode.js
CHANGED
|
@@ -6,7 +6,6 @@ import _debounce from "lodash/debounce";
|
|
|
6
6
|
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
|
|
7
7
|
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
8
8
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
9
|
-
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
10
9
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
11
10
|
|
|
12
11
|
var __rest = this && this.__rest || function (s, e) {
|
|
@@ -29,6 +28,7 @@ import { IconTreeTriangleDown, IconFile, IconFolder, IconFolderOpen } from '@dou
|
|
|
29
28
|
import { Checkbox } from '../checkbox';
|
|
30
29
|
import TreeContext from './treeContext';
|
|
31
30
|
import Spin from '../spin';
|
|
31
|
+
import { getHighLightTextHTML } from '../_utils/index';
|
|
32
32
|
const prefixcls = cssClasses.PREFIX_OPTION;
|
|
33
33
|
export default class TreeNode extends PureComponent {
|
|
34
34
|
constructor(props) {
|
|
@@ -248,22 +248,14 @@ export default class TreeNode extends PureComponent {
|
|
|
248
248
|
if (_isFunction(renderLabel)) {
|
|
249
249
|
return renderLabel(label, data);
|
|
250
250
|
} else if (_isString(label) && filtered && keyword && treeNodeFilterProp === 'label') {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
content.push( /*#__PURE__*/React.createElement("span", {
|
|
258
|
-
className: "".concat(prefixcls, "-highlight"),
|
|
259
|
-
key: index
|
|
260
|
-
}, keyword));
|
|
251
|
+
return getHighLightTextHTML({
|
|
252
|
+
sourceString: label,
|
|
253
|
+
searchWords: [keyword],
|
|
254
|
+
option: {
|
|
255
|
+
highlightTag: 'span',
|
|
256
|
+
highlightClassName: "".concat(prefixcls, "-highlight")
|
|
261
257
|
}
|
|
262
|
-
|
|
263
|
-
content.push(node);
|
|
264
258
|
});
|
|
265
|
-
|
|
266
|
-
return content;
|
|
267
259
|
} else {
|
|
268
260
|
return label;
|
|
269
261
|
}
|
|
@@ -362,7 +354,7 @@ export default class TreeNode extends PureComponent {
|
|
|
362
354
|
}
|
|
363
355
|
|
|
364
356
|
renderEmptyNode() {
|
|
365
|
-
var
|
|
357
|
+
var _context;
|
|
366
358
|
|
|
367
359
|
const {
|
|
368
360
|
emptyContent
|
|
@@ -373,14 +365,14 @@ export default class TreeNode extends PureComponent {
|
|
|
373
365
|
return /*#__PURE__*/React.createElement("ul", {
|
|
374
366
|
className: wrapperCls
|
|
375
367
|
}, /*#__PURE__*/React.createElement("li", {
|
|
376
|
-
className: _concatInstanceProperty(
|
|
368
|
+
className: _concatInstanceProperty(_context = "".concat(prefixcls, "-label ")).call(_context, prefixcls, "-label-empty"),
|
|
377
369
|
"x-semi-prop": "emptyContent"
|
|
378
370
|
}, emptyContent));
|
|
379
371
|
} // eslint-disable-next-line max-lines-per-function
|
|
380
372
|
|
|
381
373
|
|
|
382
374
|
render() {
|
|
383
|
-
var
|
|
375
|
+
var _context2;
|
|
384
376
|
|
|
385
377
|
const _a = this.props,
|
|
386
378
|
{
|
|
@@ -418,7 +410,7 @@ export default class TreeNode extends PureComponent {
|
|
|
418
410
|
const dragOverGapTop = dragOverNodeKey === eventKey && dropPosition === -1;
|
|
419
411
|
const dragOverGapBottom = dragOverNodeKey === eventKey && dropPosition === 1;
|
|
420
412
|
const nodeCls = cls(prefixcls, {
|
|
421
|
-
[_concatInstanceProperty(
|
|
413
|
+
[_concatInstanceProperty(_context2 = "".concat(prefixcls, "-level-")).call(_context2, level + 1)]: true,
|
|
422
414
|
["".concat(prefixcls, "-collapsed")]: !expanded,
|
|
423
415
|
["".concat(prefixcls, "-disabled")]: Boolean(disabled),
|
|
424
416
|
["".concat(prefixcls, "-selected")]: selected,
|
|
@@ -324,6 +324,14 @@ class TreeSelect extends BaseComponent {
|
|
|
324
324
|
};
|
|
325
325
|
|
|
326
326
|
this.search = value => {
|
|
327
|
+
const {
|
|
328
|
+
isOpen
|
|
329
|
+
} = this.state;
|
|
330
|
+
|
|
331
|
+
if (!isOpen) {
|
|
332
|
+
this.foundation.open();
|
|
333
|
+
}
|
|
334
|
+
|
|
327
335
|
this.foundation.handleInputChange(value);
|
|
328
336
|
};
|
|
329
337
|
|
|
@@ -1315,7 +1323,6 @@ TreeSelect.defaultProps = {
|
|
|
1315
1323
|
motionExpand: true,
|
|
1316
1324
|
expandAll: false,
|
|
1317
1325
|
zIndex: popoverNumbers.DEFAULT_Z_INDEX,
|
|
1318
|
-
disabled: false,
|
|
1319
1326
|
disableStrictly: false,
|
|
1320
1327
|
multiple: false,
|
|
1321
1328
|
filterTreeNode: false,
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { de } from 'date-fns/locale';
|
|
2
|
+
import { Locale } from '../interface';
|
|
3
|
+
|
|
4
|
+
const local: Locale = {
|
|
5
|
+
code: 'de',
|
|
6
|
+
dateFnsLocale: de,
|
|
7
|
+
Pagination: {
|
|
8
|
+
item: 'Artikel',
|
|
9
|
+
pageSize: ' Artikel / Seite',
|
|
10
|
+
page: ' Seiten',
|
|
11
|
+
total: '',
|
|
12
|
+
jumpTo: 'Springen zu'
|
|
13
|
+
},
|
|
14
|
+
Modal: {
|
|
15
|
+
confirm: 'Bestätigen',
|
|
16
|
+
cancel: 'Abbrechen',
|
|
17
|
+
},
|
|
18
|
+
TimePicker: {
|
|
19
|
+
placeholder: {
|
|
20
|
+
time: 'Zeit auswählen',
|
|
21
|
+
timeRange: 'Einen Zeitintervall auswählen',
|
|
22
|
+
},
|
|
23
|
+
begin: 'Startzeit',
|
|
24
|
+
end: 'Endzeit',
|
|
25
|
+
hour: '',
|
|
26
|
+
minute: '',
|
|
27
|
+
second: '',
|
|
28
|
+
AM: 'AM',
|
|
29
|
+
PM: 'PM',
|
|
30
|
+
},
|
|
31
|
+
DatePicker: {
|
|
32
|
+
placeholder: {
|
|
33
|
+
date: 'Datum auswählen',
|
|
34
|
+
dateTime: 'Datum und Uhrzeit auswählen',
|
|
35
|
+
dateRange: ['Startdatum', 'Enddatum'],
|
|
36
|
+
dateTimeRange: ['Startdatum', 'Enddatum'],
|
|
37
|
+
},
|
|
38
|
+
footer: {
|
|
39
|
+
confirm: 'Bestätigen',
|
|
40
|
+
cancel: 'Abbrechen',
|
|
41
|
+
},
|
|
42
|
+
selectDate: 'Datum auswählen',
|
|
43
|
+
selectTime: 'Uhrzeit auswählen',
|
|
44
|
+
year: 'Jahr',
|
|
45
|
+
month: 'Monat',
|
|
46
|
+
day: 'Tag',
|
|
47
|
+
monthText: '${month} ${year}',
|
|
48
|
+
months: {
|
|
49
|
+
1: 'Jan',
|
|
50
|
+
2: 'Feb',
|
|
51
|
+
3: 'Mär',
|
|
52
|
+
4: 'Apr',
|
|
53
|
+
5: 'Mai',
|
|
54
|
+
6: 'Jun',
|
|
55
|
+
7: 'Jul',
|
|
56
|
+
8: 'Aug',
|
|
57
|
+
9: 'Sep',
|
|
58
|
+
10: 'Okt',
|
|
59
|
+
11: 'Nov',
|
|
60
|
+
12: 'Dez',
|
|
61
|
+
},
|
|
62
|
+
fullMonths: {
|
|
63
|
+
1: 'Januar',
|
|
64
|
+
2: 'Februar',
|
|
65
|
+
3: 'März',
|
|
66
|
+
4: 'April',
|
|
67
|
+
5: 'Mai',
|
|
68
|
+
6: 'Juni',
|
|
69
|
+
7: 'Juli',
|
|
70
|
+
8: 'August',
|
|
71
|
+
9: 'September',
|
|
72
|
+
10: 'Oktober',
|
|
73
|
+
11: 'November',
|
|
74
|
+
12: 'Dezember',
|
|
75
|
+
},
|
|
76
|
+
weeks: {
|
|
77
|
+
Mon: 'Mo.',
|
|
78
|
+
Tue: 'Di.',
|
|
79
|
+
Wed: 'Mi.',
|
|
80
|
+
Thu: 'Do.',
|
|
81
|
+
Fri: 'Fr.',
|
|
82
|
+
Sat: 'Sa.',
|
|
83
|
+
Sun: 'So.',
|
|
84
|
+
},
|
|
85
|
+
localeFormatToken: {
|
|
86
|
+
FORMAT_SWITCH_DATE: 'yyyy-MM-dd',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
Popconfirm: {
|
|
90
|
+
confirm: 'Bestätigen',
|
|
91
|
+
cancel: 'Abbrechen',
|
|
92
|
+
},
|
|
93
|
+
Navigation: {
|
|
94
|
+
collapseText: 'Seitenleiste verstecken',
|
|
95
|
+
expandText: 'Seitenleiste anzeigen',
|
|
96
|
+
},
|
|
97
|
+
Table: {
|
|
98
|
+
emptyText: 'Kein Ergebnis',
|
|
99
|
+
pageText: 'Anzeigen ${currentStart} bis ${currentEnd} von ${total}',
|
|
100
|
+
},
|
|
101
|
+
Select: {
|
|
102
|
+
emptyText: 'Kein Ergebnis',
|
|
103
|
+
createText: 'Kreieren',
|
|
104
|
+
},
|
|
105
|
+
Tree: {
|
|
106
|
+
emptyText: 'Kein Ergebnis',
|
|
107
|
+
searchPlaceholder: 'Suchen',
|
|
108
|
+
},
|
|
109
|
+
Cascader: {
|
|
110
|
+
emptyText: 'Kein Ergebnis',
|
|
111
|
+
},
|
|
112
|
+
List: {
|
|
113
|
+
emptyText: 'Kein Ergebnis',
|
|
114
|
+
},
|
|
115
|
+
Calendar: {
|
|
116
|
+
allDay: 'Den ganzen Tag',
|
|
117
|
+
AM: '${time} AM',
|
|
118
|
+
PM: '${time} PM',
|
|
119
|
+
datestring: '',
|
|
120
|
+
remaining: '${remained} mehr',
|
|
121
|
+
},
|
|
122
|
+
Upload: {
|
|
123
|
+
mainText: 'Klicken Sie auf Datei hochladen oder ziehen Sie die Datei hierher',
|
|
124
|
+
illegalTips: 'Dieser Dateityp wird nicht unterstützt',
|
|
125
|
+
legalTips: 'Freigeben und Hochladen starten',
|
|
126
|
+
retry: 'Wiederholen',
|
|
127
|
+
replace: 'Datei ersetzen',
|
|
128
|
+
clear: 'Löschen',
|
|
129
|
+
selectedFiles: 'Ausgewählte Dateien',
|
|
130
|
+
illegalSize: 'Illegale Dateigröße',
|
|
131
|
+
fail: 'Hochladen fehlgeschlagen',
|
|
132
|
+
},
|
|
133
|
+
TreeSelect: {
|
|
134
|
+
searchPlaceholder: 'Suchen',
|
|
135
|
+
},
|
|
136
|
+
Typography: {
|
|
137
|
+
copy: 'Kopieren',
|
|
138
|
+
copied: 'Kopiert',
|
|
139
|
+
expand: 'Erweitern',
|
|
140
|
+
collapse: 'Verstecken',
|
|
141
|
+
},
|
|
142
|
+
Transfer: {
|
|
143
|
+
emptyLeft: 'Keine Daten',
|
|
144
|
+
emptySearch: 'Keine Suchergebnisse',
|
|
145
|
+
emptyRight: 'Keine Inhalte, links kontrollieren',
|
|
146
|
+
placeholder: 'Suchen',
|
|
147
|
+
clear: 'Löschen',
|
|
148
|
+
selectAll: 'Alles auswählen',
|
|
149
|
+
clearSelectAll: 'Alles abwählen',
|
|
150
|
+
total: 'Gesamt ${total} Artikel',
|
|
151
|
+
selected: '${total} ausgewählte Artikel',
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
// [i18n-German]
|
|
156
|
+
export default local;
|