@openedx/paragon 22.0.0-alpha.15 → 22.0.0-alpha.16

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.
@@ -1,7 +1,3 @@
1
- const _excluded = ["row"];
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
1
  import React from 'react';
6
2
  import PropTypes from 'prop-types';
7
3
  import { ExpandLess, ExpandMore } from '../../icons';
@@ -10,10 +6,9 @@ import IconButton from '../IconButton';
10
6
  const EXPAND_COLLAPSE_ICON_SIZE = 'inline';
11
7
  function ExpandRow(_ref) {
12
8
  let {
13
- row
14
- } = _ref,
15
- rest = _objectWithoutProperties(_ref, _excluded);
16
- return /*#__PURE__*/React.createElement("span", _extends({}, row.getToggleRowExpandedProps(), rest), row.isExpanded ? /*#__PURE__*/React.createElement(IconButton, {
9
+ row
10
+ } = _ref;
11
+ return /*#__PURE__*/React.createElement("span", row.getToggleRowExpandedProps(), row.isExpanded ? /*#__PURE__*/React.createElement(IconButton, {
17
12
  src: ExpandLess,
18
13
  iconAs: Icon,
19
14
  alt: "Collapse row",
@@ -1 +1 @@
1
- {"version":3,"file":"ExpandRow.js","names":["React","PropTypes","ExpandLess","ExpandMore","Icon","IconButton","EXPAND_COLLAPSE_ICON_SIZE","ExpandRow","_ref","row","rest","_objectWithoutProperties","_excluded","createElement","_extends","getToggleRowExpandedProps","isExpanded","src","iconAs","alt","size","propTypes","shape","bool","func","isRequired"],"sources":["../../src/DataTable/ExpandRow.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { ExpandLess, ExpandMore } from '../../icons';\nimport Icon from '../Icon';\nimport IconButton from '../IconButton';\n\nconst EXPAND_COLLAPSE_ICON_SIZE = 'inline';\n\nfunction ExpandRow({ row, ...rest }) {\n return (\n <span {...row.getToggleRowExpandedProps()} {...rest}>\n {row.isExpanded\n ? <IconButton src={ExpandLess} iconAs={Icon} alt=\"Collapse row\" size={EXPAND_COLLAPSE_ICON_SIZE} />\n : <IconButton src={ExpandMore} iconAs={Icon} alt=\"Expand row\" size={EXPAND_COLLAPSE_ICON_SIZE} />}\n </span>\n );\n}\n\nExpandRow.propTypes = {\n /** Row data that is received from `react-table` API. */\n row: PropTypes.shape({\n /** Specifies if row is in expanded state. */\n isExpanded: PropTypes.bool,\n /** Function that returns props for the wrapper component to handle expand behaviour. */\n getToggleRowExpandedProps: PropTypes.func.isRequired,\n }).isRequired,\n};\n\nexport default ExpandRow;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,UAAU,EAAEC,UAAU,QAAQ,aAAa;AACpD,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,UAAU,MAAM,eAAe;AAEtC,MAAMC,yBAAyB,GAAG,QAAQ;AAE1C,SAASC,SAASA,CAAAC,IAAA,EAAmB;EAAA,IAAlB;MAAEC;IAAa,CAAC,GAAAD,IAAA;IAANE,IAAI,GAAAC,wBAAA,CAAAH,IAAA,EAAAI,SAAA;EAC/B,oBACEZ,KAAA,CAAAa,aAAA,SAAAC,QAAA,KAAUL,GAAG,CAACM,yBAAyB,CAAC,CAAC,EAAML,IAAI,GAChDD,GAAG,CAACO,UAAU,gBACXhB,KAAA,CAAAa,aAAA,CAACR,UAAU;IAACY,GAAG,EAAEf,UAAW;IAACgB,MAAM,EAAEd,IAAK;IAACe,GAAG,EAAC,cAAc;IAACC,IAAI,EAAEd;EAA0B,CAAE,CAAC,gBACjGN,KAAA,CAAAa,aAAA,CAACR,UAAU;IAACY,GAAG,EAAEd,UAAW;IAACe,MAAM,EAAEd,IAAK;IAACe,GAAG,EAAC,YAAY;IAACC,IAAI,EAAEd;EAA0B,CAAE,CAC9F,CAAC;AAEX;AAEAC,SAAS,CAACc,SAAS,GAAG;EACpB;EACAZ,GAAG,EAAER,SAAS,CAACqB,KAAK,CAAC;IACnB;IACAN,UAAU,EAAEf,SAAS,CAACsB,IAAI;IAC1B;IACAR,yBAAyB,EAAEd,SAAS,CAACuB,IAAI,CAACC;EAC5C,CAAC,CAAC,CAACA;AACL,CAAC;AAED,eAAelB,SAAS"}
1
+ {"version":3,"file":"ExpandRow.js","names":["React","PropTypes","ExpandLess","ExpandMore","Icon","IconButton","EXPAND_COLLAPSE_ICON_SIZE","ExpandRow","_ref","row","createElement","getToggleRowExpandedProps","isExpanded","src","iconAs","alt","size","propTypes","shape","bool","func","isRequired"],"sources":["../../src/DataTable/ExpandRow.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { ExpandLess, ExpandMore } from '../../icons';\nimport Icon from '../Icon';\nimport IconButton from '../IconButton';\n\nconst EXPAND_COLLAPSE_ICON_SIZE = 'inline';\n\nfunction ExpandRow({ row }) {\n return (\n <span {...row.getToggleRowExpandedProps()}>\n {row.isExpanded\n ? <IconButton src={ExpandLess} iconAs={Icon} alt=\"Collapse row\" size={EXPAND_COLLAPSE_ICON_SIZE} />\n : <IconButton src={ExpandMore} iconAs={Icon} alt=\"Expand row\" size={EXPAND_COLLAPSE_ICON_SIZE} />}\n </span>\n );\n}\n\nExpandRow.propTypes = {\n /** Row data that is received from `react-table` API. */\n row: PropTypes.shape({\n /** Specifies if row is in expanded state. */\n isExpanded: PropTypes.bool,\n /** Function that returns props for the wrapper component to handle expand behaviour. */\n getToggleRowExpandedProps: PropTypes.func.isRequired,\n }).isRequired,\n};\n\nexport default ExpandRow;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,UAAU,EAAEC,UAAU,QAAQ,aAAa;AACpD,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,UAAU,MAAM,eAAe;AAEtC,MAAMC,yBAAyB,GAAG,QAAQ;AAE1C,SAASC,SAASA,CAAAC,IAAA,EAAU;EAAA,IAAT;IAAEC;EAAI,CAAC,GAAAD,IAAA;EACxB,oBACER,KAAA,CAAAU,aAAA,SAAUD,GAAG,CAACE,yBAAyB,CAAC,CAAC,EACtCF,GAAG,CAACG,UAAU,gBACXZ,KAAA,CAAAU,aAAA,CAACL,UAAU;IAACQ,GAAG,EAAEX,UAAW;IAACY,MAAM,EAAEV,IAAK;IAACW,GAAG,EAAC,cAAc;IAACC,IAAI,EAAEV;EAA0B,CAAE,CAAC,gBACjGN,KAAA,CAAAU,aAAA,CAACL,UAAU;IAACQ,GAAG,EAAEV,UAAW;IAACW,MAAM,EAAEV,IAAK;IAACW,GAAG,EAAC,YAAY;IAACC,IAAI,EAAEV;EAA0B,CAAE,CAC9F,CAAC;AAEX;AAEAC,SAAS,CAACU,SAAS,GAAG;EACpB;EACAR,GAAG,EAAER,SAAS,CAACiB,KAAK,CAAC;IACnB;IACAN,UAAU,EAAEX,SAAS,CAACkB,IAAI;IAC1B;IACAR,yBAAyB,EAAEV,SAAS,CAACmB,IAAI,CAACC;EAC5C,CAAC,CAAC,CAACA;AACL,CAAC;AAED,eAAed,SAAS"}
@@ -1,7 +1,4 @@
1
- const _excluded = ["row"];
2
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
2
  import React, { useContext, useCallback } from 'react';
6
3
  import PropTypes from 'prop-types';
7
4
  import { CheckboxControl } from '../../Form';
@@ -10,9 +7,8 @@ import useConvertIndeterminateProp from '../utils/useConvertIndeterminateProp';
10
7
  import { deleteSelectedRowAction, addSelectedRowAction } from './data/actions';
11
8
  function ControlledSelect(_ref) {
12
9
  let {
13
- row
14
- } = _ref,
15
- rest = _objectWithoutProperties(_ref, _excluded);
10
+ row
11
+ } = _ref;
16
12
  const {
17
13
  itemCount,
18
14
  controlledTableSelections: [, dispatch]
@@ -29,7 +25,7 @@ function ControlledSelect(_ref) {
29
25
  className: "pgn__data-table__controlled-select"
30
26
  }, /*#__PURE__*/React.createElement(CheckboxControl, _extends({}, updatedProps, {
31
27
  onChange: toggleSelected
32
- }, rest)));
28
+ })));
33
29
  }
34
30
  ControlledSelect.propTypes = {
35
31
  row: PropTypes.shape({
@@ -1 +1 @@
1
- {"version":3,"file":"ControlledSelect.js","names":["React","useContext","useCallback","PropTypes","CheckboxControl","DataTableContext","useConvertIndeterminateProp","deleteSelectedRowAction","addSelectedRowAction","ControlledSelect","_ref","row","rest","_objectWithoutProperties","_excluded","itemCount","controlledTableSelections","dispatch","toggleSelected","isSelected","id","updatedProps","getToggleRowSelectedProps","createElement","className","_extends","onChange","propTypes","shape","oneOfType","string","number","isRequired","func","bool"],"sources":["../../../src/DataTable/selection/ControlledSelect.jsx"],"sourcesContent":["import React, { useContext, useCallback } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { CheckboxControl } from '../../Form';\nimport DataTableContext from '../DataTableContext';\nimport useConvertIndeterminateProp from '../utils/useConvertIndeterminateProp';\n\nimport {\n deleteSelectedRowAction,\n addSelectedRowAction,\n} from './data/actions';\n\nfunction ControlledSelect({ row, ...rest }) {\n const {\n itemCount,\n controlledTableSelections: [, dispatch],\n } = useContext(DataTableContext);\n\n const toggleSelected = useCallback(\n () => {\n if (row.isSelected) {\n dispatch(deleteSelectedRowAction(row.id));\n } else {\n dispatch(addSelectedRowAction(row, itemCount));\n }\n },\n [itemCount, row, dispatch],\n );\n\n const updatedProps = useConvertIndeterminateProp(row.getToggleRowSelectedProps());\n\n return (\n <div className=\"pgn__data-table__controlled-select\">\n <CheckboxControl\n {...updatedProps}\n onChange={toggleSelected}\n {...rest}\n />\n </div>\n );\n}\n\nControlledSelect.propTypes = {\n row: PropTypes.shape({\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n getToggleRowSelectedProps: PropTypes.func.isRequired,\n isSelected: PropTypes.bool.isRequired,\n }).isRequired,\n};\n\nexport default ControlledSelect;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,WAAW,QAAQ,OAAO;AACtD,OAAOC,SAAS,MAAM,YAAY;AAElC,SAASC,eAAe,QAAQ,YAAY;AAC5C,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,OAAOC,2BAA2B,MAAM,sCAAsC;AAE9E,SACEC,uBAAuB,EACvBC,oBAAoB,QACf,gBAAgB;AAEvB,SAASC,gBAAgBA,CAAAC,I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boxControl","DataTableContext","useConvertIndeterminateProp","deleteSelectedRowAction","addSelectedRowAction","ControlledSelect","_ref","row","itemCount","controlledTableSelections","dispatch","toggleSelected","isSelected","id","updatedProps","getToggleRowSelectedProps","createElement","className","_extends","onChange","propTypes","shape","oneOfType","string","number","isRequired","func","bool"],"sources":["../../../src/DataTable/selection/ControlledSelect.jsx"],"sourcesContent":["import React, { useContext, useCallback } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { CheckboxControl } from '../../Form';\nimport DataTableContext from '../DataTableContext';\nimport useConvertIndeterminateProp from '../utils/useConvertIndeterminateProp';\n\nimport {\n deleteSelectedRowAction,\n addSelectedRowAction,\n} from './data/actions';\n\nfunction ControlledSelect({ row }) {\n const {\n itemCount,\n controlledTableSelections: [, dispatch],\n } = useContext(DataTableContext);\n\n const toggleSelected = useCallback(\n () => {\n if (row.isSelected) {\n dispatch(deleteSelectedRowAction(row.id));\n } else {\n dispatch(addSelectedRowAction(row, itemCount));\n }\n },\n [itemCount, row, dispatch],\n );\n\n const updatedProps = useConvertIndeterminateProp(row.getToggleRowSelectedProps());\n\n return (\n <div className=\"pgn__data-table__controlled-select\">\n <CheckboxControl\n {...updatedProps}\n onChange={toggleSelected}\n />\n </div>\n );\n}\n\nControlledSelect.propTypes = {\n row: PropTypes.shape({\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n getToggleRowSelectedProps: PropTypes.func.isRequired,\n isSelected: PropTypes.bool.isRequired,\n }).isRequired,\n};\n\nexport default ControlledSelect;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,WAAW,QAAQ,OAAO;AACtD,OAAOC,SAAS,MAAM,YAAY;AAElC,SAASC,eAAe,QAAQ,YAAY;AAC5C,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,OAAOC,2BAA2B,MAAM,sCAAsC;AAE9E,SACEC,uBAAuB,EACvBC,oBAAoB,QACf,gBAAgB;AAEvB,SAASC,gBAAgBA,CAAAC,IAAA,EAAU;EAAA,IAAT;IAAEC;EAAI,CAAC,GAAAD,IAAA;EAC/B,MAAM;IACJE,SAAS;IACTC,yBAAyB,EAAE,GAAGC,QAAQ;EACxC,CAAC,GAAGb,UAAU,CAACI,gBAAgB,CAAC;EAEhC,MAAMU,cAAc,GAAGb,WAAW,CAChC,MAAM;IACJ,IAAIS,GAAG,CAACK,UAAU,EAAE;MAClBF,QAAQ,CAACP,uBAAuB,CAACI,GAAG,CAACM,EAAE,CAAC,CAAC;IAC3C,CAAC,MAAM;MACLH,QAAQ,CAACN,oBAAoB,CAACG,GAAG,EAAEC,SAAS,CAAC,CAAC;IAChD;EACF,CAAC,EACD,CAACA,SAAS,EAAED,GAAG,EAAEG,QAAQ,CAC3B,CAAC;EAED,MAAMI,YAAY,GAAGZ,2BAA2B,CAACK,GAAG,CAACQ,yBAAyB,CAAC,CAAC,CAAC;EAEjF,oBACEnB,KAAA,CAAAoB,aAAA;IAAKC,SAAS,EAAC;EAAoC,gBACjDrB,KAAA,CAAAoB,aAAA,CAAChB,eAAe,EAAAkB,QAAA,KACVJ,YAAY;IAChBK,QAAQ,EAAER;EAAe,EAC1B,CACE,CAAC;AAEV;AAEAN,gBAAgB,CAACe,SAAS,GAAG;EAC3Bb,GAAG,EAAER,SAAS,CAACsB,KAAK,CAAC;IACnBR,EAAE,EAAEd,SAAS,CAACuB,SAAS,CAAC,CAACvB,SAAS,CAACwB,MAAM,EAAExB,SAAS,CAACyB,MAAM,CAAC,CAAC,CAACC,UAAU;IACxEV,yBAAyB,EAAEhB,SAAS,CAAC2B,IAAI,CAACD,UAAU;IACpDb,UAAU,EAAEb,SAAS,CAAC4B,IAAI,CAACF;EAC7B,CAAC,CAAC,CAACA;AACL,CAAC;AAED,eAAepB,gBAAgB"}
@@ -1,7 +1,4 @@
1
- const _excluded = ["rows"];
2
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
2
  import React, { useContext, useMemo, useCallback } from 'react';
6
3
  import PropTypes from 'prop-types';
7
4
  import { CheckboxControl } from '../../Form';
@@ -9,9 +6,8 @@ import DataTableContext from '../DataTableContext';
9
6
  import { clearPageSelectionAction, setSelectedRowsAction } from './data/actions';
10
7
  function ControlledSelectHeader(_ref) {
11
8
  let {
12
- rows
13
- } = _ref,
14
- rest = _objectWithoutProperties(_ref, _excluded);
9
+ rows
10
+ } = _ref;
15
11
  const {
16
12
  itemCount,
17
13
  controlledTableSelections: [, dispatch],
@@ -37,7 +33,7 @@ function ControlledSelectHeader(_ref) {
37
33
  className: "pgn__data-table__controlled-select"
38
34
  }, /*#__PURE__*/React.createElement(CheckboxControl, _extends({}, toggleAllPageRowsSelectedProps, {
39
35
  onChange: toggleAllPageRowsSelected
40
- }, rest)));
36
+ })));
41
37
  }
42
38
  ControlledSelectHeader.propTypes = {
43
39
  rows: PropTypes.arrayOf(PropTypes.shape({
@@ -1 +1 @@
1
- {"version":3,"file":"ControlledSelectHeader.js","names":["React","useContext","useMemo","useCallback","PropTypes","CheckboxControl","DataTableContext","clearPageSelectionAction","setSelectedRowsAction","ControlledSelectHeader","_ref","rows","rest","_objectWithoutProperties","_excluded","itemCount","controlledTableSelections","dispatch","getToggleAllPageRowsSelectedProps","state","selectedRowIds","isAllPageRowsSelected","selectedPageRowIds","Object","keys","toggleAllPageRowsSelected","toggleAllPageRowsSelectedProps","isIndeterminate","indeterminate","createElement","className","_extends","onChange","propTypes","arrayOf","shape","id","oneOfType","string","number","isRequired"],"sources":["../../../src/DataTable/selection/ControlledSelectHeader.jsx"],"sourcesContent":["import React, { useContext, useMemo, useCallback } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { CheckboxControl } from '../../Form';\nimport DataTableContext from '../DataTableContext';\n\nimport {\n clearPageSelectionAction,\n setSelectedRowsAction,\n} from './data/actions';\n\nfunction ControlledSelectHeader({ rows, ...rest }) {\n const {\n itemCount,\n controlledTableSelections: [, dispatch],\n getToggleAllPageRowsSelectedProps,\n state: { selectedRowIds },\n isAllPageRowsSelected,\n } = useContext(DataTableContext);\n\n const selectedPageRowIds = useMemo(\n () => Object.keys(selectedRowIds),\n [selectedRowIds],\n );\n\n const toggleAllPageRowsSelected = useCallback(\n () => {\n if (isAllPageRowsSelected) {\n dispatch(clearPageSelectionAction(selectedPageRowIds));\n } else {\n dispatch(setSelectedRowsAction(rows, itemCount));\n }\n },\n [rows, selectedPageRowIds, isAllPageRowsSelected, dispatch, itemCount],\n );\n\n const toggleAllPageRowsSelectedProps = getToggleAllPageRowsSelectedProps();\n toggleAllPageRowsSelectedProps.isIndeterminate = toggleAllPageRowsSelectedProps.indeterminate;\n // delete unused ``indeterminate`` prop\n delete toggleAllPageRowsSelectedProps.indeterminate;\n\n return (\n <div className=\"pgn__data-table__controlled-select\">\n <CheckboxControl\n {...toggleAllPageRowsSelectedProps}\n onChange={toggleAllPageRowsSelected}\n {...rest}\n />\n </div>\n );\n}\n\nControlledSelectHeader.propTypes = {\n rows: PropTypes.arrayOf(PropTypes.shape({\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n })).isRequired,\n};\n\nexport default ControlledSelectHeader;\n"],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AACxB,eAAe,EAAA0B,QAAA,KACVL,8BAA8B;IAClCM,QAAQ,EAAEP;EAA0B,GAChCb,IAAI,CACT,CACE,CAAC;AAEV;AAEAH,sBAAsB,CAACwB,SAAS,GAAG;EACjCtB,IAAI,EAAEP,SAAS,CAAC8B,OAAO,CAAC9B,SAAS,CAAC+B,KAAK,CAAC;IACtCC,EAAE,EAAEhC,SAAS,CAACiC,SAAS,CAAC,CAACjC,SAAS,CAACkC,MAAM,EAAElC,SAAS,CAACmC,MAAM,CAAC,CAAC,CAACC;EAChE,CAAC,CAAC,CAAC,CAACA;AACN,CAAC;AAED,eAAe/B,sBAAsB"}
1
+ {"version":3,"file":"ControlledSelectHeader.js","names":["React","useContext","useMemo","useCallback","PropTypes","CheckboxControl","DataTableContext","clearPageSelectionAction","setSelectedRowsAction","ControlledSelectHeader","_ref","rows","itemCount","controlledTableSelections","dispatch","getToggleAllPageRowsSelectedProps","state","selectedRowIds","isAllPageRowsSelected","selectedPageRowIds","Object","keys","toggleAllPageRowsSelected","toggleAllPageRowsSelectedProps","isIndeterminate","indeterminate","createElement","className","_extends","onChange","propTypes","arrayOf","shape","id","oneOfType","string","number","isRequired"],"sources":["../../../src/DataTable/selection/ControlledSelectHeader.jsx"],"sourcesContent":["import React, { useContext, useMemo, useCallback } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { CheckboxControl } from '../../Form';\nimport DataTableContext from '../DataTableContext';\n\nimport {\n clearPageSelectionAction,\n setSelectedRowsAction,\n} from './data/actions';\n\nfunction ControlledSelectHeader({ rows }) {\n const {\n itemCount,\n controlledTableSelections: [, dispatch],\n getToggleAllPageRowsSelectedProps,\n state: { selectedRowIds },\n isAllPageRowsSelected,\n } = useContext(DataTableContext);\n\n const selectedPageRowIds = useMemo(\n () => Object.keys(selectedRowIds),\n [selectedRowIds],\n );\n\n const toggleAllPageRowsSelected = useCallback(\n () => {\n if (isAllPageRowsSelected) {\n dispatch(clearPageSelectionAction(selectedPageRowIds));\n } else {\n dispatch(setSelectedRowsAction(rows, itemCount));\n }\n },\n [rows, selectedPageRowIds, isAllPageRowsSelected, dispatch, itemCount],\n );\n\n const toggleAllPageRowsSelectedProps = getToggleAllPageRowsSelectedProps();\n toggleAllPageRowsSelectedProps.isIndeterminate = toggleAllPageRowsSelectedProps.indeterminate;\n // delete unused ``indeterminate`` prop\n delete toggleAllPageRowsSelectedProps.indeterminate;\n\n return (\n <div className=\"pgn__data-table__controlled-select\">\n <CheckboxControl\n {...toggleAllPageRowsSelectedProps}\n onChange={toggleAllPageRowsSelected}\n />\n </div>\n );\n}\n\nControlledSelectHeader.propTypes = {\n rows: PropTypes.arrayOf(PropTypes.shape({\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n })).isRequired,\n};\n\nexport default ControlledSelectHeader;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,OAAO,EAAEC,WAAW,QAAQ,OAAO;AAC/D,OAAOC,SAAS,MAAM,YAAY;AAElC,SAASC,eAAe,QAAQ,YAAY;AAC5C,OAAOC,gBAAgB,MAAM,qBAAqB;AAElD,SACEC,wBAAwB,EACxBC,qBAAqB,QAChB,gBAAgB;AAEvB,SAASC,sBAAsBA,CAAAC,IAAA,EAAW;EAAA,IAAV;IAAEC;EAAK,CAAC,GAAAD,IAAA;EACtC,MAAM;IACJE,SAAS;IACTC,yBAAyB,EAAE,GAAGC,QAAQ,CAAC;IACvCC,iCAAiC;IACjCC,KAAK,EAAE;MAAEC;IAAe,CAAC;IACzBC;EACF,CAAC,GAAGjB,UAAU,CAACK,gBAAgB,CAAC;EAEhC,MAAMa,kBAAkB,GAAGjB,OAAO,CAChC,MAAMkB,MAAM,CAACC,IAAI,CAACJ,cAAc,CAAC,EACjC,CAACA,cAAc,CACjB,CAAC;EAED,MAAMK,yBAAyB,GAAGnB,WAAW,CAC3C,MAAM;IACJ,IAAIe,qBAAqB,EAAE;MACzBJ,QAAQ,CAACP,wBAAwB,CAACY,kBAAkB,CAAC,CAAC;IACxD,CAAC,MAAM;MACLL,QAAQ,CAACN,qBAAqB,CAACG,IAAI,EAAEC,SAAS,CAAC,CAAC;IAClD;EACF,CAAC,EACD,CAACD,IAAI,EAAEQ,kBAAkB,EAAED,qBAAqB,EAAEJ,QAAQ,EAAEF,SAAS,CACvE,CAAC;EAED,MAAMW,8BAA8B,GAAGR,iCAAiC,CAAC,CAAC;EAC1EQ,8BAA8B,CAACC,eAAe,GAAGD,8BAA8B,CAACE,aAAa;EAC7F;EACA,OAAOF,8BAA8B,CAACE,aAAa;EAEnD,oBACEzB,KAAA,CAAA0B,aAAA;IAAKC,SAAS,EAAC;EAAoC,gBACjD3B,KAAA,CAAA0B,aAAA,CAACrB,eAAe,EAAAuB,QAAA,KACVL,8BAA8B;IAClCM,QAAQ,EAAEP;EAA0B,EACrC,CACE,CAAC;AAEV;AAEAb,sBAAsB,CAACqB,SAAS,GAAG;EACjCnB,IAAI,EAAEP,SAAS,CAAC2B,OAAO,CAAC3B,SAAS,CAAC4B,KAAK,CAAC;IACtCC,EAAE,EAAE7B,SAAS,CAAC8B,SAAS,CAAC,CAAC9B,SAAS,CAAC+B,MAAM,EAAE/B,SAAS,CAACgC,MAAM,CAAC,CAAC,CAACC;EAChE,CAAC,CAAC,CAAC,CAACA;AACN,CAAC;AAED,eAAe5B,sBAAsB"}
@@ -1,11 +1,3 @@
1
- const _excluded = ["className", "clearSelectionText"];
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
8
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
9
1
  import React, { useContext, useEffect } from 'react';
10
2
  import PropTypes from 'prop-types';
11
3
  import DataTableContext from '../DataTableContext';
@@ -14,10 +6,9 @@ import { clearSelectionAction, setSelectAllRowsAllPagesAction, setSelectedRowsAc
14
6
  import { getUnselectedPageRows, getRowIds } from './data/helpers';
15
7
  function ControlledSelectionStatus(_ref) {
16
8
  let {
17
- className,
18
- clearSelectionText
19
- } = _ref,
20
- rest = _objectWithoutProperties(_ref, _excluded);
9
+ className,
10
+ clearSelectionText
11
+ } = _ref;
21
12
  const {
22
13
  itemCount,
23
14
  page,
@@ -37,14 +28,14 @@ function ControlledSelectionStatus(_ref) {
37
28
  }, [isEntireTableSelected, selectedRows, itemCount, page, dispatch]);
38
29
  const numSelectedRows = isEntireTableSelected ? itemCount : selectedRows.length;
39
30
  const numSelectedRowsOnPage = (page || []).filter(r => r.isSelected).length;
40
- const selectionStatusProps = _objectSpread({
31
+ const selectionStatusProps = {
41
32
  className,
42
33
  numSelectedRows,
43
34
  numSelectedRowsOnPage,
44
35
  clearSelectionText,
45
36
  onSelectAll: () => dispatch(setSelectAllRowsAllPagesAction()),
46
37
  onClear: () => dispatch(clearSelectionAction())
47
- }, rest);
38
+ };
48
39
  return /*#__PURE__*/React.createElement(BaseSelectionStatus, selectionStatusProps);
49
40
  }
50
41
  ControlledSelectionStatus.defaultProps = {
@@ -1 +1 @@
1
- {"version":3,"file":"ControlledSelectionStatus.js","names":["React","useContext","useEffect","PropTypes","DataTableContext","BaseSelectionStatus","clearSelectionAction","setSelectAllRowsAllPagesAction","setSelectedRowsAction","getUnselectedPageRows","getRowIds","ControlledSelectionStatus","_ref","className","clearSelectionText","rest","_objectWithoutProperties","_excluded","itemCount","page","controlledTableSelections","selectedRows","isEntireTableSelected","dispatch","selectedRowIds","unselectedPageRows","length","numSelectedRows","numSelectedRowsOnPage","filter","r","isSelected","selectionStatusProps","_objectSpread","onSelectAll","onClear","createElement","defaultProps","undefined","propTypes","string","oneOfType","element"],"sources":["../../../src/DataTable/selection/ControlledSelectionStatus.jsx"],"sourcesContent":["import React, { useContext, useEffect } from 'react';\nimport PropTypes from 'prop-types';\n\nimport DataTableContext from '../DataTableContext';\nimport BaseSelectionStatus from './BaseSelectionStatus';\n\nimport {\n clearSelectionAction,\n setSelectAllRowsAllPagesAction,\n setSelectedRowsAction,\n} from './data/actions';\nimport {\n getUnselectedPageRows,\n getRowIds,\n} from './data/helpers';\n\nfunction ControlledSelectionStatus({ className, clearSelectionText, ...rest }) {\n const {\n itemCount,\n page,\n controlledTableSelections: [{ selectedRows, isEntireTableSelected }, dispatch],\n } = useContext(DataTableContext);\n\n useEffect(\n () => {\n if (isEntireTableSelected) {\n const selectedRowIds = getRowIds(selectedRows);\n const unselectedPageRows = getUnselectedPageRows(selectedRowIds, page);\n if (unselectedPageRows.length) {\n dispatch(setSelectedRowsAction(unselectedPageRows, itemCount));\n }\n }\n },\n [isEntireTableSelected, selectedRows, itemCount, page, dispatch],\n );\n\n const numSelectedRows = isEntireTableSelected ? itemCount : selectedRows.length;\n const numSelectedRowsOnPage = (page || []).filter(r => r.isSelected).length;\n\n const selectionStatusProps = {\n className,\n numSelectedRows,\n numSelectedRowsOnPage,\n clearSelectionText,\n onSelectAll: () => dispatch(setSelectAllRowsAllPagesAction()),\n onClear: () => dispatch(clearSelectionAction()),\n ...rest,\n };\n return <BaseSelectionStatus {...selectionStatusProps} />;\n}\n\nControlledSelectionStatus.defaultProps = {\n className: undefined,\n clearSelectionText: undefined,\n};\n\nControlledSelectionStatus.propTypes = {\n /** A class name to append to the base element */\n className: PropTypes.string,\n /** A text that appears on the `Clear selection` button, defaults to 'Clear Selection' */\n clearSelectionText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n};\n\nexport default ControlledSelectionStatus;\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,SAAS,QAAQ,OAAO;AACpD,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,OAAOC,mBAAmB,MAAM,uBAAuB;AAEvD,SACEC,oBAAoB,EACpBC,8BAA8B,EAC9BC,qBAAqB,QAChB,gBAAgB;AACvB,SACEC,qBAAqB,EACrBC,SAAS,QACJ,gBAAgB;AAEvB,SAASC,yBAAyBA,CAAAC,IAAA,EAA6C;EAAA,IAA5C;MAAEC,SAAS;MAAEC;IAA4B,CAAC,GAAAF,IAAA;IAANG,IAAI,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA;EACzE,MAAM;IACJC,SAAS;IACTC,IAAI;IACJC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;EAC3B;EACA1B,kBAAkB,EAAEX,SAAS,CAACsC,SAAS,CAAC,CAACtC,SAAS,CAACqC,MAAM,EAAErC,SAAS,CAACuC,OAAO,CAAC;AAC/E,CAAC;AAED,eAAe/B,yBAAyB"}
1
+ {"version":3,"file":"ControlledSelectionStatus.js","names":["React","useContext","useEffect","PropTypes","DataTableContext","BaseSelectionStatus","clearSelectionAction","setSelectAllRowsAllPagesAction","setSelectedRowsAction","getUnselectedPageRows","getRowIds","ControlledSelectionStatus","_ref","className","clearSelectionText","itemCount","page","controlledTableSelections","selectedRows","isEntireTableSelected","dispatch","selectedRowIds","unselectedPageRows","length","numSelectedRows","numSelectedRowsOnPage","filter","r","isSelected","selectionStatusProps","onSelectAll","onClear","createElement","defaultProps","undefined","propTypes","string","oneOfType","element"],"sources":["../../../src/DataTable/selection/ControlledSelectionStatus.jsx"],"sourcesContent":["import React, { useContext, useEffect } from 'react';\nimport PropTypes from 'prop-types';\n\nimport DataTableContext from '../DataTableContext';\nimport BaseSelectionStatus from './BaseSelectionStatus';\n\nimport {\n clearSelectionAction,\n setSelectAllRowsAllPagesAction,\n setSelectedRowsAction,\n} from './data/actions';\nimport {\n getUnselectedPageRows,\n getRowIds,\n} from './data/helpers';\n\nfunction ControlledSelectionStatus({ className, clearSelectionText }) {\n const {\n itemCount,\n page,\n controlledTableSelections: [{ selectedRows, isEntireTableSelected }, dispatch],\n } = useContext(DataTableContext);\n\n useEffect(\n () => {\n if (isEntireTableSelected) {\n const selectedRowIds = getRowIds(selectedRows);\n const unselectedPageRows = getUnselectedPageRows(selectedRowIds, page);\n if (unselectedPageRows.length) {\n dispatch(setSelectedRowsAction(unselectedPageRows, itemCount));\n }\n }\n },\n [isEntireTableSelected, selectedRows, itemCount, page, dispatch],\n );\n\n const numSelectedRows = isEntireTableSelected ? itemCount : selectedRows.length;\n const numSelectedRowsOnPage = (page || []).filter(r => r.isSelected).length;\n\n const selectionStatusProps = {\n className,\n numSelectedRows,\n numSelectedRowsOnPage,\n clearSelectionText,\n onSelectAll: () => dispatch(setSelectAllRowsAllPagesAction()),\n onClear: () => dispatch(clearSelectionAction()),\n };\n return <BaseSelectionStatus {...selectionStatusProps} />;\n}\n\nControlledSelectionStatus.defaultProps = {\n className: undefined,\n clearSelectionText: undefined,\n};\n\nControlledSelectionStatus.propTypes = {\n /** A class name to append to the base element */\n className: PropTypes.string,\n /** A text that appears on the `Clear selection` button, defaults to 'Clear Selection' */\n clearSelectionText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n};\n\nexport default ControlledSelectionStatus;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,SAAS,QAAQ,OAAO;AACpD,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,OAAOC,mBAAmB,MAAM,uBAAuB;AAEvD,SACEC,oBAAoB,EACpBC,8BAA8B,EAC9BC,qBAAqB,QAChB,gBAAgB;AACvB,SACEC,qBAAqB,EACrBC,SAAS,QACJ,gBAAgB;AAEvB,SAASC,yBAAyBA,CAAAC,IAAA,EAAoC;EAAA,IAAnC;IAAEC,SAAS;IAAEC;EAAmB,CAAC,GAAAF,IAAA;EAClE,MAAM;IACJG,SAAS;IACTC,IAAI;IACJC,yBAAyB,EAAE,CAAC;MAAEC,YAAY;MAAEC;IAAsB,CAAC,EAAEC,QAAQ;EAC/E,CAAC,GAAGnB,UAAU,CAACG,gBAAgB,CAAC;EAEhCF,SAAS,CACP,MAAM;IACJ,IAAIiB,qBAAqB,EAAE;MACzB,MAAME,cAAc,GAAGX,SAAS,CAACQ,YAAY,CAAC;MAC9C,MAAMI,kBAAkB,GAAGb,qBAAqB,CAACY,cAAc,EAAEL,IAAI,CAAC;MACtE,IAAIM,kBAAkB,CAACC,MAAM,EAAE;QAC7BH,QAAQ,CAACZ,qBAAqB,CAACc,kBAAkB,EAAEP,SAAS,CAAC,CAAC;MAChE;IACF;EACF,CAAC,EACD,CAACI,qBAAqB,EAAED,YAAY,EAAEH,SAAS,EAAEC,IAAI,EAAEI,QAAQ,CACjE,CAAC;EAED,MAAMI,eAAe,GAAGL,qBAAqB,GAAGJ,SAAS,GAAGG,YAAY,CAACK,MAAM;EAC/E,MAAME,qBAAqB,GAAG,CAACT,IAAI,IAAI,EAAE,EAAEU,MAAM,CAACC,CAAC,IAAIA,CAAC,CAACC,UAAU,CAAC,CAACL,MAAM;EAE3E,MAAMM,oBAAoB,GAAG;IAC3BhB,SAAS;IACTW,eAAe;IACfC,qBAAqB;IACrBX,kBAAkB;IAClBgB,WAAW,EAAEA,CAAA,KAAMV,QAAQ,CAACb,8BAA8B,CAAC,CAAC,CAAC;IAC7DwB,OAAO,EAAEA,CAAA,KAAMX,QAAQ,CAACd,oBAAoB,CAAC,CAAC;EAChD,CAAC;EACD,oBAAON,KAAA,CAAAgC,aAAA,CAAC3B,mBAAmB,EAAKwB,oBAAuB,CAAC;AAC1D;AAEAlB,yBAAyB,CAACsB,YAAY,GAAG;EACvCpB,SAAS,EAAEqB,SAAS;EACpBpB,kBAAkB,EAAEoB;AACtB,CAAC;AAEDvB,yBAAyB,CAACwB,SAAS,GAAG;EACpC;EACAtB,SAAS,EAAEV,SAAS,CAACiC,MAAM;EAC3B;EACAtB,kBAAkB,EAAEX,SAAS,CAACkC,SAAS,CAAC,CAAClC,SAAS,CAACiC,MAAM,EAAEjC,SAAS,CAACmC,OAAO,CAAC;AAC/E,CAAC;AAED,eAAe3B,yBAAyB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openedx/paragon",
3
- "version": "22.0.0-alpha.15",
3
+ "version": "22.0.0-alpha.16",
4
4
  "description": "Accessible, responsive UI component library based on Bootstrap.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -6,9 +6,9 @@ import IconButton from '../IconButton';
6
6
 
7
7
  const EXPAND_COLLAPSE_ICON_SIZE = 'inline';
8
8
 
9
- function ExpandRow({ row, ...rest }) {
9
+ function ExpandRow({ row }) {
10
10
  return (
11
- <span {...row.getToggleRowExpandedProps()} {...rest}>
11
+ <span {...row.getToggleRowExpandedProps()}>
12
12
  {row.isExpanded
13
13
  ? <IconButton src={ExpandLess} iconAs={Icon} alt="Collapse row" size={EXPAND_COLLAPSE_ICON_SIZE} />
14
14
  : <IconButton src={ExpandMore} iconAs={Icon} alt="Expand row" size={EXPAND_COLLAPSE_ICON_SIZE} />}
@@ -10,7 +10,7 @@ import {
10
10
  addSelectedRowAction,
11
11
  } from './data/actions';
12
12
 
13
- function ControlledSelect({ row, ...rest }) {
13
+ function ControlledSelect({ row }) {
14
14
  const {
15
15
  itemCount,
16
16
  controlledTableSelections: [, dispatch],
@@ -34,7 +34,6 @@ function ControlledSelect({ row, ...rest }) {
34
34
  <CheckboxControl
35
35
  {...updatedProps}
36
36
  onChange={toggleSelected}
37
- {...rest}
38
37
  />
39
38
  </div>
40
39
  );
@@ -9,7 +9,7 @@ import {
9
9
  setSelectedRowsAction,
10
10
  } from './data/actions';
11
11
 
12
- function ControlledSelectHeader({ rows, ...rest }) {
12
+ function ControlledSelectHeader({ rows }) {
13
13
  const {
14
14
  itemCount,
15
15
  controlledTableSelections: [, dispatch],
@@ -44,7 +44,6 @@ function ControlledSelectHeader({ rows, ...rest }) {
44
44
  <CheckboxControl
45
45
  {...toggleAllPageRowsSelectedProps}
46
46
  onChange={toggleAllPageRowsSelected}
47
- {...rest}
48
47
  />
49
48
  </div>
50
49
  );
@@ -14,7 +14,7 @@ import {
14
14
  getRowIds,
15
15
  } from './data/helpers';
16
16
 
17
- function ControlledSelectionStatus({ className, clearSelectionText, ...rest }) {
17
+ function ControlledSelectionStatus({ className, clearSelectionText }) {
18
18
  const {
19
19
  itemCount,
20
20
  page,
@@ -44,7 +44,6 @@ function ControlledSelectionStatus({ className, clearSelectionText, ...rest }) {
44
44
  clearSelectionText,
45
45
  onSelectAll: () => dispatch(setSelectAllRowsAllPagesAction()),
46
46
  onClear: () => dispatch(clearSelectionAction()),
47
- ...rest,
48
47
  };
49
48
  return <BaseSelectionStatus {...selectionStatusProps} />;
50
49
  }
@@ -10,10 +10,7 @@ const row = {
10
10
 
11
11
  describe('<ExpandRow />', () => {
12
12
  it('renders expand row element if rows is not expanded', () => {
13
- const { getByTestId, getByLabelText } = render(<ExpandRow row={row} data-testid="span-expand-row" />);
14
-
15
- const labelWrapper = getByTestId('span-expand-row');
16
- expect(labelWrapper).toBeInTheDocument();
13
+ const { getByLabelText } = render(<ExpandRow row={row} />);
17
14
 
18
15
  const iconButton = getByLabelText('Expand row');
19
16
  expect(iconButton).toBeInTheDocument();
@@ -21,10 +18,7 @@ describe('<ExpandRow />', () => {
21
18
 
22
19
  it('renders collapse row element if row is expanded', () => {
23
20
  const expandedRow = { ...row, isExpanded: true };
24
- const { getByTestId, getByLabelText } = render(<ExpandRow row={expandedRow} data-testid="span-collapse-row" />);
25
-
26
- const labelWrapper = getByTestId('span-collapse-row');
27
- expect(labelWrapper).toBeInTheDocument();
21
+ const { getByLabelText } = render(<ExpandRow row={expandedRow} />);
28
22
 
29
23
  const iconButton = getByLabelText('Collapse row');
30
24
  expect(iconButton).toBeInTheDocument();