@cloudscape-design/components 3.0.419 → 3.0.421
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/app-layout/drawer/drawers-helpers.d.ts +1 -1
- package/app-layout/drawer/drawers-helpers.d.ts.map +1 -1
- package/app-layout/drawer/drawers-helpers.js.map +1 -1
- package/app-layout/drawer/index.d.ts +1 -1
- package/app-layout/drawer/index.d.ts.map +1 -1
- package/app-layout/drawer/index.js +16 -27
- package/app-layout/drawer/index.js.map +1 -1
- package/app-layout/drawer/interfaces.d.ts +25 -37
- package/app-layout/drawer/interfaces.d.ts.map +1 -1
- package/app-layout/drawer/interfaces.js +1 -0
- package/app-layout/drawer/interfaces.js.map +1 -1
- package/app-layout/drawer/overflow-menu.d.ts +2 -2
- package/app-layout/drawer/overflow-menu.d.ts.map +1 -1
- package/app-layout/drawer/overflow-menu.js +7 -10
- package/app-layout/drawer/overflow-menu.js.map +1 -1
- package/app-layout/drawer/resizable-drawer.js +2 -2
- package/app-layout/drawer/resizable-drawer.js.map +1 -1
- package/app-layout/index.d.ts.map +1 -1
- package/app-layout/index.js +30 -44
- package/app-layout/index.js.map +1 -1
- package/app-layout/interfaces.d.ts +27 -0
- package/app-layout/interfaces.d.ts.map +1 -1
- package/app-layout/interfaces.js.map +1 -1
- package/app-layout/mobile-toolbar/index.d.ts +6 -14
- package/app-layout/mobile-toolbar/index.d.ts.map +1 -1
- package/app-layout/mobile-toolbar/index.js +6 -10
- package/app-layout/mobile-toolbar/index.js.map +1 -1
- package/app-layout/runtime-api.d.ts +3 -3
- package/app-layout/runtime-api.d.ts.map +1 -1
- package/app-layout/runtime-api.js +6 -2
- package/app-layout/runtime-api.js.map +1 -1
- package/app-layout/utils/use-drawers.d.ts +10 -11
- package/app-layout/utils/use-drawers.d.ts.map +1 -1
- package/app-layout/utils/use-drawers.js +35 -16
- package/app-layout/utils/use-drawers.js.map +1 -1
- package/app-layout/utils/use-resize.d.ts +2 -2
- package/app-layout/utils/use-resize.d.ts.map +1 -1
- package/app-layout/utils/use-resize.js.map +1 -1
- package/app-layout/visual-refresh/context.d.ts +4 -5
- package/app-layout/visual-refresh/context.d.ts.map +1 -1
- package/app-layout/visual-refresh/context.js +6 -6
- package/app-layout/visual-refresh/context.js.map +1 -1
- package/app-layout/visual-refresh/drawers.js +3 -3
- package/app-layout/visual-refresh/drawers.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/internal/plugins/controllers/drawers.d.ts +17 -3
- package/internal/plugins/controllers/drawers.d.ts.map +1 -1
- package/internal/plugins/controllers/drawers.js +2 -0
- package/internal/plugins/controllers/drawers.js.map +1 -1
- package/mixed-line-bar-chart/chart-container.d.ts.map +1 -1
- package/mixed-line-bar-chart/chart-container.js +6 -2
- package/mixed-line-bar-chart/chart-container.js.map +1 -1
- package/package.json +1 -1
- package/table/header-cell/index.d.ts +2 -1
- package/table/header-cell/index.d.ts.map +1 -1
- package/table/header-cell/index.js +2 -2
- package/table/header-cell/index.js.map +1 -1
- package/table/interfaces.d.ts +2 -0
- package/table/interfaces.d.ts.map +1 -1
- package/table/interfaces.js.map +1 -1
- package/table/internal.d.ts.map +1 -1
- package/table/internal.js +1 -0
- package/table/internal.js.map +1 -1
- package/table/resizer/index.d.ts +2 -1
- package/table/resizer/index.d.ts.map +1 -1
- package/table/resizer/index.js +54 -28
- package/table/resizer/index.js.map +1 -1
- package/table/resizer/styles.css.js +6 -6
- package/table/resizer/styles.scoped.css +53 -11
- package/table/resizer/styles.selectors.js +6 -6
- package/table/thead.d.ts +1 -0
- package/table/thead.d.ts.map +1 -1
- package/table/thead.js +2 -2
- package/table/thead.js.map +1 -1
- package/token-group/interfaces.d.ts +5 -0
- package/token-group/interfaces.d.ts.map +1 -1
- package/token-group/interfaces.js.map +1 -1
- package/token-group/internal.d.ts +1 -1
- package/token-group/internal.d.ts.map +1 -1
- package/token-group/internal.js +2 -2
- package/token-group/internal.js.map +1 -1
- package/token-group/styles.css.js +8 -7
- package/token-group/styles.scoped.css +16 -16
- package/token-group/styles.selectors.js +8 -7
package/table/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["table/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,iBAA6C,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAqB,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,UAAU,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AACvH,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAClG,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAyB,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACxG,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,MAAM,MAAM,iBAAiB,CA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EAAE,QAAQ,EAAE,CAAC,EAChE,SAAS,EAAE,aAAa,CAAC,EAAE,CACzB,WAAW,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,aAAa,CAAC,EAEjE,UAAU,EAAE,WAAW,CAAC,UAAU,EAClC,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAA,MAAM,CAAC,EAAE,mCAAI,QAAQ,EAC/B,QAAQ,EAAE,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAC/D,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,GACpB,CACH,CAAC;gCACJ,CAAC,CAAC,CACC,CACN,CAAC;wBACJ,CAAC,CAAC,CACH,CACK,CACF;oBACP,gBAAgB,IAAI,oBAAC,aAAa,OAAG,CAClC;gBAEN,oBAAC,eAAe,IACd,GAAG,EAAE,YAAY,EACjB,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,YAAY,EACtB,gBAAgB,EAAE,gBAAgB,GAClC,CACgB,CACC,CACY,CACtC,CAAC;AACJ,CAAC,CACqB,CAAC;AAEzB,eAAe,aAAa,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useCallback, useImperativeHandle, useRef } from 'react';\nimport { TableForwardRefType, TableProps } from './interfaces';\nimport { getVisualContextClassname } from '../internal/components/visual-context';\nimport InternalContainer, { InternalContainerProps } from '../container/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport ToolsHeader from './tools-header';\nimport Thead, { TheadProps } from './thead';\nimport { TableBodyCell } from './body-cell';\nimport { supportsStickyPosition } from '../internal/utils/dom';\nimport { checkSortingState, getColumnKey, getItemKey, getVisibleColumnDefinitions, toContainerVariant } from './utils';\nimport { useRowEvents } from './use-row-events';\nimport { SelectionControl, focusMarkers, useSelectionFocusMove, useSelection } from './selection';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { isDevelopment } from '../internal/is-development';\nimport { ColumnWidthDefinition, ColumnWidthsProvider, DEFAULT_COLUMN_WIDTH } from './use-column-widths';\nimport { useScrollSync } from '../internal/hooks/use-scroll-sync';\nimport { ResizeTracker } from './resizer';\nimport styles from './styles.css.js';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport StickyHeader, { StickyHeaderRef } from './sticky-header';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport useMouseDownTarget from '../internal/hooks/use-mouse-down-target';\nimport { useDynamicOverlap } from '../internal/hooks/use-dynamic-overlap';\nimport LiveRegion from '../internal/components/live-region';\nimport useTableFocusNavigation from './use-table-focus-navigation';\nimport { SomeRequired } from '../internal/types';\nimport { TableTdElement } from './body-cell/td-element';\nimport { useStickyColumns } from './sticky-columns';\nimport { StickyScrollbar } from './sticky-scrollbar';\nimport { checkColumnWidths } from './column-widths-utils';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { getTableRoleProps, getTableRowRoleProps, getTableWrapperRoleProps } from './table-role';\nimport { useCellEditing } from './use-cell-editing';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport { CollectionLabelContext } from '../internal/context/collection-label-context';\nimport { useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { NoDataCell } from './node-data-cell';\n\nconst SELECTION_COLUMN_WIDTH = 54;\nconst selectionColumnId = Symbol('selection-column-id');\n\ntype InternalTableProps<T> = SomeRequired<TableProps<T>, 'items' | 'selectedItems' | 'variant'> &\n InternalBaseComponentProps & {\n __funnelSubStepProps?: InternalContainerProps['__funnelSubStepProps'];\n };\n\nexport const InternalTableAsSubstep = React.forwardRef(\n <T,>(props: InternalTableProps<T>, ref: React.Ref<TableProps.Ref>) => {\n const { funnelSubStepProps } = useFunnelSubStep();\n\n const tableProps: InternalTableProps<T> = {\n ...props,\n __funnelSubStepProps: funnelSubStepProps,\n };\n\n return <InternalTable {...tableProps} ref={ref} />;\n }\n) as TableForwardRefType;\n\nconst InternalTable = React.forwardRef(\n <T,>(\n {\n header,\n footer,\n empty,\n filter,\n pagination,\n preferences,\n items,\n columnDefinitions,\n trackBy,\n loading,\n loadingText,\n selectionType,\n selectedItems,\n isItemDisabled,\n ariaLabels,\n onSelectionChange,\n onSortingChange,\n sortingColumn,\n sortingDescending,\n sortingDisabled,\n visibleColumns,\n stickyHeader,\n stickyHeaderVerticalOffset,\n onRowClick,\n onRowContextMenu,\n wrapLines,\n stripedRows,\n contentDensity,\n submitEdit,\n onEditCancel,\n resizableColumns,\n onColumnWidthsChange,\n variant,\n __internalRootRef,\n totalItemsCount,\n firstIndex,\n renderAriaLive,\n stickyColumns,\n columnDisplay,\n __funnelSubStepProps,\n ...rest\n }: InternalTableProps<T>,\n ref: React.Ref<TableProps.Ref>\n ) => {\n const baseProps = getBaseProps(rest);\n stickyHeader = stickyHeader && supportsStickyPosition();\n const isMobile = useMobile();\n\n const [containerWidth, wrapperMeasureRef] = useContainerQuery<number>(rect => rect.contentBoxWidth);\n const wrapperRefObject = useRef(null);\n\n const [tableWidth, tableMeasureRef] = useContainerQuery<number>(rect => rect.contentBoxWidth);\n const tableRefObject = useRef(null);\n\n const secondaryWrapperRef = React.useRef<HTMLDivElement>(null);\n const theadRef = useRef<HTMLTableRowElement>(null);\n const stickyHeaderRef = React.useRef<StickyHeaderRef>(null);\n const scrollbarRef = React.useRef<HTMLDivElement>(null);\n const { cancelEdit, ...cellEditing } = useCellEditing({ onCancel: onEditCancel, onSubmit: submitEdit });\n\n useImperativeHandle(\n ref,\n () => ({\n scrollToTop: stickyHeaderRef.current?.scrollToTop || (() => undefined),\n cancelEdit,\n }),\n [cancelEdit]\n );\n\n const handleScroll = useScrollSync([wrapperRefObject, scrollbarRef, secondaryWrapperRef]);\n\n const { moveFocusDown, moveFocusUp, moveFocus } = useSelectionFocusMove(selectionType, items.length);\n const { onRowClickHandler, onRowContextMenuHandler } = useRowEvents({ onRowClick, onRowContextMenu });\n\n const visibleColumnDefinitions = getVisibleColumnDefinitions({\n columnDefinitions,\n columnDisplay,\n visibleColumns,\n });\n\n const { isItemSelected, getSelectAllProps, getItemSelectionProps, updateShiftToggle } = useSelection({\n items,\n trackBy,\n selectedItems,\n selectionType,\n isItemDisabled,\n onSelectionChange,\n ariaLabels,\n loading,\n });\n\n if (isDevelopment) {\n if (resizableColumns) {\n checkColumnWidths(columnDefinitions);\n }\n if (sortingColumn?.sortingComparator) {\n checkSortingState(columnDefinitions, sortingColumn.sortingComparator);\n }\n }\n\n const isVisualRefresh = useVisualRefresh();\n const computedVariant = isVisualRefresh\n ? variant\n : ['embedded', 'full-page'].indexOf(variant) > -1\n ? 'container'\n : variant;\n const hasHeader = !!(header || filter || pagination || preferences);\n const hasSelection = !!selectionType;\n const hasFooterPagination = isMobile && variant === 'full-page' && !!pagination;\n const hasFooter = !!footer || hasFooterPagination;\n\n const headerIdRef = useRef<string | undefined>(undefined);\n const isLabelledByHeader = !ariaLabels?.tableLabel && !!header;\n const setHeaderRef = useCallback((id: string) => {\n headerIdRef.current = id;\n }, []);\n\n const visibleColumnWidthsWithSelection: ColumnWidthDefinition[] = [];\n const visibleColumnIdsWithSelection: PropertyKey[] = [];\n if (hasSelection) {\n visibleColumnWidthsWithSelection.push({ id: selectionColumnId, width: SELECTION_COLUMN_WIDTH });\n visibleColumnIdsWithSelection.push(selectionColumnId);\n }\n for (let columnIndex = 0; columnIndex < visibleColumnDefinitions.length; columnIndex++) {\n const columnId = getColumnKey(visibleColumnDefinitions[columnIndex], columnIndex);\n visibleColumnWidthsWithSelection.push({ ...visibleColumnDefinitions[columnIndex], id: columnId });\n visibleColumnIdsWithSelection.push(columnId);\n }\n\n const stickyState = useStickyColumns({\n visibleColumns: visibleColumnIdsWithSelection,\n stickyColumnsFirst: (stickyColumns?.first ?? 0) + (stickyColumns?.first && hasSelection ? 1 : 0),\n stickyColumnsLast: stickyColumns?.last || 0,\n });\n\n const hasStickyColumns = !!((stickyColumns?.first ?? 0) + (stickyColumns?.last ?? 0) > 0);\n const hasEditableCells = !!columnDefinitions.find(col => col.editConfig);\n const tableRole = hasEditableCells ? 'grid-default' : 'table';\n\n const theadProps: TheadProps = {\n containerWidth,\n selectionType,\n getSelectAllProps,\n columnDefinitions: visibleColumnDefinitions,\n variant: computedVariant,\n wrapLines,\n resizableColumns,\n sortingColumn,\n sortingDisabled,\n sortingDescending,\n onSortingChange,\n onFocusMove: moveFocus,\n onResizeFinish(newWidth) {\n const widthsDetail = columnDefinitions.map(\n (column, index) => newWidth[getColumnKey(column, index)] || (column.width as number) || DEFAULT_COLUMN_WIDTH\n );\n const widthsChanged = widthsDetail.some((width, index) => columnDefinitions[index].width !== width);\n if (widthsChanged) {\n fireNonCancelableEvent(onColumnWidthsChange, { widths: widthsDetail });\n }\n },\n singleSelectionHeaderAriaLabel: ariaLabels?.selectionGroupLabel,\n stripedRows,\n stickyState,\n selectionColumnId,\n tableRole,\n };\n\n const wrapperRef = useMergeRefs(wrapperRefObject, stickyState.refs.wrapper);\n const tableRef = useMergeRefs(tableMeasureRef, tableRefObject, stickyState.refs.table);\n\n const wrapperProps = getTableWrapperRoleProps({\n tableRole,\n isScrollable: !!(tableWidth && containerWidth && tableWidth > containerWidth),\n ariaLabel: ariaLabels?.tableLabel,\n });\n\n const getMouseDownTarget = useMouseDownTarget();\n\n const hasDynamicHeight = computedVariant === 'full-page';\n const overlapElement = useDynamicOverlap({ disabled: !hasDynamicHeight });\n useTableFocusNavigation(selectionType, tableRefObject, visibleColumnDefinitions, items?.length);\n const toolsHeaderWrapper = useRef(null);\n // If is mobile, we take into consideration the AppLayout's mobile bar and we subtract the tools wrapper height so only the table header is sticky\n const toolsHeaderHeight =\n (toolsHeaderWrapper?.current as HTMLDivElement | null)?.getBoundingClientRect().height ?? 0;\n\n const totalColumnsCount = selectionType ? visibleColumnDefinitions.length + 1 : visibleColumnDefinitions.length;\n\n return (\n <LinkDefaultVariantContext.Provider value={{ defaultVariant: 'primary' }}>\n <ColumnWidthsProvider visibleColumns={visibleColumnWidthsWithSelection} resizableColumns={resizableColumns}>\n <InternalContainer\n {...baseProps}\n __internalRootRef={__internalRootRef}\n className={clsx(baseProps.className, styles.root)}\n __funnelSubStepProps={__funnelSubStepProps}\n header={\n <>\n {hasHeader && (\n <div\n ref={overlapElement}\n className={clsx(hasDynamicHeight && [styles['dark-header'], 'awsui-context-content-header'])}\n >\n <div\n ref={toolsHeaderWrapper}\n className={clsx(styles['header-controls'], styles[`variant-${computedVariant}`])}\n >\n <CollectionLabelContext.Provider value={{ assignId: setHeaderRef }}>\n <ToolsHeader\n header={header}\n filter={filter}\n pagination={pagination}\n preferences={preferences}\n />\n </CollectionLabelContext.Provider>\n </div>\n </div>\n )}\n {stickyHeader && (\n <StickyHeader\n ref={stickyHeaderRef}\n variant={computedVariant}\n theadProps={theadProps}\n wrapperRef={wrapperRefObject}\n theadRef={theadRef}\n secondaryWrapperRef={secondaryWrapperRef}\n tableRef={tableRefObject}\n onScroll={handleScroll}\n tableHasHeader={hasHeader}\n contentDensity={contentDensity}\n tableRole={tableRole}\n />\n )}\n </>\n }\n disableHeaderPaddings={true}\n disableContentPaddings={true}\n variant={toContainerVariant(computedVariant)}\n __disableFooterPaddings={true}\n __disableFooterDivider={true}\n __disableStickyMobile={false}\n footer={\n hasFooter ? (\n <div className={clsx(styles['footer-wrapper'], styles[`variant-${computedVariant}`])}>\n <div className={clsx(styles.footer, hasFooterPagination && styles['footer-with-pagination'])}>\n {footer && <span>{footer}</span>}\n {hasFooterPagination && <div className={styles['footer-pagination']}>{pagination}</div>}\n </div>\n </div>\n ) : null\n }\n __stickyHeader={stickyHeader}\n __mobileStickyOffset={toolsHeaderHeight}\n __stickyOffset={stickyHeaderVerticalOffset}\n {...focusMarkers.root}\n >\n <div\n ref={wrapperRef}\n className={clsx(styles.wrapper, styles[`variant-${computedVariant}`], {\n [styles['has-footer']]: hasFooter,\n [styles['has-header']]: hasHeader,\n })}\n style={stickyState.style.wrapper}\n onScroll={handleScroll}\n {...wrapperProps}\n >\n <div className={styles['wrapper-content-measure']} ref={wrapperMeasureRef}></div>\n {!!renderAriaLive && !!firstIndex && (\n <LiveRegion>\n <span>\n {renderAriaLive({ totalItemsCount, firstIndex, lastIndex: firstIndex + items.length - 1 })}\n </span>\n </LiveRegion>\n )}\n <table\n ref={tableRef}\n className={clsx(\n styles.table,\n resizableColumns && styles['table-layout-fixed'],\n contentDensity === 'compact' && getVisualContextClassname('compact-table')\n )}\n {...getTableRoleProps({\n tableRole,\n totalItemsCount,\n totalColumnsCount: totalColumnsCount,\n ariaLabel: ariaLabels?.tableLabel,\n ariaLabelledBy: isLabelledByHeader && headerIdRef.current ? headerIdRef.current : undefined,\n })}\n >\n <Thead\n ref={theadRef}\n hidden={stickyHeader}\n onFocusedComponentChange={focusId => stickyHeaderRef.current?.setFocus(focusId)}\n {...theadProps}\n />\n <tbody>\n {loading || items.length === 0 ? (\n <tr>\n <NoDataCell\n variant={variant}\n containerWidth={containerWidth ?? 0}\n totalColumnsCount={totalColumnsCount}\n hasFooter={hasFooter}\n loading={loading}\n loadingText={loadingText}\n empty={empty}\n tableRef={tableRefObject}\n />\n </tr>\n ) : (\n items.map((item, rowIndex) => {\n const firstVisible = rowIndex === 0;\n const lastVisible = rowIndex === items.length - 1;\n const isEven = rowIndex % 2 === 0;\n const isSelected = !!selectionType && isItemSelected(item);\n const isPrevSelected = !!selectionType && !firstVisible && isItemSelected(items[rowIndex - 1]);\n const isNextSelected = !!selectionType && !lastVisible && isItemSelected(items[rowIndex + 1]);\n return (\n <tr\n key={getItemKey(trackBy, item, rowIndex)}\n className={clsx(styles.row, isSelected && styles['row-selected'])}\n onFocus={({ currentTarget }) => {\n // When an element inside table row receives focus we want to adjust the scroll.\n // However, that behaviour is unwanted when the focus is received as result of a click\n // as it causes the click to never reach the target element.\n if (!currentTarget.contains(getMouseDownTarget())) {\n stickyHeaderRef.current?.scrollToRow(currentTarget);\n }\n }}\n {...focusMarkers.item}\n onClick={onRowClickHandler && onRowClickHandler.bind(null, rowIndex, item)}\n onContextMenu={onRowContextMenuHandler && onRowContextMenuHandler.bind(null, rowIndex, item)}\n {...getTableRowRoleProps({ tableRole, firstIndex, rowIndex })}\n >\n {selectionType !== undefined && (\n <TableTdElement\n className={clsx(styles['selection-control'])}\n isVisualRefresh={isVisualRefresh}\n isFirstRow={firstVisible}\n isLastRow={lastVisible}\n isSelected={isSelected}\n isNextSelected={isNextSelected}\n isPrevSelected={isPrevSelected}\n wrapLines={false}\n isEvenRow={isEven}\n stripedRows={stripedRows}\n hasSelection={hasSelection}\n hasFooter={hasFooter}\n stickyState={stickyState}\n columnId={selectionColumnId}\n colIndex={0}\n tableRole={tableRole}\n >\n <SelectionControl\n onFocusDown={moveFocusDown}\n onFocusUp={moveFocusUp}\n onShiftToggle={updateShiftToggle}\n {...getItemSelectionProps(item)}\n />\n </TableTdElement>\n )}\n {visibleColumnDefinitions.map((column, colIndex) => {\n const isEditing = cellEditing.checkEditing({ rowIndex, colIndex });\n const successfulEdit = cellEditing.checkLastSuccessfulEdit({ rowIndex, colIndex });\n const isEditable = !!column.editConfig && !cellEditing.isLoading;\n return (\n <TableBodyCell\n key={getColumnKey(column, colIndex)}\n style={\n resizableColumns\n ? {}\n : {\n width: column.width,\n minWidth: column.minWidth,\n maxWidth: column.maxWidth,\n }\n }\n ariaLabels={ariaLabels}\n column={column}\n item={item}\n wrapLines={wrapLines}\n isEditable={isEditable}\n isEditing={isEditing}\n isRowHeader={column.isRowHeader}\n isFirstRow={firstVisible}\n isLastRow={lastVisible}\n isSelected={isSelected}\n isNextSelected={isNextSelected}\n isPrevSelected={isPrevSelected}\n successfulEdit={successfulEdit}\n onEditStart={() => cellEditing.startEdit({ rowIndex, colIndex })}\n onEditEnd={editCancelled =>\n cellEditing.completeEdit({ rowIndex, colIndex }, editCancelled)\n }\n submitEdit={cellEditing.submitEdit}\n hasFooter={hasFooter}\n stripedRows={stripedRows}\n isEvenRow={isEven}\n columnId={column.id ?? colIndex}\n colIndex={selectionType !== undefined ? colIndex + 1 : colIndex}\n stickyState={stickyState}\n isVisualRefresh={isVisualRefresh}\n tableRole={tableRole}\n />\n );\n })}\n </tr>\n );\n })\n )}\n </tbody>\n </table>\n {resizableColumns && <ResizeTracker />}\n </div>\n\n <StickyScrollbar\n ref={scrollbarRef}\n wrapperRef={wrapperRefObject}\n tableRef={tableRefObject}\n onScroll={handleScroll}\n hasStickyColumns={hasStickyColumns}\n />\n </InternalContainer>\n </ColumnWidthsProvider>\n </LinkDefaultVariantContext.Provider>\n );\n }\n) as TableForwardRefType;\n\nexport default InternalTable;\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["table/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,iBAA6C,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAqB,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,UAAU,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,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,cAAc,EACxB,QAAQ,EAAE,YAAY,EACtB,gBAAgB,EAAE,gBAAgB,GAClC,CACgB,CACC,CACY,CACtC,CAAC;AACJ,CAAC,CACqB,CAAC;AAEzB,eAAe,aAAa,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useCallback, useImperativeHandle, useRef } from 'react';\nimport { TableForwardRefType, TableProps } from './interfaces';\nimport { getVisualContextClassname } from '../internal/components/visual-context';\nimport InternalContainer, { InternalContainerProps } from '../container/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport ToolsHeader from './tools-header';\nimport Thead, { TheadProps } from './thead';\nimport { TableBodyCell } from './body-cell';\nimport { supportsStickyPosition } from '../internal/utils/dom';\nimport { checkSortingState, getColumnKey, getItemKey, getVisibleColumnDefinitions, toContainerVariant } from './utils';\nimport { useRowEvents } from './use-row-events';\nimport { SelectionControl, focusMarkers, useSelectionFocusMove, useSelection } from './selection';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { isDevelopment } from '../internal/is-development';\nimport { ColumnWidthDefinition, ColumnWidthsProvider, DEFAULT_COLUMN_WIDTH } from './use-column-widths';\nimport { useScrollSync } from '../internal/hooks/use-scroll-sync';\nimport { ResizeTracker } from './resizer';\nimport styles from './styles.css.js';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport StickyHeader, { StickyHeaderRef } from './sticky-header';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport useMouseDownTarget from '../internal/hooks/use-mouse-down-target';\nimport { useDynamicOverlap } from '../internal/hooks/use-dynamic-overlap';\nimport LiveRegion from '../internal/components/live-region';\nimport useTableFocusNavigation from './use-table-focus-navigation';\nimport { SomeRequired } from '../internal/types';\nimport { TableTdElement } from './body-cell/td-element';\nimport { useStickyColumns } from './sticky-columns';\nimport { StickyScrollbar } from './sticky-scrollbar';\nimport { checkColumnWidths } from './column-widths-utils';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { getTableRoleProps, getTableRowRoleProps, getTableWrapperRoleProps } from './table-role';\nimport { useCellEditing } from './use-cell-editing';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport { CollectionLabelContext } from '../internal/context/collection-label-context';\nimport { useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { NoDataCell } from './node-data-cell';\n\nconst SELECTION_COLUMN_WIDTH = 54;\nconst selectionColumnId = Symbol('selection-column-id');\n\ntype InternalTableProps<T> = SomeRequired<TableProps<T>, 'items' | 'selectedItems' | 'variant'> &\n InternalBaseComponentProps & {\n __funnelSubStepProps?: InternalContainerProps['__funnelSubStepProps'];\n };\n\nexport const InternalTableAsSubstep = React.forwardRef(\n <T,>(props: InternalTableProps<T>, ref: React.Ref<TableProps.Ref>) => {\n const { funnelSubStepProps } = useFunnelSubStep();\n\n const tableProps: InternalTableProps<T> = {\n ...props,\n __funnelSubStepProps: funnelSubStepProps,\n };\n\n return <InternalTable {...tableProps} ref={ref} />;\n }\n) as TableForwardRefType;\n\nconst InternalTable = React.forwardRef(\n <T,>(\n {\n header,\n footer,\n empty,\n filter,\n pagination,\n preferences,\n items,\n columnDefinitions,\n trackBy,\n loading,\n loadingText,\n selectionType,\n selectedItems,\n isItemDisabled,\n ariaLabels,\n onSelectionChange,\n onSortingChange,\n sortingColumn,\n sortingDescending,\n sortingDisabled,\n visibleColumns,\n stickyHeader,\n stickyHeaderVerticalOffset,\n onRowClick,\n onRowContextMenu,\n wrapLines,\n stripedRows,\n contentDensity,\n submitEdit,\n onEditCancel,\n resizableColumns,\n onColumnWidthsChange,\n variant,\n __internalRootRef,\n totalItemsCount,\n firstIndex,\n renderAriaLive,\n stickyColumns,\n columnDisplay,\n __funnelSubStepProps,\n ...rest\n }: InternalTableProps<T>,\n ref: React.Ref<TableProps.Ref>\n ) => {\n const baseProps = getBaseProps(rest);\n stickyHeader = stickyHeader && supportsStickyPosition();\n const isMobile = useMobile();\n\n const [containerWidth, wrapperMeasureRef] = useContainerQuery<number>(rect => rect.contentBoxWidth);\n const wrapperRefObject = useRef(null);\n\n const [tableWidth, tableMeasureRef] = useContainerQuery<number>(rect => rect.contentBoxWidth);\n const tableRefObject = useRef(null);\n\n const secondaryWrapperRef = React.useRef<HTMLDivElement>(null);\n const theadRef = useRef<HTMLTableRowElement>(null);\n const stickyHeaderRef = React.useRef<StickyHeaderRef>(null);\n const scrollbarRef = React.useRef<HTMLDivElement>(null);\n const { cancelEdit, ...cellEditing } = useCellEditing({ onCancel: onEditCancel, onSubmit: submitEdit });\n\n useImperativeHandle(\n ref,\n () => ({\n scrollToTop: stickyHeaderRef.current?.scrollToTop || (() => undefined),\n cancelEdit,\n }),\n [cancelEdit]\n );\n\n const handleScroll = useScrollSync([wrapperRefObject, scrollbarRef, secondaryWrapperRef]);\n\n const { moveFocusDown, moveFocusUp, moveFocus } = useSelectionFocusMove(selectionType, items.length);\n const { onRowClickHandler, onRowContextMenuHandler } = useRowEvents({ onRowClick, onRowContextMenu });\n\n const visibleColumnDefinitions = getVisibleColumnDefinitions({\n columnDefinitions,\n columnDisplay,\n visibleColumns,\n });\n\n const { isItemSelected, getSelectAllProps, getItemSelectionProps, updateShiftToggle } = useSelection({\n items,\n trackBy,\n selectedItems,\n selectionType,\n isItemDisabled,\n onSelectionChange,\n ariaLabels,\n loading,\n });\n\n if (isDevelopment) {\n if (resizableColumns) {\n checkColumnWidths(columnDefinitions);\n }\n if (sortingColumn?.sortingComparator) {\n checkSortingState(columnDefinitions, sortingColumn.sortingComparator);\n }\n }\n\n const isVisualRefresh = useVisualRefresh();\n const computedVariant = isVisualRefresh\n ? variant\n : ['embedded', 'full-page'].indexOf(variant) > -1\n ? 'container'\n : variant;\n const hasHeader = !!(header || filter || pagination || preferences);\n const hasSelection = !!selectionType;\n const hasFooterPagination = isMobile && variant === 'full-page' && !!pagination;\n const hasFooter = !!footer || hasFooterPagination;\n\n const headerIdRef = useRef<string | undefined>(undefined);\n const isLabelledByHeader = !ariaLabels?.tableLabel && !!header;\n const setHeaderRef = useCallback((id: string) => {\n headerIdRef.current = id;\n }, []);\n\n const visibleColumnWidthsWithSelection: ColumnWidthDefinition[] = [];\n const visibleColumnIdsWithSelection: PropertyKey[] = [];\n if (hasSelection) {\n visibleColumnWidthsWithSelection.push({ id: selectionColumnId, width: SELECTION_COLUMN_WIDTH });\n visibleColumnIdsWithSelection.push(selectionColumnId);\n }\n for (let columnIndex = 0; columnIndex < visibleColumnDefinitions.length; columnIndex++) {\n const columnId = getColumnKey(visibleColumnDefinitions[columnIndex], columnIndex);\n visibleColumnWidthsWithSelection.push({ ...visibleColumnDefinitions[columnIndex], id: columnId });\n visibleColumnIdsWithSelection.push(columnId);\n }\n\n const stickyState = useStickyColumns({\n visibleColumns: visibleColumnIdsWithSelection,\n stickyColumnsFirst: (stickyColumns?.first ?? 0) + (stickyColumns?.first && hasSelection ? 1 : 0),\n stickyColumnsLast: stickyColumns?.last || 0,\n });\n\n const hasStickyColumns = !!((stickyColumns?.first ?? 0) + (stickyColumns?.last ?? 0) > 0);\n const hasEditableCells = !!columnDefinitions.find(col => col.editConfig);\n const tableRole = hasEditableCells ? 'grid-default' : 'table';\n\n const theadProps: TheadProps = {\n containerWidth,\n selectionType,\n getSelectAllProps,\n columnDefinitions: visibleColumnDefinitions,\n variant: computedVariant,\n wrapLines,\n resizableColumns,\n sortingColumn,\n sortingDisabled,\n sortingDescending,\n onSortingChange,\n onFocusMove: moveFocus,\n onResizeFinish(newWidth) {\n const widthsDetail = columnDefinitions.map(\n (column, index) => newWidth[getColumnKey(column, index)] || (column.width as number) || DEFAULT_COLUMN_WIDTH\n );\n const widthsChanged = widthsDetail.some((width, index) => columnDefinitions[index].width !== width);\n if (widthsChanged) {\n fireNonCancelableEvent(onColumnWidthsChange, { widths: widthsDetail });\n }\n },\n singleSelectionHeaderAriaLabel: ariaLabels?.selectionGroupLabel,\n resizerRoleDescription: ariaLabels?.resizerRoleDescription,\n stripedRows,\n stickyState,\n selectionColumnId,\n tableRole,\n };\n\n const wrapperRef = useMergeRefs(wrapperRefObject, stickyState.refs.wrapper);\n const tableRef = useMergeRefs(tableMeasureRef, tableRefObject, stickyState.refs.table);\n\n const wrapperProps = getTableWrapperRoleProps({\n tableRole,\n isScrollable: !!(tableWidth && containerWidth && tableWidth > containerWidth),\n ariaLabel: ariaLabels?.tableLabel,\n });\n\n const getMouseDownTarget = useMouseDownTarget();\n\n const hasDynamicHeight = computedVariant === 'full-page';\n const overlapElement = useDynamicOverlap({ disabled: !hasDynamicHeight });\n useTableFocusNavigation(selectionType, tableRefObject, visibleColumnDefinitions, items?.length);\n const toolsHeaderWrapper = useRef(null);\n // If is mobile, we take into consideration the AppLayout's mobile bar and we subtract the tools wrapper height so only the table header is sticky\n const toolsHeaderHeight =\n (toolsHeaderWrapper?.current as HTMLDivElement | null)?.getBoundingClientRect().height ?? 0;\n\n const totalColumnsCount = selectionType ? visibleColumnDefinitions.length + 1 : visibleColumnDefinitions.length;\n\n return (\n <LinkDefaultVariantContext.Provider value={{ defaultVariant: 'primary' }}>\n <ColumnWidthsProvider visibleColumns={visibleColumnWidthsWithSelection} resizableColumns={resizableColumns}>\n <InternalContainer\n {...baseProps}\n __internalRootRef={__internalRootRef}\n className={clsx(baseProps.className, styles.root)}\n __funnelSubStepProps={__funnelSubStepProps}\n header={\n <>\n {hasHeader && (\n <div\n ref={overlapElement}\n className={clsx(hasDynamicHeight && [styles['dark-header'], 'awsui-context-content-header'])}\n >\n <div\n ref={toolsHeaderWrapper}\n className={clsx(styles['header-controls'], styles[`variant-${computedVariant}`])}\n >\n <CollectionLabelContext.Provider value={{ assignId: setHeaderRef }}>\n <ToolsHeader\n header={header}\n filter={filter}\n pagination={pagination}\n preferences={preferences}\n />\n </CollectionLabelContext.Provider>\n </div>\n </div>\n )}\n {stickyHeader && (\n <StickyHeader\n ref={stickyHeaderRef}\n variant={computedVariant}\n theadProps={theadProps}\n wrapperRef={wrapperRefObject}\n theadRef={theadRef}\n secondaryWrapperRef={secondaryWrapperRef}\n tableRef={tableRefObject}\n onScroll={handleScroll}\n tableHasHeader={hasHeader}\n contentDensity={contentDensity}\n tableRole={tableRole}\n />\n )}\n </>\n }\n disableHeaderPaddings={true}\n disableContentPaddings={true}\n variant={toContainerVariant(computedVariant)}\n __disableFooterPaddings={true}\n __disableFooterDivider={true}\n __disableStickyMobile={false}\n footer={\n hasFooter ? (\n <div className={clsx(styles['footer-wrapper'], styles[`variant-${computedVariant}`])}>\n <div className={clsx(styles.footer, hasFooterPagination && styles['footer-with-pagination'])}>\n {footer && <span>{footer}</span>}\n {hasFooterPagination && <div className={styles['footer-pagination']}>{pagination}</div>}\n </div>\n </div>\n ) : null\n }\n __stickyHeader={stickyHeader}\n __mobileStickyOffset={toolsHeaderHeight}\n __stickyOffset={stickyHeaderVerticalOffset}\n {...focusMarkers.root}\n >\n <div\n ref={wrapperRef}\n className={clsx(styles.wrapper, styles[`variant-${computedVariant}`], {\n [styles['has-footer']]: hasFooter,\n [styles['has-header']]: hasHeader,\n })}\n style={stickyState.style.wrapper}\n onScroll={handleScroll}\n {...wrapperProps}\n >\n <div className={styles['wrapper-content-measure']} ref={wrapperMeasureRef}></div>\n {!!renderAriaLive && !!firstIndex && (\n <LiveRegion>\n <span>\n {renderAriaLive({ totalItemsCount, firstIndex, lastIndex: firstIndex + items.length - 1 })}\n </span>\n </LiveRegion>\n )}\n <table\n ref={tableRef}\n className={clsx(\n styles.table,\n resizableColumns && styles['table-layout-fixed'],\n contentDensity === 'compact' && getVisualContextClassname('compact-table')\n )}\n {...getTableRoleProps({\n tableRole,\n totalItemsCount,\n totalColumnsCount: totalColumnsCount,\n ariaLabel: ariaLabels?.tableLabel,\n ariaLabelledBy: isLabelledByHeader && headerIdRef.current ? headerIdRef.current : undefined,\n })}\n >\n <Thead\n ref={theadRef}\n hidden={stickyHeader}\n onFocusedComponentChange={focusId => stickyHeaderRef.current?.setFocus(focusId)}\n {...theadProps}\n />\n <tbody>\n {loading || items.length === 0 ? (\n <tr>\n <NoDataCell\n variant={variant}\n containerWidth={containerWidth ?? 0}\n totalColumnsCount={totalColumnsCount}\n hasFooter={hasFooter}\n loading={loading}\n loadingText={loadingText}\n empty={empty}\n tableRef={tableRefObject}\n />\n </tr>\n ) : (\n items.map((item, rowIndex) => {\n const firstVisible = rowIndex === 0;\n const lastVisible = rowIndex === items.length - 1;\n const isEven = rowIndex % 2 === 0;\n const isSelected = !!selectionType && isItemSelected(item);\n const isPrevSelected = !!selectionType && !firstVisible && isItemSelected(items[rowIndex - 1]);\n const isNextSelected = !!selectionType && !lastVisible && isItemSelected(items[rowIndex + 1]);\n return (\n <tr\n key={getItemKey(trackBy, item, rowIndex)}\n className={clsx(styles.row, isSelected && styles['row-selected'])}\n onFocus={({ currentTarget }) => {\n // When an element inside table row receives focus we want to adjust the scroll.\n // However, that behaviour is unwanted when the focus is received as result of a click\n // as it causes the click to never reach the target element.\n if (!currentTarget.contains(getMouseDownTarget())) {\n stickyHeaderRef.current?.scrollToRow(currentTarget);\n }\n }}\n {...focusMarkers.item}\n onClick={onRowClickHandler && onRowClickHandler.bind(null, rowIndex, item)}\n onContextMenu={onRowContextMenuHandler && onRowContextMenuHandler.bind(null, rowIndex, item)}\n {...getTableRowRoleProps({ tableRole, firstIndex, rowIndex })}\n >\n {selectionType !== undefined && (\n <TableTdElement\n className={clsx(styles['selection-control'])}\n isVisualRefresh={isVisualRefresh}\n isFirstRow={firstVisible}\n isLastRow={lastVisible}\n isSelected={isSelected}\n isNextSelected={isNextSelected}\n isPrevSelected={isPrevSelected}\n wrapLines={false}\n isEvenRow={isEven}\n stripedRows={stripedRows}\n hasSelection={hasSelection}\n hasFooter={hasFooter}\n stickyState={stickyState}\n columnId={selectionColumnId}\n colIndex={0}\n tableRole={tableRole}\n >\n <SelectionControl\n onFocusDown={moveFocusDown}\n onFocusUp={moveFocusUp}\n onShiftToggle={updateShiftToggle}\n {...getItemSelectionProps(item)}\n />\n </TableTdElement>\n )}\n {visibleColumnDefinitions.map((column, colIndex) => {\n const isEditing = cellEditing.checkEditing({ rowIndex, colIndex });\n const successfulEdit = cellEditing.checkLastSuccessfulEdit({ rowIndex, colIndex });\n const isEditable = !!column.editConfig && !cellEditing.isLoading;\n return (\n <TableBodyCell\n key={getColumnKey(column, colIndex)}\n style={\n resizableColumns\n ? {}\n : {\n width: column.width,\n minWidth: column.minWidth,\n maxWidth: column.maxWidth,\n }\n }\n ariaLabels={ariaLabels}\n column={column}\n item={item}\n wrapLines={wrapLines}\n isEditable={isEditable}\n isEditing={isEditing}\n isRowHeader={column.isRowHeader}\n isFirstRow={firstVisible}\n isLastRow={lastVisible}\n isSelected={isSelected}\n isNextSelected={isNextSelected}\n isPrevSelected={isPrevSelected}\n successfulEdit={successfulEdit}\n onEditStart={() => cellEditing.startEdit({ rowIndex, colIndex })}\n onEditEnd={editCancelled =>\n cellEditing.completeEdit({ rowIndex, colIndex }, editCancelled)\n }\n submitEdit={cellEditing.submitEdit}\n hasFooter={hasFooter}\n stripedRows={stripedRows}\n isEvenRow={isEven}\n columnId={column.id ?? colIndex}\n colIndex={selectionType !== undefined ? colIndex + 1 : colIndex}\n stickyState={stickyState}\n isVisualRefresh={isVisualRefresh}\n tableRole={tableRole}\n />\n );\n })}\n </tr>\n );\n })\n )}\n </tbody>\n </table>\n {resizableColumns && <ResizeTracker />}\n </div>\n\n <StickyScrollbar\n ref={scrollbarRef}\n wrapperRef={wrapperRefObject}\n tableRef={tableRefObject}\n onScroll={handleScroll}\n hasStickyColumns={hasStickyColumns}\n />\n </InternalContainer>\n </ColumnWidthsProvider>\n </LinkDefaultVariantContext.Provider>\n );\n }\n) as TableForwardRefType;\n\nexport default InternalTable;\n"]}
|
package/table/resizer/index.d.ts
CHANGED
|
@@ -7,8 +7,9 @@ interface ResizerProps {
|
|
|
7
7
|
tabIndex?: number;
|
|
8
8
|
focusId?: string;
|
|
9
9
|
showFocusRing?: boolean;
|
|
10
|
+
roleDescription?: string;
|
|
10
11
|
}
|
|
11
|
-
export declare function Resizer({ onWidthUpdate, onWidthUpdateCommit, ariaLabelledby, minWidth, tabIndex, showFocusRing, focusId, }: ResizerProps): JSX.Element;
|
|
12
|
+
export declare function Resizer({ onWidthUpdate, onWidthUpdateCommit, ariaLabelledby, minWidth, tabIndex, showFocusRing, focusId, roleDescription, }: ResizerProps): JSX.Element;
|
|
12
13
|
export declare function ResizeTracker(): JSX.Element;
|
|
13
14
|
export {};
|
|
14
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["table/resizer/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["table/resizer/index.tsx"],"names":[],"mappings":";AAWA,UAAU,YAAY;IACpB,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAMD,wBAAgB,OAAO,CAAC,EACtB,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,QAA+B,EAC/B,QAAQ,EACR,aAAa,EACb,OAAO,EACP,eAAe,GAChB,EAAE,YAAY,eAmMd;AAED,wBAAgB,aAAa,gBAE5B"}
|
package/table/resizer/index.js
CHANGED
|
@@ -6,24 +6,28 @@ import styles from './styles.css.js';
|
|
|
6
6
|
import { KeyCode } from '../../internal/keycode';
|
|
7
7
|
import { DEFAULT_COLUMN_WIDTH } from '../use-column-widths';
|
|
8
8
|
import { useStableCallback } from '@cloudscape-design/component-toolkit/internal';
|
|
9
|
+
import { useUniqueId } from '../../internal/hooks/use-unique-id';
|
|
9
10
|
import { getHeaderWidth, getResizerElements } from './resizer-lookup';
|
|
10
11
|
const AUTO_GROW_START_TIME = 10;
|
|
11
12
|
const AUTO_GROW_INTERVAL = 10;
|
|
12
13
|
const AUTO_GROW_INCREMENT = 5;
|
|
13
|
-
export function Resizer({ onWidthUpdate, onWidthUpdateCommit, ariaLabelledby, minWidth = DEFAULT_COLUMN_WIDTH, tabIndex, showFocusRing, focusId, }) {
|
|
14
|
+
export function Resizer({ onWidthUpdate, onWidthUpdateCommit, ariaLabelledby, minWidth = DEFAULT_COLUMN_WIDTH, tabIndex, showFocusRing, focusId, roleDescription, }) {
|
|
14
15
|
onWidthUpdate = useStableCallback(onWidthUpdate);
|
|
15
16
|
onWidthUpdateCommit = useStableCallback(onWidthUpdateCommit);
|
|
16
|
-
const
|
|
17
|
+
const separatorId = useUniqueId();
|
|
18
|
+
const resizerToggleRef = useRef(null);
|
|
19
|
+
const resizerSeparatorRef = useRef(null);
|
|
17
20
|
const [isDragging, setIsDragging] = useState(false);
|
|
21
|
+
const [isKeyboardDragging, setIsKeyboardDragging] = useState(false);
|
|
18
22
|
const autoGrowTimeout = useRef();
|
|
19
23
|
const [resizerHasFocus, setResizerHasFocus] = useState(false);
|
|
20
24
|
const [headerCellWidth, setHeaderCellWidth] = useState(0);
|
|
21
25
|
// Read header width after mounting for it to be available in the element's ARIA label before it gets focused.
|
|
22
26
|
useEffect(() => {
|
|
23
|
-
setHeaderCellWidth(getHeaderWidth(
|
|
27
|
+
setHeaderCellWidth(getHeaderWidth(resizerToggleRef.current));
|
|
24
28
|
}, []);
|
|
25
29
|
useEffect(() => {
|
|
26
|
-
const elements = getResizerElements(
|
|
30
|
+
const elements = getResizerElements(resizerToggleRef.current);
|
|
27
31
|
if ((!isDragging && !resizerHasFocus) || !elements) {
|
|
28
32
|
return;
|
|
29
33
|
}
|
|
@@ -76,15 +80,30 @@ export function Resizer({ onWidthUpdate, onWidthUpdateCommit, ariaLabelledby, mi
|
|
|
76
80
|
clearTimeout(autoGrowTimeout.current);
|
|
77
81
|
};
|
|
78
82
|
const onKeyDown = (event) => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
var _a, _b;
|
|
84
|
+
if (isKeyboardDragging) {
|
|
85
|
+
// Update width
|
|
86
|
+
if (event.keyCode === KeyCode.left) {
|
|
87
|
+
event.preventDefault();
|
|
88
|
+
updateColumnWidth(elements.header.getBoundingClientRect().width - 10);
|
|
89
|
+
}
|
|
90
|
+
if (event.keyCode === KeyCode.right) {
|
|
91
|
+
event.preventDefault();
|
|
92
|
+
updateColumnWidth(elements.header.getBoundingClientRect().width + 10);
|
|
93
|
+
}
|
|
94
|
+
// Exit keyboard dragging mode
|
|
95
|
+
if (event.keyCode === KeyCode.enter || event.keyCode === KeyCode.space || event.keyCode === KeyCode.escape) {
|
|
96
|
+
event.preventDefault();
|
|
97
|
+
setIsKeyboardDragging(false);
|
|
98
|
+
(_a = resizerToggleRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
99
|
+
// The onWidthUpdateCommit is fired from the separator's blur event handler.
|
|
100
|
+
}
|
|
83
101
|
}
|
|
84
|
-
|
|
102
|
+
// Enter keyboard dragging mode
|
|
103
|
+
else if (event.keyCode === KeyCode.enter || event.keyCode === KeyCode.space) {
|
|
85
104
|
event.preventDefault();
|
|
86
|
-
|
|
87
|
-
|
|
105
|
+
setIsKeyboardDragging(true);
|
|
106
|
+
(_b = resizerSeparatorRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
88
107
|
}
|
|
89
108
|
};
|
|
90
109
|
updateTrackerPosition(elements.header.getBoundingClientRect().right);
|
|
@@ -94,10 +113,12 @@ export function Resizer({ onWidthUpdate, onWidthUpdateCommit, ariaLabelledby, mi
|
|
|
94
113
|
document.addEventListener('mouseup', onMouseUp);
|
|
95
114
|
}
|
|
96
115
|
if (resizerHasFocus) {
|
|
97
|
-
document.body.classList.add(styles['resize-active']);
|
|
98
116
|
document.body.classList.add(styles['resize-active-with-focus']);
|
|
99
117
|
elements.header.addEventListener('keydown', onKeyDown);
|
|
100
118
|
}
|
|
119
|
+
if (isKeyboardDragging) {
|
|
120
|
+
document.body.classList.add(styles['resize-active']);
|
|
121
|
+
}
|
|
101
122
|
return () => {
|
|
102
123
|
clearTimeout(autoGrowTimeout.current);
|
|
103
124
|
document.body.classList.remove(styles['resize-active']);
|
|
@@ -106,33 +127,38 @@ export function Resizer({ onWidthUpdate, onWidthUpdateCommit, ariaLabelledby, mi
|
|
|
106
127
|
document.removeEventListener('mouseup', onMouseUp);
|
|
107
128
|
elements.header.removeEventListener('keydown', onKeyDown);
|
|
108
129
|
};
|
|
109
|
-
}, [isDragging,
|
|
110
|
-
const headerCellWidthString = headerCellWidth.toFixed(0);
|
|
111
|
-
const resizerAriaProps = {
|
|
112
|
-
role: 'separator',
|
|
113
|
-
'aria-labelledby': ariaLabelledby,
|
|
114
|
-
'aria-orientation': 'vertical',
|
|
115
|
-
'aria-valuenow': headerCellWidth,
|
|
116
|
-
// aria-valuetext is needed because the VO announces "collapsed" when only aria-valuenow set without aria-valuemax
|
|
117
|
-
'aria-valuetext': headerCellWidthString,
|
|
118
|
-
'aria-valuemin': minWidth,
|
|
119
|
-
};
|
|
130
|
+
}, [minWidth, isDragging, isKeyboardDragging, resizerHasFocus, onWidthUpdate, onWidthUpdateCommit]);
|
|
120
131
|
return (React.createElement(React.Fragment, null,
|
|
121
|
-
React.createElement("
|
|
132
|
+
React.createElement("button", { ref: resizerToggleRef, className: clsx(styles.resizer, isDragging && styles['resizer-active'], (resizerHasFocus || showFocusRing || isKeyboardDragging) && styles['has-focus']), onMouseDown: event => {
|
|
122
133
|
if (event.button !== 0) {
|
|
123
134
|
return;
|
|
124
135
|
}
|
|
125
136
|
event.preventDefault();
|
|
126
137
|
setIsDragging(true);
|
|
127
138
|
}, onClick: () => {
|
|
128
|
-
|
|
139
|
+
var _a;
|
|
140
|
+
// Prevent mouse drag activation and activate keyboard dragging for VO+Space click.
|
|
129
141
|
setIsDragging(false);
|
|
142
|
+
setResizerHasFocus(true);
|
|
143
|
+
setIsKeyboardDragging(true);
|
|
144
|
+
(_a = resizerSeparatorRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
130
145
|
}, onFocus: () => {
|
|
131
|
-
setHeaderCellWidth(getHeaderWidth(
|
|
146
|
+
setHeaderCellWidth(getHeaderWidth(resizerToggleRef.current));
|
|
132
147
|
setResizerHasFocus(true);
|
|
133
|
-
}, onBlur:
|
|
148
|
+
}, onBlur: event => {
|
|
149
|
+
// Ignoring blur event when focus moves to the resizer separator element.
|
|
150
|
+
// (This focus transition is done programmatically when the resizer button is clicked).
|
|
151
|
+
if (event.relatedTarget !== resizerSeparatorRef.current) {
|
|
152
|
+
setResizerHasFocus(false);
|
|
153
|
+
}
|
|
154
|
+
}, "aria-roledescription": roleDescription, "aria-labelledby": ariaLabelledby, tabIndex: tabIndex, "data-focus-id": focusId }),
|
|
155
|
+
React.createElement("span", { ref: resizerSeparatorRef, id: separatorId, role: "separator", tabIndex: -1, "aria-hidden": !isKeyboardDragging, "aria-orientation": "vertical", "aria-valuenow": headerCellWidth, "aria-valuetext": headerCellWidth.toFixed(0), "aria-valuemin": minWidth, "data-focus-id": focusId, onBlur: () => {
|
|
134
156
|
setResizerHasFocus(false);
|
|
135
|
-
|
|
157
|
+
if (isKeyboardDragging) {
|
|
158
|
+
setIsKeyboardDragging(false);
|
|
159
|
+
}
|
|
160
|
+
onWidthUpdateCommit();
|
|
161
|
+
} })));
|
|
136
162
|
}
|
|
137
163
|
export function ResizeTracker() {
|
|
138
164
|
return React.createElement("span", { className: styles.tracker });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["table/resizer/index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,CAAC,CAAC;YACtB,CAAC,EACD,OAAO,EAAE,GAAG,EAAE;gBACZ,wDAAwD;gBACxD,aAAa,CAAC,KAAK,CAAC,CAAC;YACvB,CAAC,EACD,OAAO,EAAE,GAAG,EAAE;gBACZ,kBAAkB,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;gBACvD,kBAAkB,CAAC,IAAI,CAAC,CAAC;YAC3B,CAAC,EACD,MAAM,EAAE,GAAG,EAAE;gBACX,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,IACG,gBAAgB,IACpB,QAAQ,EAAE,QAAQ,mBACH,OAAO,IACtB,CACD,CACJ,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,8BAAM,SAAS,EAAE,MAAM,CAAC,OAAO,GAAI,CAAC;AAC7C,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useEffect, useRef, useState } from 'react';\nimport styles from './styles.css.js';\nimport { KeyCode } from '../../internal/keycode';\nimport { DEFAULT_COLUMN_WIDTH } from '../use-column-widths';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\nimport { getHeaderWidth, getResizerElements } from './resizer-lookup';\n\ninterface ResizerProps {\n onWidthUpdate: (newWidth: number) => void;\n onWidthUpdateCommit: () => void;\n ariaLabelledby?: string;\n minWidth?: number;\n tabIndex?: number;\n focusId?: string;\n showFocusRing?: boolean;\n}\n\nconst AUTO_GROW_START_TIME = 10;\nconst AUTO_GROW_INTERVAL = 10;\nconst AUTO_GROW_INCREMENT = 5;\n\nexport function Resizer({\n onWidthUpdate,\n onWidthUpdateCommit,\n ariaLabelledby,\n minWidth = DEFAULT_COLUMN_WIDTH,\n tabIndex,\n showFocusRing,\n focusId,\n}: ResizerProps) {\n onWidthUpdate = useStableCallback(onWidthUpdate);\n onWidthUpdateCommit = useStableCallback(onWidthUpdateCommit);\n\n const resizerRef = useRef<HTMLSpanElement>(null);\n const [isDragging, setIsDragging] = useState(false);\n const autoGrowTimeout = useRef<ReturnType<typeof setTimeout> | undefined>();\n const [resizerHasFocus, setResizerHasFocus] = useState(false);\n const [headerCellWidth, setHeaderCellWidth] = useState(0);\n\n // Read header width after mounting for it to be available in the element's ARIA label before it gets focused.\n useEffect(() => {\n setHeaderCellWidth(getHeaderWidth(resizerRef.current));\n }, []);\n\n useEffect(() => {\n const elements = getResizerElements(resizerRef.current);\n if ((!isDragging && !resizerHasFocus) || !elements) {\n return;\n }\n\n const { left: leftEdge, right: rightEdge } = elements.scrollParent.getBoundingClientRect();\n\n const updateTrackerPosition = (newOffset: number) => {\n const { left: scrollParentLeft } = elements.table.getBoundingClientRect();\n elements.tracker.style.top = elements.header.getBoundingClientRect().height + 'px';\n // minus one pixel to offset the cell border\n elements.tracker.style.left = newOffset - scrollParentLeft - 1 + 'px';\n };\n\n const updateColumnWidth = (newWidth: number) => {\n const { right, width } = elements.header.getBoundingClientRect();\n const updatedWidth = newWidth < minWidth ? minWidth : newWidth;\n updateTrackerPosition(right + updatedWidth - width);\n if (newWidth >= minWidth) {\n setHeaderCellWidth(newWidth);\n }\n // callbacks must be the last calls in the handler, because they may cause an extra update\n onWidthUpdate(newWidth);\n };\n\n const resizeColumn = (offset: number) => {\n if (offset > leftEdge) {\n const cellLeft = elements.header.getBoundingClientRect().left;\n const newWidth = offset - cellLeft;\n // callbacks must be the last calls in the handler, because they may cause an extra update\n updateColumnWidth(newWidth);\n }\n };\n\n const onAutoGrow = () => {\n const width = elements.header.getBoundingClientRect().width;\n autoGrowTimeout.current = setTimeout(onAutoGrow, AUTO_GROW_INTERVAL);\n // callbacks must be the last calls in the handler, because they may cause an extra update\n updateColumnWidth(width + AUTO_GROW_INCREMENT);\n elements.scrollParent.scrollLeft += AUTO_GROW_INCREMENT;\n };\n\n const onMouseMove = (event: MouseEvent) => {\n clearTimeout(autoGrowTimeout.current);\n const offset = event.pageX;\n if (offset > rightEdge) {\n autoGrowTimeout.current = setTimeout(onAutoGrow, AUTO_GROW_START_TIME);\n } else {\n resizeColumn(offset);\n }\n };\n\n const onMouseUp = (event: MouseEvent) => {\n resizeColumn(event.pageX);\n setIsDragging(false);\n onWidthUpdateCommit();\n clearTimeout(autoGrowTimeout.current);\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.keyCode === KeyCode.left) {\n event.preventDefault();\n updateColumnWidth(elements.header.getBoundingClientRect().width - 10);\n setTimeout(() => onWidthUpdateCommit(), 0);\n }\n if (event.keyCode === KeyCode.right) {\n event.preventDefault();\n updateColumnWidth(elements.header.getBoundingClientRect().width + 10);\n setTimeout(() => onWidthUpdateCommit(), 0);\n }\n };\n\n updateTrackerPosition(elements.header.getBoundingClientRect().right);\n\n if (isDragging) {\n document.body.classList.add(styles['resize-active']);\n document.addEventListener('mousemove', onMouseMove);\n document.addEventListener('mouseup', onMouseUp);\n }\n if (resizerHasFocus) {\n document.body.classList.add(styles['resize-active']);\n document.body.classList.add(styles['resize-active-with-focus']);\n elements.header.addEventListener('keydown', onKeyDown);\n }\n\n return () => {\n clearTimeout(autoGrowTimeout.current);\n document.body.classList.remove(styles['resize-active']);\n document.body.classList.remove(styles['resize-active-with-focus']);\n document.removeEventListener('mousemove', onMouseMove);\n document.removeEventListener('mouseup', onMouseUp);\n elements.header.removeEventListener('keydown', onKeyDown);\n };\n }, [isDragging, resizerHasFocus, minWidth, onWidthUpdate, onWidthUpdateCommit]);\n\n const headerCellWidthString = headerCellWidth.toFixed(0);\n const resizerAriaProps = {\n role: 'separator',\n 'aria-labelledby': ariaLabelledby,\n 'aria-orientation': 'vertical' as const,\n 'aria-valuenow': headerCellWidth,\n // aria-valuetext is needed because the VO announces \"collapsed\" when only aria-valuenow set without aria-valuemax\n 'aria-valuetext': headerCellWidthString,\n 'aria-valuemin': minWidth,\n };\n\n return (\n <>\n <span\n ref={resizerRef}\n className={clsx(\n styles.resizer,\n isDragging && styles['resizer-active'],\n (resizerHasFocus || showFocusRing) && styles['has-focus']\n )}\n onMouseDown={event => {\n if (event.button !== 0) {\n return;\n }\n event.preventDefault();\n setIsDragging(true);\n }}\n onClick={() => {\n // Prevents dragging mode activation for VO+Space click.\n setIsDragging(false);\n }}\n onFocus={() => {\n setHeaderCellWidth(getHeaderWidth(resizerRef.current));\n setResizerHasFocus(true);\n }}\n onBlur={() => {\n setResizerHasFocus(false);\n }}\n {...resizerAriaProps}\n tabIndex={tabIndex}\n data-focus-id={focusId}\n />\n </>\n );\n}\n\nexport function ResizeTracker() {\n return <span className={styles.tracker} />;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["table/resizer/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAatE,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAE9B,MAAM,UAAU,OAAO,CAAC,EACtB,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,QAAQ,GAAG,oBAAoB,EAC/B,QAAQ,EACR,aAAa,EACb,OAAO,EACP,eAAe,GACF;IACb,aAAa,GAAG,iBAAiB,CAAC,aA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AAC;YACvC,CAAC,EACD,OAAO,EAAE,GAAG,EAAE;gBACZ,kBAAkB,CAAC,cAAc,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC7D,kBAAkB,CAAC,IAAI,CAAC,CAAC;YAC3B,CAAC,EACD,MAAM,EAAE,KAAK,CAAC,EAAE;gBACd,yEAAyE;gBACzE,uFAAuF;gBACvF,IAAI,KAAK,CAAC,aAAa,KAAK,mBAAmB,CAAC,OAAO,EAAE;oBACvD,kBAAkB,CAAC,KAAK,CAAC,CAAC;iBAC3B;YACH,CAAC,0BAIqB,eAAe,qBACpB,cAAc,EAC/B,QAAQ,EAAE,QAAQ,mBACH,OAAO,GACtB;QACF,8BACE,GAAG,EAAE,mBAAmB,EACxB,EAAE,EAAE,WAAW,EACf,IAAI,EAAC,WAAW,EAChB,QAAQ,EAAE,CAAC,CAAC,iBACC,CAAC,kBAAkB,sBACf,UAAU,mBACZ,eAAe,oBAEd,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,mBAC3B,QAAQ,mBACR,OAAO,EACtB,MAAM,EAAE,GAAG,EAAE;gBACX,kBAAkB,CAAC,KAAK,CAAC,CAAC;gBAC1B,IAAI,kBAAkB,EAAE;oBACtB,qBAAqB,CAAC,KAAK,CAAC,CAAC;iBAC9B;gBACD,mBAAmB,EAAE,CAAC;YACxB,CAAC,GACD,CACD,CACJ,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,8BAAM,SAAS,EAAE,MAAM,CAAC,OAAO,GAAI,CAAC;AAC7C,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useEffect, useRef, useState } from 'react';\nimport styles from './styles.css.js';\nimport { KeyCode } from '../../internal/keycode';\nimport { DEFAULT_COLUMN_WIDTH } from '../use-column-widths';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { getHeaderWidth, getResizerElements } from './resizer-lookup';\n\ninterface ResizerProps {\n onWidthUpdate: (newWidth: number) => void;\n onWidthUpdateCommit: () => void;\n ariaLabelledby?: string;\n minWidth?: number;\n tabIndex?: number;\n focusId?: string;\n showFocusRing?: boolean;\n roleDescription?: string;\n}\n\nconst AUTO_GROW_START_TIME = 10;\nconst AUTO_GROW_INTERVAL = 10;\nconst AUTO_GROW_INCREMENT = 5;\n\nexport function Resizer({\n onWidthUpdate,\n onWidthUpdateCommit,\n ariaLabelledby,\n minWidth = DEFAULT_COLUMN_WIDTH,\n tabIndex,\n showFocusRing,\n focusId,\n roleDescription,\n}: ResizerProps) {\n onWidthUpdate = useStableCallback(onWidthUpdate);\n onWidthUpdateCommit = useStableCallback(onWidthUpdateCommit);\n\n const separatorId = useUniqueId();\n const resizerToggleRef = useRef<HTMLButtonElement>(null);\n const resizerSeparatorRef = useRef<HTMLSpanElement>(null);\n\n const [isDragging, setIsDragging] = useState(false);\n const [isKeyboardDragging, setIsKeyboardDragging] = useState(false);\n const autoGrowTimeout = useRef<ReturnType<typeof setTimeout> | undefined>();\n const [resizerHasFocus, setResizerHasFocus] = useState(false);\n const [headerCellWidth, setHeaderCellWidth] = useState(0);\n\n // Read header width after mounting for it to be available in the element's ARIA label before it gets focused.\n useEffect(() => {\n setHeaderCellWidth(getHeaderWidth(resizerToggleRef.current));\n }, []);\n\n useEffect(() => {\n const elements = getResizerElements(resizerToggleRef.current);\n if ((!isDragging && !resizerHasFocus) || !elements) {\n return;\n }\n\n const { left: leftEdge, right: rightEdge } = elements.scrollParent.getBoundingClientRect();\n\n const updateTrackerPosition = (newOffset: number) => {\n const { left: scrollParentLeft } = elements.table.getBoundingClientRect();\n elements.tracker.style.top = elements.header.getBoundingClientRect().height + 'px';\n // minus one pixel to offset the cell border\n elements.tracker.style.left = newOffset - scrollParentLeft - 1 + 'px';\n };\n\n const updateColumnWidth = (newWidth: number) => {\n const { right, width } = elements.header.getBoundingClientRect();\n const updatedWidth = newWidth < minWidth ? minWidth : newWidth;\n updateTrackerPosition(right + updatedWidth - width);\n if (newWidth >= minWidth) {\n setHeaderCellWidth(newWidth);\n }\n // callbacks must be the last calls in the handler, because they may cause an extra update\n onWidthUpdate(newWidth);\n };\n\n const resizeColumn = (offset: number) => {\n if (offset > leftEdge) {\n const cellLeft = elements.header.getBoundingClientRect().left;\n const newWidth = offset - cellLeft;\n // callbacks must be the last calls in the handler, because they may cause an extra update\n updateColumnWidth(newWidth);\n }\n };\n\n const onAutoGrow = () => {\n const width = elements.header.getBoundingClientRect().width;\n autoGrowTimeout.current = setTimeout(onAutoGrow, AUTO_GROW_INTERVAL);\n // callbacks must be the last calls in the handler, because they may cause an extra update\n updateColumnWidth(width + AUTO_GROW_INCREMENT);\n elements.scrollParent.scrollLeft += AUTO_GROW_INCREMENT;\n };\n\n const onMouseMove = (event: MouseEvent) => {\n clearTimeout(autoGrowTimeout.current);\n const offset = event.pageX;\n if (offset > rightEdge) {\n autoGrowTimeout.current = setTimeout(onAutoGrow, AUTO_GROW_START_TIME);\n } else {\n resizeColumn(offset);\n }\n };\n\n const onMouseUp = (event: MouseEvent) => {\n resizeColumn(event.pageX);\n setIsDragging(false);\n onWidthUpdateCommit();\n clearTimeout(autoGrowTimeout.current);\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (isKeyboardDragging) {\n // Update width\n if (event.keyCode === KeyCode.left) {\n event.preventDefault();\n updateColumnWidth(elements.header.getBoundingClientRect().width - 10);\n }\n if (event.keyCode === KeyCode.right) {\n event.preventDefault();\n updateColumnWidth(elements.header.getBoundingClientRect().width + 10);\n }\n // Exit keyboard dragging mode\n if (event.keyCode === KeyCode.enter || event.keyCode === KeyCode.space || event.keyCode === KeyCode.escape) {\n event.preventDefault();\n setIsKeyboardDragging(false);\n resizerToggleRef.current?.focus();\n // The onWidthUpdateCommit is fired from the separator's blur event handler.\n }\n }\n // Enter keyboard dragging mode\n else if (event.keyCode === KeyCode.enter || event.keyCode === KeyCode.space) {\n event.preventDefault();\n setIsKeyboardDragging(true);\n resizerSeparatorRef.current?.focus();\n }\n };\n\n updateTrackerPosition(elements.header.getBoundingClientRect().right);\n\n if (isDragging) {\n document.body.classList.add(styles['resize-active']);\n document.addEventListener('mousemove', onMouseMove);\n document.addEventListener('mouseup', onMouseUp);\n }\n if (resizerHasFocus) {\n document.body.classList.add(styles['resize-active-with-focus']);\n elements.header.addEventListener('keydown', onKeyDown);\n }\n if (isKeyboardDragging) {\n document.body.classList.add(styles['resize-active']);\n }\n\n return () => {\n clearTimeout(autoGrowTimeout.current);\n document.body.classList.remove(styles['resize-active']);\n document.body.classList.remove(styles['resize-active-with-focus']);\n document.removeEventListener('mousemove', onMouseMove);\n document.removeEventListener('mouseup', onMouseUp);\n elements.header.removeEventListener('keydown', onKeyDown);\n };\n }, [minWidth, isDragging, isKeyboardDragging, resizerHasFocus, onWidthUpdate, onWidthUpdateCommit]);\n\n return (\n <>\n <button\n ref={resizerToggleRef}\n className={clsx(\n styles.resizer,\n isDragging && styles['resizer-active'],\n (resizerHasFocus || showFocusRing || isKeyboardDragging) && styles['has-focus']\n )}\n onMouseDown={event => {\n if (event.button !== 0) {\n return;\n }\n event.preventDefault();\n setIsDragging(true);\n }}\n onClick={() => {\n // Prevent mouse drag activation and activate keyboard dragging for VO+Space click.\n setIsDragging(false);\n setResizerHasFocus(true);\n setIsKeyboardDragging(true);\n resizerSeparatorRef.current?.focus();\n }}\n onFocus={() => {\n setHeaderCellWidth(getHeaderWidth(resizerToggleRef.current));\n setResizerHasFocus(true);\n }}\n onBlur={event => {\n // Ignoring blur event when focus moves to the resizer separator element.\n // (This focus transition is done programmatically when the resizer button is clicked).\n if (event.relatedTarget !== resizerSeparatorRef.current) {\n setResizerHasFocus(false);\n }\n }}\n // Using a custom role-description to make the element's purpose better clear.\n // The role-description must include the word \"button\" to imply the interaction model.\n // See https://www.w3.org/TR/wai-aria-1.1/#aria-roledescription\n aria-roledescription={roleDescription}\n aria-labelledby={ariaLabelledby}\n tabIndex={tabIndex}\n data-focus-id={focusId}\n />\n <span\n ref={resizerSeparatorRef}\n id={separatorId}\n role=\"separator\"\n tabIndex={-1}\n aria-hidden={!isKeyboardDragging}\n aria-orientation=\"vertical\"\n aria-valuenow={headerCellWidth}\n // aria-valuetext is needed because the VO announces \"collapsed\" when only aria-valuenow set without aria-valuemax\n aria-valuetext={headerCellWidth.toFixed(0)}\n aria-valuemin={minWidth}\n data-focus-id={focusId}\n onBlur={() => {\n setResizerHasFocus(false);\n if (isKeyboardDragging) {\n setIsKeyboardDragging(false);\n }\n onWidthUpdateCommit();\n }}\n />\n </>\n );\n}\n\nexport function ResizeTracker() {\n return <span className={styles.tracker} />;\n}\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"resize-active": "awsui_resize-
|
|
5
|
-
"resize-active-with-focus": "awsui_resize-active-with-
|
|
6
|
-
"resizer": "
|
|
7
|
-
"resizer-active": "awsui_resizer-
|
|
8
|
-
"has-focus": "awsui_has-
|
|
9
|
-
"tracker": "
|
|
4
|
+
"resize-active": "awsui_resize-active_x7peu_19okv_93",
|
|
5
|
+
"resize-active-with-focus": "awsui_resize-active-with-focus_x7peu_19okv_93",
|
|
6
|
+
"resizer": "awsui_resizer_x7peu_19okv_98",
|
|
7
|
+
"resizer-active": "awsui_resizer-active_x7peu_19okv_130",
|
|
8
|
+
"has-focus": "awsui_has-focus_x7peu_19okv_142",
|
|
9
|
+
"tracker": "awsui_tracker_x7peu_19okv_165"
|
|
10
10
|
};
|
|
11
11
|
|
|
@@ -90,13 +90,15 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
90
90
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
|
-
.awsui_resize-
|
|
93
|
+
.awsui_resize-active_x7peu_19okv_93:not(#\9):not(.awsui_resize-active-with-focus_x7peu_19okv_93) * {
|
|
94
94
|
cursor: col-resize;
|
|
95
95
|
-webkit-user-select: none;
|
|
96
96
|
user-select: none;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
.
|
|
99
|
+
.awsui_resizer_x7peu_19okv_98:not(#\9) {
|
|
100
|
+
border: none;
|
|
101
|
+
background: none;
|
|
100
102
|
bottom: 0;
|
|
101
103
|
cursor: col-resize;
|
|
102
104
|
position: absolute;
|
|
@@ -104,15 +106,55 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
104
106
|
top: 0;
|
|
105
107
|
width: var(--space-l-t419sm, 20px);
|
|
106
108
|
z-index: 10;
|
|
109
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
110
|
+
border-collapse: separate;
|
|
111
|
+
border-spacing: 0;
|
|
112
|
+
caption-side: top;
|
|
113
|
+
cursor: auto;
|
|
114
|
+
direction: ltr;
|
|
115
|
+
empty-cells: show;
|
|
116
|
+
font-family: serif;
|
|
117
|
+
font-size: medium;
|
|
118
|
+
font-style: normal;
|
|
119
|
+
font-variant: normal;
|
|
120
|
+
font-weight: normal;
|
|
121
|
+
font-stretch: normal;
|
|
122
|
+
line-height: normal;
|
|
123
|
+
-webkit-hyphens: none;
|
|
124
|
+
hyphens: none;
|
|
125
|
+
letter-spacing: normal;
|
|
126
|
+
list-style: disc outside none;
|
|
127
|
+
tab-size: 8;
|
|
128
|
+
text-align: left;
|
|
129
|
+
text-align-last: auto;
|
|
130
|
+
text-indent: 0;
|
|
131
|
+
text-shadow: none;
|
|
132
|
+
text-transform: none;
|
|
133
|
+
visibility: visible;
|
|
134
|
+
white-space: normal;
|
|
135
|
+
widows: 2;
|
|
136
|
+
word-spacing: normal;
|
|
137
|
+
box-sizing: border-box;
|
|
138
|
+
font-size: var(--font-size-body-m-x4okxb, 14px);
|
|
139
|
+
line-height: var(--line-height-body-m-30ar75, 20px);
|
|
140
|
+
color: var(--color-text-body-default-2sxhhn, #000716);
|
|
141
|
+
font-weight: 400;
|
|
142
|
+
font-family: var(--font-family-base-dnvic8, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
143
|
+
-webkit-font-smoothing: auto;
|
|
144
|
+
-moz-osx-font-smoothing: auto;
|
|
145
|
+
}
|
|
146
|
+
.awsui_resizer_x7peu_19okv_98:not(#\9):focus {
|
|
147
|
+
outline: none;
|
|
148
|
+
text-decoration: none;
|
|
107
149
|
}
|
|
108
|
-
.awsui_resize-
|
|
150
|
+
.awsui_resize-active_x7peu_19okv_93 .awsui_resizer_x7peu_19okv_98:not(#\9) {
|
|
109
151
|
pointer-events: none;
|
|
110
152
|
}
|
|
111
|
-
th:not(#\9):last-child > .
|
|
153
|
+
th:not(#\9):last-child > .awsui_resizer_x7peu_19okv_98 {
|
|
112
154
|
width: calc(var(--space-l-t419sm, 20px) / 2);
|
|
113
155
|
right: 0;
|
|
114
156
|
}
|
|
115
|
-
th:not(#\9):not(:last-child) > .
|
|
157
|
+
th:not(#\9):not(:last-child) > .awsui_resizer_x7peu_19okv_98:hover::before, th:not(#\9):not(:last-child) > .awsui_resizer-active_x7peu_19okv_130::before {
|
|
116
158
|
content: "";
|
|
117
159
|
position: absolute;
|
|
118
160
|
left: calc(var(--space-l-t419sm, 20px) / 2 - 2px);
|
|
@@ -124,15 +166,15 @@ th:not(#\9):not(:last-child) > .awsui_resizer_x7peu_1usw0_98:hover::before, th:n
|
|
|
124
166
|
border-left: 2px solid var(--color-border-divider-active-k4haaf, #000716);
|
|
125
167
|
box-sizing: border-box;
|
|
126
168
|
}
|
|
127
|
-
body[data-awsui-focus-visible=true] .
|
|
169
|
+
body[data-awsui-focus-visible=true] .awsui_resizer_x7peu_19okv_98.awsui_has-focus_x7peu_19okv_142:not(#\9) {
|
|
128
170
|
position: relative;
|
|
129
171
|
position: absolute;
|
|
130
172
|
}
|
|
131
|
-
body[data-awsui-focus-visible=true] .
|
|
173
|
+
body[data-awsui-focus-visible=true] .awsui_resizer_x7peu_19okv_98.awsui_has-focus_x7peu_19okv_142:not(#\9) {
|
|
132
174
|
outline: 2px dotted transparent;
|
|
133
175
|
outline-offset: calc(var(--space-table-header-focus-outline-gutter-7js4en, 0px) - 1px);
|
|
134
176
|
}
|
|
135
|
-
body[data-awsui-focus-visible=true] .
|
|
177
|
+
body[data-awsui-focus-visible=true] .awsui_resizer_x7peu_19okv_98.awsui_has-focus_x7peu_19okv_142:not(#\9)::before {
|
|
136
178
|
content: " ";
|
|
137
179
|
display: block;
|
|
138
180
|
position: absolute;
|
|
@@ -143,11 +185,11 @@ body[data-awsui-focus-visible=true] .awsui_resizer_x7peu_1usw0_98.awsui_has-focu
|
|
|
143
185
|
border-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
|
|
144
186
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-b2ntyl, #0972d3);
|
|
145
187
|
}
|
|
146
|
-
body[data-awsui-focus-visible=true] .
|
|
188
|
+
body[data-awsui-focus-visible=true] .awsui_resizer_x7peu_19okv_98.awsui_has-focus_x7peu_19okv_142:not(#\9)::before {
|
|
147
189
|
box-shadow: inset 0 0 0 2px var(--color-border-item-focused-b2ntyl, #0972d3);
|
|
148
190
|
}
|
|
149
191
|
|
|
150
|
-
.
|
|
192
|
+
.awsui_tracker_x7peu_19okv_165:not(#\9) {
|
|
151
193
|
display: none;
|
|
152
194
|
position: absolute;
|
|
153
195
|
border-left: var(--border-divider-list-width-27y3k5, 1px) dashed var(--color-border-divider-active-k4haaf, #000716);
|
|
@@ -155,6 +197,6 @@ body[data-awsui-focus-visible=true] .awsui_resizer_x7peu_1usw0_98.awsui_has-focu
|
|
|
155
197
|
top: 0;
|
|
156
198
|
bottom: 0;
|
|
157
199
|
}
|
|
158
|
-
.awsui_resize-
|
|
200
|
+
.awsui_resize-active_x7peu_19okv_93 .awsui_tracker_x7peu_19okv_165:not(#\9) {
|
|
159
201
|
display: block;
|
|
160
202
|
}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"resize-active": "awsui_resize-
|
|
6
|
-
"resize-active-with-focus": "awsui_resize-active-with-
|
|
7
|
-
"resizer": "
|
|
8
|
-
"resizer-active": "awsui_resizer-
|
|
9
|
-
"has-focus": "awsui_has-
|
|
10
|
-
"tracker": "
|
|
5
|
+
"resize-active": "awsui_resize-active_x7peu_19okv_93",
|
|
6
|
+
"resize-active-with-focus": "awsui_resize-active-with-focus_x7peu_19okv_93",
|
|
7
|
+
"resizer": "awsui_resizer_x7peu_19okv_98",
|
|
8
|
+
"resizer-active": "awsui_resizer-active_x7peu_19okv_130",
|
|
9
|
+
"has-focus": "awsui_has-focus_x7peu_19okv_142",
|
|
10
|
+
"tracker": "awsui_tracker_x7peu_19okv_165"
|
|
11
11
|
};
|
|
12
12
|
|
package/table/thead.d.ts
CHANGED
package/table/thead.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thead.d.ts","sourceRoot":"lib/default/","sources":["table/thead.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAkC,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,EAA0B,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAQvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAA8B,SAAS,EAAE,MAAM,cAAc,CAAC;AAIrE,MAAM,WAAW,UAAU;IACzB,cAAc,EAAE,IAAI,GAAG,MAAM,CAAC;IAC9B,aAAa,EAAE,UAAU,CAAC,aAAa,GAAG,SAAS,CAAC;IACpD,iB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,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,kBAAkB,CAAC;IAChC,iBAAiB,EAAE,WAAW,CAAC;IAC/B,gBAAgB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACjC,wBAAwB,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,GAAG,MAAM,KAAK,IAAI,CAAC;IAC5D,SAAS,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,KAAK,wFAwIV,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
package/table/thead.js
CHANGED
|
@@ -14,7 +14,7 @@ import ScreenreaderOnly from '../internal/components/screenreader-only';
|
|
|
14
14
|
import { getTableHeaderRowRoleProps } from './table-role';
|
|
15
15
|
import { TableThElement } from './header-cell/th-element';
|
|
16
16
|
import { findUpUntil } from '@cloudscape-design/component-toolkit/dom';
|
|
17
|
-
const Thead = React.forwardRef(({ containerWidth, selectionType, getSelectAllProps, columnDefinitions, sortingColumn, sortingDisabled, sortingDescending, resizableColumns, variant, wrapLines, onFocusMove, onSortingChange, onResizeFinish, singleSelectionHeaderAriaLabel, stripedRows, sticky = false, hidden = false, stuck = false, stickyState, selectionColumnId, focusedComponent, onFocusedComponentChange, tableRole, }, outerRef) => {
|
|
17
|
+
const Thead = React.forwardRef(({ containerWidth, selectionType, getSelectAllProps, columnDefinitions, sortingColumn, sortingDisabled, sortingDescending, resizableColumns, variant, wrapLines, onFocusMove, onSortingChange, onResizeFinish, singleSelectionHeaderAriaLabel, stripedRows, sticky = false, hidden = false, stuck = false, stickyState, selectionColumnId, focusedComponent, onFocusedComponentChange, tableRole, resizerRoleDescription, }, outerRef) => {
|
|
18
18
|
const isVisualRefresh = useVisualRefresh();
|
|
19
19
|
const headerCellClass = clsx(headerCellStyles['header-cell'], headerCellStyles[`header-cell-variant-${variant}`], sticky && headerCellStyles['header-cell-sticky'], stuck && headerCellStyles['header-cell-stuck'], stripedRows && headerCellStyles['has-striped-rows'], isVisualRefresh && headerCellStyles['is-visual-refresh']);
|
|
20
20
|
const selectionCellClass = clsx(styles['selection-control'], styles['selection-control-header'], isVisualRefresh && styles['is-visual-refresh']);
|
|
@@ -46,7 +46,7 @@ const Thead = React.forwardRef(({ containerWidth, selectionType, getSelectAllPro
|
|
|
46
46
|
width: widthOverride || column.width,
|
|
47
47
|
minWidth: sticky ? undefined : column.minWidth,
|
|
48
48
|
maxWidth: resizableColumns || sticky ? undefined : column.maxWidth,
|
|
49
|
-
}, tabIndex: sticky ? -1 : 0, focusedComponent: focusedComponent, column: column, activeSortingColumn: sortingColumn, sortingDescending: sortingDescending, sortingDisabled: sortingDisabled, wrapLines: wrapLines, hidden: hidden, colIndex: selectionType ? colIndex + 1 : colIndex, columnId: columnId, updateColumn: updateColumn, onResizeFinish: () => onResizeFinish(columnWidths), resizableColumns: resizableColumns, onClick: detail => fireNonCancelableEvent(onSortingChange, detail), isEditable: !!column.editConfig, stickyState: stickyState, cellRef: node => setCell(columnId, node), tableRole: tableRole }));
|
|
49
|
+
}, tabIndex: sticky ? -1 : 0, focusedComponent: focusedComponent, column: column, activeSortingColumn: sortingColumn, sortingDescending: sortingDescending, sortingDisabled: sortingDisabled, wrapLines: wrapLines, hidden: hidden, colIndex: selectionType ? colIndex + 1 : colIndex, columnId: columnId, updateColumn: updateColumn, onResizeFinish: () => onResizeFinish(columnWidths), resizableColumns: resizableColumns, onClick: detail => fireNonCancelableEvent(onSortingChange, detail), isEditable: !!column.editConfig, stickyState: stickyState, cellRef: node => setCell(columnId, node), tableRole: tableRole, resizerRoleDescription: resizerRoleDescription }));
|
|
50
50
|
}))));
|
|
51
51
|
});
|
|
52
52
|
export default Thead;
|