materio-d9/web/themes/custom/materiotheme/assets/dist/module-base.bundle.js

1 line
8.8 KiB
JavaScript

(self.webpackChunkmaterio_com=self.webpackChunkmaterio_com||[]).push([[694],{3775:(e,t,s)=>{"use strict";s.d(t,{Z:()=>_});var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("article",{staticClass:"card search-card"},[s("header",{on:{click:function(t){return t.preventDefault(),e.openModalCard(t)}}},[e.hasDBAccess?s("h1",[e._v(e._s(e.item.title))]):e._e(),e._v(" "),s("h4",[e._v(e._s(e.item.short_description))]),e._v(" "),e.hasDBAccess?s("span",{staticClass:"ref"},[e._v(e._s(e.item.reference))]):e._e()]),e._v(" "),e.hasDBAccess?s("nav",{staticClass:"tools"},[s("section",{staticClass:"tool flags"},[s("span",{staticClass:"btn mdi mdi-folder-outline"}),e._v(" "),s("div",{staticClass:"tool-content"},[s("ul",[e._l(e.flagcolls,(function(t){return e.flagcolls?s("li",{key:t.id},[s("span",{staticClass:"flag mdi",class:[e.flagIsLoading(t.id)?"mdi-loading mdi-spin":e.flagIsActive(t.id)?"mdi-close-circle isActive":"mdi-plus"],attrs:{collid:t.id},on:{click:function(t){return t.preventDefault(),e.onFlagActionCard(t)}}},[e._v("\n "+e._s(t.name)+"\n ")])]):e._e()})),e._v(" "),e.collsLength<15?s("li",{staticClass:"create-flag"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.new_folder_name,expression:"new_folder_name"}],attrs:{placeholder:"new folder"},domProps:{value:e.new_folder_name},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),t.stopPropagation(),e.onCreateFlagColl(t))},input:function(t){t.target.composing||(e.new_folder_name=t.target.value)}}}),e._v(" "),s("span",{staticClass:"add-btn mdi",class:e.addFlagBtnClassObj,on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onCreateFlagColl(t)}}})]):e._e()],2)])]),e._v(" "),e.item.samples&&e.item.samples.length?s("section",{staticClass:"tool samples"},[s("span",{staticClass:"btn mdi mdi-map-marker-star-outline"}),e._v(" "),s("div",{staticClass:"tool-content"},[s("span",{staticClass:"label"},[e._v(e._s(e.$t("materio.Samples")))]),e._v(" "),s("ul",e._l(e.item.samples,(function(t){return s("li",{key:t.showroom.id},[s("span",{staticClass:"showroom"},[e._v(e._s(t.showroom.name))]),e._v(": "+e._s(t.location)+"\n ")])})),0)])]):e._e(),e._v(" "),e.item.note?s("section",{staticClass:"tool note"},[s("span",{staticClass:"btn mdi mdi-note"})]):e._e(),e._v(" "),s("section",{staticClass:"tool print"},[s("a",{attrs:{href:e.item.path+"/printable/print",target:"_blank"}},[s("span",{staticClass:"btn mdi mdi-printer"})])])]):e._e(),e._v(" "),s("section",{directives:[{name:"switcher",rawName:"v-switcher"}],staticClass:"images"},e._l(e.item.images,(function(t,a){return s("figure",{directives:[{name:"lazy",rawName:"v-lazy",value:a,expression:"index"}],key:t.url,staticClass:"lazy"},[s("img",{attrs:{"data-src":t.style_cardmedium_url,title:t.title}}),e._v(" "),s("img",{staticClass:"blank",attrs:{src:e.blanksrc},on:{click:function(t){return t.preventDefault(),e.openModalCard(t)}}})])})),0)])};a._withStripped=!0;var i=s(629),n=s(8357),l=s(3939),r=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{attrs:{id:"member-warning"}},[s("h2",[e._v(e._s(e.$t("materio.Oops")))]),e._v(" "),s("p",[e._v(e._s(e.$t("materio.To be able to access to our 8000+ materials you need become a member")))]),e._v(" "),s("a",{attrs:{href:"/pricing"},on:{click:function(t){return t.preventDefault(),e.onclick(t)}}},[e._v(e._s(e.$t("materio.Join us")))])])};r._withStripped=!0;const o={name:"MemberWarning",router:s(4408).Z,data:()=>({}),methods:{onclick(){this.$modal.hideAll(),this.$router.push({name:"pricing"})}}};var c=s(1900),m=(0,c.Z)(o,r,[],!1,null,"bce9630c",null);m.options.__file="web/themes/custom/materiotheme/vuejs/components/Content/MemberWarning.vue";const d=m.exports,h={name:"Card",props:["item"],mixins:[n.Z],components:{ModalCard:l.Z,MemberWarning:d},data:()=>({blanksrc:`${drupalSettings.path.themePath}/assets/img/blank.gif`,loadingFlag:!1,new_folder_name:"",is_creating_folder:!1}),computed:{...(0,i.rn)({flagcolls:e=>e.User.flagcolls,isloggedin:e=>e.User.isloggedin,hasDBAccess:e=>e.User.hasDBAccess}),collsLength(){return Object.keys(this.flagcolls).length},addFlagBtnClassObj(){return{"mdi-plus-circle-outline":!this.is_creating_folder,"mdi-loading":this.is_creating_folder,active:this.new_folder_name.length>4&&!this.is_creating_folder,loading:this.is_creating_folder}}},beforeMount(){},methods:{...(0,i.nv)({createFlagColl:"User/createFlagColl",flagUnflag:"User/flagUnflag"}),onCreateFlagColl(){this.new_folder_name,this.is_creating_folder=!0,this.createFlagColl(this.new_folder_name).then((e=>{this.new_folder_name="",this.is_creating_folder=!1;let t=e.id;this.loadingFlag=t,this.flagUnflag({action:"flag",id:this.item.id,collid:t}).then((e=>{this.loadingFlag=!1}))}))},flagIsActive(e){return-1!==this.flagcolls[e].items.indexOf(this.item.id)},flagIsLoading(e){return e===this.loadingFlag},onFlagActionCard(e){if(this.item,!this.loadingFlag){let t=e.target.getAttribute("collid"),s=this.flagIsActive(t)?"unflag":"flag";this.loadingFlag=t,this.flagUnflag({action:s,id:this.item.id,collid:t}).then((e=>{this.loadingFlag=!1}))}},openModalCard(e){this.hasDBAccess,this.hasDBAccess?this.$modal.show(l.Z,{item:this.item,addNoteId:e=>{this.item.note={id:e}}},{name:`modal-${this.item.id}`,draggable:!1,classes:"vm--modale-card",width:"95%",height:"95%"}):this.$modal.show(d,{},{draggable:!1,width:"400px",height:"250px"})}}};var u=(0,c.Z)(h,a,[],!1,null,"0318fc68",null);u.options.__file="web/themes/custom/materiotheme/vuejs/components/Content/Card.vue";const _=u.exports},2074:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>u});var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{attrs:{id:"Base"}},[e.searchinfos?s("div",{staticClass:"cards-list"},[s("aside",{staticClass:"search-info"},[e._v("\n "+e._s(e.searchinfos)+"\n ")]),e._v(" "),!e.items.length&!e.noresults?s("div",{staticClass:"loading"},[s("span",[e._v(e._s(e.$t("default.Loading…")))])]):s("ul",e._l(e.items,(function(t){return s("li",{key:t.id},["materiau"==t.bundle?s("Card",{attrs:{item:t}}):e._e(),e._v(" "),"thematique"==t.bundle?s("CardThematique",{attrs:{item:t}}):e._e()],1)})),0),e._v(" "),e.count>e.limit?s("infinite-loading",{on:{infinite:e.nextPage}},[s("div",{attrs:{slot:"no-more"},slot:"no-more"},[e._v("No more results")])]):e._e()],1):s("div",{staticClass:"loading"},[s("span",[e._v(e._s(e.$t("default.Loading…")))])])])};a._withStripped=!0;var i=s(3775),n=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("article",{staticClass:"card card-thematique search-card"},[s("header",[s("a",{attrs:{href:e.item.path},on:{click:function(t){return t.preventDefault(),e.openThematique(t)}}},[s("h1",[e._v(e._s(e.item.title))]),e._v(" "),s("h4",[e._v(e._s(e.item.short_description))])])]),e._v(" "),s("section",{directives:[{name:"switcher",rawName:"v-switcher"}],staticClass:"images"},e._l(e.item.images,(function(t,a){return s("figure",{directives:[{name:"lazy",rawName:"v-lazy",value:a,expression:"index"}],key:t.url,staticClass:"lazy"},[s("img",{attrs:{"data-src":t.style_cardmedium_url,title:t.title}}),e._v(" "),s("img",{staticClass:"blank",attrs:{src:e.blanksrc},on:{click:function(t){return t.preventDefault(),e.openThematique(t)}}})])})),0)])};n._withStripped=!0;const l={name:"Card",props:["item"],mixins:[s(8357).Z],data(){return{blanksrc:`${drupalSettings.path.themePath}/assets/img/blank.gif`,lightbox_index:null,alias:this.item.path.replace(/^.*\/thematique\//g,"")}},methods:{openThematique(e){this.alias,this.$router.push({name:"thematique",params:{alias:this.alias,id:this.item.id}})}}};var r=s(1900),o=(0,r.Z)(l,n,[],!1,null,"6a3bc2e2",null);o.options.__file="web/themes/custom/materiotheme/vuejs/components/Content/CardThematique.vue";const c=o.exports;var m=s(629);const d={name:"Base",data:()=>({pagetitle:"Base"}),computed:{...(0,m.rn)({items:e=>e.Search.items,searchinfos:e=>e.Search.infos,count:e=>e.Search.count,noresults:e=>e.Search.noresults,limit:e=>e.Search.limit})},methods:{...(0,m.nv)({newSearch:"Search/newSearch",nextPage:"Search/nextPage"})},created(){window.location;let e=new URLSearchParams(window.location.search);e.has("keys")?(this.$store.commit("Search/setKeys",e.get("keys")),this.pagetitle=e.get("keys")):(this.$store.commit("Search/setKeys",""),this.pagetitle="Base"),e.has("term")?this.$store.commit("Search/setTerm",e.get("term")):this.$store.commit("Search/setTerm",""),e.has("filters")?this.$store.commit("Search/setFilters",e.get("filters").split(",")):this.$store.commit("Search/setFilters",[]),this.newSearch()},beforeRouteUpdate(e,t,s){this.$store.commit("Search/setKeys",e.query.keys),this.$store.commit("Search/setTerm",e.query.term),this.$store.commit("Search/setFilters",e.query.filters),this.pagetitle=e.query.keys,this.newSearch(),s()},components:{Card:i.Z,CardThematique:c}};var h=(0,r.Z)(d,a,[],!1,null,"04a51984",null);h.options.__file="web/themes/custom/materiotheme/vuejs/components/Pages/Base.vue";const u=h.exports}}]);