zmdms-webui 0.0.76 → 0.0.78

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 (81) hide show
  1. package/dist/es/_virtual/Draggable.js +3 -0
  2. package/dist/es/_virtual/DraggableCore.js +3 -0
  3. package/dist/es/_virtual/Resizable.js +3 -0
  4. package/dist/es/_virtual/ResizableBox.js +3 -0
  5. package/dist/es/_virtual/_commonjsHelpers.js +29 -1
  6. package/dist/es/_virtual/cjs.js +3 -0
  7. package/dist/es/_virtual/clsx.m.js +6 -0
  8. package/dist/es/_virtual/domFns.js +3 -0
  9. package/dist/es/_virtual/getPrefix.js +3 -0
  10. package/dist/es/_virtual/index3.js +3 -0
  11. package/dist/es/_virtual/index4.js +3 -0
  12. package/dist/es/_virtual/index5.js +3 -0
  13. package/dist/es/_virtual/log.js +3 -0
  14. package/dist/es/_virtual/positionFns.js +3 -0
  15. package/dist/es/_virtual/propTypes.js +3 -0
  16. package/dist/es/_virtual/react-is.development.js +3 -0
  17. package/dist/es/_virtual/react-is.production.min.js +3 -0
  18. package/dist/es/_virtual/shims.js +3 -0
  19. package/dist/es/_virtual/utils.js +3 -0
  20. package/dist/es/button/button.js +14 -9
  21. package/dist/es/button/interface.d.ts +2 -0
  22. package/dist/es/dynamicsetting/dynamicDrawer.js +88 -5
  23. package/dist/es/dynamicsetting/dynamicSetting.js +7 -2
  24. package/dist/es/dynamicsetting/interface.d.ts +4 -0
  25. package/dist/es/dynamicsetting/moreConfig.js +36 -0
  26. package/dist/es/dynamicsetting/useDynamic.js +65 -25
  27. package/dist/es/form/form.d.ts +1 -1
  28. package/dist/es/form/form.js +18 -6
  29. package/dist/es/form/hooks.js +37 -5
  30. package/dist/es/form/interface.d.ts +7 -0
  31. package/dist/es/form/toggle.js +16 -0
  32. package/dist/es/node_modules/@ant-design/icons/es/icons/MenuOutlined.js +15 -0
  33. package/dist/es/node_modules/@ant-design/icons/es/utils.js +3 -1
  34. package/dist/es/node_modules/@ant-design/icons-svg/es/asn/MenuOutlined.js +5 -0
  35. package/dist/es/node_modules/@ant-design/icons-svg/es/asn/PlusOutlined.js +1 -1
  36. package/dist/es/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +19 -19
  37. package/dist/es/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +15 -15
  38. package/dist/es/node_modules/@babel/runtime/helpers/esm/typeof.js +6 -6
  39. package/dist/es/node_modules/antd-img-crop/dist/antd-img-crop.esm.js +7 -7
  40. package/dist/es/node_modules/clsx/dist/clsx.m.js +3 -0
  41. package/dist/es/node_modules/compare-versions/lib/esm/compareVersions.js +31 -0
  42. package/dist/es/node_modules/compare-versions/lib/esm/{index.js → utils.js} +1 -28
  43. package/dist/es/node_modules/object-assign/index.js +99 -0
  44. package/dist/es/node_modules/prop-types/checkPropTypes.js +115 -0
  45. package/dist/es/node_modules/prop-types/factoryWithThrowingShims.js +74 -0
  46. package/dist/es/node_modules/prop-types/factoryWithTypeCheckers.js +625 -0
  47. package/dist/es/node_modules/prop-types/index.js +28 -0
  48. package/dist/es/node_modules/prop-types/lib/ReactPropTypesSecret.js +21 -0
  49. package/dist/es/node_modules/prop-types/lib/has.js +11 -0
  50. package/dist/es/node_modules/react-draggable/build/cjs/Draggable.js +474 -0
  51. package/dist/es/node_modules/react-draggable/build/cjs/DraggableCore.js +580 -0
  52. package/dist/es/node_modules/react-draggable/build/cjs/cjs.js +18 -0
  53. package/dist/es/node_modules/react-draggable/build/cjs/utils/domFns.js +361 -0
  54. package/dist/es/node_modules/react-draggable/build/cjs/utils/getPrefix.js +85 -0
  55. package/dist/es/node_modules/react-draggable/build/cjs/utils/log.js +10 -0
  56. package/dist/es/node_modules/react-draggable/build/cjs/utils/positionFns.js +214 -0
  57. package/dist/es/node_modules/react-draggable/build/cjs/utils/shims.js +64 -0
  58. package/dist/es/node_modules/react-easy-crop/index.module.js +51 -18
  59. package/dist/es/node_modules/react-is/cjs/react-is.development.js +190 -0
  60. package/dist/es/node_modules/react-is/cjs/react-is.production.min.js +26 -0
  61. package/dist/es/node_modules/react-is/index.js +19 -0
  62. package/dist/es/node_modules/react-resizable/build/Resizable.js +262 -0
  63. package/dist/es/node_modules/react-resizable/build/ResizableBox.js +117 -0
  64. package/dist/es/node_modules/react-resizable/build/propTypes.js +120 -0
  65. package/dist/es/node_modules/react-resizable/build/utils.js +24 -0
  66. package/dist/es/node_modules/react-resizable/index.js +14 -0
  67. package/dist/es/node_modules/virtuallist-antd/dist/index.es.js +942 -0
  68. package/dist/es/table/components/EnhanceBodyRow.js +24 -0
  69. package/dist/es/table/components/EnhanceHeaderCell.js +41 -0
  70. package/dist/es/table/components/TitleOperation.js +1 -1
  71. package/dist/es/table/components/useDragRef.js +10 -11
  72. package/dist/es/table/interface.d.ts +14 -0
  73. package/dist/es/table/table.js +72 -25
  74. package/dist/es/table/useColumns.js +144 -66
  75. package/dist/es/table/useDynamicListByColumns.js +63 -20
  76. package/dist/es/table/utils.js +59 -21
  77. package/dist/index.dark.css +1 -1
  78. package/dist/index.default.css +1 -1
  79. package/package.json +5 -4
  80. package/dist/es/table/components/EnhanceRow.js +0 -21
  81. /package/dist/es/table/components/{EnhanceCell.js → EnhanceBodyCell.js} +0 -0
@@ -0,0 +1,262 @@
1
+ import { __exports as Resizable$1 } from '../../../_virtual/Resizable.js';
2
+ import React__default from 'react';
3
+ import { c as cjsExports } from '../../react-draggable/build/cjs/cjs.js';
4
+ import './utils.js';
5
+ import './propTypes.js';
6
+ import { __exports as utils } from '../../../_virtual/utils.js';
7
+ import { __exports as propTypes } from '../../../_virtual/propTypes.js';
8
+
9
+ Resizable$1.__esModule = true;
10
+ Resizable$1.default = void 0;
11
+ var React = _interopRequireWildcard(React__default);
12
+ var _reactDraggable = cjsExports;
13
+ var _utils = utils;
14
+ var _propTypes = propTypes;
15
+ var _excluded = ["children", "className", "draggableOpts", "width", "height", "handle", "handleSize", "lockAspectRatio", "axis", "minConstraints", "maxConstraints", "onResize", "onResizeStop", "onResizeStart", "resizeHandles", "transformScale"];
16
+ 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); }
17
+ 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; }
18
+ 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); }
19
+ 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; }
20
+ 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; }
21
+ 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; }
22
+ 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; }
23
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
24
+ 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); }
25
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
26
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
27
+ // The base <Resizable> component.
28
+ // This component does not have state and relies on the parent to set its props based on callback data.
29
+ var Resizable = /*#__PURE__*/function (_React$Component) {
30
+ _inheritsLoose(Resizable, _React$Component);
31
+ function Resizable() {
32
+ var _this;
33
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
34
+ args[_key] = arguments[_key];
35
+ }
36
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
37
+ _this.handleRefs = {};
38
+ _this.lastHandleRect = null;
39
+ _this.slack = null;
40
+ return _this;
41
+ }
42
+ var _proto = Resizable.prototype;
43
+ _proto.componentWillUnmount = function componentWillUnmount() {
44
+ this.resetData();
45
+ };
46
+ _proto.resetData = function resetData() {
47
+ this.lastHandleRect = this.slack = null;
48
+ }
49
+
50
+ // Clamp width and height within provided constraints
51
+ ;
52
+ _proto.runConstraints = function runConstraints(width, height) {
53
+ var _this$props = this.props,
54
+ minConstraints = _this$props.minConstraints,
55
+ maxConstraints = _this$props.maxConstraints,
56
+ lockAspectRatio = _this$props.lockAspectRatio;
57
+ // short circuit
58
+ if (!minConstraints && !maxConstraints && !lockAspectRatio) return [width, height];
59
+
60
+ // If constraining to min and max, we need to also fit width and height to aspect ratio.
61
+ if (lockAspectRatio) {
62
+ var ratio = this.props.width / this.props.height;
63
+ var deltaW = width - this.props.width;
64
+ var deltaH = height - this.props.height;
65
+
66
+ // Find which coordinate was greater and should push the other toward it.
67
+ // E.g.:
68
+ // ratio = 1, deltaW = 10, deltaH = 5, deltaH should become 10.
69
+ // ratio = 2, deltaW = 10, deltaH = 6, deltaW should become 12.
70
+ if (Math.abs(deltaW) > Math.abs(deltaH * ratio)) {
71
+ height = width / ratio;
72
+ } else {
73
+ width = height * ratio;
74
+ }
75
+ }
76
+ var oldW = width,
77
+ oldH = height;
78
+
79
+ // Add slack to the values used to calculate bound position. This will ensure that if
80
+ // we start removing slack, the element won't react to it right away until it's been
81
+ // completely removed.
82
+ var _ref = this.slack || [0, 0],
83
+ slackW = _ref[0],
84
+ slackH = _ref[1];
85
+ width += slackW;
86
+ height += slackH;
87
+ if (minConstraints) {
88
+ width = Math.max(minConstraints[0], width);
89
+ height = Math.max(minConstraints[1], height);
90
+ }
91
+ if (maxConstraints) {
92
+ width = Math.min(maxConstraints[0], width);
93
+ height = Math.min(maxConstraints[1], height);
94
+ }
95
+
96
+ // If the width or height changed, we must have introduced some slack. Record it for the next iteration.
97
+ this.slack = [slackW + (oldW - width), slackH + (oldH - height)];
98
+ return [width, height];
99
+ }
100
+
101
+ /**
102
+ * Wrapper around drag events to provide more useful data.
103
+ *
104
+ * @param {String} handlerName Handler name to wrap.
105
+ * @return {Function} Handler function.
106
+ */;
107
+ _proto.resizeHandler = function resizeHandler(handlerName, axis) {
108
+ var _this2 = this;
109
+ return function (e, _ref2) {
110
+ var node = _ref2.node,
111
+ deltaX = _ref2.deltaX,
112
+ deltaY = _ref2.deltaY;
113
+ // Reset data in case it was left over somehow (should not be possible)
114
+ if (handlerName === 'onResizeStart') _this2.resetData();
115
+
116
+ // Axis restrictions
117
+ var canDragX = (_this2.props.axis === 'both' || _this2.props.axis === 'x') && axis !== 'n' && axis !== 's';
118
+ var canDragY = (_this2.props.axis === 'both' || _this2.props.axis === 'y') && axis !== 'e' && axis !== 'w';
119
+ // No dragging possible.
120
+ if (!canDragX && !canDragY) return;
121
+
122
+ // Decompose axis for later use
123
+ var axisV = axis[0];
124
+ var axisH = axis[axis.length - 1]; // intentionally not axis[1], so that this catches axis === 'w' for example
125
+
126
+ // Track the element being dragged to account for changes in position.
127
+ // If a handle's position is changed between callbacks, we need to factor this in to the next callback.
128
+ // Failure to do so will cause the element to "skip" when resized upwards or leftwards.
129
+ var handleRect = node.getBoundingClientRect();
130
+ if (_this2.lastHandleRect != null) {
131
+ // If the handle has repositioned on either axis since last render,
132
+ // we need to increase our callback values by this much.
133
+ // Only checking 'n', 'w' since resizing by 's', 'w' won't affect the overall position on page,
134
+ if (axisH === 'w') {
135
+ var deltaLeftSinceLast = handleRect.left - _this2.lastHandleRect.left;
136
+ deltaX += deltaLeftSinceLast;
137
+ }
138
+ if (axisV === 'n') {
139
+ var deltaTopSinceLast = handleRect.top - _this2.lastHandleRect.top;
140
+ deltaY += deltaTopSinceLast;
141
+ }
142
+ }
143
+ // Storage of last rect so we know how much it has really moved.
144
+ _this2.lastHandleRect = handleRect;
145
+
146
+ // Reverse delta if using top or left drag handles.
147
+ if (axisH === 'w') deltaX = -deltaX;
148
+ if (axisV === 'n') deltaY = -deltaY;
149
+
150
+ // Update w/h by the deltas. Also factor in transformScale.
151
+ var width = _this2.props.width + (canDragX ? deltaX / _this2.props.transformScale : 0);
152
+ var height = _this2.props.height + (canDragY ? deltaY / _this2.props.transformScale : 0);
153
+
154
+ // Run user-provided constraints.
155
+ var _this2$runConstraints = _this2.runConstraints(width, height);
156
+ width = _this2$runConstraints[0];
157
+ height = _this2$runConstraints[1];
158
+ var dimensionsChanged = width !== _this2.props.width || height !== _this2.props.height;
159
+
160
+ // Call user-supplied callback if present.
161
+ var cb = typeof _this2.props[handlerName] === 'function' ? _this2.props[handlerName] : null;
162
+ // Don't call 'onResize' if dimensions haven't changed.
163
+ var shouldSkipCb = handlerName === 'onResize' && !dimensionsChanged;
164
+ if (cb && !shouldSkipCb) {
165
+ e.persist == null ? void 0 : e.persist();
166
+ cb(e, {
167
+ node: node,
168
+ size: {
169
+ width: width,
170
+ height: height
171
+ },
172
+ handle: axis
173
+ });
174
+ }
175
+
176
+ // Reset internal data
177
+ if (handlerName === 'onResizeStop') _this2.resetData();
178
+ };
179
+ }
180
+
181
+ // Render a resize handle given an axis & DOM ref. Ref *must* be attached for
182
+ // the underlying draggable library to work properly.
183
+ ;
184
+ _proto.renderResizeHandle = function renderResizeHandle(handleAxis, ref) {
185
+ var handle = this.props.handle;
186
+ // No handle provided, make the default
187
+ if (!handle) {
188
+ return /*#__PURE__*/React.createElement("span", {
189
+ className: "react-resizable-handle react-resizable-handle-" + handleAxis,
190
+ ref: ref
191
+ });
192
+ }
193
+ // Handle is a function, such as:
194
+ // `handle={(handleAxis) => <span className={...} />}`
195
+ if (typeof handle === 'function') {
196
+ return handle(handleAxis, ref);
197
+ }
198
+ // Handle is a React component (composite or DOM).
199
+ var isDOMElement = typeof handle.type === 'string';
200
+ var props = _objectSpread({
201
+ ref: ref
202
+ }, isDOMElement ? {} : {
203
+ handleAxis: handleAxis
204
+ });
205
+ return /*#__PURE__*/React.cloneElement(handle, props);
206
+ };
207
+ _proto.render = function render() {
208
+ var _this3 = this;
209
+ // Pass along only props not meant for the `<Resizable>`.`
210
+ // eslint-disable-next-line no-unused-vars
211
+ var _this$props2 = this.props,
212
+ children = _this$props2.children,
213
+ className = _this$props2.className,
214
+ draggableOpts = _this$props2.draggableOpts;
215
+ _this$props2.width;
216
+ _this$props2.height;
217
+ _this$props2.handle;
218
+ _this$props2.handleSize;
219
+ _this$props2.lockAspectRatio;
220
+ _this$props2.axis;
221
+ _this$props2.minConstraints;
222
+ _this$props2.maxConstraints;
223
+ _this$props2.onResize;
224
+ _this$props2.onResizeStop;
225
+ _this$props2.onResizeStart;
226
+ var resizeHandles = _this$props2.resizeHandles;
227
+ _this$props2.transformScale;
228
+ var p = _objectWithoutPropertiesLoose(_this$props2, _excluded);
229
+
230
+ // What we're doing here is getting the child of this element, and cloning it with this element's props.
231
+ // We are then defining its children as:
232
+ // 1. Its original children (resizable's child's children), and
233
+ // 2. One or more draggable handles.
234
+ return (0, _utils.cloneElement)(children, _objectSpread(_objectSpread({}, p), {}, {
235
+ className: (className ? className + " " : '') + "react-resizable",
236
+ children: [].concat(children.props.children, resizeHandles.map(function (handleAxis) {
237
+ var _this3$handleRefs$han;
238
+ // Create a ref to the handle so that `<DraggableCore>` doesn't have to use ReactDOM.findDOMNode().
239
+ var ref = (_this3$handleRefs$han = _this3.handleRefs[handleAxis]) != null ? _this3$handleRefs$han : _this3.handleRefs[handleAxis] = /*#__PURE__*/React.createRef();
240
+ return /*#__PURE__*/React.createElement(_reactDraggable.DraggableCore, _extends({}, draggableOpts, {
241
+ nodeRef: ref,
242
+ key: "resizableHandle-" + handleAxis,
243
+ onStop: _this3.resizeHandler('onResizeStop', handleAxis),
244
+ onStart: _this3.resizeHandler('onResizeStart', handleAxis),
245
+ onDrag: _this3.resizeHandler('onResize', handleAxis)
246
+ }), _this3.renderResizeHandle(handleAxis, ref));
247
+ }))
248
+ }));
249
+ };
250
+ return Resizable;
251
+ }(React.Component);
252
+ Resizable$1.default = Resizable;
253
+ Resizable.propTypes = _propTypes.resizableProps;
254
+ Resizable.defaultProps = {
255
+ axis: 'both',
256
+ handleSize: [20, 20],
257
+ lockAspectRatio: false,
258
+ minConstraints: [20, 20],
259
+ maxConstraints: [Infinity, Infinity],
260
+ resizeHandles: ['se'],
261
+ transformScale: 1
262
+ };
@@ -0,0 +1,117 @@
1
+ import { __exports as ResizableBox$1 } from '../../../_virtual/ResizableBox.js';
2
+ import React__default from 'react';
3
+ import { p as propTypesExports } from '../../prop-types/index.js';
4
+ import './Resizable.js';
5
+ import './propTypes.js';
6
+ import { __exports as Resizable } from '../../../_virtual/Resizable.js';
7
+ import { __exports as propTypes } from '../../../_virtual/propTypes.js';
8
+
9
+ ResizableBox$1.__esModule = true;
10
+ ResizableBox$1.default = void 0;
11
+ var React = _interopRequireWildcard(React__default);
12
+ var _propTypes = _interopRequireDefault(propTypesExports);
13
+ var _Resizable = _interopRequireDefault(Resizable);
14
+ var _propTypes2 = propTypes;
15
+ var _excluded = ["handle", "handleSize", "onResize", "onResizeStart", "onResizeStop", "draggableOpts", "minConstraints", "maxConstraints", "lockAspectRatio", "axis", "width", "height", "resizeHandles", "style", "transformScale"];
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+ 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); }
18
+ 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; }
19
+ 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); }
20
+ 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; }
21
+ 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; }
22
+ 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; }
23
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
24
+ 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); }
25
+ 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; }
26
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
27
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
28
+ var ResizableBox = /*#__PURE__*/function (_React$Component) {
29
+ _inheritsLoose(ResizableBox, _React$Component);
30
+ function ResizableBox() {
31
+ var _this;
32
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
33
+ args[_key] = arguments[_key];
34
+ }
35
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
36
+ _this.state = {
37
+ width: _this.props.width,
38
+ height: _this.props.height,
39
+ propsWidth: _this.props.width,
40
+ propsHeight: _this.props.height
41
+ };
42
+ _this.onResize = function (e, data) {
43
+ var size = data.size;
44
+ if (_this.props.onResize) {
45
+ e.persist == null ? void 0 : e.persist();
46
+ _this.setState(size, function () {
47
+ return _this.props.onResize && _this.props.onResize(e, data);
48
+ });
49
+ } else {
50
+ _this.setState(size);
51
+ }
52
+ };
53
+ return _this;
54
+ }
55
+ ResizableBox.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
56
+ // If parent changes height/width, set that in our state.
57
+ if (state.propsWidth !== props.width || state.propsHeight !== props.height) {
58
+ return {
59
+ width: props.width,
60
+ height: props.height,
61
+ propsWidth: props.width,
62
+ propsHeight: props.height
63
+ };
64
+ }
65
+ return null;
66
+ };
67
+ var _proto = ResizableBox.prototype;
68
+ _proto.render = function render() {
69
+ // Basic wrapper around a Resizable instance.
70
+ // If you use Resizable directly, you are responsible for updating the child component
71
+ // with a new width and height.
72
+ var _this$props = this.props,
73
+ handle = _this$props.handle,
74
+ handleSize = _this$props.handleSize;
75
+ _this$props.onResize;
76
+ var onResizeStart = _this$props.onResizeStart,
77
+ onResizeStop = _this$props.onResizeStop,
78
+ draggableOpts = _this$props.draggableOpts,
79
+ minConstraints = _this$props.minConstraints,
80
+ maxConstraints = _this$props.maxConstraints,
81
+ lockAspectRatio = _this$props.lockAspectRatio,
82
+ axis = _this$props.axis;
83
+ _this$props.width;
84
+ _this$props.height;
85
+ var resizeHandles = _this$props.resizeHandles,
86
+ style = _this$props.style,
87
+ transformScale = _this$props.transformScale,
88
+ props = _objectWithoutPropertiesLoose(_this$props, _excluded);
89
+ return /*#__PURE__*/React.createElement(_Resizable.default, {
90
+ axis: axis,
91
+ draggableOpts: draggableOpts,
92
+ handle: handle,
93
+ handleSize: handleSize,
94
+ height: this.state.height,
95
+ lockAspectRatio: lockAspectRatio,
96
+ maxConstraints: maxConstraints,
97
+ minConstraints: minConstraints,
98
+ onResizeStart: onResizeStart,
99
+ onResize: this.onResize,
100
+ onResizeStop: onResizeStop,
101
+ resizeHandles: resizeHandles,
102
+ transformScale: transformScale,
103
+ width: this.state.width
104
+ }, /*#__PURE__*/React.createElement("div", _extends({}, props, {
105
+ style: _objectSpread(_objectSpread({}, style), {}, {
106
+ width: this.state.width + 'px',
107
+ height: this.state.height + 'px'
108
+ })
109
+ })));
110
+ };
111
+ return ResizableBox;
112
+ }(React.Component);
113
+ ResizableBox$1.default = ResizableBox;
114
+ // PropTypes are identical to <Resizable>, except that children are not strictly required to be present.
115
+ ResizableBox.propTypes = _objectSpread(_objectSpread({}, _propTypes2.resizableProps), {}, {
116
+ children: _propTypes.default.element
117
+ });
@@ -0,0 +1,120 @@
1
+ import { __exports as propTypes } from '../../../_virtual/propTypes.js';
2
+ import { p as propTypesExports } from '../../prop-types/index.js';
3
+ import '../../react-draggable/build/cjs/cjs.js';
4
+
5
+ propTypes.__esModule = true;
6
+ propTypes.resizableProps = void 0;
7
+ var _propTypes = _interopRequireDefault(propTypesExports);
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ var resizableProps = {
10
+ /*
11
+ * Restricts resizing to a particular axis (default: 'both')
12
+ * 'both' - allows resizing by width or height
13
+ * 'x' - only allows the width to be changed
14
+ * 'y' - only allows the height to be changed
15
+ * 'none' - disables resizing altogether
16
+ * */
17
+ axis: _propTypes.default.oneOf(['both', 'x', 'y', 'none']),
18
+ className: _propTypes.default.string,
19
+ /*
20
+ * Require that one and only one child be present.
21
+ * */
22
+ children: _propTypes.default.element.isRequired,
23
+ /*
24
+ * These will be passed wholesale to react-draggable's DraggableCore
25
+ * */
26
+ draggableOpts: _propTypes.default.shape({
27
+ allowAnyClick: _propTypes.default.bool,
28
+ cancel: _propTypes.default.string,
29
+ children: _propTypes.default.node,
30
+ disabled: _propTypes.default.bool,
31
+ enableUserSelectHack: _propTypes.default.bool,
32
+ offsetParent: _propTypes.default.node,
33
+ grid: _propTypes.default.arrayOf(_propTypes.default.number),
34
+ handle: _propTypes.default.string,
35
+ nodeRef: _propTypes.default.object,
36
+ onStart: _propTypes.default.func,
37
+ onDrag: _propTypes.default.func,
38
+ onStop: _propTypes.default.func,
39
+ onMouseDown: _propTypes.default.func,
40
+ scale: _propTypes.default.number
41
+ }),
42
+ /*
43
+ * Initial height
44
+ * */
45
+ height: function height() {
46
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
47
+ args[_key] = arguments[_key];
48
+ }
49
+ var props = args[0];
50
+ // Required if resizing height or both
51
+ if (props.axis === 'both' || props.axis === 'y') {
52
+ var _PropTypes$number;
53
+ return (_PropTypes$number = _propTypes.default.number).isRequired.apply(_PropTypes$number, args);
54
+ }
55
+ return _propTypes.default.number.apply(_propTypes.default, args);
56
+ },
57
+ /*
58
+ * Customize cursor resize handle
59
+ * */
60
+ handle: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
61
+ /*
62
+ * If you change this, be sure to update your css
63
+ * */
64
+ handleSize: _propTypes.default.arrayOf(_propTypes.default.number),
65
+ lockAspectRatio: _propTypes.default.bool,
66
+ /*
67
+ * Max X & Y measure
68
+ * */
69
+ maxConstraints: _propTypes.default.arrayOf(_propTypes.default.number),
70
+ /*
71
+ * Min X & Y measure
72
+ * */
73
+ minConstraints: _propTypes.default.arrayOf(_propTypes.default.number),
74
+ /*
75
+ * Called on stop resize event
76
+ * */
77
+ onResizeStop: _propTypes.default.func,
78
+ /*
79
+ * Called on start resize event
80
+ * */
81
+ onResizeStart: _propTypes.default.func,
82
+ /*
83
+ * Called on resize event
84
+ * */
85
+ onResize: _propTypes.default.func,
86
+ /*
87
+ * Defines which resize handles should be rendered (default: 'se')
88
+ * 's' - South handle (bottom-center)
89
+ * 'w' - West handle (left-center)
90
+ * 'e' - East handle (right-center)
91
+ * 'n' - North handle (top-center)
92
+ * 'sw' - Southwest handle (bottom-left)
93
+ * 'nw' - Northwest handle (top-left)
94
+ * 'se' - Southeast handle (bottom-right)
95
+ * 'ne' - Northeast handle (top-center)
96
+ * */
97
+ resizeHandles: _propTypes.default.arrayOf(_propTypes.default.oneOf(['s', 'w', 'e', 'n', 'sw', 'nw', 'se', 'ne'])),
98
+ /*
99
+ * If `transform: scale(n)` is set on the parent, this should be set to `n`.
100
+ * */
101
+ transformScale: _propTypes.default.number,
102
+ /*
103
+ * Initial width
104
+ */
105
+ width: function width() {
106
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
107
+ args[_key2] = arguments[_key2];
108
+ }
109
+ var props = args[0];
110
+ // Required if resizing width or both
111
+ if (props.axis === 'both' || props.axis === 'x') {
112
+ var _PropTypes$number2;
113
+ return (_PropTypes$number2 = _propTypes.default.number).isRequired.apply(_PropTypes$number2, args);
114
+ }
115
+ return _propTypes.default.number.apply(_propTypes.default, args);
116
+ }
117
+ };
118
+ propTypes.resizableProps = resizableProps;
119
+
120
+ export { propTypes as default };
@@ -0,0 +1,24 @@
1
+ import { __exports as utils } from '../../../_virtual/utils.js';
2
+ import React__default from 'react';
3
+
4
+ utils.__esModule = true;
5
+ utils.cloneElement = cloneElement;
6
+ var _react = _interopRequireDefault(React__default);
7
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
+ 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; }
9
+ 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; }
10
+ 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; }
11
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
12
+ 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); }
13
+ // React.addons.cloneWithProps look-alike that merges style & className.
14
+ function cloneElement(element, props) {
15
+ if (props.style && element.props.style) {
16
+ props.style = _objectSpread(_objectSpread({}, element.props.style), props.style);
17
+ }
18
+ if (props.className && element.props.className) {
19
+ props.className = element.props.className + " " + props.className;
20
+ }
21
+ return /*#__PURE__*/_react.default.cloneElement(element, props);
22
+ }
23
+
24
+ export { utils as default };
@@ -0,0 +1,14 @@
1
+ import { __module as reactResizable } from '../../_virtual/index3.js';
2
+ import './build/Resizable.js';
3
+ import './build/ResizableBox.js';
4
+ import { __exports as Resizable$1 } from '../../_virtual/Resizable.js';
5
+ import { __exports as ResizableBox } from '../../_virtual/ResizableBox.js';
6
+
7
+ reactResizable.exports = function() {
8
+ throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable");
9
+ };
10
+
11
+ var Resizable = reactResizable.exports.Resizable = Resizable$1.default;
12
+ reactResizable.exports.ResizableBox = ResizableBox.default;
13
+
14
+ export { Resizable };