@m4l/components 0.1.26 → 0.1.28

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 (112) hide show
  1. package/assets/Logo/index.228dcb5a.js +42 -35
  2. package/commonjs.565e6834.js +5 -5
  3. package/components/CommonActions/components/ActionCancel/index.e498eeb2.js +17 -0
  4. package/components/CommonActions/components/ActionFormCancel/index.4ff0ad73.js +64 -0
  5. package/components/CommonActions/components/ActionFormIntro/index.ca4d2674.js +28 -22
  6. package/components/CommonActions/components/ActionIntro/index.60ef7bd7.js +18 -0
  7. package/components/CommonActions/components/Actions/index.0645e30f.js +867 -0
  8. package/components/DataGrid/index.76d8fd25.js +1075 -0
  9. package/components/DynamicFilter/index.342ba5fe.js +1577 -0
  10. package/components/ErrorLabel/index.c8615f16.js +13 -12
  11. package/components/Icon/index.619c31c4.js +96 -0
  12. package/components/Icon/types.d.ts +2 -1
  13. package/components/Image/index.93d5f37f.js +190 -0
  14. package/components/Loadable/index.f5518558.js +8 -8
  15. package/components/ModalDialog/index.9ea10764.js +184 -0
  16. package/components/NoItemSelected/{index.9609a7f7.js → index.46d2f632.js} +52 -41
  17. package/components/ObjectLogs/index.f941fb79.js +288 -0
  18. package/components/Page/index.4237c241.js +22 -20
  19. package/components/PaperForm/index.ec9cb8c9.js +112 -0
  20. package/components/Period/index.2941fbda.js +249 -0
  21. package/components/PropertyValue/index.dfcfe1ba.js +147 -0
  22. package/components/PropertyValue/styles.d.ts +2 -1
  23. package/components/PropertyValue/types.d.ts +3 -3
  24. package/components/Resizeable/index.45995d2b.js +19 -19
  25. package/components/ScrollBar/index.39eeb2de.js +26 -21
  26. package/components/ScrollToTop/index.e06f98f6.js +8 -7
  27. package/components/SplitLayout/index.4032673d.js +35 -33
  28. package/components/animate/LoadingScreen/index.1d0c4307.js +33 -33
  29. package/components/animate/MotionContainer/index.8d9f9d80.js +25 -22
  30. package/components/animate/MotionLazyContainer/index.572dd012.js +10 -10
  31. package/components/animate/features.0fbf41e1.js +3 -3
  32. package/components/animate/variants/bounce.784aaaaa.js +16 -13
  33. package/components/animate/variants/container.11f82b76.js +8 -6
  34. package/components/animate/variants/fade.b561c0fc.js +32 -28
  35. package/components/animate/variants/transition.bd46b9ce.js +17 -12
  36. package/components/formatters/BooleanFormatter/index.8da35c9c.js +55 -0
  37. package/components/formatters/DateFormatter/index.1b9baacc.js +69 -0
  38. package/components/formatters/index.689a8086.js +119 -0
  39. package/components/hook-form/RHFAutocomplete/index.59a68f9f.js +224 -0
  40. package/components/hook-form/RHFAutocompleteAsync/index.c3083062.js +87 -0
  41. package/components/hook-form/RHFCheckbox/index.6dcec9e2.js +49 -39
  42. package/components/hook-form/RHFDateTime/index.9231a7c7.js +69 -56
  43. package/components/hook-form/RHFMultiCheckbox/index.2680b3b6.js +23 -23
  44. package/components/hook-form/RHFPeriod/index.64a228d5.js +55 -0
  45. package/components/hook-form/RHFRadioGroup/index.b3335e13.js +29 -29
  46. package/components/hook-form/RHFSelect/index.b6ca8bb2.js +24 -24
  47. package/components/hook-form/RHFTextField/index.f9aaaa90.js +146 -0
  48. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/index.d.ts +0 -0
  49. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/styles.d.ts +4 -3
  50. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/subcomponents/Skeleton/index.d.ts +0 -0
  51. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/subcomponents/Skeleton/styles.d.ts +0 -0
  52. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/types.d.ts +0 -0
  53. package/components/hook-form/RHFUpload/index.d5cc7c13.js +285 -0
  54. package/components/mui_extended/Accordion/index.a02ac6ae.js +107 -0
  55. package/components/mui_extended/Avatar/index.fe06afd7.js +51 -0
  56. package/components/mui_extended/BoxIcon/index.e638ecc8.js +10 -10
  57. package/components/mui_extended/Breadcrumbs/index.5e37d903.js +49 -44
  58. package/components/mui_extended/Button/index.53b56958.js +178 -0
  59. package/components/mui_extended/CircularProgress/index.ad569afd.js +8 -6
  60. package/components/mui_extended/IconButton/index.a321e5cb.js +120 -0
  61. package/components/mui_extended/IconButton/index.d.ts +1 -1
  62. package/components/mui_extended/LinkWithRoute/index.16436ab8.js +25 -21
  63. package/components/mui_extended/Pager/index.c0865b70.js +141 -0
  64. package/components/mui_extended/Popover/index.705275a4.js +278 -0
  65. package/components/mui_extended/Tab/index.e0653a0a.js +25 -21
  66. package/components/mui_extended/Typography/index.e5494696.js +25 -21
  67. package/contexts/ModalContext/index.b92fa565.js +153 -0
  68. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/index.d.ts +0 -0
  69. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/styles.d.ts +0 -0
  70. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/types.d.ts +0 -0
  71. package/contexts/RHFormContext/index.b142190a.js +63 -0
  72. package/hooks/useFormAddEdit/index.d4845f1a.js +40 -22
  73. package/hooks/useModal/index.5fee01a3.js +11 -0
  74. package/index.js +153 -153
  75. package/package.json +2 -1
  76. package/react-data-grid.d46d625e.js +2206 -1663
  77. package/react-draggable.20e95c61.js +800 -553
  78. package/react-json-view.f56a7f8e.js +2344 -2340
  79. package/react-resizable.5277deaf.js +470 -298
  80. package/react-splitter-layout.7810ac1b.js +130 -128
  81. package/utils/index.214d9542.js +500 -354
  82. package/components/CommonActions/components/ActionCancel/index.6736b782.js +0 -17
  83. package/components/CommonActions/components/ActionFormCancel/index.281ee166.js +0 -49
  84. package/components/CommonActions/components/ActionIntro/index.4665a611.js +0 -18
  85. package/components/CommonActions/components/Actions/index.cd7b2671.js +0 -742
  86. package/components/DataGrid/index.2caf6231.js +0 -894
  87. package/components/DynamicFilter/index.f2377369.js +0 -1157
  88. package/components/Icon/index.f569765b.js +0 -82
  89. package/components/Image/index.c9da2d5a.js +0 -152
  90. package/components/ModalDialog/index.bee344a5.js +0 -168
  91. package/components/ObjectLogs/index.6b6f95e6.js +0 -266
  92. package/components/PaperForm/index.3f8c7ef2.js +0 -105
  93. package/components/Period/index.a112ce37.js +0 -175
  94. package/components/PropertyValue/index.ab3dd7e9.js +0 -116
  95. package/components/contexts/RHFormContext/index.33dba822.js +0 -56
  96. package/components/formatters/BooleanFormatter/index.3ec56305.js +0 -42
  97. package/components/formatters/DateFormatter/index.08d8823b.js +0 -57
  98. package/components/formatters/index.6959c2de.js +0 -106
  99. package/components/hook-form/RHFAutocomplete/index.5eee9d7c.js +0 -174
  100. package/components/hook-form/RHFAutocompleteAsync/index.757b5080.js +0 -65
  101. package/components/hook-form/RHFPeriod/index.979d0898.js +0 -51
  102. package/components/hook-form/RHFTextField/index.ba2a8f67.js +0 -129
  103. package/components/hook-form/RHFUpload/index.6347159a.js +0 -258
  104. package/components/mui_extended/Accordion/index.49f5df8e.js +0 -103
  105. package/components/mui_extended/Avatar/index.dadb0528.js +0 -37
  106. package/components/mui_extended/Button/index.52d18aea.js +0 -144
  107. package/components/mui_extended/IconButton/index.4b5ce8b5.js +0 -103
  108. package/components/mui_extended/Pager/index.951b6975.js +0 -126
  109. package/components/mui_extended/Popover/index.4da8587a.js +0 -252
  110. package/contexts/ModalContext/index.5388dfd5.js +0 -136
  111. package/hooks/useModal/index.3b1ff084.js +0 -11
  112. package/node_modules.168cb897.js +0 -55
@@ -1,164 +1,226 @@
1
- import de from "react";
2
- import pe from "prop-types";
3
- import ge from "react-dom";
4
- import Ie from "clsx";
5
- import { s as ye, l as ve, d as he, p as me } from "./utils/index.214d9542.js";
6
- var re = { exports: {} }, be = {}, L = {};
7
- function V(r) {
8
- return V = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(a) {
9
- return typeof a;
10
- } : function(a) {
11
- return a && typeof Symbol == "function" && a.constructor === Symbol && a !== Symbol.prototype ? "symbol" : typeof a;
12
- }, V(r);
1
+ import React$1 from "react";
2
+ import require$$1 from "prop-types";
3
+ import require$$2 from "react-dom";
4
+ import clsx from "clsx";
5
+ import { s as shims, l as log, d as domFns, p as positionFns } from "./utils/index.214d9542.js";
6
+ var cjs = { exports: {} };
7
+ var Draggable$1 = {};
8
+ var DraggableCore$2 = {};
9
+ function _typeof(obj) {
10
+ "@babel/helpers - typeof";
11
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
12
+ return typeof obj2;
13
+ } : function(obj2) {
14
+ return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
15
+ }, _typeof(obj);
13
16
  }
14
- Object.defineProperty(L, "__esModule", {
15
- value: !0
17
+ Object.defineProperty(DraggableCore$2, "__esModule", {
18
+ value: true
16
19
  });
17
- L.default = void 0;
18
- var Z = We(de), w = ne(pe), Ue = ne(ge), _ = he, j = me, ee = ye, F = ne(ve);
19
- function ne(r) {
20
- return r && r.__esModule ? r : { default: r };
20
+ DraggableCore$2.default = void 0;
21
+ var React = _interopRequireWildcard(React$1);
22
+ var _propTypes = _interopRequireDefault(require$$1);
23
+ var _reactDom = _interopRequireDefault(require$$2);
24
+ var _domFns = domFns;
25
+ var _positionFns = positionFns;
26
+ var _shims = shims;
27
+ var _log = _interopRequireDefault(log);
28
+ function _interopRequireDefault(obj) {
29
+ return obj && obj.__esModule ? obj : { default: obj };
21
30
  }
22
- function De(r) {
23
- if (typeof WeakMap != "function")
31
+ function _getRequireWildcardCache(nodeInterop) {
32
+ if (typeof WeakMap !== "function")
24
33
  return null;
25
- var a = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap();
26
- return (De = function(d) {
27
- return d ? l : a;
28
- })(r);
34
+ var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
35
+ var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
36
+ return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
37
+ return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
38
+ })(nodeInterop);
29
39
  }
30
- function We(r, a) {
31
- if (!a && r && r.__esModule)
32
- return r;
33
- if (r === null || V(r) !== "object" && typeof r != "function")
34
- return { default: r };
35
- var l = De(a);
36
- if (l && l.has(r))
37
- return l.get(r);
38
- var e = {}, d = Object.defineProperty && Object.getOwnPropertyDescriptor;
39
- for (var p in r)
40
- if (p !== "default" && Object.prototype.hasOwnProperty.call(r, p)) {
41
- var h = d ? Object.getOwnPropertyDescriptor(r, p) : null;
42
- h && (h.get || h.set) ? Object.defineProperty(e, p, h) : e[p] = r[p];
40
+ function _interopRequireWildcard(obj, nodeInterop) {
41
+ if (!nodeInterop && obj && obj.__esModule) {
42
+ return obj;
43
+ }
44
+ if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
45
+ return { default: obj };
46
+ }
47
+ var cache = _getRequireWildcardCache(nodeInterop);
48
+ if (cache && cache.has(obj)) {
49
+ return cache.get(obj);
50
+ }
51
+ var newObj = {};
52
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
53
+ for (var key in obj) {
54
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
55
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
56
+ if (desc && (desc.get || desc.set)) {
57
+ Object.defineProperty(newObj, key, desc);
58
+ } else {
59
+ newObj[key] = obj[key];
60
+ }
43
61
  }
44
- return e.default = r, l && l.set(r, e), e;
62
+ }
63
+ newObj.default = obj;
64
+ if (cache) {
65
+ cache.set(obj, newObj);
66
+ }
67
+ return newObj;
45
68
  }
46
- function fe(r, a) {
47
- return Xe(r) || Fe(r, a) || qe(r, a) || $e();
69
+ function _slicedToArray(arr, i) {
70
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
48
71
  }
49
- function $e() {
50
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
51
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
72
+ function _nonIterableRest() {
73
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
52
74
  }
53
- function qe(r, a) {
54
- if (!!r) {
55
- if (typeof r == "string")
56
- return se(r, a);
57
- var l = Object.prototype.toString.call(r).slice(8, -1);
58
- if (l === "Object" && r.constructor && (l = r.constructor.name), l === "Map" || l === "Set")
59
- return Array.from(r);
60
- if (l === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))
61
- return se(r, a);
62
- }
75
+ function _unsupportedIterableToArray(o, minLen) {
76
+ if (!o)
77
+ return;
78
+ if (typeof o === "string")
79
+ return _arrayLikeToArray(o, minLen);
80
+ var n = Object.prototype.toString.call(o).slice(8, -1);
81
+ if (n === "Object" && o.constructor)
82
+ n = o.constructor.name;
83
+ if (n === "Map" || n === "Set")
84
+ return Array.from(o);
85
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
86
+ return _arrayLikeToArray(o, minLen);
63
87
  }
64
- function se(r, a) {
65
- (a == null || a > r.length) && (a = r.length);
66
- for (var l = 0, e = new Array(a); l < a; l++)
67
- e[l] = r[l];
68
- return e;
88
+ function _arrayLikeToArray(arr, len) {
89
+ if (len == null || len > arr.length)
90
+ len = arr.length;
91
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
92
+ arr2[i] = arr[i];
93
+ }
94
+ return arr2;
69
95
  }
70
- function Fe(r, a) {
71
- var l = r == null ? null : typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
72
- if (l != null) {
73
- var e = [], d = !0, p = !1, h, s;
96
+ function _iterableToArrayLimit(arr, i) {
97
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
98
+ if (_i == null)
99
+ return;
100
+ var _arr = [];
101
+ var _n = true;
102
+ var _d = false;
103
+ var _s, _e;
104
+ try {
105
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
106
+ _arr.push(_s.value);
107
+ if (i && _arr.length === i)
108
+ break;
109
+ }
110
+ } catch (err) {
111
+ _d = true;
112
+ _e = err;
113
+ } finally {
74
114
  try {
75
- for (l = l.call(r); !(d = (h = l.next()).done) && (e.push(h.value), !(a && e.length === a)); d = !0)
76
- ;
77
- } catch (v) {
78
- p = !0, s = v;
115
+ if (!_n && _i["return"] != null)
116
+ _i["return"]();
79
117
  } finally {
80
- try {
81
- !d && l.return != null && l.return();
82
- } finally {
83
- if (p)
84
- throw s;
85
- }
118
+ if (_d)
119
+ throw _e;
86
120
  }
87
- return e;
88
121
  }
122
+ return _arr;
89
123
  }
90
- function Xe(r) {
91
- if (Array.isArray(r))
92
- return r;
124
+ function _arrayWithHoles(arr) {
125
+ if (Array.isArray(arr))
126
+ return arr;
93
127
  }
94
- function Ye(r, a) {
95
- if (!(r instanceof a))
128
+ function _classCallCheck(instance, Constructor) {
129
+ if (!(instance instanceof Constructor)) {
96
130
  throw new TypeError("Cannot call a class as a function");
131
+ }
97
132
  }
98
- function ce(r, a) {
99
- for (var l = 0; l < a.length; l++) {
100
- var e = a[l];
101
- e.enumerable = e.enumerable || !1, e.configurable = !0, "value" in e && (e.writable = !0), Object.defineProperty(r, e.key, e);
133
+ function _defineProperties(target, props) {
134
+ for (var i = 0; i < props.length; i++) {
135
+ var descriptor = props[i];
136
+ descriptor.enumerable = descriptor.enumerable || false;
137
+ descriptor.configurable = true;
138
+ if ("value" in descriptor)
139
+ descriptor.writable = true;
140
+ Object.defineProperty(target, descriptor.key, descriptor);
102
141
  }
103
142
  }
104
- function Be(r, a, l) {
105
- return a && ce(r.prototype, a), l && ce(r, l), Object.defineProperty(r, "prototype", { writable: !1 }), r;
143
+ function _createClass(Constructor, protoProps, staticProps) {
144
+ if (protoProps)
145
+ _defineProperties(Constructor.prototype, protoProps);
146
+ if (staticProps)
147
+ _defineProperties(Constructor, staticProps);
148
+ Object.defineProperty(Constructor, "prototype", { writable: false });
149
+ return Constructor;
106
150
  }
107
- function He(r, a) {
108
- if (typeof a != "function" && a !== null)
151
+ function _inherits(subClass, superClass) {
152
+ if (typeof superClass !== "function" && superClass !== null) {
109
153
  throw new TypeError("Super expression must either be null or a function");
110
- r.prototype = Object.create(a && a.prototype, { constructor: { value: r, writable: !0, configurable: !0 } }), Object.defineProperty(r, "prototype", { writable: !1 }), a && te(r, a);
154
+ }
155
+ subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
156
+ Object.defineProperty(subClass, "prototype", { writable: false });
157
+ if (superClass)
158
+ _setPrototypeOf(subClass, superClass);
111
159
  }
112
- function te(r, a) {
113
- return te = Object.setPrototypeOf || function(e, d) {
114
- return e.__proto__ = d, e;
115
- }, te(r, a);
160
+ function _setPrototypeOf(o, p) {
161
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
162
+ o2.__proto__ = p2;
163
+ return o2;
164
+ };
165
+ return _setPrototypeOf(o, p);
116
166
  }
117
- function Ve(r) {
118
- var a = Le();
119
- return function() {
120
- var e = G(r), d;
121
- if (a) {
122
- var p = G(this).constructor;
123
- d = Reflect.construct(e, arguments, p);
124
- } else
125
- d = e.apply(this, arguments);
126
- return Ge(this, d);
167
+ function _createSuper(Derived) {
168
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
169
+ return function _createSuperInternal() {
170
+ var Super = _getPrototypeOf(Derived), result;
171
+ if (hasNativeReflectConstruct) {
172
+ var NewTarget = _getPrototypeOf(this).constructor;
173
+ result = Reflect.construct(Super, arguments, NewTarget);
174
+ } else {
175
+ result = Super.apply(this, arguments);
176
+ }
177
+ return _possibleConstructorReturn(this, result);
127
178
  };
128
179
  }
129
- function Ge(r, a) {
130
- if (a && (V(a) === "object" || typeof a == "function"))
131
- return a;
132
- if (a !== void 0)
180
+ function _possibleConstructorReturn(self, call) {
181
+ if (call && (_typeof(call) === "object" || typeof call === "function")) {
182
+ return call;
183
+ } else if (call !== void 0) {
133
184
  throw new TypeError("Derived constructors may only return object or undefined");
134
- return S(r);
185
+ }
186
+ return _assertThisInitialized(self);
135
187
  }
136
- function S(r) {
137
- if (r === void 0)
188
+ function _assertThisInitialized(self) {
189
+ if (self === void 0) {
138
190
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
139
- return r;
191
+ }
192
+ return self;
140
193
  }
141
- function Le() {
142
- if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
143
- return !1;
144
- if (typeof Proxy == "function")
145
- return !0;
194
+ function _isNativeReflectConstruct() {
195
+ if (typeof Reflect === "undefined" || !Reflect.construct)
196
+ return false;
197
+ if (Reflect.construct.sham)
198
+ return false;
199
+ if (typeof Proxy === "function")
200
+ return true;
146
201
  try {
147
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
148
- })), !0;
149
- } catch {
150
- return !1;
202
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
203
+ }));
204
+ return true;
205
+ } catch (e) {
206
+ return false;
151
207
  }
152
208
  }
153
- function G(r) {
154
- return G = Object.setPrototypeOf ? Object.getPrototypeOf : function(l) {
155
- return l.__proto__ || Object.getPrototypeOf(l);
156
- }, G(r);
209
+ function _getPrototypeOf(o) {
210
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o2) {
211
+ return o2.__proto__ || Object.getPrototypeOf(o2);
212
+ };
213
+ return _getPrototypeOf(o);
157
214
  }
158
- function P(r, a, l) {
159
- return a in r ? Object.defineProperty(r, a, { value: l, enumerable: !0, configurable: !0, writable: !0 }) : r[a] = l, r;
215
+ function _defineProperty(obj, key, value) {
216
+ if (key in obj) {
217
+ Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
218
+ } else {
219
+ obj[key] = value;
220
+ }
221
+ return obj;
160
222
  }
161
- var N = {
223
+ var eventsFor = {
162
224
  touch: {
163
225
  start: "touchstart",
164
226
  move: "touchmove",
@@ -169,532 +231,717 @@ var N = {
169
231
  move: "mousemove",
170
232
  stop: "mouseup"
171
233
  }
172
- }, k = N.mouse, z = /* @__PURE__ */ function(r) {
173
- He(l, r);
174
- var a = Ve(l);
175
- function l() {
176
- var e;
177
- Ye(this, l);
178
- for (var d = arguments.length, p = new Array(d), h = 0; h < d; h++)
179
- p[h] = arguments[h];
180
- return e = a.call.apply(a, [this].concat(p)), P(S(e), "state", {
181
- dragging: !1,
234
+ };
235
+ var dragEventFor = eventsFor.mouse;
236
+ var DraggableCore$1 = /* @__PURE__ */ function(_React$Component) {
237
+ _inherits(DraggableCore2, _React$Component);
238
+ var _super = _createSuper(DraggableCore2);
239
+ function DraggableCore2() {
240
+ var _this;
241
+ _classCallCheck(this, DraggableCore2);
242
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
243
+ args[_key] = arguments[_key];
244
+ }
245
+ _this = _super.call.apply(_super, [this].concat(args));
246
+ _defineProperty(_assertThisInitialized(_this), "state", {
247
+ dragging: false,
182
248
  lastX: NaN,
183
249
  lastY: NaN,
184
250
  touchIdentifier: null
185
- }), P(S(e), "mounted", !1), P(S(e), "handleDragStart", function(s) {
186
- if (e.props.onMouseDown(s), !e.props.allowAnyClick && typeof s.button == "number" && s.button !== 0)
187
- return !1;
188
- var v = e.findDOMNode();
189
- if (!v || !v.ownerDocument || !v.ownerDocument.body)
251
+ });
252
+ _defineProperty(_assertThisInitialized(_this), "mounted", false);
253
+ _defineProperty(_assertThisInitialized(_this), "handleDragStart", function(e) {
254
+ _this.props.onMouseDown(e);
255
+ if (!_this.props.allowAnyClick && typeof e.button === "number" && e.button !== 0)
256
+ return false;
257
+ var thisNode = _this.findDOMNode();
258
+ if (!thisNode || !thisNode.ownerDocument || !thisNode.ownerDocument.body) {
190
259
  throw new Error("<DraggableCore> not mounted on DragStart!");
191
- var m = v.ownerDocument;
192
- if (!(e.props.disabled || !(s.target instanceof m.defaultView.Node) || e.props.handle && !(0, _.matchesSelectorAndParentsTo)(s.target, e.props.handle, v) || e.props.cancel && (0, _.matchesSelectorAndParentsTo)(s.target, e.props.cancel, v))) {
193
- s.type === "touchstart" && s.preventDefault();
194
- var D = (0, _.getTouchIdentifier)(s);
195
- e.setState({
196
- touchIdentifier: D
197
- });
198
- var O = (0, j.getControlPosition)(s, D, S(e));
199
- if (O != null) {
200
- var b = O.x, E = O.y, M = (0, j.createCoreData)(S(e), b, E);
201
- (0, F.default)("DraggableCore: handleDragStart: %j", M), (0, F.default)("calling", e.props.onStart);
202
- var x = e.props.onStart(s, M);
203
- x === !1 || e.mounted === !1 || (e.props.enableUserSelectHack && (0, _.addUserSelectStyles)(m), e.setState({
204
- dragging: !0,
205
- lastX: b,
206
- lastY: E
207
- }), (0, _.addEvent)(m, k.move, e.handleDrag), (0, _.addEvent)(m, k.stop, e.handleDragStop));
208
- }
209
260
  }
210
- }), P(S(e), "handleDrag", function(s) {
211
- var v = (0, j.getControlPosition)(s, e.state.touchIdentifier, S(e));
212
- if (v != null) {
213
- var m = v.x, D = v.y;
214
- if (Array.isArray(e.props.grid)) {
215
- var O = m - e.state.lastX, b = D - e.state.lastY, E = (0, j.snapToGrid)(e.props.grid, O, b), M = fe(E, 2);
216
- if (O = M[0], b = M[1], !O && !b)
217
- return;
218
- m = e.state.lastX + O, D = e.state.lastY + b;
219
- }
220
- var x = (0, j.createCoreData)(S(e), m, D);
221
- (0, F.default)("DraggableCore: handleDrag: %j", x);
222
- var $ = e.props.onDrag(s, x);
223
- if ($ === !1 || e.mounted === !1) {
224
- try {
225
- e.handleDragStop(new MouseEvent("mouseup"));
226
- } catch {
227
- var C = document.createEvent("MouseEvents");
228
- C.initMouseEvent("mouseup", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), e.handleDragStop(C);
229
- }
261
+ var ownerDocument = thisNode.ownerDocument;
262
+ if (_this.props.disabled || !(e.target instanceof ownerDocument.defaultView.Node) || _this.props.handle && !(0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.handle, thisNode) || _this.props.cancel && (0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.cancel, thisNode)) {
263
+ return;
264
+ }
265
+ if (e.type === "touchstart")
266
+ e.preventDefault();
267
+ var touchIdentifier = (0, _domFns.getTouchIdentifier)(e);
268
+ _this.setState({
269
+ touchIdentifier
270
+ });
271
+ var position = (0, _positionFns.getControlPosition)(e, touchIdentifier, _assertThisInitialized(_this));
272
+ if (position == null)
273
+ return;
274
+ var x = position.x, y = position.y;
275
+ var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y);
276
+ (0, _log.default)("DraggableCore: handleDragStart: %j", coreEvent);
277
+ (0, _log.default)("calling", _this.props.onStart);
278
+ var shouldUpdate = _this.props.onStart(e, coreEvent);
279
+ if (shouldUpdate === false || _this.mounted === false)
280
+ return;
281
+ if (_this.props.enableUserSelectHack)
282
+ (0, _domFns.addUserSelectStyles)(ownerDocument);
283
+ _this.setState({
284
+ dragging: true,
285
+ lastX: x,
286
+ lastY: y
287
+ });
288
+ (0, _domFns.addEvent)(ownerDocument, dragEventFor.move, _this.handleDrag);
289
+ (0, _domFns.addEvent)(ownerDocument, dragEventFor.stop, _this.handleDragStop);
290
+ });
291
+ _defineProperty(_assertThisInitialized(_this), "handleDrag", function(e) {
292
+ var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _assertThisInitialized(_this));
293
+ if (position == null)
294
+ return;
295
+ var x = position.x, y = position.y;
296
+ if (Array.isArray(_this.props.grid)) {
297
+ var deltaX = x - _this.state.lastX, deltaY = y - _this.state.lastY;
298
+ var _snapToGrid = (0, _positionFns.snapToGrid)(_this.props.grid, deltaX, deltaY);
299
+ var _snapToGrid2 = _slicedToArray(_snapToGrid, 2);
300
+ deltaX = _snapToGrid2[0];
301
+ deltaY = _snapToGrid2[1];
302
+ if (!deltaX && !deltaY)
230
303
  return;
231
- }
232
- e.setState({
233
- lastX: m,
234
- lastY: D
235
- });
304
+ x = _this.state.lastX + deltaX, y = _this.state.lastY + deltaY;
236
305
  }
237
- }), P(S(e), "handleDragStop", function(s) {
238
- if (!!e.state.dragging) {
239
- var v = (0, j.getControlPosition)(s, e.state.touchIdentifier, S(e));
240
- if (v != null) {
241
- var m = v.x, D = v.y;
242
- if (Array.isArray(e.props.grid)) {
243
- var O = m - e.state.lastX || 0, b = D - e.state.lastY || 0, E = (0, j.snapToGrid)(e.props.grid, O, b), M = fe(E, 2);
244
- O = M[0], b = M[1], m = e.state.lastX + O, D = e.state.lastY + b;
245
- }
246
- var x = (0, j.createCoreData)(S(e), m, D), $ = e.props.onStop(s, x);
247
- if ($ === !1 || e.mounted === !1)
248
- return !1;
249
- var C = e.findDOMNode();
250
- C && e.props.enableUserSelectHack && (0, _.removeUserSelectStyles)(C.ownerDocument), (0, F.default)("DraggableCore: handleDragStop: %j", x), e.setState({
251
- dragging: !1,
252
- lastX: NaN,
253
- lastY: NaN
254
- }), C && ((0, F.default)("DraggableCore: Removing handlers"), (0, _.removeEvent)(C.ownerDocument, k.move, e.handleDrag), (0, _.removeEvent)(C.ownerDocument, k.stop, e.handleDragStop));
306
+ var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y);
307
+ (0, _log.default)("DraggableCore: handleDrag: %j", coreEvent);
308
+ var shouldUpdate = _this.props.onDrag(e, coreEvent);
309
+ if (shouldUpdate === false || _this.mounted === false) {
310
+ try {
311
+ _this.handleDragStop(new MouseEvent("mouseup"));
312
+ } catch (err) {
313
+ var event = document.createEvent("MouseEvents");
314
+ event.initMouseEvent("mouseup", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
315
+ _this.handleDragStop(event);
255
316
  }
317
+ return;
256
318
  }
257
- }), P(S(e), "onMouseDown", function(s) {
258
- return k = N.mouse, e.handleDragStart(s);
259
- }), P(S(e), "onMouseUp", function(s) {
260
- return k = N.mouse, e.handleDragStop(s);
261
- }), P(S(e), "onTouchStart", function(s) {
262
- return k = N.touch, e.handleDragStart(s);
263
- }), P(S(e), "onTouchEnd", function(s) {
264
- return k = N.touch, e.handleDragStop(s);
265
- }), e;
266
- }
267
- return Be(l, [{
268
- key: "componentDidMount",
269
- value: function() {
270
- this.mounted = !0;
271
- var d = this.findDOMNode();
272
- d && (0, _.addEvent)(d, N.touch.start, this.onTouchStart, {
273
- passive: !1
319
+ _this.setState({
320
+ lastX: x,
321
+ lastY: y
322
+ });
323
+ });
324
+ _defineProperty(_assertThisInitialized(_this), "handleDragStop", function(e) {
325
+ if (!_this.state.dragging)
326
+ return;
327
+ var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _assertThisInitialized(_this));
328
+ if (position == null)
329
+ return;
330
+ var x = position.x, y = position.y;
331
+ if (Array.isArray(_this.props.grid)) {
332
+ var deltaX = x - _this.state.lastX || 0;
333
+ var deltaY = y - _this.state.lastY || 0;
334
+ var _snapToGrid3 = (0, _positionFns.snapToGrid)(_this.props.grid, deltaX, deltaY);
335
+ var _snapToGrid4 = _slicedToArray(_snapToGrid3, 2);
336
+ deltaX = _snapToGrid4[0];
337
+ deltaY = _snapToGrid4[1];
338
+ x = _this.state.lastX + deltaX, y = _this.state.lastY + deltaY;
339
+ }
340
+ var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y);
341
+ var shouldContinue = _this.props.onStop(e, coreEvent);
342
+ if (shouldContinue === false || _this.mounted === false)
343
+ return false;
344
+ var thisNode = _this.findDOMNode();
345
+ if (thisNode) {
346
+ if (_this.props.enableUserSelectHack)
347
+ (0, _domFns.removeUserSelectStyles)(thisNode.ownerDocument);
348
+ }
349
+ (0, _log.default)("DraggableCore: handleDragStop: %j", coreEvent);
350
+ _this.setState({
351
+ dragging: false,
352
+ lastX: NaN,
353
+ lastY: NaN
274
354
  });
355
+ if (thisNode) {
356
+ (0, _log.default)("DraggableCore: Removing handlers");
357
+ (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.move, _this.handleDrag);
358
+ (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.stop, _this.handleDragStop);
359
+ }
360
+ });
361
+ _defineProperty(_assertThisInitialized(_this), "onMouseDown", function(e) {
362
+ dragEventFor = eventsFor.mouse;
363
+ return _this.handleDragStart(e);
364
+ });
365
+ _defineProperty(_assertThisInitialized(_this), "onMouseUp", function(e) {
366
+ dragEventFor = eventsFor.mouse;
367
+ return _this.handleDragStop(e);
368
+ });
369
+ _defineProperty(_assertThisInitialized(_this), "onTouchStart", function(e) {
370
+ dragEventFor = eventsFor.touch;
371
+ return _this.handleDragStart(e);
372
+ });
373
+ _defineProperty(_assertThisInitialized(_this), "onTouchEnd", function(e) {
374
+ dragEventFor = eventsFor.touch;
375
+ return _this.handleDragStop(e);
376
+ });
377
+ return _this;
378
+ }
379
+ _createClass(DraggableCore2, [{
380
+ key: "componentDidMount",
381
+ value: function componentDidMount() {
382
+ this.mounted = true;
383
+ var thisNode = this.findDOMNode();
384
+ if (thisNode) {
385
+ (0, _domFns.addEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
386
+ passive: false
387
+ });
388
+ }
275
389
  }
276
390
  }, {
277
391
  key: "componentWillUnmount",
278
- value: function() {
279
- this.mounted = !1;
280
- var d = this.findDOMNode();
281
- if (d) {
282
- var p = d.ownerDocument;
283
- (0, _.removeEvent)(p, N.mouse.move, this.handleDrag), (0, _.removeEvent)(p, N.touch.move, this.handleDrag), (0, _.removeEvent)(p, N.mouse.stop, this.handleDragStop), (0, _.removeEvent)(p, N.touch.stop, this.handleDragStop), (0, _.removeEvent)(d, N.touch.start, this.onTouchStart, {
284
- passive: !1
285
- }), this.props.enableUserSelectHack && (0, _.removeUserSelectStyles)(p);
392
+ value: function componentWillUnmount() {
393
+ this.mounted = false;
394
+ var thisNode = this.findDOMNode();
395
+ if (thisNode) {
396
+ var ownerDocument = thisNode.ownerDocument;
397
+ (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.move, this.handleDrag);
398
+ (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.move, this.handleDrag);
399
+ (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.stop, this.handleDragStop);
400
+ (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.stop, this.handleDragStop);
401
+ (0, _domFns.removeEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
402
+ passive: false
403
+ });
404
+ if (this.props.enableUserSelectHack)
405
+ (0, _domFns.removeUserSelectStyles)(ownerDocument);
286
406
  }
287
407
  }
288
408
  }, {
289
409
  key: "findDOMNode",
290
- value: function() {
291
- var d, p, h;
292
- return (d = this.props) !== null && d !== void 0 && d.nodeRef ? (p = this.props) === null || p === void 0 || (h = p.nodeRef) === null || h === void 0 ? void 0 : h.current : Ue.default.findDOMNode(this);
410
+ value: function findDOMNode() {
411
+ var _this$props, _this$props2, _this$props2$nodeRef;
412
+ return (_this$props = this.props) !== null && _this$props !== void 0 && _this$props.nodeRef ? (_this$props2 = this.props) === null || _this$props2 === void 0 ? void 0 : (_this$props2$nodeRef = _this$props2.nodeRef) === null || _this$props2$nodeRef === void 0 ? void 0 : _this$props2$nodeRef.current : _reactDom.default.findDOMNode(this);
293
413
  }
294
414
  }, {
295
415
  key: "render",
296
- value: function() {
297
- return /* @__PURE__ */ Z.cloneElement(Z.Children.only(this.props.children), {
416
+ value: function render() {
417
+ return /* @__PURE__ */ React.cloneElement(React.Children.only(this.props.children), {
298
418
  onMouseDown: this.onMouseDown,
299
419
  onMouseUp: this.onMouseUp,
300
420
  onTouchEnd: this.onTouchEnd
301
421
  });
302
422
  }
303
- }]), l;
304
- }(Z.Component);
305
- L.default = z;
306
- P(z, "displayName", "DraggableCore");
307
- P(z, "propTypes", {
308
- allowAnyClick: w.default.bool,
309
- disabled: w.default.bool,
310
- enableUserSelectHack: w.default.bool,
311
- offsetParent: function(a, l) {
312
- if (a[l] && a[l].nodeType !== 1)
423
+ }]);
424
+ return DraggableCore2;
425
+ }(React.Component);
426
+ DraggableCore$2.default = DraggableCore$1;
427
+ _defineProperty(DraggableCore$1, "displayName", "DraggableCore");
428
+ _defineProperty(DraggableCore$1, "propTypes", {
429
+ allowAnyClick: _propTypes.default.bool,
430
+ disabled: _propTypes.default.bool,
431
+ enableUserSelectHack: _propTypes.default.bool,
432
+ offsetParent: function offsetParent(props, propName) {
433
+ if (props[propName] && props[propName].nodeType !== 1) {
313
434
  throw new Error("Draggable's offsetParent must be a DOM Node.");
435
+ }
314
436
  },
315
- grid: w.default.arrayOf(w.default.number),
316
- handle: w.default.string,
317
- cancel: w.default.string,
318
- nodeRef: w.default.object,
319
- onStart: w.default.func,
320
- onDrag: w.default.func,
321
- onStop: w.default.func,
322
- onMouseDown: w.default.func,
323
- scale: w.default.number,
324
- className: ee.dontSetMe,
325
- style: ee.dontSetMe,
326
- transform: ee.dontSetMe
437
+ grid: _propTypes.default.arrayOf(_propTypes.default.number),
438
+ handle: _propTypes.default.string,
439
+ cancel: _propTypes.default.string,
440
+ nodeRef: _propTypes.default.object,
441
+ onStart: _propTypes.default.func,
442
+ onDrag: _propTypes.default.func,
443
+ onStop: _propTypes.default.func,
444
+ onMouseDown: _propTypes.default.func,
445
+ scale: _propTypes.default.number,
446
+ className: _shims.dontSetMe,
447
+ style: _shims.dontSetMe,
448
+ transform: _shims.dontSetMe
327
449
  });
328
- P(z, "defaultProps", {
329
- allowAnyClick: !1,
330
- disabled: !1,
331
- enableUserSelectHack: !0,
332
- onStart: function() {
450
+ _defineProperty(DraggableCore$1, "defaultProps", {
451
+ allowAnyClick: false,
452
+ disabled: false,
453
+ enableUserSelectHack: true,
454
+ onStart: function onStart() {
333
455
  },
334
- onDrag: function() {
456
+ onDrag: function onDrag() {
335
457
  },
336
- onStop: function() {
458
+ onStop: function onStop() {
337
459
  },
338
- onMouseDown: function() {
460
+ onMouseDown: function onMouseDown() {
339
461
  },
340
462
  scale: 1
341
463
  });
342
- (function(r) {
343
- function a(t) {
344
- return a = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
345
- return typeof n;
346
- } : function(n) {
347
- return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
348
- }, a(t);
349
- }
350
- Object.defineProperty(r, "__esModule", {
351
- value: !0
352
- }), Object.defineProperty(r, "DraggableCore", {
353
- enumerable: !0,
354
- get: function() {
355
- return m.default;
464
+ (function(exports) {
465
+ function _typeof2(obj) {
466
+ "@babel/helpers - typeof";
467
+ return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
468
+ return typeof obj2;
469
+ } : function(obj2) {
470
+ return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
471
+ }, _typeof2(obj);
472
+ }
473
+ Object.defineProperty(exports, "__esModule", {
474
+ value: true
475
+ });
476
+ Object.defineProperty(exports, "DraggableCore", {
477
+ enumerable: true,
478
+ get: function get() {
479
+ return _DraggableCore.default;
356
480
  }
357
- }), r.default = void 0;
358
- var l = M(de), e = b(pe), d = b(ge), p = b(Ie), h = he, s = me, v = ye, m = b(L), D = b(ve), O = ["axis", "bounds", "children", "defaultPosition", "defaultClassName", "defaultClassNameDragging", "defaultClassNameDragged", "position", "positionOffset", "scale"];
359
- function b(t) {
360
- return t && t.__esModule ? t : { default: t };
361
- }
362
- function E(t) {
363
- if (typeof WeakMap != "function")
481
+ });
482
+ exports.default = void 0;
483
+ var React2 = _interopRequireWildcard2(React$1);
484
+ var _propTypes2 = _interopRequireDefault2(require$$1);
485
+ var _reactDom2 = _interopRequireDefault2(require$$2);
486
+ var _clsx2 = _interopRequireDefault2(clsx);
487
+ var _domFns2 = domFns;
488
+ var _positionFns2 = positionFns;
489
+ var _shims2 = shims;
490
+ var _DraggableCore = _interopRequireDefault2(DraggableCore$2);
491
+ var _log2 = _interopRequireDefault2(log);
492
+ var _excluded = ["axis", "bounds", "children", "defaultPosition", "defaultClassName", "defaultClassNameDragging", "defaultClassNameDragged", "position", "positionOffset", "scale"];
493
+ function _interopRequireDefault2(obj) {
494
+ return obj && obj.__esModule ? obj : { default: obj };
495
+ }
496
+ function _getRequireWildcardCache2(nodeInterop) {
497
+ if (typeof WeakMap !== "function")
364
498
  return null;
365
- var n = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new WeakMap();
366
- return (E = function(u) {
367
- return u ? o : n;
368
- })(t);
369
- }
370
- function M(t, n) {
371
- if (!n && t && t.__esModule)
372
- return t;
373
- if (t === null || a(t) !== "object" && typeof t != "function")
374
- return { default: t };
375
- var o = E(n);
376
- if (o && o.has(t))
377
- return o.get(t);
378
- var i = {}, u = Object.defineProperty && Object.getOwnPropertyDescriptor;
379
- for (var f in t)
380
- if (f !== "default" && Object.prototype.hasOwnProperty.call(t, f)) {
381
- var c = u ? Object.getOwnPropertyDescriptor(t, f) : null;
382
- c && (c.get || c.set) ? Object.defineProperty(i, f, c) : i[f] = t[f];
499
+ var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
500
+ var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
501
+ return (_getRequireWildcardCache2 = function _getRequireWildcardCache3(nodeInterop2) {
502
+ return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
503
+ })(nodeInterop);
504
+ }
505
+ function _interopRequireWildcard2(obj, nodeInterop) {
506
+ if (!nodeInterop && obj && obj.__esModule) {
507
+ return obj;
508
+ }
509
+ if (obj === null || _typeof2(obj) !== "object" && typeof obj !== "function") {
510
+ return { default: obj };
511
+ }
512
+ var cache = _getRequireWildcardCache2(nodeInterop);
513
+ if (cache && cache.has(obj)) {
514
+ return cache.get(obj);
515
+ }
516
+ var newObj = {};
517
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
518
+ for (var key in obj) {
519
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
520
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
521
+ if (desc && (desc.get || desc.set)) {
522
+ Object.defineProperty(newObj, key, desc);
523
+ } else {
524
+ newObj[key] = obj[key];
525
+ }
383
526
  }
384
- return i.default = t, o && o.set(t, i), i;
385
- }
386
- function x() {
387
- return x = Object.assign || function(t) {
388
- for (var n = 1; n < arguments.length; n++) {
389
- var o = arguments[n];
390
- for (var i in o)
391
- Object.prototype.hasOwnProperty.call(o, i) && (t[i] = o[i]);
527
+ }
528
+ newObj.default = obj;
529
+ if (cache) {
530
+ cache.set(obj, newObj);
531
+ }
532
+ return newObj;
533
+ }
534
+ function _extends() {
535
+ _extends = Object.assign || function(target) {
536
+ for (var i = 1; i < arguments.length; i++) {
537
+ var source = arguments[i];
538
+ for (var key in source) {
539
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
540
+ target[key] = source[key];
541
+ }
542
+ }
392
543
  }
393
- return t;
394
- }, x.apply(this, arguments);
544
+ return target;
545
+ };
546
+ return _extends.apply(this, arguments);
395
547
  }
396
- function $(t, n) {
397
- if (t == null)
548
+ function _objectWithoutProperties(source, excluded) {
549
+ if (source == null)
398
550
  return {};
399
- var o = C(t, n), i, u;
551
+ var target = _objectWithoutPropertiesLoose(source, excluded);
552
+ var key, i;
400
553
  if (Object.getOwnPropertySymbols) {
401
- var f = Object.getOwnPropertySymbols(t);
402
- for (u = 0; u < f.length; u++)
403
- i = f[u], !(n.indexOf(i) >= 0) && (!Object.prototype.propertyIsEnumerable.call(t, i) || (o[i] = t[i]));
554
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
555
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
556
+ key = sourceSymbolKeys[i];
557
+ if (excluded.indexOf(key) >= 0)
558
+ continue;
559
+ if (!Object.prototype.propertyIsEnumerable.call(source, key))
560
+ continue;
561
+ target[key] = source[key];
562
+ }
404
563
  }
405
- return o;
564
+ return target;
406
565
  }
407
- function C(t, n) {
408
- if (t == null)
566
+ function _objectWithoutPropertiesLoose(source, excluded) {
567
+ if (source == null)
409
568
  return {};
410
- var o = {}, i = Object.keys(t), u, f;
411
- for (f = 0; f < i.length; f++)
412
- u = i[f], !(n.indexOf(u) >= 0) && (o[u] = t[u]);
413
- return o;
569
+ var target = {};
570
+ var sourceKeys = Object.keys(source);
571
+ var key, i;
572
+ for (i = 0; i < sourceKeys.length; i++) {
573
+ key = sourceKeys[i];
574
+ if (excluded.indexOf(key) >= 0)
575
+ continue;
576
+ target[key] = source[key];
577
+ }
578
+ return target;
414
579
  }
415
- function K(t, n) {
416
- var o = Object.keys(t);
580
+ function ownKeys(object, enumerableOnly) {
581
+ var keys = Object.keys(object);
417
582
  if (Object.getOwnPropertySymbols) {
418
- var i = Object.getOwnPropertySymbols(t);
419
- n && (i = i.filter(function(u) {
420
- return Object.getOwnPropertyDescriptor(t, u).enumerable;
421
- })), o.push.apply(o, i);
583
+ var symbols = Object.getOwnPropertySymbols(object);
584
+ enumerableOnly && (symbols = symbols.filter(function(sym) {
585
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
586
+ })), keys.push.apply(keys, symbols);
422
587
  }
423
- return o;
424
- }
425
- function R(t) {
426
- for (var n = 1; n < arguments.length; n++) {
427
- var o = arguments[n] != null ? arguments[n] : {};
428
- n % 2 ? K(Object(o), !0).forEach(function(i) {
429
- T(t, i, o[i]);
430
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(o)) : K(Object(o)).forEach(function(i) {
431
- Object.defineProperty(t, i, Object.getOwnPropertyDescriptor(o, i));
588
+ return keys;
589
+ }
590
+ function _objectSpread(target) {
591
+ for (var i = 1; i < arguments.length; i++) {
592
+ var source = null != arguments[i] ? arguments[i] : {};
593
+ i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
594
+ _defineProperty2(target, key, source[key]);
595
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
596
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
432
597
  });
433
598
  }
434
- return t;
435
- }
436
- function Oe(t, n) {
437
- return Ne(t) || xe(t, n) || Pe(t, n) || we();
438
- }
439
- function we() {
440
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
441
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
442
- }
443
- function Pe(t, n) {
444
- if (!!t) {
445
- if (typeof t == "string")
446
- return ae(t, n);
447
- var o = Object.prototype.toString.call(t).slice(8, -1);
448
- if (o === "Object" && t.constructor && (o = t.constructor.name), o === "Map" || o === "Set")
449
- return Array.from(t);
450
- if (o === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))
451
- return ae(t, n);
599
+ return target;
600
+ }
601
+ function _slicedToArray2(arr, i) {
602
+ return _arrayWithHoles2(arr) || _iterableToArrayLimit2(arr, i) || _unsupportedIterableToArray2(arr, i) || _nonIterableRest2();
603
+ }
604
+ function _nonIterableRest2() {
605
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
606
+ }
607
+ function _unsupportedIterableToArray2(o, minLen) {
608
+ if (!o)
609
+ return;
610
+ if (typeof o === "string")
611
+ return _arrayLikeToArray2(o, minLen);
612
+ var n = Object.prototype.toString.call(o).slice(8, -1);
613
+ if (n === "Object" && o.constructor)
614
+ n = o.constructor.name;
615
+ if (n === "Map" || n === "Set")
616
+ return Array.from(o);
617
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
618
+ return _arrayLikeToArray2(o, minLen);
619
+ }
620
+ function _arrayLikeToArray2(arr, len) {
621
+ if (len == null || len > arr.length)
622
+ len = arr.length;
623
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
624
+ arr2[i] = arr[i];
452
625
  }
453
- }
454
- function ae(t, n) {
455
- (n == null || n > t.length) && (n = t.length);
456
- for (var o = 0, i = new Array(n); o < n; o++)
457
- i[o] = t[o];
458
- return i;
459
- }
460
- function xe(t, n) {
461
- var o = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
462
- if (o != null) {
463
- var i = [], u = !0, f = !1, c, y;
626
+ return arr2;
627
+ }
628
+ function _iterableToArrayLimit2(arr, i) {
629
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
630
+ if (_i == null)
631
+ return;
632
+ var _arr = [];
633
+ var _n = true;
634
+ var _d = false;
635
+ var _s, _e;
636
+ try {
637
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
638
+ _arr.push(_s.value);
639
+ if (i && _arr.length === i)
640
+ break;
641
+ }
642
+ } catch (err) {
643
+ _d = true;
644
+ _e = err;
645
+ } finally {
464
646
  try {
465
- for (o = o.call(t); !(u = (c = o.next()).done) && (i.push(c.value), !(n && i.length === n)); u = !0)
466
- ;
467
- } catch (g) {
468
- f = !0, y = g;
647
+ if (!_n && _i["return"] != null)
648
+ _i["return"]();
469
649
  } finally {
470
- try {
471
- !u && o.return != null && o.return();
472
- } finally {
473
- if (f)
474
- throw y;
475
- }
650
+ if (_d)
651
+ throw _e;
476
652
  }
477
- return i;
478
653
  }
654
+ return _arr;
479
655
  }
480
- function Ne(t) {
481
- if (Array.isArray(t))
482
- return t;
656
+ function _arrayWithHoles2(arr) {
657
+ if (Array.isArray(arr))
658
+ return arr;
483
659
  }
484
- function Me(t, n) {
485
- if (!(t instanceof n))
660
+ function _classCallCheck2(instance, Constructor) {
661
+ if (!(instance instanceof Constructor)) {
486
662
  throw new TypeError("Cannot call a class as a function");
663
+ }
487
664
  }
488
- function oe(t, n) {
489
- for (var o = 0; o < n.length; o++) {
490
- var i = n[o];
491
- i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, i.key, i);
665
+ function _defineProperties2(target, props) {
666
+ for (var i = 0; i < props.length; i++) {
667
+ var descriptor = props[i];
668
+ descriptor.enumerable = descriptor.enumerable || false;
669
+ descriptor.configurable = true;
670
+ if ("value" in descriptor)
671
+ descriptor.writable = true;
672
+ Object.defineProperty(target, descriptor.key, descriptor);
492
673
  }
493
674
  }
494
- function Ce(t, n, o) {
495
- return n && oe(t.prototype, n), o && oe(t, o), Object.defineProperty(t, "prototype", { writable: !1 }), t;
675
+ function _createClass2(Constructor, protoProps, staticProps) {
676
+ if (protoProps)
677
+ _defineProperties2(Constructor.prototype, protoProps);
678
+ if (staticProps)
679
+ _defineProperties2(Constructor, staticProps);
680
+ Object.defineProperty(Constructor, "prototype", { writable: false });
681
+ return Constructor;
496
682
  }
497
- function Ee(t, n) {
498
- if (typeof n != "function" && n !== null)
683
+ function _inherits2(subClass, superClass) {
684
+ if (typeof superClass !== "function" && superClass !== null) {
499
685
  throw new TypeError("Super expression must either be null or a function");
500
- t.prototype = Object.create(n && n.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), n && J(t, n);
501
- }
502
- function J(t, n) {
503
- return J = Object.setPrototypeOf || function(i, u) {
504
- return i.__proto__ = u, i;
505
- }, J(t, n);
506
- }
507
- function Te(t) {
508
- var n = Ae();
509
- return function() {
510
- var i = X(t), u;
511
- if (n) {
512
- var f = X(this).constructor;
513
- u = Reflect.construct(i, arguments, f);
514
- } else
515
- u = i.apply(this, arguments);
516
- return Re(this, u);
686
+ }
687
+ subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
688
+ Object.defineProperty(subClass, "prototype", { writable: false });
689
+ if (superClass)
690
+ _setPrototypeOf2(subClass, superClass);
691
+ }
692
+ function _setPrototypeOf2(o, p) {
693
+ _setPrototypeOf2 = Object.setPrototypeOf || function _setPrototypeOf3(o2, p2) {
694
+ o2.__proto__ = p2;
695
+ return o2;
696
+ };
697
+ return _setPrototypeOf2(o, p);
698
+ }
699
+ function _createSuper2(Derived) {
700
+ var hasNativeReflectConstruct = _isNativeReflectConstruct2();
701
+ return function _createSuperInternal() {
702
+ var Super = _getPrototypeOf2(Derived), result;
703
+ if (hasNativeReflectConstruct) {
704
+ var NewTarget = _getPrototypeOf2(this).constructor;
705
+ result = Reflect.construct(Super, arguments, NewTarget);
706
+ } else {
707
+ result = Super.apply(this, arguments);
708
+ }
709
+ return _possibleConstructorReturn2(this, result);
517
710
  };
518
711
  }
519
- function Re(t, n) {
520
- if (n && (a(n) === "object" || typeof n == "function"))
521
- return n;
522
- if (n !== void 0)
712
+ function _possibleConstructorReturn2(self, call) {
713
+ if (call && (_typeof2(call) === "object" || typeof call === "function")) {
714
+ return call;
715
+ } else if (call !== void 0) {
523
716
  throw new TypeError("Derived constructors may only return object or undefined");
524
- return A(t);
717
+ }
718
+ return _assertThisInitialized2(self);
525
719
  }
526
- function A(t) {
527
- if (t === void 0)
720
+ function _assertThisInitialized2(self) {
721
+ if (self === void 0) {
528
722
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
529
- return t;
530
- }
531
- function Ae() {
532
- if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
533
- return !1;
534
- if (typeof Proxy == "function")
535
- return !0;
723
+ }
724
+ return self;
725
+ }
726
+ function _isNativeReflectConstruct2() {
727
+ if (typeof Reflect === "undefined" || !Reflect.construct)
728
+ return false;
729
+ if (Reflect.construct.sham)
730
+ return false;
731
+ if (typeof Proxy === "function")
732
+ return true;
536
733
  try {
537
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
538
- })), !0;
539
- } catch {
540
- return !1;
734
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
735
+ }));
736
+ return true;
737
+ } catch (e) {
738
+ return false;
541
739
  }
542
740
  }
543
- function X(t) {
544
- return X = Object.setPrototypeOf ? Object.getPrototypeOf : function(o) {
545
- return o.__proto__ || Object.getPrototypeOf(o);
546
- }, X(t);
547
- }
548
- function T(t, n, o) {
549
- return n in t ? Object.defineProperty(t, n, { value: o, enumerable: !0, configurable: !0, writable: !0 }) : t[n] = o, t;
550
- }
551
- var Y = /* @__PURE__ */ function(t) {
552
- Ee(o, t);
553
- var n = Te(o);
554
- function o(i) {
555
- var u;
556
- return Me(this, o), u = n.call(this, i), T(A(u), "onDragStart", function(f, c) {
557
- (0, D.default)("Draggable: onDragStart: %j", c);
558
- var y = u.props.onStart(f, (0, s.createDraggableData)(A(u), c));
559
- if (y === !1)
560
- return !1;
561
- u.setState({
562
- dragging: !0,
563
- dragged: !0
741
+ function _getPrototypeOf2(o) {
742
+ _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf3(o2) {
743
+ return o2.__proto__ || Object.getPrototypeOf(o2);
744
+ };
745
+ return _getPrototypeOf2(o);
746
+ }
747
+ function _defineProperty2(obj, key, value) {
748
+ if (key in obj) {
749
+ Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
750
+ } else {
751
+ obj[key] = value;
752
+ }
753
+ return obj;
754
+ }
755
+ var Draggable2 = /* @__PURE__ */ function(_React$Component) {
756
+ _inherits2(Draggable3, _React$Component);
757
+ var _super = _createSuper2(Draggable3);
758
+ function Draggable3(props) {
759
+ var _this;
760
+ _classCallCheck2(this, Draggable3);
761
+ _this = _super.call(this, props);
762
+ _defineProperty2(_assertThisInitialized2(_this), "onDragStart", function(e, coreData) {
763
+ (0, _log2.default)("Draggable: onDragStart: %j", coreData);
764
+ var shouldStart = _this.props.onStart(e, (0, _positionFns2.createDraggableData)(_assertThisInitialized2(_this), coreData));
765
+ if (shouldStart === false)
766
+ return false;
767
+ _this.setState({
768
+ dragging: true,
769
+ dragged: true
564
770
  });
565
- }), T(A(u), "onDrag", function(f, c) {
566
- if (!u.state.dragging)
567
- return !1;
568
- (0, D.default)("Draggable: onDrag: %j", c);
569
- var y = (0, s.createDraggableData)(A(u), c), g = {
570
- x: y.x,
571
- y: y.y
771
+ });
772
+ _defineProperty2(_assertThisInitialized2(_this), "onDrag", function(e, coreData) {
773
+ if (!_this.state.dragging)
774
+ return false;
775
+ (0, _log2.default)("Draggable: onDrag: %j", coreData);
776
+ var uiData = (0, _positionFns2.createDraggableData)(_assertThisInitialized2(_this), coreData);
777
+ var newState = {
778
+ x: uiData.x,
779
+ y: uiData.y
572
780
  };
573
- if (u.props.bounds) {
574
- var q = g.x, U = g.y;
575
- g.x += u.state.slackX, g.y += u.state.slackY;
576
- var W = (0, s.getBoundPosition)(A(u), g.x, g.y), I = Oe(W, 2), Q = I[0], B = I[1];
577
- g.x = Q, g.y = B, g.slackX = u.state.slackX + (q - g.x), g.slackY = u.state.slackY + (U - g.y), y.x = g.x, y.y = g.y, y.deltaX = g.x - u.state.x, y.deltaY = g.y - u.state.y;
781
+ if (_this.props.bounds) {
782
+ var x = newState.x, y = newState.y;
783
+ newState.x += _this.state.slackX;
784
+ newState.y += _this.state.slackY;
785
+ var _getBoundPosition = (0, _positionFns2.getBoundPosition)(_assertThisInitialized2(_this), newState.x, newState.y), _getBoundPosition2 = _slicedToArray2(_getBoundPosition, 2), newStateX = _getBoundPosition2[0], newStateY = _getBoundPosition2[1];
786
+ newState.x = newStateX;
787
+ newState.y = newStateY;
788
+ newState.slackX = _this.state.slackX + (x - newState.x);
789
+ newState.slackY = _this.state.slackY + (y - newState.y);
790
+ uiData.x = newState.x;
791
+ uiData.y = newState.y;
792
+ uiData.deltaX = newState.x - _this.state.x;
793
+ uiData.deltaY = newState.y - _this.state.y;
578
794
  }
579
- var H = u.props.onDrag(f, y);
580
- if (H === !1)
581
- return !1;
582
- u.setState(g);
583
- }), T(A(u), "onDragStop", function(f, c) {
584
- if (!u.state.dragging)
585
- return !1;
586
- var y = u.props.onStop(f, (0, s.createDraggableData)(A(u), c));
587
- if (y === !1)
588
- return !1;
589
- (0, D.default)("Draggable: onDragStop: %j", c);
590
- var g = {
591
- dragging: !1,
795
+ var shouldUpdate = _this.props.onDrag(e, uiData);
796
+ if (shouldUpdate === false)
797
+ return false;
798
+ _this.setState(newState);
799
+ });
800
+ _defineProperty2(_assertThisInitialized2(_this), "onDragStop", function(e, coreData) {
801
+ if (!_this.state.dragging)
802
+ return false;
803
+ var shouldContinue = _this.props.onStop(e, (0, _positionFns2.createDraggableData)(_assertThisInitialized2(_this), coreData));
804
+ if (shouldContinue === false)
805
+ return false;
806
+ (0, _log2.default)("Draggable: onDragStop: %j", coreData);
807
+ var newState = {
808
+ dragging: false,
592
809
  slackX: 0,
593
810
  slackY: 0
594
- }, q = Boolean(u.props.position);
595
- if (q) {
596
- var U = u.props.position, W = U.x, I = U.y;
597
- g.x = W, g.y = I;
811
+ };
812
+ var controlled = Boolean(_this.props.position);
813
+ if (controlled) {
814
+ var _this$props$position = _this.props.position, x = _this$props$position.x, y = _this$props$position.y;
815
+ newState.x = x;
816
+ newState.y = y;
598
817
  }
599
- u.setState(g);
600
- }), u.state = {
601
- dragging: !1,
602
- dragged: !1,
603
- x: i.position ? i.position.x : i.defaultPosition.x,
604
- y: i.position ? i.position.y : i.defaultPosition.y,
605
- prevPropsPosition: R({}, i.position),
818
+ _this.setState(newState);
819
+ });
820
+ _this.state = {
821
+ dragging: false,
822
+ dragged: false,
823
+ x: props.position ? props.position.x : props.defaultPosition.x,
824
+ y: props.position ? props.position.y : props.defaultPosition.y,
825
+ prevPropsPosition: _objectSpread({}, props.position),
606
826
  slackX: 0,
607
827
  slackY: 0,
608
- isElementSVG: !1
609
- }, i.position && !(i.onDrag || i.onStop) && console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element."), u;
828
+ isElementSVG: false
829
+ };
830
+ if (props.position && !(props.onDrag || props.onStop)) {
831
+ console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.");
832
+ }
833
+ return _this;
610
834
  }
611
- return Ce(o, [{
835
+ _createClass2(Draggable3, [{
612
836
  key: "componentDidMount",
613
- value: function() {
614
- typeof window.SVGElement < "u" && this.findDOMNode() instanceof window.SVGElement && this.setState({
615
- isElementSVG: !0
616
- });
837
+ value: function componentDidMount() {
838
+ if (typeof window.SVGElement !== "undefined" && this.findDOMNode() instanceof window.SVGElement) {
839
+ this.setState({
840
+ isElementSVG: true
841
+ });
842
+ }
617
843
  }
618
844
  }, {
619
845
  key: "componentWillUnmount",
620
- value: function() {
846
+ value: function componentWillUnmount() {
621
847
  this.setState({
622
- dragging: !1
848
+ dragging: false
623
849
  });
624
850
  }
625
851
  }, {
626
852
  key: "findDOMNode",
627
- value: function() {
628
- var u, f, c;
629
- return (u = (f = this.props) === null || f === void 0 || (c = f.nodeRef) === null || c === void 0 ? void 0 : c.current) !== null && u !== void 0 ? u : d.default.findDOMNode(this);
853
+ value: function findDOMNode() {
854
+ var _this$props$nodeRef$c, _this$props, _this$props$nodeRef;
855
+ return (_this$props$nodeRef$c = (_this$props = this.props) === null || _this$props === void 0 ? void 0 : (_this$props$nodeRef = _this$props.nodeRef) === null || _this$props$nodeRef === void 0 ? void 0 : _this$props$nodeRef.current) !== null && _this$props$nodeRef$c !== void 0 ? _this$props$nodeRef$c : _reactDom2.default.findDOMNode(this);
630
856
  }
631
857
  }, {
632
858
  key: "render",
633
- value: function() {
634
- var u, f = this.props;
635
- f.axis, f.bounds;
636
- var c = f.children, y = f.defaultPosition, g = f.defaultClassName, q = f.defaultClassNameDragging, U = f.defaultClassNameDragged, W = f.position, I = f.positionOffset;
637
- f.scale;
638
- var Q = $(f, O), B = {}, H = null, je = Boolean(W), ie = !je || this.state.dragging, ue = W || y, le = {
639
- x: (0, s.canDragX)(this) && ie ? this.state.x : ue.x,
640
- y: (0, s.canDragY)(this) && ie ? this.state.y : ue.y
859
+ value: function render() {
860
+ var _clsx;
861
+ var _this$props2 = this.props;
862
+ _this$props2.axis;
863
+ _this$props2.bounds;
864
+ var children = _this$props2.children, defaultPosition = _this$props2.defaultPosition, defaultClassName = _this$props2.defaultClassName, defaultClassNameDragging = _this$props2.defaultClassNameDragging, defaultClassNameDragged = _this$props2.defaultClassNameDragged, position = _this$props2.position, positionOffset = _this$props2.positionOffset;
865
+ _this$props2.scale;
866
+ var draggableCoreProps = _objectWithoutProperties(_this$props2, _excluded);
867
+ var style = {};
868
+ var svgTransform = null;
869
+ var controlled = Boolean(position);
870
+ var draggable = !controlled || this.state.dragging;
871
+ var validPosition = position || defaultPosition;
872
+ var transformOpts = {
873
+ x: (0, _positionFns2.canDragX)(this) && draggable ? this.state.x : validPosition.x,
874
+ y: (0, _positionFns2.canDragY)(this) && draggable ? this.state.y : validPosition.y
641
875
  };
642
- this.state.isElementSVG ? H = (0, h.createSVGTransform)(le, I) : B = (0, h.createCSSTransform)(le, I);
643
- var ke = (0, p.default)(c.props.className || "", g, (u = {}, T(u, q, this.state.dragging), T(u, U, this.state.dragged), u));
644
- return /* @__PURE__ */ l.createElement(m.default, x({}, Q, {
876
+ if (this.state.isElementSVG) {
877
+ svgTransform = (0, _domFns2.createSVGTransform)(transformOpts, positionOffset);
878
+ } else {
879
+ style = (0, _domFns2.createCSSTransform)(transformOpts, positionOffset);
880
+ }
881
+ var className = (0, _clsx2.default)(children.props.className || "", defaultClassName, (_clsx = {}, _defineProperty2(_clsx, defaultClassNameDragging, this.state.dragging), _defineProperty2(_clsx, defaultClassNameDragged, this.state.dragged), _clsx));
882
+ return /* @__PURE__ */ React2.createElement(_DraggableCore.default, _extends({}, draggableCoreProps, {
645
883
  onStart: this.onDragStart,
646
884
  onDrag: this.onDrag,
647
885
  onStop: this.onDragStop
648
- }), /* @__PURE__ */ l.cloneElement(l.Children.only(c), {
649
- className: ke,
650
- style: R(R({}, c.props.style), B),
651
- transform: H
886
+ }), /* @__PURE__ */ React2.cloneElement(React2.Children.only(children), {
887
+ className,
888
+ style: _objectSpread(_objectSpread({}, children.props.style), style),
889
+ transform: svgTransform
652
890
  }));
653
891
  }
654
892
  }], [{
655
893
  key: "getDerivedStateFromProps",
656
- value: function(u, f) {
657
- var c = u.position, y = f.prevPropsPosition;
658
- return c && (!y || c.x !== y.x || c.y !== y.y) ? ((0, D.default)("Draggable: getDerivedStateFromProps %j", {
659
- position: c,
660
- prevPropsPosition: y
661
- }), {
662
- x: c.x,
663
- y: c.y,
664
- prevPropsPosition: R({}, c)
665
- }) : null;
894
+ value: function getDerivedStateFromProps(_ref, _ref2) {
895
+ var position = _ref.position;
896
+ var prevPropsPosition = _ref2.prevPropsPosition;
897
+ if (position && (!prevPropsPosition || position.x !== prevPropsPosition.x || position.y !== prevPropsPosition.y)) {
898
+ (0, _log2.default)("Draggable: getDerivedStateFromProps %j", {
899
+ position,
900
+ prevPropsPosition
901
+ });
902
+ return {
903
+ x: position.x,
904
+ y: position.y,
905
+ prevPropsPosition: _objectSpread({}, position)
906
+ };
907
+ }
908
+ return null;
666
909
  }
667
- }]), o;
668
- }(l.Component);
669
- r.default = Y, T(Y, "displayName", "Draggable"), T(Y, "propTypes", R(R({}, m.default.propTypes), {}, {
670
- axis: e.default.oneOf(["both", "x", "y", "none"]),
671
- bounds: e.default.oneOfType([e.default.shape({
672
- left: e.default.number,
673
- right: e.default.number,
674
- top: e.default.number,
675
- bottom: e.default.number
676
- }), e.default.string, e.default.oneOf([!1])]),
677
- defaultClassName: e.default.string,
678
- defaultClassNameDragging: e.default.string,
679
- defaultClassNameDragged: e.default.string,
680
- defaultPosition: e.default.shape({
681
- x: e.default.number,
682
- y: e.default.number
910
+ }]);
911
+ return Draggable3;
912
+ }(React2.Component);
913
+ exports.default = Draggable2;
914
+ _defineProperty2(Draggable2, "displayName", "Draggable");
915
+ _defineProperty2(Draggable2, "propTypes", _objectSpread(_objectSpread({}, _DraggableCore.default.propTypes), {}, {
916
+ axis: _propTypes2.default.oneOf(["both", "x", "y", "none"]),
917
+ bounds: _propTypes2.default.oneOfType([_propTypes2.default.shape({
918
+ left: _propTypes2.default.number,
919
+ right: _propTypes2.default.number,
920
+ top: _propTypes2.default.number,
921
+ bottom: _propTypes2.default.number
922
+ }), _propTypes2.default.string, _propTypes2.default.oneOf([false])]),
923
+ defaultClassName: _propTypes2.default.string,
924
+ defaultClassNameDragging: _propTypes2.default.string,
925
+ defaultClassNameDragged: _propTypes2.default.string,
926
+ defaultPosition: _propTypes2.default.shape({
927
+ x: _propTypes2.default.number,
928
+ y: _propTypes2.default.number
683
929
  }),
684
- positionOffset: e.default.shape({
685
- x: e.default.oneOfType([e.default.number, e.default.string]),
686
- y: e.default.oneOfType([e.default.number, e.default.string])
930
+ positionOffset: _propTypes2.default.shape({
931
+ x: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]),
932
+ y: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string])
687
933
  }),
688
- position: e.default.shape({
689
- x: e.default.number,
690
- y: e.default.number
934
+ position: _propTypes2.default.shape({
935
+ x: _propTypes2.default.number,
936
+ y: _propTypes2.default.number
691
937
  }),
692
- className: v.dontSetMe,
693
- style: v.dontSetMe,
694
- transform: v.dontSetMe
695
- })), T(Y, "defaultProps", R(R({}, m.default.defaultProps), {}, {
938
+ className: _shims2.dontSetMe,
939
+ style: _shims2.dontSetMe,
940
+ transform: _shims2.dontSetMe
941
+ }));
942
+ _defineProperty2(Draggable2, "defaultProps", _objectSpread(_objectSpread({}, _DraggableCore.default.defaultProps), {}, {
696
943
  axis: "both",
697
- bounds: !1,
944
+ bounds: false,
698
945
  defaultClassName: "react-draggable",
699
946
  defaultClassNameDragging: "react-draggable-dragging",
700
947
  defaultClassNameDragged: "react-draggable-dragged",
@@ -704,11 +951,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
704
951
  },
705
952
  scale: 1
706
953
  }));
707
- })(be);
708
- var _e = be, Se = _e.default, ze = _e.DraggableCore;
709
- re.exports = Se;
710
- re.exports.default = Se;
711
- re.exports.DraggableCore = ze;
954
+ })(Draggable$1);
955
+ var _require = Draggable$1, Draggable = _require.default, DraggableCore = _require.DraggableCore;
956
+ cjs.exports = Draggable;
957
+ cjs.exports.default = Draggable;
958
+ cjs.exports.DraggableCore = DraggableCore;
712
959
  export {
713
- re as c
960
+ cjs as c
714
961
  };