@steroidsjs/core 2.2.60 → 2.2.63
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/hoc/file.d.ts +1 -1
- package/hooks/useFile.js +6 -1
- package/package.json +1 -1
- package/ui/modal/Modal/Modal.d.ts +6 -2
- package/ui/modal/Modal/Modal.js +5 -0
package/hoc/file.d.ts
CHANGED
package/hooks/useFile.js
CHANGED
|
@@ -39,7 +39,12 @@ function generateBackendUrl(props) {
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
function useFile(props) {
|
|
42
|
-
var
|
|
42
|
+
var http = index_1.useComponents().http;
|
|
43
|
+
http.getAccessToken(); // TODO Run promise..
|
|
44
|
+
var uploader = useInitial_1["default"](function () {
|
|
45
|
+
var _a;
|
|
46
|
+
return new fileup_core_1["default"](__assign(__assign({ dropArea: {}, backendUrl: generateBackendUrl(props), uploaderConfig: __assign(__assign({}, props.uploaderConfig), { headers: __assign(__assign({}, (_a = props.uploaderConfig) === null || _a === void 0 ? void 0 : _a.headers), { Authorization: 'Bearer ' + http._accessToken }) }) }, props.uploader), { form: __assign(__assign({}, (props.uploader && props.uploader.form)), { multiple: props.multiple }) }));
|
|
47
|
+
});
|
|
43
48
|
/**
|
|
44
49
|
* Force component update when file status or progress changes
|
|
45
50
|
* @private
|
package/package.json
CHANGED
|
@@ -25,12 +25,16 @@ export interface IModalProps {
|
|
|
25
25
|
*/
|
|
26
26
|
controls?: IControlItem[];
|
|
27
27
|
/**
|
|
28
|
-
* Время,
|
|
29
|
-
* В этот отрезок времени должны происходить все анимации закрытия компонента.
|
|
28
|
+
* Время, в течение которого будет происходить анимация закрытия Modal.
|
|
30
29
|
* Переопределяет отрезок времени, заданный в ModalPortal
|
|
31
30
|
* @example 300
|
|
32
31
|
*/
|
|
33
32
|
closeTimeoutMs?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Время в миллисекундах, через которое автоматически произойдет закрытие Modal.
|
|
35
|
+
* @example 1000
|
|
36
|
+
*/
|
|
37
|
+
closeAfterMs?: number;
|
|
34
38
|
/**
|
|
35
39
|
* Группа Modal
|
|
36
40
|
* @example 'modal'
|
package/ui/modal/Modal/Modal.js
CHANGED
|
@@ -36,6 +36,11 @@ function Modal(props) {
|
|
|
36
36
|
var components = hooks_1.useComponents();
|
|
37
37
|
var ModalView = props.view || components.ui.getView('modal.ModalView');
|
|
38
38
|
var ContentComponent = props.component;
|
|
39
|
+
React.useEffect(function () {
|
|
40
|
+
if (props.closeAfterMs) {
|
|
41
|
+
setTimeout(function () { return props.onClose(); }, props.closeAfterMs);
|
|
42
|
+
}
|
|
43
|
+
}, []);
|
|
39
44
|
return (React.createElement(ModalView, __assign({}, props), (ContentComponent && (React.createElement(ContentComponent, __assign({}, props, props.componentProps)))) || (props.children)));
|
|
40
45
|
}
|
|
41
46
|
Modal.defaultProps = {
|