{"version":3,"file":"Carousel.js","sources":["../src/utils/object.utils.js","../src/components/carousel/Carousel.js","../node_modules/vue-runtime-helpers/dist/normalize-component.mjs","../src/components/carousel/Carousel.vue"],"sourcesContent":["// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill\nexport function assign (target, varArgs) {\n if (target === null || target === undefined) {\n throw new TypeError('Cannot convert undefined or null to object')\n }\n const to = Object(target)\n for (let index = 1; index < arguments.length; index++) {\n const nextSource = arguments[index]\n if (nextSource !== null && nextSource !== undefined) {\n for (const nextKey in nextSource) {\n // Avoid bugs when hasOwnProperty is shadowed\n /* istanbul ignore else */\n if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {\n to[nextKey] = nextSource[nextKey]\n }\n }\n }\n }\n return to\n}\n\nexport function isExist (obj) {\n return typeof obj !== 'undefined' && obj !== null\n}\n\nexport function isFunction (obj) {\n return typeof obj === 'function'\n}\n\nexport function isNumber (obj) {\n return typeof obj === 'number'\n}\n\nexport function isString (obj) {\n return typeof obj === 'string'\n}\n\nexport function isBoolean (obj) {\n return typeof obj === 'boolean'\n}\n\nexport function isPromiseSupported () {\n return typeof window !== 'undefined' && isExist(window.Promise)\n}\n\nexport function hasOwnProperty (o, k) {\n return Object.prototype.hasOwnProperty.call(o, k)\n}\n","import { isExist } from '../../utils/object.utils'\n\nexport default {\n props: {\n value: Number,\n indicators: {\n type: Boolean,\n default: true\n },\n controls: {\n type: Boolean,\n default: true\n },\n interval: {\n type: Number,\n default: 5000\n },\n iconControlLeft: {\n type: String,\n default: 'glyphicon glyphicon-chevron-left'\n },\n iconControlRight: {\n type: String,\n default: 'glyphicon glyphicon-chevron-right'\n }\n },\n data () {\n return {\n slides: [],\n activeIndex: 0, // Make v-model not required\n timeoutId: 0,\n intervalId: 0\n }\n },\n watch: {\n interval () {\n this.startInterval()\n },\n value (index, oldValue) {\n this.run(index, oldValue)\n this.activeIndex = index\n }\n },\n mounted () {\n if (isExist(this.value)) {\n this.activeIndex = this.value\n }\n if (this.slides.length > 0) {\n this.$select(this.activeIndex)\n }\n this.startInterval()\n },\n beforeDestroy () {\n this.stopInterval()\n },\n methods: {\n run (newIndex, oldIndex) {\n const currentActiveIndex = oldIndex || 0\n let direction\n if (newIndex > currentActiveIndex) {\n direction = ['next', 'left']\n } else {\n direction = ['prev', 'right']\n }\n this.slides[newIndex].slideClass[direction[0]] = true\n this.$nextTick(() => {\n this.slides[newIndex].$el.offsetHeight\n this.slides.forEach((slide, i) => {\n if (i === currentActiveIndex) {\n slide.slideClass.active = true\n slide.slideClass[direction[1]] = true\n } else if (i === newIndex) {\n slide.slideClass[direction[1]] = true\n }\n })\n this.timeoutId = setTimeout(() => {\n this.$select(newIndex)\n this.$emit('change', newIndex)\n this.timeoutId = 0\n }, 600)\n })\n },\n startInterval () {\n this.stopInterval()\n if (this.interval > 0) {\n this.intervalId = setInterval(() => {\n this.next()\n }, this.interval)\n }\n },\n stopInterval () {\n clearInterval(this.intervalId)\n this.intervalId = 0\n },\n resetAllSlideClass () {\n this.slides.forEach(slide => {\n slide.slideClass.active = false\n slide.slideClass.left = false\n slide.slideClass.right = false\n slide.slideClass.next = false\n slide.slideClass.prev = false\n })\n },\n $select (index) {\n this.resetAllSlideClass()\n this.slides[index].slideClass.active = true\n },\n select (index) {\n if (this.timeoutId !== 0 || index === this.activeIndex) {\n return\n }\n if (isExist(this.value)) {\n this.$emit('input', index)\n } else {\n this.run(index, this.activeIndex)\n this.activeIndex = index\n }\n },\n prev () {\n this.select(this.activeIndex === 0 ? this.slides.length - 1 : this.activeIndex - 1)\n },\n next () {\n this.select(this.activeIndex === this.slides.length - 1 ? 0 : this.activeIndex + 1)\n }\n }\n}\n","function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {\r\n if (typeof shadowMode !== 'boolean') {\r\n createInjectorSSR = createInjector;\r\n createInjector = shadowMode;\r\n shadowMode = false;\r\n }\r\n // Vue.extend constructor export interop.\r\n const options = typeof script === 'function' ? script.options : script;\r\n // render functions\r\n if (template && template.render) {\r\n options.render = template.render;\r\n options.staticRenderFns = template.staticRenderFns;\r\n options._compiled = true;\r\n // functional template\r\n if (isFunctionalTemplate) {\r\n options.functional = true;\r\n }\r\n }\r\n // scopedId\r\n if (scopeId) {\r\n options._scopeId = scopeId;\r\n }\r\n let hook;\r\n if (moduleIdentifier) {\r\n // server build\r\n hook = function (context) {\r\n // 2.3 injection\r\n context =\r\n context || // cached call\r\n (this.$vnode && this.$vnode.ssrContext) || // stateful\r\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional\r\n // 2.2 with runInNewContext: true\r\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\r\n context = __VUE_SSR_CONTEXT__;\r\n }\r\n // inject component styles\r\n if (style) {\r\n style.call(this, createInjectorSSR(context));\r\n }\r\n // register component module identifier for async chunk inference\r\n if (context && context._registeredComponents) {\r\n context._registeredComponents.add(moduleIdentifier);\r\n }\r\n };\r\n // used by ssr in case component is cached and beforeCreate\r\n // never gets called\r\n options._ssrRegister = hook;\r\n }\r\n else if (style) {\r\n hook = shadowMode\r\n ? function (context) {\r\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));\r\n }\r\n : function (context) {\r\n style.call(this, createInjector(context));\r\n };\r\n }\r\n if (hook) {\r\n if (options.functional) {\r\n // register for functional component in vue file\r\n const originalRender = options.render;\r\n options.render = function renderWithStyleInjection(h, context) {\r\n hook.call(context);\r\n return originalRender(h, context);\r\n };\r\n }\r\n else {\r\n // inject component registration as beforeCreate hook\r\n const existing = options.beforeCreate;\r\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook];\r\n }\r\n }\r\n return script;\r\n}\n\nexport default normalizeComponent;\n//# sourceMappingURL=normalize-component.mjs.map\n","\n \n\n\n