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.

1 line
12 KiB

  1. (()=>{var e,a,i,r={5818:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});var i=a(71354),r=a.n(i),l=a(76314),o=a.n(l)()(r());o.push([e.id,".declarative-form-field[data-v-fca7a488]{padding:10px 0}.declarative-form-field .input-wrapper[data-v-fca7a488]{width:100%;max-width:400px}.declarative-form-field[data-v-fca7a488]:last-child{border-bottom:none}.declarative-form-field .hint[data-v-fca7a488]{display:inline-block;color:var(--color-text-maxcontrast);margin-inline-start:8px;padding-block-start:5px}.declarative-form-field-radio[data-v-fca7a488],.declarative-form-field-multi_checkbox[data-v-fca7a488]{max-height:250px;overflow-y:auto}.declarative-form-field-multi-select[data-v-fca7a488],.declarative-form-field-select[data-v-fca7a488]{display:flex;flex-direction:column}.declarative-form-field-multi-select label[data-v-fca7a488],.declarative-form-field-select label[data-v-fca7a488]{margin-bottom:5px}","",{version:3,sources:["webpack://./apps/settings/src/components/DeclarativeSettings/DeclarativeSection.vue"],names:[],mappings:"AACA,yCACC,cAAA,CAEA,wDACC,UAAA,CACA,eAAA,CAGD,oDACC,kBAAA,CAGD,+CACC,oBAAA,CACA,mCAAA,CACA,uBAAA,CACA,uBAAA,CAGD,uGACC,gBAAA,CACA,eAAA,CAGD,sGACC,YAAA,CACA,qBAAA,CAEA,kHACC,iBAAA",sourcesContent:["\n.declarative-form-field {\n\tpadding: 10px 0;\n\n\t.input-wrapper {\n\t\twidth: 100%;\n\t\tmax-width: 400px;\n\t}\n\n\t&:last-child {\n\t\tborder-bottom: none;\n\t}\n\n\t.hint {\n\t\tdisplay: inline-block;\n\t\tcolor: var(--color-text-maxcontrast);\n\t\tmargin-inline-start: 8px;\n\t\tpadding-block-start: 5px;\n\t}\n\n\t&-radio, &-multi_checkbox {\n\t\tmax-height: 250px;\n\t\toverflow-y: auto;\n\t}\n\n\t&-multi-select, &-select {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\n\t\tlabel {\n\t\t\tmargin-bottom: 5px;\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);const n=o},15340:()=>{},47790:()=>{},51069:()=>{},63779:()=>{},64688:()=>{},66089:()=>{},71471:(e,a,i)=>{"use strict";var r=i(81222),l=i(53334),o=i(85471),n=i(19051),s=i(85168),d=i(12555),c=i(63814),p=i(17334),u=i.n(p),f=i(32073),v=i(16879),m=i(67607),h=i(88837);const A=(0,i(35947).YK)().setApp("settings").detectUser().build(),b={name:"DeclarativeSection",components:{NcSettingsSection:h.A,NcInputField:v.A,NcSelect:m.default,NcCheckboxRadioSwitch:f.A},props:{form:{type:Object,required:!0}},data:()=>({formFieldsData:{}}),computed:{formApp(){return this.form.app||""},formFields(){return this.form.fields||[]}},beforeMount(){this.initFormFieldsData()},methods:{initFormFieldsData(){this.form.fields.forEach(e=>{"checkbox"===e.type&&this.$set(e,"value",+e.value),"multi-checkbox"===e.type&&(""===e.value?(this.$set(e,"value",{}),e.options.forEach(t=>{this.$set(e.value,t.value,!1)})):(this.$set(e,"value",JSON.parse(e.value)),e.options.forEach(t=>{Object.hasOwn(e.value,t.value)||this.$set(e.value,t.value,!1)}),Object.keys(e.value).forEach(t=>{e.options.find(e=>e.value===t)||delete e.value[t]}))),"multi-select"===e.type&&(""===e.value?this.$set(e,"value",[]):this.$set(e,"value",JSON.parse(e.value))),this.$set(this.formFieldsData,e.id,{value:e.value})})},updateFormFieldDataValue(e,t,a=!1){this.formFieldsData[t.id].value=e,a&&this.updateDeclarativeSettingsValue(t)},async updateDeclarativeSettingsValue(e,a=null){try{let i=(0,c.KT)("settings/api/declarative/value");if(!0===e?.sensitive){i=(0,c.KT)("settings/api/declarative/value-sensitive");try{await(0,d.C5)()}catch{return void(0,s.Qg)(t("settings","Password confirmation is required"))}}return n.Ay.post(i,{app:this.formApp,formId:this.form.id.replace(this.formApp+"_",""),fieldId:e.id,value:null===a?this.formFieldsData[e.id].value:a})}catch(e){A.debug(e),(0,s.Qg)(t("settings","Failed to save setting"))}},onChangeDebounced:u()(function(e){this.updateDeclarativeSettingsValue(e)},1e3),isTextFormField:e=>["text","password","email","tel","url","number"].includes(e.type)}};var _=i(85072),g=i.n(_),y=i(97825),C=i.n(y),x=i(77659),k=i.n(x),D=i(55056),F=i.n(D),w=i(10540),S=i.n(w),O=i(41113),N=i.n(O),E=i(5818),T={};T.styleTagTransform=N(),T.setAttributes=F(),T.insert=k().bind(null,"head"),T.domAPI=C(),T.insertStyleElement=S(),g()(E.A,T),E.A&&E.A.l
  2. //# sourceMappingURL=settings-declarative-settings-forms.js.map?v=5b4f7d803060d072ad43