react-mui-form-validator 1.1.7 → 1.1.9
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/lib/index.d.ts +170 -7
- package/lib/index.js +19187 -139
- package/package.json +20 -16
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
4
|
+
import * as lodash from 'lodash';
|
|
3
5
|
|
|
4
|
-
declare class ValidatorComponent extends
|
|
6
|
+
declare class ValidatorComponent extends React__default.Component<any, any, any> {
|
|
5
7
|
static getDerivedStateFromProps(nextProps: any, prevState: any): {
|
|
6
8
|
value: any;
|
|
7
9
|
validators: any;
|
|
@@ -38,7 +40,7 @@ declare class ValidatorComponent extends React.Component<any, any, any> {
|
|
|
38
40
|
makeValid: () => void;
|
|
39
41
|
renderComponent: (form: any) => any;
|
|
40
42
|
form: any;
|
|
41
|
-
render():
|
|
43
|
+
render(): React__default.JSX.Element;
|
|
42
44
|
}
|
|
43
45
|
declare namespace ValidatorComponent {
|
|
44
46
|
namespace propTypes {
|
|
@@ -60,14 +62,14 @@ declare namespace ValidatorComponent {
|
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
declare class TextValidator extends ValidatorComponent {
|
|
63
|
-
renderValidatorComponent():
|
|
65
|
+
renderValidatorComponent(): React__default.JSX.Element;
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
declare class MuiSelect$1 extends ValidatorComponent {
|
|
67
69
|
renderValidatorComponent(): React.JSX.Element;
|
|
68
70
|
}
|
|
69
71
|
|
|
70
|
-
declare class ValidatorForm extends
|
|
72
|
+
declare class ValidatorForm extends React__default.Component<any, any, any> {
|
|
71
73
|
static getValidator: (validator: any, value: any, includeRequired: any) => boolean;
|
|
72
74
|
constructor(props: any);
|
|
73
75
|
constructor(props: any, context: any);
|
|
@@ -92,7 +94,7 @@ declare class ValidatorForm extends React.Component<any, any, any> {
|
|
|
92
94
|
find: (collection: any, fn: any) => any;
|
|
93
95
|
resetValidations: () => void;
|
|
94
96
|
isFormValid: (dryRun?: boolean) => Promise<any>;
|
|
95
|
-
render():
|
|
97
|
+
render(): React__default.JSX.Element;
|
|
96
98
|
}
|
|
97
99
|
declare namespace ValidatorForm {
|
|
98
100
|
function addValidationRule(name: any, callback: any): void;
|
|
@@ -114,9 +116,170 @@ declare namespace ValidatorForm {
|
|
|
114
116
|
}
|
|
115
117
|
}
|
|
116
118
|
|
|
119
|
+
declare class MaterialUiPhoneNumber extends React__default.Component<any, any, any> {
|
|
120
|
+
constructor(props: any);
|
|
121
|
+
flags: {};
|
|
122
|
+
guessSelectedCountry: ((inputNumber: any, onlyCountries: any, defaultCountry: any) => any) & lodash.MemoizedFunction;
|
|
123
|
+
state: {
|
|
124
|
+
formattedNumber: any;
|
|
125
|
+
placeholder: any;
|
|
126
|
+
onlyCountries: any;
|
|
127
|
+
preferredCountries: any[];
|
|
128
|
+
defaultCountry: any;
|
|
129
|
+
selectedCountry: any;
|
|
130
|
+
highlightCountryIndex: number;
|
|
131
|
+
queryString: string;
|
|
132
|
+
freezeSelection: boolean;
|
|
133
|
+
debouncedQueryStingSearcher: lodash.DebouncedFunc<() => void>;
|
|
134
|
+
anchorEl: null;
|
|
135
|
+
};
|
|
136
|
+
componentDidMount(): void;
|
|
137
|
+
componentDidUpdate({ value: prevValue }: {
|
|
138
|
+
value: any;
|
|
139
|
+
}): void;
|
|
140
|
+
componentWillUnmount(): void;
|
|
141
|
+
getProbableCandidate: ((queryString: any) => string | null) & lodash.MemoizedFunction;
|
|
142
|
+
getOnlyCountries: (onlyCountriesArray: any, filteredCountries: any) => any;
|
|
143
|
+
excludeCountries: (selectedCountries: any, excludedCountries: any) => any;
|
|
144
|
+
filterRegions: (regions: any, filteredCountries: any) => any;
|
|
145
|
+
deleteAreaCodes: (filteredCountries: any) => any;
|
|
146
|
+
updateDefaultCountry: (country: any) => void;
|
|
147
|
+
scrollTo: (country: any) => void;
|
|
148
|
+
formatNumber: (text: any, patternArg: any) => any;
|
|
149
|
+
cursorToEnd: () => void;
|
|
150
|
+
getElement: (index: any) => any;
|
|
151
|
+
getCountryData: () => {
|
|
152
|
+
name?: undefined;
|
|
153
|
+
dialCode?: undefined;
|
|
154
|
+
countryCode?: undefined;
|
|
155
|
+
} | {
|
|
156
|
+
name: any;
|
|
157
|
+
dialCode: any;
|
|
158
|
+
countryCode: any;
|
|
159
|
+
};
|
|
160
|
+
handleInput: (e: any) => void;
|
|
161
|
+
handleRefInput: (ref: any) => void;
|
|
162
|
+
inputRef: any;
|
|
163
|
+
handleInputClick: (e: any) => void;
|
|
164
|
+
handleFlagItemClick: (country: any) => void;
|
|
165
|
+
handleInputFocus: (e: any) => void;
|
|
166
|
+
handleInputBlur: (e: any) => void;
|
|
167
|
+
getHighlightCountryIndex: (direction: any) => any;
|
|
168
|
+
searchCountry: () => void;
|
|
169
|
+
handleKeydown: (e: any) => void;
|
|
170
|
+
handleInputKeyDown: (e: any) => void;
|
|
171
|
+
checkIfValid: () => any;
|
|
172
|
+
updateFormattedNumber: (number: any) => void;
|
|
173
|
+
getDropdownProps: () => {
|
|
174
|
+
startAdornment?: undefined;
|
|
175
|
+
} | {
|
|
176
|
+
startAdornment: React__default.JSX.Element;
|
|
177
|
+
};
|
|
178
|
+
render(): React__default.JSX.Element;
|
|
179
|
+
}
|
|
180
|
+
declare namespace MaterialUiPhoneNumber {
|
|
181
|
+
namespace propTypes {
|
|
182
|
+
let excludeCountries: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
183
|
+
let onlyCountries: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
184
|
+
let preferredCountries: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
185
|
+
let defaultCountry: PropTypes.Requireable<string>;
|
|
186
|
+
let value: PropTypes.Requireable<string>;
|
|
187
|
+
let placeholder: PropTypes.Requireable<string>;
|
|
188
|
+
let disabled: PropTypes.Requireable<boolean>;
|
|
189
|
+
let error: PropTypes.Requireable<boolean>;
|
|
190
|
+
let variant: PropTypes.Requireable<string>;
|
|
191
|
+
let native: PropTypes.Requireable<boolean>;
|
|
192
|
+
let inputClass: PropTypes.Requireable<string>;
|
|
193
|
+
let dropdownClass: PropTypes.Requireable<string>;
|
|
194
|
+
let InputProps: PropTypes.Requireable<object>;
|
|
195
|
+
let inputProps: PropTypes.Requireable<object>;
|
|
196
|
+
let inputRef: PropTypes.Requireable<(...args: any[]) => any>;
|
|
197
|
+
let autoFormat: PropTypes.Requireable<boolean>;
|
|
198
|
+
let disableAreaCodes: PropTypes.Requireable<boolean>;
|
|
199
|
+
let disableCountryCode: PropTypes.Requireable<boolean>;
|
|
200
|
+
let disableDropdown: PropTypes.Requireable<boolean>;
|
|
201
|
+
let enableLongNumbers: PropTypes.Requireable<boolean>;
|
|
202
|
+
let countryCodeEditable: PropTypes.Requireable<boolean>;
|
|
203
|
+
let regions: PropTypes.Requireable<NonNullable<string | (string | null | undefined)[] | null | undefined>>;
|
|
204
|
+
let localization: PropTypes.Requireable<object>;
|
|
205
|
+
let onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
206
|
+
let onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
207
|
+
let onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
208
|
+
let onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
209
|
+
let onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
210
|
+
let isValid: PropTypes.Requireable<(...args: any[]) => any>;
|
|
211
|
+
let isModernBrowser: PropTypes.Requireable<(...args: any[]) => any>;
|
|
212
|
+
let onEnterKeyPress: PropTypes.Requireable<(...args: any[]) => any>;
|
|
213
|
+
let keys: PropTypes.Requireable<object>;
|
|
214
|
+
}
|
|
215
|
+
namespace defaultProps {
|
|
216
|
+
let excludeCountries_1: never[];
|
|
217
|
+
export { excludeCountries_1 as excludeCountries };
|
|
218
|
+
let onlyCountries_1: never[];
|
|
219
|
+
export { onlyCountries_1 as onlyCountries };
|
|
220
|
+
let preferredCountries_1: never[];
|
|
221
|
+
export { preferredCountries_1 as preferredCountries };
|
|
222
|
+
let defaultCountry_1: string;
|
|
223
|
+
export { defaultCountry_1 as defaultCountry };
|
|
224
|
+
let placeholder_1: string;
|
|
225
|
+
export { placeholder_1 as placeholder };
|
|
226
|
+
let disabled_1: boolean;
|
|
227
|
+
export { disabled_1 as disabled };
|
|
228
|
+
let error_1: boolean;
|
|
229
|
+
export { error_1 as error };
|
|
230
|
+
let variant_1: string;
|
|
231
|
+
export { variant_1 as variant };
|
|
232
|
+
let native_1: boolean;
|
|
233
|
+
export { native_1 as native };
|
|
234
|
+
let inputClass_1: string;
|
|
235
|
+
export { inputClass_1 as inputClass };
|
|
236
|
+
let dropdownClass_1: string;
|
|
237
|
+
export { dropdownClass_1 as dropdownClass };
|
|
238
|
+
let autoFormat_1: boolean;
|
|
239
|
+
export { autoFormat_1 as autoFormat };
|
|
240
|
+
let disableAreaCodes_1: boolean;
|
|
241
|
+
export { disableAreaCodes_1 as disableAreaCodes };
|
|
242
|
+
export function isValid_1(inputNumber: any): boolean;
|
|
243
|
+
export { isValid_1 as isValid };
|
|
244
|
+
let disableCountryCode_1: boolean;
|
|
245
|
+
export { disableCountryCode_1 as disableCountryCode };
|
|
246
|
+
let disableDropdown_1: boolean;
|
|
247
|
+
export { disableDropdown_1 as disableDropdown };
|
|
248
|
+
let enableLongNumbers_1: boolean;
|
|
249
|
+
export { enableLongNumbers_1 as enableLongNumbers };
|
|
250
|
+
let countryCodeEditable_1: boolean;
|
|
251
|
+
export { countryCodeEditable_1 as countryCodeEditable };
|
|
252
|
+
let regions_1: string;
|
|
253
|
+
export { regions_1 as regions };
|
|
254
|
+
let localization_1: {};
|
|
255
|
+
export { localization_1 as localization };
|
|
256
|
+
export function onEnterKeyPress_1(): void;
|
|
257
|
+
export { onEnterKeyPress_1 as onEnterKeyPress };
|
|
258
|
+
export function onChange_1(): void;
|
|
259
|
+
export { onChange_1 as onChange };
|
|
260
|
+
export function isModernBrowser_1(): boolean;
|
|
261
|
+
export { isModernBrowser_1 as isModernBrowser };
|
|
262
|
+
export namespace keys_1 {
|
|
263
|
+
let UP: number;
|
|
264
|
+
let DOWN: number;
|
|
265
|
+
let RIGHT: number;
|
|
266
|
+
let LEFT: number;
|
|
267
|
+
let ENTER: number;
|
|
268
|
+
let ESC: number;
|
|
269
|
+
let PLUS: number;
|
|
270
|
+
let A: number;
|
|
271
|
+
let Z: number;
|
|
272
|
+
let SPACE: number;
|
|
273
|
+
}
|
|
274
|
+
export { keys_1 as keys };
|
|
275
|
+
}
|
|
276
|
+
let displayName: string;
|
|
277
|
+
}
|
|
278
|
+
|
|
117
279
|
declare const MuiTextField: typeof TextValidator;
|
|
280
|
+
declare const MuiPhoneNumber: typeof MaterialUiPhoneNumber;
|
|
118
281
|
declare const MuiSelect: typeof MuiSelect$1;
|
|
119
282
|
declare const MuiComponent: typeof ValidatorComponent;
|
|
120
283
|
declare const MuiForm: typeof ValidatorForm;
|
|
121
284
|
|
|
122
|
-
export { MuiComponent, MuiForm, MuiSelect, MuiTextField };
|
|
285
|
+
export { MuiComponent, MuiForm, MuiPhoneNumber, MuiSelect, MuiTextField };
|