Няма описание

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  4. var inherits = require('../inherits-c86d64c1.js');
  5. var React = require('react');
  6. var React__default = _interopDefault(React);
  7. require('react-dom');
  8. var Modal = require('../Modal/index.js');
  9. var styleInject_es = require('../style-inject.es-dcee06b6.js');
  10. require('../defineProperty-ba7cd53d.js');
  11. require('../index-4c407188.js');
  12. require('antd');
  13. var WantedPublishView = require('../WantedPublishView/index.js');
  14. var WantedPublish = require('../WantedPublish-761aab8e.js');
  15. var css = ".WantedPublishModal_modalBg__3OlNh {\n background: white;\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n padding: 16px;\n text-align: center;\n border-radius: 4px;\n}\n";
  16. var styles = {
  17. "modalBg": "WantedPublishModal_modalBg__3OlNh"
  18. };
  19. styleInject_es.styleInject(css);
  20. var WantedPublishModal =
  21. /*#__PURE__*/
  22. function (_WatnedPublishBase) {
  23. inherits._inherits(WantedPublishModal, _WatnedPublishBase);
  24. function WantedPublishModal(props) {
  25. var _this;
  26. inherits._classCallCheck(this, WantedPublishModal);
  27. _this = inherits._possibleConstructorReturn(this, inherits._getPrototypeOf(WantedPublishModal).call(this, props));
  28. _this.handleConfirmButton = function (containerRef) {
  29. var handleConfirm = _this.props.handleConfirm;
  30. if (handleConfirm) {
  31. var value = _this.formatCurrentWanted(_this.state.current_wanted);
  32. handleConfirm(value ? Number(value).toFixed(2) : value);
  33. }
  34. _this.setState({
  35. modalVisible: false
  36. });
  37. };
  38. _this.state = {
  39. modalVisible: false,
  40. current_wanted: null
  41. };
  42. return _this;
  43. }
  44. inherits._createClass(WantedPublishModal, [{
  45. key: "renderMain",
  46. value: function renderMain() {
  47. var _this2 = this;
  48. var current_wanted = this.state.current_wanted;
  49. return React__default.createElement(WantedPublishView.default, Object.assign({
  50. wrapperClass: styles.modalBg,
  51. current_wanted: current_wanted,
  52. InputWantedValueChange: function InputWantedValueChange(v) {
  53. return _this2.setState({
  54. current_wanted: v
  55. });
  56. },
  57. InputWantedPressEnter: function InputWantedPressEnter(v) {
  58. var value = _this2.formatCurrentWanted(v);
  59. if (_this2.props.handleConfirm) _this2.props.handleConfirm(_this2.formatResult(value));
  60. _this2.setState({
  61. current_wanted: value,
  62. modalVisible: false
  63. });
  64. },
  65. InputWantedOnBlur: function InputWantedOnBlur(v) {
  66. var value = _this2.formatCurrentWanted(v);
  67. _this2.setState({
  68. current_wanted: value
  69. });
  70. },
  71. InputWantedClear: function InputWantedClear() {
  72. _this2.setState({
  73. current_wanted: null
  74. }, function () {
  75. if (_this2.props.handleConfirm) _this2.props.handleConfirm(null);
  76. _this2.setState({
  77. modalVisible: false
  78. });
  79. });
  80. },
  81. InputWantedConfirm: this.handleConfirmButton
  82. }, this.props.viewConfig));
  83. }
  84. }, {
  85. key: "render",
  86. value: function render() {
  87. var _this3 = this;
  88. return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
  89. onClick: function onClick() {
  90. return _this3.setState({
  91. modalVisible: true
  92. });
  93. }
  94. }, this.props.children), React__default.createElement(Modal.default, Object.assign({
  95. visible: this.state.modalVisible,
  96. onCancel: function onCancel() {
  97. _this3.setState({
  98. modalVisible: false
  99. });
  100. }
  101. }, this.props.modalConfig), this.renderMain()));
  102. }
  103. }]);
  104. return WantedPublishModal;
  105. }(WantedPublish.WatnedPublishBase);
  106. exports.WantedPublishModal = WantedPublishModal;
  107. exports.default = WantedPublishModal;
  108. //# sourceMappingURL=index.js.map