react-ui-basics 0.0.158 → 0.0.159
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/Animated.js +2 -2
- package/AutocompleteSelect.js +14 -14
- package/Button.js +13 -13
- package/Checkbox.js +2 -2
- package/CircleProgress.js +2 -2
- package/CommonFields.js +2 -1
- package/CommonFields.js.map +1 -1
- package/DNDContainer.js +27 -27
- package/DNDDraggable.js +1 -1
- package/DNDDroppable.js +1 -1
- package/Dialog.js +2 -2
- package/DropFileInput.js +1 -1
- package/DroppableHorizontalList.js +17 -17
- package/DroppableList.js +17 -17
- package/Dropzone.js +4 -4
- package/FilteredList.js +9 -9
- package/FloatingActionButton.js +1 -1
- package/FormUploadProgress.js +2 -2
- package/ImageGallery.js +91 -91
- package/MaterialIcon.js +1 -1
- package/Modal.js +5 -5
- package/ModalMenu.js +4 -4
- package/ReactCreateElement.js +1 -0
- package/ReadyListener.js +1 -1
- package/Scrollable.js +36 -36
- package/ScrollableTable.js +1 -1
- package/Size.js +3 -3
- package/Snackbar.js +1 -1
- package/SpinningProgress.js +1 -1
- package/Switch.js +2 -2
- package/Table.js +8 -8
- package/TextField.js +6 -6
- package/Tools.js +13 -12
- package/_virtual/_commonjsHelpers.js +1 -0
- package/_virtual/_react.js +1 -0
- package/_virtual/react-jsx-runtime.development.js +1 -0
- package/bundle.css +694 -694
- package/index.js +7 -8
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/router/HistoryTools.js +1 -0
- package/router/Link.js +1 -1
- package/router/NavLink.js +1 -1
- package/router/Route.js +9 -9
- package/router/index.js +1 -1
- package/store/ProxyTools.js +1 -1
- package/store/Store.js +1 -1
package/Animated.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
import { inherits as _inherits, createSuper as _createSuper, createClass as _createClass, defineProperty as _defineProperty, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, objectSpread2 as _objectSpread2 } from './_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import {clientHeight as __clientHeight, clientWidth as __clientWidth, getBoundingClientRect as __getBoundingClientRect, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, top as __top, value as __value, width as __width} from "./CommonFields";
|
|
3
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
@@ -96,7 +96,7 @@ var Animated = function (_PureComponent) {
|
|
|
96
96
|
var otherProps = allPropsExcept(_props, selfProps);
|
|
97
97
|
return React.Children.map(_props[children], function (child) {
|
|
98
98
|
var _objectSpread2$1;
|
|
99
|
-
return child && React.cloneElement(child, _objectSpread2((_objectSpread2$1 = {}, _defineProperty(_objectSpread2$1, className, classNames(props(child)[className], _props[className], isMounting && mounting, isMounted && mounted, isUnMounting && unmounting)), _defineProperty(_objectSpread2$1, "style", _objectSpread2(_objectSpread2({}, props(child)[
|
|
99
|
+
return child && React.cloneElement(child, _objectSpread2((_objectSpread2$1 = {}, _defineProperty(_objectSpread2$1, className, classNames(props(child)[className], _props[className], isMounting && mounting, isMounted && mounted, isUnMounting && unmounting)), _defineProperty(_objectSpread2$1, "style", _objectSpread2(_objectSpread2({}, props(child)[CommonFields[4]]), childStyles)), _objectSpread2$1), otherProps));
|
|
100
100
|
});
|
|
101
101
|
};
|
|
102
102
|
that[componentDidUpdate] = function () {
|
package/AutocompleteSelect.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, objectSpread2 as _objectSpread2, defineProperty as _defineProperty, assertThisInitialized as _assertThisInitialized, createClass as _createClass, toConsumableArray as _toConsumableArray } from './_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import {clientHeight as __clientHeight, clientWidth as __clientWidth, getBoundingClientRect as __getBoundingClientRect, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, top as __top, value as __value, width as __width} from "./CommonFields";
|
|
3
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
@@ -68,7 +68,7 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
68
68
|
_classCallCheck(this, AutocompleteSelect);
|
|
69
69
|
_this = _super.call(this, props);
|
|
70
70
|
_this.initSelected = function (_ref2, _ref3) {
|
|
71
|
-
var value = _ref2[
|
|
71
|
+
var value = _ref2[CommonFields[8]],
|
|
72
72
|
mode = _ref2.mode,
|
|
73
73
|
allowCustom = _ref2.allowCustom;
|
|
74
74
|
var _ref3$filterValue = _ref3.filterValue,
|
|
@@ -124,7 +124,7 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
124
124
|
var selected = _objectSpread2({}, currentSelection);
|
|
125
125
|
if (selected[selectedId] && (defaultValue || isMultiSelect)) {
|
|
126
126
|
delete selected[selectedId];
|
|
127
|
-
if (defaultValue && Object.keys(selected)[
|
|
127
|
+
if (defaultValue && Object.keys(selected)[CommonFields[5]] === 0) selected[defaultValue] = defaultValue;
|
|
128
128
|
} else if (isSelected && isMultiSelect) {
|
|
129
129
|
selected[selectedId] = selectedId;
|
|
130
130
|
} else if (isSelected) {
|
|
@@ -164,7 +164,7 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
164
164
|
orNoop(_this.props.onChange)(Object.values(result.selected));
|
|
165
165
|
};
|
|
166
166
|
_this.onChange = function (event) {
|
|
167
|
-
var value = event.target[
|
|
167
|
+
var value = event.target[CommonFields[8]];
|
|
168
168
|
_this.setState({
|
|
169
169
|
filterValue: value
|
|
170
170
|
});
|
|
@@ -172,7 +172,7 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
172
172
|
};
|
|
173
173
|
var that = _assertThisInitialized(_this);
|
|
174
174
|
that.state = {
|
|
175
|
-
selected: prepareSelected(props[
|
|
175
|
+
selected: prepareSelected(props[CommonFields[8]]),
|
|
176
176
|
isActive: !!props.focused
|
|
177
177
|
};
|
|
178
178
|
that.randomId = getRandomId('acs-');
|
|
@@ -201,7 +201,7 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
201
201
|
var form = findParent(this.el.parentNode, 'form');
|
|
202
202
|
if (form) {
|
|
203
203
|
addEventListener(this.submitButton = form.querySelector('button[type=submit]'), 'click', this.formSubmitListener = function (e) {
|
|
204
|
-
var errored = Object.keys(_this2.state.selected)[
|
|
204
|
+
var errored = Object.keys(_this2.state.selected)[CommonFields[5]] === 0;
|
|
205
205
|
_this2.setState({
|
|
206
206
|
errored: errored
|
|
207
207
|
});
|
|
@@ -213,7 +213,7 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
213
213
|
}, {
|
|
214
214
|
key: "componentDidUpdate",
|
|
215
215
|
value: function componentDidUpdate(prevProps, prevState, snapshot) {
|
|
216
|
-
if (this.props[
|
|
216
|
+
if (this.props[CommonFields[8]] !== prevProps[CommonFields[8]]) this.initSelected(this.props, this.state);
|
|
217
217
|
}
|
|
218
218
|
}, {
|
|
219
219
|
key: "componentWillUnmount",
|
|
@@ -264,13 +264,13 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
264
264
|
if (this.state.data) data = this.state.data;
|
|
265
265
|
if (!Array.isArray(data)) data = [];
|
|
266
266
|
var selectedIds = Object.values(selected);
|
|
267
|
-
var hasSelected = selectedIds[
|
|
267
|
+
var hasSelected = selectedIds[CommonFields[5]] !== 0;
|
|
268
268
|
var setActive = function setActive(e) {
|
|
269
269
|
stopPropagation(e);
|
|
270
270
|
_this3.setState({
|
|
271
271
|
isActive: true
|
|
272
272
|
}, function () {
|
|
273
|
-
return scrollToValue && selectedIds[
|
|
273
|
+
return scrollToValue && selectedIds[CommonFields[5]] > 0 && _this3.list.scrollTo(selectedIds[0]);
|
|
274
274
|
});
|
|
275
275
|
};
|
|
276
276
|
var toggle = function toggle(e) {
|
|
@@ -328,7 +328,7 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
328
328
|
id: id,
|
|
329
329
|
label: getLabel(labels, id),
|
|
330
330
|
onClick: setActive
|
|
331
|
-
})), id !== selectedIds[selectedIds[
|
|
331
|
+
})), id !== selectedIds[selectedIds[CommonFields[5]] - 1] && ', ');
|
|
332
332
|
}), !label && withArrow && ReactCreateElement("span", {
|
|
333
333
|
[__className]: "arrow"
|
|
334
334
|
}), withReset && ReactCreateElement(Button, {
|
|
@@ -357,8 +357,8 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
357
357
|
id: id,
|
|
358
358
|
label: getLabel(labels, id),
|
|
359
359
|
onClick: setActive
|
|
360
|
-
})), id !== selectedIds[selectedIds[
|
|
361
|
-
})), (isActive || !hasSelected && mode !== MODE_MULTIPLE_MINI_INLINE || mode === MODE_MULTIPLE || mode === MODE_MULTIPLE_AUTO && selectedIds[
|
|
360
|
+
})), id !== selectedIds[selectedIds[CommonFields[5]] - 1] && ', ');
|
|
361
|
+
})), (isActive || !hasSelected && mode !== MODE_MULTIPLE_MINI_INLINE || mode === MODE_MULTIPLE || mode === MODE_MULTIPLE_AUTO && selectedIds[CommonFields[5]] > 1 || mode === MODE_INLINE_MULTIPLE) && ReactCreateElement("div", {
|
|
362
362
|
[__className]: "input",
|
|
363
363
|
"data-value": filterValue
|
|
364
364
|
}, withFilter && ReactCreateElement(TextField, {
|
|
@@ -394,8 +394,8 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
394
394
|
_this3.onSelect(_this3.getSelected());
|
|
395
395
|
} else if (keyCode === 8
|
|
396
396
|
) {
|
|
397
|
-
if (!filterValue && selectedIds[
|
|
398
|
-
_this3.remove(selectedIds[selectedIds[
|
|
397
|
+
if (!filterValue && selectedIds[CommonFields[5]] !== 0 && isMultipleSelect(mode)) {
|
|
398
|
+
_this3.remove(selectedIds[selectedIds[CommonFields[5]] - 1]);
|
|
399
399
|
}
|
|
400
400
|
_this3.reset();
|
|
401
401
|
} else if (keyCode === 46
|
package/Button.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import {clientHeight as __clientHeight, clientWidth as __clientWidth, getBoundingClientRect as __getBoundingClientRect, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, top as __top, value as __value, width as __width} from "./CommonFields";
|
|
3
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
@@ -24,13 +24,13 @@ var Button = function (_PureComponent) {
|
|
|
24
24
|
var rippleClassName = stateGS(that);
|
|
25
25
|
var onMouseDown = function onMouseDown(e) {
|
|
26
26
|
if (!_this.props.withRipple) return;
|
|
27
|
-
var rect = el()[
|
|
27
|
+
var rect = el()[CommonFields[13]]();
|
|
28
28
|
var rippleElement = ripple();
|
|
29
|
-
var style = rippleElement[
|
|
29
|
+
var style = rippleElement[CommonFields[4]];
|
|
30
30
|
var body = DOCUMENT.body;
|
|
31
|
-
style[
|
|
32
|
-
style[
|
|
33
|
-
style[
|
|
31
|
+
style[CommonFields[1]] = style[CommonFields[0]] = Math.max(rect[CommonFields[0]], rect[CommonFields[1]]) + 'px';
|
|
32
|
+
style[CommonFields[2]] = e[CommonFields[7]] - rect[CommonFields[2]] - rippleElement.offsetHeight / 2 - body[CommonFields[11]] + 'px';
|
|
33
|
+
style[CommonFields[3]] = e[CommonFields[6]] - rect[CommonFields[3]] - rippleElement.offsetWidth / 2 - body[CommonFields[12]] + 'px';
|
|
34
34
|
rippleClassName('show');
|
|
35
35
|
addEventListener(rippleElement, 'animationend', function () {
|
|
36
36
|
rippleClassName('showed');
|
|
@@ -39,12 +39,12 @@ var Button = function (_PureComponent) {
|
|
|
39
39
|
var onFocus = function onFocus(e) {
|
|
40
40
|
orNoop(props(that).onFocus)(e);
|
|
41
41
|
if (rippleClassName() === 'show') return;
|
|
42
|
-
var rect = el()[
|
|
43
|
-
var style = ripple()[
|
|
44
|
-
var size = Math.max(rect[
|
|
45
|
-
style[
|
|
46
|
-
style[
|
|
47
|
-
style[
|
|
42
|
+
var rect = el()[CommonFields[13]]();
|
|
43
|
+
var style = ripple()[CommonFields[4]];
|
|
44
|
+
var size = Math.max(rect[CommonFields[0]], rect[CommonFields[1]]) * 0.8;
|
|
45
|
+
style[CommonFields[1]] = style[CommonFields[0]] = size + 'px';
|
|
46
|
+
style[CommonFields[2]] = rect[CommonFields[1]] / 2 - size / 2 + 'px';
|
|
47
|
+
style[CommonFields[3]] = rect[CommonFields[0]] / 2 - size / 2 + 'px';
|
|
48
48
|
rippleClassName('focused');
|
|
49
49
|
};
|
|
50
50
|
that[render] = function () {
|
|
@@ -57,7 +57,7 @@ var Button = function (_PureComponent) {
|
|
|
57
57
|
_props$raised = _props.raised,
|
|
58
58
|
raised = _props$raised === void 0 ? !flat : _props$raised,
|
|
59
59
|
round = _props.round,
|
|
60
|
-
style = _props[
|
|
60
|
+
style = _props[CommonFields[4]],
|
|
61
61
|
disabled = _props.disabled;
|
|
62
62
|
return ReactCreateElement("button", {
|
|
63
63
|
[__className]: classNames('Button', className, disabled && 'disabled', raised && 'raised', flat && 'flat', round && 'round'),
|
package/Checkbox.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import {clientHeight as __clientHeight, clientWidth as __clientWidth, getBoundingClientRect as __getBoundingClientRect, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, top as __top, value as __value, width as __width} from "./CommonFields";
|
|
3
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
@@ -25,7 +25,7 @@ var Checkbox = function (_PureComponent) {
|
|
|
25
25
|
label = _props.label,
|
|
26
26
|
name = _props.name,
|
|
27
27
|
onChange = _props.onChange,
|
|
28
|
-
value = _props[
|
|
28
|
+
value = _props[CommonFields[8]],
|
|
29
29
|
className = _props[__className],
|
|
30
30
|
disabled = _props.disabled;
|
|
31
31
|
var id = props().id || randomId;
|
package/CircleProgress.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
import 'react';
|
|
2
|
-
import {clientHeight as __clientHeight, clientWidth as __clientWidth, getBoundingClientRect as __getBoundingClientRect, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, top as __top, value as __value, width as __width} from "./CommonFields";
|
|
3
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
@@ -14,7 +14,7 @@ var dashoffset = function dashoffset(percent) {
|
|
|
14
14
|
return length * (100 - percent) / 100;
|
|
15
15
|
};
|
|
16
16
|
var CircleProgress = function CircleProgress(_ref) {
|
|
17
|
-
var value = _ref[
|
|
17
|
+
var value = _ref[CommonFields[8]];
|
|
18
18
|
value = Number.parseFloat(value);
|
|
19
19
|
return ReactCreateElement("div", {
|
|
20
20
|
[__className]: "CircleProgress"
|
package/CommonFields.js
CHANGED
|
@@ -12,6 +12,7 @@ var clientWidth = 'clientWidth';
|
|
|
12
12
|
var scrollTop = 'scrollTop';
|
|
13
13
|
var scrollLeft = 'scrollLeft';
|
|
14
14
|
var getBoundingClientRect = 'getBoundingClientRect';
|
|
15
|
+
var CommonFields = [width, height, top, left, style, length, pageX, pageY, value, clientHeight, clientWidth, scrollTop, scrollLeft, getBoundingClientRect];
|
|
15
16
|
|
|
16
|
-
export { clientHeight, clientWidth, getBoundingClientRect, height, left, length, pageX, pageY, scrollLeft, scrollTop, style, top, value, width };
|
|
17
|
+
export { clientHeight, clientWidth, CommonFields as default, getBoundingClientRect, height, left, length, pageX, pageY, scrollLeft, scrollTop, style, top, value, width };
|
|
17
18
|
//# sourceMappingURL=CommonFields.js.map
|
package/CommonFields.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonFields.js","sources":["../../../src/react-ui-basics/CommonFields.js"],"sourcesContent":["export const width = 'width'\nexport const height = 'height'\nexport const top = 'top'\nexport const left = 'left'\nexport const style = 'style'\nexport const length = 'length'\nexport const pageX = 'pageX'\nexport const pageY = 'pageY'\nexport const value = 'value'\nexport const clientHeight = 'clientHeight'\nexport const clientWidth = 'clientWidth'\nexport const scrollTop = 'scrollTop'\nexport const scrollLeft = 'scrollLeft'\nexport const getBoundingClientRect = 'getBoundingClientRect'"],"names":["width","height","top","left","style","length","pageX","pageY","value","clientHeight","clientWidth","scrollTop","scrollLeft","getBoundingClientRect"],"mappings":"AAAO,IAAMA,KAAK,GAAG,QAAd;AACA,IAAMC,MAAM,GAAG,SAAf;AACA,IAAMC,GAAG,GAAG,MAAZ;AACA,IAAMC,IAAI,GAAG,OAAb;AACA,IAAMC,KAAK,GAAG,QAAd;AACA,IAAMC,MAAM,GAAG,SAAf;AACA,IAAMC,KAAK,GAAG,QAAd;AACA,IAAMC,KAAK,GAAG,QAAd;AACA,IAAMC,KAAK,GAAG,QAAd;AACA,IAAMC,YAAY,GAAG,eAArB;AACA,IAAMC,WAAW,GAAG,cAApB;AACA,IAAMC,SAAS,GAAG,YAAlB;AACA,IAAMC,UAAU,GAAG,aAAnB;AACA,IAAMC,qBAAqB,GAAG;;;;"}
|
|
1
|
+
{"version":3,"file":"CommonFields.js","sources":["../../../src/react-ui-basics/CommonFields.js"],"sourcesContent":["export const width = 'width'\nexport const height = 'height'\nexport const top = 'top'\nexport const left = 'left'\nexport const style = 'style'\nexport const length = 'length'\nexport const pageX = 'pageX'\nexport const pageY = 'pageY'\nexport const value = 'value'\nexport const clientHeight = 'clientHeight'\nexport const clientWidth = 'clientWidth'\nexport const scrollTop = 'scrollTop'\nexport const scrollLeft = 'scrollLeft'\nexport const getBoundingClientRect = 'getBoundingClientRect'\n\nexport default [width, height, top, left, style, length, pageX, pageY, value, clientHeight, clientWidth, scrollTop, scrollLeft, getBoundingClientRect];"],"names":["width","height","top","left","style","length","pageX","pageY","value","clientHeight","clientWidth","scrollTop","scrollLeft","getBoundingClientRect"],"mappings":"AAAO,IAAMA,KAAK,GAAG,QAAd;AACA,IAAMC,MAAM,GAAG,SAAf;AACA,IAAMC,GAAG,GAAG,MAAZ;AACA,IAAMC,IAAI,GAAG,OAAb;AACA,IAAMC,KAAK,GAAG,QAAd;AACA,IAAMC,MAAM,GAAG,SAAf;AACA,IAAMC,KAAK,GAAG,QAAd;AACA,IAAMC,KAAK,GAAG,QAAd;AACA,IAAMC,KAAK,GAAG,QAAd;AACA,IAAMC,YAAY,GAAG,eAArB;AACA,IAAMC,WAAW,GAAG,cAApB;AACA,IAAMC,SAAS,GAAG,YAAlB;AACA,IAAMC,UAAU,GAAG,aAAnB;AACA,IAAMC,qBAAqB,GAAG,wBAA9B;AAEP,mBAAe,CAACb,KAAD,EAAQC,MAAR,EAAgBC,GAAhB,EAAqBC,IAArB,EAA2BC,KAA3B,EAAkCC,MAAlC,EAA0CC,KAA1C,EAAiDC,KAAjD,EAAwDC,KAAxD,EAA+DC,YAA/D,EAA6EC,WAA7E,EAA0FC,SAA1F,EAAqGC,UAArG,EAAiHC,qBAAjH,CAAf;;;;"}
|
package/DNDContainer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import {clientHeight as __clientHeight, clientWidth as __clientWidth, getBoundingClientRect as __getBoundingClientRect, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, top as __top, value as __value, width as __width} from "./CommonFields";
|
|
3
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
@@ -39,19 +39,19 @@ var DNDContainer = function (_Component) {
|
|
|
39
39
|
var container = _this.container;
|
|
40
40
|
_this.data = item.props.data;
|
|
41
41
|
_this.draggable = item;
|
|
42
|
-
_this.scrollOffsetX = e[
|
|
43
|
-
_this.scrollOffsetY = e[
|
|
42
|
+
_this.scrollOffsetX = e[CommonFields[6]] - e.clientX;
|
|
43
|
+
_this.scrollOffsetY = e[CommonFields[7]] - e.clientY;
|
|
44
44
|
var dataTransfer = e.dataTransfer;
|
|
45
|
-
var itemOffset = item.element[
|
|
46
|
-
item[
|
|
47
|
-
item[
|
|
45
|
+
var itemOffset = item.element[CommonFields[13]]();
|
|
46
|
+
item[CommonFields[0]] = itemOffset[CommonFields[0]];
|
|
47
|
+
item[CommonFields[1]] = itemOffset[CommonFields[1]];
|
|
48
48
|
var clone = orNoop(item.props.copy)(function (it) {
|
|
49
|
-
var style = it.element[
|
|
50
|
-
var offsetLeft = totalOffsetLeft(container) + (e.clientX - itemOffset[
|
|
51
|
-
var offsetTop = totalOffsetTop(container) + (e.clientY - itemOffset[
|
|
49
|
+
var style = it.element[CommonFields[4]];
|
|
50
|
+
var offsetLeft = totalOffsetLeft(container) + (e.clientX - itemOffset[CommonFields[3]]);
|
|
51
|
+
var offsetTop = totalOffsetTop(container) + (e.clientY - itemOffset[CommonFields[2]]);
|
|
52
52
|
_this[positionListener] = orNoop(it.createPositionListener)(e, style, itemOffset, container) || function (e) {
|
|
53
|
-
if (e[
|
|
54
|
-
style.transform = 'translate(' + (e[
|
|
53
|
+
if (e[CommonFields[6]] === 0) return;
|
|
54
|
+
style.transform = 'translate(' + (e[CommonFields[6]] - offsetLeft) + 'px, ' + (e[CommonFields[7]] - offsetTop) + 'px)';
|
|
55
55
|
};
|
|
56
56
|
requestAnimationFrame(function () {
|
|
57
57
|
if (dataTransfer && !dataTransfer.setDragImage) {
|
|
@@ -61,10 +61,10 @@ var DNDContainer = function (_Component) {
|
|
|
61
61
|
style.position = 'absolute';
|
|
62
62
|
style.pointerEvents = 'none';
|
|
63
63
|
style.opacity = '1';
|
|
64
|
-
style[
|
|
65
|
-
style[
|
|
66
|
-
style[
|
|
67
|
-
style[
|
|
64
|
+
style[CommonFields[2]] = '0px';
|
|
65
|
+
style[CommonFields[3]] = '0px';
|
|
66
|
+
style[CommonFields[0]] = itemOffset[CommonFields[0]] + 'px';
|
|
67
|
+
style[CommonFields[1]] = itemOffset[CommonFields[1]] + 'px';
|
|
68
68
|
}
|
|
69
69
|
_this.onDrag(e);
|
|
70
70
|
it.setState({
|
|
@@ -103,7 +103,7 @@ var DNDContainer = function (_Component) {
|
|
|
103
103
|
var dragStarted = false;
|
|
104
104
|
var dragged = false;
|
|
105
105
|
addListener(draggableElement, item, 'touchstart', function (e) {
|
|
106
|
-
if (e.touches[
|
|
106
|
+
if (e.touches[CommonFields[5]] > 1) return;
|
|
107
107
|
dragged = dragStarted = false;
|
|
108
108
|
var touch = e.targetTouches[0];
|
|
109
109
|
longTouch = setTimeout(function () {
|
|
@@ -116,7 +116,7 @@ var DNDContainer = function (_Component) {
|
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
118
|
if (!dragStarted) return;
|
|
119
|
-
if (e.touches[
|
|
119
|
+
if (e.touches[CommonFields[5]] > 1) return;
|
|
120
120
|
preventDefault(e);
|
|
121
121
|
dragged = true;
|
|
122
122
|
var touch = e.targetTouches[0];
|
|
@@ -131,7 +131,7 @@ var DNDContainer = function (_Component) {
|
|
|
131
131
|
item.setState({
|
|
132
132
|
placeholder: false
|
|
133
133
|
});
|
|
134
|
-
if (e.touches[
|
|
134
|
+
if (e.touches[CommonFields[5]] > 0) return;
|
|
135
135
|
_this[droppables].forEach(function (it) {
|
|
136
136
|
return it.dropIfHover();
|
|
137
137
|
});
|
|
@@ -145,7 +145,7 @@ var DNDContainer = function (_Component) {
|
|
|
145
145
|
_this.data && orNoop(item.props.onDrop)(_this.data);
|
|
146
146
|
}, false);
|
|
147
147
|
item.onDragStart = function (e, draggable) {
|
|
148
|
-
item.bounds = item.element[
|
|
148
|
+
item.bounds = item.element[CommonFields[13]]();
|
|
149
149
|
item.setState({
|
|
150
150
|
allow: true
|
|
151
151
|
});
|
|
@@ -154,9 +154,9 @@ var DNDContainer = function (_Component) {
|
|
|
154
154
|
item.isHover = function (e, draggable) {
|
|
155
155
|
var bounds = item.bounds;
|
|
156
156
|
if (!bounds) return;
|
|
157
|
-
var y = e[
|
|
158
|
-
var x = e[
|
|
159
|
-
var hover = bounds[
|
|
157
|
+
var y = e[CommonFields[7]] - _this.scrollOffsetY;
|
|
158
|
+
var x = e[CommonFields[6]] - _this.scrollOffsetX;
|
|
159
|
+
var hover = bounds[CommonFields[3]] <= x && bounds.right >= x && bounds[CommonFields[2]] <= y && bounds.bottom >= y;
|
|
160
160
|
hover && orNoop(item.props.onHover)(e, draggable);
|
|
161
161
|
if (hover) !item.state.hover && item.setState({
|
|
162
162
|
hover: hover
|
|
@@ -193,11 +193,11 @@ var DNDContainer = function (_Component) {
|
|
|
193
193
|
_this.onDragEnd = function () {
|
|
194
194
|
var draggable = _this.draggable;
|
|
195
195
|
if (draggable.element) {
|
|
196
|
-
var style = draggable.element[
|
|
196
|
+
var style = draggable.element[CommonFields[4]];
|
|
197
197
|
style.position = '';
|
|
198
198
|
style.pointerEvents = '';
|
|
199
|
-
style[
|
|
200
|
-
style[
|
|
199
|
+
style[CommonFields[0]] = "";
|
|
200
|
+
style[CommonFields[1]] = "";
|
|
201
201
|
style.opacity = '';
|
|
202
202
|
}
|
|
203
203
|
draggable.setState({
|
|
@@ -258,10 +258,10 @@ var addListener = function addListener(el, item, type, listener) {
|
|
|
258
258
|
addEventListener(el, type, item[type] = listener);
|
|
259
259
|
};
|
|
260
260
|
var totalOffsetTop = function totalOffsetTop(el) {
|
|
261
|
-
return el[
|
|
261
|
+
return el[CommonFields[13]]()[CommonFields[2]] + (WINDOW.pageYOffset || DOCUMENT.documentElement[CommonFields[11]]);
|
|
262
262
|
};
|
|
263
263
|
var totalOffsetLeft = function totalOffsetLeft(el) {
|
|
264
|
-
return el[
|
|
264
|
+
return el[CommonFields[13]]()[CommonFields[3]] + (WINDOW.pageXOffset || DOCUMENT.documentElement[CommonFields[12]]);
|
|
265
265
|
};
|
|
266
266
|
var DNDContainer$1 = DNDContainer;
|
|
267
267
|
|
package/DNDDraggable.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import {clientHeight as __clientHeight, clientWidth as __clientWidth, getBoundingClientRect as __getBoundingClientRect, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, top as __top, value as __value, width as __width} from "./CommonFields";
|
|
3
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
package/DNDDroppable.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import {clientHeight as __clientHeight, clientWidth as __clientWidth, getBoundingClientRect as __getBoundingClientRect, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, top as __top, value as __value, width as __width} from "./CommonFields";
|
|
3
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
package/Dialog.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, createClass as _createClass, assertThisInitialized as _assertThisInitialized, slicedToArray as _slicedToArray, objectWithoutProperties as _objectWithoutProperties, extends as _extends } from './_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import {clientHeight as __clientHeight, clientWidth as __clientWidth, getBoundingClientRect as __getBoundingClientRect, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, top as __top, value as __value, width as __width} from "./CommonFields";
|
|
3
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
@@ -89,7 +89,7 @@ var DialogWrapper = function (_Component) {
|
|
|
89
89
|
};
|
|
90
90
|
that[render] = function () {
|
|
91
91
|
var _props2 = props(),
|
|
92
|
-
top = _props2[
|
|
92
|
+
top = _props2[CommonFields[2]],
|
|
93
93
|
className = _props2[__className],
|
|
94
94
|
other = _objectWithoutProperties(_props2, _excluded);
|
|
95
95
|
return ReactCreateElement(Modal, {
|
package/DropFileInput.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
import 'react';
|
|
2
|
-
import {clientHeight as __clientHeight, clientWidth as __clientWidth, getBoundingClientRect as __getBoundingClientRect, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, top as __top, value as __value, width as __width} from "./CommonFields";
|
|
3
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import {clientHeight as __clientHeight, clientWidth as __clientWidth, getBoundingClientRect as __getBoundingClientRect, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, top as __top, value as __value, width as __width} from "./CommonFields";
|
|
3
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
@@ -48,14 +48,14 @@ var DroppableHorizontalList = function (_Component) {
|
|
|
48
48
|
return function (it) {
|
|
49
49
|
orNoop(initializer)(it);
|
|
50
50
|
it.createPositionListener = function (e, style) {
|
|
51
|
-
var offset = e[
|
|
51
|
+
var offset = e[CommonFields[6]];
|
|
52
52
|
return function (e) {
|
|
53
|
-
e[
|
|
53
|
+
e[CommonFields[6]] && (style.transform = 'translateX(' + (e[CommonFields[6]] - offset) + 'px)');
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
56
|
it.initDraggedStyles = NOOP;
|
|
57
57
|
it.onDragEnd = function () {
|
|
58
|
-
var style = it.element[
|
|
58
|
+
var style = it.element[CommonFields[4]];
|
|
59
59
|
inTransition = true;
|
|
60
60
|
setTimeout(function () {
|
|
61
61
|
var droppingDuration = props$1().droppingDuration || 100;
|
|
@@ -89,16 +89,16 @@ var DroppableHorizontalList = function (_Component) {
|
|
|
89
89
|
});
|
|
90
90
|
};
|
|
91
91
|
var onHover = function onHover(e, draggable) {
|
|
92
|
-
var offset = e[
|
|
93
|
-
var transformLeft = 'translateX(' + draggable[
|
|
94
|
-
var transformRight = 'translateX(-' + draggable[
|
|
92
|
+
var offset = e[CommonFields[6]] - that.scrollOffsetX;
|
|
93
|
+
var transformLeft = 'translateX(' + draggable[CommonFields[0]] + 'px)';
|
|
94
|
+
var transformRight = 'translateX(-' + draggable[CommonFields[0]] + 'px)';
|
|
95
95
|
list.forEach(function (id, i) {
|
|
96
96
|
if (i !== oldIndex) {
|
|
97
97
|
var d = draggables[id];
|
|
98
98
|
var bounds = d.bounds;
|
|
99
|
-
var style = d.element[
|
|
99
|
+
var style = d.element[CommonFields[4]];
|
|
100
100
|
if (i > oldIndex) {
|
|
101
|
-
if (offset >= bounds[
|
|
101
|
+
if (offset >= bounds[CommonFields[3]]) style.transform = transformRight;else style.transform = '';
|
|
102
102
|
} else {
|
|
103
103
|
if (offset <= bounds.right) style.transform = transformLeft;else style.transform = '';
|
|
104
104
|
}
|
|
@@ -106,23 +106,23 @@ var DroppableHorizontalList = function (_Component) {
|
|
|
106
106
|
});
|
|
107
107
|
var i = list.findIndex(function (id) {
|
|
108
108
|
var bounds = draggables[id].bounds;
|
|
109
|
-
return offset >= bounds[
|
|
109
|
+
return offset >= bounds[CommonFields[3]] && offset <= bounds.right;
|
|
110
110
|
});
|
|
111
|
-
newIndex = i !== -1 ? i : list[
|
|
111
|
+
newIndex = i !== -1 ? i : list[CommonFields[5]];
|
|
112
112
|
};
|
|
113
113
|
var onDragStart = function onDragStart(e, draggable) {
|
|
114
114
|
dragging = true;
|
|
115
115
|
dropped = false;
|
|
116
116
|
oldIndex = list.indexOf(props(draggable).id);
|
|
117
|
-
that.scrollOffsetX = e[
|
|
117
|
+
that.scrollOffsetX = e[CommonFields[6]] - e.clientX;
|
|
118
118
|
list.forEach(function (id) {
|
|
119
|
-
draggables[id].bounds = draggables[id].element[
|
|
119
|
+
draggables[id].bounds = draggables[id].element[CommonFields[13]]();
|
|
120
120
|
});
|
|
121
121
|
};
|
|
122
122
|
var reset = function reset(ignoredIndex, transition) {
|
|
123
123
|
list.forEach(function (id, i) {
|
|
124
124
|
if (i !== ignoredIndex) {
|
|
125
|
-
var s = draggables[id].element[
|
|
125
|
+
var s = draggables[id].element[CommonFields[4]];
|
|
126
126
|
s.transform = '';
|
|
127
127
|
s.transition = transition;
|
|
128
128
|
}
|
|
@@ -145,10 +145,10 @@ var DroppableHorizontalList = function (_Component) {
|
|
|
145
145
|
var onDrop = function onDrop(data) {
|
|
146
146
|
dropped = true;
|
|
147
147
|
var draggable = draggables[list[oldIndex]];
|
|
148
|
-
var style = draggable.element[
|
|
149
|
-
var diff = (newIndex - oldIndex) * draggable.bounds[
|
|
148
|
+
var style = draggable.element[CommonFields[4]];
|
|
149
|
+
var diff = (newIndex - oldIndex) * draggable.bounds[CommonFields[0]];
|
|
150
150
|
var transform = style.transform;
|
|
151
|
-
var position = transform.substring(11, transform[
|
|
151
|
+
var position = transform.substring(11, transform[CommonFields[5]] - 3);
|
|
152
152
|
style.transform = 'translateX(' + (position - diff) + 'px)';
|
|
153
153
|
orNoop(props$1().onDrop)(data, oldIndex, newIndex);
|
|
154
154
|
reset(newIndex, 'unset');
|
package/DroppableList.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import {clientHeight as __clientHeight, clientWidth as __clientWidth, getBoundingClientRect as __getBoundingClientRect, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, top as __top, value as __value, width as __width} from "./CommonFields";
|
|
3
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
@@ -48,14 +48,14 @@ var DroppableList = function (_Component) {
|
|
|
48
48
|
return function (it) {
|
|
49
49
|
orNoop(initializer)(it);
|
|
50
50
|
it.createPositionListener = function (e, style) {
|
|
51
|
-
var offsetTop = e[
|
|
51
|
+
var offsetTop = e[CommonFields[7]];
|
|
52
52
|
return function (e) {
|
|
53
|
-
e[
|
|
53
|
+
e[CommonFields[7]] && (style.transform = 'translateY(' + (e[CommonFields[7]] - offsetTop - that.scrollDiff) + 'px)');
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
56
|
it.initDraggedStyles = NOOP;
|
|
57
57
|
it.onDragEnd = function () {
|
|
58
|
-
var style = it.element[
|
|
58
|
+
var style = it.element[CommonFields[4]];
|
|
59
59
|
inTransition = true;
|
|
60
60
|
setTimeout(function () {
|
|
61
61
|
var droppingDuration = props$1().droppingDuration || 100;
|
|
@@ -93,16 +93,16 @@ var DroppableList = function (_Component) {
|
|
|
93
93
|
});
|
|
94
94
|
};
|
|
95
95
|
var onHover = function onHover(e, draggable) {
|
|
96
|
-
var y = e[
|
|
97
|
-
var transformUp = 'translateY(' + draggable[
|
|
98
|
-
var transformDown = 'translateY(-' + draggable[
|
|
96
|
+
var y = e[CommonFields[7]] - that.scrollOffsetY - that.scrollDiff;
|
|
97
|
+
var transformUp = 'translateY(' + draggable[CommonFields[1]] + 'px)';
|
|
98
|
+
var transformDown = 'translateY(-' + draggable[CommonFields[1]] + 'px)';
|
|
99
99
|
list.forEach(function (id, i) {
|
|
100
100
|
if (i !== oldIndex) {
|
|
101
101
|
var d = draggables[id];
|
|
102
102
|
var bounds = d.bounds;
|
|
103
|
-
var style = d.element[
|
|
103
|
+
var style = d.element[CommonFields[4]];
|
|
104
104
|
if (i > oldIndex) {
|
|
105
|
-
if (y >= bounds[
|
|
105
|
+
if (y >= bounds[CommonFields[2]]) style.transform = transformDown;else style.transform = '';
|
|
106
106
|
} else {
|
|
107
107
|
if (y <= bounds.bottom) style.transform = transformUp;else style.transform = '';
|
|
108
108
|
}
|
|
@@ -110,25 +110,25 @@ var DroppableList = function (_Component) {
|
|
|
110
110
|
});
|
|
111
111
|
var i = list.findIndex(function (id) {
|
|
112
112
|
var bounds = draggables[id].bounds;
|
|
113
|
-
return y >= bounds[
|
|
113
|
+
return y >= bounds[CommonFields[2]] && y <= bounds.bottom;
|
|
114
114
|
});
|
|
115
|
-
newIndex = i !== -1 ? i : list[
|
|
115
|
+
newIndex = i !== -1 ? i : list[CommonFields[5]];
|
|
116
116
|
};
|
|
117
117
|
var onDragStart = function onDragStart(e, draggable) {
|
|
118
118
|
dragging = true;
|
|
119
119
|
dropped = false;
|
|
120
120
|
oldIndex = list.indexOf(props(draggable).id);
|
|
121
|
-
that.scrollOffsetY = e[
|
|
121
|
+
that.scrollOffsetY = e[CommonFields[7]] - e.clientY;
|
|
122
122
|
that.scroll = orNoop(props$1().getScrollPosition)() || 0;
|
|
123
123
|
that.scrollDiff = 0;
|
|
124
124
|
list.forEach(function (id) {
|
|
125
|
-
draggables[id].bounds = draggables[id].element[
|
|
125
|
+
draggables[id].bounds = draggables[id].element[CommonFields[13]]();
|
|
126
126
|
});
|
|
127
127
|
};
|
|
128
128
|
var reset = function reset(ignoredIndex, transition) {
|
|
129
129
|
list.forEach(function (id, i) {
|
|
130
130
|
if (i !== ignoredIndex) {
|
|
131
|
-
var s = draggables[id].element[
|
|
131
|
+
var s = draggables[id].element[CommonFields[4]];
|
|
132
132
|
s.transform = '';
|
|
133
133
|
s.transition = transition;
|
|
134
134
|
}
|
|
@@ -151,10 +151,10 @@ var DroppableList = function (_Component) {
|
|
|
151
151
|
var onDrop = function onDrop(data) {
|
|
152
152
|
dropped = true;
|
|
153
153
|
var draggable = draggables[list[oldIndex]];
|
|
154
|
-
var style = draggable.element[
|
|
155
|
-
var diff = (newIndex - oldIndex) * draggable.bounds[
|
|
154
|
+
var style = draggable.element[CommonFields[4]];
|
|
155
|
+
var diff = (newIndex - oldIndex) * draggable.bounds[CommonFields[1]];
|
|
156
156
|
var transform = style.transform;
|
|
157
|
-
var position = transform.substring(11, transform[
|
|
157
|
+
var position = transform.substring(11, transform[CommonFields[5]] - 3);
|
|
158
158
|
style.transform = 'translateY(' + (position - diff) + 'px)';
|
|
159
159
|
orNoop(props$1().onDrop)(data, oldIndex, newIndex);
|
|
160
160
|
reset(newIndex, 'unset');
|
package/Dropzone.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import {clientHeight as __clientHeight, clientWidth as __clientWidth, getBoundingClientRect as __getBoundingClientRect, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, top as __top, value as __value, width as __width} from "./CommonFields";
|
|
3
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
@@ -14,7 +14,7 @@ import { stateGS, render, propsGetter, PureComponent } from './ReactConstants.js
|
|
|
14
14
|
var toArray = function toArray(o) {
|
|
15
15
|
if (o instanceof Array) return o;
|
|
16
16
|
var l = [];
|
|
17
|
-
for (var i = 0; i < o[
|
|
17
|
+
for (var i = 0; i < o[CommonFields[5]]; i++) {
|
|
18
18
|
l.push(o[i]);
|
|
19
19
|
}
|
|
20
20
|
return l;
|
|
@@ -69,7 +69,7 @@ var Dropzone = function (_PureComponent) {
|
|
|
69
69
|
entries = entries.filter(function (el) {
|
|
70
70
|
return el !== e.target;
|
|
71
71
|
});
|
|
72
|
-
if (entries[
|
|
72
|
+
if (entries[CommonFields[5]] === 0) isDragging(false);
|
|
73
73
|
prevent(e);
|
|
74
74
|
};
|
|
75
75
|
var inputRef = createRef();
|
|
@@ -100,7 +100,7 @@ var Dropzone = function (_PureComponent) {
|
|
|
100
100
|
accept: accept,
|
|
101
101
|
multiple: !!multiple,
|
|
102
102
|
onClick: function onClick() {
|
|
103
|
-
inputRef()[
|
|
103
|
+
inputRef()[CommonFields[8]] = '';
|
|
104
104
|
},
|
|
105
105
|
onChange: onDrop
|
|
106
106
|
}), children);
|