@razorpay/blade 11.32.0 → 11.33.0
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/build/lib/native/components/Button/IconButton/IconButton.js +1 -1
- package/build/lib/native/components/Button/IconButton/IconButton.js.map +1 -1
- package/build/lib/native/components/Table/TableContext.js +1 -1
- package/build/lib/native/components/Table/TableContext.js.map +1 -1
- package/build/lib/native/components/Table/tokens.js.map +1 -1
- package/build/lib/web/development/components/Button/IconButton/IconButton.js +2 -0
- package/build/lib/web/development/components/Button/IconButton/IconButton.js.map +1 -1
- package/build/lib/web/development/components/Button/IconButton/StyledIconButton.web.js +25 -3
- package/build/lib/web/development/components/Button/IconButton/StyledIconButton.web.js.map +1 -1
- package/build/lib/web/development/components/Button/IconButton/tokens.js +14 -0
- package/build/lib/web/development/components/Button/IconButton/tokens.js.map +1 -0
- package/build/lib/web/development/components/Table/Table.web.js +12 -3
- package/build/lib/web/development/components/Table/Table.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TableBody.web.js +214 -70
- package/build/lib/web/development/components/Table/TableBody.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TableContext.js +3 -1
- package/build/lib/web/development/components/Table/TableContext.js.map +1 -1
- package/build/lib/web/development/components/Table/TableHeader.web.js +14 -6
- package/build/lib/web/development/components/Table/TableHeader.web.js.map +1 -1
- package/build/lib/web/development/components/Table/tokens.js +6 -1
- package/build/lib/web/development/components/Table/tokens.js.map +1 -1
- package/build/lib/web/production/components/Button/IconButton/IconButton.js +2 -0
- package/build/lib/web/production/components/Button/IconButton/IconButton.js.map +1 -1
- package/build/lib/web/production/components/Button/IconButton/StyledIconButton.web.js +25 -3
- package/build/lib/web/production/components/Button/IconButton/StyledIconButton.web.js.map +1 -1
- package/build/lib/web/production/components/Button/IconButton/tokens.js +14 -0
- package/build/lib/web/production/components/Button/IconButton/tokens.js.map +1 -0
- package/build/lib/web/production/components/Table/Table.web.js +12 -3
- package/build/lib/web/production/components/Table/Table.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TableBody.web.js +214 -70
- package/build/lib/web/production/components/Table/TableBody.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TableContext.js +3 -1
- package/build/lib/web/production/components/Table/TableContext.js.map +1 -1
- package/build/lib/web/production/components/Table/TableHeader.web.js +14 -6
- package/build/lib/web/production/components/Table/TableHeader.web.js.map +1 -1
- package/build/lib/web/production/components/Table/tokens.js +6 -1
- package/build/lib/web/production/components/Table/tokens.js.map +1 -1
- package/build/types/components/index.d.ts +38 -17
- package/build/types/components/index.native.d.ts +30 -14
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.web.js","sources":["../../../../../../src/components/Table/Table.web.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo } from 'react';\nimport { Table as ReactTable } from '@table-library/react-table-library/table';\nimport { useTheme as useTableTheme } from '@table-library/react-table-library/theme';\nimport type { MiddlewareFunction } from '@table-library/react-table-library/types/common';\nimport { useSort } from '@table-library/react-table-library/sort';\nimport { usePagination } from '@table-library/react-table-library/pagination';\nimport {\n SelectClickTypes,\n SelectTypes,\n useRowSelect,\n} from '@table-library/react-table-library/select';\nimport styled from 'styled-components';\nimport usePresence from 'use-presence';\nimport type { TableContextType } from './TableContext';\nimport { TableContext } from './TableContext';\nimport { ComponentIds } from './componentIds';\nimport {\n checkboxCellWidth,\n firstColumnStickyZIndex,\n refreshWrapperZIndex,\n tableBackgroundColor,\n tablePagination,\n} from './tokens';\nimport type {\n TableProps,\n TableNode,\n Identifier,\n TablePaginationType,\n TableHeaderRowProps,\n} from './types';\nimport { makeBorderSize, makeMotionTime } from '~utils';\nimport { getComponentId, isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\nimport type { BoxProps } from '~components/Box';\nimport { getBaseBoxStyles } from '~components/Box/BaseBox/baseBoxStyles';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Spinner } from '~components/Spinner';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport { MetaConstants, metaAttribute } from '~utils/metaAttribute';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { useTheme } from '~components/BladeProvider';\nimport getIn from '~utils/lodashButBetter/get';\nimport { makeAccessible } from '~utils/makeAccessible';\n\nconst rowSelectType: Record<\n NonNullable<TableProps<unknown>['selectionType']>,\n SelectTypes | undefined\n> = {\n single: SelectTypes.SingleSelect,\n multiple: SelectTypes.MultiSelect,\n none: undefined,\n};\n\n// Get the number of TableHeaderCell components.\n// This is very complicated but the only way to iterate through the structure and get number of header cells.\n// Assuming number of header cells is the same as number of columns\nconst getTableHeaderCellCount = (children: (data: []) => React.ReactElement): number => {\n const tableRootComponent = children([]);\n if (tableRootComponent && React.isValidElement(tableRootComponent)) {\n const tableComponentArray = React.Children.toArray(tableRootComponent);\n if (React.isValidElement(tableComponentArray[0])) {\n const tableComponentArrayChildren = React.Children.toArray(\n tableComponentArray[0].props.children,\n );\n const tableHeader = tableComponentArrayChildren.find(\n (child) => getComponentId(child) === ComponentIds.TableHeader,\n );\n const tableHeaderChildrenArray = React.isValidElement(tableHeader)\n ? React.Children.toArray(tableHeader.props.children)\n : null;\n const tableHeaderRow = tableHeaderChildrenArray?.find(\n (child) => getComponentId(child) === ComponentIds.TableHeaderRow,\n );\n const tableHeaderRowChildrenArray = React.isValidElement(tableHeaderRow)\n ? React.Children.toArray(tableHeaderRow.props.children)\n : null;\n const tableHeaderCells = tableHeaderRowChildrenArray\n ? tableHeaderRowChildrenArray.filter(\n (child) => getComponentId(child) === ComponentIds.TableHeaderCell,\n )\n : null;\n return tableHeaderCells?.length ?? 0;\n }\n }\n return 0;\n};\n\nconst StyledReactTable = styled(ReactTable)<{ $styledProps?: { height?: BoxProps['height'] } }>(\n ({ $styledProps }) => {\n const { theme } = useTheme();\n const styledPropsCSSObject = getBaseBoxStyles({\n theme,\n height: $styledProps?.height,\n });\n\n return {\n '&&&': {\n ...styledPropsCSSObject,\n },\n };\n },\n);\n\nconst RefreshWrapper = styled(BaseBox)<{\n isRefreshSpinnerVisible: boolean;\n isRefreshSpinnerEntering: boolean;\n isRefreshSpinnerExiting: boolean;\n}>(({ isRefreshSpinnerVisible, isRefreshSpinnerEntering, isRefreshSpinnerExiting, theme }) => {\n return {\n opacity: isRefreshSpinnerVisible ? 1 : 0,\n transition: `opacity ${makeMotionTime(theme.motion.duration.quick)} ${\n isRefreshSpinnerEntering\n ? theme.motion.easing.entrance.effective\n : isRefreshSpinnerExiting\n ? theme.motion.easing.exit.effective\n : ''\n }`,\n };\n});\n\nconst _Table = <Item,>({\n children,\n data,\n multiSelectTrigger = 'row',\n selectionType = 'none',\n onSelectionChange,\n isHeaderSticky,\n isFooterSticky,\n isFirstColumnSticky,\n rowDensity = 'normal',\n onSortChange,\n sortFunctions,\n toolbar,\n pagination,\n height,\n showStripedRows,\n gridTemplateColumns,\n isLoading = false,\n isRefreshing = false,\n showBorderedCells = false,\n defaultSelectedIds = [],\n ...styledProps\n}: TableProps<Item>): React.ReactElement => {\n const { theme } = useTheme();\n const [selectedRows, setSelectedRows] = React.useState<TableNode<unknown>['id'][]>(\n selectionType !== 'none' ? defaultSelectedIds : [],\n );\n const [disabledRows, setDisabledRows] = React.useState<TableNode<unknown>['id'][]>([]);\n const [totalItems, setTotalItems] = React.useState(data.nodes.length || 0);\n const [paginationType, setPaginationType] = React.useState<NonNullable<TablePaginationType>>(\n 'client',\n );\n const [headerRowDensity, setHeaderRowDensity] = React.useState<TableHeaderRowProps['rowDensity']>(\n undefined,\n );\n // Need to make header is sticky if first column is sticky otherwise the first header cell will not be sticky\n const shouldHeaderBeSticky = isHeaderSticky ?? isFirstColumnSticky;\n const backgroundColor = tableBackgroundColor;\n\n const {\n isEntering: isRefreshSpinnerEntering,\n isMounted: isRefreshSpinnerMounted,\n isExiting: isRefreshSpinnerExiting,\n isVisible: isRefreshSpinnerVisible,\n } = usePresence(isRefreshing, {\n transitionDuration: theme.motion.duration.quick,\n });\n\n // Table Theme\n const columnCount = getTableHeaderCellCount(children);\n const firstColumnStickyHeaderCellCSS = isFirstColumnSticky\n ? `\n &:nth-of-type(1) {\n left: 0 !important;\n position: sticky !important;\n z-index: ${firstColumnStickyZIndex} !important;\n }\n ${\n selectionType === 'multiple' &&\n `&:nth-of-type(2) {\n left: ${checkboxCellWidth}px !important;\n position: sticky !important;\n z-index: ${firstColumnStickyZIndex} !important;\n }\n `\n }`\n : '';\n const firstColumnStickyFooterCellCSS = isFirstColumnSticky\n ? `\n &:nth-of-type(1) {\n left: 0 !important;\n position: sticky !important;\n z-index: ${firstColumnStickyZIndex} !important;\n }\n ${\n selectionType === 'multiple' &&\n `&:nth-of-type(2) {\n left: ${checkboxCellWidth}px !important;\n position: sticky !important;\n z-index: ${firstColumnStickyZIndex} !important;\n }\n `\n }`\n : '';\n const firstColumnStickyBodyCellCSS = isFirstColumnSticky\n ? `\n &:nth-of-type(1) {\n left: 0 !important;\n position: sticky !important;\n z-index: ${firstColumnStickyZIndex} !important;\n }\n ${\n selectionType === 'multiple' &&\n `&:nth-of-type(2) {\n left: ${checkboxCellWidth}px !important;\n position: sticky !important;\n z-index: ${firstColumnStickyZIndex} !important;\n }\n `\n }`\n : '';\n\n const tableTheme = useTableTheme({\n Table: `\n height:${isFooterSticky ? `100%` : undefined};\n border: ${makeBorderSize(theme.border.width.thin)} solid ${\n theme.colors.surface.border.gray.muted\n };\n --data-table-library_grid-template-columns: ${\n gridTemplateColumns ??\n ` ${\n selectionType === 'multiple' ? 'min-content' : ''\n } repeat(${columnCount},minmax(100px, 1fr)) !important;`\n } !important;\n background-color: ${getIn(theme.colors, backgroundColor)};\n `,\n HeaderCell: `\n position: ${shouldHeaderBeSticky ? 'sticky' : 'relative'};\n \n top: ${shouldHeaderBeSticky ? '0' : undefined};\n ${firstColumnStickyHeaderCellCSS}\n `,\n Cell: `\n ${firstColumnStickyBodyCellCSS}\n `,\n FooterCell: `\n position: ${isFooterSticky ? 'sticky' : 'relative'};\n bottom: ${isFooterSticky ? '0' : undefined};\n ${firstColumnStickyFooterCellCSS}\n `,\n });\n\n useEffect(() => {\n // Get the total number of items\n setTotalItems(data.nodes.length);\n }, [data.nodes]);\n\n // Selection Logic\n const onSelectChange: MiddlewareFunction = (action, state): void => {\n const selectedIds: Identifier[] = state.id ? [state.id] : state.ids ?? [];\n setSelectedRows(selectedIds);\n onSelectionChange?.({\n selectedIds,\n values: data.nodes.filter((node) => selectedIds.includes(node.id)),\n });\n };\n\n const rowSelectConfig = useRowSelect(\n data,\n {\n onChange: onSelectChange,\n state: {\n ...(selectionType === 'multiple'\n ? { ids: selectedRows }\n : selectionType === 'single'\n ? { id: selectedRows[0] }\n : {}),\n },\n },\n {\n clickType:\n multiSelectTrigger === 'row' ? SelectClickTypes.RowClick : SelectClickTypes.ButtonClick,\n rowSelect: selectionType !== 'none' ? rowSelectType[selectionType] : undefined,\n },\n );\n\n const toggleRowSelectionById = useMemo(\n () => (id: Identifier): void => {\n rowSelectConfig.fns.onToggleById(id);\n },\n [rowSelectConfig.fns],\n );\n\n const deselectAllRows = useMemo(\n () => (): void => {\n rowSelectConfig.fns.onRemoveAll();\n },\n [rowSelectConfig.fns],\n );\n\n const toggleAllRowsSelection = useMemo(\n () => (): void => {\n if (selectedRows.length > 0) {\n rowSelectConfig.fns.onRemoveAll();\n } else {\n const ids = data.nodes\n .map((item: TableNode<Item>) => (disabledRows.includes(item.id) ? null : item.id))\n .filter(Boolean) as Identifier[];\n\n rowSelectConfig.fns.onAddAll(ids);\n }\n },\n [rowSelectConfig.fns, data.nodes, selectedRows, disabledRows],\n );\n\n // Sort Logic\n const handleSortChange: MiddlewareFunction = (action, state) => {\n onSortChange?.({\n sortKey: state.sortKey,\n isSortReversed: state.reverse,\n });\n };\n\n const sort = useSort(\n data,\n {\n onChange: handleSortChange,\n },\n {\n // @ts-expect-error ignore this, if sortFunctions is undefined, it will be ignored\n sortFns: sortFunctions,\n },\n );\n\n const currentSortedState: TableContextType['currentSortedState'] = useMemo(() => {\n return {\n sortKey: sort.state.sortKey,\n isSortReversed: sort.state.reverse,\n sortableColumns: Object.keys(sortFunctions ?? {}),\n };\n }, [sort.state, sortFunctions]);\n\n const toggleSort = useCallback(\n (sortKey: string): void => {\n sort.fns.onToggleSort({\n sortKey,\n });\n },\n [sort.fns],\n );\n\n // Pagination\n\n const hasPagination = Boolean(pagination);\n\n const paginationConfig = usePagination(\n data,\n {\n state: {\n page: 0,\n size: tablePagination.defaultPageSize,\n },\n },\n {\n isServer: paginationType === 'server',\n },\n );\n\n const currentPaginationState = useMemo(() => {\n return hasPagination\n ? {\n page: paginationConfig.state.page,\n size: paginationConfig.state.size,\n }\n : undefined;\n }, [paginationConfig.state, hasPagination]);\n\n const setPaginationPage = useCallback(\n (page: number): void => {\n paginationConfig.fns.onSetPage(page);\n },\n [paginationConfig.fns],\n );\n\n const setPaginationRowSize = useCallback(\n (size: number): void => {\n paginationConfig.fns.onSetSize(size);\n },\n [paginationConfig.fns],\n );\n\n // Toolbar Component\n if (__DEV__) {\n if (toolbar && !isValidAllowedChildren(toolbar, ComponentIds.TableToolbar)) {\n throwBladeError({\n message: 'Only TableToolbar component is allowed in the `toolbar` prop',\n moduleName: 'Table',\n });\n }\n }\n\n // Table Context\n const tableContext: TableContextType = useMemo(\n () => ({\n selectionType,\n selectedRows,\n totalItems,\n toggleRowSelectionById,\n toggleAllRowsSelection,\n deselectAllRows,\n rowDensity,\n toggleSort,\n currentSortedState,\n setPaginationPage,\n setPaginationRowSize,\n currentPaginationState,\n showStripedRows,\n disabledRows,\n setDisabledRows,\n paginationType,\n setPaginationType,\n backgroundColor,\n headerRowDensity,\n setHeaderRowDensity,\n showBorderedCells,\n }),\n [\n selectionType,\n selectedRows,\n totalItems,\n toggleRowSelectionById,\n toggleAllRowsSelection,\n deselectAllRows,\n rowDensity,\n toggleSort,\n currentSortedState,\n setPaginationPage,\n setPaginationRowSize,\n currentPaginationState,\n showStripedRows,\n disabledRows,\n setDisabledRows,\n paginationType,\n setPaginationType,\n backgroundColor,\n headerRowDensity,\n setHeaderRowDensity,\n showBorderedCells,\n ],\n );\n\n return (\n <TableContext.Provider value={tableContext}>\n {isLoading ? (\n <BaseBox\n display=\"flex\"\n flex={1}\n alignItems=\"center\"\n justifyContent=\"center\"\n height={height}\n {...getStyledProps(styledProps)}\n {...metaAttribute({ name: MetaConstants.Table })}\n >\n <Spinner accessibilityLabel=\"Loading Table\" size=\"large\" testID=\"table-spinner\" />\n </BaseBox>\n ) : (\n <BaseBox\n flex={1}\n position=\"relative\"\n {...getStyledProps(styledProps)}\n {...metaAttribute({ name: MetaConstants.Table })}\n >\n {isRefreshSpinnerMounted && (\n <RefreshWrapper\n position=\"absolute\"\n width=\"100%\"\n height=\"100%\"\n zIndex={refreshWrapperZIndex}\n backgroundColor=\"overlay.background.subtle\"\n justifyContent=\"center\"\n alignItems=\"center\"\n display=\"flex\"\n isRefreshSpinnerEntering={isRefreshSpinnerEntering}\n isRefreshSpinnerExiting={isRefreshSpinnerExiting}\n isRefreshSpinnerVisible={isRefreshSpinnerVisible}\n >\n <Spinner color=\"white\" accessibilityLabel=\"Refreshing Table\" size=\"large\" />\n </RefreshWrapper>\n )}\n {toolbar}\n <StyledReactTable\n role=\"table\"\n layout={{ fixedHeader: shouldHeaderBeSticky, horizontalScroll: true }}\n data={data}\n // @ts-expect-error ignore this, theme clashes with styled-component's theme. We're using useTheme from blade to get actual theme\n theme={tableTheme}\n select={selectionType !== 'none' ? rowSelectConfig : null}\n sort={sortFunctions ? sort : null}\n $styledProps={{\n height,\n }}\n pagination={hasPagination ? paginationConfig : null}\n {...makeAccessible({ multiSelectable: selectionType === 'multiple' })}\n {...metaAttribute({ name: MetaConstants.Table })}\n >\n {children}\n </StyledReactTable>\n {pagination}\n </BaseBox>\n )}\n </TableContext.Provider>\n );\n};\n\nconst Table = assignWithoutSideEffects(_Table, {\n componentId: ComponentIds.Table,\n});\n\nexport { Table };\n"],"names":["rowSelectType","single","SelectTypes","SingleSelect","multiple","MultiSelect","none","undefined","getTableHeaderCellCount","children","tableRootComponent","React","isValidElement","tableComponentArray","Children","toArray","_tableHeaderCells$len","tableComponentArrayChildren","props","tableHeader","find","child","getComponentId","ComponentIds","TableHeader","tableHeaderChildrenArray","tableHeaderRow","TableHeaderRow","tableHeaderRowChildrenArray","tableHeaderCells","filter","TableHeaderCell","length","StyledReactTable","styled","ReactTable","withConfig","displayName","componentId","_ref","$styledProps","_useTheme","useTheme","theme","styledPropsCSSObject","getBaseBoxStyles","height","_objectSpread","RefreshWrapper","BaseBox","_ref2","isRefreshSpinnerVisible","isRefreshSpinnerEntering","isRefreshSpinnerExiting","opacity","transition","concat","makeMotionTime","motion","duration","quick","easing","entrance","effective","exit","_Table","_ref3","data","_ref3$multiSelectTrig","multiSelectTrigger","_ref3$selectionType","selectionType","onSelectionChange","isHeaderSticky","isFooterSticky","isFirstColumnSticky","_ref3$rowDensity","rowDensity","onSortChange","sortFunctions","toolbar","pagination","showStripedRows","gridTemplateColumns","_ref3$isLoading","isLoading","_ref3$isRefreshing","isRefreshing","_ref3$showBorderedCel","showBorderedCells","_ref3$defaultSelected","defaultSelectedIds","styledProps","_objectWithoutProperties","_excluded","_useTheme2","_React$useState","useState","_React$useState2","_slicedToArray","selectedRows","setSelectedRows","_React$useState3","_React$useState4","disabledRows","setDisabledRows","_React$useState5","nodes","_React$useState6","totalItems","setTotalItems","_React$useState7","_React$useState8","paginationType","setPaginationType","_React$useState9","_React$useState10","headerRowDensity","setHeaderRowDensity","shouldHeaderBeSticky","backgroundColor","tableBackgroundColor","_usePresence","usePresence","transitionDuration","isEntering","isRefreshSpinnerMounted","isMounted","isExiting","isVisible","columnCount","firstColumnStickyHeaderCellCSS","firstColumnStickyZIndex","checkboxCellWidth","firstColumnStickyFooterCellCSS","firstColumnStickyBodyCellCSS","tableTheme","useTableTheme","Table","makeBorderSize","border","width","thin","colors","surface","gray","muted","getIn","HeaderCell","Cell","FooterCell","useEffect","onSelectChange","action","state","_state$ids","selectedIds","id","ids","values","node","includes","rowSelectConfig","useRowSelect","onChange","clickType","SelectClickTypes","RowClick","ButtonClick","rowSelect","toggleRowSelectionById","useMemo","fns","onToggleById","deselectAllRows","onRemoveAll","toggleAllRowsSelection","map","item","Boolean","onAddAll","handleSortChange","sortKey","isSortReversed","reverse","sort","useSort","sortFns","currentSortedState","sortableColumns","Object","keys","toggleSort","useCallback","onToggleSort","hasPagination","paginationConfig","usePagination","page","size","tablePagination","defaultPageSize","isServer","currentPaginationState","setPaginationPage","onSetPage","setPaginationRowSize","onSetSize","isValidAllowedChildren","TableToolbar","throwBladeError","message","moduleName","tableContext","_jsx","TableContext","Provider","value","display","flex","alignItems","justifyContent","getStyledProps","metaAttribute","name","MetaConstants","Spinner","accessibilityLabel","testID","_jsxs","position","zIndex","refreshWrapperZIndex","color","role","layout","fixedHeader","horizontalScroll","select","makeAccessible","multiSelectable","assignWithoutSideEffects"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAMA,aAGL,GAAG;EACFC,MAAM,EAAEC,WAAW,CAACC,YAAY;EAChCC,QAAQ,EAAEF,WAAW,CAACG,WAAW;AACjCC,EAAAA,IAAI,EAAEC,SAAAA;AACR,CAAC,CAAA;;AAED;AACA;AACA;AACA,IAAMC,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAIC,QAA0C,EAAa;AACtF,EAAA,IAAMC,kBAAkB,GAAGD,QAAQ,CAAC,EAAE,CAAC,CAAA;EACvC,IAAIC,kBAAkB,iBAAIC,cAAK,CAACC,cAAc,CAACF,kBAAkB,CAAC,EAAE;IAClE,IAAMG,mBAAmB,GAAGF,cAAK,CAACG,QAAQ,CAACC,OAAO,CAACL,kBAAkB,CAAC,CAAA;IACtE,kBAAIC,cAAK,CAACC,cAAc,CAACC,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE;AAAA,MAAA,IAAAG,qBAAA,CAAA;AAChD,MAAA,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AAwB,CAAChL,MAAM,EAAE;EAC7C3B,WAAW,EAAEf,YAAY,CAACmH,KAAAA;AAC5B,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"Table.web.js","sources":["../../../../../../src/components/Table/Table.web.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo } from 'react';\nimport { Table as ReactTable } from '@table-library/react-table-library/table';\nimport { useTheme as useTableTheme } from '@table-library/react-table-library/theme';\nimport type { MiddlewareFunction } from '@table-library/react-table-library/types/common';\nimport { useSort } from '@table-library/react-table-library/sort';\nimport { usePagination } from '@table-library/react-table-library/pagination';\nimport {\n SelectClickTypes,\n SelectTypes,\n useRowSelect,\n} from '@table-library/react-table-library/select';\nimport styled from 'styled-components';\nimport usePresence from 'use-presence';\nimport type { TableContextType } from './TableContext';\nimport { TableContext } from './TableContext';\nimport { ComponentIds } from './componentIds';\nimport {\n checkboxCellWidth,\n firstColumnStickyZIndex,\n refreshWrapperZIndex,\n tableBackgroundColor,\n tablePagination,\n} from './tokens';\nimport type {\n TableProps,\n TableNode,\n Identifier,\n TablePaginationType,\n TableHeaderRowProps,\n} from './types';\nimport { makeBorderSize, makeMotionTime } from '~utils';\nimport { getComponentId, isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\nimport type { BoxProps } from '~components/Box';\nimport { getBaseBoxStyles } from '~components/Box/BaseBox/baseBoxStyles';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Spinner } from '~components/Spinner';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport { MetaConstants, metaAttribute } from '~utils/metaAttribute';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { useTheme } from '~components/BladeProvider';\nimport getIn from '~utils/lodashButBetter/get';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { useIsMobile } from '~utils/useIsMobile';\n\nconst rowSelectType: Record<\n NonNullable<TableProps<unknown>['selectionType']>,\n SelectTypes | undefined\n> = {\n single: SelectTypes.SingleSelect,\n multiple: SelectTypes.MultiSelect,\n none: undefined,\n};\n\n// Get the number of TableHeaderCell components.\n// This is very complicated but the only way to iterate through the structure and get number of header cells.\n// Assuming number of header cells is the same as number of columns\nconst getTableHeaderCellCount = (children: (data: []) => React.ReactElement): number => {\n const tableRootComponent = children([]);\n if (tableRootComponent && React.isValidElement(tableRootComponent)) {\n const tableComponentArray = React.Children.toArray(tableRootComponent);\n if (React.isValidElement(tableComponentArray[0])) {\n const tableComponentArrayChildren = React.Children.toArray(\n tableComponentArray[0].props.children,\n );\n const tableHeader = tableComponentArrayChildren.find(\n (child) => getComponentId(child) === ComponentIds.TableHeader,\n );\n const tableHeaderChildrenArray = React.isValidElement(tableHeader)\n ? React.Children.toArray(tableHeader.props.children)\n : null;\n const tableHeaderRow = tableHeaderChildrenArray?.find(\n (child) => getComponentId(child) === ComponentIds.TableHeaderRow,\n );\n const tableHeaderRowChildrenArray = React.isValidElement(tableHeaderRow)\n ? React.Children.toArray(tableHeaderRow.props.children)\n : null;\n const tableHeaderCells = tableHeaderRowChildrenArray\n ? tableHeaderRowChildrenArray.filter(\n (child) => getComponentId(child) === ComponentIds.TableHeaderCell,\n )\n : null;\n return tableHeaderCells?.length ?? 0;\n }\n }\n return 0;\n};\n\nconst StyledReactTable = styled(ReactTable)<{ $styledProps?: { height?: BoxProps['height'] } }>(\n ({ $styledProps }) => {\n const { theme } = useTheme();\n const styledPropsCSSObject = getBaseBoxStyles({\n theme,\n height: $styledProps?.height,\n });\n\n return {\n '&&&': {\n ...styledPropsCSSObject,\n },\n };\n },\n);\n\nconst RefreshWrapper = styled(BaseBox)<{\n isRefreshSpinnerVisible: boolean;\n isRefreshSpinnerEntering: boolean;\n isRefreshSpinnerExiting: boolean;\n}>(({ isRefreshSpinnerVisible, isRefreshSpinnerEntering, isRefreshSpinnerExiting, theme }) => {\n return {\n opacity: isRefreshSpinnerVisible ? 1 : 0,\n transition: `opacity ${makeMotionTime(theme.motion.duration.quick)} ${\n isRefreshSpinnerEntering\n ? theme.motion.easing.entrance.effective\n : isRefreshSpinnerExiting\n ? theme.motion.easing.exit.effective\n : ''\n }`,\n };\n});\n\nconst _Table = <Item,>({\n children,\n data,\n multiSelectTrigger = 'row',\n selectionType = 'none',\n onSelectionChange,\n isHeaderSticky,\n isFooterSticky,\n isFirstColumnSticky,\n rowDensity = 'normal',\n onSortChange,\n sortFunctions,\n toolbar,\n pagination,\n height,\n showStripedRows,\n gridTemplateColumns,\n isLoading = false,\n isRefreshing = false,\n showBorderedCells = false,\n defaultSelectedIds = [],\n ...styledProps\n}: TableProps<Item>): React.ReactElement => {\n const { theme } = useTheme();\n const [selectedRows, setSelectedRows] = React.useState<TableNode<unknown>['id'][]>(\n selectionType !== 'none' ? defaultSelectedIds : [],\n );\n const [disabledRows, setDisabledRows] = React.useState<TableNode<unknown>['id'][]>([]);\n const [totalItems, setTotalItems] = React.useState(data.nodes.length || 0);\n const [paginationType, setPaginationType] = React.useState<NonNullable<TablePaginationType>>(\n 'client',\n );\n const [headerRowDensity, setHeaderRowDensity] = React.useState<TableHeaderRowProps['rowDensity']>(\n undefined,\n );\n const [hasHoverActions, setHasHoverActions] = React.useState(false);\n // Need to make header is sticky if first column is sticky otherwise the first header cell will not be sticky\n const shouldHeaderBeSticky = isHeaderSticky ?? isFirstColumnSticky;\n const backgroundColor = tableBackgroundColor;\n\n const isMobile = useIsMobile();\n const lastHoverActionsColWidth = isMobile ? '1fr' : '0px';\n\n const {\n isEntering: isRefreshSpinnerEntering,\n isMounted: isRefreshSpinnerMounted,\n isExiting: isRefreshSpinnerExiting,\n isVisible: isRefreshSpinnerVisible,\n } = usePresence(isRefreshing, {\n transitionDuration: theme.motion.duration.quick,\n });\n\n // Table Theme\n const columnCount = getTableHeaderCellCount(children);\n const firstColumnStickyHeaderCellCSS = isFirstColumnSticky\n ? `\n &:nth-of-type(1) {\n left: 0 !important;\n position: sticky !important;\n z-index: ${firstColumnStickyZIndex} !important;\n }\n ${\n selectionType === 'multiple' &&\n `&:nth-of-type(2) {\n left: ${checkboxCellWidth}px !important;\n position: sticky !important;\n z-index: ${firstColumnStickyZIndex} !important;\n }\n `\n }`\n : '';\n const firstColumnStickyFooterCellCSS = isFirstColumnSticky\n ? `\n &:nth-of-type(1) {\n left: 0 !important;\n position: sticky !important;\n z-index: ${firstColumnStickyZIndex} !important;\n }\n ${\n selectionType === 'multiple' &&\n `&:nth-of-type(2) {\n left: ${checkboxCellWidth}px !important;\n position: sticky !important;\n z-index: ${firstColumnStickyZIndex} !important;\n }\n `\n }`\n : '';\n const firstColumnStickyBodyCellCSS = isFirstColumnSticky\n ? `\n &:nth-of-type(1) {\n left: 0 !important;\n position: sticky !important;\n z-index: ${firstColumnStickyZIndex} !important;\n }\n ${\n selectionType === 'multiple' &&\n `&:nth-of-type(2) {\n left: ${checkboxCellWidth}px !important;\n position: sticky !important;\n z-index: ${firstColumnStickyZIndex} !important;\n }\n `\n }`\n : '';\n\n const tableTheme = useTableTheme({\n Table: `\n height:${isFooterSticky ? `100%` : undefined};\n border: ${makeBorderSize(theme.border.width.thin)} solid ${\n theme.colors.surface.border.gray.muted\n };\n --data-table-library_grid-template-columns: ${\n gridTemplateColumns\n ? `${gridTemplateColumns} ${hasHoverActions ? lastHoverActionsColWidth : ''}`\n : ` ${\n selectionType === 'multiple' ? 'min-content' : ''\n } repeat(${columnCount},minmax(100px, 1fr)) ${\n hasHoverActions ? lastHoverActionsColWidth : ''\n } !important;`\n } !important;\n background-color: ${getIn(theme.colors, backgroundColor)};\n `,\n HeaderCell: `\n position: ${shouldHeaderBeSticky ? 'sticky' : 'relative'};\n \n top: ${shouldHeaderBeSticky ? '0' : undefined};\n ${firstColumnStickyHeaderCellCSS}\n `,\n Cell: `\n ${firstColumnStickyBodyCellCSS}\n `,\n FooterCell: `\n position: ${isFooterSticky ? 'sticky' : 'relative'};\n bottom: ${isFooterSticky ? '0' : undefined};\n ${firstColumnStickyFooterCellCSS}\n `,\n });\n\n useEffect(() => {\n // Get the total number of items\n setTotalItems(data.nodes.length);\n }, [data.nodes]);\n\n // Selection Logic\n const onSelectChange: MiddlewareFunction = (action, state): void => {\n const selectedIds: Identifier[] = state.id ? [state.id] : state.ids ?? [];\n setSelectedRows(selectedIds);\n onSelectionChange?.({\n selectedIds,\n values: data.nodes.filter((node) => selectedIds.includes(node.id)),\n });\n };\n\n const rowSelectConfig = useRowSelect(\n data,\n {\n onChange: onSelectChange,\n state: {\n ...(selectionType === 'multiple'\n ? { ids: selectedRows }\n : selectionType === 'single'\n ? { id: selectedRows[0] }\n : {}),\n },\n },\n {\n clickType:\n multiSelectTrigger === 'row' ? SelectClickTypes.RowClick : SelectClickTypes.ButtonClick,\n rowSelect: selectionType !== 'none' ? rowSelectType[selectionType] : undefined,\n },\n );\n\n const toggleRowSelectionById = useMemo(\n () => (id: Identifier): void => {\n rowSelectConfig.fns.onToggleById(id);\n },\n [rowSelectConfig.fns],\n );\n\n const deselectAllRows = useMemo(\n () => (): void => {\n rowSelectConfig.fns.onRemoveAll();\n },\n [rowSelectConfig.fns],\n );\n\n const toggleAllRowsSelection = useMemo(\n () => (): void => {\n if (selectedRows.length > 0) {\n rowSelectConfig.fns.onRemoveAll();\n } else {\n const ids = data.nodes\n .map((item: TableNode<Item>) => (disabledRows.includes(item.id) ? null : item.id))\n .filter(Boolean) as Identifier[];\n\n rowSelectConfig.fns.onAddAll(ids);\n }\n },\n [rowSelectConfig.fns, data.nodes, selectedRows, disabledRows],\n );\n\n // Sort Logic\n const handleSortChange: MiddlewareFunction = (action, state) => {\n onSortChange?.({\n sortKey: state.sortKey,\n isSortReversed: state.reverse,\n });\n };\n\n const sort = useSort(\n data,\n {\n onChange: handleSortChange,\n },\n {\n // @ts-expect-error ignore this, if sortFunctions is undefined, it will be ignored\n sortFns: sortFunctions,\n },\n );\n\n const currentSortedState: TableContextType['currentSortedState'] = useMemo(() => {\n return {\n sortKey: sort.state.sortKey,\n isSortReversed: sort.state.reverse,\n sortableColumns: Object.keys(sortFunctions ?? {}),\n };\n }, [sort.state, sortFunctions]);\n\n const toggleSort = useCallback(\n (sortKey: string): void => {\n sort.fns.onToggleSort({\n sortKey,\n });\n },\n [sort.fns],\n );\n\n // Pagination\n\n const hasPagination = Boolean(pagination);\n\n const paginationConfig = usePagination(\n data,\n {\n state: {\n page: 0,\n size: tablePagination.defaultPageSize,\n },\n },\n {\n isServer: paginationType === 'server',\n },\n );\n\n const currentPaginationState = useMemo(() => {\n return hasPagination\n ? {\n page: paginationConfig.state.page,\n size: paginationConfig.state.size,\n }\n : undefined;\n }, [paginationConfig.state, hasPagination]);\n\n const setPaginationPage = useCallback(\n (page: number): void => {\n paginationConfig.fns.onSetPage(page);\n },\n [paginationConfig.fns],\n );\n\n const setPaginationRowSize = useCallback(\n (size: number): void => {\n paginationConfig.fns.onSetSize(size);\n },\n [paginationConfig.fns],\n );\n\n // Toolbar Component\n if (__DEV__) {\n if (toolbar && !isValidAllowedChildren(toolbar, ComponentIds.TableToolbar)) {\n throwBladeError({\n message: 'Only TableToolbar component is allowed in the `toolbar` prop',\n moduleName: 'Table',\n });\n }\n }\n\n // Table Context\n const tableContext: TableContextType = useMemo(\n () => ({\n selectionType,\n selectedRows,\n totalItems,\n toggleRowSelectionById,\n toggleAllRowsSelection,\n deselectAllRows,\n rowDensity,\n toggleSort,\n currentSortedState,\n setPaginationPage,\n setPaginationRowSize,\n currentPaginationState,\n showStripedRows,\n disabledRows,\n setDisabledRows,\n paginationType,\n setPaginationType,\n backgroundColor,\n headerRowDensity,\n setHeaderRowDensity,\n showBorderedCells,\n hasHoverActions,\n setHasHoverActions,\n }),\n [\n selectionType,\n selectedRows,\n totalItems,\n toggleRowSelectionById,\n toggleAllRowsSelection,\n deselectAllRows,\n rowDensity,\n toggleSort,\n currentSortedState,\n setPaginationPage,\n setPaginationRowSize,\n currentPaginationState,\n showStripedRows,\n disabledRows,\n setDisabledRows,\n paginationType,\n setPaginationType,\n backgroundColor,\n headerRowDensity,\n setHeaderRowDensity,\n showBorderedCells,\n hasHoverActions,\n setHasHoverActions,\n ],\n );\n\n return (\n <TableContext.Provider value={tableContext}>\n {isLoading ? (\n <BaseBox\n display=\"flex\"\n flex={1}\n alignItems=\"center\"\n justifyContent=\"center\"\n height={height}\n {...getStyledProps(styledProps)}\n {...metaAttribute({ name: MetaConstants.Table })}\n >\n <Spinner accessibilityLabel=\"Loading Table\" size=\"large\" testID=\"table-spinner\" />\n </BaseBox>\n ) : (\n <BaseBox\n flex={1}\n position=\"relative\"\n {...getStyledProps(styledProps)}\n {...metaAttribute({ name: MetaConstants.Table })}\n >\n {isRefreshSpinnerMounted && (\n <RefreshWrapper\n position=\"absolute\"\n width=\"100%\"\n height=\"100%\"\n zIndex={refreshWrapperZIndex}\n backgroundColor=\"overlay.background.subtle\"\n justifyContent=\"center\"\n alignItems=\"center\"\n display=\"flex\"\n isRefreshSpinnerEntering={isRefreshSpinnerEntering}\n isRefreshSpinnerExiting={isRefreshSpinnerExiting}\n isRefreshSpinnerVisible={isRefreshSpinnerVisible}\n >\n <Spinner color=\"white\" accessibilityLabel=\"Refreshing Table\" size=\"large\" />\n </RefreshWrapper>\n )}\n {toolbar}\n <StyledReactTable\n role=\"table\"\n layout={{ fixedHeader: shouldHeaderBeSticky, horizontalScroll: true }}\n data={data}\n // @ts-expect-error ignore this, theme clashes with styled-component's theme. We're using useTheme from blade to get actual theme\n theme={tableTheme}\n select={selectionType !== 'none' ? rowSelectConfig : null}\n sort={sortFunctions ? sort : null}\n $styledProps={{\n height,\n }}\n pagination={hasPagination ? paginationConfig : null}\n {...makeAccessible({ multiSelectable: selectionType === 'multiple' })}\n {...metaAttribute({ name: MetaConstants.Table })}\n >\n {children}\n </StyledReactTable>\n {pagination}\n </BaseBox>\n )}\n </TableContext.Provider>\n );\n};\n\nconst Table = assignWithoutSideEffects(_Table, {\n componentId: ComponentIds.Table,\n});\n\nexport { Table };\n"],"names":["rowSelectType","single","SelectTypes","SingleSelect","multiple","MultiSelect","none","undefined","getTableHeaderCellCount","children","tableRootComponent","React","isValidElement","tableComponentArray","Children","toArray","_tableHeaderCells$len","tableComponentArrayChildren","props","tableHeader","find","child","getComponentId","ComponentIds","TableHeader","tableHeaderChildrenArray","tableHeaderRow","TableHeaderRow","tableHeaderRowChildrenArray","tableHeaderCells","filter","TableHeaderCell","length","StyledReactTable","styled","ReactTable","withConfig","displayName","componentId","_ref","$styledProps","_useTheme","useTheme","theme","styledPropsCSSObject","getBaseBoxStyles","height","_objectSpread","RefreshWrapper","BaseBox","_ref2","isRefreshSpinnerVisible","isRefreshSpinnerEntering","isRefreshSpinnerExiting","opacity","transition","concat","makeMotionTime","motion","duration","quick","easing","entrance","effective","exit","_Table","_ref3","data","_ref3$multiSelectTrig","multiSelectTrigger","_ref3$selectionType","selectionType","onSelectionChange","isHeaderSticky","isFooterSticky","isFirstColumnSticky","_ref3$rowDensity","rowDensity","onSortChange","sortFunctions","toolbar","pagination","showStripedRows","gridTemplateColumns","_ref3$isLoading","isLoading","_ref3$isRefreshing","isRefreshing","_ref3$showBorderedCel","showBorderedCells","_ref3$defaultSelected","defaultSelectedIds","styledProps","_objectWithoutProperties","_excluded","_useTheme2","_React$useState","useState","_React$useState2","_slicedToArray","selectedRows","setSelectedRows","_React$useState3","_React$useState4","disabledRows","setDisabledRows","_React$useState5","nodes","_React$useState6","totalItems","setTotalItems","_React$useState7","_React$useState8","paginationType","setPaginationType","_React$useState9","_React$useState10","headerRowDensity","setHeaderRowDensity","_React$useState11","_React$useState12","hasHoverActions","setHasHoverActions","shouldHeaderBeSticky","backgroundColor","tableBackgroundColor","isMobile","useIsMobile","lastHoverActionsColWidth","_usePresence","usePresence","transitionDuration","isEntering","isRefreshSpinnerMounted","isMounted","isExiting","isVisible","columnCount","firstColumnStickyHeaderCellCSS","firstColumnStickyZIndex","checkboxCellWidth","firstColumnStickyFooterCellCSS","firstColumnStickyBodyCellCSS","tableTheme","useTableTheme","Table","makeBorderSize","border","width","thin","colors","surface","gray","muted","getIn","HeaderCell","Cell","FooterCell","useEffect","onSelectChange","action","state","_state$ids","selectedIds","id","ids","values","node","includes","rowSelectConfig","useRowSelect","onChange","clickType","SelectClickTypes","RowClick","ButtonClick","rowSelect","toggleRowSelectionById","useMemo","fns","onToggleById","deselectAllRows","onRemoveAll","toggleAllRowsSelection","map","item","Boolean","onAddAll","handleSortChange","sortKey","isSortReversed","reverse","sort","useSort","sortFns","currentSortedState","sortableColumns","Object","keys","toggleSort","useCallback","onToggleSort","hasPagination","paginationConfig","usePagination","page","size","tablePagination","defaultPageSize","isServer","currentPaginationState","setPaginationPage","onSetPage","setPaginationRowSize","onSetSize","isValidAllowedChildren","TableToolbar","throwBladeError","message","moduleName","tableContext","_jsx","TableContext","Provider","value","display","flex","alignItems","justifyContent","getStyledProps","metaAttribute","name","MetaConstants","Spinner","accessibilityLabel","testID","_jsxs","position","zIndex","refreshWrapperZIndex","color","role","layout","fixedHeader","horizontalScroll","select","makeAccessible","multiSelectable","assignWithoutSideEffects"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,IAAMA,aAGL,GAAG;EACFC,MAAM,EAAEC,WAAW,CAACC,YAAY;EAChCC,QAAQ,EAAEF,WAAW,CAACG,WAAW;AACjCC,EAAAA,IAAI,EAAEC,SAAAA;AACR,CAAC,CAAA;;AAED;AACA;AACA;AACA,IAAMC,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAIC,QAA0C,EAAa;AACtF,EAAA,IAAMC,kBAAkB,GAAGD,QAAQ,CAAC,EAAE,CAAC,CAAA;EACvC,IAAIC,kBAAkB,iBAAIC,cAAK,CAACC,cAAc,CAACF,kBAAkB,CAAC,EAAE;IAClE,IAAMG,mBAAmB,GAAGF,cAAK,CAACG,QAAQ,CAACC,OAAO,CAACL,kBAAkB,CAAC,CAAA;IACtE,kBAAIC,cAAK,CAACC,cAAc,CAACC,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE;AAAA,MAAA,IAAAG,qBAAA,CAAA;AA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AAM,GAAGkG,eAAe,GAAG,IAAK;AAC1DuB,QAAAA,IAAI,EAAEjH,aAAa,GAAGiH,IAAI,GAAG,IAAK;AAClCxJ,QAAAA,YAAY,EAAE;AACZM,UAAAA,MAAM,EAANA,MAAAA;SACA;AACFmC,QAAAA,UAAU,EAAEyH,aAAa,GAAGC,gBAAgB,GAAG,IAAA;AAAK,OAAA,EAChD2C,cAAc,CAAC;QAAEC,eAAe,EAAEhL,aAAa,KAAK,UAAA;OAAY,CAAC,CACjE+J,EAAAA,aAAa,CAAC;QAAEC,IAAI,EAAEC,aAAa,CAACvF,KAAAA;AAAM,OAAC,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAxI,QAAAA,QAAA,EAE/CA,QAAAA;OACe,CAAA,CAAC,EAClBwE,UAAU,CAAA;KACJ,CAAA,CAAA;AACV,GACoB,CAAC,CAAA;AAE5B,CAAC,CAAA;AAED,IAAMgE,KAAK,gBAAGuG,wBAAwB,CAACvL,MAAM,EAAE;EAC7C3B,WAAW,EAAEf,YAAY,CAAC0H,KAAAA;AAC5B,CAAC;;;;"}
|
|
@@ -4,7 +4,7 @@ import { useEffect } from 'react';
|
|
|
4
4
|
import { Body, Cell, Row } from '@table-library/react-table-library/table';
|
|
5
5
|
import styled from 'styled-components';
|
|
6
6
|
import { useTableContext } from './TableContext.js';
|
|
7
|
-
import { tableRow, checkboxCellWidth } from './tokens.js';
|
|
7
|
+
import { tableRow, classes, tableBackgroundColor, checkboxCellWidth } from './tokens.js';
|
|
8
8
|
import { ComponentIds } from './componentIds.js';
|
|
9
9
|
import getIn from '../../utils/lodashButBetter/get.js';
|
|
10
10
|
import '../Typography/index.js';
|
|
@@ -16,6 +16,7 @@ import '../../utils/assignWithoutSideEffects/index.js';
|
|
|
16
16
|
import '../../utils/getFocusRingStyles/index.js';
|
|
17
17
|
import '../../tokens/global/index.js';
|
|
18
18
|
import '../../utils/makeAccessible/index.js';
|
|
19
|
+
import { useIsomorphicLayoutEffect } from '../../utils/useIsomorphicLayoutEffect.js';
|
|
19
20
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
20
21
|
import { makeMotionTime } from '../../utils/makeMotionTime/makeMotionTime.web.js';
|
|
21
22
|
import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.web.js';
|
|
@@ -28,18 +29,39 @@ import { makeSize } from '../../utils/makeSize/makeSize.js';
|
|
|
28
29
|
import { size } from '../../tokens/global/size.js';
|
|
29
30
|
import { Text } from '../Typography/Text/Text.js';
|
|
30
31
|
import { Checkbox } from '../Checkbox/Checkbox.js';
|
|
32
|
+
import { getMediaQuery } from '../../utils/getMediaQuery/getMediaQuery.js';
|
|
31
33
|
import { makeAccessible } from '../../utils/makeAccessible/makeAccessible.web.js';
|
|
32
34
|
|
|
33
35
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
34
36
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
37
|
+
var getTableRowBackgroundTransition = function getTableRowBackgroundTransition(theme) {
|
|
38
|
+
var rowBackgroundTransition = "background-color ".concat(makeMotionTime(getIn(theme.motion, tableRow.backgroundColorMotionDuration)), " ").concat(getIn(theme.motion, tableRow.backgroundColorMotionEasing));
|
|
39
|
+
return rowBackgroundTransition;
|
|
40
|
+
};
|
|
41
|
+
var getTableActionsHoverStyles = function getTableActionsHoverStyles(_ref) {
|
|
42
|
+
var hoverColor = _ref.hoverColor,
|
|
43
|
+
theme = _ref.theme,
|
|
44
|
+
backgroundGradientColor = _ref.backgroundGradientColor;
|
|
45
|
+
var rowBackgroundTransition = getTableRowBackgroundTransition(theme);
|
|
46
|
+
return _defineProperty(_defineProperty(_defineProperty({}, "& .".concat(classes.HOVER_ACTIONS), {
|
|
47
|
+
backgroundColor: getIn(theme.colors, tableBackgroundColor),
|
|
48
|
+
transition: rowBackgroundTransition
|
|
49
|
+
}), "& .".concat(classes.HOVER_ACTIONS_LAYER2), {
|
|
50
|
+
backgroundColor: getIn(theme.colors, backgroundGradientColor !== null && backgroundGradientColor !== void 0 ? backgroundGradientColor : 'transparent'),
|
|
51
|
+
transition: rowBackgroundTransition
|
|
52
|
+
}), "& .".concat(classes.HOVER_ACTIONS_LAYER3), {
|
|
53
|
+
backgroundColor: getIn(theme.colors, hoverColor),
|
|
54
|
+
transition: rowBackgroundTransition
|
|
55
|
+
});
|
|
56
|
+
};
|
|
35
57
|
var StyledBody = /*#__PURE__*/styled(Body).withConfig({
|
|
36
58
|
displayName: "TableBodyweb__StyledBody",
|
|
37
59
|
componentId: "sc-1fpz8hn-0"
|
|
38
|
-
})(function (
|
|
39
|
-
var theme =
|
|
40
|
-
$showStripedRows =
|
|
41
|
-
$isSelectable =
|
|
42
|
-
var rowBackgroundTransition =
|
|
60
|
+
})(function (_ref3) {
|
|
61
|
+
var theme = _ref3.theme,
|
|
62
|
+
$showStripedRows = _ref3.$showStripedRows,
|
|
63
|
+
$isSelectable = _ref3.$isSelectable;
|
|
64
|
+
var rowBackgroundTransition = getTableRowBackgroundTransition(theme);
|
|
43
65
|
return {
|
|
44
66
|
'&&&': _objectSpread(_objectSpread(_objectSpread({
|
|
45
67
|
border: 'none',
|
|
@@ -50,15 +72,27 @@ var StyledBody = /*#__PURE__*/styled(Body).withConfig({
|
|
|
50
72
|
'& .row-select-single-selected .cell-wrapper-base, .row-select-selected .cell-wrapper-base': {
|
|
51
73
|
backgroundColor: getIn(theme.colors, tableRow.nonStripe.backgroundColorSelected)
|
|
52
74
|
},
|
|
53
|
-
'& .row-select-single-selected:hover:not(.disabled-row) .cell-wrapper-base, .row-select-selected:hover:not(.disabled-row) .cell-wrapper-base': {
|
|
75
|
+
'& .row-select-single-selected:hover:not(.disabled-row) .cell-wrapper-base, .row-select-selected:hover:not(.disabled-row) .cell-wrapper-base': _objectSpread({
|
|
54
76
|
backgroundColor: getIn(theme.colors, tableRow.nonStripe.backgroundColorSelectedHover)
|
|
55
|
-
},
|
|
56
|
-
|
|
77
|
+
}, getTableActionsHoverStyles({
|
|
78
|
+
hoverColor: tableRow.nonStripe.backgroundColorSelectedHover,
|
|
79
|
+
backgroundGradientColor: tableRow.nonStripeWrapper.backgroundColorSelectedHover,
|
|
80
|
+
theme: theme
|
|
81
|
+
})),
|
|
82
|
+
'& .row-select-single-selected:focus:not(.disabled-row) .cell-wrapper-base, .row-select-selected:focus:not(.disabled-row) .cell-wrapper-base': _objectSpread({
|
|
57
83
|
backgroundColor: getIn(theme.colors, tableRow.nonStripe.backgroundColorSelectedFocus)
|
|
58
|
-
},
|
|
59
|
-
|
|
84
|
+
}, getTableActionsHoverStyles({
|
|
85
|
+
hoverColor: tableRow.nonStripe.backgroundColorSelectedFocus,
|
|
86
|
+
backgroundGradientColor: tableRow.nonStripeWrapper.backgroundColorSelectedFocus,
|
|
87
|
+
theme: theme
|
|
88
|
+
})),
|
|
89
|
+
'& .row-select-single-selected:active:not(.disabled-row) .cell-wrapper-base, .row-select-selected:active:not(.disabled-row) .cell-wrapper-base': _objectSpread({
|
|
60
90
|
backgroundColor: getIn(theme.colors, tableRow.nonStripe.backgroundColorSelectedActive)
|
|
61
|
-
}
|
|
91
|
+
}, getTableActionsHoverStyles({
|
|
92
|
+
hoverColor: tableRow.nonStripe.backgroundColorSelectedActive,
|
|
93
|
+
backgroundGradientColor: tableRow.nonStripe.backgroundColorHover,
|
|
94
|
+
theme: theme
|
|
95
|
+
}))
|
|
62
96
|
}, $isSelectable && {
|
|
63
97
|
'& tr:active:not(.disabled-row) .cell-wrapper': {
|
|
64
98
|
backgroundColor: getIn(theme.colors, tableRow.nonStripeWrapper.backgroundColorActive)
|
|
@@ -92,32 +126,60 @@ var StyledBody = /*#__PURE__*/styled(Body).withConfig({
|
|
|
92
126
|
'& .row-select-single-selected:nth-child(even):active:not(.disabled-row) .cell-wrapper, .row-select-selected:nth-child(even):active:not(.disabled-row) .cell-wrapper': {
|
|
93
127
|
backgroundColor: getIn(theme.colors, tableRow.stripeWrapper.backgroundColorSelectedActive)
|
|
94
128
|
},
|
|
95
|
-
'& tr:nth-child(even):hover:not(.disabled-row) .cell-wrapper-base': {
|
|
129
|
+
'& tr:nth-child(even):hover:not(.disabled-row) .cell-wrapper-base': _objectSpread({
|
|
96
130
|
backgroundColor: getIn(theme.colors, tableRow.stripe.backgroundColorHover)
|
|
97
|
-
},
|
|
98
|
-
|
|
131
|
+
}, getTableActionsHoverStyles({
|
|
132
|
+
hoverColor: tableRow.stripe.backgroundColorHover,
|
|
133
|
+
theme: theme,
|
|
134
|
+
backgroundGradientColor: tableRow.stripeWrapper.backgroundColorHover
|
|
135
|
+
})),
|
|
136
|
+
'& tr:nth-child(even):focus:not(.disabled-row) .cell-wrapper-base': _objectSpread({
|
|
99
137
|
backgroundColor: getIn(theme.colors, tableRow.stripe.backgroundColorFocus)
|
|
100
|
-
},
|
|
101
|
-
|
|
138
|
+
}, getTableActionsHoverStyles({
|
|
139
|
+
hoverColor: tableRow.stripe.backgroundColorFocus,
|
|
140
|
+
theme: theme,
|
|
141
|
+
backgroundGradientColor: tableRow.stripeWrapper.backgroundColorFocus
|
|
142
|
+
})),
|
|
143
|
+
'& tr:nth-child(even):active:not(.disabled-row) .cell-wrapper-base': _objectSpread({
|
|
102
144
|
backgroundColor: getIn(theme.colors, tableRow.stripe.backgroundColorActive)
|
|
103
|
-
},
|
|
104
|
-
|
|
145
|
+
}, getTableActionsHoverStyles({
|
|
146
|
+
hoverColor: tableRow.stripe.backgroundColorActive,
|
|
147
|
+
backgroundGradientColor: tableRow.stripe.backgroundColorHover,
|
|
148
|
+
theme: theme
|
|
149
|
+
})),
|
|
150
|
+
'& .row-select-single-selected:nth-child(even) .cell-wrapper-base, .row-select-selected:nth-child(even) .cell-wrapper-base ': _objectSpread({
|
|
105
151
|
backgroundColor: getIn(theme.colors, tableRow.stripe.backgroundColorSelected)
|
|
106
|
-
},
|
|
107
|
-
|
|
152
|
+
}, getTableActionsHoverStyles({
|
|
153
|
+
hoverColor: tableRow.stripe.backgroundColorSelected,
|
|
154
|
+
theme: theme,
|
|
155
|
+
backgroundGradientColor: tableRow.stripeWrapper.backgroundColorSelected
|
|
156
|
+
})),
|
|
157
|
+
'& .row-select-single-selected:nth-child(even):hover:not(.disabled-row) .cell-wrapper-base, .row-select-selected:nth-child(even):hover:not(.disabled-row) .cell-wrapper-base ': _objectSpread({
|
|
108
158
|
backgroundColor: getIn(theme.colors, tableRow.stripe.backgroundColorSelectedHover)
|
|
109
|
-
},
|
|
110
|
-
|
|
159
|
+
}, getTableActionsHoverStyles({
|
|
160
|
+
hoverColor: tableRow.stripe.backgroundColorSelectedHover,
|
|
161
|
+
theme: theme,
|
|
162
|
+
backgroundGradientColor: tableRow.stripeWrapper.backgroundColorSelectedHover
|
|
163
|
+
})),
|
|
164
|
+
'& .row-select-single-selected:nth-child(even):focus:not(.disabled-row) .cell-wrapper-base, .row-select-selected:nth-child(even):focus:not(.disabled-row) .cell-wrapper-base ': _objectSpread({
|
|
111
165
|
backgroundColor: getIn(theme.colors, tableRow.stripe.backgroundColorSelectedFocus)
|
|
112
|
-
},
|
|
113
|
-
|
|
166
|
+
}, getTableActionsHoverStyles({
|
|
167
|
+
hoverColor: tableRow.stripe.backgroundColorSelectedFocus,
|
|
168
|
+
theme: theme,
|
|
169
|
+
backgroundGradientColor: tableRow.stripeWrapper.backgroundColorSelectedFocus
|
|
170
|
+
})),
|
|
171
|
+
'& .row-select-single-selected:nth-child(even):active:not(.disabled-row) .cell-wrapper-base, .row-select-selected:nth-child(even):active:not(.disabled-row) .cell-wrapper-base ': _objectSpread({
|
|
114
172
|
backgroundColor: getIn(theme.colors, tableRow.stripe.backgroundColorSelectedActive)
|
|
115
|
-
}
|
|
173
|
+
}, getTableActionsHoverStyles({
|
|
174
|
+
hoverColor: tableRow.stripe.backgroundColorSelectedActive,
|
|
175
|
+
theme: theme,
|
|
176
|
+
backgroundGradientColor: tableRow.stripe.backgroundColorHover
|
|
177
|
+
}))
|
|
116
178
|
})
|
|
117
179
|
};
|
|
118
180
|
});
|
|
119
|
-
var _TableBody = function _TableBody(
|
|
120
|
-
var children =
|
|
181
|
+
var _TableBody = function _TableBody(_ref4) {
|
|
182
|
+
var children = _ref4.children;
|
|
121
183
|
var _useTableContext = useTableContext(),
|
|
122
184
|
showStripedRows = _useTableContext.showStripedRows,
|
|
123
185
|
selectionType = _useTableContext.selectionType;
|
|
@@ -138,9 +200,9 @@ var TableBody = /*#__PURE__*/assignWithoutSideEffects(_TableBody, {
|
|
|
138
200
|
var StyledCell = /*#__PURE__*/styled(Cell).withConfig({
|
|
139
201
|
displayName: "TableBodyweb__StyledCell",
|
|
140
202
|
componentId: "sc-1fpz8hn-1"
|
|
141
|
-
})(function (
|
|
142
|
-
var theme =
|
|
143
|
-
$backgroundColor =
|
|
203
|
+
})(function (_ref5) {
|
|
204
|
+
var theme = _ref5.theme,
|
|
205
|
+
$backgroundColor = _ref5.$backgroundColor;
|
|
144
206
|
return {
|
|
145
207
|
'&&&': {
|
|
146
208
|
height: '100%',
|
|
@@ -158,12 +220,12 @@ var StyledCell = /*#__PURE__*/styled(Cell).withConfig({
|
|
|
158
220
|
var CellWrapper = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
159
221
|
displayName: "TableBodyweb__CellWrapper",
|
|
160
222
|
componentId: "sc-1fpz8hn-2"
|
|
161
|
-
})(function (
|
|
162
|
-
var theme =
|
|
163
|
-
$rowDensity =
|
|
164
|
-
showStripedRows =
|
|
165
|
-
|
|
166
|
-
hasPadding =
|
|
223
|
+
})(function (_ref6) {
|
|
224
|
+
var theme = _ref6.theme,
|
|
225
|
+
$rowDensity = _ref6.$rowDensity,
|
|
226
|
+
showStripedRows = _ref6.showStripedRows,
|
|
227
|
+
_ref6$hasPadding = _ref6.hasPadding,
|
|
228
|
+
hasPadding = _ref6$hasPadding === void 0 ? true : _ref6$hasPadding;
|
|
167
229
|
var rowBackgroundTransition = "background-color ".concat(makeMotionTime(getIn(theme.motion, tableRow.backgroundColorMotionDuration)), " ").concat(getIn(theme.motion, tableRow.backgroundColorMotionEasing));
|
|
168
230
|
return {
|
|
169
231
|
'&&&': _objectSpread({
|
|
@@ -181,8 +243,9 @@ var CellWrapper = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
181
243
|
})
|
|
182
244
|
};
|
|
183
245
|
});
|
|
184
|
-
var _TableCell = function _TableCell(
|
|
185
|
-
var children =
|
|
246
|
+
var _TableCell = function _TableCell(_ref7) {
|
|
247
|
+
var children = _ref7.children,
|
|
248
|
+
_hasPadding = _ref7._hasPadding;
|
|
186
249
|
var isChildrenString = typeof children === 'string';
|
|
187
250
|
var _useTableContext2 = useTableContext(),
|
|
188
251
|
selectionType = _useTableContext2.selectionType,
|
|
@@ -208,6 +271,7 @@ var _TableCell = function _TableCell(_ref5) {
|
|
|
208
271
|
showStripedRows: showStripedRows,
|
|
209
272
|
display: "flex",
|
|
210
273
|
alignItems: "center",
|
|
274
|
+
hasPadding: _hasPadding,
|
|
211
275
|
flex: 1
|
|
212
276
|
// when a direct string child is passed we want to disable pointer events
|
|
213
277
|
// for custom cells components, consumers can handle pointer events themselves
|
|
@@ -216,6 +280,7 @@ var _TableCell = function _TableCell(_ref5) {
|
|
|
216
280
|
// allow text to wrap, so that if the <Text> overflows it can truncate
|
|
217
281
|
,
|
|
218
282
|
whiteSpace: "normal",
|
|
283
|
+
position: "relative",
|
|
219
284
|
children: isChildrenString ? /*#__PURE__*/jsx(Text, {
|
|
220
285
|
size: "medium",
|
|
221
286
|
truncateAfterLines: 1,
|
|
@@ -228,10 +293,10 @@ var _TableCell = function _TableCell(_ref5) {
|
|
|
228
293
|
var TableCell = /*#__PURE__*/assignWithoutSideEffects(_TableCell, {
|
|
229
294
|
componentId: ComponentIds.TableCell
|
|
230
295
|
});
|
|
231
|
-
var TableCheckboxCell = function TableCheckboxCell(
|
|
232
|
-
var isChecked =
|
|
233
|
-
onChange =
|
|
234
|
-
isDisabled =
|
|
296
|
+
var TableCheckboxCell = function TableCheckboxCell(_ref8) {
|
|
297
|
+
var isChecked = _ref8.isChecked,
|
|
298
|
+
onChange = _ref8.onChange,
|
|
299
|
+
isDisabled = _ref8.isDisabled;
|
|
235
300
|
return /*#__PURE__*/jsx(TableCell, {
|
|
236
301
|
children: /*#__PURE__*/jsx(BaseBox, {
|
|
237
302
|
display: "flex",
|
|
@@ -253,14 +318,16 @@ var TableCheckboxCell = function TableCheckboxCell(_ref6) {
|
|
|
253
318
|
var StyledRow = /*#__PURE__*/styled(Row).withConfig({
|
|
254
319
|
displayName: "TableBodyweb__StyledRow",
|
|
255
320
|
componentId: "sc-1fpz8hn-3"
|
|
256
|
-
})(function (
|
|
257
|
-
var theme =
|
|
258
|
-
$isSelectable =
|
|
259
|
-
$isHoverable =
|
|
260
|
-
$showBorderedCells =
|
|
321
|
+
})(function (_ref9) {
|
|
322
|
+
var theme = _ref9.theme,
|
|
323
|
+
$isSelectable = _ref9.$isSelectable,
|
|
324
|
+
$isHoverable = _ref9.$isHoverable,
|
|
325
|
+
$showBorderedCells = _ref9.$showBorderedCells;
|
|
326
|
+
var _useTableContext3 = useTableContext(),
|
|
327
|
+
hasHoverActions = _useTableContext3.hasHoverActions;
|
|
261
328
|
var rowBackgroundTransition = "background-color ".concat(makeMotionTime(getIn(theme.motion, tableRow.backgroundColorMotionDuration)), " ").concat(getIn(theme.motion, tableRow.backgroundColorMotionEasing));
|
|
262
329
|
return {
|
|
263
|
-
'&&&': _objectSpread(_objectSpread(_objectSpread({
|
|
330
|
+
'&&&': _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
264
331
|
backgroundColor: 'transparent',
|
|
265
332
|
'& .cell-wrapper': $showBorderedCells ? {
|
|
266
333
|
borderRightWidth: makeSpace(getIn(theme.border.width, tableRow.borderBottomWidth)),
|
|
@@ -270,23 +337,56 @@ var StyledRow = /*#__PURE__*/styled(Row).withConfig({
|
|
|
270
337
|
'& td:last-child .cell-wrapper': {
|
|
271
338
|
borderRight: 'none'
|
|
272
339
|
}
|
|
273
|
-
},
|
|
274
|
-
|
|
340
|
+
}, hasHoverActions ? _defineProperty({}, "@media ".concat(getMediaQuery({
|
|
341
|
+
min: theme.breakpoints.m
|
|
342
|
+
})), {
|
|
343
|
+
'& td:last-child': {
|
|
344
|
+
opacity: 0,
|
|
345
|
+
position: 'sticky',
|
|
346
|
+
zIndex: 2,
|
|
347
|
+
right: 0,
|
|
348
|
+
width: '0px',
|
|
349
|
+
'& > div:first-child': {
|
|
350
|
+
overflow: 'visible'
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
'& td:last-child:focus-within': _objectSpread({
|
|
354
|
+
opacity: 1
|
|
355
|
+
}, getTableActionsHoverStyles({
|
|
356
|
+
theme: theme,
|
|
357
|
+
hoverColor: tableRow.nonStripe.backgroundColor
|
|
358
|
+
})),
|
|
359
|
+
'&:hover td:last-child': {
|
|
360
|
+
opacity: 1
|
|
361
|
+
}
|
|
362
|
+
}) : {}), ($isHoverable || $isSelectable) && {
|
|
363
|
+
'&:hover:not(.disabled-row) .cell-wrapper-base': _objectSpread({
|
|
275
364
|
transition: rowBackgroundTransition,
|
|
276
365
|
cursor: 'pointer',
|
|
277
366
|
backgroundColor: getIn(theme.colors, tableRow.nonStripe.backgroundColorHover)
|
|
278
|
-
}
|
|
367
|
+
}, getTableActionsHoverStyles({
|
|
368
|
+
hoverColor: tableRow.nonStripe.backgroundColorHover,
|
|
369
|
+
theme: theme
|
|
370
|
+
}))
|
|
279
371
|
}), $isSelectable && {
|
|
280
|
-
'&:focus:not(.disabled-row) .cell-wrapper-base': {
|
|
372
|
+
'&:focus:not(.disabled-row) .cell-wrapper-base': _objectSpread({
|
|
281
373
|
transition: rowBackgroundTransition,
|
|
282
374
|
backgroundColor: getIn(theme.colors, tableRow.nonStripe.backgroundColorFocus),
|
|
283
375
|
cursor: 'pointer'
|
|
284
|
-
},
|
|
285
|
-
|
|
376
|
+
}, getTableActionsHoverStyles({
|
|
377
|
+
hoverColor: tableRow.nonStripe.backgroundColorFocus,
|
|
378
|
+
backgroundGradientColor: tableRow.nonStripe.backgroundColorHover,
|
|
379
|
+
theme: theme
|
|
380
|
+
})),
|
|
381
|
+
'&:active:not(.disabled-row) .cell-wrapper-base': _objectSpread({
|
|
286
382
|
transition: rowBackgroundTransition,
|
|
287
383
|
backgroundColor: getIn(theme.colors, tableRow.nonStripe.backgroundColorActive),
|
|
288
384
|
cursor: 'pointer'
|
|
289
|
-
}
|
|
385
|
+
}, getTableActionsHoverStyles({
|
|
386
|
+
hoverColor: tableRow.nonStripe.backgroundColorActive,
|
|
387
|
+
backgroundGradientColor: tableRow.nonStripe.backgroundColorHover,
|
|
388
|
+
theme: theme
|
|
389
|
+
}))
|
|
290
390
|
}), {}, {
|
|
291
391
|
'&:focus': getFocusRingStyles({
|
|
292
392
|
theme: theme,
|
|
@@ -295,22 +395,25 @@ var StyledRow = /*#__PURE__*/styled(Row).withConfig({
|
|
|
295
395
|
})
|
|
296
396
|
};
|
|
297
397
|
});
|
|
298
|
-
var _TableRow = function _TableRow(
|
|
299
|
-
var children =
|
|
300
|
-
item =
|
|
301
|
-
isDisabled =
|
|
302
|
-
onHover =
|
|
303
|
-
_onClick =
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
398
|
+
var _TableRow = function _TableRow(_ref11) {
|
|
399
|
+
var children = _ref11.children,
|
|
400
|
+
item = _ref11.item,
|
|
401
|
+
isDisabled = _ref11.isDisabled,
|
|
402
|
+
onHover = _ref11.onHover,
|
|
403
|
+
_onClick = _ref11.onClick,
|
|
404
|
+
hoverActions = _ref11.hoverActions,
|
|
405
|
+
testID = _ref11.testID;
|
|
406
|
+
var _useTableContext4 = useTableContext(),
|
|
407
|
+
selectionType = _useTableContext4.selectionType,
|
|
408
|
+
selectedRows = _useTableContext4.selectedRows,
|
|
409
|
+
toggleRowSelectionById = _useTableContext4.toggleRowSelectionById,
|
|
410
|
+
setDisabledRows = _useTableContext4.setDisabledRows,
|
|
411
|
+
showBorderedCells = _useTableContext4.showBorderedCells,
|
|
412
|
+
setHasHoverActions = _useTableContext4.setHasHoverActions;
|
|
311
413
|
var isSelectable = selectionType !== 'none';
|
|
312
414
|
var isMultiSelect = selectionType === 'multiple';
|
|
313
415
|
var isSelected = selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.includes(item.id);
|
|
416
|
+
var hasHoverActions = Boolean(hoverActions);
|
|
314
417
|
useEffect(function () {
|
|
315
418
|
if (isDisabled) {
|
|
316
419
|
setDisabledRows(function (prev) {
|
|
@@ -318,6 +421,11 @@ var _TableRow = function _TableRow(_ref8) {
|
|
|
318
421
|
});
|
|
319
422
|
}
|
|
320
423
|
}, [isDisabled, item.id, setDisabledRows]);
|
|
424
|
+
useIsomorphicLayoutEffect(function () {
|
|
425
|
+
if (hasHoverActions) {
|
|
426
|
+
setHasHoverActions(true);
|
|
427
|
+
}
|
|
428
|
+
}, [hasHoverActions]);
|
|
321
429
|
return /*#__PURE__*/jsxs(StyledRow, _objectSpread(_objectSpread(_objectSpread({
|
|
322
430
|
disabled: isDisabled,
|
|
323
431
|
$isSelectable: isDisabled ? false : isSelectable,
|
|
@@ -347,7 +455,43 @@ var _TableRow = function _TableRow(_ref8) {
|
|
|
347
455
|
return !isDisabled && toggleRowSelectionById(item.id);
|
|
348
456
|
},
|
|
349
457
|
isDisabled: isDisabled
|
|
350
|
-
}), children
|
|
458
|
+
}), children, hoverActions ? /*#__PURE__*/jsx(TableCell, {
|
|
459
|
+
_hasPadding: false,
|
|
460
|
+
children: /*#__PURE__*/jsx(BaseBox, {
|
|
461
|
+
className: classes.HOVER_ACTIONS,
|
|
462
|
+
position: {
|
|
463
|
+
base: 'relative',
|
|
464
|
+
m: 'absolute'
|
|
465
|
+
},
|
|
466
|
+
top: "spacing.0",
|
|
467
|
+
right: "spacing.0",
|
|
468
|
+
height: "100%",
|
|
469
|
+
flexShrink: 0,
|
|
470
|
+
flexGrow: 1,
|
|
471
|
+
width: "max-content",
|
|
472
|
+
children: /*#__PURE__*/jsx(BaseBox, {
|
|
473
|
+
className: classes.HOVER_ACTIONS_LAYER2,
|
|
474
|
+
height: "100%",
|
|
475
|
+
width: "max-content",
|
|
476
|
+
display: "flex",
|
|
477
|
+
alignItems: "center",
|
|
478
|
+
children: /*#__PURE__*/jsx(BaseBox, {
|
|
479
|
+
height: "100%",
|
|
480
|
+
width: "max-content",
|
|
481
|
+
className: classes.HOVER_ACTIONS_LAYER3,
|
|
482
|
+
display: "flex",
|
|
483
|
+
alignItems: "center",
|
|
484
|
+
paddingLeft: {
|
|
485
|
+
base: 'spacing.4',
|
|
486
|
+
m: 'spacing.6'
|
|
487
|
+
},
|
|
488
|
+
paddingRight: "spacing.4",
|
|
489
|
+
gap: "spacing.3",
|
|
490
|
+
children: hoverActions
|
|
491
|
+
})
|
|
492
|
+
})
|
|
493
|
+
})
|
|
494
|
+
}) : null]
|
|
351
495
|
}));
|
|
352
496
|
};
|
|
353
497
|
var TableRow = /*#__PURE__*/assignWithoutSideEffects(_TableRow, {
|