photos/js/photos-src_components_Virtu...

1 line
31 KiB
Plaintext

{"version":3,"file":"photos-src_components_VirtualScrolling_vue-src_views_Albums_vue.js?v=fe0ad7493c416d31069a","mappings":"2MAGIA,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,0HAA2H,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,mDAAmD,MAAQ,GAAG,SAAW,+CAA+C,eAAiB,CAAC,2vCAA20C,WAAa,MAEjqD,S,sECJIH,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,4LAA6L,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,oCAAoC,MAAQ,GAAG,SAAW,+EAA+E,eAAiB,CAAC,m/BAAmkC,WAAa,MAE5+C,S,mCCPA,I,kkECsDA,MCtDiL,EDsDjL,CACA,wBAEA,OACA,MACA,WACA,aAGA,kBACA,iBACA,cAGA,WACA,aACA,YAGA,mBACA,YACA,WAEA,0BACA,YACA,WAEA,oBACA,YAEA,WAEA,mBACA,YACA,WAEA,aACA,YACA,aAIA,KA1CA,WA2CA,OACA,iBACA,kBACA,sBAEA,oBAEA,EAEA,UAIA,YAJA,WAKA,iEAGA,0BACA,uBAIA,2BACA,kCACA,4BAEA,IACA,IAIA,iBACA,sBAIA,GAHA,IACA,YAEA,eACA,SAGA,aAaA,OAXA,iBACA,SAEA,iBACA,aAEA,iBACA,cAIA,YACA,GADA,QAGA,GAHA,IAIA,gBAGA,MACA,EAOA,WA3DA,WA8DA,iBACA,oCACA,sCAJA,GAKA,EAKA,WAtEA,WAsEA,WACA,+BACA,SAGA,kFAEA,iBACA,oCACA,WACA,qCACA,EAOA,mBAxFA,WAyFA,OACA,uCACA,2CAEA,EAQA,aArGA,WAsGA,kDACA,kEACA,EAKA,UA7GA,WA+GA,OADA,oDACA,6BACA,sBACA,eACA,OAEA,oBAEA,GAGA,OACA,aADA,SACA,GACA,GACA,0BAEA,EAEA,KAPA,WAUA,mBACA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I4B,GAAGL,EAAWO,MAAM,MAAM9B,EAAI4B,GAAG5B,EAAI+B,EAAE,SAAU,UAAW,uBAAwBR,EAAWS,UAAU,eAAe,MAAM,CAAC5B,EAAG,MAAM,CAACU,MAAM,CAAC,KAAO,UAAUe,KAAK,UAAU,CAACzB,EAAG,WAAW,CAACU,MAAM,CAAC,KAAO,UAAU,aAAad,EAAIgB,EAAE,SAAU,wBAAwBiB,GAAG,CAAC,MAAQ,SAASC,GAAQlC,EAAImC,uBAAwB,CAAI,GAAGhB,YAAYnB,EAAIoB,GAAG,CAAC,CAACC,IAAI,OAAOC,GAAG,WAAW,MAAO,CAAClB,EAAG,QAAQ,EAAEgC,OAAM,MAAS,CAACpC,EAAIa,GAAG,aAAab,EAAI4B,GAAG5B,EAAIgB,EAAE,SAAU,cAAc,eAAe,GAAGhB,EAAIa,GAAG,KAAKb,EAAIa,GAAG,KAAKT,EAAG,iBAAiB,CAACU,MAAM,CAAC,KAAO,yBAAyB,MAAQd,EAAIgB,EAAE,SAAU,2BAA2Ba,KAAK,0BAA0B,CAACzB,EAAG,sBAAsB,CAACU,MAAM,CAAC,KAAO,QAAQe,KAAK,UAAU,IAAI,GAAG7B,EAAIa,GAAG,KAAMb,EAAyB,sBAAEI,EAAG,UAAU,CAACU,MAAM,CAAC,MAAQd,EAAIgB,EAAE,SAAU,cAAciB,GAAG,CAAC,MAAQ,SAASC,GAAQlC,EAAImC,uBAAwB,CAAK,IAAI,CAAC/B,EAAG,YAAY,CAAC6B,GAAG,CAAC,KAAOjC,EAAIqC,uBAAuB,GAAGrC,EAAIsC,MAAM,EAAE,GAC/4C,IISpB,EACA,KACA,WACA,MAI8B,O","sources":["webpack:///photos/src/components/VirtualScrolling.vue?vue&type=style&index=0&id=5e8733b7&scoped=true&lang=scss&","webpack:///photos/src/views/Albums.vue?vue&type=style&index=0&id=24a8ac3e&lang=scss&scoped=true&","webpack:///photos/src/components/VirtualScrolling.vue?vue&type=template&id=5e8733b7&scoped=true&","webpack:///photos/src/components/VirtualScrolling.vue","webpack:///photos/src/components/VirtualScrolling.vue?vue&type=script&lang=js&","webpack://photos/./src/components/VirtualScrolling.vue?876f","webpack://photos/./src/components/VirtualScrolling.vue?6e3f","webpack:///photos/src/views/Albums.vue?vue&type=template&id=24a8ac3e&scoped=true&","webpack:///photos/src/views/Albums.vue","webpack:///photos/src/views/Albums.vue?vue&type=script&lang=js&","webpack://photos/./src/views/Albums.vue?f35f","webpack://photos/./src/views/Albums.vue?2029"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".vs-container[data-v-5e8733b7]{overflow-y:scroll;height:100%}.vs-rows-container[data-v-5e8733b7]{box-sizing:border-box}\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/components/VirtualScrolling.vue\"],\"names\":[],\"mappings\":\"AAkTA,+BACC,iBAAA,CACA,WAAA,CAGD,oCACC,qBAAA\",\"sourcesContent\":[\"$sizes: (\\\"400\\\": (\\\"count\\\": 3, \\\"marginTop\\\": 66, \\\"marginW\\\": 8), \\\"700\\\": (\\\"count\\\": 4, \\\"marginTop\\\": 66, \\\"marginW\\\": 8), \\\"1024\\\": (\\\"count\\\": 5, \\\"marginTop\\\": 66, \\\"marginW\\\": 44), \\\"1280\\\": (\\\"count\\\": 4, \\\"marginTop\\\": 66, \\\"marginW\\\": 44), \\\"1440\\\": (\\\"count\\\": 5, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"1600\\\": (\\\"count\\\": 6, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"2048\\\": (\\\"count\\\": 7, \\\"marginTop\\\": 88, \\\"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\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n.vs-container {\\n\\toverflow-y: scroll;\\n\\theight: 100%;\\n}\\n\\n.vs-rows-container {\\n\\tbox-sizing: border-box;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".albums-list[data-v-24a8ac3e]{display:flex;flex-direction:column}.albums-list .album__name[data-v-24a8ac3e]{font-weight:normal;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/views/Albums.vue\"],\"names\":[],\"mappings\":\"AAsIA,8BACC,YAAA,CACA,qBAAA,CAEA,2CACC,kBAAA,CACA,eAAA,CACA,kBAAA,CACA,sBAAA\",\"sourcesContent\":[\"$sizes: (\\\"400\\\": (\\\"count\\\": 3, \\\"marginTop\\\": 66, \\\"marginW\\\": 8), \\\"700\\\": (\\\"count\\\": 4, \\\"marginTop\\\": 66, \\\"marginW\\\": 8), \\\"1024\\\": (\\\"count\\\": 5, \\\"marginTop\\\": 66, \\\"marginW\\\": 44), \\\"1280\\\": (\\\"count\\\": 4, \\\"marginTop\\\": 66, \\\"marginW\\\": 44), \\\"1440\\\": (\\\"count\\\": 5, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"1600\\\": (\\\"count\\\": 6, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"2048\\\": (\\\"count\\\": 7, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"2560\\\": (\\\"count\\\": 8, \\\"marginTop\\\": 88, \\\"marginW\\\": 88), \\\"3440\\\": (\\\"count\\\": 9, \\\"marginTop\\\": 88, \\\"marginW\\\": 88), \\\"max\\\": (\\\"count\\\": 10, \\\"marginTop\\\": 88, \\\"marginW\\\": 88));\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n.albums-list {\\n\\tdisplay: flex;\\n\\tflex-direction: column;\\n\\n\\t.album__name {\\n\\t\\tfont-weight: normal;\\n\\t\\toverflow: hidden;\\n\\t\\twhite-space: nowrap;\\n\\t\\ttext-overflow: ellipsis;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.useWindow && _vm.containerElement === null)?_c('div',{ref:\"container\",staticClass:\"vs-container\"},[_c('div',{ref:\"rowsContainer\",staticClass:\"vs-rows-container\",style:(_vm.rowsContainerStyle)},[_vm._t(\"default\",null,{\"renderedRows\":_vm.visibleRows}),_vm._v(\" \"),_vm._t(\"loader\")],2)]):_c('div',{ref:\"rowsContainer\",staticClass:\"vs-rows-container\",style:(_vm.rowsContainerStyle)},[_vm._t(\"default\",null,{\"renderedRows\":_vm.visibleRows}),_vm._v(\" \"),_vm._t(\"loader\")],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<!--\n - @copyright Copyright (c) 2022 Louis Chemineau <louis@chmn.me>\n -\n - @author Louis Chemineau <louis@chmn.me>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n<template>\n\t<div v-if=\"!useWindow && containerElement === null\" ref=\"container\" class=\"vs-container\">\n\t\t<div ref=\"rowsContainer\"\n\t\t\tclass=\"vs-rows-container\"\n\t\t\t:style=\"rowsContainerStyle\">\n\t\t\t<slot :rendered-rows=\"visibleRows\" />\n\t\t\t<slot name=\"loader\" />\n\t\t</div>\n\t</div>\n\t<div v-else\n\t\tref=\"rowsContainer\"\n\t\tclass=\"vs-rows-container\"\n\t\t:style=\"rowsContainerStyle\">\n\t\t<slot :rendered-rows=\"visibleRows\" />\n\t\t<slot name=\"loader\" />\n\t</div>\n</template>\n\n<script>\nimport { debounce } from 'debounce'\n\nimport logger from '../services/logger.js'\n/**\n * @typedef {object} Row\n * @property {number} height - The height of the row.\n */\n\n/**\n * @typedef {Row} VisibleRow\n * @property {'none'|'near'|'visible'} visibility - The visibility state of the row\n * @property {boolean} shouldRender - Whether the row should be renderer in the DOM\n */\n\nexport default {\n\tname: 'VirtualScrolling',\n\n\tprops: {\n\t\trows: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\n\t\tcontainerElement: {\n\t\t\ttype: HTMLElement,\n\t\t\tdefault: null,\n\t\t},\n\n\t\tuseWindow: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\trenderWindowRatio: {\n\t\t\ttype: Number,\n\t\t\tdefault: 4,\n\t\t},\n\t\twillBeVisibleWindowRatio: {\n\t\t\ttype: Number,\n\t\t\tdefault: 4,\n\t\t},\n\t\tvisibleWindowRatio: {\n\t\t\ttype: Number,\n\t\t\t// A little bit more than the container's height to include items at its edges.\n\t\t\tdefault: 0,\n\t\t},\n\t\tbottomBufferRatio: {\n\t\t\ttype: Number,\n\t\t\tdefault: 5,\n\t\t},\n\t\tscrollToKey: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tscrollPosition: 0,\n\t\t\tcontainerHeight: 0,\n\t\t\trowsContainerHeight: 0,\n\t\t\t/** @type {ResizeObserver} */\n\t\t\tresizeObserver: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * @return {VisibleRow[]}\n\t\t */\n\t\tvisibleRows() {\n\t\t\tlogger.debug('[VirtualScrolling] Computing visible rows', this.rows)\n\n\t\t\t// Optimisation: get those computed properties once to not go through vue's internal every time we need them.\n\t\t\tconst scrollPosition = this.scrollPosition\n\t\t\tconst containerHeight = this.containerHeight\n\n\t\t\t// Optimisation: different windows to hint the items how they should render themselves.\n\t\t\t// This will be forwarded with the visibility props.\n\t\t\tconst shouldRenderedWindow = containerHeight * this.renderWindowRatio\n\t\t\tconst willBeVisibleWindow = containerHeight * this.willBeVisibleWindowRatio\n\t\t\tconst visibleWindow = containerHeight * this.visibleWindowRatio\n\n\t\t\tlet currentRowTopDistanceFromTop = 0\n\t\t\tlet currentRowBottomDistanceFromTop = 0\n\n\t\t\t// Compute whether a row should be included in the DOM (shouldRender)\n\t\t\t// And how visible the row is.\n\t\t\treturn this.rows\n\t\t\t\t.reduce((visibleRows, row) => {\n\t\t\t\t\tcurrentRowTopDistanceFromTop = currentRowBottomDistanceFromTop\n\t\t\t\t\tcurrentRowBottomDistanceFromTop += row.height\n\n\t\t\t\t\tif (currentRowTopDistanceFromTop < scrollPosition - shouldRenderedWindow || scrollPosition + containerHeight + shouldRenderedWindow < currentRowTopDistanceFromTop) {\n\t\t\t\t\t\treturn visibleRows\n\t\t\t\t\t}\n\n\t\t\t\t\tlet visibility = 'none'\n\n\t\t\t\t\tif (scrollPosition - willBeVisibleWindow < currentRowTopDistanceFromTop && currentRowTopDistanceFromTop < scrollPosition + containerHeight + willBeVisibleWindow) {\n\t\t\t\t\t\tvisibility = 'near'\n\n\t\t\t\t\t\tif (scrollPosition - visibleWindow < currentRowTopDistanceFromTop && currentRowTopDistanceFromTop < scrollPosition + containerHeight + visibleWindow) {\n\t\t\t\t\t\t\tvisibility = 'visible'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (scrollPosition - visibleWindow < currentRowBottomDistanceFromTop && currentRowBottomDistanceFromTop < scrollPosition + containerHeight + visibleWindow) {\n\t\t\t\t\t\t\tvisibility = 'visible'\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [\n\t\t\t\t\t\t...visibleRows,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...row,\n\t\t\t\t\t\t\tvisibility,\n\t\t\t\t\t\t},\n\t\t\t\t\t]\n\t\t\t\t}, [])\n\t\t},\n\n\t\t/**\n\t\t * Total height of all the rows + some room for the loader.\n\t\t *\n\t\t * @return {number}\n\t\t */\n\t\trowsHeight() {\n\t\t\tconst loaderHeight = 200\n\n\t\t\treturn this.rows\n\t\t\t\t.map(row => row.height)\n\t\t\t\t.reduce((totalHeight, rowHeight) => totalHeight + rowHeight, 0) + loaderHeight\n\t\t},\n\n\t\t/**\n\t\t * @return {number}\n\t\t */\n\t\tpaddingTop() {\n\t\t\tif (this.visibleRows.length === 0) {\n\t\t\t\treturn 0\n\t\t\t}\n\n\t\t\tconst firstVisibleRowIndex = this.rows.findIndex(row => row.items === this.visibleRows[0].items)\n\n\t\t\treturn this.rows\n\t\t\t\t.map(row => row.height)\n\t\t\t\t.slice(0, firstVisibleRowIndex)\n\t\t\t\t.reduce((totalHeight, rowHeight) => totalHeight + rowHeight, 0)\n\t\t},\n\n\t\t/**\n\t\t * padding-top is used to replace not included item in the container.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\trowsContainerStyle() {\n\t\t\treturn {\n\t\t\t\theight: `${this.rowsHeight}px`,\n\t\t\t\tpaddingTop: `${this.paddingTop}px`,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Whether the user is near the bottom.\n\t\t * If true, then the need-content event will be emitted.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisNearBottom() {\n\t\t\tconst buffer = this.containerHeight * this.bottomBufferRatio\n\t\t\treturn this.scrollPosition + this.containerHeight >= this.rowsHeight - buffer\n\t\t},\n\n\t\t/**\n\t\t * @return {HTMLElement}\n\t\t */\n\t\tcontainer() {\n\t\t\tlogger.debug('[VirtualScrolling] Computing container')\n\t\t\tif (this.containerElement !== null) {\n\t\t\t\treturn this.containerElement\n\t\t\t} else if (this.useWindow) {\n\t\t\t\treturn window\n\t\t\t} else {\n\t\t\t\treturn this.$refs.container\n\t\t\t}\n\t\t},\n\t},\n\n\twatch: {\n\t\tisNearBottom(value) {\n\t\t\tif (value) {\n\t\t\t\tthis.$emit('need-content')\n\t\t\t}\n\t\t},\n\n\t\trows() {\n\t\t\t// Re-emit need-content when rows is updated and isNearBottom is still true.\n\t\t\t// If the height of added rows is under `bottomBufferRatio`, `isNearBottom` will still be true so we need more content.\n\t\t\tif (this.isNearBottom) {\n\t\t\t\tthis.$emit('need-content')\n\t\t\t}\n\t\t},\n\n\t\tscrollToKey(key) {\n\t\t\tlet currentRowTopDistanceFromTop = 0\n\t\t\tfor (const row of this.rows) {\n\t\t\t\tif (row.key === key) {\n\t\t\t\t\tthis.$refs.container.scrollTo({ top: currentRowTopDistanceFromTop, behavior: 'smooth' })\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tcurrentRowTopDistanceFromTop += row.height\n\t\t\t}\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.resizeObserver = new ResizeObserver(entries => {\n\t\t\tfor (const entry of entries) {\n\t\t\t\tconst cr = entry.contentRect\n\t\t\t\tif (entry.target.classList.contains('vs-container')) {\n\t\t\t\t\tthis.containerHeight = cr.height\n\t\t\t\t}\n\t\t\t\tif (entry.target.classList.contains('vs-rows-container')) {\n\t\t\t\t\tthis.rowsContainerHeight = cr.height\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\tif (this.useWindow) {\n\t\t\twindow.addEventListener('resize', this.updateContainerSize)\n\t\t\tthis.containerHeight = window.innerHeight\n\t\t} else {\n\t\t\tthis.resizeObserver.observe(this.container)\n\t\t}\n\n\t\tthis.resizeObserver.observe(this.$refs.rowsContainer)\n\t\tthis.container.addEventListener('scroll', this.updateScrollPosition)\n\t},\n\n\tbeforeDestroy() {\n\t\tif (this.useWindow) {\n\t\t\twindow.removeEventListener('resize', this.updateContainerSize)\n\t\t}\n\n\t\tthis.resizeObserver.disconnect()\n\t\tthis.container.removeEventListener('scroll', this.updateScrollPosition)\n\t},\n\n\tmethods: {\n\t\tupdateScrollPosition: debounce(function() {\n\t\t\tif (this.useWindow) {\n\t\t\t\tthis.scrollPosition = this.container.scrollY\n\t\t\t} else {\n\t\t\t\tthis.scrollPosition = this.container.scrollTop\n\t\t\t}\n\t\t}, 200),\n\n\t\tupdateContainerSize() {\n\t\t\tthis.containerHeight = window.innerHeight\n\t\t},\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n.vs-container {\n\toverflow-y: scroll;\n\theight: 100%;\n}\n\n.vs-rows-container {\n\tbox-sizing: border-box;\n}\n</style>\n","import mod from \"-!../../node_modules/babel-loader/lib/index.js!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./VirtualScrolling.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/babel-loader/lib/index.js!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./VirtualScrolling.vue?vue&type=script&lang=js&\"","\n import API from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2[0].rules[0].use[3]!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./VirtualScrolling.vue?vue&type=style&index=0&id=5e8733b7&scoped=true&lang=scss&\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2[0].rules[0].use[3]!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./VirtualScrolling.vue?vue&type=style&index=0&id=5e8733b7&scoped=true&lang=scss&\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./VirtualScrolling.vue?vue&type=template&id=5e8733b7&scoped=true&\"\nimport script from \"./VirtualScrolling.vue?vue&type=script&lang=js&\"\nexport * from \"./VirtualScrolling.vue?vue&type=script&lang=js&\"\nimport style0 from \"./VirtualScrolling.vue?vue&type=style&index=0&id=5e8733b7&scoped=true&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 \"5e8733b7\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('CollectionsList',{staticClass:\"albums-list\",attrs:{\"collections\":_vm.albums,\"collection-title\":_vm.t('photos', 'Albums'),\"collection-root\":_vm.t('photos', 'Albums'),\"loading\":_vm.loadingAlbums,\"error\":_vm.errorFetchingAlbums},scopedSlots:_vm._u([{key:\"default\",fn:function(ref){\nvar collection = ref.collection;\nreturn _c('CollectionCover',{key:collection.basename,attrs:{\"link\":(\"/albums/\" + (collection.basename)),\"alt-img\":_vm.t('photos', 'Cover photo for album {albumName}', { albumName: this.collection.basename }),\"cover-url\":_vm._f(\"coverUrl\")(collection.lastPhoto)}},[_c('h2',{staticClass:\"album__name\"},[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(collection.basename)+\"\\n\\t\\t\\t\")]),_vm._v(\" \"),_c('div',{staticClass:\"album__details\",attrs:{\"slot\":\"subtitle\"},slot:\"subtitle\"},[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(collection.date)+\" ⸱ \"+_vm._s(_vm.n('photos', '%n item', '%n photos and videos', collection.nbItems))+\"\\n\\t\\t\\t\")])])}}])},[_c('div',{attrs:{\"slot\":\"header\"},slot:\"header\"},[_c('NcButton',{attrs:{\"type\":\"primary\",\"aria-label\":_vm.t('photos', 'Create a new album.')},on:{\"click\":function($event){_vm.showAlbumCreationForm = true}},scopedSlots:_vm._u([{key:\"icon\",fn:function(){return [_c('Plus')]},proxy:true}])},[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.t('photos', 'New album'))+\"\\n\\t\\t\\t\")])],1),_vm._v(\" \"),_vm._v(\" \"),_c('NcEmptyContent',{attrs:{\"slot\":\"empty-collections-list\",\"title\":_vm.t('photos', 'There is no album yet!')},slot:\"empty-collections-list\"},[_c('FolderMultipleImage',{attrs:{\"slot\":\"icon\"},slot:\"icon\"})],1)],1),_vm._v(\" \"),(_vm.showAlbumCreationForm)?_c('NcModal',{attrs:{\"title\":_vm.t('photos', 'New album')},on:{\"close\":function($event){_vm.showAlbumCreationForm = false}}},[_c('AlbumForm',{on:{\"done\":_vm.handleAlbumCreated}})],1):_vm._e()],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<!--\n - @copyright Copyright (c) 2022 Louis Chemineau <louis@chmn.me>\n -\n - @author Louis Chemineau <louis@chmn.me>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n<template>\n\t<div>\n\t\t<CollectionsList :collections=\"albums\"\n\t\t\t:collection-title=\"t('photos', 'Albums')\"\n\t\t\t:collection-root=\"t('photos', 'Albums')\"\n\t\t\t:loading=\"loadingAlbums\"\n\t\t\t:error=\"errorFetchingAlbums\"\n\t\t\tclass=\"albums-list\">\n\t\t\t<div slot=\"header\">\n\t\t\t\t<NcButton type=\"primary\"\n\t\t\t\t\t:aria-label=\"t('photos', 'Create a new album.')\"\n\t\t\t\t\t@click=\"showAlbumCreationForm = true\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<Plus />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ t('photos', 'New album') }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\n\t\t\t<CollectionCover :key=\"collection.basename\"\n\t\t\t\tslot-scope=\"{collection}\"\n\t\t\t\t:link=\"`/albums/${collection.basename}`\"\n\t\t\t\t:alt-img=\"t('photos', 'Cover photo for album {albumName}', { albumName: this.collection.basename })\"\n\t\t\t\t:cover-url=\"collection.lastPhoto | coverUrl\">\n\t\t\t\t<h2 class=\"album__name\">\n\t\t\t\t\t{{ collection.basename }}\n\t\t\t\t</h2>\n\n\t\t\t\t<div slot=\"subtitle\" class=\"album__details\">\n\t\t\t\t\t{{ collection.date }} ⸱ {{ n('photos', '%n item', '%n photos and videos', collection.nbItems,) }}\n\t\t\t\t</div>\n\t\t\t</CollectionCover>\n\n\t\t\t<NcEmptyContent slot=\"empty-collections-list\" :title=\"t('photos', 'There is no album yet!')\">\n\t\t\t\t<FolderMultipleImage slot=\"icon\" />\n\t\t\t</NcEmptyContent>\n\t\t</CollectionsList>\n\n\t\t<NcModal v-if=\"showAlbumCreationForm\"\n\t\t\t:title=\"t('photos', 'New album')\"\n\t\t\t@close=\"showAlbumCreationForm = false\">\n\t\t\t<AlbumForm @done=\"handleAlbumCreated\" />\n\t\t</NcModal>\n\t</div>\n</template>\n\n<script>\nimport Plus from 'vue-material-design-icons/Plus'\nimport FolderMultipleImage from 'vue-material-design-icons/FolderMultipleImage'\n\nimport { generateUrl } from '@nextcloud/router'\nimport { NcModal, NcButton, NcEmptyContent } from '@nextcloud/vue'\n\nimport FetchAlbumsMixin from '../mixins/FetchAlbumsMixin.js'\nimport CollectionsList from '../components/Collection/CollectionsList.vue'\nimport CollectionCover from '../components/Collection/CollectionCover.vue'\nimport AlbumForm from '../components/Albums/AlbumForm.vue'\n\nexport default {\n\tname: 'Albums',\n\tcomponents: {\n\t\tPlus,\n\t\tFolderMultipleImage,\n\t\tNcModal,\n\t\tNcButton,\n\t\tNcEmptyContent,\n\t\tCollectionsList,\n\t\tCollectionCover,\n\t\tAlbumForm,\n\t},\n\n\tfilters: {\n\t\t/**\n\t\t * @param {string} lastPhoto The album's last photos.\n\t\t */\n\t\tcoverUrl(lastPhoto) {\n\t\t\tif (lastPhoto === -1) {\n\t\t\t\treturn ''\n\t\t\t}\n\n\t\t\treturn generateUrl(`/apps/photos/api/v1/preview/${lastPhoto}?x=${512}&y=${512}`)\n\t\t},\n\t},\n\n\tmixins: [\n\t\tFetchAlbumsMixin,\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t\tshowAlbumCreationForm: false,\n\t\t}\n\t},\n\n\tmethods: {\n\t\thandleAlbumCreated({ album }) {\n\t\t\tthis.showAlbumCreationForm = false\n\t\t\tthis.$router.push({\n\t\t\t\tname: 'albums',\n\t\t\t\tparams: {\n\t\t\t\t\tpath: album.basename,\n\t\t\t\t},\n\t\t\t})\n\t\t},\n\n\t\tonRefresh() {\n\t\t\tthis.fetchAlbums()\n\t\t},\n\t},\n}\n</script>\n<style lang=\"scss\" scoped>\n.albums-list {\n\tdisplay: flex;\n\tflex-direction: column;\n\n\t.album__name {\n\t\tfont-weight: normal;\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n}\n</style>\n","import mod from \"-!../../node_modules/babel-loader/lib/index.js!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Albums.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/babel-loader/lib/index.js!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Albums.vue?vue&type=script&lang=js&\"","\n import API from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2[0].rules[0].use[3]!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Albums.vue?vue&type=style&index=0&id=24a8ac3e&lang=scss&scoped=true&\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2[0].rules[0].use[3]!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Albums.vue?vue&type=style&index=0&id=24a8ac3e&lang=scss&scoped=true&\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./Albums.vue?vue&type=template&id=24a8ac3e&scoped=true&\"\nimport script from \"./Albums.vue?vue&type=script&lang=js&\"\nexport * from \"./Albums.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Albums.vue?vue&type=style&index=0&id=24a8ac3e&lang=scss&scoped=true&\"\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 \"24a8ac3e\",\n null\n \n)\n\nexport default component.exports"],"names":["___CSS_LOADER_EXPORT___","push","module","id","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","_vm","this","_h","$createElement","_c","_self","useWindow","containerElement","ref","staticClass","style","_t","visibleRows","_v","attrs","albums","t","loadingAlbums","errorFetchingAlbums","scopedSlots","_u","key","fn","collection","basename","albumName","_f","lastPhoto","_s","slot","date","n","nbItems","on","$event","showAlbumCreationForm","proxy","handleAlbumCreated","_e"],"sourceRoot":""}