shinkansen-sprockets 1.1.322 → 1.1.323

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shinkansen-sprockets",
3
- "version": "1.1.322",
3
+ "version": "1.1.323",
4
4
  "description": "Shinkansen Sprockets",
5
5
  "keywords": [
6
6
  "Shinkansen",
@@ -56,7 +56,7 @@
56
56
  "@babel/preset-env": "^7.24.8",
57
57
  "@babel/preset-react": "^7.24.7",
58
58
  "@babel/register": "^7.24.6",
59
- "@modernpoacher/design-system": "1.0.172",
59
+ "@modernpoacher/design-system": "1.0.173",
60
60
  "@modernpoacher/hooks": "^1.0.483",
61
61
  "@sequencemedia/gulp": "^1.1.202",
62
62
  "@sequencemedia/gulp-clean-css": "^1.0.114",
@@ -27,6 +27,8 @@ import AnswerTitle from './answer-title.cjs'
27
27
  import AnswerValue from './answer-value.cjs'
28
28
  import ChangeAnswer from './change-answer.cjs'
29
29
 
30
+ const DEFAULT_CHECK_ANSWERS = []
31
+
30
32
  const log = debug('shinkansen-sprockets/components/group/check-answers')
31
33
 
32
34
  /* eslint-disable-next-line react/prop-types */
@@ -49,7 +51,7 @@ export default class CheckAnswersGroup extends Group {
49
51
  * @type {GroupState}
50
52
  */
51
53
  state = {
52
- checkAnswers: []
54
+ checkAnswers: DEFAULT_CHECK_ANSWERS
53
55
  }
54
56
 
55
57
  getClassName () {
@@ -78,11 +80,11 @@ export default class CheckAnswersGroup extends Group {
78
80
  */
79
81
  shouldComponentUpdate (props, state) {
80
82
  const {
81
- checkAnswers: c
83
+ checkAnswers: c = DEFAULT_CHECK_ANSWERS
82
84
  } = state
83
85
 
84
86
  const {
85
- checkAnswers: C
87
+ checkAnswers: C = DEFAULT_CHECK_ANSWERS
86
88
  } = this.state
87
89
 
88
90
  return (c !== C)
@@ -90,7 +92,7 @@ export default class CheckAnswersGroup extends Group {
90
92
 
91
93
  render () {
92
94
  const {
93
- checkAnswers
95
+ checkAnswers = DEFAULT_CHECK_ANSWERS
94
96
  } = this.props
95
97
 
96
98
  if (checkAnswers.length) {
@@ -111,8 +113,3 @@ CheckAnswersGroup.propTypes = {
111
113
  ...Group.propTypes,
112
114
  checkAnswers: PropTypes.arrayOf(PropTypes.shape())
113
115
  }
114
-
115
- CheckAnswersGroup.defaultProps = {
116
- ...Group.defaultProps,
117
- checkAnswers: []
118
- }
@@ -13,6 +13,8 @@ import Sprocket from 'shinkansen-sprockets/sprockets'
13
13
  import Title from './title/index.jsx'
14
14
  import Group from './group/index.jsx'
15
15
 
16
+ const DEFAULT_CHECK_ANSWERS = []
17
+
16
18
  export default class CheckAnswersSprocket extends Sprocket {
17
19
  getClassName () {
18
20
  return classnames(super.getClassName(), 'check-answers')
@@ -43,7 +45,7 @@ export default class CheckAnswersSprocket extends Sprocket {
43
45
 
44
46
  renderGroup () {
45
47
  const {
46
- checkAnswers
48
+ checkAnswers = DEFAULT_CHECK_ANSWERS
47
49
  } = this.props
48
50
 
49
51
  return (
@@ -55,7 +57,7 @@ export default class CheckAnswersSprocket extends Sprocket {
55
57
 
56
58
  render () {
57
59
  const {
58
- checkAnswers
60
+ checkAnswers = DEFAULT_CHECK_ANSWERS
59
61
  } = this.props
60
62
 
61
63
  if (checkAnswers.length) {
@@ -75,8 +77,3 @@ CheckAnswersSprocket.propTypes = {
75
77
  ...Sprocket.propTypes,
76
78
  checkAnswers: PropTypes.arrayOf(PropTypes.shape())
77
79
  }
78
-
79
- CheckAnswersSprocket.defaultProps = {
80
- ...Sprocket.defaultProps,
81
- checkAnswers: []
82
- }
@@ -27,7 +27,3 @@ export default class CheckAnswersTitle extends Title {
27
27
  CheckAnswersTitle.propTypes = {
28
28
  ...Title.propTypes
29
29
  }
30
-
31
- CheckAnswersTitle.defaultProps = {
32
- ...Title.defaultProps
33
- }
@@ -26,6 +26,8 @@ import {
26
26
 
27
27
  import TextContent from 'shinkansen-sprockets/components/common/text-content'
28
28
 
29
+ const DEFAULT_ERROR_SUMMARY = []
30
+
29
31
  const log = debug('shinkansen-sprockets/sprockets/error-summary/group')
30
32
 
31
33
  /* eslint-disable-next-line react/prop-types */
@@ -51,7 +53,7 @@ export default class ErrorSummaryGroup extends Group {
51
53
  * @type {GroupState}
52
54
  */
53
55
  state = {
54
- errorSummary: {}
56
+ errorSummary: DEFAULT_ERROR_SUMMARY
55
57
  }
56
58
 
57
59
  getClassName () {
@@ -80,11 +82,11 @@ export default class ErrorSummaryGroup extends Group {
80
82
  */
81
83
  shouldComponentUpdate (props, state) {
82
84
  const {
83
- errorSummary: e
85
+ errorSummary: e = DEFAULT_ERROR_SUMMARY
84
86
  } = state
85
87
 
86
88
  const {
87
- errorSummary: E
89
+ errorSummary: E = DEFAULT_ERROR_SUMMARY
88
90
  } = this.state
89
91
 
90
92
  return (e !== E)
@@ -93,7 +95,7 @@ export default class ErrorSummaryGroup extends Group {
93
95
  render () {
94
96
  const {
95
97
  groupRef,
96
- errorSummary
98
+ errorSummary = DEFAULT_ERROR_SUMMARY
97
99
  } = this.props
98
100
 
99
101
  if (errorSummary.length) {
@@ -114,8 +116,3 @@ ErrorSummaryGroup.propTypes = {
114
116
  ...Group.propTypes,
115
117
  errorSummary: PropTypes.arrayOf(PropTypes.shape())
116
118
  }
117
-
118
- ErrorSummaryGroup.defaultProps = {
119
- ...Group.defaultProps,
120
- errorSummary: []
121
- }
@@ -13,6 +13,8 @@ import Sprocket from 'shinkansen-sprockets/sprockets'
13
13
  import Title from './title/index.jsx'
14
14
  import Group from './group/index.jsx'
15
15
 
16
+ const DEFAULT_ERROR_SUMMARY = []
17
+
16
18
  export default class ErrorSummarySprocket extends Sprocket {
17
19
  getClassName () {
18
20
  return classnames(super.getClassName(), 'error-summary')
@@ -43,7 +45,7 @@ export default class ErrorSummarySprocket extends Sprocket {
43
45
 
44
46
  renderGroup () {
45
47
  const {
46
- errorSummary
48
+ errorSummary = DEFAULT_ERROR_SUMMARY
47
49
  } = this.props
48
50
 
49
51
  return (
@@ -55,7 +57,7 @@ export default class ErrorSummarySprocket extends Sprocket {
55
57
 
56
58
  render () {
57
59
  const {
58
- errorSummary
60
+ errorSummary = DEFAULT_ERROR_SUMMARY
59
61
  } = this.props
60
62
 
61
63
  if (errorSummary.length) {
@@ -77,8 +79,3 @@ ErrorSummarySprocket.propTypes = {
77
79
  ...Sprocket.propTypes,
78
80
  errorSummary: PropTypes.arrayOf(PropTypes.shape())
79
81
  }
80
-
81
- ErrorSummarySprocket.defaultProps = {
82
- ...Sprocket.defaultProps,
83
- errorSummary: []
84
- }
@@ -27,7 +27,3 @@ export default class ErrorSummaryTitle extends Title {
27
27
  ErrorSummaryTitle.propTypes = {
28
28
  ...Title.propTypes
29
29
  }
30
-
31
- ErrorSummaryTitle.defaultProps = {
32
- ...Title.defaultProps
33
- }
@@ -14,7 +14,3 @@ export default class FieldsetDescription extends Description {
14
14
  FieldsetDescription.propTypes = {
15
15
  ...Description.propTypes
16
16
  }
17
-
18
- FieldsetDescription.defaultProps = {
19
- ...Description.defaultProps
20
- }
@@ -14,7 +14,3 @@ export default class FieldsetErrorMessage extends ErrorMessage {
14
14
  FieldsetErrorMessage.propTypes = {
15
15
  ...ErrorMessage.propTypes
16
16
  }
17
-
18
- FieldsetErrorMessage.defaultProps = {
19
- ...ErrorMessage.defaultProps
20
- }
@@ -14,7 +14,3 @@ export default class FieldsetGroup extends Group {
14
14
  FieldsetGroup.propTypes = {
15
15
  ...Group.propTypes
16
16
  }
17
-
18
- FieldsetGroup.defaultProps = {
19
- ...Group.defaultProps
20
- }
@@ -104,7 +104,3 @@ FieldsetSprocket.propTypes = {
104
104
  uri: PropTypes.string.isRequired
105
105
  })
106
106
  }
107
-
108
- FieldsetSprocket.defaultProps = {
109
- ...Sprocket.defaultProps
110
- }
@@ -13,7 +13,3 @@ export default class FieldsetTitle extends Title {
13
13
  FieldsetTitle.propTypes = {
14
14
  ...Title.propTypes
15
15
  }
16
-
17
- FieldsetTitle.defaultProps = {
18
- ...Title.defaultProps
19
- }
@@ -84,7 +84,3 @@ Sprocket.propTypes = {
84
84
  current: PropTypes.shape().isRequired
85
85
  })
86
86
  }
87
-
88
- Sprocket.defaultProps = {
89
- onChange: DEFAULT_HANDLE_CHANGE
90
- }