@targetprocess/popover 12.23.2 → 12.23.3-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/Popover.tsx +1 -1
- package/PopoverContainer.tsx +2 -1
- package/__tests__/Popover.tests.tsx +4 -9
- package/dist/Popover.d.ts +1 -1
- package/dist/popover.es.js +5 -4
- package/dist/popover.js +5 -4
- package/package.json +4 -4
package/Popover.tsx
CHANGED
package/PopoverContainer.tsx
CHANGED
|
@@ -281,7 +281,8 @@ export class PopoverContainer extends React.Component<
|
|
|
281
281
|
<FocusTrap
|
|
282
282
|
focusTrapOptions={{
|
|
283
283
|
fallbackFocus: `#${this.popoverContainerId}`,
|
|
284
|
-
clickOutsideDeactivates: true
|
|
284
|
+
clickOutsideDeactivates: true,
|
|
285
|
+
trapStack: window.__globalTrapStack
|
|
285
286
|
}}
|
|
286
287
|
>
|
|
287
288
|
<div
|
|
@@ -8,15 +8,10 @@ import {Popover, PopoverProps, PopoverState} from '../Popover'
|
|
|
8
8
|
import {PopoverBody} from '../PopoverBody'
|
|
9
9
|
import {cleanDocumentBody} from '../../../testUtils/domUtils'
|
|
10
10
|
|
|
11
|
-
jest.mock('focus-trap', () => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
pause: () => {},
|
|
16
|
-
unpause: () => {}
|
|
17
|
-
}
|
|
18
|
-
return () => trap
|
|
19
|
-
})
|
|
11
|
+
jest.mock('focus-trap-react', () => ({
|
|
12
|
+
__esModule: true,
|
|
13
|
+
default: ({children}) => <div>{children}</div>
|
|
14
|
+
}))
|
|
20
15
|
|
|
21
16
|
describe('Popover', () => {
|
|
22
17
|
beforeEach(() => {
|
package/dist/Popover.d.ts
CHANGED
package/dist/popover.es.js
CHANGED
|
@@ -209,8 +209,8 @@ function styleInject(css, ref) {
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
var css = "/*********************************************************************\n* © Copyright IBM Corp. 2024\n*********************************************************************/\n.popover-body-container__popover__12-23-
|
|
213
|
-
var styles = {"popover-body-container":"popover-body-container__popover__12-23-
|
|
212
|
+
var css = "/*********************************************************************\n* © Copyright IBM Corp. 2024\n*********************************************************************/\n.popover-body-container__popover__12-23-3-alpha-0 {\n -webkit-box-shadow: var(--BoxShadowL, 0 4px 16px 0 rgba(0, 0, 0, 0.12));\n box-shadow: var(--BoxShadowL, 0 4px 16px 0 rgba(0, 0, 0, 0.12));\n border-radius: var(--BorderRadiusL, 4px);\n border: 1px solid var(--HighlightBlockBorderColor, rgba(64, 66, 73, 0.1));\n background: var(--BackgroundDefault, #FFFFFF);\n z-index: var(--ZIndexModal, 10001);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n.popover-body__popover__12-23-3-alpha-0 {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n padding: var(--SpaceSM, 12px);\n font-size: var(--FontSizeDefault, 13px);\n color: var(--FontColorDefault, #000000);\n}\n.popover-body--no-padding__popover__12-23-3-alpha-0 {\n padding: 0;\n }\n.popover-tip__popover__12-23-3-alpha-0 {\n position: absolute;\n pointer-events: none;\n z-index: calc(var(--ZIndexModal, 10001) + 1);\n overflow: hidden;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.popover-tip__popover__12-23-3-alpha-0:before {\n content: '';\n position: absolute;\n display: block;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n background-color: var(--BackgroundDefault, #FFFFFF);\n border: 1px solid var(--HighlightBlockBorderColor, rgba(64, 66, 73, 0.1));\n /*\n geometry FTW\n\n 2*$popoverTipSize\n _______ _______\n | /|\\ |\n | / | \\ | $popoverTipSize\n | / | \\ |\n |/______|______\\|\n since tip is rotated 45 degrees, its width and height is a\n diagonal of a square with side=$popoverTipSize, thus diagonal\n is sqrt(2) * $popoverTipSize.\n sqrt(2) ~= 1.414, 1.4 used here to prevent too much rounding\n */\n width: 11.2px;\n height: 11.2px;\n -webkit-transform: rotate(45deg);\n transform: rotate(45deg);\n }\n.popover-tip--bottom__popover__12-23-3-alpha-0,\n .popover-tip--top__popover__12-23-3-alpha-0 {\n width: 100%;\n border-top: 1px var(--BackgroundDefault, #FFFFFF);\n border-bottom: 1px var(--BackgroundDefault, #FFFFFF);\n height: 9px;\n }\n.popover-tip--left__popover__12-23-3-alpha-0,\n .popover-tip--right__popover__12-23-3-alpha-0 {\n border-left: 1px var(--BackgroundDefault, #FFFFFF);\n border-right: 1px var(--BackgroundDefault, #FFFFFF);\n height: 100%;\n width: 9px;\n }\n/*\n To determine tip position, we need to rotate it\n along the \"tip\" point, after that, the \"tip\" point\n can be placed with exactly 50% offset from the origin\n so that it is centered.\n */\n.popover-tip--bottom__popover__12-23-3-alpha-0:before {\n -webkit-transform-origin: left top;\n transform-origin: left top;\n left: 50%;\n top: 0;\n }\n.popover-tip--top__popover__12-23-3-alpha-0:before {\n -webkit-transform-origin: right bottom;\n transform-origin: right bottom;\n right: 50%;\n bottom: 0;\n }\n.popover-tip--left__popover__12-23-3-alpha-0:before {\n -webkit-transform-origin: right top;\n transform-origin: right top;\n right: 0;\n top: 50%;\n }\n.popover-tip--right__popover__12-23-3-alpha-0:before {\n -webkit-transform-origin: left bottom;\n transform-origin: left bottom;\n left: 0;\n bottom: 50%;\n }\n";
|
|
213
|
+
var styles = {"popover-body-container":"popover-body-container__popover__12-23-3-alpha-0","popover-body":"popover-body__popover__12-23-3-alpha-0","popover-body--no-padding":"popover-body--no-padding__popover__12-23-3-alpha-0","popover-tip":"popover-tip__popover__12-23-3-alpha-0","popover-tip--bottom":"popover-tip--bottom__popover__12-23-3-alpha-0","popover-tip--top":"popover-tip--top__popover__12-23-3-alpha-0","popover-tip--left":"popover-tip--left__popover__12-23-3-alpha-0","popover-tip--right":"popover-tip--right__popover__12-23-3-alpha-0"};
|
|
214
214
|
styleInject(css);
|
|
215
215
|
|
|
216
216
|
/*********************************************************************
|
|
@@ -497,7 +497,8 @@ var PopoverContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
497
497
|
}), this.props.trapFocus && React.createElement(FocusTrap, {
|
|
498
498
|
focusTrapOptions: {
|
|
499
499
|
fallbackFocus: "#".concat(this.popoverContainerId),
|
|
500
|
-
clickOutsideDeactivates: true
|
|
500
|
+
clickOutsideDeactivates: true,
|
|
501
|
+
trapStack: window.__globalTrapStack
|
|
501
502
|
}
|
|
502
503
|
}, React.createElement("div", {
|
|
503
504
|
id: this.popoverContainerId,
|
|
@@ -763,7 +764,7 @@ Popover.defaultProps = {
|
|
|
763
764
|
outerActionEvents: ['mousedown', 'touchstart'],
|
|
764
765
|
getPopoverPosition: 'bottomLeft',
|
|
765
766
|
role: 'dialog',
|
|
766
|
-
trapFocus:
|
|
767
|
+
trapFocus: true
|
|
767
768
|
};
|
|
768
769
|
|
|
769
770
|
/*********************************************************************
|
package/dist/popover.js
CHANGED
|
@@ -216,8 +216,8 @@ function styleInject(css, ref) {
|
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
var css = "/*********************************************************************\n* © Copyright IBM Corp. 2024\n*********************************************************************/\n.popover-body-container__popover__12-23-
|
|
220
|
-
var styles = {"popover-body-container":"popover-body-container__popover__12-23-
|
|
219
|
+
var css = "/*********************************************************************\n* © Copyright IBM Corp. 2024\n*********************************************************************/\n.popover-body-container__popover__12-23-3-alpha-0 {\n -webkit-box-shadow: var(--BoxShadowL, 0 4px 16px 0 rgba(0, 0, 0, 0.12));\n box-shadow: var(--BoxShadowL, 0 4px 16px 0 rgba(0, 0, 0, 0.12));\n border-radius: var(--BorderRadiusL, 4px);\n border: 1px solid var(--HighlightBlockBorderColor, rgba(64, 66, 73, 0.1));\n background: var(--BackgroundDefault, #FFFFFF);\n z-index: var(--ZIndexModal, 10001);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n.popover-body__popover__12-23-3-alpha-0 {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n padding: var(--SpaceSM, 12px);\n font-size: var(--FontSizeDefault, 13px);\n color: var(--FontColorDefault, #000000);\n}\n.popover-body--no-padding__popover__12-23-3-alpha-0 {\n padding: 0;\n }\n.popover-tip__popover__12-23-3-alpha-0 {\n position: absolute;\n pointer-events: none;\n z-index: calc(var(--ZIndexModal, 10001) + 1);\n overflow: hidden;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.popover-tip__popover__12-23-3-alpha-0:before {\n content: '';\n position: absolute;\n display: block;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n background-color: var(--BackgroundDefault, #FFFFFF);\n border: 1px solid var(--HighlightBlockBorderColor, rgba(64, 66, 73, 0.1));\n /*\n geometry FTW\n\n 2*$popoverTipSize\n _______ _______\n | /|\\ |\n | / | \\ | $popoverTipSize\n | / | \\ |\n |/______|______\\|\n since tip is rotated 45 degrees, its width and height is a\n diagonal of a square with side=$popoverTipSize, thus diagonal\n is sqrt(2) * $popoverTipSize.\n sqrt(2) ~= 1.414, 1.4 used here to prevent too much rounding\n */\n width: 11.2px;\n height: 11.2px;\n -webkit-transform: rotate(45deg);\n transform: rotate(45deg);\n }\n.popover-tip--bottom__popover__12-23-3-alpha-0,\n .popover-tip--top__popover__12-23-3-alpha-0 {\n width: 100%;\n border-top: 1px var(--BackgroundDefault, #FFFFFF);\n border-bottom: 1px var(--BackgroundDefault, #FFFFFF);\n height: 9px;\n }\n.popover-tip--left__popover__12-23-3-alpha-0,\n .popover-tip--right__popover__12-23-3-alpha-0 {\n border-left: 1px var(--BackgroundDefault, #FFFFFF);\n border-right: 1px var(--BackgroundDefault, #FFFFFF);\n height: 100%;\n width: 9px;\n }\n/*\n To determine tip position, we need to rotate it\n along the \"tip\" point, after that, the \"tip\" point\n can be placed with exactly 50% offset from the origin\n so that it is centered.\n */\n.popover-tip--bottom__popover__12-23-3-alpha-0:before {\n -webkit-transform-origin: left top;\n transform-origin: left top;\n left: 50%;\n top: 0;\n }\n.popover-tip--top__popover__12-23-3-alpha-0:before {\n -webkit-transform-origin: right bottom;\n transform-origin: right bottom;\n right: 50%;\n bottom: 0;\n }\n.popover-tip--left__popover__12-23-3-alpha-0:before {\n -webkit-transform-origin: right top;\n transform-origin: right top;\n right: 0;\n top: 50%;\n }\n.popover-tip--right__popover__12-23-3-alpha-0:before {\n -webkit-transform-origin: left bottom;\n transform-origin: left bottom;\n left: 0;\n bottom: 50%;\n }\n";
|
|
220
|
+
var styles = {"popover-body-container":"popover-body-container__popover__12-23-3-alpha-0","popover-body":"popover-body__popover__12-23-3-alpha-0","popover-body--no-padding":"popover-body--no-padding__popover__12-23-3-alpha-0","popover-tip":"popover-tip__popover__12-23-3-alpha-0","popover-tip--bottom":"popover-tip--bottom__popover__12-23-3-alpha-0","popover-tip--top":"popover-tip--top__popover__12-23-3-alpha-0","popover-tip--left":"popover-tip--left__popover__12-23-3-alpha-0","popover-tip--right":"popover-tip--right__popover__12-23-3-alpha-0"};
|
|
221
221
|
styleInject(css);
|
|
222
222
|
|
|
223
223
|
/*********************************************************************
|
|
@@ -504,7 +504,8 @@ var PopoverContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
504
504
|
}), this.props.trapFocus && React__default.createElement(FocusTrap, {
|
|
505
505
|
focusTrapOptions: {
|
|
506
506
|
fallbackFocus: "#".concat(this.popoverContainerId),
|
|
507
|
-
clickOutsideDeactivates: true
|
|
507
|
+
clickOutsideDeactivates: true,
|
|
508
|
+
trapStack: window.__globalTrapStack
|
|
508
509
|
}
|
|
509
510
|
}, React__default.createElement("div", {
|
|
510
511
|
id: this.popoverContainerId,
|
|
@@ -770,7 +771,7 @@ Popover.defaultProps = {
|
|
|
770
771
|
outerActionEvents: ['mousedown', 'touchstart'],
|
|
771
772
|
getPopoverPosition: 'bottomLeft',
|
|
772
773
|
role: 'dialog',
|
|
773
|
-
trapFocus:
|
|
774
|
+
trapFocus: true
|
|
774
775
|
};
|
|
775
776
|
|
|
776
777
|
/*********************************************************************
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@targetprocess/popover",
|
|
3
|
-
"version": "12.23.
|
|
3
|
+
"version": "12.23.3-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/popover.js",
|
|
6
6
|
"module": "dist/popover.es.js",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"prepack": "node -r ../../.ts-node.js ../../config/rollup.config.js ."
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@targetprocess/global-constants": "^12.23.
|
|
15
|
+
"@targetprocess/global-constants": "^12.23.3-alpha.0",
|
|
16
16
|
"classnames": "^2.2.5",
|
|
17
|
-
"focus-trap-react": "^
|
|
17
|
+
"focus-trap-react": "^10.3.0",
|
|
18
18
|
"prop-types": "^15.6.0",
|
|
19
19
|
"react": "^16.7.0",
|
|
20
20
|
"react-dom": "^16.7.0"
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "f06f19623c59a5507d8cc5f1cd78c77a6cd1b3df"
|
|
26
26
|
}
|