@moser-inc/moser-labs-react 1.3.3 → 1.5.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/dist/_dev/components/DevLink.d.ts +8 -0
- package/dist/_dev/layouts/App.layout.d.ts +1 -0
- package/dist/_dev/views/Base.view.d.ts +2 -2
- package/dist/_dev/views/Inputs.view.d.ts +193 -3
- package/dist/components/{FieldContainer.d.ts → FieldContainer/FieldContainer.d.ts} +2 -0
- package/dist/components/{FieldContainerInput.d.ts → FieldContainer/FieldContainerInput.d.ts} +1 -1
- package/dist/components/LabsCheckbox.d.ts +3 -2
- package/dist/components/LabsDate.d.ts +3 -2
- package/dist/components/LabsIcon.d.ts +1 -1
- package/dist/components/LabsLogoutTimer.d.ts +9 -0
- package/dist/components/LabsSelect.d.ts +3 -2
- package/dist/components/LabsText.d.ts +2 -1
- package/dist/components/LabsTextCurrency.d.ts +2 -1
- package/dist/components/LabsTextSearch.d.ts +2 -1
- package/dist/components/LabsTextarea.d.ts +19 -0
- package/dist/lib/auth/authContext.d.ts +1 -2
- package/dist/main.d.ts +1 -0
- package/dist/moser-labs-react.cjs +69 -69
- package/dist/moser-labs-react.js +8523 -7990
- package/dist/types/DirectoryValue.type.d.ts +1 -1
- package/dist/utils/fieldHelpers.d.ts +4 -0
- package/package.json +6 -3
- package/dist/constants/roles.constant.d.ts +0 -5
- /package/dist/components/{FieldContainerLabel.d.ts → FieldContainer/FieldContainerLabel.d.ts} +0 -0
- /package/dist/components/{FieldContainerMessage.d.ts → FieldContainer/FieldContainerMessage.d.ts} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LinkProps } from 'react-router-dom';
|
|
3
|
+
export type DevLinkProps = LinkProps & {
|
|
4
|
+
refreshOnSameUrl?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const DevLink: import("react").ForwardRefExoticComponent<LinkProps & {
|
|
7
|
+
refreshOnSameUrl?: boolean | undefined;
|
|
8
|
+
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DevLayoutApp: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,195 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import { UseFormProps } from 'react-hook-form';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
interface ViewInputsProps {
|
|
3
5
|
}
|
|
4
|
-
declare const
|
|
5
|
-
|
|
6
|
+
export declare const SampleFormSchema: z.ZodObject<{
|
|
7
|
+
checkbox: z.ZodBoolean;
|
|
8
|
+
date: z.ZodEffects<z.ZodNullable<z.ZodDate>, Date | null, Date | null>;
|
|
9
|
+
select: z.ZodString;
|
|
10
|
+
text: z.ZodString;
|
|
11
|
+
textCurrency: z.ZodString;
|
|
12
|
+
textSearch: z.ZodString;
|
|
13
|
+
textArea: z.ZodString;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
select: string;
|
|
16
|
+
text: string;
|
|
17
|
+
checkbox: boolean;
|
|
18
|
+
date: Date | null;
|
|
19
|
+
textCurrency: string;
|
|
20
|
+
textSearch: string;
|
|
21
|
+
textArea: string;
|
|
22
|
+
}, {
|
|
23
|
+
select: string;
|
|
24
|
+
text: string;
|
|
25
|
+
checkbox: boolean;
|
|
26
|
+
date: Date | null;
|
|
27
|
+
textCurrency: string;
|
|
28
|
+
textSearch: string;
|
|
29
|
+
textArea: string;
|
|
30
|
+
}>;
|
|
31
|
+
export type SampleFormValues = z.infer<typeof SampleFormSchema>;
|
|
32
|
+
export declare const useSampleForm: ({ resolver, defaultValues, ...rest }?: UseFormProps<SampleFormValues>) => {
|
|
33
|
+
readonly schema: z.ZodObject<{
|
|
34
|
+
checkbox: z.ZodBoolean;
|
|
35
|
+
date: z.ZodEffects<z.ZodNullable<z.ZodDate>, Date | null, Date | null>;
|
|
36
|
+
select: z.ZodString;
|
|
37
|
+
text: z.ZodString;
|
|
38
|
+
textCurrency: z.ZodString;
|
|
39
|
+
textSearch: z.ZodString;
|
|
40
|
+
textArea: z.ZodString;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
select: string;
|
|
43
|
+
text: string;
|
|
44
|
+
checkbox: boolean;
|
|
45
|
+
date: Date | null;
|
|
46
|
+
textCurrency: string;
|
|
47
|
+
textSearch: string;
|
|
48
|
+
textArea: string;
|
|
49
|
+
}, {
|
|
50
|
+
select: string;
|
|
51
|
+
text: string;
|
|
52
|
+
checkbox: boolean;
|
|
53
|
+
date: Date | null;
|
|
54
|
+
textCurrency: string;
|
|
55
|
+
textSearch: string;
|
|
56
|
+
textArea: string;
|
|
57
|
+
}>;
|
|
58
|
+
readonly watch: import("react-hook-form").UseFormWatch<{
|
|
59
|
+
select: string;
|
|
60
|
+
text: string;
|
|
61
|
+
checkbox: boolean;
|
|
62
|
+
date: Date | null;
|
|
63
|
+
textCurrency: string;
|
|
64
|
+
textSearch: string;
|
|
65
|
+
textArea: string;
|
|
66
|
+
}>;
|
|
67
|
+
readonly getValues: import("react-hook-form").UseFormGetValues<{
|
|
68
|
+
select: string;
|
|
69
|
+
text: string;
|
|
70
|
+
checkbox: boolean;
|
|
71
|
+
date: Date | null;
|
|
72
|
+
textCurrency: string;
|
|
73
|
+
textSearch: string;
|
|
74
|
+
textArea: string;
|
|
75
|
+
}>;
|
|
76
|
+
readonly getFieldState: import("react-hook-form").UseFormGetFieldState<{
|
|
77
|
+
select: string;
|
|
78
|
+
text: string;
|
|
79
|
+
checkbox: boolean;
|
|
80
|
+
date: Date | null;
|
|
81
|
+
textCurrency: string;
|
|
82
|
+
textSearch: string;
|
|
83
|
+
textArea: string;
|
|
84
|
+
}>;
|
|
85
|
+
readonly setError: import("react-hook-form").UseFormSetError<{
|
|
86
|
+
select: string;
|
|
87
|
+
text: string;
|
|
88
|
+
checkbox: boolean;
|
|
89
|
+
date: Date | null;
|
|
90
|
+
textCurrency: string;
|
|
91
|
+
textSearch: string;
|
|
92
|
+
textArea: string;
|
|
93
|
+
}>;
|
|
94
|
+
readonly clearErrors: import("react-hook-form").UseFormClearErrors<{
|
|
95
|
+
select: string;
|
|
96
|
+
text: string;
|
|
97
|
+
checkbox: boolean;
|
|
98
|
+
date: Date | null;
|
|
99
|
+
textCurrency: string;
|
|
100
|
+
textSearch: string;
|
|
101
|
+
textArea: string;
|
|
102
|
+
}>;
|
|
103
|
+
readonly setValue: import("react-hook-form").UseFormSetValue<{
|
|
104
|
+
select: string;
|
|
105
|
+
text: string;
|
|
106
|
+
checkbox: boolean;
|
|
107
|
+
date: Date | null;
|
|
108
|
+
textCurrency: string;
|
|
109
|
+
textSearch: string;
|
|
110
|
+
textArea: string;
|
|
111
|
+
}>;
|
|
112
|
+
readonly trigger: import("react-hook-form").UseFormTrigger<{
|
|
113
|
+
select: string;
|
|
114
|
+
text: string;
|
|
115
|
+
checkbox: boolean;
|
|
116
|
+
date: Date | null;
|
|
117
|
+
textCurrency: string;
|
|
118
|
+
textSearch: string;
|
|
119
|
+
textArea: string;
|
|
120
|
+
}>;
|
|
121
|
+
readonly formState: import("react-hook-form").FormState<{
|
|
122
|
+
select: string;
|
|
123
|
+
text: string;
|
|
124
|
+
checkbox: boolean;
|
|
125
|
+
date: Date | null;
|
|
126
|
+
textCurrency: string;
|
|
127
|
+
textSearch: string;
|
|
128
|
+
textArea: string;
|
|
129
|
+
}>;
|
|
130
|
+
readonly resetField: import("react-hook-form").UseFormResetField<{
|
|
131
|
+
select: string;
|
|
132
|
+
text: string;
|
|
133
|
+
checkbox: boolean;
|
|
134
|
+
date: Date | null;
|
|
135
|
+
textCurrency: string;
|
|
136
|
+
textSearch: string;
|
|
137
|
+
textArea: string;
|
|
138
|
+
}>;
|
|
139
|
+
readonly reset: import("react-hook-form").UseFormReset<{
|
|
140
|
+
select: string;
|
|
141
|
+
text: string;
|
|
142
|
+
checkbox: boolean;
|
|
143
|
+
date: Date | null;
|
|
144
|
+
textCurrency: string;
|
|
145
|
+
textSearch: string;
|
|
146
|
+
textArea: string;
|
|
147
|
+
}>;
|
|
148
|
+
readonly handleSubmit: import("react-hook-form").UseFormHandleSubmit<{
|
|
149
|
+
select: string;
|
|
150
|
+
text: string;
|
|
151
|
+
checkbox: boolean;
|
|
152
|
+
date: Date | null;
|
|
153
|
+
textCurrency: string;
|
|
154
|
+
textSearch: string;
|
|
155
|
+
textArea: string;
|
|
156
|
+
}, undefined>;
|
|
157
|
+
readonly unregister: import("react-hook-form").UseFormUnregister<{
|
|
158
|
+
select: string;
|
|
159
|
+
text: string;
|
|
160
|
+
checkbox: boolean;
|
|
161
|
+
date: Date | null;
|
|
162
|
+
textCurrency: string;
|
|
163
|
+
textSearch: string;
|
|
164
|
+
textArea: string;
|
|
165
|
+
}>;
|
|
166
|
+
readonly control: import("react-hook-form").Control<{
|
|
167
|
+
select: string;
|
|
168
|
+
text: string;
|
|
169
|
+
checkbox: boolean;
|
|
170
|
+
date: Date | null;
|
|
171
|
+
textCurrency: string;
|
|
172
|
+
textSearch: string;
|
|
173
|
+
textArea: string;
|
|
174
|
+
}, any>;
|
|
175
|
+
readonly register: import("react-hook-form").UseFormRegister<{
|
|
176
|
+
select: string;
|
|
177
|
+
text: string;
|
|
178
|
+
checkbox: boolean;
|
|
179
|
+
date: Date | null;
|
|
180
|
+
textCurrency: string;
|
|
181
|
+
textSearch: string;
|
|
182
|
+
textArea: string;
|
|
183
|
+
}>;
|
|
184
|
+
readonly setFocus: import("react-hook-form").UseFormSetFocus<{
|
|
185
|
+
select: string;
|
|
186
|
+
text: string;
|
|
187
|
+
checkbox: boolean;
|
|
188
|
+
date: Date | null;
|
|
189
|
+
textCurrency: string;
|
|
190
|
+
textSearch: string;
|
|
191
|
+
textArea: string;
|
|
192
|
+
}>;
|
|
193
|
+
};
|
|
194
|
+
declare const DevViewInputs: React.FC<ViewInputsProps>;
|
|
195
|
+
export default DevViewInputs;
|
|
@@ -6,6 +6,7 @@ export interface FieldContainerProps {
|
|
|
6
6
|
labelId?: string;
|
|
7
7
|
messageId?: string;
|
|
8
8
|
containerId?: string;
|
|
9
|
+
hasError?: boolean;
|
|
9
10
|
label?: string;
|
|
10
11
|
message?: string;
|
|
11
12
|
animation?: MotionProps;
|
|
@@ -14,5 +15,6 @@ export interface FieldContainerProps {
|
|
|
14
15
|
}
|
|
15
16
|
export declare const FieldContainer: ({ id, labelId, messageId, containerId, label, message, animation, children, ...rest }: FieldContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export declare const toFieldContainerProps: (fieldState: ControllerFieldState) => {
|
|
18
|
+
hasError: boolean;
|
|
17
19
|
message: string | undefined;
|
|
18
20
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { CheckboxProps } from 'primereact/checkbox';
|
|
2
2
|
import { FieldValues, FieldPath } from 'react-hook-form';
|
|
3
|
-
import { FieldContainerProps } from '../components/FieldContainer';
|
|
3
|
+
import { FieldContainerProps } from '../components/FieldContainer/FieldContainer';
|
|
4
4
|
import { ControllerRenderParams } from '../types/ReactHookForm.type';
|
|
5
5
|
type FieldProps = Partial<CheckboxProps> & FieldContainerProps;
|
|
6
6
|
export type LabsCheckboxProps = FieldProps;
|
|
7
7
|
export declare const LabsCheckbox: {
|
|
8
|
-
(
|
|
8
|
+
(props: LabsCheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
displayName: string;
|
|
10
10
|
};
|
|
11
11
|
export declare const toLabsCheckboxProps: <TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>>({ field: { value, ref, ...field }, fieldState, }: ControllerRenderParams<TValues, TName>) => {
|
|
12
12
|
inputRef: import("react-hook-form").RefCallBack;
|
|
13
13
|
checked: import("react-hook-form").PathValue<TValues, TName>;
|
|
14
14
|
onChange: (event: import("primereact/checkbox").CheckboxChangeEvent) => void;
|
|
15
|
+
hasError: boolean;
|
|
15
16
|
message: string | undefined;
|
|
16
17
|
onBlur: import("react-hook-form").Noop;
|
|
17
18
|
name: TName;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { FieldValues, FieldPath } from 'react-hook-form';
|
|
2
|
-
import { type FieldContainerInputProps } from '../components/FieldContainerInput';
|
|
2
|
+
import { type FieldContainerInputProps } from '../components/FieldContainer/FieldContainerInput';
|
|
3
3
|
import { LabsCalendarProps } from '../components/LabsCalendar';
|
|
4
4
|
import { ControllerRenderParams } from '../types/ReactHookForm.type';
|
|
5
5
|
type FieldProps = LabsCalendarProps & FieldContainerInputProps;
|
|
6
6
|
export type LabsDateProps = FieldProps;
|
|
7
|
-
export declare const LabsDate: (
|
|
7
|
+
export declare const LabsDate: (props: LabsDateProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export declare const toLabsDateProps: <TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>>({ field: { ref, ...field }, fieldState, }: ControllerRenderParams<TValues, TName>) => {
|
|
9
9
|
inputRef: import("react-hook-form").RefCallBack;
|
|
10
10
|
onChange: (event: import("primereact/calendar").CalendarChangeEvent) => void;
|
|
11
|
+
hasError: boolean;
|
|
11
12
|
message: string | undefined;
|
|
12
13
|
onBlur: import("react-hook-form").Noop;
|
|
13
14
|
value: import("react-hook-form").PathValue<TValues, TName>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface LabsLogoutTimerProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
options?: {
|
|
5
|
+
delay: number;
|
|
6
|
+
};
|
|
7
|
+
onLogout: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const LabsLogoutTimer: ({ children, options, onLogout, }: LabsLogoutTimerProps) => ReactNode;
|
|
@@ -3,7 +3,7 @@ import { DropdownProps } from 'primereact/dropdown';
|
|
|
3
3
|
import { FormEvent } from 'primereact/ts-helpers';
|
|
4
4
|
import type { IconType } from 'primereact/utils';
|
|
5
5
|
import { FieldValues, FieldPath } from 'react-hook-form';
|
|
6
|
-
import { type FieldContainerInputProps } from '../components/FieldContainerInput';
|
|
6
|
+
import { type FieldContainerInputProps } from '../components/FieldContainer/FieldContainerInput';
|
|
7
7
|
import { ControllerRenderParams } from '../types/ReactHookForm.type';
|
|
8
8
|
export interface LabsSelectOption<T = unknown> {
|
|
9
9
|
label?: string;
|
|
@@ -20,10 +20,11 @@ export interface LabsSelectProps<TValue extends string> extends FieldProps {
|
|
|
20
20
|
options?: LabsSelectOption<TValue>[];
|
|
21
21
|
onChange?: (event: FormEvent<TValue>) => void;
|
|
22
22
|
}
|
|
23
|
-
export declare const LabsSelect: <TValue extends string>(
|
|
23
|
+
export declare const LabsSelect: <TValue extends string>(props: LabsSelectProps<TValue>) => import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
export declare const toLabsSelectProps: <TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>>({ field: { ref, ...field }, fieldState, }: ControllerRenderParams<TValues, TName>) => {
|
|
25
25
|
inputRef: import("react-hook-form").RefCallBack;
|
|
26
26
|
onChange: (event: FormEvent<TValues[TName], import("react").SyntheticEvent<Element, Event>>) => void;
|
|
27
|
+
hasError: boolean;
|
|
27
28
|
message: string | undefined;
|
|
28
29
|
onBlur: import("react-hook-form").Noop;
|
|
29
30
|
value: import("react-hook-form").PathValue<TValues, TName>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { InputTextProps } from 'primereact/inputtext';
|
|
3
3
|
import { FieldValues, FieldPath } from 'react-hook-form';
|
|
4
|
-
import { type FieldContainerInputProps } from '../components/FieldContainerInput';
|
|
4
|
+
import { type FieldContainerInputProps } from '../components/FieldContainer/FieldContainerInput';
|
|
5
5
|
import { ControllerRenderParams } from '../types/ReactHookForm.type';
|
|
6
6
|
type FieldProps = Partial<InputTextProps> & FieldContainerInputProps;
|
|
7
7
|
export type LabsTextProps = FieldProps;
|
|
@@ -9,6 +9,7 @@ export type LabsTextElement = HTMLInputElement;
|
|
|
9
9
|
export declare const LabsText: import("react").ForwardRefExoticComponent<Partial<InputTextProps> & FieldContainerInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
10
10
|
export declare const toLabsTextProps: <TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>>({ field, fieldState, }: ControllerRenderParams<TValues, TName>) => {
|
|
11
11
|
value: string;
|
|
12
|
+
hasError: boolean;
|
|
12
13
|
message: string | undefined;
|
|
13
14
|
onChange: (...event: any[]) => void;
|
|
14
15
|
onBlur: import("react-hook-form").Noop;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { LabsTextProps } from '../components/LabsText';
|
|
3
3
|
export type LabsTextCurrencyProps = LabsTextProps;
|
|
4
|
-
export declare const LabsTextCurrency: import("react").ForwardRefExoticComponent<Partial<import("primereact/inputtext").InputTextProps> & import("./FieldContainerInput").FieldContainerInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
4
|
+
export declare const LabsTextCurrency: import("react").ForwardRefExoticComponent<Partial<import("primereact/inputtext").InputTextProps> & import("./FieldContainer/FieldContainerInput").FieldContainerInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
5
5
|
export declare const toLabsTextCurrencyProps: <TValues extends import("react-hook-form").FieldValues = import("react-hook-form").FieldValues, TName extends import("react-hook-form").FieldPath<TValues> = import("react-hook-form").FieldPath<TValues>>({ field, fieldState, }: import("../main").ControllerRenderParams<TValues, TName>) => {
|
|
6
6
|
value: string;
|
|
7
|
+
hasError: boolean;
|
|
7
8
|
message: string | undefined;
|
|
8
9
|
onChange: (...event: any[]) => void;
|
|
9
10
|
onBlur: import("react-hook-form").Noop;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { LabsTextProps } from '../components/LabsText';
|
|
3
3
|
export type LabsTextSearchProps = LabsTextProps;
|
|
4
|
-
export declare const LabsTextSearch: import("react").ForwardRefExoticComponent<Partial<import("primereact/inputtext").InputTextProps> & import("./FieldContainerInput").FieldContainerInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
4
|
+
export declare const LabsTextSearch: import("react").ForwardRefExoticComponent<Partial<import("primereact/inputtext").InputTextProps> & import("./FieldContainer/FieldContainerInput").FieldContainerInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
5
5
|
export declare const toLabsTextSearchProps: <TValues extends import("react-hook-form").FieldValues = import("react-hook-form").FieldValues, TName extends import("react-hook-form").FieldPath<TValues> = import("react-hook-form").FieldPath<TValues>>({ field, fieldState, }: import("../main").ControllerRenderParams<TValues, TName>) => {
|
|
6
6
|
value: string;
|
|
7
|
+
hasError: boolean;
|
|
7
8
|
message: string | undefined;
|
|
8
9
|
onChange: (...event: any[]) => void;
|
|
9
10
|
onBlur: import("react-hook-form").Noop;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputTextareaProps } from 'primereact/inputtextarea';
|
|
3
|
+
import { FieldValues, FieldPath } from 'react-hook-form';
|
|
4
|
+
import { type FieldContainerInputProps } from '../components/FieldContainer/FieldContainerInput';
|
|
5
|
+
import { ControllerRenderParams } from '../types/ReactHookForm.type';
|
|
6
|
+
type FieldProps = Partial<InputTextareaProps> & FieldContainerInputProps;
|
|
7
|
+
export type LabsTextareaProps = FieldProps;
|
|
8
|
+
export type LabsTextareaElement = HTMLTextAreaElement;
|
|
9
|
+
export declare const LabsTextarea: import("react").ForwardRefExoticComponent<Partial<InputTextareaProps> & FieldContainerInputProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
10
|
+
export declare const toLabsTextareaProps: <TValues extends FieldValues = FieldValues, TName extends FieldPath<TValues> = FieldPath<TValues>>({ field, fieldState, }: ControllerRenderParams<TValues, TName>) => {
|
|
11
|
+
value: string;
|
|
12
|
+
hasError: boolean;
|
|
13
|
+
message: string | undefined;
|
|
14
|
+
onChange: (...event: any[]) => void;
|
|
15
|
+
onBlur: import("react-hook-form").Noop;
|
|
16
|
+
name: TName;
|
|
17
|
+
ref: import("react-hook-form").RefCallBack;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Role } from '../../constants/roles.constant';
|
|
3
2
|
import { User, refreshToken } from '../../lib/auth';
|
|
3
|
+
export type Role = string;
|
|
4
4
|
export type AuthContextValue = {
|
|
5
5
|
user: User | null;
|
|
6
6
|
hasAllRoles: (roles: Role | readonly Role[] | undefined) => boolean;
|
|
7
7
|
hasRole: (roles: Role | readonly Role[] | undefined) => boolean;
|
|
8
|
-
isAdmin: boolean;
|
|
9
8
|
isAuthenticated: boolean;
|
|
10
9
|
isLoading: boolean;
|
|
11
10
|
logout: () => void;
|
package/dist/main.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './components/LabsCheckbox';
|
|
|
4
4
|
export * from './components/LabsDate';
|
|
5
5
|
export * from './components/LabsIcon';
|
|
6
6
|
export * from './components/LabsLoader';
|
|
7
|
+
export * from './components/LabsLogoutTimer';
|
|
7
8
|
export * from './components/LabsMain';
|
|
8
9
|
export * from './components/LabsMainDesktopNav';
|
|
9
10
|
export * from './components/LabsMainMobileNav';
|