@douyinfe/semi-ui 2.36.1-alpha.1 → 2.36.1-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/umd/semi-ui.js +266 -232
  2. package/dist/umd/semi-ui.js.map +1 -1
  3. package/dist/umd/semi-ui.min.js +1 -1
  4. package/dist/umd/semi-ui.min.js.map +1 -1
  5. package/lib/cjs/anchor/index.d.ts +1 -1
  6. package/lib/cjs/autoComplete/index.d.ts +1 -1
  7. package/lib/cjs/button/Button.d.ts +1 -1
  8. package/lib/cjs/button/buttonGroup.d.ts +1 -1
  9. package/lib/cjs/button/index.d.ts +1 -1
  10. package/lib/cjs/datePicker/dateInput.d.ts +1 -1
  11. package/lib/cjs/datePicker/datePicker.d.ts +2 -2
  12. package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
  13. package/lib/cjs/datePicker/yearAndMonth.d.ts +1 -1
  14. package/lib/cjs/form/baseForm.d.ts +2 -2
  15. package/lib/cjs/form/field.d.ts +2 -2
  16. package/lib/cjs/input/index.d.ts +1 -1
  17. package/lib/cjs/input/inputGroup.d.ts +1 -1
  18. package/lib/cjs/input/textarea.js +13 -24
  19. package/lib/cjs/modal/confirm.d.ts +21 -21
  20. package/lib/cjs/rating/index.d.ts +1 -1
  21. package/lib/cjs/rating/item.d.ts +1 -1
  22. package/lib/cjs/switch/index.d.ts +1 -1
  23. package/lib/cjs/table/Table.d.ts +2 -2
  24. package/lib/cjs/table/index.d.ts +1 -1
  25. package/lib/cjs/tagInput/index.d.ts +1 -1
  26. package/lib/cjs/timePicker/TimePicker.d.ts +1 -1
  27. package/lib/cjs/timePicker/index.d.ts +1 -1
  28. package/lib/cjs/typography/title.d.ts +2 -2
  29. package/lib/es/anchor/index.d.ts +1 -1
  30. package/lib/es/autoComplete/index.d.ts +1 -1
  31. package/lib/es/button/Button.d.ts +1 -1
  32. package/lib/es/button/buttonGroup.d.ts +1 -1
  33. package/lib/es/button/index.d.ts +1 -1
  34. package/lib/es/datePicker/dateInput.d.ts +1 -1
  35. package/lib/es/datePicker/datePicker.d.ts +2 -2
  36. package/lib/es/datePicker/monthsGrid.d.ts +1 -1
  37. package/lib/es/datePicker/yearAndMonth.d.ts +1 -1
  38. package/lib/es/form/baseForm.d.ts +2 -2
  39. package/lib/es/form/field.d.ts +2 -2
  40. package/lib/es/input/index.d.ts +1 -1
  41. package/lib/es/input/inputGroup.d.ts +1 -1
  42. package/lib/es/input/textarea.js +13 -24
  43. package/lib/es/modal/confirm.d.ts +21 -21
  44. package/lib/es/rating/index.d.ts +1 -1
  45. package/lib/es/rating/item.d.ts +1 -1
  46. package/lib/es/switch/index.d.ts +1 -1
  47. package/lib/es/table/Table.d.ts +2 -2
  48. package/lib/es/table/index.d.ts +1 -1
  49. package/lib/es/tagInput/index.d.ts +1 -1
  50. package/lib/es/timePicker/TimePicker.d.ts +1 -1
  51. package/lib/es/timePicker/index.d.ts +1 -1
  52. package/lib/es/typography/title.d.ts +2 -2
  53. package/package.json +8 -8
@@ -15058,125 +15058,149 @@ function dontSetMe(props
15058
15058
 
15059
15059
  exports.__esModule = true;
15060
15060
  exports["default"] = void 0;
15061
- var React = _interopRequireWildcard(__webpack_require__("neV8"));
15061
+
15062
+ var _react = _interopRequireDefault(__webpack_require__("neV8"));
15063
+
15062
15064
  var _reactDraggable = __webpack_require__("j6Rw");
15065
+
15063
15066
  var _utils = __webpack_require__("+cYm");
15067
+
15064
15068
  var _propTypes = __webpack_require__("6rtJ");
15065
- var _excluded = ["children", "className", "draggableOpts", "width", "height", "handle", "handleSize", "lockAspectRatio", "axis", "minConstraints", "maxConstraints", "onResize", "onResizeStop", "onResizeStart", "resizeHandles", "transformScale"];
15066
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15067
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15068
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
15069
+
15070
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15071
+
15072
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
15073
+
15074
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
15075
+
15076
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
15077
+
15069
15078
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
15070
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15071
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
15072
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15073
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
15074
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
15075
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
15076
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15077
- // The base <Resizable> component.
15078
- // This component does not have state and relies on the parent to set its props based on callback data.
15079
+
15080
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
15081
+
15082
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
15083
+
15084
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15085
+
15079
15086
  var Resizable = /*#__PURE__*/function (_React$Component) {
15080
15087
  _inheritsLoose(Resizable, _React$Component);
15088
+
15081
15089
  function Resizable() {
15082
15090
  var _this;
15091
+
15083
15092
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15084
15093
  args[_key] = arguments[_key];
15085
15094
  }
15095
+
15086
15096
  _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
15087
- _this.handleRefs = {};
15088
- _this.lastHandleRect = null;
15089
- _this.slack = null;
15097
+
15098
+ _defineProperty(_assertThisInitialized(_this), "state", undefined);
15099
+
15100
+ _defineProperty(_assertThisInitialized(_this), "lastHandleRect", null);
15101
+
15102
+ _defineProperty(_assertThisInitialized(_this), "slack", null);
15103
+
15090
15104
  return _this;
15091
15105
  }
15106
+
15092
15107
  var _proto = Resizable.prototype;
15108
+
15093
15109
  _proto.componentWillUnmount = function componentWillUnmount() {
15094
15110
  this.resetData();
15095
15111
  };
15112
+
15113
+ _proto.lockAspectRatio = function lockAspectRatio(width, height, aspectRatio) {
15114
+ height = width / aspectRatio;
15115
+ width = height * aspectRatio;
15116
+ return [width, height];
15117
+ };
15118
+
15096
15119
  _proto.resetData = function resetData() {
15097
15120
  this.lastHandleRect = this.slack = null;
15098
- }
15099
-
15100
- // Clamp width and height within provided constraints
15121
+ } // Clamp width and height within provided constraints
15101
15122
  ;
15123
+
15102
15124
  _proto.runConstraints = function runConstraints(width, height) {
15103
- var _this$props = this.props,
15104
- minConstraints = _this$props.minConstraints,
15105
- maxConstraints = _this$props.maxConstraints,
15106
- lockAspectRatio = _this$props.lockAspectRatio;
15107
- // short circuit
15108
- if (!minConstraints && !maxConstraints && !lockAspectRatio) return [width, height];
15109
-
15110
- // If constraining to min and max, we need to also fit width and height to aspect ratio.
15111
- if (lockAspectRatio) {
15112
- var ratio = this.props.width / this.props.height;
15113
- var deltaW = width - this.props.width;
15114
- var deltaH = height - this.props.height;
15115
-
15116
- // Find which coordinate was greater and should push the other toward it.
15117
- // E.g.:
15118
- // ratio = 1, deltaW = 10, deltaH = 5, deltaH should become 10.
15119
- // ratio = 2, deltaW = 10, deltaH = 6, deltaW should become 12.
15120
- if (Math.abs(deltaW) > Math.abs(deltaH * ratio)) {
15125
+ var _ref = [this.props.minConstraints, this.props.maxConstraints],
15126
+ min = _ref[0],
15127
+ max = _ref[1];
15128
+ if (!min && !max) return [width, height]; // If constraining to min and max, we need to also fit width and height to aspect ratio.
15129
+
15130
+ if (this.props.lockAspectRatio) {
15131
+ var resizingHorizontally = height === this.props.height;
15132
+
15133
+ if (resizingHorizontally) {
15134
+ var ratio = this.props.width / this.props.height;
15121
15135
  height = width / ratio;
15122
- } else {
15123
15136
  width = height * ratio;
15137
+ } else {
15138
+ // Take into account vertical resize with N/S handles on locked aspect
15139
+ // ratio. Calculate the change height-first, instead of width-first
15140
+ var _ratio = this.props.height / this.props.width;
15141
+
15142
+ width = height / _ratio;
15143
+ height = width * _ratio;
15124
15144
  }
15125
15145
  }
15126
- var oldW = width,
15127
- oldH = height;
15128
15146
 
15129
- // Add slack to the values used to calculate bound position. This will ensure that if
15147
+ var oldW = width,
15148
+ oldH = height; // Add slack to the values used to calculate bound position. This will ensure that if
15130
15149
  // we start removing slack, the element won't react to it right away until it's been
15131
15150
  // completely removed.
15132
- var _ref = this.slack || [0, 0],
15133
- slackW = _ref[0],
15134
- slackH = _ref[1];
15151
+
15152
+ var _ref2 = this.slack || [0, 0],
15153
+ slackW = _ref2[0],
15154
+ slackH = _ref2[1];
15155
+
15135
15156
  width += slackW;
15136
15157
  height += slackH;
15137
- if (minConstraints) {
15138
- width = Math.max(minConstraints[0], width);
15139
- height = Math.max(minConstraints[1], height);
15140
- }
15141
- if (maxConstraints) {
15142
- width = Math.min(maxConstraints[0], width);
15143
- height = Math.min(maxConstraints[1], height);
15158
+
15159
+ if (min) {
15160
+ width = Math.max(min[0], width);
15161
+ height = Math.max(min[1], height);
15144
15162
  }
15145
15163
 
15146
- // If the width or height changed, we must have introduced some slack. Record it for the next iteration.
15164
+ if (max) {
15165
+ width = Math.min(max[0], width);
15166
+ height = Math.min(max[1], height);
15167
+ } // If the width or height changed, we must have introduced some slack. Record it for the next iteration.
15168
+
15169
+
15147
15170
  this.slack = [slackW + (oldW - width), slackH + (oldH - height)];
15148
15171
  return [width, height];
15149
15172
  }
15150
-
15151
15173
  /**
15152
15174
  * Wrapper around drag events to provide more useful data.
15153
15175
  *
15154
15176
  * @param {String} handlerName Handler name to wrap.
15155
15177
  * @return {Function} Handler function.
15156
- */;
15178
+ */
15179
+ ;
15180
+
15157
15181
  _proto.resizeHandler = function resizeHandler(handlerName, axis) {
15158
15182
  var _this2 = this;
15159
- return function (e, _ref2) {
15160
- var node = _ref2.node,
15161
- deltaX = _ref2.deltaX,
15162
- deltaY = _ref2.deltaY;
15183
+
15184
+ return function (e, _ref3) {
15185
+ var node = _ref3.node,
15186
+ deltaX = _ref3.deltaX,
15187
+ deltaY = _ref3.deltaY;
15163
15188
  // Reset data in case it was left over somehow (should not be possible)
15164
- if (handlerName === 'onResizeStart') _this2.resetData();
15189
+ if (handlerName === 'onResizeStart') _this2.resetData(); // Axis restrictions
15165
15190
 
15166
- // Axis restrictions
15167
15191
  var canDragX = (_this2.props.axis === 'both' || _this2.props.axis === 'x') && axis !== 'n' && axis !== 's';
15168
- var canDragY = (_this2.props.axis === 'both' || _this2.props.axis === 'y') && axis !== 'e' && axis !== 'w';
15169
- // No dragging possible.
15170
- if (!canDragX && !canDragY) return;
15192
+ var canDragY = (_this2.props.axis === 'both' || _this2.props.axis === 'y') && axis !== 'e' && axis !== 'w'; // No dragging possible.
15193
+
15194
+ if (!canDragX && !canDragY) return; // Decompose axis for later use
15171
15195
 
15172
- // Decompose axis for later use
15173
15196
  var axisV = axis[0];
15174
15197
  var axisH = axis[axis.length - 1]; // intentionally not axis[1], so that this catches axis === 'w' for example
15175
-
15176
15198
  // Track the element being dragged to account for changes in position.
15177
15199
  // If a handle's position is changed between callbacks, we need to factor this in to the next callback.
15178
15200
  // Failure to do so will cause the element to "skip" when resized upwards or leftwards.
15201
+
15179
15202
  var handleRect = node.getBoundingClientRect();
15203
+
15180
15204
  if (_this2.lastHandleRect != null) {
15181
15205
  // If the handle has repositioned on either axis since last render,
15182
15206
  // we need to increase our callback values by this much.
@@ -15185,34 +15209,34 @@ var Resizable = /*#__PURE__*/function (_React$Component) {
15185
15209
  var deltaLeftSinceLast = handleRect.left - _this2.lastHandleRect.left;
15186
15210
  deltaX += deltaLeftSinceLast;
15187
15211
  }
15212
+
15188
15213
  if (axisV === 'n') {
15189
15214
  var deltaTopSinceLast = handleRect.top - _this2.lastHandleRect.top;
15190
15215
  deltaY += deltaTopSinceLast;
15191
15216
  }
15192
- }
15193
- // Storage of last rect so we know how much it has really moved.
15194
- _this2.lastHandleRect = handleRect;
15217
+ } // Storage of last rect so we know how much it has really moved.
15218
+
15219
+
15220
+ _this2.lastHandleRect = handleRect; // Reverse delta if using top or left drag handles.
15195
15221
 
15196
- // Reverse delta if using top or left drag handles.
15197
15222
  if (axisH === 'w') deltaX = -deltaX;
15198
- if (axisV === 'n') deltaY = -deltaY;
15223
+ if (axisV === 'n') deltaY = -deltaY; // Update w/h by the deltas. Also factor in transformScale.
15199
15224
 
15200
- // Update w/h by the deltas. Also factor in transformScale.
15201
15225
  var width = _this2.props.width + (canDragX ? deltaX / _this2.props.transformScale : 0);
15202
- var height = _this2.props.height + (canDragY ? deltaY / _this2.props.transformScale : 0);
15226
+ var height = _this2.props.height + (canDragY ? deltaY / _this2.props.transformScale : 0); // Run user-provided constraints.
15203
15227
 
15204
- // Run user-provided constraints.
15205
15228
  var _this2$runConstraints = _this2.runConstraints(width, height);
15229
+
15206
15230
  width = _this2$runConstraints[0];
15207
15231
  height = _this2$runConstraints[1];
15208
- var dimensionsChanged = width !== _this2.props.width || height !== _this2.props.height;
15232
+ var dimensionsChanged = width !== _this2.props.width || height !== _this2.props.height; // Call user-supplied callback if present.
15233
+
15234
+ var cb = typeof _this2.props[handlerName] === 'function' ? _this2.props[handlerName] : null; // Don't call 'onResize' if dimensions haven't changed.
15209
15235
 
15210
- // Call user-supplied callback if present.
15211
- var cb = typeof _this2.props[handlerName] === 'function' ? _this2.props[handlerName] : null;
15212
- // Don't call 'onResize' if dimensions haven't changed.
15213
15236
  var shouldSkipCb = handlerName === 'onResize' && !dimensionsChanged;
15237
+
15214
15238
  if (cb && !shouldSkipCb) {
15215
- e.persist == null ? void 0 : e.persist();
15239
+ if (typeof e.persist === 'function') e.persist();
15216
15240
  cb(e, {
15217
15241
  node: node,
15218
15242
  size: {
@@ -15221,95 +15245,86 @@ var Resizable = /*#__PURE__*/function (_React$Component) {
15221
15245
  },
15222
15246
  handle: axis
15223
15247
  });
15224
- }
15248
+ } // Reset internal data
15249
+
15225
15250
 
15226
- // Reset internal data
15227
15251
  if (handlerName === 'onResizeStop') _this2.resetData();
15228
15252
  };
15229
- }
15253
+ };
15230
15254
 
15231
- // Render a resize handle given an axis & DOM ref. Ref *must* be attached for
15232
- // the underlying draggable library to work properly.
15233
- ;
15234
- _proto.renderResizeHandle = function renderResizeHandle(handleAxis, ref) {
15255
+ _proto.renderResizeHandle = function renderResizeHandle(resizeHandleAxis) {
15235
15256
  var handle = this.props.handle;
15236
- // No handle provided, make the default
15237
- if (!handle) {
15238
- return /*#__PURE__*/React.createElement("span", {
15239
- className: "react-resizable-handle react-resizable-handle-" + handleAxis,
15240
- ref: ref
15241
- });
15242
- }
15243
- // Handle is a function, such as:
15244
- // `handle={(handleAxis) => <span className={...} />}`
15245
- if (typeof handle === 'function') {
15246
- return handle(handleAxis, ref);
15257
+
15258
+ if (handle) {
15259
+ if (typeof handle === 'function') {
15260
+ return handle(resizeHandleAxis);
15261
+ }
15262
+
15263
+ return handle;
15247
15264
  }
15248
- // Handle is a React component (composite or DOM).
15249
- var isDOMElement = typeof handle.type === 'string';
15250
- var props = _objectSpread({
15251
- ref: ref
15252
- }, isDOMElement ? {} : {
15253
- handleAxis: handleAxis
15265
+
15266
+ return /*#__PURE__*/_react.default.createElement("span", {
15267
+ className: "react-resizable-handle react-resizable-handle-" + resizeHandleAxis
15254
15268
  });
15255
- return /*#__PURE__*/React.cloneElement(handle, props);
15256
15269
  };
15270
+
15257
15271
  _proto.render = function render() {
15258
15272
  var _this3 = this;
15273
+
15259
15274
  // Pass along only props not meant for the `<Resizable>`.`
15260
15275
  // eslint-disable-next-line no-unused-vars
15261
- var _this$props2 = this.props,
15262
- children = _this$props2.children,
15263
- className = _this$props2.className,
15264
- draggableOpts = _this$props2.draggableOpts,
15265
- width = _this$props2.width,
15266
- height = _this$props2.height,
15267
- handle = _this$props2.handle,
15268
- handleSize = _this$props2.handleSize,
15269
- lockAspectRatio = _this$props2.lockAspectRatio,
15270
- axis = _this$props2.axis,
15271
- minConstraints = _this$props2.minConstraints,
15272
- maxConstraints = _this$props2.maxConstraints,
15273
- onResize = _this$props2.onResize,
15274
- onResizeStop = _this$props2.onResizeStop,
15275
- onResizeStart = _this$props2.onResizeStart,
15276
- resizeHandles = _this$props2.resizeHandles,
15277
- transformScale = _this$props2.transformScale,
15278
- p = _objectWithoutPropertiesLoose(_this$props2, _excluded);
15279
-
15280
- // What we're doing here is getting the child of this element, and cloning it with this element's props.
15276
+ var _this$props = this.props,
15277
+ children = _this$props.children,
15278
+ className = _this$props.className,
15279
+ draggableOpts = _this$props.draggableOpts,
15280
+ width = _this$props.width,
15281
+ height = _this$props.height,
15282
+ handle = _this$props.handle,
15283
+ handleSize = _this$props.handleSize,
15284
+ lockAspectRatio = _this$props.lockAspectRatio,
15285
+ axis = _this$props.axis,
15286
+ minConstraints = _this$props.minConstraints,
15287
+ maxConstraints = _this$props.maxConstraints,
15288
+ onResize = _this$props.onResize,
15289
+ onResizeStop = _this$props.onResizeStop,
15290
+ onResizeStart = _this$props.onResizeStart,
15291
+ resizeHandles = _this$props.resizeHandles,
15292
+ transformScale = _this$props.transformScale,
15293
+ p = _objectWithoutPropertiesLoose(_this$props, ["children", "className", "draggableOpts", "width", "height", "handle", "handleSize", "lockAspectRatio", "axis", "minConstraints", "maxConstraints", "onResize", "onResizeStop", "onResizeStart", "resizeHandles", "transformScale"]); // What we're doing here is getting the child of this element, and cloning it with this element's props.
15281
15294
  // We are then defining its children as:
15282
- // 1. Its original children (resizable's child's children), and
15283
- // 2. One or more draggable handles.
15295
+ // Its original children (resizable's child's children), and
15296
+ // One or more draggable handles.
15297
+
15298
+
15284
15299
  return (0, _utils.cloneElement)(children, _objectSpread(_objectSpread({}, p), {}, {
15285
15300
  className: (className ? className + " " : '') + "react-resizable",
15286
15301
  children: [].concat(children.props.children, resizeHandles.map(function (handleAxis) {
15287
- var _this3$handleRefs$han;
15288
- // Create a ref to the handle so that `<DraggableCore>` doesn't have to use ReactDOM.findDOMNode().
15289
- var ref = (_this3$handleRefs$han = _this3.handleRefs[handleAxis]) != null ? _this3$handleRefs$han : _this3.handleRefs[handleAxis] = /*#__PURE__*/React.createRef();
15290
- return /*#__PURE__*/React.createElement(_reactDraggable.DraggableCore, _extends({}, draggableOpts, {
15291
- nodeRef: ref,
15302
+ return /*#__PURE__*/_react.default.createElement(_reactDraggable.DraggableCore, _extends({}, draggableOpts, {
15292
15303
  key: "resizableHandle-" + handleAxis,
15293
15304
  onStop: _this3.resizeHandler('onResizeStop', handleAxis),
15294
15305
  onStart: _this3.resizeHandler('onResizeStart', handleAxis),
15295
15306
  onDrag: _this3.resizeHandler('onResize', handleAxis)
15296
- }), _this3.renderResizeHandle(handleAxis, ref));
15307
+ }), _this3.renderResizeHandle(handleAxis));
15297
15308
  }))
15298
15309
  }));
15299
15310
  };
15311
+
15300
15312
  return Resizable;
15301
- }(React.Component);
15313
+ }(_react.default.Component);
15314
+
15302
15315
  exports["default"] = Resizable;
15303
- Resizable.propTypes = _propTypes.resizableProps;
15304
- Resizable.defaultProps = {
15305
- axis: 'both',
15316
+
15317
+ _defineProperty(Resizable, "propTypes", _propTypes.resizableProps);
15318
+
15319
+ _defineProperty(Resizable, "defaultProps", {
15306
15320
  handleSize: [20, 20],
15307
15321
  lockAspectRatio: false,
15322
+ axis: 'both',
15308
15323
  minConstraints: [20, 20],
15309
15324
  maxConstraints: [Infinity, Infinity],
15310
15325
  resizeHandles: ['se'],
15311
15326
  transformScale: 1
15312
- };
15327
+ });
15313
15328
 
15314
15329
  /***/ }),
15315
15330
 
@@ -15322,50 +15337,71 @@ var __webpack_unused_export__;
15322
15337
 
15323
15338
  __webpack_unused_export__ = true;
15324
15339
  exports["default"] = void 0;
15340
+
15325
15341
  var React = _interopRequireWildcard(__webpack_require__("neV8"));
15342
+
15326
15343
  var _propTypes = _interopRequireDefault(__webpack_require__("aWzz"));
15344
+
15327
15345
  var _Resizable = _interopRequireDefault(__webpack_require__("DIYL"));
15346
+
15328
15347
  var _propTypes2 = __webpack_require__("6rtJ");
15329
- var _excluded = ["handle", "handleSize", "onResize", "onResizeStart", "onResizeStop", "draggableOpts", "minConstraints", "maxConstraints", "lockAspectRatio", "axis", "width", "height", "resizeHandles", "style", "transformScale"];
15348
+
15330
15349
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15331
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15332
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15333
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
15334
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15335
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
15336
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15337
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
15338
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
15350
+
15351
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
15352
+
15353
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15354
+
15355
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
15356
+
15357
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
15358
+
15359
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
15360
+
15339
15361
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
15340
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
15341
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15362
+
15363
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
15364
+
15365
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
15366
+
15367
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15368
+
15342
15369
  var ResizableBox = /*#__PURE__*/function (_React$Component) {
15343
15370
  _inheritsLoose(ResizableBox, _React$Component);
15371
+
15344
15372
  function ResizableBox() {
15345
15373
  var _this;
15374
+
15346
15375
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15347
15376
  args[_key] = arguments[_key];
15348
15377
  }
15378
+
15349
15379
  _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
15350
- _this.state = {
15380
+
15381
+ _defineProperty(_assertThisInitialized(_this), "state", {
15351
15382
  width: _this.props.width,
15352
15383
  height: _this.props.height,
15353
15384
  propsWidth: _this.props.width,
15354
15385
  propsHeight: _this.props.height
15355
- };
15356
- _this.onResize = function (e, data) {
15386
+ });
15387
+
15388
+ _defineProperty(_assertThisInitialized(_this), "onResize", function (e, data) {
15357
15389
  var size = data.size;
15390
+
15358
15391
  if (_this.props.onResize) {
15359
- e.persist == null ? void 0 : e.persist();
15392
+ e.persist && e.persist();
15393
+
15360
15394
  _this.setState(size, function () {
15361
15395
  return _this.props.onResize && _this.props.onResize(e, data);
15362
15396
  });
15363
15397
  } else {
15364
15398
  _this.setState(size);
15365
15399
  }
15366
- };
15400
+ });
15401
+
15367
15402
  return _this;
15368
15403
  }
15404
+
15369
15405
  ResizableBox.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
15370
15406
  // If parent changes height/width, set that in our state.
15371
15407
  if (state.propsWidth !== props.width || state.propsHeight !== props.height) {
@@ -15376,30 +15412,34 @@ var ResizableBox = /*#__PURE__*/function (_React$Component) {
15376
15412
  propsHeight: props.height
15377
15413
  };
15378
15414
  }
15415
+
15379
15416
  return null;
15380
15417
  };
15418
+
15381
15419
  var _proto = ResizableBox.prototype;
15420
+
15382
15421
  _proto.render = function render() {
15383
15422
  // Basic wrapper around a Resizable instance.
15384
15423
  // If you use Resizable directly, you are responsible for updating the child component
15385
15424
  // with a new width and height.
15386
15425
  var _this$props = this.props,
15387
- handle = _this$props.handle,
15388
- handleSize = _this$props.handleSize,
15389
- onResize = _this$props.onResize,
15390
- onResizeStart = _this$props.onResizeStart,
15391
- onResizeStop = _this$props.onResizeStop,
15392
- draggableOpts = _this$props.draggableOpts,
15393
- minConstraints = _this$props.minConstraints,
15394
- maxConstraints = _this$props.maxConstraints,
15395
- lockAspectRatio = _this$props.lockAspectRatio,
15396
- axis = _this$props.axis,
15397
- width = _this$props.width,
15398
- height = _this$props.height,
15399
- resizeHandles = _this$props.resizeHandles,
15400
- style = _this$props.style,
15401
- transformScale = _this$props.transformScale,
15402
- props = _objectWithoutPropertiesLoose(_this$props, _excluded);
15426
+ handle = _this$props.handle,
15427
+ handleSize = _this$props.handleSize,
15428
+ onResize = _this$props.onResize,
15429
+ onResizeStart = _this$props.onResizeStart,
15430
+ onResizeStop = _this$props.onResizeStop,
15431
+ draggableOpts = _this$props.draggableOpts,
15432
+ minConstraints = _this$props.minConstraints,
15433
+ maxConstraints = _this$props.maxConstraints,
15434
+ lockAspectRatio = _this$props.lockAspectRatio,
15435
+ axis = _this$props.axis,
15436
+ width = _this$props.width,
15437
+ height = _this$props.height,
15438
+ resizeHandles = _this$props.resizeHandles,
15439
+ style = _this$props.style,
15440
+ transformScale = _this$props.transformScale,
15441
+ props = _objectWithoutPropertiesLoose(_this$props, ["handle", "handleSize", "onResize", "onResizeStart", "onResizeStop", "draggableOpts", "minConstraints", "maxConstraints", "lockAspectRatio", "axis", "width", "height", "resizeHandles", "style", "transformScale"]);
15442
+
15403
15443
  return /*#__PURE__*/React.createElement(_Resizable.default, {
15404
15444
  axis: axis,
15405
15445
  draggableOpts: draggableOpts,
@@ -15422,13 +15462,15 @@ var ResizableBox = /*#__PURE__*/function (_React$Component) {
15422
15462
  })
15423
15463
  })));
15424
15464
  };
15465
+
15425
15466
  return ResizableBox;
15426
15467
  }(React.Component);
15468
+
15427
15469
  exports["default"] = ResizableBox;
15428
- // PropTypes are identical to <Resizable>, except that children are not strictly required to be present.
15429
- ResizableBox.propTypes = _objectSpread(_objectSpread({}, _propTypes2.resizableProps), {}, {
15470
+
15471
+ _defineProperty(ResizableBox, "propTypes", _objectSpread(_objectSpread({}, _propTypes2.resizableProps), {}, {
15430
15472
  children: _propTypes.default.element
15431
- });
15473
+ }));
15432
15474
 
15433
15475
  /***/ }),
15434
15476
 
@@ -15440,9 +15482,13 @@ ResizableBox.propTypes = _objectSpread(_objectSpread({}, _propTypes2.resizablePr
15440
15482
 
15441
15483
  exports.__esModule = true;
15442
15484
  exports.resizableProps = void 0;
15485
+
15443
15486
  var _propTypes = _interopRequireDefault(__webpack_require__("aWzz"));
15487
+
15444
15488
  var _reactDraggable = __webpack_require__("j6Rw");
15489
+
15445
15490
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15491
+
15446
15492
  var resizableProps = {
15447
15493
  /*
15448
15494
  * Restricts resizing to a particular axis (default: 'both')
@@ -15453,10 +15499,12 @@ var resizableProps = {
15453
15499
  * */
15454
15500
  axis: _propTypes.default.oneOf(['both', 'x', 'y', 'none']),
15455
15501
  className: _propTypes.default.string,
15502
+
15456
15503
  /*
15457
15504
  * Require that one and only one child be present.
15458
15505
  * */
15459
15506
  children: _propTypes.default.element.isRequired,
15507
+
15460
15508
  /*
15461
15509
  * These will be passed wholesale to react-draggable's DraggableCore
15462
15510
  * */
@@ -15476,50 +15524,48 @@ var resizableProps = {
15476
15524
  onMouseDown: _propTypes.default.func,
15477
15525
  scale: _propTypes.default.number
15478
15526
  }),
15527
+
15479
15528
  /*
15480
15529
  * Initial height
15481
15530
  * */
15482
- height: function height() {
15483
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15484
- args[_key] = arguments[_key];
15485
- }
15486
- var props = args[0];
15487
- // Required if resizing height or both
15488
- if (props.axis === 'both' || props.axis === 'y') {
15489
- var _PropTypes$number;
15490
- return (_PropTypes$number = _propTypes.default.number).isRequired.apply(_PropTypes$number, args);
15491
- }
15492
- return _propTypes.default.number.apply(_propTypes.default, args);
15493
- },
15531
+ height: _propTypes.default.number.isRequired,
15532
+
15494
15533
  /*
15495
15534
  * Customize cursor resize handle
15496
15535
  * */
15497
15536
  handle: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
15537
+
15498
15538
  /*
15499
15539
  * If you change this, be sure to update your css
15500
15540
  * */
15501
15541
  handleSize: _propTypes.default.arrayOf(_propTypes.default.number),
15502
15542
  lockAspectRatio: _propTypes.default.bool,
15543
+
15503
15544
  /*
15504
15545
  * Max X & Y measure
15505
15546
  * */
15506
15547
  maxConstraints: _propTypes.default.arrayOf(_propTypes.default.number),
15548
+
15507
15549
  /*
15508
15550
  * Min X & Y measure
15509
15551
  * */
15510
15552
  minConstraints: _propTypes.default.arrayOf(_propTypes.default.number),
15553
+
15511
15554
  /*
15512
15555
  * Called on stop resize event
15513
15556
  * */
15514
15557
  onResizeStop: _propTypes.default.func,
15558
+
15515
15559
  /*
15516
15560
  * Called on start resize event
15517
15561
  * */
15518
15562
  onResizeStart: _propTypes.default.func,
15563
+
15519
15564
  /*
15520
15565
  * Called on resize event
15521
15566
  * */
15522
15567
  onResize: _propTypes.default.func,
15568
+
15523
15569
  /*
15524
15570
  * Defines which resize handles should be rendered (default: 'se')
15525
15571
  * 's' - South handle (bottom-center)
@@ -15532,25 +15578,16 @@ var resizableProps = {
15532
15578
  * 'ne' - Northeast handle (top-center)
15533
15579
  * */
15534
15580
  resizeHandles: _propTypes.default.arrayOf(_propTypes.default.oneOf(['s', 'w', 'e', 'n', 'sw', 'nw', 'se', 'ne'])),
15581
+
15535
15582
  /*
15536
15583
  * If `transform: scale(n)` is set on the parent, this should be set to `n`.
15537
15584
  * */
15538
15585
  transformScale: _propTypes.default.number,
15586
+
15539
15587
  /*
15540
15588
  * Initial width
15541
15589
  */
15542
- width: function width() {
15543
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
15544
- args[_key2] = arguments[_key2];
15545
- }
15546
- var props = args[0];
15547
- // Required if resizing width or both
15548
- if (props.axis === 'both' || props.axis === 'x') {
15549
- var _PropTypes$number2;
15550
- return (_PropTypes$number2 = _propTypes.default.number).isRequired.apply(_PropTypes$number2, args);
15551
- }
15552
- return _propTypes.default.number.apply(_propTypes.default, args);
15553
- }
15590
+ width: _propTypes.default.number.isRequired
15554
15591
  };
15555
15592
  exports.resizableProps = resizableProps;
15556
15593
 
@@ -15564,21 +15601,27 @@ exports.resizableProps = resizableProps;
15564
15601
 
15565
15602
  exports.__esModule = true;
15566
15603
  exports.cloneElement = cloneElement;
15604
+
15567
15605
  var _react = _interopRequireDefault(__webpack_require__("neV8"));
15606
+
15568
15607
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15569
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15570
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
15571
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15572
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
15573
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
15608
+
15609
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
15610
+
15611
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
15612
+
15613
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15614
+
15574
15615
  // React.addons.cloneWithProps look-alike that merges style & className.
15575
15616
  function cloneElement(element, props) {
15576
15617
  if (props.style && element.props.style) {
15577
15618
  props.style = _objectSpread(_objectSpread({}, element.props.style), props.style);
15578
15619
  }
15620
+
15579
15621
  if (props.className && element.props.className) {
15580
15622
  props.className = element.props.className + " " + props.className;
15581
15623
  }
15624
+
15582
15625
  return /*#__PURE__*/_react.default.cloneElement(element, props);
15583
15626
  }
15584
15627
 
@@ -18667,7 +18710,7 @@ class foundation_Tooltip extends foundation {
18667
18710
  return null;
18668
18711
  }
18669
18712
  calcPosStyle(props) {
18670
- var _a, _b;
18713
+ var _a, _b, _c;
18671
18714
  const {
18672
18715
  spacing,
18673
18716
  isOverFlow
@@ -18681,7 +18724,7 @@ class foundation_Tooltip extends foundation {
18681
18724
  // eslint-disable-next-line
18682
18725
  const position = props.position != null ? props.position : this.getProp('position');
18683
18726
  // eslint-disable-next-line
18684
- const SPACING = spacing != null ? spacing : this.getProp('spacing');
18727
+ let SPACING = spacing != null ? spacing : this.getProp('spacing');
18685
18728
  const {
18686
18729
  arrowPointAtCenter,
18687
18730
  showArrow,
@@ -18712,6 +18755,10 @@ class foundation_Tooltip extends foundation {
18712
18755
  const isTriggerNearLeft = middleX - containerRect.left < containerRect.right - middleX;
18713
18756
  const isTriggerNearTop = middleY - containerRect.top < containerRect.bottom - middleY;
18714
18757
  const isWrapperWidthOverflow = wrapperRect.width > innerWidth;
18758
+ const scaled = Math.abs((wrapperRect === null || wrapperRect === void 0 ? void 0 : wrapperRect.width) - ((_a = this._adapter.getContainer()) === null || _a === void 0 ? void 0 : _a.clientWidth)) > 1;
18759
+ if (scaled) {
18760
+ SPACING = SPACING * wrapperRect.width / this._adapter.getContainer().clientWidth;
18761
+ }
18715
18762
  switch (position) {
18716
18763
  case 'top':
18717
18764
  // left = middleX;
@@ -18828,10 +18875,10 @@ class foundation_Tooltip extends foundation {
18828
18875
  // Calculate container positioning relative to window
18829
18876
  left = left - containerRect.left;
18830
18877
  top = top - containerRect.top;
18831
- if (Math.abs((wrapperRect === null || wrapperRect === void 0 ? void 0 : wrapperRect.width) - ((_a = this._adapter.getContainer()) === null || _a === void 0 ? void 0 : _a.clientWidth)) > 1) {
18878
+ if (Math.abs((wrapperRect === null || wrapperRect === void 0 ? void 0 : wrapperRect.width) - ((_b = this._adapter.getContainer()) === null || _b === void 0 ? void 0 : _b.clientWidth)) > 1) {
18832
18879
  left /= wrapperRect.width / this._adapter.getContainer().clientWidth;
18833
18880
  }
18834
- if (Math.abs((wrapperRect === null || wrapperRect === void 0 ? void 0 : wrapperRect.height) - ((_b = this._adapter.getContainer()) === null || _b === void 0 ? void 0 : _b.clientHeight)) > 1) {
18881
+ if (Math.abs((wrapperRect === null || wrapperRect === void 0 ? void 0 : wrapperRect.height) - ((_c = this._adapter.getContainer()) === null || _c === void 0 ? void 0 : _c.clientHeight)) > 1) {
18835
18882
  top /= wrapperRect.height / this._adapter.getContainer().clientHeight;
18836
18883
  }
18837
18884
  /**
@@ -59434,7 +59481,7 @@ class TextAreaFoundation extends foundation {
59434
59481
  }
59435
59482
  constructor(adapter) {
59436
59483
  super(Object.assign(Object.assign({}, TextAreaFoundation.textAreaDefaultAdapter), adapter));
59437
- this.resizeTextarea = cb => {
59484
+ this.resizeTextarea = () => {
59438
59485
  const {
59439
59486
  height
59440
59487
  } = this.getStates();
@@ -59444,7 +59491,6 @@ class TextAreaFoundation extends foundation {
59444
59491
  const node = this._adapter.getRef();
59445
59492
  const nodeSizingData = util_getSizingData(node);
59446
59493
  if (!nodeSizingData) {
59447
- cb && cb();
59448
59494
  return;
59449
59495
  }
59450
59496
  const newHeight = calculateNodeHeight(nodeSizingData, node.value || node.placeholder || 'x', rows
@@ -59456,7 +59502,6 @@ class TextAreaFoundation extends foundation {
59456
59502
  node.style.height = `${newHeight}px`;
59457
59503
  return;
59458
59504
  }
59459
- cb && cb();
59460
59505
  };
59461
59506
  }
59462
59507
  init() {
@@ -59639,6 +59684,7 @@ var input_textarea = __webpack_require__("d+AG");
59639
59684
 
59640
59685
 
59641
59686
 
59687
+
59642
59688
  var textarea_rest = undefined && undefined.__rest || function (s, e) {
59643
59689
  var t = {};
59644
59690
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
@@ -59656,6 +59702,7 @@ var textarea_rest = undefined && undefined.__rest || function (s, e) {
59656
59702
 
59657
59703
 
59658
59704
 
59705
+
59659
59706
  const textarea_prefixCls = input_constants_cssClasses.PREFIX;
59660
59707
  class TextArea extends BaseComponent {
59661
59708
  constructor(props) {
@@ -59684,7 +59731,7 @@ class TextArea extends BaseComponent {
59684
59731
  this.focusing = false;
59685
59732
  this.foundation = new TextAreaFoundation(this.adapter);
59686
59733
  this.libRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
59687
- this._resizeLock = false;
59734
+ this.throttledResizeTextarea = throttle_default()(this.foundation.resizeTextarea, 10);
59688
59735
  }
59689
59736
  get adapter() {
59690
59737
  return Object.assign(Object.assign({}, super.adapter), {
@@ -59735,32 +59782,15 @@ class TextArea extends BaseComponent {
59735
59782
  }
59736
59783
  return willUpdateStates;
59737
59784
  }
59738
- componentDidMount() {
59739
- this.foundation.init();
59740
- this._resizeListener = null;
59741
- if (this.props.autosize) {
59742
- // Working around Firefox bug which runs resize listeners even when other JS is running at the same moment
59743
- // causing competing rerenders (due to setState in the listener) in React.
59744
- // More can be found here - facebook/react#6324
59745
- // // Reference to https://github.com/andreypopp/react-textarea-autosize/
59746
- this._resizeListener = () => {
59747
- if (this._resizeLock) {
59748
- return;
59749
- }
59750
- this._resizeLock = true;
59751
- this.foundation.resizeTextarea(() => {
59752
- this._resizeLock = false;
59753
- });
59754
- };
59755
- window.addEventListener('resize', this._resizeListener);
59756
- }
59757
- }
59758
59785
  componentWillUnmount() {
59759
- this.foundation.destroy();
59760
- this._resizeListener && window.removeEventListener('resize', this._resizeListener);
59786
+ var _a, _b;
59787
+ if (this.throttledResizeTextarea) {
59788
+ (_b = (_a = this.throttledResizeTextarea) === null || _a === void 0 ? void 0 : _a.cancel) === null || _b === void 0 ? void 0 : _b.call(_a);
59789
+ this.throttledResizeTextarea = null;
59790
+ }
59761
59791
  }
59762
59792
  componentDidUpdate(prevProps, prevState) {
59763
- if (this.props.value !== prevProps.value && this.props.autosize) {
59793
+ if ((this.props.value !== prevProps.value || this.props.placeholder !== prevProps.placeholder) && this.props.autosize) {
59764
59794
  this.foundation.resizeTextarea();
59765
59795
  }
59766
59796
  }
@@ -59875,8 +59905,12 @@ class TextArea extends BaseComponent {
59875
59905
  style: style,
59876
59906
  onMouseEnter: e => this.foundation.handleMouseEnter(e),
59877
59907
  onMouseLeave: e => this.foundation.handleMouseLeave(e)
59908
+ }, autosize ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(ReactResizeObserver, {
59909
+ onResize: this.throttledResizeTextarea
59878
59910
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("textarea", Object.assign({}, itemProps, {
59879
59911
  ref: this.setRef
59912
+ }))) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("textarea", Object.assign({}, itemProps, {
59913
+ ref: this.setRef
59880
59914
  })), this.renderClearBtn(), this.renderCounter());
59881
59915
  }
59882
59916
  }