@refinedev/core 4.45.1 → 4.46.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/README.md +61 -77
  3. package/dist/components/authenticated/index.d.ts +34 -0
  4. package/dist/components/authenticated/index.d.ts.map +1 -1
  5. package/dist/components/pages/auth/components/login/index.d.ts.map +1 -1
  6. package/dist/components/pages/auth/components/register/index.d.ts.map +1 -1
  7. package/dist/components/pages/welcome/index.d.ts.map +1 -1
  8. package/dist/esm/index.js +6 -6
  9. package/dist/esm/index.js.map +1 -1
  10. package/dist/hooks/data/useMany.d.ts +1 -1
  11. package/dist/hooks/data/useMany.d.ts.map +1 -1
  12. package/dist/hooks/data/useOne.d.ts +1 -1
  13. package/dist/hooks/data/useOne.d.ts.map +1 -1
  14. package/dist/hooks/form/useForm.d.ts +1 -1
  15. package/dist/hooks/form/useForm.d.ts.map +1 -1
  16. package/dist/hooks/show/useShow.d.ts +3 -3
  17. package/dist/hooks/show/useShow.d.ts.map +1 -1
  18. package/dist/hooks/useSelect/index.d.ts +3 -3
  19. package/dist/hooks/useSelect/index.d.ts.map +1 -1
  20. package/dist/iife/index.js +6 -6
  21. package/dist/iife/index.js.map +1 -1
  22. package/dist/index.js +6 -6
  23. package/dist/index.js.map +1 -1
  24. package/dist/interfaces/auth.d.ts +12 -0
  25. package/dist/interfaces/auth.d.ts.map +1 -1
  26. package/package.json +1 -1
  27. package/src/components/authenticated/index.tsx +118 -139
  28. package/src/components/pages/auth/components/login/index.tsx +110 -84
  29. package/src/components/pages/auth/components/register/index.tsx +88 -65
  30. package/src/components/pages/welcome/index.tsx +125 -124
  31. package/src/hooks/auth/useLogin/index.ts +4 -4
  32. package/src/hooks/auth/useLogout/index.ts +4 -4
  33. package/src/hooks/auth/useRegister/index.ts +5 -4
  34. package/src/hooks/data/useMany.ts +1 -1
  35. package/src/hooks/data/useOne.ts +1 -1
  36. package/src/hooks/form/useForm.ts +1 -1
  37. package/src/hooks/show/useShow.ts +3 -3
  38. package/src/hooks/useSelect/index.ts +3 -2
  39. package/src/interfaces/auth.tsx +12 -0
@@ -137,9 +137,10 @@ export type UseSelectProps<TQueryFnData, TError, TData> = {
137
137
 
138
138
  export type UseSelectReturnType<
139
139
  TData extends BaseRecord = BaseRecord,
140
+ TError extends HttpError = HttpError,
140
141
  TOption extends BaseOption = BaseOption,
141
142
  > = {
142
- queryResult: QueryObserverResult<GetListResponse<TData>>;
143
+ queryResult: QueryObserverResult<GetListResponse<TData>, TError>;
143
144
  defaultValueQueryResult: QueryObserverResult<GetManyResponse<TData>>;
144
145
  onSearch: (value: string) => void;
145
146
  options: TOption[];
@@ -166,7 +167,7 @@ export const useSelect = <
166
167
  TOption extends BaseOption = BaseOption,
167
168
  >(
168
169
  props: UseSelectProps<TQueryFnData, TError, TData>,
169
- ): UseSelectReturnType<TData, TOption> => {
170
+ ): UseSelectReturnType<TData, TError, TOption> => {
170
171
  const [search, setSearch] = useState<CrudFilters>([]);
171
172
  const [options, setOptions] = useState<TOption[]>([]);
172
173
  const [selectedOptions, setSelectedOptions] = useState<TOption[]>([]);
@@ -73,6 +73,11 @@ export type AuthPageProps<
73
73
  * @optional
74
74
  */
75
75
  rememberMe?: React.ReactNode;
76
+ /**
77
+ * @description Can be used to hide the form components
78
+ * @optional
79
+ */
80
+ hideForm?: boolean;
76
81
  }>
77
82
  | PropsWithChildren<{
78
83
  /**
@@ -85,6 +90,11 @@ export type AuthPageProps<
85
90
  * @optional
86
91
  */
87
92
  providers?: OAuthProvider[];
93
+ /**
94
+ * @description Can be used to hide the form components
95
+ * @optional
96
+ */
97
+ hideForm?: boolean;
88
98
  }>
89
99
  | PropsWithChildren<{
90
100
  /**
@@ -156,6 +166,7 @@ export type LoginPageProps<
156
166
  contentProps?: TContentProps;
157
167
  formProps?: TFormProps;
158
168
  title?: React.ReactNode;
169
+ hideForm?: boolean;
159
170
  }>;
160
171
 
161
172
  /**
@@ -176,6 +187,7 @@ export type RegisterPageProps<
176
187
  contentProps?: TContentProps;
177
188
  formProps?: TFormProps;
178
189
  title?: React.ReactNode;
190
+ hideForm?: boolean;
179
191
  }>;
180
192
 
181
193
  /**