react-input-material 0.0.375 → 0.0.378
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/Dummy.d.ts +1 -1
- package/components/Dummy.js +1 -1
- package/components/Dummy.tsx +1 -1
- package/components/FileInput.js +1 -1
- package/components/FileInput.styles.css +2 -2
- package/components/FileInput.tsx +33 -21
- package/components/GenericAnimate.js +1 -1
- package/components/GenericAnimate.tsx +11 -5
- package/components/GenericInput.d.ts +3 -3
- package/components/GenericInput.js +1 -1
- package/components/GenericInput.styles.css +2 -2
- package/components/GenericInput.tsx +53 -41
- package/components/Inputs.d.ts +1 -1
- package/components/Inputs.js +1 -1
- package/components/Inputs.styles.css +2 -2
- package/components/Inputs.tsx +14 -8
- package/components/Interval.js +1 -1
- package/components/Interval.styles.css +2 -2
- package/components/Interval.tsx +10 -6
- package/components/RequireableCheckbox.js +1 -1
- package/components/RequireableCheckbox.tsx +6 -2
- package/helper.d.ts +3 -3
- package/helper.js +1 -1
- package/index.js +1 -1
- package/index.styles.css +2 -2
- package/package.json +1 -3
- package/testHelper.d.ts +2 -1
- package/type.d.ts +25 -25
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-input-material",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.378",
|
|
4
4
|
"description": "Reusable material design based input field with support for (richt-)text, code, selections, numbers, dates and so on.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"form-field",
|
|
@@ -119,7 +119,6 @@
|
|
|
119
119
|
"style-loader": "*",
|
|
120
120
|
"stylelint": "*",
|
|
121
121
|
"stylelint-config-standard": "*",
|
|
122
|
-
"tinymce": "*",
|
|
123
122
|
"tslib": "*",
|
|
124
123
|
"typescript-plugin-css-modules": "*",
|
|
125
124
|
"web-component-wrapper": "*",
|
|
@@ -150,7 +149,6 @@
|
|
|
150
149
|
"react-dom": "*",
|
|
151
150
|
"react-transition-group": "*",
|
|
152
151
|
"react-useanimations": "*",
|
|
153
|
-
"tinymce": "^5.0.0",
|
|
154
152
|
"tslib": "*"
|
|
155
153
|
},
|
|
156
154
|
"peerDependenciesMeta": {
|
package/testHelper.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
1
2
|
import { TestEnvironment } from './type';
|
|
2
|
-
export declare const prepareTestEnvironment: (beforeEach:
|
|
3
|
+
export declare const prepareTestEnvironment: (beforeEach: jest.Lifecycle, afterEach: jest.Lifecycle) => TestEnvironment;
|
|
3
4
|
export default prepareTestEnvironment;
|
package/type.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Mapping, PlainObject, RecursivePartial, ValueOf } from 'clientnode/type
|
|
|
3
3
|
import { ComponentClass, FocusEvent, ForwardRefExoticComponent, FunctionComponent, HTMLProps, KeyboardEvent, MouseEvent, MutableRefObject, ReactElement, RefAttributes, Requireable, SyntheticEvent } from 'react';
|
|
4
4
|
import CodeEditorType, { IAceEditorProps as CodeEditorProps } from 'react-ace';
|
|
5
5
|
import { Editor as RichTextEditor } from 'tinymce';
|
|
6
|
-
import { ComponentAdapter, StaticWebComponent as StaticBaseWebComponent } from 'web-component-wrapper/type';
|
|
6
|
+
import { ComponentAdapter, PropertiesValidationMap, StaticWebComponent as StaticBaseWebComponent, ValidationMapping } from 'web-component-wrapper/type';
|
|
7
7
|
import { MDCMenuFoundation } from '@material/menu';
|
|
8
8
|
import { MDCSelectFoundation } from '@material/select';
|
|
9
9
|
import { MDCTextFieldFoundation } from '@material/textfield';
|
|
@@ -86,7 +86,7 @@ export interface BaseProperties extends CommonBaseModel, ModelState {
|
|
|
86
86
|
required: boolean;
|
|
87
87
|
requiredText: string;
|
|
88
88
|
ripple: RipplePropT;
|
|
89
|
-
rootProps: HTMLProps<
|
|
89
|
+
rootProps: HTMLProps<Mapping<unknown>>;
|
|
90
90
|
showDeclaration: boolean;
|
|
91
91
|
showInitialValidationState: boolean;
|
|
92
92
|
styles: Mapping;
|
|
@@ -140,12 +140,12 @@ export declare type StaticFunctionComponent<P = Props, MS = ModelState, DP = Def
|
|
|
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
|
-
export declare const baseModelPropertyTypes:
|
|
143
|
+
export declare const baseModelPropertyTypes: ValidationMapping;
|
|
144
144
|
export declare const modelStatePropertyTypes: {
|
|
145
145
|
[_key in keyof ModelState]: Requireable<boolean | symbol>;
|
|
146
146
|
};
|
|
147
|
-
export declare const modelPropertyTypes:
|
|
148
|
-
export declare const propertyTypes:
|
|
147
|
+
export declare const modelPropertyTypes: ValidationMapping;
|
|
148
|
+
export declare const propertyTypes: ValidationMapping;
|
|
149
149
|
export declare const defaultModelState: ModelState;
|
|
150
150
|
export declare const defaultModel: Model<string>;
|
|
151
151
|
export declare const defaultProperties: DefaultProperties<string>;
|
|
@@ -165,7 +165,7 @@ export declare type DefaultCheckboxProperties = Omit<CheckboxProps, 'model'> & {
|
|
|
165
165
|
export declare type CheckboxState = State<boolean>;
|
|
166
166
|
export declare type CheckboxAdapter = ComponentAdapter<CheckboxProperties, Omit<CheckboxState, 'value'>>;
|
|
167
167
|
export declare type CheckboxComponent = InputComponent<CheckboxProps, CheckboxModelState, DefaultCheckboxProperties, CheckboxAdapter>;
|
|
168
|
-
export declare const checkboxPropertyTypes:
|
|
168
|
+
export declare const checkboxPropertyTypes: PropertiesValidationMap;
|
|
169
169
|
export declare const defaultCheckboxModel: CheckboxModel;
|
|
170
170
|
export declare const defaultCheckboxProperties: DefaultCheckboxProperties;
|
|
171
171
|
export interface FormatSpecification<T = unknown> {
|
|
@@ -311,7 +311,7 @@ export interface GenericInputComponent extends Omit<ForwardRefExoticComponent<In
|
|
|
311
311
|
export declare const inputModelStatePropertyTypes: {
|
|
312
312
|
[_key in keyof InputModelState]: Requireable<boolean | symbol>;
|
|
313
313
|
};
|
|
314
|
-
export declare const inputPropertyTypes:
|
|
314
|
+
export declare const inputPropertyTypes: PropertiesValidationMap;
|
|
315
315
|
export declare const inputRenderProperties: Array<string>;
|
|
316
316
|
export declare const defaultInputModelState: InputModelState;
|
|
317
317
|
export declare const defaultInputModel: InputModel<string>;
|
|
@@ -350,23 +350,23 @@ export interface FileInputChildrenOptions<P> {
|
|
|
350
350
|
export interface FileInputProperties extends Properties<FileValue>, FileInputModelState {
|
|
351
351
|
children: (_options: FileInputChildrenOptions<this>) => null | ReactElement;
|
|
352
352
|
contentTypePattern: Array<RegExp | string> | null | RegExp | string;
|
|
353
|
+
invertedContentTypePattern: Array<RegExp | string> | null | RegExp | string;
|
|
353
354
|
contentTypePatternText: string;
|
|
355
|
+
invertedContentTypePatternText: string;
|
|
356
|
+
maximumSizeText: string;
|
|
357
|
+
minimumSizeText: string;
|
|
354
358
|
deleteButton: ReactElement | string;
|
|
355
359
|
downloadButton: ReactElement | string;
|
|
356
360
|
editButton: ReactElement | string;
|
|
361
|
+
newButton: ReactElement | string;
|
|
357
362
|
encoding: string;
|
|
358
363
|
generateFileNameInputProperties: (_prototype: InputProps<string>, _properties: this & {
|
|
359
364
|
value: FileValue & {
|
|
360
365
|
name: string;
|
|
361
366
|
};
|
|
362
367
|
}) => InputProps<string>;
|
|
363
|
-
invertedContentTypePattern: Array<RegExp | string> | null | RegExp | string;
|
|
364
|
-
invertedContentTypePatternText: string;
|
|
365
|
-
maximumSizeText: string;
|
|
366
368
|
media: CardMediaProps;
|
|
367
|
-
minimumSizeText: string;
|
|
368
369
|
model: FileInputModel;
|
|
369
|
-
newButton: ReactElement | string;
|
|
370
370
|
outlined: boolean;
|
|
371
371
|
sourceToBlobOptions: {
|
|
372
372
|
endings?: 'native' | 'transparent';
|
|
@@ -401,18 +401,24 @@ export declare type FileInputComponent = InputComponent<FileInputProps, FileInpu
|
|
|
401
401
|
export declare const fileInputModelStatePropertyTypes: {
|
|
402
402
|
[_key in keyof FileInputModelState]: Requireable<boolean | symbol>;
|
|
403
403
|
};
|
|
404
|
-
export declare const fileInputPropertyTypes:
|
|
404
|
+
export declare const fileInputPropertyTypes: PropertiesValidationMap;
|
|
405
405
|
export declare const defaultFileInputModelState: FileInputModelState;
|
|
406
406
|
export declare const defaultFileInputModel: FileInputModel;
|
|
407
407
|
export declare const defaultFileNameInputProperties: InputProps<string>;
|
|
408
408
|
export declare const defaultFileInputProperties: DefaultFileInputProperties;
|
|
409
|
-
export interface InputsPropertiesItem<T> {
|
|
409
|
+
export interface InputsPropertiesItem<T, TS = unknown> {
|
|
410
410
|
model?: {
|
|
411
|
-
state?:
|
|
411
|
+
state?: TS;
|
|
412
412
|
value?: null | T;
|
|
413
413
|
};
|
|
414
414
|
value?: null | T;
|
|
415
415
|
}
|
|
416
|
+
export interface InputsCreatePrototypeOptions<T, P extends InputsPropertiesItem<T>, IP> {
|
|
417
|
+
index: number;
|
|
418
|
+
properties: IP;
|
|
419
|
+
prototype: Partial<P>;
|
|
420
|
+
values: Array<null | T | undefined> | null;
|
|
421
|
+
}
|
|
416
422
|
export interface InputsModelState extends ModelState {
|
|
417
423
|
invalidMaximumNumber: boolean;
|
|
418
424
|
invalidMinimumNumber: boolean;
|
|
@@ -428,21 +434,15 @@ export interface InputsChildrenOptions<T, P extends InputsPropertiesItem<T>, IP>
|
|
|
428
434
|
inputsProperties: IP;
|
|
429
435
|
properties: Partial<P>;
|
|
430
436
|
}
|
|
431
|
-
export interface InputsCreatePrototypeOptions<T, P extends InputsPropertiesItem<T>, IP> {
|
|
432
|
-
index: number;
|
|
433
|
-
properties: IP;
|
|
434
|
-
prototype: Partial<P>;
|
|
435
|
-
values: Array<null | T | undefined> | null;
|
|
436
|
-
}
|
|
437
437
|
export interface InputsProperties<T = unknown, P extends InputsPropertiesItem<T> = Properties<T>> extends InputsModelState, Omit<Properties<Array<P>>, 'onChangeValue'> {
|
|
438
438
|
addIcon: IconOptions;
|
|
439
|
+
removeIcon: IconOptions;
|
|
439
440
|
children: (_options: InputsChildrenOptions<T, P, this>) => ReactElement;
|
|
440
441
|
createPrototype: (_options: InputsCreatePrototypeOptions<T, P, this>) => P;
|
|
441
442
|
maximumNumber: number;
|
|
442
443
|
minimumNumber: number;
|
|
443
444
|
model: InputsModel<T, P>;
|
|
444
445
|
onChangeValue: (_values: Array<null | T> | null, _event: GenericEvent | unknown, _properties: this) => void;
|
|
445
|
-
removeIcon: IconOptions;
|
|
446
446
|
value: Array<P> | null;
|
|
447
447
|
writable: boolean;
|
|
448
448
|
}
|
|
@@ -464,7 +464,7 @@ export declare type InputsAdapterWithReferences<T = unknown, P extends InputsPro
|
|
|
464
464
|
export interface InputsComponent extends Omit<ForwardRefExoticComponent<InputsProps>, 'propTypes'>, StaticWebComponent<InputsModelState, DefaultInputsProperties> {
|
|
465
465
|
<T = string, P extends InputsPropertiesItem<T> = InputProperties<T>>(_props: InputsProps<T, P> & RefAttributes<InputsAdapter<T, P>>): ReactElement;
|
|
466
466
|
}
|
|
467
|
-
export declare const inputsPropertyTypes:
|
|
467
|
+
export declare const inputsPropertyTypes: PropertiesValidationMap;
|
|
468
468
|
export declare const inputsRenderProperties: Array<string>;
|
|
469
469
|
export declare const defaultInputsModel: InputsModel<string, InputProperties<string>>;
|
|
470
470
|
export declare const defaultInputsProperties: DefaultInputsProperties;
|
|
@@ -494,11 +494,11 @@ export interface IntervalProperties extends Omit<InputProperties<number>, 'icon'
|
|
|
494
494
|
}
|
|
495
495
|
export declare type IntervalProps = Omit<InputProps<number>, 'icon' | 'model' | 'onChange' | 'onChangeValue' | 'value'> & Partial<{
|
|
496
496
|
end: InputProps<number>;
|
|
497
|
+
start: InputProps<number>;
|
|
497
498
|
icon: IntervalProperties['icon'];
|
|
498
499
|
model: IntervalProperties['model'];
|
|
499
500
|
onChange: IntervalProperties['onChange'];
|
|
500
501
|
onChangeValue: IntervalProperties['onChangeValue'];
|
|
501
|
-
start: InputProps<number>;
|
|
502
502
|
value: IntervalConfiguration | IntervalValue | null;
|
|
503
503
|
}>;
|
|
504
504
|
export declare type DefaultIntervalProperties = Omit<IntervalProps, 'model'> & {
|
|
@@ -517,7 +517,7 @@ export interface IntervalAdapterWithReferences extends IntervalAdapter {
|
|
|
517
517
|
};
|
|
518
518
|
}
|
|
519
519
|
export declare type IntervalComponent = InputComponent<IntervalProps, IntervalModelState, DefaultIntervalProperties, IntervalAdapter>;
|
|
520
|
-
export declare const intervalPropertyTypes:
|
|
520
|
+
export declare const intervalPropertyTypes: PropertiesValidationMap;
|
|
521
521
|
export declare const defaultIntervalProperties: DefaultIntervalProperties;
|
|
522
522
|
export interface ConfigurationProperties {
|
|
523
523
|
strict?: boolean;
|