funda-ui 4.7.517 → 4.7.533
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/CascadingSelect/index.css +105 -88
- package/CascadingSelect/index.js +25 -24
- package/CascadingSelectE2E/index.css +105 -88
- package/CascadingSelectE2E/index.js +26 -25
- package/Date/index.js +3 -1
- package/DropdownMenu/index.js +3 -1
- package/LiveSearch/index.js +2 -1
- package/Select/index.d.ts +1 -0
- package/Select/index.js +70 -14
- package/Tooltip/index.css +69 -68
- package/Tooltip/index.d.ts +15 -1
- package/Tooltip/index.js +153 -57
- package/lib/cjs/CascadingSelect/index.js +25 -24
- package/lib/cjs/CascadingSelectE2E/index.js +26 -25
- package/lib/cjs/Date/index.js +3 -1
- package/lib/cjs/DropdownMenu/index.js +3 -1
- package/lib/cjs/LiveSearch/index.js +2 -1
- package/lib/cjs/Select/index.d.ts +1 -0
- package/lib/cjs/Select/index.js +70 -14
- package/lib/cjs/Tooltip/index.d.ts +15 -1
- package/lib/cjs/Tooltip/index.js +153 -57
- package/lib/css/CascadingSelect/index.css +105 -88
- package/lib/css/CascadingSelectE2E/index.css +105 -88
- package/lib/css/Tooltip/index.css +69 -68
- package/lib/esm/CascadingSelect/Group.tsx +3 -5
- package/lib/esm/CascadingSelect/index.scss +89 -68
- package/lib/esm/CascadingSelect/index.tsx +23 -21
- package/lib/esm/CascadingSelectE2E/Group.tsx +4 -3
- package/lib/esm/CascadingSelectE2E/index.scss +83 -63
- package/lib/esm/CascadingSelectE2E/index.tsx +24 -22
- package/lib/esm/Date/index.tsx +4 -1
- package/lib/esm/DropdownMenu/index.tsx +2 -1
- package/lib/esm/LiveSearch/index.tsx +2 -1
- package/lib/esm/Select/index.tsx +75 -17
- package/lib/esm/Tooltip/index.scss +63 -60
- package/lib/esm/Tooltip/index.tsx +143 -44
- package/package.json +1 -1
package/Select/index.js
CHANGED
|
@@ -3578,7 +3578,7 @@ var format_string = __webpack_require__(933);
|
|
|
3578
3578
|
// EXTERNAL MODULE: ../Utils/dist/cjs/cls.js
|
|
3579
3579
|
var cls = __webpack_require__(188);
|
|
3580
3580
|
;// CONCATENATED MODULE: ./src/index.tsx
|
|
3581
|
-
var _excluded = ["contentRef", "popupRef", "wrapperClassName", "controlClassName", "controlExClassName", "optionsExClassName", "exceededSidePosOffset", "clearIcon", "renderOption", "multiSelect", "multiSelectEntireAreaTrigger", "multiSelectSelectedItemOnlyStatus", "renderSelectedValue", "disabled", "required", "defaultValue", "value", "label", "name", "readOnly", "placeholder", "id", "autoComplete", "autoCapitalize", "spellCheck", "options", "clearTrigger", "loader", "lockBodyScroll", "hierarchical", "indentation", "doubleIndent", "style", "depth", "controlArrow", "winWidth", "tabIndex", "firstRequestAutoExec", "fetchTrigger", "fetchNoneInfo", "fetchUpdate", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "data", "extractValueByBrackets", "fetchCallback", "onFetch", "onLoad", "onSelect", "onChange", "onBlur", "onFocus", "onKeyPressed"];
|
|
3581
|
+
var _excluded = ["contentRef", "popupRef", "wrapperClassName", "controlClassName", "controlExClassName", "optionsExClassName", "customScrollContainer", "exceededSidePosOffset", "clearIcon", "renderOption", "multiSelect", "multiSelectEntireAreaTrigger", "multiSelectSelectedItemOnlyStatus", "renderSelectedValue", "disabled", "required", "defaultValue", "value", "label", "name", "readOnly", "placeholder", "id", "autoComplete", "autoCapitalize", "spellCheck", "options", "clearTrigger", "loader", "lockBodyScroll", "hierarchical", "indentation", "doubleIndent", "style", "depth", "controlArrow", "winWidth", "tabIndex", "firstRequestAutoExec", "fetchTrigger", "fetchNoneInfo", "fetchUpdate", "fetchFuncAsync", "fetchFuncMethod", "fetchFuncMethodParams", "data", "extractValueByBrackets", "fetchCallback", "onFetch", "onLoad", "onSelect", "onChange", "onBlur", "onFocus", "onKeyPressed"];
|
|
3582
3582
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3583
3583
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3584
3584
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -3626,6 +3626,7 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3626
3626
|
controlClassName = props.controlClassName,
|
|
3627
3627
|
controlExClassName = props.controlExClassName,
|
|
3628
3628
|
optionsExClassName = props.optionsExClassName,
|
|
3629
|
+
customScrollContainer = props.customScrollContainer,
|
|
3629
3630
|
exceededSidePosOffset = props.exceededSidePosOffset,
|
|
3630
3631
|
clearIcon = props.clearIcon,
|
|
3631
3632
|
renderOption = props.renderOption,
|
|
@@ -3701,6 +3702,8 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
3701
3702
|
var listContentRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
3702
3703
|
var optionsRes = options ? (0,validate.isJSON)(options) ? JSON.parse(options) : options : [];
|
|
3703
3704
|
var LIST_CONTAINER_MAX_HEIGHT = 300;
|
|
3705
|
+
var MIN_SPACE_FOR_DROPDOWN = 200; // Minimum space needed to show dropdown below trigger
|
|
3706
|
+
|
|
3704
3707
|
var keyboardSelectedItem = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
3705
3708
|
|
|
3706
3709
|
// loading
|
|
@@ -4321,8 +4324,36 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4321
4324
|
_contentOldHeight = listContainerHeightLimit(_contentOldHeight);
|
|
4322
4325
|
|
|
4323
4326
|
// You need to wait for the height of the pop-up container to be set
|
|
4324
|
-
// Detect position
|
|
4325
|
-
|
|
4327
|
+
// Detect position
|
|
4328
|
+
var containerHeight = window.innerHeight;
|
|
4329
|
+
var containerTop = 0;
|
|
4330
|
+
|
|
4331
|
+
// If custom scroll container is specified, use it instead of window
|
|
4332
|
+
if (customScrollContainer) {
|
|
4333
|
+
var customContainer = null;
|
|
4334
|
+
if (typeof customScrollContainer === 'string') {
|
|
4335
|
+
// Handle selector string
|
|
4336
|
+
customContainer = document.querySelector(customScrollContainer);
|
|
4337
|
+
} else if (customScrollContainer instanceof HTMLElement) {
|
|
4338
|
+
// Handle DOM element directly
|
|
4339
|
+
customContainer = customScrollContainer;
|
|
4340
|
+
} else if (customScrollContainer && 'current' in customScrollContainer) {
|
|
4341
|
+
// Handle React ref
|
|
4342
|
+
customContainer = customScrollContainer.current;
|
|
4343
|
+
}
|
|
4344
|
+
if (customContainer) {
|
|
4345
|
+
var containerRect = customContainer.getBoundingClientRect();
|
|
4346
|
+
containerHeight = containerRect.height;
|
|
4347
|
+
containerTop = containerRect.top;
|
|
4348
|
+
}
|
|
4349
|
+
}
|
|
4350
|
+
|
|
4351
|
+
// Calculate available space below the trigger
|
|
4352
|
+
var availableSpaceBelow = containerHeight - (_triggerBox.top - containerTop);
|
|
4353
|
+
|
|
4354
|
+
// Use a more reasonable threshold for position decision
|
|
4355
|
+
// Consider the minimum space needed for a usable dropdown
|
|
4356
|
+
if (availableSpaceBelow > MIN_SPACE_FOR_DROPDOWN) {
|
|
4326
4357
|
targetPos = 'bottom';
|
|
4327
4358
|
} else {
|
|
4328
4359
|
targetPos = 'top';
|
|
@@ -4333,7 +4364,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4333
4364
|
//-----------
|
|
4334
4365
|
// Set the pop-up height
|
|
4335
4366
|
if (targetPos === 'top') {
|
|
4336
|
-
|
|
4367
|
+
// Calculate available space above the trigger
|
|
4368
|
+
var availableSpaceAbove = _triggerBox.top - containerTop;
|
|
4369
|
+
contentMaxHeight = availableSpaceAbove;
|
|
4337
4370
|
|
|
4338
4371
|
// height restrictions
|
|
4339
4372
|
contentMaxHeight = listContainerHeightLimit(contentMaxHeight);
|
|
@@ -4354,7 +4387,9 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4354
4387
|
}
|
|
4355
4388
|
}
|
|
4356
4389
|
if (targetPos === 'bottom') {
|
|
4357
|
-
|
|
4390
|
+
// Calculate available space below the trigger
|
|
4391
|
+
var _availableSpaceBelow = containerHeight - (_triggerBox.bottom - containerTop);
|
|
4392
|
+
contentMaxHeight = _availableSpaceBelow;
|
|
4358
4393
|
|
|
4359
4394
|
// height restrictions
|
|
4360
4395
|
contentMaxHeight = listContainerHeightLimit(contentMaxHeight);
|
|
@@ -4380,17 +4415,16 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4380
4415
|
// Adjust position
|
|
4381
4416
|
if (targetPos === 'top') {
|
|
4382
4417
|
_modalRef.style.left = x + 'px';
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
_modalRef.style.
|
|
4418
|
+
_modalRef.style.bottom = 'auto';
|
|
4419
|
+
// Position the popup above the trigger without overlapping
|
|
4420
|
+
var topPosition = y - POS_OFFSET - listContentRef.current.clientHeight - 2;
|
|
4421
|
+
_modalRef.style.top = topPosition + 'px';
|
|
4387
4422
|
_modalRef.classList.add('pos-top');
|
|
4388
4423
|
}
|
|
4389
4424
|
if (targetPos === 'bottom') {
|
|
4390
4425
|
_modalRef.style.left = x + 'px';
|
|
4391
4426
|
_modalRef.style.bottom = 'auto';
|
|
4392
4427
|
_modalRef.style.top = y + height + POS_OFFSET + 'px';
|
|
4393
|
-
_modalRef.style.setProperty('position', 'absolute', 'important');
|
|
4394
4428
|
_modalRef.classList.remove('pos-top');
|
|
4395
4429
|
}
|
|
4396
4430
|
|
|
@@ -4400,16 +4434,38 @@ var Select = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_
|
|
|
4400
4434
|
var _modalContent = _modalRef;
|
|
4401
4435
|
var _modalBox = _modalContent.getBoundingClientRect();
|
|
4402
4436
|
if (typeof _modalContent.dataset.offset === 'undefined' && _modalBox.left > 0) {
|
|
4437
|
+
// Get container width for boundary checking
|
|
4438
|
+
var containerWidth = window.innerWidth;
|
|
4439
|
+
var containerLeft = 0;
|
|
4440
|
+
if (customScrollContainer) {
|
|
4441
|
+
var _customContainer = null;
|
|
4442
|
+
if (typeof customScrollContainer === 'string') {
|
|
4443
|
+
// Handle selector string
|
|
4444
|
+
_customContainer = document.querySelector(customScrollContainer);
|
|
4445
|
+
} else if (customScrollContainer instanceof HTMLElement) {
|
|
4446
|
+
// Handle DOM element directly
|
|
4447
|
+
_customContainer = customScrollContainer;
|
|
4448
|
+
} else if (customScrollContainer && 'current' in customScrollContainer) {
|
|
4449
|
+
// Handle React ref
|
|
4450
|
+
_customContainer = customScrollContainer.current;
|
|
4451
|
+
}
|
|
4452
|
+
if (_customContainer) {
|
|
4453
|
+
var _containerRect = _customContainer.getBoundingClientRect();
|
|
4454
|
+
containerWidth = _containerRect.width;
|
|
4455
|
+
containerLeft = _containerRect.left;
|
|
4456
|
+
}
|
|
4457
|
+
}
|
|
4458
|
+
|
|
4403
4459
|
// 10 pixels is used to account for some bias in mobile devices
|
|
4404
|
-
if (_modalBox.right + 10 >
|
|
4405
|
-
var _modalOffsetPosition = _modalBox.right -
|
|
4460
|
+
if (_modalBox.right + 10 > containerLeft + containerWidth) {
|
|
4461
|
+
var _modalOffsetPosition = _modalBox.right - (containerLeft + containerWidth) + EXCEEDED_SIDE_POS_OFFSET;
|
|
4406
4462
|
_modalContent.dataset.offset = _modalOffsetPosition;
|
|
4407
4463
|
_modalContent.style.marginLeft = "-".concat(_modalOffsetPosition, "px");
|
|
4408
4464
|
// console.log('_modalPosition: ', _modalOffsetPosition)
|
|
4409
4465
|
}
|
|
4410
4466
|
|
|
4411
|
-
if (_modalBox.left - 10 <
|
|
4412
|
-
var _modalOffsetPosition2 = Math.abs(_modalBox.left) + EXCEEDED_SIDE_POS_OFFSET;
|
|
4467
|
+
if (_modalBox.left - 10 < containerLeft) {
|
|
4468
|
+
var _modalOffsetPosition2 = Math.abs(_modalBox.left - containerLeft) + EXCEEDED_SIDE_POS_OFFSET;
|
|
4413
4469
|
_modalContent.dataset.offset = _modalOffsetPosition2;
|
|
4414
4470
|
_modalContent.style.marginLeft = "".concat(_modalOffsetPosition2, "px");
|
|
4415
4471
|
// console.log('_modalPosition: ', _modalOffsetPosition)
|
package/Tooltip/index.css
CHANGED
|
@@ -13,20 +13,20 @@
|
|
|
13
13
|
* 9. Position Modifiers - Right
|
|
14
14
|
* 10. Size
|
|
15
15
|
*/
|
|
16
|
-
.tooltip__wrapper {
|
|
17
|
-
--tooltip-box-shadow: 0 5px 15px 0 rgba(0,0,0,.07), 0 15px 35px 0 rgba(50,50,93,.1);
|
|
18
|
-
--tooltip-content-bg: rgba(17, 17, 17, 0.9);
|
|
19
|
-
--tooltip-content-color: #fff;
|
|
20
|
-
--tooltip-content-font-size: 0.75em;
|
|
21
|
-
--tooltip-content-padding-x: 1em;
|
|
22
|
-
--tooltip-content-padding-y: .5em;
|
|
23
|
-
--tooltip-content-line-height: 1.5;
|
|
24
|
-
--tooltip-arrow-bg-top: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%280%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
|
|
25
|
-
--tooltip-arrow-bg-bottom: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%28180%2018%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
|
|
26
|
-
--tooltip-arrow-bg-left: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%28-90%2018%2018%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
|
|
27
|
-
--tooltip-arrow-bg-right: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%2890%206%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
|
|
28
|
-
--tooltip-arrow-width: 18px;
|
|
29
|
-
--tooltip-arrow-height: 6px;
|
|
16
|
+
.cus-tooltip__wrapper {
|
|
17
|
+
--cus-tooltip-box-shadow: 0 5px 15px 0 rgba(0,0,0,.07), 0 15px 35px 0 rgba(50,50,93,.1);
|
|
18
|
+
--cus-tooltip-content-bg: rgba(17, 17, 17, 0.9);
|
|
19
|
+
--cus-tooltip-content-color: #fff;
|
|
20
|
+
--cus-tooltip-content-font-size: 0.75em;
|
|
21
|
+
--cus-tooltip-content-padding-x: 1em;
|
|
22
|
+
--cus-tooltip-content-padding-y: .5em;
|
|
23
|
+
--cus-tooltip-content-line-height: 1.5;
|
|
24
|
+
--cus-tooltip-arrow-bg-top: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%280%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
|
|
25
|
+
--cus-tooltip-arrow-bg-bottom: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%28180%2018%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
|
|
26
|
+
--cus-tooltip-arrow-bg-left: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%28-90%2018%2018%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
|
|
27
|
+
--cus-tooltip-arrow-bg-right: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%2890%206%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
|
|
28
|
+
--cus-tooltip-arrow-width: 18px;
|
|
29
|
+
--cus-tooltip-arrow-height: 6px;
|
|
30
30
|
position: absolute;
|
|
31
31
|
z-index: 1055; /* --bs-modal-zindex */
|
|
32
32
|
pointer-events: none;
|
|
@@ -73,125 +73,126 @@
|
|
|
73
73
|
---------------------------
|
|
74
74
|
*/
|
|
75
75
|
}
|
|
76
|
-
.tooltip__wrapper::before {
|
|
76
|
+
.cus-tooltip__wrapper::before {
|
|
77
77
|
background-size: 100% auto !important;
|
|
78
78
|
content: "";
|
|
79
79
|
position: absolute;
|
|
80
80
|
}
|
|
81
|
-
.tooltip__wrapper.active {
|
|
81
|
+
.cus-tooltip__wrapper.active {
|
|
82
82
|
display: block !important;
|
|
83
83
|
}
|
|
84
|
-
.tooltip__wrapper.active::before,
|
|
85
|
-
.tooltip__wrapper.active > .tooltip__content {
|
|
84
|
+
.cus-tooltip__wrapper.active::before,
|
|
85
|
+
.cus-tooltip__wrapper.active > .cus-tooltip__content {
|
|
86
86
|
opacity: 1;
|
|
87
87
|
}
|
|
88
|
-
.tooltip__wrapper:focus::before,
|
|
89
|
-
.tooltip__wrapper:focus > .tooltip__content {
|
|
88
|
+
.cus-tooltip__wrapper:focus::before,
|
|
89
|
+
.cus-tooltip__wrapper:focus > .cus-tooltip__content {
|
|
90
90
|
opacity: 1;
|
|
91
91
|
}
|
|
92
|
-
.tooltip__wrapper::before,
|
|
93
|
-
.tooltip__wrapper > .tooltip__content {
|
|
92
|
+
.cus-tooltip__wrapper::before,
|
|
93
|
+
.cus-tooltip__wrapper > .cus-tooltip__content {
|
|
94
94
|
backface-visibility: hidden;
|
|
95
95
|
will-change: transform;
|
|
96
96
|
opacity: 0;
|
|
97
97
|
box-sizing: border-box;
|
|
98
98
|
z-index: 10;
|
|
99
99
|
transform-origin: top;
|
|
100
|
-
box-shadow: var(--tooltip-box-shadow);
|
|
100
|
+
box-shadow: var(--cus-tooltip-box-shadow);
|
|
101
101
|
transition: none !important; /* Don't use transition if position is outside window */
|
|
102
102
|
}
|
|
103
|
-
.tooltip__wrapper > .tooltip__content {
|
|
104
|
-
|
|
103
|
+
.cus-tooltip__wrapper > .cus-tooltip__content {
|
|
104
|
+
pointer-events: auto;
|
|
105
|
+
background: var(--cus-tooltip-content-bg);
|
|
105
106
|
border-radius: 4px;
|
|
106
|
-
color: var(--tooltip-content-color);
|
|
107
|
+
color: var(--cus-tooltip-content-color);
|
|
107
108
|
content: attr(aria-label);
|
|
108
|
-
font-size: var(--tooltip-content-font-size);
|
|
109
|
+
font-size: var(--cus-tooltip-content-font-size);
|
|
109
110
|
font-weight: normal;
|
|
110
111
|
text-transform: none;
|
|
111
|
-
padding: var(--tooltip-content-padding-y) var(--tooltip-content-padding-x);
|
|
112
|
+
padding: var(--cus-tooltip-content-padding-y) var(--cus-tooltip-content-padding-x);
|
|
112
113
|
white-space: nowrap;
|
|
113
114
|
box-sizing: content-box;
|
|
114
|
-
line-height: var(--tooltip-content-line-height);
|
|
115
|
+
line-height: var(--cus-tooltip-content-line-height);
|
|
115
116
|
}
|
|
116
|
-
.tooltip__wrapper > .tooltip__content img {
|
|
117
|
+
.cus-tooltip__wrapper > .cus-tooltip__content img {
|
|
117
118
|
height: auto !important;
|
|
118
119
|
margin: 0.5rem 0;
|
|
119
120
|
}
|
|
120
|
-
.tooltip__wrapper[data-microtip-position|=top]::before {
|
|
121
|
-
background: var(--tooltip-arrow-bg-top);
|
|
122
|
-
height: var(--tooltip-arrow-height);
|
|
123
|
-
width: var(--tooltip-arrow-width);
|
|
121
|
+
.cus-tooltip__wrapper[data-microtip-position|=top]::before {
|
|
122
|
+
background: var(--cus-tooltip-arrow-bg-top);
|
|
123
|
+
height: var(--cus-tooltip-arrow-height);
|
|
124
|
+
width: var(--cus-tooltip-arrow-width);
|
|
124
125
|
}
|
|
125
|
-
.tooltip__wrapper[data-microtip-position|=top] > .tooltip__content {
|
|
126
|
-
margin-bottom: var(--tooltip-arrow-height);
|
|
126
|
+
.cus-tooltip__wrapper[data-microtip-position|=top] > .cus-tooltip__content {
|
|
127
|
+
margin-bottom: var(--cus-tooltip-arrow-height);
|
|
127
128
|
}
|
|
128
|
-
.tooltip__wrapper[data-microtip-position|=top]::before {
|
|
129
|
-
top: calc(100% - var(--tooltip-arrow-height));
|
|
130
|
-
left: calc(var(--tooltip-arrow-width) / 2 * -1);
|
|
129
|
+
.cus-tooltip__wrapper[data-microtip-position|=top]::before {
|
|
130
|
+
top: calc(100% - var(--cus-tooltip-arrow-height));
|
|
131
|
+
left: calc(var(--cus-tooltip-arrow-width) / 2 * -1);
|
|
131
132
|
}
|
|
132
|
-
.tooltip__wrapper[data-microtip-position|=top] > .tooltip__content {
|
|
133
|
-
bottom: calc(100% + var(--tooltip-arrow-height));
|
|
133
|
+
.cus-tooltip__wrapper[data-microtip-position|=top] > .cus-tooltip__content {
|
|
134
|
+
bottom: calc(100% + var(--cus-tooltip-arrow-height));
|
|
134
135
|
left: 50%;
|
|
135
136
|
transform: translateX(-50%);
|
|
136
137
|
}
|
|
137
|
-
.tooltip__wrapper[data-microtip-position=top-left] > .tooltip__content {
|
|
138
|
-
bottom: calc(100% + var(--tooltip-arrow-height));
|
|
138
|
+
.cus-tooltip__wrapper[data-microtip-position=top-left] > .cus-tooltip__content {
|
|
139
|
+
bottom: calc(100% + var(--cus-tooltip-arrow-height));
|
|
139
140
|
left: 50%;
|
|
140
|
-
transform: translateX(calc(-100% + var(--tooltip-arrow-width)));
|
|
141
|
+
transform: translateX(calc(-100% + var(--cus-tooltip-arrow-width)));
|
|
141
142
|
}
|
|
142
|
-
.tooltip__wrapper[data-microtip-position=top-right] > .tooltip__content {
|
|
143
|
-
bottom: calc(100% + var(--tooltip-arrow-height));
|
|
143
|
+
.cus-tooltip__wrapper[data-microtip-position=top-right] > .cus-tooltip__content {
|
|
144
|
+
bottom: calc(100% + var(--cus-tooltip-arrow-height));
|
|
144
145
|
left: 50%;
|
|
145
|
-
transform: translateX(calc(0% - var(--tooltip-arrow-width)));
|
|
146
|
+
transform: translateX(calc(0% - var(--cus-tooltip-arrow-width)));
|
|
146
147
|
}
|
|
147
|
-
.tooltip__wrapper[data-microtip-position|=bottom]::before {
|
|
148
|
-
background: var(--tooltip-arrow-bg-bottom);
|
|
149
|
-
height: var(--tooltip-arrow-height);
|
|
150
|
-
width: var(--tooltip-arrow-width);
|
|
148
|
+
.cus-tooltip__wrapper[data-microtip-position|=bottom]::before {
|
|
149
|
+
background: var(--cus-tooltip-arrow-bg-bottom);
|
|
150
|
+
height: var(--cus-tooltip-arrow-height);
|
|
151
|
+
width: var(--cus-tooltip-arrow-width);
|
|
151
152
|
margin-top: 5px;
|
|
152
153
|
margin-bottom: 0;
|
|
153
154
|
}
|
|
154
|
-
.tooltip__wrapper[data-microtip-position|=bottom] > .tooltip__content {
|
|
155
|
-
margin-top: var(--tooltip-arrow-height);
|
|
155
|
+
.cus-tooltip__wrapper[data-microtip-position|=bottom] > .cus-tooltip__content {
|
|
156
|
+
margin-top: var(--cus-tooltip-arrow-height);
|
|
156
157
|
}
|
|
157
|
-
.tooltip__wrapper[data-microtip-position|=bottom]::before {
|
|
158
|
-
bottom: calc(100% - var(--tooltip-arrow-height));
|
|
159
|
-
left: calc(var(--tooltip-arrow-width) / 2 * -1);
|
|
158
|
+
.cus-tooltip__wrapper[data-microtip-position|=bottom]::before {
|
|
159
|
+
bottom: calc(100% - var(--cus-tooltip-arrow-height));
|
|
160
|
+
left: calc(var(--cus-tooltip-arrow-width) / 2 * -1);
|
|
160
161
|
}
|
|
161
|
-
.tooltip__wrapper[data-microtip-position|=bottom] > .tooltip__content {
|
|
162
|
+
.cus-tooltip__wrapper[data-microtip-position|=bottom] > .cus-tooltip__content {
|
|
162
163
|
bottom: auto;
|
|
163
|
-
top: calc(100% + var(--tooltip-arrow-height));
|
|
164
|
+
top: calc(100% + var(--cus-tooltip-arrow-height));
|
|
164
165
|
left: 50%;
|
|
165
166
|
transform: translateX(-50%);
|
|
166
167
|
}
|
|
167
|
-
.tooltip__wrapper[data-microtip-position=bottom-left] > .tooltip__content {
|
|
168
|
+
.cus-tooltip__wrapper[data-microtip-position=bottom-left] > .cus-tooltip__content {
|
|
168
169
|
bottom: auto;
|
|
169
|
-
top: calc(100% + var(--tooltip-arrow-height));
|
|
170
|
+
top: calc(100% + var(--cus-tooltip-arrow-height));
|
|
170
171
|
left: 50%;
|
|
171
|
-
transform: translateX(calc(-100% + var(--tooltip-arrow-width)));
|
|
172
|
+
transform: translateX(calc(-100% + var(--cus-tooltip-arrow-width)));
|
|
172
173
|
}
|
|
173
|
-
.tooltip__wrapper[data-microtip-position=bottom-right] > .tooltip__content {
|
|
174
|
+
.cus-tooltip__wrapper[data-microtip-position=bottom-right] > .cus-tooltip__content {
|
|
174
175
|
bottom: auto;
|
|
175
|
-
top: calc(100% + var(--tooltip-arrow-height));
|
|
176
|
+
top: calc(100% + var(--cus-tooltip-arrow-height));
|
|
176
177
|
left: 50%;
|
|
177
|
-
transform: translateX(calc(0% - var(--tooltip-arrow-width)));
|
|
178
|
+
transform: translateX(calc(0% - var(--cus-tooltip-arrow-width)));
|
|
178
179
|
}
|
|
179
|
-
.tooltip__wrapper[data-microtip-size=auto].tooltip__content {
|
|
180
|
+
.cus-tooltip__wrapper[data-microtip-size=auto].cus-tooltip__content {
|
|
180
181
|
white-space: nowrap;
|
|
181
182
|
width: auto;
|
|
182
183
|
max-width: 530px;
|
|
183
184
|
overflow: hidden;
|
|
184
185
|
text-overflow: ellipsis;
|
|
185
186
|
}
|
|
186
|
-
.tooltip__wrapper[data-microtip-size=small].tooltip__content {
|
|
187
|
+
.cus-tooltip__wrapper[data-microtip-size=small].cus-tooltip__content {
|
|
187
188
|
white-space: initial;
|
|
188
189
|
width: 80px;
|
|
189
190
|
}
|
|
190
|
-
.tooltip__wrapper[data-microtip-size=medium].tooltip__content {
|
|
191
|
+
.cus-tooltip__wrapper[data-microtip-size=medium].cus-tooltip__content {
|
|
191
192
|
white-space: initial;
|
|
192
193
|
width: 150px;
|
|
193
194
|
}
|
|
194
|
-
.tooltip__wrapper[data-microtip-size=large].tooltip__content {
|
|
195
|
+
.cus-tooltip__wrapper[data-microtip-size=large].cus-tooltip__content {
|
|
195
196
|
white-space: initial;
|
|
196
197
|
width: 260px;
|
|
197
198
|
}
|
package/Tooltip/index.d.ts
CHANGED
|
@@ -16,9 +16,23 @@ export declare type TooltipProps = {
|
|
|
16
16
|
mouseOutDelay?: number;
|
|
17
17
|
/** Set a piece of text or HTML code */
|
|
18
18
|
content?: React.ReactNode;
|
|
19
|
+
/** If true, Tooltip is controlled by parent via ref, not by mouse events */
|
|
20
|
+
controlled?: boolean;
|
|
21
|
+
/** Custom color for the popup arrow */
|
|
22
|
+
popupArrowColor?: number[];
|
|
23
|
+
/** Custom style for the popup content */
|
|
24
|
+
popupContentStyle?: React.CSSProperties;
|
|
25
|
+
/** If true, tooltip closes only if mouse does not enter wrapper within timeout after leaving trigger */
|
|
26
|
+
delayedClose?: boolean;
|
|
27
|
+
/** Timeout in ms for delayed close (ms) */
|
|
28
|
+
delayedCloseTimeout?: number;
|
|
29
|
+
/** Called when mouse enters the tooltip wrapper */
|
|
30
|
+
onContentMouseEnter?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
31
|
+
/** Called when mouse leaves the tooltip wrapper */
|
|
32
|
+
onContentMouseLeave?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
19
33
|
/** -- */
|
|
20
34
|
id?: string;
|
|
21
35
|
children: React.ReactNode;
|
|
22
36
|
};
|
|
23
|
-
declare const Tooltip:
|
|
37
|
+
declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<any>>;
|
|
24
38
|
export default Tooltip;
|