@douyinfe/semi-ui 2.17.1 → 2.19.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/anchor/index.tsx +1 -1
- package/anchor/link.tsx +3 -4
- package/autoComplete/__test__/autoComplete.test.js +6 -6
- package/autoComplete/index.tsx +1 -1
- package/autoComplete/option.tsx +164 -0
- package/calendar/__test__/calendar.test.js +21 -2
- package/calendar/_story/calendar.stories.js +31 -0
- package/calendar/index.tsx +3 -1
- package/calendar/interface.ts +2 -1
- package/carousel/index.tsx +5 -5
- package/checkbox/checkbox.tsx +10 -2
- package/checkbox/checkboxGroup.tsx +2 -0
- package/dist/css/semi.css +160 -22
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +15144 -16407
- 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/form/_story/FieldProps/labelOptional.jsx +30 -0
- package/form/_story/form.stories.js +7 -0
- package/form/hoc/withField.tsx +1 -0
- package/form/label.tsx +21 -7
- package/gulpfile.js +3 -1
- package/lib/cjs/_base/base.css +35 -0
- package/lib/cjs/anchor/index.js +2 -1
- package/lib/cjs/anchor/link.d.ts +1 -1
- package/lib/cjs/anchor/link.js +9 -5
- package/lib/cjs/autoComplete/index.d.ts +1 -1
- package/lib/cjs/autoComplete/index.js +1 -1
- package/lib/cjs/autoComplete/option.d.ts +50 -0
- package/lib/cjs/autoComplete/option.js +218 -0
- package/lib/cjs/calendar/index.d.ts +2 -0
- package/lib/cjs/calendar/index.js +3 -1
- package/lib/cjs/calendar/interface.d.ts +2 -1
- package/lib/cjs/carousel/index.js +2 -2
- package/lib/cjs/checkbox/checkbox.d.ts +4 -0
- package/lib/cjs/checkbox/checkbox.js +9 -3
- package/lib/cjs/checkbox/checkboxGroup.js +4 -2
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/form/hoc/withField.js +2 -1
- package/lib/cjs/form/label.d.ts +8 -5
- package/lib/cjs/form/label.js +15 -4
- package/lib/cjs/locale/interface.d.ts +3 -0
- package/lib/cjs/locale/source/ar.js +3 -0
- package/lib/cjs/locale/source/de.js +3 -0
- package/lib/cjs/locale/source/en_GB.js +3 -0
- package/lib/cjs/locale/source/en_US.js +3 -0
- package/lib/cjs/locale/source/es.js +3 -0
- package/lib/cjs/locale/source/fr.js +3 -0
- package/lib/cjs/locale/source/id_ID.js +3 -0
- package/lib/cjs/locale/source/it.js +3 -0
- package/lib/cjs/locale/source/ja_JP.js +3 -0
- package/lib/cjs/locale/source/ko_KR.js +3 -0
- package/lib/cjs/locale/source/ms_MY.js +3 -0
- package/lib/cjs/locale/source/pt_BR.js +3 -0
- package/lib/cjs/locale/source/ru_RU.js +3 -0
- package/lib/cjs/locale/source/th_TH.js +3 -0
- package/lib/cjs/locale/source/tr_TR.js +3 -0
- package/lib/cjs/locale/source/vi_VN.js +3 -0
- package/lib/cjs/locale/source/zh_CN.js +3 -0
- package/lib/cjs/locale/source/zh_TW.js +3 -0
- package/lib/cjs/modal/Modal.js +0 -8
- package/lib/cjs/modal/ModalContent.js +4 -1
- package/lib/cjs/radio/radio.d.ts +2 -0
- package/lib/cjs/radio/radio.js +33 -8
- package/lib/cjs/radio/radioGroup.js +4 -2
- package/lib/cjs/tag/group.d.ts +3 -0
- package/lib/cjs/tag/group.js +24 -6
- package/lib/cjs/tag/index.d.ts +2 -1
- package/lib/cjs/tag/index.js +7 -5
- package/lib/cjs/tag/interface.d.ts +2 -1
- package/lib/cjs/tree/index.d.ts +3 -1
- package/lib/cjs/tree/index.js +23 -0
- package/lib/cjs/tree/interface.d.ts +4 -0
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/es/_base/base.css +35 -0
- package/lib/es/anchor/index.js +2 -1
- package/lib/es/anchor/link.d.ts +1 -1
- package/lib/es/anchor/link.js +9 -5
- package/lib/es/autoComplete/index.d.ts +1 -1
- package/lib/es/autoComplete/index.js +1 -1
- package/lib/es/autoComplete/option.d.ts +50 -0
- package/lib/es/autoComplete/option.js +188 -0
- package/lib/es/calendar/index.d.ts +2 -0
- package/lib/es/calendar/index.js +3 -1
- package/lib/es/calendar/interface.d.ts +2 -1
- package/lib/es/carousel/index.js +2 -2
- package/lib/es/checkbox/checkbox.d.ts +4 -0
- package/lib/es/checkbox/checkbox.js +10 -4
- package/lib/es/checkbox/checkboxGroup.js +4 -2
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/form/hoc/withField.js +2 -1
- package/lib/es/form/label.d.ts +8 -5
- package/lib/es/form/label.js +13 -4
- package/lib/es/locale/interface.d.ts +3 -0
- package/lib/es/locale/source/ar.js +3 -0
- package/lib/es/locale/source/de.js +3 -0
- package/lib/es/locale/source/en_GB.js +3 -0
- package/lib/es/locale/source/en_US.js +3 -0
- package/lib/es/locale/source/es.js +3 -0
- package/lib/es/locale/source/fr.js +3 -0
- package/lib/es/locale/source/id_ID.js +3 -0
- package/lib/es/locale/source/it.js +3 -0
- package/lib/es/locale/source/ja_JP.js +3 -0
- package/lib/es/locale/source/ko_KR.js +3 -0
- package/lib/es/locale/source/ms_MY.js +3 -0
- package/lib/es/locale/source/pt_BR.js +3 -0
- package/lib/es/locale/source/ru_RU.js +3 -0
- package/lib/es/locale/source/th_TH.js +3 -0
- package/lib/es/locale/source/tr_TR.js +3 -0
- package/lib/es/locale/source/vi_VN.js +3 -0
- package/lib/es/locale/source/zh_CN.js +3 -0
- package/lib/es/locale/source/zh_TW.js +3 -0
- package/lib/es/modal/Modal.js +0 -8
- package/lib/es/modal/ModalContent.js +4 -1
- package/lib/es/radio/radio.d.ts +2 -0
- package/lib/es/radio/radio.js +31 -8
- package/lib/es/radio/radioGroup.js +4 -2
- package/lib/es/tag/group.d.ts +3 -0
- package/lib/es/tag/group.js +24 -6
- package/lib/es/tag/index.d.ts +2 -1
- package/lib/es/tag/index.js +7 -5
- package/lib/es/tag/interface.d.ts +2 -1
- package/lib/es/tree/index.d.ts +3 -1
- package/lib/es/tree/index.js +22 -0
- package/lib/es/tree/interface.d.ts +4 -0
- package/lib/es/typography/title.d.ts +1 -1
- package/locale/interface.ts +3 -0
- package/locale/source/ar.ts +3 -0
- package/locale/source/de.ts +3 -0
- package/locale/source/en_GB.ts +3 -0
- package/locale/source/en_US.ts +3 -0
- package/locale/source/es.ts +3 -0
- package/locale/source/fr.ts +3 -0
- package/locale/source/id_ID.ts +3 -0
- package/locale/source/it.ts +3 -0
- package/locale/source/ja_JP.ts +3 -0
- package/locale/source/ko_KR.ts +3 -0
- package/locale/source/ms_MY.ts +3 -0
- package/locale/source/pt_BR.ts +3 -0
- package/locale/source/ru_RU.ts +3 -0
- package/locale/source/th_TH.ts +3 -0
- package/locale/source/tr_TR.ts +4 -1
- package/locale/source/vi_VN.ts +3 -0
- package/locale/source/zh_CN.ts +3 -0
- package/locale/source/zh_TW.ts +3 -0
- package/modal/Modal.tsx +0 -6
- package/modal/ModalContent.tsx +4 -1
- package/modal/__test__/modal.test.js +1 -1
- package/modal/_story/__snapshots__/modal.stories.tsx.snap +203 -0
- package/package.json +7 -7
- package/radio/_story/radio.stories.js +2 -2
- package/radio/radio.tsx +27 -5
- package/radio/radioGroup.tsx +2 -0
- package/rating/__test__/rating.test.js +1 -1
- package/select/__test__/select.test.js +11 -17
- package/select/_story/select.stories.js +6 -6
- package/steps/_story/steps.stories.js +3 -3
- package/switch/_story/switch.stories.js +4 -4
- package/switch/_story/switch.stories.tsx +4 -4
- package/tag/_story/tag.stories.js +57 -1
- package/tag/group.tsx +20 -3
- package/tag/index.tsx +6 -5
- package/tag/interface.ts +2 -1
- package/transfer/_story/transfer.stories.js +2 -2
- package/tree/_story/tree.stories.js +152 -3
- package/tree/index.tsx +16 -1
- package/tree/interface.ts +6 -0
- package/upload/_story/upload.stories.js +2 -2
- package/webpack.config.js +10 -2
package/lib/es/tag/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export default class Tag extends Component<TagProps, TagState> {
|
|
|
10
10
|
static defaultProps: TagProps;
|
|
11
11
|
static propTypes: {
|
|
12
12
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
13
|
+
tagKey: PropTypes.Requireable<PropTypes.Requireable<string> | PropTypes.Requireable<number>>;
|
|
13
14
|
size: PropTypes.Requireable<string>;
|
|
14
15
|
color: PropTypes.Requireable<string>;
|
|
15
16
|
type: PropTypes.Requireable<string>;
|
|
@@ -28,7 +29,7 @@ export default class Tag extends Component<TagProps, TagState> {
|
|
|
28
29
|
visible: boolean;
|
|
29
30
|
};
|
|
30
31
|
setVisible(visible: boolean): void;
|
|
31
|
-
close(e: React.MouseEvent<HTMLElement>, value: React.ReactNode): void;
|
|
32
|
+
close(e: React.MouseEvent<HTMLElement>, value: React.ReactNode, tagKey: string | number): void;
|
|
32
33
|
handleKeyDown(event: any): void;
|
|
33
34
|
renderAvatar(): JSX.Element;
|
|
34
35
|
render(): JSX.Element;
|
package/lib/es/tag/index.js
CHANGED
|
@@ -63,13 +63,13 @@ export default class Tag extends Component {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
close(e, value) {
|
|
66
|
+
close(e, value, tagKey) {
|
|
67
67
|
const {
|
|
68
68
|
onClose
|
|
69
69
|
} = this.props;
|
|
70
70
|
e.stopPropagation();
|
|
71
71
|
e.nativeEvent.stopImmediatePropagation();
|
|
72
|
-
onClose && onClose(value, e); // when user call e.preventDefault() in onClick callback, tag will not hidden
|
|
72
|
+
onClose && onClose(value, e, tagKey); // when user call e.preventDefault() in onClick callback, tag will not hidden
|
|
73
73
|
|
|
74
74
|
if (e.defaultPrevented) {
|
|
75
75
|
return;
|
|
@@ -88,7 +88,7 @@ export default class Tag extends Component {
|
|
|
88
88
|
switch (event.key) {
|
|
89
89
|
case "Backspace":
|
|
90
90
|
case "Delete":
|
|
91
|
-
closable && this.close(event, this.props.children);
|
|
91
|
+
closable && this.close(event, this.props.children, this.props.tagKey);
|
|
92
92
|
handlePrevent(event);
|
|
93
93
|
break;
|
|
94
94
|
|
|
@@ -125,6 +125,7 @@ export default class Tag extends Component {
|
|
|
125
125
|
|
|
126
126
|
const _a = this.props,
|
|
127
127
|
{
|
|
128
|
+
tagKey,
|
|
128
129
|
children,
|
|
129
130
|
size,
|
|
130
131
|
color,
|
|
@@ -138,7 +139,7 @@ export default class Tag extends Component {
|
|
|
138
139
|
avatarShape,
|
|
139
140
|
tabIndex
|
|
140
141
|
} = _a,
|
|
141
|
-
attr = __rest(_a, ["children", "size", "color", "closable", "visible", "onClose", "onClick", "className", "type", "avatarSrc", "avatarShape", "tabIndex"]);
|
|
142
|
+
attr = __rest(_a, ["tagKey", "children", "size", "color", "closable", "visible", "onClose", "onClick", "className", "type", "avatarSrc", "avatarShape", "tabIndex"]);
|
|
142
143
|
|
|
143
144
|
const {
|
|
144
145
|
visible: isVisible
|
|
@@ -171,7 +172,7 @@ export default class Tag extends Component {
|
|
|
171
172
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
172
173
|
React.createElement("div", {
|
|
173
174
|
className: "".concat(prefixCls, "-close"),
|
|
174
|
-
onClick: e => this.close(e, children)
|
|
175
|
+
onClick: e => this.close(e, children, tagKey)
|
|
175
176
|
}, /*#__PURE__*/React.createElement(IconClose, {
|
|
176
177
|
size: "small"
|
|
177
178
|
})) : null;
|
|
@@ -197,6 +198,7 @@ Tag.defaultProps = {
|
|
|
197
198
|
};
|
|
198
199
|
Tag.propTypes = {
|
|
199
200
|
children: PropTypes.node,
|
|
201
|
+
tagKey: PropTypes.oneOf([PropTypes.string, PropTypes.number]),
|
|
200
202
|
size: PropTypes.oneOf(tagSize),
|
|
201
203
|
color: PropTypes.oneOf(tagColors),
|
|
202
204
|
type: PropTypes.oneOf(tagType),
|
|
@@ -5,12 +5,13 @@ export declare type TagSize = 'default' | 'small' | 'large';
|
|
|
5
5
|
export declare type AvatarShape = 'circle' | 'square';
|
|
6
6
|
export interface TagProps {
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
+
tagKey?: string | number;
|
|
8
9
|
size?: TagSize;
|
|
9
10
|
color?: TagColor;
|
|
10
11
|
type?: TagType;
|
|
11
12
|
closable?: boolean;
|
|
12
13
|
visible?: boolean;
|
|
13
|
-
onClose?: (tagChildren: React.ReactNode, event: React.MouseEvent<HTMLElement
|
|
14
|
+
onClose?: (tagChildren: React.ReactNode, event: React.MouseEvent<HTMLElement>, tagKey: string | number) => void;
|
|
14
15
|
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
15
16
|
style?: React.CSSProperties;
|
|
16
17
|
className?: string;
|
package/lib/es/tree/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import BaseComponent from '../_base/baseComponent';
|
|
|
6
6
|
import Input from '../input/index';
|
|
7
7
|
import TreeNode from './treeNode';
|
|
8
8
|
import '@douyinfe/semi-foundation/lib/es/tree/tree.css';
|
|
9
|
-
import { TreeProps, TreeState, TreeNodeProps, TreeNodeData, FlattenNode, KeyEntity } from './interface';
|
|
9
|
+
import { TreeProps, TreeState, TreeNodeProps, TreeNodeData, FlattenNode, KeyEntity, ScrollData } from './interface';
|
|
10
10
|
export * from './interface';
|
|
11
11
|
export { AutoSizerProps } from './autoSizer';
|
|
12
12
|
declare class Tree extends BaseComponent<TreeProps, TreeState> {
|
|
@@ -102,6 +102,7 @@ declare class Tree extends BaseComponent<TreeProps, TreeState> {
|
|
|
102
102
|
onNodeClick: any;
|
|
103
103
|
onMotionEnd: any;
|
|
104
104
|
context: ContextValue;
|
|
105
|
+
virtualizedListRef: React.RefObject<any>;
|
|
105
106
|
constructor(props: TreeProps);
|
|
106
107
|
/**
|
|
107
108
|
* Process of getDerivedStateFromProps was inspired by rc-tree
|
|
@@ -110,6 +111,7 @@ declare class Tree extends BaseComponent<TreeProps, TreeState> {
|
|
|
110
111
|
static getDerivedStateFromProps(props: TreeProps, prevState: TreeState): Partial<TreeState>;
|
|
111
112
|
get adapter(): TreeAdapter;
|
|
112
113
|
search: (value: string) => void;
|
|
114
|
+
scrollTo: (scrollData: ScrollData) => void;
|
|
113
115
|
renderInput(): JSX.Element;
|
|
114
116
|
renderEmpty: () => JSX.Element;
|
|
115
117
|
onNodeSelect: (e: MouseEvent | KeyboardEvent, treeNode: TreeNodeProps) => void;
|
package/lib/es/tree/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import _isFunction from "lodash/isFunction";
|
|
|
2
2
|
import _get from "lodash/get";
|
|
3
3
|
import _isEqual from "lodash/isEqual";
|
|
4
4
|
import _isEmpty from "lodash/isEmpty";
|
|
5
|
+
import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find-index";
|
|
5
6
|
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
|
6
7
|
import _Set from "@babel/runtime-corejs3/core-js-stable/set";
|
|
7
8
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
@@ -40,6 +41,25 @@ class Tree extends BaseComponent {
|
|
|
40
41
|
this.foundation.handleInputChange(value);
|
|
41
42
|
};
|
|
42
43
|
|
|
44
|
+
this.scrollTo = scrollData => {
|
|
45
|
+
var _a;
|
|
46
|
+
|
|
47
|
+
const {
|
|
48
|
+
key,
|
|
49
|
+
align = 'center'
|
|
50
|
+
} = scrollData;
|
|
51
|
+
const {
|
|
52
|
+
flattenNodes
|
|
53
|
+
} = this.state;
|
|
54
|
+
|
|
55
|
+
if (key) {
|
|
56
|
+
const index = flattenNodes === null || flattenNodes === void 0 ? void 0 : _findIndexInstanceProperty(flattenNodes).call(flattenNodes, node => {
|
|
57
|
+
return node.key === key;
|
|
58
|
+
});
|
|
59
|
+
index >= 0 && ((_a = this.virtualizedListRef.current) === null || _a === void 0 ? void 0 : _a.scrollToItem(index, align));
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
43
63
|
this.renderEmpty = () => {
|
|
44
64
|
const {
|
|
45
65
|
emptyContent
|
|
@@ -201,6 +221,7 @@ class Tree extends BaseComponent {
|
|
|
201
221
|
this.optionsRef = /*#__PURE__*/React.createRef();
|
|
202
222
|
this.foundation = new TreeFoundation(this.adapter);
|
|
203
223
|
this.dragNode = null;
|
|
224
|
+
this.virtualizedListRef = /*#__PURE__*/React.createRef();
|
|
204
225
|
}
|
|
205
226
|
/**
|
|
206
227
|
* Process of getDerivedStateFromProps was inspired by rc-tree
|
|
@@ -573,6 +594,7 @@ class Tree extends BaseComponent {
|
|
|
573
594
|
width
|
|
574
595
|
} = _ref4;
|
|
575
596
|
return /*#__PURE__*/React.createElement(VirtualList, {
|
|
597
|
+
ref: this.virtualizedListRef,
|
|
576
598
|
itemCount: flattenNodes.length,
|
|
577
599
|
itemSize: virtualize.itemSize,
|
|
578
600
|
height: height,
|
|
@@ -37,7 +37,7 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
37
37
|
underline: PropTypes.Requireable<boolean>;
|
|
38
38
|
strong: PropTypes.Requireable<boolean>;
|
|
39
39
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
40
|
-
heading: PropTypes.Requireable<
|
|
40
|
+
heading: PropTypes.Requireable<4 | 2 | 1 | 3 | 5 | 6>;
|
|
41
41
|
style: PropTypes.Requireable<object>;
|
|
42
42
|
className: PropTypes.Requireable<string>;
|
|
43
43
|
component: PropTypes.Requireable<string>;
|
package/locale/interface.ts
CHANGED
package/locale/source/ar.ts
CHANGED
package/locale/source/de.ts
CHANGED
package/locale/source/en_GB.ts
CHANGED
package/locale/source/en_US.ts
CHANGED
package/locale/source/es.ts
CHANGED
package/locale/source/fr.ts
CHANGED
package/locale/source/id_ID.ts
CHANGED
package/locale/source/it.ts
CHANGED
package/locale/source/ja_JP.ts
CHANGED
package/locale/source/ko_KR.ts
CHANGED
package/locale/source/ms_MY.ts
CHANGED
package/locale/source/pt_BR.ts
CHANGED
package/locale/source/ru_RU.ts
CHANGED
package/locale/source/th_TH.ts
CHANGED
package/locale/source/tr_TR.ts
CHANGED
package/locale/source/vi_VN.ts
CHANGED
package/locale/source/zh_CN.ts
CHANGED
package/locale/source/zh_TW.ts
CHANGED
package/modal/Modal.tsx
CHANGED
|
@@ -347,12 +347,6 @@ class Modal extends BaseComponent<ModalReactProps, ModalState> {
|
|
|
347
347
|
let style = styleFromProps;
|
|
348
348
|
const maskStyle = maskStyleFromProps;
|
|
349
349
|
const renderFooter = 'footer' in this.props ? footer : this.renderFooter();
|
|
350
|
-
if (this.props.centered) {
|
|
351
|
-
style = {
|
|
352
|
-
transform: 'translateY(-50%)',
|
|
353
|
-
top: '50%', ...style,
|
|
354
|
-
};
|
|
355
|
-
}
|
|
356
350
|
let wrapperStyle: {
|
|
357
351
|
zIndex?: CSSProperties['zIndex'];
|
|
358
352
|
position?: CSSProperties['position'];
|
package/modal/ModalContent.tsx
CHANGED
|
@@ -318,7 +318,10 @@ export default class ModalContent extends BaseComponent<ModalContentReactProps,
|
|
|
318
318
|
<div
|
|
319
319
|
role="none"
|
|
320
320
|
tabIndex={-1}
|
|
321
|
-
className={
|
|
321
|
+
className={cls({
|
|
322
|
+
[`${cssClasses.DIALOG}-wrap`]:true,
|
|
323
|
+
[`${cssClasses.DIALOG}-wrap-center`]:this.props.centered
|
|
324
|
+
})}
|
|
322
325
|
onClick={maskClosable ? this.onMaskClick : null}
|
|
323
326
|
onMouseUp={maskClosable ? this.onMaskMouseUp : null}
|
|
324
327
|
>
|
|
@@ -287,7 +287,7 @@ describe('modal', () => {
|
|
|
287
287
|
it('centered without motion', () => {
|
|
288
288
|
let com = getModal({ centered: true, visible: true, motion: false });
|
|
289
289
|
let modal = mount(com, { attachTo: document.getElementById('container') });
|
|
290
|
-
expect(modal.find(`div.${BASE_CLASS_PREFIX}-modal`)).
|
|
290
|
+
expect(modal.find(`div.${BASE_CLASS_PREFIX}-modal-wrap`)).toHaveClassName(`${BASE_CLASS_PREFIX}-modal-wrap-center`)
|
|
291
291
|
});
|
|
292
292
|
|
|
293
293
|
it('keepDOM', () => {
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`模态框-点击遮罩层不可关闭 1`] = `
|
|
4
|
+
<DialogComponent
|
|
5
|
+
maskClosable={false}
|
|
6
|
+
>
|
|
7
|
+
<Button
|
|
8
|
+
onClick={[Function]}
|
|
9
|
+
>
|
|
10
|
+
<Button
|
|
11
|
+
block={false}
|
|
12
|
+
disabled={false}
|
|
13
|
+
htmlType="button"
|
|
14
|
+
onClick={[Function]}
|
|
15
|
+
onMouseDown={[Function]}
|
|
16
|
+
onMouseEnter={[Function]}
|
|
17
|
+
onMouseLeave={[Function]}
|
|
18
|
+
prefixCls="semi-button"
|
|
19
|
+
size="default"
|
|
20
|
+
theme="light"
|
|
21
|
+
type="primary"
|
|
22
|
+
>
|
|
23
|
+
<button
|
|
24
|
+
aria-disabled={false}
|
|
25
|
+
className="semi-button semi-button-primary semi-button-light"
|
|
26
|
+
disabled={false}
|
|
27
|
+
onClick={[Function]}
|
|
28
|
+
onMouseDown={[Function]}
|
|
29
|
+
onMouseEnter={[Function]}
|
|
30
|
+
onMouseLeave={[Function]}
|
|
31
|
+
type="button"
|
|
32
|
+
>
|
|
33
|
+
<span
|
|
34
|
+
className="semi-button-content"
|
|
35
|
+
onClick={[Function]}
|
|
36
|
+
x-semi-prop="children"
|
|
37
|
+
>
|
|
38
|
+
show dialog
|
|
39
|
+
</span>
|
|
40
|
+
</button>
|
|
41
|
+
</Button>
|
|
42
|
+
</Button>
|
|
43
|
+
<Button
|
|
44
|
+
onClick={[Function]}
|
|
45
|
+
>
|
|
46
|
+
<Button
|
|
47
|
+
block={false}
|
|
48
|
+
disabled={false}
|
|
49
|
+
htmlType="button"
|
|
50
|
+
onClick={[Function]}
|
|
51
|
+
onMouseDown={[Function]}
|
|
52
|
+
onMouseEnter={[Function]}
|
|
53
|
+
onMouseLeave={[Function]}
|
|
54
|
+
prefixCls="semi-button"
|
|
55
|
+
size="default"
|
|
56
|
+
theme="light"
|
|
57
|
+
type="primary"
|
|
58
|
+
>
|
|
59
|
+
<button
|
|
60
|
+
aria-disabled={false}
|
|
61
|
+
className="semi-button semi-button-primary semi-button-light"
|
|
62
|
+
disabled={false}
|
|
63
|
+
onClick={[Function]}
|
|
64
|
+
onMouseDown={[Function]}
|
|
65
|
+
onMouseEnter={[Function]}
|
|
66
|
+
onMouseLeave={[Function]}
|
|
67
|
+
type="button"
|
|
68
|
+
>
|
|
69
|
+
<span
|
|
70
|
+
className="semi-button-content"
|
|
71
|
+
onClick={[Function]}
|
|
72
|
+
x-semi-prop="children"
|
|
73
|
+
>
|
|
74
|
+
静态调用
|
|
75
|
+
</span>
|
|
76
|
+
</button>
|
|
77
|
+
</Button>
|
|
78
|
+
</Button>
|
|
79
|
+
<Modal
|
|
80
|
+
afterClose={[Function]}
|
|
81
|
+
cancelLoading={false}
|
|
82
|
+
centered={false}
|
|
83
|
+
closable={true}
|
|
84
|
+
closeOnEsc={true}
|
|
85
|
+
confirmLoading={false}
|
|
86
|
+
fullScreen={false}
|
|
87
|
+
hasCancel={true}
|
|
88
|
+
keepDOM={false}
|
|
89
|
+
lazyRender={true}
|
|
90
|
+
mask={true}
|
|
91
|
+
maskClosable={false}
|
|
92
|
+
maskFixed={false}
|
|
93
|
+
motion={true}
|
|
94
|
+
okType="primary"
|
|
95
|
+
onCancel={[Function]}
|
|
96
|
+
onOk={[Function]}
|
|
97
|
+
size="small"
|
|
98
|
+
title="对话框标题"
|
|
99
|
+
visible={false}
|
|
100
|
+
zIndex={1000}
|
|
101
|
+
/>
|
|
102
|
+
</DialogComponent>
|
|
103
|
+
`;
|
|
104
|
+
|
|
105
|
+
exports[`模态框默认 1`] = `
|
|
106
|
+
<DialogComponent>
|
|
107
|
+
<Button
|
|
108
|
+
onClick={[Function]}
|
|
109
|
+
>
|
|
110
|
+
<Button
|
|
111
|
+
block={false}
|
|
112
|
+
disabled={false}
|
|
113
|
+
htmlType="button"
|
|
114
|
+
onClick={[Function]}
|
|
115
|
+
onMouseDown={[Function]}
|
|
116
|
+
onMouseEnter={[Function]}
|
|
117
|
+
onMouseLeave={[Function]}
|
|
118
|
+
prefixCls="semi-button"
|
|
119
|
+
size="default"
|
|
120
|
+
theme="light"
|
|
121
|
+
type="primary"
|
|
122
|
+
>
|
|
123
|
+
<button
|
|
124
|
+
aria-disabled={false}
|
|
125
|
+
className="semi-button semi-button-primary semi-button-light"
|
|
126
|
+
disabled={false}
|
|
127
|
+
onClick={[Function]}
|
|
128
|
+
onMouseDown={[Function]}
|
|
129
|
+
onMouseEnter={[Function]}
|
|
130
|
+
onMouseLeave={[Function]}
|
|
131
|
+
type="button"
|
|
132
|
+
>
|
|
133
|
+
<span
|
|
134
|
+
className="semi-button-content"
|
|
135
|
+
onClick={[Function]}
|
|
136
|
+
x-semi-prop="children"
|
|
137
|
+
>
|
|
138
|
+
show dialog
|
|
139
|
+
</span>
|
|
140
|
+
</button>
|
|
141
|
+
</Button>
|
|
142
|
+
</Button>
|
|
143
|
+
<Button
|
|
144
|
+
onClick={[Function]}
|
|
145
|
+
>
|
|
146
|
+
<Button
|
|
147
|
+
block={false}
|
|
148
|
+
disabled={false}
|
|
149
|
+
htmlType="button"
|
|
150
|
+
onClick={[Function]}
|
|
151
|
+
onMouseDown={[Function]}
|
|
152
|
+
onMouseEnter={[Function]}
|
|
153
|
+
onMouseLeave={[Function]}
|
|
154
|
+
prefixCls="semi-button"
|
|
155
|
+
size="default"
|
|
156
|
+
theme="light"
|
|
157
|
+
type="primary"
|
|
158
|
+
>
|
|
159
|
+
<button
|
|
160
|
+
aria-disabled={false}
|
|
161
|
+
className="semi-button semi-button-primary semi-button-light"
|
|
162
|
+
disabled={false}
|
|
163
|
+
onClick={[Function]}
|
|
164
|
+
onMouseDown={[Function]}
|
|
165
|
+
onMouseEnter={[Function]}
|
|
166
|
+
onMouseLeave={[Function]}
|
|
167
|
+
type="button"
|
|
168
|
+
>
|
|
169
|
+
<span
|
|
170
|
+
className="semi-button-content"
|
|
171
|
+
onClick={[Function]}
|
|
172
|
+
x-semi-prop="children"
|
|
173
|
+
>
|
|
174
|
+
静态调用
|
|
175
|
+
</span>
|
|
176
|
+
</button>
|
|
177
|
+
</Button>
|
|
178
|
+
</Button>
|
|
179
|
+
<Modal
|
|
180
|
+
afterClose={[Function]}
|
|
181
|
+
cancelLoading={false}
|
|
182
|
+
centered={false}
|
|
183
|
+
closable={true}
|
|
184
|
+
closeOnEsc={true}
|
|
185
|
+
confirmLoading={false}
|
|
186
|
+
fullScreen={false}
|
|
187
|
+
hasCancel={true}
|
|
188
|
+
keepDOM={false}
|
|
189
|
+
lazyRender={true}
|
|
190
|
+
mask={true}
|
|
191
|
+
maskClosable={true}
|
|
192
|
+
maskFixed={false}
|
|
193
|
+
motion={true}
|
|
194
|
+
okType="primary"
|
|
195
|
+
onCancel={[Function]}
|
|
196
|
+
onOk={[Function]}
|
|
197
|
+
size="small"
|
|
198
|
+
title="对话框标题"
|
|
199
|
+
visible={false}
|
|
200
|
+
zIndex={1000}
|
|
201
|
+
/>
|
|
202
|
+
</DialogComponent>
|
|
203
|
+
`;
|