@targetprocess/popover 12.22.6-alpha.4 → 12.23.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/PopoverContainer.tsx +28 -8
- package/dist/popover.es.js +16 -5
- package/dist/popover.js +16 -5
- package/package.json +3 -3
package/PopoverContainer.tsx
CHANGED
|
@@ -277,13 +277,33 @@ export class PopoverContainer extends React.Component<
|
|
|
277
277
|
}}
|
|
278
278
|
/>
|
|
279
279
|
)}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
280
|
+
{this.props.trapFocus && (
|
|
281
|
+
<FocusTrap
|
|
282
|
+
focusTrapOptions={{
|
|
283
|
+
fallbackFocus: `#${this.popoverContainerId}`,
|
|
284
|
+
clickOutsideDeactivates: true
|
|
285
|
+
}}
|
|
286
|
+
>
|
|
287
|
+
<div
|
|
288
|
+
id={this.popoverContainerId}
|
|
289
|
+
ref={this.popoverContentRef}
|
|
290
|
+
style={{
|
|
291
|
+
position: 'absolute',
|
|
292
|
+
pointerEvents: 'all',
|
|
293
|
+
...position
|
|
294
|
+
}}
|
|
295
|
+
tabIndex={-1}
|
|
296
|
+
className={this.props.className}
|
|
297
|
+
role={this.props.role}
|
|
298
|
+
aria-modal={this.props.trapFocus ? 'true' : 'false'}
|
|
299
|
+
onKeyDown={this.handleKeyDown}
|
|
300
|
+
>
|
|
301
|
+
{this.props.children}
|
|
302
|
+
</div>
|
|
303
|
+
</FocusTrap>
|
|
304
|
+
)}
|
|
305
|
+
|
|
306
|
+
{!this.props.trapFocus && (
|
|
287
307
|
<div
|
|
288
308
|
id={this.popoverContainerId}
|
|
289
309
|
ref={this.popoverContentRef}
|
|
@@ -300,7 +320,7 @@ export class PopoverContainer extends React.Component<
|
|
|
300
320
|
>
|
|
301
321
|
{this.props.children}
|
|
302
322
|
</div>
|
|
303
|
-
|
|
323
|
+
)}
|
|
304
324
|
</div>
|
|
305
325
|
)
|
|
306
326
|
}
|
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-
|
|
213
|
-
var styles = {"popover-body-container":"popover-body-container__popover__12-
|
|
212
|
+
var css = "/*********************************************************************\n* © Copyright IBM Corp. 2024\n*********************************************************************/\n.popover-body-container__popover__12-23-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-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-0 {\n padding: 0;\n }\n.popover-tip__popover__12-23-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-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-0,\n .popover-tip--top__popover__12-23-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-0,\n .popover-tip--right__popover__12-23-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-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-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-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-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-0","popover-body":"popover-body__popover__12-23-0","popover-body--no-padding":"popover-body--no-padding__popover__12-23-0","popover-tip":"popover-tip__popover__12-23-0","popover-tip--bottom":"popover-tip--bottom__popover__12-23-0","popover-tip--top":"popover-tip--top__popover__12-23-0","popover-tip--left":"popover-tip--left__popover__12-23-0","popover-tip--right":"popover-tip--right__popover__12-23-0"};
|
|
214
214
|
styleInject(css);
|
|
215
215
|
|
|
216
216
|
/*********************************************************************
|
|
@@ -494,8 +494,7 @@ var PopoverContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
494
494
|
left: tipPosition === 'right' && position.left - 8,
|
|
495
495
|
right: tipPosition === 'left' && position.right - 8
|
|
496
496
|
}
|
|
497
|
-
}), React.createElement(FocusTrap, {
|
|
498
|
-
active: this.props.trapFocus,
|
|
497
|
+
}), this.props.trapFocus && React.createElement(FocusTrap, {
|
|
499
498
|
focusTrapOptions: {
|
|
500
499
|
fallbackFocus: "#".concat(this.popoverContainerId),
|
|
501
500
|
clickOutsideDeactivates: true
|
|
@@ -512,7 +511,19 @@ var PopoverContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
512
511
|
role: this.props.role,
|
|
513
512
|
"aria-modal": this.props.trapFocus ? 'true' : 'false',
|
|
514
513
|
onKeyDown: this.handleKeyDown
|
|
515
|
-
}, this.props.children))
|
|
514
|
+
}, this.props.children)), !this.props.trapFocus && React.createElement("div", {
|
|
515
|
+
id: this.popoverContainerId,
|
|
516
|
+
ref: this.popoverContentRef,
|
|
517
|
+
style: _extends({
|
|
518
|
+
position: 'absolute',
|
|
519
|
+
pointerEvents: 'all'
|
|
520
|
+
}, position),
|
|
521
|
+
tabIndex: -1,
|
|
522
|
+
className: this.props.className,
|
|
523
|
+
role: this.props.role,
|
|
524
|
+
"aria-modal": this.props.trapFocus ? 'true' : 'false',
|
|
525
|
+
onKeyDown: this.handleKeyDown
|
|
526
|
+
}, this.props.children));
|
|
516
527
|
}
|
|
517
528
|
}]);
|
|
518
529
|
return PopoverContainer;
|
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-
|
|
220
|
-
var styles = {"popover-body-container":"popover-body-container__popover__12-
|
|
219
|
+
var css = "/*********************************************************************\n* © Copyright IBM Corp. 2024\n*********************************************************************/\n.popover-body-container__popover__12-23-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-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-0 {\n padding: 0;\n }\n.popover-tip__popover__12-23-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-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-0,\n .popover-tip--top__popover__12-23-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-0,\n .popover-tip--right__popover__12-23-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-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-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-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-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-0","popover-body":"popover-body__popover__12-23-0","popover-body--no-padding":"popover-body--no-padding__popover__12-23-0","popover-tip":"popover-tip__popover__12-23-0","popover-tip--bottom":"popover-tip--bottom__popover__12-23-0","popover-tip--top":"popover-tip--top__popover__12-23-0","popover-tip--left":"popover-tip--left__popover__12-23-0","popover-tip--right":"popover-tip--right__popover__12-23-0"};
|
|
221
221
|
styleInject(css);
|
|
222
222
|
|
|
223
223
|
/*********************************************************************
|
|
@@ -501,8 +501,7 @@ var PopoverContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
501
501
|
left: tipPosition === 'right' && position.left - 8,
|
|
502
502
|
right: tipPosition === 'left' && position.right - 8
|
|
503
503
|
}
|
|
504
|
-
}), React__default.createElement(FocusTrap, {
|
|
505
|
-
active: this.props.trapFocus,
|
|
504
|
+
}), this.props.trapFocus && React__default.createElement(FocusTrap, {
|
|
506
505
|
focusTrapOptions: {
|
|
507
506
|
fallbackFocus: "#".concat(this.popoverContainerId),
|
|
508
507
|
clickOutsideDeactivates: true
|
|
@@ -519,7 +518,19 @@ var PopoverContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
519
518
|
role: this.props.role,
|
|
520
519
|
"aria-modal": this.props.trapFocus ? 'true' : 'false',
|
|
521
520
|
onKeyDown: this.handleKeyDown
|
|
522
|
-
}, this.props.children))
|
|
521
|
+
}, this.props.children)), !this.props.trapFocus && React__default.createElement("div", {
|
|
522
|
+
id: this.popoverContainerId,
|
|
523
|
+
ref: this.popoverContentRef,
|
|
524
|
+
style: _extends({
|
|
525
|
+
position: 'absolute',
|
|
526
|
+
pointerEvents: 'all'
|
|
527
|
+
}, position),
|
|
528
|
+
tabIndex: -1,
|
|
529
|
+
className: this.props.className,
|
|
530
|
+
role: this.props.role,
|
|
531
|
+
"aria-modal": this.props.trapFocus ? 'true' : 'false',
|
|
532
|
+
onKeyDown: this.handleKeyDown
|
|
533
|
+
}, this.props.children));
|
|
523
534
|
}
|
|
524
535
|
}]);
|
|
525
536
|
return PopoverContainer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@targetprocess/popover",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.23.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/popover.js",
|
|
6
6
|
"module": "dist/popover.es.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"prepack": "node -r ../../.ts-node.js ../../config/rollup.config.js ."
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@targetprocess/global-constants": "^12.
|
|
15
|
+
"@targetprocess/global-constants": "^12.23.0",
|
|
16
16
|
"classnames": "^2.2.5",
|
|
17
17
|
"focus-trap-react": "^7.0.0",
|
|
18
18
|
"prop-types": "^15.6.0",
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "32f86f62bef29fb1cfb18aaf42f72411a8f7cc48"
|
|
26
26
|
}
|