photos/js/photos-src_components_Virtu...

2 lines
12 KiB
JavaScript

"use strict";(self.webpackChunkphotos=self.webpackChunkphotos||[]).push([["src_components_VirtualScrolling_vue-src_views_Albums_vue"],{21238:(n,t,e)=>{e.d(t,{Z:()=>a});var o=e(87537),r=e.n(o),i=e(23645),s=e.n(i)()(r());s.push([n.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, "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\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\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.vs-container {\n\toverflow-y: scroll;\n\theight: 100%;\n}\n\n.vs-rows-container {\n\tbox-sizing: border-box;\n}\n'],sourceRoot:""}]);const a=s},56912:(n,t,e)=>{e.d(t,{Z:()=>a});var o=e(87537),r=e.n(o),i=e(23645),s=e.n(i)()(r());s.push([n.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:""}]);const a=s},20561:(n,t,e)=>{e.d(t,{Z:()=>O});var o=e(20296),r=e(59537);function i(n,t){var e="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=u(n))||t&&n&&"number"==typeof n.length){e&&(n=e);var o=0,r=function(){};return{s:r,n:function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}},e:function(n){throw n},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){e=e.call(n)},n:function(){var n=e.next();return s=n.done,n},e:function(n){a=!0,i=n},f:function(){try{s||null==e.return||e.return()}finally{if(a)throw i}}}}function s(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),e.push.apply(e,o)}return e}function a(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?s(Object(e),!0).forEach((function(t){l(n,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):s(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}function l(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function c(n){return function(n){if(Array.isArray(n))return m(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||u(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(n,t){if(n){if("string"==typeof n)return m(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(n):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?m(n,t):void 0}}function m(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,o=new Array(t);e<t;e++)o[e]=n[e];return o}const h={name:"VirtualScrolling",props:{rows:{type:Array,required:!0},containerElement:{type:HTMLElement,default:null},useWindow:{type:Boolean,default:!1},renderWindowRatio:{type:Number,default:4},willBeVisibleWindowRatio:{type:Number,default:4},visibleWindowRatio:{type:Number,default:0},bottomBufferRatio:{type:Number,default:5},scrollToKey:{type:String,default:""}},data:function(){return{scrollPosition:0,containerHeight:0,rowsContainerHeight:0,resizeObserver:null}},computed:{visibleRows:function(){r.Z.debug("[VirtualScrolling] Computing visible rows",this.rows);var n=this.scrollPosition,t=this.containerHeight,e=t*this.renderWindowRatio,o=t*this.willBeVisibleWindowRatio,i=t*this.visibleWindowRatio,s=0,l=0;return this.rows.reduce((function(r,u){if(s=l,l+=u.height,s<n-e||n+t+e<s)return r;var m="none";return n-o<s&&s<n+t+o&&(m="near",n-i<s&&s<n+t+i&&(m="visible"),n-i<l&&l<n+t+i&&(m="visible")),[].concat(c(r),[a(a({},u),{},{visibility:m})])}),[])},rowsHeight:function(){return this.rows.map((function(n){return n.height})).reduce((function(n,t){return n+t}),0)+200},paddingTop:function(){var n=this;if(0===this.visibleRows.length)return 0;var t=this.rows.findIndex((function(t){return t.items===n.visibleRows[0].items}));return this.rows.map((function(n){return n.height})).slice(0,t).reduce((function(n,t){return n+t}),0)},rowsContainerStyle:function(){return{height:"".concat(this.rowsHeight,"px"),paddingTop:"".concat(this.paddingTop,"px")}},isNearBottom:function(){var n=this.containerHeight*this.bottomBufferRatio;return this.scrollPosition+this.containerHeight>=this.rowsHeight-n},container:function(){return r.Z.debug("[VirtualScrolling] Computing container"),null!==this.containerElement?this.containerElement:this.useWindow?window:this.$refs.container}},watch:{isNearBottom:function(n){n&&this.$emit("need-content")},rows:function(){this.isNearBottom&&this.$emit("need-content")},scrollToKey:function(n){var t,e=0,o=i(this.rows);try{for(o.s();!(t=o.n()).done;){var r=t.value;if(r.key===n)return void this.$refs.container.scrollTo({top:e,behavior:"smooth"});e+=r.height}}catch(n){o.e(n)}finally{o.f()}}},mounted:function(){var n=this;this.resizeObserver=new ResizeObserver((function(t){var e,o=i(t);try{for(o.s();!(e=o.n()).done;){var r=e.value,s=r.contentRect;r.target.classList.contains("vs-container")&&(n.containerHeight=s.height),r.target.classList.contains("vs-rows-container")&&(n.rowsContainerHeight=s.height)}}catch(n){o.e(n)}finally{o.f()}})),this.useWindow?(window.addEventListener("resize",this.updateContainerSize),this.containerHeight=window.innerHeight):this.resizeObserver.observe(this.container),this.resizeObserver.observe(this.$refs.rowsContainer),this.container.addEventListener("scroll",this.updateScrollPosition)},beforeDestroy:function(){this.useWindow&&window.removeEventListener("resize",this.updateContainerSize),this.resizeObserver.disconnect(),this.container.removeEventListener("scroll",this.updateScrollPosition)},methods:{updateScrollPosition:(0,o.debounce)((function(){this.useWindow?this.scrollPosition=this.container.scrollY:this.scrollPosition=this.container.scrollTop}),200),updateContainerSize:function(){this.containerHeight=window.innerHeight}}};var d=e(93379),f=e.n(d),p=e(7795),b=e.n(p),v=e(90569),g=e.n(v),w=e(3565),y=e.n(w),A=e(19216),C=e.n(A),_=e(44589),T=e.n(_),W=e(21238),S={};S.styleTagTransform=T(),S.setAttributes=y(),S.insert=g().bind(null,"head"),S.domAPI=b(),S.insertStyleElement=C();f()(W.Z,S);W.Z&&W.Z.locals&&W.Z.locals;const O=(0,e(51900).Z)(h,(function(){var n=this,t=n.$createElement,e=n._self._c||t;return n.useWindow||null!==n.containerElement?e("div",{ref:"rowsContainer",staticClass:"vs-rows-container",style:n.rowsContainerStyle},[n._t("default",null,{renderedRows:n.visibleRows}),n._v(" "),n._t("loader")],2):e("div",{ref:"container",staticClass:"vs-container"},[e("div",{ref:"rowsContainer",staticClass:"vs-rows-container",style:n.rowsContainerStyle},[n._t("default",null,{renderedRows:n.visibleRows}),n._v(" "),n._t("loader")],2)])}),[],!1,null,"5e8733b7",null).exports},75600:(n,t,e)=>{e.r(t),e.d(t,{default:()=>S});var o=e(40502),r=e(65322),i=e(79753),s=e(33476),a=e(12945),l=e(88138),c=e(14445),u=e(666);const m={name:"Albums",components:{Plus:o.Z,FolderMultipleImage:r.Z,NcModal:s.NcModal,NcButton:s.NcButton,NcEmptyContent:s.NcEmptyContent,CollectionsList:l.Z,CollectionCover:c.Z,AlbumForm:u.Z},filters:{coverUrl:function(n){return-1===n?"":(0,i.generateUrl)("/apps/photos/api/v1/preview/".concat(n,"?x=",512,"&y=",512))}},mixins:[a.Z],data:function(){return{showAlbumCreationForm:!1}},methods:{handleAlbumCreated:function(n){var t=n.album;this.showAlbumCreationForm=!1,this.$router.push({name:"albums",params:{path:t.basename}})},onRefresh:function(){this.fetchAlbums()}}};var h=e(93379),d=e.n(h),f=e(7795),p=e.n(f),b=e(90569),v=e.n(b),g=e(3565),w=e.n(g),y=e(19216),A=e.n(y),C=e(44589),_=e.n(C),T=e(56912),W={};W.styleTagTransform=_(),W.setAttributes=w(),W.insert=v().bind(null,"head"),W.domAPI=p(),W.insertStyleElement=A();d()(T.Z,W);T.Z&&T.Z.locals&&T.Z.locals;const S=(0,e(51900).Z)(m,(function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div",[e("CollectionsList",{staticClass:"albums-list",attrs:{collections:n.albums,"collection-title":n.t("photos","Albums"),"collection-root":n.t("photos","Albums"),loading:n.loadingAlbums,error:n.errorFetchingAlbums},scopedSlots:n._u([{key:"default",fn:function(t){var o=t.collection;return e("CollectionCover",{key:o.basename,attrs:{link:"/albums/"+o.basename,"alt-img":n.t("photos","Cover photo for album {albumName}",{albumName:this.collection.basename}),"cover-url":n._f("coverUrl")(o.lastPhoto)}},[e("h2",{staticClass:"album__name"},[n._v("\n\t\t\t\t"+n._s(o.basename)+"\n\t\t\t")]),n._v(" "),e("div",{staticClass:"album__details",attrs:{slot:"subtitle"},slot:"subtitle"},[n._v("\n\t\t\t\t"+n._s(o.date)+" ⸱ "+n._s(n.n("photos","%n item","%n photos and videos",o.nbItems))+"\n\t\t\t")])])}}])},[e("div",{attrs:{slot:"header"},slot:"header"},[e("NcButton",{attrs:{type:"primary","aria-label":n.t("photos","Create a new album.")},on:{click:function(t){n.showAlbumCreationForm=!0}},scopedSlots:n._u([{key:"icon",fn:function(){return[e("Plus")]},proxy:!0}])},[n._v("\n\t\t\t\t"+n._s(n.t("photos","New album"))+"\n\t\t\t")])],1),n._v(" "),n._v(" "),e("NcEmptyContent",{attrs:{slot:"empty-collections-list",title:n.t("photos","There is no album yet!")},slot:"empty-collections-list"},[e("FolderMultipleImage",{attrs:{slot:"icon"},slot:"icon"})],1)],1),n._v(" "),n.showAlbumCreationForm?e("NcModal",{attrs:{title:n.t("photos","New album")},on:{close:function(t){n.showAlbumCreationForm=!1}}},[e("AlbumForm",{on:{done:n.handleAlbumCreated}})],1):n._e()],1)}),[],!1,null,"24a8ac3e",null).exports}}]);
//# sourceMappingURL=photos-src_components_VirtualScrolling_vue-src_views_Albums_vue.js.map?v=fe0ad7493c416d31069a