@openedx/paragon 21.11.4 → 21.12.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.
- package/dist/Container/index.js +6 -2
- package/dist/Container/index.js.map +1 -1
- package/dist/DataTable/index.js +1 -0
- package/dist/DataTable/index.js.map +1 -1
- package/dist/DataTable/selection/BaseSelectionStatus.js +3 -2
- package/dist/DataTable/selection/BaseSelectionStatus.js.map +1 -1
- package/dist/Dropdown/index.js.map +1 -1
- package/dist/Form/FormSwitch.js +3 -0
- package/dist/Form/FormSwitch.js.map +1 -1
- package/dist/Hyperlink/index.js +7 -6
- package/dist/Hyperlink/index.js.map +1 -1
- package/dist/Icon/index.js +17 -10
- package/dist/Icon/index.js.map +1 -1
- package/dist/IconButton/index.js +1 -1
- package/dist/IconButton/index.js.map +1 -1
- package/dist/Layout/index.js.map +1 -1
- package/dist/Modal/ModalDialog.js +3 -0
- package/dist/Modal/ModalDialog.js.map +1 -1
- package/dist/Modal/index.js +11 -6
- package/dist/Modal/index.js.map +1 -1
- package/dist/Popover/index.js +8 -8
- package/dist/Popover/index.js.map +1 -1
- package/dist/ProductTour/Checkpoint.js +10 -8
- package/dist/ProductTour/Checkpoint.js.map +1 -1
- package/dist/ProductTour/messages.js +16 -0
- package/dist/SearchField/SearchFieldAdvanced.js +12 -7
- package/dist/SearchField/SearchFieldAdvanced.js.map +1 -1
- package/dist/SearchField/SearchFieldLabel.js +3 -3
- package/dist/SearchField/SearchFieldLabel.js.map +1 -1
- package/dist/SearchField/index.js +0 -1
- package/dist/SearchField/index.js.map +1 -1
- package/dist/Tabs/index.js +13 -13
- package/dist/Tabs/index.js.map +1 -1
- package/dist/hooks/useIndexOfLastVisibleChild.js +33 -38
- package/dist/hooks/useIndexOfLastVisibleChild.js.map +1 -1
- package/dist/i18n/messages/ar.json +2 -1
- package/dist/i18n/messages/ca.json +2 -1
- package/dist/i18n/messages/es_419.json +2 -1
- package/dist/i18n/messages/es_AR.json +2 -1
- package/dist/i18n/messages/es_ES.json +2 -1
- package/dist/i18n/messages/fr.json +2 -1
- package/dist/i18n/messages/he.json +2 -1
- package/dist/i18n/messages/id.json +2 -1
- package/dist/i18n/messages/it_IT.json +2 -1
- package/dist/i18n/messages/ko_KR.json +2 -1
- package/dist/i18n/messages/pl.json +2 -1
- package/dist/i18n/messages/pt_BR.json +2 -1
- package/dist/i18n/messages/pt_PT.json +2 -1
- package/dist/i18n/messages/ru.json +2 -1
- package/dist/i18n/messages/th.json +2 -1
- package/dist/i18n/messages/tr_TR.json +2 -1
- package/dist/i18n/messages/uk.json +2 -1
- package/dist/i18n/messages/zh_CN.json +2 -1
- package/icons/es5/RightSidebarFilled.js +15 -0
- package/icons/es5/RightSidebarOutlined.js +15 -0
- package/icons/es5/index.js +2 -0
- package/icons/jsx/RightSidebarFilled.jsx +19 -0
- package/icons/jsx/RightSidebarOutlined.jsx +19 -0
- package/icons/jsx/index.jsx +2 -0
- package/icons/svg/right_sidebar_filled.svg +3 -0
- package/icons/svg/right_sidebar_outlined.svg +3 -0
- package/package.json +1 -1
- package/src/Container/index.jsx +4 -0
- package/src/DataTable/index.jsx +1 -0
- package/src/DataTable/selection/BaseSelectionStatus.jsx +2 -2
- package/src/DataTable/tests/DataTable.test.jsx +31 -0
- package/src/Dropdown/index.jsx +4 -0
- package/src/Form/FormSwitch.jsx +3 -0
- package/src/Hyperlink/index.jsx +7 -6
- package/src/Icon/index.jsx +17 -10
- package/src/IconButton/index.jsx +1 -1
- package/src/Layout/index.jsx +1 -4
- package/src/Modal/ModalDialog.jsx +3 -0
- package/src/Modal/index.jsx +11 -6
- package/src/Popover/README.md +0 -1
- package/src/Popover/index.jsx +11 -11
- package/src/ProductTour/Checkpoint.jsx +9 -6
- package/src/ProductTour/messages.js +16 -0
- package/src/SearchField/SearchFieldAdvanced.jsx +12 -7
- package/src/SearchField/SearchFieldLabel.jsx +3 -3
- package/src/SearchField/index.jsx +0 -1
- package/src/Tabs/index.jsx +19 -13
- package/src/hooks/tests/useIndexOfLastVisibleChild.test.jsx +3 -3
- package/src/hooks/useIndexOfLastVisibleChild.jsx +36 -38
- package/src/hooks/useIndexOfLastVisibleChild.mdx +3 -3
- package/src/i18n/messages/ar.json +2 -1
- package/src/i18n/messages/ca.json +2 -1
- package/src/i18n/messages/es_419.json +2 -1
- package/src/i18n/messages/es_AR.json +2 -1
- package/src/i18n/messages/es_ES.json +2 -1
- package/src/i18n/messages/fr.json +2 -1
- package/src/i18n/messages/he.json +2 -1
- package/src/i18n/messages/id.json +2 -1
- package/src/i18n/messages/it_IT.json +2 -1
- package/src/i18n/messages/ko_KR.json +2 -1
- package/src/i18n/messages/pl.json +2 -1
- package/src/i18n/messages/pt_BR.json +2 -1
- package/src/i18n/messages/pt_PT.json +2 -1
- package/src/i18n/messages/ru.json +2 -1
- package/src/i18n/messages/th.json +2 -1
- package/src/i18n/messages/tr_TR.json +2 -1
- package/src/i18n/messages/uk.json +2 -1
- package/src/i18n/messages/zh_CN.json +2 -1
package/dist/Container/index.js
CHANGED
|
@@ -32,17 +32,21 @@ const Container = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
32
32
|
Container.propTypes = _objectSpread(_objectSpread({}, RBContainer.propTypes), {}, {
|
|
33
33
|
/** Override the base element */
|
|
34
34
|
as: PropTypes.elementType,
|
|
35
|
+
/** Specifies the contents of the container */
|
|
35
36
|
children: PropTypes.node,
|
|
36
37
|
/** Fill all available space at any breakpoint */
|
|
37
38
|
fluid: PropTypes.bool,
|
|
38
39
|
/** Set the maximum width for the container */
|
|
39
|
-
size: PropTypes.oneOf(Object.keys(SIZE_CLASS_NAMES))
|
|
40
|
+
size: PropTypes.oneOf(Object.keys(SIZE_CLASS_NAMES)),
|
|
41
|
+
/** Overrides underlying component base CSS class name */
|
|
42
|
+
bsPrefix: PropTypes.string
|
|
40
43
|
});
|
|
41
44
|
Container.defaultProps = {
|
|
42
45
|
as: 'div',
|
|
43
46
|
children: undefined,
|
|
44
47
|
fluid: true,
|
|
45
|
-
size: undefined
|
|
48
|
+
size: undefined,
|
|
49
|
+
bsPrefix: 'container'
|
|
46
50
|
};
|
|
47
51
|
export default Container;
|
|
48
52
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","forwardRef","classNames","RBContainer","PropTypes","SIZE_CLASS_NAMES","xs","sm","md","lg","xl","Container","_ref","ref","size","children","props","_objectWithoutProperties","_excluded","createElement","_extends","className","propTypes","_objectSpread","as","elementType","node","fluid","bool","oneOf","Object","keys","defaultProps","undefined"],"sources":["../../src/Container/index.jsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport classNames from 'classnames';\nimport RBContainer from 'react-bootstrap/Container';\nimport PropTypes from 'prop-types';\n\nconst SIZE_CLASS_NAMES = {\n xs: 'container-mw-xs',\n sm: 'container-mw-sm',\n md: 'container-mw-md',\n lg: 'container-mw-lg',\n xl: 'container-mw-xl',\n};\n\nconst Container = forwardRef(({ size, children, ...props }, ref) => (\n <RBContainer\n {...props}\n ref={ref}\n className={classNames(\n props.className,\n SIZE_CLASS_NAMES[size],\n )}\n >\n {children}\n </RBContainer>\n));\n\nContainer.propTypes = {\n ...RBContainer.propTypes,\n /** Override the base element */\n as: PropTypes.elementType,\n children: PropTypes.node,\n /** Fill all available space at any breakpoint */\n fluid: PropTypes.bool,\n /** Set the maximum width for the container */\n size: PropTypes.oneOf(Object.keys(SIZE_CLASS_NAMES)),\n};\n\nContainer.defaultProps = {\n as: 'div',\n children: undefined,\n fluid: true,\n size: undefined,\n};\n\nexport default Container;\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,WAAW,MAAM,2BAA2B;AACnD,OAAOC,SAAS,MAAM,YAAY;AAElC,MAAMC,gBAAgB,GAAG;EACvBC,EAAE,EAAE,iBAAiB;EACrBC,EAAE,EAAE,iBAAiB;EACrBC,EAAE,EAAE,iBAAiB;EACrBC,EAAE,EAAE,iBAAiB;EACrBC,EAAE,EAAE;AACN,CAAC;AAED,MAAMC,SAAS,gBAAGV,UAAU,CAAC,CAAAW,IAAA,EAA+BC,GAAG;EAAA,IAAjC;MAAEC,IAAI;MAAEC;IAAmB,CAAC,GAAAH,IAAA;IAAPI,KAAK,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA;EAAA,oBACtDlB,KAAA,CAAAmB,aAAA,CAAChB,WAAW,EAAAiB,QAAA,KACNJ,KAAK;IACTH,GAAG,EAAEA,GAAI;IACTQ,SAAS,EAAEnB,UAAU,CACnBc,KAAK,CAACK,SAAS,EACfhB,gBAAgB,CAACS,IAAI,CACvB;EAAE,IAEDC,QACU,CAAC;AAAA,CACf,CAAC;AAEFJ,SAAS,CAACW,SAAS,GAAAC,aAAA,CAAAA,aAAA,KACdpB,WAAW,CAACmB,SAAS;EACxB;EACAE,EAAE,EAAEpB,SAAS,CAACqB,WAAW;
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","forwardRef","classNames","RBContainer","PropTypes","SIZE_CLASS_NAMES","xs","sm","md","lg","xl","Container","_ref","ref","size","children","props","_objectWithoutProperties","_excluded","createElement","_extends","className","propTypes","_objectSpread","as","elementType","node","fluid","bool","oneOf","Object","keys","bsPrefix","string","defaultProps","undefined"],"sources":["../../src/Container/index.jsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport classNames from 'classnames';\nimport RBContainer from 'react-bootstrap/Container';\nimport PropTypes from 'prop-types';\n\nconst SIZE_CLASS_NAMES = {\n xs: 'container-mw-xs',\n sm: 'container-mw-sm',\n md: 'container-mw-md',\n lg: 'container-mw-lg',\n xl: 'container-mw-xl',\n};\n\nconst Container = forwardRef(({ size, children, ...props }, ref) => (\n <RBContainer\n {...props}\n ref={ref}\n className={classNames(\n props.className,\n SIZE_CLASS_NAMES[size],\n )}\n >\n {children}\n </RBContainer>\n));\n\nContainer.propTypes = {\n ...RBContainer.propTypes,\n /** Override the base element */\n as: PropTypes.elementType,\n /** Specifies the contents of the container */\n children: PropTypes.node,\n /** Fill all available space at any breakpoint */\n fluid: PropTypes.bool,\n /** Set the maximum width for the container */\n size: PropTypes.oneOf(Object.keys(SIZE_CLASS_NAMES)),\n /** Overrides underlying component base CSS class name */\n bsPrefix: PropTypes.string,\n};\n\nContainer.defaultProps = {\n as: 'div',\n children: undefined,\n fluid: true,\n size: undefined,\n bsPrefix: 'container',\n};\n\nexport default Container;\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,WAAW,MAAM,2BAA2B;AACnD,OAAOC,SAAS,MAAM,YAAY;AAElC,MAAMC,gBAAgB,GAAG;EACvBC,EAAE,EAAE,iBAAiB;EACrBC,EAAE,EAAE,iBAAiB;EACrBC,EAAE,EAAE,iBAAiB;EACrBC,EAAE,EAAE,iBAAiB;EACrBC,EAAE,EAAE;AACN,CAAC;AAED,MAAMC,SAAS,gBAAGV,UAAU,CAAC,CAAAW,IAAA,EAA+BC,GAAG;EAAA,IAAjC;MAAEC,IAAI;MAAEC;IAAmB,CAAC,GAAAH,IAAA;IAAPI,KAAK,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA;EAAA,oBACtDlB,KAAA,CAAAmB,aAAA,CAAChB,WAAW,EAAAiB,QAAA,KACNJ,KAAK;IACTH,GAAG,EAAEA,GAAI;IACTQ,SAAS,EAAEnB,UAAU,CACnBc,KAAK,CAACK,SAAS,EACfhB,gBAAgB,CAACS,IAAI,CACvB;EAAE,IAEDC,QACU,CAAC;AAAA,CACf,CAAC;AAEFJ,SAAS,CAACW,SAAS,GAAAC,aAAA,CAAAA,aAAA,KACdpB,WAAW,CAACmB,SAAS;EACxB;EACAE,EAAE,EAAEpB,SAAS,CAACqB,WAAW;EACzB;EACAV,QAAQ,EAAEX,SAAS,CAACsB,IAAI;EACxB;EACAC,KAAK,EAAEvB,SAAS,CAACwB,IAAI;EACrB;EACAd,IAAI,EAAEV,SAAS,CAACyB,KAAK,CAACC,MAAM,CAACC,IAAI,CAAC1B,gBAAgB,CAAC,CAAC;EACpD;EACA2B,QAAQ,EAAE5B,SAAS,CAAC6B;AAAM,EAC3B;AAEDtB,SAAS,CAACuB,YAAY,GAAG;EACvBV,EAAE,EAAE,KAAK;EACTT,QAAQ,EAAEoB,SAAS;EACnBR,KAAK,EAAE,IAAI;EACXb,IAAI,EAAEqB,SAAS;EACfH,QAAQ,EAAE;AACZ,CAAC;AAED,eAAerB,SAAS"}
|
package/dist/DataTable/index.js
CHANGED
|
@@ -197,6 +197,7 @@ function DataTable(_ref) {
|
|
|
197
197
|
}, [tableStateSelectedRowIds, onSelectedRowsChanged]);
|
|
198
198
|
const selectionActions = useSelectionActions(instance, controlledTableSelections);
|
|
199
199
|
const enhancedInstance = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, instance), {}, {
|
|
200
|
+
manualFilters,
|
|
200
201
|
itemCount,
|
|
201
202
|
numBreakoutFilters,
|
|
202
203
|
bulkActions,
|
|
@@ -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","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://github.com/TanStack/table/blob/v7/docs/src/pages/docs/api/useTable.md */\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,O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SAAS,CAACpB,eAAe,GAAGA,eAAe;AAC3CoB,SAAS,CAAClB,WAAW,GAAGA,WAAW;AACnCkB,SAAS,CAAChC,KAAK,GAAGA,KAAK;AACvBgC,SAAS,CAACf,SAAS,GAAGA,SAAS;AAC/Be,SAAS,CAAC3B,eAAe,GAAGA,eAAe;AAC3C2B,SAAS,CAACjB,YAAY,GAAGA,YAAY;AACrCiB,SAAS,CAACzB,WAAW,GAAGA,WAAW;AACnCyB,SAAS,CAAChB,eAAe,GAAGA,eAAe;AAC3CgB,SAAS,CAACd,cAAc,GAAGA,cAAc;AACzCc,SAAS,CAACb,eAAe,GAAGA,eAAe;AAC3Ca,SAAS,CAACZ,sBAAsB,GAAGA,sBAAsB;AACzDY,SAAS,CAACV,YAAY,GAAGA,YAAY;AACrCU,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 manualFilters,\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://github.com/TanStack/table/blob/v7/docs/src/pages/docs/api/useTable.md */\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,MAA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SAAS,GAAGA,SAAS;AAC/BqB,SAAS,CAACpB,eAAe,GAAGA,eAAe;AAC3CoB,SAAS,CAAClB,WAAW,GAAGA,WAAW;AACnCkB,SAAS,CAAChC,KAAK,GAAGA,KAAK;AACvBgC,SAAS,CAACf,SAAS,GAAGA,SAAS;AAC/Be,SAAS,CAAC3B,eAAe,GAAGA,eAAe;AAC3C2B,SAAS,CAACjB,YAAY,GAAGA,YAAY;AACrCiB,SAAS,CAACzB,WAAW,GAAGA,WAAW;AACnCyB,SAAS,CAAChB,eAAe,GAAGA,eAAe;AAC3CgB,SAAS,CAACd,cAAc,GAAGA,cAAc;AACzCc,SAAS,CAACb,eAAe,GAAGA,eAAe;AAC3Ca,SAAS,CAACZ,sBAAsB,GAAGA,sBAAsB;AACzDY,SAAS,CAACV,YAAY,GAAGA,YAAY;AACrCU,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"}
|
|
@@ -22,11 +22,12 @@ function BaseSelectionStatus(_ref) {
|
|
|
22
22
|
isPaginated,
|
|
23
23
|
state,
|
|
24
24
|
isSelectable,
|
|
25
|
-
maxSelectedRows
|
|
25
|
+
maxSelectedRows,
|
|
26
|
+
manualFilters
|
|
26
27
|
} = useContext(DataTableContext);
|
|
27
28
|
const hasAppliedFilters = state?.filters?.length > 0;
|
|
28
29
|
const isAllRowsSelected = numSelectedRows === itemCount;
|
|
29
|
-
const filteredItems = filteredRows?.length || itemCount;
|
|
30
|
+
const filteredItems = manualFilters ? itemCount : filteredRows?.length || itemCount;
|
|
30
31
|
const hasMaxSelectedRows = isSelectable && maxSelectedRows;
|
|
31
32
|
const intlAllSelectedText = allSelectedText || /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
32
33
|
id: "pgn.DataTable.BaseSelectionStatus.allSelectedText",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseSelectionStatus.js","names":["React","useContext","PropTypes","FormattedMessage","Button","DataTableContext","SELECT_ALL_TEST_ID","CLEAR_SELECTION_TEST_ID","BaseSelectionStatus","_ref","className","clearSelectionText","numSelectedRows","numSelectedRowsOnPage","onSelectAll","onClear","selectAllText","allSelectedText","selectedText","itemCount","filteredRows","isPaginated","state","isSelectable","maxSelectedRows","hasAppliedFilters","filters","length","isAllRowsSelected","filteredItems","hasMaxSelectedRows","intlAllSelectedText","createElement","id","defaultMessage","description","values","defaultSelectedText","intlSelectedText","variant","size","onClick","defaultProps","undefined","propTypes","string","oneOfType","element","number","isRequired","func"],"sources":["../../../src/DataTable/selection/BaseSelectionStatus.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { FormattedMessage } from 'react-intl';\n\nimport Button from '../../Button';\nimport DataTableContext from '../DataTableContext';\nimport {\n SELECT_ALL_TEST_ID,\n CLEAR_SELECTION_TEST_ID,\n} from './data/constants';\n\nfunction BaseSelectionStatus({\n className,\n clearSelectionText,\n numSelectedRows,\n numSelectedRowsOnPage,\n onSelectAll,\n onClear,\n selectAllText,\n allSelectedText,\n selectedText,\n}) {\n const {\n itemCount, filteredRows, isPaginated, state,\n isSelectable, maxSelectedRows,\n } = useContext(DataTableContext);\n const hasAppliedFilters = state?.filters?.length > 0;\n const isAllRowsSelected = numSelectedRows === itemCount;\n const filteredItems = filteredRows?.length || itemCount;\n const hasMaxSelectedRows = isSelectable && maxSelectedRows;\n\n const intlAllSelectedText = allSelectedText || (\n <FormattedMessage\n id=\"pgn.DataTable.BaseSelectionStatus.allSelectedText\"\n defaultMessage=\"All {numSelectedRows} selected\"\n description=\"Text for all selected label\"\n values={{ numSelectedRows }}\n />\n );\n\n const defaultSelectedText = isPaginated || hasAppliedFilters ? (\n <FormattedMessage\n id=\"pgn.DataTable.BaseSelectionStatus.selectedTextPaginated\"\n defaultMessage=\"{numSelectedRows} selected ({numSelectedRowsOnPage} shown below)\"\n description=\"Text for selected label when table is paginated\"\n values={{ numSelectedRows, numSelectedRowsOnPage }}\n />\n ) : (\n <FormattedMessage\n id=\"pgn.DataTable.BaseSelectionStatus.selectedText\"\n defaultMessage=\"{numSelectedRows} selected\"\n description=\"Text for selected label\"\n values={{ numSelectedRows }}\n />\n );\n\n const intlSelectedText = selectedText || defaultSelectedText;\n\n return (\n <div className={className} data-testid=\"selection-status-component\">\n <span data-testid=\"selection-status\">\n {isAllRowsSelected ? intlAllSelectedText : intlSelectedText}\n </span>\n {!isAllRowsSelected && !hasMaxSelectedRows && (\n <Button\n data-testid={SELECT_ALL_TEST_ID}\n variant=\"link\"\n size=\"inline\"\n onClick={onSelectAll}\n >\n {selectAllText || (\n <FormattedMessage\n id=\"pgn.DataTable.BaseSelectionStatus.selectAllText\"\n defaultMessage=\"Select all {itemCount}\"\n description=\"A label for select all button.\"\n values={{ itemCount: filteredItems }}\n />\n )}\n </Button>\n )}\n {numSelectedRows > 0 && (\n <Button\n data-testid={CLEAR_SELECTION_TEST_ID}\n variant=\"link\"\n size=\"inline\"\n onClick={onClear}\n >\n {clearSelectionText || (\n <FormattedMessage\n id=\"pgn.DataTable.BaseSelectionStatus.clearSelectionText\"\n defaultMessage=\"Clear selection\"\n description=\"A label of clear all selection button.\"\n />\n )}\n </Button>\n )}\n </div>\n );\n}\n\nBaseSelectionStatus.defaultProps = {\n className: undefined,\n selectAllText: undefined,\n allSelectedText: undefined,\n selectedText: undefined,\n clearSelectionText: undefined,\n};\n\nBaseSelectionStatus.propTypes = {\n /** A class name to append to the base element */\n className: PropTypes.string,\n /** A text that appears on the `Clear selection` button, defaults to 'Clear selection' */\n clearSelectionText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n /** Count of selected rows in the table. */\n numSelectedRows: PropTypes.number.isRequired,\n /** Count of selected rows on the current page */\n numSelectedRowsOnPage: PropTypes.number.isRequired,\n /** A handler for 'Select all' button. */\n onSelectAll: PropTypes.func.isRequired,\n /** A handler for 'Clear selection' button. */\n onClear: PropTypes.func.isRequired,\n /** A text that appears on the `Select all` button, defaults to 'Select All {itemCount}' */\n selectAllText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n /** A text that appears when all items have been selected, defaults to 'All {numSelectedRows} selected' */\n allSelectedText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n /** A text that appears when some items have been selected, defaults to '{numSelectedRows} selected' */\n selectedText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n};\n\nexport default BaseSelectionStatus;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,gBAAgB,QAAQ,YAAY;AAE7C,OAAOC,MAAM,MAAM,cAAc;AACjC,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,SACEC,kBAAkB,EAClBC,uBAAuB,QAClB,kBAAkB;AAEzB,SAASC,mBAAmBA,CAAAC,IAAA,EAUzB;EAAA,IAV0B;IAC3BC,SAAS;IACTC,kBAAkB;IAClBC,eAAe;IACfC,qBAAqB;IACrBC,WAAW;IACXC,OAAO;IACPC,aAAa;IACbC,eAAe;IACfC;EACF,CAAC,GAAAT,IAAA;EACC,MAAM;IACJU,SAAS;IAAEC,YAAY;IAAEC,WAAW;IAAEC,KAAK;IAC3CC,YAAY;IAAEC;
|
|
1
|
+
{"version":3,"file":"BaseSelectionStatus.js","names":["React","useContext","PropTypes","FormattedMessage","Button","DataTableContext","SELECT_ALL_TEST_ID","CLEAR_SELECTION_TEST_ID","BaseSelectionStatus","_ref","className","clearSelectionText","numSelectedRows","numSelectedRowsOnPage","onSelectAll","onClear","selectAllText","allSelectedText","selectedText","itemCount","filteredRows","isPaginated","state","isSelectable","maxSelectedRows","manualFilters","hasAppliedFilters","filters","length","isAllRowsSelected","filteredItems","hasMaxSelectedRows","intlAllSelectedText","createElement","id","defaultMessage","description","values","defaultSelectedText","intlSelectedText","variant","size","onClick","defaultProps","undefined","propTypes","string","oneOfType","element","number","isRequired","func"],"sources":["../../../src/DataTable/selection/BaseSelectionStatus.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { FormattedMessage } from 'react-intl';\n\nimport Button from '../../Button';\nimport DataTableContext from '../DataTableContext';\nimport {\n SELECT_ALL_TEST_ID,\n CLEAR_SELECTION_TEST_ID,\n} from './data/constants';\n\nfunction BaseSelectionStatus({\n className,\n clearSelectionText,\n numSelectedRows,\n numSelectedRowsOnPage,\n onSelectAll,\n onClear,\n selectAllText,\n allSelectedText,\n selectedText,\n}) {\n const {\n itemCount, filteredRows, isPaginated, state,\n isSelectable, maxSelectedRows, manualFilters,\n } = useContext(DataTableContext);\n const hasAppliedFilters = state?.filters?.length > 0;\n const isAllRowsSelected = numSelectedRows === itemCount;\n const filteredItems = manualFilters ? itemCount : (filteredRows?.length || itemCount);\n const hasMaxSelectedRows = isSelectable && maxSelectedRows;\n\n const intlAllSelectedText = allSelectedText || (\n <FormattedMessage\n id=\"pgn.DataTable.BaseSelectionStatus.allSelectedText\"\n defaultMessage=\"All {numSelectedRows} selected\"\n description=\"Text for all selected label\"\n values={{ numSelectedRows }}\n />\n );\n\n const defaultSelectedText = isPaginated || hasAppliedFilters ? (\n <FormattedMessage\n id=\"pgn.DataTable.BaseSelectionStatus.selectedTextPaginated\"\n defaultMessage=\"{numSelectedRows} selected ({numSelectedRowsOnPage} shown below)\"\n description=\"Text for selected label when table is paginated\"\n values={{ numSelectedRows, numSelectedRowsOnPage }}\n />\n ) : (\n <FormattedMessage\n id=\"pgn.DataTable.BaseSelectionStatus.selectedText\"\n defaultMessage=\"{numSelectedRows} selected\"\n description=\"Text for selected label\"\n values={{ numSelectedRows }}\n />\n );\n\n const intlSelectedText = selectedText || defaultSelectedText;\n\n return (\n <div className={className} data-testid=\"selection-status-component\">\n <span data-testid=\"selection-status\">\n {isAllRowsSelected ? intlAllSelectedText : intlSelectedText}\n </span>\n {!isAllRowsSelected && !hasMaxSelectedRows && (\n <Button\n data-testid={SELECT_ALL_TEST_ID}\n variant=\"link\"\n size=\"inline\"\n onClick={onSelectAll}\n >\n {selectAllText || (\n <FormattedMessage\n id=\"pgn.DataTable.BaseSelectionStatus.selectAllText\"\n defaultMessage=\"Select all {itemCount}\"\n description=\"A label for select all button.\"\n values={{ itemCount: filteredItems }}\n />\n )}\n </Button>\n )}\n {numSelectedRows > 0 && (\n <Button\n data-testid={CLEAR_SELECTION_TEST_ID}\n variant=\"link\"\n size=\"inline\"\n onClick={onClear}\n >\n {clearSelectionText || (\n <FormattedMessage\n id=\"pgn.DataTable.BaseSelectionStatus.clearSelectionText\"\n defaultMessage=\"Clear selection\"\n description=\"A label of clear all selection button.\"\n />\n )}\n </Button>\n )}\n </div>\n );\n}\n\nBaseSelectionStatus.defaultProps = {\n className: undefined,\n selectAllText: undefined,\n allSelectedText: undefined,\n selectedText: undefined,\n clearSelectionText: undefined,\n};\n\nBaseSelectionStatus.propTypes = {\n /** A class name to append to the base element */\n className: PropTypes.string,\n /** A text that appears on the `Clear selection` button, defaults to 'Clear selection' */\n clearSelectionText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n /** Count of selected rows in the table. */\n numSelectedRows: PropTypes.number.isRequired,\n /** Count of selected rows on the current page */\n numSelectedRowsOnPage: PropTypes.number.isRequired,\n /** A handler for 'Select all' button. */\n onSelectAll: PropTypes.func.isRequired,\n /** A handler for 'Clear selection' button. */\n onClear: PropTypes.func.isRequired,\n /** A text that appears on the `Select all` button, defaults to 'Select All {itemCount}' */\n selectAllText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n /** A text that appears when all items have been selected, defaults to 'All {numSelectedRows} selected' */\n allSelectedText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n /** A text that appears when some items have been selected, defaults to '{numSelectedRows} selected' */\n selectedText: PropT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iBAAiB;IAChCC,WAAW,EAAC;EAAwC,CACrD,CAEG,CAEP,CAAC;AAEV;AAEA5B,mBAAmB,CAACmC,YAAY,GAAG;EACjCjC,SAAS,EAAEkC,SAAS;EACpB5B,aAAa,EAAE4B,SAAS;EACxB3B,eAAe,EAAE2B,SAAS;EAC1B1B,YAAY,EAAE0B,SAAS;EACvBjC,kBAAkB,EAAEiC;AACtB,CAAC;AAEDpC,mBAAmB,CAACqC,SAAS,GAAG;EAC9B;EACAnC,SAAS,EAAER,SAAS,CAAC4C,MAAM;EAC3B;EACAnC,kBAAkB,EAAET,SAAS,CAAC6C,SAAS,CAAC,CAAC7C,SAAS,CAAC4C,MAAM,EAAE5C,SAAS,CAAC8C,OAAO,CAAC,CAAC;EAC9E;EACApC,eAAe,EAAEV,SAAS,CAAC+C,MAAM,CAACC,UAAU;EAC5C;EACArC,qBAAqB,EAAEX,SAAS,CAAC+C,MAAM,CAACC,UAAU;EAClD;EACApC,WAAW,EAAEZ,SAAS,CAACiD,IAAI,CAACD,UAAU;EACtC;EACAnC,OAAO,EAAEb,SAAS,CAACiD,IAAI,CAACD,UAAU;EAClC;EACAlC,aAAa,EAAEd,SAAS,CAAC6C,SAAS,CAAC,CAAC7C,SAAS,CAAC4C,MAAM,EAAE5C,SAAS,CAAC8C,OAAO,CAAC,CAAC;EACzE;EACA/B,eAAe,EAAEf,SAAS,CAAC6C,SAAS,CAAC,CAAC7C,SAAS,CAAC4C,MAAM,EAAE5C,SAAS,CAAC8C,OAAO,CAAC,CAAC;EAC3E;EACA9B,YAAY,EAAEhB,SAAS,CAAC6C,SAAS,CAAC,CAAC7C,SAAS,CAAC4C,MAAM,EAAE5C,SAAS,CAAC8C,OAAO,CAAC;AACzE,CAAC;AAED,eAAexC,mBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","classNames","PropTypes","BaseDropdown","DropdownMenu","BaseDropdownItem","BaseDropdownToggle","DropdownDeprecated","Button","IconButton","Dropdown","forwardRef","_ref","ref","show","autoClose","onToggle","variant","className","rest","_objectWithoutProperties","_excluded","internalShow","setInternalShow","useState","isClosingPermitted","source","handleToggle","isOpen","event","metadata","_objectSpread","currentTarget","document","key","createElement","_extends","propTypes","oneOfType","string","bool","func","oneOf","defaultProps","undefined","DropdownToggle","_ref2","as","bsPrefix","otherProps","_excluded2","prefix","elementType","id","number","isRequired","Item","DropdownItem","_ref3","_excluded3","Deprecated","Toggle","Menu","Header","Divider","default","DropdownButton","SplitButton"],"sources":["../../src/Dropdown/index.jsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport BaseDropdown from 'react-bootstrap/Dropdown';\nimport DropdownMenu from 'react-bootstrap/DropdownMenu';\nimport BaseDropdownItem from 'react-bootstrap/DropdownItem';\nimport BaseDropdownToggle from 'react-bootstrap/DropdownToggle';\nimport DropdownDeprecated from './deprecated';\nimport Button from '../Button';\nimport IconButton from '../IconButton';\n\nconst Dropdown = React.forwardRef(\n // eslint-disable-next-line prefer-arrow-callback\n function Dropdown({\n show,\n autoClose,\n onToggle,\n variant,\n className,\n ...rest\n }, ref) {\n const [internalShow, setInternalShow] = React.useState(show);\n const isClosingPermitted = (source) => {\n // autoClose=false only permits close on button click\n if (autoClose === false) {\n return source === 'click';\n }\n // autoClose=inside doesn't permit close on rootClose\n if (autoClose === 'inside') {\n return source !== 'rootClose';\n }\n // autoClose=outside doesn't permit close on select\n if (autoClose === 'outside') {\n return source !== 'select';\n }\n return true;\n };\n\n const handleToggle = (isOpen, event, metadata) => {\n if (isOpen) {\n setInternalShow(true);\n onToggle?.(isOpen, event, metadata);\n return;\n }\n let { source } = { ...metadata };\n\n if (event.currentTarget === document && (source !== 'keydown' || event.key === 'Escape')) {\n source = 'rootClose';\n }\n if (isClosingPermitted(source)) {\n setInternalShow(false);\n onToggle?.(isOpen, event, metadata);\n }\n };\n\n return (\n <BaseDropdown\n className={classNames(\n 'pgn__dropdown',\n `pgn__dropdown-${variant}`,\n className,\n )}\n data-testid=\"dropdown\"\n onToggle={handleToggle}\n ref={ref}\n show={internalShow}\n {...rest}\n />\n );\n },\n);\nDropdown.propTypes = {\n autoClose: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.bool,\n ]),\n className: PropTypes.string,\n onToggle: PropTypes.func,\n show: PropTypes.bool,\n variant: PropTypes.oneOf(['light', 'dark']),\n};\nDropdown.defaultProps = {\n autoClose: true,\n className: '',\n onToggle: undefined,\n show: false,\n variant: 'light',\n};\n\nconst DropdownToggle = React.forwardRef(\n // eslint-disable-next-line prefer-arrow-callback\n function DropdownToggle({\n as,\n bsPrefix,\n ...otherProps\n }, ref) {\n // hide arrow from the toggle if it is rendered as IconButton\n // because it hinders the positioning of IconButton\n const prefix = as === IconButton ? 'pgn__dropdown-toggle-iconbutton' : bsPrefix;\n return <BaseDropdownToggle {...otherProps} as={as} bsPrefix={prefix} ref={ref} />;\n },\n);\n\nDropdownToggle.propTypes = {\n /** Specifies the base element. */\n as: PropTypes.elementType,\n /** Overrides underlying component base CSS class name. */\n bsPrefix: PropTypes.string,\n /** An html id attribute, necessary for assistive technologies, such as screen readers. */\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n};\n\nDropdownToggle.defaultProps = {\n as: Button,\n bsPrefix: 'dropdown-toggle',\n};\n\nDropdown.Item = React.forwardRef(\n // eslint-disable-next-line prefer-arrow-callback\n function DropdownItem({ className, ...otherProps }, ref) {\n return (\n <BaseDropdownItem\n className={classNames(className, 'pgn__dropdown-item')}\n ref={ref}\n {...otherProps}\n />\n );\n },\n);\nDropdown.Item.propTypes = {\n className: PropTypes.string,\n};\nDropdown.Item.defaultProps = {\n className: undefined,\n};\n\nDropdown.Deprecated = DropdownDeprecated;\nDropdown.Toggle = DropdownToggle;\nDropdown.Menu = DropdownMenu;\nDropdown.Header = BaseDropdown.Header;\nDropdown.Divider = BaseDropdown.Divider;\n\nexport default Dropdown;\nexport { DropdownToggle };\nexport { default as DropdownButton } from 'react-bootstrap/DropdownButton';\nexport { default as SplitButton } from 'react-bootstrap/SplitButton';\n"],"mappings":";;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,YAAY,MAAM,0BAA0B;AACnD,OAAOC,YAAY,MAAM,8BAA8B;AACvD,OAAOC,gBAAgB,MAAM,8BAA8B;AAC3D,OAAOC,kBAAkB,MAAM,gCAAgC;AAC/D,OAAOC,kBAAkB,MAAM,cAAc;AAC7C,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,UAAU,MAAM,eAAe;AAEtC,MAAMC,QAAQ,gBAAGV,KAAK,CAACW,UAAU;AAC/B;AACA,SAASD,QAAQA,CAAAE,IAAA,EAOdC,GAAG,EAAE;EAAA,IAPU;MAChBC,IAAI;MACJC,SAAS;MACTC,QAAQ;MACRC,OAAO;MACPC;IAEF,CAAC,GAAAN,IAAA;IADIO,IAAI,GAAAC,wBAAA,CAAAR,IAAA,EAAAS,SAAA;EAEP,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GAAGvB,KAAK,CAACwB,QAAQ,CAACV,IAAI,CAAC;EAC5D,MAAMW,kBAAkB,GAAIC,MAAM,IAAK;IACrC;IACA,IAAIX,SAAS,KAAK,KAAK,EAAE;MACvB,OAAOW,MAAM,KAAK,OAAO;IAC3B;IACA;IACA,IAAIX,SAAS,KAAK,QAAQ,EAAE;MAC1B,OAAOW,MAAM,KAAK,WAAW;IAC/B;IACA;IACA,IAAIX,SAAS,KAAK,SAAS,EAAE;MAC3B,OAAOW,MAAM,KAAK,QAAQ;IAC5B;IACA,OAAO,IAAI;EACb,CAAC;EAED,MAAMC,YAAY,GAAGA,CAACC,MAAM,EAAEC,KAAK,EAAEC,QAAQ,KAAK;IAChD,IAAIF,MAAM,EAAE;MACVL,eAAe,CAAC,IAAI,CAAC;MACrBP,QAAQ,GAAGY,MAAM,EAAEC,KAAK,EAAEC,QAAQ,CAAC;MACnC;IACF;IACA,IAAI;MAAEJ;IAAO,CAAC,GAAAK,aAAA,KAAQD,QAAQ,CAAE;IAEhC,IAAID,KAAK,CAACG,aAAa,KAAKC,QAAQ,KAAKP,MAAM,KAAK,SAAS,IAAIG,KAAK,CAACK,GAAG,KAAK,QAAQ,CAAC,EAAE;MACxFR,MAAM,GAAG,WAAW;IACtB;IACA,IAAID,kBAAkB,CAACC,MAAM,CAAC,EAAE;MAC9BH,eAAe,CAAC,KAAK,CAAC;MACtBP,QAAQ,GAAGY,MAAM,EAAEC,KAAK,EAAEC,QAAQ,CAAC;IACrC;EACF,CAAC;EAED,oBACE9B,KAAA,CAAAmC,aAAA,CAAChC,YAAY,EAAAiC,QAAA;IACXlB,SAAS,EAAEjB,UAAU,CACnB,eAAe,EACd,iBAAgBgB,OAAQ,EAAC,EAC1BC,SACF,CAAE;IACF,eAAY,UAAU;IACtBF,QAAQ,EAAEW,YAAa;IACvBd,GAAG,EAAEA,GAAI;IACTC,IAAI,EAAEQ;EAAa,GACfH,IAAI,CACT,CAAC;AAEN,CACF,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","classNames","PropTypes","BaseDropdown","DropdownMenu","BaseDropdownItem","BaseDropdownToggle","DropdownDeprecated","Button","IconButton","Dropdown","forwardRef","_ref","ref","show","autoClose","onToggle","variant","className","rest","_objectWithoutProperties","_excluded","internalShow","setInternalShow","useState","isClosingPermitted","source","handleToggle","isOpen","event","metadata","_objectSpread","currentTarget","document","key","createElement","_extends","propTypes","oneOfType","string","bool","func","oneOf","defaultProps","undefined","DropdownToggle","_ref2","as","bsPrefix","otherProps","_excluded2","prefix","elementType","id","number","isRequired","Item","DropdownItem","_ref3","_excluded3","Deprecated","Toggle","Menu","Header","Divider","default","DropdownButton","SplitButton"],"sources":["../../src/Dropdown/index.jsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport BaseDropdown from 'react-bootstrap/Dropdown';\nimport DropdownMenu from 'react-bootstrap/DropdownMenu';\nimport BaseDropdownItem from 'react-bootstrap/DropdownItem';\nimport BaseDropdownToggle from 'react-bootstrap/DropdownToggle';\nimport DropdownDeprecated from './deprecated';\nimport Button from '../Button';\nimport IconButton from '../IconButton';\n\nconst Dropdown = React.forwardRef(\n // eslint-disable-next-line prefer-arrow-callback\n function Dropdown({\n show,\n autoClose,\n onToggle,\n variant,\n className,\n ...rest\n }, ref) {\n const [internalShow, setInternalShow] = React.useState(show);\n const isClosingPermitted = (source) => {\n // autoClose=false only permits close on button click\n if (autoClose === false) {\n return source === 'click';\n }\n // autoClose=inside doesn't permit close on rootClose\n if (autoClose === 'inside') {\n return source !== 'rootClose';\n }\n // autoClose=outside doesn't permit close on select\n if (autoClose === 'outside') {\n return source !== 'select';\n }\n return true;\n };\n\n const handleToggle = (isOpen, event, metadata) => {\n if (isOpen) {\n setInternalShow(true);\n onToggle?.(isOpen, event, metadata);\n return;\n }\n let { source } = { ...metadata };\n\n if (event.currentTarget === document && (source !== 'keydown' || event.key === 'Escape')) {\n source = 'rootClose';\n }\n if (isClosingPermitted(source)) {\n setInternalShow(false);\n onToggle?.(isOpen, event, metadata);\n }\n };\n\n return (\n <BaseDropdown\n className={classNames(\n 'pgn__dropdown',\n `pgn__dropdown-${variant}`,\n className,\n )}\n data-testid=\"dropdown\"\n onToggle={handleToggle}\n ref={ref}\n show={internalShow}\n {...rest}\n />\n );\n },\n);\n\nDropdown.propTypes = {\n autoClose: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.bool,\n ]),\n className: PropTypes.string,\n onToggle: PropTypes.func,\n show: PropTypes.bool,\n variant: PropTypes.oneOf(['light', 'dark']),\n};\n\nDropdown.defaultProps = {\n autoClose: true,\n className: '',\n onToggle: undefined,\n show: false,\n variant: 'light',\n};\n\nconst DropdownToggle = React.forwardRef(\n // eslint-disable-next-line prefer-arrow-callback\n function DropdownToggle({\n as,\n bsPrefix,\n ...otherProps\n }, ref) {\n // hide arrow from the toggle if it is rendered as IconButton\n // because it hinders the positioning of IconButton\n const prefix = as === IconButton ? 'pgn__dropdown-toggle-iconbutton' : bsPrefix;\n return <BaseDropdownToggle {...otherProps} as={as} bsPrefix={prefix} ref={ref} />;\n },\n);\n\nDropdownToggle.propTypes = {\n /** Specifies the base element. */\n as: PropTypes.elementType,\n /** Overrides underlying component base CSS class name. */\n bsPrefix: PropTypes.string,\n /** An html id attribute, necessary for assistive technologies, such as screen readers. */\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n};\n\nDropdownToggle.defaultProps = {\n as: Button,\n bsPrefix: 'dropdown-toggle',\n};\n\nDropdown.Item = React.forwardRef(\n // eslint-disable-next-line prefer-arrow-callback\n function DropdownItem({ className, ...otherProps }, ref) {\n return (\n <BaseDropdownItem\n className={classNames(className, 'pgn__dropdown-item')}\n ref={ref}\n {...otherProps}\n />\n );\n },\n);\n\nDropdown.Item.propTypes = {\n className: PropTypes.string,\n};\n\nDropdown.Item.defaultProps = {\n className: undefined,\n};\n\nDropdown.Deprecated = DropdownDeprecated;\nDropdown.Toggle = DropdownToggle;\nDropdown.Menu = DropdownMenu;\nDropdown.Header = BaseDropdown.Header;\nDropdown.Divider = BaseDropdown.Divider;\n\nexport default Dropdown;\nexport { DropdownToggle };\nexport { default as DropdownButton } from 'react-bootstrap/DropdownButton';\nexport { default as SplitButton } from 'react-bootstrap/SplitButton';\n"],"mappings":";;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,YAAY,MAAM,0BAA0B;AACnD,OAAOC,YAAY,MAAM,8BAA8B;AACvD,OAAOC,gBAAgB,MAAM,8BAA8B;AAC3D,OAAOC,kBAAkB,MAAM,gCAAgC;AAC/D,OAAOC,kBAAkB,MAAM,cAAc;AAC7C,OAAOC,MAAM,MAAM,WAAW;AAC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D,YAAY,CAAC4D,MAAM;AACrCrD,QAAQ,CAACsD,OAAO,GAAG7D,YAAY,CAAC6D,OAAO;AAEvC,eAAetD,QAAQ;AACvB,SAASmC,cAAc;AACvB,SAASoB,OAAO,IAAIC,cAAc,QAAQ,gCAAgC;AAC1E,SAASD,OAAO,IAAIE,WAAW,QAAQ,6BAA6B"}
|
package/dist/Form/FormSwitch.js
CHANGED
|
@@ -77,8 +77,11 @@ FormSwitch.propTypes = {
|
|
|
77
77
|
children: PropTypes.node.isRequired,
|
|
78
78
|
/** Specifies class name to append to the base element. */
|
|
79
79
|
className: PropTypes.string,
|
|
80
|
+
/** Specifies class name to append to the label element. */
|
|
80
81
|
labelClassName: PropTypes.string,
|
|
82
|
+
/** Specifies helper text to display below the switch. */
|
|
81
83
|
helperText: PropTypes.node,
|
|
84
|
+
/** Determines whether the label should float to the left when the switch is active. */
|
|
82
85
|
floatLabelLeft: PropTypes.bool
|
|
83
86
|
};
|
|
84
87
|
FormSwitch.defaultProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormSwitch.js","names":["React","PropTypes","classNames","FormCheckbox","useFormGroupContext","SwitchControl","forwardRef","_ref","ref","isIndeterminate","props","_objectWithoutProperties","_excluded","defaultRef","useRef","resolvedRef","getControlProps","checkboxProps","_objectSpread","className","useEffect","current","indeterminate","createElement","_extends","type","propTypes","bool","string","defaultProps","undefined","FormSwitch","_ref2","children","helperText","_excluded2","role","controlAs","isValid","isInvalid","description","node","isRequired","labelClassName","floatLabelLeft"],"sources":["../../src/Form/FormSwitch.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport FormCheckbox from './FormCheckbox';\nimport { useFormGroupContext } from './FormGroupContext';\n\nconst SwitchControl = React.forwardRef(\n ({ isIndeterminate, ...props }, ref) => {\n const defaultRef = React.useRef();\n const resolvedRef = ref || defaultRef;\n const { getControlProps } = useFormGroupContext();\n const checkboxProps = getControlProps({\n ...props,\n className: classNames(\n 'pgn__form-switch-input',\n props.className,\n ),\n });\n\n React.useEffect(() => {\n // this if(resolvedRef.current) prevents console errors in testing\n if (resolvedRef.current) {\n resolvedRef.current.indeterminate = isIndeterminate;\n }\n }, [resolvedRef, isIndeterminate]);\n\n return (\n <input\n type=\"checkbox\"\n {...checkboxProps}\n ref={resolvedRef}\n />\n );\n },\n);\n\nSwitchControl.propTypes = {\n /** Specifies whether input should be rendered in indeterminate state. */\n isIndeterminate: PropTypes.bool,\n /** Specifies class name to append to the base element. */\n className: PropTypes.string,\n};\n\nSwitchControl.defaultProps = {\n isIndeterminate: false,\n className: undefined,\n};\n\nconst FormSwitch = React.forwardRef(({\n children,\n className,\n helperText,\n ...props\n}, ref) => (\n <div className=\"d-inline-flex flex-column\">\n <FormCheckbox\n className={classNames('pgn__form-switch', className)}\n {...props}\n role=\"switch\"\n ref={ref}\n controlAs={SwitchControl}\n // ignore the following props for form switch\n isValid={null}\n isInvalid={null}\n description={null}\n >\n {children}\n </FormCheckbox>\n {helperText && (\n <div className=\"pgn__form-switch-helper-text\">\n {helperText}\n </div>\n )}\n </div>\n));\n\nFormSwitch.propTypes = {\n /** Specifies contents of the component. */\n children: PropTypes.node.isRequired,\n /** Specifies class name to append to the base element. */\n className: PropTypes.string,\n labelClassName: PropTypes.string,\n helperText: PropTypes.node,\n floatLabelLeft: PropTypes.bool,\n};\n\nFormSwitch.defaultProps = {\n className: undefined,\n labelClassName: undefined,\n helperText: undefined,\n floatLabelLeft: false,\n};\n\nexport { SwitchControl };\nexport default FormSwitch;\n"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,YAAY,MAAM,gBAAgB;AACzC,SAASC,mBAAmB,QAAQ,oBAAoB;AAExD,MAAMC,aAAa,gBAAGL,KAAK,CAACM,UAAU,CACpC,CAAAC,IAAA,EAAgCC,GAAG,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,SAAS,EAAC;EAA2B,gBACxCnB,KAAA,CAAAuB,aAAA,CAACpB,YAAY,EAAAqB,QAAA;IACXL,SAAS,EAAEjB,UAAU,CAAC,kBAAkB,EAAEiB,SAAS;EAAE,GACjDT,KAAK;IACT0B,IAAI,EAAC,QAAQ;IACb5B,GAAG,EAAEA,GAAI;IACT6B,SAAS,EAAEhC;IACX;IAAA;IACAiC,OAAO,EAAE,IAAK;IACdC,SAAS,EAAE,IAAK;IAChBC,WAAW,EAAE;EAAK,IAEjBP,QACW,CAAC,EACdC,UAAU,iBACTlC,KAAA,CAAAuB,aAAA;IAAKJ,SAAS,EAAC;EAA8B,GAC1Ce,UACE,CAEJ,CAAC;AAAA,CACP,CAAC;AAEFH,UAAU,CAACL,SAAS,GAAG;EACrB;EACAO,QAAQ,EAAEhC,SAAS,CAACwC,IAAI,CAACC,UAAU;EACnC;EACAvB,SAAS,EAAElB,SAAS,CAAC2B,MAAM;
|
|
1
|
+
{"version":3,"file":"FormSwitch.js","names":["React","PropTypes","classNames","FormCheckbox","useFormGroupContext","SwitchControl","forwardRef","_ref","ref","isIndeterminate","props","_objectWithoutProperties","_excluded","defaultRef","useRef","resolvedRef","getControlProps","checkboxProps","_objectSpread","className","useEffect","current","indeterminate","createElement","_extends","type","propTypes","bool","string","defaultProps","undefined","FormSwitch","_ref2","children","helperText","_excluded2","role","controlAs","isValid","isInvalid","description","node","isRequired","labelClassName","floatLabelLeft"],"sources":["../../src/Form/FormSwitch.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport FormCheckbox from './FormCheckbox';\nimport { useFormGroupContext } from './FormGroupContext';\n\nconst SwitchControl = React.forwardRef(\n ({ isIndeterminate, ...props }, ref) => {\n const defaultRef = React.useRef();\n const resolvedRef = ref || defaultRef;\n const { getControlProps } = useFormGroupContext();\n const checkboxProps = getControlProps({\n ...props,\n className: classNames(\n 'pgn__form-switch-input',\n props.className,\n ),\n });\n\n React.useEffect(() => {\n // this if(resolvedRef.current) prevents console errors in testing\n if (resolvedRef.current) {\n resolvedRef.current.indeterminate = isIndeterminate;\n }\n }, [resolvedRef, isIndeterminate]);\n\n return (\n <input\n type=\"checkbox\"\n {...checkboxProps}\n ref={resolvedRef}\n />\n );\n },\n);\n\nSwitchControl.propTypes = {\n /** Specifies whether input should be rendered in indeterminate state. */\n isIndeterminate: PropTypes.bool,\n /** Specifies class name to append to the base element. */\n className: PropTypes.string,\n};\n\nSwitchControl.defaultProps = {\n isIndeterminate: false,\n className: undefined,\n};\n\nconst FormSwitch = React.forwardRef(({\n children,\n className,\n helperText,\n ...props\n}, ref) => (\n <div className=\"d-inline-flex flex-column\">\n <FormCheckbox\n className={classNames('pgn__form-switch', className)}\n {...props}\n role=\"switch\"\n ref={ref}\n controlAs={SwitchControl}\n // ignore the following props for form switch\n isValid={null}\n isInvalid={null}\n description={null}\n >\n {children}\n </FormCheckbox>\n {helperText && (\n <div className=\"pgn__form-switch-helper-text\">\n {helperText}\n </div>\n )}\n </div>\n));\n\nFormSwitch.propTypes = {\n /** Specifies contents of the component. */\n children: PropTypes.node.isRequired,\n /** Specifies class name to append to the base element. */\n className: PropTypes.string,\n /** Specifies class name to append to the label element. */\n labelClassName: PropTypes.string,\n /** Specifies helper text to display below the switch. */\n helperText: PropTypes.node,\n /** Determines whether the label should float to the left when the switch is active. */\n floatLabelLeft: PropTypes.bool,\n};\n\nFormSwitch.defaultProps = {\n className: undefined,\n labelClassName: undefined,\n helperText: undefined,\n floatLabelLeft: false,\n};\n\nexport { SwitchControl };\nexport default FormSwitch;\n"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,YAAY,MAAM,gBAAgB;AACzC,SAASC,mBAAmB,QAAQ,oBAAoB;AAExD,MAAMC,aAAa,gBAAGL,KAAK,CAACM,UAAU,CACpC,CAAAC,IAAA,E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aAAA;IAAKJ,SAAS,EAAC;EAA2B,gBACxCnB,KAAA,CAAAuB,aAAA,CAACpB,YAAY,EAAAqB,QAAA;IACXL,SAAS,EAAEjB,UAAU,CAAC,kBAAkB,EAAEiB,SAAS;EAAE,GACjDT,KAAK;IACT0B,IAAI,EAAC,QAAQ;IACb5B,GAAG,EAAEA,GAAI;IACT6B,SAAS,EAAEhC;IACX;IAAA;IACAiC,OAAO,EAAE,IAAK;IACdC,SAAS,EAAE,IAAK;IAChBC,WAAW,EAAE;EAAK,IAEjBP,QACW,CAAC,EACdC,UAAU,iBACTlC,KAAA,CAAAuB,aAAA;IAAKJ,SAAS,EAAC;EAA8B,GAC1Ce,UACE,CAEJ,CAAC;AAAA,CACP,CAAC;AAEFH,UAAU,CAACL,SAAS,GAAG;EACrB;EACAO,QAAQ,EAAEhC,SAAS,CAACwC,IAAI,CAACC,UAAU;EACnC;EACAvB,SAAS,EAAElB,SAAS,CAAC2B,MAAM;EAC3B;EACAe,cAAc,EAAE1C,SAAS,CAAC2B,MAAM;EAChC;EACAM,UAAU,EAAEjC,SAAS,CAACwC,IAAI;EAC1B;EACAG,cAAc,EAAE3C,SAAS,CAAC0B;AAC5B,CAAC;AAEDI,UAAU,CAACF,YAAY,GAAG;EACxBV,SAAS,EAAEW,SAAS;EACpBa,cAAc,EAAEb,SAAS;EACzBI,UAAU,EAAEJ,SAAS;EACrBc,cAAc,EAAE;AAClB,CAAC;AAED,SAASvC,aAAa;AACtB,eAAe0B,UAAU"}
|
package/dist/Hyperlink/index.js
CHANGED
|
@@ -88,22 +88,23 @@ Hyperlink.propTypes = {
|
|
|
88
88
|
children: PropTypes.node.isRequired,
|
|
89
89
|
/** Custom class names for the hyperlink */
|
|
90
90
|
className: PropTypes.string,
|
|
91
|
-
/** specifies where the link should open. The default behavior is `_self`, which means that the URL will be
|
|
92
|
-
|
|
91
|
+
/** specifies where the link should open. The default behavior is `_self`, which means that the URL will be
|
|
92
|
+
* loaded into the same browsing context as the current one.
|
|
93
|
+
* If the target is `_blank` (opening a new window) `rel='noopener'` will be added to the anchor tag to prevent
|
|
94
|
+
* any potential [reverse tabnabbing attack](https://www.owasp.org/index.php/Reverse_Tabnabbing).
|
|
95
|
+
*/
|
|
93
96
|
target: PropTypes.string,
|
|
94
97
|
/** specifies the callback function when the link is clicked */
|
|
95
98
|
onClick: PropTypes.func,
|
|
96
|
-
// eslint-disable-next-line max-len
|
|
97
99
|
/** specifies the text for links with a `_blank` target (which loads the URL in a new browsing context). */
|
|
98
100
|
externalLinkAlternativeText: isRequiredIf(PropTypes.string, props => props.target === '_blank'),
|
|
99
|
-
// eslint-disable-next-line max-len
|
|
100
101
|
/** specifies the title for links with a `_blank` target (which loads the URL in a new browsing context). */
|
|
101
102
|
externalLinkTitle: isRequiredIf(PropTypes.string, props => props.target === '_blank'),
|
|
102
103
|
/** type of hyperlink */
|
|
103
104
|
variant: PropTypes.oneOf(['default', 'muted', 'brand']),
|
|
104
|
-
/** specify the link style. By default it will be underlined. */
|
|
105
|
+
/** specify the link style. By default, it will be underlined. */
|
|
105
106
|
isInline: PropTypes.bool,
|
|
106
|
-
/** specify if we need to show launch Icon. By default it will be visible. */
|
|
107
|
+
/** specify if we need to show launch Icon. By default, it will be visible. */
|
|
107
108
|
showLaunchIcon: PropTypes.bool
|
|
108
109
|
};
|
|
109
110
|
export default withDeprecatedProps(Hyperlink, 'Hyperlink', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","isRequiredIf","Launch","Icon","withDeprecatedProps","DeprTypes","HYPER_LINK_EXTERNAL_LINK_ALT_TEXT","HYPER_LINK_EXTERNAL_LINK_TITLE","Hyperlink","forwardRef","props","ref","className","destination","children","target","onClick","externalLinkAlternativeText","externalLinkTitle","variant","isInline","showLaunchIcon","attrs","_objectWithoutProperties","_excluded","externalLinkIcon","generateRel","rel","includes","createElement","title","src","screenReaderText","style","height","width","_extends","href","defaultProps","undefined","propTypes","string","isRequired","node","func","oneOf","bool","content","deprType","MOVED","newName"],"sources":["../../src/Hyperlink/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport isRequiredIf from 'react-proptype-conditional-require';\nimport { Launch } from '../../icons';\nimport Icon from '../Icon';\n\nimport withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';\n\nexport const HYPER_LINK_EXTERNAL_LINK_ALT_TEXT = 'in a new tab';\nexport const HYPER_LINK_EXTERNAL_LINK_TITLE = 'Opens in a new tab';\n\nconst Hyperlink = React.forwardRef((props, ref) => {\n const {\n className,\n destination,\n children,\n target,\n onClick,\n externalLinkAlternativeText,\n externalLinkTitle,\n variant,\n isInline,\n showLaunchIcon,\n ...attrs\n } = props;\n let externalLinkIcon;\n\n if (target === '_blank') {\n const generateRel = () => {\n let { rel } = attrs;\n if (!rel) {\n return 'noopener noreferrer';\n }\n if (!rel.includes('noopener')) {\n rel += ' noopener';\n }\n if (!rel.includes('noreferrer')) {\n rel += ' noreferrer';\n }\n return rel;\n };\n\n // Add this rel attribute to prevent Reverse Tabnabbing\n attrs.rel = generateRel();\n if (showLaunchIcon) {\n externalLinkIcon = (\n <span\n className=\"pgn__hyperlink__external-icon\"\n title={externalLinkTitle}\n >\n <Icon\n src={Launch}\n screenReaderText={externalLinkAlternativeText}\n style={{ height: '1em', width: '1em' }}\n data-testid=\"hyperlink-icon\"\n />\n </span>\n );\n }\n }\n\n return (\n <a\n ref={ref}\n className={classNames(\n 'pgn__hyperlink',\n `${variant}-link`,\n {\n 'standalone-link': !isInline,\n 'inline-link': isInline,\n },\n className,\n )}\n href={destination}\n target={target}\n onClick={onClick}\n {...attrs}\n >\n {children}\n {externalLinkIcon}\n </a>\n );\n});\n\nHyperlink.defaultProps = {\n className: undefined,\n target: '_self',\n onClick: () => {},\n externalLinkAlternativeText: HYPER_LINK_EXTERNAL_LINK_ALT_TEXT,\n externalLinkTitle: HYPER_LINK_EXTERNAL_LINK_TITLE,\n variant: 'default',\n isInline: false,\n showLaunchIcon: true,\n};\n\nHyperlink.propTypes = {\n /** specifies the URL */\n destination: PropTypes.string.isRequired,\n /** Content of the hyperlink */\n children: PropTypes.node.isRequired,\n /** Custom class names for the hyperlink */\n className: PropTypes.string,\n /** specifies where the link should open. The default behavior is `_self`, which means that the URL will be loaded into the same browsing context as the current one
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","isRequiredIf","Launch","Icon","withDeprecatedProps","DeprTypes","HYPER_LINK_EXTERNAL_LINK_ALT_TEXT","HYPER_LINK_EXTERNAL_LINK_TITLE","Hyperlink","forwardRef","props","ref","className","destination","children","target","onClick","externalLinkAlternativeText","externalLinkTitle","variant","isInline","showLaunchIcon","attrs","_objectWithoutProperties","_excluded","externalLinkIcon","generateRel","rel","includes","createElement","title","src","screenReaderText","style","height","width","_extends","href","defaultProps","undefined","propTypes","string","isRequired","node","func","oneOf","bool","content","deprType","MOVED","newName"],"sources":["../../src/Hyperlink/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport isRequiredIf from 'react-proptype-conditional-require';\nimport { Launch } from '../../icons';\nimport Icon from '../Icon';\n\nimport withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';\n\nexport const HYPER_LINK_EXTERNAL_LINK_ALT_TEXT = 'in a new tab';\nexport const HYPER_LINK_EXTERNAL_LINK_TITLE = 'Opens in a new tab';\n\nconst Hyperlink = React.forwardRef((props, ref) => {\n const {\n className,\n destination,\n children,\n target,\n onClick,\n externalLinkAlternativeText,\n externalLinkTitle,\n variant,\n isInline,\n showLaunchIcon,\n ...attrs\n } = props;\n let externalLinkIcon;\n\n if (target === '_blank') {\n const generateRel = () => {\n let { rel } = attrs;\n if (!rel) {\n return 'noopener noreferrer';\n }\n if (!rel.includes('noopener')) {\n rel += ' noopener';\n }\n if (!rel.includes('noreferrer')) {\n rel += ' noreferrer';\n }\n return rel;\n };\n\n // Add this rel attribute to prevent Reverse Tabnabbing\n attrs.rel = generateRel();\n if (showLaunchIcon) {\n externalLinkIcon = (\n <span\n className=\"pgn__hyperlink__external-icon\"\n title={externalLinkTitle}\n >\n <Icon\n src={Launch}\n screenReaderText={externalLinkAlternativeText}\n style={{ height: '1em', width: '1em' }}\n data-testid=\"hyperlink-icon\"\n />\n </span>\n );\n }\n }\n\n return (\n <a\n ref={ref}\n className={classNames(\n 'pgn__hyperlink',\n `${variant}-link`,\n {\n 'standalone-link': !isInline,\n 'inline-link': isInline,\n },\n className,\n )}\n href={destination}\n target={target}\n onClick={onClick}\n {...attrs}\n >\n {children}\n {externalLinkIcon}\n </a>\n );\n});\n\nHyperlink.defaultProps = {\n className: undefined,\n target: '_self',\n onClick: () => {},\n externalLinkAlternativeText: HYPER_LINK_EXTERNAL_LINK_ALT_TEXT,\n externalLinkTitle: HYPER_LINK_EXTERNAL_LINK_TITLE,\n variant: 'default',\n isInline: false,\n showLaunchIcon: true,\n};\n\nHyperlink.propTypes = {\n /** specifies the URL */\n destination: PropTypes.string.isRequired,\n /** Content of the hyperlink */\n children: PropTypes.node.isRequired,\n /** Custom class names for the hyperlink */\n className: PropTypes.string,\n /** specifies where the link should open. The default behavior is `_self`, which means that the URL will be\n * loaded into the same browsing context as the current one.\n * If the target is `_blank` (opening a new window) `rel='noopener'` will be added to the anchor tag to prevent\n * any potential [reverse tabnabbing attack](https://www.owasp.org/index.php/Reverse_Tabnabbing).\n */\n target: PropTypes.string,\n /** specifies the callback function when the link is clicked */\n onClick: PropTypes.func,\n /** specifies the text for links with a `_blank` target (which loads the URL in a new browsing context). */\n externalLinkAlternativeText: isRequiredIf(\n PropTypes.string,\n props => props.target === '_blank',\n ),\n /** specifies the title for links with a `_blank` target (which loads the URL in a new browsing context). */\n externalLinkTitle: isRequiredIf(\n PropTypes.string,\n props => props.target === '_blank',\n ),\n /** type of hyperlink */\n variant: PropTypes.oneOf(['default', 'muted', 'brand']),\n /** specify the link style. By default, it will be underlined. */\n isInline: PropTypes.bool,\n /** specify if we need to show launch Icon. By default, it will be visible. */\n showLaunchIcon: PropTypes.bool,\n};\n\nexport default withDeprecatedProps(Hyperlink, 'Hyperlink', {\n /** specifies the text or element that a URL should be associated with */\n content: {\n deprType: DeprTypes.MOVED,\n newName: 'children',\n },\n});\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,YAAY,MAAM,oCAAoC;AAC7D,SAASC,MAAM,QAAQ,aAAa;AACpC,OAAOC,IAAI,MAAM,SAAS;AAE1B,OAAOC,mBAAmB,IAAIC,SAAS,QAAQ,wBAAwB;AAEvE,OAAO,MAAMC,iCAAiC,GAAG,cAAc;AAC/D,OAAO,MAAMC,8BAA8B,GAAG,oBAAoB;AAElE,MAAMC,SAAS,gBAAGV,KAAK,CAACW,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACjD,MAAM;MACJC,SAAS;MACTC,WAAW;MACXC,QAAQ;MACRC,MAAM;MACNC,OAAO;MACPC,2BAA2B;MAC3BC,iBAAiB;MACjBC,OAAO;MACPC,QAAQ;MACRC;IAEF,CAAC,GAAGX,KAAK;IADJY,KAAK,GAAAC,wBAAA,CACNb,KAAK,EAAAc,SAAA;EACT,IAAIC,gBAAgB;EAEpB,IAAIV,MAAM,KAAK,QAAQ,EAAE;IACvB,MAAMW,WAAW,GAAGA,CAAA,KAAM;MACxB,IAAI;QAAEC;MAAI,CAAC,GAAGL,KAAK;MACnB,IAAI,CAACK,GAAG,EAAE;QACR,OAAO,qBAAqB;MAC9B;MACA,IAAI,CAACA,GAAG,CAACC,QAAQ,CAAC,UAAU,CAAC,EAAE;QAC7BD,GAAG,IAAI,WAAW;MACpB;MACA,IAAI,CAACA,GAAG,CAACC,QAAQ,CAAC,YAAY,CAAC,EAAE;QAC/BD,GAAG,IAAI,aAAa;MACtB;MACA,OAAOA,GAAG;IACZ,C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AS,EAAEb,SAAS,CAAC0C,MAAM;EAC3B;AACF;AACA;AACA;AACA;EACE1B,MAAM,EAAEhB,SAAS,CAAC0C,MAAM;EACxB;EACAzB,OAAO,EAAEjB,SAAS,CAAC6C,IAAI;EACvB;EACA3B,2BAA2B,EAAEhB,YAAY,CACvCF,SAAS,CAAC0C,MAAM,EAChB/B,KAAK,IAAIA,KAAK,CAACK,MAAM,KAAK,QAC5B,CAAC;EACD;EACAG,iBAAiB,EAAEjB,YAAY,CAC7BF,SAAS,CAAC0C,MAAM,EAChB/B,KAAK,IAAIA,KAAK,CAACK,MAAM,KAAK,QAC5B,CAAC;EACD;EACAI,OAAO,EAAEpB,SAAS,CAAC8C,KAAK,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;EACvD;EACAzB,QAAQ,EAAErB,SAAS,CAAC+C,IAAI;EACxB;EACAzB,cAAc,EAAEtB,SAAS,CAAC+C;AAC5B,CAAC;AAED,eAAe1C,mBAAmB,CAACI,SAAS,EAAE,WAAW,EAAE;EACzD;EACAuC,OAAO,EAAE;IACPC,QAAQ,EAAE3C,SAAS,CAAC4C,KAAK;IACzBC,OAAO,EAAE;EACX;AACF,CAAC,CAAC"}
|
package/dist/Icon/index.js
CHANGED
|
@@ -60,28 +60,35 @@ function Icon(_ref) {
|
|
|
60
60
|
}, screenReaderText));
|
|
61
61
|
}
|
|
62
62
|
Icon.propTypes = {
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
/**
|
|
64
|
+
* An icon component to render.
|
|
65
|
+
* Example import of a Paragon icon component: `import { Check } from '@edx/paragon/icons';`
|
|
66
|
+
*/
|
|
65
67
|
src: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
|
|
66
68
|
/** HTML element attributes to pass through to the underlying svg element */
|
|
67
69
|
svgAttrs: PropTypes.shape({
|
|
68
70
|
'aria-label': PropTypes.string,
|
|
69
71
|
'aria-labelledby': PropTypes.string
|
|
70
72
|
}),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
/**
|
|
74
|
+
* the `id` property of the Icon element, by default this value is generated
|
|
75
|
+
* with the `newId` function with the `prefix` of `Icon`.
|
|
76
|
+
*/
|
|
73
77
|
id: PropTypes.string,
|
|
74
|
-
// eslint-disable-next-line max-len
|
|
75
78
|
/** The size of the icon. */
|
|
76
79
|
size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg']),
|
|
77
|
-
// eslint-disable-next-line max-len
|
|
78
80
|
/** A class name that will define what the Icon looks like. */
|
|
79
81
|
className: PropTypes.string,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
+
/**
|
|
83
|
+
* a boolean that determines the value of `aria-hidden` attribute on the Icon span,
|
|
84
|
+
* this value is `true` by default.
|
|
85
|
+
*/
|
|
82
86
|
hidden: PropTypes.bool,
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
/**
|
|
88
|
+
* a string or an element that will be used on a secondary span leveraging the `sr-only` style
|
|
89
|
+
* for screenreader only text, this value is `undefined` by default. This value is recommended for use unless
|
|
90
|
+
* the Icon is being used in a way that is purely decorative or provides no additional context for screen
|
|
91
|
+
* reader users. This field should be thought of the same way an `alt` attribute would be used for `image` tags.
|
|
85
92
|
*/
|
|
86
93
|
screenReaderText: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
|
|
87
94
|
};
|
package/dist/Icon/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","newId","withDeprecatedProps","DeprTypes","Icon","_ref","src","Component","id","className","hidden","screenReaderText","svgAttrs","size","attrs","_objectWithoutProperties","_excluded","hasAriaLabel","mergedSvgProps","_objectSpread","undefined","createElement","_extends","role","focusable","Fragment","propTypes","oneOfType","element","func","shape","string","oneOf","bool","defaultProps","deprType","FORMAT","expect","value","transform","Array","isArray","join","message"],"sources":["../../src/Icon/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport newId from '../utils/newId';\nimport withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';\n\n/**\n * An svg with an \"img\" role must satisfy the following a11y requirements\n * - It needs a text alternative in the form of aria-label, aria-labelledby, or screen-reader only text.\n * - If no label is desired, aria-label will be set to an empty string and aria-hidden to \"true\".\n * - focusable is set to false on the svg in all cases as a workaround for an ie11 bug\n */\n\nfunction Icon({\n src: Component,\n id,\n className,\n hidden,\n screenReaderText,\n svgAttrs,\n size,\n ...attrs\n}) {\n if (Component) {\n // If no aria label is specified, hide this icon from screenreaders\n const hasAriaLabel = svgAttrs['aria-label'] || svgAttrs['aria-labelledby'];\n\n const mergedSvgProps = { ...svgAttrs };\n\n if (!hasAriaLabel) {\n mergedSvgProps['aria-label'] = undefined;\n mergedSvgProps['aria-hidden'] = true;\n }\n\n return (\n <span\n className={classNames('pgn__icon', { [`pgn__icon__${size}`]: !!size }, className)}\n id={id}\n {...attrs}\n >\n <Component\n role=\"img\"\n focusable={false}\n {...mergedSvgProps}\n />\n {screenReaderText && (\n <span className=\"sr-only\">\n {screenReaderText}\n </span>\n )}\n </span>\n );\n }\n\n return (\n <>\n <span\n id={id || newId('Icon')}\n className={className}\n aria-hidden={hidden}\n />\n {screenReaderText && (\n <span className=\"sr-only\">\n {screenReaderText}\n </span>\n )}\n </>\n );\n}\n\nIcon.propTypes = {\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","newId","withDeprecatedProps","DeprTypes","Icon","_ref","src","Component","id","className","hidden","screenReaderText","svgAttrs","size","attrs","_objectWithoutProperties","_excluded","hasAriaLabel","mergedSvgProps","_objectSpread","undefined","createElement","_extends","role","focusable","Fragment","propTypes","oneOfType","element","func","shape","string","oneOf","bool","defaultProps","deprType","FORMAT","expect","value","transform","Array","isArray","join","message"],"sources":["../../src/Icon/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport newId from '../utils/newId';\nimport withDeprecatedProps, { DeprTypes } from '../withDeprecatedProps';\n\n/**\n * An svg with an \"img\" role must satisfy the following a11y requirements\n * - It needs a text alternative in the form of aria-label, aria-labelledby, or screen-reader only text.\n * - If no label is desired, aria-label will be set to an empty string and aria-hidden to \"true\".\n * - focusable is set to false on the svg in all cases as a workaround for an ie11 bug\n */\n\nfunction Icon({\n src: Component,\n id,\n className,\n hidden,\n screenReaderText,\n svgAttrs,\n size,\n ...attrs\n}) {\n if (Component) {\n // If no aria label is specified, hide this icon from screenreaders\n const hasAriaLabel = svgAttrs['aria-label'] || svgAttrs['aria-labelledby'];\n\n const mergedSvgProps = { ...svgAttrs };\n\n if (!hasAriaLabel) {\n mergedSvgProps['aria-label'] = undefined;\n mergedSvgProps['aria-hidden'] = true;\n }\n\n return (\n <span\n className={classNames('pgn__icon', { [`pgn__icon__${size}`]: !!size }, className)}\n id={id}\n {...attrs}\n >\n <Component\n role=\"img\"\n focusable={false}\n {...mergedSvgProps}\n />\n {screenReaderText && (\n <span className=\"sr-only\">\n {screenReaderText}\n </span>\n )}\n </span>\n );\n }\n\n return (\n <>\n <span\n id={id || newId('Icon')}\n className={className}\n aria-hidden={hidden}\n />\n {screenReaderText && (\n <span className=\"sr-only\">\n {screenReaderText}\n </span>\n )}\n </>\n );\n}\n\nIcon.propTypes = {\n /**\n * An icon component to render.\n * Example import of a Paragon icon component: `import { Check } from '@edx/paragon/icons';`\n */\n src: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),\n /** HTML element attributes to pass through to the underlying svg element */\n svgAttrs: PropTypes.shape({\n 'aria-label': PropTypes.string,\n 'aria-labelledby': PropTypes.string,\n }),\n /**\n * the `id` property of the Icon element, by default this value is generated\n * with the `newId` function with the `prefix` of `Icon`.\n */\n id: PropTypes.string,\n /** The size of the icon. */\n size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg']),\n /** A class name that will define what the Icon looks like. */\n className: PropTypes.string,\n /**\n * a boolean that determines the value of `aria-hidden` attribute on the Icon span,\n * this value is `true` by default.\n */\n hidden: PropTypes.bool,\n /**\n * a string or an element that will be used on a secondary span leveraging the `sr-only` style\n * for screenreader only text, this value is `undefined` by default. This value is recommended for use unless\n * the Icon is being used in a way that is purely decorative or provides no additional context for screen\n * reader users. This field should be thought of the same way an `alt` attribute would be used for `image` tags.\n */\n screenReaderText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n};\n\nIcon.defaultProps = {\n src: null,\n svgAttrs: {},\n id: undefined,\n hidden: true,\n screenReaderText: undefined,\n size: undefined,\n className: undefined,\n};\n\nexport default withDeprecatedProps(Icon, 'Icon', {\n className: {\n deprType: DeprTypes.FORMAT,\n expect: value => typeof value === 'string',\n transform: value => (Array.isArray(value) ? value.join(' ') : value),\n message: 'It should be a string.',\n },\n});\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,KAAK,MAAM,gBAAgB;AAClC,OAAOC,mBAAmB,IAAIC,SAAS,QAAQ,wBAAwB;;AAEvE;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASC,IAAIA,CAAAC,IAAA,EASV;EAAA,IATW;MACZC,GAAG,EAAEC,SAAS;MACdC,EAAE;MACFC,SAAS;MACTC,MAAM;MACNC,gBAAgB;MAChBC,QAAQ;MACRC;IAEF,CAAC,GAAAR,IAAA;IADIS,KAAK,GAAAC,wBAAA,CAAAV,IAAA,EAAAW,SAAA;EAER,IAAIT,SAAS,EAAE;IACb;IACA,MAAMU,YAAY,GAAGL,QAAQ,CAAC,YAAY,CAAC,IAAIA,QAAQ,CAAC,iBAAiB,CAAC;IAE1E,MAAMM,cAAc,GAAAC,aAAA,KAAQP,QAAQ,CAAE;IAEtC,IAAI,CAACK,YAAY,EAAE;MACjBC,cAAc,CAAC,YAAY,CAAC,GAAGE,SAAS;MACxCF,cAAc,CAAC,aAAa,CAAC,GAAG,IAAI;IACtC;IAEA,oBACEpB,KAA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AS,EAAEV,SAAS,CAACgC,MAAM;EAC3B;AACF;AACA;AACA;EACErB,MAAM,EAAEX,SAAS,CAACkC,IAAI;EACtB;AACF;AACA;AACA;AACA;AACA;EACEtB,gBAAgB,EAAEZ,SAAS,CAAC4B,SAAS,CAAC,CAAC5B,SAAS,CAACgC,MAAM,EAAEhC,SAAS,CAAC6B,OAAO,CAAC;AAC7E,CAAC;AAEDxB,IAAI,CAAC8B,YAAY,GAAG;EAClB5B,GAAG,EAAE,IAAI;EACTM,QAAQ,EAAE,CAAC,CAAC;EACZJ,EAAE,EAAEY,SAAS;EACbV,MAAM,EAAE,IAAI;EACZC,gBAAgB,EAAES,SAAS;EAC3BP,IAAI,EAAEO,SAAS;EACfX,SAAS,EAAEW;AACb,CAAC;AAED,eAAelB,mBAAmB,CAACE,IAAI,EAAE,MAAM,EAAE;EAC/CK,SAAS,EAAE;IACT0B,QAAQ,EAAEhC,SAAS,CAACiC,MAAM;IAC1BC,MAAM,EAAEC,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ;IAC1CC,SAAS,EAAED,KAAK,IAAKE,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,GAAGA,KAAK,CAACI,IAAI,CAAC,GAAG,CAAC,GAAGJ,KAAM;IACpEK,OAAO,EAAE;EACX;AACF,CAAC,CAAC"}
|
package/dist/IconButton/index.js
CHANGED
|
@@ -76,7 +76,7 @@ IconButton.propTypes = {
|
|
|
76
76
|
alt: PropTypes.string.isRequired,
|
|
77
77
|
/** Changes icon styles for dark background */
|
|
78
78
|
invertColors: PropTypes.bool,
|
|
79
|
-
/** Accepts a React fontawesome icon.
|
|
79
|
+
/** Accepts a React fontawesome icon. */
|
|
80
80
|
icon: PropTypes.shape({
|
|
81
81
|
prefix: PropTypes.string,
|
|
82
82
|
iconName: PropTypes.string,
|