@ctlyst.id/internal-ui 5.4.6 → 5.4.8
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 +33 -3
- package/dist/index.d.ts +33 -3
- package/dist/index.js +40 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
@@ -15,9 +15,8 @@ import { GroupBase, Props as Props$1, DropdownIndicatorProps, ClearIndicatorProp
|
|
15
15
|
import { AsyncPaginateProps } from 'react-select-async-paginate';
|
16
16
|
import { AsyncCreatableProps } from 'react-select/async-creatable';
|
17
17
|
import { CreatableProps } from 'react-select/creatable';
|
18
|
-
import { ToastOptions } from 'react-toastify';
|
18
|
+
import { Id, ToastOptions, IconProps } from 'react-toastify';
|
19
19
|
export { ToastContainer } from 'react-toastify';
|
20
|
-
import { Id, ToastIcon } from 'react-toastify/dist/types';
|
21
20
|
import { FileError, FileRejection } from 'react-dropzone';
|
22
21
|
import * as axios from 'axios';
|
23
22
|
import { AxiosRequestConfig, AxiosInstance, AxiosResponse } from 'axios';
|
@@ -764,6 +763,7 @@ interface TimeInputProps {
|
|
764
763
|
}
|
765
764
|
declare const TimeInput: _chakra_ui_react.ComponentWithAs<"div", TimeInputProps>;
|
766
765
|
|
766
|
+
type ToastIcon = false | ((props: IconProps) => React.ReactNode) | React.ReactElement<IconProps>;
|
767
767
|
interface CustomToastOptions extends Omit<ToastOptions, 'icon'> {
|
768
768
|
icon?: ToastIcon;
|
769
769
|
link?: {
|
@@ -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
|
@@ -897,6 +903,30 @@ declare const Uploader: React__default.FC<UploaderProps>;
|
|
897
903
|
*/
|
898
904
|
declare const dimensionValidator: (dimension: [number, number], message?: string) => (file: File) => FileError | null;
|
899
905
|
|
906
|
+
declare const ONE_MEGA_BYTE = 1000000;
|
907
|
+
declare const messages: {
|
908
|
+
dragActive: string;
|
909
|
+
dragInActive: string;
|
910
|
+
dragReplace: string;
|
911
|
+
replaceFile: string;
|
912
|
+
uploadFile: string;
|
913
|
+
};
|
914
|
+
declare const IMG_EXT: {
|
915
|
+
readonly jpg: "jpg";
|
916
|
+
readonly jpeg: "jpeg";
|
917
|
+
readonly png: "png";
|
918
|
+
readonly gif: "gif";
|
919
|
+
};
|
920
|
+
declare const EXCEL_EXT: {
|
921
|
+
readonly xls: "xls";
|
922
|
+
readonly xlsx: "xlsx";
|
923
|
+
readonly csv: "csv";
|
924
|
+
};
|
925
|
+
declare const DEFAULT_IMAGE_MIME_TYPE: ("jpg" | "jpeg" | "png" | "gif")[];
|
926
|
+
declare const DEFAULT_EXCEL_MIME_TYPE: string[];
|
927
|
+
declare const concatList: (list: string[]) => string;
|
928
|
+
declare const formatValidationMessage: (extension: string[]) => string;
|
929
|
+
|
900
930
|
declare enum ErrorCode {
|
901
931
|
FileInvalidType = "file-invalid-type",
|
902
932
|
FileTooLarge = "file-too-large",
|
@@ -938,4 +968,4 @@ declare const ProviderContext: React__default.Context<ProviderContextObject>;
|
|
938
968
|
declare const useInternalUI: () => ProviderContextObject;
|
939
969
|
declare const Provider: FC<ProviderProps>;
|
940
970
|
|
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 };
|
971
|
+
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
@@ -15,9 +15,8 @@ import { GroupBase, Props as Props$1, DropdownIndicatorProps, ClearIndicatorProp
|
|
15
15
|
import { AsyncPaginateProps } from 'react-select-async-paginate';
|
16
16
|
import { AsyncCreatableProps } from 'react-select/async-creatable';
|
17
17
|
import { CreatableProps } from 'react-select/creatable';
|
18
|
-
import { ToastOptions } from 'react-toastify';
|
18
|
+
import { Id, ToastOptions, IconProps } from 'react-toastify';
|
19
19
|
export { ToastContainer } from 'react-toastify';
|
20
|
-
import { Id, ToastIcon } from 'react-toastify/dist/types';
|
21
20
|
import { FileError, FileRejection } from 'react-dropzone';
|
22
21
|
import * as axios from 'axios';
|
23
22
|
import { AxiosRequestConfig, AxiosInstance, AxiosResponse } from 'axios';
|
@@ -764,6 +763,7 @@ interface TimeInputProps {
|
|
764
763
|
}
|
765
764
|
declare const TimeInput: _chakra_ui_react.ComponentWithAs<"div", TimeInputProps>;
|
766
765
|
|
766
|
+
type ToastIcon = false | ((props: IconProps) => React.ReactNode) | React.ReactElement<IconProps>;
|
767
767
|
interface CustomToastOptions extends Omit<ToastOptions, 'icon'> {
|
768
768
|
icon?: ToastIcon;
|
769
769
|
link?: {
|
@@ -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
|
@@ -897,6 +903,30 @@ declare const Uploader: React__default.FC<UploaderProps>;
|
|
897
903
|
*/
|
898
904
|
declare const dimensionValidator: (dimension: [number, number], message?: string) => (file: File) => FileError | null;
|
899
905
|
|
906
|
+
declare const ONE_MEGA_BYTE = 1000000;
|
907
|
+
declare const messages: {
|
908
|
+
dragActive: string;
|
909
|
+
dragInActive: string;
|
910
|
+
dragReplace: string;
|
911
|
+
replaceFile: string;
|
912
|
+
uploadFile: string;
|
913
|
+
};
|
914
|
+
declare const IMG_EXT: {
|
915
|
+
readonly jpg: "jpg";
|
916
|
+
readonly jpeg: "jpeg";
|
917
|
+
readonly png: "png";
|
918
|
+
readonly gif: "gif";
|
919
|
+
};
|
920
|
+
declare const EXCEL_EXT: {
|
921
|
+
readonly xls: "xls";
|
922
|
+
readonly xlsx: "xlsx";
|
923
|
+
readonly csv: "csv";
|
924
|
+
};
|
925
|
+
declare const DEFAULT_IMAGE_MIME_TYPE: ("jpg" | "jpeg" | "png" | "gif")[];
|
926
|
+
declare const DEFAULT_EXCEL_MIME_TYPE: string[];
|
927
|
+
declare const concatList: (list: string[]) => string;
|
928
|
+
declare const formatValidationMessage: (extension: string[]) => string;
|
929
|
+
|
900
930
|
declare enum ErrorCode {
|
901
931
|
FileInvalidType = "file-invalid-type",
|
902
932
|
FileTooLarge = "file-too-large",
|
@@ -938,4 +968,4 @@ declare const ProviderContext: React__default.Context<ProviderContextObject>;
|
|
938
968
|
declare const useInternalUI: () => ProviderContextObject;
|
939
969
|
declare const Provider: FC<ProviderProps>;
|
940
970
|
|
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 };
|
971
|
+
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,
|
@@ -5905,7 +5913,7 @@ var styles_default2 = Styles2;
|
|
5905
5913
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
5906
5914
|
var CustomCloseButton = (props) => {
|
5907
5915
|
const { closeToast } = props;
|
5908
|
-
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_react92.Box, { p: 2, mb: 1, alignItems: "center", display: "flex", "data-test-id": "", cursor: "pointer", onClick: closeToast, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_internal_icon11.Close, { size: 4, color: "white" }) });
|
5916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_react92.Box, { p: 2, mb: 1, alignItems: "center", display: "flex", "data-test-id": "", cursor: "pointer", onClick: () => closeToast(), children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_internal_icon11.Close, { size: 4, color: "white" }) });
|
5909
5917
|
};
|
5910
5918
|
var DEFAULT_OPTIONS = {
|
5911
5919
|
position: "top-right",
|
@@ -5939,7 +5947,7 @@ var useToast = () => {
|
|
5939
5947
|
const content = (icon, message, link) => {
|
5940
5948
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
|
5941
5949
|
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(styles_default2, {}),
|
5942
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_react92.Flex, { justifyContent: "space-between", alignItems: "center", gap: 4, mb: 1, children: [
|
5950
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_react92.Flex, { justifyContent: "space-between", alignItems: "center", gap: 4, mb: 1, flex: 1, children: [
|
5943
5951
|
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_react92.Flex, { alignItems: "center", children: [
|
5944
5952
|
icon && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_react92.chakra.span, { mr: 2, w: 4, h: 4, children: renderIcon(icon, "default") }),
|
5945
5953
|
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_react92.chakra.span, { noOfLines: 2, children: message })
|
@@ -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,
|
@@ -6141,6 +6161,11 @@ var Uploader = ({
|
|
6141
6161
|
const onDropAccepted = (0, import_react94.useCallback)(
|
6142
6162
|
(files) => {
|
6143
6163
|
const file = files[0];
|
6164
|
+
if (acceptFileType && acceptFileType.includes(file.type)) {
|
6165
|
+
setFilePreview(file.name);
|
6166
|
+
onHandleUploadFile == null ? void 0 : onHandleUploadFile(file, null);
|
6167
|
+
return null;
|
6168
|
+
}
|
6144
6169
|
const imageUrl = URL.createObjectURL(file);
|
6145
6170
|
const img = new Image();
|
6146
6171
|
if (file.type === "image/heic") {
|
@@ -6164,7 +6189,7 @@ var Uploader = ({
|
|
6164
6189
|
};
|
6165
6190
|
return null;
|
6166
6191
|
},
|
6167
|
-
[customValidation, dimension, handleRejection, onHandleUploadFile]
|
6192
|
+
[customValidation, dimension, handleRejection, onHandleUploadFile, acceptFileType]
|
6168
6193
|
);
|
6169
6194
|
const onDropRejected = (0, import_react94.useCallback)((fileRejections) => {
|
6170
6195
|
defaultOnHandleRejections(fileRejections, { acceptFormat, maxFileSize }, handleRejection);
|
@@ -6189,7 +6214,10 @@ var Uploader = ({
|
|
6189
6214
|
const { getRootProps, getInputProps, isDragActive, acceptedFiles, open } = (0, import_react_dropzone.useDropzone)({
|
6190
6215
|
onDropAccepted,
|
6191
6216
|
onDropRejected,
|
6192
|
-
accept:
|
6217
|
+
accept: {
|
6218
|
+
...acceptFormat ? Object.fromEntries(acceptFile) : {},
|
6219
|
+
...acceptFileType ? Object.fromEntries(acceptFileType.map((type) => [type, []])) : {}
|
6220
|
+
},
|
6193
6221
|
maxFiles: 1,
|
6194
6222
|
maxSize: maxFileSize == null ? void 0 : maxFileSize.validate,
|
6195
6223
|
noClick: isDisabled || !!filePreview,
|
@@ -8143,6 +8171,8 @@ var import_react108 = require("@chakra-ui/react");
|
|
8143
8171
|
Container,
|
8144
8172
|
ContainerProps,
|
8145
8173
|
Counter,
|
8174
|
+
DEFAULT_EXCEL_MIME_TYPE,
|
8175
|
+
DEFAULT_IMAGE_MIME_TYPE,
|
8146
8176
|
DataTable,
|
8147
8177
|
DatePickerMonth,
|
8148
8178
|
Datepicker,
|
@@ -8159,6 +8189,7 @@ var import_react108 = require("@chakra-ui/react");
|
|
8159
8189
|
DrawerOverlay,
|
8160
8190
|
DrawerProps,
|
8161
8191
|
DropdownIndicator,
|
8192
|
+
EXCEL_EXT,
|
8162
8193
|
EmptyState,
|
8163
8194
|
ErrorCode,
|
8164
8195
|
Fade,
|
@@ -8182,6 +8213,7 @@ var import_react108 = require("@chakra-ui/react");
|
|
8182
8213
|
HeadingProps,
|
8183
8214
|
Hide,
|
8184
8215
|
HideProps,
|
8216
|
+
IMG_EXT,
|
8185
8217
|
Icon,
|
8186
8218
|
IconButton,
|
8187
8219
|
IconButtonProps,
|
@@ -8239,6 +8271,7 @@ var import_react108 = require("@chakra-ui/react");
|
|
8239
8271
|
Navbar,
|
8240
8272
|
NavigationBar,
|
8241
8273
|
NoOptionsMessage,
|
8274
|
+
ONE_MEGA_BYTE,
|
8242
8275
|
OrderedList,
|
8243
8276
|
Pagination,
|
8244
8277
|
PaginationDetail,
|
@@ -8383,16 +8416,19 @@ var import_react108 = require("@chakra-ui/react");
|
|
8383
8416
|
WrapItemProps,
|
8384
8417
|
WrapProps,
|
8385
8418
|
XMSLogo,
|
8419
|
+
concatList,
|
8386
8420
|
createExtendTheme,
|
8387
8421
|
defaultOnHandleRejections,
|
8388
8422
|
dimensionValidator,
|
8389
8423
|
extendTheme,
|
8424
|
+
formatValidationMessage,
|
8390
8425
|
forwardRef,
|
8391
8426
|
getSelectAllCheckboxState,
|
8392
8427
|
getTheme,
|
8393
8428
|
id,
|
8394
8429
|
isCellDisabled,
|
8395
8430
|
isRatioEqual,
|
8431
|
+
messages,
|
8396
8432
|
selectStyles,
|
8397
8433
|
theme,
|
8398
8434
|
themeSelect,
|