@inntechcorp/it-design 2.0.0
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/README.md +37 -0
- package/dist/accordion/index.d.ts +14 -0
- package/dist/accordion/item/Item.d.ts +3 -0
- package/dist/accordion/item/styled.components.d.ts +7 -0
- package/dist/accordion/submenu/SubMenu.d.ts +2 -0
- package/dist/accordion/submenu/styled.components.d.ts +11 -0
- package/dist/alert/alert.style.error.d.ts +4 -0
- package/dist/alert/alert.style.info.d.ts +4 -0
- package/dist/alert/alert.style.success.d.ts +4 -0
- package/dist/alert/alert.style.warning.d.ts +4 -0
- package/dist/alert/index.d.ts +6 -0
- package/dist/alert/styled.d.ts +9 -0
- package/dist/alink/index.d.ts +2 -0
- package/dist/alink/styled.d.ts +5 -0
- package/dist/back-top/index.d.ts +1 -0
- package/dist/back-top/styled.components.d.ts +6 -0
- package/dist/button/button.style.SVG.d.ts +4 -0
- package/dist/button/button.style.circle.d.ts +4 -0
- package/dist/button/button.style.default.d.ts +4 -0
- package/dist/button/button.style.filled.d.ts +4 -0
- package/dist/button/button.style.ghost.d.ts +4 -0
- package/dist/button/button.style.icon.d.ts +5 -0
- package/dist/button/button.style.link.d.ts +4 -0
- package/dist/button/button.style.outline.d.ts +4 -0
- package/dist/button/button.style.size.d.ts +4 -0
- package/dist/button/button.style.solid.d.ts +4 -0
- package/dist/button/button.style.strecth.d.ts +4 -0
- package/dist/button/index.d.ts +3 -0
- package/dist/button/styled.components.d.ts +15 -0
- package/dist/checkbox/group/index.d.ts +4 -0
- package/dist/checkbox/group/styled.d.ts +3 -0
- package/dist/checkbox/index.d.ts +10 -0
- package/dist/checkbox/styled.d.ts +9 -0
- package/dist/context/ITDContext.d.ts +23 -0
- package/dist/enums/enum.d.ts +41 -0
- package/dist/form/context/FormContext.d.ts +32 -0
- package/dist/form/context/FormStore.d.ts +11 -0
- package/dist/form/control/Control.d.ts +6 -0
- package/dist/form/control/styled.d.ts +3 -0
- package/dist/form/group/Group.d.ts +16 -0
- package/dist/form/group/styled.components.d.ts +5 -0
- package/dist/form/index.d.ts +20 -0
- package/dist/form/item/Item.d.ts +18 -0
- package/dist/form/validation/TCIdentity.d.ts +1 -0
- package/dist/form/validation/Validator.d.ts +14 -0
- package/dist/form/wrapper/FormWrapper.d.ts +15 -0
- package/dist/helpers/array/ChunkArray.d.ts +7 -0
- package/dist/helpers/aspectratio/DetermineNewHeight.d.ts +1 -0
- package/dist/helpers/aspectratio/DetermineNewWidth.d.ts +1 -0
- package/dist/helpers/binary/FormatBytes.d.ts +1 -0
- package/dist/helpers/binary/GetTypeByFileType.d.ts +2 -0
- package/dist/helpers/checker/CheckFileURL.d.ts +1 -0
- package/dist/helpers/checker/FileChecker.d.ts +7 -0
- package/dist/helpers/country/GetCountryCodeByCurrencyCode.d.ts +1 -0
- package/dist/helpers/country/GetCountryCodeByLanguage.d.ts +1 -0
- package/dist/helpers/css/FindSelector.d.ts +1 -0
- package/dist/helpers/currency/ConvertCurrency.d.ts +1 -0
- package/dist/helpers/currency/GetByCurrency.d.ts +1 -0
- package/dist/helpers/currency/GetCurrencyFormat.d.ts +1 -0
- package/dist/helpers/currency/GetCurrencySymbol.d.ts +1 -0
- package/dist/helpers/currency/GetDecimalByCurrency.d.ts +1 -0
- package/dist/helpers/index.d.ts +22 -0
- package/dist/helpers/json/IsValidJSON.d.ts +1 -0
- package/dist/helpers/math/AddZero.d.ts +1 -0
- package/dist/helpers/promise/Wait.d.ts +1 -0
- package/dist/helpers/remover/RemoveUnits.d.ts +1 -0
- package/dist/helpers/string/UniUpperCase.d.ts +6 -0
- package/dist/helpers/theme/AddDefaultThemeStyle.d.ts +4 -0
- package/dist/helpers/theme/UpdateThemeStyle.d.ts +5 -0
- package/dist/helpers/url/ValidURL.d.ts +1 -0
- package/dist/hooks/index.d.ts +13 -0
- package/dist/hooks/useAddExternalCSS.d.ts +14 -0
- package/dist/hooks/useComponentSize.d.ts +6 -0
- package/dist/hooks/useConnectionStatus.d.ts +10 -0
- package/dist/hooks/useConstructor.d.ts +11 -0
- package/dist/hooks/useCoreFetch.d.ts +37 -0
- package/dist/hooks/useCreateDynamicStyle.d.ts +10 -0
- package/dist/hooks/useCreateStyledStyle.d.ts +13 -0
- package/dist/hooks/useMultiQuery.d.ts +7 -0
- package/dist/hooks/useOnClickOutside.d.ts +12 -0
- package/dist/hooks/useOnESCKeyDown.d.ts +10 -0
- package/dist/hooks/useOnResize.d.ts +10 -0
- package/dist/hooks/useReCaptcha.d.ts +7 -0
- package/dist/hooks/useSingleQuery.d.ts +3 -0
- package/dist/icons/Arrow.d.ts +6 -0
- package/dist/icons/BackToTop.d.ts +6 -0
- package/dist/icons/Checkmark.d.ts +6 -0
- package/dist/icons/InlineSelectArrow.d.ts +6 -0
- package/dist/icons/Lock.d.ts +6 -0
- package/dist/icons/Picture.d.ts +6 -0
- package/dist/icons/Trash.d.ts +6 -0
- package/dist/icons/Upload.d.ts +6 -0
- package/dist/icons/ZoomIn.d.ts +6 -0
- package/dist/icons/ZoomOut.d.ts +6 -0
- package/dist/icons/index.d.ts +10 -0
- package/dist/index.cjs.js +971 -0
- package/dist/index.d.mts +73 -0
- package/dist/index.d.ts +1120 -0
- package/dist/index.esm.js +971 -0
- package/dist/input/index.d.ts +9 -0
- package/dist/input/styled.components.d.ts +36 -0
- package/dist/modal/container/ModalContainer.d.ts +12 -0
- package/dist/modal/container/styled.components.d.ts +6 -0
- package/dist/modal/context/ModalContext.d.ts +64 -0
- package/dist/modal/index.d.ts +14 -0
- package/dist/modal/modal/Modal.d.ts +9 -0
- package/dist/modal/modal/styled.components.d.ts +24 -0
- package/dist/notification/context/NotificationsContext.d.ts +8 -0
- package/dist/notification/index.d.ts +14 -0
- package/dist/result/index.d.ts +15 -0
- package/dist/result/styled.components.d.ts +17 -0
- package/dist/select/index.d.ts +10 -0
- package/dist/select/menu/Menu.d.ts +13 -0
- package/dist/select/menu/styled.components.d.ts +12 -0
- package/dist/select/option/Option.d.ts +16 -0
- package/dist/select/option/styled.components.d.ts +6 -0
- package/dist/select/style.settings.d.ts +17 -0
- package/dist/select/styled.components.d.ts +5 -0
- package/dist/select/toggle/Toggle.d.ts +17 -0
- package/dist/select/toggle/label/floating/FloatingLabel.d.ts +9 -0
- package/dist/select/toggle/label/floating/styled.components.d.ts +9 -0
- package/dist/select/toggle/label/single/SingleLabel.d.ts +8 -0
- package/dist/select/toggle/label/single/styled.components.d.ts +7 -0
- package/dist/select/toggle/styled.components.d.ts +29 -0
- package/dist/spin/index.d.ts +8 -0
- package/dist/spin/styled.components.d.ts +10 -0
- package/dist/stories/Accordion.d.ts +6 -0
- package/dist/stories/Accordion.stories.d.ts +20 -0
- package/dist/stories/Alert.d.ts +2 -0
- package/dist/stories/Alert.stories.d.ts +21 -0
- package/dist/stories/Button.d.ts +3 -0
- package/dist/stories/Button.stories.d.ts +27 -0
- package/dist/stories/ButtonIcon.d.ts +2 -0
- package/dist/stories/Checkbox.d.ts +2 -0
- package/dist/stories/Checkbox.stories.d.ts +21 -0
- package/dist/stories/CheckboxGroup.d.ts +2 -0
- package/dist/stories/CheckboxGroup.stories.d.ts +21 -0
- package/dist/stories/Form.d.ts +2 -0
- package/dist/stories/Form.stories.d.ts +20 -0
- package/dist/stories/Header.d.ts +3 -0
- package/dist/stories/Header.stories.d.ts +19 -0
- package/dist/stories/Input.d.ts +3 -0
- package/dist/stories/Input.stories.d.ts +22 -0
- package/dist/stories/ModalManager.d.ts +3 -0
- package/dist/stories/ModalManager.stories.d.ts +21 -0
- package/dist/stories/Page.d.ts +3 -0
- package/dist/stories/Page.stories.d.ts +13 -0
- package/dist/stories/Upload.d.ts +2 -0
- package/dist/stories/Upload.stories.d.ts +20 -0
- package/dist/stories/root/index.d.ts +6 -0
- package/dist/switch/index.d.ts +4 -0
- package/dist/switch/styled.d.ts +6 -0
- package/dist/tinyscrollbar/index.d.ts +7 -0
- package/dist/tinyscrollbar/scroll.styled.d.ts +3 -0
- package/dist/tinyscrollbar/styled.components.d.ts +7 -0
- package/dist/types/AccordionItemProps.d.ts +8 -0
- package/dist/types/AccordionProps.d.ts +12 -0
- package/dist/types/AccordionSubMenuProps.d.ts +17 -0
- package/dist/types/AlertProps.d.ts +11 -0
- package/dist/types/ButtonProps.d.ts +41 -0
- package/dist/types/CheckboxProps.d.ts +38 -0
- package/dist/types/ChildrenProps.d.ts +1 -0
- package/dist/types/FormProps.d.ts +50 -0
- package/dist/types/ITDImperativeFuncProps.d.ts +10 -0
- package/dist/types/InputProps.d.ts +33 -0
- package/dist/types/ModalProps.d.ts +190 -0
- package/dist/types/NotificationsProps.d.ts +9 -0
- package/dist/types/SelectProps.d.ts +25 -0
- package/dist/types/SingleQueryProps.d.ts +6 -0
- package/dist/types/SwitchProps.d.ts +10 -0
- package/dist/types/UploadProps.d.ts +41 -0
- package/dist/upload/index.d.ts +14 -0
- package/dist/upload/styled.d.ts +40 -0
- package/package.json +183 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StoryObj } from "@storybook/react";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: import("react").FC<any>;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {};
|
|
11
|
+
args: {
|
|
12
|
+
name: string;
|
|
13
|
+
initialValues: {};
|
|
14
|
+
useQueryString: boolean;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
export declare const Simple: Story;
|
|
20
|
+
export declare const PreDefined: Story;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StoryObj } from "@storybook/react";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: import("react").FC<any>;
|
|
6
|
+
tags: string[];
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
args: {
|
|
11
|
+
onLogin: import("@vitest/spy").Mock<any, any>;
|
|
12
|
+
onLogout: import("@vitest/spy").Mock<any, any>;
|
|
13
|
+
onCreateAccount: import("@vitest/spy").Mock<any, any>;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default meta;
|
|
17
|
+
type Story = StoryObj<typeof meta>;
|
|
18
|
+
export declare const LoggedIn: Story;
|
|
19
|
+
export declare const LoggedOut: Story;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StoryObj } from "@storybook/react";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: import("react").FC<any>;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {};
|
|
11
|
+
args: {
|
|
12
|
+
onClick: import("@vitest/spy").Mock<any, any>;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
export declare const Default: Story;
|
|
18
|
+
export declare const MaskFormat: Story;
|
|
19
|
+
export declare const Outline: Story;
|
|
20
|
+
export declare const Ghost: Story;
|
|
21
|
+
export declare const Link: Story;
|
|
22
|
+
export declare const Small: Story;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StoryObj } from "@storybook/react";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: import("react").FC<any>;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {};
|
|
11
|
+
args: {};
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
export declare const FullFeatured: Story;
|
|
16
|
+
export declare const Title: Story;
|
|
17
|
+
export declare const CustomButtonTexts: Story;
|
|
18
|
+
export declare const CustomWidth: Story;
|
|
19
|
+
export declare const CustomButtonHandlers: Story;
|
|
20
|
+
export declare const OnlyCloseWithEvent: Story;
|
|
21
|
+
export declare const AddContentBeforeAndAfter: Story;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StoryObj } from "@storybook/react";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: import("react").FC;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const LoggedOut: Story;
|
|
13
|
+
export declare const LoggedIn: Story;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StoryObj } from "@storybook/react";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: import("react").FC<any>;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {};
|
|
11
|
+
args: {
|
|
12
|
+
onClick: import("@vitest/spy").Mock<any, any>;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
export declare const PreDefined: Story;
|
|
18
|
+
export declare const Disabled: Story;
|
|
19
|
+
export declare const NoDefinedFile: Story;
|
|
20
|
+
export declare const Error: Story;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const Thumb: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
3
|
+
declare const Body: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
|
+
declare const Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
5
|
+
declare const ErrorTooltip: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
6
|
+
export { Wrapper, ErrorTooltip, Body, Thumb };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ChildrenProps } from 'types/ChildrenProps.js';
|
|
2
|
+
type TinyScrollbarProps = {
|
|
3
|
+
className: string;
|
|
4
|
+
children: ChildrenProps;
|
|
5
|
+
};
|
|
6
|
+
export default function TinyScrollbar({ className, children }: TinyScrollbarProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const ScrollWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
export { ScrollWrapper };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
3
|
+
$scrollbar?: string | undefined;
|
|
4
|
+
$track?: string | undefined;
|
|
5
|
+
$vertical?: string | undefined;
|
|
6
|
+
}>> & string;
|
|
7
|
+
export { Wrapper };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ChildrenProps } from "./ChildrenProps";
|
|
2
|
+
export type AccordionProps = {
|
|
3
|
+
useLink?: boolean;
|
|
4
|
+
onlyOne?: boolean;
|
|
5
|
+
subMenuLinkArrow?: boolean;
|
|
6
|
+
subMenuHeight?: number;
|
|
7
|
+
itemHeight?: number;
|
|
8
|
+
iconSize?: number;
|
|
9
|
+
arrowSize?: number;
|
|
10
|
+
onChange?: null | ((id: string) => void);
|
|
11
|
+
children: ChildrenProps;
|
|
12
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ChildrenProps } from "./ChildrenProps";
|
|
2
|
+
export type AccordionSubMenuProps = {
|
|
3
|
+
id: string;
|
|
4
|
+
link: string;
|
|
5
|
+
title: string;
|
|
6
|
+
icon?: string | JSX.Element;
|
|
7
|
+
isSelected?: boolean;
|
|
8
|
+
useLink?: boolean;
|
|
9
|
+
onlyOne?: boolean;
|
|
10
|
+
subMenuLinkArrow?: boolean;
|
|
11
|
+
subMenuHeight?: number;
|
|
12
|
+
itemHeight?: number;
|
|
13
|
+
iconSize?: number;
|
|
14
|
+
arrowSize?: number;
|
|
15
|
+
onChange?: (id: string) => void;
|
|
16
|
+
children?: ChildrenProps;
|
|
17
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ChildrenProps } from "./ChildrenProps";
|
|
2
|
+
export type AlertProps = {
|
|
3
|
+
type?: AlertType;
|
|
4
|
+
size?: AlertSize;
|
|
5
|
+
icon?: string | ChildrenProps | SVGElement;
|
|
6
|
+
title?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
children?: ChildrenProps;
|
|
9
|
+
};
|
|
10
|
+
export type AlertType = "success" | "info" | "warning" | "error";
|
|
11
|
+
export type AlertSize = "x-small" | "small" | "medium" | "default" | "large" | "x-large";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DetailedHTMLProps, HTMLAttributes, MouseEvent } from "react";
|
|
2
|
+
import { ChildrenProps } from "./ChildrenProps";
|
|
3
|
+
import { IStyledComponent } from "styled-components";
|
|
4
|
+
import { Substitute } from "styled-components/dist/types";
|
|
5
|
+
export type ButtonProps = {
|
|
6
|
+
id?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
selected?: boolean;
|
|
10
|
+
strecth?: boolean;
|
|
11
|
+
circle?: boolean;
|
|
12
|
+
justify?: string;
|
|
13
|
+
contentPosition?: ButtonContentPosition;
|
|
14
|
+
type?: ButtonType;
|
|
15
|
+
variant?: ButtonVariant;
|
|
16
|
+
state?: ButtonState;
|
|
17
|
+
size?: ButtonSize;
|
|
18
|
+
icon?: string | ChildrenProps | SVGElement;
|
|
19
|
+
href?: string;
|
|
20
|
+
target?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
children?: ChildrenProps;
|
|
23
|
+
onClick?: null | ((event: MouseEvent<any>) => void);
|
|
24
|
+
};
|
|
25
|
+
export type ButtonType = "button" | "submit" | "reset";
|
|
26
|
+
export type ButtonVariant = "default" | "solid" | "filled" | "outline" | "ghost" | "link" | "statable" | "custom";
|
|
27
|
+
export type ButtonState = "primary" | "secondary" | "request" | "approve" | "reject" | "pending" | "requested" | string | null;
|
|
28
|
+
export type ButtonSize = "x-small" | "small" | "medium" | "default" | "large" | "x-large";
|
|
29
|
+
export type ButtonContentPosition = "left" | "right";
|
|
30
|
+
export type StyledElementProps = IStyledComponent<"web", Substitute<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any>>;
|
|
31
|
+
export interface IIcon {
|
|
32
|
+
$useIconPadding?: boolean;
|
|
33
|
+
$contentPosition?: string;
|
|
34
|
+
$justify?: string;
|
|
35
|
+
children?: ChildrenProps;
|
|
36
|
+
}
|
|
37
|
+
export interface ISVG {
|
|
38
|
+
$singleIcon: boolean;
|
|
39
|
+
$contentPosition: string | undefined;
|
|
40
|
+
$justify: string | undefined;
|
|
41
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ReactElement, RefObject } from "react";
|
|
2
|
+
import { ChildrenProps } from "./ChildrenProps";
|
|
3
|
+
export type CheckboxProps = {
|
|
4
|
+
id?: string;
|
|
5
|
+
value?: string | number | boolean;
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
indeterminate?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
children?: ChildrenProps;
|
|
11
|
+
onChange?: ((event: CheckboxEvent) => void);
|
|
12
|
+
onUpdate?: ((value: any, update: any, validation: boolean) => void);
|
|
13
|
+
};
|
|
14
|
+
export type CheckboxGroupProps = {
|
|
15
|
+
value?: (string | number | boolean)[];
|
|
16
|
+
defaultValue?: (string | number)[];
|
|
17
|
+
options?: GroupCheckboxOptionType[];
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
className?: string;
|
|
20
|
+
children?: ChildrenProps | ReactElement<CheckboxProps> | Array<ReactElement<CheckboxProps>>;
|
|
21
|
+
selectAll?: (value: boolean) => void;
|
|
22
|
+
onChange?: ((values: (string | number | boolean)[]) => void);
|
|
23
|
+
onUpdate?: ((value: (string | number | boolean)[], update: any, validation: boolean) => void);
|
|
24
|
+
};
|
|
25
|
+
export type GroupCheckboxOptionType = {
|
|
26
|
+
label: string;
|
|
27
|
+
value: string | number | boolean;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
};
|
|
30
|
+
export type CheckboxEvent = {
|
|
31
|
+
checked: boolean;
|
|
32
|
+
value?: string | number | boolean;
|
|
33
|
+
className: string;
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
target: RefObject<HTMLInputElement>;
|
|
36
|
+
stopPropagation: () => void;
|
|
37
|
+
preventDefault: () => void;
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ChildrenProps = string | JSX.Element | JSX.Element[] | null;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { FormValidationTypes } from "enums/enum";
|
|
2
|
+
import { RefObject } from "react";
|
|
3
|
+
import { ChildrenProps } from "types/ChildrenProps";
|
|
4
|
+
import { ITDImperativeFuncProps } from "../index";
|
|
5
|
+
import { FormStoreProps } from "../form/context/FormStore";
|
|
6
|
+
import { FormContextType } from "../form/context/FormContext";
|
|
7
|
+
import { Item, Group, Control } from "../form";
|
|
8
|
+
export type FormProps = {
|
|
9
|
+
initialValues?: {};
|
|
10
|
+
children: ChildrenProps;
|
|
11
|
+
onReset?: () => void;
|
|
12
|
+
onUpdate?: (values: {}) => void;
|
|
13
|
+
onFinish?: (values: {}) => void;
|
|
14
|
+
onFinishFailed?: (values: {}) => void;
|
|
15
|
+
onValidated?: (validate: boolean) => void;
|
|
16
|
+
onFieldUpdate?: (update: FieldUpdateProps) => void;
|
|
17
|
+
useQueryString?: boolean;
|
|
18
|
+
className?: string;
|
|
19
|
+
ref: RefObject<FormContextType>;
|
|
20
|
+
name: string;
|
|
21
|
+
};
|
|
22
|
+
export type FormValueProps = string | number | object | boolean;
|
|
23
|
+
export type FieldUpdateProps = {
|
|
24
|
+
name: string;
|
|
25
|
+
value: FormValueProps;
|
|
26
|
+
valid: boolean;
|
|
27
|
+
};
|
|
28
|
+
export type FormRuleProps = {
|
|
29
|
+
required?: boolean;
|
|
30
|
+
type?: FormValidationTypes;
|
|
31
|
+
field?: string;
|
|
32
|
+
value?: string | number;
|
|
33
|
+
message?: string;
|
|
34
|
+
};
|
|
35
|
+
export type FormItemProps = {
|
|
36
|
+
name: string;
|
|
37
|
+
field: RefObject<ITDImperativeFuncProps>;
|
|
38
|
+
valid: boolean;
|
|
39
|
+
value?: FormValueProps;
|
|
40
|
+
query: string;
|
|
41
|
+
reset: any[];
|
|
42
|
+
error: string;
|
|
43
|
+
};
|
|
44
|
+
export type FormSubComponentProps = {
|
|
45
|
+
Item: typeof Item;
|
|
46
|
+
Group: typeof Group;
|
|
47
|
+
Control: typeof Control;
|
|
48
|
+
useForm: FormContextType;
|
|
49
|
+
useFormAPI: FormStoreProps;
|
|
50
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ITDImperativeFuncProps = {
|
|
2
|
+
reset: (update?: boolean, validation?: boolean) => void;
|
|
3
|
+
setValue: (value: any, update?: boolean, validation?: boolean) => void;
|
|
4
|
+
getValue: () => any;
|
|
5
|
+
setError: (message: string) => void;
|
|
6
|
+
setFocus?: () => void;
|
|
7
|
+
setDisabled?: (value: boolean) => void;
|
|
8
|
+
forceUpdate?: () => void;
|
|
9
|
+
clear: () => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FocusEventHandler, KeyboardEvent, MutableRefObject } from "react";
|
|
2
|
+
import { ChildrenProps } from "./ChildrenProps";
|
|
3
|
+
export type InputProps = {
|
|
4
|
+
id?: string;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
type?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
size?: string;
|
|
11
|
+
variant?: string;
|
|
12
|
+
prefix?: ChildrenProps;
|
|
13
|
+
suffix?: ChildrenProps;
|
|
14
|
+
addonBefore?: ChildrenProps;
|
|
15
|
+
addonAfter?: ChildrenProps;
|
|
16
|
+
locked?: ChildrenProps | boolean;
|
|
17
|
+
status?: ChildrenProps;
|
|
18
|
+
maxLength?: number;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
floating?: boolean;
|
|
21
|
+
autoComplete?: boolean;
|
|
22
|
+
keepFocus?: boolean;
|
|
23
|
+
focusRef?: null | MutableRefObject<HTMLDivElement>;
|
|
24
|
+
mask?: null | string;
|
|
25
|
+
allowEmptyFormatting?: null | boolean;
|
|
26
|
+
onChange?: ((value: any) => void) | null;
|
|
27
|
+
onUpdate?: ((value: any, update: any, validation: boolean) => void) | null;
|
|
28
|
+
onFocus?: ((event: any) => void) | null;
|
|
29
|
+
onBlur?: ((event: FocusEventHandler<HTMLInputElement>) => void) | null;
|
|
30
|
+
onPressEnter?: ((event: KeyboardEvent) => void) | null;
|
|
31
|
+
onKeyDown?: ((event: KeyboardEvent) => void) | null;
|
|
32
|
+
children?: ChildrenProps;
|
|
33
|
+
};
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { ButtonProps } from "./ButtonProps";
|
|
2
|
+
import { ChildrenProps } from "./ChildrenProps";
|
|
3
|
+
/**
|
|
4
|
+
* #### ModalProps
|
|
5
|
+
*
|
|
6
|
+
* The properties passed when opening a new modal. The `showModal`
|
|
7
|
+
* function requires certain properties to open a new modal.
|
|
8
|
+
*/
|
|
9
|
+
export type ModalProps = {
|
|
10
|
+
/**
|
|
11
|
+
* Modal ID. Used for listening to modal events.
|
|
12
|
+
*/
|
|
13
|
+
id?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Modal Title.
|
|
16
|
+
*/
|
|
17
|
+
title?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Modal Width.
|
|
20
|
+
*/
|
|
21
|
+
width?: string | number;
|
|
22
|
+
/**
|
|
23
|
+
* Close modal when overlay is clicked.
|
|
24
|
+
*/
|
|
25
|
+
closeOnClickOutside?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Prevents modal from closing when ESC key is pressed.
|
|
28
|
+
*/
|
|
29
|
+
preventESC?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Show/hide OK button.
|
|
32
|
+
*/
|
|
33
|
+
showOkButton?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Show/hide Cancel button.
|
|
36
|
+
*/
|
|
37
|
+
showCancelButton?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Show/hide close button on the top right corner of the modal.
|
|
40
|
+
*/
|
|
41
|
+
showCloseButton?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Text for the OK button.
|
|
44
|
+
*/
|
|
45
|
+
okButtonText?: string;
|
|
46
|
+
/**
|
|
47
|
+
* The cancel button props.
|
|
48
|
+
*/
|
|
49
|
+
cancelButtonText?: string;
|
|
50
|
+
/**
|
|
51
|
+
* The ok button props.
|
|
52
|
+
*/
|
|
53
|
+
okButtonProps?: ButtonProps | null;
|
|
54
|
+
/**
|
|
55
|
+
* ModalProps for the Cancel button.
|
|
56
|
+
*/
|
|
57
|
+
cancelButtonProps?: ButtonProps | null;
|
|
58
|
+
/**
|
|
59
|
+
* Custom properties to be passed to the modal.
|
|
60
|
+
*/
|
|
61
|
+
customProps?: {} | any;
|
|
62
|
+
/**
|
|
63
|
+
* Custom context to be passed to the modal.
|
|
64
|
+
*/
|
|
65
|
+
context?: {} | any;
|
|
66
|
+
/**
|
|
67
|
+
* Called when the OK button is clicked. If this
|
|
68
|
+
* function is defined, a ModalEvent is triggered,
|
|
69
|
+
* but the modal does not automatically close.
|
|
70
|
+
* @returns
|
|
71
|
+
*/
|
|
72
|
+
onOk?: (() => boolean | null) | null;
|
|
73
|
+
/**
|
|
74
|
+
* Called when the Cancel button is clicked. If this
|
|
75
|
+
* function is defined, a ModalEvent is triggered,
|
|
76
|
+
* but the modal does not automatically close.
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
79
|
+
onCancel?: (() => boolean | null) | null;
|
|
80
|
+
/**
|
|
81
|
+
* ModalManager can find its own ref, but some libraries
|
|
82
|
+
* (@loadable, React.lazy, etc.) may have their own ref values,
|
|
83
|
+
* which can prevent ModalManager from passing parameters and
|
|
84
|
+
* accessing the actual ref. In such cases, if you want the modal
|
|
85
|
+
* to use a ref, meaning you'll use forwardRef with ModalRefProps
|
|
86
|
+
* inside the modal, you should pass "true".
|
|
87
|
+
*/
|
|
88
|
+
useRef?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* ModalManager can find its own ref, but some libraries
|
|
91
|
+
* (@loadable, React.lazy, etc.) may have their own ref
|
|
92
|
+
* values, which can prevent ModalManager from passing
|
|
93
|
+
* parameters and accessing the actual ref. In such cases,
|
|
94
|
+
* this value should remain false. You can only set it to
|
|
95
|
+
* "true" in projects where you are sure that all modals
|
|
96
|
+
* are passed as Function Components.
|
|
97
|
+
*/
|
|
98
|
+
checkAutoRef?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Content of the modal. Any content you want to display in the modal.
|
|
101
|
+
*/
|
|
102
|
+
content: ChildrenProps;
|
|
103
|
+
/**
|
|
104
|
+
* Adds content before the modal's content data.
|
|
105
|
+
*/
|
|
106
|
+
addContentBefore?: ChildrenProps;
|
|
107
|
+
/**
|
|
108
|
+
* Adds content after the modal's content data.
|
|
109
|
+
*/
|
|
110
|
+
addContentAfter?: ChildrenProps;
|
|
111
|
+
/**
|
|
112
|
+
* The padding of the modal content. The default value is "30px 20px".
|
|
113
|
+
*/
|
|
114
|
+
contentPadding?: string;
|
|
115
|
+
/**
|
|
116
|
+
* The padding before the modal content. The default value is "30px 20px 0".
|
|
117
|
+
*/
|
|
118
|
+
beforeContentPadding?: string;
|
|
119
|
+
/**
|
|
120
|
+
* The padding after the modal content. The default value is "0 20px 30px".
|
|
121
|
+
*/
|
|
122
|
+
afterContentPadding?: string;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* #### Modal Content Props
|
|
126
|
+
*
|
|
127
|
+
* These properties can only be accessed from the content data defined within the modal.
|
|
128
|
+
* When the content data is defined as an external class, these properties become accessible.
|
|
129
|
+
*/
|
|
130
|
+
export type ModalContentProps = {
|
|
131
|
+
/**
|
|
132
|
+
* Allows another modal to be opened from within the modal content.
|
|
133
|
+
* @param data Values for the new modal to be opened.
|
|
134
|
+
* @returns
|
|
135
|
+
*/
|
|
136
|
+
showAnotherModal?: (data?: ModalProps) => void;
|
|
137
|
+
/**
|
|
138
|
+
* Closes itself from within the modal content.
|
|
139
|
+
* @returns
|
|
140
|
+
*/
|
|
141
|
+
hideCurrentModal?: () => void;
|
|
142
|
+
/**
|
|
143
|
+
* Changes the buttons disabling state.
|
|
144
|
+
* @param value `true` for regular, `false` for disabled.
|
|
145
|
+
* @returns
|
|
146
|
+
*/
|
|
147
|
+
changeButtonsState?: (value: boolean) => void;
|
|
148
|
+
/**
|
|
149
|
+
* Changes the loading screen state that covers the entire modal.
|
|
150
|
+
* @param value `true` indicates loading, `false` indicates stable state.
|
|
151
|
+
* @returns
|
|
152
|
+
*/
|
|
153
|
+
changeLoadingState?: (value: boolean) => void;
|
|
154
|
+
/**
|
|
155
|
+
* Changes the state that shows only the modal content is loading.
|
|
156
|
+
* @param value `true` indicates loading, `false` indicates stable state.
|
|
157
|
+
* @returns
|
|
158
|
+
*/
|
|
159
|
+
changeInnerLoadingState?: (value: boolean) => void;
|
|
160
|
+
/**
|
|
161
|
+
* Extra parameters passed when the modal is opened.
|
|
162
|
+
*/
|
|
163
|
+
modalProps?: any;
|
|
164
|
+
/**
|
|
165
|
+
* Context data to be used for access within the modal, functioning like `modalProps`.
|
|
166
|
+
*/
|
|
167
|
+
context?: any;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* #### Modal Ref Props
|
|
171
|
+
*
|
|
172
|
+
* It can only be used within the modal content data that utilizes `forwardRef`
|
|
173
|
+
* along with `useImperativeHandle`.
|
|
174
|
+
*/
|
|
175
|
+
export type ModalRefProps = {
|
|
176
|
+
/**
|
|
177
|
+
* If defined, it is triggered when the **OK** button inside the modal is clicked.
|
|
178
|
+
* If you return `false`, it prevents the modal from closing. If you return `true`,
|
|
179
|
+
* the process continues and the modal closes.
|
|
180
|
+
* @returns
|
|
181
|
+
*/
|
|
182
|
+
onClickOK?: () => void;
|
|
183
|
+
/**
|
|
184
|
+
* If defined, it is triggered when the **Cancel** button inside the modal is clicked.
|
|
185
|
+
* If you return `false`, it prevents the modal from closing. If you return `true`,
|
|
186
|
+
* the process continues and the modal closes.
|
|
187
|
+
* @returns
|
|
188
|
+
*/
|
|
189
|
+
onClickCancel?: () => void;
|
|
190
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
export type SelectProps = {
|
|
3
|
+
defaultValue?: string | number;
|
|
4
|
+
value?: string | number;
|
|
5
|
+
label?: string | number;
|
|
6
|
+
position?: string;
|
|
7
|
+
direction?: string;
|
|
8
|
+
mode?: string;
|
|
9
|
+
size?: string;
|
|
10
|
+
variant?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
icon?: string;
|
|
14
|
+
image?: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
locked?: boolean;
|
|
17
|
+
floating?: boolean;
|
|
18
|
+
children?: ReactElement<SelectOptionProps> | Array<ReactElement<SelectOptionProps>>;
|
|
19
|
+
onChange?: ((value: any) => void) | null;
|
|
20
|
+
onUpdate?: ((value: any, update: any, validation: boolean) => void) | null;
|
|
21
|
+
};
|
|
22
|
+
export type SelectOptionProps = {
|
|
23
|
+
value: string;
|
|
24
|
+
text: string;
|
|
25
|
+
};
|