2023-08-26 10:47:36 -04:00
|
|
|
(()=>{"use strict";var e,a={39941:(e,a,n)=>{var i=n(20144),r=n(79954),o=n(15961),l=n(4820),s=n(79753);const d=["color","logo","background","logoheader","favicon","disable-user-theming"],u={emits:["update:theming"],data:()=>({showSuccess:!1,errorMessage:""}),computed:{id(){return"admin-theming-".concat(this.name)}},methods:{reset(){this.showSuccess=!1,this.errorMessage=""},handleSuccess(){this.showSuccess=!0,setTimeout((()=>{this.showSuccess=!1}),2e3),d.includes(this.name)&&this.$emit("update:theming")}}},c={mixins:[u],watch:{value(e){this.localValue=e}},data(){return{localValue:this.value}},methods:{async save(){this.reset();const e=(0,s.generateUrl)("/apps/theming/ajax/updateStylesheet"),t=!0===this.localValue?"yes":!1===this.localValue?"no":this.localValue;try{await l.default.post(e,{setting:this.name,value:t}),this.$emit("update:value",this.localValue),this.handleSuccess()}catch(e){var a;this.errorMessage=null===(a=e.response.data.data)||void 0===a?void 0:a.message}},async undo(){this.reset();const e=(0,s.generateUrl)("/apps/theming/ajax/undoChanges");try{await l.default.post(e,{setting:this.name}),this.$emit("update:value",this.defaultValue),this.handleSuccess()}catch(e){var t;this.errorMessage=null===(t=e.response.data.data)||void 0===t?void 0:t.message}}}},m={name:"CheckboxField",components:{NcCheckboxRadioSwitch:o.rw,NcNoteCard:o.qf},mixins:[c],props:{name:{type:String,required:!0},value:{type:Boolean,required:!0},defaultValue:{type:Boolean,required:!0},displayName:{type:String,required:!0},label:{type:String,required:!0},description:{type:String,required:!0}}};var p=n(93379),g=n.n(p),h=n(7795),A=n.n(h),f=n(90569),v=n.n(f),y=n(3565),C=n.n(y),b=n(19216),N=n.n(b),x=n(44589),w=n.n(x),_=n(17083),k={};k.styleTagTransform=w(),k.setAttributes=C(),k.insert=v().bind(null,"head"),k.domAPI=A(),k.insertStyleElement=N(),g()(_.Z,k),_.Z&&_.Z.locals&&_.Z.locals;var S=n(51900);const M=(0,S.Z)(m,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"field"},[t("label",{attrs:{for:e.id}},[e._v(e._s(e.displayName))]),e._v(" "),t("div",{staticClass:"field__row"},[t("NcCheckboxRadioSwitch",{attrs:{type:"switch",id:e.id,checked:e.localValue},on:{"update:checked":[function(t){e.localValue=t},e.save]}},[e._v("\n\t\t\t"+e._s(e.label)+"\n\t\t")])],1),e._v(" "),t("p",{staticClass:"field__description"},[e._v(e._s(e.description))]),e._v(" "),e.errorMessage?t("NcNoteCard",{attrs:{type:"error","show-alert":!0}},[t("p",[e._v(e._s(e.errorMessage))])]):e._e()],1)}),[],!1,null,"17145f08",null).exports;var T=n(20296),I=n(92425);const L={name:"ColorPickerField",components:{NcButton:o.P2,NcColorPicker:o.m,NcNoteCard:o.qf,Undo:I.default},mixins:[c],props:{name:{type:String,required:!0},value:{type:String,required:!0},defaultValue:{type:String,required:!0},displayName:{type:String,required:!0}},methods:{debounceSave:(0,T.debounce)((async function(){await this.save()}),200)}};var U=n(3598),F={};F.styleTagTransform=w(),F.setAttributes=C(),F.insert=v().bind(null,"head"),F.domAPI=A(),F.insertStyleElement=N(),g()(U.Z,F),U.Z&&U.Z.locals&&U.Z.locals;const D=(0,S.Z)(L,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"field"},[t("label",{attrs:{for:e.id}},[e._v(e._s(e.displayName))]),e._v(" "),t("div",{staticClass:"field__row"},[t("NcColorPicker",{attrs:{value:e.localValue,"advanced-fields":!0},on:{"update:value":[function(t){e.localValue=t},e.debounceSave]}},[t("NcButton",{staticClass:"field__button",attrs:{type:"primary",id:e.id,"aria-label":e.t("theming","Select a custom color"),"data-admin-theming-setting-primary-color-picker":""}},[e._v("\n\t\t\t\t"+e._s(e.value)+"\n\t\t\t")])],1),e._v(" "),e.value!==e.defaultValue?t("NcButton",{attrs:{type:"tertiary","aria-label":e.t("theming","Reset to default"),"data-admin-theming-setting-primary-color-reset":""},on:{click:e.undo},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Undo",{attrs:{size:20}})]},proxy:!0}],null,!1,33666776)}):e._e()],1),e._v(" "),e.errorMessage?t("NcNoteCard",{attrs:{type:"error","show-alert":!0}},[t("p",[e._v(e._s(e.errorMessage))])]):e._e()],1)}),[],!1,null,"73de
|