box-ui-elements 17.1.0-beta.4 → 17.1.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -59,6 +59,20 @@ function (_Component) {
59
59
 
60
60
  _this = _possibleConstructorReturn(this, _getPrototypeOf(ContentExplorer).call(this, props));
61
61
 
62
+ _defineProperty(_assertThisInitialized(_this), "areAllItemsSelected", function () {
63
+ var items = _this.props.items;
64
+ var selectedItems = _this.state.selectedItems;
65
+ return items.every(function (item) {
66
+ return selectedItems[item.id];
67
+ });
68
+ });
69
+
70
+ _defineProperty(_assertThisInitialized(_this), "isLoadingItems", function () {
71
+ var _this$props, _this$props$items, _this$props$items$;
72
+
73
+ return (_this$props = _this.props) === null || _this$props === void 0 ? void 0 : (_this$props$items = _this$props.items) === null || _this$props$items === void 0 ? void 0 : (_this$props$items$ = _this$props$items[0]) === null || _this$props$items$ === void 0 ? void 0 : _this$props$items$.isLoading;
74
+ });
75
+
62
76
  _defineProperty(_assertThisInitialized(_this), "doAncestersContainClassname", function (node, className, limit) {
63
77
  var nodeOfInterest = node;
64
78
  var counter = 0;
@@ -102,10 +116,10 @@ function (_Component) {
102
116
  });
103
117
 
104
118
  _defineProperty(_assertThisInitialized(_this), "enterFolder", function (enteredFolder) {
105
- var _this$props = _this.props,
106
- contentExplorerMode = _this$props.contentExplorerMode,
107
- onEnterFolder = _this$props.onEnterFolder,
108
- onFoldersPathUpdate = _this$props.onFoldersPathUpdate;
119
+ var _this$props2 = _this.props,
120
+ contentExplorerMode = _this$props2.contentExplorerMode,
121
+ onEnterFolder = _this$props2.onEnterFolder,
122
+ onFoldersPathUpdate = _this$props2.onFoldersPathUpdate;
109
123
  var foldersPath = _this.state.foldersPath;
110
124
  var folderIndex = foldersPath.findIndex(function (folder) {
111
125
  return folder.id === enteredFolder.id;
@@ -172,11 +186,11 @@ function (_Component) {
172
186
  _defineProperty(_assertThisInitialized(_this), "handleItemClick", function (_ref) {
173
187
  var event = _ref.event,
174
188
  index = _ref.index;
175
- var _this$props2 = _this.props,
176
- contentExplorerMode = _this$props2.contentExplorerMode,
177
- items = _this$props2.items,
178
- onSelectItem = _this$props2.onSelectItem,
179
- onSelectedItemsUpdate = _this$props2.onSelectedItemsUpdate;
189
+ var _this$props3 = _this.props,
190
+ contentExplorerMode = _this$props3.contentExplorerMode,
191
+ items = _this$props3.items,
192
+ onSelectItem = _this$props3.onSelectItem,
193
+ onSelectedItemsUpdate = _this$props3.onSelectedItemsUpdate;
180
194
  var selectedItems = _this.state.selectedItems;
181
195
  var item = items[index];
182
196
 
@@ -195,8 +209,7 @@ function (_Component) {
195
209
  }
196
210
 
197
211
  _this.setState({
198
- selectedItems: newSelectedItems,
199
- isSelectAllChecked: false
212
+ selectedItems: newSelectedItems
200
213
  });
201
214
 
202
215
  if (onSelectedItemsUpdate) {
@@ -210,9 +223,9 @@ function (_Component) {
210
223
 
211
224
  _defineProperty(_assertThisInitialized(_this), "handleItemDoubleClick", function (_ref2) {
212
225
  var index = _ref2.index;
213
- var _this$props3 = _this.props,
214
- items = _this$props3.items,
215
- onChooseItems = _this$props3.onChooseItems;
226
+ var _this$props4 = _this.props,
227
+ items = _this$props4.items,
228
+ onChooseItems = _this$props4.onChooseItems;
216
229
  var item = items[index];
217
230
 
218
231
  if (item.isDisabled || item.isLoading) {
@@ -224,10 +237,6 @@ function (_Component) {
224
237
  } else if (!item.isActionDisabled) {
225
238
  onChooseItems([item]);
226
239
  }
227
-
228
- _this.setState({
229
- isSelectAllChecked: false
230
- });
231
240
  });
232
241
 
233
242
  _defineProperty(_assertThisInitialized(_this), "handleItemNameClick", function (event, index) {
@@ -247,10 +256,6 @@ function (_Component) {
247
256
  event.stopPropagation();
248
257
 
249
258
  _this.enterFolder(item);
250
-
251
- _this.setState({
252
- isSelectAllChecked: false
253
- });
254
259
  });
255
260
 
256
261
  _defineProperty(_assertThisInitialized(_this), "toggleSelectedItem", function (selectedItems, item) {
@@ -298,15 +303,14 @@ function (_Component) {
298
303
  _asyncToGenerator(
299
304
  /*#__PURE__*/
300
305
  regeneratorRuntime.mark(function _callee() {
301
- var _this$props4, items, onSelectedItemsUpdate, isSelectAllChecked, newSelectedItems;
302
-
306
+ var onSelectedItemsUpdate, isSelectAllChecked, newSelectedItems;
303
307
  return regeneratorRuntime.wrap(function _callee$(_context) {
304
308
  while (1) {
305
309
  switch (_context.prev = _context.next) {
306
310
  case 0:
307
- _this$props4 = _this.props, items = _this$props4.items, onSelectedItemsUpdate = _this$props4.onSelectedItemsUpdate;
311
+ onSelectedItemsUpdate = _this.props.onSelectedItemsUpdate;
308
312
 
309
- if (!(items && items[0] && items[0].isLoading)) {
313
+ if (!_this.isLoadingItems()) {
310
314
  _context.next = 3;
311
315
  break;
312
316
  }
@@ -362,11 +366,24 @@ function (_Component) {
362
366
  key: "componentDidUpdate",
363
367
  value: function componentDidUpdate(_ref4) {
364
368
  var prevInitialFoldersPath = _ref4.initialFoldersPath;
365
- var initialFoldersPath = this.props.initialFoldersPath;
369
+ var _this$props5 = this.props,
370
+ initialFoldersPath = _this$props5.initialFoldersPath,
371
+ isSelectAllAllowed = _this$props5.isSelectAllAllowed;
372
+ var isSelectAllChecked = this.state.isSelectAllChecked;
366
373
 
367
374
  if (prevInitialFoldersPath !== initialFoldersPath) {
368
375
  this.handleFoldersPathUpdated(initialFoldersPath);
369
376
  }
377
+
378
+ if (!this.isLoadingItems() && isSelectAllAllowed) {
379
+ var areAllItemsSelected = this.areAllItemsSelected();
380
+
381
+ if (areAllItemsSelected !== isSelectAllChecked) {
382
+ this.setState({
383
+ isSelectAllChecked: areAllItemsSelected
384
+ });
385
+ }
386
+ }
370
387
  }
371
388
  }, {
372
389
  key: "componentWillUnmount",
@@ -400,51 +417,51 @@ function (_Component) {
400
417
  value: function render() {
401
418
  var _this2 = this;
402
419
 
403
- var _this$props5 = this.props,
404
- actionButtonsProps = _this$props5.actionButtonsProps,
405
- additionalColumns = _this$props5.additionalColumns,
406
- _this$props5$isNoSele = _this$props5.isNoSelectionAllowed,
407
- isNoSelectionAllowed = _this$props5$isNoSele === void 0 ? false : _this$props5$isNoSele,
408
- breadcrumbProps = _this$props5.breadcrumbProps,
409
- cancelButtonProps = _this$props5.cancelButtonProps,
410
- chooseButtonProps = _this$props5.chooseButtonProps,
411
- chooseButtonText = _this$props5.chooseButtonText,
412
- className = _this$props5.className,
413
- contentExplorerMode = _this$props5.contentExplorerMode,
414
- customInput = _this$props5.customInput,
415
- hasFolderTreeBreadcrumbs = _this$props5.hasFolderTreeBreadcrumbs,
416
- headerActionsAccessory = _this$props5.headerActionsAccessory,
417
- onChooseItems = _this$props5.onChooseItems,
418
- onMoveItem = _this$props5.onMoveItem,
419
- onCopyItem = _this$props5.onCopyItem,
420
- onCancelButtonClick = _this$props5.onCancelButtonClick,
421
- onCreateNewFolderButtonClick = _this$props5.onCreateNewFolderButtonClick,
422
- onSelectedClick = _this$props5.onSelectedClick,
423
- onViewSelectedClick = _this$props5.onViewSelectedClick,
424
- showCreateNewFolderButton = _this$props5.showCreateNewFolderButton,
425
- isChooseButtonLoading = _this$props5.isChooseButtonLoading,
426
- isCopyButtonLoading = _this$props5.isCopyButtonLoading,
427
- isCreateNewFolderAllowed = _this$props5.isCreateNewFolderAllowed,
428
- isMoveButtonLoading = _this$props5.isMoveButtonLoading,
429
- _this$props5$isRespon = _this$props5.isResponsive,
430
- isResponsive = _this$props5$isRespon === void 0 ? false : _this$props5$isRespon,
431
- isSelectAllAllowed = _this$props5.isSelectAllAllowed,
432
- items = _this$props5.items,
433
- numItemsPerPage = _this$props5.numItemsPerPage,
434
- numTotalItems = _this$props5.numTotalItems,
435
- onLoadMoreItems = _this$props5.onLoadMoreItems,
436
- includeSubfoldersProps = _this$props5.includeSubfoldersProps,
437
- itemIconRenderer = _this$props5.itemIconRenderer,
438
- itemNameLinkRenderer = _this$props5.itemNameLinkRenderer,
439
- itemButtonRenderer = _this$props5.itemButtonRenderer,
440
- itemRowHeight = _this$props5.itemRowHeight,
441
- itemRowRenderer = _this$props5.itemRowRenderer,
442
- listHeaderHeight = _this$props5.listHeaderHeight,
443
- listHeaderRenderer = _this$props5.listHeaderRenderer,
444
- listWidth = _this$props5.listWidth,
445
- listHeight = _this$props5.listHeight,
446
- searchInputProps = _this$props5.searchInputProps,
447
- rest = _objectWithoutProperties(_this$props5, ["actionButtonsProps", "additionalColumns", "isNoSelectionAllowed", "breadcrumbProps", "cancelButtonProps", "chooseButtonProps", "chooseButtonText", "className", "contentExplorerMode", "customInput", "hasFolderTreeBreadcrumbs", "headerActionsAccessory", "onChooseItems", "onMoveItem", "onCopyItem", "onCancelButtonClick", "onCreateNewFolderButtonClick", "onSelectedClick", "onViewSelectedClick", "showCreateNewFolderButton", "isChooseButtonLoading", "isCopyButtonLoading", "isCreateNewFolderAllowed", "isMoveButtonLoading", "isResponsive", "isSelectAllAllowed", "items", "numItemsPerPage", "numTotalItems", "onLoadMoreItems", "includeSubfoldersProps", "itemIconRenderer", "itemNameLinkRenderer", "itemButtonRenderer", "itemRowHeight", "itemRowRenderer", "listHeaderHeight", "listHeaderRenderer", "listWidth", "listHeight", "searchInputProps"]);
420
+ var _this$props6 = this.props,
421
+ actionButtonsProps = _this$props6.actionButtonsProps,
422
+ additionalColumns = _this$props6.additionalColumns,
423
+ _this$props6$isNoSele = _this$props6.isNoSelectionAllowed,
424
+ isNoSelectionAllowed = _this$props6$isNoSele === void 0 ? false : _this$props6$isNoSele,
425
+ breadcrumbProps = _this$props6.breadcrumbProps,
426
+ cancelButtonProps = _this$props6.cancelButtonProps,
427
+ chooseButtonProps = _this$props6.chooseButtonProps,
428
+ chooseButtonText = _this$props6.chooseButtonText,
429
+ className = _this$props6.className,
430
+ contentExplorerMode = _this$props6.contentExplorerMode,
431
+ customInput = _this$props6.customInput,
432
+ hasFolderTreeBreadcrumbs = _this$props6.hasFolderTreeBreadcrumbs,
433
+ headerActionsAccessory = _this$props6.headerActionsAccessory,
434
+ onChooseItems = _this$props6.onChooseItems,
435
+ onMoveItem = _this$props6.onMoveItem,
436
+ onCopyItem = _this$props6.onCopyItem,
437
+ onCancelButtonClick = _this$props6.onCancelButtonClick,
438
+ onCreateNewFolderButtonClick = _this$props6.onCreateNewFolderButtonClick,
439
+ onSelectedClick = _this$props6.onSelectedClick,
440
+ onViewSelectedClick = _this$props6.onViewSelectedClick,
441
+ showCreateNewFolderButton = _this$props6.showCreateNewFolderButton,
442
+ isChooseButtonLoading = _this$props6.isChooseButtonLoading,
443
+ isCopyButtonLoading = _this$props6.isCopyButtonLoading,
444
+ isCreateNewFolderAllowed = _this$props6.isCreateNewFolderAllowed,
445
+ isMoveButtonLoading = _this$props6.isMoveButtonLoading,
446
+ _this$props6$isRespon = _this$props6.isResponsive,
447
+ isResponsive = _this$props6$isRespon === void 0 ? false : _this$props6$isRespon,
448
+ isSelectAllAllowed = _this$props6.isSelectAllAllowed,
449
+ items = _this$props6.items,
450
+ numItemsPerPage = _this$props6.numItemsPerPage,
451
+ numTotalItems = _this$props6.numTotalItems,
452
+ onLoadMoreItems = _this$props6.onLoadMoreItems,
453
+ includeSubfoldersProps = _this$props6.includeSubfoldersProps,
454
+ itemIconRenderer = _this$props6.itemIconRenderer,
455
+ itemNameLinkRenderer = _this$props6.itemNameLinkRenderer,
456
+ itemButtonRenderer = _this$props6.itemButtonRenderer,
457
+ itemRowHeight = _this$props6.itemRowHeight,
458
+ itemRowRenderer = _this$props6.itemRowRenderer,
459
+ listHeaderHeight = _this$props6.listHeaderHeight,
460
+ listHeaderRenderer = _this$props6.listHeaderRenderer,
461
+ listWidth = _this$props6.listWidth,
462
+ listHeight = _this$props6.listHeight,
463
+ searchInputProps = _this$props6.searchInputProps,
464
+ rest = _objectWithoutProperties(_this$props6, ["actionButtonsProps", "additionalColumns", "isNoSelectionAllowed", "breadcrumbProps", "cancelButtonProps", "chooseButtonProps", "chooseButtonText", "className", "contentExplorerMode", "customInput", "hasFolderTreeBreadcrumbs", "headerActionsAccessory", "onChooseItems", "onMoveItem", "onCopyItem", "onCancelButtonClick", "onCreateNewFolderButtonClick", "onSelectedClick", "onViewSelectedClick", "showCreateNewFolderButton", "isChooseButtonLoading", "isCopyButtonLoading", "isCreateNewFolderAllowed", "isMoveButtonLoading", "isResponsive", "isSelectAllAllowed", "items", "numItemsPerPage", "numTotalItems", "onLoadMoreItems", "includeSubfoldersProps", "itemIconRenderer", "itemNameLinkRenderer", "itemButtonRenderer", "itemRowHeight", "itemRowRenderer", "listHeaderHeight", "listHeaderRenderer", "listWidth", "listHeight", "searchInputProps"]);
448
465
 
449
466
  var _this$state2 = this.state,
450
467
  isInSearchMode = _this$state2.isInSearchMode,
@@ -181,17 +181,35 @@ class ContentExplorer extends Component {
181
181
  }
182
182
 
183
183
  componentDidUpdate({ initialFoldersPath: prevInitialFoldersPath }) {
184
- const { initialFoldersPath } = this.props;
184
+ const { initialFoldersPath, isSelectAllAllowed } = this.props;
185
+ const { isSelectAllChecked } = this.state;
185
186
 
186
187
  if (prevInitialFoldersPath !== initialFoldersPath) {
187
188
  this.handleFoldersPathUpdated(initialFoldersPath);
188
189
  }
190
+ if (!this.isLoadingItems() && isSelectAllAllowed) {
191
+ const areAllItemsSelected = this.areAllItemsSelected();
192
+ if (areAllItemsSelected !== isSelectAllChecked) {
193
+ this.setState({ isSelectAllChecked: areAllItemsSelected });
194
+ }
195
+ }
189
196
  }
190
197
 
191
198
  componentWillUnmount() {
192
199
  document.removeEventListener('click', this.handleDocumentClick, true);
193
200
  }
194
201
 
202
+ areAllItemsSelected = () => {
203
+ const { items } = this.props;
204
+ const { selectedItems } = this.state;
205
+
206
+ return items.every(item => selectedItems[item.id]);
207
+ };
208
+
209
+ isLoadingItems = () => {
210
+ return this.props?.items?.[0]?.isLoading;
211
+ };
212
+
195
213
  getCurrentFolder() {
196
214
  const { foldersPath } = this.state;
197
215
  return foldersPath[foldersPath.length - 1];
@@ -329,7 +347,7 @@ class ContentExplorer extends Component {
329
347
  newSelectedItems[item.id] = item;
330
348
  }
331
349
 
332
- this.setState({ selectedItems: newSelectedItems, isSelectAllChecked: false });
350
+ this.setState({ selectedItems: newSelectedItems });
333
351
 
334
352
  if (onSelectedItemsUpdate) {
335
353
  onSelectedItemsUpdate(newSelectedItems);
@@ -353,7 +371,6 @@ class ContentExplorer extends Component {
353
371
  } else if (!item.isActionDisabled) {
354
372
  onChooseItems([item]);
355
373
  }
356
- this.setState({ isSelectAllChecked: false });
357
374
  };
358
375
 
359
376
  handleItemNameClick = (event, index) => {
@@ -373,7 +390,6 @@ class ContentExplorer extends Component {
373
390
  event.stopPropagation();
374
391
 
375
392
  this.enterFolder(item);
376
- this.setState({ isSelectAllChecked: false });
377
393
  };
378
394
 
379
395
  toggleSelectedItem = (selectedItems, item) => {
@@ -414,8 +430,8 @@ class ContentExplorer extends Component {
414
430
  };
415
431
 
416
432
  handleSelectAllClick = async () => {
417
- const { items, onSelectedItemsUpdate } = this.props;
418
- if (items && items[0] && items[0].isLoading) {
433
+ const { onSelectedItemsUpdate } = this.props;
434
+ if (this.isLoadingItems()) {
419
435
  return;
420
436
  }
421
437
  const { isSelectAllChecked } = this.state;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/features/content-explorer/content-explorer/ContentExplorer.js"],"names":["PropTypes","React","Component","classNames","omit","ContentExplorerHeaderActions","ContentExplorerEmptyState","ContentExplorerActionButtons","ContentExplorerSelectAll","ContentExplorerIncludeSubfolders","ItemList","ContentExplorerModePropType","FoldersPathPropType","ItemsPropType","ContentExplorerModes","TYPE_FOLDER","ContentExplorer","props","node","className","limit","nodeOfInterest","counter","parentNode","includes","contentExplorerMode","MULTI_SELECT","event","isInside","domNode","contains","target","shouldDeselectItems","deselectItems","enteredFolder","onEnterFolder","onFoldersPathUpdate","foldersPath","state","folderIndex","findIndex","folder","id","newFoldersPath","slice","concat","newState","selectedItems","setState","searchQuery","onSearchSubmit","isInSearchMode","folderBeforeSearch","onExitSearch","index","items","onSelectItem","onSelectedItemsUpdate","item","isDisabled","isLoading","isActionDisabled","stopPropagation","newSelectedItems","toggleSelectedItem","isSelectAllChecked","onChooseItems","type","enterFolder","preventDefault","result","forEach","unselectAll","selectAll","isViewingSearchResults","length","initialSelectedItems","initialFoldersPath","document","addEventListener","handleDocumentClick","prevInitialFoldersPath","handleFoldersPathUpdated","removeEventListener","actionButtonsProps","additionalColumns","isNoSelectionAllowed","breadcrumbProps","cancelButtonProps","chooseButtonProps","chooseButtonText","customInput","hasFolderTreeBreadcrumbs","headerActionsAccessory","onMoveItem","onCopyItem","onCancelButtonClick","onCreateNewFolderButtonClick","onSelectedClick","onViewSelectedClick","showCreateNewFolderButton","isChooseButtonLoading","isCopyButtonLoading","isCreateNewFolderAllowed","isMoveButtonLoading","isResponsive","isSelectAllAllowed","numItemsPerPage","numTotalItems","onLoadMoreItems","includeSubfoldersProps","itemIconRenderer","itemNameLinkRenderer","itemButtonRenderer","itemRowHeight","itemRowRenderer","listHeaderHeight","listHeaderRenderer","listWidth","listHeight","searchInputProps","rest","currentFolder","getCurrentFolder","contentExplorerProps","canIncludeSubfolders","hasSubheader","selectedItemsIds","Object","keys","areActionButtonsDisabled","SELECT_FILE","handleContentExplorerClick","ref","handleExitSearch","handleSearchSubmit","handleSelectAllClick","renderItemListEmptyState","handleItemClick","handleItemDoubleClick","handleItemNameClick","object","arrayOf","element","bool","string","isRequired","func","number"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,IAAP,MAAiB,aAAjB;AAEA,OAAOC,4BAAP,MAAyC,gCAAzC;AACA,OAAOC,yBAAP,MAAsC,6BAAtC;AACA,OAAOC,4BAAP,MAAyC,gCAAzC;AACA,OAAOC,wBAAP,MAAqC,4BAArC;AACA,OAAOC,gCAAP,MAA6C,oCAA7C;AAEA,OAAOC,QAAP,MAAqB,cAArB;AACA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kBAAkB,EAAE,EADF;AAElBI,EAAAA,iBAAiB,EAAE,EAFD;AAGlBC,EAAAA,iBAAiB,EAAE,EAHD;AAIlBtE,EAAAA,SAAS,EAAE,EAJO;AAKlBqG,EAAAA,gBAAgB,EAAE;AALA,C;;AAyc1B,eAAexG,eAAf","sourcesContent":["import PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport classNames from 'classnames';\nimport omit from 'lodash/omit';\n\nimport ContentExplorerHeaderActions from './ContentExplorerHeaderActions';\nimport ContentExplorerEmptyState from './ContentExplorerEmptyState';\nimport ContentExplorerActionButtons from './ContentExplorerActionButtons';\nimport ContentExplorerSelectAll from './ContentExplorerSelectAll';\nimport ContentExplorerIncludeSubfolders from './ContentExplorerIncludeSubfolders';\n\nimport ItemList from '../item-list';\nimport { ContentExplorerModePropType, FoldersPathPropType, ItemsPropType } from '../prop-types';\nimport ContentExplorerModes from '../modes';\n\nimport { TYPE_FOLDER } from '../../../constants';\n\nimport './ContentExplorer.scss';\n\nclass ContentExplorer extends Component {\n static propTypes = {\n /** Props for the action buttons container */\n actionButtonsProps: PropTypes.object,\n /**\n * Extra columns displayed in the folders table after folder name column\n * Each column has to be a Column element\n */\n additionalColumns: PropTypes.arrayOf(PropTypes.element),\n /** Allow users to choose no selections in MULTI_SELECT mode, defaults to false */\n isNoSelectionAllowed: PropTypes.bool,\n /** Props for breadcrumbs */\n breadcrumbProps: PropTypes.object,\n /** Props for the cancel button */\n cancelButtonProps: PropTypes.object,\n /** Props for the choose button */\n chooseButtonProps: PropTypes.object,\n /** Custom text for the choose button */\n chooseButtonText: PropTypes.node,\n /** Adds class name. */\n className: PropTypes.string,\n /** Configures the content explorer based on the user's intended action (ex. select file or move/copy) */\n contentExplorerMode: ContentExplorerModePropType.isRequired,\n /** Props that contains the custom search input. Is rendered in header actions */\n customInput: PropTypes.func,\n /** Whether the user can see the breadcrumbs represented with the folder tree button */\n hasFolderTreeBreadcrumbs: PropTypes.bool,\n /** Any extra items in the header to the right of the search input (and new folder button) */\n headerActionsAccessory: PropTypes.node,\n /** Props for the include subfolders toggle */\n includeSubfoldersProps: PropTypes.object,\n /** Initial path of folders. The last folder in the array is the current folder. */\n initialFoldersPath: FoldersPathPropType.isRequired,\n /** Initial items that will show up as selected */\n initialSelectedItems: PropTypes.object,\n /** Whether to use the responsive version */\n isResponsive: PropTypes.bool,\n /**\n * Called when the current folder changes\n *\n * @param {Object} enteredFolder\n * @param {Array} newFoldersPath\n */\n onEnterFolder: PropTypes.func.isRequired,\n /** Called when the folders path is updated\n *\n * @param {Array} newFoldersPath\n */\n onFoldersPathUpdate: PropTypes.func,\n /** Called whenever the selected items list changes\n *\n * @param {Object} selectedItems\n */\n onSelectedItemsUpdate: PropTypes.func,\n /**\n * Called when an item is selected\n *\n * @param {Object} selectedItem\n * @param {number} selectedItemIndex\n */\n onSelectItem: PropTypes.func,\n /**\n * Called when an item is chosen\n *\n * @param {Object[]} chosenItems\n */\n onChooseItems: PropTypes.func,\n /** Called when selected button is clicked */\n onSelectedClick: PropTypes.func,\n /** Called when the number of items selected text is clicked */\n onViewSelectedClick: PropTypes.func,\n /**\n * Called when a destination folder has been selected for moving an item to\n *\n * @param {Object} destFolder destination folder\n */\n onMoveItem: PropTypes.func,\n /**\n * Called when a destination folder has been selected for copying an item to\n *\n * @param {Object} destFolder destination folder\n */\n onCopyItem: PropTypes.func,\n /** Called when cancel button is clicked */\n onCancelButtonClick: PropTypes.func,\n /** Called when new folder button is clicked */\n onCreateNewFolderButtonClick: PropTypes.func,\n /** Whether the new folder button should be shown */\n showCreateNewFolderButton: PropTypes.bool,\n /** Whether the choose button should be shown with a loading indicator */\n isChooseButtonLoading: PropTypes.bool,\n /** Whether the copy button should be shown with a loading indicator */\n isCopyButtonLoading: PropTypes.bool,\n /** Whether the user has permission to create a new folder */\n isCreateNewFolderAllowed: PropTypes.bool,\n /** Whether the user can see select all checkbox */\n isSelectAllAllowed: PropTypes.bool,\n /** Whether the move button should be shown with a loading indicator */\n isMoveButtonLoading: PropTypes.bool,\n /**\n * Called when a search query is submitted.\n *\n * @param {string} searchQuery\n */\n onSearchSubmit: PropTypes.func.isRequired,\n /**\n * Called when search mode is exited. An updated items list should now be passed in to display the user's file tree.\n *\n * @param {Object} folderBeforeSearch the previous folder object before entering search mode\n */\n onExitSearch: PropTypes.func.isRequired,\n /** List of items to display */\n items: ItemsPropType.isRequired,\n /** Number of items to load per page as the user scrolls */\n numItemsPerPage: PropTypes.number,\n /** Total number of items across all pages */\n numTotalItems: PropTypes.number,\n /** Called to load more items */\n onLoadMoreItems: PropTypes.func,\n /** Used to render item icons in the list. Overrides the default icons. */\n itemIconRenderer: PropTypes.func,\n /** Used to render item name links in the list. Overrides the default links. */\n itemNameLinkRenderer: PropTypes.func,\n /** Used to render item buttons in the list. Overrides the default buttons. */\n itemButtonRenderer: PropTypes.func,\n /** Height of an item row */\n itemRowHeight: PropTypes.number,\n /** Used to render the row element for items on the list. Allows row customizations such as adding tooltips, etc. */\n itemRowRenderer: PropTypes.func,\n /** Height of the item list header, defaults to 0, which makes header not visible */\n listHeaderHeight: PropTypes.number,\n /** Used to render the header row on the item list */\n listHeaderRenderer: PropTypes.func,\n /** Width of the item list */\n listWidth: PropTypes.number.isRequired,\n /** Height of the item list */\n listHeight: PropTypes.number.isRequired,\n /** Props for the search input */\n searchInputProps: PropTypes.object,\n };\n\n static defaultProps = {\n actionButtonsProps: {},\n cancelButtonProps: {},\n chooseButtonProps: {},\n className: '',\n searchInputProps: {},\n };\n\n constructor(props) {\n super(props);\n this.state = {\n selectedItems: props.initialSelectedItems || {},\n foldersPath: props.initialFoldersPath,\n isInSearchMode: false,\n isSelectAllChecked: false,\n };\n }\n\n componentDidMount() {\n document.addEventListener('click', this.handleDocumentClick, true);\n }\n\n componentDidUpdate({ initialFoldersPath: prevInitialFoldersPath }) {\n const { initialFoldersPath } = this.props;\n\n if (prevInitialFoldersPath !== initialFoldersPath) {\n this.handleFoldersPathUpdated(initialFoldersPath);\n }\n }\n\n componentWillUnmount() {\n document.removeEventListener('click', this.handleDocumentClick, true);\n }\n\n getCurrentFolder() {\n const { foldersPath } = this.state;\n return foldersPath[foldersPath.length - 1];\n }\n\n /**\n * Traverse the hirerachy up to the limit to see if any of the parent has the className\n */\n doAncestersContainClassname = (node, className, limit) => {\n let nodeOfInterest = node;\n let counter = 0;\n while (nodeOfInterest.parentNode && counter < limit) {\n // Done traversing (Document node does not have classnames)\n if (!nodeOfInterest.parentNode.className) {\n break;\n }\n\n if (nodeOfInterest.parentNode.className.includes(className)) {\n return true;\n }\n\n nodeOfInterest = nodeOfInterest.parentNode;\n counter += 1;\n }\n\n return false;\n };\n\n shouldDeselectItems = () => {\n const { contentExplorerMode } = this.props;\n\n return (\n // always deselect when not in multi select mode\n contentExplorerMode !== ContentExplorerModes.MULTI_SELECT\n );\n };\n\n handleDocumentClick = event => {\n const isInside = (this.domNode && this.domNode.contains(event.target)) || this.domNode === event.target;\n\n if (!isInside && this.shouldDeselectItems()) {\n this.deselectItems();\n }\n };\n\n handleContentExplorerClick = () => {\n if (this.shouldDeselectItems()) {\n this.deselectItems();\n }\n };\n\n deselectItems() {\n const { onSelectedItemsUpdate } = this.props;\n this.setState({\n selectedItems: {},\n });\n if (onSelectedItemsUpdate) {\n onSelectedItemsUpdate({});\n }\n }\n\n enterFolder = enteredFolder => {\n const { contentExplorerMode, onEnterFolder, onFoldersPathUpdate } = this.props;\n const { foldersPath } = this.state;\n\n const folderIndex = foldersPath.findIndex(folder => folder.id === enteredFolder.id);\n let newFoldersPath = foldersPath.slice();\n\n if (folderIndex === -1) {\n // Append folder to the path if it's not already in the folders path\n newFoldersPath = newFoldersPath.concat([\n {\n ...enteredFolder,\n },\n ]);\n } else {\n // Otherwise, remove all folders that came after the entered folder\n newFoldersPath = newFoldersPath.slice(0, folderIndex + 1);\n }\n\n const newState = { foldersPath: newFoldersPath };\n if (contentExplorerMode !== ContentExplorerModes.MULTI_SELECT) {\n newState.selectedItems = {};\n }\n\n this.setState(newState);\n if (onFoldersPathUpdate) {\n onFoldersPathUpdate(newFoldersPath);\n }\n\n onEnterFolder(enteredFolder, newFoldersPath);\n };\n\n handleFoldersPathUpdated = newFoldersPath => {\n const { onFoldersPathUpdate } = this.props;\n\n this.setState({\n foldersPath: newFoldersPath,\n });\n if (onFoldersPathUpdate) {\n onFoldersPathUpdate(newFoldersPath);\n }\n };\n\n handleSearchSubmit = searchQuery => {\n const { onSearchSubmit } = this.props;\n\n this.setState({ isInSearchMode: true });\n onSearchSubmit(searchQuery);\n };\n\n handleExitSearch = folderBeforeSearch => {\n const { onExitSearch } = this.props;\n\n this.setState({ isInSearchMode: false });\n onExitSearch(folderBeforeSearch);\n };\n\n handleItemClick = ({ event, index }) => {\n const { contentExplorerMode, items, onSelectItem, onSelectedItemsUpdate } = this.props;\n const { selectedItems } = this.state;\n const item = items[index];\n\n if (item.isDisabled || item.isLoading || item.isActionDisabled) {\n return;\n }\n\n // Prevent the event from bubbling up (so our content explorer click handler doesn't fire)\n event.stopPropagation();\n\n let newSelectedItems = {};\n if (contentExplorerMode === ContentExplorerModes.MULTI_SELECT) {\n newSelectedItems = this.toggleSelectedItem(selectedItems, item);\n } else {\n newSelectedItems[item.id] = item;\n }\n\n this.setState({ selectedItems: newSelectedItems, isSelectAllChecked: false });\n\n if (onSelectedItemsUpdate) {\n onSelectedItemsUpdate(newSelectedItems);\n }\n\n if (onSelectItem) {\n onSelectItem(item, index);\n }\n };\n\n handleItemDoubleClick = ({ index }) => {\n const { items, onChooseItems } = this.props;\n const item = items[index];\n\n if (item.isDisabled || item.isLoading) {\n return;\n }\n\n if (item.type === TYPE_FOLDER) {\n this.enterFolder(item);\n } else if (!item.isActionDisabled) {\n onChooseItems([item]);\n }\n this.setState({ isSelectAllChecked: false });\n };\n\n handleItemNameClick = (event, index) => {\n const { items } = this.props;\n const item = items[index];\n\n if (item.isDisabled || item.isLoading) {\n return;\n }\n\n if (item.type !== TYPE_FOLDER) {\n return;\n }\n\n // Prevent the event from bubbling (so our row click handler doesn't fire)\n event.preventDefault();\n event.stopPropagation();\n\n this.enterFolder(item);\n this.setState({ isSelectAllChecked: false });\n };\n\n toggleSelectedItem = (selectedItems, item) => {\n const result = { ...selectedItems };\n if (result[item.id]) {\n delete result[item.id];\n } else {\n result[item.id] = item;\n }\n\n return result;\n };\n\n selectAll = () => {\n const { items } = this.props;\n const { selectedItems } = this.state;\n const result = { ...selectedItems };\n items.forEach(item => {\n if (!result[item.id]) {\n result[item.id] = item;\n }\n });\n\n return result;\n };\n\n unselectAll = () => {\n const { items } = this.props;\n const { selectedItems } = this.state;\n const result = { ...selectedItems };\n items.forEach(item => {\n if (result[item.id]) {\n delete result[item.id];\n }\n });\n\n return result;\n };\n\n handleSelectAllClick = async () => {\n const { items, onSelectedItemsUpdate } = this.props;\n if (items && items[0] && items[0].isLoading) {\n return;\n }\n const { isSelectAllChecked } = this.state;\n const newSelectedItems = isSelectAllChecked ? this.unselectAll() : this.selectAll();\n this.setState({ selectedItems: newSelectedItems, isSelectAllChecked: !isSelectAllChecked });\n if (onSelectedItemsUpdate) {\n onSelectedItemsUpdate(newSelectedItems);\n }\n };\n\n renderItemListEmptyState = () => {\n const { foldersPath, isInSearchMode } = this.state;\n const isViewingSearchResults = isInSearchMode && foldersPath.length === 1;\n\n return <ContentExplorerEmptyState isSearch={isViewingSearchResults} />;\n };\n\n render() {\n const {\n actionButtonsProps,\n additionalColumns,\n isNoSelectionAllowed = false,\n breadcrumbProps,\n cancelButtonProps,\n chooseButtonProps,\n chooseButtonText,\n className,\n contentExplorerMode,\n customInput,\n hasFolderTreeBreadcrumbs,\n headerActionsAccessory,\n onChooseItems,\n onMoveItem,\n onCopyItem,\n onCancelButtonClick,\n onCreateNewFolderButtonClick,\n onSelectedClick,\n onViewSelectedClick,\n showCreateNewFolderButton,\n isChooseButtonLoading,\n isCopyButtonLoading,\n isCreateNewFolderAllowed,\n isMoveButtonLoading,\n isResponsive = false,\n isSelectAllAllowed,\n items,\n numItemsPerPage,\n numTotalItems,\n onLoadMoreItems,\n includeSubfoldersProps,\n itemIconRenderer,\n itemNameLinkRenderer,\n itemButtonRenderer,\n itemRowHeight,\n itemRowRenderer,\n listHeaderHeight,\n listHeaderRenderer,\n listWidth,\n listHeight,\n searchInputProps,\n ...rest\n } = this.props;\n const { isInSearchMode, foldersPath, selectedItems, isSelectAllChecked } = this.state;\n const isViewingSearchResults = isInSearchMode && foldersPath.length === 1;\n const currentFolder = this.getCurrentFolder();\n const contentExplorerProps = omit(rest, [\n 'initialFoldersPath',\n 'onEnterFolder',\n 'onSelectItem',\n 'onSearchSubmit',\n 'onExitSearch',\n 'initialSelectedItems',\n 'onFoldersPathUpdate',\n 'onSelectedItemsUpdate',\n ]);\n const canIncludeSubfolders = !!includeSubfoldersProps;\n const hasSubheader = canIncludeSubfolders || isSelectAllAllowed;\n\n const selectedItemsIds = Object.keys(selectedItems);\n let areActionButtonsDisabled;\n // NOTE: it almost feels like this whole section should be inside the\n // ContentExplorerActionButtons instead. There's a lot of implicit knowledge\n // of what the action buttons are and what they should be doing.\n if (contentExplorerMode === ContentExplorerModes.MULTI_SELECT) {\n // NOTE: only expecting to have 1 (choose) button so as long as something\n // is selected and that item's isActionDisabled is false, we enable the action button\n areActionButtonsDisabled =\n (selectedItemsIds.length === 0 && !isNoSelectionAllowed) ||\n (selectedItemsIds.length === 1 && selectedItems[selectedItemsIds[0]].isActionDisabled);\n } else if (isViewingSearchResults || contentExplorerMode === ContentExplorerModes.SELECT_FILE) {\n // Buttons are only enabled when an item is selected\n // When viewing search results, there is no \"current folder\"\n // When selecting a file, the file can only selected from the list\n areActionButtonsDisabled =\n selectedItemsIds.length === 0 || selectedItems[selectedItemsIds[0]].isActionDisabled;\n } else {\n // Buttons are enabled using the selected item or the current folder if no item is selected\n areActionButtonsDisabled =\n selectedItemsIds.length > 0\n ? selectedItems[selectedItemsIds[0]].isActionDisabled\n : currentFolder.isActionDisabled;\n }\n\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events\n <div\n className={classNames('content-explorer', className, {\n 'bdl-ContentExplorer--responsive': isResponsive,\n })}\n data-testid=\"content-explorer\"\n onClick={this.handleContentExplorerClick}\n ref={ref => {\n this.domNode = ref;\n }}\n {...contentExplorerProps}\n >\n <ContentExplorerHeaderActions\n breadcrumbProps={breadcrumbProps}\n contentExplorerMode={contentExplorerMode}\n customInput={customInput}\n foldersPath={foldersPath}\n hasFolderTreeBreadcrumbs={hasFolderTreeBreadcrumbs}\n isCreateNewFolderAllowed={isCreateNewFolderAllowed}\n onCreateNewFolderButtonClick={onCreateNewFolderButtonClick}\n onFoldersPathUpdated={this.handleFoldersPathUpdated}\n onEnterFolder={this.enterFolder}\n onExitSearch={this.handleExitSearch}\n onSearchSubmit={this.handleSearchSubmit}\n numTotalItems={numTotalItems}\n searchInputProps={searchInputProps}\n showCreateNewFolderButton={showCreateNewFolderButton}\n >\n {headerActionsAccessory}\n </ContentExplorerHeaderActions>\n {hasSubheader && (\n <div className=\"bdl-ContentExplorer-subheader\">\n {canIncludeSubfolders && <ContentExplorerIncludeSubfolders {...includeSubfoldersProps} />}\n {isSelectAllAllowed && (\n <ContentExplorerSelectAll\n handleSelectAllClick={this.handleSelectAllClick}\n isLabelHidden={canIncludeSubfolders}\n isSelectAllChecked={isSelectAllChecked}\n numTotalItems={numTotalItems}\n />\n )}\n </div>\n )}\n <ItemList\n additionalColumns={additionalColumns}\n contentExplorerMode={contentExplorerMode}\n headerHeight={listHeaderHeight}\n headerRenderer={listHeaderRenderer}\n height={listHeight}\n isResponsive={isResponsive}\n itemButtonRenderer={itemButtonRenderer}\n itemIconRenderer={itemIconRenderer}\n itemNameLinkRenderer={itemNameLinkRenderer}\n items={items}\n itemRowRenderer={itemRowRenderer}\n noItemsRenderer={this.renderItemListEmptyState}\n numItemsPerPage={numItemsPerPage}\n numTotalItems={numTotalItems}\n onItemClick={this.handleItemClick}\n onItemDoubleClick={this.handleItemDoubleClick}\n onItemNameClick={this.handleItemNameClick}\n onLoadMoreItems={onLoadMoreItems}\n rowHeight={itemRowHeight}\n selectedItems={selectedItems}\n width={listWidth}\n />\n <ContentExplorerActionButtons\n actionButtonsProps={actionButtonsProps}\n areButtonsDisabled={areActionButtonsDisabled}\n cancelButtonProps={cancelButtonProps}\n canIncludeSubfolders={canIncludeSubfolders}\n chooseButtonProps={chooseButtonProps}\n chooseButtonText={chooseButtonText}\n contentExplorerMode={contentExplorerMode}\n currentFolder={currentFolder}\n isChooseButtonLoading={isChooseButtonLoading}\n isCopyButtonLoading={isCopyButtonLoading}\n isMoveButtonLoading={isMoveButtonLoading}\n isResponsive={isResponsive}\n isSelectAllAllowed={isSelectAllAllowed}\n onCancelClick={onCancelButtonClick}\n onChooseClick={onChooseItems}\n onCopyClick={onCopyItem}\n onFoldersPathUpdated={this.handleFoldersPathUpdated}\n onSelectedClick={onSelectedClick}\n onMoveClick={onMoveItem}\n onViewSelectedClick={onViewSelectedClick}\n selectedItems={selectedItems}\n isNoSelectionAllowed={isNoSelectionAllowed}\n />\n </div>\n );\n }\n}\n\nexport default ContentExplorer;\n"],"file":"ContentExplorer.js"}
1
+ {"version":3,"sources":["../../../../src/features/content-explorer/content-explorer/ContentExplorer.js"],"names":["PropTypes","React","Component","classNames","omit","ContentExplorerHeaderActions","ContentExplorerEmptyState","ContentExplorerActionButtons","ContentExplorerSelectAll","ContentExplorerIncludeSubfolders","ItemList","ContentExplorerModePropType","FoldersPathPropType","ItemsPropType","ContentExplorerModes","TYPE_FOLDER","ContentExplorer","props","items","selectedItems","state","every","item","id","isLoading","node","className","limit","nodeOfInterest","counter","parentNode","includes","contentExplorerMode","MULTI_SELECT","event","isInside","domNode","contains","target","shouldDeselectItems","deselectItems","enteredFolder","onEnterFolder","onFoldersPathUpdate","foldersPath","folderIndex","findIndex","folder","newFoldersPath","slice","concat","newState","setState","searchQuery","onSearchSubmit","isInSearchMode","folderBeforeSearch","onExitSearch","index","onSelectItem","onSelectedItemsUpdate","isDisabled","isActionDisabled","stopPropagation","newSelectedItems","toggleSelectedItem","onChooseItems","type","enterFolder","preventDefault","result","forEach","isLoadingItems","isSelectAllChecked","unselectAll","selectAll","isViewingSearchResults","length","initialSelectedItems","initialFoldersPath","document","addEventListener","handleDocumentClick","prevInitialFoldersPath","isSelectAllAllowed","handleFoldersPathUpdated","areAllItemsSelected","removeEventListener","actionButtonsProps","additionalColumns","isNoSelectionAllowed","breadcrumbProps","cancelButtonProps","chooseButtonProps","chooseButtonText","customInput","hasFolderTreeBreadcrumbs","headerActionsAccessory","onMoveItem","onCopyItem","onCancelButtonClick","onCreateNewFolderButtonClick","onSelectedClick","onViewSelectedClick","showCreateNewFolderButton","isChooseButtonLoading","isCopyButtonLoading","isCreateNewFolderAllowed","isMoveButtonLoading","isResponsive","numItemsPerPage","numTotalItems","onLoadMoreItems","includeSubfoldersProps","itemIconRenderer","itemNameLinkRenderer","itemButtonRenderer","itemRowHeight","itemRowRenderer","listHeaderHeight","listHeaderRenderer","listWidth","listHeight","searchInputProps","rest","currentFolder","getCurrentFolder","contentExplorerProps","canIncludeSubfolders","hasSubheader","selectedItemsIds","Object","keys","areActionButtonsDisabled","SELECT_FILE","handleContentExplorerClick","ref","handleExitSearch","handleSearchSubmit","handleSelectAllClick","renderItemListEmptyState","handleItemClick","handleItemDoubleClick","handleItemNameClick","object","arrayOf","element","bool","string","isRequired","func","number"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,IAAP,MAAiB,aAAjB;AAEA,OAAOC,4BAAP,MAAyC,gCAAzC;AACA,OAAOC,yBAAP,MAAsC,6BAAtC;AACA,OAAOC,4BAAP,MAAyC,gCAAzC;AACA,OAAOC,wBAAP,MAAqC,4BAArC;AACA,OAAOC,gCAAP,MAA6C,oCAA7C;AAEA,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AAwHf;AACAnC,EAAAA,oBAAoB,EAAEnH,SAAS,CAACsJ,IAzHjB;;AA0Hf;AACAlC,EAAAA,kBAAkB,EAAEpH,SAAS,CAACsJ,IA3Hf;;AA4Hf;AACAjC,EAAAA,aAAa,EAAErH,SAAS,CAACuJ,MA7HV;;AA8Hf;AACAjC,EAAAA,eAAe,EAAEtH,SAAS,CAACsJ,IA/HZ;;AAgIf;AACA/B,EAAAA,gBAAgB,EAAEvH,SAAS,CAACuJ,MAjIb;;AAkIf;AACA/B,EAAAA,kBAAkB,EAAExH,SAAS,CAACsJ,IAnIf;;AAoIf;AACA7B,EAAAA,SAAS,EAAEzH,SAAS,CAACuJ,MAAV,CAAiBF,UArIb;;AAsIf;AACA3B,EAAAA,UAAU,EAAE1H,SAAS,CAACuJ,MAAV,CAAiBF,UAvId;;AAwIf;AACA1B,EAAAA,gBAAgB,EAAE3H,SAAS,CAACgJ;AAzIb,C;;gBADjBhI,e,kBA6IoB;AAClBwE,EAAAA,kBAAkB,EAAE,EADF;AAElBI,EAAAA,iBAAiB,EAAE,EAFD;AAGlBC,EAAAA,iBAAiB,EAAE,EAHD;AAIlBnE,EAAAA,SAAS,EAAE,EAJO;AAKlBiG,EAAAA,gBAAgB,EAAE;AALA,C;;AAyd1B,eAAe3G,eAAf","sourcesContent":["import PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport classNames from 'classnames';\nimport omit from 'lodash/omit';\n\nimport ContentExplorerHeaderActions from './ContentExplorerHeaderActions';\nimport ContentExplorerEmptyState from './ContentExplorerEmptyState';\nimport ContentExplorerActionButtons from './ContentExplorerActionButtons';\nimport ContentExplorerSelectAll from './ContentExplorerSelectAll';\nimport ContentExplorerIncludeSubfolders from './ContentExplorerIncludeSubfolders';\n\nimport ItemList from '../item-list';\nimport { ContentExplorerModePropType, FoldersPathPropType, ItemsPropType } from '../prop-types';\nimport ContentExplorerModes from '../modes';\n\nimport { TYPE_FOLDER } from '../../../constants';\n\nimport './ContentExplorer.scss';\n\nclass ContentExplorer extends Component {\n static propTypes = {\n /** Props for the action buttons container */\n actionButtonsProps: PropTypes.object,\n /**\n * Extra columns displayed in the folders table after folder name column\n * Each column has to be a Column element\n */\n additionalColumns: PropTypes.arrayOf(PropTypes.element),\n /** Allow users to choose no selections in MULTI_SELECT mode, defaults to false */\n isNoSelectionAllowed: PropTypes.bool,\n /** Props for breadcrumbs */\n breadcrumbProps: PropTypes.object,\n /** Props for the cancel button */\n cancelButtonProps: PropTypes.object,\n /** Props for the choose button */\n chooseButtonProps: PropTypes.object,\n /** Custom text for the choose button */\n chooseButtonText: PropTypes.node,\n /** Adds class name. */\n className: PropTypes.string,\n /** Configures the content explorer based on the user's intended action (ex. select file or move/copy) */\n contentExplorerMode: ContentExplorerModePropType.isRequired,\n /** Props that contains the custom search input. Is rendered in header actions */\n customInput: PropTypes.func,\n /** Whether the user can see the breadcrumbs represented with the folder tree button */\n hasFolderTreeBreadcrumbs: PropTypes.bool,\n /** Any extra items in the header to the right of the search input (and new folder button) */\n headerActionsAccessory: PropTypes.node,\n /** Props for the include subfolders toggle */\n includeSubfoldersProps: PropTypes.object,\n /** Initial path of folders. The last folder in the array is the current folder. */\n initialFoldersPath: FoldersPathPropType.isRequired,\n /** Initial items that will show up as selected */\n initialSelectedItems: PropTypes.object,\n /** Whether to use the responsive version */\n isResponsive: PropTypes.bool,\n /**\n * Called when the current folder changes\n *\n * @param {Object} enteredFolder\n * @param {Array} newFoldersPath\n */\n onEnterFolder: PropTypes.func.isRequired,\n /** Called when the folders path is updated\n *\n * @param {Array} newFoldersPath\n */\n onFoldersPathUpdate: PropTypes.func,\n /** Called whenever the selected items list changes\n *\n * @param {Object} selectedItems\n */\n onSelectedItemsUpdate: PropTypes.func,\n /**\n * Called when an item is selected\n *\n * @param {Object} selectedItem\n * @param {number} selectedItemIndex\n */\n onSelectItem: PropTypes.func,\n /**\n * Called when an item is chosen\n *\n * @param {Object[]} chosenItems\n */\n onChooseItems: PropTypes.func,\n /** Called when selected button is clicked */\n onSelectedClick: PropTypes.func,\n /** Called when the number of items selected text is clicked */\n onViewSelectedClick: PropTypes.func,\n /**\n * Called when a destination folder has been selected for moving an item to\n *\n * @param {Object} destFolder destination folder\n */\n onMoveItem: PropTypes.func,\n /**\n * Called when a destination folder has been selected for copying an item to\n *\n * @param {Object} destFolder destination folder\n */\n onCopyItem: PropTypes.func,\n /** Called when cancel button is clicked */\n onCancelButtonClick: PropTypes.func,\n /** Called when new folder button is clicked */\n onCreateNewFolderButtonClick: PropTypes.func,\n /** Whether the new folder button should be shown */\n showCreateNewFolderButton: PropTypes.bool,\n /** Whether the choose button should be shown with a loading indicator */\n isChooseButtonLoading: PropTypes.bool,\n /** Whether the copy button should be shown with a loading indicator */\n isCopyButtonLoading: PropTypes.bool,\n /** Whether the user has permission to create a new folder */\n isCreateNewFolderAllowed: PropTypes.bool,\n /** Whether the user can see select all checkbox */\n isSelectAllAllowed: PropTypes.bool,\n /** Whether the move button should be shown with a loading indicator */\n isMoveButtonLoading: PropTypes.bool,\n /**\n * Called when a search query is submitted.\n *\n * @param {string} searchQuery\n */\n onSearchSubmit: PropTypes.func.isRequired,\n /**\n * Called when search mode is exited. An updated items list should now be passed in to display the user's file tree.\n *\n * @param {Object} folderBeforeSearch the previous folder object before entering search mode\n */\n onExitSearch: PropTypes.func.isRequired,\n /** List of items to display */\n items: ItemsPropType.isRequired,\n /** Number of items to load per page as the user scrolls */\n numItemsPerPage: PropTypes.number,\n /** Total number of items across all pages */\n numTotalItems: PropTypes.number,\n /** Called to load more items */\n onLoadMoreItems: PropTypes.func,\n /** Used to render item icons in the list. Overrides the default icons. */\n itemIconRenderer: PropTypes.func,\n /** Used to render item name links in the list. Overrides the default links. */\n itemNameLinkRenderer: PropTypes.func,\n /** Used to render item buttons in the list. Overrides the default buttons. */\n itemButtonRenderer: PropTypes.func,\n /** Height of an item row */\n itemRowHeight: PropTypes.number,\n /** Used to render the row element for items on the list. Allows row customizations such as adding tooltips, etc. */\n itemRowRenderer: PropTypes.func,\n /** Height of the item list header, defaults to 0, which makes header not visible */\n listHeaderHeight: PropTypes.number,\n /** Used to render the header row on the item list */\n listHeaderRenderer: PropTypes.func,\n /** Width of the item list */\n listWidth: PropTypes.number.isRequired,\n /** Height of the item list */\n listHeight: PropTypes.number.isRequired,\n /** Props for the search input */\n searchInputProps: PropTypes.object,\n };\n\n static defaultProps = {\n actionButtonsProps: {},\n cancelButtonProps: {},\n chooseButtonProps: {},\n className: '',\n searchInputProps: {},\n };\n\n constructor(props) {\n super(props);\n this.state = {\n selectedItems: props.initialSelectedItems || {},\n foldersPath: props.initialFoldersPath,\n isInSearchMode: false,\n isSelectAllChecked: false,\n };\n }\n\n componentDidMount() {\n document.addEventListener('click', this.handleDocumentClick, true);\n }\n\n componentDidUpdate({ initialFoldersPath: prevInitialFoldersPath }) {\n const { initialFoldersPath, isSelectAllAllowed } = this.props;\n const { isSelectAllChecked } = this.state;\n\n if (prevInitialFoldersPath !== initialFoldersPath) {\n this.handleFoldersPathUpdated(initialFoldersPath);\n }\n if (!this.isLoadingItems() && isSelectAllAllowed) {\n const areAllItemsSelected = this.areAllItemsSelected();\n if (areAllItemsSelected !== isSelectAllChecked) {\n this.setState({ isSelectAllChecked: areAllItemsSelected });\n }\n }\n }\n\n componentWillUnmount() {\n document.removeEventListener('click', this.handleDocumentClick, true);\n }\n\n areAllItemsSelected = () => {\n const { items } = this.props;\n const { selectedItems } = this.state;\n\n return items.every(item => selectedItems[item.id]);\n };\n\n isLoadingItems = () => {\n return this.props?.items?.[0]?.isLoading;\n };\n\n getCurrentFolder() {\n const { foldersPath } = this.state;\n return foldersPath[foldersPath.length - 1];\n }\n\n /**\n * Traverse the hirerachy up to the limit to see if any of the parent has the className\n */\n doAncestersContainClassname = (node, className, limit) => {\n let nodeOfInterest = node;\n let counter = 0;\n while (nodeOfInterest.parentNode && counter < limit) {\n // Done traversing (Document node does not have classnames)\n if (!nodeOfInterest.parentNode.className) {\n break;\n }\n\n if (nodeOfInterest.parentNode.className.includes(className)) {\n return true;\n }\n\n nodeOfInterest = nodeOfInterest.parentNode;\n counter += 1;\n }\n\n return false;\n };\n\n shouldDeselectItems = () => {\n const { contentExplorerMode } = this.props;\n\n return (\n // always deselect when not in multi select mode\n contentExplorerMode !== ContentExplorerModes.MULTI_SELECT\n );\n };\n\n handleDocumentClick = event => {\n const isInside = (this.domNode && this.domNode.contains(event.target)) || this.domNode === event.target;\n\n if (!isInside && this.shouldDeselectItems()) {\n this.deselectItems();\n }\n };\n\n handleContentExplorerClick = () => {\n if (this.shouldDeselectItems()) {\n this.deselectItems();\n }\n };\n\n deselectItems() {\n const { onSelectedItemsUpdate } = this.props;\n this.setState({\n selectedItems: {},\n });\n if (onSelectedItemsUpdate) {\n onSelectedItemsUpdate({});\n }\n }\n\n enterFolder = enteredFolder => {\n const { contentExplorerMode, onEnterFolder, onFoldersPathUpdate } = this.props;\n const { foldersPath } = this.state;\n\n const folderIndex = foldersPath.findIndex(folder => folder.id === enteredFolder.id);\n let newFoldersPath = foldersPath.slice();\n\n if (folderIndex === -1) {\n // Append folder to the path if it's not already in the folders path\n newFoldersPath = newFoldersPath.concat([\n {\n ...enteredFolder,\n },\n ]);\n } else {\n // Otherwise, remove all folders that came after the entered folder\n newFoldersPath = newFoldersPath.slice(0, folderIndex + 1);\n }\n\n const newState = { foldersPath: newFoldersPath };\n if (contentExplorerMode !== ContentExplorerModes.MULTI_SELECT) {\n newState.selectedItems = {};\n }\n\n this.setState(newState);\n if (onFoldersPathUpdate) {\n onFoldersPathUpdate(newFoldersPath);\n }\n\n onEnterFolder(enteredFolder, newFoldersPath);\n };\n\n handleFoldersPathUpdated = newFoldersPath => {\n const { onFoldersPathUpdate } = this.props;\n\n this.setState({\n foldersPath: newFoldersPath,\n });\n if (onFoldersPathUpdate) {\n onFoldersPathUpdate(newFoldersPath);\n }\n };\n\n handleSearchSubmit = searchQuery => {\n const { onSearchSubmit } = this.props;\n\n this.setState({ isInSearchMode: true });\n onSearchSubmit(searchQuery);\n };\n\n handleExitSearch = folderBeforeSearch => {\n const { onExitSearch } = this.props;\n\n this.setState({ isInSearchMode: false });\n onExitSearch(folderBeforeSearch);\n };\n\n handleItemClick = ({ event, index }) => {\n const { contentExplorerMode, items, onSelectItem, onSelectedItemsUpdate } = this.props;\n const { selectedItems } = this.state;\n const item = items[index];\n\n if (item.isDisabled || item.isLoading || item.isActionDisabled) {\n return;\n }\n\n // Prevent the event from bubbling up (so our content explorer click handler doesn't fire)\n event.stopPropagation();\n\n let newSelectedItems = {};\n if (contentExplorerMode === ContentExplorerModes.MULTI_SELECT) {\n newSelectedItems = this.toggleSelectedItem(selectedItems, item);\n } else {\n newSelectedItems[item.id] = item;\n }\n\n this.setState({ selectedItems: newSelectedItems });\n\n if (onSelectedItemsUpdate) {\n onSelectedItemsUpdate(newSelectedItems);\n }\n\n if (onSelectItem) {\n onSelectItem(item, index);\n }\n };\n\n handleItemDoubleClick = ({ index }) => {\n const { items, onChooseItems } = this.props;\n const item = items[index];\n\n if (item.isDisabled || item.isLoading) {\n return;\n }\n\n if (item.type === TYPE_FOLDER) {\n this.enterFolder(item);\n } else if (!item.isActionDisabled) {\n onChooseItems([item]);\n }\n };\n\n handleItemNameClick = (event, index) => {\n const { items } = this.props;\n const item = items[index];\n\n if (item.isDisabled || item.isLoading) {\n return;\n }\n\n if (item.type !== TYPE_FOLDER) {\n return;\n }\n\n // Prevent the event from bubbling (so our row click handler doesn't fire)\n event.preventDefault();\n event.stopPropagation();\n\n this.enterFolder(item);\n };\n\n toggleSelectedItem = (selectedItems, item) => {\n const result = { ...selectedItems };\n if (result[item.id]) {\n delete result[item.id];\n } else {\n result[item.id] = item;\n }\n\n return result;\n };\n\n selectAll = () => {\n const { items } = this.props;\n const { selectedItems } = this.state;\n const result = { ...selectedItems };\n items.forEach(item => {\n if (!result[item.id]) {\n result[item.id] = item;\n }\n });\n\n return result;\n };\n\n unselectAll = () => {\n const { items } = this.props;\n const { selectedItems } = this.state;\n const result = { ...selectedItems };\n items.forEach(item => {\n if (result[item.id]) {\n delete result[item.id];\n }\n });\n\n return result;\n };\n\n handleSelectAllClick = async () => {\n const { onSelectedItemsUpdate } = this.props;\n if (this.isLoadingItems()) {\n return;\n }\n const { isSelectAllChecked } = this.state;\n const newSelectedItems = isSelectAllChecked ? this.unselectAll() : this.selectAll();\n this.setState({ selectedItems: newSelectedItems, isSelectAllChecked: !isSelectAllChecked });\n if (onSelectedItemsUpdate) {\n onSelectedItemsUpdate(newSelectedItems);\n }\n };\n\n renderItemListEmptyState = () => {\n const { foldersPath, isInSearchMode } = this.state;\n const isViewingSearchResults = isInSearchMode && foldersPath.length === 1;\n\n return <ContentExplorerEmptyState isSearch={isViewingSearchResults} />;\n };\n\n render() {\n const {\n actionButtonsProps,\n additionalColumns,\n isNoSelectionAllowed = false,\n breadcrumbProps,\n cancelButtonProps,\n chooseButtonProps,\n chooseButtonText,\n className,\n contentExplorerMode,\n customInput,\n hasFolderTreeBreadcrumbs,\n headerActionsAccessory,\n onChooseItems,\n onMoveItem,\n onCopyItem,\n onCancelButtonClick,\n onCreateNewFolderButtonClick,\n onSelectedClick,\n onViewSelectedClick,\n showCreateNewFolderButton,\n isChooseButtonLoading,\n isCopyButtonLoading,\n isCreateNewFolderAllowed,\n isMoveButtonLoading,\n isResponsive = false,\n isSelectAllAllowed,\n items,\n numItemsPerPage,\n numTotalItems,\n onLoadMoreItems,\n includeSubfoldersProps,\n itemIconRenderer,\n itemNameLinkRenderer,\n itemButtonRenderer,\n itemRowHeight,\n itemRowRenderer,\n listHeaderHeight,\n listHeaderRenderer,\n listWidth,\n listHeight,\n searchInputProps,\n ...rest\n } = this.props;\n const { isInSearchMode, foldersPath, selectedItems, isSelectAllChecked } = this.state;\n const isViewingSearchResults = isInSearchMode && foldersPath.length === 1;\n const currentFolder = this.getCurrentFolder();\n const contentExplorerProps = omit(rest, [\n 'initialFoldersPath',\n 'onEnterFolder',\n 'onSelectItem',\n 'onSearchSubmit',\n 'onExitSearch',\n 'initialSelectedItems',\n 'onFoldersPathUpdate',\n 'onSelectedItemsUpdate',\n ]);\n const canIncludeSubfolders = !!includeSubfoldersProps;\n const hasSubheader = canIncludeSubfolders || isSelectAllAllowed;\n\n const selectedItemsIds = Object.keys(selectedItems);\n let areActionButtonsDisabled;\n // NOTE: it almost feels like this whole section should be inside the\n // ContentExplorerActionButtons instead. There's a lot of implicit knowledge\n // of what the action buttons are and what they should be doing.\n if (contentExplorerMode === ContentExplorerModes.MULTI_SELECT) {\n // NOTE: only expecting to have 1 (choose) button so as long as something\n // is selected and that item's isActionDisabled is false, we enable the action button\n areActionButtonsDisabled =\n (selectedItemsIds.length === 0 && !isNoSelectionAllowed) ||\n (selectedItemsIds.length === 1 && selectedItems[selectedItemsIds[0]].isActionDisabled);\n } else if (isViewingSearchResults || contentExplorerMode === ContentExplorerModes.SELECT_FILE) {\n // Buttons are only enabled when an item is selected\n // When viewing search results, there is no \"current folder\"\n // When selecting a file, the file can only selected from the list\n areActionButtonsDisabled =\n selectedItemsIds.length === 0 || selectedItems[selectedItemsIds[0]].isActionDisabled;\n } else {\n // Buttons are enabled using the selected item or the current folder if no item is selected\n areActionButtonsDisabled =\n selectedItemsIds.length > 0\n ? selectedItems[selectedItemsIds[0]].isActionDisabled\n : currentFolder.isActionDisabled;\n }\n\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events\n <div\n className={classNames('content-explorer', className, {\n 'bdl-ContentExplorer--responsive': isResponsive,\n })}\n data-testid=\"content-explorer\"\n onClick={this.handleContentExplorerClick}\n ref={ref => {\n this.domNode = ref;\n }}\n {...contentExplorerProps}\n >\n <ContentExplorerHeaderActions\n breadcrumbProps={breadcrumbProps}\n contentExplorerMode={contentExplorerMode}\n customInput={customInput}\n foldersPath={foldersPath}\n hasFolderTreeBreadcrumbs={hasFolderTreeBreadcrumbs}\n isCreateNewFolderAllowed={isCreateNewFolderAllowed}\n onCreateNewFolderButtonClick={onCreateNewFolderButtonClick}\n onFoldersPathUpdated={this.handleFoldersPathUpdated}\n onEnterFolder={this.enterFolder}\n onExitSearch={this.handleExitSearch}\n onSearchSubmit={this.handleSearchSubmit}\n numTotalItems={numTotalItems}\n searchInputProps={searchInputProps}\n showCreateNewFolderButton={showCreateNewFolderButton}\n >\n {headerActionsAccessory}\n </ContentExplorerHeaderActions>\n {hasSubheader && (\n <div className=\"bdl-ContentExplorer-subheader\">\n {canIncludeSubfolders && <ContentExplorerIncludeSubfolders {...includeSubfoldersProps} />}\n {isSelectAllAllowed && (\n <ContentExplorerSelectAll\n handleSelectAllClick={this.handleSelectAllClick}\n isLabelHidden={canIncludeSubfolders}\n isSelectAllChecked={isSelectAllChecked}\n numTotalItems={numTotalItems}\n />\n )}\n </div>\n )}\n <ItemList\n additionalColumns={additionalColumns}\n contentExplorerMode={contentExplorerMode}\n headerHeight={listHeaderHeight}\n headerRenderer={listHeaderRenderer}\n height={listHeight}\n isResponsive={isResponsive}\n itemButtonRenderer={itemButtonRenderer}\n itemIconRenderer={itemIconRenderer}\n itemNameLinkRenderer={itemNameLinkRenderer}\n items={items}\n itemRowRenderer={itemRowRenderer}\n noItemsRenderer={this.renderItemListEmptyState}\n numItemsPerPage={numItemsPerPage}\n numTotalItems={numTotalItems}\n onItemClick={this.handleItemClick}\n onItemDoubleClick={this.handleItemDoubleClick}\n onItemNameClick={this.handleItemNameClick}\n onLoadMoreItems={onLoadMoreItems}\n rowHeight={itemRowHeight}\n selectedItems={selectedItems}\n width={listWidth}\n />\n <ContentExplorerActionButtons\n actionButtonsProps={actionButtonsProps}\n areButtonsDisabled={areActionButtonsDisabled}\n cancelButtonProps={cancelButtonProps}\n canIncludeSubfolders={canIncludeSubfolders}\n chooseButtonProps={chooseButtonProps}\n chooseButtonText={chooseButtonText}\n contentExplorerMode={contentExplorerMode}\n currentFolder={currentFolder}\n isChooseButtonLoading={isChooseButtonLoading}\n isCopyButtonLoading={isCopyButtonLoading}\n isMoveButtonLoading={isMoveButtonLoading}\n isResponsive={isResponsive}\n isSelectAllAllowed={isSelectAllAllowed}\n onCancelClick={onCancelButtonClick}\n onChooseClick={onChooseItems}\n onCopyClick={onCopyItem}\n onFoldersPathUpdated={this.handleFoldersPathUpdated}\n onSelectedClick={onSelectedClick}\n onMoveClick={onMoveItem}\n onViewSelectedClick={onViewSelectedClick}\n selectedItems={selectedItems}\n isNoSelectionAllowed={isNoSelectionAllowed}\n />\n </div>\n );\n }\n}\n\nexport default ContentExplorer;\n"],"file":"ContentExplorer.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "box-ui-elements",
3
- "version": "17.1.0-beta.4",
3
+ "version": "17.1.0-beta.5",
4
4
  "description": "Box UI Elements",
5
5
  "author": "Box (https://www.box.com/)",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -181,17 +181,35 @@ class ContentExplorer extends Component {
181
181
  }
182
182
 
183
183
  componentDidUpdate({ initialFoldersPath: prevInitialFoldersPath }) {
184
- const { initialFoldersPath } = this.props;
184
+ const { initialFoldersPath, isSelectAllAllowed } = this.props;
185
+ const { isSelectAllChecked } = this.state;
185
186
 
186
187
  if (prevInitialFoldersPath !== initialFoldersPath) {
187
188
  this.handleFoldersPathUpdated(initialFoldersPath);
188
189
  }
190
+ if (!this.isLoadingItems() && isSelectAllAllowed) {
191
+ const areAllItemsSelected = this.areAllItemsSelected();
192
+ if (areAllItemsSelected !== isSelectAllChecked) {
193
+ this.setState({ isSelectAllChecked: areAllItemsSelected });
194
+ }
195
+ }
189
196
  }
190
197
 
191
198
  componentWillUnmount() {
192
199
  document.removeEventListener('click', this.handleDocumentClick, true);
193
200
  }
194
201
 
202
+ areAllItemsSelected = () => {
203
+ const { items } = this.props;
204
+ const { selectedItems } = this.state;
205
+
206
+ return items.every(item => selectedItems[item.id]);
207
+ };
208
+
209
+ isLoadingItems = () => {
210
+ return this.props?.items?.[0]?.isLoading;
211
+ };
212
+
195
213
  getCurrentFolder() {
196
214
  const { foldersPath } = this.state;
197
215
  return foldersPath[foldersPath.length - 1];
@@ -329,7 +347,7 @@ class ContentExplorer extends Component {
329
347
  newSelectedItems[item.id] = item;
330
348
  }
331
349
 
332
- this.setState({ selectedItems: newSelectedItems, isSelectAllChecked: false });
350
+ this.setState({ selectedItems: newSelectedItems });
333
351
 
334
352
  if (onSelectedItemsUpdate) {
335
353
  onSelectedItemsUpdate(newSelectedItems);
@@ -353,7 +371,6 @@ class ContentExplorer extends Component {
353
371
  } else if (!item.isActionDisabled) {
354
372
  onChooseItems([item]);
355
373
  }
356
- this.setState({ isSelectAllChecked: false });
357
374
  };
358
375
 
359
376
  handleItemNameClick = (event, index) => {
@@ -373,7 +390,6 @@ class ContentExplorer extends Component {
373
390
  event.stopPropagation();
374
391
 
375
392
  this.enterFolder(item);
376
- this.setState({ isSelectAllChecked: false });
377
393
  };
378
394
 
379
395
  toggleSelectedItem = (selectedItems, item) => {
@@ -414,8 +430,8 @@ class ContentExplorer extends Component {
414
430
  };
415
431
 
416
432
  handleSelectAllClick = async () => {
417
- const { items, onSelectedItemsUpdate } = this.props;
418
- if (items && items[0] && items[0].isLoading) {
433
+ const { onSelectedItemsUpdate } = this.props;
434
+ if (this.isLoadingItems()) {
419
435
  return;
420
436
  }
421
437
  const { isSelectAllChecked } = this.state;
@@ -453,6 +453,72 @@ describe('features/content-explorer/content-explorer/ContentExplorer', () => {
453
453
 
454
454
  expect(onSelectItemSpy.notCalled).toBe(true);
455
455
  });
456
+
457
+ test('should set isSelectAllChecked to true if all displayed items are selected and isSelectAllAllowed is true', () => {
458
+ const clickedItemIndex = 0;
459
+ const clickedItemIndex2 = 1;
460
+ const clickedItemIndex3 = 2;
461
+ const items = [
462
+ { id: '1', name: 'item1' },
463
+ { id: '2', name: 'item2' },
464
+ { id: '3', name: 'item3' },
465
+ ];
466
+ const wrapper = renderComponent(
467
+ {
468
+ items,
469
+ isSelectAllAllowed: true,
470
+ onSelectItem: onSelectItemSpy,
471
+ contentExplorerMode: ContentExplorerModes.MULTI_SELECT,
472
+ },
473
+ true,
474
+ );
475
+
476
+ wrapper
477
+ .find('.table-row')
478
+ .at(clickedItemIndex)
479
+ .simulate('click');
480
+
481
+ wrapper
482
+ .find('.table-row')
483
+ .at(clickedItemIndex2)
484
+ .simulate('click');
485
+
486
+ wrapper
487
+ .find('.table-row')
488
+ .at(clickedItemIndex3)
489
+ .simulate('click');
490
+
491
+ expect(Object.keys(wrapper.state('selectedItems')).length).toBe(3);
492
+ expect(wrapper.state('isSelectAllChecked')).toBe(true);
493
+ });
494
+
495
+ test('should set isSelectAllChecked to false if an item is unchecked while isSelectAllChecked is true', () => {
496
+ const clickedItemIndex = 0;
497
+ const clickedItemIndex2 = 1;
498
+ const items = [
499
+ { id: '1', name: 'item1' },
500
+ { id: '2', name: 'item2' },
501
+ ];
502
+ const selectedItems = { '1': items[clickedItemIndex], '2': items[clickedItemIndex2] };
503
+ const wrapper = renderComponent(
504
+ {
505
+ items,
506
+ isSelectAllAllowed: true,
507
+ onSelectItem: onSelectItemSpy,
508
+ contentExplorerMode: ContentExplorerModes.MULTI_SELECT,
509
+ },
510
+ true,
511
+ );
512
+ wrapper.setState({ selectedItems, isSelectAllChecked: true });
513
+
514
+ wrapper
515
+ .find('.table-row')
516
+ .at(clickedItemIndex)
517
+ .simulate('click');
518
+
519
+ expect(Object.keys(wrapper.state('selectedItems')).length).toBe(1);
520
+ expect(wrapper.state('isSelectAllChecked')).toBe(false);
521
+ });
456
522
  });
457
523
 
458
524
  describe('onChooseItems', () => {