shinkansen-cogs 1.8.20 → 1.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/eslint.config.mjs +16 -3
- package/index.d.mts +116 -104
- package/package.json +38 -7
- package/src/cogs/checkbox/description/index.cjs +5 -2
- package/src/cogs/checkbox/description/index.jsx +1 -1
- package/src/cogs/checkbox/error-message/index.cjs +5 -2
- package/src/cogs/checkbox/error-message/index.jsx +1 -1
- package/src/cogs/checkbox/field/index.cjs +5 -2
- package/src/cogs/checkbox/field/index.jsx +1 -1
- package/src/cogs/checkbox/index.cjs +5 -2
- package/src/cogs/checkbox/index.d.mts +1 -1
- package/src/cogs/checkbox/index.jsx +13 -10
- package/src/cogs/checkbox/title/index.cjs +5 -2
- package/src/cogs/checkbox/title/index.jsx +2 -2
- package/src/cogs/email/description/index.cjs +5 -2
- package/src/cogs/email/description/index.jsx +1 -1
- package/src/cogs/email/error-message/index.cjs +5 -2
- package/src/cogs/email/error-message/index.jsx +1 -1
- package/src/cogs/email/field/index.cjs +5 -2
- package/src/cogs/email/field/index.jsx +1 -1
- package/src/cogs/email/index.cjs +5 -2
- package/src/cogs/email/index.d.mts +1 -1
- package/src/cogs/email/index.jsx +12 -8
- package/src/cogs/email/title/index.cjs +5 -2
- package/src/cogs/email/title/index.jsx +2 -2
- package/src/cogs/index.cjs +7 -5
- package/src/cogs/index.d.cts +0 -1
- package/src/cogs/index.d.mts +4 -23
- package/src/cogs/index.jsx +22 -169
- package/src/cogs/number/description/index.cjs +5 -2
- package/src/cogs/number/description/index.jsx +1 -1
- package/src/cogs/number/error-message/index.cjs +5 -2
- package/src/cogs/number/error-message/index.jsx +1 -1
- package/src/cogs/number/field/index.cjs +5 -2
- package/src/cogs/number/field/index.jsx +1 -1
- package/src/cogs/number/index.cjs +5 -2
- package/src/cogs/number/index.d.mts +1 -1
- package/src/cogs/number/index.jsx +12 -8
- package/src/cogs/number/title/index.cjs +5 -2
- package/src/cogs/number/title/index.jsx +2 -2
- package/src/cogs/password/description/index.cjs +5 -2
- package/src/cogs/password/description/index.jsx +1 -1
- package/src/cogs/password/error-message/index.cjs +5 -2
- package/src/cogs/password/error-message/index.jsx +1 -1
- package/src/cogs/password/field/index.cjs +5 -2
- package/src/cogs/password/field/index.jsx +1 -1
- package/src/cogs/password/index.cjs +5 -2
- package/src/cogs/password/index.d.mts +1 -1
- package/src/cogs/password/index.jsx +12 -8
- package/src/cogs/password/title/index.cjs +5 -2
- package/src/cogs/password/title/index.jsx +2 -2
- package/src/cogs/radio/description/index.cjs +5 -2
- package/src/cogs/radio/description/index.jsx +1 -1
- package/src/cogs/radio/error-message/index.cjs +5 -2
- package/src/cogs/radio/error-message/index.jsx +1 -1
- package/src/cogs/radio/field/index.cjs +5 -2
- package/src/cogs/radio/field/index.jsx +1 -1
- package/src/cogs/radio/index.cjs +5 -2
- package/src/cogs/radio/index.d.mts +1 -1
- package/src/cogs/radio/index.jsx +13 -10
- package/src/cogs/radio/title/index.cjs +5 -2
- package/src/cogs/radio/title/index.jsx +2 -2
- package/src/cogs/select/description/index.cjs +5 -2
- package/src/cogs/select/description/index.jsx +1 -1
- package/src/cogs/select/error-message/index.cjs +5 -2
- package/src/cogs/select/error-message/index.jsx +1 -1
- package/src/cogs/select/field/index.cjs +5 -2
- package/src/cogs/select/field/index.jsx +9 -5
- package/src/cogs/select/index.cjs +5 -2
- package/src/cogs/select/index.d.mts +1 -1
- package/src/cogs/select/index.jsx +12 -8
- package/src/cogs/select/title/index.cjs +5 -2
- package/src/cogs/select/title/index.jsx +2 -2
- package/src/cogs/text/description/index.cjs +5 -2
- package/src/cogs/text/description/index.jsx +1 -1
- package/src/cogs/text/error-message/index.cjs +5 -2
- package/src/cogs/text/error-message/index.jsx +1 -1
- package/src/cogs/text/field/index.cjs +5 -2
- package/src/cogs/text/field/index.jsx +1 -1
- package/src/cogs/text/index.cjs +5 -2
- package/src/cogs/text/index.d.mts +1 -1
- package/src/cogs/text/index.jsx +12 -8
- package/src/cogs/text/title/index.cjs +5 -2
- package/src/cogs/text/title/index.jsx +2 -2
- package/src/cogs/textarea/description/index.cjs +5 -2
- package/src/cogs/textarea/description/index.jsx +1 -1
- package/src/cogs/textarea/error-message/index.cjs +5 -2
- package/src/cogs/textarea/error-message/index.jsx +1 -1
- package/src/cogs/textarea/field/index.cjs +5 -2
- package/src/cogs/textarea/field/index.jsx +1 -1
- package/src/cogs/textarea/index.cjs +5 -2
- package/src/cogs/textarea/index.d.mts +1 -1
- package/src/cogs/textarea/index.jsx +12 -8
- package/src/cogs/textarea/title/index.cjs +5 -2
- package/src/cogs/textarea/title/index.jsx +2 -2
- package/src/common/index.d.mts +1 -7
- package/src/common/index.mjs +1 -5
- package/src/components/common/disabled/index.cjs +5 -2
- package/src/components/common/readonly/index.cjs +5 -2
- package/src/components/common/required/index.cjs +5 -2
- package/src/components/common/text-content/index.cjs +5 -2
- package/src/components/common/text-content/index.jsx +1 -1
- package/src/components/description/index.cjs +5 -2
- package/src/components/description/index.d.mts +1 -1
- package/src/components/description/index.jsx +2 -44
- package/src/components/error-message/index.cjs +5 -2
- package/src/components/error-message/index.d.mts +2 -21
- package/src/components/error-message/index.jsx +2 -118
- package/src/components/field/index.cjs +9 -3
- package/src/components/field/index.d.cts +0 -1
- package/src/components/field/index.d.mts +3 -11
- package/src/components/field/index.jsx +18 -75
- package/src/components/index.cjs +25 -5
- package/src/components/index.d.cts +4 -4
- package/src/components/index.d.mts +4 -4
- package/src/components/index.mjs +4 -4
- package/src/components/title/index.cjs +2 -2
- package/src/components/title/index.d.mts +2 -23
- package/src/components/title/index.jsx +2 -118
- package/src/super/cogs/index.cjs +20 -0
- package/src/super/cogs/index.d.cts +2 -0
- package/src/super/cogs/index.d.mts +28 -0
- package/src/super/cogs/index.jsx +179 -0
- package/src/super/components/description/index.cjs +20 -0
- package/src/super/components/description/index.d.cts +2 -0
- package/src/super/components/description/index.d.mts +18 -0
- package/src/super/components/description/index.jsx +47 -0
- package/src/super/components/error-message/index.cjs +20 -0
- package/src/super/components/error-message/index.d.cts +2 -0
- package/src/super/components/error-message/index.d.mts +28 -0
- package/src/super/components/error-message/index.jsx +121 -0
- package/src/super/components/field/index.cjs +20 -0
- package/src/super/components/field/index.d.cts +2 -0
- package/src/super/components/field/index.d.mts +18 -0
- package/src/super/components/field/index.jsx +74 -0
- package/src/super/components/index.cjs +32 -0
- package/src/super/components/index.d.cts +4 -0
- package/src/super/components/index.d.mts +4 -0
- package/src/super/components/index.mjs +10 -0
- package/src/super/components/title/index.cjs +20 -0
- package/src/super/components/title/index.d.cts +2 -0
- package/src/super/components/title/index.d.mts +30 -0
- package/src/super/components/title/index.jsx +121 -0
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-cogs/cogs/email/field')
|
|
|
11
11
|
log('`shinkansen` is awake')
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
|
-
default:
|
|
14
|
+
default: Field // @ts-expect-error
|
|
15
15
|
} = require('./index.jsx')
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Exports only default
|
|
19
|
+
*/
|
|
20
|
+
module.exports = Field
|
package/src/cogs/email/index.cjs
CHANGED
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-cogs/cogs/email')
|
|
|
11
11
|
log('`shinkansen` is awake')
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
|
-
default:
|
|
14
|
+
default: Email // @ts-expect-error
|
|
15
15
|
} = require('./index.jsx')
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Exports only default
|
|
19
|
+
*/
|
|
20
|
+
module.exports = Email
|
|
@@ -3,7 +3,7 @@ declare module '#cogs/cogs/email' {
|
|
|
3
3
|
ValueCog
|
|
4
4
|
} from '#cogs/cogs'
|
|
5
5
|
|
|
6
|
-
export type EmailProps = CogsTypes.Cogs.
|
|
6
|
+
export type EmailProps = CogsTypes.Cogs.Email.EmailProps
|
|
7
7
|
|
|
8
8
|
export default class EmailCog<P extends EmailProps> extends ValueCog<P> {
|
|
9
9
|
handleChange (
|
package/src/cogs/email/index.jsx
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {CogsTypes.
|
|
3
|
-
* @typedef {CogsTypes.Cogs.
|
|
2
|
+
* @typedef {CogsTypes.OnEventType} OnEventType
|
|
3
|
+
* @typedef {CogsTypes.Cogs.ValueProps} ValueProps
|
|
4
|
+
* @typedef {CogsTypes.Cogs.Email.EmailProps} EmailProps
|
|
4
5
|
*/
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* EmailCog component
|
|
8
9
|
*/
|
|
9
10
|
import React from 'react'
|
|
10
11
|
import classnames from 'classnames'
|
|
@@ -13,15 +14,18 @@ import {
|
|
|
13
14
|
ValueCog
|
|
14
15
|
} from '#cogs/cogs'
|
|
15
16
|
|
|
16
|
-
import {
|
|
17
|
-
DEFAULT_HANDLE_CHANGE
|
|
18
|
-
} from '#cogs/common'
|
|
19
|
-
|
|
20
17
|
import Title from '#cogs/cogs/email/title'
|
|
21
18
|
import Description from '#cogs/cogs/email/description'
|
|
22
19
|
import ErrorMessage from '#cogs/cogs/email/error-message'
|
|
23
20
|
import Field from '#cogs/cogs/email/field'
|
|
24
21
|
|
|
22
|
+
/**
|
|
23
|
+
* @type {OnEventType}
|
|
24
|
+
*/
|
|
25
|
+
function DEFAULT_HANDLE_EVENT () {
|
|
26
|
+
//
|
|
27
|
+
}
|
|
28
|
+
|
|
25
29
|
/**
|
|
26
30
|
* @extends {ValueCog<ValueProps & EmailProps>}
|
|
27
31
|
*/
|
|
@@ -36,7 +40,7 @@ export default class EmailCog extends ValueCog {
|
|
|
36
40
|
*/
|
|
37
41
|
handleChange = (name, value) => {
|
|
38
42
|
const {
|
|
39
|
-
onChange =
|
|
43
|
+
onChange = DEFAULT_HANDLE_EVENT
|
|
40
44
|
} = this.props
|
|
41
45
|
|
|
42
46
|
onChange(name, value)
|
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-cogs/cogs/email/title')
|
|
|
11
11
|
log('`shinkansen` is awake')
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
|
-
default:
|
|
14
|
+
default: Title // @ts-expect-error
|
|
15
15
|
} = require('./index.jsx')
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Exports only default
|
|
19
|
+
*/
|
|
20
|
+
module.exports = Title
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {CogsTypes.Components.Title.TitleProps} TitleProps
|
|
2
|
+
* @typedef {CogsTypes.Super.Components.Title.TitleProps} TitleProps
|
|
3
3
|
* @typedef {CogsTypes.Components.Title.Email.EmailProps} EmailProps
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* EmailTitle component
|
|
8
8
|
*/
|
|
9
9
|
import classnames from 'classnames'
|
|
10
10
|
import Title from '#cogs/components/title'
|
package/src/cogs/index.cjs
CHANGED
|
@@ -10,8 +10,10 @@ const log = debug('shinkansen-cogs/cogs')
|
|
|
10
10
|
|
|
11
11
|
log('`shinkansen` is awake')
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
const {
|
|
14
|
+
ValueCog,
|
|
15
|
+
CheckCog // @ts-expect-error
|
|
16
|
+
} = require('./index.jsx')
|
|
17
|
+
|
|
18
|
+
module.exports.ValueCog = ValueCog
|
|
19
|
+
module.exports.CheckCog = CheckCog
|
package/src/cogs/index.d.cts
CHANGED
package/src/cogs/index.d.mts
CHANGED
|
@@ -1,27 +1,9 @@
|
|
|
1
1
|
declare module '#cogs/cogs' {
|
|
2
|
-
import
|
|
2
|
+
import Cog from '#cogs/super/cogs'
|
|
3
3
|
|
|
4
|
-
export type CogProps = CogsTypes.Cogs.
|
|
5
|
-
export type ValueProps = CogsTypes.Cogs.
|
|
6
|
-
export type CheckProps = CogsTypes.Cogs.
|
|
7
|
-
|
|
8
|
-
export default class Cog<P extends CogProps> extends React.Component<P> {
|
|
9
|
-
static propTypes: Record<PropertyKey, unknown>
|
|
10
|
-
|
|
11
|
-
getClassName (): string
|
|
12
|
-
|
|
13
|
-
getId (): string
|
|
14
|
-
|
|
15
|
-
shouldComponentUpdate (props: CogProps): boolean
|
|
16
|
-
|
|
17
|
-
renderTitle (): React.JSX.Element | null
|
|
18
|
-
|
|
19
|
-
renderDescription (): React.JSX.Element | null
|
|
20
|
-
|
|
21
|
-
renderErrorMessage (): React.JSX.Element | null
|
|
22
|
-
|
|
23
|
-
renderField (): React.JSX.Element | null
|
|
24
|
-
}
|
|
4
|
+
export type CogProps = CogsTypes.Super.Cogs.CogProps
|
|
5
|
+
export type ValueProps = CogsTypes.Cogs.ValueProps
|
|
6
|
+
export type CheckProps = CogsTypes.Cogs.CheckProps
|
|
25
7
|
|
|
26
8
|
export class ValueCog<P extends ValueProps> extends Cog<P> {
|
|
27
9
|
shouldComponentUpdate (props: ValueProps): boolean
|
|
@@ -33,6 +15,5 @@ declare module '#cogs/cogs' {
|
|
|
33
15
|
}
|
|
34
16
|
|
|
35
17
|
declare module 'shinkansen-cogs/cogs' {
|
|
36
|
-
export { default } from '#cogs/cogs'
|
|
37
18
|
export * from '#cogs/cogs'
|
|
38
19
|
}
|
package/src/cogs/index.jsx
CHANGED
|
@@ -1,183 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {CogsTypes.
|
|
3
|
-
* @typedef {CogsTypes.Cogs.
|
|
4
|
-
* @typedef {CogsTypes.Cogs.
|
|
2
|
+
* @typedef {CogsTypes.OnEventType} OnEventType
|
|
3
|
+
* @typedef {CogsTypes.Super.Cogs.CogProps} CogProps
|
|
4
|
+
* @typedef {CogsTypes.Cogs.ValueProps} ValueProps
|
|
5
|
+
* @typedef {CogsTypes.Cogs.CheckProps} CheckProps
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* Cog component
|
|
9
10
|
*/
|
|
10
|
-
import React
|
|
11
|
+
import React from 'react'
|
|
11
12
|
import PropTypes from 'prop-types'
|
|
12
|
-
import classnames from 'classnames'
|
|
13
13
|
|
|
14
|
-
import
|
|
15
|
-
DEFAULT_HANDLE_CHANGE,
|
|
16
|
-
DEFAULT_HANDLE_CLICK
|
|
17
|
-
} from '#cogs/common'
|
|
14
|
+
import Cog from '#cogs/super/cogs'
|
|
18
15
|
|
|
19
|
-
import
|
|
20
|
-
import Description from '#cogs/components/description'
|
|
21
|
-
import ErrorMessage from '#cogs/components/error-message'
|
|
22
|
-
import Field, {
|
|
16
|
+
import {
|
|
23
17
|
ValueField,
|
|
24
18
|
CheckField
|
|
25
19
|
} from '#cogs/components/field'
|
|
26
20
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
readOnly = false,
|
|
33
|
-
errorMessage
|
|
34
|
-
} = this.props
|
|
35
|
-
|
|
36
|
-
return classnames('cog', { required, disabled, readOnly, error: !!errorMessage })
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
getId () {
|
|
40
|
-
const {
|
|
41
|
-
id,
|
|
42
|
-
name
|
|
43
|
-
} = this.props
|
|
44
|
-
|
|
45
|
-
return id || name
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @param {CogProps} props
|
|
50
|
-
* @returns {boolean}
|
|
51
|
-
*/
|
|
52
|
-
shouldComponentUpdate (props) {
|
|
53
|
-
return (
|
|
54
|
-
(props.name !== this.props.name) ||
|
|
55
|
-
(props.id !== this.props.id) ||
|
|
56
|
-
(props.title !== this.props.title) ||
|
|
57
|
-
(props.description !== this.props.description) ||
|
|
58
|
-
(props.errorMessage !== this.props.errorMessage) ||
|
|
59
|
-
(props.required !== this.props.required) ||
|
|
60
|
-
(props.disabled !== this.props.disabled) ||
|
|
61
|
-
(props.readOnly !== this.props.readOnly) ||
|
|
62
|
-
(props.tabIndex !== this.props.tabIndex) ||
|
|
63
|
-
(props.accessKey !== this.props.accessKey) ||
|
|
64
|
-
(props.placeholder !== this.props.placeholder) ||
|
|
65
|
-
(props.onChange !== this.props.onChange)
|
|
66
|
-
)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
renderTitle () {
|
|
70
|
-
const id = this.getId()
|
|
71
|
-
|
|
72
|
-
const {
|
|
73
|
-
title,
|
|
74
|
-
required = false,
|
|
75
|
-
disabled = false,
|
|
76
|
-
readOnly = false
|
|
77
|
-
} = this.props
|
|
78
|
-
|
|
79
|
-
return (
|
|
80
|
-
<Title
|
|
81
|
-
id={id}
|
|
82
|
-
title={title}
|
|
83
|
-
required={required}
|
|
84
|
-
disabled={disabled}
|
|
85
|
-
readOnly={readOnly}
|
|
86
|
-
/>
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
renderDescription () {
|
|
91
|
-
const {
|
|
92
|
-
description
|
|
93
|
-
} = this.props
|
|
94
|
-
|
|
95
|
-
return (
|
|
96
|
-
<Description
|
|
97
|
-
description={description}
|
|
98
|
-
/>
|
|
99
|
-
)
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
renderErrorMessage () {
|
|
103
|
-
const {
|
|
104
|
-
errorMessage
|
|
105
|
-
} = this.props
|
|
106
|
-
|
|
107
|
-
return (
|
|
108
|
-
<ErrorMessage
|
|
109
|
-
errorMessage={errorMessage}
|
|
110
|
-
/>
|
|
111
|
-
)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
renderField () {
|
|
115
|
-
const id = this.getId()
|
|
116
|
-
|
|
117
|
-
const {
|
|
118
|
-
name,
|
|
119
|
-
required = false,
|
|
120
|
-
disabled = false,
|
|
121
|
-
readOnly = false,
|
|
122
|
-
tabIndex,
|
|
123
|
-
accessKey,
|
|
124
|
-
placeholder,
|
|
125
|
-
onChange = DEFAULT_HANDLE_CHANGE,
|
|
126
|
-
fieldRef
|
|
127
|
-
} = this.props
|
|
128
|
-
|
|
129
|
-
return (
|
|
130
|
-
<Field
|
|
131
|
-
id={id}
|
|
132
|
-
name={name}
|
|
133
|
-
required={required}
|
|
134
|
-
disabled={disabled}
|
|
135
|
-
readOnly={readOnly}
|
|
136
|
-
tabIndex={tabIndex}
|
|
137
|
-
accessKey={accessKey}
|
|
138
|
-
placeholder={placeholder}
|
|
139
|
-
onChange={onChange}
|
|
140
|
-
fieldRef={fieldRef}
|
|
141
|
-
/>
|
|
142
|
-
)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
render () {
|
|
146
|
-
const className = this.getClassName()
|
|
147
|
-
|
|
148
|
-
return (
|
|
149
|
-
<div className={className}>
|
|
150
|
-
{this.renderTitle()}
|
|
151
|
-
{this.renderDescription()}
|
|
152
|
-
{this.renderErrorMessage()}
|
|
153
|
-
{this.renderField()}
|
|
154
|
-
</div>
|
|
155
|
-
)
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
Cog.propTypes = {
|
|
160
|
-
id: PropTypes.string,
|
|
161
|
-
name: PropTypes.string.isRequired,
|
|
162
|
-
title: PropTypes.string,
|
|
163
|
-
description: PropTypes.string,
|
|
164
|
-
errorMessage: PropTypes.shape({
|
|
165
|
-
type: PropTypes.string.isRequired,
|
|
166
|
-
params: PropTypes.shape({}).isRequired,
|
|
167
|
-
uri: PropTypes.string.isRequired
|
|
168
|
-
}),
|
|
169
|
-
required: PropTypes.bool,
|
|
170
|
-
disabled: PropTypes.bool,
|
|
171
|
-
readOnly: PropTypes.bool,
|
|
172
|
-
tabIndex: PropTypes.number,
|
|
173
|
-
accessKey: PropTypes.string,
|
|
174
|
-
placeholder: PropTypes.string,
|
|
175
|
-
onChange: PropTypes.func,
|
|
176
|
-
fieldRef: PropTypes.shape({
|
|
177
|
-
current: PropTypes.shape({}).isRequired
|
|
178
|
-
})
|
|
21
|
+
/**
|
|
22
|
+
* @type {OnEventType}
|
|
23
|
+
*/
|
|
24
|
+
function DEFAULT_HANDLE_EVENT () {
|
|
25
|
+
//
|
|
179
26
|
}
|
|
180
27
|
|
|
28
|
+
/**
|
|
29
|
+
* @extends {Cog<CogProps & ValueProps>}
|
|
30
|
+
*/
|
|
181
31
|
export class ValueCog extends Cog {
|
|
182
32
|
/**
|
|
183
33
|
* @param {ValueProps} props
|
|
@@ -208,7 +58,7 @@ export class ValueCog extends Cog {
|
|
|
208
58
|
tabIndex,
|
|
209
59
|
accessKey,
|
|
210
60
|
placeholder,
|
|
211
|
-
onChange =
|
|
61
|
+
onChange = DEFAULT_HANDLE_EVENT,
|
|
212
62
|
fieldRef
|
|
213
63
|
} = this.props
|
|
214
64
|
|
|
@@ -235,6 +85,9 @@ ValueCog.propTypes = {
|
|
|
235
85
|
defaultValue: PropTypes.string
|
|
236
86
|
}
|
|
237
87
|
|
|
88
|
+
/**
|
|
89
|
+
* @extends {Cog<CogProps & CheckProps>}
|
|
90
|
+
*/
|
|
238
91
|
export class CheckCog extends Cog {
|
|
239
92
|
/**
|
|
240
93
|
* @param {CheckProps} props
|
|
@@ -267,8 +120,8 @@ export class CheckCog extends Cog {
|
|
|
267
120
|
tabIndex,
|
|
268
121
|
accessKey,
|
|
269
122
|
placeholder,
|
|
270
|
-
onChange =
|
|
271
|
-
onClick =
|
|
123
|
+
onChange = DEFAULT_HANDLE_EVENT,
|
|
124
|
+
onClick = DEFAULT_HANDLE_EVENT,
|
|
272
125
|
fieldRef
|
|
273
126
|
} = this.props
|
|
274
127
|
|
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-cogs/cogs/number/description')
|
|
|
11
11
|
log('`shinkansen` is awake')
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
|
-
default:
|
|
14
|
+
default: Description // @ts-expect-error
|
|
15
15
|
} = require('./index.jsx')
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Exports only default
|
|
19
|
+
*/
|
|
20
|
+
module.exports = Description
|
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-cogs/cogs/number/error-message')
|
|
|
11
11
|
log('`shinkansen` is awake')
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
|
-
default:
|
|
14
|
+
default: ErrorMessage // @ts-expect-error
|
|
15
15
|
} = require('./index.jsx')
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Exports only default
|
|
19
|
+
*/
|
|
20
|
+
module.exports = ErrorMessage
|
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-cogs/cogs/number/field')
|
|
|
11
11
|
log('`shinkansen` is awake')
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
|
-
default:
|
|
14
|
+
default: Field // @ts-expect-error
|
|
15
15
|
} = require('./index.jsx')
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Exports only default
|
|
19
|
+
*/
|
|
20
|
+
module.exports = Field
|
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-cogs/cogs/number')
|
|
|
11
11
|
log('`shinkansen` is awake')
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
|
-
default:
|
|
14
|
+
default: Number // @ts-expect-error
|
|
15
15
|
} = require('./index.jsx')
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Exports only default
|
|
19
|
+
*/
|
|
20
|
+
module.exports = Number
|
|
@@ -3,7 +3,7 @@ declare module '#cogs/cogs/number' {
|
|
|
3
3
|
ValueCog
|
|
4
4
|
} from '#cogs/cogs'
|
|
5
5
|
|
|
6
|
-
export type NumberProps = CogsTypes.Cogs.
|
|
6
|
+
export type NumberProps = CogsTypes.Cogs.Number.NumberProps
|
|
7
7
|
|
|
8
8
|
export default class NumberCog<P extends NumberProps> extends ValueCog<Omit<Omit<P, 'value'>, 'defaultValue'>> {
|
|
9
9
|
handleChange (
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {CogsTypes.
|
|
3
|
-
* @typedef {CogsTypes.Cogs.
|
|
2
|
+
* @typedef {CogsTypes.OnEventType} OnEventType
|
|
3
|
+
* @typedef {CogsTypes.Cogs.ValueProps} ValueProps
|
|
4
|
+
* @typedef {CogsTypes.Cogs.Number.NumberProps} NumberProps
|
|
4
5
|
*/
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* NumberCog component
|
|
8
9
|
*/
|
|
9
10
|
import React from 'react'
|
|
10
11
|
import PropTypes from 'prop-types'
|
|
@@ -14,15 +15,18 @@ import {
|
|
|
14
15
|
ValueCog
|
|
15
16
|
} from '#cogs/cogs'
|
|
16
17
|
|
|
17
|
-
import {
|
|
18
|
-
DEFAULT_HANDLE_CHANGE
|
|
19
|
-
} from '#cogs/common'
|
|
20
|
-
|
|
21
18
|
import Title from '#cogs/cogs/number/title'
|
|
22
19
|
import Description from '#cogs/cogs/number/description'
|
|
23
20
|
import ErrorMessage from '#cogs/cogs/number/error-message'
|
|
24
21
|
import Field from '#cogs/cogs/number/field'
|
|
25
22
|
|
|
23
|
+
/**
|
|
24
|
+
* @type {OnEventType}
|
|
25
|
+
*/
|
|
26
|
+
function DEFAULT_HANDLE_EVENT () {
|
|
27
|
+
//
|
|
28
|
+
}
|
|
29
|
+
|
|
26
30
|
/**
|
|
27
31
|
* @extends {ValueCog<ValueProps & NumberProps>}
|
|
28
32
|
*/
|
|
@@ -37,7 +41,7 @@ export default class NumberCog extends ValueCog {
|
|
|
37
41
|
*/
|
|
38
42
|
handleChange = (name, value) => {
|
|
39
43
|
const {
|
|
40
|
-
onChange =
|
|
44
|
+
onChange = DEFAULT_HANDLE_EVENT
|
|
41
45
|
} = this.props
|
|
42
46
|
|
|
43
47
|
onChange(name, value)
|
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-cogs/cogs/number/title')
|
|
|
11
11
|
log('`shinkansen` is awake')
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
|
-
default:
|
|
14
|
+
default: Title // @ts-expect-error
|
|
15
15
|
} = require('./index.jsx')
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Exports only default
|
|
19
|
+
*/
|
|
20
|
+
module.exports = Title
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {CogsTypes.Components.Title.TitleProps} TitleProps
|
|
2
|
+
* @typedef {CogsTypes.Super.Components.Title.TitleProps} TitleProps
|
|
3
3
|
* @typedef {CogsTypes.Components.Title.Number.NumberProps} NumberProps
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* NumberTitle component
|
|
8
8
|
*/
|
|
9
9
|
import classnames from 'classnames'
|
|
10
10
|
import Title from '#cogs/components/title'
|
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-cogs/cogs/password/description')
|
|
|
11
11
|
log('`shinkansen` is awake')
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
|
-
default:
|
|
14
|
+
default: Description // @ts-expect-error
|
|
15
15
|
} = require('./index.jsx')
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Exports only default
|
|
19
|
+
*/
|
|
20
|
+
module.exports = Description
|
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-cogs/cogs/password/error-message')
|
|
|
11
11
|
log('`shinkansen` is awake')
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
|
-
default:
|
|
14
|
+
default: ErrorMessage // @ts-expect-error
|
|
15
15
|
} = require('./index.jsx')
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Exports only default
|
|
19
|
+
*/
|
|
20
|
+
module.exports = ErrorMessage
|
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-cogs/cogs/password/field')
|
|
|
11
11
|
log('`shinkansen` is awake')
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
|
-
default:
|
|
14
|
+
default: Field // @ts-expect-error
|
|
15
15
|
} = require('./index.jsx')
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Exports only default
|
|
19
|
+
*/
|
|
20
|
+
module.exports = Field
|
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-cogs/cogs/password')
|
|
|
11
11
|
log('`shinkansen` is awake')
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
|
-
default:
|
|
14
|
+
default: Password // @ts-expect-error
|
|
15
15
|
} = require('./index.jsx')
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Exports only default
|
|
19
|
+
*/
|
|
20
|
+
module.exports = Password
|
|
@@ -3,7 +3,7 @@ declare module '#cogs/cogs/password' {
|
|
|
3
3
|
ValueCog
|
|
4
4
|
} from '#cogs/cogs'
|
|
5
5
|
|
|
6
|
-
export type PasswordProps = CogsTypes.Cogs.
|
|
6
|
+
export type PasswordProps = CogsTypes.Cogs.Password.PasswordProps
|
|
7
7
|
|
|
8
8
|
export default class PasswordCog<P extends PasswordProps> extends ValueCog<P> {
|
|
9
9
|
handleChange (
|