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

7 lines
10 KiB
JavaScript

(self.webpackChunkmaterio_com=self.webpackChunkmaterio_com||[]).push([[282],{8964:e=>{var t={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"ThematiqueFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Thematique"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"body"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"tags"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"linked_materials"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"short_description"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"images"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"style_cardmedium_url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"style_hd_url"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"samples"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"showroom"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"location"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"images"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"alt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"style_cardfull_url"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:374}};t.loc.source={body:"fragment ThematiqueFields on Thematique {\n id\n title\n body\n tags {\n id\n name\n }\n linked_materials {\n id\n title\n short_description\n images {\n url\n style_cardmedium_url\n style_hd_url\n }\n \tsamples{\n showroom{\n name\n id\n }\n location\n }\n }\n images {\n id\n url\n alt\n style_cardfull_url\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};e.exports=t},3775:(e,t,i)=>{"use strict";i.d(t,{Z:()=>g});var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("article",{staticClass:"card search-card"},[i("header",{on:{click:function(t){return t.preventDefault(),e.openModalCard(t)}}},[e.hasDBAccess?i("h1",[e._v(e._s(e.item.title))]):e._e(),e._v(" "),i("h4",[e._v(e._s(e.item.short_description))]),e._v(" "),e.hasDBAccess?i("span",{staticClass:"ref"},[e._v(e._s(e.item.reference))]):e._e()]),e._v(" "),e.hasDBAccess?i("nav",{staticClass:"tools"},[i("section",{staticClass:"tool flags"},[i("span",{staticClass:"btn mdi mdi-folder-outline"}),e._v(" "),i("div",{staticClass:"tool-content"},[i("ul",[e._l(e.flagcolls,(function(t){return e.flagcolls?i("li",{key:t.id},[i("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?i("li",{staticClass:"create-flag"},[i("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(" "),i("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?i("section",{staticClass:"tool samples"},[i("span",{staticClass:"btn mdi mdi-beaker-outline"}),e._v(" "),i("div",{staticClass:"tool-content"},[i("span",{staticClass:"label"},[e._v(e._s(e.$t("materio.Samples")))]),e._v(" "),i("ul",e._l(e.item.samples,(function(t){return i("li",{key:t.showroom.id},[i("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?i("section",{staticClass:"tool note"},[i("span",{staticClass:"btn mdi mdi-note"})]):e._e(),e._v(" "),i("section",{staticClass:"tool print"},[i("a",{attrs:{href:e.item.path+"/printable/print",target:"_blank"}},[i("span",{staticClass:"btn mdi mdi-printer"})])])]):e._e(),e._v(" "),i("section",{directives:[{name:"switcher",rawName:"v-switcher"}],staticClass:"images"},e._l(e.item.images,(function(t,a){return i("figure",{directives:[{name:"lazy",rawName:"v-lazy",value:a,expression:"index"}],key:t.url,staticClass:"lazy"},[i("img",{attrs:{"data-src":t.style_cardmedium_url,title:t.title}}),e._v(" "),i("img",{staticClass:"blank",attrs:{src:e.blanksrc},on:{click:function(t){return t.preventDefault(),e.openModalCard(t)}}})])})),0)])};a._withStripped=!0;var s=i(629),n=i(8357),l=i(3939),d=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{attrs:{id:"member-warning"}},[i("h2",[e._v(e._s(e.$t("materio.Oops")))]),e._v(" "),i("p",[e._v(e._s(e.$t("materio.To be able to access to our 8000+ materials you need become a member")))]),e._v(" "),i("a",{attrs:{href:"/pricing"},on:{click:function(t){return t.preventDefault(),e.onclick(t)}}},[e._v(e._s(e.$t("materio.Join us")))])])};d._withStripped=!0;const r={name:"MemberWarning",router:i(4408).Z,data:()=>({}),methods:{onclick(){this.$modal.hideAll(),this.$router.push({name:"pricing"})}}};var o=i(1900),m=(0,o.Z)(r,d,[],!1,null,"bce9630c",null);m.options.__file="web/themes/custom/materiotheme/vuejs/components/Content/MemberWarning.vue";const c=m.exports,u={name:"Card",props:["item"],mixins:[n.Z],components:{ModalCard:l.Z,MemberWarning:c},data:()=>({blanksrc:`${drupalSettings.path.themePath}/assets/img/blank.gif`,loadingFlag:!1,new_folder_name:"",is_creating_folder:!1}),computed:{...(0,s.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(){this.item.id,this.samples},methods:{...(0,s.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"),i=this.flagIsActive(t)?"unflag":"flag";this.loadingFlag=t,this.flagUnflag({action:i,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(c,{},{draggable:!1,width:"400px",height:"250px"})}}};var h=(0,o.Z)(u,a,[],!1,null,"0318fc68",null);h.options.__file="web/themes/custom/materiotheme/vuejs/components/Content/Card.vue";const g=h.exports},3255:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>_});var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return!e.thematique||e.loading?i("div",{staticClass:"loading"},[i("span",[e._v(e._s(e.$t("default.Loading…")))])]):i("article",{staticClass:"thematique"},[i("div",{staticClass:"cols"},[i("div",{staticClass:"col col-left"},[i("section",{staticClass:"body",domProps:{innerHTML:e._s(e.thematique.body)}}),e._v(" "),i("section",{staticClass:"visuel"},[i("img",{attrs:{src:e.image_accroche.style_cardfull_url,alt:""}})])]),e._v(" "),i("div",{staticClass:"col col-right"},[i("aside",{staticClass:"linked-materials"},[i("div",{staticClass:"card-list"},[i("ul",{},e._l(e.thematique.linked_materials,(function(e){return i("li",{key:e.id},[i("Card",{attrs:{item:e}})],1)})),0)])])])])])};a._withStripped=!0;var s=i(4408),n=i(8492),l=(i(2141),i(546)),d=i(3033),r=i(4119),o=i.n(r),m=i(8964),c=i.n(m),u=i(3775);const h={name:"Thematique",router:s.Z,store:n.Z,data:()=>({nid:null,path:null,thematique:{},image_accroche:null,loading:!0}),metaInfo(){return{title:this.thematique.title}},created(){this.getThematique()},methods:{getThematique(){this.$route,this.$route.params.id?this.id=this.$route.params.id:"node"==drupalDecoupled.entity_type&&"thematique"==drupalDecoupled.entity_bundle&&(this.id=drupalDecoupled.entity_id),this.id?this.loadThematique():this.$router.replace({name:"home"})},loadThematique(){this.loading=!0;const e=o()`{
thematique(id: ${this.id}, lang: "${drupalDecoupled.lang_code}") {
...ThematiqueFields
}
}
${c()}
`;l.E.post("",{query:(0,d.S)(e)}).then((({data:{data:{thematique:e}}})=>{this.parseDataGQL(e)})).catch((e=>{console.warn("Issue with loadThematique",e),Promise.reject(e)}))},parseDataGQL(e){e?(this.thematique=e,e.images&&(this.image_accroche=e.images[0]),this.$store.commit("Common/setPagetitle",e.title)):console.warn("Thematique not loaded"),this.loading=!1}},components:{Card:u.Z},watch:{$route(e,t){this.getThematique()}}};var g=(0,i(1900).Z)(h,a,[],!1,null,"128bc334",null);g.options.__file="web/themes/custom/materiotheme/vuejs/components/Pages/Thematique.vue";const _=g.exports}}]);