@devtron-labs/devtron-fe-common-lib 0.5.2-beta-7 → 0.5.3
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/Common/Constants.d.ts +0 -3
- package/dist/Common/Hooks/UseRegisterShortcut/UseRegisterShortcutContext.d.ts +1 -1
- package/dist/Common/Hooks/UseRegisterShortcut/UseRegisterShortcutProvider.d.ts +1 -1
- package/dist/Common/Hooks/UseRegisterShortcut/types.d.ts +53 -3
- package/dist/Common/Hooks/UseRegisterShortcut/utils.d.ts +6 -0
- package/dist/Common/Tooltip/index.d.ts +0 -1
- package/dist/Common/Tooltip/types.d.ts +1 -7
- package/dist/Common/Types.d.ts +6 -2
- package/dist/Pages/App/AppConfigurations/index.d.ts +1 -0
- package/dist/Pages/App/AppConfigurations/utils.d.ts +2 -0
- package/dist/Pages/{Applications/DevtronApps/Details → App}/index.d.ts +0 -1
- package/dist/Pages/{Applications/DevtronApps/Details/CDPipeline → CDPipeline}/types.d.ts +4 -4
- package/dist/Pages/index.d.ts +2 -1
- package/dist/Shared/Components/Button/Button.component.d.ts +1 -1
- package/dist/Shared/Components/Button/types.d.ts +0 -6
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryConfigDiff.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryConfigDiffCompare.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/helpers.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/types.d.ts +3 -2
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/utils.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/History.components.d.ts +1 -54
- package/dist/Shared/Components/CICDHistory/LogsRenderer.d.ts +2 -55
- package/dist/Shared/Components/CICDHistory/types.d.ts +2 -1
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.component.d.ts +1 -1
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.types.d.ts +2 -4
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffNavigation.d.ts +1 -1
- package/dist/Shared/Components/SelectPicker/type.d.ts +2 -2
- package/dist/Shared/Components/TabGroup/TabGroup.types.d.ts +1 -9
- package/dist/Shared/Components/index.d.ts +0 -1
- package/dist/Shared/Hooks/useForm/useForm.d.ts +26 -29
- package/dist/Shared/Hooks/useForm/useForm.types.d.ts +8 -15
- package/dist/Shared/Hooks/useForm/useForm.utils.d.ts +1 -1
- package/dist/Shared/Services/app.types.d.ts +22 -35
- package/dist/Shared/constants.d.ts +1 -3
- package/dist/Shared/types.d.ts +0 -12
- package/dist/assets/index.css +1 -1
- package/dist/{cssMode-BzAJNNfO.js → cssMode-9W1buTsV.js} +1 -1
- package/dist/{freemarker2-C5v7rdGk.js → freemarker2-BWe5eRwB.js} +1 -1
- package/dist/{handlebars-Cl_Athu7.js → handlebars-CTfz5kSz.js} +1 -1
- package/dist/{html-BhmbKvsl.js → html-Dvb80ALs.js} +1 -1
- package/dist/{htmlMode-Eh-qZm_q.js → htmlMode-CAsy-Umk.js} +1 -1
- package/dist/{index-B3Nto1wx.js → index-Bb2FTEAc.js} +25214 -25342
- package/dist/index.js +521 -541
- package/dist/{javascript-C9CMizZO.js → javascript-C4IBasJO.js} +1 -1
- package/dist/{jsonMode-CrNdCxMf.js → jsonMode-CQ6vLXYS.js} +1 -1
- package/dist/{liquid-OSTTmxyA.js → liquid-BMWGnzGZ.js} +1 -1
- package/dist/{mdx-Bl4Q7X-Y.js → mdx-B84VbCvk.js} +1 -1
- package/dist/{python-BRbo-lxI.js → python-CkTKI3LV.js} +1 -1
- package/dist/{razor-CH6gsgck.js → razor-C1nzEZOE.js} +1 -1
- package/dist/{tsMode-CD1RkTWx.js → tsMode-VncCnYcl.js} +1 -1
- package/dist/{typescript-CiU-skWG.js → typescript-DCrQdLtl.js} +1 -1
- package/dist/{xml-BKlUFTP7.js → xml-C4BcGdfI.js} +1 -1
- package/dist/{yaml-B98Fk6S4.js → yaml-BKASVM86.js} +1 -1
- package/package.json +1 -2
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/DTApplicationMetricsFormField.d.ts +0 -3
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/constants.d.ts +0 -2
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/index.d.ts +0 -4
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/service.d.ts +0 -4
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/types.d.ts +0 -171
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/OverrideStrategyTippyContent.d.ts +0 -2
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/constants.d.ts +0 -5
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/index.d.ts +0 -5
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/types.d.ts +0 -27
- package/dist/Pages/Applications/DevtronApps/Details/AppConfigurations/utils.d.ts +0 -2
- package/dist/Pages/Applications/DevtronApps/index.d.ts +0 -1
- package/dist/Pages/Applications/index.d.ts +0 -1
- package/dist/Shared/Components/InvalidYAMLTippy/InvalidYAMLTippyWrapper.d.ts +0 -3
- package/dist/Shared/Components/InvalidYAMLTippy/constants.d.ts +0 -1
- package/dist/Shared/Components/InvalidYAMLTippy/index.d.ts +0 -2
- package/dist/Shared/Components/InvalidYAMLTippy/types.d.ts +0 -6
- package/dist/Shared/Components/InvalidYAMLTippy/utils.d.ts +0 -2
- package/dist/Shared/Components/SelectPicker/constants.d.ts +0 -5
- /package/dist/Pages/{Applications/DevtronApps/Details/CDPipeline → CDPipeline}/index.d.ts +0 -0
|
@@ -5,7 +5,6 @@ export declare const DOCUMENTATION_HOME_PAGE = "https://docs.devtron.ai";
|
|
|
5
5
|
export declare const DOCUMENTATION_VERSION = "/v/v0.7";
|
|
6
6
|
export declare const DISCORD_LINK = "https://discord.devtron.ai/";
|
|
7
7
|
export declare const DOCUMENTATION: {
|
|
8
|
-
APP_METRICS: string;
|
|
9
8
|
APP_TAGS: string;
|
|
10
9
|
APP_OVERVIEW_TAGS: string;
|
|
11
10
|
BLOB_STORAGE: string;
|
|
@@ -49,7 +48,6 @@ export declare const URLS: {
|
|
|
49
48
|
export declare const ROUTES: {
|
|
50
49
|
APP: string;
|
|
51
50
|
APP_ARTIFACT_PROMOTE_MATERIAL: string;
|
|
52
|
-
APP_TEMPLATE_DATA: string;
|
|
53
51
|
PROJECT_LIST_MIN: string;
|
|
54
52
|
USER_CHECK_ROLE: string;
|
|
55
53
|
IMAGE_TAGGING: string;
|
|
@@ -252,7 +250,6 @@ export declare const API_STATUS_CODES: {
|
|
|
252
250
|
PERMISSION_DENIED: number;
|
|
253
251
|
NOT_FOUND: number;
|
|
254
252
|
EXPECTATION_FAILED: number;
|
|
255
|
-
LOCKED: number;
|
|
256
253
|
};
|
|
257
254
|
export declare enum SERVER_MODE {
|
|
258
255
|
EA_ONLY = "EA_ONLY",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { UseRegisterShortcutContextType } from './types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const UseRegisterShortcutContext: import('react').Context<UseRegisterShortcutContextType>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { UseRegisterShortcutProviderType } from './types';
|
|
2
|
-
declare const UseRegisterShortcutProvider: ({ children }: UseRegisterShortcutProviderType) => JSX.Element;
|
|
2
|
+
declare const UseRegisterShortcutProvider: ({ ignoreTags, preventDefault, shortcutTimeout, children, }: UseRegisterShortcutProviderType) => JSX.Element;
|
|
3
3
|
export default UseRegisterShortcutProvider;
|
|
@@ -1,7 +1,57 @@
|
|
|
1
|
+
export declare const KEYBOARD_KEYS_MAP: {
|
|
2
|
+
readonly Control: "Ctrl";
|
|
3
|
+
readonly Shift: "⇧";
|
|
4
|
+
readonly Meta: "⌘" | "Win";
|
|
5
|
+
readonly Alt: "⌥" | "Alt";
|
|
6
|
+
readonly F: "F";
|
|
7
|
+
readonly E: "E";
|
|
8
|
+
readonly R: "R";
|
|
9
|
+
readonly K: "K";
|
|
10
|
+
};
|
|
11
|
+
export type SupportedKeyboardKeysType = keyof typeof KEYBOARD_KEYS_MAP;
|
|
12
|
+
export interface ShortcutType {
|
|
13
|
+
keys: SupportedKeyboardKeysType[];
|
|
14
|
+
callbackStack: Array<() => void>;
|
|
15
|
+
description?: string;
|
|
16
|
+
}
|
|
17
|
+
interface RegisterShortcutType extends Pick<ShortcutType, 'keys' | 'description'> {
|
|
18
|
+
callback: ShortcutType['callbackStack'][number];
|
|
19
|
+
}
|
|
1
20
|
export interface UseRegisterShortcutContextType {
|
|
2
|
-
|
|
3
|
-
|
|
21
|
+
/**
|
|
22
|
+
* This method registers a shortcut with its corresponding callback
|
|
23
|
+
*
|
|
24
|
+
* If keys is undefined or null this method will throw an error
|
|
25
|
+
*/
|
|
26
|
+
registerShortcut: (props: RegisterShortcutType) => void;
|
|
27
|
+
/**
|
|
28
|
+
* This method unregisters the provided shortcut if found
|
|
29
|
+
*
|
|
30
|
+
* If keys is undefined or null this method will throw an error
|
|
31
|
+
*/
|
|
32
|
+
unregisterShortcut: (keys: ShortcutType['keys']) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Globally disable all shortcuts with this function
|
|
35
|
+
*/
|
|
36
|
+
setDisableShortcuts: (shouldDisable: boolean) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Programmatically trigger a shortcut if already registered
|
|
39
|
+
*/
|
|
40
|
+
triggerShortcut: (keys: ShortcutType['keys']) => void;
|
|
4
41
|
}
|
|
5
42
|
export interface UseRegisterShortcutProviderType {
|
|
6
|
-
children: React.
|
|
43
|
+
children: React.ReactNode;
|
|
44
|
+
/**
|
|
45
|
+
* Defines how long after holding the keys down do we trigger the callback in milliseconds
|
|
46
|
+
*/
|
|
47
|
+
shortcutTimeout?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Defines which html tags to ignore as source of an event
|
|
50
|
+
*/
|
|
51
|
+
ignoreTags?: string[];
|
|
52
|
+
/**
|
|
53
|
+
* If true, call preventDefault on the event
|
|
54
|
+
*/
|
|
55
|
+
preventDefault?: boolean;
|
|
7
56
|
}
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ShortcutType } from './types';
|
|
2
|
+
export declare const preprocessKeys: (keys: ShortcutType["keys"]) => {
|
|
3
|
+
keys: ("Control" | "Alt" | "F" | "E" | "R" | "K" | "Shift" | "Meta")[];
|
|
4
|
+
id: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const verifyCallbackStack: (stack: ShortcutType["callbackStack"]) => void;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
+
import { SupportedKeyboardKeysType } from '@Common/Hooks/UseRegisterShortcut/types';
|
|
1
2
|
import { TippyProps } from '@tippyjs/react';
|
|
2
|
-
export declare const KEYBOARD_KEYS_MAP: {
|
|
3
|
-
readonly Control: "⌘" | "Ctrl";
|
|
4
|
-
readonly Shift: "⇧";
|
|
5
|
-
readonly F: "F";
|
|
6
|
-
readonly E: "E";
|
|
7
|
-
};
|
|
8
|
-
export type SupportedKeyboardKeysType = keyof typeof KEYBOARD_KEYS_MAP;
|
|
9
3
|
type BaseTooltipProps = {
|
|
10
4
|
/**
|
|
11
5
|
* If true, show tippy on truncate
|
package/dist/Common/Types.d.ts
CHANGED
|
@@ -661,8 +661,6 @@ export interface AppEnvironment {
|
|
|
661
661
|
isProtected?: boolean;
|
|
662
662
|
pipelineId?: number;
|
|
663
663
|
latestCdWorkflowRunnerId?: number;
|
|
664
|
-
commits?: string[];
|
|
665
|
-
ciArtifactId?: number;
|
|
666
664
|
}
|
|
667
665
|
export interface Strategy {
|
|
668
666
|
deploymentTemplate: string;
|
|
@@ -781,6 +779,12 @@ export interface CiPipeline {
|
|
|
781
779
|
isOffendingMandatoryPlugin?: boolean;
|
|
782
780
|
pipelineType?: string;
|
|
783
781
|
}
|
|
782
|
+
export interface DeploymentChartVersionType {
|
|
783
|
+
chartRefId: number;
|
|
784
|
+
chartVersion: string;
|
|
785
|
+
chartType: string;
|
|
786
|
+
type: number;
|
|
787
|
+
}
|
|
784
788
|
export interface ChartVersionAndTypeSelectorProps {
|
|
785
789
|
setSelectedChartRefId: React.Dispatch<React.SetStateAction<number>>;
|
|
786
790
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getDeploymentStageTitle } from './utils';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BuildStageType, FormType } from '
|
|
2
|
-
import { DeploymentAppTypes, UserApprovalConfigType } from '
|
|
3
|
-
import { DeploymentStrategy } from '
|
|
4
|
-
import { EnvListMinDTO } from '
|
|
1
|
+
import { BuildStageType, FormType } from '../../Common/CIPipeline.Types';
|
|
2
|
+
import { DeploymentAppTypes, UserApprovalConfigType } from '../../Common/Types';
|
|
3
|
+
import { DeploymentStrategy } from '../../Shared/Components';
|
|
4
|
+
import { EnvListMinDTO } from '../../Shared/types';
|
|
5
5
|
interface ConfigSecretType {
|
|
6
6
|
label: string;
|
|
7
7
|
value: string;
|
package/dist/Pages/index.d.ts
CHANGED
|
@@ -63,5 +63,5 @@ import { ButtonProps } from './types';
|
|
|
63
63
|
* <Button icon={<ICCube />} ariaLabel="Label" />
|
|
64
64
|
* ```
|
|
65
65
|
*/
|
|
66
|
-
declare const Button: ({ dataTestId, text, variant, size, style, startIcon, endIcon, disabled, isLoading, showTooltip, tooltipProps, icon, ariaLabel, showAriaLabelInTippy,
|
|
66
|
+
declare const Button: ({ dataTestId, text, variant, size, style, startIcon, endIcon, disabled, isLoading, showTooltip, tooltipProps, icon, ariaLabel, showAriaLabelInTippy, ...props }: ButtonProps) => JSX.Element;
|
|
67
67
|
export default Button;
|
|
@@ -74,12 +74,6 @@ export type ButtonProps = ({
|
|
|
74
74
|
* @default false
|
|
75
75
|
*/
|
|
76
76
|
disabled?: boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Determines if the button should expand to fill the full width of its container.
|
|
79
|
-
*
|
|
80
|
-
* @default false
|
|
81
|
-
*/
|
|
82
|
-
fullWidth?: boolean;
|
|
83
77
|
} & ({
|
|
84
78
|
/**
|
|
85
79
|
* If true, the tooltip is shown for the button
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DeploymentHistoryConfigDiffProps } from './types';
|
|
2
|
-
export declare const DeploymentHistoryConfigDiff: ({ appName, envName, pipelineId, wfrId, triggerHistory, setFullScreenView, resourceId, renderRunSource, }: DeploymentHistoryConfigDiffProps) => JSX.Element;
|
|
2
|
+
export declare const DeploymentHistoryConfigDiff: ({ appName, envName, pipelineId, wfrId, triggerHistory, setFullScreenView, runSource, resourceId, renderRunSource, }: DeploymentHistoryConfigDiffProps) => JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DeploymentHistoryDiffDetailedProps } from './types';
|
|
2
|
-
export declare const DeploymentHistoryConfigDiffCompare: ({ envName, setFullScreenView, pipelineDeployments, wfrId, previousWfrId, convertVariables, setConvertVariables,
|
|
2
|
+
export declare const DeploymentHistoryConfigDiffCompare: ({ envName, setFullScreenView, pipelineDeployments, wfrId, previousWfrId, convertVariables, setConvertVariables, runSource, renderRunSource, resourceId, isCompareDeploymentConfigNotAvailable, ...props }: DeploymentHistoryDiffDetailedProps) => JSX.Element;
|
|
@@ -3,4 +3,4 @@ import { History } from '../types';
|
|
|
3
3
|
import { DeploymentHistoryConfigDiffProps } from './types';
|
|
4
4
|
export declare const renderDeploymentHistoryConfig: (config: DeploymentConfigDiffProps["configList"], heading: string, pathname: string, hideDiffState: boolean) => JSX.Element;
|
|
5
5
|
export declare const renderPipelineDeploymentStatusIcon: (status: string) => JSX.Element;
|
|
6
|
-
export declare const renderPipelineDeploymentOptionDescription: ({ stage, triggeredBy, triggeredByEmail, artifact, renderRunSource, resourceId, runSource, }: Pick<History, "triggeredBy" | "triggeredByEmail" | "artifact" | "stage"
|
|
6
|
+
export declare const renderPipelineDeploymentOptionDescription: ({ stage, triggeredBy, triggeredByEmail, artifact, renderRunSource, resourceId, runSource, }: Pick<History, "triggeredBy" | "triggeredByEmail" | "artifact" | "stage"> & Pick<DeploymentHistoryConfigDiffProps, "renderRunSource" | "resourceId" | "runSource">) => JSX.Element;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import { DeploymentConfigDiffProps } from '@Shared/Components/DeploymentConfigDiff';
|
|
3
3
|
import { EnvResourceType } from '../../../Services';
|
|
4
|
-
import { History, HistoryLogsProps } from '../types';
|
|
4
|
+
import { History, HistoryLogsProps, RunSourceType } from '../types';
|
|
5
5
|
export interface DeploymentHistoryConfigDiffProps extends Required<Pick<HistoryLogsProps, 'renderRunSource' | 'resourceId'>> {
|
|
6
6
|
appName: string;
|
|
7
7
|
envName: string;
|
|
8
8
|
pipelineId: number;
|
|
9
9
|
wfrId: number;
|
|
10
|
+
runSource: RunSourceType;
|
|
10
11
|
triggerHistory: Map<number, History>;
|
|
11
12
|
setFullScreenView: (fullscreen: boolean) => void;
|
|
12
13
|
}
|
|
13
|
-
export type DeploymentHistoryDiffDetailedProps = Pick<DeploymentConfigDiffProps, 'collapsibleNavList' | 'configList' | 'errorConfig' | 'isLoading' | 'navList' | 'hideDiffState'> & Required<Pick<DeploymentHistoryConfigDiffProps, 'setFullScreenView' | 'wfrId' | 'envName' | 'renderRunSource' | 'resourceId' | '
|
|
14
|
+
export type DeploymentHistoryDiffDetailedProps = Pick<DeploymentConfigDiffProps, 'collapsibleNavList' | 'configList' | 'errorConfig' | 'isLoading' | 'navList' | 'hideDiffState'> & Required<Pick<DeploymentHistoryConfigDiffProps, 'setFullScreenView' | 'wfrId' | 'envName' | 'renderRunSource' | 'resourceId' | 'runSource'>> & {
|
|
14
15
|
pipelineDeployments: History[];
|
|
15
16
|
previousWfrId: number;
|
|
16
17
|
convertVariables: boolean;
|
|
@@ -8,7 +8,7 @@ export declare const getPipelineDeploymentsWfrIds: ({ pipelineDeployments, wfrId
|
|
|
8
8
|
currentWfrId: number;
|
|
9
9
|
previousWfrId: number;
|
|
10
10
|
};
|
|
11
|
-
export declare const getPipelineDeploymentsOptions: ({ pipelineDeployments, wfrId, renderRunSource, resourceId,
|
|
11
|
+
export declare const getPipelineDeploymentsOptions: ({ pipelineDeployments, wfrId, renderRunSource, resourceId, runSource, }: Required<Pick<DeploymentHistoryConfigDiffProps, "renderRunSource" | "runSource" | "resourceId">> & {
|
|
12
12
|
pipelineDeployments: History[];
|
|
13
13
|
wfrId: number;
|
|
14
14
|
}) => {
|
|
@@ -1,57 +1,4 @@
|
|
|
1
|
-
import { IWithShortcut } from 'react-keybind';
|
|
2
1
|
import { GitChangesType, LogResizeButtonType, ScrollerType } from './types';
|
|
3
|
-
export declare const LogResizeButton: {
|
|
4
|
-
new (props: Readonly<LogResizeButtonType & IWithShortcut>): {
|
|
5
|
-
render(): JSX.Element;
|
|
6
|
-
context: any;
|
|
7
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<LogResizeButtonType & IWithShortcut>) => {} | Pick<{}, K>) | Pick<{}, K>, callback?: (() => void) | undefined): void;
|
|
8
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
9
|
-
readonly props: Readonly<LogResizeButtonType & IWithShortcut> & Readonly<{
|
|
10
|
-
children?: import('react').ReactNode;
|
|
11
|
-
}>;
|
|
12
|
-
state: Readonly<{}>;
|
|
13
|
-
refs: {
|
|
14
|
-
[key: string]: import('react').ReactInstance;
|
|
15
|
-
};
|
|
16
|
-
componentDidMount?(): void;
|
|
17
|
-
shouldComponentUpdate?(nextProps: Readonly<LogResizeButtonType & IWithShortcut>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
18
|
-
componentWillUnmount?(): void;
|
|
19
|
-
componentDidCatch?(error: Error, errorInfo: import('react').ErrorInfo): void;
|
|
20
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<LogResizeButtonType & IWithShortcut>, prevState: Readonly<{}>): any;
|
|
21
|
-
componentDidUpdate?(prevProps: Readonly<LogResizeButtonType & IWithShortcut>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
22
|
-
componentWillMount?(): void;
|
|
23
|
-
UNSAFE_componentWillMount?(): void;
|
|
24
|
-
componentWillReceiveProps?(nextProps: Readonly<LogResizeButtonType & IWithShortcut>, nextContext: any): void;
|
|
25
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<LogResizeButtonType & IWithShortcut>, nextContext: any): void;
|
|
26
|
-
componentWillUpdate?(nextProps: Readonly<LogResizeButtonType & IWithShortcut>, nextState: Readonly<{}>, nextContext: any): void;
|
|
27
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<LogResizeButtonType & IWithShortcut>, nextState: Readonly<{}>, nextContext: any): void;
|
|
28
|
-
};
|
|
29
|
-
new (props: LogResizeButtonType & IWithShortcut, context?: any): {
|
|
30
|
-
render(): JSX.Element;
|
|
31
|
-
context: any;
|
|
32
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<LogResizeButtonType & IWithShortcut>) => {} | Pick<{}, K>) | Pick<{}, K>, callback?: (() => void) | undefined): void;
|
|
33
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
34
|
-
readonly props: Readonly<LogResizeButtonType & IWithShortcut> & Readonly<{
|
|
35
|
-
children?: import('react').ReactNode;
|
|
36
|
-
}>;
|
|
37
|
-
state: Readonly<{}>;
|
|
38
|
-
refs: {
|
|
39
|
-
[key: string]: import('react').ReactInstance;
|
|
40
|
-
};
|
|
41
|
-
componentDidMount?(): void;
|
|
42
|
-
shouldComponentUpdate?(nextProps: Readonly<LogResizeButtonType & IWithShortcut>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
43
|
-
componentWillUnmount?(): void;
|
|
44
|
-
componentDidCatch?(error: Error, errorInfo: import('react').ErrorInfo): void;
|
|
45
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<LogResizeButtonType & IWithShortcut>, prevState: Readonly<{}>): any;
|
|
46
|
-
componentDidUpdate?(prevProps: Readonly<LogResizeButtonType & IWithShortcut>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
47
|
-
componentWillMount?(): void;
|
|
48
|
-
UNSAFE_componentWillMount?(): void;
|
|
49
|
-
componentWillReceiveProps?(nextProps: Readonly<LogResizeButtonType & IWithShortcut>, nextContext: any): void;
|
|
50
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<LogResizeButtonType & IWithShortcut>, nextContext: any): void;
|
|
51
|
-
componentWillUpdate?(nextProps: Readonly<LogResizeButtonType & IWithShortcut>, nextState: Readonly<{}>, nextContext: any): void;
|
|
52
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<LogResizeButtonType & IWithShortcut>, nextState: Readonly<{}>, nextContext: any): void;
|
|
53
|
-
};
|
|
54
|
-
contextType?: import('react').Context<any> | undefined;
|
|
55
|
-
};
|
|
2
|
+
export declare const LogResizeButton: ({ shortcutCombo, showOnlyWhenPathIncludesLogs, fullScreenView, setFullScreenView, }: LogResizeButtonType) => JSX.Element;
|
|
56
3
|
export declare const Scroller: ({ scrollToTop, scrollToBottom, style }: ScrollerType) => JSX.Element;
|
|
57
4
|
export declare const GitChanges: ({ gitTriggers, ciMaterials, artifact, userApprovalMetadata, triggeredByEmail, ciPipelineId, artifactId, imageComment, imageReleaseTags, appReleaseTagNames, tagsEditable, hideImageTaggingHardDelete, appliedFilters, appliedFiltersTimestamp, promotionApprovalMetadata, selectedEnvironmentName, renderCIListHeader, }: GitChangesType) => JSX.Element;
|
|
@@ -1,56 +1,3 @@
|
|
|
1
|
-
import { IWithShortcut } from 'react-keybind';
|
|
2
1
|
import { LogsRendererType } from './types';
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
render(): JSX.Element;
|
|
6
|
-
context: any;
|
|
7
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<LogsRendererType & IWithShortcut>) => {} | Pick<{}, K>) | Pick<{}, K>, callback?: (() => void) | undefined): void;
|
|
8
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
9
|
-
readonly props: Readonly<LogsRendererType & IWithShortcut> & Readonly<{
|
|
10
|
-
children?: import('react').ReactNode;
|
|
11
|
-
}>;
|
|
12
|
-
state: Readonly<{}>;
|
|
13
|
-
refs: {
|
|
14
|
-
[key: string]: import('react').ReactInstance;
|
|
15
|
-
};
|
|
16
|
-
componentDidMount?(): void;
|
|
17
|
-
shouldComponentUpdate?(nextProps: Readonly<LogsRendererType & IWithShortcut>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
18
|
-
componentWillUnmount?(): void;
|
|
19
|
-
componentDidCatch?(error: Error, errorInfo: import('react').ErrorInfo): void;
|
|
20
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<LogsRendererType & IWithShortcut>, prevState: Readonly<{}>): any;
|
|
21
|
-
componentDidUpdate?(prevProps: Readonly<LogsRendererType & IWithShortcut>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
22
|
-
componentWillMount?(): void;
|
|
23
|
-
UNSAFE_componentWillMount?(): void;
|
|
24
|
-
componentWillReceiveProps?(nextProps: Readonly<LogsRendererType & IWithShortcut>, nextContext: any): void;
|
|
25
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<LogsRendererType & IWithShortcut>, nextContext: any): void;
|
|
26
|
-
componentWillUpdate?(nextProps: Readonly<LogsRendererType & IWithShortcut>, nextState: Readonly<{}>, nextContext: any): void;
|
|
27
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<LogsRendererType & IWithShortcut>, nextState: Readonly<{}>, nextContext: any): void;
|
|
28
|
-
};
|
|
29
|
-
new (props: LogsRendererType & IWithShortcut, context?: any): {
|
|
30
|
-
render(): JSX.Element;
|
|
31
|
-
context: any;
|
|
32
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<LogsRendererType & IWithShortcut>) => {} | Pick<{}, K>) | Pick<{}, K>, callback?: (() => void) | undefined): void;
|
|
33
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
34
|
-
readonly props: Readonly<LogsRendererType & IWithShortcut> & Readonly<{
|
|
35
|
-
children?: import('react').ReactNode;
|
|
36
|
-
}>;
|
|
37
|
-
state: Readonly<{}>;
|
|
38
|
-
refs: {
|
|
39
|
-
[key: string]: import('react').ReactInstance;
|
|
40
|
-
};
|
|
41
|
-
componentDidMount?(): void;
|
|
42
|
-
shouldComponentUpdate?(nextProps: Readonly<LogsRendererType & IWithShortcut>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
43
|
-
componentWillUnmount?(): void;
|
|
44
|
-
componentDidCatch?(error: Error, errorInfo: import('react').ErrorInfo): void;
|
|
45
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<LogsRendererType & IWithShortcut>, prevState: Readonly<{}>): any;
|
|
46
|
-
componentDidUpdate?(prevProps: Readonly<LogsRendererType & IWithShortcut>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
47
|
-
componentWillMount?(): void;
|
|
48
|
-
UNSAFE_componentWillMount?(): void;
|
|
49
|
-
componentWillReceiveProps?(nextProps: Readonly<LogsRendererType & IWithShortcut>, nextContext: any): void;
|
|
50
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<LogsRendererType & IWithShortcut>, nextContext: any): void;
|
|
51
|
-
componentWillUpdate?(nextProps: Readonly<LogsRendererType & IWithShortcut>, nextState: Readonly<{}>, nextContext: any): void;
|
|
52
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<LogsRendererType & IWithShortcut>, nextState: Readonly<{}>, nextContext: any): void;
|
|
53
|
-
};
|
|
54
|
-
contextType?: import('react').Context<any> | undefined;
|
|
55
|
-
};
|
|
56
|
-
export default _default;
|
|
2
|
+
declare const LogsRenderer: ({ triggerDetails, isBlobStorageConfigured, parentType, fullScreenView }: LogsRendererType) => JSX.Element;
|
|
3
|
+
export default LogsRenderer;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CSSProperties, ReactElement } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SupportedKeyboardKeysType } from '@Common/Hooks/UseRegisterShortcut/types';
|
|
3
|
+
import { OptionType, UserApprovalMetadataType, ReleaseTag, ImageComment, PromotionApprovalMetadataType, FilterConditionsListType, DeploymentAppTypes, ResponseType, PaginationProps, useScrollable, SortingOrder } from '../../../Common';
|
|
3
4
|
import { DeploymentStageType } from '../../constants';
|
|
4
5
|
import { AggregationKeys, GitTriggers, Node, NodeType, ResourceKindType, ResourceVersionType } from '../../types';
|
|
5
6
|
export declare enum HistoryComponentType {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DeploymentConfigDiffProps } from './DeploymentConfigDiff.types';
|
|
2
|
-
export declare const DeploymentConfigDiff: ({ isLoading, configList, collapsibleNavList, navList, goBackURL, navHeading, navHelpText, isNavHelpTextShowingError, tabConfig,
|
|
2
|
+
export declare const DeploymentConfigDiff: ({ isLoading, configList, collapsibleNavList, navList, goBackURL, navHeading, navHelpText, isNavHelpTextShowingError, tabConfig, showDetailedDiffState, hideDiffState, renderedInDrawer, ...resProps }: DeploymentConfigDiffProps) => JSX.Element;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SortingOrder } from '../../../Common/Constants';
|
|
2
|
-
import { AppEnvDeploymentConfigDTO, ConfigMapSecretDataConfigDatumDTO, DeploymentTemplateDTO, EnvResourceType } from '../../Services';
|
|
3
|
-
import { ManifestTemplateDTO } from '../../../Pages/Applications';
|
|
2
|
+
import { AppEnvDeploymentConfigDTO, ConfigMapSecretDataConfigDatumDTO, DeploymentTemplateDTO, EnvResourceType, ManifestTemplateDTO } from '../../Services';
|
|
4
3
|
import { DeploymentHistoryDetail } from '../CICDHistory';
|
|
5
4
|
import { CollapsibleListConfig, CollapsibleListItem } from '../CollapsibleList';
|
|
6
5
|
import { SelectPickerProps } from '../SelectPicker';
|
|
@@ -38,7 +37,6 @@ export type DeploymentConfigDiffSelectPickerProps = {
|
|
|
38
37
|
selectPickerProps: SelectPickerProps;
|
|
39
38
|
};
|
|
40
39
|
export interface DeploymentConfigDiffNavigationItem extends Pick<CollapsibleListItem, 'href' | 'title' | 'onClick'> {
|
|
41
|
-
Icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
42
40
|
diffState: DeploymentConfigListItem['diffState'];
|
|
43
41
|
}
|
|
44
42
|
export interface DeploymentConfigDiffNavigationCollapsibleItem extends Pick<CollapsibleListConfig, 'id' | 'header' | 'noItemsText'> {
|
|
@@ -85,7 +83,7 @@ export interface DeploymentConfigDiffProps {
|
|
|
85
83
|
};
|
|
86
84
|
renderedInDrawer?: boolean;
|
|
87
85
|
}
|
|
88
|
-
export interface DeploymentConfigDiffNavigationProps extends Pick<DeploymentConfigDiffProps, 'isLoading' | 'navList' | 'collapsibleNavList' | 'goBackURL' | 'navHeading' | 'navHelpText' | '
|
|
86
|
+
export interface DeploymentConfigDiffNavigationProps extends Pick<DeploymentConfigDiffProps, 'isLoading' | 'navList' | 'collapsibleNavList' | 'goBackURL' | 'navHeading' | 'navHelpText' | 'isNavHelpTextShowingError' | 'tabConfig' | 'showDetailedDiffState' | 'hideDiffState'> {
|
|
89
87
|
}
|
|
90
88
|
export interface DeploymentConfigDiffMainProps extends Pick<DeploymentConfigDiffProps, 'isLoading' | 'errorConfig' | 'headerText' | 'configList' | 'scrollIntoViewId' | 'selectorsConfig' | 'sortingConfig' | 'scopeVariablesConfig' | 'showDetailedDiffState' | 'hideDiffState'> {
|
|
91
89
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DeploymentConfigDiffNavigationProps } from './DeploymentConfigDiff.types';
|
|
2
|
-
export declare const DeploymentConfigDiffNavigation: ({ isLoading, collapsibleNavList, navList, goBackURL, navHeading, navHelpText, isNavHelpTextShowingError, tabConfig,
|
|
2
|
+
export declare const DeploymentConfigDiffNavigation: ({ isLoading, collapsibleNavList, navList, goBackURL, navHeading, navHelpText, isNavHelpTextShowingError, tabConfig, showDetailedDiffState, hideDiffState, }: DeploymentConfigDiffNavigationProps) => JSX.Element;
|
|
@@ -79,11 +79,11 @@ export type SelectPickerProps<OptionValue = number | string, IsMulti extends boo
|
|
|
79
79
|
*/
|
|
80
80
|
customSelectedOptionsCount?: number;
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
82
|
+
* Height of the dropdown
|
|
83
83
|
*
|
|
84
84
|
* @default 'ComponentSizeType.medium'
|
|
85
85
|
*/
|
|
86
|
-
size?: Extract<ComponentSizeType, ComponentSizeType.medium | ComponentSizeType.large
|
|
86
|
+
size?: Extract<ComponentSizeType, ComponentSizeType.medium | ComponentSizeType.large>;
|
|
87
87
|
/**
|
|
88
88
|
* Content to be shown in a tippy when disabled
|
|
89
89
|
*/
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { LinkProps, NavLinkProps } from 'react-router-dom';
|
|
2
2
|
import { ComponentSizeType } from '../../constants';
|
|
3
3
|
import { DataAttributes } from '../../types';
|
|
4
|
-
import { TooltipProps } from '@Common/Tooltip/types';
|
|
5
4
|
type TabComponentProps<TabTypeProps> = TabTypeProps & DataAttributes;
|
|
6
5
|
type ConditionalTabType = {
|
|
7
6
|
/**
|
|
@@ -57,13 +56,6 @@ type ConditionalTabType = {
|
|
|
57
56
|
*/
|
|
58
57
|
active?: never | false;
|
|
59
58
|
};
|
|
60
|
-
type TabTooltipProps = {
|
|
61
|
-
shouldWrapTooltip: boolean;
|
|
62
|
-
tooltipProps: TooltipProps;
|
|
63
|
-
} | {
|
|
64
|
-
shouldWrapTooltip?: never;
|
|
65
|
-
tooltipProps?: never;
|
|
66
|
-
};
|
|
67
59
|
export type TabProps = {
|
|
68
60
|
/**
|
|
69
61
|
* Unique identifier for the tab.
|
|
@@ -105,7 +97,7 @@ export type TabProps = {
|
|
|
105
97
|
* Disables the tab, preventing interaction and indicating an inactive state.
|
|
106
98
|
*/
|
|
107
99
|
disabled?: boolean;
|
|
108
|
-
} & ConditionalTabType
|
|
100
|
+
} & ConditionalTabType;
|
|
109
101
|
export interface TabGroupProps {
|
|
110
102
|
/**
|
|
111
103
|
* Array of tabs to be rendered.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { UseFormSubmitHandler, UseFormValidations
|
|
1
|
+
import { ChangeEvent, FormEvent } from 'react';
|
|
2
|
+
import { UseFormSubmitHandler, UseFormValidations } from './useForm.types';
|
|
3
3
|
/**
|
|
4
4
|
* A custom hook to manage form state, validation, and submission handling.
|
|
5
5
|
*
|
|
@@ -16,19 +16,20 @@ export declare const useForm: <T extends Record<keyof T, any> = {}>(options?: {
|
|
|
16
16
|
* - 'onBlur': Validation occurs when the input loses focus.
|
|
17
17
|
* @default 'onChange'
|
|
18
18
|
*/
|
|
19
|
-
validationMode?: "onChange" | "onBlur"
|
|
19
|
+
validationMode?: "onChange" | "onBlur";
|
|
20
20
|
}) => {
|
|
21
21
|
/** The current form data. */
|
|
22
22
|
data: T;
|
|
23
23
|
/** An object containing validation errors for each form field. */
|
|
24
|
-
errors: Partial<Record<keyof T, string[]>>;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
errors: Partial<Record<keyof T, string | string[]>>;
|
|
25
|
+
/**
|
|
26
|
+
* Registers form input fields with onChange, onBlur and onFocus handlers.
|
|
27
|
+
*
|
|
28
|
+
* @param name - The key of the form field to register.
|
|
29
|
+
* @param sanitizeFn - An optional function to sanitize the input value.
|
|
30
|
+
* @returns An object containing form field `name`, `onChange`, `onBlur` and `onFocus` event handlers.
|
|
31
|
+
*/
|
|
32
|
+
register: <V extends unknown = string, S extends unknown = unknown>(name: keyof T, sanitizeFn?: (value: V) => S, registerOptions?: {
|
|
32
33
|
/**
|
|
33
34
|
* Prevents the input value from being trimmed.
|
|
34
35
|
*
|
|
@@ -38,30 +39,26 @@ export declare const useForm: <T extends Record<keyof T, any> = {}>(options?: {
|
|
|
38
39
|
* @default false - By default, the input will be trimmed.
|
|
39
40
|
*/
|
|
40
41
|
noTrim?: boolean;
|
|
41
|
-
/** A boolean flag indicating if the input is a custom component. */
|
|
42
|
-
isCustomComponent?: CustomComponent;
|
|
43
42
|
}) => {
|
|
44
|
-
onChange: (e:
|
|
43
|
+
onChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
45
44
|
onBlur: () => void;
|
|
46
45
|
onFocus: () => void;
|
|
47
46
|
name: keyof T;
|
|
48
47
|
};
|
|
49
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Handles form submission, validates all form fields, and calls the provided `onValid` function if valid.
|
|
50
|
+
*
|
|
51
|
+
* @param onValid - A function to handle valid form data on submission.
|
|
52
|
+
* @returns The event handler for form submission.
|
|
53
|
+
*/
|
|
54
|
+
handleSubmit: (onValid: UseFormSubmitHandler<T>) => (e: FormEvent<HTMLFormElement>) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Manually triggers validation for specific form fields.
|
|
57
|
+
*
|
|
58
|
+
* @param name - The key(s) of the form field(s) to validate.
|
|
59
|
+
* @returns The validation error(s), if any.
|
|
60
|
+
*/
|
|
50
61
|
trigger: (name: keyof T | (keyof T)[]) => (string | string[]) | (string | string[])[];
|
|
51
|
-
setValue: (name: keyof T, value: T[keyof T], valueOptions?: {
|
|
52
|
-
/** A boolean indicating whether to mark the field as dirty after setting the value. */
|
|
53
|
-
shouldDirty?: boolean;
|
|
54
|
-
/** A boolean indicating whether to mark the field as touched after setting the value. */
|
|
55
|
-
shouldTouch?: boolean;
|
|
56
|
-
}) => void;
|
|
57
|
-
reset: (formData: T, resetOptions?: {
|
|
58
|
-
/** A boolean indicating whether to retain the current dirty state of the form fields. */
|
|
59
|
-
keepDirty?: boolean;
|
|
60
|
-
/** A boolean indicating whether to retain the current touched state of the form fields. */
|
|
61
|
-
keepTouched?: boolean;
|
|
62
|
-
/** A boolean indicating whether to retain the current error state of the form fields. */
|
|
63
|
-
keepErrors?: boolean;
|
|
64
|
-
}) => void;
|
|
65
62
|
/** An object representing additional form state. */
|
|
66
63
|
formState: {
|
|
67
64
|
/** An object indicating which fields have been touched (interacted with). */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FormEvent } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Describes the "required" validation rule.
|
|
4
4
|
* It can be a simple boolean or an object containing a boolean value and an error message.
|
|
@@ -24,10 +24,10 @@ type ValidationPattern = {
|
|
|
24
24
|
* If validation fails, an error message is provided.
|
|
25
25
|
*/
|
|
26
26
|
type ValidationCustom = {
|
|
27
|
-
isValid: (value:
|
|
27
|
+
isValid: (value: string) => boolean;
|
|
28
28
|
message: string;
|
|
29
29
|
} | {
|
|
30
|
-
isValid: (value:
|
|
30
|
+
isValid: (value: string) => boolean;
|
|
31
31
|
message: string;
|
|
32
32
|
}[];
|
|
33
33
|
/**
|
|
@@ -41,9 +41,9 @@ export interface UseFormValidation {
|
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Represents the structure for form validation errors.
|
|
44
|
-
* Maps each field to an array of error messages.
|
|
44
|
+
* Maps each field to an error message or an array of error messages.
|
|
45
45
|
*/
|
|
46
|
-
export type UseFormErrors<T> = Partial<Record<keyof T, string[]>>;
|
|
46
|
+
export type UseFormErrors<T> = Partial<Record<keyof T, string | string[]>>;
|
|
47
47
|
/**
|
|
48
48
|
* Represents the fields that have been modified ("dirty") in the form.
|
|
49
49
|
* Maps each field to a boolean value indicating whether it has been changed.
|
|
@@ -58,19 +58,12 @@ export type TouchedFields<T> = Partial<Record<keyof T, boolean>>;
|
|
|
58
58
|
* Defines the structure for form validations.
|
|
59
59
|
* Maps each form field to its corresponding validation rules.
|
|
60
60
|
*/
|
|
61
|
-
export type UseFormValidations<T extends {}> =
|
|
61
|
+
export type UseFormValidations<T extends {}> = Partial<Record<keyof T, UseFormValidation>>;
|
|
62
62
|
/**
|
|
63
63
|
* Describes the function signature for handling form submission.
|
|
64
64
|
*
|
|
65
65
|
* @param data - The form data collected during submission.
|
|
66
|
-
* @param e - The event, optionally passed when
|
|
66
|
+
* @param e - The form event, optionally passed when the form is submitted.
|
|
67
67
|
*/
|
|
68
|
-
export type UseFormSubmitHandler<T extends {}> = (data: T, e?:
|
|
69
|
-
/**
|
|
70
|
-
* A type defining the function signature for handling form validation errors.
|
|
71
|
-
*
|
|
72
|
-
* @param errors - An object containing the validation errors for form fields.
|
|
73
|
-
* @param e - The event, optionally passed when `handleSubmit` is called.
|
|
74
|
-
*/
|
|
75
|
-
export type UseFormErrorHandler<T extends {}> = (errors: UseFormErrors<T>, e?: BaseSyntheticEvent) => void;
|
|
68
|
+
export type UseFormSubmitHandler<T extends {}> = (data: T, e?: FormEvent<HTMLFormElement>) => void;
|
|
76
69
|
export {};
|
|
@@ -7,4 +7,4 @@ import { UseFormValidation } from './useForm.types';
|
|
|
7
7
|
* @param validation - The validation rules for the form field.
|
|
8
8
|
* @returns Returns error message(s) or null if valid.
|
|
9
9
|
*/
|
|
10
|
-
export declare const checkValidation: <T extends Record<keyof T, any> = {}>(value: T[keyof T], validation: UseFormValidation) => string[] | null;
|
|
10
|
+
export declare const checkValidation: <T extends Record<keyof T, any> = {}>(value: T[keyof T], validation: UseFormValidation) => string | string[] | null;
|