No Description

WantedPublish-b91e67a7.js 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { a as _inherits, b as _classCallCheck, c as _possibleConstructorReturn, d as _getPrototypeOf } from './inherits-6cb67931.js';
  2. import { Component } from 'react';
  3. var WatnedPublishBase =
  4. /*#__PURE__*/
  5. function (_Component) {
  6. _inherits(WatnedPublishBase, _Component);
  7. function WatnedPublishBase() {
  8. var _this;
  9. _classCallCheck(this, WatnedPublishBase);
  10. _this = _possibleConstructorReturn(this, _getPrototypeOf(WatnedPublishBase).apply(this, arguments));
  11. _this.formatCurrentWanted = function (value) {
  12. var _this$props$inputWant = _this.props.inputWantedRange,
  13. inputWantedRange = _this$props$inputWant === void 0 ? [5, 10000] : _this$props$inputWant;
  14. if (!value) return null;
  15. var result;
  16. result = value;
  17. if (parseInt("".concat(value), 10) === value) {
  18. result = Number(value);
  19. }
  20. if (!result) return null;
  21. if (result > inputWantedRange[1]) result = inputWantedRange[1];
  22. if (result < inputWantedRange[0]) result = inputWantedRange[0];
  23. return result;
  24. };
  25. _this.formatResult = function (value) {
  26. if (!value) return null;
  27. return Number(value).toFixed(2);
  28. };
  29. return _this;
  30. }
  31. return WatnedPublishBase;
  32. }(Component);
  33. export { WatnedPublishBase as W };
  34. //# sourceMappingURL=WantedPublish-b91e67a7.js.map