react-input-material 0.0.410 → 0.0.411
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/FileInput.js +1 -1
- package/components/GenericInput.js +1 -1
- package/components/GenericInput.tsx +1 -0
- package/components/Inputs.js +1 -1
- package/components/Inputs.tsx +1 -1
- package/components/Interval.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/type.d.ts +34 -34
package/package.json
CHANGED
package/type.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export interface GenericEvent<T = unknown> extends SyntheticEvent {
|
|
|
23
23
|
}
|
|
24
24
|
export interface TestEnvironment {
|
|
25
25
|
container: HTMLDivElement | null;
|
|
26
|
-
render: <T = HTMLElement>(
|
|
26
|
+
render: <T = HTMLElement>(component: ReactElement) => null | T;
|
|
27
27
|
}
|
|
28
28
|
export interface CursorState {
|
|
29
29
|
end: number;
|
|
@@ -102,14 +102,14 @@ export declare type DefaultBaseProperties = Omit<BaseProps, 'model'> & {
|
|
|
102
102
|
export interface TypedProperties<T = unknown> extends BaseProperties {
|
|
103
103
|
initialValue: null | T;
|
|
104
104
|
model: Model<T>;
|
|
105
|
-
onBlur: (
|
|
106
|
-
onChange: (
|
|
107
|
-
onChangeShowDeclaration: (
|
|
108
|
-
onChangeState: (
|
|
109
|
-
onChangeValue: (
|
|
110
|
-
onClick: (
|
|
111
|
-
onFocus: (
|
|
112
|
-
onTouch: (
|
|
105
|
+
onBlur: (event: GenericEvent | undefined, properties: this) => void;
|
|
106
|
+
onChange: (properties: this, event?: GenericEvent) => void;
|
|
107
|
+
onChangeShowDeclaration: (show: boolean, event: GenericEvent | undefined, properties: this) => void;
|
|
108
|
+
onChangeState: (state: ModelState, event: GenericEvent | undefined, properties: this) => void;
|
|
109
|
+
onChangeValue: (value: null | T, event: GenericEvent | undefined, properties: this) => void;
|
|
110
|
+
onClick: (event: MouseEvent, properties: this) => void;
|
|
111
|
+
onFocus: (event: FocusEvent, properties: this) => void;
|
|
112
|
+
onTouch: (event: GenericEvent, properties: this) => void;
|
|
113
113
|
}
|
|
114
114
|
export declare type Properties<T = unknown> = TypedProperties<T> & CommonModel<T>;
|
|
115
115
|
export declare type Props<T = unknown> = Partial<Omit<Properties<T>, 'model'>> & {
|
|
@@ -138,11 +138,11 @@ export interface StaticWebComponent<MS = ModelState, DP = DefaultProperties> ext
|
|
|
138
138
|
export declare type StaticComponent<P = Props, MS = ModelState, DP = DefaultProperties> = Omit<ComponentClass<P>, 'propTypes'> & StaticWebComponent<MS, DP>;
|
|
139
139
|
export declare type StaticFunctionComponent<P = Props, MS = ModelState, DP = DefaultProperties> = Omit<FunctionComponent<P>, 'propTypes'> & StaticComponent<P, MS, DP>;
|
|
140
140
|
export interface InputComponent<P = Props, MS = ModelState, DP = DefaultProperties, A = ComponentAdapter<P>> extends Omit<ForwardRefExoticComponent<P>, 'propTypes'>, StaticWebComponent<MS, DP> {
|
|
141
|
-
(
|
|
141
|
+
(props: P & RefAttributes<A>): ReactElement;
|
|
142
142
|
}
|
|
143
143
|
export declare const baseModelPropertyTypes: ValidationMapping;
|
|
144
144
|
export declare const modelStatePropertyTypes: {
|
|
145
|
-
[
|
|
145
|
+
[key in keyof ModelState]: Requireable<boolean | symbol>;
|
|
146
146
|
};
|
|
147
147
|
export declare const modelPropertyTypes: ValidationMapping;
|
|
148
148
|
export declare const propertyTypes: ValidationMapping;
|
|
@@ -193,7 +193,7 @@ export declare type InputDataTransformation = {
|
|
|
193
193
|
number: DataTransformSpecification<number, number>;
|
|
194
194
|
string?: DataTransformSpecification<unknown>;
|
|
195
195
|
} & {
|
|
196
|
-
[
|
|
196
|
+
[key in Exclude<NativeInputType, 'date' | 'datetime-local' | 'time' | 'number'>]?: DataTransformSpecification<unknown>;
|
|
197
197
|
};
|
|
198
198
|
export declare type NormalizedSelection = Array<Omit<FormattedSelectionOption, 'value'> & {
|
|
199
199
|
value: unknown;
|
|
@@ -233,7 +233,7 @@ export interface SuggestionCreatorOptions<P> {
|
|
|
233
233
|
}
|
|
234
234
|
export interface InputProperties<T = unknown> extends InputModelState, Properties<T> {
|
|
235
235
|
align: 'end' | 'start';
|
|
236
|
-
children: (
|
|
236
|
+
children: (options: InputChildrenOptions<this, T>) => null | ReactElement;
|
|
237
237
|
cursor: CursorState;
|
|
238
238
|
editor: ('code' | 'code(css)' | 'code(script)' | 'plain' | 'text' | 'richtext(raw)' | 'richtext(simple)' | 'richtext(normal)' | 'richtext(advanced)');
|
|
239
239
|
editorIsActive: boolean;
|
|
@@ -249,11 +249,11 @@ export interface InputProperties<T = unknown> extends InputModelState, Propertie
|
|
|
249
249
|
minimumLengthText: string;
|
|
250
250
|
minimumText: string;
|
|
251
251
|
model: InputModel<T>;
|
|
252
|
-
onChangeEditorIsActive: (
|
|
253
|
-
onKeyDown: (
|
|
254
|
-
onKeyUp: (
|
|
255
|
-
onSelect: (
|
|
256
|
-
onSelectionChange: (
|
|
252
|
+
onChangeEditorIsActive: (isActive: boolean, event: MouseEvent | undefined, properties: this) => void;
|
|
253
|
+
onKeyDown: (event: KeyboardEvent, properties: this) => void;
|
|
254
|
+
onKeyUp: (event: KeyboardEvent, properties: this) => void;
|
|
255
|
+
onSelect: (event: GenericEvent, properties: this) => void;
|
|
256
|
+
onSelectionChange: (event: GenericEvent, properties: this) => void;
|
|
257
257
|
outlined: boolean;
|
|
258
258
|
patternText: string;
|
|
259
259
|
placeholder: string;
|
|
@@ -262,7 +262,7 @@ export interface InputProperties<T = unknown> extends InputModelState, Propertie
|
|
|
262
262
|
searchSelection: boolean;
|
|
263
263
|
selectableEditor: boolean;
|
|
264
264
|
step: number;
|
|
265
|
-
suggestionCreator?: (
|
|
265
|
+
suggestionCreator?: (options: SuggestionCreatorOptions<this>) => InputProperties['selection'] | Promise<InputProperties['selection']>;
|
|
266
266
|
suggestSelection: boolean;
|
|
267
267
|
trailingIcon: string | (IconOptions & {
|
|
268
268
|
tooltip?: string | TooltipProps;
|
|
@@ -276,7 +276,7 @@ export declare type DefaultInputProperties<T = string> = Omit<InputProps<T>, 'mo
|
|
|
276
276
|
model: InputModel<T>;
|
|
277
277
|
};
|
|
278
278
|
export declare type InputPropertyTypes<T = unknown> = {
|
|
279
|
-
[
|
|
279
|
+
[key in keyof InputProperties<T>]: ValueOf<typeof PropertyTypes>;
|
|
280
280
|
};
|
|
281
281
|
export interface InputState<T = unknown> extends State<T> {
|
|
282
282
|
cursor: CursorState;
|
|
@@ -309,12 +309,12 @@ export interface TinyMCEOptions extends RawTinyMCEOptions {
|
|
|
309
309
|
target?: undefined;
|
|
310
310
|
}
|
|
311
311
|
export interface GenericInputComponent extends Omit<ForwardRefExoticComponent<InputProps>, 'propTypes'>, StaticWebComponent<InputModelState, DefaultInputProperties> {
|
|
312
|
-
<T = string>(
|
|
312
|
+
<T = string>(props: InputProps<T> & RefAttributes<InputAdapter<T>>): ReactElement;
|
|
313
313
|
locales: Array<string>;
|
|
314
314
|
transformer: InputDataTransformation;
|
|
315
315
|
}
|
|
316
316
|
export declare const inputModelStatePropertyTypes: {
|
|
317
|
-
[
|
|
317
|
+
[key in keyof InputModelState]: Requireable<boolean | symbol>;
|
|
318
318
|
};
|
|
319
319
|
export declare const inputPropertyTypes: PropertiesValidationMap;
|
|
320
320
|
export declare const inputRenderProperties: Array<string>;
|
|
@@ -353,7 +353,7 @@ export interface FileInputChildrenOptions<P> {
|
|
|
353
353
|
value?: FileValue | null;
|
|
354
354
|
}
|
|
355
355
|
export interface FileInputProperties extends Properties<FileValue>, FileInputModelState {
|
|
356
|
-
children: (
|
|
356
|
+
children: (options: FileInputChildrenOptions<this>) => null | ReactElement;
|
|
357
357
|
contentTypePattern: Array<RegExp | string> | null | RegExp | string;
|
|
358
358
|
invertedContentTypePattern: Array<RegExp | string> | null | RegExp | string;
|
|
359
359
|
contentTypePatternText: string;
|
|
@@ -365,7 +365,7 @@ export interface FileInputProperties extends Properties<FileValue>, FileInputMod
|
|
|
365
365
|
editButton: ReactElement | string;
|
|
366
366
|
newButton: ReactElement | string;
|
|
367
367
|
encoding: string;
|
|
368
|
-
generateFileNameInputProperties: (
|
|
368
|
+
generateFileNameInputProperties: (prototype: InputProps<string>, properties: this & {
|
|
369
369
|
value: FileValue & {
|
|
370
370
|
name: string;
|
|
371
371
|
};
|
|
@@ -385,7 +385,7 @@ export declare type DefaultFileInputProperties = Omit<FileInputProps, 'model'> &
|
|
|
385
385
|
model: FileInputModel;
|
|
386
386
|
};
|
|
387
387
|
export declare type FileInputPropertyTypes = {
|
|
388
|
-
[
|
|
388
|
+
[key in keyof FileInputProperties]: ValueOf<typeof PropertyTypes>;
|
|
389
389
|
};
|
|
390
390
|
export interface FileInputState extends State<FileValue> {
|
|
391
391
|
modelState: FileInputModelState;
|
|
@@ -404,7 +404,7 @@ export interface FileInputAdapterWithReferences extends FileInputAdapter {
|
|
|
404
404
|
}
|
|
405
405
|
export declare type FileInputComponent = InputComponent<FileInputProps, FileInputModelState, DefaultFileInputProperties, FileInputAdapter>;
|
|
406
406
|
export declare const fileInputModelStatePropertyTypes: {
|
|
407
|
-
[
|
|
407
|
+
[key in keyof FileInputModelState]: Requireable<boolean | symbol>;
|
|
408
408
|
};
|
|
409
409
|
export declare const fileInputPropertyTypes: PropertiesValidationMap;
|
|
410
410
|
export declare const defaultFileInputModelState: FileInputModelState;
|
|
@@ -442,12 +442,12 @@ export interface InputsChildrenOptions<T, P extends InputsPropertiesItem<T>, IP>
|
|
|
442
442
|
export interface InputsProperties<T = unknown, P extends InputsPropertiesItem<T> = Properties<T>> extends InputsModelState, Omit<Properties<Array<P>>, 'onChangeValue'> {
|
|
443
443
|
addIcon: IconOptions;
|
|
444
444
|
removeIcon: IconOptions;
|
|
445
|
-
children: (
|
|
446
|
-
createPrototype: (
|
|
445
|
+
children: (options: InputsChildrenOptions<T, P, this>) => ReactElement;
|
|
446
|
+
createPrototype: (options: InputsCreatePrototypeOptions<T, P, this>) => P;
|
|
447
447
|
maximumNumber: number;
|
|
448
448
|
minimumNumber: number;
|
|
449
449
|
model: InputsModel<T, P>;
|
|
450
|
-
onChangeValue: (
|
|
450
|
+
onChangeValue: (values: Array<null | T> | null, event: GenericEvent | unknown, properties: this) => void;
|
|
451
451
|
value: Array<P> | null;
|
|
452
452
|
writable: boolean;
|
|
453
453
|
}
|
|
@@ -459,7 +459,7 @@ export declare type DefaultInputsProperties<T = string, P extends InputsProperti
|
|
|
459
459
|
model: InputsModel<T, P>;
|
|
460
460
|
};
|
|
461
461
|
export declare type InputsPropertyTypes<T = unknown, P extends InputsPropertiesItem<T> = Properties<T>> = {
|
|
462
|
-
[
|
|
462
|
+
[key in keyof InputsProperties<P>]: ValueOf<typeof PropertyTypes>;
|
|
463
463
|
};
|
|
464
464
|
export declare type InputsState<T = unknown> = State<Array<null | T | undefined>>;
|
|
465
465
|
export declare type InputsAdapter<T = unknown, P extends InputsPropertiesItem<T> = Properties<T>> = ComponentAdapter<InputsProperties<T, P>, InputsState<T>>;
|
|
@@ -467,7 +467,7 @@ export declare type InputsAdapterWithReferences<T = unknown, P extends InputsPro
|
|
|
467
467
|
references: Array<MutableRefObject<RefType>>;
|
|
468
468
|
};
|
|
469
469
|
export interface InputsComponent extends Omit<ForwardRefExoticComponent<InputsProps>, 'propTypes'>, StaticWebComponent<InputsModelState, DefaultInputsProperties> {
|
|
470
|
-
<T = string, P extends InputsPropertiesItem<T> = InputProperties<T>>(
|
|
470
|
+
<T = string, P extends InputsPropertiesItem<T> = InputProperties<T>>(props: InputsProps<T, P> & RefAttributes<InputsAdapter<T, P>>): ReactElement;
|
|
471
471
|
}
|
|
472
472
|
export declare const inputsPropertyTypes: PropertiesValidationMap;
|
|
473
473
|
export declare const inputsRenderProperties: Array<string>;
|
|
@@ -493,8 +493,8 @@ export interface IntervalModel {
|
|
|
493
493
|
export interface IntervalProperties extends Omit<InputProperties<number>, 'icon' | 'model' | 'onChange' | 'onChangeValue' | 'value'> {
|
|
494
494
|
icon: IconOptions;
|
|
495
495
|
model: IntervalModel;
|
|
496
|
-
onChange: (
|
|
497
|
-
onChangeValue: (
|
|
496
|
+
onChange: (properties: this, event?: GenericEvent) => void;
|
|
497
|
+
onChangeValue: (value: null | IntervalValue, event?: GenericEvent) => void;
|
|
498
498
|
value: IntervalConfiguration;
|
|
499
499
|
}
|
|
500
500
|
export declare type IntervalProps = Omit<InputProps<number>, 'icon' | 'model' | 'onChange' | 'onChangeValue' | 'value'> & Partial<{
|
|
@@ -510,7 +510,7 @@ export declare type DefaultIntervalProperties = Omit<IntervalProps, 'model'> & {
|
|
|
510
510
|
model: IntervalModel;
|
|
511
511
|
};
|
|
512
512
|
export declare type IntervalPropertyTypes = {
|
|
513
|
-
[
|
|
513
|
+
[key in keyof IntervalProperties]: ValueOf<typeof PropertyTypes>;
|
|
514
514
|
};
|
|
515
515
|
export declare type IntervalAdapter = ComponentAdapter<IntervalProperties, {
|
|
516
516
|
value?: IntervalValue | null;
|