react-ui-basics 0.0.159 → 0.0.162

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 (83) hide show
  1. package/Animated.js +11 -10
  2. package/AutocompleteSelect.js +76 -77
  3. package/Button.js +24 -25
  4. package/Checkbox.js +10 -11
  5. package/CircleProgress.js +5 -6
  6. package/CommonFields.js +23 -16
  7. package/DNDContainer.js +47 -48
  8. package/DNDDraggable.js +9 -10
  9. package/DNDDroppable.js +8 -9
  10. package/Dialog.js +18 -19
  11. package/DropFileInput.js +4 -5
  12. package/DroppableHorizontalList.js +26 -27
  13. package/DroppableList.js +26 -27
  14. package/Dropzone.js +19 -20
  15. package/FilteredList.js +43 -44
  16. package/FloatingActionButton.js +6 -7
  17. package/FormUploadProgress.js +9 -10
  18. package/ImageGallery.js +125 -126
  19. package/MaterialIcon.js +5 -6
  20. package/Modal.js +19 -20
  21. package/ModalMenu.js +12 -13
  22. package/ReactConstants.d.ts +5 -4
  23. package/ReactConstants.js +6 -3
  24. package/ReactCreateElement.js +2 -1
  25. package/ReadyListener.js +10 -11
  26. package/Scrollable.js +52 -53
  27. package/ScrollableTable.js +4 -5
  28. package/Size.js +5 -6
  29. package/Snackbar.js +7 -8
  30. package/SpinningProgress.js +5 -6
  31. package/Switch.js +20 -21
  32. package/Table.d.ts +0 -1
  33. package/Table.js +50 -57
  34. package/TextField.js +24 -25
  35. package/Tools.d.ts +1 -0
  36. package/Tools.js +14 -13
  37. package/_virtual/_commonjsHelpers.js +2 -1
  38. package/_virtual/_react.js +2 -1
  39. package/_virtual/react-jsx-runtime.development.js +2 -1
  40. package/bundle.css +784 -784
  41. package/index.js +8 -7
  42. package/package.json +1 -1
  43. package/router/HistoryTools.js +2 -1
  44. package/router/Link.js +6 -7
  45. package/router/NavLink.js +5 -6
  46. package/router/Route.js +15 -16
  47. package/router/index.js +2 -3
  48. package/store/ProxyTools.js +2 -3
  49. package/store/Store.js +2 -3
  50. package/Animated.js.map +0 -1
  51. package/AutocompleteSelect.js.map +0 -1
  52. package/Button.js.map +0 -1
  53. package/Checkbox.js.map +0 -1
  54. package/CircleProgress.js.map +0 -1
  55. package/CommonFields.js.map +0 -1
  56. package/DNDContainer.js.map +0 -1
  57. package/DNDDraggable.js.map +0 -1
  58. package/DNDDroppable.js.map +0 -1
  59. package/Dialog.js.map +0 -1
  60. package/DropFileInput.js.map +0 -1
  61. package/DroppableHorizontalList.js.map +0 -1
  62. package/DroppableList.js.map +0 -1
  63. package/Dropzone.js.map +0 -1
  64. package/FilteredList.js.map +0 -1
  65. package/FloatingActionButton.js.map +0 -1
  66. package/FormUploadProgress.js.map +0 -1
  67. package/ImageGallery.js.map +0 -1
  68. package/MaterialIcon.js.map +0 -1
  69. package/Modal.js.map +0 -1
  70. package/ModalMenu.js.map +0 -1
  71. package/ReactConstants.js.map +0 -1
  72. package/ReactCreateElement.js.map +0 -1
  73. package/ReadyListener.js.map +0 -1
  74. package/Scrollable.js.map +0 -1
  75. package/ScrollableTable.js.map +0 -1
  76. package/Size.js.map +0 -1
  77. package/Snackbar.js.map +0 -1
  78. package/SpinningProgress.js.map +0 -1
  79. package/Switch.js.map +0 -1
  80. package/Table.js.map +0 -1
  81. package/TextField.js.map +0 -1
  82. package/Tools.js.map +0 -1
  83. package/index.js.map +0 -1
package/CommonFields.js CHANGED
@@ -1,18 +1,25 @@
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');
21
+ var state = createAccessor('state');
22
+ var props = createAccessor('props');
16
23
 
17
- export { clientHeight, clientWidth, CommonFields as default, getBoundingClientRect, height, left, length, pageX, pageY, scrollLeft, scrollTop, style, top, value, width };
24
+ export { clientHeight, clientWidth, createAccessor, data, height, left, length, pageX, pageY, props, scrollLeft, scrollTop, state, style, target, top, value, width };
18
25
  //# sourceMappingURL=CommonFields.js.map
package/DNDContainer.js CHANGED
@@ -1,10 +1,9 @@
1
- import CommonFields from "./CommonFields";
1
+ import ReactConstants from "./ReactConstants";
2
+ 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, props as __props, scrollLeft as __scrollLeft, scrollTop as __scrollTop, state as __state, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
3
  import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
3
4
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
5
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
5
6
  import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
6
- import {className as __className} from "./ReactConstants";
7
- import {children as __children} from "./ReactConstants";
8
7
  import { Component } from 'react';
9
8
  import ReactCreateElement from './ReactCreateElement.js';
10
9
  import { setTimeout, clearTimeout, preventDefault, addEventListener, orNoop, NOOP, removeEventListener, WINDOW, DOCUMENT, requestAnimationFrame, classNames, ref } from './Tools.js';
@@ -31,27 +30,27 @@ var DNDContainer = function (_Component) {
31
30
  _classCallCheck(this, DNDContainer);
32
31
  _this = _super.call(this, props);
33
32
  _this.draggableInitializer = function (item) {
34
- var handle = item.props.handle;
33
+ var handle = __props(item).handle;
35
34
  var draggableElement = handle && item.element.childNodes[0] || item.element;
36
35
  draggableElement.draggable = true;
37
36
  var dragStartListener = function dragStartListener(e) {
38
37
  clearSelection();
39
38
  var container = _this.container;
40
- _this.data = item.props.data;
39
+ _this.data = __props(item).data;
41
40
  _this.draggable = item;
42
- _this.scrollOffsetX = e[CommonFields[6]] - e.clientX;
43
- _this.scrollOffsetY = e[CommonFields[7]] - e.clientY;
41
+ _this.scrollOffsetX = __pageX(e) - e.clientX;
42
+ _this.scrollOffsetY = __pageY(e) - e.clientY;
44
43
  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]];
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]]);
44
+ var itemOffset = item.element.getBoundingClientRect();
45
+ item.width = __width(itemOffset);
46
+ item.height = __height(itemOffset);
47
+ var clone = orNoop(__props(item).copy)(function (it) {
48
+ var style = it.element.style;
49
+ var offsetLeft = totalOffsetLeft(container) + (e.clientX - __left(itemOffset));
50
+ var offsetTop = totalOffsetTop(container) + (e.clientY - __top(itemOffset));
52
51
  _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)';
52
+ if (__pageX(e) === 0) return;
53
+ style.transform = 'translate(' + (__pageX(e) - offsetLeft) + 'px, ' + (__pageY(e) - offsetTop) + 'px)';
55
54
  };
56
55
  requestAnimationFrame(function () {
57
56
  if (dataTransfer && !dataTransfer.setDragImage) {
@@ -61,10 +60,10 @@ var DNDContainer = function (_Component) {
61
60
  style.position = 'absolute';
62
61
  style.pointerEvents = 'none';
63
62
  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';
63
+ style.top = '0px';
64
+ style.left = '0px';
65
+ style.width = __width(itemOffset) + 'px';
66
+ style.height = __height(itemOffset) + 'px';
68
67
  }
69
68
  _this.onDrag(e);
70
69
  it.setState({
@@ -103,7 +102,7 @@ var DNDContainer = function (_Component) {
103
102
  var dragStarted = false;
104
103
  var dragged = false;
105
104
  addListener(draggableElement, item, 'touchstart', function (e) {
106
- if (e.touches[CommonFields[5]] > 1) return;
105
+ if (e.touches.length > 1) return;
107
106
  dragged = dragStarted = false;
108
107
  var touch = e.targetTouches[0];
109
108
  longTouch = setTimeout(function () {
@@ -116,7 +115,7 @@ var DNDContainer = function (_Component) {
116
115
  return;
117
116
  }
118
117
  if (!dragStarted) return;
119
- if (e.touches[CommonFields[5]] > 1) return;
118
+ if (e.touches.length > 1) return;
120
119
  preventDefault(e);
121
120
  dragged = true;
122
121
  var touch = e.targetTouches[0];
@@ -131,7 +130,7 @@ var DNDContainer = function (_Component) {
131
130
  item.setState({
132
131
  placeholder: false
133
132
  });
134
- if (e.touches[CommonFields[5]] > 0) return;
133
+ if (e.touches.length > 0) return;
135
134
  _this[droppables].forEach(function (it) {
136
135
  return it.dropIfHover();
137
136
  });
@@ -142,30 +141,30 @@ var DNDContainer = function (_Component) {
142
141
  _this[droppables].push(item);
143
142
  addEventListener(item.element, 'drop', function (e) {
144
143
  preventDefault(e);
145
- _this.data && orNoop(item.props.onDrop)(_this.data);
144
+ __data(_this) && orNoop(__props(item).onDrop)(__data(_this));
146
145
  }, false);
147
146
  item.onDragStart = function (e, draggable) {
148
- item.bounds = item.element[CommonFields[13]]();
147
+ item.bounds = item.element.getBoundingClientRect();
149
148
  item.setState({
150
149
  allow: true
151
150
  });
152
- orNoop(item.props.onDragStart)(e, draggable);
151
+ orNoop(__props(item).onDragStart)(e, draggable);
153
152
  };
154
153
  item.isHover = function (e, draggable) {
155
154
  var bounds = item.bounds;
156
155
  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;
160
- hover && orNoop(item.props.onHover)(e, draggable);
161
- if (hover) !item.state.hover && item.setState({
156
+ var y = __pageY(e) - _this.scrollOffsetY;
157
+ var x = __pageX(e) - _this.scrollOffsetX;
158
+ var hover = __left(bounds) <= x && bounds.right >= x && __top(bounds) <= y && bounds.bottom >= y;
159
+ hover && orNoop(__props(item).onHover)(e, draggable);
160
+ if (hover) !__state(item).hover && item.setState({
162
161
  hover: hover
163
- });else item.state.hover && item.setState({
162
+ });else __state(item).hover && item.setState({
164
163
  hover: hover
165
164
  });
166
165
  };
167
166
  item.dropIfHover = function () {
168
- _this.data && item.state.hover && orNoop(item.props.onDrop)(_this.data);
167
+ __data(_this) && __state(item).hover && orNoop(__props(item).onDrop)(__data(_this));
169
168
  };
170
169
  item.onDragEnd = function () {
171
170
  orNoop(orNoop(_this.draggable).onDragEnd)();
@@ -193,11 +192,11 @@ var DNDContainer = function (_Component) {
193
192
  _this.onDragEnd = function () {
194
193
  var draggable = _this.draggable;
195
194
  if (draggable.element) {
196
- var style = draggable.element[CommonFields[4]];
195
+ var style = draggable.element.style;
197
196
  style.position = '';
198
197
  style.pointerEvents = '';
199
- style[CommonFields[0]] = "";
200
- style[CommonFields[1]] = "";
198
+ style.width = "";
199
+ style.height = "";
201
200
  style.opacity = '';
202
201
  }
203
202
  draggable.setState({
@@ -208,7 +207,7 @@ var DNDContainer = function (_Component) {
208
207
  });
209
208
  _this[droppables].forEach(function (it) {
210
209
  it.onDragEnd();
211
- orNoop(it.props.onDragEnd)(_this.draggable);
210
+ orNoop(__props(it).onDragEnd)(_this.draggable);
212
211
  });
213
212
  _this.data = null;
214
213
  _this.draggable = null;
@@ -221,23 +220,23 @@ var DNDContainer = function (_Component) {
221
220
  return _this;
222
221
  }
223
222
  _createClass(DNDContainer, [{
224
- key: "render",
223
+ key: [ReactConstants[3]],
225
224
  value: function render() {
226
- var _this$props = this.props,
227
- children = _this$props[__children],
228
- className = _this$props[__className];
229
- var draggable = this.state.draggable;
225
+ var _this$props = __props(this),
226
+ children = _this$props[ReactConstants[4]],
227
+ className = _this$props[ReactConstants[5]];
228
+ var draggable = __state(this).draggable;
230
229
  return ReactCreateElement("div", {
231
- [__className]: classNames('DNDContainer', className),
230
+ [ReactConstants[5]]: classNames('DNDContainer', className),
232
231
  ref: ref('container', this)
233
232
  }, children, ReactCreateElement("div", {
234
- [__className]: "overlay"
233
+ [ReactConstants[5]]: "overlay"
235
234
  }, draggable));
236
235
  }
237
236
  }, {
238
- key: "componentDidMount",
237
+ key: [ReactConstants[0]],
239
238
  value: function componentDidMount() {
240
- var _this$props2 = this.props,
239
+ var _this$props2 = __props(this),
241
240
  provideDraggableInitializer = _this$props2.provideDraggableInitializer,
242
241
  provideDroppableInitializer = _this$props2.provideDroppableInitializer;
243
242
  orNoop(provideDraggableInitializer)(this.draggableInitializer);
@@ -258,10 +257,10 @@ var addListener = function addListener(el, item, type, listener) {
258
257
  addEventListener(el, type, item[type] = listener);
259
258
  };
260
259
  var totalOffsetTop = function totalOffsetTop(el) {
261
- return el[CommonFields[13]]()[CommonFields[2]] + (WINDOW.pageYOffset || DOCUMENT.documentElement[CommonFields[11]]);
260
+ return el.getBoundingClientRect().top + (WINDOW.pageYOffset || DOCUMENT.documentElement.scrollTop);
262
261
  };
263
262
  var totalOffsetLeft = function totalOffsetLeft(el) {
264
- return el[CommonFields[13]]()[CommonFields[3]] + (WINDOW.pageXOffset || DOCUMENT.documentElement[CommonFields[12]]);
263
+ return el.getBoundingClientRect().left + (WINDOW.pageXOffset || DOCUMENT.documentElement.scrollLeft);
265
264
  };
266
265
  var DNDContainer$1 = DNDContainer;
267
266
 
package/DNDDraggable.js CHANGED
@@ -1,10 +1,9 @@
1
- import CommonFields from "./CommonFields";
1
+ import ReactConstants from "./ReactConstants";
2
+ 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, props as __props, scrollLeft as __scrollLeft, scrollTop as __scrollTop, state as __state, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
3
  import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
3
4
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
5
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
5
6
  import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
6
- import {className as __className} from "./ReactConstants";
7
- import {children as __children} from "./ReactConstants";
8
7
  import 'react';
9
8
  import ReactCreateElement from './ReactCreateElement.js';
10
9
  import { orNoop, classNames, ref } from './Tools.js';
@@ -27,23 +26,23 @@ var Draggable = function (_PureComponent) {
27
26
  _this = _super.call(this, properties);
28
27
  var that = _assertThisInitialized(_this);
29
28
  that.state = {};
30
- that[componentDidUpdate] = function (prevProps) {
29
+ that[ReactConstants[2]] = function (prevProps) {
31
30
  if (prevProps[handle] !== props(that)[handle] || prevProps[initializer] !== props(that)[initializer]) init(that);
32
31
  };
33
- that[componentDidMount] = function () {
32
+ that[ReactConstants[0]] = function () {
34
33
  init(that);
35
34
  };
36
- that[componentWillUnmount] = function () {
35
+ that[ReactConstants[1]] = function () {
37
36
  orNoop(that.onUnmount)();
38
37
  };
39
- that[render] = function () {
38
+ that[ReactConstants[3]] = function () {
40
39
  var _state = state(that),
41
40
  _props = props(that);
42
41
  return ReactCreateElement("div", {
43
- [__className]: classNames('Draggable', _props[className], _state[dragged] && dragged, _state[placeholder] && placeholder, _state[hover] && hover),
44
- onClick: _props.onClick,
42
+ [ReactConstants[5]]: classNames('Draggable', _props[ReactConstants[5]], _state[dragged] && dragged, _state[placeholder] && placeholder, _state[hover] && hover),
43
+ [ReactConstants[6]]: _props[ReactConstants[6]],
45
44
  ref: ref('element', that)
46
- }, _props[handle], _props[children]);
45
+ }, _props[handle], _props[ReactConstants[4]]);
47
46
  };
48
47
  return _this;
49
48
  }
package/DNDDroppable.js CHANGED
@@ -1,10 +1,9 @@
1
- import CommonFields from "./CommonFields";
1
+ import ReactConstants from "./ReactConstants";
2
+ 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, props as __props, scrollLeft as __scrollLeft, scrollTop as __scrollTop, state as __state, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
3
  import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
3
4
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
5
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
5
6
  import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
6
- import {className as __className} from "./ReactConstants";
7
- import {children as __children} from "./ReactConstants";
8
7
  import 'react';
9
8
  import ReactCreateElement from './ReactCreateElement.js';
10
9
  import { orNoop, classNames, preventDefault, stopPropagation, ref } from './Tools.js';
@@ -24,26 +23,26 @@ var Droppable = function (_PureComponent) {
24
23
  _classCallCheck(this, Droppable);
25
24
  _this = _super.call(this, properties);
26
25
  var that = _assertThisInitialized(_this);
27
- that[componentDidUpdate] = function (prevProps) {
26
+ that[ReactConstants[2]] = function (prevProps) {
28
27
  if (prevProps[initializer] !== props(that)[initializer]) init(that);
29
28
  };
30
- that[componentDidMount] = function () {
29
+ that[ReactConstants[0]] = function () {
31
30
  init(that);
32
31
  };
33
- that[componentWillUnmount] = function () {
32
+ that[ReactConstants[1]] = function () {
34
33
  orNoop(that.onUnmount)();
35
34
  };
36
- that[render] = function () {
35
+ that[ReactConstants[3]] = function () {
37
36
  var _props = props(that),
38
37
  _state = state(that);
39
38
  return ReactCreateElement("div", {
40
- [__className]: classNames('Droppable', _props[className], _state[hover] && hover, _state[allow] && allow),
39
+ [ReactConstants[5]]: classNames('Droppable', _props[ReactConstants[5]], _state[hover] && hover, _state[allow] && allow),
41
40
  onDragOver: function onDragOver(e) {
42
41
  preventDefault(e);
43
42
  stopPropagation(e);
44
43
  },
45
44
  ref: ref('element', that)
46
- }, _props[children]);
45
+ }, _props[ReactConstants[4]]);
47
46
  };
48
47
  return _this;
49
48
  }
package/Dialog.js CHANGED
@@ -1,10 +1,9 @@
1
- import CommonFields from "./CommonFields";
1
+ import ReactConstants from "./ReactConstants";
2
+ 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, props as __props, scrollLeft as __scrollLeft, scrollTop as __scrollTop, state as __state, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
3
  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
4
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
5
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
5
6
  import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
6
- import {className as __className} from "./ReactConstants";
7
- import {children as __children} from "./ReactConstants";
8
7
  import { Component } from 'react';
9
8
  import ReactCreateElement from './ReactCreateElement.js';
10
9
  import Button from './Button.js';
@@ -13,7 +12,7 @@ import { classNames, UNDEFINED, isUndefined, orNoop, createRef, preventDefault }
13
12
  import { render, stateGSs, componentDidMount, PureComponent, propsGetter } from './ReactConstants.js';
14
13
  import PropTypes from 'prop-types';
15
14
 
16
- var _excluded = ["top", "className"];
15
+ var _excluded = ["top", [ReactConstants[5]]];
17
16
  var Dialog = function (_PureComponent) {
18
17
  _inherits(Dialog, _PureComponent);
19
18
  var _super = _createSuper(Dialog);
@@ -21,29 +20,29 @@ var Dialog = function (_PureComponent) {
21
20
  var _this;
22
21
  _classCallCheck(this, Dialog);
23
22
  _this = _super.call(this, properties);
24
- _this[render] = function () {
25
- var _this$props = _this.props,
23
+ _this[ReactConstants[3]] = function () {
24
+ var _this$props = __props(_this),
26
25
  title = _this$props.title,
27
26
  description = _this$props.description,
28
27
  accept = _this$props.accept,
29
28
  cancel = _this$props.cancel,
30
29
  onAccept = _this$props.onAccept,
31
30
  onCancel = _this$props.onCancel,
32
- children = _this$props[__children];
31
+ children = _this$props[ReactConstants[4]];
33
32
  return ReactCreateElement("div", {
34
- [__className]: "Dialog"
33
+ [ReactConstants[5]]: "Dialog"
35
34
  }, title && ReactCreateElement("div", {
36
- [__className]: "title"
35
+ [ReactConstants[5]]: "title"
37
36
  }, title), description && ReactCreateElement("div", {
38
- [__className]: "description"
37
+ [ReactConstants[5]]: "description"
39
38
  }, description), children, ReactCreateElement("div", {
40
- [__className]: "row right"
39
+ [ReactConstants[5]]: "row right"
41
40
  }, cancel && ReactCreateElement(Button, {
42
41
  flat: true,
43
- onClick: onCancel
42
+ [ReactConstants[6]]: onCancel
44
43
  }, cancel), accept && ReactCreateElement(Button, {
45
44
  flat: true,
46
- onClick: onAccept
45
+ [ReactConstants[6]]: onAccept
47
46
  }, accept)));
48
47
  };
49
48
  return _this;
@@ -87,14 +86,14 @@ var DialogWrapper = function (_Component) {
87
86
  orNoop(props().onAccept || onAcceptState())();
88
87
  closeRef()();
89
88
  };
90
- that[render] = function () {
89
+ that[ReactConstants[3]] = function () {
91
90
  var _props2 = props(),
92
- top = _props2[CommonFields[2]],
93
- className = _props2[__className],
91
+ top = __top(_props2),
92
+ className = _props2[ReactConstants[5]],
94
93
  other = _objectWithoutProperties(_props2, _excluded);
95
94
  return ReactCreateElement(Modal, {
96
95
  top: top,
97
- [__className]: classNames('DialogModal', className),
96
+ [ReactConstants[5]]: classNames('DialogModal', className),
98
97
  open: openRef,
99
98
  close: closeRef,
100
99
  onClose: onCancel
@@ -142,7 +141,7 @@ var DialogWrapper = function (_Component) {
142
141
  }
143
142
  openRef()();
144
143
  };
145
- that[componentDidMount] = function () {
144
+ that[ReactConstants[0]] = function () {
146
145
  var _props = props();
147
146
  orNoop(_props.open)(that.open);
148
147
  orNoop(_props.close)(closeRef());
@@ -161,7 +160,7 @@ if (process.env.NODE_ENV !== 'production') {
161
160
  cancel: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
162
161
  onAccept: PropTypes.func,
163
162
  onCancel: PropTypes.func,
164
- [__className]: PropTypes.string,
163
+ [ReactConstants[5]]: PropTypes.string,
165
164
  top: PropTypes.number
166
165
  };
167
166
  }
package/DropFileInput.js CHANGED
@@ -1,10 +1,9 @@
1
- import CommonFields from "./CommonFields";
1
+ import ReactConstants from "./ReactConstants";
2
+ 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, props as __props, scrollLeft as __scrollLeft, scrollTop as __scrollTop, state as __state, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
3
  import 'react';
3
4
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
5
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
5
6
  import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
6
- import {className as __className} from "./ReactConstants";
7
- import {children as __children} from "./ReactConstants";
8
7
  import ReactCreateElement from './ReactCreateElement.js';
9
8
  import Dropzone from './Dropzone.js';
10
9
  import PropTypes from 'prop-types';
@@ -19,14 +18,14 @@ var DropFileInput = function DropFileInput(_ref) {
19
18
  multiple = _ref.multiple,
20
19
  accept = _ref.accept;
21
20
  return ReactCreateElement("section", {
22
- [__className]: "DropFileInput"
21
+ [ReactConstants[5]]: "DropFileInput"
23
22
  }, ReactCreateElement(Dropzone, {
24
23
  droppable: droppable,
25
24
  onDrop: onDrop,
26
25
  accept: accept,
27
26
  multiple: multiple
28
27
  }, ReactCreateElement(MaterialIcon, {
29
- [__className]: classNames("icon", label && 'withText'),
28
+ [ReactConstants[5]]: classNames("icon", label && 'withText'),
30
29
  icon: icon
31
30
  }), label && ReactCreateElement("div", null, label)));
32
31
  };
@@ -1,10 +1,9 @@
1
- import CommonFields from "./CommonFields";
1
+ import ReactConstants from "./ReactConstants";
2
+ 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, props as __props, scrollLeft as __scrollLeft, scrollTop as __scrollTop, state as __state, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
3
  import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
3
4
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
5
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
5
6
  import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
6
- import {className as __className} from "./ReactConstants";
7
- import {children as __children} from "./ReactConstants";
8
7
  import React, { Component } from 'react';
9
8
  import ReactCreateElement from './ReactCreateElement.js';
10
9
  import DNDDroppable from './DNDDroppable.js';
@@ -28,13 +27,13 @@ var DroppableHorizontalList = function (_Component) {
28
27
  var list;
29
28
  var init = function init() {
30
29
  list = [];
31
- React.Children.forEach(props$1()[children], function (child) {
30
+ React.Children.forEach(props$1()[ReactConstants[4]], function (child) {
32
31
  child && child.type === DNDDraggable && list.push(props(child).id);
33
32
  });
34
33
  };
35
34
  init();
36
- that[componentDidUpdate] = function (prevProps) {
37
- if (prevProps[children] !== props$1()[children]) {
35
+ that[ReactConstants[2]] = function (prevProps) {
36
+ if (prevProps[ReactConstants[4]] !== props$1()[ReactConstants[4]]) {
38
37
  init();
39
38
  }
40
39
  };
@@ -42,20 +41,20 @@ var DroppableHorizontalList = function (_Component) {
42
41
  var dragging;
43
42
  var oldIndex;
44
43
  var newIndex;
45
- that[componentDidMount] = function () {
44
+ that[ReactConstants[0]] = function () {
46
45
  var inTransition = false;
47
46
  orNoop(props$1().provideDraggableEnhancer)(function (initializer) {
48
47
  return function (it) {
49
48
  orNoop(initializer)(it);
50
49
  it.createPositionListener = function (e, style) {
51
- var offset = e[CommonFields[6]];
50
+ var offset = __pageX(e);
52
51
  return function (e) {
53
- e[CommonFields[6]] && (style.transform = 'translateX(' + (e[CommonFields[6]] - offset) + 'px)');
52
+ __pageX(e) && (style.transform = 'translateX(' + (__pageX(e) - offset) + 'px)');
54
53
  };
55
54
  };
56
55
  it.initDraggedStyles = NOOP;
57
56
  it.onDragEnd = function () {
58
- var style = it.element[CommonFields[4]];
57
+ var style = it.element.style;
59
58
  inTransition = true;
60
59
  setTimeout(function () {
61
60
  var droppingDuration = props$1().droppingDuration || 100;
@@ -89,16 +88,16 @@ var DroppableHorizontalList = function (_Component) {
89
88
  });
90
89
  };
91
90
  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)';
91
+ var offset = __pageX(e) - that.scrollOffsetX;
92
+ var transformLeft = 'translateX(' + __width(draggable) + 'px)';
93
+ var transformRight = 'translateX(-' + __width(draggable) + 'px)';
95
94
  list.forEach(function (id, i) {
96
95
  if (i !== oldIndex) {
97
96
  var d = draggables[id];
98
97
  var bounds = d.bounds;
99
- var style = d.element[CommonFields[4]];
98
+ var style = d.element.style;
100
99
  if (i > oldIndex) {
101
- if (offset >= bounds[CommonFields[3]]) style.transform = transformRight;else style.transform = '';
100
+ if (offset >= __left(bounds)) style.transform = transformRight;else style.transform = '';
102
101
  } else {
103
102
  if (offset <= bounds.right) style.transform = transformLeft;else style.transform = '';
104
103
  }
@@ -106,23 +105,23 @@ var DroppableHorizontalList = function (_Component) {
106
105
  });
107
106
  var i = list.findIndex(function (id) {
108
107
  var bounds = draggables[id].bounds;
109
- return offset >= bounds[CommonFields[3]] && offset <= bounds.right;
108
+ return offset >= __left(bounds) && offset <= bounds.right;
110
109
  });
111
- newIndex = i !== -1 ? i : list[CommonFields[5]];
110
+ newIndex = i !== -1 ? i : __length(list);
112
111
  };
113
112
  var onDragStart = function onDragStart(e, draggable) {
114
113
  dragging = true;
115
114
  dropped = false;
116
115
  oldIndex = list.indexOf(props(draggable).id);
117
- that.scrollOffsetX = e[CommonFields[6]] - e.clientX;
116
+ that.scrollOffsetX = __pageX(e) - e.clientX;
118
117
  list.forEach(function (id) {
119
- draggables[id].bounds = draggables[id].element[CommonFields[13]]();
118
+ draggables[id].bounds = draggables[id].element.getBoundingClientRect();
120
119
  });
121
120
  };
122
121
  var reset = function reset(ignoredIndex, transition) {
123
122
  list.forEach(function (id, i) {
124
123
  if (i !== ignoredIndex) {
125
- var s = draggables[id].element[CommonFields[4]];
124
+ var s = draggables[id].element.style;
126
125
  s.transform = '';
127
126
  s.transition = transition;
128
127
  }
@@ -145,26 +144,26 @@ var DroppableHorizontalList = function (_Component) {
145
144
  var onDrop = function onDrop(data) {
146
145
  dropped = true;
147
146
  var draggable = draggables[list[oldIndex]];
148
- var style = draggable.element[CommonFields[4]];
149
- var diff = (newIndex - oldIndex) * draggable.bounds[CommonFields[0]];
147
+ var style = draggable.element.style;
148
+ var diff = (newIndex - oldIndex) * draggable.bounds.width;
150
149
  var transform = style.transform;
151
- var position = transform.substring(11, transform[CommonFields[5]] - 3);
150
+ var position = transform.substring(11, __length(transform) - 3);
152
151
  style.transform = 'translateX(' + (position - diff) + 'px)';
153
152
  orNoop(props$1().onDrop)(data, oldIndex, newIndex);
154
153
  reset(newIndex, 'unset');
155
154
  };
156
- that[render] = function () {
155
+ that[ReactConstants[3]] = function () {
157
156
  var _props = props$1();
158
- var className = _props[__className],
157
+ var className = _props[ReactConstants[5]],
159
158
  initializer = _props.initializer;
160
159
  return ReactCreateElement(DNDDroppable, {
161
- [__className]: classNames('DroppableList', className, resetting() && 'resetting'),
160
+ [ReactConstants[5]]: classNames('DroppableList', className, resetting() && 'resetting'),
162
161
  initializer: initializer,
163
162
  onHover: onHover,
164
163
  onDragStart: onDragStart,
165
164
  onDragEnd: onDragEnd,
166
165
  onDrop: onDrop
167
- }, _props[children]);
166
+ }, _props[ReactConstants[4]]);
168
167
  };
169
168
  return _this;
170
169
  }