説明なし

WantedPublish-761aab8e.js 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. 'use strict';
  2. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  3. var inherits = require('./inherits-c86d64c1.js');
  4. var React = require('react');
  5. var React__default = _interopDefault(React);
  6. var WatnedPublishBase =
  7. /*#__PURE__*/
  8. function (_Component) {
  9. inherits._inherits(WatnedPublishBase, _Component);
  10. function WatnedPublishBase() {
  11. var _this;
  12. inherits._classCallCheck(this, WatnedPublishBase);
  13. _this = inherits._possibleConstructorReturn(this, inherits._getPrototypeOf(WatnedPublishBase).apply(this, arguments));
  14. _this.formatCurrentWanted = function (value) {
  15. var _this$props$inputWant = _this.props.inputWantedRange,
  16. inputWantedRange = _this$props$inputWant === void 0 ? [5, 10000] : _this$props$inputWant;
  17. if (!value) return null;
  18. var result;
  19. result = value;
  20. if (parseInt("".concat(value), 10) === value) {
  21. result = Number(value);
  22. }
  23. if (!result) return null;
  24. if (result > inputWantedRange[1]) result = inputWantedRange[1];
  25. if (result < inputWantedRange[0]) result = inputWantedRange[0];
  26. return result;
  27. };
  28. _this.formatResult = function (value) {
  29. if (!value) return null;
  30. return Number(value).toFixed(2);
  31. };
  32. return _this;
  33. }
  34. return WatnedPublishBase;
  35. }(React.Component);
  36. exports.WatnedPublishBase = WatnedPublishBase;
  37. //# sourceMappingURL=WantedPublish-761aab8e.js.map