@douyinfe/semi-ui 2.56.0-alpha.0 → 2.56.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/dist/css/semi.css +41 -9
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +76 -47
- 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/lib/cjs/_base/base.css +5 -7
- package/lib/cjs/anchor/index.d.ts +1 -1
- package/lib/cjs/autoComplete/index.d.ts +1 -1
- package/lib/cjs/autoComplete/index.js +2 -1
- package/lib/cjs/backtop/index.d.ts +1 -0
- package/lib/cjs/backtop/index.js +4 -1
- package/lib/cjs/button/Button.d.ts +1 -1
- package/lib/cjs/button/buttonGroup.d.ts +1 -1
- package/lib/cjs/button/index.d.ts +1 -1
- package/lib/cjs/calendar/monthCalendar.js +3 -1
- package/lib/cjs/cascader/index.js +8 -4
- package/lib/cjs/datePicker/datePicker.d.ts +1 -1
- package/lib/cjs/datePicker/datePicker.js +5 -9
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/form/baseForm.d.ts +2 -2
- package/lib/cjs/form/field.d.ts +2 -2
- package/lib/cjs/input/index.d.ts +1 -1
- package/lib/cjs/input/inputGroup.d.ts +1 -1
- package/lib/cjs/locale/source/ro.d.ts +3 -170
- package/lib/cjs/locale/source/ro.js +5 -5
- package/lib/cjs/modal/confirm.d.ts +16 -16
- package/lib/cjs/radio/radio.d.ts +1 -1
- package/lib/cjs/radio/radioGroup.d.ts +1 -1
- package/lib/cjs/rating/index.d.ts +1 -1
- package/lib/cjs/rating/item.d.ts +1 -1
- package/lib/cjs/select/index.js +3 -3
- package/lib/cjs/switch/index.d.ts +1 -1
- package/lib/cjs/table/Table.d.ts +2 -2
- package/lib/cjs/table/index.d.ts +1 -1
- package/lib/cjs/tagInput/index.d.ts +1 -1
- package/lib/cjs/tagInput/index.js +2 -1
- package/lib/cjs/timePicker/TimePicker.d.ts +2 -1
- package/lib/cjs/timePicker/TimePicker.js +8 -8
- package/lib/cjs/timePicker/index.d.ts +1 -1
- package/lib/cjs/tooltip/index.js +4 -1
- package/lib/cjs/treeSelect/index.js +4 -3
- package/lib/cjs/typography/base.d.ts +8 -0
- package/lib/cjs/typography/base.js +28 -4
- package/lib/cjs/typography/title.d.ts +2 -2
- package/lib/es/_base/base.css +5 -7
- package/lib/es/anchor/index.d.ts +1 -1
- package/lib/es/autoComplete/index.d.ts +1 -1
- package/lib/es/autoComplete/index.js +2 -1
- package/lib/es/backtop/index.d.ts +1 -0
- package/lib/es/backtop/index.js +4 -1
- package/lib/es/button/Button.d.ts +1 -1
- package/lib/es/button/buttonGroup.d.ts +1 -1
- package/lib/es/button/index.d.ts +1 -1
- package/lib/es/calendar/monthCalendar.js +3 -1
- package/lib/es/cascader/index.js +8 -4
- package/lib/es/datePicker/datePicker.d.ts +1 -1
- package/lib/es/datePicker/datePicker.js +5 -9
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/form/baseForm.d.ts +2 -2
- package/lib/es/form/field.d.ts +2 -2
- package/lib/es/input/index.d.ts +1 -1
- package/lib/es/input/inputGroup.d.ts +1 -1
- package/lib/es/locale/source/ro.d.ts +3 -170
- package/lib/es/locale/source/ro.js +6 -6
- package/lib/es/modal/confirm.d.ts +16 -16
- package/lib/es/radio/radio.d.ts +1 -1
- package/lib/es/radio/radioGroup.d.ts +1 -1
- package/lib/es/rating/index.d.ts +1 -1
- package/lib/es/rating/item.d.ts +1 -1
- package/lib/es/select/index.js +3 -3
- package/lib/es/switch/index.d.ts +1 -1
- package/lib/es/table/Table.d.ts +2 -2
- package/lib/es/table/index.d.ts +1 -1
- package/lib/es/tagInput/index.d.ts +1 -1
- package/lib/es/tagInput/index.js +2 -1
- package/lib/es/timePicker/TimePicker.d.ts +2 -1
- package/lib/es/timePicker/TimePicker.js +8 -8
- package/lib/es/timePicker/index.d.ts +1 -1
- package/lib/es/tooltip/index.js +4 -1
- package/lib/es/treeSelect/index.js +4 -3
- package/lib/es/typography/base.d.ts +8 -0
- package/lib/es/typography/base.js +28 -4
- package/lib/es/typography/title.d.ts +2 -2
- package/package.json +8 -8
|
@@ -45,7 +45,7 @@ declare class Switch extends BaseComponent<SwitchProps, SwitchState> {
|
|
|
45
45
|
onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
46
46
|
onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
|
47
47
|
style: PropTypes.Requireable<object>;
|
|
48
|
-
size: PropTypes.Requireable<"
|
|
48
|
+
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
49
49
|
uncheckedText: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
50
50
|
id: PropTypes.Requireable<string>;
|
|
51
51
|
};
|
package/lib/cjs/table/Table.d.ts
CHANGED
|
@@ -60,7 +60,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
|
|
|
60
60
|
components: PropTypes.Requireable<any>;
|
|
61
61
|
bordered: PropTypes.Requireable<boolean>;
|
|
62
62
|
loading: PropTypes.Requireable<boolean>;
|
|
63
|
-
size: PropTypes.Requireable<"
|
|
63
|
+
size: PropTypes.Requireable<"default" | "small" | "middle">;
|
|
64
64
|
tableLayout: PropTypes.Requireable<"" | "fixed" | "auto">;
|
|
65
65
|
columns: PropTypes.Requireable<PropTypes.InferProps<{
|
|
66
66
|
align: PropTypes.Requireable<"center" | "left" | "right">;
|
|
@@ -297,7 +297,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
|
|
|
297
297
|
showTotal?: boolean;
|
|
298
298
|
pageSize?: number;
|
|
299
299
|
pageSizeOpts?: number[];
|
|
300
|
-
size?: "
|
|
300
|
+
size?: "default" | "small";
|
|
301
301
|
currentPage?: number;
|
|
302
302
|
defaultCurrentPage?: number;
|
|
303
303
|
onPageChange?: (currentPage: number) => void;
|
package/lib/cjs/table/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ declare class Table<RecordType extends Record<string, any> = Data> extends React
|
|
|
16
16
|
components: PropTypes.Requireable<any>;
|
|
17
17
|
bordered: PropTypes.Requireable<boolean>;
|
|
18
18
|
loading: PropTypes.Requireable<boolean>;
|
|
19
|
-
size: PropTypes.Requireable<"
|
|
19
|
+
size: PropTypes.Requireable<"default" | "small" | "middle">;
|
|
20
20
|
tableLayout: PropTypes.Requireable<"" | "fixed" | "auto">;
|
|
21
21
|
columns: PropTypes.Requireable<PropTypes.InferProps<{
|
|
22
22
|
align: PropTypes.Requireable<"center" | "left" | "right">;
|
|
@@ -97,7 +97,7 @@ declare class TagInput extends BaseComponent<TagInputProps, TagInputState> {
|
|
|
97
97
|
onAdd: PropTypes.Requireable<(...args: any[]) => any>;
|
|
98
98
|
onRemove: PropTypes.Requireable<(...args: any[]) => any>;
|
|
99
99
|
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
100
|
-
size: PropTypes.Requireable<"
|
|
100
|
+
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
101
101
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
|
|
102
102
|
prefix: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
103
103
|
suffix: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
@@ -270,7 +270,8 @@ class TagInput extends _baseComponent.default {
|
|
|
270
270
|
const clickOutsideHandler = e => {
|
|
271
271
|
const tagInputDom = this.tagInputRef && this.tagInputRef.current;
|
|
272
272
|
const target = e.target;
|
|
273
|
-
|
|
273
|
+
const path = e.composedPath && e.composedPath() || [target];
|
|
274
|
+
if (tagInputDom && !tagInputDom.contains(target) && !path.includes(tagInputDom)) {
|
|
274
275
|
cb(e);
|
|
275
276
|
}
|
|
276
277
|
};
|
|
@@ -133,7 +133,7 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
|
|
|
133
133
|
secondStep: PropTypes.Requireable<number>;
|
|
134
134
|
focusOnOpen: PropTypes.Requireable<boolean>;
|
|
135
135
|
autoFocus: PropTypes.Requireable<boolean>;
|
|
136
|
-
size: PropTypes.Requireable<"
|
|
136
|
+
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
137
137
|
stopPropagation: PropTypes.Requireable<boolean>;
|
|
138
138
|
panels: PropTypes.Requireable<PropTypes.InferProps<{
|
|
139
139
|
panelHeader: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
@@ -193,6 +193,7 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
|
|
|
193
193
|
foundation: TimePickerFoundation;
|
|
194
194
|
timePickerRef: React.MutableRefObject<HTMLDivElement>;
|
|
195
195
|
savePanelRef: React.RefObject<HTMLDivElement>;
|
|
196
|
+
useCustomTrigger: boolean;
|
|
196
197
|
clickOutSideHandler: (e: MouseEvent) => void;
|
|
197
198
|
constructor(props: TimePickerProps);
|
|
198
199
|
get adapter(): TimePickerAdapter<TimePickerProps, TimePickerState>;
|
|
@@ -92,6 +92,7 @@ class TimePicker extends _baseComponent.default {
|
|
|
92
92
|
this.foundation = new _foundation.default(this.adapter);
|
|
93
93
|
this.timePickerRef = /*#__PURE__*/_react.default.createRef();
|
|
94
94
|
this.savePanelRef = /*#__PURE__*/_react.default.createRef();
|
|
95
|
+
this.useCustomTrigger = typeof this.props.triggerRender === 'function';
|
|
95
96
|
}
|
|
96
97
|
get adapter() {
|
|
97
98
|
var _this2 = this;
|
|
@@ -107,11 +108,11 @@ class TimePicker extends _baseComponent.default {
|
|
|
107
108
|
}
|
|
108
109
|
this.clickOutSideHandler = e => {
|
|
109
110
|
const panel = this.savePanelRef && this.savePanelRef.current;
|
|
110
|
-
const
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
this.foundation.handlePanelClose(
|
|
111
|
+
const trigger = this.timePickerRef && this.timePickerRef.current;
|
|
112
|
+
const target = e.target;
|
|
113
|
+
const path = e.composedPath && e.composedPath() || [target];
|
|
114
|
+
if (!(panel && panel.contains(target)) && !(trigger && trigger.contains(target)) && !(path.includes(trigger) || path.includes(panel))) {
|
|
115
|
+
this.foundation.handlePanelClose(true, e);
|
|
115
116
|
}
|
|
116
117
|
};
|
|
117
118
|
document.addEventListener('mousedown', this.clickOutSideHandler);
|
|
@@ -275,7 +276,6 @@ class TimePicker extends _baseComponent.default {
|
|
|
275
276
|
rest = __rest(_a, ["prefixCls", "placeholder", "disabled", "defaultValue", "dropdownMargin", "className", "popupStyle", "size", "style", "locale", "localeCode", "zIndex", "getPopupContainer", "insetLabel", "insetLabelId", "inputStyle", "showClear", "panelHeader", "panelFooter", "rangeSeparator", "onOpenChange", "onChangeWithDateFirst", "popupClassName", "hideDisabledOptions", "use12Hours", "minuteStep", "hourStep", "secondStep", "scrollItemProps", "triggerRender", "motion", "autoAdjustOverflow", "stopPropagation"]);
|
|
276
277
|
const format = this.foundation.getDefaultFormatIfNeed();
|
|
277
278
|
const position = this.foundation.getPosition();
|
|
278
|
-
const useCustomTrigger = typeof triggerRender === 'function';
|
|
279
279
|
const {
|
|
280
280
|
open,
|
|
281
281
|
inputValue,
|
|
@@ -309,7 +309,7 @@ class TimePicker extends _baseComponent.default {
|
|
|
309
309
|
onBlur: this.handleBlur
|
|
310
310
|
});
|
|
311
311
|
const outerProps = {};
|
|
312
|
-
if (useCustomTrigger) {
|
|
312
|
+
if (this.useCustomTrigger) {
|
|
313
313
|
outerProps.onClick = this.openPanel;
|
|
314
314
|
}
|
|
315
315
|
return /*#__PURE__*/_react.default.createElement("div", Object.assign({
|
|
@@ -332,7 +332,7 @@ class TimePicker extends _baseComponent.default {
|
|
|
332
332
|
margin: dropdownMargin,
|
|
333
333
|
autoAdjustOverflow: autoAdjustOverflow,
|
|
334
334
|
stopPropagation: stopPropagation
|
|
335
|
-
}, useCustomTrigger ? /*#__PURE__*/_react.default.createElement(_trigger.default, {
|
|
335
|
+
}, this.useCustomTrigger ? /*#__PURE__*/_react.default.createElement(_trigger.default, {
|
|
336
336
|
triggerRender: triggerRender,
|
|
337
337
|
disabled: disabled,
|
|
338
338
|
value: value,
|
|
@@ -49,7 +49,7 @@ export default class LocaleTimePicker extends React.PureComponent<LocalePickerPr
|
|
|
49
49
|
secondStep: import("prop-types").Requireable<number>;
|
|
50
50
|
focusOnOpen: import("prop-types").Requireable<boolean>;
|
|
51
51
|
autoFocus: import("prop-types").Requireable<boolean>;
|
|
52
|
-
size: import("prop-types").Requireable<"
|
|
52
|
+
size: import("prop-types").Requireable<"default" | "small" | "large">;
|
|
53
53
|
stopPropagation: import("prop-types").Requireable<boolean>;
|
|
54
54
|
panels: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
55
55
|
panelHeader: import("prop-types").Requireable<NonNullable<import("prop-types").ReactNodeLike>>;
|
package/lib/cjs/tooltip/index.js
CHANGED
|
@@ -432,7 +432,10 @@ class Tooltip extends _baseComponent.default {
|
|
|
432
432
|
let popupEl = this.containerEl && this.containerEl.current;
|
|
433
433
|
el = _reactDom.default.findDOMNode(el);
|
|
434
434
|
popupEl = _reactDom.default.findDOMNode(popupEl);
|
|
435
|
-
|
|
435
|
+
const target = e.target;
|
|
436
|
+
const path = e.composedPath && e.composedPath() || [target];
|
|
437
|
+
const isClickTriggerToHide = this.props.clickTriggerToHide ? el && el.contains(target) || path.includes(el) : false;
|
|
438
|
+
if (el && !el.contains(target) && popupEl && !popupEl.contains(target) && !(path.includes(popupEl) || path.includes(el)) || isClickTriggerToHide) {
|
|
436
439
|
this.props.onClickOutSide(e);
|
|
437
440
|
cb();
|
|
438
441
|
}
|
|
@@ -1114,7 +1114,8 @@ class TreeSelect extends _baseComponent.default {
|
|
|
1114
1114
|
const triggerDom = this.triggerRef && this.triggerRef.current;
|
|
1115
1115
|
const optionsDom = _reactDom.default.findDOMNode(optionInstance);
|
|
1116
1116
|
const target = e.target;
|
|
1117
|
-
|
|
1117
|
+
const path = e.composedPath && e.composedPath() || [target];
|
|
1118
|
+
if (optionsDom && (!optionsDom.contains(target) || !optionsDom.contains(target.parentNode)) && triggerDom && !triggerDom.contains(target) && !(path.includes(triggerDom) || path.includes(optionsDom))) {
|
|
1118
1119
|
cb(e);
|
|
1119
1120
|
}
|
|
1120
1121
|
};
|
|
@@ -1142,8 +1143,8 @@ class TreeSelect extends _baseComponent.default {
|
|
|
1142
1143
|
notifySelect: (selectKey, bool, node) => {
|
|
1143
1144
|
this.props.onSelect && this.props.onSelect(selectKey, bool, node);
|
|
1144
1145
|
},
|
|
1145
|
-
notifySearch: (input, filteredExpandedKeys
|
|
1146
|
-
this.props.onSearch && this.props.onSearch(input, filteredExpandedKeys
|
|
1146
|
+
notifySearch: (input, filteredExpandedKeys) => {
|
|
1147
|
+
this.props.onSearch && this.props.onSearch(input, filteredExpandedKeys);
|
|
1147
1148
|
},
|
|
1148
1149
|
cacheFlattenNodes: bool => {
|
|
1149
1150
|
this.setState({
|
|
@@ -132,6 +132,14 @@ export default class Base extends Component<BaseTypographyProps, BaseTypographyS
|
|
|
132
132
|
* @returns {Boolean}
|
|
133
133
|
*/
|
|
134
134
|
shouldTruncated: (rows: number) => boolean;
|
|
135
|
+
/**
|
|
136
|
+
* 通过将 content 给到 Range 对象,借助 Range 的 getBoundingClientRect 拿到 content 的准确 width
|
|
137
|
+
* 不受 css ellipsis 与否的影响
|
|
138
|
+
* By giving the content to the Range object, get the exact width of the content with the help of Range's getBoundingClientRect
|
|
139
|
+
* Not affected by css ellipsis or not
|
|
140
|
+
* https://github.com/DouyinFE/semi-design/issues/1731
|
|
141
|
+
*/
|
|
142
|
+
compareSingleRow: () => boolean;
|
|
135
143
|
showTooltip: () => boolean | ShowTooltip | {
|
|
136
144
|
type: string;
|
|
137
145
|
};
|
|
@@ -132,9 +132,32 @@ class Base extends _react.Component {
|
|
|
132
132
|
if (!rows || rows < 1) {
|
|
133
133
|
return false;
|
|
134
134
|
}
|
|
135
|
-
const updateOverflow = rows <= 1 ? this.
|
|
135
|
+
const updateOverflow = rows <= 1 ? this.compareSingleRow() : this.wrapperRef.current.scrollHeight > this.wrapperRef.current.offsetHeight;
|
|
136
136
|
return updateOverflow;
|
|
137
137
|
};
|
|
138
|
+
/**
|
|
139
|
+
* 通过将 content 给到 Range 对象,借助 Range 的 getBoundingClientRect 拿到 content 的准确 width
|
|
140
|
+
* 不受 css ellipsis 与否的影响
|
|
141
|
+
* By giving the content to the Range object, get the exact width of the content with the help of Range's getBoundingClientRect
|
|
142
|
+
* Not affected by css ellipsis or not
|
|
143
|
+
* https://github.com/DouyinFE/semi-design/issues/1731
|
|
144
|
+
*/
|
|
145
|
+
this.compareSingleRow = () => {
|
|
146
|
+
if (!(document && document.createRange)) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
const containerNode = this.wrapperRef.current;
|
|
150
|
+
const containerWidth = containerNode.getBoundingClientRect().width;
|
|
151
|
+
const childNodes = Array.from(containerNode.childNodes);
|
|
152
|
+
const range = document.createRange();
|
|
153
|
+
const contentWidth = childNodes.reduce((acc, node) => {
|
|
154
|
+
var _a;
|
|
155
|
+
range.selectNodeContents(node);
|
|
156
|
+
return acc + ((_a = range.getBoundingClientRect().width) !== null && _a !== void 0 ? _a : 0);
|
|
157
|
+
}, 0);
|
|
158
|
+
range.detach();
|
|
159
|
+
return contentWidth > containerWidth;
|
|
160
|
+
};
|
|
138
161
|
this.showTooltip = () => {
|
|
139
162
|
var _a, _b;
|
|
140
163
|
const {
|
|
@@ -241,14 +264,15 @@ class Base extends _react.Component {
|
|
|
241
264
|
expand: this.expandRef.current,
|
|
242
265
|
copy: this.copyRef && this.copyRef.current
|
|
243
266
|
};
|
|
244
|
-
const content = (0, _util.default)(this.wrapperRef.current, rows,
|
|
245
267
|
// Perform type conversion on children to prevent component crash due to non-string type of children
|
|
246
|
-
|
|
268
|
+
// https://github.com/DouyinFE/semi-design/issues/2167
|
|
269
|
+
const realChildren = Array.isArray(children) ? children.join('') : String(children);
|
|
270
|
+
const content = (0, _util.default)(this.wrapperRef.current, rows, realChildren, extraNode, ELLIPSIS_STR, suffix, pos);
|
|
247
271
|
return new Promise(resolve => {
|
|
248
272
|
this.setState({
|
|
249
273
|
isOverflowed: false,
|
|
250
274
|
ellipsisContent: content,
|
|
251
|
-
isTruncated:
|
|
275
|
+
isTruncated: realChildren !== content
|
|
252
276
|
}, resolve);
|
|
253
277
|
});
|
|
254
278
|
});
|
|
@@ -60,11 +60,11 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
60
60
|
underline: PropTypes.Requireable<boolean>;
|
|
61
61
|
strong: PropTypes.Requireable<boolean>;
|
|
62
62
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "secondary" | "danger" | "tertiary" | "quaternary">;
|
|
63
|
-
heading: PropTypes.Requireable<
|
|
63
|
+
heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 5 | 6>;
|
|
64
64
|
style: PropTypes.Requireable<object>;
|
|
65
65
|
className: PropTypes.Requireable<string>;
|
|
66
66
|
component: PropTypes.Requireable<string>;
|
|
67
|
-
weight: PropTypes.Requireable<NonNullable<number | "
|
|
67
|
+
weight: PropTypes.Requireable<NonNullable<number | "default" | "bold" | "medium" | "light" | "regular" | "semibold">>;
|
|
68
68
|
};
|
|
69
69
|
static defaultProps: {
|
|
70
70
|
copyable: boolean;
|
package/lib/es/_base/base.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* shadow */
|
|
2
2
|
/* sizing */
|
|
3
3
|
/* spacing */
|
|
4
|
-
body {
|
|
4
|
+
body, :host {
|
|
5
5
|
--semi-transition_duration-slowest:0ms;
|
|
6
6
|
--semi-transition_duration-slower:0ms;
|
|
7
7
|
--semi-transition_duration-slow:0ms;
|
|
@@ -38,8 +38,7 @@ body {
|
|
|
38
38
|
--semi-transform_rotate-anticlockwise360deg:rotate(-360deg);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
body,
|
|
42
|
-
body .semi-always-light {
|
|
41
|
+
body, body .semi-always-light, :host, :host .semi-always-light {
|
|
43
42
|
--semi-amber-0: 254,251,235;
|
|
44
43
|
--semi-amber-1: 252,245,206;
|
|
45
44
|
--semi-amber-2: 249,232,158;
|
|
@@ -204,8 +203,7 @@ body .semi-always-light {
|
|
|
204
203
|
--semi-yellow-9: 83,72,0;
|
|
205
204
|
}
|
|
206
205
|
|
|
207
|
-
body[theme-mode=dark],
|
|
208
|
-
body .semi-always-dark {
|
|
206
|
+
body[theme-mode=dark], body .semi-always-dark, :host-context(body[theme-mode=dark]), :host .semi-always-dark {
|
|
209
207
|
--semi-red-0: 108,9,11;
|
|
210
208
|
--semi-red-1: 144,17,16;
|
|
211
209
|
--semi-red-2: 180,32,25;
|
|
@@ -370,7 +368,7 @@ body .semi-always-dark {
|
|
|
370
368
|
--semi-black: 0, 0, 0;
|
|
371
369
|
}
|
|
372
370
|
|
|
373
|
-
body, body[theme-mode=dark] .semi-always-light {
|
|
371
|
+
body, body[theme-mode=dark] .semi-always-light, :host, :host .semi-always-light {
|
|
374
372
|
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
375
373
|
-webkit-font-smoothing: antialiased;
|
|
376
374
|
--semi-color-white: rgba(var(--semi-white), 1);
|
|
@@ -480,7 +478,7 @@ body, body[theme-mode=dark] .semi-always-light {
|
|
|
480
478
|
--semi-color-data-19: rgba(188, 198, 255, 1);
|
|
481
479
|
}
|
|
482
480
|
|
|
483
|
-
body[theme-mode=dark], body .semi-always-dark {
|
|
481
|
+
body[theme-mode=dark], body .semi-always-dark, :host-context(body[theme-mode=dark]), :host .semi-always-dark {
|
|
484
482
|
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
485
483
|
-webkit-font-smoothing: antialiased;
|
|
486
484
|
--semi-color-white: rgba(228, 231, 245, 1);
|
package/lib/es/anchor/index.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ declare class Anchor extends BaseComponent<AnchorProps, AnchorState> {
|
|
|
40
40
|
static contextType: React.Context<ContextValue>;
|
|
41
41
|
static Link: typeof Link;
|
|
42
42
|
static PropTypes: {
|
|
43
|
-
size: PropTypes.Requireable<"
|
|
43
|
+
size: PropTypes.Requireable<"default" | "small">;
|
|
44
44
|
railTheme: PropTypes.Requireable<"primary" | "tertiary" | "muted">;
|
|
45
45
|
className: PropTypes.Requireable<string>;
|
|
46
46
|
style: PropTypes.Requireable<object>;
|
|
@@ -125,7 +125,7 @@ declare class AutoComplete<T extends AutoCompleteItems> extends BaseComponent<Au
|
|
|
125
125
|
renderSelectedItem: PropTypes.Requireable<(...args: any[]) => any>;
|
|
126
126
|
suffix: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
127
127
|
showClear: PropTypes.Requireable<boolean>;
|
|
128
|
-
size: PropTypes.Requireable<"
|
|
128
|
+
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
129
129
|
style: PropTypes.Requireable<object>;
|
|
130
130
|
stopPropagation: PropTypes.Requireable<NonNullable<string | boolean>>;
|
|
131
131
|
maxHeight: PropTypes.Requireable<NonNullable<string | number>>;
|
|
@@ -147,7 +147,8 @@ class AutoComplete extends BaseComponent {
|
|
|
147
147
|
const triggerDom = this.triggerRef && this.triggerRef.current;
|
|
148
148
|
const optionsDom = ReactDOM.findDOMNode(optionInstance);
|
|
149
149
|
const target = e.target;
|
|
150
|
-
|
|
150
|
+
const path = e.composedPath && e.composedPath() || [target];
|
|
151
|
+
if (optionsDom && (!optionsDom.contains(target) || !optionsDom.contains(target.parentNode)) && triggerDom && !triggerDom.contains(target) && !(path.includes(triggerDom) || path.includes(optionsDom))) {
|
|
151
152
|
cb(e);
|
|
152
153
|
}
|
|
153
154
|
};
|
|
@@ -26,6 +26,7 @@ export default class BackTop extends BaseComponent<BackTopProps, BackTopState> {
|
|
|
26
26
|
style: PropTypes.Requireable<object>;
|
|
27
27
|
className: PropTypes.Requireable<string>;
|
|
28
28
|
};
|
|
29
|
+
handler: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
29
30
|
constructor(props: BackTopProps);
|
|
30
31
|
componentDidMount(): void;
|
|
31
32
|
componentWillUnmount(): void;
|
package/lib/es/backtop/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _throttle from "lodash/throttle";
|
|
1
2
|
var __rest = this && this.__rest || function (s, e) {
|
|
2
3
|
var t = {};
|
|
3
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -27,7 +28,9 @@ export default class BackTop extends BaseComponent {
|
|
|
27
28
|
this.foundation = new BackTopFoundation(this.adapter);
|
|
28
29
|
}
|
|
29
30
|
componentDidMount() {
|
|
31
|
+
var _a;
|
|
30
32
|
this.foundation.init();
|
|
33
|
+
this.handler = _throttle(this.handleClick, (_a = this.props.duration) !== null && _a !== void 0 ? _a : BackTop.defaultProps.duration);
|
|
31
34
|
}
|
|
32
35
|
componentWillUnmount() {
|
|
33
36
|
this.foundation.destroy();
|
|
@@ -85,7 +88,7 @@ export default class BackTop extends BaseComponent {
|
|
|
85
88
|
React.createElement("div", Object.assign({}, others, {
|
|
86
89
|
className: preCls,
|
|
87
90
|
style: style,
|
|
88
|
-
onClick: e => this.
|
|
91
|
+
onClick: e => this.handler(e),
|
|
89
92
|
"x-semi-prop": "children"
|
|
90
93
|
}), backtopBtn) : null;
|
|
91
94
|
return content;
|
|
@@ -47,7 +47,7 @@ export default class Button extends PureComponent<ButtonProps> {
|
|
|
47
47
|
disabled: PropTypes.Requireable<boolean>;
|
|
48
48
|
prefixCls: PropTypes.Requireable<string>;
|
|
49
49
|
style: PropTypes.Requireable<object>;
|
|
50
|
-
size: PropTypes.Requireable<"
|
|
50
|
+
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
51
51
|
type: PropTypes.Requireable<"warning" | "primary" | "secondary" | "danger" | "tertiary">;
|
|
52
52
|
block: PropTypes.Requireable<boolean>;
|
|
53
53
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -18,7 +18,7 @@ export default class ButtonGroup extends BaseComponent<ButtonGroupProps> {
|
|
|
18
18
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
19
19
|
disabled: PropTypes.Requireable<boolean>;
|
|
20
20
|
type: PropTypes.Requireable<string>;
|
|
21
|
-
size: PropTypes.Requireable<"
|
|
21
|
+
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
22
22
|
theme: PropTypes.Requireable<"solid" | "light" | "borderless">;
|
|
23
23
|
'aria-label': PropTypes.Requireable<string>;
|
|
24
24
|
};
|
package/lib/es/button/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ declare class Button extends React.PureComponent<ButtonProps> {
|
|
|
23
23
|
onMouseEnter: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
24
24
|
onMouseLeave: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
25
25
|
disabled: import("prop-types").Requireable<boolean>;
|
|
26
|
-
size: import("prop-types").Requireable<"
|
|
26
|
+
size: import("prop-types").Requireable<"default" | "small" | "large">;
|
|
27
27
|
type: import("prop-types").Requireable<"warning" | "primary" | "secondary" | "danger" | "tertiary">;
|
|
28
28
|
block: import("prop-types").Requireable<boolean>;
|
|
29
29
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
@@ -279,7 +279,9 @@ export default class monthCalendar extends BaseComponent {
|
|
|
279
279
|
const clickOutsideHandler = e => {
|
|
280
280
|
const cardInstance = this.cardRef && this.cardRef.get(key);
|
|
281
281
|
const cardDom = ReactDOM.findDOMNode(cardInstance);
|
|
282
|
-
|
|
282
|
+
const target = e.target;
|
|
283
|
+
const path = e.composedPath && e.composedPath() || [target];
|
|
284
|
+
if (cardDom && !cardDom.contains(target) && !path.includes(cardDom)) {
|
|
283
285
|
cb();
|
|
284
286
|
}
|
|
285
287
|
};
|
package/lib/es/cascader/index.js
CHANGED
|
@@ -561,7 +561,8 @@ class Cascader extends BaseComponent {
|
|
|
561
561
|
const triggerDom = this.triggerRef && this.triggerRef.current;
|
|
562
562
|
const optionsDom = ReactDOM.findDOMNode(optionInstance);
|
|
563
563
|
const target = e.target;
|
|
564
|
-
|
|
564
|
+
const path = e.composedPath && e.composedPath() || [target];
|
|
565
|
+
if (optionsDom && (!optionsDom.contains(target) || !optionsDom.contains(target.parentNode)) && triggerDom && !triggerDom.contains(target) && !(path.includes(triggerDom) || path.includes(optionsDom))) {
|
|
565
566
|
cb(e);
|
|
566
567
|
}
|
|
567
568
|
};
|
|
@@ -731,9 +732,9 @@ class Cascader extends BaseComponent {
|
|
|
731
732
|
}, []);
|
|
732
733
|
return formatKeys;
|
|
733
734
|
};
|
|
734
|
-
const needUpdateTreeData = needUpdate('treeData') || needUpdateData();
|
|
735
|
-
const needUpdateValue = needUpdate('value') || _isEmpty(prevProps) && defaultValue;
|
|
736
735
|
if (multiple) {
|
|
736
|
+
const needUpdateTreeData = needUpdate('treeData') || needUpdateData();
|
|
737
|
+
const needUpdateValue = needUpdate('value') || _isEmpty(prevProps) && defaultValue;
|
|
737
738
|
// when value and treedata need updated
|
|
738
739
|
if (needUpdateTreeData || needUpdateValue) {
|
|
739
740
|
// update state.keyEntities
|
|
@@ -781,8 +782,11 @@ class Cascader extends BaseComponent {
|
|
|
781
782
|
this.foundation.destroy();
|
|
782
783
|
}
|
|
783
784
|
componentDidUpdate(prevProps) {
|
|
785
|
+
if (this.props.multiple) {
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
784
788
|
let isOptionsChanged = false;
|
|
785
|
-
if (!_isEqual(prevProps.treeData, this.props.treeData)
|
|
789
|
+
if (!_isEqual(prevProps.treeData, this.props.treeData)) {
|
|
786
790
|
isOptionsChanged = true;
|
|
787
791
|
this.foundation.collectOptions();
|
|
788
792
|
}
|
|
@@ -59,7 +59,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
59
59
|
'aria-required': PropTypes.Requireable<boolean>;
|
|
60
60
|
borderless: PropTypes.Requireable<boolean>;
|
|
61
61
|
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "monthRange" | "dateTimeRange">;
|
|
62
|
-
size: PropTypes.Requireable<"
|
|
62
|
+
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
63
63
|
clearIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
64
64
|
density: PropTypes.Requireable<"default" | "compact">;
|
|
65
65
|
defaultValue: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
@@ -266,15 +266,11 @@ export default class DatePicker extends BaseComponent {
|
|
|
266
266
|
this.clickOutSideHandler = e => {
|
|
267
267
|
const triggerEl = this.triggerElRef && this.triggerElRef.current;
|
|
268
268
|
const panelEl = this.panelRef && this.panelRef.current;
|
|
269
|
-
const
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
return;
|
|
275
|
-
} else {
|
|
276
|
-
if (clickOutSide) {
|
|
277
|
-
this.props.onClickOutSide();
|
|
269
|
+
const target = e.target;
|
|
270
|
+
const path = e.composedPath && e.composedPath() || [target];
|
|
271
|
+
if (!(triggerEl && triggerEl.contains(target)) && !(panelEl && panelEl.contains(target)) && !(path.includes(triggerEl) || path.includes(panelEl))) {
|
|
272
|
+
this.props.onClickOutSide();
|
|
273
|
+
if (!this.adapter.needConfirm()) {
|
|
278
274
|
this.foundation.closePanel(e);
|
|
279
275
|
}
|
|
280
276
|
}
|
|
@@ -86,7 +86,7 @@ export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGri
|
|
|
86
86
|
renderMonth(month: Date, panelType: PanelType): JSX.Element;
|
|
87
87
|
handleWeeksRowNumChange: (weeksRowNum: number, panelType: PanelType) => void;
|
|
88
88
|
reselect: () => void;
|
|
89
|
-
getYAMOpenType: () => "
|
|
89
|
+
getYAMOpenType: () => "both" | "none" | "left" | "right";
|
|
90
90
|
renderTimePicker(panelType: PanelType, panelDetail: MonthInfo): JSX.Element;
|
|
91
91
|
renderYearAndMonth(panelType: PanelType, panelDetail: MonthInfo): JSX.Element;
|
|
92
92
|
renderSwitch(panelType: PanelType): JSX.Element;
|
|
@@ -86,7 +86,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
|
|
|
86
86
|
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
87
87
|
zIndex?: number;
|
|
88
88
|
position?: "left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
|
|
89
|
-
onSearch?: (value: string, event: React.
|
|
89
|
+
onSearch?: (value: string, event: React.KeyboardEvent<Element> | React.MouseEvent<Element, MouseEvent>) => void;
|
|
90
90
|
dropdownClassName?: string;
|
|
91
91
|
dropdownStyle?: React.CSSProperties;
|
|
92
92
|
dropdownMargin?: number | {
|
|
@@ -140,7 +140,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
|
|
|
140
140
|
preventScroll?: boolean;
|
|
141
141
|
showRestTagsPopover?: boolean;
|
|
142
142
|
restTagsPopoverProps?: import("../popover").PopoverProps;
|
|
143
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
143
|
+
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "motion" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
144
144
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
145
145
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
|
|
146
146
|
static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
|
package/lib/es/form/field.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
32
32
|
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
33
33
|
zIndex?: number;
|
|
34
34
|
position?: "left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
|
|
35
|
-
onSearch?: (value: string, event: import("react").
|
|
35
|
+
onSearch?: (value: string, event: import("react").KeyboardEvent<Element> | import("react").MouseEvent<Element, MouseEvent>) => void;
|
|
36
36
|
dropdownClassName?: string;
|
|
37
37
|
dropdownStyle?: import("react").CSSProperties;
|
|
38
38
|
dropdownMargin?: number | {
|
|
@@ -86,7 +86,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
86
86
|
preventScroll?: boolean;
|
|
87
87
|
showRestTagsPopover?: boolean;
|
|
88
88
|
restTagsPopoverProps?: import("../popover").PopoverProps;
|
|
89
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
89
|
+
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "motion" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
90
90
|
declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
|
91
91
|
declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
92
92
|
declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
package/lib/es/input/index.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ declare class Input extends BaseComponent<InputProps, InputState> {
|
|
|
86
86
|
showClear: PropTypes.Requireable<boolean>;
|
|
87
87
|
hideSuffix: PropTypes.Requireable<boolean>;
|
|
88
88
|
placeholder: PropTypes.Requireable<any>;
|
|
89
|
-
size: PropTypes.Requireable<"
|
|
89
|
+
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
90
90
|
className: PropTypes.Requireable<string>;
|
|
91
91
|
style: PropTypes.Requireable<object>;
|
|
92
92
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
|
|
@@ -21,7 +21,7 @@ export default class inputGroup extends BaseComponent<InputGroupProps, InputGrou
|
|
|
21
21
|
static propTypes: {
|
|
22
22
|
className: PropTypes.Requireable<string>;
|
|
23
23
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
24
|
-
size: PropTypes.Requireable<"
|
|
24
|
+
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
25
25
|
style: PropTypes.Requireable<object>;
|
|
26
26
|
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|