@douyinfe/semi-ui 2.38.2-alpha.1 → 2.38.2-alpha.2-patch-modal
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 +45 -2
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +78 -88
- 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/collapsible/index.d.ts +2 -0
- package/lib/cjs/collapsible/index.js +19 -11
- package/lib/cjs/dropdown/dropdownItem.js +11 -1
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/input/textarea.js +1 -1
- package/lib/cjs/modal/Modal.js +9 -6
- package/lib/cjs/modal/ModalContent.js +5 -4
- package/lib/cjs/modal/confirm.d.ts +3 -3
- package/lib/cjs/scrollList/scrollItem.js +1 -1
- package/lib/cjs/select/option.js +2 -1
- package/lib/cjs/spin/icon.js +14 -51
- package/lib/cjs/table/Body/index.js +1 -1
- package/lib/cjs/table/TableCell.js +7 -1
- package/lib/cjs/table/interface.d.ts +9 -0
- package/lib/cjs/treeSelect/index.d.ts +1 -1
- package/lib/cjs/treeSelect/index.js +2 -2
- package/lib/es/collapsible/index.d.ts +2 -0
- package/lib/es/collapsible/index.js +19 -11
- package/lib/es/dropdown/dropdownItem.js +11 -1
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/input/textarea.js +1 -1
- package/lib/es/modal/Modal.js +9 -6
- package/lib/es/modal/ModalContent.js +5 -4
- package/lib/es/modal/confirm.d.ts +3 -3
- package/lib/es/scrollList/scrollItem.js +1 -1
- package/lib/es/select/option.js +2 -1
- package/lib/es/spin/icon.js +14 -51
- package/lib/es/table/Body/index.js +1 -1
- package/lib/es/table/TableCell.js +7 -1
- package/lib/es/table/interface.d.ts +9 -0
- package/lib/es/treeSelect/index.d.ts +1 -1
- package/lib/es/treeSelect/index.js +2 -2
- package/package.json +8 -8
|
@@ -278,20 +278,21 @@ export default class ModalContent extends BaseComponent {
|
|
|
278
278
|
this.foundation.destroy();
|
|
279
279
|
}
|
|
280
280
|
render() {
|
|
281
|
-
|
|
281
|
+
var _a;
|
|
282
|
+
const _b = this.props,
|
|
282
283
|
{
|
|
283
284
|
maskClosable,
|
|
284
285
|
className,
|
|
285
286
|
getPopupContainer,
|
|
286
287
|
maskFixed,
|
|
287
288
|
getContainerContext
|
|
288
|
-
} =
|
|
289
|
-
rest = __rest(
|
|
289
|
+
} = _b,
|
|
290
|
+
rest = __rest(_b, ["maskClosable", "className", "getPopupContainer", "maskFixed", "getContainerContext"]);
|
|
290
291
|
const {
|
|
291
292
|
direction
|
|
292
293
|
} = this.context;
|
|
293
294
|
const classList = cls(className, {
|
|
294
|
-
[`${cssClasses.DIALOG}-popup`]: getPopupContainer && !maskFixed,
|
|
295
|
+
[`${cssClasses.DIALOG}-popup`]: getPopupContainer && getPopupContainer() !== ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.body) && !maskFixed,
|
|
295
296
|
[`${cssClasses.DIALOG}-fixed`]: maskFixed,
|
|
296
297
|
[`${cssClasses.DIALOG}-rtl`]: direction === 'rtl'
|
|
297
298
|
});
|
|
@@ -145,11 +145,11 @@ export declare function withError(props: ModalReactProps): {
|
|
|
145
145
|
size?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").Size;
|
|
146
146
|
style?: React.CSSProperties;
|
|
147
147
|
className?: string;
|
|
148
|
+
motion?: boolean;
|
|
148
149
|
getPopupContainer?: () => HTMLElement;
|
|
149
150
|
footer?: React.ReactNode;
|
|
150
151
|
header?: React.ReactNode;
|
|
151
152
|
direction?: any;
|
|
152
|
-
motion?: boolean;
|
|
153
153
|
width?: string | number;
|
|
154
154
|
height?: string | number;
|
|
155
155
|
mask?: boolean;
|
|
@@ -204,10 +204,10 @@ export declare function withError(props: ModalReactProps): {
|
|
|
204
204
|
title?: string;
|
|
205
205
|
name?: string;
|
|
206
206
|
value?: string | number | readonly string[];
|
|
207
|
-
form?: string;
|
|
208
|
-
slot?: string;
|
|
209
207
|
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
210
208
|
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
209
|
+
form?: string;
|
|
210
|
+
slot?: string;
|
|
211
211
|
hidden?: boolean;
|
|
212
212
|
color?: string;
|
|
213
213
|
content?: string;
|
|
@@ -243,8 +243,8 @@ export default class ScrollItem extends BaseComponent {
|
|
|
243
243
|
key: prefixKey + index
|
|
244
244
|
}, events, {
|
|
245
245
|
className: cls,
|
|
246
|
+
// eslint-disable-next-line jsx-a11y/role-has-required-aria-props
|
|
246
247
|
role: "option",
|
|
247
|
-
"aria-selected": selected,
|
|
248
248
|
"aria-disabled": item.disabled
|
|
249
249
|
}), text)
|
|
250
250
|
);
|
package/lib/es/select/option.js
CHANGED
package/lib/es/spin/icon.js
CHANGED
|
@@ -8,64 +8,27 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
8
8
|
};
|
|
9
9
|
/* eslint-disable no-unused-vars */
|
|
10
10
|
import React from 'react';
|
|
11
|
-
import isNullOrUndefined from '@douyinfe/semi-foundation/lib/es/utils/isNullOrUndefined';
|
|
12
|
-
let _id = -1;
|
|
13
11
|
function Icon() {
|
|
14
12
|
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
15
13
|
const {
|
|
16
|
-
id
|
|
14
|
+
id,
|
|
17
15
|
className
|
|
18
16
|
} = props,
|
|
19
17
|
rest = __rest(props, ["id", "className"]);
|
|
20
|
-
let _propsId = propsId;
|
|
21
|
-
if (isNullOrUndefined(_propsId)) {
|
|
22
|
-
_id++;
|
|
23
|
-
_propsId = _id;
|
|
24
|
-
}
|
|
25
|
-
const id = `linearGradient-${_propsId}`;
|
|
26
18
|
return /*#__PURE__*/React.createElement("svg", Object.assign({}, rest, {
|
|
27
19
|
className: className,
|
|
28
|
-
width: "
|
|
29
|
-
height: "
|
|
30
|
-
viewBox: "0 0
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, /*#__PURE__*/React.createElement("stop", {
|
|
42
|
-
stopColor: "currentColor",
|
|
43
|
-
stopOpacity: "0",
|
|
44
|
-
offset: "0%"
|
|
45
|
-
}), /*#__PURE__*/React.createElement("stop", {
|
|
46
|
-
stopColor: "currentColor",
|
|
47
|
-
stopOpacity: "0.50",
|
|
48
|
-
offset: "39.9430698%"
|
|
49
|
-
}), /*#__PURE__*/React.createElement("stop", {
|
|
50
|
-
stopColor: "currentColor",
|
|
51
|
-
offset: "100%"
|
|
52
|
-
}))), /*#__PURE__*/React.createElement("g", {
|
|
53
|
-
stroke: "none",
|
|
54
|
-
strokeWidth: "1",
|
|
55
|
-
fill: "none",
|
|
56
|
-
fillRule: "evenodd"
|
|
57
|
-
}, /*#__PURE__*/React.createElement("rect", {
|
|
58
|
-
fillOpacity: "0.01",
|
|
59
|
-
fill: "none",
|
|
60
|
-
x: "0",
|
|
61
|
-
y: "0",
|
|
62
|
-
width: "36",
|
|
63
|
-
height: "36"
|
|
64
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
65
|
-
d: "M34,18 C34,9.163444 26.836556,2 18,2 C11.6597233,2 6.18078805,5.68784135 3.59122325,11.0354951",
|
|
66
|
-
stroke: `url(#${id})`,
|
|
67
|
-
strokeWidth: "4",
|
|
68
|
-
strokeLinecap: "round"
|
|
69
|
-
})));
|
|
20
|
+
width: "100%",
|
|
21
|
+
height: "100%",
|
|
22
|
+
viewBox: "0 0 100 100"
|
|
23
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
24
|
+
cx: "50",
|
|
25
|
+
cy: "50",
|
|
26
|
+
r: "35",
|
|
27
|
+
stroke: "currentColor",
|
|
28
|
+
strokeWidth: "11",
|
|
29
|
+
strokeLinecap: "round",
|
|
30
|
+
strokeMiterlimit: "10",
|
|
31
|
+
fill: "none"
|
|
32
|
+
}));
|
|
70
33
|
}
|
|
71
34
|
export default Icon;
|
|
@@ -496,7 +496,7 @@ class Body extends BaseComponent {
|
|
|
496
496
|
if (props.virtualized) {
|
|
497
497
|
getVirtualizedListRef(this.listRef);
|
|
498
498
|
} else {
|
|
499
|
-
console.warn('getVirtualizedListRef only works with virtualized. ' + 'See https://semi.design/
|
|
499
|
+
console.warn('getVirtualizedListRef only works with virtualized. ' + 'See https://semi.design/en-US/show/table for more information.');
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
502
|
this.foundation = new BodyFoundation(this.adapter);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _merge from "lodash/merge";
|
|
2
1
|
import _isEqual from "lodash/isEqual";
|
|
2
|
+
import _merge from "lodash/merge";
|
|
3
3
|
import _omit from "lodash/omit";
|
|
4
4
|
import _set from "lodash/set";
|
|
5
5
|
import _noop from "lodash/noop";
|
|
@@ -72,6 +72,12 @@ export default class TableCell extends BaseComponent {
|
|
|
72
72
|
expandIcon
|
|
73
73
|
} = props;
|
|
74
74
|
const cellInSelectionColumn = isSelectionColumn(column);
|
|
75
|
+
const {
|
|
76
|
+
shouldCellUpdate
|
|
77
|
+
} = column;
|
|
78
|
+
if (typeof shouldCellUpdate === 'function') {
|
|
79
|
+
return shouldCellUpdate(nextProps, props);
|
|
80
|
+
}
|
|
75
81
|
// The expand button may be in a separate column or in the first data column
|
|
76
82
|
const columnHasExpandIcon = isExpandedColumn(column) || expandIcon;
|
|
77
83
|
if ((cellInSelectionColumn || columnHasExpandIcon) && !_isEqual(nextProps, this.props)) {
|
|
@@ -8,6 +8,7 @@ import { ArrayElement } from '../_base/base';
|
|
|
8
8
|
import { strings } from '@douyinfe/semi-foundation/lib/es/table/constants';
|
|
9
9
|
import { BaseRowKeyType, BaseSortOrder, BaseGroupBy, BaseGroupByFn, BaseFixed, BaseAlign, BaseChangeInfoSorter, BaseSorter, BaseFilter, BaseChangeInfoFilter, BaseIncludeGroupRecord, BaseEllipsis } from '@douyinfe/semi-foundation/lib/es/table/foundation';
|
|
10
10
|
import { ScrollDirection, CSSDirection } from 'react-window';
|
|
11
|
+
import { TableCellProps } from './TableCell';
|
|
11
12
|
export interface TableProps<RecordType extends Record<string, any> = any> extends BaseProps {
|
|
12
13
|
bordered?: boolean;
|
|
13
14
|
children?: ReactNode;
|
|
@@ -90,6 +91,10 @@ export interface ColumnProps<RecordType extends Record<string, any> = any> {
|
|
|
90
91
|
onFilterDropdownVisibleChange?: OnFilterDropdownVisibleChange;
|
|
91
92
|
onHeaderCell?: OnHeaderCell<RecordType>;
|
|
92
93
|
ellipsis?: BaseEllipsis;
|
|
94
|
+
/**
|
|
95
|
+
* self control whether to update cell for performance reasons
|
|
96
|
+
*/
|
|
97
|
+
shouldCellUpdate?: (props: TableCellProps, prevProps: TableCellProps) => boolean;
|
|
93
98
|
}
|
|
94
99
|
export type Align = BaseAlign;
|
|
95
100
|
export type SortOrder = BaseSortOrder;
|
|
@@ -211,6 +216,10 @@ export interface RowSelectionProps<RecordType> {
|
|
|
211
216
|
onChange?: RowSelectionOnChange<RecordType>;
|
|
212
217
|
onSelect?: RowSelectionOnSelect<RecordType>;
|
|
213
218
|
onSelectAll?: RowSelectionOnSelectAll<RecordType>;
|
|
219
|
+
/**
|
|
220
|
+
* self control whether to update cell for performance reasons
|
|
221
|
+
*/
|
|
222
|
+
shouldCellUpdate?: (props: TableCellProps, prevProps: TableCellProps) => boolean;
|
|
214
223
|
}
|
|
215
224
|
export type GetCheckboxProps<RecordType> = (record: RecordType) => CheckboxProps;
|
|
216
225
|
export type RowSelectionOnChange<RecordType> = (selectedRowKeys?: (string | number)[], selectedRows?: RecordType[]) => void;
|
|
@@ -228,7 +228,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
|
|
|
228
228
|
renderArrow: () => JSX.Element;
|
|
229
229
|
renderClearBtn: () => JSX.Element;
|
|
230
230
|
renderSelection: () => JSX.Element;
|
|
231
|
-
renderTagItem: (key: string, idx: number) =>
|
|
231
|
+
renderTagItem: (key: string, idx: number) => any;
|
|
232
232
|
renderTagInput: () => JSX.Element;
|
|
233
233
|
renderInput: () => JSX.Element;
|
|
234
234
|
renderEmpty: () => JSX.Element;
|
|
@@ -192,7 +192,7 @@ class TreeSelect extends BaseComponent {
|
|
|
192
192
|
} = item && treeNodeLabelProp in item ? renderSelectedItem(item, {
|
|
193
193
|
index,
|
|
194
194
|
onClose
|
|
195
|
-
}) :
|
|
195
|
+
}) : {};
|
|
196
196
|
if (_isNull(content) || _isUndefined(content)) {
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
@@ -490,7 +490,7 @@ class TreeSelect extends BaseComponent {
|
|
|
490
490
|
} = item && treeNodeLabelProp in item ? renderSelectedItem(item, {
|
|
491
491
|
index: idx,
|
|
492
492
|
onClose
|
|
493
|
-
}) :
|
|
493
|
+
}) : {};
|
|
494
494
|
if (isRenderInTag) {
|
|
495
495
|
return /*#__PURE__*/React.createElement(Tag, Object.assign({}, tagProps), content);
|
|
496
496
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.38.2-alpha.
|
|
3
|
+
"version": "2.38.2-alpha.2-patch-modal",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"lib/*"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@douyinfe/semi-animation": "2.38.2-alpha.
|
|
21
|
-
"@douyinfe/semi-animation-react": "2.38.2-alpha.
|
|
22
|
-
"@douyinfe/semi-foundation": "2.38.2-alpha.
|
|
23
|
-
"@douyinfe/semi-icons": "2.38.2-alpha.
|
|
24
|
-
"@douyinfe/semi-illustrations": "2.38.2-alpha.
|
|
25
|
-
"@douyinfe/semi-theme-default": "2.38.2-alpha.
|
|
20
|
+
"@douyinfe/semi-animation": "2.38.2-alpha.2-patch-modal",
|
|
21
|
+
"@douyinfe/semi-animation-react": "2.38.2-alpha.2-patch-modal",
|
|
22
|
+
"@douyinfe/semi-foundation": "2.38.2-alpha.2-patch-modal",
|
|
23
|
+
"@douyinfe/semi-icons": "2.38.2-alpha.2-patch-modal",
|
|
24
|
+
"@douyinfe/semi-illustrations": "2.38.2-alpha.2-patch-modal",
|
|
25
|
+
"@douyinfe/semi-theme-default": "2.38.2-alpha.2-patch-modal",
|
|
26
26
|
"async-validator": "^3.5.0",
|
|
27
27
|
"classnames": "^2.2.6",
|
|
28
28
|
"copy-text-to-clipboard": "^2.1.1",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
],
|
|
70
70
|
"author": "",
|
|
71
71
|
"license": "MIT",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "0b01c3ee2c2e054522e1022f24f64fcc1b6ce6ac",
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
75
75
|
"@babel/plugin-transform-runtime": "^7.15.8",
|