dfh-ui-library 1.3.12 → 1.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.
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Gird/Grid.d.ts +9 -3
- package/dist/cjs/types/components/Gird/mockAPI.d.ts +23 -0
- package/dist/cjs/types/hooks/usePagination.d.ts +13 -0
- package/dist/cjs/types/hooks/useSorting.d.ts +13 -0
- package/dist/cjs/types/index.d.ts +2 -0
- package/dist/cjs/types/shared/models/components/common.model.d.ts +4 -0
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Gird/Grid.d.ts +9 -3
- package/dist/esm/types/components/Gird/mockAPI.d.ts +23 -0
- package/dist/esm/types/hooks/usePagination.d.ts +13 -0
- package/dist/esm/types/hooks/useSorting.d.ts +13 -0
- package/dist/esm/types/index.d.ts +2 -0
- package/dist/esm/types/shared/models/components/common.model.d.ts +4 -0
- package/dist/index.d.ts +73 -36
- package/package.json +1 -1
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ColumnDef, OnChangeFn, SortingState } from "@tanstack/react-table";
|
|
3
|
-
|
|
2
|
+
import { ColumnDef, OnChangeFn, SortingState, PaginationState } from "@tanstack/react-table";
|
|
3
|
+
import { PaginationProps } from "../../shared/models/components/common.model";
|
|
4
|
+
export declare function Table({ data, columns, sorting, onSortingChange, pagination, onPaginationChange, totalRecords, isManualPagination, isManualSorting, }: {
|
|
4
5
|
data: any[];
|
|
5
6
|
columns: ColumnDef<any>[];
|
|
6
7
|
sorting?: any;
|
|
7
|
-
|
|
8
|
+
onSortingChange?: OnChangeFn<SortingState> | undefined;
|
|
9
|
+
pagination?: PaginationProps;
|
|
10
|
+
onPaginationChange?: OnChangeFn<PaginationState> | undefined;
|
|
11
|
+
totalRecords?: number;
|
|
12
|
+
isManualPagination?: boolean;
|
|
13
|
+
isManualSorting?: boolean;
|
|
8
14
|
}): React.JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare function mockAPI({ pagination: { limit, skip }, sort: { field, order }, }?: {
|
|
2
|
+
pagination?: {
|
|
3
|
+
limit?: number | undefined;
|
|
4
|
+
skip?: number | undefined;
|
|
5
|
+
} | undefined;
|
|
6
|
+
sort?: {
|
|
7
|
+
field?: string | undefined;
|
|
8
|
+
order?: string | undefined;
|
|
9
|
+
} | undefined;
|
|
10
|
+
}): {
|
|
11
|
+
res: Promise<unknown>;
|
|
12
|
+
abort: () => void;
|
|
13
|
+
};
|
|
14
|
+
export declare function useMockAPI(query?: string, { pagination: { limit, skip }, sort: { field, order }, }?: {
|
|
15
|
+
pagination?: {
|
|
16
|
+
limit?: number | undefined;
|
|
17
|
+
skip?: number | undefined;
|
|
18
|
+
} | undefined;
|
|
19
|
+
sort?: {
|
|
20
|
+
field?: string | undefined;
|
|
21
|
+
order?: string | undefined;
|
|
22
|
+
} | undefined;
|
|
23
|
+
}): (number | boolean | never[])[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare function usePagination(): {
|
|
3
|
+
limit: number;
|
|
4
|
+
onPaginationChange: import("react").Dispatch<import("react").SetStateAction<{
|
|
5
|
+
pageSize: number;
|
|
6
|
+
pageIndex: number;
|
|
7
|
+
}>>;
|
|
8
|
+
pagination: {
|
|
9
|
+
pageSize: number;
|
|
10
|
+
pageIndex: number;
|
|
11
|
+
};
|
|
12
|
+
skip: number;
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare function useSorting(initialField?: string, initialOrder?: string): {
|
|
3
|
+
sorting: {
|
|
4
|
+
id: string;
|
|
5
|
+
desc: boolean;
|
|
6
|
+
}[];
|
|
7
|
+
onSortingChange: import("react").Dispatch<import("react").SetStateAction<{
|
|
8
|
+
id: string;
|
|
9
|
+
desc: boolean;
|
|
10
|
+
}[]>>;
|
|
11
|
+
order: string;
|
|
12
|
+
field: string;
|
|
13
|
+
};
|
|
@@ -9,3 +9,5 @@ export { DropdownSearchProps } from "./shared/models/components/common.model";
|
|
|
9
9
|
export { BtnOptionDropdown } from "./shared/models/components/common.model";
|
|
10
10
|
export { OptionProps } from "./shared/models/components/common.model";
|
|
11
11
|
export { ColumnDef, SortingState } from "@tanstack/react-table";
|
|
12
|
+
export { usePagination } from "./hooks/usePagination";
|
|
13
|
+
export { useSorting } from "./hooks/useSorting";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
|
+
import React__default, { InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes, FC, ReactNode } from 'react';
|
|
4
|
+
import { ColumnDef, OnChangeFn, SortingState, PaginationState } from '@tanstack/react-table';
|
|
3
5
|
export { ColumnDef, SortingState } from '@tanstack/react-table';
|
|
4
6
|
|
|
5
7
|
type AlignmentType = "center" | "left" | "right";
|
|
@@ -266,6 +268,10 @@ interface ButtonGroupProps {
|
|
|
266
268
|
isAdditionalErrorInput?: boolean;
|
|
267
269
|
additionalErrorClasses?: string;
|
|
268
270
|
}
|
|
271
|
+
interface PaginationProps {
|
|
272
|
+
pageSize: number;
|
|
273
|
+
pageIndex: number;
|
|
274
|
+
}
|
|
269
275
|
|
|
270
276
|
type VariantTypes = "large" | "small" | "extraSmall" | "largeOutlined" | "smallOutlined" | "extraSmallOutlined" | "default" | "defaultOutlined" | "primaryBlue" | "primaryWhite" | "primaryWhiteSelected" | "primaryWhiteNoBoader" | undefined;
|
|
271
277
|
interface IButtonProps extends IChildrenProp, IAdditionalClassesProp, IIconTypeProp, IOnClickEventProps {
|
|
@@ -622,19 +628,19 @@ interface TooltipProps {
|
|
|
622
628
|
showTooltip?: boolean;
|
|
623
629
|
}
|
|
624
630
|
|
|
625
|
-
declare const Button: ({ type, isDisabled, buttonLabel, iconType, iconColor, iconAlignment, isIconEnabled, variants, additionalClasses, iconClass, onClick, }: IButtonProps) =>
|
|
631
|
+
declare const Button: ({ type, isDisabled, buttonLabel, iconType, iconColor, iconAlignment, isIconEnabled, variants, additionalClasses, iconClass, onClick, }: IButtonProps) => React__default.JSX.Element;
|
|
626
632
|
|
|
627
633
|
/**
|
|
628
634
|
* Primary UI component
|
|
629
635
|
*/
|
|
630
|
-
declare const Typhography: ({ type, component, color, additionalClasses, children, onClick, ...rest }: ITyphographyProps) =>
|
|
636
|
+
declare const Typhography: ({ type, component, color, additionalClasses, children, onClick, ...rest }: ITyphographyProps) => React__default.JSX.Element;
|
|
631
637
|
|
|
632
|
-
declare const Checkbox:
|
|
638
|
+
declare const Checkbox: React__default.FC<ICheckboxProps>;
|
|
633
639
|
|
|
634
640
|
/**
|
|
635
641
|
* Primary UI component for user interaction
|
|
636
642
|
*/
|
|
637
|
-
declare const InputValidation:
|
|
643
|
+
declare const InputValidation: React__default.FC<IInputValidationProps>;
|
|
638
644
|
|
|
639
645
|
/**
|
|
640
646
|
* Primary UI component for user interaction
|
|
@@ -644,79 +650,79 @@ declare const Input: FC<IHookFormsInputProps>;
|
|
|
644
650
|
/**
|
|
645
651
|
* Primary UI component for user interaction
|
|
646
652
|
*/
|
|
647
|
-
declare const Label:
|
|
653
|
+
declare const Label: React__default.FC<ILabelProps>;
|
|
648
654
|
|
|
649
655
|
/**
|
|
650
656
|
* Primary UI component for user interaction
|
|
651
657
|
*/
|
|
652
|
-
declare const Select:
|
|
658
|
+
declare const Select: React__default.FC<ISelectProps>;
|
|
653
659
|
|
|
654
660
|
/**
|
|
655
661
|
* Primary UI component for user interaction
|
|
656
662
|
*/
|
|
657
|
-
declare const RadioButton:
|
|
663
|
+
declare const RadioButton: React__default.FC<IRadioProps>;
|
|
658
664
|
|
|
659
665
|
/**
|
|
660
666
|
* Primary UI component for user interaction
|
|
661
667
|
*/
|
|
662
|
-
declare const Textarea:
|
|
668
|
+
declare const Textarea: React__default.FC<IInputProps>;
|
|
663
669
|
|
|
664
670
|
/**
|
|
665
671
|
* Primary UI component for user interaction
|
|
666
672
|
*/
|
|
667
673
|
declare const IconInput: FC<IHookFormsInputProps>;
|
|
668
674
|
|
|
669
|
-
declare const ImageInput:
|
|
675
|
+
declare const ImageInput: React__default.FC<ImageInputProps>;
|
|
670
676
|
|
|
671
677
|
/**
|
|
672
678
|
* Primary UI component for user interaction
|
|
673
679
|
*/
|
|
674
|
-
declare const Card:
|
|
680
|
+
declare const Card: React__default.FC<ICardProps>;
|
|
675
681
|
|
|
676
682
|
interface IComponentProps {
|
|
677
683
|
schema: ISchema[];
|
|
678
684
|
children: ReactNode;
|
|
679
685
|
setComponents: (data: IComponent[]) => void;
|
|
680
686
|
}
|
|
681
|
-
declare function DFHFormProvider({ schema, children, setComponents }: IComponentProps):
|
|
687
|
+
declare function DFHFormProvider({ schema, children, setComponents }: IComponentProps): React__default.JSX.Element;
|
|
682
688
|
|
|
683
689
|
/**
|
|
684
690
|
* Primary UI component for user interaction
|
|
685
691
|
*
|
|
686
692
|
* Use SVG for Logo
|
|
687
693
|
*/
|
|
688
|
-
declare const Logo:
|
|
694
|
+
declare const Logo: React__default.FC<LogoProps>;
|
|
689
695
|
|
|
690
|
-
declare const LoadingSpinner:
|
|
696
|
+
declare const LoadingSpinner: React__default.FC<AdditionalClassesProp$1>;
|
|
691
697
|
|
|
692
|
-
declare const NavBar: ({ navigationData, additionalClasses, navItemClick, isEnableLogout, handleLogout, userImage, }: TabNavigationProps) =>
|
|
698
|
+
declare const NavBar: ({ navigationData, additionalClasses, navItemClick, isEnableLogout, handleLogout, userImage, }: TabNavigationProps) => React__default.JSX.Element;
|
|
693
699
|
|
|
694
|
-
declare const Message: ({ type, text }: MessageProps) =>
|
|
700
|
+
declare const Message: ({ type, text }: MessageProps) => React__default.JSX.Element | undefined;
|
|
695
701
|
|
|
696
|
-
declare const Breadcrumb:
|
|
702
|
+
declare const Breadcrumb: React__default.FC<BreadcrumbProps>;
|
|
697
703
|
|
|
698
|
-
declare const ImagePreview:
|
|
704
|
+
declare const ImagePreview: React__default.FC<ImagePreviewProps>;
|
|
699
705
|
|
|
700
|
-
declare const CustomDatePicker:
|
|
706
|
+
declare const CustomDatePicker: React__default.FC<CustomDatePickerProps>;
|
|
701
707
|
|
|
702
708
|
interface RowProps {
|
|
703
|
-
children:
|
|
709
|
+
children: React__default.ReactNode;
|
|
704
710
|
additionalClasses?: string;
|
|
705
711
|
}
|
|
706
|
-
declare const Row:
|
|
712
|
+
declare const Row: React__default.FC<RowProps>;
|
|
707
713
|
|
|
708
|
-
declare const PhoneNumberInput:
|
|
714
|
+
declare const PhoneNumberInput: React__default.FC<PhoneNumberInputProps>;
|
|
709
715
|
|
|
710
716
|
/**
|
|
711
717
|
* Primary UI component for Tooltip
|
|
712
718
|
*/
|
|
713
|
-
declare const Tooltip:
|
|
719
|
+
declare const Tooltip: React__default.FC<TooltipProps>;
|
|
714
720
|
|
|
715
|
-
declare const DialogBox:
|
|
721
|
+
declare const DialogBox: React__default.FC<DialogBoxProps>;
|
|
716
722
|
|
|
717
|
-
declare const Modal:
|
|
723
|
+
declare const Modal: React__default.FC<ModalProps>;
|
|
718
724
|
|
|
719
|
-
declare const CustomFileInput:
|
|
725
|
+
declare const CustomFileInput: React__default.FC<CustomFileInputProps>;
|
|
720
726
|
|
|
721
727
|
interface HeadingProps {
|
|
722
728
|
/**
|
|
@@ -739,13 +745,13 @@ interface HeadingProps {
|
|
|
739
745
|
/**
|
|
740
746
|
* Primary UI component for user interaction
|
|
741
747
|
*/
|
|
742
|
-
declare const Heading:
|
|
748
|
+
declare const Heading: React__default.FC<HeadingProps>;
|
|
743
749
|
|
|
744
|
-
declare const TagSelect:
|
|
750
|
+
declare const TagSelect: React__default.FC<DropdownMultiselectProps>;
|
|
745
751
|
|
|
746
|
-
declare const SearchDropdownWithButton:
|
|
752
|
+
declare const SearchDropdownWithButton: React__default.FC<DropdownSearchProps>;
|
|
747
753
|
|
|
748
|
-
declare const ButtonGroup:
|
|
754
|
+
declare const ButtonGroup: React__default.FC<ButtonGroupProps>;
|
|
749
755
|
|
|
750
756
|
/**
|
|
751
757
|
* Primary UI component for user interaction
|
|
@@ -754,14 +760,19 @@ declare const ButtonGroup: React$1.FC<ButtonGroupProps>;
|
|
|
754
760
|
*
|
|
755
761
|
* File Path : "src/components/core/Media/Icons/Icons.tsx"
|
|
756
762
|
*/
|
|
757
|
-
declare const Icon:
|
|
763
|
+
declare const Icon: React__default.FC<IIconProps>;
|
|
758
764
|
|
|
759
|
-
declare function Table({ data, columns, sorting,
|
|
765
|
+
declare function Table({ data, columns, sorting, onSortingChange, pagination, onPaginationChange, totalRecords, isManualPagination, isManualSorting, }: {
|
|
760
766
|
data: any[];
|
|
761
767
|
columns: ColumnDef<any>[];
|
|
762
768
|
sorting?: any;
|
|
763
|
-
|
|
764
|
-
|
|
769
|
+
onSortingChange?: OnChangeFn<SortingState> | undefined;
|
|
770
|
+
pagination?: PaginationProps;
|
|
771
|
+
onPaginationChange?: OnChangeFn<PaginationState> | undefined;
|
|
772
|
+
totalRecords?: number;
|
|
773
|
+
isManualPagination?: boolean;
|
|
774
|
+
isManualSorting?: boolean;
|
|
775
|
+
}): React__default.JSX.Element;
|
|
765
776
|
|
|
766
777
|
interface UseSchemaProcessorProps {
|
|
767
778
|
schema: ISchema[];
|
|
@@ -771,4 +782,30 @@ declare const useSchemaProcessor: ({ schema, externalSetComponents, }: UseSchema
|
|
|
771
782
|
componentsRtn: IComponent[] | undefined;
|
|
772
783
|
};
|
|
773
784
|
|
|
774
|
-
|
|
785
|
+
declare function usePagination(): {
|
|
786
|
+
limit: number;
|
|
787
|
+
onPaginationChange: React$1.Dispatch<React$1.SetStateAction<{
|
|
788
|
+
pageSize: number;
|
|
789
|
+
pageIndex: number;
|
|
790
|
+
}>>;
|
|
791
|
+
pagination: {
|
|
792
|
+
pageSize: number;
|
|
793
|
+
pageIndex: number;
|
|
794
|
+
};
|
|
795
|
+
skip: number;
|
|
796
|
+
};
|
|
797
|
+
|
|
798
|
+
declare function useSorting(initialField?: string, initialOrder?: string): {
|
|
799
|
+
sorting: {
|
|
800
|
+
id: string;
|
|
801
|
+
desc: boolean;
|
|
802
|
+
}[];
|
|
803
|
+
onSortingChange: React$1.Dispatch<React$1.SetStateAction<{
|
|
804
|
+
id: string;
|
|
805
|
+
desc: boolean;
|
|
806
|
+
}[]>>;
|
|
807
|
+
order: string;
|
|
808
|
+
field: string;
|
|
809
|
+
};
|
|
810
|
+
|
|
811
|
+
export { Breadcrumb, type BtnOptionDropdown, Button, ButtonGroup, Card, Checkbox as CheckBox, DFHFormProvider as ComponentProvider, CustomFileInput, CustomDatePicker as DatePicker, DialogBox, type DropdownSearchProps, Heading, Icon, IconInput, ImageInput, ImagePreview, Input, type InputType, InputValidation, Label, LoadingSpinner, Logo, type LogoProps, Message, type MessageProps, Modal, NavBar, type OptionProps, PhoneNumberInput, RadioButton, Row, SearchDropdownWithButton, Select, Table, TagSelect as TagDropdown, TagSelect, Textarea, Tooltip, Typhography, useSchemaProcessor as UseSchemaProcessor, type VariantTypes, usePagination, useSorting };
|