@instructure/ui-text-input 8.17.0 → 8.17.1-snapshot.17
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/LICENSE.md +27 -0
- package/es/TextInput/index.js +6 -7
- package/lib/TextInput/index.js +7 -7
- package/package.json +17 -18
- package/src/TextInput/index.tsx +5 -4
- package/src/TextInput/props.ts +2 -1
- package/tsconfig.build.json +0 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/TextInput/index.d.ts.map +1 -1
- package/types/TextInput/props.d.ts +2 -1
- package/types/TextInput/props.d.ts.map +1 -1
package/LICENSE.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
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/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
const _excluded = ["type", "size", "htmlSize", "display", "textAlign", "placeholder", "value", "defaultValue", "isRequired"];
|
|
3
3
|
|
|
4
|
-
var _dec, _dec2, _class, _class2, _temp;
|
|
4
|
+
var _dec, _dec2, _dec3, _class, _class2, _temp;
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* The MIT License (MIT)
|
|
@@ -29,10 +29,9 @@ var _dec, _dec2, _class, _class2, _temp;
|
|
|
29
29
|
|
|
30
30
|
/** @jsx jsx */
|
|
31
31
|
import React, { Component } from 'react';
|
|
32
|
-
import { callRenderProp, getInteraction, passthroughProps } from '@instructure/ui-react-utils';
|
|
32
|
+
import { callRenderProp, getInteraction, passthroughProps, withDeterministicId } from '@instructure/ui-react-utils';
|
|
33
33
|
import { isActiveElement } from '@instructure/ui-dom-utils';
|
|
34
34
|
import { FormField } from '@instructure/ui-form-field';
|
|
35
|
-
import { uid } from '@instructure/uid';
|
|
36
35
|
import { testable } from '@instructure/ui-testable';
|
|
37
36
|
import { withStyle, jsx } from '@instructure/emotion';
|
|
38
37
|
import generateStyle from './styles';
|
|
@@ -46,7 +45,7 @@ tags: form, field
|
|
|
46
45
|
@tsProps
|
|
47
46
|
**/
|
|
48
47
|
|
|
49
|
-
let TextInput = (_dec = withStyle(generateStyle, generateComponentTheme),
|
|
48
|
+
let TextInput = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = (_temp = _class2 = class TextInput extends Component {
|
|
50
49
|
constructor(props) {
|
|
51
50
|
super(props);
|
|
52
51
|
this.ref = null;
|
|
@@ -109,8 +108,8 @@ let TextInput = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
109
108
|
this.state = {
|
|
110
109
|
hasFocus: false
|
|
111
110
|
};
|
|
112
|
-
this._defaultId =
|
|
113
|
-
this._messagesId =
|
|
111
|
+
this._defaultId = props.deterministicId();
|
|
112
|
+
this._messagesId = props.deterministicId('TextInput-messages');
|
|
114
113
|
}
|
|
115
114
|
|
|
116
115
|
componentDidMount() {
|
|
@@ -260,6 +259,6 @@ let TextInput = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
260
259
|
size: 'medium',
|
|
261
260
|
textAlign: 'start',
|
|
262
261
|
messages: []
|
|
263
|
-
}, _temp)) || _class) || _class);
|
|
262
|
+
}, _temp)) || _class) || _class) || _class);
|
|
264
263
|
export default TextInput;
|
|
265
264
|
export { TextInput };
|
package/lib/TextInput/index.js
CHANGED
|
@@ -19,12 +19,12 @@ var _getInteraction = require("@instructure/ui-react-utils/lib/getInteraction.js
|
|
|
19
19
|
|
|
20
20
|
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
21
21
|
|
|
22
|
+
var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
|
|
23
|
+
|
|
22
24
|
var _isActiveElement = require("@instructure/ui-dom-utils/lib/isActiveElement.js");
|
|
23
25
|
|
|
24
26
|
var _FormField = require("@instructure/ui-form-field/lib/FormField");
|
|
25
27
|
|
|
26
|
-
var _uid = require("@instructure/uid");
|
|
27
|
-
|
|
28
28
|
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
29
29
|
|
|
30
30
|
var _emotion = require("@instructure/emotion");
|
|
@@ -37,7 +37,7 @@ var _props = require("./props");
|
|
|
37
37
|
|
|
38
38
|
const _excluded = ["type", "size", "htmlSize", "display", "textAlign", "placeholder", "value", "defaultValue", "isRequired"];
|
|
39
39
|
|
|
40
|
-
var _dec, _dec2, _class, _class2, _temp;
|
|
40
|
+
var _dec, _dec2, _dec3, _class, _class2, _temp;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
---
|
|
@@ -46,7 +46,7 @@ tags: form, field
|
|
|
46
46
|
---
|
|
47
47
|
@tsProps
|
|
48
48
|
**/
|
|
49
|
-
let TextInput = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
49
|
+
let TextInput = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _testable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = (_temp = _class2 = class TextInput extends _react.Component {
|
|
50
50
|
constructor(props) {
|
|
51
51
|
super(props);
|
|
52
52
|
this.ref = null;
|
|
@@ -109,8 +109,8 @@ let TextInput = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
109
109
|
this.state = {
|
|
110
110
|
hasFocus: false
|
|
111
111
|
};
|
|
112
|
-
this._defaultId =
|
|
113
|
-
this._messagesId =
|
|
112
|
+
this._defaultId = props.deterministicId();
|
|
113
|
+
this._messagesId = props.deterministicId('TextInput-messages');
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
componentDidMount() {
|
|
@@ -259,7 +259,7 @@ let TextInput = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
259
259
|
size: 'medium',
|
|
260
260
|
textAlign: 'start',
|
|
261
261
|
messages: []
|
|
262
|
-
}, _temp)) || _class) || _class);
|
|
262
|
+
}, _temp)) || _class) || _class) || _class);
|
|
263
263
|
exports.TextInput = TextInput;
|
|
264
264
|
var _default = TextInput;
|
|
265
265
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-text-input",
|
|
3
|
-
"version": "8.17.
|
|
3
|
+
"version": "8.17.1-snapshot.17+8e38d5a2e",
|
|
4
4
|
"description": "A styled HTML text input component.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,25 +23,23 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "8.17.
|
|
27
|
-
"@instructure/ui-badge": "8.17.
|
|
28
|
-
"@instructure/ui-color-utils": "8.17.
|
|
29
|
-
"@instructure/ui-test-utils": "8.17.
|
|
30
|
-
"@instructure/ui-themes": "8.17.
|
|
26
|
+
"@instructure/ui-babel-preset": "8.17.1-snapshot.17+8e38d5a2e",
|
|
27
|
+
"@instructure/ui-badge": "8.17.1-snapshot.17+8e38d5a2e",
|
|
28
|
+
"@instructure/ui-color-utils": "8.17.1-snapshot.17+8e38d5a2e",
|
|
29
|
+
"@instructure/ui-test-utils": "8.17.1-snapshot.17+8e38d5a2e",
|
|
30
|
+
"@instructure/ui-themes": "8.17.1-snapshot.17+8e38d5a2e"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.13.10",
|
|
34
|
-
"@instructure/emotion": "8.17.
|
|
35
|
-
"@instructure/shared-types": "8.17.
|
|
36
|
-
"@instructure/ui-dom-utils": "8.17.
|
|
37
|
-
"@instructure/ui-form-field": "8.17.
|
|
38
|
-
"@instructure/ui-icons": "8.17.
|
|
39
|
-
"@instructure/ui-prop-types": "8.17.
|
|
40
|
-
"@instructure/ui-react-utils": "8.17.
|
|
41
|
-
"@instructure/ui-tag": "8.17.
|
|
42
|
-
"@instructure/ui-testable": "8.17.
|
|
43
|
-
"@instructure/ui-utils": "8.17.0",
|
|
44
|
-
"@instructure/uid": "8.17.0",
|
|
34
|
+
"@instructure/emotion": "8.17.1-snapshot.17+8e38d5a2e",
|
|
35
|
+
"@instructure/shared-types": "8.17.1-snapshot.17+8e38d5a2e",
|
|
36
|
+
"@instructure/ui-dom-utils": "8.17.1-snapshot.17+8e38d5a2e",
|
|
37
|
+
"@instructure/ui-form-field": "8.17.1-snapshot.17+8e38d5a2e",
|
|
38
|
+
"@instructure/ui-icons": "8.17.1-snapshot.17+8e38d5a2e",
|
|
39
|
+
"@instructure/ui-prop-types": "8.17.1-snapshot.17+8e38d5a2e",
|
|
40
|
+
"@instructure/ui-react-utils": "8.17.1-snapshot.17+8e38d5a2e",
|
|
41
|
+
"@instructure/ui-tag": "8.17.1-snapshot.17+8e38d5a2e",
|
|
42
|
+
"@instructure/ui-testable": "8.17.1-snapshot.17+8e38d5a2e",
|
|
45
43
|
"prop-types": "^15"
|
|
46
44
|
},
|
|
47
45
|
"peerDependencies": {
|
|
@@ -50,5 +48,6 @@
|
|
|
50
48
|
"publishConfig": {
|
|
51
49
|
"access": "public"
|
|
52
50
|
},
|
|
53
|
-
"sideEffects": false
|
|
51
|
+
"sideEffects": false,
|
|
52
|
+
"gitHead": "8e38d5a2e11e842eafa2fa270e47a261c6ebb626"
|
|
54
53
|
}
|
package/src/TextInput/index.tsx
CHANGED
|
@@ -28,11 +28,11 @@ import React, { Component } from 'react'
|
|
|
28
28
|
import {
|
|
29
29
|
callRenderProp,
|
|
30
30
|
getInteraction,
|
|
31
|
-
passthroughProps
|
|
31
|
+
passthroughProps,
|
|
32
|
+
withDeterministicId
|
|
32
33
|
} from '@instructure/ui-react-utils'
|
|
33
34
|
import { isActiveElement } from '@instructure/ui-dom-utils'
|
|
34
35
|
import { FormField } from '@instructure/ui-form-field'
|
|
35
|
-
import { uid } from '@instructure/uid'
|
|
36
36
|
import { testable } from '@instructure/ui-testable'
|
|
37
37
|
import { withStyle, jsx } from '@instructure/emotion'
|
|
38
38
|
|
|
@@ -52,6 +52,7 @@ tags: form, field
|
|
|
52
52
|
---
|
|
53
53
|
@tsProps
|
|
54
54
|
**/
|
|
55
|
+
@withDeterministicId()
|
|
55
56
|
@withStyle(generateStyle, generateComponentTheme)
|
|
56
57
|
@testable()
|
|
57
58
|
class TextInput extends Component<TextInputProps, TextInputState> {
|
|
@@ -75,8 +76,8 @@ class TextInput extends Component<TextInputProps, TextInputState> {
|
|
|
75
76
|
constructor(props: TextInputProps) {
|
|
76
77
|
super(props)
|
|
77
78
|
this.state = { hasFocus: false }
|
|
78
|
-
this._defaultId =
|
|
79
|
-
this._messagesId =
|
|
79
|
+
this._defaultId = props.deterministicId!()
|
|
80
|
+
this._messagesId = props.deterministicId!('TextInput-messages')
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
ref: Element | null = null
|
package/src/TextInput/props.ts
CHANGED
|
@@ -36,6 +36,7 @@ import type {
|
|
|
36
36
|
TextInputTheme
|
|
37
37
|
} from '@instructure/shared-types'
|
|
38
38
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
|
|
39
|
+
import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
|
|
39
40
|
|
|
40
41
|
type TextInputOwnProps = {
|
|
41
42
|
/**
|
|
@@ -182,7 +183,7 @@ type TextInputProps = TextInputOwnProps &
|
|
|
182
183
|
> &
|
|
183
184
|
// The component will handle pass this prop to FormField, but it shouldn't be
|
|
184
185
|
// listed as a prop
|
|
185
|
-
Pick<FormFieldProps, 'layout'>
|
|
186
|
+
Pick<FormFieldProps, 'layout'> & WithDeterministicIdProps
|
|
186
187
|
|
|
187
188
|
type TextInputStyle = ComponentStyle<
|
|
188
189
|
| 'textInput'
|
package/tsconfig.build.json
CHANGED