Brak opisu

index.js.map 7.8KB

1
  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'; export default img;","import React from 'react';\r\nimport { Popover, Divider, Input, Button } from 'antd';\r\nimport WantedPublishView from '../WantedPublishView';\r\n\r\nimport popClose from '../assets/icon/close@2x.png';\r\nimport styles from './WantedPublishPopover.less';\r\n\r\nexport interface WantedPublishPopoverProp {\r\n popoverConfig?: {\r\n placement?: \"left\" | \"top\" | \"right\" | \"bottom\" | \"topLeft\" | \"topRight\" | \"bottomLeft\" | \"bottomRight\" | \"leftTop\" | \"leftBottom\" | \"rightTop\" | \"rightBottom\" | undefined;\r\n trigger?: \"hover\" | \"focus\" | \"click\" | \"contextMenu\" | undefined;\r\n getPopupContainer?: any;\r\n };\r\n handleConfirm?: Function;\r\n}\r\n\r\nexport interface WantedPublishPopoverState {\r\n visible: boolean;\r\n current_wanted: number|string|null;\r\n}\r\n\r\nexport class WantedPublishPopover extends React.Component<WantedPublishPopoverProp, WantedPublishPopoverState> {\r\n constructor(props: WantedPublishPopoverProp) {\r\n super(props);\r\n this.state = {\r\n visible: false,\r\n\r\n current_wanted: null,\r\n }\r\n }\r\n\r\n handleClose = () => {\r\n const { handleConfirm } = this.props;\r\n if (handleConfirm) {\r\n this.handleUpdateCurrentWanted(this.state.current_wanted, (value: string) => {\r\n handleConfirm(Number(value).toFixed(2));\r\n });\r\n }\r\n this.setState({ visible: false });\r\n }\r\n\r\n clearCurrentWanted = (cb: Function) => {\r\n this.setState({\r\n current_wanted: null,\r\n }, () => cb())\r\n }\r\n\r\n handleUpdateCurrentWanted = (value: string|number|null, afterUpdate?: Function) => {\r\n if (!value) return;\r\n let result: string|number;\r\n result = value;\r\n if (parseInt(`${value}`, 10) === value) {\r\n // 无小数判断\r\n result = Number(value)\r\n }\r\n if (!result) return;\r\n if (result > 10000) result = 10000;\r\n if (result < 5) result = 5;\r\n this.setState({ current_wanted: result }, () => afterUpdate && afterUpdate(result));\r\n }\r\n\r\n renderInitView() {\r\n const { current_wanted } = this.state; \r\n return (\r\n <WantedPublishView\r\n type=\"pop\"\r\n current_wanted={current_wanted}\r\n InputWantedValueChange={(v: string) => this.setState({ current_wanted: v })}\r\n InputWantedPressEnter={(v: string) => this.handleUpdateCurrentWanted(v, this.handleClose)}\r\n InputWantedOnBlur={(v: string) => this.handleUpdateCurrentWanted(v)}\r\n InputWantedClear={() => this.clearCurrentWanted(this.handleClose)}\r\n CloseFunction={this.handleClose}\r\n />\r\n )\r\n }\r\n\r\n render() {\r\n const { children, popoverConfig = {} } = this.props;\r\n\r\n return (\r\n <Popover\r\n placement=\"left\"\r\n trigger=\"click\"\r\n visible={this.state.visible}\r\n onVisibleChange={(value: boolean) => {\r\n if (!value) {\r\n this.handleClose();\r\n }\r\n this.setState({ visible: value });\r\n }}\r\n {...popoverConfig}\r\n content={\r\n <div className={styles.wanted_wrapper}>\r\n <div className={styles.close_btn}>\r\n <button onClick={this.handleClose}>\r\n <img src={popClose} alt=\"close wanted button\"/>\r\n </button>\r\n </div>\r\n {this.renderInitView()}\r\n </div>\r\n }\r\n >\r\n {children}\r\n </Popover>\r\n );\r\n }\r\n}\r\n\r\nexport default WantedPublishPopover;"],"names":["WantedPublishPopover","props","handleConfirm","handleUpdateCurrentWanted","state","current_wanted","value","Number","toFixed","setState","visible","cb","afterUpdate","result","parseInt","React","WantedPublishView","v","handleClose","clearCurrentWanted","children","popoverConfig","Popover","styles","wanted_wrapper","close_btn","popClose","renderInitView","Component"],"mappings":";;;;;;;;;;;;;;;AAAA,MAAM,GAAG,GAAG,o1DAAo1D,CAAC;;;;;;ICqBp1DA,oBAAb;;AAAA;;;gCACcC,KAAZ,EAA6C;;;;;kJACrCA,KAAN;;sHAQY,YAAM;UACVC,aADU,GACQ,MAAKD,KADb,CACVC,aADU;;UAEdA,aAAJ,EAAmB;cACZC,yBAAL,CAA+B,MAAKC,KAAL,CAAWC,cAA1C,EAA0D,UAACC,KAAD,EAAmB;UAC3EJ,aAAa,CAACK,MAAM,CAACD,KAAD,CAAN,CAAcE,OAAd,CAAsB,CAAtB,CAAD,CAAb;SADF;;;YAIGC,QAAL,CAAc;QAAEC,OAAO,EAAE;OAAzB;KAhB2C;;6HAmBxB,UAACC,EAAD,EAAkB;YAChCF,QAAL,CAAc;QACZJ,cAAc,EAAE;OADlB,EAEG;eAAMM,EAAE,EAAR;OAFH;KApB2C;;oIAyBjB,UAACL,KAAD,EAA4BM,WAA5B,EAAuD;UAC7E,CAACN,KAAL,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