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
|
@@ -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.Password.PasswordProps} PasswordProps
|
|
4
5
|
*/
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* PasswordCog 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/password/title'
|
|
21
18
|
import Description from '#cogs/cogs/password/description'
|
|
22
19
|
import ErrorMessage from '#cogs/cogs/password/error-message'
|
|
23
20
|
import Field from '#cogs/cogs/password/field'
|
|
24
21
|
|
|
22
|
+
/**
|
|
23
|
+
* @type {OnEventType}
|
|
24
|
+
*/
|
|
25
|
+
function DEFAULT_HANDLE_EVENT () {
|
|
26
|
+
//
|
|
27
|
+
}
|
|
28
|
+
|
|
25
29
|
/**
|
|
26
30
|
* @extends {ValueCog<ValueProps & PasswordProps>}
|
|
27
31
|
*/
|
|
@@ -36,7 +40,7 @@ export default class PasswordCog 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/password/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.Password.PasswordProps} PasswordProps
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* PasswordTitle 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/radio/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/radio/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/radio/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/radio/index.cjs
CHANGED
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-cogs/cogs/radio')
|
|
|
11
11
|
log('`shinkansen` is awake')
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
|
-
default:
|
|
14
|
+
default: Radio // @ts-expect-error
|
|
15
15
|
} = require('./index.jsx')
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Exports only default
|
|
19
|
+
*/
|
|
20
|
+
module.exports = Radio
|
|
@@ -3,7 +3,7 @@ declare module '#cogs/cogs/radio' {
|
|
|
3
3
|
CheckCog
|
|
4
4
|
} from '#cogs/cogs'
|
|
5
5
|
|
|
6
|
-
export type RadioProps = CogsTypes.Cogs.
|
|
6
|
+
export type RadioProps = CogsTypes.Cogs.Radio.RadioProps
|
|
7
7
|
|
|
8
8
|
export default class RadioCog<P extends RadioProps> extends CheckCog<P> {
|
|
9
9
|
handleChange (
|
package/src/cogs/radio/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.CheckProps} CheckProps
|
|
4
|
+
* @typedef {CogsTypes.Cogs.Radio.RadioProps} RadioProps
|
|
4
5
|
*/
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* Radio component
|
|
8
9
|
*/
|
|
9
10
|
import React from 'react'
|
|
10
11
|
import PropTypes from 'prop-types'
|
|
@@ -14,16 +15,18 @@ import {
|
|
|
14
15
|
CheckCog
|
|
15
16
|
} from '#cogs/cogs'
|
|
16
17
|
|
|
17
|
-
import {
|
|
18
|
-
DEFAULT_HANDLE_CHANGE,
|
|
19
|
-
DEFAULT_HANDLE_CLICK
|
|
20
|
-
} from '#cogs/common'
|
|
21
|
-
|
|
22
18
|
import Title from '#cogs/cogs/radio/title'
|
|
23
19
|
import Description from '#cogs/cogs/radio/description'
|
|
24
20
|
import ErrorMessage from '#cogs/cogs/radio/error-message'
|
|
25
21
|
import Field from '#cogs/cogs/radio/field'
|
|
26
22
|
|
|
23
|
+
/**
|
|
24
|
+
* @type {OnEventType}
|
|
25
|
+
*/
|
|
26
|
+
function DEFAULT_HANDLE_EVENT () {
|
|
27
|
+
//
|
|
28
|
+
}
|
|
29
|
+
|
|
27
30
|
/**
|
|
28
31
|
* @extends {CheckCog<CheckProps & RadioProps>}
|
|
29
32
|
*/
|
|
@@ -55,7 +58,7 @@ export default class Radio extends CheckCog {
|
|
|
55
58
|
*/
|
|
56
59
|
handleChange = (name, value, checked) => {
|
|
57
60
|
const {
|
|
58
|
-
onChange =
|
|
61
|
+
onChange = DEFAULT_HANDLE_EVENT
|
|
59
62
|
} = this.props
|
|
60
63
|
|
|
61
64
|
onChange(name, value, checked)
|
|
@@ -68,7 +71,7 @@ export default class Radio extends CheckCog {
|
|
|
68
71
|
*/
|
|
69
72
|
handleClick = (name, value, checked) => {
|
|
70
73
|
const {
|
|
71
|
-
onClick =
|
|
74
|
+
onClick = DEFAULT_HANDLE_EVENT
|
|
72
75
|
} = this.props
|
|
73
76
|
|
|
74
77
|
onClick(name, value, checked)
|
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-cogs/cogs/radio/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.Radio.RadioProps} RadioProps
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* RadioTitle 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/select/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/select/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/select/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
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @typedef {CogsTypes.OnEventType} OnEventType
|
|
2
3
|
* @typedef {CogsTypes.Components.Field.ValueProps} ValueProps
|
|
3
4
|
* @typedef {CogsTypes.Components.Field.Select.SelectProps} SelectProps
|
|
4
5
|
*/
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* SelectField component
|
|
8
9
|
*/
|
|
9
10
|
import React from 'react'
|
|
10
11
|
import PropTypes from 'prop-types'
|
|
@@ -14,9 +15,12 @@ import {
|
|
|
14
15
|
ValueField
|
|
15
16
|
} from '#cogs/components/field'
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @type {OnEventType}
|
|
20
|
+
*/
|
|
21
|
+
function DEFAULT_HANDLE_EVENT () {
|
|
22
|
+
//
|
|
23
|
+
}
|
|
20
24
|
|
|
21
25
|
/**
|
|
22
26
|
* @param {{ target: { selectedOptions: { value?: string, text?: string }[] } }} event
|
|
@@ -78,7 +82,7 @@ export default class SelectField extends ValueField {
|
|
|
78
82
|
handleChange = (event) => {
|
|
79
83
|
const {
|
|
80
84
|
multiple = false,
|
|
81
|
-
onChange =
|
|
85
|
+
onChange = DEFAULT_HANDLE_EVENT,
|
|
82
86
|
name
|
|
83
87
|
} = this.props
|
|
84
88
|
|
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-cogs/cogs/select')
|
|
|
11
11
|
log('`shinkansen` is awake')
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
|
-
default:
|
|
14
|
+
default: Select // @ts-expect-error
|
|
15
15
|
} = require('./index.jsx')
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Exports only default
|
|
19
|
+
*/
|
|
20
|
+
module.exports = Select
|
|
@@ -3,7 +3,7 @@ declare module '#cogs/cogs/select' {
|
|
|
3
3
|
ValueCog
|
|
4
4
|
} from '#cogs/cogs'
|
|
5
5
|
|
|
6
|
-
export type SelectProps = CogsTypes.Cogs.
|
|
6
|
+
export type SelectProps = CogsTypes.Cogs.Select.SelectProps
|
|
7
7
|
|
|
8
8
|
export default class SelectCog<P extends SelectProps> 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.Select.SelectProps} SelectProps
|
|
4
5
|
*/
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* SelectCog 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/select/title'
|
|
22
19
|
import Description from '#cogs/cogs/select/description'
|
|
23
20
|
import ErrorMessage from '#cogs/cogs/select/error-message'
|
|
24
21
|
import Field from '#cogs/cogs/select/field'
|
|
25
22
|
|
|
23
|
+
/**
|
|
24
|
+
* @type {OnEventType}
|
|
25
|
+
*/
|
|
26
|
+
function DEFAULT_HANDLE_EVENT () {
|
|
27
|
+
//
|
|
28
|
+
}
|
|
29
|
+
|
|
26
30
|
/**
|
|
27
31
|
* @extends {ValueCog<ValueProps & SelectProps>}
|
|
28
32
|
*/
|
|
@@ -59,7 +63,7 @@ export default class SelectCog extends ValueCog {
|
|
|
59
63
|
*/
|
|
60
64
|
handleChange = (name, value) => {
|
|
61
65
|
const {
|
|
62
|
-
onChange =
|
|
66
|
+
onChange = DEFAULT_HANDLE_EVENT
|
|
63
67
|
} = this.props
|
|
64
68
|
|
|
65
69
|
onChange(name, value)
|
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-cogs/cogs/select/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.Select.SelectProps} SelectProps
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* SelectTitle 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/text/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/text/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/text/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/text/index.cjs
CHANGED
|
@@ -11,7 +11,10 @@ const log = debug('shinkansen-cogs/cogs/text')
|
|
|
11
11
|
log('`shinkansen` is awake')
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
|
-
default:
|
|
14
|
+
default: Text // @ts-expect-error
|
|
15
15
|
} = require('./index.jsx')
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Exports only default
|
|
19
|
+
*/
|
|
20
|
+
module.exports = Text
|
|
@@ -3,7 +3,7 @@ declare module '#cogs/cogs/text' {
|
|
|
3
3
|
ValueCog
|
|
4
4
|
} from '#cogs/cogs'
|
|
5
5
|
|
|
6
|
-
export type TextProps = CogsTypes.Cogs.
|
|
6
|
+
export type TextProps = CogsTypes.Cogs.Text.TextProps
|
|
7
7
|
|
|
8
8
|
export default class TextCog<P extends TextProps> extends ValueCog<P> {
|
|
9
9
|
handleChange (
|
package/src/cogs/text/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.Text.TextProps} TextProps
|
|
4
5
|
*/
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* TextCog 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/text/title'
|
|
21
18
|
import Description from '#cogs/cogs/text/description'
|
|
22
19
|
import ErrorMessage from '#cogs/cogs/text/error-message'
|
|
23
20
|
import Field from '#cogs/cogs/text/field'
|
|
24
21
|
|
|
22
|
+
/**
|
|
23
|
+
* @type {OnEventType}
|
|
24
|
+
*/
|
|
25
|
+
function DEFAULT_HANDLE_EVENT () {
|
|
26
|
+
//
|
|
27
|
+
}
|
|
28
|
+
|
|
25
29
|
/**
|
|
26
30
|
* @extends {ValueCog<ValueProps & TextProps>}
|
|
27
31
|
*/
|
|
@@ -36,7 +40,7 @@ export default class TextCog 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/text/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.Text.TextProps} TextProps
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* TextTitle 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/textarea/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/textarea/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
|