react-dialogger 1.1.21 → 1.1.23
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/components/CircularProgress.d.ts +1 -2
- package/components/CircularProgress.js +5 -8
- package/components/DialogActionBase.d.ts +1 -2
- package/components/DialogActionBase.js +10 -11
- package/components/DialogBase.d.ts +4 -4
- package/components/DialogBase.js +115 -105
- package/components/Futures/DialogCloseAction.d.ts +1 -2
- package/components/Futures/DialogCloseAction.js +4 -28
- package/components/Futures/DialogFullscreenAction.d.ts +1 -2
- package/components/Futures/DialogFullscreenAction.js +13 -36
- package/components/Futures/DialogHeaderActionsWrapper.d.ts +1 -1
- package/components/Futures/DialogHeaderActionsWrapper.js +2 -5
- package/components/Futures/DialogInfoAction.d.ts +1 -2
- package/components/Futures/DialogInfoAction.js +4 -15
- package/components/Futures/DialogProcessing.d.ts +1 -2
- package/components/Futures/DialogProcessing.js +2 -25
- package/components/RippleButton.js +3 -4
- package/components/dialogBoundsMemoize.d.ts +20 -0
- package/components/dialogBoundsMemoize.js +117 -0
- package/components/icons/CloseIcon.d.ts +1 -2
- package/components/icons/CloseIcon.js +2 -7
- package/components/icons/FullscreenExitIcon.d.ts +1 -2
- package/components/icons/FullscreenExitIcon.js +2 -7
- package/components/icons/FullscreenIcon.d.ts +1 -2
- package/components/icons/FullscreenIcon.js +2 -7
- package/components/icons/InfoIcon.d.ts +1 -2
- package/components/icons/InfoIcon.js +2 -7
- package/components/icons/ResizeIcon.d.ts +1 -2
- package/components/icons/ResizeIcon.js +3 -8
- package/helpers/BoundTypes.d.ts +11 -0
- package/helpers/BoundTypes.js +2 -0
- package/helpers/dialogBoundsMemoize.d.ts +5 -0
- package/helpers/dialogBoundsMemoize.js +117 -0
- package/helpers/index.d.ts +2 -0
- package/helpers/index.js +22 -0
- package/helpers/initDialogMemoizeBounds.d.ts +5 -0
- package/helpers/initDialogMemoizeBounds.js +40 -0
- package/hooks/initDialogMemoizeBounds.d.ts +4 -0
- package/hooks/initDialogMemoizeBounds.js +39 -0
- package/hooks/useDialogMemoizeBounds.d.ts +1 -0
- package/hooks/useDialogMemoizeBounds.js +37 -0
- package/index.d.ts +1 -0
- package/index.js +3 -1
- package/models/DialogAction.d.ts +1 -2
- package/models/DialogAction.js +2 -25
- package/models/Resizeable.d.ts +3 -1
- package/models/Resizeable.js +15 -9
- package/package.json +2 -2
- package/types/DialogTypes.d.ts +5 -0
- package/components/Dependencies/Body.d.ts +0 -8
- package/components/Dependencies/Body.js +0 -40
- package/components/Dependencies/DialogBody.d.ts +0 -8
- package/components/Dependencies/DialogBody.js +0 -40
- package/types/FormikProps.d.ts +0 -302
package/types/FormikProps.d.ts
DELETED
@@ -1,302 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import {JSX} from "react";
|
3
|
-
|
4
|
-
export interface FieldProps<V = any, FormValues = any> {
|
5
|
-
field: FieldInputProps<V>;
|
6
|
-
form: FormikProps<FormValues>;
|
7
|
-
meta: FieldMetaProps<V>;
|
8
|
-
}
|
9
|
-
interface FieldConfig<V = any> {
|
10
|
-
/**
|
11
|
-
* Field component to render. Can either be a string like 'select' or a component.
|
12
|
-
*/
|
13
|
-
component?: string | React.ComponentType<FieldProps<V>> | React.ComponentType | React.ForwardRefExoticComponent<any>;
|
14
|
-
/**
|
15
|
-
* Component to render. Can either be a string e.g. 'select', 'input', or 'textarea', or a component.
|
16
|
-
*/
|
17
|
-
as?: React.ComponentType<FieldProps<V>['field']> | string | React.ComponentType | React.ForwardRefExoticComponent<any>;
|
18
|
-
/**
|
19
|
-
* Render prop (works like React router's <Route render={props =>} />)
|
20
|
-
* @deprecated
|
21
|
-
*/
|
22
|
-
render?: (props: FieldProps<V>) => React.ReactNode;
|
23
|
-
/**
|
24
|
-
* Children render function <Field name>{props => ...}</Field>)
|
25
|
-
*/
|
26
|
-
children?: ((props: FieldProps<V>) => React.ReactNode) | React.ReactNode;
|
27
|
-
/**
|
28
|
-
* Validate a single field value independently
|
29
|
-
*/
|
30
|
-
validate?: FieldValidator;
|
31
|
-
/**
|
32
|
-
* Used for 'select' and related input types.
|
33
|
-
*/
|
34
|
-
multiple?: boolean;
|
35
|
-
/**
|
36
|
-
* Field name
|
37
|
-
*/
|
38
|
-
name: string;
|
39
|
-
/** HTML input type */
|
40
|
-
type?: string;
|
41
|
-
/** Field value */
|
42
|
-
value?: any;
|
43
|
-
/** Inner ref */
|
44
|
-
innerRef?: (instance: any) => void;
|
45
|
-
}
|
46
|
-
export type FieldAttributes<T> = {
|
47
|
-
className?: string;
|
48
|
-
} & GenericFieldHTMLAttributes & FieldConfig<T> & T & {
|
49
|
-
name: string;
|
50
|
-
};
|
51
|
-
export type FieldHookConfig<T> = GenericFieldHTMLAttributes & FieldConfig<T>;
|
52
|
-
export declare function useField<Val = any>(propsOrFieldName: string | FieldHookConfig<Val>): [FieldInputProps<Val>, FieldMetaProps<Val>, FieldHelperProps<Val>];
|
53
|
-
export declare function Field({ validate, name, render, children, as: is, // `as` is reserved in typescript lol
|
54
|
-
component, className, ...props }: FieldAttributes<any>): any;
|
55
|
-
|
56
|
-
|
57
|
-
/**
|
58
|
-
* Values of fields in the form
|
59
|
-
*/
|
60
|
-
interface FormikValues {
|
61
|
-
[field: string]: any;
|
62
|
-
}
|
63
|
-
/**
|
64
|
-
* An object containing error messages whose keys correspond to FormikValues.
|
65
|
-
* Should always be an object of strings, but any is allowed to support i18n libraries.
|
66
|
-
*/
|
67
|
-
type FormikErrors<Values> = {
|
68
|
-
[K in keyof Values]?: Values[K] extends any[] ? Values[K][number] extends object ? FormikErrors<Values[K][number]>[] | string | string[] : string | string[] : Values[K] extends object ? FormikErrors<Values[K]> : string;
|
69
|
-
};
|
70
|
-
/**
|
71
|
-
* An object containing touched state of the form whose keys correspond to FormikValues.
|
72
|
-
*/
|
73
|
-
type FormikTouched<Values> = {
|
74
|
-
[K in keyof Values]?: Values[K] extends any[] ? Values[K][number] extends object ? FormikTouched<Values[K][number]>[] : boolean : Values[K] extends object ? FormikTouched<Values[K]> : boolean;
|
75
|
-
};
|
76
|
-
/**
|
77
|
-
* Formik state tree
|
78
|
-
*/
|
79
|
-
interface FormikState<Values> {
|
80
|
-
/** Form values */
|
81
|
-
values: Values;
|
82
|
-
/** map of field names to specific error for that field */
|
83
|
-
errors: FormikErrors<Values>;
|
84
|
-
/** map of field names to whether the field has been touched */
|
85
|
-
touched: FormikTouched<Values>;
|
86
|
-
/** whether the form is currently submitting */
|
87
|
-
isSubmitting: boolean;
|
88
|
-
/** whether the form is currently validating (prior to submission) */
|
89
|
-
isValidating: boolean;
|
90
|
-
/** Top level status state, in case you need it */
|
91
|
-
status?: any;
|
92
|
-
/** Number of times user tried to submit the form */
|
93
|
-
submitCount: number;
|
94
|
-
}
|
95
|
-
/**
|
96
|
-
* Formik computed properties. These are read-only.
|
97
|
-
*/
|
98
|
-
interface FormikComputedProps<Values> {
|
99
|
-
/** True if any input has been touched. False otherwise. */
|
100
|
-
readonly dirty: boolean;
|
101
|
-
/** True if state.errors is empty */
|
102
|
-
readonly isValid: boolean;
|
103
|
-
/** The initial values of the form */
|
104
|
-
readonly initialValues: Values;
|
105
|
-
/** The initial errors of the form */
|
106
|
-
readonly initialErrors: FormikErrors<Values>;
|
107
|
-
/** The initial visited fields of the form */
|
108
|
-
readonly initialTouched: FormikTouched<Values>;
|
109
|
-
/** The initial status of the form */
|
110
|
-
readonly initialStatus?: any;
|
111
|
-
}
|
112
|
-
/**
|
113
|
-
* Formik state helpers
|
114
|
-
*/
|
115
|
-
interface FormikHelpers<Values> {
|
116
|
-
/** Manually set top level status. */
|
117
|
-
setStatus: (status?: any) => void;
|
118
|
-
/** Manually set errors object */
|
119
|
-
setErrors: (errors: FormikErrors<Values>) => void;
|
120
|
-
/** Manually set isSubmitting */
|
121
|
-
setSubmitting: (isSubmitting: boolean) => void;
|
122
|
-
/** Manually set touched object */
|
123
|
-
setTouched: (touched: FormikTouched<Values>, shouldValidate?: boolean) => Promise<void | FormikErrors<Values>>;
|
124
|
-
/** Manually set values object */
|
125
|
-
setValues: (values: React.SetStateAction<Values>, shouldValidate?: boolean) => Promise<void | FormikErrors<Values>>;
|
126
|
-
/** Set value of form field directly */
|
127
|
-
setFieldValue: (field: string, value: any, shouldValidate?: boolean) => Promise<void | FormikErrors<Values>>;
|
128
|
-
/** Set error message of a form field directly */
|
129
|
-
setFieldError: (field: string, message: string | undefined) => void;
|
130
|
-
/** Set whether field has been touched directly */
|
131
|
-
setFieldTouched: (field: string, isTouched?: boolean, shouldValidate?: boolean) => Promise<void | FormikErrors<Values>>;
|
132
|
-
/** Validate form values */
|
133
|
-
validateForm: (values?: any) => Promise<FormikErrors<Values>>|void;
|
134
|
-
/** Validate field value */
|
135
|
-
validateField: (field: string) => Promise<void> | Promise<string | undefined>;
|
136
|
-
/** Reset form */
|
137
|
-
resetForm: (nextState?: Partial<FormikState<Values>>) => void;
|
138
|
-
/** Submit the form imperatively */
|
139
|
-
submitForm: () => void; // Promise<void>;
|
140
|
-
/** Set Formik state, careful! */
|
141
|
-
setFormikState: (f: FormikState<Values> | ((prevState: FormikState<Values>) => FormikState<Values>), cb?: () => void) => void;
|
142
|
-
}
|
143
|
-
/**
|
144
|
-
* Formik form event handlers
|
145
|
-
*/
|
146
|
-
interface FormikHandlers {
|
147
|
-
/** Form submit handler */
|
148
|
-
handleSubmit: (e?: React.FormEvent<HTMLFormElement>) => void;
|
149
|
-
/** Reset form event handler */
|
150
|
-
handleReset: (e?: React.SyntheticEvent<any>) => void;
|
151
|
-
handleBlur: {
|
152
|
-
/** Classic React blur handler, keyed by input name */
|
153
|
-
(e: React.FocusEvent<any>): void;
|
154
|
-
/** Preact-like linkState. Will return a handleBlur function. */
|
155
|
-
<T = string | any>(fieldOrEvent: T): T extends string ? (e: any) => void : void;
|
156
|
-
};
|
157
|
-
handleChange: {
|
158
|
-
/** Classic React change handler, keyed by input name */
|
159
|
-
(e: React.ChangeEvent<any>): void;
|
160
|
-
/** Preact-like linkState. Will return a handleChange function. */
|
161
|
-
<T = string | React.ChangeEvent<any>>(field: T): T extends React.ChangeEvent<any> ? void : (e: string | React.ChangeEvent<any>) => void;
|
162
|
-
};
|
163
|
-
getFieldProps: <Value = any>(props: string | FieldConfig<Value>) => FieldInputProps<Value>;
|
164
|
-
getFieldMeta: <Value>(name: string) => FieldMetaProps<Value>;
|
165
|
-
getFieldHelpers: <Value = any>(name: string) => FieldHelperProps<Value>;
|
166
|
-
}
|
167
|
-
/**
|
168
|
-
* Base formik configuration/props shared between the HoC and Component.
|
169
|
-
*/
|
170
|
-
interface FormikSharedConfig<Props = {}> {
|
171
|
-
/** Tells Formik to validate the form on each input's onChange event */
|
172
|
-
validateOnChange?: boolean;
|
173
|
-
/** Tells Formik to validate the form on each input's onBlur event */
|
174
|
-
validateOnBlur?: boolean;
|
175
|
-
/** Tells Formik to validate upon mount */
|
176
|
-
validateOnMount?: boolean;
|
177
|
-
/** Tell Formik if initial form values are valid or not on first render */
|
178
|
-
isInitialValid?: boolean | ((props: Props) => boolean);
|
179
|
-
/** Should Formik reset the form when new initialValues change */
|
180
|
-
enableReinitialize?: boolean;
|
181
|
-
}
|
182
|
-
/**
|
183
|
-
* <Formik /> props
|
184
|
-
*/
|
185
|
-
interface FormikConfig<Values> extends FormikSharedConfig {
|
186
|
-
/**
|
187
|
-
* Form component to render
|
188
|
-
*/
|
189
|
-
component?: React.ComponentType<FormikProps<Values>>;
|
190
|
-
/**
|
191
|
-
* Render prop (works like React router's <Route render={props =>} />)
|
192
|
-
* @deprecated
|
193
|
-
*/
|
194
|
-
render?: (props: FormikProps<Values>) => React.ReactNode;
|
195
|
-
/**
|
196
|
-
* React children or child render callback
|
197
|
-
*/
|
198
|
-
children?: ((props: FormikProps<Values>) => React.ReactNode) | React.ReactNode;
|
199
|
-
/**
|
200
|
-
* Initial values of the form
|
201
|
-
*/
|
202
|
-
initialValues: Values;
|
203
|
-
/**
|
204
|
-
* Initial status
|
205
|
-
*/
|
206
|
-
initialStatus?: any;
|
207
|
-
/** Initial object map of field names to specific error for that field */
|
208
|
-
initialErrors?: FormikErrors<Values>;
|
209
|
-
/** Initial object map of field names to whether the field has been touched */
|
210
|
-
initialTouched?: FormikTouched<Values>;
|
211
|
-
/**
|
212
|
-
* Reset handler
|
213
|
-
*/
|
214
|
-
onReset?: (values: Values, formikHelpers: FormikHelpers<Values>) => void;
|
215
|
-
/**
|
216
|
-
* Submission handler
|
217
|
-
*/
|
218
|
-
onSubmit: (values: Values, formikHelpers: FormikHelpers<Values>) => void | Promise<any>;
|
219
|
-
/**
|
220
|
-
* A Yup Schema or a function that returns a Yup schema
|
221
|
-
*/
|
222
|
-
validationSchema?: any | (() => any);
|
223
|
-
/**
|
224
|
-
* Validation function. Must return an error object or promise that
|
225
|
-
* throws an error object where that object keys map to corresponding value.
|
226
|
-
*/
|
227
|
-
validate?: (values: Values) => void | object | Promise<FormikErrors<Values>>;
|
228
|
-
/** Inner ref */
|
229
|
-
innerRef?: React.Ref<FormikProps<Values>>;
|
230
|
-
|
231
|
-
}
|
232
|
-
/**
|
233
|
-
* State, handlers, and helpers made available to form component or render prop
|
234
|
-
* of <Formik/>.
|
235
|
-
*/
|
236
|
-
export type FormikProps<Values> = FormikSharedConfig & FormikState<Values> & FormikHelpers<Values> & FormikHandlers & FormikComputedProps<Values> & FormikRegistration
|
237
|
-
/** Internal Formik registration methods that get passed down as props */
|
238
|
-
interface FormikRegistration {
|
239
|
-
registerField: (name: string, fns: {
|
240
|
-
validate?: FieldValidator;
|
241
|
-
}) => void;
|
242
|
-
unregisterField: (name: string) => void;
|
243
|
-
}
|
244
|
-
/**
|
245
|
-
* State, handlers, and helpers made available to Formik's primitive components through context.
|
246
|
-
*/
|
247
|
-
type FormikContextType<Values> = FormikProps<Values> & Pick<FormikConfig<Values>, 'validate' | 'validationSchema'>;
|
248
|
-
interface SharedRenderProps<T> {
|
249
|
-
/**
|
250
|
-
* Field component to render. Can either be a string like 'select' or a component.
|
251
|
-
*/
|
252
|
-
component?: keyof JSX.IntrinsicElements | React.ComponentType<T | void>;
|
253
|
-
/**
|
254
|
-
* Render prop (works like React router's <Route render={props =>} />)
|
255
|
-
*/
|
256
|
-
render?: (props: T) => React.ReactNode;
|
257
|
-
/**
|
258
|
-
* Children render function <Field name>{props => ...}</Field>)
|
259
|
-
*/
|
260
|
-
children?: (props: T) => React.ReactNode;
|
261
|
-
}
|
262
|
-
type GenericFieldHTMLAttributes = JSX.IntrinsicElements['input'] | JSX.IntrinsicElements['select'] | JSX.IntrinsicElements['textarea'];
|
263
|
-
/** Field metadata */
|
264
|
-
interface FieldMetaProps<Value> {
|
265
|
-
/** Value of the field */
|
266
|
-
value: Value;
|
267
|
-
/** Error message of the field */
|
268
|
-
error?: string;
|
269
|
-
/** Has the field been visited? */
|
270
|
-
touched: boolean;
|
271
|
-
/** Initial value of the field */
|
272
|
-
initialValue?: Value;
|
273
|
-
/** Initial touched state of the field */
|
274
|
-
initialTouched: boolean;
|
275
|
-
/** Initial error message of the field */
|
276
|
-
initialError?: string;
|
277
|
-
}
|
278
|
-
/** Imperative handles to change a field's value, error and touched */
|
279
|
-
interface FieldHelperProps<Value> {
|
280
|
-
/** Set the field's value */
|
281
|
-
setValue: (value: Value, shouldValidate?: boolean) => Promise<void | FormikErrors<Value>>;
|
282
|
-
/** Set the field's touched value */
|
283
|
-
setTouched: (value: boolean, shouldValidate?: boolean) => Promise<void | FormikErrors<Value>>;
|
284
|
-
/** Set the field's error value */
|
285
|
-
setError: (value: string | undefined) => void;
|
286
|
-
}
|
287
|
-
/** Field input value, name, and event handlers */
|
288
|
-
interface FieldInputProps<Value> {
|
289
|
-
/** Value of the field */
|
290
|
-
value: Value;
|
291
|
-
/** Name of the field */
|
292
|
-
name: string;
|
293
|
-
/** Multiple select? */
|
294
|
-
multiple?: boolean;
|
295
|
-
/** Is the field checked? */
|
296
|
-
checked?: boolean;
|
297
|
-
/** Change event handler */
|
298
|
-
onChange: FormikHandlers['handleChange'];
|
299
|
-
/** Blur event handler */
|
300
|
-
onBlur: FormikHandlers['handleBlur'];
|
301
|
-
}
|
302
|
-
type FieldValidator = (value: any) => string | void | Promise<string | void>;
|