@dreamcommerce/aurora 2.6.0-8 → 2.6.0-9
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/build/cjs/packages/aurora/src/components/xhr_image_picker/index.js +2 -2
- package/build/esm/packages/aurora/src/components/image_picker/types.d.ts +1 -1
- package/build/esm/packages/aurora/src/components/xhr_image_picker/index.js +2 -2
- package/build/esm/packages/aurora/src/components/xhr_image_picker/types.d.ts +1 -1
- package/build/esm/packages/aurora/src/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -14,14 +14,14 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
14
14
|
|
|
15
15
|
const XhrImagePicker = ({ id, url, name, onUploaded, initialFile, errors, allowedExtensions = [constants.FILES_EXTENSIONS.WEBP, constants.FILES_EXTENSIONS.JPG, constants.FILES_EXTENSIONS.PNG, constants.FILES_EXTENSIONS.GIF, constants.FILES_EXTENSIONS.SVG] }) => {
|
|
16
16
|
const httpApi = use_http_api.useHttpApi();
|
|
17
|
-
const onChange = async (fileList,
|
|
17
|
+
const onChange = async (fileList, imageSize) => {
|
|
18
18
|
const { response } = httpApi.fetch({
|
|
19
19
|
url,
|
|
20
20
|
method: http_requester_contants.REQUEST_TYPES.post,
|
|
21
21
|
data: fileList[0]
|
|
22
22
|
});
|
|
23
23
|
const data = await response;
|
|
24
|
-
onUploaded === null || onUploaded === void 0 ? void 0 : onUploaded(data, fileList[0],
|
|
24
|
+
onUploaded === null || onUploaded === void 0 ? void 0 : onUploaded(data, fileList[0], imageSize);
|
|
25
25
|
};
|
|
26
26
|
return (React__default['default'].createElement(index['default'], { id: id, name: name, onChange: onChange, errors: errors, allowedExtensions: allowedExtensions, initialFile: initialFile }));
|
|
27
27
|
};
|
|
@@ -5,7 +5,7 @@ export declare type TImagePickerFile = {
|
|
|
5
5
|
fileName: string;
|
|
6
6
|
};
|
|
7
7
|
export interface IImagePicker extends Omit<IFilePicker, 'onChange'> {
|
|
8
|
-
onChange?: (fileList: FileList | null,
|
|
8
|
+
onChange?: (fileList: FileList | null, imageSize?: TImageSize) => void;
|
|
9
9
|
}
|
|
10
10
|
export interface ISelectedImagePreview {
|
|
11
11
|
file: TImagePickerFile;
|
|
@@ -6,14 +6,14 @@ import { useHttpApi } from '../../hooks/use_http_api.js';
|
|
|
6
6
|
|
|
7
7
|
const XhrImagePicker = ({ id, url, name, onUploaded, initialFile, errors, allowedExtensions = [FILES_EXTENSIONS.WEBP, FILES_EXTENSIONS.JPG, FILES_EXTENSIONS.PNG, FILES_EXTENSIONS.GIF, FILES_EXTENSIONS.SVG] }) => {
|
|
8
8
|
const httpApi = useHttpApi();
|
|
9
|
-
const onChange = async (fileList,
|
|
9
|
+
const onChange = async (fileList, imageSize) => {
|
|
10
10
|
const { response } = httpApi.fetch({
|
|
11
11
|
url,
|
|
12
12
|
method: REQUEST_TYPES.post,
|
|
13
13
|
data: fileList[0]
|
|
14
14
|
});
|
|
15
15
|
const data = await response;
|
|
16
|
-
onUploaded === null || onUploaded === void 0 ? void 0 : onUploaded(data, fileList[0],
|
|
16
|
+
onUploaded === null || onUploaded === void 0 ? void 0 : onUploaded(data, fileList[0], imageSize);
|
|
17
17
|
};
|
|
18
18
|
return (React.createElement(ImagePicker, { id: id, name: name, onChange: onChange, errors: errors, allowedExtensions: allowedExtensions, initialFile: initialFile }));
|
|
19
19
|
};
|
|
@@ -2,6 +2,6 @@ import { IImagePicker, TImageSize } from "../image_picker/types";
|
|
|
2
2
|
import { IRequestResponse } from '@dreamcommerce/star_core';
|
|
3
3
|
export interface IXhrImagePickerProps extends IImagePicker {
|
|
4
4
|
url: string;
|
|
5
|
-
onUploaded?: (resp: IRequestResponse<any>, file: File,
|
|
5
|
+
onUploaded?: (resp: IRequestResponse<any>, file: File, imageSize: TImageSize) => void;
|
|
6
6
|
onUploadError?: Function;
|
|
7
7
|
}
|
|
@@ -84,7 +84,7 @@ import SlideWrapper from "./components/slide/components/slide_wrapper";
|
|
|
84
84
|
import Spacing from "./components/spacing";
|
|
85
85
|
import Stack from "./components/stack";
|
|
86
86
|
import { TFilePickerFile } from "./components/file_picker/types";
|
|
87
|
-
import { TImagePickerFile } from "./components/image_picker/types";
|
|
87
|
+
import { TImagePickerFile, TImageSize } from "./components/image_picker/types";
|
|
88
88
|
import { TMessageBoxType } from "./components/message-box/types";
|
|
89
89
|
import Table from "./components/table";
|
|
90
90
|
import Tabs from "./components/tabs/components/tabs";
|
|
@@ -113,4 +113,4 @@ export { Accordion, Button, Tooltip, ButtonsGroup, Dropdown, Select, MultiSelect
|
|
|
113
113
|
/**
|
|
114
114
|
* export types
|
|
115
115
|
*/
|
|
116
|
-
export type { IDropdownProps, ISelectOption, IHeadingProps, ICellProps, IIRowProps, ITableProps, IDropdownContext, IControlRadioGroupOption, IColor, IDatepickerRange, TFilePickerFile, TImagePickerFile, TMessageBoxType, ILoaderProps, IWithLoader, TFlashMessage, TFlashMessageExtended };
|
|
116
|
+
export type { IDropdownProps, ISelectOption, IHeadingProps, ICellProps, IIRowProps, ITableProps, IDropdownContext, IControlRadioGroupOption, IColor, IDatepickerRange, TFilePickerFile, TImagePickerFile, TMessageBoxType, ILoaderProps, IWithLoader, TFlashMessage, TFlashMessageExtended, TImageSize };
|