@instructure/ui-form-field 8.8.1-snapshot.8 → 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/FormField/index.js +4 -31
- package/es/FormField/props.js +51 -0
- package/es/FormFieldGroup/index.js +3 -39
- package/es/FormFieldGroup/props.js +55 -0
- package/es/FormFieldLabel/index.js +3 -10
- package/{src/FormFieldMessage/types.ts → es/FormFieldLabel/props.js} +7 -8
- package/es/FormFieldLayout/index.js +4 -45
- package/es/FormFieldLayout/props.js +59 -0
- package/es/FormFieldMessage/index.js +3 -10
- package/{src/FormFieldLabel/types.ts → es/FormFieldMessage/props.js} +7 -10
- package/es/FormFieldMessages/index.js +4 -20
- package/{src/FormField/types.ts → es/FormFieldMessages/props.js} +13 -16
- package/lib/FormField/index.js +5 -35
- package/lib/FormField/props.js +63 -0
- package/lib/FormFieldGroup/index.js +4 -41
- package/lib/FormFieldGroup/props.js +67 -0
- package/lib/FormFieldLabel/index.js +4 -11
- package/{src/FormFieldMessages/types.ts → lib/FormFieldLabel/props.js} +18 -8
- package/lib/FormFieldLayout/index.js +5 -47
- package/lib/FormFieldLayout/props.js +71 -0
- package/lib/FormFieldMessage/index.js +4 -11
- package/{src/FormFieldLayout/types.ts → lib/FormFieldMessage/props.js} +18 -20
- package/lib/FormFieldMessages/index.js +5 -22
- package/lib/FormFieldMessages/props.js +48 -0
- package/package.json +15 -16
- package/src/FormField/index.tsx +6 -31
- package/src/FormField/props.ts +91 -0
- package/src/FormFieldGroup/index.tsx +6 -38
- package/src/FormFieldGroup/props.ts +98 -0
- package/src/FormFieldGroup/styles.ts +1 -1
- package/src/FormFieldLabel/index.tsx +6 -12
- package/src/{FormFieldGroup/types.ts → FormFieldLabel/props.ts} +20 -16
- package/src/FormFieldLabel/styles.ts +1 -1
- package/src/FormFieldLayout/index.tsx +7 -43
- package/src/FormFieldLayout/props.ts +97 -0
- package/src/FormFieldLayout/styles.ts +1 -1
- package/src/FormFieldMessage/index.tsx +6 -12
- package/src/FormFieldMessage/props.ts +50 -0
- package/src/FormFieldMessage/styles.ts +1 -1
- package/src/FormFieldMessages/index.tsx +8 -22
- package/src/FormFieldMessages/props.ts +56 -0
- package/src/index.ts +6 -6
- package/types/FormField/index.d.ts +28 -32
- package/types/FormField/index.d.ts.map +1 -1
- package/types/FormField/props.d.ts +24 -0
- package/types/FormField/props.d.ts.map +1 -0
- package/types/FormFieldGroup/index.d.ts +27 -36
- package/types/FormFieldGroup/index.d.ts.map +1 -1
- package/types/FormFieldGroup/props.d.ts +28 -0
- package/types/FormFieldGroup/props.d.ts.map +1 -0
- package/types/FormFieldGroup/styles.d.ts +1 -1
- package/types/FormFieldLabel/index.d.ts +9 -8
- package/types/FormFieldLabel/index.d.ts.map +1 -1
- package/types/FormFieldLabel/props.d.ts +15 -0
- package/types/FormFieldLabel/props.d.ts.map +1 -0
- package/types/FormFieldLabel/styles.d.ts +1 -1
- package/types/FormFieldLayout/index.d.ts +27 -40
- package/types/FormFieldLayout/index.d.ts.map +1 -1
- package/types/FormFieldLayout/props.d.ts +25 -0
- package/types/FormFieldLayout/props.d.ts.map +1 -0
- package/types/FormFieldLayout/styles.d.ts +1 -1
- package/types/FormFieldMessage/index.d.ts +9 -8
- package/types/FormFieldMessage/index.d.ts.map +1 -1
- package/types/FormFieldMessage/props.d.ts +16 -0
- package/types/FormFieldMessage/props.d.ts.map +1 -0
- package/types/FormFieldMessage/styles.d.ts +1 -1
- package/types/FormFieldMessages/index.d.ts +4 -19
- package/types/FormFieldMessages/index.d.ts.map +1 -1
- package/types/FormFieldMessages/props.d.ts +14 -0
- package/types/FormFieldMessages/props.d.ts.map +1 -0
- package/types/index.d.ts +6 -6
- package/LICENSE.md +0 -27
- package/es/FormField/types.js +0 -1
- package/es/FormFieldGroup/types.js +0 -1
- package/es/FormFieldLabel/types.js +0 -1
- package/es/FormFieldLayout/types.js +0 -1
- package/es/FormFieldMessage/types.js +0 -1
- package/es/FormFieldMessages/types.js +0 -1
- package/lib/FormField/types.js +0 -1
- package/lib/FormFieldGroup/types.js +0 -1
- package/lib/FormFieldLabel/types.js +0 -1
- package/lib/FormFieldLayout/types.js +0 -1
- package/lib/FormFieldMessage/types.js +0 -1
- package/lib/FormFieldMessages/types.js +0 -1
- package/types/FormField/types.d.ts +0 -15
- package/types/FormField/types.d.ts.map +0 -1
- package/types/FormFieldGroup/types.d.ts +0 -21
- package/types/FormFieldGroup/types.d.ts.map +0 -1
- package/types/FormFieldLabel/types.d.ts +0 -9
- package/types/FormFieldLabel/types.d.ts.map +0 -1
- package/types/FormFieldLayout/types.d.ts +0 -19
- package/types/FormFieldLayout/types.d.ts.map +0 -1
- package/types/FormFieldMessage/types.d.ts +0 -7
- package/types/FormFieldMessage/types.d.ts.map +0 -1
- package/types/FormFieldMessages/types.d.ts +0 -7
- package/types/FormFieldMessages/types.d.ts.map +0 -1
|
@@ -0,0 +1,97 @@
|
|
|
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 PropTypes from 'prop-types'
|
|
26
|
+
|
|
27
|
+
import { FormPropTypes } from '../FormPropTypes'
|
|
28
|
+
|
|
29
|
+
import type { AsElementType, PropValidators } from '@instructure/shared-types'
|
|
30
|
+
import type { WithStyleProps } from '@instructure/emotion'
|
|
31
|
+
import type { FormMessage } from '../FormPropTypes'
|
|
32
|
+
|
|
33
|
+
type FormFieldLayoutOwnProps = {
|
|
34
|
+
label: React.ReactNode
|
|
35
|
+
id?: string
|
|
36
|
+
as?: AsElementType
|
|
37
|
+
messages?: FormMessage[]
|
|
38
|
+
messagesId?: string
|
|
39
|
+
children?: React.ReactNode
|
|
40
|
+
inline?: boolean
|
|
41
|
+
layout?: 'stacked' | 'inline'
|
|
42
|
+
labelAlign?: 'start' | 'end'
|
|
43
|
+
width?: string
|
|
44
|
+
inputContainerRef?: (...args: any[]) => any
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
type PropKeys = keyof FormFieldLayoutOwnProps
|
|
48
|
+
|
|
49
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
50
|
+
|
|
51
|
+
type FormFieldLayoutProps = FormFieldLayoutOwnProps & WithStyleProps
|
|
52
|
+
|
|
53
|
+
const propTypes: PropValidators<PropKeys> = {
|
|
54
|
+
label: PropTypes.node.isRequired,
|
|
55
|
+
/**
|
|
56
|
+
* the id of the input (to link it to its label for a11y)
|
|
57
|
+
*/
|
|
58
|
+
id: PropTypes.string,
|
|
59
|
+
/**
|
|
60
|
+
* the element type to render as
|
|
61
|
+
*/
|
|
62
|
+
as: PropTypes.elementType,
|
|
63
|
+
/**
|
|
64
|
+
* object with shape: `{
|
|
65
|
+
* text: PropTypes.string,
|
|
66
|
+
* type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
|
|
67
|
+
* }`
|
|
68
|
+
*/
|
|
69
|
+
messages: PropTypes.arrayOf(FormPropTypes.message),
|
|
70
|
+
/**
|
|
71
|
+
* id for the form field messages
|
|
72
|
+
*/
|
|
73
|
+
messagesId: PropTypes.string,
|
|
74
|
+
children: PropTypes.node,
|
|
75
|
+
inline: PropTypes.bool,
|
|
76
|
+
layout: PropTypes.oneOf(['stacked', 'inline']),
|
|
77
|
+
labelAlign: PropTypes.oneOf(['start', 'end']),
|
|
78
|
+
width: PropTypes.string,
|
|
79
|
+
inputContainerRef: PropTypes.func
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const allowedProps: AllowedPropKeys = [
|
|
83
|
+
'label',
|
|
84
|
+
'id',
|
|
85
|
+
'as',
|
|
86
|
+
'messages',
|
|
87
|
+
'messagesId',
|
|
88
|
+
'children',
|
|
89
|
+
'inline',
|
|
90
|
+
'layout',
|
|
91
|
+
'labelAlign',
|
|
92
|
+
'width',
|
|
93
|
+
'inputContainerRef'
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
export type { FormFieldLayoutProps }
|
|
97
|
+
export { propTypes, allowedProps }
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
|
|
25
25
|
/** @jsx jsx */
|
|
26
26
|
import { Component } from 'react'
|
|
27
|
-
import PropTypes from 'prop-types'
|
|
28
27
|
|
|
29
28
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content'
|
|
30
29
|
|
|
@@ -32,7 +31,9 @@ import { withStyle, jsx } from '@instructure/emotion'
|
|
|
32
31
|
|
|
33
32
|
import generateStyle from './styles'
|
|
34
33
|
import generateComponentTheme from './theme'
|
|
35
|
-
|
|
34
|
+
|
|
35
|
+
import { propTypes, allowedProps } from './props'
|
|
36
|
+
import type { FormFieldMessageProps } from './props'
|
|
36
37
|
|
|
37
38
|
/**
|
|
38
39
|
---
|
|
@@ -53,15 +54,8 @@ example: true
|
|
|
53
54
|
class FormFieldMessage extends Component<FormFieldMessageProps> {
|
|
54
55
|
static readonly componentId = 'FormFieldMessage'
|
|
55
56
|
|
|
56
|
-
static propTypes =
|
|
57
|
-
|
|
58
|
-
makeStyles: PropTypes.func,
|
|
59
|
-
// eslint-disable-next-line react/require-default-props
|
|
60
|
-
styles: PropTypes.object,
|
|
61
|
-
variant: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only']),
|
|
62
|
-
children: PropTypes.node
|
|
63
|
-
}
|
|
64
|
-
|
|
57
|
+
static propTypes = propTypes
|
|
58
|
+
static allowedProps = allowedProps
|
|
65
59
|
static defaultProps = {
|
|
66
60
|
variant: 'hint',
|
|
67
61
|
children: null
|
|
@@ -82,7 +76,7 @@ class FormFieldMessage extends Component<FormFieldMessageProps> {
|
|
|
82
76
|
const { children, styles } = this.props
|
|
83
77
|
|
|
84
78
|
return this.props.variant !== 'screenreader-only' ? (
|
|
85
|
-
<span css={styles
|
|
79
|
+
<span css={styles?.formFieldMessage}>{children}</span>
|
|
86
80
|
) : (
|
|
87
81
|
<ScreenReaderContent>{children}</ScreenReaderContent>
|
|
88
82
|
)
|
|
@@ -0,0 +1,50 @@
|
|
|
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 PropTypes from 'prop-types'
|
|
26
|
+
|
|
27
|
+
import type { PropValidators } from '@instructure/shared-types'
|
|
28
|
+
import type { WithStyleProps } from '@instructure/emotion'
|
|
29
|
+
import type { FormMessageType } from '../FormPropTypes'
|
|
30
|
+
|
|
31
|
+
type FormFieldMessageOwnProps = {
|
|
32
|
+
variant?: FormMessageType
|
|
33
|
+
children?: React.ReactNode
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
type PropKeys = keyof FormFieldMessageOwnProps
|
|
37
|
+
|
|
38
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
39
|
+
|
|
40
|
+
type FormFieldMessageProps = FormFieldMessageOwnProps & WithStyleProps
|
|
41
|
+
|
|
42
|
+
const propTypes: PropValidators<PropKeys> = {
|
|
43
|
+
variant: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only']),
|
|
44
|
+
children: PropTypes.node
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const allowedProps: AllowedPropKeys = ['variant', 'children']
|
|
48
|
+
|
|
49
|
+
export type { FormFieldMessageProps }
|
|
50
|
+
export { propTypes, allowedProps }
|
|
@@ -24,18 +24,18 @@
|
|
|
24
24
|
|
|
25
25
|
/** @jsx jsx */
|
|
26
26
|
import { Component } from 'react'
|
|
27
|
-
import PropTypes from 'prop-types'
|
|
28
27
|
|
|
29
28
|
import { omitProps } from '@instructure/ui-react-utils'
|
|
30
29
|
|
|
31
30
|
import { withStyle, jsx } from '@instructure/emotion'
|
|
32
31
|
|
|
33
|
-
import { FormPropTypes } from '../FormPropTypes'
|
|
34
32
|
import { FormFieldMessage } from '../FormFieldMessage'
|
|
35
33
|
|
|
36
34
|
import generateStyle from './styles'
|
|
37
35
|
import generateComponentTheme from './theme'
|
|
38
|
-
|
|
36
|
+
|
|
37
|
+
import { propTypes, allowedProps } from './props'
|
|
38
|
+
import type { FormFieldMessagesProps } from './props'
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
---
|
|
@@ -59,23 +59,9 @@ example: true
|
|
|
59
59
|
class FormFieldMessages extends Component<FormFieldMessagesProps> {
|
|
60
60
|
static readonly componentId = 'FormFieldMessages'
|
|
61
61
|
|
|
62
|
-
static propTypes =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// eslint-disable-next-line react/require-default-props
|
|
66
|
-
styles: PropTypes.object,
|
|
67
|
-
/**
|
|
68
|
-
* object with shape: `{
|
|
69
|
-
* text: PropTypes.string,
|
|
70
|
-
* type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
|
|
71
|
-
* }`
|
|
72
|
-
*/
|
|
73
|
-
messages: PropTypes.arrayOf(FormPropTypes.message)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
static defaultProps = {
|
|
77
|
-
messages: undefined
|
|
78
|
-
}
|
|
62
|
+
static propTypes = propTypes
|
|
63
|
+
static allowedProps = allowedProps
|
|
64
|
+
static defaultProps = {}
|
|
79
65
|
|
|
80
66
|
componentDidMount() {
|
|
81
67
|
// @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
|
|
@@ -93,12 +79,12 @@ class FormFieldMessages extends Component<FormFieldMessagesProps> {
|
|
|
93
79
|
|
|
94
80
|
return messages && messages.length > 0 ? (
|
|
95
81
|
<span
|
|
96
|
-
css={styles
|
|
82
|
+
css={styles?.formFieldMessages}
|
|
97
83
|
{...omitProps(this.props, FormFieldMessages.propTypes)}
|
|
98
84
|
>
|
|
99
85
|
{messages.map((msg, i) => {
|
|
100
86
|
return (
|
|
101
|
-
<span key={`error${i}`} css={styles
|
|
87
|
+
<span key={`error${i}`} css={styles?.message}>
|
|
102
88
|
<FormFieldMessage variant={msg.type}>{msg.text}</FormFieldMessage>
|
|
103
89
|
</span>
|
|
104
90
|
)
|
|
@@ -0,0 +1,56 @@
|
|
|
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 PropTypes from 'prop-types'
|
|
26
|
+
|
|
27
|
+
import { FormPropTypes } from '../FormPropTypes'
|
|
28
|
+
|
|
29
|
+
import type { PropValidators } from '@instructure/shared-types'
|
|
30
|
+
import type { WithStyleProps } from '@instructure/emotion'
|
|
31
|
+
import type { FormMessage } from '../FormPropTypes'
|
|
32
|
+
|
|
33
|
+
type FormFieldMessagesOwnProps = {
|
|
34
|
+
messages?: FormMessage[]
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
type PropKeys = keyof FormFieldMessagesOwnProps
|
|
38
|
+
|
|
39
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
40
|
+
|
|
41
|
+
type FormFieldMessagesProps = FormFieldMessagesOwnProps & WithStyleProps
|
|
42
|
+
|
|
43
|
+
const propTypes: PropValidators<PropKeys> = {
|
|
44
|
+
/**
|
|
45
|
+
* object with shape: `{
|
|
46
|
+
* text: PropTypes.string,
|
|
47
|
+
* type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
|
|
48
|
+
* }`
|
|
49
|
+
*/
|
|
50
|
+
messages: PropTypes.arrayOf(FormPropTypes.message)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const allowedProps: AllowedPropKeys = ['messages']
|
|
54
|
+
|
|
55
|
+
export type { FormFieldMessagesProps }
|
|
56
|
+
export { propTypes, allowedProps }
|
package/src/index.ts
CHANGED
|
@@ -32,9 +32,9 @@ export { FormFieldGroup } from './FormFieldGroup'
|
|
|
32
32
|
export { FormPropTypes } from './FormPropTypes'
|
|
33
33
|
export type { FormMessageType, FormMessage } from './FormPropTypes'
|
|
34
34
|
|
|
35
|
-
export type { FormFieldProps } from './FormField/
|
|
36
|
-
export type { FormFieldLabelProps } from './FormFieldLabel/
|
|
37
|
-
export type { FormFieldMessageProps } from './FormFieldMessage/
|
|
38
|
-
export type { FormFieldMessagesProps } from './FormFieldMessages/
|
|
39
|
-
export type { FormFieldLayoutProps } from './FormFieldLayout/
|
|
40
|
-
export type { FormFieldGroupProps } from './FormFieldGroup/
|
|
35
|
+
export type { FormFieldProps } from './FormField/props'
|
|
36
|
+
export type { FormFieldLabelProps } from './FormFieldLabel/props'
|
|
37
|
+
export type { FormFieldMessageProps } from './FormFieldMessage/props'
|
|
38
|
+
export type { FormFieldMessagesProps } from './FormFieldMessages/props'
|
|
39
|
+
export type { FormFieldLayoutProps } from './FormFieldLayout/props'
|
|
40
|
+
export type { FormFieldGroupProps } from './FormFieldGroup/props'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Component } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import { FormFieldProps } from './types';
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import type { FormFieldProps } from './props';
|
|
4
3
|
/**
|
|
5
4
|
---
|
|
6
5
|
category: components
|
|
@@ -8,41 +7,38 @@ category: components
|
|
|
8
7
|
**/
|
|
9
8
|
declare class FormField extends Component<FormFieldProps> {
|
|
10
9
|
static readonly componentId = "FormField";
|
|
11
|
-
static propTypes: {
|
|
12
|
-
label:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
10
|
+
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
|
11
|
+
label: React.ReactNode;
|
|
12
|
+
id: string;
|
|
13
|
+
messages?: import("..").FormMessage[] | undefined;
|
|
14
|
+
messagesId?: string | undefined;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
inline?: boolean | undefined;
|
|
17
|
+
layout?: "inline" | "stacked" | undefined;
|
|
18
|
+
labelAlign?: "end" | "start" | undefined;
|
|
19
|
+
vAlign?: "middle" | "bottom" | "top" | undefined;
|
|
20
|
+
width?: string | undefined;
|
|
21
|
+
inputContainerRef?: ((...args: any[]) => any) | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
static allowedProps: readonly (keyof {
|
|
24
|
+
label: React.ReactNode;
|
|
25
|
+
id: string;
|
|
26
|
+
messages?: import("..").FormMessage[] | undefined;
|
|
27
|
+
messagesId?: string | undefined;
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
inline?: boolean | undefined;
|
|
30
|
+
layout?: "inline" | "stacked" | undefined;
|
|
31
|
+
labelAlign?: "end" | "start" | undefined;
|
|
32
|
+
vAlign?: "middle" | "bottom" | "top" | undefined;
|
|
33
|
+
width?: string | undefined;
|
|
34
|
+
inputContainerRef?: ((...args: any[]) => any) | undefined;
|
|
35
|
+
})[];
|
|
36
36
|
static defaultProps: {
|
|
37
37
|
inline: boolean;
|
|
38
38
|
layout: string;
|
|
39
39
|
labelAlign: string;
|
|
40
40
|
vAlign: string;
|
|
41
|
-
messages: undefined;
|
|
42
|
-
messagesId: undefined;
|
|
43
41
|
children: null;
|
|
44
|
-
width: undefined;
|
|
45
|
-
inputContainerRef: undefined;
|
|
46
42
|
};
|
|
47
43
|
render(): JSX.Element;
|
|
48
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FormField/index.tsx"],"names":[],"mappings":"AAwBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FormField/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C;;;;GAIG;AACH,cAAM,SAAU,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC/C,MAAM,CAAC,QAAQ,CAAC,WAAW,eAAc;IAEzC,MAAM,CAAC,SAAS;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;MAMlB;IAED,MAAM;CAYP;AAED,eAAe,SAAS,CAAA;AACxB,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PropValidators } from '@instructure/shared-types';
|
|
3
|
+
import type { FormMessage } from '../FormPropTypes';
|
|
4
|
+
declare type FormFieldOwnProps = {
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
id: string;
|
|
7
|
+
messages?: FormMessage[];
|
|
8
|
+
messagesId?: string;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
inline?: boolean;
|
|
11
|
+
layout?: 'stacked' | 'inline';
|
|
12
|
+
labelAlign?: 'start' | 'end';
|
|
13
|
+
vAlign?: 'top' | 'middle' | 'bottom';
|
|
14
|
+
width?: string;
|
|
15
|
+
inputContainerRef?: (...args: any[]) => any;
|
|
16
|
+
};
|
|
17
|
+
declare type PropKeys = keyof FormFieldOwnProps;
|
|
18
|
+
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
19
|
+
declare type FormFieldProps = FormFieldOwnProps;
|
|
20
|
+
declare const propTypes: PropValidators<PropKeys>;
|
|
21
|
+
declare const allowedProps: AllowedPropKeys;
|
|
22
|
+
export type { FormFieldProps };
|
|
23
|
+
export { propTypes, allowedProps };
|
|
24
|
+
//# sourceMappingURL=props.d.ts.map
|