From 8bab38bb7176d2716b72664dbafcc326824a2ee9 Mon Sep 17 00:00:00 2001 From: fat Date: Sat, 9 May 2015 23:00:59 -0700 Subject: [PATCH] add collapse --- Gruntfile.js | 1 + js/carousel.js | 237 ----------------------- js/collapse.js | 211 --------------------- js/dist/alert.js.map | 2 +- js/dist/button.js.map | 2 +- js/dist/carousel.js | 10 +- js/dist/carousel.js.map | 2 +- js/dist/collapse.js | 322 +++++++++++++++++++++++++++++++ js/dist/collapse.js.map | 1 + js/src/alert.js | 2 +- js/src/collapse.js | 345 ++++++++++++++++++++++++++++++++++ js/tests/index.html | 2 +- js/tests/unit/collapse.js | 4 +- js/tests/visual/collapse.html | 4 +- 14 files changed, 683 insertions(+), 462 deletions(-) delete mode 100644 js/carousel.js delete mode 100644 js/collapse.js create mode 100644 js/dist/collapse.js create mode 100644 js/dist/collapse.js.map create mode 100644 js/src/collapse.js diff --git a/Gruntfile.js b/Gruntfile.js index b058bf3a06..ffc6609589 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -67,6 +67,7 @@ module.exports = function (grunt) { 'js/dist/alert.js': 'js/src/alert.js', 'js/dist/button.js': 'js/src/button.js', 'js/dist/carousel.js': 'js/src/carousel.js', + 'js/dist/collapse.js': 'js/src/collapse.js', } } }, diff --git a/js/carousel.js b/js/carousel.js deleted file mode 100644 index a38ef14d0b..0000000000 --- a/js/carousel.js +++ /dev/null @@ -1,237 +0,0 @@ -/* ======================================================================== - * Bootstrap: carousel.js v3.3.4 - * http://getbootstrap.com/javascript/#carousel - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // CAROUSEL CLASS DEFINITION - // ========================= - - var Carousel = function (element, options) { - this.$element = $(element) - this.$indicators = this.$element.find('.carousel-indicators') - this.options = options - this.paused = null - this.sliding = null - this.interval = null - this.$active = null - this.$items = null - - this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)) - - this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element - .on('mouseenter.bs.carousel', $.proxy(this.pause, this)) - .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) - } - - Carousel.VERSION = '3.3.4' - - Carousel.TRANSITION_DURATION = 600 - - Carousel.DEFAULTS = { - interval: 5000, - pause: 'hover', - wrap: true, - keyboard: true - } - - Carousel.prototype.keydown = function (e) { - if (/input|textarea/i.test(e.target.tagName)) return - switch (e.which) { - case 37: this.prev(); break - case 39: this.next(); break - default: return - } - - e.preventDefault() - } - - Carousel.prototype.cycle = function (e) { - e || (this.paused = false) - - this.interval && clearInterval(this.interval) - - this.options.interval - && !this.paused - && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) - - return this - } - - Carousel.prototype.getItemIndex = function (item) { - this.$items = item.parent().children('.item') - return this.$items.index(item || this.$active) - } - - Carousel.prototype.getItemForDirection = function (direction, active) { - var activeIndex = this.getItemIndex(active) - var willWrap = (direction == 'prev' && activeIndex === 0) - || (direction == 'next' && activeIndex == (this.$items.length - 1)) - if (willWrap && !this.options.wrap) return active - var delta = direction == 'prev' ? -1 : 1 - var itemIndex = (activeIndex + delta) % this.$items.length - return this.$items.eq(itemIndex) - } - - Carousel.prototype.to = function (pos) { - var that = this - var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) - - if (pos > (this.$items.length - 1) || pos < 0) return - - if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" - if (activeIndex == pos) return this.pause().cycle() - - return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) - } - - Carousel.prototype.pause = function (e) { - e || (this.paused = true) - - if (this.$element.find('.next, .prev').length && $.support.transition) { - this.$element.trigger($.support.transition.end) - this.cycle(true) - } - - this.interval = clearInterval(this.interval) - - return this - } - - Carousel.prototype.next = function () { - if (this.sliding) return - return this.slide('next') - } - - Carousel.prototype.prev = function () { - if (this.sliding) return - return this.slide('prev') - } - - Carousel.prototype.slide = function (type, next) { - var $active = this.$element.find('.item.active') - var $next = next || this.getItemForDirection(type, $active) - var isCycling = this.interval - var direction = type == 'next' ? 'left' : 'right' - var that = this - - if ($next.hasClass('active')) return (this.sliding = false) - - var relatedTarget = $next[0] - var slideEvent = $.Event('slide.bs.carousel', { - relatedTarget: relatedTarget, - direction: direction - }) - this.$element.trigger(slideEvent) - if (slideEvent.isDefaultPrevented()) return - - this.sliding = true - - isCycling && this.pause() - - if (this.$indicators.length) { - this.$indicators.find('.active').removeClass('active') - var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]) - $nextIndicator && $nextIndicator.addClass('active') - } - - var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid" - if ($.support.transition && this.$element.hasClass('slide')) { - $next.addClass(type) - $next[0].offsetWidth // force reflow - $active.addClass(direction) - $next.addClass(direction) - $active - .one('bsTransitionEnd', function () { - $next.removeClass([type, direction].join(' ')).addClass('active') - $active.removeClass(['active', direction].join(' ')) - that.sliding = false - setTimeout(function () { - that.$element.trigger(slidEvent) - }, 0) - }) - .emulateTransitionEnd(Carousel.TRANSITION_DURATION) - } else { - $active.removeClass('active') - $next.addClass('active') - this.sliding = false - this.$element.trigger(slidEvent) - } - - isCycling && this.cycle() - - return this - } - - - // CAROUSEL PLUGIN DEFINITION - // ========================== - - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.carousel') - var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) - var action = typeof option == 'string' ? option : options.slide - - if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) - if (typeof option == 'number') data.to(option) - else if (action) data[action]() - else if (options.interval) data.pause().cycle() - }) - } - - var old = $.fn.carousel - - $.fn.carousel = Plugin - $.fn.carousel.Constructor = Carousel - - - // CAROUSEL NO CONFLICT - // ==================== - - $.fn.carousel.noConflict = function () { - $.fn.carousel = old - return this - } - - - // CAROUSEL DATA-API - // ================= - - var clickHandler = function (e) { - var href - var $this = $(this) - var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7 - if (!$target.hasClass('carousel')) return - var options = $.extend({}, $target.data(), $this.data()) - var slideIndex = $this.attr('data-slide-to') - if (slideIndex) options.interval = false - - Plugin.call($target, options) - - if (slideIndex) { - $target.data('bs.carousel').to(slideIndex) - } - - e.preventDefault() - } - - $(document) - .on('click.bs.carousel.data-api', '[data-slide]', clickHandler) - .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler) - - $(window).on('load', function () { - $('[data-ride="carousel"]').each(function () { - var $carousel = $(this) - Plugin.call($carousel, $carousel.data()) - }) - }) - -}(jQuery); diff --git a/js/collapse.js b/js/collapse.js deleted file mode 100644 index 954513c5e1..0000000000 --- a/js/collapse.js +++ /dev/null @@ -1,211 +0,0 @@ -/* ======================================================================== - * Bootstrap: collapse.js v3.3.4 - * http://getbootstrap.com/javascript/#collapse - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // COLLAPSE PUBLIC CLASS DEFINITION - // ================================ - - var Collapse = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, Collapse.DEFAULTS, options) - this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + - '[data-toggle="collapse"][data-target="#' + element.id + '"]') - this.transitioning = null - - if (this.options.parent) { - this.$parent = this.getParent() - } else { - this.addAriaAndCollapsedClass(this.$element, this.$trigger) - } - - if (this.options.toggle) this.toggle() - } - - Collapse.VERSION = '3.3.4' - - Collapse.TRANSITION_DURATION = 350 - - Collapse.DEFAULTS = { - toggle: true - } - - Collapse.prototype.dimension = function () { - var hasWidth = this.$element.hasClass('width') - return hasWidth ? 'width' : 'height' - } - - Collapse.prototype.show = function () { - if (this.transitioning || this.$element.hasClass('in')) return - - var activesData - var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing') - - if (actives && actives.length) { - activesData = actives.data('bs.collapse') - if (activesData && activesData.transitioning) return - } - - var startEvent = $.Event('show.bs.collapse') - this.$element.trigger(startEvent) - if (startEvent.isDefaultPrevented()) return - - if (actives && actives.length) { - Plugin.call(actives, 'hide') - activesData || actives.data('bs.collapse', null) - } - - var dimension = this.dimension() - - this.$element - .removeClass('collapse') - .addClass('collapsing')[dimension](0) - .attr('aria-expanded', true) - - this.$trigger - .removeClass('collapsed') - .attr('aria-expanded', true) - - this.transitioning = 1 - - var complete = function () { - this.$element - .removeClass('collapsing') - .addClass('collapse in')[dimension]('') - this.transitioning = 0 - this.$element - .trigger('shown.bs.collapse') - } - - if (!$.support.transition) return complete.call(this) - - var scrollSize = $.camelCase(['scroll', dimension].join('-')) - - this.$element - .one('bsTransitionEnd', $.proxy(complete, this)) - .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) - } - - Collapse.prototype.hide = function () { - if (this.transitioning || !this.$element.hasClass('in')) return - - var startEvent = $.Event('hide.bs.collapse') - this.$element.trigger(startEvent) - if (startEvent.isDefaultPrevented()) return - - var dimension = this.dimension() - - this.$element[dimension](this.$element[dimension]())[0].offsetHeight - - this.$element - .addClass('collapsing') - .removeClass('collapse in') - .attr('aria-expanded', false) - - this.$trigger - .addClass('collapsed') - .attr('aria-expanded', false) - - this.transitioning = 1 - - var complete = function () { - this.transitioning = 0 - this.$element - .removeClass('collapsing') - .addClass('collapse') - .trigger('hidden.bs.collapse') - } - - if (!$.support.transition) return complete.call(this) - - this.$element - [dimension](0) - .one('bsTransitionEnd', $.proxy(complete, this)) - .emulateTransitionEnd(Collapse.TRANSITION_DURATION) - } - - Collapse.prototype.toggle = function () { - this[this.$element.hasClass('in') ? 'hide' : 'show']() - } - - Collapse.prototype.getParent = function () { - return $(this.options.parent) - .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') - .each($.proxy(function (i, element) { - var $element = $(element) - this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element) - }, this)) - .end() - } - - Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) { - var isOpen = $element.hasClass('in') - - $element.attr('aria-expanded', isOpen) - $trigger - .toggleClass('collapsed', !isOpen) - .attr('aria-expanded', isOpen) - } - - function getTargetFromTrigger($trigger) { - var href - var target = $trigger.attr('data-target') - || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 - - return $(target) - } - - - // COLLAPSE PLUGIN DEFINITION - // ========================== - - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.collapse') - var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) - - if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false - if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - var old = $.fn.collapse - - $.fn.collapse = Plugin - $.fn.collapse.Constructor = Collapse - - - // COLLAPSE NO CONFLICT - // ==================== - - $.fn.collapse.noConflict = function () { - $.fn.collapse = old - return this - } - - - // COLLAPSE DATA-API - // ================= - - $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { - var $this = $(this) - - if (!$this.attr('data-target')) e.preventDefault() - - var $target = getTargetFromTrigger($this) - var data = $target.data('bs.collapse') - var option = data ? 'toggle' : $this.data() - - Plugin.call($target, option) - }) - -}(jQuery); diff --git a/js/dist/alert.js.map b/js/dist/alert.js.map index 4d8c6173e5..a313bd0853 100644 --- a/js/dist/alert.js.map +++ b/js/dist/alert.js.map @@ -1 +1 @@ -{"version":3,"sources":["js/src/alert.js"],"names":[],"mappings":";;;;;;;;;;;;;AAUA,IAAM,KAAK,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;;AASpB,MAAM,IAAI,GAAkB,OAAO,CAAA;AACnC,MAAM,OAAO,GAAe,OAAO,CAAA;AACnC,MAAM,QAAQ,GAAc,UAAU,CA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Q,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;;;WA9FG,KAAK;;;;;;;;;AAyGX,GAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CACZ,KAAK,CAAC,KAAK,EACX,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":"js/src/alert.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0): 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'\n const DATA_KEY = 'bs.alert'\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.bs.alert',\n CLOSED : 'closed.bs.alert',\n CLICK : 'click.bs.alert.data-api'\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 // 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\n // private\n\n _getRootElement(element) {\n let parent = false\n let selector = Util.getSelectorFromElement(element)\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 var closeEvent = $.Event(Event.CLOSE)\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, this._destroyElement.bind(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,\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":["js/src/alert.js"],"names":[],"mappings":";;;;;;;;;;;;;AAUA,IAAM,KAAK,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;;AASpB,MAAM,IAAI,GAAkB,OAAO,CAAA;AACnC,MAAM,OAAO,GAAe,OAAO,CAAA;AACnC,MAAM,QAAQ,GAAc,UAAU,CAAA;AACtC,MAAM,kBAAkB,GAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;AACtC,MAAM,mBAAmB,GAAG,GAAG,CAAA;;AAE/B,MAAM,QAAQ,GAAG;AACf,WAAO,EAAG,wBAAwB;GACnC,CAAA;;AAED,MAAM,KAAK,GAAG;AACZ,SAAK,EAAI,gBAAgB;AACzB,UAAM,EAAG,iBAAiB;AAC1B,SAAK,EAAI,yBAAyB;GACnC,CAAA;;AAED,MAAM,SAAS,GAAG;AAChB,SAAK,EAAG,OAAO;AACf,QAAI,EAAI,MAAM;AACd,MAAE,EAAM,IAAI;GACb,CAAA;;;;;;;;MASK,KAAK;AAEE,aAFP,KAAK,CAEG,OAAO,EAAE;4BAFjB,KAAK;;AAGP,UAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;KACxB;;iBAJG,KAAK;;;;;aASJ,eAAC,OAAO,EAAE;AACb,eAAO,GAAG,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAA;;AAElC,YAAI,WAAW,GAAG,IAAI,CAAC,eAAe,CAAC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AK,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":"js/src/alert.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0): 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'\n const DATA_KEY = 'bs.alert'\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.bs.alert',\n CLOSED : 'closed.bs.alert',\n CLICK : 'click.bs.alert.data-api'\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 // 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\n // private\n\n _getRootElement(element) {\n let parent = false\n let selector = Util.getSelectorFromElement(element)\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 var closeEvent = $.Event(Event.CLOSE)\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, this._destroyElement.bind(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,\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.map b/js/dist/button.js.map index ac111ccf43..2ba0e11c7d 100644 --- a/js/dist/button.js.map +++ b/js/dist/button.js.map @@ -1 +1 @@ -{"version":3,"sources":["js/src/button.js"],"names":[],"mappings":";;;;;;;;;;;;;AAOA,IAAM,MAAM,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;;AASrB,MAAM,IAAI,GAAkB,QAAQ,CAAA;AACpC,MAAM,OAAO,GAAe,OAAO,CAAA;AACnC,MAAM,QAAQ,GAAc,WAAW,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,CAAA,CAAE,MAAM,CAAC,CAAA","file":"js/src/button.js","sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0): 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'\n const DATA_KEY = 'bs.button'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 150\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 : 'click.bs.button.data-api',\n FOCUS_BLUR : 'focus.bs.button.data-api blur.bs.button.data-api'\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 // 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 } 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\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, Selector.DATA_TOGGLE_CARROT, function (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, Selector.DATA_TOGGLE_CARROT, function (event) {\n var 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":["js/src/button.js"],"names":[],"mappings":";;;;;;;;;;;;;AAOA,IAAM,MAAM,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;;AASrB,MAAM,IAAI,GAAkB,QAAQ,CAAA;AACpC,MAAM,OAAO,GAAe,OAAO,CAAA;AACnC,MAAM,QAAQ,GAAc,WAAW,CAAA;AACvC,MAAM,kBAAkB,GAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;AACtC,MAAM,mBAAmB,GAAG,GAAG,CAAA;;AAE/B,MAAM,SAAS,GAAG;AAChB,UAAM,EAAG,QAAQ;AACjB,UAAM,EAAG,KAAK;AACd,SAAK,EAAI,OAAO;GACjB,C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AC,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;AACzC,YAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;KAC5C;;AAED,UAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAA;GAClD,CAAC,CACD,EAAE,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,kBAAkB,EAAE,UAAU,KAAK,EAAE;AAClE,QAAI,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACxD,KAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;GACxE,CAAC,CAAA;;;;;;;;AASJ,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAe,MAAM,CAAC,gBAAgB,CAAA;AAChD,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,GAAG,MAAM,CAAA;AAC/B,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,GAAI,YAAY;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":"js/src/button.js","sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0): 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'\n const DATA_KEY = 'bs.button'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 150\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 : 'click.bs.button.data-api',\n FOCUS_BLUR : 'focus.bs.button.data-api blur.bs.button.data-api'\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 // 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 } 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\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, Selector.DATA_TOGGLE_CARROT, function (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, Selector.DATA_TOGGLE_CARROT, function (event) {\n var 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 55fd16024f..026e74316a 100644 --- a/js/dist/carousel.js +++ b/js/dist/carousel.js @@ -26,11 +26,11 @@ var Carousel = (function ($) { var TRANSITION_DURATION = 600; var Defaults = { - 'interval': 5000, - 'keyboard': true, - 'slide': false, - 'pause': 'hover', - 'wrap': true + interval: 5000, + keyboard: true, + slide: false, + pause: 'hover', + wrap: true }; var Direction = { diff --git a/js/dist/carousel.js.map b/js/dist/carousel.js.map index 12b48721a0..f0565e167e 100644 --- a/js/dist/carousel.js.map +++ b/js/dist/carousel.js.map @@ -1 +1 @@ -{"version":3,"sources":["js/src/carousel.js"],"names":[],"mappings":";;;;;;;;;;;;;AAUA,IAAM,QAAQ,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;;AASvB,MAAM,IAAI,GAAkB,UAAU,CAAA;AACtC,MAAM,OAAO,GAAe,OAAO,CAAA;AACnC,MAAM,QAAQ,GAAc,aAAa,CAAA;AACzC,MAAM,kBAAkB,GAAI,CAAC,CAAC,EAAE,CAAC,IA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I,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":"js/src/carousel.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0): 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'\n const DATA_KEY = 'bs.carousel'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 600\n\n const Defaults = {\n 'interval' : 5000,\n 'keyboard' : true,\n 'slide' : false,\n 'pause' : 'hover',\n 'wrap' : true\n }\n\n const Direction = {\n NEXT : 'next',\n PREVIOUS : 'prev'\n }\n\n const Event = {\n SLIDE : 'slide.bs.carousel',\n SLID : 'slid.bs.carousel',\n CLICK : 'click.bs.carousel.data-api',\n LOAD : 'load'\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\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 = config\n this._element = $(element)[0]\n this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0]\n\n this._addEventListeners()\n\n }\n\n\n // public\n\n next() {\n if (!this._isSliding) {\n this._slide(Direction.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 this.next.bind(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 var direction = index > activeIndex ?\n Direction.NEXT :\n Direction.PREVIOUS\n\n this._slide(direction, this._items[index])\n }\n\n\n // private\n\n _addEventListeners() {\n if (this._config.keyboard) {\n $(this._element)\n .on('keydown.bs.carousel', this._keydown.bind(this))\n }\n\n if (this._config.pause == 'hover' && \n !('ontouchstart' in document.documentElement)) {\n $(this._element)\n .on('mouseenter.bs.carousel', this.pause.bind(this))\n .on('mouseleave.bs.carousel', this.cycle.bind(this))\n }\n }\n\n _keydown(event) {\n event.preventDefault()\n\n if (/input|textarea/i.test(event.target.tagName)) return\n\n switch (event.which) {\n case 37: this.prev(); break\n case 39: this.next(); break\n default: 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: 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 = !!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 var 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({}, Defaults, $(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\n } else if (action) {\n data[action]()\n\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\n let slideIndex = this.getAttribute('data-slide-to')\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, Selector.DATA_SLIDE, Carousel._dataApiClickHandler)\n\n $(window).on(Event.LOAD, function () {\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":["js/src/carousel.js"],"names":[],"mappings":";;;;;;;;;;;;;AAUA,IAAM,QAAQ,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;;AASvB,MAAM,IAAI,GAAkB,UAAU,CAAA;AACtC,MAAM,OAAO,GAAe,OAAO,CAAA;AACnC,MAAM,QAAQ,GAAc,aAAa,CAAA;AACzC,MAAM,kBAAkB,GAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;AACtC,MAAM,mBAAmB,GAAG,GAAG,CAAA;;AAE/B,MAAM,QAAQ,GAAG;AACf,YAAQ,EAAG,IAAI;AACf,YAA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,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":"js/src/carousel.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0): 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'\n const DATA_KEY = 'bs.carousel'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 600\n\n const Defaults = {\n interval : 5000,\n keyboard : true,\n slide : false,\n pause : 'hover',\n wrap : true\n }\n\n const Direction = {\n NEXT : 'next',\n PREVIOUS : 'prev'\n }\n\n const Event = {\n SLIDE : 'slide.bs.carousel',\n SLID : 'slid.bs.carousel',\n CLICK : 'click.bs.carousel.data-api',\n LOAD : 'load'\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\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 = config\n this._element = $(element)[0]\n this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0]\n\n this._addEventListeners()\n\n }\n\n\n // public\n\n next() {\n if (!this._isSliding) {\n this._slide(Direction.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 this.next.bind(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 var direction = index > activeIndex ?\n Direction.NEXT :\n Direction.PREVIOUS\n\n this._slide(direction, this._items[index])\n }\n\n\n // private\n\n _addEventListeners() {\n if (this._config.keyboard) {\n $(this._element)\n .on('keydown.bs.carousel', this._keydown.bind(this))\n }\n\n if (this._config.pause == 'hover' &&\n !('ontouchstart' in document.documentElement)) {\n $(this._element)\n .on('mouseenter.bs.carousel', this.pause.bind(this))\n .on('mouseleave.bs.carousel', this.cycle.bind(this))\n }\n }\n\n _keydown(event) {\n event.preventDefault()\n\n if (/input|textarea/i.test(event.target.tagName)) return\n\n switch (event.which) {\n case 37: this.prev(); break\n case 39: this.next(); break\n default: 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: 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 = !!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 var 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({}, Defaults, $(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\n } else if (action) {\n data[action]()\n\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\n let slideIndex = this.getAttribute('data-slide-to')\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, Selector.DATA_SLIDE, Carousel._dataApiClickHandler)\n\n $(window).on(Event.LOAD, function () {\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 new file mode 100644 index 0000000000..a537f426e6 --- /dev/null +++ b/js/dist/collapse.js @@ -0,0 +1,322 @@ +'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'); } } + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): collapse.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + +var Collapse = (function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'collapse'; + var VERSION = '4.0.0'; + var DATA_KEY = 'bs.collapse'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 600; + + var Defaults = { + toggle: true, + parent: null + }; + + var Event = { + SHOW: 'show.bs.collapse', + SHOWN: 'shown.bs.collapse', + HIDE: 'hide.bs.collapse', + HIDDEN: 'hidden.bs.collapse', + CLICK: 'click.bs.collapse.data-api' + }; + + var ClassName = { + IN: 'in', + COLLAPSE: 'collapse', + COLLAPSING: 'collapsing', + COLLAPSED: 'collapsed' + }; + + var Dimension = { + WIDTH: 'width', + HEIGHT: 'height' + }; + + var Selector = { + ACTIVES: '.panel > .in, .panel > .collapsing', + DATA_TOGGLE: '[data-toggle="collapse"]' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Collapse = (function () { + function Collapse(element, config) { + _classCallCheck(this, Collapse); + + this._isTransitioning = false; + this._element = element; + this._config = $.extend({}, Defaults, config); + this._triggerArray = $.makeArray($('[data-toggle="collapse"][href="#' + element.id + '"],' + ('[data-toggle="collapse"][data-target="#' + element.id + '"]'))); + + this._parent = this._config.parent ? this._getParent() : null; + + if (!this._config.parent) { + this._addAriaAndCollapsedClass(this._element, this._triggerArray); + } + + if (this._config.toggle) { + this.toggle(); + } + } + + _createClass(Collapse, [{ + key: 'toggle', + + // public + + value: function toggle() { + if ($(this._element).hasClass(ClassName.IN)) { + this.hide(); + } else { + this.show(); + } + } + }, { + key: 'show', + value: function show() { + var _this = this; + + if (this._isTransitioning || $(this._element).hasClass(ClassName.IN)) { + return; + } + + var activesData = undefined; + var actives = undefined; + + if (this._parent) { + actives = $.makeArray($(Selector.ACTIVES)); + if (!actives.length) { + actives = null; + } + } + + if (actives) { + activesData = $(actives).data(DATA_KEY); + if (activesData && activesData._isTransitioning) { + return; + } + } + + var startEvent = $.Event(Event.SHOW); + $(this._element).trigger(startEvent); + if (startEvent.isDefaultPrevented()) { + return; + } + + if (actives) { + Collapse._jQueryInterface.call($(actives), 'hide'); + if (!activesData) { + $(actives).data(DATA_KEY, null); + } + } + + var dimension = this._getDimension(); + + $(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING); + + this._element.style[dimension] = 0; + this._element.setAttribute('aria-expanded', true); + + if (this._triggerArray.length) { + $(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true); + } + + this.setTransitioning(true); + + var complete = function complete() { + $(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.IN); + + _this._element.style[dimension] = ''; + + _this.setTransitioning(false); + + $(_this._element).trigger(Event.SHOWN); + }; + + if (!Util.supportsTransitionEnd()) { + complete(); + return; + } + + var scrollSize = 'scroll' + (dimension[0].toUpperCase() + dimension.slice(1)); + + $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + + this._element.style[dimension] = this._element[scrollSize] + 'px'; + } + }, { + key: 'hide', + value: function hide() { + var _this2 = this; + + if (this._isTransitioning || !$(this._element).hasClass(ClassName.IN)) { + return; + } + + var startEvent = $.Event(Event.HIDE); + $(this._element).trigger(startEvent); + if (startEvent.isDefaultPrevented()) { + return; + } + + var dimension = this._getDimension(); + var offsetDimension = dimension === Dimension.WIDTH ? 'offsetWidth' : 'offsetHeight'; + + this._element.style[dimension] = this._element[offsetDimension] + 'px'; + + Util.reflow(this._element); + + $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.IN); + + this._element.setAttribute('aria-expanded', false); + + if (this._triggerArray.length) { + $(this._triggerArray).addClass(ClassName.COLLAPSED).attr('aria-expanded', false); + } + + this.setTransitioning(true); + + var complete = function complete() { + _this2.setTransitioning(false); + $(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN); + }; + + this._element.style[dimension] = 0; + + if (!Util.supportsTransitionEnd()) { + return complete(); + } + + $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + } + }, { + key: 'setTransitioning', + value: function setTransitioning(isTransitioning) { + this._isTransitioning = isTransitioning; + } + }, { + key: '_getDimension', + + // private + + value: function _getDimension() { + var hasWidth = $(this._element).hasClass(Dimension.WIDTH); + return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT; + } + }, { + key: '_getParent', + value: 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; + } + }, { + 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); + } + } + } + }], [{ + key: '_getTargetFromElement', + + // static + + 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({}, Defaults, $this.data(), typeof config === 'object' && config); + + if (!data && _config.toggle && /show|hide/.test(config)) { + _config.toggle = false; + } + + if (!data) { + data = new Collapse(this, _config); + $this.data(DATA_KEY, data); + } + + if (typeof config === 'string') { + data[config](); + } + }); + } + }]); + + return Collapse; + })(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.CLICK, Selector.DATA_TOGGLE, function (event) { + event.preventDefault(); + + var target = Collapse._getTargetFromElement(this); + + var data = $(target).data(DATA_KEY); + var config = data ? 'toggle' : $(this).data(); + + Collapse._jQueryInterface.call($(target), config); + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Collapse._jQueryInterface; + $.fn[NAME].Constructor = Collapse; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Collapse._jQueryInterface; + }; + + return Collapse; +})(jQuery); +//# sourceMappingURL=collapse.js.map \ No newline at end of file diff --git a/js/dist/collapse.js.map b/js/dist/collapse.js.map new file mode 100644 index 0000000000..fbd4445548 --- /dev/null +++ b/js/dist/collapse.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["js/src/collapse.js"],"names":[],"mappings":";;;;;;;;;;;;;AAUA,IAAM,QAAQ,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;;AASvB,MAAM,IAAI,GAAkB,UAAU,CAAA;AACtC,MAAM,OAAO,GAAe,OAAO,CAAA;AACnC,MAAM,QAAQ,GAAc,aAAa,CAAA;AACzC,MAAM,kBAAkB,GAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;AACtC,MAAM,mBAAmB,GAAG,GAAG,CAAA;;AAE/B,MAAM,QAAQ,GAAG;AACf,UAAM,EAAG,IAAI;AACb,UAAM,EAAG,IAAI;GACd,CAAA;;AAED,MAAM,KAAK,GAAG;AACZ,QAAI,EAAK,kBAAkB;AAC3B,SAAK,EAAI,mBAAmB;AAC5B,QAAI,EAAK,kBAAkB;AAC3B,UAAM,EAAG,oBAAoB;AAC7B,SAAK,EAAI,4BAA4B;GACtC,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;;AAED,MAA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AAA;AAClC,iBAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;WAC3B;;AAED,cAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAC9B,gBAAI,CAAC,MAAM,CAAC,EAAE,CAAA;WACf;SACF,CAAC,CAAA;OACH;;;WAlPG,QAAQ;;;;;;;;;AA6Pd,GAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,WAAW,EAAE,UAAU,KAAK,EAAE;AACjE,SAAK,CAAC,cAAc,EAAE,CAAA;;AAEtB,QAAI,MAAM,GAAG,QAAQ,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAA;;AAEjD,QAAI,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;AACnC,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":"js/src/collapse.js","sourcesContent":["import Util from './util'\n\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0): 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'\n const DATA_KEY = 'bs.collapse'\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n const TRANSITION_DURATION = 600\n\n const Defaults = {\n toggle : true,\n parent : null\n }\n\n const Event = {\n SHOW : 'show.bs.collapse',\n SHOWN : 'shown.bs.collapse',\n HIDE : 'hide.bs.collapse',\n HIDDEN : 'hidden.bs.collapse',\n CLICK : 'click.bs.collapse.data-api'\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\n this._isTransitioning = false\n this._element = element\n this._config = $.extend({}, Defaults, 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 // 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 activesData\n let actives\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 scrollSize = 'scroll'\n + (dimension[0].toUpperCase()\n + dimension.slice(1))\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 return complete()\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\n // private\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 Defaults,\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 data[config]()\n }\n })\n }\n\n }\n\n\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n $(document).on(Event.CLICK, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault()\n\n let target = Collapse._getTargetFromElement(this)\n\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/src/alert.js b/js/src/alert.js index e5e8eeacb3..a712154ab5 100644 --- a/js/src/alert.js +++ b/js/src/alert.js @@ -80,7 +80,7 @@ const Alert = (($) => { } if (!parent) { - parent = $(element).closest('.' + ClassName.ALERT)[0] + parent = $(element).closest(`.${ClassName.ALERT}`)[0] } return parent diff --git a/js/src/collapse.js b/js/src/collapse.js new file mode 100644 index 0000000000..00ae290979 --- /dev/null +++ b/js/src/collapse.js @@ -0,0 +1,345 @@ +import Util from './util' + + +/** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0): collapse.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + +const Collapse = (($) => { + + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + const NAME = 'collapse' + const VERSION = '4.0.0' + const DATA_KEY = 'bs.collapse' + const JQUERY_NO_CONFLICT = $.fn[NAME] + const TRANSITION_DURATION = 600 + + const Defaults = { + toggle : true, + parent : null + } + + const Event = { + SHOW : 'show.bs.collapse', + SHOWN : 'shown.bs.collapse', + HIDE : 'hide.bs.collapse', + HIDDEN : 'hidden.bs.collapse', + CLICK : 'click.bs.collapse.data-api' + } + + const ClassName = { + IN : 'in', + COLLAPSE : 'collapse', + COLLAPSING : 'collapsing', + COLLAPSED : 'collapsed' + } + + const Dimension = { + WIDTH : 'width', + HEIGHT : 'height' + } + + const Selector = { + ACTIVES : '.panel > .in, .panel > .collapsing', + DATA_TOGGLE : '[data-toggle="collapse"]' + } + + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + class Collapse { + + constructor(element, config) { + + this._isTransitioning = false + this._element = element + this._config = $.extend({}, Defaults, config) + this._triggerArray = $.makeArray($( + `[data-toggle="collapse"][href="#${element.id}"],` + + `[data-toggle="collapse"][data-target="#${element.id}"]` + )) + + this._parent = this._config.parent ? this._getParent() : null + + if (!this._config.parent) { + this._addAriaAndCollapsedClass(this._element, this._triggerArray) + } + + if (this._config.toggle) { + this.toggle() + } + + } + + // public + + toggle() { + if ($(this._element).hasClass(ClassName.IN)) { + this.hide() + } else { + this.show() + } + } + + show() { + if (this._isTransitioning || + $(this._element).hasClass(ClassName.IN)) { + return + } + + let activesData + let actives + + if (this._parent) { + actives = $.makeArray($(Selector.ACTIVES)) + if (!actives.length) { + actives = null + } + } + + if (actives) { + activesData = $(actives).data(DATA_KEY) + if (activesData && activesData._isTransitioning) { + return + } + } + + let startEvent = $.Event(Event.SHOW) + $(this._element).trigger(startEvent) + if (startEvent.isDefaultPrevented()) { + return + } + + if (actives) { + Collapse._jQueryInterface.call($(actives), 'hide') + if (!activesData) { + $(actives).data(DATA_KEY, null) + } + } + + let dimension = this._getDimension() + + $(this._element) + .removeClass(ClassName.COLLAPSE) + .addClass(ClassName.COLLAPSING) + + this._element.style[dimension] = 0 + this._element.setAttribute('aria-expanded', true) + + if (this._triggerArray.length) { + $(this._triggerArray) + .removeClass(ClassName.COLLAPSED) + .attr('aria-expanded', true) + } + + this.setTransitioning(true) + + let complete = () => { + $(this._element) + .removeClass(ClassName.COLLAPSING) + .addClass(ClassName.COLLAPSE) + .addClass(ClassName.IN) + + this._element.style[dimension] = '' + + this.setTransitioning(false) + + $(this._element).trigger(Event.SHOWN) + } + + if (!Util.supportsTransitionEnd()) { + complete() + return + } + + let scrollSize = 'scroll' + + (dimension[0].toUpperCase() + + dimension.slice(1)) + + $(this._element) + .one(Util.TRANSITION_END, complete) + .emulateTransitionEnd(TRANSITION_DURATION) + + this._element.style[dimension] = this._element[scrollSize] + 'px' + } + + hide() { + if (this._isTransitioning || + !$(this._element).hasClass(ClassName.IN)) { + return + } + + let startEvent = $.Event(Event.HIDE) + $(this._element).trigger(startEvent) + if (startEvent.isDefaultPrevented()) { + return + } + + let dimension = this._getDimension() + let offsetDimension = dimension === Dimension.WIDTH ? + 'offsetWidth' : 'offsetHeight' + + this._element.style[dimension] = this._element[offsetDimension] + 'px' + + Util.reflow(this._element) + + $(this._element) + .addClass(ClassName.COLLAPSING) + .removeClass(ClassName.COLLAPSE) + .removeClass(ClassName.IN) + + this._element.setAttribute('aria-expanded', false) + + if (this._triggerArray.length) { + $(this._triggerArray) + .addClass(ClassName.COLLAPSED) + .attr('aria-expanded', false) + } + + this.setTransitioning(true) + + let complete = () => { + this.setTransitioning(false) + $(this._element) + .removeClass(ClassName.COLLAPSING) + .addClass(ClassName.COLLAPSE) + .trigger(Event.HIDDEN) + } + + this._element.style[dimension] = 0 + + if (!Util.supportsTransitionEnd()) { + return complete() + } + + $(this._element) + .one(Util.TRANSITION_END, complete) + .emulateTransitionEnd(TRANSITION_DURATION) + } + + setTransitioning(isTransitioning) { + this._isTransitioning = isTransitioning + } + + + // private + + _getDimension() { + let hasWidth = $(this._element).hasClass(Dimension.WIDTH) + return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT + } + + _getParent() { + let parent = $(this._config.parent)[0] + let selector = + `[data-toggle="collapse"][data-parent="${this._config.parent}"]` + + $(parent).find(selector).each((i, element) => { + this._addAriaAndCollapsedClass( + Collapse._getTargetFromElement(element), + [element] + ) + }) + + return parent + } + + _addAriaAndCollapsedClass(element, triggerArray) { + if (element) { + let isOpen = $(element).hasClass(ClassName.IN) + element.setAttribute('aria-expanded', isOpen) + + if (triggerArray.length) { + $(triggerArray) + .toggleClass(ClassName.COLLAPSED, !isOpen) + .attr('aria-expanded', isOpen) + } + } + } + + + // static + + static _getTargetFromElement(element) { + let selector = Util.getSelectorFromElement(element) + return selector ? $(selector)[0] : null + } + + static _jQueryInterface(config) { + return this.each(function () { + let $this = $(this) + let data = $this.data(DATA_KEY) + let _config = $.extend( + {}, + Defaults, + $this.data(), + typeof config === 'object' && config + ) + + if (!data && _config.toggle && /show|hide/.test(config)) { + _config.toggle = false + } + + if (!data) { + data = new Collapse(this, _config) + $this.data(DATA_KEY, data) + } + + if (typeof config === 'string') { + data[config]() + } + }) + } + + } + + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.CLICK, Selector.DATA_TOGGLE, function (event) { + event.preventDefault() + + let target = Collapse._getTargetFromElement(this) + + let data = $(target).data(DATA_KEY) + let config = data ? 'toggle' : $(this).data() + + Collapse._jQueryInterface.call($(target), config) + }) + + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Collapse._jQueryInterface + $.fn[NAME].Constructor = Collapse + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT + return Collapse._jQueryInterface + } + + return Collapse + +})(jQuery) + +export default Collapse diff --git a/js/tests/index.html b/js/tests/index.html index 0ba54e8023..cc008152fb 100644 --- a/js/tests/index.html +++ b/js/tests/index.html @@ -134,9 +134,9 @@ + - diff --git a/js/tests/unit/collapse.js b/js/tests/unit/collapse.js index 0efa65400d..78fafc6c2d 100644 --- a/js/tests/unit/collapse.js +++ b/js/tests/unit/collapse.js @@ -355,7 +355,7 @@ $(function () { $('
').appendTo($groups.eq(0)) - var $target2 = $('