@ctlyst.id/internal-ui 5.7.2 → 5.7.4
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/index.d.mts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -513,6 +513,8 @@ interface PaginationProps {
|
|
|
513
513
|
current: number;
|
|
514
514
|
/** Total number of pages. */
|
|
515
515
|
total: number;
|
|
516
|
+
/** Maximum number of buttons to show. */
|
|
517
|
+
maxButtons?: number;
|
|
516
518
|
/**
|
|
517
519
|
* Callback to run when a page number is selected. You can use this to e.g.
|
|
518
520
|
* run setState on your component's page state.
|
|
@@ -857,6 +859,16 @@ type UploaderProps = FlexProps & {
|
|
|
857
859
|
validate: [number, number];
|
|
858
860
|
message: string;
|
|
859
861
|
};
|
|
862
|
+
/**
|
|
863
|
+
* validate minimum width x height dimension
|
|
864
|
+
*/
|
|
865
|
+
minDimension?: {
|
|
866
|
+
/**
|
|
867
|
+
* [minimum width, minimum height]
|
|
868
|
+
*/
|
|
869
|
+
validate: [number, number];
|
|
870
|
+
message: string;
|
|
871
|
+
};
|
|
860
872
|
/**
|
|
861
873
|
* validate max file size
|
|
862
874
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -513,6 +513,8 @@ interface PaginationProps {
|
|
|
513
513
|
current: number;
|
|
514
514
|
/** Total number of pages. */
|
|
515
515
|
total: number;
|
|
516
|
+
/** Maximum number of buttons to show. */
|
|
517
|
+
maxButtons?: number;
|
|
516
518
|
/**
|
|
517
519
|
* Callback to run when a page number is selected. You can use this to e.g.
|
|
518
520
|
* run setState on your component's page state.
|
|
@@ -857,6 +859,16 @@ type UploaderProps = FlexProps & {
|
|
|
857
859
|
validate: [number, number];
|
|
858
860
|
message: string;
|
|
859
861
|
};
|
|
862
|
+
/**
|
|
863
|
+
* validate minimum width x height dimension
|
|
864
|
+
*/
|
|
865
|
+
minDimension?: {
|
|
866
|
+
/**
|
|
867
|
+
* [minimum width, minimum height]
|
|
868
|
+
*/
|
|
869
|
+
validate: [number, number];
|
|
870
|
+
message: string;
|
|
871
|
+
};
|
|
860
872
|
/**
|
|
861
873
|
* validate max file size
|
|
862
874
|
*/
|
package/dist/index.js
CHANGED
|
@@ -4394,7 +4394,7 @@ var pagination_button_trigger_default = PaginationButtonTrigger;
|
|
|
4394
4394
|
|
|
4395
4395
|
// src/components/pagination/components/pagination.tsx
|
|
4396
4396
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4397
|
-
var Pagination = ({ className, current, total, onSelect }) => {
|
|
4397
|
+
var Pagination = ({ className, current, total, maxButtons = 5, onSelect }) => {
|
|
4398
4398
|
const btnColorDisabled = (0, import_react65.useColorModeValue)("secondary.100", "primary.500");
|
|
4399
4399
|
const btnColor = (0, import_react65.useColorModeValue)("primary.500", "secondary.100");
|
|
4400
4400
|
const disabledPrevious = current === 1;
|
|
@@ -4407,7 +4407,6 @@ var Pagination = ({ className, current, total, onSelect }) => {
|
|
|
4407
4407
|
}
|
|
4408
4408
|
};
|
|
4409
4409
|
const generatePages = () => {
|
|
4410
|
-
const maxButtons = 5;
|
|
4411
4410
|
const pageButtons = [];
|
|
4412
4411
|
let startPage;
|
|
4413
4412
|
let endPage;
|
|
@@ -6274,6 +6273,7 @@ var Uploader = ({
|
|
|
6274
6273
|
maxFileSize,
|
|
6275
6274
|
customValidation,
|
|
6276
6275
|
value,
|
|
6276
|
+
minDimension,
|
|
6277
6277
|
isShowCloseButton = true,
|
|
6278
6278
|
testId,
|
|
6279
6279
|
isError: propIsError,
|
|
@@ -6343,13 +6343,16 @@ var Uploader = ({
|
|
|
6343
6343
|
if (dimension && (imgWidth !== dimension.validate[0] || imgheight !== dimension.validate[1])) {
|
|
6344
6344
|
return handleRejection(dimension.message, file, img);
|
|
6345
6345
|
}
|
|
6346
|
+
if (minDimension && (imgWidth < minDimension.validate[0] || imgheight < minDimension.validate[1])) {
|
|
6347
|
+
return handleRejection(minDimension.message, file, img, error_code_default.FileInvalidDimension);
|
|
6348
|
+
}
|
|
6346
6349
|
onHandleUploadFile == null ? void 0 : onHandleUploadFile(file, img);
|
|
6347
6350
|
setFilePreview(URL.createObjectURL(file));
|
|
6348
6351
|
return null;
|
|
6349
6352
|
};
|
|
6350
6353
|
return null;
|
|
6351
6354
|
},
|
|
6352
|
-
[customValidation, dimension, handleRejection, onHandleUploadFile, acceptFileType]
|
|
6355
|
+
[customValidation, dimension, handleRejection, onHandleUploadFile, acceptFileType, minDimension]
|
|
6353
6356
|
);
|
|
6354
6357
|
const onDropRejected = (0, import_react98.useCallback)((fileRejections) => {
|
|
6355
6358
|
defaultOnHandleRejections(fileRejections, { acceptFormat, maxFileSize }, handleRejection);
|