@hipay/hipay-material-ui 2.0.0-beta.55 → 2.0.0-beta.57

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. package/CHANGELOG.md +116 -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 +13 -1
  10. package/HiCell/CellRate.js +6 -3
  11. package/HiCell/CellSentinel.js +7 -10
  12. package/HiCell/CellTextStyled.js +29 -1
  13. package/HiColoredLabel/HiColoredLabel.js +1 -1
  14. package/HiDatePicker/Caption.js +16 -10
  15. package/HiDatePicker/HiDatePicker.js +9 -3
  16. package/HiDatePicker/HiDateRangePicker.js +36 -22
  17. package/HiDatePicker/HiDateRangeSelector.js +75 -21
  18. package/HiDatePicker/NavBar.js +8 -1
  19. package/HiDatePicker/Overlays/CustomOverlayLayout.js +26 -17
  20. package/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +123 -0
  21. package/HiDatePicker/Overlays/MonthPickerOverlay.js +4 -4
  22. package/HiDatePicker/Overlays/MonthPickerOverlay.spec.js +1 -0
  23. package/HiDatePicker/Overlays/Overlay.js +15 -8
  24. package/HiDatePicker/Overlays/Overlay.spec.js +1 -0
  25. package/HiDatePicker/Overlays/TimePickerOverlay.js +2 -2
  26. package/HiDatePicker/Overlays/TimePickerOverlay.spec.js +1 -0
  27. package/HiDatePicker/Overlays/YearPickerOverlay.js +4 -6
  28. package/HiDatePicker/Overlays/YearPickerOverlay.spec.js +1 -0
  29. package/HiDatePicker/hiLocaleUtils.js +144 -0
  30. package/HiDatePicker/stylesheet.js +33 -7
  31. package/HiDotsStepper/HiDot.js +108 -0
  32. package/HiDotsStepper/HiDotsStepper.js +121 -0
  33. package/HiExpansionPanel/HiExpansionPanel.js +1 -1
  34. package/HiForm/HiAddressField.js +176 -0
  35. package/HiForm/HiFormControl.js +2 -0
  36. package/HiForm/HiInput.js +3 -3
  37. package/HiForm/HiSlider.js +352 -0
  38. package/HiForm/HiUpload.js +204 -0
  39. package/HiForm/HiUploadField.js +182 -0
  40. package/HiForm/HiUploadInput.js +459 -0
  41. package/HiForm/index.js +16 -0
  42. package/HiMap/HiMap.js +345 -0
  43. package/HiMap/HiMapExpand.js +210 -0
  44. package/HiMap/index.js +23 -0
  45. package/HiNotice/HiKPI.js +238 -0
  46. package/HiNotice/HiKPINotice.js +96 -0
  47. package/HiNotice/index.js +23 -0
  48. package/HiPdfReader/HiPdfReader.js +269 -0
  49. package/HiPdfReader/index.js +15 -0
  50. package/HiPin/HiPin.js +1 -1
  51. package/HiRadio/HiRadio.js +74 -0
  52. package/HiRadio/index.js +15 -0
  53. package/HiSelect/HiSelect.js +73 -84
  54. package/HiSelect/HiSuggestSelect.js +35 -4
  55. package/HiSelect/SelectInput.js +9 -1
  56. package/HiSelectNew/HiNestedSelectContent.js +5 -1
  57. package/HiSelectNew/HiSelect.js +260 -179
  58. package/HiSelectNew/HiSelectContent.js +0 -8
  59. package/HiSelectNew/HiSelectInput.js +8 -9
  60. package/HiSelectableList/HiSelectableList.js +39 -4
  61. package/HiSelectableList/HiSelectableListItem.js +81 -38
  62. package/HiTable/HiCellBuilder.js +25 -12
  63. package/HiTable/HiTableHeader.js +16 -17
  64. package/HiTable/constants.js +3 -1
  65. package/README.md +248 -98
  66. package/es/HiBreadcrumb/HiBreadcrumb.js +14 -4
  67. package/es/HiBreadcrumb/HiStep.js +4 -1
  68. package/es/HiBreadcrumb/HiStepContent.js +0 -1
  69. package/es/HiBreadcrumb/HiStepLabel.js +13 -4
  70. package/es/HiBreadcrumb/HiStepper.js +1 -1
  71. package/es/HiButton/HiButton.js +7 -0
  72. package/es/HiCell/CellIcon.js +5 -5
  73. package/es/HiCell/CellImage.js +13 -1
  74. package/es/HiCell/CellRate.js +6 -3
  75. package/es/HiCell/CellSentinel.js +7 -10
  76. package/es/HiCell/CellTextStyled.js +28 -1
  77. package/es/HiColoredLabel/HiColoredLabel.js +1 -1
  78. package/es/HiDatePicker/Caption.js +14 -10
  79. package/es/HiDatePicker/HiDatePicker.js +8 -3
  80. package/es/HiDatePicker/HiDateRangePicker.js +40 -28
  81. package/es/HiDatePicker/HiDateRangeSelector.js +69 -21
  82. package/es/HiDatePicker/ListPicker.js +1 -1
  83. package/es/HiDatePicker/NavBar.js +7 -1
  84. package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +30 -19
  85. package/es/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +106 -0
  86. package/es/HiDatePicker/Overlays/MonthPickerOverlay.js +5 -5
  87. package/es/HiDatePicker/Overlays/MonthPickerOverlay.spec.js +1 -0
  88. package/es/HiDatePicker/Overlays/Overlay.js +16 -9
  89. package/es/HiDatePicker/Overlays/Overlay.spec.js +1 -0
  90. package/es/HiDatePicker/Overlays/TimePickerOverlay.js +2 -2
  91. package/es/HiDatePicker/Overlays/TimePickerOverlay.spec.js +1 -0
  92. package/es/HiDatePicker/Overlays/YearPickerOverlay.js +4 -6
  93. package/es/HiDatePicker/Overlays/YearPickerOverlay.spec.js +1 -0
  94. package/es/HiDatePicker/hiLocaleUtils.js +131 -0
  95. package/es/HiDatePicker/stylesheet.js +32 -7
  96. package/es/HiDotsStepper/HiDot.js +66 -0
  97. package/es/HiDotsStepper/HiDotsStepper.js +73 -0
  98. package/es/HiExpansionPanel/HiExpansionPanel.js +1 -1
  99. package/es/HiForm/HiAddressField.js +134 -0
  100. package/es/HiForm/HiFormControl.js +2 -0
  101. package/es/HiForm/HiInput.js +3 -3
  102. package/es/HiForm/HiSlider.js +302 -0
  103. package/es/HiForm/HiUpload.js +158 -0
  104. package/es/HiForm/HiUploadField.js +140 -0
  105. package/es/HiForm/HiUploadInput.js +411 -0
  106. package/es/HiForm/index.js +2 -0
  107. package/es/HiMap/HiMap.js +290 -0
  108. package/es/HiMap/HiMapExpand.js +162 -0
  109. package/es/HiMap/index.js +2 -0
  110. package/es/HiNotice/HiKPI.js +196 -0
  111. package/es/HiNotice/HiKPINotice.js +78 -0
  112. package/es/HiNotice/index.js +2 -0
  113. package/es/HiPdfReader/HiPdfReader.js +214 -0
  114. package/es/HiPdfReader/index.js +1 -0
  115. package/es/HiPin/HiPin.js +1 -1
  116. package/es/HiRadio/HiRadio.js +55 -0
  117. package/es/HiRadio/index.js +1 -0
  118. package/es/HiSelect/HiSelect.js +68 -78
  119. package/es/HiSelect/HiSuggestSelect.js +30 -4
  120. package/es/HiSelect/SelectInput.js +9 -1
  121. package/es/HiSelectNew/HiNestedSelectContent.js +5 -1
  122. package/es/HiSelectNew/HiSelect.js +246 -162
  123. package/es/HiSelectNew/HiSelectContent.js +0 -7
  124. package/es/HiSelectNew/HiSelectInput.js +8 -9
  125. package/es/HiSelectableList/HiSelectableList.js +34 -6
  126. package/es/HiSelectableList/HiSelectableListItem.js +92 -40
  127. package/es/HiTable/HiCellBuilder.js +130 -123
  128. package/es/HiTable/HiTableHeader.js +14 -12
  129. package/es/HiTable/constants.js +1 -0
  130. package/es/index.js +9 -1
  131. package/es/utils/helpers.js +1 -1
  132. package/index.es.js +9 -1
  133. package/index.js +66 -2
  134. package/package.json +5 -2
  135. package/umd/hipay-material-ui.development.js +44450 -40930
  136. package/umd/hipay-material-ui.production.min.js +2 -2
  137. package/utils/helpers.js +1 -1
package/README.md CHANGED
@@ -1,152 +1,302 @@
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é
17
+ - [Docker](https://docs.docker.com/install/linux/docker-ce/ubuntu/)
29
18
 
30
- **[Stable channel v1](https://material-ui.com/)**
19
+ Puis lancez les commandes
31
20
  ```sh
32
- // with npm
33
- npm install @material-ui/core
21
+ # En mode dev :
22
+ docker-compose -f docker-compose.dev.yml build
23
+ docker-compose -f docker-compose.dev.yml up # -d pour détacher du shell courant
34
24
 
35
- // with yarn
36
- yarn add @material-ui/core
25
+ # En mode prod :
26
+ docker-compose -f docker-compose.prod.yml build
27
+ docker-compose -f docker-compose.prod.yml up # -d pour détacher du shell courant
37
28
  ```
38
29
 
39
- **[v0.x](https://v0.material-ui.com/)** ([Migration to v1](https://material-ui.com/guides/migration-v0x/))
30
+ #### En local
31
+
32
+ Il faut que sur votre poste soit installés
33
+ - [node](https://nodejs.org/fr/) (minimum version LTS 8.9.4)
34
+ - [npm](https://www.npmjs.com/) (minimum version 5.6.0)
35
+
36
+ Puis lancez les commandes
37
+ ```sh
38
+ npm install
39
+
40
+ # En mode dev :
41
+ npm start
42
+ # équivaut à
43
+ npm run docs:dev
44
+
45
+ # En mode prod :
46
+ npm run docs:build
47
+ npm run docs:start
48
+ ```
49
+ Le site est dispo à cette URL:
50
+ [http://localhost:3000](http://localhost:3000)
51
+
52
+ ## Best practices
53
+ #### Patterns
54
+ - single "source of truth" / top>down data flow
55
+ https://reactjs.org/docs/lifting-state-up.html
56
+ https://reactjs.org/docs/state-and-lifecycle.html#the-data-flows-down
57
+
58
+ - classique patterns
59
+ https://reactpatterns.com
60
+
61
+ - accéder au thème dans un composant (en dehors du style)
62
+ export default withStyles(styles, { withTheme: true })(CellStatus);
63
+ ne plus utiliser la notation
64
+ export default withStyles(styles)(withTheme()(CellStatus));
65
+
66
+ #### Optimisation
67
+ - 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).
68
+ 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 )
69
+ <img width="800" src="/static/react-lifecycle.png" alt="react-lifecycle">
70
+
71
+ - Comprendre la différence entre React.Component & React.PureComponent
72
+ https://codeburst.io/when-to-use-component-or-purecomponent-a60cfad01a81
73
+
74
+ - Comprendre le principe de réconciliation pour optimiser les ensembles de composants (listes, tableaux...) -> use "key" !
75
+ https://reactjs.org/docs/lists-and-keys.html
76
+ https://reactjs.org/docs/reconciliation.html
77
+
78
+ - Attention aux refs et aux mutations
79
+ 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 !
80
+
81
+ ## Contribuer
82
+
83
+ #### A savoir
84
+ - Notre projet sur JIRA : [PSYCHE - Production](https://jira.hipay.org/secure/RapidBoard.jspa?rapidView=90&projectKey=PSYCHE)
85
+ - Pour ouvrir nos features, nous utilisons [git flow](https://danielkummer.github.io/git-flow-cheatsheet/)
86
+ Après avoir cloner le projet, il faudra lancer la commande `git flow init` **depuis la master**
87
+
88
+ ```sh
89
+ git clone git@gitlab.hipay.org:backend/hipay-material-ui.git
90
+ git checkout master
91
+ git flow init
92
+ # Tapez "Entrée" pour toutes les questions
93
+ ```
94
+
95
+ - Tous les composants sont dans le dossier /src.
96
+ - Nos composants HiPay doivent être préfixés par "Hi", par exemple HiTable, HiButton...
97
+ - Pour un code bien formatter, on utilise [ESLint - Prettier](#eslint-prettier)
98
+ - Pour activer ESLint sur PHPStorm : File -> Settings -> Languages & Frameworks -> Code Qaulity Tools -> ESLint -> Enable
99
+
100
+ #### Pour rajouter de la documentation dans les démos
101
+ [Lire ce guide](https://github.com/callemall/material-ui/blob/v1-beta/CONTRIBUTING.md)
102
+
103
+ #### Pour rajouter des composants dans la liste "API"
104
+ Il faut les rajouter tout en haut du markdown de la page dans la liste des "components:"
105
+ Par exemple sur la page des tableaux : http://localhost:3000/demos/tables
106
+ => Il faut les rajouter au fichier [hi-table.md](docs/src/pages/demos/hi-table/hi-table.md)
107
+
108
+ #### Workflow d'une feature
109
+ - 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))
110
+ - Ouvrir la feature via git flow
111
+
112
+ ```sh
113
+ git flow feature start PSYCHE-XXX
114
+ ```
115
+
116
+ - 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)
117
+ - Les [tests unitaires](#tests) doivent passer
118
+ - La [génération des apis](#generation-des-apis) aussi
119
+ - Le code doit être bien formatter : [ESLint - Prettier](#esLint-prettier)
120
+ - Commit - suivant les conventions de rédaction des messages de commit
121
+ - Push
122
+ - Faire la demande de merge request sur la develop
123
+ - La revue se fera par un membre de l'équipe PSYCHE
124
+
125
+ ##### Conventional Changelog
126
+
127
+ (optionel) installer [commitizen](https://github.com/commitizen/cz-cli) pour s'assurer de commiter selon la convention
40
128
  ```sh
41
- // with npm
42
- npm install material-ui
129
+ npm install commitizen -g
130
+ ```
43
131
 
44
- // with yarn
45
- yarn add material-ui
132
+
133
+ Voici un squelette d’exemple de message de commit conventionnel :
46
134
  ```
135
+ <type de tâche>(<périmètre>): message court
47
136
 
137
+ Description complémentaire/complète
48
138
 
49
- Please note that `@next` will only point to pre-releases; to get the latest stable release use `@latest` instead.
139
+ Référence/action sur un ticket définissant cette tâche
140
+ ```
50
141
 
51
- ## Supporting Material-UI
142
+ On facilite ainsi la lecture du log d’une part, la génération automatique du changelog (ou release notes) d’autre part
52
143
 
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).
144
+ Types de tâche:
145
+ - <b>fix</b> : commit d'une correction de bug. Se traduit en <b>PATCH</b> dans le changelog
146
+ - <b>feat</b> : commit d'une nouvelle feature. Se traduit en <b>MINOR</b> dans le changelog
147
+ - <b>test</b> : commit d'un ajout ou d'une maj de tests
148
+ - <b>docs</b> : commit d'un ajout ou d'une maj de la documentation OU de l'app de démonstration
149
+ - <b>perf</b> : commit concernant l'amélioration des performances
56
150
 
57
- #### What's the difference between Patreon and OpenCollective?
151
+ <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
152
 
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.
153
+ Périmètre (optionel): nom du composant, type de tests, page de la doc
62
154
 
63
- ### Gold Sponsors
155
+ Exemple:
156
+ ```
157
+ feat(HiTable): add children rows management
64
158
 
65
- Gold Sponsors are those who have pledged $500/month and more to Material-UI.
159
+ Handle children rows as subtable based on the same columns as parents.
66
160
 
67
- via [Patreon](https://www.patreon.com/oliviertassinari)
161
+ PSYCHE-XX
162
+ ```
68
163
 
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>
164
+ ## Génération des apis
165
+ ```sh
166
+ npm run docs:api
167
+ ```
73
168
 
74
- via [OpenCollective](https://opencollective.com/material-ui)
169
+ ## Tests
170
+ Tous les composants doivent avoir leur test à côté (fichier .spec.js)
171
+ On utilise [mocha](https://mochajs.org/), [chai](http://chaijs.com/) et [enzyme](http://airbnb.io/enzyme/docs/api/)
75
172
 
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>
173
+ ##### Jouer tous les tests
174
+ ```sh
175
+ npm run test:unit
176
+ ```
86
177
 
87
- ### There is more!
178
+ ##### Jouer les tests sur un seul composant
179
+ ```sh
180
+ yarn run mocha src/AdvancedTable/BodyCells/CellAccount.spec.js
181
+ ```
88
182
 
89
- See the full list of [our backers](/BACKERS.md).
183
+ #### Vérifier la couverture de code
184
+ ```sh
185
+ npm run test:coverage
186
+ # ou pour avoir le rendu html :
187
+ npm run test:coverage:html
188
+ ```
189
+ La couverture de code html se trouvera dans le dossier [coverage](coverage)
90
190
 
91
- ## Usage
191
+ #### Calcul de couverture sur un seul composant
192
+ ```sh
193
+ yarn cross-env NODE_ENV=test BABEL_ENV=coverage nyc mocha src/HiTable/BodyCells/CellAccount.spec.js && nyc report -r lcovonly
194
+ ```
92
195
 
93
- Here is a quick example to get you started, **it's all you need**:
196
+ ## ESLint - Prettier
197
+ Pour le bon formattage des fichiers, on utilise [Prettier](https://prettier.io/docs/en/install.html) avec la conf EsLint
198
+ La conf se trouve dans le fichier [prettier.config.js](prettier.config.js)
199
+ Toutes les options : [https://prettier.io/docs/en/options.html](https://prettier.io/docs/en/options.html)
94
200
 
95
- ```jsx
96
- import React from 'react';
97
- import ReactDOM from 'react-dom';
98
- import Button from '@material-ui/core/Button';
201
+ #### Installer prettier en global
202
+ ```sh
203
+ yarn global add prettier
204
+ ```
99
205
 
100
- function App() {
101
- return (
102
- <Button variant="raised" color="primary">
103
- Hello World
104
- </Button>
105
- );
106
- }
206
+ #### Utilisation [voir doc](https://prettier.io/docs/en/cli.html)
107
207
 
108
- ReactDOM.render(<App />, document.querySelector('#app'));
208
+ #### Vérifier le fichier de config utilisé
209
+ ```sh
210
+ prettier --find-config-path src/HiForm/HiInput.js
109
211
  ```
110
212
 
111
- Yes, it's really all you need to get started as you can see in this live and interactive demo:
213
+ #### Forcer le formatage d'un fichier
214
+ ```sh
215
+ prettier --write src/HiForm/HiInput.js
216
+ ```
112
217
 
113
- [![Edit Button](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/4j7m47vlm4)
218
+ ## Publish
219
+ Le projet est publié sur un repo privé npm : https://www.npmjs.com/package/@hipay/hipay-material-ui
114
220
 
115
- ## Questions
221
+ #### Publier une nouvelle version
116
222
 
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.
223
+ 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.
224
+ ```sh
225
+ npm install -g conventional-changelog-cli
226
+ npm install -g cz-conventional-changelog
227
+ ```
120
228
 
121
- ## Examples
229
+ 1. Changer la version dans packages/hipay-material-ui/package.json
230
+ 2. Générer le fichier HI-CHANGELOG.md : ```npm run changelog```
231
+ 3. Commiter la release : ```git ci -am "chore(release): VERSION DATE```
232
+ 4. Build : ```npm run build```
233
+ 5. Publish :
122
234
 
123
- Are you looking for an example project to get started?
124
- [We host some](https://material-ui.com/getting-started/example-projects/).
235
+ ```sh
236
+ cd build
237
+ npm login
238
+ # Username: hipay
239
+ # Password: (voir avec la tribu PSYCHE)
240
+ npm publish
241
+ ```
242
+
243
+ #### [Semantic Versioning](https://semver.org/)
244
+
245
+ Une version MAJOR.MINOR.PATCH, correspond a:
125
246
 
126
- ## Documentation
247
+ - MAJOR version introduisant des évolutions non retro-compatibles (API changes...),
248
+ - MINOR version introduisant des évolutions retro-compatibles, la sortie des versions mineures est basé sur les sprints de la tribu PSYCHE
249
+ - PATCH version corrigeant des bugs
250
+ Des tags additionels peuvent être ajouter selon le contexte (ex: 1.0.0-beta.24).
127
251
 
128
- Check out our [documentation website](https://material-ui.com/).
252
+ En production, chaque releases (MAJOR, MINOR & PATCH) doit faire l'objet d'une communication interne aux tribus utilisatrices.
129
253
 
130
- ## Contributing
254
+ Les projets peuvent se baser sur une version MINOR: ```^2.5.0```, ce qui signifient "compatible avec la version 2.5.0".
131
255
 
132
- We'd greatly appreciate any [contribution](/CONTRIBUTING.md) you make. :)
256
+ Ainsi les PATCH seront automatiquement pris en compte.
257
+ L'intégration d'une MINOR doit faire l'objet d'une recette (voir HI-CHANGELOG.md).
258
+ Le passage à une autre MAJOR doit faire l'objet d'une recette (voir HI-CHANGELOG.md BREAKING CHANGE).
133
259
 
134
- ## Changelog
260
+ # Si ERR d'authentification
261
+ npm adduser
262
+ admin
263
+ admin123
135
264
 
136
- Recently Updated?
137
- Please read the [changelog](https://github.com/mui-org/material-ui/releases).
265
+ # pour le premier publish, modifier .npmrc
266
+ vi ~/.npmrc
267
+ # Mettre
268
+ registry=http://jira-nexus.hipay-pos-platform.com:8081/repository/npm-private/
269
+ _auth="YWRtaW46YWRtaW4xMjM="
270
+ ```
138
271
 
139
- ## Roadmap
272
+ ## Troubleshooting
140
273
 
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.
274
+ ### Upgrade node :
275
+ ```sh
276
+ sudo npm cache clean -f
277
+ sudo npm install -g n
278
+ sudo n stable
279
+ ```
142
280
 
143
- ## Thanks
281
+ ### Lorsqu'on lance la commande pour générer les apis :
282
+ Erreur : Cannot read property 'name' of undefined
283
+ => Une props est présente dans les défaultProps mais pas déclarée dans propTypes
144
284
 
145
- [<img src="https://www.browserstack.com/images/mail/browserstack-logo-footer.png" width="120">](https://www.browserstack.com/)
285
+ ### Lorsqu'on rajoute une page demo :
286
+ **Cannot read property 'js' of undefined**
287
+ => 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.
288
+ Ou bien la demo n'existe pas dans le fichier js du dossier pages/demos/votre-demo.js
146
289
 
147
- Thank you to [BrowserStack](https://www.browserstack.com/) for providing the infrastructure that allows us to test in real browsers.
290
+ **Cannot read property 'toLowerCase' of undefined**
291
+ => 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
292
 
149
- ## License
293
+ **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`.**
294
+ => on importe mal un composant, par exemple
295
+ ```import { HiFormControl } from 'material-ui/Form';```
296
+ au lieu de
297
+ ```import { HiFormControl } from 'hipay-material-ui/HiForm';```
150
298
 
151
- This project is licensed under the terms of the
152
- [MIT license](/LICENSE).
299
+ ### Problème d'import dans front-react
300
+ Attention aux index.js.
301
+ La bonne syntaxe est :
302
+ 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'
@@ -41,7 +41,8 @@ class CellImage extends React.PureComponent {
41
41
  shortLabel,
42
42
  view,
43
43
  size,
44
- fallbackImage
44
+ fallbackImage,
45
+ title
45
46
  } = this.props;
46
47
  if (!path || path === '') return '';
47
48
  return React.createElement("div", {
@@ -50,6 +51,7 @@ class CellImage extends React.PureComponent {
50
51
  }, React.createElement("img", {
51
52
  src: path,
52
53
  alt: label,
54
+ title: title,
53
55
  className: classes.img,
54
56
  width: size,
55
57
  onError: handleError(fallbackImage)
@@ -72,6 +74,11 @@ CellImage.propTypes = process.env.NODE_ENV !== "production" ? {
72
74
  */
73
75
  classes: PropTypes.object,
74
76
 
77
+ /**
78
+ * Fallback image path
79
+ */
80
+ fallbackImage: PropTypes.string,
81
+
75
82
  /**
76
83
  * Label
77
84
  */
@@ -92,6 +99,11 @@ CellImage.propTypes = process.env.NODE_ENV !== "production" ? {
92
99
  */
93
100
  size: PropTypes.number,
94
101
 
102
+ /**
103
+ * Title.
104
+ */
105
+ title: PropTypes.string,
106
+
95
107
  /**
96
108
  * View (L/M/S)
97
109
  */