@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.
- package/CHANGELOG.md +57 -0
- package/HiBreadcrumb/HiBreadcrumb.js +14 -4
- package/HiBreadcrumb/HiStep.js +4 -1
- package/HiBreadcrumb/HiStepContent.js +0 -1
- package/HiBreadcrumb/HiStepLabel.js +12 -4
- package/HiBreadcrumb/HiStepper.js +1 -1
- package/HiButton/HiButton.js +7 -1
- package/HiCell/CellIcon.js +4 -4
- package/HiCell/CellImage.js +28 -4
- package/HiCell/CellNumeric.js +1 -2
- package/HiCell/CellRate.js +6 -3
- package/HiCell/CellSentinel.js +7 -10
- package/HiCell/CellSentinelScore.js +4 -4
- package/HiCell/CellTextStyled.js +99 -0
- package/HiCell/index.js +9 -1
- package/HiChip/HiChip.js +1 -0
- package/HiDatePicker/Caption.js +8 -9
- package/HiDatePicker/HiDateRangePicker.js +37 -19
- package/HiDatePicker/HiDateRangeSelector.js +24 -22
- package/HiDatePicker/Overlays/CustomOverlayLayout.js +26 -17
- package/HiDatePicker/Overlays/MonthPickerOverlay.spec.js +1 -0
- package/HiDatePicker/Overlays/Overlay.js +15 -8
- package/HiDatePicker/Overlays/Overlay.spec.js +1 -0
- package/HiDatePicker/Overlays/TimePickerOverlay.js +2 -2
- package/HiDatePicker/Overlays/TimePickerOverlay.spec.js +1 -0
- package/HiDatePicker/Overlays/YearPickerOverlay.js +2 -4
- package/HiDatePicker/Overlays/YearPickerOverlay.spec.js +1 -0
- package/HiDatePicker/stylesheet.js +3 -2
- package/HiDotsStepper/HiDot.js +108 -0
- package/HiDotsStepper/HiDotsStepper.js +121 -0
- package/HiExpansionPanel/HiExpansionPanel.js +1 -1
- package/HiForm/HiAddressField.js +176 -0
- package/HiForm/HiSlider.js +352 -0
- package/HiForm/HiUpload.js +204 -0
- package/HiForm/HiUploadField.js +182 -0
- package/HiForm/HiUploadInput.js +459 -0
- package/HiForm/index.js +16 -0
- package/HiMap/HiMap.js +345 -0
- package/HiMap/HiMapExpand.js +210 -0
- package/HiMap/index.js +23 -0
- package/HiNotice/HiKPI.js +238 -0
- package/HiNotice/HiKPINotice.js +93 -0
- package/HiNotice/index.js +23 -0
- package/HiPdfReader/HiPdfReader.js +269 -0
- package/HiPdfReader/index.js +15 -0
- package/HiRadio/HiRadio.js +74 -0
- package/HiRadio/index.js +15 -0
- package/HiSelect/HiSelect.js +73 -84
- package/HiSelect/HiSuggestSelect.js +32 -5
- package/HiSelect/SelectInput.js +5 -0
- package/HiSelectNew/HiNestedSelectContent.js +5 -1
- package/HiSelectNew/HiSelect.js +174 -137
- package/HiSelectNew/HiSelectContent.js +0 -8
- package/HiSelectNew/HiSelectInput.js +8 -9
- package/HiSelectableList/HiSelectableList.js +32 -4
- package/HiSelectableList/HiSelectableListItem.js +62 -24
- package/HiTable/HiCellBuilder.js +42 -32
- package/HiTable/HiTableHeader.js +28 -21
- package/HiTable/constants.js +3 -1
- package/README.md +249 -98
- package/es/HiBreadcrumb/HiBreadcrumb.js +14 -4
- package/es/HiBreadcrumb/HiStep.js +4 -1
- package/es/HiBreadcrumb/HiStepContent.js +0 -1
- package/es/HiBreadcrumb/HiStepLabel.js +13 -4
- package/es/HiBreadcrumb/HiStepper.js +1 -1
- package/es/HiButton/HiButton.js +7 -0
- package/es/HiCell/CellIcon.js +5 -5
- package/es/HiCell/CellImage.js +25 -2
- package/es/HiCell/CellNumeric.js +1 -2
- package/es/HiCell/CellRate.js +6 -3
- package/es/HiCell/CellSentinel.js +7 -10
- package/es/HiCell/CellSentinelScore.js +4 -4
- package/es/HiCell/CellTextStyled.js +84 -0
- package/es/HiCell/index.js +2 -1
- package/es/HiChip/HiChip.js +1 -0
- package/es/HiDatePicker/Caption.js +7 -9
- package/es/HiDatePicker/HiDateRangePicker.js +41 -25
- package/es/HiDatePicker/HiDateRangeSelector.js +24 -22
- package/es/HiDatePicker/ListPicker.js +1 -1
- package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +30 -19
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.js +2 -2
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.spec.js +1 -0
- package/es/HiDatePicker/Overlays/Overlay.js +16 -9
- package/es/HiDatePicker/Overlays/Overlay.spec.js +1 -0
- package/es/HiDatePicker/Overlays/TimePickerOverlay.js +2 -2
- package/es/HiDatePicker/Overlays/TimePickerOverlay.spec.js +1 -0
- package/es/HiDatePicker/Overlays/YearPickerOverlay.js +2 -4
- package/es/HiDatePicker/Overlays/YearPickerOverlay.spec.js +1 -0
- package/es/HiDatePicker/stylesheet.js +3 -2
- package/es/HiDotsStepper/HiDot.js +66 -0
- package/es/HiDotsStepper/HiDotsStepper.js +73 -0
- package/es/HiExpansionPanel/HiExpansionPanel.js +1 -1
- package/es/HiForm/HiAddressField.js +134 -0
- package/es/HiForm/HiSlider.js +302 -0
- package/es/HiForm/HiUpload.js +158 -0
- package/es/HiForm/HiUploadField.js +140 -0
- package/es/HiForm/HiUploadInput.js +411 -0
- package/es/HiForm/index.js +2 -0
- package/es/HiMap/HiMap.js +290 -0
- package/es/HiMap/HiMapExpand.js +162 -0
- package/es/HiMap/index.js +2 -0
- package/es/HiNotice/HiKPI.js +196 -0
- package/es/HiNotice/HiKPINotice.js +77 -0
- package/es/HiNotice/index.js +2 -0
- package/es/HiPdfReader/HiPdfReader.js +214 -0
- package/es/HiPdfReader/index.js +1 -0
- package/es/HiRadio/HiRadio.js +55 -0
- package/es/HiRadio/index.js +1 -0
- package/es/HiSelect/HiSelect.js +68 -78
- package/es/HiSelect/HiSuggestSelect.js +27 -6
- package/es/HiSelect/SelectInput.js +5 -0
- package/es/HiSelectNew/HiNestedSelectContent.js +5 -1
- package/es/HiSelectNew/HiSelect.js +156 -120
- package/es/HiSelectNew/HiSelectContent.js +0 -7
- package/es/HiSelectNew/HiSelectInput.js +8 -9
- package/es/HiSelectableList/HiSelectableList.js +28 -6
- package/es/HiSelectableList/HiSelectableListItem.js +71 -24
- package/es/HiTable/HiCellBuilder.js +140 -136
- package/es/HiTable/HiTableHeader.js +26 -18
- package/es/HiTable/constants.js +1 -0
- package/es/index.js +7 -0
- package/es/utils/helpers.js +1 -1
- package/index.es.js +8 -1
- package/index.js +57 -1
- package/package.json +6 -3
- package/umd/hipay-material-ui.development.js +42114 -35120
- package/umd/hipay-material-ui.production.min.js +2 -2
- package/utils/helpers.js +1 -1
package/README.md
CHANGED
@@ -1,152 +1,303 @@
|
|
1
|
-
|
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
|
-
|
3
|
+
Voici la documentation du site HiPay Material-UI.
|
6
4
|
|
7
|
-
|
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
|
-
|
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
|
-
|
12
|
+
## Lancer le projet
|
25
13
|
|
26
|
-
|
14
|
+
#### Via docker
|
27
15
|
|
28
|
-
|
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
|
-
|
20
|
+
Puis lancez les commandes
|
31
21
|
```sh
|
32
|
-
|
33
|
-
|
22
|
+
docker-compose build
|
23
|
+
docker-compose up -d
|
34
24
|
|
35
|
-
|
36
|
-
|
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
|
-
|
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
|
-
|
42
|
-
|
130
|
+
npm install commitizen -g
|
131
|
+
```
|
43
132
|
|
44
|
-
|
45
|
-
|
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
|
-
|
140
|
+
Référence/action sur un ticket définissant cette tâche
|
141
|
+
```
|
50
142
|
|
51
|
-
|
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
|
-
|
54
|
-
-
|
55
|
-
-
|
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
|
-
|
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
|
-
|
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
|
-
|
156
|
+
Exemple:
|
157
|
+
```
|
158
|
+
feat(HiTable): add children rows management
|
64
159
|
|
65
|
-
|
160
|
+
Handle children rows as subtable based on the same columns as parents.
|
66
161
|
|
67
|
-
|
162
|
+
PSYCHE-XX
|
163
|
+
```
|
68
164
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
165
|
+
## Génération des apis
|
166
|
+
```sh
|
167
|
+
npm run docs:api
|
168
|
+
```
|
73
169
|
|
74
|
-
|
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
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
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
|
-
|
179
|
+
##### Jouer les tests sur un seul composant
|
180
|
+
```sh
|
181
|
+
yarn run mocha src/AdvancedTable/BodyCells/CellAccount.spec.js
|
182
|
+
```
|
88
183
|
|
89
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
202
|
+
#### Installer prettier en global
|
203
|
+
```sh
|
204
|
+
yarn global add prettier
|
205
|
+
```
|
99
206
|
|
100
|
-
|
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
|
-
|
209
|
+
#### Vérifier le fichier de config utilisé
|
210
|
+
```sh
|
211
|
+
prettier --find-config-path src/HiForm/HiInput.js
|
109
212
|
```
|
110
213
|
|
111
|
-
|
214
|
+
#### Forcer le formatage d'un fichier
|
215
|
+
```sh
|
216
|
+
prettier --write src/HiForm/HiInput.js
|
217
|
+
```
|
112
218
|
|
113
|
-
|
219
|
+
## Publish
|
220
|
+
Le projet est publié sur un repo privé npm : https://www.npmjs.com/package/@hipay/hipay-material-ui
|
114
221
|
|
115
|
-
|
222
|
+
#### Publier une nouvelle version
|
116
223
|
|
117
|
-
|
118
|
-
|
119
|
-
|
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
|
-
|
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
|
-
|
124
|
-
|
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
|
-
|
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
|
-
|
253
|
+
En production, chaque releases (MAJOR, MINOR & PATCH) doit faire l'objet d'une communication interne aux tribus utilisatrices.
|
129
254
|
|
130
|
-
|
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
|
-
|
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
|
-
|
261
|
+
# Si ERR d'authentification
|
262
|
+
npm adduser
|
263
|
+
admin
|
264
|
+
admin123
|
135
265
|
|
136
|
-
|
137
|
-
|
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
|
-
##
|
273
|
+
## Troubleshooting
|
140
274
|
|
141
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
152
|
-
|
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.
|
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,
|
@@ -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
|
-
},
|
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
|
*/
|
package/es/HiButton/HiButton.js
CHANGED
@@ -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',
|
package/es/HiCell/CellIcon.js
CHANGED
@@ -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:
|
39
|
+
color: 'inherit',
|
40
40
|
style: {
|
41
|
-
color
|
42
|
-
fontSize: size
|
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
|
-
|
82
|
+
size: PropTypes.number,
|
83
83
|
|
84
84
|
/**
|
85
85
|
* Icon size
|
86
86
|
*/
|
87
|
-
|
87
|
+
view: PropTypes.oneOf(['l', 'm', 's'])
|
88
88
|
} : {};
|
89
89
|
export default withStyles(styles, {
|
90
90
|
name: 'HmuiCellIcon'
|