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/ImageGallery.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 { createClass as _createClass, classCallCheck as _classCallCheck, objectSpread2 as _objectSpread2, defineProperty as _defineProperty, inherits as _inherits, createSuper as _createSuper, assertThisInitialized as _assertThisInitialized, slicedToArray as _slicedToArray, extends as _extends, toConsumableArray as _toConsumableArray } 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 from 'react';
9
8
  import ReactCreateElement from './ReactCreateElement.js';
10
9
  import Animated from './Animated.js';
@@ -26,8 +25,8 @@ var previewWidth = previewRatio * previewHeight;
26
25
  var previewPadding = 8;
27
26
  var previewsHeight = previewHeight + 15;
28
27
  var calculatePosition = function calculatePosition(it, ratio, width, height, previewsHeight, embedded, container) {
29
- var windowWidth = embedded ? container[CommonFields[10]] : min(DOCUMENT.body[CommonFields[10]], WINDOW.innerWidth);
30
- var windowHeight = embedded ? container[CommonFields[9]] : min(DOCUMENT.body[CommonFields[9]], WINDOW.innerHeight);
28
+ var windowWidth = embedded ? __clientWidth(container) : min(DOCUMENT.body.clientWidth, WINDOW.innerWidth);
29
+ var windowHeight = embedded ? __clientHeight(container) : min(DOCUMENT.body.clientHeight, WINDOW.innerHeight);
31
30
  var offset = it.offset;
32
31
  if (offset == null) offset = embedded ? 0 : windowHeight * 0.03;
33
32
  var offsetTop = it.offsetTop;
@@ -117,7 +116,7 @@ var Actions = _createClass(function Actions() {
117
116
  Actions.replaceImages = function (images) {
118
117
  return function (dispatch, getState) {
119
118
  var state = getState();
120
- var length = images[CommonFields[5]];
119
+ var length = __length(images);
121
120
  var nextState = _objectSpread2({}, state);
122
121
  nextState.images = images.map(function (item) {
123
122
  var image = state.images.find(function (it) {
@@ -127,14 +126,14 @@ Actions.replaceImages = function (images) {
127
126
  var it = _objectSpread2({}, item);
128
127
  var el = it.el;
129
128
  if (el) {
130
- var rect = el[CommonFields[13]]();
131
- var fromWidth = el[CommonFields[10]];
132
- var fromHeight = el[CommonFields[9]];
133
- it.fromLeftPx = toPx(rect[CommonFields[3]]);
134
- it.fromTopPx = toPx(rect[CommonFields[2]]);
129
+ var rect = el.getBoundingClientRect();
130
+ var fromWidth = __clientWidth(el);
131
+ var fromHeight = __clientHeight(el);
132
+ it.fromLeftPx = toPx(__left(rect));
133
+ it.fromTopPx = toPx(__top(rect));
135
134
  it.fromWidthPx = toPx(fromWidth);
136
135
  var ratio = fromWidth / fromHeight;
137
- calculatePosition(it, ratio, el.naturalWidth || el[CommonFields[0]], el.naturalHeight || el[CommonFields[1]], withPreviews ? previewsHeight : 0, embedded, container);
136
+ calculatePosition(it, ratio, el.naturalWidth || __width(el), el.naturalHeight || __height(el), withPreviews ? previewsHeight : 0, embedded, container);
138
137
  } else {
139
138
  it.toLeft = 100;
140
139
  it.toTop = 100;
@@ -142,7 +141,7 @@ Actions.replaceImages = function (images) {
142
141
  if (!it.toWidth || !it.toHeight || !el) Actions.loadPreview(it)(dispatch);
143
142
  return it;
144
143
  });
145
- nextState.previews[CommonFields[0]] = min(length, 5) * previewWidth + min(length - 1, 4) * previewPadding;
144
+ nextState.previews.width = min(length, 5) * previewWidth + min(length - 1, 4) * previewPadding;
146
145
  nextState.previews.totalWidth = toPx(length * previewWidth + (length - 1) * previewPadding);
147
146
  nextState.previews.images = nextState.images.map(function (item) {
148
147
  var preview = state.previews.images.find(function (it) {
@@ -151,8 +150,8 @@ Actions.replaceImages = function (images) {
151
150
  if (preview) return preview;
152
151
  var el = item.el;
153
152
  if (!el) return {};
154
- var width = el[CommonFields[10]];
155
- var height = el[CommonFields[9]];
153
+ var width = __clientWidth(el);
154
+ var height = __clientHeight(el);
156
155
  return calculatePreview(width, height, el.src);
157
156
  });
158
157
  dispatch({
@@ -164,7 +163,7 @@ Actions.replaceImages = function (images) {
164
163
  Actions.show = function (gallery) {
165
164
  return function (dispatch) {
166
165
  var images = gallery.images;
167
- var length = images[CommonFields[5]];
166
+ var length = __length(images);
168
167
  var withPreviews = length > 1 && (gallery.withPreviews === UNDEFINED || !!gallery.withPreviews);
169
168
  var container = gallery.container;
170
169
  var embedded = gallery.embedded;
@@ -178,14 +177,14 @@ Actions.show = function (gallery) {
178
177
  var it = _objectSpread2({}, item);
179
178
  var el = it.el;
180
179
  if (el) {
181
- var rect = el[CommonFields[13]]();
182
- var fromWidth = el[CommonFields[10]];
183
- var fromHeight = el[CommonFields[9]];
184
- it.fromLeftPx = toPx(rect[CommonFields[3]]);
185
- it.fromTopPx = toPx(rect[CommonFields[2]]);
180
+ var rect = el.getBoundingClientRect();
181
+ var fromWidth = __clientWidth(el);
182
+ var fromHeight = __clientHeight(el);
183
+ it.fromLeftPx = toPx(__left(rect));
184
+ it.fromTopPx = toPx(__top(rect));
186
185
  it.fromWidthPx = toPx(fromWidth);
187
186
  var ratio = fromWidth / fromHeight;
188
- calculatePosition(it, ratio, el.naturalWidth || el[CommonFields[0]], el.naturalHeight || el[CommonFields[1]], withPreviews ? previewsHeight : 0, embedded, container);
187
+ calculatePosition(it, ratio, el.naturalWidth || __width(el), el.naturalHeight || __height(el), withPreviews ? previewsHeight : 0, embedded, container);
189
188
  } else {
190
189
  it.toLeft = 100;
191
190
  it.toTop = 100;
@@ -201,8 +200,8 @@ Actions.show = function (gallery) {
201
200
  images: images.map(function (it) {
202
201
  var el = it.el;
203
202
  if (!el) return {};
204
- var width = el[CommonFields[10]];
205
- var height = el[CommonFields[9]];
203
+ var width = __clientWidth(el);
204
+ var height = __clientHeight(el);
206
205
  return calculatePreview(width, height, el.src);
207
206
  })
208
207
  }
@@ -219,7 +218,7 @@ Actions.show = function (gallery) {
219
218
  }
220
219
  }
221
220
  });
222
- data.previews.scroll = calculatePreviewsScroll(index, length, data.previews[CommonFields[0]]);
221
+ data.previews.scroll = calculatePreviewsScroll(index, length, data.previews.width);
223
222
  dispatch({
224
223
  type: ACTION_IMAGE_GALLERY_SHOW,
225
224
  data: data
@@ -274,7 +273,7 @@ Actions.loadPreview = function (item) {
274
273
  };
275
274
  };
276
275
  var reducers = (_reducers = {}, _defineProperty(_reducers, ACTION_IMAGE_GALLERY_SHOW, function (state, action) {
277
- return _objectSpread2(_objectSpread2({}, action.data), {}, {
276
+ return _objectSpread2(_objectSpread2({}, __data(action)), {}, {
278
277
  open: true
279
278
  });
280
279
  }), _defineProperty(_reducers, ACTION_IMAGE_GALLERY_CLOSE, function (state, action) {
@@ -286,11 +285,11 @@ var reducers = (_reducers = {}, _defineProperty(_reducers, ACTION_IMAGE_GALLERY_
286
285
  var result = _objectSpread2(_objectSpread2({}, state), {}, {
287
286
  images: images
288
287
  });
289
- for (var i = 0; i < images[CommonFields[5]]; i++) {
290
- if (!images[i][CommonFields[0]] && !images[i].fromWidthPx) continue;
288
+ for (var i = 0; i < __length(images); i++) {
289
+ if (!__width(images[i]) && !images[i].fromWidthPx) continue;
291
290
  var it = _objectSpread2({}, images[i]);
292
- var width = it[CommonFields[0]] || Number.parseInt(it.fromWidthPx);
293
- var height = it[CommonFields[1]] || Number.parseInt(it.fromHeightPx);
291
+ var width = __width(it) || Number.parseInt(it.fromWidthPx);
292
+ var height = __height(it) || Number.parseInt(it.fromHeightPx);
294
293
  calculatePosition(it, width / height, width, height, result.previews.show ? previewsHeight : 0, state.embedded, state.container);
295
294
  images[i] = it;
296
295
  }
@@ -305,8 +304,8 @@ var reducers = (_reducers = {}, _defineProperty(_reducers, ACTION_IMAGE_GALLERY_
305
304
  var index = images.findIndex(function (it) {
306
305
  return it.id === item.id;
307
306
  });
308
- var width = image[CommonFields[0]];
309
- var height = image[CommonFields[1]];
307
+ var width = __width(image);
308
+ var height = __height(image);
310
309
  var it = _objectSpread2(_objectSpread2({}, images[index]), {}, {
311
310
  loaded: true,
312
311
  width: width,
@@ -326,11 +325,11 @@ var reducers = (_reducers = {}, _defineProperty(_reducers, ACTION_IMAGE_GALLERY_
326
325
  return it.id === item.id;
327
326
  });
328
327
  var it = _objectSpread2({}, images[index]);
329
- if (!it.toWidth || !it.toHeight) calculatePosition(it, image[CommonFields[0]] / image[CommonFields[1]], image[CommonFields[0]], image[CommonFields[1]], result.previews.show ? previewsHeight : 0, state.embedded, state.container);
328
+ if (!it.toWidth || !it.toHeight) calculatePosition(it, __width(image) / __height(image), __width(image), __height(image), result.previews.show ? previewsHeight : 0, state.embedded, state.container);
330
329
  images[index] = it;
331
330
  var previewImages = _toConsumableArray(state.previews.images);
332
331
  result.previews.images = previewImages;
333
- var preview = calculatePreview(image[CommonFields[0]], image[CommonFields[1]], image.src);
332
+ var preview = calculatePreview(__width(image), __height(image), image.src);
334
333
  previewImages[index] = preview;
335
334
  return result;
336
335
  }), _reducers);
@@ -354,7 +353,7 @@ var big = function big(it, index, i, shift, length, previous) {
354
353
  if (index !== i) {
355
354
  var width = WINDOW.innerWidth;
356
355
  var additionalOffset = it.toLeft < 0 ? -it.toLeft : 0;
357
- if (i < index) styles[CommonFields[3]] = toPx(it.toLeft - width - additionalOffset + (i + 1 === index ? shift : 0));else styles[CommonFields[3]] = toPx(it.toLeft + width + additionalOffset + (i - 1 === index ? shift : 0));
356
+ if (i < index) styles.left = toPx(it.toLeft - width - additionalOffset + (i + 1 === index ? shift : 0));else styles.left = toPx(it.toLeft + width + additionalOffset + (i - 1 === index ? shift : 0));
358
357
  }
359
358
  return styles;
360
359
  };
@@ -375,7 +374,7 @@ var ImageGallery = function (_React$Component) {
375
374
  zoomed = _stateGSs2[3],
376
375
  previewScroll = _stateGSs2[4];
377
376
  var props = propsGetter(that);
378
- that[componentDidUpdate] = function (prevProps, prevState, snapshot) {
377
+ that[ReactConstants[2]] = function (prevProps, prevState, snapshot) {
379
378
  if (props().open !== prevProps.open && !props().open) {
380
379
  setTimeout(function () {
381
380
  shift(0);
@@ -388,7 +387,7 @@ var ImageGallery = function (_React$Component) {
388
387
  var indexValue = index() !== UNDEFINED ? index() : props().index;
389
388
  var image = images[indexValue];
390
389
  if (!image) {
391
- var i = images[CommonFields[5]] - 1;
390
+ var i = __length(images) - 1;
392
391
  if (i === -1) {
393
392
  if (prevProps.images !== images) {
394
393
  onClose();
@@ -403,16 +402,16 @@ var ImageGallery = function (_React$Component) {
403
402
  var resizeListener = debounce(function () {
404
403
  props().open && props().recalculate();
405
404
  }, 100);
406
- that[componentDidMount] = function () {
405
+ that[ReactConstants[0]] = function () {
407
406
  addEventListener(WINDOW, 'resize', resizeListener);
408
407
  };
409
- that[componentWillUnmount] = function () {
408
+ that[ReactConstants[1]] = function () {
410
409
  removeEventListener(WINDOW, 'resize', resizeListener);
411
410
  };
412
411
  var onClose = function onClose() {
413
412
  resetZoom();
414
413
  moveListenerAdded = false;
415
- _this.props.close();
414
+ __props(_this).close();
416
415
  };
417
416
  var onKeyDown = function onKeyDown(e) {
418
417
  var keyCode = e.keyCode;
@@ -452,22 +451,22 @@ var ImageGallery = function (_React$Component) {
452
451
  var resetZoom = function resetZoom() {
453
452
  if (!zoomed()) return;
454
453
  zoomed(false);
455
- zoomedImage[CommonFields[4]][CommonFields[0]] = defaultWidth;
456
- zoomedImage[CommonFields[4]][CommonFields[3]] = defaultLeft;
457
- zoomedImage[CommonFields[4]][CommonFields[2]] = defaultTop;
458
- zoomedImage[CommonFields[4]].transition = null;
454
+ __style(zoomedImage).width = defaultWidth;
455
+ __style(zoomedImage).left = defaultLeft;
456
+ __style(zoomedImage).top = defaultTop;
457
+ __style(zoomedImage).transition = null;
459
458
  touchpadStarted = null;
460
459
  };
461
460
  var initZoom = function initZoom() {
462
461
  zoomed(true);
463
- defaultWidth = zoomedImage[CommonFields[4]][CommonFields[0]];
464
- defaultLeft = zoomedImage[CommonFields[4]][CommonFields[3]];
465
- defaultTop = zoomedImage[CommonFields[4]][CommonFields[2]];
462
+ defaultWidth = __style(zoomedImage).width;
463
+ defaultLeft = __style(zoomedImage).left;
464
+ defaultTop = __style(zoomedImage).top;
466
465
  };
467
466
  var initTouchpadDragging = function initTouchpadDragging() {
468
- oldLeft = Number.parseFloat(zoomedImage[CommonFields[4]][CommonFields[3]]);
469
- oldTop = Number.parseFloat(zoomedImage[CommonFields[4]][CommonFields[2]]);
470
- zoomedImage[CommonFields[4]].transition = 'none';
467
+ oldLeft = Number.parseFloat(__style(zoomedImage).left);
468
+ oldTop = Number.parseFloat(__style(zoomedImage).top);
469
+ __style(zoomedImage).transition = 'none';
471
470
  touchpadStarted = true;
472
471
  };
473
472
  var onWheel = function onWheel(e) {
@@ -479,43 +478,43 @@ var ImageGallery = function (_React$Component) {
479
478
  if (e.ctrlKey) {
480
479
  var diff = e.deltaY * 0.005;
481
480
  var newZoom = Math.min(Math.max(zoomValue + diff, 0.5), 10);
482
- var zoomX = e[CommonFields[6]];
481
+ var zoomX = __pageX(e);
483
482
  oldLeft = zoomX - (zoomX - oldLeft) * newZoom / zoomValue;
484
- var zoomY = e[CommonFields[7]];
483
+ var zoomY = __pageY(e);
485
484
  oldTop = zoomY - (zoomY - oldTop) * newZoom / zoomValue;
486
485
  zoomValue = newZoom;
487
- zoomedImage[CommonFields[4]][CommonFields[0]] = zoomValue * 100 + '%';
486
+ __style(zoomedImage).width = zoomValue * 100 + '%';
488
487
  } else {
489
488
  oldLeft += e.deltaX * 0.5;
490
489
  oldTop += e.deltaY * 0.5;
491
490
  }
492
- zoomedImage[CommonFields[4]][CommonFields[3]] = oldLeft + 'px';
493
- zoomedImage[CommonFields[4]][CommonFields[2]] = oldTop + 'px';
491
+ __style(zoomedImage).left = oldLeft + 'px';
492
+ __style(zoomedImage).top = oldTop + 'px';
494
493
  };
495
494
  var moveListenerAdded;
496
495
  var onTouchStart = function onTouchStart(e) {
497
496
  e.swipeProcessed = false;
498
497
  if (e.button === 2) return;
499
498
  var touches = e.touches || [{
500
- pageX: e[CommonFields[6]],
501
- pageY: e[CommonFields[7]]
499
+ pageX: __pageX(e),
500
+ pageY: __pageY(e)
502
501
  }];
503
- zoomedImage = e.target;
502
+ zoomedImage = __target(e);
504
503
  zoomedImage = zoomedImage.tagName.toLowerCase() === 'img' ? zoomedImage.parentElement : zoomedImage;
505
- oldLeft = Number.parseFloat(zoomedImage[CommonFields[4]][CommonFields[3]]);
506
- oldTop = Number.parseFloat(zoomedImage[CommonFields[4]][CommonFields[2]]);
504
+ oldLeft = Number.parseFloat(__style(zoomedImage).left);
505
+ oldTop = Number.parseFloat(__style(zoomedImage).top);
507
506
  if (zoomed()) {
508
- zoomedImage[CommonFields[4]].transition = 'none';
507
+ __style(zoomedImage).transition = 'none';
509
508
  }
510
509
  if (!moveListenerAdded) {
511
510
  addEventListener(_this.gallery, 'touchmove', onTouchMove, false);
512
511
  moveListenerAdded = true;
513
512
  }
514
- if (touches[CommonFields[5]] === 2) {
513
+ if (__length(touches) === 2) {
515
514
  if (zoomed()) zoomValueStarted = zoomValue;else if (!props().embedded) {
516
515
  initZoom();
517
- zoomedImage[CommonFields[4]].transition = 'none';
518
- zoomValueStarted = zoomValue = Number.parseFloat(zoomedImage[CommonFields[4]][CommonFields[0]]) / WINDOW.innerWidth;
516
+ __style(zoomedImage).transition = 'none';
517
+ zoomValueStarted = zoomValue = Number.parseFloat(__style(zoomedImage).width) / WINDOW.innerWidth;
519
518
  }
520
519
  }
521
520
  touchesStart = touches;
@@ -526,25 +525,25 @@ var ImageGallery = function (_React$Component) {
526
525
  var distance = function distance(touches) {
527
526
  var a = touches[0];
528
527
  var b = touches[1];
529
- return Math.sqrt(power2(a[CommonFields[6]] - b[CommonFields[6]]) + power2(a[CommonFields[7]] - b[CommonFields[7]]));
528
+ return Math.sqrt(power2(__pageX(a) - __pageX(b)) + power2(__pageY(a) - __pageY(b)));
530
529
  };
531
530
  var center = function center(touches) {
532
531
  var a = touches[0];
533
532
  var b = touches[1];
534
533
  return {
535
- x: (a[CommonFields[6]] + b[CommonFields[6]]) / 2,
536
- y: (a[CommonFields[7]] + b[CommonFields[7]]) / 2
534
+ x: (__pageX(a) + __pageX(b)) / 2,
535
+ y: (__pageY(a) + __pageY(b)) / 2
537
536
  };
538
537
  };
539
538
  var onTouchMove = function onTouchMove(e) {
540
539
  if (!touchesStart) return;
541
540
  var touches = e.touches || [{
542
- pageX: e[CommonFields[6]],
543
- pageY: e[CommonFields[7]]
541
+ pageX: __pageX(e),
542
+ pageY: __pageY(e)
544
543
  }];
545
544
  if (zoomed()) {
546
545
  preventDefault(e);
547
- if (touches[CommonFields[5]] === 2) {
546
+ if (__length(touches) === 2) {
548
547
  var diff = distance(touches) / distance(touchesStart);
549
548
  zoomValue = Math.min(Math.max(zoomValueStarted * diff, 0.5), 10);
550
549
  var zoomedAt = center(touchesStart);
@@ -552,24 +551,24 @@ var ImageGallery = function (_React$Component) {
552
551
  var newLeft = zoomX - (zoomX - oldLeft) * zoomValue / zoomValueStarted;
553
552
  var zoomY = zoomedAt.y;
554
553
  var newTop = zoomY - (zoomY - oldTop) * zoomValue / zoomValueStarted;
555
- zoomedImage[CommonFields[4]][CommonFields[3]] = newLeft + 'px';
556
- zoomedImage[CommonFields[4]][CommonFields[2]] = newTop + 'px';
557
- zoomedImage[CommonFields[4]][CommonFields[0]] = zoomValue * 100 + '%';
554
+ __style(zoomedImage).left = newLeft + 'px';
555
+ __style(zoomedImage).top = newTop + 'px';
556
+ __style(zoomedImage).width = zoomValue * 100 + '%';
558
557
  return;
559
558
  } else {
560
559
  var _touch = touches[0];
561
560
  var _touchStart = touchesStart[0];
562
- var _newLeft = oldLeft + _touch[CommonFields[6]] - _touchStart[CommonFields[6]];
563
- var _newTop = oldTop + _touch[CommonFields[7]] - _touchStart[CommonFields[7]];
564
- zoomedImage[CommonFields[4]][CommonFields[3]] = _newLeft + 'px';
565
- zoomedImage[CommonFields[4]][CommonFields[2]] = _newTop + 'px';
561
+ var _newLeft = oldLeft + __pageX(_touch) - __pageX(_touchStart);
562
+ var _newTop = oldTop + __pageY(_touch) - __pageY(_touchStart);
563
+ __style(zoomedImage).left = _newLeft + 'px';
564
+ __style(zoomedImage).top = _newTop + 'px';
566
565
  return;
567
566
  }
568
567
  }
569
- if (touches[CommonFields[5]] > 1 || zoomed()) return;
568
+ if (__length(touches) > 1 || zoomed()) return;
570
569
  var touch = touches[0];
571
570
  var touchStart = touchesStart[0];
572
- shift(touch[CommonFields[6]] - touchStart[CommonFields[6]]);
571
+ shift(__pageX(touch) - __pageX(touchStart));
573
572
  };
574
573
  var onTouchEnd = function onTouchEnd(e) {
575
574
  if (!touchesStart) return;
@@ -581,13 +580,13 @@ var ImageGallery = function (_React$Component) {
581
580
  return;
582
581
  }
583
582
  var touches = e.changedTouches || [{
584
- pageX: e[CommonFields[6]],
585
- pageY: e[CommonFields[7]]
583
+ pageX: __pageX(e),
584
+ pageY: __pageY(e)
586
585
  }];
587
586
  var touchEnd = touches[0];
588
587
  var touchStart = touchesStart[0];
589
- var distX = touchEnd[CommonFields[6]] - touchStart[CommonFields[6]];
590
- var distY = touchEnd[CommonFields[7]] - touchStart[CommonFields[7]];
588
+ var distX = __pageX(touchEnd) - __pageX(touchStart);
589
+ var distY = __pageY(touchEnd) - __pageY(touchStart);
591
590
  touchesStart = UNDEFINED;
592
591
  shift(0);
593
592
  var minDistance = 20;
@@ -604,14 +603,14 @@ var ImageGallery = function (_React$Component) {
604
603
  previews = _props.previews;
605
604
  index(i);
606
605
  previous(prev);
607
- previewScroll(calculatePreviewsScroll(i, previews.images[CommonFields[5]], previews[CommonFields[0]]));
606
+ previewScroll(calculatePreviewsScroll(i, previews.images.length, __width(previews)));
608
607
  };
609
608
  var left = function left(e) {
610
609
  if (zoomed()) return;
611
610
  preventDefault(e);
612
611
  stopPropagation(e);
613
612
  var indexValue = index() !== UNDEFINED ? index() : props().index;
614
- if (indexValue > 0) scrollTo(indexValue - 1, indexValue);else if (props().loop) scrollTo(props().images[CommonFields[5]] - 1, indexValue);
613
+ if (indexValue > 0) scrollTo(indexValue - 1, indexValue);else if (props().loop) scrollTo(props().images.length - 1, indexValue);
615
614
  };
616
615
  var right = function right(e) {
617
616
  if (zoomed()) return;
@@ -620,23 +619,23 @@ var ImageGallery = function (_React$Component) {
620
619
  var _props2 = props(),
621
620
  images = _props2.images;
622
621
  var indexValue = index() !== UNDEFINED ? index() : props().index;
623
- if (indexValue < images[CommonFields[5]] - 1) scrollTo(indexValue + 1, indexValue);else if (props().loop) scrollTo(0, indexValue);
622
+ if (indexValue < __length(images) - 1) scrollTo(indexValue + 1, indexValue);else if (props().loop) scrollTo(0, indexValue);
624
623
  };
625
624
  that.scrollTo = scrollTo;
626
- that[CommonFields[3]] = left;
625
+ that.left = left;
627
626
  that.right = right;
628
627
  var animatedRoundButton = function animatedRoundButton(show, className, onClick, icon) {
629
628
  return ReactCreateElement(Animated, {
630
629
  value: show
631
630
  }, ReactCreateElement(Button, {
632
- [__className]: className,
633
- onClick: onClick,
631
+ [ReactConstants[5]]: className,
632
+ [ReactConstants[6]]: onClick,
634
633
  round: true
635
634
  }, ReactCreateElement(MaterialIcon, {
636
635
  icon: icon
637
636
  })));
638
637
  };
639
- that[render] = function () {
638
+ that[ReactConstants[3]] = function () {
640
639
  var _props3 = props(),
641
640
  open = _props3.open;
642
641
  var _props4 = props(),
@@ -647,17 +646,17 @@ var ImageGallery = function (_React$Component) {
647
646
  indicator = _props4.indicator,
648
647
  embedded = _props4.embedded,
649
648
  loop = _props4.loop,
650
- _onClick = _props4.onClick,
651
- children = _props4[__children];
649
+ _onClick = _props4[ReactConstants[6]],
650
+ children = _props4[ReactConstants[4]];
652
651
  var indexValue = index() !== UNDEFINED ? index() : props().index;
653
- var length = images[CommonFields[5]];
652
+ var length = __length(images);
654
653
  var isZoomed = zoomed();
655
654
  var shiftValue = shift() || 0;
656
655
  previous();
657
656
  return ReactCreateElement(Animated, {
658
657
  value: open
659
658
  }, ReactCreateElement("div", {
660
- [__className]: classNames('ImageGallery', embedded && 'embedded', isZoomed && 'zoomed'),
659
+ [ReactConstants[5]]: classNames('ImageGallery', embedded && 'embedded', isZoomed && 'zoomed'),
661
660
  tabIndex: 0,
662
661
  ref: function ref(it) {
663
662
  return (that.gallery = it) && !embedded && it.focus();
@@ -687,33 +686,33 @@ var ImageGallery = function (_React$Component) {
687
686
  }, ReactCreateElement("div", {
688
687
  draggable: false,
689
688
  onDoubleClick: function onDoubleClick(e) {
690
- var img = e.target;
691
- if (img.naturalWidth === img[CommonFields[10]] && img.naturalHeight === img[CommonFields[9]]) return;
689
+ var img = __target(e);
690
+ if (img.naturalWidth === __clientWidth(img) && img.naturalHeight === __clientHeight(img)) return;
692
691
  if (!isZoomed) {
693
692
  zoomedImage = img.tagName.toLowerCase() === 'img' ? img.parentElement : img;
694
693
  initZoom();
695
694
  zoomValue = 2;
696
695
  var newWidth = WINDOW.innerWidth * 2;
697
- var oldWidth = Number.parseFloat(zoomedImage[CommonFields[4]][CommonFields[0]]);
698
- var _oldLeft = Number.parseFloat(zoomedImage[CommonFields[4]][CommonFields[3]]);
699
- var zoomX = e[CommonFields[6]];
696
+ var oldWidth = Number.parseFloat(__style(zoomedImage).width);
697
+ var _oldLeft = Number.parseFloat(__style(zoomedImage).left);
698
+ var zoomX = __pageX(e);
700
699
  var diff = newWidth / oldWidth;
701
700
  var newLeft = zoomX - (zoomX - _oldLeft) * diff;
702
- var _oldTop = Number.parseFloat(zoomedImage[CommonFields[4]][CommonFields[2]]);
703
- var zoomY = e[CommonFields[7]];
701
+ var _oldTop = Number.parseFloat(__style(zoomedImage).top);
702
+ var zoomY = __pageY(e);
704
703
  var newTop = zoomY - (zoomY - _oldTop) * diff;
705
- zoomedImage[CommonFields[4]][CommonFields[0]] = '200%';
706
- zoomedImage[CommonFields[4]][CommonFields[3]] = newLeft + 'px';
707
- zoomedImage[CommonFields[4]][CommonFields[2]] = newTop + 'px';
704
+ __style(zoomedImage).width = '200%';
705
+ __style(zoomedImage).left = newLeft + 'px';
706
+ __style(zoomedImage).top = newTop + 'px';
708
707
  } else {
709
708
  resetZoom();
710
709
  }
711
710
  },
712
- onClick: function onClick(e) {
711
+ [ReactConstants[6]]: function onClick(e) {
713
712
  !e.swipeProcessed && orNoop(_onClick)(e, it, i);
714
713
  },
715
714
  key: i,
716
- [__className]: classNames('image', touchesStart && 'dragging', isZoomedCurrent && 'zoomed', i === indexValue && 'current')
715
+ [ReactConstants[5]]: classNames('image', touchesStart && 'dragging', isZoomedCurrent && 'zoomed', i === indexValue && 'current')
717
716
  }, ReactCreateElement("img", {
718
717
  draggable: false,
719
718
  src: loaded ? it.url : it.previewUrl,
@@ -721,29 +720,29 @@ var ImageGallery = function (_React$Component) {
721
720
  }), ReactCreateElement(Animated, {
722
721
  value: !loaded && Math.abs(indexValue - i) <= 1
723
722
  }, ReactCreateElement("div", {
724
- [__className]: 'spinner'
723
+ [ReactConstants[5]]: 'spinner'
725
724
  }, ReactCreateElement(SpinningProgress, null))), !embedded && animatedRoundButton(open && !isZoomedCurrent, 'close', onClose, 'close'), ReactCreateElement(Animated, {
726
725
  value: loaded && !isZoomedCurrent
727
726
  }, ReactCreateElement("div", {
728
- [__className]: "counter"
727
+ [ReactConstants[5]]: "counter"
729
728
  }, indexValue + 1, " / ", length)), !isZoomedCurrent && loaded && it.overlay));
730
729
  }), animatedRoundButton(open && length > 1 && (indexValue > 0 || loop) && !isZoomed, 'arrow left', left, 'chevron_left'), animatedRoundButton(open && length > 1 && (indexValue !== length - 1 || loop) && !isZoomed, 'arrow right', right, 'chevron_right'), ReactCreateElement(Animated, {
731
730
  value: open && length > 1 && !isZoomed
732
731
  }, ReactCreateElement("div", {
733
- [__className]: "counter"
732
+ [ReactConstants[5]]: "counter"
734
733
  }, indexValue + 1, " / ", length)), indicator && ReactCreateElement(Animated, {
735
734
  value: open && length > 1 && !isZoomed
736
735
  }, indicator(indexValue, length)), ReactCreateElement(Animated, {
737
736
  value: open && previews.show && !isZoomed
738
737
  }, ReactCreateElement("div", {
739
- [__className]: "previews",
738
+ [ReactConstants[5]]: "previews",
740
739
  style: {
741
- width: previews[CommonFields[0]]
740
+ width: __width(previews)
742
741
  }
743
742
  }, ReactCreateElement("div", {
744
- [__className]: "viewport"
743
+ [ReactConstants[5]]: "viewport"
745
744
  }, ReactCreateElement("div", {
746
- [__className]: "container",
745
+ [ReactConstants[5]]: "container",
747
746
  style: {
748
747
  width: previews.totalWidth,
749
748
  left: toPx(previewScroll() || previews.scroll)
@@ -751,17 +750,17 @@ var ImageGallery = function (_React$Component) {
751
750
  }, (previews.images || []).map(function (it, i) {
752
751
  return ReactCreateElement("div", {
753
752
  key: i,
754
- [__className]: classNames('preview', indexValue === i && 'selected'),
755
- onClick: function onClick() {
753
+ [ReactConstants[5]]: classNames('preview', indexValue === i && 'selected'),
754
+ [ReactConstants[6]]: function onClick() {
756
755
  return scrollTo(i, indexValue);
757
756
  }
758
757
  }, ReactCreateElement("img", {
759
758
  src: it.url,
760
759
  style: it
761
760
  }), ReactCreateElement("div", {
762
- [__className]: "border"
761
+ [ReactConstants[5]]: "border"
763
762
  }, ReactCreateElement("div", {
764
- [__className]: "line"
763
+ [ReactConstants[5]]: "line"
765
764
  })));
766
765
  }))), animatedRoundButton(indexValue > 0 || loop, 'arrow left', left, 'keyboard_arrow_left'), animatedRoundButton(indexValue !== length - 1 || loop, 'arrow right', right, 'keyboard_arrow_right'))), children));
767
766
  };
@@ -785,12 +784,12 @@ var ImageGalleryContainer = function (_React$Component2) {
785
784
  var that = _assertThisInitialized(_this2);
786
785
  that.state = IMAGE_GALLERY_REDUCER(null, {});
787
786
  var getState = function getState() {
788
- return that.state;
787
+ return __state(that);
789
788
  };
790
789
  var dispatch = function dispatch(action) {
791
790
  return setTimeout(function () {
792
- var state = IMAGE_GALLERY_REDUCER(that.state, action);
793
- if (state !== that.state) that.setState(state);
791
+ var state = IMAGE_GALLERY_REDUCER(__state(that), action);
792
+ if (state !== __state(that)) that.setState(state);
794
793
  }, 0);
795
794
  };
796
795
  var props = propsGetter(that);
@@ -820,23 +819,23 @@ var ImageGalleryContainer = function (_React$Component2) {
820
819
  that.replaceImages = function (images) {
821
820
  Actions.replaceImages(images)(dispatch, getState);
822
821
  };
823
- that[render] = function () {
822
+ that[ReactConstants[3]] = function () {
824
823
  return ReactCreateElement(ImageGallery, _extends({
825
824
  ref: galleryRef
826
- }, that.props, that.state, {
825
+ }, __props(that), __state(that), {
827
826
  show: show,
828
827
  load: load,
829
828
  close: close,
830
829
  recalculate: recalculate
831
- }), that.props[__children]);
830
+ }), __props(that)[ReactConstants[4]]);
832
831
  };
833
- that[componentDidMount] = function () {
832
+ that[ReactConstants[0]] = function () {
834
833
  props()[embedded] && show(props()[embedded]);
835
834
  that.scrollTo = galleryRef().scrollTo;
836
- that[CommonFields[3]] = galleryRef()[CommonFields[3]];
835
+ that.left = __left(galleryRef());
837
836
  that.right = galleryRef().right;
838
837
  };
839
- that[componentDidUpdate] = function (prevProps, prevState) {
838
+ that[ReactConstants[2]] = function (prevProps, prevState) {
840
839
  isDifferent(prevProps[embedded], props()[embedded]) && props()[embedded] && show(props()[embedded]);
841
840
  };
842
841
  return _this2;