react-input-material 0.0.447 → 0.0.449

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/type.d.ts ADDED
@@ -0,0 +1,585 @@
1
+ import PropertyTypes from 'clientnode/property-types';
2
+ import { Mapping, PlainObject, RecursivePartial, ValueOf } from 'clientnode/type';
3
+ import { ComponentClass, FocusEvent, ForwardRefExoticComponent, FunctionComponent, FunctionComponentElement, KeyboardEvent, MouseEvent, MutableRefObject, ReactElement, ReactNode, RefAttributes, Requireable, SyntheticEvent } from 'react';
4
+ import CodeEditorType, { IAceEditorProps as CodeEditorProps } from 'react-ace';
5
+ import { TransitionProps } from 'react-transition-group/Transition';
6
+ import { EditorOptions as RawTinyMCEOptions, Editor as RichTextEditor } from 'tinymce';
7
+ import { ComponentAdapter, PropertiesValidationMap, StaticWebComponent as StaticBaseWebComponent, ValidationMapping } from 'web-component-wrapper/type';
8
+ import { MDCMenuFoundation } from '@material/menu';
9
+ import { MDCSelectFoundation } from '@material/select';
10
+ import { MDCTextFieldFoundation } from '@material/textfield';
11
+ import { CardMediaProps } from '@rmwc/card';
12
+ import { MenuApi } from '@rmwc/menu';
13
+ import { FormattedOption as FormattedSelectionOption, SelectProps } from '@rmwc/select';
14
+ import { TextFieldProps } from '@rmwc/textfield';
15
+ import { ThemeProviderProps } from '@rmwc/theme';
16
+ import { TooltipProps } from '@rmwc/tooltip';
17
+ import { IconOptions, RipplePropT } from '@rmwc/types';
18
+ import { Editor as RichTextEditorComponent, IAllProps as RichTextEditorProps } from '@tinymce/tinymce-react';
19
+ export declare type GenericAnimateProps = Partial<TransitionProps<HTMLElement | undefined>>;
20
+ export interface GenericAnimateComponent<Type> extends Omit<ForwardRefExoticComponent<GenericAnimateProps>, 'propTypes'>, StaticBaseWebComponent<Type> {
21
+ (props: (GenericAnimateProps & RefAttributes<HTMLDivElement | HTMLSpanElement>)): ReactElement;
22
+ }
23
+ export declare type DummyProps = Mapping<unknown> & {
24
+ children?: ReactElement;
25
+ };
26
+ export interface GenericEvent<T = unknown> extends SyntheticEvent {
27
+ detail?: T;
28
+ }
29
+ export interface TestHookWrapper<P extends Array<unknown> = Array<unknown>, WP extends {
30
+ children: FunctionComponentElement<{
31
+ parameters: P;
32
+ }>;
33
+ } = {
34
+ children: FunctionComponentElement<{
35
+ parameters: P;
36
+ }>;
37
+ }> {
38
+ component: FunctionComponent<WP>;
39
+ properties?: WP;
40
+ }
41
+ export interface TestHookResult<R = unknown, P extends Array<unknown> = Array<unknown>> {
42
+ result: {
43
+ value: R;
44
+ };
45
+ render: (...parameters: P) => void;
46
+ }
47
+ export interface HookOptions<P extends Array<unknown> = Array<unknown>, WP extends {
48
+ children: FunctionComponentElement<{
49
+ parameters: P;
50
+ }>;
51
+ } = {
52
+ children: FunctionComponentElement<{
53
+ parameters: P;
54
+ }>;
55
+ }> {
56
+ parameters: P;
57
+ wrapper?: null | TestHookWrapper<P, WP>;
58
+ flush?: boolean;
59
+ }
60
+ export interface TestEnvironment {
61
+ container: HTMLDivElement | null;
62
+ render: <T = HTMLElement>(component: ReactElement) => null | T;
63
+ runHook: <R = unknown, P extends Array<unknown> = Array<unknown>, WP extends {
64
+ children: FunctionComponentElement<{
65
+ parameters: P;
66
+ }>;
67
+ } = {
68
+ children: FunctionComponentElement<{
69
+ parameters: P;
70
+ }>;
71
+ }>(hook: (...parameters: P) => R, options: Partial<HookOptions<P, WP>>) => TestHookResult<R, P>;
72
+ }
73
+ export interface CursorState {
74
+ end: number;
75
+ start: number;
76
+ }
77
+ export declare type Renderable = Array<ReactElement | string> | ReactElement | string;
78
+ export interface CommonBaseModel {
79
+ declaration: string;
80
+ default: unknown;
81
+ description: string;
82
+ emptyEqualsNull: boolean;
83
+ maximum: number | string;
84
+ maximumLength: number;
85
+ minimum: number | string;
86
+ minimumLength: number;
87
+ name: string;
88
+ selection?: SelectProps['options'];
89
+ trim: boolean;
90
+ type: string;
91
+ value?: unknown;
92
+ }
93
+ export interface ModelState {
94
+ dirty: boolean;
95
+ focused: boolean;
96
+ invalid: boolean;
97
+ invalidRequired: boolean;
98
+ pristine: boolean;
99
+ touched: boolean;
100
+ untouched: boolean;
101
+ valid: boolean;
102
+ visited: boolean;
103
+ }
104
+ export interface BaseModel extends CommonBaseModel {
105
+ invertedRegularExpressionPattern: Array<RegExp | string> | null | RegExp | string;
106
+ mutable: boolean;
107
+ nullable: boolean;
108
+ regularExpressionPattern: Array<RegExp | string> | null | RegExp | string;
109
+ state: ModelState;
110
+ writable: boolean;
111
+ }
112
+ export interface CommonModel<T = unknown> extends CommonBaseModel {
113
+ default: null | T;
114
+ value?: null | T;
115
+ }
116
+ export interface Model<T = unknown> extends BaseModel {
117
+ default: null | T;
118
+ value?: null | T;
119
+ }
120
+ export interface BaseProperties extends CommonBaseModel, ModelState {
121
+ className: string;
122
+ disabled: boolean;
123
+ enforceUncontrolled: boolean;
124
+ id: string;
125
+ initialValue: unknown;
126
+ label: string;
127
+ model: BaseModel;
128
+ name: string;
129
+ required: boolean;
130
+ requiredText: string;
131
+ ripple: RipplePropT;
132
+ rootProps: Mapping<boolean | number | string>;
133
+ showDeclaration: boolean;
134
+ showInitialValidationState: boolean;
135
+ styles: Mapping;
136
+ themeConfiguration: ThemeProviderProps['options'];
137
+ tooltip: string | TooltipProps;
138
+ }
139
+ export declare type BaseProps = Partial<Omit<BaseProperties, 'model'>> & {
140
+ model?: Partial<BaseModel>;
141
+ };
142
+ export declare type DefaultBaseProperties = Omit<BaseProps, 'model'> & {
143
+ model: BaseModel;
144
+ };
145
+ export interface TypedProperties<T = unknown> extends BaseProperties {
146
+ initialValue: null | T;
147
+ model: Model<T>;
148
+ onBlur: (event: GenericEvent | undefined, properties: this) => void;
149
+ onChange: (properties: this, event?: GenericEvent) => void;
150
+ onChangeShowDeclaration: (show: boolean, event: GenericEvent | undefined, properties: this) => void;
151
+ onChangeState: (state: ModelState, event: GenericEvent | undefined, properties: this) => void;
152
+ onChangeValue: (value: null | T, event: GenericEvent | undefined, properties: this) => void;
153
+ onClick: (event: MouseEvent, properties: this) => void;
154
+ onFocus: (event: FocusEvent, properties: this) => void;
155
+ onTouch: (event: GenericEvent, properties: this) => void;
156
+ }
157
+ export declare type Properties<T = unknown> = TypedProperties<T> & CommonModel<T>;
158
+ export declare type Props<T = unknown> = Partial<Omit<Properties<T>, 'model'>> & {
159
+ model?: Partial<Model<T>>;
160
+ };
161
+ export declare type DefaultProperties<T = unknown> = Omit<Props<T>, 'model'> & {
162
+ model: Model<T>;
163
+ };
164
+ export interface State<T = unknown> {
165
+ modelState?: ModelState;
166
+ value?: null | T;
167
+ }
168
+ export interface ValueState<T = unknown, MS = ModelState> {
169
+ modelState: MS;
170
+ value: null | T;
171
+ }
172
+ export interface EditorState {
173
+ editorIsActive: boolean;
174
+ selectionIsUnstable: boolean;
175
+ }
176
+ export interface StaticWebComponent<Type, MS = ModelState, DP = DefaultProperties> extends StaticBaseWebComponent<Type> {
177
+ defaultModelState: MS;
178
+ defaultProperties: DP;
179
+ strict: boolean;
180
+ }
181
+ export declare type StaticComponent<Type, P = Props, MS = ModelState, DP = DefaultProperties> = Omit<ComponentClass<P>, 'propTypes'> & StaticWebComponent<Type, MS, DP>;
182
+ export declare type StaticFunctionComponent<Type, P = Props, MS = ModelState, DP = DefaultProperties> = Omit<FunctionComponent<P>, 'propTypes'> & StaticComponent<Type, P, MS, DP>;
183
+ export interface InputComponent<Type, P = Props, MS = ModelState, DP = DefaultProperties, A = ComponentAdapter<P>> extends Omit<ForwardRefExoticComponent<P>, 'propTypes'>, StaticWebComponent<Type, MS, DP> {
184
+ (props: P & RefAttributes<A>): ReactElement;
185
+ }
186
+ export declare const baseModelPropertyTypes: ValidationMapping;
187
+ export declare const modelStatePropertyTypes: {
188
+ [key in keyof ModelState]: Requireable<boolean | symbol>;
189
+ };
190
+ export declare const modelPropertyTypes: ValidationMapping;
191
+ export declare const propertyTypes: ValidationMapping;
192
+ export declare const defaultModelState: ModelState;
193
+ export declare const defaultModel: Model<string>;
194
+ export declare const defaultProperties: DefaultProperties<string>;
195
+ export interface CheckboxProperties extends Properties<boolean> {
196
+ checked: boolean;
197
+ id: string;
198
+ }
199
+ export declare type CheckboxModel = Model<boolean>;
200
+ export declare type CheckboxModelState = ModelState;
201
+ export declare type CheckboxValueState = ValueState<boolean, CheckboxModelState>;
202
+ export declare type CheckboxProps = Partial<Omit<CheckboxProperties, 'model'>> & {
203
+ model?: Partial<CheckboxModel>;
204
+ };
205
+ export declare type DefaultCheckboxProperties = Omit<CheckboxProps, 'model'> & {
206
+ model: CheckboxModel;
207
+ };
208
+ export declare type CheckboxState = State<boolean>;
209
+ export declare type CheckboxAdapter = ComponentAdapter<CheckboxProperties, Omit<CheckboxState, 'value'>>;
210
+ export declare type CheckboxComponent<Type> = InputComponent<Type, CheckboxProps, CheckboxModelState, DefaultCheckboxProperties, CheckboxAdapter>;
211
+ export declare const checkboxPropertyTypes: PropertiesValidationMap;
212
+ export declare const defaultCheckboxModel: CheckboxModel;
213
+ export declare const defaultCheckboxProperties: DefaultCheckboxProperties;
214
+ export declare type Transformer<T = unknown> = (value: T, configuration: DefaultInputProperties<T>, transformer: InputDataTransformation) => string;
215
+ export interface FormatSpecification<T = unknown> {
216
+ options?: PlainObject;
217
+ transform?: Transformer<T>;
218
+ }
219
+ export interface FormatSpecifications<T = unknown> {
220
+ final: FormatSpecification<T>;
221
+ intermediate?: FormatSpecification<T>;
222
+ }
223
+ export interface DataTransformSpecification<T = unknown, InputType = number | string> {
224
+ format?: FormatSpecifications<T>;
225
+ parse?: (value: InputType, configuration: DefaultInputProperties<T>, transformer: InputDataTransformation) => T;
226
+ type?: NativeInputType;
227
+ }
228
+ export declare type InputDataTransformation = {
229
+ boolean: DataTransformSpecification<boolean, number | string>;
230
+ currency: DataTransformSpecification<number, string>;
231
+ date: DataTransformSpecification<number, Date | number | string>;
232
+ 'datetime-local': DataTransformSpecification<number, Date | number | string>;
233
+ time: DataTransformSpecification<number, Date | number | string>;
234
+ 'time-local': DataTransformSpecification<number, Date | number | string>;
235
+ float: DataTransformSpecification<number, string>;
236
+ integer: DataTransformSpecification<number, string>;
237
+ number: DataTransformSpecification<number, number>;
238
+ string?: DataTransformSpecification<unknown>;
239
+ } & {
240
+ [key in Exclude<NativeInputType, 'date' | 'datetime-local' | 'time' | 'number'>]?: DataTransformSpecification<unknown>;
241
+ };
242
+ export declare type NormalizedSelection = Array<Omit<FormattedSelectionOption, 'value'> & {
243
+ value: unknown;
244
+ }>;
245
+ export interface InputTablePosition {
246
+ column: number;
247
+ row: number;
248
+ }
249
+ export interface InputModelState extends ModelState {
250
+ invalidMaximum: boolean;
251
+ invalidMinimum: boolean;
252
+ invalidMaximumLength: boolean;
253
+ invalidMinimumLength: boolean;
254
+ invalidInvertedPattern: boolean;
255
+ invalidPattern: boolean;
256
+ }
257
+ export interface InputModel<T = unknown> extends Model<T> {
258
+ state: InputModelState;
259
+ }
260
+ export interface InputValueState<T = unknown, MS = ModelState> extends ValueState<T, MS> {
261
+ representation?: ReactNode | string;
262
+ }
263
+ export declare type NativeInputType = ('date' | 'datetime-local' | 'month' | 'number' | 'range' | 'text' | 'time' | 'week');
264
+ export declare type GenericInputType = ('boolean' | 'currency' | 'float' | 'integer' | 'string' | 'time-local' | NativeInputType);
265
+ export interface InputChildrenOptions<P, T> {
266
+ index: number;
267
+ normalizedSelection: NormalizedSelection;
268
+ properties: P;
269
+ query: string;
270
+ suggestion: ReactNode | string;
271
+ value: T;
272
+ }
273
+ export interface SuggestionCreatorOptions<P> {
274
+ abortController: AbortController;
275
+ properties: P;
276
+ query: string;
277
+ }
278
+ export interface InputProperties<T = unknown> extends InputModelState, Properties<T> {
279
+ align: 'end' | 'start';
280
+ children: (options: InputChildrenOptions<this, T>) => null | ReactElement;
281
+ cursor: CursorState;
282
+ editor: ('code' | 'code(css)' | 'code(script)' | 'plain' | 'text' | 'richtext(raw)' | 'richtext(simple)' | 'richtext(normal)' | 'richtext(advanced)');
283
+ editorIsActive: boolean;
284
+ hidden: boolean;
285
+ icon: string | (IconOptions & {
286
+ tooltip?: string | TooltipProps;
287
+ });
288
+ inputProperties: Partial<CodeEditorProps | RichTextEditorProps | SelectProps | TextFieldProps>;
289
+ inputProps: Mapping<boolean | number | string>;
290
+ invertedPattern: Array<RegExp | string> | null | RegExp | string;
291
+ invertedPatternText: string;
292
+ labels: Array<[string, string]> | Array<string> | Mapping;
293
+ maximumLengthText: string;
294
+ maximumText: string;
295
+ minimumLengthText: string;
296
+ minimumText: string;
297
+ model: InputModel<T>;
298
+ onChangeEditorIsActive: (isActive: boolean, event: MouseEvent | undefined, properties: this) => void;
299
+ onKeyDown: (event: KeyboardEvent, properties: this) => void;
300
+ onKeyUp: (event: KeyboardEvent, properties: this) => void;
301
+ onSelect: (event: GenericEvent, properties: this) => void;
302
+ onSelectionChange: (event: GenericEvent, properties: this) => void;
303
+ outlined: boolean;
304
+ pattern: Array<RegExp | string> | null | RegExp | string;
305
+ patternText: string;
306
+ placeholder: string;
307
+ representation: ReactNode | string;
308
+ rows: number;
309
+ searchSelection: boolean;
310
+ selectableEditor: boolean;
311
+ step: number;
312
+ suggestionCreator?: (options: SuggestionCreatorOptions<this>) => InputProperties['selection'] | Promise<InputProperties['selection']>;
313
+ suggestSelection: boolean;
314
+ trailingIcon: string | (IconOptions & {
315
+ tooltip?: string | TooltipProps;
316
+ });
317
+ transformer: RecursivePartial<DataTransformSpecification<T, Date | number | string>>;
318
+ }
319
+ export declare type InputProps<T = unknown> = Partial<Omit<InputProperties<T>, 'model'>> & {
320
+ model?: Partial<InputModel<T>>;
321
+ };
322
+ export declare type DefaultInputProperties<T = string> = Omit<InputProps<T>, 'model'> & {
323
+ model: InputModel<T>;
324
+ };
325
+ export declare type InputPropertyTypes<T = unknown> = {
326
+ [key in keyof InputProperties<T>]: ValueOf<typeof PropertyTypes>;
327
+ };
328
+ export interface InputState<T = unknown> extends State<T> {
329
+ cursor: CursorState;
330
+ editorIsActive: boolean;
331
+ hidden?: boolean;
332
+ modelState: InputModelState;
333
+ representation?: ReactNode | string;
334
+ selectionIsUnstable: boolean;
335
+ showDeclaration: boolean;
336
+ }
337
+ export declare type InputAdapter<T = unknown> = ComponentAdapter<InputProperties<T>, Omit<InputState<T>, 'representation' | 'selectionIsUnstable' | 'value'> & {
338
+ representation?: ReactNode | string;
339
+ value?: null | T;
340
+ }>;
341
+ export interface InputAdapterWithReferences<T = unknown> extends InputAdapter<T> {
342
+ references: {
343
+ codeEditorReference: MutableRefObject<CodeEditorType | null>;
344
+ codeEditorInputReference: MutableRefObject<HTMLTextAreaElement | null>;
345
+ foundationReference: MutableRefObject<MDCSelectFoundation | MDCTextFieldFoundation | null>;
346
+ inputReference: MutableRefObject<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | null>;
347
+ richTextEditorInputReference: MutableRefObject<HTMLTextAreaElement | null>;
348
+ richTextEditorInstance: MutableRefObject<RichTextEditor | null>;
349
+ richTextEditorReference: MutableRefObject<RichTextEditorComponent | null>;
350
+ suggestionMenuAPIReference: MutableRefObject<MenuApi | null>;
351
+ suggestionMenuFoundationReference: MutableRefObject<MDCMenuFoundation | null>;
352
+ };
353
+ }
354
+ export interface TinyMCEOptions extends RawTinyMCEOptions {
355
+ selector?: undefined;
356
+ target?: undefined;
357
+ }
358
+ export interface GenericInputComponent<Type> extends Omit<ForwardRefExoticComponent<InputProps>, 'propTypes'>, StaticWebComponent<Type, InputModelState, DefaultInputProperties> {
359
+ <T = string>(props: InputProps<T> & RefAttributes<InputAdapter<T>>): ReactElement;
360
+ locales: Array<string>;
361
+ transformer: InputDataTransformation;
362
+ }
363
+ export declare const inputModelStatePropertyTypes: {
364
+ [key in keyof InputModelState]: Requireable<boolean | symbol>;
365
+ };
366
+ export declare const inputPropertyTypes: PropertiesValidationMap;
367
+ export declare const inputRenderProperties: Array<string>;
368
+ export declare const defaultInputModelState: InputModelState;
369
+ export declare const defaultInputModel: InputModel<string>;
370
+ export declare const defaultInputProperties: DefaultInputProperties;
371
+ export declare type FileRepresentationType = 'binary' | 'image' | 'renderableText' | 'text' | 'video';
372
+ export interface FileValue {
373
+ blob?: Partial<Blob> | null;
374
+ hash?: null | string;
375
+ name?: null | string;
376
+ source?: null | string;
377
+ url?: null | string;
378
+ }
379
+ export interface FileInputValueState extends ValueState<FileValue, FileInputModelState> {
380
+ attachBlobProperty: boolean;
381
+ }
382
+ export interface FileInputModelState extends ModelState {
383
+ invalidMaximumSize: boolean;
384
+ invalidMinimumSize: boolean;
385
+ invalidContentTypePattern: boolean;
386
+ invalidName: boolean;
387
+ }
388
+ export interface FileInputModel extends Model<FileValue> {
389
+ contentTypeRegularExpressionPattern: Array<RegExp | string> | null | RegExp | string;
390
+ invertedContentTypeRegularExpressionPattern: (Array<RegExp | string> | null | RegExp | string);
391
+ maximumSize: number;
392
+ minimumSize: number;
393
+ fileName: InputModel<string>;
394
+ state: FileInputModelState;
395
+ }
396
+ export interface FileInputChildrenOptions<P> {
397
+ declaration: string;
398
+ invalid: boolean;
399
+ properties: P;
400
+ value?: FileValue | null;
401
+ }
402
+ export interface FileInputProperties extends Properties<FileValue>, FileInputModelState {
403
+ children: (options: FileInputChildrenOptions<this>) => null | ReactElement;
404
+ contentTypePattern: Array<RegExp | string> | null | RegExp | string;
405
+ invertedContentTypePattern: Array<RegExp | string> | null | RegExp | string;
406
+ contentTypePatternText: string;
407
+ invertedContentTypePatternText: string;
408
+ maximumSizeText: string;
409
+ minimumSizeText: string;
410
+ deleteButton: ReactElement | string;
411
+ downloadButton: ReactElement | string;
412
+ editButton: ReactElement | string;
413
+ newButton: ReactElement | string;
414
+ encoding: string;
415
+ generateFileNameInputProperties: (prototype: InputProps<string>, properties: this & {
416
+ value: FileValue & {
417
+ name: string;
418
+ };
419
+ }) => InputProps<string>;
420
+ media: CardMediaProps;
421
+ model: FileInputModel;
422
+ outlined: boolean;
423
+ sourceToBlobOptions: {
424
+ endings?: 'native' | 'transparent';
425
+ type?: string;
426
+ };
427
+ }
428
+ export declare type FileInputProps = Partial<Omit<FileInputProperties, 'model'>> & {
429
+ model?: Partial<FileInputModel>;
430
+ };
431
+ export declare type DefaultFileInputProperties = Omit<FileInputProps, 'model'> & {
432
+ model: FileInputModel;
433
+ };
434
+ export declare type FileInputPropertyTypes = {
435
+ [key in keyof FileInputProperties]: ValueOf<typeof PropertyTypes>;
436
+ };
437
+ export interface FileInputState extends State<FileValue> {
438
+ modelState: FileInputModelState;
439
+ }
440
+ export declare type FileInputAdapter = ComponentAdapter<FileInputProperties, Omit<FileInputState, 'value'> & {
441
+ value?: FileValue | null;
442
+ }>;
443
+ export interface FileInputAdapterWithReferences extends FileInputAdapter {
444
+ references: {
445
+ deleteButtonReference: MutableRefObject<HTMLButtonElement | null>;
446
+ downloadLinkReference: MutableRefObject<HTMLAnchorElement | null>;
447
+ fileInputReference: MutableRefObject<HTMLInputElement | null>;
448
+ nameInputReference: MutableRefObject<InputAdapter<string> | null>;
449
+ uploadButtonReference: MutableRefObject<HTMLButtonElement | null>;
450
+ };
451
+ }
452
+ export declare type FileInputComponent<Type> = InputComponent<Type, FileInputProps, FileInputModelState, DefaultFileInputProperties, FileInputAdapter>;
453
+ export declare const fileInputModelStatePropertyTypes: {
454
+ [key in keyof FileInputModelState]: Requireable<boolean | symbol>;
455
+ };
456
+ export declare const fileInputPropertyTypes: PropertiesValidationMap;
457
+ export declare const defaultFileInputModelState: FileInputModelState;
458
+ export declare const defaultFileInputModel: FileInputModel;
459
+ export declare const defaultFileNameInputProperties: InputProps<string>;
460
+ export declare const defaultFileInputProperties: DefaultFileInputProperties;
461
+ export interface InputsPropertiesItem<T, TS = unknown> {
462
+ model?: {
463
+ state?: TS;
464
+ value?: null | T;
465
+ };
466
+ value?: null | T;
467
+ }
468
+ export interface InputsCreateOptions<T, IP> {
469
+ index: number;
470
+ properties: IP;
471
+ values: Array<null | T | undefined> | null;
472
+ }
473
+ export interface InputsCreateItemOptions<T, P extends InputsPropertiesItem<T>, IP> extends InputsCreateOptions<T, IP> {
474
+ item: Partial<P>;
475
+ }
476
+ export interface InputsCreatePrototypeOptions<T, P extends InputsPropertiesItem<T>, IP> extends InputsCreateItemOptions<T, P, IP> {
477
+ lastValue: null | T | undefined;
478
+ }
479
+ export interface InputsModelState extends ModelState {
480
+ invalidMaximumNumber: boolean;
481
+ invalidMinimumNumber: boolean;
482
+ }
483
+ export interface InputsModel<T, P extends InputsPropertiesItem<T>> extends Model<Array<P>> {
484
+ maximumNumber: number;
485
+ minimumNumber: number;
486
+ state: InputsModelState;
487
+ writable: boolean;
488
+ }
489
+ export interface InputsChildrenOptions<T, P extends InputsPropertiesItem<T>, IP> {
490
+ index: number;
491
+ inputsProperties: IP;
492
+ properties: Partial<P>;
493
+ }
494
+ export interface InputsProperties<T = unknown, P extends InputsPropertiesItem<T> = Properties<T>> extends InputsModelState, Omit<Properties<Array<P>>, 'onChangeValue'> {
495
+ addIcon: IconOptions;
496
+ removeIcon: IconOptions;
497
+ children: (options: InputsChildrenOptions<T, P, this>) => ReactElement;
498
+ createItem: (options: InputsCreateItemOptions<T, P, this>) => P;
499
+ createPrototype: (options: InputsCreatePrototypeOptions<T, P, this>) => P;
500
+ maximumNumber: number;
501
+ minimumNumber: number;
502
+ model: InputsModel<T, P>;
503
+ onChangeValue: (values: Array<null | T> | null, event: GenericEvent | unknown, properties: this) => void;
504
+ value: Array<P> | null;
505
+ writable: boolean;
506
+ }
507
+ export declare type InputsProps<T = unknown, P extends InputsPropertiesItem<T> = Properties<T>> = Partial<Omit<InputsProperties<T, P>, 'model' | 'value'>> & {
508
+ model?: Partial<InputsModel<T, P>>;
509
+ value?: Array<Partial<P>> | Array<null | T | undefined> | null;
510
+ };
511
+ export declare type DefaultInputsProperties<T = string, P extends InputsPropertiesItem<T> = InputProps<T>> = Partial<Omit<InputsProperties<T, P>, 'default' | 'model' | 'value'>> & {
512
+ model: InputsModel<T, P>;
513
+ };
514
+ export declare type InputsPropertyTypes<T = unknown, P extends InputsPropertiesItem<T> = Properties<T>> = {
515
+ [key in keyof InputsProperties<P>]: ValueOf<typeof PropertyTypes>;
516
+ };
517
+ export declare type InputsState<T = unknown> = State<Array<null | T | undefined>>;
518
+ export declare type InputsAdapter<T = unknown, P extends InputsPropertiesItem<T> = Properties<T>> = ComponentAdapter<InputsProperties<T, P>, InputsState<T>>;
519
+ export declare type InputsAdapterWithReferences<T = unknown, P extends InputsPropertiesItem<T> = Properties<T>, RefType = unknown> = InputsAdapter<T, P> & {
520
+ references: Array<MutableRefObject<RefType>>;
521
+ };
522
+ export interface InputsComponent<Type> extends Omit<ForwardRefExoticComponent<InputsProps>, 'propTypes'>, StaticWebComponent<Type, InputsModelState, DefaultInputsProperties> {
523
+ <T = string, P extends InputsPropertiesItem<T> = InputProperties<T>>(props: InputsProps<T, P> & RefAttributes<InputsAdapter<T, P>>): ReactElement;
524
+ }
525
+ export declare const inputsPropertyTypes: PropertiesValidationMap;
526
+ export declare const inputsRenderProperties: Array<string>;
527
+ export declare const defaultInputsModel: InputsModel<string, InputProperties<string>>;
528
+ export declare const defaultInputsProperties: DefaultInputsProperties;
529
+ export interface IntervalValue {
530
+ end?: null | number;
531
+ start?: null | number;
532
+ }
533
+ export interface IntervalConfiguration {
534
+ end: InputProps<number>;
535
+ start: InputProps<number>;
536
+ }
537
+ export declare type IntervalModelState = ModelState;
538
+ export interface IntervalModel {
539
+ name: string;
540
+ state: IntervalModelState;
541
+ value: {
542
+ end: InputModel<number>;
543
+ start: InputModel<number>;
544
+ };
545
+ }
546
+ export interface IntervalProperties extends Omit<InputProperties<number>, 'icon' | 'model' | 'onChange' | 'onChangeValue' | 'value'> {
547
+ icon: IconOptions;
548
+ model: IntervalModel;
549
+ onChange: (properties: this, event?: GenericEvent) => void;
550
+ onChangeValue: (value: null | IntervalValue, event?: GenericEvent) => void;
551
+ value: IntervalConfiguration;
552
+ }
553
+ export declare type IntervalProps = Omit<InputProps<number>, 'icon' | 'model' | 'onChange' | 'onChangeValue' | 'value'> & Partial<{
554
+ end: InputProps<number>;
555
+ start: InputProps<number>;
556
+ icon: IntervalProperties['icon'];
557
+ model: IntervalProperties['model'];
558
+ onChange: IntervalProperties['onChange'];
559
+ onChangeValue: IntervalProperties['onChangeValue'];
560
+ value: IntervalConfiguration | IntervalValue | null;
561
+ }>;
562
+ export declare type DefaultIntervalProperties = Omit<IntervalProps, 'model'> & {
563
+ model: IntervalModel;
564
+ };
565
+ export declare type IntervalPropertyTypes = {
566
+ [key in keyof IntervalProperties]: ValueOf<typeof PropertyTypes>;
567
+ };
568
+ export declare type IntervalAdapter = ComponentAdapter<IntervalProperties, {
569
+ value?: IntervalValue | null;
570
+ }>;
571
+ export interface IntervalAdapterWithReferences extends IntervalAdapter {
572
+ references: {
573
+ end: MutableRefObject<InputAdapterWithReferences<number> | null>;
574
+ start: MutableRefObject<InputAdapterWithReferences<number> | null>;
575
+ };
576
+ }
577
+ export declare type IntervalComponent<Type> = InputComponent<Type, IntervalProps, IntervalModelState, DefaultIntervalProperties, IntervalAdapter>;
578
+ export declare const intervalPropertyTypes: PropertiesValidationMap;
579
+ export declare const defaultIntervalProperties: DefaultIntervalProperties;
580
+ export interface ConfigurationProperties {
581
+ strict?: boolean;
582
+ themeConfiguration?: ThemeProviderProps['options'];
583
+ tooltip?: Properties['tooltip'];
584
+ wrap?: boolean;
585
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-input-material",
3
- "version": "0.0.447",
3
+ "version": "0.0.449",
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",
@@ -30,6 +30,7 @@
30
30
  "dist/index.js",
31
31
  "dist/testHelper.d.ts",
32
32
  "dist/testHelper.js",
33
+ "dist/type.d.ts",
33
34
  "src/material-fixes.css"
34
35
  ],
35
36
  "repository": {