0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-05-18 12:11:41 +00:00
nextcloud_server/dist/settings-declarative-settings-forms.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

2 lines
12 KiB
JavaScript
Raw Permalink Normal View History

(()=>{"use strict";var e,a,i,r={19391:(e,t,a)=>{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-9d5ea91e]{padding:10px 0}.declarative-form-field .input-wrapper[data-v-9d5ea91e]{width:100%;max-width:400px}.declarative-form-field[data-v-9d5ea91e]:last-child{border-bottom:none}.declarative-form-field .hint[data-v-9d5ea91e]{display:inline-block;color:var(--color-text-maxcontrast);margin-inline-start:8px;padding-block-start:5px}.declarative-form-field-radio[data-v-9d5ea91e],.declarative-form-field-multi_checkbox[data-v-9d5ea91e]{max-height:250px;overflow-y:auto}.declarative-form-field-multi-select[data-v-9d5ea91e],.declarative-form-field-select[data-v-9d5ea91e]{display:flex;flex-direction:column}.declarative-form-field-multi-select label[data-v-9d5ea91e],.declarative-form-field-select label[data-v-9d5ea91e]{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},64580:(e,a,i)=>{var r=i(32981),l=i(53334),o=i(85471),n=i(65043),s=i(63814),d=i(85168),c=i(17334),p=i.n(c),u=i(88837),f=i(16879),v=i(67607),m=i(32073);const h={name:"DeclarativeSection",components:{NcSettingsSection:u.A,NcInputField:f.A,NcSelect:v.A,NcCheckboxRadioSwitch:m.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.prototype.hasOwnProperty.call(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){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.formFieldsData[t.id].value=e,a&&this.updateDeclarativeSettingsValue(t)},updateDeclarativeSettingsValue(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{return n.Ay.post((0,s.KT)("settings/api/declarative/value"),{app:this.formApp,formId:this.form.id.replace(this.formApp+"_",""),fieldId:e.id,value:null===a?this.formFieldsData[e.id].value:a})}catch(e){console.debug(e),(0,d.Qg)(t("settings","Failed to save setting"))}},onChangeDebounced:p()((function(e){this.updateDeclarativeSettingsValue(e)}),1e3),isTextFormField:e=>["text","password","email","tel","url","number"].includes(e.type)}};var A=i(85072),b=i.n(A),_=i(97825),g=i.n(_),C=i(77659),y=i.n(C),x=i(55056),k=i.n(x),D=i(10540),F=i.n(D),w=i(41113),S=i.n(w),O=i(19391),N={};N.styleTagTransform=S(),N.setAttributes=k(),N.insert=y().bind(null,"head"),N.domAPI=g(),N.insertStyleElement=F(),b()(O.A,N),O.A&&O.A.locals&&O.A.locals;const E=(0,i(14486).A)(h,(function(){var e=this,t=e._self._c;return t("NcSettingsSection",{staticClass:"declarative-settings-section",attrs:{name:e.t(e.formApp,e.form.title),descri
//# sourceMappingURL=settings-declarative-settings-forms.js.map?v=cef587f5d5ab7ee1e740