wcz-test 3.3.0 → 3.4.1
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.cjs +3655 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +426 -0
- package/dist/index.d.ts +19 -13
- package/dist/index.js +266 -191
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
import { TypographyProps, SxProps, Theme, BoxProps, ChipProps, ButtonProps, IconButtonProps, LinkProps, TabProps, ListItemButtonProps, CssVarsThemeOptions, TextFieldProps, SliderProps, RadioGroupProps, SwitchProps, CheckboxProps, AutocompleteProps } from '@mui/material';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import react__default, { FC, ReactNode, ComponentType } from 'react';
|
|
4
|
+
import { DropzoneOptions } from 'react-dropzone';
|
|
5
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
+
import { GridValidRowModel, GridRenderCellParams, GridColumnHeaderParams, GridActionsCellItemProps } from '@mui/x-data-grid-premium';
|
|
7
|
+
import { LinkComponent, ErrorComponentProps, LinkOptions } from '@tanstack/react-router';
|
|
8
|
+
import { TFunction } from 'i18next';
|
|
9
|
+
export { t } from 'i18next';
|
|
10
|
+
export { uuidv7 } from 'uuidv7';
|
|
11
|
+
import * as axios from 'axios';
|
|
12
|
+
import { DateTimePickerProps, DatePickerProps } from '@mui/x-date-pickers-pro';
|
|
13
|
+
import { NumericFormatProps, InputAttributes } from 'react-number-format/types/types';
|
|
14
|
+
import * as _tanstack_react_form from '@tanstack/react-form';
|
|
15
|
+
import * as _tanstack_form_core from '@tanstack/form-core';
|
|
16
|
+
export { default as useLocalStorageState } from 'use-local-storage-state';
|
|
17
|
+
export { useTranslation } from 'react-i18next';
|
|
18
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
19
|
+
import { DefinedInitialDataOptions, UseMutationOptions } from '@tanstack/react-query';
|
|
20
|
+
import { DetailedError } from 'tus-js-client';
|
|
21
|
+
|
|
22
|
+
interface TypographyWithIconProps extends TypographyProps {
|
|
23
|
+
startIcon?: React.ReactNode;
|
|
24
|
+
endIcon?: React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
declare const TypographyWithIcon: React.FC<TypographyWithIconProps>;
|
|
27
|
+
|
|
28
|
+
interface PageHeaderProps {
|
|
29
|
+
title: string;
|
|
30
|
+
action?: ReactNode;
|
|
31
|
+
sx?: SxProps<Theme>;
|
|
32
|
+
}
|
|
33
|
+
declare const PageHeader: FC<PageHeaderProps>;
|
|
34
|
+
|
|
35
|
+
declare const TableContainer: FC<BoxProps>;
|
|
36
|
+
|
|
37
|
+
interface DropzoneProps extends DropzoneOptions {
|
|
38
|
+
sx?: SxProps<Theme>;
|
|
39
|
+
}
|
|
40
|
+
declare const Dropzone: FC<DropzoneProps>;
|
|
41
|
+
|
|
42
|
+
interface FileMeta {
|
|
43
|
+
id: string;
|
|
44
|
+
subId: string;
|
|
45
|
+
appName: string;
|
|
46
|
+
fileName: string;
|
|
47
|
+
fileExtension: string;
|
|
48
|
+
fileSize: number;
|
|
49
|
+
mediaSubType: string;
|
|
50
|
+
mediaType: string;
|
|
51
|
+
mimeType: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
type FileActions = {
|
|
55
|
+
download?: boolean;
|
|
56
|
+
delete?: boolean;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
type FileViewerGridItemBar = "hidden" | "always" | "onMouseEnter";
|
|
60
|
+
interface FileViewerGridProps {
|
|
61
|
+
size?: number;
|
|
62
|
+
itemBar?: FileViewerGridItemBar;
|
|
63
|
+
sx?: SxProps<Theme>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface FileViewerListProps {
|
|
67
|
+
sx?: SxProps<Theme>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
interface FileViewerComponent {
|
|
71
|
+
Grid: ComponentType<FileViewerGridProps>;
|
|
72
|
+
List: ComponentType<FileViewerListProps>;
|
|
73
|
+
}
|
|
74
|
+
interface FileViewerProps {
|
|
75
|
+
/** Insert your record ID (can be multiple splitted by comma) */
|
|
76
|
+
subId: string | undefined | null;
|
|
77
|
+
onDelete?: (params: {
|
|
78
|
+
remainingFileMetas: FileMeta[];
|
|
79
|
+
deletedFileMeta: FileMeta;
|
|
80
|
+
}) => void;
|
|
81
|
+
actions?: FileActions;
|
|
82
|
+
children: (component: FileViewerComponent) => ReactNode;
|
|
83
|
+
}
|
|
84
|
+
declare const FileViewer: FC<FileViewerProps>;
|
|
85
|
+
|
|
86
|
+
interface ChipInputCellProps<T extends GridValidRowModel> {
|
|
87
|
+
params: GridRenderCellParams<T>;
|
|
88
|
+
slotProps?: ChipProps;
|
|
89
|
+
getLabel?: (object: T) => string | number;
|
|
90
|
+
}
|
|
91
|
+
declare const ChipInputCell: <T extends GridValidRowModel>({ params, slotProps, getLabel }: ChipInputCellProps<T>) => react_jsx_runtime.JSX.Element | null;
|
|
92
|
+
|
|
93
|
+
declare const EditableColumnHeader: <T extends GridValidRowModel>({ colDef }: GridColumnHeaderParams<T>) => react_jsx_runtime.JSX.Element;
|
|
94
|
+
|
|
95
|
+
declare const Component$5: react__default.ForwardRefExoticComponent<Omit<ButtonProps<"a">, "ref"> & react__default.RefAttributes<HTMLAnchorElement>>;
|
|
96
|
+
declare const RouterButton: LinkComponent<typeof Component$5>;
|
|
97
|
+
|
|
98
|
+
declare const Component$4: react__default.ForwardRefExoticComponent<GridActionsCellItemProps & react__default.RefAttributes<HTMLButtonElement>>;
|
|
99
|
+
declare const RouterGridActionsCellItem: LinkComponent<typeof Component$4>;
|
|
100
|
+
|
|
101
|
+
declare const Component$3: react__default.ForwardRefExoticComponent<Omit<IconButtonProps<"a">, "ref"> & react__default.RefAttributes<HTMLAnchorElement>>;
|
|
102
|
+
declare const RouterIconButton: LinkComponent<typeof Component$3>;
|
|
103
|
+
|
|
104
|
+
declare const Component$2: react__default.ForwardRefExoticComponent<Omit<LinkProps, "ref"> & react__default.RefAttributes<HTMLAnchorElement>>;
|
|
105
|
+
declare const RouterLink: LinkComponent<typeof Component$2>;
|
|
106
|
+
|
|
107
|
+
declare const Component$1: react__default.ForwardRefExoticComponent<Omit<TabProps<"a">, "ref"> & react__default.RefAttributes<HTMLAnchorElement>>;
|
|
108
|
+
declare const RouterTab: LinkComponent<typeof Component$1>;
|
|
109
|
+
|
|
110
|
+
declare const Component: react__default.ForwardRefExoticComponent<Omit<ListItemButtonProps<"a">, "ref"> & react__default.RefAttributes<HTMLAnchorElement>>;
|
|
111
|
+
declare const RouterListItemButton: LinkComponent<typeof Component>;
|
|
112
|
+
|
|
113
|
+
declare function RouterNotFound(): react_jsx_runtime.JSX.Element;
|
|
114
|
+
|
|
115
|
+
interface RouterErrorProps {
|
|
116
|
+
error: ErrorComponentProps["error"];
|
|
117
|
+
}
|
|
118
|
+
declare const RouterError: FC<RouterErrorProps>;
|
|
119
|
+
|
|
120
|
+
interface User {
|
|
121
|
+
employeeId: string;
|
|
122
|
+
name: string;
|
|
123
|
+
department: string;
|
|
124
|
+
email?: string;
|
|
125
|
+
company: string;
|
|
126
|
+
category: string;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
interface NavigationParams {
|
|
130
|
+
user: User;
|
|
131
|
+
t: TFunction<"translation", undefined>;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
interface NavigationPageItem extends Pick<LinkOptions, "to" | "href" | "params" | "search"> {
|
|
135
|
+
title: string;
|
|
136
|
+
icon: React.ReactNode;
|
|
137
|
+
children?: NavigationItem[];
|
|
138
|
+
hidden?: boolean;
|
|
139
|
+
}
|
|
140
|
+
interface NavigationDivider {
|
|
141
|
+
kind: "divider";
|
|
142
|
+
hidden?: boolean;
|
|
143
|
+
}
|
|
144
|
+
interface NavigationHeader {
|
|
145
|
+
kind: "header";
|
|
146
|
+
title: string;
|
|
147
|
+
hidden?: boolean;
|
|
148
|
+
}
|
|
149
|
+
type NavigationItem = NavigationPageItem | NavigationDivider | NavigationHeader;
|
|
150
|
+
type Navigation = NavigationItem[];
|
|
151
|
+
|
|
152
|
+
interface ProvidersProps {
|
|
153
|
+
getNavigation?: (parameters: NavigationParams) => Navigation;
|
|
154
|
+
theme?: Pick<CssVarsThemeOptions, "colorSchemes" | "components">;
|
|
155
|
+
children: ReactNode;
|
|
156
|
+
}
|
|
157
|
+
declare const LayoutProvider: FC<ProvidersProps>;
|
|
158
|
+
|
|
159
|
+
declare class Platform {
|
|
160
|
+
static get isAndroid(): boolean;
|
|
161
|
+
static get isIOS(): boolean;
|
|
162
|
+
static get isWindows(): boolean;
|
|
163
|
+
static get isMacOS(): boolean;
|
|
164
|
+
private static get userAgent();
|
|
165
|
+
}
|
|
166
|
+
interface RootRouteHeadProps {
|
|
167
|
+
title: string;
|
|
168
|
+
}
|
|
169
|
+
declare const rootRouteHead: ({ title }: RootRouteHeadProps) => () => {
|
|
170
|
+
meta: ({
|
|
171
|
+
charSet: string;
|
|
172
|
+
name?: undefined;
|
|
173
|
+
content?: undefined;
|
|
174
|
+
title?: undefined;
|
|
175
|
+
} | {
|
|
176
|
+
name: string;
|
|
177
|
+
content: string;
|
|
178
|
+
charSet?: undefined;
|
|
179
|
+
title?: undefined;
|
|
180
|
+
} | {
|
|
181
|
+
title: string;
|
|
182
|
+
charSet?: undefined;
|
|
183
|
+
name?: undefined;
|
|
184
|
+
content?: undefined;
|
|
185
|
+
})[];
|
|
186
|
+
links: ({
|
|
187
|
+
rel: string;
|
|
188
|
+
sizes: string;
|
|
189
|
+
href: string;
|
|
190
|
+
type?: undefined;
|
|
191
|
+
} | {
|
|
192
|
+
rel: string;
|
|
193
|
+
type: string;
|
|
194
|
+
sizes: string;
|
|
195
|
+
href: string;
|
|
196
|
+
} | {
|
|
197
|
+
rel: string;
|
|
198
|
+
href: string;
|
|
199
|
+
sizes?: undefined;
|
|
200
|
+
type?: undefined;
|
|
201
|
+
})[];
|
|
202
|
+
};
|
|
203
|
+
declare const wczApiClient: axios.AxiosInstance;
|
|
204
|
+
|
|
205
|
+
type FormSubmitButtonProps = Omit<ButtonProps, "loading" | "disabled" | "onClick" | "type">;
|
|
206
|
+
|
|
207
|
+
type FormOmittedProps = "name" | "value" | "onChange" | "onBlur" | "error" | "helperText" | "renderInput" | "type" | "aria-label";
|
|
208
|
+
|
|
209
|
+
interface FormDateTimePickerProps extends Omit<DateTimePickerProps, FormOmittedProps> {
|
|
210
|
+
textFieldProps?: TextFieldProps;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
interface FormDatePickerProps extends Omit<DatePickerProps, FormOmittedProps> {
|
|
214
|
+
textFieldProps?: TextFieldProps;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
interface FormSliderProps extends Omit<SliderProps, FormOmittedProps> {
|
|
218
|
+
label?: string;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
interface Option {
|
|
222
|
+
label: string;
|
|
223
|
+
value: string | number;
|
|
224
|
+
}
|
|
225
|
+
interface FormRadioGroupProps extends Omit<RadioGroupProps, FormOmittedProps> {
|
|
226
|
+
label?: string;
|
|
227
|
+
options: Option[];
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
interface FormSwitchProps extends Omit<SwitchProps, FormOmittedProps> {
|
|
231
|
+
label?: string;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
interface FormCheckboxProps extends Omit<CheckboxProps, FormOmittedProps> {
|
|
235
|
+
label?: string;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
interface FormAutocompleteProps extends Omit<AutocompleteProps<any, boolean, boolean, boolean>, FormOmittedProps> {
|
|
239
|
+
textFieldProps?: Omit<TextFieldProps, FormOmittedProps>;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
interface FormNumberFieldProps extends Omit<TextFieldProps, FormOmittedProps> {
|
|
243
|
+
defaultValue?: number | null;
|
|
244
|
+
options?: Omit<NumericFormatProps<InputAttributes>, "customInput" | "onValueChange" | keyof InputAttributes>;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
interface FormTextFieldProps extends Omit<TextFieldProps, FormOmittedProps> {
|
|
248
|
+
type?: "color" | "email" | "password" | "search" | "tel" | "text" | "url";
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
declare const useFieldContext: <TData>() => _tanstack_form_core.FieldApi<any, string, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
|
|
252
|
+
declare const useFormContext: () => _tanstack_react_form.ReactFormExtendedApi<Record<string, never>, any, any, any, any, any, any, any, any, any, any, any>;
|
|
253
|
+
declare const useLayoutForm: <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, TOnDynamic extends _tanstack_form_core.FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync extends _tanstack_form_core.FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends _tanstack_form_core.FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta>(props: _tanstack_form_core.FormOptions<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>) => _tanstack_react_form.AppFieldExtendedReactFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
|
|
254
|
+
readonly TextField: react.FC<FormTextFieldProps>;
|
|
255
|
+
readonly NumberField: react.FC<FormNumberFieldProps>;
|
|
256
|
+
readonly Autocomplete: react.FC<FormAutocompleteProps>;
|
|
257
|
+
readonly Checkbox: react.FC<FormCheckboxProps>;
|
|
258
|
+
readonly Switch: react.FC<FormSwitchProps>;
|
|
259
|
+
readonly RadioGroup: react.FC<FormRadioGroupProps>;
|
|
260
|
+
readonly Slider: react.FC<FormSliderProps>;
|
|
261
|
+
readonly DatePicker: react.FC<FormDatePickerProps>;
|
|
262
|
+
readonly DateTimePicker: react.FC<FormDateTimePickerProps>;
|
|
263
|
+
}, {
|
|
264
|
+
readonly SubmitButton: react.FC<FormSubmitButtonProps>;
|
|
265
|
+
}>;
|
|
266
|
+
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, TOnDynamic extends _tanstack_form_core.FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync 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, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
|
|
267
|
+
readonly TextField: react.FC<FormTextFieldProps>;
|
|
268
|
+
readonly NumberField: react.FC<FormNumberFieldProps>;
|
|
269
|
+
readonly Autocomplete: react.FC<FormAutocompleteProps>;
|
|
270
|
+
readonly Checkbox: react.FC<FormCheckboxProps>;
|
|
271
|
+
readonly Switch: react.FC<FormSwitchProps>;
|
|
272
|
+
readonly RadioGroup: react.FC<FormRadioGroupProps>;
|
|
273
|
+
readonly Slider: react.FC<FormSliderProps>;
|
|
274
|
+
readonly DatePicker: react.FC<FormDatePickerProps>;
|
|
275
|
+
readonly DateTimePicker: react.FC<FormDateTimePickerProps>;
|
|
276
|
+
}, {
|
|
277
|
+
readonly SubmitButton: react.FC<FormSubmitButtonProps>;
|
|
278
|
+
}, TRenderProps>) => (props: react.PropsWithChildren<NoInfer<[unknown] extends [TRenderProps] ? any : TRenderProps> & {
|
|
279
|
+
form: _tanstack_react_form.AppFieldExtendedReactFormApi<[unknown] extends [TFormData] ? any : TFormData, [_tanstack_form_core.FormValidateOrFn<TFormData> | undefined] extends [TOnMount] ? [TOnMount] extends [TOnMount & (_tanstack_form_core.FormValidateOrFn<TFormData> | undefined)] ? any : TOnMount : TOnMount, [_tanstack_form_core.FormValidateOrFn<TFormData> | undefined] extends [TOnChange] ? [TOnChange] extends [TOnChange & (_tanstack_form_core.FormValidateOrFn<TFormData> | undefined)] ? any : TOnChange : TOnChange, [_tanstack_form_core.FormValidateOrFn<TFormData> | undefined] extends [TOnChangeAsync] ? [TOnChangeAsync] extends [TOnChangeAsync & (_tanstack_form_core.FormValidateOrFn<TFormData> | undefined)] ? any : TOnChangeAsync : TOnChangeAsync, [_tanstack_form_core.FormValidateOrFn<TFormData> | undefined] extends [TOnBlur] ? [TOnBlur] extends [TOnBlur & (_tanstack_form_core.FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlur : TOnBlur, [_tanstack_form_core.FormValidateOrFn<TFormData> | undefined] extends [TOnBlurAsync] ? [TOnBlurAsync] extends [TOnBlurAsync & (_tanstack_form_core.FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlurAsync : TOnBlurAsync, [_tanstack_form_core.FormValidateOrFn<TFormData> | undefined] extends [TOnSubmit] ? [TOnSubmit] extends [TOnSubmit & (_tanstack_form_core.FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmit : TOnSubmit, [_tanstack_form_core.FormValidateOrFn<TFormData> | undefined] extends [TOnSubmitAsync] ? [TOnSubmitAsync] extends [TOnSubmitAsync & (_tanstack_form_core.FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmitAsync : TOnSubmitAsync, [_tanstack_form_core.FormValidateOrFn<TFormData> | undefined] extends [TOnDynamic] ? [TOnDynamic] extends [TOnDynamic & (_tanstack_form_core.FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamic : TOnDynamic, [_tanstack_form_core.FormValidateOrFn<TFormData> | undefined] extends [TOnDynamicAsync] ? [TOnDynamicAsync] extends [TOnDynamicAsync & (_tanstack_form_core.FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamicAsync : TOnDynamicAsync, [_tanstack_form_core.FormValidateOrFn<TFormData> | undefined] extends [TOnServer] ? [TOnServer] extends [TOnServer & (_tanstack_form_core.FormValidateOrFn<TFormData> | undefined)] ? any : TOnServer : TOnServer, [unknown] extends [TSubmitMeta] ? any : TSubmitMeta, {
|
|
280
|
+
readonly TextField: react.FC<FormTextFieldProps>;
|
|
281
|
+
readonly NumberField: react.FC<FormNumberFieldProps>;
|
|
282
|
+
readonly Autocomplete: react.FC<FormAutocompleteProps>;
|
|
283
|
+
readonly Checkbox: react.FC<FormCheckboxProps>;
|
|
284
|
+
readonly Switch: react.FC<FormSwitchProps>;
|
|
285
|
+
readonly RadioGroup: react.FC<FormRadioGroupProps>;
|
|
286
|
+
readonly Slider: react.FC<FormSliderProps>;
|
|
287
|
+
readonly DatePicker: react.FC<FormDatePickerProps>;
|
|
288
|
+
readonly DateTimePicker: react.FC<FormDateTimePickerProps>;
|
|
289
|
+
}, {
|
|
290
|
+
readonly SubmitButton: react.FC<FormSubmitButtonProps>;
|
|
291
|
+
}>;
|
|
292
|
+
}>) => react.JSX.Element;
|
|
293
|
+
|
|
294
|
+
interface OpenDialogOptions<R> {
|
|
295
|
+
onClose?: (result: R) => Promise<void>;
|
|
296
|
+
}
|
|
297
|
+
interface AlertOptions {
|
|
298
|
+
title?: ReactNode;
|
|
299
|
+
}
|
|
300
|
+
interface ConfirmOptions {
|
|
301
|
+
title?: ReactNode;
|
|
302
|
+
cancelText?: ReactNode;
|
|
303
|
+
}
|
|
304
|
+
interface DialogProps<P = undefined, R = void> {
|
|
305
|
+
payload: P;
|
|
306
|
+
open: boolean;
|
|
307
|
+
onClose: (result: R) => Promise<void>;
|
|
308
|
+
}
|
|
309
|
+
type OpenAlertDialog = (message: ReactNode, options?: AlertOptions) => Promise<void>;
|
|
310
|
+
type OpenConfirmDialog = (message: ReactNode, options?: ConfirmOptions) => Promise<boolean>;
|
|
311
|
+
type DialogComponent<P, R> = React.ComponentType<DialogProps<P, R>>;
|
|
312
|
+
interface OpenDialog {
|
|
313
|
+
<P extends undefined, R>(Component: DialogComponent<P, R>, payload?: P, options?: OpenDialogOptions<R>): Promise<R>;
|
|
314
|
+
<P, R>(Component: DialogComponent<P, R>, payload: P, options?: OpenDialogOptions<R>): Promise<R>;
|
|
315
|
+
}
|
|
316
|
+
type CloseDialog = <R>(dialog: Promise<R>, result: R) => Promise<R>;
|
|
317
|
+
interface DialogHook {
|
|
318
|
+
alert: OpenAlertDialog;
|
|
319
|
+
confirm: OpenConfirmDialog;
|
|
320
|
+
open: OpenDialog;
|
|
321
|
+
close: CloseDialog;
|
|
322
|
+
}
|
|
323
|
+
declare function useDialogs(): DialogHook;
|
|
324
|
+
|
|
325
|
+
type OptionalId = string | undefined | null;
|
|
326
|
+
type BaseFileMetaArrayQueryOptions = Omit<DefinedInitialDataOptions<FileMeta[]>, "queryKey" | "queryFn" | "staleTime" | "gcTime" | "refetchOnWindowFocus" | "initialData">;
|
|
327
|
+
type BaseBlobQueryOptions = Omit<DefinedInitialDataOptions<Blob, Error, string>, "queryKey" | "queryFn" | "select" | "staleTime" | "gcTime" | "refetchOnWindowFocus" | "initialData">;
|
|
328
|
+
type BaseFileMetaMutationOptions = Omit<UseMutationOptions<FileMeta, Error, FileMeta>, "mutationFn" | "onSettled">;
|
|
329
|
+
type BaseBlobMutationOptions = Omit<UseMutationOptions<Blob, Error, FileMeta>, "mutationFn" | "onSuccess">;
|
|
330
|
+
type BaseStringMutationOptions = Omit<UseMutationOptions<string, Error, string>, "mutationFn" | "onSettled">;
|
|
331
|
+
declare const useGetFileMetas: (subId: OptionalId, options?: BaseFileMetaArrayQueryOptions) => _tanstack_react_query.UseQueryResult<FileMeta[], Error>;
|
|
332
|
+
declare const useGetFileThumbnail: (meta: FileMeta | undefined | null, options?: BaseBlobQueryOptions) => _tanstack_react_query.UseQueryResult<string, Error>;
|
|
333
|
+
declare const useGetFile: (meta: FileMeta | undefined | null, options?: BaseBlobQueryOptions) => _tanstack_react_query.UseQueryResult<string, Error>;
|
|
334
|
+
declare const useDownloadFile: (options?: BaseBlobMutationOptions) => _tanstack_react_query.UseMutationResult<Blob, Error, FileMeta, unknown>;
|
|
335
|
+
declare const useOpenFile: (options?: BaseBlobMutationOptions) => _tanstack_react_query.UseMutationResult<Blob, Error, FileMeta, unknown>;
|
|
336
|
+
declare const useUpdateFileMeta: (options?: BaseFileMetaMutationOptions) => _tanstack_react_query.UseMutationResult<FileMeta, Error, FileMeta, unknown>;
|
|
337
|
+
declare const useDeleteFile: (options?: BaseFileMetaMutationOptions) => _tanstack_react_query.UseMutationResult<FileMeta, Error, FileMeta, unknown>;
|
|
338
|
+
declare const useDeleteFiles: (options?: BaseStringMutationOptions) => _tanstack_react_query.UseMutationResult<string, Error, string, unknown>;
|
|
339
|
+
interface UseUploadFileProps {
|
|
340
|
+
subId: OptionalId;
|
|
341
|
+
onSuccess?: (meta: Pick<FileMeta, "id" | "appName" | "subId" | "fileName">) => void;
|
|
342
|
+
onError?: (error: Error | DetailedError) => void;
|
|
343
|
+
}
|
|
344
|
+
declare const useUploadFile: ({ subId, onSuccess, onError }: UseUploadFileProps) => {
|
|
345
|
+
mutate: (file: File) => Promise<void>;
|
|
346
|
+
progress: number;
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
interface EmailAttachment {
|
|
350
|
+
appName: string;
|
|
351
|
+
subId: string;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
interface Email {
|
|
355
|
+
subject: string;
|
|
356
|
+
body: string;
|
|
357
|
+
to: string[];
|
|
358
|
+
bcc?: string[];
|
|
359
|
+
cc?: string[];
|
|
360
|
+
attachments?: EmailAttachment[];
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
declare enum EmployeeCategoryGroup {
|
|
364
|
+
IDL = "IDL",
|
|
365
|
+
FD = "FD",
|
|
366
|
+
FI = "FI"
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
declare enum EmployeeStatus {
|
|
370
|
+
Active = "Active",
|
|
371
|
+
Terminated = "Terminated",
|
|
372
|
+
LeaveOfAbsence = "Leave of Absence"
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
interface Employee {
|
|
376
|
+
badgeId: string;
|
|
377
|
+
category: string;
|
|
378
|
+
categoryGroup: EmployeeCategoryGroup;
|
|
379
|
+
companyCode: string;
|
|
380
|
+
contactPhone: string;
|
|
381
|
+
departmentId: string;
|
|
382
|
+
departmentDescription: string;
|
|
383
|
+
emailString: string;
|
|
384
|
+
employeeId: string;
|
|
385
|
+
extensionNumber: string;
|
|
386
|
+
firstName: string;
|
|
387
|
+
gender: string;
|
|
388
|
+
hiredDate: Date;
|
|
389
|
+
lastName: string;
|
|
390
|
+
managerId: string;
|
|
391
|
+
middleName: string;
|
|
392
|
+
name: string;
|
|
393
|
+
nameTitleCase: string;
|
|
394
|
+
nfcSn: string;
|
|
395
|
+
plantId: string;
|
|
396
|
+
position: string;
|
|
397
|
+
previousEmployeeIds: string | null;
|
|
398
|
+
reHiredDate: Date | null;
|
|
399
|
+
recordNumber: number;
|
|
400
|
+
status: EmployeeStatus;
|
|
401
|
+
supervisorId: string;
|
|
402
|
+
terminationDate: Date | null;
|
|
403
|
+
terminationFutureDate: Date | null;
|
|
404
|
+
type: string;
|
|
405
|
+
upperDepartmentId: string;
|
|
406
|
+
jobCode: string;
|
|
407
|
+
jobDescription: string;
|
|
408
|
+
terminationReason: string | null;
|
|
409
|
+
supervisorRecordNumber: number;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
interface Department {
|
|
413
|
+
departmentId: string;
|
|
414
|
+
description: string;
|
|
415
|
+
managerId: string;
|
|
416
|
+
managerRecordNumber: string;
|
|
417
|
+
treeLevel: number;
|
|
418
|
+
upperDepartmentId: string;
|
|
419
|
+
companyCode: string;
|
|
420
|
+
location: string;
|
|
421
|
+
salLocation: string;
|
|
422
|
+
plantId: string;
|
|
423
|
+
manager: Employee;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
export { ChipInputCell, type Department, type DialogProps, Dropzone, EditableColumnHeader, type Email, type EmailAttachment, type Employee, EmployeeCategoryGroup, EmployeeStatus, type FileMeta, FileViewer, LayoutProvider, type Navigation, type NavigationParams, PageHeader, Platform, RouterButton, RouterError, RouterGridActionsCellItem, RouterIconButton, RouterLink, RouterListItemButton, RouterNotFound, RouterTab, TableContainer, TypographyWithIcon, type User, rootRouteHead, useDeleteFile, useDeleteFiles, useDialogs, useDownloadFile, useFieldContext, useFormContext, useGetFile, useGetFileMetas, useGetFileThumbnail, useLayoutForm, useOpenFile, useUpdateFileMeta, useUploadFile, wczApiClient, withLayoutForm };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TypographyProps, SxProps, Theme,
|
|
1
|
+
import { TypographyProps, SxProps, Theme, BoxProps, ChipProps, ButtonProps, IconButtonProps, LinkProps, TabProps, ListItemButtonProps, CssVarsThemeOptions, TextFieldProps, SliderProps, RadioGroupProps, SwitchProps, CheckboxProps, AutocompleteProps } from '@mui/material';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import react__default, { FC, ReactNode, ComponentType } from 'react';
|
|
4
4
|
import { DropzoneOptions } from 'react-dropzone';
|
|
@@ -32,7 +32,7 @@ interface PageHeaderProps {
|
|
|
32
32
|
}
|
|
33
33
|
declare const PageHeader: FC<PageHeaderProps>;
|
|
34
34
|
|
|
35
|
-
declare const TableContainer: FC<
|
|
35
|
+
declare const TableContainer: FC<BoxProps>;
|
|
36
36
|
|
|
37
37
|
interface DropzoneProps extends DropzoneOptions {
|
|
38
38
|
sx?: SxProps<Theme>;
|
|
@@ -92,20 +92,23 @@ declare const ChipInputCell: <T extends GridValidRowModel>({ params, slotProps,
|
|
|
92
92
|
|
|
93
93
|
declare const EditableColumnHeader: <T extends GridValidRowModel>({ colDef }: GridColumnHeaderParams<T>) => react_jsx_runtime.JSX.Element;
|
|
94
94
|
|
|
95
|
-
declare const Component$
|
|
96
|
-
declare const RouterButton: LinkComponent<typeof Component$
|
|
95
|
+
declare const Component$5: react__default.ForwardRefExoticComponent<Omit<ButtonProps<"a">, "ref"> & react__default.RefAttributes<HTMLAnchorElement>>;
|
|
96
|
+
declare const RouterButton: LinkComponent<typeof Component$5>;
|
|
97
97
|
|
|
98
|
-
declare const Component$
|
|
99
|
-
declare const RouterGridActionsCellItem: LinkComponent<typeof Component$
|
|
98
|
+
declare const Component$4: react__default.ForwardRefExoticComponent<GridActionsCellItemProps & react__default.RefAttributes<HTMLButtonElement>>;
|
|
99
|
+
declare const RouterGridActionsCellItem: LinkComponent<typeof Component$4>;
|
|
100
100
|
|
|
101
|
-
declare const Component$
|
|
102
|
-
declare const RouterIconButton: LinkComponent<typeof Component$
|
|
101
|
+
declare const Component$3: react__default.ForwardRefExoticComponent<Omit<IconButtonProps<"a">, "ref"> & react__default.RefAttributes<HTMLAnchorElement>>;
|
|
102
|
+
declare const RouterIconButton: LinkComponent<typeof Component$3>;
|
|
103
103
|
|
|
104
|
-
declare const Component$
|
|
105
|
-
declare const RouterLink: LinkComponent<typeof Component$
|
|
104
|
+
declare const Component$2: react__default.ForwardRefExoticComponent<Omit<LinkProps, "ref"> & react__default.RefAttributes<HTMLAnchorElement>>;
|
|
105
|
+
declare const RouterLink: LinkComponent<typeof Component$2>;
|
|
106
106
|
|
|
107
|
-
declare const Component: react__default.ForwardRefExoticComponent<Omit<TabProps<"a">, "ref"> & react__default.RefAttributes<HTMLAnchorElement>>;
|
|
108
|
-
declare const RouterTab: LinkComponent<typeof Component>;
|
|
107
|
+
declare const Component$1: react__default.ForwardRefExoticComponent<Omit<TabProps<"a">, "ref"> & react__default.RefAttributes<HTMLAnchorElement>>;
|
|
108
|
+
declare const RouterTab: LinkComponent<typeof Component$1>;
|
|
109
|
+
|
|
110
|
+
declare const Component: react__default.ForwardRefExoticComponent<Omit<ListItemButtonProps<"a">, "ref"> & react__default.RefAttributes<HTMLAnchorElement>>;
|
|
111
|
+
declare const RouterListItemButton: LinkComponent<typeof Component>;
|
|
109
112
|
|
|
110
113
|
declare function RouterNotFound(): react_jsx_runtime.JSX.Element;
|
|
111
114
|
|
|
@@ -132,13 +135,16 @@ interface NavigationPageItem extends Pick<LinkOptions, "to" | "href" | "params"
|
|
|
132
135
|
title: string;
|
|
133
136
|
icon: React.ReactNode;
|
|
134
137
|
children?: NavigationItem[];
|
|
138
|
+
hidden?: boolean;
|
|
135
139
|
}
|
|
136
140
|
interface NavigationDivider {
|
|
137
141
|
kind: "divider";
|
|
142
|
+
hidden?: boolean;
|
|
138
143
|
}
|
|
139
144
|
interface NavigationHeader {
|
|
140
145
|
kind: "header";
|
|
141
146
|
title: string;
|
|
147
|
+
hidden?: boolean;
|
|
142
148
|
}
|
|
143
149
|
type NavigationItem = NavigationPageItem | NavigationDivider | NavigationHeader;
|
|
144
150
|
type Navigation = NavigationItem[];
|
|
@@ -417,4 +423,4 @@ interface Department {
|
|
|
417
423
|
manager: Employee;
|
|
418
424
|
}
|
|
419
425
|
|
|
420
|
-
export { ChipInputCell, type Department, type DialogProps, Dropzone, EditableColumnHeader, type Email, type EmailAttachment, type Employee, EmployeeCategoryGroup, EmployeeStatus, type FileMeta, FileViewer, LayoutProvider, type Navigation, type NavigationParams, PageHeader, Platform, RouterButton, RouterError, RouterGridActionsCellItem, RouterIconButton, RouterLink, RouterNotFound, RouterTab, TableContainer, TypographyWithIcon, type User, rootRouteHead, useDeleteFile, useDeleteFiles, useDialogs, useDownloadFile, useFieldContext, useFormContext, useGetFile, useGetFileMetas, useGetFileThumbnail, useLayoutForm, useOpenFile, useUpdateFileMeta, useUploadFile, wczApiClient, withLayoutForm };
|
|
426
|
+
export { ChipInputCell, type Department, type DialogProps, Dropzone, EditableColumnHeader, type Email, type EmailAttachment, type Employee, EmployeeCategoryGroup, EmployeeStatus, type FileMeta, FileViewer, LayoutProvider, type Navigation, type NavigationParams, PageHeader, Platform, RouterButton, RouterError, RouterGridActionsCellItem, RouterIconButton, RouterLink, RouterListItemButton, RouterNotFound, RouterTab, TableContainer, TypographyWithIcon, type User, rootRouteHead, useDeleteFile, useDeleteFiles, useDialogs, useDownloadFile, useFieldContext, useFormContext, useGetFile, useGetFileMetas, useGetFileThumbnail, useLayoutForm, useOpenFile, useUpdateFileMeta, useUploadFile, wczApiClient, withLayoutForm };
|