zmdms-webui 0.0.76 → 0.0.77

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 (79) 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 +67 -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/{EnhanceRow.js → EnhanceBodyRow.js} +3 -3
  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/interface.d.ts +14 -0
  72. package/dist/es/table/table.js +73 -25
  73. package/dist/es/table/useColumns.js +143 -65
  74. package/dist/es/table/useDynamicListByColumns.js +63 -20
  75. package/dist/es/table/utils.js +59 -21
  76. package/dist/index.dark.css +1 -1
  77. package/dist/index.default.css +1 -1
  78. package/package.json +5 -4
  79. /package/dist/es/table/components/{EnhanceCell.js → EnhanceBodyCell.js} +0 -0
@@ -26,10 +26,10 @@ function useDynamicListByItems(items, dynamicKey, formPreferences) {
26
26
  var dynamicList = useMemo(function () {
27
27
  var result = [];
28
28
  if (dynamicKey && items) {
29
- result = items.map(function (item) {
30
- var name = item.name, label = item.label, dynamicDisabled = item.dynamicDisabled, isDisplay = item.isDisplay;
29
+ result = items.map(function (item, index) {
30
+ var name = item.name, key = item.key, label = item.label, dynamicDisabled = item.dynamicDisabled, isDisplay = item.isDisplay;
31
31
  return {
32
- key: name,
32
+ key: name || key || "".concat(Date.now(), "-").concat(index),
33
33
  label: label,
34
34
  disabled: dynamicDisabled === true ? true : false,
35
35
  // 如果用户传入了 isDisplay
@@ -62,7 +62,7 @@ function useDynamicListByItems(items, dynamicKey, formPreferences) {
62
62
  if (Array.isArray(currentDynamicList) && currentDynamicList.length > 0) {
63
63
  currentDynamicList.forEach(function (item) {
64
64
  var key = item.key, checked = item.checked;
65
- var childrenItem = items === null || items === void 0 ? void 0 : items.find(function (item) { return (item === null || item === void 0 ? void 0 : item.name) === key; });
65
+ var childrenItem = items === null || items === void 0 ? void 0 : items.find(function (item) { return (item === null || item === void 0 ? void 0 : item.name) === key || (item === null || item === void 0 ? void 0 : item.key) === key; });
66
66
  if (childrenItem) {
67
67
  if (!checked) {
68
68
  childrenItem.isDisplay = false;
@@ -100,6 +100,38 @@ function useBtnHandle(form, handleObj) {
100
100
  onResetHandleInner: onResetHandleInner,
101
101
  onSearchHandleInner: onSearchHandleInner,
102
102
  };
103
+ }
104
+ var ROW_HEIGHT = 42;
105
+ function useToggle(domRef, options) {
106
+ var isToggle = options.isToggle, _a = options.toggleNum, toggleNum = _a === void 0 ? 2 : _a, _b = options.defaultToggle, defaultToggle = _b === void 0 ? false : _b;
107
+ var _c = useState(defaultToggle), toggle = _c[0], setToggle = _c[1];
108
+ var isHandle = useRef(false);
109
+ // 设置展开 收起
110
+ var setToggleHandle = useCallback(function (toggle) {
111
+ if (!domRef.current) {
112
+ return;
113
+ }
114
+ isHandle.current = true;
115
+ var maxHeight = toggleNum * ROW_HEIGHT;
116
+ if (toggle) {
117
+ domRef.current.style.cssText = "max-height: 800px;";
118
+ }
119
+ else {
120
+ domRef.current.style.cssText = "max-height: ".concat(maxHeight, "px;");
121
+ }
122
+ setToggle(toggle);
123
+ }, [domRef, toggleNum]);
124
+ useEffect(function () {
125
+ if (domRef.current && isToggle && !isHandle.current && !defaultToggle) {
126
+ var height = domRef.current.offsetHeight;
127
+ var maxHeight = toggleNum * ROW_HEIGHT;
128
+ setToggleHandle(height < maxHeight);
129
+ }
130
+ }, [domRef, isToggle, toggleNum, setToggleHandle, defaultToggle]);
131
+ var onToggleChange = useCallback(function () {
132
+ setToggleHandle(!toggle);
133
+ }, [toggle, setToggleHandle]);
134
+ return { toggle: toggle, setToggle: setToggle, onToggleChange: onToggleChange, setToggleHandle: setToggleHandle };
103
135
  }
104
136
 
105
- export { useBtnHandle, useDynamicListByItems, useFormPreferencesCreateNewItems };
137
+ export { useBtnHandle, useDynamicListByItems, useFormPreferencesCreateNewItems, useToggle };
@@ -7,6 +7,7 @@ interface IFormPreferences {
7
7
  isDisplay?: boolean | number;
8
8
  }
9
9
  interface IFormItemProps extends IFormItem {
10
+ key?: string;
10
11
  }
11
12
  interface IProFormProps extends FormProps {
12
13
  /**
@@ -21,6 +22,12 @@ interface IProFormProps extends FormProps {
21
22
  * 是否开启容器flex布局
22
23
  */
23
24
  isFlex?: boolean;
25
+ /**
26
+ * 是否toggle
27
+ */
28
+ isToggle?: boolean;
29
+ toggleNum?: number;
30
+ defaultToggle?: boolean;
24
31
  /**
25
32
  * 主容器类名
26
33
  */
@@ -0,0 +1,16 @@
1
+ import { __assign } from '../_virtual/_tslib.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { memo } from 'react';
4
+ import DownOutlined from '../node_modules/@ant-design/icons/es/icons/DownOutlined.js';
5
+
6
+ var Toggle = function (_a) {
7
+ var toggle = _a.toggle, onClick = _a.onClick;
8
+ return (jsx("div", __assign({ className: "ztxk-from--toggle", onClick: onClick }, { children: jsx(DownOutlined, { style: {
9
+ fontSize: 18,
10
+ color: "#768696",
11
+ transform: "rotate(".concat(toggle ? "180deg" : 0, ")"),
12
+ } }) })));
13
+ };
14
+ var Toggle$1 = memo(Toggle);
15
+
16
+ export { Toggle$1 as default };
@@ -0,0 +1,15 @@
1
+ import _objectSpread2 from '../../../../@babel/runtime/helpers/esm/objectSpread2.js';
2
+ import * as React from 'react';
3
+ import MenuOutlinedSvg from '../../../icons-svg/es/asn/MenuOutlined.js';
4
+ import AntdIcon from '../components/AntdIcon.js';
5
+
6
+ var MenuOutlined = function MenuOutlined(props, ref) {
7
+ return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread2(_objectSpread2({}, props), {}, {
8
+ ref: ref,
9
+ icon: MenuOutlinedSvg
10
+ }));
11
+ };
12
+ MenuOutlined.displayName = 'MenuOutlined';
13
+ var MenuOutlined$1 = /*#__PURE__*/React.forwardRef(MenuOutlined);
14
+
15
+ export { MenuOutlined$1 as default };
@@ -5,6 +5,7 @@ import React__default, { useContext, useEffect } from 'react';
5
5
  import { warningOnce } from '../../../rc-util/es/warning.js';
6
6
  import { updateCSS } from '../../../rc-util/es/Dom/dynamicCSS.js';
7
7
  import Context from './components/Context.js';
8
+ import camelCase from 'lodash/camelCase';
8
9
 
9
10
  function warning(valid, message) {
10
11
  warningOnce(valid, "[@ant-design/icons] ".concat(message));
@@ -22,7 +23,8 @@ function normalizeAttrs() {
22
23
  delete acc.class;
23
24
  break;
24
25
  default:
25
- acc[key] = val;
26
+ delete acc[key];
27
+ acc[camelCase(key)] = val;
26
28
  }
27
29
  return acc;
28
30
  }, {});
@@ -0,0 +1,5 @@
1
+ // This icon file is generated automatically.
2
+ var MenuOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M904 160H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0 624H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0-312H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8z" } }] }, "name": "menu", "theme": "outlined" };
3
+ var MenuOutlinedSvg = MenuOutlined;
4
+
5
+ export { MenuOutlinedSvg as default };
@@ -1,5 +1,5 @@
1
1
  // This icon file is generated automatically.
2
- var PlusOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "defs", "attrs": {}, "children": [{ "tag": "style", "attrs": {} }] }, { "tag": "path", "attrs": { "d": "M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z" } }, { "tag": "path", "attrs": { "d": "M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z" } }] }, "name": "plus", "theme": "outlined" };
2
+ var PlusOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z" } }, { "tag": "path", "attrs": { "d": "M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z" } }] }, "name": "plus", "theme": "outlined" };
3
3
  var PlusOutlinedSvg = PlusOutlined;
4
4
 
5
5
  export { PlusOutlinedSvg as default };
@@ -1,28 +1,28 @@
1
- function _iterableToArrayLimit(arr, i) {
2
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
3
- if (null != _i) {
4
- var _s,
5
- _e,
6
- _x,
7
- _r,
8
- _arr = [],
9
- _n = !0,
10
- _d = !1;
1
+ function _iterableToArrayLimit(r, l) {
2
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
3
+ if (null != t) {
4
+ var e,
5
+ n,
6
+ i,
7
+ u,
8
+ a = [],
9
+ f = !0,
10
+ o = !1;
11
11
  try {
12
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
13
- if (Object(_i) !== _i) return;
14
- _n = !1;
15
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
16
- } catch (err) {
17
- _d = !0, _e = err;
12
+ if (i = (t = t.call(r)).next, 0 === l) {
13
+ if (Object(t) !== t) return;
14
+ f = !1;
15
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
16
+ } catch (r) {
17
+ o = !0, n = r;
18
18
  } finally {
19
19
  try {
20
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
20
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
21
21
  } finally {
22
- if (_d) throw _e;
22
+ if (o) throw n;
23
23
  }
24
24
  }
25
- return _arr;
25
+ return a;
26
26
  }
27
27
  }
28
28
 
@@ -1,25 +1,25 @@
1
1
  import _defineProperty from './defineProperty.js';
2
2
 
3
- function ownKeys(object, enumerableOnly) {
4
- var keys = Object.keys(object);
3
+ function ownKeys(e, r) {
4
+ var t = Object.keys(e);
5
5
  if (Object.getOwnPropertySymbols) {
6
- var symbols = Object.getOwnPropertySymbols(object);
7
- enumerableOnly && (symbols = symbols.filter(function (sym) {
8
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
9
- })), keys.push.apply(keys, symbols);
6
+ var o = Object.getOwnPropertySymbols(e);
7
+ r && (o = o.filter(function (r) {
8
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
9
+ })), t.push.apply(t, o);
10
10
  }
11
- return keys;
11
+ return t;
12
12
  }
13
- function _objectSpread2(target) {
14
- for (var i = 1; i < arguments.length; i++) {
15
- var source = null != arguments[i] ? arguments[i] : {};
16
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
17
- _defineProperty(target, key, source[key]);
18
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
19
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
13
+ function _objectSpread2(e) {
14
+ for (var r = 1; r < arguments.length; r++) {
15
+ var t = null != arguments[r] ? arguments[r] : {};
16
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
17
+ _defineProperty(e, r, t[r]);
18
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
19
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
20
20
  });
21
21
  }
22
- return target;
22
+ return e;
23
23
  }
24
24
 
25
25
  export { _objectSpread2 as default };
@@ -1,11 +1,11 @@
1
- function _typeof(obj) {
1
+ function _typeof(o) {
2
2
  "@babel/helpers - typeof";
3
3
 
4
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
5
- return typeof obj;
6
- } : function (obj) {
7
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
8
- }, _typeof(obj);
4
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
5
+ return typeof o;
6
+ } : function (o) {
7
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
8
+ }, _typeof(o);
9
9
  }
10
10
 
11
11
  export { _typeof as default };
@@ -1,13 +1,13 @@
1
1
  import { __rest, __awaiter } from '../../../_virtual/_tslib.js';
2
2
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
- import { forwardRef, useState, useRef, useCallback, useImperativeHandle, memo, useMemo } from 'react';
4
3
  import { version } from 'antd';
5
4
  import AntModal from 'antd/es/modal';
6
5
  import AntUpload from 'antd/es/upload';
7
- import { compareVersions } from '../../compare-versions/lib/esm/index.js';
8
- import Cropper from '../../react-easy-crop/index.module.js';
6
+ import { forwardRef, useState, useRef, useCallback, useImperativeHandle, memo, useMemo } from 'react';
9
7
  import AntButton from 'antd/es/button';
10
8
  import AntSlider from 'antd/es/slider';
9
+ import Cropper from '../../react-easy-crop/index.module.js';
10
+ import { compareVersions } from '../../compare-versions/lib/esm/compareVersions.js';
11
11
 
12
12
  const PREFIX = 'img-crop';
13
13
  const ZOOM_INITIAL = 1;
@@ -53,7 +53,7 @@ const EasyCrop = forwardRef((props, ref) => {
53
53
  cropShape: cropShape, showGrid: showGrid, onCropChange: onCropChange, onZoomChange: setZoom, onRotationChange: setRotation, onCropComplete: onCropComplete, classes: {
54
54
  containerClassName: `${PREFIX}-container ![position:relative] [width:100%] [height:40vh] [&~section:first-of-type]:[margin-top:16px] [&~section:last-of-type]:[margin-bottom:16px]`,
55
55
  mediaClassName: `${PREFIX}-media`,
56
- } })), zoomSlider && (jsxs("section", Object.assign({ className: `${PREFIX}-control ${PREFIX}-control-zoom ${wrapperClass}` }, { children: [jsx("button", Object.assign({ className: buttonClass, onClick: () => setZoom(zoom - ZOOM_STEP), disabled: zoom - ZOOM_STEP < minZoom }, { children: "\uFF0D" })), jsx(AntSlider, { className: sliderClass, min: minZoom, max: maxZoom, step: ZOOM_STEP, value: zoom, onChange: setZoom }), jsx("button", Object.assign({ className: buttonClass, onClick: () => setZoom(zoom + ZOOM_STEP), disabled: zoom + ZOOM_STEP > maxZoom }, { children: "\uFF0B" }))] }))), rotationSlider && (jsxs("section", Object.assign({ className: `${PREFIX}-control ${PREFIX}-control-rotation ${wrapperClass}` }, { children: [jsx("button", Object.assign({ className: `${buttonClass} [font-size:16px]`, onClick: () => setRotation(rotation - ROTATION_STEP), disabled: rotation === ROTATION_MIN }, { children: "\u21BA" })), jsx(AntSlider, { className: sliderClass, min: ROTATION_MIN, max: ROTATION_MAX, step: ROTATION_STEP, value: rotation, onChange: setRotation }), jsx("button", Object.assign({ className: `${buttonClass} [font-size:16px]`, onClick: () => setRotation(rotation + ROTATION_STEP), disabled: rotation === ROTATION_MAX }, { children: "\u21BB" }))] }))), aspectSlider && (jsxs("section", Object.assign({ className: `${PREFIX}-control ${PREFIX}-control-aspect ${wrapperClass}` }, { children: [jsx("button", Object.assign({ className: buttonClass, onClick: () => setAspect(aspect - ASPECT_STEP), disabled: aspect - ASPECT_STEP < ASPECT_MIN }, { children: "\u2195\uFE0F" })), jsx(AntSlider, { className: sliderClass, min: ASPECT_MIN, max: ASPECT_MAX, step: ASPECT_STEP, value: aspect, onChange: setAspect }), jsx("button", Object.assign({ className: buttonClass, onClick: () => setAspect(aspect + ASPECT_STEP), disabled: aspect + ASPECT_STEP > ASPECT_MAX }, { children: "\u2194\uFE0F" }))] }))), showReset && (zoomSlider || rotationSlider || aspectSlider) && (jsx(AntButton, Object.assign({ className: "[bottom:20px] [position:absolute]", style: isResetActive ? {} : { opacity: 0.3, pointerEvents: 'none' }, onClick: onReset }, { children: resetBtnText })))] }));
56
+ } })), zoomSlider && (jsxs("section", { className: `${PREFIX}-control ${PREFIX}-control-zoom ${wrapperClass}`, children: [jsx("button", { className: buttonClass, onClick: () => setZoom(zoom - ZOOM_STEP), disabled: zoom - ZOOM_STEP < minZoom, children: "\uFF0D" }), jsx(AntSlider, { className: sliderClass, min: minZoom, max: maxZoom, step: ZOOM_STEP, value: zoom, onChange: setZoom }), jsx("button", { className: buttonClass, onClick: () => setZoom(zoom + ZOOM_STEP), disabled: zoom + ZOOM_STEP > maxZoom, children: "\uFF0B" })] })), rotationSlider && (jsxs("section", { className: `${PREFIX}-control ${PREFIX}-control-rotation ${wrapperClass}`, children: [jsx("button", { className: `${buttonClass} [font-size:16px]`, onClick: () => setRotation(rotation - ROTATION_STEP), disabled: rotation === ROTATION_MIN, children: "\u21BA" }), jsx(AntSlider, { className: sliderClass, min: ROTATION_MIN, max: ROTATION_MAX, step: ROTATION_STEP, value: rotation, onChange: setRotation }), jsx("button", { className: `${buttonClass} [font-size:16px]`, onClick: () => setRotation(rotation + ROTATION_STEP), disabled: rotation === ROTATION_MAX, children: "\u21BB" })] })), aspectSlider && (jsxs("section", { className: `${PREFIX}-control ${PREFIX}-control-aspect ${wrapperClass}`, children: [jsx("button", { className: buttonClass, onClick: () => setAspect(aspect - ASPECT_STEP), disabled: aspect - ASPECT_STEP < ASPECT_MIN, children: "\u2195\uFE0F" }), jsx(AntSlider, { className: sliderClass, min: ASPECT_MIN, max: ASPECT_MAX, step: ASPECT_STEP, value: aspect, onChange: setAspect }), jsx("button", { className: buttonClass, onClick: () => setAspect(aspect + ASPECT_STEP), disabled: aspect + ASPECT_STEP > ASPECT_MAX, children: "\u2194\uFE0F" })] })), showReset && (zoomSlider || rotationSlider || aspectSlider) && (jsx(AntButton, { className: "[bottom:20px] [position:absolute]", style: isResetActive ? {} : { opacity: 0.3, pointerEvents: 'none' }, onClick: onReset, children: resetBtnText }))] }));
57
57
  });
58
58
  var EasyCrop$1 = memo(EasyCrop);
59
59
 
@@ -84,8 +84,8 @@ function styleInject(css, ref) {
84
84
  }
85
85
  }
86
86
 
87
- var css_248z = ".container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.visible{visibility:visible}.grid{display:grid}.\\!\\[position\\:relative\\]{position:relative!important}.\\[align-items\\:center\\]{align-items:center}.\\[background\\:transparent\\]{background:transparent}.\\[border\\:0\\]{border:0}.\\[bottom\\:20px\\]{bottom:20px}.\\[cursor\\:pointer\\]{cursor:pointer}.\\[display\\:flex\\]{display:flex}.\\[flex\\:1\\]{flex:1}.\\[font-family\\:inherit\\]{font-family:inherit}.\\[font-size\\:16px\\]{font-size:16px}.\\[font-size\\:18px\\]{font-size:18px}.\\[height\\:32px\\]{height:32px}.\\[height\\:40vh\\]{height:40vh}.\\[justify-content\\:center\\]{justify-content:center}.\\[margin-inline\\:auto\\]{margin-inline:auto}.\\[position\\:absolute\\]{position:absolute}.\\[width\\:100\\%\\]{width:100%}.\\[width\\:32px\\]{width:32px}.\\[width\\:60\\%\\]{width:60%}.disabled\\:\\[cursor\\:default\\]:disabled{cursor:default}.disabled\\:\\[opacity\\:20\\%\\]:disabled{opacity:20%}.\\[\\&\\~section\\:first-of-type\\]\\:\\[margin-top\\:16px\\]~section:first-of-type{margin-top:16px}.\\[\\&\\~section\\:last-of-type\\]\\:\\[margin-bottom\\:16px\\]~section:last-of-type{margin-bottom:16px}";
88
- styleInject(css_248z);
87
+ var css_248z = ".visible{visibility:visible}.grid{display:grid}.\\!\\[position\\:relative\\]{position:relative!important}.\\[align-items\\:center\\]{align-items:center}.\\[background\\:transparent\\]{background:transparent}.\\[border\\:0\\]{border:0}.\\[bottom\\:20px\\]{bottom:20px}.\\[cursor\\:pointer\\]{cursor:pointer}.\\[display\\:flex\\]{display:flex}.\\[flex\\:1\\]{flex:1}.\\[font-family\\:inherit\\]{font-family:inherit}.\\[font-size\\:16px\\]{font-size:16px}.\\[font-size\\:18px\\]{font-size:18px}.\\[height\\:32px\\]{height:32px}.\\[height\\:40vh\\]{height:40vh}.\\[justify-content\\:center\\]{justify-content:center}.\\[margin-inline\\:auto\\]{margin-inline:auto}.\\[position\\:absolute\\]{position:absolute}.\\[width\\:100\\%\\]{width:100%}.\\[width\\:32px\\]{width:32px}.\\[width\\:60\\%\\]{width:60%}.disabled\\:\\[cursor\\:default\\]:disabled{cursor:default}.disabled\\:\\[opacity\\:20\\%\\]:disabled{opacity:20%}.\\[\\&\\~section\\:first-of-type\\]\\:\\[margin-top\\:16px\\]~section:first-of-type{margin-top:16px}.\\[\\&\\~section\\:last-of-type\\]\\:\\[margin-bottom\\:16px\\]~section:last-of-type{margin-bottom:16px}";
88
+ styleInject(css_248z,{"insertAt":"top"});
89
89
 
90
90
  const openProp = compareVersions(version, '4.23.0') === -1 ? 'visible' : 'open';
91
91
  const deprecate = (obj, old, now) => {
@@ -259,7 +259,7 @@ const ImgCrop = forwardRef((props, cropperRef) => {
259
259
  const isCN = lang === 'zh-CN';
260
260
  const title = modalTitle || (isCN ? '编辑图片' : 'Edit image');
261
261
  const resetBtnText = resetText || (isCN ? '重置' : 'Reset');
262
- return (jsxs(Fragment, { children: [uploadComponent, modalImage && (jsx(AntModal, Object.assign({}, modalProps, modalBaseProps, { [openProp]: true }, { title: title, onCancel: onCancel.current, onOk: onOk.current, wrapClassName: wrapClassName, maskClosable: false, destroyOnClose: true }, { children: jsx(EasyCrop$1, { ref: easyCropRef, cropperRef: cropperRef, zoomSlider: zoomSlider, rotationSlider: rotationSlider, aspectSlider: aspectSlider, showReset: showReset, resetBtnText: resetBtnText, modalImage: modalImage, aspect: aspect, minZoom: minZoom, maxZoom: maxZoom, cropShape: cropShape, showGrid: showGrid, cropperProps: cropperProps }) })))] }));
262
+ return (jsxs(Fragment, { children: [uploadComponent, modalImage && (jsx(AntModal, Object.assign({}, modalProps, modalBaseProps, { [openProp]: true, title: title, onCancel: onCancel.current, onOk: onOk.current, wrapClassName: wrapClassName, maskClosable: false, destroyOnClose: true, children: jsx(EasyCrop$1, { ref: easyCropRef, cropperRef: cropperRef, zoomSlider: zoomSlider, rotationSlider: rotationSlider, aspectSlider: aspectSlider, showReset: showReset, resetBtnText: resetBtnText, modalImage: modalImage, aspect: aspect, minZoom: minZoom, maxZoom: maxZoom, cropShape: cropShape, showGrid: showGrid, cropperProps: cropperProps }) })))] }));
263
263
  });
264
264
 
265
265
  export { ImgCrop as default };
@@ -0,0 +1,3 @@
1
+ function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
2
+
3
+ export { clsx, clsx as default };
@@ -0,0 +1,31 @@
1
+ import { validateAndParse, compareSegments } from './utils.js';
2
+
3
+ /**
4
+ * Compare [semver](https://semver.org/) version strings to find greater, equal or lesser.
5
+ * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`.
6
+ * @param v1 - First version to compare
7
+ * @param v2 - Second version to compare
8
+ * @returns Numeric value compatible with the [Array.sort(fn) interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Parameters).
9
+ */
10
+ const compareVersions = (v1, v2) => {
11
+ // validate input and split into segments
12
+ const n1 = validateAndParse(v1);
13
+ const n2 = validateAndParse(v2);
14
+ // pop off the patch
15
+ const p1 = n1.pop();
16
+ const p2 = n2.pop();
17
+ // validate numbers
18
+ const r = compareSegments(n1, n2);
19
+ if (r !== 0)
20
+ return r;
21
+ // validate pre-release
22
+ if (p1 && p2) {
23
+ return compareSegments(p1.split('.'), p2.split('.'));
24
+ }
25
+ else if (p1 || p2) {
26
+ return p1 ? -1 : 1;
27
+ }
28
+ return 0;
29
+ };
30
+
31
+ export { compareVersions };
@@ -1,30 +1,3 @@
1
- /**
2
- * Compare [semver](https://semver.org/) version strings to find greater, equal or lesser.
3
- * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`.
4
- * @param v1 - First version to compare
5
- * @param v2 - Second version to compare
6
- * @returns Numeric value compatible with the [Array.sort(fn) interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Parameters).
7
- */
8
- const compareVersions = (v1, v2) => {
9
- // validate input and split into segments
10
- const n1 = validateAndParse(v1);
11
- const n2 = validateAndParse(v2);
12
- // pop off the patch
13
- const p1 = n1.pop();
14
- const p2 = n2.pop();
15
- // validate numbers
16
- const r = compareSegments(n1, n2);
17
- if (r !== 0)
18
- return r;
19
- // validate pre-release
20
- if (p1 && p2) {
21
- return compareSegments(p1.split('.'), p2.split('.'));
22
- }
23
- else if (p1 || p2) {
24
- return p1 ? -1 : 1;
25
- }
26
- return 0;
27
- };
28
1
  const semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
29
2
  const validateAndParse = (version) => {
30
3
  if (typeof version !== 'string') {
@@ -62,4 +35,4 @@ const compareSegments = (a, b) => {
62
35
  return 0;
63
36
  };
64
37
 
65
- export { compareVersions };
38
+ export { compareSegments, semver, validateAndParse };
@@ -0,0 +1,99 @@
1
+ /*
2
+ object-assign
3
+ (c) Sindre Sorhus
4
+ @license MIT
5
+ */
6
+
7
+ var objectAssign;
8
+ var hasRequiredObjectAssign;
9
+
10
+ function requireObjectAssign () {
11
+ if (hasRequiredObjectAssign) return objectAssign;
12
+ hasRequiredObjectAssign = 1;
13
+ /* eslint-disable no-unused-vars */
14
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
15
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
16
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
17
+
18
+ function toObject(val) {
19
+ if (val === null || val === undefined) {
20
+ throw new TypeError('Object.assign cannot be called with null or undefined');
21
+ }
22
+
23
+ return Object(val);
24
+ }
25
+
26
+ function shouldUseNative() {
27
+ try {
28
+ if (!Object.assign) {
29
+ return false;
30
+ }
31
+
32
+ // Detect buggy property enumeration order in older V8 versions.
33
+
34
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
35
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
36
+ test1[5] = 'de';
37
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
38
+ return false;
39
+ }
40
+
41
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
42
+ var test2 = {};
43
+ for (var i = 0; i < 10; i++) {
44
+ test2['_' + String.fromCharCode(i)] = i;
45
+ }
46
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
47
+ return test2[n];
48
+ });
49
+ if (order2.join('') !== '0123456789') {
50
+ return false;
51
+ }
52
+
53
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
54
+ var test3 = {};
55
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
56
+ test3[letter] = letter;
57
+ });
58
+ if (Object.keys(Object.assign({}, test3)).join('') !==
59
+ 'abcdefghijklmnopqrst') {
60
+ return false;
61
+ }
62
+
63
+ return true;
64
+ } catch (err) {
65
+ // We don't expect any of the above to throw, but better to be safe.
66
+ return false;
67
+ }
68
+ }
69
+
70
+ objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
71
+ var from;
72
+ var to = toObject(target);
73
+ var symbols;
74
+
75
+ for (var s = 1; s < arguments.length; s++) {
76
+ from = Object(arguments[s]);
77
+
78
+ for (var key in from) {
79
+ if (hasOwnProperty.call(from, key)) {
80
+ to[key] = from[key];
81
+ }
82
+ }
83
+
84
+ if (getOwnPropertySymbols) {
85
+ symbols = getOwnPropertySymbols(from);
86
+ for (var i = 0; i < symbols.length; i++) {
87
+ if (propIsEnumerable.call(from, symbols[i])) {
88
+ to[symbols[i]] = from[symbols[i]];
89
+ }
90
+ }
91
+ }
92
+ }
93
+
94
+ return to;
95
+ };
96
+ return objectAssign;
97
+ }
98
+
99
+ export { requireObjectAssign as __require };
@@ -0,0 +1,115 @@
1
+ import { __require as requireReactPropTypesSecret } from './lib/ReactPropTypesSecret.js';
2
+ import { __require as requireHas } from './lib/has.js';
3
+
4
+ /**
5
+ * Copyright (c) 2013-present, Facebook, Inc.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */
10
+
11
+ var checkPropTypes_1;
12
+ var hasRequiredCheckPropTypes;
13
+
14
+ function requireCheckPropTypes () {
15
+ if (hasRequiredCheckPropTypes) return checkPropTypes_1;
16
+ hasRequiredCheckPropTypes = 1;
17
+
18
+ var printWarning = function() {};
19
+
20
+ if (process.env.NODE_ENV !== 'production') {
21
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
22
+ var loggedTypeFailures = {};
23
+ var has = requireHas();
24
+
25
+ printWarning = function(text) {
26
+ var message = 'Warning: ' + text;
27
+ if (typeof console !== 'undefined') {
28
+ console.error(message);
29
+ }
30
+ try {
31
+ // --- Welcome to debugging React ---
32
+ // This error was thrown as a convenience so that you can use this stack
33
+ // to find the callsite that caused this warning to fire.
34
+ throw new Error(message);
35
+ } catch (x) { /**/ }
36
+ };
37
+ }
38
+
39
+ /**
40
+ * Assert that the values match with the type specs.
41
+ * Error messages are memorized and will only be shown once.
42
+ *
43
+ * @param {object} typeSpecs Map of name to a ReactPropType
44
+ * @param {object} values Runtime values that need to be type-checked
45
+ * @param {string} location e.g. "prop", "context", "child context"
46
+ * @param {string} componentName Name of the component for error messages.
47
+ * @param {?Function} getStack Returns the component stack.
48
+ * @private
49
+ */
50
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
51
+ if (process.env.NODE_ENV !== 'production') {
52
+ for (var typeSpecName in typeSpecs) {
53
+ if (has(typeSpecs, typeSpecName)) {
54
+ var error;
55
+ // Prop type validation may throw. In case they do, we don't want to
56
+ // fail the render phase where it didn't fail before. So we log it.
57
+ // After these have been cleaned up, we'll let them throw.
58
+ try {
59
+ // This is intentionally an invariant that gets caught. It's the same
60
+ // behavior as without this statement except with a better message.
61
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
62
+ var err = Error(
63
+ (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
64
+ 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
65
+ 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
66
+ );
67
+ err.name = 'Invariant Violation';
68
+ throw err;
69
+ }
70
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
71
+ } catch (ex) {
72
+ error = ex;
73
+ }
74
+ if (error && !(error instanceof Error)) {
75
+ printWarning(
76
+ (componentName || 'React class') + ': type specification of ' +
77
+ location + ' `' + typeSpecName + '` is invalid; the type checker ' +
78
+ 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
79
+ 'You may have forgotten to pass an argument to the type checker ' +
80
+ 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
81
+ 'shape all require an argument).'
82
+ );
83
+ }
84
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
85
+ // Only monitor this failure once because there tends to be a lot of the
86
+ // same error.
87
+ loggedTypeFailures[error.message] = true;
88
+
89
+ var stack = getStack ? getStack() : '';
90
+
91
+ printWarning(
92
+ 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
93
+ );
94
+ }
95
+ }
96
+ }
97
+ }
98
+ }
99
+
100
+ /**
101
+ * Resets warning cache when testing.
102
+ *
103
+ * @private
104
+ */
105
+ checkPropTypes.resetWarningCache = function() {
106
+ if (process.env.NODE_ENV !== 'production') {
107
+ loggedTypeFailures = {};
108
+ }
109
+ };
110
+
111
+ checkPropTypes_1 = checkPropTypes;
112
+ return checkPropTypes_1;
113
+ }
114
+
115
+ export { requireCheckPropTypes as __require };