react-ui-basics 0.0.159 → 0.0.160

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/Animated.js +5 -3
  2. package/AutocompleteSelect.js +17 -17
  3. package/Button.js +14 -14
  4. package/Checkbox.js +2 -2
  5. package/CircleProgress.js +2 -2
  6. package/CommonFields.js +21 -16
  7. package/DNDContainer.js +29 -29
  8. package/DNDDraggable.js +1 -1
  9. package/DNDDroppable.js +1 -1
  10. package/Dialog.js +2 -2
  11. package/DropFileInput.js +1 -1
  12. package/DroppableHorizontalList.js +17 -17
  13. package/DroppableList.js +17 -17
  14. package/Dropzone.js +8 -8
  15. package/FilteredList.js +13 -13
  16. package/FloatingActionButton.js +1 -1
  17. package/FormUploadProgress.js +2 -2
  18. package/ImageGallery.js +94 -94
  19. package/MaterialIcon.js +1 -1
  20. package/Modal.js +6 -6
  21. package/ModalMenu.js +4 -4
  22. package/ReactConstants.js +6 -1
  23. package/ReactCreateElement.js +1 -1
  24. package/ReadyListener.js +1 -1
  25. package/Scrollable.js +36 -36
  26. package/ScrollableTable.js +1 -1
  27. package/Size.js +3 -3
  28. package/Snackbar.js +1 -1
  29. package/SpinningProgress.js +1 -1
  30. package/Switch.js +2 -2
  31. package/Table.js +13 -13
  32. package/TextField.js +6 -6
  33. package/Tools.d.ts +1 -0
  34. package/Tools.js +13 -13
  35. package/_virtual/_commonjsHelpers.js +1 -1
  36. package/_virtual/_react.js +1 -1
  37. package/_virtual/react-jsx-runtime.development.js +1 -1
  38. package/bundle.css +759 -759
  39. package/index.js +8 -7
  40. package/package.json +1 -1
  41. package/router/HistoryTools.js +1 -1
  42. package/router/Link.js +1 -1
  43. package/router/NavLink.js +1 -1
  44. package/router/Route.js +9 -9
  45. package/router/index.js +1 -1
  46. package/store/ProxyTools.js +1 -1
  47. package/store/Store.js +1 -1
  48. package/Animated.js.map +0 -1
  49. package/AutocompleteSelect.js.map +0 -1
  50. package/Button.js.map +0 -1
  51. package/Checkbox.js.map +0 -1
  52. package/CircleProgress.js.map +0 -1
  53. package/CommonFields.js.map +0 -1
  54. package/DNDContainer.js.map +0 -1
  55. package/DNDDraggable.js.map +0 -1
  56. package/DNDDroppable.js.map +0 -1
  57. package/Dialog.js.map +0 -1
  58. package/DropFileInput.js.map +0 -1
  59. package/DroppableHorizontalList.js.map +0 -1
  60. package/DroppableList.js.map +0 -1
  61. package/Dropzone.js.map +0 -1
  62. package/FilteredList.js.map +0 -1
  63. package/FloatingActionButton.js.map +0 -1
  64. package/FormUploadProgress.js.map +0 -1
  65. package/ImageGallery.js.map +0 -1
  66. package/MaterialIcon.js.map +0 -1
  67. package/Modal.js.map +0 -1
  68. package/ModalMenu.js.map +0 -1
  69. package/ReactConstants.js.map +0 -1
  70. package/ReactCreateElement.js.map +0 -1
  71. package/ReadyListener.js.map +0 -1
  72. package/Scrollable.js.map +0 -1
  73. package/ScrollableTable.js.map +0 -1
  74. package/Size.js.map +0 -1
  75. package/Snackbar.js.map +0 -1
  76. package/SpinningProgress.js.map +0 -1
  77. package/Switch.js.map +0 -1
  78. package/Table.js.map +0 -1
  79. package/TextField.js.map +0 -1
  80. package/Tools.js.map +0 -1
  81. package/index.js.map +0 -1
package/Animated.js CHANGED
@@ -1,4 +1,4 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
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';
3
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
4
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
@@ -96,11 +96,13 @@ 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)[CommonFields[4]]), childStyles)), _objectSpread2$1), otherProps));
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({}, __style(props(child))), childStyles)), _objectSpread2$1), otherProps));
100
100
  });
101
101
  };
102
102
  that[componentDidUpdate] = function () {
103
- var _props = props(that),
103
+ var p = props;
104
+ var t = that;
105
+ var _props = p(t) || props(that),
104
106
  _state = state(that),
105
107
  v = _props[value],
106
108
  mountingDuration = _props[mounting],
@@ -1,4 +1,4 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
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';
3
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
4
  import {extends as __extends} 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[CommonFields[8]],
71
+ var value = __value(_ref2),
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)[CommonFields[5]] === 0) selected[defaultValue] = defaultValue;
127
+ if (defaultValue && Object.keys(selected).length === 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[CommonFields[8]];
167
+ var value = __target(event).value;
168
168
  _this.setState({
169
169
  filterValue: value
170
170
  });
@@ -172,11 +172,11 @@ var AutocompleteSelect = function (_PureComponent) {
172
172
  };
173
173
  var that = _assertThisInitialized(_this);
174
174
  that.state = {
175
- selected: prepareSelected(props[CommonFields[8]]),
175
+ selected: prepareSelected(__value(props)),
176
176
  isActive: !!props.focused
177
177
  };
178
178
  that.randomId = getRandomId('acs-');
179
- var data = props.data,
179
+ var data = __data(props),
180
180
  getSelected = props.getSelected;
181
181
  isFunction(data) && data(function (data) {
182
182
  return that.setState({
@@ -193,7 +193,7 @@ var AutocompleteSelect = function (_PureComponent) {
193
193
  value: function componentDidMount() {
194
194
  var _this2 = this;
195
195
  addEventListener(DOCUMENT, 'mousedown', this.listener = function (e) {
196
- if (_this2.state.isActive && _this2.el && !_this2.el.contains(e.target)) {
196
+ if (_this2.state.isActive && _this2.el && !_this2.el.contains(__target(e))) {
197
197
  _this2.onClickOutside();
198
198
  }
199
199
  });
@@ -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)[CommonFields[5]] === 0;
204
+ var errored = Object.keys(_this2.state.selected).length === 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[CommonFields[8]] !== prevProps[CommonFields[8]]) this.initSelected(this.props, this.state);
216
+ if (this.props.value !== __value(prevProps)) this.initSelected(this.props, this.state);
217
217
  }
218
218
  }, {
219
219
  key: "componentWillUnmount",
@@ -257,20 +257,20 @@ var AutocompleteSelect = function (_PureComponent) {
257
257
  isActive = this.props.isActive;
258
258
  }
259
259
  var _this$props4 = this.props,
260
- _this$props4$data = _this$props4.data,
260
+ _this$props4$data = __data(_this$props4),
261
261
  data = _this$props4$data === void 0 ? [] : _this$props4$data,
262
262
  _this$props4$labels = _this$props4.labels,
263
263
  labels = _this$props4$labels === void 0 ? {} : _this$props4$labels;
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[CommonFields[5]] !== 0;
267
+ var hasSelected = __length(selectedIds) !== 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[CommonFields[5]] > 0 && _this3.list.scrollTo(selectedIds[0]);
273
+ return scrollToValue && __length(selectedIds) > 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[CommonFields[5]] - 1] && ', ');
331
+ })), id !== selectedIds[__length(selectedIds) - 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[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", {
360
+ })), id !== selectedIds[__length(selectedIds) - 1] && ', ');
361
+ })), (isActive || !hasSelected && mode !== MODE_MULTIPLE_MINI_INLINE || mode === MODE_MULTIPLE || mode === MODE_MULTIPLE_AUTO && __length(selectedIds) > 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[CommonFields[5]] !== 0 && isMultipleSelect(mode)) {
398
- _this3.remove(selectedIds[selectedIds[CommonFields[5]] - 1]);
397
+ if (!filterValue && __length(selectedIds) !== 0 && isMultipleSelect(mode)) {
398
+ _this3.remove(selectedIds[__length(selectedIds) - 1]);
399
399
  }
400
400
  _this3.reset();
401
401
  } else if (keyCode === 46
package/Button.js CHANGED
@@ -1,4 +1,4 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
2
  import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
3
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
4
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
@@ -23,14 +23,14 @@ var Button = function (_PureComponent) {
23
23
  var ripple = createRef();
24
24
  var rippleClassName = stateGS(that);
25
25
  var onMouseDown = function onMouseDown(e) {
26
- if (!_this.props.withRipple) return;
27
- var rect = el()[CommonFields[13]]();
26
+ if (!props(that).withRipple) return;
27
+ var rect = el().getBoundingClientRect();
28
28
  var rippleElement = ripple();
29
- var style = rippleElement[CommonFields[4]];
29
+ var style = __style(rippleElement);
30
30
  var body = DOCUMENT.body;
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';
31
+ style.height = style.width = Math.max(__width(rect), __height(rect)) + 'px';
32
+ style.top = __pageY(e) - __top(rect) - rippleElement.offsetHeight / 2 - __scrollTop(body) + 'px';
33
+ style.left = __pageX(e) - __left(rect) - rippleElement.offsetWidth / 2 - __scrollLeft(body) + '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()[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';
42
+ var rect = el().getBoundingClientRect();
43
+ var style = __style(ripple());
44
+ var size = Math.max(__width(rect), __height(rect)) * 0.8;
45
+ style.height = style.width = size + 'px';
46
+ style.top = __height(rect) / 2 - size / 2 + 'px';
47
+ style.left = __width(rect) / 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[CommonFields[4]],
60
+ style = __style(_props),
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,4 +1,4 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
2
  import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
3
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
4
  import {extends as __extends} 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[CommonFields[8]],
28
+ value = __value(_props),
29
29
  className = _props[__className],
30
30
  disabled = _props.disabled;
31
31
  var id = props().id || randomId;
package/CircleProgress.js CHANGED
@@ -1,4 +1,4 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
2
  import 'react';
3
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
4
  import {extends as __extends} 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[CommonFields[8]];
17
+ var value = __value(_ref);
18
18
  value = Number.parseFloat(value);
19
19
  return ReactCreateElement("div", {
20
20
  [__className]: "CircleProgress"
package/CommonFields.js CHANGED
@@ -1,18 +1,23 @@
1
- var width = 'width';
2
- var height = 'height';
3
- var top = 'top';
4
- var left = 'left';
5
- var style = 'style';
6
- var length = 'length';
7
- var pageX = 'pageX';
8
- var pageY = 'pageY';
9
- var value = 'value';
10
- var clientHeight = 'clientHeight';
11
- var clientWidth = 'clientWidth';
12
- var scrollTop = 'scrollTop';
13
- var scrollLeft = 'scrollLeft';
14
- var getBoundingClientRect = 'getBoundingClientRect';
15
- var CommonFields = [width, height, top, left, style, length, pageX, pageY, value, clientHeight, clientWidth, scrollTop, scrollLeft, getBoundingClientRect];
1
+ var createAccessor = function createAccessor(field) {
2
+ return function (o) {
3
+ return o[field];
4
+ };
5
+ };
6
+ var width = createAccessor('width');
7
+ var height = createAccessor('height');
8
+ var top = createAccessor('top');
9
+ var left = createAccessor('left');
10
+ var style = createAccessor('style');
11
+ var length = createAccessor('length');
12
+ var pageX = createAccessor('pageX');
13
+ var pageY = createAccessor('pageY');
14
+ var value = createAccessor('value');
15
+ var clientHeight = createAccessor('clientHeight');
16
+ var clientWidth = createAccessor('clientWidth');
17
+ var scrollTop = createAccessor('scrollTop');
18
+ var scrollLeft = createAccessor('scrollLeft');
19
+ var target = createAccessor('target');
20
+ var data = createAccessor('data');
16
21
 
17
- export { clientHeight, clientWidth, CommonFields as default, getBoundingClientRect, height, left, length, pageX, pageY, scrollLeft, scrollTop, style, top, value, width };
22
+ export { clientHeight, clientWidth, createAccessor, data, height, left, length, pageX, pageY, scrollLeft, scrollTop, style, target, top, value, width };
18
23
  //# sourceMappingURL=CommonFields.js.map
package/DNDContainer.js CHANGED
@@ -1,4 +1,4 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
2
  import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
3
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
4
  import {extends as __extends} 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[CommonFields[6]] - e.clientX;
43
- _this.scrollOffsetY = e[CommonFields[7]] - e.clientY;
42
+ _this.scrollOffsetX = __pageX(e) - e.clientX;
43
+ _this.scrollOffsetY = __pageY(e) - e.clientY;
44
44
  var dataTransfer = e.dataTransfer;
45
- var itemOffset = item.element[CommonFields[13]]();
46
- item[CommonFields[0]] = itemOffset[CommonFields[0]];
47
- item[CommonFields[1]] = itemOffset[CommonFields[1]];
45
+ var itemOffset = item.element.getBoundingClientRect();
46
+ item.width = __width(itemOffset);
47
+ item.height = __height(itemOffset);
48
48
  var clone = orNoop(item.props.copy)(function (it) {
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]]);
49
+ var style = it.element.style;
50
+ var offsetLeft = totalOffsetLeft(container) + (e.clientX - __left(itemOffset));
51
+ var offsetTop = totalOffsetTop(container) + (e.clientY - __top(itemOffset));
52
52
  _this[positionListener] = orNoop(it.createPositionListener)(e, style, itemOffset, container) || function (e) {
53
- if (e[CommonFields[6]] === 0) return;
54
- style.transform = 'translate(' + (e[CommonFields[6]] - offsetLeft) + 'px, ' + (e[CommonFields[7]] - offsetTop) + 'px)';
53
+ if (e.pageX === 0) return;
54
+ style.transform = 'translate(' + (__pageX(e) - offsetLeft) + 'px, ' + (__pageY(e) - 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[CommonFields[2]] = '0px';
65
- style[CommonFields[3]] = '0px';
66
- style[CommonFields[0]] = itemOffset[CommonFields[0]] + 'px';
67
- style[CommonFields[1]] = itemOffset[CommonFields[1]] + 'px';
64
+ style.top = '0px';
65
+ style.left = '0px';
66
+ style.width = __width(itemOffset) + 'px';
67
+ style.height = __height(itemOffset) + '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[CommonFields[5]] > 1) return;
106
+ if (e.touches.length > 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[CommonFields[5]] > 1) return;
119
+ if (e.touches.length > 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[CommonFields[5]] > 0) return;
134
+ if (e.touches.length > 0) return;
135
135
  _this[droppables].forEach(function (it) {
136
136
  return it.dropIfHover();
137
137
  });
@@ -142,10 +142,10 @@ var DNDContainer = function (_Component) {
142
142
  _this[droppables].push(item);
143
143
  addEventListener(item.element, 'drop', function (e) {
144
144
  preventDefault(e);
145
- _this.data && orNoop(item.props.onDrop)(_this.data);
145
+ __data(_this) && orNoop(item.props.onDrop)(__data(_this));
146
146
  }, false);
147
147
  item.onDragStart = function (e, draggable) {
148
- item.bounds = item.element[CommonFields[13]]();
148
+ item.bounds = item.element.getBoundingClientRect();
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[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;
157
+ var y = __pageY(e) - _this.scrollOffsetY;
158
+ var x = __pageX(e) - _this.scrollOffsetX;
159
+ var hover = __left(bounds) <= x && bounds.right >= x && __top(bounds) <= 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
@@ -165,7 +165,7 @@ var DNDContainer = function (_Component) {
165
165
  });
166
166
  };
167
167
  item.dropIfHover = function () {
168
- _this.data && item.state.hover && orNoop(item.props.onDrop)(_this.data);
168
+ __data(_this) && item.state.hover && orNoop(item.props.onDrop)(__data(_this));
169
169
  };
170
170
  item.onDragEnd = function () {
171
171
  orNoop(orNoop(_this.draggable).onDragEnd)();
@@ -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[CommonFields[4]];
196
+ var style = draggable.element.style;
197
197
  style.position = '';
198
198
  style.pointerEvents = '';
199
- style[CommonFields[0]] = "";
200
- style[CommonFields[1]] = "";
199
+ style.width = "";
200
+ style.height = "";
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[CommonFields[13]]()[CommonFields[2]] + (WINDOW.pageYOffset || DOCUMENT.documentElement[CommonFields[11]]);
261
+ return el.getBoundingClientRect().top + (WINDOW.pageYOffset || DOCUMENT.documentElement.scrollTop);
262
262
  };
263
263
  var totalOffsetLeft = function totalOffsetLeft(el) {
264
- return el[CommonFields[13]]()[CommonFields[3]] + (WINDOW.pageXOffset || DOCUMENT.documentElement[CommonFields[12]]);
264
+ return el.getBoundingClientRect().left + (WINDOW.pageXOffset || DOCUMENT.documentElement.scrollLeft);
265
265
  };
266
266
  var DNDContainer$1 = DNDContainer;
267
267
 
package/DNDDraggable.js CHANGED
@@ -1,4 +1,4 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
2
  import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
3
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
4
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
package/DNDDroppable.js CHANGED
@@ -1,4 +1,4 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
2
  import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
3
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
4
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
package/Dialog.js CHANGED
@@ -1,4 +1,4 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
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';
3
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
4
  import {extends as __extends} 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[CommonFields[2]],
92
+ top = __top(_props2),
93
93
  className = _props2[__className],
94
94
  other = _objectWithoutProperties(_props2, _excluded);
95
95
  return ReactCreateElement(Modal, {
package/DropFileInput.js CHANGED
@@ -1,4 +1,4 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
2
  import 'react';
3
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
4
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
@@ -1,4 +1,4 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
2
  import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
3
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
4
  import {extends as __extends} 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[CommonFields[6]];
51
+ var offset = __pageX(e);
52
52
  return function (e) {
53
- e[CommonFields[6]] && (style.transform = 'translateX(' + (e[CommonFields[6]] - offset) + 'px)');
53
+ __pageX(e) && (style.transform = 'translateX(' + (__pageX(e) - offset) + 'px)');
54
54
  };
55
55
  };
56
56
  it.initDraggedStyles = NOOP;
57
57
  it.onDragEnd = function () {
58
- var style = it.element[CommonFields[4]];
58
+ var style = it.element.style;
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[CommonFields[6]] - that.scrollOffsetX;
93
- var transformLeft = 'translateX(' + draggable[CommonFields[0]] + 'px)';
94
- var transformRight = 'translateX(-' + draggable[CommonFields[0]] + 'px)';
92
+ var offset = __pageX(e) - that.scrollOffsetX;
93
+ var transformLeft = 'translateX(' + __width(draggable) + 'px)';
94
+ var transformRight = 'translateX(-' + __width(draggable) + '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[CommonFields[4]];
99
+ var style = d.element.style;
100
100
  if (i > oldIndex) {
101
- if (offset >= bounds[CommonFields[3]]) style.transform = transformRight;else style.transform = '';
101
+ if (offset >= __left(bounds)) 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[CommonFields[3]] && offset <= bounds.right;
109
+ return offset >= __left(bounds) && offset <= bounds.right;
110
110
  });
111
- newIndex = i !== -1 ? i : list[CommonFields[5]];
111
+ newIndex = i !== -1 ? i : __length(list);
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[CommonFields[6]] - e.clientX;
117
+ that.scrollOffsetX = __pageX(e) - e.clientX;
118
118
  list.forEach(function (id) {
119
- draggables[id].bounds = draggables[id].element[CommonFields[13]]();
119
+ draggables[id].bounds = draggables[id].element.getBoundingClientRect();
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[CommonFields[4]];
125
+ var s = draggables[id].__style(element);
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[CommonFields[4]];
149
- var diff = (newIndex - oldIndex) * draggable.bounds[CommonFields[0]];
148
+ var style = draggable.element.style;
149
+ var diff = (newIndex - oldIndex) * draggable.bounds.width;
150
150
  var transform = style.transform;
151
- var position = transform.substring(11, transform[CommonFields[5]] - 3);
151
+ var position = transform.substring(11, __length(transform) - 3);
152
152
  style.transform = 'translateX(' + (position - diff) + 'px)';
153
153
  orNoop(props$1().onDrop)(data, oldIndex, newIndex);
154
154
  reset(newIndex, 'unset');