@ctlyst.id/internal-ui 4.3.2 → 5.0.1

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.mts CHANGED
@@ -7,7 +7,7 @@ import { SystemStyleObject, HTMLChakraProps, ThemingProps, ColorMode } from '@ch
7
7
  import * as React$1 from 'react';
8
8
  import React__default, { PropsWithChildren, ReactNode, FC } from 'react';
9
9
  import * as _tanstack_react_table from '@tanstack/react-table';
10
- import { ColumnDef, SortingState, ColumnPinningState, RowSelectionInstance } from '@tanstack/react-table';
10
+ import { ColumnDef, RowSelectionState, OnChangeFn, SortingState, ColumnPinningState, RowSelectionInstance } from '@tanstack/react-table';
11
11
  import { DatePickerProps } from 'react-datepicker';
12
12
  import { IconType } from 'react-icons/lib';
13
13
  import * as react_select from 'react-select';
@@ -246,6 +246,8 @@ interface DataTableProps<T> {
246
246
  dataSource: T[] | undefined;
247
247
  isLoading?: boolean;
248
248
  withSelectedRow?: boolean | undefined;
249
+ selectedRow?: RowSelectionState;
250
+ onRowSelectionChange?: OnChangeFn<RowSelectionState>;
249
251
  onSelectedRow?: (data: T[]) => void;
250
252
  onSort?: (data: SortingState) => void;
251
253
  manualSorting?: boolean;
@@ -261,7 +263,7 @@ interface DataTableProps<T> {
261
263
  }
262
264
  declare const isCellDisabled: (row: DisabledRowData, cellId: string) => boolean;
263
265
  type DataTableRefs<T> = Pick<RowSelectionInstance<T>, 'toggleAllRowsSelected'>;
264
- declare const useDataTable: <T>({ columns, dataSource, withSelectedRow, onSelectedRow, onSort, sortDescFirst, sortingState, manualSorting, columnPinning, }: DataTableProps<T>) => {
266
+ declare const useDataTable: <T>({ columns, dataSource, withSelectedRow, onSelectedRow, onSort, sortDescFirst, sortingState, manualSorting, selectedRow, disabledRow, onRowSelectionChange, columnPinning, }: DataTableProps<T>) => {
265
267
  table: _tanstack_react_table.Table<T>;
266
268
  toggleAllRowsSelected: (value?: boolean | undefined) => void;
267
269
  generateColumn: () => ColumnDef<T>[];
@@ -270,6 +272,11 @@ declare const _default: <T>(props: DataTableProps<T> & {
270
272
  ref?: React$1.Ref<DataTableRefs<T>>;
271
273
  }) => JSX.Element;
272
274
 
275
+ declare const useSelectTable: (intialRowSelection?: RowSelectionState) => {
276
+ rowSelection: RowSelectionState;
277
+ onRowSelectionChange: React__default.Dispatch<React__default.SetStateAction<RowSelectionState>>;
278
+ };
279
+
273
280
  type DatepickerProps = DatePickerProps & {
274
281
  id?: string;
275
282
  isRequired?: boolean;
@@ -924,4 +931,4 @@ declare const ProviderContext: React__default.Context<ProviderContextObject>;
924
931
  declare const useInternalUI: () => ProviderContextObject;
925
932
  declare const Provider: FC<ProviderProps>;
926
933
 
927
- 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, useToast };
934
+ 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 };
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import { SystemStyleObject, HTMLChakraProps, ThemingProps, ColorMode } from '@ch
7
7
  import * as React$1 from 'react';
8
8
  import React__default, { PropsWithChildren, ReactNode, FC } from 'react';
9
9
  import * as _tanstack_react_table from '@tanstack/react-table';
10
- import { ColumnDef, SortingState, ColumnPinningState, RowSelectionInstance } from '@tanstack/react-table';
10
+ import { ColumnDef, RowSelectionState, OnChangeFn, SortingState, ColumnPinningState, RowSelectionInstance } from '@tanstack/react-table';
11
11
  import { DatePickerProps } from 'react-datepicker';
12
12
  import { IconType } from 'react-icons/lib';
13
13
  import * as react_select from 'react-select';
@@ -246,6 +246,8 @@ interface DataTableProps<T> {
246
246
  dataSource: T[] | undefined;
247
247
  isLoading?: boolean;
248
248
  withSelectedRow?: boolean | undefined;
249
+ selectedRow?: RowSelectionState;
250
+ onRowSelectionChange?: OnChangeFn<RowSelectionState>;
249
251
  onSelectedRow?: (data: T[]) => void;
250
252
  onSort?: (data: SortingState) => void;
251
253
  manualSorting?: boolean;
@@ -261,7 +263,7 @@ interface DataTableProps<T> {
261
263
  }
262
264
  declare const isCellDisabled: (row: DisabledRowData, cellId: string) => boolean;
263
265
  type DataTableRefs<T> = Pick<RowSelectionInstance<T>, 'toggleAllRowsSelected'>;
264
- declare const useDataTable: <T>({ columns, dataSource, withSelectedRow, onSelectedRow, onSort, sortDescFirst, sortingState, manualSorting, columnPinning, }: DataTableProps<T>) => {
266
+ declare const useDataTable: <T>({ columns, dataSource, withSelectedRow, onSelectedRow, onSort, sortDescFirst, sortingState, manualSorting, selectedRow, disabledRow, onRowSelectionChange, columnPinning, }: DataTableProps<T>) => {
265
267
  table: _tanstack_react_table.Table<T>;
266
268
  toggleAllRowsSelected: (value?: boolean | undefined) => void;
267
269
  generateColumn: () => ColumnDef<T>[];
@@ -270,6 +272,11 @@ declare const _default: <T>(props: DataTableProps<T> & {
270
272
  ref?: React$1.Ref<DataTableRefs<T>>;
271
273
  }) => JSX.Element;
272
274
 
275
+ declare const useSelectTable: (intialRowSelection?: RowSelectionState) => {
276
+ rowSelection: RowSelectionState;
277
+ onRowSelectionChange: React__default.Dispatch<React__default.SetStateAction<RowSelectionState>>;
278
+ };
279
+
273
280
  type DatepickerProps = DatePickerProps & {
274
281
  id?: string;
275
282
  isRequired?: boolean;
@@ -924,4 +931,4 @@ declare const ProviderContext: React__default.Context<ProviderContextObject>;
924
931
  declare const useInternalUI: () => ProviderContextObject;
925
932
  declare const Provider: FC<ProviderProps>;
926
933
 
927
- 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, useToast };
934
+ 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 };