@douyinfe/semi-ui 2.48.0-beta.0 → 2.49.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/dist/css/semi.css +4 -0
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +92 -53
- 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/banner/index.d.ts +2 -2
- package/lib/cjs/banner/index.js +2 -2
- package/lib/cjs/breadcrumb/item.d.ts +1 -1
- package/lib/cjs/breadcrumb/item.js +1 -1
- package/lib/cjs/calendar/dayCalendar.d.ts +1 -0
- package/lib/cjs/calendar/dayCalendar.js +4 -1
- package/lib/cjs/calendar/dayCol.d.ts +2 -0
- package/lib/cjs/calendar/dayCol.js +6 -6
- package/lib/cjs/calendar/index.d.ts +1 -0
- package/lib/cjs/calendar/index.js +1 -0
- package/lib/cjs/calendar/interface.d.ts +2 -1
- package/lib/cjs/calendar/rangeCalendar.js +4 -2
- package/lib/cjs/calendar/weekCalendar.js +4 -2
- package/lib/cjs/dropdown/dropdownItem.js +2 -1
- package/lib/cjs/form/baseForm.js +2 -2
- package/lib/cjs/modal/Modal.d.ts +1 -1
- package/lib/cjs/modal/Modal.js +1 -1
- package/lib/cjs/navigation/SubNav.d.ts +1 -1
- package/lib/cjs/navigation/SubNav.js +1 -1
- package/lib/cjs/popconfirm/index.d.ts +1 -1
- package/lib/cjs/popconfirm/index.js +1 -1
- package/lib/cjs/select/utils.d.ts +1 -1
- package/lib/cjs/select/utils.js +16 -4
- package/lib/cjs/sideSheet/SideSheetContent.d.ts +3 -1
- package/lib/cjs/sideSheet/SideSheetContent.js +6 -3
- package/lib/cjs/table/Body/BaseRow.d.ts +3 -0
- package/lib/cjs/table/Body/BaseRow.js +4 -1
- package/lib/cjs/table/Body/ExpandedRow.d.ts +1 -0
- package/lib/cjs/table/Body/ExpandedRow.js +4 -2
- package/lib/cjs/table/Body/index.d.ts +3 -0
- package/lib/cjs/table/Body/index.js +18 -10
- package/lib/cjs/table/interface.d.ts +1 -0
- package/lib/cjs/timePicker/TimePicker.d.ts +3 -0
- package/lib/cjs/timePicker/TimePicker.js +7 -3
- package/lib/cjs/timePicker/index.d.ts +2 -0
- package/lib/cjs/toast/toast.d.ts +1 -1
- package/lib/cjs/toast/toast.js +1 -1
- package/lib/cjs/typography/util.js +5 -6
- package/lib/es/banner/index.d.ts +2 -2
- package/lib/es/banner/index.js +2 -2
- package/lib/es/breadcrumb/item.d.ts +1 -1
- package/lib/es/breadcrumb/item.js +1 -1
- package/lib/es/calendar/dayCalendar.d.ts +1 -0
- package/lib/es/calendar/dayCalendar.js +4 -1
- package/lib/es/calendar/dayCol.d.ts +2 -0
- package/lib/es/calendar/dayCol.js +6 -6
- package/lib/es/calendar/index.d.ts +1 -0
- package/lib/es/calendar/index.js +1 -0
- package/lib/es/calendar/interface.d.ts +2 -1
- package/lib/es/calendar/rangeCalendar.js +4 -2
- package/lib/es/calendar/weekCalendar.js +4 -2
- package/lib/es/dropdown/dropdownItem.js +2 -1
- package/lib/es/form/baseForm.js +2 -2
- package/lib/es/modal/Modal.d.ts +1 -1
- package/lib/es/modal/Modal.js +1 -1
- package/lib/es/navigation/SubNav.d.ts +1 -1
- package/lib/es/navigation/SubNav.js +1 -1
- package/lib/es/popconfirm/index.d.ts +1 -1
- package/lib/es/popconfirm/index.js +1 -1
- package/lib/es/select/utils.d.ts +1 -1
- package/lib/es/select/utils.js +16 -4
- package/lib/es/sideSheet/SideSheetContent.d.ts +3 -1
- package/lib/es/sideSheet/SideSheetContent.js +6 -3
- package/lib/es/table/Body/BaseRow.d.ts +3 -0
- package/lib/es/table/Body/BaseRow.js +4 -1
- package/lib/es/table/Body/ExpandedRow.d.ts +1 -0
- package/lib/es/table/Body/ExpandedRow.js +4 -2
- package/lib/es/table/Body/index.d.ts +3 -0
- package/lib/es/table/Body/index.js +18 -10
- package/lib/es/table/interface.d.ts +1 -0
- package/lib/es/timePicker/TimePicker.d.ts +3 -0
- package/lib/es/timePicker/TimePicker.js +7 -3
- package/lib/es/timePicker/index.d.ts +2 -0
- package/lib/es/toast/toast.d.ts +1 -1
- package/lib/es/toast/toast.js +1 -1
- package/lib/es/typography/util.js +5 -6
- package/package.json +8 -8
|
@@ -301,7 +301,8 @@ class Body extends BaseComponent {
|
|
|
301
301
|
expanded,
|
|
302
302
|
index,
|
|
303
303
|
rowKey,
|
|
304
|
-
virtualized
|
|
304
|
+
virtualized,
|
|
305
|
+
displayNone
|
|
305
306
|
} = props;
|
|
306
307
|
let key = getRecordKey(record, rowKey);
|
|
307
308
|
if (key == null) {
|
|
@@ -327,7 +328,8 @@ class Body extends BaseComponent {
|
|
|
327
328
|
index: index,
|
|
328
329
|
virtualized: virtualized,
|
|
329
330
|
key: genExpandedRowKey(key),
|
|
330
|
-
cellWidths: _this.cellWidths
|
|
331
|
+
cellWidths: _this.cellWidths,
|
|
332
|
+
displayNone: displayNone
|
|
331
333
|
});
|
|
332
334
|
};
|
|
333
335
|
/**
|
|
@@ -339,7 +341,8 @@ class Body extends BaseComponent {
|
|
|
339
341
|
groups,
|
|
340
342
|
dataSource: data,
|
|
341
343
|
rowKey,
|
|
342
|
-
expandedRowKeys
|
|
344
|
+
expandedRowKeys,
|
|
345
|
+
keepDOM
|
|
343
346
|
} = this.props;
|
|
344
347
|
const {
|
|
345
348
|
flattenedColumns
|
|
@@ -374,7 +377,7 @@ class Body extends BaseComponent {
|
|
|
374
377
|
expanded
|
|
375
378
|
})));
|
|
376
379
|
// Render the grouped content when the group is expanded
|
|
377
|
-
if (expanded) {
|
|
380
|
+
if (expanded || keepDOM) {
|
|
378
381
|
const dataInGroup = [];
|
|
379
382
|
group.forEach(recordKey => {
|
|
380
383
|
const record = getRecord(data, recordKey, rowKey);
|
|
@@ -385,7 +388,7 @@ class Body extends BaseComponent {
|
|
|
385
388
|
/**
|
|
386
389
|
* Render the contents of the group row
|
|
387
390
|
*/
|
|
388
|
-
renderedRows.push(this.renderBodyRows(dataInGroup));
|
|
391
|
+
renderedRows.push(this.renderBodyRows(dataInGroup, undefined, [], !expanded));
|
|
389
392
|
}
|
|
390
393
|
});
|
|
391
394
|
return renderedRows;
|
|
@@ -629,12 +632,14 @@ class Body extends BaseComponent {
|
|
|
629
632
|
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
630
633
|
let level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
631
634
|
let renderedRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
635
|
+
let displayNone = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
632
636
|
const {
|
|
633
637
|
rowKey,
|
|
634
638
|
expandedRowRender,
|
|
635
639
|
expandedRowKeys,
|
|
636
640
|
childrenRecordName,
|
|
637
|
-
rowExpandable
|
|
641
|
+
rowExpandable,
|
|
642
|
+
keepDOM
|
|
638
643
|
} = this.props;
|
|
639
644
|
const hasExpandedRowRender = typeof expandedRowRender === 'function';
|
|
640
645
|
const expandBtnShouldInRow = this.state.cachedExpandBtnShouldInRow;
|
|
@@ -651,6 +656,7 @@ class Body extends BaseComponent {
|
|
|
651
656
|
renderedRows.push(this.renderBaseRow(Object.assign(Object.assign({}, this.props), {
|
|
652
657
|
columns: flattenedColumns,
|
|
653
658
|
expandBtnShouldInRow,
|
|
659
|
+
displayNone,
|
|
654
660
|
record,
|
|
655
661
|
key,
|
|
656
662
|
level,
|
|
@@ -658,13 +664,15 @@ class Body extends BaseComponent {
|
|
|
658
664
|
})));
|
|
659
665
|
// render expand row
|
|
660
666
|
const expanded = isExpanded(expandedRowKeys, key);
|
|
661
|
-
|
|
667
|
+
const shouldRenderExpandedRows = expanded || keepDOM;
|
|
668
|
+
if (hasExpandedRowRender && rowExpandable && rowExpandable(record) && shouldRenderExpandedRows) {
|
|
662
669
|
const currentExpandRow = this.renderExpandedRow(Object.assign(Object.assign({}, this.props), {
|
|
663
670
|
columns: flattenedColumns,
|
|
664
671
|
level,
|
|
665
672
|
index,
|
|
666
673
|
record,
|
|
667
|
-
expanded
|
|
674
|
+
expanded,
|
|
675
|
+
displayNone: displayNone || !expanded
|
|
668
676
|
}));
|
|
669
677
|
/**
|
|
670
678
|
* If expandedRowRender returns falsy, this expanded row will not be rendered
|
|
@@ -675,8 +683,8 @@ class Body extends BaseComponent {
|
|
|
675
683
|
}
|
|
676
684
|
}
|
|
677
685
|
// render tree data
|
|
678
|
-
if (recordHasChildren &&
|
|
679
|
-
const nestedRows = this.renderBodyRows(recordChildren, level + 1);
|
|
686
|
+
if (recordHasChildren && shouldRenderExpandedRows) {
|
|
687
|
+
const nestedRows = this.renderBodyRows(recordChildren, level + 1, [], displayNone || !expanded);
|
|
680
688
|
renderedRows.push(...nestedRows);
|
|
681
689
|
}
|
|
682
690
|
});
|
|
@@ -63,6 +63,7 @@ export type TimePickerProps = {
|
|
|
63
63
|
secondStep?: number;
|
|
64
64
|
showClear?: boolean;
|
|
65
65
|
size?: InputSize;
|
|
66
|
+
stopPropagation: boolean;
|
|
66
67
|
style?: React.CSSProperties;
|
|
67
68
|
timeZone?: string | number;
|
|
68
69
|
triggerRender?: (props?: any) => React.ReactNode;
|
|
@@ -133,6 +134,7 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
|
|
|
133
134
|
focusOnOpen: PropTypes.Requireable<boolean>;
|
|
134
135
|
autoFocus: PropTypes.Requireable<boolean>;
|
|
135
136
|
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
137
|
+
stopPropagation: PropTypes.Requireable<boolean>;
|
|
136
138
|
panels: PropTypes.Requireable<PropTypes.InferProps<{
|
|
137
139
|
panelHeader: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
138
140
|
panelFooter: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
@@ -166,6 +168,7 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
|
|
|
166
168
|
prefixCls: string;
|
|
167
169
|
inputReadOnly: boolean;
|
|
168
170
|
style: {};
|
|
171
|
+
stopPropagation: boolean;
|
|
169
172
|
className: string;
|
|
170
173
|
popupClassName: string;
|
|
171
174
|
popupStyle: {
|
|
@@ -262,9 +262,10 @@ export default class TimePicker extends BaseComponent {
|
|
|
262
262
|
scrollItemProps,
|
|
263
263
|
triggerRender,
|
|
264
264
|
motion,
|
|
265
|
-
autoAdjustOverflow
|
|
265
|
+
autoAdjustOverflow,
|
|
266
|
+
stopPropagation
|
|
266
267
|
} = _a,
|
|
267
|
-
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"]);
|
|
268
|
+
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"]);
|
|
268
269
|
const format = this.foundation.getDefaultFormatIfNeed();
|
|
269
270
|
const position = this.foundation.getPosition();
|
|
270
271
|
const useCustomTrigger = typeof triggerRender === 'function';
|
|
@@ -322,7 +323,8 @@ export default class TimePicker extends BaseComponent {
|
|
|
322
323
|
visible: disabled ? false : Boolean(open),
|
|
323
324
|
motion: motion,
|
|
324
325
|
margin: dropdownMargin,
|
|
325
|
-
autoAdjustOverflow: autoAdjustOverflow
|
|
326
|
+
autoAdjustOverflow: autoAdjustOverflow,
|
|
327
|
+
stopPropagation: stopPropagation
|
|
326
328
|
}, useCustomTrigger ? /*#__PURE__*/React.createElement(Trigger, {
|
|
327
329
|
triggerRender: triggerRender,
|
|
328
330
|
disabled: disabled,
|
|
@@ -377,6 +379,7 @@ TimePicker.propTypes = Object.assign(Object.assign({
|
|
|
377
379
|
focusOnOpen: PropTypes.bool,
|
|
378
380
|
autoFocus: PropTypes.bool,
|
|
379
381
|
size: PropTypes.oneOf(strings.SIZE),
|
|
382
|
+
stopPropagation: PropTypes.bool,
|
|
380
383
|
panels: PropTypes.arrayOf(PropTypes.shape(PanelShape)),
|
|
381
384
|
onFocus: PropTypes.func,
|
|
382
385
|
onBlur: PropTypes.func,
|
|
@@ -410,6 +413,7 @@ TimePicker.defaultProps = Object.assign({
|
|
|
410
413
|
prefixCls: cssClasses.PREFIX,
|
|
411
414
|
inputReadOnly: false,
|
|
412
415
|
style: {},
|
|
416
|
+
stopPropagation: true,
|
|
413
417
|
className: '',
|
|
414
418
|
popupClassName: '',
|
|
415
419
|
popupStyle: {
|
|
@@ -50,6 +50,7 @@ export default class LocaleTimePicker extends React.PureComponent<LocalePickerPr
|
|
|
50
50
|
focusOnOpen: import("prop-types").Requireable<boolean>;
|
|
51
51
|
autoFocus: import("prop-types").Requireable<boolean>;
|
|
52
52
|
size: import("prop-types").Requireable<"default" | "small" | "large">;
|
|
53
|
+
stopPropagation: import("prop-types").Requireable<boolean>;
|
|
53
54
|
panels: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
54
55
|
panelHeader: import("prop-types").Requireable<NonNullable<import("prop-types").ReactNodeLike>>;
|
|
55
56
|
panelFooter: import("prop-types").Requireable<NonNullable<import("prop-types").ReactNodeLike>>;
|
|
@@ -83,6 +84,7 @@ export default class LocaleTimePicker extends React.PureComponent<LocalePickerPr
|
|
|
83
84
|
prefixCls: string;
|
|
84
85
|
inputReadOnly: boolean;
|
|
85
86
|
style: {};
|
|
87
|
+
stopPropagation: boolean;
|
|
86
88
|
className: string;
|
|
87
89
|
popupClassName: string;
|
|
88
90
|
popupStyle: {
|
package/lib/es/toast/toast.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ declare class Toast extends BaseComponent<ToastReactProps, ToastState> {
|
|
|
32
32
|
showClose: PropTypes.Requireable<boolean>;
|
|
33
33
|
stack: PropTypes.Requireable<boolean>;
|
|
34
34
|
stackExpanded: PropTypes.Requireable<boolean>;
|
|
35
|
-
icon: PropTypes.Requireable<
|
|
35
|
+
icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
36
36
|
direction: PropTypes.Requireable<string>;
|
|
37
37
|
};
|
|
38
38
|
static defaultProps: {
|
package/lib/es/toast/toast.js
CHANGED
|
@@ -150,7 +150,7 @@ Toast.propTypes = {
|
|
|
150
150
|
showClose: PropTypes.bool,
|
|
151
151
|
stack: PropTypes.bool,
|
|
152
152
|
stackExpanded: PropTypes.bool,
|
|
153
|
-
icon: PropTypes.
|
|
153
|
+
icon: PropTypes.node,
|
|
154
154
|
direction: PropTypes.oneOf(strings.directions)
|
|
155
155
|
};
|
|
156
156
|
Toast.defaultProps = {
|
|
@@ -42,7 +42,6 @@ const getRenderText = function (originEle, rows) {
|
|
|
42
42
|
const lineHeight = pxToNumber(originStyle.lineHeight);
|
|
43
43
|
const maxHeight = Math.round(lineHeight * (rows + 1) + pxToNumber(originStyle.paddingTop) + pxToNumber(originStyle.paddingBottom));
|
|
44
44
|
// Set shadow
|
|
45
|
-
const maxWidth = parseInt(originStyle.width);
|
|
46
45
|
ellipsisContainer.setAttribute('style', originCSS);
|
|
47
46
|
ellipsisContainer.style.position = 'fixed';
|
|
48
47
|
ellipsisContainer.style.left = '0';
|
|
@@ -54,12 +53,12 @@ const getRenderText = function (originEle, rows) {
|
|
|
54
53
|
ellipsisContainer.style.webkitLineClamp = 'none';
|
|
55
54
|
// Render fake container
|
|
56
55
|
ReactDOM.render( /*#__PURE__*/React.createElement(React.Fragment, null), ellipsisContainer);
|
|
57
|
-
// Check if ellipsis in measure div is
|
|
56
|
+
// Check if ellipsis in measure div is enough for content
|
|
58
57
|
function inRange() {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return
|
|
58
|
+
// If content does not wrap due to line break strategy, width should be judged to determine whether it's in range
|
|
59
|
+
const widthInRange = ellipsisContainer.scrollWidth <= ellipsisContainer.offsetWidth;
|
|
60
|
+
const heightInRange = ellipsisContainer.scrollHeight < maxHeight;
|
|
61
|
+
return rows === 1 ? widthInRange && heightInRange : heightInRange;
|
|
63
62
|
}
|
|
64
63
|
// ========================= Find match ellipsis content =========================
|
|
65
64
|
// Create origin content holder
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.49.0-beta.0",
|
|
4
4
|
"description": "A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"@dnd-kit/core": "^6.0.8",
|
|
21
21
|
"@dnd-kit/sortable": "^7.0.2",
|
|
22
22
|
"@dnd-kit/utilities": "^3.2.1",
|
|
23
|
-
"@douyinfe/semi-animation": "2.
|
|
24
|
-
"@douyinfe/semi-animation-react": "2.
|
|
25
|
-
"@douyinfe/semi-foundation": "2.
|
|
26
|
-
"@douyinfe/semi-icons": "2.
|
|
27
|
-
"@douyinfe/semi-illustrations": "2.
|
|
28
|
-
"@douyinfe/semi-theme-default": "2.
|
|
23
|
+
"@douyinfe/semi-animation": "2.49.0-beta.0",
|
|
24
|
+
"@douyinfe/semi-animation-react": "2.49.0-beta.0",
|
|
25
|
+
"@douyinfe/semi-foundation": "2.49.0-beta.0",
|
|
26
|
+
"@douyinfe/semi-icons": "2.49.0-beta.0",
|
|
27
|
+
"@douyinfe/semi-illustrations": "2.49.0-beta.0",
|
|
28
|
+
"@douyinfe/semi-theme-default": "2.49.0-beta.0",
|
|
29
29
|
"async-validator": "^3.5.0",
|
|
30
30
|
"classnames": "^2.2.6",
|
|
31
31
|
"copy-text-to-clipboard": "^2.1.1",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
],
|
|
76
76
|
"author": "",
|
|
77
77
|
"license": "MIT",
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "aa959f0cd22894b27c019eb78254ba9b991f80b3",
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
81
81
|
"@babel/plugin-transform-runtime": "^7.15.8",
|