1"use strict";(self["webpackChunklumenii"]=self["webpackChunklumenii"]||[]).push([[140],{91410:function(t,e,s){s.d(e,{A:function(){return m}});var n=s(1032),r=s(55993),i=s(339),a=function(){var t=this,e=t._self._c;return t.isLoading?e(i.A,{ref:"table",attrs:{type:"table-thead, table-tbody, table-tfoot"}}):e(r.A,t._g({ref:"table",staticClass:"c-table",attrs:{"group-by":t.groupBy,"group-desc":t.groupDesc,headers:t.translatedHeaders,items:t.items,"item-class":"c-row","item-key":"id",loading:t.isLoading,"loading-text":t.loadingText,"sort-by":t.sortBy,"sort-desc":t.sortDesc,"multi-sort":"","show-expand":!0,"show-group-by":t.showGroupBy},scopedSlots:t._u([t._l(t.slotNames,function(e){return{key:`item.${e}`,fn:function(s){let{item:n}=s;return[t._t(e,null,{item:n})]}}}),{key:"expanded-item",fn:function(s){let{item:n}=s;return[e("td",{staticClass:"c-details py-4",attrs:{colspan:t.headers.length}},[t._t("card",null,{item:n})],2)]}},{key:"no-data",fn:function(){return[e(n.A,{attrs:{color:"primary"},on:{click:function(e){return t.$emit("resync")}}},[t._v(" "+t._s(t.$t("ui.reset"))+" ")])]},proxy:!0}],null,!0)},t.$listeners))},o=[],c=(s(18111),s(61701),{name:"CardTable",components:{},props:{headers:{type:Array,required:!0},items:{type:Array,required:!0},loading:{type:Boolean,required:!0},width:{type:Number,required:!1,default:0}},data:function(){return{tableWidth:this.width,expanded:[],groupBy:[],groupDesc:[],sortBy:[],sortDesc:[!1],showGroupBy:!1,singleExpand:!1}},computed:{isLoading(){return this.loading},loadingText(){return this.$t("ui.loading")},slotNames(){return this.headers.map(t=>t.name)},translatedHeaders(){return this.headers.map(t=>Object.assign({},t,{text:this.$t(t.text),value:t.name}))}},watch:{width:{immediate:!1,handler:function(t,e){this.tableWidth=t||this.$refs.table.clientWidth}}},mounted:function(){},methods:{}}),l=c,d=s(81656),u=(0,d.A)(l,a,o,!1,null,"0a3ea36b",null),m=u.exports},28233:function(t,e,s){s.r(e),s.d(e,{default:function(){return W}});var n=s(82115),r=function(){var t=this,e=t._self._c;return e("div",{ref:"contactsView",staticClass:"c-contacts-view"},[e("ContactToolbar",{attrs:{contacts:t.contacts,grid:t.grid,reset:t.resetToolbar},on:{"update:grid":function(e){t.isGrid=e},results:function(e){return t.onResults(e)}}}),e(n.A,{attrs:{active:t.isLoading,color:"red",height:8,indeterminate:"",striped:""}}),t.isGrid?e("CardView",{attrs:{items:t.resultSet},scopedSlots:t._u([{key:"card",fn:function(s){return[t.isLoading?e("ClientCardSkeleton"):e("ContactCard",{attrs:{contact:s.item}})]}}],null,!1,3129531962)}):e("ContactTable",{attrs:{contacts:t.resultSet,headers:t.headers,loading:t.isLoading},on:{resync:function(e){t.resetToolbar+=1}},scopedSlots:t._u([{key:"details",fn:function(t){return[e("ContactCard",{attrs:{contact:t.contact}})]}}])})],1)},i=[],a=(s(18111),s(61701),s(98427)),o=s(75402),c=s(4432),l=s(1271),d=s(8346),u=s(65872),m=function(){var t=this,e=t._self._c;return e("CardTable",{attrs:{headers:t.headers,items:t.contacts,loading:t.loading},on:{resync:function(e){return t.$emit("resync")},"click:row":function(e){return t.$emit("view",e)}},scopedSlots:t._u([{key:"avatar",fn:function(s){let{item:n}=s;return[e(d.A,{staticClass:"my-2",attrs:{size:"50px"}},[n.avatar?e("img",{attrs:{alt:"Avatar",src:n.avatar}}):e(u.A,[t._v(" mdi-account ")])],1)]}},{key:"card",fn:function(e){let{item:s}=e;return[t._t("card",null,{company:s})]}}],null,!0)})},h=[],p=s(91410),f={name:"ContactTable",components:{CardTable:p.A},props:{contacts:{type:Array,required:!0},headers:{type:Array,required:!0},loading:{type:Boolean,required:!0}},data:function(){return{}},computed:{},methods:{}},y=f,g=s(81656),b=(0,g.A)(y,m,h,!1,null,"f0596142",null),A=b.exports,C=s(1032),v=s(32884),_=s(51908),k=s(13622),x=s(17864),w=s(17742),T=s(82269),S=s(80146),$=s(5709),B=s(99674),O=function(){var t=this,e=t._self._c;return e(B.A,{staticClass:"c-contact-toolbar mb-0",class:{"c-mobile":t.isReallyMobile},attrs:{color:"secondary",dense:"",flat:"",tile:""}},[e($.A,{ref:"search",staticClass:"c-search",attrs:{clearable:"",dense:"","hide-details":"",outlined:"",placeholder:t.$t("ui.search"),"prepend-inner-icon":"mdi-magnify","single-line":""},model:{value:t.searchTerms,callback:function(e){t.searchTerms=e},expression:"searchTerms"}}),e(S.A),e(w.A,{attrs:{bottom:"","offset-y":"","open-on-click":!0,"close-on-click":!0,"close-on-content-click":!0},scopedSlots:t._u([{key:"activator",fn:function(s){let{on:n,attrs:r}=s;return[e(C.A,t._g(t._b({attrs:{icon:""}},"v-btn",r,!1),n),[e(u.A,{attrs:{large:""}},[t._v(" mdi-sort ")])],1)]}}])},[e(v.A,[e(k.A,{attrs:{color:"accent",mandatory:""},model:{value:t.sortOptionIndex,callback:function(e){t.sortOptionIndex=e},expression:"sortOptionIndex"}},t._l(t.sortOptions,function(s){return e(_.A,{key:s.value,on:{click:function(e){t.sortOptionName=s.value}}},[e(x.UZ,[t._v(t._s(s.text))])],1)}),1)],1)],1),e(w.A,{attrs:{bottom:"","offset-y":"","open-on-click":!0,"close-on-click":!0,"close-on-content-click":!1},scopedSlots:t._u([{key:"activator",fn:function(s){let{on:n,attrs:r}=s;return[e(C.A,t._g(t._b({attrs:{icon:""}},"v-btn",r,!1),n),[e(u.A,{class:{"accent--text":t.companyFilter.length>0},attrs:{large:""}},[t._v(" mdi-filter ")])],1)]}}])},[e(v.A,[e(_.A,[e(T.A,{staticClass:"c-filter ml-2",attrs:{chips:"",clearable:"","deletable-chips":"",dense:t.isMobile,"hide-details":"",items:t.companies,label:t.$t("client.label.company"),"menu-props":{offsetY:!0,closeOnClick:!0,closeOnContentClick:!0},multiple:"",outlined:"","prepend-inner-icon":"mdi-filter","single-line":"","small-chips":""},model:{value:t.companyFilter,callback:function(e){t.companyFilter=e},expression:"companyFilter"}})],1)],1)],1),e(C.A,{staticClass:"c-last-button",attrs:{icon:""},on:{click:t.toggleView}},[e(u.A,{attrs:{large:""}},[t._v(" "+t._s(t.isGrid?"mdi-format-list-bulleted-square":"mdi-apps")+" ")])],1)],1)},L=[],N=(s(74423),s(22489),s(17642),s(58004),s(33853),s(45876),s(32475),s(15024),s(31698),s(34559)),q={name:"ContactToolbar",components:{},mixins:[N.A],props:{contacts:{type:Array,required:!0},grid:{type:Boolean,required:!1,default:!0},reset:{type:Number,required:!1,default:0}},data:function(){const t=[{text:this.$t("client.sortOptions.sortByClientNameAsc"),value:"sortByNameAsc"},{text:this.$t("client.sortOptions.sortByClientNameDesc"),value:"sortByNameDesc"},{text:this.$t("ui.sortOptions.sortByAsIs"),value:"sortByAsIs",default:!0}],e=t.findIndex(t=>t.default)||0;return{companyFilter:[],searchTerms:"",selectedContacts:this.selected,isGrid:this.grid,sortOptionName:t[e].value,sortOptionIndex:e,sortOptions:t}},computed:{isMobile(){return this.$vuetify.breakpoint.mobile},isReallyMobile(){return this.mobileMixin_isReallyMobile},companies(){const t=[...new Set(this.contacts.map(t=>t.company))].sort();return t},searchTerm(){return this.searchTerms.toLowerCase()},resultSet(){return this.contacts.filter(t=>!this.companyFilter.length||this.companyFilter.includes(t.company)).filter(t=>!this.searchTerms||this.generateSearchTarget(t).includes(this.searchTerm)).sort(this.sortMixin_getSortFunction(this.sortOptionName))}},watch:{reset:{immediate:!1,handler(t,e){this.companyFilter=[],this.searchTerms=""}},resultSet:{immediate:!0,handler:function(t,e){this.$emit("results",t)}}},methods:{generateSearchTarget(t){const e=t.firstName+t.lastName+t.company+t.email;return e.trim().replace(/\s+/g," ").toLowerCase()},toggleView(){this.isGrid=!this.isGrid,this.$emit("update:grid",this.isGrid)}}},G=q,F=(0,g.A)(G,O,L,!1,null,"25815da5",null),I=F.exports,M=s(96763),D={name:"ContactsView",components:{CardView:o.A,ClientCardSkeleton:c.A,ContactCard:l.A,ContactTable:A,ContactToolbar:I},props:{grid:{type:Boolean,required:!1,default:!0}},data:function(){return{contactService:a.e,contacts:[],resultSet:new Array(48).fill().map((t,e)=>({id:e+""})),headers:[],isGrid:this.grid,isLoading:!0,resetToolbar:0}},computed:{},created:function(){this.fetchContacts()},mounted:function(){},activated:function(){this.isActivated=!0,this.isLoading||this.$emit("count",this.resultSet.length)},deactivated:function(){this.isActivated=!1},methods:{async fetchContacts(){this.isLoading=!0;try{const t=await this.contactService.fetchContacts();this.headers=t.headers,this.contacts=t.data}catch(t){this.headers=[],this.contacts=[],M.error(`[Contacts]: Unable to fetch contacts. ${t}`)}finally{this.isLoading=!1}},onResults(t){this.isLoading||(this.resultSet=t,this.$emit("count",t.length))}}},V=D,R=(0,g.A)(V,r,i,!1,null,"0fa95fc5",null),W=R.exports}}]); 2//# sourceMappingURL=ContactsView-vue.360d65d7.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.