diff options
author | Johann-S <johann.servoire@gmail.com> | 2017-05-16 10:59:44 +0300 |
---|---|---|
committer | Johann-S <johann.servoire@gmail.com> | 2017-05-16 11:09:48 +0300 |
commit | 3719ed4cb69fd8c75869158b086b4fc077e63e14 (patch) | |
tree | 20c4aa1021aacd824b752d5ab85377ac782b4d90 /js/dist | |
parent | 183205afb87582bf905e1fac0b6c5353c0b2d28c (diff) |
build
Diffstat (limited to 'js/dist')
-rw-r--r-- | js/dist/button.js | 3 | ||||
-rw-r--r-- | js/dist/button.js.map | 2 | ||||
-rw-r--r-- | js/dist/collapse.js | 16 | ||||
-rw-r--r-- | js/dist/collapse.js.map | 2 | ||||
-rw-r--r-- | js/dist/dropdown.js | 141 | ||||
-rw-r--r-- | js/dist/dropdown.js.map | 2 | ||||
-rw-r--r-- | js/dist/popover.js | 18 | ||||
-rw-r--r-- | js/dist/popover.js.map | 2 | ||||
-rw-r--r-- | js/dist/tab.js | 2 | ||||
-rw-r--r-- | js/dist/tab.js.map | 2 | ||||
-rw-r--r-- | js/dist/tooltip.js | 167 | ||||
-rw-r--r-- | js/dist/tooltip.js.map | 2 |
12 files changed, 246 insertions, 113 deletions
diff --git a/js/dist/button.js b/js/dist/button.js index 367e50495d..cd82242c12 100644 --- a/js/dist/button.js +++ b/js/dist/button.js @@ -82,6 +82,9 @@ var Button = function ($) { } if (triggerChangeEvent) { + if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) { + return; + } input.checked = !$(this._element).hasClass(ClassName.ACTIVE); $(input).trigger('change'); } diff --git a/js/dist/button.js.map b/js/dist/button.js.map index ae41dc5038..899bcdaeaa 100644 --- a/js/dist/button.js.map +++ b/js/dist/button.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/button.js"],"names":["Button","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","ClassName","ACTIVE","BUTTON","FOCUS","Selector","DATA_TOGGLE_CARROT","DATA_TOGGLE","INPUT","Event","CLICK_DATA_API","FOCUS_BLUR_DATA_API","element","_element","toggle","triggerChangeEvent","addAriaPressed","rootElement","closest","input","find","type","checked","hasClass","activeElement","removeClass","trigger","focus","setAttribute","toggleClass","dispose","removeData","_jQueryInterface","config","each","data","document","on","event","preventDefault","button","target","call","test","Constructor","noConflict","jQuery"],"mappings":";;;;AAAA;;;;;;;AAOA,IAAMA,SAAU,UAACC,CAAD,EAAO;;AAGrB;;;;;;AAMA,MAAMC,OAAsB,QAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,WAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,eAAsB,WAA5B;AACA,MAAMC,qBAAsBN,EAAEO,EAAF,CAAKN,IAAL,CAA5B;;AAEA,MAAMO,YAAY;AAChBC,YAAS,QADO;AAEhBC,YAAS,KAFO;AAGhBC,WAAS;AAHO,GAAlB;;AAMA,MAAMC,WAAW;AACfC,wBAAqB,yBADN;AAEfC,iBAAqB,yBAFN;AAGfC,WAAqB,OAHN;AAIfN,YAAqB,SAJN;AAKfC,YAAqB;AALN,GAAjB;;AAQA,MAAMM,QAAQ;AACZC,8BAA8Bb,SAA9B,GAA0CC,YAD9B;AAEZa,yBAAsB,UAAQd,SAAR,GAAoBC,YAApB,mBACOD,SADP,GACmBC,YADnB;AAFV,GAAd;;AAOA;;;;;;AArCqB,MA2CfN,MA3Ce;AA6CnB,oBAAYoB,OAAZ,EAAqB;AAAA;;AACnB,WAAKC,QAAL,GAAgBD,OAAhB;AACD;;AAGD;;AAOA;;AAzDmB,qBA2DnBE,MA3DmB,qBA2DV;AACP,UAAIC,qBAAqB,IAAzB;AACA,UAAIC,iBAAiB,IAArB;AACA,UAAMC,cAAmBxB,EAAE,KAAKoB,QAAP,EAAiBK,OAAjB,CACvBb,SAASE,WADc,EAEvB,CAFuB,CAAzB;;AAIA,UAAIU,WAAJ,EAAiB;AACf,YAAME,QAAQ1B,EA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,EAAF,CAAKN,IAAL,EAAWkD,WAAX,GAAyBpD,MAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWmD,UAAX,GAAyB,YAAY;AACnCpD,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,OAAOwC,gBAAd;AACD,GAHD;;AAKA,SAAOxC,MAAP;AAED,CA1Kc,CA0KZsD,MA1KY,CAAf","file":"button.js","sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Button = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'button'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.button'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const ClassName = {\n ACTIVE : 'active',\n BUTTON : 'btn',\n FOCUS : 'focus'\n }\n\n const Selector = {\n DATA_TOGGLE_CARROT : '[data-toggle^=\"button\"]',\n DATA_TOGGLE : '[data-toggle=\"buttons\"]',\n INPUT : 'input',\n ACTIVE : '.active',\n BUTTON : '.btn'\n }\n\n const Event = {\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`,\n FOCUS_BLUR_DATA_API : `focus${EVENT_KEY}${DATA_API_KEY} `\n + `blur${EVENT_KEY}${DATA_API_KEY}`\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Button {\n\n constructor(element) {\n this._element = element\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n\n // public\n\n toggle() {\n let triggerChangeEvent = true\n let addAriaPressed = true\n const rootElement = $(this._element).closest(\n Selector.DATA_TOGGLE\n )[0]\n\n if (rootElement) {\n const input = $(this._element).find(Selector.INPUT)[0]\n\n if (input) {\n if (input.type === 'radio') {\n if (input.checked &&\n $(this._element).hasClass(ClassName.ACTIVE)) {\n triggerChangeEvent = false\n\n } else {\n const activeElement = $(rootElement).find(Selector.ACTIVE)[0]\n\n if (activeElement) {\n $(activeElement).removeClass(ClassName.ACTIVE)\n }\n }\n }\n\n if (triggerChangeEvent) {\n input.checked = !$(this._element).hasClass(ClassName.ACTIVE)\n $(input).trigger('change')\n }\n\n input.focus()\n addAriaPressed = false\n }\n\n }\n\n if (addAriaPressed) {\n this._element.setAttribute('aria-pressed',\n !$(this._element).hasClass(ClassName.ACTIVE))\n }\n\n if (triggerChangeEvent) {\n $(this._element).toggleClass(ClassName.ACTIVE)\n }\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n\n if (!data) {\n data = new Button(this)\n $(this).data(DATA_KEY, data)\n }\n\n if (config === 'toggle') {\n data[config]()\n }\n })\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => {\n event.preventDefault()\n\n let button = event.target\n\n if (!$(button).hasClass(ClassName.BUTTON)) {\n button = $(button).closest(Selector.BUTTON)\n }\n\n Button._jQueryInterface.call($(button), 'toggle')\n })\n .on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => {\n const button = $(event.target).closest(Selector.BUTTON)[0]\n $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type))\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Button._jQueryInterface\n $.fn[NAME].Constructor = Button\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Button._jQueryInterface\n }\n\n return Button\n\n})(jQuery)\n\nexport default Button\n"]}
\ No newline at end of file +{"version":3,"sources":["../src/button.js"],"names":["Button","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","ClassName","ACTIVE","BUTTON","FOCUS","Selector","DATA_TOGGLE_CARROT","DATA_TOGGLE","INPUT","Event","CLICK_DATA_API","FOCUS_BLUR_DATA_API","element","_element","toggle","triggerChangeEvent","addAriaPressed","rootElement","closest","input","find","type","checked","hasClass","activeElement","removeClass","hasAttribute","classList","contains","trigger","focus","setAttribute","toggleClass","dispose","removeData","_jQueryInterface","config","each","data","document","on","event","preventDefault","button","target","call","test","Constructor","noConflict","jQuery"],"mappings":";;;;AAAA;;;;;;;AAOA,IAAMA,SAAU,UAACC,CAAD,EAAO;;AAGrB;;;;;;AAMA,MAAMC,OAAsB,QAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,WAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,eAAsB,WAA5B;AACA,MAAMC,qBAAsBN,EAAEO,EAAF,CAAKN,IAAL,CAA5B;;AAEA,MAAMO,YAAY;AAChBC,YAAS,QADO;AAEhBC,YAAS,KAFO;AAGhBC,WAAS;AAHO,GAAlB;;AAMA,MAAMC,WAAW;AACfC,wBAAqB,yBADN;AAEfC,iBAAqB,yBAFN;AAGfC,WAAqB,OAHN;AAIfN,YAAqB,SAJN;AAKfC,YAAqB;AALN,GAAjB;;AAQA,MAAMM,QAAQ;AACZC,8BAA8Bb,SAA9B,GAA0CC,YAD9B;AAEZa,yBAAsB,UAAQd,SAAR,GAAoBC,YAApB,mBACOD,SADP,GACmBC,YADnB;AAFV,GAAd;;AAOA;;;;;;AArCqB,MA2CfN,MA3Ce;AA6CnB,oBAAYoB,OAAZ,EAAqB;AAAA;;AACnB,WAAKC,QAAL,GAAgBD,OAAhB;AACD;;AAGD;;AAOA;;AAzDmB,qBA2DnBE,MA3DmB,qBA2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AAwC,QAAxC;AACD,GAXH,EAYGH,EAZH,CAYM/B,MAAME,mBAZZ,EAYiCN,SAASC,kBAZ1C,EAY8D,UAACmC,KAAD,EAAW;AACrE,QAAME,SAASlD,EAAEgD,MAAMG,MAAR,EAAgB1B,OAAhB,CAAwBb,SAASF,MAAjC,EAAyC,CAAzC,CAAf;AACAV,MAAEkD,MAAF,EAAUX,WAAV,CAAsB/B,UAAUG,KAAhC,EAAuC,eAAe0C,IAAf,CAAoBL,MAAMpB,IAA1B,CAAvC;AACD,GAfH;;AAkBA;;;;;;AAMA5B,IAAEO,EAAF,CAAKN,IAAL,IAAyBF,OAAO2C,gBAAhC;AACA1C,IAAEO,EAAF,CAAKN,IAAL,EAAWqD,WAAX,GAAyBvD,MAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWsD,UAAX,GAAyB,YAAY;AACnCvD,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,OAAO2C,gBAAd;AACD,GAHD;;AAKA,SAAO3C,MAAP;AAED,CAhLc,CAgLZyD,MAhLY,CAAf","file":"button.js","sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Button = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'button'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.button'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const ClassName = {\n ACTIVE : 'active',\n BUTTON : 'btn',\n FOCUS : 'focus'\n }\n\n const Selector = {\n DATA_TOGGLE_CARROT : '[data-toggle^=\"button\"]',\n DATA_TOGGLE : '[data-toggle=\"buttons\"]',\n INPUT : 'input',\n ACTIVE : '.active',\n BUTTON : '.btn'\n }\n\n const Event = {\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`,\n FOCUS_BLUR_DATA_API : `focus${EVENT_KEY}${DATA_API_KEY} `\n + `blur${EVENT_KEY}${DATA_API_KEY}`\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Button {\n\n constructor(element) {\n this._element = element\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n\n // public\n\n toggle() {\n let triggerChangeEvent = true\n let addAriaPressed = true\n const rootElement = $(this._element).closest(\n Selector.DATA_TOGGLE\n )[0]\n\n if (rootElement) {\n const input = $(this._element).find(Selector.INPUT)[0]\n\n if (input) {\n if (input.type === 'radio') {\n if (input.checked &&\n $(this._element).hasClass(ClassName.ACTIVE)) {\n triggerChangeEvent = false\n\n } else {\n const activeElement = $(rootElement).find(Selector.ACTIVE)[0]\n\n if (activeElement) {\n $(activeElement).removeClass(ClassName.ACTIVE)\n }\n }\n }\n\n if (triggerChangeEvent) {\n if (input.hasAttribute('disabled') ||\n rootElement.hasAttribute('disabled') ||\n input.classList.contains('disabled') ||\n rootElement.classList.contains('disabled')) {\n return\n }\n input.checked = !$(this._element).hasClass(ClassName.ACTIVE)\n $(input).trigger('change')\n }\n\n input.focus()\n addAriaPressed = false\n }\n\n }\n\n if (addAriaPressed) {\n this._element.setAttribute('aria-pressed',\n !$(this._element).hasClass(ClassName.ACTIVE))\n }\n\n if (triggerChangeEvent) {\n $(this._element).toggleClass(ClassName.ACTIVE)\n }\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n\n if (!data) {\n data = new Button(this)\n $(this).data(DATA_KEY, data)\n }\n\n if (config === 'toggle') {\n data[config]()\n }\n })\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => {\n event.preventDefault()\n\n let button = event.target\n\n if (!$(button).hasClass(ClassName.BUTTON)) {\n button = $(button).closest(Selector.BUTTON)\n }\n\n Button._jQueryInterface.call($(button), 'toggle')\n })\n .on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => {\n const button = $(event.target).closest(Selector.BUTTON)[0]\n $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type))\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Button._jQueryInterface\n $.fn[NAME].Constructor = Button\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Button._jQueryInterface\n }\n\n return Button\n\n})(jQuery)\n\nexport default Button\n"]}
\ No newline at end of file diff --git a/js/dist/collapse.js b/js/dist/collapse.js index d5105f4421..0e2bc75e21 100644 --- a/js/dist/collapse.js +++ b/js/dist/collapse.js @@ -58,9 +58,8 @@ var Collapse = function ($) { }; var Selector = { - ACTIVES: '.card > .show, .card > .collapsing', - DATA_TOGGLE: '[data-toggle="collapse"]', - DATA_CHILDREN: 'data-children' + ACTIVES: '.show, .collapsing', + DATA_TOGGLE: '[data-toggle="collapse"]' }; /** @@ -77,20 +76,13 @@ var Collapse = function ($) { this._element = element; this._config = this._getConfig(config); this._triggerArray = $.makeArray($('[data-toggle="collapse"][href="#' + element.id + '"],' + ('[data-toggle="collapse"][data-target="#' + element.id + '"]'))); + this._parent = this._config.parent ? this._getParent() : null; if (!this._config.parent) { this._addAriaAndCollapsedClass(this._element, this._triggerArray); } - this._selectorActives = Selector.ACTIVES; - if (this._parent) { - var childrenSelector = this._parent.hasAttribute(Selector.DATA_CHILDREN) ? this._parent.getAttribute(Selector.DATA_CHILDREN) : null; - if (childrenSelector !== null) { - this._selectorActives = childrenSelector + ' > .show, ' + childrenSelector + ' > .collapsing'; - } - } - if (this._config.toggle) { this.toggle(); } @@ -119,7 +111,7 @@ var Collapse = function ($) { var activesData = void 0; if (this._parent) { - actives = $.makeArray($(this._parent).find(this._selectorActives)); + actives = $.makeArray($(this._parent).children().children(Selector.ACTIVES)); if (!actives.length) { actives = null; } diff --git a/js/dist/collapse.js.map b/js/dist/collapse.js.map index db9d13f6eb..5fa9f74faf 100644 --- a/js/dist/collapse.js.map +++ b/js/dist/collapse.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/collapse.js"],"names":["Collapse","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","TRANSITION_DURATION","Default","toggle","parent","DefaultType","Event","SHOW","SHOWN","HIDE","HIDDEN","CLICK_DATA_API","ClassName","COLLAPSE","COLLAPSING","COLLAPSED","Dimension","WIDTH","HEIGHT","Selector","ACTIVES","DATA_TOGGLE","DATA_CHILDREN","element","config","_isTransitioning","_element","_config","_getConfig","_triggerArray","makeArray","id","_parent","_getParent","_addAriaAndCollapsedClass","_selectorActives","childrenSelector","hasAttribute","getAttribute","hasClass","hide","show","actives","activesData","find","length","data","startEvent","trigger","isDefaultPrevented","_jQueryInterface","call","dimension","_getDimension","removeClass","addClass","style","attr","setTransitioning","complete","Util","supportsTransitionEnd","capitalizedDimension","toUpperCase","slice","scrollSize","one","TRANSITION_END","emulateTransitionEnd","getBoundingClientRect","reflow","isTransitioning","dispose","removeData","extend","Boolean","typeCheckConfig","hasWidth","selector","each","i","_getTargetFromElement","triggerArray","isOpen","toggleClass","getSelectorFromElement","$this","test","undefined","Error","document","on","event","target","tagName","preventDefault","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAGA;;;;;;;AAOA,IAAMA,WAAY,UAACC,CAAD,EAAO;;AAGvB;;;;;;AAMA,MAAMC,OAAsB,UAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,aAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,M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AS0D,gBAAT,CAA0BC,IAA1B,CAA+B1D,EAAEoG,MAAF,CAA/B,EAA0CrE,MAA1C;AACD,GAVD;;AAaA;;;;;;AAMA/B,IAAEO,EAAF,CAAKN,IAAL,IAAyBF,SAAS0D,gBAAlC;AACAzD,IAAEO,EAAF,CAAKN,IAAL,EAAWsG,WAAX,GAAyBxG,QAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWuG,UAAX,GAAyB,YAAY;AACnCxG,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,SAAS0D,gBAAhB;AACD,GAHD;;AAKA,SAAO1D,QAAP;AAED,CApXgB,CAoXd0G,MApXc,CAAjB","file":"collapse.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Collapse = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'collapse'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.collapse'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 600\n\n const Default = {\n toggle : true,\n parent : ''\n }\n\n const DefaultType = {\n toggle : 'boolean',\n parent : 'string'\n }\n\n const Event = {\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n SHOW : 'show',\n COLLAPSE : 'collapse',\n COLLAPSING : 'collapsing',\n COLLAPSED : 'collapsed'\n }\n\n const Dimension = {\n WIDTH : 'width',\n HEIGHT : 'height'\n }\n\n const Selector = {\n ACTIVES : '.card > .show, .card > .collapsing',\n DATA_TOGGLE : '[data-toggle=\"collapse\"]',\n DATA_CHILDREN : 'data-children'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Collapse {\n\n constructor(element, config) {\n this._isTransitioning = false\n this._element = element\n this._config = this._getConfig(config)\n this._triggerArray = $.makeArray($(\n `[data-toggle=\"collapse\"][href=\"#${element.id}\"],` +\n `[data-toggle=\"collapse\"][data-target=\"#${element.id}\"]`\n ))\n this._parent = this._config.parent ? this._getParent() : null\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._element, this._triggerArray)\n }\n\n this._selectorActives = Selector.ACTIVES\n if (this._parent) {\n const childrenSelector = this._parent.hasAttribute(Selector.DATA_CHILDREN) ? this._parent.getAttribute(Selector.DATA_CHILDREN) : null\n if (childrenSelector !== null) {\n this._selectorActives = `${childrenSelector} > .show, ${childrenSelector} > .collapsing`\n }\n }\n\n if (this._config.toggle) {\n this.toggle()\n }\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n\n // public\n\n toggle() {\n if ($(this._element).hasClass(ClassName.SHOW)) {\n this.hide()\n } else {\n this.show()\n }\n }\n\n show() {\n if (this._isTransitioning ||\n $(this._element).hasClass(ClassName.SHOW)) {\n return\n }\n\n let actives\n let activesData\n\n if (this._parent) {\n actives = $.makeArray($(this._parent).find(this._selectorActives))\n if (!actives.length) {\n actives = null\n }\n }\n\n if (actives) {\n activesData = $(actives).data(DATA_KEY)\n if (activesData && activesData._isTransitioning) {\n return\n }\n }\n\n const startEvent = $.Event(Event.SHOW)\n $(this._element).trigger(startEvent)\n if (startEvent.isDefaultPrevented()) {\n return\n }\n\n if (actives) {\n Collapse._jQueryInterface.call($(actives), 'hide')\n if (!activesData) {\n $(actives).data(DATA_KEY, null)\n }\n }\n\n const dimension = this._getDimension()\n\n $(this._element)\n .removeClass(ClassName.COLLAPSE)\n .addClass(ClassName.COLLAPSING)\n\n this._element.style[dimension] = 0\n\n if (this._triggerArray.length) {\n $(this._triggerArray)\n .removeClass(ClassName.COLLAPSED)\n .attr('aria-expanded', true)\n }\n\n this.setTransitioning(true)\n\n const complete = () => {\n $(this._element)\n .removeClass(ClassName.COLLAPSING)\n .addClass(ClassName.COLLAPSE)\n .addClass(ClassName.SHOW)\n\n this._element.style[dimension] = ''\n\n this.setTransitioning(false)\n\n $(this._element).trigger(Event.SHOWN)\n }\n\n if (!Util.supportsTransitionEnd()) {\n complete()\n return\n }\n\n const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)\n const scrollSize = `scroll${capitalizedDimension}`\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(TRANSITION_DURATION)\n\n this._element.style[dimension] = `${this._element[scrollSize]}px`\n }\n\n hide() {\n if (this._isTransitioning ||\n !$(this._element).hasClass(ClassName.SHOW)) {\n return\n }\n\n const startEvent = $.Event(Event.HIDE)\n $(this._element).trigger(startEvent)\n if (startEvent.isDefaultPrevented()) {\n return\n }\n\n const dimension = this._getDimension()\n\n this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`\n\n Util.reflow(this._element)\n\n $(this._element)\n .addClass(ClassName.COLLAPSING)\n .removeClass(ClassName.COLLAPSE)\n .removeClass(ClassName.SHOW)\n\n if (this._triggerArray.length) {\n $(this._triggerArray)\n .addClass(ClassName.COLLAPSED)\n .attr('aria-expanded', false)\n }\n\n this.setTransitioning(true)\n\n const complete = () => {\n this.setTransitioning(false)\n $(this._element)\n .removeClass(ClassName.COLLAPSING)\n .addClass(ClassName.COLLAPSE)\n .trigger(Event.HIDDEN)\n }\n\n this._element.style[dimension] = ''\n\n if (!Util.supportsTransitionEnd()) {\n complete()\n return\n }\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(TRANSITION_DURATION)\n }\n\n setTransitioning(isTransitioning) {\n this._isTransitioning = isTransitioning\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n\n this._config = null\n this._parent = null\n this._element = null\n this._triggerArray = null\n this._isTransitioning = null\n }\n\n\n // private\n\n _getConfig(config) {\n config = $.extend({}, Default, config)\n config.toggle = Boolean(config.toggle) // coerce string values\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _getDimension() {\n const hasWidth = $(this._element).hasClass(Dimension.WIDTH)\n return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT\n }\n\n _getParent() {\n const parent = $(this._config.parent)[0]\n const selector =\n `[data-toggle=\"collapse\"][data-parent=\"${this._config.parent}\"]`\n\n $(parent).find(selector).each((i, element) => {\n this._addAriaAndCollapsedClass(\n Collapse._getTargetFromElement(element),\n [element]\n )\n })\n\n return parent\n }\n\n _addAriaAndCollapsedClass(element, triggerArray) {\n if (element) {\n const isOpen = $(element).hasClass(ClassName.SHOW)\n\n if (triggerArray.length) {\n $(triggerArray)\n .toggleClass(ClassName.COLLAPSED, !isOpen)\n .attr('aria-expanded', isOpen)\n }\n }\n }\n\n\n // static\n\n static _getTargetFromElement(element) {\n const selector = Util.getSelectorFromElement(element)\n return selector ? $(selector)[0] : null\n }\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $this = $(this)\n let data = $this.data(DATA_KEY)\n const _config = $.extend(\n {},\n Default,\n $this.data(),\n typeof config === 'object' && config\n )\n\n if (!data && _config.toggle && /show|hide/.test(config)) {\n _config.toggle = false\n }\n\n if (!data) {\n data = new Collapse(this, _config)\n $this.data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n if (!/input|textarea/i.test(event.target.tagName)) {\n event.preventDefault()\n }\n\n const target = Collapse._getTargetFromElement(this)\n const data = $(target).data(DATA_KEY)\n const config = data ? 'toggle' : $(this).data()\n\n Collapse._jQueryInterface.call($(target), config)\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Collapse._jQueryInterface\n $.fn[NAME].Constructor = Collapse\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Collapse._jQueryInterface\n }\n\n return Collapse\n\n})(jQuery)\n\nexport default Collapse\n"]}
\ No newline at end of file +{"version":3,"sources":["../src/collapse.js"],"names":["Collapse","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","TRANSITION_DURATION","Default","toggle","parent","DefaultType","Event","SHOW","SHOWN","HIDE","HIDDEN","CLICK_DATA_API","ClassName","COLLAPSE","COLLAPSING","COLLAPSED","Dimension","WIDTH","HEIGHT","Selector","ACTIVES","DATA_TOGGLE","element","config","_isTransitioning","_element","_config","_getConfig","_triggerArray","makeArray","id","_parent","_getParent","_addAriaAndCollapsedClass","hasClass","hide","show","actives","activesData","children","length","data","startEvent","trigger","isDefaultPrevented","_jQueryInterface","call","dimension","_getDimension","removeClass","addClass","style","attr","setTransitioning","complete","Util","supportsTransitionEnd","capitalizedDimension","toUpperCase","slice","scrollSize","one","TRANSITION_END","emulateTransitionEnd","getBoundingClientRect","reflow","isTransitioning","dispose","removeData","extend","Boolean","typeCheckConfig","hasWidth","selector","find","each","i","_getTargetFromElement","triggerArray","isOpen","toggleClass","getSelectorFromElement","$this","test","undefined","Error","document","on","event","target","tagName","preventDefault","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAGA;;;;;;;AAOA,IAAMA,WAAY,UAACC,CAAD,EAAO;;AAGvB;;;;;;AAMA,MAAMC,OAAsB,UAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,aAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,e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;AACD,GAHD;;AAKA,SAAOrD,QAAP;AAED,CA5WgB,CA4WdsG,MA5Wc,CAAjB","file":"collapse.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Collapse = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'collapse'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.collapse'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 600\n\n const Default = {\n toggle : true,\n parent : ''\n }\n\n const DefaultType = {\n toggle : 'boolean',\n parent : 'string'\n }\n\n const Event = {\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n SHOW : 'show',\n COLLAPSE : 'collapse',\n COLLAPSING : 'collapsing',\n COLLAPSED : 'collapsed'\n }\n\n const Dimension = {\n WIDTH : 'width',\n HEIGHT : 'height'\n }\n\n const Selector = {\n ACTIVES : '.show, .collapsing',\n DATA_TOGGLE : '[data-toggle=\"collapse\"]'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Collapse {\n\n constructor(element, config) {\n this._isTransitioning = false\n this._element = element\n this._config = this._getConfig(config)\n this._triggerArray = $.makeArray($(\n `[data-toggle=\"collapse\"][href=\"#${element.id}\"],` +\n `[data-toggle=\"collapse\"][data-target=\"#${element.id}\"]`\n ))\n\n this._parent = this._config.parent ? this._getParent() : null\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._element, this._triggerArray)\n }\n\n if (this._config.toggle) {\n this.toggle()\n }\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n\n // public\n\n toggle() {\n if ($(this._element).hasClass(ClassName.SHOW)) {\n this.hide()\n } else {\n this.show()\n }\n }\n\n show() {\n if (this._isTransitioning ||\n $(this._element).hasClass(ClassName.SHOW)) {\n return\n }\n\n let actives\n let activesData\n\n if (this._parent) {\n actives = $.makeArray($(this._parent).children().children(Selector.ACTIVES))\n if (!actives.length) {\n actives = null\n }\n }\n\n if (actives) {\n activesData = $(actives).data(DATA_KEY)\n if (activesData && activesData._isTransitioning) {\n return\n }\n }\n\n const startEvent = $.Event(Event.SHOW)\n $(this._element).trigger(startEvent)\n if (startEvent.isDefaultPrevented()) {\n return\n }\n\n if (actives) {\n Collapse._jQueryInterface.call($(actives), 'hide')\n if (!activesData) {\n $(actives).data(DATA_KEY, null)\n }\n }\n\n const dimension = this._getDimension()\n\n $(this._element)\n .removeClass(ClassName.COLLAPSE)\n .addClass(ClassName.COLLAPSING)\n\n this._element.style[dimension] = 0\n\n if (this._triggerArray.length) {\n $(this._triggerArray)\n .removeClass(ClassName.COLLAPSED)\n .attr('aria-expanded', true)\n }\n\n this.setTransitioning(true)\n\n const complete = () => {\n $(this._element)\n .removeClass(ClassName.COLLAPSING)\n .addClass(ClassName.COLLAPSE)\n .addClass(ClassName.SHOW)\n\n this._element.style[dimension] = ''\n\n this.setTransitioning(false)\n\n $(this._element).trigger(Event.SHOWN)\n }\n\n if (!Util.supportsTransitionEnd()) {\n complete()\n return\n }\n\n const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)\n const scrollSize = `scroll${capitalizedDimension}`\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(TRANSITION_DURATION)\n\n this._element.style[dimension] = `${this._element[scrollSize]}px`\n }\n\n hide() {\n if (this._isTransitioning ||\n !$(this._element).hasClass(ClassName.SHOW)) {\n return\n }\n\n const startEvent = $.Event(Event.HIDE)\n $(this._element).trigger(startEvent)\n if (startEvent.isDefaultPrevented()) {\n return\n }\n\n const dimension = this._getDimension()\n\n this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`\n\n Util.reflow(this._element)\n\n $(this._element)\n .addClass(ClassName.COLLAPSING)\n .removeClass(ClassName.COLLAPSE)\n .removeClass(ClassName.SHOW)\n\n if (this._triggerArray.length) {\n $(this._triggerArray)\n .addClass(ClassName.COLLAPSED)\n .attr('aria-expanded', false)\n }\n\n this.setTransitioning(true)\n\n const complete = () => {\n this.setTransitioning(false)\n $(this._element)\n .removeClass(ClassName.COLLAPSING)\n .addClass(ClassName.COLLAPSE)\n .trigger(Event.HIDDEN)\n }\n\n this._element.style[dimension] = ''\n\n if (!Util.supportsTransitionEnd()) {\n complete()\n return\n }\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(TRANSITION_DURATION)\n }\n\n setTransitioning(isTransitioning) {\n this._isTransitioning = isTransitioning\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n\n this._config = null\n this._parent = null\n this._element = null\n this._triggerArray = null\n this._isTransitioning = null\n }\n\n\n // private\n\n _getConfig(config) {\n config = $.extend({}, Default, config)\n config.toggle = Boolean(config.toggle) // coerce string values\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _getDimension() {\n const hasWidth = $(this._element).hasClass(Dimension.WIDTH)\n return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT\n }\n\n _getParent() {\n const parent = $(this._config.parent)[0]\n const selector =\n `[data-toggle=\"collapse\"][data-parent=\"${this._config.parent}\"]`\n\n $(parent).find(selector).each((i, element) => {\n this._addAriaAndCollapsedClass(\n Collapse._getTargetFromElement(element),\n [element]\n )\n })\n\n return parent\n }\n\n _addAriaAndCollapsedClass(element, triggerArray) {\n if (element) {\n const isOpen = $(element).hasClass(ClassName.SHOW)\n\n if (triggerArray.length) {\n $(triggerArray)\n .toggleClass(ClassName.COLLAPSED, !isOpen)\n .attr('aria-expanded', isOpen)\n }\n }\n }\n\n\n // static\n\n static _getTargetFromElement(element) {\n const selector = Util.getSelectorFromElement(element)\n return selector ? $(selector)[0] : null\n }\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $this = $(this)\n let data = $this.data(DATA_KEY)\n const _config = $.extend(\n {},\n Default,\n $this.data(),\n typeof config === 'object' && config\n )\n\n if (!data && _config.toggle && /show|hide/.test(config)) {\n _config.toggle = false\n }\n\n if (!data) {\n data = new Collapse(this, _config)\n $this.data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n if (!/input|textarea/i.test(event.target.tagName)) {\n event.preventDefault()\n }\n\n const target = Collapse._getTargetFromElement(this)\n const data = $(target).data(DATA_KEY)\n const config = data ? 'toggle' : $(this).data()\n\n Collapse._jQueryInterface.call($(target), config)\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Collapse._jQueryInterface\n $.fn[NAME].Constructor = Collapse\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Collapse._jQueryInterface\n }\n\n return Collapse\n\n})(jQuery)\n\nexport default Collapse\n"]}
\ No newline at end of file diff --git a/js/dist/dropdown.js b/js/dist/dropdown.js index 62df3f341d..3a4996992d 100644 --- a/js/dist/dropdown.js +++ b/js/dist/dropdown.js @@ -1,3 +1,5 @@ +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -12,6 +14,14 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons var Dropdown = function ($) { /** + * Check for Popper dependency + * Popper - https://popper.js.org + */ + if (typeof Popper === 'undefined') { + throw new Error('Bootstrap dropdown require Popper.js (https://popper.js.org)'); + } + + /** * ------------------------------------------------------------------------ * Constants * ------------------------------------------------------------------------ @@ -55,6 +65,23 @@ var Dropdown = function ($) { VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled)' }; + var AttachmentMap = { + TOP: 'top-start', + BOTTOM: 'bottom-start' + }; + + var Default = { + placement: AttachmentMap.BOTTOM, + offset: 0, + flip: true + }; + + var DefaultType = { + placement: 'string', + offset: '(number|string)', + flip: 'boolean' + }; + /** * ------------------------------------------------------------------------ * Class Definition @@ -62,10 +89,13 @@ var Dropdown = function ($) { */ var Dropdown = function () { - function Dropdown(element) { + function Dropdown(element, config) { _classCallCheck(this, Dropdown); this._element = element; + this._popper = null; + this._config = this._getConfig(config); + this._menu = this._getMenuElement(); this._addEventListeners(); } @@ -75,30 +105,44 @@ var Dropdown = function ($) { // public Dropdown.prototype.toggle = function toggle() { - if (this.disabled || $(this).hasClass(ClassName.DISABLED)) { - return false; + if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) { + return; } - var parent = Dropdown._getParentFromElement(this); - var isActive = $(parent).hasClass(ClassName.SHOW); + var parent = Dropdown._getParentFromElement(this._element); + var isActive = $(this._menu).hasClass(ClassName.SHOW); Dropdown._clearMenus(); if (isActive) { - return false; + return; } var relatedTarget = { - relatedTarget: this + relatedTarget: this._element }; var showEvent = $.Event(Event.SHOW, relatedTarget); $(parent).trigger(showEvent); if (showEvent.isDefaultPrevented()) { - return false; + return; } + // Handle dropup + var dropdownPlacement = $(this._element).parent().hasClass('dropup') ? AttachmentMap.TOP : this._config.placement; + this._popper = new Popper(this._element, this._menu, { + placement: dropdownPlacement, + modifiers: { + offset: { + offset: this._config.offset + }, + flip: { + enabled: this._config.flip + } + } + }); + // if this is a touch-enabled device we add extra // empty mouseover listeners to the body's immediate children; // only needed because of broken event delegation on iOS @@ -107,25 +151,61 @@ var Dropdown = function ($) { $('body').children().on('mouseover', null, $.noop); } - this.focus(); - this.setAttribute('aria-expanded', true); + this._element.focus(); + this._element.setAttribute('aria-expanded', true); - $(parent).toggleClass(ClassName.SHOW); - $(parent).trigger($.Event(Event.SHOWN, relatedTarget)); - - return false; + $(this._menu).toggleClass(ClassName.SHOW); + $(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.SHOWN, relatedTarget)); }; Dropdown.prototype.dispose = function dispose() { $.removeData(this._element, DATA_KEY); $(this._element).off(EVENT_KEY); this._element = null; + this._menu = null; + if (this._popper !== null) { + this._popper.destroy(); + } + this._popper = null; + }; + + Dropdown.prototype.update = function update() { + if (this._popper !== null) { + this._popper.scheduleUpdate(); + } }; // private Dropdown.prototype._addEventListeners = function _addEventListeners() { - $(this._element).on(Event.CLICK, this.toggle); + var _this = this; + + $(this._element).on(Event.CLICK, function (event) { + event.preventDefault(); + event.stopPropagation(); + _this.toggle(); + }); + }; + + Dropdown.prototype._getConfig = function _getConfig(config) { + var elementData = $(this._element).data(); + if (elementData.placement !== undefined) { + elementData.placement = AttachmentMap[elementData.placement.toUpperCase()]; + } + + config = $.extend({}, this.constructor.Default, $(this._element).data(), config); + + Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); + + return config; + }; + + Dropdown.prototype._getMenuElement = function _getMenuElement() { + if (!this._menu) { + var parent = Dropdown._getParentFromElement(this._element); + this._menu = $(parent).find(Selector.MENU)[0]; + } + return this._menu; }; // static @@ -133,9 +213,10 @@ var Dropdown = function ($) { Dropdown._jQueryInterface = function _jQueryInterface(config) { return this.each(function () { var data = $(this).data(DATA_KEY); + var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' ? config : null; if (!data) { - data = new Dropdown(this); + data = new Dropdown(this, _config); $(this).data(DATA_KEY, data); } @@ -143,7 +224,7 @@ var Dropdown = function ($) { if (data[config] === undefined) { throw new Error('No method named "' + config + '"'); } - data[config].call(this); + data[config](); } }); }; @@ -154,13 +235,18 @@ var Dropdown = function ($) { } var toggles = $.makeArray($(Selector.DATA_TOGGLE)); - for (var i = 0; i < toggles.length; i++) { var parent = Dropdown._getParentFromElement(toggles[i]); + var context = $(toggles[i]).data(DATA_KEY); var relatedTarget = { relatedTarget: toggles[i] }; + if (!context) { + continue; + } + + var dropdownMenu = context._menu; if (!$(parent).hasClass(ClassName.SHOW)) { continue; } @@ -183,6 +269,7 @@ var Dropdown = function ($) { toggles[i].setAttribute('aria-expanded', 'false'); + $(dropdownMenu).removeClass(ClassName.SHOW); $(parent).removeClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget)); } }; @@ -254,6 +341,16 @@ var Dropdown = function ($) { get: function get() { return VERSION; } + }, { + key: 'Default', + get: function get() { + return Default; + } + }, { + key: 'DefaultType', + get: function get() { + return DefaultType; + } }]); return Dropdown; @@ -265,7 +362,11 @@ var Dropdown = function ($) { * ------------------------------------------------------------------------ */ - $(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + ' ' + Event.KEYUP_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, Dropdown.prototype.toggle).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) { + $(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + ' ' + Event.KEYUP_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { + event.preventDefault(); + event.stopPropagation(); + Dropdown._jQueryInterface.call($(this), 'toggle'); + }).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) { e.stopPropagation(); }); @@ -283,5 +384,5 @@ var Dropdown = function ($) { }; return Dropdown; -}(jQuery); +}(jQuery); /* global Popper */ //# sourceMappingURL=dropdown.js.map
\ No newline at end of file diff --git a/js/dist/dropdown.js.map b/js/dist/dropdown.js.map index c7b189283b..397209cdcd 100644 --- a/js/dist/dropdown.js.map +++ b/js/dist/dropdown.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/dropdown.js"],"names":["Dropdown","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","ESCAPE_KEYCODE","SPACE_KEYCODE","TAB_KEYCODE","ARROW_UP_KEYCODE","ARROW_DOWN_KEYCODE","RIGHT_MOUSE_BUTTON_WHICH","REGEXP_KEYDOWN","RegExp","Event","HIDE","HIDDEN","SHOW","SHOWN","CLICK","CLICK_DATA_API","KEYDOWN_DATA_API","KEYUP_DATA_API","ClassName","DISABLED","Selector","DATA_TOGGLE","FORM_CHILD","MENU","NAVBAR_NAV","VISIBLE_ITEMS","element","_element","_addEventListeners","toggle","disabled","hasClass","parent","_getParentFromElement","isActive","_clearMenus","relatedTarget","showEvent","trigger","isDefaultPrevented","document","documentElement","closest","length","children","on","noop","focus","setAttribute","toggleClass","dispose","removeData","off","_jQueryInterface","config","each","data","undefined","Error","call","event","which","type","toggles","makeArray","i","test","target","tagName","contains","hideEvent","removeClass","selector","Util","getSelectorFromElement","parentNode","_dataApiKeydownHandler","preventDefault","stopPropagation","find","items","get","index","indexOf","prototype","e","Constructor","noConflict","jQuery"],"mappings":";;;;AAGA;;;;;;;AAOA,IAAMA,WAAY,UAACC,CAAD,EAAO;;AAGvB;;;;;;AAMA,MAAMC,OAA2B,UAAjC;AACA,MAAMC,UAA2B,eAAjC;AACA,MAAMC,WAA2B,aAAjC;AACA,MAAMC,kBAA+BD,QAArC;AACA,MAAME,eAA2B,WAAjC;AACA,MAAMC,qBAA2BN,EAAEO,EAAF,CAAKN,IAAL,CAAjC;AACA,MAAMO,iBAA2B,EAAjC,CAfuB,CAea;AACpC,MAAMC,gBAA2B,EAAjC,CAhBuB,CAgBa;AACpC,MAAMC,cAA2B,CAAjC,CAjBuB,CAiBY;AACnC,MAAMC,mBAA2B,EAAjC,CAlBuB,CAkBa;AACpC,MAAMC,qBAA2B,EAAjC,CAnBuB,CAmBa;AACpC,MAAMC,2BAA2B,CAAjC,CApBuB,CAoBY;AACnC,MAAMC,iBAA2B,IAAIC,MAAJ,CAAcJ,gBAAd,SAAkCC,kBAAlC,SAAwDJ,cAAxD,CAAjC;;AAEA,MAAMQ,QAAQ;AACZC,mBAA0Bb,SADd;AAEZc,uBAA4Bd,SAFhB;AAGZe,mBAA0Bf,SAHd;AAIZgB,qBAA2BhB,SAJf;AAKZiB,qBAA2BjB,SALf;AAMZkB,8BAA2BlB,SAA3B,GAAuCC,YAN3B;AAOZkB,kCAA6BnB,SAA7B,GAAyCC,YAP7B;AAQZmB,8BAA2BpB,SAA3B,GAAuCC;AAR3B,GAAd;;AAWA,MAAMoB,YAAY;AAChBC,cAAW,UADK;AAEhBP,UAAW;AAFK,GAAlB;;AAKA,MAAMQ,WAAW;AACfC,iBAAgB,0BADD;AAEfC,gBAAgB,gBAFD;AAGfC,UAAgB,gBAHD;AAIfC,gBAAgB,aAJD;AAKfC,mBAAgB;AALD,GAAjB;;AASA;;;;;;AAhDuB,MAsDjBjC,QAtDiB;AAwDrB,sB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AACnC9F,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,SAAS6D,gBAAhB;AACD,GAHD;;AAKA,SAAO7D,QAAP;AAED,CAjSgB,CAiSdgG,MAjSc,CAAjB","file":"dropdown.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Dropdown = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'dropdown'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.dropdown'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key\n const SPACE_KEYCODE = 32 // KeyboardEvent.which value for space key\n const TAB_KEYCODE = 9 // KeyboardEvent.which value for tab key\n const ARROW_UP_KEYCODE = 38 // KeyboardEvent.which value for up arrow key\n const ARROW_DOWN_KEYCODE = 40 // KeyboardEvent.which value for down arrow key\n const RIGHT_MOUSE_BUTTON_WHICH = 3 // MouseEvent.which value for the right button (assuming a right-handed mouse)\n const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEYCODE}|${ARROW_DOWN_KEYCODE}|${ESCAPE_KEYCODE}`)\n\n const Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`,\n KEYDOWN_DATA_API : `keydown${EVENT_KEY}${DATA_API_KEY}`,\n KEYUP_DATA_API : `keyup${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n DISABLED : 'disabled',\n SHOW : 'show'\n }\n\n const Selector = {\n DATA_TOGGLE : '[data-toggle=\"dropdown\"]',\n FORM_CHILD : '.dropdown form',\n MENU : '.dropdown-menu',\n NAVBAR_NAV : '.navbar-nav',\n VISIBLE_ITEMS : '.dropdown-menu .dropdown-item:not(.disabled)'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Dropdown {\n\n constructor(element) {\n this._element = element\n\n this._addEventListeners()\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n\n // public\n\n toggle() {\n if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {\n return false\n }\n\n const parent = Dropdown._getParentFromElement(this)\n const isActive = $(parent).hasClass(ClassName.SHOW)\n\n Dropdown._clearMenus()\n\n if (isActive) {\n return false\n }\n\n const relatedTarget = {\n relatedTarget : this\n }\n const showEvent = $.Event(Event.SHOW, relatedTarget)\n\n $(parent).trigger(showEvent)\n\n if (showEvent.isDefaultPrevented()) {\n return false\n }\n\n // if this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement &&\n !$(parent).closest(Selector.NAVBAR_NAV).length) {\n $('body').children().on('mouseover', null, $.noop)\n }\n\n this.focus()\n this.setAttribute('aria-expanded', true)\n\n $(parent).toggleClass(ClassName.SHOW)\n $(parent).trigger($.Event(Event.SHOWN, relatedTarget))\n\n return false\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n $(this._element).off(EVENT_KEY)\n this._element = null\n }\n\n\n // private\n\n _addEventListeners() {\n $(this._element).on(Event.CLICK, this.toggle)\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n\n if (!data) {\n data = new Dropdown(this)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config].call(this)\n }\n })\n }\n\n static _clearMenus(event) {\n if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH ||\n event.type === 'keyup' && event.which !== TAB_KEYCODE)) {\n return\n }\n\n const toggles = $.makeArray($(Selector.DATA_TOGGLE))\n\n for (let i = 0; i < toggles.length; i++) {\n const parent = Dropdown._getParentFromElement(toggles[i])\n const relatedTarget = {\n relatedTarget : toggles[i]\n }\n\n if (!$(parent).hasClass(ClassName.SHOW)) {\n continue\n }\n\n if (event && (event.type === 'click' &&\n /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE)\n && $.contains(parent, event.target)) {\n continue\n }\n\n const hideEvent = $.Event(Event.HIDE, relatedTarget)\n $(parent).trigger(hideEvent)\n if (hideEvent.isDefaultPrevented()) {\n continue\n }\n\n // if this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n $('body').children().off('mouseover', null, $.noop)\n }\n\n toggles[i].setAttribute('aria-expanded', 'false')\n\n $(parent)\n .removeClass(ClassName.SHOW)\n .trigger($.Event(Event.HIDDEN, relatedTarget))\n }\n }\n\n static _getParentFromElement(element) {\n let parent\n const selector = Util.getSelectorFromElement(element)\n\n if (selector) {\n parent = $(selector)[0]\n }\n\n return parent || element.parentNode\n }\n\n static _dataApiKeydownHandler(event) {\n if (!REGEXP_KEYDOWN.test(event.which) || /button/i.test(event.target.tagName) && event.which === SPACE_KEYCODE ||\n /input|textarea/i.test(event.target.tagName)) {\n return\n }\n\n event.preventDefault()\n event.stopPropagation()\n\n if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {\n return\n }\n\n const parent = Dropdown._getParentFromElement(this)\n const isActive = $(parent).hasClass(ClassName.SHOW)\n\n if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) ||\n isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {\n\n if (event.which === ESCAPE_KEYCODE) {\n const toggle = $(parent).find(Selector.DATA_TOGGLE)[0]\n $(toggle).trigger('focus')\n }\n\n $(this).trigger('click')\n return\n }\n\n const items = $(parent).find(Selector.VISIBLE_ITEMS).get()\n\n if (!items.length) {\n return\n }\n\n let index = items.indexOf(event.target)\n\n if (event.which === ARROW_UP_KEYCODE && index > 0) { // up\n index--\n }\n\n if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { // down\n index++\n }\n\n if (index < 0) {\n index = 0\n }\n\n items[index].focus()\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document)\n .on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler)\n .on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler)\n .on(`${Event.CLICK_DATA_API} ${Event.KEYUP_DATA_API}`, Dropdown._clearMenus)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, Dropdown.prototype.toggle)\n .on(Event.CLICK_DATA_API, Selector.FORM_CHILD, (e) => {\n e.stopPropagation()\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Dropdown._jQueryInterface\n $.fn[NAME].Constructor = Dropdown\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Dropdown._jQueryInterface\n }\n\n return Dropdown\n\n})(jQuery)\n\nexport default Dropdown\n"]}
\ No newline at end of file +{"version":3,"sources":["../src/dropdown.js"],"names":["Dropdown","$","Popper","Error","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","ESCAPE_KEYCODE","SPACE_KEYCODE","TAB_KEYCODE","ARROW_UP_KEYCODE","ARROW_DOWN_KEYCODE","RIGHT_MOUSE_BUTTON_WHICH","REGEXP_KEYDOWN","RegExp","Event","HIDE","HIDDEN","SHOW","SHOWN","CLICK","CLICK_DATA_API","KEYDOWN_DATA_API","KEYUP_DATA_API","ClassName","DISABLED","Selector","DATA_TOGGLE","FORM_CHILD","MENU","NAVBAR_NAV","VISIBLE_ITEMS","AttachmentMap","TOP","BOTTOM","Default","placement","offset","flip","DefaultType","element","config","_element","_popper","_config","_getConfig","_menu","_getMenuElement","_addEventListeners","toggle","disabled","hasClass","parent","_getParentFromElement","isActive","_clearMenus","relatedTarget","showEvent","trigger","isDefaultPrevented","dropdownPlacement","modifiers","enabled","document","documentElement","closest","length","children","on","noop","focus","setAttribute","toggleClass","dispose","removeData","off","destroy","update","scheduleUpdate","event","preventDefault","stopPropagation","elementData","data","undefined","toUpperCase","extend","constructor","Util","typeCheckConfig","find","_jQueryInterface","each","which","type","toggles","makeArray","i","context","dropdownMenu","test","target","tagName","contains","hideEvent","removeClass","selector","getSelectorFromElement","parentNode","_dataApiKeydownHandler","items","get","index","indexOf","call","e","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAKA;;;;;;;AAOA,IAAMA,WAAY,UAACC,CAAD,EAAO;;AAEvB;;;;AAIA,MAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;AACjC,UAAM,IAAIC,KAAJ,CAAU,8DAAV,CAAN;AACD;;AAED;;;;;;AAMA,MAAMC,OAA2B,UAAjC;AACA,MAAMC,UAA2B,eAAjC;AACA,MAAMC,WAA2B,aAAjC;AACA,MAAMC,kBAA+BD,QAArC;AACA,MAAME,eAA2B,WAAjC;AACA,MAAMC,qBAA2BR,EAAES,EAAF,CAAKN,IAAL,CAAjC;AACA,MAAMO,iBAA2B,EAAjC,CAtBuB,CAsBa;AACpC,MAAMC,gBAA2B,EAAjC,CAvBuB,CAuBa;AACpC,MAAMC,cAA2B,CAAjC,CAxBuB,CAwBY;AACnC,MAAMC,mBAA2B,EAAjC,CAzBuB,CAyBa;AACpC,MAAMC,qBAA2B,EAAjC,CA1BuB,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A;AAAA;;AAoWvB;;;;;;AAMA1C,IAAEkE,QAAF,EACGK,EADH,CACMrD,MAAMO,gBADZ,EAC8BI,SAASC,WADvC,EACqD/B,SAASiH,sBAD9D,EAEGzC,EAFH,CAEMrD,MAAMO,gBAFZ,EAE8BI,SAASG,IAFvC,EAE6CjC,SAASiH,sBAFtD,EAGGzC,EAHH,CAGSrD,MAAMM,cAHf,SAGiCN,MAAMQ,cAHvC,EAGyD3B,SAAS2D,WAHlE,EAIGa,EAJH,CAIMrD,MAAMM,cAJZ,EAI4BK,SAASC,WAJrC,EAIkD,UAAUoD,KAAV,EAAiB;AAC/DA,UAAMC,cAAN;AACAD,UAAME,eAAN;AACArF,aAAS+F,gBAAT,CAA0BuB,IAA1B,CAA+BrH,EAAE,IAAF,CAA/B,EAAwC,QAAxC;AACD,GARH,EASGuE,EATH,CASMrD,MAAMM,cATZ,EAS4BK,SAASE,UATrC,EASiD,UAACuF,CAAD,EAAO;AACpDA,MAAElC,eAAF;AACD,GAXH;;AAcA;;;;;;AAMApF,IAAES,EAAF,CAAKN,IAAL,IAAyBJ,SAAS+F,gBAAlC;AACA9F,IAAES,EAAF,CAAKN,IAAL,EAAWoH,WAAX,GAAyBxH,QAAzB;AACAC,IAAES,EAAF,CAAKN,IAAL,EAAWqH,UAAX,GAAyB,YAAY;AACnCxH,MAAES,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOT,SAAS+F,gBAAhB;AACD,GAHD;;AAKA,SAAO/F,QAAP;AAED,CAvYgB,CAuYd0H,MAvYc,CAAjB,C,CAZA","file":"dropdown.js","sourcesContent":["/* global Popper */\n\nimport Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Dropdown = (($) => {\n\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper === 'undefined') {\n throw new Error('Bootstrap dropdown require Popper.js (https://popper.js.org)')\n }\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'dropdown'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.dropdown'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key\n const SPACE_KEYCODE = 32 // KeyboardEvent.which value for space key\n const TAB_KEYCODE = 9 // KeyboardEvent.which value for tab key\n const ARROW_UP_KEYCODE = 38 // KeyboardEvent.which value for up arrow key\n const ARROW_DOWN_KEYCODE = 40 // KeyboardEvent.which value for down arrow key\n const RIGHT_MOUSE_BUTTON_WHICH = 3 // MouseEvent.which value for the right button (assuming a right-handed mouse)\n const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEYCODE}|${ARROW_DOWN_KEYCODE}|${ESCAPE_KEYCODE}`)\n\n const Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`,\n KEYDOWN_DATA_API : `keydown${EVENT_KEY}${DATA_API_KEY}`,\n KEYUP_DATA_API : `keyup${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n DISABLED : 'disabled',\n SHOW : 'show'\n }\n\n const Selector = {\n DATA_TOGGLE : '[data-toggle=\"dropdown\"]',\n FORM_CHILD : '.dropdown form',\n MENU : '.dropdown-menu',\n NAVBAR_NAV : '.navbar-nav',\n VISIBLE_ITEMS : '.dropdown-menu .dropdown-item:not(.disabled)'\n }\n\n const AttachmentMap = {\n TOP : 'top-start',\n BOTTOM : 'bottom-start'\n }\n\n const Default = {\n placement : AttachmentMap.BOTTOM,\n offset : 0,\n flip : true\n }\n\n const DefaultType = {\n placement : 'string',\n offset : '(number|string)',\n flip : 'boolean'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Dropdown {\n\n constructor(element, config) {\n this._element = element\n this._popper = null\n this._config = this._getConfig(config)\n this._menu = this._getMenuElement()\n\n this._addEventListeners()\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n // public\n\n toggle() {\n if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) {\n return\n }\n\n const parent = Dropdown._getParentFromElement(this._element)\n const isActive = $(this._menu).hasClass(ClassName.SHOW)\n\n Dropdown._clearMenus()\n\n if (isActive) {\n return\n }\n\n const relatedTarget = {\n relatedTarget : this._element\n }\n const showEvent = $.Event(Event.SHOW, relatedTarget)\n\n $(parent).trigger(showEvent)\n\n if (showEvent.isDefaultPrevented()) {\n return\n }\n\n // Handle dropup\n const dropdownPlacement = $(this._element).parent().hasClass('dropup') ? AttachmentMap.TOP : this._config.placement\n this._popper = new Popper(this._element, this._menu, {\n placement : dropdownPlacement,\n modifiers : {\n offset : {\n offset : this._config.offset\n },\n flip : {\n enabled : this._config.flip\n }\n }\n })\n\n // if this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement &&\n !$(parent).closest(Selector.NAVBAR_NAV).length) {\n $('body').children().on('mouseover', null, $.noop)\n }\n\n this._element.focus()\n this._element.setAttribute('aria-expanded', true)\n\n $(this._menu).toggleClass(ClassName.SHOW)\n $(parent)\n .toggleClass(ClassName.SHOW)\n .trigger($.Event(Event.SHOWN, relatedTarget))\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n $(this._element).off(EVENT_KEY)\n this._element = null\n this._menu = null\n if (this._popper !== null) {\n this._popper.destroy()\n }\n this._popper = null\n }\n\n update() {\n if (this._popper !== null) {\n this._popper.scheduleUpdate()\n }\n }\n\n // private\n\n _addEventListeners() {\n $(this._element).on(Event.CLICK, (event) => {\n event.preventDefault()\n event.stopPropagation()\n this.toggle()\n })\n }\n\n _getConfig(config) {\n const elementData = $(this._element).data()\n if (elementData.placement !== undefined) {\n elementData.placement = AttachmentMap[elementData.placement.toUpperCase()]\n }\n\n config = $.extend(\n {},\n this.constructor.Default,\n $(this._element).data(),\n config\n )\n\n Util.typeCheckConfig(\n NAME,\n config,\n this.constructor.DefaultType\n )\n\n return config\n }\n\n _getMenuElement() {\n if (!this._menu) {\n const parent = Dropdown._getParentFromElement(this._element)\n this._menu = $(parent).find(Selector.MENU)[0]\n }\n return this._menu\n }\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' ? config : null\n\n if (!data) {\n data = new Dropdown(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n\n static _clearMenus(event) {\n if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH ||\n event.type === 'keyup' && event.which !== TAB_KEYCODE)) {\n return\n }\n\n const toggles = $.makeArray($(Selector.DATA_TOGGLE))\n for (let i = 0; i < toggles.length; i++) {\n const parent = Dropdown._getParentFromElement(toggles[i])\n const context = $(toggles[i]).data(DATA_KEY)\n const relatedTarget = {\n relatedTarget : toggles[i]\n }\n\n if (!context) {\n continue\n }\n\n const dropdownMenu = context._menu\n if (!$(parent).hasClass(ClassName.SHOW)) {\n continue\n }\n\n if (event && (event.type === 'click' &&\n /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE)\n && $.contains(parent, event.target)) {\n continue\n }\n\n const hideEvent = $.Event(Event.HIDE, relatedTarget)\n $(parent).trigger(hideEvent)\n if (hideEvent.isDefaultPrevented()) {\n continue\n }\n\n // if this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n $('body').children().off('mouseover', null, $.noop)\n }\n\n toggles[i].setAttribute('aria-expanded', 'false')\n\n $(dropdownMenu).removeClass(ClassName.SHOW)\n $(parent)\n .removeClass(ClassName.SHOW)\n .trigger($.Event(Event.HIDDEN, relatedTarget))\n }\n }\n\n static _getParentFromElement(element) {\n let parent\n const selector = Util.getSelectorFromElement(element)\n\n if (selector) {\n parent = $(selector)[0]\n }\n\n return parent || element.parentNode\n }\n\n static _dataApiKeydownHandler(event) {\n if (!REGEXP_KEYDOWN.test(event.which) || /button/i.test(event.target.tagName) && event.which === SPACE_KEYCODE ||\n /input|textarea/i.test(event.target.tagName)) {\n return\n }\n\n event.preventDefault()\n event.stopPropagation()\n\n if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {\n return\n }\n\n const parent = Dropdown._getParentFromElement(this)\n const isActive = $(parent).hasClass(ClassName.SHOW)\n\n if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) ||\n isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {\n\n if (event.which === ESCAPE_KEYCODE) {\n const toggle = $(parent).find(Selector.DATA_TOGGLE)[0]\n $(toggle).trigger('focus')\n }\n\n $(this).trigger('click')\n return\n }\n\n const items = $(parent).find(Selector.VISIBLE_ITEMS).get()\n\n if (!items.length) {\n return\n }\n\n let index = items.indexOf(event.target)\n\n if (event.which === ARROW_UP_KEYCODE && index > 0) { // up\n index--\n }\n\n if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { // down\n index++\n }\n\n if (index < 0) {\n index = 0\n }\n\n items[index].focus()\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document)\n .on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler)\n .on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler)\n .on(`${Event.CLICK_DATA_API} ${Event.KEYUP_DATA_API}`, Dropdown._clearMenus)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault()\n event.stopPropagation()\n Dropdown._jQueryInterface.call($(this), 'toggle')\n })\n .on(Event.CLICK_DATA_API, Selector.FORM_CHILD, (e) => {\n e.stopPropagation()\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Dropdown._jQueryInterface\n $.fn[NAME].Constructor = Dropdown\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Dropdown._jQueryInterface\n }\n\n return Dropdown\n\n})(jQuery)\n\nexport default Dropdown\n"]}
\ No newline at end of file diff --git a/js/dist/popover.js b/js/dist/popover.js index d570fa3723..ecc89c81fe 100644 --- a/js/dist/popover.js +++ b/js/dist/popover.js @@ -28,12 +28,14 @@ var Popover = function ($) { var DATA_KEY = 'bs.popover'; var EVENT_KEY = '.' + DATA_KEY; var JQUERY_NO_CONFLICT = $.fn[NAME]; + var CLASS_PREFIX = 'bs-popover'; + var BSCLS_PREFIX_REGEX = new RegExp('(^|\\s)' + CLASS_PREFIX + '\\S+', 'g'); var Default = $.extend({}, Tooltip.Default, { placement: 'right', trigger: 'click', content: '', - template: '<div class="popover" role="tooltip">' + '<h3 class="popover-title"></h3>' + '<div class="popover-content"></div></div>' + template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-title"></h3>' + '<div class="popover-content"></div></div>' }); var DefaultType = $.extend({}, Tooltip.DefaultType, { @@ -84,6 +86,10 @@ var Popover = function ($) { return this.getTitle() || this._getContent(); }; + Popover.prototype.addAttachmentClass = function addAttachmentClass(attachment) { + $(this.getTipElement()).addClass(CLASS_PREFIX + '-' + attachment); + }; + Popover.prototype.getTipElement = function getTipElement() { return this.tip = this.tip || $(this.config.template)[0]; }; @@ -96,8 +102,6 @@ var Popover = function ($) { this.setElementContent($tip.find(Selector.CONTENT), this._getContent()); $tip.removeClass(ClassName.FADE + ' ' + ClassName.SHOW); - - this.cleanupTether(); }; // private @@ -106,6 +110,14 @@ var Popover = function ($) { return this.element.getAttribute('data-content') || (typeof this.config.content === 'function' ? this.config.content.call(this.element) : this.config.content); }; + Popover.prototype._cleanTipClass = function _cleanTipClass() { + var $tip = $(this.getTipElement()); + var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); + if (tabClass !== null && tabClass.length > 0) { + $tip.removeClass(tabClass.join('')); + } + }; + // static Popover._jQueryInterface = function _jQueryInterface(config) { diff --git a/js/dist/popover.js.map b/js/dist/popover.js.map index e8bf8e9d93..ca0774a4df 100644 --- a/js/dist/popover.js.map +++ b/js/dist/popover.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/popover.js"],"names":["Popover","$","NAME","VERSION","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","fn","Default","extend","Tooltip","placement","trigger","content","template","DefaultType","ClassName","FADE","SHOW","Selector","TITLE","CONTENT","Event","HIDE","HIDDEN","SHOWN","INSERTED","CLICK","FOCUSIN","FOCUSOUT","MOUSEENTER","MOUSELEAVE","isWithContent","getTitle","_getContent","getTipElement","tip","config","setContent","$tip","setElementContent","find","removeClass","cleanupTether","element","getAttribute","call","_jQueryInterface","each","data","_config","test","undefined","Error","Constructor","noConflict","jQuery"],"mappings":";;;;;;;;;;AAGA;;;;;;;AAOA,IAAMA,UAAW,UAACC,CAAD,EAAO;;AAGtB;;;;;;AAMA,MAAMC,OAAsB,SAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,YAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,qBAAsBL,EAAEM,EAAF,CAAKL,IAAL,CAA5B;;AAEA,MAAMM,UAAU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0BA+DC;AACnB,eAAOlC,OAAP;AACD;AAjEmB;AAAA;AAAA,0BAmEC;AACnB,eAAOK,OAAP;AACD;AArEmB;AAAA;AAAA,0BAuEF;AAChB,eAAON,IAAP;AACD;AAzEmB;AAAA;AAAA,0BA2EE;AACpB,eAAOE,QAAP;AACD;AA7EmB;AAAA;AAAA,0BA+ED;AACjB,eAAOkB,KAAP;AACD;AAjFmB;AAAA;AAAA,0BAmFG;AACrB,eAAOjB,SAAP;AACD;AArFmB;AAAA;AAAA,0BAuFK;AACvB,eAAOU,WAAP;AACD;AAzFmB;;AAAA;AAAA,IA0DAL,OA1DA;;AAuJtB;;;;;;AAMAT,IAAEM,EAAF,CAAKL,IAAL,IAAyBF,QAAQ+C,gBAAjC;AACA9C,IAAEM,EAAF,CAAKL,IAAL,EAAWoD,WAAX,GAAyBtD,OAAzB;AACAC,IAAEM,EAAF,CAAKL,IAAL,EAAWqD,UAAX,GAAyB,YAAY;AACnCtD,MAAEM,EAAF,CAAKL,IAAL,IAAaI,kBAAb;AACA,WAAON,QAAQ+C,gBAAf;AACD,GAHD;;AAKA,SAAO/C,OAAP;AAED,CAtKe,CAsKbwD,MAtKa,CAAhB","file":"popover.js","sourcesContent":["import Tooltip from './tooltip'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Popover = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'popover'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.popover'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Default = $.extend({}, Tooltip.Default, {\n placement : 'right',\n trigger : 'click',\n content : '',\n template : '<div class=\"popover\" role=\"tooltip\">'\n + '<h3 class=\"popover-title\"></h3>'\n + '<div class=\"popover-content\"></div></div>'\n })\n\n const DefaultType = $.extend({}, Tooltip.DefaultType, {\n content : '(string|element|function)'\n })\n\n const ClassName = {\n FADE : 'fade',\n SHOW : 'show'\n }\n\n const Selector = {\n TITLE : '.popover-title',\n CONTENT : '.popover-content'\n }\n\n const Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n INSERTED : `inserted${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n FOCUSOUT : `focusout${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Popover extends Tooltip {\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get DATA_KEY() {\n return DATA_KEY\n }\n\n static get Event() {\n return Event\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n\n // overrides\n\n isWithContent() {\n return this.getTitle() || this._getContent()\n }\n\n getTipElement() {\n return this.tip = this.tip || $(this.config.template)[0]\n }\n\n setContent() {\n const $tip = $(this.getTipElement())\n\n // we use append for html objects to maintain js events\n this.setElementContent($tip.find(Selector.TITLE), this.getTitle())\n this.setElementContent($tip.find(Selector.CONTENT), this._getContent())\n\n $tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)\n\n this.cleanupTether()\n }\n\n // private\n\n _getContent() {\n return this.element.getAttribute('data-content')\n || (typeof this.config.content === 'function' ?\n this.config.content.call(this.element) :\n this.config.content)\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' ? config : null\n\n if (!data && /destroy|hide/.test(config)) {\n return\n }\n\n if (!data) {\n data = new Popover(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Popover._jQueryInterface\n $.fn[NAME].Constructor = Popover\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Popover._jQueryInterface\n }\n\n return Popover\n\n})(jQuery)\n\nexport default Popover\n"]}
\ No newline at end of file +{"version":3,"sources":["../src/popover.js"],"names":["Popover","$","NAME","VERSION","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","fn","CLASS_PREFIX","BSCLS_PREFIX_REGEX","RegExp","Default","extend","Tooltip","placement","trigger","content","template","DefaultType","ClassName","FADE","SHOW","Selector","TITLE","CONTENT","Event","HIDE","HIDDEN","SHOWN","INSERTED","CLICK","FOCUSIN","FOCUSOUT","MOUSEENTER","MOUSELEAVE","isWithContent","getTitle","_getContent","addAttachmentClass","attachment","getTipElement","addClass","tip","config","setContent","$tip","setElementContent","find","removeClass","element","getAttribute","call","_cleanTipClass","tabClass","attr","match","length","join","_jQueryInterface","each","data","_config","test","undefined","Error","Constructor","noConflict","jQuery"],"mappings":";;;;;;;;;;AAGA;;;;;;;AAOA,IAAMA,UAAW,UAACC,CAAD,EAAO;;AAGtB;;;;;;AAMA,MAAMC,OAAsB,SAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,YAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,qBAAsBL,EAAEM,EAAF,CAAKL,IAAL,CAA5B;AACA,MAAMM,eAAsB,YAA5B;AACA,MAAMC,qBAAqB,IAAIC,MAAJ,aAAqBF,YAArB,WAAyC,GAAzC,CAA3B;;AAEA,MAAM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js","sourcesContent":["import Tooltip from './tooltip'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Popover = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'popover'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.popover'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const CLASS_PREFIX = 'bs-popover'\n const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\\\s)${CLASS_PREFIX}\\\\S+`, 'g')\n\n const Default = $.extend({}, Tooltip.Default, {\n placement : 'right',\n trigger : 'click',\n content : '',\n template : '<div class=\"popover\" role=\"tooltip\">'\n + '<div class=\"arrow\"></div>'\n + '<h3 class=\"popover-title\"></h3>'\n + '<div class=\"popover-content\"></div></div>'\n })\n\n const DefaultType = $.extend({}, Tooltip.DefaultType, {\n content : '(string|element|function)'\n })\n\n const ClassName = {\n FADE : 'fade',\n SHOW : 'show'\n }\n\n const Selector = {\n TITLE : '.popover-title',\n CONTENT : '.popover-content'\n }\n\n const Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n INSERTED : `inserted${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n FOCUSOUT : `focusout${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Popover extends Tooltip {\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get DATA_KEY() {\n return DATA_KEY\n }\n\n static get Event() {\n return Event\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n\n // overrides\n\n isWithContent() {\n return this.getTitle() || this._getContent()\n }\n\n addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(`${CLASS_PREFIX}-${attachment}`)\n }\n\n getTipElement() {\n return this.tip = this.tip || $(this.config.template)[0]\n }\n\n setContent() {\n const $tip = $(this.getTipElement())\n\n // we use append for html objects to maintain js events\n this.setElementContent($tip.find(Selector.TITLE), this.getTitle())\n this.setElementContent($tip.find(Selector.CONTENT), this._getContent())\n\n $tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)\n }\n\n // private\n\n _getContent() {\n return this.element.getAttribute('data-content')\n || (typeof this.config.content === 'function' ?\n this.config.content.call(this.element) :\n this.config.content)\n }\n\n _cleanTipClass() {\n const $tip = $(this.getTipElement())\n const tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX)\n if (tabClass !== null && tabClass.length > 0) {\n $tip.removeClass(tabClass.join(''))\n }\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' ? config : null\n\n if (!data && /destroy|hide/.test(config)) {\n return\n }\n\n if (!data) {\n data = new Popover(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Popover._jQueryInterface\n $.fn[NAME].Constructor = Popover\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Popover._jQueryInterface\n }\n\n return Popover\n\n})(jQuery)\n\nexport default Popover\n"]}
\ No newline at end of file diff --git a/js/dist/tab.js b/js/dist/tab.js index 079f98a638..fb0749ed54 100644 --- a/js/dist/tab.js +++ b/js/dist/tab.js @@ -129,7 +129,7 @@ var Tab = function ($) { }; Tab.prototype.dispose = function dispose() { - $.removeClass(this._element, DATA_KEY); + $.removeData(this._element, DATA_KEY); this._element = null; }; diff --git a/js/dist/tab.js.map b/js/dist/tab.js.map index 80117e0267..7e0d8179d9 100644 --- a/js/dist/tab.js.map +++ b/js/dist/tab.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/tab.js"],"names":["Tab","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","TRANSITION_DURATION","Event","HIDE","HIDDEN","SHOW","SHOWN","CLICK_DATA_API","ClassName","DROPDOWN_MENU","ACTIVE","DISABLED","FADE","Selector","DROPDOWN","NAV_LIST_GROUP","DATA_TOGGLE","DROPDOWN_TOGGLE","DROPDOWN_ACTIVE_CHILD","element","_element","show","parentNode","nodeType","Node","ELEMENT_NODE","hasClass","target","previous","listElement","closest","selector","Util","getSelectorFromElement","makeArray","find","length","hideEvent","relatedTarget","showEvent","trigger","isDefaultPrevented","_activate","complete","hiddenEvent","shownEvent","dispose","removeClass","container","callback","active","isTransitioning","supportsTransitionEnd","_transitionComplete","one","TRANSITION_END","emulateTransitionEnd","dropdownChild","setAttribute","addClass","reflow","dropdownElement","_jQueryInterface","config","each","$this","data","undefined","Error","document","on","event","preventDefault","call","Constructor","noConflict","jQuery"],"mappings":";;;;AAGA;;;;;;;AAOA,IAAMA,MAAO,UAACC,CAAD,EAAO;;AAGlB;;;;;;AAMA,MAAMC,OAAsB,KAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,QAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,eAAsB,WAA5B;AACA,MAAMC,qBAAsBN,EAAEO,EAAF,CAAKN,IAAL,CAA5B;AACA,MAAMO,sBAAsB,GAA5B;;AAEA,MA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ACDG,eAAKH,MAAL;AACD;AACF,OAfM,CAAP;AAgBD,KAnOe;;AAAA;AAAA;AAAA,0BA0DK;AACnB,eAAOpE,OAAP;AACD;AA5De;;AAAA;AAAA;;AAwOlB;;;;;;AAMAF,IAAE4E,QAAF,EACGC,EADH,CACMpE,MAAMK,cADZ,EAC4BM,SAASG,WADrC,EACkD,UAAUuD,KAAV,EAAiB;AAC/DA,UAAMC,cAAN;AACAhF,QAAIsE,gBAAJ,CAAqBW,IAArB,CAA0BhF,EAAE,IAAF,CAA1B,EAAmC,MAAnC;AACD,GAJH;;AAOA;;;;;;AAMAA,IAAEO,EAAF,CAAKN,IAAL,IAAyBF,IAAIsE,gBAA7B;AACArE,IAAEO,EAAF,CAAKN,IAAL,EAAWgF,WAAX,GAAyBlF,GAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWiF,UAAX,GAAyB,YAAY;AACnClF,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,IAAIsE,gBAAX;AACD,GAHD;;AAKA,SAAOtE,GAAP;AAED,CApQW,CAoQToF,MApQS,CAAZ","file":"tab.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): tab.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Tab = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'tab'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.tab'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 150\n\n const Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n DROPDOWN_MENU : 'dropdown-menu',\n ACTIVE : 'active',\n DISABLED : 'disabled',\n FADE : 'fade',\n SHOW : 'show'\n }\n\n const Selector = {\n DROPDOWN : '.dropdown',\n NAV_LIST_GROUP : '.nav, .list-group',\n ACTIVE : '.active',\n DATA_TOGGLE : '[data-toggle=\"tab\"], [data-toggle=\"pill\"], [data-toggle=\"list\"]',\n DROPDOWN_TOGGLE : '.dropdown-toggle',\n DROPDOWN_ACTIVE_CHILD : '> .dropdown-menu .active'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Tab {\n\n constructor(element) {\n this._element = element\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n\n // public\n\n show() {\n if (this._element.parentNode &&\n this._element.parentNode.nodeType === Node.ELEMENT_NODE &&\n $(this._element).hasClass(ClassName.ACTIVE) ||\n $(this._element).hasClass(ClassName.DISABLED)) {\n return\n }\n\n let target\n let previous\n const listElement = $(this._element).closest(Selector.NAV_LIST_GROUP)[0]\n const selector = Util.getSelectorFromElement(this._element)\n\n if (listElement) {\n previous = $.makeArray($(listElement).find(Selector.ACTIVE))\n previous = previous[previous.length - 1]\n }\n\n const hideEvent = $.Event(Event.HIDE, {\n relatedTarget: this._element\n })\n\n const showEvent = $.Event(Event.SHOW, {\n relatedTarget: previous\n })\n\n if (previous) {\n $(previous).trigger(hideEvent)\n }\n\n $(this._element).trigger(showEvent)\n\n if (showEvent.isDefaultPrevented() ||\n hideEvent.isDefaultPrevented()) {\n return\n }\n\n if (selector) {\n target = $(selector)[0]\n }\n\n this._activate(\n this._element,\n listElement\n )\n\n const complete = () => {\n const hiddenEvent = $.Event(Event.HIDDEN, {\n relatedTarget: this._element\n })\n\n const shownEvent = $.Event(Event.SHOWN, {\n relatedTarget: previous\n })\n\n $(previous).trigger(hiddenEvent)\n $(this._element).trigger(shownEvent)\n }\n\n if (target) {\n this._activate(target, target.parentNode, complete)\n } else {\n complete()\n }\n }\n\n dispose() {\n $.removeClass(this._element, DATA_KEY)\n this._element = null\n }\n\n\n // private\n\n _activate(element, container, callback) {\n const active = $(container).find(Selector.ACTIVE)[0]\n const isTransitioning = callback\n && Util.supportsTransitionEnd()\n && (active && $(active).hasClass(ClassName.FADE))\n\n const complete = () => this._transitionComplete(\n element,\n active,\n isTransitioning,\n callback\n )\n\n if (active && isTransitioning) {\n $(active)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(TRANSITION_DURATION)\n\n } else {\n complete()\n }\n\n if (active) {\n $(active).removeClass(ClassName.SHOW)\n }\n }\n\n _transitionComplete(element, active, isTransitioning, callback) {\n if (active) {\n $(active).removeClass(ClassName.ACTIVE)\n\n const dropdownChild = $(active.parentNode).find(\n Selector.DROPDOWN_ACTIVE_CHILD\n )[0]\n\n if (dropdownChild) {\n $(dropdownChild).removeClass(ClassName.ACTIVE)\n }\n\n active.setAttribute('aria-expanded', false)\n }\n\n $(element).addClass(ClassName.ACTIVE)\n element.setAttribute('aria-expanded', true)\n\n if (isTransitioning) {\n Util.reflow(element)\n $(element).addClass(ClassName.SHOW)\n } else {\n $(element).removeClass(ClassName.FADE)\n }\n\n if (element.parentNode &&\n $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {\n\n const dropdownElement = $(element).closest(Selector.DROPDOWN)[0]\n if (dropdownElement) {\n $(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE)\n }\n\n element.setAttribute('aria-expanded', true)\n }\n\n if (callback) {\n callback()\n }\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $this = $(this)\n let data = $this.data(DATA_KEY)\n\n if (!data) {\n data = new Tab(this)\n $this.data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault()\n Tab._jQueryInterface.call($(this), 'show')\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Tab._jQueryInterface\n $.fn[NAME].Constructor = Tab\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Tab._jQueryInterface\n }\n\n return Tab\n\n})(jQuery)\n\nexport default Tab\n"]}
\ No newline at end of file +{"version":3,"sources":["../src/tab.js"],"names":["Tab","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","TRANSITION_DURATION","Event","HIDE","HIDDEN","SHOW","SHOWN","CLICK_DATA_API","ClassName","DROPDOWN_MENU","ACTIVE","DISABLED","FADE","Selector","DROPDOWN","NAV_LIST_GROUP","DATA_TOGGLE","DROPDOWN_TOGGLE","DROPDOWN_ACTIVE_CHILD","element","_element","show","parentNode","nodeType","Node","ELEMENT_NODE","hasClass","target","previous","listElement","closest","selector","Util","getSelectorFromElement","makeArray","find","length","hideEvent","relatedTarget","showEvent","trigger","isDefaultPrevented","_activate","complete","hiddenEvent","shownEvent","dispose","removeData","container","callback","active","isTransitioning","supportsTransitionEnd","_transitionComplete","one","TRANSITION_END","emulateTransitionEnd","removeClass","dropdownChild","setAttribute","addClass","reflow","dropdownElement","_jQueryInterface","config","each","$this","data","undefined","Error","document","on","event","preventDefault","call","Constructor","noConflict","jQuery"],"mappings":";;;;AAGA;;;;;;;AAOA,IAAMA,MAAO,UAACC,CAAD,EAAO;;AAGlB;;;;;;AAMA,MAAMC,OAAsB,KAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,QAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,eAAsB,WAA5B;AACA,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,MAAL,MAAiBI,SAArB,EAAgC;AAC9B,kBAAM,IAAIC,KAAJ,uBAA8BL,MAA9B,OAAN;AACD;AACDG,eAAKH,MAAL;AACD;AACF,OAfM,CAAP;AAgBD,KAnOe;;AAAA;AAAA;AAAA,0BA0DK;AACnB,eAAOrE,OAAP;AACD;AA5De;;AAAA;AAAA;;AAwOlB;;;;;;AAMAF,IAAE6E,QAAF,EACGC,EADH,CACMrE,MAAMK,cADZ,EAC4BM,SAASG,WADrC,EACkD,UAAUwD,KAAV,EAAiB;AAC/DA,UAAMC,cAAN;AACAjF,QAAIuE,gBAAJ,CAAqBW,IAArB,CAA0BjF,EAAE,IAAF,CAA1B,EAAmC,MAAnC;AACD,GAJH;;AAOA;;;;;;AAMAA,IAAEO,EAAF,CAAKN,IAAL,IAAyBF,IAAIuE,gBAA7B;AACAtE,IAAEO,EAAF,CAAKN,IAAL,EAAWiF,WAAX,GAAyBnF,GAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWkF,UAAX,GAAyB,YAAY;AACnCnF,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,IAAIuE,gBAAX;AACD,GAHD;;AAKA,SAAOvE,GAAP;AAED,CApQW,CAoQTqF,MApQS,CAAZ","file":"tab.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): tab.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Tab = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'tab'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.tab'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 150\n\n const Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n DROPDOWN_MENU : 'dropdown-menu',\n ACTIVE : 'active',\n DISABLED : 'disabled',\n FADE : 'fade',\n SHOW : 'show'\n }\n\n const Selector = {\n DROPDOWN : '.dropdown',\n NAV_LIST_GROUP : '.nav, .list-group',\n ACTIVE : '.active',\n DATA_TOGGLE : '[data-toggle=\"tab\"], [data-toggle=\"pill\"], [data-toggle=\"list\"]',\n DROPDOWN_TOGGLE : '.dropdown-toggle',\n DROPDOWN_ACTIVE_CHILD : '> .dropdown-menu .active'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Tab {\n\n constructor(element) {\n this._element = element\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n\n // public\n\n show() {\n if (this._element.parentNode &&\n this._element.parentNode.nodeType === Node.ELEMENT_NODE &&\n $(this._element).hasClass(ClassName.ACTIVE) ||\n $(this._element).hasClass(ClassName.DISABLED)) {\n return\n }\n\n let target\n let previous\n const listElement = $(this._element).closest(Selector.NAV_LIST_GROUP)[0]\n const selector = Util.getSelectorFromElement(this._element)\n\n if (listElement) {\n previous = $.makeArray($(listElement).find(Selector.ACTIVE))\n previous = previous[previous.length - 1]\n }\n\n const hideEvent = $.Event(Event.HIDE, {\n relatedTarget: this._element\n })\n\n const showEvent = $.Event(Event.SHOW, {\n relatedTarget: previous\n })\n\n if (previous) {\n $(previous).trigger(hideEvent)\n }\n\n $(this._element).trigger(showEvent)\n\n if (showEvent.isDefaultPrevented() ||\n hideEvent.isDefaultPrevented()) {\n return\n }\n\n if (selector) {\n target = $(selector)[0]\n }\n\n this._activate(\n this._element,\n listElement\n )\n\n const complete = () => {\n const hiddenEvent = $.Event(Event.HIDDEN, {\n relatedTarget: this._element\n })\n\n const shownEvent = $.Event(Event.SHOWN, {\n relatedTarget: previous\n })\n\n $(previous).trigger(hiddenEvent)\n $(this._element).trigger(shownEvent)\n }\n\n if (target) {\n this._activate(target, target.parentNode, complete)\n } else {\n complete()\n }\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n\n // private\n\n _activate(element, container, callback) {\n const active = $(container).find(Selector.ACTIVE)[0]\n const isTransitioning = callback\n && Util.supportsTransitionEnd()\n && (active && $(active).hasClass(ClassName.FADE))\n\n const complete = () => this._transitionComplete(\n element,\n active,\n isTransitioning,\n callback\n )\n\n if (active && isTransitioning) {\n $(active)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(TRANSITION_DURATION)\n\n } else {\n complete()\n }\n\n if (active) {\n $(active).removeClass(ClassName.SHOW)\n }\n }\n\n _transitionComplete(element, active, isTransitioning, callback) {\n if (active) {\n $(active).removeClass(ClassName.ACTIVE)\n\n const dropdownChild = $(active.parentNode).find(\n Selector.DROPDOWN_ACTIVE_CHILD\n )[0]\n\n if (dropdownChild) {\n $(dropdownChild).removeClass(ClassName.ACTIVE)\n }\n\n active.setAttribute('aria-expanded', false)\n }\n\n $(element).addClass(ClassName.ACTIVE)\n element.setAttribute('aria-expanded', true)\n\n if (isTransitioning) {\n Util.reflow(element)\n $(element).addClass(ClassName.SHOW)\n } else {\n $(element).removeClass(ClassName.FADE)\n }\n\n if (element.parentNode &&\n $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {\n\n const dropdownElement = $(element).closest(Selector.DROPDOWN)[0]\n if (dropdownElement) {\n $(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE)\n }\n\n element.setAttribute('aria-expanded', true)\n }\n\n if (callback) {\n callback()\n }\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $this = $(this)\n let data = $this.data(DATA_KEY)\n\n if (!data) {\n data = new Tab(this)\n $this.data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault()\n Tab._jQueryInterface.call($(this), 'show')\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Tab._jQueryInterface\n $.fn[NAME].Constructor = Tab\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Tab._jQueryInterface\n }\n\n return Tab\n\n})(jQuery)\n\nexport default Tab\n"]}
\ No newline at end of file diff --git a/js/dist/tooltip.js b/js/dist/tooltip.js index af385927ff..75d4c38f34 100644 --- a/js/dist/tooltip.js +++ b/js/dist/tooltip.js @@ -14,11 +14,11 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons var Tooltip = function ($) { /** - * Check for Tether dependency - * Tether - http://tether.io/ + * Check for Popper dependency + * Popper - https://popper.js.org */ - if (typeof Tether === 'undefined') { - throw new Error('Bootstrap tooltips require Tether (http://tether.io/)'); + if (typeof Popper === 'undefined') { + throw new Error('Bootstrap tooltips require Popper.js (https://popper.js.org)'); } /** @@ -33,22 +33,8 @@ var Tooltip = function ($) { var EVENT_KEY = '.' + DATA_KEY; var JQUERY_NO_CONFLICT = $.fn[NAME]; var TRANSITION_DURATION = 150; - var CLASS_PREFIX = 'bs-tether'; - var TETHER_PREFIX_REGEX = new RegExp('(^|\\s)' + CLASS_PREFIX + '\\S+', 'g'); - - var Default = { - animation: true, - template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-inner"></div></div>', - trigger: 'hover focus', - title: '', - delay: 0, - html: false, - selector: false, - placement: 'top', - offset: '0 0', - constraints: [], - container: false - }; + var CLASS_PREFIX = 'bs-tooltip'; + var BSCLS_PREFIX_REGEX = new RegExp('(^|\\s)' + CLASS_PREFIX + '\\S+', 'g'); var DefaultType = { animation: 'boolean', @@ -59,16 +45,30 @@ var Tooltip = function ($) { html: 'boolean', selector: '(string|boolean)', placement: '(string|function)', - offset: 'string', - constraints: 'array', - container: '(string|element|boolean)' + offset: '(number|string)', + container: '(string|element|boolean)', + fallbackPlacement: '(string|array)' }; var AttachmentMap = { - TOP: 'bottom center', - RIGHT: 'middle left', - BOTTOM: 'top center', - LEFT: 'middle right' + TOP: 'top', + RIGHT: 'right', + BOTTOM: 'bottom', + LEFT: 'left' + }; + + var Default = { + animation: true, + template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>', + trigger: 'hover focus', + title: '', + delay: 0, + html: false, + selector: false, + placement: 'top', + offset: 0, + container: false, + fallbackPlacement: 'flip' }; var HoverState = { @@ -99,11 +99,6 @@ var Tooltip = function ($) { TOOLTIP_INNER: '.tooltip-inner' }; - var TetherClass = { - element: false, - enabled: false - }; - var Trigger = { HOVER: 'hover', FOCUS: 'focus', @@ -126,7 +121,7 @@ var Tooltip = function ($) { this._timeout = 0; this._hoverState = ''; this._activeTrigger = {}; - this._tether = null; + this._popper = null; // protected this.element = element; @@ -183,8 +178,6 @@ var Tooltip = function ($) { Tooltip.prototype.dispose = function dispose() { clearTimeout(this._timeout); - this.cleanupTether(); - $.removeData(this.element, this.constructor.DATA_KEY); $(this.element).off(this.constructor.EVENT_KEY); @@ -198,7 +191,10 @@ var Tooltip = function ($) { this._timeout = null; this._hoverState = null; this._activeTrigger = null; - this._tether = null; + if (this._popper !== null) { + this._popper.destroy(); + } + this._popper = null; this.element = null; this.config = null; @@ -237,6 +233,7 @@ var Tooltip = function ($) { var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; var attachment = this._getAttachment(placement); + this.addAttachmentClass(attachment); var container = this.config.container === false ? document.body : $(this.config.container); @@ -248,20 +245,26 @@ var Tooltip = function ($) { $(this.element).trigger(this.constructor.Event.INSERTED); - this._tether = new Tether({ - attachment: attachment, - element: tip, - target: this.element, - classes: TetherClass, - classPrefix: CLASS_PREFIX, - offset: this.config.offset, - constraints: this.config.constraints, - addTargetClasses: false + this._popper = new Popper(this.element, tip, { + placement: attachment, + modifiers: { + offset: { + offset: this.config.offset + }, + flip: { + behavior: this.config.fallbackPlacement + } + }, + onCreate: function onCreate(data) { + if (data.originalPlacement !== data.placement) { + _this._handlePopperPlacementChange(data); + } + }, + onUpdate: function onUpdate(data) { + _this._handlePopperPlacementChange(data); + } }); - Util.reflow(tip); - this._tether.position(); - $(tip).addClass(ClassName.SHOW); // if this is a touch-enabled device we add extra @@ -273,6 +276,9 @@ var Tooltip = function ($) { } var complete = function complete() { + if (_this.config.animation) { + _this._fixTransition(); + } var prevHoverState = _this._hoverState; _this._hoverState = null; @@ -285,10 +291,9 @@ var Tooltip = function ($) { if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) { $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION); - return; + } else { + complete(); } - - complete(); } }; @@ -305,7 +310,9 @@ var Tooltip = function ($) { _this2._cleanTipClass(); _this2.element.removeAttribute('aria-describedby'); $(_this2.element).trigger(_this2.constructor.Event.HIDDEN); - _this2.cleanupTether(); + if (_this2._popper !== null) { + _this2._popper.destroy(); + } if (callback) { callback(); @@ -340,24 +347,30 @@ var Tooltip = function ($) { this._hoverState = ''; }; + Tooltip.prototype.update = function update() { + if (this._popper !== null) { + this._popper.scheduleUpdate(); + } + }; + // protected Tooltip.prototype.isWithContent = function isWithContent() { return Boolean(this.getTitle()); }; + Tooltip.prototype.addAttachmentClass = function addAttachmentClass(attachment) { + $(this.getTipElement()).addClass(CLASS_PREFIX + '-' + attachment); + }; + Tooltip.prototype.getTipElement = function getTipElement() { return this.tip = this.tip || $(this.config.template)[0]; }; Tooltip.prototype.setContent = function setContent() { var $tip = $(this.getTipElement()); - this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle()); - $tip.removeClass(ClassName.FADE + ' ' + ClassName.SHOW); - - this.cleanupTether(); }; Tooltip.prototype.setElementContent = function setElementContent($element, content) { @@ -386,26 +399,12 @@ var Tooltip = function ($) { return title; }; - Tooltip.prototype.cleanupTether = function cleanupTether() { - if (this._tether) { - this._tether.destroy(); - } - }; - // private Tooltip.prototype._getAttachment = function _getAttachment(placement) { return AttachmentMap[placement.toUpperCase()]; }; - Tooltip.prototype._cleanTipClass = function _cleanTipClass() { - var $tip = $(this.getTipElement()); - var tabClass = $tip.attr('class').match(TETHER_PREFIX_REGEX); - if (tabClass !== null && tabClass.length > 0) { - $tip.removeClass(tabClass.join('')); - } - }; - Tooltip.prototype._setListeners = function _setListeners() { var _this3 = this; @@ -566,6 +565,32 @@ var Tooltip = function ($) { return config; }; + Tooltip.prototype._cleanTipClass = function _cleanTipClass() { + var $tip = $(this.getTipElement()); + var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); + if (tabClass !== null && tabClass.length > 0) { + $tip.removeClass(tabClass.join('')); + } + }; + + Tooltip.prototype._handlePopperPlacementChange = function _handlePopperPlacementChange(data) { + this._cleanTipClass(); + this.addAttachmentClass(this._getAttachment(data.placement)); + }; + + Tooltip.prototype._fixTransition = function _fixTransition() { + var tip = this.getTipElement(); + var initConfigAnimation = this.config.animation; + if (tip.getAttribute('x-placement') !== null) { + return; + } + $(tip).removeClass(ClassName.FADE); + this.config.animation = false; + this.hide(); + this.show(); + this.config.animation = initConfigAnimation; + }; + // static Tooltip._jQueryInterface = function _jQueryInterface(config) { @@ -645,5 +670,5 @@ var Tooltip = function ($) { }; return Tooltip; -}(jQuery); /* global Tether */ +}(jQuery); /* global Popper */ //# sourceMappingURL=tooltip.js.map
\ No newline at end of file diff --git a/js/dist/tooltip.js.map b/js/dist/tooltip.js.map index f697512d3a..05299de5af 100644 --- a/js/dist/tooltip.js.map +++ b/js/dist/tooltip.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/tooltip.js"],"names":["Tooltip","$","Tether","Error","NAME","VERSION","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","fn","TRANSITION_DURATION","CLASS_PREFIX","TETHER_PREFIX_REGEX","RegExp","Default","animation","template","trigger","title","delay","html","selector","placement","offset","constraints","container","DefaultType","AttachmentMap","TOP","RIGHT","BOTTOM","LEFT","HoverState","SHOW","OUT","Event","HIDE","HIDDEN","SHOWN","INSERTED","CLICK","FOCUSIN","FOCUSOUT","MOUSEENTER","MOUSELEAVE","ClassName","FADE","Selector","TOOLTIP","TOOLTIP_INNER","TetherClass","element","enabled","Trigger","HOVER","FOCUS","MANUAL","config","_isEnabled","_timeout","_hoverState","_activeTrigger","_tether","_getConfig","tip","_setListeners","enable","disable","toggleEnabled","toggle","event","dataKey","constructor","context","currentTarget","data","_getDelegateConfig","click","_isWithActiveTrigger","_enter","_leave","getTipElement","hasClass","dispose","clearTimeout","cleanupTether","removeData","off","closest","remove","show","css","showEvent","isWithContent","isInTheDom","contains","ownerDocument","documentElement","isDefaultPrevented","tipId","Util","getUID","setAttribute","setContent","addClass","call","attachment","_getAttachment","document","body","appendTo","target","classes","classPrefix","addTargetClasses","reflow","position","children","on","noop","complete","prevHoverState","supportsTransitionEnd","one","TRANSITION_END","emulateTransitionEnd","_TRANSITION_DURATION","hide","callback","hideEvent","parentNode","removeChild","_cleanTipClass","removeAttribute","removeClass","Boolean","getTitle","$tip","setElementContent","find","$element","content","nodeType","jquery","parent","is","empty","append","text","getAttribute","destroy","toUpperCase","tabClass","attr","match","length","join","triggers","split","forEach","eventIn","eventOut","extend","_fixTitle","titleType","type","setTimeout","toString","typeCheckConfig","key","_jQueryInterface","each","_config","test","undefined","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAKA;;;;;;;AAOA,IAAMA,UAAW,UAACC,CAAD,EAAO;;AAEtB;;;;AAIA,MAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;AACjC,UAAM,IAAIC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AhB,C,CAZA","file":"tooltip.js","sourcesContent":["/* global Tether */\n\nimport Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Tooltip = (($) => {\n\n /**\n * Check for Tether dependency\n * Tether - http://tether.io/\n */\n if (typeof Tether === 'undefined') {\n throw new Error('Bootstrap tooltips require Tether (http://tether.io/)')\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'tooltip'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.tooltip'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 150\n const CLASS_PREFIX = 'bs-tether'\n const TETHER_PREFIX_REGEX = new RegExp(`(^|\\\\s)${CLASS_PREFIX}\\\\S+`, 'g')\n\n const Default = {\n animation : true,\n template : '<div class=\"tooltip\" role=\"tooltip\">'\n + '<div class=\"tooltip-inner\"></div></div>',\n trigger : 'hover focus',\n title : '',\n delay : 0,\n html : false,\n selector : false,\n placement : 'top',\n offset : '0 0',\n constraints : [],\n container : false\n }\n\n const DefaultType = {\n animation : 'boolean',\n template : 'string',\n title : '(string|element|function)',\n trigger : 'string',\n delay : '(number|object)',\n html : 'boolean',\n selector : '(string|boolean)',\n placement : '(string|function)',\n offset : 'string',\n constraints : 'array',\n container : '(string|element|boolean)'\n }\n\n const AttachmentMap = {\n TOP : 'bottom center',\n RIGHT : 'middle left',\n BOTTOM : 'top center',\n LEFT : 'middle right'\n }\n\n const HoverState = {\n SHOW : 'show',\n OUT : 'out'\n }\n\n const Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n INSERTED : `inserted${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n FOCUSOUT : `focusout${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`\n }\n\n const ClassName = {\n FADE : 'fade',\n SHOW : 'show'\n }\n\n const Selector = {\n TOOLTIP : '.tooltip',\n TOOLTIP_INNER : '.tooltip-inner'\n }\n\n const TetherClass = {\n element : false,\n enabled : false\n }\n\n const Trigger = {\n HOVER : 'hover',\n FOCUS : 'focus',\n CLICK : 'click',\n MANUAL : 'manual'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Tooltip {\n\n constructor(element, config) {\n\n // private\n this._isEnabled = true\n this._timeout = 0\n this._hoverState = ''\n this._activeTrigger = {}\n this._tether = null\n\n // protected\n this.element = element\n this.config = this._getConfig(config)\n this.tip = null\n\n this._setListeners()\n\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get DATA_KEY() {\n return DATA_KEY\n }\n\n static get Event() {\n return Event\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n\n // public\n\n enable() {\n this._isEnabled = true\n }\n\n disable() {\n this._isEnabled = false\n }\n\n toggleEnabled() {\n this._isEnabled = !this._isEnabled\n }\n\n toggle(event) {\n if (event) {\n const dataKey = this.constructor.DATA_KEY\n let context = $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n context._activeTrigger.click = !context._activeTrigger.click\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context)\n } else {\n context._leave(null, context)\n }\n\n } else {\n\n if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {\n this._leave(null, this)\n return\n }\n\n this._enter(null, this)\n }\n }\n\n dispose() {\n clearTimeout(this._timeout)\n\n this.cleanupTether()\n\n $.removeData(this.element, this.constructor.DATA_KEY)\n\n $(this.element).off(this.constructor.EVENT_KEY)\n $(this.element).closest('.modal').off('hide.bs.modal')\n\n if (this.tip) {\n $(this.tip).remove()\n }\n\n this._isEnabled = null\n this._timeout = null\n this._hoverState = null\n this._activeTrigger = null\n this._tether = null\n\n this.element = null\n this.config = null\n this.tip = null\n }\n\n show() {\n if ($(this.element).css('display') === 'none') {\n throw new Error('Please use show on visible elements')\n }\n\n const showEvent = $.Event(this.constructor.Event.SHOW)\n if (this.isWithContent() && this._isEnabled) {\n $(this.element).trigger(showEvent)\n\n const isInTheDom = $.contains(\n this.element.ownerDocument.documentElement,\n this.element\n )\n\n if (showEvent.isDefaultPrevented() || !isInTheDom) {\n return\n }\n\n const tip = this.getTipElement()\n const tipId = Util.getUID(this.constructor.NAME)\n\n tip.setAttribute('id', tipId)\n this.element.setAttribute('aria-describedby', tipId)\n\n this.setContent()\n\n if (this.config.animation) {\n $(tip).addClass(ClassName.FADE)\n }\n\n const placement = typeof this.config.placement === 'function' ?\n this.config.placement.call(this, tip, this.element) :\n this.config.placement\n\n const attachment = this._getAttachment(placement)\n\n const container = this.config.container === false ? document.body : $(this.config.container)\n\n $(tip).data(this.constructor.DATA_KEY, this)\n\n if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {\n $(tip).appendTo(container)\n }\n\n $(this.element).trigger(this.constructor.Event.INSERTED)\n\n this._tether = new Tether({\n attachment,\n element : tip,\n target : this.element,\n classes : TetherClass,\n classPrefix : CLASS_PREFIX,\n offset : this.config.offset,\n constraints : this.config.constraints,\n addTargetClasses: false\n })\n\n Util.reflow(tip)\n this._tether.position()\n\n $(tip).addClass(ClassName.SHOW)\n\n // if this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement) {\n $('body').children().on('mouseover', null, $.noop)\n }\n\n const complete = () => {\n const prevHoverState = this._hoverState\n this._hoverState = null\n\n $(this.element).trigger(this.constructor.Event.SHOWN)\n\n if (prevHoverState === HoverState.OUT) {\n this._leave(null, this)\n }\n }\n\n if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {\n $(this.tip)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(Tooltip._TRANSITION_DURATION)\n return\n }\n\n complete()\n }\n }\n\n hide(callback) {\n const tip = this.getTipElement()\n const hideEvent = $.Event(this.constructor.Event.HIDE)\n const complete = () => {\n if (this._hoverState !== HoverState.SHOW && tip.parentNode) {\n tip.parentNode.removeChild(tip)\n }\n\n this._cleanTipClass()\n this.element.removeAttribute('aria-describedby')\n $(this.element).trigger(this.constructor.Event.HIDDEN)\n this.cleanupTether()\n\n if (callback) {\n callback()\n }\n }\n\n $(this.element).trigger(hideEvent)\n\n if (hideEvent.isDefaultPrevented()) {\n return\n }\n\n $(tip).removeClass(ClassName.SHOW)\n\n // if this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n $('body').children().off('mouseover', null, $.noop)\n }\n\n this._activeTrigger[Trigger.CLICK] = false\n this._activeTrigger[Trigger.FOCUS] = false\n this._activeTrigger[Trigger.HOVER] = false\n\n if (Util.supportsTransitionEnd() &&\n $(this.tip).hasClass(ClassName.FADE)) {\n\n $(tip)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(TRANSITION_DURATION)\n\n } else {\n complete()\n }\n\n this._hoverState = ''\n\n }\n\n\n // protected\n\n isWithContent() {\n return Boolean(this.getTitle())\n }\n\n getTipElement() {\n return this.tip = this.tip || $(this.config.template)[0]\n }\n\n setContent() {\n const $tip = $(this.getTipElement())\n\n this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle())\n\n $tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)\n\n this.cleanupTether()\n }\n\n setElementContent($element, content) {\n const html = this.config.html\n if (typeof content === 'object' && (content.nodeType || content.jquery)) {\n // content is a DOM node or a jQuery\n if (html) {\n if (!$(content).parent().is($element)) {\n $element.empty().append(content)\n }\n } else {\n $element.text($(content).text())\n }\n } else {\n $element[html ? 'html' : 'text'](content)\n }\n }\n\n getTitle() {\n let title = this.element.getAttribute('data-original-title')\n\n if (!title) {\n title = typeof this.config.title === 'function' ?\n this.config.title.call(this.element) :\n this.config.title\n }\n\n return title\n }\n\n cleanupTether() {\n if (this._tether) {\n this._tether.destroy()\n }\n }\n\n\n // private\n\n _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()]\n }\n\n _cleanTipClass() {\n const $tip = $(this.getTipElement())\n const tabClass = $tip.attr('class').match(TETHER_PREFIX_REGEX)\n if (tabClass !== null && tabClass.length > 0) {\n $tip.removeClass(tabClass.join(''))\n }\n }\n\n _setListeners() {\n const triggers = this.config.trigger.split(' ')\n\n triggers.forEach((trigger) => {\n if (trigger === 'click') {\n $(this.element).on(\n this.constructor.Event.CLICK,\n this.config.selector,\n (event) => this.toggle(event)\n )\n\n } else if (trigger !== Trigger.MANUAL) {\n const eventIn = trigger === Trigger.HOVER ?\n this.constructor.Event.MOUSEENTER :\n this.constructor.Event.FOCUSIN\n const eventOut = trigger === Trigger.HOVER ?\n this.constructor.Event.MOUSELEAVE :\n this.constructor.Event.FOCUSOUT\n\n $(this.element)\n .on(\n eventIn,\n this.config.selector,\n (event) => this._enter(event)\n )\n .on(\n eventOut,\n this.config.selector,\n (event) => this._leave(event)\n )\n }\n\n $(this.element).closest('.modal').on(\n 'hide.bs.modal',\n () => this.hide()\n )\n })\n\n if (this.config.selector) {\n this.config = $.extend({}, this.config, {\n trigger : 'manual',\n selector : ''\n })\n } else {\n this._fixTitle()\n }\n }\n\n _fixTitle() {\n const titleType = typeof this.element.getAttribute('data-original-title')\n if (this.element.getAttribute('title') ||\n titleType !== 'string') {\n this.element.setAttribute(\n 'data-original-title',\n this.element.getAttribute('title') || ''\n )\n this.element.setAttribute('title', '')\n }\n }\n\n _enter(event, context) {\n const dataKey = this.constructor.DATA_KEY\n\n context = context || $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n if (event) {\n context._activeTrigger[\n event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER\n ] = true\n }\n\n if ($(context.getTipElement()).hasClass(ClassName.SHOW) ||\n context._hoverState === HoverState.SHOW) {\n context._hoverState = HoverState.SHOW\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HoverState.SHOW\n\n if (!context.config.delay || !context.config.delay.show) {\n context.show()\n return\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HoverState.SHOW) {\n context.show()\n }\n }, context.config.delay.show)\n }\n\n _leave(event, context) {\n const dataKey = this.constructor.DATA_KEY\n\n context = context || $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n if (event) {\n context._activeTrigger[\n event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER\n ] = false\n }\n\n if (context._isWithActiveTrigger()) {\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HoverState.OUT\n\n if (!context.config.delay || !context.config.delay.hide) {\n context.hide()\n return\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HoverState.OUT) {\n context.hide()\n }\n }, context.config.delay.hide)\n }\n\n _isWithActiveTrigger() {\n for (const trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true\n }\n }\n\n return false\n }\n\n _getConfig(config) {\n config = $.extend(\n {},\n this.constructor.Default,\n $(this.element).data(),\n config\n )\n\n if (config.delay && typeof config.delay === 'number') {\n config.delay = {\n show : config.delay,\n hide : config.delay\n }\n }\n\n if (config.title && typeof config.title === 'number') {\n config.title = config.title.toString()\n }\n\n if (config.content && typeof config.content === 'number') {\n config.content = config.content.toString()\n }\n\n Util.typeCheckConfig(\n NAME,\n config,\n this.constructor.DefaultType\n )\n\n return config\n }\n\n _getDelegateConfig() {\n const config = {}\n\n if (this.config) {\n for (const key in this.config) {\n if (this.constructor.Default[key] !== this.config[key]) {\n config[key] = this.config[key]\n }\n }\n }\n\n return config\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' && config\n\n if (!data && /dispose|hide/.test(config)) {\n return\n }\n\n if (!data) {\n data = new Tooltip(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Tooltip._jQueryInterface\n $.fn[NAME].Constructor = Tooltip\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Tooltip._jQueryInterface\n }\n\n return Tooltip\n\n})(jQuery)\n\nexport default Tooltip\n"]}
\ No newline at end of file +{"version":3,"sources":["../src/tooltip.js"],"names":["Tooltip","$","Popper","Error","NAME","VERSION","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","fn","TRANSITION_DURATION","CLASS_PREFIX","BSCLS_PREFIX_REGEX","RegExp","DefaultType","animation","template","title","trigger","delay","html","selector","placement","offset","container","fallbackPlacement","AttachmentMap","TOP","RIGHT","BOTTOM","LEFT","Default","HoverState","SHOW","OUT","Event","HIDE","HIDDEN","SHOWN","INSERTED","CLICK","FOCUSIN","FOCUSOUT","MOUSEENTER","MOUSELEAVE","ClassName","FADE","Selector","TOOLTIP","TOOLTIP_INNER","Trigger","HOVER","FOCUS","MANUAL","element","config","_isEnabled","_timeout","_hoverState","_activeTrigger","_popper","_getConfig","tip","_setListeners","enable","disable","toggleEnabled","toggle","event","dataKey","constructor","context","currentTarget","data","_getDelegateConfig","click","_isWithActiveTrigger","_enter","_leave","getTipElement","hasClass","dispose","clearTimeout","removeData","off","closest","remove","destroy","show","css","showEvent","isWithContent","isInTheDom","contains","ownerDocument","documentElement","isDefaultPrevented","tipId","Util","getUID","setAttribute","setContent","addClass","call","attachment","_getAttachment","addAttachmentClass","document","body","appendTo","modifiers","flip","behavior","onCreate","originalPlacement","_handlePopperPlacementChange","onUpdate","children","on","noop","complete","_fixTransition","prevHoverState","supportsTransitionEnd","one","TRANSITION_END","emulateTransitionEnd","_TRANSITION_DURATION","hide","callback","hideEvent","parentNode","removeChild","_cleanTipClass","removeAttribute","removeClass","update","scheduleUpdate","Boolean","getTitle","$tip","setElementContent","find","$element","content","nodeType","jquery","parent","is","empty","append","text","getAttribute","toUpperCase","triggers","split","forEach","eventIn","eventOut","extend","_fixTitle","titleType","type","setTimeout","toString","typeCheckConfig","key","tabClass","attr","match","length","join","initConfigAnimation","_jQueryInterface","each","_config","test","undefined","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAKA;;;;;;;AAOA,IAAMA,UAAW,UAACC,CAAD,EAAO;;AAEtB;;;;AAIA,MAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;AACjC,UAAM,IAAIC,KAAJ,CAAU,8DAAV,CAAN;AACD;;AAGD;;;;;;AAMA,MAAMC,OAAsB,SAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,YAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,qBAAsBP,EAAEQ,EAAF,CAAKL,IAAL,CAA5B;AACA,MAAMM,sBAAsB,GAA5B;AACA,MAAMC,eAAsB,YAA5B;AACA,MAAMC,qBAAqB,IAAIC,MAAJ,aAAqBF,YAArB,WAAyC,GAAzC,CAA3B;;AAEA,MAAMG,cAAc;AAClBC,eAAsB,SADJ;AAElB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D,KAjrBmB;;AAAA;AAAA;AAAA,0BAgIC;AACnB,eAAOlD,OAAP;AACD;AAlImB;AAAA;AAAA,0BAoIC;AACnB,eAAO0B,OAAP;AACD;AAtImB;AAAA;AAAA,0BAwIF;AAChB,eAAO3B,IAAP;AACD;AA1ImB;AAAA;AAAA,0BA4IE;AACpB,eAAOE,QAAP;AACD;AA9ImB;AAAA;AAAA,0BAgJD;AACjB,eAAO6B,KAAP;AACD;AAlJmB;AAAA;AAAA,0BAoJG;AACrB,eAAO5B,SAAP;AACD;AAtJmB;AAAA;AAAA,0BAwJK;AACvB,eAAOO,WAAP;AACD;AA1JmB;;AAAA;AAAA;;AAsrBtB;;;;;;AAMAb,IAAEQ,EAAF,CAAKL,IAAL,IAAyBJ,QAAQ6K,gBAAjC;AACA5K,IAAEQ,EAAF,CAAKL,IAAL,EAAW8K,WAAX,GAAyBlL,OAAzB;AACAC,IAAEQ,EAAF,CAAKL,IAAL,EAAW+K,UAAX,GAAyB,YAAY;AACnClL,MAAEQ,EAAF,CAAKL,IAAL,IAAaI,kBAAb;AACA,WAAOR,QAAQ6K,gBAAf;AACD,GAHD;;AAKA,SAAO7K,OAAP;AAED,CArsBe,CAqsBboL,MArsBa,CAAhB,C,CAZA","file":"tooltip.js","sourcesContent":["/* global Popper */\n\nimport Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Tooltip = (($) => {\n\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper === 'undefined') {\n throw new Error('Bootstrap tooltips require Popper.js (https://popper.js.org)')\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'tooltip'\n const VERSION = '4.0.0-alpha.6'\n const DATA_KEY = 'bs.tooltip'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 150\n const CLASS_PREFIX = 'bs-tooltip'\n const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\\\s)${CLASS_PREFIX}\\\\S+`, 'g')\n\n const DefaultType = {\n animation : 'boolean',\n template : 'string',\n title : '(string|element|function)',\n trigger : 'string',\n delay : '(number|object)',\n html : 'boolean',\n selector : '(string|boolean)',\n placement : '(string|function)',\n offset : '(number|string)',\n container : '(string|element|boolean)',\n fallbackPlacement : '(string|array)'\n }\n\n const AttachmentMap = {\n TOP : 'top',\n RIGHT : 'right',\n BOTTOM : 'bottom',\n LEFT : 'left'\n }\n\n const Default = {\n animation : true,\n template : '<div class=\"tooltip\" role=\"tooltip\">'\n + '<div class=\"arrow\"></div>'\n + '<div class=\"tooltip-inner\"></div></div>',\n trigger : 'hover focus',\n title : '',\n delay : 0,\n html : false,\n selector : false,\n placement : 'top',\n offset : 0,\n container : false,\n fallbackPlacement : 'flip'\n }\n\n const HoverState = {\n SHOW : 'show',\n OUT : 'out'\n }\n\n const Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n INSERTED : `inserted${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n FOCUSOUT : `focusout${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`\n }\n\n const ClassName = {\n FADE : 'fade',\n SHOW : 'show'\n }\n\n const Selector = {\n TOOLTIP : '.tooltip',\n TOOLTIP_INNER : '.tooltip-inner'\n }\n\n const Trigger = {\n HOVER : 'hover',\n FOCUS : 'focus',\n CLICK : 'click',\n MANUAL : 'manual'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Tooltip {\n\n constructor(element, config) {\n\n // private\n this._isEnabled = true\n this._timeout = 0\n this._hoverState = ''\n this._activeTrigger = {}\n this._popper = null\n\n // protected\n this.element = element\n this.config = this._getConfig(config)\n this.tip = null\n\n this._setListeners()\n\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get DATA_KEY() {\n return DATA_KEY\n }\n\n static get Event() {\n return Event\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n\n // public\n\n enable() {\n this._isEnabled = true\n }\n\n disable() {\n this._isEnabled = false\n }\n\n toggleEnabled() {\n this._isEnabled = !this._isEnabled\n }\n\n toggle(event) {\n if (event) {\n const dataKey = this.constructor.DATA_KEY\n let context = $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n context._activeTrigger.click = !context._activeTrigger.click\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context)\n } else {\n context._leave(null, context)\n }\n\n } else {\n\n if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {\n this._leave(null, this)\n return\n }\n\n this._enter(null, this)\n }\n }\n\n dispose() {\n clearTimeout(this._timeout)\n\n $.removeData(this.element, this.constructor.DATA_KEY)\n\n $(this.element).off(this.constructor.EVENT_KEY)\n $(this.element).closest('.modal').off('hide.bs.modal')\n\n if (this.tip) {\n $(this.tip).remove()\n }\n\n this._isEnabled = null\n this._timeout = null\n this._hoverState = null\n this._activeTrigger = null\n if (this._popper !== null) {\n this._popper.destroy()\n }\n this._popper = null\n\n this.element = null\n this.config = null\n this.tip = null\n }\n\n show() {\n if ($(this.element).css('display') === 'none') {\n throw new Error('Please use show on visible elements')\n }\n\n const showEvent = $.Event(this.constructor.Event.SHOW)\n if (this.isWithContent() && this._isEnabled) {\n $(this.element).trigger(showEvent)\n\n const isInTheDom = $.contains(\n this.element.ownerDocument.documentElement,\n this.element\n )\n\n if (showEvent.isDefaultPrevented() || !isInTheDom) {\n return\n }\n\n const tip = this.getTipElement()\n const tipId = Util.getUID(this.constructor.NAME)\n\n tip.setAttribute('id', tipId)\n this.element.setAttribute('aria-describedby', tipId)\n\n this.setContent()\n\n if (this.config.animation) {\n $(tip).addClass(ClassName.FADE)\n }\n\n const placement = typeof this.config.placement === 'function' ?\n this.config.placement.call(this, tip, this.element) :\n this.config.placement\n\n const attachment = this._getAttachment(placement)\n this.addAttachmentClass(attachment)\n\n const container = this.config.container === false ? document.body : $(this.config.container)\n\n $(tip).data(this.constructor.DATA_KEY, this)\n\n if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {\n $(tip).appendTo(container)\n }\n\n $(this.element).trigger(this.constructor.Event.INSERTED)\n\n this._popper = new Popper(this.element, tip, {\n placement : attachment,\n modifiers : {\n offset : {\n offset : this.config.offset\n },\n flip : {\n behavior : this.config.fallbackPlacement\n }\n },\n onCreate : (data) => {\n if (data.originalPlacement !== data.placement) {\n this._handlePopperPlacementChange(data)\n }\n },\n onUpdate : (data) => {\n this._handlePopperPlacementChange(data)\n }\n })\n\n $(tip).addClass(ClassName.SHOW)\n\n // if this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement) {\n $('body').children().on('mouseover', null, $.noop)\n }\n\n const complete = () => {\n if (this.config.animation) {\n this._fixTransition()\n }\n const prevHoverState = this._hoverState\n this._hoverState = null\n\n $(this.element).trigger(this.constructor.Event.SHOWN)\n\n if (prevHoverState === HoverState.OUT) {\n this._leave(null, this)\n }\n }\n\n if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {\n $(this.tip)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(Tooltip._TRANSITION_DURATION)\n } else {\n complete()\n }\n }\n }\n\n hide(callback) {\n const tip = this.getTipElement()\n const hideEvent = $.Event(this.constructor.Event.HIDE)\n const complete = () => {\n if (this._hoverState !== HoverState.SHOW && tip.parentNode) {\n tip.parentNode.removeChild(tip)\n }\n\n this._cleanTipClass()\n this.element.removeAttribute('aria-describedby')\n $(this.element).trigger(this.constructor.Event.HIDDEN)\n if (this._popper !== null) {\n this._popper.destroy()\n }\n\n if (callback) {\n callback()\n }\n }\n\n $(this.element).trigger(hideEvent)\n\n if (hideEvent.isDefaultPrevented()) {\n return\n }\n\n $(tip).removeClass(ClassName.SHOW)\n\n // if this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n $('body').children().off('mouseover', null, $.noop)\n }\n\n this._activeTrigger[Trigger.CLICK] = false\n this._activeTrigger[Trigger.FOCUS] = false\n this._activeTrigger[Trigger.HOVER] = false\n\n if (Util.supportsTransitionEnd() &&\n $(this.tip).hasClass(ClassName.FADE)) {\n\n $(tip)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(TRANSITION_DURATION)\n\n } else {\n complete()\n }\n\n this._hoverState = ''\n\n }\n\n update() {\n if (this._popper !== null) {\n this._popper.scheduleUpdate()\n }\n }\n\n // protected\n\n isWithContent() {\n return Boolean(this.getTitle())\n }\n\n addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(`${CLASS_PREFIX}-${attachment}`)\n }\n\n getTipElement() {\n return this.tip = this.tip || $(this.config.template)[0]\n }\n\n setContent() {\n const $tip = $(this.getTipElement())\n this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle())\n $tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)\n }\n\n setElementContent($element, content) {\n const html = this.config.html\n if (typeof content === 'object' && (content.nodeType || content.jquery)) {\n // content is a DOM node or a jQuery\n if (html) {\n if (!$(content).parent().is($element)) {\n $element.empty().append(content)\n }\n } else {\n $element.text($(content).text())\n }\n } else {\n $element[html ? 'html' : 'text'](content)\n }\n }\n\n getTitle() {\n let title = this.element.getAttribute('data-original-title')\n\n if (!title) {\n title = typeof this.config.title === 'function' ?\n this.config.title.call(this.element) :\n this.config.title\n }\n\n return title\n }\n\n\n // private\n\n _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()]\n }\n\n _setListeners() {\n const triggers = this.config.trigger.split(' ')\n\n triggers.forEach((trigger) => {\n if (trigger === 'click') {\n $(this.element).on(\n this.constructor.Event.CLICK,\n this.config.selector,\n (event) => this.toggle(event)\n )\n\n } else if (trigger !== Trigger.MANUAL) {\n const eventIn = trigger === Trigger.HOVER ?\n this.constructor.Event.MOUSEENTER :\n this.constructor.Event.FOCUSIN\n const eventOut = trigger === Trigger.HOVER ?\n this.constructor.Event.MOUSELEAVE :\n this.constructor.Event.FOCUSOUT\n\n $(this.element)\n .on(\n eventIn,\n this.config.selector,\n (event) => this._enter(event)\n )\n .on(\n eventOut,\n this.config.selector,\n (event) => this._leave(event)\n )\n }\n\n $(this.element).closest('.modal').on(\n 'hide.bs.modal',\n () => this.hide()\n )\n })\n\n if (this.config.selector) {\n this.config = $.extend({}, this.config, {\n trigger : 'manual',\n selector : ''\n })\n } else {\n this._fixTitle()\n }\n }\n\n _fixTitle() {\n const titleType = typeof this.element.getAttribute('data-original-title')\n if (this.element.getAttribute('title') ||\n titleType !== 'string') {\n this.element.setAttribute(\n 'data-original-title',\n this.element.getAttribute('title') || ''\n )\n this.element.setAttribute('title', '')\n }\n }\n\n _enter(event, context) {\n const dataKey = this.constructor.DATA_KEY\n\n context = context || $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n if (event) {\n context._activeTrigger[\n event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER\n ] = true\n }\n\n if ($(context.getTipElement()).hasClass(ClassName.SHOW) ||\n context._hoverState === HoverState.SHOW) {\n context._hoverState = HoverState.SHOW\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HoverState.SHOW\n\n if (!context.config.delay || !context.config.delay.show) {\n context.show()\n return\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HoverState.SHOW) {\n context.show()\n }\n }, context.config.delay.show)\n }\n\n _leave(event, context) {\n const dataKey = this.constructor.DATA_KEY\n\n context = context || $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n if (event) {\n context._activeTrigger[\n event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER\n ] = false\n }\n\n if (context._isWithActiveTrigger()) {\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HoverState.OUT\n\n if (!context.config.delay || !context.config.delay.hide) {\n context.hide()\n return\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HoverState.OUT) {\n context.hide()\n }\n }, context.config.delay.hide)\n }\n\n _isWithActiveTrigger() {\n for (const trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true\n }\n }\n\n return false\n }\n\n _getConfig(config) {\n config = $.extend(\n {},\n this.constructor.Default,\n $(this.element).data(),\n config\n )\n\n if (config.delay && typeof config.delay === 'number') {\n config.delay = {\n show : config.delay,\n hide : config.delay\n }\n }\n\n if (config.title && typeof config.title === 'number') {\n config.title = config.title.toString()\n }\n\n if (config.content && typeof config.content === 'number') {\n config.content = config.content.toString()\n }\n\n Util.typeCheckConfig(\n NAME,\n config,\n this.constructor.DefaultType\n )\n\n return config\n }\n\n _getDelegateConfig() {\n const config = {}\n\n if (this.config) {\n for (const key in this.config) {\n if (this.constructor.Default[key] !== this.config[key]) {\n config[key] = this.config[key]\n }\n }\n }\n\n return config\n }\n\n _cleanTipClass() {\n const $tip = $(this.getTipElement())\n const tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX)\n if (tabClass !== null && tabClass.length > 0) {\n $tip.removeClass(tabClass.join(''))\n }\n }\n\n _handlePopperPlacementChange(data) {\n this._cleanTipClass()\n this.addAttachmentClass(this._getAttachment(data.placement))\n }\n\n _fixTransition() {\n const tip = this.getTipElement()\n const initConfigAnimation = this.config.animation\n if (tip.getAttribute('x-placement') !== null) {\n return\n }\n $(tip).removeClass(ClassName.FADE)\n this.config.animation = false\n this.hide()\n this.show()\n this.config.animation = initConfigAnimation\n }\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' && config\n\n if (!data && /dispose|hide/.test(config)) {\n return\n }\n\n if (!data) {\n data = new Tooltip(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Tooltip._jQueryInterface\n $.fn[NAME].Constructor = Tooltip\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Tooltip._jQueryInterface\n }\n\n return Tooltip\n\n})(jQuery)\n\nexport default Tooltip\n"]}
\ No newline at end of file |