nharrel/ValuesProject
0
1(function webpackUniversalModuleDefinition(root, factory) {2 if(typeof exports === 'object' && typeof module === 'object')3 module.exports = factory();4 else if(typeof define === 'function' && define.amd)5 define([], factory);6 else if(typeof exports === 'object')7 exports["bulmaCarousel"] = factory();8 else9 root["bulmaCarousel"] = factory();10})(typeof self !== 'undefined' ? self : this, function() {11return /******/ (function(modules) { // webpackBootstrap12/******/ // The module cache13/******/ var installedModules = {};14/******/15/******/ // The require function16/******/ function __webpack_require__(moduleId) {17/******/18/******/ // Check if module is in cache19/******/ if(installedModules[moduleId]) {20/******/ return installedModules[moduleId].exports;21/******/ }22/******/ // Create a new module (and put it into the cache)23/******/ var module = installedModules[moduleId] = {24/******/ i: moduleId,25/******/ l: false,26/******/ exports: {}27/******/ };28/******/29/******/ // Execute the module function30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);31/******/32/******/ // Flag the module as loaded33/******/ module.l = true;34/******/35/******/ // Return the exports of the module36/******/ return module.exports;37/******/ }38/******/39/******/40/******/ // expose the modules object (__webpack_modules__)41/******/ __webpack_require__.m = modules;42/******/43/******/ // expose the module cache44/******/ __webpack_require__.c = installedModules;45/******/46/******/ // define getter function for harmony exports47/******/ __webpack_require__.d = function(exports, name, getter) {48/******/ if(!__webpack_require__.o(exports, name)) {49/******/ Object.defineProperty(exports, name, {50/******/ configurable: false,51/******/ enumerable: true,52/******/ get: getter53/******/ });54/******/ }55/******/ };56/******/57/******/ // getDefaultExport function for compatibility with non-harmony modules58/******/ __webpack_require__.n = function(module) {59/******/ var getter = module && module.__esModule ?60/******/ function getDefault() { return module['default']; } :61/******/ function getModuleExports() { return module; };62/******/ __webpack_require__.d(getter, 'a', getter);63/******/ return getter;64/******/ };65/******/66/******/ // Object.prototype.hasOwnProperty.call67/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };68/******/69/******/ // __webpack_public_path__70/******/ __webpack_require__.p = "";71/******/72/******/ // Load entry module and return exports73/******/ return __webpack_require__(__webpack_require__.s = 5);74/******/ })75/************************************************************************/76/******/ ([77/* 0 */78/***/ (function(module, __webpack_exports__, __webpack_require__) {79 80"use strict";81/* unused harmony export addClasses */82/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return removeClasses; });83/* unused harmony export show */84/* unused harmony export hide */85/* unused harmony export offset */86/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return width; });87/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return height; });88/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return outerHeight; });89/* unused harmony export outerWidth */90/* unused harmony export position */91/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return css; });92/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__type__ = __webpack_require__(2);93 94 95var addClasses = function addClasses(element, classes) {96 classes = Array.isArray(classes) ? classes : classes.split(' ');97 classes.forEach(function (cls) {98 element.classList.add(cls);99 });100};101 102var removeClasses = function removeClasses(element, classes) {103 classes = Array.isArray(classes) ? classes : classes.split(' ');104 classes.forEach(function (cls) {105 element.classList.remove(cls);106 });107};108 109var show = function show(elements) {110 elements = Array.isArray(elements) ? elements : [elements];111 elements.forEach(function (element) {112 element.style.display = '';113 });114};115 116var hide = function hide(elements) {117 elements = Array.isArray(elements) ? elements : [elements];118 elements.forEach(function (element) {119 element.style.display = 'none';120 });121};122 123var offset = function offset(element) {124 var rect = element.getBoundingClientRect();125 return {126 top: rect.top + document.body.scrollTop,127 left: rect.left + document.body.scrollLeft128 };129};130 131// returns an element's width132var width = function width(element) {133 return element.getBoundingClientRect().width || element.offsetWidth;134};135// returns an element's height136var height = function height(element) {137 return element.getBoundingClientRect().height || element.offsetHeight;138};139 140var outerHeight = function outerHeight(element) {141 var withMargin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;142 143 var height = element.offsetHeight;144 if (withMargin) {145 var style = window.getComputedStyle(element);146 height += parseInt(style.marginTop) + parseInt(style.marginBottom);147 }148 return height;149};150 151var outerWidth = function outerWidth(element) {152 var withMargin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;153 154 var width = element.offsetWidth;155 if (withMargin) {156 var style = window.getComputedStyle(element);157 width += parseInt(style.marginLeft) + parseInt(style.marginRight);158 }159 return width;160};161 162var position = function position(element) {163 return {164 left: element.offsetLeft,165 top: element.offsetTop166 };167};168 169var css = function css(element, obj) {170 if (!obj) {171 return window.getComputedStyle(element);172 }173 if (Object(__WEBPACK_IMPORTED_MODULE_0__type__["b" /* isObject */])(obj)) {174 var style = '';175 Object.keys(obj).forEach(function (key) {176 style += key + ': ' + obj[key] + ';';177 });178 179 element.style.cssText += style;180 }181};182 183/***/ }),184/* 1 */185/***/ (function(module, __webpack_exports__, __webpack_require__) {186 187"use strict";188/* harmony export (immutable) */ __webpack_exports__["a"] = detectSupportsPassive;189function detectSupportsPassive() {190 var supportsPassive = false;191 192 try {193 var opts = Object.defineProperty({}, 'passive', {194 get: function get() {195 supportsPassive = true;196 }197 });198 199 window.addEventListener('testPassive', null, opts);200 window.removeEventListener('testPassive', null, opts);201 } catch (e) {}202 203 return supportsPassive;204}205 206/***/ }),207/* 2 */208/***/ (function(module, __webpack_exports__, __webpack_require__) {209 210"use strict";211/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isFunction; });212/* unused harmony export isNumber */213/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isString; });214/* unused harmony export isDate */215/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isObject; });216/* unused harmony export isEmptyObject */217/* unused harmony export isNode */218/* unused harmony export isVideo */219/* unused harmony export isHTML5 */220/* unused harmony export isIFrame */221/* unused harmony export isYoutube */222/* unused harmony export isVimeo */223var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };224 225var isFunction = function isFunction(unknown) {226 return typeof unknown === 'function';227};228var isNumber = function isNumber(unknown) {229 return typeof unknown === "number";230};231var isString = function isString(unknown) {232 return typeof unknown === 'string' || !!unknown && (typeof unknown === 'undefined' ? 'undefined' : _typeof(unknown)) === 'object' && Object.prototype.toString.call(unknown) === '[object String]';233};234var isDate = function isDate(unknown) {235 return (Object.prototype.toString.call(unknown) === '[object Date]' || unknown instanceof Date) && !isNaN(unknown.valueOf());236};237var isObject = function isObject(unknown) {238 return (typeof unknown === 'function' || (typeof unknown === 'undefined' ? 'undefined' : _typeof(unknown)) === 'object' && !!unknown) && !Array.isArray(unknown);239};240var isEmptyObject = function isEmptyObject(unknown) {241 for (var name in unknown) {242 if (unknown.hasOwnProperty(name)) {243 return false;244 }245 }246 return true;247};248 249var isNode = function isNode(unknown) {250 return !!(unknown && unknown.nodeType === HTMLElement | SVGElement);251};252var isVideo = function isVideo(unknown) {253 return isYoutube(unknown) || isVimeo(unknown) || isHTML5(unknown);254};255var isHTML5 = function isHTML5(unknown) {256 return isNode(unknown) && unknown.tagName === 'VIDEO';257};258var isIFrame = function isIFrame(unknown) {259 return isNode(unknown) && unknown.tagName === 'IFRAME';260};261var isYoutube = function isYoutube(unknown) {262 return isIFrame(unknown) && !!unknown.src.match(/\/\/.*?youtube(-nocookie)?\.[a-z]+\/(watch\?v=[^&\s]+|embed)|youtu\.be\/.*/);263};264var isVimeo = function isVimeo(unknown) {265 return isIFrame(unknown) && !!unknown.src.match(/vimeo\.com\/video\/.*/);266};267 268/***/ }),269/* 3 */270/***/ (function(module, __webpack_exports__, __webpack_require__) {271 272"use strict";273var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();274 275function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }276 277function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }278 279var EventEmitter = function () {280 function EventEmitter() {281 var events = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];282 283 _classCallCheck(this, EventEmitter);284 285 this.events = new Map(events);286 }287 288 _createClass(EventEmitter, [{289 key: "on",290 value: function on(name, cb) {291 var _this = this;292 293 this.events.set(name, [].concat(_toConsumableArray(this.events.has(name) ? this.events.get(name) : []), [cb]));294 295 return function () {296 return _this.events.set(name, _this.events.get(name).filter(function (fn) {297 return fn !== cb;298 }));299 };300 }301 }, {302 key: "emit",303 value: function emit(name) {304 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {305 args[_key - 1] = arguments[_key];306 }307 308 return this.events.has(name) && this.events.get(name).map(function (fn) {309 return fn.apply(undefined, args);310 });311 }312 }]);313 314 return EventEmitter;315}();316 317/* harmony default export */ __webpack_exports__["a"] = (EventEmitter);318 319/***/ }),320/* 4 */321/***/ (function(module, __webpack_exports__, __webpack_require__) {322 323"use strict";324var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();325 326function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }327 328var Coordinate = function () {329 function Coordinate() {330 var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;331 var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;332 333 _classCallCheck(this, Coordinate);334 335 this._x = x;336 this._y = y;337 }338 339 _createClass(Coordinate, [{340 key: 'add',341 value: function add(coord) {342 return new Coordinate(this._x + coord._x, this._y + coord._y);343 }344 }, {345 key: 'sub',346 value: function sub(coord) {347 return new Coordinate(this._x - coord._x, this._y - coord._y);348 }349 }, {350 key: 'distance',351 value: function distance(coord) {352 var deltaX = this._x - coord._x;353 var deltaY = this._y - coord._y;354 355 return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));356 }357 }, {358 key: 'max',359 value: function max(coord) {360 var x = Math.max(this._x, coord._x);361 var y = Math.max(this._y, coord._y);362 363 return new Coordinate(x, y);364 }365 }, {366 key: 'equals',367 value: function equals(coord) {368 if (this == coord) {369 return true;370 }371 if (!coord || coord == null) {372 return false;373 }374 return this._x == coord._x && this._y == coord._y;375 }376 }, {377 key: 'inside',378 value: function inside(northwest, southeast) {379 if (this._x >= northwest._x && this._x <= southeast._x && this._y >= northwest._y && this._y <= southeast._y) {380 381 return true;382 }383 return false;384 }385 }, {386 key: 'constrain',387 value: function constrain(min, max) {388 if (min._x > max._x || min._y > max._y) {389 return this;390 }391 392 var x = this._x,393 y = this._y;394 395 if (min._x !== null) {396 x = Math.max(x, min._x);397 }398 if (max._x !== null) {399 x = Math.min(x, max._x);400 }401 if (min._y !== null) {402 y = Math.max(y, min._y);403 }404 if (max._y !== null) {405 y = Math.min(y, max._y);406 }407 408 return new Coordinate(x, y);409 }410 }, {411 key: 'reposition',412 value: function reposition(element) {413 element.style['top'] = this._y + 'px';414 element.style['left'] = this._x + 'px';415 }416 }, {417 key: 'toString',418 value: function toString() {419 return '(' + this._x + ',' + this._y + ')';420 }421 }, {422 key: 'x',423 get: function get() {424 return this._x;425 },426 set: function set() {427 var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;428 429 this._x = value;430 return this;431 }432 }, {433 key: 'y',434 get: function get() {435 return this._y;436 },437 set: function set() {438 var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;439 440 this._y = value;441 return this;442 }443 }]);444 445 return Coordinate;446}();447 448/* harmony default export */ __webpack_exports__["a"] = (Coordinate);449 450/***/ }),451/* 5 */452/***/ (function(module, __webpack_exports__, __webpack_require__) {453 454"use strict";455Object.defineProperty(__webpack_exports__, "__esModule", { value: true });456/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_index__ = __webpack_require__(6);457/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_css__ = __webpack_require__(0);458/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_type__ = __webpack_require__(2);459/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_eventEmitter__ = __webpack_require__(3);460/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__components_autoplay__ = __webpack_require__(7);461/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__components_breakpoint__ = __webpack_require__(9);462/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__components_infinite__ = __webpack_require__(10);463/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__components_loop__ = __webpack_require__(11);464/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__components_navigation__ = __webpack_require__(13);465/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__components_pagination__ = __webpack_require__(15);466/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__components_swipe__ = __webpack_require__(18);467/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__components_transitioner__ = __webpack_require__(19);468/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__defaultOptions__ = __webpack_require__(22);469/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__templates__ = __webpack_require__(23);470/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__templates_item__ = __webpack_require__(24);471var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };472 473var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();474 475function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }476 477function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }478 479function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }480 481function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501var bulmaCarousel = function (_EventEmitter) {502 _inherits(bulmaCarousel, _EventEmitter);503 504 function bulmaCarousel(selector) {505 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};506 507 _classCallCheck(this, bulmaCarousel);508 509 var _this = _possibleConstructorReturn(this, (bulmaCarousel.__proto__ || Object.getPrototypeOf(bulmaCarousel)).call(this));510 511 _this.element = Object(__WEBPACK_IMPORTED_MODULE_2__utils_type__["c" /* isString */])(selector) ? document.querySelector(selector) : selector;512 // An invalid selector or non-DOM node has been provided.513 if (!_this.element) {514 throw new Error('An invalid selector or non-DOM node has been provided.');515 }516 _this._clickEvents = ['click', 'touch'];517 518 // Use Element dataset values to override options519 var elementConfig = _this.element.dataset ? Object.keys(_this.element.dataset).filter(function (key) {520 return Object.keys(__WEBPACK_IMPORTED_MODULE_12__defaultOptions__["a" /* default */]).includes(key);521 }).reduce(function (obj, key) {522 return _extends({}, obj, _defineProperty({}, key, _this.element.dataset[key]));523 }, {}) : {};524 // Set default options - dataset attributes are master525 _this.options = _extends({}, __WEBPACK_IMPORTED_MODULE_12__defaultOptions__["a" /* default */], options, elementConfig);526 527 _this._id = Object(__WEBPACK_IMPORTED_MODULE_0__utils_index__["a" /* uuid */])('slider');528 529 _this.onShow = _this.onShow.bind(_this);530 531 // Initiate plugin532 _this._init();533 return _this;534 }535 536 /**537 * Initiate all DOM element containing datePicker class538 * @method539 * @return {Array} Array of all datePicker instances540 */541 542 543 _createClass(bulmaCarousel, [{544 key: '_init',545 546 547 /****************************************************548 * *549 * PRIVATE FUNCTIONS *550 * *551 ****************************************************/552 /**553 * Initiate plugin instance554 * @method _init555 * @return {Slider} Current plugin instance556 */557 value: function _init() {558 this._items = Array.from(this.element.children);559 560 // Load plugins561 this._breakpoint = new __WEBPACK_IMPORTED_MODULE_5__components_breakpoint__["a" /* default */](this);562 this._autoplay = new __WEBPACK_IMPORTED_MODULE_4__components_autoplay__["a" /* default */](this);563 this._navigation = new __WEBPACK_IMPORTED_MODULE_8__components_navigation__["a" /* default */](this);564 this._pagination = new __WEBPACK_IMPORTED_MODULE_9__components_pagination__["a" /* default */](this);565 this._infinite = new __WEBPACK_IMPORTED_MODULE_6__components_infinite__["a" /* default */](this);566 this._loop = new __WEBPACK_IMPORTED_MODULE_7__components_loop__["a" /* default */](this);567 this._swipe = new __WEBPACK_IMPORTED_MODULE_10__components_swipe__["a" /* default */](this);568 569 this._build();570 571 if (Object(__WEBPACK_IMPORTED_MODULE_2__utils_type__["a" /* isFunction */])(this.options.onReady)) {572 this.options.onReady(this);573 }574 575 return this;576 }577 578 /**579 * Build Slider HTML component and append it to the DOM580 * @method _build581 */582 583 }, {584 key: '_build',585 value: function _build() {586 var _this2 = this;587 588 // Generate HTML Fragment of template589 this.node = document.createRange().createContextualFragment(Object(__WEBPACK_IMPORTED_MODULE_13__templates__["a" /* default */])(this.id));590 // Save pointers to template parts591 this._ui = {592 wrapper: this.node.firstChild,593 container: this.node.querySelector('.slider-container')594 595 // Add slider to DOM596 };this.element.appendChild(this.node);597 this._ui.wrapper.classList.add('is-loading');598 this._ui.container.style.opacity = 0;599 600 this._transitioner = new __WEBPACK_IMPORTED_MODULE_11__components_transitioner__["a" /* default */](this);601 602 // Wrap all items by slide element603 this._slides = this._items.map(function (item, index) {604 return _this2._createSlide(item, index);605 });606 607 this.reset();608 609 this._bindEvents();610 611 this._ui.container.style.opacity = 1;612 this._ui.wrapper.classList.remove('is-loading');613 }614 615 /**616 * Bind all events617 * @method _bindEvents618 * @return {void}619 */620 621 }, {622 key: '_bindEvents',623 value: function _bindEvents() {624 this.on('show', this.onShow);625 }626 }, {627 key: '_unbindEvents',628 value: function _unbindEvents() {629 this.off('show', this.onShow);630 }631 }, {632 key: '_createSlide',633 value: function _createSlide(item, index) {634 var slide = document.createRange().createContextualFragment(Object(__WEBPACK_IMPORTED_MODULE_14__templates_item__["a" /* default */])()).firstChild;635 slide.dataset.sliderIndex = index;636 slide.appendChild(item);637 return slide;638 }639 640 /**641 * Calculate slider dimensions642 */643 644 }, {645 key: '_setDimensions',646 value: function _setDimensions() {647 var _this3 = this;648 649 if (!this.options.vertical) {650 if (this.options.centerMode) {651 this._ui.wrapper.style.padding = '0px ' + this.options.centerPadding;652 }653 } else {654 this._ui.wrapper.style.height = Object(__WEBPACK_IMPORTED_MODULE_1__utils_css__["c" /* outerHeight */])(this._slides[0]) * this.slidesToShow;655 if (this.options.centerMode) {656 this._ui.wrapper.style.padding = this.options.centerPadding + ' 0px';657 }658 }659 660 this._wrapperWidth = Object(__WEBPACK_IMPORTED_MODULE_1__utils_css__["e" /* width */])(this._ui.wrapper);661 this._wrapperHeight = Object(__WEBPACK_IMPORTED_MODULE_1__utils_css__["c" /* outerHeight */])(this._ui.wrapper);662 663 if (!this.options.vertical) {664 this._slideWidth = Math.ceil(this._wrapperWidth / this.slidesToShow);665 this._containerWidth = Math.ceil(this._slideWidth * this._slides.length);666 this._ui.container.style.width = this._containerWidth + 'px';667 } else {668 this._slideWidth = Math.ceil(this._wrapperWidth);669 this._containerHeight = Math.ceil(Object(__WEBPACK_IMPORTED_MODULE_1__utils_css__["c" /* outerHeight */])(this._slides[0]) * this._slides.length);670 this._ui.container.style.height = this._containerHeight + 'px';671 }672 673 this._slides.forEach(function (slide) {674 slide.style.width = _this3._slideWidth + 'px';675 });676 }677 }, {678 key: '_setHeight',679 value: function _setHeight() {680 if (this.options.effect !== 'translate') {681 this._ui.container.style.height = Object(__WEBPACK_IMPORTED_MODULE_1__utils_css__["c" /* outerHeight */])(this._slides[this.state.index]) + 'px';682 }683 }684 685 // Update slides classes686 687 }, {688 key: '_setClasses',689 value: function _setClasses() {690 var _this4 = this;691 692 this._slides.forEach(function (slide) {693 Object(__WEBPACK_IMPORTED_MODULE_1__utils_css__["d" /* removeClasses */])(slide, 'is-active is-current is-slide-previous is-slide-next');694 if (Math.abs((_this4.state.index - 1) % _this4.state.length) === parseInt(slide.dataset.sliderIndex, 10)) {695 slide.classList.add('is-slide-previous');696 }697 if (Math.abs(_this4.state.index % _this4.state.length) === parseInt(slide.dataset.sliderIndex, 10)) {698 slide.classList.add('is-current');699 }700 if (Math.abs((_this4.state.index + 1) % _this4.state.length) === parseInt(slide.dataset.sliderIndex, 10)) {701 slide.classList.add('is-slide-next');702 }703 });704 }705 706 /****************************************************707 * *708 * GETTERS and SETTERS *709 * *710 ****************************************************/711 712 /**713 * Get id of current datePicker714 */715 716 }, {717 key: 'onShow',718 719 720 /****************************************************721 * *722 * EVENTS FUNCTIONS *723 * *724 ****************************************************/725 value: function onShow(e) {726 this._navigation.refresh();727 this._pagination.refresh();728 this._setClasses();729 }730 731 /****************************************************732 * *733 * PUBLIC FUNCTIONS *734 * *735 ****************************************************/736 737 }, {738 key: 'next',739 value: function next() {740 if (!this.options.loop && !this.options.infinite && this.state.index + this.slidesToScroll > this.state.length - this.slidesToShow && !this.options.centerMode) {741 this.state.next = this.state.index;742 } else {743 this.state.next = this.state.index + this.slidesToScroll;744 }745 this.show();746 }747 }, {748 key: 'previous',749 value: function previous() {750 if (!this.options.loop && !this.options.infinite && this.state.index === 0) {751 this.state.next = this.state.index;752 } else {753 this.state.next = this.state.index - this.slidesToScroll;754 }755 this.show();756 }757 }, {758 key: 'start',759 value: function start() {760 this._autoplay.start();761 }762 }, {763 key: 'pause',764 value: function pause() {765 this._autoplay.pause();766 }767 }, {768 key: 'stop',769 value: function stop() {770 this._autoplay.stop();771 }772 }, {773 key: 'show',774 value: function show(index) {775 var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;776 777 // If all slides are already visible then return778 if (!this.state.length || this.state.length <= this.slidesToShow) {779 return;780 }781 782 if (typeof index === 'Number') {783 this.state.next = index;784 }785 786 if (this.options.loop) {787 this._loop.apply();788 }789 if (this.options.infinite) {790 this._infinite.apply();791 }792 793 // If new slide is already the current one then return794 if (this.state.index === this.state.next) {795 return;796 }797 798 this.emit('before:show', this.state);799 this._transitioner.apply(force, this._setHeight.bind(this));800 this.emit('after:show', this.state);801 802 this.emit('show', this);803 }804 }, {805 key: 'reset',806 value: function reset() {807 var _this5 = this;808 809 this.state = {810 length: this._items.length,811 index: Math.abs(this.options.initialSlide),812 next: Math.abs(this.options.initialSlide),813 prev: undefined814 };815 816 // Fix options817 if (this.options.loop && this.options.infinite) {818 this.options.loop = false;819 }820 if (this.options.slidesToScroll > this.options.slidesToShow) {821 this.options.slidesToScroll = this.slidesToShow;822 }823 this._breakpoint.init();824 825 if (this.state.index >= this.state.length && this.state.index !== 0) {826 this.state.index = this.state.index - this.slidesToScroll;827 }828 if (this.state.length <= this.slidesToShow) {829 this.state.index = 0;830 }831 832 this._ui.wrapper.appendChild(this._navigation.init().render());833 this._ui.wrapper.appendChild(this._pagination.init().render());834 835 if (this.options.navigationSwipe) {836 this._swipe.bindEvents();837 } else {838 this._swipe._bindEvents();839 }840 841 this._breakpoint.apply();842 // Move all created slides into slider843 this._slides.forEach(function (slide) {844 return _this5._ui.container.appendChild(slide);845 });846 this._transitioner.init().apply(true, this._setHeight.bind(this));847 848 if (this.options.autoplay) {849 this._autoplay.init().start();850 }851 }852 853 /**854 * Destroy Slider855 * @method destroy856 */857 858 }, {859 key: 'destroy',860 value: function destroy() {861 var _this6 = this;862 863 this._unbindEvents();864 this._items.forEach(function (item) {865 _this6.element.appendChild(item);866 });867 this.node.remove();868 }869 }, {870 key: 'id',871 get: function get() {872 return this._id;873 }874 }, {875 key: 'index',876 set: function set(index) {877 this._index = index;878 },879 get: function get() {880 return this._index;881 }882 }, {883 key: 'length',884 set: function set(length) {885 this._length = length;886 },887 get: function get() {888 return this._length;889 }890 }, {891 key: 'slides',892 get: function get() {893 return this._slides;894 },895 set: function set(slides) {896 this._slides = slides;897 }898 }, {899 key: 'slidesToScroll',900 get: function get() {901 return this.options.effect === 'translate' ? this._breakpoint.getSlidesToScroll() : 1;902 }903 }, {904 key: 'slidesToShow',905 get: function get() {906 return this.options.effect === 'translate' ? this._breakpoint.getSlidesToShow() : 1;907 }908 }, {909 key: 'direction',910 get: function get() {911 return this.element.dir.toLowerCase() === 'rtl' || this.element.style.direction === 'rtl' ? 'rtl' : 'ltr';912 }913 }, {914 key: 'wrapper',915 get: function get() {916 return this._ui.wrapper;917 }918 }, {919 key: 'wrapperWidth',920 get: function get() {921 return this._wrapperWidth || 0;922 }923 }, {924 key: 'container',925 get: function get() {926 return this._ui.container;927 }928 }, {929 key: 'containerWidth',930 get: function get() {931 return this._containerWidth || 0;932 }933 }, {934 key: 'slideWidth',935 get: function get() {936 return this._slideWidth || 0;937 }938 }, {939 key: 'transitioner',940 get: function get() {941 return this._transitioner;942 }943 }], [{944 key: 'attach',945 value: function attach() {946 var _this7 = this;947 948 var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '.slider';949 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};950 951 var instances = new Array();952 953 var elements = Object(__WEBPACK_IMPORTED_MODULE_2__utils_type__["c" /* isString */])(selector) ? document.querySelectorAll(selector) : Array.isArray(selector) ? selector : [selector];954 [].forEach.call(elements, function (element) {955 if (typeof element[_this7.constructor.name] === 'undefined') {956 var instance = new bulmaCarousel(element, options);957 element[_this7.constructor.name] = instance;958 instances.push(instance);959 } else {960 instances.push(element[_this7.constructor.name]);961 }962 });963 964 return instances;965 }966 }]);967 968 return bulmaCarousel;969}(__WEBPACK_IMPORTED_MODULE_3__utils_eventEmitter__["a" /* default */]);970 971/* harmony default export */ __webpack_exports__["default"] = (bulmaCarousel);972 973/***/ }),974/* 6 */975/***/ (function(module, __webpack_exports__, __webpack_require__) {976 977"use strict";978/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return uuid; });979/* unused harmony export isRtl */980/* unused harmony export defer */981/* unused harmony export getNodeIndex */982/* unused harmony export camelize */983function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }984 985var uuid = function uuid() {986 var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';987 return prefix + ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, function (c) {988 return (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16);989 });990};991var isRtl = function isRtl() {992 return document.documentElement.getAttribute('dir') === 'rtl';993};994 995var defer = function defer() {996 this.promise = new Promise(function (resolve, reject) {997 this.resolve = resolve;998 this.reject = reject;999 }.bind(this));1000 1001 this.then = this.promise.then.bind(this.promise);1002 this.catch = this.promise.catch.bind(this.promise);1003};1004 1005var getNodeIndex = function getNodeIndex(node) {1006 return [].concat(_toConsumableArray(node.parentNode.children)).indexOf(node);1007};1008var camelize = function camelize(str) {1009 return str.replace(/-(\w)/g, toUpper);1010};1011 1012/***/ }),1013/* 7 */1014/***/ (function(module, __webpack_exports__, __webpack_require__) {1015 1016"use strict";1017/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_eventEmitter__ = __webpack_require__(3);1018/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_device__ = __webpack_require__(8);1019var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();1020 1021function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1022 1023function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }1024 1025function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }1026 1027 1028 1029 1030var onVisibilityChange = Symbol('onVisibilityChange');1031var onMouseEnter = Symbol('onMouseEnter');1032var onMouseLeave = Symbol('onMouseLeave');1033 1034var defaultOptions = {1035 autoplay: false,1036 autoplaySpeed: 30001037};1038 1039var Autoplay = function (_EventEmitter) {1040 _inherits(Autoplay, _EventEmitter);1041 1042 function Autoplay(slider) {1043 _classCallCheck(this, Autoplay);1044 1045 var _this = _possibleConstructorReturn(this, (Autoplay.__proto__ || Object.getPrototypeOf(Autoplay)).call(this));1046 1047 _this.slider = slider;1048 1049 _this.onVisibilityChange = _this.onVisibilityChange.bind(_this);1050 _this.onMouseEnter = _this.onMouseEnter.bind(_this);1051 _this.onMouseLeave = _this.onMouseLeave.bind(_this);1052 return _this;1053 }1054 1055 _createClass(Autoplay, [{1056 key: 'init',1057 value: function init() {1058 this._bindEvents();1059 return this;1060 }1061 }, {1062 key: '_bindEvents',1063 value: function _bindEvents() {1064 document.addEventListener('visibilitychange', this.onVisibilityChange);1065 if (this.slider.options.pauseOnHover) {1066 this.slider.container.addEventListener(__WEBPACK_IMPORTED_MODULE_1__utils_device__["a" /* pointerEnter */], this.onMouseEnter);1067 this.slider.container.addEventListener(__WEBPACK_IMPORTED_MODULE_1__utils_device__["b" /* pointerLeave */], this.onMouseLeave);1068 }1069 }1070 }, {1071 key: '_unbindEvents',1072 value: function _unbindEvents() {1073 document.removeEventListener('visibilitychange', this.onVisibilityChange);1074 this.slider.container.removeEventListener(__WEBPACK_IMPORTED_MODULE_1__utils_device__["a" /* pointerEnter */], this.onMouseEnter);1075 this.slider.container.removeEventListener(__WEBPACK_IMPORTED_MODULE_1__utils_device__["b" /* pointerLeave */], this.onMouseLeave);1076 }1077 }, {1078 key: 'start',1079 value: function start() {1080 var _this2 = this;1081 1082 this.stop();1083 if (this.slider.options.autoplay) {1084 this.emit('start', this);1085 this._interval = setInterval(function () {1086 if (!(_this2._hovering && _this2.slider.options.pauseOnHover)) {1087 if (!_this2.slider.options.centerMode && _this2.slider.state.next >= _this2.slider.state.length - _this2.slider.slidesToShow && !_this2.slider.options.loop && !_this2.slider.options.infinite) {1088 _this2.stop();1089 } else {1090 _this2.slider.next();1091 }1092 }1093 }, this.slider.options.autoplaySpeed);1094 }1095 }1096 }, {1097 key: 'stop',1098 value: function stop() {1099 this._interval = clearInterval(this._interval);1100 this.emit('stop', this);1101 }1102 }, {1103 key: 'pause',1104 value: function pause() {1105 var _this3 = this;1106 1107 var speed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;1108 1109 if (this.paused) {1110 return;1111 }1112 if (this.timer) {1113 this.stop();1114 }1115 this.paused = true;1116 if (speed === 0) {1117 this.paused = false;1118 this.start();1119 } else {1120 this.slider.on('transition:end', function () {1121 if (!_this3) {1122 return;1123 }1124 _this3.paused = false;1125 if (!_this3.run) {1126 _this3.stop();1127 } else {1128 _this3.start();1129 }1130 });1131 }1132 }1133 }, {1134 key: 'onVisibilityChange',1135 value: function onVisibilityChange(e) {1136 if (document.hidden) {1137 this.stop();1138 } else {1139 this.start();1140 }1141 }1142 }, {1143 key: 'onMouseEnter',1144 value: function onMouseEnter(e) {1145 this._hovering = true;1146 if (this.slider.options.pauseOnHover) {1147 this.pause();1148 }1149 }1150 }, {1151 key: 'onMouseLeave',1152 value: function onMouseLeave(e) {1153 this._hovering = false;1154 if (this.slider.options.pauseOnHover) {1155 this.pause();1156 }1157 }1158 }]);1159 1160 return Autoplay;1161}(__WEBPACK_IMPORTED_MODULE_0__utils_eventEmitter__["a" /* default */]);1162 1163/* harmony default export */ __webpack_exports__["a"] = (Autoplay);1164 1165/***/ }),1166/* 8 */1167/***/ (function(module, __webpack_exports__, __webpack_require__) {1168 1169"use strict";1170/* unused harmony export isIE */1171/* unused harmony export isIETouch */1172/* unused harmony export isAndroid */1173/* unused harmony export isiPad */1174/* unused harmony export isiPod */1175/* unused harmony export isiPhone */1176/* unused harmony export isSafari */1177/* unused harmony export isUiWebView */1178/* unused harmony export supportsTouchEvents */1179/* unused harmony export supportsPointerEvents */1180/* unused harmony export supportsTouch */1181/* unused harmony export pointerDown */1182/* unused harmony export pointerMove */1183/* unused harmony export pointerUp */1184/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return pointerEnter; });1185/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return pointerLeave; });1186var isIE = window.navigator.pointerEnabled || window.navigator.msPointerEnabled;1187var isIETouch = window.navigator.msPointerEnabled && window.navigator.msMaxTouchPoints > 1 || window.navigator.pointerEnabled && window.navigator.maxTouchPoints > 1;1188var isAndroid = navigator.userAgent.match(/(Android);?[\s\/]+([\d.]+)?/);1189var isiPad = navigator.userAgent.match(/(iPad).*OS\s([\d_]+)/);1190var isiPod = navigator.userAgent.match(/(iPod)(.*OS\s([\d_]+))?/);1191var isiPhone = !navigator.userAgent.match(/(iPad).*OS\s([\d_]+)/) && navigator.userAgent.match(/(iPhone\sOS)\s([\d_]+)/);1192var isSafari = navigator.userAgent.toLowerCase().indexOf('safari') >= 0 && navigator.userAgent.toLowerCase().indexOf('chrome') < 0 && navigator.userAgent.toLowerCase().indexOf('android') < 0;1193var isUiWebView = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent);1194 1195var supportsTouchEvents = !!('ontouchstart' in window);1196var supportsPointerEvents = !!('PointerEvent' in window);1197var supportsTouch = supportsTouchEvents || window.DocumentTouch && document instanceof DocumentTouch || navigator.maxTouchPoints; // IE >=111198var pointerDown = !supportsTouch ? 'mousedown' : 'mousedown ' + (supportsTouchEvents ? 'touchstart' : 'pointerdown');1199var pointerMove = !supportsTouch ? 'mousemove' : 'mousemove ' + (supportsTouchEvents ? 'touchmove' : 'pointermove');1200var pointerUp = !supportsTouch ? 'mouseup' : 'mouseup ' + (supportsTouchEvents ? 'touchend' : 'pointerup');