@douyinfe/semi-ui 2.41.2 → 2.41.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.
@@ -15005,149 +15005,125 @@ function dontSetMe(props
15005
15005
 
15006
15006
  exports.__esModule = true;
15007
15007
  exports["default"] = void 0;
15008
-
15009
- var _react = _interopRequireDefault(__webpack_require__("neV8"));
15010
-
15008
+ var React = _interopRequireWildcard(__webpack_require__("neV8"));
15011
15009
  var _reactDraggable = __webpack_require__("j6Rw");
15012
-
15013
15010
  var _utils = __webpack_require__("+cYm");
15014
-
15015
15011
  var _propTypes = __webpack_require__("6rtJ");
15016
-
15017
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15018
-
15019
- 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); }
15020
-
15021
- 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; }
15022
-
15023
- 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; }
15024
-
15012
+ var _excluded = ["children", "className", "draggableOpts", "width", "height", "handle", "handleSize", "lockAspectRatio", "axis", "minConstraints", "maxConstraints", "onResize", "onResizeStop", "onResizeStart", "resizeHandles", "transformScale"];
15013
+ 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); }
15014
+ 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; }
15015
+ 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); }
15025
15016
  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; }
15026
-
15027
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
15028
-
15029
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
15030
-
15031
- 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; }
15032
-
15017
+ 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; }
15018
+ 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; }
15019
+ 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; }
15020
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
15021
+ 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); }
15022
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
15023
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15024
+ // The base <Resizable> component.
15025
+ // This component does not have state and relies on the parent to set its props based on callback data.
15033
15026
  var Resizable = /*#__PURE__*/function (_React$Component) {
15034
15027
  _inheritsLoose(Resizable, _React$Component);
15035
-
15036
15028
  function Resizable() {
15037
15029
  var _this;
15038
-
15039
15030
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15040
15031
  args[_key] = arguments[_key];
15041
15032
  }
15042
-
15043
15033
  _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
15044
-
15045
- _defineProperty(_assertThisInitialized(_this), "state", undefined);
15046
-
15047
- _defineProperty(_assertThisInitialized(_this), "lastHandleRect", null);
15048
-
15049
- _defineProperty(_assertThisInitialized(_this), "slack", null);
15050
-
15034
+ _this.handleRefs = {};
15035
+ _this.lastHandleRect = null;
15036
+ _this.slack = null;
15051
15037
  return _this;
15052
15038
  }
15053
-
15054
15039
  var _proto = Resizable.prototype;
15055
-
15056
15040
  _proto.componentWillUnmount = function componentWillUnmount() {
15057
15041
  this.resetData();
15058
15042
  };
15059
-
15060
- _proto.lockAspectRatio = function lockAspectRatio(width, height, aspectRatio) {
15061
- height = width / aspectRatio;
15062
- width = height * aspectRatio;
15063
- return [width, height];
15064
- };
15065
-
15066
15043
  _proto.resetData = function resetData() {
15067
15044
  this.lastHandleRect = this.slack = null;
15068
- } // Clamp width and height within provided constraints
15069
- ;
15045
+ }
15070
15046
 
15047
+ // Clamp width and height within provided constraints
15048
+ ;
15071
15049
  _proto.runConstraints = function runConstraints(width, height) {
15072
- var _ref = [this.props.minConstraints, this.props.maxConstraints],
15073
- min = _ref[0],
15074
- max = _ref[1];
15075
- if (!min && !max) return [width, height]; // If constraining to min and max, we need to also fit width and height to aspect ratio.
15076
-
15077
- if (this.props.lockAspectRatio) {
15078
- var resizingHorizontally = height === this.props.height;
15079
-
15080
- if (resizingHorizontally) {
15081
- var ratio = this.props.width / this.props.height;
15050
+ var _this$props = this.props,
15051
+ minConstraints = _this$props.minConstraints,
15052
+ maxConstraints = _this$props.maxConstraints,
15053
+ lockAspectRatio = _this$props.lockAspectRatio;
15054
+ // short circuit
15055
+ if (!minConstraints && !maxConstraints && !lockAspectRatio) return [width, height];
15056
+
15057
+ // If constraining to min and max, we need to also fit width and height to aspect ratio.
15058
+ if (lockAspectRatio) {
15059
+ var ratio = this.props.width / this.props.height;
15060
+ var deltaW = width - this.props.width;
15061
+ var deltaH = height - this.props.height;
15062
+
15063
+ // Find which coordinate was greater and should push the other toward it.
15064
+ // E.g.:
15065
+ // ratio = 1, deltaW = 10, deltaH = 5, deltaH should become 10.
15066
+ // ratio = 2, deltaW = 10, deltaH = 6, deltaW should become 12.
15067
+ if (Math.abs(deltaW) > Math.abs(deltaH * ratio)) {
15082
15068
  height = width / ratio;
15083
- width = height * ratio;
15084
15069
  } else {
15085
- // Take into account vertical resize with N/S handles on locked aspect
15086
- // ratio. Calculate the change height-first, instead of width-first
15087
- var _ratio = this.props.height / this.props.width;
15088
-
15089
- width = height / _ratio;
15090
- height = width * _ratio;
15070
+ width = height * ratio;
15091
15071
  }
15092
15072
  }
15093
-
15094
15073
  var oldW = width,
15095
- oldH = height; // Add slack to the values used to calculate bound position. This will ensure that if
15074
+ oldH = height;
15075
+
15076
+ // Add slack to the values used to calculate bound position. This will ensure that if
15096
15077
  // we start removing slack, the element won't react to it right away until it's been
15097
15078
  // completely removed.
15098
-
15099
- var _ref2 = this.slack || [0, 0],
15100
- slackW = _ref2[0],
15101
- slackH = _ref2[1];
15102
-
15079
+ var _ref = this.slack || [0, 0],
15080
+ slackW = _ref[0],
15081
+ slackH = _ref[1];
15103
15082
  width += slackW;
15104
15083
  height += slackH;
15105
-
15106
- if (min) {
15107
- width = Math.max(min[0], width);
15108
- height = Math.max(min[1], height);
15084
+ if (minConstraints) {
15085
+ width = Math.max(minConstraints[0], width);
15086
+ height = Math.max(minConstraints[1], height);
15087
+ }
15088
+ if (maxConstraints) {
15089
+ width = Math.min(maxConstraints[0], width);
15090
+ height = Math.min(maxConstraints[1], height);
15109
15091
  }
15110
15092
 
15111
- if (max) {
15112
- width = Math.min(max[0], width);
15113
- height = Math.min(max[1], height);
15114
- } // If the width or height changed, we must have introduced some slack. Record it for the next iteration.
15115
-
15116
-
15093
+ // If the width or height changed, we must have introduced some slack. Record it for the next iteration.
15117
15094
  this.slack = [slackW + (oldW - width), slackH + (oldH - height)];
15118
15095
  return [width, height];
15119
15096
  }
15097
+
15120
15098
  /**
15121
15099
  * Wrapper around drag events to provide more useful data.
15122
15100
  *
15123
15101
  * @param {String} handlerName Handler name to wrap.
15124
15102
  * @return {Function} Handler function.
15125
- */
15126
- ;
15127
-
15103
+ */;
15128
15104
  _proto.resizeHandler = function resizeHandler(handlerName, axis) {
15129
15105
  var _this2 = this;
15130
-
15131
- return function (e, _ref3) {
15132
- var node = _ref3.node,
15133
- deltaX = _ref3.deltaX,
15134
- deltaY = _ref3.deltaY;
15106
+ return function (e, _ref2) {
15107
+ var node = _ref2.node,
15108
+ deltaX = _ref2.deltaX,
15109
+ deltaY = _ref2.deltaY;
15135
15110
  // Reset data in case it was left over somehow (should not be possible)
15136
- if (handlerName === 'onResizeStart') _this2.resetData(); // Axis restrictions
15111
+ if (handlerName === 'onResizeStart') _this2.resetData();
15137
15112
 
15113
+ // Axis restrictions
15138
15114
  var canDragX = (_this2.props.axis === 'both' || _this2.props.axis === 'x') && axis !== 'n' && axis !== 's';
15139
- var canDragY = (_this2.props.axis === 'both' || _this2.props.axis === 'y') && axis !== 'e' && axis !== 'w'; // No dragging possible.
15140
-
15141
- if (!canDragX && !canDragY) return; // Decompose axis for later use
15115
+ var canDragY = (_this2.props.axis === 'both' || _this2.props.axis === 'y') && axis !== 'e' && axis !== 'w';
15116
+ // No dragging possible.
15117
+ if (!canDragX && !canDragY) return;
15142
15118
 
15119
+ // Decompose axis for later use
15143
15120
  var axisV = axis[0];
15144
15121
  var axisH = axis[axis.length - 1]; // intentionally not axis[1], so that this catches axis === 'w' for example
15122
+
15145
15123
  // Track the element being dragged to account for changes in position.
15146
15124
  // If a handle's position is changed between callbacks, we need to factor this in to the next callback.
15147
15125
  // Failure to do so will cause the element to "skip" when resized upwards or leftwards.
15148
-
15149
15126
  var handleRect = node.getBoundingClientRect();
15150
-
15151
15127
  if (_this2.lastHandleRect != null) {
15152
15128
  // If the handle has repositioned on either axis since last render,
15153
15129
  // we need to increase our callback values by this much.
@@ -15156,34 +15132,34 @@ var Resizable = /*#__PURE__*/function (_React$Component) {
15156
15132
  var deltaLeftSinceLast = handleRect.left - _this2.lastHandleRect.left;
15157
15133
  deltaX += deltaLeftSinceLast;
15158
15134
  }
15159
-
15160
15135
  if (axisV === 'n') {
15161
15136
  var deltaTopSinceLast = handleRect.top - _this2.lastHandleRect.top;
15162
15137
  deltaY += deltaTopSinceLast;
15163
15138
  }
15164
- } // Storage of last rect so we know how much it has really moved.
15165
-
15166
-
15167
- _this2.lastHandleRect = handleRect; // Reverse delta if using top or left drag handles.
15139
+ }
15140
+ // Storage of last rect so we know how much it has really moved.
15141
+ _this2.lastHandleRect = handleRect;
15168
15142
 
15143
+ // Reverse delta if using top or left drag handles.
15169
15144
  if (axisH === 'w') deltaX = -deltaX;
15170
- if (axisV === 'n') deltaY = -deltaY; // Update w/h by the deltas. Also factor in transformScale.
15145
+ if (axisV === 'n') deltaY = -deltaY;
15171
15146
 
15147
+ // Update w/h by the deltas. Also factor in transformScale.
15172
15148
  var width = _this2.props.width + (canDragX ? deltaX / _this2.props.transformScale : 0);
15173
- var height = _this2.props.height + (canDragY ? deltaY / _this2.props.transformScale : 0); // Run user-provided constraints.
15149
+ var height = _this2.props.height + (canDragY ? deltaY / _this2.props.transformScale : 0);
15174
15150
 
15151
+ // Run user-provided constraints.
15175
15152
  var _this2$runConstraints = _this2.runConstraints(width, height);
15176
-
15177
15153
  width = _this2$runConstraints[0];
15178
15154
  height = _this2$runConstraints[1];
15179
- var dimensionsChanged = width !== _this2.props.width || height !== _this2.props.height; // Call user-supplied callback if present.
15180
-
15181
- var cb = typeof _this2.props[handlerName] === 'function' ? _this2.props[handlerName] : null; // Don't call 'onResize' if dimensions haven't changed.
15155
+ var dimensionsChanged = width !== _this2.props.width || height !== _this2.props.height;
15182
15156
 
15157
+ // Call user-supplied callback if present.
15158
+ var cb = typeof _this2.props[handlerName] === 'function' ? _this2.props[handlerName] : null;
15159
+ // Don't call 'onResize' if dimensions haven't changed.
15183
15160
  var shouldSkipCb = handlerName === 'onResize' && !dimensionsChanged;
15184
-
15185
15161
  if (cb && !shouldSkipCb) {
15186
- if (typeof e.persist === 'function') e.persist();
15162
+ e.persist == null ? void 0 : e.persist();
15187
15163
  cb(e, {
15188
15164
  node: node,
15189
15165
  size: {
@@ -15192,86 +15168,95 @@ var Resizable = /*#__PURE__*/function (_React$Component) {
15192
15168
  },
15193
15169
  handle: axis
15194
15170
  });
15195
- } // Reset internal data
15196
-
15171
+ }
15197
15172
 
15173
+ // Reset internal data
15198
15174
  if (handlerName === 'onResizeStop') _this2.resetData();
15199
15175
  };
15200
- };
15176
+ }
15201
15177
 
15202
- _proto.renderResizeHandle = function renderResizeHandle(resizeHandleAxis) {
15178
+ // Render a resize handle given an axis & DOM ref. Ref *must* be attached for
15179
+ // the underlying draggable library to work properly.
15180
+ ;
15181
+ _proto.renderResizeHandle = function renderResizeHandle(handleAxis, ref) {
15203
15182
  var handle = this.props.handle;
15204
-
15205
- if (handle) {
15206
- if (typeof handle === 'function') {
15207
- return handle(resizeHandleAxis);
15208
- }
15209
-
15210
- return handle;
15183
+ // No handle provided, make the default
15184
+ if (!handle) {
15185
+ return /*#__PURE__*/React.createElement("span", {
15186
+ className: "react-resizable-handle react-resizable-handle-" + handleAxis,
15187
+ ref: ref
15188
+ });
15211
15189
  }
15212
-
15213
- return /*#__PURE__*/_react.default.createElement("span", {
15214
- className: "react-resizable-handle react-resizable-handle-" + resizeHandleAxis
15190
+ // Handle is a function, such as:
15191
+ // `handle={(handleAxis) => <span className={...} />}`
15192
+ if (typeof handle === 'function') {
15193
+ return handle(handleAxis, ref);
15194
+ }
15195
+ // Handle is a React component (composite or DOM).
15196
+ var isDOMElement = typeof handle.type === 'string';
15197
+ var props = _objectSpread({
15198
+ ref: ref
15199
+ }, isDOMElement ? {} : {
15200
+ handleAxis: handleAxis
15215
15201
  });
15202
+ return /*#__PURE__*/React.cloneElement(handle, props);
15216
15203
  };
15217
-
15218
15204
  _proto.render = function render() {
15219
15205
  var _this3 = this;
15220
-
15221
15206
  // Pass along only props not meant for the `<Resizable>`.`
15222
15207
  // eslint-disable-next-line no-unused-vars
15223
- var _this$props = this.props,
15224
- children = _this$props.children,
15225
- className = _this$props.className,
15226
- draggableOpts = _this$props.draggableOpts,
15227
- width = _this$props.width,
15228
- height = _this$props.height,
15229
- handle = _this$props.handle,
15230
- handleSize = _this$props.handleSize,
15231
- lockAspectRatio = _this$props.lockAspectRatio,
15232
- axis = _this$props.axis,
15233
- minConstraints = _this$props.minConstraints,
15234
- maxConstraints = _this$props.maxConstraints,
15235
- onResize = _this$props.onResize,
15236
- onResizeStop = _this$props.onResizeStop,
15237
- onResizeStart = _this$props.onResizeStart,
15238
- resizeHandles = _this$props.resizeHandles,
15239
- transformScale = _this$props.transformScale,
15240
- 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.
15208
+ var _this$props2 = this.props,
15209
+ children = _this$props2.children,
15210
+ className = _this$props2.className,
15211
+ draggableOpts = _this$props2.draggableOpts,
15212
+ width = _this$props2.width,
15213
+ height = _this$props2.height,
15214
+ handle = _this$props2.handle,
15215
+ handleSize = _this$props2.handleSize,
15216
+ lockAspectRatio = _this$props2.lockAspectRatio,
15217
+ axis = _this$props2.axis,
15218
+ minConstraints = _this$props2.minConstraints,
15219
+ maxConstraints = _this$props2.maxConstraints,
15220
+ onResize = _this$props2.onResize,
15221
+ onResizeStop = _this$props2.onResizeStop,
15222
+ onResizeStart = _this$props2.onResizeStart,
15223
+ resizeHandles = _this$props2.resizeHandles,
15224
+ transformScale = _this$props2.transformScale,
15225
+ p = _objectWithoutPropertiesLoose(_this$props2, _excluded);
15226
+
15227
+ // What we're doing here is getting the child of this element, and cloning it with this element's props.
15241
15228
  // We are then defining its children as:
15242
- // Its original children (resizable's child's children), and
15243
- // One or more draggable handles.
15244
-
15245
-
15229
+ // 1. Its original children (resizable's child's children), and
15230
+ // 2. One or more draggable handles.
15246
15231
  return (0, _utils.cloneElement)(children, _objectSpread(_objectSpread({}, p), {}, {
15247
15232
  className: (className ? className + " " : '') + "react-resizable",
15248
15233
  children: [].concat(children.props.children, resizeHandles.map(function (handleAxis) {
15249
- return /*#__PURE__*/_react.default.createElement(_reactDraggable.DraggableCore, _extends({}, draggableOpts, {
15234
+ var _this3$handleRefs$han;
15235
+ // Create a ref to the handle so that `<DraggableCore>` doesn't have to use ReactDOM.findDOMNode().
15236
+ var ref = (_this3$handleRefs$han = _this3.handleRefs[handleAxis]) != null ? _this3$handleRefs$han : _this3.handleRefs[handleAxis] = /*#__PURE__*/React.createRef();
15237
+ return /*#__PURE__*/React.createElement(_reactDraggable.DraggableCore, _extends({}, draggableOpts, {
15238
+ nodeRef: ref,
15250
15239
  key: "resizableHandle-" + handleAxis,
15251
15240
  onStop: _this3.resizeHandler('onResizeStop', handleAxis),
15252
15241
  onStart: _this3.resizeHandler('onResizeStart', handleAxis),
15253
15242
  onDrag: _this3.resizeHandler('onResize', handleAxis)
15254
- }), _this3.renderResizeHandle(handleAxis));
15243
+ }), _this3.renderResizeHandle(handleAxis, ref));
15255
15244
  }))
15256
15245
  }));
15257
15246
  };
15258
-
15259
15247
  return Resizable;
15260
- }(_react.default.Component);
15261
-
15248
+ }(React.Component);
15262
15249
  exports["default"] = Resizable;
15263
-
15264
- _defineProperty(Resizable, "propTypes", _propTypes.resizableProps);
15265
-
15266
- _defineProperty(Resizable, "defaultProps", {
15250
+ Resizable.propTypes = _propTypes.resizableProps;
15251
+ Resizable.defaultProps = {
15252
+ axis: 'both',
15267
15253
  handleSize: [20, 20],
15268
15254
  lockAspectRatio: false,
15269
- axis: 'both',
15270
15255
  minConstraints: [20, 20],
15271
15256
  maxConstraints: [Infinity, Infinity],
15272
15257
  resizeHandles: ['se'],
15273
15258
  transformScale: 1
15274
- });
15259
+ };
15275
15260
 
15276
15261
  /***/ }),
15277
15262
 
@@ -15284,71 +15269,50 @@ var __webpack_unused_export__;
15284
15269
 
15285
15270
  __webpack_unused_export__ = true;
15286
15271
  exports["default"] = void 0;
15287
-
15288
15272
  var React = _interopRequireWildcard(__webpack_require__("neV8"));
15289
-
15290
15273
  var _propTypes = _interopRequireDefault(__webpack_require__("aWzz"));
15291
-
15292
15274
  var _Resizable = _interopRequireDefault(__webpack_require__("DIYL"));
15293
-
15294
15275
  var _propTypes2 = __webpack_require__("6rtJ");
15295
-
15276
+ var _excluded = ["handle", "handleSize", "onResize", "onResizeStart", "onResizeStop", "draggableOpts", "minConstraints", "maxConstraints", "lockAspectRatio", "axis", "width", "height", "resizeHandles", "style", "transformScale"];
15296
15277
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15297
-
15298
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
15299
-
15300
- 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; }
15301
-
15302
- 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); }
15303
-
15304
- 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; }
15305
-
15306
- 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; }
15307
-
15278
+ 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); }
15279
+ 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; }
15280
+ 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); }
15281
+ 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; }
15282
+ 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; }
15283
+ 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; }
15284
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
15285
+ 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); }
15308
15286
  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; }
15309
-
15310
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
15311
-
15312
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
15313
-
15314
- 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; }
15315
-
15287
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
15288
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15316
15289
  var ResizableBox = /*#__PURE__*/function (_React$Component) {
15317
15290
  _inheritsLoose(ResizableBox, _React$Component);
15318
-
15319
15291
  function ResizableBox() {
15320
15292
  var _this;
15321
-
15322
15293
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15323
15294
  args[_key] = arguments[_key];
15324
15295
  }
15325
-
15326
15296
  _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
15327
-
15328
- _defineProperty(_assertThisInitialized(_this), "state", {
15297
+ _this.state = {
15329
15298
  width: _this.props.width,
15330
15299
  height: _this.props.height,
15331
15300
  propsWidth: _this.props.width,
15332
15301
  propsHeight: _this.props.height
15333
- });
15334
-
15335
- _defineProperty(_assertThisInitialized(_this), "onResize", function (e, data) {
15302
+ };
15303
+ _this.onResize = function (e, data) {
15336
15304
  var size = data.size;
15337
-
15338
15305
  if (_this.props.onResize) {
15339
- e.persist && e.persist();
15340
-
15306
+ e.persist == null ? void 0 : e.persist();
15341
15307
  _this.setState(size, function () {
15342
15308
  return _this.props.onResize && _this.props.onResize(e, data);
15343
15309
  });
15344
15310
  } else {
15345
15311
  _this.setState(size);
15346
15312
  }
15347
- });
15348
-
15313
+ };
15349
15314
  return _this;
15350
15315
  }
15351
-
15352
15316
  ResizableBox.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
15353
15317
  // If parent changes height/width, set that in our state.
15354
15318
  if (state.propsWidth !== props.width || state.propsHeight !== props.height) {
@@ -15359,34 +15323,30 @@ var ResizableBox = /*#__PURE__*/function (_React$Component) {
15359
15323
  propsHeight: props.height
15360
15324
  };
15361
15325
  }
15362
-
15363
15326
  return null;
15364
15327
  };
15365
-
15366
15328
  var _proto = ResizableBox.prototype;
15367
-
15368
15329
  _proto.render = function render() {
15369
15330
  // Basic wrapper around a Resizable instance.
15370
15331
  // If you use Resizable directly, you are responsible for updating the child component
15371
15332
  // with a new width and height.
15372
15333
  var _this$props = this.props,
15373
- handle = _this$props.handle,
15374
- handleSize = _this$props.handleSize,
15375
- onResize = _this$props.onResize,
15376
- onResizeStart = _this$props.onResizeStart,
15377
- onResizeStop = _this$props.onResizeStop,
15378
- draggableOpts = _this$props.draggableOpts,
15379
- minConstraints = _this$props.minConstraints,
15380
- maxConstraints = _this$props.maxConstraints,
15381
- lockAspectRatio = _this$props.lockAspectRatio,
15382
- axis = _this$props.axis,
15383
- width = _this$props.width,
15384
- height = _this$props.height,
15385
- resizeHandles = _this$props.resizeHandles,
15386
- style = _this$props.style,
15387
- transformScale = _this$props.transformScale,
15388
- props = _objectWithoutPropertiesLoose(_this$props, ["handle", "handleSize", "onResize", "onResizeStart", "onResizeStop", "draggableOpts", "minConstraints", "maxConstraints", "lockAspectRatio", "axis", "width", "height", "resizeHandles", "style", "transformScale"]);
15389
-
15334
+ handle = _this$props.handle,
15335
+ handleSize = _this$props.handleSize,
15336
+ onResize = _this$props.onResize,
15337
+ onResizeStart = _this$props.onResizeStart,
15338
+ onResizeStop = _this$props.onResizeStop,
15339
+ draggableOpts = _this$props.draggableOpts,
15340
+ minConstraints = _this$props.minConstraints,
15341
+ maxConstraints = _this$props.maxConstraints,
15342
+ lockAspectRatio = _this$props.lockAspectRatio,
15343
+ axis = _this$props.axis,
15344
+ width = _this$props.width,
15345
+ height = _this$props.height,
15346
+ resizeHandles = _this$props.resizeHandles,
15347
+ style = _this$props.style,
15348
+ transformScale = _this$props.transformScale,
15349
+ props = _objectWithoutPropertiesLoose(_this$props, _excluded);
15390
15350
  return /*#__PURE__*/React.createElement(_Resizable.default, {
15391
15351
  axis: axis,
15392
15352
  draggableOpts: draggableOpts,
@@ -15409,15 +15369,13 @@ var ResizableBox = /*#__PURE__*/function (_React$Component) {
15409
15369
  })
15410
15370
  })));
15411
15371
  };
15412
-
15413
15372
  return ResizableBox;
15414
15373
  }(React.Component);
15415
-
15416
15374
  exports["default"] = ResizableBox;
15417
-
15418
- _defineProperty(ResizableBox, "propTypes", _objectSpread(_objectSpread({}, _propTypes2.resizableProps), {}, {
15375
+ // PropTypes are identical to <Resizable>, except that children are not strictly required to be present.
15376
+ ResizableBox.propTypes = _objectSpread(_objectSpread({}, _propTypes2.resizableProps), {}, {
15419
15377
  children: _propTypes.default.element
15420
- }));
15378
+ });
15421
15379
 
15422
15380
  /***/ }),
15423
15381
 
@@ -15429,13 +15387,9 @@ _defineProperty(ResizableBox, "propTypes", _objectSpread(_objectSpread({}, _prop
15429
15387
 
15430
15388
  exports.__esModule = true;
15431
15389
  exports.resizableProps = void 0;
15432
-
15433
15390
  var _propTypes = _interopRequireDefault(__webpack_require__("aWzz"));
15434
-
15435
15391
  var _reactDraggable = __webpack_require__("j6Rw");
15436
-
15437
15392
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15438
-
15439
15393
  var resizableProps = {
15440
15394
  /*
15441
15395
  * Restricts resizing to a particular axis (default: 'both')
@@ -15446,12 +15400,10 @@ var resizableProps = {
15446
15400
  * */
15447
15401
  axis: _propTypes.default.oneOf(['both', 'x', 'y', 'none']),
15448
15402
  className: _propTypes.default.string,
15449
-
15450
15403
  /*
15451
15404
  * Require that one and only one child be present.
15452
15405
  * */
15453
15406
  children: _propTypes.default.element.isRequired,
15454
-
15455
15407
  /*
15456
15408
  * These will be passed wholesale to react-draggable's DraggableCore
15457
15409
  * */
@@ -15471,48 +15423,50 @@ var resizableProps = {
15471
15423
  onMouseDown: _propTypes.default.func,
15472
15424
  scale: _propTypes.default.number
15473
15425
  }),
15474
-
15475
15426
  /*
15476
15427
  * Initial height
15477
15428
  * */
15478
- height: _propTypes.default.number.isRequired,
15479
-
15429
+ height: function height() {
15430
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15431
+ args[_key] = arguments[_key];
15432
+ }
15433
+ var props = args[0];
15434
+ // Required if resizing height or both
15435
+ if (props.axis === 'both' || props.axis === 'y') {
15436
+ var _PropTypes$number;
15437
+ return (_PropTypes$number = _propTypes.default.number).isRequired.apply(_PropTypes$number, args);
15438
+ }
15439
+ return _propTypes.default.number.apply(_propTypes.default, args);
15440
+ },
15480
15441
  /*
15481
15442
  * Customize cursor resize handle
15482
15443
  * */
15483
15444
  handle: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
15484
-
15485
15445
  /*
15486
15446
  * If you change this, be sure to update your css
15487
15447
  * */
15488
15448
  handleSize: _propTypes.default.arrayOf(_propTypes.default.number),
15489
15449
  lockAspectRatio: _propTypes.default.bool,
15490
-
15491
15450
  /*
15492
15451
  * Max X & Y measure
15493
15452
  * */
15494
15453
  maxConstraints: _propTypes.default.arrayOf(_propTypes.default.number),
15495
-
15496
15454
  /*
15497
15455
  * Min X & Y measure
15498
15456
  * */
15499
15457
  minConstraints: _propTypes.default.arrayOf(_propTypes.default.number),
15500
-
15501
15458
  /*
15502
15459
  * Called on stop resize event
15503
15460
  * */
15504
15461
  onResizeStop: _propTypes.default.func,
15505
-
15506
15462
  /*
15507
15463
  * Called on start resize event
15508
15464
  * */
15509
15465
  onResizeStart: _propTypes.default.func,
15510
-
15511
15466
  /*
15512
15467
  * Called on resize event
15513
15468
  * */
15514
15469
  onResize: _propTypes.default.func,
15515
-
15516
15470
  /*
15517
15471
  * Defines which resize handles should be rendered (default: 'se')
15518
15472
  * 's' - South handle (bottom-center)
@@ -15525,16 +15479,25 @@ var resizableProps = {
15525
15479
  * 'ne' - Northeast handle (top-center)
15526
15480
  * */
15527
15481
  resizeHandles: _propTypes.default.arrayOf(_propTypes.default.oneOf(['s', 'w', 'e', 'n', 'sw', 'nw', 'se', 'ne'])),
15528
-
15529
15482
  /*
15530
15483
  * If `transform: scale(n)` is set on the parent, this should be set to `n`.
15531
15484
  * */
15532
15485
  transformScale: _propTypes.default.number,
15533
-
15534
15486
  /*
15535
15487
  * Initial width
15536
15488
  */
15537
- width: _propTypes.default.number.isRequired
15489
+ width: function width() {
15490
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
15491
+ args[_key2] = arguments[_key2];
15492
+ }
15493
+ var props = args[0];
15494
+ // Required if resizing width or both
15495
+ if (props.axis === 'both' || props.axis === 'x') {
15496
+ var _PropTypes$number2;
15497
+ return (_PropTypes$number2 = _propTypes.default.number).isRequired.apply(_PropTypes$number2, args);
15498
+ }
15499
+ return _propTypes.default.number.apply(_propTypes.default, args);
15500
+ }
15538
15501
  };
15539
15502
  exports.resizableProps = resizableProps;
15540
15503
 
@@ -15548,27 +15511,21 @@ exports.resizableProps = resizableProps;
15548
15511
 
15549
15512
  exports.__esModule = true;
15550
15513
  exports.cloneElement = cloneElement;
15551
-
15552
15514
  var _react = _interopRequireDefault(__webpack_require__("neV8"));
15553
-
15554
15515
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15555
-
15556
- 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; }
15557
-
15558
- 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; }
15559
-
15560
- 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; }
15561
-
15516
+ 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; }
15517
+ 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; }
15518
+ 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; }
15519
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
15520
+ 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); }
15562
15521
  // React.addons.cloneWithProps look-alike that merges style & className.
15563
15522
  function cloneElement(element, props) {
15564
15523
  if (props.style && element.props.style) {
15565
15524
  props.style = _objectSpread(_objectSpread({}, element.props.style), props.style);
15566
15525
  }
15567
-
15568
15526
  if (props.className && element.props.className) {
15569
15527
  props.className = element.props.className + " " + props.className;
15570
15528
  }
15571
-
15572
15529
  return /*#__PURE__*/_react.default.cloneElement(element, props);
15573
15530
  }
15574
15531