@hipay/hipay-material-ui 2.0.0-beta.54 → 2.0.0-beta.56

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/HiBreadcrumb/HiBreadcrumb.js +14 -4
  3. package/HiBreadcrumb/HiStep.js +4 -1
  4. package/HiBreadcrumb/HiStepContent.js +0 -1
  5. package/HiBreadcrumb/HiStepLabel.js +12 -4
  6. package/HiBreadcrumb/HiStepper.js +1 -1
  7. package/HiButton/HiButton.js +7 -1
  8. package/HiCell/CellIcon.js +4 -4
  9. package/HiCell/CellImage.js +28 -4
  10. package/HiCell/CellNumeric.js +1 -2
  11. package/HiCell/CellRate.js +6 -3
  12. package/HiCell/CellSentinel.js +7 -10
  13. package/HiCell/CellSentinelScore.js +4 -4
  14. package/HiCell/CellTextStyled.js +99 -0
  15. package/HiCell/index.js +9 -1
  16. package/HiChip/HiChip.js +1 -0
  17. package/HiDatePicker/Caption.js +8 -9
  18. package/HiDatePicker/HiDateRangePicker.js +37 -19
  19. package/HiDatePicker/HiDateRangeSelector.js +24 -22
  20. package/HiDatePicker/Overlays/CustomOverlayLayout.js +26 -17
  21. package/HiDatePicker/Overlays/MonthPickerOverlay.spec.js +1 -0
  22. package/HiDatePicker/Overlays/Overlay.js +15 -8
  23. package/HiDatePicker/Overlays/Overlay.spec.js +1 -0
  24. package/HiDatePicker/Overlays/TimePickerOverlay.js +2 -2
  25. package/HiDatePicker/Overlays/TimePickerOverlay.spec.js +1 -0
  26. package/HiDatePicker/Overlays/YearPickerOverlay.js +2 -4
  27. package/HiDatePicker/Overlays/YearPickerOverlay.spec.js +1 -0
  28. package/HiDatePicker/stylesheet.js +3 -2
  29. package/HiDotsStepper/HiDot.js +108 -0
  30. package/HiDotsStepper/HiDotsStepper.js +121 -0
  31. package/HiExpansionPanel/HiExpansionPanel.js +1 -1
  32. package/HiForm/HiAddressField.js +176 -0
  33. package/HiForm/HiSlider.js +352 -0
  34. package/HiForm/HiUpload.js +204 -0
  35. package/HiForm/HiUploadField.js +182 -0
  36. package/HiForm/HiUploadInput.js +459 -0
  37. package/HiForm/index.js +16 -0
  38. package/HiMap/HiMap.js +345 -0
  39. package/HiMap/HiMapExpand.js +210 -0
  40. package/HiMap/index.js +23 -0
  41. package/HiNotice/HiKPI.js +238 -0
  42. package/HiNotice/HiKPINotice.js +93 -0
  43. package/HiNotice/index.js +23 -0
  44. package/HiPdfReader/HiPdfReader.js +269 -0
  45. package/HiPdfReader/index.js +15 -0
  46. package/HiRadio/HiRadio.js +74 -0
  47. package/HiRadio/index.js +15 -0
  48. package/HiSelect/HiSelect.js +73 -84
  49. package/HiSelect/HiSuggestSelect.js +32 -5
  50. package/HiSelect/SelectInput.js +5 -0
  51. package/HiSelectNew/HiNestedSelectContent.js +5 -1
  52. package/HiSelectNew/HiSelect.js +174 -137
  53. package/HiSelectNew/HiSelectContent.js +0 -8
  54. package/HiSelectNew/HiSelectInput.js +8 -9
  55. package/HiSelectableList/HiSelectableList.js +32 -4
  56. package/HiSelectableList/HiSelectableListItem.js +62 -24
  57. package/HiTable/HiCellBuilder.js +42 -32
  58. package/HiTable/HiTableHeader.js +28 -21
  59. package/HiTable/constants.js +3 -1
  60. package/README.md +249 -98
  61. package/es/HiBreadcrumb/HiBreadcrumb.js +14 -4
  62. package/es/HiBreadcrumb/HiStep.js +4 -1
  63. package/es/HiBreadcrumb/HiStepContent.js +0 -1
  64. package/es/HiBreadcrumb/HiStepLabel.js +13 -4
  65. package/es/HiBreadcrumb/HiStepper.js +1 -1
  66. package/es/HiButton/HiButton.js +7 -0
  67. package/es/HiCell/CellIcon.js +5 -5
  68. package/es/HiCell/CellImage.js +25 -2
  69. package/es/HiCell/CellNumeric.js +1 -2
  70. package/es/HiCell/CellRate.js +6 -3
  71. package/es/HiCell/CellSentinel.js +7 -10
  72. package/es/HiCell/CellSentinelScore.js +4 -4
  73. package/es/HiCell/CellTextStyled.js +84 -0
  74. package/es/HiCell/index.js +2 -1
  75. package/es/HiChip/HiChip.js +1 -0
  76. package/es/HiDatePicker/Caption.js +7 -9
  77. package/es/HiDatePicker/HiDateRangePicker.js +41 -25
  78. package/es/HiDatePicker/HiDateRangeSelector.js +24 -22
  79. package/es/HiDatePicker/ListPicker.js +1 -1
  80. package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +30 -19
  81. package/es/HiDatePicker/Overlays/MonthPickerOverlay.js +2 -2
  82. package/es/HiDatePicker/Overlays/MonthPickerOverlay.spec.js +1 -0
  83. package/es/HiDatePicker/Overlays/Overlay.js +16 -9
  84. package/es/HiDatePicker/Overlays/Overlay.spec.js +1 -0
  85. package/es/HiDatePicker/Overlays/TimePickerOverlay.js +2 -2
  86. package/es/HiDatePicker/Overlays/TimePickerOverlay.spec.js +1 -0
  87. package/es/HiDatePicker/Overlays/YearPickerOverlay.js +2 -4
  88. package/es/HiDatePicker/Overlays/YearPickerOverlay.spec.js +1 -0
  89. package/es/HiDatePicker/stylesheet.js +3 -2
  90. package/es/HiDotsStepper/HiDot.js +66 -0
  91. package/es/HiDotsStepper/HiDotsStepper.js +73 -0
  92. package/es/HiExpansionPanel/HiExpansionPanel.js +1 -1
  93. package/es/HiForm/HiAddressField.js +134 -0
  94. package/es/HiForm/HiSlider.js +302 -0
  95. package/es/HiForm/HiUpload.js +158 -0
  96. package/es/HiForm/HiUploadField.js +140 -0
  97. package/es/HiForm/HiUploadInput.js +411 -0
  98. package/es/HiForm/index.js +2 -0
  99. package/es/HiMap/HiMap.js +290 -0
  100. package/es/HiMap/HiMapExpand.js +162 -0
  101. package/es/HiMap/index.js +2 -0
  102. package/es/HiNotice/HiKPI.js +196 -0
  103. package/es/HiNotice/HiKPINotice.js +77 -0
  104. package/es/HiNotice/index.js +2 -0
  105. package/es/HiPdfReader/HiPdfReader.js +214 -0
  106. package/es/HiPdfReader/index.js +1 -0
  107. package/es/HiRadio/HiRadio.js +55 -0
  108. package/es/HiRadio/index.js +1 -0
  109. package/es/HiSelect/HiSelect.js +68 -78
  110. package/es/HiSelect/HiSuggestSelect.js +27 -6
  111. package/es/HiSelect/SelectInput.js +5 -0
  112. package/es/HiSelectNew/HiNestedSelectContent.js +5 -1
  113. package/es/HiSelectNew/HiSelect.js +156 -120
  114. package/es/HiSelectNew/HiSelectContent.js +0 -7
  115. package/es/HiSelectNew/HiSelectInput.js +8 -9
  116. package/es/HiSelectableList/HiSelectableList.js +28 -6
  117. package/es/HiSelectableList/HiSelectableListItem.js +71 -24
  118. package/es/HiTable/HiCellBuilder.js +140 -136
  119. package/es/HiTable/HiTableHeader.js +26 -18
  120. package/es/HiTable/constants.js +1 -0
  121. package/es/index.js +7 -0
  122. package/es/utils/helpers.js +1 -1
  123. package/index.es.js +8 -1
  124. package/index.js +57 -1
  125. package/package.json +6 -3
  126. package/umd/hipay-material-ui.development.js +42114 -35120
  127. package/umd/hipay-material-ui.production.min.js +2 -2
  128. package/utils/helpers.js +1 -1
package/README.md CHANGED
@@ -1,152 +1,303 @@
1
- <p align="center">
2
- <a href="https://material-ui.com/" rel="noopener" target="_blank"><img width="150" src="https://material-ui.com/static/images/material-ui-logo.svg" alt="Material-UI logo"></a></p>
3
- </p>
1
+ # Material-UI docs
4
2
 
5
- <h1 align="center">Material-UI</h1>
3
+ Voici la documentation du site HiPay Material-UI.
6
4
 
7
- <div align="center">
5
+ Avant de commencer, il faut vous familiariser avec REACT :
6
+ - https://reactjs.org/
7
+ - https://reactjs.org/docs/optimizing-performance.html
8
8
 
9
- [React](http://facebook.github.io/react/) components that implement [Google's Material Design](https://www.google.com/design/spec/material-design/introduction.html).
9
+ Et connaîtres les [best practices](#best-practices)
10
10
 
11
- [![npm package](https://img.shields.io/npm/v/@material-ui/core/latest.svg)](https://www.npmjs.com/package/@material-ui/core)
12
- [![npm downloads](https://img.shields.io/npm/dm/@material-ui/core.svg)](https://www.npmjs.com/package/@material-ui/core)
13
- [![CircleCI](https://img.shields.io/circleci/project/github/mui-org/material-ui/master.svg)](https://circleci.com/gh/mui-org/material-ui/tree/master)
14
- [![Gitter](https://img.shields.io/badge/gitter-join%20chat-f81a65.svg)](https://gitter.im/callemall/material-ui?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
15
- [![Coverage Status](https://img.shields.io/codecov/c/github/mui-org/material-ui/master.svg)](https://codecov.io/gh/mui-org/material-ui/branch/master)
16
- [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1320/badge)](https://bestpractices.coreinfrastructure.org/projects/1320)
17
- ![Code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)
18
- [![Follow on Twitter](https://img.shields.io/twitter/follow/MaterialUI.svg?label=follow+Material-UI)](https://twitter.com/MaterialUI)
19
- [![PeerDependencies](https://img.shields.io/david/peer/mui-org/material-ui.svg)](https://david-dm.org/mui-org/material-ui?type=peer)
20
- [![Dependencies](https://img.shields.io/david/mui-org/material-ui.svg)](https://david-dm.org/mui-org/material-ui)
21
- [![DevDependencies](https://img.shields.io/david/dev/mui-org/material-ui.svg)](https://david-dm.org/mui-org/material-ui?type=dev)
22
- [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/mui-org/material-ui.svg)](http://isitmaintained.com/project/mui-org/material-ui "Average time to resolve an issue")
23
11
 
24
- </div>
12
+ ## Lancer le projet
25
13
 
26
- ## Installation
14
+ #### Via docker
27
15
 
28
- Material-UI is available as an [npm package](https://www.npmjs.com/package/@material-ui/core).
16
+ Il faut que sur votre poste soit installés
17
+ - [Docker](https://www.docker.com/community-edition) (minimum version 17)
18
+ - [Docker Compose](#https://docs.docker.com/compose/install/) (minimum version 1.13.0)
29
19
 
30
- **[Stable channel v1](https://material-ui.com/)**
20
+ Puis lancez les commandes
31
21
  ```sh
32
- // with npm
33
- npm install @material-ui/core
22
+ docker-compose build
23
+ docker-compose up -d
34
24
 
35
- // with yarn
36
- yarn add @material-ui/core
25
+ # En cas d'erreurs, vérifiez les logs
26
+ docker-compose logs -f
37
27
  ```
28
+ Le site est dispo à cette URL:
29
+ [http://localhost:3222](http://localhost:3222)
38
30
 
39
- **[v0.x](https://v0.material-ui.com/)** ([Migration to v1](https://material-ui.com/guides/migration-v0x/))
31
+ #### En local
32
+
33
+ Il faut que sur votre poste soit installés
34
+ - [node](https://nodejs.org/fr/) (minimum version LTS 8.9.4)
35
+ - [npm](https://www.npmjs.com/) (minimum version 5.6.0)
36
+
37
+ Puis lancez les commandes
38
+ ```sh
39
+ npm install
40
+
41
+ # En mode dev :
42
+ npm start
43
+ # équivaut à
44
+ npm run docs:dev
45
+
46
+ # En mode prod :
47
+ npm run docs:build
48
+ npm run docs:start
49
+ ```
50
+ Le site est dispo à cette URL:
51
+ [http://localhost:3000](http://localhost:3000)
52
+
53
+ ## Best practices
54
+ #### Patterns
55
+ - single "source of truth" / top>down data flow
56
+ https://reactjs.org/docs/lifting-state-up.html
57
+ https://reactjs.org/docs/state-and-lifecycle.html#the-data-flows-down
58
+
59
+ - classique patterns
60
+ https://reactpatterns.com
61
+
62
+ - accéder au thème dans un composant (en dehors du style)
63
+ export default withStyles(styles, { withTheme: true })(CellStatus);
64
+ ne plus utiliser la notation
65
+ export default withStyles(styles)(withTheme()(CellStatus));
66
+
67
+ #### Optimisation
68
+ - Faire attention au Lifecycle ! ne pas introduire de boucle infinie en "updatant" le state d'un composant dans une mauvaise phase. (voir schéma ci-dessous).
69
+ Si le composant à besoin d'accéder à son DOM (pour redéfinir sa taille...), on préfère le gérer en js pur pour ne pas refaire un cycle (voir la gestion des scrolls dans HiTable/HiTable.js ou l'ellipse au milieu dans HiTable/BodyCells/CellText.js )
70
+ <img width="800" src="/static/react-lifecycle.png" alt="react-lifecycle">
71
+
72
+ - Comprendre la différence entre React.Component & React.PureComponent
73
+ https://codeburst.io/when-to-use-component-or-purecomponent-a60cfad01a81
74
+
75
+ - Comprendre le principe de réconciliation pour optimiser les ensembles de composants (listes, tableaux...) -> use "key" !
76
+ https://reactjs.org/docs/lists-and-keys.html
77
+ https://reactjs.org/docs/reconciliation.html
78
+
79
+ - Attention aux refs et aux mutations
80
+ ex: ne pas passer une arrow fonction directement dans les props d'un composant. Même pour y inclure un index ou une valeur contextuelle !
81
+
82
+ ## Contribuer
83
+
84
+ #### A savoir
85
+ - Notre projet sur JIRA : [PSYCHE - Production](https://jira.hipay.org/secure/RapidBoard.jspa?rapidView=90&projectKey=PSYCHE)
86
+ - Pour ouvrir nos features, nous utilisons [git flow](https://danielkummer.github.io/git-flow-cheatsheet/)
87
+ Après avoir cloner le projet, il faudra lancer la commande `git flow init` **depuis la master**
88
+
89
+ ```sh
90
+ git clone git@gitlab.hipay.org:backend/hipay-material-ui.git
91
+ git checkout master
92
+ git flow init
93
+ # Tapez "Entrée" pour toutes les questions
94
+ ```
95
+
96
+ - Tous les composants sont dans le dossier /src.
97
+ - Nos composants HiPay doivent être préfixés par "Hi", par exemple HiTable, HiButton...
98
+ - Pour un code bien formatter, on utilise [ESLint - Prettier](#eslint-prettier)
99
+ - Pour activer ESLint sur PHPStorm : File -> Settings -> Languages & Frameworks -> Code Qaulity Tools -> ESLint -> Enable
100
+
101
+ #### Pour rajouter de la documentation dans les démos
102
+ [Lire ce guide](https://github.com/callemall/material-ui/blob/v1-beta/CONTRIBUTING.md)
103
+
104
+ #### Pour rajouter des composants dans la liste "API"
105
+ Il faut les rajouter tout en haut du markdown de la page dans la liste des "components:"
106
+ Par exemple sur la page des tableaux : http://localhost:3000/demos/tables
107
+ => Il faut les rajouter au fichier [hi-table.md](docs/src/pages/demos/hi-table/hi-table.md)
108
+
109
+ #### Workflow d'une feature
110
+ - S'affecter la tâche JIRA et la passer à "dev in progress" (projet [PSYCHE - Production](https://jira.hipay.org/secure/RapidBoard.jspa?rapidView=90&projectKey=PSYCHE))
111
+ - Ouvrir la feature via git flow
112
+
113
+ ```sh
114
+ git flow feature start PSYCHE-XXX
115
+ ```
116
+
117
+ - Avant de commiter ou pusher, il faut vérifier la [Definition Of Done](https://docs.google.com/spreadsheets/d/1qYanLfy2k_VYuclar3aAWSUo9b3soI48ZCjkKK83Rr0/edit?usp=drive_web&ouid=102268869535987309171)
118
+ - Les [tests unitaires](#tests) doivent passer
119
+ - La [génération des apis](#generation-des-apis) aussi
120
+ - Le code doit être bien formatter : [ESLint - Prettier](#esLint-prettier)
121
+ - Commit - suivant les conventions de rédaction des messages de commit
122
+ - Push
123
+ - Faire la demande de merge request sur la develop
124
+ - La revue se fera par un membre de l'équipe PSYCHE
125
+
126
+ ##### Conventional Changelog
127
+
128
+ (optionel) installer [commitizen](https://github.com/commitizen/cz-cli) pour s'assurer de commiter selon la convention
40
129
  ```sh
41
- // with npm
42
- npm install material-ui
130
+ npm install commitizen -g
131
+ ```
43
132
 
44
- // with yarn
45
- yarn add material-ui
133
+
134
+ Voici un squelette d’exemple de message de commit conventionnel :
46
135
  ```
136
+ <type de tâche>(<périmètre>): message court
47
137
 
138
+ Description complémentaire/complète
48
139
 
49
- Please note that `@next` will only point to pre-releases; to get the latest stable release use `@latest` instead.
140
+ Référence/action sur un ticket définissant cette tâche
141
+ ```
50
142
 
51
- ## Supporting Material-UI
143
+ On facilite ainsi la lecture du log d’une part, la génération automatique du changelog (ou release notes) d’autre part
52
144
 
53
- Material-UI is an MIT-licensed open source project. It's an independent project with ongoing development made possible thanks to the support of these awesome [backers](/BACKERS.md). If you'd like to join them, please consider:
54
- - [Become a backer or sponsor on Patreon](https://www.patreon.com/oliviertassinari).
55
- - [Become a backer or sponsor on OpenCollective](https://opencollective.com/material-ui).
145
+ Types de tâche:
146
+ - <b>fix</b> : commit d'une correction de bug. Se traduit en <b>PATCH</b> dans le changelog
147
+ - <b>feat</b> : commit d'une nouvelle feature. Se traduit en <b>MINOR</b> dans le changelog
148
+ - <b>test</b> : commit d'un ajout ou d'une maj de tests
149
+ - <b>docs</b> : commit d'un ajout ou d'une maj de la documentation OU de l'app de démonstration
150
+ - <b>perf</b> : commit concernant l'amélioration des performances
56
151
 
57
- #### What's the difference between Patreon and OpenCollective?
152
+ <b>BREAKING CHANGE</b> : si un commit introduit un BREAKING CHANGE, on doit ajouter le tag BREAKING CHANGE dans le corps du commit. Ce commit peut être de n'importe quel type mais il est préférable qu'il soit lié à une feature. Se traduit en <b>MAJOR</b> dans le changelog
58
153
 
59
- Funds donated via Patreon directly support [Olivier Tassinari](https://github.com/oliviertassinari)'s work on Material-UI.
60
- Funds donated via OpenCollective are managed transparently and will be used for compensating work and expenses for core team members.
61
- Your name/logo will receive proper recognition and exposure by donating on either platform.
154
+ Périmètre (optionel): nom du composant, type de tests, page de la doc
62
155
 
63
- ### Gold Sponsors
156
+ Exemple:
157
+ ```
158
+ feat(HiTable): add children rows management
64
159
 
65
- Gold Sponsors are those who have pledged $500/month and more to Material-UI.
160
+ Handle children rows as subtable based on the same columns as parents.
66
161
 
67
- via [Patreon](https://www.patreon.com/oliviertassinari)
162
+ PSYCHE-XX
163
+ ```
68
164
 
69
- <p style="display: flex;">
70
- <a href="https://www.creative-tim.com/?utm_source=material-ui&utm_medium=docs&utm_campaign=homepage" rel="noopener" target="_blank"><img width="126" src="https://avatars1.githubusercontent.com/u/20172349?s=378" alt="creative-tim" title="Premium Themes"></a>
71
- <a href="https://bitsrc.io" rel="noopener" target="_blank"><img width="96" src="https://avatars1.githubusercontent.com/u/24789812?s=192" alt="bitsrc" title="The fastest way to share code"></a>
72
- </p>
165
+ ## Génération des apis
166
+ ```sh
167
+ npm run docs:api
168
+ ```
73
169
 
74
- via [OpenCollective](https://opencollective.com/material-ui)
170
+ ## Tests
171
+ Tous les composants doivent avoir leur test à côté (fichier .spec.js)
172
+ On utilise [mocha](https://mochajs.org/), [chai](http://chaijs.com/) et [enzyme](http://airbnb.io/enzyme/docs/api/)
75
173
 
76
- <a href="https://opencollective.com/material-ui/tiers/gold-sponsors/0/website" rel="noopener" target="_blank"><img src="https://opencollective.com/material-ui/tiers/gold-sponsors/0/avatar.svg" alt="0" /></a>
77
- <a href="https://opencollective.com/material-ui/tiers/gold-sponsors/1/website" rel="noopener" target="_blank"><img src="https://opencollective.com/material-ui/tiers/gold-sponsors/1/avatar.svg" alt="1" /></a>
78
- <a href="https://opencollective.com/material-ui/tiers/gold-sponsors/2/website" rel="noopener" target="_blank"><img src="https://opencollective.com/material-ui/tiers/gold-sponsors/2/avatar.svg" alt="2" /></a>
79
- <a href="https://opencollective.com/material-ui/tiers/gold-sponsors/3/website" rel="noopener" target="_blank"><img src="https://opencollective.com/material-ui/tiers/gold-sponsors/3/avatar.svg" alt="3" /></a>
80
- <a href="https://opencollective.com/material-ui/tiers/gold-sponsors/4/website" rel="noopener" target="_blank"><img src="https://opencollective.com/material-ui/tiers/gold-sponsors/4/avatar.svg" alt="4" /></a>
81
- <a href="https://opencollective.com/material-ui/tiers/gold-sponsors/5/website" rel="noopener" target="_blank"><img src="https://opencollective.com/material-ui/tiers/gold-sponsors/5/avatar.svg" alt="5" /></a>
82
- <a href="https://opencollective.com/material-ui/tiers/gold-sponsors/6/website" rel="noopener" target="_blank"><img src="https://opencollective.com/material-ui/tiers/gold-sponsors/6/avatar.svg" alt="6" /></a>
83
- <a href="https://opencollective.com/material-ui/tiers/gold-sponsors/7/website" rel="noopener" target="_blank"><img src="https://opencollective.com/material-ui/tiers/gold-sponsors/7/avatar.svg" alt="7" /></a>
84
- <a href="https://opencollective.com/material-ui/tiers/gold-sponsors/8/website" rel="noopener" target="_blank"><img src="https://opencollective.com/material-ui/tiers/gold-sponsors/8/avatar.svg" alt="8" /></a>
85
- <a href="https://opencollective.com/material-ui/tiers/gold-sponsors/9/website" rel="noopener" target="_blank"><img src="https://opencollective.com/material-ui/tiers/gold-sponsors/9/avatar.svg" alt="9" /></a>
174
+ ##### Jouer tous les tests
175
+ ```sh
176
+ npm run test:unit
177
+ ```
86
178
 
87
- ### There is more!
179
+ ##### Jouer les tests sur un seul composant
180
+ ```sh
181
+ yarn run mocha src/AdvancedTable/BodyCells/CellAccount.spec.js
182
+ ```
88
183
 
89
- See the full list of [our backers](/BACKERS.md).
184
+ #### Vérifier la couverture de code
185
+ ```sh
186
+ npm run test:coverage
187
+ # ou pour avoir le rendu html :
188
+ npm run test:coverage:html
189
+ ```
190
+ La couverture de code html se trouvera dans le dossier [coverage](coverage)
90
191
 
91
- ## Usage
192
+ #### Calcul de couverture sur un seul composant
193
+ ```sh
194
+ yarn cross-env NODE_ENV=test BABEL_ENV=coverage nyc mocha src/HiTable/BodyCells/CellAccount.spec.js && nyc report -r lcovonly
195
+ ```
92
196
 
93
- Here is a quick example to get you started, **it's all you need**:
197
+ ## ESLint - Prettier
198
+ Pour le bon formattage des fichiers, on utilise [Prettier](https://prettier.io/docs/en/install.html) avec la conf EsLint
199
+ La conf se trouve dans le fichier [prettier.config.js](prettier.config.js)
200
+ Toutes les options : [https://prettier.io/docs/en/options.html](https://prettier.io/docs/en/options.html)
94
201
 
95
- ```jsx
96
- import React from 'react';
97
- import ReactDOM from 'react-dom';
98
- import Button from '@material-ui/core/Button';
202
+ #### Installer prettier en global
203
+ ```sh
204
+ yarn global add prettier
205
+ ```
99
206
 
100
- function App() {
101
- return (
102
- <Button variant="raised" color="primary">
103
- Hello World
104
- </Button>
105
- );
106
- }
207
+ #### Utilisation [voir doc](https://prettier.io/docs/en/cli.html)
107
208
 
108
- ReactDOM.render(<App />, document.querySelector('#app'));
209
+ #### Vérifier le fichier de config utilisé
210
+ ```sh
211
+ prettier --find-config-path src/HiForm/HiInput.js
109
212
  ```
110
213
 
111
- Yes, it's really all you need to get started as you can see in this live and interactive demo:
214
+ #### Forcer le formatage d'un fichier
215
+ ```sh
216
+ prettier --write src/HiForm/HiInput.js
217
+ ```
112
218
 
113
- [![Edit Button](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/4j7m47vlm4)
219
+ ## Publish
220
+ Le projet est publié sur un repo privé npm : https://www.npmjs.com/package/@hipay/hipay-material-ui
114
221
 
115
- ## Questions
222
+ #### Publier une nouvelle version
116
223
 
117
- For *how-to* questions and other non-issues,
118
- please use [StackOverflow](http://stackoverflow.com/questions/tagged/material-ui) instead of Github issues.
119
- There is a StackOverflow tag called "material-ui" that you can use to tag your questions.
224
+ Avoir installé [conventional-changelog-cli](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-cli) pour générer le CHANGELOG à partir des commits git.
225
+ ```sh
226
+ npm install -g conventional-changelog-cli
227
+ npm install -g cz-conventional-changelog
228
+ ```
120
229
 
121
- ## Examples
230
+ 1. Changer la version dans package.json
231
+ 2. Générer le fichier HI-CHANGELOG.md : ```npm run changelog```
232
+ 3. Commiter la release : ```git ci -am "chore(release): VERSION DATE```
233
+ 4. Build : ```npm run build```
234
+ 5. Publish :
122
235
 
123
- Are you looking for an example project to get started?
124
- [We host some](https://material-ui.com/getting-started/example-projects/).
236
+ ```sh
237
+ cd build
238
+ npm login
239
+ # Username: hipay
240
+ # Password: (voir avec la tribu PSYCHE)
241
+ npm publish
242
+ ```
243
+
244
+ #### [Semantic Versioning](https://semver.org/)
245
+
246
+ Une version MAJOR.MINOR.PATCH, correspond a:
125
247
 
126
- ## Documentation
248
+ - MAJOR version introduisant des évolutions non retro-compatibles (API changes...),
249
+ - MINOR version introduisant des évolutions retro-compatibles, la sortie des versions mineures est basé sur les sprints de la tribu PSYCHE
250
+ - PATCH version corrigeant des bugs
251
+ Des tags additionels peuvent être ajouter selon le contexte (ex: 1.0.0-beta.24).
127
252
 
128
- Check out our [documentation website](https://material-ui.com/).
253
+ En production, chaque releases (MAJOR, MINOR & PATCH) doit faire l'objet d'une communication interne aux tribus utilisatrices.
129
254
 
130
- ## Contributing
255
+ Les projets peuvent se baser sur une version MINOR: ```^2.5.0```, ce qui signifient "compatible avec la version 2.5.0".
131
256
 
132
- We'd greatly appreciate any [contribution](/CONTRIBUTING.md) you make. :)
257
+ Ainsi les PATCH seront automatiquement pris en compte.
258
+ L'intégration d'une MINOR doit faire l'objet d'une recette (voir HI-CHANGELOG.md).
259
+ Le passage à une autre MAJOR doit faire l'objet d'une recette (voir HI-CHANGELOG.md BREAKING CHANGE).
133
260
 
134
- ## Changelog
261
+ # Si ERR d'authentification
262
+ npm adduser
263
+ admin
264
+ admin123
135
265
 
136
- Recently Updated?
137
- Please read the [changelog](https://github.com/mui-org/material-ui/releases).
266
+ # pour le premier publish, modifier .npmrc
267
+ vi ~/.npmrc
268
+ # Mettre
269
+ registry=http://jira-nexus.hipay-pos-platform.com:8081/repository/npm-private/
270
+ _auth="YWRtaW46YWRtaW4xMjM="
271
+ ```
138
272
 
139
- ## Roadmap
273
+ ## Troubleshooting
140
274
 
141
- The future plans and high priority features and enhancements can be found in the [ROADMAP.md](https://material-ui.com/discover-more/roadmap/) file.
275
+ ### Upgrade node :
276
+ ```sh
277
+ sudo npm cache clean -f
278
+ sudo npm install -g n
279
+ sudo n stable
280
+ ```
142
281
 
143
- ## Thanks
282
+ ### Lorsqu'on lance la commande pour générer les apis :
283
+ Erreur : Cannot read property 'name' of undefined
284
+ => Une props est présente dans les défaultProps mais pas déclarée dans propTypes
144
285
 
145
- [<img src="https://www.browserstack.com/images/mail/browserstack-logo-footer.png" width="120">](https://www.browserstack.com/)
286
+ ### Lorsqu'on rajoute une page demo :
287
+ **Cannot read property 'js' of undefined**
288
+ => dans le fichier markdown du dossier docs/src/pages/demos/[VOTRE-DEMO]/votre-demo.md, la demo pointe sur un fichier qui n'existe pas.
289
+ Ou bien la demo n'existe pas dans le fichier js du dossier pages/demos/votre-demo.js
146
290
 
147
- Thank you to [BrowserStack](https://www.browserstack.com/) for providing the infrastructure that allows us to test in real browsers.
291
+ **Cannot read property 'toLowerCase' of undefined**
292
+ => un composant qu'on importe n'est pas exporter. Vérifier le fichier index.js à la racine du dossier du composant en question dans src/
148
293
 
149
- ## License
294
+ **Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. Check the render method of `SelectSuggestWithLabel`.**
295
+ => on importe mal un composant, par exemple
296
+ ```import { HiFormControl } from 'material-ui/Form';```
297
+ au lieu de
298
+ ```import { HiFormControl } from 'hipay-material-ui/HiForm';```
150
299
 
151
- This project is licensed under the terms of the
152
- [MIT license](/LICENSE).
300
+ ### Problème d'import dans front-react
301
+ Attention aux index.js.
302
+ La bonne syntaxe est :
303
+ export { default as MyComponente } from './MyComponente';
@@ -9,7 +9,9 @@ class HiBreadcrumb extends React.PureComponent {
9
9
  super(...args);
10
10
 
11
11
  this.handleStep = idx => () => {
12
- this.props.handleStep(idx);
12
+ if (this.props.disableNavigation === false) {
13
+ this.props.handleStep(idx);
14
+ }
13
15
  };
14
16
  }
15
17
 
@@ -17,7 +19,8 @@ class HiBreadcrumb extends React.PureComponent {
17
19
  const {
18
20
  activeStep,
19
21
  steps,
20
- type
22
+ type,
23
+ disableNavigation
21
24
  } = this.props;
22
25
  return React.createElement(HiStepper, {
23
26
  activeStep: activeStep,
@@ -37,7 +40,8 @@ class HiBreadcrumb extends React.PureComponent {
37
40
  active: activeStep === index,
38
41
  status: step.status,
39
42
  notificationNumber: step.notificationNumber,
40
- type: type
43
+ type: type,
44
+ disableNavigation: disableNavigation
41
45
  }, step.label));
42
46
  })));
43
47
  }
@@ -46,7 +50,8 @@ class HiBreadcrumb extends React.PureComponent {
46
50
 
47
51
  HiBreadcrumb.defaultProps = {
48
52
  activeStep: 0,
49
- type: 'back'
53
+ type: 'back',
54
+ disableNavigation: false
50
55
  };
51
56
  HiBreadcrumb.propTypes = process.env.NODE_ENV !== "production" ? {
52
57
  /**
@@ -54,6 +59,11 @@ HiBreadcrumb.propTypes = process.env.NODE_ENV !== "production" ? {
54
59
  */
55
60
  activeStep: PropTypes.number,
56
61
 
62
+ /**
63
+ * Disable navigation in steps
64
+ */
65
+ disableNavigation: PropTypes.bool,
66
+
57
67
  /**
58
68
  * The callback function handling the flow from one step to another
59
69
  */
@@ -8,6 +8,9 @@ import HiStepContent from './HiStepContent';
8
8
  export const styles = () => ({
9
9
  lastStep: {
10
10
  marginBottom: 40
11
+ },
12
+ step: {
13
+ outline: 'none'
11
14
  }
12
15
  });
13
16
 
@@ -38,7 +41,7 @@ class HiStep extends React.PureComponent {
38
41
  return React.createElement("div", {
39
42
  role: "button",
40
43
  tabIndex: index,
41
- className: classNames({
44
+ className: classNames(classes.step, {
42
45
  [classes.lastStep]: isLast && type !== 'back'
43
46
  }),
44
47
  onClick: onClick,
@@ -12,7 +12,6 @@ export const styles = () => ({
12
12
  contentContainer: {
13
13
  height: 'fit-content',
14
14
  maxHeight: 300,
15
- maxWidth: 323,
16
15
  marginTop: 35,
17
16
  marginLeft: 24,
18
17
  padding: 24,
@@ -30,11 +30,13 @@ export const styles = theme => ({
30
30
  marginLeft: 4,
31
31
  fontWeight: theme.typography.fontWeightRegular,
32
32
  color: theme.palette.neutral.main,
33
- marginBottom: -4,
33
+ marginBottom: -4
34
+ }, theme.typography.b2),
35
+ labelHover: {
34
36
  '&:hover': {
35
37
  cursor: 'pointer'
36
38
  }
37
- }, theme.typography.b2),
39
+ },
38
40
  labelContainer: {
39
41
  marginBottom: 4
40
42
  },
@@ -96,9 +98,10 @@ class HiStepLabel extends React.PureComponent {
96
98
  className: classNameProp,
97
99
  notificationNumber,
98
100
  status,
99
- type
101
+ type,
102
+ disableNavigation
100
103
  } = _this$props,
101
- other = _objectWithoutProperties(_this$props, ["active", "children", "classes", "className", "notificationNumber", "status", "type"]);
104
+ other = _objectWithoutProperties(_this$props, ["active", "children", "classes", "className", "notificationNumber", "status", "type", "disableNavigation"]);
102
105
 
103
106
  return React.createElement("span", _extends({
104
107
  className: classNames(classes.root, classNameProp, {
@@ -118,6 +121,7 @@ class HiStepLabel extends React.PureComponent {
118
121
  })
119
122
  }, React.createElement("div", {
120
123
  className: classNames(classes.label, {
124
+ [classes.labelHover]: disableNavigation === false,
121
125
  [classes.validated]: status === 'validated',
122
126
  [classes.refused]: status === 'refused',
123
127
  [classes.warning]: status === 'warning',
@@ -167,6 +171,11 @@ HiStepLabel.propTypes = process.env.NODE_ENV !== "production" ? {
167
171
  */
168
172
  className: PropTypes.string,
169
173
 
174
+ /**
175
+ * Disable navigation in steps
176
+ */
177
+ disableNavigation: PropTypes.bool,
178
+
170
179
  /**
171
180
  * The value to be displayed in the HiPin on the right of the label
172
181
  */
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
4
4
  import { withStyles } from '../styles';
5
5
  export const styles = () => ({
6
6
  root: {
7
- width: 340
7
+ width: '100%'
8
8
  }
9
9
  });
10
10
 
@@ -62,6 +62,12 @@ export const styles = theme => ({
62
62
  },
63
63
 
64
64
  /* Styles applied to the root element if `variant="[contained | fab]"` and `color="positive"`. */
65
+ containedPrimary: {
66
+ '&$disabled': {
67
+ color: theme.palette.neutral.contrastText,
68
+ backgroundColor: theme.palette.neutral.main
69
+ }
70
+ },
65
71
  containedPositive: {
66
72
  color: theme.palette.positive.contrastText,
67
73
  backgroundColor: theme.palette.positive.main,
@@ -183,6 +189,7 @@ function HiButton(props) {
183
189
  [classes.flatNegative]: (variant === 'text' || variant === 'flat' || variant === 'outlined') && color === 'negative',
184
190
  [classes.flatMiddle]: (variant === 'text' || variant === 'flat' || variant === 'outlined') && color === 'middle',
185
191
  [classes.flatNeutral]: (variant === 'text' || variant === 'flat' || variant === 'outlined') && (color === 'default' || color === 'neutral'),
192
+ [classes.containedPrimary]: (contained || fab) && color === 'primary',
186
193
  [classes.containedPositive]: (contained || fab) && color === 'positive',
187
194
  [classes.containedNegative]: (contained || fab) && color === 'negative',
188
195
  [classes.containedMiddle]: (contained || fab) && color === 'middle',
@@ -36,10 +36,10 @@ class CellIcon extends React.PureComponent {
36
36
  className: classes.wrapper,
37
37
  title: label
38
38
  }, icon && React.createElement(HiIcon, {
39
- color: "inherit",
39
+ color: 'inherit',
40
40
  style: {
41
- color: color,
42
- fontSize: size ? size : 24
41
+ color,
42
+ fontSize: size || 24
43
43
  },
44
44
  className: classes.icon,
45
45
  icon: icon
@@ -79,12 +79,12 @@ CellIcon.propTypes = process.env.NODE_ENV !== "production" ? {
79
79
  /**
80
80
  * View (L/M/S)
81
81
  */
82
- view: PropTypes.oneOf(['l', 'm', 's']),
82
+ size: PropTypes.number,
83
83
 
84
84
  /**
85
85
  * Icon size
86
86
  */
87
- size: PropTypes.number
87
+ view: PropTypes.oneOf(['l', 'm', 's'])
88
88
  } : {};
89
89
  export default withStyles(styles, {
90
90
  name: 'HmuiCellIcon'