{"version":3,"sources":["components/TagLists/FormView.jsx","containers/TagLists/FormView.js"],"names":["FormView","React","constructor","props","_this","super","this","state","getItemId","_this$state$item","_this$props$linkTarge","item","id","linkTargetRecord","tagListId","find","Boolean","fetchItem","async","itemId","arguments","length","undefined","_this$props$filterDto","_this$props$filterDto2","tagType","filterDto","Object","keys","tagTypes","responses","Promise","all","getItem","catch","error","_this$props$onCancel","_this$props","onCancel","call","resourceNotFound","newItem","getSettings","type","settingsType","setState","value","data","fieldSettings","showError","handleSubmit","createHandleSubmit","componentDidMount","render","_jsx","_Spin","createLabel","createLabelFactory","createFieldDecorator","createFieldFactory","form","readOnly","isReadOnly","_jsxs","_Form","layout","colon","onSubmit","stopEvent","children","className","ValidationError","errors","validationErrors","Item","label","_Input","autoFocus","FormButtons","saveButtonLoading","saveAndCloseButtonLoading","create","createFormViewContainer","actions","Component"],"mappings":"gRAQA,MAAMA,UAAiBC,YAGrBC,YAAYC,GAAQ,IAADC,EACjBC,MAAMF,GAAMC,EAAAE,KAAA,KAHdC,MAAQ,CAAC,EAAC,KAYVC,UAAY,SAAAC,EAAAC,EAAA,MAAM,CAAgB,QAAhBD,EAACH,KAAKC,MAAMI,YAAI,IAAAF,OAAA,EAAfA,EAAiBG,GAA+B,QAA7BF,EAAEJ,KAAKH,MAAMU,wBAAgB,IAAAH,OAAA,EAA3BA,EAA6BI,WAAWC,KAAKC,QAAQ,OAE7FC,UAAYC,iBAA+C,IAAxC,OAAEC,EAASf,EAAKI,aAAaY,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAC,EAClD,IAAK,IAADG,EAAAC,EACF,MAAMC,EAAuC,QAAhCF,EAAuB,QAAvBC,EAAGpB,EAAKD,MAAMuB,iBAAS,IAAAF,OAAA,EAApBA,EAAsBC,eAAO,IAAAF,IAAII,OAAOC,KAAKC,KAAU,GACjEC,QAAkBC,QAAQC,IAAI,CAClCb,EACIf,EAAKD,MAAM8B,QAAQd,GAAQe,OAAOC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,MAAMyE,gCAKhD,EAGahB,UAAKiB,QAALjB,CAAchE,GC5EdkF,sBAAwB,CAAEC,aAA1BD,CAAqCE,E","file":"static/js/60.5f783277.chunk.js","sourcesContent":["import * as React from 'react'\r\nimport { Form, Input, Spin } from 'antd'\r\nimport { showError, resourceNotFound, ValidationError } from 'helpers/errors'\r\nimport { createLabelFactory, createFieldFactory, createHandleSubmit, isReadOnly } from 'helpers/formViews'\r\nimport tagTypes from 'options/tagTypes'\r\nimport { stopEvent } from 'helpers/events'\r\nimport FormButtons from 'elements/FormButtons'\r\n\r\nclass FormView extends React.Component {\r\n state = {}\r\n\r\n constructor(props) {\r\n super(props)\r\n\r\n this.handleSubmit = createHandleSubmit(this)\r\n }\r\n\r\n componentDidMount() {\r\n this.fetchItem()\r\n }\r\n\r\n getItemId = () => [this.state.item?.id, this.props.linkTargetRecord?.tagListId].find(Boolean)\r\n\r\n fetchItem = async ({ itemId = this.getItemId() } = {}) => {\r\n try {\r\n const tagType = this.props.filterDto?.tagType ?? Object.keys(tagTypes)[0]\r\n const responses = await Promise.all([\r\n itemId\r\n ? this.props.getItem(itemId).catch((error) => {\r\n this.props.onCancel?.()\r\n throw error\r\n })\r\n : !this.props.linkTargetRecord\r\n ? this.props.newItem({ tagType })\r\n : resourceNotFound(this),\r\n this.props.getSettings({ type: this.props.settingsType }),\r\n ])\r\n\r\n this.setState({\r\n item: responses[0].value.data,\r\n fieldSettings: responses[1].value.data.fieldSettings,\r\n })\r\n } catch (error) {\r\n showError({ error })\r\n }\r\n }\r\n\r\n render() {\r\n const { item, fieldSettings } = this.state\r\n\r\n if (!item || !fieldSettings) {\r\n return \r\n }\r\n\r\n const createLabel = createLabelFactory(fieldSettings)\r\n const createFieldDecorator = createFieldFactory(this.props.form, item, fieldSettings)\r\n const readOnly = isReadOnly(this)\r\n\r\n return (\r\n
\r\n
\r\n \r\n \r\n {createFieldDecorator('description')()}\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n )\r\n }\r\n}\r\n\r\nexport default Form.create()(FormView)\r\n","import actions from 'actions/tagLists'\r\nimport { createFormViewContainer } from 'factories/FormView'\r\nimport Component from 'components/TagLists/FormView'\r\n\r\nexport default createFormViewContainer({ actions })(Component)\r\n"],"sourceRoot":""}