react-ui-basics 0.0.158 → 0.0.159
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.
- package/Animated.js +2 -2
- package/AutocompleteSelect.js +14 -14
- package/Button.js +13 -13
- package/Checkbox.js +2 -2
- package/CircleProgress.js +2 -2
- package/CommonFields.js +2 -1
- package/CommonFields.js.map +1 -1
- package/DNDContainer.js +27 -27
- package/DNDDraggable.js +1 -1
- package/DNDDroppable.js +1 -1
- package/Dialog.js +2 -2
- package/DropFileInput.js +1 -1
- package/DroppableHorizontalList.js +17 -17
- package/DroppableList.js +17 -17
- package/Dropzone.js +4 -4
- package/FilteredList.js +9 -9
- package/FloatingActionButton.js +1 -1
- package/FormUploadProgress.js +2 -2
- package/ImageGallery.js +91 -91
- package/MaterialIcon.js +1 -1
- package/Modal.js +5 -5
- package/ModalMenu.js +4 -4
- package/ReactCreateElement.js +1 -0
- package/ReadyListener.js +1 -1
- package/Scrollable.js +36 -36
- package/ScrollableTable.js +1 -1
- package/Size.js +3 -3
- package/Snackbar.js +1 -1
- package/SpinningProgress.js +1 -1
- package/Switch.js +2 -2
- package/Table.js +8 -8
- package/TextField.js +6 -6
- package/Tools.js +13 -12
- package/_virtual/_commonjsHelpers.js +1 -0
- package/_virtual/_react.js +1 -0
- package/_virtual/react-jsx-runtime.development.js +1 -0
- package/bundle.css +694 -694
- package/index.js +7 -8
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/router/HistoryTools.js +1 -0
- package/router/Link.js +1 -1
- package/router/NavLink.js +1 -1
- package/router/Route.js +9 -9
- package/router/index.js +1 -1
- package/store/ProxyTools.js +1 -1
- package/store/Store.js +1 -1
package/Scrollable.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
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";
|
|
3
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {inherits as __inherits} 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[
|
|
88
|
-
var positionH = viewport[
|
|
87
|
+
var position = viewport[CommonFields[11]] / (scrollHeight - offsetHeight);
|
|
88
|
+
var positionH = viewport[CommonFields[12]] / (scrollWidth - offsetWidth);
|
|
89
89
|
if (position > 1) {
|
|
90
|
-
viewport[
|
|
90
|
+
viewport[CommonFields[11]] = scrollHeight - offsetHeight;
|
|
91
91
|
position = 1;
|
|
92
92
|
}
|
|
93
|
-
styleOf(thumb)[
|
|
94
|
-
styleOf(thumbH)[
|
|
93
|
+
styleOf(thumb)[CommonFields[2]] = position * (scrollbarHeight - offsetHeightOf(thumb)) + 'px';
|
|
94
|
+
styleOf(thumbH)[CommonFields[3]] = 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[
|
|
112
|
+
viewport[CommonFields[4]].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[
|
|
118
|
+
viewport[CommonFields[11]] += (e.clientY - lastY) * ratio;
|
|
119
119
|
lastY = e.clientY;
|
|
120
120
|
} else if (scrolling === 'h') {
|
|
121
|
-
viewport[
|
|
121
|
+
viewport[CommonFields[12]] += (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[
|
|
129
|
+
viewport[CommonFields[4]].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[
|
|
139
|
+
viewport[CommonFields[4]].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)[
|
|
148
|
-
viewport[
|
|
147
|
+
var thumbPosition = parseInt(styleOf(thumb)[CommonFields[2]]);
|
|
148
|
+
viewport[CommonFields[11]] += 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)[
|
|
154
|
-
viewport[
|
|
153
|
+
var thumbPosition = parseInt(styleOf(thumbH)[CommonFields[3]]);
|
|
154
|
+
viewport[CommonFields[12]] += 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[
|
|
159
|
+
NATIVE_SCROLL_WIDTH = viewport.offsetWidth - viewport[CommonFields[10]];
|
|
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[
|
|
165
|
+
NATIVE_SCROLL_HEIGHT = viewport.offsetHeight - viewport[CommonFields[9]];
|
|
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[
|
|
173
|
-
styleOf(viewport).marginRight = -NATIVE_SCROLL_WIDTH - scrollbar[
|
|
172
|
+
styleOf(viewport).paddingRight = NATIVE_SCROLL_WIDTH + scrollbar[CommonFields[10]] + 'px';
|
|
173
|
+
styleOf(viewport).marginRight = -NATIVE_SCROLL_WIDTH - scrollbar[CommonFields[10]] + 'px';
|
|
174
174
|
}
|
|
175
175
|
if (NATIVE_SCROLL_HEIGHT >= 0 && statusH() !== WITHOUT_SCROLL) {
|
|
176
|
-
styleOf(viewport).paddingBottom = NATIVE_SCROLL_HEIGHT + scrollbarH[
|
|
177
|
-
styleOf(viewport).marginBottom = -NATIVE_SCROLL_HEIGHT - scrollbarH[
|
|
176
|
+
styleOf(viewport).paddingBottom = NATIVE_SCROLL_HEIGHT + scrollbarH[CommonFields[9]] + 'px';
|
|
177
|
+
styleOf(viewport).marginBottom = -NATIVE_SCROLL_HEIGHT - scrollbarH[CommonFields[9]] + '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[
|
|
218
|
+
var horizontalScrollBarOffset = statusH() !== WITHOUT_SCROLL ? scrollbarH[CommonFields[9]] + 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[
|
|
222
|
-
viewport[
|
|
221
|
+
if (props().autoScrollTop && scrollHeight - offsetHeight - viewport[CommonFields[11]] <= 20 && newRatio < ratio && Number.isFinite(newRatio) && Number.isFinite(ratio)) {
|
|
222
|
+
viewport[CommonFields[11]] = 0;
|
|
223
223
|
}
|
|
224
224
|
ratio = newRatio;
|
|
225
|
-
styleOf(thumb)[
|
|
226
|
-
styleOf(container)[
|
|
225
|
+
styleOf(thumb)[CommonFields[1]] = scrollbarHeight / newRatio + 'px';
|
|
226
|
+
styleOf(container)[CommonFields[1]] = 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[
|
|
241
|
-
styleOf(thumb)[
|
|
240
|
+
var position = viewport[CommonFields[11]] / (scrollHeight - offsetHeight);
|
|
241
|
+
styleOf(thumb)[CommonFields[2]] = 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[
|
|
250
|
+
var verticalScrollBarOffset = status() !== WITHOUT_SCROLL ? scrollbar[CommonFields[10]] + 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)[
|
|
254
|
+
styleOf(thumbH)[CommonFields[0]] = 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)[
|
|
259
|
+
styleOf(container)[CommonFields[0]] = 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[
|
|
268
|
-
styleOf(thumbH)[
|
|
267
|
+
var position = viewport[CommonFields[12]] / (scrollWidth - offsetWidth);
|
|
268
|
+
styleOf(thumbH)[CommonFields[3]] = 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()[
|
|
283
|
+
viewportRef()[CommonFields[11]] = y;
|
|
284
284
|
};
|
|
285
285
|
that.getScroll = function () {
|
|
286
|
-
return viewportRef()[
|
|
286
|
+
return viewportRef()[CommonFields[11]];
|
|
287
287
|
};
|
|
288
288
|
that.getScrollHeight = function () {
|
|
289
289
|
return scrollHeightOf(viewportRef());
|
|
290
290
|
};
|
|
291
291
|
that.getHeight = function () {
|
|
292
|
-
return containerRef()[
|
|
292
|
+
return containerRef()[CommonFields[9]];
|
|
293
293
|
};
|
|
294
294
|
that[render] = function () {
|
|
295
295
|
var _props = props();
|
package/ScrollableTable.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
|
|
2
3
|
import { jsx as jsxRuntime_2 } from 'react/jsx-runtime';
|
|
3
|
-
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";
|
|
4
4
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
6
6
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
package/Size.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
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";
|
|
3
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {inherits as __inherits} 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[
|
|
12
|
+
var value = _ref[CommonFields[8]];
|
|
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[
|
|
24
|
+
} while (maxLength !== -1 && fractionalLength >= 0 && result[CommonFields[5]] > maxLength);
|
|
25
25
|
return result;
|
|
26
26
|
};
|
|
27
27
|
function formatNumber(size, fractionalLength, toAbbreviation) {
|
package/Snackbar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
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";
|
|
3
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
package/SpinningProgress.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
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";
|
|
3
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
package/Switch.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, 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";
|
|
3
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {inherits as __inherits} 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[
|
|
29
|
+
value = _this$props[CommonFields[8]],
|
|
30
30
|
onClick = _this$props.onClick;
|
|
31
31
|
var id = _this.props.id || randomId;
|
|
32
32
|
return ReactCreateElement("div", {
|
package/Table.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
|
|
2
3
|
import { jsxs as jsxRuntime_1, jsx as jsxRuntime_2 } from 'react/jsx-runtime';
|
|
3
|
-
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";
|
|
4
4
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
6
6
|
import {inherits as __inherits} 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[
|
|
33
|
-
fixed[i][
|
|
32
|
+
for (var i = 0; i < hidden[CommonFields[5]]; i++) {
|
|
33
|
+
fixed[i][CommonFields[4]][CommonFields[0]] = hidden[i].offsetWidth + 'px';
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
var cancelEditing = function () {
|
|
@@ -41,15 +41,15 @@ var Table = /** @class */ (function (_super) {
|
|
|
41
41
|
};
|
|
42
42
|
var handleInputChange = function (event) {
|
|
43
43
|
var target = event.target;
|
|
44
|
-
var value = target.type === 'checkbox' ? target.checked : target[
|
|
44
|
+
var value = target.type === 'checkbox' ? target.checked : target[CommonFields[8]];
|
|
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[
|
|
50
|
+
if (editing[CommonFields[8]] === null)
|
|
51
51
|
return;
|
|
52
|
-
var value = editing[
|
|
52
|
+
var value = editing[CommonFields[8]];
|
|
53
53
|
if (isString(value))
|
|
54
54
|
value = value.trim();
|
|
55
55
|
if (value === editing.item[editing.field])
|
|
@@ -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[
|
|
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) {
|
|
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[
|
|
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) {
|
|
154
154
|
stopPropagation(e);
|
|
155
155
|
preventDefault(e);
|
|
156
156
|
setValue(!item[column.field]);
|
package/TextField.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
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";
|
|
3
3
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
4
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
5
|
import {inherits as __inherits} 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()[
|
|
35
|
+
var value = inputRef()[CommonFields[8]];
|
|
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()[
|
|
42
|
+
isWithValue(!!inputRef()[CommonFields[8]]);
|
|
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[
|
|
56
|
+
var value = _props[CommonFields[8]],
|
|
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[
|
|
113
|
+
isWithValue(!!i[CommonFields[8]]);
|
|
114
114
|
focused && i.focus();
|
|
115
115
|
orNoop(input)(i);
|
|
116
116
|
};
|
|
117
117
|
that[componentDidUpdate] = function () {
|
|
118
|
-
if (props()[
|
|
118
|
+
if (props()[CommonFields[8]] !== inputRef()[CommonFields[8]]) check();
|
|
119
119
|
var _props4 = props(),
|
|
120
120
|
focused = _props4.focused,
|
|
121
121
|
i = inputRef();
|
package/Tools.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
var global = global || window;
|
|
2
3
|
var WINDOW = global;
|
|
3
4
|
var DOCUMENT = WINDOW.document;
|
|
4
5
|
function classNames() {
|
|
5
6
|
var classes = [];
|
|
6
|
-
for (var _i = 0; _i < arguments[
|
|
7
|
+
for (var _i = 0; _i < arguments[CommonFields[5]]; _i++) {
|
|
7
8
|
classes[_i] = arguments[_i];
|
|
8
9
|
}
|
|
9
10
|
var filtered = [];
|
|
10
|
-
var length = classes[
|
|
11
|
+
var length = classes[CommonFields[5]];
|
|
11
12
|
for (var i = 0; i < length; i++) {
|
|
12
13
|
var it = classes[i];
|
|
13
14
|
!!it && filtered.push(it);
|
|
@@ -43,7 +44,7 @@ var allPropsExcept = function (obj, except) {
|
|
|
43
44
|
return result;
|
|
44
45
|
};
|
|
45
46
|
var continuousIncludes = function (value, inc) {
|
|
46
|
-
var length = inc[
|
|
47
|
+
var length = inc[CommonFields[5]];
|
|
47
48
|
var from = -1;
|
|
48
49
|
for (var i = 0; i < length; i++) {
|
|
49
50
|
from = value.indexOf(inc[i], from + 1);
|
|
@@ -57,10 +58,10 @@ var isArrayShallowEqual = function (a, b) {
|
|
|
57
58
|
return true;
|
|
58
59
|
if (a == null || b == null)
|
|
59
60
|
return false;
|
|
60
|
-
if (a[
|
|
61
|
+
if (a[CommonFields[5]] !== b[CommonFields[5]]) {
|
|
61
62
|
return false;
|
|
62
63
|
}
|
|
63
|
-
var i = a[
|
|
64
|
+
var i = a[CommonFields[5]] - 1;
|
|
64
65
|
var result = true;
|
|
65
66
|
while (i >= 0 && (result = (a[i] === b[i]))) {
|
|
66
67
|
i--;
|
|
@@ -108,10 +109,10 @@ var isDifferent = function (a, b) {
|
|
|
108
109
|
return true;
|
|
109
110
|
}
|
|
110
111
|
if (Array.isArray(a)) {
|
|
111
|
-
if (a[
|
|
112
|
+
if (a[CommonFields[5]] !== b[CommonFields[5]]) {
|
|
112
113
|
return true;
|
|
113
114
|
}
|
|
114
|
-
var i = a[
|
|
115
|
+
var i = a[CommonFields[5]] - 1;
|
|
115
116
|
var result = false;
|
|
116
117
|
while (i >= 0 && !(result = isDifferent(a[i], b[i]))) {
|
|
117
118
|
i--;
|
|
@@ -121,10 +122,10 @@ var isDifferent = function (a, b) {
|
|
|
121
122
|
if (typeA === 'object') {
|
|
122
123
|
var keysA = Object.keys(a);
|
|
123
124
|
var keysB = Object.keys(b);
|
|
124
|
-
if (keysA[
|
|
125
|
+
if (keysA[CommonFields[5]] !== keysB[CommonFields[5]]) {
|
|
125
126
|
return true;
|
|
126
127
|
}
|
|
127
|
-
var j = keysA[
|
|
128
|
+
var j = keysA[CommonFields[5]] - 1;
|
|
128
129
|
var r = false;
|
|
129
130
|
while (j >= 0 && !(r = keysA[j] !== keysB[j]) && !(r = isDifferent(a[keysA[j]], b[keysB[j]]))) {
|
|
130
131
|
j--;
|
|
@@ -141,7 +142,7 @@ var stopPropagation = function (e) {
|
|
|
141
142
|
};
|
|
142
143
|
var setTimeout = function (callback, ms) {
|
|
143
144
|
var args = [];
|
|
144
|
-
for (var _i = 2; _i < arguments[
|
|
145
|
+
for (var _i = 2; _i < arguments[CommonFields[5]]; _i++) {
|
|
145
146
|
args[_i - 2] = arguments[_i];
|
|
146
147
|
}
|
|
147
148
|
return WINDOW.setTimeout.apply(WINDOW, arguments);
|
|
@@ -151,7 +152,7 @@ var clearTimeout = function (id) {
|
|
|
151
152
|
};
|
|
152
153
|
var setInterval = function (callback, ms) {
|
|
153
154
|
var args = [];
|
|
154
|
-
for (var _i = 2; _i < arguments[
|
|
155
|
+
for (var _i = 2; _i < arguments[CommonFields[5]]; _i++) {
|
|
155
156
|
args[_i - 2] = arguments[_i];
|
|
156
157
|
}
|
|
157
158
|
return WINDOW.setInterval.apply(WINDOW, arguments);
|
|
@@ -204,7 +205,7 @@ var Comparators = /** @class */ (function () {
|
|
|
204
205
|
};
|
|
205
206
|
Comparators.chain = function (comparators) { return addComparatorMethods(function (a, b) {
|
|
206
207
|
var result;
|
|
207
|
-
for (var i = 0; i < comparators[
|
|
208
|
+
for (var i = 0; i < comparators[CommonFields[5]]; i++) {
|
|
208
209
|
result = comparators[i](a, b);
|
|
209
210
|
if (result !== 0)
|
|
210
211
|
return result;
|
package/_virtual/_react.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import CommonFields from "./../CommonFields";
|
|
1
2
|
import reactJsxRuntime_development from '../node_modules/react/cjs/react-jsx-runtime.development.js';
|
|
2
3
|
export { default } from '../node_modules/react/cjs/react-jsx-runtime.development.js';
|
|
3
4
|
//# sourceMappingURL=react-jsx-runtime.development.js.map
|