@openedx/paragon 21.8.0 → 21.9.1

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.
Files changed (35) hide show
  1. package/dist/DataTable/CollapsibleButtonGroup.js +1 -1
  2. package/dist/DataTable/CollapsibleButtonGroup.js.map +1 -1
  3. package/dist/DataTable/TableFilters.js +1 -1
  4. package/dist/DataTable/TableFilters.js.map +1 -1
  5. package/dist/DataTable/TableFooter.js +1 -1
  6. package/dist/DataTable/TableFooter.js.map +1 -1
  7. package/dist/DataTable/filters/CheckboxFilter.js +1 -1
  8. package/dist/DataTable/filters/CheckboxFilter.js.map +1 -1
  9. package/dist/DataTable/filters/DropdownFilter.js +1 -1
  10. package/dist/DataTable/filters/DropdownFilter.js.map +1 -1
  11. package/dist/DataTable/filters/MultiSelectDropdownFilter.js +1 -1
  12. package/dist/DataTable/filters/MultiSelectDropdownFilter.js.map +1 -1
  13. package/dist/DataTable/filters/TextFilter.js +1 -1
  14. package/dist/DataTable/filters/TextFilter.js.map +1 -1
  15. package/dist/DataTable/index.js +13 -13
  16. package/dist/DataTable/index.js.map +1 -1
  17. package/dist/Form/FormControl.js +12 -6
  18. package/dist/Form/FormControl.js.map +1 -1
  19. package/dist/ProductTour/Checkpoint.js +1 -0
  20. package/dist/ProductTour/Checkpoint.js.map +1 -1
  21. package/package.json +6 -2
  22. package/src/ActionRow/README.md +4 -2
  23. package/src/DataTable/CollapsibleButtonGroup.jsx +1 -1
  24. package/src/DataTable/TableFilters.jsx +1 -1
  25. package/src/DataTable/TableFooter.jsx +1 -5
  26. package/src/DataTable/filters/CheckboxFilter.jsx +1 -1
  27. package/src/DataTable/filters/DropdownFilter.jsx +1 -1
  28. package/src/DataTable/filters/MultiSelectDropdownFilter.jsx +1 -1
  29. package/src/DataTable/filters/TextFilter.jsx +1 -1
  30. package/src/DataTable/index.jsx +13 -13
  31. package/src/DataTable/tests/TableActions.test.jsx +5 -4
  32. package/src/Form/FormControl.jsx +7 -1
  33. package/src/Form/form-control.mdx +142 -1
  34. package/src/Form/tests/FormControl.test.jsx +40 -3
  35. package/src/ProductTour/Checkpoint.jsx +1 -0
@@ -92,7 +92,7 @@ CollapsibleButtonGroup.propTypes = {
92
92
  className: PropTypes.string,
93
93
  /** Array of action objects, containing a component and their callback args */
94
94
  actions: PropTypes.arrayOf(PropTypes.shape({
95
- component: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).isRequired,
95
+ component: PropTypes.oneOfType([PropTypes.element, PropTypes.elementType]).isRequired,
96
96
  args: PropTypes.shape({})
97
97
  })).isRequired
98
98
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CollapsibleButtonGroup.js","names":["React","useContext","useMemo","useState","PropTypes","MoreVert","useToggle","useWindowSize","DataTableContext","Icon","IconButton","breakpoints","ModalPopup","Stack","Button","ACTION_OVERFLOW_BUTTON_TEXT","SMALL_SCREEN_ACTION_OVERFLOW_BUTTON_TEXT","CollapsibleButtonGroup","_ref","className","actions","rest","_objectWithoutProperties","_excluded","isOverflowMenuOpen","openOverflowMenu","closeOverflowMenu","overflowMenuTarget","setOverflowMenuTarget","controlledTableSelections","isEntireTableSelected","selectedFlatRows","rows","width","selectedRows","visibleActions","dropdownActions","small","minWidth","firstTwoActions","splice","extraActions","slice","reverse","cloneAction","action","index","cloneElement","component","_objectSpread","key","as","args","createElement","_extends","length","Fragment","variant","iconAs","src","alt","id","ref","onClick","positionRef","onClose","placement","isOpen","gap","map","defaultProps","propTypes","string","arrayOf","shape","oneOfType","func","element","isRequired"],"sources":["../../src/DataTable/CollapsibleButtonGroup.jsx"],"sourcesContent":["import React, { useContext, useMemo, useState } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { MoreVert } from '../../icons';\nimport useToggle from '../hooks/useToggle';\nimport useWindowSize from '../hooks/useWindowSize';\nimport DataTableContext from './DataTableContext';\nimport Icon from '../Icon';\nimport IconButton from '../IconButton';\nimport breakpoints from '../utils/breakpoints';\nimport ModalPopup from '../Modal/ModalPopup';\nimport Stack from '../Stack';\nimport Button from '../Button';\n\nexport const ACTION_OVERFLOW_BUTTON_TEXT = 'More actions';\nexport const SMALL_SCREEN_ACTION_OVERFLOW_BUTTON_TEXT = 'Actions';\n\nfunction CollapsibleButtonGroup({\n className,\n actions,\n ...rest\n}) {\n const [isOverflowMenuOpen, openOverflowMenu, closeOverflowMenu] = useToggle(false);\n const [overflowMenuTarget, setOverflowMenuTarget] = useState(null);\n const {\n controlledTableSelections: [{ isEntireTableSelected }],\n selectedFlatRows,\n rows,\n } = useContext(DataTableContext);\n const { width } = useWindowSize();\n const selectedRows = selectedFlatRows || rows;\n\n const [visibleActions, dropdownActions] = useMemo(() => {\n if (width < breakpoints.small.minWidth) {\n // On a small screen, all actions will be in the overflow menu\n return [[], [...actions]];\n }\n // The first two actions will be displayed as buttons, the rest will go in an overflow menu\n const firstTwoActions = [...actions].splice(0, 2);\n const extraActions = [...actions].slice(2);\n\n /* Reversing the array because to the user it makes sense to put the primary button first,\n but we want it on the right */\n return [firstTwoActions.reverse(), extraActions];\n }, [actions, width]);\n\n if (!isEntireTableSelected && !selectedRows) {\n return null;\n }\n\n const cloneAction = (action, index) => React.cloneElement(\n action.component,\n {\n // eslint-disable-next-line react/no-array-index-key\n key: `${action}${index}`,\n as: Button, // for backwards compatibility this is needed\n ...action.args,\n },\n );\n\n return (\n <div className={className} {...rest}>\n {dropdownActions.length > 0 && (\n <>\n <IconButton\n variant=\"secondary\"\n iconAs={Icon}\n src={MoreVert}\n alt={width > breakpoints.small.minWidth\n ? ACTION_OVERFLOW_BUTTON_TEXT : SMALL_SCREEN_ACTION_OVERFLOW_BUTTON_TEXT}\n id=\"actions-dropdown\"\n ref={setOverflowMenuTarget}\n onClick={openOverflowMenu}\n />\n <ModalPopup\n positionRef={overflowMenuTarget}\n onClose={closeOverflowMenu}\n placement=\"bottom-end\"\n isOpen={isOverflowMenuOpen}\n >\n <div className=\"pgn__datatable__overflow-actions-menu\">\n <Stack gap={2}>\n {dropdownActions.map(cloneAction)}\n </Stack>\n </div>\n </ModalPopup>\n </>\n )}\n <div className=\"pgn__datatable__visible-actions\">\n {visibleActions.map(cloneAction)}\n </div>\n </div>\n );\n}\n\nCollapsibleButtonGroup.defaultProps = {\n className: null,\n};\n\nCollapsibleButtonGroup.propTypes = {\n /** Class names for the div wrapping the button components */\n className: PropTypes.string,\n /** Array of action objects, containing a component and their callback args */\n actions: PropTypes.arrayOf(PropTypes.shape({\n component: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).isRequired,\n args: PropTypes.shape({}),\n })).isRequired,\n};\n\nexport default CollapsibleButtonGroup;\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC5D,OAAOC,SAAS,MAAM,YAAY;AAElC,SAASC,QAAQ,QAAQ,aAAa;AACtC,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,OAAOC,aAAa,MAAM,wBAAwB;AAClD,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,WAAW,MAAM,sBAAsB;AAC9C,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,OAAOC,KAAK,MAAM,UAAU;AAC5B,OAAOC,MAAM,MAAM,WAAW;AAE9B,OAAO,MAAMC,2BAA2B,GAAG,cAAc;AACzD,OAAO,MAAMC,wCAAwC,GAAG,SAAS;AAEjE,SAASC,sBAAsBA,CAAAC,IAAA,EAI5B;EAAA,IAJ6B;MAC9BC,SAAS;MACTC;IAEF,CAAC,GAAAF,IAAA;IADIG,IAAI,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA;EAEP,MAAM,CAACC,kBAAkB,EAAEC,gBAAgB,EAAEC,iBAAiB,CAAC,GAAGpB,SAAS,CAAC,KAAK,CAAC;EAClF,MAAM,CAACqB,kBAAkB,EAAEC,qBAAqB,CAAC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U;IAC9E1B,IAAI,EAAEhD,SAAS,CAACsE,KAAK,CAAC,CAAC,CAAC;EAC1B,CAAC,CAAC,CAAC,CAACI;AACN,CAAC;AAED,eAAe7D,sBAAsB"}
1
+ {"version":3,"file":"CollapsibleButtonGroup.js","names":["React","useContext","useMemo","useState","PropTypes","MoreVert","useToggle","useWindowSize","DataTableContext","Icon","IconButton","breakpoints","ModalPopup","Stack","Button","ACTION_OVERFLOW_BUTTON_TEXT","SMALL_SCREEN_ACTION_OVERFLOW_BUTTON_TEXT","CollapsibleButtonGroup","_ref","className","actions","rest","_objectWithoutProperties","_excluded","isOverflowMenuOpen","openOverflowMenu","closeOverflowMenu","overflowMenuTarget","setOverflowMenuTarget","controlledTableSelections","isEntireTableSelected","selectedFlatRows","rows","width","selectedRows","visibleActions","dropdownActions","small","minWidth","firstTwoActions","splice","extraActions","slice","reverse","cloneAction","action","index","cloneElement","component","_objectSpread","key","as","args","createElement","_extends","length","Fragment","variant","iconAs","src","alt","id","ref","onClick","positionRef","onClose","placement","isOpen","gap","map","defaultProps","propTypes","string","arrayOf","shape","oneOfType","element","elementType","isRequired"],"sources":["../../src/DataTable/CollapsibleButtonGroup.jsx"],"sourcesContent":["import React, { useContext, useMemo, useState } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { MoreVert } from '../../icons';\nimport useToggle from '../hooks/useToggle';\nimport useWindowSize from '../hooks/useWindowSize';\nimport DataTableContext from './DataTableContext';\nimport Icon from '../Icon';\nimport IconButton from '../IconButton';\nimport breakpoints from '../utils/breakpoints';\nimport ModalPopup from '../Modal/ModalPopup';\nimport Stack from '../Stack';\nimport Button from '../Button';\n\nexport const ACTION_OVERFLOW_BUTTON_TEXT = 'More actions';\nexport const SMALL_SCREEN_ACTION_OVERFLOW_BUTTON_TEXT = 'Actions';\n\nfunction CollapsibleButtonGroup({\n className,\n actions,\n ...rest\n}) {\n const [isOverflowMenuOpen, openOverflowMenu, closeOverflowMenu] = useToggle(false);\n const [overflowMenuTarget, setOverflowMenuTarget] = useState(null);\n const {\n controlledTableSelections: [{ isEntireTableSelected }],\n selectedFlatRows,\n rows,\n } = useContext(DataTableContext);\n const { width } = useWindowSize();\n const selectedRows = selectedFlatRows || rows;\n\n const [visibleActions, dropdownActions] = useMemo(() => {\n if (width < breakpoints.small.minWidth) {\n // On a small screen, all actions will be in the overflow menu\n return [[], [...actions]];\n }\n // The first two actions will be displayed as buttons, the rest will go in an overflow menu\n const firstTwoActions = [...actions].splice(0, 2);\n const extraActions = [...actions].slice(2);\n\n /* Reversing the array because to the user it makes sense to put the primary button first,\n but we want it on the right */\n return [firstTwoActions.reverse(), extraActions];\n }, [actions, width]);\n\n if (!isEntireTableSelected && !selectedRows) {\n return null;\n }\n\n const cloneAction = (action, index) => React.cloneElement(\n action.component,\n {\n // eslint-disable-next-line react/no-array-index-key\n key: `${action}${index}`,\n as: Button, // for backwards compatibility this is needed\n ...action.args,\n },\n );\n\n return (\n <div className={className} {...rest}>\n {dropdownActions.length > 0 && (\n <>\n <IconButton\n variant=\"secondary\"\n iconAs={Icon}\n src={MoreVert}\n alt={width > breakpoints.small.minWidth\n ? ACTION_OVERFLOW_BUTTON_TEXT : SMALL_SCREEN_ACTION_OVERFLOW_BUTTON_TEXT}\n id=\"actions-dropdown\"\n ref={setOverflowMenuTarget}\n onClick={openOverflowMenu}\n />\n <ModalPopup\n positionRef={overflowMenuTarget}\n onClose={closeOverflowMenu}\n placement=\"bottom-end\"\n isOpen={isOverflowMenuOpen}\n >\n <div className=\"pgn__datatable__overflow-actions-menu\">\n <Stack gap={2}>\n {dropdownActions.map(cloneAction)}\n </Stack>\n </div>\n </ModalPopup>\n </>\n )}\n <div className=\"pgn__datatable__visible-actions\">\n {visibleActions.map(cloneAction)}\n </div>\n </div>\n );\n}\n\nCollapsibleButtonGroup.defaultProps = {\n className: null,\n};\n\nCollapsibleButtonGroup.propTypes = {\n /** Class names for the div wrapping the button components */\n className: PropTypes.string,\n /** Array of action objects, containing a component and their callback args */\n actions: PropTypes.arrayOf(PropTypes.shape({\n component: PropTypes.oneOfType([PropTypes.element, PropTypes.elementType]).isRequired,\n args: PropTypes.shape({}),\n })).isRequired,\n};\n\nexport default CollapsibleButtonGroup;\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC5D,OAAOC,SAAS,MAAM,YAAY;AAElC,SAASC,QAAQ,QAAQ,aAAa;AACtC,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,OAAOC,aAAa,MAAM,wBAAwB;AAClD,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,WAAW,MAAM,sBAAsB;AAC9C,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,OAAOC,KAAK,MAAM,UAAU;AAC5B,OAAOC,MAAM,MAAM,WAAW;AAE9B,OAAO,MAAMC,2BAA2B,GAAG,cAAc;AACzD,OAAO,MAAMC,wCAAwC,GAAG,SAAS;AAEjE,SAASC,sBAAsBA,CAAAC,IAAA,EAI5B;EAAA,IAJ6B;MAC9BC,SAAS;MACTC;IAEF,CAAC,GAAAF,IAAA;IADIG,IAAI,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA;EAEP,MAAM,CAACC,kBAAkB,EAAEC,gBAAgB,EAAEC,iBAAiB,CAAC,GAAGpB,SAAS,CAAC,KAAK,CAAC;EAClF,MAAM,CAACqB,kBAAkB,EAAEC,qBAAqB,CAAC,GAAGzB,QAAQ,CAAC,IAAI,CAAC;EAClE,MAAM;IACJ0B,yBAAyB,EAAE,CAAC;MAAEC;IAAsB,CAAC,CAAC;IACtDC,gBAAgB;IAChBC;EACF,CAAC,GAAG/B,UAAU,CAACO,gBAAgB,CAAC;EAChC,MAAM;IAAEyB;EAAM,CAAC,GAAG1B,aAAa,CAAC,CAAC;EACjC,MAAM2B,YAAY,GAAGH,g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,CAACC,QAAQ,GACnCvB,2BAA2B,GAAGC,wCAAyC;IAC3E6C,EAAE,EAAC,kBAAkB;IACrBC,GAAG,EAAElC,qBAAsB;IAC3BmC,OAAO,EAAEtC;EAAiB,CAC3B,CAAC,eACFzB,KAAA,CAAAqD,aAAA,CAACzC,UAAU;IACToD,WAAW,EAAErC,kBAAmB;IAChCsC,OAAO,EAAEvC,iBAAkB;IAC3BwC,SAAS,EAAC,YAAY;IACtBC,MAAM,EAAE3C;EAAmB,gBAE3BxB,KAAA,CAAAqD,aAAA;IAAKlC,SAAS,EAAC;EAAuC,gBACpDnB,KAAA,CAAAqD,aAAA,CAACxC,KAAK;IAACuD,GAAG,EAAE;EAAE,GACXhC,eAAe,CAACiC,GAAG,CAACzB,WAAW,CAC3B,CACJ,CACK,CACZ,CACH,eACD5C,KAAA,CAAAqD,aAAA;IAAKlC,SAAS,EAAC;EAAiC,GAC7CgB,cAAc,CAACkC,GAAG,CAACzB,WAAW,CAC5B,CACF,CAAC;AAEV;AAEA3B,sBAAsB,CAACqD,YAAY,GAAG;EACpCnD,SAAS,EAAE;AACb,CAAC;AAEDF,sBAAsB,CAACsD,SAAS,GAAG;EACjC;EACApD,SAAS,EAAEf,SAAS,CAACoE,MAAM;EAC3B;EACApD,OAAO,EAAEhB,SAAS,CAACqE,OAAO,CAACrE,SAAS,CAACsE,KAAK,CAAC;IACzC1B,SAAS,EAAE5C,SAAS,CAACuE,SAAS,CAAC,CAACvE,SAAS,CAACwE,OAAO,EAAExE,SAAS,CAACyE,WAAW,CAAC,CAAC,CAACC,UAAU;IACrF1B,IAAI,EAAEhD,SAAS,CAACsE,KAAK,CAAC,CAAC,CAAC;EAC1B,CAAC,CAAC,CAAC,CAACI;AACN,CAAC;AAED,eAAe7D,sBAAsB"}
@@ -22,7 +22,7 @@ TableFilters.defaultProps = {
22
22
  };
23
23
  TableFilters.propTypes = {
24
24
  columns: PropTypes.arrayOf(PropTypes.shape({
25
- Header: PropTypes.oneOfType([PropTypes.func, PropTypes.node]).isRequired,
25
+ Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,
26
26
  canFilter: PropTypes.bool,
27
27
  render: PropTypes.func.isRequired
28
28
  })).isRequired,
@@ -1 +1 @@
1
- {"version":3,"file":"TableFilters.js","names":["React","PropTypes","Button","TABLE_FILTERS_BUTTON_TEXT","TableFilters","_ref","columns","manualFilters","onFilter","currentFilters","createElement","map","column","key","Header","canFilter","render","type","onClick","defaultProps","propTypes","arrayOf","shape","oneOfType","func","node","isRequired","bool"],"sources":["../../src/DataTable/TableFilters.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Button from '../Button';\n\nexport const TABLE_FILTERS_BUTTON_TEXT = 'Filter';\n\nfunction TableFilters({\n columns, manualFilters, onFilter, currentFilters,\n}) {\n return (\n <div>\n <h4>Filters</h4>\n {columns.map(column => <div key={column.Header}>{column.canFilter ? column.render('Filter') : null}</div>)}\n {manualFilters && (\n <Button\n type=\"primary\"\n onClick={() => onFilter(currentFilters)}\n >\n {TABLE_FILTERS_BUTTON_TEXT}\n </Button>\n )}\n </div>\n );\n}\n\nTableFilters.defaultProps = {\n manualFilters: false,\n onFilter: () => {},\n};\n\nTableFilters.propTypes = {\n columns: PropTypes.arrayOf(PropTypes.shape({\n Header: PropTypes.oneOfType([PropTypes.func, PropTypes.node]).isRequired,\n canFilter: PropTypes.bool,\n render: PropTypes.func.isRequired,\n })).isRequired,\n manualFilters: PropTypes.bool,\n onFilter: PropTypes.func,\n currentFilters: PropTypes.arrayOf(PropTypes.shape()).isRequired,\n};\n\nexport default TableFilters;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,MAAM,MAAM,WAAW;AAE9B,OAAO,MAAMC,yBAAyB,GAAG,QAAQ;AAEjD,SAASC,YAAYA,CAAAC,IAAA,EAElB;EAAA,IAFmB;IACpBC,OAAO;IAAEC,aAAa;IAA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ref","columns","manualFilters","onFilter","currentFilters","createElement","map","column","key","Header","canFilter","render","type","onClick","defaultProps","propTypes","arrayOf","shape","oneOfType","elementType","node","isRequired","bool","func"],"sources":["../../src/DataTable/TableFilters.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Button from '../Button';\n\nexport const TABLE_FILTERS_BUTTON_TEXT = 'Filter';\n\nfunction TableFilters({\n columns, manualFilters, onFilter, currentFilters,\n}) {\n return (\n <div>\n <h4>Filters</h4>\n {columns.map(column => <div key={column.Header}>{column.canFilter ? column.render('Filter') : null}</div>)}\n {manualFilters && (\n <Button\n type=\"primary\"\n onClick={() => onFilter(currentFilters)}\n >\n {TABLE_FILTERS_BUTTON_TEXT}\n </Button>\n )}\n </div>\n );\n}\n\nTableFilters.defaultProps = {\n manualFilters: false,\n onFilter: () => {},\n};\n\nTableFilters.propTypes = {\n columns: PropTypes.arrayOf(PropTypes.shape({\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n canFilter: PropTypes.bool,\n render: PropTypes.func.isRequired,\n })).isRequired,\n manualFilters: PropTypes.bool,\n onFilter: PropTypes.func,\n currentFilters: PropTypes.arrayOf(PropTypes.shape()).isRequired,\n};\n\nexport default TableFilters;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,MAAM,MAAM,WAAW;AAE9B,OAAO,MAAMC,yBAAyB,GAAG,QAAQ;AAEjD,SAASC,YAAYA,CAAAC,IAAA,EAElB;EAAA,IAFmB;IACpBC,OAAO;IAAEC,aAAa;IAAEC,QAAQ;IAAEC;EACpC,CAAC,GAAAJ,IAAA;EACC,oBACEL,KAAA,CAAAU,aAAA,2BACEV,KAAA,CAAAU,aAAA,aAAI,SAAW,CAAC,EACfJ,OAAO,CAACK,GAAG,CAACC,MAAM,iBAAIZ,KAAA,CAAAU,aAAA;IAAKG,GAAG,EAAED,MAAM,CAACE;EAAO,GAAEF,MAAM,CAACG,SAAS,GAAGH,MAAM,CAACI,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAU,CAAC,CAAC,EACzGT,aAAa,iBACdP,KAAA,CAAAU,aAAA,CAACR,MAAM;IACLe,IAAI,EAAC,SAAS;IACdC,OAAO,EAAEA,CAAA,KAAMV,QAAQ,CAACC,cAAc;EAAE,GAEvCN,yBACK,CAEL,CAAC;AAEV;AAEAC,YAAY,CAACe,YAAY,GAAG;EAC1BZ,aAAa,EAAE,KAAK;EACpBC,QAAQ,EAAEA,CAAA,KAAM,CAAC;AACnB,CAAC;AAEDJ,YAAY,CAACgB,SAAS,GAAG;EACvBd,OAAO,EAAEL,SAAS,CAACoB,OAAO,CAACpB,SAAS,CAACqB,KAAK,CAAC;IACzCR,MAAM,EAAEb,SAAS,CAACsB,SAAS,CAAC,CAACtB,SAAS,CAACuB,WAAW,EAAEvB,SAAS,CAACwB,IAAI,CAAC,CAAC,CAACC,UAAU;IAC/EX,SAAS,EAAEd,SAAS,CAAC0B,IAAI;IACzBX,MAAM,EAAEf,SAAS,CAAC2B,IAAI,CAACF;EACzB,CAAC,CAAC,CAAC,CAACA,UAAU;EACdnB,aAAa,EAAEN,SAAS,CAAC0B,IAAI;EAC7BnB,QAAQ,EAAEP,SAAS,CAAC2B,IAAI;EACxBnB,cAAc,EAAER,SAAS,CAACoB,OAAO,CAACpB,SAAS,CAACqB,KAAK,CAAC,CAAC,CAAC,CAACI;AACvD,CAAC;AAED,eAAetB,YAAY"}
@@ -21,7 +21,7 @@ function TableFooter(_ref) {
21
21
  }
22
22
  TableFooter.propTypes = {
23
23
  /** Specifies the content of the `TableFooter` */
24
- children: PropTypes.oneOfType([PropTypes.func, PropTypes.node, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.node]))]),
24
+ children: PropTypes.node,
25
25
  /** Specifies class name to append to the base element. */
26
26
  className: PropTypes.string
27
27
  };
@@ -1 +1 @@
1
- {"version":3,"file":"TableFooter.js","names":["React","useContext","classNames","PropTypes","DataTableContext","RowStatusDefault","TablePagination","TablePaginationMinimal","TableFooter","_ref","className","children","RowStatusComponent","RowStatus","createElement","Fragment","propTypes","oneOfType","func","node","arrayOf","string","defaultProps","undefined"],"sources":["../../src/DataTable/TableFooter.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport DataTableContext from './DataTableContext';\nimport RowStatusDefault from './RowStatus';\nimport TablePagination from './TablePagination';\nimport TablePaginationMinimal from './TablePaginationMinimal';\n\nfunction TableFooter({ className, children }) {\n const { RowStatusComponent } = useContext(DataTableContext);\n const RowStatus = RowStatusComponent || RowStatusDefault;\n\n return (\n <div className={classNames(className, 'pgn__data-table-footer')} data-testid=\"table-footer\">\n {children || (\n <>\n <RowStatus />\n <TablePagination />\n <TablePaginationMinimal />\n </>\n )}\n </div>\n );\n}\n\nTableFooter.propTypes = {\n /** Specifies the content of the `TableFooter` */\n children: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.node,\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.node])),\n ]),\n /** Specifies class name to append to the base element. */\n className: PropTypes.string,\n};\n\nTableFooter.defaultProps = {\n children: null,\n className: undefined,\n};\n\nexport default TableFooter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,gBAAgB,MAAM,aAAa;AAC1C,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,OAAOC,sBAAsB,MAAM,0BAA0B;AAE7D,SAASC,WAAWA,CAAAC,IAAA,EAA0B;EAAA,IAAzB;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAAF,IAAA;EAC1C,MAAM;IAAEG;EAAmB,CAAC,GAAGX,UAAU,CAACG,gBAAgB,CAAC;EAC3D,MAAMS,SAAS,GAAGD,kBAAkB,IAAIP,gBAAgB;EAExD,oBACEL,KAAA,CAAAc,aAAA;IAAKJ,SAAS,EAAER,UAAU,CAACQ,SAAS,EAAE,wBAAwB,CAAE;IAAC,eAAY;EAAc,GACxFC,QAAQ,iBACPX,KAAA,CAAAc,aAAA,CAAAd,KAAA,CAAAe,QAAA,qBACEf,KAAA,CAAAc,aAAA,CAACD,SAAS,MAAE,CAAC,eACbb,KAAA,CAAAc,aAAA,CAACR,eAAe,MAAE,CAAC,eACnBN,KAAA,CAAAc,aAAA,CAACP,sBAAsB,MAAE,CACzB,CAED,CAAC;AAEV;AAEAC,WAAW,CAACQ,SAAS,GAAG;EACtB;EACAL,QAAQ,EAAER,SAAS,CAACc,SAAS,CAAC,CAC5Bd,SAAS,CAACe,IAAI,EACdf,SAAS,CAACgB,IAAI,EACdhB,SAAS,CAACiB,OAAO,CAACjB,SAAS,CAACc,SAAS,CAAC,CAACd,SAAS,CAACe,IAAI,EAAEf,SAAS,CAACgB,IAAI,CAAC,CAAC,CAAC,CACzE,CAAC;EACF;EACAT,SAAS,EAAEP,SAAS,CAACkB;AACvB,CAAC;AAEDb,WAAW,CAACc,YAAY,GAAG;EACzBX,QAAQ,EAAE,IAAI;EACdD,SAAS,EAAEa;AACb,CAAC;AAED,eAAef,WAAW"}
1
+ {"version":3,"file":"TableFooter.js","names":["React","useContext","classNames","PropTypes","DataTableContext","RowStatusDefault","TablePagination","TablePaginationMinimal","TableFooter","_ref","className","children","RowStatusComponent","RowStatus","createElement","Fragment","propTypes","node","string","defaultProps","undefined"],"sources":["../../src/DataTable/TableFooter.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport DataTableContext from './DataTableContext';\nimport RowStatusDefault from './RowStatus';\nimport TablePagination from './TablePagination';\nimport TablePaginationMinimal from './TablePaginationMinimal';\n\nfunction TableFooter({ className, children }) {\n const { RowStatusComponent } = useContext(DataTableContext);\n const RowStatus = RowStatusComponent || RowStatusDefault;\n\n return (\n <div className={classNames(className, 'pgn__data-table-footer')} data-testid=\"table-footer\">\n {children || (\n <>\n <RowStatus />\n <TablePagination />\n <TablePaginationMinimal />\n </>\n )}\n </div>\n );\n}\n\nTableFooter.propTypes = {\n /** Specifies the content of the `TableFooter` */\n children: PropTypes.node,\n /** Specifies class name to append to the base element. */\n className: PropTypes.string,\n};\n\nTableFooter.defaultProps = {\n children: null,\n className: undefined,\n};\n\nexport default TableFooter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,gBAAgB,MAAM,aAAa;AAC1C,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,OAAOC,sBAAsB,MAAM,0BAA0B;AAE7D,SAASC,WAAWA,CAAAC,IAAA,EAA0B;EAAA,IAAzB;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAAF,IAAA;EAC1C,MAAM;IAAEG;EAAmB,CAAC,GAAGX,UAAU,CAACG,gBAAgB,CAAC;EAC3D,MAAMS,SAAS,GAAGD,kBAAkB,IAAIP,gBAAgB;EAExD,oBACEL,KAAA,CAAAc,aAAA;IAAKJ,SAAS,EAAER,UAAU,CAACQ,SAAS,EAAE,wBAAwB,CAAE;IAAC,eAAY;EAAc,GACxFC,QAAQ,iBACPX,KAAA,CAAAc,aAAA,CAAAd,KAAA,CAAAe,QAAA,qBACEf,KAAA,CAAAc,aAAA,CAACD,SAAS,MAAE,CAAC,eACbb,KAAA,CAAAc,aAAA,CAACR,eAAe,MAAE,CAAC,eACnBN,KAAA,CAAAc,aAAA,CAACP,sBAAsB,MAAE,CACzB,CAED,CAAC;AAEV;AAEAC,WAAW,CAACQ,SAAS,GAAG;EACtB;EACAL,QAAQ,EAAER,SAAS,CAACc,IAAI;EACxB;EACAP,SAAS,EAAEP,SAAS,CAACe;AACvB,CAAC;AAEDV,WAAW,CAACW,YAAY,GAAG;EACzBR,QAAQ,EAAE,IAAI;EACdD,SAAS,EAAEU;AACb,CAAC;AAED,eAAeZ,WAAW"}
@@ -70,7 +70,7 @@ CheckboxFilter.propTypes = {
70
70
  */
71
71
  column: PropTypes.shape({
72
72
  setFilter: PropTypes.func.isRequired,
73
- Header: PropTypes.oneOfType([PropTypes.func, PropTypes.node]).isRequired,
73
+ Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,
74
74
  filterChoices: PropTypes.arrayOf(PropTypes.shape({
75
75
  name: PropTypes.string.isRequired,
76
76
  value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxFilter.js","names":["React","useRef","useMemo","PropTypes","Form","FormLabel","Badge","Stack","newId","CheckboxFilter","_ref","column","filterValue","setFilter","Header","filterChoices","getHeaderProps","ariaLabel","key","checkedBoxes","changeCheckbox","value","includes","newCheckedBoxes","filter","val","push","headerBasedId","createElement","Group","role","current","id","className","CheckboxSet","name","map","_ref2","number","Checkbox","checked","onChange","direction","gap","undefined","variant","propTypes","shape","func","isRequired","oneOfType","node","arrayOf","string"],"sources":["../../../src/DataTable/filters/CheckboxFilter.jsx"],"sourcesContent":["import React, { useRef, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport Form, { FormLabel } from '../../Form';\nimport Badge from '../../Badge';\nimport Stack from '../../Stack';\nimport { newId } from '../../utils';\n\nfunction CheckboxFilter({\n column: {\n filterValue, setFilter, Header, filterChoices, getHeaderProps,\n },\n}) {\n // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom\n const ariaLabel = useRef(newId(`checkbox-filter-label-${getHeaderProps().key}-`));\n\n const checkedBoxes = filterValue || [];\n const changeCheckbox = (value) => {\n if (checkedBoxes.includes(value)) {\n const newCheckedBoxes = checkedBoxes.filter((val) => val !== value);\n return setFilter(newCheckedBoxes);\n }\n checkedBoxes.push(value);\n return setFilter(checkedBoxes);\n };\n const headerBasedId = useMemo(() => `checkbox-filter-check-${getHeaderProps().key}-`, [getHeaderProps]);\n\n return (\n <Form.Group role=\"group\" aria-labelledby={ariaLabel.current}>\n <FormLabel id={ariaLabel.current} className=\"pgn__checkbox-filter-label\">{Header}</FormLabel>\n <Form.CheckboxSet name={Header}>\n {filterChoices.map(({ name, number, value }) => (\n <Form.Checkbox\n key={`${headerBasedId}${name}`}\n value={name}\n checked={checkedBoxes.includes(value)}\n onChange={() => changeCheckbox(value)}\n aria-label={name}\n >\n <Stack direction=\"horizontal\" gap={2}>\n {name} {number !== undefined && <Badge variant=\"light\">{number}</Badge>}\n </Stack>\n </Form.Checkbox>\n ))}\n </Form.CheckboxSet>\n </Form.Group>\n );\n}\n\nCheckboxFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `filterChoices`: Specifies array of choices.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n setFilter: PropTypes.func.isRequired,\n Header: PropTypes.oneOfType([PropTypes.func, PropTypes.node]).isRequired,\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n number: PropTypes.number,\n })).isRequired,\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.arrayOf(PropTypes.string),\n }).isRequired,\n};\n\nexport default CheckboxFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,OAAO,QAAQ,OAAO;AAC9C,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,IAAIC,SAAS,QAAQ,YAAY;AAC5C,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,KAAK,MAAM,aAAa;AAC/B,SAASC,KAAK,QAAQ,aAAa;AAE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AAU;IACzCrC,WAAW,EAAET,SAAS,CAACiD,OAAO,CAACjD,SAAS,CAACkD,MAAM;EACjD,CAAC,CAAC,CAACJ;AACL,CAAC;AAED,eAAexC,cAAc"}
1
+ {"version":3,"file":"CheckboxFilter.js","names":["React","useRef","useMemo","PropTypes","Form","FormLabel","Badge","Stack","newId","CheckboxFilter","_ref","column","filterValue","setFilter","Header","filterChoices","getHeaderProps","ariaLabel","key","checkedBoxes","changeCheckbox","value","includes","newCheckedBoxes","filter","val","push","headerBasedId","createElement","Group","role","current","id","className","CheckboxSet","name","map","_ref2","number","Checkbox","checked","onChange","direction","gap","undefined","variant","propTypes","shape","func","isRequired","oneOfType","elementType","node","arrayOf","string"],"sources":["../../../src/DataTable/filters/CheckboxFilter.jsx"],"sourcesContent":["import React, { useRef, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport Form, { FormLabel } from '../../Form';\nimport Badge from '../../Badge';\nimport Stack from '../../Stack';\nimport { newId } from '../../utils';\n\nfunction CheckboxFilter({\n column: {\n filterValue, setFilter, Header, filterChoices, getHeaderProps,\n },\n}) {\n // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom\n const ariaLabel = useRef(newId(`checkbox-filter-label-${getHeaderProps().key}-`));\n\n const checkedBoxes = filterValue || [];\n const changeCheckbox = (value) => {\n if (checkedBoxes.includes(value)) {\n const newCheckedBoxes = checkedBoxes.filter((val) => val !== value);\n return setFilter(newCheckedBoxes);\n }\n checkedBoxes.push(value);\n return setFilter(checkedBoxes);\n };\n const headerBasedId = useMemo(() => `checkbox-filter-check-${getHeaderProps().key}-`, [getHeaderProps]);\n\n return (\n <Form.Group role=\"group\" aria-labelledby={ariaLabel.current}>\n <FormLabel id={ariaLabel.current} className=\"pgn__checkbox-filter-label\">{Header}</FormLabel>\n <Form.CheckboxSet name={Header}>\n {filterChoices.map(({ name, number, value }) => (\n <Form.Checkbox\n key={`${headerBasedId}${name}`}\n value={name}\n checked={checkedBoxes.includes(value)}\n onChange={() => changeCheckbox(value)}\n aria-label={name}\n >\n <Stack direction=\"horizontal\" gap={2}>\n {name} {number !== undefined && <Badge variant=\"light\">{number}</Badge>}\n </Stack>\n </Form.Checkbox>\n ))}\n </Form.CheckboxSet>\n </Form.Group>\n );\n}\n\nCheckboxFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `filterChoices`: Specifies array of choices.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n setFilter: PropTypes.func.isRequired,\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n number: PropTypes.number,\n })).isRequired,\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.arrayOf(PropTypes.string),\n }).isRequired,\n};\n\nexport default CheckboxFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,OAAO,QAAQ,OAAO;AAC9C,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,IAAIC,SAAS,QAAQ,YAAY;AAC5C,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,KAAK,MAAM,aAAa;AAC/B,SAASC,KAAK,QAAQ,aAAa;AAEnC,SAASC,cAAcA,CAAAC,IAAA,EAIpB;EAAA,IAJqB;IACtBC,MAAM,EAAE;MACNC,WAAW;MAAEC,SAAS;MAAEC,MAAM;MAAEC,aAAa;MAAEC;IACjD;EACF,CAAC,GAAAN,IAAA;EACC;EACA,MAAMO,SAAS,GAAGhB,MAAM,CAACO,KAAK,CAAE,yBAAwBQ,cAAc,CAAC,CAAC,CAACE,GAAI,GAAE,CAAC,CAAC;EAEjF,MAAMC,YAAY,GAAGP,WAAW,IAAI,EAAE;EACtC,MAAM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AY;MAACC,GAAG,EAAE;IAAE,GAClCR,IAAI,EAAC,GAAC,EAACG,MAAM,KAAKM,SAAS,iBAAI5C,KAAA,CAAA4B,aAAA,CAACtB,KAAK;MAACuC,OAAO,EAAC;IAAO,GAAEP,MAAc,CACjE,CACM,CAAC;EAAA,CACjB,CACe,CACR,CAAC;AAEjB;AAEA7B,cAAc,CAACqC,SAAS,GAAG;EACzB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEnC,MAAM,EAAER,SAAS,CAAC4C,KAAK,CAAC;IACtBlC,SAAS,EAAEV,SAAS,CAAC6C,IAAI,CAACC,UAAU;IACpCnC,MAAM,EAAEX,SAAS,CAAC+C,SAAS,CAAC,CAAC/C,SAAS,CAACgD,WAAW,EAAEhD,SAAS,CAACiD,IAAI,CAAC,CAAC,CAACH,UAAU;IAC/ElC,aAAa,EAAEZ,SAAS,CAACkD,OAAO,CAAClD,SAAS,CAAC4C,KAAK,CAAC;MAC/CZ,IAAI,EAAEhC,SAAS,CAACmD,MAAM,CAACL,UAAU;MACjC5B,KAAK,EAAElB,SAAS,CAAC+C,SAAS,CAAC,CAAC/C,SAAS,CAACmD,MAAM,EAAEnD,SAAS,CAACmC,MAAM,CAAC,CAAC;MAChEA,MAAM,EAAEnC,SAAS,CAACmC;IACpB,CAAC,CAAC,CAAC,CAACW,UAAU;IACdjC,cAAc,EAAEb,SAAS,CAAC6C,IAAI,CAACC,UAAU;IACzCrC,WAAW,EAAET,SAAS,CAACkD,OAAO,CAAClD,SAAS,CAACmD,MAAM;EACjD,CAAC,CAAC,CAACL;AACL,CAAC;AAED,eAAexC,cAAc"}
@@ -57,7 +57,7 @@ DropdownFilter.propTypes = {
57
57
  */
58
58
  column: PropTypes.shape({
59
59
  setFilter: PropTypes.func.isRequired,
60
- Header: PropTypes.oneOfType([PropTypes.func, PropTypes.node]).isRequired,
60
+ Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,
61
61
  filterChoices: PropTypes.arrayOf(PropTypes.shape({
62
62
  name: PropTypes.string.isRequired,
63
63
  number: PropTypes.number,
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownFilter.js","names":["React","useRef","PropTypes","Form","newId","DEFAULT_VALUE","DropdownFilter","_ref","column","setFilter","Header","filterChoices","getHeaderProps","ariaLabel","key","onChange","e","target","value","undefined","createElement","Group","Label","id","current","className","Control","as","default","map","_ref2","name","number","propTypes","shape","func","isRequired","oneOfType","node","arrayOf","string"],"sources":["../../../src/DataTable/filters/DropdownFilter.jsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Form from '../../Form';\nimport { newId } from '../../utils';\n\nconst DEFAULT_VALUE = '';\n\nfunction DropdownFilter({\n column: {\n setFilter, Header, filterChoices, getHeaderProps,\n },\n}) {\n // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom\n const ariaLabel = useRef(newId(`dropdown-filter-label-${getHeaderProps().key}-`));\n const onChange = (e) => {\n if (e.target.value === DEFAULT_VALUE) {\n // setting undefined resets the filter\n return setFilter(undefined);\n }\n return setFilter(e.target.value);\n };\n\n return (\n <Form.Group>\n <Form.Label id={ariaLabel.current} className=\"sr-only\">{Header}</Form.Label>\n <Form.Control\n as=\"select\"\n default={DEFAULT_VALUE}\n onChange={onChange}\n aria-labelledby={ariaLabel.current}\n >\n <option value={DEFAULT_VALUE}>{Header}</option>\n {filterChoices.map(({ name, number, value }) => (<option key={value} value={value}>{name} {number && `(${number})`}</option>))}\n </Form.Control>\n </Form.Group>\n );\n}\n\nDropdownFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `filterChoices`: Specifies array of choices.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n */\n column: PropTypes.shape({\n setFilter: PropTypes.func.isRequired,\n Header: PropTypes.oneOfType([PropTypes.func, PropTypes.node]).isRequired,\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n number: PropTypes.number,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n })).isRequired,\n getHeaderProps: PropTypes.func.isRequired,\n }).isRequired,\n};\n\nexport default DropdownFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,MAAM,YAAY;AAC7B,SAASC,KAAK,QAAQ,aAAa;AAEnC,MAAMC,aAAa,GAAG,EAAE;AAExB,SAASC,cAAcA,CAAAC,IAAA,EAIpB;EAAA,IAJqB;IACtBC,MAAM,EAAE;MACNC,SAAS;MAAEC,MAAM;MAAEC,aAAa;MAAEC;IACpC;EACF,CAAC,GAAAL,IAAA;EACC;EACA,MAAMM,SAAS,GAAGZ,MAAM,CAACG,KAAK,CAAE,yBAAwBQ,cAAc,CAAC,CAAC,CAACE,GAAI,GAAE,CAAC,CAAC;EACjF,MAAMC,QAAQ,GAAIC,CAAC,IAAK;IACtB,IAAIA,CAAC,CAACC,MAAM,CAACC,KAAK,KAAKb,aAAa,EAAE;MACpC;MACA,OAAOI,SAAS,CAACU,SAAS,CAAC;IAC7B;IACA,OAAOV,SAAS,CAACO,CAAC,CAACC,MAAM,CAACC,KAAK,CAAC;EAClC,CAAC;EAED,oBACElB,KAAA,CAAAoB,aAAA,CAACjB,IAAI,CAACkB,KAAK,qBACTrB,KAAA,CAAAoB,aAAA,CAACjB,IAAI,CAACmB,KAAK;IAACC,EAAE,EAAEV,SAAS,CAACW,OAAQ;IAACC,SAAS,EAAC;EAAS,GAAEf,MAAmB,CAAC,eAC5EV,KAAA,CAAAoB,aAAA,CAACjB,IAAI,CAACuB,OAAO;IACXC,EAAE,EAAC,QAAQ;IACXC,OAAO,EAAEvB,aAAc;IACvBU,QAAQ,EAAEA,QAAS;IACnB,mBAAiBF,SAAS,CAACW;EAAQ,gBAEnCxB,KAAA,CAAAoB,aAAA;IAAQF,KAAK,EAAEb;EAAc,GAAEK,MAAe,CAAC,EAC9CC,aAAa,CAACkB,GAAG,CAACC,KAAA;IAAA,IAAC;MAAEC,IAAI;MAAEC,MAAM;MAAEd;IAAM,CAAC,GAAAY,KAAA;IAAA,oBAAM9B,KAAA,CAAAoB,aAAA;MAAQN,GAAG,EAAEI,KAAM;MAACA,KAAK,EAAEA;IAAM,GAAEa,IAAI,EAAC,GAAC,EAACC,MAAM,IAAK,IAAGA,MAAO,GAAW,CAAC;EAAA,CAAC,CACjH,CACJ,CAAC;AAEjB;AAEA1B,cAAc,CAAC2B,SAAS,GAAG;EACzB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEzB,MAAM,EAAEN,SAAS,CAACgC,KAAK,CAAC;IACtBzB,SAAS,EAAEP,SAAS,CAACiC,IAAI,CAACC,UAAU;IACpC1B,MAAM,EAAER,SAAS,CAACmC,SAAS,CAAC,CAACnC,SAAS,CAACiC,IAAI,EAAEjC,SAAS,CAACoC,IAAI,CAAC,CAAC,CAACF,UAAU;IACxEzB,aAAa,EAAET,SAAS,CAACqC,OAAO,CAACrC,SAAS,CAACgC,KAAK,CAAC;MAC/CH,IAAI,EAAE7B,SAAS,CAACsC,MAAM,CAACJ,UAAU;MACjCJ,MAAM,EAAE9B,SAAS,CAAC8B,MAAM;MACxBd,KAAK,EAAEhB,SAAS,CAACmC,SAAS,CAAC,CAACnC,SAAS,CAACsC,MAAM,EAAEtC,SAAS,CAAC8B,MAAM,CAAC,CAAC,CAACI;IACnE,CAAC,CAAC,CAAC,CAACA,UAAU;IACdxB,cAAc,EAAEV,SAAS,CAACiC,IAAI,CAACC;EACjC,CAAC,CAAC,CAACA;AACL,CAAC;AAED,eAAe9B,cAAc"}
1
+ {"version":3,"file":"DropdownFilter.js","names":["React","useRef","PropTypes","Form","newId","DEFAULT_VALUE","DropdownFilter","_ref","column","setFilter","Header","filterChoices","getHeaderProps","ariaLabel","key","onChange","e","target","value","undefined","createElement","Group","Label","id","current","className","Control","as","default","map","_ref2","name","number","propTypes","shape","func","isRequired","oneOfType","elementType","node","arrayOf","string"],"sources":["../../../src/DataTable/filters/DropdownFilter.jsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Form from '../../Form';\nimport { newId } from '../../utils';\n\nconst DEFAULT_VALUE = '';\n\nfunction DropdownFilter({\n column: {\n setFilter, Header, filterChoices, getHeaderProps,\n },\n}) {\n // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom\n const ariaLabel = useRef(newId(`dropdown-filter-label-${getHeaderProps().key}-`));\n const onChange = (e) => {\n if (e.target.value === DEFAULT_VALUE) {\n // setting undefined resets the filter\n return setFilter(undefined);\n }\n return setFilter(e.target.value);\n };\n\n return (\n <Form.Group>\n <Form.Label id={ariaLabel.current} className=\"sr-only\">{Header}</Form.Label>\n <Form.Control\n as=\"select\"\n default={DEFAULT_VALUE}\n onChange={onChange}\n aria-labelledby={ariaLabel.current}\n >\n <option value={DEFAULT_VALUE}>{Header}</option>\n {filterChoices.map(({ name, number, value }) => (<option key={value} value={value}>{name} {number && `(${number})`}</option>))}\n </Form.Control>\n </Form.Group>\n );\n}\n\nDropdownFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `filterChoices`: Specifies array of choices.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n */\n column: PropTypes.shape({\n setFilter: PropTypes.func.isRequired,\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n number: PropTypes.number,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n })).isRequired,\n getHeaderProps: PropTypes.func.isRequired,\n }).isRequired,\n};\n\nexport default DropdownFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,M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AG,EAAEI,KAAM;MAACA,KAAK,EAAEA;IAAM,GAAEa,IAAI,EAAC,GAAC,EAACC,MAAM,IAAK,IAAGA,MAAO,GAAW,CAAC;EAAA,CAAC,CACjH,CACJ,CAAC;AAEjB;AAEA1B,cAAc,CAAC2B,SAAS,GAAG;EACzB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEzB,MAAM,EAAEN,SAAS,CAACgC,KAAK,CAAC;IACtBzB,SAAS,EAAEP,SAAS,CAACiC,IAAI,CAACC,UAAU;IACpC1B,MAAM,EAAER,SAAS,CAACmC,SAAS,CAAC,CAACnC,SAAS,CAACoC,WAAW,EAAEpC,SAAS,CAACqC,IAAI,CAAC,CAAC,CAACH,UAAU;IAC/EzB,aAAa,EAAET,SAAS,CAACsC,OAAO,CAACtC,SAAS,CAACgC,KAAK,CAAC;MAC/CH,IAAI,EAAE7B,SAAS,CAACuC,MAAM,CAACL,UAAU;MACjCJ,MAAM,EAAE9B,SAAS,CAAC8B,MAAM;MACxBd,KAAK,EAAEhB,SAAS,CAACmC,SAAS,CAAC,CAACnC,SAAS,CAACuC,MAAM,EAAEvC,SAAS,CAAC8B,MAAM,CAAC,CAAC,CAACI;IACnE,CAAC,CAAC,CAAC,CAACA,UAAU;IACdxB,cAAc,EAAEV,SAAS,CAACiC,IAAI,CAACC;EACjC,CAAC,CAAC,CAACA;AACL,CAAC;AAED,eAAe9B,cAAc"}
@@ -72,7 +72,7 @@ MultiSelectDropdownFilter.propTypes = {
72
72
  /** Function to set the filter value */
73
73
  setFilter: PropTypes.func.isRequired,
74
74
  /** Column header used for labels and placeholders */
75
- Header: PropTypes.oneOfType([PropTypes.func, PropTypes.node]).isRequired,
75
+ Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,
76
76
  /** Names and values for the select options */
77
77
  filterChoices: PropTypes.arrayOf(PropTypes.shape({
78
78
  name: PropTypes.string.isRequired,
@@ -1 +1 @@
1
- {"version":3,"file":"MultiSelectDropdownFilter.js","names":["React","useRef","PropTypes","Badge","Stack","DropdownButton","newId","Form","MultiSelectDropdownFilter","_ref","column","setFilter","Header","filterChoices","getHeaderProps","filterValue","ariaLabel","key","checkedBoxes","changeCheckbox","value","includes","newCheckedBoxes","filter","val","push","createElement","variant","id","current","title","CheckboxSet","className","name","map","_ref2","number","Checkbox","checked","onChange","direction","gap","propTypes","shape","func","isRequired","oneOfType","node","arrayOf","string"],"sources":["../../../src/DataTable/filters/MultiSelectDropdownFilter.jsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Badge from '../../Badge';\nimport Stack from '../../Stack';\nimport { DropdownButton } from '../../Dropdown';\nimport { newId } from '../../utils';\nimport Form from '../../Form';\n\nfunction MultiSelectDropdownFilter({\n column: {\n setFilter, Header, filterChoices, getHeaderProps, filterValue,\n },\n}) {\n // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom\n const ariaLabel = useRef(newId(`multi-dropdown-filter-label-${getHeaderProps().key}-`));\n const checkedBoxes = filterValue || [];\n const changeCheckbox = (value) => {\n if (checkedBoxes.includes(value)) {\n const newCheckedBoxes = checkedBoxes.filter((val) => val !== value);\n return setFilter(newCheckedBoxes);\n }\n checkedBoxes.push(value);\n return setFilter(checkedBoxes);\n };\n\n return (\n <DropdownButton variant=\"outline-primary\" id={ariaLabel.current} title={Header}>\n <Form.CheckboxSet\n className=\"pgn__dropdown-filter-checkbox-group\"\n name={Header}\n aria-label={Header}\n >\n {filterChoices.map(({ name, number, value }) => (\n <Form.Checkbox\n key={name}\n value={name}\n checked={checkedBoxes.includes(value)}\n onChange={() => changeCheckbox(value)}\n aria-label={name}\n >\n <Stack direction=\"horizontal\" gap={2}>\n {name} {number && <Badge variant=\"light\">{number}</Badge>}\n </Stack>\n </Form.Checkbox>\n ))}\n </Form.CheckboxSet>\n </DropdownButton>\n );\n}\n\nMultiSelectDropdownFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `filterChoices`: Specifies array of choices.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n /** Function to set the filter value */\n setFilter: PropTypes.func.isRequired,\n /** Column header used for labels and placeholders */\n Header: PropTypes.oneOfType([PropTypes.func, PropTypes.node]).isRequired,\n /** Names and values for the select options */\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n number: PropTypes.number,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n })).isRequired,\n /** Generates a key unique to the column being filtered */\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.arrayOf(PropTypes.string),\n }).isRequired,\n};\n\nexport default MultiSelectDropdownFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,KAAK,MAAM,aAAa;AAC/B,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,KAAK,QAAQ,aAAa;AACnC,OAAOC,IAAI,MAAM,YAAY;AAE7B,SAASC,yBAAyBA,CAAAC,IAAA,EAI/B;EAAA,IAJgC;IACjCC,MAAM,EAAE;MACNC,SAAS;MAAEC,MAAM;MAAEC,aAAa;MAAEC,cAAc;MAAEC;IACpD;EACF,CAAC,GAAAN,IAAA;EACC;EACA,MAAMO,SAAS,GAAGf,MAAM,CAACK,KAAK,CAAE,+BAA8BQ,cAAc,CAAC,CAAC,CAACG,GAAI,GAAE,CAAC,CAAC;EACvF,MAAMC,YAAY,GAAGH,WAAW,IAAI,EAAE;EACtC,MAAMI,cAAc,GAAIC,KAAK,IAAK;IAChC,IAAIF,YAAY,CAACG,QAAQ,CAACD,KAAK,CAAC,EAAE;MAChC,MAAME,eAAe,GAAGJ,YAAY,CAACK,MAAM,CAA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hC,SAAS,EAAET,SAAS,CAAC0C,IAAI,CAACC,UAAU;IACpC;IACAjC,MAAM,EAAEV,SAAS,CAAC4C,SAAS,CAAC,CAAC5C,SAAS,CAAC0C,IAAI,EAAE1C,SAAS,CAAC6C,IAAI,CAAC,CAAC,CAACF,UAAU;IACxE;IACAhC,aAAa,EAAEX,SAAS,CAAC8C,OAAO,CAAC9C,SAAS,CAACyC,KAAK,CAAC;MAC/CV,IAAI,EAAE/B,SAAS,CAAC+C,MAAM,CAACJ,UAAU;MACjCT,MAAM,EAAElC,SAAS,CAACkC,MAAM;MACxBhB,KAAK,EAAElB,SAAS,CAAC4C,SAAS,CAAC,CAAC5C,SAAS,CAAC+C,MAAM,EAAE/C,SAAS,CAACkC,MAAM,CAAC,CAAC,CAACS;IACnE,CAAC,CAAC,CAAC,CAACA,UAAU;IACd;IACA/B,cAAc,EAAEZ,SAAS,CAAC0C,IAAI,CAACC,UAAU;IACzC9B,WAAW,EAAEb,SAAS,CAAC8C,OAAO,CAAC9C,SAAS,CAAC+C,MAAM;EACjD,CAAC,CAAC,CAACJ;AACL,CAAC;AAED,eAAerC,yBAAyB"}
1
+ {"version":3,"file":"MultiSelectDropdownFilter.js","names":["React","useRef","PropTypes","Badge","Stack","DropdownButton","newId","Form","MultiSelectDropdownFilter","_ref","column","setFilter","Header","filterChoices","getHeaderProps","filterValue","ariaLabel","key","checkedBoxes","changeCheckbox","value","includes","newCheckedBoxes","filter","val","push","createElement","variant","id","current","title","CheckboxSet","className","name","map","_ref2","number","Checkbox","checked","onChange","direction","gap","propTypes","shape","func","isRequired","oneOfType","elementType","node","arrayOf","string"],"sources":["../../../src/DataTable/filters/MultiSelectDropdownFilter.jsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Badge from '../../Badge';\nimport Stack from '../../Stack';\nimport { DropdownButton } from '../../Dropdown';\nimport { newId } from '../../utils';\nimport Form from '../../Form';\n\nfunction MultiSelectDropdownFilter({\n column: {\n setFilter, Header, filterChoices, getHeaderProps, filterValue,\n },\n}) {\n // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom\n const ariaLabel = useRef(newId(`multi-dropdown-filter-label-${getHeaderProps().key}-`));\n const checkedBoxes = filterValue || [];\n const changeCheckbox = (value) => {\n if (checkedBoxes.includes(value)) {\n const newCheckedBoxes = checkedBoxes.filter((val) => val !== value);\n return setFilter(newCheckedBoxes);\n }\n checkedBoxes.push(value);\n return setFilter(checkedBoxes);\n };\n\n return (\n <DropdownButton variant=\"outline-primary\" id={ariaLabel.current} title={Header}>\n <Form.CheckboxSet\n className=\"pgn__dropdown-filter-checkbox-group\"\n name={Header}\n aria-label={Header}\n >\n {filterChoices.map(({ name, number, value }) => (\n <Form.Checkbox\n key={name}\n value={name}\n checked={checkedBoxes.includes(value)}\n onChange={() => changeCheckbox(value)}\n aria-label={name}\n >\n <Stack direction=\"horizontal\" gap={2}>\n {name} {number && <Badge variant=\"light\">{number}</Badge>}\n </Stack>\n </Form.Checkbox>\n ))}\n </Form.CheckboxSet>\n </DropdownButton>\n );\n}\n\nMultiSelectDropdownFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `filterChoices`: Specifies array of choices.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n /** Function to set the filter value */\n setFilter: PropTypes.func.isRequired,\n /** Column header used for labels and placeholders */\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n /** Names and values for the select options */\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n number: PropTypes.number,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n })).isRequired,\n /** Generates a key unique to the column being filtered */\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.arrayOf(PropTypes.string),\n }).isRequired,\n};\n\n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AC,CAAC,CAACA,UAAU;IACd;IACA/B,cAAc,EAAEZ,SAAS,CAAC0C,IAAI,CAACC,UAAU;IACzC9B,WAAW,EAAEb,SAAS,CAAC+C,OAAO,CAAC/C,SAAS,CAACgD,MAAM;EACjD,CAAC,CAAC,CAACL;AACL,CAAC;AAED,eAAerC,yBAAyB"}
@@ -52,7 +52,7 @@ TextFilter.propTypes = {
52
52
  */
53
53
  column: PropTypes.shape({
54
54
  setFilter: PropTypes.func.isRequired,
55
- Header: PropTypes.oneOfType([PropTypes.func, PropTypes.node]).isRequired,
55
+ Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,
56
56
  getHeaderProps: PropTypes.func.isRequired,
57
57
  filterValue: PropTypes.string
58
58
  }).isRequired
@@ -1 +1 @@
1
- {"version":3,"file":"TextFilter.js","names":["React","useRef","PropTypes","Form","FormLabel","Input","newId","formatHeaderForLabel","header","toLowerCase","TextFilter","_ref","column","filterValue","setFilter","Header","getHeaderProps","ariaLabel","key","formattedHeader","inputText","isValidElement","createElement","Group","id","current","className","value","type","onChange","e","target","undefined","placeholder","propTypes","shape","func","isRequired","oneOfType","node","string"],"sources":["../../../src/DataTable/filters/TextFilter.jsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Form, { FormLabel } from '../../Form';\nimport Input from '../../Input';\nimport { newId } from '../../utils';\n\nconst formatHeaderForLabel = (header) => {\n if (typeof header === 'function') {\n return header();\n }\n if (typeof header === 'string') {\n return header.toLowerCase();\n }\n return header;\n};\n\nfunction TextFilter({\n column: {\n filterValue, setFilter, Header, getHeaderProps,\n },\n}) {\n const ariaLabel = useRef(newId(`text-filter-label-${getHeaderProps().key}-`));\n const formattedHeader = formatHeaderForLabel(Header);\n const inputText = React.isValidElement(formattedHeader) ? formattedHeader : `Search ${formattedHeader}`;\n return (\n <Form.Group>\n <FormLabel id={ariaLabel.current} className=\"sr-only\">{inputText}</FormLabel>\n <Input\n aria-labelledby={ariaLabel.current}\n value={filterValue || ''}\n type=\"text\"\n onChange={e => {\n setFilter(e.target.value || undefined); // Set undefined to remove the filter entirely\n }}\n placeholder={inputText}\n />\n </Form.Group>\n );\n}\n\nTextFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n setFilter: PropTypes.func.isRequired,\n Header: PropTypes.oneOfType([PropTypes.func, PropTypes.node]).isRequired,\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.string,\n }).isRequired,\n};\n\nexport default TextFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,IAAIC,SAAS,QAAQ,YAAY;AAC5C,OAAOC,KAAK,MAAM,aAAa;AAC/B,SAASC,KAAK,QAAQ,aAAa;AAEnC,MAAMC,oBAAoB,GAAIC,MAAM,IAAK;EACvC,IAAI,OAAOA,MAAM,KAAK,UAAU,EAAE;IAChC,OAAOA,MAAM,CAAC,CAAC;EACjB;EACA,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IAC9B,OAAOA,MAAM,CAACC,WAAW,CAAC,CAAC;EAC7B;EACA,OAAOD,MAAM;AACf,CAAC;AAED,SAASE,UAAUA,CAAAC,IAAA,EAIhB;EAAA,IAJiB;IAClBC,MAAM,EAAE;MACNC,WAAW;MAAEC,SAAS;MAAEC,MAAM;MAAEC;IAClC;EACF,CAAC,GAAAL,IAAA;EACC,MAAMM,SAAS,GAAGhB,MAAM,CAACK,KAAK,CAAE,qBAAoBU,cAAc,CAAC,CAAC,CAACE,GAAI,GAAE,CAAC,CAAC;EAC7E,MAAMC,eAAe,GAAGZ,oBAAoB,CAACQ,MAAM,CAAC;EACpD,MAAMK,SAAS,GAAG,aAAApB,KAAK,CAACqB,cAAc,CAACF,eAAe,CAAC,GAAGA,eAAe,GAAI,UAASA,eAAgB,EAAC;EACvG,oBACEnB,KAAA,CAAAsB,aAAA,CAACnB,IAAI,CAACoB,KAAK,qBACTvB,KAAA,CAAAsB,aAAA,CAAClB,SAAS;IAACoB,EAAE,EAAEP,SAAS,CAACQ,OAAQ;IAACC,SAAS,EAAC;EAAS,GAAEN,SAAqB,CAAC,eAC7EpB,KAAA,CAAAsB,aAAA,CAACjB,KAAK;IACJ,mBAAiBY,SAAS,CAACQ,OAAQ;IACnCE,KAAK,EAAEd,WAAW,IAAI,EAAG;IACzBe,IAAI,EAAC,MAAM;IACXC,QAAQ,EAAEC,CAAC,IAAI;MACbhB,SAAS,CAACgB,CAAC,CAACC,MAAM,CAACJ,KAAK,IAAIK,SAAS,CAAC,CAAC,CAAC;IAC1C,CAAE;;IACFC,WAAW,EAAEb;EAAU,CACxB,CACS,CAAC;AAEjB;AAEAV,UAAU,CAACwB,SAAS,GAAG;EACrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEtB,MAAM,EAAEV,SAAS,CAACiC,KAAK,CAAC;IACtBrB,SAAS,EAAEZ,SAAS,CAACkC,IAAI,CAACC,UAAU;IACpCtB,MAAM,EAAEb,SAAS,CAACoC,SAAS,CAAC,CAACpC,SAAS,CAACkC,IAAI,EAAElC,SAAS,CAACqC,IAAI,CAAC,CAAC,CAACF,UAAU;IACxErB,cAAc,EAAEd,SAAS,CAACkC,IAAI,CAACC,UAAU;IACzCxB,WAAW,EAAEX,SAAS,CAACsC;EACzB,CAAC,CAAC,CAACH;AACL,CAAC;AAED,eAAe3B,UAAU"}
1
+ {"version":3,"file":"TextFilter.js","names":["React","useRef","PropTypes","Form","FormLabel","Input","newId","formatHeaderForLabel","header","toLowerCase","TextFilter","_ref","column","filterValue","setFilter","Header","getHeaderProps","ariaLabel","key","formattedHeader","inputText","isValidElement","createElement","Group","id","current","className","value","type","onChange","e","target","undefined","placeholder","propTypes","shape","func","isRequired","oneOfType","elementType","node","string"],"sources":["../../../src/DataTable/filters/TextFilter.jsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Form, { FormLabel } from '../../Form';\nimport Input from '../../Input';\nimport { newId } from '../../utils';\n\nconst formatHeaderForLabel = (header) => {\n if (typeof header === 'function') {\n return header();\n }\n if (typeof header === 'string') {\n return header.toLowerCase();\n }\n return header;\n};\n\nfunction TextFilter({\n column: {\n filterValue, setFilter, Header, getHeaderProps,\n },\n}) {\n const ariaLabel = useRef(newId(`text-filter-label-${getHeaderProps().key}-`));\n const formattedHeader = formatHeaderForLabel(Header);\n const inputText = React.isValidElement(formattedHeader) ? formattedHeader : `Search ${formattedHeader}`;\n return (\n <Form.Group>\n <FormLabel id={ariaLabel.current} className=\"sr-only\">{inputText}</FormLabel>\n <Input\n aria-labelledby={ariaLabel.current}\n value={filterValue || ''}\n type=\"text\"\n onChange={e => {\n setFilter(e.target.value || undefined); // Set undefined to remove the filter entirely\n }}\n placeholder={inputText}\n />\n </Form.Group>\n );\n}\n\nTextFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n setFilter: PropTypes.func.isRequired,\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.string,\n }).isRequired,\n};\n\nexport default TextFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,IAAIC,SAAS,QAAQ,YAAY;AAC5C,OAAOC,KAAK,MAAM,aAAa;AAC/B,SAASC,KAAK,QAAQ,aAAa;AAEnC,MAAMC,oBAAoB,GAAIC,MA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EACEtB,MAAM,EAAEV,SAAS,CAACiC,KAAK,CAAC;IACtBrB,SAAS,EAAEZ,SAAS,CAACkC,IAAI,CAACC,UAAU;IACpCtB,MAAM,EAAEb,SAAS,CAACoC,SAAS,CAAC,CAACpC,SAAS,CAACqC,WAAW,EAAErC,SAAS,CAACsC,IAAI,CAAC,CAAC,CAACH,UAAU;IAC/ErB,cAAc,EAAEd,SAAS,CAACkC,IAAI,CAACC,UAAU;IACzCxB,WAAW,EAAEX,SAAS,CAACuC;EACzB,CAAC,CAAC,CAACJ;AACL,CAAC;AAED,eAAe3B,UAAU"}
@@ -264,13 +264,13 @@ DataTable.propTypes = {
264
264
  /** Definition of table columns */
265
265
  columns: PropTypes.arrayOf(PropTypes.shape({
266
266
  /** User visible column name */
267
- Header: PropTypes.oneOfType([PropTypes.func, PropTypes.node]).isRequired,
267
+ Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,
268
268
  /** String used to access the correct cell data for this column */
269
269
  accessor: requiredWhenNot(PropTypes.string, 'Cell'),
270
270
  /** Specifies a function that receives `row` as argument and returns cell content */
271
- Cell: PropTypes.oneOfType([PropTypes.func, PropTypes.element]),
271
+ Cell: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]),
272
272
  /** Specifies filter component */
273
- Filter: PropTypes.func,
273
+ Filter: PropTypes.elementType,
274
274
  /** Specifies filter type */
275
275
  filter: PropTypes.string,
276
276
  /** Specifies filter choices */
@@ -287,8 +287,8 @@ DataTable.propTypes = {
287
287
  /** Alternate column for selecting rows. See react table useSort docs for more information */
288
288
  manualSelectColumn: PropTypes.shape({
289
289
  id: PropTypes.string.isRequired,
290
- Header: PropTypes.oneOfType([PropTypes.func, PropTypes.node]).isRequired,
291
- Cell: PropTypes.func.isRequired,
290
+ Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,
291
+ Cell: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]),
292
292
  disableSortBy: PropTypes.bool.isRequired
293
293
  }),
294
294
  /** Table columns can be sorted */
@@ -308,16 +308,16 @@ DataTable.propTypes = {
308
308
  /** defaults that will be set on each column. Will be overridden by individual column values */
309
309
  defaultColumnValues: PropTypes.shape({
310
310
  /** A default filter component for the column */
311
- Filter: PropTypes.oneOfType([PropTypes.func, PropTypes.node])
311
+ Filter: PropTypes.elementType
312
312
  }),
313
313
  /** Actions or other additional non-data columns can be added here */
314
314
  additionalColumns: PropTypes.arrayOf(PropTypes.shape({
315
315
  /** id must be unique from other columns ids */
316
316
  id: PropTypes.string.isRequired,
317
317
  /** column header that will be displayed to the user */
318
- Header: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
318
+ Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]),
319
319
  /** Component that renders in the added column. It will receive the row as a prop */
320
- Cell: PropTypes.oneOfType([PropTypes.func, PropTypes.node])
320
+ Cell: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node])
321
321
  })),
322
322
  /** Function that will fetch table data. Called when page size, page index or filters change.
323
323
  * Meant to be used with manual filters and pagination */
@@ -374,15 +374,15 @@ DataTable.propTypes = {
374
374
  /** Number between one and four filters that can be shown on the top row. */
375
375
  numBreakoutFilters: PropTypes.oneOf([1, 2, 3, 4]),
376
376
  /** Component to be displayed when the table is empty */
377
- EmptyTableComponent: PropTypes.func,
377
+ EmptyTableComponent: PropTypes.elementType,
378
378
  /** Component to be displayed for row status, ie, 10 of 20 rows. Displayed by default in the TableControlBar */
379
- RowStatusComponent: PropTypes.func,
379
+ RowStatusComponent: PropTypes.elementType,
380
380
  /** Component to be displayed for selection status. Displayed when there are selected rows and no active filters */
381
- SelectionStatusComponent: PropTypes.func,
381
+ SelectionStatusComponent: PropTypes.elementType,
382
382
  /** Component to be displayed for filter status. Displayed when there are active filters. */
383
- FilterStatusComponent: PropTypes.func,
383
+ FilterStatusComponent: PropTypes.elementType,
384
384
  /** If children are not provided a table with control bar and footer will be rendered */
385
- children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
385
+ children: PropTypes.node,
386
386
  /** If true filters will be shown on sidebar instead */
387
387
  showFiltersInSidebar: PropTypes.bool,
388
388
  /** options for data view toggle */
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useEffect","useMemo","useReducer","PropTypes","useTable","useMountedLayoutEffect","classNames","Table","getVisibleColumns","requiredWhen","requiredWhenNot","getTableArgs","TableControlBar","EmptyTableContent","TableFooter","BulkActions","DropdownFilters","FilterStatus","RowStatus","SelectionStatus","ControlledSelectionStatus","SmartStatus","TableFilters","TableHeaderCell","TableCell","TableHeaderRow","TablePagination","TablePaginationMinimal","DataTableContext","TableActions","ControlledSelect","ControlledSelectHeader","DataTableLayout","ExpandAll","ExpandRow","useSelectionActions","selectionsReducer","initialState","initialSelectionsState","DataTable","_ref","columns","data","defaultColumnValues","additionalColumns","isSelectable","isPaginated","manualPagination","pageCount","itemCount","isFilterable","manualFilters","fetchData","isSortable","manualSortBy","isExpandable","renderRowSubComponent","bulkActions","tableActions","numBreakoutFilters","initialTableOptions","EmptyTableComponent","manualSelectColumn","showFiltersInSidebar","dataViewToggleOptions","disableElevation","isLoading","children","onSelectedRowsChanged","maxSelectedRows","onMaxSelectedRows","props","_objectWithoutProperties","_excluded","defaultColumn","tableOptions","updatedTableOptions","_objectSpread","stateReducer","newState","action","previousState","type","value","selectedRowIds","rowIndex","parseInt","id","selectedRowsOrdered","newSelectedRowsOrdered","filter","item","selections","selectionsDispatch","tableArgs","push","hooks","visibleColumns","selectionProps","selectedRows","length","selectedRowsById","forEach","row","useControlledState","state","selectedFlatRows","controlledTableSelections","instance","pageSize","tableStatePageSize","pageIndex","tableStatePageIndex","sortBy","tableStateSortBy","filters","tableStateFilters","tableStateSelectedRowIds","selectionActions","enhancedInstance","createElement","Provider","className","Fragment","content","defaultProps","undefined","SelectionStatusComponent","FilterStatusComponent","RowStatusComponent","isDataViewToggleEnabled","onDataViewToggle","defaultActiveStateValue","togglePlacement","propTypes","arrayOf","shape","Header","oneOfType","func","node","isRequired","accessor","string","Cell","element","Filter","filterChoices","name","number","bool","disableSortBy","buttonText","handleClick","variant","disabled","oneOf","EmptyTable"],"sources":["../../src/DataTable/index.jsx"],"sourcesContent":["import React, {\n useEffect, useMemo, useReducer,\n} from 'react';\nimport PropTypes from 'prop-types';\nimport { useTable, useMountedLayoutEffect } from 'react-table';\n\nimport classNames from 'classnames';\nimport Table from './Table';\nimport getVisibleColumns from './utils/getVisibleColumns';\nimport { requiredWhen, requiredWhenNot } from '../utils/propTypes';\nimport getTableArgs from './utils/getTableArgs';\nimport TableControlBar from './TableControlBar';\nimport EmptyTableContent from './EmptyTable';\nimport TableFooter from './TableFooter';\nimport BulkActions from './BulkActions';\nimport DropdownFilters from './DropdownFilters';\nimport FilterStatus from './FilterStatus';\nimport RowStatus from './RowStatus';\nimport SelectionStatus from './selection/SelectionStatus';\nimport ControlledSelectionStatus from './selection/ControlledSelectionStatus';\nimport SmartStatus from './SmartStatus';\nimport TableFilters from './TableFilters';\nimport TableHeaderCell from './TableHeaderCell';\nimport TableCell from './TableCell';\nimport TableHeaderRow from './TableHeaderRow';\nimport TablePagination from './TablePagination';\nimport TablePaginationMinimal from './TablePaginationMinimal';\nimport DataTableContext from './DataTableContext';\nimport TableActions from './TableActions';\nimport ControlledSelect from './selection/ControlledSelect';\nimport ControlledSelectHeader from './selection/ControlledSelectHeader';\nimport DataTableLayout from './DataTableLayout';\nimport ExpandAll from './ExpandAll';\nimport ExpandRow from './ExpandRow';\n\nimport { useSelectionActions } from './hooks';\nimport selectionsReducer, { initialState as initialSelectionsState } from './selection/data/reducer';\n\nfunction DataTable({\n columns, data, defaultColumnValues, additionalColumns, isSelectable,\n isPaginated, manualPagination, pageCount, itemCount,\n isFilterable, manualFilters, fetchData, initialState,\n isSortable, manualSortBy,\n isExpandable, renderRowSubComponent,\n bulkActions, tableActions, numBreakoutFilters,\n initialTableOptions,\n EmptyTableComponent,\n manualSelectColumn,\n showFiltersInSidebar,\n dataViewToggleOptions,\n disableElevation,\n isLoading,\n children,\n onSelectedRowsChanged,\n maxSelectedRows,\n onMaxSelectedRows,\n ...props\n}) {\n const defaultColumn = useMemo(\n () => (defaultColumnValues),\n [defaultColumnValues],\n );\n const tableOptions = useMemo(() => {\n const updatedTableOptions = {\n stateReducer: (newState, action, previousState) => {\n switch (action.type) {\n // Note: we override the `toggleAllRowsSelected` action\n // from react-table because it only clears the selections on the\n // currently visible page; it does not clear the `selectedRowIds`\n // as we would expect for selections on different pages. Instead, we\n // force `selectedRowIds` to be cleared when `toggleAllRowsSelected(false)`\n // is called.\n case 'toggleAllRowsSelected': {\n if (action.value) {\n return newState;\n }\n return {\n ...newState,\n selectedRowIds: {},\n };\n }\n /* Note: We override the `toggleRowSelected` action from react-table\n because we need to preserve the order of the selected rows.\n While `selectedRowIds` is an object that contains the selected rows as key-value pairs,\n it does not maintain the order of selection. Therefore, we have added the `selectedRowsOrdered` property\n to keep track of the order in which the rows were selected.\n */\n case 'toggleRowSelected': {\n const rowIndex = parseInt(action.id, 10);\n const { selectedRowsOrdered = [] } = previousState;\n\n let newSelectedRowsOrdered;\n if (action.value) {\n newSelectedRowsOrdered = [...selectedRowsOrdered, rowIndex];\n } else {\n newSelectedRowsOrdered = selectedRowsOrdered.filter((item) => item !== rowIndex);\n }\n\n return {\n ...newState,\n selectedRowsOrdered: newSelectedRowsOrdered,\n };\n }\n default:\n return newState;\n }\n },\n ...initialTableOptions,\n };\n return {\n columns,\n data,\n defaultColumn,\n manualFilters,\n manualPagination,\n manualSortBy,\n initialState,\n ...updatedTableOptions,\n };\n }, [initialTableOptions, columns, data, defaultColumn, manualFilters, manualPagination, manualSortBy, initialState]);\n\n const [selections, selectionsDispatch] = useReducer(selectionsReducer, initialSelectionsState);\n\n if (isPaginated && manualPagination) {\n // pageCount is required when pagination is manual, if it's not there passing -1 as per react-table docs\n tableOptions.pageCount = pageCount || -1;\n }\n\n // NB: Table args *must* be in a particular order\n const tableArgs = getTableArgs({\n tableOptions, isFilterable, isSelectable, isPaginated, isSortable, isExpandable,\n });\n // adds selection column and action columns as necessary\n tableArgs.push(hooks => {\n hooks.visibleColumns.push(\n visibleColumns => getVisibleColumns(isSelectable, visibleColumns, additionalColumns, manualSelectColumn),\n );\n });\n\n // Pass any controlled selections from context to the appropriate ``useTable`` arguments to maintain\n // correct selection states on rows, both from a data perspective and in the UI.\n const selectionProps = {};\n const { selectedRows } = selections;\n if (selectedRows.length > 0) {\n const selectedRowsById = {};\n selectedRows.forEach((row) => {\n selectedRowsById[row.id] = true;\n });\n tableArgs.push(hooks => {\n hooks.useControlledState.push(\n (state) => ({ ...state, selectedRowIds: selectedRowsById }),\n );\n });\n selectionProps.selectedFlatRows = selectedRows;\n }\n const controlledTableSelections = [selections, selectionsDispatch];\n\n // Use the state and functions returned from useTable to build your UI\n const instance = useTable(...tableArgs);\n\n const {\n pageSize: tableStatePageSize,\n pageIndex: tableStatePageIndex,\n sortBy: tableStateSortBy,\n filters: tableStateFilters,\n selectedRowIds: tableStateSelectedRowIds,\n } = instance.state;\n\n useEffect(() => {\n if (fetchData) {\n fetchData({\n pageSize: tableStatePageSize,\n pageIndex: tableStatePageIndex,\n sortBy: tableStateSortBy,\n filters: tableStateFilters,\n });\n }\n }, [fetchData, tableStatePageSize, tableStatePageIndex, tableStateSortBy, tableStateFilters]);\n\n useMountedLayoutEffect(() => {\n if (onSelectedRowsChanged) {\n onSelectedRowsChanged(tableStateSelectedRowIds);\n }\n }, [tableStateSelectedRowIds, onSelectedRowsChanged]);\n\n const selectionActions = useSelectionActions(instance, controlledTableSelections);\n\n const enhancedInstance = {\n ...instance,\n itemCount,\n numBreakoutFilters,\n bulkActions,\n tableActions,\n controlledTableSelections,\n showFiltersInSidebar,\n dataViewToggleOptions,\n renderRowSubComponent,\n disableElevation,\n isLoading,\n isSelectable,\n isPaginated,\n manualSelectColumn,\n maxSelectedRows,\n onMaxSelectedRows,\n ...selectionProps,\n ...selectionActions,\n ...props,\n };\n\n return (\n <DataTableContext.Provider value={enhancedInstance}>\n <DataTableLayout>\n <div className={classNames('pgn__data-table-wrapper', {\n 'hide-shadow': !!disableElevation,\n })}\n >\n {children || (\n <>\n <TableControlBar />\n <Table />\n <EmptyTableComponent content=\"No results found\" />\n <TableFooter />\n </>\n )}\n </div>\n </DataTableLayout>\n </DataTableContext.Provider>\n );\n}\n\nDataTable.defaultProps = {\n additionalColumns: [],\n defaultColumnValues: {},\n isFilterable: false,\n isPaginated: false,\n isSelectable: false,\n isSortable: false,\n manualFilters: false,\n manualPagination: false,\n manualSortBy: false,\n fetchData: null,\n initialState: {},\n initialTableOptions: {},\n EmptyTableComponent: EmptyTableContent,\n children: null,\n bulkActions: [],\n tableActions: [],\n numBreakoutFilters: 1,\n manualSelectColumn: undefined,\n SelectionStatusComponent: SelectionStatus,\n FilterStatusComponent: FilterStatus,\n RowStatusComponent: RowStatus,\n showFiltersInSidebar: false,\n dataViewToggleOptions: {\n isDataViewToggleEnabled: false,\n onDataViewToggle: () => {},\n defaultActiveStateValue: 'card',\n togglePlacement: 'left',\n },\n disableElevation: false,\n renderRowSubComponent: undefined,\n isExpandable: false,\n isLoading: false,\n onSelectedRowsChanged: undefined,\n maxSelectedRows: undefined,\n onMaxSelectedRows: undefined,\n};\n\nDataTable.propTypes = {\n /** Definition of table columns */\n columns: PropTypes.arrayOf(PropTypes.shape({\n /** User visible column name */\n Header: PropTypes.oneOfType([PropTypes.func, PropTypes.node]).isRequired,\n /** String used to access the correct cell data for this column */\n accessor: requiredWhenNot(PropTypes.string, 'Cell'),\n /** Specifies a function that receives `row` as argument and returns cell content */\n Cell: PropTypes.oneOfType([PropTypes.func, PropTypes.element]),\n /** Specifies filter component */\n Filter: PropTypes.func,\n /** Specifies filter type */\n filter: PropTypes.string,\n /** Specifies filter choices */\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string,\n number: PropTypes.number,\n value: PropTypes.string,\n })),\n })).isRequired,\n /** Data to be displayed in the table */\n data: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n /** table rows can be selected */\n isSelectable: PropTypes.bool,\n /** Alternate column for selecting rows. See react table useSort docs for more information */\n manualSelectColumn: PropTypes.shape({\n id: PropTypes.string.isRequired,\n Header: PropTypes.oneOfType([PropTypes.func, PropTypes.node]).isRequired,\n Cell: PropTypes.func.isRequired,\n disableSortBy: PropTypes.bool.isRequired,\n }),\n /** Table columns can be sorted */\n isSortable: PropTypes.bool,\n /** Indicates that sorting will be done via backend API. A fetchData function must be provided */\n manualSortBy: PropTypes.bool,\n /** Paginate the table */\n isPaginated: PropTypes.bool,\n /** Indicates that pagination will be done manually. A fetchData function must be provided */\n manualPagination: PropTypes.bool,\n // eslint-disable-next-line react/require-default-props\n pageCount: requiredWhen(PropTypes.number, 'manualPagination'),\n /** Table rows can be filtered, using a default filter in the default column values, or in the column definition */\n isFilterable: PropTypes.bool,\n /** Indicates that filtering will be done via a backend API. A fetchData function must be provided */\n manualFilters: PropTypes.bool,\n\n /** defaults that will be set on each column. Will be overridden by individual column values */\n defaultColumnValues: PropTypes.shape({\n /** A default filter component for the column */\n Filter: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n }),\n /** Actions or other additional non-data columns can be added here */\n additionalColumns: PropTypes.arrayOf(PropTypes.shape({\n /** id must be unique from other columns ids */\n id: PropTypes.string.isRequired,\n /** column header that will be displayed to the user */\n Header: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n /** Component that renders in the added column. It will receive the row as a prop */\n Cell: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n })),\n /** Function that will fetch table data. Called when page size, page index or filters change.\n * Meant to be used with manual filters and pagination */\n fetchData: PropTypes.func,\n /** Initial state passed to react-table's documentation https://react-table.tanstack.com/docs/api/useTable */\n initialState: PropTypes.shape({\n pageSize: requiredWhen(PropTypes.number, 'isPaginated'),\n pageIndex: requiredWhen(PropTypes.number, 'isPaginated'),\n filters: requiredWhen(PropTypes.arrayOf(PropTypes.shape()), 'manualFilters'),\n sortBy: requiredWhen(PropTypes.arrayOf(PropTypes.shape()), 'manualSortBy'),\n selectedRowIds: PropTypes.shape(),\n selectedRowsOrdered: PropTypes.arrayOf(PropTypes.number),\n }),\n /** Table options passed to react-table's useTable hook. Will override some options passed in to DataTable, such\n as: data, columns, defaultColumn, manualFilters, manualPagination, manualSortBy, and initialState */\n initialTableOptions: PropTypes.shape({}),\n /** Actions to be performed on the table. Called with the table instance. Not displayed if rows are selected. */\n itemCount: PropTypes.number.isRequired,\n /** Actions to be performed on selected rows of the table. Called with the selected rows.\n * Only displayed if rows are selected. */\n bulkActions: PropTypes.oneOfType([\n PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n /** Bulk action button text */\n buttonText: PropTypes.string.isRequired,\n /** handleClick will be passed the selected rows */\n handleClick: PropTypes.func.isRequired,\n /** classnames for button class */\n className: PropTypes.string,\n /** optional button variant; only relevant for the first two buttons */\n variant: PropTypes.string,\n /** disables button */\n disabled: PropTypes.bool,\n }),\n /** function passed selected items, should return action object */\n PropTypes.func,\n /** A custom component representing an action */\n PropTypes.element,\n ]),\n ),\n /** Function for rendering custom components */\n PropTypes.func,\n /** A custom component representing an action */\n PropTypes.element,\n ]),\n /** Function for rendering custom components, called with the table instance */\n tableActions: PropTypes.oneOfType([\n PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n /** Bulk action button text */\n buttonText: PropTypes.string.isRequired,\n /** handleClick will be passed the selected rows */\n handleClick: PropTypes.func.isRequired,\n /** classnames for button class */\n className: PropTypes.string,\n /** optional button variant; only relevant for the first two buttons */\n variant: PropTypes.string,\n /** disables button */\n disabled: PropTypes.bool,\n }),\n /** function passed table instance, should return action object */\n PropTypes.func,\n /** A custom component representing an action */\n PropTypes.element,\n ]),\n ),\n /** Function for rendering custom components */\n PropTypes.func,\n /** A custom component representing an action */\n PropTypes.element,\n ]),\n /** Number between one and four filters that can be shown on the top row. */\n numBreakoutFilters: PropTypes.oneOf([1, 2, 3, 4]),\n /** Component to be displayed when the table is empty */\n EmptyTableComponent: PropTypes.func,\n /** Component to be displayed for row status, ie, 10 of 20 rows. Displayed by default in the TableControlBar */\n RowStatusComponent: PropTypes.func,\n /** Component to be displayed for selection status. Displayed when there are selected rows and no active filters */\n SelectionStatusComponent: PropTypes.func,\n /** Component to be displayed for filter status. Displayed when there are active filters. */\n FilterStatusComponent: PropTypes.func,\n /** If children are not provided a table with control bar and footer will be rendered */\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n /** If true filters will be shown on sidebar instead */\n showFiltersInSidebar: PropTypes.bool,\n /** options for data view toggle */\n dataViewToggleOptions: PropTypes.shape({\n /** Whether to show a toggle button group which allows view switching between card and table views */\n isDataViewToggleEnabled: PropTypes.bool,\n /** Callback invoked when the toggle buttons are clicked, with value of selected button passed in */\n onDataViewToggle: PropTypes.func,\n /** default value for toggle active state */\n defaultActiveStateValue: PropTypes.string,\n /** placement of toggle 'bottom' will push it to the bottom row in\n * actions section. Only 'left' and 'bottom' are supported */\n togglePlacement: PropTypes.string,\n }),\n /** Remove the default box shadow on the component */\n disableElevation: PropTypes.bool,\n /** A function that will render contents of expanded row, accepts `row` as a prop. */\n renderRowSubComponent: PropTypes.func,\n /** Indicates whether table supports expandable rows. */\n isExpandable: PropTypes.bool,\n /** Indicates whether the table should show loading states. */\n isLoading: PropTypes.bool,\n /** Callback function called when row selections change. */\n onSelectedRowsChanged: PropTypes.func,\n /** Indicates the max of rows selectable in the table. Requires isSelectable prop */\n maxSelectedRows: PropTypes.number,\n /** Callback after selected max rows. Requires isSelectable and maxSelectedRows props */\n onMaxSelectedRows: PropTypes.func,\n};\n\nDataTable.BulkActions = BulkActions;\nDataTable.EmptyTable = EmptyTableContent;\nDataTable.DropdownFilters = DropdownFilters;\nDataTable.FilterStatus = FilterStatus;\nDataTable.RowStatus = RowStatus;\nDataTable.SelectionStatus = SelectionStatus;\nDataTable.SmartStatus = SmartStatus;\nDataTable.Table = Table;\nDataTable.TableCell = TableCell;\nDataTable.TableControlBar = TableControlBar;\nDataTable.TableFilters = TableFilters;\nDataTable.TableFooter = TableFooter;\nDataTable.TableHeaderCell = TableHeaderCell;\nDataTable.TableHeaderRow = TableHeaderRow;\nDataTable.TablePagination = TablePagination;\nDataTable.TablePaginationMinimal = TablePaginationMinimal;\nDataTable.TableActions = TableActions;\nDataTable.ControlledSelectionStatus = ControlledSelectionStatus;\nDataTable.ControlledSelect = ControlledSelect;\nDataTable.ControlledSelectHeader = ControlledSelectHeader;\nDataTable.ExpandAll = ExpandAll;\nDataTable.ExpandRow = ExpandRow;\n\nexport default DataTable;\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,IACVC,SAAS,EAAEC,OAAO,EAAEC,UAAU,QACzB,OAAO;AACd,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,QAAQ,EAAEC,sBAAsB,QAAQ,aAAa;AAE9D,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,SAAS;AAC3B,OAAOC,iBAAiB,MAAM,2BAA2B;AACzD,SAASC,YAAY,EAAEC,eAAe,QAAQ,oBAAoB;AAClE,OAAOC,YAAY,MAAM,sBAAsB;AAC/C,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,OAAOC,iBAAiB,MAAM,cAAc;AAC5C,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,SAAS,MAAM,aAAa;AACnC,OAAOC,eAAe,MAAM,6BAA6B;AACzD,OAAOC,yBAAyB,MAAM,uCAAuC;AAC7E,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,OAAOC,SAAS,MAAM,aAAa;AACnC,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,eAA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SAAS,CAACnB,yBAAyB,GAAGA,yBAAyB;AAC/DmB,SAAS,CAACT,gBAAgB,GAAGA,gBAAgB;AAC7CS,SAAS,CAACR,sBAAsB,GAAGA,sBAAsB;AACzDQ,SAAS,CAACN,SAAS,GAAGA,SAAS;AAC/BM,SAAS,CAACL,SAAS,GAAGA,SAAS;AAE/B,eAAeK,SAAS"}
1
+ {"version":3,"file":"index.js","names":["React","useEffect","useMemo","useReducer","PropTypes","useTable","useMountedLayoutEffect","classNames","Table","getVisibleColumns","requiredWhen","requiredWhenNot","getTableArgs","TableControlBar","EmptyTableContent","TableFooter","BulkActions","DropdownFilters","FilterStatus","RowStatus","SelectionStatus","ControlledSelectionStatus","SmartStatus","TableFilters","TableHeaderCell","TableCell","TableHeaderRow","TablePagination","TablePaginationMinimal","DataTableContext","TableActions","ControlledSelect","ControlledSelectHeader","DataTableLayout","ExpandAll","ExpandRow","useSelectionActions","selectionsReducer","initialState","initialSelectionsState","DataTable","_ref","columns","data","defaultColumnValues","additionalColumns","isSelectable","isPaginated","manualPagination","pageCount","itemCount","isFilterable","manualFilters","fetchData","isSortable","manualSortBy","isExpandable","renderRowSubComponent","bulkActions","tableActions","numBreakoutFilters","initialTableOptions","EmptyTableComponent","manualSelectColumn","showFiltersInSidebar","dataViewToggleOptions","disableElevation","isLoading","children","onSelectedRowsChanged","maxSelectedRows","onMaxSelectedRows","props","_objectWithoutProperties","_excluded","defaultColumn","tableOptions","updatedTableOptions","_objectSpread","stateReducer","newState","action","previousState","type","value","selectedRowIds","rowIndex","parseInt","id","selectedRowsOrdered","newSelectedRowsOrdered","filter","item","selections","selectionsDispatch","tableArgs","push","hooks","visibleColumns","selectionProps","selectedRows","length","selectedRowsById","forEach","row","useControlledState","state","selectedFlatRows","controlledTableSelections","instance","pageSize","tableStatePageSize","pageIndex","tableStatePageIndex","sortBy","tableStateSortBy","filters","tableStateFilters","tableStateSelectedRowIds","selectionActions","enhancedInstance","createElement","Provider","className","Fragment","content","defaultProps","undefined","SelectionStatusComponent","FilterStatusComponent","RowStatusComponent","isDataViewToggleEnabled","onDataViewToggle","defaultActiveStateValue","togglePlacement","propTypes","arrayOf","shape","Header","oneOfType","elementType","node","isRequired","accessor","string","Cell","Filter","filterChoices","name","number","bool","disableSortBy","func","buttonText","handleClick","variant","disabled","element","oneOf","EmptyTable"],"sources":["../../src/DataTable/index.jsx"],"sourcesContent":["import React, {\n useEffect, useMemo, useReducer,\n} from 'react';\nimport PropTypes from 'prop-types';\nimport { useTable, useMountedLayoutEffect } from 'react-table';\n\nimport classNames from 'classnames';\nimport Table from './Table';\nimport getVisibleColumns from './utils/getVisibleColumns';\nimport { requiredWhen, requiredWhenNot } from '../utils/propTypes';\nimport getTableArgs from './utils/getTableArgs';\nimport TableControlBar from './TableControlBar';\nimport EmptyTableContent from './EmptyTable';\nimport TableFooter from './TableFooter';\nimport BulkActions from './BulkActions';\nimport DropdownFilters from './DropdownFilters';\nimport FilterStatus from './FilterStatus';\nimport RowStatus from './RowStatus';\nimport SelectionStatus from './selection/SelectionStatus';\nimport ControlledSelectionStatus from './selection/ControlledSelectionStatus';\nimport SmartStatus from './SmartStatus';\nimport TableFilters from './TableFilters';\nimport TableHeaderCell from './TableHeaderCell';\nimport TableCell from './TableCell';\nimport TableHeaderRow from './TableHeaderRow';\nimport TablePagination from './TablePagination';\nimport TablePaginationMinimal from './TablePaginationMinimal';\nimport DataTableContext from './DataTableContext';\nimport TableActions from './TableActions';\nimport ControlledSelect from './selection/ControlledSelect';\nimport ControlledSelectHeader from './selection/ControlledSelectHeader';\nimport DataTableLayout from './DataTableLayout';\nimport ExpandAll from './ExpandAll';\nimport ExpandRow from './ExpandRow';\n\nimport { useSelectionActions } from './hooks';\nimport selectionsReducer, { initialState as initialSelectionsState } from './selection/data/reducer';\n\nfunction DataTable({\n columns, data, defaultColumnValues, additionalColumns, isSelectable,\n isPaginated, manualPagination, pageCount, itemCount,\n isFilterable, manualFilters, fetchData, initialState,\n isSortable, manualSortBy,\n isExpandable, renderRowSubComponent,\n bulkActions, tableActions, numBreakoutFilters,\n initialTableOptions,\n EmptyTableComponent,\n manualSelectColumn,\n showFiltersInSidebar,\n dataViewToggleOptions,\n disableElevation,\n isLoading,\n children,\n onSelectedRowsChanged,\n maxSelectedRows,\n onMaxSelectedRows,\n ...props\n}) {\n const defaultColumn = useMemo(\n () => (defaultColumnValues),\n [defaultColumnValues],\n );\n const tableOptions = useMemo(() => {\n const updatedTableOptions = {\n stateReducer: (newState, action, previousState) => {\n switch (action.type) {\n // Note: we override the `toggleAllRowsSelected` action\n // from react-table because it only clears the selections on the\n // currently visible page; it does not clear the `selectedRowIds`\n // as we would expect for selections on different pages. Instead, we\n // force `selectedRowIds` to be cleared when `toggleAllRowsSelected(false)`\n // is called.\n case 'toggleAllRowsSelected': {\n if (action.value) {\n return newState;\n }\n return {\n ...newState,\n selectedRowIds: {},\n };\n }\n /* Note: We override the `toggleRowSelected` action from react-table\n because we need to preserve the order of the selected rows.\n While `selectedRowIds` is an object that contains the selected rows as key-value pairs,\n it does not maintain the order of selection. Therefore, we have added the `selectedRowsOrdered` property\n to keep track of the order in which the rows were selected.\n */\n case 'toggleRowSelected': {\n const rowIndex = parseInt(action.id, 10);\n const { selectedRowsOrdered = [] } = previousState;\n\n let newSelectedRowsOrdered;\n if (action.value) {\n newSelectedRowsOrdered = [...selectedRowsOrdered, rowIndex];\n } else {\n newSelectedRowsOrdered = selectedRowsOrdered.filter((item) => item !== rowIndex);\n }\n\n return {\n ...newState,\n selectedRowsOrdered: newSelectedRowsOrdered,\n };\n }\n default:\n return newState;\n }\n },\n ...initialTableOptions,\n };\n return {\n columns,\n data,\n defaultColumn,\n manualFilters,\n manualPagination,\n manualSortBy,\n initialState,\n ...updatedTableOptions,\n };\n }, [initialTableOptions, columns, data, defaultColumn, manualFilters, manualPagination, manualSortBy, initialState]);\n\n const [selections, selectionsDispatch] = useReducer(selectionsReducer, initialSelectionsState);\n\n if (isPaginated && manualPagination) {\n // pageCount is required when pagination is manual, if it's not there passing -1 as per react-table docs\n tableOptions.pageCount = pageCount || -1;\n }\n\n // NB: Table args *must* be in a particular order\n const tableArgs = getTableArgs({\n tableOptions, isFilterable, isSelectable, isPaginated, isSortable, isExpandable,\n });\n // adds selection column and action columns as necessary\n tableArgs.push(hooks => {\n hooks.visibleColumns.push(\n visibleColumns => getVisibleColumns(isSelectable, visibleColumns, additionalColumns, manualSelectColumn),\n );\n });\n\n // Pass any controlled selections from context to the appropriate ``useTable`` arguments to maintain\n // correct selection states on rows, both from a data perspective and in the UI.\n const selectionProps = {};\n const { selectedRows } = selections;\n if (selectedRows.length > 0) {\n const selectedRowsById = {};\n selectedRows.forEach((row) => {\n selectedRowsById[row.id] = true;\n });\n tableArgs.push(hooks => {\n hooks.useControlledState.push(\n (state) => ({ ...state, selectedRowIds: selectedRowsById }),\n );\n });\n selectionProps.selectedFlatRows = selectedRows;\n }\n const controlledTableSelections = [selections, selectionsDispatch];\n\n // Use the state and functions returned from useTable to build your UI\n const instance = useTable(...tableArgs);\n\n const {\n pageSize: tableStatePageSize,\n pageIndex: tableStatePageIndex,\n sortBy: tableStateSortBy,\n filters: tableStateFilters,\n selectedRowIds: tableStateSelectedRowIds,\n } = instance.state;\n\n useEffect(() => {\n if (fetchData) {\n fetchData({\n pageSize: tableStatePageSize,\n pageIndex: tableStatePageIndex,\n sortBy: tableStateSortBy,\n filters: tableStateFilters,\n });\n }\n }, [fetchData, tableStatePageSize, tableStatePageIndex, tableStateSortBy, tableStateFilters]);\n\n useMountedLayoutEffect(() => {\n if (onSelectedRowsChanged) {\n onSelectedRowsChanged(tableStateSelectedRowIds);\n }\n }, [tableStateSelectedRowIds, onSelectedRowsChanged]);\n\n const selectionActions = useSelectionActions(instance, controlledTableSelections);\n\n const enhancedInstance = {\n ...instance,\n itemCount,\n numBreakoutFilters,\n bulkActions,\n tableActions,\n controlledTableSelections,\n showFiltersInSidebar,\n dataViewToggleOptions,\n renderRowSubComponent,\n disableElevation,\n isLoading,\n isSelectable,\n isPaginated,\n manualSelectColumn,\n maxSelectedRows,\n onMaxSelectedRows,\n ...selectionProps,\n ...selectionActions,\n ...props,\n };\n\n return (\n <DataTableContext.Provider value={enhancedInstance}>\n <DataTableLayout>\n <div className={classNames('pgn__data-table-wrapper', {\n 'hide-shadow': !!disableElevation,\n })}\n >\n {children || (\n <>\n <TableControlBar />\n <Table />\n <EmptyTableComponent content=\"No results found\" />\n <TableFooter />\n </>\n )}\n </div>\n </DataTableLayout>\n </DataTableContext.Provider>\n );\n}\n\nDataTable.defaultProps = {\n additionalColumns: [],\n defaultColumnValues: {},\n isFilterable: false,\n isPaginated: false,\n isSelectable: false,\n isSortable: false,\n manualFilters: false,\n manualPagination: false,\n manualSortBy: false,\n fetchData: null,\n initialState: {},\n initialTableOptions: {},\n EmptyTableComponent: EmptyTableContent,\n children: null,\n bulkActions: [],\n tableActions: [],\n numBreakoutFilters: 1,\n manualSelectColumn: undefined,\n SelectionStatusComponent: SelectionStatus,\n FilterStatusComponent: FilterStatus,\n RowStatusComponent: RowStatus,\n showFiltersInSidebar: false,\n dataViewToggleOptions: {\n isDataViewToggleEnabled: false,\n onDataViewToggle: () => {},\n defaultActiveStateValue: 'card',\n togglePlacement: 'left',\n },\n disableElevation: false,\n renderRowSubComponent: undefined,\n isExpandable: false,\n isLoading: false,\n onSelectedRowsChanged: undefined,\n maxSelectedRows: undefined,\n onMaxSelectedRows: undefined,\n};\n\nDataTable.propTypes = {\n /** Definition of table columns */\n columns: PropTypes.arrayOf(PropTypes.shape({\n /** User visible column name */\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n /** String used to access the correct cell data for this column */\n accessor: requiredWhenNot(PropTypes.string, 'Cell'),\n /** Specifies a function that receives `row` as argument and returns cell content */\n Cell: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]),\n /** Specifies filter component */\n Filter: PropTypes.elementType,\n /** Specifies filter type */\n filter: PropTypes.string,\n /** Specifies filter choices */\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string,\n number: PropTypes.number,\n value: PropTypes.string,\n })),\n })).isRequired,\n /** Data to be displayed in the table */\n data: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n /** table rows can be selected */\n isSelectable: PropTypes.bool,\n /** Alternate column for selecting rows. See react table useSort docs for more information */\n manualSelectColumn: PropTypes.shape({\n id: PropTypes.string.isRequired,\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n Cell: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]),\n disableSortBy: PropTypes.bool.isRequired,\n }),\n /** Table columns can be sorted */\n isSortable: PropTypes.bool,\n /** Indicates that sorting will be done via backend API. A fetchData function must be provided */\n manualSortBy: PropTypes.bool,\n /** Paginate the table */\n isPaginated: PropTypes.bool,\n /** Indicates that pagination will be done manually. A fetchData function must be provided */\n manualPagination: PropTypes.bool,\n // eslint-disable-next-line react/require-default-props\n pageCount: requiredWhen(PropTypes.number, 'manualPagination'),\n /** Table rows can be filtered, using a default filter in the default column values, or in the column definition */\n isFilterable: PropTypes.bool,\n /** Indicates that filtering will be done via a backend API. A fetchData function must be provided */\n manualFilters: PropTypes.bool,\n\n /** defaults that will be set on each column. Will be overridden by individual column values */\n defaultColumnValues: PropTypes.shape({\n /** A default filter component for the column */\n Filter: PropTypes.elementType,\n }),\n /** Actions or other additional non-data columns can be added here */\n additionalColumns: PropTypes.arrayOf(PropTypes.shape({\n /** id must be unique from other columns ids */\n id: PropTypes.string.isRequired,\n /** column header that will be displayed to the user */\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]),\n /** Component that renders in the added column. It will receive the row as a prop */\n Cell: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]),\n })),\n /** Function that will fetch table data. Called when page size, page index or filters change.\n * Meant to be used with manual filters and pagination */\n fetchData: PropTypes.func,\n /** Initial state passed to react-table's documentation https://react-table.tanstack.com/docs/api/useTable */\n initialState: PropTypes.shape({\n pageSize: requiredWhen(PropTypes.number, 'isPaginated'),\n pageIndex: requiredWhen(PropTypes.number, 'isPaginated'),\n filters: requiredWhen(PropTypes.arrayOf(PropTypes.shape()), 'manualFilters'),\n sortBy: requiredWhen(PropTypes.arrayOf(PropTypes.shape()), 'manualSortBy'),\n selectedRowIds: PropTypes.shape(),\n selectedRowsOrdered: PropTypes.arrayOf(PropTypes.number),\n }),\n /** Table options passed to react-table's useTable hook. Will override some options passed in to DataTable, such\n as: data, columns, defaultColumn, manualFilters, manualPagination, manualSortBy, and initialState */\n initialTableOptions: PropTypes.shape({}),\n /** Actions to be performed on the table. Called with the table instance. Not displayed if rows are selected. */\n itemCount: PropTypes.number.isRequired,\n /** Actions to be performed on selected rows of the table. Called with the selected rows.\n * Only displayed if rows are selected. */\n bulkActions: PropTypes.oneOfType([\n PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n /** Bulk action button text */\n buttonText: PropTypes.string.isRequired,\n /** handleClick will be passed the selected rows */\n handleClick: PropTypes.func.isRequired,\n /** classnames for button class */\n className: PropTypes.string,\n /** optional button variant; only relevant for the first two buttons */\n variant: PropTypes.string,\n /** disables button */\n disabled: PropTypes.bool,\n }),\n /** function passed selected items, should return action object */\n PropTypes.func,\n /** A custom component representing an action */\n PropTypes.element,\n ]),\n ),\n /** Function for rendering custom components */\n PropTypes.func,\n /** A custom component representing an action */\n PropTypes.element,\n ]),\n /** Function for rendering custom components, called with the table instance */\n tableActions: PropTypes.oneOfType([\n PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n /** Bulk action button text */\n buttonText: PropTypes.string.isRequired,\n /** handleClick will be passed the selected rows */\n handleClick: PropTypes.func.isRequired,\n /** classnames for button class */\n className: PropTypes.string,\n /** optional button variant; only relevant for the first two buttons */\n variant: PropTypes.string,\n /** disables button */\n disabled: PropTypes.bool,\n }),\n /** function passed table instance, should return action object */\n PropTypes.func,\n /** A custom component representing an action */\n PropTypes.element,\n ]),\n ),\n /** Function for rendering custom components */\n PropTypes.func,\n /** A custom component representing an action */\n PropTypes.element,\n ]),\n /** Number between one and four filters that can be shown on the top row. */\n numBreakoutFilters: PropTypes.oneOf([1, 2, 3, 4]),\n /** Component to be displayed when the table is empty */\n EmptyTableComponent: PropTypes.elementType,\n /** Component to be displayed for row status, ie, 10 of 20 rows. Displayed by default in the TableControlBar */\n RowStatusComponent: PropTypes.elementType,\n /** Component to be displayed for selection status. Displayed when there are selected rows and no active filters */\n SelectionStatusComponent: PropTypes.elementType,\n /** Component to be displayed for filter status. Displayed when there are active filters. */\n FilterStatusComponent: PropTypes.elementType,\n /** If children are not provided a table with control bar and footer will be rendered */\n children: PropTypes.node,\n /** If true filters will be shown on sidebar instead */\n showFiltersInSidebar: PropTypes.bool,\n /** options for data view toggle */\n dataViewToggleOptions: PropTypes.shape({\n /** Whether to show a toggle button group which allows view switching between card and table views */\n isDataViewToggleEnabled: PropTypes.bool,\n /** Callback invoked when the toggle buttons are clicked, with value of selected button passed in */\n onDataViewToggle: PropTypes.func,\n /** default value for toggle active state */\n defaultActiveStateValue: PropTypes.string,\n /** placement of toggle 'bottom' will push it to the bottom row in\n * actions section. Only 'left' and 'bottom' are supported */\n togglePlacement: PropTypes.string,\n }),\n /** Remove the default box shadow on the component */\n disableElevation: PropTypes.bool,\n /** A function that will render contents of expanded row, accepts `row` as a prop. */\n renderRowSubComponent: PropTypes.func,\n /** Indicates whether table supports expandable rows. */\n isExpandable: PropTypes.bool,\n /** Indicates whether the table should show loading states. */\n isLoading: PropTypes.bool,\n /** Callback function called when row selections change. */\n onSelectedRowsChanged: PropTypes.func,\n /** Indicates the max of rows selectable in the table. Requires isSelectable prop */\n maxSelectedRows: PropTypes.number,\n /** Callback after selected max rows. Requires isSelectable and maxSelectedRows props */\n onMaxSelectedRows: PropTypes.func,\n};\n\nDataTable.BulkActions = BulkActions;\nDataTable.EmptyTable = EmptyTableContent;\nDataTable.DropdownFilters = DropdownFilters;\nDataTable.FilterStatus = FilterStatus;\nDataTable.RowStatus = RowStatus;\nDataTable.SelectionStatus = SelectionStatus;\nDataTable.SmartStatus = SmartStatus;\nDataTable.Table = Table;\nDataTable.TableCell = TableCell;\nDataTable.TableControlBar = TableControlBar;\nDataTable.TableFilters = TableFilters;\nDataTable.TableFooter = TableFooter;\nDataTable.TableHeaderCell = TableHeaderCell;\nDataTable.TableHeaderRow = TableHeaderRow;\nDataTable.TablePagination = TablePagination;\nDataTable.TablePaginationMinimal = TablePaginationMinimal;\nDataTable.TableActions = TableActions;\nDataTable.ControlledSelectionStatus = ControlledSelectionStatus;\nDataTable.ControlledSelect = ControlledSelect;\nDataTable.ControlledSelectHeader = ControlledSelectHeader;\nDataTable.ExpandAll = ExpandAll;\nDataTable.ExpandRow = ExpandRow;\n\nexport default DataTable;\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,IACVC,SAAS,EAAEC,OAAO,EAAEC,UAAU,QACzB,OAAO;AACd,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,QAAQ,EAAEC,sBAAsB,QAAQ,aAAa;AAE9D,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,SAAS;AAC3B,OAAOC,iBAAiB,MAAM,2BAA2B;AACzD,SAASC,YAAY,EAAEC,eAAe,QAAQ,oBAAoB;AAClE,OAAOC,YAAY,MAAM,sBAAsB;AAC/C,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,OAAOC,iBAAiB,MAAM,cAAc;AAC5C,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,SAAS,MAAM,aAAa;AACnC,OAAOC,eAAe,MAAM,6BAA6B;AACzD,OAAOC,yBAAyB,MAAM,uCAAuC;AAC7E,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,eAAe,MAAM,mBAAmB;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B,GAAGA,yBAAyB;AAC/DmB,SAAS,CAACT,gBAAgB,GAAGA,gBAAgB;AAC7CS,SAAS,CAACR,sBAAsB,GAAGA,sBAAsB;AACzDQ,SAAS,CAACN,SAAS,GAAGA,SAAS;AAC/BM,SAAS,CAACL,SAAS,GAAGA,SAAS;AAE/B,eAAeK,SAAS"}
@@ -1,4 +1,4 @@
1
- const _excluded = ["as", "className", "controlClassName", "leadingElement", "trailingElement", "floatingLabel", "autoResize", "onChange"],
1
+ const _excluded = ["as", "className", "controlClassName", "leadingElement", "trailingElement", "floatingLabel", "autoResize", "onChange", "inputMask"],
2
2
  _excluded2 = ["isInvalid", "isValid", "getControlProps"];
3
3
  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); }
4
4
  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; }
@@ -12,6 +12,7 @@ import React, { useCallback, useEffect } from 'react';
12
12
  import PropTypes from 'prop-types';
13
13
  import classNames from 'classnames';
14
14
  import RBFormControl from 'react-bootstrap/FormControl';
15
+ import { IMaskInput } from 'react-imask';
15
16
  import { useFormGroupContext } from './FormGroupContext';
16
17
  import FormControlFeedback from './FormControlFeedback';
17
18
  import FormControlDecoratorGroup from './FormControlDecoratorGroup';
@@ -25,7 +26,8 @@ const FormControl = /*#__PURE__*/React.forwardRef((_ref, ref) => {
25
26
  trailingElement,
26
27
  floatingLabel,
27
28
  autoResize,
28
- onChange
29
+ onChange,
30
+ inputMask
29
31
  } = _ref,
30
32
  props = _objectWithoutProperties(_ref, _excluded);
31
33
  const _useFormGroupContext = useFormGroupContext(),
@@ -72,7 +74,7 @@ const FormControl = /*#__PURE__*/React.forwardRef((_ref, ref) => {
72
74
  floatingLabel: floatingLabel,
73
75
  className: className
74
76
  }, /*#__PURE__*/React.createElement(RBFormControl, _extends({
75
- as: as,
77
+ as: inputMask ? IMaskInput : as,
76
78
  ref: resolvedRef,
77
79
  size: size,
78
80
  isInvalid: isInvalid,
@@ -80,7 +82,8 @@ const FormControl = /*#__PURE__*/React.forwardRef((_ref, ref) => {
80
82
  className: classNames(controlClassName, {
81
83
  'has-value': hasValue
82
84
  }),
83
- onChange: handleOnChange
85
+ onChange: handleOnChange,
86
+ mask: inputMask
84
87
  }, controlProps)));
85
88
  });
86
89
  const SIZE_CHOICES = ['sm', 'lg'];
@@ -116,7 +119,9 @@ FormControl.propTypes = {
116
119
  /** Specifies whether to display control in invalid state, this affects styling. */
117
120
  isInvalid: PropTypes.bool,
118
121
  /** Only for `as="textarea"`. Specifies whether the input can be resized according to the height of content. */
119
- autoResize: PropTypes.bool
122
+ autoResize: PropTypes.bool,
123
+ /** Specifies what format to use for the input mask. */
124
+ inputMask: PropTypes.string
120
125
  };
121
126
  FormControl.defaultProps = {
122
127
  as: 'input',
@@ -133,7 +138,8 @@ FormControl.defaultProps = {
133
138
  plaintext: false,
134
139
  isValid: undefined,
135
140
  isInvalid: undefined,
136
- autoResize: false
141
+ autoResize: false,
142
+ inputMask: undefined
137
143
  };
138
144
  export default FormControl;
139
145
  //# sourceMappingURL=FormControl.js.map