(target, text, className = 'cn-tooltip', styleMap = {})
| 604 | } |
| 605 | } |
| 606 | export function showTooltip(target, text, className = 'cn-tooltip', styleMap = {}) { |
| 607 | if (!$tooltip) { |
| 608 | $tooltip = document.createElement("div"); |
| 609 | $tooltip.className = className; |
| 610 | $tooltip.style.cssText = ` |
| 611 | pointer-events: none; |
| 612 | position: fixed; |
| 613 | z-index: 10001; |
| 614 | padding: 20px; |
| 615 | color: #1e1e1e; |
| 616 | max-width: 350px; |
| 617 | filter: drop-shadow(1px 5px 5px rgb(0 0 0 / 30%)); |
| 618 | ${Object.keys(styleMap).map(k=>k+":"+styleMap[k]+";").join("")} |
| 619 | `; |
| 620 | document.body.appendChild($tooltip); |
| 621 | } |
| 622 | |
| 623 | $tooltip.innerHTML = text; |
| 624 | $tooltip.style.display = "block"; |
| 625 | renderPopover($tooltip, target, { |
| 626 | positions: ['top', 'bottom', 'right', 'center'], |
| 627 | bgColor: "#ffffff", |
| 628 | borderColor: "#cccccc", |
| 629 | borderRadius: 5 |
| 630 | }); |
| 631 | } |
| 632 | |
| 633 | export function generateUUID() { |
| 634 | return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { |
no test coverage detected