@hi-ui/layout 4.0.0 → 5.0.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/CHANGELOG.md +51 -0
- package/lib/cjs/AppList.js +163 -0
- package/lib/cjs/CollapseIcon.js +56 -0
- package/lib/cjs/Content.js +1 -4
- package/lib/cjs/FloatMenuContainer.js +93 -0
- package/lib/cjs/Footer.js +45 -0
- package/lib/cjs/Header.js +45 -0
- package/lib/cjs/Layout.js +4 -2
- package/lib/cjs/Profile.js +165 -0
- package/lib/cjs/SearchTrigger.js +71 -8
- package/lib/cjs/Sider.js +32 -18
- package/lib/cjs/index.js +26 -3
- package/lib/cjs/packages/hooks/use-id/lib/esm/index.js +51 -0
- package/lib/cjs/packages/hooks/use-id/node_modules/uuid/dist/esm-browser/regex.js +16 -0
- package/lib/cjs/packages/hooks/use-id/node_modules/uuid/dist/esm-browser/rng.js +33 -0
- package/lib/cjs/packages/hooks/use-id/node_modules/uuid/dist/esm-browser/stringify.js +41 -0
- package/lib/cjs/packages/hooks/use-id/node_modules/uuid/dist/esm-browser/v4.js +33 -0
- package/lib/cjs/packages/hooks/use-id/node_modules/uuid/dist/esm-browser/validate.js +19 -0
- package/lib/cjs/packages/hooks/use-latest/lib/esm/index.js +56 -0
- package/lib/cjs/packages/hooks/use-timeout/lib/esm/index.js +50 -0
- package/lib/cjs/packages/hooks/use-toggle/lib/esm/index.js +71 -0
- package/lib/cjs/packages/hooks/use-unmount-effect/lib/esm/index.js +44 -0
- package/lib/cjs/packages/icons/lib/esm/components/alert/check-outlined.js +65 -0
- package/lib/cjs/packages/icons/lib/esm/components/direction/right-outlined.js +65 -0
- package/lib/cjs/packages/ui/popover/lib/esm/Popover.js +111 -0
- package/lib/cjs/packages/ui/popover/lib/esm/index.js +31 -0
- package/lib/cjs/packages/ui/popover/lib/esm/styles/index.scss.js +35 -0
- package/lib/cjs/packages/ui/popover/lib/esm/types.js +31 -0
- package/lib/cjs/packages/ui/popover/lib/esm/use-popover.js +187 -0
- package/lib/cjs/packages/ui/popover/lib/esm/utils/container/lib/esm/index.js +67 -0
- package/lib/cjs/packages/ui/popover/lib/esm/with-api.js +84 -0
- package/lib/cjs/packages/utils/array-utils/lib/esm/index.js +33 -0
- package/lib/cjs/packages/utils/dom-utils/lib/esm/index.js +47 -0
- package/lib/cjs/packages/utils/react-utils/lib/esm/index.js +72 -0
- package/lib/cjs/packages/utils/type-assertion/lib/esm/index.js +36 -0
- package/lib/cjs/styles/index.scss.js +1 -1
- package/lib/esm/AppList.js +149 -0
- package/lib/esm/CollapseIcon.js +44 -0
- package/lib/esm/Content.js +1 -4
- package/lib/esm/FloatMenuContainer.js +81 -0
- package/lib/esm/Footer.js +33 -0
- package/lib/esm/Header.js +33 -0
- package/lib/esm/Layout.js +4 -2
- package/lib/esm/Profile.js +152 -0
- package/lib/esm/SearchTrigger.js +70 -8
- package/lib/esm/Sider.js +32 -18
- package/lib/esm/index.js +22 -4
- package/lib/esm/packages/hooks/use-id/lib/esm/index.js +45 -0
- package/lib/esm/packages/hooks/use-id/node_modules/uuid/dist/esm-browser/regex.js +11 -0
- package/lib/esm/packages/hooks/use-id/node_modules/uuid/dist/esm-browser/rng.js +27 -0
- package/lib/esm/packages/hooks/use-id/node_modules/uuid/dist/esm-browser/stringify.js +36 -0
- package/lib/esm/packages/hooks/use-id/node_modules/uuid/dist/esm-browser/v4.js +28 -0
- package/lib/esm/packages/hooks/use-id/node_modules/uuid/dist/esm-browser/validate.js +14 -0
- package/lib/esm/packages/hooks/use-latest/lib/esm/index.js +50 -0
- package/lib/esm/packages/hooks/use-timeout/lib/esm/index.js +45 -0
- package/lib/esm/packages/hooks/use-toggle/lib/esm/index.js +66 -0
- package/lib/esm/packages/hooks/use-unmount-effect/lib/esm/index.js +39 -0
- package/lib/esm/packages/icons/lib/esm/components/alert/check-outlined.js +53 -0
- package/lib/esm/packages/icons/lib/esm/components/direction/right-outlined.js +53 -0
- package/lib/esm/packages/ui/popover/lib/esm/Popover.js +97 -0
- package/lib/esm/packages/ui/popover/lib/esm/index.js +25 -0
- package/lib/esm/packages/ui/popover/lib/esm/styles/index.scss.js +23 -0
- package/lib/esm/packages/ui/popover/lib/esm/types.js +25 -0
- package/lib/esm/packages/ui/popover/lib/esm/use-popover.js +175 -0
- package/lib/esm/packages/ui/popover/lib/esm/utils/container/lib/esm/index.js +60 -0
- package/lib/esm/packages/ui/popover/lib/esm/with-api.js +79 -0
- package/lib/esm/packages/utils/array-utils/lib/esm/index.js +28 -0
- package/lib/esm/packages/utils/dom-utils/lib/esm/index.js +42 -0
- package/lib/esm/packages/utils/react-utils/lib/esm/index.js +65 -0
- package/lib/esm/packages/utils/type-assertion/lib/esm/index.js +29 -0
- package/lib/esm/styles/index.scss.js +1 -1
- package/lib/types/AppList.d.ts +71 -0
- package/lib/types/CollapseIcon.d.ts +1 -0
- package/lib/types/Content.d.ts +0 -3
- package/lib/types/FloatMenuContainer.d.ts +28 -0
- package/lib/types/Footer.d.ts +5 -0
- package/lib/types/Header.d.ts +5 -0
- package/lib/types/Layout.d.ts +4 -0
- package/lib/types/Profile.d.ts +24 -0
- package/lib/types/SearchTrigger.d.ts +11 -0
- package/lib/types/Sider.d.ts +21 -0
- package/lib/types/index.d.ts +17 -1
- package/package.json +9 -7
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/layout
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/layout#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 tslib = require('tslib');
|
|
17
|
+
var React = require('react');
|
|
18
|
+
var classname = require('@hi-ui/classname');
|
|
19
|
+
var env = require('@hi-ui/env');
|
|
20
|
+
function _interopDefaultCompat(e) {
|
|
21
|
+
return e && _typeof(e) === 'object' && 'default' in e ? e : {
|
|
22
|
+
'default': e
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
26
|
+
|
|
27
|
+
/** @LICENSE
|
|
28
|
+
* @hi-ui/icons
|
|
29
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/icons#readme
|
|
30
|
+
*
|
|
31
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the MIT license found in the
|
|
34
|
+
* LICENSE file in the root directory of this source tree.
|
|
35
|
+
*/
|
|
36
|
+
var _prefix = classname.getPrefixCls('icon-check-outlined');
|
|
37
|
+
var CheckOutlined = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
38
|
+
var _a$prefixCls = _a.prefixCls,
|
|
39
|
+
prefixCls = _a$prefixCls === void 0 ? _prefix : _a$prefixCls,
|
|
40
|
+
className = _a.className,
|
|
41
|
+
size = _a.size,
|
|
42
|
+
styleProp = _a.style,
|
|
43
|
+
rest = tslib.__rest(_a, ["prefixCls", "className", "children", "size", "style"]);
|
|
44
|
+
var cls = classname.cx(prefixCls, className);
|
|
45
|
+
var style = Object.assign({
|
|
46
|
+
fontSize: size
|
|
47
|
+
}, styleProp);
|
|
48
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", Object.assign({
|
|
49
|
+
className: cls,
|
|
50
|
+
ref: ref,
|
|
51
|
+
role: "icon",
|
|
52
|
+
style: style
|
|
53
|
+
}, rest, {
|
|
54
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
55
|
+
viewBox: "0 0 1024 1024",
|
|
56
|
+
version: "1.1"
|
|
57
|
+
}), /*#__PURE__*/React__default["default"].createElement("path", {
|
|
58
|
+
d: "M840.832 328.832a42.666667 42.666667 0 0 0-57.621333-62.826667l-2.709334 2.496L405.333333 643.626667l-161.834666-161.813334a42.666667 42.666667 0 0 0-57.621334-2.496l-2.709333 2.496a42.666667 42.666667 0 0 0-2.496 57.621334l2.496 2.709333 192 192a42.666667 42.666667 0 0 0 57.621333 2.496l2.709334-2.496 405.333333-405.333333z",
|
|
59
|
+
"p-id": "47651"
|
|
60
|
+
}));
|
|
61
|
+
});
|
|
62
|
+
if (env.__DEV__) {
|
|
63
|
+
CheckOutlined.displayName = 'CheckOutlined';
|
|
64
|
+
}
|
|
65
|
+
exports.CheckOutlined = CheckOutlined;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/layout
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/layout#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 tslib = require('tslib');
|
|
17
|
+
var React = require('react');
|
|
18
|
+
var classname = require('@hi-ui/classname');
|
|
19
|
+
var env = require('@hi-ui/env');
|
|
20
|
+
function _interopDefaultCompat(e) {
|
|
21
|
+
return e && _typeof(e) === 'object' && 'default' in e ? e : {
|
|
22
|
+
'default': e
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
26
|
+
|
|
27
|
+
/** @LICENSE
|
|
28
|
+
* @hi-ui/icons
|
|
29
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/icons#readme
|
|
30
|
+
*
|
|
31
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the MIT license found in the
|
|
34
|
+
* LICENSE file in the root directory of this source tree.
|
|
35
|
+
*/
|
|
36
|
+
var _prefix = classname.getPrefixCls('icon-right-outlined');
|
|
37
|
+
var RightOutlined = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
38
|
+
var _a$prefixCls = _a.prefixCls,
|
|
39
|
+
prefixCls = _a$prefixCls === void 0 ? _prefix : _a$prefixCls,
|
|
40
|
+
className = _a.className,
|
|
41
|
+
size = _a.size,
|
|
42
|
+
styleProp = _a.style,
|
|
43
|
+
rest = tslib.__rest(_a, ["prefixCls", "className", "children", "size", "style"]);
|
|
44
|
+
var cls = classname.cx(prefixCls, className);
|
|
45
|
+
var style = Object.assign({
|
|
46
|
+
fontSize: size
|
|
47
|
+
}, styleProp);
|
|
48
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", Object.assign({
|
|
49
|
+
className: cls,
|
|
50
|
+
ref: ref,
|
|
51
|
+
role: "icon",
|
|
52
|
+
style: style
|
|
53
|
+
}, rest, {
|
|
54
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
55
|
+
viewBox: "0 0 1024 1024",
|
|
56
|
+
version: "1.1"
|
|
57
|
+
}), /*#__PURE__*/React__default["default"].createElement("path", {
|
|
58
|
+
d: "M414.165333 225.834667a42.666667 42.666667 0 0 0-62.826666 57.621333l2.496 2.709333L579.626667 512 353.834667 737.834667a42.666667 42.666667 0 0 0-2.496 57.621333l2.496 2.709333a42.666667 42.666667 0 0 0 57.621333 2.496l2.709333-2.496 256-256a42.666667 42.666667 0 0 0 2.496-57.621333l-2.496-2.709333-256-256z",
|
|
59
|
+
"p-id": "49596"
|
|
60
|
+
}));
|
|
61
|
+
});
|
|
62
|
+
if (env.__DEV__) {
|
|
63
|
+
RightOutlined.displayName = 'RightOutlined';
|
|
64
|
+
}
|
|
65
|
+
exports.RightOutlined = RightOutlined;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/layout
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/layout#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 tslib = require('tslib');
|
|
17
|
+
var React = require('react');
|
|
18
|
+
var classname = require('@hi-ui/classname');
|
|
19
|
+
var env = require('@hi-ui/env');
|
|
20
|
+
var Popper = require('@hi-ui/popper');
|
|
21
|
+
var usePopover = require('./use-popover.js');
|
|
22
|
+
var index = require('../../../../utils/type-assertion/lib/esm/index.js');
|
|
23
|
+
function _interopDefaultCompat(e) {
|
|
24
|
+
return e && _typeof(e) === 'object' && 'default' in e ? e : {
|
|
25
|
+
'default': e
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
29
|
+
var Popper__default = /*#__PURE__*/_interopDefaultCompat(Popper);
|
|
30
|
+
|
|
31
|
+
/** @LICENSE
|
|
32
|
+
* @hi-ui/popover
|
|
33
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/popover#readme
|
|
34
|
+
*
|
|
35
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
36
|
+
*
|
|
37
|
+
* This source code is licensed under the MIT license found in the
|
|
38
|
+
* LICENSE file in the root directory of this source tree.
|
|
39
|
+
*/
|
|
40
|
+
var _role = 'popover';
|
|
41
|
+
var prefix = classname.getPrefixCls(_role);
|
|
42
|
+
/**
|
|
43
|
+
* 气泡卡片
|
|
44
|
+
*/
|
|
45
|
+
var Popover = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
46
|
+
var _a$prefixCls = _a.prefixCls,
|
|
47
|
+
prefixCls = _a$prefixCls === void 0 ? prefix : _a$prefixCls,
|
|
48
|
+
innerRef = _a.innerRef,
|
|
49
|
+
className = _a.className,
|
|
50
|
+
children = _a.children,
|
|
51
|
+
title = _a.title,
|
|
52
|
+
content = _a.content,
|
|
53
|
+
_a$shouldWrapChildren = _a.shouldWrapChildren,
|
|
54
|
+
shouldWrapChildren = _a$shouldWrapChildren === void 0 ? false : _a$shouldWrapChildren,
|
|
55
|
+
_a$autoWrapChildren = _a.autoWrapChildren,
|
|
56
|
+
autoWrapChildren = _a$autoWrapChildren === void 0 ? true : _a$autoWrapChildren,
|
|
57
|
+
_a$wrapTagName = _a.wrapTagName,
|
|
58
|
+
wrapTagName = _a$wrapTagName === void 0 ? 'span' : _a$wrapTagName,
|
|
59
|
+
_a$showTitleDivider = _a.showTitleDivider,
|
|
60
|
+
showTitleDivider = _a$showTitleDivider === void 0 ? false : _a$showTitleDivider,
|
|
61
|
+
rest = tslib.__rest(_a, ["prefixCls", "innerRef", "className", "children", "title", "content", "shouldWrapChildren", "autoWrapChildren", "wrapTagName", "showTitleDivider"]);
|
|
62
|
+
var _usePopover = usePopover.usePopover(rest),
|
|
63
|
+
rootProps = _usePopover.rootProps,
|
|
64
|
+
getTriggerProps = _usePopover.getTriggerProps,
|
|
65
|
+
getPopperProps = _usePopover.getPopperProps,
|
|
66
|
+
getOverlayProps = _usePopover.getOverlayProps,
|
|
67
|
+
visibleAction = _usePopover.visibleAction;
|
|
68
|
+
React.useImperativeHandle(innerRef, function () {
|
|
69
|
+
return {
|
|
70
|
+
open: visibleAction.on,
|
|
71
|
+
close: visibleAction.off
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
var triggerMemo = React.useMemo(function () {
|
|
75
|
+
var trigger;
|
|
76
|
+
if ( /*#__PURE__*/React.isValidElement(children)) {
|
|
77
|
+
trigger = /*#__PURE__*/React.cloneElement(children,
|
|
78
|
+
// @ts-ignore
|
|
79
|
+
getTriggerProps(children.props, children.ref));
|
|
80
|
+
} else {
|
|
81
|
+
var TagName = wrapTagName;
|
|
82
|
+
if (shouldWrapChildren || autoWrapChildren && index.isString(children)) {
|
|
83
|
+
trigger = /*#__PURE__*/React__default["default"].createElement(TagName, Object.assign({
|
|
84
|
+
tabIndex: 0
|
|
85
|
+
}, getTriggerProps()), children);
|
|
86
|
+
} else {
|
|
87
|
+
trigger = children;
|
|
88
|
+
if (env.__DEV__) {
|
|
89
|
+
env.invariant(false, 'Make sure that the children supports the event corresponding to the trigger, you can set `shouldWrapChildren=true` to solve it.');
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return trigger;
|
|
94
|
+
}, [children, getTriggerProps, autoWrapChildren, shouldWrapChildren, wrapTagName]);
|
|
95
|
+
var cls = classname.cx(prefixCls, showTitleDivider && prefixCls + "--divided", className);
|
|
96
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, triggerMemo, /*#__PURE__*/React__default["default"].createElement(Popper__default["default"], Object.assign({}, getPopperProps(), getOverlayProps(), {
|
|
97
|
+
autoFocus: false
|
|
98
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", Object.assign({
|
|
99
|
+
ref: ref,
|
|
100
|
+
className: cls
|
|
101
|
+
}, rootProps), title ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
102
|
+
className: prefixCls + "__title"
|
|
103
|
+
}, title) : null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
104
|
+
className: prefixCls + "__content"
|
|
105
|
+
}, content))));
|
|
106
|
+
});
|
|
107
|
+
if (env.__DEV__) {
|
|
108
|
+
Popover.displayName = 'Popover';
|
|
109
|
+
}
|
|
110
|
+
exports.Popover = Popover;
|
|
111
|
+
exports.prefix = prefix;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/layout
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/layout#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
|
+
require('./styles/index.scss.js');
|
|
16
|
+
var Popover$1 = require('./Popover.js');
|
|
17
|
+
var withApi = require('./with-api.js');
|
|
18
|
+
|
|
19
|
+
/** @LICENSE
|
|
20
|
+
* @hi-ui/popover
|
|
21
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/popover#readme
|
|
22
|
+
*
|
|
23
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the MIT license found in the
|
|
26
|
+
* LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/
|
|
28
|
+
var Popover = withApi.withPopover(Popover$1.Popover);
|
|
29
|
+
exports.prefix = Popover$1.prefix;
|
|
30
|
+
exports.Popover = Popover;
|
|
31
|
+
exports["default"] = Popover;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/layout
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/layout#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 __styleInject__ = require('@hi-ui/style-inject');
|
|
17
|
+
function _interopDefaultCompat(e) {
|
|
18
|
+
return e && _typeof(e) === 'object' && 'default' in e ? e : {
|
|
19
|
+
'default': e
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
var __styleInject____default = /*#__PURE__*/_interopDefaultCompat(__styleInject__);
|
|
23
|
+
|
|
24
|
+
/** @LICENSE
|
|
25
|
+
* @hi-ui/popover
|
|
26
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/popover#readme
|
|
27
|
+
*
|
|
28
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
29
|
+
*
|
|
30
|
+
* This source code is licensed under the MIT license found in the
|
|
31
|
+
* LICENSE file in the root directory of this source tree.
|
|
32
|
+
*/
|
|
33
|
+
var css_248z = ".hi-v5-popover {overflow-wrap: break-word;font-size: var(--hi-v5-text-size-md, 0.875rem);line-height: var(--hi-v5-text-lineheight-md, 1.375rem);background: var(--hi-v5-color-static-white, #fff);padding: var(--hi-v5-spacing-6, 12px) var(--hi-v5-spacing-8, 16px);border-radius: var(--hi-v5-border-radius-xl, 8px);border: var(--hi-v5-border-size-normal, 1px solid) var(--hi-v5-color-gray-200, #e6e8eb);}.hi-v5-popover__title {-webkit-box-sizing: border-box;box-sizing: border-box;margin-bottom: var(--hi-v5-spacing-2, 4px);color: var(--hi-v5-color-gray-700, #1a1d26);font-size: var(--hi-v5-text-size-md, 0.875rem);font-weight: var(--hi-v5-text-weight-medium, 500);line-height: var(--hi-v5-text-lineheight-md, 1.375rem);}.hi-v5-popover--divided > .hi-v5-popover__title {padding-bottom: var(--hi-v5-spacing-6, 12px);margin-bottom: var(--hi-v5-spacing-6, 12px);font-size: var(--hi-v5-text-size-md, 0.875rem);line-height: var(--hi-v5-text-lineheight-md, 1.375rem);border-bottom: var(--hi-v5-border-size-normal, 1px solid) var(--hi-v5-color-gray-200, #e6e8eb);}.hi-v5-popover__content {-webkit-box-sizing: border-box;box-sizing: border-box;color: var(--hi-v5-color-gray-700, #1a1d26);line-height: var(--hi-v5-text-lineheight-md, 1.375rem);font-size: var(--hi-v5-text-size-md, 0.875rem);}";
|
|
34
|
+
__styleInject____default["default"](css_248z);
|
|
35
|
+
exports["default"] = css_248z;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/layout
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/layout#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
|
+
|
|
16
|
+
/** @LICENSE
|
|
17
|
+
* @hi-ui/popover
|
|
18
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/popover#readme
|
|
19
|
+
*
|
|
20
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the MIT license found in the
|
|
23
|
+
* LICENSE file in the root directory of this source tree.
|
|
24
|
+
*/
|
|
25
|
+
var PopoverTriggerActionEnum = {
|
|
26
|
+
CLICK: 'click',
|
|
27
|
+
CONTEXTMENU: 'contextmenu',
|
|
28
|
+
HOVER: 'hover',
|
|
29
|
+
FOCUS: 'focus'
|
|
30
|
+
};
|
|
31
|
+
exports.PopoverTriggerActionEnum = PopoverTriggerActionEnum;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/layout
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/layout#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 tslib = require('tslib');
|
|
17
|
+
var React = require('react');
|
|
18
|
+
var types = require('./types.js');
|
|
19
|
+
var index = require('../../../../hooks/use-toggle/lib/esm/index.js');
|
|
20
|
+
var Popper = require('@hi-ui/popper');
|
|
21
|
+
var index$5 = require('../../../../utils/dom-utils/lib/esm/index.js');
|
|
22
|
+
var index$6 = require('../../../../utils/react-utils/lib/esm/index.js');
|
|
23
|
+
var index$3 = require('../../../../hooks/use-id/lib/esm/index.js');
|
|
24
|
+
var index$2 = require('../../../../hooks/use-unmount-effect/lib/esm/index.js');
|
|
25
|
+
var index$7 = require('../../../../utils/array-utils/lib/esm/index.js');
|
|
26
|
+
var index$1 = require('../../../../hooks/use-timeout/lib/esm/index.js');
|
|
27
|
+
var index$4 = require('../../../../hooks/use-latest/lib/esm/index.js');
|
|
28
|
+
function _interopDefaultCompat(e) {
|
|
29
|
+
return e && _typeof(e) === 'object' && 'default' in e ? e : {
|
|
30
|
+
'default': e
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
34
|
+
|
|
35
|
+
/** @LICENSE
|
|
36
|
+
* @hi-ui/popover
|
|
37
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/popover#readme
|
|
38
|
+
*
|
|
39
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
40
|
+
*
|
|
41
|
+
* This source code is licensed under the MIT license found in the
|
|
42
|
+
* LICENSE file in the root directory of this source tree.
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
// TODO: 和 Tooltip 复用
|
|
46
|
+
var usePopover = function usePopover(_a) {
|
|
47
|
+
var visibleProp = _a.visible,
|
|
48
|
+
onOpen = _a.onOpen,
|
|
49
|
+
_onClose = _a.onClose,
|
|
50
|
+
_a$trigger = _a.trigger,
|
|
51
|
+
triggerProp = _a$trigger === void 0 ? 'click' : _a$trigger,
|
|
52
|
+
_a$mouseEnterDelay = _a.mouseEnterDelay,
|
|
53
|
+
mouseEnterDelay = _a$mouseEnterDelay === void 0 ? 100 : _a$mouseEnterDelay,
|
|
54
|
+
_a$mouseLeaveDelay = _a.mouseLeaveDelay,
|
|
55
|
+
mouseLeaveDelay = _a$mouseLeaveDelay === void 0 ? 100 : _a$mouseLeaveDelay,
|
|
56
|
+
attachEl = _a.attachEl,
|
|
57
|
+
popperClassName = _a.popperClassName,
|
|
58
|
+
restProps = tslib.__rest(_a, ["visible", "onOpen", "onClose", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "attachEl", "popperClassName"]);
|
|
59
|
+
// TODO: 移除 popper,使用 hook 重写
|
|
60
|
+
var _omitPopperOverlayPro = Popper.omitPopperOverlayProps(restProps),
|
|
61
|
+
popper = _omitPopperOverlayPro[0],
|
|
62
|
+
rest = _omitPopperOverlayPro[1];
|
|
63
|
+
var _useUncontrolledToggl = index.useUncontrolledToggle({
|
|
64
|
+
defaultVisible: false,
|
|
65
|
+
visible: visibleProp,
|
|
66
|
+
onOpen: onOpen,
|
|
67
|
+
onClose: function onClose() {
|
|
68
|
+
clearToggleTimer();
|
|
69
|
+
_onClose === null || _onClose === void 0 ? void 0 : _onClose();
|
|
70
|
+
}
|
|
71
|
+
}),
|
|
72
|
+
visible = _useUncontrolledToggl[0],
|
|
73
|
+
visibleAction = _useUncontrolledToggl[1];
|
|
74
|
+
var _useTimeout = index$1.useTimeout(function () {
|
|
75
|
+
visibleAction.on();
|
|
76
|
+
}, mouseEnterDelay),
|
|
77
|
+
startOpenTimer = _useTimeout.start,
|
|
78
|
+
clearOpenTimer = _useTimeout.clear;
|
|
79
|
+
var _useTimeout2 = index$1.useTimeout(function () {
|
|
80
|
+
if (hoveringRef.current) return;
|
|
81
|
+
visibleAction.off();
|
|
82
|
+
}, mouseLeaveDelay),
|
|
83
|
+
startCloseTimer = _useTimeout2.start,
|
|
84
|
+
clearCloseTimer = _useTimeout2.clear;
|
|
85
|
+
var clearToggleTimer = React.useCallback(function () {
|
|
86
|
+
clearOpenTimer();
|
|
87
|
+
clearCloseTimer();
|
|
88
|
+
}, [clearOpenTimer, clearCloseTimer]);
|
|
89
|
+
index$2.useUnmountEffect(clearToggleTimer);
|
|
90
|
+
var _React$useState = React__default["default"].useState(null),
|
|
91
|
+
triggerEl = _React$useState[0],
|
|
92
|
+
setTriggerEl = _React$useState[1];
|
|
93
|
+
var hoveringRef = React__default["default"].useRef(false);
|
|
94
|
+
var trigger = index$7.normalizeArray(triggerProp);
|
|
95
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
96
|
+
var triggersMemo = React__default["default"].useMemo(function () {
|
|
97
|
+
return trigger;
|
|
98
|
+
}, trigger);
|
|
99
|
+
var popoverId = index$3.useUID('popover');
|
|
100
|
+
var handlePopoverLeave = index$4.useLatestCallback(function () {
|
|
101
|
+
hoveringRef.current = false;
|
|
102
|
+
clearOpenTimer();
|
|
103
|
+
startCloseTimer();
|
|
104
|
+
});
|
|
105
|
+
var handlePopoverEnter = index$4.useLatestCallback(function () {
|
|
106
|
+
hoveringRef.current = true;
|
|
107
|
+
startOpenTimer();
|
|
108
|
+
});
|
|
109
|
+
var getOverlayProps = React__default["default"].useCallback(function (props, ref) {
|
|
110
|
+
if (props === void 0) {
|
|
111
|
+
props = {};
|
|
112
|
+
}
|
|
113
|
+
if (ref === void 0) {
|
|
114
|
+
ref = null;
|
|
115
|
+
}
|
|
116
|
+
var popoverProps = Object.assign(Object.assign({}, props), {
|
|
117
|
+
ref: ref,
|
|
118
|
+
role: 'dialog',
|
|
119
|
+
id: popoverId
|
|
120
|
+
});
|
|
121
|
+
if (triggersMemo.includes(types.PopoverTriggerActionEnum.HOVER)) {
|
|
122
|
+
popoverProps.onMouseEnter = index$5.mockDefaultHandlers(props.onMouseEnter, function () {
|
|
123
|
+
hoveringRef.current = true;
|
|
124
|
+
});
|
|
125
|
+
popoverProps.onMouseLeave = index$5.mockDefaultHandlers(props.onMouseLeave, handlePopoverLeave);
|
|
126
|
+
}
|
|
127
|
+
return popoverProps;
|
|
128
|
+
}, [triggersMemo, popoverId, handlePopoverLeave]);
|
|
129
|
+
var getTriggerProps = React__default["default"].useCallback(function (props, ref) {
|
|
130
|
+
if (props === void 0) {
|
|
131
|
+
props = {};
|
|
132
|
+
}
|
|
133
|
+
if (ref === void 0) {
|
|
134
|
+
ref = null;
|
|
135
|
+
}
|
|
136
|
+
var triggerProps = Object.assign(Object.assign({}, props), {
|
|
137
|
+
ref: index$6.mergeRefs(setTriggerEl, ref),
|
|
138
|
+
'aria-controls': popoverId,
|
|
139
|
+
'aria-haspopup': 'dialog',
|
|
140
|
+
'aria-expanded': visible
|
|
141
|
+
});
|
|
142
|
+
if (triggersMemo.includes(types.PopoverTriggerActionEnum.CLICK)) {
|
|
143
|
+
triggerProps.onClick = index$5.mockDefaultHandlers(props.onClick, visibleAction.not);
|
|
144
|
+
}
|
|
145
|
+
if (triggersMemo.includes(types.PopoverTriggerActionEnum.HOVER)) {
|
|
146
|
+
// @ref https://www.w3.org/WAI/WCAG21/Understanding/content-on-hover-or-focus.html
|
|
147
|
+
triggerProps.onFocus = index$5.mockDefaultHandlers(props.onFocus, visibleAction.on);
|
|
148
|
+
triggerProps.onBlur = index$5.mockDefaultHandlers(props.onBlur, visibleAction.off);
|
|
149
|
+
triggerProps.onMouseEnter = index$5.mockDefaultHandlers(props.onMouseEnter, handlePopoverEnter);
|
|
150
|
+
triggerProps.onMouseLeave = index$5.mockDefaultHandlers(props.onMouseLeave, handlePopoverLeave);
|
|
151
|
+
} else if (triggersMemo.includes(types.PopoverTriggerActionEnum.FOCUS)) {
|
|
152
|
+
triggerProps.onFocus = index$5.mockDefaultHandlers(props.onFocus, visibleAction.on);
|
|
153
|
+
triggerProps.onBlur = index$5.mockDefaultHandlers(props.onBlur, visibleAction.off);
|
|
154
|
+
}
|
|
155
|
+
if (triggersMemo.includes(types.PopoverTriggerActionEnum.CONTEXTMENU)) {
|
|
156
|
+
triggerProps.onContextMenu = index$5.mockDefaultHandlers(props.onContextMenu, function (evt) {
|
|
157
|
+
evt.preventDefault();
|
|
158
|
+
visibleAction.not();
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
return triggerProps;
|
|
162
|
+
}, [triggersMemo, popoverId, visibleAction, visible, handlePopoverEnter, handlePopoverLeave]);
|
|
163
|
+
var getPopperProps = React__default["default"].useCallback(function () {
|
|
164
|
+
var popperProps = index$6.withDefaultProps(popper, {
|
|
165
|
+
arrow: true,
|
|
166
|
+
placement: 'top',
|
|
167
|
+
// @DesignToken zIndex: `popper`
|
|
168
|
+
zIndex: 1030,
|
|
169
|
+
// @DesignToken 10
|
|
170
|
+
gutterGap: 14
|
|
171
|
+
});
|
|
172
|
+
return Object.assign(Object.assign({}, popperProps), {
|
|
173
|
+
visible: visible,
|
|
174
|
+
attachEl: attachEl !== null && attachEl !== void 0 ? attachEl : triggerEl,
|
|
175
|
+
onClose: visibleAction.off,
|
|
176
|
+
className: popperClassName
|
|
177
|
+
});
|
|
178
|
+
}, [popper, visible, attachEl, triggerEl, visibleAction.off, popperClassName]);
|
|
179
|
+
return {
|
|
180
|
+
rootProps: rest,
|
|
181
|
+
getOverlayProps: getOverlayProps,
|
|
182
|
+
getTriggerProps: getTriggerProps,
|
|
183
|
+
getPopperProps: getPopperProps,
|
|
184
|
+
visibleAction: visibleAction
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
exports.usePopover = usePopover;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/layout
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/layout#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
|
+
|
|
16
|
+
/** @LICENSE
|
|
17
|
+
* @hi-ui/popover
|
|
18
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/popover#readme
|
|
19
|
+
*
|
|
20
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the MIT license found in the
|
|
23
|
+
* LICENSE file in the root directory of this source tree.
|
|
24
|
+
*/
|
|
25
|
+
/** @LICENSE
|
|
26
|
+
* @hi-ui/container
|
|
27
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/container#readme
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* 获取用于承载组件的容器,将挂载在 body 下面
|
|
36
|
+
*
|
|
37
|
+
* @param selector 以 `.` 开头的选择器类
|
|
38
|
+
* @returns 容器元素
|
|
39
|
+
*/
|
|
40
|
+
var getContainer = function getContainer(selector, doc, customWrapper) {
|
|
41
|
+
if (doc === void 0) {
|
|
42
|
+
doc = document;
|
|
43
|
+
}
|
|
44
|
+
var rootElm = doc.querySelector(selector);
|
|
45
|
+
if (rootElm) return rootElm;
|
|
46
|
+
rootElm = doc.createElement('div');
|
|
47
|
+
rootElm.className = selector.slice(1);
|
|
48
|
+
var wrapper = customWrapper !== null && customWrapper !== void 0 ? customWrapper : doc.body;
|
|
49
|
+
wrapper.appendChild(rootElm);
|
|
50
|
+
return rootElm;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* 从 DOM 中移除指定的承载容器
|
|
54
|
+
*
|
|
55
|
+
* @param selector 以 `.` 开头的选择器类
|
|
56
|
+
*/
|
|
57
|
+
var removeContainer = function removeContainer(selector, doc) {
|
|
58
|
+
if (doc === void 0) {
|
|
59
|
+
doc = document;
|
|
60
|
+
}
|
|
61
|
+
var rootElm = doc.querySelector(selector);
|
|
62
|
+
if (rootElm && rootElm.parentNode) {
|
|
63
|
+
rootElm.parentNode.removeChild(rootElm);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
exports.getContainer = getContainer;
|
|
67
|
+
exports.removeContainer = removeContainer;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/** @LICENSE
|
|
2
|
+
* @hi-ui/layout
|
|
3
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/layout#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 tslib = require('tslib');
|
|
16
|
+
var React = require('react');
|
|
17
|
+
var require$$2 = require('react-dom');
|
|
18
|
+
var index$1 = require('./utils/container/lib/esm/index.js');
|
|
19
|
+
var index = require('../../../../hooks/use-id/lib/esm/index.js');
|
|
20
|
+
var Popover = require('./Popover.js');
|
|
21
|
+
|
|
22
|
+
/** @LICENSE
|
|
23
|
+
* @hi-ui/popover
|
|
24
|
+
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/popover#readme
|
|
25
|
+
*
|
|
26
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
27
|
+
*
|
|
28
|
+
* This source code is licensed under the MIT license found in the
|
|
29
|
+
* LICENSE file in the root directory of this source tree.
|
|
30
|
+
*/
|
|
31
|
+
var prefixCls = Popover.prefix;
|
|
32
|
+
var selector = "." + prefixCls + "-wrapper";
|
|
33
|
+
var popoverInstanceCache = {};
|
|
34
|
+
var open = function open(target, _a) {
|
|
35
|
+
var key = _a.key,
|
|
36
|
+
disabledPortal = _a.disabledPortal,
|
|
37
|
+
rest = tslib.__rest(_a, ["key", "disabledPortal"]);
|
|
38
|
+
if (!key) {
|
|
39
|
+
key = index.uuid();
|
|
40
|
+
}
|
|
41
|
+
var selectId = selector + "__" + key;
|
|
42
|
+
var container = index$1.getContainer(selectId, undefined, disabledPortal ? target.parentNode : undefined);
|
|
43
|
+
var popoverRef = /*#__PURE__*/React.createRef();
|
|
44
|
+
var ClonedPopover = /*#__PURE__*/React.createElement(Popover.Popover, Object.assign({
|
|
45
|
+
innerRef: popoverRef,
|
|
46
|
+
container: container,
|
|
47
|
+
attachEl: target,
|
|
48
|
+
closeOnOutsideClick: false,
|
|
49
|
+
shouldWrapChildren: true,
|
|
50
|
+
onExited: function onExited() {
|
|
51
|
+
// 卸载
|
|
52
|
+
if (container) {
|
|
53
|
+
require$$2.unmountComponentAtNode(container);
|
|
54
|
+
index$1.removeContainer(selectId);
|
|
55
|
+
}
|
|
56
|
+
container = undefined;
|
|
57
|
+
}
|
|
58
|
+
}, rest));
|
|
59
|
+
requestAnimationFrame(function () {
|
|
60
|
+
require$$2.render(ClonedPopover, container);
|
|
61
|
+
popoverRef.current.open();
|
|
62
|
+
});
|
|
63
|
+
var close = function close() {
|
|
64
|
+
var _a;
|
|
65
|
+
(_a = popoverRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
66
|
+
};
|
|
67
|
+
if (key) {
|
|
68
|
+
popoverInstanceCache[key] = close;
|
|
69
|
+
}
|
|
70
|
+
return key;
|
|
71
|
+
};
|
|
72
|
+
var close = function close(key) {
|
|
73
|
+
if (typeof popoverInstanceCache[key] === 'function') {
|
|
74
|
+
popoverInstanceCache[key]();
|
|
75
|
+
}
|
|
76
|
+
delete popoverInstanceCache[key];
|
|
77
|
+
};
|
|
78
|
+
function withPopover(instance) {
|
|
79
|
+
return Object.assign(instance, {
|
|
80
|
+
open: open,
|
|
81
|
+
close: close
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
exports.withPopover = withPopover;
|