@instructure/ui-text-input 8.8.1-snapshot.8 → 8.9.1
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 +10 -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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [8.9.1](https://github.com/instructure/instructure-ui/compare/v8.9.0...v8.9.1) (2021-09-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-text-input
|
|
9
|
+
|
|
10
|
+
# [8.9.0](https://github.com/instructure/instructure-ui/compare/v8.8.0...v8.9.0) (2021-09-15)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- fix shared-types TS errors ([7b83164](https://github.com/instructure/instructure-ui/commit/7b83164f4c5872f3a217e010563f59bf584ae4fc))
|
|
15
|
+
|
|
6
16
|
# [8.8.0](https://github.com/instructure/instructure-ui/compare/v8.7.0...v8.8.0) (2021-08-27)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @instructure/ui-text-input
|
package/es/TextInput/index.js
CHANGED
|
@@ -29,23 +29,22 @@ var _dec, _dec2, _class, _class2, _temp;
|
|
|
29
29
|
|
|
30
30
|
/** @jsx jsx */
|
|
31
31
|
import { Component } from 'react';
|
|
32
|
-
import PropTypes from 'prop-types';
|
|
33
|
-
import { controllable } from '@instructure/ui-prop-types';
|
|
34
32
|
import { callRenderProp, getInteraction, passthroughProps } from '@instructure/ui-react-utils';
|
|
35
33
|
import { isActiveElement } from '@instructure/ui-dom-utils';
|
|
36
|
-
import { FormField
|
|
34
|
+
import { FormField } from '@instructure/ui-form-field';
|
|
37
35
|
import { uid } from '@instructure/uid';
|
|
38
36
|
import { testable } from '@instructure/ui-testable';
|
|
39
37
|
import { withStyle, jsx } from '@instructure/emotion';
|
|
40
38
|
import generateStyle from './styles';
|
|
41
39
|
import generateComponentTheme from './theme';
|
|
42
|
-
|
|
40
|
+
import { allowedProps, propTypes } from './props';
|
|
43
41
|
/**
|
|
44
42
|
---
|
|
45
43
|
category: components
|
|
46
44
|
tags: form, field
|
|
47
45
|
---
|
|
48
46
|
**/
|
|
47
|
+
|
|
49
48
|
let TextInput = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_temp = _class2 = class TextInput extends Component {
|
|
50
49
|
constructor(props) {
|
|
51
50
|
super(props);
|
|
@@ -90,11 +89,15 @@ let TextInput = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
90
89
|
}
|
|
91
90
|
|
|
92
91
|
componentDidMount() {
|
|
93
|
-
|
|
92
|
+
var _this$props$makeStyle, _this$props;
|
|
93
|
+
|
|
94
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, this.makeStyleProps());
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
componentDidUpdate(prevProps, prevState, snapshot) {
|
|
97
|
-
|
|
98
|
+
var _this$props$makeStyle2, _this$props2;
|
|
99
|
+
|
|
100
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStyleProps());
|
|
98
101
|
}
|
|
99
102
|
|
|
100
103
|
focus() {
|
|
@@ -130,17 +133,19 @@ let TextInput = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
130
133
|
}
|
|
131
134
|
|
|
132
135
|
renderInput() {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
136
|
+
var _this$props$styles;
|
|
137
|
+
|
|
138
|
+
const _this$props3 = this.props,
|
|
139
|
+
type = _this$props3.type,
|
|
140
|
+
size = _this$props3.size,
|
|
141
|
+
htmlSize = _this$props3.htmlSize,
|
|
142
|
+
display = _this$props3.display,
|
|
143
|
+
textAlign = _this$props3.textAlign,
|
|
144
|
+
placeholder = _this$props3.placeholder,
|
|
145
|
+
value = _this$props3.value,
|
|
146
|
+
defaultValue = _this$props3.defaultValue,
|
|
147
|
+
isRequired = _this$props3.isRequired,
|
|
148
|
+
rest = _objectWithoutProperties(_this$props3, _excluded);
|
|
144
149
|
|
|
145
150
|
const props = passthroughProps(rest);
|
|
146
151
|
const interaction = this.interaction;
|
|
@@ -155,7 +160,7 @@ let TextInput = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
155
160
|
}
|
|
156
161
|
|
|
157
162
|
return jsx("input", Object.assign({}, props, {
|
|
158
|
-
css: this.props.styles.textInput,
|
|
163
|
+
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.textInput,
|
|
159
164
|
defaultValue: defaultValue,
|
|
160
165
|
value: value,
|
|
161
166
|
placeholder: placeholder,
|
|
@@ -175,15 +180,15 @@ let TextInput = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
175
180
|
}
|
|
176
181
|
|
|
177
182
|
render() {
|
|
178
|
-
const _this$
|
|
179
|
-
width = _this$
|
|
180
|
-
display = _this$
|
|
181
|
-
renderLabel = _this$
|
|
182
|
-
renderBeforeInput = _this$
|
|
183
|
-
renderAfterInput = _this$
|
|
184
|
-
messages = _this$
|
|
185
|
-
inputContainerRef = _this$
|
|
186
|
-
styles = _this$
|
|
183
|
+
const _this$props4 = this.props,
|
|
184
|
+
width = _this$props4.width,
|
|
185
|
+
display = _this$props4.display,
|
|
186
|
+
renderLabel = _this$props4.renderLabel,
|
|
187
|
+
renderBeforeInput = _this$props4.renderBeforeInput,
|
|
188
|
+
renderAfterInput = _this$props4.renderAfterInput,
|
|
189
|
+
messages = _this$props4.messages,
|
|
190
|
+
inputContainerRef = _this$props4.inputContainerRef,
|
|
191
|
+
styles = _this$props4.styles;
|
|
187
192
|
const hasBeforeElement = renderBeforeInput && callRenderProp(renderBeforeInput);
|
|
188
193
|
const hasAfterElement = renderAfterInput && callRenderProp(renderAfterInput);
|
|
189
194
|
const renderBeforeOrAfter = hasBeforeElement || hasAfterElement;
|
|
@@ -198,174 +203,39 @@ let TextInput = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
198
203
|
layout: this.props.layout // eslint-disable-line react/prop-types
|
|
199
204
|
|
|
200
205
|
}, jsx("span", {
|
|
201
|
-
css: styles.facade
|
|
206
|
+
css: styles === null || styles === void 0 ? void 0 : styles.facade
|
|
202
207
|
}, renderBeforeOrAfter ? jsx("div", null, jsx("span", {
|
|
203
|
-
css: styles.layout
|
|
208
|
+
css: styles === null || styles === void 0 ? void 0 : styles.layout
|
|
204
209
|
}, hasBeforeElement && jsx("span", {
|
|
205
|
-
css: styles.beforeElement
|
|
210
|
+
css: styles === null || styles === void 0 ? void 0 : styles.beforeElement
|
|
206
211
|
}, callRenderProp(renderBeforeInput)), jsx("span", {
|
|
207
|
-
css: styles.innerWrapper
|
|
212
|
+
css: styles === null || styles === void 0 ? void 0 : styles.innerWrapper
|
|
208
213
|
}, jsx("span", {
|
|
209
|
-
css: styles.inputLayout
|
|
214
|
+
css: styles === null || styles === void 0 ? void 0 : styles.inputLayout
|
|
210
215
|
}, jsx("span", {
|
|
211
|
-
css: styles.innerWrapper
|
|
216
|
+
css: styles === null || styles === void 0 ? void 0 : styles.innerWrapper
|
|
212
217
|
}, this.renderInput()), hasAfterElement && jsx("span", {
|
|
213
|
-
css: styles.afterElement
|
|
218
|
+
css: styles === null || styles === void 0 ? void 0 : styles.afterElement
|
|
214
219
|
}, callRenderProp(renderAfterInput)))))) :
|
|
215
220
|
/* If no prepended or appended content, don't render Flex layout */
|
|
216
221
|
this.renderInput()));
|
|
217
222
|
}
|
|
218
223
|
|
|
219
|
-
}, _class2.displayName = "TextInput", _class2.componentId = 'TextInput', _class2.propTypes = {
|
|
220
|
-
/**
|
|
221
|
-
* The form field label.
|
|
222
|
-
*/
|
|
223
|
-
renderLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Determines the underlying native HTML `<input>` element's `type`.
|
|
227
|
-
* For more see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/url
|
|
228
|
-
*/
|
|
229
|
-
type: PropTypes.oneOf(['text', 'email', 'url', 'tel', 'search', 'password']),
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* The id of the text input. One is generated if not supplied.
|
|
233
|
-
*/
|
|
234
|
-
id: PropTypes.string,
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* the selected value (must be accompanied by an `onChange` prop)
|
|
238
|
-
*/
|
|
239
|
-
value: controllable(PropTypes.string),
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* value to set on initial render
|
|
243
|
-
*/
|
|
244
|
-
defaultValue: PropTypes.string,
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* Specifies if interaction with the input is enabled, disabled, or readonly.
|
|
248
|
-
* When "disabled", the input changes visibly to indicate that it cannot
|
|
249
|
-
* receive user interactions. When "readonly" the input still cannot receive
|
|
250
|
-
* user interactions but it keeps the same styles as if it were enabled.
|
|
251
|
-
*/
|
|
252
|
-
interaction: PropTypes.oneOf(['enabled', 'disabled', 'readonly']),
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* object with shape: `{
|
|
256
|
-
* text: PropTypes.string,
|
|
257
|
-
* type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
|
|
258
|
-
* }`
|
|
259
|
-
*/
|
|
260
|
-
messages: PropTypes.arrayOf(FormPropTypes.message),
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* The size of the text input.
|
|
264
|
-
*/
|
|
265
|
-
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* The text alignment of the input.
|
|
269
|
-
*/
|
|
270
|
-
textAlign: PropTypes.oneOf(['start', 'center']),
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* The width of the input.
|
|
274
|
-
*/
|
|
275
|
-
width: PropTypes.string,
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* The width of the input, in characters, if a width is not explicitly
|
|
279
|
-
* provided via the `width` prop. Only applicable if `isInline={true}`.
|
|
280
|
-
*/
|
|
281
|
-
htmlSize: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* The display of the root element.
|
|
285
|
-
*/
|
|
286
|
-
display: PropTypes.oneOf(['inline-block', 'block']),
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* Prevents the default behavior of wrapping the input and rendered content
|
|
290
|
-
* when available space is exceeded.
|
|
291
|
-
*/
|
|
292
|
-
shouldNotWrap: PropTypes.bool,
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* Html placeholder text to display when the input has no value. This should be hint text, not a label
|
|
296
|
-
* replacement.
|
|
297
|
-
*/
|
|
298
|
-
placeholder: PropTypes.string,
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* Whether or not the text input is required.
|
|
302
|
-
*/
|
|
303
|
-
isRequired: PropTypes.bool,
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* a function that provides a reference to the actual input element
|
|
307
|
-
*/
|
|
308
|
-
inputRef: PropTypes.func,
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
* a function that provides a reference a parent of the input element
|
|
312
|
-
*/
|
|
313
|
-
inputContainerRef: PropTypes.func,
|
|
314
|
-
|
|
315
|
-
/**
|
|
316
|
-
* Content to display before the input text, such as an icon
|
|
317
|
-
*/
|
|
318
|
-
renderBeforeInput: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* Content to display after the input text, such as an icon
|
|
322
|
-
*/
|
|
323
|
-
renderAfterInput: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* Callback executed when the input fires a change event.
|
|
327
|
-
* @param {Object} event - the event object
|
|
328
|
-
* @param {Object} value - the string value of the input
|
|
329
|
-
*/
|
|
330
|
-
onChange: PropTypes.func,
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* Callback fired when input loses focus.
|
|
334
|
-
*/
|
|
335
|
-
onBlur: PropTypes.func,
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Callback fired when input receives focus.
|
|
339
|
-
*/
|
|
340
|
-
onFocus: PropTypes.func,
|
|
341
|
-
// eslint-disable-next-line react/require-default-props
|
|
342
|
-
makeStyles: PropTypes.func,
|
|
343
|
-
// eslint-disable-next-line react/require-default-props
|
|
344
|
-
styles: PropTypes.object
|
|
345
|
-
}, _class2.defaultProps = {
|
|
346
|
-
renderLabel: void 0,
|
|
224
|
+
}, _class2.displayName = "TextInput", _class2.componentId = 'TextInput', _class2.allowedProps = allowedProps, _class2.propTypes = propTypes, _class2.defaultProps = {
|
|
347
225
|
type: 'text',
|
|
348
|
-
id: void 0,
|
|
349
226
|
// Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
|
|
350
227
|
interaction: void 0,
|
|
351
228
|
isRequired: false,
|
|
352
|
-
value: void 0,
|
|
353
|
-
defaultValue: void 0,
|
|
354
229
|
display: 'block',
|
|
355
230
|
shouldNotWrap: false,
|
|
356
|
-
placeholder: void 0,
|
|
357
|
-
width: void 0,
|
|
358
231
|
size: 'medium',
|
|
359
|
-
htmlSize: void 0,
|
|
360
232
|
textAlign: 'start',
|
|
361
233
|
messages: [],
|
|
362
234
|
inputRef: function (input) {},
|
|
363
235
|
inputContainerRef: function (container) {},
|
|
364
236
|
onChange: function (event, value) {},
|
|
365
237
|
onBlur: function (event) {},
|
|
366
|
-
onFocus: function (event) {}
|
|
367
|
-
renderBeforeInput: void 0,
|
|
368
|
-
renderAfterInput: void 0
|
|
238
|
+
onFocus: function (event) {}
|
|
369
239
|
}, _temp)) || _class) || _class);
|
|
370
240
|
export default TextInput;
|
|
371
241
|
export { TextInput };
|
|
@@ -0,0 +1,151 @@
|
|
|
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
|
+
import PropTypes from 'prop-types';
|
|
25
|
+
import { FormPropTypes } from '@instructure/ui-form-field';
|
|
26
|
+
import { controllable } from '@instructure/ui-prop-types';
|
|
27
|
+
const propTypes = {
|
|
28
|
+
/**
|
|
29
|
+
* The form field label.
|
|
30
|
+
*/
|
|
31
|
+
renderLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Determines the underlying native HTML `<input>` element's `type`.
|
|
35
|
+
* For more see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/url
|
|
36
|
+
*/
|
|
37
|
+
type: PropTypes.oneOf(['text', 'email', 'url', 'tel', 'search', 'password']),
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The id of the text input. One is generated if not supplied.
|
|
41
|
+
*/
|
|
42
|
+
id: PropTypes.string,
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* the selected value (must be accompanied by an `onChange` prop)
|
|
46
|
+
*/
|
|
47
|
+
value: controllable(PropTypes.string),
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* value to set on initial render
|
|
51
|
+
*/
|
|
52
|
+
defaultValue: PropTypes.string,
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Specifies if interaction with the input is enabled, disabled, or readonly.
|
|
56
|
+
* When "disabled", the input changes visibly to indicate that it cannot
|
|
57
|
+
* receive user interactions. When "readonly" the input still cannot receive
|
|
58
|
+
* user interactions but it keeps the same styles as if it were enabled.
|
|
59
|
+
*/
|
|
60
|
+
interaction: PropTypes.oneOf(['enabled', 'disabled', 'readonly']),
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* object with shape: `{
|
|
64
|
+
* text: PropTypes.string,
|
|
65
|
+
* type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
|
|
66
|
+
* }`
|
|
67
|
+
*/
|
|
68
|
+
messages: PropTypes.arrayOf(FormPropTypes.message),
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The size of the text input.
|
|
72
|
+
*/
|
|
73
|
+
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The text alignment of the input.
|
|
77
|
+
*/
|
|
78
|
+
textAlign: PropTypes.oneOf(['start', 'center']),
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The width of the input.
|
|
82
|
+
*/
|
|
83
|
+
width: PropTypes.string,
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The width of the input, in characters, if a width is not explicitly
|
|
87
|
+
* provided via the `width` prop. Only applicable if `isInline={true}`.
|
|
88
|
+
*/
|
|
89
|
+
htmlSize: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The display of the root element.
|
|
93
|
+
*/
|
|
94
|
+
display: PropTypes.oneOf(['inline-block', 'block']),
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Prevents the default behavior of wrapping the input and rendered content
|
|
98
|
+
* when available space is exceeded.
|
|
99
|
+
*/
|
|
100
|
+
shouldNotWrap: PropTypes.bool,
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Html placeholder text to display when the input has no value. This should be hint text, not a label
|
|
104
|
+
* replacement.
|
|
105
|
+
*/
|
|
106
|
+
placeholder: PropTypes.string,
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Whether or not the text input is required.
|
|
110
|
+
*/
|
|
111
|
+
isRequired: PropTypes.bool,
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* a function that provides a reference to the actual input element
|
|
115
|
+
*/
|
|
116
|
+
inputRef: PropTypes.func,
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* a function that provides a reference a parent of the input element
|
|
120
|
+
*/
|
|
121
|
+
inputContainerRef: PropTypes.func,
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Content to display before the input text, such as an icon
|
|
125
|
+
*/
|
|
126
|
+
renderBeforeInput: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Content to display after the input text, such as an icon
|
|
130
|
+
*/
|
|
131
|
+
renderAfterInput: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Callback executed when the input fires a change event.
|
|
135
|
+
* @param {Object} event - the event object
|
|
136
|
+
* @param {Object} value - the string value of the input
|
|
137
|
+
*/
|
|
138
|
+
onChange: PropTypes.func,
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Callback fired when input loses focus.
|
|
142
|
+
*/
|
|
143
|
+
onBlur: PropTypes.func,
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Callback fired when input receives focus.
|
|
147
|
+
*/
|
|
148
|
+
onFocus: PropTypes.func
|
|
149
|
+
};
|
|
150
|
+
const allowedProps = ['renderLabel', 'type', 'id', 'value', 'defaultValue', 'interaction', 'messages', 'size', 'textAlign', 'width', 'htmlSize', 'display', 'shouldNotWrap', 'placeholder', 'isRequired', 'inputRef', 'inputContainerRef', 'renderBeforeInput', 'renderAfterInput', 'onChange', 'onBlur', 'onFocus'];
|
|
151
|
+
export { propTypes, allowedProps };
|