@instructure/ui-text-input 8.8.1-snapshot.3 → 8.9.0
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/CHANGELOG.md +6 -0
- package/es/TextInput/index.js +41 -171
- package/es/TextInput/props.js +151 -0
- package/lib/TextInput/index.js +40 -173
- package/lib/TextInput/props.js +164 -0
- package/package.json +18 -19
- package/src/TextInput/index.tsx +20 -140
- package/src/TextInput/props.ts +206 -0
- package/src/TextInput/styles.ts +1 -1
- package/src/index.ts +1 -1
- package/types/TextInput/index.d.ts +49 -118
- package/types/TextInput/index.d.ts.map +1 -1
- package/types/TextInput/{types.d.ts → props.d.ts} +13 -6
- package/types/TextInput/props.d.ts.map +1 -0
- package/types/TextInput/styles.d.ts +1 -1
- package/types/index.d.ts +1 -1
- package/LICENSE.md +0 -27
- package/es/TextInput/types.js +0 -1
- package/lib/TextInput/types.js +0 -1
- package/src/TextInput/types.ts +0 -64
- package/types/TextInput/types.d.ts.map +0 -1
package/src/TextInput/styles.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Component, InputHTMLAttributes } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
3
|
import { jsx } from '@instructure/emotion';
|
|
5
4
|
import { OtherHTMLAttributes } from '@instructure/shared-types';
|
|
6
|
-
import { TextInputProps, TextInputState, TextInputStyleProps } from './
|
|
5
|
+
import type { TextInputProps, TextInputState, TextInputStyleProps } from './props';
|
|
7
6
|
/**
|
|
8
7
|
---
|
|
9
8
|
category: components
|
|
@@ -12,127 +11,61 @@ tags: form, field
|
|
|
12
11
|
**/
|
|
13
12
|
declare class TextInput extends Component<TextInputProps & OtherHTMLAttributes<TextInputProps, InputHTMLAttributes<TextInputProps>>, TextInputState> {
|
|
14
13
|
static readonly componentId = "TextInput";
|
|
15
|
-
static
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
* The width of the input.
|
|
64
|
-
*/
|
|
65
|
-
width: PropTypes.Requireable<string>;
|
|
66
|
-
/**
|
|
67
|
-
* The width of the input, in characters, if a width is not explicitly
|
|
68
|
-
* provided via the `width` prop. Only applicable if `isInline={true}`.
|
|
69
|
-
*/
|
|
70
|
-
htmlSize: PropTypes.Requireable<string | number>;
|
|
71
|
-
/**
|
|
72
|
-
* The display of the root element.
|
|
73
|
-
*/
|
|
74
|
-
display: PropTypes.Requireable<string>;
|
|
75
|
-
/**
|
|
76
|
-
* Prevents the default behavior of wrapping the input and rendered content
|
|
77
|
-
* when available space is exceeded.
|
|
78
|
-
*/
|
|
79
|
-
shouldNotWrap: PropTypes.Requireable<boolean>;
|
|
80
|
-
/**
|
|
81
|
-
* Html placeholder text to display when the input has no value. This should be hint text, not a label
|
|
82
|
-
* replacement.
|
|
83
|
-
*/
|
|
84
|
-
placeholder: PropTypes.Requireable<string>;
|
|
85
|
-
/**
|
|
86
|
-
* Whether or not the text input is required.
|
|
87
|
-
*/
|
|
88
|
-
isRequired: PropTypes.Requireable<boolean>;
|
|
89
|
-
/**
|
|
90
|
-
* a function that provides a reference to the actual input element
|
|
91
|
-
*/
|
|
92
|
-
inputRef: PropTypes.Requireable<(...args: any[]) => any>;
|
|
93
|
-
/**
|
|
94
|
-
* a function that provides a reference a parent of the input element
|
|
95
|
-
*/
|
|
96
|
-
inputContainerRef: PropTypes.Requireable<(...args: any[]) => any>;
|
|
97
|
-
/**
|
|
98
|
-
* Content to display before the input text, such as an icon
|
|
99
|
-
*/
|
|
100
|
-
renderBeforeInput: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
101
|
-
/**
|
|
102
|
-
* Content to display after the input text, such as an icon
|
|
103
|
-
*/
|
|
104
|
-
renderAfterInput: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
105
|
-
/**
|
|
106
|
-
* Callback executed when the input fires a change event.
|
|
107
|
-
* @param {Object} event - the event object
|
|
108
|
-
* @param {Object} value - the string value of the input
|
|
109
|
-
*/
|
|
110
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
111
|
-
/**
|
|
112
|
-
* Callback fired when input loses focus.
|
|
113
|
-
*/
|
|
114
|
-
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
115
|
-
/**
|
|
116
|
-
* Callback fired when input receives focus.
|
|
117
|
-
*/
|
|
118
|
-
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
119
|
-
makeStyles: PropTypes.Requireable<(...args: any[]) => any>;
|
|
120
|
-
styles: PropTypes.Requireable<object>;
|
|
121
|
-
};
|
|
14
|
+
static allowedProps: readonly (keyof {
|
|
15
|
+
renderLabel?: import("react").ReactNode | ((...args: any[]) => any);
|
|
16
|
+
type?: "text" | "email" | "url" | "tel" | "search" | "password" | undefined;
|
|
17
|
+
id?: string | undefined;
|
|
18
|
+
value?: any;
|
|
19
|
+
defaultValue?: string | undefined;
|
|
20
|
+
interaction?: import("@instructure/ui-react-utils").InteractionType | undefined;
|
|
21
|
+
messages?: import("@instructure/ui-form-field").FormMessage[] | undefined;
|
|
22
|
+
size?: "small" | "medium" | "large" | undefined;
|
|
23
|
+
textAlign?: "start" | "center" | undefined;
|
|
24
|
+
width?: string | undefined;
|
|
25
|
+
htmlSize?: string | number | undefined;
|
|
26
|
+
display?: "inline-block" | "block" | undefined;
|
|
27
|
+
shouldNotWrap?: boolean | undefined;
|
|
28
|
+
placeholder?: string | undefined;
|
|
29
|
+
isRequired?: boolean | undefined;
|
|
30
|
+
inputRef?: ((...args: any[]) => any) | undefined;
|
|
31
|
+
inputContainerRef?: ((...args: any[]) => any) | undefined;
|
|
32
|
+
renderBeforeInput?: import("react").ReactNode | ((...args: any[]) => any);
|
|
33
|
+
renderAfterInput?: import("react").ReactNode | ((...args: any[]) => any);
|
|
34
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
35
|
+
onBlur?: ((...args: any[]) => any) | undefined;
|
|
36
|
+
onFocus?: ((...args: any[]) => any) | undefined;
|
|
37
|
+
})[];
|
|
38
|
+
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
|
39
|
+
renderLabel?: import("react").ReactNode | ((...args: any[]) => any);
|
|
40
|
+
type?: "text" | "email" | "url" | "tel" | "search" | "password" | undefined;
|
|
41
|
+
id?: string | undefined;
|
|
42
|
+
value?: any;
|
|
43
|
+
defaultValue?: string | undefined;
|
|
44
|
+
interaction?: import("@instructure/ui-react-utils").InteractionType | undefined;
|
|
45
|
+
messages?: import("@instructure/ui-form-field").FormMessage[] | undefined;
|
|
46
|
+
size?: "small" | "medium" | "large" | undefined;
|
|
47
|
+
textAlign?: "start" | "center" | undefined;
|
|
48
|
+
width?: string | undefined;
|
|
49
|
+
htmlSize?: string | number | undefined;
|
|
50
|
+
display?: "inline-block" | "block" | undefined;
|
|
51
|
+
shouldNotWrap?: boolean | undefined;
|
|
52
|
+
placeholder?: string | undefined;
|
|
53
|
+
isRequired?: boolean | undefined;
|
|
54
|
+
inputRef?: ((...args: any[]) => any) | undefined;
|
|
55
|
+
inputContainerRef?: ((...args: any[]) => any) | undefined;
|
|
56
|
+
renderBeforeInput?: import("react").ReactNode | ((...args: any[]) => any);
|
|
57
|
+
renderAfterInput?: import("react").ReactNode | ((...args: any[]) => any);
|
|
58
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
59
|
+
onBlur?: ((...args: any[]) => any) | undefined;
|
|
60
|
+
onFocus?: ((...args: any[]) => any) | undefined;
|
|
61
|
+
}>;
|
|
122
62
|
static defaultProps: {
|
|
123
|
-
renderLabel: undefined;
|
|
124
63
|
type: string;
|
|
125
|
-
id: undefined;
|
|
126
64
|
interaction: undefined;
|
|
127
65
|
isRequired: boolean;
|
|
128
|
-
value: undefined;
|
|
129
|
-
defaultValue: undefined;
|
|
130
66
|
display: string;
|
|
131
67
|
shouldNotWrap: boolean;
|
|
132
|
-
placeholder: undefined;
|
|
133
|
-
width: undefined;
|
|
134
68
|
size: string;
|
|
135
|
-
htmlSize: undefined;
|
|
136
69
|
textAlign: string;
|
|
137
70
|
messages: never[];
|
|
138
71
|
inputRef: (input: any) => void;
|
|
@@ -140,8 +73,6 @@ declare class TextInput extends Component<TextInputProps & OtherHTMLAttributes<T
|
|
|
140
73
|
onChange: (event: any, value: any) => void;
|
|
141
74
|
onBlur: (event: any) => void;
|
|
142
75
|
onFocus: (event: any) => void;
|
|
143
|
-
renderBeforeInput: undefined;
|
|
144
|
-
renderAfterInput: undefined;
|
|
145
76
|
};
|
|
146
77
|
constructor(props: any);
|
|
147
78
|
componentDidMount(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TextInput/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TextInput/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAWtD,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAI/D,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,mBAAmB,EACpB,MAAM,SAAS,CAAA;AAGhB;;;;;GAKG;AACH,cAEM,SAAU,SAAQ,SAAS,CAC/B,cAAc,GACZ,mBAAmB,CAAC,cAAc,EAAE,mBAAmB,CAAC,cAAc,CAAC,CAAC,EAC1E,cAAc,CACf;IACC,MAAM,CAAC,QAAQ,CAAC,WAAW,eAAc;IAEzC,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;MAoBlB;gBAGW,KAAK,KAAA;IASjB,iBAAiB;IAKjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAIjD,cAAc,QAAO,mBAAmB,CAOvC;IAED,KAAK;IAKL,IAAI,WAAW,0DAEd;IAED,IAAI,WAAW,wBAEd;IAED,IAAI,OAAO,YAOV;IAED,IAAI,OAAO,YAGV;IAED,IAAI,KAAK,QAGR;IAED,IAAI,EAAE,QAGL;IAGD,cAAc,sBAKb;IAGD,YAAY,uBAGX;IAGD,UAAU,uBAMT;IAGD,WAAW,uBAMV;IAED,WAAW;IA0DX,MAAM;CAgEP;AAED,eAAe,SAAS,CAAA;AACxB,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { InteractionType } from '@instructure/ui-react-utils';
|
|
3
3
|
import type { FormMessage } from '@instructure/ui-form-field';
|
|
4
|
-
|
|
4
|
+
import type { PropValidators } from '@instructure/shared-types';
|
|
5
|
+
import type { WithStyleProps } from '@instructure/emotion';
|
|
6
|
+
declare type TextInputOwnProps = {
|
|
5
7
|
renderLabel?: React.ReactNode | ((...args: any[]) => any);
|
|
6
8
|
type?: 'text' | 'email' | 'url' | 'tel' | 'search' | 'password';
|
|
7
9
|
id?: string;
|
|
@@ -24,15 +26,20 @@ export declare type TextInputProps = {
|
|
|
24
26
|
onChange?: (...args: any[]) => any;
|
|
25
27
|
onBlur?: (...args: any[]) => any;
|
|
26
28
|
onFocus?: (...args: any[]) => any;
|
|
27
|
-
makeStyles?: (...args: any[]) => any;
|
|
28
|
-
styles?: any;
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
declare type PropKeys = keyof TextInputOwnProps;
|
|
31
|
+
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
32
|
+
declare type TextInputProps = TextInputOwnProps & WithStyleProps;
|
|
33
|
+
declare const propTypes: PropValidators<PropKeys>;
|
|
34
|
+
declare const allowedProps: AllowedPropKeys;
|
|
35
|
+
declare type TextInputState = {
|
|
31
36
|
hasFocus: boolean;
|
|
32
37
|
};
|
|
33
|
-
|
|
38
|
+
declare type TextInputStyleProps = {
|
|
34
39
|
disabled: boolean;
|
|
35
40
|
invalid: boolean;
|
|
36
41
|
focused: TextInputState['hasFocus'];
|
|
37
42
|
};
|
|
38
|
-
|
|
43
|
+
export type { TextInputProps, TextInputState, TextInputStyleProps };
|
|
44
|
+
export { propTypes, allowedProps };
|
|
45
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/TextInput/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,KAAK,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AAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IAC9D,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IAClC,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IAChC,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;CAClC,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,iBAAiB,CAAA;AAEvC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,cAAc,GAAG,iBAAiB,GAAG,cAAc,CAAA;AAExD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAqGvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAuBnB,CAAA;AAED,aAAK,cAAc,GAAG;IACpB,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,aAAK,mBAAmB,GAAG;IACzB,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,cAAc,CAAC,UAAU,CAAC,CAAA;CACpC,CAAA;AAED,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
package/types/index.d.ts
CHANGED
package/LICENSE.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: The MIT License (MIT)
|
|
3
|
-
category: Getting Started
|
|
4
|
-
order: 9
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# The MIT License (MIT)
|
|
8
|
-
|
|
9
|
-
Copyright (c) 2015 Instructure, Inc.
|
|
10
|
-
|
|
11
|
-
**Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
-
in the Software without restriction, including without limitation the rights
|
|
14
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
-
furnished to do so, subject to the following conditions.**
|
|
17
|
-
|
|
18
|
-
The above copyright notice and this permission notice shall be included in all
|
|
19
|
-
copies or substantial portions of the Software.
|
|
20
|
-
|
|
21
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
-
SOFTWARE.
|
package/es/TextInput/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/TextInput/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/src/TextInput/types.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* The MIT License (MIT)
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
-
*
|
|
6
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
* in the Software without restriction, including without limitation the rights
|
|
9
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
-
* copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
import React from 'react'
|
|
26
|
-
import type { InteractionType } from '@instructure/ui-react-utils'
|
|
27
|
-
import type { FormMessage } from '@instructure/ui-form-field'
|
|
28
|
-
|
|
29
|
-
export type TextInputProps = {
|
|
30
|
-
renderLabel?: React.ReactNode | ((...args: any[]) => any)
|
|
31
|
-
type?: 'text' | 'email' | 'url' | 'tel' | 'search' | 'password'
|
|
32
|
-
id?: string
|
|
33
|
-
value?: any // TODO: controllable(PropTypes.string)
|
|
34
|
-
defaultValue?: string
|
|
35
|
-
interaction?: InteractionType
|
|
36
|
-
messages?: FormMessage[]
|
|
37
|
-
size?: 'small' | 'medium' | 'large'
|
|
38
|
-
textAlign?: 'start' | 'center'
|
|
39
|
-
width?: string
|
|
40
|
-
htmlSize?: string | number
|
|
41
|
-
display?: 'inline-block' | 'block'
|
|
42
|
-
shouldNotWrap?: boolean
|
|
43
|
-
placeholder?: string
|
|
44
|
-
isRequired?: boolean
|
|
45
|
-
inputRef?: (...args: any[]) => any
|
|
46
|
-
inputContainerRef?: (...args: any[]) => any
|
|
47
|
-
renderBeforeInput?: React.ReactNode | ((...args: any[]) => any)
|
|
48
|
-
renderAfterInput?: React.ReactNode | ((...args: any[]) => any)
|
|
49
|
-
onChange?: (...args: any[]) => any
|
|
50
|
-
onBlur?: (...args: any[]) => any
|
|
51
|
-
onFocus?: (...args: any[]) => any
|
|
52
|
-
makeStyles?: (...args: any[]) => any
|
|
53
|
-
styles?: any
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export type TextInputState = {
|
|
57
|
-
hasFocus: boolean
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export type TextInputStyleProps = {
|
|
61
|
-
disabled: boolean
|
|
62
|
-
invalid: boolean
|
|
63
|
-
focused: TextInputState['hasFocus']
|
|
64
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/TextInput/types.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAE7D,oBAAY,cAAc,GAAG;IAC3B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IACzD,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,UAAU,CAAA;IAC/D,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,eAAe,CAAA;IAC7B,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAA;IACxB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO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