1 |
- {"version":3,"file":"index.js","sources":["../../src/components/Payment/assets/icon/close@2x.png","../../src/components/Payment/WantedPublishPopover/index.tsx"],"sourcesContent":["const img = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAFNElEQVRYR82Yf0jcdRjH33enp1NbTQ3FdKhTY64hTTsURc6keQeSqIPSQJIiMHM3zj8ST/BE/And+c8wmSSMomHl4EaaP2aeuq/R1MwrraEgLVbLXcvpReY847l9v3I7774/LKUHjuN79/k8z+v7+fG8n89Hhv+pyf4F1xEAxwE8BSAIQDAAPwB/AnCwnzsAVgHsSI0jFcwfwEkA8QAiRAYj0BUACwDsIvtALJgcwLMA0tjREevfs90tADcBbAg5EAN2FEAegFAhZyL/3wYwBeB7vvZCYFEAzgIIEBlUSjMCYwA4vXXiA6N1lAuApvGg7DaAL7zB+QILB1DA7rKDguL80shNegbxBkZbv4jd/gcNxfmfYHftbjxvYDR9CYdFxMahDfExm/tcP3mC0RQWHzIUF+5HAGPcgydYPoBn+MCSk5ODm5ubs4qKigadTq8b6rHuFRUVcYmJicf0ev2swAuTOnwC4L7niD0J4FW+zvHx8YEMw+gjIiKOz8zM3MjIyPhwa2vLp9xUV1cntra2VioUCv+WlpYug8EwLwD3HYAbnmApANL5OlZVVZ0wm806hUKhpHbz8/Nfq1Sqns3NzT1wdXV1J41GYwXXdnZ2lklNTb0sAEaK8JEnGKWHSKH1xY2Cn59fILVdXFz8RqVSXdrY2Nid16amptM1NTVvyeVy0laIGV23uJ+SpnJrTAHgTSEo7v/Kyso4k8l0XqlUUoWBpaUlW3p6epfdbn9oMpnO6HS6N+RyOfnE1NTUWFZW1hUx65H1T3I1z4E9AaBULBi1Ky8vj+ns7NQFBASE0PPKysqi1WqdKSsrK5XJZC61sFqtw2q1+jMpfgmK3ocDoymkqZRkJSUlUd3d3ReCgoJI6B+zwcHBzzUazTVJDh81XgJwnQOLY8Vasp+CgoKI3t7ed5VKJSmGy4aGhvrz8vIskp096kDF5TUOjCpR7X4c9fX1nS0sLCQJ27XV1dXbubm5HTabjSpZqfYTgAEOLAzAOake+vv787VaLSVlsh2Hw/EgODiY8iHsdvsdjUbTMT09/UCi3x9oeXJgtLvKpDgYHR0tzMnJoQISOzs7zq6urss9PT0LAwMDF0JDQ6mOw9ra2t38/Hzz5OTkHxJ8k0Lc5MDo+3UArsTJZ3K5HOPj469kZmbmsFDbHR0dH+j1+hl6TklJCRkZGdGFh4fH0PP6+vq94uJi8/DwsNh6/0sAt9y18kUAiXxQ/v7+MoZhXktLS8uidk6n82FbW9ul2trab937JSUlBVmt1vORkZGx9LvD4bhfWlpqtlgsvwm8NykIqcNf7mBUsb7E19FoNJ6qr6+vojbb29t/NzY2vt/Q0ECnnz0WGxsbODEx8U50dLSrhFpeXrYlJCRcFAD7BYBrN7uDkXzQOqOzoU+zWCwarVarNRgMF9vb2+nU49OioqKUDMO8HRIScjQ7O/u9hYUFoV1KZwCbJxg9vwDgjNA6U6vVx8bGxlzliZCFhYX5xcTEHJmbm1sXaEvnzysAtryB0eIvAeAS6EO2caoJuJjeSutTAFyL+xDtdwCkqbsViq9T0mHW/ZsArlLacx8IX2C0AV4G8PQBjxqlh34AP3vG4TvwkihrDhCOTkZ0+KBqYo8JXRHQyKkBnPiPR4524CAAnwlXCIzjOc3e9AhKlogXoCspOnnz5jSxYBSPLlaeB/AcAFfZLNHuAvgKwK9i+kkB4/xRjqP6jXSQhJpPKUi4aYToc08MEF8ek9KfRo675qRv7qqTu+6kVLAv28+I7SuQ1E7/AHTQdDZ7M6+KAAAAAElFTkSuQmCC\";\n export default img;","import React from \"react\";\nimport { Popover } from \"antd\";\nimport { PopoverProps } from \"antd/lib/popover\";\nimport WantedPublishView from \"../WantedPublishView\";\n\nimport popClose from \"../assets/icon/close@2x.png\";\nimport styles from \"./WantedPublishPopover.less\";\n\nexport interface WantedPublishPopoverProp {\n popoverConfig?: PopoverProps;\n handleConfirm?: Function;\n}\n\nexport interface WantedPublishPopoverState {\n visible: boolean;\n current_wanted: number | string | null;\n}\n\nexport class WantedPublishPopover extends React.Component<\n WantedPublishPopoverProp,\n WantedPublishPopoverState\n> {\n constructor(props: WantedPublishPopoverProp) {\n super(props);\n this.state = {\n visible: false,\n\n current_wanted: null\n };\n }\n\n handleClose = () => {\n const { handleConfirm } = this.props;\n if (handleConfirm) {\n this.handleUpdateCurrentWanted(\n this.state.current_wanted,\n (value: string) => {\n handleConfirm(Number(value).toFixed(2));\n }\n );\n }\n this.setState({ visible: false });\n };\n\n clearCurrentWanted = (cb: Function) => {\n this.setState(\n {\n current_wanted: null\n },\n () => cb()\n );\n };\n\n handleUpdateCurrentWanted = (\n value: string | number | null,\n afterUpdate?: Function\n ) => {\n if (!value) return;\n let result: string | number;\n result = value;\n if (parseInt(`${value}`, 10) === value) {\n // 无小数判断\n result = Number(value);\n }\n if (!result) return;\n if (result > 10000) result = 10000;\n if (result < 5) result = 5;\n this.setState(\n { current_wanted: result },\n () => afterUpdate && afterUpdate(result)\n );\n };\n\n renderInitView() {\n const { current_wanted } = this.state;\n return (\n <WantedPublishView\n type=\"pop\"\n current_wanted={current_wanted}\n InputWantedValueChange={(v: string) =>\n this.setState({ current_wanted: v })\n }\n InputWantedPressEnter={(v: string) =>\n this.handleUpdateCurrentWanted(v, this.handleClose)\n }\n InputWantedOnBlur={(v: string) => this.handleUpdateCurrentWanted(v)}\n InputWantedClear={() => this.clearCurrentWanted(this.handleClose)}\n CloseFunction={this.handleClose}\n />\n );\n }\n\n render() {\n const { children, popoverConfig = {} } = this.props;\n\n return (\n <Popover\n placement=\"left\"\n trigger=\"click\"\n visible={this.state.visible}\n onVisibleChange={(value: boolean) => {\n if (!value) {\n this.handleClose();\n }\n this.setState({ visible: value });\n }}\n {...popoverConfig}\n content={\n <div className={styles.wantedWrapper}>\n <div role=\"button\" tabIndex={1} className={styles.closeBtnWrapper}>\n <div className={styles.closeBtn} onClick={this.handleClose}>\n <img src={popClose} alt=\"close wanted button\" />\n </div>\n </div>\n {this.renderInitView()}\n </div>\n }\n >\n {children}\n </Popover>\n );\n }\n}\n\nexport default WantedPublishPopover;\n"],"names":["img","WantedPublishPopover","props","handleClose","handleConfirm","_this","handleUpdateCurrentWanted","state","current_wanted","value","Number","toFixed","setState","visible","clearCurrentWanted","cb","afterUpdate","result","parseInt","React","createElement","WantedPublishView","type","InputWantedValueChange","v","_this2","InputWantedPressEnter","InputWantedOnBlur","InputWantedClear","CloseFunction","children","popoverConfig","Popover","Object","assign","placement","trigger","onVisibleChange","_this3","content","className","styles","wantedWrapper","role","tabIndex","closeBtnWrapper","closeBtn","onClick","src","popClose","alt","renderInitView","Component"],"mappings":";;;;;;;;;AAAA,IAAMA,GAAG,GAAG,o1DAAZ;;;;;;;;;;ICkBaC,oBAAb;AAAA;AAAA,0BAAA;;;gCAIcC,OAA+B;;;;;8FACnCA;;UAQRC,cAAc,YAAK;UACTC,aADS,GACSC,MAAKH,KAAL,CAAlBE;;UACJA,eAAe;cACZE,0BACHD,MAAKE,KAAL,CAAWC,gBACX,UAACC,KAAD,EAAkB;AAChBL,UAAAA,aAAa,CAACM,MAAM,CAACD,KAAD,CAAN,CAAcE,OAAd,CAAsB,CAAtB,CAAD,CAAb;AAHJ;;;YAOGC,SAAS;AAAEC,QAAAA,OAAO,EAAE;AAAX;AAVhB;;UAaAC,qBAAqB,UAACC,EAAD,EAAiB;YAC/BH,SACH;AACEJ,QAAAA,cAAc,EAAE;AADlB,SAGA;eAAMO,EAAE;AAJV;AADF;;UASAT,4BAA4B,UAC1BG,KAD0B,EAE1BO,WAF0B,EAGxB;UACE,CAACP,OAAO;UACRQ;AACJA,MAAAA,MAAM,GAAGR,KAAT;;UACIS,QAAQ,WAAIT,MAAJ,EAAa,EAAb,CAAR,KAA6BA,OAAO;AAEtCQ,QAAAA,MAAM,GAAGP,MAAM,CAACD,KAAD,CAAf;;;UAEE,CAACQ,QAAQ;UACTA,MAAM,GAAG,OAAOA,MAAM,GAAG,KAAT;UAChBA,MAAM,GAAG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