diff options
author | Mark Otto <markdotto@gmail.com> | 2016-10-10 03:26:51 +0300 |
---|---|---|
committer | Mark Otto <markdotto@gmail.com> | 2016-10-10 03:26:51 +0300 |
commit | 571e86e7705ee38a4b828b0e6f24de089a69e8a9 (patch) | |
tree | 6fa1e44c68d2e18720694a34803475e172f42b64 /js/dist | |
parent | 6def7a5d56c5042a6f91361842f85f5af6e5b033 (diff) |
grunt
Diffstat (limited to 'js/dist')
-rw-r--r-- | js/dist/alert.js | 175 | ||||
-rw-r--r-- | js/dist/alert.js.map | 2 | ||||
-rw-r--r-- | js/dist/button.js | 125 | ||||
-rw-r--r-- | js/dist/button.js.map | 2 | ||||
-rw-r--r-- | js/dist/carousel.js | 516 | ||||
-rw-r--r-- | js/dist/carousel.js.map | 2 | ||||
-rw-r--r-- | js/dist/collapse.js | 360 | ||||
-rw-r--r-- | js/dist/collapse.js.map | 2 | ||||
-rw-r--r-- | js/dist/dropdown.js | 294 | ||||
-rw-r--r-- | js/dist/dropdown.js.map | 2 | ||||
-rw-r--r-- | js/dist/modal.js | 592 | ||||
-rw-r--r-- | js/dist/modal.js.map | 2 | ||||
-rw-r--r-- | js/dist/popover.js | 121 | ||||
-rw-r--r-- | js/dist/popover.js.map | 2 | ||||
-rw-r--r-- | js/dist/scrollspy.js | 298 | ||||
-rw-r--r-- | js/dist/scrollspy.js.map | 2 | ||||
-rw-r--r-- | js/dist/tab.js | 250 | ||||
-rw-r--r-- | js/dist/tab.js.map | 2 | ||||
-rw-r--r-- | js/dist/tooltip.js | 644 | ||||
-rw-r--r-- | js/dist/tooltip.js.map | 2 | ||||
-rw-r--r-- | js/dist/util.js | 23 | ||||
-rw-r--r-- | js/dist/util.js.map | 2 |
22 files changed, 1633 insertions, 1787 deletions
diff --git a/js/dist/alert.js b/js/dist/alert.js index b9cc9dd0fb..4b99701665 100644 --- a/js/dist/alert.js +++ b/js/dist/alert.js @@ -1,8 +1,6 @@ -'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; }; }(); -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'); } } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** * -------------------------------------------------------------------------- @@ -11,7 +9,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * -------------------------------------------------------------------------- */ -var Alert = (function ($) { +var Alert = function ($) { /** * ------------------------------------------------------------------------ @@ -49,120 +47,103 @@ var Alert = (function ($) { * ------------------------------------------------------------------------ */ - var Alert = (function () { + var Alert = function () { function Alert(element) { _classCallCheck(this, Alert); this._element = element; } - /** - * ------------------------------------------------------------------------ - * Data Api implementation - * ------------------------------------------------------------------------ - */ - // getters - _createClass(Alert, [{ - key: 'close', + // public - // public + Alert.prototype.close = function close(element) { + element = element || this._element; - value: function close(element) { - element = element || this._element; + var rootElement = this._getRootElement(element); + var customEvent = this._triggerCloseEvent(rootElement); - var rootElement = this._getRootElement(element); - var customEvent = this._triggerCloseEvent(rootElement); + if (customEvent.isDefaultPrevented()) { + return; + } - if (customEvent.isDefaultPrevented()) { - return; - } + this._removeElement(rootElement); + }; + + Alert.prototype.dispose = function dispose() { + $.removeData(this._element, DATA_KEY); + this._element = null; + }; + + // private + + Alert.prototype._getRootElement = function _getRootElement(element) { + var selector = Util.getSelectorFromElement(element); + var parent = false; - this._removeElement(rootElement); + if (selector) { + parent = $(selector)[0]; } - }, { - key: 'dispose', - value: function dispose() { - $.removeData(this._element, DATA_KEY); - this._element = null; + + if (!parent) { + parent = $(element).closest('.' + ClassName.ALERT)[0]; } - // private + return parent; + }; - }, { - key: '_getRootElement', - value: function _getRootElement(element) { - var selector = Util.getSelectorFromElement(element); - var parent = false; + Alert.prototype._triggerCloseEvent = function _triggerCloseEvent(element) { + var closeEvent = $.Event(Event.CLOSE); - if (selector) { - parent = $(selector)[0]; - } + $(element).trigger(closeEvent); + return closeEvent; + }; - if (!parent) { - parent = $(element).closest('.' + ClassName.ALERT)[0]; - } + Alert.prototype._removeElement = function _removeElement(element) { + $(element).removeClass(ClassName.IN); - return parent; + if (!Util.supportsTransitionEnd() || !$(element).hasClass(ClassName.FADE)) { + this._destroyElement(element); + return; } - }, { - key: '_triggerCloseEvent', - value: function _triggerCloseEvent(element) { - var closeEvent = $.Event(Event.CLOSE); - $(element).trigger(closeEvent); - return closeEvent; - } - }, { - key: '_removeElement', - value: function _removeElement(element) { - $(element).removeClass(ClassName.IN); - - if (!Util.supportsTransitionEnd() || !$(element).hasClass(ClassName.FADE)) { - this._destroyElement(element); - return; - } + $(element).one(Util.TRANSITION_END, $.proxy(this._destroyElement, this, element)).emulateTransitionEnd(TRANSITION_DURATION); + }; - $(element).one(Util.TRANSITION_END, $.proxy(this._destroyElement, this, element)).emulateTransitionEnd(TRANSITION_DURATION); - } - }, { - key: '_destroyElement', - value: function _destroyElement(element) { - $(element).detach().trigger(Event.CLOSED).remove(); - } + Alert.prototype._destroyElement = function _destroyElement(element) { + $(element).detach().trigger(Event.CLOSED).remove(); + }; - // static + // static - }], [{ - key: '_jQueryInterface', - value: function _jQueryInterface(config) { - return this.each(function () { - var $element = $(this); - var data = $element.data(DATA_KEY); + Alert._jQueryInterface = function _jQueryInterface(config) { + return this.each(function () { + var $element = $(this); + var data = $element.data(DATA_KEY); - if (!data) { - data = new Alert(this); - $element.data(DATA_KEY, data); - } + if (!data) { + data = new Alert(this); + $element.data(DATA_KEY, data); + } - if (config === 'close') { - data[config](this); - } - }); - } - }, { - key: '_handleDismiss', - value: function _handleDismiss(alertInstance) { - return function (event) { - if (event) { - event.preventDefault(); - } - - alertInstance.close(this); - }; - } - }, { + if (config === 'close') { + data[config](this); + } + }); + }; + + Alert._handleDismiss = function _handleDismiss(alertInstance) { + return function (event) { + if (event) { + event.preventDefault(); + } + + alertInstance.close(this); + }; + }; + + _createClass(Alert, null, [{ key: 'VERSION', get: function get() { return VERSION; @@ -170,7 +151,13 @@ var Alert = (function ($) { }]); return Alert; - })(); + }(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert())); @@ -188,5 +175,5 @@ var Alert = (function ($) { }; return Alert; -})(jQuery); +}(jQuery); //# sourceMappingURL=alert.js.map diff --git a/js/dist/alert.js.map b/js/dist/alert.js.map index 4237cb82c6..f5a55dbe2e 100644 --- a/js/dist/alert.js.map +++ b/js/dist/alert.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/alert.js"],"names":[],"mappings":";;;;;;;;;;;;;AAUA,IAAM,KAAK,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;;AASpB,MAAM,IAAI,GAAkB,OAAO,CAAA;AACnC,MAAM,OAAO,GAAe,eAAe,CAAA;AAC3C,MAAM,QAAQ,GAAc,UAAU,CAAA;AACtC,MAAM,SAAS,SAAiB,QAAQ,AAAE,CAAA;AAC1C,MAAM,YAAY,GAAU,WAAW,CAAA;AACvC,MAAM,kBAAkB,GAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;AACtC,MAAM,mBAAmB,GAAG,GAAG,CAAA;;AAE/B,MAAM,QAAQ,GAAG;AACf,WAAO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AAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;WAC9B;;AAED,cAAI,MAAM,KAAK,OAAO,EAAE;AACtB,gBAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAA;WACnB;SACF,CAAC,CAAA;OACH;;;aAEoB,wBAAC,aAAa,EAAE;AACnC,eAAO,UAAU,KAAK,EAAE;AACtB,cAAI,KAAK,EAAE;AACT,iBAAK,CAAC,cAAc,EAAE,CAAA;WACvB;;AAED,uBAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;SAC1B,CAAA;OACF;;;WAlGiB,eAAG;AACnB,eAAO,OAAO,CAAA;OACf;;;WAXG,KAAK;;;AAsHX,GAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CACZ,KAAK,CAAC,cAAc,EACpB,QAAQ,CAAC,OAAO,EAChB,KAAK,CAAC,cAAc,CAAC,IAAI,KAAK,EAAE,CAAC,CAClC,CAAA;;;;;;;;AASD,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAe,KAAK,CAAC,gBAAgB,CAAA;AAC/C,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,GAAG,KAAK,CAAA;AAC9B,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,GAAI,YAAY;AACnC,KAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAA;AAC/B,WAAO,KAAK,CAAC,gBAAgB,CAAA;GAC9B,CAAA;;AAED,SAAO,KAAK,CAAA;CAEb,CAAA,CAAE,MAAM,CAAC,CAAA","file":"alert.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): 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-alpha.4'\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 IN : 'in'\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 let rootElement = this._getRootElement(element)\n let 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 let 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 let closeEvent = $.Event(Event.CLOSE)\n\n $(element).trigger(closeEvent)\n return closeEvent\n }\n\n _removeElement(element) {\n $(element).removeClass(ClassName.IN)\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, $.proxy(this._destroyElement, this, element))\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 let $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","IN","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","proxy","emulateTransitionEnd","detach","remove","_jQueryInterface","config","each","$element","data","_handleDismiss","alertInstance","event","preventDefault","document","on","Constructor","noConflict","jQuery"],"mappings":";;;;AAGA;;;;;;;AAOA,IAAMA,QAAS,UAACC,CAAD,EAAO;;AAGpB;;;;;;AAMA,MAAMC,OAAsB,OAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,UAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,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Af,EAAwB;AACtBG,eAAKH,MAAL,EAAa,IAAb;AACD;AACF,OAZM,CAAP;AAaD,KAzIiB;;AAAA,UA2IXI,cA3IW,2BA2IIC,aA3IJ,EA2ImB;AACnC,aAAO,UAAUC,KAAV,EAAiB;AACtB,YAAIA,KAAJ,EAAW;AACTA,gBAAMC,cAAN;AACD;;AAEDF,sBAAchC,KAAd,CAAoB,IAApB;AACD,OAND;AAOD,KAnJiB;;AAAA;AAAA;AAAA,0BAiDG;AACnB,eAAOnB,OAAP;AACD;AAnDiB;;AAAA;AAAA;;AAwJpB;;;;;;AAMAF,IAAEwD,QAAF,EAAYC,EAAZ,CACE9C,MAAMG,cADR,EAEEL,SAASC,OAFX,EAGEX,MAAMqD,cAAN,CAAqB,IAAIrD,KAAJ,EAArB,CAHF;;AAOA;;;;;;AAMAC,IAAEO,EAAF,CAAKN,IAAL,IAAyBF,MAAMgD,gBAA/B;AACA/C,IAAEO,EAAF,CAAKN,IAAL,EAAWyD,WAAX,GAAyB3D,KAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAW0D,UAAX,GAAyB,YAAY;AACnC3D,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,MAAMgD,gBAAb;AACD,GAHD;;AAKA,SAAOhD,KAAP;AAED,CApLa,CAoLX6D,MApLW,CAAd","file":"alert.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): 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-alpha.4'\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 IN : 'in'\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 let rootElement = this._getRootElement(element)\n let 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 let 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 let closeEvent = $.Event(Event.CLOSE)\n\n $(element).trigger(closeEvent)\n return closeEvent\n }\n\n _removeElement(element) {\n $(element).removeClass(ClassName.IN)\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, $.proxy(this._destroyElement, this, element))\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 let $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 2d791ed1fe..20f532fc9f 100644 --- a/js/dist/button.js +++ b/js/dist/button.js @@ -1,3 +1,7 @@ +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"); } } + /** * -------------------------------------------------------------------------- * Bootstrap (v4.0.0-alpha.4): button.js @@ -5,13 +9,7 @@ * -------------------------------------------------------------------------- */ -'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'); } } - -var Button = (function ($) { +var Button = function ($) { /** * ------------------------------------------------------------------------ @@ -51,87 +49,76 @@ var Button = (function ($) { * ------------------------------------------------------------------------ */ - var Button = (function () { + var Button = function () { function Button(element) { _classCallCheck(this, Button); this._element = element; } - /** - * ------------------------------------------------------------------------ - * Data Api implementation - * ------------------------------------------------------------------------ - */ - // getters - _createClass(Button, [{ - key: 'toggle', + // public - // public + Button.prototype.toggle = function toggle() { + var triggerChangeEvent = true; + var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0]; - value: function toggle() { - var triggerChangeEvent = 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) { - input.checked = !$(this._element).hasClass(ClassName.ACTIVE); - $(this._element).trigger('change'); - } - - input.focus(); + if (triggerChangeEvent) { + input.checked = !$(this._element).hasClass(ClassName.ACTIVE); + $(this._element).trigger('change'); } - } else { - this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE)); - } - if (triggerChangeEvent) { - $(this._element).toggleClass(ClassName.ACTIVE); + input.focus(); } + } else { + this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE)); } - }, { - key: 'dispose', - value: function dispose() { - $.removeData(this._element, DATA_KEY); - this._element = null; + + if (triggerChangeEvent) { + $(this._element).toggleClass(ClassName.ACTIVE); } + }; - // static + Button.prototype.dispose = function dispose() { + $.removeData(this._element, DATA_KEY); + this._element = null; + }; - }], [{ - key: '_jQueryInterface', - value: function _jQueryInterface(config) { - return this.each(function () { - var data = $(this).data(DATA_KEY); + // static - if (!data) { - data = new Button(this); - $(this).data(DATA_KEY, data); - } + Button._jQueryInterface = 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); + } + + if (config === 'toggle') { + data[config](); + } + }); + }; + + _createClass(Button, null, [{ key: 'VERSION', get: function get() { return VERSION; @@ -139,7 +126,13 @@ var Button = (function ($) { }]); return Button; - })(); + }(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) { event.preventDefault(); @@ -170,5 +163,5 @@ var Button = (function ($) { }; return Button; -})(jQuery); +}(jQuery); //# sourceMappingURL=button.js.map diff --git a/js/dist/button.js.map b/js/dist/button.js.map index 856460da35..32343f0347 100644 --- a/js/dist/button.js.map +++ b/js/dist/button.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/button.js"],"names":[],"mappings":";;;;;;;;;;;;;AAOA,IAAM,MAAM,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;;AASrB,MAAM,IAAI,GAAkB,QAAQ,CAAA;AACpC,MAAM,OAAO,GAAe,eAAe,CAAA;AAC3C,MAAM,QAAQ,GAAc,WAAW,CAAA;AACvC,MAAM,SAAS,SAAiB,QAAQ,AAAE,CAAA;AAC1C,MAAM,YAAY,GAAU,WAAW,CAAA;AACvC,MAAM,kBAAkB,GAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;;AAEtC,MAAM,SAAS,GAAG;AAChB,U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AY;AACnC,KAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAA;AAC/B,WAAO,MAAM,CAAC,gBAAgB,CAAA;GAC/B,CAAA;;AAED,SAAO,MAAM,CAAA;CAEd,CAAA,CAAE,MAAM,CAAC,CAAA","file":"button.js","sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Button = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'button'\n const VERSION = '4.0.0-alpha.4'\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 rootElement = $(this._element).closest(\n Selector.DATA_TOGGLE\n )[0]\n\n if (rootElement) {\n let 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 let activeElement = $(rootElement).find(Selector.ACTIVE)[0]\n\n if (activeElement) {\n $(activeElement).removeClass(ClassName.ACTIVE)\n }\n }\n }\n\n if (triggerChangeEvent) {\n input.checked = !$(this._element).hasClass(ClassName.ACTIVE)\n $(this._element).trigger('change')\n }\n\n input.focus()\n }\n\n } else {\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 let button = $(event.target).closest(Selector.BUTTON)[0]\n $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type))\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Button._jQueryInterface\n $.fn[NAME].Constructor = Button\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Button._jQueryInterface\n }\n\n return Button\n\n})(jQuery)\n\nexport default Button\n"]}
\ No newline at end of file +{"version":3,"sources":["../src/button.js"],"names":["Button","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","ClassName","ACTIVE","BUTTON","FOCUS","Selector","DATA_TOGGLE_CARROT","DATA_TOGGLE","INPUT","Event","CLICK_DATA_API","FOCUS_BLUR_DATA_API","element","_element","toggle","triggerChangeEvent","rootElement","closest","input","find","type","checked","hasClass","activeElement","removeClass","trigger","focus","setAttribute","toggleClass","dispose","removeData","_jQueryInterface","config","each","data","document","on","event","preventDefault","button","target","call","test","Constructor","noConflict","jQuery"],"mappings":";;;;AAAA;;;;;;;AAOA,IAAMA,SAAU,UAACC,CAAD,EAAO;;AAGrB;;;;;;AAMA,MAAMC,OAAsB,QAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,WAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,eAAsB,WAA5B;AACA,MAAMC,qBAAsBN,EAAEO,EAAF,CAAKN,IAAL,CAA5B;;AAEA,MAAMO,YAAY;AAChBC,YAAS,QADO;AAEhBC,YAAS,KAFO;AAGhBC,WAAS;AAHO,GAAlB;;AAMA,MAAMC,WAAW;AACfC,wBAAqB,yBADN;AAEfC,iBAAqB,yBAFN;AAGfC,WAAqB,OAHN;AAIfN,YAAqB,SAJN;AAKfC,YAAqB;AALN,GAAjB;;AAQA,MAAMM,QAAQ;AACZC,8BAA8Bb,SAA9B,GAA0CC,YAD9B;AAEZa,yBAAsB,UAAQd,SAAR,GAAoBC,YAApB,mBACOD,SADP,GACmBC,YADnB;AAFV,GAAd;;AAOA;;;;;;AArCqB,MA2CfN,MA3Ce;AA6CnB,oBAAYoB,OAAZ,EAAqB;AAAA;;AACnB,WAAKC,QAAL,GAAgBD,OAAhB;AACD;;AAGD;;AAOA;;AAzDmB,qBA2DnBE,MA3DmB,qBA2DV;AACP,UAAIC,qBAAqB,IAAzB;AACA,UAAIC,cAAqBvB,EAAE,KAAKoB,QAAP,EAAiBI,OAAjB,CACvBZ,SAASE,WADc,EAEvB,CAFuB,CAAzB;;AAIA,UAAIS,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C;AACAtC,IAAEO,EAAF,CAAKN,IAAL,EAAWiD,WAAX,GAAyBnD,MAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWkD,UAAX,GAAyB,YAAY;AACnCnD,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,OAAOuC,gBAAd;AACD,GAHD;;AAKA,SAAOvC,MAAP;AAED,CAtKc,CAsKZqD,MAtKY,CAAf","file":"button.js","sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Button = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'button'\n const VERSION = '4.0.0-alpha.4'\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 rootElement = $(this._element).closest(\n Selector.DATA_TOGGLE\n )[0]\n\n if (rootElement) {\n let 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 let activeElement = $(rootElement).find(Selector.ACTIVE)[0]\n\n if (activeElement) {\n $(activeElement).removeClass(ClassName.ACTIVE)\n }\n }\n }\n\n if (triggerChangeEvent) {\n input.checked = !$(this._element).hasClass(ClassName.ACTIVE)\n $(this._element).trigger('change')\n }\n\n input.focus()\n }\n\n } else {\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 let 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 99f3090d97..c41111d504 100644 --- a/js/dist/carousel.js +++ b/js/dist/carousel.js @@ -1,8 +1,8 @@ -'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; }; })(); +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'); } } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** * -------------------------------------------------------------------------- @@ -11,7 +11,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * -------------------------------------------------------------------------- */ -var Carousel = (function ($) { +var Carousel = function ($) { /** * ------------------------------------------------------------------------ @@ -85,7 +85,7 @@ var Carousel = (function ($) { * ------------------------------------------------------------------------ */ - var Carousel = (function () { + var Carousel = function () { function Carousel(element, config) { _classCallCheck(this, Carousel); @@ -103,344 +103,318 @@ var Carousel = (function ($) { this._addEventListeners(); } - /** - * ------------------------------------------------------------------------ - * Data Api implementation - * ------------------------------------------------------------------------ - */ - // getters - _createClass(Carousel, [{ - key: 'next', + // public - // public + Carousel.prototype.next = function next() { + if (!this._isSliding) { + this._slide(Direction.NEXT); + } + }; - value: function next() { - if (!this._isSliding) { - this._slide(Direction.NEXT); - } + Carousel.prototype.nextWhenVisible = function nextWhenVisible() { + // Don't call next when the page isn't visible + if (!document.hidden) { + this.next(); } - }, { - key: 'nextWhenVisible', - value: function nextWhenVisible() { - // Don't call next when the page isn't visible - if (!document.hidden) { - this.next(); - } + }; + + Carousel.prototype.prev = function prev() { + if (!this._isSliding) { + this._slide(Direction.PREVIOUS); } - }, { - key: 'prev', - value: function prev() { - if (!this._isSliding) { - this._slide(Direction.PREVIOUS); - } + }; + + Carousel.prototype.pause = function pause(event) { + if (!event) { + this._isPaused = true; } - }, { - key: 'pause', - value: function pause(event) { - if (!event) { - this._isPaused = true; - } - if ($(this._element).find(Selector.NEXT_PREV)[0] && Util.supportsTransitionEnd()) { - Util.triggerTransitionEnd(this._element); - this.cycle(true); - } + if ($(this._element).find(Selector.NEXT_PREV)[0] && Util.supportsTransitionEnd()) { + Util.triggerTransitionEnd(this._element); + this.cycle(true); + } + clearInterval(this._interval); + this._interval = null; + }; + + Carousel.prototype.cycle = function cycle(event) { + if (!event) { + this._isPaused = false; + } + + if (this._interval) { clearInterval(this._interval); this._interval = null; } - }, { - key: 'cycle', - value: function cycle(event) { - if (!event) { - this._isPaused = false; - } - if (this._interval) { - clearInterval(this._interval); - this._interval = null; - } + if (this._config.interval && !this._isPaused) { + this._interval = setInterval($.proxy(document.visibilityState ? this.nextWhenVisible : this.next, this), this._config.interval); + } + }; - if (this._config.interval && !this._isPaused) { - this._interval = setInterval($.proxy(document.visibilityState ? this.nextWhenVisible : this.next, 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; } - }, { - key: 'to', - value: function to(index) { - var _this = this; - this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]; + if (this._isSliding) { + $(this._element).one(Event.SLID, function () { + return _this.to(index); + }); + return; + } - var activeIndex = this._getItemIndex(this._activeElement); + if (activeIndex === index) { + this.pause(); + this.cycle(); + return; + } - if (index > this._items.length - 1 || index < 0) { - return; - } + var direction = index > activeIndex ? Direction.NEXT : Direction.PREVIOUS; - if (this._isSliding) { - $(this._element).one(Event.SLID, function () { - return _this.to(index); - }); - return; - } + this._slide(direction, this._items[index]); + }; - if (activeIndex === index) { - this.pause(); - this.cycle(); - return; - } + Carousel.prototype.dispose = function dispose() { + $(this._element).off(EVENT_KEY); + $.removeData(this._element, DATA_KEY); - var direction = index > activeIndex ? Direction.NEXT : Direction.PREVIOUS; + this._items = null; + this._config = null; + this._element = null; + this._interval = null; + this._isPaused = null; + this._isSliding = null; + this._activeElement = null; + this._indicatorsElement = null; + }; - 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; - } + // private - // private + Carousel.prototype._getConfig = function _getConfig(config) { + config = $.extend({}, Default, config); + Util.typeCheckConfig(NAME, config, DefaultType); + return config; + }; - }, { - key: '_getConfig', - value: function _getConfig(config) { - config = $.extend({}, Default, config); - Util.typeCheckConfig(NAME, config, DefaultType); - return config; + Carousel.prototype._addEventListeners = function _addEventListeners() { + if (this._config.keyboard) { + $(this._element).on(Event.KEYDOWN, $.proxy(this._keydown, this)); } - }, { - key: '_addEventListeners', - value: function _addEventListeners() { - if (this._config.keyboard) { - $(this._element).on(Event.KEYDOWN, $.proxy(this._keydown, this)); - } - if (this._config.pause === 'hover' && !('ontouchstart' in document.documentElement)) { - $(this._element).on(Event.MOUSEENTER, $.proxy(this.pause, this)).on(Event.MOUSELEAVE, $.proxy(this.cycle, this)); - } + if (this._config.pause === 'hover' && !('ontouchstart' in document.documentElement)) { + $(this._element).on(Event.MOUSEENTER, $.proxy(this.pause, this)).on(Event.MOUSELEAVE, $.proxy(this.cycle, this)); } - }, { - key: '_keydown', - value: function _keydown(event) { - event.preventDefault(); + }; - if (/input|textarea/i.test(event.target.tagName)) { - return; - } + Carousel.prototype._keydown = function _keydown(event) { + event.preventDefault(); - switch (event.which) { - case ARROW_LEFT_KEYCODE: - this.prev(); - break; - case ARROW_RIGHT_KEYCODE: - this.next(); - break; - default: - return; - } + if (/input|textarea/i.test(event.target.tagName)) { + return; } - }, { - key: '_getItemIndex', - value: function _getItemIndex(element) { - this._items = $.makeArray($(element).parent().find(Selector.ITEM)); - return this._items.indexOf(element); + + switch (event.which) { + case ARROW_LEFT_KEYCODE: + this.prev(); + break; + case ARROW_RIGHT_KEYCODE: + 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.PREVIOUS; + 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: '_getItemByDirection', - value: function _getItemByDirection(direction, activeElement) { - var isNextDirection = direction === Direction.NEXT; - var isPrevDirection = direction === Direction.PREVIOUS; - 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.PREVIOUS ? -1 : 1; - var itemIndex = (activeIndex + delta) % this._items.length; + var delta = direction === Direction.PREVIOUS ? -1 : 1; + var itemIndex = (activeIndex + delta) % this._items.length; - return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; - } - }, { - key: '_triggerSlideEvent', - value: function _triggerSlideEvent(relatedTarget, directionalClassname) { - var slideEvent = $.Event(Event.SLIDE, { - relatedTarget: relatedTarget, - direction: directionalClassname - }); + return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; + }; - $(this._element).trigger(slideEvent); + Carousel.prototype._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, directionalClassname) { + var slideEvent = $.Event(Event.SLIDE, { + relatedTarget: relatedTarget, + direction: directionalClassname + }); - return slideEvent; - } - }, { - key: '_setActiveIndicatorElement', - value: function _setActiveIndicatorElement(element) { - if (this._indicatorsElement) { - $(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE); + $(this._element).trigger(slideEvent); - var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; + return slideEvent; + }; - if (nextIndicator) { - $(nextIndicator).addClass(ClassName.ACTIVE); - } + Carousel.prototype._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { + if (this._indicatorsElement) { + $(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE); + + var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; + + if (nextIndicator) { + $(nextIndicator).addClass(ClassName.ACTIVE); } } - }, { - key: '_slide', - value: function _slide(direction, element) { - var _this2 = this; + }; - var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]; - var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); + Carousel.prototype._slide = function _slide(direction, element) { + var _this2 = this; - var isCycling = Boolean(this._interval); + var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]; + var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); - var directionalClassName = direction === Direction.NEXT ? ClassName.LEFT : ClassName.RIGHT; + var isCycling = Boolean(this._interval); - if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) { - this._isSliding = false; - return; - } + var directionalClassName = direction === Direction.NEXT ? ClassName.LEFT : ClassName.RIGHT; - var slideEvent = this._triggerSlideEvent(nextElement, directionalClassName); - if (slideEvent.isDefaultPrevented()) { - return; - } + if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) { + this._isSliding = false; + return; + } - if (!activeElement || !nextElement) { - // some weirdness is happening, so we bail - return; - } + var slideEvent = this._triggerSlideEvent(nextElement, directionalClassName); + if (slideEvent.isDefaultPrevented()) { + return; + } - this._isSliding = true; + if (!activeElement || !nextElement) { + // some weirdness is happening, so we bail + return; + } - if (isCycling) { - this.pause(); - } + this._isSliding = true; - this._setActiveIndicatorElement(nextElement); + if (isCycling) { + this.pause(); + } - var slidEvent = $.Event(Event.SLID, { - relatedTarget: nextElement, - direction: directionalClassName - }); + this._setActiveIndicatorElement(nextElement); - if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) { + var slidEvent = $.Event(Event.SLID, { + relatedTarget: nextElement, + direction: directionalClassName + }); - $(nextElement).addClass(direction); + if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) { - Util.reflow(nextElement); + $(nextElement).addClass(direction); - $(activeElement).addClass(directionalClassName); - $(nextElement).addClass(directionalClassName); + Util.reflow(nextElement); - $(activeElement).one(Util.TRANSITION_END, function () { - $(nextElement).removeClass(directionalClassName).removeClass(direction); + $(activeElement).addClass(directionalClassName); + $(nextElement).addClass(directionalClassName); - $(nextElement).addClass(ClassName.ACTIVE); + $(activeElement).one(Util.TRANSITION_END, function () { + $(nextElement).removeClass(directionalClassName).removeClass(direction); - $(activeElement).removeClass(ClassName.ACTIVE).removeClass(direction).removeClass(directionalClassName); + $(nextElement).addClass(ClassName.ACTIVE); - _this2._isSliding = false; + $(activeElement).removeClass(ClassName.ACTIVE).removeClass(direction).removeClass(directionalClassName); - setTimeout(function () { - return $(_this2._element).trigger(slidEvent); - }, 0); - }).emulateTransitionEnd(TRANSITION_DURATION); - } else { - $(activeElement).removeClass(ClassName.ACTIVE); - $(nextElement).addClass(ClassName.ACTIVE); + _this2._isSliding = false; - this._isSliding = false; - $(this._element).trigger(slidEvent); - } + setTimeout(function () { + return $(_this2._element).trigger(slidEvent); + }, 0); + }).emulateTransitionEnd(TRANSITION_DURATION); + } else { + $(activeElement).removeClass(ClassName.ACTIVE); + $(nextElement).addClass(ClassName.ACTIVE); - if (isCycling) { - this.cycle(); - } + this._isSliding = false; + $(this._element).trigger(slidEvent); } - // static + if (isCycling) { + this.cycle(); + } + }; - }], [{ - key: '_jQueryInterface', - value: function _jQueryInterface(config) { - return this.each(function () { - var data = $(this).data(DATA_KEY); - var _config = $.extend({}, Default, $(this).data()); + // static - if (typeof config === 'object') { - $.extend(_config, config); - } + Carousel._jQueryInterface = 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 + '"'); - } - data[action](); - } else if (_config.interval) { - data.pause(); - data.cycle(); - } - }); - } - }, { - key: '_dataApiClickHandler', - value: function _dataApiClickHandler(event) { - var selector = Util.getSelectorFromElement(this); + if (!data) { + data = new Carousel(this, _config); + $(this).data(DATA_KEY, data); + } - if (!selector) { - return; + if (typeof config === 'number') { + data.to(config); + } else if (typeof action === 'string') { + if (data[action] === undefined) { + throw new Error('No method named "' + action + '"'); + } + data[action](); + } else if (_config.interval) { + data.pause(); + data.cycle(); } + }); + }; - var target = $(selector)[0]; + Carousel._dataApiClickHandler = function _dataApiClickHandler(event) { + var selector = Util.getSelectorFromElement(this); - if (!target || !$(target).hasClass(ClassName.CAROUSEL)) { - return; - } + if (!selector) { + return; + } - var config = $.extend({}, $(target).data(), $(this).data()); - var slideIndex = this.getAttribute('data-slide-to'); + var target = $(selector)[0]; - if (slideIndex) { - config.interval = false; - } + if (!target || !$(target).hasClass(ClassName.CAROUSEL)) { + return; + } - Carousel._jQueryInterface.call($(target), config); + var config = $.extend({}, $(target).data(), $(this).data()); + var slideIndex = this.getAttribute('data-slide-to'); - if (slideIndex) { - $(target).data(DATA_KEY).to(slideIndex); - } + if (slideIndex) { + config.interval = false; + } - event.preventDefault(); + Carousel._jQueryInterface.call($(target), config); + + if (slideIndex) { + $(target).data(DATA_KEY).to(slideIndex); } - }, { + + event.preventDefault(); + }; + + _createClass(Carousel, null, [{ key: 'VERSION', get: function get() { return VERSION; @@ -453,7 +427,13 @@ var Carousel = (function ($) { }]); return Carousel; - })(); + }(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ $(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler); @@ -478,5 +458,5 @@ var Carousel = (function ($) { }; return Carousel; -})(jQuery); +}(jQuery); //# sourceMappingURL=carousel.js.map diff --git a/js/dist/carousel.js.map b/js/dist/carousel.js.map index 40df56900b..4aaa3b2481 100644 --- a/js/dist/carousel.js.map +++ b/js/dist/carousel.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/carousel.js"],"names":[],"mappings":";;;;;;;;;;;;;AAUA,IAAM,QAAQ,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;;AASvB,MAAM,IAAI,GAAkB,UAAU,CAAA;AACtC,MAAM,OAAO,GAAe,eAAe,CAAA;AAC3C,MAAM,QAAQ,GAAc,aAAa,CAAA;AACzC,MAAM,SAAS,SAAiB,QAAQ,AAAE,CAAA;AAC1C,MAAM,YAAY,GAAU,WAAW,CAAA;AACvC,MAAM,kBAAkB,GAAI,CAAC,CA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AK,CAAC,cAAc,EAAE,CAAA;OACvB;;;WAnViB,eAAG;AACnB,eAAO,OAAO,CAAA;OACf;;;WAEiB,eAAG;AACnB,eAAO,OAAO,CAAA;OACf;;;WA1BG,QAAQ;;;AAkXd,GAAC,CAAC,QAAQ,CAAC,CACR,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,oBAAoB,CAAC,CAAA;;AAE/E,GAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,EAAE,YAAM;AACtC,KAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,YAAY;AACrC,UAAI,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,CAAA;AACvB,cAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC,CAAA;KAC5D,CAAC,CAAA;GACH,CAAC,CAAA;;;;;;;;AASF,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAe,QAAQ,CAAC,gBAAgB,CAAA;AAClD,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,GAAG,QAAQ,CAAA;AACjC,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,GAAI,YAAY;AACnC,KAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAA;AAC/B,WAAO,QAAQ,CAAC,gBAAgB,CAAA;GACjC,CAAA;;AAED,SAAO,QAAQ,CAAA;CAEhB,CAAA,CAAE,MAAM,CAAC,CAAA","file":"carousel.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): 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-alpha.4'\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\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 PREVIOUS : 'prev'\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 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 : 'right',\n LEFT : 'left',\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 : '.next, .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._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 if (!document.hidden) {\n this.next()\n }\n }\n\n prev() {\n if (!this._isSliding) {\n this._slide(Direction.PREVIOUS)\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 $.proxy(document.visibilityState ? this.nextWhenVisible : this.next, this), this._config.interval\n )\n }\n }\n\n to(index) {\n this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]\n\n let 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 let direction = index > activeIndex ?\n Direction.NEXT :\n Direction.PREVIOUS\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, $.proxy(this._keydown, this))\n }\n\n if (this._config.pause === 'hover' &&\n !('ontouchstart' in document.documentElement)) {\n $(this._element)\n .on(Event.MOUSEENTER, $.proxy(this.pause, this))\n .on(Event.MOUSELEAVE, $.proxy(this.cycle, this))\n }\n }\n\n _keydown(event) {\n event.preventDefault()\n\n if (/input|textarea/i.test(event.target.tagName)) {\n return\n }\n\n switch (event.which) {\n case ARROW_LEFT_KEYCODE:\n this.prev()\n break\n case ARROW_RIGHT_KEYCODE:\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 let isNextDirection = direction === Direction.NEXT\n let isPrevDirection = direction === Direction.PREVIOUS\n let activeIndex = this._getItemIndex(activeElement)\n let lastItemIndex = (this._items.length - 1)\n let isGoingToWrap = (isPrevDirection && activeIndex === 0) ||\n (isNextDirection && activeIndex === lastItemIndex)\n\n if (isGoingToWrap && !this._config.wrap) {\n return activeElement\n }\n\n let delta = direction === Direction.PREVIOUS ? -1 : 1\n let 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, directionalClassname) {\n let slideEvent = $.Event(Event.SLIDE, {\n relatedTarget,\n direction: directionalClassname\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 let 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 let activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]\n let nextElement = element || activeElement &&\n this._getItemByDirection(direction, activeElement)\n\n let isCycling = Boolean(this._interval)\n\n let directionalClassName = direction === Direction.NEXT ?\n ClassName.LEFT :\n ClassName.RIGHT\n\n if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {\n this._isSliding = false\n return\n }\n\n let slideEvent = this._triggerSlideEvent(nextElement, directionalClassName)\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 let slidEvent = $.Event(Event.SLID, {\n relatedTarget: nextElement,\n direction: directionalClassName\n })\n\n if (Util.supportsTransitionEnd() &&\n $(this._element).hasClass(ClassName.SLIDE)) {\n\n $(nextElement).addClass(direction)\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)\n .removeClass(direction)\n\n $(nextElement).addClass(ClassName.ACTIVE)\n\n $(activeElement)\n .removeClass(ClassName.ACTIVE)\n .removeClass(direction)\n .removeClass(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 let _config = $.extend({}, Default, $(this).data())\n\n if (typeof config === 'object') {\n $.extend(_config, config)\n }\n\n let 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 let selector = Util.getSelectorFromElement(this)\n\n if (!selector) {\n return\n }\n\n let target = $(selector)[0]\n\n if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {\n return\n }\n\n let config = $.extend({}, $(target).data(), $(this).data())\n let 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 let $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","Default","interval","keyboard","slide","pause","wrap","DefaultType","Direction","NEXT","PREVIOUS","Event","SLIDE","SLID","KEYDOWN","MOUSEENTER","MOUSELEAVE","LOAD_DATA_API","CLICK_DATA_API","ClassName","CAROUSEL","ACTIVE","RIGHT","LEFT","ITEM","Selector","ACTIVE_ITEM","NEXT_PREV","INDICATORS","DATA_SLIDE","DATA_RIDE","element","config","_items","_interval","_activeElement","_isPaused","_isSliding","_config","_getConfig","_element","_indicatorsElement","find","_addEventListeners","next","_slide","nextWhenVisible","document","hidden","prev","event","Util","supportsTransitionEnd","triggerTransitionEnd","cycle","clearInterval","setInterval","proxy","visibilityState","to","index","activeIndex","_getItemIndex","length","one","direction","dispose","off","removeData","extend","typeCheckConfig","on","_keydown","documentElement","preventDefault","test","target","tagName","which","makeArray","parent","indexOf","_getItemByDirection","activeElement","isNextDirection","isPrevDirection","lastItemIndex","isGoingToWrap","delta","itemIndex","_triggerSlideEvent","relatedTarget","directionalClassname","slideEvent","trigger","_setActiveIndicatorElement","removeClass","nextIndicator","children","addClass","nextElement","isCycling","Boolean","directionalClassName","hasClass","isDefaultPrevented","slidEvent","reflow","TRANSITION_END","setTimeout","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,OAAsB,UAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,aAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,eAAsB,WAA5B;AACA,MAAMC,qBAAsBN,EAAEO,EAAF,CAAKN,IAAL,CAA5B;AACA,MAAMO,sBAAsB,GAA5B;AACA,MAAMC,qBAAsB,EAA5B,CAhBuB,CAgBQ;AAC/B,MAAMC,sBAAsB,EAA5B,CAjBuB,CAiBQ;;AAE/B,MAAMC,UAAU;AACdC,cAAW,IADG;AAEdC,cAAW,IAFG;AAGdC,WAAW,KAHG;AAIdC,WAAW,OAJG;AAKdC,UAAW;AALG,GAAhB;;AAQA,MAAMC,cAAc;AAClBL,cAAW,kBADO;A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A1C;AACD,KAHD;AAID,GALD;;AAQA;;;;;;AAMA3H,IAAEO,EAAF,CAAKN,IAAL,IAAyBF,SAAS0H,gBAAlC;AACAzH,IAAEO,EAAF,CAAKN,IAAL,EAAWsI,WAAX,GAAyBxI,QAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWuI,UAAX,GAAyB,YAAY;AACnCxI,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,SAAS0H,gBAAhB;AACD,GAHD;;AAKA,SAAO1H,QAAP;AAED,CAxdgB,CAwdd0I,MAxdc,CAAjB","file":"carousel.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): 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-alpha.4'\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\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 PREVIOUS : 'prev'\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 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 : 'right',\n LEFT : 'left',\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 : '.next, .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._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 if (!document.hidden) {\n this.next()\n }\n }\n\n prev() {\n if (!this._isSliding) {\n this._slide(Direction.PREVIOUS)\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 $.proxy(document.visibilityState ? this.nextWhenVisible : this.next, this), this._config.interval\n )\n }\n }\n\n to(index) {\n this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]\n\n let 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 let direction = index > activeIndex ?\n Direction.NEXT :\n Direction.PREVIOUS\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, $.proxy(this._keydown, this))\n }\n\n if (this._config.pause === 'hover' &&\n !('ontouchstart' in document.documentElement)) {\n $(this._element)\n .on(Event.MOUSEENTER, $.proxy(this.pause, this))\n .on(Event.MOUSELEAVE, $.proxy(this.cycle, this))\n }\n }\n\n _keydown(event) {\n event.preventDefault()\n\n if (/input|textarea/i.test(event.target.tagName)) {\n return\n }\n\n switch (event.which) {\n case ARROW_LEFT_KEYCODE:\n this.prev()\n break\n case ARROW_RIGHT_KEYCODE:\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 let isNextDirection = direction === Direction.NEXT\n let isPrevDirection = direction === Direction.PREVIOUS\n let activeIndex = this._getItemIndex(activeElement)\n let lastItemIndex = (this._items.length - 1)\n let isGoingToWrap = (isPrevDirection && activeIndex === 0) ||\n (isNextDirection && activeIndex === lastItemIndex)\n\n if (isGoingToWrap && !this._config.wrap) {\n return activeElement\n }\n\n let delta = direction === Direction.PREVIOUS ? -1 : 1\n let 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, directionalClassname) {\n let slideEvent = $.Event(Event.SLIDE, {\n relatedTarget,\n direction: directionalClassname\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 let 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 let activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]\n let nextElement = element || activeElement &&\n this._getItemByDirection(direction, activeElement)\n\n let isCycling = Boolean(this._interval)\n\n let directionalClassName = direction === Direction.NEXT ?\n ClassName.LEFT :\n ClassName.RIGHT\n\n if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {\n this._isSliding = false\n return\n }\n\n let slideEvent = this._triggerSlideEvent(nextElement, directionalClassName)\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 let slidEvent = $.Event(Event.SLID, {\n relatedTarget: nextElement,\n direction: directionalClassName\n })\n\n if (Util.supportsTransitionEnd() &&\n $(this._element).hasClass(ClassName.SLIDE)) {\n\n $(nextElement).addClass(direction)\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)\n .removeClass(direction)\n\n $(nextElement).addClass(ClassName.ACTIVE)\n\n $(activeElement)\n .removeClass(ClassName.ACTIVE)\n .removeClass(direction)\n .removeClass(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 let _config = $.extend({}, Default, $(this).data())\n\n if (typeof config === 'object') {\n $.extend(_config, config)\n }\n\n let 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 let selector = Util.getSelectorFromElement(this)\n\n if (!selector) {\n return\n }\n\n let target = $(selector)[0]\n\n if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {\n return\n }\n\n let config = $.extend({}, $(target).data(), $(this).data())\n let 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 let $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 4925aba53c..640fb82176 100644 --- a/js/dist/collapse.js +++ b/js/dist/collapse.js @@ -1,8 +1,8 @@ -'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; }; })(); +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'); } } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** * -------------------------------------------------------------------------- @@ -11,7 +11,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * -------------------------------------------------------------------------- */ -var Collapse = (function ($) { +var Collapse = function ($) { /** * ------------------------------------------------------------------------ @@ -68,7 +68,7 @@ var Collapse = (function ($) { * ------------------------------------------------------------------------ */ - var Collapse = (function () { + var Collapse = function () { function Collapse(element, config) { _classCallCheck(this, Collapse); @@ -88,240 +88,220 @@ var Collapse = (function ($) { } } - /** - * ------------------------------------------------------------------------ - * Data Api implementation - * ------------------------------------------------------------------------ - */ - // getters - _createClass(Collapse, [{ - key: 'toggle', + // public + + Collapse.prototype.toggle = function toggle() { + if ($(this._element).hasClass(ClassName.IN)) { + this.hide(); + } else { + this.show(); + } + }; - // public + Collapse.prototype.show = function show() { + var _this = this; + + if (this._isTransitioning || $(this._element).hasClass(ClassName.IN)) { + return; + } - value: function toggle() { - if ($(this._element).hasClass(ClassName.IN)) { - this.hide(); - } else { - this.show(); + var actives = void 0; + var activesData = void 0; + + if (this._parent) { + actives = $.makeArray($(Selector.ACTIVES)); + if (!actives.length) { + actives = null; } } - }, { - key: 'show', - value: function show() { - var _this = this; - if (this._isTransitioning || $(this._element).hasClass(ClassName.IN)) { + if (actives) { + activesData = $(actives).data(DATA_KEY); + if (activesData && activesData._isTransitioning) { return; } + } - var actives = undefined; - var activesData = undefined; + var startEvent = $.Event(Event.SHOW); + $(this._element).trigger(startEvent); + if (startEvent.isDefaultPrevented()) { + return; + } - if (this._parent) { - actives = $.makeArray($(Selector.ACTIVES)); - if (!actives.length) { - actives = null; - } + if (actives) { + Collapse._jQueryInterface.call($(actives), 'hide'); + if (!activesData) { + $(actives).data(DATA_KEY, null); } + } - if (actives) { - activesData = $(actives).data(DATA_KEY); - if (activesData && activesData._isTransitioning) { - return; - } - } + var dimension = this._getDimension(); - var startEvent = $.Event(Event.SHOW); - $(this._element).trigger(startEvent); - if (startEvent.isDefaultPrevented()) { - return; - } + $(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING); - if (actives) { - Collapse._jQueryInterface.call($(actives), 'hide'); - if (!activesData) { - $(actives).data(DATA_KEY, null); - } - } + this._element.style[dimension] = 0; + this._element.setAttribute('aria-expanded', true); - var dimension = this._getDimension(); + if (this._triggerArray.length) { + $(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true); + } - $(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING); + this.setTransitioning(true); - this._element.style[dimension] = 0; - this._element.setAttribute('aria-expanded', true); + var complete = function complete() { + $(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.IN); - if (this._triggerArray.length) { - $(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true); - } + _this._element.style[dimension] = ''; - this.setTransitioning(true); + _this.setTransitioning(false); - var complete = function complete() { - $(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.IN); + $(_this._element).trigger(Event.SHOWN); + }; - _this._element.style[dimension] = ''; + if (!Util.supportsTransitionEnd()) { + complete(); + return; + } - _this.setTransitioning(false); + var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); + var scrollSize = 'scroll' + capitalizedDimension; - $(_this._element).trigger(Event.SHOWN); - }; + $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); - if (!Util.supportsTransitionEnd()) { - complete(); - return; - } + this._element.style[dimension] = this._element[scrollSize] + 'px'; + }; - var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); - var scrollSize = 'scroll' + capitalizedDimension; + Collapse.prototype.hide = function hide() { + var _this2 = this; - $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + if (this._isTransitioning || !$(this._element).hasClass(ClassName.IN)) { + return; + } - this._element.style[dimension] = this._element[scrollSize] + 'px'; + var startEvent = $.Event(Event.HIDE); + $(this._element).trigger(startEvent); + if (startEvent.isDefaultPrevented()) { + return; } - }, { - key: 'hide', - value: function hide() { - var _this2 = this; - if (this._isTransitioning || !$(this._element).hasClass(ClassName.IN)) { - return; - } + var dimension = this._getDimension(); + var offsetDimension = dimension === Dimension.WIDTH ? 'offsetWidth' : 'offsetHeight'; - var startEvent = $.Event(Event.HIDE); - $(this._element).trigger(startEvent); - if (startEvent.isDefaultPrevented()) { - return; - } + this._element.style[dimension] = this._element[offsetDimension] + 'px'; - var dimension = this._getDimension(); - var offsetDimension = dimension === Dimension.WIDTH ? 'offsetWidth' : 'offsetHeight'; + Util.reflow(this._element); - this._element.style[dimension] = this._element[offsetDimension] + 'px'; + $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.IN); - Util.reflow(this._element); + this._element.setAttribute('aria-expanded', false); - $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.IN); + if (this._triggerArray.length) { + $(this._triggerArray).addClass(ClassName.COLLAPSED).attr('aria-expanded', false); + } - this._element.setAttribute('aria-expanded', false); + this.setTransitioning(true); - if (this._triggerArray.length) { - $(this._triggerArray).addClass(ClassName.COLLAPSED).attr('aria-expanded', false); - } + var complete = function complete() { + _this2.setTransitioning(false); + $(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN); + }; - this.setTransitioning(true); + this._element.style[dimension] = 0; - var complete = function complete() { - _this2.setTransitioning(false); - $(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN); - }; + if (!Util.supportsTransitionEnd()) { + complete(); + return; + } - this._element.style[dimension] = 0; + $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + }; - if (!Util.supportsTransitionEnd()) { - complete(); - return; - } + Collapse.prototype.setTransitioning = function setTransitioning(isTransitioning) { + this._isTransitioning = isTransitioning; + }; - $(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.dispose = function dispose() { + $.removeData(this._element, DATA_KEY); - // private + this._config = null; + this._parent = null; + this._element = null; + this._triggerArray = null; + this._isTransitioning = null; + }; - }, { - 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; + // private - var parent = $(this._config.parent)[0]; - var selector = '[data-toggle="collapse"][data-parent="' + this._config.parent + '"]'; + 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; + }; - $(parent).find(selector).each(function (i, element) { - _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); - }); + Collapse.prototype._getDimension = function _getDimension() { + var hasWidth = $(this._element).hasClass(Dimension.WIDTH); + return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT; + }; - return parent; - } - }, { - key: '_addAriaAndCollapsedClass', - value: function _addAriaAndCollapsedClass(element, triggerArray) { - if (element) { - var isOpen = $(element).hasClass(ClassName.IN); - element.setAttribute('aria-expanded', isOpen); - - if (triggerArray.length) { - $(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen); - } + Collapse.prototype._getParent = function _getParent() { + var _this3 = this; + + var parent = $(this._config.parent)[0]; + var selector = '[data-toggle="collapse"][data-parent="' + this._config.parent + '"]'; + + $(parent).find(selector).each(function (i, element) { + _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); + }); + + return parent; + }; + + Collapse.prototype._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { + if (element) { + var isOpen = $(element).hasClass(ClassName.IN); + element.setAttribute('aria-expanded', isOpen); + + if (triggerArray.length) { + $(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen); } } + }; - // static + // static - }], [{ - 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 === 'object' && config); - - if (!data && _config.toggle && /show|hide/.test(config)) { - _config.toggle = false; - } + Collapse._getTargetFromElement = function _getTargetFromElement(element) { + var selector = Util.getSelectorFromElement(element); + return selector ? $(selector)[0] : null; + }; - if (!data) { - data = new Collapse(this, _config); - $this.data(DATA_KEY, data); - } + 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 (typeof config === 'string') { - if (data[config] === undefined) { - throw new Error('No method named "' + config + '"'); - } - data[config](); + if (!data && _config.toggle && /show|hide/.test(config)) { + _config.toggle = false; + } + + if (!data) { + data = new Collapse(this, _config); + $this.data(DATA_KEY, data); + } + + if (typeof config === 'string') { + if (data[config] === undefined) { + throw new Error('No method named "' + config + '"'); } - }); - } - }, { + data[config](); + } + }); + }; + + _createClass(Collapse, null, [{ key: 'VERSION', get: function get() { return VERSION; @@ -334,7 +314,13 @@ var Collapse = (function ($) { }]); return Collapse; - })(); + }(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { event.preventDefault(); @@ -360,5 +346,5 @@ var Collapse = (function ($) { }; return Collapse; -})(jQuery); +}(jQuery); //# sourceMappingURL=collapse.js.map diff --git a/js/dist/collapse.js.map b/js/dist/collapse.js.map index 5eae7599d3..f43b7b8fb4 100644 --- a/js/dist/collapse.js.map +++ b/js/dist/collapse.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/collapse.js"],"names":[],"mappings":";;;;;;;;;;;;;AAUA,IAAM,QAAQ,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;;AASvB,MAAM,IAAI,GAAkB,UAAU,CAAA;AACtC,MAAM,OAAO,GAAe,eAAe,CAAA;AAC3C,MAAM,QAAQ,GAAc,aAAa,CAAA;AACzC,MAAM,SAAS,SAAiB,QAAQ,AAAE,CAAA;AAC1C,MAAM,YAAY,GAAU,WAAW,CAAA;AACvC,MAAM,kBAAkB,GAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;AACtC,MAAM,mBAAmB,GAAG,GAAG,CAAA;;AAE/B,MAAM,OAAO,GAAG;AACd,UAAM,EAAG,IAAI;AACb,UAAM,EAAG,EAAE;GACZ,CAAA;;AAED,MAAM,WAAW,GAAG;AAClB,UAAM,EAAG,SAAS;AAClB,UAAM,EAAG,QAAQ;GAClB,CAAA;;AAED,MAAM,KAAK,GAAG;AACZ,QAAI,WAAoB,SAAS,AAAE;AACnC,SAAK,YAAoB,SAAS,AAAE;AACpC,QAAI,WAAoB,SAAS,AAAE;AACnC,UAAM,aAAoB,SAAS,AAAE;AACrC,kBAAc,YAAW,SAAS,GAAG,YAAY,AAAE;GACpD,CAAA;;AAED,MAAM,SAAS,GAAG;AAChB,MAAE,EAAW,IAAI;AACjB,YAAQ,EAAK,UAAU;AACvB,cAAU,EAAG,YAAY;AACzB,aAAS,EAAI,WAAW;GACzB,CAAA;;AAED,MAAM,SAAS,GAAG;AAChB,SAAK,EAAI,OAAO;AAChB,UAAM,EAAG,QAAQ;GAClB,CAAA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AC,IAAI,CAAC,CAAA;AACjD,QAAI,IAAI,GAAK,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;AACrC,QAAI,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAA;;AAE7C,YAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAA;GAClD,CAAC,CAAA;;;;;;;;AASF,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAe,QAAQ,CAAC,gBAAgB,CAAA;AAClD,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,GAAG,QAAQ,CAAA;AACjC,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,GAAI,YAAY;AACnC,KAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAA;AAC/B,WAAO,QAAQ,CAAC,gBAAgB,CAAA;GACjC,CAAA;;AAED,SAAO,QAAQ,CAAA;CAEhB,CAAA,CAAE,MAAM,CAAC,CAAA","file":"collapse.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Collapse = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'collapse'\n const VERSION = '4.0.0-alpha.4'\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 IN : 'in',\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 : '.panel > .in, .panel > .collapsing',\n DATA_TOGGLE : '[data-toggle=\"collapse\"]'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Collapse {\n\n constructor(element, config) {\n this._isTransitioning = false\n this._element = element\n this._config = this._getConfig(config)\n this._triggerArray = $.makeArray($(\n `[data-toggle=\"collapse\"][href=\"#${element.id}\"],` +\n `[data-toggle=\"collapse\"][data-target=\"#${element.id}\"]`\n ))\n\n this._parent = this._config.parent ? this._getParent() : null\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._element, this._triggerArray)\n }\n\n if (this._config.toggle) {\n this.toggle()\n }\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n\n // public\n\n toggle() {\n if ($(this._element).hasClass(ClassName.IN)) {\n this.hide()\n } else {\n this.show()\n }\n }\n\n show() {\n if (this._isTransitioning ||\n $(this._element).hasClass(ClassName.IN)) {\n return\n }\n\n let actives\n let activesData\n\n if (this._parent) {\n actives = $.makeArray($(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 let 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 let dimension = this._getDimension()\n\n $(this._element)\n .removeClass(ClassName.COLLAPSE)\n .addClass(ClassName.COLLAPSING)\n\n this._element.style[dimension] = 0\n this._element.setAttribute('aria-expanded', true)\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 let complete = () => {\n $(this._element)\n .removeClass(ClassName.COLLAPSING)\n .addClass(ClassName.COLLAPSE)\n .addClass(ClassName.IN)\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 let capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)\n let 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.IN)) {\n return\n }\n\n let startEvent = $.Event(Event.HIDE)\n $(this._element).trigger(startEvent)\n if (startEvent.isDefaultPrevented()) {\n return\n }\n\n let dimension = this._getDimension()\n let offsetDimension = dimension === Dimension.WIDTH ?\n 'offsetWidth' : 'offsetHeight'\n\n this._element.style[dimension] = `${this._element[offsetDimension]}px`\n\n Util.reflow(this._element)\n\n $(this._element)\n .addClass(ClassName.COLLAPSING)\n .removeClass(ClassName.COLLAPSE)\n .removeClass(ClassName.IN)\n\n this._element.setAttribute('aria-expanded', false)\n\n if (this._triggerArray.length) {\n $(this._triggerArray)\n .addClass(ClassName.COLLAPSED)\n .attr('aria-expanded', false)\n }\n\n this.setTransitioning(true)\n\n let 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] = 0\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 let hasWidth = $(this._element).hasClass(Dimension.WIDTH)\n return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT\n }\n\n _getParent() {\n let parent = $(this._config.parent)[0]\n let 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 let isOpen = $(element).hasClass(ClassName.IN)\n element.setAttribute('aria-expanded', isOpen)\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 let selector = Util.getSelectorFromElement(element)\n return selector ? $(selector)[0] : null\n }\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let $this = $(this)\n let data = $this.data(DATA_KEY)\n let _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 event.preventDefault()\n\n let target = Collapse._getTargetFromElement(this)\n let data = $(target).data(DATA_KEY)\n let config = data ? 'toggle' : $(this).data()\n\n Collapse._jQueryInterface.call($(target), config)\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Collapse._jQueryInterface\n $.fn[NAME].Constructor = Collapse\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Collapse._jQueryInterface\n }\n\n return Collapse\n\n})(jQuery)\n\nexport default Collapse\n"]}
\ No newline at end of file +{"version":3,"sources":["../src/collapse.js"],"names":["Collapse","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","TRANSITION_DURATION","Default","toggle","parent","DefaultType","Event","SHOW","SHOWN","HIDE","HIDDEN","CLICK_DATA_API","ClassName","IN","COLLAPSE","COLLAPSING","COLLAPSED","Dimension","WIDTH","HEIGHT","Selector","ACTIVES","DATA_TOGGLE","element","config","_isTransitioning","_element","_config","_getConfig","_triggerArray","makeArray","id","_parent","_getParent","_addAriaAndCollapsedClass","hasClass","hide","show","actives","activesData","length","data","startEvent","trigger","isDefaultPrevented","_jQueryInterface","call","dimension","_getDimension","removeClass","addClass","style","setAttribute","attr","setTransitioning","complete","Util","supportsTransitionEnd","capitalizedDimension","toUpperCase","slice","scrollSize","one","TRANSITION_END","emulateTransitionEnd","offsetDimension","reflow","isTransitioning","dispose","removeData","extend","Boolean","typeCheckConfig","hasWidth","selector","find","each","i","_getTargetFromElement","triggerArray","isOpen","toggleClass","getSelectorFromElement","$this","test","undefined","Error","document","on","event","preventDefault","target","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAGA;;;;;;;AAOA,IAAMA,WAAY,UAACC,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,IAAL,IAAyBF,SAASqD,gBAAlC;AACApD,IAAEO,EAAF,CAAKN,IAAL,EAAWkG,WAAX,GAAyBpG,QAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWmG,UAAX,GAAyB,YAAY;AACnCpG,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,SAASqD,gBAAhB;AACD,GAHD;;AAKA,SAAOrD,QAAP;AAED,CAhXgB,CAgXdsG,MAhXc,CAAjB","file":"collapse.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Collapse = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'collapse'\n const VERSION = '4.0.0-alpha.4'\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 IN : 'in',\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 : '.panel > .in, .panel > .collapsing',\n DATA_TOGGLE : '[data-toggle=\"collapse\"]'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Collapse {\n\n constructor(element, config) {\n this._isTransitioning = false\n this._element = element\n this._config = this._getConfig(config)\n this._triggerArray = $.makeArray($(\n `[data-toggle=\"collapse\"][href=\"#${element.id}\"],` +\n `[data-toggle=\"collapse\"][data-target=\"#${element.id}\"]`\n ))\n\n this._parent = this._config.parent ? this._getParent() : null\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._element, this._triggerArray)\n }\n\n if (this._config.toggle) {\n this.toggle()\n }\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n\n // public\n\n toggle() {\n if ($(this._element).hasClass(ClassName.IN)) {\n this.hide()\n } else {\n this.show()\n }\n }\n\n show() {\n if (this._isTransitioning ||\n $(this._element).hasClass(ClassName.IN)) {\n return\n }\n\n let actives\n let activesData\n\n if (this._parent) {\n actives = $.makeArray($(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 let 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 let dimension = this._getDimension()\n\n $(this._element)\n .removeClass(ClassName.COLLAPSE)\n .addClass(ClassName.COLLAPSING)\n\n this._element.style[dimension] = 0\n this._element.setAttribute('aria-expanded', true)\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 let complete = () => {\n $(this._element)\n .removeClass(ClassName.COLLAPSING)\n .addClass(ClassName.COLLAPSE)\n .addClass(ClassName.IN)\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 let capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)\n let 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.IN)) {\n return\n }\n\n let startEvent = $.Event(Event.HIDE)\n $(this._element).trigger(startEvent)\n if (startEvent.isDefaultPrevented()) {\n return\n }\n\n let dimension = this._getDimension()\n let offsetDimension = dimension === Dimension.WIDTH ?\n 'offsetWidth' : 'offsetHeight'\n\n this._element.style[dimension] = `${this._element[offsetDimension]}px`\n\n Util.reflow(this._element)\n\n $(this._element)\n .addClass(ClassName.COLLAPSING)\n .removeClass(ClassName.COLLAPSE)\n .removeClass(ClassName.IN)\n\n this._element.setAttribute('aria-expanded', false)\n\n if (this._triggerArray.length) {\n $(this._triggerArray)\n .addClass(ClassName.COLLAPSED)\n .attr('aria-expanded', false)\n }\n\n this.setTransitioning(true)\n\n let 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] = 0\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 let hasWidth = $(this._element).hasClass(Dimension.WIDTH)\n return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT\n }\n\n _getParent() {\n let parent = $(this._config.parent)[0]\n let 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 let isOpen = $(element).hasClass(ClassName.IN)\n element.setAttribute('aria-expanded', isOpen)\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 let selector = Util.getSelectorFromElement(element)\n return selector ? $(selector)[0] : null\n }\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let $this = $(this)\n let data = $this.data(DATA_KEY)\n let _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 event.preventDefault()\n\n let target = Collapse._getTargetFromElement(this)\n let data = $(target).data(DATA_KEY)\n let config = data ? 'toggle' : $(this).data()\n\n Collapse._jQueryInterface.call($(target), config)\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Collapse._jQueryInterface\n $.fn[NAME].Constructor = Collapse\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Collapse._jQueryInterface\n }\n\n return Collapse\n\n})(jQuery)\n\nexport default Collapse\n"]}
\ No newline at end of file diff --git a/js/dist/dropdown.js b/js/dist/dropdown.js index d8ef1a40eb..9cad7941e2 100644 --- a/js/dist/dropdown.js +++ b/js/dist/dropdown.js @@ -1,8 +1,6 @@ -'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; }; }(); -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'); } } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** * -------------------------------------------------------------------------- @@ -11,7 +9,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * -------------------------------------------------------------------------- */ -var Dropdown = (function ($) { +var Dropdown = function ($) { /** * ------------------------------------------------------------------------ @@ -62,7 +60,7 @@ var Dropdown = (function ($) { * ------------------------------------------------------------------------ */ - var Dropdown = (function () { + var Dropdown = function () { function Dropdown(element) { _classCallCheck(this, Dropdown); @@ -71,201 +69,185 @@ var Dropdown = (function ($) { this._addEventListeners(); } - /** - * ------------------------------------------------------------------------ - * Data Api implementation - * ------------------------------------------------------------------------ - */ - // getters - _createClass(Dropdown, [{ - key: 'toggle', + // public - // public + Dropdown.prototype.toggle = function toggle() { + if (this.disabled || $(this).hasClass(ClassName.DISABLED)) { + return false; + } - value: function toggle() { - if (this.disabled || $(this).hasClass(ClassName.DISABLED)) { - return false; - } + var parent = Dropdown._getParentFromElement(this); + var isActive = $(parent).hasClass(ClassName.OPEN); - var parent = Dropdown._getParentFromElement(this); - var isActive = $(parent).hasClass(ClassName.OPEN); + Dropdown._clearMenus(); - Dropdown._clearMenus(); + if (isActive) { + return false; + } - if (isActive) { - return false; - } + if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) { - if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) { + // if mobile we use a backdrop because click events don't delegate + var dropdown = document.createElement('div'); + dropdown.className = ClassName.BACKDROP; + $(dropdown).insertBefore(this); + $(dropdown).on('click', Dropdown._clearMenus); + } - // if mobile we use a backdrop because click events don't delegate - var dropdown = document.createElement('div'); - dropdown.className = ClassName.BACKDROP; - $(dropdown).insertBefore(this); - $(dropdown).on('click', Dropdown._clearMenus); - } + var relatedTarget = { relatedTarget: this }; + var showEvent = $.Event(Event.SHOW, relatedTarget); - var relatedTarget = { relatedTarget: this }; - var showEvent = $.Event(Event.SHOW, relatedTarget); + $(parent).trigger(showEvent); - $(parent).trigger(showEvent); + if (showEvent.isDefaultPrevented()) { + return false; + } - if (showEvent.isDefaultPrevented()) { - return false; - } + this.focus(); + this.setAttribute('aria-expanded', 'true'); - this.focus(); - this.setAttribute('aria-expanded', 'true'); + $(parent).toggleClass(ClassName.OPEN); + $(parent).trigger($.Event(Event.SHOWN, relatedTarget)); - $(parent).toggleClass(ClassName.OPEN); - $(parent).trigger($.Event(Event.SHOWN, relatedTarget)); + return false; + }; - return false; - } - }, { - key: 'dispose', - value: function dispose() { - $.removeData(this._element, DATA_KEY); - $(this._element).off(EVENT_KEY); - this._element = null; - } + Dropdown.prototype.dispose = function dispose() { + $.removeData(this._element, DATA_KEY); + $(this._element).off(EVENT_KEY); + this._element = null; + }; - // private + // private - }, { - key: '_addEventListeners', - value: function _addEventListeners() { - $(this._element).on(Event.CLICK, this.toggle); - } + Dropdown.prototype._addEventListeners = function _addEventListeners() { + $(this._element).on(Event.CLICK, this.toggle); + }; - // static + // static - }], [{ - key: '_jQueryInterface', - value: function _jQueryInterface(config) { - return this.each(function () { - var data = $(this).data(DATA_KEY); + Dropdown._jQueryInterface = function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); - if (!data) { - $(this).data(DATA_KEY, data = new Dropdown(this)); - } - - if (typeof config === 'string') { - if (data[config] === undefined) { - throw new Error('No method named "' + config + '"'); - } - data[config].call(this); - } - }); - } - }, { - key: '_clearMenus', - value: function _clearMenus(event) { - if (event && event.which === RIGHT_MOUSE_BUTTON_WHICH) { - return; + if (!data) { + $(this).data(DATA_KEY, data = new Dropdown(this)); } - var backdrop = $(Selector.BACKDROP)[0]; - if (backdrop) { - backdrop.parentNode.removeChild(backdrop); + if (typeof config === 'string') { + if (data[config] === undefined) { + throw new Error('No method named "' + config + '"'); + } + data[config].call(this); } + }); + }; - var toggles = $.makeArray($(Selector.DATA_TOGGLE)); + Dropdown._clearMenus = function _clearMenus(event) { + if (event && event.which === RIGHT_MOUSE_BUTTON_WHICH) { + return; + } - for (var i = 0; i < toggles.length; i++) { - var _parent = Dropdown._getParentFromElement(toggles[i]); - var relatedTarget = { relatedTarget: toggles[i] }; + var backdrop = $(Selector.BACKDROP)[0]; + if (backdrop) { + backdrop.parentNode.removeChild(backdrop); + } - if (!$(_parent).hasClass(ClassName.OPEN)) { - continue; - } + var toggles = $.makeArray($(Selector.DATA_TOGGLE)); - if (event && event.type === 'click' && /input|textarea/i.test(event.target.tagName) && $.contains(_parent, event.target)) { - continue; - } + for (var i = 0; i < toggles.length; i++) { + var parent = Dropdown._getParentFromElement(toggles[i]); + var relatedTarget = { relatedTarget: toggles[i] }; - var hideEvent = $.Event(Event.HIDE, relatedTarget); - $(_parent).trigger(hideEvent); - if (hideEvent.isDefaultPrevented()) { - continue; - } + if (!$(parent).hasClass(ClassName.OPEN)) { + continue; + } - toggles[i].setAttribute('aria-expanded', 'false'); + if (event && event.type === 'click' && /input|textarea/i.test(event.target.tagName) && $.contains(parent, event.target)) { + continue; + } - $(_parent).removeClass(ClassName.OPEN).trigger($.Event(Event.HIDDEN, relatedTarget)); + var hideEvent = $.Event(Event.HIDE, relatedTarget); + $(parent).trigger(hideEvent); + if (hideEvent.isDefaultPrevented()) { + continue; } + + toggles[i].setAttribute('aria-expanded', 'false'); + + $(parent).removeClass(ClassName.OPEN).trigger($.Event(Event.HIDDEN, relatedTarget)); } - }, { - key: '_getParentFromElement', - value: function _getParentFromElement(element) { - var parent = undefined; - var selector = Util.getSelectorFromElement(element); - - if (selector) { - parent = $(selector)[0]; - } + }; + + Dropdown._getParentFromElement = function _getParentFromElement(element) { + var parent = void 0; + var selector = Util.getSelectorFromElement(element); - return parent || element.parentNode; + if (selector) { + parent = $(selector)[0]; } - }, { - key: '_dataApiKeydownHandler', - value: function _dataApiKeydownHandler(event) { - if (!/(38|40|27|32)/.test(event.which) || /input|textarea/i.test(event.target.tagName)) { - return; - } - event.preventDefault(); - event.stopPropagation(); + return parent || element.parentNode; + }; - if (this.disabled || $(this).hasClass(ClassName.DISABLED)) { - return; - } + Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { + if (!/(38|40|27|32)/.test(event.which) || /input|textarea/i.test(event.target.tagName)) { + return; + } - var parent = Dropdown._getParentFromElement(this); - var isActive = $(parent).hasClass(ClassName.OPEN); + event.preventDefault(); + event.stopPropagation(); - if (!isActive && event.which !== ESCAPE_KEYCODE || isActive && event.which === ESCAPE_KEYCODE) { + if (this.disabled || $(this).hasClass(ClassName.DISABLED)) { + return; + } - if (event.which === ESCAPE_KEYCODE) { - var toggle = $(parent).find(Selector.DATA_TOGGLE)[0]; - $(toggle).trigger('focus'); - } + var parent = Dropdown._getParentFromElement(this); + var isActive = $(parent).hasClass(ClassName.OPEN); - $(this).trigger('click'); - return; + if (!isActive && event.which !== ESCAPE_KEYCODE || isActive && event.which === ESCAPE_KEYCODE) { + + if (event.which === ESCAPE_KEYCODE) { + var toggle = $(parent).find(Selector.DATA_TOGGLE)[0]; + $(toggle).trigger('focus'); } - var items = $.makeArray($(Selector.VISIBLE_ITEMS)); + $(this).trigger('click'); + return; + } - items = items.filter(function (item) { - return item.offsetWidth || item.offsetHeight; - }); + var items = $.makeArray($(Selector.VISIBLE_ITEMS)); - if (!items.length) { - return; - } + items = items.filter(function (item) { + return item.offsetWidth || item.offsetHeight; + }); - var index = items.indexOf(event.target); + if (!items.length) { + return; + } - if (event.which === ARROW_UP_KEYCODE && index > 0) { - // up - index--; - } + var index = items.indexOf(event.target); - if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { - // down - index++; - } + if (event.which === ARROW_UP_KEYCODE && index > 0) { + // up + index--; + } - if (index < 0) { - index = 0; - } + if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { + // down + index++; + } - items[index].focus(); + if (index < 0) { + index = 0; } - }, { + + items[index].focus(); + }; + + _createClass(Dropdown, null, [{ key: 'VERSION', get: function get() { return VERSION; @@ -273,7 +255,13 @@ var Dropdown = (function ($) { }]); return Dropdown; - })(); + }(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ $(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_MENU, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, Dropdown.prototype.toggle).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) { e.stopPropagation(); @@ -293,5 +281,5 @@ var Dropdown = (function ($) { }; return Dropdown; -})(jQuery); +}(jQuery); //# sourceMappingURL=dropdown.js.map diff --git a/js/dist/dropdown.js.map b/js/dist/dropdown.js.map index cee14033e3..1701b6b830 100644 --- a/js/dist/dropdown.js.map +++ b/js/dist/dropdown.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/dropdown.js"],"names":[],"mappings":";;;;;;;;;;;;;AAUA,IAAM,QAAQ,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;;AASvB,MAAM,IAAI,GAAuB,UAAU,CAAA;AAC3C,MAAM,OAAO,GAAoB,eAAe,CAAA;AAChD,MAAM,QAAQ,GAAmB,aAAa,CAAA;AAC9C,MAAM,SAAS,SAAsB,QAAQ,AAAE,CAAA;AAC/C,MAAM,YAAY,GAAe,WAAW,CAAA;AAC5C,MAAM,kBAAkB,GAAS,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;AAC3C,MAAM,cAAc,GAAa,EAAE,CAAA;AACnC,MAAM,gBAAgB,GAAW,EAAE,CAAA;AACnC,MAAM,kBAAkB,GAAS,EAAE,CAAA;AACnC,MAAM,wBAAwB,GAAG,CAAC,CAAA;;AAElC,MAAM,KAAK,GAAG;AACZ,QAAI,WAAsB,SAAS,AAAE;AACrC,UAAM,aAAsB,SAAS,AAAE;AACvC,QAAI,WAAsB,SAAS,AAAE;AACrC,SAAK,YAAsB,SAAS,AAAE;AACtC,SAAK,YAAsB,SAAS,AAAE;AACtC,kBAAc,YAAa,SAAS,GAAG,YAAY,AAAE;AACrD,oBAAgB,cAAa,SAAS,GAAG,YAAY,AAAE;GACxD,CAAA;;AAED,MAAM,SAAS,GAAG;AAChB,YAAQ,EAAG,mBAAmB;AAC9B,YAAQ,EAAG,UAAU;AACrB,QAAI,EAAO,MAAM;GAClB,CAAA;;AAED,MAAM,QAAQ,GAAG;AACf,YAAQ,EAAQ,oBAAoB;AACpC,eAAW,EAAK,0BAA0B;AAC1C,cAAU,EAAM,gBAAgB;AAChC,aAAS,EAAO,eAAe;AAC/B,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------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Dropdown = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'dropdown'\n const VERSION = '4.0.0-alpha.4'\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 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\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 }\n\n const ClassName = {\n BACKDROP : 'dropdown-backdrop',\n DISABLED : 'disabled',\n OPEN : 'open'\n }\n\n const Selector = {\n BACKDROP : '.dropdown-backdrop',\n DATA_TOGGLE : '[data-toggle=\"dropdown\"]',\n FORM_CHILD : '.dropdown form',\n ROLE_MENU : '[role=\"menu\"]',\n ROLE_LISTBOX : '[role=\"listbox\"]',\n NAVBAR_NAV : '.navbar-nav',\n VISIBLE_ITEMS : '[role=\"menu\"] li:not(.disabled) a, '\n + '[role=\"listbox\"] li:not(.disabled) a'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Dropdown {\n\n constructor(element) {\n this._element = element\n\n this._addEventListeners()\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n\n // public\n\n toggle() {\n if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {\n return false\n }\n\n let parent = Dropdown._getParentFromElement(this)\n let isActive = $(parent).hasClass(ClassName.OPEN)\n\n Dropdown._clearMenus()\n\n if (isActive) {\n return false\n }\n\n if ('ontouchstart' in document.documentElement &&\n (!$(parent).closest(Selector.NAVBAR_NAV).length)) {\n\n // if mobile we use a backdrop because click events don't delegate\n let dropdown = document.createElement('div')\n dropdown.className = ClassName.BACKDROP\n $(dropdown).insertBefore(this)\n $(dropdown).on('click', Dropdown._clearMenus)\n }\n\n let relatedTarget = { relatedTarget : this }\n let showEvent = $.Event(Event.SHOW, relatedTarget)\n\n $(parent).trigger(showEvent)\n\n if (showEvent.isDefaultPrevented()) {\n return false\n }\n\n this.focus()\n this.setAttribute('aria-expanded', 'true')\n\n $(parent).toggleClass(ClassName.OPEN)\n $(parent).trigger($.Event(Event.SHOWN, relatedTarget))\n\n return false\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n $(this._element).off(EVENT_KEY)\n this._element = null\n }\n\n\n // private\n\n _addEventListeners() {\n $(this._element).on(Event.CLICK, this.toggle)\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n\n if (!data) {\n $(this).data(DATA_KEY, (data = new Dropdown(this)))\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config].call(this)\n }\n })\n }\n\n static _clearMenus(event) {\n if (event && event.which === RIGHT_MOUSE_BUTTON_WHICH) {\n return\n }\n\n let backdrop = $(Selector.BACKDROP)[0]\n if (backdrop) {\n backdrop.parentNode.removeChild(backdrop)\n }\n\n let toggles = $.makeArray($(Selector.DATA_TOGGLE))\n\n for (let i = 0; i < toggles.length; i++) {\n let parent = Dropdown._getParentFromElement(toggles[i])\n let relatedTarget = { relatedTarget : toggles[i] }\n\n if (!$(parent).hasClass(ClassName.OPEN)) {\n continue\n }\n\n if (event && event.type === 'click' &&\n (/input|textarea/i.test(event.target.tagName)) &&\n ($.contains(parent, event.target))) {\n continue\n }\n\n let hideEvent = $.Event(Event.HIDE, relatedTarget)\n $(parent).trigger(hideEvent)\n if (hideEvent.isDefaultPrevented()) {\n continue\n }\n\n toggles[i].setAttribute('aria-expanded', 'false')\n\n $(parent)\n .removeClass(ClassName.OPEN)\n .trigger($.Event(Event.HIDDEN, relatedTarget))\n }\n }\n\n static _getParentFromElement(element) {\n let parent\n let 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 (!/(38|40|27|32)/.test(event.which) ||\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 let parent = Dropdown._getParentFromElement(this)\n let isActive = $(parent).hasClass(ClassName.OPEN)\n\n if ((!isActive && event.which !== ESCAPE_KEYCODE) ||\n (isActive && event.which === ESCAPE_KEYCODE)) {\n\n if (event.which === ESCAPE_KEYCODE) {\n let toggle = $(parent).find(Selector.DATA_TOGGLE)[0]\n $(toggle).trigger('focus')\n }\n\n $(this).trigger('click')\n return\n }\n\n let items = $.makeArray($(Selector.VISIBLE_ITEMS))\n\n items = items.filter((item) => {\n return item.offsetWidth || item.offsetHeight\n })\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.ROLE_MENU, Dropdown._dataApiKeydownHandler)\n .on(Event.KEYDOWN_DATA_API, Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler)\n .on(Event.CLICK_DATA_API, Dropdown._clearMenus)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, Dropdown.prototype.toggle)\n .on(Event.CLICK_DATA_API, Selector.FORM_CHILD, (e) => {\n e.stopPropagation()\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Dropdown._jQueryInterface\n $.fn[NAME].Constructor = Dropdown\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Dropdown._jQueryInterface\n }\n\n return Dropdown\n\n})(jQuery)\n\nexport default Dropdown\n"]}
\ No newline at end of file +{"version":3,"sources":["../src/dropdown.js"],"names":["Dropdown","$","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","JQUERY_NO_CONFLICT","fn","ESCAPE_KEYCODE","ARROW_UP_KEYCODE","ARROW_DOWN_KEYCODE","RIGHT_MOUSE_BUTTON_WHICH","Event","HIDE","HIDDEN","SHOW","SHOWN","CLICK","CLICK_DATA_API","KEYDOWN_DATA_API","ClassName","BACKDROP","DISABLED","OPEN","Selector","DATA_TOGGLE","FORM_CHILD","ROLE_MENU","ROLE_LISTBOX","NAVBAR_NAV","VISIBLE_ITEMS","element","_element","_addEventListeners","toggle","disabled","hasClass","parent","_getParentFromElement","isActive","_clearMenus","document","documentElement","closest","length","dropdown","createElement","className","insertBefore","on","relatedTarget","showEvent","trigger","isDefaultPrevented","focus","setAttribute","toggleClass","dispose","removeData","off","_jQueryInterface","config","each","data","undefined","Error","call","event","which","backdrop","parentNode","removeChild","toggles","makeArray","i","type","test","target","tagName","contains","hideEvent","removeClass","selector","Util","getSelectorFromElement","_dataApiKeydownHandler","preventDefault","stopPropagation","find","items","filter","item","offsetWidth","offsetHeight","index","indexOf","prototype","e","Constructor","noConflict","jQuery"],"mappings":";;;;AAGA;;;;;;;AAOA,IAAMA,WAAY,UAACC,CAAD,EAAO;;AAGvB;;;;;;AAMA,MAAMC,OAA2B,UAAjC;AACA,MAAMC,UAA2B,eAAjC;AACA,MAAMC,WAA2B,aAAjC;AACA,MAAMC,kBAA+BD,QAArC;AACA,MAAME,eAA2B,WAAjC;AACA,MAAMC,qBAA2BN,EAAEO,EAAF,CAAKN,IAAL,CAAjC;AACA,MAAMO,iBAA2B,EAAjC,CAfuB,CAea;AACpC,MAAMC,mBAA2B,EAAjC,CAhBuB,CAgBa;AACpC,MAAMC,qBAA2B,EAAjC,CAjBuB,CAiBa;AACpC,MAAMC,2BAA2B,CAAjC,CAlBuB,CAkBY;;AAEnC,MAAMC,QAAQ;AACZC,mBAA0BT,SADd;AAEZU,uBAA4BV,SAFhB;AAGZW,mBAA0BX,SAHd;AAIZY,qBAA2BZ,SAJf;AAKZa,qBAA2Bb,SALf;AAMZc,8BAA2Bd,SAA3B,GAAuCC,YAN3B;AAOZc,kCAA6Bf,SAA7B,GAAyCC;AAP7B,GAAd;;AAUA,MAAMe,YAAY;AAChBC,cAAW,mBADK;AAEhBC,cAAW,UAFK;AAGhBC,UAAW;AAHK,GAAlB;;AAMA,MAAMC,WAAW;AACfH,cAAgB,oBADD;AAEfI,iBAAgB,0BAFD;AAGfC,gBAAgB,gBAHD;AAIfC,eAAgB,eAJD;AAKfC,kBAAgB,kBALD;AAMfC,gBAAgB,aAND;AAOfC,mBAAgB,wCACA;AARD,GAAjB;;AAYA;;;;;;AAhDuB,MAsDjB/B,QAtDiB;AAwDrB,sBAAYgC,OAAZ,EAAqB;AAAA;;AACnB,WAAKC,QAAL,GAAgBD,OAAhB;;AAEA,WAAKE,kBAAL;AACD;;AAGD;;AAOA;;AAtEqB,uBAwErBC,MAxEqB,qBAwEZ;AACP,UA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B,IAAsCoF,QAAQL,MAAM7C,MAAN,GAAe,CAAjE,EAAoE;AAAE;AACpEkD;AACD;;AAED,UAAIA,QAAQ,CAAZ,EAAe;AACbA,gBAAQ,CAAR;AACD;;AAEDL,YAAMK,KAAN,EAAaxC,KAAb;AACD,KA3PoB;;AAAA;AAAA;AAAA,0BAiEA;AACnB,eAAOpD,OAAP;AACD;AAnEoB;;AAAA;AAAA;;AAgQvB;;;;;;AAMAF,IAAEyC,QAAF,EACGQ,EADH,CACMrC,MAAMO,gBADZ,EAC8BK,SAASC,WADvC,EACqD1B,SAASsF,sBAD9D,EAEGpC,EAFH,CAEMrC,MAAMO,gBAFZ,EAE8BK,SAASG,SAFvC,EAEqD5B,SAASsF,sBAF9D,EAGGpC,EAHH,CAGMrC,MAAMO,gBAHZ,EAG8BK,SAASI,YAHvC,EAGqD7B,SAASsF,sBAH9D,EAIGpC,EAJH,CAIMrC,MAAMM,cAJZ,EAI4BnB,SAASyC,WAJrC,EAKGS,EALH,CAKMrC,MAAMM,cALZ,EAK4BM,SAASC,WALrC,EAKkD1B,SAASiG,SAAT,CAAmB9D,MALrE,EAMGe,EANH,CAMMrC,MAAMM,cANZ,EAM4BM,SAASE,UANrC,EAMiD,UAACuE,CAAD,EAAO;AACpDA,MAAEV,eAAF;AACD,GARH;;AAWA;;;;;;AAMAvF,IAAEO,EAAF,CAAKN,IAAL,IAAyBF,SAAS6D,gBAAlC;AACA5D,IAAEO,EAAF,CAAKN,IAAL,EAAWiG,WAAX,GAAyBnG,QAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWkG,UAAX,GAAyB,YAAY;AACnCnG,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,SAAS6D,gBAAhB;AACD,GAHD;;AAKA,SAAO7D,QAAP;AAED,CAhSgB,CAgSdqG,MAhSc,CAAjB","file":"dropdown.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Dropdown = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'dropdown'\n const VERSION = '4.0.0-alpha.4'\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 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\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 }\n\n const ClassName = {\n BACKDROP : 'dropdown-backdrop',\n DISABLED : 'disabled',\n OPEN : 'open'\n }\n\n const Selector = {\n BACKDROP : '.dropdown-backdrop',\n DATA_TOGGLE : '[data-toggle=\"dropdown\"]',\n FORM_CHILD : '.dropdown form',\n ROLE_MENU : '[role=\"menu\"]',\n ROLE_LISTBOX : '[role=\"listbox\"]',\n NAVBAR_NAV : '.navbar-nav',\n VISIBLE_ITEMS : '[role=\"menu\"] li:not(.disabled) a, '\n + '[role=\"listbox\"] li:not(.disabled) a'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Dropdown {\n\n constructor(element) {\n this._element = element\n\n this._addEventListeners()\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n\n // public\n\n toggle() {\n if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {\n return false\n }\n\n let parent = Dropdown._getParentFromElement(this)\n let isActive = $(parent).hasClass(ClassName.OPEN)\n\n Dropdown._clearMenus()\n\n if (isActive) {\n return false\n }\n\n if ('ontouchstart' in document.documentElement &&\n (!$(parent).closest(Selector.NAVBAR_NAV).length)) {\n\n // if mobile we use a backdrop because click events don't delegate\n let dropdown = document.createElement('div')\n dropdown.className = ClassName.BACKDROP\n $(dropdown).insertBefore(this)\n $(dropdown).on('click', Dropdown._clearMenus)\n }\n\n let relatedTarget = { relatedTarget : this }\n let showEvent = $.Event(Event.SHOW, relatedTarget)\n\n $(parent).trigger(showEvent)\n\n if (showEvent.isDefaultPrevented()) {\n return false\n }\n\n this.focus()\n this.setAttribute('aria-expanded', 'true')\n\n $(parent).toggleClass(ClassName.OPEN)\n $(parent).trigger($.Event(Event.SHOWN, relatedTarget))\n\n return false\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n $(this._element).off(EVENT_KEY)\n this._element = null\n }\n\n\n // private\n\n _addEventListeners() {\n $(this._element).on(Event.CLICK, this.toggle)\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n\n if (!data) {\n $(this).data(DATA_KEY, (data = new Dropdown(this)))\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config].call(this)\n }\n })\n }\n\n static _clearMenus(event) {\n if (event && event.which === RIGHT_MOUSE_BUTTON_WHICH) {\n return\n }\n\n let backdrop = $(Selector.BACKDROP)[0]\n if (backdrop) {\n backdrop.parentNode.removeChild(backdrop)\n }\n\n let toggles = $.makeArray($(Selector.DATA_TOGGLE))\n\n for (let i = 0; i < toggles.length; i++) {\n let parent = Dropdown._getParentFromElement(toggles[i])\n let relatedTarget = { relatedTarget : toggles[i] }\n\n if (!$(parent).hasClass(ClassName.OPEN)) {\n continue\n }\n\n if (event && event.type === 'click' &&\n (/input|textarea/i.test(event.target.tagName)) &&\n ($.contains(parent, event.target))) {\n continue\n }\n\n let hideEvent = $.Event(Event.HIDE, relatedTarget)\n $(parent).trigger(hideEvent)\n if (hideEvent.isDefaultPrevented()) {\n continue\n }\n\n toggles[i].setAttribute('aria-expanded', 'false')\n\n $(parent)\n .removeClass(ClassName.OPEN)\n .trigger($.Event(Event.HIDDEN, relatedTarget))\n }\n }\n\n static _getParentFromElement(element) {\n let parent\n let 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 (!/(38|40|27|32)/.test(event.which) ||\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 let parent = Dropdown._getParentFromElement(this)\n let isActive = $(parent).hasClass(ClassName.OPEN)\n\n if ((!isActive && event.which !== ESCAPE_KEYCODE) ||\n (isActive && event.which === ESCAPE_KEYCODE)) {\n\n if (event.which === ESCAPE_KEYCODE) {\n let toggle = $(parent).find(Selector.DATA_TOGGLE)[0]\n $(toggle).trigger('focus')\n }\n\n $(this).trigger('click')\n return\n }\n\n let items = $.makeArray($(Selector.VISIBLE_ITEMS))\n\n items = items.filter((item) => {\n return item.offsetWidth || item.offsetHeight\n })\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.ROLE_MENU, Dropdown._dataApiKeydownHandler)\n .on(Event.KEYDOWN_DATA_API, Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler)\n .on(Event.CLICK_DATA_API, Dropdown._clearMenus)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, Dropdown.prototype.toggle)\n .on(Event.CLICK_DATA_API, Selector.FORM_CHILD, (e) => {\n e.stopPropagation()\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Dropdown._jQueryInterface\n $.fn[NAME].Constructor = Dropdown\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Dropdown._jQueryInterface\n }\n\n return Dropdown\n\n})(jQuery)\n\nexport default Dropdown\n"]}
\ No newline at end of file diff --git a/js/dist/modal.js b/js/dist/modal.js index 96ad2a5677..790ce20348 100644 --- a/js/dist/modal.js +++ b/js/dist/modal.js @@ -1,8 +1,8 @@ -'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; }; })(); +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'); } } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** * -------------------------------------------------------------------------- @@ -11,7 +11,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * -------------------------------------------------------------------------- */ -var Modal = (function ($) { +var Modal = function ($) { /** * ------------------------------------------------------------------------ @@ -78,7 +78,7 @@ var Modal = (function ($) { * ------------------------------------------------------------------------ */ - var Modal = (function () { + var Modal = function () { function Modal(element, config) { _classCallCheck(this, Modal); @@ -93,382 +93,352 @@ var Modal = (function ($) { this._scrollbarWidth = 0; } - /** - * ------------------------------------------------------------------------ - * Data Api implementation - * ------------------------------------------------------------------------ - */ - // getters - _createClass(Modal, [{ - key: 'toggle', + // public - // public + Modal.prototype.toggle = function toggle(relatedTarget) { + return this._isShown ? this.hide() : this.show(relatedTarget); + }; - value: function toggle(relatedTarget) { - return this._isShown ? this.hide() : this.show(relatedTarget); - } - }, { - key: 'show', - value: function show(relatedTarget) { - var _this = this; + Modal.prototype.show = function show(relatedTarget) { + var _this = this; - var showEvent = $.Event(Event.SHOW, { - relatedTarget: relatedTarget - }); + var showEvent = $.Event(Event.SHOW, { + relatedTarget: relatedTarget + }); - $(this._element).trigger(showEvent); + $(this._element).trigger(showEvent); - if (this._isShown || showEvent.isDefaultPrevented()) { - return; - } + if (this._isShown || showEvent.isDefaultPrevented()) { + return; + } - this._isShown = true; + this._isShown = true; - this._checkScrollbar(); - this._setScrollbar(); + this._checkScrollbar(); + this._setScrollbar(); - $(document.body).addClass(ClassName.OPEN); + $(document.body).addClass(ClassName.OPEN); - this._setEscapeEvent(); - this._setResizeEvent(); + this._setEscapeEvent(); + this._setResizeEvent(); - $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, $.proxy(this.hide, this)); + $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, $.proxy(this.hide, this)); - $(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._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($.proxy(this._showElement, this, relatedTarget)); + }; - this._showBackdrop($.proxy(this._showElement, this, relatedTarget)); + Modal.prototype.hide = function hide(event) { + if (event) { + event.preventDefault(); } - }, { - key: 'hide', - value: function hide(event) { - if (event) { - event.preventDefault(); - } - var hideEvent = $.Event(Event.HIDE); + var hideEvent = $.Event(Event.HIDE); - $(this._element).trigger(hideEvent); + $(this._element).trigger(hideEvent); - if (!this._isShown || hideEvent.isDefaultPrevented()) { - return; - } + if (!this._isShown || hideEvent.isDefaultPrevented()) { + return; + } - this._isShown = false; + this._isShown = false; - this._setEscapeEvent(); - this._setResizeEvent(); + this._setEscapeEvent(); + this._setResizeEvent(); - $(document).off(Event.FOCUSIN); + $(document).off(Event.FOCUSIN); - $(this._element).removeClass(ClassName.IN); + $(this._element).removeClass(ClassName.IN); - $(this._element).off(Event.CLICK_DISMISS); - $(this._dialog).off(Event.MOUSEDOWN_DISMISS); + $(this._element).off(Event.CLICK_DISMISS); + $(this._dialog).off(Event.MOUSEDOWN_DISMISS); - if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) { + if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) { - $(this._element).one(Util.TRANSITION_END, $.proxy(this._hideModal, this)).emulateTransitionEnd(TRANSITION_DURATION); - } else { - this._hideModal(); - } - } - }, { - key: 'dispose', - value: function dispose() { - $.removeData(this._element, DATA_KEY); - - $(window).off(EVENT_KEY); - $(document).off(EVENT_KEY); - $(this._element).off(EVENT_KEY); - $(this._backdrop).off(EVENT_KEY); - - this._config = null; - this._element = null; - this._dialog = null; - this._backdrop = null; - this._isShown = null; - this._isBodyOverflowing = null; - this._ignoreBackdropClick = null; - this._originalBodyPadding = null; - this._scrollbarWidth = null; + $(this._element).one(Util.TRANSITION_END, $.proxy(this._hideModal, this)).emulateTransitionEnd(TRANSITION_DURATION); + } else { + this._hideModal(); } + }; - // private + Modal.prototype.dispose = function dispose() { + $.removeData(this._element, DATA_KEY); - }, { - key: '_getConfig', - value: function _getConfig(config) { - config = $.extend({}, Default, config); - Util.typeCheckConfig(NAME, config, DefaultType); - return config; + $(window).off(EVENT_KEY); + $(document).off(EVENT_KEY); + $(this._element).off(EVENT_KEY); + $(this._backdrop).off(EVENT_KEY); + + this._config = null; + this._element = null; + this._dialog = null; + this._backdrop = null; + this._isShown = null; + this._isBodyOverflowing = null; + this._ignoreBackdropClick = null; + this._originalBodyPadding = null; + this._scrollbarWidth = null; + }; + + // private + + Modal.prototype._getConfig = function _getConfig(config) { + config = $.extend({}, Default, config); + Util.typeCheckConfig(NAME, config, DefaultType); + return config; + }; + + Modal.prototype._showElement = function _showElement(relatedTarget) { + var _this2 = this; + + var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE); + + if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { + // don't move modals dom position + document.body.appendChild(this._element); } - }, { - key: '_showElement', - value: function _showElement(relatedTarget) { - var _this2 = this; - var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE); + this._element.style.display = 'block'; + this._element.removeAttribute('aria-hidden'); + this._element.scrollTop = 0; - if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { - // don't move modals dom position - document.body.appendChild(this._element); - } + if (transition) { + Util.reflow(this._element); + } - this._element.style.display = 'block'; - this._element.removeAttribute('aria-hidden'); - this._element.scrollTop = 0; + $(this._element).addClass(ClassName.IN); - if (transition) { - Util.reflow(this._element); - } + if (this._config.focus) { + this._enforceFocus(); + } - $(this._element).addClass(ClassName.IN); + var shownEvent = $.Event(Event.SHOWN, { + relatedTarget: relatedTarget + }); - if (this._config.focus) { - this._enforceFocus(); + var transitionComplete = function transitionComplete() { + if (_this2._config.focus) { + _this2._element.focus(); } + $(_this2._element).trigger(shownEvent); + }; - var shownEvent = $.Event(Event.SHOWN, { - relatedTarget: relatedTarget - }); + if (transition) { + $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION); + } else { + transitionComplete(); + } + }; - var transitionComplete = function transitionComplete() { - if (_this2._config.focus) { - _this2._element.focus(); - } - $(_this2._element).trigger(shownEvent); - }; + Modal.prototype._enforceFocus = function _enforceFocus() { + var _this3 = this; - if (transition) { - $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION); - } else { - transitionComplete(); + $(document).off(Event.FOCUSIN) // guard against infinite focus loop + .on(Event.FOCUSIN, function (event) { + if (document !== event.target && _this3._element !== event.target && !$(_this3._element).has(event.target).length) { + _this3._element.focus(); } - } - }, { - key: '_enforceFocus', - value: function _enforceFocus() { - var _this3 = this; - - $(document).off(Event.FOCUSIN) // guard against infinite focus loop - .on(Event.FOCUSIN, function (event) { - if (document !== event.target && _this3._element !== event.target && !$(_this3._element).has(event.target).length) { - _this3._element.focus(); + }); + }; + + Modal.prototype._setEscapeEvent = function _setEscapeEvent() { + var _this4 = this; + + if (this._isShown && this._config.keyboard) { + $(this._element).on(Event.KEYDOWN_DISMISS, function (event) { + if (event.which === ESCAPE_KEYCODE) { + _this4.hide(); } }); + } else if (!this._isShown) { + $(this._element).off(Event.KEYDOWN_DISMISS); } - }, { - key: '_setEscapeEvent', - value: function _setEscapeEvent() { - var _this4 = this; - - if (this._isShown && this._config.keyboard) { - $(this._element).on(Event.KEYDOWN_DISMISS, function (event) { - if (event.which === ESCAPE_KEYCODE) { - _this4.hide(); - } - }); - } else if (!this._isShown) { - $(this._element).off(Event.KEYDOWN_DISMISS); - } - } - }, { - key: '_setResizeEvent', - value: function _setResizeEvent() { - if (this._isShown) { - $(window).on(Event.RESIZE, $.proxy(this._handleUpdate, this)); - } else { - $(window).off(Event.RESIZE); - } - } - }, { - key: '_hideModal', - value: function _hideModal() { - var _this5 = this; - - this._element.style.display = 'none'; - this._element.setAttribute('aria-hidden', 'true'); - this._showBackdrop(function () { - $(document.body).removeClass(ClassName.OPEN); - _this5._resetAdjustments(); - _this5._resetScrollbar(); - $(_this5._element).trigger(Event.HIDDEN); - }); + }; + + Modal.prototype._setResizeEvent = function _setResizeEvent() { + if (this._isShown) { + $(window).on(Event.RESIZE, $.proxy(this._handleUpdate, this)); + } else { + $(window).off(Event.RESIZE); } - }, { - key: '_removeBackdrop', - value: function _removeBackdrop() { - if (this._backdrop) { - $(this._backdrop).remove(); - this._backdrop = null; - } + }; + + Modal.prototype._hideModal = function _hideModal() { + var _this5 = this; + + this._element.style.display = 'none'; + this._element.setAttribute('aria-hidden', 'true'); + this._showBackdrop(function () { + $(document.body).removeClass(ClassName.OPEN); + _this5._resetAdjustments(); + _this5._resetScrollbar(); + $(_this5._element).trigger(Event.HIDDEN); + }); + }; + + Modal.prototype._removeBackdrop = function _removeBackdrop() { + if (this._backdrop) { + $(this._backdrop).remove(); + this._backdrop = null; } - }, { - key: '_showBackdrop', - value: function _showBackdrop(callback) { - var _this6 = this; + }; - var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : ''; + Modal.prototype._showBackdrop = function _showBackdrop(callback) { + var _this6 = this; - if (this._isShown && this._config.backdrop) { - var doAnimate = Util.supportsTransitionEnd() && animate; + var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : ''; - this._backdrop = document.createElement('div'); - this._backdrop.className = ClassName.BACKDROP; + if (this._isShown && this._config.backdrop) { + var doAnimate = Util.supportsTransitionEnd() && animate; - if (animate) { - $(this._backdrop).addClass(animate); - } + this._backdrop = document.createElement('div'); + this._backdrop.className = ClassName.BACKDROP; - $(this._backdrop).appendTo(document.body); - - $(this._element).on(Event.CLICK_DISMISS, function (event) { - if (_this6._ignoreBackdropClick) { - _this6._ignoreBackdropClick = false; - return; - } - if (event.target !== event.currentTarget) { - return; - } - if (_this6._config.backdrop === 'static') { - _this6._element.focus(); - } else { - _this6.hide(); - } - }); - - if (doAnimate) { - Util.reflow(this._backdrop); - } + if (animate) { + $(this._backdrop).addClass(animate); + } - $(this._backdrop).addClass(ClassName.IN); + $(this._backdrop).appendTo(document.body); - if (!callback) { + $(this._element).on(Event.CLICK_DISMISS, function (event) { + if (_this6._ignoreBackdropClick) { + _this6._ignoreBackdropClick = false; return; } - - if (!doAnimate) { - callback(); + if (event.target !== event.currentTarget) { return; } - - $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION); - } else if (!this._isShown && this._backdrop) { - $(this._backdrop).removeClass(ClassName.IN); - - var callbackRemove = function callbackRemove() { - _this6._removeBackdrop(); - if (callback) { - callback(); - } - }; - - if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) { - $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION); + if (_this6._config.backdrop === 'static') { + _this6._element.focus(); } else { - callbackRemove(); + _this6.hide(); } - } else if (callback) { - callback(); - } - } + }); - // ---------------------------------------------------------------------- - // the following methods are used to handle overflowing modals - // todo (fat): these should probably be refactored out of modal.js - // ---------------------------------------------------------------------- + if (doAnimate) { + Util.reflow(this._backdrop); + } - }, { - key: '_handleUpdate', - value: function _handleUpdate() { - this._adjustDialog(); - } - }, { - key: '_adjustDialog', - value: function _adjustDialog() { - var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; + $(this._backdrop).addClass(ClassName.IN); - if (!this._isBodyOverflowing && isModalOverflowing) { - this._element.style.paddingLeft = this._scrollbarWidth + 'px'; + if (!callback) { + return; } - if (this._isBodyOverflowing && !isModalOverflowing) { - this._element.style.paddingRight = this._scrollbarWidth + 'px'; + if (!doAnimate) { + callback(); + return; } - } - }, { - key: '_resetAdjustments', - value: function _resetAdjustments() { - this._element.style.paddingLeft = ''; - this._element.style.paddingRight = ''; - } - }, { - key: '_checkScrollbar', - value: function _checkScrollbar() { - this._isBodyOverflowing = document.body.clientWidth < window.innerWidth; - this._scrollbarWidth = this._getScrollbarWidth(); - } - }, { - key: '_setScrollbar', - value: function _setScrollbar() { - var bodyPadding = parseInt($(Selector.FIXED_CONTENT).css('padding-right') || 0, 10); - this._originalBodyPadding = document.body.style.paddingRight || ''; + $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION); + } else if (!this._isShown && this._backdrop) { + $(this._backdrop).removeClass(ClassName.IN); - if (this._isBodyOverflowing) { - document.body.style.paddingRight = bodyPadding + this._scrollbarWidth + 'px'; + var callbackRemove = function callbackRemove() { + _this6._removeBackdrop(); + if (callback) { + callback(); + } + }; + + 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(); } - }, { - key: '_resetScrollbar', - value: function _resetScrollbar() { - document.body.style.paddingRight = this._originalBodyPadding; + }; + + // ---------------------------------------------------------------------- + // the following methods are used to handle overflowing modals + // todo (fat): these should probably be refactored out of modal.js + // ---------------------------------------------------------------------- + + Modal.prototype._handleUpdate = function _handleUpdate() { + this._adjustDialog(); + }; + + Modal.prototype._adjustDialog = function _adjustDialog() { + var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; + + if (!this._isBodyOverflowing && isModalOverflowing) { + this._element.style.paddingLeft = this._scrollbarWidth + 'px'; } - }, { - 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.offsetWidth - scrollDiv.clientWidth; - document.body.removeChild(scrollDiv); - return scrollbarWidth; + + if (this._isBodyOverflowing && !isModalOverflowing) { + this._element.style.paddingRight = this._scrollbarWidth + 'px'; } + }; - // static + Modal.prototype._resetAdjustments = function _resetAdjustments() { + this._element.style.paddingLeft = ''; + this._element.style.paddingRight = ''; + }; - }], [{ - 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 === 'object' && config); + Modal.prototype._checkScrollbar = function _checkScrollbar() { + this._isBodyOverflowing = document.body.clientWidth < window.innerWidth; + this._scrollbarWidth = this._getScrollbarWidth(); + }; - if (!data) { - data = new Modal(this, _config); - $(this).data(DATA_KEY, data); - } + Modal.prototype._setScrollbar = function _setScrollbar() { + var bodyPadding = parseInt($(Selector.FIXED_CONTENT).css('padding-right') || 0, 10); - if (typeof config === 'string') { - if (data[config] === undefined) { - throw new Error('No method named "' + config + '"'); - } - data[config](relatedTarget); - } else if (_config.show) { - data.show(relatedTarget); - } - }); + this._originalBodyPadding = document.body.style.paddingRight || ''; + + if (this._isBodyOverflowing) { + document.body.style.paddingRight = bodyPadding + this._scrollbarWidth + 'px'; } - }, { + }; + + Modal.prototype._resetScrollbar = function _resetScrollbar() { + document.body.style.paddingRight = this._originalBodyPadding; + }; + + 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.offsetWidth - 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); + } + + if (typeof config === 'string') { + if (data[config] === undefined) { + throw new Error('No method named "' + config + '"'); + } + data[config](relatedTarget); + } else if (_config.show) { + data.show(relatedTarget); + } + }); + }; + + _createClass(Modal, null, [{ key: 'VERSION', get: function get() { return VERSION; @@ -481,12 +451,18 @@ var Modal = (function ($) { }]); return Modal; - })(); + }(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { var _this7 = this; - var target = undefined; + var target = void 0; var selector = Util.getSelectorFromElement(this); if (selector) { @@ -529,5 +505,5 @@ var Modal = (function ($) { }; return Modal; -})(jQuery); +}(jQuery); //# sourceMappingURL=modal.js.map diff --git a/js/dist/modal.js.map b/js/dist/modal.js.map index 1d4c9cd606..e37defbaac 100644 --- a/js/dist/modal.js.map +++ b/js/dist/modal.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/modal.js"],"names":[],"mappings":";;;;;;;;;;;;;AAUA,IAAM,KAAK,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;;AASpB,MAAM,IAAI,GAA2B,OAAO,CAAA;AAC5C,MAAM,OAAO,GAAwB,eAAe,CAAA;AACpD,MAAM,QAAQ,GAAuB,UAAU,CAAA;AAC/C,MAAM,SAAS,SAA0B,QAAQ,AAAE,CAAA;AACnD,MAAM,YAAY,GAAmB,WAAW,CAAA;AAChD,MAAM,kBAAkB,GAAa,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;AAC/C,MAAM,mBAAmB,GAAY,GAAG,CAAA;AACxC,MAAM,4BAA4B,GAAG,GAAG,CAAA;AACxC,MAAM,cAAc,GAAiB,EAAE,CAAA;;AAEvC,MAAM,OAAO,GAAG;AACd,YAAQ,EAAG,IAAI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/B,WAAO,KAAK,CAAC,gBAAgB,CAAA;GAC9B,CAAA;;AAED,SAAO,KAAK,CAAA;CAEb,CAAA,CAAE,MAAM,CAAC,CAAA","file":"modal.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): 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-alpha.4'\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 IN : 'in'\n }\n\n const Selector = {\n DIALOG : '.modal-dialog',\n DATA_TOGGLE : '[data-toggle=\"modal\"]',\n DATA_DISMISS : '[data-dismiss=\"modal\"]',\n FIXED_CONTENT : '.navbar-fixed-top, .navbar-fixed-bottom, .is-fixed'\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 let 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 $.proxy(this.hide, this)\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(\n $.proxy(this._showElement, this, relatedTarget)\n )\n }\n\n hide(event) {\n if (event) {\n event.preventDefault()\n }\n\n let 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.IN)\n\n $(this._element).off(Event.CLICK_DISMISS)\n $(this._dialog).off(Event.MOUSEDOWN_DISMISS)\n\n if (Util.supportsTransitionEnd() &&\n ($(this._element).hasClass(ClassName.FADE))) {\n\n $(this._element)\n .one(Util.TRANSITION_END, $.proxy(this._hideModal, this))\n .emulateTransitionEnd(TRANSITION_DURATION)\n } else {\n this._hideModal()\n }\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n\n $(window).off(EVENT_KEY)\n $(document).off(EVENT_KEY)\n $(this._element).off(EVENT_KEY)\n $(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._originalBodyPadding = null\n this._scrollbarWidth = 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 _showElement(relatedTarget) {\n let 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.IN)\n\n if (this._config.focus) {\n this._enforceFocus()\n }\n\n let shownEvent = $.Event(Event.SHOWN, {\n relatedTarget\n })\n\n let transitionComplete = () => {\n if (this._config.focus) {\n this._element.focus()\n }\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 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, $.proxy(this._handleUpdate, this))\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._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 let animate = $(this._element).hasClass(ClassName.FADE) ?\n ClassName.FADE : ''\n\n if (this._isShown && this._config.backdrop) {\n let 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.IN)\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.IN)\n\n let 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 _handleUpdate() {\n this._adjustDialog()\n }\n\n _adjustDialog() {\n let 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 let bodyPadding = parseInt(\n $(Selector.FIXED_CONTENT).css('padding-right') || 0,\n 10\n )\n\n this._originalBodyPadding = document.body.style.paddingRight || ''\n\n if (this._isBodyOverflowing) {\n document.body.style.paddingRight =\n `${bodyPadding + this._scrollbarWidth}px`\n }\n }\n\n _resetScrollbar() {\n document.body.style.paddingRight = this._originalBodyPadding\n }\n\n _getScrollbarWidth() { // thx d.walsh\n let scrollDiv = document.createElement('div')\n scrollDiv.className = ClassName.SCROLLBAR_MEASURER\n document.body.appendChild(scrollDiv)\n let scrollbarWidth = scrollDiv.offsetWidth - 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 let _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 let selector = Util.getSelectorFromElement(this)\n\n if (selector) {\n target = $(selector)[0]\n }\n\n let config = $(target).data(DATA_KEY) ?\n 'toggle' : $.extend({}, $(target).data(), $(this).data())\n\n if (this.tagName === 'A') {\n event.preventDefault()\n }\n\n let $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","IN","Selector","DIALOG","DATA_TOGGLE","DATA_DISMISS","FIXED_CONTENT","element","config","_config","_getConfig","_element","_dialog","find","_backdrop","_isShown","_isBodyOverflowing","_ignoreBackdropClick","_originalBodyPadding","_scrollbarWidth","toggle","relatedTarget","hide","showEvent","trigger","isDefaultPrevented","_checkScrollbar","_setScrollbar","document","body","addClass","_setEscapeEvent","_setResizeEvent","on","proxy","one","event","target","is","_showBackdrop","_showElement","preventDefault","hideEvent","off","removeClass","Util","supportsTransitionEnd","hasClass","TRANSITION_END","_hideModal","emulateTransitionEnd","dispose","removeData","window","extend","typeCheckConfig","transition","parentNode","nodeType","Node","ELEMENT_NODE","appendChild","style","display","removeAttribute","scrollTop","reflow","_enforceFocus","shownEvent","transitionComplete","has","length","which","_handleUpdate","setAttribute","_resetAdjustments","_resetScrollbar","_removeBackdrop","remove","callback","animate","doAnimate","createElement","className","appendTo","currentTarget","callbackRemove","_adjustDialog","isModalOverflowing","scrollHeight","documentElement","clientHeight","paddingLeft","paddingRight","clientWidth","innerWidth","_getScrollbarWidth","bodyPadding","parseInt","css","scrollDiv","scrollbarWidth","offsetWidth","removeChild","_jQueryInterface","each","data","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,eAArC;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,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/B,CADb;;AAGA,QAAI,KAAKK,OAAL,KAAiB,GAArB,EAA0B;AACxB3E,YAAMK,cAAN;AACD;;AAED,QAAIuE,UAAUjJ,EAAEsE,MAAF,EAAUF,GAAV,CAAcnD,MAAMG,IAApB,EAA0B,UAACoC,SAAD,EAAe;AACrD,UAAIA,UAAUE,kBAAV,EAAJ,EAAoC;AAClC;AACA;AACD;;AAEDuF,cAAQ7E,GAAR,CAAYnD,MAAME,MAAlB,EAA0B,YAAM;AAC9B,YAAInB,UAAQuE,EAAR,CAAW,UAAX,CAAJ,EAA4B;AAC1B,iBAAKzD,KAAL;AACD;AACF,OAJD;AAKD,KAXa,CAAd;;AAaAf,UAAM0I,gBAAN,CAAuBS,IAAvB,CAA4BlJ,EAAEsE,MAAF,CAA5B,EAAuC7B,MAAvC,EAA+C,IAA/C;AACD,GA7BD;;AAgCA;;;;;;AAMAzC,IAAEO,EAAF,CAAKN,IAAL,IAAyBF,MAAM0I,gBAA/B;AACAzI,IAAEO,EAAF,CAAKN,IAAL,EAAWkJ,WAAX,GAAyBpJ,KAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWmJ,UAAX,GAAyB,YAAY;AACnCpJ,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,MAAM0I,gBAAb;AACD,GAHD;;AAKA,SAAO1I,KAAP;AAED,CAvgBa,CAugBXsJ,MAvgBW,CAAd","file":"modal.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): 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-alpha.4'\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 IN : 'in'\n }\n\n const Selector = {\n DIALOG : '.modal-dialog',\n DATA_TOGGLE : '[data-toggle=\"modal\"]',\n DATA_DISMISS : '[data-dismiss=\"modal\"]',\n FIXED_CONTENT : '.navbar-fixed-top, .navbar-fixed-bottom, .is-fixed'\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 let 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 $.proxy(this.hide, this)\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(\n $.proxy(this._showElement, this, relatedTarget)\n )\n }\n\n hide(event) {\n if (event) {\n event.preventDefault()\n }\n\n let 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.IN)\n\n $(this._element).off(Event.CLICK_DISMISS)\n $(this._dialog).off(Event.MOUSEDOWN_DISMISS)\n\n if (Util.supportsTransitionEnd() &&\n ($(this._element).hasClass(ClassName.FADE))) {\n\n $(this._element)\n .one(Util.TRANSITION_END, $.proxy(this._hideModal, this))\n .emulateTransitionEnd(TRANSITION_DURATION)\n } else {\n this._hideModal()\n }\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n\n $(window).off(EVENT_KEY)\n $(document).off(EVENT_KEY)\n $(this._element).off(EVENT_KEY)\n $(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._originalBodyPadding = null\n this._scrollbarWidth = 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 _showElement(relatedTarget) {\n let 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.IN)\n\n if (this._config.focus) {\n this._enforceFocus()\n }\n\n let shownEvent = $.Event(Event.SHOWN, {\n relatedTarget\n })\n\n let transitionComplete = () => {\n if (this._config.focus) {\n this._element.focus()\n }\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 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, $.proxy(this._handleUpdate, this))\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._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 let animate = $(this._element).hasClass(ClassName.FADE) ?\n ClassName.FADE : ''\n\n if (this._isShown && this._config.backdrop) {\n let 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.IN)\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.IN)\n\n let 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 _handleUpdate() {\n this._adjustDialog()\n }\n\n _adjustDialog() {\n let 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 let bodyPadding = parseInt(\n $(Selector.FIXED_CONTENT).css('padding-right') || 0,\n 10\n )\n\n this._originalBodyPadding = document.body.style.paddingRight || ''\n\n if (this._isBodyOverflowing) {\n document.body.style.paddingRight =\n `${bodyPadding + this._scrollbarWidth}px`\n }\n }\n\n _resetScrollbar() {\n document.body.style.paddingRight = this._originalBodyPadding\n }\n\n _getScrollbarWidth() { // thx d.walsh\n let scrollDiv = document.createElement('div')\n scrollDiv.className = ClassName.SCROLLBAR_MEASURER\n document.body.appendChild(scrollDiv)\n let scrollbarWidth = scrollDiv.offsetWidth - 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 let _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 let selector = Util.getSelectorFromElement(this)\n\n if (selector) {\n target = $(selector)[0]\n }\n\n let config = $(target).data(DATA_KEY) ?\n 'toggle' : $.extend({}, $(target).data(), $(this).data())\n\n if (this.tagName === 'A') {\n event.preventDefault()\n }\n\n let $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 f9d60ca341..b29b612a07 100644 --- a/js/dist/popover.js +++ b/js/dist/popover.js @@ -1,12 +1,12 @@ -'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; }; })(); +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; }; }(); -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** * -------------------------------------------------------------------------- @@ -15,7 +15,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== 'function' * -------------------------------------------------------------------------- */ -var Popover = (function ($) { +var Popover = function ($) { /** * ------------------------------------------------------------------------ @@ -70,85 +70,72 @@ var Popover = (function ($) { * ------------------------------------------------------------------------ */ - var Popover = (function (_Tooltip) { + var Popover = function (_Tooltip) { _inherits(Popover, _Tooltip); function Popover() { _classCallCheck(this, Popover); - _get(Object.getPrototypeOf(Popover.prototype), 'constructor', this).apply(this, arguments); + return _possibleConstructorReturn(this, _Tooltip.apply(this, arguments)); } - /** - * ------------------------------------------------------------------------ - * jQuery - * ------------------------------------------------------------------------ - */ + // overrides - _createClass(Popover, [{ - key: 'isWithContent', + Popover.prototype.isWithContent = function isWithContent() { + return this.getTitle() || this._getContent(); + }; - // overrides + Popover.prototype.getTipElement = function getTipElement() { + return this.tip = this.tip || $(this.config.template)[0]; + }; - value: function isWithContent() { - return this.getTitle() || this._getContent(); - } - }, { - key: 'getTipElement', - value: function getTipElement() { - return this.tip = this.tip || $(this.config.template)[0]; - } - }, { - key: 'setContent', - value: function setContent() { - var $tip = $(this.getTipElement()); + Popover.prototype.setContent = function setContent() { + var $tip = $(this.getTipElement()); - // 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()); + // 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()); - $tip.removeClass(ClassName.FADE).removeClass(ClassName.IN); + $tip.removeClass(ClassName.FADE).removeClass(ClassName.IN); - this.cleanupTether(); - } + this.cleanupTether(); + }; - // private + // private - }, { - 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); - } + 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); + }; - // static + // static - }], [{ - key: '_jQueryInterface', - value: function _jQueryInterface(config) { - return this.each(function () { - var data = $(this).data(DATA_KEY); - var _config = typeof config === 'object' ? config : null; + 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; - if (!data && /destroy|hide/.test(config)) { - return; - } + if (!data && /destroy|hide/.test(config)) { + return; + } - if (!data) { - data = new Popover(this, _config); - $(this).data(DATA_KEY, data); - } + if (!data) { + data = new Popover(this, _config); + $(this).data(DATA_KEY, data); + } - if (typeof config === 'string') { - if (data[config] === undefined) { - throw new Error('No method named "' + config + '"'); - } - data[config](); + if (typeof config === 'string') { + if (data[config] === undefined) { + throw new Error('No method named "' + config + '"'); } - }); - } - }, { + data[config](); + } + }); + }; + + _createClass(Popover, null, [{ key: 'VERSION', + // getters get: function get() { @@ -187,7 +174,13 @@ var Popover = (function ($) { }]); return Popover; - })(Tooltip); + }(Tooltip); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ $.fn[NAME] = Popover._jQueryInterface; $.fn[NAME].Constructor = Popover; @@ -197,5 +190,5 @@ var Popover = (function ($) { }; return Popover; -})(jQuery); +}(jQuery); //# sourceMappingURL=popover.js.map diff --git a/js/dist/popover.js.map b/js/dist/popover.js.map index e5839422b5..a3a9151936 100644 --- a/js/dist/popover.js.map +++ b/js/dist/popover.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/popover.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAUA,IAAM,OAAO,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;;AAStB,MAAM,IAAI,GAAkB,SAAS,CAAA;AACrC,MAAM,OAAO,GAAe,eAAe,CAAA;AAC3C,MAAM,QAAQ,GAAc,YAAY,CAAA;AACxC,MAAM,SAAS,SAAiB,QAAQ,AAAE,CAAA;AAC1C,MAAM,kBAAkB,GAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;;AAEtC,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,OAAO,EAAE;AAC5C,aAAS,EAAG,OAAO;AACnB,WAAO,EAAK,OAAO;AACnB,WAAO,EAAK,EAAE;AACd,YAAQ,E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M,CAAC,KAAK,SAAS,EAAE;AAC9B,oBAAM,IAAI,KAAK,uBAAqB,MAAM,OAAI,CAAA;aAC/C;AACD,gBAAI,CAAC,MAAM,CAAC,EAAE,CAAA;WACf;SACF,CAAC,CAAA;OACH;;;;;;WAtFiB,eAAG;AACnB,eAAO,OAAO,CAAA;OACf;;;WAEiB,eAAG;AACnB,eAAO,OAAO,CAAA;OACf;;;WAEc,eAAG;AAChB,eAAO,IAAI,CAAA;OACZ;;;WAEkB,eAAG;AACpB,eAAO,QAAQ,CAAA;OAChB;;;WAEe,eAAG;AACjB,eAAO,KAAK,CAAA;OACb;;;WAEmB,eAAG;AACrB,eAAO,SAAS,CAAA;OACjB;;;WAEqB,eAAG;AACvB,eAAO,WAAW,CAAA;OACnB;;;WA/BG,OAAO;KAAS,OAAO;;AAqG7B,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAe,OAAO,CAAC,gBAAgB,CAAA;AACjD,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,GAAG,OAAO,CAAA;AAChC,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,GAAI,YAAY;AACnC,KAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAA;AAC/B,WAAO,OAAO,CAAC,gBAAgB,CAAA;GAChC,CAAA;;AAED,SAAO,OAAO,CAAA;CAEf,CAAA,CAAE,MAAM,CAAC,CAAA","file":"popover.js","sourcesContent":["import Tooltip from './tooltip'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Popover = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'popover'\n const VERSION = '4.0.0-alpha.4'\n const DATA_KEY = 'bs.popover'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Default = $.extend({}, Tooltip.Default, {\n placement : 'right',\n trigger : 'click',\n content : '',\n template : '<div class=\"popover\" role=\"tooltip\">'\n + '<div class=\"popover-arrow\"></div>'\n + '<h3 class=\"popover-title\"></h3>'\n + '<div class=\"popover-content\"></div></div>'\n })\n\n const DefaultType = $.extend({}, Tooltip.DefaultType, {\n content : '(string|element|function)'\n })\n\n const ClassName = {\n FADE : 'fade',\n IN : 'in'\n }\n\n const Selector = {\n TITLE : '.popover-title',\n CONTENT : '.popover-content',\n ARROW : '.popover-arrow'\n }\n\n const Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n INSERTED : `inserted${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n FOCUSOUT : `focusout${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Popover extends Tooltip {\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get DATA_KEY() {\n return DATA_KEY\n }\n\n static get Event() {\n return Event\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n\n // overrides\n\n isWithContent() {\n return this.getTitle() || this._getContent()\n }\n\n getTipElement() {\n return (this.tip = this.tip || $(this.config.template)[0])\n }\n\n setContent() {\n let $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\n .removeClass(ClassName.FADE)\n .removeClass(ClassName.IN)\n\n this.cleanupTether()\n }\n\n // private\n\n _getContent() {\n return this.element.getAttribute('data-content')\n || (typeof this.config.content === 'function' ?\n this.config.content.call(this.element) :\n this.config.content)\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n let _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","Default","extend","Tooltip","placement","trigger","content","template","DefaultType","ClassName","FADE","IN","Selector","TITLE","CONTENT","ARROW","Event","HIDE","HIDDEN","SHOW","SHOWN","INSERTED","CLICK","FOCUSIN","FOCUSOUT","MOUSEENTER","MOUSELEAVE","isWithContent","getTitle","_getContent","getTipElement","tip","config","setContent","$tip","setElementContent","find","removeClass","cleanupTether","element","getAttribute","call","_jQueryInterface","each","data","_config","test","undefined","Error","Constructor","noConflict","jQuery"],"mappings":";;;;;;;;;;AAGA;;;;;;;AAOA,IAAMA,UAAW,UAACC,CAAD,EAAO;;AAGtB;;;;;;AAMA,MAAMC,OAAsB,SAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,YAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,qBAAsBL,EAAEM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ACDY,eAAKZ,MAAL;AACD;AACF,OAnBM,CAAP;AAoBD,KAvJmB;;AAAA;AAAA;;;AA+DpB;;AA/DoB,0BAiEC;AACnB,eAAOpC,OAAP;AACD;AAnEmB;AAAA;AAAA,0BAqEC;AACnB,eAAOK,OAAP;AACD;AAvEmB;AAAA;AAAA,0BAyEF;AAChB,eAAON,IAAP;AACD;AA3EmB;AAAA;AAAA,0BA6EE;AACpB,eAAOE,QAAP;AACD;AA/EmB;AAAA;AAAA,0BAiFD;AACjB,eAAOmB,KAAP;AACD;AAnFmB;AAAA;AAAA,0BAqFG;AACrB,eAAOlB,SAAP;AACD;AAvFmB;AAAA;AAAA,0BAyFK;AACvB,eAAOU,WAAP;AACD;AA3FmB;;AAAA;AAAA,IA4DAL,OA5DA;;AA2JtB;;;;;;AAMAT,IAAEM,EAAF,CAAKL,IAAL,IAAyBF,QAAQiD,gBAAjC;AACAhD,IAAEM,EAAF,CAAKL,IAAL,EAAWsD,WAAX,GAAyBxD,OAAzB;AACAC,IAAEM,EAAF,CAAKL,IAAL,EAAWuD,UAAX,GAAyB,YAAY;AACnCxD,MAAEM,EAAF,CAAKL,IAAL,IAAaI,kBAAb;AACA,WAAON,QAAQiD,gBAAf;AACD,GAHD;;AAKA,SAAOjD,OAAP;AAED,CA1Ke,CA0Kb0D,MA1Ka,CAAhB","file":"popover.js","sourcesContent":["import Tooltip from './tooltip'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Popover = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'popover'\n const VERSION = '4.0.0-alpha.4'\n const DATA_KEY = 'bs.popover'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n\n const Default = $.extend({}, Tooltip.Default, {\n placement : 'right',\n trigger : 'click',\n content : '',\n template : '<div class=\"popover\" role=\"tooltip\">'\n + '<div class=\"popover-arrow\"></div>'\n + '<h3 class=\"popover-title\"></h3>'\n + '<div class=\"popover-content\"></div></div>'\n })\n\n const DefaultType = $.extend({}, Tooltip.DefaultType, {\n content : '(string|element|function)'\n })\n\n const ClassName = {\n FADE : 'fade',\n IN : 'in'\n }\n\n const Selector = {\n TITLE : '.popover-title',\n CONTENT : '.popover-content',\n ARROW : '.popover-arrow'\n }\n\n const Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n INSERTED : `inserted${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n FOCUSOUT : `focusout${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Popover extends Tooltip {\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get DATA_KEY() {\n return DATA_KEY\n }\n\n static get Event() {\n return Event\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n\n // overrides\n\n isWithContent() {\n return this.getTitle() || this._getContent()\n }\n\n getTipElement() {\n return (this.tip = this.tip || $(this.config.template)[0])\n }\n\n setContent() {\n let $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\n .removeClass(ClassName.FADE)\n .removeClass(ClassName.IN)\n\n this.cleanupTether()\n }\n\n // private\n\n _getContent() {\n return this.element.getAttribute('data-content')\n || (typeof this.config.content === 'function' ?\n this.config.content.call(this.element) :\n this.config.content)\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n let _config = typeof config === 'object' ? config : null\n\n if (!data && /destroy|hide/.test(config)) {\n return\n }\n\n if (!data) {\n data = new Popover(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Popover._jQueryInterface\n $.fn[NAME].Constructor = Popover\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Popover._jQueryInterface\n }\n\n return Popover\n\n})(jQuery)\n\nexport default Popover\n"]}
\ No newline at end of file diff --git a/js/dist/scrollspy.js b/js/dist/scrollspy.js index 01978a9fc1..a41ef2267f 100644 --- a/js/dist/scrollspy.js +++ b/js/dist/scrollspy.js @@ -1,8 +1,8 @@ -'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; }; })(); +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'); } } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** * -------------------------------------------------------------------------- @@ -11,7 +11,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * -------------------------------------------------------------------------- */ -var ScrollSpy = (function ($) { +var ScrollSpy = function ($) { /** * ------------------------------------------------------------------------ @@ -75,7 +75,7 @@ var ScrollSpy = (function ($) { * ------------------------------------------------------------------------ */ - var ScrollSpy = (function () { + var ScrollSpy = function () { function ScrollSpy(element, config) { _classCallCheck(this, ScrollSpy); @@ -94,192 +94,174 @@ var ScrollSpy = (function ($) { this._process(); } - /** - * ------------------------------------------------------------------------ - * Data Api implementation - * ------------------------------------------------------------------------ - */ - // getters - _createClass(ScrollSpy, [{ - key: 'refresh', + // public - // public + ScrollSpy.prototype.refresh = function refresh() { + var _this = this; - value: function refresh() { - var _this = this; + var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET; - var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET; + var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; - var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; + var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0; - var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0; + this._offsets = []; + this._targets = []; - this._offsets = []; - this._targets = []; + this._scrollHeight = this._getScrollHeight(); - this._scrollHeight = this._getScrollHeight(); + var targets = $.makeArray($(this._selector)); - var targets = $.makeArray($(this._selector)); + targets.map(function (element) { + var target = void 0; + var targetSelector = Util.getSelectorFromElement(element); - targets.map(function (element) { - var target = undefined; - var targetSelector = Util.getSelectorFromElement(element); + if (targetSelector) { + target = $(targetSelector)[0]; + } - if (targetSelector) { - target = $(targetSelector)[0]; - } + if (target && (target.offsetWidth || target.offsetHeight)) { + // 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) { + _this._offsets.push(item[0]); + _this._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; + }; - if (target && (target.offsetWidth || target.offsetHeight)) { - // 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) { - _this._offsets.push(item[0]); - _this._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; - } + // private - // private + ScrollSpy.prototype._getConfig = function _getConfig(config) { + config = $.extend({}, Default, config); - }, { - 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; + 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; + } - Util.typeCheckConfig(NAME, config, DefaultType); + Util.typeCheckConfig(NAME, config, DefaultType); - return config; - } - }, { - key: '_getScrollTop', - value: function _getScrollTop() { - return this._scrollElement === window ? this._scrollElement.scrollY : this._scrollElement.scrollTop; - } - }, { - key: '_getScrollHeight', - value: function _getScrollHeight() { - return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); + return config; + }; + + ScrollSpy.prototype._getScrollTop = function _getScrollTop() { + return this._scrollElement === window ? this._scrollElement.scrollY : this._scrollElement.scrollTop; + }; + + ScrollSpy.prototype._getScrollHeight = function _getScrollHeight() { + return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); + }; + + ScrollSpy.prototype._process = function _process() { + var scrollTop = this._getScrollTop() + this._config.offset; + var scrollHeight = this._getScrollHeight(); + var maxScroll = this._config.offset + scrollHeight - this._scrollElement.offsetHeight; + + if (this._scrollHeight !== scrollHeight) { + this.refresh(); } - }, { - key: '_process', - value: function _process() { - var scrollTop = this._getScrollTop() + this._config.offset; - var scrollHeight = this._getScrollHeight(); - var maxScroll = this._config.offset + scrollHeight - this._scrollElement.offsetHeight; - - if (this._scrollHeight !== scrollHeight) { - this.refresh(); - } - if (scrollTop >= maxScroll) { - var target = this._targets[this._targets.length - 1]; + if (scrollTop >= maxScroll) { + var target = this._targets[this._targets.length - 1]; - if (this._activeTarget !== target) { - this._activate(target); - } + if (this._activeTarget !== target) { + this._activate(target); } + } - if (this._activeTarget && scrollTop < this._offsets[0]) { - this._activeTarget = null; - this._clear(); - return; - } + if (this._activeTarget && scrollTop < this._offsets[0]) { + this._activeTarget = null; + this._clear(); + return; + } - 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]); + 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 (isActiveTarget) { - this._activate(this._targets[i]); - } + if (isActiveTarget) { + this._activate(this._targets[i]); } } - }, { - key: '_activate', - value: function _activate(target) { - this._activeTarget = target; + }; - this._clear(); + ScrollSpy.prototype._activate = function _activate(target) { + this._activeTarget = target; - var queries = this._selector.split(','); - queries = queries.map(function (selector) { - return selector + '[data-target="' + target + '"],' + (selector + '[href="' + target + '"]'); - }); + this._clear(); - var $link = $(queries.join(',')); + var queries = this._selector.split(','); + queries = queries.map(function (selector) { + return selector + '[data-target="' + target + '"],' + (selector + '[href="' + target + '"]'); + }); - if ($link.hasClass(ClassName.DROPDOWN_ITEM)) { - $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE); - $link.addClass(ClassName.ACTIVE); - } else { - // todo (fat) this is kinda sus... - // recursively add actives to tested nav-links - $link.parents(Selector.LI).find(Selector.NAV_LINKS).addClass(ClassName.ACTIVE); - } + var $link = $(queries.join(',')); - $(this._scrollElement).trigger(Event.ACTIVATE, { - relatedTarget: target - }); - } - }, { - key: '_clear', - value: function _clear() { - $(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE); + if ($link.hasClass(ClassName.DROPDOWN_ITEM)) { + $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE); + $link.addClass(ClassName.ACTIVE); + } else { + // todo (fat) this is kinda sus... + // recursively add actives to tested nav-links + $link.parents(Selector.LI).find(Selector.NAV_LINKS).addClass(ClassName.ACTIVE); } - // static + $(this._scrollElement).trigger(Event.ACTIVATE, { + relatedTarget: target + }); + }; - }], [{ - key: '_jQueryInterface', - value: function _jQueryInterface(config) { - return this.each(function () { - var data = $(this).data(DATA_KEY); - var _config = typeof config === 'object' && config || null; + ScrollSpy.prototype._clear = function _clear() { + $(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE); + }; - if (!data) { - data = new ScrollSpy(this, _config); - $(this).data(DATA_KEY, data); - } + // static - if (typeof config === 'string') { - if (data[config] === undefined) { - throw new Error('No method named "' + config + '"'); - } - data[config](); + 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 || null; + + if (!data) { + data = new ScrollSpy(this, _config); + $(this).data(DATA_KEY, data); + } + + if (typeof config === 'string') { + if (data[config] === undefined) { + throw new Error('No method named "' + config + '"'); } - }); - } - }, { + data[config](); + } + }); + }; + + _createClass(ScrollSpy, null, [{ key: 'VERSION', get: function get() { return VERSION; @@ -292,7 +274,13 @@ var ScrollSpy = (function ($) { }]); return ScrollSpy; - })(); + }(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ $(window).on(Event.LOAD_DATA_API, function () { var scrollSpys = $.makeArray($(Selector.DATA_SPY)); @@ -317,5 +305,5 @@ var ScrollSpy = (function ($) { }; return ScrollSpy; -})(jQuery); +}(jQuery); //# sourceMappingURL=scrollspy.js.map diff --git a/js/dist/scrollspy.js.map b/js/dist/scrollspy.js.map index 4dce4fcc3d..906c90f934 100644 --- a/js/dist/scrollspy.js.map +++ b/js/dist/scrollspy.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/scrollspy.js"],"names":[],"mappings":";;;;;;;;;;;;;AAUA,IAAM,SAAS,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;;AASxB,MAAM,IAAI,GAAiB,WAAW,CAAA;AACtC,MAAM,OAAO,GAAc,eAAe,CAAA;AAC1C,MAAM,QAAQ,GAAa,cAAc,CAAA;AACzC,MAAM,SAAS,SAAgB,QAAQ,AAAE,CAAA;AACzC,MAAM,YAAY,GAAS,WAAW,CAAA;AACtC,MAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;;AAErC,MAAM,OAAO,GAAG;AACd,UAAM,EAAG,EAAE;AACX,UAAM,EAAG,MAAM;AACf,UAAM,EAAG,EAAE;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AAO,SAAS,CAAC,gBAAgB,CAAA;GAClC,CAAA;;AAED,SAAO,SAAS,CAAA;CAEjB,CAAA,CAAE,MAAM,CAAC,CAAA","file":"scrollspy.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): 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-alpha.4'\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 NAV_LINK : 'nav-link',\n NAV : 'nav',\n ACTIVE : 'active'\n }\n\n const Selector = {\n DATA_SPY : '[data-spy=\"scroll\"]',\n ACTIVE : '.active',\n LIST_ITEM : '.list-item',\n LI : 'li',\n LI_DROPDOWN : 'li.dropdown',\n NAV_LINKS : '.nav-link',\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.DROPDOWN_ITEMS}`\n this._offsets = []\n this._targets = []\n this._activeTarget = null\n this._scrollHeight = 0\n\n $(this._scrollElement).on(Event.SCROLL, $.proxy(this._process, this))\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 let autoMethod = this._scrollElement !== this._scrollElement.window ?\n OffsetMethod.POSITION : OffsetMethod.OFFSET\n\n let offsetMethod = this._config.method === 'auto' ?\n autoMethod : this._config.method\n\n let offsetBase = offsetMethod === OffsetMethod.POSITION ?\n this._getScrollTop() : 0\n\n this._offsets = []\n this._targets = []\n\n this._scrollHeight = this._getScrollHeight()\n\n let targets = $.makeArray($(this._selector))\n\n targets\n .map((element) => {\n let target\n let targetSelector = Util.getSelectorFromElement(element)\n\n if (targetSelector) {\n target = $(targetSelector)[0]\n }\n\n if (target && (target.offsetWidth || target.offsetHeight)) {\n // todo (fat): remove sketch reliance on jQuery position/offset\n return [\n $(target)[offsetMethod]().top + offsetBase,\n targetSelector\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.scrollY : 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 _process() {\n let scrollTop = this._getScrollTop() + this._config.offset\n let scrollHeight = this._getScrollHeight()\n let maxScroll = this._config.offset\n + scrollHeight\n - this._scrollElement.offsetHeight\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh()\n }\n\n if (scrollTop >= maxScroll) {\n let target = this._targets[this._targets.length - 1]\n\n if (this._activeTarget !== target) {\n this._activate(target)\n }\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0]) {\n this._activeTarget = null\n this._clear()\n return\n }\n\n for (let i = this._offsets.length; i--;) {\n let 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 let $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 // todo (fat) this is kinda sus...\n // recursively add actives to tested nav-links\n $link.parents(Selector.LI).find(Selector.NAV_LINKS).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 let _config = typeof config === 'object' && config || null\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 let scrollSpys = $.makeArray($(Selector.DATA_SPY))\n\n for (let i = scrollSpys.length; i--;) {\n let $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","NAV_LINK","NAV","ACTIVE","Selector","DATA_SPY","LIST_ITEM","LI","LI_DROPDOWN","NAV_LINKS","DROPDOWN","DROPDOWN_ITEMS","DROPDOWN_TOGGLE","OffsetMethod","OFFSET","POSITION","element","config","_element","_scrollElement","tagName","window","_config","_getConfig","_selector","_offsets","_targets","_activeTarget","_scrollHeight","on","proxy","_process","refresh","autoMethod","offsetMethod","offsetBase","_getScrollTop","_getScrollHeight","targets","makeArray","map","targetSelector","Util","getSelectorFromElement","offsetWidth","offsetHeight","top","filter","item","sort","a","b","forEach","push","dispose","removeData","off","extend","id","attr","getUID","typeCheckConfig","scrollY","scrollTop","scrollHeight","Math","max","document","body","documentElement","maxScroll","length","_activate","_clear","i","isActiveTarget","undefined","queries","split","selector","$link","join","hasClass","closest","find","addClass","parents","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;AACA,MAAMC,UAAqB,eAA3B;AACA,MAAMC,WAAqB,cAA3B;AACA,MAAMC,kBAAyBD,QAA/B;AACA,MAAME,eAAqB,WAA3B;AACA,MAAMC,qBAAqBN,EAAEO,EAAF,CAAKN,IAAL,CAA3B;;AAEA,MAAMO,UAAU;AACdC,YAAS,EADK;AAEdC,YAAS,MAFK;AAGdC,YAAS;AAHK,GAAhB;;AAMA,MAAMC,cAAc;AAClBH,YAAS,QADS;AAElBC,YAAS,QAFS;AAGlBC,YAAS;AAHS,GAApB;;AAMA,MAAME,QAAQ;AACZC,2BAA2BV,SADf;AAEZW,uBAAyBX,SAFb;AAGZY,4BAAuBZ,SAAvB,GAAmCC;AAHvB,GAAd;;AAMA,MAAMY,YAAY;AAChBC,mBAAgB,eADA;AAEhBC,mBAAgB,eAFA;AAGhBC,cAAgB,UAHA;AAIhBC,SAAgB,KAJA;AAKhBC,YAAgB;AALA,GAAlB;;AAQA,MAAMC,WAAW;AACfC,cAAkB,qBADH;AAEfF,YAAkB,SAFH;AAGfG,eAAkB,YAHH;AAIfC,QAAkB,IAJH;AAKfC,iBAAkB,aALH;AAMfC,eAAkB,WANH;AAOfC,cAAkB,WAPH;AAQfC,oBAAkB,gBARH;AASfC,qBAAkB;AATH,GAAjB;;AAYA,MAAMC,eAAe;AACnBC,YAAW,QADQ;AAEnBC,cAAW;AAFQ,GAArB;;AAMA;;;;;;AA5DwB,MAkElBnC,SAlEkB;AAoEtB,uBAAYoC,OAAZ,EAAqBC,MAArB,EAA6B;AAAA;;AAC3B,WAAKC,QA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AAA;AAAA,0BAwFD;AACnB,eAAOlC,OAAP;AACD;AA1FqB;AAAA;AAAA,0BA4FD;AACnB,eAAOM,OAAP;AACD;AA9FqB;;AAAA;AAAA;;AA0RxB;;;;;;AAMAR,IAAEwC,MAAF,EAAUQ,EAAV,CAAanC,MAAMG,aAAnB,EAAkC,YAAM;AACtC,QAAIiG,aAAajH,EAAE0D,SAAF,CAAY1D,EAAEuB,SAASC,QAAX,CAAZ,CAAjB;;AAEA,SAAK,IAAIqE,IAAIoB,WAAWvB,MAAxB,EAAgCG,GAAhC,GAAsC;AACpC,UAAIqB,OAAOlH,EAAEiH,WAAWpB,CAAX,CAAF,CAAX;AACA9F,gBAAU8G,gBAAV,CAA2BM,IAA3B,CAAgCD,IAAhC,EAAsCA,KAAKH,IAAL,EAAtC;AACD;AACF,GAPD;;AAUA;;;;;;AAMA/G,IAAEO,EAAF,CAAKN,IAAL,IAAyBF,UAAU8G,gBAAnC;AACA7G,IAAEO,EAAF,CAAKN,IAAL,EAAWmH,WAAX,GAAyBrH,SAAzB;AACAC,IAAEO,EAAF,CAAKN,IAAL,EAAWoH,UAAX,GAAyB,YAAY;AACnCrH,MAAEO,EAAF,CAAKN,IAAL,IAAaK,kBAAb;AACA,WAAOP,UAAU8G,gBAAjB;AACD,GAHD;;AAKA,SAAO9G,SAAP;AAED,CAzTiB,CAyTfuH,MAzTe,CAAlB","file":"scrollspy.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): 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-alpha.4'\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 NAV_LINK : 'nav-link',\n NAV : 'nav',\n ACTIVE : 'active'\n }\n\n const Selector = {\n DATA_SPY : '[data-spy=\"scroll\"]',\n ACTIVE : '.active',\n LIST_ITEM : '.list-item',\n LI : 'li',\n LI_DROPDOWN : 'li.dropdown',\n NAV_LINKS : '.nav-link',\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.DROPDOWN_ITEMS}`\n this._offsets = []\n this._targets = []\n this._activeTarget = null\n this._scrollHeight = 0\n\n $(this._scrollElement).on(Event.SCROLL, $.proxy(this._process, this))\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 let autoMethod = this._scrollElement !== this._scrollElement.window ?\n OffsetMethod.POSITION : OffsetMethod.OFFSET\n\n let offsetMethod = this._config.method === 'auto' ?\n autoMethod : this._config.method\n\n let offsetBase = offsetMethod === OffsetMethod.POSITION ?\n this._getScrollTop() : 0\n\n this._offsets = []\n this._targets = []\n\n this._scrollHeight = this._getScrollHeight()\n\n let targets = $.makeArray($(this._selector))\n\n targets\n .map((element) => {\n let target\n let targetSelector = Util.getSelectorFromElement(element)\n\n if (targetSelector) {\n target = $(targetSelector)[0]\n }\n\n if (target && (target.offsetWidth || target.offsetHeight)) {\n // todo (fat): remove sketch reliance on jQuery position/offset\n return [\n $(target)[offsetMethod]().top + offsetBase,\n targetSelector\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.scrollY : 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 _process() {\n let scrollTop = this._getScrollTop() + this._config.offset\n let scrollHeight = this._getScrollHeight()\n let maxScroll = this._config.offset\n + scrollHeight\n - this._scrollElement.offsetHeight\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh()\n }\n\n if (scrollTop >= maxScroll) {\n let target = this._targets[this._targets.length - 1]\n\n if (this._activeTarget !== target) {\n this._activate(target)\n }\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0]) {\n this._activeTarget = null\n this._clear()\n return\n }\n\n for (let i = this._offsets.length; i--;) {\n let 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 let $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 // todo (fat) this is kinda sus...\n // recursively add actives to tested nav-links\n $link.parents(Selector.LI).find(Selector.NAV_LINKS).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 let _config = typeof config === 'object' && config || null\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 let scrollSpys = $.makeArray($(Selector.DATA_SPY))\n\n for (let i = scrollSpys.length; i--;) {\n let $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 e2e6116c1e..6bbafb58b4 100644 --- a/js/dist/tab.js +++ b/js/dist/tab.js @@ -1,8 +1,6 @@ -'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; }; }(); -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'); } } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** * -------------------------------------------------------------------------- @@ -11,7 +9,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * -------------------------------------------------------------------------- */ -var Tab = (function ($) { +var Tab = function ($) { /** * ------------------------------------------------------------------------ @@ -61,176 +59,162 @@ var Tab = (function ($) { * ------------------------------------------------------------------------ */ - var Tab = (function () { + var Tab = function () { function Tab(element) { _classCallCheck(this, Tab); this._element = element; } - /** - * ------------------------------------------------------------------------ - * Data Api implementation - * ------------------------------------------------------------------------ - */ - // getters - _createClass(Tab, [{ - key: 'show', - - // public + // public - value: function show() { - var _this = this; + Tab.prototype.show = function show() { + var _this = this; - if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName.ACTIVE)) { - return; - } + if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName.ACTIVE)) { + return; + } - var target = undefined; - var previous = undefined; - var ulElement = $(this._element).closest(Selector.UL)[0]; - var selector = Util.getSelectorFromElement(this._element); + var target = void 0; + var previous = void 0; + var ulElement = $(this._element).closest(Selector.UL)[0]; + var selector = Util.getSelectorFromElement(this._element); - if (ulElement) { - previous = $.makeArray($(ulElement).find(Selector.ACTIVE)); - previous = previous[previous.length - 1]; - } + if (ulElement) { + previous = $.makeArray($(ulElement).find(Selector.ACTIVE)); + previous = previous[previous.length - 1]; + } - var hideEvent = $.Event(Event.HIDE, { - relatedTarget: this._element - }); + var hideEvent = $.Event(Event.HIDE, { + relatedTarget: this._element + }); - var showEvent = $.Event(Event.SHOW, { - relatedTarget: previous - }); + var showEvent = $.Event(Event.SHOW, { + relatedTarget: previous + }); - if (previous) { - $(previous).trigger(hideEvent); - } + if (previous) { + $(previous).trigger(hideEvent); + } - $(this._element).trigger(showEvent); + $(this._element).trigger(showEvent); - if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { - return; - } + if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { + return; + } - if (selector) { - target = $(selector)[0]; - } + if (selector) { + target = $(selector)[0]; + } - this._activate(this._element, ulElement); + this._activate(this._element, ulElement); - var complete = function complete() { - var hiddenEvent = $.Event(Event.HIDDEN, { - relatedTarget: _this._element - }); + var complete = function complete() { + var hiddenEvent = $.Event(Event.HIDDEN, { + relatedTarget: _this._element + }); - var shownEvent = $.Event(Event.SHOWN, { - relatedTarget: previous - }); + var shownEvent = $.Event(Event.SHOWN, { + relatedTarget: previous + }); - $(previous).trigger(hiddenEvent); - $(_this._element).trigger(shownEvent); - }; + $(previous).trigger(hiddenEvent); + $(_this._element).trigger(shownEvent); + }; - if (target) { - this._activate(target, target.parentNode, complete); - } else { - complete(); - } - } - }, { - key: 'dispose', - value: function dispose() { - $.removeClass(this._element, DATA_KEY); - this._element = null; + if (target) { + this._activate(target, target.parentNode, complete); + } else { + complete(); } + }; - // private + Tab.prototype.dispose = function dispose() { + $.removeClass(this._element, DATA_KEY); + this._element = null; + }; - }, { - key: '_activate', - value: function _activate(element, container, callback) { - var active = $(container).find(Selector.ACTIVE_CHILD)[0]; - var isTransitioning = callback && Util.supportsTransitionEnd() && (active && $(active).hasClass(ClassName.FADE) || Boolean($(container).find(Selector.FADE_CHILD)[0])); + // private - var complete = $.proxy(this._transitionComplete, this, element, active, isTransitioning, callback); + Tab.prototype._activate = function _activate(element, container, callback) { + var active = $(container).find(Selector.ACTIVE_CHILD)[0]; + var isTransitioning = callback && Util.supportsTransitionEnd() && (active && $(active).hasClass(ClassName.FADE) || Boolean($(container).find(Selector.FADE_CHILD)[0])); - if (active && isTransitioning) { - $(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); - } else { - complete(); - } + var complete = $.proxy(this._transitionComplete, this, element, active, isTransitioning, callback); - if (active) { - $(active).removeClass(ClassName.IN); - } + if (active && isTransitioning) { + $(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + } else { + complete(); } - }, { - key: '_transitionComplete', - value: function _transitionComplete(element, active, isTransitioning, callback) { - if (active) { - $(active).removeClass(ClassName.ACTIVE); - var dropdownChild = $(active).find(Selector.DROPDOWN_ACTIVE_CHILD)[0]; + if (active) { + $(active).removeClass(ClassName.IN); + } + }; - if (dropdownChild) { - $(dropdownChild).removeClass(ClassName.ACTIVE); - } + Tab.prototype._transitionComplete = function _transitionComplete(element, active, isTransitioning, callback) { + if (active) { + $(active).removeClass(ClassName.ACTIVE); + + var dropdownChild = $(active).find(Selector.DROPDOWN_ACTIVE_CHILD)[0]; - active.setAttribute('aria-expanded', false); + if (dropdownChild) { + $(dropdownChild).removeClass(ClassName.ACTIVE); } - $(element).addClass(ClassName.ACTIVE); - element.setAttribute('aria-expanded', true); + active.setAttribute('aria-expanded', false); + } - if (isTransitioning) { - Util.reflow(element); - $(element).addClass(ClassName.IN); - } else { - $(element).removeClass(ClassName.FADE); - } + $(element).addClass(ClassName.ACTIVE); + element.setAttribute('aria-expanded', true); - if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) { + if (isTransitioning) { + Util.reflow(element); + $(element).addClass(ClassName.IN); + } else { + $(element).removeClass(ClassName.FADE); + } - var dropdownElement = $(element).closest(Selector.DROPDOWN)[0]; - if (dropdownElement) { - $(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE); - } + if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) { - element.setAttribute('aria-expanded', true); + var dropdownElement = $(element).closest(Selector.DROPDOWN)[0]; + if (dropdownElement) { + $(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE); } - if (callback) { - callback(); - } + element.setAttribute('aria-expanded', true); } - // static + if (callback) { + callback(); + } + }; - }], [{ - key: '_jQueryInterface', - value: function _jQueryInterface(config) { - return this.each(function () { - var $this = $(this); - var data = $this.data(DATA_KEY); + // static - if (!data) { - data = data = new Tab(this); - $this.data(DATA_KEY, data); - } + Tab._jQueryInterface = function _jQueryInterface(config) { + return this.each(function () { + var $this = $(this); + var data = $this.data(DATA_KEY); - if (typeof config === 'string') { - if (data[config] === undefined) { - throw new Error('No method named "' + config + '"'); - } - data[config](); + if (!data) { + data = data = new Tab(this); + $this.data(DATA_KEY, data); + } + + if (typeof config === 'string') { + if (data[config] === undefined) { + throw new Error('No method named "' + config + '"'); } - }); - } - }, { + data[config](); + } + }); + }; + + _createClass(Tab, null, [{ key: 'VERSION', get: function get() { return VERSION; @@ -238,7 +222,13 @@ var Tab = (function ($) { }]); return Tab; - })(); + }(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { event.preventDefault(); @@ -259,5 +249,5 @@ var Tab = (function ($) { }; return Tab; -})(jQuery); +}(jQuery); //# sourceMappingURL=tab.js.map diff --git a/js/dist/tab.js.map b/js/dist/tab.js.map index 52823b00c3..84e934bcd9 100644 --- a/js/dist/tab.js.map +++ b/js/dist/tab.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/tab.js"],"names":[],"mappings":";;;;;;;;;;;;;AAUA,IAAM,GAAG,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;;AASlB,MAAM,IAAI,GAAkB,KAAK,CAAA;AACjC,MAAM,OAAO,GAAe,eAAe,CAAA;AAC3C,MAAM,QAAQ,GAAc,QAAQ,CAAA;AACpC,MAAM,SAAS,SAAiB,QAAQ,AAAE,CAAA;AAC1C,MAAM,YAAY,GAAU,WAAW,CAAA;AACvC,MAAM,kBAAkB,GAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;AACtC,MAAM,mBAAmB,GAAG,GAAG,CAAA;;AAE/B,MAAM,KAAK,GAAG;AACZ,QAAI,WAAoB,SAAS,AAAE;AACnC,UAAM,aAAoB,SAAS,AAAE;AACrC,QAAI,WAAoB,SAAS,AAAE;AACnC,SAAK,YAAoB,SAAS,AAAE;AACpC,kBAAc,YAAW,SAAS,GAAG,YAAY,AAAE;GACpD,CAAA;;AAED,MAAM,SAAS,GAAG;AAChB,iBAAa,EAAG,eAAe;AAC/B,UAAM,EAAU,QAAQ;AACxB,QAAI,EAAY,MAAM;AACtB,MAAE,EAAc,IAAI;GACrB,CAAA;;AAED,MAAM,QAAQ,GAAG;AACf,KAAC,EAAuB,GAAG;AAC3B,MAAE,EAAsB,IAAI;AAC5B,YAAQ,EAAgB,WAAW;AACnC,MAAE,EAAsB,wBAAwB;AAChD,cAAU,EAAc,4BA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'./util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): tab.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Tab = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'tab'\n const VERSION = '4.0.0-alpha.4'\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 FADE : 'fade',\n IN : 'in'\n }\n\n const Selector = {\n A : 'a',\n LI : 'li',\n DROPDOWN : '.dropdown',\n UL : 'ul:not(.dropdown-menu)',\n FADE_CHILD : '> .nav-item .fade, > .fade',\n ACTIVE : '.active',\n ACTIVE_CHILD : '> .nav-item > .active, > .active',\n DATA_TOGGLE : '[data-toggle=\"tab\"], [data-toggle=\"pill\"]',\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 return\n }\n\n let target\n let previous\n let ulElement = $(this._element).closest(Selector.UL)[0]\n let selector = Util.getSelectorFromElement(this._element)\n\n if (ulElement) {\n previous = $.makeArray($(ulElement).find(Selector.ACTIVE))\n previous = previous[previous.length - 1]\n }\n\n let hideEvent = $.Event(Event.HIDE, {\n relatedTarget: this._element\n })\n\n let 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 ulElement\n )\n\n let complete = () => {\n let hiddenEvent = $.Event(Event.HIDDEN, {\n relatedTarget: this._element\n })\n\n let shownEvent = $.Event(Event.SHOWN, {\n relatedTarget: previous\n })\n\n $(previous).trigger(hiddenEvent)\n $(this._element).trigger(shownEvent)\n }\n\n if (target) {\n this._activate(target, target.parentNode, complete)\n } else {\n complete()\n }\n }\n\n dispose() {\n $.removeClass(this._element, DATA_KEY)\n this._element = null\n }\n\n\n // private\n\n _activate(element, container, callback) {\n let active = $(container).find(Selector.ACTIVE_CHILD)[0]\n let isTransitioning = callback\n && Util.supportsTransitionEnd()\n && ((active && $(active).hasClass(ClassName.FADE))\n || Boolean($(container).find(Selector.FADE_CHILD)[0]))\n\n let complete = $.proxy(\n this._transitionComplete,\n this,\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.IN)\n }\n }\n\n _transitionComplete(element, active, isTransitioning, callback) {\n if (active) {\n $(active).removeClass(ClassName.ACTIVE)\n\n let dropdownChild = $(active).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.IN)\n } else {\n $(element).removeClass(ClassName.FADE)\n }\n\n if (element.parentNode &&\n ($(element.parentNode).hasClass(ClassName.DROPDOWN_MENU))) {\n\n let 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 let $this = $(this)\n let data = $this.data(DATA_KEY)\n\n if (!data) {\n data = 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","FADE","IN","Selector","A","LI","DROPDOWN","UL","FADE_CHILD","ACTIVE_CHILD","DATA_TOGGLE","DROPDOWN_TOGGLE","DROPDOWN_ACTIVE_CHILD","element","_element","show","parentNode","nodeType","Node","ELEMENT_NODE","hasClass","target","previous","ulElement","closest","selector","Util","getSelectorFromElement","makeArray","find","length","hideEvent","relatedTarget","showEvent","trigger","isDefaultPrevented","_activate","complete","hiddenEvent","shownEvent","dispose","removeClass","container","callback","active","isTransitioning","supportsTransitionEnd","Boolean","proxy","_transitionComplete","one","TRANSITION_END","emulateTransitionEnd","dropdownChild","setAttribute","addClass","reflow","dropdownElement","_jQueryInterface","config","each","$this","data","undefined","Error","document","on","event","preventDefault","call","Constructor","noConflict","jQuery"],"mappings":";;;;AAGA;;;;;;;AAOA,IAAMA,MAAO,UAACC,CAAD,EAAO;;AAGlB;;;;;;AAMA,MAAMC,OAAsB,KAA5B;AACA,MAAMC,UAAsB,eAA5B;AACA,MAAMC,WAAsB,QAA5B;AACA,MAAMC,kBAA0BD,QAAhC;AACA,MAAME,eAAsB,WAA5B;AACA,MAAMC,qBAAsBN,EAAEO,EAAF,CAAKN,IAAL,CAA5B;AACA,MAAMO,sBAAsB,GAA5B;;AAEA,MAAMC,QAAQ;AACZC,mBAAwBN,SADZ;AAEZO,uBAA0BP,SAFd;AAGZQ,mBAAwBR,SAHZ;AAIZS,qBAAyBT,SAJb;AAKZU,8BAAyBV,SAAzB,GAAqCC;AALzB,GAAd;;AAQA,MAAMU,YAAY;AAChBC,mBAAgB,eADA;AAEhBC,YAAgB,QAFA;AAGhBC,UAAgB,MAHA;AAIhBC,QAAgB;AAJA,GAAlB;;AAOA,MAAMC,WAAW;AACfC,OAAwB,GADT;AAEfC,QAAwB,IAFT;AAGfC,cAAwB,WAHT;AAIfC,QAAwB,wBAJT;AAKfC,gBAAwB,4BALT;AAMfR,YAAwB,SANT;AAOfS,kBAAwB,kCAPT;AAQfC,iBAAwB,2CART;AASfC,qBAAwB,kBATT;AAUfC,2BAAwB;AAVT,GAAjB;;AAcA;;;;;;AA9CkB,MAoDZ9B,GApDY;AAsDhB,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BxF,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,CAzQW,CAyQT0F,MAzQS,CAAZ","file":"tab.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): tab.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Tab = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'tab'\n const VERSION = '4.0.0-alpha.4'\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 FADE : 'fade',\n IN : 'in'\n }\n\n const Selector = {\n A : 'a',\n LI : 'li',\n DROPDOWN : '.dropdown',\n UL : 'ul:not(.dropdown-menu)',\n FADE_CHILD : '> .nav-item .fade, > .fade',\n ACTIVE : '.active',\n ACTIVE_CHILD : '> .nav-item > .active, > .active',\n DATA_TOGGLE : '[data-toggle=\"tab\"], [data-toggle=\"pill\"]',\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 return\n }\n\n let target\n let previous\n let ulElement = $(this._element).closest(Selector.UL)[0]\n let selector = Util.getSelectorFromElement(this._element)\n\n if (ulElement) {\n previous = $.makeArray($(ulElement).find(Selector.ACTIVE))\n previous = previous[previous.length - 1]\n }\n\n let hideEvent = $.Event(Event.HIDE, {\n relatedTarget: this._element\n })\n\n let 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 ulElement\n )\n\n let complete = () => {\n let hiddenEvent = $.Event(Event.HIDDEN, {\n relatedTarget: this._element\n })\n\n let shownEvent = $.Event(Event.SHOWN, {\n relatedTarget: previous\n })\n\n $(previous).trigger(hiddenEvent)\n $(this._element).trigger(shownEvent)\n }\n\n if (target) {\n this._activate(target, target.parentNode, complete)\n } else {\n complete()\n }\n }\n\n dispose() {\n $.removeClass(this._element, DATA_KEY)\n this._element = null\n }\n\n\n // private\n\n _activate(element, container, callback) {\n let active = $(container).find(Selector.ACTIVE_CHILD)[0]\n let isTransitioning = callback\n && Util.supportsTransitionEnd()\n && ((active && $(active).hasClass(ClassName.FADE))\n || Boolean($(container).find(Selector.FADE_CHILD)[0]))\n\n let complete = $.proxy(\n this._transitionComplete,\n this,\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.IN)\n }\n }\n\n _transitionComplete(element, active, isTransitioning, callback) {\n if (active) {\n $(active).removeClass(ClassName.ACTIVE)\n\n let dropdownChild = $(active).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.IN)\n } else {\n $(element).removeClass(ClassName.FADE)\n }\n\n if (element.parentNode &&\n ($(element.parentNode).hasClass(ClassName.DROPDOWN_MENU))) {\n\n let 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 let $this = $(this)\n let data = $this.data(DATA_KEY)\n\n if (!data) {\n data = data = new Tab(this)\n $this.data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined) {\n throw new Error(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault()\n Tab._jQueryInterface.call($(this), 'show')\n })\n\n\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $.fn[NAME] = Tab._jQueryInterface\n $.fn[NAME].Constructor = Tab\n $.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Tab._jQueryInterface\n }\n\n return Tab\n\n})(jQuery)\n\nexport default Tab\n"]}
\ No newline at end of file diff --git a/js/dist/tooltip.js b/js/dist/tooltip.js index fb62f49f94..99e39d0c4b 100644 --- a/js/dist/tooltip.js +++ b/js/dist/tooltip.js @@ -1,10 +1,8 @@ -/* global Tether */ +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; }; -'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; }; }(); -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'); } } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** * -------------------------------------------------------------------------- @@ -13,7 +11,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * -------------------------------------------------------------------------- */ -var Tooltip = (function ($) { +var Tooltip = function ($) { /** * Check for Tether dependency @@ -116,7 +114,7 @@ var Tooltip = (function ($) { * ------------------------------------------------------------------------ */ - var Tooltip = (function () { + var Tooltip = function () { function Tooltip(element, config) { _classCallCheck(this, Tooltip); @@ -135,439 +133,407 @@ var Tooltip = (function ($) { this._setListeners(); } - /** - * ------------------------------------------------------------------------ - * jQuery - * ------------------------------------------------------------------------ - */ - // getters - _createClass(Tooltip, [{ - key: 'enable', - - // public + // public - 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 (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); - } + Tooltip.prototype.enable = function enable() { + this._isEnabled = true; + }; - context._activeTrigger.click = !context._activeTrigger.click; + Tooltip.prototype.disable = function disable() { + this._isEnabled = false; + }; - if (context._isWithActiveTrigger()) { - context._enter(null, context); - } else { - context._leave(null, context); - } - } else { + Tooltip.prototype.toggleEnabled = function toggleEnabled() { + this._isEnabled = !this._isEnabled; + }; - if ($(this.getTipElement()).hasClass(ClassName.IN)) { - this._leave(null, this); - return; - } + Tooltip.prototype.toggle = function toggle(event) { + if (event) { + var dataKey = this.constructor.DATA_KEY; + var context = $(event.currentTarget).data(dataKey); - this._enter(null, this); + if (!context) { + context = new this.constructor(event.currentTarget, this._getDelegateConfig()); + $(event.currentTarget).data(dataKey, context); } - } - }, { - key: 'dispose', - value: function dispose() { - clearTimeout(this._timeout); - this.cleanupTether(); + context._activeTrigger.click = !context._activeTrigger.click; - $.removeData(this.element, this.constructor.DATA_KEY); - - $(this.element).off(this.constructor.EVENT_KEY); - - if (this.tip) { - $(this.tip).remove(); + if (context._isWithActiveTrigger()) { + context._enter(null, context); + } else { + context._leave(null, context); } + } else { - this._isEnabled = null; - this._timeout = null; - this._hoverState = null; - this._activeTrigger = null; - this._tether = null; + if ($(this.getTipElement()).hasClass(ClassName.IN)) { + this._leave(null, this); + return; + } - this.element = null; - this.config = null; - this.tip = null; + this._enter(null, this); } - }, { - key: 'show', - value: function show() { - var _this = this; + }; - var showEvent = $.Event(this.constructor.Event.SHOW); + Tooltip.prototype.dispose = function dispose() { + clearTimeout(this._timeout); - if (this.isWithContent() && this._isEnabled) { - $(this.element).trigger(showEvent); + this.cleanupTether(); - var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element); + $.removeData(this.element, this.constructor.DATA_KEY); - if (showEvent.isDefaultPrevented() || !isInTheDom) { - return; - } + $(this.element).off(this.constructor.EVENT_KEY); - var tip = this.getTipElement(); - var tipId = Util.getUID(this.constructor.NAME); + if (this.tip) { + $(this.tip).remove(); + } - tip.setAttribute('id', tipId); - this.element.setAttribute('aria-describedby', tipId); + this._isEnabled = null; + this._timeout = null; + this._hoverState = null; + this._activeTrigger = null; + this._tether = null; - this.setContent(); + this.element = null; + this.config = null; + this.tip = null; + }; - if (this.config.animation) { - $(tip).addClass(ClassName.FADE); - } + Tooltip.prototype.show = function show() { + var _this = this; - var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; + var showEvent = $.Event(this.constructor.Event.SHOW); - var attachment = this._getAttachment(placement); + if (this.isWithContent() && this._isEnabled) { + $(this.element).trigger(showEvent); - $(tip).data(this.constructor.DATA_KEY, this).appendTo(document.body); + var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element); - $(this.element).trigger(this.constructor.Event.INSERTED); + if (showEvent.isDefaultPrevented() || !isInTheDom) { + return; + } - this._tether = new Tether({ - attachment: attachment, - element: tip, - target: this.element, - classes: TetherClass, - classPrefix: CLASS_PREFIX, - offset: this.config.offset, - constraints: this.config.constraints, - addTargetClasses: false - }); + var tip = this.getTipElement(); + var tipId = Util.getUID(this.constructor.NAME); - Util.reflow(tip); - this._tether.position(); + tip.setAttribute('id', tipId); + this.element.setAttribute('aria-describedby', tipId); - $(tip).addClass(ClassName.IN); + this.setContent(); - var complete = function complete() { - var prevHoverState = _this._hoverState; - _this._hoverState = null; + if (this.config.animation) { + $(tip).addClass(ClassName.FADE); + } - $(_this.element).trigger(_this.constructor.Event.SHOWN); + var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; - if (prevHoverState === HoverState.OUT) { - _this._leave(null, _this); - } - }; + var attachment = this._getAttachment(placement); - if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) { - $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION); - return; - } + $(tip).data(this.constructor.DATA_KEY, this).appendTo(document.body); - complete(); - } - } - }, { - key: 'hide', - value: function hide(callback) { - var _this2 = this; + $(this.element).trigger(this.constructor.Event.INSERTED); + + this._tether = new Tether({ + attachment: attachment, + element: tip, + target: this.element, + classes: TetherClass, + classPrefix: CLASS_PREFIX, + offset: this.config.offset, + constraints: this.config.constraints, + addTargetClasses: false + }); + + Util.reflow(tip); + this._tether.position(); + + $(tip).addClass(ClassName.IN); - var tip = this.getTipElement(); - var hideEvent = $.Event(this.constructor.Event.HIDE); var complete = function complete() { - if (_this2._hoverState !== HoverState.IN && tip.parentNode) { - tip.parentNode.removeChild(tip); - } + var prevHoverState = _this._hoverState; + _this._hoverState = null; - _this2.element.removeAttribute('aria-describedby'); - $(_this2.element).trigger(_this2.constructor.Event.HIDDEN); - _this2.cleanupTether(); + $(_this.element).trigger(_this.constructor.Event.SHOWN); - if (callback) { - callback(); + if (prevHoverState === HoverState.OUT) { + _this._leave(null, _this); } }; - $(this.element).trigger(hideEvent); - - if (hideEvent.isDefaultPrevented()) { + if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) { + $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION); return; } - $(tip).removeClass(ClassName.IN); + complete(); + } + }; - if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) { + Tooltip.prototype.hide = function hide(callback) { + var _this2 = this; - $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); - } else { - complete(); + var tip = this.getTipElement(); + var hideEvent = $.Event(this.constructor.Event.HIDE); + var complete = function complete() { + if (_this2._hoverState !== HoverState.IN && tip.parentNode) { + tip.parentNode.removeChild(tip); } - this._hoverState = ''; - } + _this2.element.removeAttribute('aria-describedby'); + $(_this2.element).trigger(_this2.constructor.Event.HIDDEN); + _this2.cleanupTether(); - // protected + if (callback) { + callback(); + } + }; - }, { - key: 'isWithContent', - value: function isWithContent() { - return Boolean(this.getTitle()); - } - }, { - key: 'getTipElement', - value: function getTipElement() { - return this.tip = this.tip || $(this.config.template)[0]; + $(this.element).trigger(hideEvent); + + if (hideEvent.isDefaultPrevented()) { + return; } - }, { - key: 'setContent', - value: function setContent() { - var $tip = $(this.getTipElement()); - this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle()); + $(tip).removeClass(ClassName.IN); - $tip.removeClass(ClassName.FADE).removeClass(ClassName.IN); + if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) { - this.cleanupTether(); + $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + } else { + complete(); } - }, { - key: 'setElementContent', - value: function setElementContent($element, content) { - var html = this.config.html; - if (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()); + + this._hoverState = ''; + }; + + // protected + + Tooltip.prototype.isWithContent = function isWithContent() { + return Boolean(this.getTitle()); + }; + + 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).removeClass(ClassName.IN); + + this.cleanupTether(); + }; + + 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); } } else { - $element[html ? 'html' : 'text'](content); + $element.text($(content).text()); } + } else { + $element[html ? 'html' : 'text'](content); } - }, { - key: 'getTitle', - value: 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; - } + Tooltip.prototype.getTitle = function getTitle() { + var title = this.element.getAttribute('data-original-title'); - return title; - } - }, { - key: 'cleanupTether', - value: function cleanupTether() { - if (this._tether) { - this._tether.destroy(); - } + if (!title) { + title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; } - // private + return title; + }; - }, { - key: '_getAttachment', - value: function _getAttachment(placement) { - return AttachmentMap[placement.toUpperCase()]; + Tooltip.prototype.cleanupTether = function cleanupTether() { + if (this._tether) { + this._tether.destroy(); } - }, { - key: '_setListeners', - value: function _setListeners() { - var _this3 = this; + }; - var triggers = this.config.trigger.split(' '); + // private - triggers.forEach(function (trigger) { - if (trigger === 'click') { - $(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, $.proxy(_this3.toggle, _this3)); - } 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; + Tooltip.prototype._getAttachment = function _getAttachment(placement) { + return AttachmentMap[placement.toUpperCase()]; + }; - $(_this3.element).on(eventIn, _this3.config.selector, $.proxy(_this3._enter, _this3)).on(eventOut, _this3.config.selector, $.proxy(_this3._leave, _this3)); - } - }); + Tooltip.prototype._setListeners = function _setListeners() { + var _this3 = this; - if (this.config.selector) { - this.config = $.extend({}, this.config, { - trigger: 'manual', - selector: '' - }); - } else { - this._fixTitle(); - } - } - }, { - 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', ''); + var triggers = this.config.trigger.split(' '); + + triggers.forEach(function (trigger) { + if (trigger === 'click') { + $(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, $.proxy(_this3.toggle, _this3)); + } 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, $.proxy(_this3._enter, _this3)).on(eventOut, _this3.config.selector, $.proxy(_this3._leave, _this3)); } + }); + + if (this.config.selector) { + this.config = $.extend({}, this.config, { + trigger: 'manual', + selector: '' + }); + } else { + this._fixTitle(); } - }, { - key: '_enter', - value: function _enter(event, context) { - var dataKey = this.constructor.DATA_KEY; + }; - context = context || $(event.currentTarget).data(dataKey); + 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', ''); + } + }; - if (!context) { - context = new this.constructor(event.currentTarget, this._getDelegateConfig()); - $(event.currentTarget).data(dataKey, context); - } + Tooltip.prototype._enter = function _enter(event, context) { + var dataKey = this.constructor.DATA_KEY; - if (event) { - context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true; - } + context = context || $(event.currentTarget).data(dataKey); - if ($(context.getTipElement()).hasClass(ClassName.IN) || context._hoverState === HoverState.IN) { - context._hoverState = HoverState.IN; - return; - } + if (!context) { + context = new this.constructor(event.currentTarget, this._getDelegateConfig()); + $(event.currentTarget).data(dataKey, context); + } - clearTimeout(context._timeout); + if (event) { + context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true; + } + if ($(context.getTipElement()).hasClass(ClassName.IN) || context._hoverState === HoverState.IN) { context._hoverState = HoverState.IN; + return; + } + + clearTimeout(context._timeout); + + context._hoverState = HoverState.IN; - if (!context.config.delay || !context.config.delay.show) { + if (!context.config.delay || !context.config.delay.show) { + context.show(); + return; + } + + context._timeout = setTimeout(function () { + if (context._hoverState === HoverState.IN) { context.show(); - return; } + }, context.config.delay.show); + }; - context._timeout = setTimeout(function () { - if (context._hoverState === HoverState.IN) { - context.show(); - } - }, context.config.delay.show); - } - }, { - key: '_leave', - value: function _leave(event, context) { - var dataKey = this.constructor.DATA_KEY; + Tooltip.prototype._leave = function _leave(event, context) { + var dataKey = this.constructor.DATA_KEY; - context = context || $(event.currentTarget).data(dataKey); + context = 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); + } - if (event) { - context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false; - } + if (event) { + context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false; + } - if (context._isWithActiveTrigger()) { - return; - } + if (context._isWithActiveTrigger()) { + return; + } + + clearTimeout(context._timeout); - clearTimeout(context._timeout); + context._hoverState = HoverState.OUT; - context._hoverState = HoverState.OUT; + if (!context.config.delay || !context.config.delay.hide) { + context.hide(); + return; + } - if (!context.config.delay || !context.config.delay.hide) { + context._timeout = setTimeout(function () { + if (context._hoverState === HoverState.OUT) { context.hide(); - return; } + }, context.config.delay.hide); + }; - 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; - } + Tooltip.prototype._isWithActiveTrigger = function _isWithActiveTrigger() { + for (var trigger in this._activeTrigger) { + if (this._activeTrigger[trigger]) { + return true; } - - 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); + return false; + }; + + Tooltip.prototype._getConfig = function _getConfig(config) { + config = $.extend({}, this.constructor.Default, $(this.element).data(), config); - return config; + if (config.delay && typeof config.delay === 'number') { + config.delay = { + show: config.delay, + hide: config.delay + }; } - }, { - 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]; - } + + Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); + + return config; + }; + + Tooltip.prototype._getDelegateConfig = 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; } - // static + return config; + }; - }], [{ - key: '_jQueryInterface', - value: function _jQueryInterface(config) { - return this.each(function () { - var data = $(this).data(DATA_KEY); - var _config = typeof config === 'object' ? config : null; + // static - if (!data && /destroy|hide/.test(config)) { - return; - } + 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 : null; - if (!data) { - data = new Tooltip(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 + '"'); - } - data[config](); + if (!data) { + data = new Tooltip(this, _config); + $(this).data(DATA_KEY, data); + } + + if (typeof config === 'string') { + if (data[config] === undefined) { + throw new Error('No method named "' + config + '"'); } - }); - } - }, { + data[config](); + } + }); + }; + + _createClass(Tooltip, null, [{ key: 'VERSION', get: function get() { return VERSION; @@ -605,7 +571,13 @@ var Tooltip = (function ($) { }]); return Tooltip; - })(); + }(); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ $.fn[NAME] = Tooltip._jQueryInterface; $.fn[NAME].Constructor = Tooltip; @@ -615,5 +587,5 @@ var Tooltip = (function ($) { }; return Tooltip; -})(jQuery); +}(jQuery); /* global Tether */ //# sourceMappingURL=tooltip.js.map diff --git a/js/dist/tooltip.js.map b/js/dist/tooltip.js.map index 185ef2cb3c..1ff3af0f7e 100644 --- a/js/dist/tooltip.js.map +++ b/js/dist/tooltip.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/tooltip.js"],"names":[],"mappings":";;;;;;;;;;;;;;;AAYA,IAAM,OAAO,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;AAMtB,MAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE;AAC/B,UAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;GACzE;;;;;;;;AASD,MAAM,IAAI,GAAkB,SAAS,CAAA;AACrC,MAAM,OAAO,GAAe,eAAe,CAAA;AAC3C,MAAM,QAAQ,GAAc,YAAY,CAAA;AACxC,MAAM,SAAS,SAAiB,QAAQ,AAAE,CAAA;AAC1C,MAAM,kBAAkB,GAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;AACtC,MAAM,mBAAmB,GAAG,GAAG,CAAA;AAC/B,MAAM,YAAY,GAAU,WAAW,CAAA;;AAEvC,MAAM,OAAO,GAAG;AACd,aAAS,EAAK,IAAI;AAClB,YAAQ,EAAM,sCAAsC,GACtC,mCAAmC,GACnC,yCAAyC;AACvD,WAAO,EAAO,aAAa;AAC3B,SAAK,EAAS,EAAE;AAChB,SAAK,EAAS,CAAC;AACf,QAAI,EAAU,KAAK;AACnB,YAAQ,EAAM,KAAK;AACnB,aAAS,EAAK,KAAK;AACnB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IAAI,CAAC,CAAC,UAAU,GAAI,YAAY;AACnC,KAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAA;AAC/B,WAAO,OAAO,CAAC,gBAAgB,CAAA;GAChC,CAAA;;AAED,SAAO,OAAO,CAAA;CAEf,CAAA,CAAE,MAAM,CAAC,CAAA","file":"tooltip.js","sourcesContent":["/* global Tether */\n\nimport Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Tooltip = (($) => {\n\n /**\n * Check for Tether dependency\n * Tether - http://tether.io/\n */\n if (window.Tether === undefined) {\n throw new Error('Bootstrap tooltips require Tether (http://tether.io/)')\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'tooltip'\n const VERSION = '4.0.0-alpha.4'\n const DATA_KEY = 'bs.tooltip'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 150\n const CLASS_PREFIX = 'bs-tether'\n\n const Default = {\n animation : true,\n template : '<div class=\"tooltip\" role=\"tooltip\">'\n + '<div class=\"tooltip-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 0',\n constraints : []\n }\n\n const DefaultType = {\n animation : 'boolean',\n template : 'string',\n title : '(string|element|function)',\n trigger : 'string',\n delay : '(number|object)',\n html : 'boolean',\n selector : '(string|boolean)',\n placement : '(string|function)',\n offset : 'string',\n constraints : 'array'\n }\n\n const AttachmentMap = {\n TOP : 'bottom center',\n RIGHT : 'middle left',\n BOTTOM : 'top center',\n LEFT : 'middle right'\n }\n\n const HoverState = {\n IN : 'in',\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 IN : 'in'\n }\n\n const Selector = {\n TOOLTIP : '.tooltip',\n TOOLTIP_INNER : '.tooltip-inner'\n }\n\n const TetherClass = {\n element : false,\n enabled : false\n }\n\n const Trigger = {\n HOVER : 'hover',\n FOCUS : 'focus',\n CLICK : 'click',\n MANUAL : 'manual'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Tooltip {\n\n constructor(element, config) {\n\n // private\n this._isEnabled = true\n this._timeout = 0\n this._hoverState = ''\n this._activeTrigger = {}\n this._tether = null\n\n // protected\n this.element = element\n this.config = this._getConfig(config)\n this.tip = null\n\n this._setListeners()\n\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get DATA_KEY() {\n return DATA_KEY\n }\n\n static get Event() {\n return Event\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n\n // public\n\n enable() {\n this._isEnabled = true\n }\n\n disable() {\n this._isEnabled = false\n }\n\n toggleEnabled() {\n this._isEnabled = !this._isEnabled\n }\n\n toggle(event) {\n if (event) {\n let 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.IN)) {\n this._leave(null, this)\n return\n }\n\n this._enter(null, this)\n }\n }\n\n dispose() {\n clearTimeout(this._timeout)\n\n this.cleanupTether()\n\n $.removeData(this.element, this.constructor.DATA_KEY)\n\n $(this.element).off(this.constructor.EVENT_KEY)\n\n if (this.tip) {\n $(this.tip).remove()\n }\n\n this._isEnabled = null\n this._timeout = null\n this._hoverState = null\n this._activeTrigger = null\n this._tether = null\n\n this.element = null\n this.config = null\n this.tip = null\n }\n\n show() {\n let showEvent = $.Event(this.constructor.Event.SHOW)\n\n if (this.isWithContent() && this._isEnabled) {\n $(this.element).trigger(showEvent)\n\n let isInTheDom = $.contains(\n this.element.ownerDocument.documentElement,\n this.element\n )\n\n if (showEvent.isDefaultPrevented() || !isInTheDom) {\n return\n }\n\n let tip = this.getTipElement()\n let 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 let placement = typeof this.config.placement === 'function' ?\n this.config.placement.call(this, tip, this.element) :\n this.config.placement\n\n let attachment = this._getAttachment(placement)\n\n $(tip)\n .data(this.constructor.DATA_KEY, this)\n .appendTo(document.body)\n\n $(this.element).trigger(this.constructor.Event.INSERTED)\n\n this._tether = new Tether({\n attachment,\n element : tip,\n target : this.element,\n classes : TetherClass,\n classPrefix : CLASS_PREFIX,\n offset : this.config.offset,\n constraints : this.config.constraints,\n addTargetClasses: false\n })\n\n Util.reflow(tip)\n this._tether.position()\n\n $(tip).addClass(ClassName.IN)\n\n let complete = () => {\n let prevHoverState = this._hoverState\n this._hoverState = null\n\n $(this.element).trigger(this.constructor.Event.SHOWN)\n\n if (prevHoverState === HoverState.OUT) {\n this._leave(null, this)\n }\n }\n\n if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {\n $(this.tip)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(Tooltip._TRANSITION_DURATION)\n return\n }\n\n complete()\n }\n }\n\n hide(callback) {\n let tip = this.getTipElement()\n let hideEvent = $.Event(this.constructor.Event.HIDE)\n let complete = () => {\n if (this._hoverState !== HoverState.IN && tip.parentNode) {\n tip.parentNode.removeChild(tip)\n }\n\n this.element.removeAttribute('aria-describedby')\n $(this.element).trigger(this.constructor.Event.HIDDEN)\n this.cleanupTether()\n\n if (callback) {\n callback()\n }\n }\n\n $(this.element).trigger(hideEvent)\n\n if (hideEvent.isDefaultPrevented()) {\n return\n }\n\n $(tip).removeClass(ClassName.IN)\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 // protected\n\n isWithContent() {\n return Boolean(this.getTitle())\n }\n\n getTipElement() {\n return (this.tip = this.tip || $(this.config.template)[0])\n }\n\n setContent() {\n let $tip = $(this.getTipElement())\n\n this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle())\n\n $tip\n .removeClass(ClassName.FADE)\n .removeClass(ClassName.IN)\n\n this.cleanupTether()\n }\n\n setElementContent($element, content) {\n let html = this.config.html\n if (typeof content === 'object' && (content.nodeType || content.jquery)) {\n // content is a DOM node or a jQuery\n if (html) {\n if (!$(content).parent().is($element)) {\n $element.empty().append(content)\n }\n } else {\n $element.text($(content).text())\n }\n } else {\n $element[html ? 'html' : 'text'](content)\n }\n }\n\n getTitle() {\n let title = this.element.getAttribute('data-original-title')\n\n if (!title) {\n title = typeof this.config.title === 'function' ?\n this.config.title.call(this.element) :\n this.config.title\n }\n\n return title\n }\n\n cleanupTether() {\n if (this._tether) {\n this._tether.destroy()\n }\n }\n\n\n // private\n\n _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()]\n }\n\n _setListeners() {\n let 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 $.proxy(this.toggle, this)\n )\n\n } else if (trigger !== Trigger.MANUAL) {\n let eventIn = trigger === Trigger.HOVER ?\n this.constructor.Event.MOUSEENTER :\n this.constructor.Event.FOCUSIN\n let 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 $.proxy(this._enter, this)\n )\n .on(\n eventOut,\n this.config.selector,\n $.proxy(this._leave, this)\n )\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 let 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 let 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.IN) ||\n (context._hoverState === HoverState.IN)) {\n context._hoverState = HoverState.IN\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HoverState.IN\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.IN) {\n context.show()\n }\n }, context.config.delay.show)\n }\n\n _leave(event, context) {\n let 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 (let 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 Util.typeCheckConfig(\n NAME,\n config,\n this.constructor.DefaultType\n )\n\n return config\n }\n\n _getDelegateConfig() {\n let config = {}\n\n if (this.config) {\n for (let key in this.config) {\n if (this.constructor.Default[key] !== this.config[key]) {\n config[key] = this.config[key]\n }\n }\n }\n\n return config\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n let _config = typeof config === 'object' ?\n config : null\n\n if (!data && /destroy|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","$","window","Tether","undefined","Error","NAME","VERSION","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","fn","TRANSITION_DURATION","CLASS_PREFIX","Default","animation","template","trigger","title","delay","html","selector","placement","offset","constraints","DefaultType","AttachmentMap","TOP","RIGHT","BOTTOM","LEFT","HoverState","IN","OUT","Event","HIDE","HIDDEN","SHOW","SHOWN","INSERTED","CLICK","FOCUSIN","FOCUSOUT","MOUSEENTER","MOUSELEAVE","ClassName","FADE","Selector","TOOLTIP","TOOLTIP_INNER","TetherClass","element","enabled","Trigger","HOVER","FOCUS","MANUAL","config","_isEnabled","_timeout","_hoverState","_activeTrigger","_tether","_getConfig","tip","_setListeners","enable","disable","toggleEnabled","toggle","event","dataKey","constructor","context","currentTarget","data","_getDelegateConfig","click","_isWithActiveTrigger","_enter","_leave","getTipElement","hasClass","dispose","clearTimeout","cleanupTether","removeData","off","remove","show","showEvent","isWithContent","isInTheDom","contains","ownerDocument","documentElement","isDefaultPrevented","tipId","Util","getUID","setAttribute","setContent","addClass","call","attachment","_getAttachment","appendTo","document","body","target","classes","classPrefix","addTargetClasses","reflow","position","complete","prevHoverState","supportsTransitionEnd","one","TRANSITION_END","emulateTransitionEnd","_TRANSITION_DURATION","hide","callback","hideEvent","parentNode","removeChild","removeAttribute","removeClass","Boolean","getTitle","$tip","setElementContent","find","$element","content","nodeType","jquery","parent","is","empty","append","text","getAttribute","destroy","toUpperCase","triggers","split","forEach","on","proxy","eventIn","eventOut","extend","_fixTitle","titleType","type","setTimeout","typeCheckConfig","key","_jQueryInterface","each","_config","test","Constructor","noConflict","jQuery"],"mappings":";;;;;;AAKA;;;;;;;AAOA,IAAMA,UAAW,UAACC,CAAD,EAAO;;AAEtB;;;;AAIA,MAAIC,OAAOC,MA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AAAA;AAAA,0BAkJD;AACjB,eAAO0B,KAAP;AACD;AApJmB;AAAA;AAAA,0BAsJG;AACrB,eAAOzB,SAAP;AACD;AAxJmB;AAAA;AAAA,0BA0JK;AACvB,eAAOgB,WAAP;AACD;AA5JmB;;AAAA;AAAA;;AA8mBtB;;;;;;AAMAxB,IAAEU,EAAF,CAAKL,IAAL,IAAyBN,QAAQgK,gBAAjC;AACA/J,IAAEU,EAAF,CAAKL,IAAL,EAAW8J,WAAX,GAAyBpK,OAAzB;AACAC,IAAEU,EAAF,CAAKL,IAAL,EAAW+J,UAAX,GAAyB,YAAY;AACnCpK,MAAEU,EAAF,CAAKL,IAAL,IAAaI,kBAAb;AACA,WAAOV,QAAQgK,gBAAf;AACD,GAHD;;AAKA,SAAOhK,OAAP;AAED,CA7nBe,CA6nBbsK,MA7nBa,CAAhB,C,CAZA","file":"tooltip.js","sourcesContent":["/* global Tether */\n\nimport Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Tooltip = (($) => {\n\n /**\n * Check for Tether dependency\n * Tether - http://tether.io/\n */\n if (window.Tether === undefined) {\n throw new Error('Bootstrap tooltips require Tether (http://tether.io/)')\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n const NAME = 'tooltip'\n const VERSION = '4.0.0-alpha.4'\n const DATA_KEY = 'bs.tooltip'\n const EVENT_KEY = `.${DATA_KEY}`\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 150\n const CLASS_PREFIX = 'bs-tether'\n\n const Default = {\n animation : true,\n template : '<div class=\"tooltip\" role=\"tooltip\">'\n + '<div class=\"tooltip-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 0',\n constraints : []\n }\n\n const DefaultType = {\n animation : 'boolean',\n template : 'string',\n title : '(string|element|function)',\n trigger : 'string',\n delay : '(number|object)',\n html : 'boolean',\n selector : '(string|boolean)',\n placement : '(string|function)',\n offset : 'string',\n constraints : 'array'\n }\n\n const AttachmentMap = {\n TOP : 'bottom center',\n RIGHT : 'middle left',\n BOTTOM : 'top center',\n LEFT : 'middle right'\n }\n\n const HoverState = {\n IN : 'in',\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 IN : 'in'\n }\n\n const Selector = {\n TOOLTIP : '.tooltip',\n TOOLTIP_INNER : '.tooltip-inner'\n }\n\n const TetherClass = {\n element : false,\n enabled : false\n }\n\n const Trigger = {\n HOVER : 'hover',\n FOCUS : 'focus',\n CLICK : 'click',\n MANUAL : 'manual'\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n class Tooltip {\n\n constructor(element, config) {\n\n // private\n this._isEnabled = true\n this._timeout = 0\n this._hoverState = ''\n this._activeTrigger = {}\n this._tether = null\n\n // protected\n this.element = element\n this.config = this._getConfig(config)\n this.tip = null\n\n this._setListeners()\n\n }\n\n\n // getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get DATA_KEY() {\n return DATA_KEY\n }\n\n static get Event() {\n return Event\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n\n // public\n\n enable() {\n this._isEnabled = true\n }\n\n disable() {\n this._isEnabled = false\n }\n\n toggleEnabled() {\n this._isEnabled = !this._isEnabled\n }\n\n toggle(event) {\n if (event) {\n let 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.IN)) {\n this._leave(null, this)\n return\n }\n\n this._enter(null, this)\n }\n }\n\n dispose() {\n clearTimeout(this._timeout)\n\n this.cleanupTether()\n\n $.removeData(this.element, this.constructor.DATA_KEY)\n\n $(this.element).off(this.constructor.EVENT_KEY)\n\n if (this.tip) {\n $(this.tip).remove()\n }\n\n this._isEnabled = null\n this._timeout = null\n this._hoverState = null\n this._activeTrigger = null\n this._tether = null\n\n this.element = null\n this.config = null\n this.tip = null\n }\n\n show() {\n let showEvent = $.Event(this.constructor.Event.SHOW)\n\n if (this.isWithContent() && this._isEnabled) {\n $(this.element).trigger(showEvent)\n\n let isInTheDom = $.contains(\n this.element.ownerDocument.documentElement,\n this.element\n )\n\n if (showEvent.isDefaultPrevented() || !isInTheDom) {\n return\n }\n\n let tip = this.getTipElement()\n let 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 let placement = typeof this.config.placement === 'function' ?\n this.config.placement.call(this, tip, this.element) :\n this.config.placement\n\n let attachment = this._getAttachment(placement)\n\n $(tip)\n .data(this.constructor.DATA_KEY, this)\n .appendTo(document.body)\n\n $(this.element).trigger(this.constructor.Event.INSERTED)\n\n this._tether = new Tether({\n attachment,\n element : tip,\n target : this.element,\n classes : TetherClass,\n classPrefix : CLASS_PREFIX,\n offset : this.config.offset,\n constraints : this.config.constraints,\n addTargetClasses: false\n })\n\n Util.reflow(tip)\n this._tether.position()\n\n $(tip).addClass(ClassName.IN)\n\n let complete = () => {\n let prevHoverState = this._hoverState\n this._hoverState = null\n\n $(this.element).trigger(this.constructor.Event.SHOWN)\n\n if (prevHoverState === HoverState.OUT) {\n this._leave(null, this)\n }\n }\n\n if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {\n $(this.tip)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(Tooltip._TRANSITION_DURATION)\n return\n }\n\n complete()\n }\n }\n\n hide(callback) {\n let tip = this.getTipElement()\n let hideEvent = $.Event(this.constructor.Event.HIDE)\n let complete = () => {\n if (this._hoverState !== HoverState.IN && tip.parentNode) {\n tip.parentNode.removeChild(tip)\n }\n\n this.element.removeAttribute('aria-describedby')\n $(this.element).trigger(this.constructor.Event.HIDDEN)\n this.cleanupTether()\n\n if (callback) {\n callback()\n }\n }\n\n $(this.element).trigger(hideEvent)\n\n if (hideEvent.isDefaultPrevented()) {\n return\n }\n\n $(tip).removeClass(ClassName.IN)\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 // protected\n\n isWithContent() {\n return Boolean(this.getTitle())\n }\n\n getTipElement() {\n return (this.tip = this.tip || $(this.config.template)[0])\n }\n\n setContent() {\n let $tip = $(this.getTipElement())\n\n this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle())\n\n $tip\n .removeClass(ClassName.FADE)\n .removeClass(ClassName.IN)\n\n this.cleanupTether()\n }\n\n setElementContent($element, content) {\n let html = this.config.html\n if (typeof content === 'object' && (content.nodeType || content.jquery)) {\n // content is a DOM node or a jQuery\n if (html) {\n if (!$(content).parent().is($element)) {\n $element.empty().append(content)\n }\n } else {\n $element.text($(content).text())\n }\n } else {\n $element[html ? 'html' : 'text'](content)\n }\n }\n\n getTitle() {\n let title = this.element.getAttribute('data-original-title')\n\n if (!title) {\n title = typeof this.config.title === 'function' ?\n this.config.title.call(this.element) :\n this.config.title\n }\n\n return title\n }\n\n cleanupTether() {\n if (this._tether) {\n this._tether.destroy()\n }\n }\n\n\n // private\n\n _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()]\n }\n\n _setListeners() {\n let 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 $.proxy(this.toggle, this)\n )\n\n } else if (trigger !== Trigger.MANUAL) {\n let eventIn = trigger === Trigger.HOVER ?\n this.constructor.Event.MOUSEENTER :\n this.constructor.Event.FOCUSIN\n let 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 $.proxy(this._enter, this)\n )\n .on(\n eventOut,\n this.config.selector,\n $.proxy(this._leave, this)\n )\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 let 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 let 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.IN) ||\n (context._hoverState === HoverState.IN)) {\n context._hoverState = HoverState.IN\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HoverState.IN\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.IN) {\n context.show()\n }\n }, context.config.delay.show)\n }\n\n _leave(event, context) {\n let 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 (let 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 Util.typeCheckConfig(\n NAME,\n config,\n this.constructor.DefaultType\n )\n\n return config\n }\n\n _getDelegateConfig() {\n let config = {}\n\n if (this.config) {\n for (let key in this.config) {\n if (this.constructor.Default[key] !== this.config[key]) {\n config[key] = this.config[key]\n }\n }\n }\n\n return config\n }\n\n\n // static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n let _config = typeof config === 'object' ?\n config : null\n\n if (!data && /destroy|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 diff --git a/js/dist/util.js b/js/dist/util.js index eb861bdf41..3668170619 100644 --- a/js/dist/util.js +++ b/js/dist/util.js @@ -5,9 +5,7 @@ * -------------------------------------------------------------------------- */ -'use strict'; - -var Util = (function ($) { +var Util = function ($) { /** * ------------------------------------------------------------------------ @@ -28,7 +26,7 @@ var Util = (function ($) { // shoutout AngusCroll (https://goo.gl/pxwQGp) function toType(obj) { - return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase(); + return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase(); } function isElement(obj) { @@ -55,9 +53,9 @@ var Util = (function ($) { var el = document.createElement('bootstrap'); - for (var _name in TransitionEndEvent) { - if (el.style[_name] !== undefined) { - return { end: TransitionEndEvent[_name] }; + for (var name in TransitionEndEvent) { + if (el.style[name] !== undefined) { + return { end: TransitionEndEvent[name] }; } } @@ -105,12 +103,11 @@ var Util = (function ($) { getUID: function getUID(prefix) { do { /* eslint-disable no-bitwise */ - prefix += ~ ~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here + prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here /* eslint-enable no-bitwise */ } while (document.getElementById(prefix)); return prefix; }, - getSelectorFromElement: function getSelectorFromElement(element) { var selector = element.getAttribute('data-target'); @@ -121,25 +118,21 @@ var Util = (function ($) { return selector; }, - reflow: function reflow(element) { new Function('bs', 'return bs')(element.offsetHeight); }, - triggerTransitionEnd: function triggerTransitionEnd(element) { $(element).trigger(transition.end); }, - supportsTransitionEnd: function supportsTransitionEnd() { return Boolean(transition); }, - typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { for (var property in configTypes) { if (configTypes.hasOwnProperty(property)) { var expectedTypes = configTypes[property]; var value = config[property]; - var valueType = undefined; + var valueType = void 0; if (value && isElement(value)) { valueType = 'element'; @@ -158,5 +151,5 @@ var Util = (function ($) { setTransitionEndSupport(); return Util; -})(jQuery); +}(jQuery); //# sourceMappingURL=util.js.map diff --git a/js/dist/util.js.map b/js/dist/util.js.map index e7e5f60bec..2a23338d93 100644 --- a/js/dist/util.js.map +++ b/js/dist/util.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/util.js"],"names":[],"mappings":";;;;;;;;;AAOA,IAAM,IAAI,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;;AASnB,MAAI,UAAU,GAAG,KAAK,CAAA;;AAEtB,MAAM,OAAO,GAAG,OAAO,CAAA;;AAEvB,MAAM,kBAAkB,GAAG;AACzB,oBAAgB,EAAG,qBAAqB;AACxC,iBAAa,EAAM,eAAe;AAClC,eAAW,EAAQ,+BAA+B;AAClD,cAAU,EAAS,eAAe;GACnC,CAAA;;;AAGD,WAAS,MAAM,CAAC,GAAG,EAAE;AACnB,WAAO,CAAC,GAAE,CAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;GACvE;;AAED,WAAS,SAAS,CAAC,GAAG,EAAE;AACtB,WAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAA,CAAE,QAAQ,CAAA;GAChC;;AAED,WAAS,4BAA4B,GAAG;AACtC,WAAO;AACL,cAAQ,EAAE,UAAU,CAAC,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GAAG,WAAW,CAAC,QAAQ,CAAC,CAAA;AACzC,cAAI,KAAK,GAAW,MAAM,CAAC,QAAQ,CAAC,CAAA;AACpC,cAAI,SAAS,YAAA,CAAA;;AAEb,cAAI,KAAK,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE;AAC7B,qBAAS,GAAG,SAAS,CAAA;WACtB,MAAM;AACL,qBAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;WAC1B;;AAED,cAAI,CAAC,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;AAC9C,kBAAM,IAAI,KAAK,CACb,AAAG,aAAa,CAAC,WAAW,EAAE,wBACnB,QAAQ,yBAAoB,SAAS,QAAI,4BAC9B,aAAa,QAAI,CAAC,CAAA;WAC3C;SACF;OACF;KACF;GACF,CAAA;;AAED,yBAAuB,EAAE,CAAA;;AAEzB,SAAO,IAAI,CAAA;CAEZ,CAAA,CAAE,MAAM,CAAC,CAAA","file":"util.js","sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): 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 let el = document.createElement('bootstrap')\n\n for (let name in TransitionEndEvent) {\n if (el.style[name] !== undefined) {\n return { end: TransitionEndEvent[name] }\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 let Util = {\n\n TRANSITION_END: 'bsTransitionEnd',\n\n getUID(prefix) {\n do {\n /* eslint-disable no-bitwise */\n prefix += ~~(Math.random() * MAX_UID) // \"~~\" acts like a faster Math.floor() here\n /* eslint-enable no-bitwise */\n } while (document.getElementById(prefix))\n return prefix\n },\n\n getSelectorFromElement(element) {\n let selector = element.getAttribute('data-target')\n\n if (!selector) {\n selector = element.getAttribute('href') || ''\n selector = /^#[a-z]/i.test(selector) ? selector : null\n }\n\n return selector\n },\n\n reflow(element) {\n new Function('bs', 'return bs')(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 (let property in configTypes) {\n if (configTypes.hasOwnProperty(property)) {\n let expectedTypes = configTypes[property]\n let value = config[property]\n let valueType\n\n if (value && isElement(value)) {\n valueType = 'element'\n } else {\n valueType = toType(value)\n }\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","test","reflow","Function","offsetHeight","trigger","Boolean","typeCheckConfig","componentName","config","configTypes","property","hasOwnProperty","expectedTypes","value","valueType","RegExp","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;AAJM,GAA3B;;AAOA;AACA,WAASM,MAAT,CAAgBC,GAAhB,EAAqB;AACnB,WAAQ,EAAD,CAAKC,QAAL,CAAcC,IAAd,CAAmBF,GAAnB,EAAwBG,KAAxB,CAA8B,eAA9B,EAA+C,CAA/C,EAAkDC,WAAlD,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;AA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AIE,MAAJ,CAAWH,aAAX,EAA0BZ,IAA1B,CAA+Bc,SAA/B,CAAL,EAAgD;AAC9C,kBAAM,IAAIE,KAAJ,CACDT,cAAcU,WAAd,EAAH,wBACWP,QADX,yBACuCI,SADvC,oCAEsBF,aAFtB,QADI,CAAN;AAID;AACF;AACF;AACF;AAzDQ,GAAX;;AA4DA1B;;AAEA,SAAO5C,IAAP;AAED,CA3JY,CA2JV4E,MA3JU,CAAb","file":"util.js","sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.4): 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 let el = document.createElement('bootstrap')\n\n for (let name in TransitionEndEvent) {\n if (el.style[name] !== undefined) {\n return { end: TransitionEndEvent[name] }\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 let Util = {\n\n TRANSITION_END: 'bsTransitionEnd',\n\n getUID(prefix) {\n do {\n /* eslint-disable no-bitwise */\n prefix += ~~(Math.random() * MAX_UID) // \"~~\" acts like a faster Math.floor() here\n /* eslint-enable no-bitwise */\n } while (document.getElementById(prefix))\n return prefix\n },\n\n getSelectorFromElement(element) {\n let selector = element.getAttribute('data-target')\n\n if (!selector) {\n selector = element.getAttribute('href') || ''\n selector = /^#[a-z]/i.test(selector) ? selector : null\n }\n\n return selector\n },\n\n reflow(element) {\n new Function('bs', 'return bs')(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 (let property in configTypes) {\n if (configTypes.hasOwnProperty(property)) {\n let expectedTypes = configTypes[property]\n let value = config[property]\n let valueType\n\n if (value && isElement(value)) {\n valueType = 'element'\n } else {\n valueType = toType(value)\n }\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 |