diff options
author | Mark Otto <markdotto@gmail.com> | 2017-09-06 07:05:12 +0300 |
---|---|---|
committer | Mark Otto <markdotto@gmail.com> | 2017-09-06 07:05:12 +0300 |
commit | df47558ef680adf6e80b5e8402837125c41210c0 (patch) | |
tree | fb9cb52d3ed467f73c16140254b18e9733e640ab /js | |
parent | fbd1f52f896c599211c24c5c86d04fbbb3e88165 (diff) |
dist
Diffstat (limited to 'js')
-rw-r--r-- | js/dist/alert.js | 156 | ||||
-rw-r--r-- | js/dist/alert.js.map | 2 | ||||
-rw-r--r-- | js/dist/button.js | 110 | ||||
-rw-r--r-- | js/dist/button.js.map | 2 | ||||
-rw-r--r-- | js/dist/carousel.js | 585 | ||||
-rw-r--r-- | js/dist/carousel.js.map | 2 | ||||
-rw-r--r-- | js/dist/collapse.js | 346 | ||||
-rw-r--r-- | js/dist/collapse.js.map | 2 | ||||
-rw-r--r-- | js/dist/dropdown.js | 447 | ||||
-rw-r--r-- | js/dist/dropdown.js.map | 2 | ||||
-rw-r--r-- | js/dist/index.js | 22 | ||||
-rw-r--r-- | js/dist/index.js.map | 1 | ||||
-rw-r--r-- | js/dist/modal.js | 684 | ||||
-rw-r--r-- | js/dist/modal.js.map | 2 | ||||
-rw-r--r-- | js/dist/popover.js | 118 | ||||
-rw-r--r-- | js/dist/popover.js.map | 2 | ||||
-rw-r--r-- | js/dist/scrollspy.js | 301 | ||||
-rw-r--r-- | js/dist/scrollspy.js.map | 2 | ||||
-rw-r--r-- | js/dist/tab.js | 245 | ||||
-rw-r--r-- | js/dist/tab.js.map | 2 | ||||
-rw-r--r-- | js/dist/tooltip.js | 786 | ||||
-rw-r--r-- | js/dist/tooltip.js.map | 2 | ||||
-rw-r--r-- | js/dist/util.js | 12 | ||||
-rw-r--r-- | js/dist/util.js.map | 2 |
24 files changed, 2030 insertions, 1805 deletions
diff --git a/js/dist/alert.js b/js/dist/alert.js index 0d881dc411..4420d463be 100644 --- a/js/dist/alert.js +++ b/js/dist/alert.js @@ -1,3 +1,5 @@ +'use strict'; + 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"); } } @@ -9,7 +11,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * -------------------------------------------------------------------------- */ -var Alert = function ($) { +var Alert = function () { /** * ------------------------------------------------------------------------ @@ -56,98 +58,110 @@ var Alert = function ($) { // getters - // public - - Alert.prototype.close = function close(element) { - element = element || this._element; + _createClass(Alert, [{ + key: 'close', - var rootElement = this._getRootElement(element); - var customEvent = this._triggerCloseEvent(rootElement); - if (customEvent.isDefaultPrevented()) { - return; - } + // public - this._removeElement(rootElement); - }; + value: function close(element) { + element = element || this._element; - Alert.prototype.dispose = function dispose() { - $.removeData(this._element, DATA_KEY); - this._element = null; - }; + var rootElement = this._getRootElement(element); + var customEvent = this._triggerCloseEvent(rootElement); - // private - - Alert.prototype._getRootElement = function _getRootElement(element) { - var selector = Util.getSelectorFromElement(element); - var parent = false; + if (customEvent.isDefaultPrevented()) { + return; + } - if (selector) { - parent = $(selector)[0]; + this._removeElement(rootElement); } - - if (!parent) { - parent = $(element).closest('.' + ClassName.ALERT)[0]; + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + this._element = null; } - return parent; - }; - - Alert.prototype._triggerCloseEvent = function _triggerCloseEvent(element) { - var closeEvent = $.Event(Event.CLOSE); + // private - $(element).trigger(closeEvent); - return closeEvent; - }; + }, { + key: '_getRootElement', + value: function _getRootElement(element) { + var selector = Util.getSelectorFromElement(element); + var parent = false; - Alert.prototype._removeElement = function _removeElement(element) { - var _this = this; + if (selector) { + parent = $(selector)[0]; + } - $(element).removeClass(ClassName.SHOW); + if (!parent) { + parent = $(element).closest('.' + ClassName.ALERT)[0]; + } - if (!Util.supportsTransitionEnd() || !$(element).hasClass(ClassName.FADE)) { - this._destroyElement(element); - return; + return parent; } + }, { + key: '_triggerCloseEvent', + value: function _triggerCloseEvent(element) { + var closeEvent = $.Event(Event.CLOSE); - $(element).one(Util.TRANSITION_END, function (event) { - return _this._destroyElement(element, event); - }).emulateTransitionEnd(TRANSITION_DURATION); - }; - - Alert.prototype._destroyElement = function _destroyElement(element) { - $(element).detach().trigger(Event.CLOSED).remove(); - }; - - // static + $(element).trigger(closeEvent); + return closeEvent; + } + }, { + key: '_removeElement', + value: function _removeElement(element) { + var _this = this; - Alert._jQueryInterface = function _jQueryInterface(config) { - return this.each(function () { - var $element = $(this); - var data = $element.data(DATA_KEY); + $(element).removeClass(ClassName.SHOW); - if (!data) { - data = new Alert(this); - $element.data(DATA_KEY, data); + if (!Util.supportsTransitionEnd() || !$(element).hasClass(ClassName.FADE)) { + this._destroyElement(element); + return; } - if (config === 'close') { - data[config](this); - } - }); - }; + $(element).one(Util.TRANSITION_END, function (event) { + return _this._destroyElement(element, event); + }).emulateTransitionEnd(TRANSITION_DURATION); + } + }, { + key: '_destroyElement', + value: function _destroyElement(element) { + $(element).detach().trigger(Event.CLOSED).remove(); + } - Alert._handleDismiss = function _handleDismiss(alertInstance) { - return function (event) { - if (event) { - event.preventDefault(); - } + // static + + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + var $element = $(this); + var data = $element.data(DATA_KEY); - alertInstance.close(this); - }; - }; + if (!data) { + data = new Alert(this); + $element.data(DATA_KEY, data); + } - _createClass(Alert, null, [{ + if (config === 'close') { + data[config](this); + } + }); + } + }, { + key: '_handleDismiss', + value: function _handleDismiss(alertInstance) { + return function (event) { + if (event) { + event.preventDefault(); + } + + alertInstance.close(this); + }; + } + }, { key: 'VERSION', get: function get() { return VERSION; diff --git a/js/dist/alert.js.map b/js/dist/alert.js.map index 64fbf2e001..107e588bd4 100644 --- a/js/dist/alert.js.map +++ b/js/dist/alert.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/alert.js"],"names":["Alert","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","TRANSITION_DURATION","Selector","DISMISS","Event","CLOSE","CLOSED","CLICK_DATA_API","ClassName","ALERT","FADE","SHOW","element","_element","close","rootElement","_getRootElement","customEvent","_triggerCloseEvent","isDefaultPrevented","_removeElement","dispose","removeData","selector","Util","getSelectorFromElement","parent","closest","closeEvent","trigger","removeClass","supportsTransitionEnd","hasClass","_destroyElement","one","TRANSITION_END","event","emulateTransitionEnd","detach","remove","_jQueryInterface","config","each","$element","data","_handleDismiss","alertInstance","preventDefault","document","on","Constructor","noConflict","jQuery"],"mappings":";;;;AAGA;;;;;;;AAOA,IAAMA,QAAS,UAACC,CAAD,EAAO;;AAGpB;;;;;;AAMA,MAAMC,OAAsB,OAA5B;AACA,MAAMC,UAAsB,YAA5B;AACA,MAAMC,WAAsB,UAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,eAAsB,WAA5B;AACA,MAAMC,qBAAsBN,EAAEO,EAAF,CAAKN,IAAL,CAA5B;AACA,MAAMO,sBAAsB,GAA5B;;AAEA,MAAMC,WAAW;AACfC,aAAU;AADK,GAAjB;;AAIA,MAAMC,QAAQ;AACZC,qBAAyBR,SADb;AAEZS,uBAA0BT,SAFd;AAGZU,8BAAyBV,SAAzB,GAAqCC;AAHzB,GAAd;;AAMA,MAAMU,YAAY;AAChBC,WAAQ,OADQ;AAEhBC,UAAQ,MAFQ;AAGhBC,UAAQ;;AAIV;;;;;;AAPkB,GAAlB;AA3BoB,MAwCdnB,KAxCc;AA0ClB,mBAAYoB,OAAZ,EAAqB;AAAA;;AACnB,WAAKC,QAAL,GAAgBD,OAAhB;AACD;;AAGD;;AAOA;;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B,IAAIrD,KAAJ,EAArB,CAHF;;AAOA;;;;;;AAMAC,IAAEO,EAAF,CAAKN,IAAL,IAAyBF,MAAMgD,gBAA/B;AACA/C,IAAEO,EAAF,CAAKN,IAAL,EAAWwD,WAAX,GAAyB1D,KAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWyD,UAAX,GAAyB,YAAY;AACnC1D,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,MAAMgD,gBAAb;AACD,GAHD;;AAKA,SAAOhD,KAAP;AAED,CApLa,CAoLX4D,MApLW,CAAd","file":"alert.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Alert = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'alert'\n const VERSION = '4.0.0-beta'\n const DATA_KEY = 'bs.alert'\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 Selector = {\n DISMISS : '[data-dismiss=\"alert\"]'\n }\n\n const Event = {\n CLOSE : `close${EVENT_KEY}`,\n CLOSED : `closed${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n ALERT : 'alert',\n FADE : 'fade',\n SHOW : 'show'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Alert {\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 close(element) {\n element = element || this._element\n\n const rootElement = this._getRootElement(element)\n const customEvent = this._triggerCloseEvent(rootElement)\n\n if (customEvent.isDefaultPrevented()) {\n return\n }\n\n this._removeElement(rootElement)\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n\n // private\n\n _getRootElement(element) {\n const selector = Util.getSelectorFromElement(element)\n let parent = false\n\n if (selector) {\n parent = $(selector)[0]\n }\n\n if (!parent) {\n parent = $(element).closest(`.${ClassName.ALERT}`)[0]\n }\n\n return parent\n }\n\n _triggerCloseEvent(element) {\n const closeEvent = $.Event(Event.CLOSE)\n\n $(element).trigger(closeEvent)\n return closeEvent\n }\n\n _removeElement(element) {\n $(element).removeClass(ClassName.SHOW)\n\n if (!Util.supportsTransitionEnd() ||\n !$(element).hasClass(ClassName.FADE)) {\n this._destroyElement(element)\n return\n }\n\n $(element)\n .one(Util.TRANSITION_END, (event) => this._destroyElement(element, event))\n .emulateTransitionEnd(TRANSITION_DURATION)\n }\n\n _destroyElement(element) {\n $(element)\n .detach()\n .trigger(Event.CLOSED)\n .remove()\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $element = $(this)\n let data = $element.data(DATA_KEY)\n\n if (!data) {\n data = new Alert(this)\n $element.data(DATA_KEY, data)\n }\n\n if (config === 'close') {\n data[config](this)\n }\n })\n }\n\n static _handleDismiss(alertInstance) {\n return function (event) {\n if (event) {\n event.preventDefault()\n }\n\n alertInstance.close(this)\n }\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document).on(\n Event.CLICK_DATA_API,\n Selector.DISMISS,\n Alert._handleDismiss(new Alert())\n )\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Alert._jQueryInterface\n $.fn[NAME].Constructor = Alert\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Alert._jQueryInterface\n }\n\n return Alert\n\n})(jQuery)\n\nexport default Alert\n"]}
\ No newline at end of file +{"version":3,"sources":["../src/alert.js"],"names":["Alert","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","TRANSITION_DURATION","Selector","DISMISS","Event","CLOSE","CLOSED","CLICK_DATA_API","ClassName","ALERT","FADE","SHOW","element","_element","rootElement","_getRootElement","customEvent","_triggerCloseEvent","isDefaultPrevented","_removeElement","removeData","selector","Util","getSelectorFromElement","parent","closest","closeEvent","trigger","removeClass","supportsTransitionEnd","hasClass","_destroyElement","one","TRANSITION_END","event","emulateTransitionEnd","detach","remove","config","each","$element","data","alertInstance","preventDefault","close","document","on","_handleDismiss","_jQueryInterface","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAIA;;;;;;;AAOA,IAAMA,QAAS,YAAM;;AAGnB;;;;;;AAMA,MAAMC,OAAsB,OAA5B;AACA,MAAMC,UAAsB,YAA5B;AACA,MAAMC,WAAsB,UAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,eAAsB,WAA5B;AACA,MAAMC,qBAAsBC,EAAEC,EAAF,CAAKP,IAAL,CAA5B;AACA,MAAMQ,sBAAsB,GAA5B;;AAEA,MAAMC,WAAW;AACfC,aAAU;AADK,GAAjB;;AAIA,MAAMC,QAAQ;AACZC,qBAAyBT,SADb;AAEZU,uBAA0BV,SAFd;AAGZW,8BAAyBX,SAAzB,GAAqCC;AAHzB,GAAd;;AAMA,MAAMW,YAAY;AAChBC,WAAQ,OADQ;AAEhBC,UAAQ,MAFQ;AAGhBC,UAAQ;;AAIV;;;;;;AAPkB,GAAlB;AA3BmB,MAwCbnB,KAxCa;AA0CjB,mBAAYoB,OAAZ,EAAqB;AAAA;;AACnB,WAAKC,QAAL,GAAgBD,OAAhB;AACD;;AAGD;;AA/CiB;AAAA;;;AAsDjB;;AAtDiB,4BAwDXA,OAxDW,EAwDF;AACbA,kBAAUA,WAAW,KAAKC,QAA1B;;AAEA,YAAMC,cAAc,KAAKC,eAAL,CAAqBH,OAArB,CAApB;AACA,YAAMI,cAAc,K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A,WAAON,MAAMwD,gBAAb;AACD,GAHD;;AAKA,SAAOxD,KAAP;AAED,CApLa,CAoLX2D,MApLW,CAAd","file":"alert.js","sourcesContent":["import $ from 'jquery'\nimport Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Alert = (() => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'alert'\n const VERSION = '4.0.0-beta'\n const DATA_KEY = 'bs.alert'\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 Selector = {\n DISMISS : '[data-dismiss=\"alert\"]'\n }\n\n const Event = {\n CLOSE : `close${EVENT_KEY}`,\n CLOSED : `closed${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n ALERT : 'alert',\n FADE : 'fade',\n SHOW : 'show'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Alert {\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 close(element) {\n element = element || this._element\n\n const rootElement = this._getRootElement(element)\n const customEvent = this._triggerCloseEvent(rootElement)\n\n if (customEvent.isDefaultPrevented()) {\n return\n }\n\n this._removeElement(rootElement)\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n\n // private\n\n _getRootElement(element) {\n const selector = Util.getSelectorFromElement(element)\n let parent = false\n\n if (selector) {\n parent = $(selector)[0]\n }\n\n if (!parent) {\n parent = $(element).closest(`.${ClassName.ALERT}`)[0]\n }\n\n return parent\n }\n\n _triggerCloseEvent(element) {\n const closeEvent = $.Event(Event.CLOSE)\n\n $(element).trigger(closeEvent)\n return closeEvent\n }\n\n _removeElement(element) {\n $(element).removeClass(ClassName.SHOW)\n\n if (!Util.supportsTransitionEnd() ||\n !$(element).hasClass(ClassName.FADE)) {\n this._destroyElement(element)\n return\n }\n\n $(element)\n .one(Util.TRANSITION_END, (event) => this._destroyElement(element, event))\n .emulateTransitionEnd(TRANSITION_DURATION)\n }\n\n _destroyElement(element) {\n $(element)\n .detach()\n .trigger(Event.CLOSED)\n .remove()\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $element = $(this)\n let data = $element.data(DATA_KEY)\n\n if (!data) {\n data = new Alert(this)\n $element.data(DATA_KEY, data)\n }\n\n if (config === 'close') {\n data[config](this)\n }\n })\n }\n\n static _handleDismiss(alertInstance) {\n return function (event) {\n if (event) {\n event.preventDefault()\n }\n\n alertInstance.close(this)\n }\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document).on(\n Event.CLICK_DATA_API,\n Selector.DISMISS,\n Alert._handleDismiss(new Alert())\n )\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Alert._jQueryInterface\n $.fn[NAME].Constructor = Alert\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Alert._jQueryInterface\n }\n\n return Alert\n\n})(jQuery)\n\nexport default Alert\n"]}
\ No newline at end of file diff --git a/js/dist/button.js b/js/dist/button.js index 69af9a8ada..21267816d6 100644 --- a/js/dist/button.js +++ b/js/dist/button.js @@ -1,3 +1,5 @@ +'use strict'; + 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"); } } @@ -9,7 +11,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * -------------------------------------------------------------------------- */ -var Button = function ($) { +var Button = function () { /** * ------------------------------------------------------------------------ @@ -58,74 +60,80 @@ var Button = function ($) { // getters - // public + _createClass(Button, [{ + key: 'toggle', + + + // public - Button.prototype.toggle = function toggle() { - var triggerChangeEvent = true; - var addAriaPressed = true; - var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0]; + value: function toggle() { + var triggerChangeEvent = true; + var addAriaPressed = true; + var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0]; - if (rootElement) { - var input = $(this._element).find(Selector.INPUT)[0]; + if (rootElement) { + var input = $(this._element).find(Selector.INPUT)[0]; - if (input) { - if (input.type === 'radio') { - if (input.checked && $(this._element).hasClass(ClassName.ACTIVE)) { - triggerChangeEvent = false; - } else { - var activeElement = $(rootElement).find(Selector.ACTIVE)[0]; + if (input) { + if (input.type === 'radio') { + if (input.checked && $(this._element).hasClass(ClassName.ACTIVE)) { + triggerChangeEvent = false; + } else { + var activeElement = $(rootElement).find(Selector.ACTIVE)[0]; - if (activeElement) { - $(activeElement).removeClass(ClassName.ACTIVE); + if (activeElement) { + $(activeElement).removeClass(ClassName.ACTIVE); + } } } - } - if (triggerChangeEvent) { - if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) { - return; + 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'); } - input.checked = !$(this._element).hasClass(ClassName.ACTIVE); - $(input).trigger('change'); + + input.focus(); + addAriaPressed = false; } + } - input.focus(); - addAriaPressed = false; + if (addAriaPressed) { + this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE)); } - } - if (addAriaPressed) { - this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE)); + if (triggerChangeEvent) { + $(this._element).toggleClass(ClassName.ACTIVE); + } } - - if (triggerChangeEvent) { - $(this._element).toggleClass(ClassName.ACTIVE); + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + this._element = null; } - }; - - Button.prototype.dispose = function dispose() { - $.removeData(this._element, DATA_KEY); - this._element = null; - }; - // static + // static - Button._jQueryInterface = function _jQueryInterface(config) { - return this.each(function () { - var data = $(this).data(DATA_KEY); - - if (!data) { - data = new Button(this); - $(this).data(DATA_KEY, data); - } + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); - if (config === 'toggle') { - data[config](); - } - }); - }; + if (!data) { + data = new Button(this); + $(this).data(DATA_KEY, data); + } - _createClass(Button, null, [{ + if (config === 'toggle') { + data[config](); + } + }); + } + }, { key: 'VERSION', get: function get() { return VERSION; diff --git a/js/dist/button.js.map b/js/dist/button.js.map index f22489cfe8..46ee9bc4e2 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","hasAttribute","classList","contains","trigger","focus","setAttribute","toggleClass","dispose","removeData","_jQueryInterface","config","each","data","document","on","event","preventDefault","button","target","call","test","Constructor","noConflict","jQuery"],"mapp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AWqD,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-beta): 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-beta'\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 +{"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","triggerChangeEvent","addAriaPressed","rootElement","closest","input","find","type","checked","hasClass","activeElement","removeClass","hasAttribute","classList","contains","trigger","focus","setAttribute","toggleClass","removeData","config","each","data","document","on","event","preventDefault","button","target","_jQueryInterface","call","test","Constructor","noConflict","jQuery"],"mappings":";;;;;;AACA;;;;;;;AAOA,IAAMA,SAAU,YAAM;;AAGpB;;;;;;AAMA,MAAMC,OAAsB,QAA5B;AACA,MAAMC,UAAsB,YAA5B;AACA,MAAMC,WAAsB,WAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,eAAsB,WAA5B;AACA,MAAMC,qBAAsBC,EAAEC,EAAF,CAAKP,IAAL,CAA5B;;AAEA,MAAMQ,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,8BAA8Bd,SAA9B,GAA0CC,YAD9B;AAEZc,yBAAsB,UAAQf,SAAR,GAAoBC,YAApB,mBACOD,SADP,GACmBC,YADnB;;AAKxB;;;;;;AAPc,GAAd;AA9BoB,MA2CdL,MA3Cc;AA6ClB,oBAAYoB,OAAZ,EAAqB;AAAA;;AACnB,WAAKC,QAAL,GAAgBD,OAAhB;AACD;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,EAAwC,QAAxC;AACD,GAXH,EAYGH,EAZH,CAYM5B,MAAME,mBAZZ,EAYiCN,SAASC,kBAZ1C,EAY8D,UAACgC,KAAD,EAAW;AACrE,QAAME,SAASzC,EAAEuC,MAAMG,MAAR,EAAgBxB,OAAhB,CAAwBZ,SAASF,MAAjC,EAAyC,CAAzC,CAAf;AACAJ,MAAEyC,MAAF,EAAUT,WAAV,CAAsB9B,UAAUG,KAAhC,EAAuC,eAAewC,IAAf,CAAoBN,MAAMlB,IAA1B,CAAvC;AACD,GAfH;;AAkBA;;;;;;AAMArB,IAAEC,EAAF,CAAKP,IAAL,IAAyBD,OAAOkD,gBAAhC;AACA3C,IAAEC,EAAF,CAAKP,IAAL,EAAWoD,WAAX,GAAyBrD,MAAzB;AACAO,IAAEC,EAAF,CAAKP,IAAL,EAAWqD,UAAX,GAAyB,YAAY;AACnC/C,MAAEC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;AACA,WAAON,OAAOkD,gBAAd;AACD,GAHD;;AAKA,SAAOlD,MAAP;AAED,CAhLc,CAgLZuD,MAhLY,CAAf","file":"button.js","sourcesContent":["import $ from 'jquery'\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): 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-beta'\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/carousel.js b/js/dist/carousel.js index 6001f024f6..d70d03d961 100644 --- a/js/dist/carousel.js +++ b/js/dist/carousel.js @@ -1,3 +1,5 @@ +'use strict'; + 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; }; }(); @@ -11,7 +13,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * -------------------------------------------------------------------------- */ -var Carousel = function ($) { +var Carousel = function () { /** * ------------------------------------------------------------------------ @@ -113,360 +115,381 @@ var Carousel = function ($) { // getters - // public + _createClass(Carousel, [{ + key: 'next', - Carousel.prototype.next = function next() { - if (!this._isSliding) { - this._slide(Direction.NEXT); - } - }; - Carousel.prototype.nextWhenVisible = function nextWhenVisible() { - // Don't call next when the page isn't visible - // or the carousel or its parent isn't visible - if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') { - this.next(); - } - }; + // public - Carousel.prototype.prev = function prev() { - if (!this._isSliding) { - this._slide(Direction.PREV); + value: function next() { + if (!this._isSliding) { + this._slide(Direction.NEXT); + } } - }; - - Carousel.prototype.pause = function pause(event) { - if (!event) { - this._isPaused = true; + }, { + key: 'nextWhenVisible', + value: function nextWhenVisible() { + // Don't call next when the page isn't visible + // or the carousel or its parent isn't visible + if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') { + this.next(); + } } - - if ($(this._element).find(Selector.NEXT_PREV)[0] && Util.supportsTransitionEnd()) { - Util.triggerTransitionEnd(this._element); - this.cycle(true); + }, { + key: 'prev', + value: function prev() { + if (!this._isSliding) { + this._slide(Direction.PREV); + } } + }, { + key: 'pause', + value: function pause(event) { + if (!event) { + this._isPaused = true; + } - clearInterval(this._interval); - this._interval = null; - }; - - Carousel.prototype.cycle = function cycle(event) { - if (!event) { - this._isPaused = false; - } + if ($(this._element).find(Selector.NEXT_PREV)[0] && Util.supportsTransitionEnd()) { + Util.triggerTransitionEnd(this._element); + this.cycle(true); + } - if (this._interval) { clearInterval(this._interval); this._interval = null; } + }, { + key: 'cycle', + value: function cycle(event) { + if (!event) { + this._isPaused = false; + } - if (this._config.interval && !this._isPaused) { - this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); - } - }; - - Carousel.prototype.to = function to(index) { - var _this = this; - - this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]; - - var activeIndex = this._getItemIndex(this._activeElement); - - if (index > this._items.length - 1 || index < 0) { - return; - } + if (this._interval) { + clearInterval(this._interval); + this._interval = null; + } - if (this._isSliding) { - $(this._element).one(Event.SLID, function () { - return _this.to(index); - }); - return; + if (this._config.interval && !this._isPaused) { + this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); + } } + }, { + key: 'to', + value: function to(index) { + var _this = this; - if (activeIndex === index) { - this.pause(); - this.cycle(); - return; - } + this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]; - var direction = index > activeIndex ? Direction.NEXT : Direction.PREV; + var activeIndex = this._getItemIndex(this._activeElement); - this._slide(direction, this._items[index]); - }; + if (index > this._items.length - 1 || index < 0) { + return; + } - Carousel.prototype.dispose = function dispose() { - $(this._element).off(EVENT_KEY); - $.removeData(this._element, DATA_KEY); + if (this._isSliding) { + $(this._element).one(Event.SLID, function () { + return _this.to(index); + }); + return; + } - this._items = null; - this._config = null; - this._element = null; - this._interval = null; - this._isPaused = null; - this._isSliding = null; - this._activeElement = null; - this._indicatorsElement = null; - }; + if (activeIndex === index) { + this.pause(); + this.cycle(); + return; + } - // private + var direction = index > activeIndex ? Direction.NEXT : Direction.PREV; - Carousel.prototype._getConfig = function _getConfig(config) { - config = $.extend({}, Default, config); - Util.typeCheckConfig(NAME, config, DefaultType); - return config; - }; + this._slide(direction, this._items[index]); + } + }, { + key: 'dispose', + value: function dispose() { + $(this._element).off(EVENT_KEY); + $.removeData(this._element, DATA_KEY); + + this._items = null; + this._config = null; + this._element = null; + this._interval = null; + this._isPaused = null; + this._isSliding = null; + this._activeElement = null; + this._indicatorsElement = null; + } - Carousel.prototype._addEventListeners = function _addEventListeners() { - var _this2 = this; + // private - if (this._config.keyboard) { - $(this._element).on(Event.KEYDOWN, function (event) { - return _this2._keydown(event); - }); + }, { + key: '_getConfig', + value: function _getConfig(config) { + config = $.extend({}, Default, config); + Util.typeCheckConfig(NAME, config, DefaultType); + return config; } + }, { + key: '_addEventListeners', + value: function _addEventListeners() { + var _this2 = this; - if (this._config.pause === 'hover') { - $(this._element).on(Event.MOUSEENTER, function (event) { - return _this2.pause(event); - }).on(Event.MOUSELEAVE, function (event) { - return _this2.cycle(event); - }); - if ('ontouchstart' in document.documentElement) { - // if it's a touch-enabled device, mouseenter/leave are fired as - // part of the mouse compatibility events on first tap - the carousel - // would stop cycling until user tapped out of it; - // here, we listen for touchend, explicitly pause the carousel - // (as if it's the second time we tap on it, mouseenter compat event - // is NOT fired) and after a timeout (to allow for mouse compatibility - // events to fire) we explicitly restart cycling - $(this._element).on(Event.TOUCHEND, function () { - _this2.pause(); - if (_this2.touchTimeout) { - clearTimeout(_this2.touchTimeout); - } - _this2.touchTimeout = setTimeout(function (event) { - return _this2.cycle(event); - }, TOUCHEVENT_COMPAT_WAIT + _this2._config.interval); + if (this._config.keyboard) { + $(this._element).on(Event.KEYDOWN, function (event) { + return _this2._keydown(event); }); } - } - }; - Carousel.prototype._keydown = function _keydown(event) { - if (/input|textarea/i.test(event.target.tagName)) { - return; + if (this._config.pause === 'hover') { + $(this._element).on(Event.MOUSEENTER, function (event) { + return _this2.pause(event); + }).on(Event.MOUSELEAVE, function (event) { + return _this2.cycle(event); + }); + if ('ontouchstart' in document.documentElement) { + // if it's a touch-enabled device, mouseenter/leave are fired as + // part of the mouse compatibility events on first tap - the carousel + // would stop cycling until user tapped out of it; + // here, we listen for touchend, explicitly pause the carousel + // (as if it's the second time we tap on it, mouseenter compat event + // is NOT fired) and after a timeout (to allow for mouse compatibility + // events to fire) we explicitly restart cycling + $(this._element).on(Event.TOUCHEND, function () { + _this2.pause(); + if (_this2.touchTimeout) { + clearTimeout(_this2.touchTimeout); + } + _this2.touchTimeout = setTimeout(function (event) { + return _this2.cycle(event); + }, TOUCHEVENT_COMPAT_WAIT + _this2._config.interval); + }); + } + } } - - switch (event.which) { - case ARROW_LEFT_KEYCODE: - event.preventDefault(); - this.prev(); - break; - case ARROW_RIGHT_KEYCODE: - event.preventDefault(); - this.next(); - break; - default: + }, { + key: '_keydown', + value: function _keydown(event) { + if (/input|textarea/i.test(event.target.tagName)) { return; + } + + switch (event.which) { + case ARROW_LEFT_KEYCODE: + event.preventDefault(); + this.prev(); + break; + case ARROW_RIGHT_KEYCODE: + event.preventDefault(); + this.next(); + break; + default: + return; + } } - }; - - Carousel.prototype._getItemIndex = function _getItemIndex(element) { - this._items = $.makeArray($(element).parent().find(Selector.ITEM)); - return this._items.indexOf(element); - }; - - Carousel.prototype._getItemByDirection = function _getItemByDirection(direction, activeElement) { - var isNextDirection = direction === Direction.NEXT; - var isPrevDirection = direction === Direction.PREV; - var activeIndex = this._getItemIndex(activeElement); - var lastItemIndex = this._items.length - 1; - var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; - - if (isGoingToWrap && !this._config.wrap) { - return activeElement; + }, { + key: '_getItemIndex', + value: function _getItemIndex(element) { + this._items = $.makeArray($(element).parent().find(Selector.ITEM)); + return this._items.indexOf(element); } + }, { + key: '_getItemByDirection', + value: function _getItemByDirection(direction, activeElement) { + var isNextDirection = direction === Direction.NEXT; + var isPrevDirection = direction === Direction.PREV; + var activeIndex = this._getItemIndex(activeElement); + var lastItemIndex = this._items.length - 1; + var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; + + if (isGoingToWrap && !this._config.wrap) { + return activeElement; + } - var delta = direction === Direction.PREV ? -1 : 1; - var itemIndex = (activeIndex + delta) % this._items.length; - - return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; - }; - - Carousel.prototype._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { - var targetIndex = this._getItemIndex(relatedTarget); - var fromIndex = this._getItemIndex($(this._element).find(Selector.ACTIVE_ITEM)[0]); - var slideEvent = $.Event(Event.SLIDE, { - relatedTarget: relatedTarget, - direction: eventDirectionName, - from: fromIndex, - to: targetIndex - }); + var delta = direction === Direction.PREV ? -1 : 1; + var itemIndex = (activeIndex + delta) % this._items.length; - $(this._element).trigger(slideEvent); + return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; + } + }, { + key: '_triggerSlideEvent', + value: function _triggerSlideEvent(relatedTarget, eventDirectionName) { + var targetIndex = this._getItemIndex(relatedTarget); + var fromIndex = this._getItemIndex($(this._element).find(Selector.ACTIVE_ITEM)[0]); + var slideEvent = $.Event(Event.SLIDE, { + relatedTarget: relatedTarget, + direction: eventDirectionName, + from: fromIndex, + to: targetIndex + }); - return slideEvent; - }; + $(this._element).trigger(slideEvent); - Carousel.prototype._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { - if (this._indicatorsElement) { - $(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE); + return slideEvent; + } + }, { + key: '_setActiveIndicatorElement', + value: function _setActiveIndicatorElement(element) { + if (this._indicatorsElement) { + $(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE); - var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; + var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; - if (nextIndicator) { - $(nextIndicator).addClass(ClassName.ACTIVE); + if (nextIndicator) { + $(nextIndicator).addClass(ClassName.ACTIVE); + } } } - }; - - Carousel.prototype._slide = function _slide(direction, element) { - var _this3 = this; - - var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]; - var activeElementIndex = this._getItemIndex(activeElement); - var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); - var nextElementIndex = this._getItemIndex(nextElement); - var isCycling = Boolean(this._interval); - - var directionalClassName = void 0; - var orderClassName = void 0; - var eventDirectionName = void 0; - - if (direction === Direction.NEXT) { - directionalClassName = ClassName.LEFT; - orderClassName = ClassName.NEXT; - eventDirectionName = Direction.LEFT; - } else { - directionalClassName = ClassName.RIGHT; - orderClassName = ClassName.PREV; - eventDirectionName = Direction.RIGHT; - } + }, { + key: '_slide', + value: function _slide(direction, element) { + var _this3 = this; + + var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]; + var activeElementIndex = this._getItemIndex(activeElement); + var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); + var nextElementIndex = this._getItemIndex(nextElement); + var isCycling = Boolean(this._interval); + + var directionalClassName = void 0; + var orderClassName = void 0; + var eventDirectionName = void 0; + + if (direction === Direction.NEXT) { + directionalClassName = ClassName.LEFT; + orderClassName = ClassName.NEXT; + eventDirectionName = Direction.LEFT; + } else { + directionalClassName = ClassName.RIGHT; + orderClassName = ClassName.PREV; + eventDirectionName = Direction.RIGHT; + } - if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) { - this._isSliding = false; - return; - } + if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) { + this._isSliding = false; + return; + } - var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); - if (slideEvent.isDefaultPrevented()) { - return; - } + var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); + if (slideEvent.isDefaultPrevented()) { + return; + } - if (!activeElement || !nextElement) { - // some weirdness is happening, so we bail - return; - } + if (!activeElement || !nextElement) { + // some weirdness is happening, so we bail + return; + } - this._isSliding = true; + this._isSliding = true; - if (isCycling) { - this.pause(); - } + if (isCycling) { + this.pause(); + } - this._setActiveIndicatorElement(nextElement); + this._setActiveIndicatorElement(nextElement); - var slidEvent = $.Event(Event.SLID, { - relatedTarget: nextElement, - direction: eventDirectionName, - from: activeElementIndex, - to: nextElementIndex - }); + var slidEvent = $.Event(Event.SLID, { + relatedTarget: nextElement, + direction: eventDirectionName, + from: activeElementIndex, + to: nextElementIndex + }); - if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) { + if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) { - $(nextElement).addClass(orderClassName); + $(nextElement).addClass(orderClassName); - Util.reflow(nextElement); + Util.reflow(nextElement); - $(activeElement).addClass(directionalClassName); - $(nextElement).addClass(directionalClassName); + $(activeElement).addClass(directionalClassName); + $(nextElement).addClass(directionalClassName); - $(activeElement).one(Util.TRANSITION_END, function () { - $(nextElement).removeClass(directionalClassName + ' ' + orderClassName).addClass(ClassName.ACTIVE); + $(activeElement).one(Util.TRANSITION_END, function () { + $(nextElement).removeClass(directionalClassName + ' ' + orderClassName).addClass(ClassName.ACTIVE); - $(activeElement).removeClass(ClassName.ACTIVE + ' ' + orderClassName + ' ' + directionalClassName); + $(activeElement).removeClass(ClassName.ACTIVE + ' ' + orderClassName + ' ' + directionalClassName); - _this3._isSliding = false; + _this3._isSliding = false; - setTimeout(function () { - return $(_this3._element).trigger(slidEvent); - }, 0); - }).emulateTransitionEnd(TRANSITION_DURATION); - } else { - $(activeElement).removeClass(ClassName.ACTIVE); - $(nextElement).addClass(ClassName.ACTIVE); + setTimeout(function () { + return $(_this3._element).trigger(slidEvent); + }, 0); + }).emulateTransitionEnd(TRANSITION_DURATION); + } else { + $(activeElement).removeClass(ClassName.ACTIVE); + $(nextElement).addClass(ClassName.ACTIVE); - this._isSliding = false; - $(this._element).trigger(slidEvent); - } + this._isSliding = false; + $(this._element).trigger(slidEvent); + } - if (isCycling) { - this.cycle(); + if (isCycling) { + this.cycle(); + } } - }; - - // static - Carousel._jQueryInterface = function _jQueryInterface(config) { - return this.each(function () { - var data = $(this).data(DATA_KEY); - var _config = $.extend({}, Default, $(this).data()); + // static - if ((typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object') { - $.extend(_config, config); - } + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + var _config = $.extend({}, Default, $(this).data()); - var action = typeof config === 'string' ? config : _config.slide; + if ((typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object') { + $.extend(_config, config); + } - if (!data) { - data = new Carousel(this, _config); - $(this).data(DATA_KEY, data); - } + var action = typeof config === 'string' ? config : _config.slide; - if (typeof config === 'number') { - data.to(config); - } else if (typeof action === 'string') { - if (data[action] === undefined) { - throw new Error('No method named "' + action + '"'); + if (!data) { + data = new Carousel(this, _config); + $(this).data(DATA_KEY, data); } - data[action](); - } else if (_config.interval) { - data.pause(); - data.cycle(); - } - }); - }; - Carousel._dataApiClickHandler = function _dataApiClickHandler(event) { - var selector = Util.getSelectorFromElement(this); - - if (!selector) { - return; + if (typeof config === 'number') { + data.to(config); + } else if (typeof action === 'string') { + if (typeof data[action] === 'undefined') { + throw new Error('No method named "' + action + '"'); + } + data[action](); + } else if (_config.interval) { + data.pause(); + data.cycle(); + } + }); } + }, { + key: '_dataApiClickHandler', + value: function _dataApiClickHandler(event) { + var selector = Util.getSelectorFromElement(this); - var target = $(selector)[0]; + if (!selector) { + return; + } - if (!target || !$(target).hasClass(ClassName.CAROUSEL)) { - return; - } + var target = $(selector)[0]; - var config = $.extend({}, $(target).data(), $(this).data()); - var slideIndex = this.getAttribute('data-slide-to'); + if (!target || !$(target).hasClass(ClassName.CAROUSEL)) { + return; + } - if (slideIndex) { - config.interval = false; - } + var config = $.extend({}, $(target).data(), $(this).data()); + var slideIndex = this.getAttribute('data-slide-to'); - Carousel._jQueryInterface.call($(target), config); + if (slideIndex) { + config.interval = false; + } - if (slideIndex) { - $(target).data(DATA_KEY).to(slideIndex); - } + Carousel._jQueryInterface.call($(target), config); - event.preventDefault(); - }; + if (slideIndex) { + $(target).data(DATA_KEY).to(slideIndex); + } - _createClass(Carousel, null, [{ + event.preventDefault(); + } + }, { key: 'VERSION', get: function get() { return VERSION; diff --git a/js/dist/carousel.js.map b/js/dist/carousel.js.map index f1503da6f1..239546f741 100644 --- a/js/dist/carousel.js.map +++ b/js/dist/carousel.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/carousel.js"],"names":["Carousel","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","TRANSITION_DURATION","ARROW_LEFT_KEYCODE","ARROW_RIGHT_KEYCODE","TOUCHEVENT_COMPAT_WAIT","Default","interval","keyboard","slide","pause","wrap","DefaultType","Direction","NEXT","PREV","LEFT","RIGHT","Event","SLIDE","SLID","KEYDOWN","MOUSEENTER","MOUSELEAVE","TOUCHEND","LOAD_DATA_API","CLICK_DATA_API","ClassName","CAROUSEL","ACTIVE","ITEM","Selector","ACTIVE_ITEM","NEXT_PREV","INDICATORS","DATA_SLIDE","DATA_RIDE","element","config","_items","_interval","_activeElement","_isPaused","_isSliding","touchTimeout","_config","_getConfig","_element","_indicatorsElement","find","_addEventListeners","next","_slide","nextWhenVisible","document","hidden","is","css","prev","event","Util","supportsTransitionEnd","triggerTransitionEnd","cycle","clearInterval","setInterval","visibilityState","bind","to","index","activeIndex","_getItemIndex","length","one","direction","dispose","off","removeData","extend","typeCheckConfig","on","_keydown","documentElement","clearTimeout","setTimeout","test","target","tagName","which","preventDefault","makeArray","parent","indexOf","_getItemByDirection","activeElement","isNextDirection","isPrevDirection","lastItemIndex","isGoingToWrap","delta","itemIndex","_triggerSlideEvent","relatedTarget","eventDirectionName","targetIndex","fromIndex","slideEvent","from","trigger","_setActiveIndicatorElement","removeClass","nextIndicator","children","addClass","activeElementIndex","nextElement","nextElementIndex","isCycling","Boolean","directionalClassName","orderClassName","hasClass","isDefaultPrevented","slidEvent","reflow","TRANSITION_END","emulateTransitionEnd","_jQueryInterface","each","data","action","undefined","Error","_dataApiClickHandler","selector","getSelectorFromElement","slideIndex","getAttribute","call","window","$carousel","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAGA;;;;;;;AAOA,IAAMA,WAAY,UAACC,CAAD,EAAO;;AAGvB;;;;;;AAMA,MAAMC,OAAyB,UAA/B;AACA,MAAMC,UAAyB,YAA/B;AACA,MAAMC,WAAyB,aAA/B;AACA,MAAMC,kBAA6BD,QAAnC;AACA,MAAME,eAAyB,WAA/B;AACA,MAAMC,qBAAyBN,EAAEO,EAAF,CAAKN,IAAL,CAA/B;AACA,MAAMO,sBAAyB,GAA/B;AACA,MAAMC,qBAAyB,EAA/B,CAhBuB,CAgBW;AAClC,MAAMC,sBAAyB,EAA/B,CAjBuB,CAiBW;AAClC,MAAMC,yBAAyB,GAA/B,CAlBuB,CAkBY;;AA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oBAD1D;;AAGA3I,IAAEiJ,MAAF,EAAU3D,EAAV,CAAa9D,MAAMO,aAAnB,EAAkC,YAAM;AACtC/B,MAAEqC,SAASK,SAAX,EAAsB4F,IAAtB,CAA2B,YAAY;AACrC,UAAMY,YAAYlJ,EAAE,IAAF,CAAlB;AACAD,eAASsI,gBAAT,CAA0BW,IAA1B,CAA+BE,SAA/B,EAA0CA,UAAUX,IAAV,EAA1C;AACD,KAHD;AAID,GALD;;AAQA;;;;;;AAMAvI,IAAEO,EAAF,CAAKN,IAAL,IAAyBF,SAASsI,gBAAlC;AACArI,IAAEO,EAAF,CAAKN,IAAL,EAAWkJ,WAAX,GAAyBpJ,QAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWmJ,UAAX,GAAyB,YAAY;AACnCpJ,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,SAASsI,gBAAhB;AACD,GAHD;;AAKA,SAAOtI,QAAP;AAED,CA9fgB,CA8fdsJ,MA9fc,CAAjB","file":"carousel.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Carousel = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'carousel'\n const VERSION = '4.0.0-beta'\n const DATA_KEY = 'bs.carousel'\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 const ARROW_LEFT_KEYCODE = 37 // KeyboardEvent.which value for left arrow key\n const ARROW_RIGHT_KEYCODE = 39 // KeyboardEvent.which value for right arrow key\n const TOUCHEVENT_COMPAT_WAIT = 500 // Time for mouse compat events to fire after touch\n\n const Default = {\n interval : 5000,\n keyboard : true,\n slide : false,\n pause : 'hover',\n wrap : true\n }\n\n const DefaultType = {\n interval : '(number|boolean)',\n keyboard : 'boolean',\n slide : '(boolean|string)',\n pause : '(string|boolean)',\n wrap : 'boolean'\n }\n\n const Direction = {\n NEXT : 'next',\n PREV : 'prev',\n LEFT : 'left',\n RIGHT : 'right'\n }\n\n const Event = {\n SLIDE : `slide${EVENT_KEY}`,\n SLID : `slid${EVENT_KEY}`,\n KEYDOWN : `keydown${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`,\n TOUCHEND : `touchend${EVENT_KEY}`,\n LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n CAROUSEL : 'carousel',\n ACTIVE : 'active',\n SLIDE : 'slide',\n RIGHT : 'carousel-item-right',\n LEFT : 'carousel-item-left',\n NEXT : 'carousel-item-next',\n PREV : 'carousel-item-prev',\n ITEM : 'carousel-item'\n }\n\n const Selector = {\n ACTIVE : '.active',\n ACTIVE_ITEM : '.active.carousel-item',\n ITEM : '.carousel-item',\n NEXT_PREV : '.carousel-item-next, .carousel-item-prev',\n INDICATORS : '.carousel-indicators',\n DATA_SLIDE : '[data-slide], [data-slide-to]',\n DATA_RIDE : '[data-ride=\"carousel\"]'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Carousel {\n\n constructor(element, config) {\n this._items = null\n this._interval = null\n this._activeElement = null\n\n this._isPaused = false\n this._isSliding = false\n\n this.touchTimeout = null\n\n this._config = this._getConfig(config)\n this._element = $(element)[0]\n this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0]\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\n // public\n\n next() {\n if (!this._isSliding) {\n this._slide(Direction.NEXT)\n }\n }\n\n nextWhenVisible() {\n // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n if (!document.hidden &&\n ($(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden')) {\n this.next()\n }\n }\n\n prev() {\n if (!this._isSliding) {\n this._slide(Direction.PREV)\n }\n }\n\n pause(event) {\n if (!event) {\n this._isPaused = true\n }\n\n if ($(this._element).find(Selector.NEXT_PREV)[0] &&\n Util.supportsTransitionEnd()) {\n Util.triggerTransitionEnd(this._element)\n this.cycle(true)\n }\n\n clearInterval(this._interval)\n this._interval = null\n }\n\n cycle(event) {\n if (!event) {\n this._isPaused = false\n }\n\n if (this._interval) {\n clearInterval(this._interval)\n this._interval = null\n }\n\n if (this._config.interval && !this._isPaused) {\n this._interval = setInterval(\n (document.visibilityState ? this.nextWhenVisible : this.next).bind(this),\n this._config.interval\n )\n }\n }\n\n to(index) {\n this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]\n\n const activeIndex = this._getItemIndex(this._activeElement)\n\n if (index > this._items.length - 1 || index < 0) {\n return\n }\n\n if (this._isSliding) {\n $(this._element).one(Event.SLID, () => this.to(index))\n return\n }\n\n if (activeIndex === index) {\n this.pause()\n this.cycle()\n return\n }\n\n const direction = index > activeIndex ?\n Direction.NEXT :\n Direction.PREV\n\n this._slide(direction, this._items[index])\n }\n\n dispose() {\n $(this._element).off(EVENT_KEY)\n $.removeData(this._element, DATA_KEY)\n\n this._items = null\n this._config = null\n this._element = null\n this._interval = null\n this._isPaused = null\n this._isSliding = null\n this._activeElement = null\n this._indicatorsElement = null\n }\n\n\n // private\n\n _getConfig(config) {\n config = $.extend({}, Default, config)\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _addEventListeners() {\n if (this._config.keyboard) {\n $(this._element)\n .on(Event.KEYDOWN, (event) => this._keydown(event))\n }\n\n if (this._config.pause === 'hover') {\n $(this._element)\n .on(Event.MOUSEENTER, (event) => this.pause(event))\n .on(Event.MOUSELEAVE, (event) => this.cycle(event))\n if ('ontouchstart' in document.documentElement) {\n // if it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n $(this._element).on(Event.TOUCHEND, () => {\n this.pause()\n if (this.touchTimeout) {\n clearTimeout(this.touchTimeout)\n }\n this.touchTimeout = setTimeout((event) => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval)\n })\n }\n }\n }\n\n _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return\n }\n\n switch (event.which) {\n case ARROW_LEFT_KEYCODE:\n event.preventDefault()\n this.prev()\n break\n case ARROW_RIGHT_KEYCODE:\n event.preventDefault()\n this.next()\n break\n default:\n return\n }\n }\n\n _getItemIndex(element) {\n this._items = $.makeArray($(element).parent().find(Selector.ITEM))\n return this._items.indexOf(element)\n }\n\n _getItemByDirection(direction, activeElement) {\n const isNextDirection = direction === Direction.NEXT\n const isPrevDirection = direction === Direction.PREV\n const activeIndex = this._getItemIndex(activeElement)\n const lastItemIndex = this._items.length - 1\n const isGoingToWrap = isPrevDirection && activeIndex === 0 ||\n isNextDirection && activeIndex === lastItemIndex\n\n if (isGoingToWrap && !this._config.wrap) {\n return activeElement\n }\n\n const delta = direction === Direction.PREV ? -1 : 1\n const itemIndex = (activeIndex + delta) % this._items.length\n\n return itemIndex === -1 ?\n this._items[this._items.length - 1] : this._items[itemIndex]\n }\n\n\n _triggerSlideEvent(relatedTarget, eventDirectionName) {\n const targetIndex = this._getItemIndex(relatedTarget)\n const fromIndex = this._getItemIndex($(this._element).find(Selector.ACTIVE_ITEM)[0])\n const slideEvent = $.Event(Event.SLIDE, {\n relatedTarget,\n direction: eventDirectionName,\n from: fromIndex,\n to: targetIndex\n })\n\n $(this._element).trigger(slideEvent)\n\n return slideEvent\n }\n\n _setActiveIndicatorElement(element) {\n if (this._indicatorsElement) {\n $(this._indicatorsElement)\n .find(Selector.ACTIVE)\n .removeClass(ClassName.ACTIVE)\n\n const nextIndicator = this._indicatorsElement.children[\n this._getItemIndex(element)\n ]\n\n if (nextIndicator) {\n $(nextIndicator).addClass(ClassName.ACTIVE)\n }\n }\n }\n\n _slide(direction, element) {\n const activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]\n const activeElementIndex = this._getItemIndex(activeElement)\n const nextElement = element || activeElement &&\n this._getItemByDirection(direction, activeElement)\n const nextElementIndex = this._getItemIndex(nextElement)\n const isCycling = Boolean(this._interval)\n\n let directionalClassName\n let orderClassName\n let eventDirectionName\n\n if (direction === Direction.NEXT) {\n directionalClassName = ClassName.LEFT\n orderClassName = ClassName.NEXT\n eventDirectionName = Direction.LEFT\n } else {\n directionalClassName = ClassName.RIGHT\n orderClassName = ClassName.PREV\n eventDirectionName = Direction.RIGHT\n }\n\n if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {\n this._isSliding = false\n return\n }\n\n const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName)\n if (slideEvent.isDefaultPrevented()) {\n return\n }\n\n if (!activeElement || !nextElement) {\n // some weirdness is happening, so we bail\n return\n }\n\n this._isSliding = true\n\n if (isCycling) {\n this.pause()\n }\n\n this._setActiveIndicatorElement(nextElement)\n\n const slidEvent = $.Event(Event.SLID, {\n relatedTarget: nextElement,\n direction: eventDirectionName,\n from: activeElementIndex,\n to: nextElementIndex\n })\n\n if (Util.supportsTransitionEnd() &&\n $(this._element).hasClass(ClassName.SLIDE)) {\n\n $(nextElement).addClass(orderClassName)\n\n Util.reflow(nextElement)\n\n $(activeElement).addClass(directionalClassName)\n $(nextElement).addClass(directionalClassName)\n\n $(activeElement)\n .one(Util.TRANSITION_END, () => {\n $(nextElement)\n .removeClass(`${directionalClassName} ${orderClassName}`)\n .addClass(ClassName.ACTIVE)\n\n $(activeElement).removeClass(`${ClassName.ACTIVE} ${orderClassName} ${directionalClassName}`)\n\n this._isSliding = false\n\n setTimeout(() => $(this._element).trigger(slidEvent), 0)\n\n })\n .emulateTransitionEnd(TRANSITION_DURATION)\n\n } else {\n $(activeElement).removeClass(ClassName.ACTIVE)\n $(nextElement).addClass(ClassName.ACTIVE)\n\n this._isSliding = false\n $(this._element).trigger(slidEvent)\n }\n\n if (isCycling) {\n this.cycle()\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 = $.extend({}, Default, $(this).data())\n\n if (typeof config === 'object') {\n $.extend(_config, config)\n }\n\n const action = typeof config === 'string' ? config : _config.slide\n\n if (!data) {\n data = new Carousel(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'number') {\n data.to(config)\n } else if (typeof action === 'string') {\n if (data[action] === undefined) {\n throw new Error(`No method named \"${action}\"`)\n }\n data[action]()\n } else if (_config.interval) {\n data.pause()\n data.cycle()\n }\n })\n }\n\n static _dataApiClickHandler(event) {\n const selector = Util.getSelectorFromElement(this)\n\n if (!selector) {\n return\n }\n\n const target = $(selector)[0]\n\n if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {\n return\n }\n\n const config = $.extend({}, $(target).data(), $(this).data())\n const slideIndex = this.getAttribute('data-slide-to')\n\n if (slideIndex) {\n config.interval = false\n }\n\n Carousel._jQueryInterface.call($(target), config)\n\n if (slideIndex) {\n $(target).data(DATA_KEY).to(slideIndex)\n }\n\n event.preventDefault()\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler)\n\n $(window).on(Event.LOAD_DATA_API, () => {\n $(Selector.DATA_RIDE).each(function () {\n const $carousel = $(this)\n Carousel._jQueryInterface.call($carousel, $carousel.data())\n })\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Carousel._jQueryInterface\n $.fn[NAME].Constructor = Carousel\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Carousel._jQueryInterface\n }\n\n return Carousel\n\n})(jQuery)\n\nexport default Carousel\n"]}
\ No newline at end of file +{"version":3,"sources":["../src/carousel.js"],"names":["Carousel","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","TRANSITION_DURATION","ARROW_LEFT_KEYCODE","ARROW_RIGHT_KEYCODE","TOUCHEVENT_COMPAT_WAIT","Default","interval","keyboard","slide","pause","wrap","DefaultType","Direction","NEXT","PREV","LEFT","RIGHT","Event","SLIDE","SLID","KEYDOWN","MOUSEENTER","MOUSELEAVE","TOUCHEND","LOAD_DATA_API","CLICK_DATA_API","ClassName","CAROUSEL","ACTIVE","ITEM","Selector","ACTIVE_ITEM","NEXT_PREV","INDICATORS","DATA_SLIDE","DATA_RIDE","element","config","_items","_interval","_activeElement","_isPaused","_isSliding","touchTimeout","_config","_getConfig","_element","_indicatorsElement","find","_addEventListeners","_slide","document","hidden","is","css","next","event","Util","supportsTransitionEnd","triggerTransitionEnd","cycle","clearInterval","setInterval","visibilityState","nextWhenVisible","bind","index","activeIndex","_getItemIndex","length","one","to","direction","off","removeData","extend","typeCheckConfig","on","_keydown","documentElement","clearTimeout","setTimeout","test","target","tagName","which","preventDefault","prev","makeArray","parent","indexOf","activeElement","isNextDirection","isPrevDirection","lastItemIndex","isGoingToWrap","delta","itemIndex","relatedTarget","eventDirectionName","targetIndex","fromIndex","slideEvent","from","trigger","removeClass","nextIndicator","children","addClass","activeElementIndex","nextElement","_getItemByDirection","nextElementIndex","isCycling","Boolean","directionalClassName","orderClassName","hasClass","_triggerSlideEvent","isDefaultPrevented","_setActiveIndicatorElement","slidEvent","reflow","TRANSITION_END","emulateTransitionEnd","each","data","action","Error","selector","getSelectorFromElement","slideIndex","get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AED3E,cAAM8B,cAAN;AACD;AAzdmB;AAAA;AAAA,0BAwGC;AACnB,eAAO5F,OAAP;AACD;AA1GmB;AAAA;AAAA,0BA4GC;AACnB,eAAOW,OAAP;AACD;AA9GmB;;AAAA;AAAA;;AA8dtB;;;;;;AAMAN,IAAEoD,QAAF,EACG0B,EADH,CACM5D,MAAMQ,cADZ,EAC4BK,SAASI,UADrC,EACiD1C,SAAS+I,oBAD1D;;AAGAxI,IAAEyI,MAAF,EAAU3D,EAAV,CAAa5D,MAAMO,aAAnB,EAAkC,YAAM;AACtCzB,MAAE+B,SAASK,SAAX,EAAsB0F,IAAtB,CAA2B,YAAY;AACrC,UAAMY,YAAY1I,EAAE,IAAF,CAAlB;AACAP,eAAS6I,gBAAT,CAA0BC,IAA1B,CAA+BG,SAA/B,EAA0CA,UAAUX,IAAV,EAA1C;AACD,KAHD;AAID,GALD;;AAQA;;;;;;AAMA/H,IAAEC,EAAF,CAAKP,IAAL,IAAyBD,SAAS6I,gBAAlC;AACAtI,IAAEC,EAAF,CAAKP,IAAL,EAAWiJ,WAAX,GAAyBlJ,QAAzB;AACAO,IAAEC,EAAF,CAAKP,IAAL,EAAWkJ,UAAX,GAAyB,YAAY;AACnC5I,MAAEC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;AACA,WAAON,SAAS6I,gBAAhB;AACD,GAHD;;AAKA,SAAO7I,QAAP;AAED,CA9fgB,CA8fdoJ,MA9fc,CAAjB","file":"carousel.js","sourcesContent":["import $ from 'jquery'\nimport Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Carousel = (() => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'carousel'\n const VERSION = '4.0.0-beta'\n const DATA_KEY = 'bs.carousel'\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 const ARROW_LEFT_KEYCODE = 37 // KeyboardEvent.which value for left arrow key\n const ARROW_RIGHT_KEYCODE = 39 // KeyboardEvent.which value for right arrow key\n const TOUCHEVENT_COMPAT_WAIT = 500 // Time for mouse compat events to fire after touch\n\n const Default = {\n interval : 5000,\n keyboard : true,\n slide : false,\n pause : 'hover',\n wrap : true\n }\n\n const DefaultType = {\n interval : '(number|boolean)',\n keyboard : 'boolean',\n slide : '(boolean|string)',\n pause : '(string|boolean)',\n wrap : 'boolean'\n }\n\n const Direction = {\n NEXT : 'next',\n PREV : 'prev',\n LEFT : 'left',\n RIGHT : 'right'\n }\n\n const Event = {\n SLIDE : `slide${EVENT_KEY}`,\n SLID : `slid${EVENT_KEY}`,\n KEYDOWN : `keydown${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`,\n TOUCHEND : `touchend${EVENT_KEY}`,\n LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n CAROUSEL : 'carousel',\n ACTIVE : 'active',\n SLIDE : 'slide',\n RIGHT : 'carousel-item-right',\n LEFT : 'carousel-item-left',\n NEXT : 'carousel-item-next',\n PREV : 'carousel-item-prev',\n ITEM : 'carousel-item'\n }\n\n const Selector = {\n ACTIVE : '.active',\n ACTIVE_ITEM : '.active.carousel-item',\n ITEM : '.carousel-item',\n NEXT_PREV : '.carousel-item-next, .carousel-item-prev',\n INDICATORS : '.carousel-indicators',\n DATA_SLIDE : '[data-slide], [data-slide-to]',\n DATA_RIDE : '[data-ride=\"carousel\"]'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Carousel {\n\n constructor(element, config) {\n this._items = null\n this._interval = null\n this._activeElement = null\n\n this._isPaused = false\n this._isSliding = false\n\n this.touchTimeout = null\n\n this._config = this._getConfig(config)\n this._element = $(element)[0]\n this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0]\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\n // public\n\n next() {\n if (!this._isSliding) {\n this._slide(Direction.NEXT)\n }\n }\n\n nextWhenVisible() {\n // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n if (!document.hidden &&\n ($(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden')) {\n this.next()\n }\n }\n\n prev() {\n if (!this._isSliding) {\n this._slide(Direction.PREV)\n }\n }\n\n pause(event) {\n if (!event) {\n this._isPaused = true\n }\n\n if ($(this._element).find(Selector.NEXT_PREV)[0] &&\n Util.supportsTransitionEnd()) {\n Util.triggerTransitionEnd(this._element)\n this.cycle(true)\n }\n\n clearInterval(this._interval)\n this._interval = null\n }\n\n cycle(event) {\n if (!event) {\n this._isPaused = false\n }\n\n if (this._interval) {\n clearInterval(this._interval)\n this._interval = null\n }\n\n if (this._config.interval && !this._isPaused) {\n this._interval = setInterval(\n (document.visibilityState ? this.nextWhenVisible : this.next).bind(this),\n this._config.interval\n )\n }\n }\n\n to(index) {\n this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]\n\n const activeIndex = this._getItemIndex(this._activeElement)\n\n if (index > this._items.length - 1 || index < 0) {\n return\n }\n\n if (this._isSliding) {\n $(this._element).one(Event.SLID, () => this.to(index))\n return\n }\n\n if (activeIndex === index) {\n this.pause()\n this.cycle()\n return\n }\n\n const direction = index > activeIndex ?\n Direction.NEXT :\n Direction.PREV\n\n this._slide(direction, this._items[index])\n }\n\n dispose() {\n $(this._element).off(EVENT_KEY)\n $.removeData(this._element, DATA_KEY)\n\n this._items = null\n this._config = null\n this._element = null\n this._interval = null\n this._isPaused = null\n this._isSliding = null\n this._activeElement = null\n this._indicatorsElement = null\n }\n\n\n // private\n\n _getConfig(config) {\n config = $.extend({}, Default, config)\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _addEventListeners() {\n if (this._config.keyboard) {\n $(this._element)\n .on(Event.KEYDOWN, (event) => this._keydown(event))\n }\n\n if (this._config.pause === 'hover') {\n $(this._element)\n .on(Event.MOUSEENTER, (event) => this.pause(event))\n .on(Event.MOUSELEAVE, (event) => this.cycle(event))\n if ('ontouchstart' in document.documentElement) {\n // if it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n $(this._element).on(Event.TOUCHEND, () => {\n this.pause()\n if (this.touchTimeout) {\n clearTimeout(this.touchTimeout)\n }\n this.touchTimeout = setTimeout((event) => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval)\n })\n }\n }\n }\n\n _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return\n }\n\n switch (event.which) {\n case ARROW_LEFT_KEYCODE:\n event.preventDefault()\n this.prev()\n break\n case ARROW_RIGHT_KEYCODE:\n event.preventDefault()\n this.next()\n break\n default:\n return\n }\n }\n\n _getItemIndex(element) {\n this._items = $.makeArray($(element).parent().find(Selector.ITEM))\n return this._items.indexOf(element)\n }\n\n _getItemByDirection(direction, activeElement) {\n const isNextDirection = direction === Direction.NEXT\n const isPrevDirection = direction === Direction.PREV\n const activeIndex = this._getItemIndex(activeElement)\n const lastItemIndex = this._items.length - 1\n const isGoingToWrap = isPrevDirection && activeIndex === 0 ||\n isNextDirection && activeIndex === lastItemIndex\n\n if (isGoingToWrap && !this._config.wrap) {\n return activeElement\n }\n\n const delta = direction === Direction.PREV ? -1 : 1\n const itemIndex = (activeIndex + delta) % this._items.length\n\n return itemIndex === -1 ?\n this._items[this._items.length - 1] : this._items[itemIndex]\n }\n\n\n _triggerSlideEvent(relatedTarget, eventDirectionName) {\n const targetIndex = this._getItemIndex(relatedTarget)\n const fromIndex = this._getItemIndex($(this._element).find(Selector.ACTIVE_ITEM)[0])\n const slideEvent = $.Event(Event.SLIDE, {\n relatedTarget,\n direction: eventDirectionName,\n from: fromIndex,\n to: targetIndex\n })\n\n $(this._element).trigger(slideEvent)\n\n return slideEvent\n }\n\n _setActiveIndicatorElement(element) {\n if (this._indicatorsElement) {\n $(this._indicatorsElement)\n .find(Selector.ACTIVE)\n .removeClass(ClassName.ACTIVE)\n\n const nextIndicator = this._indicatorsElement.children[\n this._getItemIndex(element)\n ]\n\n if (nextIndicator) {\n $(nextIndicator).addClass(ClassName.ACTIVE)\n }\n }\n }\n\n _slide(direction, element) {\n const activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]\n const activeElementIndex = this._getItemIndex(activeElement)\n const nextElement = element || activeElement &&\n this._getItemByDirection(direction, activeElement)\n const nextElementIndex = this._getItemIndex(nextElement)\n const isCycling = Boolean(this._interval)\n\n let directionalClassName\n let orderClassName\n let eventDirectionName\n\n if (direction === Direction.NEXT) {\n directionalClassName = ClassName.LEFT\n orderClassName = ClassName.NEXT\n eventDirectionName = Direction.LEFT\n } else {\n directionalClassName = ClassName.RIGHT\n orderClassName = ClassName.PREV\n eventDirectionName = Direction.RIGHT\n }\n\n if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {\n this._isSliding = false\n return\n }\n\n const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName)\n if (slideEvent.isDefaultPrevented()) {\n return\n }\n\n if (!activeElement || !nextElement) {\n // some weirdness is happening, so we bail\n return\n }\n\n this._isSliding = true\n\n if (isCycling) {\n this.pause()\n }\n\n this._setActiveIndicatorElement(nextElement)\n\n const slidEvent = $.Event(Event.SLID, {\n relatedTarget: nextElement,\n direction: eventDirectionName,\n from: activeElementIndex,\n to: nextElementIndex\n })\n\n if (Util.supportsTransitionEnd() &&\n $(this._element).hasClass(ClassName.SLIDE)) {\n\n $(nextElement).addClass(orderClassName)\n\n Util.reflow(nextElement)\n\n $(activeElement).addClass(directionalClassName)\n $(nextElement).addClass(directionalClassName)\n\n $(activeElement)\n .one(Util.TRANSITION_END, () => {\n $(nextElement)\n .removeClass(`${directionalClassName} ${orderClassName}`)\n .addClass(ClassName.ACTIVE)\n\n $(activeElement).removeClass(`${ClassName.ACTIVE} ${orderClassName} ${directionalClassName}`)\n\n this._isSliding = false\n\n setTimeout(() => $(this._element).trigger(slidEvent), 0)\n\n })\n .emulateTransitionEnd(TRANSITION_DURATION)\n\n } else {\n $(activeElement).removeClass(ClassName.ACTIVE)\n $(nextElement).addClass(ClassName.ACTIVE)\n\n this._isSliding = false\n $(this._element).trigger(slidEvent)\n }\n\n if (isCycling) {\n this.cycle()\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 = $.extend({}, Default, $(this).data())\n\n if (typeof config === 'object') {\n $.extend(_config, config)\n }\n\n const action = typeof config === 'string' ? config : _config.slide\n\n if (!data) {\n data = new Carousel(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'number') {\n data.to(config)\n } else if (typeof action === 'string') {\n if (typeof data[action] === 'undefined') {\n throw new Error(`No method named \"${action}\"`)\n }\n data[action]()\n } else if (_config.interval) {\n data.pause()\n data.cycle()\n }\n })\n }\n\n static _dataApiClickHandler(event) {\n const selector = Util.getSelectorFromElement(this)\n\n if (!selector) {\n return\n }\n\n const target = $(selector)[0]\n\n if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {\n return\n }\n\n const config = $.extend({}, $(target).data(), $(this).data())\n const slideIndex = this.getAttribute('data-slide-to')\n\n if (slideIndex) {\n config.interval = false\n }\n\n Carousel._jQueryInterface.call($(target), config)\n\n if (slideIndex) {\n $(target).data(DATA_KEY).to(slideIndex)\n }\n\n event.preventDefault()\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler)\n\n $(window).on(Event.LOAD_DATA_API, () => {\n $(Selector.DATA_RIDE).each(function () {\n const $carousel = $(this)\n Carousel._jQueryInterface.call($carousel, $carousel.data())\n })\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Carousel._jQueryInterface\n $.fn[NAME].Constructor = Carousel\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Carousel._jQueryInterface\n }\n\n return Carousel\n\n})(jQuery)\n\nexport default Carousel\n"]}
\ No newline at end of file diff --git a/js/dist/collapse.js b/js/dist/collapse.js index 50320dbdb0..532e46f46b 100644 --- a/js/dist/collapse.js +++ b/js/dist/collapse.js @@ -1,3 +1,5 @@ +'use strict'; + 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; }; }(); @@ -11,7 +13,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * -------------------------------------------------------------------------- */ -var Collapse = function ($) { +var Collapse = function () { /** * ------------------------------------------------------------------------ @@ -98,222 +100,237 @@ var Collapse = function ($) { // getters - // public - - Collapse.prototype.toggle = function toggle() { - if ($(this._element).hasClass(ClassName.SHOW)) { - this.hide(); - } else { - this.show(); - } - }; + _createClass(Collapse, [{ + key: 'toggle', - Collapse.prototype.show = function show() { - var _this = this; - - if (this._isTransitioning || $(this._element).hasClass(ClassName.SHOW)) { - return; - } - var actives = void 0; - var activesData = void 0; + // public - if (this._parent) { - actives = $.makeArray($(this._parent).children().children(Selector.ACTIVES)); - if (!actives.length) { - actives = null; + value: function toggle() { + if ($(this._element).hasClass(ClassName.SHOW)) { + this.hide(); + } else { + this.show(); } } + }, { + key: 'show', + value: function show() { + var _this = this; - if (actives) { - activesData = $(actives).data(DATA_KEY); - if (activesData && activesData._isTransitioning) { + if (this._isTransitioning || $(this._element).hasClass(ClassName.SHOW)) { return; } - } - var startEvent = $.Event(Event.SHOW); - $(this._element).trigger(startEvent); - if (startEvent.isDefaultPrevented()) { - return; - } + var actives = void 0; + var activesData = void 0; - if (actives) { - Collapse._jQueryInterface.call($(actives), 'hide'); - if (!activesData) { - $(actives).data(DATA_KEY, null); + if (this._parent) { + actives = $.makeArray($(this._parent).children().children(Selector.ACTIVES)); + if (!actives.length) { + actives = null; + } } - } - var dimension = this._getDimension(); + if (actives) { + activesData = $(actives).data(DATA_KEY); + if (activesData && activesData._isTransitioning) { + return; + } + } - $(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING); + var startEvent = $.Event(Event.SHOW); + $(this._element).trigger(startEvent); + if (startEvent.isDefaultPrevented()) { + return; + } - this._element.style[dimension] = 0; + if (actives) { + Collapse._jQueryInterface.call($(actives), 'hide'); + if (!activesData) { + $(actives).data(DATA_KEY, null); + } + } - if (this._triggerArray.length) { - $(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true); - } + var dimension = this._getDimension(); - this.setTransitioning(true); + $(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING); - var complete = function complete() { - $(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW); + this._element.style[dimension] = 0; - _this._element.style[dimension] = ''; + if (this._triggerArray.length) { + $(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true); + } - _this.setTransitioning(false); + this.setTransitioning(true); - $(_this._element).trigger(Event.SHOWN); - }; + var complete = function complete() { + $(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW); - if (!Util.supportsTransitionEnd()) { - complete(); - return; - } + _this._element.style[dimension] = ''; - var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); - var scrollSize = 'scroll' + capitalizedDimension; + _this.setTransitioning(false); - $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + $(_this._element).trigger(Event.SHOWN); + }; - this._element.style[dimension] = this._element[scrollSize] + 'px'; - }; + if (!Util.supportsTransitionEnd()) { + complete(); + return; + } - Collapse.prototype.hide = function hide() { - var _this2 = this; + var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); + var scrollSize = 'scroll' + capitalizedDimension; - if (this._isTransitioning || !$(this._element).hasClass(ClassName.SHOW)) { - return; - } + $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); - var startEvent = $.Event(Event.HIDE); - $(this._element).trigger(startEvent); - if (startEvent.isDefaultPrevented()) { - return; + this._element.style[dimension] = this._element[scrollSize] + 'px'; } + }, { + key: 'hide', + value: function hide() { + var _this2 = this; - var dimension = this._getDimension(); - - this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + 'px'; - - Util.reflow(this._element); - - $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW); + if (this._isTransitioning || !$(this._element).hasClass(ClassName.SHOW)) { + return; + } - if (this._triggerArray.length) { - for (var i = 0; i < this._triggerArray.length; i++) { - var trigger = this._triggerArray[i]; - var selector = Util.getSelectorFromElement(trigger); - if (selector !== null) { - var $elem = $(selector); - if (!$elem.hasClass(ClassName.SHOW)) { - $(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false); - } - } + var startEvent = $.Event(Event.HIDE); + $(this._element).trigger(startEvent); + if (startEvent.isDefaultPrevented()) { + return; } - } - this.setTransitioning(true); + var dimension = this._getDimension(); - var complete = function complete() { - _this2.setTransitioning(false); - $(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN); - }; + this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + 'px'; - this._element.style[dimension] = ''; + Util.reflow(this._element); - if (!Util.supportsTransitionEnd()) { - complete(); - return; - } + $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW); - $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); - }; - - Collapse.prototype.setTransitioning = function setTransitioning(isTransitioning) { - this._isTransitioning = isTransitioning; - }; + if (this._triggerArray.length) { + for (var i = 0; i < this._triggerArray.length; i++) { + var trigger = this._triggerArray[i]; + var selector = Util.getSelectorFromElement(trigger); + if (selector !== null) { + var $elem = $(selector); + if (!$elem.hasClass(ClassName.SHOW)) { + $(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false); + } + } + } + } - Collapse.prototype.dispose = function dispose() { - $.removeData(this._element, DATA_KEY); + this.setTransitioning(true); - this._config = null; - this._parent = null; - this._element = null; - this._triggerArray = null; - this._isTransitioning = null; - }; + var complete = function complete() { + _this2.setTransitioning(false); + $(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN); + }; - // private + this._element.style[dimension] = ''; - Collapse.prototype._getConfig = function _getConfig(config) { - config = $.extend({}, Default, config); - config.toggle = Boolean(config.toggle); // coerce string values - Util.typeCheckConfig(NAME, config, DefaultType); - return config; - }; + if (!Util.supportsTransitionEnd()) { + complete(); + return; + } - Collapse.prototype._getDimension = function _getDimension() { - var hasWidth = $(this._element).hasClass(Dimension.WIDTH); - return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT; - }; + $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + } + }, { + key: 'setTransitioning', + value: function setTransitioning(isTransitioning) { + this._isTransitioning = isTransitioning; + } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + + this._config = null; + this._parent = null; + this._element = null; + this._triggerArray = null; + this._isTransitioning = null; + } - Collapse.prototype._getParent = function _getParent() { - var _this3 = this; + // private - var parent = $(this._config.parent)[0]; - var selector = '[data-toggle="collapse"][data-parent="' + this._config.parent + '"]'; + }, { + key: '_getConfig', + value: function _getConfig(config) { + config = $.extend({}, Default, config); + config.toggle = Boolean(config.toggle); // coerce string values + Util.typeCheckConfig(NAME, config, DefaultType); + return config; + } + }, { + key: '_getDimension', + value: function _getDimension() { + var hasWidth = $(this._element).hasClass(Dimension.WIDTH); + return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT; + } + }, { + key: '_getParent', + value: function _getParent() { + var _this3 = this; - $(parent).find(selector).each(function (i, element) { - _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); - }); + var parent = $(this._config.parent)[0]; + var selector = '[data-toggle="collapse"][data-parent="' + this._config.parent + '"]'; - return parent; - }; + $(parent).find(selector).each(function (i, element) { + _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); + }); - Collapse.prototype._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { - if (element) { - var isOpen = $(element).hasClass(ClassName.SHOW); + return parent; + } + }, { + key: '_addAriaAndCollapsedClass', + value: function _addAriaAndCollapsedClass(element, triggerArray) { + if (element) { + var isOpen = $(element).hasClass(ClassName.SHOW); - if (triggerArray.length) { - $(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen); + if (triggerArray.length) { + $(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen); + } } } - }; - - // static - Collapse._getTargetFromElement = function _getTargetFromElement(element) { - var selector = Util.getSelectorFromElement(element); - return selector ? $(selector)[0] : null; - }; + // static - Collapse._jQueryInterface = function _jQueryInterface(config) { - return this.each(function () { - var $this = $(this); - var data = $this.data(DATA_KEY); - var _config = $.extend({}, Default, $this.data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config); - - if (!data && _config.toggle && /show|hide/.test(config)) { - _config.toggle = false; - } - - if (!data) { - data = new Collapse(this, _config); - $this.data(DATA_KEY, data); - } + }], [{ + key: '_getTargetFromElement', + value: function _getTargetFromElement(element) { + var selector = Util.getSelectorFromElement(element); + return selector ? $(selector)[0] : null; + } + }, { + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + var $this = $(this); + var data = $this.data(DATA_KEY); + var _config = $.extend({}, Default, $this.data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config); + + if (!data && _config.toggle && /show|hide/.test(config)) { + _config.toggle = false; + } - if (typeof config === 'string') { - if (data[config] === undefined) { - throw new Error('No method named "' + config + '"'); + if (!data) { + data = new Collapse(this, _config); + $this.data(DATA_KEY, data); } - data[config](); - } - }); - }; - _createClass(Collapse, null, [{ + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new Error('No method named "' + config + '"'); + } + data[config](); + } + }); + } + }, { key: 'VERSION', get: function get() { return VERSION; @@ -335,7 +352,8 @@ var Collapse = function ($) { */ $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { - if (!/input|textarea/i.test(event.target.tagName)) { + // preventDefault only for <a> elements (which change the URL) not inside the collapsible element + if (event.target.tagName === 'A' && !$.contains(this, event.target)) { event.preventDefault(); } diff --git a/js/dist/collapse.js.map b/js/dist/collapse.js.map index 0bd5517be1..c4ec464d98 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","element","config","_isTransitioning","_element","_config","_getConfig","_triggerArray","makeArray","id","tabToggles","i","length","elem","selector","Util","getSelectorFromElement","filter","push","_parent","_getParent","_addAriaAndCollapsedClass","hasClass","hide","show","actives","activesData","children","data","startEvent","trigger","isDefaultPrevented","_jQueryInterface","call","dimension","_getDimension","removeClass","addClass","style","attr","setTransitioning","complete","supportsTransitionEnd","capitalizedDimension","toUpperCase","slice","scrollSize","one","TRANSITION_END","emulateTransitionEnd","getBoundingClientRect","reflow","$elem","isTransitioning","dispose","removeData","extend","Boolean","typeCheckConfig","hasWidth","find","each","_getTargetFromElement","triggerArray","isOpen","toggleClass","$this","test","undefined","Error","document","on","event","target","tagName","preventDefault","$trigger","$target","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAGA;;;;;;;AAOA,IAAMA,WAAY,UAACC,CAAD,EAAO;;AAGvB;;;;;;AAMA,MAAMC,OAAsB,UAA5B;AACA,MAAMC,UAAsB,YAA5B;AACA,MAAMC,WAAsB,aAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,eAAsB,WAA5B;AACA,MAAMC,qBAAsBN,EAAEO,EAAF,CAAKN,IAAL,CAA5B;AACA,MAAMO,sBAAsB,GAA5B;;AAEA,MAAMC,UAAU;AACdC,YAAS,IADK;AAEdC,YAAS;AAFK,GAAhB;;AAKA,MAAMC,cAAc;AAClBF,YAAS,SADS;AAElBC,YAAS;AAFS,GAApB;;AAKA,MAAME,QAAQ;AACZC,mBAAwBV,SADZ;AAEZW,qBAAyBX,SAFb;AAGZY,mBAAwBZ,SAHZ;AAIZa,uBAA0Bb,SAJd;AAKZc,8BAAyBd,SAAzB,GAAqCC;AALzB,GAAd;;AAQA,MAAMc,YAAY;AA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,IAAF,CAAhB;AACA,UAAMwD,OAAUiD,QAAQjD,IAAR,CAAarD,QAAb,CAAhB;AACA,UAAM2B,SAAU0B,OAAO,QAAP,GAAkBgD,SAAShD,IAAT,EAAlC;AACAzD,eAAS6D,gBAAT,CAA0BC,IAA1B,CAA+B4C,OAA/B,EAAwC3E,MAAxC;AACD,KALD;AAMD,GAbD;;AAgBA;;;;;;AAMA9B,IAAEO,EAAF,CAAKN,IAAL,IAAyBF,SAAS6D,gBAAlC;AACA5D,IAAEO,EAAF,CAAKN,IAAL,EAAWyG,WAAX,GAAyB3G,QAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAW0G,UAAX,GAAyB,YAAY;AACnC3G,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,SAAS6D,gBAAhB;AACD,GAHD;;AAKA,SAAO7D,QAAP;AAED,CA/XgB,CA+Xd6G,MA/Xc,CAAjB","file":"collapse.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): 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-beta'\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 const tabToggles = $(Selector.DATA_TOGGLE)\n for (let i = 0; i < tabToggles.length; i++) {\n const elem = tabToggles[i]\n const selector = Util.getSelectorFromElement(elem)\n if (selector !== null && $(selector).filter(element).length > 0) {\n this._triggerArray.push(elem)\n }\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 for (let i = 0; i < this._triggerArray.length; i++) {\n const trigger = this._triggerArray[i]\n const selector = Util.getSelectorFromElement(trigger)\n if (selector !== null) {\n const $elem = $(selector)\n if (!$elem.hasClass(ClassName.SHOW)) {\n $(trigger).addClass(ClassName.COLLAPSED)\n .attr('aria-expanded', false)\n }\n }\n }\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 $trigger = $(this)\n const selector = Util.getSelectorFromElement(this)\n $(selector).each(function () {\n const $target = $(this)\n const data = $target.data(DATA_KEY)\n const config = data ? 'toggle' : $trigger.data()\n Collapse._jQueryInterface.call($target, config)\n })\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","tabToggles","i","length","elem","selector","Util","getSelectorFromElement","filter","push","_parent","_getParent","_addAriaAndCollapsedClass","hasClass","hide","show","actives","activesData","children","data","startEvent","trigger","isDefaultPrevented","_jQueryInterface","call","dimension","_getDimension","removeClass","addClass","style","attr","setTransitioning","complete","supportsTransitionEnd","capitalizedDimension","toUpperCase","slice","scrollSize","one","TRANSITION_END","emulateTransitionEnd","getBoundingClientRect","reflow","$elem","isTransitioning","removeData","extend","Boolean","typeCheckConfig","hasWidth","find","each","_getTargetFromElement","triggerArray","isOpen","toggleClass","$this","test","Error","document","on","event","target","tagName","contains","preventDefault","$trigger","$target","Constructor","noConflict","jQuery"],"mappings":";;;;;;;;AAIA;;;;;;;AAOA,IAAMA,WAAY,YAAM;;AAGtB;;;;;;AAMA,MAAMC,OAAsB,UAA5B;AACA,MAAMC,UAAsB,YAA5B;AACA,MAAMC,WAAsB,aAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,eAAsB,WAA5B;AACA,MAAMC,qBAAsBC,EAAEC,EAAF,CAAKP,IAAL,CAA5B;AACA,MAAMQ,sBAAsB,GAA5B;;AAEA,MAAMC,UAAU;AACdC,YAAS,IADK;AAEdC,YAAS;AAFK,GAAhB;;AAKA,MAAMC,cAAc;AAClBF,YAAS,SADS;AAElBC,YAAS;AAFS,GAApB;;AAKA,MAAME,QAAQ;AACZC,mBAAwBX,SADZ;AAEZY,qBAAyBZ,SAFb;AAGZa,mBAAwBb,SAHZ;AAIZc,uBAA0Bd,SAJd;AAKZe,8BAAyBf,SAAzB,GAAqCC;AALzB,GAAd;;AAQA,MAAMe,YAAY;AAChBL,UAAa,MADG;AAEhBM,cAAa,UAFG;AAGhBC,gBAAa,YAHG;AAIhBC,eAAa;AAJG,GAAlB;;AAOA,MAAMC,YAAY;AAChBC,WAAS,OADO;AAEhBC,YAAS;AAFO,GAAlB;;AAKA,MAAMC,WAAW;AACfC,aAAc,oBADC;AAEfC,iBAAc;;AAIhB;;;;;;AANiB,GAAjB;AA/CsB,MA2DhB7B,QA3DgB;AA6DpB,sBAAY8B,OAAZ,EAAqBC,MAArB,EAA6B;AAAA;;AAC3B,WAAKC,gBAAL,GAAwB,KAAxB;AACA,WAAKC,QAAL,GAAwBH,OAAxB;AACA,WAAKI,OAAL,GAAwB,KAAKC,UAAL,CAAgBJ,MAAhB,CAAxB;AACA,WAAKK,aAAL,GAAwB7B,EAAE8B,SAAF,CAAY9B,EAClC,qCAAmCuB,QAAQQ,EAA3C,wDAC0CR,QA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n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): 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-beta'\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 const tabToggles = $(Selector.DATA_TOGGLE)\n for (let i = 0; i < tabToggles.length; i++) {\n const elem = tabToggles[i]\n const selector = Util.getSelectorFromElement(elem)\n if (selector !== null && $(selector).filter(element).length > 0) {\n this._triggerArray.push(elem)\n }\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 for (let i = 0; i < this._triggerArray.length; i++) {\n const trigger = this._triggerArray[i]\n const selector = Util.getSelectorFromElement(trigger)\n if (selector !== null) {\n const $elem = $(selector)\n if (!$elem.hasClass(ClassName.SHOW)) {\n $(trigger).addClass(ClassName.COLLAPSED)\n .attr('aria-expanded', false)\n }\n }\n }\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 (typeof 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 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element\n if (event.target.tagName === 'A' && !$.contains(this, event.target)) {\n event.preventDefault()\n }\n\n const $trigger = $(this)\n const selector = Util.getSelectorFromElement(this)\n $(selector).each(function () {\n const $target = $(this)\n const data = $target.data(DATA_KEY)\n const config = data ? 'toggle' : $trigger.data()\n Collapse._jQueryInterface.call($target, config)\n })\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 0b41280743..39096759c6 100644 --- a/js/dist/dropdown.js +++ b/js/dist/dropdown.js @@ -1,3 +1,5 @@ +'use strict'; + 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; }; }(); @@ -11,7 +13,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * -------------------------------------------------------------------------- */ -var Dropdown = function ($) { +var Dropdown = function () { /** * Check for Popper dependency @@ -108,278 +110,295 @@ var Dropdown = function ($) { // getters - // public + _createClass(Dropdown, [{ + key: 'toggle', - Dropdown.prototype.toggle = function toggle() { - if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) { - return; - } - var parent = Dropdown._getParentFromElement(this._element); - var isActive = $(this._menu).hasClass(ClassName.SHOW); + // public - Dropdown._clearMenus(); + value: function toggle() { + if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) { + return; + } - if (isActive) { - return; - } + var parent = Dropdown._getParentFromElement(this._element); + var isActive = $(this._menu).hasClass(ClassName.SHOW); - var relatedTarget = { - relatedTarget: this._element - }; - var showEvent = $.Event(Event.SHOW, relatedTarget); + Dropdown._clearMenus(); - $(parent).trigger(showEvent); + if (isActive) { + return; + } - if (showEvent.isDefaultPrevented()) { - return; - } + var relatedTarget = { + relatedTarget: this._element + }; + var showEvent = $.Event(Event.SHOW, relatedTarget); - var element = this._element; - // for dropup with alignment we use the parent as popper container - if ($(parent).hasClass(ClassName.DROPUP)) { - if ($(this._menu).hasClass(ClassName.MENULEFT) || $(this._menu).hasClass(ClassName.MENURIGHT)) { - element = parent; + $(parent).trigger(showEvent); + + if (showEvent.isDefaultPrevented()) { + return; } - } - this._popper = new Popper(element, this._menu, this._getPopperConfig()); - - // 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 - // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html - if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) { - $('body').children().on('mouseover', null, $.noop); - } - this._element.focus(); - this._element.setAttribute('aria-expanded', true); + var element = this._element; + // for dropup with alignment we use the parent as popper container + if ($(parent).hasClass(ClassName.DROPUP)) { + if ($(this._menu).hasClass(ClassName.MENULEFT) || $(this._menu).hasClass(ClassName.MENURIGHT)) { + element = parent; + } + } + this._popper = new Popper(element, this._menu, this._getPopperConfig()); + + // 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 + // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html + if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) { + $('body').children().on('mouseover', null, $.noop); + } - $(this._menu).toggleClass(ClassName.SHOW); - $(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.SHOWN, relatedTarget)); - }; + this._element.focus(); + this._element.setAttribute('aria-expanded', true); - 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._menu).toggleClass(ClassName.SHOW); + $(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.SHOWN, relatedTarget)); } - this._popper = null; - }; - - Dropdown.prototype.update = function update() { - this._inNavbar = this._detectNavbar(); - if (this._popper !== null) { - this._popper.scheduleUpdate(); + }, { + key: 'dispose', + value: 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; + } + }, { + key: 'update', + value: function update() { + this._inNavbar = this._detectNavbar(); + if (this._popper !== null) { + this._popper.scheduleUpdate(); + } } - }; - - // private - Dropdown.prototype._addEventListeners = function _addEventListeners() { - var _this = this; + // private - $(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()]; + }, { + key: '_addEventListeners', + value: function _addEventListeners() { + var _this = this; + + $(this._element).on(Event.CLICK, function (event) { + event.preventDefault(); + event.stopPropagation(); + _this.toggle(); + }); } + }, { + key: '_getConfig', + value: function _getConfig(config) { + var elementData = $(this._element).data(); + if (typeof 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); + config = $.extend({}, this.constructor.Default, $(this._element).data(), config); - return config; - }; + Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); - Dropdown.prototype._getMenuElement = function _getMenuElement() { - if (!this._menu) { - var parent = Dropdown._getParentFromElement(this._element); - this._menu = $(parent).find(Selector.MENU)[0]; + return config; } - return this._menu; - }; - - Dropdown.prototype._getPlacement = function _getPlacement() { - var $parentDropdown = $(this._element).parent(); - var placement = this._config.placement; - - // Handle dropup - if ($parentDropdown.hasClass(ClassName.DROPUP) || this._config.placement === AttachmentMap.TOP) { - placement = AttachmentMap.TOP; - if ($(this._menu).hasClass(ClassName.MENURIGHT)) { - placement = AttachmentMap.TOPEND; + }, { + key: '_getMenuElement', + value: function _getMenuElement() { + if (!this._menu) { + var parent = Dropdown._getParentFromElement(this._element); + this._menu = $(parent).find(Selector.MENU)[0]; } - } else if ($(this._menu).hasClass(ClassName.MENURIGHT)) { - placement = AttachmentMap.BOTTOMEND; + return this._menu; } - return placement; - }; - - Dropdown.prototype._detectNavbar = function _detectNavbar() { - return $(this._element).closest('.navbar').length > 0; - }; - - Dropdown.prototype._getPopperConfig = function _getPopperConfig() { - var popperConfig = { - placement: this._getPlacement(), - modifiers: { - offset: { - offset: this._config.offset - }, - flip: { - enabled: this._config.flip + }, { + key: '_getPlacement', + value: function _getPlacement() { + var $parentDropdown = $(this._element).parent(); + var placement = this._config.placement; + + // Handle dropup + if ($parentDropdown.hasClass(ClassName.DROPUP) || this._config.placement === AttachmentMap.TOP) { + placement = AttachmentMap.TOP; + if ($(this._menu).hasClass(ClassName.MENURIGHT)) { + placement = AttachmentMap.TOPEND; } + } else if ($(this._menu).hasClass(ClassName.MENURIGHT)) { + placement = AttachmentMap.BOTTOMEND; } + return placement; + } + }, { + key: '_detectNavbar', + value: function _detectNavbar() { + return $(this._element).closest('.navbar').length > 0; + } + }, { + key: '_getPopperConfig', + value: function _getPopperConfig() { + var popperConfig = { + placement: this._getPlacement(), + modifiers: { + offset: { + offset: this._config.offset + }, + flip: { + enabled: this._config.flip + } + } - // Disable Popper.js for Dropdown in Navbar - };if (this._inNavbar) { - popperConfig.modifiers.applyStyle = { - enabled: !this._inNavbar - }; + // Disable Popper.js for Dropdown in Navbar + };if (this._inNavbar) { + popperConfig.modifiers.applyStyle = { + enabled: !this._inNavbar + }; + } + return popperConfig; } - return popperConfig; - }; - // static + // static - 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; + }], [{ + key: '_jQueryInterface', + value: 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, _config); - $(this).data(DATA_KEY, data); - } - - if (typeof config === 'string') { - if (data[config] === undefined) { - throw new Error('No method named "' + config + '"'); + if (!data) { + data = new Dropdown(this, _config); + $(this).data(DATA_KEY, data); } - data[config](); - } - }); - }; - Dropdown._clearMenus = function _clearMenus(event) { - if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { - return; + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new Error('No method named "' + config + '"'); + } + data[config](); + } + }); } - - 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; + }, { + key: '_clearMenus', + value: function _clearMenus(event) { + if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { + return; } - var dropdownMenu = context._menu; - if (!$(parent).hasClass(ClassName.SHOW)) { - continue; - } + 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 (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) { - continue; - } + if (!context) { + continue; + } - var hideEvent = $.Event(Event.HIDE, relatedTarget); - $(parent).trigger(hideEvent); - if (hideEvent.isDefaultPrevented()) { - continue; - } + var dropdownMenu = context._menu; + if (!$(parent).hasClass(ClassName.SHOW)) { + continue; + } - // if this is a touch-enabled device we remove the extra - // empty mouseover listeners we added for iOS support - if ('ontouchstart' in document.documentElement) { - $('body').children().off('mouseover', null, $.noop); - } + if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) { + continue; + } - toggles[i].setAttribute('aria-expanded', 'false'); + var hideEvent = $.Event(Event.HIDE, relatedTarget); + $(parent).trigger(hideEvent); + if (hideEvent.isDefaultPrevented()) { + continue; + } - $(dropdownMenu).removeClass(ClassName.SHOW); - $(parent).removeClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget)); - } - }; + // if this is a touch-enabled device we remove the extra + // empty mouseover listeners we added for iOS support + if ('ontouchstart' in document.documentElement) { + $('body').children().off('mouseover', null, $.noop); + } - Dropdown._getParentFromElement = function _getParentFromElement(element) { - var parent = void 0; - var selector = Util.getSelectorFromElement(element); + toggles[i].setAttribute('aria-expanded', 'false'); - if (selector) { - parent = $(selector)[0]; + $(dropdownMenu).removeClass(ClassName.SHOW); + $(parent).removeClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget)); + } } + }, { + key: '_getParentFromElement', + value: function _getParentFromElement(element) { + var parent = void 0; + var selector = Util.getSelectorFromElement(element); - return parent || element.parentNode; - }; + if (selector) { + parent = $(selector)[0]; + } - Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { - if (!REGEXP_KEYDOWN.test(event.which) || /button/i.test(event.target.tagName) && event.which === SPACE_KEYCODE || /input|textarea/i.test(event.target.tagName)) { - return; + return parent || element.parentNode; } + }, { + key: '_dataApiKeydownHandler', + value: function _dataApiKeydownHandler(event) { + if (!REGEXP_KEYDOWN.test(event.which) || /button/i.test(event.target.tagName) && event.which === SPACE_KEYCODE || /input|textarea/i.test(event.target.tagName)) { + return; + } + + event.preventDefault(); + event.stopPropagation(); - event.preventDefault(); - event.stopPropagation(); + if (this.disabled || $(this).hasClass(ClassName.DISABLED)) { + return; + } - if (this.disabled || $(this).hasClass(ClassName.DISABLED)) { - return; - } + var parent = Dropdown._getParentFromElement(this); + var isActive = $(parent).hasClass(ClassName.SHOW); - var parent = Dropdown._getParentFromElement(this); - var isActive = $(parent).hasClass(ClassName.SHOW); + if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) { - if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) { + if (event.which === ESCAPE_KEYCODE) { + var toggle = $(parent).find(Selector.DATA_TOGGLE)[0]; + $(toggle).trigger('focus'); + } - if (event.which === ESCAPE_KEYCODE) { - var toggle = $(parent).find(Selector.DATA_TOGGLE)[0]; - $(toggle).trigger('focus'); + $(this).trigger('click'); + return; } - $(this).trigger('click'); - return; - } + var items = $(parent).find(Selector.VISIBLE_ITEMS).get(); - var items = $(parent).find(Selector.VISIBLE_ITEMS).get(); + if (!items.length) { + return; + } - if (!items.length) { - return; - } + var index = items.indexOf(event.target); - var index = items.indexOf(event.target); + if (event.which === ARROW_UP_KEYCODE && index > 0) { + // up + index--; + } - if (event.which === ARROW_UP_KEYCODE && index > 0) { - // up - index--; - } + if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { + // down + index++; + } - if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { - // down - index++; - } + if (index < 0) { + index = 0; + } - if (index < 0) { - index = 0; + items[index].focus(); } - - items[index].focus(); - }; - - _createClass(Dropdown, null, [{ + }, { key: 'VERSION', get: function get() { return VERSION; @@ -427,5 +446,5 @@ var Dropdown = function ($) { }; return Dropdown; -}(jQuery); /* global Popper */ +}(jQuery, 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 c1f128ff03..64af50fb75 100644 --- a/js/dist/dropdown.js.map +++ b/js/dist/dropdown.js.map @@ -1 +1 @@ -{"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","DROPUP","MENURIGHT","MENULEFT","Selector","DATA_TOGGLE","FORM_CHILD","MENU","NAVBAR_NAV","VISIBLE_ITEMS","AttachmentMap","TOP","TOPEND","BOTTOM","BOTTOMEND","Default","placement","offset","flip","DefaultType","element","config","_element","_popper","_config","_getConfig","_menu","_getMenuElement","_inNavbar","_detectNavbar","_addEventListeners","toggle","disabled","hasClass","parent","_getParentFromElement","isActive","_clearMenus","relatedTarget","showEvent","trigger","isDefaultPrevented","_getPopperConfig","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","_getPlacement","$parentDropdown","popperConfig","modifiers","enabled","applyStyle","_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,YAAjC;AACA,MAAMC,WAA2B,aAAjC;AACA,MAAMC,kBAA+BD,QAArC;AACA,MAAME,eAA2B,WAAjC;AACA,MAAMC,qBAA2BR,EAAES,EAAF,CAAKN,I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ACA,WAAOT,SAAS0G,gBAAhB;AACD,GAHD;;AAKA,SAAO1G,QAAP;AAED,CAnbgB,CAmbdqI,MAnbc,CAAjB,C,CAZA","file":"dropdown.js","sourcesContent":["/* global Popper */\n\nimport Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): 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-beta'\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 DROPUP : 'dropup',\n MENURIGHT : 'dropdown-menu-right',\n MENULEFT : 'dropdown-menu-left'\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 TOPEND : 'top-end',\n BOTTOM : 'bottom-start',\n BOTTOMEND : 'bottom-end'\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 this._inNavbar = this._detectNavbar()\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 let element = this._element\n // for dropup with alignment we use the parent as popper container\n if ($(parent).hasClass(ClassName.DROPUP)) {\n if ($(this._menu).hasClass(ClassName.MENULEFT) || $(this._menu).hasClass(ClassName.MENURIGHT)) {\n element = parent\n }\n }\n this._popper = new Popper(element, this._menu, this._getPopperConfig())\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 this._inNavbar = this._detectNavbar()\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 _getPlacement() {\n const $parentDropdown = $(this._element).parent()\n let placement = this._config.placement\n\n // Handle dropup\n if ($parentDropdown.hasClass(ClassName.DROPUP) || this._config.placement === AttachmentMap.TOP) {\n placement = AttachmentMap.TOP\n if ($(this._menu).hasClass(ClassName.MENURIGHT)) {\n placement = AttachmentMap.TOPEND\n }\n } else if ($(this._menu).hasClass(ClassName.MENURIGHT)) {\n placement = AttachmentMap.BOTTOMEND\n }\n return placement\n }\n\n _detectNavbar() {\n return $(this._element).closest('.navbar').length > 0\n }\n\n _getPopperConfig() {\n const popperConfig = {\n placement : this._getPlacement(),\n modifiers : {\n offset : {\n offset : this._config.offset\n },\n flip : {\n enabled : this._config.flip\n }\n }\n }\n\n // Disable Popper.js for Dropdown in Navbar\n if (this._inNavbar) {\n popperConfig.modifiers.applyStyle = {\n enabled: !this._inNavbar\n }\n }\n return popperConfig\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 +{"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","DROPUP","MENURIGHT","MENULEFT","Selector","DATA_TOGGLE","FORM_CHILD","MENU","NAVBAR_NAV","VISIBLE_ITEMS","AttachmentMap","TOP","TOPEND","BOTTOM","BOTTOMEND","Default","placement","offset","flip","DefaultType","element","config","_element","_popper","_config","_getConfig","_menu","_getMenuElement","_inNavbar","_detectNavbar","_addEventListeners","disabled","hasClass","parent","_getParentFromElement","isActive","_clearMenus","relatedTarget","showEvent","trigger","isDefaultPrevented","_getPopperConfig","document","documentElement","closest","length","children","on","noop","focus","setAttribute","toggleClass","removeData","off","destroy","scheduleUpdate","event","preventDefault","stopPropagation","toggle","elementData","data","toUpperCase","extend","constructor","Util","typeCheckConfig","find","$parentDropdown","popperConfig","_getPlacement","modifiers","enabled","applyStyle","each","which","type","toggles","makeArray","i","context","dropdownMenu","test","target","tagName","contains","hideEvent","removeClass","selector","getSelectorFromElement","parentNode","items","get","index","indexOf","_dataApiKeydownHandler","_jQueryInterface","call","e","Constructor","noConflict","jQuery"],"mappings":";;;;;;;;AAKA;;;;;;;AAOA,IAAMA,WAAY,YAAM;;AAEtB;;;;AAIA,MAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;AACjC,UAAM,IAAIC,KAAJ,CAAU,8DAAV,CAAN;AACD;;AAED;;;;;;AAMA,MAAMC,OAA2B,UAAjC;AACA,MAAMC,UAA2B,YAAjC;AACA,MAAMC,WAA2B,aAAjC;AACA,MAAMC,kBAA+BD,QAArC;AACA,MAAME,eAA2B,WAAjC;AACA,MAAMC,qBAA2BC,EAAEC,EAAF,CAAKP,IAAL,CAAjC;AACA,MAAMQ,iBAA2B,EAAjC,CAtBsB,CAsBc;AACpC,MAAMC,gBAA2B,EAAjC,CAvBsB,CAuBc;AACpC,MAAMC,cAA2B,CAAjC,CAxBsB,CAwBa;AACnC,MAAMC,mBAA2B,EAAjC,CAzBsB,CAyBc;AACpC,MAAMC,qBAA2B,EAAjC,CA1BsB,CA0Bc;AACpC,MAAMC,2BAA2B,CAAjC,CA3BsB,CA2Ba;AACnC,MAAMC,iBAA2B,IAAIC,MAAJ,CAAcJ,gBAAd,SAAkCC,kBAAlC,SAAwDJ,cAAxD,CAAjC;;AAEA,MAAMQ,QAAQ;AACZC,mBAA0Bd,SADd;AAEZe,uBAA4Bf,SAFhB;AAGZgB,mBAA0BhB,SAHd;AAIZiB,qBAA2BjB,SAJf;AAKZkB,qBAA2BlB,SALf;AAMZmB,8BAA2BnB,SAA3B,GAAuCC,YAN3B;AAOZmB,kCAA6BpB,SAA7B,GAAyCC,YAP7B;AAQZoB,8BAA2BrB,SAA3B,GAAuCC;AAR3B,GAAd;;AAWA,MAAMqB,YAAY;AAChBC,cAAY,UADI;AAEhBP,UAAY,MAFI;AAGhBQ,YAAY,QAHI;AAIh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,EAS4BQ,SAASE,UATrC,EASiD,UAAC4F,CAAD,EAAO;AACpDA,MAAExC,eAAF;AACD,GAXH;;AAcA;;;;;;AAMA9E,IAAEC,EAAF,CAAKP,IAAL,IAAyBH,SAAS6H,gBAAlC;AACApH,IAAEC,EAAF,CAAKP,IAAL,EAAW6H,WAAX,GAAyBhI,QAAzB;AACAS,IAAEC,EAAF,CAAKP,IAAL,EAAW8H,UAAX,GAAyB,YAAY;AACnCxH,MAAEC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;AACA,WAAOR,SAAS6H,gBAAhB;AACD,GAHD;;AAKA,SAAO7H,QAAP;AAED,CAnbgB,CAmbdkI,MAnbc,EAmbNjI,MAnbM,CAAjB","file":"dropdown.js","sourcesContent":["import $ from 'jquery'\nimport Popper from 'popper.js'\nimport Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): 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-beta'\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 DROPUP : 'dropup',\n MENURIGHT : 'dropdown-menu-right',\n MENULEFT : 'dropdown-menu-left'\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 TOPEND : 'top-end',\n BOTTOM : 'bottom-start',\n BOTTOMEND : 'bottom-end'\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 this._inNavbar = this._detectNavbar()\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 let element = this._element\n // for dropup with alignment we use the parent as popper container\n if ($(parent).hasClass(ClassName.DROPUP)) {\n if ($(this._menu).hasClass(ClassName.MENULEFT) || $(this._menu).hasClass(ClassName.MENURIGHT)) {\n element = parent\n }\n }\n this._popper = new Popper(element, this._menu, this._getPopperConfig())\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 this._inNavbar = this._detectNavbar()\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 (typeof 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 _getPlacement() {\n const $parentDropdown = $(this._element).parent()\n let placement = this._config.placement\n\n // Handle dropup\n if ($parentDropdown.hasClass(ClassName.DROPUP) || this._config.placement === AttachmentMap.TOP) {\n placement = AttachmentMap.TOP\n if ($(this._menu).hasClass(ClassName.MENURIGHT)) {\n placement = AttachmentMap.TOPEND\n }\n } else if ($(this._menu).hasClass(ClassName.MENURIGHT)) {\n placement = AttachmentMap.BOTTOMEND\n }\n return placement\n }\n\n _detectNavbar() {\n return $(this._element).closest('.navbar').length > 0\n }\n\n _getPopperConfig() {\n const popperConfig = {\n placement : this._getPlacement(),\n modifiers : {\n offset : {\n offset : this._config.offset\n },\n flip : {\n enabled : this._config.flip\n }\n }\n }\n\n // Disable Popper.js for Dropdown in Navbar\n if (this._inNavbar) {\n popperConfig.modifiers.applyStyle = {\n enabled: !this._inNavbar\n }\n }\n return popperConfig\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 (typeof 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, Popper)\n\nexport default Dropdown\n"]}
\ No newline at end of file diff --git a/js/dist/index.js b/js/dist/index.js new file mode 100644 index 0000000000..21d9140092 --- /dev/null +++ b/js/dist/index.js @@ -0,0 +1,22 @@ +'use strict'; + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0-alpha.6): index.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + +(function () { + if (typeof jQuery === 'undefined') { + throw new Error('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.'); + } + + var version = $.fn.jquery.split(' ')[0].split('.'); + var min = 3; + var max = 4; + if (version[0] < min || version[0] >= max) { + throw new Error('Bootstrap\'s JavaScript requires at least jQuery v3.0.0 but less than v4.0.0'); + } +})(jQuery); +//# sourceMappingURL=index.js.map
\ No newline at end of file diff --git a/js/dist/index.js.map b/js/dist/index.js.map new file mode 100644 index 0000000000..96abc6edc9 --- /dev/null +++ b/js/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/index.js"],"names":["jQuery","Error","version","$","fn","jquery","split","min","max"],"mappings":";;AAaA;;;;;;;AAOA,CAAC,YAAM;AACL,MAAI,OAAOA,MAAP,KAAkB,WAAtB,EAAmC;AACjC,UAAM,IAAIC,KAAJ,CAAU,kGAAV,CAAN;AACD;;AAED,MAAMC,UAAUC,EAAEC,EAAF,CAAKC,MAAL,CAAYC,KAAZ,CAAkB,GAAlB,EAAuB,CAAvB,EAA0BA,KAA1B,CAAgC,GAAhC,CAAhB;AACA,MAAMC,MAAM,CAAZ;AACA,MAAMC,MAAM,CAAZ;AACA,MAAIN,QAAQ,CAAR,IAAaK,GAAb,IAAoBL,QAAQ,CAAR,KAAcM,GAAtC,EAA2C;AACzC,UAAM,IAAIP,KAAJ,CAAU,8EAAV,CAAN;AACD;AACF,CAXD,EAWGD,MAXH","file":"index.js","sourcesContent":["import $ from 'jquery'\nimport Alert from './alert'\nimport Button from './button'\nimport Carousel from './carousel'\nimport Collapse from './collapse'\nimport Dropdown from './dropdown'\nimport Modal from './modal'\nimport Popover from './popover'\nimport Scrollspy from './scrollspy'\nimport Tab from './tab'\nimport Tooltip from './tooltip'\nimport Util from './util'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n(() => {\n if (typeof jQuery === 'undefined') {\n throw new Error('Bootstrap\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\'s JavaScript.')\n }\n\n const version = $.fn.jquery.split(' ')[0].split('.')\n const min = 3\n const max = 4\n if (version[0] < min || version[0] >= max) {\n throw new Error('Bootstrap\\'s JavaScript requires at least jQuery v3.0.0 but less than v4.0.0')\n }\n})(jQuery)\n\nexport {\n Util,\n Alert,\n Button,\n Carousel,\n Collapse,\n Dropdown,\n Modal,\n Popover,\n Scrollspy,\n Tab,\n Tooltip\n}\n"]}
\ No newline at end of file diff --git a/js/dist/modal.js b/js/dist/modal.js index 877111bf25..c3482de57c 100644 --- a/js/dist/modal.js +++ b/js/dist/modal.js @@ -1,3 +1,5 @@ +'use strict'; + 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; }; }(); @@ -11,7 +13,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * -------------------------------------------------------------------------- */ -var Modal = function ($) { +var Modal = function () { /** * ------------------------------------------------------------------------ @@ -70,6 +72,7 @@ var Modal = function ($) { DATA_TOGGLE: '[data-toggle="modal"]', DATA_DISMISS: '[data-dismiss="modal"]', FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top', + STICKY_CONTENT: '.sticky-top', NAVBAR_TOGGLER: '.navbar-toggler' /** @@ -96,417 +99,452 @@ var Modal = function ($) { // getters - // public - - Modal.prototype.toggle = function toggle(relatedTarget) { - return this._isShown ? this.hide() : this.show(relatedTarget); - }; - - Modal.prototype.show = function show(relatedTarget) { - var _this = this; + _createClass(Modal, [{ + key: 'toggle', - if (this._isTransitioning) { - return; - } - - if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) { - this._isTransitioning = true; - } - - var showEvent = $.Event(Event.SHOW, { - relatedTarget: relatedTarget - }); - $(this._element).trigger(showEvent); + // public - if (this._isShown || showEvent.isDefaultPrevented()) { - return; + value: function toggle(relatedTarget) { + return this._isShown ? this.hide() : this.show(relatedTarget); } + }, { + key: 'show', + value: function show(relatedTarget) { + var _this = this; - this._isShown = true; - - this._checkScrollbar(); - this._setScrollbar(); - - $(document.body).addClass(ClassName.OPEN); - - this._setEscapeEvent(); - this._setResizeEvent(); + if (this._isTransitioning) { + return; + } - $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) { - return _this.hide(event); - }); + if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) { + this._isTransitioning = true; + } - $(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () { - $(_this._element).one(Event.MOUSEUP_DISMISS, function (event) { - if ($(event.target).is(_this._element)) { - _this._ignoreBackdropClick = true; - } + var showEvent = $.Event(Event.SHOW, { + relatedTarget: relatedTarget }); - }); - this._showBackdrop(function () { - return _this._showElement(relatedTarget); - }); - }; + $(this._element).trigger(showEvent); - Modal.prototype.hide = function hide(event) { - var _this2 = this; + if (this._isShown || showEvent.isDefaultPrevented()) { + return; + } - if (event) { - event.preventDefault(); - } + this._isShown = true; - if (this._isTransitioning || !this._isShown) { - return; - } + this._checkScrollbar(); + this._setScrollbar(); - var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE); + this._adjustDialog(); - if (transition) { - this._isTransitioning = true; - } + $(document.body).addClass(ClassName.OPEN); - var hideEvent = $.Event(Event.HIDE); + this._setEscapeEvent(); + this._setResizeEvent(); - $(this._element).trigger(hideEvent); + $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) { + return _this.hide(event); + }); - if (!this._isShown || hideEvent.isDefaultPrevented()) { - return; + $(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () { + $(_this._element).one(Event.MOUSEUP_DISMISS, function (event) { + if ($(event.target).is(_this._element)) { + _this._ignoreBackdropClick = true; + } + }); + }); + + this._showBackdrop(function () { + return _this._showElement(relatedTarget); + }); } + }, { + key: 'hide', + value: function hide(event) { + var _this2 = this; - this._isShown = false; + if (event) { + event.preventDefault(); + } - this._setEscapeEvent(); - this._setResizeEvent(); + if (this._isTransitioning || !this._isShown) { + return; + } - $(document).off(Event.FOCUSIN); + var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE); - $(this._element).removeClass(ClassName.SHOW); + if (transition) { + this._isTransitioning = true; + } - $(this._element).off(Event.CLICK_DISMISS); - $(this._dialog).off(Event.MOUSEDOWN_DISMISS); + var hideEvent = $.Event(Event.HIDE); - if (transition) { + $(this._element).trigger(hideEvent); - $(this._element).one(Util.TRANSITION_END, function (event) { - return _this2._hideModal(event); - }).emulateTransitionEnd(TRANSITION_DURATION); - } else { - this._hideModal(); - } - }; + if (!this._isShown || hideEvent.isDefaultPrevented()) { + return; + } - Modal.prototype.dispose = function dispose() { - $.removeData(this._element, DATA_KEY); + this._isShown = false; - $(window, document, this._element, this._backdrop).off(EVENT_KEY); + this._setEscapeEvent(); + this._setResizeEvent(); - this._config = null; - this._element = null; - this._dialog = null; - this._backdrop = null; - this._isShown = null; - this._isBodyOverflowing = null; - this._ignoreBackdropClick = null; - this._scrollbarWidth = null; - }; + $(document).off(Event.FOCUSIN); - Modal.prototype.handleUpdate = function handleUpdate() { - this._adjustDialog(); - }; + $(this._element).removeClass(ClassName.SHOW); - // private + $(this._element).off(Event.CLICK_DISMISS); + $(this._dialog).off(Event.MOUSEDOWN_DISMISS); - Modal.prototype._getConfig = function _getConfig(config) { - config = $.extend({}, Default, config); - Util.typeCheckConfig(NAME, config, DefaultType); - return config; - }; + if (transition) { - Modal.prototype._showElement = function _showElement(relatedTarget) { - var _this3 = this; + $(this._element).one(Util.TRANSITION_END, function (event) { + return _this2._hideModal(event); + }).emulateTransitionEnd(TRANSITION_DURATION); + } else { + this._hideModal(); + } + } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); - var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE); + $(window, document, this._element, this._backdrop).off(EVENT_KEY); - if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { - // don't move modals dom position - document.body.appendChild(this._element); + this._config = null; + this._element = null; + this._dialog = null; + this._backdrop = null; + this._isShown = null; + this._isBodyOverflowing = null; + this._ignoreBackdropClick = null; + this._scrollbarWidth = null; + } + }, { + key: 'handleUpdate', + value: function handleUpdate() { + this._adjustDialog(); } - this._element.style.display = 'block'; - this._element.removeAttribute('aria-hidden'); - this._element.scrollTop = 0; + // private - if (transition) { - Util.reflow(this._element); + }, { + key: '_getConfig', + value: function _getConfig(config) { + config = $.extend({}, Default, config); + Util.typeCheckConfig(NAME, config, DefaultType); + return config; } + }, { + key: '_showElement', + value: function _showElement(relatedTarget) { + var _this3 = this; - $(this._element).addClass(ClassName.SHOW); + var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE); - if (this._config.focus) { - this._enforceFocus(); - } + if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { + // don't move modals dom position + document.body.appendChild(this._element); + } - var shownEvent = $.Event(Event.SHOWN, { - relatedTarget: relatedTarget - }); + this._element.style.display = 'block'; + this._element.removeAttribute('aria-hidden'); + this._element.scrollTop = 0; - var transitionComplete = function transitionComplete() { - if (_this3._config.focus) { - _this3._element.focus(); + if (transition) { + Util.reflow(this._element); } - _this3._isTransitioning = false; - $(_this3._element).trigger(shownEvent); - }; - - if (transition) { - $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION); - } else { - transitionComplete(); - } - }; - Modal.prototype._enforceFocus = function _enforceFocus() { - var _this4 = this; + $(this._element).addClass(ClassName.SHOW); - $(document).off(Event.FOCUSIN) // guard against infinite focus loop - .on(Event.FOCUSIN, function (event) { - if (document !== event.target && _this4._element !== event.target && !$(_this4._element).has(event.target).length) { - _this4._element.focus(); + if (this._config.focus) { + this._enforceFocus(); } - }); - }; - Modal.prototype._setEscapeEvent = function _setEscapeEvent() { - var _this5 = this; + var shownEvent = $.Event(Event.SHOWN, { + relatedTarget: relatedTarget + }); - if (this._isShown && this._config.keyboard) { - $(this._element).on(Event.KEYDOWN_DISMISS, function (event) { - if (event.which === ESCAPE_KEYCODE) { - event.preventDefault(); - _this5.hide(); + var transitionComplete = function transitionComplete() { + if (_this3._config.focus) { + _this3._element.focus(); + } + _this3._isTransitioning = false; + $(_this3._element).trigger(shownEvent); + }; + + if (transition) { + $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION); + } else { + transitionComplete(); + } + } + }, { + key: '_enforceFocus', + value: function _enforceFocus() { + var _this4 = this; + + $(document).off(Event.FOCUSIN) // guard against infinite focus loop + .on(Event.FOCUSIN, function (event) { + if (document !== event.target && _this4._element !== event.target && !$(_this4._element).has(event.target).length) { + _this4._element.focus(); } }); - } else if (!this._isShown) { - $(this._element).off(Event.KEYDOWN_DISMISS); } - }; - - Modal.prototype._setResizeEvent = function _setResizeEvent() { - var _this6 = this; - - if (this._isShown) { - $(window).on(Event.RESIZE, function (event) { - return _this6.handleUpdate(event); + }, { + key: '_setEscapeEvent', + value: function _setEscapeEvent() { + var _this5 = this; + + if (this._isShown && this._config.keyboard) { + $(this._element).on(Event.KEYDOWN_DISMISS, function (event) { + if (event.which === ESCAPE_KEYCODE) { + event.preventDefault(); + _this5.hide(); + } + }); + } else if (!this._isShown) { + $(this._element).off(Event.KEYDOWN_DISMISS); + } + } + }, { + key: '_setResizeEvent', + value: function _setResizeEvent() { + var _this6 = this; + + if (this._isShown) { + $(window).on(Event.RESIZE, function (event) { + return _this6.handleUpdate(event); + }); + } else { + $(window).off(Event.RESIZE); + } + } + }, { + key: '_hideModal', + value: function _hideModal() { + var _this7 = this; + + this._element.style.display = 'none'; + this._element.setAttribute('aria-hidden', true); + this._isTransitioning = false; + this._showBackdrop(function () { + $(document.body).removeClass(ClassName.OPEN); + _this7._resetAdjustments(); + _this7._resetScrollbar(); + $(_this7._element).trigger(Event.HIDDEN); }); - } else { - $(window).off(Event.RESIZE); } - }; - - Modal.prototype._hideModal = function _hideModal() { - var _this7 = this; - - this._element.style.display = 'none'; - this._element.setAttribute('aria-hidden', true); - this._isTransitioning = false; - this._showBackdrop(function () { - $(document.body).removeClass(ClassName.OPEN); - _this7._resetAdjustments(); - _this7._resetScrollbar(); - $(_this7._element).trigger(Event.HIDDEN); - }); - }; - - Modal.prototype._removeBackdrop = function _removeBackdrop() { - if (this._backdrop) { - $(this._backdrop).remove(); - this._backdrop = null; + }, { + key: '_removeBackdrop', + value: function _removeBackdrop() { + if (this._backdrop) { + $(this._backdrop).remove(); + this._backdrop = null; + } } - }; + }, { + key: '_showBackdrop', + value: function _showBackdrop(callback) { + var _this8 = this; - Modal.prototype._showBackdrop = function _showBackdrop(callback) { - var _this8 = this; + var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : ''; - var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : ''; + if (this._isShown && this._config.backdrop) { + var doAnimate = Util.supportsTransitionEnd() && animate; - if (this._isShown && this._config.backdrop) { - var doAnimate = Util.supportsTransitionEnd() && animate; + this._backdrop = document.createElement('div'); + this._backdrop.className = ClassName.BACKDROP; - this._backdrop = document.createElement('div'); - this._backdrop.className = ClassName.BACKDROP; + if (animate) { + $(this._backdrop).addClass(animate); + } - if (animate) { - $(this._backdrop).addClass(animate); - } + $(this._backdrop).appendTo(document.body); + + $(this._element).on(Event.CLICK_DISMISS, function (event) { + if (_this8._ignoreBackdropClick) { + _this8._ignoreBackdropClick = false; + return; + } + if (event.target !== event.currentTarget) { + return; + } + if (_this8._config.backdrop === 'static') { + _this8._element.focus(); + } else { + _this8.hide(); + } + }); + + if (doAnimate) { + Util.reflow(this._backdrop); + } - $(this._backdrop).appendTo(document.body); + $(this._backdrop).addClass(ClassName.SHOW); - $(this._element).on(Event.CLICK_DISMISS, function (event) { - if (_this8._ignoreBackdropClick) { - _this8._ignoreBackdropClick = false; + if (!callback) { return; } - if (event.target !== event.currentTarget) { + + if (!doAnimate) { + callback(); return; } - if (_this8._config.backdrop === 'static') { - _this8._element.focus(); - } else { - _this8.hide(); - } - }); - if (doAnimate) { - Util.reflow(this._backdrop); - } + $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION); + } else if (!this._isShown && this._backdrop) { + $(this._backdrop).removeClass(ClassName.SHOW); - $(this._backdrop).addClass(ClassName.SHOW); + var callbackRemove = function callbackRemove() { + _this8._removeBackdrop(); + if (callback) { + callback(); + } + }; - if (!callback) { - return; - } - - if (!doAnimate) { + if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) { + $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION); + } else { + callbackRemove(); + } + } else if (callback) { callback(); - return; } + } - $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION); - } else if (!this._isShown && this._backdrop) { - $(this._backdrop).removeClass(ClassName.SHOW); + // ---------------------------------------------------------------------- + // the following methods are used to handle overflowing modals + // todo (fat): these should probably be refactored out of modal.js + // ---------------------------------------------------------------------- - var callbackRemove = function callbackRemove() { - _this8._removeBackdrop(); - if (callback) { - callback(); - } - }; + }, { + key: '_adjustDialog', + value: function _adjustDialog() { + var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; - if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) { - $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION); - } else { - callbackRemove(); + if (!this._isBodyOverflowing && isModalOverflowing) { + this._element.style.paddingLeft = this._scrollbarWidth + 'px'; } - } else if (callback) { - callback(); - } - }; - // ---------------------------------------------------------------------- - // the following methods are used to handle overflowing modals - // todo (fat): these should probably be refactored out of modal.js - // ---------------------------------------------------------------------- - - Modal.prototype._adjustDialog = function _adjustDialog() { - var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; - - if (!this._isBodyOverflowing && isModalOverflowing) { - this._element.style.paddingLeft = this._scrollbarWidth + 'px'; + if (this._isBodyOverflowing && !isModalOverflowing) { + this._element.style.paddingRight = this._scrollbarWidth + 'px'; + } } - - if (this._isBodyOverflowing && !isModalOverflowing) { - this._element.style.paddingRight = this._scrollbarWidth + 'px'; + }, { + key: '_resetAdjustments', + value: function _resetAdjustments() { + this._element.style.paddingLeft = ''; + this._element.style.paddingRight = ''; } - }; - - Modal.prototype._resetAdjustments = function _resetAdjustments() { - this._element.style.paddingLeft = ''; - this._element.style.paddingRight = ''; - }; - - Modal.prototype._checkScrollbar = function _checkScrollbar() { - this._isBodyOverflowing = document.body.clientWidth < window.innerWidth; - this._scrollbarWidth = this._getScrollbarWidth(); - }; - - Modal.prototype._setScrollbar = function _setScrollbar() { - var _this9 = this; - - if (this._isBodyOverflowing) { - // Note: DOMNode.style.paddingRight returns the actual value or '' if not set - // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set - - // Adjust fixed content padding + }, { + key: '_checkScrollbar', + value: function _checkScrollbar() { + var rect = document.body.getBoundingClientRect(); + this._isBodyOverflowing = rect.left + rect.right < window.innerWidth; + this._scrollbarWidth = this._getScrollbarWidth(); + } + }, { + key: '_setScrollbar', + value: function _setScrollbar() { + var _this9 = this; + + if (this._isBodyOverflowing) { + // Note: DOMNode.style.paddingRight returns the actual value or '' if not set + // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set + + // Adjust fixed content padding + $(Selector.FIXED_CONTENT).each(function (index, element) { + var actualPadding = $(element)[0].style.paddingRight; + var calculatedPadding = $(element).css('padding-right'); + $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + 'px'); + }); + + // Adjust sticky content margin + $(Selector.STICKY_CONTENT).each(function (index, element) { + var actualMargin = $(element)[0].style.marginRight; + var calculatedMargin = $(element).css('margin-right'); + $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + 'px'); + }); + + // Adjust navbar-toggler margin + $(Selector.NAVBAR_TOGGLER).each(function (index, element) { + var actualMargin = $(element)[0].style.marginRight; + var calculatedMargin = $(element).css('margin-right'); + $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) + _this9._scrollbarWidth + 'px'); + }); + + // Adjust body padding + var actualPadding = document.body.style.paddingRight; + var calculatedPadding = $('body').css('padding-right'); + $('body').data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + 'px'); + } + } + }, { + key: '_resetScrollbar', + value: function _resetScrollbar() { + // Restore fixed content padding $(Selector.FIXED_CONTENT).each(function (index, element) { - var actualPadding = $(element)[0].style.paddingRight; - var calculatedPadding = $(element).css('padding-right'); - $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + 'px'); + var padding = $(element).data('padding-right'); + if (typeof padding !== 'undefined') { + $(element).css('padding-right', padding).removeData('padding-right'); + } }); - // Adjust navbar-toggler margin - $(Selector.NAVBAR_TOGGLER).each(function (index, element) { - var actualMargin = $(element)[0].style.marginRight; - var calculatedMargin = $(element).css('margin-right'); - $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) + _this9._scrollbarWidth + 'px'); + // Restore sticky content and navbar-toggler margin + $(Selector.STICKY_CONTENT + ', ' + Selector.NAVBAR_TOGGLER).each(function (index, element) { + var margin = $(element).data('margin-right'); + if (typeof margin !== 'undefined') { + $(element).css('margin-right', margin).removeData('margin-right'); + } }); - // Adjust body padding - var actualPadding = document.body.style.paddingRight; - var calculatedPadding = $('body').css('padding-right'); - $('body').data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + 'px'); - } - }; - - Modal.prototype._resetScrollbar = function _resetScrollbar() { - // Restore fixed content padding - $(Selector.FIXED_CONTENT).each(function (index, element) { - var padding = $(element).data('padding-right'); + // Restore body padding + var padding = $('body').data('padding-right'); if (typeof padding !== 'undefined') { - $(element).css('padding-right', padding).removeData('padding-right'); + $('body').css('padding-right', padding).removeData('padding-right'); } - }); + } + }, { + key: '_getScrollbarWidth', + value: function _getScrollbarWidth() { + // thx d.walsh + var scrollDiv = document.createElement('div'); + scrollDiv.className = ClassName.SCROLLBAR_MEASURER; + document.body.appendChild(scrollDiv); + var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; + document.body.removeChild(scrollDiv); + return scrollbarWidth; + } - // Restore navbar-toggler margin - $(Selector.NAVBAR_TOGGLER).each(function (index, element) { - var margin = $(element).data('margin-right'); - if (typeof margin !== 'undefined') { - $(element).css('margin-right', margin).removeData('margin-right'); - } - }); + // static - // Restore body padding - var padding = $('body').data('padding-right'); - if (typeof padding !== 'undefined') { - $('body').css('padding-right', padding).removeData('padding-right'); - } - }; - - Modal.prototype._getScrollbarWidth = function _getScrollbarWidth() { - // thx d.walsh - var scrollDiv = document.createElement('div'); - scrollDiv.className = ClassName.SCROLLBAR_MEASURER; - document.body.appendChild(scrollDiv); - var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; - document.body.removeChild(scrollDiv); - return scrollbarWidth; - }; - - // static - - Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { - return this.each(function () { - var data = $(this).data(DATA_KEY); - var _config = $.extend({}, Modal.Default, $(this).data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config); - - if (!data) { - data = new Modal(this, _config); - $(this).data(DATA_KEY, data); - } + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(config, relatedTarget) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + var _config = $.extend({}, Modal.Default, $(this).data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config); - if (typeof config === 'string') { - if (data[config] === undefined) { - throw new Error('No method named "' + config + '"'); + if (!data) { + data = new Modal(this, _config); + $(this).data(DATA_KEY, data); } - data[config](relatedTarget); - } else if (_config.show) { - data.show(relatedTarget); - } - }); - }; - _createClass(Modal, null, [{ + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new Error('No method named "' + config + '"'); + } + data[config](relatedTarget); + } else if (_config.show) { + data.show(relatedTarget); + } + }); + } + }, { key: 'VERSION', get: function get() { return VERSION; diff --git a/js/dist/modal.js.map b/js/dist/modal.js.map index 04913e26ee..3378029fa2 100644 --- a/js/dist/modal.js.map +++ b/js/dist/modal.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/modal.js"],"names":["Modal","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","TRANSITION_DURATION","BACKDROP_TRANSITION_DURATION","ESCAPE_KEYCODE","Default","backdrop","keyboard","focus","show","DefaultType","Event","HIDE","HIDDEN","SHOW","SHOWN","FOCUSIN","RESIZE","CLICK_DISMISS","KEYDOWN_DISMISS","MOUSEUP_DISMISS","MOUSEDOWN_DISMISS","CLICK_DATA_API","ClassName","SCROLLBAR_MEASURER","BACKDROP","OPEN","FADE","Selector","DIALOG","DATA_TOGGLE","DATA_DISMISS","FIXED_CONTENT","NAVBAR_TOGGLER","element","config","_config","_getConfig","_element","_dialog","find","_backdrop","_isShown","_isBodyOverflowing","_ignoreBackdropClick","_originalBodyPadding","_scrollbarWidth","toggle","relatedTarget","hide","_isTransitioning","Util","supportsTransitionEnd","hasClass","showEvent","trigger","isDefaultPrevented","_checkScrollbar","_setScrollbar","document","body","addClass","_setEscapeEvent","_setResizeEvent","on","event","one","target","is","_showBackdrop","_showElement","preventDefault","transition","hideEvent","off","removeClass","TRANSITION_END","_hideModal","emulateTransitionEnd","dispose","removeData","window","handleUpdate","_adjustDialog","extend","typeCheckConfig","parentNode","nodeType","Node","ELEMENT_NODE","appendChild","style","display","removeAttribute","scrollTop","reflow","_enforceFocus","shownEvent","transitionComplete","has","length","which","setAttribute","_resetAdjustments","_resetScrollbar","_removeBackdrop","remove","callback","animate","doAnimate","createElement","className","appendTo","currentTarget","callbackRemove","isModalOverflowing","scrollHeight","documentElement","clientHeight","paddingLeft","paddingRight","clientWidth","innerWidth","_getScrollbarWidth","each","index","actualPadding","calculatedPadding","css","data","parseFloat","actualMargin","marginRight","calculatedMargin","padding","margin","scrollDiv","scrollbarWidth","getBoundingClientRect","width","removeChild","_jQueryInterface","undefined","Error","selector","getSelectorFromElement","tagName","$target","call","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAGA;;;;;;;AAOA,IAAMA,QAAS,UAACC,CAAD,EAAO;;AAGpB;;;;;;AAMA,MAAMC,OAA+B,OAArC;AACA,MAAMC,UAA+B,YAArC;AACA,MAAMC,WAA+B,UAArC;AACA,MAAMC,kBAAmCD,QAAzC;AACA,MAAME,eAA+B,WAArC;AACA,MAAMC,qBAA+BN,EAAEO,EAAF,CAAKN,IAAL,CAArC;AACA,MAAMO,sBAA+B,GAArC;AACA,MAAMC,+BAA+B,GAArC;AACA,MAAMC,iBAA+B,EAArC,CAjBoB,CAiBoB;;AAExC,MAAMC,UAAU;AACdC,cAAW,IADG;AAEdC,cAAW,IAFG;AAGdC,WAAW,IAHG;AAIdC,UAAW;AAJG,GAAhB;;AAOA,MAAMC,cAAc;AAClBJ,cAAW,kBADO;AAElBC,cAAW,SAFO;AAGlBC,WAAW,SAHO;AAIlBC,UAAW;AAJO,GAApB;;AAOA,MAAME,QAAQ;AACZC,mBAA2Bd,SADf;AAEZe,uBAA6Bf,SAFjB;AAGZgB,mBAA2BhB,SAHf;AAIZiB,qBAA4BjB,SAJhB;AAKZkB,yBAA8BlB,SALlB;AAMZmB,uBAA6BnB,SANjB;AAOZoB,qCAAoCpB,SAPxB;AAQZqB,yCAAsCrB,SAR1B;AASZsB,yCAAsCtB,SAT1B;AAUZuB,6CAAwCvB,SAV5B;AAWZwB,8BAA4BxB,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n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Modal = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'modal'\n const VERSION = '4.0.0-beta'\n const DATA_KEY = 'bs.modal'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 300\n const BACKDROP_TRANSITION_DURATION = 150\n const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key\n\n const Default = {\n backdrop : true,\n keyboard : true,\n focus : true,\n show : true\n }\n\n const DefaultType = {\n backdrop : '(boolean|string)',\n keyboard : 'boolean',\n focus : 'boolean',\n show : 'boolean'\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 FOCUSIN : `focusin${EVENT_KEY}`,\n RESIZE : `resize${EVENT_KEY}`,\n CLICK_DISMISS : `click.dismiss${EVENT_KEY}`,\n KEYDOWN_DISMISS : `keydown.dismiss${EVENT_KEY}`,\n MOUSEUP_DISMISS : `mouseup.dismiss${EVENT_KEY}`,\n MOUSEDOWN_DISMISS : `mousedown.dismiss${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n SCROLLBAR_MEASURER : 'modal-scrollbar-measure',\n BACKDROP : 'modal-backdrop',\n OPEN : 'modal-open',\n FADE : 'fade',\n SHOW : 'show'\n }\n\n const Selector = {\n DIALOG : '.modal-dialog',\n DATA_TOGGLE : '[data-toggle=\"modal\"]',\n DATA_DISMISS : '[data-dismiss=\"modal\"]',\n FIXED_CONTENT : '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',\n NAVBAR_TOGGLER : '.navbar-toggler'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Modal {\n\n constructor(element, config) {\n this._config = this._getConfig(config)\n this._element = element\n this._dialog = $(element).find(Selector.DIALOG)[0]\n this._backdrop = null\n this._isShown = false\n this._isBodyOverflowing = false\n this._ignoreBackdropClick = false\n this._originalBodyPadding = 0\n this._scrollbarWidth = 0\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(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget)\n }\n\n show(relatedTarget) {\n if (this._isTransitioning) {\n return\n }\n\n if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {\n this._isTransitioning = true\n }\n\n const showEvent = $.Event(Event.SHOW, {\n relatedTarget\n })\n\n $(this._element).trigger(showEvent)\n\n if (this._isShown || showEvent.isDefaultPrevented()) {\n return\n }\n\n this._isShown = true\n\n this._checkScrollbar()\n this._setScrollbar()\n\n $(document.body).addClass(ClassName.OPEN)\n\n this._setEscapeEvent()\n this._setResizeEvent()\n\n $(this._element).on(\n Event.CLICK_DISMISS,\n Selector.DATA_DISMISS,\n (event) => this.hide(event)\n )\n\n $(this._dialog).on(Event.MOUSEDOWN_DISMISS, () => {\n $(this._element).one(Event.MOUSEUP_DISMISS, (event) => {\n if ($(event.target).is(this._element)) {\n this._ignoreBackdropClick = true\n }\n })\n })\n\n this._showBackdrop(() => this._showElement(relatedTarget))\n }\n\n hide(event) {\n if (event) {\n event.preventDefault()\n }\n\n if (this._isTransitioning || !this._isShown) {\n return\n }\n\n const transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)\n\n if (transition) {\n this._isTransitioning = true\n }\n\n const hideEvent = $.Event(Event.HIDE)\n\n $(this._element).trigger(hideEvent)\n\n if (!this._isShown || hideEvent.isDefaultPrevented()) {\n return\n }\n\n this._isShown = false\n\n this._setEscapeEvent()\n this._setResizeEvent()\n\n $(document).off(Event.FOCUSIN)\n\n $(this._element).removeClass(ClassName.SHOW)\n\n $(this._element).off(Event.CLICK_DISMISS)\n $(this._dialog).off(Event.MOUSEDOWN_DISMISS)\n\n if (transition) {\n\n $(this._element)\n .one(Util.TRANSITION_END, (event) => this._hideModal(event))\n .emulateTransitionEnd(TRANSITION_DURATION)\n } else {\n this._hideModal()\n }\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n\n $(window, document, this._element, this._backdrop).off(EVENT_KEY)\n\n this._config = null\n this._element = null\n this._dialog = null\n this._backdrop = null\n this._isShown = null\n this._isBodyOverflowing = null\n this._ignoreBackdropClick = null\n this._scrollbarWidth = null\n }\n\n handleUpdate() {\n this._adjustDialog()\n }\n\n // private\n\n _getConfig(config) {\n config = $.extend({}, Default, config)\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _showElement(relatedTarget) {\n const transition = Util.supportsTransitionEnd() &&\n $(this._element).hasClass(ClassName.FADE)\n\n if (!this._element.parentNode ||\n this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {\n // don't move modals dom position\n document.body.appendChild(this._element)\n }\n\n this._element.style.display = 'block'\n this._element.removeAttribute('aria-hidden')\n this._element.scrollTop = 0\n\n if (transition) {\n Util.reflow(this._element)\n }\n\n $(this._element).addClass(ClassName.SHOW)\n\n if (this._config.focus) {\n this._enforceFocus()\n }\n\n const shownEvent = $.Event(Event.SHOWN, {\n relatedTarget\n })\n\n const transitionComplete = () => {\n if (this._config.focus) {\n this._element.focus()\n }\n this._isTransitioning = false\n $(this._element).trigger(shownEvent)\n }\n\n if (transition) {\n $(this._dialog)\n .one(Util.TRANSITION_END, transitionComplete)\n .emulateTransitionEnd(TRANSITION_DURATION)\n } else {\n transitionComplete()\n }\n }\n\n _enforceFocus() {\n $(document)\n .off(Event.FOCUSIN) // guard against infinite focus loop\n .on(Event.FOCUSIN, (event) => {\n if (document !== event.target &&\n this._element !== event.target &&\n !$(this._element).has(event.target).length) {\n this._element.focus()\n }\n })\n }\n\n _setEscapeEvent() {\n if (this._isShown && this._config.keyboard) {\n $(this._element).on(Event.KEYDOWN_DISMISS, (event) => {\n if (event.which === ESCAPE_KEYCODE) {\n event.preventDefault()\n this.hide()\n }\n })\n\n } else if (!this._isShown) {\n $(this._element).off(Event.KEYDOWN_DISMISS)\n }\n }\n\n _setResizeEvent() {\n if (this._isShown) {\n $(window).on(Event.RESIZE, (event) => this.handleUpdate(event))\n } else {\n $(window).off(Event.RESIZE)\n }\n }\n\n _hideModal() {\n this._element.style.display = 'none'\n this._element.setAttribute('aria-hidden', true)\n this._isTransitioning = false\n this._showBackdrop(() => {\n $(document.body).removeClass(ClassName.OPEN)\n this._resetAdjustments()\n this._resetScrollbar()\n $(this._element).trigger(Event.HIDDEN)\n })\n }\n\n _removeBackdrop() {\n if (this._backdrop) {\n $(this._backdrop).remove()\n this._backdrop = null\n }\n }\n\n _showBackdrop(callback) {\n const animate = $(this._element).hasClass(ClassName.FADE) ?\n ClassName.FADE : ''\n\n if (this._isShown && this._config.backdrop) {\n const doAnimate = Util.supportsTransitionEnd() && animate\n\n this._backdrop = document.createElement('div')\n this._backdrop.className = ClassName.BACKDROP\n\n if (animate) {\n $(this._backdrop).addClass(animate)\n }\n\n $(this._backdrop).appendTo(document.body)\n\n $(this._element).on(Event.CLICK_DISMISS, (event) => {\n if (this._ignoreBackdropClick) {\n this._ignoreBackdropClick = false\n return\n }\n if (event.target !== event.currentTarget) {\n return\n }\n if (this._config.backdrop === 'static') {\n this._element.focus()\n } else {\n this.hide()\n }\n })\n\n if (doAnimate) {\n Util.reflow(this._backdrop)\n }\n\n $(this._backdrop).addClass(ClassName.SHOW)\n\n if (!callback) {\n return\n }\n\n if (!doAnimate) {\n callback()\n return\n }\n\n $(this._backdrop)\n .one(Util.TRANSITION_END, callback)\n .emulateTransitionEnd(BACKDROP_TRANSITION_DURATION)\n\n } else if (!this._isShown && this._backdrop) {\n $(this._backdrop).removeClass(ClassName.SHOW)\n\n const callbackRemove = () => {\n this._removeBackdrop()\n if (callback) {\n callback()\n }\n }\n\n if (Util.supportsTransitionEnd() &&\n $(this._element).hasClass(ClassName.FADE)) {\n $(this._backdrop)\n .one(Util.TRANSITION_END, callbackRemove)\n .emulateTransitionEnd(BACKDROP_TRANSITION_DURATION)\n } else {\n callbackRemove()\n }\n\n } else if (callback) {\n callback()\n }\n }\n\n\n // ----------------------------------------------------------------------\n // the following methods are used to handle overflowing modals\n // todo (fat): these should probably be refactored out of modal.js\n // ----------------------------------------------------------------------\n\n _adjustDialog() {\n const isModalOverflowing =\n this._element.scrollHeight > document.documentElement.clientHeight\n\n if (!this._isBodyOverflowing && isModalOverflowing) {\n this._element.style.paddingLeft = `${this._scrollbarWidth}px`\n }\n\n if (this._isBodyOverflowing && !isModalOverflowing) {\n this._element.style.paddingRight = `${this._scrollbarWidth}px`\n }\n }\n\n _resetAdjustments() {\n this._element.style.paddingLeft = ''\n this._element.style.paddingRight = ''\n }\n\n _checkScrollbar() {\n this._isBodyOverflowing = document.body.clientWidth < window.innerWidth\n this._scrollbarWidth = this._getScrollbarWidth()\n }\n\n _setScrollbar() {\n if (this._isBodyOverflowing) {\n // Note: DOMNode.style.paddingRight returns the actual value or '' if not set\n // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set\n\n // Adjust fixed content padding\n $(Selector.FIXED_CONTENT).each((index, element) => {\n const actualPadding = $(element)[0].style.paddingRight\n const calculatedPadding = $(element).css('padding-right')\n $(element).data('padding-right', actualPadding).css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)\n })\n\n // Adjust navbar-toggler margin\n $(Selector.NAVBAR_TOGGLER).each((index, element) => {\n const actualMargin = $(element)[0].style.marginRight\n const calculatedMargin = $(element).css('margin-right')\n $(element).data('margin-right', actualMargin).css('margin-right', `${parseFloat(calculatedMargin) + this._scrollbarWidth}px`)\n })\n\n // Adjust body padding\n const actualPadding = document.body.style.paddingRight\n const calculatedPadding = $('body').css('padding-right')\n $('body').data('padding-right', actualPadding).css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)\n }\n }\n\n _resetScrollbar() {\n // Restore fixed content padding\n $(Selector.FIXED_CONTENT).each((index, element) => {\n const padding = $(element).data('padding-right')\n if (typeof padding !== 'undefined') {\n $(element).css('padding-right', padding).removeData('padding-right')\n }\n })\n\n // Restore navbar-toggler margin\n $(Selector.NAVBAR_TOGGLER).each((index, element) => {\n const margin = $(element).data('margin-right')\n if (typeof margin !== 'undefined') {\n $(element).css('margin-right', margin).removeData('margin-right')\n }\n })\n\n // Restore body padding\n const padding = $('body').data('padding-right')\n if (typeof padding !== 'undefined') {\n $('body').css('padding-right', padding).removeData('padding-right')\n }\n }\n\n _getScrollbarWidth() { // thx d.walsh\n const scrollDiv = document.createElement('div')\n scrollDiv.className = ClassName.SCROLLBAR_MEASURER\n document.body.appendChild(scrollDiv)\n const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth\n document.body.removeChild(scrollDiv)\n return scrollbarWidth\n }\n\n\n // static\n\n static _jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = $.extend(\n {},\n Modal.Default,\n $(this).data(),\n typeof config === 'object' && config\n )\n\n if (!data) {\n data = new Modal(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](relatedTarget)\n } else if (_config.show) {\n data.show(relatedTarget)\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 let target\n const selector = Util.getSelectorFromElement(this)\n\n if (selector) {\n target = $(selector)[0]\n }\n\n const config = $(target).data(DATA_KEY) ?\n 'toggle' : $.extend({}, $(target).data(), $(this).data())\n\n if (this.tagName === 'A' || this.tagName === 'AREA') {\n event.preventDefault()\n }\n\n const $target = $(target).one(Event.SHOW, (showEvent) => {\n if (showEvent.isDefaultPrevented()) {\n // only register focus restorer if modal will actually get shown\n return\n }\n\n $target.one(Event.HIDDEN, () => {\n if ($(this).is(':visible')) {\n this.focus()\n }\n })\n })\n\n Modal._jQueryInterface.call($(target), config, this)\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Modal._jQueryInterface\n $.fn[NAME].Constructor = Modal\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Modal._jQueryInterface\n }\n\n return Modal\n\n})(jQuery)\n\nexport default Modal\n"]}
\ No newline at end of file +{"version":3,"sources":["../src/modal.js"],"names":["Modal","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","TRANSITION_DURATION","BACKDROP_TRANSITION_DURATION","ESCAPE_KEYCODE","Default","backdrop","keyboard","focus","show","DefaultType","Event","HIDE","HIDDEN","SHOW","SHOWN","FOCUSIN","RESIZE","CLICK_DISMISS","KEYDOWN_DISMISS","MOUSEUP_DISMISS","MOUSEDOWN_DISMISS","CLICK_DATA_API","ClassName","SCROLLBAR_MEASURER","BACKDROP","OPEN","FADE","Selector","DIALOG","DATA_TOGGLE","DATA_DISMISS","FIXED_CONTENT","STICKY_CONTENT","NAVBAR_TOGGLER","element","config","_config","_getConfig","_element","_dialog","find","_backdrop","_isShown","_isBodyOverflowing","_ignoreBackdropClick","_originalBodyPadding","_scrollbarWidth","relatedTarget","hide","_isTransitioning","Util","supportsTransitionEnd","hasClass","showEvent","trigger","isDefaultPrevented","_checkScrollbar","_setScrollbar","_adjustDialog","document","body","addClass","_setEscapeEvent","_setResizeEvent","on","event","one","target","is","_showBackdrop","_showElement","preventDefault","transition","hideEvent","off","removeClass","TRANSITION_END","_hideModal","emulateTransitionEnd","removeData","window","extend","typeCheckConfig","parentNode","nodeType","Node","ELEMENT_NODE","appendChild","style","display","removeAttribute","scrollTop","reflow","_enforceFocus","shownEvent","transitionComplete","has","length","which","handleUpdate","setAttribute","_resetAdjustments","_resetScrollbar","remove","callback","animate","doAnimate","createElement","className","appendTo","currentTarget","callbackRemove","_removeBackdrop","isModalOverflowing","scrollHeight","documentElement","clientHeight","paddingLeft","paddingRight","rect","getBoundingClientRect","left","right","innerWidth","_getScrollbarWidth","each","index","actualPadding","calculatedPadding","css","data","parseFloat","actualMargin","marginRight","calculatedMargin","padding","margin","scrollDiv","scrollbarWidth","width","clientWidth","removeChild","Error","selector","getSelectorFromElement","tagName","$target","_jQueryInterface","call","Constructor","noConflict","jQuery"],"mappings":";;;;;;;;AAIA;;;;;;;AAOA,IAAMA,QAAS,YAAM;;AAGnB;;;;;;AAMA,MAAMC,OAA+B,OAArC;AACA,MAAMC,UAA+B,YAArC;AACA,MAAMC,WAA+B,UAArC;AACA,MAAMC,kBAAmCD,QAAzC;AACA,MAAME,eAA+B,WAArC;AACA,MAAMC,qBAA+BC,EAAEC,EAAF,CAAKP,IAAL,CAArC;AACA,MAAMQ,sBAA+B,GAArC;AACA,MAAMC,+BAA+B,GAArC;AACA,MAAMC,iBAA+B,EAArC,CAjBmB,CAiBqB;;AAExC,MAAMC,UAAU;AACdC,cAAW,IADG;AAEdC,cAAW,IAFG;AAGdC,WAAW,IAHG;AAIdC,UAAW;AAJG,GAAhB;;AAOA,MAAMC,cAAc;AAClBJ,cAAW,kBADO;AAElBC,cAAW,SAFO;AAGlBC,WAAW,SAHO;AAIlBC,UAAW;AAJO,GAApB;;AAOA,MAAME,QAAQ;AACZC,mBAA2Bf,SADf;AAEZgB,uBAA6BhB,SAFjB;AAGZiB,mBAA2BjB,SAHf;AAIZkB,qBAA4BlB,SAJhB;AAKZmB,yBAA8BnB,SALlB;AAMZoB,uBAA6BpB,SANjB;AAOZqB,qCAAoCrB,SAPx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;;AAMApC,IAAEC,EAAF,CAAKP,IAAL,IAAyBD,MAAM2J,gBAA/B;AACApJ,IAAEC,EAAF,CAAKP,IAAL,EAAW4J,WAAX,GAAyB7J,KAAzB;AACAO,IAAEC,EAAF,CAAKP,IAAL,EAAW6J,UAAX,GAAyB,YAAY;AACnCvJ,MAAEC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;AACA,WAAON,MAAM2J,gBAAb;AACD,GAHD;;AAKA,SAAO3J,KAAP;AAED,CAhkBa,CAgkBX+J,MAhkBW,CAAd","file":"modal.js","sourcesContent":["import $ from 'jquery'\nimport Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Modal = (() => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'modal'\n const VERSION = '4.0.0-beta'\n const DATA_KEY = 'bs.modal'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 300\n const BACKDROP_TRANSITION_DURATION = 150\n const ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key\n\n const Default = {\n backdrop : true,\n keyboard : true,\n focus : true,\n show : true\n }\n\n const DefaultType = {\n backdrop : '(boolean|string)',\n keyboard : 'boolean',\n focus : 'boolean',\n show : 'boolean'\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 FOCUSIN : `focusin${EVENT_KEY}`,\n RESIZE : `resize${EVENT_KEY}`,\n CLICK_DISMISS : `click.dismiss${EVENT_KEY}`,\n KEYDOWN_DISMISS : `keydown.dismiss${EVENT_KEY}`,\n MOUSEUP_DISMISS : `mouseup.dismiss${EVENT_KEY}`,\n MOUSEDOWN_DISMISS : `mousedown.dismiss${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n SCROLLBAR_MEASURER : 'modal-scrollbar-measure',\n BACKDROP : 'modal-backdrop',\n OPEN : 'modal-open',\n FADE : 'fade',\n SHOW : 'show'\n }\n\n const Selector = {\n DIALOG : '.modal-dialog',\n DATA_TOGGLE : '[data-toggle=\"modal\"]',\n DATA_DISMISS : '[data-dismiss=\"modal\"]',\n FIXED_CONTENT : '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',\n STICKY_CONTENT : '.sticky-top',\n NAVBAR_TOGGLER : '.navbar-toggler'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Modal {\n\n constructor(element, config) {\n this._config = this._getConfig(config)\n this._element = element\n this._dialog = $(element).find(Selector.DIALOG)[0]\n this._backdrop = null\n this._isShown = false\n this._isBodyOverflowing = false\n this._ignoreBackdropClick = false\n this._originalBodyPadding = 0\n this._scrollbarWidth = 0\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(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget)\n }\n\n show(relatedTarget) {\n if (this._isTransitioning) {\n return\n }\n\n if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {\n this._isTransitioning = true\n }\n\n const showEvent = $.Event(Event.SHOW, {\n relatedTarget\n })\n\n $(this._element).trigger(showEvent)\n\n if (this._isShown || showEvent.isDefaultPrevented()) {\n return\n }\n\n this._isShown = true\n\n this._checkScrollbar()\n this._setScrollbar()\n\n this._adjustDialog()\n\n $(document.body).addClass(ClassName.OPEN)\n\n this._setEscapeEvent()\n this._setResizeEvent()\n\n $(this._element).on(\n Event.CLICK_DISMISS,\n Selector.DATA_DISMISS,\n (event) => this.hide(event)\n )\n\n $(this._dialog).on(Event.MOUSEDOWN_DISMISS, () => {\n $(this._element).one(Event.MOUSEUP_DISMISS, (event) => {\n if ($(event.target).is(this._element)) {\n this._ignoreBackdropClick = true\n }\n })\n })\n\n this._showBackdrop(() => this._showElement(relatedTarget))\n }\n\n hide(event) {\n if (event) {\n event.preventDefault()\n }\n\n if (this._isTransitioning || !this._isShown) {\n return\n }\n\n const transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)\n\n if (transition) {\n this._isTransitioning = true\n }\n\n const hideEvent = $.Event(Event.HIDE)\n\n $(this._element).trigger(hideEvent)\n\n if (!this._isShown || hideEvent.isDefaultPrevented()) {\n return\n }\n\n this._isShown = false\n\n this._setEscapeEvent()\n this._setResizeEvent()\n\n $(document).off(Event.FOCUSIN)\n\n $(this._element).removeClass(ClassName.SHOW)\n\n $(this._element).off(Event.CLICK_DISMISS)\n $(this._dialog).off(Event.MOUSEDOWN_DISMISS)\n\n if (transition) {\n\n $(this._element)\n .one(Util.TRANSITION_END, (event) => this._hideModal(event))\n .emulateTransitionEnd(TRANSITION_DURATION)\n } else {\n this._hideModal()\n }\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n\n $(window, document, this._element, this._backdrop).off(EVENT_KEY)\n\n this._config = null\n this._element = null\n this._dialog = null\n this._backdrop = null\n this._isShown = null\n this._isBodyOverflowing = null\n this._ignoreBackdropClick = null\n this._scrollbarWidth = null\n }\n\n handleUpdate() {\n this._adjustDialog()\n }\n\n // private\n\n _getConfig(config) {\n config = $.extend({}, Default, config)\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _showElement(relatedTarget) {\n const transition = Util.supportsTransitionEnd() &&\n $(this._element).hasClass(ClassName.FADE)\n\n if (!this._element.parentNode ||\n this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {\n // don't move modals dom position\n document.body.appendChild(this._element)\n }\n\n this._element.style.display = 'block'\n this._element.removeAttribute('aria-hidden')\n this._element.scrollTop = 0\n\n if (transition) {\n Util.reflow(this._element)\n }\n\n $(this._element).addClass(ClassName.SHOW)\n\n if (this._config.focus) {\n this._enforceFocus()\n }\n\n const shownEvent = $.Event(Event.SHOWN, {\n relatedTarget\n })\n\n const transitionComplete = () => {\n if (this._config.focus) {\n this._element.focus()\n }\n this._isTransitioning = false\n $(this._element).trigger(shownEvent)\n }\n\n if (transition) {\n $(this._dialog)\n .one(Util.TRANSITION_END, transitionComplete)\n .emulateTransitionEnd(TRANSITION_DURATION)\n } else {\n transitionComplete()\n }\n }\n\n _enforceFocus() {\n $(document)\n .off(Event.FOCUSIN) // guard against infinite focus loop\n .on(Event.FOCUSIN, (event) => {\n if (document !== event.target &&\n this._element !== event.target &&\n !$(this._element).has(event.target).length) {\n this._element.focus()\n }\n })\n }\n\n _setEscapeEvent() {\n if (this._isShown && this._config.keyboard) {\n $(this._element).on(Event.KEYDOWN_DISMISS, (event) => {\n if (event.which === ESCAPE_KEYCODE) {\n event.preventDefault()\n this.hide()\n }\n })\n\n } else if (!this._isShown) {\n $(this._element).off(Event.KEYDOWN_DISMISS)\n }\n }\n\n _setResizeEvent() {\n if (this._isShown) {\n $(window).on(Event.RESIZE, (event) => this.handleUpdate(event))\n } else {\n $(window).off(Event.RESIZE)\n }\n }\n\n _hideModal() {\n this._element.style.display = 'none'\n this._element.setAttribute('aria-hidden', true)\n this._isTransitioning = false\n this._showBackdrop(() => {\n $(document.body).removeClass(ClassName.OPEN)\n this._resetAdjustments()\n this._resetScrollbar()\n $(this._element).trigger(Event.HIDDEN)\n })\n }\n\n _removeBackdrop() {\n if (this._backdrop) {\n $(this._backdrop).remove()\n this._backdrop = null\n }\n }\n\n _showBackdrop(callback) {\n const animate = $(this._element).hasClass(ClassName.FADE) ?\n ClassName.FADE : ''\n\n if (this._isShown && this._config.backdrop) {\n const doAnimate = Util.supportsTransitionEnd() && animate\n\n this._backdrop = document.createElement('div')\n this._backdrop.className = ClassName.BACKDROP\n\n if (animate) {\n $(this._backdrop).addClass(animate)\n }\n\n $(this._backdrop).appendTo(document.body)\n\n $(this._element).on(Event.CLICK_DISMISS, (event) => {\n if (this._ignoreBackdropClick) {\n this._ignoreBackdropClick = false\n return\n }\n if (event.target !== event.currentTarget) {\n return\n }\n if (this._config.backdrop === 'static') {\n this._element.focus()\n } else {\n this.hide()\n }\n })\n\n if (doAnimate) {\n Util.reflow(this._backdrop)\n }\n\n $(this._backdrop).addClass(ClassName.SHOW)\n\n if (!callback) {\n return\n }\n\n if (!doAnimate) {\n callback()\n return\n }\n\n $(this._backdrop)\n .one(Util.TRANSITION_END, callback)\n .emulateTransitionEnd(BACKDROP_TRANSITION_DURATION)\n\n } else if (!this._isShown && this._backdrop) {\n $(this._backdrop).removeClass(ClassName.SHOW)\n\n const callbackRemove = () => {\n this._removeBackdrop()\n if (callback) {\n callback()\n }\n }\n\n if (Util.supportsTransitionEnd() &&\n $(this._element).hasClass(ClassName.FADE)) {\n $(this._backdrop)\n .one(Util.TRANSITION_END, callbackRemove)\n .emulateTransitionEnd(BACKDROP_TRANSITION_DURATION)\n } else {\n callbackRemove()\n }\n\n } else if (callback) {\n callback()\n }\n }\n\n\n // ----------------------------------------------------------------------\n // the following methods are used to handle overflowing modals\n // todo (fat): these should probably be refactored out of modal.js\n // ----------------------------------------------------------------------\n\n _adjustDialog() {\n const isModalOverflowing =\n this._element.scrollHeight > document.documentElement.clientHeight\n\n if (!this._isBodyOverflowing && isModalOverflowing) {\n this._element.style.paddingLeft = `${this._scrollbarWidth}px`\n }\n\n if (this._isBodyOverflowing && !isModalOverflowing) {\n this._element.style.paddingRight = `${this._scrollbarWidth}px`\n }\n }\n\n _resetAdjustments() {\n this._element.style.paddingLeft = ''\n this._element.style.paddingRight = ''\n }\n\n _checkScrollbar() {\n const rect = document.body.getBoundingClientRect()\n this._isBodyOverflowing = rect.left + rect.right < window.innerWidth\n this._scrollbarWidth = this._getScrollbarWidth()\n }\n\n _setScrollbar() {\n if (this._isBodyOverflowing) {\n // Note: DOMNode.style.paddingRight returns the actual value or '' if not set\n // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set\n\n // Adjust fixed content padding\n $(Selector.FIXED_CONTENT).each((index, element) => {\n const actualPadding = $(element)[0].style.paddingRight\n const calculatedPadding = $(element).css('padding-right')\n $(element).data('padding-right', actualPadding).css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)\n })\n\n // Adjust sticky content margin\n $(Selector.STICKY_CONTENT).each((index, element) => {\n const actualMargin = $(element)[0].style.marginRight\n const calculatedMargin = $(element).css('margin-right')\n $(element).data('margin-right', actualMargin).css('margin-right', `${parseFloat(calculatedMargin) - this._scrollbarWidth}px`)\n })\n\n // Adjust navbar-toggler margin\n $(Selector.NAVBAR_TOGGLER).each((index, element) => {\n const actualMargin = $(element)[0].style.marginRight\n const calculatedMargin = $(element).css('margin-right')\n $(element).data('margin-right', actualMargin).css('margin-right', `${parseFloat(calculatedMargin) + this._scrollbarWidth}px`)\n })\n\n // Adjust body padding\n const actualPadding = document.body.style.paddingRight\n const calculatedPadding = $('body').css('padding-right')\n $('body').data('padding-right', actualPadding).css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)\n }\n }\n\n _resetScrollbar() {\n // Restore fixed content padding\n $(Selector.FIXED_CONTENT).each((index, element) => {\n const padding = $(element).data('padding-right')\n if (typeof padding !== 'undefined') {\n $(element).css('padding-right', padding).removeData('padding-right')\n }\n })\n\n // Restore sticky content and navbar-toggler margin\n $(`${Selector.STICKY_CONTENT}, ${Selector.NAVBAR_TOGGLER}`).each((index, element) => {\n const margin = $(element).data('margin-right')\n if (typeof margin !== 'undefined') {\n $(element).css('margin-right', margin).removeData('margin-right')\n }\n })\n\n // Restore body padding\n const padding = $('body').data('padding-right')\n if (typeof padding !== 'undefined') {\n $('body').css('padding-right', padding).removeData('padding-right')\n }\n }\n\n _getScrollbarWidth() { // thx d.walsh\n const scrollDiv = document.createElement('div')\n scrollDiv.className = ClassName.SCROLLBAR_MEASURER\n document.body.appendChild(scrollDiv)\n const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth\n document.body.removeChild(scrollDiv)\n return scrollbarWidth\n }\n\n\n // static\n\n static _jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = $.extend(\n {},\n Modal.Default,\n $(this).data(),\n typeof config === 'object' && config\n )\n\n if (!data) {\n data = new Modal(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config](relatedTarget)\n } else if (_config.show) {\n data.show(relatedTarget)\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 let target\n const selector = Util.getSelectorFromElement(this)\n\n if (selector) {\n target = $(selector)[0]\n }\n\n const config = $(target).data(DATA_KEY) ?\n 'toggle' : $.extend({}, $(target).data(), $(this).data())\n\n if (this.tagName === 'A' || this.tagName === 'AREA') {\n event.preventDefault()\n }\n\n const $target = $(target).one(Event.SHOW, (showEvent) => {\n if (showEvent.isDefaultPrevented()) {\n // only register focus restorer if modal will actually get shown\n return\n }\n\n $target.one(Event.HIDDEN, () => {\n if ($(this).is(':visible')) {\n this.focus()\n }\n })\n })\n\n Modal._jQueryInterface.call($(target), config, this)\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Modal._jQueryInterface\n $.fn[NAME].Constructor = Modal\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Modal._jQueryInterface\n }\n\n return Modal\n\n})(jQuery)\n\nexport default Modal\n"]}
\ No newline at end of file diff --git a/js/dist/popover.js b/js/dist/popover.js index 901fc87cb9..b20459c2c3 100644 --- a/js/dist/popover.js +++ b/js/dist/popover.js @@ -1,3 +1,5 @@ +'use strict'; + 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; }; }(); @@ -15,7 +17,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * -------------------------------------------------------------------------- */ -var Popover = function ($) { +var Popover = function () { /** * ------------------------------------------------------------------------ @@ -77,73 +79,85 @@ var Popover = function ($) { function Popover() { _classCallCheck(this, Popover); - return _possibleConstructorReturn(this, _Tooltip.apply(this, arguments)); + return _possibleConstructorReturn(this, (Popover.__proto__ || Object.getPrototypeOf(Popover)).apply(this, arguments)); } - // overrides - - Popover.prototype.isWithContent = function isWithContent() { - return this.getTitle() || this._getContent(); - }; - - Popover.prototype.addAttachmentClass = function addAttachmentClass(attachment) { - $(this.getTipElement()).addClass(CLASS_PREFIX + '-' + attachment); - }; + _createClass(Popover, [{ + key: 'isWithContent', - Popover.prototype.getTipElement = function getTipElement() { - return this.tip = this.tip || $(this.config.template)[0]; - }; - Popover.prototype.setContent = function setContent() { - var $tip = $(this.getTipElement()); + // overrides - // we use append for html objects to maintain js events - this.setElementContent($tip.find(Selector.TITLE), this.getTitle()); - this.setElementContent($tip.find(Selector.CONTENT), this._getContent()); + value: function isWithContent() { + return this.getTitle() || this._getContent(); + } + }, { + key: 'addAttachmentClass', + value: function addAttachmentClass(attachment) { + $(this.getTipElement()).addClass(CLASS_PREFIX + '-' + attachment); + } + }, { + key: 'getTipElement', + value: function getTipElement() { + this.tip = this.tip || $(this.config.template)[0]; + return this.tip; + } + }, { + key: 'setContent', + value: function setContent() { + var $tip = $(this.getTipElement()); - $tip.removeClass(ClassName.FADE + ' ' + ClassName.SHOW); - }; + // we use append for html objects to maintain js events + this.setElementContent($tip.find(Selector.TITLE), this.getTitle()); + this.setElementContent($tip.find(Selector.CONTENT), this._getContent()); - // private + $tip.removeClass(ClassName.FADE + ' ' + ClassName.SHOW); + } - Popover.prototype._getContent = function _getContent() { - return this.element.getAttribute('data-content') || (typeof this.config.content === 'function' ? this.config.content.call(this.element) : this.config.content); - }; + // private - 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('')); + }, { + key: '_getContent', + value: function _getContent() { + return this.element.getAttribute('data-content') || (typeof this.config.content === 'function' ? this.config.content.call(this.element) : this.config.content); + } + }, { + key: '_cleanTipClass', + value: 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) { - return this.each(function () { - var data = $(this).data(DATA_KEY); - var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' ? config : null; + // static - if (!data && /destroy|hide/.test(config)) { - return; - } + }], [{ + key: '_jQueryInterface', + value: 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 Popover(this, _config); - $(this).data(DATA_KEY, data); - } + if (!data && /destroy|hide/.test(config)) { + return; + } - if (typeof config === 'string') { - if (data[config] === undefined) { - throw new Error('No method named "' + config + '"'); + if (!data) { + data = new Popover(this, _config); + $(this).data(DATA_KEY, data); } - data[config](); - } - }); - }; - _createClass(Popover, null, [{ + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new Error('No method named "' + config + '"'); + } + data[config](); + } + }); + } + }, { key: 'VERSION', diff --git a/js/dist/popover.js.map b/js/dist/popover.js.map index 5c335ed337..ddf0e586c1 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","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,YAA5B;AACA,MAAMC,WAAsB,YAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,qBAAsBL,EAAEM,EAAF,CAAKL,IAAL,CAA5B;AACA,MAAMM,eAAsB,YAA5B;AACA,MAAMC,qBAAsB,IAAIC,MAAJ,aAAqBF,YAArB,WAAyC,GAAzC,CAA5B;;AAEA,MAAMG,UAAUV,EAAEW,MAAF,CAAS,EAAT,EAAaC,QAAQF,OAArB,EAA8B;AAC5CG,eAAY,OADgC;AAE5CC,aAAY,OAFgC;AAG5CC,aAAY,EAHgC;AAI5CC,cAAY,yCACA,2BADA,GAEA,kCAFA,GAGA;AAPg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,IAAF,EAAQ2D,IAAR,CAAaxD,QAAb,EAAuBwD,IAAvB;AACD;;AAED,YAAI,OAAOjB,MAAP,KAAkB,QAAtB,EAAgC;AAC9B,cAAIiB,KAAKjB,MAAL,MAAiBoB,SAArB,EAAgC;AAC9B,kBAAM,IAAIC,KAAJ,uBAA8BrB,MAA9B,OAAN;AACD;AACDiB,eAAKjB,MAAL;AACD;AACF,OAnBM,CAAP;AAoBD,KAhKmB;;AAAA;AAAA;;;AAgEpB;;AAhEoB,0BAkEC;AACnB,eAAOxC,OAAP;AACD;AApEmB;AAAA;AAAA,0BAsEC;AACnB,eAAOQ,OAAP;AACD;AAxEmB;AAAA;AAAA,0BA0EF;AAChB,eAAOT,IAAP;AACD;AA5EmB;AAAA;AAAA,0BA8EE;AACpB,eAAOE,QAAP;AACD;AAhFmB;AAAA;AAAA,0BAkFD;AACjB,eAAOqB,KAAP;AACD;AApFmB;AAAA;AAAA,0BAsFG;AACrB,eAAOpB,SAAP;AACD;AAxFmB;AAAA;AAAA,0BA0FK;AACvB,eAAOa,WAAP;AACD;AA5FmB;;AAAA;AAAA,IA6DAL,OA7DA;;AAoKtB;;;;;;AAMAZ,IAAEM,EAAF,CAAKL,IAAL,IAAyBF,QAAQ0D,gBAAjC;AACAzD,IAAEM,EAAF,CAAKL,IAAL,EAAW+D,WAAX,GAAyBjE,OAAzB;AACAC,IAAEM,EAAF,CAAKL,IAAL,EAAWgE,UAAX,GAAyB,YAAY;AACnCjE,MAAEM,EAAF,CAAKL,IAAL,IAAaI,kBAAb;AACA,WAAON,QAAQ0D,gBAAf;AACD,GAHD;;AAKA,SAAO1D,OAAP;AAED,CAnLe,CAmLbmE,MAnLa,CAAhB","file":"popover.js","sourcesContent":["import Tooltip from './tooltip'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): 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-beta'\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-header\"></h3>'\n + '<div class=\"popover-body\"></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-header',\n CONTENT : '.popover-body'\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 +{"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","getTitle","_getContent","attachment","getTipElement","addClass","tip","config","$tip","setElementContent","find","removeClass","element","getAttribute","call","tabClass","attr","match","length","join","each","data","_config","test","Error","_jQueryInterface","Constructor","noConflict","jQuery"],"mappings":";;;;;;;;;;;;AAIA;;;;;;;AAOA,IAAMA,UAAW,YAAM;;AAGrB;;;;;;AAMA,MAAMC,OAAsB,SAA5B;AACA,MAAMC,UAAsB,YAA5B;AACA,MAAMC,WAAsB,YAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,qBAAsBC,EAAEC,EAAF,CAAKN,IAAL,CAA5B;AACA,MAAMO,eAAsB,YAA5B;AACA,MAAMC,qBAAsB,IAAIC,MAAJ,aAAqBF,YAArB,WAAyC,GAAzC,CAA5B;;AAEA,MAAMG,UAAUL,EAAEM,MAAF,CAAS,EAAT,EAAaC,QAAQF,OAArB,EAA8B;AAC5CG,eAAY,OADgC;AAE5CC,aAAY,OAFgC;AAG5CC,aAAY,EAHgC;AAI5CC,cAAY,yCACA,2BADA,GAEA,kCAFA,GAGA;AAPgC,GAA9B,CAAhB;;AAUA,MAAMC,cAAcZ,EAAEM,MAAF,CAAS,EAAT,EAAaC,QAAQK,WAArB,EAAkC;AACpDF,aAAU;AAD0C,GAAlC,CAApB;;AAIA,MAAMG,YAAY;AAChBC,UAAO,MADS;AAEhBC,UAAO;AAFS,GAAlB;;AAKA,MAAMC,WAAW;AACfC,WAAU,iBADK;AAEfC,aAAU;AAFK,GAAjB;;AAKA,MAAMC,QAAQ;AACZC,mBAAoBtB,SADR;AAEZuB,uBAAsBvB,SAFV;AAGZiB,mBAAoBjB,SAHR;AAIZwB,qBAAqBxB,SAJT;AAKZyB,2BAAwBzB,SALZ;AAMZ0B,qBAAqB1B,SANT;AAOZ2B,yBAAuB3B,SAPX;AAQZ4B,2BAAwB5B,SARZ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A;AAAA,0BAsFI;AACrB,eAAOrB,SAAP;AACD;AAxFkB;AAAA;AAAA,0BA0FM;AACvB,eAAOc,WAAP;AACD;AA5FkB;;AAAA;AAAA,IA6DCL,OA7DD;;AAqKrB;;;;;;AAMAP,IAAEC,EAAF,CAAKN,IAAL,IAAyBD,QAAQ2D,gBAAjC;AACArD,IAAEC,EAAF,CAAKN,IAAL,EAAW2D,WAAX,GAAyB5D,OAAzB;AACAM,IAAEC,EAAF,CAAKN,IAAL,EAAW4D,UAAX,GAAyB,YAAY;AACnCvD,MAAEC,EAAF,CAAKN,IAAL,IAAaI,kBAAb;AACA,WAAOL,QAAQ2D,gBAAf;AACD,GAHD;;AAKA,SAAO3D,OAAP;AAED,CApLe,CAoLb8D,MApLa,CAAhB","file":"popover.js","sourcesContent":["import $ from 'jquery'\nimport Tooltip from './tooltip'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): 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-beta'\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-header\"></h3>'\n + '<div class=\"popover-body\"></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-header',\n CONTENT : '.popover-body'\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 this.tip = this.tip || $(this.config.template)[0]\n return this.tip\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 (typeof 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/scrollspy.js b/js/dist/scrollspy.js index 11d9981bf9..c1365a7413 100644 --- a/js/dist/scrollspy.js +++ b/js/dist/scrollspy.js @@ -1,3 +1,5 @@ +'use strict'; + 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; }; }(); @@ -11,7 +13,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * -------------------------------------------------------------------------- */ -var ScrollSpy = function ($) { +var ScrollSpy = function () { /** * ------------------------------------------------------------------------ @@ -97,182 +99,197 @@ var ScrollSpy = function ($) { // getters - // public + _createClass(ScrollSpy, [{ + key: 'refresh', - ScrollSpy.prototype.refresh = function refresh() { - var _this2 = this; - var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET; + // public - var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; + value: function refresh() { + var _this2 = this; - var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0; + var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET; - this._offsets = []; - this._targets = []; + var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; - this._scrollHeight = this._getScrollHeight(); + var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0; - var targets = $.makeArray($(this._selector)); + this._offsets = []; + this._targets = []; - targets.map(function (element) { - var target = void 0; - var targetSelector = Util.getSelectorFromElement(element); + this._scrollHeight = this._getScrollHeight(); - if (targetSelector) { - target = $(targetSelector)[0]; - } - - if (target) { - var targetBCR = target.getBoundingClientRect(); - if (targetBCR.width || targetBCR.height) { - // todo (fat): remove sketch reliance on jQuery position/offset - return [$(target)[offsetMethod]().top + offsetBase, targetSelector]; - } - } - return null; - }).filter(function (item) { - return item; - }).sort(function (a, b) { - return a[0] - b[0]; - }).forEach(function (item) { - _this2._offsets.push(item[0]); - _this2._targets.push(item[1]); - }); - }; - - ScrollSpy.prototype.dispose = function dispose() { - $.removeData(this._element, DATA_KEY); - $(this._scrollElement).off(EVENT_KEY); - - this._element = null; - this._scrollElement = null; - this._config = null; - this._selector = null; - this._offsets = null; - this._targets = null; - this._activeTarget = null; - this._scrollHeight = null; - }; + var targets = $.makeArray($(this._selector)); - // private + targets.map(function (element) { + var target = void 0; + var targetSelector = Util.getSelectorFromElement(element); - ScrollSpy.prototype._getConfig = function _getConfig(config) { - config = $.extend({}, Default, config); + if (targetSelector) { + target = $(targetSelector)[0]; + } - if (typeof config.target !== 'string') { - var id = $(config.target).attr('id'); - if (!id) { - id = Util.getUID(NAME); - $(config.target).attr('id', id); - } - config.target = '#' + id; + if (target) { + var targetBCR = target.getBoundingClientRect(); + if (targetBCR.width || targetBCR.height) { + // todo (fat): remove sketch reliance on jQuery position/offset + return [$(target)[offsetMethod]().top + offsetBase, targetSelector]; + } + } + return null; + }).filter(function (item) { + return item; + }).sort(function (a, b) { + return a[0] - b[0]; + }).forEach(function (item) { + _this2._offsets.push(item[0]); + _this2._targets.push(item[1]); + }); + } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + $(this._scrollElement).off(EVENT_KEY); + + this._element = null; + this._scrollElement = null; + this._config = null; + this._selector = null; + this._offsets = null; + this._targets = null; + this._activeTarget = null; + this._scrollHeight = null; } - Util.typeCheckConfig(NAME, config, DefaultType); - - return config; - }; - - ScrollSpy.prototype._getScrollTop = function _getScrollTop() { - return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; - }; - - ScrollSpy.prototype._getScrollHeight = function _getScrollHeight() { - return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); - }; + // private - ScrollSpy.prototype._getOffsetHeight = function _getOffsetHeight() { - return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; - }; + }, { + key: '_getConfig', + value: function _getConfig(config) { + config = $.extend({}, Default, config); + + if (typeof config.target !== 'string') { + var id = $(config.target).attr('id'); + if (!id) { + id = Util.getUID(NAME); + $(config.target).attr('id', id); + } + config.target = '#' + id; + } - ScrollSpy.prototype._process = function _process() { - var scrollTop = this._getScrollTop() + this._config.offset; - var scrollHeight = this._getScrollHeight(); - var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); + Util.typeCheckConfig(NAME, config, DefaultType); - if (this._scrollHeight !== scrollHeight) { - this.refresh(); + return config; } - - if (scrollTop >= maxScroll) { - var target = this._targets[this._targets.length - 1]; - - if (this._activeTarget !== target) { - this._activate(target); - } - return; + }, { + key: '_getScrollTop', + value: function _getScrollTop() { + return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; } - - if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { - this._activeTarget = null; - this._clear(); - return; + }, { + key: '_getScrollHeight', + value: function _getScrollHeight() { + return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); + } + }, { + key: '_getOffsetHeight', + value: function _getOffsetHeight() { + return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; } + }, { + key: '_process', + value: function _process() { + var scrollTop = this._getScrollTop() + this._config.offset; + var scrollHeight = this._getScrollHeight(); + var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); + + if (this._scrollHeight !== scrollHeight) { + this.refresh(); + } - for (var i = this._offsets.length; i--;) { - var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (this._offsets[i + 1] === undefined || scrollTop < this._offsets[i + 1]); + if (scrollTop >= maxScroll) { + var target = this._targets[this._targets.length - 1]; - if (isActiveTarget) { - this._activate(this._targets[i]); + if (this._activeTarget !== target) { + this._activate(target); + } + return; } - } - }; - - ScrollSpy.prototype._activate = function _activate(target) { - this._activeTarget = target; - this._clear(); + if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { + this._activeTarget = null; + this._clear(); + return; + } - var queries = this._selector.split(','); - queries = queries.map(function (selector) { - return selector + '[data-target="' + target + '"],' + (selector + '[href="' + target + '"]'); - }); + for (var i = this._offsets.length; i--;) { + var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); - var $link = $(queries.join(',')); - - if ($link.hasClass(ClassName.DROPDOWN_ITEM)) { - $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE); - $link.addClass(ClassName.ACTIVE); - } else { - // Set triggered link as active - $link.addClass(ClassName.ACTIVE); - // Set triggered links parents as active - // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor - $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_LINKS + ', ' + Selector.LIST_ITEMS).addClass(ClassName.ACTIVE); + if (isActiveTarget) { + this._activate(this._targets[i]); + } + } } + }, { + key: '_activate', + value: function _activate(target) { + this._activeTarget = target; - $(this._scrollElement).trigger(Event.ACTIVATE, { - relatedTarget: target - }); - }; + this._clear(); - ScrollSpy.prototype._clear = function _clear() { - $(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE); - }; + var queries = this._selector.split(','); + // eslint-disable-next-line arrow-body-style + queries = queries.map(function (selector) { + return selector + '[data-target="' + target + '"],' + (selector + '[href="' + target + '"]'); + }); + + var $link = $(queries.join(',')); + + if ($link.hasClass(ClassName.DROPDOWN_ITEM)) { + $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE); + $link.addClass(ClassName.ACTIVE); + } else { + // Set triggered link as active + $link.addClass(ClassName.ACTIVE); + // Set triggered links parents as active + // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor + $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_LINKS + ', ' + Selector.LIST_ITEMS).addClass(ClassName.ACTIVE); + } - // static + $(this._scrollElement).trigger(Event.ACTIVATE, { + relatedTarget: target + }); + } + }, { + key: '_clear', + value: function _clear() { + $(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE); + } - ScrollSpy._jQueryInterface = function _jQueryInterface(config) { - return this.each(function () { - var data = $(this).data(DATA_KEY); - var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config; + // static - if (!data) { - data = new ScrollSpy(this, _config); - $(this).data(DATA_KEY, data); - } + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config; - if (typeof config === 'string') { - if (data[config] === undefined) { - throw new Error('No method named "' + config + '"'); + if (!data) { + data = new ScrollSpy(this, _config); + $(this).data(DATA_KEY, data); } - data[config](); - } - }); - }; - _createClass(ScrollSpy, null, [{ + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new Error('No method named "' + config + '"'); + } + data[config](); + } + }); + } + }, { key: 'VERSION', get: function get() { return VERSION; diff --git a/js/dist/scrollspy.js.map b/js/dist/scrollspy.js.map index 6961e5fcbc..9eb9902150 100644 --- a/js/dist/scrollspy.js.map +++ b/js/dist/scrollspy.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/scrollspy.js"],"names":["ScrollSpy","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","Default","offset","method","target","DefaultType","Event","ACTIVATE","SCROLL","LOAD_DATA_API","ClassName","DROPDOWN_ITEM","DROPDOWN_MENU","ACTIVE","Selector","DATA_SPY","NAV_LIST_GROUP","NAV_LINKS","LIST_ITEMS","DROPDOWN","DROPDOWN_ITEMS","DROPDOWN_TOGGLE","OffsetMethod","OFFSET","POSITION","element","config","_element","_scrollElement","tagName","window","_config","_getConfig","_selector","_offsets","_targets","_activeTarget","_scrollHeight","on","event","_process","refresh","autoMethod","offsetMethod","offsetBase","_getScrollTop","_getScrollHeight","targets","makeArray","map","targetSelector","Util","getSelectorFromElement","targetBCR","getBoundingClientRect","width","height","top","filter","item","sort","a","b","forEach","push","dispose","removeData","off","extend","id","attr","getUID","typeCheckConfig","pageYOffset","scrollTop","scrollHeight","Math","max","document","body","documentElement","_getOffsetHeight","innerHeight","maxScroll","length","_activate","_clear","i","isActiveTarget","undefined","queries","split","selector","$link","join","hasClass","closest","find","addClass","parents","prev","trigger","relatedTarget","removeClass","_jQueryInterface","each","data","Error","scrollSpys","$spy","call","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAGA;;;;;;;AAOA,IAAMA,YAAa,UAACC,CAAD,EAAO;;AAGxB;;;;;;AAMA,MAAMC,OAAqB,WAA3B;AAC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AN;AACD;AACDgF,eAAKhF,MAAL;AACD;AACF,OAfM,CAAP;AAgBD,KA7RqB;;AAAA;AAAA;AAAA,0BAsFD;AACnB,eAAO/B,OAAP;AACD;AAxFqB;AAAA;AAAA,0BA0FD;AACnB,eAAOM,OAAP;AACD;AA5FqB;;AAAA;AAAA;;AAmSxB;;;;;;AAMAR,IAAEqC,MAAF,EAAUQ,EAAV,CAAahC,MAAMG,aAAnB,EAAkC,YAAM;AACtC,QAAMmG,aAAanH,EAAEuD,SAAF,CAAYvD,EAAEqB,SAASC,QAAX,CAAZ,CAAnB;;AAEA,SAAK,IAAIwE,IAAIqB,WAAWxB,MAAxB,EAAgCG,GAAhC,GAAsC;AACpC,UAAMsB,OAAOpH,EAAEmH,WAAWrB,CAAX,CAAF,CAAb;AACA/F,gBAAUgH,gBAAV,CAA2BM,IAA3B,CAAgCD,IAAhC,EAAsCA,KAAKH,IAAL,EAAtC;AACD;AACF,GAPD;;AAUA;;;;;;AAMAjH,IAAEO,EAAF,CAAKN,IAAL,IAAyBF,UAAUgH,gBAAnC;AACA/G,IAAEO,EAAF,CAAKN,IAAL,EAAWqH,WAAX,GAAyBvH,SAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWsH,UAAX,GAAyB,YAAY;AACnCvH,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,UAAUgH,gBAAjB;AACD,GAHD;;AAKA,SAAOhH,SAAP;AAED,CAlUiB,CAkUfyH,MAlUe,CAAlB","file":"scrollspy.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst ScrollSpy = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'scrollspy'\n const VERSION = '4.0.0-beta'\n const DATA_KEY = 'bs.scrollspy'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Default = {\n offset : 10,\n method : 'auto',\n target : ''\n }\n\n const DefaultType = {\n offset : 'number',\n method : 'string',\n target : '(string|element)'\n }\n\n const Event = {\n ACTIVATE : `activate${EVENT_KEY}`,\n SCROLL : `scroll${EVENT_KEY}`,\n LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n DROPDOWN_ITEM : 'dropdown-item',\n DROPDOWN_MENU : 'dropdown-menu',\n ACTIVE : 'active'\n }\n\n const Selector = {\n DATA_SPY : '[data-spy=\"scroll\"]',\n ACTIVE : '.active',\n NAV_LIST_GROUP : '.nav, .list-group',\n NAV_LINKS : '.nav-link',\n LIST_ITEMS : '.list-group-item',\n DROPDOWN : '.dropdown',\n DROPDOWN_ITEMS : '.dropdown-item',\n DROPDOWN_TOGGLE : '.dropdown-toggle'\n }\n\n const OffsetMethod = {\n OFFSET : 'offset',\n POSITION : 'position'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class ScrollSpy {\n\n constructor(element, config) {\n this._element = element\n this._scrollElement = element.tagName === 'BODY' ? window : element\n this._config = this._getConfig(config)\n this._selector = `${this._config.target} ${Selector.NAV_LINKS},`\n + `${this._config.target} ${Selector.LIST_ITEMS},`\n + `${this._config.target} ${Selector.DROPDOWN_ITEMS}`\n this._offsets = []\n this._targets = []\n this._activeTarget = null\n this._scrollHeight = 0\n\n $(this._scrollElement).on(Event.SCROLL, (event) => this._process(event))\n\n this.refresh()\n this._process()\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 refresh() {\n const autoMethod = this._scrollElement !== this._scrollElement.window ?\n OffsetMethod.POSITION : OffsetMethod.OFFSET\n\n const offsetMethod = this._config.method === 'auto' ?\n autoMethod : this._config.method\n\n const offsetBase = offsetMethod === OffsetMethod.POSITION ?\n this._getScrollTop() : 0\n\n this._offsets = []\n this._targets = []\n\n this._scrollHeight = this._getScrollHeight()\n\n const targets = $.makeArray($(this._selector))\n\n targets\n .map((element) => {\n let target\n const targetSelector = Util.getSelectorFromElement(element)\n\n if (targetSelector) {\n target = $(targetSelector)[0]\n }\n\n if (target) {\n const targetBCR = target.getBoundingClientRect()\n if (targetBCR.width || targetBCR.height) {\n // todo (fat): remove sketch reliance on jQuery position/offset\n return [\n $(target)[offsetMethod]().top + offsetBase,\n targetSelector\n ]\n }\n }\n return null\n })\n .filter((item) => item)\n .sort((a, b) => a[0] - b[0])\n .forEach((item) => {\n this._offsets.push(item[0])\n this._targets.push(item[1])\n })\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n $(this._scrollElement).off(EVENT_KEY)\n\n this._element = null\n this._scrollElement = null\n this._config = null\n this._selector = null\n this._offsets = null\n this._targets = null\n this._activeTarget = null\n this._scrollHeight = null\n }\n\n\n // private\n\n _getConfig(config) {\n config = $.extend({}, Default, config)\n\n if (typeof config.target !== 'string') {\n let id = $(config.target).attr('id')\n if (!id) {\n id = Util.getUID(NAME)\n $(config.target).attr('id', id)\n }\n config.target = `#${id}`\n }\n\n Util.typeCheckConfig(NAME, config, DefaultType)\n\n return config\n }\n\n _getScrollTop() {\n return this._scrollElement === window ?\n this._scrollElement.pageYOffset : this._scrollElement.scrollTop\n }\n\n _getScrollHeight() {\n return this._scrollElement.scrollHeight || Math.max(\n document.body.scrollHeight,\n document.documentElement.scrollHeight\n )\n }\n\n _getOffsetHeight() {\n return this._scrollElement === window ?\n window.innerHeight : this._scrollElement.getBoundingClientRect().height\n }\n\n _process() {\n const scrollTop = this._getScrollTop() + this._config.offset\n const scrollHeight = this._getScrollHeight()\n const maxScroll = this._config.offset\n + scrollHeight\n - this._getOffsetHeight()\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh()\n }\n\n if (scrollTop >= maxScroll) {\n const target = this._targets[this._targets.length - 1]\n\n if (this._activeTarget !== target) {\n this._activate(target)\n }\n return\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {\n this._activeTarget = null\n this._clear()\n return\n }\n\n for (let i = this._offsets.length; i--;) {\n const isActiveTarget = this._activeTarget !== this._targets[i]\n && scrollTop >= this._offsets[i]\n && (this._offsets[i + 1] === undefined ||\n scrollTop < this._offsets[i + 1])\n\n if (isActiveTarget) {\n this._activate(this._targets[i])\n }\n }\n }\n\n _activate(target) {\n this._activeTarget = target\n\n this._clear()\n\n let queries = this._selector.split(',')\n queries = queries.map((selector) => {\n return `${selector}[data-target=\"${target}\"],` +\n `${selector}[href=\"${target}\"]`\n })\n\n const $link = $(queries.join(','))\n\n if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {\n $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE)\n $link.addClass(ClassName.ACTIVE)\n } else {\n // Set triggered link as active\n $link.addClass(ClassName.ACTIVE)\n // Set triggered links parents as active\n // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor\n $link.parents(Selector.NAV_LIST_GROUP).prev(`${Selector.NAV_LINKS}, ${Selector.LIST_ITEMS}`).addClass(ClassName.ACTIVE)\n }\n\n $(this._scrollElement).trigger(Event.ACTIVATE, {\n relatedTarget: target\n })\n }\n\n _clear() {\n $(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE)\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) {\n data = new ScrollSpy(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 * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(window).on(Event.LOAD_DATA_API, () => {\n const scrollSpys = $.makeArray($(Selector.DATA_SPY))\n\n for (let i = scrollSpys.length; i--;) {\n const $spy = $(scrollSpys[i])\n ScrollSpy._jQueryInterface.call($spy, $spy.data())\n }\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = ScrollSpy._jQueryInterface\n $.fn[NAME].Constructor = ScrollSpy\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return ScrollSpy._jQueryInterface\n }\n\n return ScrollSpy\n\n})(jQuery)\n\nexport default ScrollSpy\n"]}
\ No newline at end of file +{"version":3,"sources":["../src/scrollspy.js"],"names":["ScrollSpy","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","$","fn","Default","offset","method","target","DefaultType","Event","ACTIVATE","SCROLL","LOAD_DATA_API","ClassName","DROPDOWN_ITEM","DROPDOWN_MENU","ACTIVE","Selector","DATA_SPY","NAV_LIST_GROUP","NAV_LINKS","LIST_ITEMS","DROPDOWN","DROPDOWN_ITEMS","DROPDOWN_TOGGLE","OffsetMethod","OFFSET","POSITION","element","config","_element","_scrollElement","tagName","window","_config","_getConfig","_selector","_offsets","_targets","_activeTarget","_scrollHeight","on","event","_process","refresh","autoMethod","offsetMethod","offsetBase","_getScrollTop","_getScrollHeight","targets","makeArray","map","targetSelector","Util","getSelectorFromElement","targetBCR","getBoundingClientRect","width","height","top","filter","item","sort","a","b","forEach","push","removeData","off","extend","id","attr","getUID","typeCheckConfig","pageYOffset","scrollTop","scrollHeight","Math","max","document","body","documentElement","innerHeight","maxScroll","_getOffsetHeight","length","_activate","_clear","i","isActiveTarget","queries","split","selector","$link","join","hasClass","closest","find","addClass","parents","prev","trigger","relatedTarget","removeClass","each","data","Error","scrollSpys","$spy","_jQueryInterface","call","Constructor","noConflict","jQuery"],"mappings":";;;;;;;;AAIA;;;;;;;AAOA,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D;AACF,SAfM,CAAP;AAgBD;AA9RoB;AAAA;AAAA,0BAsFA;AACnB,eAAOhC,OAAP;AACD;AAxFoB;AAAA;AAAA,0BA0FA;AACnB,eAAOO,OAAP;AACD;AA5FoB;;AAAA;AAAA;;AAoSvB;;;;;;AAMAF,IAAE+B,MAAF,EAAUQ,EAAV,CAAahC,MAAMG,aAAnB,EAAkC,YAAM;AACtC,QAAMgG,aAAa1G,EAAEiD,SAAF,CAAYjD,EAAEe,SAASC,QAAX,CAAZ,CAAnB;;AAEA,SAAK,IAAIuE,IAAImB,WAAWtB,MAAxB,EAAgCG,GAAhC,GAAsC;AACpC,UAAMoB,OAAO3G,EAAE0G,WAAWnB,CAAX,CAAF,CAAb;AACA9F,gBAAUmH,gBAAV,CAA2BC,IAA3B,CAAgCF,IAAhC,EAAsCA,KAAKH,IAAL,EAAtC;AACD;AACF,GAPD;;AAUA;;;;;;AAMAxG,IAAEC,EAAF,CAAKP,IAAL,IAAyBD,UAAUmH,gBAAnC;AACA5G,IAAEC,EAAF,CAAKP,IAAL,EAAWoH,WAAX,GAAyBrH,SAAzB;AACAO,IAAEC,EAAF,CAAKP,IAAL,EAAWqH,UAAX,GAAyB,YAAY;AACnC/G,MAAEC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;AACA,WAAON,UAAUmH,gBAAjB;AACD,GAHD;;AAKA,SAAOnH,SAAP;AAED,CAnUiB,CAmUfuH,MAnUe,CAAlB","file":"scrollspy.js","sourcesContent":["import $ from 'jquery'\nimport Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst ScrollSpy = (() => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'scrollspy'\n const VERSION = '4.0.0-beta'\n const DATA_KEY = 'bs.scrollspy'\n const EVENT_KEY = `.${DATA_KEY}`\n const DATA_API_KEY = '.data-api'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Default = {\n offset : 10,\n method : 'auto',\n target : ''\n }\n\n const DefaultType = {\n offset : 'number',\n method : 'string',\n target : '(string|element)'\n }\n\n const Event = {\n ACTIVATE : `activate${EVENT_KEY}`,\n SCROLL : `scroll${EVENT_KEY}`,\n LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`\n }\n\n const ClassName = {\n DROPDOWN_ITEM : 'dropdown-item',\n DROPDOWN_MENU : 'dropdown-menu',\n ACTIVE : 'active'\n }\n\n const Selector = {\n DATA_SPY : '[data-spy=\"scroll\"]',\n ACTIVE : '.active',\n NAV_LIST_GROUP : '.nav, .list-group',\n NAV_LINKS : '.nav-link',\n LIST_ITEMS : '.list-group-item',\n DROPDOWN : '.dropdown',\n DROPDOWN_ITEMS : '.dropdown-item',\n DROPDOWN_TOGGLE : '.dropdown-toggle'\n }\n\n const OffsetMethod = {\n OFFSET : 'offset',\n POSITION : 'position'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class ScrollSpy {\n\n constructor(element, config) {\n this._element = element\n this._scrollElement = element.tagName === 'BODY' ? window : element\n this._config = this._getConfig(config)\n this._selector = `${this._config.target} ${Selector.NAV_LINKS},`\n + `${this._config.target} ${Selector.LIST_ITEMS},`\n + `${this._config.target} ${Selector.DROPDOWN_ITEMS}`\n this._offsets = []\n this._targets = []\n this._activeTarget = null\n this._scrollHeight = 0\n\n $(this._scrollElement).on(Event.SCROLL, (event) => this._process(event))\n\n this.refresh()\n this._process()\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 refresh() {\n const autoMethod = this._scrollElement !== this._scrollElement.window ?\n OffsetMethod.POSITION : OffsetMethod.OFFSET\n\n const offsetMethod = this._config.method === 'auto' ?\n autoMethod : this._config.method\n\n const offsetBase = offsetMethod === OffsetMethod.POSITION ?\n this._getScrollTop() : 0\n\n this._offsets = []\n this._targets = []\n\n this._scrollHeight = this._getScrollHeight()\n\n const targets = $.makeArray($(this._selector))\n\n targets\n .map((element) => {\n let target\n const targetSelector = Util.getSelectorFromElement(element)\n\n if (targetSelector) {\n target = $(targetSelector)[0]\n }\n\n if (target) {\n const targetBCR = target.getBoundingClientRect()\n if (targetBCR.width || targetBCR.height) {\n // todo (fat): remove sketch reliance on jQuery position/offset\n return [\n $(target)[offsetMethod]().top + offsetBase,\n targetSelector\n ]\n }\n }\n return null\n })\n .filter((item) => item)\n .sort((a, b) => a[0] - b[0])\n .forEach((item) => {\n this._offsets.push(item[0])\n this._targets.push(item[1])\n })\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n $(this._scrollElement).off(EVENT_KEY)\n\n this._element = null\n this._scrollElement = null\n this._config = null\n this._selector = null\n this._offsets = null\n this._targets = null\n this._activeTarget = null\n this._scrollHeight = null\n }\n\n\n // private\n\n _getConfig(config) {\n config = $.extend({}, Default, config)\n\n if (typeof config.target !== 'string') {\n let id = $(config.target).attr('id')\n if (!id) {\n id = Util.getUID(NAME)\n $(config.target).attr('id', id)\n }\n config.target = `#${id}`\n }\n\n Util.typeCheckConfig(NAME, config, DefaultType)\n\n return config\n }\n\n _getScrollTop() {\n return this._scrollElement === window ?\n this._scrollElement.pageYOffset : this._scrollElement.scrollTop\n }\n\n _getScrollHeight() {\n return this._scrollElement.scrollHeight || Math.max(\n document.body.scrollHeight,\n document.documentElement.scrollHeight\n )\n }\n\n _getOffsetHeight() {\n return this._scrollElement === window ?\n window.innerHeight : this._scrollElement.getBoundingClientRect().height\n }\n\n _process() {\n const scrollTop = this._getScrollTop() + this._config.offset\n const scrollHeight = this._getScrollHeight()\n const maxScroll = this._config.offset\n + scrollHeight\n - this._getOffsetHeight()\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh()\n }\n\n if (scrollTop >= maxScroll) {\n const target = this._targets[this._targets.length - 1]\n\n if (this._activeTarget !== target) {\n this._activate(target)\n }\n return\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {\n this._activeTarget = null\n this._clear()\n return\n }\n\n for (let i = this._offsets.length; i--;) {\n const isActiveTarget = this._activeTarget !== this._targets[i]\n && scrollTop >= this._offsets[i]\n && (typeof this._offsets[i + 1] === 'undefined' ||\n scrollTop < this._offsets[i + 1])\n\n if (isActiveTarget) {\n this._activate(this._targets[i])\n }\n }\n }\n\n _activate(target) {\n this._activeTarget = target\n\n this._clear()\n\n let queries = this._selector.split(',')\n // eslint-disable-next-line arrow-body-style\n queries = queries.map((selector) => {\n return `${selector}[data-target=\"${target}\"],` +\n `${selector}[href=\"${target}\"]`\n })\n\n const $link = $(queries.join(','))\n\n if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {\n $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE)\n $link.addClass(ClassName.ACTIVE)\n } else {\n // Set triggered link as active\n $link.addClass(ClassName.ACTIVE)\n // Set triggered links parents as active\n // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor\n $link.parents(Selector.NAV_LIST_GROUP).prev(`${Selector.NAV_LINKS}, ${Selector.LIST_ITEMS}`).addClass(ClassName.ACTIVE)\n }\n\n $(this._scrollElement).trigger(Event.ACTIVATE, {\n relatedTarget: target\n })\n }\n\n _clear() {\n $(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE)\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) {\n data = new ScrollSpy(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof 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 * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(window).on(Event.LOAD_DATA_API, () => {\n const scrollSpys = $.makeArray($(Selector.DATA_SPY))\n\n for (let i = scrollSpys.length; i--;) {\n const $spy = $(scrollSpys[i])\n ScrollSpy._jQueryInterface.call($spy, $spy.data())\n }\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = ScrollSpy._jQueryInterface\n $.fn[NAME].Constructor = ScrollSpy\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return ScrollSpy._jQueryInterface\n }\n\n return ScrollSpy\n\n})(jQuery)\n\nexport default ScrollSpy\n"]}
\ No newline at end of file diff --git a/js/dist/tab.js b/js/dist/tab.js index 09afbeadc4..3efbf5d5d1 100644 --- a/js/dist/tab.js +++ b/js/dist/tab.js @@ -1,3 +1,5 @@ +'use strict'; + 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"); } } @@ -9,7 +11,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * -------------------------------------------------------------------------- */ -var Tab = function ($) { +var Tab = function () { /** * ------------------------------------------------------------------------ @@ -66,165 +68,174 @@ var Tab = function ($) { // getters - // public - - Tab.prototype.show = function show() { - var _this = this; - - if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName.ACTIVE) || $(this._element).hasClass(ClassName.DISABLED)) { - return; - } - - var target = void 0; - var previous = void 0; - var listElement = $(this._element).closest(Selector.NAV_LIST_GROUP)[0]; - var selector = Util.getSelectorFromElement(this._element); + _createClass(Tab, [{ + key: 'show', - if (listElement) { - var itemSelector = listElement.nodeName === 'UL' ? Selector.ACTIVE_UL : Selector.ACTIVE; - previous = $.makeArray($(listElement).find(itemSelector)); - previous = previous[previous.length - 1]; - } - - var hideEvent = $.Event(Event.HIDE, { - relatedTarget: this._element - }); - var showEvent = $.Event(Event.SHOW, { - relatedTarget: previous - }); + // public - if (previous) { - $(previous).trigger(hideEvent); - } + value: function show() { + var _this = this; - $(this._element).trigger(showEvent); - - if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { - return; - } + if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName.ACTIVE) || $(this._element).hasClass(ClassName.DISABLED)) { + return; + } - if (selector) { - target = $(selector)[0]; - } + var target = void 0; + var previous = void 0; + var listElement = $(this._element).closest(Selector.NAV_LIST_GROUP)[0]; + var selector = Util.getSelectorFromElement(this._element); - this._activate(this._element, listElement); + if (listElement) { + var itemSelector = listElement.nodeName === 'UL' ? Selector.ACTIVE_UL : Selector.ACTIVE; + previous = $.makeArray($(listElement).find(itemSelector)); + previous = previous[previous.length - 1]; + } - var complete = function complete() { - var hiddenEvent = $.Event(Event.HIDDEN, { - relatedTarget: _this._element + var hideEvent = $.Event(Event.HIDE, { + relatedTarget: this._element }); - var shownEvent = $.Event(Event.SHOWN, { + var showEvent = $.Event(Event.SHOW, { relatedTarget: previous }); - $(previous).trigger(hiddenEvent); - $(_this._element).trigger(shownEvent); - }; + if (previous) { + $(previous).trigger(hideEvent); + } - if (target) { - this._activate(target, target.parentNode, complete); - } else { - complete(); - } - }; + $(this._element).trigger(showEvent); - Tab.prototype.dispose = function dispose() { - $.removeData(this._element, DATA_KEY); - this._element = null; - }; + if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { + return; + } - // private + if (selector) { + target = $(selector)[0]; + } - Tab.prototype._activate = function _activate(element, container, callback) { - var _this2 = this; + this._activate(this._element, listElement); - var activeElements = void 0; - if (container.nodeName === 'UL') { - activeElements = $(container).find(Selector.ACTIVE_UL); - } else { - activeElements = $(container).children(Selector.ACTIVE); - } + var complete = function complete() { + var hiddenEvent = $.Event(Event.HIDDEN, { + relatedTarget: _this._element + }); - var active = activeElements[0]; - var isTransitioning = callback && Util.supportsTransitionEnd() && active && $(active).hasClass(ClassName.FADE); + var shownEvent = $.Event(Event.SHOWN, { + relatedTarget: previous + }); - var complete = function complete() { - return _this2._transitionComplete(element, active, isTransitioning, callback); - }; + $(previous).trigger(hiddenEvent); + $(_this._element).trigger(shownEvent); + }; - if (active && isTransitioning) { - $(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); - } else { - complete(); + if (target) { + this._activate(target, target.parentNode, complete); + } else { + complete(); + } } - - if (active) { - $(active).removeClass(ClassName.SHOW); + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + this._element = null; } - }; - Tab.prototype._transitionComplete = function _transitionComplete(element, active, isTransitioning, callback) { - if (active) { - $(active).removeClass(ClassName.ACTIVE); + // private - var dropdownChild = $(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0]; + }, { + key: '_activate', + value: function _activate(element, container, callback) { + var _this2 = this; - if (dropdownChild) { - $(dropdownChild).removeClass(ClassName.ACTIVE); + var activeElements = void 0; + if (container.nodeName === 'UL') { + activeElements = $(container).find(Selector.ACTIVE_UL); + } else { + activeElements = $(container).children(Selector.ACTIVE); } - active.setAttribute('aria-expanded', false); - } + var active = activeElements[0]; + var isTransitioning = callback && Util.supportsTransitionEnd() && active && $(active).hasClass(ClassName.FADE); + + var complete = function complete() { + return _this2._transitionComplete(element, active, isTransitioning, callback); + }; - $(element).addClass(ClassName.ACTIVE); - element.setAttribute('aria-expanded', true); + if (active && isTransitioning) { + $(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + } else { + complete(); + } - if (isTransitioning) { - Util.reflow(element); - $(element).addClass(ClassName.SHOW); - } else { - $(element).removeClass(ClassName.FADE); + if (active) { + $(active).removeClass(ClassName.SHOW); + } } + }, { + key: '_transitionComplete', + value: function _transitionComplete(element, active, isTransitioning, callback) { + if (active) { + $(active).removeClass(ClassName.ACTIVE); + + var dropdownChild = $(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0]; - if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) { + if (dropdownChild) { + $(dropdownChild).removeClass(ClassName.ACTIVE); + } - var dropdownElement = $(element).closest(Selector.DROPDOWN)[0]; - if (dropdownElement) { - $(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE); + active.setAttribute('aria-expanded', false); } + $(element).addClass(ClassName.ACTIVE); element.setAttribute('aria-expanded', true); - } - if (callback) { - callback(); - } - }; + if (isTransitioning) { + Util.reflow(element); + $(element).addClass(ClassName.SHOW); + } else { + $(element).removeClass(ClassName.FADE); + } - // static + if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) { - Tab._jQueryInterface = function _jQueryInterface(config) { - return this.each(function () { - var $this = $(this); - var data = $this.data(DATA_KEY); + var dropdownElement = $(element).closest(Selector.DROPDOWN)[0]; + if (dropdownElement) { + $(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE); + } - if (!data) { - data = new Tab(this); - $this.data(DATA_KEY, data); + element.setAttribute('aria-expanded', true); } - if (typeof config === 'string') { - if (data[config] === undefined) { - throw new Error('No method named "' + config + '"'); - } - data[config](); + if (callback) { + callback(); } - }); - }; + } + + // static - _createClass(Tab, null, [{ + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + var $this = $(this); + var data = $this.data(DATA_KEY); + + if (!data) { + data = new Tab(this); + $this.data(DATA_KEY, data); + } + + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new Error('No method named "' + config + '"'); + } + data[config](); + } + }); + } + }, { key: 'VERSION', get: function get() { return VERSION; diff --git a/js/dist/tab.js.map b/js/dist/tab.js.map index 4fbdae5b79..3f8512c81b 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","ACTIVE_UL","DATA_TOGGLE","DROPDOWN_TOGGLE","DROPDOWN_ACTIVE_CHILD","element","_element","show","parentNode","nodeType","Node","ELEMENT_NODE","hasClass","target","previous","listElement","closest","selector","Util","getSelectorFromElement","itemSelector","nodeName","makeArray","find","length","hideEvent","relatedTarget","showEvent","trigger","isDefaultPrevented","_activate","complete","hiddenEvent","shownEvent","dispose","removeData","container","callback","activeElements","children","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,YAA5B;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,MAAMC,QAAQ;AACZC,mBAAwBN,SADZ;AAEZO,uBAA0BP,SAFd;AAGZQ,mBAAwBR,SAHZ;AAIZS,qBAAyBT,SAJb;AAKZU,8BAAyBV,SAAz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W5E,QAAX,EAAqB4E,IAArB;AACD;;AAED,YAAI,OAAOH,MAAP,KAAkB,QAAtB,EAAgC;AAC9B,cAAIG,KAAKH,MAAL,MAAiBI,SAArB,EAAgC;AAC9B,kBAAM,IAAIC,KAAJ,uBAA8BL,MAA9B,OAAN;AACD;AACDG,eAAKH,MAAL;AACD;AACF,OAfM,CAAP;AAgBD,KA5Oe;;AAAA;AAAA;AAAA,0BA2DK;AACnB,eAAO1E,OAAP;AACD;AA7De;;AAAA;AAAA;;AAiPlB;;;;;;AAMAF,IAAEkF,QAAF,EACGC,EADH,CACM1E,MAAMK,cADZ,EAC4BM,SAASI,WADrC,EACkD,UAAU4D,KAAV,EAAiB;AAC/DA,UAAMC,cAAN;AACAtF,QAAI4E,gBAAJ,CAAqBW,IAArB,CAA0BtF,EAAE,IAAF,CAA1B,EAAmC,MAAnC;AACD,GAJH;;AAOA;;;;;;AAMAA,IAAEO,EAAF,CAAKN,IAAL,IAAyBF,IAAI4E,gBAA7B;AACA3E,IAAEO,EAAF,CAAKN,IAAL,EAAWsF,WAAX,GAAyBxF,GAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWuF,UAAX,GAAyB,YAAY;AACnCxF,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,IAAI4E,gBAAX;AACD,GAHD;;AAKA,SAAO5E,GAAP;AAED,CA7QW,CA6QT0F,MA7QS,CAAZ","file":"tab.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): 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-beta'\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 ACTIVE_UL : '> li > .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 const itemSelector = listElement.nodeName === 'UL' ? Selector.ACTIVE_UL : Selector.ACTIVE\n previous = $.makeArray($(listElement).find(itemSelector))\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 let activeElements\n if (container.nodeName === 'UL') {\n activeElements = $(container).find(Selector.ACTIVE_UL)\n } else {\n activeElements = $(container).children(Selector.ACTIVE)\n }\n\n const active = activeElements[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","ACTIVE_UL","DATA_TOGGLE","DROPDOWN_TOGGLE","DROPDOWN_ACTIVE_CHILD","element","_element","parentNode","nodeType","Node","ELEMENT_NODE","hasClass","target","previous","listElement","closest","selector","Util","getSelectorFromElement","itemSelector","nodeName","makeArray","find","length","hideEvent","relatedTarget","showEvent","trigger","isDefaultPrevented","_activate","complete","hiddenEvent","shownEvent","removeData","container","callback","activeElements","children","active","isTransitioning","supportsTransitionEnd","_transitionComplete","one","TRANSITION_END","emulateTransitionEnd","removeClass","dropdownChild","setAttribute","addClass","reflow","dropdownElement","config","each","$this","data","Error","document","on","event","preventDefault","_jQueryInterface","call","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAIA;;;;;;;AAOA,IAAMA,MAAO,YAAM;;AAGjB;;;;;;AAMA,MAAMC,OAAsB,KAA5B;AACA,MAAMC,UAAsB,YAA5B;AACA,MAAMC,WAAsB,QAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,eAAsB,WAA5B;AACA,MAAMC,qBAAsBC,EAAEC,EAAF,CAAKP,IAAL,CAA5B;AACA,MAAMQ,sBAAsB,GAA5B;;AAEA,MAAMC,QAAQ;AACZC,mBAAwBP,SADZ;AAEZQ,uBAA0BR,SAFd;AAGZS,mBAAwBT,SAHZ;AAIZU,qBAAyBV,SAJb;AAKZW,8BAAyBX,SAAzB,GAAqCC;AALzB,GAAd;;AAQA,MAAMW,YAAY;AAChBC,mBAAgB,eADA;AAEhBC,YAAgB,QAFA;AAGhBC,cAAgB,UAHA;AAIhBC,UAAgB,MAJA;AAKhBP,UAAgB;AALA,GAAlB;;AAQA,MAAMQ,WAAW;AACfC,cAAwB,WADT;AAEfC,oBAAwB,mBAFT;AAGfL,YAAwB,SAHT;AAIfM,eAAwB,gBAJT;AAKfC,iBAAwB,iEALT;AAMfC,qBAAwB,kBANT;AAOfC,2BAAwB;;AAI1B;;;;;;AAXiB,GAAjB;AAjCiB,MAkDX3B,GAlDW;AAoDf,iBAAY4B,OAAZ,EAAqB;AAAA;;AACnB,WAAKC,QAAL,GAAgBD,OAAhB;AACD;;AAGD;;AAzDe;AAAA;;;AAgEf;;AAhEe,6BAkER;AAAA;;AACL,YAAI,KAAKC,QAAL,CAAcC,UAAd,IACA,KAAKD,QAAL,CAAcC,UAAd,CAAyBC,QAAzB,KAAsCC,KAAKC,YAD3C,IAEA1B,EAAE,KAAKsB,QAAP,EAAiBK,QAAjB,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IAAL,EAAWqF,UAAX,GAAyB,YAAY;AACnC/E,MAAEC,EAAF,CAAKP,IAAL,IAAaK,kBAAb;AACA,WAAON,IAAImF,gBAAX;AACD,GAHD;;AAKA,SAAOnF,GAAP;AAED,CA7QW,CA6QTuF,MA7QS,CAAZ","file":"tab.js","sourcesContent":["import $ from 'jquery'\nimport Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): 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-beta'\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 ACTIVE_UL : '> li > .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 const itemSelector = listElement.nodeName === 'UL' ? Selector.ACTIVE_UL : Selector.ACTIVE\n previous = $.makeArray($(listElement).find(itemSelector))\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 let activeElements\n if (container.nodeName === 'UL') {\n activeElements = $(container).find(Selector.ACTIVE_UL)\n } else {\n activeElements = $(container).children(Selector.ACTIVE)\n }\n\n const active = activeElements[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 (typeof 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 9193ba5f29..a386e0241f 100644 --- a/js/dist/tooltip.js +++ b/js/dist/tooltip.js @@ -1,3 +1,5 @@ +'use strict'; + 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; }; }(); @@ -11,7 +13,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * -------------------------------------------------------------------------- */ -var Tooltip = function ($) { +var Tooltip = function () { /** * Check for Popper dependency @@ -135,493 +137,529 @@ var Tooltip = function ($) { // getters - // public + _createClass(Tooltip, [{ + key: 'enable', - Tooltip.prototype.enable = function enable() { - this._isEnabled = true; - }; - Tooltip.prototype.disable = function disable() { - this._isEnabled = false; - }; + // public - Tooltip.prototype.toggleEnabled = function toggleEnabled() { - this._isEnabled = !this._isEnabled; - }; + value: function enable() { + this._isEnabled = true; + } + }, { + key: 'disable', + value: function disable() { + this._isEnabled = false; + } + }, { + key: 'toggleEnabled', + value: function toggleEnabled() { + this._isEnabled = !this._isEnabled; + } + }, { + key: 'toggle', + value: function toggle(event) { + if (!this._isEnabled) { + return; + } - Tooltip.prototype.toggle = function toggle(event) { - if (event) { - var dataKey = this.constructor.DATA_KEY; - var context = $(event.currentTarget).data(dataKey); + if (event) { + var dataKey = this.constructor.DATA_KEY; + var context = $(event.currentTarget).data(dataKey); - if (!context) { - context = new this.constructor(event.currentTarget, this._getDelegateConfig()); - $(event.currentTarget).data(dataKey, context); - } + if (!context) { + context = new this.constructor(event.currentTarget, this._getDelegateConfig()); + $(event.currentTarget).data(dataKey, context); + } - context._activeTrigger.click = !context._activeTrigger.click; + context._activeTrigger.click = !context._activeTrigger.click; - if (context._isWithActiveTrigger()) { - context._enter(null, context); + if (context._isWithActiveTrigger()) { + context._enter(null, context); + } else { + context._leave(null, context); + } } else { - context._leave(null, context); - } - } else { - if ($(this.getTipElement()).hasClass(ClassName.SHOW)) { - this._leave(null, this); - return; - } + if ($(this.getTipElement()).hasClass(ClassName.SHOW)) { + this._leave(null, this); + return; + } - this._enter(null, this); + this._enter(null, this); + } } - }; - - Tooltip.prototype.dispose = function dispose() { - clearTimeout(this._timeout); - - $.removeData(this.element, this.constructor.DATA_KEY); - - $(this.element).off(this.constructor.EVENT_KEY); - $(this.element).closest('.modal').off('hide.bs.modal'); + }, { + key: 'dispose', + value: function dispose() { + clearTimeout(this._timeout); - if (this.tip) { - $(this.tip).remove(); - } + $.removeData(this.element, this.constructor.DATA_KEY); - this._isEnabled = null; - this._timeout = null; - this._hoverState = null; - this._activeTrigger = null; - if (this._popper !== null) { - this._popper.destroy(); - } - this._popper = null; + $(this.element).off(this.constructor.EVENT_KEY); + $(this.element).closest('.modal').off('hide.bs.modal'); - this.element = null; - this.config = null; - this.tip = null; - }; + if (this.tip) { + $(this.tip).remove(); + } - Tooltip.prototype.show = function show() { - var _this = this; + this._isEnabled = null; + this._timeout = null; + this._hoverState = null; + this._activeTrigger = null; + if (this._popper !== null) { + this._popper.destroy(); + } - if ($(this.element).css('display') === 'none') { - throw new Error('Please use show on visible elements'); + this._popper = null; + this.element = null; + this.config = null; + this.tip = null; } + }, { + key: 'show', + value: function show() { + var _this = this; - var showEvent = $.Event(this.constructor.Event.SHOW); - if (this.isWithContent() && this._isEnabled) { - $(this.element).trigger(showEvent); + if ($(this.element).css('display') === 'none') { + throw new Error('Please use show on visible elements'); + } - var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element); + var showEvent = $.Event(this.constructor.Event.SHOW); + if (this.isWithContent() && this._isEnabled) { + $(this.element).trigger(showEvent); - if (showEvent.isDefaultPrevented() || !isInTheDom) { - return; - } + var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element); - var tip = this.getTipElement(); - var tipId = Util.getUID(this.constructor.NAME); + if (showEvent.isDefaultPrevented() || !isInTheDom) { + return; + } - tip.setAttribute('id', tipId); - this.element.setAttribute('aria-describedby', tipId); + var tip = this.getTipElement(); + var tipId = Util.getUID(this.constructor.NAME); - this.setContent(); + tip.setAttribute('id', tipId); + this.element.setAttribute('aria-describedby', tipId); - if (this.config.animation) { - $(tip).addClass(ClassName.FADE); - } + this.setContent(); - var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; + if (this.config.animation) { + $(tip).addClass(ClassName.FADE); + } - var attachment = this._getAttachment(placement); - this.addAttachmentClass(attachment); + var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; - var container = this.config.container === false ? document.body : $(this.config.container); + var attachment = this._getAttachment(placement); + this.addAttachmentClass(attachment); - $(tip).data(this.constructor.DATA_KEY, this); + var container = this.config.container === false ? document.body : $(this.config.container); - if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) { - $(tip).appendTo(container); - } + $(tip).data(this.constructor.DATA_KEY, this); - $(this.element).trigger(this.constructor.Event.INSERTED); + if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) { + $(tip).appendTo(container); + } - this._popper = new Popper(this.element, tip, { - placement: attachment, - modifiers: { - offset: { - offset: this.config.offset + $(this.element).trigger(this.constructor.Event.INSERTED); + + this._popper = new Popper(this.element, tip, { + placement: attachment, + modifiers: { + offset: { + offset: this.config.offset + }, + flip: { + behavior: this.config.fallbackPlacement + }, + arrow: { + element: Selector.ARROW + } }, - flip: { - behavior: this.config.fallbackPlacement + onCreate: function onCreate(data) { + if (data.originalPlacement !== data.placement) { + _this._handlePopperPlacementChange(data); + } }, - arrow: { - element: Selector.ARROW - } - }, - onCreate: function onCreate(data) { - if (data.originalPlacement !== data.placement) { + onUpdate: function onUpdate(data) { _this._handlePopperPlacementChange(data); } - }, - onUpdate: function onUpdate(data) { - _this._handlePopperPlacementChange(data); + }); + + $(tip).addClass(ClassName.SHOW); + + // 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 + // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html + if ('ontouchstart' in document.documentElement) { + $('body').children().on('mouseover', null, $.noop); } - }); - $(tip).addClass(ClassName.SHOW); + var complete = function complete() { + if (_this.config.animation) { + _this._fixTransition(); + } + var prevHoverState = _this._hoverState; + _this._hoverState = null; - // 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 - // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html - if ('ontouchstart' in document.documentElement) { - $('body').children().on('mouseover', null, $.noop); + $(_this.element).trigger(_this.constructor.Event.SHOWN); + + if (prevHoverState === HoverState.OUT) { + _this._leave(null, _this); + } + }; + + if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) { + $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION); + } else { + complete(); + } } + } + }, { + key: 'hide', + value: function hide(callback) { + var _this2 = this; + var tip = this.getTipElement(); + var hideEvent = $.Event(this.constructor.Event.HIDE); var complete = function complete() { - if (_this.config.animation) { - _this._fixTransition(); + if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) { + tip.parentNode.removeChild(tip); } - var prevHoverState = _this._hoverState; - _this._hoverState = null; - $(_this.element).trigger(_this.constructor.Event.SHOWN); + _this2._cleanTipClass(); + _this2.element.removeAttribute('aria-describedby'); + $(_this2.element).trigger(_this2.constructor.Event.HIDDEN); + if (_this2._popper !== null) { + _this2._popper.destroy(); + } - if (prevHoverState === HoverState.OUT) { - _this._leave(null, _this); + if (callback) { + callback(); } }; - if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) { - $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION); - } else { - complete(); - } - } - }; - - Tooltip.prototype.hide = function hide(callback) { - var _this2 = this; + $(this.element).trigger(hideEvent); - var tip = this.getTipElement(); - var hideEvent = $.Event(this.constructor.Event.HIDE); - var complete = function complete() { - if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) { - tip.parentNode.removeChild(tip); + if (hideEvent.isDefaultPrevented()) { + return; } - _this2._cleanTipClass(); - _this2.element.removeAttribute('aria-describedby'); - $(_this2.element).trigger(_this2.constructor.Event.HIDDEN); - if (_this2._popper !== null) { - _this2._popper.destroy(); - } + $(tip).removeClass(ClassName.SHOW); - if (callback) { - callback(); + // if this is a touch-enabled device we remove the extra + // empty mouseover listeners we added for iOS support + if ('ontouchstart' in document.documentElement) { + $('body').children().off('mouseover', null, $.noop); } - }; - $(this.element).trigger(hideEvent); + this._activeTrigger[Trigger.CLICK] = false; + this._activeTrigger[Trigger.FOCUS] = false; + this._activeTrigger[Trigger.HOVER] = false; - if (hideEvent.isDefaultPrevented()) { - return; - } + if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) { - $(tip).removeClass(ClassName.SHOW); + $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + } else { + complete(); + } - // if this is a touch-enabled device we remove the extra - // empty mouseover listeners we added for iOS support - if ('ontouchstart' in document.documentElement) { - $('body').children().off('mouseover', null, $.noop); + this._hoverState = ''; } - - this._activeTrigger[Trigger.CLICK] = false; - this._activeTrigger[Trigger.FOCUS] = false; - this._activeTrigger[Trigger.HOVER] = false; - - if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) { - - $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); - } else { - complete(); + }, { + key: 'update', + value: function update() { + if (this._popper !== null) { + this._popper.scheduleUpdate(); + } } - this._hoverState = ''; - }; + // protected - Tooltip.prototype.update = function update() { - if (this._popper !== null) { - this._popper.scheduleUpdate(); + }, { + key: 'isWithContent', + value: function isWithContent() { + return Boolean(this.getTitle()); } - }; - - // 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); - }; - - Tooltip.prototype.setElementContent = function setElementContent($element, content) { - var html = this.config.html; - if ((typeof content === 'undefined' ? 'undefined' : _typeof(content)) === 'object' && (content.nodeType || content.jquery)) { - // content is a DOM node or a jQuery - if (html) { - if (!$(content).parent().is($element)) { - $element.empty().append(content); + }, { + key: 'addAttachmentClass', + value: function addAttachmentClass(attachment) { + $(this.getTipElement()).addClass(CLASS_PREFIX + '-' + attachment); + } + }, { + key: 'getTipElement', + value: function getTipElement() { + this.tip = this.tip || $(this.config.template)[0]; + return this.tip; + } + }, { + key: 'setContent', + value: function setContent() { + var $tip = $(this.getTipElement()); + this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle()); + $tip.removeClass(ClassName.FADE + ' ' + ClassName.SHOW); + } + }, { + key: 'setElementContent', + value: function setElementContent($element, content) { + var html = this.config.html; + if ((typeof content === 'undefined' ? 'undefined' : _typeof(content)) === 'object' && (content.nodeType || content.jquery)) { + // content is a DOM node or a jQuery + if (html) { + if (!$(content).parent().is($element)) { + $element.empty().append(content); + } + } else { + $element.text($(content).text()); } } else { - $element.text($(content).text()); + $element[html ? 'html' : 'text'](content); } - } else { - $element[html ? 'html' : 'text'](content); } - }; + }, { + key: 'getTitle', + value: function getTitle() { + var title = this.element.getAttribute('data-original-title'); - Tooltip.prototype.getTitle = function getTitle() { - var title = this.element.getAttribute('data-original-title'); + if (!title) { + title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; + } - if (!title) { - title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; + return title; } - return title; - }; - - // private - - Tooltip.prototype._getAttachment = function _getAttachment(placement) { - return AttachmentMap[placement.toUpperCase()]; - }; - - Tooltip.prototype._setListeners = function _setListeners() { - var _this3 = this; + // private - var triggers = this.config.trigger.split(' '); + }, { + key: '_getAttachment', + value: function _getAttachment(placement) { + return AttachmentMap[placement.toUpperCase()]; + } + }, { + key: '_setListeners', + value: function _setListeners() { + var _this3 = this; + + var triggers = this.config.trigger.split(' '); + + triggers.forEach(function (trigger) { + if (trigger === 'click') { + $(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) { + return _this3.toggle(event); + }); + } else if (trigger !== Trigger.MANUAL) { + var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN; + var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT; + + $(_this3.element).on(eventIn, _this3.config.selector, function (event) { + return _this3._enter(event); + }).on(eventOut, _this3.config.selector, function (event) { + return _this3._leave(event); + }); + } - triggers.forEach(function (trigger) { - if (trigger === 'click') { - $(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) { - return _this3.toggle(event); - }); - } else if (trigger !== Trigger.MANUAL) { - var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN; - var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT; - - $(_this3.element).on(eventIn, _this3.config.selector, function (event) { - return _this3._enter(event); - }).on(eventOut, _this3.config.selector, function (event) { - return _this3._leave(event); + $(_this3.element).closest('.modal').on('hide.bs.modal', function () { + return _this3.hide(); }); - } - - $(_this3.element).closest('.modal').on('hide.bs.modal', function () { - return _this3.hide(); }); - }); - if (this.config.selector) { - this.config = $.extend({}, this.config, { - trigger: 'manual', - selector: '' - }); - } else { - this._fixTitle(); + if (this.config.selector) { + this.config = $.extend({}, this.config, { + trigger: 'manual', + selector: '' + }); + } else { + this._fixTitle(); + } } - }; - - Tooltip.prototype._fixTitle = function _fixTitle() { - var titleType = _typeof(this.element.getAttribute('data-original-title')); - if (this.element.getAttribute('title') || titleType !== 'string') { - this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); - this.element.setAttribute('title', ''); + }, { + key: '_fixTitle', + value: function _fixTitle() { + var titleType = _typeof(this.element.getAttribute('data-original-title')); + if (this.element.getAttribute('title') || titleType !== 'string') { + this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); + this.element.setAttribute('title', ''); + } } - }; - - Tooltip.prototype._enter = function _enter(event, context) { - var dataKey = this.constructor.DATA_KEY; - - context = context || $(event.currentTarget).data(dataKey); + }, { + key: '_enter', + value: function _enter(event, context) { + var dataKey = this.constructor.DATA_KEY; - if (!context) { - context = new this.constructor(event.currentTarget, this._getDelegateConfig()); - $(event.currentTarget).data(dataKey, context); - } + context = context || $(event.currentTarget).data(dataKey); - if (event) { - context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true; - } + if (!context) { + context = new this.constructor(event.currentTarget, this._getDelegateConfig()); + $(event.currentTarget).data(dataKey, context); + } - if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) { - context._hoverState = HoverState.SHOW; - return; - } + if (event) { + context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true; + } - clearTimeout(context._timeout); + if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) { + context._hoverState = HoverState.SHOW; + return; + } - context._hoverState = HoverState.SHOW; + clearTimeout(context._timeout); - if (!context.config.delay || !context.config.delay.show) { - context.show(); - return; - } + context._hoverState = HoverState.SHOW; - context._timeout = setTimeout(function () { - if (context._hoverState === HoverState.SHOW) { + if (!context.config.delay || !context.config.delay.show) { context.show(); + return; } - }, context.config.delay.show); - }; - Tooltip.prototype._leave = function _leave(event, context) { - var dataKey = this.constructor.DATA_KEY; - - context = context || $(event.currentTarget).data(dataKey); - - if (!context) { - context = new this.constructor(event.currentTarget, this._getDelegateConfig()); - $(event.currentTarget).data(dataKey, context); - } - - if (event) { - context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false; - } - - if (context._isWithActiveTrigger()) { - return; + context._timeout = setTimeout(function () { + if (context._hoverState === HoverState.SHOW) { + context.show(); + } + }, context.config.delay.show); } + }, { + key: '_leave', + value: function _leave(event, context) { + var dataKey = this.constructor.DATA_KEY; - clearTimeout(context._timeout); - - context._hoverState = HoverState.OUT; + context = context || $(event.currentTarget).data(dataKey); - if (!context.config.delay || !context.config.delay.hide) { - context.hide(); - return; - } + if (!context) { + context = new this.constructor(event.currentTarget, this._getDelegateConfig()); + $(event.currentTarget).data(dataKey, context); + } - context._timeout = setTimeout(function () { - if (context._hoverState === HoverState.OUT) { - context.hide(); + if (event) { + context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false; } - }, context.config.delay.hide); - }; - Tooltip.prototype._isWithActiveTrigger = function _isWithActiveTrigger() { - for (var trigger in this._activeTrigger) { - if (this._activeTrigger[trigger]) { - return true; + if (context._isWithActiveTrigger()) { + return; } - } - return false; - }; + clearTimeout(context._timeout); - Tooltip.prototype._getConfig = function _getConfig(config) { - config = $.extend({}, this.constructor.Default, $(this.element).data(), config); + context._hoverState = HoverState.OUT; - if (config.delay && typeof config.delay === 'number') { - config.delay = { - show: config.delay, - hide: config.delay - }; - } + if (!context.config.delay || !context.config.delay.hide) { + context.hide(); + return; + } - if (config.title && typeof config.title === 'number') { - config.title = config.title.toString(); + context._timeout = setTimeout(function () { + if (context._hoverState === HoverState.OUT) { + context.hide(); + } + }, context.config.delay.hide); } + }, { + key: '_isWithActiveTrigger', + value: function _isWithActiveTrigger() { + for (var trigger in this._activeTrigger) { + if (this._activeTrigger[trigger]) { + return true; + } + } - if (config.content && typeof config.content === 'number') { - config.content = config.content.toString(); + return false; } + }, { + key: '_getConfig', + value: function _getConfig(config) { + config = $.extend({}, this.constructor.Default, $(this.element).data(), config); + + if (config.delay && typeof config.delay === 'number') { + config.delay = { + show: config.delay, + hide: config.delay + }; + } - Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); + if (config.title && typeof config.title === 'number') { + config.title = config.title.toString(); + } - return config; - }; + if (config.content && typeof config.content === 'number') { + config.content = config.content.toString(); + } - Tooltip.prototype._getDelegateConfig = function _getDelegateConfig() { - var config = {}; + Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); - if (this.config) { - for (var key in this.config) { - if (this.constructor.Default[key] !== this.config[key]) { - config[key] = this.config[key]; + return config; + } + }, { + key: '_getDelegateConfig', + value: function _getDelegateConfig() { + var config = {}; + + if (this.config) { + for (var key in this.config) { + if (this.constructor.Default[key] !== this.config[key]) { + config[key] = this.config[key]; + } } } - } - 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('')); + return config; } - }; - - 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; + }, { + key: '_cleanTipClass', + value: 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('')); + } } - $(tip).removeClass(ClassName.FADE); - this.config.animation = false; - this.hide(); - this.show(); - this.config.animation = initConfigAnimation; - }; - - // static - - Tooltip._jQueryInterface = function _jQueryInterface(config) { - return this.each(function () { - var data = $(this).data(DATA_KEY); - var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config; - - if (!data && /dispose|hide/.test(config)) { + }, { + key: '_handlePopperPlacementChange', + value: function _handlePopperPlacementChange(data) { + this._cleanTipClass(); + this.addAttachmentClass(this._getAttachment(data.placement)); + } + }, { + key: '_fixTransition', + value: 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; + } - if (!data) { - data = new Tooltip(this, _config); - $(this).data(DATA_KEY, data); - } + // static + + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config; - if (typeof config === 'string') { - if (data[config] === undefined) { - throw new Error('No method named "' + config + '"'); + if (!data && /dispose|hide/.test(config)) { + return; + } + + if (!data) { + data = new Tooltip(this, _config); + $(this).data(DATA_KEY, data); } - data[config](); - } - }); - }; - _createClass(Tooltip, null, [{ + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new Error('No method named "' + config + '"'); + } + data[config](); + } + }); + } + }, { key: 'VERSION', get: function get() { return VERSION; @@ -675,5 +713,5 @@ var Tooltip = function ($) { }; return Tooltip; -}(jQuery); /* global Popper */ +}(jQuery, 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 7785033557..50b1e36fa0 100644 --- a/js/dist/tooltip.js.map +++ b/js/dist/tooltip.js.map @@ -1 +1 @@ -{"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","AUTO","TOP","RIGHT","BOTTOM","LEFT","Default","HoverState","SHOW","OUT","Event","HIDE","HIDDEN","SHOWN","INSERTED","CLICK","FOCUSIN","FOCUSOUT","MOUSEENTER","MOUSELEAVE","ClassName","FADE","Selector","TOOLTIP","TOOLTIP_INNER","ARROW","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","arrow","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;;;;;;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CAAKL,IAAL,IAAaI,kBAAb;AACA,WAAOR,QAAQgL,gBAAf;AACD,GAHD;;AAKA,SAAOhL,OAAP;AAED,CA1sBe,CA0sBbuL,MA1sBa,CAAhB,C,CAZA","file":"tooltip.js","sourcesContent":["/* global Popper */\n\nimport Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): 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-beta'\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 AUTO : 'auto',\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 ARROW : '.arrow'\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 arrow: {\n element: Selector.ARROW\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 +{"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","AUTO","TOP","RIGHT","BOTTOM","LEFT","Default","HoverState","SHOW","OUT","Event","HIDE","HIDDEN","SHOWN","INSERTED","CLICK","FOCUSIN","FOCUSOUT","MOUSEENTER","MOUSELEAVE","ClassName","FADE","Selector","TOOLTIP","TOOLTIP_INNER","ARROW","Trigger","HOVER","FOCUS","MANUAL","element","config","_isEnabled","_timeout","_hoverState","_activeTrigger","_popper","_getConfig","tip","_setListeners","event","dataKey","constructor","context","currentTarget","data","_getDelegateConfig","click","_isWithActiveTrigger","_enter","_leave","getTipElement","hasClass","clearTimeout","removeData","off","closest","remove","destroy","css","showEvent","isWithContent","isInTheDom","contains","ownerDocument","documentElement","isDefaultPrevented","tipId","Util","getUID","setAttribute","setContent","addClass","call","attachment","_getAttachment","addAttachmentClass","document","body","appendTo","modifiers","flip","behavior","arrow","onCreate","originalPlacement","_handlePopperPlacementChange","onUpdate","children","on","noop","complete","_fixTransition","prevHoverState","supportsTransitionEnd","one","TRANSITION_END","emulateTransitionEnd","_TRANSITION_DURATION","callback","hideEvent","parentNode","removeChild","_cleanTipClass","removeAttribute","removeClass","scheduleUpdate","Boolean","getTitle","$tip","setElementContent","find","$element","content","nodeType","jquery","parent","is","empty","append","text","getAttribute","toUpperCase","triggers","split","forEach","toggle","eventIn","eventOut","hide","extend","_fixTitle","titleType","type","show","setTimeout","toString","typeCheckConfig","key","tabClass","attr","match","length","join","initConfigAnimation","each","_config","test","_jQueryInterface","Constructor","noConflict","jQuery"],"mappings":";;;;;;;;AAKA;;;;;;;AAOA,IAAMA,UAAW,YAAM;;AAErB;;;;AAIA,MAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;AACjC,UAAM,IAAIC,KAAJ,CAAU,8DAAV,CAAN;AACD;;AAGD;;;;;;AAMA,MAAMC,OAAsB,SAA5B;AACA,MAAMC,UAAsB,YAA5B;AACA,MAAMC,WAAsB,YAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,qBAAsBC,EAAEC,EAAF,CAAKN,IAAL,CAA5B;AACA,MAAMO,sBAAsB,GAA5B;AACA,MAAMC,eAAsB,YAA5B;AACA,MAAMC,qBAAqB,IAAIC,MAAJ,aAAqBF,YAArB,WAAyC,GAAzC,CAA3B;;AAEA,MAAMG,cAAc;AAClBC,eAAsB,SADJ;AAElBC,cAAsB,QAFJ;AAGlBC,WAAsB,2BAHJ;AAIlBC,aAAsB,QAJJ;AAKlBC,WAAsB,iBALJ;AAMlBC,UAAsB,SANJ;AAOlBC,cAAsB,kBAPJ;AAQlBC,eAAsB,mBARJ;AASlBC,YAAsB,iBATJ;AAUlBC,eAAsB,0BAVJ;AAWlBC,uBAAsB;AAXJ,GAApB;;AAcA,MAAMC,gBAAgB;AACpBC,UAAS,MADW;AAEpBC,SAAS,KAFW;AAGpBC,WAAS,OAHW;AAIpBC,YAAS,QAJW;AAKpBC,UAAS;AALW,GAAtB;;AAQA,MAAMC,UAAU;AACdjB,eAAsB,IADR;AAEdC,cAAsB,yCACA,2BADA,GAEA,yCAJR;AAKdE,aAAsB,aALR;AAMdD,WAAsB,EANR;AAOdE,WAAsB,CAPR;AAQdC,UAAsB,KARR;AASdC,cAAsB,KATR;AAUdC,eAAsB,KAVR;AAWdC,YAAsB,CAXR;AAYdC,eAAsB,KAZR;AAadC,uBAAsB;AAbR,GAAhB;;AAgBA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,IAAL,EAAW;AACTA,mBAAO,IAAIvE,OAAJ,CAAY,IAAZ,EAAkB4K,OAAlB,CAAP;AACApK,cAAE,IAAF,EAAQ+D,IAAR,CAAalE,QAAb,EAAuBkE,IAAvB;AACD;;AAED,cAAI,OAAOd,MAAP,KAAkB,QAAtB,EAAgC;AAC9B,gBAAI,OAAOc,KAAKd,MAAL,CAAP,KAAwB,WAA5B,EAAyC;AACvC,oBAAM,IAAIvD,KAAJ,uBAA8BuD,MAA9B,OAAN;AACD;AACDc,iBAAKd,MAAL;AACD;AACF,SAnBM,CAAP;AAoBD;AA3rBkB;AAAA;AAAA,0BAkIE;AACnB,eAAOrD,OAAP;AACD;AApIkB;AAAA;AAAA,0BAsIE;AACnB,eAAO4B,OAAP;AACD;AAxIkB;AAAA;AAAA,0BA0ID;AAChB,eAAO7B,IAAP;AACD;AA5IkB;AAAA;AAAA,0BA8IG;AACpB,eAAOE,QAAP;AACD;AAhJkB;AAAA;AAAA,0BAkJA;AACjB,eAAO+B,KAAP;AACD;AApJkB;AAAA;AAAA,0BAsJI;AACrB,eAAO9B,SAAP;AACD;AAxJkB;AAAA;AAAA,0BA0JM;AACvB,eAAOQ,WAAP;AACD;AA5JkB;;AAAA;AAAA;;AA+rBrB;;;;;;AAMAN,IAAEC,EAAF,CAAKN,IAAL,IAAyBH,QAAQ8K,gBAAjC;AACAtK,IAAEC,EAAF,CAAKN,IAAL,EAAW4K,WAAX,GAAyB/K,OAAzB;AACAQ,IAAEC,EAAF,CAAKN,IAAL,EAAW6K,UAAX,GAAyB,YAAY;AACnCxK,MAAEC,EAAF,CAAKN,IAAL,IAAaI,kBAAb;AACA,WAAOP,QAAQ8K,gBAAf;AACD,GAHD;;AAKA,SAAO9K,OAAP;AAED,CA9sBe,CA8sBbiL,MA9sBa,EA8sBLhL,MA9sBK,CAAhB","file":"tooltip.js","sourcesContent":["import $ from 'jquery'\nimport Popper from 'popper.js'\nimport Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): 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-beta'\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 AUTO : 'auto',\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 ARROW : '.arrow'\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 (!this._isEnabled) {\n return\n }\n\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\n this._popper = null\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 arrow: {\n element: Selector.ARROW\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 this.tip = this.tip || $(this.config.template)[0]\n return this.tip\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 (typeof 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] = 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, Popper)\n\nexport default Tooltip\n"]}
\ No newline at end of file diff --git a/js/dist/util.js b/js/dist/util.js index b6d5f03e91..0cb4b614e0 100644 --- a/js/dist/util.js +++ b/js/dist/util.js @@ -1,3 +1,5 @@ +'use strict'; + /** * -------------------------------------------------------------------------- * Bootstrap (v4.0.0-beta): util.js @@ -5,7 +7,7 @@ * -------------------------------------------------------------------------- */ -var Util = function ($) { +var Util = function () { /** * ------------------------------------------------------------------------ @@ -40,7 +42,7 @@ var Util = function ($) { if ($(event.target).is(this)) { return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params } - return undefined; + return undefined; // eslint-disable-line no-undefined } }; } @@ -53,7 +55,7 @@ var Util = function ($) { var el = document.createElement('bootstrap'); for (var name in TransitionEndEvent) { - if (el.style[name] !== undefined) { + if (typeof el.style[name] !== 'undefined') { return { end: TransitionEndEvent[name] }; @@ -115,7 +117,7 @@ var Util = function ($) { } try { - var $selector = $(selector); + var $selector = $(document).find(selector); return $selector.length > 0 ? selector : null; } catch (error) { return null; @@ -132,7 +134,7 @@ var Util = function ($) { }, typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { for (var property in configTypes) { - if (configTypes.hasOwnProperty(property)) { + if (Object.prototype.hasOwnProperty.call(configTypes, property)) { var expectedTypes = configTypes[property]; var value = config[property]; var valueType = value && isElement(value) ? 'element' : toType(value); diff --git a/js/dist/util.js.map b/js/dist/util.js.map index 960f4b4f7d..aa1d755996 100644 --- a/js/dist/util.js.map +++ b/js/dist/util.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/util.js"],"names":["Util","$","transition","MAX_UID","TransitionEndEvent","WebkitTransition","MozTransition","OTransition","toType","obj","toString","call","match","toLowerCase","isElement","nodeType","getSpecialTransitionEndEvent","bindType","end","delegateType","handle","event","target","is","handleObj","handler","apply","arguments","undefined","transitionEndTest","window","QUnit","el","document","createElement","name","style","transitionEndEmulator","duration","called","one","TRANSITION_END","setTimeout","triggerTransitionEnd","setTransitionEndSupport","fn","emulateTransitionEnd","supportsTransitionEnd","special","getUID","prefix","Math","random","getElementById","getSelectorFromElement","element","selector","getAttribute","$selector","length","error","reflow","offsetHeight","trigger","Boolean","typeCheckConfig","componentName","config","configTypes","property","hasOwnProperty","expectedTypes","value","valueType","RegExp","test","Error","toUpperCase","jQuery"],"mappings":"AAAA;;;;;;;AAOA,IAAMA,OAAQ,UAACC,CAAD,EAAO;;AAGnB;;;;;;AAMA,MAAIC,aAAa,KAAjB;;AAEA,MAAMC,UAAU,OAAhB;;AAEA,MAAMC,qBAAqB;AACzBC,sBAAmB,qBADM;AAEzBC,mBAAmB,eAFM;AAGzBC,iBAAmB,+BAHM;AAIzBL,gBAAmB;;AAGrB;AAP2B,GAA3B,CAQA,SAASM,MAAT,CAAgBC,GAAhB,EAAqB;AACnB,WAAO,GAAGC,QAAH,CAAYC,IAAZ,CAAiBF,GAAjB,EAAsBG,KAAtB,CAA4B,eAA5B,EAA6C,CAA7C,EAAgDC,WAAhD,EAAP;AACD;;AAED,WAASC,SAAT,CAAmBL,GAAnB,EAAwB;AACtB,WAAO,CAACA,IAAI,CAAJ,KAAUA,GAAX,EAAgBM,QAAvB;AACD;;AAED,WAASC,4BAAT,GAAwC;AACtC,WAAO;AACLC,gBAAUf,WAAWgB,GADhB;AAELC,oBAAcjB,WAAWgB,GAFpB;AAGLE,YAHK,kBAGEC,KAHF,EAGS;AACZ,YAAIpB,EAAEoB,MAAMC,MAAR,EAAgBC,EAAhB,CAAmB,IAAnB,CAAJ,EAA8B;AAC5B,iBAAOF,MAAMG,SAAN,CAAgBC,OAAhB,CAAwBC,KAAxB,CAA8B,IAA9B,EAAoCC,SAApC,CAAP,CAD4B,CAC0B;AACvD;AACD,eAAOC,SAAP;AACD;AARI,KAAP;AAUD;;AAED,WAASC,iBAAT,GAA6B;AAC3B,QAAIC,OAAOC,KAAX,EAAkB;AAChB,aAAO,KAAP;AACD;;AAED,QAAMC,KAAKC,SAASC,aAAT,CAAuB,WAAvB,CAAX;;AAEA,SAAK,IAAM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YzD,EAAEuD,QAAF,CAAlB;AACA,eAAOE,UAAUC,MAAV,GAAmB,CAAnB,GAAuBH,QAAvB,GAAkC,IAAzC;AACD,OAHD,CAGE,OAAOI,KAAP,EAAc;AACd,eAAO,IAAP;AACD;AACF,KAxBU;AA0BXC,UA1BW,kBA0BJN,OA1BI,EA0BK;AACd,aAAOA,QAAQO,YAAf;AACD,KA5BU;AA8BXnB,wBA9BW,gCA8BUY,OA9BV,EA8BmB;AAC5BtD,QAAEsD,OAAF,EAAWQ,OAAX,CAAmB7D,WAAWgB,GAA9B;AACD,KAhCU;AAkCX6B,yBAlCW,mCAkCa;AACtB,aAAOiB,QAAQ9D,UAAR,CAAP;AACD,KApCU;AAsCX+D,mBAtCW,2BAsCKC,aAtCL,EAsCoBC,MAtCpB,EAsC4BC,WAtC5B,EAsCyC;AAClD,WAAK,IAAMC,QAAX,IAAuBD,WAAvB,EAAoC;AAClC,YAAIA,YAAYE,cAAZ,CAA2BD,QAA3B,CAAJ,EAA0C;AACxC,cAAME,gBAAgBH,YAAYC,QAAZ,CAAtB;AACA,cAAMG,QAAgBL,OAAOE,QAAP,CAAtB;AACA,cAAMI,YAAgBD,SAAS1D,UAAU0D,KAAV,CAAT,GACA,SADA,GACYhE,OAAOgE,KAAP,CADlC;;AAGA,cAAI,CAAC,IAAIE,MAAJ,CAAWH,aAAX,EAA0BI,IAA1B,CAA+BF,SAA/B,CAAL,EAAgD;AAC9C,kBAAM,IAAIG,KAAJ,CACDV,cAAcW,WAAd,EAAH,wBACWR,QADX,yBACuCI,SADvC,oCAEsBF,aAFtB,QADI,CAAN;AAID;AACF;AACF;AACF;AAtDU,GAAb;;AAyDA3B;;AAEA,SAAO5C,IAAP;AAED,CA1JY,CA0JV8E,MA1JU,CAAb","file":"util.js","sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Util = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n\n let transition = false\n\n const MAX_UID = 1000000\n\n const TransitionEndEvent = {\n WebkitTransition : 'webkitTransitionEnd',\n MozTransition : 'transitionend',\n OTransition : 'oTransitionEnd otransitionend',\n transition : 'transitionend'\n }\n\n // shoutout AngusCroll (https://goo.gl/pxwQGp)\n function toType(obj) {\n return {}.toString.call(obj).match(/\\s([a-zA-Z]+)/)[1].toLowerCase()\n }\n\n function isElement(obj) {\n return (obj[0] || obj).nodeType\n }\n\n function getSpecialTransitionEndEvent() {\n return {\n bindType: transition.end,\n delegateType: transition.end,\n handle(event) {\n if ($(event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments) // eslint-disable-line prefer-rest-params\n }\n return undefined\n }\n }\n }\n\n function transitionEndTest() {\n if (window.QUnit) {\n return false\n }\n\n const el = document.createElement('bootstrap')\n\n for (const name in TransitionEndEvent) {\n if (el.style[name] !== undefined) {\n return {\n end: TransitionEndEvent[name]\n }\n }\n }\n\n return false\n }\n\n function transitionEndEmulator(duration) {\n let called = false\n\n $(this).one(Util.TRANSITION_END, () => {\n called = true\n })\n\n setTimeout(() => {\n if (!called) {\n Util.triggerTransitionEnd(this)\n }\n }, duration)\n\n return this\n }\n\n function setTransitionEndSupport() {\n transition = transitionEndTest()\n\n $.fn.emulateTransitionEnd = transitionEndEmulator\n\n if (Util.supportsTransitionEnd()) {\n $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent()\n }\n }\n\n\n /**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\n const Util = {\n\n TRANSITION_END: 'bsTransitionEnd',\n\n getUID(prefix) {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID) // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix))\n return prefix\n },\n\n getSelectorFromElement(element) {\n let selector = element.getAttribute('data-target')\n if (!selector || selector === '#') {\n selector = element.getAttribute('href') || ''\n }\n\n try {\n const $selector = $(selector)\n return $selector.length > 0 ? selector : null\n } catch (error) {\n return null\n }\n },\n\n reflow(element) {\n return element.offsetHeight\n },\n\n triggerTransitionEnd(element) {\n $(element).trigger(transition.end)\n },\n\n supportsTransitionEnd() {\n return Boolean(transition)\n },\n\n typeCheckConfig(componentName, config, configTypes) {\n for (const property in configTypes) {\n if (configTypes.hasOwnProperty(property)) {\n const expectedTypes = configTypes[property]\n const value = config[property]\n const valueType = value && isElement(value) ?\n 'element' : toType(value)\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(\n `${componentName.toUpperCase()}: ` +\n `Option \"${property}\" provided type \"${valueType}\" ` +\n `but expected type \"${expectedTypes}\".`)\n }\n }\n }\n }\n }\n\n setTransitionEndSupport()\n\n return Util\n\n})(jQuery)\n\nexport default Util\n"]}
\ No newline at end of file +{"version":3,"sources":["../src/util.js"],"names":["Util","transition","MAX_UID","TransitionEndEvent","WebkitTransition","MozTransition","OTransition","toType","obj","toString","call","match","toLowerCase","isElement","nodeType","getSpecialTransitionEndEvent","bindType","end","delegateType","handle","event","$","target","is","handleObj","handler","apply","arguments","undefined","transitionEndTest","window","QUnit","el","document","createElement","name","style","transitionEndEmulator","duration","called","one","TRANSITION_END","setTimeout","triggerTransitionEnd","setTransitionEndSupport","fn","emulateTransitionEnd","supportsTransitionEnd","special","getUID","prefix","Math","random","getElementById","getSelectorFromElement","element","selector","getAttribute","$selector","find","length","error","reflow","offsetHeight","trigger","Boolean","typeCheckConfig","componentName","config","configTypes","property","Object","prototype","hasOwnProperty","expectedTypes","value","valueType","RegExp","test","Error","toUpperCase","jQuery"],"mappings":";;AAEA;;;;;;;AAOA,IAAMA,OAAQ,YAAM;;AAGlB;;;;;;AAMA,MAAIC,aAAa,KAAjB;;AAEA,MAAMC,UAAU,OAAhB;;AAEA,MAAMC,qBAAqB;AACzBC,sBAAmB,qBADM;AAEzBC,mBAAm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S,OAAX,CAAmB/D,WAAWgB,GAA9B;AACD,KAhCU;AAkCX8B,yBAlCW,mCAkCa;AACtB,aAAOkB,QAAQhE,UAAR,CAAP;AACD,KApCU;AAsCXiE,mBAtCW,2BAsCKC,aAtCL,EAsCoBC,MAtCpB,EAsC4BC,WAtC5B,EAsCyC;AAClD,WAAK,IAAMC,QAAX,IAAuBD,WAAvB,EAAoC;AAClC,YAAIE,OAAOC,SAAP,CAAiBC,cAAjB,CAAgC/D,IAAhC,CAAqC2D,WAArC,EAAkDC,QAAlD,CAAJ,EAAiE;AAC/D,cAAMI,gBAAgBL,YAAYC,QAAZ,CAAtB;AACA,cAAMK,QAAgBP,OAAOE,QAAP,CAAtB;AACA,cAAMM,YAAgBD,SAAS9D,UAAU8D,KAAV,CAAT,GACA,SADA,GACYpE,OAAOoE,KAAP,CADlC;;AAGA,cAAI,CAAC,IAAIE,MAAJ,CAAWH,aAAX,EAA0BI,IAA1B,CAA+BF,SAA/B,CAAL,EAAgD;AAC9C,kBAAM,IAAIG,KAAJ,CACDZ,cAAca,WAAd,EAAH,wBACWV,QADX,yBACuCM,SADvC,oCAEsBF,aAFtB,QADI,CAAN;AAID;AACF;AACF;AACF;AAtDU,GAAb;;AAyDA9B;;AAEA,SAAO5C,IAAP;AAED,CA1JY,CA0JViF,MA1JU,CAAb","file":"util.js","sourcesContent":["import $ from 'jquery'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-beta): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Util = (() => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n\n let transition = false\n\n const MAX_UID = 1000000\n\n const TransitionEndEvent = {\n WebkitTransition : 'webkitTransitionEnd',\n MozTransition : 'transitionend',\n OTransition : 'oTransitionEnd otransitionend',\n transition : 'transitionend'\n }\n\n // shoutout AngusCroll (https://goo.gl/pxwQGp)\n function toType(obj) {\n return {}.toString.call(obj).match(/\\s([a-zA-Z]+)/)[1].toLowerCase()\n }\n\n function isElement(obj) {\n return (obj[0] || obj).nodeType\n }\n\n function getSpecialTransitionEndEvent() {\n return {\n bindType: transition.end,\n delegateType: transition.end,\n handle(event) {\n if ($(event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments) // eslint-disable-line prefer-rest-params\n }\n return undefined // eslint-disable-line no-undefined\n }\n }\n }\n\n function transitionEndTest() {\n if (window.QUnit) {\n return false\n }\n\n const el = document.createElement('bootstrap')\n\n for (const name in TransitionEndEvent) {\n if (typeof el.style[name] !== 'undefined') {\n return {\n end: TransitionEndEvent[name]\n }\n }\n }\n\n return false\n }\n\n function transitionEndEmulator(duration) {\n let called = false\n\n $(this).one(Util.TRANSITION_END, () => {\n called = true\n })\n\n setTimeout(() => {\n if (!called) {\n Util.triggerTransitionEnd(this)\n }\n }, duration)\n\n return this\n }\n\n function setTransitionEndSupport() {\n transition = transitionEndTest()\n\n $.fn.emulateTransitionEnd = transitionEndEmulator\n\n if (Util.supportsTransitionEnd()) {\n $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent()\n }\n }\n\n\n /**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\n const Util = {\n\n TRANSITION_END: 'bsTransitionEnd',\n\n getUID(prefix) {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID) // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix))\n return prefix\n },\n\n getSelectorFromElement(element) {\n let selector = element.getAttribute('data-target')\n if (!selector || selector === '#') {\n selector = element.getAttribute('href') || ''\n }\n\n try {\n const $selector = $(document).find(selector)\n return $selector.length > 0 ? selector : null\n } catch (error) {\n return null\n }\n },\n\n reflow(element) {\n return element.offsetHeight\n },\n\n triggerTransitionEnd(element) {\n $(element).trigger(transition.end)\n },\n\n supportsTransitionEnd() {\n return Boolean(transition)\n },\n\n typeCheckConfig(componentName, config, configTypes) {\n for (const property in configTypes) {\n if (Object.prototype.hasOwnProperty.call(configTypes, property)) {\n const expectedTypes = configTypes[property]\n const value = config[property]\n const valueType = value && isElement(value) ?\n 'element' : toType(value)\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(\n `${componentName.toUpperCase()}: ` +\n `Option \"${property}\" provided type \"${valueType}\" ` +\n `but expected type \"${expectedTypes}\".`)\n }\n }\n }\n }\n }\n\n setTransitionEndSupport()\n\n return Util\n\n})(jQuery)\n\nexport default Util\n"]}
\ No newline at end of file |