react-ui-basics 0.0.155 → 0.0.158

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 (53) hide show
  1. package/Animated.js +2 -1
  2. package/AutocompleteSelect.js +15 -14
  3. package/Button.js +15 -15
  4. package/Button.js.map +1 -1
  5. package/Checkbox.js +3 -2
  6. package/CircleProgress.js +2 -1
  7. package/CommonFields.js +17 -0
  8. package/CommonFields.js.map +1 -0
  9. package/DNDContainer.js +29 -28
  10. package/DNDDraggable.js +1 -0
  11. package/DNDDroppable.js +1 -0
  12. package/Dialog.js +4 -3
  13. package/DropFileInput.js +1 -0
  14. package/DroppableHorizontalList.js +18 -17
  15. package/DroppableList.js +18 -17
  16. package/Dropzone.js +6 -5
  17. package/FilteredList.js +11 -10
  18. package/FloatingActionButton.js +2 -1
  19. package/FormUploadProgress.js +2 -1
  20. package/ImageGallery.js +93 -92
  21. package/MaterialIcon.js +2 -1
  22. package/Modal.js +7 -6
  23. package/ModalMenu.js +4 -3
  24. package/ReactConstants.d.ts +18 -0
  25. package/ReactConstants.js +25 -36
  26. package/ReactConstants.js.map +1 -1
  27. package/ReadyListener.js +1 -0
  28. package/ResizeObserver.d.ts +1 -0
  29. package/Scrollable.js +38 -37
  30. package/ScrollableTable.d.ts +15 -0
  31. package/ScrollableTable.js +19 -32
  32. package/ScrollableTable.js.map +1 -1
  33. package/Size.js +3 -2
  34. package/Snackbar.js +1 -0
  35. package/SpinningProgress.js +1 -0
  36. package/Switch.js +3 -2
  37. package/Table.d.ts +8 -25
  38. package/Table.js +90 -95
  39. package/Table.js.map +1 -1
  40. package/TextField.js +7 -6
  41. package/Tools.d.ts +1 -1
  42. package/Tools.js +18 -17
  43. package/Tools.js.map +1 -1
  44. package/bundle.css +623 -623
  45. package/index.js +8 -5
  46. package/index.js.map +1 -1
  47. package/package.json +1 -1
  48. package/router/Link.js +3 -2
  49. package/router/NavLink.js +3 -2
  50. package/router/Route.js +10 -9
  51. package/router/index.js +1 -0
  52. package/store/ProxyTools.js +1 -0
  53. package/store/Store.js +1 -0
package/ImageGallery.js CHANGED
@@ -1,4 +1,5 @@
1
1
  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';
2
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, getBoundingClientRect as __getBoundingClientRect, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, top as __top, value as __value, width as __width} from "./CommonFields";
2
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
3
4
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
4
5
  import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
@@ -25,8 +26,8 @@ var previewWidth = previewRatio * previewHeight;
25
26
  var previewPadding = 8;
26
27
  var previewsHeight = previewHeight + 15;
27
28
  var calculatePosition = function calculatePosition(it, ratio, width, height, previewsHeight, embedded, container) {
28
- var windowWidth = embedded ? container.clientWidth : min(DOCUMENT.body.clientWidth, WINDOW.innerWidth);
29
- var windowHeight = embedded ? container.clientHeight : min(DOCUMENT.body.clientHeight, WINDOW.innerHeight);
29
+ var windowWidth = embedded ? container[__clientWidth] : min(DOCUMENT.body[__clientWidth], WINDOW.innerWidth);
30
+ var windowHeight = embedded ? container[__clientHeight] : min(DOCUMENT.body[__clientHeight], WINDOW.innerHeight);
30
31
  var offset = it.offset;
31
32
  if (offset == null) offset = embedded ? 0 : windowHeight * 0.03;
32
33
  var offsetTop = it.offsetTop;
@@ -116,7 +117,7 @@ var Actions = _createClass(function Actions() {
116
117
  Actions.replaceImages = function (images) {
117
118
  return function (dispatch, getState) {
118
119
  var state = getState();
119
- var length = images.length;
120
+ var length = images[__length];
120
121
  var nextState = _objectSpread2({}, state);
121
122
  nextState.images = images.map(function (item) {
122
123
  var image = state.images.find(function (it) {
@@ -126,14 +127,14 @@ Actions.replaceImages = function (images) {
126
127
  var it = _objectSpread2({}, item);
127
128
  var el = it.el;
128
129
  if (el) {
129
- var rect = el.getBoundingClientRect();
130
- var fromWidth = el.clientWidth;
131
- var fromHeight = el.clientHeight;
132
- it.fromLeftPx = toPx(rect.left);
133
- it.fromTopPx = toPx(rect.top);
130
+ var rect = el[__getBoundingClientRect]();
131
+ var fromWidth = el[__clientWidth];
132
+ var fromHeight = el[__clientHeight];
133
+ it.fromLeftPx = toPx(rect[__left]);
134
+ it.fromTopPx = toPx(rect[__top]);
134
135
  it.fromWidthPx = toPx(fromWidth);
135
136
  var ratio = fromWidth / fromHeight;
136
- calculatePosition(it, ratio, el.naturalWidth || el.width, el.naturalHeight || el.height, withPreviews ? previewsHeight : 0, embedded, container);
137
+ calculatePosition(it, ratio, el.naturalWidth || el[__width], el.naturalHeight || el[__height], withPreviews ? previewsHeight : 0, embedded, container);
137
138
  } else {
138
139
  it.toLeft = 100;
139
140
  it.toTop = 100;
@@ -141,7 +142,7 @@ Actions.replaceImages = function (images) {
141
142
  if (!it.toWidth || !it.toHeight || !el) Actions.loadPreview(it)(dispatch);
142
143
  return it;
143
144
  });
144
- nextState.previews.width = min(length, 5) * previewWidth + min(length - 1, 4) * previewPadding;
145
+ nextState.previews[__width] = min(length, 5) * previewWidth + min(length - 1, 4) * previewPadding;
145
146
  nextState.previews.totalWidth = toPx(length * previewWidth + (length - 1) * previewPadding);
146
147
  nextState.previews.images = nextState.images.map(function (item) {
147
148
  var preview = state.previews.images.find(function (it) {
@@ -150,8 +151,8 @@ Actions.replaceImages = function (images) {
150
151
  if (preview) return preview;
151
152
  var el = item.el;
152
153
  if (!el) return {};
153
- var width = el.clientWidth;
154
- var height = el.clientHeight;
154
+ var width = el[__clientWidth];
155
+ var height = el[__clientHeight];
155
156
  return calculatePreview(width, height, el.src);
156
157
  });
157
158
  dispatch({
@@ -163,7 +164,7 @@ Actions.replaceImages = function (images) {
163
164
  Actions.show = function (gallery) {
164
165
  return function (dispatch) {
165
166
  var images = gallery.images;
166
- var length = images.length;
167
+ var length = images[__length];
167
168
  var withPreviews = length > 1 && (gallery.withPreviews === UNDEFINED || !!gallery.withPreviews);
168
169
  var container = gallery.container;
169
170
  var embedded = gallery.embedded;
@@ -177,14 +178,14 @@ Actions.show = function (gallery) {
177
178
  var it = _objectSpread2({}, item);
178
179
  var el = it.el;
179
180
  if (el) {
180
- var rect = el.getBoundingClientRect();
181
- var fromWidth = el.clientWidth;
182
- var fromHeight = el.clientHeight;
183
- it.fromLeftPx = toPx(rect.left);
184
- it.fromTopPx = toPx(rect.top);
181
+ var rect = el[__getBoundingClientRect]();
182
+ var fromWidth = el[__clientWidth];
183
+ var fromHeight = el[__clientHeight];
184
+ it.fromLeftPx = toPx(rect[__left]);
185
+ it.fromTopPx = toPx(rect[__top]);
185
186
  it.fromWidthPx = toPx(fromWidth);
186
187
  var ratio = fromWidth / fromHeight;
187
- calculatePosition(it, ratio, el.naturalWidth || el.width, el.naturalHeight || el.height, withPreviews ? previewsHeight : 0, embedded, container);
188
+ calculatePosition(it, ratio, el.naturalWidth || el[__width], el.naturalHeight || el[__height], withPreviews ? previewsHeight : 0, embedded, container);
188
189
  } else {
189
190
  it.toLeft = 100;
190
191
  it.toTop = 100;
@@ -200,8 +201,8 @@ Actions.show = function (gallery) {
200
201
  images: images.map(function (it) {
201
202
  var el = it.el;
202
203
  if (!el) return {};
203
- var width = el.clientWidth;
204
- var height = el.clientHeight;
204
+ var width = el[__clientWidth];
205
+ var height = el[__clientHeight];
205
206
  return calculatePreview(width, height, el.src);
206
207
  })
207
208
  }
@@ -218,7 +219,7 @@ Actions.show = function (gallery) {
218
219
  }
219
220
  }
220
221
  });
221
- data.previews.scroll = calculatePreviewsScroll(index, length, data.previews.width);
222
+ data.previews.scroll = calculatePreviewsScroll(index, length, data.previews[__width]);
222
223
  dispatch({
223
224
  type: ACTION_IMAGE_GALLERY_SHOW,
224
225
  data: data
@@ -285,11 +286,11 @@ var reducers = (_reducers = {}, _defineProperty(_reducers, ACTION_IMAGE_GALLERY_
285
286
  var result = _objectSpread2(_objectSpread2({}, state), {}, {
286
287
  images: images
287
288
  });
288
- for (var i = 0; i < images.length; i++) {
289
- if (!images[i].width && !images[i].fromWidthPx) continue;
289
+ for (var i = 0; i < images[__length]; i++) {
290
+ if (!images[i][__width] && !images[i].fromWidthPx) continue;
290
291
  var it = _objectSpread2({}, images[i]);
291
- var width = it.width || Number.parseInt(it.fromWidthPx);
292
- var height = it.height || Number.parseInt(it.fromHeightPx);
292
+ var width = it[__width] || Number.parseInt(it.fromWidthPx);
293
+ var height = it[__height] || Number.parseInt(it.fromHeightPx);
293
294
  calculatePosition(it, width / height, width, height, result.previews.show ? previewsHeight : 0, state.embedded, state.container);
294
295
  images[i] = it;
295
296
  }
@@ -304,8 +305,8 @@ var reducers = (_reducers = {}, _defineProperty(_reducers, ACTION_IMAGE_GALLERY_
304
305
  var index = images.findIndex(function (it) {
305
306
  return it.id === item.id;
306
307
  });
307
- var width = image.width;
308
- var height = image.height;
308
+ var width = image[__width];
309
+ var height = image[__height];
309
310
  var it = _objectSpread2(_objectSpread2({}, images[index]), {}, {
310
311
  loaded: true,
311
312
  width: width,
@@ -325,11 +326,11 @@ var reducers = (_reducers = {}, _defineProperty(_reducers, ACTION_IMAGE_GALLERY_
325
326
  return it.id === item.id;
326
327
  });
327
328
  var it = _objectSpread2({}, images[index]);
328
- if (!it.toWidth || !it.toHeight) calculatePosition(it, image.width / image.height, image.width, image.height, result.previews.show ? previewsHeight : 0, state.embedded, state.container);
329
+ if (!it.toWidth || !it.toHeight) calculatePosition(it, image[__width] / image[__height], image[__width], image[__height], result.previews.show ? previewsHeight : 0, state.embedded, state.container);
329
330
  images[index] = it;
330
331
  var previewImages = _toConsumableArray(state.previews.images);
331
332
  result.previews.images = previewImages;
332
- var preview = calculatePreview(image.width, image.height, image.src);
333
+ var preview = calculatePreview(image[__width], image[__height], image.src);
333
334
  previewImages[index] = preview;
334
335
  return result;
335
336
  }), _reducers);
@@ -353,7 +354,7 @@ var big = function big(it, index, i, shift, length, previous) {
353
354
  if (index !== i) {
354
355
  var width = WINDOW.innerWidth;
355
356
  var additionalOffset = it.toLeft < 0 ? -it.toLeft : 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));
357
+ 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));
357
358
  }
358
359
  return styles;
359
360
  };
@@ -387,7 +388,7 @@ var ImageGallery = function (_React$Component) {
387
388
  var indexValue = index() !== UNDEFINED ? index() : props().index;
388
389
  var image = images[indexValue];
389
390
  if (!image) {
390
- var i = images.length - 1;
391
+ var i = images[__length] - 1;
391
392
  if (i === -1) {
392
393
  if (prevProps.images !== images) {
393
394
  onClose();
@@ -451,22 +452,22 @@ var ImageGallery = function (_React$Component) {
451
452
  var resetZoom = function resetZoom() {
452
453
  if (!zoomed()) return;
453
454
  zoomed(false);
454
- zoomedImage.style.width = defaultWidth;
455
- zoomedImage.style.left = defaultLeft;
456
- zoomedImage.style.top = defaultTop;
457
- zoomedImage.style.transition = null;
455
+ zoomedImage[__style][__width] = defaultWidth;
456
+ zoomedImage[__style][__left] = defaultLeft;
457
+ zoomedImage[__style][__top] = defaultTop;
458
+ zoomedImage[__style].transition = null;
458
459
  touchpadStarted = null;
459
460
  };
460
461
  var initZoom = function initZoom() {
461
462
  zoomed(true);
462
- defaultWidth = zoomedImage.style.width;
463
- defaultLeft = zoomedImage.style.left;
464
- defaultTop = zoomedImage.style.top;
463
+ defaultWidth = zoomedImage[__style][__width];
464
+ defaultLeft = zoomedImage[__style][__left];
465
+ defaultTop = zoomedImage[__style][__top];
465
466
  };
466
467
  var initTouchpadDragging = function initTouchpadDragging() {
467
- oldLeft = Number.parseFloat(zoomedImage.style.left);
468
- oldTop = Number.parseFloat(zoomedImage.style.top);
469
- zoomedImage.style.transition = 'none';
468
+ oldLeft = Number.parseFloat(zoomedImage[__style][__left]);
469
+ oldTop = Number.parseFloat(zoomedImage[__style][__top]);
470
+ zoomedImage[__style].transition = 'none';
470
471
  touchpadStarted = true;
471
472
  };
472
473
  var onWheel = function onWheel(e) {
@@ -478,43 +479,43 @@ var ImageGallery = function (_React$Component) {
478
479
  if (e.ctrlKey) {
479
480
  var diff = e.deltaY * 0.005;
480
481
  var newZoom = Math.min(Math.max(zoomValue + diff, 0.5), 10);
481
- var zoomX = e.pageX;
482
+ var zoomX = e[__pageX];
482
483
  oldLeft = zoomX - (zoomX - oldLeft) * newZoom / zoomValue;
483
- var zoomY = e.pageY;
484
+ var zoomY = e[__pageY];
484
485
  oldTop = zoomY - (zoomY - oldTop) * newZoom / zoomValue;
485
486
  zoomValue = newZoom;
486
- zoomedImage.style.width = zoomValue * 100 + '%';
487
+ zoomedImage[__style][__width] = zoomValue * 100 + '%';
487
488
  } else {
488
489
  oldLeft += e.deltaX * 0.5;
489
490
  oldTop += e.deltaY * 0.5;
490
491
  }
491
- zoomedImage.style.left = oldLeft + 'px';
492
- zoomedImage.style.top = oldTop + 'px';
492
+ zoomedImage[__style][__left] = oldLeft + 'px';
493
+ zoomedImage[__style][__top] = oldTop + 'px';
493
494
  };
494
495
  var moveListenerAdded;
495
496
  var onTouchStart = function onTouchStart(e) {
496
497
  e.swipeProcessed = false;
497
498
  if (e.button === 2) return;
498
499
  var touches = e.touches || [{
499
- pageX: e.pageX,
500
- pageY: e.pageY
500
+ pageX: e[__pageX],
501
+ pageY: e[__pageY]
501
502
  }];
502
503
  zoomedImage = e.target;
503
504
  zoomedImage = zoomedImage.tagName.toLowerCase() === 'img' ? zoomedImage.parentElement : zoomedImage;
504
- oldLeft = Number.parseFloat(zoomedImage.style.left);
505
- oldTop = Number.parseFloat(zoomedImage.style.top);
505
+ oldLeft = Number.parseFloat(zoomedImage[__style][__left]);
506
+ oldTop = Number.parseFloat(zoomedImage[__style][__top]);
506
507
  if (zoomed()) {
507
- zoomedImage.style.transition = 'none';
508
+ zoomedImage[__style].transition = 'none';
508
509
  }
509
510
  if (!moveListenerAdded) {
510
511
  addEventListener(_this.gallery, 'touchmove', onTouchMove, false);
511
512
  moveListenerAdded = true;
512
513
  }
513
- if (touches.length === 2) {
514
+ if (touches[__length] === 2) {
514
515
  if (zoomed()) zoomValueStarted = zoomValue;else if (!props().embedded) {
515
516
  initZoom();
516
- zoomedImage.style.transition = 'none';
517
- zoomValueStarted = zoomValue = Number.parseFloat(zoomedImage.style.width) / WINDOW.innerWidth;
517
+ zoomedImage[__style].transition = 'none';
518
+ zoomValueStarted = zoomValue = Number.parseFloat(zoomedImage[__style][__width]) / WINDOW.innerWidth;
518
519
  }
519
520
  }
520
521
  touchesStart = touches;
@@ -525,25 +526,25 @@ var ImageGallery = function (_React$Component) {
525
526
  var distance = function distance(touches) {
526
527
  var a = touches[0];
527
528
  var b = touches[1];
528
- return Math.sqrt(power2(a.pageX - b.pageX) + power2(a.pageY - b.pageY));
529
+ return Math.sqrt(power2(a[__pageX] - b[__pageX]) + power2(a[__pageY] - b[__pageY]));
529
530
  };
530
531
  var center = function center(touches) {
531
532
  var a = touches[0];
532
533
  var b = touches[1];
533
534
  return {
534
- x: (a.pageX + b.pageX) / 2,
535
- y: (a.pageY + b.pageY) / 2
535
+ x: (a[__pageX] + b[__pageX]) / 2,
536
+ y: (a[__pageY] + b[__pageY]) / 2
536
537
  };
537
538
  };
538
539
  var onTouchMove = function onTouchMove(e) {
539
540
  if (!touchesStart) return;
540
541
  var touches = e.touches || [{
541
- pageX: e.pageX,
542
- pageY: e.pageY
542
+ pageX: e[__pageX],
543
+ pageY: e[__pageY]
543
544
  }];
544
545
  if (zoomed()) {
545
546
  preventDefault(e);
546
- if (touches.length === 2) {
547
+ if (touches[__length] === 2) {
547
548
  var diff = distance(touches) / distance(touchesStart);
548
549
  zoomValue = Math.min(Math.max(zoomValueStarted * diff, 0.5), 10);
549
550
  var zoomedAt = center(touchesStart);
@@ -551,24 +552,24 @@ var ImageGallery = function (_React$Component) {
551
552
  var newLeft = zoomX - (zoomX - oldLeft) * zoomValue / zoomValueStarted;
552
553
  var zoomY = zoomedAt.y;
553
554
  var newTop = zoomY - (zoomY - oldTop) * zoomValue / zoomValueStarted;
554
- zoomedImage.style.left = newLeft + 'px';
555
- zoomedImage.style.top = newTop + 'px';
556
- zoomedImage.style.width = zoomValue * 100 + '%';
555
+ zoomedImage[__style][__left] = newLeft + 'px';
556
+ zoomedImage[__style][__top] = newTop + 'px';
557
+ zoomedImage[__style][__width] = zoomValue * 100 + '%';
557
558
  return;
558
559
  } else {
559
560
  var _touch = touches[0];
560
561
  var _touchStart = touchesStart[0];
561
- var _newLeft = oldLeft + _touch.pageX - _touchStart.pageX;
562
- var _newTop = oldTop + _touch.pageY - _touchStart.pageY;
563
- zoomedImage.style.left = _newLeft + 'px';
564
- zoomedImage.style.top = _newTop + 'px';
562
+ var _newLeft = oldLeft + _touch[__pageX] - _touchStart[__pageX];
563
+ var _newTop = oldTop + _touch[__pageY] - _touchStart[__pageY];
564
+ zoomedImage[__style][__left] = _newLeft + 'px';
565
+ zoomedImage[__style][__top] = _newTop + 'px';
565
566
  return;
566
567
  }
567
568
  }
568
- if (touches.length > 1 || zoomed()) return;
569
+ if (touches[__length] > 1 || zoomed()) return;
569
570
  var touch = touches[0];
570
571
  var touchStart = touchesStart[0];
571
- shift(touch.pageX - touchStart.pageX);
572
+ shift(touch[__pageX] - touchStart[__pageX]);
572
573
  };
573
574
  var onTouchEnd = function onTouchEnd(e) {
574
575
  if (!touchesStart) return;
@@ -580,13 +581,13 @@ var ImageGallery = function (_React$Component) {
580
581
  return;
581
582
  }
582
583
  var touches = e.changedTouches || [{
583
- pageX: e.pageX,
584
- pageY: e.pageY
584
+ pageX: e[__pageX],
585
+ pageY: e[__pageY]
585
586
  }];
586
587
  var touchEnd = touches[0];
587
588
  var touchStart = touchesStart[0];
588
- var distX = touchEnd.pageX - touchStart.pageX;
589
- var distY = touchEnd.pageY - touchStart.pageY;
589
+ var distX = touchEnd[__pageX] - touchStart[__pageX];
590
+ var distY = touchEnd[__pageY] - touchStart[__pageY];
590
591
  touchesStart = UNDEFINED;
591
592
  shift(0);
592
593
  var minDistance = 20;
@@ -603,14 +604,14 @@ var ImageGallery = function (_React$Component) {
603
604
  previews = _props.previews;
604
605
  index(i);
605
606
  previous(prev);
606
- previewScroll(calculatePreviewsScroll(i, previews.images.length, previews.width));
607
+ previewScroll(calculatePreviewsScroll(i, previews.images[__length], previews[__width]));
607
608
  };
608
609
  var left = function left(e) {
609
610
  if (zoomed()) return;
610
611
  preventDefault(e);
611
612
  stopPropagation(e);
612
613
  var indexValue = index() !== UNDEFINED ? index() : props().index;
613
- if (indexValue > 0) scrollTo(indexValue - 1, indexValue);else if (props().loop) scrollTo(props().images.length - 1, indexValue);
614
+ if (indexValue > 0) scrollTo(indexValue - 1, indexValue);else if (props().loop) scrollTo(props().images[__length] - 1, indexValue);
614
615
  };
615
616
  var right = function right(e) {
616
617
  if (zoomed()) return;
@@ -619,10 +620,10 @@ var ImageGallery = function (_React$Component) {
619
620
  var _props2 = props(),
620
621
  images = _props2.images;
621
622
  var indexValue = index() !== UNDEFINED ? index() : props().index;
622
- if (indexValue < images.length - 1) scrollTo(indexValue + 1, indexValue);else if (props().loop) scrollTo(0, indexValue);
623
+ if (indexValue < images[__length] - 1) scrollTo(indexValue + 1, indexValue);else if (props().loop) scrollTo(0, indexValue);
623
624
  };
624
625
  that.scrollTo = scrollTo;
625
- that.left = left;
626
+ that[__left] = left;
626
627
  that.right = right;
627
628
  var animatedRoundButton = function animatedRoundButton(show, className, onClick, icon) {
628
629
  return ReactCreateElement(Animated, {
@@ -647,9 +648,9 @@ var ImageGallery = function (_React$Component) {
647
648
  embedded = _props4.embedded,
648
649
  loop = _props4.loop,
649
650
  _onClick = _props4.onClick,
650
- children = _props4.children;
651
+ children = _props4[__children];
651
652
  var indexValue = index() !== UNDEFINED ? index() : props().index;
652
- var length = images.length;
653
+ var length = images[__length];
653
654
  var isZoomed = zoomed();
654
655
  var shiftValue = shift() || 0;
655
656
  previous();
@@ -687,23 +688,23 @@ var ImageGallery = function (_React$Component) {
687
688
  draggable: false,
688
689
  onDoubleClick: function onDoubleClick(e) {
689
690
  var img = e.target;
690
- if (img.naturalWidth === img.clientWidth && img.naturalHeight === img.clientHeight) return;
691
+ if (img.naturalWidth === img[__clientWidth] && img.naturalHeight === img[__clientHeight]) return;
691
692
  if (!isZoomed) {
692
693
  zoomedImage = img.tagName.toLowerCase() === 'img' ? img.parentElement : img;
693
694
  initZoom();
694
695
  zoomValue = 2;
695
696
  var newWidth = WINDOW.innerWidth * 2;
696
- var oldWidth = Number.parseFloat(zoomedImage.style.width);
697
- var _oldLeft = Number.parseFloat(zoomedImage.style.left);
698
- var zoomX = e.pageX;
697
+ var oldWidth = Number.parseFloat(zoomedImage[__style][__width]);
698
+ var _oldLeft = Number.parseFloat(zoomedImage[__style][__left]);
699
+ var zoomX = e[__pageX];
699
700
  var diff = newWidth / oldWidth;
700
701
  var newLeft = zoomX - (zoomX - _oldLeft) * diff;
701
- var _oldTop = Number.parseFloat(zoomedImage.style.top);
702
- var zoomY = e.pageY;
702
+ var _oldTop = Number.parseFloat(zoomedImage[__style][__top]);
703
+ var zoomY = e[__pageY];
703
704
  var newTop = zoomY - (zoomY - _oldTop) * diff;
704
- zoomedImage.style.width = '200%';
705
- zoomedImage.style.left = newLeft + 'px';
706
- zoomedImage.style.top = newTop + 'px';
705
+ zoomedImage[__style][__width] = '200%';
706
+ zoomedImage[__style][__left] = newLeft + 'px';
707
+ zoomedImage[__style][__top] = newTop + 'px';
707
708
  } else {
708
709
  resetZoom();
709
710
  }
@@ -737,7 +738,7 @@ var ImageGallery = function (_React$Component) {
737
738
  }, ReactCreateElement("div", {
738
739
  [__className]: "previews",
739
740
  style: {
740
- width: previews.width
741
+ width: previews[__width]
741
742
  }
742
743
  }, ReactCreateElement("div", {
743
744
  [__className]: "viewport"
@@ -827,12 +828,12 @@ var ImageGalleryContainer = function (_React$Component2) {
827
828
  load: load,
828
829
  close: close,
829
830
  recalculate: recalculate
830
- }), that.props.children);
831
+ }), that.props[__children]);
831
832
  };
832
833
  that[componentDidMount] = function () {
833
834
  props()[embedded] && show(props()[embedded]);
834
835
  that.scrollTo = galleryRef().scrollTo;
835
- that.left = galleryRef().left;
836
+ that[__left] = galleryRef()[__left];
836
837
  that.right = galleryRef().right;
837
838
  };
838
839
  that[componentDidUpdate] = function (prevProps, prevState) {
package/MaterialIcon.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import 'react';
2
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, getBoundingClientRect as __getBoundingClientRect, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, top as __top, value as __value, width as __width} from "./CommonFields";
2
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
3
4
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
4
5
  import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
@@ -10,7 +11,7 @@ import PropTypes from 'prop-types';
10
11
 
11
12
  var MaterialIcon = function MaterialIcon(_ref) {
12
13
  var icon = _ref.icon,
13
- className = _ref.className;
14
+ className = _ref[__className];
14
15
  return ReactCreateElement("i", {
15
16
  [__className]: classNames('MaterialIcon', 'material-icons', className)
16
17
  }, icon);
package/Modal.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, slicedToArray as _slicedToArray, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
2
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, getBoundingClientRect as __getBoundingClientRect, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, top as __top, value as __value, width as __width} from "./CommonFields";
2
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
3
4
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
4
5
  import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
@@ -52,7 +53,7 @@ var Modal = function (_PureComponent) {
52
53
  if (!bc || bc(that.close)) that.close(e);
53
54
  };
54
55
  var shouldClose = function shouldClose(e) {
55
- var isSameModal = el().style.zIndex == zIndex - 1;
56
+ var isSameModal = el()[__style].zIndex == zIndex - 1;
56
57
  !(e && content().contains(e.target)) && isSameModal && beforeClose(e);
57
58
  };
58
59
  var addTransitionListener = function addTransitionListener() {
@@ -60,17 +61,17 @@ var Modal = function (_PureComponent) {
60
61
  var listener = function listener() {
61
62
  removeEventListener(overlay(), transitionend, listener);
62
63
  orNoop(isShow() ? props().onOpen : orNoop(props().onClose))();
63
- el() && (el().style.paddingBottom = isShow() ? '1px' : '0px');
64
+ el() && (el()[__style].paddingBottom = isShow() ? '1px' : '0px');
64
65
  };
65
66
  addEventListener(overlay(), transitionend, listener);
66
67
  };
67
68
  that[render] = function () {
68
69
  var _props2 = props(),
69
- className = _props2.className,
70
- top = _props2.top,
70
+ className = _props2[__className],
71
+ top = _props2[__top],
71
72
  _props2$container = _props2.container,
72
73
  container = _props2$container === void 0 ? Modal.defaultContainer : _props2$container,
73
- children = _props2.children,
74
+ children = _props2[__children],
74
75
  closeIcon = _props2.closeIcon;
75
76
  var menu = getMenu();
76
77
  var show = isShow();
@@ -109,7 +110,7 @@ var Modal = function (_PureComponent) {
109
110
  };
110
111
  var open = that.open = function () {
111
112
  if (isShow()) return;
112
- el() && (el().style.zIndex = zIndex++);
113
+ el() && (el()[__style].zIndex = zIndex++);
113
114
  addTransitionListener();
114
115
  isShow(true);
115
116
  var listener = function listener(event) {
package/ModalMenu.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
2
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, getBoundingClientRect as __getBoundingClientRect, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, top as __top, value as __value, width as __width} from "./CommonFields";
2
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
3
4
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
4
5
  import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
@@ -29,7 +30,7 @@ var ModalMenu = function (_PureComponent) {
29
30
  var filtered = (items || []).filter(function (it) {
30
31
  return !!it;
31
32
  });
32
- if (filtered.length === 0) return null;
33
+ if (filtered[__length] === 0) return null;
33
34
  var open = isOpen();
34
35
  return ReactCreateElement("div", {
35
36
  [__className]: classNames("ModalMenu", 'row', open && 'open')
@@ -40,10 +41,10 @@ var ModalMenu = function (_PureComponent) {
40
41
  mounting: 200,
41
42
  unmounting: 200,
42
43
  mountingDelay: i * 50,
43
- unmountingDelay: (filtered.length - i - 1) * 50,
44
+ unmountingDelay: (filtered[__length] - i - 1) * 50,
44
45
  styles: {
45
46
  mounting: {
46
- right: (filtered.length - i) * 36 + 5 + (filtered.length - i) * 5 + "px"
47
+ right: (filtered[__length] - i) * 36 + 5 + (filtered[__length] - i) * 5 + "px"
47
48
  }
48
49
  }
49
50
  }, ReactCreateElement(Button, {
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ export declare const props: <P>(that: React.Component<P>) => P;
3
+ export declare const propsGetter: <P>(that: React.Component<P>) => (() => P);
4
+ export declare const state: <P, S>(that: React.Component<P, S>) => S;
5
+ export declare const setState: (that: any, data: any, cb?: any) => void;
6
+ export declare const stateFieldSetter: (that: any, key: any, cb?: any) => (value: any, cb2?: any) => void;
7
+ export declare const stateGS: (that: any) => {
8
+ (): any;
9
+ toString(): string;
10
+ };
11
+ export declare const stateGSs: (that: any, num: any) => any[];
12
+ export declare const componentDidMount = "componentDidMount";
13
+ export declare const componentWillUnmount = "componentWillUnmount";
14
+ export declare const componentDidUpdate = "componentDidUpdate";
15
+ export declare const render = "render";
16
+ export declare const children = "children";
17
+ export declare const className = "className";
18
+ export declare const PureComponent: typeof React.PureComponent;
package/ReactConstants.js CHANGED
@@ -1,44 +1,33 @@
1
- import { defineProperty as _defineProperty } from './_virtual/_rollupPluginBabelHelpers.js';
2
1
  import React from 'react';
3
2
 
4
3
  var EMPTY = {};
5
- var props = function props(that) {
6
- return that.props;
4
+ var props = function (that) { return that.props; };
5
+ var propsGetter = function (that) { return function () { return props(that); }; };
6
+ // @ts-ignore //ignore incompatible casting EMPTY to S
7
+ var state = function (that) { return that.state || EMPTY; };
8
+ var setState = function (that, data, cb) {
9
+ that.setState(data, cb);
7
10
  };
8
- var propsGetter = function propsGetter(that) {
9
- return function () {
10
- return props(that);
11
- };
11
+ var stateFieldSetter = function (that, key, cb) { return function (value, cb2) {
12
+ var _a;
13
+ setState(that, (_a = {}, _a[key] = value, _a), cb2 || cb);
14
+ }; };
15
+ var stateGS = function (that) {
16
+ !that.sfc && (that.sfc = 0);
17
+ var key = '_' + (that.sfc++);
18
+ var setter = stateFieldSetter(that, key);
19
+ var result = function () {
20
+ return !arguments.length ? state(that)[key] : setter.apply(null, arguments);
21
+ };
22
+ result.toString = function () { return key; };
23
+ return result;
12
24
  };
13
- var state = function state(that) {
14
- return that.state || EMPTY;
15
- };
16
- var setState = function setState(that, data, cb) {
17
- that.setState(data, cb);
18
- };
19
- var stateFieldSetter = function stateFieldSetter(that, key, cb) {
20
- return function (value, cb2) {
21
- setState(that, _defineProperty({}, key, value), cb2 || cb);
22
- };
23
- };
24
- var stateGS = function stateGS(that) {
25
- !that.sfc && (that.sfc = 0);
26
- var key = '_' + that.sfc++;
27
- var setter = stateFieldSetter(that, key);
28
- var result = function result() {
29
- return !arguments.length ? state(that)[key] : setter.apply(null, arguments);
30
- };
31
- result.toString = function () {
32
- return key;
33
- };
34
- return result;
35
- };
36
- var stateGSs = function stateGSs(that, num) {
37
- var result = [];
38
- for (var i = 0; i < num; i++) {
39
- result.push(stateGS(that));
40
- }
41
- return result;
25
+ var stateGSs = function (that, num) {
26
+ var result = [];
27
+ for (var i = 0; i < num; i++) {
28
+ result.push(stateGS(that));
29
+ }
30
+ return result;
42
31
  };
43
32
  var componentDidMount = 'componentDidMount';
44
33
  var componentWillUnmount = 'componentWillUnmount';
@@ -1 +1 @@
1
- {"version":3,"file":"ReactConstants.js","sources":["../../../src/react-ui-basics/ReactConstants.js"],"sourcesContent":["import React from 'react';\n\nconst EMPTY = {};\nexport const props = that => that.props;\nexport const propsGetter = that => () => props(that);\nexport const state = that => that.state || EMPTY;\nexport const setState = (that, data, cb) => {\n that.setState(data, cb);\n};\nexport const stateFieldSetter = (that, key, cb) => (value, cb2) => {\n setState(that, {[key]: value}, cb2 || cb);\n};\nexport const stateGS = (that) => {\n !that.sfc && (that.sfc = 0);\n const key = '_' + (that.sfc++);\n const setter = stateFieldSetter(that, key);\n const result = function () {\n return !arguments.length ? state(that)[key] : setter.apply(null, arguments);\n };\n result.toString = () => key;\n return result;\n};\nexport const stateGSs = (that, num) => {\n const result = [];\n for (let i = 0; i < num; i++) {\n result.push(stateGS(that));\n }\n return result;\n};\n\nexport const componentDidMount = 'componentDidMount';\nexport const componentWillUnmount = 'componentWillUnmount';\nexport const componentDidUpdate = 'componentDidUpdate';\nexport const render = 'render';\nexport const children = 'children';\nexport const className = 'className';\nexport const PureComponent = React.PureComponent;"],"names":["EMPTY","props","that","propsGetter","state","setState","data","cb","stateFieldSetter","key","value","cb2","stateGS","sfc","setter","result","arguments","length","apply","toString","stateGSs","num","i","push","componentDidMount","componentWillUnmount","componentDidUpdate","render","children","className","PureComponent","React"],"mappings":";;;AAEA,IAAMA,KAAK,GAAG,EAAd,CAAA;IACaC,KAAK,GAAG,SAARA,KAAQ,CAAAC,IAAI,EAAA;AAAA,EAAIA,OAAAA,IAAI,CAACD,KAAT,CAAA;AAAA,EAAlB;IACME,WAAW,GAAG,SAAdA,WAAc,CAAAD,IAAI,EAAA;AAAA,EAAI,OAAA,YAAA;AAAA,IAAMD,OAAAA,KAAK,CAACC,IAAD,CAAX,CAAA;AAAA,GAAJ,CAAA;AAAA,EAAxB;IACME,KAAK,GAAG,SAARA,KAAQ,CAAAF,IAAI,EAAA;AAAA,EAAA,OAAIA,IAAI,CAACE,KAAL,IAAcJ,KAAlB,CAAA;AAAA,EAAlB;AACA,IAAMK,QAAQ,GAAG,SAAXA,QAAW,CAACH,IAAD,EAAOI,IAAP,EAAaC,EAAb,EAAoB;AACxCL,EAAAA,IAAI,CAACG,QAAL,CAAcC,IAAd,EAAoBC,EAApB,CAAA,CAAA;AACH,EAFM;AAGA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACN,IAAD,EAAOO,GAAP,EAAYF,EAAZ,EAAA;AAAA,EAAA,OAAmB,UAACG,KAAD,EAAQC,GAAR,EAAgB;AAC/DN,IAAAA,QAAQ,CAACH,IAAD,EAASO,eAAAA,CAAAA,EAAAA,EAAAA,GAAT,EAAeC,KAAf,CAAuBC,EAAAA,GAAG,IAAIJ,EAA9B,CAAR,CAAA;AACH,GAF+B,CAAA;AAAA,EAAzB;IAGMK,OAAO,GAAG,SAAVA,OAAU,CAACV,IAAD,EAAU;AAC7B,EAACA,CAAAA,IAAI,CAACW,GAAN,KAAcX,IAAI,CAACW,GAAL,GAAW,CAAzB,CAAA,CAAA;AACA,EAAA,IAAMJ,GAAG,GAAG,GAAA,GAAOP,IAAI,CAACW,GAAL,EAAnB,CAAA;AACA,EAAA,IAAMC,MAAM,GAAGN,gBAAgB,CAACN,IAAD,EAAOO,GAAP,CAA/B,CAAA;AACA,EAAA,IAAMM,MAAM,GAAG,SAATA,MAAS,GAAY;AACvB,IAAO,OAAA,CAACC,SAAS,CAACC,MAAX,GAAoBb,KAAK,CAACF,IAAD,CAAL,CAAYO,GAAZ,CAApB,GAAuCK,MAAM,CAACI,KAAP,CAAa,IAAb,EAAmBF,SAAnB,CAA9C,CAAA;AACH,GAFD,CAAA;AAGAD,EAAAA,MAAM,CAACI,QAAP,GAAkB,YAAA;AAAA,IAAA,OAAMV,GAAN,CAAA;AAAA,GAAlB,CAAA;AACA,EAAA,OAAOM,MAAP,CAAA;AACH,EATM;AAUA,IAAMK,QAAQ,GAAG,SAAXA,QAAW,CAAClB,IAAD,EAAOmB,GAAP,EAAe;AACnC,EAAMN,IAAAA,MAAM,GAAG,EAAf,CAAA;AACA,EAAK,KAAA,IAAIO,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGD,GAApB,EAAyBC,CAAC,EAA1B,EAA8B;AAC1BP,IAAAA,MAAM,CAACQ,IAAP,CAAYX,OAAO,CAACV,IAAD,CAAnB,CAAA,CAAA;AACH,GAAA;AACD,EAAA,OAAOa,MAAP,CAAA;AACH,EANM;AAQA,IAAMS,iBAAiB,GAAG,oBAA1B;AACA,IAAMC,oBAAoB,GAAG,uBAA7B;AACA,IAAMC,kBAAkB,GAAG,qBAA3B;AACA,IAAMC,MAAM,GAAG,SAAf;AACA,IAAMC,QAAQ,GAAG,WAAjB;AACA,IAAMC,SAAS,GAAG,YAAlB;AACMC,IAAAA,aAAa,GAAGC,KAAK,CAACD;;;;"}
1
+ {"version":3,"file":"ReactConstants.js","sources":["../../../src/src/react-ui-basics/ReactConstants.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA,IAAM,KAAK,GAAG,EAAE,CAAC;AACV,IAAM,KAAK,GAAuC,UAAA,IAAI,EAAI,EAAA,OAAA,IAAI,CAAC,KAAK,CAAA,GAAC;AAC/D,IAAA,WAAW,GAA+C,UAAA,IAAI,IAAI,OAAA,YAAA,EAAM,OAAA,KAAK,CAAC,IAAI,CAAC,GAAA,CAAA,GAAC;AACjG;AACO,IAAM,KAAK,GAA6C,UAAA,IAAI,EAAA,EAAI,OAAA,IAAI,CAAC,KAAK,IAAI,KAAK,CAAA,GAAC;IAC9E,QAAQ,GAAG,UAAC,IAAI,EAAE,IAAI,EAAE,EAAG,EAAA;AACpC,IAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC5B,EAAE;AACK,IAAM,gBAAgB,GAAG,UAAC,IAAI,EAAE,GAAG,EAAE,EAAG,EAAK,EAAA,OAAA,UAAC,KAAK,EAAE,GAAI,EAAA;;AAC5D,IAAA,QAAQ,CAAC,IAAI,GAAG,EAAA,GAAA,EAAA,EAAA,EAAA,CAAC,GAAG,CAAA,GAAG,KAAK,EAAA,EAAA,GAAG,GAAG,IAAI,EAAE,CAAC,CAAC;AAC9C,CAAC,CAAA,GAAC;AACK,IAAM,OAAO,GAAG,UAAC,IAAI,EAAA;IACxB,CAAC,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IAC5B,IAAM,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/B,IAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAC3C,IAAA,IAAM,MAAM,GAAG,YAAA;QACX,OAAO,CAAC,SAAS,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAChF,KAAC,CAAC;IACF,MAAM,CAAC,QAAQ,GAAG,YAAA,EAAM,OAAA,GAAG,CAAA,EAAA,CAAC;AAC5B,IAAA,OAAO,MAAM,CAAC;AAClB,EAAE;AACW,IAAA,QAAQ,GAAG,UAAC,IAAI,EAAE,GAAG,EAAA;IAC9B,IAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;QAC1B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9B,KAAA;AACD,IAAA,OAAO,MAAM,CAAC;AAClB,EAAE;AAEK,IAAM,iBAAiB,GAAG,oBAAoB;AAC9C,IAAM,oBAAoB,GAAG,uBAAuB;AACpD,IAAM,kBAAkB,GAAG,qBAAqB;AAChD,IAAM,MAAM,GAAG,SAAS;AACxB,IAAM,QAAQ,GAAG,WAAW;AAC5B,IAAM,SAAS,GAAG,YAAY;AACxB,IAAA,aAAa,GAAG,KAAK,CAAC;;;;"}