react-ui-basics 0.0.158 → 0.0.161
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 +11 -10
- package/AutocompleteSelect.js +62 -63
- package/Button.js +21 -22
- package/Checkbox.js +7 -8
- package/CircleProgress.js +5 -6
- package/CommonFields.js +23 -15
- package/DNDContainer.js +47 -48
- package/DNDDraggable.js +8 -9
- package/DNDDroppable.js +8 -9
- package/Dialog.js +16 -17
- package/DropFileInput.js +4 -5
- package/DroppableHorizontalList.js +26 -27
- package/DroppableList.js +26 -27
- package/Dropzone.js +17 -18
- package/FilteredList.js +40 -41
- package/FloatingActionButton.js +4 -5
- package/FormUploadProgress.js +8 -9
- package/ImageGallery.js +121 -122
- package/MaterialIcon.js +5 -6
- package/Modal.js +17 -18
- package/ModalMenu.js +10 -11
- package/ReactConstants.d.ts +2 -0
- package/ReactConstants.js +2 -1
- package/ReactCreateElement.js +2 -0
- package/ReadyListener.js +9 -10
- package/Scrollable.js +50 -51
- package/ScrollableTable.js +4 -5
- package/Size.js +5 -6
- package/Snackbar.js +7 -8
- package/SpinningProgress.js +5 -6
- package/Switch.js +14 -15
- package/Table.js +26 -27
- package/TextField.js +17 -18
- package/Tools.d.ts +1 -0
- package/Tools.js +14 -12
- package/_virtual/_commonjsHelpers.js +2 -0
- package/_virtual/_react.js +2 -0
- package/_virtual/react-jsx-runtime.development.js +2 -0
- package/bundle.css +446 -446
- package/index.js +3 -3
- package/package.json +1 -1
- package/router/HistoryTools.js +2 -0
- package/router/Link.js +5 -6
- package/router/NavLink.js +5 -6
- package/router/Route.js +15 -16
- package/router/index.js +2 -3
- package/store/ProxyTools.js +2 -3
- package/store/Store.js +2 -3
- package/Animated.js.map +0 -1
- package/AutocompleteSelect.js.map +0 -1
- package/Button.js.map +0 -1
- package/Checkbox.js.map +0 -1
- package/CircleProgress.js.map +0 -1
- package/CommonFields.js.map +0 -1
- package/DNDContainer.js.map +0 -1
- package/DNDDraggable.js.map +0 -1
- package/DNDDroppable.js.map +0 -1
- package/Dialog.js.map +0 -1
- package/DropFileInput.js.map +0 -1
- package/DroppableHorizontalList.js.map +0 -1
- package/DroppableList.js.map +0 -1
- package/Dropzone.js.map +0 -1
- package/FilteredList.js.map +0 -1
- package/FloatingActionButton.js.map +0 -1
- package/FormUploadProgress.js.map +0 -1
- package/ImageGallery.js.map +0 -1
- package/MaterialIcon.js.map +0 -1
- package/Modal.js.map +0 -1
- package/ModalMenu.js.map +0 -1
- package/ReactConstants.js.map +0 -1
- package/ReactCreateElement.js.map +0 -1
- package/ReadyListener.js.map +0 -1
- package/Scrollable.js.map +0 -1
- package/ScrollableTable.js.map +0 -1
- package/Size.js.map +0 -1
- package/Snackbar.js.map +0 -1
- package/SpinningProgress.js.map +0 -1
- package/Switch.js.map +0 -1
- package/Table.js.map +0 -1
- package/TextField.js.map +0 -1
- package/Tools.js.map +0 -1
- package/index.js.map +0 -1
package/DNDContainer.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import ReactConstants from "./ReactConstants";
|
|
2
|
+
import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, props as __props, scrollLeft as __scrollLeft, scrollTop as __scrollTop, state as __state, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
|
|
1
3
|
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
4
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
5
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
6
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {className as __className} from "./ReactConstants";
|
|
7
|
-
import {children as __children} from "./ReactConstants";
|
|
8
7
|
import { Component } from 'react';
|
|
9
8
|
import ReactCreateElement from './ReactCreateElement.js';
|
|
10
9
|
import { setTimeout, clearTimeout, preventDefault, addEventListener, orNoop, NOOP, removeEventListener, WINDOW, DOCUMENT, requestAnimationFrame, classNames, ref } from './Tools.js';
|
|
@@ -31,27 +30,27 @@ var DNDContainer = function (_Component) {
|
|
|
31
30
|
_classCallCheck(this, DNDContainer);
|
|
32
31
|
_this = _super.call(this, props);
|
|
33
32
|
_this.draggableInitializer = function (item) {
|
|
34
|
-
var handle = item.
|
|
33
|
+
var handle = __props(item).handle;
|
|
35
34
|
var draggableElement = handle && item.element.childNodes[0] || item.element;
|
|
36
35
|
draggableElement.draggable = true;
|
|
37
36
|
var dragStartListener = function dragStartListener(e) {
|
|
38
37
|
clearSelection();
|
|
39
38
|
var container = _this.container;
|
|
40
|
-
_this.data = item.
|
|
39
|
+
_this.data = __props(item).data;
|
|
41
40
|
_this.draggable = item;
|
|
42
|
-
_this.scrollOffsetX = e
|
|
43
|
-
_this.scrollOffsetY = e
|
|
41
|
+
_this.scrollOffsetX = __pageX(e) - e.clientX;
|
|
42
|
+
_this.scrollOffsetY = __pageY(e) - e.clientY;
|
|
44
43
|
var dataTransfer = e.dataTransfer;
|
|
45
|
-
var itemOffset = item.element
|
|
46
|
-
item
|
|
47
|
-
item
|
|
48
|
-
var clone = orNoop(item.
|
|
49
|
-
var style = it.element
|
|
50
|
-
var offsetLeft = totalOffsetLeft(container) + (e.clientX - itemOffset
|
|
51
|
-
var offsetTop = totalOffsetTop(container) + (e.clientY - itemOffset
|
|
44
|
+
var itemOffset = item.element.getBoundingClientRect();
|
|
45
|
+
item.width = __width(itemOffset);
|
|
46
|
+
item.height = __height(itemOffset);
|
|
47
|
+
var clone = orNoop(__props(item).copy)(function (it) {
|
|
48
|
+
var style = it.element.style;
|
|
49
|
+
var offsetLeft = totalOffsetLeft(container) + (e.clientX - __left(itemOffset));
|
|
50
|
+
var offsetTop = totalOffsetTop(container) + (e.clientY - __top(itemOffset));
|
|
52
51
|
_this[positionListener] = orNoop(it.createPositionListener)(e, style, itemOffset, container) || function (e) {
|
|
53
|
-
if (e
|
|
54
|
-
style.transform = 'translate(' + (e
|
|
52
|
+
if (e.pageX === 0) return;
|
|
53
|
+
style.transform = 'translate(' + (__pageX(e) - offsetLeft) + 'px, ' + (__pageY(e) - offsetTop) + 'px)';
|
|
55
54
|
};
|
|
56
55
|
requestAnimationFrame(function () {
|
|
57
56
|
if (dataTransfer && !dataTransfer.setDragImage) {
|
|
@@ -61,10 +60,10 @@ var DNDContainer = function (_Component) {
|
|
|
61
60
|
style.position = 'absolute';
|
|
62
61
|
style.pointerEvents = 'none';
|
|
63
62
|
style.opacity = '1';
|
|
64
|
-
style
|
|
65
|
-
style
|
|
66
|
-
style
|
|
67
|
-
style
|
|
63
|
+
style.top = '0px';
|
|
64
|
+
style.left = '0px';
|
|
65
|
+
style.width = __width(itemOffset) + 'px';
|
|
66
|
+
style.height = __height(itemOffset) + 'px';
|
|
68
67
|
}
|
|
69
68
|
_this.onDrag(e);
|
|
70
69
|
it.setState({
|
|
@@ -103,7 +102,7 @@ var DNDContainer = function (_Component) {
|
|
|
103
102
|
var dragStarted = false;
|
|
104
103
|
var dragged = false;
|
|
105
104
|
addListener(draggableElement, item, 'touchstart', function (e) {
|
|
106
|
-
if (e.touches
|
|
105
|
+
if (e.touches.length > 1) return;
|
|
107
106
|
dragged = dragStarted = false;
|
|
108
107
|
var touch = e.targetTouches[0];
|
|
109
108
|
longTouch = setTimeout(function () {
|
|
@@ -116,7 +115,7 @@ var DNDContainer = function (_Component) {
|
|
|
116
115
|
return;
|
|
117
116
|
}
|
|
118
117
|
if (!dragStarted) return;
|
|
119
|
-
if (e.touches
|
|
118
|
+
if (e.touches.length > 1) return;
|
|
120
119
|
preventDefault(e);
|
|
121
120
|
dragged = true;
|
|
122
121
|
var touch = e.targetTouches[0];
|
|
@@ -131,7 +130,7 @@ var DNDContainer = function (_Component) {
|
|
|
131
130
|
item.setState({
|
|
132
131
|
placeholder: false
|
|
133
132
|
});
|
|
134
|
-
if (e.touches
|
|
133
|
+
if (e.touches.length > 0) return;
|
|
135
134
|
_this[droppables].forEach(function (it) {
|
|
136
135
|
return it.dropIfHover();
|
|
137
136
|
});
|
|
@@ -142,30 +141,30 @@ var DNDContainer = function (_Component) {
|
|
|
142
141
|
_this[droppables].push(item);
|
|
143
142
|
addEventListener(item.element, 'drop', function (e) {
|
|
144
143
|
preventDefault(e);
|
|
145
|
-
_this
|
|
144
|
+
__data(_this) && orNoop(__props(item).onDrop)(__data(_this));
|
|
146
145
|
}, false);
|
|
147
146
|
item.onDragStart = function (e, draggable) {
|
|
148
|
-
item.bounds = item.element
|
|
147
|
+
item.bounds = item.element.getBoundingClientRect();
|
|
149
148
|
item.setState({
|
|
150
149
|
allow: true
|
|
151
150
|
});
|
|
152
|
-
orNoop(item.
|
|
151
|
+
orNoop(__props(item).onDragStart)(e, draggable);
|
|
153
152
|
};
|
|
154
153
|
item.isHover = function (e, draggable) {
|
|
155
154
|
var bounds = item.bounds;
|
|
156
155
|
if (!bounds) return;
|
|
157
|
-
var y = e
|
|
158
|
-
var x = e
|
|
159
|
-
var hover = bounds
|
|
160
|
-
hover && orNoop(item.
|
|
161
|
-
if (hover) !item.
|
|
156
|
+
var y = __pageY(e) - _this.scrollOffsetY;
|
|
157
|
+
var x = __pageX(e) - _this.scrollOffsetX;
|
|
158
|
+
var hover = __left(bounds) <= x && bounds.right >= x && __top(bounds) <= y && bounds.bottom >= y;
|
|
159
|
+
hover && orNoop(__props(item).onHover)(e, draggable);
|
|
160
|
+
if (hover) !__state(item).hover && item.setState({
|
|
162
161
|
hover: hover
|
|
163
|
-
});else item.
|
|
162
|
+
});else __state(item).hover && item.setState({
|
|
164
163
|
hover: hover
|
|
165
164
|
});
|
|
166
165
|
};
|
|
167
166
|
item.dropIfHover = function () {
|
|
168
|
-
_this
|
|
167
|
+
__data(_this) && __state(item).hover && orNoop(__props(item).onDrop)(__data(_this));
|
|
169
168
|
};
|
|
170
169
|
item.onDragEnd = function () {
|
|
171
170
|
orNoop(orNoop(_this.draggable).onDragEnd)();
|
|
@@ -193,11 +192,11 @@ var DNDContainer = function (_Component) {
|
|
|
193
192
|
_this.onDragEnd = function () {
|
|
194
193
|
var draggable = _this.draggable;
|
|
195
194
|
if (draggable.element) {
|
|
196
|
-
var style = draggable.element
|
|
195
|
+
var style = draggable.element.style;
|
|
197
196
|
style.position = '';
|
|
198
197
|
style.pointerEvents = '';
|
|
199
|
-
style
|
|
200
|
-
style
|
|
198
|
+
style.width = "";
|
|
199
|
+
style.height = "";
|
|
201
200
|
style.opacity = '';
|
|
202
201
|
}
|
|
203
202
|
draggable.setState({
|
|
@@ -208,7 +207,7 @@ var DNDContainer = function (_Component) {
|
|
|
208
207
|
});
|
|
209
208
|
_this[droppables].forEach(function (it) {
|
|
210
209
|
it.onDragEnd();
|
|
211
|
-
orNoop(it.
|
|
210
|
+
orNoop(__props(it).onDragEnd)(_this.draggable);
|
|
212
211
|
});
|
|
213
212
|
_this.data = null;
|
|
214
213
|
_this.draggable = null;
|
|
@@ -221,23 +220,23 @@ var DNDContainer = function (_Component) {
|
|
|
221
220
|
return _this;
|
|
222
221
|
}
|
|
223
222
|
_createClass(DNDContainer, [{
|
|
224
|
-
key:
|
|
223
|
+
key: [ReactConstants[3]],
|
|
225
224
|
value: function render() {
|
|
226
|
-
var _this$props = this
|
|
227
|
-
children = _this$props[
|
|
228
|
-
className = _this$props[
|
|
229
|
-
var draggable = this.
|
|
225
|
+
var _this$props = __props(this),
|
|
226
|
+
children = _this$props[ReactConstants[4]],
|
|
227
|
+
className = _this$props[ReactConstants[5]];
|
|
228
|
+
var draggable = __state(this).draggable;
|
|
230
229
|
return ReactCreateElement("div", {
|
|
231
|
-
[
|
|
230
|
+
[ReactConstants[5]]: classNames('DNDContainer', className),
|
|
232
231
|
ref: ref('container', this)
|
|
233
232
|
}, children, ReactCreateElement("div", {
|
|
234
|
-
[
|
|
233
|
+
[ReactConstants[5]]: "overlay"
|
|
235
234
|
}, draggable));
|
|
236
235
|
}
|
|
237
236
|
}, {
|
|
238
|
-
key:
|
|
237
|
+
key: [ReactConstants[0]],
|
|
239
238
|
value: function componentDidMount() {
|
|
240
|
-
var _this$props2 = this
|
|
239
|
+
var _this$props2 = __props(this),
|
|
241
240
|
provideDraggableInitializer = _this$props2.provideDraggableInitializer,
|
|
242
241
|
provideDroppableInitializer = _this$props2.provideDroppableInitializer;
|
|
243
242
|
orNoop(provideDraggableInitializer)(this.draggableInitializer);
|
|
@@ -258,10 +257,10 @@ var addListener = function addListener(el, item, type, listener) {
|
|
|
258
257
|
addEventListener(el, type, item[type] = listener);
|
|
259
258
|
};
|
|
260
259
|
var totalOffsetTop = function totalOffsetTop(el) {
|
|
261
|
-
return el
|
|
260
|
+
return el.getBoundingClientRect().top + (WINDOW.pageYOffset || DOCUMENT.documentElement.scrollTop);
|
|
262
261
|
};
|
|
263
262
|
var totalOffsetLeft = function totalOffsetLeft(el) {
|
|
264
|
-
return el
|
|
263
|
+
return el.getBoundingClientRect().left + (WINDOW.pageXOffset || DOCUMENT.documentElement.scrollLeft);
|
|
265
264
|
};
|
|
266
265
|
var DNDContainer$1 = DNDContainer;
|
|
267
266
|
|
package/DNDDraggable.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import ReactConstants from "./ReactConstants";
|
|
2
|
+
import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, props as __props, scrollLeft as __scrollLeft, scrollTop as __scrollTop, state as __state, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
|
|
1
3
|
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
4
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
5
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
6
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {className as __className} from "./ReactConstants";
|
|
7
|
-
import {children as __children} from "./ReactConstants";
|
|
8
7
|
import 'react';
|
|
9
8
|
import ReactCreateElement from './ReactCreateElement.js';
|
|
10
9
|
import { orNoop, classNames, ref } from './Tools.js';
|
|
@@ -27,23 +26,23 @@ var Draggable = function (_PureComponent) {
|
|
|
27
26
|
_this = _super.call(this, properties);
|
|
28
27
|
var that = _assertThisInitialized(_this);
|
|
29
28
|
that.state = {};
|
|
30
|
-
that[
|
|
29
|
+
that[ReactConstants[2]] = function (prevProps) {
|
|
31
30
|
if (prevProps[handle] !== props(that)[handle] || prevProps[initializer] !== props(that)[initializer]) init(that);
|
|
32
31
|
};
|
|
33
|
-
that[
|
|
32
|
+
that[ReactConstants[0]] = function () {
|
|
34
33
|
init(that);
|
|
35
34
|
};
|
|
36
|
-
that[
|
|
35
|
+
that[ReactConstants[1]] = function () {
|
|
37
36
|
orNoop(that.onUnmount)();
|
|
38
37
|
};
|
|
39
|
-
that[
|
|
38
|
+
that[ReactConstants[3]] = function () {
|
|
40
39
|
var _state = state(that),
|
|
41
40
|
_props = props(that);
|
|
42
41
|
return ReactCreateElement("div", {
|
|
43
|
-
[
|
|
42
|
+
[ReactConstants[5]]: classNames('Draggable', _props[ReactConstants[5]], _state[dragged] && dragged, _state[placeholder] && placeholder, _state[hover] && hover),
|
|
44
43
|
onClick: _props.onClick,
|
|
45
44
|
ref: ref('element', that)
|
|
46
|
-
}, _props[handle], _props[
|
|
45
|
+
}, _props[handle], _props[ReactConstants[4]]);
|
|
47
46
|
};
|
|
48
47
|
return _this;
|
|
49
48
|
}
|
package/DNDDroppable.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import ReactConstants from "./ReactConstants";
|
|
2
|
+
import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, props as __props, scrollLeft as __scrollLeft, scrollTop as __scrollTop, state as __state, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
|
|
1
3
|
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
4
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
5
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
6
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {className as __className} from "./ReactConstants";
|
|
7
|
-
import {children as __children} from "./ReactConstants";
|
|
8
7
|
import 'react';
|
|
9
8
|
import ReactCreateElement from './ReactCreateElement.js';
|
|
10
9
|
import { orNoop, classNames, preventDefault, stopPropagation, ref } from './Tools.js';
|
|
@@ -24,26 +23,26 @@ var Droppable = function (_PureComponent) {
|
|
|
24
23
|
_classCallCheck(this, Droppable);
|
|
25
24
|
_this = _super.call(this, properties);
|
|
26
25
|
var that = _assertThisInitialized(_this);
|
|
27
|
-
that[
|
|
26
|
+
that[ReactConstants[2]] = function (prevProps) {
|
|
28
27
|
if (prevProps[initializer] !== props(that)[initializer]) init(that);
|
|
29
28
|
};
|
|
30
|
-
that[
|
|
29
|
+
that[ReactConstants[0]] = function () {
|
|
31
30
|
init(that);
|
|
32
31
|
};
|
|
33
|
-
that[
|
|
32
|
+
that[ReactConstants[1]] = function () {
|
|
34
33
|
orNoop(that.onUnmount)();
|
|
35
34
|
};
|
|
36
|
-
that[
|
|
35
|
+
that[ReactConstants[3]] = function () {
|
|
37
36
|
var _props = props(that),
|
|
38
37
|
_state = state(that);
|
|
39
38
|
return ReactCreateElement("div", {
|
|
40
|
-
[
|
|
39
|
+
[ReactConstants[5]]: classNames('Droppable', _props[ReactConstants[5]], _state[hover] && hover, _state[allow] && allow),
|
|
41
40
|
onDragOver: function onDragOver(e) {
|
|
42
41
|
preventDefault(e);
|
|
43
42
|
stopPropagation(e);
|
|
44
43
|
},
|
|
45
44
|
ref: ref('element', that)
|
|
46
|
-
}, _props[
|
|
45
|
+
}, _props[ReactConstants[4]]);
|
|
47
46
|
};
|
|
48
47
|
return _this;
|
|
49
48
|
}
|
package/Dialog.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import ReactConstants from "./ReactConstants";
|
|
2
|
+
import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, props as __props, scrollLeft as __scrollLeft, scrollTop as __scrollTop, state as __state, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
|
|
1
3
|
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, createClass as _createClass, assertThisInitialized as _assertThisInitialized, slicedToArray as _slicedToArray, objectWithoutProperties as _objectWithoutProperties, extends as _extends } 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
4
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
5
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
6
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {className as __className} from "./ReactConstants";
|
|
7
|
-
import {children as __children} from "./ReactConstants";
|
|
8
7
|
import { Component } from 'react';
|
|
9
8
|
import ReactCreateElement from './ReactCreateElement.js';
|
|
10
9
|
import Button from './Button.js';
|
|
@@ -13,7 +12,7 @@ import { classNames, UNDEFINED, isUndefined, orNoop, createRef, preventDefault }
|
|
|
13
12
|
import { render, stateGSs, componentDidMount, PureComponent, propsGetter } from './ReactConstants.js';
|
|
14
13
|
import PropTypes from 'prop-types';
|
|
15
14
|
|
|
16
|
-
var _excluded = ["top",
|
|
15
|
+
var _excluded = ["top", [ReactConstants[5]]];
|
|
17
16
|
var Dialog = function (_PureComponent) {
|
|
18
17
|
_inherits(Dialog, _PureComponent);
|
|
19
18
|
var _super = _createSuper(Dialog);
|
|
@@ -21,23 +20,23 @@ var Dialog = function (_PureComponent) {
|
|
|
21
20
|
var _this;
|
|
22
21
|
_classCallCheck(this, Dialog);
|
|
23
22
|
_this = _super.call(this, properties);
|
|
24
|
-
_this[
|
|
25
|
-
var _this$props = _this
|
|
23
|
+
_this[ReactConstants[3]] = function () {
|
|
24
|
+
var _this$props = __props(_this),
|
|
26
25
|
title = _this$props.title,
|
|
27
26
|
description = _this$props.description,
|
|
28
27
|
accept = _this$props.accept,
|
|
29
28
|
cancel = _this$props.cancel,
|
|
30
29
|
onAccept = _this$props.onAccept,
|
|
31
30
|
onCancel = _this$props.onCancel,
|
|
32
|
-
children = _this$props[
|
|
31
|
+
children = _this$props[ReactConstants[4]];
|
|
33
32
|
return ReactCreateElement("div", {
|
|
34
|
-
[
|
|
33
|
+
[ReactConstants[5]]: "Dialog"
|
|
35
34
|
}, title && ReactCreateElement("div", {
|
|
36
|
-
[
|
|
35
|
+
[ReactConstants[5]]: "title"
|
|
37
36
|
}, title), description && ReactCreateElement("div", {
|
|
38
|
-
[
|
|
37
|
+
[ReactConstants[5]]: "description"
|
|
39
38
|
}, description), children, ReactCreateElement("div", {
|
|
40
|
-
[
|
|
39
|
+
[ReactConstants[5]]: "row right"
|
|
41
40
|
}, cancel && ReactCreateElement(Button, {
|
|
42
41
|
flat: true,
|
|
43
42
|
onClick: onCancel
|
|
@@ -87,14 +86,14 @@ var DialogWrapper = function (_Component) {
|
|
|
87
86
|
orNoop(props().onAccept || onAcceptState())();
|
|
88
87
|
closeRef()();
|
|
89
88
|
};
|
|
90
|
-
that[
|
|
89
|
+
that[ReactConstants[3]] = function () {
|
|
91
90
|
var _props2 = props(),
|
|
92
|
-
top = _props2
|
|
93
|
-
className = _props2[
|
|
91
|
+
top = __top(_props2),
|
|
92
|
+
className = _props2[ReactConstants[5]],
|
|
94
93
|
other = _objectWithoutProperties(_props2, _excluded);
|
|
95
94
|
return ReactCreateElement(Modal, {
|
|
96
95
|
top: top,
|
|
97
|
-
[
|
|
96
|
+
[ReactConstants[5]]: classNames('DialogModal', className),
|
|
98
97
|
open: openRef,
|
|
99
98
|
close: closeRef,
|
|
100
99
|
onClose: onCancel
|
|
@@ -142,7 +141,7 @@ var DialogWrapper = function (_Component) {
|
|
|
142
141
|
}
|
|
143
142
|
openRef()();
|
|
144
143
|
};
|
|
145
|
-
that[
|
|
144
|
+
that[ReactConstants[0]] = function () {
|
|
146
145
|
var _props = props();
|
|
147
146
|
orNoop(_props.open)(that.open);
|
|
148
147
|
orNoop(_props.close)(closeRef());
|
|
@@ -161,7 +160,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
161
160
|
cancel: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
162
161
|
onAccept: PropTypes.func,
|
|
163
162
|
onCancel: PropTypes.func,
|
|
164
|
-
[
|
|
163
|
+
[ReactConstants[5]]: PropTypes.string,
|
|
165
164
|
top: PropTypes.number
|
|
166
165
|
};
|
|
167
166
|
}
|
package/DropFileInput.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import ReactConstants from "./ReactConstants";
|
|
2
|
+
import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, props as __props, scrollLeft as __scrollLeft, scrollTop as __scrollTop, state as __state, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
|
|
1
3
|
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
4
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
5
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
6
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {className as __className} from "./ReactConstants";
|
|
7
|
-
import {children as __children} from "./ReactConstants";
|
|
8
7
|
import ReactCreateElement from './ReactCreateElement.js';
|
|
9
8
|
import Dropzone from './Dropzone.js';
|
|
10
9
|
import PropTypes from 'prop-types';
|
|
@@ -19,14 +18,14 @@ var DropFileInput = function DropFileInput(_ref) {
|
|
|
19
18
|
multiple = _ref.multiple,
|
|
20
19
|
accept = _ref.accept;
|
|
21
20
|
return ReactCreateElement("section", {
|
|
22
|
-
[
|
|
21
|
+
[ReactConstants[5]]: "DropFileInput"
|
|
23
22
|
}, ReactCreateElement(Dropzone, {
|
|
24
23
|
droppable: droppable,
|
|
25
24
|
onDrop: onDrop,
|
|
26
25
|
accept: accept,
|
|
27
26
|
multiple: multiple
|
|
28
27
|
}, ReactCreateElement(MaterialIcon, {
|
|
29
|
-
[
|
|
28
|
+
[ReactConstants[5]]: classNames("icon", label && 'withText'),
|
|
30
29
|
icon: icon
|
|
31
30
|
}), label && ReactCreateElement("div", null, label)));
|
|
32
31
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import ReactConstants from "./ReactConstants";
|
|
2
|
+
import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, props as __props, scrollLeft as __scrollLeft, scrollTop as __scrollTop, state as __state, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields";
|
|
1
3
|
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
4
|
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
4
5
|
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
5
6
|
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {className as __className} from "./ReactConstants";
|
|
7
|
-
import {children as __children} from "./ReactConstants";
|
|
8
7
|
import React, { Component } from 'react';
|
|
9
8
|
import ReactCreateElement from './ReactCreateElement.js';
|
|
10
9
|
import DNDDroppable from './DNDDroppable.js';
|
|
@@ -28,13 +27,13 @@ var DroppableHorizontalList = function (_Component) {
|
|
|
28
27
|
var list;
|
|
29
28
|
var init = function init() {
|
|
30
29
|
list = [];
|
|
31
|
-
React.Children.forEach(props$1()[
|
|
30
|
+
React.Children.forEach(props$1()[ReactConstants[4]], function (child) {
|
|
32
31
|
child && child.type === DNDDraggable && list.push(props(child).id);
|
|
33
32
|
});
|
|
34
33
|
};
|
|
35
34
|
init();
|
|
36
|
-
that[
|
|
37
|
-
if (prevProps[
|
|
35
|
+
that[ReactConstants[2]] = function (prevProps) {
|
|
36
|
+
if (prevProps[ReactConstants[4]] !== props$1()[ReactConstants[4]]) {
|
|
38
37
|
init();
|
|
39
38
|
}
|
|
40
39
|
};
|
|
@@ -42,20 +41,20 @@ var DroppableHorizontalList = function (_Component) {
|
|
|
42
41
|
var dragging;
|
|
43
42
|
var oldIndex;
|
|
44
43
|
var newIndex;
|
|
45
|
-
that[
|
|
44
|
+
that[ReactConstants[0]] = function () {
|
|
46
45
|
var inTransition = false;
|
|
47
46
|
orNoop(props$1().provideDraggableEnhancer)(function (initializer) {
|
|
48
47
|
return function (it) {
|
|
49
48
|
orNoop(initializer)(it);
|
|
50
49
|
it.createPositionListener = function (e, style) {
|
|
51
|
-
var offset = e
|
|
50
|
+
var offset = __pageX(e);
|
|
52
51
|
return function (e) {
|
|
53
|
-
e
|
|
52
|
+
__pageX(e) && (style.transform = 'translateX(' + (__pageX(e) - offset) + 'px)');
|
|
54
53
|
};
|
|
55
54
|
};
|
|
56
55
|
it.initDraggedStyles = NOOP;
|
|
57
56
|
it.onDragEnd = function () {
|
|
58
|
-
var style = it.element
|
|
57
|
+
var style = it.element.style;
|
|
59
58
|
inTransition = true;
|
|
60
59
|
setTimeout(function () {
|
|
61
60
|
var droppingDuration = props$1().droppingDuration || 100;
|
|
@@ -89,16 +88,16 @@ var DroppableHorizontalList = function (_Component) {
|
|
|
89
88
|
});
|
|
90
89
|
};
|
|
91
90
|
var onHover = function onHover(e, draggable) {
|
|
92
|
-
var offset = e
|
|
93
|
-
var transformLeft = 'translateX(' + draggable
|
|
94
|
-
var transformRight = 'translateX(-' + draggable
|
|
91
|
+
var offset = __pageX(e) - that.scrollOffsetX;
|
|
92
|
+
var transformLeft = 'translateX(' + __width(draggable) + 'px)';
|
|
93
|
+
var transformRight = 'translateX(-' + __width(draggable) + 'px)';
|
|
95
94
|
list.forEach(function (id, i) {
|
|
96
95
|
if (i !== oldIndex) {
|
|
97
96
|
var d = draggables[id];
|
|
98
97
|
var bounds = d.bounds;
|
|
99
|
-
var style = d.element
|
|
98
|
+
var style = d.element.style;
|
|
100
99
|
if (i > oldIndex) {
|
|
101
|
-
if (offset >= bounds
|
|
100
|
+
if (offset >= __left(bounds)) style.transform = transformRight;else style.transform = '';
|
|
102
101
|
} else {
|
|
103
102
|
if (offset <= bounds.right) style.transform = transformLeft;else style.transform = '';
|
|
104
103
|
}
|
|
@@ -106,23 +105,23 @@ var DroppableHorizontalList = function (_Component) {
|
|
|
106
105
|
});
|
|
107
106
|
var i = list.findIndex(function (id) {
|
|
108
107
|
var bounds = draggables[id].bounds;
|
|
109
|
-
return offset >= bounds
|
|
108
|
+
return offset >= __left(bounds) && offset <= bounds.right;
|
|
110
109
|
});
|
|
111
|
-
newIndex = i !== -1 ? i : list
|
|
110
|
+
newIndex = i !== -1 ? i : __length(list);
|
|
112
111
|
};
|
|
113
112
|
var onDragStart = function onDragStart(e, draggable) {
|
|
114
113
|
dragging = true;
|
|
115
114
|
dropped = false;
|
|
116
115
|
oldIndex = list.indexOf(props(draggable).id);
|
|
117
|
-
that.scrollOffsetX = e
|
|
116
|
+
that.scrollOffsetX = __pageX(e) - e.clientX;
|
|
118
117
|
list.forEach(function (id) {
|
|
119
|
-
draggables[id].bounds = draggables[id].element
|
|
118
|
+
draggables[id].bounds = draggables[id].element.getBoundingClientRect();
|
|
120
119
|
});
|
|
121
120
|
};
|
|
122
121
|
var reset = function reset(ignoredIndex, transition) {
|
|
123
122
|
list.forEach(function (id, i) {
|
|
124
123
|
if (i !== ignoredIndex) {
|
|
125
|
-
var s = draggables[id].element
|
|
124
|
+
var s = draggables[id].element.style;
|
|
126
125
|
s.transform = '';
|
|
127
126
|
s.transition = transition;
|
|
128
127
|
}
|
|
@@ -145,26 +144,26 @@ var DroppableHorizontalList = function (_Component) {
|
|
|
145
144
|
var onDrop = function onDrop(data) {
|
|
146
145
|
dropped = true;
|
|
147
146
|
var draggable = draggables[list[oldIndex]];
|
|
148
|
-
var style = draggable.element
|
|
149
|
-
var diff = (newIndex - oldIndex) * draggable.bounds
|
|
147
|
+
var style = draggable.element.style;
|
|
148
|
+
var diff = (newIndex - oldIndex) * draggable.bounds.width;
|
|
150
149
|
var transform = style.transform;
|
|
151
|
-
var position = transform.substring(11, transform
|
|
150
|
+
var position = transform.substring(11, __length(transform) - 3);
|
|
152
151
|
style.transform = 'translateX(' + (position - diff) + 'px)';
|
|
153
152
|
orNoop(props$1().onDrop)(data, oldIndex, newIndex);
|
|
154
153
|
reset(newIndex, 'unset');
|
|
155
154
|
};
|
|
156
|
-
that[
|
|
155
|
+
that[ReactConstants[3]] = function () {
|
|
157
156
|
var _props = props$1();
|
|
158
|
-
var className = _props[
|
|
157
|
+
var className = _props[ReactConstants[5]],
|
|
159
158
|
initializer = _props.initializer;
|
|
160
159
|
return ReactCreateElement(DNDDroppable, {
|
|
161
|
-
[
|
|
160
|
+
[ReactConstants[5]]: classNames('DroppableList', className, resetting() && 'resetting'),
|
|
162
161
|
initializer: initializer,
|
|
163
162
|
onHover: onHover,
|
|
164
163
|
onDragStart: onDragStart,
|
|
165
164
|
onDragEnd: onDragEnd,
|
|
166
165
|
onDrop: onDrop
|
|
167
|
-
}, _props[
|
|
166
|
+
}, _props[ReactConstants[4]]);
|
|
168
167
|
};
|
|
169
168
|
return _this;
|
|
170
169
|
}
|