@ctlyst.id/internal-ui 5.4.7 → 5.4.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/index.d.mts +32 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +45 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
@@ -868,6 +868,12 @@ type UploaderProps = FlexProps & {
|
|
868
868
|
validate: string[];
|
869
869
|
message?: string;
|
870
870
|
};
|
871
|
+
/**
|
872
|
+
* MIME types for file upload
|
873
|
+
* Example:
|
874
|
+
* ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv']
|
875
|
+
*/
|
876
|
+
acceptFileType?: string[];
|
871
877
|
/**
|
872
878
|
* @deprecated since version 3.4.6
|
873
879
|
* will be removed in version 4
|
@@ -887,6 +893,7 @@ type UploaderProps = FlexProps & {
|
|
887
893
|
testId?: string;
|
888
894
|
isShowReupload?: boolean;
|
889
895
|
size?: 'sm' | 'lg';
|
896
|
+
buttonChangeText?: string;
|
890
897
|
};
|
891
898
|
|
892
899
|
declare const Uploader: React__default.FC<UploaderProps>;
|
@@ -897,6 +904,30 @@ declare const Uploader: React__default.FC<UploaderProps>;
|
|
897
904
|
*/
|
898
905
|
declare const dimensionValidator: (dimension: [number, number], message?: string) => (file: File) => FileError | null;
|
899
906
|
|
907
|
+
declare const ONE_MEGA_BYTE = 1000000;
|
908
|
+
declare const messages: {
|
909
|
+
dragActive: string;
|
910
|
+
dragInActive: string;
|
911
|
+
dragReplace: string;
|
912
|
+
replaceFile: string;
|
913
|
+
uploadFile: string;
|
914
|
+
};
|
915
|
+
declare const IMG_EXT: {
|
916
|
+
readonly jpg: "jpg";
|
917
|
+
readonly jpeg: "jpeg";
|
918
|
+
readonly png: "png";
|
919
|
+
readonly gif: "gif";
|
920
|
+
};
|
921
|
+
declare const EXCEL_EXT: {
|
922
|
+
readonly xls: "xls";
|
923
|
+
readonly xlsx: "xlsx";
|
924
|
+
readonly csv: "csv";
|
925
|
+
};
|
926
|
+
declare const DEFAULT_IMAGE_MIME_TYPE: ("jpg" | "jpeg" | "png" | "gif")[];
|
927
|
+
declare const DEFAULT_EXCEL_MIME_TYPE: string[];
|
928
|
+
declare const concatList: (list: string[]) => string;
|
929
|
+
declare const formatValidationMessage: (extension: string[]) => string;
|
930
|
+
|
900
931
|
declare enum ErrorCode {
|
901
932
|
FileInvalidType = "file-invalid-type",
|
902
933
|
FileTooLarge = "file-too-large",
|
@@ -938,4 +969,4 @@ declare const ProviderContext: React__default.Context<ProviderContextObject>;
|
|
938
969
|
declare const useInternalUI: () => ProviderContextObject;
|
939
970
|
declare const Provider: FC<ProviderProps>;
|
940
971
|
|
941
|
-
export { AccordionEye, AccordionIndicator, Alert, AlertAction, type AlertActionProps, AlertClose, type AlertCloseProps, AlertDescription, type AlertDescriptionProps, AlertIcon, type AlertIconProps, type AlertProps, type AlertStatus, AlertTitle, type AlertTitleProps, Anchor, type AnchorProps, Badge, type BadgeProps, BreadCrumb, type BreadCrumbParentProps, type BreadCrumbProps, Button, type ButtonProps, CHECKBOX_STATE, CardCustom as Card, type CardProps, CheckboxComponent as Checkbox, type CheckboxComponentProps, CheckboxGroupComponent as CheckboxGroup, type CheckboxGroupComponentProps, Chips, type ChipsProps, ClearIndicator, Counter, type CustomLoaderProps, _default as DataTable, type DataTableProps, type DataTableRefs, DatePickerMonth, type DatePickerMonthProps, Datepicker, type DatepickerProps, Dialog, type DisabledRowData, DropdownIndicator, EmptyState, type Environment, ErrorCode, Field, type FieldProps, Header, type HeaderDataProps, type HeaderProps, InputAddonLeft, InputAddonRight, InputField, type InputFieldProps, Loader, type LoaderProps, Logo, type LogoProps, Navigation as MainMenu, ModalBackButton, MultiDatePickerMonth, type MultiDatePickerMonthProps, MultiValue, MultiValueRemove, NavItem, type NavItemProps, Navbar, type NavbarProps, NavigationBar, type NavigationBarProps, type NavigationProps, NoOptionsMessage, type OptionGroup, type OptionMultiGroup, type OptionsGroup, Pagination, PaginationDetail, type PaginationDetailProps, PaginationFilter, type PaginationFilterProps, type PaginationProps, Profile, type ProfileProps, type Props, Provider, ProviderContext, Radio, RadioGroup, type RadioGroupComponentProps, type RadioProps, Rating, type RatingProps, Select, SelectAsync, SelectAsyncCreatable, type SelectAsyncCreatableProps, type SelectAsyncProps, SelectCheckbox as SelectCheckBox, SelectCreatable, type SelectCreatableProps, type SelectProps, type SelectWithCheckboxBaseProps, Sidebar, SidebarHeader, type SidebarHeaderProps, SidebarMenu, type SidebarMenuProps, type SidebarProps, Switch, type SwitchProps, Tab, type TableStyleProps, type TextAreaProps, TextareaField, type Theme, Time, TimeInput, type TimeInputProps, type TimeOptions, Tooltip, type TooltipProps, Uploader, type UploaderProps, Version, type VersionProps, VoilaLogo, XMSLogo, createExtendTheme, defaultOnHandleRejections, dimensionValidator, getSelectAllCheckboxState, getTheme, isCellDisabled, isRatioEqual, selectStyles, theme, themeSelect, timeFromString, useAlertStyles, useDataTable, useFetcher, useInternalUI, useSelectTable, useToast };
|
972
|
+
export { AccordionEye, AccordionIndicator, Alert, AlertAction, type AlertActionProps, AlertClose, type AlertCloseProps, AlertDescription, type AlertDescriptionProps, AlertIcon, type AlertIconProps, type AlertProps, type AlertStatus, AlertTitle, type AlertTitleProps, Anchor, type AnchorProps, Badge, type BadgeProps, BreadCrumb, type BreadCrumbParentProps, type BreadCrumbProps, Button, type ButtonProps, CHECKBOX_STATE, CardCustom as Card, type CardProps, CheckboxComponent as Checkbox, type CheckboxComponentProps, CheckboxGroupComponent as CheckboxGroup, type CheckboxGroupComponentProps, Chips, type ChipsProps, ClearIndicator, Counter, type CustomLoaderProps, DEFAULT_EXCEL_MIME_TYPE, DEFAULT_IMAGE_MIME_TYPE, _default as DataTable, type DataTableProps, type DataTableRefs, DatePickerMonth, type DatePickerMonthProps, Datepicker, type DatepickerProps, Dialog, type DisabledRowData, DropdownIndicator, EXCEL_EXT, EmptyState, type Environment, ErrorCode, Field, type FieldProps, Header, type HeaderDataProps, type HeaderProps, IMG_EXT, InputAddonLeft, InputAddonRight, InputField, type InputFieldProps, Loader, type LoaderProps, Logo, type LogoProps, Navigation as MainMenu, ModalBackButton, MultiDatePickerMonth, type MultiDatePickerMonthProps, MultiValue, MultiValueRemove, NavItem, type NavItemProps, Navbar, type NavbarProps, NavigationBar, type NavigationBarProps, type NavigationProps, NoOptionsMessage, ONE_MEGA_BYTE, type OptionGroup, type OptionMultiGroup, type OptionsGroup, Pagination, PaginationDetail, type PaginationDetailProps, PaginationFilter, type PaginationFilterProps, type PaginationProps, Profile, type ProfileProps, type Props, Provider, ProviderContext, Radio, RadioGroup, type RadioGroupComponentProps, type RadioProps, Rating, type RatingProps, Select, SelectAsync, SelectAsyncCreatable, type SelectAsyncCreatableProps, type SelectAsyncProps, SelectCheckbox as SelectCheckBox, SelectCreatable, type SelectCreatableProps, type SelectProps, type SelectWithCheckboxBaseProps, Sidebar, SidebarHeader, type SidebarHeaderProps, SidebarMenu, type SidebarMenuProps, type SidebarProps, Switch, type SwitchProps, Tab, type TableStyleProps, type TextAreaProps, TextareaField, type Theme, Time, TimeInput, type TimeInputProps, type TimeOptions, Tooltip, type TooltipProps, Uploader, type UploaderProps, Version, type VersionProps, VoilaLogo, XMSLogo, concatList, createExtendTheme, defaultOnHandleRejections, dimensionValidator, formatValidationMessage, getSelectAllCheckboxState, getTheme, isCellDisabled, isRatioEqual, messages, selectStyles, theme, themeSelect, timeFromString, useAlertStyles, useDataTable, useFetcher, useInternalUI, useSelectTable, useToast };
|
package/dist/index.d.ts
CHANGED
@@ -868,6 +868,12 @@ type UploaderProps = FlexProps & {
|
|
868
868
|
validate: string[];
|
869
869
|
message?: string;
|
870
870
|
};
|
871
|
+
/**
|
872
|
+
* MIME types for file upload
|
873
|
+
* Example:
|
874
|
+
* ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv']
|
875
|
+
*/
|
876
|
+
acceptFileType?: string[];
|
871
877
|
/**
|
872
878
|
* @deprecated since version 3.4.6
|
873
879
|
* will be removed in version 4
|
@@ -887,6 +893,7 @@ type UploaderProps = FlexProps & {
|
|
887
893
|
testId?: string;
|
888
894
|
isShowReupload?: boolean;
|
889
895
|
size?: 'sm' | 'lg';
|
896
|
+
buttonChangeText?: string;
|
890
897
|
};
|
891
898
|
|
892
899
|
declare const Uploader: React__default.FC<UploaderProps>;
|
@@ -897,6 +904,30 @@ declare const Uploader: React__default.FC<UploaderProps>;
|
|
897
904
|
*/
|
898
905
|
declare const dimensionValidator: (dimension: [number, number], message?: string) => (file: File) => FileError | null;
|
899
906
|
|
907
|
+
declare const ONE_MEGA_BYTE = 1000000;
|
908
|
+
declare const messages: {
|
909
|
+
dragActive: string;
|
910
|
+
dragInActive: string;
|
911
|
+
dragReplace: string;
|
912
|
+
replaceFile: string;
|
913
|
+
uploadFile: string;
|
914
|
+
};
|
915
|
+
declare const IMG_EXT: {
|
916
|
+
readonly jpg: "jpg";
|
917
|
+
readonly jpeg: "jpeg";
|
918
|
+
readonly png: "png";
|
919
|
+
readonly gif: "gif";
|
920
|
+
};
|
921
|
+
declare const EXCEL_EXT: {
|
922
|
+
readonly xls: "xls";
|
923
|
+
readonly xlsx: "xlsx";
|
924
|
+
readonly csv: "csv";
|
925
|
+
};
|
926
|
+
declare const DEFAULT_IMAGE_MIME_TYPE: ("jpg" | "jpeg" | "png" | "gif")[];
|
927
|
+
declare const DEFAULT_EXCEL_MIME_TYPE: string[];
|
928
|
+
declare const concatList: (list: string[]) => string;
|
929
|
+
declare const formatValidationMessage: (extension: string[]) => string;
|
930
|
+
|
900
931
|
declare enum ErrorCode {
|
901
932
|
FileInvalidType = "file-invalid-type",
|
902
933
|
FileTooLarge = "file-too-large",
|
@@ -938,4 +969,4 @@ declare const ProviderContext: React__default.Context<ProviderContextObject>;
|
|
938
969
|
declare const useInternalUI: () => ProviderContextObject;
|
939
970
|
declare const Provider: FC<ProviderProps>;
|
940
971
|
|
941
|
-
export { AccordionEye, AccordionIndicator, Alert, AlertAction, type AlertActionProps, AlertClose, type AlertCloseProps, AlertDescription, type AlertDescriptionProps, AlertIcon, type AlertIconProps, type AlertProps, type AlertStatus, AlertTitle, type AlertTitleProps, Anchor, type AnchorProps, Badge, type BadgeProps, BreadCrumb, type BreadCrumbParentProps, type BreadCrumbProps, Button, type ButtonProps, CHECKBOX_STATE, CardCustom as Card, type CardProps, CheckboxComponent as Checkbox, type CheckboxComponentProps, CheckboxGroupComponent as CheckboxGroup, type CheckboxGroupComponentProps, Chips, type ChipsProps, ClearIndicator, Counter, type CustomLoaderProps, _default as DataTable, type DataTableProps, type DataTableRefs, DatePickerMonth, type DatePickerMonthProps, Datepicker, type DatepickerProps, Dialog, type DisabledRowData, DropdownIndicator, EmptyState, type Environment, ErrorCode, Field, type FieldProps, Header, type HeaderDataProps, type HeaderProps, InputAddonLeft, InputAddonRight, InputField, type InputFieldProps, Loader, type LoaderProps, Logo, type LogoProps, Navigation as MainMenu, ModalBackButton, MultiDatePickerMonth, type MultiDatePickerMonthProps, MultiValue, MultiValueRemove, NavItem, type NavItemProps, Navbar, type NavbarProps, NavigationBar, type NavigationBarProps, type NavigationProps, NoOptionsMessage, type OptionGroup, type OptionMultiGroup, type OptionsGroup, Pagination, PaginationDetail, type PaginationDetailProps, PaginationFilter, type PaginationFilterProps, type PaginationProps, Profile, type ProfileProps, type Props, Provider, ProviderContext, Radio, RadioGroup, type RadioGroupComponentProps, type RadioProps, Rating, type RatingProps, Select, SelectAsync, SelectAsyncCreatable, type SelectAsyncCreatableProps, type SelectAsyncProps, SelectCheckbox as SelectCheckBox, SelectCreatable, type SelectCreatableProps, type SelectProps, type SelectWithCheckboxBaseProps, Sidebar, SidebarHeader, type SidebarHeaderProps, SidebarMenu, type SidebarMenuProps, type SidebarProps, Switch, type SwitchProps, Tab, type TableStyleProps, type TextAreaProps, TextareaField, type Theme, Time, TimeInput, type TimeInputProps, type TimeOptions, Tooltip, type TooltipProps, Uploader, type UploaderProps, Version, type VersionProps, VoilaLogo, XMSLogo, createExtendTheme, defaultOnHandleRejections, dimensionValidator, getSelectAllCheckboxState, getTheme, isCellDisabled, isRatioEqual, selectStyles, theme, themeSelect, timeFromString, useAlertStyles, useDataTable, useFetcher, useInternalUI, useSelectTable, useToast };
|
972
|
+
export { AccordionEye, AccordionIndicator, Alert, AlertAction, type AlertActionProps, AlertClose, type AlertCloseProps, AlertDescription, type AlertDescriptionProps, AlertIcon, type AlertIconProps, type AlertProps, type AlertStatus, AlertTitle, type AlertTitleProps, Anchor, type AnchorProps, Badge, type BadgeProps, BreadCrumb, type BreadCrumbParentProps, type BreadCrumbProps, Button, type ButtonProps, CHECKBOX_STATE, CardCustom as Card, type CardProps, CheckboxComponent as Checkbox, type CheckboxComponentProps, CheckboxGroupComponent as CheckboxGroup, type CheckboxGroupComponentProps, Chips, type ChipsProps, ClearIndicator, Counter, type CustomLoaderProps, DEFAULT_EXCEL_MIME_TYPE, DEFAULT_IMAGE_MIME_TYPE, _default as DataTable, type DataTableProps, type DataTableRefs, DatePickerMonth, type DatePickerMonthProps, Datepicker, type DatepickerProps, Dialog, type DisabledRowData, DropdownIndicator, EXCEL_EXT, EmptyState, type Environment, ErrorCode, Field, type FieldProps, Header, type HeaderDataProps, type HeaderProps, IMG_EXT, InputAddonLeft, InputAddonRight, InputField, type InputFieldProps, Loader, type LoaderProps, Logo, type LogoProps, Navigation as MainMenu, ModalBackButton, MultiDatePickerMonth, type MultiDatePickerMonthProps, MultiValue, MultiValueRemove, NavItem, type NavItemProps, Navbar, type NavbarProps, NavigationBar, type NavigationBarProps, type NavigationProps, NoOptionsMessage, ONE_MEGA_BYTE, type OptionGroup, type OptionMultiGroup, type OptionsGroup, Pagination, PaginationDetail, type PaginationDetailProps, PaginationFilter, type PaginationFilterProps, type PaginationProps, Profile, type ProfileProps, type Props, Provider, ProviderContext, Radio, RadioGroup, type RadioGroupComponentProps, type RadioProps, Rating, type RatingProps, Select, SelectAsync, SelectAsyncCreatable, type SelectAsyncCreatableProps, type SelectAsyncProps, SelectCheckbox as SelectCheckBox, SelectCreatable, type SelectCreatableProps, type SelectProps, type SelectWithCheckboxBaseProps, Sidebar, SidebarHeader, type SidebarHeaderProps, SidebarMenu, type SidebarMenuProps, type SidebarProps, Switch, type SwitchProps, Tab, type TableStyleProps, type TextAreaProps, TextareaField, type Theme, Time, TimeInput, type TimeInputProps, type TimeOptions, Tooltip, type TooltipProps, Uploader, type UploaderProps, Version, type VersionProps, VoilaLogo, XMSLogo, concatList, createExtendTheme, defaultOnHandleRejections, dimensionValidator, formatValidationMessage, getSelectAllCheckboxState, getTheme, isCellDisabled, isRatioEqual, messages, selectStyles, theme, themeSelect, timeFromString, useAlertStyles, useDataTable, useFetcher, useInternalUI, useSelectTable, useToast };
|
package/dist/index.js
CHANGED
@@ -96,6 +96,8 @@ __export(src_exports, {
|
|
96
96
|
Container: () => import_react55.Container,
|
97
97
|
ContainerProps: () => import_react55.ContainerProps,
|
98
98
|
Counter: () => counter_default,
|
99
|
+
DEFAULT_EXCEL_MIME_TYPE: () => DEFAULT_EXCEL_MIME_TYPE,
|
100
|
+
DEFAULT_IMAGE_MIME_TYPE: () => DEFAULT_IMAGE_MIME_TYPE,
|
99
101
|
DataTable: () => data_table_default,
|
100
102
|
DatePickerMonth: () => datepicker_month_default,
|
101
103
|
Datepicker: () => datepicker_default,
|
@@ -112,6 +114,7 @@ __export(src_exports, {
|
|
112
114
|
DrawerOverlay: () => import_react58.ModalOverlay,
|
113
115
|
DrawerProps: () => import_react58.DrawerProps,
|
114
116
|
DropdownIndicator: () => DropdownIndicator,
|
117
|
+
EXCEL_EXT: () => EXCEL_EXT,
|
115
118
|
EmptyState: () => empty_state_default,
|
116
119
|
ErrorCode: () => error_code_default,
|
117
120
|
Fade: () => import_react95.Fade,
|
@@ -135,6 +138,7 @@ __export(src_exports, {
|
|
135
138
|
HeadingProps: () => import_react87.HeadingProps,
|
136
139
|
Hide: () => import_react95.Hide,
|
137
140
|
HideProps: () => import_react95.HideProps,
|
141
|
+
IMG_EXT: () => IMG_EXT,
|
138
142
|
Icon: () => import_react54.Icon,
|
139
143
|
IconButton: () => import_react10.IconButton,
|
140
144
|
IconButtonProps: () => import_react10.IconButtonProps,
|
@@ -192,6 +196,7 @@ __export(src_exports, {
|
|
192
196
|
Navbar: () => Navbar,
|
193
197
|
NavigationBar: () => navigation_bar_default,
|
194
198
|
NoOptionsMessage: () => NoOptionsMessage,
|
199
|
+
ONE_MEGA_BYTE: () => ONE_MEGA_BYTE,
|
195
200
|
OrderedList: () => import_react56.OrderedList,
|
196
201
|
Pagination: () => pagination_default,
|
197
202
|
PaginationDetail: () => pagination_detail_default,
|
@@ -336,16 +341,19 @@ __export(src_exports, {
|
|
336
341
|
WrapItemProps: () => import_react55.WrapItemProps,
|
337
342
|
WrapProps: () => import_react55.WrapProps,
|
338
343
|
XMSLogo: () => XMSLogo,
|
344
|
+
concatList: () => concatList,
|
339
345
|
createExtendTheme: () => createExtendTheme,
|
340
346
|
defaultOnHandleRejections: () => defaultOnHandleRejections,
|
341
347
|
dimensionValidator: () => dimensionValidator,
|
342
348
|
extendTheme: () => import_react108.extendTheme,
|
349
|
+
formatValidationMessage: () => formatValidationMessage,
|
343
350
|
forwardRef: () => import_react108.forwardRef,
|
344
351
|
getSelectAllCheckboxState: () => getSelectAllCheckboxState,
|
345
352
|
getTheme: () => getTheme,
|
346
353
|
id: () => id,
|
347
354
|
isCellDisabled: () => isCellDisabled,
|
348
355
|
isRatioEqual: () => isRatioEqual,
|
356
|
+
messages: () => messages,
|
349
357
|
selectStyles: () => selectStyles,
|
350
358
|
theme: () => theme4,
|
351
359
|
themeSelect: () => themeSelect,
|
@@ -6031,6 +6039,7 @@ var import_react94 = require("react");
|
|
6031
6039
|
var import_react_dropzone = require("react-dropzone");
|
6032
6040
|
|
6033
6041
|
// src/components/uploader/constants.ts
|
6042
|
+
var ONE_MEGA_BYTE = 1e6;
|
6034
6043
|
var messages = {
|
6035
6044
|
dragActive: "Drop file disini...",
|
6036
6045
|
dragInActive: `(Klik atau drag untuk input file)`,
|
@@ -6044,7 +6053,17 @@ var IMG_EXT = {
|
|
6044
6053
|
png: "png",
|
6045
6054
|
gif: "gif"
|
6046
6055
|
};
|
6056
|
+
var EXCEL_EXT = {
|
6057
|
+
xls: "xls",
|
6058
|
+
xlsx: "xlsx",
|
6059
|
+
csv: "csv"
|
6060
|
+
};
|
6047
6061
|
var DEFAULT_IMAGE_MIME_TYPE = [IMG_EXT.jpg, IMG_EXT.jpeg, IMG_EXT.png, IMG_EXT.gif];
|
6062
|
+
var DEFAULT_EXCEL_MIME_TYPE = [
|
6063
|
+
"application/vnd.ms-excel",
|
6064
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
6065
|
+
"text/csv"
|
6066
|
+
];
|
6048
6067
|
var concatList = (list) => {
|
6049
6068
|
let _concatedList = "";
|
6050
6069
|
if (list.length > 1) {
|
@@ -6114,6 +6133,7 @@ var Uploader = ({
|
|
6114
6133
|
acceptFormat = {
|
6115
6134
|
validate: DEFAULT_IMAGE_MIME_TYPE
|
6116
6135
|
},
|
6136
|
+
acceptFileType,
|
6117
6137
|
maxFileSize,
|
6118
6138
|
customValidation,
|
6119
6139
|
value,
|
@@ -6124,6 +6144,7 @@ var Uploader = ({
|
|
6124
6144
|
isShowReupload = true,
|
6125
6145
|
size: size2 = "lg",
|
6126
6146
|
validatorExt,
|
6147
|
+
buttonChangeText = "Ubah Foto",
|
6127
6148
|
...props
|
6128
6149
|
}) => {
|
6129
6150
|
const [filePreview, setFilePreview] = (0, import_react94.useState)();
|
@@ -6141,6 +6162,11 @@ var Uploader = ({
|
|
6141
6162
|
const onDropAccepted = (0, import_react94.useCallback)(
|
6142
6163
|
(files) => {
|
6143
6164
|
const file = files[0];
|
6165
|
+
if (acceptFileType && acceptFileType.includes(file.type)) {
|
6166
|
+
setFilePreview(file.name);
|
6167
|
+
onHandleUploadFile == null ? void 0 : onHandleUploadFile(file, null);
|
6168
|
+
return null;
|
6169
|
+
}
|
6144
6170
|
const imageUrl = URL.createObjectURL(file);
|
6145
6171
|
const img = new Image();
|
6146
6172
|
if (file.type === "image/heic") {
|
@@ -6164,7 +6190,7 @@ var Uploader = ({
|
|
6164
6190
|
};
|
6165
6191
|
return null;
|
6166
6192
|
},
|
6167
|
-
[customValidation, dimension, handleRejection, onHandleUploadFile]
|
6193
|
+
[customValidation, dimension, handleRejection, onHandleUploadFile, acceptFileType]
|
6168
6194
|
);
|
6169
6195
|
const onDropRejected = (0, import_react94.useCallback)((fileRejections) => {
|
6170
6196
|
defaultOnHandleRejections(fileRejections, { acceptFormat, maxFileSize }, handleRejection);
|
@@ -6189,7 +6215,10 @@ var Uploader = ({
|
|
6189
6215
|
const { getRootProps, getInputProps, isDragActive, acceptedFiles, open } = (0, import_react_dropzone.useDropzone)({
|
6190
6216
|
onDropAccepted,
|
6191
6217
|
onDropRejected,
|
6192
|
-
accept:
|
6218
|
+
accept: {
|
6219
|
+
...acceptFormat ? Object.fromEntries(acceptFile) : {},
|
6220
|
+
...acceptFileType ? Object.fromEntries(acceptFileType.map((type) => [type, []])) : {}
|
6221
|
+
},
|
6193
6222
|
maxFiles: 1,
|
6194
6223
|
maxSize: maxFileSize == null ? void 0 : maxFileSize.validate,
|
6195
6224
|
noClick: isDisabled || !!filePreview,
|
@@ -6227,6 +6256,10 @@ var Uploader = ({
|
|
6227
6256
|
setFilePreview(value.name);
|
6228
6257
|
return;
|
6229
6258
|
}
|
6259
|
+
if (acceptFileType == null ? void 0 : acceptFileType.some((type) => type === value.type)) {
|
6260
|
+
setFilePreview(value.name);
|
6261
|
+
return;
|
6262
|
+
}
|
6230
6263
|
setFilePreview(URL.createObjectURL(value));
|
6231
6264
|
}
|
6232
6265
|
} else {
|
@@ -6289,7 +6322,7 @@ var Uploader = ({
|
|
6289
6322
|
"data-test-id": `CT_component_base-image-uploader_image-preview${testId ? `_${testId}` : ""}`,
|
6290
6323
|
justify: "center",
|
6291
6324
|
align: "center",
|
6292
|
-
children: filePreview.includes("blob") ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
6325
|
+
children: filePreview.includes("blob") && !acceptFile.some(([type]) => typeof type === "string" && type.includes("image/")) ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
6293
6326
|
import_react93.Image,
|
6294
6327
|
{
|
6295
6328
|
h: size2 === "lg" ? "120" : "100",
|
@@ -6334,7 +6367,7 @@ var Uploader = ({
|
|
6334
6367
|
size: "sm",
|
6335
6368
|
variant: "outline",
|
6336
6369
|
onClick: open,
|
6337
|
-
children:
|
6370
|
+
children: buttonChangeText
|
6338
6371
|
}
|
6339
6372
|
) }),
|
6340
6373
|
renderErrorText(errorText),
|
@@ -8143,6 +8176,8 @@ var import_react108 = require("@chakra-ui/react");
|
|
8143
8176
|
Container,
|
8144
8177
|
ContainerProps,
|
8145
8178
|
Counter,
|
8179
|
+
DEFAULT_EXCEL_MIME_TYPE,
|
8180
|
+
DEFAULT_IMAGE_MIME_TYPE,
|
8146
8181
|
DataTable,
|
8147
8182
|
DatePickerMonth,
|
8148
8183
|
Datepicker,
|
@@ -8159,6 +8194,7 @@ var import_react108 = require("@chakra-ui/react");
|
|
8159
8194
|
DrawerOverlay,
|
8160
8195
|
DrawerProps,
|
8161
8196
|
DropdownIndicator,
|
8197
|
+
EXCEL_EXT,
|
8162
8198
|
EmptyState,
|
8163
8199
|
ErrorCode,
|
8164
8200
|
Fade,
|
@@ -8182,6 +8218,7 @@ var import_react108 = require("@chakra-ui/react");
|
|
8182
8218
|
HeadingProps,
|
8183
8219
|
Hide,
|
8184
8220
|
HideProps,
|
8221
|
+
IMG_EXT,
|
8185
8222
|
Icon,
|
8186
8223
|
IconButton,
|
8187
8224
|
IconButtonProps,
|
@@ -8239,6 +8276,7 @@ var import_react108 = require("@chakra-ui/react");
|
|
8239
8276
|
Navbar,
|
8240
8277
|
NavigationBar,
|
8241
8278
|
NoOptionsMessage,
|
8279
|
+
ONE_MEGA_BYTE,
|
8242
8280
|
OrderedList,
|
8243
8281
|
Pagination,
|
8244
8282
|
PaginationDetail,
|
@@ -8383,16 +8421,19 @@ var import_react108 = require("@chakra-ui/react");
|
|
8383
8421
|
WrapItemProps,
|
8384
8422
|
WrapProps,
|
8385
8423
|
XMSLogo,
|
8424
|
+
concatList,
|
8386
8425
|
createExtendTheme,
|
8387
8426
|
defaultOnHandleRejections,
|
8388
8427
|
dimensionValidator,
|
8389
8428
|
extendTheme,
|
8429
|
+
formatValidationMessage,
|
8390
8430
|
forwardRef,
|
8391
8431
|
getSelectAllCheckboxState,
|
8392
8432
|
getTheme,
|
8393
8433
|
id,
|
8394
8434
|
isCellDisabled,
|
8395
8435
|
isRatioEqual,
|
8436
|
+
messages,
|
8396
8437
|
selectStyles,
|
8397
8438
|
theme,
|
8398
8439
|
themeSelect,
|