react-ui-basics 0.0.159 → 0.0.160

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/Animated.js +5 -3
  2. package/AutocompleteSelect.js +17 -17
  3. package/Button.js +14 -14
  4. package/Checkbox.js +2 -2
  5. package/CircleProgress.js +2 -2
  6. package/CommonFields.js +21 -16
  7. package/DNDContainer.js +29 -29
  8. package/DNDDraggable.js +1 -1
  9. package/DNDDroppable.js +1 -1
  10. package/Dialog.js +2 -2
  11. package/DropFileInput.js +1 -1
  12. package/DroppableHorizontalList.js +17 -17
  13. package/DroppableList.js +17 -17
  14. package/Dropzone.js +8 -8
  15. package/FilteredList.js +13 -13
  16. package/FloatingActionButton.js +1 -1
  17. package/FormUploadProgress.js +2 -2
  18. package/ImageGallery.js +94 -94
  19. package/MaterialIcon.js +1 -1
  20. package/Modal.js +6 -6
  21. package/ModalMenu.js +4 -4
  22. package/ReactConstants.js +6 -1
  23. package/ReactCreateElement.js +1 -1
  24. package/ReadyListener.js +1 -1
  25. package/Scrollable.js +36 -36
  26. package/ScrollableTable.js +1 -1
  27. package/Size.js +3 -3
  28. package/Snackbar.js +1 -1
  29. package/SpinningProgress.js +1 -1
  30. package/Switch.js +2 -2
  31. package/Table.js +13 -13
  32. package/TextField.js +6 -6
  33. package/Tools.d.ts +1 -0
  34. package/Tools.js +13 -13
  35. package/_virtual/_commonjsHelpers.js +1 -1
  36. package/_virtual/_react.js +1 -1
  37. package/_virtual/react-jsx-runtime.development.js +1 -1
  38. package/bundle.css +759 -759
  39. package/index.js +8 -7
  40. package/package.json +1 -1
  41. package/router/HistoryTools.js +1 -1
  42. package/router/Link.js +1 -1
  43. package/router/NavLink.js +1 -1
  44. package/router/Route.js +9 -9
  45. package/router/index.js +1 -1
  46. package/store/ProxyTools.js +1 -1
  47. package/store/Store.js +1 -1
  48. package/Animated.js.map +0 -1
  49. package/AutocompleteSelect.js.map +0 -1
  50. package/Button.js.map +0 -1
  51. package/Checkbox.js.map +0 -1
  52. package/CircleProgress.js.map +0 -1
  53. package/CommonFields.js.map +0 -1
  54. package/DNDContainer.js.map +0 -1
  55. package/DNDDraggable.js.map +0 -1
  56. package/DNDDroppable.js.map +0 -1
  57. package/Dialog.js.map +0 -1
  58. package/DropFileInput.js.map +0 -1
  59. package/DroppableHorizontalList.js.map +0 -1
  60. package/DroppableList.js.map +0 -1
  61. package/Dropzone.js.map +0 -1
  62. package/FilteredList.js.map +0 -1
  63. package/FloatingActionButton.js.map +0 -1
  64. package/FormUploadProgress.js.map +0 -1
  65. package/ImageGallery.js.map +0 -1
  66. package/MaterialIcon.js.map +0 -1
  67. package/Modal.js.map +0 -1
  68. package/ModalMenu.js.map +0 -1
  69. package/ReactConstants.js.map +0 -1
  70. package/ReactCreateElement.js.map +0 -1
  71. package/ReadyListener.js.map +0 -1
  72. package/Scrollable.js.map +0 -1
  73. package/ScrollableTable.js.map +0 -1
  74. package/Size.js.map +0 -1
  75. package/Snackbar.js.map +0 -1
  76. package/SpinningProgress.js.map +0 -1
  77. package/Switch.js.map +0 -1
  78. package/Table.js.map +0 -1
  79. package/TextField.js.map +0 -1
  80. package/Tools.js.map +0 -1
  81. package/index.js.map +0 -1
package/Scrollable.js CHANGED
@@ -1,4 +1,4 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
2
  import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
3
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
4
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
@@ -84,14 +84,14 @@ var Scrollable = function (_PureComponent) {
84
84
  var offsetWidth = offsetWidthOf(viewport);
85
85
  var scrollbarHeight = offsetHeightOf(scrollbar);
86
86
  var scrollbarWidth = offsetWidthOf(scrollbarH);
87
- var position = viewport[CommonFields[11]] / (scrollHeight - offsetHeight);
88
- var positionH = viewport[CommonFields[12]] / (scrollWidth - offsetWidth);
87
+ var position = __scrollTop(viewport) / (scrollHeight - offsetHeight);
88
+ var positionH = __scrollLeft(viewport) / (scrollWidth - offsetWidth);
89
89
  if (position > 1) {
90
- viewport[CommonFields[11]] = scrollHeight - offsetHeight;
90
+ viewport.scrollTop = scrollHeight - offsetHeight;
91
91
  position = 1;
92
92
  }
93
- styleOf(thumb)[CommonFields[2]] = position * (scrollbarHeight - offsetHeightOf(thumb)) + 'px';
94
- styleOf(thumbH)[CommonFields[3]] = positionH * (scrollbarWidth - offsetWidthOf(thumbH)) + 'px';
93
+ styleOf(thumb).top = position * (scrollbarHeight - offsetHeightOf(thumb)) + 'px';
94
+ styleOf(thumbH).left = positionH * (scrollbarWidth - offsetWidthOf(thumbH)) + 'px';
95
95
  if (position >= 0.98) {
96
96
  !scrolledToBottom && orNoop(props().onScrolledToBottom)();
97
97
  scrolledToBottom = true;
@@ -109,16 +109,16 @@ var Scrollable = function (_PureComponent) {
109
109
  var reset = function reset() {
110
110
  removeEventListener(WINDOW, 'mouseup', reset);
111
111
  removeEventListener(WINDOW, 'mousemove', moveListener);
112
- viewport[CommonFields[4]].scrollBehavior = '';
112
+ __style(viewport).scrollBehavior = '';
113
113
  scrolling = false;
114
114
  };
115
115
  var moveListener = function moveListener(e) {
116
116
  if (!scrolling) return;
117
117
  if (scrolling === 'v') {
118
- viewport[CommonFields[11]] += (e.clientY - lastY) * ratio;
118
+ viewport.scrollTop += (e.clientY - lastY) * ratio;
119
119
  lastY = e.clientY;
120
120
  } else if (scrolling === 'h') {
121
- viewport[CommonFields[12]] += (e.clientX - lastX) * ratioH;
121
+ viewport.scrollLeft += (e.clientX - lastX) * ratioH;
122
122
  lastX = e.clientX;
123
123
  }
124
124
  };
@@ -126,7 +126,7 @@ var Scrollable = function (_PureComponent) {
126
126
  lastY = e.clientY;
127
127
  scrolling = 'v';
128
128
  ratio = scrollHeightOf(viewport) / offsetHeightOf(viewport);
129
- viewport[CommonFields[4]].scrollBehavior = 'unset';
129
+ __style(viewport).scrollBehavior = 'unset';
130
130
  addEventListener(WINDOW, 'mouseup', reset);
131
131
  addEventListener(WINDOW, 'mousemove', moveListener);
132
132
  };
@@ -136,7 +136,7 @@ var Scrollable = function (_PureComponent) {
136
136
  lastX = e.clientX;
137
137
  scrolling = 'h';
138
138
  ratioH = scrollWidthOf(viewport) / offsetWidthOf(viewport);
139
- viewport[CommonFields[4]].scrollBehavior = 'unset';
139
+ __style(viewport).scrollBehavior = 'unset';
140
140
  addEventListener(WINDOW, 'mouseup', reset);
141
141
  addEventListener(WINDOW, 'mousemove', moveListener);
142
142
  };
@@ -144,37 +144,37 @@ var Scrollable = function (_PureComponent) {
144
144
  thumbH.onmouseup = reset;
145
145
  scrollbar.onclick = function (e) {
146
146
  if (e.target === scrollbar) {
147
- var thumbPosition = parseInt(styleOf(thumb)[CommonFields[2]]);
148
- viewport[CommonFields[11]] += offsetHeightOf(viewport) * 0.9 * (e.offsetY < thumbPosition ? -1 : 1);
147
+ var thumbPosition = parseInt(__top(styleOf(thumb)));
148
+ viewport.scrollTop += offsetHeightOf(viewport) * 0.9 * (e.offsetY < thumbPosition ? -1 : 1);
149
149
  }
150
150
  };
151
151
  scrollbarH.onclick = function (e) {
152
152
  if (e.target === scrollbarH) {
153
- var thumbPosition = parseInt(styleOf(thumbH)[CommonFields[3]]);
154
- viewport[CommonFields[12]] += offsetWidthOf(viewport) * 0.9 * (e.offsetX < thumbPosition ? -1 : 1);
153
+ var thumbPosition = parseInt(__left(styleOf(thumbH)));
154
+ viewport.scrollLeft += offsetWidthOf(viewport) * 0.9 * (e.offsetX < thumbPosition ? -1 : 1);
155
155
  }
156
156
  };
157
157
  var adjustScrollWidth = function adjustScrollWidth() {
158
158
  if (NATIVE_SCROLL_WIDTH < 0) {
159
- NATIVE_SCROLL_WIDTH = viewport.offsetWidth - viewport[CommonFields[10]];
159
+ NATIVE_SCROLL_WIDTH = viewport.offsetWidth - __clientWidth(viewport);
160
160
  if (NATIVE_SCROLL_WIDTH === 0 && scrollHeightOf(viewport) !== offsetHeightOf(viewport)) {
161
161
  NATIVE_SCROLL_WIDTH = -1;
162
162
  }
163
163
  }
164
164
  if (NATIVE_SCROLL_HEIGHT < 0) {
165
- NATIVE_SCROLL_HEIGHT = viewport.offsetHeight - viewport[CommonFields[9]];
165
+ NATIVE_SCROLL_HEIGHT = viewport.offsetHeight - __clientHeight(viewport);
166
166
  if (NATIVE_SCROLL_HEIGHT === 0 && scrollWidthOf(viewport) !== offsetWidthOf(viewport)) {
167
167
  NATIVE_SCROLL_HEIGHT = -1;
168
168
  }
169
169
  }
170
170
  if (!adjustedScrollWidth) {
171
171
  if (NATIVE_SCROLL_WIDTH >= 0 && status() !== WITHOUT_SCROLL) {
172
- styleOf(viewport).paddingRight = NATIVE_SCROLL_WIDTH + scrollbar[CommonFields[10]] + 'px';
173
- styleOf(viewport).marginRight = -NATIVE_SCROLL_WIDTH - scrollbar[CommonFields[10]] + 'px';
172
+ styleOf(viewport).paddingRight = NATIVE_SCROLL_WIDTH + __clientWidth(scrollbar) + 'px';
173
+ styleOf(viewport).marginRight = -NATIVE_SCROLL_WIDTH - __clientWidth(scrollbar) + 'px';
174
174
  }
175
175
  if (NATIVE_SCROLL_HEIGHT >= 0 && statusH() !== WITHOUT_SCROLL) {
176
- styleOf(viewport).paddingBottom = NATIVE_SCROLL_HEIGHT + scrollbarH[CommonFields[9]] + 'px';
177
- styleOf(viewport).marginBottom = -NATIVE_SCROLL_HEIGHT - scrollbarH[CommonFields[9]] + 'px';
176
+ styleOf(viewport).paddingBottom = NATIVE_SCROLL_HEIGHT + __clientHeight(scrollbarH) + 'px';
177
+ styleOf(viewport).marginBottom = -NATIVE_SCROLL_HEIGHT - __clientHeight(scrollbarH) + 'px';
178
178
  }
179
179
  adjustedScrollWidth = true;
180
180
  }
@@ -215,15 +215,15 @@ var Scrollable = function (_PureComponent) {
215
215
  var newRatio = scrollHeight / scrollbarHeight;
216
216
  if (ratio === newRatio && Number.isFinite(newRatio) || Number.isNaN(newRatio)) return;
217
217
  var offsetHeight = offsetHeightOf(viewport);
218
- var horizontalScrollBarOffset = statusH() !== WITHOUT_SCROLL ? scrollbarH[CommonFields[9]] + Math.max(NATIVE_SCROLL_HEIGHT, 0) : 0;
218
+ var horizontalScrollBarOffset = statusH() !== WITHOUT_SCROLL ? __clientHeight(scrollbarH) + Math.max(NATIVE_SCROLL_HEIGHT, 0) : 0;
219
219
  var containerOffsetHeight = offsetHeightOf(container) + horizontalScrollBarOffset;
220
220
  if (containerOffsetHeight === scrollHeight && status() === WITHOUT_SCROLL) return;
221
- if (props().autoScrollTop && scrollHeight - offsetHeight - viewport[CommonFields[11]] <= 20 && newRatio < ratio && Number.isFinite(newRatio) && Number.isFinite(ratio)) {
222
- viewport[CommonFields[11]] = 0;
221
+ if (props().autoScrollTop && scrollHeight - offsetHeight - __scrollTop(viewport) <= 20 && newRatio < ratio && Number.isFinite(newRatio) && Number.isFinite(ratio)) {
222
+ viewport.scrollTop = 0;
223
223
  }
224
224
  ratio = newRatio;
225
- styleOf(thumb)[CommonFields[1]] = scrollbarHeight / newRatio + 'px';
226
- styleOf(container)[CommonFields[1]] = scrollHeight - horizontalScrollBarOffset + 'px';
225
+ styleOf(thumb).height = scrollbarHeight / newRatio + 'px';
226
+ styleOf(container).height = scrollHeight - horizontalScrollBarOffset + 'px';
227
227
  containerOffsetHeight = offsetHeightOf(container) + horizontalScrollBarOffset;
228
228
  if (scrollBarModeOf(props()) === SCROLLBAR_MODE_HIDDEN) {
229
229
  if (status() !== WITHOUT_SCROLL) hideScrollbar(scrollbar, viewport);
@@ -237,8 +237,8 @@ var Scrollable = function (_PureComponent) {
237
237
  }
238
238
  scrolledToBottom = false;
239
239
  scrolledToTop = false;
240
- var position = viewport[CommonFields[11]] / (scrollHeight - offsetHeight);
241
- styleOf(thumb)[CommonFields[2]] = position * (scrollbarHeight - offsetHeightOf(thumb)) + 'px';
240
+ var position = __scrollTop(viewport) / (scrollHeight - offsetHeight);
241
+ styleOf(thumb).top = position * (scrollbarHeight - offsetHeightOf(thumb)) + 'px';
242
242
  };
243
243
  var updateHorizontalScrollbar = function updateHorizontalScrollbar() {
244
244
  var scrollWidth = scrollWidthOf(viewport);
@@ -247,16 +247,16 @@ var Scrollable = function (_PureComponent) {
247
247
  var newRatio = scrollWidth / scrollbarWidth;
248
248
  if (ratioH === newRatio && Number.isFinite(newRatio) || Number.isNaN(newRatio)) return;
249
249
  var offsetWidth = offsetWidthOf(viewport);
250
- var verticalScrollBarOffset = status() !== WITHOUT_SCROLL ? scrollbar[CommonFields[10]] + Math.max(NATIVE_SCROLL_WIDTH, 0) : 0;
250
+ var verticalScrollBarOffset = status() !== WITHOUT_SCROLL ? __clientWidth(scrollbar) + Math.max(NATIVE_SCROLL_WIDTH, 0) : 0;
251
251
  var containerOffsetWidth = offsetWidthOf(container) + verticalScrollBarOffset;
252
252
  if (containerOffsetWidth === scrollWidth && statusH() === WITHOUT_SCROLL) return;
253
253
  ratioH = newRatio;
254
- styleOf(thumbH)[CommonFields[0]] = scrollbarWidth / newRatio + 'px';
254
+ styleOf(thumbH).width = scrollbarWidth / newRatio + 'px';
255
255
  if (horizontalScrollBarModeOf(props()) === SCROLLBAR_MODE_HIDDEN) {
256
256
  if (statusH() !== WITHOUT_SCROLL) hideHorizontalScrollbar(scrollbarH, viewport);
257
257
  return;
258
258
  }
259
- styleOf(container)[CommonFields[0]] = scrollWidth - verticalScrollBarOffset + 'px';
259
+ styleOf(container).width = scrollWidth - verticalScrollBarOffset + 'px';
260
260
  containerOffsetWidth = offsetWidthOf(container) + verticalScrollBarOffset;
261
261
  if (containerOffsetWidth < scrollWidth) {
262
262
  adjustedScrollWidth = false;
@@ -264,8 +264,8 @@ var Scrollable = function (_PureComponent) {
264
264
  } else {
265
265
  hideHorizontalScrollbar(scrollbarH, viewport);
266
266
  }
267
- var position = viewport[CommonFields[12]] / (scrollWidth - offsetWidth);
268
- styleOf(thumbH)[CommonFields[3]] = position * (scrollbarWidth - offsetWidthOf(thumbH)) + 'px';
267
+ var position = __scrollLeft(viewport) / (scrollWidth - offsetWidth);
268
+ styleOf(thumbH).left = position * (scrollbarWidth - offsetWidthOf(thumbH)) + 'px';
269
269
  };
270
270
  initTimeout = setTimeout(function () {
271
271
  resizeInterval = setInterval(function () {
@@ -280,16 +280,16 @@ var Scrollable = function (_PureComponent) {
280
280
  if (scrollBarModeOf(props()) !== scrollBarModeOf(prevProps)) init();else if (onScroll(props()) !== onScroll(prevProps)) init();
281
281
  };
282
282
  that.setScroll = function (y) {
283
- viewportRef()[CommonFields[11]] = y;
283
+ viewportRef().scrollTop = y;
284
284
  };
285
285
  that.getScroll = function () {
286
- return viewportRef()[CommonFields[11]];
286
+ return __scrollTop(viewportRef());
287
287
  };
288
288
  that.getScrollHeight = function () {
289
289
  return scrollHeightOf(viewportRef());
290
290
  };
291
291
  that.getHeight = function () {
292
- return containerRef()[CommonFields[9]];
292
+ return __clientHeight(containerRef());
293
293
  };
294
294
  that[render] = function () {
295
295
  var _props = props();
@@ -1,4 +1,4 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
2
 
3
3
  import { jsx as jsxRuntime_2 } from 'react/jsx-runtime';
4
4
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
package/Size.js CHANGED
@@ -1,4 +1,4 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
2
  import 'react';
3
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
4
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
@@ -9,7 +9,7 @@ import ReactCreateElement from './ReactCreateElement.js';
9
9
  import { isUndefined } from './Tools.js';
10
10
 
11
11
  var Size = function Size(_ref) {
12
- var value = _ref[CommonFields[8]];
12
+ var value = __value(_ref);
13
13
  return ReactCreateElement("span", {
14
14
  [__className]: "Size"
15
15
  }, formatNumber(value, 1), "\xA0", formatAbbreviation(value));
@@ -21,7 +21,7 @@ var formatNumberWithMaxLength = function formatNumberWithMaxLength(size, fractio
21
21
  do {
22
22
  result = formatNumber(size, fractionalLength, toAbbreviation);
23
23
  fractionalLength--;
24
- } while (maxLength !== -1 && fractionalLength >= 0 && result[CommonFields[5]] > maxLength);
24
+ } while (maxLength !== -1 && fractionalLength >= 0 && __length(result) > maxLength);
25
25
  return result;
26
26
  };
27
27
  function formatNumber(size, fractionalLength, toAbbreviation) {
package/Snackbar.js CHANGED
@@ -1,4 +1,4 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
2
  import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, slicedToArray as _slicedToArray, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
3
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
4
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
@@ -1,4 +1,4 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
2
  import 'react';
3
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
4
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
package/Switch.js CHANGED
@@ -1,4 +1,4 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
2
  import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
3
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
4
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
@@ -26,7 +26,7 @@ var Switch = function (_PureComponent) {
26
26
  labelOn = _this$props.labelOn,
27
27
  labelOff = _this$props.labelOff,
28
28
  onChange = _this$props.onChange,
29
- value = _this$props[CommonFields[8]],
29
+ value = __value(_this$props),
30
30
  onClick = _this$props.onClick;
31
31
  var id = _this.props.id || randomId;
32
32
  return ReactCreateElement("div", {
package/Table.js CHANGED
@@ -1,4 +1,4 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
2
 
3
3
  import { jsxs as jsxRuntime_1, jsx as jsxRuntime_2 } from 'react/jsx-runtime';
4
4
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
@@ -29,8 +29,8 @@ var Table = /** @class */ (function (_super) {
29
29
  var updateHeaders = function () {
30
30
  var hidden = headers().querySelectorAll('.hidden');
31
31
  var fixed = headers().querySelectorAll('.fixed');
32
- for (var i = 0; i < hidden[CommonFields[5]]; i++) {
33
- fixed[i][CommonFields[4]][CommonFields[0]] = hidden[i].offsetWidth + 'px';
32
+ for (var i = 0; i < __length(hidden); i++) {
33
+ fixed[i].style.width = hidden[i].offsetWidth + 'px';
34
34
  }
35
35
  };
36
36
  var cancelEditing = function () {
@@ -40,16 +40,16 @@ var Table = /** @class */ (function (_super) {
40
40
  _this.setState({ editing: { id: item.id, value: item[field], columnIndex: columnIndex, item: item, field: field } });
41
41
  };
42
42
  var handleInputChange = function (event) {
43
- var target = event.target;
44
- var value = target.type === 'checkbox' ? target.checked : target[CommonFields[8]];
43
+ var target = __target(event);
44
+ var value = target.type === 'checkbox' ? target.checked : __value(target);
45
45
  _this.setState({ editing: __extends(__extends({}, state(_this).editing), { value: value }) });
46
46
  };
47
47
  var onFinishEditing = function () {
48
48
  var _a;
49
49
  var editing = state(_this).editing;
50
- if (editing[CommonFields[8]] === null)
50
+ if (editing.value === null)
51
51
  return;
52
- var value = editing[CommonFields[8]];
52
+ var value = __value(editing);
53
53
  if (isString(value))
54
54
  value = value.trim();
55
55
  if (value === editing.item[editing.field])
@@ -79,7 +79,7 @@ var Table = /** @class */ (function (_super) {
79
79
  sortOrder: state(_this).sortBy === sortBy && state(_this).sortOrder === SORT_ASC ? SORT_DESC : SORT_ASC,
80
80
  comparator: comparator,
81
81
  sortBy: sortBy
82
- }, function () { return setData(state(_this).data); });
82
+ }, function () { return setData(__data(state(_this))); });
83
83
  };
84
84
  _this[componentDidMount] = function () {
85
85
  var _a;
@@ -94,7 +94,7 @@ var Table = /** @class */ (function (_super) {
94
94
  };
95
95
  _this[componentDidUpdate] = function (prevProps, prevState, snapshot) {
96
96
  var _a;
97
- var _b = props(), sortBy = _b.sortBy, sortOrder = _b.sortOrder, columns = _b.columns, data = _b.data;
97
+ var _b = props(), sortBy = _b.sortBy, sortOrder = _b.sortOrder, columns = _b.columns, data = __data(_b);
98
98
  if (sortBy !== prevProps.sortBy || sortOrder !== prevProps.sortOrder) {
99
99
  _this.setState({
100
100
  sortBy: sortBy,
@@ -102,14 +102,14 @@ var Table = /** @class */ (function (_super) {
102
102
  comparator: (_a = columns.find(function (it) { return it.field === sortBy; })) === null || _a === void 0 ? void 0 : _a.comparator
103
103
  }, function () { return setData(data); });
104
104
  }
105
- else if (data !== prevProps.data) {
105
+ else if (data !== __data(prevProps)) {
106
106
  setData(data);
107
107
  }
108
108
  updateHeaders();
109
109
  };
110
110
  _this[render] = function () {
111
111
  var _a = props(), _b = _a.columns, columns = _b === void 0 ? [] : _b, _c = _a.onRowClick, onRowClick = _c === void 0 ? NOOP : _c, disabled = _a.disabled, className = _a[__className], rowClassName = _a.rowClassName, _d = _a.toKey, toKey = _d === void 0 ? getId : _d;
112
- var _e = state(_this), sortBy = _e.sortBy, sortOrder = _e.sortOrder, _f = _e.data, data = _f === void 0 ? [] : _f, editing = _e.editing;
112
+ var _e = state(_this), sortBy = _e.sortBy, sortOrder = _e.sortOrder, _f = __data(_e), data = _f === void 0 ? [] : _f, editing = _e.editing;
113
113
  return (jsxRuntime_1("table", __extends({ [__className]: classNames("Table", className) }, { [__children]: [jsxRuntime_2("thead", { [__children]: jsxRuntime_2("tr", __extends({ ref: headers }, { [__children]: columns.filter(function (it) { return !!it; }).map(function (column, i) {
114
114
  var sortable = column.sortable || column.sortable == null;
115
115
  return (jsxRuntime_1("th", __extends({ onClick: function (e) { return sortable && sort(e, column.field, column.comparator); } }, { [__children]: [jsxRuntime_1("div", __extends({ [__className]: classNames('hidden', sortable && 'sortable', sortBy === column.field && 'active') }, { [__children]: [column.header, column.header && sortBy === column.field && sortOrder === SORT_ASC && (jsxRuntime_2(MaterialIcon, { icon: 'keyboard_arrow_up' })), column.header && sortBy === column.field && sortOrder === SORT_DESC && (jsxRuntime_2(MaterialIcon, { icon: 'keyboard_arrow_down' }))] })), jsxRuntime_1("div", __extends({ [__className]: classNames('fixed', sortable && 'sortable', sortBy === column.field && 'active') }, { [__children]: [column.header, column.header && sortBy === column.field && sortOrder === SORT_ASC && (jsxRuntime_2(MaterialIcon, { icon: 'keyboard_arrow_up' })), column.header && sortBy === column.field && sortOrder === SORT_DESC && (jsxRuntime_2(MaterialIcon, { icon: 'keyboard_arrow_down' }))] }))] }), i));
@@ -141,7 +141,7 @@ var Row = /** @class */ (function (_super) {
141
141
  return jsxRuntime_2("tr", __extends({ onClick: function (e) { return onClick(item); }, [__className]: classNames(disabled && disabled(item) && 'disabled', className && (isFunction(className) ? className(item) : className)) }, { [__children]: columns.filter(function (it) { return !!it; }).map(function (column, i) {
142
142
  var isEditing = editing && editing.columnIndex === i;
143
143
  var editable = isFunction(column.editable) ? column.editable(item) : !!column.editable;
144
- return (jsxRuntime_1("td", __extends({ [__className]: classNames(editable ? 'editable' : 'ro', isEditing && 'editing', column[__className]), onClick: !isEditing && editable ? function () { return setEditing(item, i, column.field); } : NOOP }, { [__children]: [(isEditing || column.displayEditor) && !column.editor && (jsxRuntime_2(TextField, { value: column.preEditor ? column.preEditor(editing[CommonFields[8]]) : editing[CommonFields[8]], focused: true, onBlur: cancelEditing, onChange: handleInputChange, onKeyDown: function (e) {
144
+ return (jsxRuntime_1("td", __extends({ [__className]: classNames(editable ? 'editable' : 'ro', isEditing && 'editing', column[__className]), onClick: !isEditing && editable ? function () { return setEditing(item, i, column.field); } : NOOP }, { [__children]: [(isEditing || column.displayEditor) && !column.editor && (jsxRuntime_2(TextField, { value: column.preEditor ? column.preEditor(__value(editing)) : __value(editing), focused: true, onBlur: cancelEditing, onChange: handleInputChange, onKeyDown: function (e) {
145
145
  if (e.keyCode === 27 /*escape*/) {
146
146
  preventDefault(e);
147
147
  cancelEditing();
@@ -150,7 +150,7 @@ var Row = /** @class */ (function (_super) {
150
150
  preventDefault(e);
151
151
  onFinishEditing();
152
152
  }
153
- } })), (isEditing || column.displayEditor) && column.editor === editorSelect && (jsxRuntime_2(AutocompleteSelect, { value: column.preEditor ? column.preEditor(editing[CommonFields[8]]) : editing[CommonFields[8]], data: column.editorData, focused: true, withArrow: false, withFilter: false, selectedMode: 'inline', selectedComponent: column.editorSelectedComponent, mode: column.multiSelect ? MODE_MULTIPLE_MINI : MODE_DEFAULT, onChange: column.multiSelect && (column.onSelect ? (function (value) { return setValue(column.onSelect(value)); }) : setValue), onSelect: !column.multiSelect && (column.onSelect ? (function (value) { return setValue(column.onSelect(value)); }) : setValue), childComponent: column.editorChildCompononRowClickent, onCancel: cancelEditing, prefilter: column.prefilter })), (isEditing || column.displayEditor) && column.editor === editorSwitch && (jsxRuntime_2(Switch, { onClick: function (e) {
153
+ } })), (isEditing || column.displayEditor) && column.editor === editorSelect && (jsxRuntime_2(AutocompleteSelect, { value: column.preEditor ? column.preEditor(__value(editing)) : __value(editing), data: column.editorData, focused: true, withArrow: false, withFilter: false, selectedMode: 'inline', selectedComponent: column.editorSelectedComponent, mode: column.multiSelect ? MODE_MULTIPLE_MINI : MODE_DEFAULT, onChange: column.multiSelect && (column.onSelect ? (function (value) { return setValue(column.onSelect(value)); }) : setValue), onSelect: !column.multiSelect && (column.onSelect ? (function (value) { return setValue(column.onSelect(value)); }) : setValue), childComponent: column.editorChildCompononRowClickent, onCancel: cancelEditing, prefilter: column.prefilter })), (isEditing || column.displayEditor) && column.editor === editorSwitch && (jsxRuntime_2(Switch, { onClick: function (e) {
154
154
  stopPropagation(e);
155
155
  preventDefault(e);
156
156
  setValue(!item[column.field]);
package/TextField.js CHANGED
@@ -1,4 +1,4 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
2
  import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, slicedToArray as _slicedToArray, createClass as _createClass } from './_virtual/_rollupPluginBabelHelpers.js';
3
3
  import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
4
4
  import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
@@ -32,14 +32,14 @@ var TextField = function (_PureComponent) {
32
32
  var _props2 = props(),
33
33
  required = _props2.required,
34
34
  check = _props2.check;
35
- var value = inputRef()[CommonFields[8]];
35
+ var value = __value(inputRef());
36
36
  var error = required && value === '' || check && check(value);
37
37
  errorState() !== error && setTimeout(errorState, 0, error);
38
38
  return error;
39
39
  };
40
40
  var onChange = function onChange(e) {
41
41
  orNoop(props().onChange)(e);
42
- isWithValue(!!inputRef()[CommonFields[8]]);
42
+ isWithValue(!!__value(inputRef()));
43
43
  check();
44
44
  };
45
45
  var onFocus = function onFocus() {
@@ -53,7 +53,7 @@ var TextField = function (_PureComponent) {
53
53
  };
54
54
  that[render] = function () {
55
55
  var _props = props();
56
- var value = _props[CommonFields[8]],
56
+ var value = __value(_props),
57
57
  name = _props.name,
58
58
  type = _props.type,
59
59
  label = _props.label,
@@ -110,12 +110,12 @@ var TextField = function (_PureComponent) {
110
110
  focused = _props3.focused,
111
111
  input = _props3.input,
112
112
  i = inputRef();
113
- isWithValue(!!i[CommonFields[8]]);
113
+ isWithValue(!!__value(i));
114
114
  focused && i.focus();
115
115
  orNoop(input)(i);
116
116
  };
117
117
  that[componentDidUpdate] = function () {
118
- if (props()[CommonFields[8]] !== inputRef()[CommonFields[8]]) check();
118
+ if (__value(props()) !== __value(inputRef())) check();
119
119
  var _props4 = props(),
120
120
  focused = _props4.focused,
121
121
  i = inputRef();
package/Tools.d.ts CHANGED
@@ -6,6 +6,7 @@ export declare const orNoop: <T>(f: (...a: any) => T) => (() => void) | ((...a:
6
6
  export declare const getRandomId: (prefix: any) => any;
7
7
  export declare const ref: (name: any, component: any) => any;
8
8
  export declare const createRef: (initialValue?: any) => (value?: any) => any;
9
+ export declare const createAccessor: (field: string) => (o: any, value?: any) => any;
9
10
  export declare const setOf: (list: any) => any;
10
11
  export declare const allPropsExcept: (obj: any, except: any) => {};
11
12
  export declare const continuousIncludes: (value: any, inc: any) => boolean;
package/Tools.js CHANGED
@@ -1,14 +1,14 @@
1
- import CommonFields from "./CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
2
2
  var global = global || window;
3
3
  var WINDOW = global;
4
4
  var DOCUMENT = WINDOW.document;
5
5
  function classNames() {
6
6
  var classes = [];
7
- for (var _i = 0; _i < arguments[CommonFields[5]]; _i++) {
7
+ for (var _i = 0; _i < __length(arguments); _i++) {
8
8
  classes[_i] = arguments[_i];
9
9
  }
10
10
  var filtered = [];
11
- var length = classes[CommonFields[5]];
11
+ var length = __length(classes);
12
12
  for (var i = 0; i < length; i++) {
13
13
  var it = classes[i];
14
14
  !!it && filtered.push(it);
@@ -44,7 +44,7 @@ var allPropsExcept = function (obj, except) {
44
44
  return result;
45
45
  };
46
46
  var continuousIncludes = function (value, inc) {
47
- var length = inc[CommonFields[5]];
47
+ var length = __length(inc);
48
48
  var from = -1;
49
49
  for (var i = 0; i < length; i++) {
50
50
  from = value.indexOf(inc[i], from + 1);
@@ -58,10 +58,10 @@ var isArrayShallowEqual = function (a, b) {
58
58
  return true;
59
59
  if (a == null || b == null)
60
60
  return false;
61
- if (a[CommonFields[5]] !== b[CommonFields[5]]) {
61
+ if (__length(a) !== __length(b)) {
62
62
  return false;
63
63
  }
64
- var i = a[CommonFields[5]] - 1;
64
+ var i = __length(a) - 1;
65
65
  var result = true;
66
66
  while (i >= 0 && (result = (a[i] === b[i]))) {
67
67
  i--;
@@ -109,10 +109,10 @@ var isDifferent = function (a, b) {
109
109
  return true;
110
110
  }
111
111
  if (Array.isArray(a)) {
112
- if (a[CommonFields[5]] !== b[CommonFields[5]]) {
112
+ if (__length(a) !== __length(b)) {
113
113
  return true;
114
114
  }
115
- var i = a[CommonFields[5]] - 1;
115
+ var i = __length(a) - 1;
116
116
  var result = false;
117
117
  while (i >= 0 && !(result = isDifferent(a[i], b[i]))) {
118
118
  i--;
@@ -122,10 +122,10 @@ var isDifferent = function (a, b) {
122
122
  if (typeA === 'object') {
123
123
  var keysA = Object.keys(a);
124
124
  var keysB = Object.keys(b);
125
- if (keysA[CommonFields[5]] !== keysB[CommonFields[5]]) {
125
+ if (__length(keysA) !== __length(keysB)) {
126
126
  return true;
127
127
  }
128
- var j = keysA[CommonFields[5]] - 1;
128
+ var j = __length(keysA) - 1;
129
129
  var r = false;
130
130
  while (j >= 0 && !(r = keysA[j] !== keysB[j]) && !(r = isDifferent(a[keysA[j]], b[keysB[j]]))) {
131
131
  j--;
@@ -142,7 +142,7 @@ var stopPropagation = function (e) {
142
142
  };
143
143
  var setTimeout = function (callback, ms) {
144
144
  var args = [];
145
- for (var _i = 2; _i < arguments[CommonFields[5]]; _i++) {
145
+ for (var _i = 2; _i < __length(arguments); _i++) {
146
146
  args[_i - 2] = arguments[_i];
147
147
  }
148
148
  return WINDOW.setTimeout.apply(WINDOW, arguments);
@@ -152,7 +152,7 @@ var clearTimeout = function (id) {
152
152
  };
153
153
  var setInterval = function (callback, ms) {
154
154
  var args = [];
155
- for (var _i = 2; _i < arguments[CommonFields[5]]; _i++) {
155
+ for (var _i = 2; _i < __length(arguments); _i++) {
156
156
  args[_i - 2] = arguments[_i];
157
157
  }
158
158
  return WINDOW.setInterval.apply(WINDOW, arguments);
@@ -205,7 +205,7 @@ var Comparators = /** @class */ (function () {
205
205
  };
206
206
  Comparators.chain = function (comparators) { return addComparatorMethods(function (a, b) {
207
207
  var result;
208
- for (var i = 0; i < comparators[CommonFields[5]]; i++) {
208
+ for (var i = 0; i < __length(comparators); i++) {
209
209
  result = comparators[i](a, b);
210
210
  if (result !== 0)
211
211
  return result;
@@ -1,4 +1,4 @@
1
- import CommonFields from "./../CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./../CommonFields";
2
2
  function createCommonjsModule(fn, module) {
3
3
  return module = { exports: {} }, fn(module, module.exports), module.exports;
4
4
  }
@@ -1,4 +1,4 @@
1
- import CommonFields from "./../CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./../CommonFields";
2
2
  import React from 'react';
3
3
  export { default } from 'react';
4
4
  //# sourceMappingURL=_react.js.map
@@ -1,4 +1,4 @@
1
- import CommonFields from "./../CommonFields";
1
+ import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, scrollLeft as __scrollLeft, scrollTop as __scrollTop, style as __style, target as __target, top as __top, value as __value, width as __width} from "./../CommonFields";
2
2
  import reactJsxRuntime_development from '../node_modules/react/cjs/react-jsx-runtime.development.js';
3
3
  export { default } from '../node_modules/react/cjs/react-jsx-runtime.development.js';
4
4
  //# sourceMappingURL=react-jsx-runtime.development.js.map