cozy-ui 75.3.0 → 75.4.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 CHANGED
@@ -1,3 +1,17 @@
1
+ # [75.4.0](https://github.com/cozy/cozy-ui/compare/v75.3.0...v75.4.0) (2022-09-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **Viewer:** Ensute bool type for isEditable in ActionMenuWrapper ([464caac](https://github.com/cozy/cozy-ui/commit/464caac))
7
+ * **Viewer:** QualificationListItemText was using bad dom structure and prop ([53c351b](https://github.com/cozy/cozy-ui/commit/53c351b))
8
+
9
+
10
+ ### Features
11
+
12
+ * **Input:** Disables spell checking ([43040df](https://github.com/cozy/cozy-ui/commit/43040df))
13
+ * **Viewer:** Show all possible qualification data, uninformed if empty ([c3d13d5](https://github.com/cozy/cozy-ui/commit/c3d13d5))
14
+
1
15
  # [75.3.0](https://github.com/cozy/cozy-ui/compare/v75.2.0...v75.3.0) (2022-09-22)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "75.3.0",
3
+ "version": "75.4.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -4,6 +4,7 @@ exports[`Input component should support number type 1`] = `
4
4
  <input
5
5
  className="styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR"
6
6
  onChange={[MockFunction]}
7
+ spellCheck={false}
7
8
  type="number"
8
9
  value="42"
9
10
  />
@@ -36,6 +36,7 @@ const Input = forwardRef((props, ref) => {
36
36
  disabled={disabled}
37
37
  placeholder={placeholder}
38
38
  value={value}
39
+ spellCheck={false}
39
40
  {...restProps}
40
41
  />
41
42
  )
@@ -65,7 +65,7 @@ const ActionMenuWrapper = forwardRef(({ onClose, optionFile }, ref) => {
65
65
  return (
66
66
  <ActionMenuMobile
67
67
  onClose={onClose}
68
- isEditable={editPath && isEditableAttribute}
68
+ isEditable={Boolean(editPath) && isEditableAttribute}
69
69
  actions={{ handleCopy, handleEdit }}
70
70
  appLink={url}
71
71
  appSlug={mespapiersAppSlug}
@@ -77,7 +77,7 @@ const ActionMenuWrapper = forwardRef(({ onClose, optionFile }, ref) => {
77
77
  <ActionMenuDesktop
78
78
  ref={ref}
79
79
  onClose={onClose}
80
- isEditable={editPath && isEditableAttribute}
80
+ isEditable={Boolean(editPath) && isEditableAttribute}
81
81
  actions={{ handleCopy, handleEdit }}
82
82
  appLink={url}
83
83
  appSlug={mespapiersAppSlug}
@@ -6,8 +6,8 @@ import { withViewerLocales } from '../hoc/withViewerLocales'
6
6
  import {
7
7
  formatMetadataQualification,
8
8
  knownDateMetadataNames,
9
- knowInformationMetadataNames,
10
- knowOtherMetadataNames
9
+ knownInformationMetadataNames,
10
+ knownOtherMetadataNames
11
11
  } from '../helpers'
12
12
  import QualificationListItemContact from './QualificationListItemContact'
13
13
  import ActionMenuWrapper from './ActionMenuWrapper'
@@ -15,6 +15,20 @@ import QualificationListItemDate from './QualificationListItemDate'
15
15
  import QualificationListItemInformation from './QualificationListItemInformation'
16
16
  import QualificationListItemOther from './QualificationListItemOther'
17
17
 
18
+ const makeQualificationListItemComp = metadataName => {
19
+ if (knownDateMetadataNames.includes(metadataName)) {
20
+ return QualificationListItemDate
21
+ }
22
+
23
+ if (knownInformationMetadataNames.includes(metadataName)) {
24
+ return QualificationListItemInformation
25
+ }
26
+
27
+ if (knownOtherMetadataNames.includes(metadataName)) {
28
+ return QualificationListItemOther
29
+ }
30
+ }
31
+
18
32
  const Qualification = ({ file = {} }) => {
19
33
  const { metadata = {} } = file
20
34
  const actionBtnRef = useRef([])
@@ -35,60 +49,38 @@ const Qualification = ({ file = {} }) => {
35
49
  })
36
50
  }
37
51
 
38
- const metadataComputed = useMemo(() => {
52
+ const formatedMetadataQualification = useMemo(() => {
39
53
  return formatMetadataQualification(metadata)
40
54
  }, [metadata])
41
55
 
42
56
  useEffect(() => {
43
- actionBtnRef.current = metadataComputed.map(
57
+ actionBtnRef.current = formatedMetadataQualification.map(
44
58
  (_, idx) => actionBtnRef.current[idx] ?? createRef()
45
59
  )
46
- }, [metadataComputed])
60
+ }, [formatedMetadataQualification])
47
61
 
48
62
  return (
49
63
  <List className={'u-pv-1'}>
50
- {metadataComputed.map((meta, idx) => {
64
+ {formatedMetadataQualification.map((meta, idx) => {
51
65
  const { name } = meta
52
66
 
53
- if (knownDateMetadataNames.includes(name)) {
54
- return (
55
- <QualificationListItemDate
56
- key={idx}
57
- ref={actionBtnRef.current[idx]}
58
- metadataComputed={meta}
59
- toggleActionsMenu={val => toggleActionsMenu(idx, name, val)}
60
- />
61
- )
67
+ if (name === 'contact') {
68
+ return <QualificationListItemContact key={idx} file={file} />
62
69
  }
63
70
 
64
- if (knowInformationMetadataNames.includes(name)) {
65
- return (
66
- <QualificationListItemInformation
67
- key={idx}
68
- ref={actionBtnRef.current[idx]}
69
- metadataComputed={meta}
70
- toggleActionsMenu={val => toggleActionsMenu(idx, name, val)}
71
- />
72
- )
73
- }
71
+ const QualificationListItemComp = makeQualificationListItemComp(name)
74
72
 
75
- if (knowOtherMetadataNames.includes(name)) {
76
- if (name === 'contact') {
77
- return <QualificationListItemContact key={idx} file={file} />
78
- }
79
-
80
- return (
81
- <QualificationListItemOther
82
- key={idx}
83
- ref={actionBtnRef.current[idx]}
84
- metadataComputed={meta}
85
- toggleActionsMenu={val => toggleActionsMenu(idx, name, val)}
86
- />
87
- )
88
- }
73
+ return (
74
+ <QualificationListItemComp
75
+ key={idx}
76
+ ref={actionBtnRef.current[idx]}
77
+ formatedMetadataQualification={meta}
78
+ toggleActionsMenu={val => toggleActionsMenu(idx, name, val)}
79
+ />
80
+ )
89
81
  })}
90
82
 
91
- {optionFile.value && (
83
+ {optionFile.name && (
92
84
  <ActionMenuWrapper
93
85
  onClose={hideActionsMenu}
94
86
  file={file}
@@ -104,4 +96,4 @@ Qualification.propTypes = {
104
96
  file: PropTypes.object
105
97
  }
106
98
 
107
- export default withViewerLocales(React.memo(Qualification))
99
+ export default withViewerLocales(Qualification)
@@ -11,16 +11,19 @@ import { useI18n } from '../../I18n'
11
11
  import { formatDate } from '../helpers'
12
12
 
13
13
  const QualificationListItemDate = forwardRef(
14
- ({ metadataComputed, toggleActionsMenu }, ref) => {
14
+ ({ formatedMetadataQualification, toggleActionsMenu }, ref) => {
15
15
  const { t, f, lang } = useI18n()
16
- const { name, value } = metadataComputed
17
- const formattedDate = formatDate({ f, lang, date: value })
16
+ const { name, value } = formatedMetadataQualification
17
+ const formattedDate = value
18
+ ? formatDate({ f, lang, date: value })
19
+ : t('Viewer.panel.qualification.noInfo')
18
20
 
19
21
  return (
20
22
  <ListItem className={'u-pl-2 u-pr-3'}>
21
23
  <QualificationListItemText
22
24
  primary={t(`Viewer.panel.qualification.date.title.${name}`)}
23
25
  secondary={formattedDate}
26
+ disabled={!value}
24
27
  />
25
28
  <ListItemSecondaryAction>
26
29
  <IconButton
@@ -34,10 +37,11 @@ const QualificationListItemDate = forwardRef(
34
37
  )
35
38
  }
36
39
  )
40
+
37
41
  QualificationListItemDate.displayName = 'QualificationListItemDate'
38
42
 
39
43
  QualificationListItemDate.propTypes = {
40
- metadataComputed: PropTypes.shape({
44
+ formatedMetadataQualification: PropTypes.shape({
41
45
  name: PropTypes.string,
42
46
  value: PropTypes.string
43
47
  }).isRequired,
@@ -10,15 +10,16 @@ import QualificationListItemText from './QualificationListItemText'
10
10
  import { useI18n } from '../../I18n'
11
11
 
12
12
  const QualificationListItemInformation = forwardRef(
13
- ({ metadataComputed, toggleActionsMenu }, ref) => {
13
+ ({ formatedMetadataQualification, toggleActionsMenu }, ref) => {
14
14
  const { t } = useI18n()
15
- const { name, value } = metadataComputed
15
+ const { name, value } = formatedMetadataQualification
16
16
 
17
17
  return (
18
18
  <ListItem className={'u-pl-2 u-pr-3'}>
19
19
  <QualificationListItemText
20
20
  primary={t(`Viewer.panel.qualification.information.title.${name}`)}
21
- secondary={value}
21
+ secondary={value || t('Viewer.panel.qualification.noInfo')}
22
+ disabled={!value}
22
23
  />
23
24
  <ListItemSecondaryAction>
24
25
  <IconButton ref={ref} onClick={() => toggleActionsMenu(value)}>
@@ -29,10 +30,11 @@ const QualificationListItemInformation = forwardRef(
29
30
  )
30
31
  }
31
32
  )
33
+
32
34
  QualificationListItemInformation.displayName = 'QualificationListItemNumber'
33
35
 
34
36
  QualificationListItemInformation.propTypes = {
35
- metadataComputed: PropTypes.shape({
37
+ formatedMetadataQualification: PropTypes.shape({
36
38
  name: PropTypes.string,
37
39
  value: PropTypes.string
38
40
  }).isRequired,
@@ -19,10 +19,10 @@ const {
19
19
  } = models
20
20
 
21
21
  const QualificationListItemOther = forwardRef(
22
- ({ metadataComputed, toggleActionsMenu }, ref) => {
22
+ ({ formatedMetadataQualification, toggleActionsMenu }, ref) => {
23
23
  const { t, lang } = useI18n()
24
24
  const scannerT = getBoundT(lang)
25
- const { name, value } = metadataComputed
25
+ const { name, value } = formatedMetadataQualification
26
26
 
27
27
  if (!value) return null
28
28
 
@@ -52,7 +52,7 @@ const QualificationListItemOther = forwardRef(
52
52
  QualificationListItemOther.displayName = 'QualificationListItemOther'
53
53
 
54
54
  QualificationListItemOther.propTypes = {
55
- metadataComputed: PropTypes.shape({
55
+ formatedMetadataQualification: PropTypes.shape({
56
56
  name: PropTypes.string,
57
57
  value: PropTypes.string
58
58
  }).isRequired,
@@ -4,19 +4,27 @@ import PropTypes from 'prop-types'
4
4
  import ListItemText from '../../ListItemText'
5
5
  import Typography from '../../Typography'
6
6
 
7
- const QualificationListItemText = ({ primary, secondary }) => {
7
+ const QualificationListItemText = ({ primary, secondary, disabled }) => {
8
8
  return (
9
9
  <ListItemText
10
10
  disableTypography
11
- primary={<Typography variant={'caption'}>{primary}</Typography>}
12
- secondary={<Typography variant={'body1'}>{secondary}</Typography>}
11
+ primary={<Typography variant="caption">{primary}</Typography>}
12
+ secondary={
13
+ <Typography
14
+ component="div"
15
+ variant="body1"
16
+ style={disabled ? { color: 'var(--disabledTextColor)' } : undefined}
17
+ >
18
+ {secondary}
19
+ </Typography>
20
+ }
13
21
  />
14
22
  )
15
23
  }
16
24
 
17
25
  QualificationListItemText.propTypes = {
18
26
  primary: PropTypes.string.isRequired,
19
- secondary: PropTypes.string.isRequired
27
+ secondary: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired
20
28
  }
21
29
 
22
30
  export default QualificationListItemText
@@ -58,8 +58,14 @@ const files = [
58
58
  mime: 'application/pdf',
59
59
  metadata: {
60
60
  carbonCopy: true,
61
+ AObtentionDate: null,
61
62
  BObtentionDate: "2022-02-09T09:05:38.000Z",
63
+ CObtentionDate: null,
64
+ DObtentionDate: null,
65
+ datetime: "2022-09-23T07:50:22.000Z",
62
66
  datetimeLabel: "BObtentionDate",
67
+ number: "",
68
+ page: "front",
63
69
  qualification: {
64
70
  label: "driver_license",
65
71
  purpose: "attestation",
@@ -170,8 +176,6 @@ const editPathByModelProps = {
170
176
  files={files}
171
177
  currentIndex={state.currentIndex}
172
178
  currentURL={state.currentURL}
173
- onCloseRequest={toggleViewer}
174
- onChangeRequest={onFileChange}
175
179
  showNavigation={variant.navigation}
176
180
  editPathByModelProps={editPathByModelProps}
177
181
  onlyOfficeProps={{
@@ -182,6 +186,8 @@ const editPathByModelProps = {
182
186
  showToolbar: variant.toolbar,
183
187
  showClose: state.showToolbarCloseButton
184
188
  }}
189
+ onCloseRequest={toggleViewer}
190
+ onChangeRequest={onFileChange}
185
191
  >
186
192
  <FooterActionButtons>
187
193
  <ShareButtonFake />
@@ -15,19 +15,19 @@ export const knownDateMetadataNames = [
15
15
  'date',
16
16
  'datetime'
17
17
  ]
18
- export const knowInformationMetadataNames = [
18
+ export const knownInformationMetadataNames = [
19
19
  'number',
20
20
  'cardNumber',
21
21
  'vinNumber',
22
22
  'ibanNumber',
23
23
  'country'
24
24
  ]
25
- export const knowOtherMetadataNames = ['contact', 'page', 'qualification']
25
+ export const knownOtherMetadataNames = ['contact', 'page', 'qualification']
26
26
 
27
27
  export const getCurrentModel = metadataName => {
28
28
  if (
29
29
  knownDateMetadataNames.includes(metadataName) ||
30
- knowInformationMetadataNames.includes(metadataName)
30
+ knownInformationMetadataNames.includes(metadataName)
31
31
  ) {
32
32
  return 'information'
33
33
  }
@@ -87,41 +87,61 @@ export const downloadFile = async ({ client, file, url }) => {
87
87
 
88
88
  export const isFileEncrypted = file => isEncrypted(file)
89
89
 
90
+ const makeMetadataQualification = ({ metadata, knownMetadataName, value }) => {
91
+ const shouldReturnThisMetadata = Object.keys(metadata).includes(
92
+ knownMetadataName
93
+ )
94
+
95
+ if (shouldReturnThisMetadata) {
96
+ return { name: knownMetadataName, value: value || null }
97
+ }
98
+ }
99
+
90
100
  /**
91
101
  * @param {Object} metadata
92
102
  * @returns {{ name: string, value: string }[]} Array of formated metadata
93
103
  */
94
104
  export const formatMetadataQualification = metadata => {
95
105
  const dates = knownDateMetadataNames
96
- .map(dateName => {
97
- if (metadata[dateName]) {
98
- return { name: dateName, value: metadata[dateName] }
99
- }
100
- })
106
+ .map(dateName =>
107
+ makeMetadataQualification({
108
+ metadata,
109
+ knownMetadataName: dateName,
110
+ value: metadata[dateName]
111
+ })
112
+ )
101
113
  .filter(Boolean)
102
114
  .filter((data, _, arr) => {
103
115
  if (arr.length > 1) return data.name !== 'datetime'
104
116
  return data
105
117
  })
106
118
 
107
- const numbers = knowInformationMetadataNames
108
- .map(numberName => {
109
- if (metadata[numberName]) {
110
- return { name: numberName, value: metadata[numberName] }
111
- }
112
- })
119
+ const informations = knownInformationMetadataNames
120
+ .map(numberName =>
121
+ makeMetadataQualification({
122
+ metadata,
123
+ knownMetadataName: numberName,
124
+ value: metadata[numberName]
125
+ })
126
+ )
113
127
  .filter(Boolean)
114
128
 
115
- const others = knowOtherMetadataNames
129
+ const others = knownOtherMetadataNames
116
130
  .map(otherName => {
117
- if (otherName === 'qualification') {
118
- return { name: otherName, value: metadata[otherName]?.label }
119
- }
120
- return { name: otherName, value: metadata[otherName] }
131
+ const value =
132
+ otherName === 'qualification'
133
+ ? metadata[otherName]?.label
134
+ : metadata[otherName]
135
+
136
+ return makeMetadataQualification({
137
+ metadata,
138
+ knownMetadataName: otherName,
139
+ value
140
+ })
121
141
  })
122
142
  .filter(Boolean)
123
143
 
124
- return [...dates, ...numbers, ...others]
144
+ return [...dates, ...informations, ...others]
125
145
  }
126
146
 
127
147
  export const formatDate = ({ f, lang, date }) => {
@@ -7,7 +7,7 @@ import {
7
7
  getCurrentModel,
8
8
  buildEditAttributePath,
9
9
  knownDateMetadataNames,
10
- knowInformationMetadataNames
10
+ knownInformationMetadataNames
11
11
  } from './helpers'
12
12
 
13
13
  const fakeMetadata = {
@@ -125,7 +125,7 @@ describe('helpers', () => {
125
125
  })
126
126
  describe('getCurrentModel', () => {
127
127
  const expected = 'information'
128
- it.each([...knownDateMetadataNames, ...knowInformationMetadataNames])(
128
+ it.each([...knownDateMetadataNames, ...knownInformationMetadataNames])(
129
129
  `getCurrentModel(%s) should return ${expected}`,
130
130
  input => {
131
131
  expect(getCurrentModel(input)).toBe(expected)
@@ -64,6 +64,7 @@
64
64
  "front": "Front side",
65
65
  "back": "Back side",
66
66
  "qualification": "Qualification",
67
+ "noInfo": "No information",
67
68
  "actions": {
68
69
  "copy": "Copy",
69
70
  "copyClipboard": "Copy to clipboard",
@@ -64,6 +64,7 @@
64
64
  "front": "Face avant",
65
65
  "back": "Face arrière",
66
66
  "qualification": "Qualification",
67
+ "noInfo": "Non renseigné(e)",
67
68
  "actions": {
68
69
  "copy": "Copier",
69
70
  "copyClipboard": "Copier dans le presse-papier",
@@ -2882,21 +2882,21 @@ exports[`Field should render examples: Field 1`] = `
2882
2882
  exports[`Field should render examples: Field 2`] = `
2883
2883
  "<div>
2884
2884
  <form>
2885
- <div class=\\"styles__o-field___3n5HM styles__o-field--inline___7JWZ8\\"><label for=\\"idField\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\">I'm a label</label><input type=\\"text\\" id=\\"idField\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--medium___28jPV\\" placeholder=\\"Write something\\" value=\\"\\"></div>
2885
+ <div class=\\"styles__o-field___3n5HM styles__o-field--inline___7JWZ8\\"><label for=\\"idField\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\">I'm a label</label><input type=\\"text\\" id=\\"idField\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--medium___28jPV\\" placeholder=\\"Write something\\" spellcheck=\\"false\\" value=\\"\\"></div>
2886
2886
  </form>
2887
2887
  </div>"
2888
2888
  `;
2889
2889
 
2890
2890
  exports[`Field should render examples: Field 3`] = `
2891
2891
  "<div>
2892
- <div class=\\"styles__o-field___3n5HM\\"><label for=\\"controlled-field\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\"></label><input type=\\"text\\" id=\\"controlled-field\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"\\" value=\\"\\"></div>
2892
+ <div class=\\"styles__o-field___3n5HM\\"><label for=\\"controlled-field\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\"></label><input type=\\"text\\" id=\\"controlled-field\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"\\" spellcheck=\\"false\\" value=\\"\\"></div>
2893
2893
  </div>"
2894
2894
  `;
2895
2895
 
2896
2896
  exports[`Field should render examples: Field 4`] = `
2897
2897
  "<div>
2898
2898
  <div>
2899
- <div class=\\"styles__o-field___3n5HM\\"><label for=\\"\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\">I can have focus</label><input type=\\"text\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"Focus please\\" value=\\"\\"></div><button type=\\"submit\\" class=\\"styles__c-btn___-2Vnj styles__c-btn--center___16_Xh\\"><span><span>Focus!</span>Set Focus</span></button>
2899
+ <div class=\\"styles__o-field___3n5HM\\"><label for=\\"\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\">I can have focus</label><input type=\\"text\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"Focus please\\" spellcheck=\\"false\\" value=\\"\\"></div><button type=\\"submit\\" class=\\"styles__c-btn___-2Vnj styles__c-btn--center___16_Xh\\"><span><span>Focus!</span>Set Focus</span></button>
2900
2900
  </div>
2901
2901
  </div>"
2902
2902
  `;
@@ -2904,7 +2904,7 @@ exports[`Field should render examples: Field 4`] = `
2904
2904
  exports[`Field should render examples: Field 5`] = `
2905
2905
  "<div>
2906
2906
  <form>
2907
- <div class=\\"styles__o-field___3n5HM\\"><label for=\\"\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\">I got a name</label><input type=\\"text\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"\\" name=\\"foo\\" value=\\"\\"></div>
2907
+ <div class=\\"styles__o-field___3n5HM\\"><label for=\\"\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\">I got a name</label><input type=\\"text\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"\\" spellcheck=\\"false\\" name=\\"foo\\" value=\\"\\"></div>
2908
2908
  </form>
2909
2909
  </div>"
2910
2910
  `;
@@ -2912,7 +2912,7 @@ exports[`Field should render examples: Field 5`] = `
2912
2912
  exports[`Field should render examples: Field 6`] = `
2913
2913
  "<div>
2914
2914
  <form>
2915
- <div class=\\"styles__o-field___3n5HM\\"><label for=\\"idFieldError\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\">I'm an error label</label><input type=\\"text\\" id=\\"idFieldError\\" class=\\"styles__c-input-text___3TAv1 styles__is-error___3lsCJ styles__c-input-text--large___28EaR\\" placeholder=\\"I'm an error input[type=text]\\" value=\\"\\"></div>
2915
+ <div class=\\"styles__o-field___3n5HM\\"><label for=\\"idFieldError\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\">I'm an error label</label><input type=\\"text\\" id=\\"idFieldError\\" class=\\"styles__c-input-text___3TAv1 styles__is-error___3lsCJ styles__c-input-text--large___28EaR\\" placeholder=\\"I'm an error input[type=text]\\" spellcheck=\\"false\\" value=\\"\\"></div>
2916
2916
  </form>
2917
2917
  </div>"
2918
2918
  `;
@@ -2975,7 +2975,7 @@ exports[`Field should render examples: Field 9`] = `
2975
2975
  <form>
2976
2976
  <div class=\\"styles__o-field___3n5HM\\"><label for=\\"idFieldPassword\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\">I'm a password label</label>
2977
2977
  <div class=\\"styles__o-field-input___vCqdV\\">
2978
- <div class=\\"styles__c-label___o4ozG styles__o-field-input-action___2k7a8\\">Show</div><input type=\\"password\\" id=\\"idFieldPassword\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"\\" value=\\"\\">
2978
+ <div class=\\"styles__c-label___o4ozG styles__o-field-input-action___2k7a8\\">Show</div><input type=\\"password\\" id=\\"idFieldPassword\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"\\" spellcheck=\\"false\\" value=\\"\\">
2979
2979
  </div>
2980
2980
  </div>
2981
2981
  </form>
@@ -2987,7 +2987,7 @@ exports[`Field should render examples: Field 10`] = `
2987
2987
  <form>
2988
2988
  <div class=\\"styles__o-field___3n5HM\\"><label for=\\"idFieldPassword\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\">I'm a password label</label>
2989
2989
  <div class=\\"styles__o-field-input___vCqdV\\">
2990
- <div class=\\"styles__c-label___o4ozG styles__o-field-input-action___2k7a8\\"></div><input type=\\"password\\" id=\\"idFieldPassword\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"\\" value=\\"\\">
2990
+ <div class=\\"styles__c-label___o4ozG styles__o-field-input-action___2k7a8\\"></div><input type=\\"password\\" id=\\"idFieldPassword\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"\\" spellcheck=\\"false\\" value=\\"\\">
2991
2991
  </div>
2992
2992
  </div>
2993
2993
  </form>
@@ -2998,7 +2998,7 @@ exports[`Field should render examples: Field 11`] = `
2998
2998
  "<div>
2999
2999
  <form>
3000
3000
  <div class=\\"styles__o-field___3n5HM\\"><label for=\\"\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\">I'm a label</label>
3001
- <div class=\\"styles__o-side___tXbXL styles__c-label___o4ozG\\">(optional)</div><input type=\\"text\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"\\" value=\\"\\">
3001
+ <div class=\\"styles__o-side___tXbXL styles__c-label___o4ozG\\">(optional)</div><input type=\\"text\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"\\" spellcheck=\\"false\\" value=\\"\\">
3002
3002
  </div>
3003
3003
  </form>
3004
3004
  </div>"
@@ -3008,7 +3008,7 @@ exports[`Field should render examples: Field 12`] = `
3008
3008
  "<div>
3009
3009
  <form>
3010
3010
  <div class=\\"styles__o-field___3n5HM\\"><label for=\\"\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\">I'm a label</label>
3011
- <div class=\\"styles__o-side___tXbXL styles__c-label___o4ozG styles__o-side-fullwidth___7WcCI\\">(optional)</div><input type=\\"text\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR styles__c-input-text--fullwidth___33o_f\\" placeholder=\\"\\" value=\\"\\">
3011
+ <div class=\\"styles__o-side___tXbXL styles__c-label___o4ozG styles__o-side-fullwidth___7WcCI\\">(optional)</div><input type=\\"text\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR styles__c-input-text--fullwidth___33o_f\\" placeholder=\\"\\" spellcheck=\\"false\\" value=\\"\\">
3012
3012
  </div>
3013
3013
  </form>
3014
3014
  </div>"
@@ -3017,7 +3017,7 @@ exports[`Field should render examples: Field 12`] = `
3017
3017
  exports[`Field should render examples: Field 13`] = `
3018
3018
  "<div>
3019
3019
  <form>
3020
- <div class=\\"styles__o-field___3n5HM\\"><label for=\\"\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\" style=\\"color: teal;\\">I'm a label</label><input type=\\"text\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"\\" style=\\"border-color: teal;\\" value=\\"\\"></div>
3020
+ <div class=\\"styles__o-field___3n5HM\\"><label for=\\"\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\" style=\\"color: teal;\\">I'm a label</label><input type=\\"text\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"\\" spellcheck=\\"false\\" style=\\"border-color: teal;\\" value=\\"\\"></div>
3021
3021
  </form>
3022
3022
  </div>"
3023
3023
  `;
@@ -3029,7 +3029,7 @@ exports[`Field should render examples: Field 14`] = `
3029
3029
  <div class=\\"styles__o-field-input___vCqdV\\">
3030
3030
  <div class=\\"styles__o-field-input-action___2k7a8\\">
3031
3031
  <div style=\\"margin-top: -0.5rem;\\"><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textSecondary MuiButton-textSizeSmall MuiButton-sizeSmall\\" tabindex=\\"0\\" type=\\"button\\"><span class=\\"MuiButton-label\\">Show</span></button></div>
3032
- </div><input type=\\"password\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"\\" style=\\"border-color: teal;\\" value=\\"\\">
3032
+ </div><input type=\\"password\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"\\" spellcheck=\\"false\\" style=\\"border-color: teal;\\" value=\\"\\">
3033
3033
  </div>
3034
3034
  </div>
3035
3035
  </form>
@@ -3040,7 +3040,7 @@ exports[`Field should render examples: Field 15`] = `
3040
3040
  "<div>
3041
3041
  <form>
3042
3042
  <div class=\\"styles__o-field___3n5HM\\"><label for=\\"\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\"></label>
3043
- <div class=\\"styles__o-side___tXbXL styles__c-label___o4ozG styles__o-side-fullwidth___7WcCI\\">(optional)</div><input type=\\"text\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR styles__c-input-text--fullwidth___33o_f\\" placeholder=\\"\\" value=\\"\\">
3043
+ <div class=\\"styles__o-side___tXbXL styles__c-label___o4ozG styles__o-side-fullwidth___7WcCI\\">(optional)</div><input type=\\"text\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR styles__c-input-text--fullwidth___33o_f\\" placeholder=\\"\\" spellcheck=\\"false\\" value=\\"\\">
3044
3044
  </div>Value:
3045
3045
  </form>
3046
3046
  </div>"
@@ -3052,7 +3052,7 @@ exports[`Field should render examples: Field 16`] = `
3052
3052
  <h5 class=\\"MuiTypography-root u-mb-1 MuiTypography-h5 MuiTypography-colorTextPrimary\\">Variant selector</h5><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">AUTOCAPITALIZE</span></label><label class=\\"MuiFormControlLabel-root\\"><span class=\\"MuiButtonBase-root MuiIconButton-root PrivateSwitchBase-root-1 MuiCheckbox-root MuiCheckbox-colorPrimary MuiIconButton-colorPrimary\\" aria-disabled=\\"false\\"><span class=\\"MuiIconButton-label\\"><input class=\\"PrivateSwitchBase-input-4\\" type=\\"checkbox\\" data-indeterminate=\\"false\\" aria-checked=\\"\\" value=\\"\\"><svg class=\\"MuiSvgIcon-root\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\"><path d=\\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\\"></path></svg></span></span><span class=\\"MuiTypography-root MuiFormControlLabel-label MuiTypography-body1\\">AUTOCOMPLETE</span></label>
3053
3053
  </div>
3054
3054
  <form>
3055
- <div class=\\"styles__o-field___3n5HM\\"><label for=\\"\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\"></label><input autocomplete=\\"off\\" type=\\"text\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"\\" autocapitalize=\\"none\\" value=\\"\\"></div>
3055
+ <div class=\\"styles__o-field___3n5HM\\"><label for=\\"\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\"></label><input autocomplete=\\"off\\" type=\\"text\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"\\" spellcheck=\\"false\\" autocapitalize=\\"none\\" value=\\"\\"></div>
3056
3056
  </form>
3057
3057
  </div>"
3058
3058
  `;
@@ -8437,7 +8437,7 @@ exports[`InputGroup should render examples: InputGroup 1`] = `
8437
8437
  <form>
8438
8438
  <div>
8439
8439
  <div class=\\"styles__c-inputgroup___12OVJ\\">
8440
- <div class=\\"styles__c-inputgroup-main___1LP4B\\"><input type=\\"text\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"Placeholder\\" value=\\"\\"></div>
8440
+ <div class=\\"styles__c-inputgroup-main___1LP4B\\"><input type=\\"text\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"Placeholder\\" spellcheck=\\"false\\" value=\\"\\"></div>
8441
8441
  <div class=\\"styles__c-inputgroup-side___60v0v\\"><span class=\\"styles__c-inputgroup-unit___bFj9a\\">€</span></div>
8442
8442
  </div>
8443
8443
  </div>
@@ -8453,7 +8453,7 @@ exports[`InputGroup should render examples: InputGroup 2`] = `
8453
8453
  <div class=\\"styles__c-inputgroup-side___60v0v\\">
8454
8454
  <h6 class=\\"MuiTypography-root u-pl-1 MuiTypography-h6 MuiTypography-colorTextPrimary\\">text</h6>
8455
8455
  </div>
8456
- <div class=\\"styles__c-inputgroup-main___1LP4B\\"><input type=\\"text\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"Placeholder\\" value=\\"\\"></div>
8456
+ <div class=\\"styles__c-inputgroup-main___1LP4B\\"><input type=\\"text\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"Placeholder\\" spellcheck=\\"false\\" value=\\"\\"></div>
8457
8457
  </div>
8458
8458
  </div>
8459
8459
  </form>
@@ -8465,8 +8465,8 @@ exports[`InputGroup should render examples: InputGroup 3`] = `
8465
8465
  <form>
8466
8466
  <div>
8467
8467
  <div class=\\"styles__c-inputgroup___12OVJ\\">
8468
- <div class=\\"styles__c-inputgroup-main___1LP4B\\"><input type=\\"text\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"Email\\" value=\\"\\"></div>
8469
- <div class=\\"styles__c-inputgroup-side___60v0v\\"><input type=\\"text\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR u-w-4\\" placeholder=\\"@domain.tld\\" value=\\"\\"></div>
8468
+ <div class=\\"styles__c-inputgroup-main___1LP4B\\"><input type=\\"text\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"Email\\" spellcheck=\\"false\\" value=\\"\\"></div>
8469
+ <div class=\\"styles__c-inputgroup-side___60v0v\\"><input type=\\"text\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR u-w-4\\" placeholder=\\"@domain.tld\\" spellcheck=\\"false\\" value=\\"\\"></div>
8470
8470
  </div>
8471
8471
  </div>
8472
8472
  </form>
@@ -8478,7 +8478,7 @@ exports[`InputGroup should render examples: InputGroup 4`] = `
8478
8478
  <form>
8479
8479
  <div>
8480
8480
  <div class=\\"styles__c-inputgroup___12OVJ\\">
8481
- <div class=\\"styles__c-inputgroup-main___1LP4B\\"><input type=\\"text\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"URL\\" value=\\"\\"></div>
8481
+ <div class=\\"styles__c-inputgroup-main___1LP4B\\"><input type=\\"text\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"URL\\" spellcheck=\\"false\\" value=\\"\\"></div>
8482
8482
  <div class=\\"styles__c-inputgroup-side___60v0v\\">
8483
8483
  <div class=\\"styles__select--autowidth___16AEp u-w-4 css-2b097c-container\\"><span aria-live=\\"polite\\" aria-atomic=\\"false\\" aria-relevant=\\"additions text\\" class=\\"css-1f43avz-a11yText-A11yText\\"></span>
8484
8484
  <div class=\\" css-1x8e986-control\\">
@@ -8509,7 +8509,7 @@ exports[`InputGroup should render examples: InputGroup 5`] = `
8509
8509
  <form>
8510
8510
  <div>
8511
8511
  <div class=\\"styles__c-inputgroup___12OVJ styles__c-inputgroup--fullwidth___3nuay\\">
8512
- <div class=\\"styles__c-inputgroup-main___1LP4B\\"><input type=\\"text\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"Placeholder\\" value=\\"\\"></div>
8512
+ <div class=\\"styles__c-inputgroup-main___1LP4B\\"><input type=\\"text\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"Placeholder\\" spellcheck=\\"false\\" value=\\"\\"></div>
8513
8513
  <div class=\\"styles__c-inputgroup-side___60v0v\\">
8514
8514
  <h6 class=\\"MuiTypography-root u-pr-1 MuiTypography-h6 MuiTypography-colorTextPrimary\\">text</h6>
8515
8515
  </div>
@@ -8524,7 +8524,7 @@ exports[`InputGroup should render examples: InputGroup 6`] = `
8524
8524
  <form>
8525
8525
  <div>
8526
8526
  <div class=\\"styles__c-inputgroup___12OVJ styles__c-inputgroup--error___1JNbu\\">
8527
- <div class=\\"styles__c-inputgroup-main___1LP4B\\"><input type=\\"text\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"Placeholder\\" value=\\"\\"></div>
8527
+ <div class=\\"styles__c-inputgroup-main___1LP4B\\"><input type=\\"text\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"Placeholder\\" spellcheck=\\"false\\" value=\\"\\"></div>
8528
8528
  <div class=\\"styles__c-inputgroup-side___60v0v\\">
8529
8529
  <h6 class=\\"MuiTypography-root u-pr-1 MuiTypography-h6 MuiTypography-colorTextPrimary\\">text</h6>
8530
8530
  </div>
@@ -8542,7 +8542,7 @@ exports[`InputGroup should render examples: InputGroup 7`] = `
8542
8542
  <div class=\\"styles__c-inputgroup-side___60v0v\\">
8543
8543
  <h6 class=\\"MuiTypography-root u-pl-1 MuiTypography-h6 MuiTypography-colorTextPrimary\\">text</h6>
8544
8544
  </div>
8545
- <div class=\\"styles__c-inputgroup-main___1LP4B\\"><input type=\\"text\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"Placeholder\\" value=\\"\\"></div>
8545
+ <div class=\\"styles__c-inputgroup-main___1LP4B\\"><input type=\\"text\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"Placeholder\\" spellcheck=\\"false\\" value=\\"\\"></div>
8546
8546
  </div>
8547
8547
  </div>
8548
8548
  </form>
@@ -8552,7 +8552,7 @@ exports[`InputGroup should render examples: InputGroup 7`] = `
8552
8552
  exports[`Label should render examples: Label 1`] = `
8553
8553
  "<div>
8554
8554
  <form>
8555
- <div><label for=\\"idInput\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\">This is a label</label><input type=\\"text\\" id=\\"idInput\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"Recherche\\" value=\\"\\"></div>
8555
+ <div><label for=\\"idInput\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\">This is a label</label><input type=\\"text\\" id=\\"idInput\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"Recherche\\" spellcheck=\\"false\\" value=\\"\\"></div>
8556
8556
  </form>
8557
8557
  </div>"
8558
8558
  `;
@@ -8560,7 +8560,7 @@ exports[`Label should render examples: Label 1`] = `
8560
8560
  exports[`Label should render examples: Label 2`] = `
8561
8561
  "<div>
8562
8562
  <form>
8563
- <div><label for=\\"idInput2\\" class=\\"styles__c-label___o4ozG\\">This is an inline label</label><input type=\\"text\\" id=\\"idInput2\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"Recherche\\" value=\\"\\"></div>
8563
+ <div><label for=\\"idInput2\\" class=\\"styles__c-label___o4ozG\\">This is an inline label</label><input type=\\"text\\" id=\\"idInput2\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"Recherche\\" spellcheck=\\"false\\" value=\\"\\"></div>
8564
8564
  </form>
8565
8565
  </div>"
8566
8566
  `;
@@ -8568,7 +8568,7 @@ exports[`Label should render examples: Label 2`] = `
8568
8568
  exports[`Label should render examples: Label 3`] = `
8569
8569
  "<div>
8570
8570
  <form>
8571
- <div><label for=\\"idInput2\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7 styles__is-error___2Dwem\\">This is an error label</label><input type=\\"text\\" id=\\"idInput2\\" class=\\"styles__c-input-text___3TAv1 styles__is-error___3lsCJ styles__c-input-text--large___28EaR\\" placeholder=\\"Recherche\\" value=\\"\\"></div>
8571
+ <div><label for=\\"idInput2\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7 styles__is-error___2Dwem\\">This is an error label</label><input type=\\"text\\" id=\\"idInput2\\" class=\\"styles__c-input-text___3TAv1 styles__is-error___3lsCJ styles__c-input-text--large___28EaR\\" placeholder=\\"Recherche\\" spellcheck=\\"false\\" value=\\"\\"></div>
8572
8572
  </form>
8573
8573
  </div>"
8574
8574
  `;
@@ -9403,8 +9403,8 @@ exports[`Wizard should render examples: Wizard 1`] = `
9403
9403
  <h3 class=\\"MuiTypography-root styles__wizard-title___11Dzr MuiTypography-h3 MuiTypography-colorTextPrimary\\">Connect to your Cozy</h3>
9404
9404
  </header>
9405
9405
  <div class=\\"styles__wizard-main___ObvId\\">
9406
- <div class=\\"styles__o-field___3n5HM\\"><label for=\\"\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\">Login</label><input type=\\"text\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"dalailama@cozycloud.cc\\" value=\\"\\"></div>
9407
- <div class=\\"styles__o-field___3n5HM\\"><label for=\\"\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\">Password</label><input type=\\"text\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"\\" value=\\"\\"></div>
9406
+ <div class=\\"styles__o-field___3n5HM\\"><label for=\\"\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\">Login</label><input type=\\"text\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"dalailama@cozycloud.cc\\" spellcheck=\\"false\\" value=\\"\\"></div>
9407
+ <div class=\\"styles__o-field___3n5HM\\"><label for=\\"\\" class=\\"styles__c-label___o4ozG styles__c-label--block___2ZV_7\\">Password</label><input type=\\"text\\" id=\\"\\" class=\\"styles__c-input-text___3TAv1 styles__c-input-text--large___28EaR\\" placeholder=\\"\\" spellcheck=\\"false\\" value=\\"\\"></div>
9408
9408
  <p class=\\"styles__wizard-errors___1ufSE u-error\\">There is an error</p>
9409
9409
  </div>
9410
9410
  <footer class=\\"styles__wizard-footer___-ZrgM u-pb-2\\"><button type=\\"submit\\" class=\\"styles__c-btn___-2Vnj styles__c-btn--large___2gatN styles__c-btn--center___16_Xh styles__wizard-next___38lPl\\"><span><span>Next step</span><svg viewBox=\\"0 0 16 16\\" class=\\"styles__icon___23x3R\\" style=\\"fill: white;\\" width=\\"16\\" height=\\"16\\">
@@ -39,7 +39,8 @@ var Input = /*#__PURE__*/forwardRef(function (props, ref) {
39
39
  className: cx(styles['c-input-text'], (_cx = {}, _defineProperty(_cx, styles["is-error"], error), _defineProperty(_cx, styles["c-input-text--".concat(size)], size), _defineProperty(_cx, styles["c-input-text--fullwidth"], fullwidth), _cx), className),
40
40
  disabled: disabled,
41
41
  placeholder: placeholder,
42
- value: value
42
+ value: value,
43
+ spellCheck: false
43
44
  }, restProps));
44
45
  });
45
46
  Input.displayName = 'Input';
@@ -65,7 +65,7 @@ var ActionMenuWrapper = /*#__PURE__*/forwardRef(function (_ref, ref) {
65
65
  if (isMobile) {
66
66
  return /*#__PURE__*/React.createElement(ActionMenuMobile, {
67
67
  onClose: onClose,
68
- isEditable: editPath && isEditableAttribute,
68
+ isEditable: Boolean(editPath) && isEditableAttribute,
69
69
  actions: {
70
70
  handleCopy: handleCopy,
71
71
  handleEdit: handleEdit
@@ -78,7 +78,7 @@ var ActionMenuWrapper = /*#__PURE__*/forwardRef(function (_ref, ref) {
78
78
  return /*#__PURE__*/React.createElement(ActionMenuDesktop, {
79
79
  ref: ref,
80
80
  onClose: onClose,
81
- isEditable: editPath && isEditableAttribute,
81
+ isEditable: Boolean(editPath) && isEditableAttribute,
82
82
  actions: {
83
83
  handleCopy: handleCopy,
84
84
  handleEdit: handleEdit
@@ -3,13 +3,27 @@ import React, { useRef, useState, createRef, useMemo, useEffect } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import List from "cozy-ui/transpiled/react/MuiCozyTheme/List";
5
5
  import { withViewerLocales } from "cozy-ui/transpiled/react/Viewer/hoc/withViewerLocales";
6
- import { formatMetadataQualification, knownDateMetadataNames, knowInformationMetadataNames, knowOtherMetadataNames } from "cozy-ui/transpiled/react/Viewer/helpers";
6
+ import { formatMetadataQualification, knownDateMetadataNames, knownInformationMetadataNames, knownOtherMetadataNames } from "cozy-ui/transpiled/react/Viewer/helpers";
7
7
  import QualificationListItemContact from "cozy-ui/transpiled/react/Viewer/Panel/QualificationListItemContact";
8
8
  import ActionMenuWrapper from "cozy-ui/transpiled/react/Viewer/Panel/ActionMenuWrapper";
9
9
  import QualificationListItemDate from "cozy-ui/transpiled/react/Viewer/Panel/QualificationListItemDate";
10
10
  import QualificationListItemInformation from "cozy-ui/transpiled/react/Viewer/Panel/QualificationListItemInformation";
11
11
  import QualificationListItemOther from "cozy-ui/transpiled/react/Viewer/Panel/QualificationListItemOther";
12
12
 
13
+ var makeQualificationListItemComp = function makeQualificationListItemComp(metadataName) {
14
+ if (knownDateMetadataNames.includes(metadataName)) {
15
+ return QualificationListItemDate;
16
+ }
17
+
18
+ if (knownInformationMetadataNames.includes(metadataName)) {
19
+ return QualificationListItemInformation;
20
+ }
21
+
22
+ if (knownOtherMetadataNames.includes(metadataName)) {
23
+ return QualificationListItemOther;
24
+ }
25
+ };
26
+
13
27
  var Qualification = function Qualification(_ref) {
14
28
  var _ref$file = _ref.file,
15
29
  file = _ref$file === void 0 ? {} : _ref$file;
@@ -49,61 +63,38 @@ var Qualification = function Qualification(_ref) {
49
63
  });
50
64
  };
51
65
 
52
- var metadataComputed = useMemo(function () {
66
+ var formatedMetadataQualification = useMemo(function () {
53
67
  return formatMetadataQualification(metadata);
54
68
  }, [metadata]);
55
69
  useEffect(function () {
56
- actionBtnRef.current = metadataComputed.map(function (_, idx) {
70
+ actionBtnRef.current = formatedMetadataQualification.map(function (_, idx) {
57
71
  var _actionBtnRef$current;
58
72
 
59
73
  return (_actionBtnRef$current = actionBtnRef.current[idx]) !== null && _actionBtnRef$current !== void 0 ? _actionBtnRef$current : /*#__PURE__*/createRef();
60
74
  });
61
- }, [metadataComputed]);
75
+ }, [formatedMetadataQualification]);
62
76
  return /*#__PURE__*/React.createElement(List, {
63
77
  className: 'u-pv-1'
64
- }, metadataComputed.map(function (meta, idx) {
78
+ }, formatedMetadataQualification.map(function (meta, idx) {
65
79
  var name = meta.name;
66
80
 
67
- if (knownDateMetadataNames.includes(name)) {
68
- return /*#__PURE__*/React.createElement(QualificationListItemDate, {
81
+ if (name === 'contact') {
82
+ return /*#__PURE__*/React.createElement(QualificationListItemContact, {
69
83
  key: idx,
70
- ref: actionBtnRef.current[idx],
71
- metadataComputed: meta,
72
- toggleActionsMenu: function toggleActionsMenu(val) {
73
- return _toggleActionsMenu(idx, name, val);
74
- }
84
+ file: file
75
85
  });
76
86
  }
77
87
 
78
- if (knowInformationMetadataNames.includes(name)) {
79
- return /*#__PURE__*/React.createElement(QualificationListItemInformation, {
80
- key: idx,
81
- ref: actionBtnRef.current[idx],
82
- metadataComputed: meta,
83
- toggleActionsMenu: function toggleActionsMenu(val) {
84
- return _toggleActionsMenu(idx, name, val);
85
- }
86
- });
87
- }
88
-
89
- if (knowOtherMetadataNames.includes(name)) {
90
- if (name === 'contact') {
91
- return /*#__PURE__*/React.createElement(QualificationListItemContact, {
92
- key: idx,
93
- file: file
94
- });
88
+ var QualificationListItemComp = makeQualificationListItemComp(name);
89
+ return /*#__PURE__*/React.createElement(QualificationListItemComp, {
90
+ key: idx,
91
+ ref: actionBtnRef.current[idx],
92
+ formatedMetadataQualification: meta,
93
+ toggleActionsMenu: function toggleActionsMenu(val) {
94
+ return _toggleActionsMenu(idx, name, val);
95
95
  }
96
-
97
- return /*#__PURE__*/React.createElement(QualificationListItemOther, {
98
- key: idx,
99
- ref: actionBtnRef.current[idx],
100
- metadataComputed: meta,
101
- toggleActionsMenu: function toggleActionsMenu(val) {
102
- return _toggleActionsMenu(idx, name, val);
103
- }
104
- });
105
- }
106
- }), optionFile.value && /*#__PURE__*/React.createElement(ActionMenuWrapper, {
96
+ });
97
+ }), optionFile.name && /*#__PURE__*/React.createElement(ActionMenuWrapper, {
107
98
  onClose: hideActionsMenu,
108
99
  file: file,
109
100
  optionFile: optionFile,
@@ -114,4 +105,4 @@ var Qualification = function Qualification(_ref) {
114
105
  Qualification.propTypes = {
115
106
  file: PropTypes.object
116
107
  };
117
- export default withViewerLocales( /*#__PURE__*/React.memo(Qualification));
108
+ export default withViewerLocales(Qualification);
@@ -9,7 +9,7 @@ import QualificationListItemText from "cozy-ui/transpiled/react/Viewer/Panel/Qua
9
9
  import { useI18n } from "cozy-ui/transpiled/react/I18n";
10
10
  import { formatDate } from "cozy-ui/transpiled/react/Viewer/helpers";
11
11
  var QualificationListItemDate = /*#__PURE__*/forwardRef(function (_ref, ref) {
12
- var metadataComputed = _ref.metadataComputed,
12
+ var formatedMetadataQualification = _ref.formatedMetadataQualification,
13
13
  toggleActionsMenu = _ref.toggleActionsMenu;
14
14
 
15
15
  var _useI18n = useI18n(),
@@ -17,18 +17,19 @@ var QualificationListItemDate = /*#__PURE__*/forwardRef(function (_ref, ref) {
17
17
  f = _useI18n.f,
18
18
  lang = _useI18n.lang;
19
19
 
20
- var name = metadataComputed.name,
21
- value = metadataComputed.value;
22
- var formattedDate = formatDate({
20
+ var name = formatedMetadataQualification.name,
21
+ value = formatedMetadataQualification.value;
22
+ var formattedDate = value ? formatDate({
23
23
  f: f,
24
24
  lang: lang,
25
25
  date: value
26
- });
26
+ }) : t('Viewer.panel.qualification.noInfo');
27
27
  return /*#__PURE__*/React.createElement(ListItem, {
28
28
  className: 'u-pl-2 u-pr-3'
29
29
  }, /*#__PURE__*/React.createElement(QualificationListItemText, {
30
30
  primary: t("Viewer.panel.qualification.date.title.".concat(name)),
31
- secondary: formattedDate
31
+ secondary: formattedDate,
32
+ disabled: !value
32
33
  }), /*#__PURE__*/React.createElement(ListItemSecondaryAction, null, /*#__PURE__*/React.createElement(IconButton, {
33
34
  ref: ref,
34
35
  onClick: function onClick() {
@@ -40,7 +41,7 @@ var QualificationListItemDate = /*#__PURE__*/forwardRef(function (_ref, ref) {
40
41
  });
41
42
  QualificationListItemDate.displayName = 'QualificationListItemDate';
42
43
  QualificationListItemDate.propTypes = {
43
- metadataComputed: PropTypes.shape({
44
+ formatedMetadataQualification: PropTypes.shape({
44
45
  name: PropTypes.string,
45
46
  value: PropTypes.string
46
47
  }).isRequired,
@@ -8,19 +8,20 @@ import Dots from "cozy-ui/transpiled/react/Icons/Dots";
8
8
  import QualificationListItemText from "cozy-ui/transpiled/react/Viewer/Panel/QualificationListItemText";
9
9
  import { useI18n } from "cozy-ui/transpiled/react/I18n";
10
10
  var QualificationListItemInformation = /*#__PURE__*/forwardRef(function (_ref, ref) {
11
- var metadataComputed = _ref.metadataComputed,
11
+ var formatedMetadataQualification = _ref.formatedMetadataQualification,
12
12
  toggleActionsMenu = _ref.toggleActionsMenu;
13
13
 
14
14
  var _useI18n = useI18n(),
15
15
  t = _useI18n.t;
16
16
 
17
- var name = metadataComputed.name,
18
- value = metadataComputed.value;
17
+ var name = formatedMetadataQualification.name,
18
+ value = formatedMetadataQualification.value;
19
19
  return /*#__PURE__*/React.createElement(ListItem, {
20
20
  className: 'u-pl-2 u-pr-3'
21
21
  }, /*#__PURE__*/React.createElement(QualificationListItemText, {
22
22
  primary: t("Viewer.panel.qualification.information.title.".concat(name)),
23
- secondary: value
23
+ secondary: value || t('Viewer.panel.qualification.noInfo'),
24
+ disabled: !value
24
25
  }), /*#__PURE__*/React.createElement(ListItemSecondaryAction, null, /*#__PURE__*/React.createElement(IconButton, {
25
26
  ref: ref,
26
27
  onClick: function onClick() {
@@ -32,7 +33,7 @@ var QualificationListItemInformation = /*#__PURE__*/forwardRef(function (_ref, r
32
33
  });
33
34
  QualificationListItemInformation.displayName = 'QualificationListItemNumber';
34
35
  QualificationListItemInformation.propTypes = {
35
- metadataComputed: PropTypes.shape({
36
+ formatedMetadataQualification: PropTypes.shape({
36
37
  name: PropTypes.string,
37
38
  value: PropTypes.string
38
39
  }).isRequired,
@@ -11,7 +11,7 @@ import { useI18n } from "cozy-ui/transpiled/react/I18n";
11
11
  import MidEllipsis from "cozy-ui/transpiled/react/MidEllipsis";
12
12
  var getBoundT = models.document.locales.getBoundT;
13
13
  var QualificationListItemOther = /*#__PURE__*/forwardRef(function (_ref, ref) {
14
- var metadataComputed = _ref.metadataComputed,
14
+ var formatedMetadataQualification = _ref.formatedMetadataQualification,
15
15
  toggleActionsMenu = _ref.toggleActionsMenu;
16
16
 
17
17
  var _useI18n = useI18n(),
@@ -19,8 +19,8 @@ var QualificationListItemOther = /*#__PURE__*/forwardRef(function (_ref, ref) {
19
19
  lang = _useI18n.lang;
20
20
 
21
21
  var scannerT = getBoundT(lang);
22
- var name = metadataComputed.name,
23
- value = metadataComputed.value;
22
+ var name = formatedMetadataQualification.name,
23
+ value = formatedMetadataQualification.value;
24
24
  if (!value) return null;
25
25
  var currentValueTranslated = name === 'qualification' ? scannerT("Scan.items.".concat(value)) : t("Viewer.panel.qualification.".concat(value));
26
26
  return /*#__PURE__*/React.createElement(ListItem, {
@@ -41,7 +41,7 @@ var QualificationListItemOther = /*#__PURE__*/forwardRef(function (_ref, ref) {
41
41
  });
42
42
  QualificationListItemOther.displayName = 'QualificationListItemOther';
43
43
  QualificationListItemOther.propTypes = {
44
- metadataComputed: PropTypes.shape({
44
+ formatedMetadataQualification: PropTypes.shape({
45
45
  name: PropTypes.string,
46
46
  value: PropTypes.string
47
47
  }).isRequired,
@@ -5,20 +5,25 @@ import Typography from "cozy-ui/transpiled/react/Typography";
5
5
 
6
6
  var QualificationListItemText = function QualificationListItemText(_ref) {
7
7
  var primary = _ref.primary,
8
- secondary = _ref.secondary;
8
+ secondary = _ref.secondary,
9
+ disabled = _ref.disabled;
9
10
  return /*#__PURE__*/React.createElement(ListItemText, {
10
11
  disableTypography: true,
11
12
  primary: /*#__PURE__*/React.createElement(Typography, {
12
- variant: 'caption'
13
+ variant: "caption"
13
14
  }, primary),
14
15
  secondary: /*#__PURE__*/React.createElement(Typography, {
15
- variant: 'body1'
16
+ component: "div",
17
+ variant: "body1",
18
+ style: disabled ? {
19
+ color: 'var(--disabledTextColor)'
20
+ } : undefined
16
21
  }, secondary)
17
22
  });
18
23
  };
19
24
 
20
25
  QualificationListItemText.propTypes = {
21
26
  primary: PropTypes.string.isRequired,
22
- secondary: PropTypes.string.isRequired
27
+ secondary: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired
23
28
  };
24
29
  export default QualificationListItemText;
@@ -5,10 +5,10 @@ import has from 'lodash/has';
5
5
  import { models } from 'cozy-client';
6
6
  var isEncrypted = models.file.isEncrypted;
7
7
  export var knownDateMetadataNames = ['AObtentionDate', 'BObtentionDate', 'CObtentionDate', 'DObtentionDate', 'obtentionDate', 'expirationDate', 'referencedDate', 'issueDate', 'shootingDate', 'date', 'datetime'];
8
- export var knowInformationMetadataNames = ['number', 'cardNumber', 'vinNumber', 'ibanNumber', 'country'];
9
- export var knowOtherMetadataNames = ['contact', 'page', 'qualification'];
8
+ export var knownInformationMetadataNames = ['number', 'cardNumber', 'vinNumber', 'ibanNumber', 'country'];
9
+ export var knownOtherMetadataNames = ['contact', 'page', 'qualification'];
10
10
  export var getCurrentModel = function getCurrentModel(metadataName) {
11
- if (knownDateMetadataNames.includes(metadataName) || knowInformationMetadataNames.includes(metadataName)) {
11
+ if (knownDateMetadataNames.includes(metadataName) || knownInformationMetadataNames.includes(metadataName)) {
12
12
  return 'information';
13
13
  }
14
14
 
@@ -94,52 +94,60 @@ export var downloadFile = /*#__PURE__*/function () {
94
94
  export var isFileEncrypted = function isFileEncrypted(file) {
95
95
  return isEncrypted(file);
96
96
  };
97
+
98
+ var makeMetadataQualification = function makeMetadataQualification(_ref7) {
99
+ var metadata = _ref7.metadata,
100
+ knownMetadataName = _ref7.knownMetadataName,
101
+ value = _ref7.value;
102
+ var shouldReturnThisMetadata = Object.keys(metadata).includes(knownMetadataName);
103
+
104
+ if (shouldReturnThisMetadata) {
105
+ return {
106
+ name: knownMetadataName,
107
+ value: value || null
108
+ };
109
+ }
110
+ };
97
111
  /**
98
112
  * @param {Object} metadata
99
113
  * @returns {{ name: string, value: string }[]} Array of formated metadata
100
114
  */
101
115
 
116
+
102
117
  export var formatMetadataQualification = function formatMetadataQualification(metadata) {
103
118
  var dates = knownDateMetadataNames.map(function (dateName) {
104
- if (metadata[dateName]) {
105
- return {
106
- name: dateName,
107
- value: metadata[dateName]
108
- };
109
- }
119
+ return makeMetadataQualification({
120
+ metadata: metadata,
121
+ knownMetadataName: dateName,
122
+ value: metadata[dateName]
123
+ });
110
124
  }).filter(Boolean).filter(function (data, _, arr) {
111
125
  if (arr.length > 1) return data.name !== 'datetime';
112
126
  return data;
113
127
  });
114
- var numbers = knowInformationMetadataNames.map(function (numberName) {
115
- if (metadata[numberName]) {
116
- return {
117
- name: numberName,
118
- value: metadata[numberName]
119
- };
120
- }
128
+ var informations = knownInformationMetadataNames.map(function (numberName) {
129
+ return makeMetadataQualification({
130
+ metadata: metadata,
131
+ knownMetadataName: numberName,
132
+ value: metadata[numberName]
133
+ });
121
134
  }).filter(Boolean);
122
- var others = knowOtherMetadataNames.map(function (otherName) {
123
- if (otherName === 'qualification') {
124
- var _metadata$otherName;
125
-
126
- return {
127
- name: otherName,
128
- value: (_metadata$otherName = metadata[otherName]) === null || _metadata$otherName === void 0 ? void 0 : _metadata$otherName.label
129
- };
130
- }
135
+ var others = knownOtherMetadataNames.map(function (otherName) {
136
+ var _metadata$otherName;
131
137
 
132
- return {
133
- name: otherName,
134
- value: metadata[otherName]
135
- };
138
+ var value = otherName === 'qualification' ? (_metadata$otherName = metadata[otherName]) === null || _metadata$otherName === void 0 ? void 0 : _metadata$otherName.label : metadata[otherName];
139
+ return makeMetadataQualification({
140
+ metadata: metadata,
141
+ knownMetadataName: otherName,
142
+ value: value
143
+ });
136
144
  }).filter(Boolean);
137
- return [].concat(_toConsumableArray(dates), _toConsumableArray(numbers), _toConsumableArray(others));
145
+ return [].concat(_toConsumableArray(dates), _toConsumableArray(informations), _toConsumableArray(others));
138
146
  };
139
- export var formatDate = function formatDate(_ref7) {
140
- var f = _ref7.f,
141
- lang = _ref7.lang,
142
- date = _ref7.date;
147
+ export var formatDate = function formatDate(_ref8) {
148
+ var f = _ref8.f,
149
+ lang = _ref8.lang,
150
+ date = _ref8.date;
143
151
 
144
152
  if (lang === 'en') {
145
153
  return f(date, 'MM/DD/YYYY');
@@ -65,6 +65,7 @@ var en = {
65
65
  front: "Front side",
66
66
  back: "Back side",
67
67
  qualification: "Qualification",
68
+ noInfo: "No information",
68
69
  actions: {
69
70
  copy: "Copy",
70
71
  copyClipboard: "Copy to clipboard",
@@ -157,6 +158,7 @@ var fr = {
157
158
  front: "Face avant",
158
159
  back: "Face arri\xE8re",
159
160
  qualification: "Qualification",
161
+ noInfo: "Non renseign\xE9(e)",
160
162
  actions: {
161
163
  copy: "Copier",
162
164
  copyClipboard: "Copier dans le presse-papier",