@m4l/components 0.1.12 → 0.1.13
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.
- package/assets/Logo/index.228dcb5a.js +86 -0
- package/commonjs.565e6834.js +12 -0
- package/components/CommonActions/components/ActionCancel/index.cba1b460.js +17 -0
- package/components/CommonActions/components/ActionFormCancel/index.be2fe891.js +49 -0
- package/components/CommonActions/components/ActionFormIntro/index.ca4d2674.js +31 -0
- package/components/CommonActions/components/ActionIntro/index.cc4b1e0e.js +18 -0
- package/components/CommonActions/components/Actions/index.e8148d98.js +743 -0
- package/components/CompanyLogo/{index.js → index.f81c179c.js} +42 -48
- package/components/DataGrid/index.b688877d.js +894 -0
- package/components/DynamicFilter/index.82ce857e.js +1158 -0
- package/components/ErrorLabel/index.c8615f16.js +19 -0
- package/components/Icon/index.cbca79b0.js +70 -0
- package/components/Image/index.e790b50b.js +122 -0
- package/components/LanguagePopover/index.3d9611cb.js +87 -0
- package/components/Loadable/index.f5518558.js +15 -0
- package/components/ModalDialog/index.3850c053.js +168 -0
- package/components/NoItemSelected/{index.js → index.12f0ca67.js} +43 -50
- package/components/ObjectLogs/index.27ef875d.js +266 -0
- package/components/Page/index.6d69977e.js +35 -0
- package/components/Page/index.d.ts +1 -1
- package/components/PaperForm/index.d7c74064.js +105 -0
- package/components/Period/index.5e68286a.js +160 -0
- package/components/PropertyValue/index.ab3dd7e9.js +116 -0
- package/components/Resizeable/{index.js → index.45995d2b.js} +21 -19
- package/components/ScrollBar/index.39eeb2de.js +49 -0
- package/components/ScrollToTop/index.e06f98f6.js +11 -0
- package/components/SplitLayout/{index.js → index.4032673d.js} +35 -35
- package/components/animate/IconButtonAnimate/index.d.ts +1 -1
- package/components/animate/LoadingScreen/{index.js → index.f1cec7db.js} +29 -27
- package/components/animate/MotionContainer/index.8d9f9d80.js +30 -0
- package/components/animate/MotionLazyContainer/index.572dd012.js +15 -0
- package/components/animate/features.0fbf41e1.js +5 -0
- package/components/animate/variants/{bounce.js → bounce.784aaaaa.js} +15 -16
- package/components/animate/variants/container.11f82b76.js +20 -0
- package/components/animate/variants/fade.b561c0fc.js +59 -0
- package/components/animate/variants/{index.js → index.7a912140.js} +0 -0
- package/components/animate/variants/transition.bd46b9ce.js +15 -0
- package/components/formatters/BooleanFormatter/index.cca53b7f.js +42 -0
- package/components/formatters/DateFormatter/index.ad8d9b8e.js +57 -0
- package/components/formatters/index.55856d65.js +106 -0
- package/components/hook-form/FormProvider/index.257acd9f.js +55 -0
- package/components/hook-form/RHFAutocomplete/index.6ed76d4c.js +122 -0
- package/components/hook-form/RHFAutocompleteAsync/index.8f2c97ea.js +153 -0
- package/components/hook-form/RHFCheckbox/index.f9ce6c39.js +59 -0
- package/components/hook-form/RHFDateTime/index.fc5cbafe.js +68 -0
- package/components/hook-form/RHFMultiCheckbox/index.2680b3b6.js +34 -0
- package/components/hook-form/RHFPeriod/index.23c254e9.js +45 -0
- package/components/hook-form/RHFRadioGroup/index.b3335e13.js +43 -0
- package/components/hook-form/RHFSelect/index.b6ca8bb2.js +36 -0
- package/components/hook-form/RHFTextField/index.4c455f75.js +77 -0
- package/components/hook-form/RHFTextField/index.d.ts +1 -1
- package/components/hook-form/RHFUpload/index.ed3d739f.js +244 -0
- package/components/mui_extended/Accordion/index.2116e423.js +103 -0
- package/components/mui_extended/Avatar/index.0a2a4523.js +32 -0
- package/components/mui_extended/Avatar/index.d.ts +1 -1
- package/components/mui_extended/BoxIcon/index.e638ecc8.js +22 -0
- package/components/mui_extended/Breadcrumbs/index.5e37d903.js +89 -0
- package/components/mui_extended/Button/index.84d8898c.js +110 -0
- package/components/mui_extended/IconButton/index.88f3aadb.js +98 -0
- package/components/mui_extended/LinkWithRoute/index.d4b263de.js +28 -0
- package/components/mui_extended/MenuPopover/index.488fc536.js +131 -0
- package/components/mui_extended/Pager/index.0576814f.js +126 -0
- package/components/mui_extended/Tab/index.e0653a0a.js +28 -0
- package/components/mui_extended/Typography/index.0c4604b3.js +22 -0
- package/contexts/ModalContext/index.2188b69e.js +150 -0
- package/hooks/useFormAddEdit/index.d4845f1a.js +26 -0
- package/hooks/useModal/index.6571d2d9.js +6 -0
- package/index.js +162 -70
- package/lodash.e09401f0.js +32 -0
- package/node_modules.168cb897.js +55 -0
- package/package.json +1 -1
- package/react-data-grid.d46d625e.js +2115 -0
- package/react-draggable.20e95c61.js +714 -0
- package/react-json-view.f56a7f8e.js +2762 -0
- package/react-lazy-load-image-component.45b56650.js +784 -0
- package/react-resizable.5277deaf.js +371 -0
- package/react-splitter-layout.7810ac1b.js +165 -0
- package/utils/index.214d9542.js +435 -0
- package/assets/Logo/index.js +0 -91
- package/commonjs.js +0 -9
- package/components/CommonActions/components/ActionCancel/index.js +0 -15
- package/components/CommonActions/components/ActionFormCancel/index.js +0 -62
- package/components/CommonActions/components/ActionFormIntro/index.js +0 -35
- package/components/CommonActions/components/ActionIntro/index.js +0 -16
- package/components/CommonActions/components/Actions/index.js +0 -859
- package/components/DataGrid/index.js +0 -1067
- package/components/DynamicFilter/index.js +0 -1573
- package/components/ErrorLabel/index.js +0 -18
- package/components/Icon/index.js +0 -80
- package/components/Image/index.js +0 -128
- package/components/LanguagePopover/index.js +0 -93
- package/components/Loadable/index.js +0 -13
- package/components/ModalDialog/index.js +0 -180
- package/components/ObjectLogs/index.js +0 -284
- package/components/Page/index.js +0 -36
- package/components/PaperForm/index.js +0 -110
- package/components/Period/index.js +0 -230
- package/components/PropertyValue/index.js +0 -142
- package/components/ScrollBar/index.js +0 -52
- package/components/ScrollToTop/index.js +0 -10
- package/components/animate/MotionContainer/index.js +0 -31
- package/components/animate/MotionLazyContainer/index.js +0 -13
- package/components/animate/features.js +0 -2
- package/components/animate/variants/container.js +0 -20
- package/components/animate/variants/fade.js +0 -61
- package/components/animate/variants/transition.js +0 -16
- package/components/formatters/BooleanFormatter/index.js +0 -52
- package/components/formatters/DateFormatter/index.js +0 -66
- package/components/formatters/index.js +0 -112
- package/components/hook-form/FormProvider/index.js +0 -61
- package/components/hook-form/RHFAutocomplete/index.js +0 -144
- package/components/hook-form/RHFAutocompleteAsync/index.js +0 -191
- package/components/hook-form/RHFCheckbox/index.js +0 -65
- package/components/hook-form/RHFDateTime/index.js +0 -79
- package/components/hook-form/RHFMultiCheckbox/index.js +0 -32
- package/components/hook-form/RHFPeriod/index.js +0 -47
- package/components/hook-form/RHFRadioGroup/index.js +0 -41
- package/components/hook-form/RHFSelect/index.js +0 -34
- package/components/hook-form/RHFTextField/index.js +0 -87
- package/components/hook-form/RHFUpload/index.js +0 -255
- package/components/mui_extended/Accordion/index.js +0 -105
- package/components/mui_extended/Avatar/index.js +0 -33
- package/components/mui_extended/BoxIcon/index.js +0 -20
- package/components/mui_extended/Breadcrumbs/index.js +0 -92
- package/components/mui_extended/Button/index.js +0 -131
- package/components/mui_extended/IconButton/index.js +0 -108
- package/components/mui_extended/LinkWithRoute/index.js +0 -30
- package/components/mui_extended/MenuPopover/index.js +0 -135
- package/components/mui_extended/Pager/index.js +0 -137
- package/components/mui_extended/Tab/index.js +0 -30
- package/components/mui_extended/Typography/index.js +0 -21
- package/contexts/ModalContext/index.js +0 -165
- package/hooks/useFormAddEdit/index.js +0 -42
- package/hooks/useModal/index.js +0 -4
- package/lodash.js +0 -62
- package/node_modules.js +0 -54
- package/react-data-grid.js +0 -2652
- package/react-draggable.js +0 -960
- package/react-json-view.js +0 -2764
- package/react-lazy-load-image-component.js +0 -792
- package/react-resizable.js +0 -541
- package/react-splitter-layout.js +0 -165
- package/utils/index.js +0 -572
package/utils/index.js
DELETED
|
@@ -1,572 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
const getPaletteColor = function(palette, s) {
|
|
3
|
-
s = s.replace(/\[(\w+)\]/g, ".$1");
|
|
4
|
-
s = s.replace(/^\./, "");
|
|
5
|
-
let o = palette;
|
|
6
|
-
const a = s.split(".");
|
|
7
|
-
for (let i = 0, n = a.length; i < n; ++i) {
|
|
8
|
-
const k = a[i];
|
|
9
|
-
if (k in o) {
|
|
10
|
-
o = o[k];
|
|
11
|
-
} else {
|
|
12
|
-
return palette.action.active;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return o;
|
|
16
|
-
};
|
|
17
|
-
const getVariantColor = (variant) => {
|
|
18
|
-
switch (variant) {
|
|
19
|
-
case "warning":
|
|
20
|
-
return "warning";
|
|
21
|
-
case "delete":
|
|
22
|
-
return "error";
|
|
23
|
-
case "info":
|
|
24
|
-
return "info";
|
|
25
|
-
}
|
|
26
|
-
return "primary";
|
|
27
|
-
};
|
|
28
|
-
const getThemeVariantColor = (theme, variant) => {
|
|
29
|
-
switch (variant) {
|
|
30
|
-
case "warning":
|
|
31
|
-
theme.palette.warning.main;
|
|
32
|
-
break;
|
|
33
|
-
case "delete":
|
|
34
|
-
theme.palette.error.main;
|
|
35
|
-
break;
|
|
36
|
-
case "info":
|
|
37
|
-
theme.palette.info.main;
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
return theme.palette.text.primary;
|
|
41
|
-
};
|
|
42
|
-
var domFns = {};
|
|
43
|
-
var shims = {};
|
|
44
|
-
Object.defineProperty(shims, "__esModule", {
|
|
45
|
-
value: true
|
|
46
|
-
});
|
|
47
|
-
shims.dontSetMe = dontSetMe;
|
|
48
|
-
shims.findInArray = findInArray;
|
|
49
|
-
shims.int = int;
|
|
50
|
-
shims.isFunction = isFunction;
|
|
51
|
-
shims.isNum = isNum;
|
|
52
|
-
function findInArray(array, callback) {
|
|
53
|
-
for (var i = 0, length = array.length; i < length; i++) {
|
|
54
|
-
if (callback.apply(callback, [array[i], i, array]))
|
|
55
|
-
return array[i];
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function isFunction(func) {
|
|
59
|
-
return typeof func === "function" || Object.prototype.toString.call(func) === "[object Function]";
|
|
60
|
-
}
|
|
61
|
-
function isNum(num) {
|
|
62
|
-
return typeof num === "number" && !isNaN(num);
|
|
63
|
-
}
|
|
64
|
-
function int(a) {
|
|
65
|
-
return parseInt(a, 10);
|
|
66
|
-
}
|
|
67
|
-
function dontSetMe(props, propName, componentName) {
|
|
68
|
-
if (props[propName]) {
|
|
69
|
-
return new Error("Invalid prop ".concat(propName, " passed to ").concat(componentName, " - do not set this, set it on the child."));
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
var getPrefix$1 = {};
|
|
73
|
-
Object.defineProperty(getPrefix$1, "__esModule", {
|
|
74
|
-
value: true
|
|
75
|
-
});
|
|
76
|
-
getPrefix$1.browserPrefixToKey = browserPrefixToKey;
|
|
77
|
-
getPrefix$1.browserPrefixToStyle = browserPrefixToStyle;
|
|
78
|
-
getPrefix$1.default = void 0;
|
|
79
|
-
getPrefix$1.getPrefix = getPrefix;
|
|
80
|
-
var prefixes = ["Moz", "Webkit", "O", "ms"];
|
|
81
|
-
function getPrefix() {
|
|
82
|
-
var _window$document, _window$document$docu;
|
|
83
|
-
var prop = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "transform";
|
|
84
|
-
if (typeof window === "undefined")
|
|
85
|
-
return "";
|
|
86
|
-
var style = (_window$document = window.document) === null || _window$document === void 0 ? void 0 : (_window$document$docu = _window$document.documentElement) === null || _window$document$docu === void 0 ? void 0 : _window$document$docu.style;
|
|
87
|
-
if (!style)
|
|
88
|
-
return "";
|
|
89
|
-
if (prop in style)
|
|
90
|
-
return "";
|
|
91
|
-
for (var i = 0; i < prefixes.length; i++) {
|
|
92
|
-
if (browserPrefixToKey(prop, prefixes[i]) in style)
|
|
93
|
-
return prefixes[i];
|
|
94
|
-
}
|
|
95
|
-
return "";
|
|
96
|
-
}
|
|
97
|
-
function browserPrefixToKey(prop, prefix) {
|
|
98
|
-
return prefix ? "".concat(prefix).concat(kebabToTitleCase(prop)) : prop;
|
|
99
|
-
}
|
|
100
|
-
function browserPrefixToStyle(prop, prefix) {
|
|
101
|
-
return prefix ? "-".concat(prefix.toLowerCase(), "-").concat(prop) : prop;
|
|
102
|
-
}
|
|
103
|
-
function kebabToTitleCase(str) {
|
|
104
|
-
var out = "";
|
|
105
|
-
var shouldCapitalize = true;
|
|
106
|
-
for (var i = 0; i < str.length; i++) {
|
|
107
|
-
if (shouldCapitalize) {
|
|
108
|
-
out += str[i].toUpperCase();
|
|
109
|
-
shouldCapitalize = false;
|
|
110
|
-
} else if (str[i] === "-") {
|
|
111
|
-
shouldCapitalize = true;
|
|
112
|
-
} else {
|
|
113
|
-
out += str[i];
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
return out;
|
|
117
|
-
}
|
|
118
|
-
var _default = getPrefix();
|
|
119
|
-
getPrefix$1.default = _default;
|
|
120
|
-
function _typeof(obj) {
|
|
121
|
-
"@babel/helpers - typeof";
|
|
122
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
|
|
123
|
-
return typeof obj2;
|
|
124
|
-
} : function(obj2) {
|
|
125
|
-
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
126
|
-
}, _typeof(obj);
|
|
127
|
-
}
|
|
128
|
-
Object.defineProperty(domFns, "__esModule", {
|
|
129
|
-
value: true
|
|
130
|
-
});
|
|
131
|
-
domFns.addClassName = addClassName;
|
|
132
|
-
domFns.addEvent = addEvent;
|
|
133
|
-
domFns.addUserSelectStyles = addUserSelectStyles;
|
|
134
|
-
domFns.createCSSTransform = createCSSTransform;
|
|
135
|
-
domFns.createSVGTransform = createSVGTransform;
|
|
136
|
-
domFns.getTouch = getTouch;
|
|
137
|
-
domFns.getTouchIdentifier = getTouchIdentifier;
|
|
138
|
-
domFns.getTranslation = getTranslation;
|
|
139
|
-
domFns.innerHeight = innerHeight;
|
|
140
|
-
domFns.innerWidth = innerWidth;
|
|
141
|
-
domFns.matchesSelector = matchesSelector;
|
|
142
|
-
domFns.matchesSelectorAndParentsTo = matchesSelectorAndParentsTo;
|
|
143
|
-
domFns.offsetXYFromParent = offsetXYFromParent;
|
|
144
|
-
domFns.outerHeight = outerHeight;
|
|
145
|
-
domFns.outerWidth = outerWidth;
|
|
146
|
-
domFns.removeClassName = removeClassName;
|
|
147
|
-
domFns.removeEvent = removeEvent;
|
|
148
|
-
domFns.removeUserSelectStyles = removeUserSelectStyles;
|
|
149
|
-
var _shims$1 = shims;
|
|
150
|
-
var _getPrefix = _interopRequireWildcard(getPrefix$1);
|
|
151
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
152
|
-
if (typeof WeakMap !== "function")
|
|
153
|
-
return null;
|
|
154
|
-
var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
|
|
155
|
-
var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
|
156
|
-
return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) {
|
|
157
|
-
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
|
158
|
-
})(nodeInterop);
|
|
159
|
-
}
|
|
160
|
-
function _interopRequireWildcard(obj, nodeInterop) {
|
|
161
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
162
|
-
return obj;
|
|
163
|
-
}
|
|
164
|
-
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
|
|
165
|
-
return { default: obj };
|
|
166
|
-
}
|
|
167
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
168
|
-
if (cache && cache.has(obj)) {
|
|
169
|
-
return cache.get(obj);
|
|
170
|
-
}
|
|
171
|
-
var newObj = {};
|
|
172
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
173
|
-
for (var key in obj) {
|
|
174
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
175
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
176
|
-
if (desc && (desc.get || desc.set)) {
|
|
177
|
-
Object.defineProperty(newObj, key, desc);
|
|
178
|
-
} else {
|
|
179
|
-
newObj[key] = obj[key];
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
newObj.default = obj;
|
|
184
|
-
if (cache) {
|
|
185
|
-
cache.set(obj, newObj);
|
|
186
|
-
}
|
|
187
|
-
return newObj;
|
|
188
|
-
}
|
|
189
|
-
function ownKeys$1(object, enumerableOnly) {
|
|
190
|
-
var keys = Object.keys(object);
|
|
191
|
-
if (Object.getOwnPropertySymbols) {
|
|
192
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
193
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
194
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
195
|
-
})), keys.push.apply(keys, symbols);
|
|
196
|
-
}
|
|
197
|
-
return keys;
|
|
198
|
-
}
|
|
199
|
-
function _objectSpread$1(target) {
|
|
200
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
201
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
202
|
-
i % 2 ? ownKeys$1(Object(source), true).forEach(function(key) {
|
|
203
|
-
_defineProperty$1(target, key, source[key]);
|
|
204
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function(key) {
|
|
205
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
return target;
|
|
209
|
-
}
|
|
210
|
-
function _defineProperty$1(obj, key, value) {
|
|
211
|
-
if (key in obj) {
|
|
212
|
-
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
213
|
-
} else {
|
|
214
|
-
obj[key] = value;
|
|
215
|
-
}
|
|
216
|
-
return obj;
|
|
217
|
-
}
|
|
218
|
-
var matchesSelectorFunc = "";
|
|
219
|
-
function matchesSelector(el, selector) {
|
|
220
|
-
if (!matchesSelectorFunc) {
|
|
221
|
-
matchesSelectorFunc = (0, _shims$1.findInArray)(["matches", "webkitMatchesSelector", "mozMatchesSelector", "msMatchesSelector", "oMatchesSelector"], function(method) {
|
|
222
|
-
return (0, _shims$1.isFunction)(el[method]);
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
if (!(0, _shims$1.isFunction)(el[matchesSelectorFunc]))
|
|
226
|
-
return false;
|
|
227
|
-
return el[matchesSelectorFunc](selector);
|
|
228
|
-
}
|
|
229
|
-
function matchesSelectorAndParentsTo(el, selector, baseNode) {
|
|
230
|
-
var node = el;
|
|
231
|
-
do {
|
|
232
|
-
if (matchesSelector(node, selector))
|
|
233
|
-
return true;
|
|
234
|
-
if (node === baseNode)
|
|
235
|
-
return false;
|
|
236
|
-
node = node.parentNode;
|
|
237
|
-
} while (node);
|
|
238
|
-
return false;
|
|
239
|
-
}
|
|
240
|
-
function addEvent(el, event, handler, inputOptions) {
|
|
241
|
-
if (!el)
|
|
242
|
-
return;
|
|
243
|
-
var options = _objectSpread$1({
|
|
244
|
-
capture: true
|
|
245
|
-
}, inputOptions);
|
|
246
|
-
if (el.addEventListener) {
|
|
247
|
-
el.addEventListener(event, handler, options);
|
|
248
|
-
} else if (el.attachEvent) {
|
|
249
|
-
el.attachEvent("on" + event, handler);
|
|
250
|
-
} else {
|
|
251
|
-
el["on" + event] = handler;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
function removeEvent(el, event, handler, inputOptions) {
|
|
255
|
-
if (!el)
|
|
256
|
-
return;
|
|
257
|
-
var options = _objectSpread$1({
|
|
258
|
-
capture: true
|
|
259
|
-
}, inputOptions);
|
|
260
|
-
if (el.removeEventListener) {
|
|
261
|
-
el.removeEventListener(event, handler, options);
|
|
262
|
-
} else if (el.detachEvent) {
|
|
263
|
-
el.detachEvent("on" + event, handler);
|
|
264
|
-
} else {
|
|
265
|
-
el["on" + event] = null;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
function outerHeight(node) {
|
|
269
|
-
var height = node.clientHeight;
|
|
270
|
-
var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
271
|
-
height += (0, _shims$1.int)(computedStyle.borderTopWidth);
|
|
272
|
-
height += (0, _shims$1.int)(computedStyle.borderBottomWidth);
|
|
273
|
-
return height;
|
|
274
|
-
}
|
|
275
|
-
function outerWidth(node) {
|
|
276
|
-
var width = node.clientWidth;
|
|
277
|
-
var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
278
|
-
width += (0, _shims$1.int)(computedStyle.borderLeftWidth);
|
|
279
|
-
width += (0, _shims$1.int)(computedStyle.borderRightWidth);
|
|
280
|
-
return width;
|
|
281
|
-
}
|
|
282
|
-
function innerHeight(node) {
|
|
283
|
-
var height = node.clientHeight;
|
|
284
|
-
var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
285
|
-
height -= (0, _shims$1.int)(computedStyle.paddingTop);
|
|
286
|
-
height -= (0, _shims$1.int)(computedStyle.paddingBottom);
|
|
287
|
-
return height;
|
|
288
|
-
}
|
|
289
|
-
function innerWidth(node) {
|
|
290
|
-
var width = node.clientWidth;
|
|
291
|
-
var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
292
|
-
width -= (0, _shims$1.int)(computedStyle.paddingLeft);
|
|
293
|
-
width -= (0, _shims$1.int)(computedStyle.paddingRight);
|
|
294
|
-
return width;
|
|
295
|
-
}
|
|
296
|
-
function offsetXYFromParent(evt, offsetParent, scale) {
|
|
297
|
-
var isBody = offsetParent === offsetParent.ownerDocument.body;
|
|
298
|
-
var offsetParentRect = isBody ? {
|
|
299
|
-
left: 0,
|
|
300
|
-
top: 0
|
|
301
|
-
} : offsetParent.getBoundingClientRect();
|
|
302
|
-
var x = (evt.clientX + offsetParent.scrollLeft - offsetParentRect.left) / scale;
|
|
303
|
-
var y = (evt.clientY + offsetParent.scrollTop - offsetParentRect.top) / scale;
|
|
304
|
-
return {
|
|
305
|
-
x,
|
|
306
|
-
y
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
|
-
function createCSSTransform(controlPos, positionOffset) {
|
|
310
|
-
var translation = getTranslation(controlPos, positionOffset, "px");
|
|
311
|
-
return _defineProperty$1({}, (0, _getPrefix.browserPrefixToKey)("transform", _getPrefix.default), translation);
|
|
312
|
-
}
|
|
313
|
-
function createSVGTransform(controlPos, positionOffset) {
|
|
314
|
-
var translation = getTranslation(controlPos, positionOffset, "");
|
|
315
|
-
return translation;
|
|
316
|
-
}
|
|
317
|
-
function getTranslation(_ref2, positionOffset, unitSuffix) {
|
|
318
|
-
var x = _ref2.x, y = _ref2.y;
|
|
319
|
-
var translation = "translate(".concat(x).concat(unitSuffix, ",").concat(y).concat(unitSuffix, ")");
|
|
320
|
-
if (positionOffset) {
|
|
321
|
-
var defaultX = "".concat(typeof positionOffset.x === "string" ? positionOffset.x : positionOffset.x + unitSuffix);
|
|
322
|
-
var defaultY = "".concat(typeof positionOffset.y === "string" ? positionOffset.y : positionOffset.y + unitSuffix);
|
|
323
|
-
translation = "translate(".concat(defaultX, ", ").concat(defaultY, ")") + translation;
|
|
324
|
-
}
|
|
325
|
-
return translation;
|
|
326
|
-
}
|
|
327
|
-
function getTouch(e, identifier) {
|
|
328
|
-
return e.targetTouches && (0, _shims$1.findInArray)(e.targetTouches, function(t) {
|
|
329
|
-
return identifier === t.identifier;
|
|
330
|
-
}) || e.changedTouches && (0, _shims$1.findInArray)(e.changedTouches, function(t) {
|
|
331
|
-
return identifier === t.identifier;
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
function getTouchIdentifier(e) {
|
|
335
|
-
if (e.targetTouches && e.targetTouches[0])
|
|
336
|
-
return e.targetTouches[0].identifier;
|
|
337
|
-
if (e.changedTouches && e.changedTouches[0])
|
|
338
|
-
return e.changedTouches[0].identifier;
|
|
339
|
-
}
|
|
340
|
-
function addUserSelectStyles(doc) {
|
|
341
|
-
if (!doc)
|
|
342
|
-
return;
|
|
343
|
-
var styleEl = doc.getElementById("react-draggable-style-el");
|
|
344
|
-
if (!styleEl) {
|
|
345
|
-
styleEl = doc.createElement("style");
|
|
346
|
-
styleEl.type = "text/css";
|
|
347
|
-
styleEl.id = "react-draggable-style-el";
|
|
348
|
-
styleEl.innerHTML = ".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n";
|
|
349
|
-
styleEl.innerHTML += ".react-draggable-transparent-selection *::selection {all: inherit;}\n";
|
|
350
|
-
doc.getElementsByTagName("head")[0].appendChild(styleEl);
|
|
351
|
-
}
|
|
352
|
-
if (doc.body)
|
|
353
|
-
addClassName(doc.body, "react-draggable-transparent-selection");
|
|
354
|
-
}
|
|
355
|
-
function removeUserSelectStyles(doc) {
|
|
356
|
-
if (!doc)
|
|
357
|
-
return;
|
|
358
|
-
try {
|
|
359
|
-
if (doc.body)
|
|
360
|
-
removeClassName(doc.body, "react-draggable-transparent-selection");
|
|
361
|
-
if (doc.selection) {
|
|
362
|
-
doc.selection.empty();
|
|
363
|
-
} else {
|
|
364
|
-
var selection = (doc.defaultView || window).getSelection();
|
|
365
|
-
if (selection && selection.type !== "Caret") {
|
|
366
|
-
selection.removeAllRanges();
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
} catch (e) {
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
function addClassName(el, className) {
|
|
373
|
-
if (el.classList) {
|
|
374
|
-
el.classList.add(className);
|
|
375
|
-
} else {
|
|
376
|
-
if (!el.className.match(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)")))) {
|
|
377
|
-
el.className += " ".concat(className);
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
function removeClassName(el, className) {
|
|
382
|
-
if (el.classList) {
|
|
383
|
-
el.classList.remove(className);
|
|
384
|
-
} else {
|
|
385
|
-
el.className = el.className.replace(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)"), "g"), "");
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
var positionFns = {};
|
|
389
|
-
Object.defineProperty(positionFns, "__esModule", {
|
|
390
|
-
value: true
|
|
391
|
-
});
|
|
392
|
-
positionFns.canDragX = canDragX;
|
|
393
|
-
positionFns.canDragY = canDragY;
|
|
394
|
-
positionFns.createCoreData = createCoreData;
|
|
395
|
-
positionFns.createDraggableData = createDraggableData;
|
|
396
|
-
positionFns.getBoundPosition = getBoundPosition;
|
|
397
|
-
positionFns.getControlPosition = getControlPosition;
|
|
398
|
-
positionFns.snapToGrid = snapToGrid;
|
|
399
|
-
var _shims = shims;
|
|
400
|
-
var _domFns = domFns;
|
|
401
|
-
function getBoundPosition(draggable, x, y) {
|
|
402
|
-
if (!draggable.props.bounds)
|
|
403
|
-
return [x, y];
|
|
404
|
-
var bounds = draggable.props.bounds;
|
|
405
|
-
bounds = typeof bounds === "string" ? bounds : cloneBounds(bounds);
|
|
406
|
-
var node = findDOMNode(draggable);
|
|
407
|
-
if (typeof bounds === "string") {
|
|
408
|
-
var ownerDocument = node.ownerDocument;
|
|
409
|
-
var ownerWindow = ownerDocument.defaultView;
|
|
410
|
-
var boundNode;
|
|
411
|
-
if (bounds === "parent") {
|
|
412
|
-
boundNode = node.parentNode;
|
|
413
|
-
} else {
|
|
414
|
-
boundNode = ownerDocument.querySelector(bounds);
|
|
415
|
-
}
|
|
416
|
-
if (!(boundNode instanceof ownerWindow.HTMLElement)) {
|
|
417
|
-
throw new Error('Bounds selector "' + bounds + '" could not find an element.');
|
|
418
|
-
}
|
|
419
|
-
var boundNodeEl = boundNode;
|
|
420
|
-
var nodeStyle = ownerWindow.getComputedStyle(node);
|
|
421
|
-
var boundNodeStyle = ownerWindow.getComputedStyle(boundNodeEl);
|
|
422
|
-
bounds = {
|
|
423
|
-
left: -node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingLeft) + (0, _shims.int)(nodeStyle.marginLeft),
|
|
424
|
-
top: -node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingTop) + (0, _shims.int)(nodeStyle.marginTop),
|
|
425
|
-
right: (0, _domFns.innerWidth)(boundNodeEl) - (0, _domFns.outerWidth)(node) - node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingRight) - (0, _shims.int)(nodeStyle.marginRight),
|
|
426
|
-
bottom: (0, _domFns.innerHeight)(boundNodeEl) - (0, _domFns.outerHeight)(node) - node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingBottom) - (0, _shims.int)(nodeStyle.marginBottom)
|
|
427
|
-
};
|
|
428
|
-
}
|
|
429
|
-
if ((0, _shims.isNum)(bounds.right))
|
|
430
|
-
x = Math.min(x, bounds.right);
|
|
431
|
-
if ((0, _shims.isNum)(bounds.bottom))
|
|
432
|
-
y = Math.min(y, bounds.bottom);
|
|
433
|
-
if ((0, _shims.isNum)(bounds.left))
|
|
434
|
-
x = Math.max(x, bounds.left);
|
|
435
|
-
if ((0, _shims.isNum)(bounds.top))
|
|
436
|
-
y = Math.max(y, bounds.top);
|
|
437
|
-
return [x, y];
|
|
438
|
-
}
|
|
439
|
-
function snapToGrid(grid, pendingX, pendingY) {
|
|
440
|
-
var x = Math.round(pendingX / grid[0]) * grid[0];
|
|
441
|
-
var y = Math.round(pendingY / grid[1]) * grid[1];
|
|
442
|
-
return [x, y];
|
|
443
|
-
}
|
|
444
|
-
function canDragX(draggable) {
|
|
445
|
-
return draggable.props.axis === "both" || draggable.props.axis === "x";
|
|
446
|
-
}
|
|
447
|
-
function canDragY(draggable) {
|
|
448
|
-
return draggable.props.axis === "both" || draggable.props.axis === "y";
|
|
449
|
-
}
|
|
450
|
-
function getControlPosition(e, touchIdentifier, draggableCore) {
|
|
451
|
-
var touchObj = typeof touchIdentifier === "number" ? (0, _domFns.getTouch)(e, touchIdentifier) : null;
|
|
452
|
-
if (typeof touchIdentifier === "number" && !touchObj)
|
|
453
|
-
return null;
|
|
454
|
-
var node = findDOMNode(draggableCore);
|
|
455
|
-
var offsetParent = draggableCore.props.offsetParent || node.offsetParent || node.ownerDocument.body;
|
|
456
|
-
return (0, _domFns.offsetXYFromParent)(touchObj || e, offsetParent, draggableCore.props.scale);
|
|
457
|
-
}
|
|
458
|
-
function createCoreData(draggable, x, y) {
|
|
459
|
-
var state = draggable.state;
|
|
460
|
-
var isStart = !(0, _shims.isNum)(state.lastX);
|
|
461
|
-
var node = findDOMNode(draggable);
|
|
462
|
-
if (isStart) {
|
|
463
|
-
return {
|
|
464
|
-
node,
|
|
465
|
-
deltaX: 0,
|
|
466
|
-
deltaY: 0,
|
|
467
|
-
lastX: x,
|
|
468
|
-
lastY: y,
|
|
469
|
-
x,
|
|
470
|
-
y
|
|
471
|
-
};
|
|
472
|
-
} else {
|
|
473
|
-
return {
|
|
474
|
-
node,
|
|
475
|
-
deltaX: x - state.lastX,
|
|
476
|
-
deltaY: y - state.lastY,
|
|
477
|
-
lastX: state.lastX,
|
|
478
|
-
lastY: state.lastY,
|
|
479
|
-
x,
|
|
480
|
-
y
|
|
481
|
-
};
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
function createDraggableData(draggable, coreData) {
|
|
485
|
-
var scale = draggable.props.scale;
|
|
486
|
-
return {
|
|
487
|
-
node: coreData.node,
|
|
488
|
-
x: draggable.state.x + coreData.deltaX / scale,
|
|
489
|
-
y: draggable.state.y + coreData.deltaY / scale,
|
|
490
|
-
deltaX: coreData.deltaX / scale,
|
|
491
|
-
deltaY: coreData.deltaY / scale,
|
|
492
|
-
lastX: draggable.state.x,
|
|
493
|
-
lastY: draggable.state.y
|
|
494
|
-
};
|
|
495
|
-
}
|
|
496
|
-
function cloneBounds(bounds) {
|
|
497
|
-
return {
|
|
498
|
-
left: bounds.left,
|
|
499
|
-
top: bounds.top,
|
|
500
|
-
right: bounds.right,
|
|
501
|
-
bottom: bounds.bottom
|
|
502
|
-
};
|
|
503
|
-
}
|
|
504
|
-
function findDOMNode(draggable) {
|
|
505
|
-
var node = draggable.findDOMNode();
|
|
506
|
-
if (!node) {
|
|
507
|
-
throw new Error("<DraggableCore>: Unmounted during event!");
|
|
508
|
-
}
|
|
509
|
-
return node;
|
|
510
|
-
}
|
|
511
|
-
var log$1 = {};
|
|
512
|
-
Object.defineProperty(log$1, "__esModule", {
|
|
513
|
-
value: true
|
|
514
|
-
});
|
|
515
|
-
log$1.default = log;
|
|
516
|
-
function log() {
|
|
517
|
-
}
|
|
518
|
-
var utils = {};
|
|
519
|
-
utils.__esModule = true;
|
|
520
|
-
utils.cloneElement = cloneElement;
|
|
521
|
-
var _react = _interopRequireDefault(React);
|
|
522
|
-
function _interopRequireDefault(obj) {
|
|
523
|
-
return obj && obj.__esModule ? obj : { default: obj };
|
|
524
|
-
}
|
|
525
|
-
function ownKeys(object, enumerableOnly) {
|
|
526
|
-
var keys = Object.keys(object);
|
|
527
|
-
if (Object.getOwnPropertySymbols) {
|
|
528
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
529
|
-
if (enumerableOnly) {
|
|
530
|
-
symbols = symbols.filter(function(sym) {
|
|
531
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
keys.push.apply(keys, symbols);
|
|
535
|
-
}
|
|
536
|
-
return keys;
|
|
537
|
-
}
|
|
538
|
-
function _objectSpread(target) {
|
|
539
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
540
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
541
|
-
if (i % 2) {
|
|
542
|
-
ownKeys(Object(source), true).forEach(function(key) {
|
|
543
|
-
_defineProperty(target, key, source[key]);
|
|
544
|
-
});
|
|
545
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
546
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
547
|
-
} else {
|
|
548
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
549
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
return target;
|
|
554
|
-
}
|
|
555
|
-
function _defineProperty(obj, key, value) {
|
|
556
|
-
if (key in obj) {
|
|
557
|
-
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
558
|
-
} else {
|
|
559
|
-
obj[key] = value;
|
|
560
|
-
}
|
|
561
|
-
return obj;
|
|
562
|
-
}
|
|
563
|
-
function cloneElement(element, props) {
|
|
564
|
-
if (props.style && element.props.style) {
|
|
565
|
-
props.style = _objectSpread(_objectSpread({}, element.props.style), props.style);
|
|
566
|
-
}
|
|
567
|
-
if (props.className && element.props.className) {
|
|
568
|
-
props.className = element.props.className + " " + props.className;
|
|
569
|
-
}
|
|
570
|
-
return /* @__PURE__ */ _react.default.cloneElement(element, props);
|
|
571
|
-
}
|
|
572
|
-
export { getThemeVariantColor as a, getVariantColor as b, domFns as d, getPaletteColor as g, log$1 as l, positionFns as p, shims as s, utils as u };
|