react-ui-basics 0.0.183 → 0.0.185
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 +1 -7
- package/AutocompleteSelect.js +1 -7
- package/Button.js +1 -7
- package/CalendarMonthView.js +1 -7
- package/Checkbox.js +1 -7
- package/CircleProgress.js +1 -7
- package/DNDContainer.js +1 -7
- package/DNDDraggable.js +1 -6
- package/DNDDroppable.js +1 -6
- package/DatePicker.js +1 -7
- package/DateTools.js +0 -2
- package/Dialog.js +1 -7
- package/DropFileInput.js +1 -7
- package/DroppableHorizontalList.js +1 -6
- package/DroppableList.js +1 -7
- package/Dropzone.js +1 -7
- package/FilteredList.js +1 -7
- package/FloatingActionButton.js +1 -7
- package/FormUploadProgress.js +1 -7
- package/HttpTools.d.ts +35 -0
- package/HttpTools.js +220 -0
- package/HttpTools.js.map +1 -0
- package/ImageGallery.js +1 -7
- package/MaterialIcon.js +1 -6
- package/Modal.js +1 -7
- package/ModalMenu.js +1 -7
- package/ReactCreateElement.js +0 -2
- package/ReadyListener.js +1 -6
- package/Scrollable.js +1 -7
- package/ScrollableTable.js +1 -7
- package/Size.js +1 -6
- package/Snackbar.js +1 -7
- package/SpinningProgress.js +1 -7
- package/Switch.js +1 -7
- package/Table.js +1 -7
- package/TextField.js +1 -7
- package/Tools.js +0 -2
- package/_virtual/_commonjsHelpers.js +0 -2
- package/_virtual/_react.js +0 -2
- package/_virtual/react-jsx-runtime.development.js +0 -2
- package/bundle.css +446 -446
- package/index.js +3 -6
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/router/HistoryTools.js +0 -2
- package/router/Link.js +1 -6
- package/router/NavLink.js +1 -6
- package/router/Route.js +1 -6
- package/router/index.js +1 -6
- package/src/Animated.js +1 -7
- package/src/AutocompleteSelect.js +1 -7
- package/src/Button.js +1 -7
- package/src/Checkbox.js +1 -7
- package/src/CircleProgress.js +1 -7
- package/src/DNDDraggable.js +1 -6
- package/src/DNDDroppable.js +1 -6
- package/src/Dialog.js +1 -7
- package/src/DropFileInput.js +1 -7
- package/src/DroppableHorizontalList.js +1 -6
- package/src/DroppableList.js +1 -7
- package/src/Dropzone.js +1 -7
- package/src/FilteredList.js +1 -7
- package/src/FloatingActionButton.js +1 -7
- package/src/FormUploadProgress.js +1 -7
- package/src/HttpTools.ts +257 -0
- package/src/ImageGallery.js +1 -7
- package/src/MaterialIcon.js +1 -6
- package/src/Modal.js +1 -7
- package/src/ModalMenu.js +1 -7
- package/src/ReactCreateElement.js +0 -2
- package/src/ReadyListener.js +1 -6
- package/src/Scrollable.js +1 -7
- package/src/Size.js +1 -6
- package/src/Snackbar.js +1 -7
- package/src/SpinningProgress.js +1 -7
- package/src/Switch.js +1 -7
- package/src/TextField.js +1 -7
- package/src/Tools.test.js +0 -2
- package/src/index.js +3 -6
- package/src/router/HistoryTools.js +0 -2
- package/src/router/Link.js +1 -6
- package/src/router/NavLink.js +1 -6
- package/src/router/Route.js +1 -6
- package/src/router/Route.test.js +1 -6
- package/src/router/index.js +1 -6
- package/src/store/ProxyTools.js +0 -2
- package/src/store/ProxyTools.test.js +0 -2
- package/store/ProxyTools.js +1 -6
- package/store/Store.js +1 -6
package/index.js
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
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";
|
|
3
1
|
export { default as Animated } from './Animated.js';
|
|
4
2
|
export { default as AutocompleteSelect } from './AutocompleteSelect.js';
|
|
5
3
|
export { default as Button } from './Button.js';
|
|
6
4
|
export { default as CalendarMonthView } from './CalendarMonthView.js';
|
|
7
5
|
export { default as Checkbox } from './Checkbox.js';
|
|
8
6
|
export { default as CircleProgress } from './CircleProgress.js';
|
|
9
|
-
import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers";
|
|
10
|
-
import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers";
|
|
11
|
-
import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers";
|
|
12
|
-
import * as CommonFields from './CommonFields.js';
|
|
7
|
+
import ReactConstants from "./ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers"; import * as CommonFields from './CommonFields.js';
|
|
13
8
|
export { CommonFields };
|
|
14
9
|
export { default as DatePicker } from './DatePicker.js';
|
|
15
10
|
import * as DateTools from './DateTools.js';
|
|
@@ -23,6 +18,8 @@ export { default as Dropzone } from './Dropzone.js';
|
|
|
23
18
|
export { default as FilteredList } from './FilteredList.js';
|
|
24
19
|
export { default as FloatingActionButton } from './FloatingActionButton.js';
|
|
25
20
|
export { default as FormUploadProgress } from './FormUploadProgress.js';
|
|
21
|
+
import * as HttpTools from './HttpTools.js';
|
|
22
|
+
export { HttpTools };
|
|
26
23
|
export { default as ImageGallery, ImageGalleryContainer } from './ImageGallery.js';
|
|
27
24
|
export { default as MaterialIcon } from './MaterialIcon.js';
|
|
28
25
|
export { default as Modal } from './Modal.js';
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
package/router/HistoryTools.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
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";
|
|
3
1
|
import { WINDOW, DOCUMENT } from '../Tools.js';
|
|
4
2
|
|
|
5
3
|
var history = WINDOW.history;
|
package/router/Link.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
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";
|
|
3
1
|
import 'react';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import ReactCreateElement from '../ReactCreateElement.js';
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import ReactCreateElement from '../ReactCreateElement.js';
|
|
8
3
|
import PropTypes from 'prop-types';
|
|
9
4
|
import { pushLocation } from './HistoryTools.js';
|
|
10
5
|
import { preventDefault } from '../Tools.js';
|
package/router/NavLink.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
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";
|
|
3
1
|
import 'react';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import ReactCreateElement from '../ReactCreateElement.js';
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import ReactCreateElement from '../ReactCreateElement.js';
|
|
8
3
|
import 'prop-types';
|
|
9
4
|
import Route from './Route.js';
|
|
10
5
|
import Link from './Link.js';
|
package/router/Route.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
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";
|
|
3
1
|
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, slicedToArray as _slicedToArray, createClass as _createClass } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import React from 'react';
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import React from 'react';
|
|
8
3
|
import PropTypes from 'prop-types';
|
|
9
4
|
import { setOf, allPropsExcept, isDifferent, addEventListener, WINDOW, removeEventListener, orNoop } from '../Tools.js';
|
|
10
5
|
import { stateGSs, componentDidUpdate, render, componentDidMount, componentWillUnmount, propsGetter, setState, PureComponent } from '../ReactConstants.js';
|
package/router/index.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
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";
|
|
3
1
|
import Link from './Link.js';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import NavLink from './NavLink.js';
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import NavLink from './NavLink.js';
|
|
8
3
|
import Route from './Route.js';
|
|
9
4
|
|
|
10
5
|
var index = {
|
package/src/Animated.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
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";
|
|
3
1
|
import React from 'react';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import './Animated.css';
|
|
8
|
-
import ReactCreateElement from './ReactCreateElement';
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import './Animated.css'; import ReactCreateElement from './ReactCreateElement';
|
|
9
3
|
import PropTypes from 'prop-types';
|
|
10
4
|
import './Animated.css'
|
|
11
5
|
import {allPropsExcept, classNames, setOf, setTimeout, requestAnimationFrame, clearTimeout} from "./Tools";
|
|
@@ -1,11 +1,5 @@
|
|
|
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";
|
|
3
1
|
import React from 'react';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import './AutocompleteSelect.css';
|
|
8
|
-
import ReactCreateElement from './ReactCreateElement';
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import './AutocompleteSelect.css'; import ReactCreateElement from './ReactCreateElement';
|
|
9
3
|
import PropTypes from 'prop-types';
|
|
10
4
|
import './AutocompleteSelect.css'
|
|
11
5
|
import TextField from "./TextField";
|
package/src/Button.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
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";
|
|
3
1
|
import React from 'react';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import './Button.css';
|
|
8
|
-
import ReactCreateElement from './ReactCreateElement';
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import './Button.css'; import ReactCreateElement from './ReactCreateElement';
|
|
9
3
|
import './Button.css'
|
|
10
4
|
import {classNames, DOCUMENT, addEventListener, createRef, orNoop} from "./Tools";
|
|
11
5
|
import PropTypes from "prop-types";
|
package/src/Checkbox.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
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";
|
|
3
1
|
import React from 'react';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import './Checkbox.css';
|
|
8
|
-
import ReactCreateElement from './ReactCreateElement';
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import './Checkbox.css'; import ReactCreateElement from './ReactCreateElement';
|
|
9
3
|
import './Checkbox.css'
|
|
10
4
|
import {classNames, getRandomId} from "./Tools";
|
|
11
5
|
import {PureComponent, render, propsGetter} from "./ReactConstants";
|
package/src/CircleProgress.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
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";
|
|
3
1
|
import React from 'react';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import './CircleProgress.css';
|
|
8
|
-
import ReactCreateElement from './ReactCreateElement';
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import './CircleProgress.css'; import ReactCreateElement from './ReactCreateElement';
|
|
9
3
|
import PropTypes from "prop-types";
|
|
10
4
|
import './CircleProgress.css'
|
|
11
5
|
|
package/src/DNDDraggable.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
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";
|
|
3
1
|
import React from 'react';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import ReactCreateElement from './ReactCreateElement';
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import ReactCreateElement from './ReactCreateElement';
|
|
8
3
|
import {classNames, orNoop, ref} from "./Tools";
|
|
9
4
|
import {componentDidUpdate, props, state, render, children, className, componentDidMount, componentWillUnmount, PureComponent} from "./ReactConstants";
|
|
10
5
|
|
package/src/DNDDroppable.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
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";
|
|
3
1
|
import React from 'react';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import ReactCreateElement from './ReactCreateElement';
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import ReactCreateElement from './ReactCreateElement';
|
|
8
3
|
import {classNames, orNoop, ref, preventDefault, stopPropagation} from "./Tools";
|
|
9
4
|
import {componentDidMount, componentDidUpdate, render, props, state, componentWillUnmount, children, className, PureComponent} from "./ReactConstants";
|
|
10
5
|
|
package/src/Dialog.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
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";
|
|
3
1
|
import React, {Component} from 'react';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import './Dialog.css';
|
|
8
|
-
import ReactCreateElement from './ReactCreateElement';
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import './Dialog.css'; import ReactCreateElement from './ReactCreateElement';
|
|
9
3
|
import './Dialog.css'
|
|
10
4
|
import Button from "./Button";
|
|
11
5
|
import Modal from "./Modal";
|
package/src/DropFileInput.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
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";
|
|
3
1
|
import React from 'react';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import './DropFileInput.css';
|
|
8
|
-
import ReactCreateElement from './ReactCreateElement';
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import './DropFileInput.css'; import ReactCreateElement from './ReactCreateElement';
|
|
9
3
|
import './DropFileInput.css'
|
|
10
4
|
import Dropzone from "./Dropzone";
|
|
11
5
|
import PropTypes from "prop-types";
|
|
@@ -1,10 +1,5 @@
|
|
|
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";
|
|
3
1
|
import React, {Component} from 'react';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import ReactCreateElement from './ReactCreateElement';
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import ReactCreateElement from './ReactCreateElement';
|
|
8
3
|
import './DroppableList.css'
|
|
9
4
|
import DNDDroppable from "./DNDDroppable";
|
|
10
5
|
import {classNames, orNoop, setTimeout, NOOP} from "./Tools";
|
package/src/DroppableList.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
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";
|
|
3
1
|
import React, {Component} from 'react';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import './DroppableList.css';
|
|
8
|
-
import ReactCreateElement from './ReactCreateElement';
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import './DroppableList.css'; import ReactCreateElement from './ReactCreateElement';
|
|
9
3
|
import './DroppableList.css'
|
|
10
4
|
import DNDDroppable from "./DNDDroppable";
|
|
11
5
|
import {classNames, orNoop, setTimeout, NOOP} from "./Tools";
|
package/src/Dropzone.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
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";
|
|
3
1
|
import React from 'react';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import './Dropzone.css';
|
|
8
|
-
import PropTypes from "prop-types";
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import './Dropzone.css'; import PropTypes from "prop-types";
|
|
9
3
|
import ReactCreateElement from './ReactCreateElement';
|
|
10
4
|
import './Dropzone.css'
|
|
11
5
|
import {classNames, setOf, preventDefault, stopPropagation, UNDEFINED, createRef} from "./Tools";
|
package/src/FilteredList.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
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";
|
|
3
1
|
import React from 'react';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import './FilteredList.css';
|
|
8
|
-
import ReactCreateElement from './ReactCreateElement';
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import './FilteredList.css'; import ReactCreateElement from './ReactCreateElement';
|
|
9
3
|
import './FilteredList.css'
|
|
10
4
|
import Scrollable from "./Scrollable";
|
|
11
5
|
import {classNames, orNoop, ref, stopPropagation, isFunction, isObject} from "./Tools";
|
|
@@ -1,11 +1,5 @@
|
|
|
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";
|
|
3
1
|
import React from 'react';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import './FloatingActionButton.css';
|
|
8
|
-
import ReactCreateElement from './ReactCreateElement';
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import './FloatingActionButton.css'; import ReactCreateElement from './ReactCreateElement';
|
|
9
3
|
import PropTypes from 'prop-types';
|
|
10
4
|
import './FloatingActionButton.css'
|
|
11
5
|
import Button from "./Button";
|
|
@@ -1,11 +1,5 @@
|
|
|
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";
|
|
3
1
|
import React from 'react';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import './FormUploadProgress.css';
|
|
8
|
-
import ReactCreateElement from './ReactCreateElement';
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import './FormUploadProgress.css'; import ReactCreateElement from './ReactCreateElement';
|
|
9
3
|
import './FormUploadProgress.css'
|
|
10
4
|
import Button from "./Button";
|
|
11
5
|
import Animated from "./Animated";
|
package/src/HttpTools.ts
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import {orNoop} from "./Tools";
|
|
2
|
+
|
|
3
|
+
const CONTENT_TYPE_APPLICATION_JSON = 'application/json';
|
|
4
|
+
|
|
5
|
+
const toKeyValue = (key, value) => key && (encodeURIComponent(key) + '=' + encodeURIComponent(value !== null && typeof value === 'object' ? JSON.stringify(value) : value));
|
|
6
|
+
|
|
7
|
+
export const toRequestParams = (params) => (params && Object.keys(params).map(key => {
|
|
8
|
+
const value = params[key];
|
|
9
|
+
if (Array.isArray(value))
|
|
10
|
+
return value.map(it => toKeyValue(key, it)).join('&')
|
|
11
|
+
else
|
|
12
|
+
return toKeyValue(key, value);
|
|
13
|
+
}).join('&')) || '';
|
|
14
|
+
|
|
15
|
+
export type Method = 'GET' | 'DELETE' | 'POST' | 'PUT'
|
|
16
|
+
|
|
17
|
+
export class FetchOptions {
|
|
18
|
+
method?: Method = 'GET'
|
|
19
|
+
headers?: ({ [name: string]: string })
|
|
20
|
+
params?: ({ [name: string]: any }) | FormData | Blob
|
|
21
|
+
multipart?: boolean = false
|
|
22
|
+
async?: boolean = true
|
|
23
|
+
withCredentials?: boolean = true
|
|
24
|
+
timeout?: number
|
|
25
|
+
onTimeout?: ((ev: ProgressEvent) => any)
|
|
26
|
+
onSuccess?: ((t: any) => void)
|
|
27
|
+
onError?: ((e: any, status: number) => void)
|
|
28
|
+
onProgress?: ((ev: ProgressEvent) => any)
|
|
29
|
+
provideCancel?: ((cancelFunction: () => void) => void)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const DEFAULT_OPTIONS = new FetchOptions()
|
|
33
|
+
|
|
34
|
+
export const fetch = <T>(url, options: FetchOptions = DEFAULT_OPTIONS) => {
|
|
35
|
+
const method = options.method || 'GET'
|
|
36
|
+
const params = options.params || {};
|
|
37
|
+
if (method === 'GET' || method === 'DELETE') {
|
|
38
|
+
const serializedData = toRequestParams(params);
|
|
39
|
+
if (serializedData)
|
|
40
|
+
url = url + "?" + serializedData;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const headers = {
|
|
44
|
+
'Accept': CONTENT_TYPE_APPLICATION_JSON,
|
|
45
|
+
...(options.headers || {})
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
let body: FormData | string | Blob
|
|
49
|
+
|
|
50
|
+
if (method === 'POST' || method === 'PUT') {
|
|
51
|
+
if (options.multipart) {
|
|
52
|
+
let formData;
|
|
53
|
+
if (params instanceof FormData) {
|
|
54
|
+
formData = params;
|
|
55
|
+
} else {
|
|
56
|
+
formData = new FormData();
|
|
57
|
+
Object.keys(params).forEach(name => {
|
|
58
|
+
let value = params[name];
|
|
59
|
+
if (Array.isArray(value)) {
|
|
60
|
+
value.forEach(it => formData.append(name, it))
|
|
61
|
+
} else if (value != null)
|
|
62
|
+
formData.append(name, value);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
body = formData;
|
|
66
|
+
} else if (params instanceof Blob || params instanceof FormData) {
|
|
67
|
+
body = params;
|
|
68
|
+
} else {
|
|
69
|
+
headers['Content-Type'] = CONTENT_TYPE_APPLICATION_JSON;
|
|
70
|
+
body = JSON.stringify(params || {}, (key, value) => {
|
|
71
|
+
if (value !== null)
|
|
72
|
+
return value
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
let makeRequest = (success, error) => {
|
|
78
|
+
const request = new XMLHttpRequest();
|
|
79
|
+
|
|
80
|
+
const data = body;
|
|
81
|
+
|
|
82
|
+
if (!!(options.withCredentials === void 0 ? true : options.withCredentials))
|
|
83
|
+
request.withCredentials = true;
|
|
84
|
+
|
|
85
|
+
const async = !!(options.async === void 0 ? true : options.async);
|
|
86
|
+
request.open(method, url, async);
|
|
87
|
+
|
|
88
|
+
Object.keys(headers).forEach(key =>
|
|
89
|
+
request.setRequestHeader(key, headers[key])
|
|
90
|
+
);
|
|
91
|
+
const onError = orNoop(error);
|
|
92
|
+
|
|
93
|
+
if (options.timeout && async) {
|
|
94
|
+
request.timeout = options.timeout;
|
|
95
|
+
request.ontimeout = (e) => (options.onTimeout || onError)(e);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const onProgress = options.onProgress;
|
|
99
|
+
if (onProgress) {
|
|
100
|
+
request.upload.onprogress = e => {
|
|
101
|
+
if (e.lengthComputable)
|
|
102
|
+
onProgress(e);
|
|
103
|
+
};
|
|
104
|
+
request.onprogress = onProgress;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
request.onload = () => {
|
|
108
|
+
const responseText = request.responseText;
|
|
109
|
+
const status = request.status;
|
|
110
|
+
if (status >= 200 && status < 400) {
|
|
111
|
+
try {
|
|
112
|
+
orNoop(success)(JSON.parse(responseText || "{}"));
|
|
113
|
+
} catch (e) {
|
|
114
|
+
const message = `Unexpected exception while processing response for ${method} ${url}, status: ${status}, response: '${responseText}', exception:`;
|
|
115
|
+
console.log(message, e)
|
|
116
|
+
onError(new FetchError(message, status, responseText))
|
|
117
|
+
}
|
|
118
|
+
} else {
|
|
119
|
+
const message = `Not ok response for ${method} ${url}, status: ${status}, response: '${responseText}'`;
|
|
120
|
+
console.log(message);
|
|
121
|
+
onError(new FetchError(message, status, responseText))
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
request.onerror = onError;
|
|
126
|
+
|
|
127
|
+
try {
|
|
128
|
+
if (method === 'POST') {
|
|
129
|
+
if (typeof data === 'string' || data instanceof Blob || data instanceof FormData)
|
|
130
|
+
request.send(data);
|
|
131
|
+
else
|
|
132
|
+
request.send(toRequestParams(data));
|
|
133
|
+
} else
|
|
134
|
+
request.send();
|
|
135
|
+
} catch (e) {
|
|
136
|
+
onError(e);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (options.provideCancel) {
|
|
140
|
+
options.provideCancel(() => request.abort());
|
|
141
|
+
}
|
|
142
|
+
return request
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
// if (!window.Promise)
|
|
146
|
+
// return makeRequest(options.onSuccess, options.onError);
|
|
147
|
+
|
|
148
|
+
return new Promise<T>((resolve, reject) => {
|
|
149
|
+
const success = data => (options.onSuccess || resolve)(data);
|
|
150
|
+
const error = (e, status) => (options.onError || reject)(e, status);
|
|
151
|
+
makeRequest(success, error);
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
class FetchError extends Error {
|
|
156
|
+
status: number;
|
|
157
|
+
responseText?: string;
|
|
158
|
+
|
|
159
|
+
constructor(message, status: number, responseText?: string) {
|
|
160
|
+
super(message);
|
|
161
|
+
this.status = status;
|
|
162
|
+
this.responseText = responseText;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
export type Params = { [id: string]: any };
|
|
168
|
+
export type UrlRenderer = (params: Params) => string;
|
|
169
|
+
|
|
170
|
+
const variablePatter = /\{(\w+)\}/g;
|
|
171
|
+
export const createUrlRenderer = (template: string, deleteVars: boolean = false): UrlRenderer => {
|
|
172
|
+
let parts = [];
|
|
173
|
+
let variables = [];
|
|
174
|
+
|
|
175
|
+
let find;
|
|
176
|
+
let prevIndex = 0;
|
|
177
|
+
while ((find = variablePatter.exec(template)) !== null) {
|
|
178
|
+
variables.push(find[1]);
|
|
179
|
+
parts.push(template.substring(prevIndex, find.index));
|
|
180
|
+
prevIndex = find.index + find[0].length;
|
|
181
|
+
}
|
|
182
|
+
if (prevIndex === 0)
|
|
183
|
+
return () => template;
|
|
184
|
+
|
|
185
|
+
parts.push(template.substring(prevIndex, template.length));
|
|
186
|
+
|
|
187
|
+
const m = parts;
|
|
188
|
+
const v = variables;
|
|
189
|
+
return function (params: any) {
|
|
190
|
+
const length = Math.max(m.length, v.length);
|
|
191
|
+
let s = '';
|
|
192
|
+
for (let i = 0; i < length; i++) {
|
|
193
|
+
if (m[i] !== null)
|
|
194
|
+
s += m[i];
|
|
195
|
+
let param = params[v[i]];
|
|
196
|
+
if (params && v[i] !== null && param != null) {
|
|
197
|
+
s += encodeURIComponent(param);
|
|
198
|
+
if (deleteVars)
|
|
199
|
+
delete params[v[i]]
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return s;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const lazy = <T extends Function>(f: ((...any) => T), ...args): any => {
|
|
207
|
+
let result: T;
|
|
208
|
+
return function (): any {
|
|
209
|
+
if (!result)
|
|
210
|
+
result = f.apply(null, args) as T
|
|
211
|
+
|
|
212
|
+
return result.apply(null, arguments)
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
let baseurl = window.location.origin
|
|
217
|
+
export const setBaseUrl = url => baseurl = url
|
|
218
|
+
|
|
219
|
+
export const createGET = <R>(template: string) => {
|
|
220
|
+
let urlMaker: (UrlRenderer) = lazy(createUrlRenderer, template, true);
|
|
221
|
+
return async (params?: Params,) => fetch<R>(`${baseurl}${urlMaker(params)}`, {params});
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
export const createPOST = <R, P extends Params>(template: string) => {
|
|
226
|
+
let urlMaker: (UrlRenderer) = lazy(createUrlRenderer, template);
|
|
227
|
+
return async (params?: P,) => fetch<R>(`${baseurl}${urlMaker(params)}`, {params, method: "POST"});
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
const createBinaryPOST = <R>(template: string) => {
|
|
231
|
+
let urlMaker: (UrlRenderer) = lazy(createUrlRenderer, template, true);
|
|
232
|
+
return async (pathVariables: Params, options: FetchOptions) => {
|
|
233
|
+
let url = `${baseurl}${urlMaker(pathVariables)}`;
|
|
234
|
+
if (Object.keys(pathVariables).length > 0) {
|
|
235
|
+
url += '?' + toRequestParams(pathVariables)
|
|
236
|
+
}
|
|
237
|
+
return fetch<R>(url, options);
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
export const createDELETE = <R>(template: string) => {
|
|
242
|
+
let urlMaker: (UrlRenderer) = lazy(createUrlRenderer, template, true);
|
|
243
|
+
return async (params?: Params,) => fetch<R>(`${baseurl}${urlMaker(params)}`, {params, method: "DELETE"});
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
export interface MultipartOptions {
|
|
247
|
+
onProgress?: ((ev: ProgressEvent) => any)
|
|
248
|
+
provideCancel?: ((cancelFunction: () => void) => void)
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export const createMultipart = <R>(template: string) => {
|
|
252
|
+
let urlMaker: (UrlRenderer) = lazy(createUrlRenderer, template);
|
|
253
|
+
return async (params: any, options?: MultipartOptions) => {
|
|
254
|
+
let url = `${baseurl}${urlMaker(params)}`;
|
|
255
|
+
return fetch<R>(url, {params, method: "POST", multipart: true, ...options});
|
|
256
|
+
};
|
|
257
|
+
};
|
package/src/ImageGallery.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
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";
|
|
3
1
|
import React from 'react';
|
|
4
|
-
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
-
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
-
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
-
import './ImageGallery.css';
|
|
8
|
-
import ReactCreateElement from './ReactCreateElement';
|
|
2
|
+
import ReactConstants from "./../ReactConstants"; 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"; import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers"; import './ImageGallery.css'; import ReactCreateElement from './ReactCreateElement';
|
|
9
3
|
import './ImageGallery.css'
|
|
10
4
|
import Animated from "./Animated";
|
|
11
5
|
import Button from "./Button";
|