@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 CHANGED
@@ -15,7 +15,7 @@ export interface IFileHocInput {
15
15
  uploaderConfig?: {
16
16
  useFormData?: boolean;
17
17
  fileFieldName?: string;
18
- };
18
+ } | any;
19
19
  }
20
20
  export interface IFileHocOutput {
21
21
  uploader?: any;
package/hooks/useFile.js CHANGED
@@ -39,7 +39,12 @@ function generateBackendUrl(props) {
39
39
  });
40
40
  }
41
41
  function useFile(props) {
42
- var uploader = useInitial_1["default"](function () { return new fileup_core_1["default"](__assign(__assign({ dropArea: {}, backendUrl: generateBackendUrl(props), uploaderConfig: __assign({}, props.uploaderConfig) }, props.uploader), { form: __assign(__assign({}, (props.uploader && props.uploader.form)), { multiple: props.multiple }) })); });
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/core",
3
- "version": "2.2.60",
3
+ "version": "2.2.63",
4
4
  "description": "",
5
5
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
6
6
  "repository": {
@@ -25,12 +25,16 @@ export interface IModalProps {
25
25
  */
26
26
  controls?: IControlItem[];
27
27
  /**
28
- * Время, через которое произойдет закрытие Modal.
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'
@@ -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 = {