@douyinfe/semi-ui 2.24.2 → 2.24.3
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/umd/semi-ui.js +24 -11
- 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/form/hoc/withFormApi.d.ts +1 -1
- package/lib/cjs/form/hoc/withFormApi.js +15 -6
- package/lib/cjs/form/hoc/withFormState.d.ts +1 -1
- package/lib/cjs/form/hoc/withFormState.js +15 -6
- package/lib/cjs/navigation/index.d.ts +7 -7
- package/lib/es/form/hoc/withFormApi.d.ts +1 -1
- package/lib/es/form/hoc/withFormApi.js +12 -5
- package/lib/es/form/hoc/withFormState.d.ts +1 -1
- package/lib/es/form/hoc/withFormState.js +12 -5
- package/lib/es/navigation/index.d.ts +7 -7
- package/package.json +8 -8
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare
|
|
2
|
+
declare function withFormApi<C extends React.ElementType, T extends React.ComponentProps<C> & React.RefAttributes<any>, R extends React.ComponentType<T>>(Component: C): R;
|
|
3
3
|
export default withFormApi;
|
|
@@ -5,16 +5,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _context = require("../context");
|
|
11
11
|
|
|
12
|
-
function
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
|
|
16
|
+
function withFormApi(Component) {
|
|
17
|
+
let WithApiCom = (props, ref) => {
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_context.FormApiContext.Consumer, null, formApi => /*#__PURE__*/_react.default.createElement(Component, Object.assign({
|
|
19
|
+
formApi: formApi,
|
|
20
|
+
ref: ref
|
|
21
|
+
}, props)));
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
WithApiCom = /*#__PURE__*/(0, _react.forwardRef)(WithApiCom);
|
|
25
|
+
return WithApiCom;
|
|
26
|
+
}
|
|
18
27
|
|
|
19
28
|
var _default = withFormApi;
|
|
20
29
|
exports.default = _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare
|
|
2
|
+
declare function withFormState<C extends React.ElementType, T extends React.ComponentProps<C> & React.RefAttributes<any>, R extends React.ComponentType<T>>(Component: C): R;
|
|
3
3
|
export default withFormState;
|
|
@@ -5,16 +5,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _context = require("../context");
|
|
11
11
|
|
|
12
|
-
function
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
|
|
16
|
+
function withFormState(Component) {
|
|
17
|
+
let WithStateCom = (props, ref) => {
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_context.FormStateContext.Consumer, null, formState => /*#__PURE__*/_react.default.createElement(Component, Object.assign({
|
|
19
|
+
formState: formState,
|
|
20
|
+
ref: ref
|
|
21
|
+
}, props)));
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
WithStateCom = /*#__PURE__*/(0, _react.forwardRef)(WithStateCom);
|
|
25
|
+
return WithStateCom;
|
|
26
|
+
}
|
|
18
27
|
|
|
19
28
|
var _default = withFormState;
|
|
20
29
|
exports.default = _default;
|
|
@@ -51,17 +51,17 @@ export interface NavProps extends BaseProps {
|
|
|
51
51
|
tooltipShowDelay?: number;
|
|
52
52
|
getPopupContainer?: () => HTMLElement;
|
|
53
53
|
onClick?: (data: {
|
|
54
|
-
itemKey
|
|
55
|
-
domEvent
|
|
56
|
-
isOpen
|
|
54
|
+
itemKey?: React.ReactText;
|
|
55
|
+
domEvent?: MouseEvent;
|
|
56
|
+
isOpen?: boolean;
|
|
57
57
|
}) => void;
|
|
58
58
|
onCollapseChange?: (isCollapse: boolean) => void;
|
|
59
59
|
onDeselect?: (data?: any) => void;
|
|
60
60
|
onOpenChange?: (data: {
|
|
61
|
-
itemKey
|
|
62
|
-
openKeys
|
|
63
|
-
domEvent
|
|
64
|
-
isOpen
|
|
61
|
+
itemKey?: (string | number);
|
|
62
|
+
openKeys?: (string | number)[];
|
|
63
|
+
domEvent?: MouseEvent;
|
|
64
|
+
isOpen?: boolean;
|
|
65
65
|
}) => void;
|
|
66
66
|
onSelect?: (data: OnSelectedData) => void;
|
|
67
67
|
renderWrapper?: ({ itemElement, isSubNav, isInSubNav, props }: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare
|
|
2
|
+
declare function withFormApi<C extends React.ElementType, T extends React.ComponentProps<C> & React.RefAttributes<any>, R extends React.ComponentType<T>>(Component: C): R;
|
|
3
3
|
export default withFormApi;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
2
|
import { FormApiContext } from '../context';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
function withFormApi(Component) {
|
|
5
|
+
let WithApiCom = (props, ref) => {
|
|
6
|
+
return /*#__PURE__*/React.createElement(FormApiContext.Consumer, null, formApi => /*#__PURE__*/React.createElement(Component, Object.assign({
|
|
7
|
+
formApi: formApi,
|
|
8
|
+
ref: ref
|
|
9
|
+
}, props)));
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
WithApiCom = /*#__PURE__*/forwardRef(WithApiCom);
|
|
13
|
+
return WithApiCom;
|
|
14
|
+
}
|
|
8
15
|
|
|
9
16
|
export default withFormApi;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare
|
|
2
|
+
declare function withFormState<C extends React.ElementType, T extends React.ComponentProps<C> & React.RefAttributes<any>, R extends React.ComponentType<T>>(Component: C): R;
|
|
3
3
|
export default withFormState;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
2
|
import { FormStateContext } from '../context';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
function withFormState(Component) {
|
|
5
|
+
let WithStateCom = (props, ref) => {
|
|
6
|
+
return /*#__PURE__*/React.createElement(FormStateContext.Consumer, null, formState => /*#__PURE__*/React.createElement(Component, Object.assign({
|
|
7
|
+
formState: formState,
|
|
8
|
+
ref: ref
|
|
9
|
+
}, props)));
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
WithStateCom = /*#__PURE__*/forwardRef(WithStateCom);
|
|
13
|
+
return WithStateCom;
|
|
14
|
+
}
|
|
8
15
|
|
|
9
16
|
export default withFormState;
|
|
@@ -51,17 +51,17 @@ export interface NavProps extends BaseProps {
|
|
|
51
51
|
tooltipShowDelay?: number;
|
|
52
52
|
getPopupContainer?: () => HTMLElement;
|
|
53
53
|
onClick?: (data: {
|
|
54
|
-
itemKey
|
|
55
|
-
domEvent
|
|
56
|
-
isOpen
|
|
54
|
+
itemKey?: React.ReactText;
|
|
55
|
+
domEvent?: MouseEvent;
|
|
56
|
+
isOpen?: boolean;
|
|
57
57
|
}) => void;
|
|
58
58
|
onCollapseChange?: (isCollapse: boolean) => void;
|
|
59
59
|
onDeselect?: (data?: any) => void;
|
|
60
60
|
onOpenChange?: (data: {
|
|
61
|
-
itemKey
|
|
62
|
-
openKeys
|
|
63
|
-
domEvent
|
|
64
|
-
isOpen
|
|
61
|
+
itemKey?: (string | number);
|
|
62
|
+
openKeys?: (string | number)[];
|
|
63
|
+
domEvent?: MouseEvent;
|
|
64
|
+
isOpen?: boolean;
|
|
65
65
|
}) => void;
|
|
66
66
|
onSelect?: (data: OnSelectedData) => void;
|
|
67
67
|
renderWrapper?: ({ itemElement, isSubNav, isInSubNav, props }: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.24.
|
|
3
|
+
"version": "2.24.3",
|
|
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.24.
|
|
21
|
-
"@douyinfe/semi-animation-react": "2.24.
|
|
22
|
-
"@douyinfe/semi-foundation": "2.24.
|
|
23
|
-
"@douyinfe/semi-icons": "2.24.
|
|
24
|
-
"@douyinfe/semi-illustrations": "2.24.
|
|
25
|
-
"@douyinfe/semi-theme-default": "2.24.
|
|
20
|
+
"@douyinfe/semi-animation": "2.24.3",
|
|
21
|
+
"@douyinfe/semi-animation-react": "2.24.3",
|
|
22
|
+
"@douyinfe/semi-foundation": "2.24.3",
|
|
23
|
+
"@douyinfe/semi-icons": "2.24.3",
|
|
24
|
+
"@douyinfe/semi-illustrations": "2.24.3",
|
|
25
|
+
"@douyinfe/semi-theme-default": "2.24.3",
|
|
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": "989e106471d68c7eaf1b26abb64bbc1a5f383f9a",
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
75
75
|
"@babel/plugin-transform-runtime": "^7.15.8",
|