@hipay/hipay-material-ui 1.0.0-beta.22 → 1.0.0-beta.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. package/HI-CHANGELOG.md +26 -43
  2. package/HiChip/HiChip.js +67 -8
  3. package/HiChip/HiChipSwitch.js +6 -0
  4. package/HiDatePicker/HiDatePicker.js +35 -21
  5. package/HiDatePicker/HiDateRangePicker.js +92 -50
  6. package/HiDatePicker/HiDateRangeSelector.js +15 -4
  7. package/HiDatePicker/Overlays/Overlay.js +1 -1
  8. package/HiDatePicker/stylesheet.js +3 -0
  9. package/HiForm/HiInput.js +12 -2
  10. package/HiForm/HiPasswordField.js +8 -3
  11. package/HiLoader/HiLoader.js +7 -4
  12. package/HiPins/HiPins.js +6 -4
  13. package/HiSelect/HiSelect.js +26 -6
  14. package/HiSelect/HiSuggestSelect.js +2 -1
  15. package/HiSelect/SelectInput.js +3 -8
  16. package/HiSelectableList/HiSelectableList.js +51 -49
  17. package/HiSelectableList/HiSelectableListItem.js +18 -2
  18. package/HiTable/BodyCellBuilder.js +22 -12
  19. package/HiTable/BodyCells/CellAccount.js +13 -4
  20. package/HiTable/BodyCells/CellAccountNumber.js +12 -3
  21. package/HiTable/BodyCells/CellAddress.js +12 -3
  22. package/HiTable/BodyCells/CellCountry.js +12 -3
  23. package/HiTable/BodyCells/CellDate.js +43 -42
  24. package/HiTable/BodyCells/CellIcon.js +12 -3
  25. package/HiTable/BodyCells/CellImage.js +12 -3
  26. package/HiTable/BodyCells/CellNumeric.js +12 -3
  27. package/HiTable/BodyCells/CellRate.js +12 -3
  28. package/HiTable/BodyCells/CellSentinel.js +17 -7
  29. package/HiTable/BodyCells/CellStatus.js +13 -4
  30. package/HiTable/BodyCells/CellText.js +17 -7
  31. package/HiTable/BodyCells/CellThirdPartySecurity.js +12 -3
  32. package/HiTable/BodyRow.js +12 -3
  33. package/HiTable/ColumnFilter.js +2 -5
  34. package/HiTable/HeaderCell.js +21 -11
  35. package/HiTable/HiStickyRow.js +24 -13
  36. package/HiTable/HiTable.js +30 -69
  37. package/HiTable/HiTableBody.js +99 -29
  38. package/HiTable/HiTableContextMenu.js +31 -16
  39. package/HiTable/HiTableFooter.js +9 -0
  40. package/HiTable/HiTableHead.js +15 -7
  41. package/HiTopBar/HiTopBar.js +6 -0
  42. package/README.md +71 -6
  43. package/es/HiChip/HiChip.js +79 -8
  44. package/es/HiChip/HiChipSwitch.js +6 -0
  45. package/es/HiDatePicker/HiDatePicker.js +30 -21
  46. package/es/HiDatePicker/HiDateRangePicker.js +86 -52
  47. package/es/HiDatePicker/HiDateRangeSelector.js +14 -4
  48. package/es/HiDatePicker/Overlays/Overlay.js +1 -1
  49. package/es/HiDatePicker/stylesheet.js +3 -0
  50. package/es/HiForm/HiInput.js +12 -2
  51. package/es/HiForm/HiPasswordField.js +8 -3
  52. package/es/HiLoader/HiLoader.js +3 -3
  53. package/es/HiPins/HiPins.js +4 -4
  54. package/es/HiSelect/HiSelect.js +25 -6
  55. package/es/HiSelect/HiSuggestSelect.js +2 -1
  56. package/es/HiSelect/SelectInput.js +3 -8
  57. package/es/HiSelectableList/HiSelectableList.js +51 -49
  58. package/es/HiSelectableList/HiSelectableListItem.js +15 -2
  59. package/es/HiTable/BodyCellBuilder.js +8 -2
  60. package/es/HiTable/BodyCells/CellAccount.js +7 -2
  61. package/es/HiTable/BodyCells/CellAccountNumber.js +6 -1
  62. package/es/HiTable/BodyCells/CellAddress.js +6 -1
  63. package/es/HiTable/BodyCells/CellCountry.js +6 -1
  64. package/es/HiTable/BodyCells/CellDate.js +28 -37
  65. package/es/HiTable/BodyCells/CellIcon.js +6 -1
  66. package/es/HiTable/BodyCells/CellImage.js +6 -1
  67. package/es/HiTable/BodyCells/CellNumeric.js +6 -1
  68. package/es/HiTable/BodyCells/CellRate.js +6 -1
  69. package/es/HiTable/BodyCells/CellSentinel.js +6 -1
  70. package/es/HiTable/BodyCells/CellStatus.js +7 -2
  71. package/es/HiTable/BodyCells/CellText.js +6 -1
  72. package/es/HiTable/BodyCells/CellThirdPartySecurity.js +6 -1
  73. package/es/HiTable/BodyRow.js +7 -2
  74. package/es/HiTable/ColumnFilter.js +2 -5
  75. package/es/HiTable/HeaderCell.js +16 -9
  76. package/es/HiTable/HiStickyRow.js +20 -13
  77. package/es/HiTable/HiTable.js +4 -40
  78. package/es/HiTable/HiTableBody.js +78 -26
  79. package/es/HiTable/HiTableContextMenu.js +28 -16
  80. package/es/HiTable/HiTableFooter.js +5 -0
  81. package/es/HiTable/HiTableHead.js +11 -6
  82. package/es/HiTopBar/HiTopBar.js +5 -0
  83. package/es/utils/HiIconBuilder.js +6 -2
  84. package/index.es.js +1 -1
  85. package/index.js +1 -1
  86. package/package.json +6 -1
  87. package/umd/hipay-material-ui.development.js +99120 -65306
  88. package/umd/hipay-material-ui.production.min.js +5 -5
  89. package/utils/HiIconBuilder.js +6 -2
@@ -88,7 +88,9 @@ var HiTableContextMenu = function (_React$Component) {
88
88
 
89
89
  _this.state = {
90
90
  value: '',
91
- label: ''
91
+ label: '',
92
+ lookup: true,
93
+ exclude: true
92
94
  };
93
95
 
94
96
  _this.handleContextMenuOpen = _this.handleContextMenuOpen.bind(_this);
@@ -102,9 +104,13 @@ var HiTableContextMenu = function (_React$Component) {
102
104
  (0, _createClass3.default)(HiTableContextMenu, [{
103
105
  key: 'handleContextMenuOpen',
104
106
  value: function handleContextMenuOpen(event) {
107
+ var columns = this.props.columns;
108
+
105
109
  this.setState({
106
110
  value: event.detail.data.value,
107
- label: event.detail.data.label
111
+ label: event.detail.data.label,
112
+ lookup: columns[event.detail.data.column].lookup !== false,
113
+ exclude: columns[event.detail.data.column].exclude !== false
108
114
  });
109
115
  }
110
116
  }, {
@@ -144,9 +150,12 @@ var HiTableContextMenu = function (_React$Component) {
144
150
  classes = _props.classes,
145
151
  tabId = _props.tabId,
146
152
  translations = _props.translations;
153
+ var _state = this.state,
154
+ lookup = _state.lookup,
155
+ exclude = _state.exclude;
147
156
 
148
157
 
149
- var contextMenuItems = [{ id: 'copy', icon: 'contentDuplicate', title: translations.copy, action: this.handleClickCopy }, { id: 'lookup', icon: 'crosshairsGps', title: translations.lookUp, action: this.handleClickLookup }, { id: 'exclude', icon: 'closeCircleOutline', title: translations.exclude, action: this.handleClickExclude }, { id: 'open', icon: 'openInNew', title: translations.openInNewTab, action: this.handleClickOpenNewTab }];
158
+ var contextMenuItems = [{ id: 'copy', icon: 'contentDuplicate', title: translations.copy, action: this.handleClickCopy }, { id: 'lookup', displayed: lookup, icon: 'crosshairsGps', title: translations.lookUp, action: this.handleClickLookup }, { id: 'exclude', displayed: exclude, icon: 'closeCircleOutline', title: translations.exclude, action: this.handleClickExclude }, { id: 'open', icon: 'openInNew', title: translations.openInNewTab, action: this.handleClickOpenNewTab }];
150
159
 
151
160
  return _react2.default.createElement(
152
161
  _reactContextmenu.ContextMenu,
@@ -156,19 +165,21 @@ var HiTableContextMenu = function (_React$Component) {
156
165
  onShow: this.handleContextMenuOpen
157
166
  },
158
167
  contextMenuItems.map(function (menuItem) {
159
- return _react2.default.createElement(
160
- _reactContextmenu.MenuItem,
161
- {
162
- attributes: { className: classes.contextMenuItem },
163
- key: 'hitable_context_menu_' + tabId + '_' + menuItem.id,
164
- onClick: menuItem.action },
165
- _react2.default.createElement(_HiIconBuilder2.default, { icon: menuItem.icon }),
166
- _react2.default.createElement(
167
- 'span',
168
- { className: classes.title },
169
- menuItem.title.replace('%s', _this2.state.label)
170
- )
171
- );
168
+ if (menuItem.displayed !== false) {
169
+ return _react2.default.createElement(
170
+ _reactContextmenu.MenuItem,
171
+ {
172
+ attributes: { className: classes.contextMenuItem },
173
+ key: 'hitable_context_menu_' + tabId + '_' + menuItem.id,
174
+ onClick: menuItem.action },
175
+ _react2.default.createElement(_HiIconBuilder2.default, { icon: menuItem.icon }),
176
+ _react2.default.createElement(
177
+ 'span',
178
+ { className: classes.title },
179
+ menuItem.title.replace('%s', _this2.state.label)
180
+ )
181
+ );
182
+ }
172
183
  })
173
184
  );
174
185
  }
@@ -189,6 +200,10 @@ HiTableContextMenu.propTypes = process.env.NODE_ENV !== "production" ? {
189
200
  * Surcharge le style du composant
190
201
  */
191
202
  classes: _propTypes2.default.object,
203
+ /**
204
+ * Liste des objets colonnes utilisé pour savoir quels items du context menu sont affichés
205
+ */
206
+ columns: _propTypes2.default.object.isRequired,
192
207
  /**
193
208
  * Fonction de callback appelée au clic sur l'item redirection
194
209
  * du menu contextuel ouvert au clic droit
@@ -5,6 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.styles = undefined;
7
7
 
8
+ var _stringify = require('babel-runtime/core-js/json/stringify');
9
+
10
+ var _stringify2 = _interopRequireDefault(_stringify);
11
+
8
12
  var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
9
13
 
10
14
  var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
@@ -78,6 +82,11 @@ var HiTableFooter = function (_React$Component) {
78
82
  }
79
83
 
80
84
  (0, _createClass3.default)(HiTableFooter, [{
85
+ key: 'shouldComponentUpdate',
86
+ value: function shouldComponentUpdate(nextProps, nextState) {
87
+ return (0, _stringify2.default)(this.props) !== (0, _stringify2.default)(nextProps) || (0, _stringify2.default)(this.state) !== (0, _stringify2.default)(nextState);
88
+ }
89
+ }, {
81
90
  key: 'render',
82
91
  value: function render() {
83
92
  var _props = this.props,
@@ -13,6 +13,10 @@ var _extends2 = require('babel-runtime/helpers/extends');
13
13
 
14
14
  var _extends3 = _interopRequireDefault(_extends2);
15
15
 
16
+ var _stringify = require('babel-runtime/core-js/json/stringify');
17
+
18
+ var _stringify2 = _interopRequireDefault(_stringify);
19
+
16
20
  var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
17
21
 
18
22
  var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
@@ -163,13 +167,13 @@ var HiTableHead = function (_React$Component) {
163
167
 
164
168
  var _this = (0, _possibleConstructorReturn3.default)(this, (HiTableHead.__proto__ || (0, _getPrototypeOf2.default)(HiTableHead)).call(this));
165
169
 
170
+ _this.orderColumnsAnchorEl = null;
166
171
  _this.orderColumnsButton = null;
167
172
 
168
173
 
169
174
  _this.state = {
170
175
  hovered: false,
171
- openedOrderColumns: false,
172
- orderColumnsAnchorEl: null
176
+ openedOrderColumns: false
173
177
  };
174
178
 
175
179
  _this.handleEvent = _this.handleEvent.bind(_this);
@@ -179,6 +183,11 @@ var HiTableHead = function (_React$Component) {
179
183
  }
180
184
 
181
185
  (0, _createClass3.default)(HiTableHead, [{
186
+ key: 'shouldComponentUpdate',
187
+ value: function shouldComponentUpdate(nextProps, nextState) {
188
+ return (0, _stringify2.default)(this.props) !== (0, _stringify2.default)(nextProps) || (0, _stringify2.default)(this.state) !== (0, _stringify2.default)(nextState);
189
+ }
190
+ }, {
182
191
  key: 'handleEvent',
183
192
  value: function handleEvent(_ref) {
184
193
  var type = _ref.type;
@@ -196,9 +205,9 @@ var HiTableHead = function (_React$Component) {
196
205
  key: 'handleOpenOrderColumns',
197
206
  value: function handleOpenOrderColumns() {
198
207
  this.setState({
199
- openedOrderColumns: true,
200
- orderColumnsAnchorEl: (0, _reactDom.findDOMNode)(this.orderColumnsButton)
208
+ openedOrderColumns: true
201
209
  });
210
+ this.orderColumnsAnchorEl = (0, _reactDom.findDOMNode)(this.orderColumnsButton);
202
211
  }
203
212
  }, {
204
213
  key: 'handleCloseOrderColumns',
@@ -240,8 +249,7 @@ var HiTableHead = function (_React$Component) {
240
249
  fixedColumnWidth = _props.fixedColumnWidth;
241
250
  var _state = this.state,
242
251
  hovered = _state.hovered,
243
- openedOrderColumns = _state.openedOrderColumns,
244
- orderColumnsAnchorEl = _state.orderColumnsAnchorEl;
252
+ openedOrderColumns = _state.openedOrderColumns;
245
253
 
246
254
 
247
255
  var headerProps = (0, _extends3.default)({
@@ -343,7 +351,7 @@ var HiTableHead = function (_React$Component) {
343
351
  orderable && _react2.default.createElement(_OrderColumns2.default, {
344
352
  isOpen: openedOrderColumns,
345
353
  onClose: this.handleCloseOrderColumns,
346
- anchorEl: orderColumnsAnchorEl,
354
+ anchorEl: this.orderColumnsAnchorEl,
347
355
  updateOrderedColumns: onColumnsOrderUpdate,
348
356
  columns: columns,
349
357
  orderedColumns: orderedColumns,
@@ -245,6 +245,12 @@ var HiTopBar = function (_React$Component) {
245
245
  value: function handleClickMenu() {
246
246
  this.props.onClickReturn();
247
247
  }
248
+
249
+ //TODO : Cyclic reference passed.
250
+ /*shouldComponentUpdate(nextProps, nextState){
251
+ return JSON.stringify(this.props) !== JSON.stringify(nextProps);
252
+ }*/
253
+
248
254
  }, {
249
255
  key: 'render',
250
256
  value: function render() {
package/README.md CHANGED
@@ -5,12 +5,14 @@ Voici la documentation du site HiPay Material-UI.
5
5
  Avant de commencer, il faut vous familiariser avec REACT :
6
6
  - https://reactjs.org/
7
7
  - https://reactjs.org/docs/optimizing-performance.html
8
+
8
9
  Et connaitres les [best practices](#best-practices)
9
10
 
10
11
 
11
12
  ## Lancer le projet
12
13
 
13
14
  #### Via docker
15
+
14
16
  Il faut que sur votre poste soit installés
15
17
  - [Docker](https://www.docker.com/community-edition) (minimum version 17)
16
18
  - [Docker Compose](#https://docs.docker.com/compose/install/) (minimum version 1.13.0)
@@ -27,6 +29,7 @@ Le site est dispo à cette URL:
27
29
  [http://localhost:3222](http://localhost:3222)
28
30
 
29
31
  #### En local
32
+
30
33
  Il faut que sur votre poste soit installés
31
34
  - [node](https://nodejs.org/fr/) (minimum version LTS 8.9.4)
32
35
  - [npm](https://www.npmjs.com/) (minimum version 5.6.0)
@@ -115,10 +118,50 @@ git flow feature start PSYCHE-XXX
115
118
  - Les [tests unitaires](#tests) doivent passer
116
119
  - La [génération des apis](#generation-des-apis) aussi
117
120
  - Le code doit être bien formatter : [ESLint - Prettier](#esLint-prettier)
118
- - commit + push
121
+ - Commit - suivant les conventions de rédaction des messages de commit
122
+ - Push
119
123
  - Faire la demande de merge request sur la develop
120
124
  - La revue se fera par un membre de l'équipe PSYCHE
121
125
 
126
+ ##### Conventional Changelog
127
+
128
+ (optionel) installer [commitizen](https://github.com/commitizen/cz-cli) pour s'assurer de commiter selon la convention
129
+ ```sh
130
+ npm install commitizen -g
131
+ ```
132
+
133
+
134
+ Voici un squelette d’exemple de message de commit conventionnel :
135
+ ```
136
+ <type de tâche>(<périmètre>): message court
137
+
138
+ Description complémentaire/complète
139
+
140
+ Référence/action sur un ticket définissant cette tâche
141
+ ```
142
+
143
+ On facilite ainsi la lecture du log d’une part, la génération automatique du changelog (ou release notes) d’autre part
144
+
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
151
+
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
153
+
154
+ Périmètre (optionel): nom du composant, type de tests, page de la doc
155
+
156
+ Exemple:
157
+ ```
158
+ feat(HiTable): add children rows management
159
+
160
+ Handle children rows as subtable based on the same columns as parents.
161
+
162
+ PSYCHE-XX
163
+ ```
164
+
122
165
  ## Génération des apis
123
166
  ```sh
124
167
  npm run docs:api
@@ -178,12 +221,17 @@ Le projet est publié sur un repo privé npm : https://www.npmjs.com/package/@hi
178
221
 
179
222
  #### Publier une nouvelle version
180
223
 
181
- 1. Changer la version dans package.json
182
- 2. Build
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.
183
225
  ```sh
184
- npm run build
226
+ npm install -g conventional-changelog-cli
185
227
  ```
186
- 3. Publish
228
+
229
+ 1. Changer la version dans 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 :
234
+
187
235
  ```sh
188
236
  cd build
189
237
  npm login
@@ -192,7 +240,24 @@ npm login
192
240
  npm publish
193
241
  ```
194
242
 
195
- # Si ERR d'authenitifcation
243
+ #### [Semantic Versioning](https://semver.org/)
244
+
245
+ Une version MAJOR.MINOR.PATCH, correspond a:
246
+
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).
251
+
252
+ En production, chaque releases (MAJOR, MINOR & PATCH) doit faire l'objet d'une communication interne aux tribus utilisatrices.
253
+
254
+ Les projets peuvent se baser sur une version MINOR: ```^2.5.0```, ce qui signifient "compatible avec la version 2.5.0".
255
+
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).
259
+
260
+ # Si ERR d'authentification
196
261
  npm adduser
197
262
  admin
198
263
  admin123
@@ -27,14 +27,24 @@ export const styles = theme => ({
27
27
  },
28
28
  '&$deletable': {
29
29
  paddingRight: 4
30
+ },
31
+ '&$leftIccon': {
32
+ paddingLeft: 4
30
33
  }
31
34
  }),
32
35
  leftNavigation: {},
33
36
  rightNavigation: {},
34
37
  deletable: {},
38
+ leftIccon: {},
35
39
  icon: {
36
40
  marginRight: 4
37
41
  },
42
+ iconClickable: {
43
+ cursor: 'pointer',
44
+ '&:hover, &:focus': {
45
+ color: theme.palette.business.primary.normal
46
+ }
47
+ },
38
48
  eraseIcon: {
39
49
  // Remove grey highlight
40
50
  WebkitTapHighlightColor: 'transparent',
@@ -78,15 +88,33 @@ export const styles = theme => ({
78
88
  });
79
89
 
80
90
  function HiChip(props) {
81
- const { label, classes, icon, img, onPrevious, onNext, onDelete, prefix } = props;
91
+ const {
92
+ label,
93
+ classes,
94
+ icon,
95
+ id,
96
+ img,
97
+ onPrevious,
98
+ onNext,
99
+ onDelete,
100
+ prefix,
101
+ onIconClick,
102
+ titleDelete,
103
+ titleIcon,
104
+ titleImg,
105
+ titleNext,
106
+ titlePrevious
107
+ } = props;
82
108
 
83
109
  return React.createElement(
84
110
  'div',
85
111
  {
112
+ id: id,
86
113
  className: classNames(classes.root, {
87
114
  [classes.leftNavigation]: onPrevious,
88
115
  [classes.rightNavigation]: onNext,
89
- [classes.deletable]: onDelete
116
+ [classes.deletable]: onDelete,
117
+ [classes.leftIccon]: icon
90
118
  })
91
119
  },
92
120
  prefix && React.createElement(
@@ -95,13 +123,22 @@ function HiChip(props) {
95
123
  prefix,
96
124
  ' : '
97
125
  ),
98
- img && React.createElement('img', { className: classes.badge, src: img, alt: img }),
99
- icon && React.createElement(HiIconBuilder, { className: classes.icon, icon: icon, size: 16 }),
126
+ img && React.createElement('img', { className: classes.badge, src: img, alt: img, title: titleImg }),
127
+ icon && React.createElement(HiIconBuilder, {
128
+ className: classNames(classes.icon, {
129
+ [classes.iconClickable]: onIconClick
130
+ }),
131
+ icon: icon,
132
+ size: 16,
133
+ onClick: onIconClick,
134
+ titleAccess: titleIcon
135
+ }),
100
136
  onPrevious && React.createElement(HiIconBuilder, {
101
137
  className: classNames(classes.navigate),
102
138
  icon: 'menuLeft',
103
139
  onClick: onPrevious,
104
- size: 16
140
+ size: 16,
141
+ titleAccess: titlePrevious
105
142
  }),
106
143
  React.createElement(
107
144
  'span',
@@ -112,13 +149,15 @@ function HiChip(props) {
112
149
  className: classNames(classes.navigate),
113
150
  icon: 'menuRight',
114
151
  onClick: onNext,
115
- size: 16
152
+ size: 16,
153
+ titleAccess: titleNext
116
154
  }),
117
155
  onDelete && React.createElement(HiIconBuilder, {
118
156
  classes: { root: classes.eraseIcon },
119
157
  icon: 'closeCircle',
120
158
  onClick: onDelete,
121
- size: 16
159
+ size: 16,
160
+ titleAccess: titleDelete
122
161
  })
123
162
  );
124
163
  }
@@ -132,6 +171,10 @@ HiChip.propTypes = process.env.NODE_ENV !== "production" ? {
132
171
  * Icone affiché à gauche
133
172
  */
134
173
  icon: PropTypes.string,
174
+ /**
175
+ * Identifiant de l'élément
176
+ */
177
+ id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
135
178
  /**
136
179
  * Ajoute une image à gauche du Chip
137
180
  */
@@ -144,6 +187,10 @@ HiChip.propTypes = process.env.NODE_ENV !== "production" ? {
144
187
  * Fonction de callback au clic sur l'icon close si cancelable = true
145
188
  */
146
189
  onDelete: PropTypes.func,
190
+ /**
191
+ * Fonction de callback au clic sur l'icon à gauche
192
+ */
193
+ onIconClick: PropTypes.func,
147
194
  /**
148
195
  * Fonction de callback au clic sur l'icon next
149
196
  */
@@ -151,7 +198,31 @@ HiChip.propTypes = process.env.NODE_ENV !== "production" ? {
151
198
  /**
152
199
  * Fonction de callback au clic sur l'icon previous
153
200
  */
154
- onPrevious: PropTypes.func
201
+ onPrevious: PropTypes.func,
202
+ /**
203
+ * Préfixe dans le HiChip
204
+ */
205
+ prefix: PropTypes.string,
206
+ /**
207
+ * Titre de l'icône supprimer
208
+ */
209
+ titleDelete: PropTypes.string,
210
+ /**
211
+ * Titre de l'icône
212
+ */
213
+ titleIcon: PropTypes.string,
214
+ /**
215
+ * Titre de la balise img
216
+ */
217
+ titleImg: PropTypes.string,
218
+ /**
219
+ * Titre de la navigation suivante
220
+ */
221
+ titleNext: PropTypes.string,
222
+ /**
223
+ * Titre de la navigation précédente
224
+ */
225
+ titlePrevious: PropTypes.string
155
226
  } : {};
156
227
 
157
228
  export default withStyles(styles, { name: 'HmuiHiChip' })(HiChip);
@@ -138,6 +138,7 @@ class HiChipSwitch extends React.PureComponent {
138
138
 
139
139
  render() {
140
140
  const {
141
+ id,
141
142
  label,
142
143
  classes,
143
144
  activeIcon,
@@ -163,6 +164,7 @@ class HiChipSwitch extends React.PureComponent {
163
164
  return React.createElement(
164
165
  'div',
165
166
  {
167
+ id: id,
166
168
  className: classNames(classes.root, {
167
169
  [classes.active]: !!active,
168
170
  [classes.inactive]: !active
@@ -223,6 +225,10 @@ HiChipSwitch.propTypes = process.env.NODE_ENV !== "production" ? {
223
225
  * Surcharge les classes du composant
224
226
  */
225
227
  classes: PropTypes.object,
228
+ /**
229
+ * Identifiant de l'élément
230
+ */
231
+ id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
226
232
  /**
227
233
  * Label qu'affiche le ChipFilter
228
234
  */
@@ -40,6 +40,7 @@ class HiDatePicker extends React.Component {
40
40
  this.renderMonthPickerOverlay = this.renderMonthPickerOverlay.bind(this);
41
41
  this.renderTimePickerOverlay = this.renderTimePickerOverlay.bind(this);
42
42
  this.renderYearPickerOverlay = this.renderYearPickerOverlay.bind(this);
43
+ this.handleInputChange = this.handleInputChange.bind(this);
43
44
  }
44
45
 
45
46
  componentWillUnmount() {
@@ -51,27 +52,33 @@ class HiDatePicker extends React.Component {
51
52
  this.props.onReset();
52
53
  }
53
54
 
55
+ handleInputChange(event) {
56
+ this.props.onChange(event.target.value);
57
+ }
58
+
54
59
  handleDayChange(day, modifiers) {
55
- if (modifiers.selected) {
56
- // Deselect day
57
- this.props.onChange(undefined);
58
- } else {
59
- // Keep Time if set
60
- if (this.props.enableTime && day !== undefined) {
61
- if (this.props.value) {
62
- day.setHours(this.props.value.getHours(), this.props.value.getMinutes());
63
- } else {
64
- day.setHours(0, 0);
60
+ if (day) {
61
+ if (modifiers.selected) {
62
+ // Deselect day
63
+ this.props.onChange(undefined);
64
+ } else {
65
+ // Keep Time if set
66
+ if (this.props.enableTime && day !== undefined) {
67
+ if (this.props.value) {
68
+ day.setHours(this.props.value.getHours(), this.props.value.getMinutes());
69
+ } else {
70
+ day.setHours(0, 0);
71
+ }
65
72
  }
73
+ this.props.onChange(day);
74
+ }
75
+ if (day instanceof Date && !this.props.enableTime && modifiers.selected !== true) {
76
+ // Hide overlay & remove focus on input
77
+ document.activeElement.blur();
78
+ } else if (day instanceof Date && this.props.enableTime && modifiers.selected !== true) {
79
+ // Open Time panel after date selection
80
+ this.openPanel('time');
66
81
  }
67
- this.props.onChange(day);
68
- }
69
- if (day instanceof Date && !this.props.enableTime && modifiers.selected !== true) {
70
- // Hide overlay & remove focus on input
71
- document.activeElement.blur();
72
- } else if (day instanceof Date && this.props.enableTime && modifiers.selected !== true) {
73
- // Open Time panel after date selection
74
- this.openPanel('time');
75
82
  }
76
83
  }
77
84
 
@@ -205,7 +212,7 @@ class HiDatePicker extends React.Component {
205
212
  captionElement: this.renderCaption,
206
213
  classNames: classes,
207
214
  disabledDays: effectiveDisabledDays,
208
- selectedDays: value,
215
+ selectedDays: typeof value === 'object' ? value : undefined,
209
216
  locale,
210
217
  firstDayOfWeek: 1,
211
218
  fromMonth: minimumDate,
@@ -221,7 +228,9 @@ class HiDatePicker extends React.Component {
221
228
  onReset: this.handleReset
222
229
  }, {
223
230
  onBlur: this.handleBlur
224
- }, props);
231
+ }, props, {
232
+ onChange: this.handleInputChange
233
+ });
225
234
 
226
235
  return React.createElement(
227
236
  'div',
@@ -314,6 +323,6 @@ HiDatePicker.propTypes = process.env.NODE_ENV !== "production" ? {
314
323
  /**
315
324
  * Date sélectionnée
316
325
  */
317
- value: PropTypes.instanceOf(Date)
326
+ value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.string])
318
327
  } : {};
319
328
  export default withStyles(styles, { name: 'HmuiHiDatePicker' })(HiDatePicker);