@douyinfe/semi-ui 2.27.1 → 2.28.0-alpha.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 +12 -0
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +256 -214
- 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/dropdown/dropdownMenu.d.ts +1 -1
- package/lib/cjs/dropdown/index.d.ts +1 -1
- package/lib/cjs/image/preview.d.ts +1 -1
- package/lib/cjs/input/index.d.ts +1 -1
- package/lib/cjs/layout/Sider.d.ts +1 -0
- package/lib/cjs/layout/Sider.js +1 -0
- package/lib/cjs/layout/index.js +3 -1
- package/lib/cjs/modal/Modal.d.ts +0 -2
- package/lib/cjs/modal/Modal.js +4 -6
- package/lib/cjs/spin/index.d.ts +1 -1
- package/lib/cjs/table/TableHeaderRow.d.ts +1 -1
- package/lib/es/dropdown/dropdownMenu.d.ts +1 -1
- package/lib/es/dropdown/index.d.ts +1 -1
- package/lib/es/image/preview.d.ts +1 -1
- package/lib/es/input/index.d.ts +1 -1
- package/lib/es/layout/Sider.d.ts +1 -0
- package/lib/es/layout/Sider.js +1 -0
- package/lib/es/layout/index.js +3 -1
- package/lib/es/modal/Modal.d.ts +0 -2
- package/lib/es/modal/Modal.js +4 -6
- package/lib/es/spin/index.d.ts +1 -1
- package/lib/es/table/TableHeaderRow.d.ts +1 -1
- package/package.json +8 -8
|
@@ -17,7 +17,7 @@ declare class DropdownMenu extends BaseComponent<DropdownMenuProps> {
|
|
|
17
17
|
getProps(): BaseProps;
|
|
18
18
|
getState(key: string): any;
|
|
19
19
|
getStates(): {};
|
|
20
|
-
setState(s: Pick<{},
|
|
20
|
+
setState<K extends never>(s: Pick<{}, K>, callback?: any): void;
|
|
21
21
|
getCache(c: string): any;
|
|
22
22
|
getCaches(): any;
|
|
23
23
|
setCache(key: any, value: any): void;
|
|
@@ -101,7 +101,7 @@ declare class Dropdown extends BaseComponent<DropdownProps, DropdownState> {
|
|
|
101
101
|
getProps(): DropdownProps;
|
|
102
102
|
getState(key: string): any;
|
|
103
103
|
getStates(): DropdownState;
|
|
104
|
-
setState(s: Pick<DropdownState,
|
|
104
|
+
setState<K extends "popVisible">(s: Pick<DropdownState, K>, callback?: any): void;
|
|
105
105
|
getCache(c: string): any;
|
|
106
106
|
getCaches(): any;
|
|
107
107
|
setCache(key: any, value: any): void;
|
|
@@ -59,7 +59,7 @@ export default class Preview extends BaseComponent<PreviewProps, PreviewState> {
|
|
|
59
59
|
getProps(): PreviewProps;
|
|
60
60
|
getState(key: string): any;
|
|
61
61
|
getStates(): PreviewState;
|
|
62
|
-
setState(s: Pick<PreviewState,
|
|
62
|
+
setState<K extends keyof PreviewState>(s: Pick<PreviewState, K>, callback?: any): void;
|
|
63
63
|
getCache(c: string): any;
|
|
64
64
|
getCaches(): any;
|
|
65
65
|
setCache(key: any, value: any): void;
|
package/lib/cjs/input/index.d.ts
CHANGED
|
@@ -154,7 +154,7 @@ declare class Input extends BaseComponent<InputProps, InputState> {
|
|
|
154
154
|
getProps(): InputProps;
|
|
155
155
|
getState(key: string): any;
|
|
156
156
|
getStates(): InputState;
|
|
157
|
-
setState(s: Pick<InputState,
|
|
157
|
+
setState<K extends keyof InputState>(s: Pick<InputState, K>, callback?: any): void;
|
|
158
158
|
getCache(c: string): any;
|
|
159
159
|
getCaches(): any;
|
|
160
160
|
setCache(key: any, value: any): void;
|
package/lib/cjs/layout/Sider.js
CHANGED
package/lib/cjs/layout/index.js
CHANGED
|
@@ -125,7 +125,9 @@ class Layout extends _react.default.Component {
|
|
|
125
125
|
siders
|
|
126
126
|
} = this.state;
|
|
127
127
|
const classString = (0, _classnames.default)(className, prefixCls, {
|
|
128
|
-
["".concat(prefixCls, "-has-sider")]: typeof hasSider === 'boolean'
|
|
128
|
+
["".concat(prefixCls, "-has-sider")]: typeof hasSider === 'boolean' && hasSider || siders.length > 0 || _react.default.Children.toArray(children).some(child => {
|
|
129
|
+
return /*#__PURE__*/_react.default.isValidElement(child) && child.type && child.type.type === "Sider";
|
|
130
|
+
})
|
|
129
131
|
});
|
|
130
132
|
const Tag = tagName;
|
|
131
133
|
return /*#__PURE__*/_react.default.createElement(_layoutContext.default.Provider, {
|
package/lib/cjs/modal/Modal.d.ts
CHANGED
|
@@ -74,8 +74,6 @@ declare class Modal extends BaseComponent<ModalReactProps, ModalState> {
|
|
|
74
74
|
centered: boolean;
|
|
75
75
|
closable: boolean;
|
|
76
76
|
visible: boolean;
|
|
77
|
-
confirmLoading: boolean;
|
|
78
|
-
cancelLoading: boolean;
|
|
79
77
|
okType: string;
|
|
80
78
|
maskClosable: boolean;
|
|
81
79
|
hasCancel: boolean;
|
package/lib/cjs/modal/Modal.js
CHANGED
|
@@ -93,7 +93,7 @@ class Modal extends _baseComponent.default {
|
|
|
93
93
|
return /*#__PURE__*/_react.default.createElement(_button.default, Object.assign({
|
|
94
94
|
"aria-label": "cancel",
|
|
95
95
|
onClick: this.handleCancel,
|
|
96
|
-
loading: cancelLoading,
|
|
96
|
+
loading: cancelLoading === undefined ? this.state.onCancelReturnPromiseStatus === "pending" : cancelLoading,
|
|
97
97
|
type: "tertiary",
|
|
98
98
|
autoFocus: true
|
|
99
99
|
}, this.props.cancelButtonProps, {
|
|
@@ -108,7 +108,7 @@ class Modal extends _baseComponent.default {
|
|
|
108
108
|
"aria-label": "confirm",
|
|
109
109
|
type: okType,
|
|
110
110
|
theme: "solid",
|
|
111
|
-
loading: confirmLoading,
|
|
111
|
+
loading: confirmLoading === undefined ? this.state.onOKReturnPromiseStatus === "pending" : confirmLoading,
|
|
112
112
|
onClick: this.handleOk
|
|
113
113
|
}, this.props.okButtonProps, {
|
|
114
114
|
"x-semi-children-alias": "okText"
|
|
@@ -244,10 +244,10 @@ class Modal extends _baseComponent.default {
|
|
|
244
244
|
}
|
|
245
245
|
},
|
|
246
246
|
notifyCancel: e => {
|
|
247
|
-
this.props.onCancel(e);
|
|
247
|
+
return this.props.onCancel(e);
|
|
248
248
|
},
|
|
249
249
|
notifyOk: e => {
|
|
250
|
-
this.props.onOk(e);
|
|
250
|
+
return this.props.onOk(e);
|
|
251
251
|
},
|
|
252
252
|
notifyClose: () => {
|
|
253
253
|
this.props.afterClose();
|
|
@@ -380,8 +380,6 @@ Modal.defaultProps = {
|
|
|
380
380
|
centered: false,
|
|
381
381
|
closable: true,
|
|
382
382
|
visible: false,
|
|
383
|
-
confirmLoading: false,
|
|
384
|
-
cancelLoading: false,
|
|
385
383
|
okType: 'primary',
|
|
386
384
|
maskClosable: true,
|
|
387
385
|
hasCancel: true,
|
package/lib/cjs/spin/index.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ declare class Spin extends BaseComponent<SpinProps, SpinState> {
|
|
|
50
50
|
getProps(): SpinProps;
|
|
51
51
|
getState(key: string): any;
|
|
52
52
|
getStates(): SpinState;
|
|
53
|
-
setState(s: Pick<SpinState,
|
|
53
|
+
setState<K extends keyof SpinState>(s: Pick<SpinState, K>, callback?: any): void;
|
|
54
54
|
getCache(c: string): any;
|
|
55
55
|
getCaches(): any;
|
|
56
56
|
setCache(key: any, value: any): void;
|
|
@@ -46,7 +46,7 @@ export default class TableHeaderRow extends BaseComponent<TableHeaderRowProps, R
|
|
|
46
46
|
getProps(): TableHeaderRowProps;
|
|
47
47
|
getState(key: string): any;
|
|
48
48
|
getStates(): Record<string, any>;
|
|
49
|
-
setState(s: Pick<Record<string, any>,
|
|
49
|
+
setState<K extends string>(s: Pick<Record<string, any>, K>, callback?: any): void;
|
|
50
50
|
getCache(c: string): any;
|
|
51
51
|
getCaches(): any;
|
|
52
52
|
setCache(key: any, value: any): void;
|
|
@@ -17,7 +17,7 @@ declare class DropdownMenu extends BaseComponent<DropdownMenuProps> {
|
|
|
17
17
|
getProps(): BaseProps;
|
|
18
18
|
getState(key: string): any;
|
|
19
19
|
getStates(): {};
|
|
20
|
-
setState(s: Pick<{},
|
|
20
|
+
setState<K extends never>(s: Pick<{}, K>, callback?: any): void;
|
|
21
21
|
getCache(c: string): any;
|
|
22
22
|
getCaches(): any;
|
|
23
23
|
setCache(key: any, value: any): void;
|
|
@@ -101,7 +101,7 @@ declare class Dropdown extends BaseComponent<DropdownProps, DropdownState> {
|
|
|
101
101
|
getProps(): DropdownProps;
|
|
102
102
|
getState(key: string): any;
|
|
103
103
|
getStates(): DropdownState;
|
|
104
|
-
setState(s: Pick<DropdownState,
|
|
104
|
+
setState<K extends "popVisible">(s: Pick<DropdownState, K>, callback?: any): void;
|
|
105
105
|
getCache(c: string): any;
|
|
106
106
|
getCaches(): any;
|
|
107
107
|
setCache(key: any, value: any): void;
|
|
@@ -59,7 +59,7 @@ export default class Preview extends BaseComponent<PreviewProps, PreviewState> {
|
|
|
59
59
|
getProps(): PreviewProps;
|
|
60
60
|
getState(key: string): any;
|
|
61
61
|
getStates(): PreviewState;
|
|
62
|
-
setState(s: Pick<PreviewState,
|
|
62
|
+
setState<K extends keyof PreviewState>(s: Pick<PreviewState, K>, callback?: any): void;
|
|
63
63
|
getCache(c: string): any;
|
|
64
64
|
getCaches(): any;
|
|
65
65
|
setCache(key: any, value: any): void;
|
package/lib/es/input/index.d.ts
CHANGED
|
@@ -154,7 +154,7 @@ declare class Input extends BaseComponent<InputProps, InputState> {
|
|
|
154
154
|
getProps(): InputProps;
|
|
155
155
|
getState(key: string): any;
|
|
156
156
|
getStates(): InputState;
|
|
157
|
-
setState(s: Pick<InputState,
|
|
157
|
+
setState<K extends keyof InputState>(s: Pick<InputState, K>, callback?: any): void;
|
|
158
158
|
getCache(c: string): any;
|
|
159
159
|
getCaches(): any;
|
|
160
160
|
setCache(key: any, value: any): void;
|
package/lib/es/layout/Sider.d.ts
CHANGED
package/lib/es/layout/Sider.js
CHANGED
package/lib/es/layout/index.js
CHANGED
|
@@ -109,7 +109,9 @@ class Layout extends React.Component {
|
|
|
109
109
|
siders
|
|
110
110
|
} = this.state;
|
|
111
111
|
const classString = cls(className, prefixCls, {
|
|
112
|
-
["".concat(prefixCls, "-has-sider")]: typeof hasSider === 'boolean'
|
|
112
|
+
["".concat(prefixCls, "-has-sider")]: typeof hasSider === 'boolean' && hasSider || siders.length > 0 || React.Children.toArray(children).some(child => {
|
|
113
|
+
return /*#__PURE__*/React.isValidElement(child) && child.type && child.type.type === "Sider";
|
|
114
|
+
})
|
|
113
115
|
});
|
|
114
116
|
const Tag = tagName;
|
|
115
117
|
return /*#__PURE__*/React.createElement(LayoutContext.Provider, {
|
package/lib/es/modal/Modal.d.ts
CHANGED
|
@@ -74,8 +74,6 @@ declare class Modal extends BaseComponent<ModalReactProps, ModalState> {
|
|
|
74
74
|
centered: boolean;
|
|
75
75
|
closable: boolean;
|
|
76
76
|
visible: boolean;
|
|
77
|
-
confirmLoading: boolean;
|
|
78
|
-
cancelLoading: boolean;
|
|
79
77
|
okType: string;
|
|
80
78
|
maskClosable: boolean;
|
|
81
79
|
hasCancel: boolean;
|
package/lib/es/modal/Modal.js
CHANGED
|
@@ -65,7 +65,7 @@ class Modal extends BaseComponent {
|
|
|
65
65
|
return /*#__PURE__*/React.createElement(Button, Object.assign({
|
|
66
66
|
"aria-label": "cancel",
|
|
67
67
|
onClick: this.handleCancel,
|
|
68
|
-
loading: cancelLoading,
|
|
68
|
+
loading: cancelLoading === undefined ? this.state.onCancelReturnPromiseStatus === "pending" : cancelLoading,
|
|
69
69
|
type: "tertiary",
|
|
70
70
|
autoFocus: true
|
|
71
71
|
}, this.props.cancelButtonProps, {
|
|
@@ -80,7 +80,7 @@ class Modal extends BaseComponent {
|
|
|
80
80
|
"aria-label": "confirm",
|
|
81
81
|
type: okType,
|
|
82
82
|
theme: "solid",
|
|
83
|
-
loading: confirmLoading,
|
|
83
|
+
loading: confirmLoading === undefined ? this.state.onOKReturnPromiseStatus === "pending" : confirmLoading,
|
|
84
84
|
onClick: this.handleOk
|
|
85
85
|
}, this.props.okButtonProps, {
|
|
86
86
|
"x-semi-children-alias": "okText"
|
|
@@ -216,10 +216,10 @@ class Modal extends BaseComponent {
|
|
|
216
216
|
}
|
|
217
217
|
},
|
|
218
218
|
notifyCancel: e => {
|
|
219
|
-
this.props.onCancel(e);
|
|
219
|
+
return this.props.onCancel(e);
|
|
220
220
|
},
|
|
221
221
|
notifyOk: e => {
|
|
222
|
-
this.props.onOk(e);
|
|
222
|
+
return this.props.onOk(e);
|
|
223
223
|
},
|
|
224
224
|
notifyClose: () => {
|
|
225
225
|
this.props.afterClose();
|
|
@@ -352,8 +352,6 @@ Modal.defaultProps = {
|
|
|
352
352
|
centered: false,
|
|
353
353
|
closable: true,
|
|
354
354
|
visible: false,
|
|
355
|
-
confirmLoading: false,
|
|
356
|
-
cancelLoading: false,
|
|
357
355
|
okType: 'primary',
|
|
358
356
|
maskClosable: true,
|
|
359
357
|
hasCancel: true,
|
package/lib/es/spin/index.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ declare class Spin extends BaseComponent<SpinProps, SpinState> {
|
|
|
50
50
|
getProps(): SpinProps;
|
|
51
51
|
getState(key: string): any;
|
|
52
52
|
getStates(): SpinState;
|
|
53
|
-
setState(s: Pick<SpinState,
|
|
53
|
+
setState<K extends keyof SpinState>(s: Pick<SpinState, K>, callback?: any): void;
|
|
54
54
|
getCache(c: string): any;
|
|
55
55
|
getCaches(): any;
|
|
56
56
|
setCache(key: any, value: any): void;
|
|
@@ -46,7 +46,7 @@ export default class TableHeaderRow extends BaseComponent<TableHeaderRowProps, R
|
|
|
46
46
|
getProps(): TableHeaderRowProps;
|
|
47
47
|
getState(key: string): any;
|
|
48
48
|
getStates(): Record<string, any>;
|
|
49
|
-
setState(s: Pick<Record<string, any>,
|
|
49
|
+
setState<K extends string>(s: Pick<Record<string, any>, K>, callback?: any): void;
|
|
50
50
|
getCache(c: string): any;
|
|
51
51
|
getCaches(): any;
|
|
52
52
|
setCache(key: any, value: any): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.28.0-alpha.0",
|
|
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.
|
|
21
|
-
"@douyinfe/semi-animation-react": "2.
|
|
22
|
-
"@douyinfe/semi-foundation": "2.
|
|
23
|
-
"@douyinfe/semi-icons": "2.
|
|
24
|
-
"@douyinfe/semi-illustrations": "2.
|
|
25
|
-
"@douyinfe/semi-theme-default": "2.
|
|
20
|
+
"@douyinfe/semi-animation": "2.28.0-alpha.0",
|
|
21
|
+
"@douyinfe/semi-animation-react": "2.28.0-alpha.0",
|
|
22
|
+
"@douyinfe/semi-foundation": "2.28.0-alpha.0",
|
|
23
|
+
"@douyinfe/semi-icons": "2.28.0-alpha.0",
|
|
24
|
+
"@douyinfe/semi-illustrations": "2.28.0-alpha.0",
|
|
25
|
+
"@douyinfe/semi-theme-default": "2.28.0-alpha.0",
|
|
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": "ee3933458b16abacd476c8ea1c28a245c9d85dc0",
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
75
75
|
"@babel/plugin-transform-runtime": "^7.15.8",
|