@modernpoacher/gremlins 0.0.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/README.md +5 -0
- package/babel.config.cjs +106 -0
- package/package.json +139 -0
- package/src/components/common/disabled/index.cjs +17 -0
- package/src/components/common/disabled/index.jsx +9 -0
- package/src/components/common/readonly/index.cjs +17 -0
- package/src/components/common/readonly/index.jsx +9 -0
- package/src/components/common/required/index.cjs +17 -0
- package/src/components/common/required/index.jsx +9 -0
- package/src/components/common/text-content/index.cjs +17 -0
- package/src/components/common/text-content/index.jsx +24 -0
- package/src/components/field/index.cjs +16 -0
- package/src/components/field/index.jsx +146 -0
- package/src/components/group/index.cjs +17 -0
- package/src/components/group/index.jsx +55 -0
- package/src/gremlins/checkbox/field/index.cjs +17 -0
- package/src/gremlins/checkbox/field/index.jsx +62 -0
- package/src/gremlins/checkbox/index.cjs +17 -0
- package/src/gremlins/checkbox/index.jsx +84 -0
- package/src/gremlins/email/field/index.cjs +17 -0
- package/src/gremlins/email/field/index.jsx +58 -0
- package/src/gremlins/email/index.cjs +17 -0
- package/src/gremlins/email/index.jsx +65 -0
- package/src/gremlins/fieldset/group/index.cjs +17 -0
- package/src/gremlins/fieldset/group/index.jsx +20 -0
- package/src/gremlins/fieldset/index.cjs +17 -0
- package/src/gremlins/fieldset/index.jsx +40 -0
- package/src/gremlins/index.cjs +16 -0
- package/src/gremlins/index.jsx +226 -0
- package/src/gremlins/number/field/index.cjs +17 -0
- package/src/gremlins/number/field/index.jsx +67 -0
- package/src/gremlins/number/index.cjs +17 -0
- package/src/gremlins/number/index.jsx +74 -0
- package/src/gremlins/password/field/index.cjs +17 -0
- package/src/gremlins/password/field/index.jsx +58 -0
- package/src/gremlins/password/index.cjs +17 -0
- package/src/gremlins/password/index.jsx +65 -0
- package/src/gremlins/radio/field/index.cjs +17 -0
- package/src/gremlins/radio/field/index.jsx +79 -0
- package/src/gremlins/radio/index.cjs +17 -0
- package/src/gremlins/radio/index.jsx +95 -0
- package/src/gremlins/select/field/index.cjs +17 -0
- package/src/gremlins/select/field/index.jsx +71 -0
- package/src/gremlins/select/index.cjs +17 -0
- package/src/gremlins/select/index.jsx +81 -0
- package/src/gremlins/text/field/index.cjs +17 -0
- package/src/gremlins/text/field/index.jsx +58 -0
- package/src/gremlins/text/index.cjs +17 -0
- package/src/gremlins/text/index.jsx +65 -0
- package/src/gremlins/textarea/field/index.cjs +17 -0
- package/src/gremlins/textarea/field/index.jsx +57 -0
- package/src/gremlins/textarea/index.cjs +17 -0
- package/src/gremlins/textarea/index.jsx +65 -0
- package/src/index.cjs +29 -0
- package/src/index.d.cts +249 -0
- package/src/index.mjs +34 -0
- package/tsconfig.json +11 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SelectGremlin component
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react'
|
|
5
|
+
import PropTypes from 'prop-types'
|
|
6
|
+
import classnames from 'classnames'
|
|
7
|
+
|
|
8
|
+
import { ValueGremlin } from '@modernpoacher/gremlins/gremlins'
|
|
9
|
+
|
|
10
|
+
import Field from './field/index.jsx'
|
|
11
|
+
|
|
12
|
+
export default class SelectGremlin extends ValueGremlin {
|
|
13
|
+
shouldComponentUpdate (props) {
|
|
14
|
+
return (
|
|
15
|
+
super.shouldComponentUpdate(props) ||
|
|
16
|
+
(props.children !== this.props.children)
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
getClassName () {
|
|
21
|
+
return classnames(super.getClassName(), 'select')
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
handleChange = (value) => {
|
|
25
|
+
const {
|
|
26
|
+
onChange
|
|
27
|
+
} = this.props
|
|
28
|
+
|
|
29
|
+
onChange(value)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
renderField () {
|
|
33
|
+
const id = this.getId()
|
|
34
|
+
|
|
35
|
+
const {
|
|
36
|
+
name,
|
|
37
|
+
value,
|
|
38
|
+
defaultValue,
|
|
39
|
+
required,
|
|
40
|
+
disabled,
|
|
41
|
+
readOnly,
|
|
42
|
+
tabIndex,
|
|
43
|
+
accessKey,
|
|
44
|
+
placeholder,
|
|
45
|
+
fieldRef,
|
|
46
|
+
children
|
|
47
|
+
} = this.props
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<Field
|
|
51
|
+
id={id}
|
|
52
|
+
name={name}
|
|
53
|
+
value={value}
|
|
54
|
+
defaultValue={defaultValue}
|
|
55
|
+
required={required}
|
|
56
|
+
disabled={disabled}
|
|
57
|
+
readOnly={readOnly}
|
|
58
|
+
tabIndex={tabIndex}
|
|
59
|
+
accessKey={accessKey}
|
|
60
|
+
placeholder={placeholder}
|
|
61
|
+
onChange={this.handleChange}
|
|
62
|
+
fieldRef={fieldRef}>
|
|
63
|
+
{children}
|
|
64
|
+
</Field>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
SelectGremlin.propTypes = {
|
|
70
|
+
...ValueGremlin.propTypes,
|
|
71
|
+
children: PropTypes.oneOfType([
|
|
72
|
+
PropTypes.node,
|
|
73
|
+
PropTypes.arrayOf(
|
|
74
|
+
PropTypes.node
|
|
75
|
+
)
|
|
76
|
+
])
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
SelectGremlin.defaultProps = {
|
|
80
|
+
...ValueGremlin.defaultProps
|
|
81
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require('@babel/register')({
|
|
2
|
+
ignore: [
|
|
3
|
+
/node_modules\/(?!@modernpoacher\/cogs|@modernpoacher\/gremlins|@modernpoacher\/sprockets)/
|
|
4
|
+
]
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
const debug = require('debug')
|
|
8
|
+
|
|
9
|
+
const log = debug('@modernpoacher/gremlins/gremlins/text/field')
|
|
10
|
+
|
|
11
|
+
log('`gremlins` is awake')
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
default: component
|
|
15
|
+
} = require('./index.jsx')
|
|
16
|
+
|
|
17
|
+
module.exports = component
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TextField component
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react'
|
|
5
|
+
import classnames from 'classnames'
|
|
6
|
+
|
|
7
|
+
import { ValueField } from '@modernpoacher/gremlins/components/field'
|
|
8
|
+
|
|
9
|
+
export default class TextField extends ValueField {
|
|
10
|
+
getClassName () {
|
|
11
|
+
return classnames(super.getClassName(), 'text')
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
render () {
|
|
15
|
+
const {
|
|
16
|
+
id,
|
|
17
|
+
name,
|
|
18
|
+
value,
|
|
19
|
+
defaultValue,
|
|
20
|
+
required,
|
|
21
|
+
disabled,
|
|
22
|
+
readOnly,
|
|
23
|
+
tabIndex,
|
|
24
|
+
accessKey,
|
|
25
|
+
placeholder,
|
|
26
|
+
fieldRef
|
|
27
|
+
} = this.props
|
|
28
|
+
|
|
29
|
+
const className = this.getClassName()
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<input
|
|
33
|
+
id={id}
|
|
34
|
+
name={name}
|
|
35
|
+
value={value}
|
|
36
|
+
defaultValue={defaultValue}
|
|
37
|
+
required={required}
|
|
38
|
+
disabled={disabled}
|
|
39
|
+
readOnly={readOnly}
|
|
40
|
+
tabIndex={tabIndex}
|
|
41
|
+
accessKey={accessKey}
|
|
42
|
+
placeholder={placeholder}
|
|
43
|
+
onChange={this.handleChange}
|
|
44
|
+
className={className}
|
|
45
|
+
type='text'
|
|
46
|
+
ref={fieldRef}
|
|
47
|
+
/>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
TextField.propTypes = {
|
|
53
|
+
...ValueField.propTypes
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
TextField.defaultProps = {
|
|
57
|
+
...ValueField.defaultProps
|
|
58
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require('@babel/register')({
|
|
2
|
+
ignore: [
|
|
3
|
+
/node_modules\/(?!@modernpoacher\/cogs|@modernpoacher\/gremlins|@modernpoacher\/sprockets)/
|
|
4
|
+
]
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
const debug = require('debug')
|
|
8
|
+
|
|
9
|
+
const log = debug('@modernpoacher/gremlins/gremlins/text')
|
|
10
|
+
|
|
11
|
+
log('`gremlins` is awake')
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
default: component
|
|
15
|
+
} = require('./index.jsx')
|
|
16
|
+
|
|
17
|
+
module.exports = component
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TextGremlin component
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react'
|
|
5
|
+
import classnames from 'classnames'
|
|
6
|
+
|
|
7
|
+
import { ValueGremlin } from '@modernpoacher/gremlins/gremlins'
|
|
8
|
+
|
|
9
|
+
import Field from './field/index.jsx'
|
|
10
|
+
|
|
11
|
+
export default class TextGremlin extends ValueGremlin {
|
|
12
|
+
getClassName () {
|
|
13
|
+
return classnames(super.getClassName(), 'text')
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
handleChange = (value) => {
|
|
17
|
+
const {
|
|
18
|
+
onChange
|
|
19
|
+
} = this.props
|
|
20
|
+
|
|
21
|
+
onChange(value)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
renderField () {
|
|
25
|
+
const id = this.getId()
|
|
26
|
+
|
|
27
|
+
const {
|
|
28
|
+
name,
|
|
29
|
+
value,
|
|
30
|
+
defaultValue,
|
|
31
|
+
required,
|
|
32
|
+
disabled,
|
|
33
|
+
readOnly,
|
|
34
|
+
tabIndex,
|
|
35
|
+
accessKey,
|
|
36
|
+
placeholder,
|
|
37
|
+
fieldRef
|
|
38
|
+
} = this.props
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Field
|
|
42
|
+
id={id}
|
|
43
|
+
name={name}
|
|
44
|
+
value={value}
|
|
45
|
+
defaultValue={defaultValue}
|
|
46
|
+
required={required}
|
|
47
|
+
disabled={disabled}
|
|
48
|
+
readOnly={readOnly}
|
|
49
|
+
tabIndex={tabIndex}
|
|
50
|
+
accessKey={accessKey}
|
|
51
|
+
placeholder={placeholder}
|
|
52
|
+
onChange={this.handleChange}
|
|
53
|
+
fieldRef={fieldRef}
|
|
54
|
+
/>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
TextGremlin.propTypes = {
|
|
60
|
+
...ValueGremlin.propTypes
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
TextGremlin.defaultProps = {
|
|
64
|
+
...ValueGremlin.defaultProps
|
|
65
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require('@babel/register')({
|
|
2
|
+
ignore: [
|
|
3
|
+
/node_modules\/(?!@modernpoacher\/cogs|@modernpoacher\/gremlins|@modernpoacher\/sprockets)/
|
|
4
|
+
]
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
const debug = require('debug')
|
|
8
|
+
|
|
9
|
+
const log = debug('@modernpoacher/gremlins/gremlins/textarea/field')
|
|
10
|
+
|
|
11
|
+
log('`gremlins` is awake')
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
default: component
|
|
15
|
+
} = require('./index.jsx')
|
|
16
|
+
|
|
17
|
+
module.exports = component
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TextareaField component
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react'
|
|
5
|
+
import classnames from 'classnames'
|
|
6
|
+
|
|
7
|
+
import { ValueField } from '@modernpoacher/gremlins/components/field'
|
|
8
|
+
|
|
9
|
+
export default class TextareaField extends ValueField {
|
|
10
|
+
getClassName () {
|
|
11
|
+
return classnames(super.getClassName(), 'textarea')
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
render () {
|
|
15
|
+
const {
|
|
16
|
+
id,
|
|
17
|
+
name,
|
|
18
|
+
value,
|
|
19
|
+
defaultValue,
|
|
20
|
+
required,
|
|
21
|
+
disabled,
|
|
22
|
+
readOnly,
|
|
23
|
+
tabIndex,
|
|
24
|
+
accessKey,
|
|
25
|
+
placeholder,
|
|
26
|
+
fieldRef
|
|
27
|
+
} = this.props
|
|
28
|
+
|
|
29
|
+
const className = this.getClassName()
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<textarea
|
|
33
|
+
id={id}
|
|
34
|
+
name={name}
|
|
35
|
+
value={value}
|
|
36
|
+
defaultValue={defaultValue}
|
|
37
|
+
required={required}
|
|
38
|
+
disabled={disabled}
|
|
39
|
+
readOnly={readOnly}
|
|
40
|
+
tabIndex={tabIndex}
|
|
41
|
+
accessKey={accessKey}
|
|
42
|
+
placeholder={placeholder}
|
|
43
|
+
onChange={this.handleChange}
|
|
44
|
+
className={className}
|
|
45
|
+
ref={fieldRef}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
TextareaField.propTypes = {
|
|
52
|
+
...ValueField.propTypes
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
TextareaField.defaultProps = {
|
|
56
|
+
...ValueField.defaultProps
|
|
57
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require('@babel/register')({
|
|
2
|
+
ignore: [
|
|
3
|
+
/node_modules\/(?!@modernpoacher\/cogs|@modernpoacher\/gremlins|@modernpoacher\/sprockets)/
|
|
4
|
+
]
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
const debug = require('debug')
|
|
8
|
+
|
|
9
|
+
const log = debug('@modernpoacher/gremlins/gremlins/textarea')
|
|
10
|
+
|
|
11
|
+
log('`gremlins` is awake')
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
default: component
|
|
15
|
+
} = require('./index.jsx')
|
|
16
|
+
|
|
17
|
+
module.exports = component
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TextareaGremlin component
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react'
|
|
5
|
+
import classnames from 'classnames'
|
|
6
|
+
|
|
7
|
+
import { ValueGremlin } from '@modernpoacher/gremlins/gremlins'
|
|
8
|
+
|
|
9
|
+
import Field from './field/index.jsx'
|
|
10
|
+
|
|
11
|
+
export default class TextareaGremlin extends ValueGremlin {
|
|
12
|
+
getClassName () {
|
|
13
|
+
return classnames(super.getClassName(), 'textarea')
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
handleChange = (value) => {
|
|
17
|
+
const {
|
|
18
|
+
onChange
|
|
19
|
+
} = this.props
|
|
20
|
+
|
|
21
|
+
onChange(value)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
renderField () {
|
|
25
|
+
const id = this.getId()
|
|
26
|
+
|
|
27
|
+
const {
|
|
28
|
+
name,
|
|
29
|
+
value,
|
|
30
|
+
defaultValue,
|
|
31
|
+
required,
|
|
32
|
+
disabled,
|
|
33
|
+
readOnly,
|
|
34
|
+
tabIndex,
|
|
35
|
+
accessKey,
|
|
36
|
+
placeholder,
|
|
37
|
+
fieldRef
|
|
38
|
+
} = this.props
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Field
|
|
42
|
+
id={id}
|
|
43
|
+
name={name}
|
|
44
|
+
value={value}
|
|
45
|
+
defaultValue={defaultValue}
|
|
46
|
+
required={required}
|
|
47
|
+
disabled={disabled}
|
|
48
|
+
readOnly={readOnly}
|
|
49
|
+
tabIndex={tabIndex}
|
|
50
|
+
accessKey={accessKey}
|
|
51
|
+
placeholder={placeholder}
|
|
52
|
+
onChange={this.handleChange}
|
|
53
|
+
fieldRef={fieldRef}
|
|
54
|
+
/>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
TextareaGremlin.propTypes = {
|
|
60
|
+
...ValueGremlin.propTypes
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
TextareaGremlin.defaultProps = {
|
|
64
|
+
...ValueGremlin.defaultProps
|
|
65
|
+
}
|
package/src/index.cjs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
require('@babel/register')({
|
|
2
|
+
ignore: [
|
|
3
|
+
/node_modules\/(?!@modernpoacher\/cogs|@modernpoacher\/gremlins|@modernpoacher\/sprockets)/
|
|
4
|
+
]
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
const debug = require('debug')
|
|
8
|
+
|
|
9
|
+
const log = debug('@modernpoacher/gremlins')
|
|
10
|
+
|
|
11
|
+
log('`gremlins` is awake')
|
|
12
|
+
|
|
13
|
+
const CheckboxGremlin = require('./gremlins/checkbox/index.cjs')
|
|
14
|
+
const EmailGremlin = require('./gremlins/email/index.cjs')
|
|
15
|
+
const NumberGremlin = require('./gremlins/number/index.cjs')
|
|
16
|
+
const PasswordGremlin = require('./gremlins/password/index.cjs')
|
|
17
|
+
const RadioGremlin = require('./gremlins/radio/index.cjs')
|
|
18
|
+
const SelectGremlin = require('./gremlins/select/index.cjs')
|
|
19
|
+
const TextGremlin = require('./gremlins/text/index.cjs')
|
|
20
|
+
const TextareaGremlin = require('./gremlins/textarea/index.cjs')
|
|
21
|
+
|
|
22
|
+
module.exports.CheckboxGremlin = CheckboxGremlin
|
|
23
|
+
module.exports.EmailGremlin = EmailGremlin
|
|
24
|
+
module.exports.NumberGremlin = NumberGremlin
|
|
25
|
+
module.exports.PasswordGremlin = PasswordGremlin
|
|
26
|
+
module.exports.RadioGremlin = RadioGremlin
|
|
27
|
+
module.exports.SelectGremlin = SelectGremlin
|
|
28
|
+
module.exports.TextGremlin = TextGremlin
|
|
29
|
+
module.exports.TextareaGremlin = TextareaGremlin
|
package/src/index.d.cts
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
declare namespace FieldGremlinsTypes {
|
|
2
|
+
export type OnChangeType = () => void
|
|
3
|
+
|
|
4
|
+
export type AnswerDefinitionType = {
|
|
5
|
+
answer: {
|
|
6
|
+
value: string | string[]
|
|
7
|
+
}
|
|
8
|
+
changeAnswer: {
|
|
9
|
+
text: string
|
|
10
|
+
href: string
|
|
11
|
+
visuallyHiddenText?: string
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type ErrorDefinitionType = {
|
|
16
|
+
type: string,
|
|
17
|
+
uri: string,
|
|
18
|
+
params: {
|
|
19
|
+
expectedType: string
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type ComponentsType = {}
|
|
24
|
+
|
|
25
|
+
export type FieldChangeType = {
|
|
26
|
+
text: string,
|
|
27
|
+
href: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type FieldErrorType = {
|
|
31
|
+
text: string,
|
|
32
|
+
href: string
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare module '@modernpoacher/gremlins/gremlins' {
|
|
37
|
+
import React from 'react'
|
|
38
|
+
|
|
39
|
+
export type FieldGremlinProps = {
|
|
40
|
+
id: string,
|
|
41
|
+
name: string,
|
|
42
|
+
required: boolean,
|
|
43
|
+
disabled: boolean,
|
|
44
|
+
readOnly: boolean,
|
|
45
|
+
placeholder: string,
|
|
46
|
+
onChange: FieldGremlinsTypes.OnChangeType,
|
|
47
|
+
fieldRef: object
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export class FieldGremlin extends React.Component<FieldGremlinProps> {}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
declare module '@modernpoacher/gremlins/gremlins/checkbox' {
|
|
54
|
+
import { FieldGremlin as Gremlin } from '@modernpoacher/gremlins/gremlins'
|
|
55
|
+
|
|
56
|
+
export default class CheckboxGremlin extends Gremlin {}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
declare module '@modernpoacher/gremlins/gremlins/email' {
|
|
60
|
+
import { FieldGremlin as Gremlin } from '@modernpoacher/gremlins/gremlins'
|
|
61
|
+
|
|
62
|
+
export default class EmailGremlin extends Gremlin {}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
declare module '@modernpoacher/gremlins/gremlins/number' {
|
|
66
|
+
import { FieldGremlin as Gremlin } from '@modernpoacher/gremlins/gremlins'
|
|
67
|
+
|
|
68
|
+
export default class NumberGremlin extends Gremlin {}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare module '@modernpoacher/gremlins/gremlins/password' {
|
|
72
|
+
import { FieldGremlin as Gremlin } from '@modernpoacher/gremlins/gremlins'
|
|
73
|
+
|
|
74
|
+
export default class PasswordGremlin extends Gremlin {}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
declare module '@modernpoacher/gremlins/gremlins/radio' {
|
|
78
|
+
import { FieldGremlin as Gremlin } from '@modernpoacher/gremlins/gremlins'
|
|
79
|
+
|
|
80
|
+
export default class RadioGremlin extends Gremlin {}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
declare module '@modernpoacher/gremlins/gremlins/select' {
|
|
84
|
+
import { FieldGremlin as Gremlin } from '@modernpoacher/gremlins/gremlins'
|
|
85
|
+
|
|
86
|
+
export default class SelectGremlin extends Gremlin {}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
declare module '@modernpoacher/gremlins/gremlins/text' {
|
|
90
|
+
import { FieldGremlin as Gremlin } from '@modernpoacher/gremlins/gremlins'
|
|
91
|
+
|
|
92
|
+
export default class TextGremlin extends Gremlin {}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
declare module '@modernpoacher/gremlins/gremlins/textarea' {
|
|
96
|
+
import { FieldGremlin as Gremlin } from '@modernpoacher/gremlins/gremlins'
|
|
97
|
+
|
|
98
|
+
export default class TextareaGremlin extends Gremlin {}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
declare module '@modernpoacher/gremlins/components/common/disabled' {
|
|
102
|
+
import React from 'react'
|
|
103
|
+
|
|
104
|
+
export default function Disabled(): React.JSX.Element
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
declare module '@modernpoacher/gremlins/components/common/readonly' {
|
|
108
|
+
import React from 'react'
|
|
109
|
+
|
|
110
|
+
export default function ReadOnly(): React.JSX.Element
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
declare module '@modernpoacher/gremlins/components/common/required' {
|
|
114
|
+
import React from 'react'
|
|
115
|
+
|
|
116
|
+
export default function Required(): React.JSX.Element
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
declare module '@modernpoacher/gremlins/components/common/text-content' {
|
|
120
|
+
import React from 'react'
|
|
121
|
+
|
|
122
|
+
export type TextContentProps = {
|
|
123
|
+
textContent: string
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export default function TextContent(props: TextContentProps): React.JSX.Element
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
declare module '@modernpoacher/gremlins/components/field' {
|
|
130
|
+
import React from 'react'
|
|
131
|
+
|
|
132
|
+
export type FieldProps = {
|
|
133
|
+
id: string,
|
|
134
|
+
name: string,
|
|
135
|
+
required: boolean,
|
|
136
|
+
disabled: boolean,
|
|
137
|
+
readOnly: boolean,
|
|
138
|
+
tabIndex: number,
|
|
139
|
+
accessKey: string,
|
|
140
|
+
placeholder: string,
|
|
141
|
+
onChange: FieldGremlinsTypes.OnChangeType,
|
|
142
|
+
fieldRef: object
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export default class Field extends React.Component<FieldProps> {}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
declare module '@modernpoacher/gremlins/gremlins/checkbox/field' {
|
|
149
|
+
import Field from '@modernpoacher/gremlins/components/field'
|
|
150
|
+
|
|
151
|
+
export default class CheckboxField extends Field {}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
declare module '@modernpoacher/gremlins/gremlins/email/field' {
|
|
155
|
+
import Field from '@modernpoacher/gremlins/components/field'
|
|
156
|
+
|
|
157
|
+
export default class EmailField extends Field {}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
declare module '@modernpoacher/gremlins/gremlins/number/field' {
|
|
161
|
+
import Field from '@modernpoacher/gremlins/components/field'
|
|
162
|
+
|
|
163
|
+
export default class NumberField extends Field {}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
declare module '@modernpoacher/gremlins/gremlins/password/field' {
|
|
167
|
+
import Field from '@modernpoacher/gremlins/components/field'
|
|
168
|
+
|
|
169
|
+
export default class PasswordField extends Field {}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
declare module '@modernpoacher/gremlins/gremlins/radio/field' {
|
|
173
|
+
import Field from '@modernpoacher/gremlins/components/field'
|
|
174
|
+
|
|
175
|
+
export default class RadioField extends Field {}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
declare module '@modernpoacher/gremlins/gremlins/select/field' {
|
|
179
|
+
import Field from '@modernpoacher/gremlins/components/field'
|
|
180
|
+
|
|
181
|
+
export default class SelectField extends Field {}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
declare module '@modernpoacher/gremlins/gremlins/text/field' {
|
|
185
|
+
import Field from '@modernpoacher/gremlins/components/field'
|
|
186
|
+
|
|
187
|
+
export default class TextField extends Field {}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
declare module '@modernpoacher/gremlins/gremlins/textarea/field' {
|
|
191
|
+
import Field from '@modernpoacher/gremlins/components/field'
|
|
192
|
+
|
|
193
|
+
export default class TextareaField extends Field {}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
declare namespace GroupGremlinsTypes {
|
|
197
|
+
export type OnChangeType = () => void
|
|
198
|
+
|
|
199
|
+
export type ComponentsType = {}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
declare module '@modernpoacher/gremlins/components/group' {
|
|
203
|
+
import React from 'react'
|
|
204
|
+
|
|
205
|
+
export type GroupProps = {
|
|
206
|
+
onChange: GroupGremlinsTypes.OnChangeType,
|
|
207
|
+
groupRef: object,
|
|
208
|
+
children: React.JSX.Element | React.JSX.Element[]
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export default class Group extends React.Component<GroupProps> {}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
declare module '@modernpoacher/gremlins/gremlins/fieldset/group' {
|
|
215
|
+
import Group from '@modernpoacher/gremlins/components/group'
|
|
216
|
+
|
|
217
|
+
export default class FieldsetGroup extends Group {}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
declare module '@modernpoacher/gremlins/gremlins/fieldset' {
|
|
221
|
+
import { GroupGremlin as Gremlin } from '@modernpoacher/gremlins/gremlins'
|
|
222
|
+
|
|
223
|
+
export default class FieldsetGremlin extends Gremlin {}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
declare module '@modernpoacher/gremlins/gremlins' {
|
|
227
|
+
import React from 'react'
|
|
228
|
+
|
|
229
|
+
export type GroupGremlinProps = {
|
|
230
|
+
title: string,
|
|
231
|
+
onChange: GroupGremlinsTypes.OnChangeType,
|
|
232
|
+
groupRef: object,
|
|
233
|
+
children: React.JSX.Element | React.JSX.Element[]
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export class GroupGremlin extends React.Component<GroupGremlinProps> {}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
declare module '@modernpoacher/gremlins' {
|
|
240
|
+
export { default as CheckboxGremlin } from '@modernpoacher/gremlins/gremlins/checkbox'
|
|
241
|
+
export { default as EmailGremlin } from '@modernpoacher/gremlins/gremlins/email'
|
|
242
|
+
export { default as NumberGremlin } from '@modernpoacher/gremlins/gremlins/number'
|
|
243
|
+
export { default as PasswordGremlin } from '@modernpoacher/gremlins/gremlins/password'
|
|
244
|
+
export { default as RadioGremlin } from '@modernpoacher/gremlins/gremlins/radio'
|
|
245
|
+
export { default as SelectGremlin } from '@modernpoacher/gremlins/gremlins/select'
|
|
246
|
+
export { default as TextGremlin } from '@modernpoacher/gremlins/gremlins/text'
|
|
247
|
+
export { default as TextareaGremlin } from '@modernpoacher/gremlins/gremlins/textarea'
|
|
248
|
+
export { default as FieldsetGremlin } from '@modernpoacher/gremlins/gremlins/fieldset'
|
|
249
|
+
}
|