react-input-material 0.0.762 → 0.0.764

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 DELETED
@@ -1,143 +0,0 @@
1
- import { Mapping, Primitive } from 'clientnode';
2
- import { Requireable } from 'clientnode/property-types';
3
- import { ComponentClass, FocusEvent, ForwardRefExoticComponent, FunctionComponent, MouseEvent, ReactElement, RefAttributes } from 'react';
4
- import { GenericEvent } from 'react-generic-tools/type';
5
- import { ComponentAdapter, StaticWebComponent as StaticBaseWebComponent, ValidationMapping } from 'web-component-wrapper/type';
6
- import { ThemeProviderProps } from '@rmwc/theme';
7
- export interface CursorState {
8
- end: number;
9
- start: number;
10
- }
11
- export declare const PrimitiveTypes: readonly ["boolean", "DateTime", "integer", "number", "string"];
12
- export type PrimitiveType = typeof PrimitiveTypes[number];
13
- export type Type = boolean | number | string;
14
- export type TypeSpecification = Array<TypeSpecification> | Type;
15
- export interface SelectionOption {
16
- label: string;
17
- value: Primitive;
18
- }
19
- export type NormalizedSelection = Array<SelectionOption>;
20
- export type ModelSelection = Array<Primitive> | Mapping | NormalizedSelection;
21
- export type Selection = Array<[Primitive, string]> | ModelSelection;
22
- export interface CommonBaseModel<Type = unknown> {
23
- declaration: string;
24
- description: string;
25
- name: string;
26
- emptyEqualsNull: boolean;
27
- maximum: number | string;
28
- minimum: number | string;
29
- maximumLength: number;
30
- minimumLength: number;
31
- type: TypeSpecification;
32
- trim: boolean;
33
- value?: Type;
34
- }
35
- export interface ModelState {
36
- dirty: boolean;
37
- pristine: boolean;
38
- touched: boolean;
39
- untouched: boolean;
40
- focused: boolean;
41
- visited: boolean;
42
- invalid: boolean;
43
- valid: boolean;
44
- invalidRequired: boolean;
45
- }
46
- export type Pattern = Array<RegExp | string> | RegExp | string;
47
- export interface BaseModel<T = unknown> extends CommonBaseModel<T> {
48
- pattern?: Pattern;
49
- invertedPattern?: Pattern;
50
- selection?: ModelSelection;
51
- mutable: boolean;
52
- writable: boolean;
53
- nullable: boolean;
54
- state?: ModelState;
55
- }
56
- export interface BaseProperties<T = unknown> extends CommonBaseModel<T>, ModelState {
57
- className: Array<string> | string;
58
- styles: Mapping;
59
- themeConfiguration: ThemeProviderProps['options'];
60
- disabled: boolean;
61
- enforceUncontrolled: boolean;
62
- id?: string;
63
- label: string;
64
- name: string;
65
- initialValue: T;
66
- model: BaseModel<T>;
67
- required: boolean;
68
- requiredText: string;
69
- componentProperties: Mapping<unknown>;
70
- domNodeProperties: Mapping<unknown>;
71
- selection?: Selection;
72
- showDeclaration: boolean;
73
- showInitialValidationState: boolean;
74
- showValidationState: boolean;
75
- tooltip: string;
76
- triggerInitialPropertiesConsolidation: boolean;
77
- }
78
- export type BaseProps<T = unknown> = Partial<Omit<BaseProperties<T>, 'model'>> & {
79
- model?: (Partial<Omit<BaseModel<T>, 'state'>> & {
80
- state?: Partial<ModelState>;
81
- });
82
- };
83
- export type DefaultBaseProperties<T = unknown> = Omit<BaseProps<T>, 'model'> & {
84
- model: BaseModel<T>;
85
- };
86
- export interface TypedProperties<T = unknown> extends BaseProperties<T> {
87
- initialValue: T;
88
- model: BaseModel<T>;
89
- onBlur: (event: GenericEvent | undefined, properties: this) => void;
90
- onChange: (properties: this, event?: GenericEvent) => void;
91
- onChangeShowDeclaration: (show: boolean, event: GenericEvent | undefined, properties: this) => void;
92
- onChangeState: (state: ModelState, event: GenericEvent | undefined, properties: this) => void;
93
- onChangeValue: (value: T, event: GenericEvent | undefined, properties: this) => void;
94
- onClick: (event: MouseEvent, properties: this) => void;
95
- onFocus: (event: FocusEvent, properties: this) => void;
96
- onTouch: (event: GenericEvent, properties: this) => void;
97
- }
98
- export type Properties<T = unknown> = TypedProperties<T> & CommonBaseModel<T>;
99
- export type Props<T = unknown> = Partial<Omit<Properties<T>, 'model'>> & {
100
- model?: (Partial<Omit<BaseModel<T>, 'state'>> & {
101
- state?: Partial<ModelState>;
102
- });
103
- };
104
- export type DefaultProperties<T = unknown> = Omit<Props<T>, 'model'> & {
105
- model: BaseModel<T>;
106
- };
107
- export interface State<T = unknown> {
108
- modelState?: ModelState;
109
- value?: null | T;
110
- }
111
- export interface ValueState<T = unknown, MS = ModelState> {
112
- modelState: MS;
113
- value: null | T;
114
- }
115
- export interface EditorState {
116
- editorIsActive: boolean;
117
- selectionIsUnstable: boolean;
118
- }
119
- export interface StaticWebComponent<Type, MS = ModelState, DP = DefaultProperties<Type>> extends StaticBaseWebComponent<Type> {
120
- defaultModelState: MS;
121
- defaultProperties: DP;
122
- strict: boolean;
123
- }
124
- export type StaticComponent<Type, P = Props, MS = ModelState, DP = DefaultProperties<Type>> = Omit<ComponentClass<P>, 'propTypes'> & StaticWebComponent<Type, MS, DP>;
125
- export type StaticFunctionComponent<Type, P = Props, MS = ModelState, DP = DefaultProperties<Type>> = Omit<FunctionComponent<P>, 'propTypes'> & StaticComponent<Type, P, MS, DP>;
126
- export interface Component<ValueType, ComponentType, P = Props<ValueType>, MS = ModelState, DP = DefaultProperties<ValueType>, A = ComponentAdapter<P>> extends Omit<ForwardRefExoticComponent<P>, 'propTypes'>, StaticWebComponent<ComponentType, MS, DP> {
127
- (props: P & RefAttributes<A>): ReactElement;
128
- }
129
- export declare const baseModelPropertyTypes: ValidationMapping;
130
- export declare const modelStatePropertyTypes: {
131
- [key in keyof ModelState]: Requireable<boolean | symbol>;
132
- };
133
- export declare const modelPropertyTypes: ValidationMapping;
134
- export declare const propertyTypes: ValidationMapping;
135
- export declare const defaultModelState: ModelState;
136
- export declare const defaultModel: BaseModel<string>;
137
- export declare const defaultProperties: DefaultProperties;
138
- export interface ConfigurationProperties {
139
- strict?: boolean;
140
- themeConfiguration?: ThemeProviderProps['options'];
141
- tooltip?: Properties['tooltip'];
142
- wrap?: boolean;
143
- }