@douyinfe/semi-ui 2.53.3 → 2.54.0-alpha.1
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 +29 -20
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +201 -67
- 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/anchor/index.d.ts +1 -1
- package/lib/cjs/autoComplete/index.d.ts +1 -1
- package/lib/cjs/button/Button.d.ts +1 -1
- package/lib/cjs/button/index.d.ts +1 -1
- package/lib/cjs/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/cjs/carousel/index.d.ts +1 -1
- package/lib/cjs/cascader/index.d.ts +3 -0
- package/lib/cjs/cascader/index.js +11 -4
- package/lib/cjs/collapsible/index.d.ts +1 -0
- package/lib/cjs/collapsible/index.js +4 -3
- package/lib/cjs/datePicker/datePicker.d.ts +2 -2
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/datePicker/quickControl.d.ts +1 -1
- package/lib/cjs/datePicker/yearAndMonth.d.ts +1 -1
- package/lib/cjs/descriptions/descriptions-context.d.ts +2 -0
- package/lib/cjs/descriptions/index.d.ts +17 -4
- package/lib/cjs/descriptions/index.js +52 -16
- package/lib/cjs/descriptions/item.d.ts +1 -0
- package/lib/cjs/descriptions/item.js +20 -13
- package/lib/cjs/dropdown/index.d.ts +1 -1
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/image/interface.d.ts +1 -0
- package/lib/cjs/image/previewInner.js +6 -0
- package/lib/cjs/modal/Modal.d.ts +4 -4
- package/lib/cjs/modal/Modal.js +12 -11
- package/lib/cjs/modal/confirm.d.ts +100 -100
- package/lib/cjs/overflowList/index.d.ts +1 -1
- package/lib/cjs/popover/index.d.ts +1 -1
- package/lib/cjs/radio/radio.d.ts +1 -1
- package/lib/cjs/radio/radioGroup.d.ts +1 -1
- package/lib/cjs/select/index.d.ts +1 -1
- package/lib/cjs/slider/index.js +4 -2
- package/lib/cjs/table/Column.d.ts +1 -1
- package/lib/cjs/table/ColumnShape.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/toast/index.js +3 -0
- package/lib/cjs/tooltip/index.d.ts +1 -1
- package/lib/cjs/typography/base.js +6 -4
- package/lib/cjs/upload/index.d.ts +3 -3
- package/lib/es/anchor/index.d.ts +1 -1
- package/lib/es/autoComplete/index.d.ts +1 -1
- package/lib/es/button/Button.d.ts +1 -1
- package/lib/es/button/index.d.ts +1 -1
- package/lib/es/carousel/CarouselIndicator.d.ts +1 -1
- package/lib/es/carousel/index.d.ts +1 -1
- package/lib/es/cascader/index.d.ts +3 -0
- package/lib/es/cascader/index.js +11 -4
- package/lib/es/collapsible/index.d.ts +1 -0
- package/lib/es/collapsible/index.js +4 -3
- package/lib/es/datePicker/datePicker.d.ts +2 -2
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/datePicker/quickControl.d.ts +1 -1
- package/lib/es/datePicker/yearAndMonth.d.ts +1 -1
- package/lib/es/descriptions/descriptions-context.d.ts +2 -0
- package/lib/es/descriptions/index.d.ts +17 -4
- package/lib/es/descriptions/index.js +52 -14
- package/lib/es/descriptions/item.d.ts +1 -0
- package/lib/es/descriptions/item.js +20 -13
- package/lib/es/dropdown/index.d.ts +1 -1
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/image/interface.d.ts +1 -0
- package/lib/es/image/previewInner.js +6 -0
- package/lib/es/modal/Modal.d.ts +4 -4
- package/lib/es/modal/Modal.js +12 -11
- package/lib/es/modal/confirm.d.ts +100 -100
- package/lib/es/overflowList/index.d.ts +1 -1
- package/lib/es/popover/index.d.ts +1 -1
- package/lib/es/radio/radio.d.ts +1 -1
- package/lib/es/radio/radioGroup.d.ts +1 -1
- package/lib/es/select/index.d.ts +1 -1
- package/lib/es/slider/index.js +4 -2
- package/lib/es/table/Column.d.ts +1 -1
- package/lib/es/table/ColumnShape.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/toast/index.js +3 -0
- package/lib/es/tooltip/index.d.ts +1 -1
- package/lib/es/typography/base.js +6 -4
- package/lib/es/upload/index.d.ts +3 -3
- package/package.json +8 -8
|
@@ -22,9 +22,8 @@ class Collapsible extends BaseComponent {
|
|
|
22
22
|
this.isChildrenInRenderTree = () => {
|
|
23
23
|
if (this.domRef.current) {
|
|
24
24
|
return this.domRef.current.offsetHeight > 0;
|
|
25
|
-
} else {
|
|
26
|
-
return false;
|
|
27
25
|
}
|
|
26
|
+
return false;
|
|
28
27
|
};
|
|
29
28
|
this.state = {
|
|
30
29
|
domInRenderTree: false,
|
|
@@ -108,6 +107,7 @@ class Collapsible extends BaseComponent {
|
|
|
108
107
|
const wrapperCls = cls(`${cssClasses.PREFIX}-wrapper`, {
|
|
109
108
|
[`${cssClasses.PREFIX}-transition`]: this.props.motion && this.state.isTransitioning
|
|
110
109
|
}, this.props.className);
|
|
110
|
+
const shouldRender = this.props.keepDOM && !this.props.lazyRender || this.props.collapseHeight !== 0 || this.state.visible || this.props.isOpen;
|
|
111
111
|
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
112
112
|
className: wrapperCls,
|
|
113
113
|
style: wrapperStyle,
|
|
@@ -126,7 +126,7 @@ class Collapsible extends BaseComponent {
|
|
|
126
126
|
overflow: 'hidden'
|
|
127
127
|
},
|
|
128
128
|
id: this.props.id
|
|
129
|
-
},
|
|
129
|
+
}, shouldRender && this.props.children));
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
Collapsible.__SemiComponentName__ = "Collapsible";
|
|
@@ -135,6 +135,7 @@ Collapsible.defaultProps = getDefaultPropsFromGlobalConfig(Collapsible.__SemiCom
|
|
|
135
135
|
duration: 250,
|
|
136
136
|
motion: true,
|
|
137
137
|
keepDOM: false,
|
|
138
|
+
lazyRender: true,
|
|
138
139
|
collapseHeight: 0,
|
|
139
140
|
fade: false
|
|
140
141
|
});
|
|
@@ -74,7 +74,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
74
74
|
max: PropTypes.Requireable<number>;
|
|
75
75
|
placeholder: PropTypes.Requireable<NonNullable<string | any[]>>;
|
|
76
76
|
presets: PropTypes.Requireable<any[]>;
|
|
77
|
-
presetPosition: PropTypes.Requireable<"left" | "
|
|
77
|
+
presetPosition: PropTypes.Requireable<"left" | "top" | "right" | "bottom">;
|
|
78
78
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
79
79
|
onChangeWithDateFirst: PropTypes.Requireable<boolean>;
|
|
80
80
|
weekStartsOn: PropTypes.Requireable<number>;
|
|
@@ -91,7 +91,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
91
91
|
insetLabel: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
92
92
|
insetLabelId: PropTypes.Requireable<string>;
|
|
93
93
|
zIndex: PropTypes.Requireable<number>;
|
|
94
|
-
position: PropTypes.Requireable<"left" | "
|
|
94
|
+
position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
|
|
95
95
|
getPopupContainer: PropTypes.Requireable<(...args: any[]) => any>;
|
|
96
96
|
onCancel: PropTypes.Requireable<(...args: any[]) => any>;
|
|
97
97
|
onConfirm: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -51,7 +51,7 @@ export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGri
|
|
|
51
51
|
onPanelChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
52
52
|
focusRecordsRef: PropTypes.Requireable<object>;
|
|
53
53
|
triggerRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
54
|
-
presetPosition: PropTypes.Requireable<"left" | "
|
|
54
|
+
presetPosition: PropTypes.Requireable<"left" | "top" | "right" | "bottom">;
|
|
55
55
|
renderQuickControls: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
56
56
|
renderDateInput: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
57
57
|
};
|
|
@@ -15,7 +15,7 @@ export interface QuickControlProps {
|
|
|
15
15
|
declare class QuickControl extends PureComponent<QuickControlProps> {
|
|
16
16
|
static propTypes: {
|
|
17
17
|
presets: PropTypes.Requireable<any[]>;
|
|
18
|
-
presetPosition: PropTypes.Requireable<"left" | "
|
|
18
|
+
presetPosition: PropTypes.Requireable<"left" | "top" | "right" | "bottom">;
|
|
19
19
|
onPresetClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
20
20
|
type: PropTypes.Requireable<string>;
|
|
21
21
|
insetInput: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
@@ -21,7 +21,7 @@ declare class YearAndMonth extends BaseComponent<YearAndMonthProps, YearAndMonth
|
|
|
21
21
|
noBackBtn: PropTypes.Requireable<boolean>;
|
|
22
22
|
disabledDate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
23
23
|
density: PropTypes.Requireable<string>;
|
|
24
|
-
presetPosition: PropTypes.Requireable<"left" | "
|
|
24
|
+
presetPosition: PropTypes.Requireable<"left" | "top" | "right" | "bottom">;
|
|
25
25
|
renderQuickControls: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
26
26
|
renderDateInput: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
27
27
|
type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "monthRange" | "dateTimeRange">;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type DescriptionsAlign = 'center' | 'justify' | 'left' | 'plain';
|
|
3
|
+
export type DescriptionLayout = 'horizontal' | 'vertical';
|
|
3
4
|
export interface DescriptionsContextValue {
|
|
4
5
|
align?: DescriptionsAlign;
|
|
6
|
+
layout?: DescriptionLayout;
|
|
5
7
|
}
|
|
6
8
|
declare const DescriptionsContext: React.Context<DescriptionsContextValue>;
|
|
7
9
|
export default DescriptionsContext;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import '@douyinfe/semi-foundation/lib/es/descriptions/descriptions.css';
|
|
4
|
-
import { DescriptionsAlign,
|
|
4
|
+
import { DescriptionsAlign, DescriptionLayout } from './descriptions-context';
|
|
5
5
|
import Item from './item';
|
|
6
|
+
import DescriptionsFoundation, { DescriptionsAdapter } from '@douyinfe/semi-foundation/lib/es/descriptions/foundation';
|
|
7
|
+
import BaseComponent from '../_base/baseComponent';
|
|
6
8
|
export type { DescriptionsItemProps } from './item';
|
|
7
9
|
export type DescriptionsSize = 'small' | 'medium' | 'large';
|
|
8
10
|
export interface Data {
|
|
9
11
|
key?: React.ReactNode;
|
|
10
12
|
value?: (() => React.ReactNode) | React.ReactNode;
|
|
11
13
|
hidden?: boolean;
|
|
14
|
+
span?: number;
|
|
12
15
|
}
|
|
13
16
|
export interface DescriptionsProps {
|
|
14
17
|
align?: DescriptionsAlign;
|
|
@@ -18,10 +21,12 @@ export interface DescriptionsProps {
|
|
|
18
21
|
className?: string;
|
|
19
22
|
children?: React.ReactNode;
|
|
20
23
|
data?: Data[];
|
|
24
|
+
layout?: DescriptionLayout;
|
|
25
|
+
column?: number;
|
|
21
26
|
}
|
|
22
|
-
declare class Descriptions extends
|
|
27
|
+
declare class Descriptions extends BaseComponent<DescriptionsProps> {
|
|
23
28
|
static Item: typeof Item;
|
|
24
|
-
static contextType: React.Context<DescriptionsContextValue>;
|
|
29
|
+
static contextType: React.Context<import("./descriptions-context").DescriptionsContextValue>;
|
|
25
30
|
static propTypes: {
|
|
26
31
|
align: PropTypes.Requireable<string>;
|
|
27
32
|
row: PropTypes.Requireable<boolean>;
|
|
@@ -35,13 +40,21 @@ declare class Descriptions extends PureComponent<DescriptionsProps> {
|
|
|
35
40
|
className: PropTypes.Requireable<string>;
|
|
36
41
|
style: PropTypes.Requireable<object>;
|
|
37
42
|
}>[]>;
|
|
43
|
+
layout: PropTypes.Requireable<string>;
|
|
44
|
+
column: PropTypes.Requireable<number>;
|
|
38
45
|
};
|
|
39
46
|
static defaultProps: {
|
|
40
47
|
align: string;
|
|
41
48
|
row: boolean;
|
|
42
49
|
size: string;
|
|
43
50
|
data: Data[];
|
|
51
|
+
layout: string;
|
|
52
|
+
column: number;
|
|
44
53
|
};
|
|
54
|
+
foundation: DescriptionsFoundation;
|
|
55
|
+
constructor(props: DescriptionsProps);
|
|
56
|
+
get adapter(): DescriptionsAdapter<DescriptionsProps>;
|
|
57
|
+
renderChildrenList: () => string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | JSX.Element[];
|
|
45
58
|
render(): JSX.Element;
|
|
46
59
|
}
|
|
47
60
|
export default Descriptions;
|
|
@@ -7,7 +7,7 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
7
7
|
}
|
|
8
8
|
return t;
|
|
9
9
|
};
|
|
10
|
-
import React
|
|
10
|
+
import React from 'react';
|
|
11
11
|
import cls from 'classnames';
|
|
12
12
|
import PropTypes from 'prop-types';
|
|
13
13
|
import { strings, cssClasses } from '@douyinfe/semi-foundation/lib/es/descriptions/constants';
|
|
@@ -15,8 +15,43 @@ import '@douyinfe/semi-foundation/lib/es/descriptions/descriptions.css';
|
|
|
15
15
|
import getDataAttr from '@douyinfe/semi-foundation/lib/es/utils/getDataAttr';
|
|
16
16
|
import DescriptionsContext from './descriptions-context';
|
|
17
17
|
import Item from './item';
|
|
18
|
+
import DescriptionsFoundation from '@douyinfe/semi-foundation/lib/es/descriptions/foundation';
|
|
19
|
+
import BaseComponent from '../_base/baseComponent';
|
|
18
20
|
const prefixCls = cssClasses.PREFIX;
|
|
19
|
-
class Descriptions extends
|
|
21
|
+
class Descriptions extends BaseComponent {
|
|
22
|
+
constructor(props) {
|
|
23
|
+
super(props);
|
|
24
|
+
this.renderChildrenList = () => {
|
|
25
|
+
const props = this.props;
|
|
26
|
+
const {
|
|
27
|
+
layout,
|
|
28
|
+
data,
|
|
29
|
+
children
|
|
30
|
+
} = props;
|
|
31
|
+
if (layout === 'horizontal') {
|
|
32
|
+
const horizontalList = this.foundation.getHorizontalList();
|
|
33
|
+
return horizontalList.map((row, index) => {
|
|
34
|
+
return /*#__PURE__*/React.createElement("tr", {
|
|
35
|
+
key: index
|
|
36
|
+
}, row.map((item, itemIndex) => _isPlainObject(item) ? /*#__PURE__*/React.createElement(Item, Object.assign({
|
|
37
|
+
itemKey: item.key
|
|
38
|
+
}, item, {
|
|
39
|
+
key: index + '-' + itemIndex
|
|
40
|
+
}), item.value) : null));
|
|
41
|
+
});
|
|
42
|
+
} else {
|
|
43
|
+
return data && data.length ? data.map((item, index) => _isPlainObject(item) ? /*#__PURE__*/React.createElement(Item, Object.assign({
|
|
44
|
+
itemKey: item.key
|
|
45
|
+
}, item, {
|
|
46
|
+
key: index
|
|
47
|
+
}), item.value) : null) : children;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
this.foundation = new DescriptionsFoundation(this.adapter);
|
|
51
|
+
}
|
|
52
|
+
get adapter() {
|
|
53
|
+
return Object.assign({}, super.adapter);
|
|
54
|
+
}
|
|
20
55
|
render() {
|
|
21
56
|
const _a = this.props,
|
|
22
57
|
{
|
|
@@ -26,27 +61,26 @@ class Descriptions extends PureComponent {
|
|
|
26
61
|
className,
|
|
27
62
|
style,
|
|
28
63
|
children,
|
|
29
|
-
data
|
|
64
|
+
data,
|
|
65
|
+
layout
|
|
30
66
|
} = _a,
|
|
31
|
-
rest = __rest(_a, ["align", "row", "size", "className", "style", "children", "data"]);
|
|
67
|
+
rest = __rest(_a, ["align", "row", "size", "className", "style", "children", "data", "layout"]);
|
|
32
68
|
const classNames = cls(prefixCls, className, {
|
|
33
69
|
[`${prefixCls}-${align}`]: !row,
|
|
34
70
|
[`${prefixCls}-double`]: row,
|
|
35
|
-
[`${prefixCls}-double-${size}`]: row
|
|
71
|
+
[`${prefixCls}-double-${size}`]: row,
|
|
72
|
+
[`${prefixCls}-horizontal`]: layout === 'horizontal',
|
|
73
|
+
[`${prefixCls}-vertical`]: layout === 'vertical'
|
|
36
74
|
});
|
|
37
|
-
const childrenList = data && data.length ? data.map((item, index) => _isPlainObject(item) ? /*#__PURE__*/React.createElement(Item, Object.assign({
|
|
38
|
-
itemKey: item.key
|
|
39
|
-
}, item, {
|
|
40
|
-
key: index
|
|
41
|
-
}), item.value) : null) : children;
|
|
42
75
|
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
43
76
|
className: classNames,
|
|
44
77
|
style: style
|
|
45
78
|
}, getDataAttr(rest)), /*#__PURE__*/React.createElement("table", null, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement(DescriptionsContext.Provider, {
|
|
46
79
|
value: {
|
|
47
|
-
align
|
|
80
|
+
align,
|
|
81
|
+
layout
|
|
48
82
|
}
|
|
49
|
-
},
|
|
83
|
+
}, this.renderChildrenList()))));
|
|
50
84
|
}
|
|
51
85
|
}
|
|
52
86
|
Descriptions.Item = Item;
|
|
@@ -63,12 +97,16 @@ Descriptions.propTypes = {
|
|
|
63
97
|
hidden: PropTypes.bool,
|
|
64
98
|
className: PropTypes.string,
|
|
65
99
|
style: PropTypes.object
|
|
66
|
-
}))
|
|
100
|
+
})),
|
|
101
|
+
layout: PropTypes.oneOf(strings.LAYOUT_SET),
|
|
102
|
+
column: PropTypes.number
|
|
67
103
|
};
|
|
68
104
|
Descriptions.defaultProps = {
|
|
69
105
|
align: 'center',
|
|
70
106
|
row: false,
|
|
71
107
|
size: 'medium',
|
|
72
|
-
data: []
|
|
108
|
+
data: [],
|
|
109
|
+
layout: 'vertical',
|
|
110
|
+
column: 3
|
|
73
111
|
};
|
|
74
112
|
export default Descriptions;
|
|
@@ -8,6 +8,7 @@ export interface DescriptionsItemProps {
|
|
|
8
8
|
children?: React.ReactNode | (() => React.ReactNode);
|
|
9
9
|
style?: React.CSSProperties;
|
|
10
10
|
itemKey?: React.ReactNode;
|
|
11
|
+
span?: number;
|
|
11
12
|
}
|
|
12
13
|
export default class Item extends PureComponent<DescriptionsItemProps> {
|
|
13
14
|
static propTypes: {
|
|
@@ -22,38 +22,45 @@ export default class Item extends PureComponent {
|
|
|
22
22
|
itemKey,
|
|
23
23
|
hidden,
|
|
24
24
|
className,
|
|
25
|
+
span,
|
|
25
26
|
style,
|
|
26
27
|
children
|
|
27
28
|
} = _a,
|
|
28
|
-
rest = __rest(_a, ["itemKey", "hidden", "className", "style", "children"]);
|
|
29
|
+
rest = __rest(_a, ["itemKey", "hidden", "className", "span", "style", "children"]);
|
|
29
30
|
const {
|
|
30
|
-
align
|
|
31
|
+
align,
|
|
32
|
+
layout
|
|
31
33
|
} = this.context;
|
|
32
34
|
if (hidden) {
|
|
33
35
|
return null;
|
|
34
36
|
}
|
|
35
|
-
const
|
|
36
|
-
className:
|
|
37
|
-
|
|
38
|
-
}, getDataAttr(rest)), /*#__PURE__*/React.createElement("td", {
|
|
39
|
-
className: `${prefixCls}-item`
|
|
37
|
+
const plainItem = /*#__PURE__*/React.createElement("td", {
|
|
38
|
+
className: `${prefixCls}-item`,
|
|
39
|
+
colSpan: span || 1
|
|
40
40
|
}, /*#__PURE__*/React.createElement("span", {
|
|
41
41
|
className: keyCls
|
|
42
42
|
}, itemKey, ":"), /*#__PURE__*/React.createElement("span", {
|
|
43
43
|
className: valCls
|
|
44
|
-
}, typeof children === 'function' ? children() : children))
|
|
45
|
-
|
|
46
|
-
style: style
|
|
47
|
-
}, getDataAttr(rest)), /*#__PURE__*/React.createElement("th", {
|
|
44
|
+
}, typeof children === 'function' ? children() : children));
|
|
45
|
+
const alignItem = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("th", {
|
|
48
46
|
className: `${prefixCls}-item ${prefixCls}-item-th`
|
|
49
47
|
}, /*#__PURE__*/React.createElement("span", {
|
|
50
48
|
className: keyCls
|
|
51
49
|
}, itemKey)), /*#__PURE__*/React.createElement("td", {
|
|
52
|
-
className: `${prefixCls}-item ${prefixCls}-item-td
|
|
50
|
+
className: `${prefixCls}-item ${prefixCls}-item-td`,
|
|
51
|
+
colSpan: span || 1
|
|
53
52
|
}, /*#__PURE__*/React.createElement("span", {
|
|
54
53
|
className: valCls
|
|
55
54
|
}, typeof children === 'function' ? children() : children)));
|
|
56
|
-
|
|
55
|
+
const item = align === 'plain' ? /*#__PURE__*/React.createElement("tr", Object.assign({
|
|
56
|
+
className: className,
|
|
57
|
+
style: style
|
|
58
|
+
}, getDataAttr(rest)), plainItem) : /*#__PURE__*/React.createElement("tr", Object.assign({
|
|
59
|
+
className: className,
|
|
60
|
+
style: style
|
|
61
|
+
}, getDataAttr(rest)), alignItem);
|
|
62
|
+
const horizontalItem = align === 'plain' ? plainItem : alignItem;
|
|
63
|
+
return layout === 'horizontal' ? horizontalItem : item;
|
|
57
64
|
}
|
|
58
65
|
}
|
|
59
66
|
Item.propTypes = {
|
|
@@ -66,7 +66,7 @@ declare class Dropdown extends BaseComponent<DropdownProps, DropdownState> {
|
|
|
66
66
|
motion: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
67
67
|
onVisibleChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
68
68
|
prefixCls: PropTypes.Requireable<string>;
|
|
69
|
-
position: PropTypes.Requireable<"left" | "
|
|
69
|
+
position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
|
|
70
70
|
rePosKey: PropTypes.Requireable<NonNullable<string | number>>;
|
|
71
71
|
render: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
72
72
|
spacing: PropTypes.Requireable<NonNullable<number | object>>;
|
|
@@ -85,7 +85,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
|
|
|
85
85
|
expandRestTagsOnClick?: boolean;
|
|
86
86
|
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
87
87
|
zIndex?: number;
|
|
88
|
-
position?: "left" | "
|
|
88
|
+
position?: "left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
|
|
89
89
|
onSearch?: (value: string, event: React.KeyboardEvent<Element> | React.MouseEvent<Element, MouseEvent>) => void;
|
|
90
90
|
dropdownClassName?: string;
|
|
91
91
|
dropdownStyle?: React.CSSProperties;
|
package/lib/es/form/field.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
31
31
|
expandRestTagsOnClick?: boolean;
|
|
32
32
|
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
33
33
|
zIndex?: number;
|
|
34
|
-
position?: "left" | "
|
|
34
|
+
position?: "left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver";
|
|
35
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;
|
|
@@ -71,6 +71,7 @@ export interface PreviewProps extends BaseProps {
|
|
|
71
71
|
onRatioChange?: (type: RatioType) => void;
|
|
72
72
|
onRotateLeft?: (angle: number) => void;
|
|
73
73
|
onDownload?: (src: string, index: number) => void;
|
|
74
|
+
onDownloadError?: (src: string) => void;
|
|
74
75
|
setDownloadName?: (src: string) => string;
|
|
75
76
|
}
|
|
76
77
|
export interface PreviewInnerProps extends Omit<PreviewProps, "previewCls" | "previewStyle"> {
|
|
@@ -91,6 +91,12 @@ export default class PreviewInner extends BaseComponent {
|
|
|
91
91
|
} = this.props;
|
|
92
92
|
_isFunction(onDownload) && onDownload(src, index);
|
|
93
93
|
},
|
|
94
|
+
notifyDownloadError: src => {
|
|
95
|
+
const {
|
|
96
|
+
onDownloadError
|
|
97
|
+
} = this.props;
|
|
98
|
+
_isFunction(onDownloadError) && onDownloadError(src);
|
|
99
|
+
},
|
|
94
100
|
registerKeyDownListener: () => {
|
|
95
101
|
window && window.addEventListener("keydown", this.handleKeyDown);
|
|
96
102
|
},
|
package/lib/es/modal/Modal.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '@douyinfe/semi-foundation/lib/es/modal/modal.css';
|
|
2
2
|
import ModalFoundation, { ModalAdapter, ModalProps, ModalState } from '@douyinfe/semi-foundation/lib/es/modal/modalFoundation';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import '
|
|
4
|
+
import React, { CSSProperties, ReactNode } from 'react';
|
|
5
5
|
import BaseComponent from '../_base/baseComponent';
|
|
6
|
-
import useModal from './useModal';
|
|
7
6
|
import { ButtonProps } from '../button/Button';
|
|
8
|
-
|
|
7
|
+
import useModal from './useModal';
|
|
8
|
+
export declare let destroyFns: any[];
|
|
9
9
|
export type ConfirmType = 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
10
10
|
export type Directions = 'ltr' | 'rtl';
|
|
11
11
|
export type { ModalState };
|
package/lib/es/modal/Modal.js
CHANGED
|
@@ -7,22 +7,22 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
7
7
|
}
|
|
8
8
|
return t;
|
|
9
9
|
};
|
|
10
|
-
import React from 'react';
|
|
11
10
|
import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/modal/constants';
|
|
12
|
-
import
|
|
11
|
+
import '@douyinfe/semi-foundation/lib/es/modal/modal.css';
|
|
13
12
|
import ModalFoundation from '@douyinfe/semi-foundation/lib/es/modal/modalFoundation';
|
|
14
|
-
import ModalContent from './ModalContent';
|
|
15
|
-
import Portal from '../_portal';
|
|
16
|
-
import LocaleConsumer from '../locale/localeConsumer';
|
|
17
13
|
import cls from 'classnames';
|
|
18
14
|
import PropTypes from 'prop-types';
|
|
19
|
-
import '
|
|
15
|
+
import React from 'react';
|
|
20
16
|
import BaseComponent from '../_base/baseComponent';
|
|
21
|
-
import confirm, { withConfirm, withError, withInfo, withSuccess, withWarning } from './confirm';
|
|
22
|
-
import useModal from './useModal';
|
|
23
17
|
import CSSAnimation from "../_cssAnimation";
|
|
18
|
+
import Portal from '../_portal';
|
|
24
19
|
import { getDefaultPropsFromGlobalConfig, getScrollbarWidth } from '../_utils';
|
|
25
|
-
|
|
20
|
+
import Button from '../button';
|
|
21
|
+
import LocaleConsumer from '../locale/localeConsumer';
|
|
22
|
+
import ModalContent from './ModalContent';
|
|
23
|
+
import confirm, { withConfirm, withError, withInfo, withSuccess, withWarning } from './confirm';
|
|
24
|
+
import useModal from './useModal';
|
|
25
|
+
export let destroyFns = [];
|
|
26
26
|
class Modal extends BaseComponent {
|
|
27
27
|
constructor(props) {
|
|
28
28
|
super(props);
|
|
@@ -349,11 +349,12 @@ Modal.confirm = function (props) {
|
|
|
349
349
|
return confirm(withConfirm(props));
|
|
350
350
|
};
|
|
351
351
|
Modal.destroyAll = function destroyAllFn() {
|
|
352
|
-
|
|
353
|
-
const close = destroyFns
|
|
352
|
+
for (let i = 0, len = destroyFns.length; i < len; i++) {
|
|
353
|
+
const close = destroyFns[i];
|
|
354
354
|
if (close) {
|
|
355
355
|
close();
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
+
destroyFns = [];
|
|
358
359
|
};
|
|
359
360
|
export default Modal;
|