Ei kuvausta

index.js.map 5.5KB

1
  1. {"version":3,"file":"index.js","sources":["../../src/components/Payment/WantedPublishModal/index.tsx"],"sourcesContent":["import React, { Component, Ref } from \"react\";\n\nimport Modal, { ModalProps } from \"../../Common/Modal\";\nimport WantedPublishView from \"../WantedPublishView\";\nimport styles from \"./WantedPublishModal.less\";\nimport {\n WatnedPublishBase,\n WatnedPublishBaseP\n} from \"@components/Payment/BaseClassComponents/WantedPublish\";\n\ninterface WantedPublishModalProps extends WatnedPublishBaseP {\n modalConfig?: ModalProps;\n}\n\ninterface WantedPublishModalState {\n modalVisible: boolean;\n current_wanted: number | string | null;\n}\n\nexport class WantedPublishModal extends WatnedPublishBase<\n WantedPublishModalProps,\n WantedPublishModalState\n> {\n constructor(props: WantedPublishModalProps) {\n super(props);\n this.state = {\n modalVisible: false,\n current_wanted: null\n };\n }\n\n handleConfirmButton = (containerRef?: React.RefObject<any>) => {\n const { handleConfirm } = this.props;\n if (handleConfirm) {\n const value = this.formatCurrentWanted(this.state.current_wanted);\n handleConfirm(value ? Number(value).toFixed(2) : value);\n }\n this.setState({ modalVisible: false });\n };\n\n renderMain() {\n const { current_wanted } = this.state;\n return (\n <WantedPublishView\n wrapperClass={styles.modalBg}\n current_wanted={current_wanted}\n InputWantedValueChange={(v: string) =>\n this.setState({ current_wanted: v })\n }\n InputWantedPressEnter={(v: string) => {\n const value = this.formatCurrentWanted(v);\n if (this.props.handleConfirm)\n this.props.handleConfirm(this.formatResult(value));\n this.setState({ current_wanted: value, modalVisible: false });\n }}\n InputWantedOnBlur={(v: string) => {\n const value = this.formatCurrentWanted(v);\n this.setState({ current_wanted: value });\n }}\n InputWantedClear={() => {\n this.setState(\n {\n current_wanted: null\n },\n () => {\n if (this.props.handleConfirm) this.props.handleConfirm(null);\n this.setState({ modalVisible: false });\n }\n );\n }}\n InputWantedConfirm={this.handleConfirmButton}\n {...this.props.viewConfig}\n />\n );\n }\n\n render() {\n return (\n <>\n <div onClick={() => this.setState({ modalVisible: true })}>\n {this.props.children}\n </div>\n <Modal\n visible={this.state.modalVisible}\n onCancel={() => {\n this.setState({ modalVisible: false });\n }}\n {...this.props.modalConfig}\n >\n {this.renderMain()}\n </Modal>\n </>\n );\n }\n}\n\nexport default WantedPublishModal;\n"],"names":["WantedPublishModal","props","handleConfirmButton","containerRef","handleConfirm","_this","value","formatCurrentWanted","state","current_wanted","Number","toFixed","setState","modalVisible","React","createElement","WantedPublishView","Object","assign","wrapperClass","styles","modalBg","InputWantedValueChange","v","_this2","InputWantedPressEnter","formatResult","InputWantedOnBlur","InputWantedClear","InputWantedConfirm","viewConfig","Fragment","onClick","_this3","children","Modal","visible","onCancel","modalConfig","renderMain","WatnedPublishBase"],"mappings":";;;;;;;;;;;;;;;;;IAmBaA,kBAAb;AAAA;AAAA,4BAAA;;;8BAIcC,OAA8B;;;;;4FAClCA;;UAORC,sBAAsB,UAACC,YAAD,EAAwC;UACpDC,aADoD,GAClCC,MAAKJ,KAAL,CAAlBG;;UACJA,eAAe;YACXE,KAAK,GAAGD,MAAKE,mBAAL,CAAyBF,MAAKG,KAAL,CAAWC,cAApC;;AACdL,QAAAA,aAAa,CAACE,KAAK,GAAGI,MAAM,CAACJ,KAAD,CAAN,CAAcK,OAAd,CAAsB,CAAtB,CAAH,GAA8BL,KAApC,CAAb;;;YAEGM,SAAS;AAAEC,QAAAA,YAAY,EAAE;AAAhB;AANhB;;UANOL,QAAQ;AACXK,MAAAA,YAAY,EAAE,KADH;AAEXJ,MAAAA,cAAc,EAAE;AAFL;;;;;;iCAeL;;;UACAA,cADA,GACmB,KAAKD,KAAL,CAAnBC;aAENK,KAAA,CAAAC,aAAA,CAACC,iBAAD,EAAkBC,MAAA,CAAAC,MAAA,CAAA;AAChBC,QAAAA,YAAY,EAAEC,MAAM,CAACC,OADL;AAEhBZ,QAAAA,cAAc,EAAEA,cAFA;AAGhBa,QAAAA,sBAAsB,EAAE,+BAAA,CAACC,CAAD;iBACtBC,MAAI,CAACZ,QAAL,CAAc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