@dreamcommerce/aurora 2.6.0-6 → 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.
@@ -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
  };
@@ -177,7 +177,7 @@ export interface IControlXhrImagePicker extends IFilePicker, IControlCommonProps
177
177
  isRequired?: boolean;
178
178
  onChange?: (fileList: FileList | null, size?: TImageSize) => void;
179
179
  labelAdditionalInfo?: string | ReactNode;
180
- onUploaded?: (resp: IRequestResponse<any>, file: File) => void;
180
+ onUploaded?: (resp: IRequestResponse<any>, file: File, size: TImageSize) => void;
181
181
  }
182
182
  export interface ICellSelector {
183
183
  rows?: number;
@@ -4,8 +4,8 @@ export declare type TImagePickerFile = {
4
4
  fileUrl: string;
5
5
  fileName: string;
6
6
  };
7
- export interface IImagePicker extends IFilePicker {
8
- onChange?: (fileList: FileList | null, size?: TImageSize) => void;
7
+ export interface IImagePicker extends Omit<IFilePicker, 'onChange'> {
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
  };
@@ -1,7 +1,7 @@
1
- import { IImagePicker } from "../image_picker/types";
1
+ 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) => void;
5
+ onUploaded?: (resp: IRequestResponse<any>, file: File, imageSize: TImageSize) => void;
6
6
  onUploadError?: Function;
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/components/xhr_image_picker/types.ts"],"names":[],"mappings":"AAAA,OAA6B,sCAAsC,CAAC;AACpE,OAAiC,0BAA0B,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/components/xhr_image_picker/types.ts"],"names":[],"mappings":"AAAA,OAAyC,sCAAsC,CAAC;AAChF,OAAiC,0BAA0B,CAAC"}
@@ -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 };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@dreamcommerce/aurora",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "2.6.0-6",
5
+ "version": "2.6.0-9",
6
6
  "description": "aurora",
7
7
  "author": "k0ssak",
8
8
  "license": "MIT",