From e91bfe7df088132432b10dcf8eba8e0f8ffc5d56 Mon Sep 17 00:00:00 2001 From: midzer Date: Wed, 1 Jan 2020 20:54:24 +0100 Subject: [PATCH] introduce rollup bundler --- dist/bootstrap-native-v4.js | 3915 ++++++++++++++-------------- dist/bootstrap-native-v4.min.js | 3 +- lib/src/.babelrc | 10 + lib/src/alert-native.js | 4 +- lib/src/button-native.js | 4 +- lib/src/carousel-native.js | 4 +- lib/src/collapse-native.js | 4 +- lib/src/dropdown-native.js | 8 +- lib/src/index.js | 3 +- lib/src/modal-native.js | 4 +- lib/src/popover-native.js | 10 +- lib/src/scrollspy-native.js | 4 +- lib/src/tab-native.js | 4 +- lib/src/toast-native.js | 4 +- lib/src/tooltip-native.js | 4 +- lib/src/util/callbacks.js | 16 +- lib/src/util/globals.js | 4 + lib/src/util/init.js | 5 + lib/src/util/misc.js | 14 +- lib/src/util/selector.js | 2 +- lib/src/util/transition.js | 2 +- package-lock.json | 4244 +++++++++++++++++++++++++++++++ package.json | 19 +- rollup.config.js | 41 + 24 files changed, 6265 insertions(+), 2067 deletions(-) create mode 100644 lib/src/.babelrc create mode 100644 lib/src/util/globals.js create mode 100644 lib/src/util/init.js create mode 100644 package-lock.json create mode 100644 rollup.config.js diff --git a/dist/bootstrap-native-v4.js b/dist/bootstrap-native-v4.js index dd642a2d..998f3e74 100644 --- a/dist/bootstrap-native-v4.js +++ b/dist/bootstrap-native-v4.js @@ -1,2236 +1,2124 @@ -// Native JavaScript for Bootstrap 4 v2.0.28 | © dnp_theme | MIT-License -(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD support: - define([], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like: - module.exports = factory(); - } else { - // Browser globals (root is window) - var bsn = factory(); - root.Alert = bsn.Alert; - root.Button = bsn.Button; - root.Carousel = bsn.Carousel; - root.Collapse = bsn.Collapse; - root.Dropdown = bsn.Dropdown; - root.Modal = bsn.Modal; - root.Popover = bsn.Popover; - root.ScrollSpy = bsn.ScrollSpy; - root.Tab = bsn.Tab; - root.Toast = bsn.Toast; - root.Tooltip = bsn.Tooltip; +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, (global.bootstrap = global.bootstrap || {}, global.bootstrap.native = factory())); +}(this, (function () { 'use strict'; + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } } -}(this, function () { - - /* Native JavaScript for Bootstrap 4 | Internal Utility Functions - ----------------------------------------------------------------*/ - "use strict"; - + // globals - var globalObject = typeof global !== 'undefined' ? global : this||window, - DOC = document, HTML = DOC.documentElement, body = 'body', // allow the library to be used in - - // Native JavaScript for Bootstrap Global Object - BSN = globalObject.BSN = {}, - supports = BSN.supports = [], - - // function toggle attributes - dataToggle = 'data-toggle', - dataDismiss = 'data-dismiss', - dataSpy = 'data-spy', - dataRide = 'data-ride', - - // components - stringAlert = 'Alert', - stringButton = 'Button', - stringCarousel = 'Carousel', - stringCollapse = 'Collapse', - stringDropdown = 'Dropdown', - stringModal = 'Modal', - stringPopover = 'Popover', - stringScrollSpy = 'ScrollSpy', - stringTab = 'Tab', - stringTooltip = 'Tooltip', - stringToast = 'Toast', - - // options DATA API - dataAutohide = 'data-autohide', - databackdrop = 'data-backdrop', - dataKeyboard = 'data-keyboard', - dataTarget = 'data-target', - dataInterval = 'data-interval', - dataHeight = 'data-height', - dataPause = 'data-pause', - dataTitle = 'data-title', - dataOriginalTitle = 'data-original-title', - dataDismissible = 'data-dismissible', - dataTrigger = 'data-trigger', - dataAnimation = 'data-animation', - dataContainer = 'data-container', - dataPlacement = 'data-placement', - dataDelay = 'data-delay', - - // option keys - backdrop = 'backdrop', keyboard = 'keyboard', delay = 'delay', - content = 'content', target = 'target', currentTarget = 'currentTarget', - interval = 'interval', pause = 'pause', animation = 'animation', - placement = 'placement', container = 'container', template = 'template', - - // box model - offsetTop = 'offsetTop', offsetBottom = 'offsetBottom', - offsetLeft = 'offsetLeft', - scrollTop = 'scrollTop', scrollLeft = 'scrollLeft', - clientWidth = 'clientWidth', clientHeight = 'clientHeight', - offsetWidth = 'offsetWidth', offsetHeight = 'offsetHeight', - innerWidth = 'innerWidth', innerHeight = 'innerHeight', - scrollHeight = 'scrollHeight', height = 'height', - - // aria - ariaExpanded = 'aria-expanded', - ariaHidden = 'aria-hidden', - ariaSelected = 'aria-selected', - - // event names - clickEvent = 'click', - focusEvent = 'focus', - hoverEvent = 'hover', - keydownEvent = 'keydown', - keyupEvent = 'keyup', - resizeEvent = 'resize', // passive - scrollEvent = 'scroll', // passive - mouseHover = ('onmouseleave' in DOC) ? [ 'mouseenter', 'mouseleave'] : [ 'mouseover', 'mouseout' ], - // touch since 2.0.26 - touchEvents = { start: 'touchstart', end: 'touchend', move:'touchmove' }, // passive - // originalEvents - showEvent = 'show', - shownEvent = 'shown', - hideEvent = 'hide', - hiddenEvent = 'hidden', - closeEvent = 'close', - closedEvent = 'closed', - slidEvent = 'slid', - slideEvent = 'slide', - changeEvent = 'change', - // custom events related - defaultPrevented = 'defaultPrevented', - - // other - getAttribute = 'getAttribute', - setAttribute = 'setAttribute', - removeAttribute = 'removeAttribute', - hasAttribute = 'hasAttribute', - createElement = 'createElement', - appendChild = 'appendChild', - innerHTML = 'innerHTML', - getElementsByTagName = 'getElementsByTagName', - preventDefault = 'preventDefault', - getBoundingClientRect = 'getBoundingClientRect', - querySelectorAll = 'querySelectorAll', - getElementsByCLASSNAME = 'getElementsByClassName', - getComputedStyle = 'getComputedStyle', - - indexOf = 'indexOf', - parentNode = 'parentNode', - length = 'length', - toLowerCase = 'toLowerCase', - Transition = 'Transition', - Duration = 'Duration', - Webkit = 'Webkit', - style = 'style', - push = 'push', - tabindex = 'tabindex', - contains = 'contains', - - active = 'active', - showClass = 'show', - collapsing = 'collapsing', - disabled = 'disabled', - loading = 'loading', - left = 'left', - right = 'right', - top = 'top', - bottom = 'bottom', - - // tooltip / popover - tipPositions = /\b(top|bottom|left|right)+/, - - // modal - fixedTop = 'fixed-top', - fixedBottom = 'fixed-bottom', - - // transitionEnd since 2.0.4 - supportTransitions = Webkit+Transition in HTML[style] || Transition[toLowerCase]() in HTML[style], - transitionEndEvent = Webkit+Transition in HTML[style] ? Webkit[toLowerCase]()+Transition+'End' : Transition[toLowerCase]()+'end', - transitionDuration = Webkit+Duration in HTML[style] ? Webkit[toLowerCase]()+Transition+Duration : Transition[toLowerCase]()+Duration, - - // set new focus element since 2.0.3 - setFocus = function(element){ - element.focus ? element.focus() : element.setActive(); - }, - - // class manipulation, since 2.0.0 requires polyfill.js - addClass = function(element,classNAME) { - element.classList.add(classNAME); - }, - removeClass = function(element,classNAME) { - element.classList.remove(classNAME); - }, - hasClass = function(element,classNAME){ // since 2.0.0 - return element.classList[contains](classNAME); - }, - - // selection methods - getElementsByClassName = function(element,classNAME) { // returns Array - return [].slice.call(element[getElementsByCLASSNAME]( classNAME )); - }, - queryElement = function (selector, parent) { - var lookUp = parent ? parent : DOC; - return typeof selector === 'object' ? selector : lookUp.querySelector(selector); - }, - getClosest = function (element, selector) { //element is the element and selector is for the closest parent element to find - // source http://gomakethings.com/climbing-up-and-down-the-dom-tree-with-vanilla-javascript/ - var firstChar = selector.charAt(0), selectorSubstring = selector.substr(1); - if ( firstChar === '.' ) {// If selector is a class - for ( ; element && element !== DOC; element = element[parentNode] ) { // Get closest match - if ( queryElement(selector,element[parentNode]) !== null && hasClass(element,selectorSubstring) ) { return element; } - } - } else if ( firstChar === '#' ) { // If selector is an ID - for ( ; element && element !== DOC; element = element[parentNode] ) { // Get closest match - if ( element.id === selectorSubstring ) { return element; } - } - } - return false; - }, - - // event attach jQuery style / trigger since 1.2.0 - on = function (element, event, handler, options) { - options = options || false; - element.addEventListener(event, handler, options); - }, - off = function(element, event, handler, options) { - options = options || false; - element.removeEventListener(event, handler, options); - }, - one = function (element, event, handler, options) { // one since 2.0.4 - on(element, event, function handlerWrapper(e){ - if (e[target] === element) { - handler(e); - off(element, event, handlerWrapper, options); - } - }, options); - }, - // determine support for passive events - supportPassive = (function(){ - // Test via a getter in the options object to see if the passive property is accessed - var result = false; - try { - var opts = Object.defineProperty({}, 'passive', { - get: function() { - result = true; - } - }); - one(globalObject, null, null, opts); - } catch (e) {} - - return result; - }()), - // event options - // https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection - passiveHandler = supportPassive ? { passive: true } : false, - // transitions - getTransitionDurationFromElement = function(element) { - var duration = supportTransitions ? globalObject[getComputedStyle](element)[transitionDuration] : 0; - duration = parseFloat(duration); - duration = typeof duration === 'number' && !isNaN(duration) ? duration * 1000 : 0; - return duration; // we take a short offset to make sure we fire on the next frame after animation - }, - emulateTransitionEnd = function(element,handler){ // emulateTransitionEnd since 2.0.4 - var called = 0, duration = getTransitionDurationFromElement(element); - duration ? one(element, transitionEndEvent, function(e){ !called && handler(e), called = 1; }) - : setTimeout(function() { !called && handler(), called = 1; }, 17); - }, - bootstrapCustomEvent = function (eventName, componentName, related) { - var OriginalCustomEvent = new CustomEvent( eventName + '.bs.' + componentName, {cancelable: true}); - OriginalCustomEvent.relatedTarget = related; - return OriginalCustomEvent; - }, - dispatchCustomEvent = function(customEvent){ - this.dispatchEvent(customEvent); - }, - - // tooltip / popover stuff - getScroll = function() { // also Affix and ScrollSpy uses it - return { - y : globalObject.pageYOffset || HTML[scrollTop], - x : globalObject.pageXOffset || HTML[scrollLeft] + //const globalObject = typeof global !== 'undefined' ? global : window; + //const BSN = globalObject.BSN = {}; + var supports = + /*globalObject.BSN.supports =*/ + []; + + function addClass(element, classNAME) { + element.classList.add(classNAME); + } + function removeClass(element, classNAME) { + element.classList.remove(classNAME); + } + function hasClass(element, classNAME) { + return element.classList.contains(classNAME); + } + + // event names + var touchEvents = { + start: 'touchstart', + end: 'touchend', + move: 'touchmove', + cancel: 'touchcancel' + }; + var mouseHover = 'onmouseleave' in document ? ['mouseenter', 'mouseleave'] : ['mouseover', 'mouseout']; // attach | detach handlers + + function on(element, event, handler, options) { + options = options || false; + element.addEventListener(event, handler, options); + } + function off(element, event, handler, options) { + options = options || false; + element.removeEventListener(event, handler, options); + } + function one(element, event, handler, options) { + on(element, event, function handlerWrapper(e) { + if (e.target === element) { + handler(e); + off(element, event, handlerWrapper, options); } - }, - styleTip = function(link,element,position,parent) { // both popovers and tooltips (target,tooltip,placement,elementToAppendTo) - var elementDimensions = { w : element[offsetWidth], h: element[offsetHeight] }, - windowWidth = (HTML[clientWidth] || DOC[body][clientWidth]), - windowHeight = (HTML[clientHeight] || DOC[body][clientHeight]), - rect = link[getBoundingClientRect](), - scroll = parent === DOC[body] ? getScroll() : { x: parent[offsetLeft] + parent[scrollLeft], y: parent[offsetTop] + parent[scrollTop] }, - linkDimensions = { w: rect[right] - rect[left], h: rect[bottom] - rect[top] }, - isPopover = hasClass(element,'popover'), - topPosition, leftPosition, - - arrow = queryElement('.arrow',element), - arrowTop, arrowLeft, arrowWidth, arrowHeight, - - halfTopExceed = rect[top] + linkDimensions.h/2 - elementDimensions.h/2 < 0, - halfLeftExceed = rect[left] + linkDimensions.w/2 - elementDimensions.w/2 < 0, - halfRightExceed = rect[left] + elementDimensions.w/2 + linkDimensions.w/2 >= windowWidth, - halfBottomExceed = rect[top] + elementDimensions.h/2 + linkDimensions.h/2 >= windowHeight, - topExceed = rect[top] - elementDimensions.h < 0, - leftExceed = rect[left] - elementDimensions.w < 0, - bottomExceed = rect[top] + elementDimensions.h + linkDimensions.h >= windowHeight, - rightExceed = rect[left] + elementDimensions.w + linkDimensions.w >= windowWidth; - - // recompute position - position = (position === left || position === right) && leftExceed && rightExceed ? top : position; // first, when both left and right limits are exceeded, we fall back to top|bottom - position = position === top && topExceed ? bottom : position; - position = position === bottom && bottomExceed ? top : position; - position = position === left && leftExceed ? right : position; - position = position === right && rightExceed ? left : position; - - // update tooltip/popover class - element.className[indexOf](position) === -1 && (element.className = element.className.replace(tipPositions,position)); - - // we check the computed width & height and update here - arrowWidth = arrow[offsetWidth]; arrowHeight = arrow[offsetHeight]; - - // apply styling to tooltip or popover - if ( position === left || position === right ) { // secondary|side positions - if ( position === left ) { // LEFT - leftPosition = rect[left] + scroll.x - elementDimensions.w - ( isPopover ? arrowWidth : 0 ); - } else { // RIGHT - leftPosition = rect[left] + scroll.x + linkDimensions.w; - } - - // adjust top and arrow - if (halfTopExceed) { - topPosition = rect[top] + scroll.y; - arrowTop = linkDimensions.h/2 - arrowWidth; - } else if (halfBottomExceed) { - topPosition = rect[top] + scroll.y - elementDimensions.h + linkDimensions.h; - arrowTop = elementDimensions.h - linkDimensions.h/2 - arrowWidth; - } else { - topPosition = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2; - arrowTop = elementDimensions.h/2 - (isPopover ? arrowHeight*0.9 : arrowHeight/2); - } - } else if ( position === top || position === bottom ) { // primary|vertical positions - if ( position === top) { // TOP - topPosition = rect[top] + scroll.y - elementDimensions.h - ( isPopover ? arrowHeight : 0 ); - } else { // BOTTOM - topPosition = rect[top] + scroll.y + linkDimensions.h; - } - // adjust left | right and also the arrow - if (halfLeftExceed) { - leftPosition = 0; - arrowLeft = rect[left] + linkDimensions.w/2 - arrowWidth; - } else if (halfRightExceed) { - leftPosition = windowWidth - elementDimensions.w*1.01; - arrowLeft = elementDimensions.w - ( windowWidth - rect[left] ) + linkDimensions.w/2 - arrowWidth/2; - } else { - leftPosition = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2; - arrowLeft = elementDimensions.w/2 - ( isPopover ? arrowWidth : arrowWidth/2 ); + }, options); + } // custom events + + function bootstrapCustomEvent(eventName, componentName, related) { + var OriginalCustomEvent = new CustomEvent(eventName + '.bs.' + componentName, { + cancelable: true + }); + OriginalCustomEvent.relatedTarget = related; + return OriginalCustomEvent; + } + function dispatchCustomEvent(customEvent) { + this.dispatchEvent(customEvent); + } // determine support for passive events + + var supportPassive = function () { + // Test via a getter in the options object to see if the passive property is accessed + var result = false; + + try { + var opts = Object.defineProperty({}, 'passive', { + get: function get() { + result = true; } - } - - // apply style to tooltip/popover and its arrow - element[style][top] = topPosition + 'px'; - element[style][left] = leftPosition + 'px'; - - arrowTop && (arrow[style][top] = arrowTop + 'px'); - arrowLeft && (arrow[style][left] = arrowLeft + 'px'); - }; - - BSN.version = '2.0.28'; - - /* Native JavaScript for Bootstrap 4 | Alert - -------------------------------------------*/ - - // ALERT DEFINITION + }); + one(window, null, null, opts); + } catch (e) {} + + return result; + }(); // event options + // https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection + + var passiveHandler = supportPassive ? { + passive: true + } : false; + + function getElementsByClassName$1(element, classNAME) { + // returns Array + return [].slice.call(element.getElementsByClassName(classNAME)); + } + function queryElement(selector, parent) { + var lookUp = parent ? parent : document; + return selector instanceof Element ? selector : lookUp.querySelector(selector); + } + + var supportTransitions = 'webkitTransition' in document.body.style || 'transition' in document.body.style; + var transitionEndEvent = 'webkitTransition' in document.body.style ? 'webkitTransitionEnd' : 'transitionend'; + var transitionDuration = 'webkitTransition' in document.body.style ? 'webkitTransitionDuration' : 'transitionDuration'; + function getTransitionDurationFromElement(element) { + var duration = supportTransitions ? window.getComputedStyle(element)[transitionDuration] : 0; + duration = parseFloat(duration); + duration = typeof duration === 'number' && !isNaN(duration) ? duration * 1000 : 0; + return duration; // we take a short offset to make sure we fire on the next frame after animation + } + function emulateTransitionEnd(element, handler) { + // emulateTransitionEnd since 2.0.4 + var called = 0, + duration = getTransitionDurationFromElement(element); + duration ? one(element, transitionEndEvent, function (e) { + !called && handler(e), called = 1; + }) : setTimeout(function () { + !called && handler(), called = 1; + }, 17); + } + // ================ - var Alert = function( element ) { - + + var Alert = function Alert(element) { + _classCallCheck(this, Alert); + // initialization element - element = queryElement(element); - - // reset on re-init - element[stringAlert] && element[stringAlert].destroy(); - - // bind, target alert, duration and stuff - var self = this, component = 'alert', - // custom events - closeCustomEvent = bootstrapCustomEvent(closeEvent, component), - closedCustomEvent = bootstrapCustomEvent(closedEvent, component), - alert = getClosest(element,'.'+component), - triggerHandler = function(){ hasClass(alert,'fade') ? emulateTransitionEnd(alert,transitionEndHandler) : transitionEndHandler(); }, - // handlers - clickHandler = function(e){ - alert = getClosest(e[target],'.'+component); - element = queryElement('['+dataDismiss+'="'+component+'"]',alert); - element && alert && (element === e[target] || element[contains](e[target])) && self.close(); - }, - transitionEndHandler = function(){ - off(element, clickEvent, clickHandler); // detach it's listener - alert[parentNode].removeChild(alert); - dispatchCustomEvent.call(alert,closedCustomEvent); - }; - - // public method - self.close = function() { - if ( alert && element && hasClass(alert,showClass) ) { - dispatchCustomEvent.call(alert,closeCustomEvent); - if ( closeCustomEvent[defaultPrevented] ) return; + element = queryElement(element); // reset on re-init + + element.Alert && element.Alert.destroy(); // bind, target alert, duration and stuff + + var self = this, + // custom events + closeCustomEvent = bootstrapCustomEvent('close', 'alert'), + closedCustomEvent = bootstrapCustomEvent('closed', 'alert'), + // handlers + triggerHandler = function triggerHandler() { + hasClass(alert, 'fade') ? emulateTransitionEnd(alert, transitionEndHandler) : transitionEndHandler(); + }, + clickHandler = function clickHandler(e) { + alert = e.target.closest(".alert"); + element = queryElement("[data-dismiss=\"alert\"]", alert); + element && alert && (element === e.target || element.contains(e.target)) && self.close(); + }, + transitionEndHandler = function transitionEndHandler() { + off(element, 'click', clickHandler); // detach it's listener + + alert.parentNode.removeChild(alert); + dispatchCustomEvent.call(alert, closedCustomEvent); + }; // public method + + + self.close = function () { + if (alert && element && hasClass(alert, 'show')) { + dispatchCustomEvent.call(alert, closeCustomEvent); + if (closeCustomEvent.defaultPrevented) return; self.destroy(); } }; - self.destroy = function() { - removeClass(alert,showClass); + + self.destroy = function () { + removeClass(alert, 'show'); alert && triggerHandler(); - off(element, clickEvent, clickHandler); - delete element[stringAlert]; - }; - - // init - if ( !(stringAlert in element ) ) { // prevent adding event handlers twice - on(element, clickEvent, clickHandler); - } - element[stringAlert] = self; - }; - - // ALERT DATA API - // ============== - supports[push]([stringAlert, Alert, '['+dataDismiss+'="alert"]']); - - - /* Native JavaScript for Bootstrap 4 | Button - ---------------------------------------------*/ - - // BUTTON DEFINITION + off(element, 'click', clickHandler); + delete element.Alert; + }; // init + + + if (!element.Alert) { + // prevent adding event handlers twice + on(element, 'click', clickHandler); + } // find the parent alert + + + var alert = element.closest(".alert"); // store init object within target element + + self.element = element; + element.Alert = self; + }; // ALERT DATA API + supports.push(['Alert', Alert, '[data-dismiss="alert"]']); + // =================== - var Button = function( element ) { - + + var Button = function Button(element) { + _classCallCheck(this, Button); + // initialization element - element = queryElement(element); - - // reset on re-init - element[stringButton] && element[stringButton].destroy(); - + element = queryElement(element); // reset on re-init + + element.Button && element.Button.destroy(); // constant + + var toggled = false; // toggled makes sure to prevent triggering twice the change.bs.button events // bind + var self = this, - // constant - toggled = false, // toggled makes sure to prevent triggering twice the change.bs.button events - - // strings - component = 'button', - checked = 'checked', - LABEL = 'LABEL', - INPUT = 'INPUT', - // changeEvent - changeCustomEvent = bootstrapCustomEvent(changeEvent, component), - + changeCustomEvent = bootstrapCustomEvent('change', 'button'), // private methods - keyHandler = function(e){ - var key = e.which || e.keyCode; - key === 32 && e[target] === DOC.activeElement && toggle(e); - }, - preventScroll = function(e){ - var key = e.which || e.keyCode; - key === 32 && e[preventDefault](); - }, - toggle = function(e) { - var label = e[target].tagName === LABEL ? e[target] : e[target][parentNode].tagName === LABEL ? e[target][parentNode] : null; // the .btn label - - if ( !label ) return; //react if a label or its immediate child is clicked - - var labels = getElementsByClassName(label[parentNode],'btn'), // all the button group buttons - input = label[getElementsByTagName](INPUT)[0]; - - if ( !input ) return; // return if no input found - - dispatchCustomEvent.call(input, changeCustomEvent); // trigger the change for the input - dispatchCustomEvent.call(element, changeCustomEvent); // trigger the change for the btn-group - - // manage the dom manipulation - if ( input.type === 'checkbox' ) { //checkboxes - if ( changeCustomEvent[defaultPrevented] ) return; // discontinue when defaultPrevented is true - - if ( !input[checked] ) { - addClass(label,active); - input[getAttribute](checked); - input[setAttribute](checked,checked); - input[checked] = true; - } else { - removeClass(label,active); - input[getAttribute](checked); - input.removeAttribute(checked); - input[checked] = false; - } - - if (!toggled) { // prevent triggering the event twice - toggled = true; - } - } - - if ( input.type === 'radio' && !toggled ) { // radio buttons - if ( changeCustomEvent[defaultPrevented] ) return; - // don't trigger if already active (the OR condition is a hack to check if the buttons were selected with key press and NOT mouse click) - if ( !input[checked] || (e.screenX === 0 && e.screenY == 0) ) { - addClass(label,active); - addClass(label,focusEvent); - input[setAttribute](checked,checked); - input[checked] = true; - - toggled = true; - for (var i = 0, ll = labels[length]; i 1 && action(element, touchEvents.start, touchDownHandler, passiveHandler); + rightArrow && action(rightArrow, 'click', controlsHandler); + leftArrow && action(leftArrow, 'click', controlsHandler); + indicator && action(indicator, 'click', indicatorHandler); + self.options.keyboard && action(window, 'keydown', keyHandler); + }, + // touch events + toggleTouchEvents = function toggleTouchEvents(action) { + action(element, touchEvents.move, touchMoveHandler, passiveHandler); + action(element, touchEvents.end, touchEndHandler, passiveHandler); + }, + touchDownHandler = function touchDownHandler(e) { + if (isTouch) { + return; + } + + startXPosition = parseInt(e.touches[0].pageX); + + if (element.contains(e.target)) { + isTouch = true; + toggleTouchEvents(on); + } + }, + touchMoveHandler = function touchMoveHandler(e) { + if (!isTouch) { + e.preventDefault(); + return; + } + + currentXPosition = parseInt(e.touches[0].pageX); //cancel touch if more than one touches detected + + if (e.type === 'touchmove' && e.touches.length > 1) { + e.preventDefault(); + return false; + } + }, + touchEndHandler = function touchEndHandler(e) { + if (!isTouch || isSliding) { + return; + } + + endXPosition = currentXPosition || parseInt(e.touches[0].pageX); + + if (isTouch) { + if ((!element.contains(e.target) || !element.contains(e.relatedTarget)) && Math.abs(startXPosition - endXPosition) < 75) { + return false; + } else { + if (currentXPosition < startXPosition) { index++; - break; - case 37: + } else if (currentXPosition > startXPosition) { index--; - break; - default: return; - } - self.slideTo( index ); //Do the slide - }, - toggleEvents = function(action){ - if ( self[pause] && self[interval] ) { - action( element, mouseHover[0], pauseHandler ); - action( element, mouseHover[1], resumeHandler ); - action( element, touchEvents.start, pauseHandler, passiveHandler ); - action( element, touchEvents.end, resumeHandler, passiveHandler ); - } - - slides[length] > 1 && action( element, touchEvents.start, touchDownHandler, passiveHandler ); - - rightArrow && action( rightArrow, clickEvent, controlsHandler ); - leftArrow && action( leftArrow, clickEvent, controlsHandler ); - - indicator && action( indicator, clickEvent, indicatorHandler ); - self[keyboard] && action( globalObject, keydownEvent, keyHandler ); - }, - // touch events - toggleTouchEvents = function(action){ - action( element, touchEvents.move, touchMoveHandler, passiveHandler ); - action( element, touchEvents.end, touchEndHandler, passiveHandler ); - }, - touchDownHandler = function(e) { - if ( isTouch ) { return; } - - startXPosition = parseInt(e.touches[0].pageX); - - if ( element.contains(e[target]) ) { - isTouch = true; - toggleTouchEvents(on); - } - }, - touchMoveHandler = function(e) { - if ( !isTouch ) { e.preventDefault(); return; } - - currentXPosition = parseInt(e.touches[0].pageX); - - //cancel touch if more than one touches detected - if ( e.type === 'touchmove' && e.touches[length] > 1 ) { - e.preventDefault(); - return false; - } - }, - touchEndHandler = function(e) { - if ( !isTouch || isSliding ) { return } - - endXPosition = currentXPosition || parseInt( e.touches[0].pageX ); - - if ( isTouch ) { - if ( (!element.contains(e[target]) || !element.contains(e.relatedTarget) ) && Math.abs(startXPosition - endXPosition) < 75 ) { - return false; - } else { - if ( currentXPosition < startXPosition ) { - index++; - } else if ( currentXPosition > startXPosition ) { - index--; - } - isTouch = false; - self.slideTo(index); } - toggleTouchEvents(off); - } - }, - - // private methods - isElementInScrollRange = function () { - var rect = element[getBoundingClientRect](), - viewportHeight = globalObject[innerHeight] || HTML[clientHeight] - return rect[top] <= viewportHeight && rect[bottom] >= 0; // bottom && top - }, - setActivePage = function( pageIndex ) { //indicators - for ( var i = 0, icl = indicators[length]; i < icl; i++ ) { - removeClass(indicators[i],active); + + isTouch = false; + self.slideTo(index); } - if (indicators[pageIndex]) addClass(indicators[pageIndex], active); - }; - - - // public methods - self.cycle = function() { + + toggleTouchEvents(off); + } + }, + // private methods + isElementInScrollRange = function isElementInScrollRange() { + var rect = element.getBoundingClientRect(), + viewportHeight = window.innerHeight || document.documentElement.clientHeight; + return rect.top <= viewportHeight && rect.bottom >= 0; // bottom && top + }, + setActivePage = function setActivePage(pageIndex) { + //indicators + for (var i = 0, icl = indicators.length; i < icl; i++) { + removeClass(indicators[i], 'active'); + } + + if (indicators[pageIndex]) addClass(indicators[pageIndex], 'active'); + }; // public methods + + + self.cycle = function () { if (timer) { clearInterval(timer); timer = null; } - - timer = setInterval(function() { - isElementInScrollRange() && (index++, self.slideTo( index ) ); - }, self[interval]); + + timer = setInterval(function () { + isElementInScrollRange() && (index++, self.slideTo(index)); + }, self.options.interval); }; - self.slideTo = function( next ) { + + self.slideTo = function (next) { if (isSliding) return; // when controled via methods, make sure to check again - - var activeItem = self.getActiveIndex(), // the current active - orientation; - - // first return if we're on the same item #227 - if ( activeItem === next ) { - return; - // or determine slideDirection - } else if ( (activeItem < next ) || (activeItem === 0 && next === total -1 ) ) { - slideDirection = self[direction] = left; // next - } else if ( (activeItem > next) || (activeItem === total - 1 && next === 0 ) ) { - slideDirection = self[direction] = right; // prev - } - - // find the right next index - if ( next < 0 ) { next = total - 1; } - else if ( next >= total ){ next = 0; } - - // update index + // the current active and orientation + + var activeItem = self.getActiveIndex(), + orientation; // first return if we're on the same item #227 + + if (activeItem === next) { + return; // or determine slideDirection + } else if (activeItem < next || activeItem === 0 && next === total - 1) { + slideDirection = self.direction = 'left'; // next + } else if (activeItem > next || activeItem === total - 1 && next === 0) { + slideDirection = self.direction = 'right'; // prev + } // find the right next index + + + if (next < 0) { + next = total - 1; + } else if (next >= total) { + next = 0; + } // update index + + index = next; - - orientation = slideDirection === left ? 'next' : 'prev'; // determine type - - slideCustomEvent = bootstrapCustomEvent(slideEvent, component, slides[next]); - slidCustomEvent = bootstrapCustomEvent(slidEvent, component, slides[next]); - + orientation = slideDirection === 'left' ? 'next' : 'prev'; // determine type + + slideCustomEvent = bootstrapCustomEvent('slide', 'carousel', slides[next]); + slidCustomEvent = bootstrapCustomEvent('slid', 'carousel', slides[next]); dispatchCustomEvent.call(element, slideCustomEvent); // here we go with the slide - if (slideCustomEvent[defaultPrevented]) return; // discontinue when prevented - + + if (slideCustomEvent.defaultPrevented) return; // discontinue when prevented + isSliding = true; clearInterval(timer); timer = null; - setActivePage( next ); - - if ( supportTransitions && hasClass(element,'slide') ) { - - addClass(slides[next],carouselItem +'-'+ orientation); - slides[next][offsetWidth]; - addClass(slides[next],carouselItem +'-'+ slideDirection); - addClass(slides[activeItem],carouselItem +'-'+ slideDirection); - - emulateTransitionEnd(slides[next], function(e) { - var timeout = e && e[target] !== slides[next] ? e.elapsedTime*1000+100 : 20; - - isSliding && setTimeout(function(){ + setActivePage(next); + + if (supportTransitions && hasClass(element, 'slide')) { + addClass(slides[next], "carousel-item-".concat(orientation)); + slides[next].offsetWidth; + addClass(slides[next], "carousel-item-".concat(slideDirection)); + addClass(slides[activeItem], "carousel-item-".concat(slideDirection)); + emulateTransitionEnd(slides[next], function (e) { + var timeout = e && e.target !== slides[next] ? e.elapsedTime * 1000 + 100 : 20; + isSliding && setTimeout(function () { isSliding = false; - - addClass(slides[next],active); - removeClass(slides[activeItem],active); - - removeClass(slides[next],carouselItem +'-'+ orientation); - removeClass(slides[next],carouselItem +'-'+ slideDirection); - removeClass(slides[activeItem],carouselItem +'-'+ slideDirection); - + addClass(slides[next], 'active'); + removeClass(slides[activeItem], 'active'); + removeClass(slides[next], "carousel-item-".concat(orientation)); + removeClass(slides[next], "carousel-item-".concat(slideDirection)); + removeClass(slides[activeItem], "carousel-item-".concat(slideDirection)); dispatchCustomEvent.call(element, slidCustomEvent); - - if ( !DOC.hidden && self[interval] && !hasClass(element,paused) ) { + + if (!document.hidden && self.options.interval && !hasClass(element, 'paused')) { self.cycle(); } }, timeout); }); - } else { - addClass(slides[next],active); - slides[next][offsetWidth]; - removeClass(slides[activeItem],active); - setTimeout(function() { + addClass(slides[next], 'active'); + slides[next].offsetWidth; + removeClass(slides[activeItem], 'active'); + setTimeout(function () { isSliding = false; - if ( self[interval] && !hasClass(element,paused) ) { + + if (self.options.interval && !hasClass(element, 'paused')) { self.cycle(); } + dispatchCustomEvent.call(element, slidCustomEvent); - }, 100 ); + }, 100); } }; + self.getActiveIndex = function () { - return slides[indexOf](getElementsByClassName(element,carouselItem+' active')[0]) || 0; + return slides.indexOf(getElementsByClassName$1(element, 'carousel-item active')[0]) || 0; }; + self.destroy = function () { toggleEvents(off); clearInterval(timer); - delete element[stringCarousel]; - }; - - // init - if ( !element[stringCarousel] ) { // prevent adding event handlers twice + delete element.Carousel; + }; // init + + + if (!element.Carousel) { + // prevent adding event handlers twice toggleEvents(on); - } - // set first slide active if none - if (self.getActiveIndex()<0) { - slides[length] && addClass(slides[0],active); - indicators[length] && setActivePage(0); - } - // start to cycle if set - if ( self[interval] ){ self.cycle(); } - - element[stringCarousel] = self; + } // set first slide active if none + + + if (self.getActiveIndex() < 0) { + slides.length && addClass(slides[0], 'active'); + indicators.length && setActivePage(0); + } // start to cycle if set + + + if (self.options.interval) { + self.cycle(); + } // associate init object to target + + + self.element = element; + element.Carousel = self; }; - - // CAROUSEL DATA API // ================= - supports[push]( [ stringCarousel, Carousel, '['+dataRide+'="carousel"]' ] ); - - - /* Native JavaScript for Bootstrap 4 | Collapse - -----------------------------------------------*/ - - // COLLAPSE DEFINITION + + supports.push(['Carousel', Carousel, '[data-ride="carousel"]']); + // =================== - var Collapse = function( element, options ) { - + + var Collapse = function Collapse(element, options) { + _classCallCheck(this, Collapse); + // initialization element - element = queryElement(element); - - // reset on re-init - element[stringCollapse] && element[stringCollapse].destroy(); - - // set options - options = options || {}; - - // bind, event targets and constants - var self = this, - accordion = null, collapse = null, - accordionData = element[getAttribute]('data-parent'), - activeCollapse, activeElement, - - // component strings - component = 'collapse', - collapsed = 'collapsed', - isAnimating = 'isAnimating', - - // custom events - showCustomEvent = bootstrapCustomEvent(showEvent, component), - shownCustomEvent = bootstrapCustomEvent(shownEvent, component), - hideCustomEvent = bootstrapCustomEvent(hideEvent, component), - hiddenCustomEvent = bootstrapCustomEvent(hiddenEvent, component), - - // private methods - openAction = function(collapseElement,toggle) { - dispatchCustomEvent.call(collapseElement, showCustomEvent); - if ( showCustomEvent[defaultPrevented] ) return; - collapseElement[isAnimating] = true; - addClass(collapseElement,collapsing); - removeClass(collapseElement,component); - collapseElement[style][height] = collapseElement[scrollHeight] + 'px'; - - emulateTransitionEnd(collapseElement, function() { - collapseElement[isAnimating] = false; - collapseElement[setAttribute](ariaExpanded,'true'); - toggle[setAttribute](ariaExpanded,'true'); - removeClass(collapseElement,collapsing); - addClass(collapseElement, component); - addClass(collapseElement,showClass); - collapseElement[style][height] = ''; - dispatchCustomEvent.call(collapseElement, shownCustomEvent); - }); - }, - closeAction = function(collapseElement,toggle) { - dispatchCustomEvent.call(collapseElement, hideCustomEvent); - if ( hideCustomEvent[defaultPrevented] ) return; - collapseElement[isAnimating] = true; - collapseElement[style][height] = collapseElement[scrollHeight] + 'px'; // set height first - removeClass(collapseElement,component); - removeClass(collapseElement,showClass); - addClass(collapseElement,collapsing); - collapseElement[offsetWidth]; // force reflow to enable transition - collapseElement[style][height] = '0px'; - - emulateTransitionEnd(collapseElement, function() { - collapseElement[isAnimating] = false; - collapseElement[setAttribute](ariaExpanded,'false'); - toggle[setAttribute](ariaExpanded,'false'); - removeClass(collapseElement,collapsing); - addClass(collapseElement,component); - collapseElement[style][height] = ''; - dispatchCustomEvent.call(collapseElement, hiddenCustomEvent); - }); - }, - getTarget = function() { - var href = element.href && element[getAttribute]('href'), - parent = element[getAttribute](dataTarget), - id = href || ( parent && parent.charAt(0) === '#' ) && parent; - return id && queryElement(id); - }; - - // public methods - self.toggle = function(e) { - e[preventDefault](); - if (!hasClass(collapse,showClass)) { self.show(); } - else { self.hide(); } + element = queryElement(element); // reset on re-init + + element.Collapse && element.Collapse.destroy(); // set options + + options = options || {}; // target practice + + var accordion = null, + collapse = null, + activeCollapse, + activeElement; // bind, event targets and constants + + var self = this, + // DATA API + accordionData = element.getAttribute('data-parent'), + // custom events + showCustomEvent = bootstrapCustomEvent('show', 'collapse'), + shownCustomEvent = bootstrapCustomEvent('shown', 'collapse'), + hideCustomEvent = bootstrapCustomEvent('hide', 'collapse'), + hiddenCustomEvent = bootstrapCustomEvent('hidden', 'collapse'), + // private methods + openAction = function openAction(collapseElement, toggle) { + dispatchCustomEvent.call(collapseElement, showCustomEvent); + if (showCustomEvent.defaultPrevented) return; + collapseElement.isAnimating = true; + addClass(collapseElement, 'collapsing'); + removeClass(collapseElement, 'collapse'); + collapseElement.style.height = "".concat(collapseElement.scrollHeight, "px"); + emulateTransitionEnd(collapseElement, function () { + collapseElement.isAnimating = false; + collapseElement.setAttribute('aria-expanded', 'true'); + toggle.setAttribute('aria-expanded', 'true'); + removeClass(collapseElement, 'collapsing'); + addClass(collapseElement, 'collapse'); + addClass(collapseElement, 'show'); + collapseElement.style.height = ''; + dispatchCustomEvent.call(collapseElement, shownCustomEvent); + }); + }, + closeAction = function closeAction(collapseElement, toggle) { + dispatchCustomEvent.call(collapseElement, hideCustomEvent); + if (hideCustomEvent.defaultPrevented) return; + collapseElement.isAnimating = true; + collapseElement.style.height = "".concat(collapseElement.scrollHeight, "px"); // set height first + + removeClass(collapseElement, 'collapse'); + removeClass(collapseElement, 'show'); + addClass(collapseElement, 'collapsing'); + collapseElement.offsetWidth; // force reflow to enable transition + + collapseElement.style.height = '0px'; + emulateTransitionEnd(collapseElement, function () { + collapseElement.isAnimating = false; + collapseElement.setAttribute('aria-expanded', 'false'); + toggle.setAttribute('aria-expanded', 'false'); + removeClass(collapseElement, 'collapsing'); + addClass(collapseElement, 'collapse'); + collapseElement.style.height = ''; + dispatchCustomEvent.call(collapseElement, hiddenCustomEvent); + }); + }, + getTarget = function getTarget() { + var href = element.href && element.getAttribute('href'), + parent = element.getAttribute('data-target'), + id = href || parent && parent.charAt(0) === '#' && parent; + return id && queryElement(id); + }; // public methods + + + self.toggle = function (e) { + e.preventDefault(); + + if (!hasClass(collapse, 'show')) { + self.show(); + } else { + self.hide(); + } }; - self.hide = function() { - if ( collapse[isAnimating] ) return; - closeAction(collapse,element); - addClass(element,collapsed); + + self.hide = function () { + if (collapse.isAnimating) return; + closeAction(collapse, element); + addClass(element, 'collapsed'); }; - self.show = function() { - if ( accordion ) { - activeCollapse = queryElement('.'+component+'.'+showClass,accordion); - activeElement = activeCollapse && (queryElement('['+dataTarget+'="#'+activeCollapse.id+'"]',accordion) - || queryElement('[href="#'+activeCollapse.id+'"]',accordion) ); - } - - if ( !collapse[isAnimating] || activeCollapse && !activeCollapse[isAnimating] ) { - if ( activeElement && activeCollapse !== collapse ) { - closeAction(activeCollapse,activeElement); - addClass(activeElement,collapsed); + + self.show = function () { + if (accordion) { + activeCollapse = queryElement(".collapse.show", accordion); + activeElement = activeCollapse && (queryElement("[data-target=\"#".concat(activeCollapse.id, "\"]"), accordion) || queryElement("[href=\"#".concat(activeCollapse.id, "\"]"), accordion)); + } + + if (!collapse.isAnimating || activeCollapse && !activeCollapse.isAnimating) { + if (activeElement && activeCollapse !== collapse) { + closeAction(activeCollapse, activeElement); + addClass(activeElement, 'collapsed'); } - openAction(collapse,element); - removeClass(element,collapsed); + + openAction(collapse, element); + removeClass(element, 'collapsed'); } }; - self.destroy = function() { - off(element, clickEvent, self.toggle); - delete element[stringCollapse]; - } - - // init - if ( !element[stringCollapse] ) { // prevent adding event handlers twice - on(element, clickEvent, self.toggle); - } + + self.destroy = function () { + off(element, 'click', self.toggle); + delete element.Collapse; + }; // init + + + if (!element.Collapse) { + // prevent adding event handlers twice + on(element, 'click', self.toggle); + } // determine targets + + collapse = getTarget(); - collapse[isAnimating] = false; // when true it will prevent click handlers - accordion = queryElement(options.parent) || accordionData && getClosest(element, accordionData); - element[stringCollapse] = self; + collapse.isAnimating = false; // when true it will prevent click handlers + + accordion = queryElement(options.parent) || accordionData && element.closest(accordionData); // associations + + collapse && (self.collapse = collapse); + accordion && (self.options = {}, self.options.parent = accordion); // associate target to init object + + self.element = element; + element.Collapse = self; }; - - // COLLAPSE DATA API // ================= - supports[push]( [ stringCollapse, Collapse, '['+dataToggle+'="collapse"]' ] ); - - - /* Native JavaScript for Bootstrap 4 | Dropdown - ----------------------------------------------*/ - - // DROPDOWN DEFINITION + + supports.push(['Collapse', Collapse, '[data-toggle="collapse"]']); + + function setFocus(element) { + element.focus ? element.focus() : element.setActive(); + } + function getScroll() { + // also Affix and ScrollSpy uses it + return { + y: window.pageYOffset || document.documentElement.scrollTop, + x: window.pageXOffset || document.documentElement.scrollLeft + }; + } + var tipPositions = /\b(top|bottom|left|right)+/; + function styleTip(link, element, position, parent) { + // both popovers and tooltips (target,tooltip,placement,elementToAppendTo) + var elementDimensions = { + w: element.offsetWidth, + h: element.offsetHeight + }, + windowWidth = HTML.clientWidth || document.body.clientWidth, + windowHeight = HTML.clientHeight || document.body.clientHeight, + rect = link.getBoundingClientRect(), + scroll = parent === document.body ? getScroll() : { + x: parent.offsetLeft + parent.scrollLeft, + y: parent.offsetTop + parent.scrollTop + }, + linkDimensions = { + w: rect.right - rect.left, + h: rect.bottom - rect.top + }, + isPopover = hasClass(element, 'popover'), + arrow = queryElement('.arrow', element), + halfTopExceed = rect.top + linkDimensions.h / 2 - elementDimensions.h / 2 < 0, + halfLeftExceed = rect.left + linkDimensions.w / 2 - elementDimensions.w / 2 < 0, + halfRightExceed = rect.left + elementDimensions.w / 2 + linkDimensions.w / 2 >= windowWidth, + halfBottomExceed = rect.top + elementDimensions.h / 2 + linkDimensions.h / 2 >= windowHeight, + topExceed = rect.top - elementDimensions.h < 0, + leftExceed = rect.left - elementDimensions.w < 0, + bottomExceed = rect.top + elementDimensions.h + linkDimensions.h >= windowHeight, + rightExceed = rect.left + elementDimensions.w + linkDimensions.w >= windowWidth; // recompute position + + position = (position === 'left' || position === 'right') && leftExceed && rightExceed ? 'top' : position; // first, when both left and right limits are exceeded, we fall back to top|bottom + + position = position === 'top' && topExceed ? 'bottom' : position; + position = position === 'bottom' && bottomExceed ? 'top' : position; + position = position === 'left' && leftExceed ? 'right' : position; + position = position === 'right' && rightExceed ? 'left' : position; + var topPosition, leftPosition, arrowTop, arrowLeft, arrowWidth, arrowHeight; // update tooltip/popover class + + element.className.indexOf(position) === -1 && (element.className = element.className.replace(tipPositions, position)); // we check the computed width & height and update here + + arrowWidth = arrow.offsetWidth; + arrowHeight = arrow.offsetHeight; // apply styling to tooltip or popover + + if (position === 'left' || position === 'right') { + // secondary|side positions + if (position === 'left') { + // LEFT + leftPosition = rect.left + scroll.x - elementDimensions.w - (isPopover ? arrowWidth : 0); + } else { + // RIGHT + leftPosition = rect.left + scroll.x + linkDimensions.w; + } // adjust top and arrow + + + if (halfTopExceed) { + topPosition = rect.top + scroll.y; + arrowTop = linkDimensions.h / 2 - arrowWidth; + } else if (halfBottomExceed) { + topPosition = rect.top + scroll.y - elementDimensions.h + linkDimensions.h; + arrowTop = elementDimensions.h - linkDimensions.h / 2 - arrowWidth; + } else { + topPosition = rect.top + scroll.y - elementDimensions.h / 2 + linkDimensions.h / 2; + arrowTop = elementDimensions.h / 2 - (isPopover ? arrowHeight * 0.9 : arrowHeight / 2); + } + } else if (position === top || position === bottom) { + // primary|vertical positions + if (position === top) { + // TOP + topPosition = rect.top + scroll.y - elementDimensions.h - (isPopover ? arrowHeight : 0); + } else { + // BOTTOM + topPosition = rect.top + scroll.y + linkDimensions.h; + } // adjust left | right and also the arrow + + + if (halfLeftExceed) { + leftPosition = 0; + arrowLeft = rect.left + linkDimensions.w / 2 - arrowWidth; + } else if (halfRightExceed) { + leftPosition = windowWidth - elementDimensions.w * 1.01; + arrowLeft = elementDimensions.w - (windowWidth - rect.left) + linkDimensions.w / 2 - arrowWidth / 2; + } else { + leftPosition = rect.left + scroll.x - elementDimensions.w / 2 + linkDimensions.w / 2; + arrowLeft = elementDimensions.w / 2 - (isPopover ? arrowWidth : arrowWidth / 2); + } + } // apply style to tooltip/popover and its arrow + + + element.style.top = topPosition + 'px'; + element.style.left = leftPosition + 'px'; + arrowTop && (arrow.style.top = arrowTop + 'px'); + arrowLeft && (arrow.style.left = arrowLeft + 'px'); + } + // =================== - var Dropdown = function( element, option ) { - + + var Dropdown = function Dropdown(element, option) { + _classCallCheck(this, Dropdown); + // initialization element - element = queryElement(element); - - // reset on re-init - element[stringDropdown] && element[stringDropdown].destroy(); - - // constants, event targets, strings + element = queryElement(element); // reset on re-init + + element.Dropdown && element.Dropdown.destroy(); // custom events + + var showCustomEvent, + shownCustomEvent, + hideCustomEvent, + hiddenCustomEvent, + relatedTarget = null; // constants + var self = this, - parent = element[parentNode], - relatedTarget = null, - - // strings - children = 'children', - component = 'dropdown', - open = 'open', - - // custom events - showCustomEvent, shownCustomEvent, hideCustomEvent, hiddenCustomEvent, - - menu = queryElement('.dropdown-menu', parent), - menuItems = (function(){ - var set = menu[children], newSet = []; - for ( var i=0; i1?idx-1:0) - : key === 40 ? (idx 1 ? idx - 1 : 0 : key === 40 ? idx < menuItems.length - 1 ? idx + 1 : idx : idx; + menuItems[idx] && setFocus(menuItems[idx]); + } + + if ((menuItems.length && isMenuItem // menu has items + || !menuItems.length && (isInsideMenu || isSameElement) // menu might be a form + || !isInsideMenu) && // or the focused element is not in the menu at all + element.open && key === 27 // menu must be open + ) { self.toggle(); relatedTarget = null; } - }, - - // private methods - show = function() { - showCustomEvent = bootstrapCustomEvent(showEvent, component, relatedTarget); - dispatchCustomEvent.call(parent, showCustomEvent); - if ( showCustomEvent[defaultPrevented] ) return; - - addClass(menu,showClass); - addClass(parent,showClass); - element[setAttribute](ariaExpanded,true); - element[open] = true; - off(element, clickEvent, clickHandler); - setTimeout(function(){ - setFocus( menu[getElementsByTagName]('INPUT')[0] || element ); // focus the first input item | element - toggleDismiss(); - shownCustomEvent = bootstrapCustomEvent( shownEvent, component, relatedTarget); - dispatchCustomEvent.call(parent, shownCustomEvent); - },1); - }, - hide = function() { - hideCustomEvent = bootstrapCustomEvent(hideEvent, component, relatedTarget); - dispatchCustomEvent.call(parent, hideCustomEvent); - if ( hideCustomEvent[defaultPrevented] ) return; - - removeClass(menu,showClass); - removeClass(parent,showClass); - element[setAttribute](ariaExpanded,false); - element[open] = false; + }, + // private methods + show = function show() { + showCustomEvent = bootstrapCustomEvent('show', 'dropdown', relatedTarget); + dispatchCustomEvent.call(parent, showCustomEvent); + if (showCustomEvent.defaultPrevented) return; + addClass(menu, 'show'); + addClass(parent, 'show'); + element.setAttribute(ariaExpanded, true); + element.open = true; + off(element, 'click', clickHandler); + setTimeout(function () { + setFocus(menu.getElementsByTagName('INPUT')[0] || element); // focus the first input item | element + toggleDismiss(); - setFocus(element); - setTimeout(function(){ on(element, clickEvent, clickHandler); },1); - - hiddenCustomEvent = bootstrapCustomEvent(hiddenEvent, component, relatedTarget); - dispatchCustomEvent.call(parent, hiddenCustomEvent); - }; - - // set initial state to closed - element[open] = false; - - // public methods - self.toggle = function() { - if (hasClass(parent,showClass) && element[open]) { hide(); } - else { show(); } - }; - self.destroy = function(){ - if (hasClass(parent,showClass) && element[open]) { hide(); } - off(element, clickEvent, clickHandler); - delete element[stringDropdown]; + shownCustomEvent = bootstrapCustomEvent('shown', 'dropdown', relatedTarget); + dispatchCustomEvent.call(parent, shownCustomEvent); + }, 1); + }, + hide = function hide() { + hideCustomEvent = bootstrapCustomEvent('hide', 'dropdown', relatedTarget); + dispatchCustomEvent.call(parent, hideCustomEvent); + if (hideCustomEvent.defaultPrevented) return; + removeClass(menu, 'show'); + removeClass(parent, 'show'); + element.setAttribute(ariaExpanded, false); + element.open = false; + toggleDismiss(); + setFocus(element); + setTimeout(function () { + on(element, 'click', clickHandler); + }, 1); + hiddenCustomEvent = bootstrapCustomEvent('hidden', 'dropdown', relatedTarget); + dispatchCustomEvent.call(parent, hiddenCustomEvent); + }; // public methods + + + self.toggle = function () { + if (hasClass(parent, 'show') && element.open) { + hide(); + } else { + show(); + } }; - - // init - if ( !element[stringDropdown] ) { // prevent adding event handlers twice - !tabindex in menu && menu[setAttribute](tabindex, '0'); // Fix onblur on Chrome | Safari - on(element, clickEvent, clickHandler); - } - - // set option - self.persist = option === true || element[getAttribute]('data-persist') === 'true' || false; - - element[stringDropdown] = self; + + self.destroy = function () { + if (hasClass(parent, 'show') && element.open) { + hide(); + } + + off(element, 'click', clickHandler); + delete element.Dropdown; + }; // init + + + if (!element.Dropdown) { + // prevent adding event handlers twice + !('tabindex' in menu) && menu.setAttribute('tabindex', '0'); // Fix onblur on Chrome | Safari + + on(element, 'click', clickHandler); + } // set option + + + self.options = {}; + self.options.persist = option === true || element.getAttribute('data-persist') === 'true' || false; // set initial state to closed + + element.open = false; // associate element with init object + + self.element = element; + element.Dropdown = self; }; - - // DROPDOWN DATA API // ================= - supports[push]( [stringDropdown, Dropdown, '['+dataToggle+'="dropdown"]'] ); - - - /* Native JavaScript for Bootstrap 4 | Modal - -------------------------------------------*/ - - // MODAL DEFINITION + + supports.push(['Dropdown', Dropdown, '[data-toggle="dropdown"]']); + // =============== - var Modal = function(element, options) { // element can be the modal/triggering button - + + var Modal = // element can be the modal/triggering button + function Modal(element, options) { + _classCallCheck(this, Modal); + // the modal (both JavaScript / DATA API init) / triggering button element (DATA API) - element = queryElement(element); - - // bind - var self = this, - - // strings - component = 'modal', - staticString = 'static', - modalTrigger = 'modalTrigger', - paddingRight = 'paddingRight', - modalBackdropString = 'modal-backdrop', - isAnimating = 'isAnimating', - // custom events - showCustomEvent, shownCustomEvent, hideCustomEvent, hiddenCustomEvent, - // determine modal, triggering element - btnCheck = element[getAttribute](dataTarget)||element[getAttribute]('href'), - checkModal = queryElement( btnCheck ), - modal = hasClass(element,component) ? element : checkModal; - - if ( hasClass(element, component) ) { element = null; } // modal is now independent of it's triggering element - - if ( !modal ) { return; } // invalidate - + element = queryElement(element); // custom events + + var showCustomEvent, + shownCustomEvent, + hideCustomEvent, + hiddenCustomEvent, + // event targets and other + relatedTarget = null, + scrollBarWidth, + overlay, + overlayDelay; // bind + + var self = this; // determine modal, triggering element + + btnCheck = element.getAttribute('data-target') || element.getAttribute('href'), checkModal = queryElement(btnCheck), modal = hasClass(element, 'modal') ? element : checkModal; + + if (hasClass(element, 'modal')) { + element = null; + } // modal is now independent of it's triggering element + + + if (!modal) { + return; + } // invalidate // reset on re-init - element && element[stringModal] && element[stringModal].destroy(); - modal[stringModal] && modal[stringModal].destroy(); - - // set options + + + element && element.Modal && element.Modal.destroy(); + modal.Modal && modal.Modal.destroy(); // set options + options = options || {}; - - self[keyboard] = options[keyboard] === false || modal[getAttribute](dataKeyboard) === 'false' ? false : true; - self[backdrop] = options[backdrop] === staticString || modal[getAttribute](databackdrop) === staticString ? staticString : true; - self[backdrop] = options[backdrop] === false || modal[getAttribute](databackdrop) === 'false' ? false : self[backdrop]; - self[animation] = hasClass(modal, 'fade') ? true : false; - self[content] = options[content]; // JavaScript only - + self.options = {}; + self.options.keyboard = options.keyboard === false || modal.getAttribute('data-keyboard') === 'false' ? false : true; + self.options.backdrop = options.backdrop === 'static' || modal.getAttribute('data-backdrop') === 'static' ? 'static' : true; + self.options.backdrop = options.backdrop === false || modal.getAttribute('data-backdrop') === 'false' ? false : self.options.backdrop; + self.options.animation = hasClass(modal, 'fade') ? true : false; + self.options.content = options.content; // JavaScript only // set an initial state of the modal - modal[isAnimating] = false; - - // constants, event targets and other vars - var relatedTarget = null, - scrollBarWidth, overlay, overlayDelay, - - // also find fixed-top / fixed-bottom items - fixedItems = getElementsByClassName(HTML,fixedTop).concat(getElementsByClassName(HTML,fixedBottom)), - - // private methods - setScrollbar = function () { - var openModal = hasClass(DOC[body],component+'-open'), - bodyStyle = globalObject[getComputedStyle](DOC[body]), - bodyPad = parseInt((bodyStyle[paddingRight]), 10), itemPad; - - DOC[body][style][paddingRight] = (bodyPad + (openModal?0:scrollBarWidth)) + 'px'; - modal[style][paddingRight] = (scrollBarWidth?scrollBarWidth+'px':''); - if (fixedItems[length]){ - for (var i = 0; i < fixedItems[length]; i++) { - itemPad = globalObject[getComputedStyle](fixedItems[i])[paddingRight]; - fixedItems[i][style][paddingRight] = ( parseInt(itemPad) + (openModal?0:scrollBarWidth) ) + 'px'; - } - } - }, - resetScrollbar = function () { - DOC[body][style][paddingRight] = ''; - modal[style][paddingRight] = ''; - if (fixedItems[length]){ - for (var i = 0; i < fixedItems[length]; i++) { - fixedItems[i][style][paddingRight] = ''; - } - } - }, - measureScrollbar = function () { // thx walsh - var scrollDiv = DOC[createElement]('div'), widthValue; - scrollDiv.className = component+'-scrollbar-measure'; // this is here to stay - DOC[body][appendChild](scrollDiv); - widthValue = scrollDiv[offsetWidth] - scrollDiv[clientWidth]; - DOC[body].removeChild(scrollDiv); - return widthValue; - }, - checkScrollbar = function () { - scrollBarWidth = measureScrollbar(); - }, - createOverlay = function() { - var newOverlay = DOC[createElement]('div'); - overlay = queryElement('.'+modalBackdropString); - - if ( overlay === null ) { - newOverlay[setAttribute]('class', modalBackdropString + (self[animation] ? ' fade' : '')); - overlay = newOverlay; - DOC[body][appendChild](overlay); - } - return overlay; - }, - removeOverlay = function() { - overlay = queryElement('.'+modalBackdropString); - if ( overlay && !getElementsByClassName(DOC,component+' '+showClass)[0] ) { - DOC[body].removeChild(overlay); overlay = null; - } - overlay === null && (removeClass(DOC[body],component+'-open'), resetScrollbar()); - }, - toggleEvents = function(action){ - action(globalObject, resizeEvent, self.update, passiveHandler); - action(modal, clickEvent, dismissHandler); - action(DOC, keydownEvent, keyHandler); - }, - // triggers - beforeShow = function(){ - modal[style].display = 'block'; - - checkScrollbar(); - setScrollbar(); - !getElementsByClassName(DOC,component+' '+showClass)[0] && addClass(DOC[body],component+'-open'); - - addClass(modal,showClass); - modal[setAttribute](ariaHidden, false); - - hasClass(modal,'fade') ? emulateTransitionEnd(modal, triggerShow) : triggerShow(); - }, - triggerShow = function() { - setFocus(modal); - modal[isAnimating] = false; - - toggleEvents(on); - - shownCustomEvent = bootstrapCustomEvent(shownEvent, component, relatedTarget); - dispatchCustomEvent.call(modal, shownCustomEvent); - }, - triggerHide = function() { - modal[style].display = ''; - element && (setFocus(element)); - - overlay = queryElement('.'+modalBackdropString); - - if (overlay && hasClass(overlay,showClass) && !getElementsByClassName(DOC,component+' '+showClass)[0]) { - removeClass(overlay,showClass); - emulateTransitionEnd(overlay,removeOverlay); - } else { - removeOverlay(); + + modal.isAnimating = false; // also find fixed-top / fixed-bottom items + + var fixedItems = getElementsByClassName$1(document.documentElement, 'fixed-top').concat(getElementsByClassName$1(document.documentElement, 'fixed-bottom')); // private methods + + setScrollbar = function setScrollbar() { + var openModal = hasClass(document.body, 'modal-open'), + bodyStyle = window.getComputedStyle(document.body), + bodyPad = parseInt(bodyStyle.paddingRight, 10); + var itemPad; + document.body.style.paddingRight = "".concat(bodyPad + (openModal ? 0 : scrollBarWidth), "px"); + modal.style.paddingRight = scrollBarWidth ? "".concat(scrollBarWidth, "px") : ''; + + if (fixedItems.length) { + for (var i = 0; i < fixedItems.length; i++) { + itemPad = window.getComputedStyle(fixedItems[i]).paddingRight; + fixedItems[i].style.paddingRight = "".concat(parseInt(itemPad) + (openModal ? 0 : scrollBarWidth), "px"); } - - toggleEvents(off); - - modal[isAnimating] = false; - - hiddenCustomEvent = bootstrapCustomEvent(hiddenEvent, component); - dispatchCustomEvent.call(modal, hiddenCustomEvent); - }, - // handlers - clickHandler = function(e) { - if ( modal[isAnimating] ) return; - - var clickTarget = e[target]; - clickTarget = clickTarget[hasAttribute](dataTarget) || clickTarget[hasAttribute]('href') ? clickTarget : clickTarget[parentNode]; - if ( clickTarget === element && !hasClass(modal,showClass) ) { - modal[modalTrigger] = element; - relatedTarget = element; - self.show(); - e[preventDefault](); - } - }, - keyHandler = function(e) { - if ( modal[isAnimating] ) return; - - if (self[keyboard] && e.which == 27 && hasClass(modal,showClass) ) { - self.hide(); - } - }, - dismissHandler = function(e) { - if ( modal[isAnimating] ) return; - var clickTarget = e[target]; - - if ( hasClass(modal,showClass) && ( clickTarget[parentNode][getAttribute](dataDismiss) === component - || clickTarget[getAttribute](dataDismiss) === component - || clickTarget === modal && self[backdrop] !== staticString ) ) { - self.hide(); relatedTarget = null; - e[preventDefault](); + } + }, resetScrollbar = function resetScrollbar() { + document.body.style.paddingRight = ''; + modal.style.paddingRight = ''; + + if (fixedItems.length) { + for (var i = 0; i < fixedItems.length; i++) { + fixedItems[i].style.paddingRight = ''; } - }; - - // public methods - self.toggle = function() { - if ( hasClass(modal,showClass) ) {self.hide();} else {self.show();} + } + }, measureScrollbar = function measureScrollbar() { + var scrollDiv = document.createElement('div'); + var widthValue; + scrollDiv.className = 'modal-scrollbar-measure'; // this is here to stay + + document.body.appendChild(scrollDiv); + widthValue = scrollDiv.offsetWidth - scrollDiv.clientWidth; + document.body.removeChild(scrollDiv); + return widthValue; + }, checkScrollbar = function checkScrollbar() { + scrollBarWidth = measureScrollbar(); + }, createOverlay = function createOverlay() { + var newOverlay = document.createElement('div'); + overlay = queryElement('.modal-backdrop'); + + if (overlay === null) { + newOverlay.setAttribute('class', 'modal-backdrop' + (self.options.animation ? ' fade' : '')); + overlay = newOverlay; + document.body.appendChild(overlay); + } + + return overlay; + }, removeOverlay = function removeOverlay() { + overlay = queryElement('.modal-backdrop'); + + if (overlay && !getElementsByClassName$1(document, 'modal show')[0]) { + document.body.removeChild(overlay); + overlay = null; + } + + overlay === null && (removeClass(document.body, 'modal-open'), resetScrollbar()); + }, toggleEvents = function toggleEvents(action) { + action(window, 'resize', self.update, passiveHandler); + action(modal, 'click', dismissHandler); + action(document, 'keydown', keyHandler); + }, // triggers + beforeShow = function beforeShow() { + modal.style.display = 'block'; + checkScrollbar(); + setScrollbar(); + !getElementsByClassName$1(document, 'modal show')[0] && addClass(document.body, 'modal-open'); + addClass(modal, 'show'); + modal.setAttribute('aria-hidden', false); + hasClass(modal, 'fade') ? emulateTransitionEnd(modal, triggerShow) : triggerShow(); + }, triggerShow = function triggerShow() { + setFocus(modal); + modal.isAnimating = false; + toggleEvents(on); + shownCustomEvent = bootstrapCustomEvent('shown', 'modal', relatedTarget); + dispatchCustomEvent.call(modal, shownCustomEvent); + }, triggerHide = function triggerHide() { + modal.style.display = ''; + element && setFocus(element); + overlay = queryElement('.modal-backdrop'); + + if (overlay && hasClass(overlay, 'show') && !getElementsByClassName$1(document, 'modal show')[0]) { + removeClass(overlay, 'show'); + emulateTransitionEnd(overlay, removeOverlay); + } else { + removeOverlay(); + } + + toggleEvents(off); + modal.isAnimating = false; + hiddenCustomEvent = bootstrapCustomEvent('hidden', 'modal'); + dispatchCustomEvent.call(modal, hiddenCustomEvent); + }, // handlers + clickHandler = function clickHandler(e) { + if (modal.isAnimating) return; + var clickTarget = e.target; + clickTarget = clickTarget.hasAttribute('data-target') || clickTarget.hasAttribute('href') ? clickTarget : clickTarget.parentNode; + + if (clickTarget === element && !hasClass(modal, 'show')) { + modal.modalTrigger = element; + relatedTarget = element; + self.show(); + e.preventDefault(); + } + }, keyHandler = function keyHandler(_ref) { + var which = _ref.which; + if (modal.isAnimating) return; + + if (self.options.keyboard && which == 27 && hasClass(modal, 'show')) { + self.hide(); + } + }, dismissHandler = function dismissHandler(e) { + if (modal.isAnimating) return; + var clickTarget = e.target; + + if (hasClass(modal, 'show') && (clickTarget.parentNode.getAttribute('data-dismiss') === 'modal' || clickTarget.getAttribute('data-dismiss') === 'modal' || clickTarget === modal && self.options.backdrop !== 'static')) { + self.hide(); + relatedTarget = null; + e.preventDefault(); + } + }; // public methods + + self.toggle = function () { + if (hasClass(modal, 'show')) { + self.hide(); + } else { + self.show(); + } }; - self.show = function() { - if ( hasClass(modal,showClass) ) {return} - - showCustomEvent = bootstrapCustomEvent(showEvent, component, relatedTarget); + + self.show = function () { + if (hasClass(modal, 'show')) { + return; + } + + showCustomEvent = bootstrapCustomEvent('show', 'modal', relatedTarget); dispatchCustomEvent.call(modal, showCustomEvent); - - if ( showCustomEvent[defaultPrevented] ) return; - - modal[isAnimating] = true; - - // we elegantly hide any opened modal - var currentOpen = getElementsByClassName(DOC,component+' '+showClass)[0]; + if (showCustomEvent.defaultPrevented) return; + modal.isAnimating = true; // we elegantly hide any opened modal + + var currentOpen = getElementsByClassName$1(document, 'modal show')[0]; + if (currentOpen && currentOpen !== modal) { - modalTrigger in currentOpen && currentOpen[modalTrigger][stringModal].hide(); - stringModal in currentOpen && currentOpen[stringModal].hide(); + currentOpen.modalTrigger && currentOpen.modalTrigger.Modal.hide(); + currentOpen.Modal && currentOpen.Modal.hide(); } - - if ( self[backdrop] ) { + + if (self.options.backdrop) { overlay = createOverlay(); } - - if ( overlay && !currentOpen && !hasClass(overlay,showClass) ) { - overlay[offsetWidth]; // force reflow to enable trasition + + if (overlay && !currentOpen && !hasClass(overlay, 'show')) { + overlay.offsetWidth; // force reflow to enable trasition + overlayDelay = getTransitionDurationFromElement(overlay); - addClass(overlay, showClass); + addClass(overlay, 'show'); } - - !currentOpen ? setTimeout( beforeShow, overlay && overlayDelay ? overlayDelay:0 ) : beforeShow(); + + !currentOpen ? setTimeout(beforeShow, overlay && overlayDelay ? overlayDelay : 0) : beforeShow(); }; - self.hide = function() { - if ( !hasClass(modal,showClass) ) {return} - - hideCustomEvent = bootstrapCustomEvent( hideEvent, component); + + self.hide = function () { + if (!hasClass(modal, 'show')) { + return; + } + + hideCustomEvent = bootstrapCustomEvent('hide', 'modal'); dispatchCustomEvent.call(modal, hideCustomEvent); - if ( hideCustomEvent[defaultPrevented] ) return; - - modal[isAnimating] = true; - - removeClass(modal,showClass); - modal[setAttribute](ariaHidden, true); - - hasClass(modal,'fade') ? emulateTransitionEnd(modal, triggerHide) : triggerHide(); + if (hideCustomEvent.defaultPrevented) return; + modal.isAnimating = true; + removeClass(modal, 'show'); + modal.setAttribute('aria-hidden', true); + hasClass(modal, 'fade') ? emulateTransitionEnd(modal, triggerHide) : triggerHide(); }; - self.setContent = function( content ) { - queryElement('.'+component+'-content',modal)[innerHTML] = content; + + self.setContent = function (content) { + queryElement('.modal-content', modal).innerHTML = content; }; - self.update = function() { - if (hasClass(modal,showClass)) { + + self.update = function () { + if (hasClass(modal, 'show')) { checkScrollbar(); setScrollbar(); } }; - self.destroy = function() { + + self.destroy = function () { self.hide(); - if (!!element) {off(element, clickEvent, clickHandler); delete element[stringModal]; } - else {delete modal[stringModal];} - }; - - // init + + if (element) { + off(element, 'click', clickHandler); + delete element.Modal; + } else { + delete modal.Modal; + } + }; // init // prevent adding event handlers over and over // modal is independent of a triggering element - if ( !!element && !element[stringModal] ) { - on(element, clickEvent, clickHandler); + + + if (element && !element.Modal) { + on(element, 'click', clickHandler); + } + + if (self.options.content) { + self.setContent(self.options.content.trim()); + } // set associations + + + self.modal = modal; + + if (element) { + modal.modalTrigger = element; + self.element = element; + element.Modal = self; + } else { + modal.Modal = self; } - if ( !!self[content] ) { self.setContent( self[content].trim() ); } - if (element) { element[stringModal] = self; modal[modalTrigger] = element; } - else { modal[stringModal] = self; } }; - - // DATA API - supports[push]( [ stringModal, Modal, '['+dataToggle+'="modal"]' ] ); - - /* Native JavaScript for Bootstrap 4 | Popover - ----------------------------------------------*/ - - // POPOVER DEFINITION + + supports.push(['Modal', Modal, '[data-toggle="modal"]']); + // ================== - var Popover = function( element, options ) { - + + var Popover = function Popover(element, options) { + _classCallCheck(this, Popover); + // initialization element - element = queryElement(element); - - // reset on re-init - element[stringPopover] && element[stringPopover].destroy(); - - // set options - options = options || {}; - - // bind, popover and timer - var self = this, popover = null, timer = 0, + element = queryElement(element); // reset on re-init + + element.Popover && element.Popover.destroy(); // popover and timer + + var popover = null, + timer = 0, + // title and content + titleString, + contentString; // bind, popover and timer + + var self = this, // DATA API - triggerData = element[getAttribute](dataTrigger), // click / hover / focus - animationData = element[getAttribute](dataAnimation), // true / false - placementData = element[getAttribute](dataPlacement), - dismissibleData = element[getAttribute](dataDismissible), - delayData = element[getAttribute](dataDelay), - containerData = element[getAttribute](dataContainer), - - // internal strings - component = 'popover', - trigger = 'trigger', - div = 'div', - fade = 'fade', - headerClass = component+'-header', - bodyClass = component+'-body', - dataContent = 'data-content', - dismissible = 'dismissible', - closeBtn = '', + triggerData = element.getAttribute('data-trigger'), + // click / hover / focus + animationData = element.getAttribute('data-animation'), + // true / false + placementData = element.getAttribute('data-placement'), + dismissibleData = element.getAttribute('data-dismissible'), + delayData = element.getAttribute('data-delay'), + containerData = element.getAttribute('data-container'), + // close btn for dissmissible popover + closeBtn = '', // custom events - showCustomEvent = bootstrapCustomEvent(showEvent, component), - shownCustomEvent = bootstrapCustomEvent(shownEvent, component), - hideCustomEvent = bootstrapCustomEvent(hideEvent, component), - hiddenCustomEvent = bootstrapCustomEvent(hiddenEvent, component), - + showCustomEvent = bootstrapCustomEvent('show', 'popover'), + shownCustomEvent = bootstrapCustomEvent('shown', 'popover'), + hideCustomEvent = bootstrapCustomEvent('hide', 'popover'), + hiddenCustomEvent = bootstrapCustomEvent('hidden', 'popover'), // check container - containerElement = queryElement(options[container]), - containerDataElement = queryElement(containerData), - + containerElement = queryElement(options.container), + containerDataElement = queryElement(containerData), // maybe the element is inside a modal - modal = getClosest(element,'.modal'), - + modal = element.closest('.modal'), // maybe the element is inside a fixed navbar - navbarFixedTop = getClosest(element,'.'+fixedTop), - navbarFixedBottom = getClosest(element,'.'+fixedBottom); - - // set instance options - self[template] = options[template] ? options[template] : null; // JavaScript only - self[trigger] = options[trigger] ? options[trigger] : triggerData || hoverEvent; - self[animation] = options[animation] && options[animation] !== fade ? options[animation] : animationData || fade; - self[placement] = options[placement] ? options[placement] : placementData || top; - self[delay] = parseInt(options[delay] || delayData) || 200; - self[dismissible] = options[dismissible] || dismissibleData === 'true' ? true : false; - self[container] = containerElement ? containerElement - : containerDataElement ? containerDataElement - : navbarFixedTop ? navbarFixedTop - : navbarFixedBottom ? navbarFixedBottom - : modal ? modal : DOC[body]; - - // title and content - var titleString, contentString, - placementClass = 'bs-' + component+'-'+self[placement]; - - // private methods - // handlers - var dismissibleHandler = function(e) { - if (popover !== null && e[target] === queryElement('.close',popover)) { - self.hide(); - } - }, - - // private methods - getContents = function(){ - return { - 0 : options.title || element[getAttribute](dataTitle) || null, - 1 : options.content || element[getAttribute](dataContent) || null, - } - }, - removePopover = function() { - self[container].removeChild(popover); - timer = null; popover = null; - }, - createPopover = function() { - titleString = getContents()[0] || null; - contentString = getContents()[1]; - // fixing https://github.com/thednp/bootstrap.native/issues/233 - contentString = !!contentString ? contentString.trim() : null; - - popover = DOC[createElement](div); - - // popover arrow - var popoverArrow = DOC[createElement](div); - addClass(popoverArrow,'arrow'); - popover[appendChild](popoverArrow); - - if ( contentString !== null && self[template] === null ) { //create the popover from data attributes - - popover[setAttribute]('role','tooltip'); - - if (titleString !== null) { - var popoverTitle = DOC[createElement]('h3'); - addClass(popoverTitle,headerClass); - popoverTitle[innerHTML] = self[dismissible] ? titleString + closeBtn : titleString; - popover[appendChild](popoverTitle); - } - - //set popover content - var popoverBody = DOC[createElement](div); - addClass(popoverBody,bodyClass); - popoverBody[innerHTML] = self[dismissible] && titleString === null ? contentString + closeBtn : contentString; - popover[appendChild](popoverBody); - - } else { // or create the popover from template - var popoverTemplate = DOC[createElement](div); - popoverTemplate[innerHTML] = self[template].trim(); - popover.className = popoverTemplate.firstChild.className; - popover[innerHTML] = popoverTemplate.firstChild[innerHTML]; - - var popoverHeader = queryElement('.'+headerClass,popover), - popoverBody = queryElement('.'+bodyClass,popover); - - // fill the template with content from data attributes - titleString && popoverHeader && (popoverHeader[innerHTML] = titleString.trim()); - contentString && popoverBody && (popoverBody[innerHTML] = contentString.trim()); - } - - //append to the container - self[container][appendChild](popover); - popover[style].display = 'block'; - !hasClass(popover, component) && addClass(popover, component); - !hasClass(popover, self[animation]) && addClass(popover, self[animation]); - !hasClass(popover, placementClass) && addClass(popover, placementClass); - }, - showPopover = function () { - !hasClass(popover,showClass) && ( addClass(popover,showClass) ); - }, - updatePopover = function() { - styleTip(element, popover, self[placement], self[container]); - }, - toggleEvents = function(action){ - if (self[trigger] === hoverEvent) { - action( element, mouseHover[0], self.show ); - if (!self[dismissible]) { action( element, mouseHover[1], self.hide ); } - } else if (clickEvent == self[trigger] || 'focus' == self[trigger]) { - action( element, self[trigger], self.toggle ); - } - }, - - // event toggle - dismissHandlerToggle = function(action){ - if (clickEvent == self[trigger] || 'focus' == self[trigger]) { - !self[dismissible] && action( element, 'blur', self.hide ); - } - self[dismissible] && action( DOC, clickEvent, dismissibleHandler ); - action( globalObject, resizeEvent, self.hide, passiveHandler ); - }, - - // triggers - showTrigger = function() { - dismissHandlerToggle(on); - dispatchCustomEvent.call(element, shownCustomEvent); - }, - hideTrigger = function() { - dismissHandlerToggle(off); - removePopover(); - dispatchCustomEvent.call(element, hiddenCustomEvent); + navbarFixedTop = element.closest('.fixed-top'), + navbarFixedBottom = element.closest('.fixed-bottom'); // set instance options + + options = options || {}; + self.options = {}; + self.options.template = options.template ? options.template : null; // JavaScript only + + self.options.trigger = options.trigger ? options.trigger : triggerData || 'hover'; + self.options.animation = options.animation && options.animation !== 'fade' ? options.animation : animationData || 'fade'; + self.options.placement = options.placement ? options.placement : placementData || top; + self.options.delay = parseInt(options.delay || delayData) || 200; + self.options.dismissible = options.dismissible || dismissibleData === 'true' ? true : false; + self.options.container = containerElement ? containerElement : containerDataElement ? containerDataElement : navbarFixedTop ? navbarFixedTop : navbarFixedBottom ? navbarFixedBottom : modal ? modal : document.body; // set initial placement from option + + var placementClass = "bs-popover-".concat(self.options.placement), + // handlers + dismissibleHandler = function dismissibleHandler(e) { + if (popover !== null && e.target === queryElement('.close', popover)) { + self.hide(); + } + }, + // private methods + getContents = function getContents() { + return { + 0: options.title || element.getAttribute('data-title') || null, + 1: options.content || element.getAttribute('data-content') || null }; - - // public methods / handlers - self.toggle = function() { - if (popover === null) { self.show(); } - else { self.hide(); } + }, + removePopover = function removePopover() { + self.options.container.removeChild(popover); + timer = null; + popover = null; + }, + createPopover = function createPopover() { + titleString = getContents()[0] || null; + contentString = getContents()[1]; // fixing https://github.com/thednp/bootstrap.native/issues/233 + + contentString = !!contentString ? contentString.trim() : null; + popover = document.createElement('div'); // popover arrow + + var popoverArrow = document.createElement('div'); + addClass(popoverArrow, 'arrow'); + popover.appendChild(popoverArrow); + + if (contentString !== null && self.options.template === null) { + //create the popover from data attributes + popover.setAttribute('role', 'tooltip'); + + if (titleString !== null) { + var popoverTitle = document.createElement('h3'); + addClass(popoverTitle, 'popover-header'); + popoverTitle.innerHTML = self.options.dismissible ? titleString + closeBtn : titleString; + popover.appendChild(popoverTitle); + } //set popover content + + + var popoverBody = document.createElement('div'); + addClass(popoverBody, 'popover-body'); + popoverBody.innerHTML = self.options.dismissible && titleString === null ? contentString + closeBtn : contentString; + popover.appendChild(popoverBody); + } else { + // or create the popover from template + var popoverTemplate = document.createElement('div'); + popoverTemplate.innerHTML = self.options.template.trim(); + popover.className = popoverTemplate.firstChild.className; + popover.innerHTML = popoverTemplate.firstChild.innerHTML; + + var popoverHeader = queryElement('.popover-header', popover), + _popoverBody = queryElement('.popover-body', popover); // fill the template with content from data attributes + + + titleString && popoverHeader && (popoverHeader.innerHTML = titleString.trim()); + contentString && _popoverBody && (_popoverBody.innerHTML = contentString.trim()); + } //append to the container + + + self.options.container.appendChild(popover); + popover.style.display = 'block'; + !hasClass(popover, 'popover') && addClass(popover, 'popover'); + !hasClass(popover, self.options.animation) && addClass(popover, self.options.animation); + !hasClass(popover, placementClass) && addClass(popover, placementClass); + }, + showPopover = function showPopover() { + !hasClass(popover, 'show') && addClass(popover, 'show'); + }, + updatePopover = function updatePopover() { + styleTip(element, popover, self.options.placement, self.options.container); + }, + toggleEvents = function toggleEvents(action) { + if (self.options.trigger === 'hover') { + action(element, mouseHover[0], self.show); + + if (!self.options.dismissible) { + action(element, mouseHover[1], self.hide); + } + } else if ('click' == self.options.trigger || 'focus' == self.options.trigger) { + action(element, self.options.trigger, self.toggle); + } + }, + // event toggle + dismissHandlerToggle = function dismissHandlerToggle(action) { + if ('click' == self.options.trigger || 'focus' == self.options.trigger) { + !self.options.dismissible && action(element, 'blur', self.hide); + } + + self.options.dismissible && action(document, 'click', dismissibleHandler); + action(window, 'resize', self.hide, passiveHandler); + }, + // triggers + showTrigger = function showTrigger() { + dismissHandlerToggle(on); + dispatchCustomEvent.call(element, shownCustomEvent); + }, + hideTrigger = function hideTrigger() { + dismissHandlerToggle(off); + removePopover(); + dispatchCustomEvent.call(element, hiddenCustomEvent); + }; // public methods / handlers + + + self.toggle = function () { + if (popover === null) { + self.show(); + } else { + self.hide(); + } }; - self.show = function() { + + self.show = function () { clearTimeout(timer); - timer = setTimeout( function() { + timer = setTimeout(function () { if (popover === null) { dispatchCustomEvent.call(element, showCustomEvent); - if ( showCustomEvent[defaultPrevented] ) return; - + if (showCustomEvent.defaultPrevented) return; createPopover(); updatePopover(); showPopover(); - !!self[animation] ? emulateTransitionEnd(popover, showTrigger) : showTrigger(); + !!self.options.animation ? emulateTransitionEnd(popover, showTrigger) : showTrigger(); } - }, 20 ); + }, 20); }; - self.hide = function() { + + self.hide = function () { clearTimeout(timer); - timer = setTimeout( function() { - if (popover && popover !== null && hasClass(popover,showClass)) { + timer = setTimeout(function () { + if (popover && popover !== null && hasClass(popover, 'show')) { dispatchCustomEvent.call(element, hideCustomEvent); - if ( hideCustomEvent[defaultPrevented] ) return; - removeClass(popover,showClass); - !!self[animation] ? emulateTransitionEnd(popover, hideTrigger) : hideTrigger(); + if (hideCustomEvent.defaultPrevented) return; + removeClass(popover, 'show'); + !!self.options.animation ? emulateTransitionEnd(popover, hideTrigger) : hideTrigger(); } - }, self[delay] ); + }, self.options.delay); }; - self.destroy = function() { + + self.destroy = function () { self.hide(); toggleEvents(off); - delete element[stringPopover]; - }; - - // invalidate + delete element.Popover; + }; // invalidate + + titleString = getContents()[0]; contentString = getContents()[1]; - if ( !contentString && !self[template] ) return; - - // init - if ( !element[stringPopover] ) { // prevent adding event handlers twice + if (!contentString && !self.options.template) return; // init + + if (!element.Popover) { + // prevent adding event handlers twice toggleEvents(on); - } - - element[stringPopover] = self; + } // associate target to init object + + + self.element = element; + element.Popover = self; }; - - // POPOVER DATA API // ================ - supports[push]( [ stringPopover, Popover, '['+dataToggle+'="popover"]' ] ); - - - /* Native JavaScript for Bootstrap 4 | ScrollSpy - -----------------------------------------------*/ - - // SCROLLSPY DEFINITION + + supports.push(['Popover', Popover, '[data-toggle="popover"],[data-tip="popover"]']); + // ==================== - var ScrollSpy = function(element, options) { - + + var ScrollSpy = function ScrollSpy(element, options) { + _classCallCheck(this, ScrollSpy); + // initialization element, the element we spy on - element = queryElement(element); - - // reset on re-init - element[stringScrollSpy] && element[stringScrollSpy].destroy(); - - // DATA API - var targetData = queryElement(element[getAttribute](dataTarget)), - offsetData = element[getAttribute]('data-offset'); - - // set options - options = options || {}; - - // invalidate - if ( !options[target] && !targetData ) { return; } - - // event targets, constants + element = queryElement(element); // reset on re-init + + element.ScrollSpy && element.ScrollSpy.destroy(); // set options + + options = options || {}; // bind, event targets, constants + var self = this, - spyTarget = options[target] && queryElement(options[target]) || targetData, - links = spyTarget && spyTarget[getElementsByTagName]('A'), - offset = parseInt(options['offset'] || offsetData) || 10, - items = [], targetItems = [], scrollOffset, - scrollTarget = element[offsetHeight] < element[scrollHeight] ? element : globalObject, // determine which is the real scrollTarget - isWindow = scrollTarget === globalObject; - - // populate items and targets - for (var i=0, il=links[length]; i= topEdge && bottomEdge > scrollOffset; - - if ( !isActive && inside ) { - if ( !hasClass(item,active) ) { - addClass(item,active); - if (dropdownLink && !hasClass(dropdownLink,active) ) { - addClass(dropdownLink,active); - } - dispatchCustomEvent.call(element, bootstrapCustomEvent( 'activate', 'scrollspy', items[index])); - } - } else if ( !inside ) { - if ( hasClass(item,active) ) { - removeClass(item,active); - if (dropdownLink && hasClass(dropdownLink,active) && !getElementsByClassName(item[parentNode],active).length ) { - removeClass(dropdownLink,active); - } + + if (!isActive && inside) { + if (!hasClass(item, 'active')) { + addClass(item, 'active'); + + if (dropdownLink && !hasClass(dropdownLink, 'active')) { + addClass(dropdownLink, 'active'); } - } else if ( !inside && !isActive || isActive && inside ) { - return; + + dispatchCustomEvent.call(element, bootstrapCustomEvent('activate', 'scrollspy', items[index])); } - }, - toggleEvents = function(action){ - action( scrollTarget, scrollEvent, self.refresh, passiveHandler ); - action( globalObject, resizeEvent, self.refresh, passiveHandler ); - }, - updateItems = function(){ - scrollOffset = isWindow ? getScroll().y : element[scrollTop]; - for (var index=0, itl=items[length]; index 1 ) { - activeTab = activeTabs[activeTabs[length]-1]; - } - return activeTab; - }, - getActiveContent = function() { - return queryElement(getActiveTab()[getAttribute]('href')); - }, - // handler - clickHandler = function(e) { - e[preventDefault](); - next = e[currentTarget]; - !tabs[isAnimating] && !hasClass(next,active) && self.show(); - }; - - // public method - self.show = function() { // the tab we clicked is now the next tab + } else { + tabs.isAnimating = false; + } + + shownCustomEvent = bootstrapCustomEvent('shown', 'tab', activeTab); + dispatchCustomEvent.call(next, shownCustomEvent); + }, + triggerHide = function triggerHide() { + if (tabsContentContainer) { + activeContent.style.float = 'left'; + nextContent.style.float = 'left'; + containerHeight = activeContent.scrollHeight; + } + + showCustomEvent = bootstrapCustomEvent('show', 'tab', activeTab); + hiddenCustomEvent = bootstrapCustomEvent('hidden', 'tab', next); + dispatchCustomEvent.call(next, showCustomEvent); + if (showCustomEvent.defaultPrevented) return; + addClass(nextContent, 'active'); + removeClass(activeContent, 'active'); + + if (tabsContentContainer) { + nextHeight = nextContent.scrollHeight; + equalContents = nextHeight === containerHeight; + addClass(tabsContentContainer, 'collapsing'); + tabsContentContainer.style.height = "".concat(containerHeight, "px"); // height animation + + tabsContentContainer.offsetHeight; + activeContent.style.float = ''; + nextContent.style.float = ''; + } + + if (hasClass(nextContent, 'fade')) { + setTimeout(function () { + addClass(nextContent, 'show'); + emulateTransitionEnd(nextContent, triggerShow); + }, 20); + } else { + triggerShow(); + } + + dispatchCustomEvent.call(activeTab, hiddenCustomEvent); + }, + // private methods + getActiveTab = function getActiveTab() { + var activeTabs = getElementsByClassName$1(tabs, 'active'); + var activeTab; + + if (activeTabs.length === 1 && !hasClass(activeTabs[0].parentNode, 'dropdown')) { + activeTab = activeTabs[0]; + } else if (activeTabs.length > 1) { + activeTab = activeTabs[activeTabs.length - 1]; + } + + return activeTab; + }, + getActiveContent = function getActiveContent() { + return queryElement(getActiveTab().getAttribute('href')); + }, + // handler + clickHandler = function clickHandler(e) { + e.preventDefault(); + next = e.currentTarget; + !tabs.isAnimating && !hasClass(next, 'active') && self.show(); + }; // public method + + + self.show = function () { + // the tab we clicked is now the next tab next = next || element; - nextContent = queryElement(next[getAttribute]('href')); // this is the actual object, the next tab content to activate - activeTab = getActiveTab(); + nextContent = queryElement(next.getAttribute('href')); // this is the actual object, the next tab content to activate + + activeTab = getActiveTab(); activeContent = getActiveContent(); - - hideCustomEvent = bootstrapCustomEvent( hideEvent, component, next); + hideCustomEvent = bootstrapCustomEvent('hide', 'tab', next); dispatchCustomEvent.call(activeTab, hideCustomEvent); - if (hideCustomEvent[defaultPrevented]) return; - - tabs[isAnimating] = true; - removeClass(activeTab,active); - activeTab[setAttribute](ariaSelected,'false'); - addClass(next,active); - next[setAttribute](ariaSelected,'true'); - - if ( dropdown ) { - if ( !hasClass(element[parentNode],'dropdown-menu') ) { - if (hasClass(dropdown,active)) removeClass(dropdown,active); + if (hideCustomEvent.defaultPrevented) return; + tabs.isAnimating = true; + removeClass(activeTab, 'active'); + activeTab.setAttribute(ariaSelected, 'false'); + addClass(next, 'active'); + next.setAttribute(ariaSelected, 'true'); + + if (dropdown) { + if (!hasClass(element.parentNode, 'dropdown-menu')) { + if (hasClass(dropdown, 'active')) removeClass(dropdown, 'active'); } else { - if (!hasClass(dropdown,active)) addClass(dropdown,active); + if (!hasClass(dropdown, 'active')) addClass(dropdown, 'active'); } } - + if (hasClass(activeContent, 'fade')) { - removeClass(activeContent,showClass); + removeClass(activeContent, 'show'); emulateTransitionEnd(activeContent, triggerHide); - } else { triggerHide(); } + } else { + triggerHide(); + } }; - self.destroy = function() { - off(element, clickEvent, clickHandler); - delete element[stringTab]; + + self.destroy = function () { + off(element, 'click', clickHandler); + delete element.Tab; }; - - // init - if ( !element[stringTab] ) { // prevent adding event handlers twice - on(element, clickEvent, clickHandler); + + if (!tabs) return; // invalidate + // set default animation state + + tabs.isAnimating = false; // init + + if (!element.Tab) { + // prevent adding event handlers twice + on(element, 'click', clickHandler); } - if (self[height]) { tabsContentContainer = getActiveContent()[parentNode]; } - element[stringTab] = self; + + if (self.options.height) { + tabsContentContainer = getActiveContent().parentNode; + } // associate target with init object + + + self.element = element; + element.Tab = self; }; - - // TAB DATA API // ============ - supports[push]( [ stringTab, Tab, '['+dataToggle+'="tab"]' ] ); - - - /* Native JavaScript for Bootstrap 4 | Toast - ---------------------------------------------*/ - - // TOAST DEFINITION + + supports.push(['Tab', Tab, '[data-toggle="tab"]']); + // ================== - var Toast = function( element,options ) { - + + var Toast = function Toast(element, options) { + _classCallCheck(this, Toast); + // initialization element - element = queryElement(element); - - // reset on re-init - element[stringToast] && element[stringToast].destroy(); - - // set options - options = options || {}; - - // bind, toast and timer - var self = this, - toast = getClosest(element,'.toast'), - timer = 0, - + element = queryElement(element); // reset on re-init + + element.Toast && element.Toast.destroy(); // set options + + options = options || {}; // toast, timer + + var toast = element.closest('.toast'), + timer = 0; // bind, data api and events + + var self = this, // DATA API - animationData = element[getAttribute](dataAnimation), - autohideData = element[getAttribute](dataAutohide), - delayData = element[getAttribute](dataDelay), - - // strings - component = 'toast', - autohide = 'autohide', - animation = 'animation', - showing = 'showing', - hide = 'hide', - fade = 'fade', + animationData = element.getAttribute('data-animation'), + autohideData = element.getAttribute('data-autohide'), + delayData = element.getAttribute('data-delay'), // custom events - showCustomEvent = bootstrapCustomEvent(showEvent, component), - hideCustomEvent = bootstrapCustomEvent(hideEvent, component), - shownCustomEvent = bootstrapCustomEvent(shownEvent, component), - hiddenCustomEvent = bootstrapCustomEvent(hiddenEvent, component); - - // set instance options - self[animation] = options[animation] === false || animationData === 'false' ? 0 : 1; // true by default - self[autohide] = options[autohide] === false || autohideData === 'false' ? 0 : 1; // true by default - self[delay] = parseInt(options[delay] || delayData) || 500; // 500ms default - - + showCustomEvent = bootstrapCustomEvent('show', 'toast'), + hideCustomEvent = bootstrapCustomEvent('hide', 'toast'), + shownCustomEvent = bootstrapCustomEvent('shown', 'toast'), + hiddenCustomEvent = bootstrapCustomEvent('hidden', 'toast'); // set instance options + + self.options = {}; + self.options.animation = options.animation === false || animationData === 'false' ? 0 : 1; // true by default + + self.options.autohide = options.autohide === false || autohideData === 'false' ? 0 : 1; // true by default + + self.options.delay = parseInt(options.delay || delayData) || 500; // 500ms default // private methods - // animation complete - var showComplete = function() { - removeClass( toast, showing ); - addClass( toast, showClass ); - if (self[autohide]) { self.hide(); } - dispatchCustomEvent.call(toast,shownCustomEvent); - }, - hideComplete = function() { - addClass( toast, hide ); - dispatchCustomEvent.call(toast,hiddenCustomEvent); - }, - close = function() { - removeClass( toast,showClass ); - self[animation] ? emulateTransitionEnd(toast, hideComplete) : hideComplete(); - }, - disposeComplete = function(){ - clearTimeout(timer); timer = null; - addClass( toast, hide ); - off(element, clickEvent, self.hide); - element[stringToast] = null; - element = null; - toast = null; - }; - - // public methods - self.show = function() { + + var showComplete = function showComplete() { + removeClass(toast, 'showing'); + addClass(toast, 'show'); + + if (self.options.autohide) { + self.hide(); + } + + dispatchCustomEvent.call(toast, shownCustomEvent); + }, + hideComplete = function hideComplete() { + addClass(toast, 'hide'); + dispatchCustomEvent.call(toast, hiddenCustomEvent); + }, + close = function close() { + removeClass(toast, 'show'); + self.options.animation ? emulateTransitionEnd(toast, hideComplete) : hideComplete(); + }, + disposeComplete = function disposeComplete() { + clearTimeout(timer); + timer = null; + addClass(toast, 'hide'); + off(element, 'click', self.hide); + delete element.Toast; + element = null; + toast = null; + }; // public methods + + + self.show = function () { if (toast) { - dispatchCustomEvent.call(toast,showCustomEvent); - if (showCustomEvent[defaultPrevented]) return; - self[animation] && addClass( toast,fade ); - removeClass( toast,hide ); - addClass( toast,showing ); - - self[animation] ? emulateTransitionEnd(toast, showComplete) : showComplete(); + dispatchCustomEvent.call(toast, showCustomEvent); + if (showCustomEvent.defaultPrevented) return; + self.options.animation && addClass(toast, 'fade'); + removeClass(toast, 'hide'); + addClass(toast, 'showing'); + self.options.animation ? emulateTransitionEnd(toast, showComplete) : showComplete(); } }; - self.hide = function(noTimer) { - if (toast && hasClass(toast,showClass)) { - dispatchCustomEvent.call(toast,hideCustomEvent); - if(hideCustomEvent[defaultPrevented]) return; - + + self.hide = function (noTimer) { + if (toast && hasClass(toast, 'show')) { + dispatchCustomEvent.call(toast, hideCustomEvent); + if (hideCustomEvent.defaultPrevented) return; + if (noTimer) { close(); } else { - timer = setTimeout( close, self[delay]); + timer = setTimeout(close, self.options.delay); } } }; - self.dispose = function() { - if ( toast && hasClass(toast,showClass) ) { - removeClass( toast,showClass ); - self[animation] ? emulateTransitionEnd(toast, disposeComplete) : disposeComplete(); + + self.dispose = function () { + if (toast && hasClass(toast, 'show')) { + removeClass(toast, 'show'); + self.options.animation ? emulateTransitionEnd(toast, disposeComplete) : disposeComplete(); } }; - self.destroy = function() { + + self.destroy = function () { self.hide(); clearTimeout(timer); - off(element, clickEvent, self.hide); - delete element[stringToast]; - }; - - // init - if ( !element[stringToast] ) { // prevent adding event handlers twice - on(element, clickEvent, self.hide); - } - element[stringToast] = self; + off(element, 'click', self.hide); + delete element.Toast; + }; // init + + + if (!element.Toast) { + // prevent adding event handlers twice + on(element, 'click', self.hide); + } // associate targets to init object + + + self.toast = toast; + self.element = element; + element.Toast = self; }; - - // TOAST DATA API // ================= - supports[push]( [ stringToast, Toast, '['+dataDismiss+'="toast"]' ] ); - - - /* Native JavaScript for Bootstrap 4 | Tooltip - ---------------------------------------------*/ - - // TOOLTIP DEFINITION + + supports.push(['Toast', Toast, '[data-dismiss="toast"]']); + // ================== - var Tooltip = function( element,options ) { - + + var Tooltip = function Tooltip(element, options) { + _classCallCheck(this, Tooltip); + // initialization element - element = queryElement(element); - - // set options - options = options || {}; - - // reset on re-init - element[stringTooltip] && element[stringTooltip].destroy(); - - // bind, timer and tooltip - var self = this, timer = 0, tooltip = null, - + element = queryElement(element); // set options + + options = options || {}; // reset on re-init + + element.Tooltip && element.Tooltip.destroy(); // tooltip, timer, and title + + var tooltip = null, + timer = 0, + titleString; // bind, + + var self = this, // DATA API - animationData = element[getAttribute](dataAnimation), - placementData = element[getAttribute](dataPlacement), - delayData = element[getAttribute](dataDelay), - containerData = element[getAttribute](dataContainer), - - // strings - component = 'tooltip', - classString = 'class', - title = 'title', - fade = 'fade', - div = 'div', + animationData = element.getAttribute('data-animation'), + placementData = element.getAttribute('data-placement'), + delayData = element.getAttribute('data-delay'), + containerData = element.getAttribute('data-container'), // custom events - showCustomEvent = bootstrapCustomEvent(showEvent, component), - shownCustomEvent = bootstrapCustomEvent(shownEvent, component), - hideCustomEvent = bootstrapCustomEvent(hideEvent, component), - hiddenCustomEvent = bootstrapCustomEvent(hiddenEvent, component), - + showCustomEvent = bootstrapCustomEvent('show', 'tooltip'), + shownCustomEvent = bootstrapCustomEvent('shown', 'tooltip'), + hideCustomEvent = bootstrapCustomEvent('hide', 'tooltip'), + hiddenCustomEvent = bootstrapCustomEvent('hidden', 'tooltip'), // check container - containerElement = queryElement(options[container]), - containerDataElement = queryElement(containerData), - + containerElement = queryElement(options.container), + containerDataElement = queryElement(containerData), // maybe the element is inside a modal - modal = getClosest(element,'.modal'), - + modal = element.closest('.modal'), // maybe the element is inside a fixed navbar - navbarFixedTop = getClosest(element,'.'+fixedTop), - navbarFixedBottom = getClosest(element,'.'+fixedBottom); - - // set instance options - self[animation] = options[animation] && options[animation] !== fade ? options[animation] : animationData || fade; - self[placement] = options[placement] ? options[placement] : placementData || top; - self[template] = options[template] ? options[template] : null; // JavaScript only - self[delay] = parseInt(options[delay] || delayData) || 200; - self[container] = containerElement ? containerElement - : containerDataElement ? containerDataElement - : navbarFixedTop ? navbarFixedTop - : navbarFixedBottom ? navbarFixedBottom - : modal ? modal : DOC[body]; - - // title and placement class - var titleString, placementClass = 'bs-' + component + '-' + self[placement]; - - // private methods - var getTitle = function() { - return element[getAttribute](title) || element[getAttribute](dataTitle) || element[getAttribute](dataOriginalTitle); - }, - removeToolTip = function() { - self[container].removeChild(tooltip); - tooltip = null; timer = null; - }, - createToolTip = function() { - titleString = getTitle(); // read the title again - if ( titleString ) { // invalidate, maybe markup changed - // create tooltip - tooltip = DOC[createElement](div); - - // set markup - if (self[template]) { - var tooltipMarkup = DOC[createElement](div); - tooltipMarkup[innerHTML] = self[template].trim(); - - tooltip.className = tooltipMarkup.firstChild.className; - tooltip[innerHTML] = tooltipMarkup.firstChild[innerHTML]; - - queryElement('.'+component+'-inner',tooltip)[innerHTML] = titleString.trim(); - } else { - // tooltip arrow - var tooltipArrow = DOC[createElement](div); - tooltipArrow[setAttribute](classString,'arrow'); - tooltip[appendChild](tooltipArrow); - // tooltip inner - var tooltipInner = DOC[createElement](div); - tooltipInner[setAttribute](classString,component+'-inner'); - tooltip[appendChild](tooltipInner); - tooltipInner[innerHTML] = titleString; - } - // reset position - tooltip[style][left] = '0'; - tooltip[style][top] = '0'; - // set class and role attribute - tooltip[setAttribute]('role',component); - !hasClass(tooltip, component) && addClass(tooltip, component); - !hasClass(tooltip, self[animation]) && addClass(tooltip, self[animation]); - !hasClass(tooltip, placementClass) && addClass(tooltip, placementClass); - // append to container - self[container][appendChild](tooltip); - } - }, - updateTooltip = function () { - styleTip(element, tooltip, self[placement], self[container]); - }, - showTooltip = function () { - !hasClass(tooltip,showClass) && ( addClass(tooltip,showClass) ); - }, - // triggers - showAction = function() { - on( globalObject, resizeEvent, self.hide, passiveHandler ); - dispatchCustomEvent.call(element, shownCustomEvent); - }, - hideAction = function() { - off( globalObject, resizeEvent, self.hide, passiveHandler ); - removeToolTip(); - dispatchCustomEvent.call(element, hiddenCustomEvent); - }, - toggleEvents = function(action){ - action(element, mouseHover[0], self.show); - action(element, mouseHover[1], self.hide); - }; - - // public methods - self.show = function() { + navbarFixedTop = element.closest('.fixed-top'), + navbarFixedBottom = element.closest('.fixed-bottom'); // set instance options + + self.options = {}; + self.options.animation = options.animation && options.animation !== 'fade' ? options.animation : animationData || 'fade'; + self.options.placement = options.placement ? options.placement : placementData || top; + self.options.template = options.template ? options.template : null; // JavaScript only + + self.options.delay = parseInt(options.delay || delayData) || 200; + self.options.container = containerElement ? containerElement : containerDataElement ? containerDataElement : navbarFixedTop ? navbarFixedTop : navbarFixedBottom ? navbarFixedBottom : modal ? modal : document.body; // set placement class + + var placementClass = "bs-tooltip-".concat(self.options.placement), + // private methods + getTitle = function getTitle() { + return element.getAttribute('title') || element.getAttribute('data-title') || element.getAttribute('data-original-title'); + }, + removeToolTip = function removeToolTip() { + self.options.container.removeChild(tooltip); + tooltip = null; + timer = null; + }, + createToolTip = function createToolTip() { + titleString = getTitle(); // read the title again + + if (titleString) { + // invalidate, maybe markup changed + // create tooltip + tooltip = document.createElement('div'); // set markup + + if (self.options.template) { + var tooltipMarkup = document.createElement('div'); + tooltipMarkup.innerHTML = self.options.template.trim(); + tooltip.className = tooltipMarkup.firstChild.className; + tooltip.innerHTML = tooltipMarkup.firstChild.innerHTML; + queryElement('.tooltip-inner', tooltip).innerHTML = titleString.trim(); + } else { + // tooltip arrow + var tooltipArrow = document.createElement('div'); + addClass(tooltipArrow, 'arrow'); + tooltip.appendChild(tooltipArrow); // tooltip inner + + var tooltipInner = document.createElement('div'); + addClass(tooltipInner, 'tooltip-inner'); + tooltip.appendChild(tooltipInner); + tooltipInner.innerHTML = titleString; + } // reset position + + + tooltip.style.left = '0'; + tooltip.style.top = '0'; // set class and role attribute + + tooltip.setAttribute('role', 'tooltip'); + !hasClass(tooltip, 'tooltip') && addClass(tooltip, 'tooltip'); + !hasClass(tooltip, self.options.animation) && addClass(tooltip, self.options.animation); + !hasClass(tooltip, placementClass) && addClass(tooltip, placementClass); // append to container + + self.options.container.appendChild(tooltip); + } + }, + updateTooltip = function updateTooltip() { + styleTip(element, tooltip, self.options.placement, self.options.container); + }, + showTooltip = function showTooltip() { + !hasClass(tooltip, 'show') && addClass(tooltip, 'show'); + }, + // triggers + showAction = function showAction() { + on(window, 'resize', self.hide, passiveHandler); + dispatchCustomEvent.call(element, shownCustomEvent); + }, + hideAction = function hideAction() { + off(window, 'resize', self.hide, passiveHandler); + removeToolTip(); + dispatchCustomEvent.call(element, hiddenCustomEvent); + }, + toggleEvents = function toggleEvents(action) { + action(element, mouseHover[0], self.show); + action(element, mouseHover[1], self.hide); + }; // public methods + + + self.show = function () { clearTimeout(timer); - timer = setTimeout( function() { + timer = setTimeout(function () { if (tooltip === null) { dispatchCustomEvent.call(element, showCustomEvent); - if (showCustomEvent[defaultPrevented]) return; - // if(createToolTip() == false) return; - if(createToolTip() !== false) { + if (showCustomEvent.defaultPrevented) return; // if(createToolTip() == false) return; + + if (createToolTip() !== false) { updateTooltip(); showTooltip(); - !!self[animation] ? emulateTransitionEnd(tooltip, showAction) : showAction(); + !!self.options.animation ? emulateTransitionEnd(tooltip, showAction) : showAction(); } } - }, 20 ); + }, 20); }; - self.hide = function() { + + self.hide = function () { clearTimeout(timer); - timer = setTimeout( function() { - if (tooltip && hasClass(tooltip,showClass)) { + timer = setTimeout(function () { + if (tooltip && hasClass(tooltip, 'show')) { dispatchCustomEvent.call(element, hideCustomEvent); - if (hideCustomEvent[defaultPrevented]) return; - removeClass(tooltip,showClass); - !!self[animation] ? emulateTransitionEnd(tooltip, hideAction) : hideAction(); + if (hideCustomEvent.defaultPrevented) return; + removeClass(tooltip, 'show'); + !!self.options.animation ? emulateTransitionEnd(tooltip, hideAction) : hideAction(); } - }, self[delay]); + }, self.options.delay); }; - self.toggle = function() { - if (!tooltip) { self.show(); } - else { self.hide(); } + + self.toggle = function () { + if (!tooltip) { + self.show(); + } else { + self.hide(); + } }; - self.destroy = function() { + + self.destroy = function () { toggleEvents(off); self.hide(); - element[setAttribute](title, element[getAttribute](dataOriginalTitle)); - element[removeAttribute](dataOriginalTitle); - delete element[stringTooltip]; - }; - - // invalidate + element.setAttribute('title', element.getAttribute('data-original-title')); + element.removeAttribute('data-original-title'); + delete element.Tooltip; + }; // invalidate + + titleString = getTitle(); - if ( !titleString ) return; - - // init - if (!element[stringTooltip]){ // prevent adding event handlers twice - element[setAttribute](dataOriginalTitle,titleString); - element[removeAttribute](title); + if (!titleString) return; // init + + if (!element.Tooltip) { + // prevent adding event handlers twice + element.setAttribute('data-original-title', titleString); + element.removeAttribute('title'); toggleEvents(on); - } - - element[stringTooltip] = self; + } // associate target to init object + + + self.element = element; + element.Tooltip = self; }; - - // TOOLTIP DATA API // ================= - supports[push]( [ stringTooltip, Tooltip, '['+dataToggle+'="tooltip"]' ] ); - - - + + supports.push(['Tooltip', Tooltip, '[data-toggle="tooltip"],[data-tip="tooltip"]']); + /* Native JavaScript for Bootstrap | Initialize Data API - --------------------------------------------------------*/ - var initializeDataAPI = function( constructor, collection ){ - for (var i=0, l=collection[length]; i=p,N=v[A]+h.h/2+w.h/2>=m,I=v[A]-h.h<0,D=v[C]-h.w<0,S=v[A]+h.h+w.h>=m,L=v[C]+h.w+w.w>=p;a=(a===C||"right"===a)&&D&&L?A:a,a=a===A&&I?"bottom":a,a="bottom"===a&&S?A:a,a=a===C&&D?"right":a,a="right"===a&&L?C:a,-1===i.className.indexOf(a)&&(i.className=i.className.replace(x,a)),u=T.offsetWidth,f=T.offsetHeight,a===C||"right"===a?(c=a===C?v[C]+g.x-h.w-(y?u:0):v[C]+g.x+w.w,k?(r=v[A]+g.y,s=w.h/2-u):N?(r=v[A]+g.y-h.h+w.h,s=h.h-w.h/2-u):(r=v[A]+g.y-h.h/2+w.h/2,s=h.h/2-(y?.9*f:f/2))):a!==A&&"bottom"!==a||(r=a===A?v[A]+g.y-h.h-(y?f:0):v[A]+g.y+w.h,P?(c=0,d=v[C]+w.w/2-u):E?(c=p-1.01*h.w,d=h.w-(p-v[C])+w.w/2-u/2):(c=v[C]+g.x-h.w/2+w.w/2,d=h.w/2-(y?u:u/2))),i[b][A]=r+"px",i[b][C]=c+"px",s&&(T[b][A]=s+"px"),d&&(T[b][C]=d+"px")};i.version="2.0.28";var J=function(e){e=M(e),e.Alert&&e.Alert.destroy();var t=this,o=q("close","alert"),n=q("closed","alert"),i=H(e,".alert"),a=function(){B(i,"fade")?j(i,r):r()},l=function(o){i=H(o[c],".alert"),(e=M('[data-dismiss="alert"]',i))&&i&&(e===o[c]||e.contains(o[c]))&&t.close()},r=function(){R(e,"click",l),i[v].removeChild(i),Y.call(i,n)};t.close=function(){if(i&&e&&B(i,"show")){if(Y.call(i,o),o.defaultPrevented)return;t.destroy()}},t.destroy=function(){S(i,"show"),i&&a(),R(e,"click",l),delete e.Alert},"Alert"in e||W(e,"click",l),e.Alert=t};a[T](["Alert",J,'[data-dismiss="alert"]']);var K=function(e){e=M(e),e.Button&&e.Button.destroy();var o=this,n=!1,i="checked",a=q("change","button"),l=function(e){32===(e.which||e.keyCode)&&e[c]===t.activeElement&&s(e)},r=function(e){32===(e.which||e.keyCode)&&e.preventDefault()},s=function(t){var o="LABEL"===t[c].tagName?t[c]:"LABEL"===t[c][v].tagName?t[c][v]:null;if(o){var l=L(o[v],"btn"),r=o.getElementsByTagName("INPUT")[0];if(r){if(Y.call(r,a),Y.call(e,a),"checkbox"===r.type){if(a.defaultPrevented)return;r[i]?(S(o,k),r[h](i),r.removeAttribute(i),r[i]=!1):(D(o,k),r[h](i),r[p](i,i),r[i]=!0),n||(n=!0)}if("radio"===r.type&&!n){if(a.defaultPrevented)return;if(!r[i]||0===t.screenX&&0==t.screenY){D(o,k),D(o,"focus"),r[p](i,i),r[i]=!0,n=!0;for(var s=0,d=l[g];s1&&t(n,f.start,ee,X),U&&t(U,"click",V),z&&t(z,"click",V),F&&t(F,"click",Q),r.keyboard&&t(e,"keydown",Z)},_=function(e){e(n,f.move,te,X),e(n,f.end,oe,X)},ee=function(e){T||(x=parseInt(e.touches[0].pageX),n.contains(e[c])&&(T=!0,_(W)))},te=function(e){return T?(E=parseInt(e.touches[0].pageX),"touchmove"===e.type&&e.touches[g]>1?(e.preventDefault(),!1):void 0):void e.preventDefault()},oe=function(e){if(T&&!b&&(N=E||parseInt(e.touches[0].pageX),T)){if((!n.contains(e[c])||!n.contains(e.relatedTarget))&&Math.abs(x-N)<75)return!1;Ex&&s--,T=!1,r.slideTo(s),_(R)}},ne=function(){var t=n.getBoundingClientRect(),i=e.innerHeight||o.clientHeight;return t[A]<=i&&t.bottom>=0},ie=function(e){for(var t=0,o=G[g];te||i===H-1&&0===e)&&(O=r.direction="right"),e<0?e=H-1:e>=H&&(e=0),s=e,o=O===C?"next":"prev",a=q("slide","carousel",I[e]),l=q("slid","carousel",I[e]),Y.call(n,a),a.defaultPrevented||(b=!0,clearInterval(d),d=null,ie(e),P&&B(n,"slide")?(D(I[e],"carousel-item-"+o),I[e].offsetWidth,D(I[e],"carousel-item-"+O),D(I[i],"carousel-item-"+O),j(I[e],function(a){var s=a&&a[c]!==I[e]?1e3*a.elapsedTime+100:20;b&&setTimeout(function(){b=!1,D(I[e],k),S(I[i],k),S(I[e],"carousel-item-"+o),S(I[e],"carousel-item-"+O),S(I[i],"carousel-item-"+O),Y.call(n,l),t.hidden||!r.interval||B(n,"paused")||r.cycle()},s)})):(D(I[e],k),I[e].offsetWidth,S(I[i],k),setTimeout(function(){b=!1,r.interval&&!B(n,"paused")&&r.cycle(),Y.call(n,l)},100))))}},r.getActiveIndex=function(){return I.indexOf(L(n,"carousel-item active")[0])||0},r.destroy=function(){$(R),clearInterval(d),delete n.Carousel},n.Carousel||$(W),r.getActiveIndex()<0&&(I[g]&&D(I[0],k),G[g]&&ie(0)),r.interval&&r.cycle(),n.Carousel=r}};a[T](["Carousel",Q,'[data-ride="carousel"]']);var V=function(e,t){e=M(e),e.Collapse&&e.Collapse.destroy(),t=t||{};var o,n,i=this,a=null,l=null,r=e[h]("data-parent"),c=q("show","collapse"),s=q("shown","collapse"),d=q("hide","collapse"),u=q("hidden","collapse"),f=function(e,t){Y.call(e,c),c.defaultPrevented||(e.isAnimating=!0,D(e,"collapsing"),S(e,"collapse"),e[b].height=e.scrollHeight+"px",j(e,function(){e.isAnimating=!1,e[p]("aria-expanded","true"),t[p]("aria-expanded","true"),S(e,"collapsing"),D(e,"collapse"),D(e,"show"),e[b].height="",Y.call(e,s)}))},m=function(e,t){Y.call(e,d),d.defaultPrevented||(e.isAnimating=!0,e[b].height=e.scrollHeight+"px",S(e,"collapse"),S(e,"show"),D(e,"collapsing"),e.offsetWidth,e[b].height="0px",j(e,function(){e.isAnimating=!1,e[p]("aria-expanded","false"),t[p]("aria-expanded","false"),S(e,"collapsing"),D(e,"collapse"),e[b].height="",Y.call(e,u)}))};i.toggle=function(e){e.preventDefault(),B(l,"show")?i.hide():i.show()},i.hide=function(){l.isAnimating||(m(l,e),D(e,"collapsed"))},i.show=function(){a&&(o=M(".collapse.show",a),n=o&&(M('[data-target="#'+o.id+'"]',a)||M('[href="#'+o.id+'"]',a))),(!l.isAnimating||o&&!o.isAnimating)&&(n&&o!==l&&(m(o,n),D(n,"collapsed")),f(l,e),S(e,"collapsed"))},i.destroy=function(){R(e,"click",i.toggle),delete e.Collapse},e.Collapse||W(e,"click",i.toggle),l=function(){var t=e.href&&e[h]("href"),o=e[h]("data-target"),n=t||o&&"#"===o.charAt(0)&&o;return n&&M(n)}(),l.isAnimating=!1,a=M(t.parent)||r&&H(e,r),e.Collapse=i};a[T](["Collapse",V,'[data-toggle="collapse"]']);var Z=function(e,o){e=M(e),e.Dropdown&&e.Dropdown.destroy();var n,i,a,r,s=this,d=e[v],u=null,f="open",m=M(".dropdown-menu",d),w=function(){for(var e=m.children,t=[],o=0;o1?a-1:0:40===n&&a×',x=q("show","popover"),P=q("shown","popover"),E=q("hide","popover"),N=q("hidden","popover"),I=M(i.container),L=M(k),O=H(o,".modal"),z=H(o,".fixed-top"),U=H(o,".fixed-bottom");a[d]=i[d]?i[d]:null,a.trigger=i.trigger?i.trigger:v||"hover",a[s]=i[s]&&"fade"!==i[s]?i[s]:g||"fade",a.placement=i.placement?i.placement:w||A,a[r]=parseInt(i[r]||T)||200,a.dismissible=!(!i.dismissible&&"true"!==y),a.container=I||(L||(z||(U||(O||t[n]))));var F,J,K="bs-popover-"+a.placement,Q=function(e){null!==l&&e[c]===M(".close",l)&&a.hide()},V=function(){return{0:i.title||o[h]("data-title")||null,1:i.content||o[h]("data-content")||null}},Z=function(){a.container.removeChild(l),f=null,l=null},$=function(){F=V()[0]||null,J=V()[1],J=J?J.trim():null,l=t.createElement("div");var e=t.createElement("div");if(D(e,"arrow"),l.appendChild(e),null!==J&&null===a[d]){if(l[p]("role","tooltip"),null!==F){var o=t.createElement("h3");D(o,"popover-header"),o[m]=a.dismissible?F+C:F,l.appendChild(o)}var n=t.createElement("div");D(n,"popover-body"),n[m]=a.dismissible&&null===F?J+C:J,l.appendChild(n)}else{var i=t.createElement("div");i[m]=a[d].trim(),l.className=i.firstChild.className,l[m]=i.firstChild[m];var r=M(".popover-header",l),n=M(".popover-body",l);F&&r&&(r[m]=F.trim()),J&&n&&(n[m]=J.trim())}a.container.appendChild(l),l[b].display="block",!B(l,"popover")&&D(l,"popover"),!B(l,a[s])&&D(l,a[s]),!B(l,K)&&D(l,K)},_=function(){!B(l,"show")&&D(l,"show")},ee=function(){G(o,l,a.placement,a.container)},te=function(e){"hover"===a.trigger?(e(o,u[0],a.show),a.dismissible||e(o,u[1],a.hide)):"click"!=a.trigger&&"focus"!=a.trigger||e(o,a.trigger,a.toggle)},oe=function(n){"click"!=a.trigger&&"focus"!=a.trigger||!a.dismissible&&n(o,"blur",a.hide),a.dismissible&&n(t,"click",Q),n(e,"resize",a.hide,X)},ne=function(){oe(W),Y.call(o,P)},ie=function(){oe(R),Z(),Y.call(o,N)};a.toggle=function(){null===l?a.show():a.hide()},a.show=function(){clearTimeout(f),f=setTimeout(function(){if(null===l){if(Y.call(o,x),x.defaultPrevented)return;$(),ee(),_(),a[s]?j(l,ne):ne()}},20)},a.hide=function(){clearTimeout(f),f=setTimeout(function(){if(l&&null!==l&&B(l,"show")){if(Y.call(o,E),E.defaultPrevented)return;S(l,"show"),a[s]?j(l,ie):ie()}},a[r])},a.destroy=function(){a.hide(),te(R),delete o.Popover},F=V()[0],((J=V()[1])||a[d])&&(o.Popover||te(W),o.Popover=a)};a[T](["Popover",_,'[data-toggle="popover"]']);var ee=function(t,o){t=M(t),t.ScrollSpy&&t.ScrollSpy.destroy();var n=M(t[h]("data-target")),i=t[h]("data-offset");if(o=o||{},o[c]||n){for(var a,l=this,r=o[c]&&M(o[c])||n,s=r&&r.getElementsByTagName("A"),d=parseInt(o.offset||i)||10,u=[],f=[],p=t.offsetHeight=s&&h>a;if(!c&&p)B(o,k)||(D(o,k),l&&!B(l,k)&&D(l,k),Y.call(t,q("activate","scrollspy",u[e])));else if(p){if(!p&&!c||c&&p)return}else B(o,k)&&(S(o,k),l&&B(l,k)&&!L(o[v],k).length&&S(l,k))},P=function(t){t(p,"scroll",l.refresh,X),t(e,"resize",l.refresh,X)},E=function(){a=m?F().y:t.scrollTop;for(var e=0,o=u[g];e1&&(e=t[t[g]-1]):e=t[0],e},O=function(){return M(I()[h]("href"))},z=function(e){e.preventDefault(),c=e.currentTarget,!y.isAnimating&&!B(c,k)&&l.show()};l.show=function(){c=c||e,u=M(c[h]("href")),s=I(),d=O(),i=q("hide","tab",c),Y.call(s,i),i.defaultPrevented||(y.isAnimating=!0,S(s,k),s[p]("aria-selected","false"),D(c,k),c[p]("aria-selected","true"),A&&(B(e[v],"dropdown-menu")?B(A,k)||D(A,k):B(A,k)&&S(A,k)),B(d,"fade")?(S(d,"show"),j(d,N)):N())},l.destroy=function(){R(e,"click",z),delete e.Tab},e.Tab||W(e,"click",z),l.height&&(T=O()[v]),e.Tab=l}};a[T](["Tab",te,'[data-toggle="tab"]']);var oe=function(e,t){e=M(e),e.Toast&&e.Toast.destroy(),t=t||{};var o=this,n=H(e,".toast"),i=0,a=e[h]("data-animation"),l=e[h]("data-autohide"),c=e[h]("data-delay"),s=q("show","toast"),d=q("hide","toast"),u=q("shown","toast"),f=q("hidden","toast");o.animation=!1===t.animation||"false"===a?0:1,o.autohide=!1===t.autohide||"false"===l?0:1,o[r]=parseInt(t[r]||c)||500;var p=function(){S(n,"showing"),D(n,"show"),o.autohide&&o.hide(),Y.call(n,u)},m=function(){D(n,"hide"),Y.call(n,f)},v=function(){S(n,"show"),o.animation?j(n,m):m()},g=function(){clearTimeout(i),i=null,D(n,"hide"),R(e,"click",o.hide),e.Toast=null,e=null,n=null};o.show=function(){if(n){if(Y.call(n,s),s.defaultPrevented)return;o.animation&&D(n,"fade"),S(n,"hide"),D(n,"showing"),o.animation?j(n,p):p()}},o.hide=function(e){if(n&&B(n,"show")){if(Y.call(n,d),d.defaultPrevented)return;e?v():i=setTimeout(v,o[r])}},o.dispose=function(){n&&B(n,"show")&&(S(n,"show"),o.animation?j(n,g):g())},o.destroy=function(){o.hide(),clearTimeout(i),R(e,"click",o.hide),delete e.Toast},e.Toast||W(e,"click",o.hide),e.Toast=o};a[T](["Toast",oe,'[data-dismiss="toast"]']);var ne=function(o,i){o=M(o),i=i||{},o.Tooltip&&o.Tooltip.destroy();var a=this,l=0,c=null,f=o[h]("data-animation"),v=o[h]("data-placement"),g=o[h]("data-delay"),w=o[h]("data-container"),y=q("show","tooltip"),T=q("shown","tooltip"),k=q("hide","tooltip"),x=q("hidden","tooltip"),P=M(i.container),E=M(w),N=H(o,".modal"),I=H(o,".fixed-top"),L=H(o,".fixed-bottom");a[s]=i[s]&&"fade"!==i[s]?i[s]:f||"fade",a.placement=i.placement?i.placement:v||A,a[d]=i[d]?i[d]:null,a[r]=parseInt(i[r]||g)||200,a.container=P||(E||(I||(L||(N||t[n]))));var O,z="bs-tooltip-"+a.placement,U=function(){return o[h]("title")||o[h]("data-title")||o[h]("data-original-title")},F=function(){a.container.removeChild(c),c=null,l=null},J=function(){if(O=U()){if(c=t.createElement("div"),a[d]){var e=t.createElement("div");e[m]=a[d].trim(),c.className=e.firstChild.className,c[m]=e.firstChild[m],M(".tooltip-inner",c)[m]=O.trim()}else{var o=t.createElement("div");o[p]("class","arrow"),c.appendChild(o);var n=t.createElement("div");n[p]("class","tooltip-inner"),c.appendChild(n),n[m]=O}c[b][C]="0",c[b][A]="0",c[p]("role","tooltip"),!B(c,"tooltip")&&D(c,"tooltip"),!B(c,a[s])&&D(c,a[s]),!B(c,z)&&D(c,z),a.container.appendChild(c)}},K=function(){G(o,c,a.placement,a.container)},Q=function(){!B(c,"show")&&D(c,"show")},V=function(){W(e,"resize",a.hide,X),Y.call(o,T)},Z=function(){R(e,"resize",a.hide,X),F(),Y.call(o,x)},$=function(e){e(o,u[0],a.show),e(o,u[1],a.hide)};a.show=function(){clearTimeout(l),l=setTimeout(function(){if(null===c){if(Y.call(o,y),y.defaultPrevented)return;!1!==J()&&(K(),Q(),a[s]?j(c,V):V())}},20)},a.hide=function(){clearTimeout(l),l=setTimeout(function(){if(c&&B(c,"show")){if(Y.call(o,k),k.defaultPrevented)return;S(c,"show"),a[s]?j(c,Z):Z()}},a[r])},a.toggle=function(){c?a.hide():a.show()},a.destroy=function(){$(R),a.hide(),o[p]("title",o[h]("data-original-title")),o.removeAttribute("data-original-title"),delete o.Tooltip},(O=U())&&(o.Tooltip||(o[p]("data-original-title",O),o.removeAttribute("title"),$(W)),o.Tooltip=a)};a[T](["Tooltip",ne,'[data-toggle="tooltip"]']);var ie=function(e,t){for(var o=0,n=t[g];os.top+p.h/2-n.h/2,f=0>s.left+p.w/2-n.w/2,b=s.left+n.w/2+p.w/2>=l,y=s.top+n.h/2+p.h/2>=d,v=0>s.top-n.h,w=0>s.left-n.w,A=s.top+n.h+p.h>=d,k=s.left+n.w+p.w>=l;o=("left"===o||"right"===o)&&w&&k?"top":o,o="top"===o&&v?"bottom":o,o="bottom"===o&&A?"top":o,o="left"===o&&w?"right":o,o="right"===o&&k?"left":o;var T,x,N,C,E,M;-1===t.className.indexOf(o)&&(t.className=t.className.replace(P,o)),E=g.offsetWidth,M=g.offsetHeight,"left"===o||"right"===o?(x="left"===o?s.left+r.x-n.w-(h?E:0):s.left+r.x+p.w,m?(T=s.top+r.y,N=p.h/2-E):y?(T=s.top+r.y-n.h+p.h,N=n.h-p.h/2-E):(T=s.top+r.y-n.h/2+p.h/2,N=n.h/2-(h?.9*M:M/2))):(o===top||o===bottom)&&(T=o===top?s.top+r.y-n.h-(h?M:0):s.top+r.y+p.h,f?(x=0,C=s.left+p.w/2-E):b?(x=l-1.01*n.w,C=n.w-(l-s.left)+p.w/2-E/2):(x=s.left+r.x-n.w/2+p.w/2,C=n.w/2-(h?E:E/2))),t.style.top=T+"px",t.style.left=x+"px",N&&(g.style.top=N+"px"),C&&(g.style.left=C+"px")}var f=[],b={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},y="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],v=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});l(window,null,null,t)}catch(t){}return e}(),w=!!v&&{passive:!0},A="webkitTransition"in document.body.style||"transition"in document.body.style,k="webkitTransition"in document.body.style?"webkitTransitionEnd":"transitionend",T="webkitTransition"in document.body.style?"webkitTransitionDuration":"transitionDuration",x=function t(l){e(this,t),l=c(l),l.Alert&&l.Alert.destroy();var r=this,p=d("close","alert"),g=d("closed","alert"),u=function(){a(b,"fade")?h(b,f):f()},m=function(t){b=t.target.closest(".alert"),l=c("[data-dismiss=\"alert\"]",b),l&&b&&(l===t.target||l.contains(t.target))&&r.close()},f=function(){i(l,"click",m),b.parentNode.removeChild(b),s.call(b,g)};r.close=function(){if(b&&l&&a(b,"show")){if(s.call(b,p),p.defaultPrevented)return;r.destroy()}},r.destroy=function(){o(b,"show"),b&&u(),i(l,"click",m),delete l.Alert},l.Alert||n(l,"click",m);var b=l.closest(".alert");r.element=l,l.Alert=r};f.push(["Alert",x,"[data-dismiss=\"alert\"]"]);var N=function l(p){e(this,l),p=c(p),p.Button&&p.Button.destroy();var h=!1,g=this,u=d("change","button"),m=function(t){var e=t.which||t.keyCode;32===e&&t.target===document.activeElement&&b(t)},f=function(t){var e=t.which||t.keyCode;32===e&&t.preventDefault()},b=function(n){var e="LABEL"===n.target.tagName?n.target:"LABEL"===n.target.parentNode.tagName?n.target.parentNode:null;if(e){var l=r(e.parentNode,"btn"),d=e.getElementsByTagName("INPUT")[0];if(d){if(s.call(d,u),s.call(p,u),"checkbox"===d.type){if(u.defaultPrevented)return;d.checked?(o(e,"active"),d.getAttribute("checked"),d.removeAttribute("checked"),d.checked=!1):(t(e,"active"),d.getAttribute("checked"),d.setAttribute("checked","checked"),d.checked=!0),h||(h=!0)}if("radio"===d.type&&!h){if(u.defaultPrevented)return;if(!d.checked||0===n.screenX&&0==n.screenY){t(e,"active"),t(e,"focus"),d.setAttribute("checked","checked"),d.checked=!0,h=!0;for(var c=0,g=l.length;ctotal)){g=g||{},u.options={},u.options.keyboard=!0===g.keyboard||keyboardData,u.options.pause=!!("hover"===g.pause||pauseData)&&"hover",u.options.interval="number"==typeof intervalOption?intervalOption:!1===intervalOption||0===intervalData||!1===intervalData?0:isNaN(intervalData)?5e3:intervalData;var f,v,k=p.index=0,T=p.timer=0,x=!1,N=!1,C=null,E=null,P=null,M=u.direction=left,L=function(){!1===u.options.interval||a(p,"paused")||(t(p,"paused"),!x&&(clearInterval(T),T=null))},H=function(){!1!==u.options.interval&&a(p,"paused")&&(o(p,"paused"),!x&&(clearInterval(T),T=null),!x&&u.cycle())},D=function(t){if(t.preventDefault(),!x){var e=t.target;if(e&&!a(e,"active")&&e.getAttribute("data-slide-to"))k=parseInt(e.getAttribute("data-slide-to"),10);else return!1;u.slideTo(k)}},B=function(t){if(t.preventDefault(),!x){var e=t.currentTarget||t.srcElement;e===rightArrow?k++:e===leftArrow&&k--,u.slideTo(k)}},S=function(e){var t=e.which;if(!x){switch(t){case 39:k++;break;case 37:k--;break;default:return;}u.slideTo(k)}},I=function(e){u.options.pause&&u.options.interval&&(e(p,y[0],L),e(p,y[1],H),e(p,b.start,L,w),e(p,b.end,H,w)),1e(C-P))return!1;EC&&k--,N=!1,u.slideTo(k),R(i)}},X=function(){var e=p.getBoundingClientRect(),t=window.innerHeight||document.documentElement.clientHeight;return e.top<=t&&0<=e.bottom},U=function(e){for(var a=0,n=indicators.length;ai||l===total-1&&0===i)&&(M=u.direction="right"),0>i?i=total-1:i>=total&&(i=0),k=i,n="left"===M?"next":"prev",f=d("slide","carousel",slides[i]),v=d("slid","carousel",slides[i]),s.call(p,f),f.defaultPrevented||(x=!0,clearInterval(T),T=null,U(i),A&&a(p,"slide")?(t(slides[i],"carousel-item-".concat(n)),slides[i].offsetWidth,t(slides[i],"carousel-item-".concat(M)),t(slides[l],"carousel-item-".concat(M)),h(slides[i],function(d){var e=d&&d.target!==slides[i]?1e3*d.elapsedTime+100:20;x&&setTimeout(function(){x=!1,t(slides[i],"active"),o(slides[l],"active"),o(slides[i],"carousel-item-".concat(n)),o(slides[i],"carousel-item-".concat(M)),o(slides[l],"carousel-item-".concat(M)),s.call(p,v),document.hidden||!u.options.interval||a(p,"paused")||u.cycle()},e)})):(t(slides[i],"active"),slides[i].offsetWidth,o(slides[l],"active"),setTimeout(function(){x=!1,u.options.interval&&!a(p,"paused")&&u.cycle(),s.call(p,v)},100))))}},u.getActiveIndex=function(){return slides.indexOf(r(p,"carousel-item active")[0])||0},u.destroy=function(){I(i),clearInterval(T),delete p.Carousel},p.Carousel||I(n),0>u.getActiveIndex()&&(slides.length&&t(slides[0],"active"),indicators.length&&U(0)),u.options.interval&&u.cycle(),u.element=p,p.Carousel=u}};f.push(["Carousel",C,"[data-ride=\"carousel\"]"]);var E=function l(r,p){e(this,l),r=c(r),r.Collapse&&r.Collapse.destroy(),p=p||{};var g,u,m=null,f=null,b=this,y=r.getAttribute("data-parent"),v=d("show","collapse"),w=d("shown","collapse"),A=d("hide","collapse"),k=d("hidden","collapse"),T=function(e,i){s.call(e,v);v.defaultPrevented||(e.isAnimating=!0,t(e,"collapsing"),o(e,"collapse"),e.style.height="".concat(e.scrollHeight,"px"),h(e,function(){e.isAnimating=!1,e.setAttribute("aria-expanded","true"),i.setAttribute("aria-expanded","true"),o(e,"collapsing"),t(e,"collapse"),t(e,"show"),e.style.height="",s.call(e,w)}))},x=function(e,i){s.call(e,A);A.defaultPrevented||(e.isAnimating=!0,e.style.height="".concat(e.scrollHeight,"px"),o(e,"collapse"),o(e,"show"),t(e,"collapsing"),e.offsetWidth,e.style.height="0px",h(e,function(){e.isAnimating=!1,e.setAttribute("aria-expanded","false"),i.setAttribute("aria-expanded","false"),o(e,"collapsing"),t(e,"collapse"),e.style.height="",s.call(e,k)}))},N=function(){var e=r.href&&r.getAttribute("href"),t=r.getAttribute("data-target"),o=e||t&&"#"===t.charAt(0)&&t;return o&&c(o)};b.toggle=function(t){t.preventDefault(),a(f,"show")?b.hide():b.show()},b.hide=function(){f.isAnimating||(x(f,r),t(r,"collapsed"))},b.show=function(){m&&(g=c(".collapse.show",m),u=g&&(c("[data-target=\"#".concat(g.id,"\"]"),m)||c("[href=\"#".concat(g.id,"\"]"),m))),f.isAnimating&&(!g||g.isAnimating)||(u&&g!==f&&(x(g,u),t(u,"collapsed")),T(f,r),o(r,"collapsed"))},b.destroy=function(){i(r,"click",b.toggle),delete r.Collapse},r.Collapse||n(r,"click",b.toggle),f=N(),f.isAnimating=!1,m=c(p.parent)||y&&r.closest(y),f&&(b.collapse=f),m&&(b.options={},b.options.parent=m),b.element=r,r.Collapse=b};f.push(["Collapse",E,"[data-toggle=\"collapse\"]"]);var P=/\b(top|bottom|left|right)+/,M=function l(r,p){e(this,l),r=c(r),r.Dropdown&&r.Dropdown.destroy();var h,u,m,f,b=null,y=this,v=r.parentNode,w=c(".dropdown-menu",v),A=function(){for(var e=w.children,t=[],o=0;o\xD7",P=d("show","popover"),M=d("shown","popover"),L=d("hide","popover"),H=d("hidden","popover"),D=c(p.container),B=c(C),S=r.closest(".modal"),I=r.closest(".fixed-top"),R=r.closest(".fixed-bottom");p=p||{},v.options={},v.options.template=p.template?p.template:null,v.options.trigger=p.trigger?p.trigger:A||"hover",v.options.animation=p.animation&&"fade"!==p.animation?p.animation:k||"fade",v.options.placement=p.placement?p.placement:T||top,v.options.delay=parseInt(p.delay||N)||200,v.options.dismissible=!!(p.dismissible||"true"===x),v.options.container=D?D:B?B:I?I:R?R:S?S:document.body;var W="bs-popover-".concat(v.options.placement),O=function(t){null!==f&&t.target===c(".close",f)&&v.hide()},z=function(){return{0:p.title||r.getAttribute("data-title")||null,1:p.content||r.getAttribute("data-content")||null}},X=function(){v.options.container.removeChild(f),b=null,f=null},U=function(){g=z()[0]||null,u=z()[1],u=u?u.trim():null,f=document.createElement("div");var e=document.createElement("div");if(t(e,"arrow"),f.appendChild(e),null!==u&&null===v.options.template){if(f.setAttribute("role","tooltip"),null!==g){var o=document.createElement("h3");t(o,"popover-header"),o.innerHTML=v.options.dismissible?g+E:g,f.appendChild(o)}var i=document.createElement("div");t(i,"popover-body"),i.innerHTML=v.options.dismissible&&null===g?u+E:u,f.appendChild(i)}else{var n=document.createElement("div");n.innerHTML=v.options.template.trim(),f.className=n.firstChild.className,f.innerHTML=n.firstChild.innerHTML;var l=c(".popover-header",f),d=c(".popover-body",f);g&&l&&(l.innerHTML=g.trim()),u&&d&&(d.innerHTML=u.trim())}v.options.container.appendChild(f),f.style.display="block",a(f,"popover")||t(f,"popover"),a(f,v.options.animation)||t(f,v.options.animation),a(f,W)||t(f,W)},j=function(){a(f,"show")||t(f,"show")},q=function(){m(r,f,v.options.placement,v.options.container)},Y=function(e){"hover"===v.options.trigger?(e(r,y[0],v.show),!v.options.dismissible&&e(r,y[1],v.hide)):("click"==v.options.trigger||"focus"==v.options.trigger)&&e(r,v.options.trigger,v.toggle)},G=function(e){"click"!=v.options.trigger&&"focus"!=v.options.trigger||v.options.dismissible||e(r,"blur",v.hide),v.options.dismissible&&e(document,"click",O),e(window,"resize",v.hide,w)},K=function(){G(n),s.call(r,M)},V=function(){G(i),X(),s.call(r,H)};v.toggle=function(){null===f?v.show():v.hide()},v.show=function(){clearTimeout(b),b=setTimeout(function(){if(null===f){if(s.call(r,P),P.defaultPrevented)return;U(),q(),j(),v.options.animation?h(f,K):K()}},20)},v.hide=function(){clearTimeout(b),b=setTimeout(function(){if(f&&null!==f&&a(f,"show")){if(s.call(r,L),L.defaultPrevented)return;o(f,"show"),v.options.animation?h(f,V):V()}},v.options.delay)},v.destroy=function(){v.hide(),Y(i),delete r.Popover},g=z()[0],u=z()[1];(u||v.options.template)&&(!r.Popover&&Y(n),v.element=r,r.Popover=v)};f.push(["Popover",H,"[data-toggle=\"popover\"],[data-tip=\"popover\"]"]);var D=function l(r,p){e(this,l),r=c(r),r.ScrollSpy&&r.ScrollSpy.destroy(),p=p||{};for(var h,g=this,m=c(r.getAttribute("data-target")),f=r.getAttribute("data-offset"),b=p.target&&c(p.target)||m,y=b&&b.getElementsByTagName("A"),v=parseInt(p.offset||f)||10,A=r.offsetHeight=m&&f>h;if(!u&&b)a(i,"active")||(t(i,"active"),c&&!a(c,"active")&&t(c,"active"),s.call(r,d("activate","scrollspy",T[e])));else if(!b)a(i,"active")&&(o(i,"active"),c&&a(c,"active")&&!getElementsByClassName(i.parentNode,"active").length&&o(c,"active"));else if(!b&&!u||u&&b)return},L=function(e){e(A,"scroll",g.refresh,w),e(window,"resize",g.refresh,w)},H=function(){h=k?u().y:r.scrollTop;for(var e=0,t=T.length;e { + dismissibleHandler = e => { if (popover !== null && e.target === queryElement('.close',popover)) { self.hide(); } diff --git a/lib/src/scrollspy-native.js b/lib/src/scrollspy-native.js index 28f1e2d3..45c2ca32 100644 --- a/lib/src/scrollspy-native.js +++ b/lib/src/scrollspy-native.js @@ -3,9 +3,9 @@ -----------------------------------------------*/ // IMPORTS -import { supports } from './util/callbacks.js'; +import { supports } from './util/globals.js'; import { hasClass, addClass, removeClass } from './util/class.js'; -import { bootstrapCustomEvent, on, off, passiveHandler } from './util/event.js'; +import { bootstrapCustomEvent, dispatchCustomEvent, on, off, passiveHandler } from './util/event.js'; import { queryElement } from './util/selector.js'; import { getScroll } from './util/misc.js'; diff --git a/lib/src/tab-native.js b/lib/src/tab-native.js index 93cf38af..b8df2eda 100644 --- a/lib/src/tab-native.js +++ b/lib/src/tab-native.js @@ -3,9 +3,9 @@ -----------------------------------------*/ // IMPORTS -import { supports } from './util/callbacks.js'; +import { supports } from './util/globals.js'; import { hasClass, addClass, removeClass } from './util/class.js'; -import { bootstrapCustomEvent, on, off } from './util/event.js'; +import { bootstrapCustomEvent, dispatchCustomEvent, on, off } from './util/event.js'; import { queryElement, getElementsByClassName } from './util/selector.js'; import { supportTransitions, emulateTransitionEnd } from './util/transition.js'; diff --git a/lib/src/toast-native.js b/lib/src/toast-native.js index 15ab6307..bba1a353 100644 --- a/lib/src/toast-native.js +++ b/lib/src/toast-native.js @@ -3,9 +3,9 @@ ---------------------------------------------*/ // IMPORTS -import { supports } from './util/callbacks.js'; +import { supports } from './util/globals.js'; import { hasClass, addClass, removeClass } from './util/class.js'; -import { bootstrapCustomEvent, on, off } from './util/event.js'; +import { bootstrapCustomEvent, dispatchCustomEvent, on, off } from './util/event.js'; import { queryElement } from './util/selector.js'; import { emulateTransitionEnd } from './util/transition.js'; diff --git a/lib/src/tooltip-native.js b/lib/src/tooltip-native.js index d7f254c8..9f9e50bd 100644 --- a/lib/src/tooltip-native.js +++ b/lib/src/tooltip-native.js @@ -3,10 +3,10 @@ ---------------------------------------------*/ // IMPORTS -import { supports } from './util/callbacks.js'; +import { supports } from './util/globals.js'; import { styleTip } from './util/misc.js'; import { hasClass, addClass, removeClass } from './util/class.js'; -import { bootstrapCustomEvent, on, off, mouseHover, passiveHandler } from './util/event.js'; +import { bootstrapCustomEvent, dispatchCustomEvent, on, off, mouseHover, passiveHandler } from './util/event.js'; import { queryElement } from './util/selector.js'; import { emulateTransitionEnd } from './util/transition.js'; diff --git a/lib/src/util/callbacks.js b/lib/src/util/callbacks.js index 69a43d15..e18745c5 100644 --- a/lib/src/util/callbacks.js +++ b/lib/src/util/callbacks.js @@ -1,14 +1,8 @@ -import on from './event.js' - -// globals -const globalObject = typeof global !== 'undefined' ? global : this||window; -const BSN = globalObject.BSN = {}; -export const supports = globalObject.BSN.supports = []; - +import { supports } from './globals.js' /* Native JavaScript for Bootstrap | Initialize Data API --------------------------------------------------------*/ -export const initCallback = BSN.initCallback = function(lookUp){ +export const initCallback = function(lookUp){ lookUp = lookUp || document; const initializeDataAPI = function( constructor, collection ){ for (let i=0, cl=collection.length; i= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "bundled": true, + "dev": true, + "optional": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true, + "optional": true + }, + "minipass": { + "version": "2.9.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.3.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.9.0" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "needle": { + "version": "2.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "^3.2.6", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.14.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4.4.2" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-normalize-package-bin": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.4.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.7.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, + "semver": { + "version": "5.7.1", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.13", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.3" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "yallist": { + "version": "3.1.1", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "graceful-fs": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", + "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hosted-git-info": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", + "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==", + "dev": true + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "^2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "js-levenshtein": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", + "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json5": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.1.tgz", + "integrity": "sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", + "dev": true + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "math-random": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", + "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==", + "dev": true + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "node-releases": { + "version": "1.1.44", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.44.tgz", + "integrity": "sha512-NwbdvJyR7nrcGrXvKAvzc5raj/NkoJudkarh2yIpJ4t0NH4aqjUDz/486P+ynIW5eokKOfzGNRdYoLfBlomruw==", + "dev": true, + "requires": { + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "onchange": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/onchange/-/onchange-3.3.0.tgz", + "integrity": "sha512-0ZQIdGkhG8Y+r8BIcjjDV93X59KkZ4Cc+ZxA9N+wA/3vm1cvd8/f2NXlCPCZpowSd78eCERk29dtuS8+X97MLg==", + "dev": true, + "requires": { + "arrify": "~1.0.1", + "chokidar": "~1.7.0", + "cross-spawn": "~5.1.0", + "minimist": "~1.2.0", + "tree-kill": "~1.2.0" + } + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "requires": { + "lcid": "^1.0.0" + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "randomatic": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", + "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", + "dev": true, + "requires": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + } + } + }, + "regenerate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "dev": true + }, + "regenerate-unicode-properties": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz", + "integrity": "sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA==", + "dev": true, + "requires": { + "regenerate": "^1.4.0" + } + }, + "regenerator-transform": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.1.tgz", + "integrity": "sha512-flVuee02C3FKRISbxhXl9mGzdbWUVHubl1SMaknjxkFB1/iqpJhArQUvRxOOPEc/9tAiX0BaQ28FJH10E4isSQ==", + "dev": true, + "requires": { + "private": "^0.1.6" + } + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexpu-core": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.6.0.tgz", + "integrity": "sha512-YlVaefl8P5BnFYOITTNzDvan1ulLOiXJzCNZxduTIosN17b87h3bvG9yHMoHaRuo88H4mQ06Aodj5VtYGGGiTg==", + "dev": true, + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.1.0", + "regjsgen": "^0.5.0", + "regjsparser": "^0.6.0", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.1.0" + } + }, + "regjsgen": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.1.tgz", + "integrity": "sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg==", + "dev": true + }, + "regjsparser": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.2.tgz", + "integrity": "sha512-E9ghzUtoLwDekPT0DYCp+c4h+bvuUpe6rRHCTYn6eGoqj1LgKXxT6I0Il4WbjhQkOghzi/V+y03bPKvbllL93Q==", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "resolve": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", + "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "rollup": { + "version": "1.27.14", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.27.14.tgz", + "integrity": "sha512-DuDjEyn8Y79ALYXMt+nH/EI58L5pEw5HU9K38xXdRnxQhvzUTI/nxAawhkAHUQeudANQ//8iyrhVRHJBuR6DSQ==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/node": "*", + "acorn": "^7.1.0" + } + }, + "rollup-plugin-babel": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/rollup-plugin-babel/-/rollup-plugin-babel-4.3.3.tgz", + "integrity": "sha512-tKzWOCmIJD/6aKNz0H1GMM+lW1q9KyFubbWzGiOG540zxPPifnEAHTZwjo0g991Y+DyOZcLqBgqOdqazYE5fkw==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "rollup-pluginutils": "^2.8.1" + } + }, + "rollup-plugin-babel-minify": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-babel-minify/-/rollup-plugin-babel-minify-9.1.1.tgz", + "integrity": "sha512-/Jph4PungzuB4h8uPSNKJQ16GjxVTfaRT6f4EwZW5NfD7RU7niFSEMMCZAlM6ezf11MBo1ttQcei+FisyCxicg==", + "dev": true, + "requires": { + "@babel/core": "^7.7.2", + "@babel/plugin-syntax-dynamic-import": "^7.2.0", + "@comandeer/babel-plugin-banner": "^5.0.0", + "babel-preset-minify": "^0.5.1", + "sourcemap-codec": "^1.4.6" + } + }, + "rollup-pluginutils": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", + "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", + "dev": true, + "requires": { + "estree-walker": "^0.6.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "dev": true, + "requires": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "sourcemap-codec": { + "version": "1.4.6", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.6.tgz", + "integrity": "sha512-1ZooVLYFxC448piVLBbtOxFcXwnymH9oUF8nRd3CuYDVvkRBxRl6pB4Mtas5a4drtL+E8LDgFkQNcgIw6tc8Hg==", + "dev": true + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + } + } + }, + "tree-kill": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.1.tgz", + "integrity": "sha512-4hjqbObwlh2dLyW4tcz0Ymw0ggoaVDMveUB9w8kFSQScdRLo0gxO9J7WFcUBo+W3C1TLdFIEwNOWebgZZ0RH9Q==", + "dev": true + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "requires": { + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" + }, + "dependencies": { + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "requires": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + }, + "dependencies": { + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "requires": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + } + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "requires": { + "align-text": "^0.1.1" + } + }, + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true + } + } + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + }, + "dependencies": { + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + } + } + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz", + "integrity": "sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g==", + "dev": true + }, + "unicode-property-aliases-ecmascript": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz", + "integrity": "sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw==", + "dev": true + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "dev": true + }, + "window-size": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", + "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargs": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-5.0.0.tgz", + "integrity": "sha1-M1UUSXfQV1fbuG1uOOwFYSOzpm4=", + "dev": true, + "requires": { + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "lodash.assign": "^4.2.0", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "window-size": "^0.2.0", + "y18n": "^3.2.1", + "yargs-parser": "^3.2.0" + } + }, + "yargs-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-3.2.0.tgz", + "integrity": "sha1-UIE1XRnZ0MjF2BrakIy05tGGZk8=", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "lodash.assign": "^4.1.0" + } + } + } +} diff --git a/package.json b/package.json index 1860cfd1..2de59cc7 100644 --- a/package.json +++ b/package.json @@ -6,12 +6,17 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "help": "node lib/build.js --help", - "build": "node lib/build.js -v 3 > dist/bootstrap-native.js && npm run build-min", + "build": "rollup -c", "build-v4": "node lib/build.js -v 4 > dist/bootstrap-native-v4.js && npm run build-v4-min", "build-min": "node lib/build.js -m -v 3 > dist/bootstrap-native.min.js", "build-v4-min": "node lib/build.js -m -v 4 > dist/bootstrap-native-v4.min.js", - "watch": "onchange \"lib/*/**\" -i -- npm run build && npm run build-v4" + "watch": "rollup -c -w" }, + "browserslist": [ + "last 2 versions", + "not <= 1%", + "not IE 10" + ], "repository": { "type": "git", "url": "git+https://github.com/thednp/bootstrap.native.git" @@ -30,11 +35,13 @@ }, "homepage": "https://thednp.github.io/bootstrap.native/", "devDependencies": { - "onchange": "^3.0.2", + "@babel/core": "^7.7.7", + "@babel/preset-env": "^7.7.7", + "rollup": "^1.27.14", + "rollup-plugin-babel": "^4.3.3", + "rollup-plugin-babel-minify": "^9.1.1", "uglify-js": "^2.7.3", - "yargs": "^5.0.0", - "babel": "^6.23.0", - "babel-polyfill": "^6.26.0" + "yargs": "^5.0.0" }, "dependencies": {} } diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 00000000..7a07a1fc --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,41 @@ +import babel from 'rollup-plugin-babel' +import minify from 'rollup-plugin-babel-minify' + +export default [ + { + input: 'lib/src/index.js', + output: { + name: 'bootstrap.native', + file: './dist/bootstrap-native-v4.js', + format: 'umd', // or iife + globals: { + bsn: 'bsn' + } + }, + plugins: [ + babel({ + exclude: 'node_modules/**' // only transpile our source code + }) + ] + }, + // Minfied version + { + input: 'lib/src/index.js', + output: { + name: 'bootstrap.native', + file: './dist/bootstrap-native-v4.min.js', + format: 'umd', // or iife + globals: { + bsn: 'bsn' + } + }, + plugins: [ + babel({ + exclude: 'node_modules/**' // only transpile our source code + }), + minify({ + comments: false + }) + ] + } +]