@hi-ui/hiui 4.10.0 → 4.10.2
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/CHANGELOG.md +12 -0
- package/lib/cjs/index.js +7 -0
- package/lib/cjs/ui/portal-context/lib/esm/PortalContext.js +32 -0
- package/lib/cjs/ui/portal-context/lib/esm/PortalProvider.js +45 -0
- package/lib/esm/index.js +3 -0
- package/lib/esm/ui/portal-context/lib/esm/PortalContext.js +26 -0
- package/lib/esm/ui/portal-context/lib/esm/PortalProvider.js +33 -0
- package/lib/types/index.d.ts +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @hi-ui/hiui
|
2
2
|
|
3
|
+
## 4.10.2
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#3072](https://github.com/XiaoMi/hiui/pull/3072) [`5e426c9`](https://github.com/XiaoMi/hiui/commit/5e426c9f9d0e6ab9aa8d166c29ac8fb2fd95a414) Thanks [@zyprepare](https://github.com/zyprepare)! - chore(locale-context): 对外暴露类型定义
|
8
|
+
|
9
|
+
## 4.10.1
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- [#3070](https://github.com/XiaoMi/hiui/pull/3070) [`e3ce5be`](https://github.com/XiaoMi/hiui/commit/e3ce5be69208fa6fcd3ea9e1c8b7badb2744e055) Thanks [@zyprepare](https://github.com/zyprepare)! - chore(hiui): add portal-context package
|
14
|
+
|
3
15
|
## 4.10.0
|
4
16
|
|
5
17
|
### Minor Changes
|
package/lib/cjs/index.js
CHANGED
@@ -41,6 +41,9 @@ var list = require('@hi-ui/list');
|
|
41
41
|
var loading = require('@hi-ui/loading');
|
42
42
|
var LocaleContext = require('./ui/locale-context/lib/esm/LocaleContext.js');
|
43
43
|
var LocaleProvider = require('./ui/locale-context/lib/esm/LocaleProvider.js');
|
44
|
+
var types = require('./ui/locale-context/lib/esm/types.js');
|
45
|
+
var PortalContext = require('./ui/portal-context/lib/esm/PortalContext.js');
|
46
|
+
var PortalProvider = require('./ui/portal-context/lib/esm/PortalProvider.js');
|
44
47
|
var menu = require('@hi-ui/menu');
|
45
48
|
var message = require('@hi-ui/message');
|
46
49
|
var modal = require('@hi-ui/modal');
|
@@ -245,6 +248,10 @@ exports.getLanguage = LocaleContext.getLanguage;
|
|
245
248
|
exports.useLocaleContext = LocaleContext.useLocaleContext;
|
246
249
|
exports.LocaleContext = LocaleProvider.LocaleProvider;
|
247
250
|
exports.LocaleProvider = LocaleProvider.LocaleProvider;
|
251
|
+
exports.LocaleEnum = types.LocaleEnum;
|
252
|
+
exports.usePortalContext = PortalContext.usePortalContext;
|
253
|
+
exports.PortalContext = PortalProvider.PortalProvider;
|
254
|
+
exports.PortalProvider = PortalProvider.PortalProvider;
|
248
255
|
Object.defineProperty(exports, 'Menu', {
|
249
256
|
enumerable: true,
|
250
257
|
get: function get() {
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/** @LICENSE
|
2
|
+
* @hi-ui/hiui
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/hiui#readme
|
4
|
+
*
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
6
|
+
*
|
7
|
+
* This source code is licensed under the MIT license found in the
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
9
|
+
*/
|
10
|
+
'use strict';
|
11
|
+
|
12
|
+
Object.defineProperty(exports, '__esModule', {
|
13
|
+
value: true
|
14
|
+
});
|
15
|
+
var React = require('react');
|
16
|
+
|
17
|
+
/** @LICENSE
|
18
|
+
* @hi-ui/portal-context
|
19
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/container-context#readme
|
20
|
+
*
|
21
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
22
|
+
*
|
23
|
+
* This source code is licensed under the MIT license found in the
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
25
|
+
*/
|
26
|
+
var PortalContext = /*#__PURE__*/React.createContext(null);
|
27
|
+
var usePortalContext = function usePortalContext() {
|
28
|
+
var context = React.useContext(PortalContext);
|
29
|
+
return context;
|
30
|
+
};
|
31
|
+
exports.PortalContext = PortalContext;
|
32
|
+
exports.usePortalContext = usePortalContext;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
/** @LICENSE
|
2
|
+
* @hi-ui/hiui
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/hiui#readme
|
4
|
+
*
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
6
|
+
*
|
7
|
+
* This source code is licensed under the MIT license found in the
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
9
|
+
*/
|
10
|
+
'use strict';
|
11
|
+
|
12
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
13
|
+
Object.defineProperty(exports, '__esModule', {
|
14
|
+
value: true
|
15
|
+
});
|
16
|
+
var React = require('react');
|
17
|
+
var PortalContext = require('./PortalContext.js');
|
18
|
+
var index = require('../../../../utils/env/lib/esm/index.js');
|
19
|
+
function _interopDefaultCompat(e) {
|
20
|
+
return e && _typeof(e) === 'object' && 'default' in e ? e : {
|
21
|
+
'default': e
|
22
|
+
};
|
23
|
+
}
|
24
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
25
|
+
|
26
|
+
/** @LICENSE
|
27
|
+
* @hi-ui/portal-context
|
28
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/container-context#readme
|
29
|
+
*
|
30
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
31
|
+
*
|
32
|
+
* This source code is licensed under the MIT license found in the
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
34
|
+
*/
|
35
|
+
var PortalProvider = function PortalProvider(_ref) {
|
36
|
+
var children = _ref.children,
|
37
|
+
portal = _ref.portal;
|
38
|
+
return /*#__PURE__*/React__default["default"].createElement(PortalContext.PortalContext.Provider, {
|
39
|
+
value: portal
|
40
|
+
}, children);
|
41
|
+
};
|
42
|
+
if (index.__DEV__) {
|
43
|
+
PortalProvider.displayName = 'PortalProvider';
|
44
|
+
}
|
45
|
+
exports.PortalProvider = PortalProvider;
|
package/lib/esm/index.js
CHANGED
@@ -63,6 +63,9 @@ export * from '@hi-ui/loading';
|
|
63
63
|
export { default as Loading } from '@hi-ui/loading';
|
64
64
|
export { getLanguage, useLocaleContext } from './ui/locale-context/lib/esm/LocaleContext.js';
|
65
65
|
export { LocaleProvider as LocaleContext, LocaleProvider } from './ui/locale-context/lib/esm/LocaleProvider.js';
|
66
|
+
export { LocaleEnum } from './ui/locale-context/lib/esm/types.js';
|
67
|
+
export { usePortalContext } from './ui/portal-context/lib/esm/PortalContext.js';
|
68
|
+
export { PortalProvider as PortalContext, PortalProvider } from './ui/portal-context/lib/esm/PortalProvider.js';
|
66
69
|
export * from '@hi-ui/menu';
|
67
70
|
export { default as Menu } from '@hi-ui/menu';
|
68
71
|
export * from '@hi-ui/message';
|
@@ -0,0 +1,26 @@
|
|
1
|
+
/** @LICENSE
|
2
|
+
* @hi-ui/hiui
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/hiui#readme
|
4
|
+
*
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
6
|
+
*
|
7
|
+
* This source code is licensed under the MIT license found in the
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
9
|
+
*/
|
10
|
+
import { useContext, createContext } from 'react';
|
11
|
+
|
12
|
+
/** @LICENSE
|
13
|
+
* @hi-ui/portal-context
|
14
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/container-context#readme
|
15
|
+
*
|
16
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
17
|
+
*
|
18
|
+
* This source code is licensed under the MIT license found in the
|
19
|
+
* LICENSE file in the root directory of this source tree.
|
20
|
+
*/
|
21
|
+
var PortalContext = /*#__PURE__*/createContext(null);
|
22
|
+
var usePortalContext = function usePortalContext() {
|
23
|
+
var context = useContext(PortalContext);
|
24
|
+
return context;
|
25
|
+
};
|
26
|
+
export { PortalContext, usePortalContext };
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/** @LICENSE
|
2
|
+
* @hi-ui/hiui
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/hiui#readme
|
4
|
+
*
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
6
|
+
*
|
7
|
+
* This source code is licensed under the MIT license found in the
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
9
|
+
*/
|
10
|
+
import React from 'react';
|
11
|
+
import { PortalContext } from './PortalContext.js';
|
12
|
+
import { __DEV__ } from '../../../../utils/env/lib/esm/index.js';
|
13
|
+
|
14
|
+
/** @LICENSE
|
15
|
+
* @hi-ui/portal-context
|
16
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/container-context#readme
|
17
|
+
*
|
18
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
19
|
+
*
|
20
|
+
* This source code is licensed under the MIT license found in the
|
21
|
+
* LICENSE file in the root directory of this source tree.
|
22
|
+
*/
|
23
|
+
var PortalProvider = function PortalProvider(_ref) {
|
24
|
+
var children = _ref.children,
|
25
|
+
portal = _ref.portal;
|
26
|
+
return /*#__PURE__*/React.createElement(PortalContext.Provider, {
|
27
|
+
value: portal
|
28
|
+
}, children);
|
29
|
+
};
|
30
|
+
if (__DEV__) {
|
31
|
+
PortalProvider.displayName = 'PortalProvider';
|
32
|
+
}
|
33
|
+
export { PortalProvider };
|
package/lib/types/index.d.ts
CHANGED
@@ -60,6 +60,8 @@ export * from '@hi-ui/locale-context';
|
|
60
60
|
* @deprecated Please use the `Provider` instead of it.
|
61
61
|
*/
|
62
62
|
export { default as LocaleContext } from '@hi-ui/locale-context';
|
63
|
+
export * from '@hi-ui/portal-context';
|
64
|
+
export { default as PortalContext } from '@hi-ui/portal-context';
|
63
65
|
export * from '@hi-ui/menu';
|
64
66
|
export { default as Menu } from '@hi-ui/menu';
|
65
67
|
export * from '@hi-ui/message';
|