@majapisoftwares/ui 4.3.12 → 4.3.13
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.
|
@@ -4,7 +4,7 @@ export type PictureCropInputRef = {
|
|
|
4
4
|
handleCrop: () => Promise<void>;
|
|
5
5
|
completedCrop: PixelCrop | undefined;
|
|
6
6
|
};
|
|
7
|
-
export default function PictureCropInput({ value, onChange, loading, className, previewSizeClassNames, previewContainerClassName, cropButtonClassName, aspect, ref, label, }: {
|
|
7
|
+
export default function PictureCropInput({ value, onChange, loading, className, previewSizeClassNames, previewContainerClassName, cropButtonClassName, aspect, minWidth, minHeight, ref, label, }: {
|
|
8
8
|
value?: string;
|
|
9
9
|
onChange: (value?: string) => void;
|
|
10
10
|
loading?: boolean;
|
|
@@ -13,6 +13,8 @@ export default function PictureCropInput({ value, onChange, loading, className,
|
|
|
13
13
|
previewContainerClassName?: string;
|
|
14
14
|
cropButtonClassName?: string;
|
|
15
15
|
aspect?: number;
|
|
16
|
+
minWidth?: number;
|
|
17
|
+
minHeight?: number;
|
|
16
18
|
ref?: RefObject<PictureCropInputRef | null>;
|
|
17
19
|
label?: string;
|
|
18
20
|
}): import("react").JSX.Element;
|
|
@@ -10,7 +10,7 @@ import { CheckIcon, TrashIcon } from "@heroicons/react/20/solid";
|
|
|
10
10
|
import Tooltip from "../Tooltip";
|
|
11
11
|
import { useLatest } from "react-use";
|
|
12
12
|
import { defaultLabelClassName } from "../Input";
|
|
13
|
-
export default function PictureCropInput({ value, onChange, loading, className, previewSizeClassNames = "
|
|
13
|
+
export default function PictureCropInput({ value, onChange, loading, className, previewSizeClassNames = "w-52", previewContainerClassName, cropButtonClassName, aspect, minWidth, minHeight, ref, label, }) {
|
|
14
14
|
const id = useId();
|
|
15
15
|
const [src, setSrc] = useState();
|
|
16
16
|
const [crop, setCrop] = useState();
|
|
@@ -121,7 +121,7 @@ export default function PictureCropInput({ value, onChange, loading, className,
|
|
|
121
121
|
<div className="flex gap-2">
|
|
122
122
|
{loading && <Skeleton className={previewSizeClassNames}/>}
|
|
123
123
|
{src && (<>
|
|
124
|
-
<ReactCrop crop={crop} onChange={(c) => setCrop(c)} onComplete={(c) => setCompletedCrop(c)} aspect={aspect} minWidth={
|
|
124
|
+
<ReactCrop crop={crop} onChange={(c) => setCrop(c)} onComplete={(c) => setCompletedCrop(c)} aspect={aspect} minWidth={minWidth} minHeight={minHeight} className="max-h-96 max-w-96" keepSelection>
|
|
125
125
|
{/* eslint-disable-next-line @next/next/no-img-element */}
|
|
126
126
|
<img alt="Picture" src={src}
|
|
127
127
|
// className="h-96 w-96 object-contain"
|
package/package.json
CHANGED