You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nextcloud-server/dist/files-sidebar.js

3 lines
50 KiB

/*! For license information please see files-sidebar.js.LICENSE.txt */
(()=>{var e,s,i,n={5119:(t,e,s)=>{"use strict";const{XMLParser:i,XMLValidator:n}=s(16932),r=t=>{if(null==t)return!1;if(0===(t=t.toString().trim()).length)return!1;if(!0!==n.validate(t))return!1;let e;const s=new i;try{e=s.parse(t)}catch(t){return!1}return!!e&&"svg"in e};t.exports=r,t.exports.default=r},17932:(e,s,i)=>{"use strict";var n=i(20144),r=i(31352),o=i(69183),a=i(65358),l=i(5656),d=i(42515),c=i(77958),u=i(41922),h=i(19755),p=i.n(h),f=i(93664),g=i(80351),m=i.n(g),y=i(66805),b=i(97021),v=i(51900);const w=(0,v.Z)(b.Z,y.s,y.x,!1,null,null,null).exports;var A=i(94277),j=i(41251);const x=(0,v.Z)(j.Z,A.s,A.x,!1,null,null,null).exports;var I=i(42899),N=i(72155),C=i(22175);const T={name:"LegacyView",props:{component:{type:Object,required:!0},fileInfo:{type:Object,default:()=>{},required:!0}},watch:{fileInfo(t){this.setFileInfo(t)}},mounted(){this.component.$el.replaceAll(this.$el),this.setFileInfo(this.fileInfo)},methods:{setFileInfo(t){this.component.setFileInfo(new OCA.Files.FileInfoModel(t))}}},_=(0,v.Z)(T,(function(){return(0,this._self._c)("div")}),[],!1,null,null,null).exports,S={name:"SidebarTab",components:{NcAppSidebarTab:i(98445).Z,NcEmptyContent:C.Z},props:{fileInfo:{type:Object,default:()=>{},required:!0},id:{type:String,required:!0},name:{type:String,required:!0},icon:{type:String,required:!1},onMount:{type:Function,required:!0},onUpdate:{type:Function,required:!0},onDestroy:{type:Function,required:!0},onScrollBottomReached:{type:Function,default:()=>{}}},data:()=>({loading:!0}),computed:{activeTab(){return this.$parent.activeTab}},watch:{async fileInfo(t,e){t.id!==e.id&&(this.loading=!0,await this.onUpdate(this.fileInfo),this.loading=!1)}},async mounted(){this.loading=!0,await this.onMount(this.$refs.mount,this.fileInfo,this.$refs.tab),this.loading=!1},async beforeDestroy(){await this.onDestroy()}},E=(0,v.Z)(S,(function(){var t=this,e=t._self._c;return e("NcAppSidebarTab",{ref:"tab",attrs:{id:t.id,name:t.name,icon:t.icon},on:{bottomReached:t.onScrollBottomReached},scopedSlots:t._u([{key:"icon",fn:function(){return[t._t("icon")]},proxy:!0}],null,!0)},[t._v(" "),t.loading?e("NcEmptyContent",{attrs:{icon:"icon-loading"}}):t._e(),t._v(" "),e("div",{ref:"mount"})],1)}),[],!1,null,null,null).exports;var O=i(20435),L=i(35380),D=i(64024),F=i(36906);const P={userVisible:!0,userAssignable:!0,canAssign:!0},M=t=>t.map((t=>{let{props:e}=t;return Object.fromEntries(Object.entries(e).map((t=>{let[e,s]=t;return[(0,F.Z)(e),"displayName"===(0,F.Z)(e)?String(s):s]})))})),k=t=>{const e={...t};return e.name&&!e.displayName||(e.name=e.displayName,delete e.displayName),e};var R=i(79753),z=i(14596);const B=(0,R.generateRemoteUrl)("dav"),Z=(0,z.eI)(B,{headers:{requesttoken:(0,c.IH)()??""}}),$=(0,i(17499).IY)().setApp("systemtags").detectUser().build(),U='<?xml version="1.0"?>\n<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">\n\t<d:prop>\n\t\t<oc:id />\n\t\t<oc:display-name />\n\t\t<oc:user-visible />\n\t\t<oc:user-assignable />\n\t\t<oc:can-assign />\n\t</d:prop>\n</d:propfind>',V=async(e,s)=>{const i="/systemtags-relations/files/"+s+"/"+e.id,n=k(e);try{await Z.customRequest(i,{method:"PUT",data:n})}catch(e){throw $.error(t("systemtags","Failed to set tag for file"),{error:e}),new Error(t("systemtags","Failed to set tag for file"))}},q=n.default.extend({name:"SystemTags",components:{NcLoadingIcon:O.Z,NcSelectTags:L.Z},props:{fileId:{type:Number,required:!0}},data:()=>({sortedTags:[],selectedTags:[],loadingTags:!1,loading:!1}),async created(){try{const t=await(async()=>{try{const{data:t}=await Z.getDirectoryContents("/systemtags",{data:U,details:!0,glob:"/systemtags/*"});return M(t)}catch(t){throw $.error((0,r.Iu)("systemtags","Failed to load tags"),{error:t}),new Error((0,r.Iu)("systemtags","Failed to load tags"))}})(),e=await(async()=>{const t=(0,R.generateUrl)("/apps/systemtags/lastused");try{const{data:e}=await f.Z.get(t);return e.map(Number)}catch(t){throw $.error((0,r.Iu)("systemtags","Failed to load last used tags"),{error:t}),new Error((0,r.Iu)("systemtags","Failed to load last used tags"))}})(),s=[],i=[];for(c
//# sourceMappingURL=files-sidebar.js.map?v=7adc7ca2ea12bfa2f0eb