{"version":3,"file":"form_controller-B6hJn83v.js","sources":["../../../app/javascript/controllers/artifact/entity/form_controller.js"],"sourcesContent":["import ApplicationController from '@/controllers/application_controller'\n\nexport default class extends ApplicationController {\n static targets = [\n 'submit',\n 'requiredProperty',\n 'form'\n ]\n\n syncSubmitButton() {\n this.submitTarget.disabled = !this.requiredPropertyTargets\n .filter(property => !property.hasAttribute('data-disabled'))\n .every(property => property.hasAttribute('data-valid'))\n }\n\n showHiddenForm() {\n this.formTarget.querySelectorAll('[data-property]').forEach(property => {\n property.removeAttribute('data-disabled')\n })\n\n this.syncSubmitButton()\n }\n\n hideHiddenForm() {\n this.formTarget.querySelectorAll('[data-property]').forEach(property => {\n property.setAttribute('data-disabled', '')\n })\n\n this.syncSubmitButton()\n }\n\n requiredPropertyTargetConnected() {\n this.syncSubmitButton()\n }\n}\n"],"names":["form_controller","ApplicationController","property","__publicField"],"mappings":"uNAEe,MAAKA,UAASC,CAAsB,CAOjD,kBAAmB,CACjB,KAAK,aAAa,SAAW,CAAC,KAAK,wBAChC,OAAOC,GAAY,CAACA,EAAS,aAAa,eAAe,CAAC,EAC1D,MAAMA,GAAYA,EAAS,aAAa,YAAY,CAAC,CAC5D,CAEE,gBAAiB,CACf,KAAK,WAAW,iBAAiB,iBAAiB,EAAE,QAAQA,GAAY,CACtEA,EAAS,gBAAgB,eAAe,CACzC,CAAA,EAED,KAAK,iBAAgB,CACzB,CAEE,gBAAiB,CACf,KAAK,WAAW,iBAAiB,iBAAiB,EAAE,QAAQA,GAAY,CACtEA,EAAS,aAAa,gBAAiB,EAAE,CAC1C,CAAA,EAED,KAAK,iBAAgB,CACzB,CAEE,iCAAkC,CAChC,KAAK,iBAAgB,CACzB,CACA,CA/BEC,EADkBH,EACX,UAAU,CACf,SACA,mBACA,MACJ"}