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/FilteredList.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, objectSpread2 as _objectSpread2 } 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";
|
|
@@ -42,7 +42,7 @@ var FilteredList = function (_PureComponent) {
|
|
|
42
42
|
var filtered = _this.list.filter(function (id) {
|
|
43
43
|
return !_this.hidden[id];
|
|
44
44
|
});
|
|
45
|
-
if (selectSingle && filtered[
|
|
45
|
+
if (selectSingle && filtered[CommonFields[5]] === 1) return filtered[0];
|
|
46
46
|
return null;
|
|
47
47
|
} else {
|
|
48
48
|
return value;
|
|
@@ -55,10 +55,10 @@ var FilteredList = function (_PureComponent) {
|
|
|
55
55
|
return selected === id;
|
|
56
56
|
});
|
|
57
57
|
if (_this.hidden[list[position]]) position = -1;
|
|
58
|
-
while (++position < list[
|
|
58
|
+
while (++position < list[CommonFields[5]]) {
|
|
59
59
|
if (!_this.hidden[list[position]]) break;
|
|
60
60
|
}
|
|
61
|
-
if (position < list[
|
|
61
|
+
if (position < list[CommonFields[5]]) {
|
|
62
62
|
var id = list[position];
|
|
63
63
|
_this.setState({
|
|
64
64
|
selected: id
|
|
@@ -72,7 +72,7 @@ var FilteredList = function (_PureComponent) {
|
|
|
72
72
|
var position = list.findIndex(function (id) {
|
|
73
73
|
return selected === id;
|
|
74
74
|
});
|
|
75
|
-
if (_this.hidden[list[position]]) position = list[
|
|
75
|
+
if (_this.hidden[list[position]]) position = list[CommonFields[5]];
|
|
76
76
|
while (--position >= 0) {
|
|
77
77
|
if (!_this.hidden[list[position]]) break;
|
|
78
78
|
}
|
|
@@ -89,9 +89,9 @@ var FilteredList = function (_PureComponent) {
|
|
|
89
89
|
var container = _this.el;
|
|
90
90
|
var scrollTop = container.getScroll();
|
|
91
91
|
var height = container.getHeight();
|
|
92
|
-
var isVisible = scrollTop <= child.offsetTop && scrollTop + height >= child.offsetTop + child[
|
|
92
|
+
var isVisible = scrollTop <= child.offsetTop && scrollTop + height >= child.offsetTop + child[CommonFields[9]];
|
|
93
93
|
if (!isVisible) {
|
|
94
|
-
var scrollToBottom = child.offsetTop + child[
|
|
94
|
+
var scrollToBottom = child.offsetTop + child[CommonFields[9]] - height;
|
|
95
95
|
var scrollToTop = child.offsetTop;
|
|
96
96
|
if (Math.abs(scrollTop - scrollToTop) < Math.abs(scrollTop - scrollToBottom)) {
|
|
97
97
|
container.setScroll(scrollToTop);
|
|
@@ -104,7 +104,7 @@ var FilteredList = function (_PureComponent) {
|
|
|
104
104
|
_this.setState({
|
|
105
105
|
selected: -1
|
|
106
106
|
});
|
|
107
|
-
_this.el[
|
|
107
|
+
_this.el[CommonFields[11]] = 0;
|
|
108
108
|
};
|
|
109
109
|
_this.scrollTo = function (id) {
|
|
110
110
|
return _this.el.setScroll(_this.elements[id] && _this.elements[id].offsetTop);
|
|
@@ -144,7 +144,7 @@ var FilteredList = function (_PureComponent) {
|
|
|
144
144
|
inline = _this$props.inline,
|
|
145
145
|
childComponent = _this$props.childComponent,
|
|
146
146
|
childProps = _this$props.childProps,
|
|
147
|
-
style = _this$props[
|
|
147
|
+
style = _this$props[CommonFields[4]],
|
|
148
148
|
scroll = _this$props.scroll;
|
|
149
149
|
return ReactCreateElement(Scrollable, {
|
|
150
150
|
[__className]: classNames('FilteredList', className, inline ? 'inline' : 'popup'),
|
package/FloatingActionButton.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/FormUploadProgress.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
import React from '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";
|
|
@@ -20,7 +20,7 @@ var defaultValueFormat = function defaultValueFormat(value, loaded, total) {
|
|
|
20
20
|
return ReactCreateElement(React.Fragment, null, formatNumberWithMaxLength(loaded, 1, abbreviation, 4), "/", formatNumberWithMaxLength(total, 1, abbreviation, 4), ReactCreateElement("br", null), abbreviation);
|
|
21
21
|
};
|
|
22
22
|
var FormUploadProgress = function FormUploadProgress(_ref) {
|
|
23
|
-
var value = _ref[
|
|
23
|
+
var value = _ref[CommonFields[8]],
|
|
24
24
|
cancel = _ref.cancel,
|
|
25
25
|
loaded = _ref.loaded,
|
|
26
26
|
total = _ref.total,
|
package/ImageGallery.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CommonFields from "./CommonFields";
|
|
1
2
|
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";
|
|
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,8 +26,8 @@ var previewWidth = previewRatio * previewHeight;
|
|
|
26
26
|
var previewPadding = 8;
|
|
27
27
|
var previewsHeight = previewHeight + 15;
|
|
28
28
|
var calculatePosition = function calculatePosition(it, ratio, width, height, previewsHeight, embedded, container) {
|
|
29
|
-
var windowWidth = embedded ? container[
|
|
30
|
-
var windowHeight = embedded ? container[
|
|
29
|
+
var windowWidth = embedded ? container[CommonFields[10]] : min(DOCUMENT.body[CommonFields[10]], WINDOW.innerWidth);
|
|
30
|
+
var windowHeight = embedded ? container[CommonFields[9]] : min(DOCUMENT.body[CommonFields[9]], WINDOW.innerHeight);
|
|
31
31
|
var offset = it.offset;
|
|
32
32
|
if (offset == null) offset = embedded ? 0 : windowHeight * 0.03;
|
|
33
33
|
var offsetTop = it.offsetTop;
|
|
@@ -117,7 +117,7 @@ var Actions = _createClass(function Actions() {
|
|
|
117
117
|
Actions.replaceImages = function (images) {
|
|
118
118
|
return function (dispatch, getState) {
|
|
119
119
|
var state = getState();
|
|
120
|
-
var length = images[
|
|
120
|
+
var length = images[CommonFields[5]];
|
|
121
121
|
var nextState = _objectSpread2({}, state);
|
|
122
122
|
nextState.images = images.map(function (item) {
|
|
123
123
|
var image = state.images.find(function (it) {
|
|
@@ -127,14 +127,14 @@ Actions.replaceImages = function (images) {
|
|
|
127
127
|
var it = _objectSpread2({}, item);
|
|
128
128
|
var el = it.el;
|
|
129
129
|
if (el) {
|
|
130
|
-
var rect = el[
|
|
131
|
-
var fromWidth = el[
|
|
132
|
-
var fromHeight = el[
|
|
133
|
-
it.fromLeftPx = toPx(rect[
|
|
134
|
-
it.fromTopPx = toPx(rect[
|
|
130
|
+
var rect = el[CommonFields[13]]();
|
|
131
|
+
var fromWidth = el[CommonFields[10]];
|
|
132
|
+
var fromHeight = el[CommonFields[9]];
|
|
133
|
+
it.fromLeftPx = toPx(rect[CommonFields[3]]);
|
|
134
|
+
it.fromTopPx = toPx(rect[CommonFields[2]]);
|
|
135
135
|
it.fromWidthPx = toPx(fromWidth);
|
|
136
136
|
var ratio = fromWidth / fromHeight;
|
|
137
|
-
calculatePosition(it, ratio, el.naturalWidth || el[
|
|
137
|
+
calculatePosition(it, ratio, el.naturalWidth || el[CommonFields[0]], el.naturalHeight || el[CommonFields[1]], withPreviews ? previewsHeight : 0, embedded, container);
|
|
138
138
|
} else {
|
|
139
139
|
it.toLeft = 100;
|
|
140
140
|
it.toTop = 100;
|
|
@@ -142,7 +142,7 @@ Actions.replaceImages = function (images) {
|
|
|
142
142
|
if (!it.toWidth || !it.toHeight || !el) Actions.loadPreview(it)(dispatch);
|
|
143
143
|
return it;
|
|
144
144
|
});
|
|
145
|
-
nextState.previews[
|
|
145
|
+
nextState.previews[CommonFields[0]] = min(length, 5) * previewWidth + min(length - 1, 4) * previewPadding;
|
|
146
146
|
nextState.previews.totalWidth = toPx(length * previewWidth + (length - 1) * previewPadding);
|
|
147
147
|
nextState.previews.images = nextState.images.map(function (item) {
|
|
148
148
|
var preview = state.previews.images.find(function (it) {
|
|
@@ -151,8 +151,8 @@ Actions.replaceImages = function (images) {
|
|
|
151
151
|
if (preview) return preview;
|
|
152
152
|
var el = item.el;
|
|
153
153
|
if (!el) return {};
|
|
154
|
-
var width = el[
|
|
155
|
-
var height = el[
|
|
154
|
+
var width = el[CommonFields[10]];
|
|
155
|
+
var height = el[CommonFields[9]];
|
|
156
156
|
return calculatePreview(width, height, el.src);
|
|
157
157
|
});
|
|
158
158
|
dispatch({
|
|
@@ -164,7 +164,7 @@ Actions.replaceImages = function (images) {
|
|
|
164
164
|
Actions.show = function (gallery) {
|
|
165
165
|
return function (dispatch) {
|
|
166
166
|
var images = gallery.images;
|
|
167
|
-
var length = images[
|
|
167
|
+
var length = images[CommonFields[5]];
|
|
168
168
|
var withPreviews = length > 1 && (gallery.withPreviews === UNDEFINED || !!gallery.withPreviews);
|
|
169
169
|
var container = gallery.container;
|
|
170
170
|
var embedded = gallery.embedded;
|
|
@@ -178,14 +178,14 @@ Actions.show = function (gallery) {
|
|
|
178
178
|
var it = _objectSpread2({}, item);
|
|
179
179
|
var el = it.el;
|
|
180
180
|
if (el) {
|
|
181
|
-
var rect = el[
|
|
182
|
-
var fromWidth = el[
|
|
183
|
-
var fromHeight = el[
|
|
184
|
-
it.fromLeftPx = toPx(rect[
|
|
185
|
-
it.fromTopPx = toPx(rect[
|
|
181
|
+
var rect = el[CommonFields[13]]();
|
|
182
|
+
var fromWidth = el[CommonFields[10]];
|
|
183
|
+
var fromHeight = el[CommonFields[9]];
|
|
184
|
+
it.fromLeftPx = toPx(rect[CommonFields[3]]);
|
|
185
|
+
it.fromTopPx = toPx(rect[CommonFields[2]]);
|
|
186
186
|
it.fromWidthPx = toPx(fromWidth);
|
|
187
187
|
var ratio = fromWidth / fromHeight;
|
|
188
|
-
calculatePosition(it, ratio, el.naturalWidth || el[
|
|
188
|
+
calculatePosition(it, ratio, el.naturalWidth || el[CommonFields[0]], el.naturalHeight || el[CommonFields[1]], withPreviews ? previewsHeight : 0, embedded, container);
|
|
189
189
|
} else {
|
|
190
190
|
it.toLeft = 100;
|
|
191
191
|
it.toTop = 100;
|
|
@@ -201,8 +201,8 @@ Actions.show = function (gallery) {
|
|
|
201
201
|
images: images.map(function (it) {
|
|
202
202
|
var el = it.el;
|
|
203
203
|
if (!el) return {};
|
|
204
|
-
var width = el[
|
|
205
|
-
var height = el[
|
|
204
|
+
var width = el[CommonFields[10]];
|
|
205
|
+
var height = el[CommonFields[9]];
|
|
206
206
|
return calculatePreview(width, height, el.src);
|
|
207
207
|
})
|
|
208
208
|
}
|
|
@@ -219,7 +219,7 @@ Actions.show = function (gallery) {
|
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
});
|
|
222
|
-
data.previews.scroll = calculatePreviewsScroll(index, length, data.previews[
|
|
222
|
+
data.previews.scroll = calculatePreviewsScroll(index, length, data.previews[CommonFields[0]]);
|
|
223
223
|
dispatch({
|
|
224
224
|
type: ACTION_IMAGE_GALLERY_SHOW,
|
|
225
225
|
data: data
|
|
@@ -286,11 +286,11 @@ var reducers = (_reducers = {}, _defineProperty(_reducers, ACTION_IMAGE_GALLERY_
|
|
|
286
286
|
var result = _objectSpread2(_objectSpread2({}, state), {}, {
|
|
287
287
|
images: images
|
|
288
288
|
});
|
|
289
|
-
for (var i = 0; i < images[
|
|
290
|
-
if (!images[i][
|
|
289
|
+
for (var i = 0; i < images[CommonFields[5]]; i++) {
|
|
290
|
+
if (!images[i][CommonFields[0]] && !images[i].fromWidthPx) continue;
|
|
291
291
|
var it = _objectSpread2({}, images[i]);
|
|
292
|
-
var width = it[
|
|
293
|
-
var height = it[
|
|
292
|
+
var width = it[CommonFields[0]] || Number.parseInt(it.fromWidthPx);
|
|
293
|
+
var height = it[CommonFields[1]] || Number.parseInt(it.fromHeightPx);
|
|
294
294
|
calculatePosition(it, width / height, width, height, result.previews.show ? previewsHeight : 0, state.embedded, state.container);
|
|
295
295
|
images[i] = it;
|
|
296
296
|
}
|
|
@@ -305,8 +305,8 @@ var reducers = (_reducers = {}, _defineProperty(_reducers, ACTION_IMAGE_GALLERY_
|
|
|
305
305
|
var index = images.findIndex(function (it) {
|
|
306
306
|
return it.id === item.id;
|
|
307
307
|
});
|
|
308
|
-
var width = image[
|
|
309
|
-
var height = image[
|
|
308
|
+
var width = image[CommonFields[0]];
|
|
309
|
+
var height = image[CommonFields[1]];
|
|
310
310
|
var it = _objectSpread2(_objectSpread2({}, images[index]), {}, {
|
|
311
311
|
loaded: true,
|
|
312
312
|
width: width,
|
|
@@ -326,11 +326,11 @@ var reducers = (_reducers = {}, _defineProperty(_reducers, ACTION_IMAGE_GALLERY_
|
|
|
326
326
|
return it.id === item.id;
|
|
327
327
|
});
|
|
328
328
|
var it = _objectSpread2({}, images[index]);
|
|
329
|
-
if (!it.toWidth || !it.toHeight) calculatePosition(it, image[
|
|
329
|
+
if (!it.toWidth || !it.toHeight) calculatePosition(it, image[CommonFields[0]] / image[CommonFields[1]], image[CommonFields[0]], image[CommonFields[1]], result.previews.show ? previewsHeight : 0, state.embedded, state.container);
|
|
330
330
|
images[index] = it;
|
|
331
331
|
var previewImages = _toConsumableArray(state.previews.images);
|
|
332
332
|
result.previews.images = previewImages;
|
|
333
|
-
var preview = calculatePreview(image[
|
|
333
|
+
var preview = calculatePreview(image[CommonFields[0]], image[CommonFields[1]], image.src);
|
|
334
334
|
previewImages[index] = preview;
|
|
335
335
|
return result;
|
|
336
336
|
}), _reducers);
|
|
@@ -354,7 +354,7 @@ var big = function big(it, index, i, shift, length, previous) {
|
|
|
354
354
|
if (index !== i) {
|
|
355
355
|
var width = WINDOW.innerWidth;
|
|
356
356
|
var additionalOffset = it.toLeft < 0 ? -it.toLeft : 0;
|
|
357
|
-
if (i < index) styles[
|
|
357
|
+
if (i < index) styles[CommonFields[3]] = toPx(it.toLeft - width - additionalOffset + (i + 1 === index ? shift : 0));else styles[CommonFields[3]] = toPx(it.toLeft + width + additionalOffset + (i - 1 === index ? shift : 0));
|
|
358
358
|
}
|
|
359
359
|
return styles;
|
|
360
360
|
};
|
|
@@ -388,7 +388,7 @@ var ImageGallery = function (_React$Component) {
|
|
|
388
388
|
var indexValue = index() !== UNDEFINED ? index() : props().index;
|
|
389
389
|
var image = images[indexValue];
|
|
390
390
|
if (!image) {
|
|
391
|
-
var i = images[
|
|
391
|
+
var i = images[CommonFields[5]] - 1;
|
|
392
392
|
if (i === -1) {
|
|
393
393
|
if (prevProps.images !== images) {
|
|
394
394
|
onClose();
|
|
@@ -452,22 +452,22 @@ var ImageGallery = function (_React$Component) {
|
|
|
452
452
|
var resetZoom = function resetZoom() {
|
|
453
453
|
if (!zoomed()) return;
|
|
454
454
|
zoomed(false);
|
|
455
|
-
zoomedImage[
|
|
456
|
-
zoomedImage[
|
|
457
|
-
zoomedImage[
|
|
458
|
-
zoomedImage[
|
|
455
|
+
zoomedImage[CommonFields[4]][CommonFields[0]] = defaultWidth;
|
|
456
|
+
zoomedImage[CommonFields[4]][CommonFields[3]] = defaultLeft;
|
|
457
|
+
zoomedImage[CommonFields[4]][CommonFields[2]] = defaultTop;
|
|
458
|
+
zoomedImage[CommonFields[4]].transition = null;
|
|
459
459
|
touchpadStarted = null;
|
|
460
460
|
};
|
|
461
461
|
var initZoom = function initZoom() {
|
|
462
462
|
zoomed(true);
|
|
463
|
-
defaultWidth = zoomedImage[
|
|
464
|
-
defaultLeft = zoomedImage[
|
|
465
|
-
defaultTop = zoomedImage[
|
|
463
|
+
defaultWidth = zoomedImage[CommonFields[4]][CommonFields[0]];
|
|
464
|
+
defaultLeft = zoomedImage[CommonFields[4]][CommonFields[3]];
|
|
465
|
+
defaultTop = zoomedImage[CommonFields[4]][CommonFields[2]];
|
|
466
466
|
};
|
|
467
467
|
var initTouchpadDragging = function initTouchpadDragging() {
|
|
468
|
-
oldLeft = Number.parseFloat(zoomedImage[
|
|
469
|
-
oldTop = Number.parseFloat(zoomedImage[
|
|
470
|
-
zoomedImage[
|
|
468
|
+
oldLeft = Number.parseFloat(zoomedImage[CommonFields[4]][CommonFields[3]]);
|
|
469
|
+
oldTop = Number.parseFloat(zoomedImage[CommonFields[4]][CommonFields[2]]);
|
|
470
|
+
zoomedImage[CommonFields[4]].transition = 'none';
|
|
471
471
|
touchpadStarted = true;
|
|
472
472
|
};
|
|
473
473
|
var onWheel = function onWheel(e) {
|
|
@@ -479,43 +479,43 @@ var ImageGallery = function (_React$Component) {
|
|
|
479
479
|
if (e.ctrlKey) {
|
|
480
480
|
var diff = e.deltaY * 0.005;
|
|
481
481
|
var newZoom = Math.min(Math.max(zoomValue + diff, 0.5), 10);
|
|
482
|
-
var zoomX = e[
|
|
482
|
+
var zoomX = e[CommonFields[6]];
|
|
483
483
|
oldLeft = zoomX - (zoomX - oldLeft) * newZoom / zoomValue;
|
|
484
|
-
var zoomY = e[
|
|
484
|
+
var zoomY = e[CommonFields[7]];
|
|
485
485
|
oldTop = zoomY - (zoomY - oldTop) * newZoom / zoomValue;
|
|
486
486
|
zoomValue = newZoom;
|
|
487
|
-
zoomedImage[
|
|
487
|
+
zoomedImage[CommonFields[4]][CommonFields[0]] = zoomValue * 100 + '%';
|
|
488
488
|
} else {
|
|
489
489
|
oldLeft += e.deltaX * 0.5;
|
|
490
490
|
oldTop += e.deltaY * 0.5;
|
|
491
491
|
}
|
|
492
|
-
zoomedImage[
|
|
493
|
-
zoomedImage[
|
|
492
|
+
zoomedImage[CommonFields[4]][CommonFields[3]] = oldLeft + 'px';
|
|
493
|
+
zoomedImage[CommonFields[4]][CommonFields[2]] = oldTop + 'px';
|
|
494
494
|
};
|
|
495
495
|
var moveListenerAdded;
|
|
496
496
|
var onTouchStart = function onTouchStart(e) {
|
|
497
497
|
e.swipeProcessed = false;
|
|
498
498
|
if (e.button === 2) return;
|
|
499
499
|
var touches = e.touches || [{
|
|
500
|
-
pageX: e[
|
|
501
|
-
pageY: e[
|
|
500
|
+
pageX: e[CommonFields[6]],
|
|
501
|
+
pageY: e[CommonFields[7]]
|
|
502
502
|
}];
|
|
503
503
|
zoomedImage = e.target;
|
|
504
504
|
zoomedImage = zoomedImage.tagName.toLowerCase() === 'img' ? zoomedImage.parentElement : zoomedImage;
|
|
505
|
-
oldLeft = Number.parseFloat(zoomedImage[
|
|
506
|
-
oldTop = Number.parseFloat(zoomedImage[
|
|
505
|
+
oldLeft = Number.parseFloat(zoomedImage[CommonFields[4]][CommonFields[3]]);
|
|
506
|
+
oldTop = Number.parseFloat(zoomedImage[CommonFields[4]][CommonFields[2]]);
|
|
507
507
|
if (zoomed()) {
|
|
508
|
-
zoomedImage[
|
|
508
|
+
zoomedImage[CommonFields[4]].transition = 'none';
|
|
509
509
|
}
|
|
510
510
|
if (!moveListenerAdded) {
|
|
511
511
|
addEventListener(_this.gallery, 'touchmove', onTouchMove, false);
|
|
512
512
|
moveListenerAdded = true;
|
|
513
513
|
}
|
|
514
|
-
if (touches[
|
|
514
|
+
if (touches[CommonFields[5]] === 2) {
|
|
515
515
|
if (zoomed()) zoomValueStarted = zoomValue;else if (!props().embedded) {
|
|
516
516
|
initZoom();
|
|
517
|
-
zoomedImage[
|
|
518
|
-
zoomValueStarted = zoomValue = Number.parseFloat(zoomedImage[
|
|
517
|
+
zoomedImage[CommonFields[4]].transition = 'none';
|
|
518
|
+
zoomValueStarted = zoomValue = Number.parseFloat(zoomedImage[CommonFields[4]][CommonFields[0]]) / WINDOW.innerWidth;
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
521
|
touchesStart = touches;
|
|
@@ -526,25 +526,25 @@ var ImageGallery = function (_React$Component) {
|
|
|
526
526
|
var distance = function distance(touches) {
|
|
527
527
|
var a = touches[0];
|
|
528
528
|
var b = touches[1];
|
|
529
|
-
return Math.sqrt(power2(a[
|
|
529
|
+
return Math.sqrt(power2(a[CommonFields[6]] - b[CommonFields[6]]) + power2(a[CommonFields[7]] - b[CommonFields[7]]));
|
|
530
530
|
};
|
|
531
531
|
var center = function center(touches) {
|
|
532
532
|
var a = touches[0];
|
|
533
533
|
var b = touches[1];
|
|
534
534
|
return {
|
|
535
|
-
x: (a[
|
|
536
|
-
y: (a[
|
|
535
|
+
x: (a[CommonFields[6]] + b[CommonFields[6]]) / 2,
|
|
536
|
+
y: (a[CommonFields[7]] + b[CommonFields[7]]) / 2
|
|
537
537
|
};
|
|
538
538
|
};
|
|
539
539
|
var onTouchMove = function onTouchMove(e) {
|
|
540
540
|
if (!touchesStart) return;
|
|
541
541
|
var touches = e.touches || [{
|
|
542
|
-
pageX: e[
|
|
543
|
-
pageY: e[
|
|
542
|
+
pageX: e[CommonFields[6]],
|
|
543
|
+
pageY: e[CommonFields[7]]
|
|
544
544
|
}];
|
|
545
545
|
if (zoomed()) {
|
|
546
546
|
preventDefault(e);
|
|
547
|
-
if (touches[
|
|
547
|
+
if (touches[CommonFields[5]] === 2) {
|
|
548
548
|
var diff = distance(touches) / distance(touchesStart);
|
|
549
549
|
zoomValue = Math.min(Math.max(zoomValueStarted * diff, 0.5), 10);
|
|
550
550
|
var zoomedAt = center(touchesStart);
|
|
@@ -552,24 +552,24 @@ var ImageGallery = function (_React$Component) {
|
|
|
552
552
|
var newLeft = zoomX - (zoomX - oldLeft) * zoomValue / zoomValueStarted;
|
|
553
553
|
var zoomY = zoomedAt.y;
|
|
554
554
|
var newTop = zoomY - (zoomY - oldTop) * zoomValue / zoomValueStarted;
|
|
555
|
-
zoomedImage[
|
|
556
|
-
zoomedImage[
|
|
557
|
-
zoomedImage[
|
|
555
|
+
zoomedImage[CommonFields[4]][CommonFields[3]] = newLeft + 'px';
|
|
556
|
+
zoomedImage[CommonFields[4]][CommonFields[2]] = newTop + 'px';
|
|
557
|
+
zoomedImage[CommonFields[4]][CommonFields[0]] = zoomValue * 100 + '%';
|
|
558
558
|
return;
|
|
559
559
|
} else {
|
|
560
560
|
var _touch = touches[0];
|
|
561
561
|
var _touchStart = touchesStart[0];
|
|
562
|
-
var _newLeft = oldLeft + _touch[
|
|
563
|
-
var _newTop = oldTop + _touch[
|
|
564
|
-
zoomedImage[
|
|
565
|
-
zoomedImage[
|
|
562
|
+
var _newLeft = oldLeft + _touch[CommonFields[6]] - _touchStart[CommonFields[6]];
|
|
563
|
+
var _newTop = oldTop + _touch[CommonFields[7]] - _touchStart[CommonFields[7]];
|
|
564
|
+
zoomedImage[CommonFields[4]][CommonFields[3]] = _newLeft + 'px';
|
|
565
|
+
zoomedImage[CommonFields[4]][CommonFields[2]] = _newTop + 'px';
|
|
566
566
|
return;
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
|
-
if (touches[
|
|
569
|
+
if (touches[CommonFields[5]] > 1 || zoomed()) return;
|
|
570
570
|
var touch = touches[0];
|
|
571
571
|
var touchStart = touchesStart[0];
|
|
572
|
-
shift(touch[
|
|
572
|
+
shift(touch[CommonFields[6]] - touchStart[CommonFields[6]]);
|
|
573
573
|
};
|
|
574
574
|
var onTouchEnd = function onTouchEnd(e) {
|
|
575
575
|
if (!touchesStart) return;
|
|
@@ -581,13 +581,13 @@ var ImageGallery = function (_React$Component) {
|
|
|
581
581
|
return;
|
|
582
582
|
}
|
|
583
583
|
var touches = e.changedTouches || [{
|
|
584
|
-
pageX: e[
|
|
585
|
-
pageY: e[
|
|
584
|
+
pageX: e[CommonFields[6]],
|
|
585
|
+
pageY: e[CommonFields[7]]
|
|
586
586
|
}];
|
|
587
587
|
var touchEnd = touches[0];
|
|
588
588
|
var touchStart = touchesStart[0];
|
|
589
|
-
var distX = touchEnd[
|
|
590
|
-
var distY = touchEnd[
|
|
589
|
+
var distX = touchEnd[CommonFields[6]] - touchStart[CommonFields[6]];
|
|
590
|
+
var distY = touchEnd[CommonFields[7]] - touchStart[CommonFields[7]];
|
|
591
591
|
touchesStart = UNDEFINED;
|
|
592
592
|
shift(0);
|
|
593
593
|
var minDistance = 20;
|
|
@@ -604,14 +604,14 @@ var ImageGallery = function (_React$Component) {
|
|
|
604
604
|
previews = _props.previews;
|
|
605
605
|
index(i);
|
|
606
606
|
previous(prev);
|
|
607
|
-
previewScroll(calculatePreviewsScroll(i, previews.images[
|
|
607
|
+
previewScroll(calculatePreviewsScroll(i, previews.images[CommonFields[5]], previews[CommonFields[0]]));
|
|
608
608
|
};
|
|
609
609
|
var left = function left(e) {
|
|
610
610
|
if (zoomed()) return;
|
|
611
611
|
preventDefault(e);
|
|
612
612
|
stopPropagation(e);
|
|
613
613
|
var indexValue = index() !== UNDEFINED ? index() : props().index;
|
|
614
|
-
if (indexValue > 0) scrollTo(indexValue - 1, indexValue);else if (props().loop) scrollTo(props().images[
|
|
614
|
+
if (indexValue > 0) scrollTo(indexValue - 1, indexValue);else if (props().loop) scrollTo(props().images[CommonFields[5]] - 1, indexValue);
|
|
615
615
|
};
|
|
616
616
|
var right = function right(e) {
|
|
617
617
|
if (zoomed()) return;
|
|
@@ -620,10 +620,10 @@ var ImageGallery = function (_React$Component) {
|
|
|
620
620
|
var _props2 = props(),
|
|
621
621
|
images = _props2.images;
|
|
622
622
|
var indexValue = index() !== UNDEFINED ? index() : props().index;
|
|
623
|
-
if (indexValue < images[
|
|
623
|
+
if (indexValue < images[CommonFields[5]] - 1) scrollTo(indexValue + 1, indexValue);else if (props().loop) scrollTo(0, indexValue);
|
|
624
624
|
};
|
|
625
625
|
that.scrollTo = scrollTo;
|
|
626
|
-
that[
|
|
626
|
+
that[CommonFields[3]] = left;
|
|
627
627
|
that.right = right;
|
|
628
628
|
var animatedRoundButton = function animatedRoundButton(show, className, onClick, icon) {
|
|
629
629
|
return ReactCreateElement(Animated, {
|
|
@@ -650,7 +650,7 @@ var ImageGallery = function (_React$Component) {
|
|
|
650
650
|
_onClick = _props4.onClick,
|
|
651
651
|
children = _props4[__children];
|
|
652
652
|
var indexValue = index() !== UNDEFINED ? index() : props().index;
|
|
653
|
-
var length = images[
|
|
653
|
+
var length = images[CommonFields[5]];
|
|
654
654
|
var isZoomed = zoomed();
|
|
655
655
|
var shiftValue = shift() || 0;
|
|
656
656
|
previous();
|
|
@@ -688,23 +688,23 @@ var ImageGallery = function (_React$Component) {
|
|
|
688
688
|
draggable: false,
|
|
689
689
|
onDoubleClick: function onDoubleClick(e) {
|
|
690
690
|
var img = e.target;
|
|
691
|
-
if (img.naturalWidth === img[
|
|
691
|
+
if (img.naturalWidth === img[CommonFields[10]] && img.naturalHeight === img[CommonFields[9]]) return;
|
|
692
692
|
if (!isZoomed) {
|
|
693
693
|
zoomedImage = img.tagName.toLowerCase() === 'img' ? img.parentElement : img;
|
|
694
694
|
initZoom();
|
|
695
695
|
zoomValue = 2;
|
|
696
696
|
var newWidth = WINDOW.innerWidth * 2;
|
|
697
|
-
var oldWidth = Number.parseFloat(zoomedImage[
|
|
698
|
-
var _oldLeft = Number.parseFloat(zoomedImage[
|
|
699
|
-
var zoomX = e[
|
|
697
|
+
var oldWidth = Number.parseFloat(zoomedImage[CommonFields[4]][CommonFields[0]]);
|
|
698
|
+
var _oldLeft = Number.parseFloat(zoomedImage[CommonFields[4]][CommonFields[3]]);
|
|
699
|
+
var zoomX = e[CommonFields[6]];
|
|
700
700
|
var diff = newWidth / oldWidth;
|
|
701
701
|
var newLeft = zoomX - (zoomX - _oldLeft) * diff;
|
|
702
|
-
var _oldTop = Number.parseFloat(zoomedImage[
|
|
703
|
-
var zoomY = e[
|
|
702
|
+
var _oldTop = Number.parseFloat(zoomedImage[CommonFields[4]][CommonFields[2]]);
|
|
703
|
+
var zoomY = e[CommonFields[7]];
|
|
704
704
|
var newTop = zoomY - (zoomY - _oldTop) * diff;
|
|
705
|
-
zoomedImage[
|
|
706
|
-
zoomedImage[
|
|
707
|
-
zoomedImage[
|
|
705
|
+
zoomedImage[CommonFields[4]][CommonFields[0]] = '200%';
|
|
706
|
+
zoomedImage[CommonFields[4]][CommonFields[3]] = newLeft + 'px';
|
|
707
|
+
zoomedImage[CommonFields[4]][CommonFields[2]] = newTop + 'px';
|
|
708
708
|
} else {
|
|
709
709
|
resetZoom();
|
|
710
710
|
}
|
|
@@ -738,7 +738,7 @@ var ImageGallery = function (_React$Component) {
|
|
|
738
738
|
}, ReactCreateElement("div", {
|
|
739
739
|
[__className]: "previews",
|
|
740
740
|
style: {
|
|
741
|
-
width: previews[
|
|
741
|
+
width: previews[CommonFields[0]]
|
|
742
742
|
}
|
|
743
743
|
}, ReactCreateElement("div", {
|
|
744
744
|
[__className]: "viewport"
|
|
@@ -833,7 +833,7 @@ var ImageGalleryContainer = function (_React$Component2) {
|
|
|
833
833
|
that[componentDidMount] = function () {
|
|
834
834
|
props()[embedded] && show(props()[embedded]);
|
|
835
835
|
that.scrollTo = galleryRef().scrollTo;
|
|
836
|
-
that[
|
|
836
|
+
that[CommonFields[3]] = galleryRef()[CommonFields[3]];
|
|
837
837
|
that.right = galleryRef().right;
|
|
838
838
|
};
|
|
839
839
|
that[componentDidUpdate] = function (prevProps, prevState) {
|
package/MaterialIcon.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/Modal.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";
|
|
@@ -53,7 +53,7 @@ var Modal = function (_PureComponent) {
|
|
|
53
53
|
if (!bc || bc(that.close)) that.close(e);
|
|
54
54
|
};
|
|
55
55
|
var shouldClose = function shouldClose(e) {
|
|
56
|
-
var isSameModal = el()[
|
|
56
|
+
var isSameModal = el()[CommonFields[4]].zIndex == zIndex - 1;
|
|
57
57
|
!(e && content().contains(e.target)) && isSameModal && beforeClose(e);
|
|
58
58
|
};
|
|
59
59
|
var addTransitionListener = function addTransitionListener() {
|
|
@@ -61,14 +61,14 @@ var Modal = function (_PureComponent) {
|
|
|
61
61
|
var listener = function listener() {
|
|
62
62
|
removeEventListener(overlay(), transitionend, listener);
|
|
63
63
|
orNoop(isShow() ? props().onOpen : orNoop(props().onClose))();
|
|
64
|
-
el() && (el()[
|
|
64
|
+
el() && (el()[CommonFields[4]].paddingBottom = isShow() ? '1px' : '0px');
|
|
65
65
|
};
|
|
66
66
|
addEventListener(overlay(), transitionend, listener);
|
|
67
67
|
};
|
|
68
68
|
that[render] = function () {
|
|
69
69
|
var _props2 = props(),
|
|
70
70
|
className = _props2[__className],
|
|
71
|
-
top = _props2[
|
|
71
|
+
top = _props2[CommonFields[2]],
|
|
72
72
|
_props2$container = _props2.container,
|
|
73
73
|
container = _props2$container === void 0 ? Modal.defaultContainer : _props2$container,
|
|
74
74
|
children = _props2[__children],
|
|
@@ -110,7 +110,7 @@ var Modal = function (_PureComponent) {
|
|
|
110
110
|
};
|
|
111
111
|
var open = that.open = function () {
|
|
112
112
|
if (isShow()) return;
|
|
113
|
-
el() && (el()[
|
|
113
|
+
el() && (el()[CommonFields[4]].zIndex = zIndex++);
|
|
114
114
|
addTransitionListener();
|
|
115
115
|
isShow(true);
|
|
116
116
|
var listener = function listener(event) {
|
package/ModalMenu.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";
|
|
@@ -30,7 +30,7 @@ var ModalMenu = function (_PureComponent) {
|
|
|
30
30
|
var filtered = (items || []).filter(function (it) {
|
|
31
31
|
return !!it;
|
|
32
32
|
});
|
|
33
|
-
if (filtered[
|
|
33
|
+
if (filtered[CommonFields[5]] === 0) return null;
|
|
34
34
|
var open = isOpen();
|
|
35
35
|
return ReactCreateElement("div", {
|
|
36
36
|
[__className]: classNames("ModalMenu", 'row', open && 'open')
|
|
@@ -41,10 +41,10 @@ var ModalMenu = function (_PureComponent) {
|
|
|
41
41
|
mounting: 200,
|
|
42
42
|
unmounting: 200,
|
|
43
43
|
mountingDelay: i * 50,
|
|
44
|
-
unmountingDelay: (filtered[
|
|
44
|
+
unmountingDelay: (filtered[CommonFields[5]] - i - 1) * 50,
|
|
45
45
|
styles: {
|
|
46
46
|
mounting: {
|
|
47
|
-
right: (filtered[
|
|
47
|
+
right: (filtered[CommonFields[5]] - i) * 36 + 5 + (filtered[CommonFields[5]] - i) * 5 + "px"
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}, ReactCreateElement(Button, {
|
package/ReactCreateElement.js
CHANGED
package/ReadyListener.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";
|