@inntechcorp/it-design 3.1.6 → 3.1.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/dist/cropper/index.d.ts +6 -0
- package/dist/index.cjs.js +4 -4
- package/dist/index.d.mts +9 -1
- package/dist/index.d.ts +44 -15
- package/dist/index.esm.js +24 -24
- package/dist/stories/Upload.stories.d.ts +2 -0
- package/dist/types/UploadProps.d.ts +37 -14
- package/package.json +1 -1
|
@@ -16,7 +16,9 @@ type Story = StoryObj<typeof meta>;
|
|
|
16
16
|
export declare const PreDefined: Story;
|
|
17
17
|
export declare const Disabled: Story;
|
|
18
18
|
export declare const NoDefinedFile: Story;
|
|
19
|
+
export declare const MinImageSize: Story;
|
|
19
20
|
export declare const CropEnabled: Story;
|
|
20
21
|
export declare const CropEnabled16x9: Story;
|
|
21
22
|
export declare const CropEnabledRetina: Story;
|
|
23
|
+
export declare const CropExactOutput: Story;
|
|
22
24
|
export declare const Error: Story;
|
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
import { FileTypes } from "../index";
|
|
2
|
+
/**
|
|
3
|
+
* Crop settings for the Upload component
|
|
4
|
+
*/
|
|
5
|
+
export type CropSettings = {
|
|
6
|
+
/** Aspect ratio (e.g., 1 for square, 16/9 for widescreen). */
|
|
7
|
+
aspectRatio?: number;
|
|
8
|
+
/** Minimum crop area width in pixels. User cannot select smaller than this. */
|
|
9
|
+
minWidth?: number;
|
|
10
|
+
/** Minimum crop area height in pixels. User cannot select smaller than this. */
|
|
11
|
+
minHeight?: number;
|
|
12
|
+
/** Output width in pixels. Cropped image will be resized to this width. */
|
|
13
|
+
outputWidth?: number;
|
|
14
|
+
/** Output height in pixels. Cropped image will be resized to this height. */
|
|
15
|
+
outputHeight?: number;
|
|
16
|
+
/** Output image quality (0-1), default 0.9 */
|
|
17
|
+
quality?: number;
|
|
18
|
+
/** Crop modal title */
|
|
19
|
+
modalTitle?: string;
|
|
20
|
+
/** Show grid lines on crop area (default: true) */
|
|
21
|
+
showGrid?: boolean;
|
|
22
|
+
};
|
|
2
23
|
export type UploadProps = {
|
|
3
24
|
id?: string;
|
|
4
25
|
action?: string;
|
|
@@ -30,22 +51,24 @@ export type UploadProps = {
|
|
|
30
51
|
extraQueryString?: {};
|
|
31
52
|
extraHeader?: {};
|
|
32
53
|
disabled?: boolean;
|
|
33
|
-
/** Minimum image width required for upload (in pixels). Smaller images will be rejected. */
|
|
54
|
+
/** Minimum image width required for upload (in pixels). Smaller images will be rejected. Works with or without crop. */
|
|
34
55
|
minImageWidth?: number;
|
|
35
|
-
/** Minimum image height required for upload (in pixels). Smaller images will be rejected. */
|
|
56
|
+
/** Minimum image height required for upload (in pixels). Smaller images will be rejected. Works with or without crop. */
|
|
36
57
|
minImageHeight?: number;
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Crop settings. If provided, cropping is enabled.
|
|
60
|
+
* @example
|
|
61
|
+
* crop={{
|
|
62
|
+
* aspectRatio: 16/9,
|
|
63
|
+
* minWidth: 960, // Minimum crop area size
|
|
64
|
+
* minHeight: 540,
|
|
65
|
+
* outputWidth: 1920, // Final output size
|
|
66
|
+
* outputHeight: 1080,
|
|
67
|
+
* quality: 0.9,
|
|
68
|
+
* modalTitle: "Crop Image"
|
|
69
|
+
* }}
|
|
70
|
+
*/
|
|
71
|
+
crop?: CropSettings;
|
|
49
72
|
onChange?: ((value: any) => void) | null;
|
|
50
73
|
onUpdate?: ((value: any, update: any, validation: boolean) => void) | null;
|
|
51
74
|
onUploadSuccess?: (path: string) => void;
|