react-input-material 0.0.535 → 0.0.537

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 CHANGED
@@ -21,7 +21,7 @@ export interface CursorState {
21
21
  end: number;
22
22
  start: number;
23
23
  }
24
- export interface CommonBaseModel {
24
+ export interface CommonBaseModel<Type = unknown> {
25
25
  declaration: string;
26
26
  default: unknown;
27
27
  description: string;
@@ -34,7 +34,7 @@ export interface CommonBaseModel {
34
34
  selection?: Array<boolean | number> | SelectProps['options'];
35
35
  trim: boolean;
36
36
  type: string;
37
- value?: unknown;
37
+ value?: null | Type;
38
38
  }
39
39
  export interface ModelState {
40
40
  dirty: boolean;
@@ -47,7 +47,7 @@ export interface ModelState {
47
47
  valid: boolean;
48
48
  visited: boolean;
49
49
  }
50
- export interface BaseModel extends CommonBaseModel {
50
+ export interface BaseModel<T = unknown> extends CommonBaseModel<T> {
51
51
  invertedRegularExpressionPattern: Array<RegExp | string> | null | RegExp | string;
52
52
  mutable: boolean;
53
53
  nullable: boolean;
@@ -55,22 +55,20 @@ export interface BaseModel extends CommonBaseModel {
55
55
  state: ModelState;
56
56
  writable: boolean;
57
57
  }
58
- export interface CommonModel<T = unknown> extends CommonBaseModel {
58
+ export interface CommonModel<T = unknown> extends CommonBaseModel<T> {
59
59
  default: null | T;
60
- value?: null | T;
61
60
  }
62
- export interface Model<T = unknown> extends BaseModel {
61
+ export interface Model<T = unknown> extends BaseModel<T> {
63
62
  default: null | T;
64
- value?: null | T;
65
63
  }
66
- export interface BaseProperties extends CommonBaseModel, ModelState {
64
+ export interface BaseProperties<T = unknown> extends CommonBaseModel<T>, ModelState {
67
65
  className: string;
68
66
  disabled: boolean;
69
67
  enforceUncontrolled: boolean;
70
68
  id: string;
71
69
  initialValue: unknown;
72
70
  label: string;
73
- model: BaseModel;
71
+ model: BaseModel<T>;
74
72
  name: string;
75
73
  required: boolean;
76
74
  requiredText: string;
@@ -84,13 +82,13 @@ export interface BaseProperties extends CommonBaseModel, ModelState {
84
82
  tooltip: string | TooltipProps;
85
83
  triggerInitialPropertiesConsolidation: boolean;
86
84
  }
87
- export type BaseProps = Partial<Omit<BaseProperties, 'model'>> & {
88
- model?: Partial<BaseModel>;
85
+ export type BaseProps<T = unknown> = Partial<Omit<BaseProperties<T>, 'model'>> & {
86
+ model?: Partial<BaseModel<T>>;
89
87
  };
90
- export type DefaultBaseProperties = Omit<BaseProps, 'model'> & {
91
- model: BaseModel;
88
+ export type DefaultBaseProperties<T = unknown> = Omit<BaseProps<T>, 'model'> & {
89
+ model: BaseModel<T>;
92
90
  };
93
- export interface TypedProperties<T = unknown> extends BaseProperties {
91
+ export interface TypedProperties<T = unknown> extends BaseProperties<T> {
94
92
  initialValue: null | T;
95
93
  model: Model<T>;
96
94
  onBlur: (event: GenericEvent | undefined, properties: this) => void;
@@ -121,14 +119,14 @@ export interface EditorState {
121
119
  editorIsActive: boolean;
122
120
  selectionIsUnstable: boolean;
123
121
  }
124
- export interface StaticWebComponent<Type, MS = ModelState, DP = DefaultProperties> extends StaticBaseWebComponent<Type> {
122
+ export interface StaticWebComponent<Type, MS = ModelState, DP = DefaultProperties<Type>> extends StaticBaseWebComponent<Type> {
125
123
  defaultModelState: MS;
126
124
  defaultProperties: DP;
127
125
  strict: boolean;
128
126
  }
129
- export type StaticComponent<Type, P = Props, MS = ModelState, DP = DefaultProperties> = Omit<ComponentClass<P>, 'propTypes'> & StaticWebComponent<Type, MS, DP>;
130
- export type StaticFunctionComponent<Type, P = Props, MS = ModelState, DP = DefaultProperties> = Omit<FunctionComponent<P>, 'propTypes'> & StaticComponent<Type, P, MS, DP>;
131
- export interface InputComponent<Type, P = Props, MS = ModelState, DP = DefaultProperties, A = ComponentAdapter<P>> extends Omit<ForwardRefExoticComponent<P>, 'propTypes'>, StaticWebComponent<Type, MS, DP> {
127
+ export type StaticComponent<Type, P = Props, MS = ModelState, DP = DefaultProperties<Type>> = Omit<ComponentClass<P>, 'propTypes'> & StaticWebComponent<Type, MS, DP>;
128
+ export type StaticFunctionComponent<Type, P = Props, MS = ModelState, DP = DefaultProperties<Type>> = Omit<FunctionComponent<P>, 'propTypes'> & StaticComponent<Type, P, MS, DP>;
129
+ export interface InputComponent<ValueType, ComponentType, P = Props<ValueType>, MS = ModelState, DP = DefaultProperties<ValueType>, A = ComponentAdapter<P>> extends Omit<ForwardRefExoticComponent<P>, 'propTypes'>, StaticWebComponent<ComponentType, MS, DP> {
132
130
  (props: P & RefAttributes<A>): ReactElement;
133
131
  }
134
132
  export declare const baseModelPropertyTypes: ValidationMapping;
@@ -139,7 +137,7 @@ export declare const modelPropertyTypes: ValidationMapping;
139
137
  export declare const propertyTypes: ValidationMapping;
140
138
  export declare const defaultModelState: ModelState;
141
139
  export declare const defaultModel: Model<string>;
142
- export declare const defaultProperties: DefaultProperties<string>;
140
+ export declare const defaultProperties: DefaultProperties;
143
141
  export interface CheckboxProperties extends Properties<boolean> {
144
142
  checked: boolean;
145
143
  id: string;
@@ -155,7 +153,7 @@ export type DefaultCheckboxProperties = Omit<CheckboxProps, 'model'> & {
155
153
  };
156
154
  export type CheckboxState = State<boolean>;
157
155
  export type CheckboxAdapter = ComponentAdapter<CheckboxProperties, Omit<CheckboxState, 'value'>>;
158
- export type CheckboxComponent<Type> = InputComponent<Type, CheckboxProps, CheckboxModelState, DefaultCheckboxProperties, CheckboxAdapter>;
156
+ export type CheckboxComponent<ComponentType> = InputComponent<boolean, ComponentType, CheckboxProps, CheckboxModelState, DefaultCheckboxProperties, CheckboxAdapter>;
159
157
  export declare const checkboxPropertyTypes: PropertiesValidationMap;
160
158
  export declare const defaultCheckboxModel: CheckboxModel;
161
159
  export declare const defaultCheckboxProperties: DefaultCheckboxProperties;
@@ -326,7 +324,7 @@ export interface FileValue {
326
324
  source?: null | string;
327
325
  url?: null | string;
328
326
  }
329
- export interface FileInputValueState extends ValueState<FileValue, FileInputModelState> {
327
+ export interface FileInputValueState<Type = FileValue> extends ValueState<Type, FileInputModelState> {
330
328
  attachBlobProperty: boolean;
331
329
  }
332
330
  export interface FileInputModelState extends ModelState {
@@ -335,7 +333,7 @@ export interface FileInputModelState extends ModelState {
335
333
  invalidContentTypePattern: boolean;
336
334
  invalidName: boolean;
337
335
  }
338
- export interface FileInputModel extends Model<FileValue> {
336
+ export interface FileInputModel<Type = FileValue> extends Model<Type> {
339
337
  contentTypeRegularExpressionPattern: Array<RegExp | string> | null | RegExp | string;
340
338
  invertedContentTypeRegularExpressionPattern: (Array<RegExp | string> | null | RegExp | string);
341
339
  maximumSize: number;
@@ -343,14 +341,14 @@ export interface FileInputModel extends Model<FileValue> {
343
341
  fileName: InputModel<string>;
344
342
  state: FileInputModelState;
345
343
  }
346
- export interface FileInputChildrenOptions<P> {
344
+ export interface FileInputChildrenOptions<P, Type = FileValue> {
347
345
  declaration: string;
348
346
  invalid: boolean;
349
347
  properties: P;
350
- value?: FileValue | null;
348
+ value?: null | Type;
351
349
  }
352
- export interface FileInputProperties extends Properties<FileValue>, FileInputModelState {
353
- children: (options: FileInputChildrenOptions<this>) => null | ReactElement;
350
+ export interface FileInputProperties<Type = FileValue> extends Properties<Type>, FileInputModelState {
351
+ children: (options: FileInputChildrenOptions<this, Type>) => null | ReactNode;
354
352
  contentTypePattern: Array<RegExp | string> | null | RegExp | string;
355
353
  invertedContentTypePattern: Array<RegExp | string> | null | RegExp | string;
356
354
  contentTypePatternText: string;
@@ -363,32 +361,32 @@ export interface FileInputProperties extends Properties<FileValue>, FileInputMod
363
361
  newButton: ReactElement | string;
364
362
  encoding: string;
365
363
  generateFileNameInputProperties: (prototype: InputProps<string>, properties: this & {
366
- value: FileValue & {
364
+ value: Type & {
367
365
  name: string;
368
366
  };
369
367
  }) => InputProps<string>;
370
368
  media: CardMediaProps;
371
- model: FileInputModel;
369
+ model: FileInputModel<Type>;
372
370
  outlined: boolean;
373
371
  sourceToBlobOptions: {
374
372
  endings?: 'native' | 'transparent';
375
373
  type?: string;
376
374
  };
377
375
  }
378
- export type FileInputProps = Partial<Omit<FileInputProperties, 'model'>> & {
379
- model?: Partial<FileInputModel>;
376
+ export type FileInputProps<Type = FileValue> = Partial<Omit<FileInputProperties<Type>, 'model'>> & {
377
+ model?: Partial<FileInputModel<Type>>;
380
378
  };
381
- export type DefaultFileInputProperties = Omit<FileInputProps, 'model'> & {
382
- model: FileInputModel;
379
+ export type DefaultFileInputProperties<Type = FileValue> = Omit<FileInputProps<Type>, 'model'> & {
380
+ model: FileInputModel<Type>;
383
381
  };
384
382
  export type FileInputPropertyTypes = {
385
383
  [key in keyof FileInputProperties]: ValueOf<typeof PropertyTypes>;
386
384
  };
387
- export interface FileInputState extends State<FileValue> {
385
+ export interface FileInputState<Type = FileValue> extends State<Type> {
388
386
  modelState: FileInputModelState;
389
387
  }
390
- export type FileInputAdapter = ComponentAdapter<FileInputProperties, Omit<FileInputState, 'value'> & {
391
- value?: FileValue | null;
388
+ export type FileInputAdapter<Type = FileValue> = ComponentAdapter<FileInputProperties<Type>, Omit<FileInputState<Type>, 'value'> & {
389
+ value?: Type | null;
392
390
  }>;
393
391
  export interface FileInputAdapterWithReferences extends FileInputAdapter {
394
392
  references: {
@@ -399,7 +397,7 @@ export interface FileInputAdapterWithReferences extends FileInputAdapter {
399
397
  uploadButtonReference: MutableRefObject<HTMLButtonElement | null>;
400
398
  };
401
399
  }
402
- export type FileInputComponent<Type> = InputComponent<Type, FileInputProps, FileInputModelState, DefaultFileInputProperties, FileInputAdapter>;
400
+ export type FileInputComponent<ValueType, ComponentType> = InputComponent<ValueType, ComponentType, FileInputProps<ValueType>, FileInputModelState, DefaultFileInputProperties<ValueType>, FileInputAdapter<ValueType>>;
403
401
  export declare const fileInputModelStatePropertyTypes: {
404
402
  [key in keyof FileInputModelState]: Requireable<boolean | symbol>;
405
403
  };
@@ -524,7 +522,7 @@ export interface IntervalAdapterWithReferences extends IntervalAdapter {
524
522
  start: MutableRefObject<InputAdapterWithReferences<number> | null>;
525
523
  };
526
524
  }
527
- export type IntervalComponent<Type> = InputComponent<Type, IntervalProps, IntervalModelState, DefaultIntervalProperties, IntervalAdapter>;
525
+ export type IntervalComponent<ComponentType> = InputComponent<IntervalConfiguration | IntervalValue | null, ComponentType, IntervalProps, IntervalModelState, DefaultIntervalProperties, IntervalAdapter>;
528
526
  export declare const intervalPropertyTypes: PropertiesValidationMap;
529
527
  export declare const defaultIntervalProperties: DefaultIntervalProperties;
530
528
  export interface ConfigurationProperties {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-input-material",
3
- "version": "0.0.535",
3
+ "version": "0.0.537",
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",
@@ -1,6 +1,14 @@
1
1
  // -*- coding: utf-8 -*-
2
2
  /** @module declarations */
3
3
  /// <reference path="../node_modules/weboptimizer/declarations" />
4
+ /*
5
+ NOTE: Already defined in weboptimizer's generic declaration. but currently
6
+ only needed for intellij only.
7
+ */
8
+ declare module '*.module' {
9
+ const classes:Mapping
10
+ export default classes
11
+ }
4
12
  // region vim modline
5
13
  // vim: set tabstop=4 shiftwidth=4 expandtab:
6
14
  // vim: foldmethod=marker foldmarker=region,endregion: