{"version":3,"sources":["webpack:///./src/components/notes-carousel/index.vue","webpack:///./src/components/notes-carousel/scripts.js","webpack:///./src/components/notes-carousel/scripts.js?1280","webpack:///./src/components/notes-carousel/index.vue?e07a","webpack:///./src/components/notes-carousel/index.vue?b0d6"],"names":["render","_vm","this","_c","_self","_setupProxy","staticClass","isDesktop","_v","attrs","domProps","filteredItems","length","selectedItems","on","$event","selectAllItems","_s","_e","isMobile","years","item","selectedYear","ref","decreaseCurrent","_l","index","key","date","class","selected","selectItemList","increaseCurrent","staticRenderFns","components","SvgLoader","SelectMenu","props","data","current","computed","uniqBy","items","map","findIndex","created","window","addEventListener","checkScrollCarouselComponent","mounted","setClassNavButton","beforeDestroy","removeEventListener","methods","$refs","carouselComponent","scrollWidth","offsetWidth","containerNotesCarousel","classList","add","remove","scrollLeft","containerCarouselNavPrev","containerCarouselNavNext","splice","unshift","$emit","component"],"mappings":"gHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAUF,EAAIG,MAAMC,YAAY,OAAOF,EAAG,UAAU,CAACG,YAAY,0BAA0B,CAAEL,EAAIM,UAAWJ,EAAG,UAAU,CAACG,YAAY,yBAAyB,CAACH,EAAG,MAAM,CAACA,EAAG,KAAK,CAACF,EAAIO,GAAG,oCAAoCL,EAAG,OAAO,CAACG,YAAY,gBAAgB,CAACH,EAAG,IAAI,CAACA,EAAG,QAAQ,CAACM,MAAM,CAAC,IAAM,qBAAqB,CAACR,EAAIO,GAAG,uBAAuBL,EAAG,QAAQ,CAACG,YAAY,mBAAmBG,MAAM,CAAC,GAAK,mBAAmB,KAAO,YAAYC,SAAS,CAAC,QAAUT,EAAIU,cAAcC,SAAWX,EAAIY,cAAcD,QAAQE,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOd,EAAIe,2BAA2Bb,EAAG,OAAO,CAACF,EAAIO,GAAGP,EAAIgB,GAAGhB,EAAIY,cAAcD,QAAQ,IAAIX,EAAIgB,GA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AjBO,WAkBD9B,KAAKK,YACPL,KAAKoD,MAAMC,kBAAkBO,YAAc,IAE3C5D,KAAKgD,sBAGTA,kBAxBO,WAyBDhD,KAAKK,YACHL,KAAKoD,MAAMC,kBAAkBO,YAAc,EAC7C5D,KAAKoD,MAAMS,yBAAyBJ,UAAUC,IAAI,YAElD1D,KAAKoD,MAAMS,yBAAyBJ,UAAUE,OAAO,YAGlD3D,KAAKoD,MAAMC,kBAAkBE,YAAcvD,KAAKoD,MAAMC,kBAAkBO,YAAe5D,KAAKoD,MAAMC,kBAAkBC,YACvHtD,KAAKoD,MAAMU,yBAAyBL,UAAUC,IAAI,YAElD1D,KAAKoD,MAAMU,yBAAyBL,UAAUE,OAAO,cAI3D9B,eAvCO,SAuCSV,GACd,IAAMK,EAAQkB,uBAAU1C,KAAKW,cAAe,CAAEe,KAAMP,EAAKO,OAErDF,GAAS,EACXxB,KAAKW,cAAcoD,OAAOvC,EAAO,GAEjCxB,KAAKW,cAAcqD,QAAQ7C,GAG7BnB,KAAKiE,MAAM,QAASjE,KAAKW,cAAc8B,KAAI,SAAAtB,GAGzC,cAFOA,EAAKS,SAELT,OAGXL,eAtDO,WAuDDd,KAAKS,cAAcC,SAAWV,KAAKW,cAAcD,QACnDV,KAAKW,cAAgB,GAErBX,KAAKiE,MAAM,QAASjE,KAAKW,iBAEzBX,KAAKW,cAAgBX,KAAKS,cAE1BT,KAAKiE,MAAM,QAASjE,KAAKW,cAAc8B,KAAI,SAAAtB,GAGzC,cAFOA,EAAKS,SAELT,UClHmR,I,wBCQhS+C,EAAY,eACd,EACApE,EACAiC,GACA,EACA,KACA,KACA,MAIa,OAAAmC,E,6CCnBf,W","file":"js/app~13bf6b96-legacy.8c52f0fa.js","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('section',{staticClass:\"wrapper-notes-carousel\"},[(_vm.isDesktop)?_c('section',{staticClass:\"header-notes-carousel\"},[_c('div',[_c('h5',[_vm._v(\"Fazer download da nota fiscal:\")]),_c('form',{staticClass:\"generic-form\"},[_c('p',[_c('label',{attrs:{\"for\":\"select-all-items\"}},[_vm._v(\"Selecionar todos:\")]),_c('input',{staticClass:\"generic-checkbox\",attrs:{\"id\":\"select-all-items\",\"type\":\"checkbox\"},domProps:{\"checked\":_vm.filteredItems.length === _vm.selectedItems.length},on:{\"click\":function($event){return _vm.selectAllItems()}}})])])]),_c('span',[_vm._v(_vm._s(_vm.selectedItems.length)+\" \"+_vm._s(_vm.selectedItems.length > 1 ? 'Notas fiscais selecionadas' : 'Nota fiscal selecionada'))])]):_vm._e(),(_vm.isMobile)?_c('section',{staticClass:\"filters-notes-carousel\"},[_c('h4',[_vm._v(\"Visualizar notas fiscais de:\")]),_c('select-menu',{attrs:{\"list\":_vm.years,\"title\":\"Ano\"},on:{\"actionItem\":(item) => _vm.selectedYear = item}})],1):_vm._e(),_c('section',{ref:\"containerNotesCarousel\",staticClass:\"container-notes-carousel\"},[(_vm.isDesktop)?_c('div',{ref:\"containerCarouselNavPrev\",staticClass:\"container-carousel-nav\"},[_c('button',{attrs:{\"title\":\"Anterior\"},on:{\"click\":function($event){return _vm.decreaseCurrent()}}},[_c('img',{attrs:{\"src\":\"img/carousel-arrow-left-purple.svg\",\"alt\":\"carousel-arrow-left\"}})])]):_vm._e(),_c('ul',{ref:\"carouselComponent\",staticClass:\"carousel-component\"},_vm._l((_vm.filteredItems),function(item,index){return _c('li',{key:`${index}-${item.date}`,staticClass:\"carousel-item\",class:{ 'active': item.selected }},[_c('button',{staticClass:\"container-content-item-list\",on:{\"click\":function($event){return _vm.selectItemList(item)}}},[(_vm.isDesktop)?_c('input',{staticClass:\"generic-checkbox\",attrs:{\"type\":\"checkbox\"},domProps:{\"checked\":item.selected}}):_vm._e(),_c('h6',[_vm._v(_vm._s(item.date))]),_c('span',{staticClass:\"container-icon\"},[_c('svg-loader',{staticClass:\"icon-notes\",attrs:{\"src\":\"img/icon-notes.svg\"}}),_c('img',{staticClass:\"icon-alarm\",attrs:{\"src\":\"img/icon-alarm.svg\",\"alt\":\"icon-alarm\"}})],1)])])}),0),(_vm.isDesktop)?_c('div',{ref:\"containerCarouselNavNext\",staticClass:\"container-carousel-nav\"},[_c('button',{attrs:{\"title\":\"Próximo\"},on:{\"click\":function($event){return _vm.increaseCurrent()}}},[_c('img',{attrs:{\"src\":\"img/carousel-arrow-right-purple.svg\",\"alt\":\"carousel-arrow-right\"}})])]):_vm._e()])])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { uniqBy, findIndex } from 'lodash'\nimport SvgLoader from '../svg-loader/index.vue'\nimport SelectMenu from '../select-menu/index.vue'\n\nexport default {\n components: {\n SvgLoader,\n SelectMenu\n },\n props: [\n 'items'\n ],\n data () {\n return {\n current: 0,\n selectedItems: [],\n years: [\n '2019',\n '2018',\n '2017',\n '2016'\n ],\n selectedYear: ''\n }\n },\n computed: {\n filteredItems () {\n return uniqBy(this.items.map(item => {\n const index = findIndex(this.selectedItems, { date: item.date })\n\n if (index > -1) {\n return { ...item, selected: true }\n }\n\n return { ...item, selected: false }\n }), 'date')\n }\n },\n created () {\n window.addEventListener('resize', this.checkScrollCarouselComponent)\n },\n mounted () {\n this.checkScrollCarouselComponent()\n\n this.setClassNavButton()\n },\n beforeDestroy () {\n window.removeEventListener('resize', this.checkScrollCarouselComponent)\n },\n methods: {\n checkScrollCarouselComponent () {\n if (this.isDesktop) {\n if (this.$refs.carouselComponent.scrollWidth > this.$refs.carouselComponent.offsetWidth) {\n this.$refs.containerNotesCarousel.classList.add('has-scroll')\n } else {\n this.$refs.containerNotesCarousel.classList.remove('has-scroll')\n }\n }\n },\n decreaseCurrent () {\n if (this.isDesktop) {\n this.$refs.carouselComponent.scrollLeft -= 92 * 2\n\n this.setClassNavButton()\n }\n },\n increaseCurrent () {\n if (this.isDesktop) {\n this.$refs.carouselComponent.scrollLeft += 92 * 2\n\n this.setClassNavButton()\n }\n },\n setClassNavButton () {\n if (this.isDesktop) {\n if (this.$refs.carouselComponent.scrollLeft <= 0) {\n this.$refs.containerCarouselNavPrev.classList.add('disabled')\n } else {\n this.$refs.containerCarouselNavPrev.classList.remove('disabled')\n }\n\n if ((this.$refs.carouselComponent.offsetWidth + this.$refs.carouselComponent.scrollLeft) >= this.$refs.carouselComponent.scrollWidth) {\n this.$refs.containerCarouselNavNext.classList.add('disabled')\n } else {\n this.$refs.containerCarouselNavNext.classList.remove('disabled')\n }\n }\n },\n selectItemList (item) {\n const index = findIndex(this.selectedItems, { date: item.date })\n\n if (index > -1) {\n this.selectedItems.splice(index, 1)\n } else {\n this.selectedItems.unshift(item)\n }\n\n this.$emit('input', this.selectedItems.map(item => {\n delete item.selected\n\n return item\n }))\n },\n selectAllItems () {\n if (this.filteredItems.length === this.selectedItems.length) {\n this.selectedItems = []\n\n this.$emit('input', this.selectedItems)\n } else {\n this.selectedItems = this.filteredItems\n\n this.$emit('input', this.selectedItems.map(item => {\n delete item.selected\n\n return item\n }))\n }\n }\n }\n}\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/eslint-loader/index.js??ref--13-0!./scripts.js?vue&type=script&lang=js&external\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/eslint-loader/index.js??ref--13-0!./scripts.js?vue&type=script&lang=js&external\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=25548d8b&lang=html\"\nimport script from \"./scripts.js?vue&type=script&lang=js&external\"\nexport * from \"./scripts.js?vue&type=script&lang=js&external\"\nimport style0 from \"./index.vue?vue&type=style&index=0&id=25548d8b&prod&lang=scss\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&id=25548d8b&prod&lang=scss\""],"sourceRoot":""}