@targetprocess/popover 12.21.0 → 12.22.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 -0
- package/PopoverContainer.tsx +3 -1
- package/StatlessPopover.tsx +2 -0
- package/dist/Popover.d.ts +1 -0
- package/dist/PopoverContainer.d.ts +1 -0
- package/dist/StatlessPopover.d.ts +1 -0
- package/dist/popover.es.js +4 -3
- package/dist/popover.js +4 -3
- package/package.json +3 -3
package/Popover.tsx
CHANGED
package/PopoverContainer.tsx
CHANGED
|
@@ -24,6 +24,7 @@ type PopoverContainerProps = {
|
|
|
24
24
|
scrollThrottleIntervalMs?: number
|
|
25
25
|
getPopoverPosition: GetPopoverPositionType
|
|
26
26
|
showTip?: boolean
|
|
27
|
+
classNameTip?: string
|
|
27
28
|
zIndex: number
|
|
28
29
|
role?: 'tooltip' | 'dialog'
|
|
29
30
|
trapFocus?: boolean
|
|
@@ -265,7 +266,8 @@ export class PopoverContainer extends React.Component<
|
|
|
265
266
|
className={classNames(
|
|
266
267
|
styles['popover-tip'],
|
|
267
268
|
styles[`popover-tip--${tipPosition}`],
|
|
268
|
-
'popover-tip'
|
|
269
|
+
'popover-tip',
|
|
270
|
+
this.props.classNameTip
|
|
269
271
|
)}
|
|
270
272
|
style={{
|
|
271
273
|
top: tipPosition === 'bottom' && (position.top as number) - 8,
|
package/StatlessPopover.tsx
CHANGED
|
@@ -16,6 +16,7 @@ export type StatelessPopoverProps = {
|
|
|
16
16
|
body?: React.ReactNode
|
|
17
17
|
zIndex: number
|
|
18
18
|
showTip?: boolean
|
|
19
|
+
classNameTip?: string
|
|
19
20
|
className?: string
|
|
20
21
|
outerActionEvents?: string[]
|
|
21
22
|
onOuterAction?: (evt: Event) => void
|
|
@@ -44,6 +45,7 @@ export class StatelessPopover extends React.Component<StatelessPopoverProps> {
|
|
|
44
45
|
className={props.className}
|
|
45
46
|
positioningTarget={positioningTarget}
|
|
46
47
|
showTip={props.showTip}
|
|
48
|
+
classNameTip={props.classNameTip}
|
|
47
49
|
zIndex={props.zIndex}
|
|
48
50
|
trackScroll={props.trackScroll}
|
|
49
51
|
role={this.props.role}
|
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-
|
|
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-22-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-22-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-22-0 {\n padding: 0;\n }\n.popover-tip__popover__12-22-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-22-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-22-0,\n .popover-tip--top__popover__12-22-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-22-0,\n .popover-tip--right__popover__12-22-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-22-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-22-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-22-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-22-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-22-0","popover-body":"popover-body__popover__12-22-0","popover-body--no-padding":"popover-body--no-padding__popover__12-22-0","popover-tip":"popover-tip__popover__12-22-0","popover-tip--bottom":"popover-tip--bottom__popover__12-22-0","popover-tip--top":"popover-tip--top__popover__12-22-0","popover-tip--left":"popover-tip--left__popover__12-22-0","popover-tip--right":"popover-tip--right__popover__12-22-0"};
|
|
214
214
|
styleInject(css);
|
|
215
215
|
|
|
216
216
|
/*********************************************************************
|
|
@@ -487,7 +487,7 @@ var PopoverContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
487
487
|
opacity: this.state.adjusted ? 1 : 0
|
|
488
488
|
})
|
|
489
489
|
}, this.props.showTip && tipPosition && React.createElement("div", {
|
|
490
|
-
className: classNames(styles['popover-tip'], styles["popover-tip--".concat(tipPosition)], 'popover-tip'),
|
|
490
|
+
className: classNames(styles['popover-tip'], styles["popover-tip--".concat(tipPosition)], 'popover-tip', this.props.classNameTip),
|
|
491
491
|
style: {
|
|
492
492
|
top: tipPosition === 'bottom' && position.top - 8,
|
|
493
493
|
bottom: tipPosition === 'top' && position.bottom - 8,
|
|
@@ -655,6 +655,7 @@ var StatelessPopover = /*#__PURE__*/function (_React$Component) {
|
|
|
655
655
|
className: props.className,
|
|
656
656
|
positioningTarget: positioningTarget,
|
|
657
657
|
showTip: props.showTip,
|
|
658
|
+
classNameTip: props.classNameTip,
|
|
658
659
|
zIndex: props.zIndex,
|
|
659
660
|
trackScroll: props.trackScroll,
|
|
660
661
|
role: this.props.role,
|
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-22-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-22-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-22-0 {\n padding: 0;\n }\n.popover-tip__popover__12-22-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-22-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-22-0,\n .popover-tip--top__popover__12-22-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-22-0,\n .popover-tip--right__popover__12-22-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-22-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-22-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-22-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-22-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-22-0","popover-body":"popover-body__popover__12-22-0","popover-body--no-padding":"popover-body--no-padding__popover__12-22-0","popover-tip":"popover-tip__popover__12-22-0","popover-tip--bottom":"popover-tip--bottom__popover__12-22-0","popover-tip--top":"popover-tip--top__popover__12-22-0","popover-tip--left":"popover-tip--left__popover__12-22-0","popover-tip--right":"popover-tip--right__popover__12-22-0"};
|
|
221
221
|
styleInject(css);
|
|
222
222
|
|
|
223
223
|
/*********************************************************************
|
|
@@ -494,7 +494,7 @@ var PopoverContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
494
494
|
opacity: this.state.adjusted ? 1 : 0
|
|
495
495
|
})
|
|
496
496
|
}, this.props.showTip && tipPosition && React__default.createElement("div", {
|
|
497
|
-
className: classNames(styles['popover-tip'], styles["popover-tip--".concat(tipPosition)], 'popover-tip'),
|
|
497
|
+
className: classNames(styles['popover-tip'], styles["popover-tip--".concat(tipPosition)], 'popover-tip', this.props.classNameTip),
|
|
498
498
|
style: {
|
|
499
499
|
top: tipPosition === 'bottom' && position.top - 8,
|
|
500
500
|
bottom: tipPosition === 'top' && position.bottom - 8,
|
|
@@ -662,6 +662,7 @@ var StatelessPopover = /*#__PURE__*/function (_React$Component) {
|
|
|
662
662
|
className: props.className,
|
|
663
663
|
positioningTarget: positioningTarget,
|
|
664
664
|
showTip: props.showTip,
|
|
665
|
+
classNameTip: props.classNameTip,
|
|
665
666
|
zIndex: props.zIndex,
|
|
666
667
|
trackScroll: props.trackScroll,
|
|
667
668
|
role: this.props.role,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@targetprocess/popover",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.22.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.22.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": "0b28861002689e429cb2b1c6e99a0b85e3e7de11"
|
|
26
26
|
}
|