stratosphere-ui 1.5.0 → 1.6.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.
|
@@ -14,8 +14,8 @@ export interface TabsProps extends Omit<HTMLProps<HTMLDivElement>, 'as' | 'onCha
|
|
|
14
14
|
className?: string;
|
|
15
15
|
lifted?: boolean;
|
|
16
16
|
manual?: boolean;
|
|
17
|
-
onChange
|
|
18
|
-
selectedTabId
|
|
17
|
+
onChange: (tab: TabData) => void;
|
|
18
|
+
selectedTabId: string;
|
|
19
19
|
size?: TabSize;
|
|
20
20
|
tabs: TabData[];
|
|
21
21
|
vertical?: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './useDebouncedValue';
|
|
2
2
|
export * from './useFieldColor';
|
|
3
3
|
export * from './useFormValues';
|
|
4
|
+
export * from './useFormWithQueryParams';
|
|
4
5
|
export * from './useOutsideClick';
|
|
5
6
|
export * from './useTypeaheadQuery';
|
|
6
7
|
export * from './useValueChangeEffect';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { URLSearchParamsInit } from 'react-router-dom';
|
|
2
|
+
import { DefaultValues, FieldPath, FieldValues, Path, PathValue, UseFormProps, UseFormReturn } from 'react-hook-form';
|
|
3
|
+
export type QueryParamValues<FormValues extends FieldValues> = Partial<Record<keyof FormValues, string | null>>;
|
|
4
|
+
export interface UseFormWithQueryParamsOptions<FormValues extends FieldValues, FormContext = any> extends Omit<UseFormProps<FormValues, FormContext>, 'defaultValues'> {
|
|
5
|
+
getDefaultValues: (searchParamValues: QueryParamValues<FormValues>) => DefaultValues<FormValues>;
|
|
6
|
+
getSearchParams: (formValues: PathValue<FormValues, Path<FormValues>>[]) => URLSearchParamsInit | ((prev: URLSearchParams) => URLSearchParamsInit);
|
|
7
|
+
includeKeys: readonly FieldPath<FormValues>[];
|
|
8
|
+
}
|
|
9
|
+
export declare const useFormWithQueryParams: <FormValues extends FieldValues, FormContext = any, TransformedValues extends FieldValues | undefined = undefined>({ getDefaultValues, getSearchParams, includeKeys, ...useFormOptions }: UseFormWithQueryParamsOptions<FormValues, FormContext>) => UseFormReturn<FormValues, FormContext, TransformedValues>;
|