@ew-color-picker/tooltip 2.0.14 → 2.0.16
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Placement } from "@ew-color-picker/utils";
|
|
1
|
+
import { type AttrRecord, type Placement } from "@ew-color-picker/utils";
|
|
2
2
|
export type TooltipEffect = "dark" | "light";
|
|
3
3
|
export type TooltipPlacement = Placement;
|
|
4
4
|
export type TooltipTrigger = "hover" | "click" | "focus" | "contextmenu";
|
|
@@ -43,6 +43,7 @@ export interface TooltipOptions {
|
|
|
43
43
|
focusOnTarget?: boolean;
|
|
44
44
|
popperOptions?: TooltipPopperOptions;
|
|
45
45
|
className?: string;
|
|
46
|
+
attrs?: AttrRecord;
|
|
46
47
|
container?: HTMLElement;
|
|
47
48
|
onBeforeShow?: (event?: Event) => void;
|
|
48
49
|
onShow?: (event?: Event) => void;
|
|
@@ -72,6 +73,8 @@ export default class Tooltip {
|
|
|
72
73
|
private positionFrame;
|
|
73
74
|
private globalBound;
|
|
74
75
|
private triggerListeners;
|
|
76
|
+
private targetAttrEl;
|
|
77
|
+
private appliedTargetAttrs;
|
|
75
78
|
private popperListeners;
|
|
76
79
|
private listeners;
|
|
77
80
|
constructor(options?: TooltipOptions);
|
|
@@ -97,6 +100,8 @@ export default class Tooltip {
|
|
|
97
100
|
private updatePosition;
|
|
98
101
|
private scheduleUpdate;
|
|
99
102
|
private addTriggerListener;
|
|
103
|
+
private applyTargetAttrs;
|
|
104
|
+
setAttrs(attrs?: AttrRecord): void;
|
|
100
105
|
private bindTriggerEvents;
|
|
101
106
|
private unbindTriggerEvents;
|
|
102
107
|
private bindPopperEvents;
|
package/dist/tooltip.esm.js
CHANGED
|
@@ -3,9 +3,42 @@
|
|
|
3
3
|
* (c) 2024-2026 eveningwater(854806732@qq.com)
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { isNull, isUndefined, isString, $, isHTMLElement, isFunction, getRect, addClass, toStyleStr, create, setAttr, insertNode, removeElement, getElementSize, parsePlacement, clamp, isPlacement, on, off, getAttr, removeClass, extend, isBoolean, isArray, DEFAULT_PREFIX } from '@ew-color-picker/utils';
|
|
6
|
+
import { isNull, isUndefined, isString, $, isHTMLElement, isFunction, getRect, addClass, toStyleStr, create, setAttr, insertNode, removeElement, getElementSize, parsePlacement, clamp, isPlacement, on, applyExtraAttrs, off, getAttr, removeClass, extend, isBoolean, isArray, DEFAULT_PREFIX } from '@ew-color-picker/utils';
|
|
7
7
|
export { isTextTruncated } from '@ew-color-picker/utils';
|
|
8
8
|
|
|
9
|
+
/******************************************************************************
|
|
10
|
+
Copyright (c) Microsoft Corporation.
|
|
11
|
+
|
|
12
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
13
|
+
purpose with or without fee is hereby granted.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
16
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
17
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
18
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
19
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
20
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
21
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
22
|
+
***************************************************************************** */
|
|
23
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
var __assign = function() {
|
|
27
|
+
__assign = Object.assign || function __assign(t) {
|
|
28
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
29
|
+
s = arguments[i];
|
|
30
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
31
|
+
}
|
|
32
|
+
return t;
|
|
33
|
+
};
|
|
34
|
+
return __assign.apply(this, arguments);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
38
|
+
var e = new Error(message);
|
|
39
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
40
|
+
};
|
|
41
|
+
|
|
9
42
|
var TRIGGERS = ["hover", "click", "focus", "contextmenu"];
|
|
10
43
|
var OPPOSITE_SIDE = {
|
|
11
44
|
top: "bottom",
|
|
@@ -53,6 +86,8 @@ var Tooltip = /** @class */ (function () {
|
|
|
53
86
|
this.positionFrame = null;
|
|
54
87
|
this.globalBound = false;
|
|
55
88
|
this.triggerListeners = [];
|
|
89
|
+
this.targetAttrEl = null;
|
|
90
|
+
this.appliedTargetAttrs = {};
|
|
56
91
|
this.popperListeners = [];
|
|
57
92
|
this.listeners = {};
|
|
58
93
|
// 滚动/resize 时按帧合并重算,避免高频 reflow
|
|
@@ -444,6 +479,27 @@ var Tooltip = /** @class */ (function () {
|
|
|
444
479
|
on(el, type, handler);
|
|
445
480
|
this.triggerListeners.push({ el: el, type: type, handler: handler });
|
|
446
481
|
};
|
|
482
|
+
// 把 attrs 透传到触发元素
|
|
483
|
+
Tooltip.prototype.applyTargetAttrs = function () {
|
|
484
|
+
var _this = this;
|
|
485
|
+
var el = this.resolveElement(this.options.target);
|
|
486
|
+
if (!el)
|
|
487
|
+
return;
|
|
488
|
+
if (this.targetAttrEl && this.targetAttrEl !== el) {
|
|
489
|
+
Object.keys(this.appliedTargetAttrs).forEach(function (key) {
|
|
490
|
+
_this.targetAttrEl.removeAttribute(key);
|
|
491
|
+
});
|
|
492
|
+
this.appliedTargetAttrs = {};
|
|
493
|
+
}
|
|
494
|
+
this.targetAttrEl = el;
|
|
495
|
+
this.appliedTargetAttrs = applyExtraAttrs(el, this.options.attrs || {}, this.appliedTargetAttrs);
|
|
496
|
+
};
|
|
497
|
+
// 全量替换触发元素上的透传属性
|
|
498
|
+
Tooltip.prototype.setAttrs = function (attrs) {
|
|
499
|
+
if (attrs === void 0) { attrs = {}; }
|
|
500
|
+
this.options.attrs = __assign({}, attrs);
|
|
501
|
+
this.applyTargetAttrs();
|
|
502
|
+
};
|
|
447
503
|
Tooltip.prototype.bindTriggerEvents = function () {
|
|
448
504
|
var _this = this;
|
|
449
505
|
this.unbindTriggerEvents();
|
|
@@ -452,6 +508,7 @@ var Tooltip = /** @class */ (function () {
|
|
|
452
508
|
var el = this.resolveElement(this.options.target);
|
|
453
509
|
if (!el)
|
|
454
510
|
return;
|
|
511
|
+
this.applyTargetAttrs();
|
|
455
512
|
var triggers = this.triggerList;
|
|
456
513
|
var hasHover = triggers.indexOf("hover") > -1;
|
|
457
514
|
var hasClick = triggers.indexOf("click") > -1;
|
|
@@ -805,6 +862,9 @@ var Tooltip = /** @class */ (function () {
|
|
|
805
862
|
if (Object.prototype.hasOwnProperty.call(options, "visible")) {
|
|
806
863
|
this.controlled = isBoolean(options.visible);
|
|
807
864
|
}
|
|
865
|
+
if (options.attrs !== undefined) {
|
|
866
|
+
this.applyTargetAttrs();
|
|
867
|
+
}
|
|
808
868
|
// 触发/挂载相关配置变化时重新绑定
|
|
809
869
|
if (options.target !== undefined ||
|
|
810
870
|
options.trigger !== undefined ||
|
package/dist/tooltip.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
((t,e)=>{"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@ew-color-picker/utils")):"function"==typeof define&&define.amd?define(["exports","@ew-color-picker/utils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Tooltip={},t.Utils)})(this,function(t,d){var e=["hover","click","focus","contextmenu"],p={top:"bottom",bottom:"top",left:"right",right:"left"},i=0;function o(t){return-1<e.indexOf(t)}function r(t){var e;return d.isArray(t)?(e=t.filter(o)).length?e:["hover"]:o(t)?[t]:["hover"]}Object.defineProperty(s.prototype,"prefix",{get:function(){return this.options.prefix},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"strategy",{get:function(){return"absolute"===this.options.popperOptions.strategy?"absolute":"fixed"},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"triggerList",{get:function(){return this.options.trigger},enumerable:!1,configurable:!0}),s.prototype.hasContent=function(t){return void 0===t&&(t=this.currentContent),!d.isNull(t)&&!d.isUndefined(t)&&(!d.isString(t)||0<t.trim().length)},s.prototype.resolveElement=function(t){return t?d.isString(t)?d.$(t):t:null},s.prototype.getAnchorElement=function(){var t;return this.options.virtualTriggering?(t=this.options.virtualRef,d.isHTMLElement(t)?t:null):this.imperativeAnchor||this.resolveElement(this.options.target)},s.prototype.getAnchorRect=function(){var t;return this.options.virtualTriggering?(t=this.options.virtualRef)&&d.isFunction(t.getBoundingClientRect)?t.getBoundingClientRect():null:(t=this.getAnchorElement())?d.getRect(t):null},s.prototype.getParent=function(){var t;return!1===this.options.teleported?(null==(t=this.getAnchorElement())?void 0:t.parentElement)||document.body:(t=null!=(t=this.options.appendTo)?t:this.options.container,d.isString(t)?d.$(t)||document.body:t||document.body)},s.prototype.applyCustomClasses=function(t){var e=[this.options.popperClass,this.options.className].filter(Boolean).join(" ");e&&d.addClass(t,e),this.options.transition&&d.addClass(t,this.options.transition)},s.prototype.applyPopperStyle=function(t){var e=this.options.popperStyle;e&&(t.style.cssText+=d.isString(e)?e:d.toStyleStr(e))},s.prototype.ensureNode=function(){var t,e;return this.node?(this.attachNode(),this.node):(t=this.prefix,(e=d.create("div")).id="".concat(t,"tooltip-").concat(++i),d.addClass(e,"".concat(t,"tooltip")),d.addClass(e,"".concat(t,"tooltip--").concat(this.options.effect)),this.options.enterable&&d.addClass(e,"".concat(t,"tooltip--enterable")),d.setAttr(e,{role:"tooltip"}),this.options.ariaLabel&&d.setAttr(e,{"aria-label":this.options.ariaLabel}),this.applyCustomClasses(e),e.style.position=this.strategy,this.contentNode=d.create("div"),d.addClass(this.contentNode,"".concat(t,"tooltip__content")),d.insertNode(e,this.contentNode),this.arrowNode=d.create("div"),d.addClass(this.arrowNode,"".concat(t,"tooltip__arrow")),this.options.showArrow||(this.arrowNode.style.display="none"),d.insertNode(e,this.arrowNode),this.applyPopperStyle(e),this.node=e,this.attachNode(),this.bindPopperEvents(),e)},s.prototype.attachNode=function(){var t;this.node&&(t=this.getParent())&&this.node.parentNode!==t&&t.appendChild(this.node)},s.prototype.applyContent=function(){var t,e=this.contentNode;e&&(t=this.currentContent,e.textContent="",d.isNull(t)||d.isUndefined(t)||(d.isString(t)?this.options.html||this.options.rawContent?e.innerHTML=t:e.textContent=t:d.isHTMLElement(t)?e.appendChild(t):e.textContent=String(t)))},s.prototype.destroyNode=function(){this.unbindPopperEvents(),this.node&&(d.removeElement(this.node),this.node=null),this.contentNode=null,this.arrowNode=null},s.prototype.getNodeSize=function(){var t;return this.node?{width:(t=d.getElementSize(this.node)).offsetWidth||0,height:t.offsetHeight||0}:{width:0,height:0}},s.prototype.computeCoords=function(t,e,i){function o(){return"start"===r?e.left:"end"===r?e.right-i.width:e.left+(e.width-i.width)/2}function n(){return"start"===r?e.top:"end"===r?e.bottom-i.height:e.top+(e.height-i.height)/2}var t=d.parsePlacement(t),s=t.side,r=t.align,h=this.options.offset,p=0,a=0;switch(s){case"top":a=e.top-h-i.height,p=o();break;case"bottom":a=e.bottom+h,p=o();break;case"left":p=e.left-h-i.width,a=n();break;case"right":p=e.right+h,a=n()}var t=window.innerWidth,l=window.innerHeight;return"top"===s||"bottom"===s?p=d.clamp(p,5,Math.max(5,t-i.width-5)):a=d.clamp(a,5,Math.max(5,l-i.height-5)),"absolute"===this.strategy&&(p+=window.scrollX||window.pageXOffset||0,a+=window.scrollY||window.pageYOffset||0),{left:p,top:a}},s.prototype.fitsViewport=function(t,e,i){var t=d.parsePlacement(t).side,o=this.options.offset,n=window.innerWidth,s=window.innerHeight;switch(t){case"top":return 5<=e.top-o-i.height;case"bottom":return e.bottom+o+i.height<=s-5;case"left":return 5<=e.left-o-i.width;case"right":return e.right+o+i.width<=n-5}},s.prototype.resolvePlacement=function(t,e){var i=this.options.placement;if(!this.fitsViewport(i,t,e))for(var o=d.parsePlacement(i),n=o.side,o=o.align,n=p[n],n="center"===o?n:"".concat(n,"-").concat(o),s=0,r=this.options.fallbackPlacements.length?this.options.fallbackPlacements:[n];s<r.length;s++){var h=r[s];if(d.isPlacement(h)&&this.fitsViewport(h,t,e))return h}return i},s.prototype.updateArrow=function(t,e,i,o){var n,s,r,h=this.arrowNode;h&&(this.options.showArrow?(h.style.display="",h.style.left="",h.style.right="",h.style.top="",h.style.bottom="",n=d.parsePlacement(t).side,s=this.options.arrowOffset,"top"===n||"bottom"===n?(r=e.left+e.width/2-i.left,o.width>2*s&&(r=d.clamp(r,s,o.width-s)),h.style.left="".concat(r-4,"px"),"top"===n?h.style.bottom="".concat(-4,"px"):h.style.top="".concat(-4,"px")):(r=e.top+e.height/2-i.top,o.height>2*s&&(r=d.clamp(r,s,o.height-s)),h.style.top="".concat(r-4,"px"),"left"===n?h.style.right="".concat(-4,"px"):h.style.left="".concat(-4,"px")),d.setAttr(h,{"data-placement":t})):h.style.display="none")},s.prototype.updatePosition=function(){var t,e,i,o,n=this.node;n&&(t=this.getAnchorRect())&&(e=this.getNodeSize(),i=this.resolvePlacement(t,e),o=this.computeCoords(i,t,e),n.style.left="".concat(Math.round(o.left),"px"),n.style.top="".concat(Math.round(o.top),"px"),d.setAttr(n,{"data-placement":i,"data-popper-placement":i}),this.updateArrow(i,t,o,e))},s.prototype.addTriggerListener=function(t,e,i){d.on(t,e,i),this.triggerListeners.push({el:t,type:e,handler:i})},s.prototype.bindTriggerEvents=function(){var t,e,i,o,n,s=this;this.unbindTriggerEvents(),this.options.virtualTriggering||(t=this.resolveElement(this.options.target))&&(e=-1<(n=this.triggerList).indexOf("hover"),i=-1<n.indexOf("click"),o=-1<n.indexOf("focus"),n=-1<n.indexOf("contextmenu"),e&&(this.addTriggerListener(t,"mouseenter",function(){return s.requestOpen()}),this.addTriggerListener(t,"mouseleave",function(t){return s.requestHide(t)}),this.addTriggerListener(t,"focus",function(){return s.requestOpen()}),this.addTriggerListener(t,"blur",function(t){return s.handleBlur(t)})),o&&!e&&(this.addTriggerListener(t,"focus",function(){return s.requestOpen()}),this.addTriggerListener(t,"blur",function(t){return s.handleBlur(t)})),i&&(this.addTriggerListener(t,"click",function(){s.isOpen?s.hide():s.requestOpen()}),this.addTriggerListener(t,"keydown",function(t){return s.handleTriggerKeydown(t)})),n)&&this.addTriggerListener(t,"contextmenu",function(t){t.preventDefault(),s.requestOpen(t)})},s.prototype.unbindTriggerEvents=function(){this.triggerListeners.forEach(function(t){var e=t.el;d.off(e,t.type,t.handler)}),this.triggerListeners=[]},s.prototype.bindPopperEvents=function(){var t,e,i=this;this.node&&!this.popperListeners.length&&(e=function(t){return i.requestHide(t)},d.on(this.node,"mouseenter",t=function(){return i.clearHideTimer()}),d.on(this.node,"mouseleave",e),this.popperListeners=[{type:"mouseenter",handler:t},{type:"mouseleave",handler:e}])},s.prototype.unbindPopperEvents=function(){var i=this;this.node&&this.popperListeners.forEach(function(t){var e=t.type;d.off(i.node,e,t.handler)}),this.popperListeners=[]},s.prototype.handleBlur=function(t){var e=t.relatedTarget;e&&this.node&&this.node.contains(e)&&this.options.enterable||this.requestHide(t)},s.prototype.handleTriggerKeydown=function(t){var e=this.options.triggerKeys;!(-1<e.indexOf(t.key)||-1<e.indexOf(t.code))||this.isOpen||this.options.disabled||(t.preventDefault(),this.requestOpen(t))},s.prototype.bindGlobalEvents=function(){this.globalBound||(d.on(window,"scroll",this.scheduleUpdate,{capture:!0}),d.on(window,"resize",this.scheduleUpdate),d.on(document,"keydown",this.handleDocumentKeydown),-1<this.triggerList.indexOf("click")&&d.on(document,"click",this.handleDocumentClick,{capture:!0}),this.globalBound=!0)},s.prototype.unbindGlobalEvents=function(){this.globalBound&&(d.off(window,"scroll",this.scheduleUpdate,{capture:!0}),d.off(window,"resize",this.scheduleUpdate),d.off(document,"keydown",this.handleDocumentKeydown),-1<this.triggerList.indexOf("click")&&d.off(document,"click",this.handleDocumentClick,{capture:!0}),this.globalBound=!1,null!==this.positionFrame)&&("function"==typeof cancelAnimationFrame&&cancelAnimationFrame(this.positionFrame),this.positionFrame=null)},s.prototype.setAriaDescribedBy=function(t){var e=this.getAnchorElement();e&&this.node&&(t?(this.prevAriaDescribedBy=d.getAttr(e,"aria-describedby"),d.setAttr(e,{"aria-describedby":this.node.id})):d.getAttr(e,"aria-describedby")===this.node.id&&(this.prevAriaDescribedBy?d.setAttr(e,{"aria-describedby":this.prevAriaDescribedBy}):e.removeAttribute("aria-describedby")))},s.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var o=this.listeners[t],o=(o&&o.forEach(function(t){return t.apply(void 0,e)}),"on".concat(t.charAt(0).toUpperCase()).concat(t.slice(1))),t=this.options[o];d.isFunction(t)&&t.apply(void 0,e)},s.prototype.clearShowTimer=function(){this.showTimer&&(clearTimeout(this.showTimer),this.showTimer=null)},s.prototype.clearHideTimer=function(){this.hideTimer&&(clearTimeout(this.hideTimer),this.hideTimer=null)},s.prototype.clearAutoCloseTimer=function(){this.autoCloseTimer&&(clearTimeout(this.autoCloseTimer),this.autoCloseTimer=null)},s.prototype.requestOpen=function(t){var e,i=this;this.options.disabled||(this.clearHideTimer(),this.isOpen)||(this.controlled?this.emit("visibleChange",!0):0<(e=this.options.showAfter)?(this.clearShowTimer(),this.showTimer=setTimeout(function(){return i.doOpen(t)},e)):this.doOpen(t))},s.prototype.requestHide=function(t){var e,i=this;this.clearShowTimer(),this.isOpen&&(this.controlled?this.emit("visibleChange",!1):0<(e=this.options.hideAfter)?(this.clearHideTimer(),this.hideTimer=setTimeout(function(){return i.doHide(t)},e)):this.doHide(t))},s.prototype.doOpen=function(t){var e,i=this;!this.options.disabled&&this.hasContent()&&(this.triggerListeners.length||this.options.virtualTriggering||this.bindTriggerEvents(),this.isOpen?(this.applyContent(),this.updatePosition()):(this.clearTimers(),this.emit("beforeShow",t),e=this.ensureNode(),this.applyContent(),d.addClass(e,"".concat(this.prefix,"tooltip--visible")),this.isOpen=!0,this.updatePosition(),this.bindGlobalEvents(),this.setAriaDescribedBy(!0),this.emit("show",t),this.emit("visibleChange",!0),0<this.options.autoClose&&(this.autoCloseTimer=setTimeout(function(){i.doHide()},this.options.autoClose))))},s.prototype.doHide=function(t){this.isOpen&&(this.emit("beforeHide",t),this.isOpen=!1,this.node&&d.removeClass(this.node,"".concat(this.prefix,"tooltip--visible")),this.setAriaDescribedBy(!1),this.unbindGlobalEvents(),this.clearTimers(),this.emit("hide",t),this.emit("visibleChange",!1),this.options.persistent||this.destroyNode(),this.options.focusOnTarget)&&null!=(t=this.getAnchorElement())&&t.focus()},s.prototype.clearTimers=function(){this.clearShowTimer(),this.clearHideTimer(),this.clearAutoCloseTimer()},s.prototype.show=function(t,e){e&&(this.imperativeAnchor=e),void 0!==t&&(this.currentContent=t),this.hasContent()?this.options.disabled||(this.controlled?this.emit("visibleChange",!0):this.doOpen()):this.hide()},s.prototype.hide=function(t){this.controlled?this.emit("visibleChange",!1):this.doHide(t)},s.prototype.onOpen=function(){this.requestOpen()},s.prototype.onClose=function(){this.hide()},s.prototype.isVisible=function(){return this.isOpen},s.prototype.getElement=function(){return this.node},s.prototype.getContentElement=function(){return this.contentNode},s.prototype.getTrigger=function(){return this.resolveElement(this.options.target)},s.prototype.isFocusInsideContent=function(){return Boolean(this.node&&this.node.contains(document.activeElement))},s.prototype.updatePopper=function(){this.updatePosition()},s.prototype.setContent=function(t){this.currentContent=t,this.isOpen&&(this.applyContent(),this.updatePosition())},s.prototype.setOptions=function(t){var e=this.options.target,i=this.options.trigger.join(","),o=this.options.appendTo,n=this.options.container,s=this.options.virtualTriggering;this.options=d.extend(this.options,t),void 0!==t.trigger&&(this.options.trigger=r(t.trigger)),t.triggerKeys&&(this.options.triggerKeys=t.triggerKeys),t.popperOptions&&(this.options.popperOptions=t.popperOptions),void 0!==t.content&&(this.currentContent=t.content),Object.prototype.hasOwnProperty.call(t,"visible")&&(this.controlled=d.isBoolean(t.visible)),void 0===t.target&&void 0===t.trigger&&void 0===t.virtualTriggering&&e===this.options.target&&i===this.options.trigger.join(",")&&s===this.options.virtualTriggering||this.bindTriggerEvents(),!this.node||void 0===t.appendTo&&void 0===t.container&&void 0===t.teleported&&o===this.options.appendTo&&n===this.options.container||this.attachNode(),this.node&&(e=this.prefix,this.node.style.position=this.strategy,d.removeClass(this.node,"".concat(e,"tooltip--dark")),d.removeClass(this.node,"".concat(e,"tooltip--light")),d.addClass(this.node,"".concat(e,"tooltip--").concat(this.options.effect)),this.options.enterable?d.addClass(this.node,"".concat(e,"tooltip--enterable")):d.removeClass(this.node,"".concat(e,"tooltip--enterable")),this.arrowNode&&(this.arrowNode.style.display=this.options.showArrow?"":"none"),this.options.ariaLabel&&d.setAttr(this.node,{"aria-label":this.options.ariaLabel}),this.options.popperClass&&d.addClass(this.node,this.options.popperClass),this.options.popperStyle&&this.applyPopperStyle(this.node),this.isOpen)&&(this.applyContent(),this.updatePosition()),this.options.disabled?this.doHide():this.controlled&&(this.options.visible?this.doOpen():this.doHide())},s.prototype.on=function(t,e){return this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e),this},s.prototype.off=function(t,e){var i=this.listeners[t];return i&&(this.listeners[t]=e?i.filter(function(t){return t!==e}):[]),this},s.prototype.destroy=function(){this.clearTimers(),this.unbindTriggerEvents(),this.unbindGlobalEvents(),this.unbindPopperEvents(),this.setAriaDescribedBy(!1),this.destroyNode(),this.currentContent=void 0,this.imperativeAnchor=null,this.isOpen=!1,this.listeners={},this.controlled=!1};var n=s;function s(t){void 0===t&&(t={});var i=this;this.node=null,this.contentNode=null,this.arrowNode=null,this.isOpen=!1,this.controlled=!1,this.currentContent=void 0,this.imperativeAnchor=null,this.prevAriaDescribedBy=null,this.showTimer=null,this.hideTimer=null,this.autoCloseTimer=null,this.positionFrame=null,this.globalBound=!1,this.triggerListeners=[],this.popperListeners=[],this.listeners={},this.scheduleUpdate=function(){var t;null===i.positionFrame&&(t="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){return setTimeout(function(){return t(Date.now())},16)},i.positionFrame=t(function(){i.positionFrame=null,i.updatePosition()}))},this.handleDocumentKeydown=function(t){"Escape"===t.key&&i.isOpen&&i.doHide(t)},this.handleDocumentClick=function(t){var e,t=t.target;!t||i.node&&i.node.contains(t)||(e=i.getAnchorElement())&&e.contains(t)||i.hide()},this.options=d.extend({prefix:d.DEFAULT_PREFIX,rawContent:!1,effect:"dark",placement:"bottom",fallbackPlacements:[],disabled:!1,offset:12,arrowOffset:5,showArrow:!0,showAfter:0,hideAfter:200,autoClose:0,popperClass:"",popperStyle:"",teleported:!0,enterable:!0,triggerKeys:["Enter","Space"],persistent:!0,transition:"",ariaLabel:"",focusOnTarget:!1,popperOptions:{},className:""},t),this.options.trigger=r(t.trigger),this.options.popperOptions=t.popperOptions||{},this.options.triggerKeys=t.triggerKeys||["Enter","Space"],this.controlled=Object.prototype.hasOwnProperty.call(t,"visible")&&d.isBoolean(t.visible),this.currentContent=t.content,this.bindTriggerEvents(),this.controlled&&this.options.visible&&this.doOpen()}Object.defineProperty(t,"isTextTruncated",{enumerable:!0,get:function(){return d.isTextTruncated}}),t.Tooltip=n,t.default=n,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
1
|
+
((t,e)=>{"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@ew-color-picker/utils")):"function"==typeof define&&define.amd?define(["exports","@ew-color-picker/utils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Tooltip={},t.Utils)})(this,function(t,d){var e=function(){return(e=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},i=["hover","click","focus","contextmenu"],h={top:"bottom",bottom:"top",left:"right",right:"left"},o=0;function n(t){return-1<i.indexOf(t)}function r(t){var e;return d.isArray(t)?(e=t.filter(n)).length?e:["hover"]:n(t)?[t]:["hover"]}Object.defineProperty(p.prototype,"prefix",{get:function(){return this.options.prefix},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"strategy",{get:function(){return"absolute"===this.options.popperOptions.strategy?"absolute":"fixed"},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"triggerList",{get:function(){return this.options.trigger},enumerable:!1,configurable:!0}),p.prototype.hasContent=function(t){return void 0===t&&(t=this.currentContent),!d.isNull(t)&&!d.isUndefined(t)&&(!d.isString(t)||0<t.trim().length)},p.prototype.resolveElement=function(t){return t?d.isString(t)?d.$(t):t:null},p.prototype.getAnchorElement=function(){var t;return this.options.virtualTriggering?(t=this.options.virtualRef,d.isHTMLElement(t)?t:null):this.imperativeAnchor||this.resolveElement(this.options.target)},p.prototype.getAnchorRect=function(){var t;return this.options.virtualTriggering?(t=this.options.virtualRef)&&d.isFunction(t.getBoundingClientRect)?t.getBoundingClientRect():null:(t=this.getAnchorElement())?d.getRect(t):null},p.prototype.getParent=function(){var t;return!1===this.options.teleported?(null==(t=this.getAnchorElement())?void 0:t.parentElement)||document.body:(t=null!=(t=this.options.appendTo)?t:this.options.container,d.isString(t)?d.$(t)||document.body:t||document.body)},p.prototype.applyCustomClasses=function(t){var e=[this.options.popperClass,this.options.className].filter(Boolean).join(" ");e&&d.addClass(t,e),this.options.transition&&d.addClass(t,this.options.transition)},p.prototype.applyPopperStyle=function(t){var e=this.options.popperStyle;e&&(t.style.cssText+=d.isString(e)?e:d.toStyleStr(e))},p.prototype.ensureNode=function(){var t,e;return this.node?(this.attachNode(),this.node):(t=this.prefix,(e=d.create("div")).id="".concat(t,"tooltip-").concat(++o),d.addClass(e,"".concat(t,"tooltip")),d.addClass(e,"".concat(t,"tooltip--").concat(this.options.effect)),this.options.enterable&&d.addClass(e,"".concat(t,"tooltip--enterable")),d.setAttr(e,{role:"tooltip"}),this.options.ariaLabel&&d.setAttr(e,{"aria-label":this.options.ariaLabel}),this.applyCustomClasses(e),e.style.position=this.strategy,this.contentNode=d.create("div"),d.addClass(this.contentNode,"".concat(t,"tooltip__content")),d.insertNode(e,this.contentNode),this.arrowNode=d.create("div"),d.addClass(this.arrowNode,"".concat(t,"tooltip__arrow")),this.options.showArrow||(this.arrowNode.style.display="none"),d.insertNode(e,this.arrowNode),this.applyPopperStyle(e),this.node=e,this.attachNode(),this.bindPopperEvents(),e)},p.prototype.attachNode=function(){var t;this.node&&(t=this.getParent())&&this.node.parentNode!==t&&t.appendChild(this.node)},p.prototype.applyContent=function(){var t,e=this.contentNode;e&&(t=this.currentContent,e.textContent="",d.isNull(t)||d.isUndefined(t)||(d.isString(t)?this.options.html||this.options.rawContent?e.innerHTML=t:e.textContent=t:d.isHTMLElement(t)?e.appendChild(t):e.textContent=String(t)))},p.prototype.destroyNode=function(){this.unbindPopperEvents(),this.node&&(d.removeElement(this.node),this.node=null),this.contentNode=null,this.arrowNode=null},p.prototype.getNodeSize=function(){var t;return this.node?{width:(t=d.getElementSize(this.node)).offsetWidth||0,height:t.offsetHeight||0}:{width:0,height:0}},p.prototype.computeCoords=function(t,e,i){function o(){return"start"===r?e.left:"end"===r?e.right-i.width:e.left+(e.width-i.width)/2}function n(){return"start"===r?e.top:"end"===r?e.bottom-i.height:e.top+(e.height-i.height)/2}var t=d.parsePlacement(t),s=t.side,r=t.align,p=this.options.offset,h=0,a=0;switch(s){case"top":a=e.top-p-i.height,h=o();break;case"bottom":a=e.bottom+p,h=o();break;case"left":h=e.left-p-i.width,a=n();break;case"right":h=e.right+p,a=n()}var t=window.innerWidth,l=window.innerHeight;return"top"===s||"bottom"===s?h=d.clamp(h,5,Math.max(5,t-i.width-5)):a=d.clamp(a,5,Math.max(5,l-i.height-5)),"absolute"===this.strategy&&(h+=window.scrollX||window.pageXOffset||0,a+=window.scrollY||window.pageYOffset||0),{left:h,top:a}},p.prototype.fitsViewport=function(t,e,i){var t=d.parsePlacement(t).side,o=this.options.offset,n=window.innerWidth,s=window.innerHeight;switch(t){case"top":return 5<=e.top-o-i.height;case"bottom":return e.bottom+o+i.height<=s-5;case"left":return 5<=e.left-o-i.width;case"right":return e.right+o+i.width<=n-5}},p.prototype.resolvePlacement=function(t,e){var i=this.options.placement;if(!this.fitsViewport(i,t,e))for(var o=d.parsePlacement(i),n=o.side,o=o.align,n=h[n],n="center"===o?n:"".concat(n,"-").concat(o),s=0,r=this.options.fallbackPlacements.length?this.options.fallbackPlacements:[n];s<r.length;s++){var p=r[s];if(d.isPlacement(p)&&this.fitsViewport(p,t,e))return p}return i},p.prototype.updateArrow=function(t,e,i,o){var n,s,r,p=this.arrowNode;p&&(this.options.showArrow?(p.style.display="",p.style.left="",p.style.right="",p.style.top="",p.style.bottom="",n=d.parsePlacement(t).side,s=this.options.arrowOffset,"top"===n||"bottom"===n?(r=e.left+e.width/2-i.left,o.width>2*s&&(r=d.clamp(r,s,o.width-s)),p.style.left="".concat(r-4,"px"),"top"===n?p.style.bottom="".concat(-4,"px"):p.style.top="".concat(-4,"px")):(r=e.top+e.height/2-i.top,o.height>2*s&&(r=d.clamp(r,s,o.height-s)),p.style.top="".concat(r-4,"px"),"left"===n?p.style.right="".concat(-4,"px"):p.style.left="".concat(-4,"px")),d.setAttr(p,{"data-placement":t})):p.style.display="none")},p.prototype.updatePosition=function(){var t,e,i,o,n=this.node;n&&(t=this.getAnchorRect())&&(e=this.getNodeSize(),i=this.resolvePlacement(t,e),o=this.computeCoords(i,t,e),n.style.left="".concat(Math.round(o.left),"px"),n.style.top="".concat(Math.round(o.top),"px"),d.setAttr(n,{"data-placement":i,"data-popper-placement":i}),this.updateArrow(i,t,o,e))},p.prototype.addTriggerListener=function(t,e,i){d.on(t,e,i),this.triggerListeners.push({el:t,type:e,handler:i})},p.prototype.applyTargetAttrs=function(){var e=this,t=this.resolveElement(this.options.target);t&&(this.targetAttrEl&&this.targetAttrEl!==t&&(Object.keys(this.appliedTargetAttrs).forEach(function(t){e.targetAttrEl.removeAttribute(t)}),this.appliedTargetAttrs={}),this.targetAttrEl=t,this.appliedTargetAttrs=d.applyExtraAttrs(t,this.options.attrs||{},this.appliedTargetAttrs))},p.prototype.setAttrs=function(t){this.options.attrs=e({},t=void 0===t?{}:t),this.applyTargetAttrs()},p.prototype.bindTriggerEvents=function(){var t,e,i,o,n,s=this;this.unbindTriggerEvents(),this.options.virtualTriggering||(t=this.resolveElement(this.options.target))&&(this.applyTargetAttrs(),e=-1<(n=this.triggerList).indexOf("hover"),i=-1<n.indexOf("click"),o=-1<n.indexOf("focus"),n=-1<n.indexOf("contextmenu"),e&&(this.addTriggerListener(t,"mouseenter",function(){return s.requestOpen()}),this.addTriggerListener(t,"mouseleave",function(t){return s.requestHide(t)}),this.addTriggerListener(t,"focus",function(){return s.requestOpen()}),this.addTriggerListener(t,"blur",function(t){return s.handleBlur(t)})),o&&!e&&(this.addTriggerListener(t,"focus",function(){return s.requestOpen()}),this.addTriggerListener(t,"blur",function(t){return s.handleBlur(t)})),i&&(this.addTriggerListener(t,"click",function(){s.isOpen?s.hide():s.requestOpen()}),this.addTriggerListener(t,"keydown",function(t){return s.handleTriggerKeydown(t)})),n)&&this.addTriggerListener(t,"contextmenu",function(t){t.preventDefault(),s.requestOpen(t)})},p.prototype.unbindTriggerEvents=function(){this.triggerListeners.forEach(function(t){var e=t.el;d.off(e,t.type,t.handler)}),this.triggerListeners=[]},p.prototype.bindPopperEvents=function(){var t,e,i=this;this.node&&!this.popperListeners.length&&(e=function(t){return i.requestHide(t)},d.on(this.node,"mouseenter",t=function(){return i.clearHideTimer()}),d.on(this.node,"mouseleave",e),this.popperListeners=[{type:"mouseenter",handler:t},{type:"mouseleave",handler:e}])},p.prototype.unbindPopperEvents=function(){var i=this;this.node&&this.popperListeners.forEach(function(t){var e=t.type;d.off(i.node,e,t.handler)}),this.popperListeners=[]},p.prototype.handleBlur=function(t){var e=t.relatedTarget;e&&this.node&&this.node.contains(e)&&this.options.enterable||this.requestHide(t)},p.prototype.handleTriggerKeydown=function(t){var e=this.options.triggerKeys;!(-1<e.indexOf(t.key)||-1<e.indexOf(t.code))||this.isOpen||this.options.disabled||(t.preventDefault(),this.requestOpen(t))},p.prototype.bindGlobalEvents=function(){this.globalBound||(d.on(window,"scroll",this.scheduleUpdate,{capture:!0}),d.on(window,"resize",this.scheduleUpdate),d.on(document,"keydown",this.handleDocumentKeydown),-1<this.triggerList.indexOf("click")&&d.on(document,"click",this.handleDocumentClick,{capture:!0}),this.globalBound=!0)},p.prototype.unbindGlobalEvents=function(){this.globalBound&&(d.off(window,"scroll",this.scheduleUpdate,{capture:!0}),d.off(window,"resize",this.scheduleUpdate),d.off(document,"keydown",this.handleDocumentKeydown),-1<this.triggerList.indexOf("click")&&d.off(document,"click",this.handleDocumentClick,{capture:!0}),this.globalBound=!1,null!==this.positionFrame)&&("function"==typeof cancelAnimationFrame&&cancelAnimationFrame(this.positionFrame),this.positionFrame=null)},p.prototype.setAriaDescribedBy=function(t){var e=this.getAnchorElement();e&&this.node&&(t?(this.prevAriaDescribedBy=d.getAttr(e,"aria-describedby"),d.setAttr(e,{"aria-describedby":this.node.id})):d.getAttr(e,"aria-describedby")===this.node.id&&(this.prevAriaDescribedBy?d.setAttr(e,{"aria-describedby":this.prevAriaDescribedBy}):e.removeAttribute("aria-describedby")))},p.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var o=this.listeners[t],o=(o&&o.forEach(function(t){return t.apply(void 0,e)}),"on".concat(t.charAt(0).toUpperCase()).concat(t.slice(1))),t=this.options[o];d.isFunction(t)&&t.apply(void 0,e)},p.prototype.clearShowTimer=function(){this.showTimer&&(clearTimeout(this.showTimer),this.showTimer=null)},p.prototype.clearHideTimer=function(){this.hideTimer&&(clearTimeout(this.hideTimer),this.hideTimer=null)},p.prototype.clearAutoCloseTimer=function(){this.autoCloseTimer&&(clearTimeout(this.autoCloseTimer),this.autoCloseTimer=null)},p.prototype.requestOpen=function(t){var e,i=this;this.options.disabled||(this.clearHideTimer(),this.isOpen)||(this.controlled?this.emit("visibleChange",!0):0<(e=this.options.showAfter)?(this.clearShowTimer(),this.showTimer=setTimeout(function(){return i.doOpen(t)},e)):this.doOpen(t))},p.prototype.requestHide=function(t){var e,i=this;this.clearShowTimer(),this.isOpen&&(this.controlled?this.emit("visibleChange",!1):0<(e=this.options.hideAfter)?(this.clearHideTimer(),this.hideTimer=setTimeout(function(){return i.doHide(t)},e)):this.doHide(t))},p.prototype.doOpen=function(t){var e,i=this;!this.options.disabled&&this.hasContent()&&(this.triggerListeners.length||this.options.virtualTriggering||this.bindTriggerEvents(),this.isOpen?(this.applyContent(),this.updatePosition()):(this.clearTimers(),this.emit("beforeShow",t),e=this.ensureNode(),this.applyContent(),d.addClass(e,"".concat(this.prefix,"tooltip--visible")),this.isOpen=!0,this.updatePosition(),this.bindGlobalEvents(),this.setAriaDescribedBy(!0),this.emit("show",t),this.emit("visibleChange",!0),0<this.options.autoClose&&(this.autoCloseTimer=setTimeout(function(){i.doHide()},this.options.autoClose))))},p.prototype.doHide=function(t){this.isOpen&&(this.emit("beforeHide",t),this.isOpen=!1,this.node&&d.removeClass(this.node,"".concat(this.prefix,"tooltip--visible")),this.setAriaDescribedBy(!1),this.unbindGlobalEvents(),this.clearTimers(),this.emit("hide",t),this.emit("visibleChange",!1),this.options.persistent||this.destroyNode(),this.options.focusOnTarget)&&null!=(t=this.getAnchorElement())&&t.focus()},p.prototype.clearTimers=function(){this.clearShowTimer(),this.clearHideTimer(),this.clearAutoCloseTimer()},p.prototype.show=function(t,e){e&&(this.imperativeAnchor=e),void 0!==t&&(this.currentContent=t),this.hasContent()?this.options.disabled||(this.controlled?this.emit("visibleChange",!0):this.doOpen()):this.hide()},p.prototype.hide=function(t){this.controlled?this.emit("visibleChange",!1):this.doHide(t)},p.prototype.onOpen=function(){this.requestOpen()},p.prototype.onClose=function(){this.hide()},p.prototype.isVisible=function(){return this.isOpen},p.prototype.getElement=function(){return this.node},p.prototype.getContentElement=function(){return this.contentNode},p.prototype.getTrigger=function(){return this.resolveElement(this.options.target)},p.prototype.isFocusInsideContent=function(){return Boolean(this.node&&this.node.contains(document.activeElement))},p.prototype.updatePopper=function(){this.updatePosition()},p.prototype.setContent=function(t){this.currentContent=t,this.isOpen&&(this.applyContent(),this.updatePosition())},p.prototype.setOptions=function(t){var e=this.options.target,i=this.options.trigger.join(","),o=this.options.appendTo,n=this.options.container,s=this.options.virtualTriggering;this.options=d.extend(this.options,t),void 0!==t.trigger&&(this.options.trigger=r(t.trigger)),t.triggerKeys&&(this.options.triggerKeys=t.triggerKeys),t.popperOptions&&(this.options.popperOptions=t.popperOptions),void 0!==t.content&&(this.currentContent=t.content),Object.prototype.hasOwnProperty.call(t,"visible")&&(this.controlled=d.isBoolean(t.visible)),void 0!==t.attrs&&this.applyTargetAttrs(),void 0===t.target&&void 0===t.trigger&&void 0===t.virtualTriggering&&e===this.options.target&&i===this.options.trigger.join(",")&&s===this.options.virtualTriggering||this.bindTriggerEvents(),!this.node||void 0===t.appendTo&&void 0===t.container&&void 0===t.teleported&&o===this.options.appendTo&&n===this.options.container||this.attachNode(),this.node&&(e=this.prefix,this.node.style.position=this.strategy,d.removeClass(this.node,"".concat(e,"tooltip--dark")),d.removeClass(this.node,"".concat(e,"tooltip--light")),d.addClass(this.node,"".concat(e,"tooltip--").concat(this.options.effect)),this.options.enterable?d.addClass(this.node,"".concat(e,"tooltip--enterable")):d.removeClass(this.node,"".concat(e,"tooltip--enterable")),this.arrowNode&&(this.arrowNode.style.display=this.options.showArrow?"":"none"),this.options.ariaLabel&&d.setAttr(this.node,{"aria-label":this.options.ariaLabel}),this.options.popperClass&&d.addClass(this.node,this.options.popperClass),this.options.popperStyle&&this.applyPopperStyle(this.node),this.isOpen)&&(this.applyContent(),this.updatePosition()),this.options.disabled?this.doHide():this.controlled&&(this.options.visible?this.doOpen():this.doHide())},p.prototype.on=function(t,e){return this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e),this},p.prototype.off=function(t,e){var i=this.listeners[t];return i&&(this.listeners[t]=e?i.filter(function(t){return t!==e}):[]),this},p.prototype.destroy=function(){this.clearTimers(),this.unbindTriggerEvents(),this.unbindGlobalEvents(),this.unbindPopperEvents(),this.setAriaDescribedBy(!1),this.destroyNode(),this.currentContent=void 0,this.imperativeAnchor=null,this.isOpen=!1,this.listeners={},this.controlled=!1};var s=p;function p(t){void 0===t&&(t={});var i=this;this.node=null,this.contentNode=null,this.arrowNode=null,this.isOpen=!1,this.controlled=!1,this.currentContent=void 0,this.imperativeAnchor=null,this.prevAriaDescribedBy=null,this.showTimer=null,this.hideTimer=null,this.autoCloseTimer=null,this.positionFrame=null,this.globalBound=!1,this.triggerListeners=[],this.targetAttrEl=null,this.appliedTargetAttrs={},this.popperListeners=[],this.listeners={},this.scheduleUpdate=function(){var t;null===i.positionFrame&&(t="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){return setTimeout(function(){return t(Date.now())},16)},i.positionFrame=t(function(){i.positionFrame=null,i.updatePosition()}))},this.handleDocumentKeydown=function(t){"Escape"===t.key&&i.isOpen&&i.doHide(t)},this.handleDocumentClick=function(t){var e,t=t.target;!t||i.node&&i.node.contains(t)||(e=i.getAnchorElement())&&e.contains(t)||i.hide()},this.options=d.extend({prefix:d.DEFAULT_PREFIX,rawContent:!1,effect:"dark",placement:"bottom",fallbackPlacements:[],disabled:!1,offset:12,arrowOffset:5,showArrow:!0,showAfter:0,hideAfter:200,autoClose:0,popperClass:"",popperStyle:"",teleported:!0,enterable:!0,triggerKeys:["Enter","Space"],persistent:!0,transition:"",ariaLabel:"",focusOnTarget:!1,popperOptions:{},className:""},t),this.options.trigger=r(t.trigger),this.options.popperOptions=t.popperOptions||{},this.options.triggerKeys=t.triggerKeys||["Enter","Space"],this.controlled=Object.prototype.hasOwnProperty.call(t,"visible")&&d.isBoolean(t.visible),this.currentContent=t.content,this.bindTriggerEvents(),this.controlled&&this.options.visible&&this.doOpen()}Object.defineProperty(t,"isTextTruncated",{enumerable:!0,get:function(){return d.isTextTruncated}}),t.Tooltip=s,t.default=s,Object.defineProperty(t,"__esModule",{value:!0})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ew-color-picker/tooltip",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.16",
|
|
4
4
|
"description": "Standalone tooltip utility used by ew-color-picker plugins",
|
|
5
5
|
"main": "dist/tooltip.min.js",
|
|
6
6
|
"module": "dist/tooltip.esm.js",
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
"author": "eveningwater(854806732@qq.com)",
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@ew-color-picker/utils": "^2.0.
|
|
21
|
+
"@ew-color-picker/utils": "^2.0.16"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"rollup": "^3.0.0",
|
|
25
25
|
"rollup-plugin-typescript2": "^0.34.0",
|
|
26
26
|
"typescript": "^4.9.0",
|
|
27
27
|
"rimraf": "^3.0.2",
|
|
28
|
-
"@ew-color-picker/utils": "2.0.
|
|
28
|
+
"@ew-color-picker/utils": "2.0.16"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|