wcz-test 2.14.0 → 3.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/dist/index.d.ts CHANGED
@@ -1,13 +1,16 @@
1
- import { TypographyProps, ContainerProps, ChipProps, ButtonProps, IconButtonProps, LinkProps, TabProps, CssVarsThemeOptions, TextFieldProps, SliderProps, RadioGroupProps, SwitchProps, CheckboxProps, AutocompleteProps } from '@mui/material';
1
+ import { TypographyProps, ContainerProps, SxProps, Theme, ChipProps, ButtonProps, IconButtonProps, LinkProps, TabProps, CssVarsThemeOptions, TextFieldProps, SliderProps, RadioGroupProps, SwitchProps, CheckboxProps, AutocompleteProps } from '@mui/material';
2
2
  export { PageHeader } from '@toolpad/core/PageContainer';
3
3
  import * as react from 'react';
4
4
  import react__default, { FC } from 'react';
5
+ import { DropzoneOptions } from 'react-dropzone';
5
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
7
  import { GridValidRowModel, GridRenderCellParams, GridColumnHeaderParams, GridActionsCellItemProps } from '@mui/x-data-grid-premium';
7
8
  import { LinkComponent, ErrorComponentProps } from '@tanstack/react-router';
8
9
  import { Navigation } from '@toolpad/core/AppProvider';
9
10
  export { Navigation } from '@toolpad/core/AppProvider';
11
+ import { DashboardLayoutProps } from '@toolpad/core/DashboardLayout';
10
12
  import { TFunction } from 'i18next';
13
+ export { t } from 'i18next';
11
14
  export { uuidv7 } from 'uuidv7';
12
15
  import * as axios from 'axios';
13
16
  import { DateTimePickerProps, DatePickerProps } from '@mui/x-date-pickers-pro';
@@ -30,6 +33,11 @@ declare const TypographyWithIcon: React.FC<TypographyWithIconProps>;
30
33
 
31
34
  declare const PageContainer: FC<ContainerProps>;
32
35
 
36
+ interface DropzoneProps extends DropzoneOptions {
37
+ sx?: SxProps<Theme>;
38
+ }
39
+ declare const Dropzone: FC<DropzoneProps>;
40
+
33
41
  interface ChipInputCellProps<T extends GridValidRowModel> {
34
42
  params: GridRenderCellParams<T>;
35
43
  slotProps?: ChipProps;
@@ -75,20 +83,19 @@ interface NavigationParams {
75
83
  t: TFunction<"translation", undefined>;
76
84
  }
77
85
 
78
- interface ProvidersProps {
86
+ interface ProvidersProps extends Pick<DashboardLayoutProps, "children" | "defaultSidebarCollapsed" | "disableCollapsibleSidebar" | "sidebarExpandedWidth"> {
79
87
  getNavigation?: (parameters: NavigationParams) => Navigation;
80
88
  theme?: Pick<CssVarsThemeOptions, "colorSchemes" | "components">;
81
- children: React.ReactNode;
82
89
  }
83
90
  declare const LayoutProvider: FC<ProvidersProps>;
84
91
 
85
92
  declare class Platform {
86
- static readonly isAndroid: boolean;
87
- static readonly isIOS: boolean;
88
- static readonly isWindows: boolean;
89
- static readonly isMacOS: boolean;
93
+ static get isAndroid(): boolean;
94
+ static get isIOS(): boolean;
95
+ static get isWindows(): boolean;
96
+ static get isMacOS(): boolean;
97
+ private static get userAgent();
90
98
  }
91
- declare const getContrastTextColor: (color: string) => "black" | "white";
92
99
  interface RootRouteHeadProps {
93
100
  title: string;
94
101
  }
@@ -192,7 +199,7 @@ declare const useLayoutForm: <TFormData, TOnMount extends _tanstack_form_core.Fo
192
199
  }>>;
193
200
  AppForm: react.ComponentType<react.PropsWithChildren>;
194
201
  };
195
- declare const withLayoutForm: <TFormData, TOnMount extends _tanstack_form_core.FormValidateOrFn<TFormData> | undefined, TOnChange extends _tanstack_form_core.FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends _tanstack_form_core.FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends _tanstack_form_core.FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends _tanstack_form_core.FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends _tanstack_form_core.FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends _tanstack_form_core.FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends _tanstack_form_core.FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta, TRenderProps extends Record<string, unknown> = {}>({ render, props, }: _tanstack_react_form.WithFormProps<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta, {
202
+ declare const withLayoutForm: <TFormData, TOnMount extends _tanstack_form_core.FormValidateOrFn<TFormData> | undefined, TOnChange extends _tanstack_form_core.FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends _tanstack_form_core.FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends _tanstack_form_core.FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends _tanstack_form_core.FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends _tanstack_form_core.FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends _tanstack_form_core.FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends _tanstack_form_core.FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta, TRenderProps extends object = {}>({ render, props, }: _tanstack_react_form.WithFormProps<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta, {
196
203
  readonly TextField: react.FC<FormTextFieldProps>;
197
204
  readonly NumberField: react.FC<FormNumberFieldProps>;
198
205
  readonly Autocomplete: react.FC<FormAutocompleteProps>;
@@ -245,12 +252,18 @@ declare const useDeleteFile: (options?: Omit<UseMutationOptions<FileMeta, Error,
245
252
  declare const useDeleteFiles: (options?: Omit<UseMutationOptions<string, Error, string>, "mutationFn" | "onSettled">) => _tanstack_react_query.UseMutationResult<string, Error, string, unknown>;
246
253
  interface UseUploadFileProps {
247
254
  subId: string | undefined | null;
248
- onSuccess?: (file: File) => void;
255
+ onSuccess?: (meta: Pick<FileMeta, "id" | "appName" | "subId" | "fileName">) => void;
249
256
  onError?: (error: Error | DetailedError) => void;
250
257
  }
251
258
  declare const useUploadFile: ({ subId, onSuccess, onError }: UseUploadFileProps) => {
252
259
  mutate: (file: File) => Promise<void>;
253
- uploadProgress: number;
260
+ progress: number;
261
+ };
262
+ declare function useOptimisticFileMutation(subId: string | undefined | null, options?: Omit<DefinedInitialDataOptions<FileMeta[]>, "queryKey" | "queryFn" | "initialData" | "refetchOnWindowFocus">): {
263
+ addFile: (meta: FileMeta) => void;
264
+ removeFile: (meta: FileMeta) => void;
265
+ save: () => void;
266
+ undo: () => void;
254
267
  };
255
268
 
256
269
  interface EmailAttachment {
@@ -326,4 +339,4 @@ interface PeoplesoftDepartment {
326
339
  manager: PeoplesoftEmployee;
327
340
  }
328
341
 
329
- export { ChipInputCell, EditableColumnHeader, type Email, type EmailAttachment, EmployeeCategoryGroup, EmployeeStatus, type FileMeta, LayoutProvider, type NavigationParams, PageContainer, type PeoplesoftDepartment, type PeoplesoftEmployee, Platform, RouterButton, RouterError, RouterGridActionsCellItem, RouterIconButton, RouterLink, RouterNotFound, RouterTab, TypographyWithIcon, type User, getContrastTextColor, rootRouteHead, useDeleteFile, useDeleteFiles, useDownloadFile, useFieldContext, useFormContext, useGetFile, useGetFileMetas, useGetFileThumbnail, useLayoutForm, useOpenFile, useUpdateFileMeta, useUploadFile, wczApiClient, withLayoutForm };
342
+ export { ChipInputCell, Dropzone, EditableColumnHeader, type Email, type EmailAttachment, EmployeeCategoryGroup, EmployeeStatus, type FileMeta, LayoutProvider, type NavigationParams, PageContainer, type PeoplesoftDepartment, type PeoplesoftEmployee, Platform, RouterButton, RouterError, RouterGridActionsCellItem, RouterIconButton, RouterLink, RouterNotFound, RouterTab, TypographyWithIcon, type User, rootRouteHead, useDeleteFile, useDeleteFiles, useDownloadFile, useFieldContext, useFormContext, useGetFile, useGetFileMetas, useGetFileThumbnail, useLayoutForm, useOpenFile, useOptimisticFileMutation, useUpdateFileMeta, useUploadFile, wczApiClient, withLayoutForm };