@fluentui/react-popover 9.0.0-beta.1 → 9.0.0-beta.5
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +287 -1
- package/CHANGELOG.md +72 -2
- package/dist/react-popover.d.ts +7 -3
- package/lib/components/Popover/Popover.js +2 -2
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/Popover.types.d.ts +5 -3
- package/lib/components/Popover/renderPopover.js +27 -25
- package/lib/components/Popover/renderPopover.js.map +1 -1
- package/lib/components/Popover/usePopover.js +39 -51
- package/lib/components/Popover/usePopover.js.map +1 -1
- package/lib/components/PopoverSurface/PopoverSurface.js +2 -2
- package/lib/components/PopoverSurface/PopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/renderPopoverSurface.js +6 -7
- package/lib/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/usePopoverSurface.js +41 -55
- package/lib/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +1 -0
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js +16 -8
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
- package/lib/components/PopoverTrigger/PopoverTrigger.js +2 -2
- package/lib/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
- package/lib/components/PopoverTrigger/renderPopoverTrigger.js +1 -1
- package/lib/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
- package/lib/components/PopoverTrigger/usePopoverTrigger.js +25 -33
- package/lib/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
- package/lib/popoverContext.js +3 -7
- package/lib/popoverContext.js.map +1 -1
- package/lib-commonjs/Popover.js +1 -1
- package/lib-commonjs/PopoverSurface.js +1 -1
- package/lib-commonjs/PopoverTrigger.js +1 -1
- package/lib-commonjs/components/Popover/Popover.js +4 -4
- package/lib-commonjs/components/Popover/Popover.js.map +1 -1
- package/lib-commonjs/components/Popover/Popover.types.d.ts +5 -3
- package/lib-commonjs/components/Popover/index.js +1 -1
- package/lib-commonjs/components/Popover/renderPopover.js +29 -27
- package/lib-commonjs/components/Popover/renderPopover.js.map +1 -1
- package/lib-commonjs/components/Popover/usePopover.js +45 -58
- package/lib-commonjs/components/Popover/usePopover.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.js +6 -6
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/index.js +1 -1
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js +10 -12
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js +44 -59
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +1 -0
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js +18 -9
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js +4 -4
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/index.js +1 -1
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js +1 -1
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js +29 -38
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
- package/lib-commonjs/index.js +1 -1
- package/lib-commonjs/popoverContext.js +3 -7
- package/lib-commonjs/popoverContext.js.map +1 -1
- package/package.json +13 -13
- package/lib/common/isConformant.d.ts +0 -4
- package/lib/common/isConformant.js +0 -13
- package/lib/common/isConformant.js.map +0 -1
- package/lib/common/mockUsePopoverContext.d.ts +0 -7
- package/lib/common/mockUsePopoverContext.js +0 -38
- package/lib/common/mockUsePopoverContext.js.map +0 -1
- package/lib-commonjs/common/isConformant.d.ts +0 -4
- package/lib-commonjs/common/isConformant.js +0 -24
- package/lib-commonjs/common/isConformant.js.map +0 -1
- package/lib-commonjs/common/mockUsePopoverContext.d.ts +0 -7
- package/lib-commonjs/common/mockUsePopoverContext.js +0 -49
- package/lib-commonjs/common/mockUsePopoverContext.js.map +0 -1
@@ -5,15 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.usePopoverSurface = exports.popoverSurfaceSlots = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
9
|
|
10
|
-
|
10
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
11
|
|
12
|
-
|
12
|
+
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
var popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
|
14
|
+
const popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
|
17
15
|
|
18
16
|
exports.popoverSurfaceSlots = ['root'];
|
19
17
|
/**
|
@@ -26,61 +24,46 @@ exports.popoverSurfaceSlots = ['root'];
|
|
26
24
|
* @param ref - reference to root HTMLDivElement of PopoverSurface
|
27
25
|
*/
|
28
26
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
});
|
45
|
-
var arrowRef = popoverContext_1.usePopoverContext(function (context) {
|
46
|
-
return context.arrowRef;
|
47
|
-
});
|
48
|
-
var size = popoverContext_1.usePopoverContext(function (context) {
|
49
|
-
return context.size;
|
50
|
-
});
|
51
|
-
var noArrow = popoverContext_1.usePopoverContext(function (context) {
|
52
|
-
return context.noArrow;
|
53
|
-
});
|
54
|
-
var appearance = popoverContext_1.usePopoverContext(function (context) {
|
55
|
-
return context.appearance;
|
56
|
-
});
|
57
|
-
var trapFocus = popoverContext_1.usePopoverContext(function (context) {
|
58
|
-
return context.trapFocus;
|
27
|
+
const usePopoverSurface = (props, ref) => {
|
28
|
+
const contentRef = popoverContext_1.usePopoverContext(context => context.contentRef);
|
29
|
+
const open = popoverContext_1.usePopoverContext(context => context.open);
|
30
|
+
const openOnHover = popoverContext_1.usePopoverContext(context => context.openOnHover);
|
31
|
+
const setOpen = popoverContext_1.usePopoverContext(context => context.setOpen);
|
32
|
+
const mountNode = popoverContext_1.usePopoverContext(context => context.mountNode);
|
33
|
+
const arrowRef = popoverContext_1.usePopoverContext(context => context.arrowRef);
|
34
|
+
const size = popoverContext_1.usePopoverContext(context => context.size);
|
35
|
+
const noArrow = popoverContext_1.usePopoverContext(context => context.noArrow);
|
36
|
+
const appearance = popoverContext_1.usePopoverContext(context => context.appearance);
|
37
|
+
const trapFocus = popoverContext_1.usePopoverContext(context => context.trapFocus);
|
38
|
+
const {
|
39
|
+
modalAttributes
|
40
|
+
} = react_tabster_1.useModalAttributes({
|
41
|
+
trapFocus
|
59
42
|
});
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
arrowRef: arrowRef,
|
68
|
-
open: open,
|
69
|
-
mountNode: mountNode,
|
43
|
+
const state = {
|
44
|
+
appearance,
|
45
|
+
noArrow,
|
46
|
+
size,
|
47
|
+
arrowRef,
|
48
|
+
open,
|
49
|
+
mountNode,
|
70
50
|
components: {
|
71
51
|
root: 'div'
|
72
52
|
},
|
73
|
-
root: react_utilities_1.getNativeElementProps('div',
|
53
|
+
root: react_utilities_1.getNativeElementProps('div', {
|
74
54
|
ref: react_utilities_1.useMergedRefs(ref, contentRef),
|
75
|
-
role: 'dialog'
|
76
|
-
|
55
|
+
role: 'dialog',
|
56
|
+
...modalAttributes,
|
57
|
+
...props
|
58
|
+
})
|
77
59
|
};
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
60
|
+
const {
|
61
|
+
onMouseEnter: onMouseEnterOriginal,
|
62
|
+
onMouseLeave: onMouseLeaveOriginal,
|
63
|
+
onKeyDown: onKeyDownOriginal
|
64
|
+
} = state.root;
|
82
65
|
|
83
|
-
state.root.onMouseEnter =
|
66
|
+
state.root.onMouseEnter = e => {
|
84
67
|
if (openOnHover) {
|
85
68
|
setOpen(e, true);
|
86
69
|
}
|
@@ -88,7 +71,7 @@ var usePopoverSurface = function (props, ref) {
|
|
88
71
|
onMouseEnterOriginal === null || onMouseEnterOriginal === void 0 ? void 0 : onMouseEnterOriginal(e);
|
89
72
|
};
|
90
73
|
|
91
|
-
state.root.onMouseLeave =
|
74
|
+
state.root.onMouseLeave = e => {
|
92
75
|
if (openOnHover) {
|
93
76
|
setOpen(e, false);
|
94
77
|
}
|
@@ -96,7 +79,7 @@ var usePopoverSurface = function (props, ref) {
|
|
96
79
|
onMouseLeaveOriginal === null || onMouseLeaveOriginal === void 0 ? void 0 : onMouseLeaveOriginal(e);
|
97
80
|
};
|
98
81
|
|
99
|
-
state.root.onKeyDown =
|
82
|
+
state.root.onKeyDown = e => {
|
100
83
|
var _a; // only close if the event happened inside the current popover
|
101
84
|
// If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack
|
102
85
|
|
@@ -108,10 +91,12 @@ var usePopoverSurface = function (props, ref) {
|
|
108
91
|
onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(e);
|
109
92
|
};
|
110
93
|
|
111
|
-
|
112
|
-
|
94
|
+
const {
|
95
|
+
findFirstFocusable
|
96
|
+
} = react_tabster_1.useFocusFinders();
|
97
|
+
React.useEffect(() => {
|
113
98
|
if (state.open && contentRef.current) {
|
114
|
-
|
99
|
+
const firstFocusable = findFirstFocusable(contentRef.current);
|
115
100
|
firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
|
116
101
|
}
|
117
102
|
}, [contentRef, findFirstFocusable, state.open]);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PopoverSurface/usePopoverSurface.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/PopoverSurface/usePopoverSurface.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;;AAGa,OAAA,CAAA,mBAAA,GAAwD,CAAC,MAAD,CAAxD;AAEb;;;;;;;;AAQG;;AACI,MAAM,iBAAiB,GAAG,CAAC,KAAD,EAA6B,GAA7B,KAAoF;AACnH,QAAM,UAAU,GAAG,gBAAA,CAAA,iBAAA,CAAkB,OAAO,IAAI,OAAO,CAAC,UAArC,CAAnB;AACA,QAAM,IAAI,GAAG,gBAAA,CAAA,iBAAA,CAAkB,OAAO,IAAI,OAAO,CAAC,IAArC,CAAb;AACA,QAAM,WAAW,GAAG,gBAAA,CAAA,iBAAA,CAAkB,OAAO,IAAI,OAAO,CAAC,WAArC,CAApB;AACA,QAAM,OAAO,GAAG,gBAAA,CAAA,iBAAA,CAAkB,OAAO,IAAI,OAAO,CAAC,OAArC,CAAhB;AACA,QAAM,SAAS,GAAG,gBAAA,CAAA,iBAAA,CAAkB,OAAO,IAAI,OAAO,CAAC,SAArC,CAAlB;AACA,QAAM,QAAQ,GAAG,gBAAA,CAAA,iBAAA,CAAkB,OAAO,IAAI,OAAO,CAAC,QAArC,CAAjB;AACA,QAAM,IAAI,GAAG,gBAAA,CAAA,iBAAA,CAAkB,OAAO,IAAI,OAAO,CAAC,IAArC,CAAb;AACA,QAAM,OAAO,GAAG,gBAAA,CAAA,iBAAA,CAAkB,OAAO,IAAI,OAAO,CAAC,OAArC,CAAhB;AACA,QAAM,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verSurface.types';
|
3
|
+
export declare const popoverSurfaceClassName = "fui-PopoverSurface";
|
3
4
|
export declare const arrowHeights: Record<PopoverSize, number>;
|
4
5
|
/**
|
5
6
|
* Apply styling to the PopoverSurface slots based on the state
|
@@ -3,10 +3,13 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.usePopoverSurfaceStyles = exports.arrowHeights = void 0;
|
6
|
+
exports.usePopoverSurfaceStyles = exports.arrowHeights = exports.popoverSurfaceClassName = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
|
9
9
|
|
10
|
+
const react_positioning_1 = /*#__PURE__*/require("@fluentui/react-positioning");
|
11
|
+
|
12
|
+
exports.popoverSurfaceClassName = 'fui-PopoverSurface';
|
10
13
|
exports.arrowHeights = {
|
11
14
|
small: 6,
|
12
15
|
medium: 8,
|
@@ -16,10 +19,10 @@ exports.arrowHeights = {
|
|
16
19
|
* Styles for the root slot
|
17
20
|
*/
|
18
21
|
|
19
|
-
|
22
|
+
const useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
20
23
|
"root": {
|
21
24
|
"De3pzq": "fxugw4r",
|
22
|
-
"E5pizo":
|
25
|
+
"E5pizo": "f1hg901r",
|
23
26
|
"Dimara": "ff3glw6",
|
24
27
|
"B4j52fo": "f5ogflp",
|
25
28
|
"Bekrc4i": ["f1hqa2wf", "finvdd3"],
|
@@ -81,7 +84,13 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
81
84
|
"B4zgs9e": "ffo048g",
|
82
85
|
"Bex5imi": "fkk33zh",
|
83
86
|
"px8gyy": ["f5bg3dr", "f1rfdd74"],
|
84
|
-
"h6z6rw":
|
87
|
+
"h6z6rw": "fzd2j21",
|
88
|
+
"Iykf4b": ["feexxpo", "f7s5fvx"],
|
89
|
+
"F42hee": ["f1jq8eg5", "f12n7c5j"],
|
90
|
+
"Blxsnla": ["f1wv7y6t", "fi4qyh6"],
|
91
|
+
"t2scew": "fcvru7r",
|
92
|
+
"Emsed9": "f7ybgnc",
|
93
|
+
"E11wbp": "f16xtfle",
|
85
94
|
"hl6cv3": "fotnskf",
|
86
95
|
"Bh2vraf": "f1n8855c",
|
87
96
|
"yayu3t": ["f1nq055x", "f13ohf3"],
|
@@ -92,16 +101,16 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
92
101
|
"Bwwlvwl": "fm1ycve"
|
93
102
|
}
|
94
103
|
}, {
|
95
|
-
"d": [".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f1hg901r{box-shadow:var(--shadow16);}", ".
|
104
|
+
"d": [".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f1hg901r{box-shadow:var(--shadow16);}", ".ff3glw6{border-radius:4px;}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f1c73kur{background-color:var(--colorNeutralForeground1);}", ".fqpbvvt{color:var(--colorNeutralForegroundInverted);}", ".ffp7eso{background-color:var(--colorBrandBackground);}", ".f1kcqot9{padding-top:12px;}", ".f11qrl6u{padding-right:12px;}", ".fjlbh76{padding-left:12px;}", ".fpe6lb7{padding-bottom:12px;}", ".fqag9an{padding-top:16px;}", ".f1gbmcue{padding-right:16px;}", ".f1rh9g5y{padding-left:16px;}", ".fp67ikv{padding-bottom:16px;}", ".fc7z3ec{padding-top:20px;}", ".fat0sn4{padding-right:20px;}", ".fekwl8i{padding-left:20px;}", ".fe2my4m{padding-bottom:20px;}", ".f1smug5u{width:8.485281374238571px;}", ".f11ci07v{height:8.485281374238571px;}", ".ftmg478{width:11.313708498984761px;}", ".f7bsbfx{height:11.313708498984761px;}", ".f1euv43f{position:absolute;}", ".f1uo6wrk{background:inherit;}", ".fd7fpy0{visibility:hidden;}", ".f1bsuimh{z-index:-1;}", ".fuzzvh5:before{content:\"\";}", ".f1qudtws:before{border-radius:4px;}", ".fxf9f1y:before{position:absolute;}", ".f103af6e:before{width:inherit;}", ".f15umuo5:before{height:inherit;}", ".ffo048g:before{background:inherit;}", ".fkk33zh:before{visibility:visible;}", ".f5bg3dr:before{border-bottom-right-radius:var(--borderRadiusSmall);}", ".f1rfdd74:before{border-bottom-left-radius:var(--borderRadiusSmall);}", ".fzd2j21:before{-webkit-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-moz-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);-ms-transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);transform:rotate(var(--angle)) translate(0, 50%) rotate(45deg);}", "[data-popper-placement] .feexxpo:before{border-right-width:1px;}", "[data-popper-placement] .f7s5fvx:before{border-left-width:1px;}", "[data-popper-placement] .f1jq8eg5:before{border-right-style:solid;}", "[data-popper-placement] .f12n7c5j:before{border-left-style:solid;}", "[data-popper-placement] .f1wv7y6t:before{border-right-color:transparent;}", "[data-popper-placement] .fi4qyh6:before{border-left-color:transparent;}", "[data-popper-placement] .fcvru7r:before{border-bottom-width:1px;}", "[data-popper-placement] .f7ybgnc:before{border-bottom-style:solid;}", "[data-popper-placement] .f16xtfle:before{border-bottom-color:transparent;}", "[data-popper-placement^=\"top\"] .fotnskf{bottom:0;}", "[data-popper-placement^=\"top\"] .f1n8855c{--angle:0;}", "[data-popper-placement^=\"right\"] .f1nq055x{left:0;}", "[data-popper-placement^=\"right\"] .f13ohf3{right:0;}", "[data-popper-placement^=\"right\"] .fsw6im5{--angle:90deg;}", "[data-popper-placement^=\"bottom\"] .ftghsr9{top:0;}", "[data-popper-placement^=\"bottom\"] .f159pzir{--angle:180deg;}", "[data-popper-placement^=\"left\"] .f1l8vbt4{right:0;}", "[data-popper-placement^=\"left\"] .fsxzh25{left:0;}", "[data-popper-placement^=\"left\"] .fm1ycve{--angle:270deg;}"]
|
96
105
|
});
|
97
106
|
/**
|
98
107
|
* Apply styling to the PopoverSurface slots based on the state
|
99
108
|
*/
|
100
109
|
|
101
110
|
|
102
|
-
|
103
|
-
|
104
|
-
state.root.className = react_make_styles_1.mergeClasses(styles.root, state.size === 'small' && styles.smallPadding, state.size === 'medium' && styles.mediumPadding, state.size === 'large' && styles.largePadding, state.appearance === 'inverted' && styles.inverted, state.appearance === 'brand' && styles.brand, state.root.className);
|
111
|
+
const usePopoverSurfaceStyles = state => {
|
112
|
+
const styles = useStyles();
|
113
|
+
state.root.className = react_make_styles_1.mergeClasses(exports.popoverSurfaceClassName, styles.root, state.size === 'small' && styles.smallPadding, state.size === 'medium' && styles.mediumPadding, state.size === 'large' && styles.largePadding, state.appearance === 'inverted' && styles.inverted, state.appearance === 'brand' && styles.brand, state.root.className);
|
105
114
|
state.arrowClassName = react_make_styles_1.mergeClasses(styles.arrow, state.size === 'small' ? styles.smallArrow : styles.mediumLargeArrow);
|
106
115
|
return state;
|
107
116
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PopoverSurface/usePopoverSurfaceStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,
|
1
|
+
{"version":3,"sources":["../../../src/components/PopoverSurface/usePopoverSurfaceStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAIa,OAAA,CAAA,uBAAA,GAA0B,oBAA1B;AAEA,OAAA,CAAA,YAAA,GAA4C;AACvD,EAAA,KAAK,EAAE,CADgD;AAEvD,EAAA,MAAM,EAAE,C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ACrB,MAAM,CAAC,KADc,EAErB,KAAK,CAAC,IAAN,KAAe,OAAf,GAAyB,MAAM,CAAC,UAAhC,GAA6C,MAAM,CAAC,gBAF/B,CAAvB;AAKA,SAAO,KAAP;AACD,CAnBM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourceRoot":""}
|
@@ -5,16 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.PopoverTrigger = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const usePopoverTrigger_1 = /*#__PURE__*/require("./usePopoverTrigger");
|
9
9
|
|
10
|
-
|
10
|
+
const renderPopoverTrigger_1 = /*#__PURE__*/require("./renderPopoverTrigger");
|
11
11
|
/**
|
12
12
|
* Wraps a trigger element as an only child and adds the necessary event handling to open a popover.
|
13
13
|
*/
|
14
14
|
|
15
15
|
|
16
|
-
|
17
|
-
|
16
|
+
const PopoverTrigger = props => {
|
17
|
+
const state = usePopoverTrigger_1.usePopoverTrigger(props);
|
18
18
|
return renderPopoverTrigger_1.renderPopoverTrigger(state);
|
19
19
|
};
|
20
20
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PopoverTrigger/PopoverTrigger.tsx"],"names":[],"mappings":";;;;;;;AACA,
|
1
|
+
{"version":3,"sources":["../../../src/components/PopoverTrigger/PopoverTrigger.tsx"],"names":[],"mappings":";;;;;;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,MAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,cAAc,GAAkC,KAAK,IAAG;AACnE,QAAM,KAAK,GAAG,mBAAA,CAAA,iBAAA,CAAkB,KAAlB,CAAd;AAEA,SAAO,sBAAA,CAAA,oBAAA,CAAqB,KAArB,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,cAAA,GAAc,cAAd;AAMb,OAAA,CAAA,cAAA,CAAe,WAAf,GAA6B,gBAA7B","sourceRoot":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PopoverTrigger/renderPopoverTrigger.tsx"],"names":[],"mappings":";;;;;;AAEA;;AAEG;;AACI,
|
1
|
+
{"version":3,"sources":["../../../src/components/PopoverTrigger/renderPopoverTrigger.tsx"],"names":[],"mappings":";;;;;;AAEA;;AAEG;;AACI,MAAM,oBAAoB,GAAI,KAAD,IAA4C;AAC9E,SAAO,KAAK,CAAC,QAAb;AACD,CAFM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","sourceRoot":""}
|
@@ -5,15 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.usePopoverTrigger = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
9
|
|
10
|
-
|
10
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
11
|
|
12
|
-
|
12
|
+
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
var popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
|
14
|
+
const popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
|
17
15
|
/**
|
18
16
|
* Create the state required to render PopoverTrigger.
|
19
17
|
*
|
@@ -24,24 +22,17 @@ var popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
|
|
24
22
|
*/
|
25
23
|
|
26
24
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
});
|
37
|
-
|
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) {
|
25
|
+
const usePopoverTrigger = props => {
|
26
|
+
const setOpen = popoverContext_1.usePopoverContext(context => context.setOpen);
|
27
|
+
const open = popoverContext_1.usePopoverContext(context => context.open);
|
28
|
+
const triggerRef = popoverContext_1.usePopoverContext(context => context.triggerRef);
|
29
|
+
const openOnHover = popoverContext_1.usePopoverContext(context => context.openOnHover);
|
30
|
+
const openOnContext = popoverContext_1.usePopoverContext(context => context.openOnContext);
|
31
|
+
const trapFocus = popoverContext_1.usePopoverContext(context => context.trapFocus);
|
32
|
+
const {
|
33
|
+
triggerAttributes
|
34
|
+
} = react_tabster_1.useModalAttributes();
|
35
|
+
const onContextMenu = react_utilities_1.useEventCallback(e => {
|
45
36
|
var _a, _b;
|
46
37
|
|
47
38
|
if (openOnContext) {
|
@@ -51,7 +42,7 @@ var usePopoverTrigger = function (props) {
|
|
51
42
|
|
52
43
|
(_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onContextMenu) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
53
44
|
});
|
54
|
-
|
45
|
+
const onClick = react_utilities_1.useEventCallback(e => {
|
55
46
|
var _a, _b;
|
56
47
|
|
57
48
|
if (!openOnContext) {
|
@@ -60,7 +51,7 @@ var usePopoverTrigger = function (props) {
|
|
60
51
|
|
61
52
|
(_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
62
53
|
});
|
63
|
-
|
54
|
+
const onKeyDown = react_utilities_1.useEventCallback(e => {
|
64
55
|
var _a, _b, _c;
|
65
56
|
|
66
57
|
if (react_utilities_1.shouldPreventDefaultOnKeyDown(e) && (e.key === ' ' || e.key === 'Enter')) {
|
@@ -74,7 +65,7 @@ var usePopoverTrigger = function (props) {
|
|
74
65
|
|
75
66
|
(_c = (_b = child.props) === null || _b === void 0 ? void 0 : _b.onKeyDown) === null || _c === void 0 ? void 0 : _c.call(_b, e);
|
76
67
|
});
|
77
|
-
|
68
|
+
const onMouseEnter = react_utilities_1.useEventCallback(e => {
|
78
69
|
var _a, _b;
|
79
70
|
|
80
71
|
if (openOnHover) {
|
@@ -83,7 +74,7 @@ var usePopoverTrigger = function (props) {
|
|
83
74
|
|
84
75
|
(_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onMouseEnter) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
85
76
|
});
|
86
|
-
|
77
|
+
const onMouseLeave = react_utilities_1.useEventCallback(e => {
|
87
78
|
var _a, _b;
|
88
79
|
|
89
80
|
if (openOnHover) {
|
@@ -92,18 +83,18 @@ var usePopoverTrigger = function (props) {
|
|
92
83
|
|
93
84
|
(_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onMouseLeave) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
94
85
|
});
|
95
|
-
|
86
|
+
const child = React.Children.only(props.children);
|
96
87
|
return {
|
97
|
-
children: React.cloneElement(child,
|
98
|
-
'aria-haspopup': 'true'
|
99
|
-
|
100
|
-
onClick
|
101
|
-
onMouseEnter
|
102
|
-
onKeyDown
|
103
|
-
onMouseLeave
|
104
|
-
onContextMenu
|
88
|
+
children: React.cloneElement(child, { ...triggerAttributes,
|
89
|
+
'aria-haspopup': trapFocus ? 'dialog' : 'true',
|
90
|
+
...child.props,
|
91
|
+
onClick,
|
92
|
+
onMouseEnter,
|
93
|
+
onKeyDown,
|
94
|
+
onMouseLeave,
|
95
|
+
onContextMenu,
|
105
96
|
ref: react_utilities_1.useMergedRefs(child.ref, triggerRef)
|
106
|
-
})
|
97
|
+
})
|
107
98
|
};
|
108
99
|
};
|
109
100
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PopoverTrigger/usePopoverTrigger.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/PopoverTrigger/usePopoverTrigger.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA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lC,MAAA,GAAG,EAAE,iBAAA,CAAA,aAAA,CAAgB,KAAuE,CAAC,GAAxF,EAA6F,UAA7F;AAT6B,KAA1B;AADL,GAAP;AAaD,CAlEM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","sourceRoot":""}
|
package/lib-commonjs/index.js
CHANGED
@@ -5,13 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.usePopoverContext = exports.PopoverContext = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-selector");
|
9
9
|
|
10
10
|
exports.PopoverContext = /*#__PURE__*/react_context_selector_1.createContext({
|
11
11
|
open: false,
|
12
|
-
setOpen:
|
13
|
-
return null;
|
14
|
-
},
|
12
|
+
setOpen: () => null,
|
15
13
|
triggerRef: {
|
16
14
|
current: null
|
17
15
|
},
|
@@ -27,9 +25,7 @@ exports.PopoverContext = /*#__PURE__*/react_context_selector_1.createContext({
|
|
27
25
|
trapFocus: false
|
28
26
|
});
|
29
27
|
|
30
|
-
|
31
|
-
return react_context_selector_1.useContextSelector(exports.PopoverContext, selector);
|
32
|
-
};
|
28
|
+
const usePopoverContext = selector => react_context_selector_1.useContextSelector(exports.PopoverContext, selector);
|
33
29
|
|
34
30
|
exports.usePopoverContext = usePopoverContext;
|
35
31
|
//# sourceMappingURL=popoverContext.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/popoverContext.ts"],"names":[],"mappings":";;;;;;;AAAA,
|
1
|
+
{"version":3,"sources":["../src/popoverContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,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,MAAM,IAF8E;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,MAAM,iBAAiB,GAAO,QAAJ,IAC/B,wBAAA,CAAA,kBAAA,CAAmB,OAAA,CAAA,cAAnB,EAAmC,QAAnC,CADK;;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-beta.
|
3
|
+
"version": "9.0.0-beta.5",
|
4
4
|
"description": "Popover component for Fluent UI",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -23,14 +23,15 @@
|
|
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
|
+
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-popover/src && yarn docs",
|
27
|
+
"type-check": "tsc -b tsconfig.json"
|
27
28
|
},
|
28
29
|
"devDependencies": {
|
29
|
-
"@fluentui/babel-make-styles": "9.0.0-beta.
|
30
|
+
"@fluentui/babel-make-styles": "9.0.0-beta.4",
|
30
31
|
"@fluentui/eslint-plugin": "*",
|
31
|
-
"@fluentui/jest-serializer-make-styles": "9.0.0-beta.
|
32
|
+
"@fluentui/jest-serializer-make-styles": "9.0.0-beta.4",
|
32
33
|
"@fluentui/react-conformance": "*",
|
33
|
-
"@fluentui/react-conformance-make-styles": "9.0.0-beta.
|
34
|
+
"@fluentui/react-conformance-make-styles": "9.0.0-beta.4",
|
34
35
|
"@fluentui/scripts": "^1.0.0",
|
35
36
|
"@types/enzyme": "3.10.3",
|
36
37
|
"@types/enzyme-adapter-react-16": "1.0.3",
|
@@ -44,13 +45,13 @@
|
|
44
45
|
"react-test-renderer": "^16.3.0"
|
45
46
|
},
|
46
47
|
"dependencies": {
|
47
|
-
"@fluentui/react-context-selector": "9.0.0-beta.
|
48
|
-
"@fluentui/react-make-styles": "9.0.0-beta.
|
49
|
-
"@fluentui/react-portal": "9.0.0-beta.
|
50
|
-
"@fluentui/react-positioning": "9.0.0-beta.
|
51
|
-
"@fluentui/react-shared-contexts": "9.0.0-beta.
|
52
|
-
"@fluentui/react-tabster": "9.0.0-beta.
|
53
|
-
"@fluentui/react-utilities": "9.0.0-beta.
|
48
|
+
"@fluentui/react-context-selector": "9.0.0-beta.4",
|
49
|
+
"@fluentui/react-make-styles": "9.0.0-beta.4",
|
50
|
+
"@fluentui/react-portal": "9.0.0-beta.5",
|
51
|
+
"@fluentui/react-positioning": "9.0.0-beta.4",
|
52
|
+
"@fluentui/react-shared-contexts": "9.0.0-beta.4",
|
53
|
+
"@fluentui/react-tabster": "9.0.0-beta.5",
|
54
|
+
"@fluentui/react-utilities": "9.0.0-beta.4",
|
54
55
|
"tslib": "^2.1.0"
|
55
56
|
},
|
56
57
|
"peerDependencies": {
|
@@ -60,7 +61,6 @@
|
|
60
61
|
"react-dom": ">=16.8.0 <18.0.0"
|
61
62
|
},
|
62
63
|
"beachball": {
|
63
|
-
"tag": "beta",
|
64
64
|
"disallowedChangeTypes": [
|
65
65
|
"major",
|
66
66
|
"minor",
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
|
2
|
-
import makeStylesTests from '@fluentui/react-conformance-make-styles';
|
3
|
-
export function isConformant(testInfo) {
|
4
|
-
var defaultOptions = {
|
5
|
-
asPropHandlesRef: true,
|
6
|
-
componentPath: module.parent.filename.replace('.test', ''),
|
7
|
-
// TODO // https://github.com/microsoft/fluentui/issues/19522
|
8
|
-
skipAsPropTests: true,
|
9
|
-
extraTests: makeStylesTests
|
10
|
-
};
|
11
|
-
baseIsConformant(defaultOptions, testInfo);
|
12
|
-
}
|
13
|
-
//# sourceMappingURL=isConformant.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,IAAI,gBAAzB,QAAiD,6BAAjD;AAEA,OAAO,eAAP,MAA4B,yCAA5B;AAEA,OAAM,SAAU,YAAV,CACJ,QADI,EACqF;AAEzF,MAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D;AACA,IAAA,eAAe,EAAE,IAJ0C;AAK3D,IAAA,UAAU,EAAE;AAL+C,GAA7D;AAQA,EAAA,gBAAgB,CAAC,cAAD,EAAiB,QAAjB,CAAhB;AACD","sourceRoot":""}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import type { PopoverContextValue } from '../popoverContext';
|
2
|
-
/**
|
3
|
-
* A test utility to mock the usePopoverContext hook that relies on context selector
|
4
|
-
* Don't forget to call `jest.mock(**\/popupContext.ts)` while using this
|
5
|
-
* @param options Popover context values to set for testing
|
6
|
-
*/
|
7
|
-
export declare const mockPopoverContext: (options?: Partial<PopoverContextValue>) => void;
|