@fluentui/react-popover 9.0.0-alpha.8 → 9.0.0-nightly.f81b28ceb3.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +1800 -1
- package/CHANGELOG.md +566 -2
- package/Spec.md +6 -6
- package/dist/react-popover.d.ts +59 -77
- package/lib/Popover.js.map +1 -1
- package/lib/PopoverSurface.js.map +1 -1
- package/lib/PopoverTrigger.js.map +1 -1
- package/lib/common/isConformant.d.ts +1 -1
- package/lib/common/isConformant.js +9 -5
- package/lib/common/isConformant.js.map +1 -1
- package/lib/common/mockUsePopoverContext.d.ts +1 -1
- package/lib/common/mockUsePopoverContext.js +28 -6
- package/lib/common/mockUsePopoverContext.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts +2 -2
- package/lib/components/Popover/Popover.js +4 -3
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/Popover.types.d.ts +24 -33
- package/lib/components/Popover/Popover.types.js.map +1 -1
- package/lib/components/Popover/index.js.map +1 -1
- package/lib/components/Popover/renderPopover.d.ts +1 -1
- package/lib/components/Popover/renderPopover.js +29 -17
- package/lib/components/Popover/renderPopover.js.map +1 -1
- package/lib/components/Popover/usePopover.d.ts +2 -3
- package/lib/components/Popover/usePopover.js +110 -88
- package/lib/components/Popover/usePopover.js.map +1 -1
- package/lib/components/PopoverSurface/PopoverSurface.d.ts +3 -3
- package/lib/components/PopoverSurface/PopoverSurface.js +5 -4
- package/lib/components/PopoverSurface/PopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/PopoverSurface.types.d.ts +9 -18
- package/lib/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
- package/lib/components/PopoverSurface/index.js.map +1 -1
- package/lib/components/PopoverSurface/renderPopoverSurface.d.ts +1 -1
- package/lib/components/PopoverSurface/renderPopoverSurface.js +18 -10
- package/lib/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/usePopoverSurface.d.ts +4 -4
- package/lib/components/PopoverSurface/usePopoverSurface.js +94 -54
- package/lib/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +2 -2
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js +88 -64
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
- package/lib/components/PopoverTrigger/PopoverTrigger.d.ts +2 -2
- package/lib/components/PopoverTrigger/PopoverTrigger.js +4 -3
- package/lib/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
- package/lib/components/PopoverTrigger/PopoverTrigger.types.d.ts +3 -4
- package/lib/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
- package/lib/components/PopoverTrigger/index.js.map +1 -1
- package/lib/components/PopoverTrigger/renderPopoverTrigger.d.ts +1 -1
- package/lib/components/PopoverTrigger/renderPopoverTrigger.js +1 -1
- package/lib/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
- package/lib/components/PopoverTrigger/usePopoverTrigger.d.ts +2 -3
- package/lib/components/PopoverTrigger/usePopoverTrigger.js +83 -60
- package/lib/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/popoverContext.d.ts +4 -5
- package/lib/popoverContext.js +19 -12
- package/lib/popoverContext.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib-commonjs/Popover.js +7 -2
- package/lib-commonjs/Popover.js.map +1 -1
- package/lib-commonjs/PopoverSurface.js +7 -2
- package/lib-commonjs/PopoverSurface.js.map +1 -1
- package/lib-commonjs/PopoverTrigger.js +7 -2
- package/lib-commonjs/PopoverTrigger.js.map +1 -1
- package/lib-commonjs/common/isConformant.d.ts +1 -1
- package/lib-commonjs/common/isConformant.js +18 -7
- package/lib-commonjs/common/isConformant.js.map +1 -1
- package/lib-commonjs/common/mockUsePopoverContext.d.ts +1 -1
- package/lib-commonjs/common/mockUsePopoverContext.js +38 -9
- package/lib-commonjs/common/mockUsePopoverContext.js.map +1 -1
- package/lib-commonjs/components/Popover/Popover.d.ts +2 -2
- package/lib-commonjs/components/Popover/Popover.js +14 -6
- package/lib-commonjs/components/Popover/Popover.js.map +1 -1
- package/lib-commonjs/components/Popover/Popover.types.d.ts +24 -33
- package/lib-commonjs/components/Popover/Popover.types.js +4 -1
- package/lib-commonjs/components/Popover/Popover.types.js.map +1 -1
- package/lib-commonjs/components/Popover/index.js +10 -2
- package/lib-commonjs/components/Popover/index.js.map +1 -1
- package/lib-commonjs/components/Popover/renderPopover.d.ts +1 -1
- package/lib-commonjs/components/Popover/renderPopover.js +39 -20
- package/lib-commonjs/components/Popover/renderPopover.js.map +1 -1
- package/lib-commonjs/components/Popover/usePopover.d.ts +2 -3
- package/lib-commonjs/components/Popover/usePopover.js +127 -93
- package/lib-commonjs/components/Popover/usePopover.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.d.ts +3 -3
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.js +18 -9
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.d.ts +9 -18
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.js +4 -1
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/index.js +11 -2
- package/lib-commonjs/components/PopoverSurface/index.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.d.ts +1 -1
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js +32 -14
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.d.ts +4 -4
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js +110 -60
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +2 -2
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js +95 -65
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.d.ts +2 -2
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js +14 -6
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.d.ts +3 -4
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.js +4 -1
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/index.js +10 -2
- package/lib-commonjs/components/PopoverTrigger/index.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.d.ts +1 -1
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js +7 -2
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.d.ts +2 -3
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js +98 -65
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
- package/lib-commonjs/index.js +10 -2
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/popoverContext.d.ts +4 -5
- package/lib-commonjs/popoverContext.js +28 -14
- package/lib-commonjs/popoverContext.js.map +1 -1
- package/package.json +18 -15
- package/.storybook/main.js +0 -11
- package/.storybook/preview.js +0 -4
- package/bundle-size/Popover.fixture.js +0 -7
- package/config/api-extractor.json +0 -3
- package/config/tests.js +0 -7
- package/e2e/Popover.e2e.ts +0 -139
- package/etc/react-popover.api.md +0 -135
- package/just.config.ts +0 -3
- package/lib/Popover.stories.d.ts +0 -62
- package/lib/Popover.stories.js +0 -114
- package/lib/Popover.stories.js.map +0 -1
- package/lib/components/Popover/getOffsetWithArrow.d.ts +0 -7
- package/lib/components/Popover/getOffsetWithArrow.js +0 -34
- package/lib/components/Popover/getOffsetWithArrow.js.map +0 -1
- package/lib-amd/Popover.d.ts +0 -1
- package/lib-amd/Popover.js +0 -6
- package/lib-amd/Popover.js.map +0 -1
- package/lib-amd/Popover.stories.d.ts +0 -62
- package/lib-amd/Popover.stories.js +0 -121
- package/lib-amd/Popover.stories.js.map +0 -1
- package/lib-amd/PopoverSurface.d.ts +0 -1
- package/lib-amd/PopoverSurface.js +0 -6
- package/lib-amd/PopoverSurface.js.map +0 -1
- package/lib-amd/PopoverTrigger.d.ts +0 -1
- package/lib-amd/PopoverTrigger.js +0 -6
- package/lib-amd/PopoverTrigger.js.map +0 -1
- package/lib-amd/common/isConformant.d.ts +0 -4
- package/lib-amd/common/isConformant.js +0 -14
- package/lib-amd/common/isConformant.js.map +0 -1
- package/lib-amd/common/mockUsePopoverContext.d.ts +0 -7
- package/lib-amd/common/mockUsePopoverContext.js +0 -20
- package/lib-amd/common/mockUsePopoverContext.js.map +0 -1
- package/lib-amd/components/Popover/Popover.d.ts +0 -6
- package/lib-amd/components/Popover/Popover.js +0 -15
- package/lib-amd/components/Popover/Popover.js.map +0 -1
- package/lib-amd/components/Popover/Popover.types.d.ts +0 -109
- package/lib-amd/components/Popover/Popover.types.js +0 -5
- package/lib-amd/components/Popover/Popover.types.js.map +0 -1
- package/lib-amd/components/Popover/getOffsetWithArrow.d.ts +0 -7
- package/lib-amd/components/Popover/getOffsetWithArrow.js +0 -40
- package/lib-amd/components/Popover/getOffsetWithArrow.js.map +0 -1
- package/lib-amd/components/Popover/index.d.ts +0 -4
- package/lib-amd/components/Popover/index.js +0 -9
- package/lib-amd/components/Popover/index.js.map +0 -1
- package/lib-amd/components/Popover/renderPopover.d.ts +0 -5
- package/lib-amd/components/Popover/renderPopover.js +0 -29
- package/lib-amd/components/Popover/renderPopover.js.map +0 -1
- package/lib-amd/components/Popover/usePopover.d.ts +0 -11
- package/lib-amd/components/Popover/usePopover.js +0 -112
- package/lib-amd/components/Popover/usePopover.js.map +0 -1
- package/lib-amd/components/PopoverSurface/PopoverSurface.d.ts +0 -6
- package/lib-amd/components/PopoverSurface/PopoverSurface.js +0 -15
- package/lib-amd/components/PopoverSurface/PopoverSurface.js.map +0 -1
- package/lib-amd/components/PopoverSurface/PopoverSurface.types.d.ts +0 -30
- package/lib-amd/components/PopoverSurface/PopoverSurface.types.js +0 -5
- package/lib-amd/components/PopoverSurface/PopoverSurface.types.js.map +0 -1
- package/lib-amd/components/PopoverSurface/index.d.ts +0 -5
- package/lib-amd/components/PopoverSurface/index.js +0 -10
- package/lib-amd/components/PopoverSurface/index.js.map +0 -1
- package/lib-amd/components/PopoverSurface/renderPopoverSurface.d.ts +0 -5
- package/lib-amd/components/PopoverSurface/renderPopoverSurface.js +0 -21
- package/lib-amd/components/PopoverSurface/renderPopoverSurface.js.map +0 -1
- package/lib-amd/components/PopoverSurface/usePopoverSurface.d.ts +0 -13
- package/lib-amd/components/PopoverSurface/usePopoverSurface.js +0 -69
- package/lib-amd/components/PopoverSurface/usePopoverSurface.js.map +0 -1
- package/lib-amd/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +0 -7
- package/lib-amd/components/PopoverSurface/usePopoverSurfaceStyles.js +0 -81
- package/lib-amd/components/PopoverSurface/usePopoverSurfaceStyles.js.map +0 -1
- package/lib-amd/components/PopoverTrigger/PopoverTrigger.d.ts +0 -6
- package/lib-amd/components/PopoverTrigger/PopoverTrigger.js +0 -15
- package/lib-amd/components/PopoverTrigger/PopoverTrigger.js.map +0 -1
- package/lib-amd/components/PopoverTrigger/PopoverTrigger.types.d.ts +0 -12
- package/lib-amd/components/PopoverTrigger/PopoverTrigger.types.js +0 -5
- package/lib-amd/components/PopoverTrigger/PopoverTrigger.types.js.map +0 -1
- package/lib-amd/components/PopoverTrigger/index.d.ts +0 -4
- package/lib-amd/components/PopoverTrigger/index.js +0 -9
- package/lib-amd/components/PopoverTrigger/index.js.map +0 -1
- package/lib-amd/components/PopoverTrigger/renderPopoverTrigger.d.ts +0 -5
- package/lib-amd/components/PopoverTrigger/renderPopoverTrigger.js +0 -13
- package/lib-amd/components/PopoverTrigger/renderPopoverTrigger.js.map +0 -1
- package/lib-amd/components/PopoverTrigger/usePopoverTrigger.d.ts +0 -11
- package/lib-amd/components/PopoverTrigger/usePopoverTrigger.js +0 -75
- package/lib-amd/components/PopoverTrigger/usePopoverTrigger.js.map +0 -1
- package/lib-amd/index.d.ts +0 -4
- package/lib-amd/index.js +0 -9
- package/lib-amd/index.js.map +0 -1
- package/lib-amd/popoverContext.d.ts +0 -9
- package/lib-amd/popoverContext.js +0 -22
- package/lib-amd/popoverContext.js.map +0 -1
- package/lib-commonjs/Popover.stories.d.ts +0 -62
- package/lib-commonjs/Popover.stories.js +0 -122
- package/lib-commonjs/Popover.stories.js.map +0 -1
- package/lib-commonjs/components/Popover/getOffsetWithArrow.d.ts +0 -7
- package/lib-commonjs/components/Popover/getOffsetWithArrow.js +0 -38
- package/lib-commonjs/components/Popover/getOffsetWithArrow.js.map +0 -1
- package/src/components/Popover/Popover.types.ts +0 -124
- package/src/components/PopoverSurface/PopoverSurface.types.ts +0 -36
- package/src/components/PopoverTrigger/PopoverTrigger.types.ts +0 -13
@@ -1,12 +1,19 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
3
6
|
exports.usePopoverTrigger = void 0;
|
4
|
-
|
5
|
-
var
|
6
|
-
|
7
|
-
var
|
8
|
-
|
9
|
-
var
|
7
|
+
|
8
|
+
var tslib_1 = /*#__PURE__*/require("tslib");
|
9
|
+
|
10
|
+
var React = /*#__PURE__*/require("react");
|
11
|
+
|
12
|
+
var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
13
|
+
|
14
|
+
var react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
15
|
+
|
16
|
+
var popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
|
10
17
|
/**
|
11
18
|
* Create the state required to render PopoverTrigger.
|
12
19
|
*
|
@@ -14,65 +21,91 @@ var mergeProps = react_utilities_1.makeMergeProps({});
|
|
14
21
|
* before being passed to renderPopoverTrigger.
|
15
22
|
*
|
16
23
|
* @param props - props from this instance of PopoverTrigger
|
17
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
18
24
|
*/
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
25
|
+
|
26
|
+
|
27
|
+
var usePopoverTrigger = function (props) {
|
28
|
+
var setOpen = popoverContext_1.usePopoverContext(function (context) {
|
29
|
+
return context.setOpen;
|
30
|
+
});
|
31
|
+
var open = popoverContext_1.usePopoverContext(function (context) {
|
32
|
+
return context.open;
|
33
|
+
});
|
34
|
+
var triggerRef = popoverContext_1.usePopoverContext(function (context) {
|
35
|
+
return context.triggerRef;
|
36
|
+
});
|
37
|
+
var openOnHover = popoverContext_1.usePopoverContext(function (context) {
|
38
|
+
return context.openOnHover;
|
39
|
+
});
|
40
|
+
var openOnContext = popoverContext_1.usePopoverContext(function (context) {
|
41
|
+
return context.openOnContext;
|
42
|
+
});
|
43
|
+
var triggerAttributes = react_tabster_1.useModalAttributes().triggerAttributes;
|
44
|
+
var onContextMenu = react_utilities_1.useEventCallback(function (e) {
|
45
|
+
var _a, _b;
|
46
|
+
|
47
|
+
if (openOnContext) {
|
48
|
+
e.preventDefault();
|
49
|
+
setOpen(e, true);
|
50
|
+
}
|
51
|
+
|
52
|
+
(_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onContextMenu) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
53
|
+
});
|
54
|
+
var onClick = react_utilities_1.useEventCallback(function (e) {
|
55
|
+
var _a, _b;
|
56
|
+
|
57
|
+
if (!openOnContext) {
|
58
|
+
setOpen(e, !open);
|
59
|
+
}
|
60
|
+
|
61
|
+
(_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
62
|
+
});
|
63
|
+
var onKeyDown = react_utilities_1.useEventCallback(function (e) {
|
64
|
+
var _a, _b, _c;
|
65
|
+
|
66
|
+
if (react_utilities_1.shouldPreventDefaultOnKeyDown(e) && (e.key === ' ' || e.key === 'Enter')) {
|
67
|
+
e.preventDefault();
|
68
|
+
(_a = e.target) === null || _a === void 0 ? void 0 : _a.click();
|
69
|
+
}
|
70
|
+
|
71
|
+
if (e.key === 'Escape') {
|
72
|
+
setOpen(e, false);
|
73
|
+
}
|
74
|
+
|
75
|
+
(_c = (_b = child.props) === null || _b === void 0 ? void 0 : _b.onKeyDown) === null || _c === void 0 ? void 0 : _c.call(_b, e);
|
76
|
+
});
|
77
|
+
var onMouseEnter = react_utilities_1.useEventCallback(function (e) {
|
78
|
+
var _a, _b;
|
79
|
+
|
80
|
+
if (openOnHover) {
|
81
|
+
setOpen(e, true);
|
82
|
+
}
|
83
|
+
|
84
|
+
(_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onMouseEnter) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
85
|
+
});
|
86
|
+
var onMouseLeave = react_utilities_1.useEventCallback(function (e) {
|
87
|
+
var _a, _b;
|
88
|
+
|
89
|
+
if (openOnHover) {
|
90
|
+
setOpen(e, false);
|
91
|
+
}
|
92
|
+
|
93
|
+
(_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onMouseLeave) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
94
|
+
});
|
95
|
+
var child = React.Children.only(props.children);
|
96
|
+
return {
|
97
|
+
children: React.cloneElement(child, tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, triggerAttributes), {
|
98
|
+
'aria-haspopup': 'true'
|
99
|
+
}), child.props), {
|
100
|
+
onClick: onClick,
|
101
|
+
onMouseEnter: onMouseEnter,
|
102
|
+
onKeyDown: onKeyDown,
|
103
|
+
onMouseLeave: onMouseLeave,
|
104
|
+
onContextMenu: onContextMenu,
|
105
|
+
ref: react_utilities_1.useMergedRefs(child.ref, triggerRef)
|
106
|
+
}))
|
107
|
+
};
|
76
108
|
};
|
109
|
+
|
77
110
|
exports.usePopoverTrigger = usePopoverTrigger;
|
78
111
|
//# sourceMappingURL=usePopoverTrigger.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../src/components/PopoverTrigger/usePopoverTrigger.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,IAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,IAAA,gBAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;AAGA;;;;;;;AAOG;;;AACI,IAAM,iBAAiB,GAAG,UAAC,KAAD,EAA2B;AAC1D,MAAM,OAAO,GAAG,gBAAA,CAAA,iBAAA,CAAkB,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,OAAA;AAAe,GAA5C,CAAhB;AACA,MAAM,IAAI,GAAG,gBAAA,CAAA,iBAAA,CAAkB,UAAA,OAAA,EAAO;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,GAAiB,iBAAjB","sourceRoot":""}
|
package/lib-commonjs/index.js
CHANGED
@@ -1,8 +1,16 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
|
7
|
+
var tslib_1 = /*#__PURE__*/require("tslib");
|
8
|
+
|
4
9
|
tslib_1.__exportStar(require("./Popover"), exports);
|
10
|
+
|
5
11
|
tslib_1.__exportStar(require("./PopoverSurface"), exports);
|
12
|
+
|
6
13
|
tslib_1.__exportStar(require("./popoverContext"), exports);
|
14
|
+
|
7
15
|
tslib_1.__exportStar(require("./PopoverTrigger"), exports);
|
8
16
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,WAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA","sourceRoot":""}
|
@@ -1,9 +1,8 @@
|
|
1
|
-
import { ContextSelector, Context } from '@fluentui/react-context-selector';
|
2
|
-
import { PopoverState } from './components/Popover/index';
|
1
|
+
import type { ContextSelector, Context } from '@fluentui/react-context-selector';
|
2
|
+
import type { PopoverState } from './components/Popover/index';
|
3
3
|
export declare const PopoverContext: Context<PopoverContextValue>;
|
4
4
|
/**
|
5
5
|
* Context shared between Popover and its children components
|
6
6
|
*/
|
7
|
-
export
|
8
|
-
|
9
|
-
export declare const usePopoverContext: <T>(selector: ContextSelector<PopoverContextValue, T>) => T;
|
7
|
+
export declare type PopoverContextValue = Pick<PopoverState, 'open' | 'setOpen' | 'triggerRef' | 'contentRef' | 'openOnHover' | 'openOnContext' | 'mountNode' | 'noArrow' | 'arrowRef' | 'size' | 'appearance' | 'trapFocus'>;
|
8
|
+
export declare const usePopoverContext: <T>(selector: ContextSelector<Pick<PopoverState, "mountNode" | "open" | "setOpen" | "triggerRef" | "contentRef" | "openOnHover" | "openOnContext" | "noArrow" | "arrowRef" | "size" | "appearance" | "trapFocus">, T>) => T;
|
@@ -1,21 +1,35 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
3
6
|
exports.usePopoverContext = exports.PopoverContext = void 0;
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
7
|
+
|
8
|
+
var react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-selector");
|
9
|
+
|
10
|
+
exports.PopoverContext = /*#__PURE__*/react_context_selector_1.createContext({
|
11
|
+
open: false,
|
12
|
+
setOpen: function () {
|
13
|
+
return null;
|
14
|
+
},
|
15
|
+
triggerRef: {
|
16
|
+
current: null
|
17
|
+
},
|
18
|
+
contentRef: {
|
19
|
+
current: null
|
20
|
+
},
|
21
|
+
arrowRef: {
|
22
|
+
current: null
|
23
|
+
},
|
24
|
+
openOnContext: false,
|
25
|
+
openOnHover: false,
|
26
|
+
size: 'medium',
|
27
|
+
trapFocus: false
|
16
28
|
});
|
29
|
+
|
17
30
|
var usePopoverContext = function (selector) {
|
18
|
-
|
31
|
+
return react_context_selector_1.useContextSelector(exports.PopoverContext, selector);
|
19
32
|
};
|
33
|
+
|
20
34
|
exports.usePopoverContext = usePopoverContext;
|
21
35
|
//# sourceMappingURL=popoverContext.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../src/popoverContext.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;;AAIa,OAAA,CAAA,cAAA,gBAA+C,wBAAA,CAAA,aAAA,CAAmC;AAC7F,EAAA,IAAI,EAAE,KADuF;AAE7F,EAAA,OAAO,EAAE,YAAA;AAAM,WAAA,IAAA;AAAI,GAF0E;AAG7F,EAAA,UAAU,EAAE;AAAE,IAAA,OAAO,EAAE;AAAX,GAHiF;AAI7F,EAAA,UAAU,EAAE;AAAE,IAAA,OAAO,EAAE;AAAX,GAJiF;AAK7F,EAAA,QAAQ,EAAE;AAAE,IAAA,OAAO,EAAE;AAAX,GALmF;AAM7F,EAAA,aAAa,EAAE,KAN8E;AAO7F,EAAA,WAAW,EAAE,KAPgF;AAQ7F,EAAA,IAAI,EAAE,QARuF;AAS7F,EAAA,SAAS,EAAE;AATkF,CAAnC,CAA/C;;AA+BN,IAAM,iBAAiB,GAAG,UAAI,QAAJ,EAAqD;AACpF,SAAA,wBAAA,CAAA,kBAAA,CAAmB,OAAA,CAAA,cAAnB,EAAmC,QAAnC,CAAA;AAA4C,CADvC;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","sourceRoot":""}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-popover",
|
3
|
-
"version": "9.0.0-
|
3
|
+
"version": "9.0.0-nightly.f81b28ceb3.1",
|
4
4
|
"description": "Popover component for Fluent UI",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -18,16 +18,19 @@
|
|
18
18
|
"code-style": "just-scripts code-style",
|
19
19
|
"just": "just-scripts",
|
20
20
|
"lint": "just-scripts lint",
|
21
|
-
"start": "
|
22
|
-
"
|
21
|
+
"start": "yarn storybook",
|
22
|
+
"e2e": "e2e",
|
23
23
|
"storybook": "start-storybook",
|
24
24
|
"test": "jest",
|
25
|
-
"
|
25
|
+
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
|
26
|
+
"build:local": "tsc -p . --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output dist/react-popover/src && yarn docs"
|
26
27
|
},
|
27
28
|
"devDependencies": {
|
28
|
-
"@fluentui/
|
29
|
-
"@fluentui/
|
30
|
-
"@fluentui/
|
29
|
+
"@fluentui/babel-make-styles": "9.0.0-nightly.f81b28ceb3.1",
|
30
|
+
"@fluentui/eslint-plugin": "*",
|
31
|
+
"@fluentui/jest-serializer-make-styles": "9.0.0-nightly.f81b28ceb3.1",
|
32
|
+
"@fluentui/react-conformance": "*",
|
33
|
+
"@fluentui/react-conformance-make-styles": "9.0.0-nightly.f81b28ceb3.1",
|
31
34
|
"@fluentui/scripts": "^1.0.0",
|
32
35
|
"@types/enzyme": "3.10.3",
|
33
36
|
"@types/enzyme-adapter-react-16": "1.0.3",
|
@@ -41,13 +44,13 @@
|
|
41
44
|
"react-test-renderer": "^16.3.0"
|
42
45
|
},
|
43
46
|
"dependencies": {
|
44
|
-
"@fluentui/react-context-selector": "
|
45
|
-
"@fluentui/react-make-styles": "
|
46
|
-
"@fluentui/react-portal": "
|
47
|
-
"@fluentui/react-positioning": "
|
48
|
-
"@fluentui/react-shared-contexts": "
|
49
|
-
"@fluentui/react-tabster": "
|
50
|
-
"@fluentui/react-utilities": "
|
47
|
+
"@fluentui/react-context-selector": "9.0.0-nightly.f81b28ceb3.1",
|
48
|
+
"@fluentui/react-make-styles": "9.0.0-nightly.f81b28ceb3.1",
|
49
|
+
"@fluentui/react-portal": "9.0.0-nightly.f81b28ceb3.1",
|
50
|
+
"@fluentui/react-positioning": "9.0.0-nightly.f81b28ceb3.1",
|
51
|
+
"@fluentui/react-shared-contexts": "9.0.0-nightly.f81b28ceb3.1",
|
52
|
+
"@fluentui/react-tabster": "9.0.0-nightly.f81b28ceb3.1",
|
53
|
+
"@fluentui/react-utilities": "9.0.0-nightly.f81b28ceb3.1",
|
51
54
|
"tslib": "^2.1.0"
|
52
55
|
},
|
53
56
|
"peerDependencies": {
|
@@ -57,7 +60,7 @@
|
|
57
60
|
"react-dom": ">=16.8.0 <18.0.0"
|
58
61
|
},
|
59
62
|
"beachball": {
|
60
|
-
"tag": "
|
63
|
+
"tag": "beta",
|
61
64
|
"disallowedChangeTypes": [
|
62
65
|
"major",
|
63
66
|
"minor",
|
package/.storybook/main.js
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
const rootMain = require('../../../.storybook/main');
|
2
|
-
|
3
|
-
module.exports = /** @type {Pick<import('../../../.storybook/main').StorybookConfig,'addons'|'stories'|'webpackFinal'>} */ ({
|
4
|
-
stories: [...rootMain.stories, '../src/**/*.stories.mdx', '../src/**/*.stories.@(ts|tsx)'],
|
5
|
-
addons: [...rootMain.addons],
|
6
|
-
webpackFinal: (config, options) => {
|
7
|
-
const localConfig = { ...rootMain.webpackFinal(config, options) };
|
8
|
-
|
9
|
-
return localConfig;
|
10
|
-
},
|
11
|
-
});
|
package/.storybook/preview.js
DELETED
package/config/tests.js
DELETED
package/e2e/Popover.e2e.ts
DELETED
@@ -1,139 +0,0 @@
|
|
1
|
-
const popoverTriggerSelector = '[aria-haspopup="true"]';
|
2
|
-
const popoverContentSelector = '[role="dialog"]';
|
3
|
-
const popoverStoriesTitle = 'Components/Popover';
|
4
|
-
|
5
|
-
const popoverDefaultStory = 'Default';
|
6
|
-
const popoverAnchorToTargetStory = 'AnchorToTarget';
|
7
|
-
const popoverControlledStory = 'Controlled';
|
8
|
-
const popoverWithCustomTriggerStory = 'WithCustomTrigger';
|
9
|
-
const popoverNestedStory = 'NestedPopovers';
|
10
|
-
|
11
|
-
describe('Popover', () => {
|
12
|
-
before(() => {
|
13
|
-
cy.visitStorybook();
|
14
|
-
});
|
15
|
-
|
16
|
-
[popoverDefaultStory, popoverAnchorToTargetStory, popoverControlledStory].forEach(story => {
|
17
|
-
describe(story, () => {
|
18
|
-
beforeEach(() => {
|
19
|
-
cy.get('body').click('bottomRight').loadStory(popoverStoriesTitle, story);
|
20
|
-
});
|
21
|
-
|
22
|
-
it('should open when clicked', () => {
|
23
|
-
cy.get(popoverTriggerSelector).click().get(popoverContentSelector).should('be.visible');
|
24
|
-
});
|
25
|
-
|
26
|
-
['{enter}', 'Space'].forEach((key: '{enter}' | 'Space') => {
|
27
|
-
it(`should open with ${key}`, () => {
|
28
|
-
cy.get(popoverTriggerSelector).focus().realPress(key);
|
29
|
-
|
30
|
-
cy.get(popoverContentSelector).should('be.visible');
|
31
|
-
});
|
32
|
-
});
|
33
|
-
|
34
|
-
it('should dismiss on click outside', () => {
|
35
|
-
cy.get(popoverTriggerSelector)
|
36
|
-
.click()
|
37
|
-
.get('body')
|
38
|
-
.click('bottomRight')
|
39
|
-
.get(popoverContentSelector)
|
40
|
-
.should('not.exist');
|
41
|
-
});
|
42
|
-
|
43
|
-
it('should dismiss on Escape keydown', () => {
|
44
|
-
cy.get(popoverTriggerSelector).click().realPress('Escape');
|
45
|
-
cy.get(popoverContentSelector).should('not.exist');
|
46
|
-
});
|
47
|
-
});
|
48
|
-
});
|
49
|
-
|
50
|
-
describe('With custom trigger', () => {
|
51
|
-
it('should dismiss on click outside', () => {
|
52
|
-
cy.loadStory(popoverStoriesTitle, popoverWithCustomTriggerStory)
|
53
|
-
.get(popoverTriggerSelector)
|
54
|
-
.get('body')
|
55
|
-
.click('bottomRight')
|
56
|
-
.get(popoverContentSelector)
|
57
|
-
.should('not.exist');
|
58
|
-
});
|
59
|
-
});
|
60
|
-
|
61
|
-
describe('Nested', () => {
|
62
|
-
beforeEach(() => {
|
63
|
-
// Open the whole stack of popovers
|
64
|
-
cy.loadStory(popoverStoriesTitle, popoverNestedStory)
|
65
|
-
.contains('Root')
|
66
|
-
.click()
|
67
|
-
.get('body')
|
68
|
-
.contains('First')
|
69
|
-
.click()
|
70
|
-
.get('body')
|
71
|
-
.contains('Second')
|
72
|
-
.first()
|
73
|
-
.click();
|
74
|
-
});
|
75
|
-
|
76
|
-
it('should trap focus with tab', () => {
|
77
|
-
cy.focused().then(beforeFocused => {
|
78
|
-
cy.focused().realPress('Tab');
|
79
|
-
cy.realPress(['Shift', 'Tab']);
|
80
|
-
cy.focused().then(afterFocused => {
|
81
|
-
expect(beforeFocused[0]).eq(afterFocused[0]);
|
82
|
-
});
|
83
|
-
});
|
84
|
-
});
|
85
|
-
|
86
|
-
it('should trap focus with shift+tab', () => {
|
87
|
-
cy.focused().then(beforeFocused => {
|
88
|
-
cy.focused().realPress('Tab');
|
89
|
-
cy.realPress(['Shift', 'Tab']);
|
90
|
-
cy.focused().then(afterFocused => {
|
91
|
-
expect(beforeFocused[0]).eq(afterFocused[0]);
|
92
|
-
});
|
93
|
-
});
|
94
|
-
});
|
95
|
-
|
96
|
-
it('should dismiss all nested popovers on outside click', () => {
|
97
|
-
cy.get('body').click('bottomRight').get(popoverContentSelector).should('not.exist');
|
98
|
-
});
|
99
|
-
|
100
|
-
it('should not dismiss when clicking on nested content', () => {
|
101
|
-
cy.contains('Second nested button').click().get(popoverContentSelector).should('have.length', 3);
|
102
|
-
});
|
103
|
-
|
104
|
-
it('should dismiss child popovers when clicking on parents', () => {
|
105
|
-
cy.contains('First nested button')
|
106
|
-
.click()
|
107
|
-
.get(popoverContentSelector)
|
108
|
-
.should('have.length', 2)
|
109
|
-
.contains('Root button')
|
110
|
-
.click()
|
111
|
-
.get(popoverContentSelector)
|
112
|
-
.should('have.length', 1);
|
113
|
-
});
|
114
|
-
|
115
|
-
it('should when opening a sibling popover, should dismiss other sibling popover', () => {
|
116
|
-
const secondNestedTriggerSelector = 'button:contains(Second nested trigger)';
|
117
|
-
|
118
|
-
cy.get(secondNestedTriggerSelector)
|
119
|
-
.eq(1)
|
120
|
-
.click()
|
121
|
-
.get(popoverContentSelector)
|
122
|
-
.should('have.length', 3)
|
123
|
-
.get(secondNestedTriggerSelector)
|
124
|
-
.eq(0)
|
125
|
-
.click()
|
126
|
-
.get(popoverContentSelector)
|
127
|
-
.should('have.length', 3);
|
128
|
-
});
|
129
|
-
|
130
|
-
it('should dismiss each popover in the stack with Escape keydown', () => {
|
131
|
-
cy.focused().realPress('Escape');
|
132
|
-
cy.get(popoverContentSelector).should('have.length', 2);
|
133
|
-
cy.focused().realPress('Escape');
|
134
|
-
cy.get(popoverContentSelector).should('have.length', 1);
|
135
|
-
cy.focused().realPress('Escape');
|
136
|
-
cy.get(popoverContentSelector).should('not.exist');
|
137
|
-
});
|
138
|
-
});
|
139
|
-
});
|