photos/js/photos-node_modules_vue-mat...

2 lines
16 KiB
JavaScript

"use strict";(self.webpackChunkphotos=self.webpackChunkphotos||[]).push([["node_modules_vue-material-design-icons_FolderMultipleImage_vue-src_views_AlbumContent_vue"],{20830:(t,o,e)=>{e.d(o,{Z:()=>s});var l=e(87537),a=e.n(l),i=e(23645),n=e.n(i)()(a());n.push([t.id,".album__title[data-v-c3c48a50]{width:100%}.album__name[data-v-c3c48a50]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.album__location[data-v-c3c48a50]{margin-left:-4px;display:flex;color:var(--color-text-lighter)}.photos-navigation[data-v-c3c48a50]{position:relative}.photos-navigation--uploading[data-v-c3c48a50]{margin-bottom:30px}[data-v-c3c48a50] .upload-picker .upload-picker__progress{position:absolute;bottom:-30px;left:64px;margin:0}[data-v-c3c48a50] .upload-picker .upload-picker__cancel{position:absolute;bottom:-24px;right:50px}","",{version:3,sources:["webpack://./src/views/AlbumContent.vue"],names:[],mappings:"AAGC,+BACC,UAAA,CAGD,8BACC,eAAA,CACA,kBAAA,CACA,sBAAA,CAGD,kCACC,gBAAA,CACA,YAAA,CACA,+BAAA,CAIF,oCACC,iBAAA,CAEA,+CACC,kBAAA,CAKD,0DACC,iBAAA,CACA,YAAA,CACA,SAAA,CACA,QAAA,CAED,wDACC,iBAAA,CACA,YAAA,CACA,UAAA",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.album {\n\t&__title {\n\t\twidth: 100%;\n\t}\n\n\t&__name {\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t&__location {\n\t\tmargin-left: -4px;\n\t\tdisplay: flex;\n\t\tcolor: var(--color-text-lighter);\n\t}\n}\n\n.photos-navigation {\n\tposition: relative;\n\t// Add space at the bottom for the progress bar.\n\t&--uploading {\n\t\tmargin-bottom: 30px;\n\t}\n}\n\n:deep(.upload-picker) {\n\t.upload-picker__progress {\n\t\tposition: absolute;\n\t\tbottom: -30px;\n\t\tleft: 64px;\n\t\tmargin: 0;\n\t}\n\t.upload-picker__cancel {\n\t\tposition: absolute;\n\t\tbottom: -24px;\n\t\tright: 50px;\n\t}\n}\n'],sourceRoot:""}]);const s=n},99147:(t,o,e)=>{e.d(o,{Z:()=>a});const l={name:"FolderMultipleImageIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};const a=(0,e(51900).Z)(l,(function(){var t=this,o=t._self._c;return o("span",t._b({staticClass:"material-design-icon folder-multiple-image-icon",attrs:{"aria-hidden":!t.title,"aria-label":t.title,role:"img"},on:{click:function(o){return t.$emit("click",o)}}},"span",t.$attrs,!1),[o("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[o("path",{attrs:{d:"M7,15L11.5,9L15,13.5L17.5,10.5L21,15M22,4H14L12,2H6A2,2 0 0,0 4,4V16A2,2 0 0,0 6,18H22A2,2 0 0,0 24,16V6A2,2 0 0,0 22,4M2,6H0V11H0V20A2,2 0 0,0 2,22H20V20H2V6Z"}},[t.title?o("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports},85109:(t,o,e)=>{e.d(o,{Z:()=>a});const l={name:"ImagePlusIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};const a=(0,e(51900).Z)(l,(function(){var t=this,o=t._self._c;return o("span",t._b({staticClass:"material-design-icon image-plus-icon",attrs:{"aria-hidden":!t.title,"aria-label":t.title,role:"img"},on:{click:function(o){return t.$emit("click",o)}}},"span",t.$attrs,!1),[o("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[o("path",{attrs:{d:"M18 15V18H15V20H18V23H20V20H23V18H20V15H18M13.3 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5V13.3C20.4 13.1 19.7 13 19 13C17.9 13 16.8 13.3 15.9 13.9L14.5 12L11 16.5L8.5 13.5L5 18H13.1C13 18.3 13 18.7 13 19C13 19.7 13.1 20.4 13.3 21Z"}},[t.title?o("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports},77531:(t,o,e)=>{e.d(o,{Z:()=>a});const l={name:"PencilIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};const a=(0,e(51900).Z)(l,(function(){var t=this,o=t._self._c;return o("span",t._b({staticClass:"material-design-icon pencil-icon",attrs:{"aria-hidden":!t.title,"aria-label":t.title,role:"img"},on:{click:function(o){return t.$emit("click",o)}}},"span",t.$attrs,!1),[o("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[o("path",{attrs:{d:"M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z"}},[t.title?o("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports},8165:(t,o,e)=>{e.d(o,{Z:()=>a});const l={name:"ShareVariantIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};const a=(0,e(51900).Z)(l,(function(){var t=this,o=t._self._c;return o("span",t._b({staticClass:"material-design-icon share-variant-icon",attrs:{"aria-hidden":!t.title,"aria-label":t.title,role:"img"},on:{click:function(o){return t.$emit("click",o)}}},"span",t.$attrs,!1),[o("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[o("path",{attrs:{d:"M18,16.08C17.24,16.08 16.56,16.38 16.04,16.85L8.91,12.7C8.96,12.47 9,12.24 9,12C9,11.76 8.96,11.53 8.91,11.3L15.96,7.19C16.5,7.69 17.21,8 18,8A3,3 0 0,0 21,5A3,3 0 0,0 18,2A3,3 0 0,0 15,5C15,5.24 15.04,5.47 15.09,5.7L8.04,9.81C7.5,9.31 6.79,9 6,9A3,3 0 0,0 3,12A3,3 0 0,0 6,15C6.79,15 7.5,14.69 8.04,14.19L15.16,18.34C15.11,18.55 15.08,18.77 15.08,19C15.08,20.61 16.39,21.91 18,21.91C19.61,21.91 20.92,20.61 20.92,19A2.92,2.92 0 0,0 18,16.08Z"}},[t.title?o("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports},41809:(t,o,e)=>{e.d(o,{Z:()=>s});var l=e(20629),a=e(58613),i=e(64882);const n={name:"ActionFavorite",components:{Star:a.Z,NcActionButton:i.Js},props:{selectedFileIds:{type:Array,required:!0}},computed:{...(0,l.Se)(["files"]),shouldFavoriteSelection(){return this.selectedFileIds.some((t=>0===this.files[t].favorite))}},methods:{...(0,l.nv)(["toggleFavoriteForFiles"]),async favoriteSelection(){await this.toggleFavoriteForFiles({fileIds:this.selectedFileIds,favoriteState:1})},async unFavoriteSelection(){await this.toggleFavoriteForFiles({fileIds:this.selectedFileIds,favoriteState:0})}}};const s=(0,e(51900).Z)(n,(function(){var t=this,o=t._self._c;return t.shouldFavoriteSelection?o("NcActionButton",{attrs:{"close-after-click":!0,"aria-label":t.t("photos","Mark selection as favorite")},on:{click:t.favoriteSelection}},[t._v("\n\t"+t._s(t.t("photos","Add selection to favorites"))+"\n\t"),o("Star",{attrs:{slot:"icon"},slot:"icon"})],1):o("NcActionButton",{attrs:{"close-after-click":!0,"aria-label":t.t("photos","Remove selection from favorites")},on:{click:t.unFavoriteSelection}},[t._v("\n\t"+t._s(t.t("photos","Remove selection from favorites"))+"\n\t"),o("Star",{attrs:{slot:"icon"},slot:"icon"})],1)}),[],!1,null,null,null).exports},72283:(o,e,l)=>{l.r(e),l.d(e,{default:()=>R});var a=l(20629),i=l(5656),n=l(77958),s=l(64882),r=l(57873),c=l(31352),u=l(20296),m=l.n(u),d=l(44893),p=l(42588),h=l(85109),b=l(41316),A=l(77531),C=l(5352);var g=l(8165),v=l(66951),f=l(60213),_=l(41809),w=l(7976),F=l(13619),k=l(70877),y=l(45947),N=l(41197),S=l(3301),Z=l(59537);const x={name:"AlbumContent",components:{ActionFavorite:_.Z,AlbumForm:w.Z,Close:d.Z,CollaboratorsSelectionForm:F.Z,CollectionContent:k.Z,Delete:p.Z,PhotosPicker:y.Z,HeaderNavigation:N.Z,ImagePlus:h.Z,MapMarker:b.Z,NcActionButton:s.Js,NcActions:s.O3,NcActionSeparator:s.rr,NcButton:s.P2,NcDialog:s.a0,NcEmptyContent:s.SL,NcLoadingIcon:s.lb,NcModal:s.Jc,Pencil:A.Z,Plus:C.Z,ShareVariant:g.Z,UploadPicker:r.e},mixins:[f.Z,v.Z,s.tq],props:{albumName:{type:String,default:"/"}},data(){return{allowedMimes:S.ZP,showAddPhotosModal:!1,showManageCollaboratorView:!1,showEditAlbumForm:!1,loadingAddCollaborators:!1,uploader:(0,r.oM)(),newFileMenuEntry:{id:"album-add",displayName:t("photos","Add photos to this album"),enabled:t=>t.basename===this.$route.params.albumName,iconSvgInline:'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-plus" viewBox="0 0 24 24"><path d="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" /></svg>',handler:()=>{this.showAddPhotosModal=!0}}}},computed:{album(){return this.$store.getters.getAlbum(this.albumName)},albumFileIds(){return this.$store.getters.getAlbumFiles(this.albumName)},sharingEnabled:()=>void 0!==OC.Share,uploadContext(){var t;return{...this.album,route:this.$route.name,root:"dav/photos/".concat(null===(t=(0,n.ts)())||void 0===t?void 0:t.uid,"/albums")}},albumFileName(){return this.$store.getters.getAlbumName(this.albumName)},albumAsFolder(){var t,o,e,l;return new i.gt({...this.album,owner:null!==(t=null===(o=(0,n.ts)())||void 0===o?void 0:o.uid)&&void 0!==t?t:"",source:null!==(e=null===(l=this.album)||void 0===l?void 0:l.source)&&void 0!==e?e:"",permissions:(0,i.zu)(this.album.permissions)})}},async mounted(){this.fetchAlbum(),this.fetchAlbumContent(),(0,i.cd)(this.newFileMenuEntry)},destroyed(){(0,i.oE)(this.newFileMenuEntry)},methods:{...(0,a.nv)(["addFilesToCollection","removeFilesFromCollection","deleteCollection","updateCollection"]),async fetchAlbum(){await this.fetchCollection(this.albumFileName,["<nc:location />","<nc:dateRange />","<nc:collaborators />"])},async fetchAlbumContent(){await this.fetchCollectionFiles(this.albumFileName)},redirectToNewName(t){let{album:o}=t;this.showEditAlbumForm=!1,this.album.basename!==o.basename&&this.$router.push("/albums/".concat(o.basename))},async handleFilesPicked(t){this.showAddPhotosModal=!1,await this.addFilesToCollection({collectionFileName:this.album.filename,fileIdsToAdd:t}),await this.fetchAlbumContent()},async handleRemoveFilesFromAlbum(t){this.$refs.collectionContent.onUncheckFiles(t),await this.removeFilesFromCollection({collectionFileName:this.album.filename,fileIdsToRemove:t})},async handleDeleteAlbum(){await this.deleteCollection({collectionFileName:this.album.filename}),this.$router.push("/albums")},async handleSetCollaborators(t){try{this.loadingAddCollaborators=!0,this.showManageCollaboratorView=!1,await this.updateCollection({collectionFileName:this.album.filename,properties:{collaborators:t}})}catch(t){Z.Z.error("Error while setting album collaborators",{error:t})}finally{this.loadingAddCollaborators=!1}},onUpload:m()((function(){this.fetchAlbumContent()}),500),t:c.Iu}};var M=l(93379),I=l.n(M),V=l(7795),B=l.n(V),H=l(90569),P=l.n(H),L=l(3565),E=l.n(L),T=l(19216),$=l.n(T),z=l(44589),D=l.n(z),W=l(20830),U={};U.styleTagTransform=D(),U.setAttributes=E(),U.insert=P().bind(null,"head"),U.domAPI=B(),U.insertStyleElement=$();I()(W.Z,U);W.Z&&W.Z.locals&&W.Z.locals;const R=(0,l(51900).Z)(x,(function(){var t=this,o=t._self._c;return o("div",[o("CollectionContent",{ref:"collectionContent",attrs:{collection:t.album,"collection-file-ids":t.albumFileIds,loading:t.loadingCollection||t.loadingCollectionFiles,error:t.errorFetchingCollection||t.errorFetchingCollectionFiles},scopedSlots:t._u([{key:"header",fn:function(e){var l;let{selectedFileIds:a,resetSelection:i}=e;return o("HeaderNavigation",{key:"navigation",class:{"photos-navigation--uploading":(null===(l=t.uploader.queue)||void 0===l?void 0:l.length)>0},attrs:{loading:t.loadingCollectionFiles,params:{albumName:t.albumName},path:"/"+t.albumName,title:t.albumName},on:{refresh:t.fetchAlbumContent}},[void 0!==t.album&&""!==t.album.location?o("div",{staticClass:"album__location",attrs:{slot:"subtitle"},slot:"subtitle"},[o("MapMarker"),t._v(t._s(t.album.location)+"\n\t\t\t")],1):t._e(),t._v(" "),o("template",{slot:"default"},[a.length>0?o("NcButton",{attrs:{"aria-label":t.t("photos","Unselect all")},on:{click:i},scopedSlots:t._u([{key:"icon",fn:function(){return[o("Close")]},proxy:!0}],null,!0)},[t._v("\n\t\t\t\t\t"+t._s(t.t("photos","Unselect all"))+"\n\t\t\t\t")]):t._e()],1),t._v(" "),void 0!==t.album?o("template",{slot:"right"},[0!==t.album.nbItems?o("UploadPicker",{attrs:{accept:t.allowedMimes,context:t.uploadContext,destination:t.albumAsFolder,root:t.uploadContext.root,multiple:!0},on:{uploaded:t.onUpload}}):t._e(),t._v(" "),t.sharingEnabled?o("NcButton",{attrs:{type:"tertiary","aria-label":t.t("photos","Manage collaborators for this album")},on:{click:function(o){t.showManageCollaboratorView=!0}}},[o("ShareVariant",{attrs:{slot:"icon"},slot:"icon"})],1):t._e(),t._v(" "),o("NcActions",{attrs:{"aria-label":t.t("photos","Open actions menu")}},[o("NcActionButton",{attrs:{"close-after-click":!0,"aria-label":t.t("photos","Edit album details")},on:{click:function(o){t.showEditAlbumForm=!0}}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("photos","Edit album details"))+"\n\t\t\t\t\t\t"),o("Pencil",{attrs:{slot:"icon"},slot:"icon"})],1),t._v(" "),o("NcActionButton",{attrs:{"close-after-click":!0},on:{click:t.handleDeleteAlbum}},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("photos","Delete album"))+"\n\t\t\t\t\t\t"),o("Delete",{attrs:{slot:"icon"},slot:"icon"})],1),t._v(" "),a.length>0?[o("NcActionSeparator"),t._v(" "),o("ActionFavorite",{attrs:{"selected-file-ids":a}}),t._v(" "),o("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(o){return t.handleRemoveFilesFromAlbum(a)}}},[t._v("\n\t\t\t\t\t\t\t"+t._s(t.t("photos","Remove selection from album"))+"\n\t\t\t\t\t\t\t"),o("Close",{attrs:{slot:"icon"},slot:"icon"})],1)]:t._e()],2)],1):t._e()],2)}}],null,!1,3551349678)},[t._v(" "),void 0===t.album||0!==t.album.nbItems||t.loadingCollectionFiles||t.loadingCollection?t._e():o("NcEmptyContent",{staticClass:"album__empty",attrs:{slot:"empty-content",name:t.t("photos","This album does not have any photos or videos yet!")},slot:"empty-content"},[o("ImagePlus",{attrs:{slot:"icon"},slot:"icon"}),t._v(" "),o("NcButton",{staticClass:"album__empty__button",attrs:{slot:"action",type:"primary","aria-label":t.t("photos","Add photos to this album")},on:{click:function(o){t.showAddPhotosModal=!0}},slot:"action"},[o("Plus",{attrs:{slot:"icon"},slot:"icon"}),t._v("\n\t\t\t\t"+t._s(t.t("photos","Add"))+"\n\t\t\t")],1)],1)],1),t._v(" "),o("PhotosPicker",{attrs:{open:t.showAddPhotosModal,"blacklist-ids":t.albumFileIds,destination:t.album.basename,name:t.t("photos","Add photos to {albumName}",{albumName:t.albumName})},on:{"update:open":function(o){t.showAddPhotosModal=o},"files-picked":t.handleFilesPicked}}),t._v(" "),t.showManageCollaboratorView&&void 0!==t.album?o("NcModal",{attrs:{name:t.t("photos","Manage collaborators")},on:{close:function(o){t.showManageCollaboratorView=!1}}},[o("CollaboratorsSelectionForm",{attrs:{"album-name":t.album.basename,collaborators:t.album.collaborators},scopedSlots:t._u([{key:"default",fn:function(e){let{collaborators:l}=e;return[o("NcButton",{attrs:{"aria-label":t.t("photos","Save collaborators for this album."),type:"primary",disabled:t.loadingAddCollaborators},on:{click:function(o){return t.handleSetCollaborators(l)}},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loadingAddCollaborators?o("NcLoadingIcon"):t._e()]},proxy:!0}],null,!0)},[t._v("\n\t\t\t\t\t"+t._s(t.t("photos","Save"))+"\n\t\t\t\t")])]}}],null,!1,4058924180)})],1):t._e(),t._v(" "),t.showEditAlbumForm?o("NcDialog",{attrs:{name:t.t("photos","Edit album details"),"close-on-click-outside":"",size:"normal"},on:{closing:function(o){t.showEditAlbumForm=!1}}},[o("AlbumForm",{attrs:{album:t.album},on:{done:t.redirectToNewName}})],1):t._e()],1)}),[],!1,null,"c3c48a50",null).exports}}]);
//# sourceMappingURL=photos-node_modules_vue-material-design-icons_FolderMultipleImage_vue-src_views_AlbumContent_vue.js.map?v=e555c4c92feb42647415