@cloudscape-design/components 3.0.420 → 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.
@@ -1,4 +1,4 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (e9fbf236)";
2
+ export var PACKAGE_VERSION = "3.0.0 (150cac6b)";
3
3
  export var THEME = "open-source-visual-refresh";
4
4
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (e9fbf236)",
3
+ "PACKAGE_VERSION": "3.0.0 (150cac6b)",
4
4
  "THEME": "default",
5
5
  "ALWAYS_VISUAL_REFRESH": false
6
6
  }
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "e9fbf2367717b27300bc11c194ca66a60b3f0af2"
2
+ "commit": "150cac6b85a28b70f467bcf2f84d6c1c4d4b1d4b"
3
3
  }
package/package.json CHANGED
@@ -112,7 +112,7 @@
112
112
  "./internal/base-component/index.js",
113
113
  "./internal/base-component/styles.css.js"
114
114
  ],
115
- "version": "3.0.420",
115
+ "version": "3.0.421",
116
116
  "repository": {
117
117
  "type": "git",
118
118
  "url": "https://github.com/cloudscape-design/components.git"
@@ -23,7 +23,8 @@ interface TableHeaderCellProps<ItemType> {
23
23
  cellRef: React.RefCallback<HTMLElement>;
24
24
  focusedComponent?: null | string;
25
25
  tableRole: TableRole;
26
+ resizerRoleDescription?: string;
26
27
  }
27
- export declare function TableHeaderCell<ItemType>({ className, style, tabIndex, column, activeSortingColumn, sortingDescending, sortingDisabled, wrapLines, focusedComponent, hidden, onClick, colIndex, updateColumn, resizableColumns, onResizeFinish, isEditable, columnId, stickyState, cellRef, tableRole, }: TableHeaderCellProps<ItemType>): JSX.Element;
28
+ export declare function TableHeaderCell<ItemType>({ className, style, tabIndex, column, activeSortingColumn, sortingDescending, sortingDisabled, wrapLines, focusedComponent, hidden, onClick, colIndex, updateColumn, resizableColumns, onResizeFinish, isEditable, columnId, stickyState, cellRef, tableRole, resizerRoleDescription, }: TableHeaderCellProps<ItemType>): JSX.Element;
28
29
  export {};
29
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["table/header-cell/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAM3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C,UAAU,oBAAoB,CAAC,QAAQ;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,mBAAmB,CAAC,EAAE,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACzD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IACpD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAChE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,WAAW,CAAC;IACtB,W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,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IACpD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAChE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,WAAW,CAAC;IACtB,WAAW,EAAE,kBAAkB,CAAC;IAChC,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IACxC,gBAAgB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACjC,SAAS,EAAE,SAAS,CAAC;IACrB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,EACxC,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAM,EACN,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,QAAQ,EACR,WAAW,EACX,OAAO,EACP,SAAS,EACT,sBAAsB,GACvB,EAAE,oBAAoB,CAAC,QAAQ,CAAC,eA6FhC"}
@@ -10,7 +10,7 @@ import { Resizer } from '../resizer';
10
10
  import { useUniqueId } from '../../internal/hooks/use-unique-id';
11
11
  import { useInternalI18n } from '../../i18n/context';
12
12
  import { TableThElement } from './th-element';
13
- export function TableHeaderCell({ className, style, tabIndex, column, activeSortingColumn, sortingDescending, sortingDisabled, wrapLines, focusedComponent, hidden, onClick, colIndex, updateColumn, resizableColumns, onResizeFinish, isEditable, columnId, stickyState, cellRef, tableRole, }) {
13
+ export function TableHeaderCell({ className, style, tabIndex, column, activeSortingColumn, sortingDescending, sortingDisabled, wrapLines, focusedComponent, hidden, onClick, colIndex, updateColumn, resizableColumns, onResizeFinish, isEditable, columnId, stickyState, cellRef, tableRole, resizerRoleDescription, }) {
14
14
  var _a;
15
15
  const i18n = useInternalI18n('table');
16
16
  const sortable = !!column.sortingComparator || !!column.sortingField;
@@ -54,6 +54,6 @@ export function TableHeaderCell({ className, style, tabIndex, column, activeSort
54
54
  React.createElement(InternalIcon, { name: "edit" }))) : null),
55
55
  sortingStatus && (React.createElement("span", { className: styles['sorting-icon'] },
56
56
  React.createElement(InternalIcon, { name: getSortingIconName(sortingStatus) })))),
57
- resizableColumns && (React.createElement(Resizer, { tabIndex: tabIndex, focusId: `resize-control-${String(columnId)}`, showFocusRing: focusedComponent === `resize-control-${String(columnId)}`, onWidthUpdate: newWidth => updateColumn(columnId, newWidth), onWidthUpdateCommit: onResizeFinish, ariaLabelledby: headerId, minWidth: typeof column.minWidth === 'string' ? parseInt(column.minWidth) : column.minWidth }))));
57
+ resizableColumns && (React.createElement(Resizer, { tabIndex: tabIndex, focusId: `resize-control-${String(columnId)}`, showFocusRing: focusedComponent === `resize-control-${String(columnId)}`, onWidthUpdate: newWidth => updateColumn(columnId, newWidth), onWidthUpdateCommit: onResizeFinish, ariaLabelledby: headerId, minWidth: typeof column.minWidth === 'string' ? parseInt(column.minWidth) : column.minWidth, roleDescription: i18n('ariaLabels.resizerRoleDescription', resizerRoleDescription) }))));
58
58
  }
59
59
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["table/header-cell/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM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kB,CAAC,EAAE,SAAS,IAAI,MAAM,CAAC,uBAAuB,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ;gBACzG,MAAM,CAAC,MAAM;gBACb,UAAU,CAAC,CAAC,CAAC,CACZ,8BACE,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,EAC9B,IAAI,EAAC,KAAK,gBACE,IAAI,CAAC,gDAAgD,EAAE,MAAA,MAAM,CAAC,UAAU,0CAAE,iBAAiB,CAAC;oBAExG,oBAAC,YAAY,IAAC,IAAI,EAAC,MAAM,GAAG,CACvB,CACR,CAAC,CAAC,CAAC,IAAI,CACJ;YACL,aAAa,IAAI,CAChB,8BAAM,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC;gBACrC,oBAAC,YAAY,IAAC,IAAI,EAAE,kBAAkB,CAAC,aAAa,CAAC,GAAI,CACpD,CACR,CACG;QACL,gBAAgB,IAAI,CACnB,oBAAC,OAAO,IACN,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,kBAAkB,MAAM,CAAC,QAAQ,CAAC,EAAE,EAC7C,aAAa,EAAE,gBAAgB,KAAK,kBAAkB,MAAM,CAAC,QAAQ,CAAC,EAAE,EACxE,aAAa,EAAE,QAAQ,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAC3D,mBAAmB,EAAE,cAAc,EACnC,cAAc,EAAE,QAAQ,EACxB,QAAQ,EAAE,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,GAC3F,CACH,CACc,CAClB,CAAC;AACJ,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 from 'react';\nimport InternalIcon from '../../icon/internal';\nimport { KeyCode } from '../../internal/keycode';\nimport { TableProps } from '../interfaces';\nimport { getSortingIconName, getSortingStatus, isSorted } from './utils';\nimport styles from './styles.css.js';\nimport { Resizer } from '../resizer';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { useInternalI18n } from '../../i18n/context';\nimport { StickyColumnsModel } from '../sticky-columns';\nimport { TableRole } from '../table-role';\nimport { TableThElement } from './th-element';\n\ninterface TableHeaderCellProps<ItemType> {\n className?: string;\n style?: React.CSSProperties;\n tabIndex: number;\n column: TableProps.ColumnDefinition<ItemType>;\n activeSortingColumn?: TableProps.SortingColumn<ItemType>;\n sortingDescending?: boolean;\n sortingDisabled?: boolean;\n wrapLines?: boolean;\n hidden?: boolean;\n onClick(detail: TableProps.SortingState<any>): void;\n onResizeFinish: () => void;\n colIndex: number;\n updateColumn: (columnId: PropertyKey, newWidth: number) => void;\n resizableColumns?: boolean;\n isEditable?: boolean;\n columnId: PropertyKey;\n stickyState: StickyColumnsModel;\n cellRef: React.RefCallback<HTMLElement>;\n focusedComponent?: null | string;\n tableRole: TableRole;\n}\n\nexport function TableHeaderCell<ItemType>({\n className,\n style,\n tabIndex,\n column,\n activeSortingColumn,\n sortingDescending,\n sortingDisabled,\n wrapLines,\n focusedComponent,\n hidden,\n onClick,\n colIndex,\n updateColumn,\n resizableColumns,\n onResizeFinish,\n isEditable,\n columnId,\n stickyState,\n cellRef,\n tableRole,\n}: TableHeaderCellProps<ItemType>) {\n const i18n = useInternalI18n('table');\n const sortable = !!column.sortingComparator || !!column.sortingField;\n const sorted = !!activeSortingColumn && isSorted(column, activeSortingColumn);\n const sortingStatus = getSortingStatus(sortable, sorted, !!sortingDescending, !!sortingDisabled);\n const handleClick = () =>\n onClick({\n sortingColumn: column,\n isDescending: sorted ? !sortingDescending : false,\n });\n\n // Elements with role=\"button\" do not have the default behavior of <button>, where pressing\n // Enter or Space will trigger a click event. Therefore we need to add this ourselves.\n // The native <button> element cannot be used due to a misaligned implementation in Firefox:\n // https://bugzilla.mozilla.org/show_bug.cgi?id=843003\n const handleKeyPress = ({ nativeEvent: e }: React.KeyboardEvent) => {\n if (e.keyCode === KeyCode.enter || e.keyCode === KeyCode.space) {\n e.preventDefault();\n handleClick();\n }\n };\n\n const headerId = useUniqueId('table-header-');\n\n return (\n <TableThElement\n className={className}\n style={style}\n cellRef={cellRef}\n sortingStatus={sortingStatus}\n sortingDisabled={sortingDisabled}\n hidden={hidden}\n colIndex={colIndex}\n resizableColumns={resizableColumns}\n columnId={columnId}\n stickyState={stickyState}\n tableRole={tableRole}\n >\n <div\n data-focus-id={`sorting-control-${String(columnId)}`}\n className={clsx(styles['header-cell-content'], {\n [styles['header-cell-fake-focus']]: focusedComponent === `sorting-control-${String(columnId)}`,\n })}\n aria-label={\n column.ariaLabel\n ? column.ariaLabel({\n sorted: sorted,\n descending: sorted && !!sortingDescending,\n disabled: !!sortingDisabled,\n })\n : undefined\n }\n {...(sortingStatus && !sortingDisabled\n ? {\n onKeyPress: handleKeyPress,\n tabIndex: tabIndex,\n role: 'button',\n onClick: handleClick,\n }\n : {})}\n >\n <div className={clsx(styles['header-cell-text'], wrapLines && styles['header-cell-text-wrap'])} id={headerId}>\n {column.header}\n {isEditable ? (\n <span\n className={styles['edit-icon']}\n role=\"img\"\n aria-label={i18n('columnDefinitions.editConfig.editIconAriaLabel', column.editConfig?.editIconAriaLabel)}\n >\n <InternalIcon name=\"edit\" />\n </span>\n ) : null}\n </div>\n {sortingStatus && (\n <span className={styles['sorting-icon']}>\n <InternalIcon name={getSortingIconName(sortingStatus)} />\n </span>\n )}\n </div>\n {resizableColumns && (\n <Resizer\n tabIndex={tabIndex}\n focusId={`resize-control-${String(columnId)}`}\n showFocusRing={focusedComponent === `resize-control-${String(columnId)}`}\n onWidthUpdate={newWidth => updateColumn(columnId, newWidth)}\n onWidthUpdateCommit={onResizeFinish}\n ariaLabelledby={headerId}\n minWidth={typeof column.minWidth === 'string' ? parseInt(column.minWidth) : column.minWidth}\n />\n )}\n </TableThElement>\n );\n}\n"]}
1
+ {"version":3,"file":"index.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Q,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAC3F,eAAe,EAAE,IAAI,CAAC,mCAAmC,EAAE,sBAAsB,CAAC,GAClF,CACH,CACc,CAClB,CAAC;AACJ,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 from 'react';\nimport InternalIcon from '../../icon/internal';\nimport { KeyCode } from '../../internal/keycode';\nimport { TableProps } from '../interfaces';\nimport { getSortingIconName, getSortingStatus, isSorted } from './utils';\nimport styles from './styles.css.js';\nimport { Resizer } from '../resizer';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { useInternalI18n } from '../../i18n/context';\nimport { StickyColumnsModel } from '../sticky-columns';\nimport { TableRole } from '../table-role';\nimport { TableThElement } from './th-element';\n\ninterface TableHeaderCellProps<ItemType> {\n className?: string;\n style?: React.CSSProperties;\n tabIndex: number;\n column: TableProps.ColumnDefinition<ItemType>;\n activeSortingColumn?: TableProps.SortingColumn<ItemType>;\n sortingDescending?: boolean;\n sortingDisabled?: boolean;\n wrapLines?: boolean;\n hidden?: boolean;\n onClick(detail: TableProps.SortingState<any>): void;\n onResizeFinish: () => void;\n colIndex: number;\n updateColumn: (columnId: PropertyKey, newWidth: number) => void;\n resizableColumns?: boolean;\n isEditable?: boolean;\n columnId: PropertyKey;\n stickyState: StickyColumnsModel;\n cellRef: React.RefCallback<HTMLElement>;\n focusedComponent?: null | string;\n tableRole: TableRole;\n resizerRoleDescription?: string;\n}\n\nexport function TableHeaderCell<ItemType>({\n className,\n style,\n tabIndex,\n column,\n activeSortingColumn,\n sortingDescending,\n sortingDisabled,\n wrapLines,\n focusedComponent,\n hidden,\n onClick,\n colIndex,\n updateColumn,\n resizableColumns,\n onResizeFinish,\n isEditable,\n columnId,\n stickyState,\n cellRef,\n tableRole,\n resizerRoleDescription,\n}: TableHeaderCellProps<ItemType>) {\n const i18n = useInternalI18n('table');\n const sortable = !!column.sortingComparator || !!column.sortingField;\n const sorted = !!activeSortingColumn && isSorted(column, activeSortingColumn);\n const sortingStatus = getSortingStatus(sortable, sorted, !!sortingDescending, !!sortingDisabled);\n const handleClick = () =>\n onClick({\n sortingColumn: column,\n isDescending: sorted ? !sortingDescending : false,\n });\n\n // Elements with role=\"button\" do not have the default behavior of <button>, where pressing\n // Enter or Space will trigger a click event. Therefore we need to add this ourselves.\n // The native <button> element cannot be used due to a misaligned implementation in Firefox:\n // https://bugzilla.mozilla.org/show_bug.cgi?id=843003\n const handleKeyPress = ({ nativeEvent: e }: React.KeyboardEvent) => {\n if (e.keyCode === KeyCode.enter || e.keyCode === KeyCode.space) {\n e.preventDefault();\n handleClick();\n }\n };\n\n const headerId = useUniqueId('table-header-');\n\n return (\n <TableThElement\n className={className}\n style={style}\n cellRef={cellRef}\n sortingStatus={sortingStatus}\n sortingDisabled={sortingDisabled}\n hidden={hidden}\n colIndex={colIndex}\n resizableColumns={resizableColumns}\n columnId={columnId}\n stickyState={stickyState}\n tableRole={tableRole}\n >\n <div\n data-focus-id={`sorting-control-${String(columnId)}`}\n className={clsx(styles['header-cell-content'], {\n [styles['header-cell-fake-focus']]: focusedComponent === `sorting-control-${String(columnId)}`,\n })}\n aria-label={\n column.ariaLabel\n ? column.ariaLabel({\n sorted: sorted,\n descending: sorted && !!sortingDescending,\n disabled: !!sortingDisabled,\n })\n : undefined\n }\n {...(sortingStatus && !sortingDisabled\n ? {\n onKeyPress: handleKeyPress,\n tabIndex: tabIndex,\n role: 'button',\n onClick: handleClick,\n }\n : {})}\n >\n <div className={clsx(styles['header-cell-text'], wrapLines && styles['header-cell-text-wrap'])} id={headerId}>\n {column.header}\n {isEditable ? (\n <span\n className={styles['edit-icon']}\n role=\"img\"\n aria-label={i18n('columnDefinitions.editConfig.editIconAriaLabel', column.editConfig?.editIconAriaLabel)}\n >\n <InternalIcon name=\"edit\" />\n </span>\n ) : null}\n </div>\n {sortingStatus && (\n <span className={styles['sorting-icon']}>\n <InternalIcon name={getSortingIconName(sortingStatus)} />\n </span>\n )}\n </div>\n {resizableColumns && (\n <Resizer\n tabIndex={tabIndex}\n focusId={`resize-control-${String(columnId)}`}\n showFocusRing={focusedComponent === `resize-control-${String(columnId)}`}\n onWidthUpdate={newWidth => updateColumn(columnId, newWidth)}\n onWidthUpdateCommit={onResizeFinish}\n ariaLabelledby={headerId}\n minWidth={typeof column.minWidth === 'string' ? parseInt(column.minWidth) : column.minWidth}\n roleDescription={i18n('ariaLabels.resizerRoleDescription', resizerRoleDescription)}\n />\n )}\n </TableThElement>\n );\n}\n"]}
@@ -139,6 +139,7 @@ export interface TableProps<T = any> extends BaseComponentProps {
139
139
  * add a meaningful description to the whole selection.
140
140
  * * `tableLabel` (string) - Provides an alternative text for the table. If you use a header for this table, you may reuse the string
141
141
  * to provide a caption-like description. For example, tableLabel=Instances will be announced as 'Instances table'.
142
+ * * `resizerRoleDescription` (string) - Provides role description for table column resizer buttons.
142
143
  * * `activateEditLabel` (EditableColumnDefinition, Item) => string -
143
144
  * Specifies an alternative text for the edit button in editable cells.
144
145
  * * `cancelEditLabel` (EditableColumnDefinition) => string -
@@ -341,6 +342,7 @@ export declare namespace TableProps {
341
342
  itemSelectionLabel?: (data: TableProps.SelectionState<T>, row: T) => string;
342
343
  selectionGroupLabel?: string;
343
344
  tableLabel?: string;
345
+ resizerRoleDescription?: string;
344
346
  activateEditLabel?: (column: ColumnDefinition<any>, item: T) => string;
345
347
  cancelEditLabel?: (column: ColumnDefinition<any>) => string;
346
348
  submitEditLabel?: (column: ColumnDefinition<any>) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["table/interfaces.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,C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E,MAAM,CAAC;QACjB,IAAI,EAAE,CAAC,CAAC;KACT;IACD,UAAiB,sBAAsB,CAAC,CAAC;QACvC,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,CAAC,CAAC;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB;IAED,UAAiB,wBAAwB;QACvC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;KAC/B;IAED,UAAiB,gBAAgB;QAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;KACnB;IAED,UAAiB,GAAG;QAClB;;;WAGG;QACH,WAAW,IAAI,IAAI,CAAC;QAEpB;;WAEG;QACH,UAAU,CAAC,IAAI,IAAI,CAAC;KACrB;IAED,KAAY,kBAAkB,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,IAAI,CAC9D,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EAClC,QAAQ,EAAE,SAAS,KAChB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAE1B,UAAiB,uBAAuB;QACtC,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,OAAO,CAAC;KAClB;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["table/interfaces.tsx"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler, CancelableEventHandler } from '../internal/events';\nimport { Optional } from '../internal/types';\nimport ColumnDisplayProperties = TableProps.ColumnDisplayProperties;\n\n/*\n * HACK: Cast the component to a named parametrized interface.\n *\n * This lets us use React.forwardRef and still let the component have type\n * parameters, and the naming convention lets the documenter know that this is\n * a forwardRef-wrapped component.\n *\n * We don't need to expose this type to customers because it's just a simple\n * function type.\n */\nexport interface TableForwardRefType {\n <T>(props: TableProps<T> & { ref?: React.Ref<TableProps.Ref> }): JSX.Element;\n}\n\nexport interface TableProps<T = any> extends BaseComponentProps {\n /**\n * Heading element of the table container. Use the [header component](/components/header/).\n */\n header?: React.ReactNode;\n\n /**\n * Footer of the table container.\n */\n footer?: React.ReactNode;\n\n /**\n * Displayed when the `items` property is an empty array. Use it to render an empty or no-match state.\n */\n empty?: React.ReactNode;\n\n /**\n * Specifies the data that's displayed in the table rows. Each item contains the data for one row. The display of a row is handled\n * by the `cell` property of each column definition in the `columnDefinitions` property.\n */\n items: ReadonlyArray<T>;\n\n /**\n * Renders the table in a loading state. We recommend that you also set a `loadingText`.\n */\n loading?: boolean;\n\n /**\n * Specifies the text that's displayed when the table is in a loading state.\n */\n loadingText?: string;\n\n /**\n * Specifies a property that uniquely identifies an individual item.\n * When it's set, it's used to provide [keys for React](https://reactjs.org/docs/lists-and-keys.html#keys)\n * for performance optimizations.\n *\n * It's also used to connect `items` and `selectedItems` values when they reference different objects.\n */\n trackBy?: TableProps.TrackBy<T>;\n\n /**\n * The columns configuration object\n * * `id` (string) - Specifies a unique column identifier. The property is used 1) as a [keys](https://reactjs.org/docs/lists-and-keys.html#keys) source for React rendering,\n * and 2) to match entries in the `columnDisplay` property, if defined.\n * * `header` (ReactNode) - Determines the display of the column header.\n * * `cell` ((item) => ReactNode) - Determines the display of a cell's content. You receive the current table row\n * item as an argument.\n * * `width` (string | number) - Specifies the column width. Corresponds to the `width` css-property. If the width is not set,\n * the browser automatically adjusts the column width based on the content. When `resizableColumns` property is\n * set to `true`, additional constraints apply: 1) string values are not allowed, and 2) the last visible column always\n * fills the remaining space of the table so the specified width is ignored.\n * * `minWidth` (string | number) - Specifies the minimum column width. Corresponds to the `min-width` css-property. When\n * `resizableColumns` property is set to `true`, additional constraints apply: 1) string values are not allowed,\n * and 2) the column can't resize below than the specified width (defaults to \"120px\"). We recommend that you set a minimum width\n * of at least 176px for columns that are editable.\n * * `maxWidth` (string | number) - Specifies the maximum column width. Corresponds to the `max-width` css-property.\n * Note that when the `resizableColumns` property is set to `true` this property is ignored.\n * * `ariaLabel` (LabelData => string) - An optional function that's called to provide an `aria-label` for the cell header.\n * It receives the current sorting state of this column, the direction it's sorted in, and an indication of\n * whether the sorting is disabled, as three Boolean values: `sorted`, `descending` and `disabled`.\n * We recommend that you use this for sortable columns to provide more meaningful labels based on the\n * current sorting direction.\n * * `sortingField` (string) - Enables default column sorting. The value is used in [collection hooks](/get-started/dev-guides/collection-hooks/)\n * to reorder the items. Provide the name of the property within each item that should be used for sorting by this column.\n * For more complex sorting use `sortingComparator` instead.\n * * `sortingComparator` ((T, T) => number) - Enables custom column sorting. The value is used in [collection hooks](/get-started/dev-guides/collection-hooks/)\n * to reorder the items. This property accepts a custom comparator that is used to compare two items.\n * The comparator must implement ascending ordering, and the output is inverted automatically in case of descending order.\n * If present, the `sortingField` property is ignored.\n * * `editConfig` (EditConfig) - Enables inline editing in column when present. The value is used to configure the editing behavior.\n * * * `editConfig.ariaLabel` (string) - Specifies a label for the edit control. Visually hidden but read by screen readers.\n * * * `editConfig.errorIconAriaLabel` (string) - Specifies an ariaLabel for the error icon that is displayed when the validation fails.\n * * * `editConfig.editIconAriaLabel` (string) - Specifies an alternate text for the edit icon used in column header.\n * * * `editConfig.constraintText` (string) - Constraint text that is displayed below the edit control.\n * * * `editConfig.validation` ((item, value) => string) - A function that allows you to validate the value of the edit control.\n * Return a string from the function to display an error message. Return `undefined` (or no return) from the function to indicate that the value is valid.\n * * * `editConfig.editingCell` ((item, cellContext) => ReactNode) - Determines the display of a cell's content when inline editing is active on a cell;\n * You receive the current table row `item` and a `cellContext` object as arguments.\n * The `cellContext` object contains the following properties:\n * * * `cellContext.currentValue` - State to keep track of a value in input fields while editing.\n * * * `cellContext.setValue` - Function to update `currentValue`. This should be called when the value in input field changes.\n * * `isRowHeader` (boolean) - Specifies that cells in this column should be used as row headers.\n */\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<T>>;\n /**\n * Specifies the selection type (`'single' | 'multi'`).\n */\n selectionType?: TableProps.SelectionType;\n /**\n * List of selected items.\n */\n selectedItems?: ReadonlyArray<T>;\n\n /**\n * Use this slot to add filtering controls to the table.\n */\n filter?: React.ReactNode;\n\n /**\n * Use this slot to add the [pagination component](/components/pagination/) to the table.\n */\n pagination?: React.ReactNode;\n\n /**\n * Use this slot to add [collection preferences](/components/collection-preferences/) to the table.\n */\n preferences?: React.ReactNode;\n\n /**\n * Determines whether a given item is disabled. If an item is disabled, the user can't select it.\n */\n isItemDisabled?: TableProps.IsItemDisabled<T>;\n\n /**\n * Specifies if text wraps within table cells. If set to `true`, long text within cells may wrap onto\n * multiple lines instead of being truncated with an ellipsis.\n */\n wrapLines?: boolean;\n\n /**\n * Specifies if table rows alternate being shaded and unshaded. If set to `true`, every other row will be shaded.\n */\n stripedRows?: boolean;\n\n /**\n * Toggles the content density of the table. Defaults to `'comfortable'`.\n */\n contentDensity?: 'comfortable' | 'compact';\n\n /**\n * Specifies if columns can be resized. If set to `true`, users can resize the columns in the table.\n */\n resizableColumns?: boolean;\n\n /**\n * Specifies alternative text for the selection components (checkboxes and radio buttons) as follows:\n * * `itemSelectionLabel` ((SelectionState, Item) => string) - Specifies the alternative text for an item.\n * * `allItemsSelectionLabel` ((SelectionState) => string) - Specifies the alternative text for multi-selection column header.\n * * `selectionGroupLabel` (string) - Specifies the alternative text for the whole selection and single-selection column header.\n * It is prefixed to `itemSelectionLabel` and `allItemsSelectionLabel` when they are set.\n * You can use the first argument of type `SelectionState` to access the current selection\n * state of the component (for example, the `selectedItems` list). The `itemSelectionLabel` for individual\n * items also receives the corresponding `Item` object. You can use the `selectionGroupLabel` to\n * add a meaningful description to the whole selection.\n * * `tableLabel` (string) - Provides an alternative text for the table. If you use a header for this table, you may reuse the string\n * to provide a caption-like description. For example, tableLabel=Instances will be announced as 'Instances table'.\n * * `activateEditLabel` (EditableColumnDefinition, Item) => string -\n * Specifies an alternative text for the edit button in editable cells.\n * * `cancelEditLabel` (EditableColumnDefinition) => string -\n * Specifies an alternative text for the cancel button in editable cells.\n * * `submitEditLabel` (EditableColumnDefinition) => string -\n * Specifies an alternative text for the submit button in editable cells.\n * * `successfulEditLabel` (EditableColumnDefinition) => string -\n * Specifies an alternative text for the success icon in editable cells. This text is also announced to screen readers.\n * * `submittingEditText` (EditableColumnDefinition) => string -\n * Specifies a text that is announced to screen readers when a cell edit operation is submitted.\n * @i18n\n */\n ariaLabels?: TableProps.AriaLabels<T>;\n\n /**\n * Specifies the definition object of the currently sorted column. Make sure you pass an object that's\n * present in the `columnDefinitions` array.\n */\n sortingColumn?: TableProps.SortingColumn<T>;\n /**\n * Specifies whether to use a descending sort order.\n */\n sortingDescending?: boolean;\n /**\n * Specifies if sorting buttons are disabled. For example, use this property\n * to prevent the user from sorting before items are fully loaded.\n */\n sortingDisabled?: boolean;\n\n /**\n * Specifies the number of first and/or last columns that should be sticky.\n *\n * If the available scrollable space is less than a certain threshold, the feature is deactivated.\n *\n * Use it in conjunction with the sticky columns preference of the\n * [collection preferences](/components/collection-preferences/) component.\n *\n */\n stickyColumns?: TableProps.StickyColumns;\n\n /**\n * Specifies an array that represents the table columns in the order in which they will be displayed, together with their visibility.\n *\n * If not set, all columns are displayed and the order is dictated by the `columnDefinitions` property.\n *\n * Use it in conjunction with the content display preference of the [collection preferences](/components/collection-preferences/) component.\n */\n columnDisplay?: ReadonlyArray<ColumnDisplayProperties>;\n\n /**\n * Specifies an array containing the `id`s of visible columns. If not set, all columns are displayed.\n *\n * Use it in conjunction with the visible content preference of the [collection preferences](/components/collection-preferences/) component.\n *\n * The order of ids doesn't influence the order in which columns are displayed - this is dictated by the `columnDefinitions` property.\n * */\n visibleColumns?: ReadonlyArray<string>;\n\n /**\n * Fired when the user resizes a table column. The event detail contains an array of column widths in pixels,\n * including the hidden via preferences columns. Use this event to persist the column widths.\n */\n onColumnWidthsChange?: NonCancelableEventHandler<TableProps.ColumnWidthsChangeDetail>;\n\n /**\n * Called when either the column to sort by or the direction of sorting changes upon user interaction.\n * The event detail contains the current sortingColumn and isDescending.\n */\n onSortingChange?: NonCancelableEventHandler<TableProps.SortingState<T>>;\n\n /**\n * Fired when a user interaction triggers a change in the list of selected items.\n * The event `detail` contains the current list of `selectedItems`.\n */\n onSelectionChange?: NonCancelableEventHandler<TableProps.SelectionChangeDetail<T>>;\n\n /**\n * Note: This feature is provided for backwards compatibility. Its use is not recommended,\n * and it may be deprecated in the future.\n *\n * Called when the user clicked at a table row. The event detail contains the index of the\n * clicked row and the row object itself. Use this event to define a row click behavior.\n */\n onRowClick?: NonCancelableEventHandler<TableProps.OnRowClickDetail<T>>;\n\n /**\n * Note: This feature is provided for backwards compatibility. Its use is not recommended,\n * and it may be deprecated in the future.\n *\n * Called when the user clicked at a table row with the right mouse click. The event detail\n * contains the index of the clicked row and the row object itself. Use this event to override\n * the default browser context menu behavior.\n */\n onRowContextMenu?: CancelableEventHandler<TableProps.OnRowContextMenuDetail<T>>;\n\n /**\n * If set to `true`, the table header remains visible when the user scrolls down.\n */\n stickyHeader?: boolean;\n\n /**\n * Specifies a vertical offset (in pixels) for the sticky header. For example, use this if you\n * need to position the sticky header below other fixed position elements on the page.\n */\n stickyHeaderVerticalOffset?: number;\n\n /**\n * Specify a table variant with one of the following:\n * * `container` - Use this variant to have the table displayed within a container.\n * * `borderless` - Use this variant when the table should have no outer borders or shadow\n * (such as in a dashboard item container).\n * * `embedded` - Use this variant within a parent container (such as a modal, expandable\n * section, container or split panel).\n * **Deprecated**, replaced by `borderless` and `container`.\n * * `stacked` - Use this variant adjacent to other stacked containers (such as a container,\n * table).\n * * `full-page` – Use this variant when the table is the entire content of a page. Full page variants\n * implement the high contrast header and content behavior automatically.\n * @visualrefresh `embedded`, `stacked`, and `full-page` variants\n */\n variant?: TableProps.Variant;\n\n /**\n * Use this property to inform screen readers how many items there are in a table.\n * It specifies the total count of all items in a table.\n * If there is an unknown total of items in a table, leave this property undefined. */\n totalItemsCount?: number;\n /**\n * Use this property to inform screen readers which range of items is currently displayed in the table.\n * It specifies the index (1-based) of the first item in the table.\n * If the table has no pagination, leave this property undefined. */\n firstIndex?: number;\n /**\n * Use this function to announce page changes to screen reader users.\n * Requires the properties firstIndex and totalItemsCount to be set correctly.\n */\n renderAriaLive?: (data: TableProps.LiveAnnouncement) => string;\n /**\n * Specifies a function that will be called after user submits an inline edit.\n * Return a promise to keep loading state while the submit request is in progress.\n */\n submitEdit?: TableProps.SubmitEditFunction<T>;\n\n /**\n * Called whenever user cancels an inline edit. Use this function to reset any\n * validation states, or show warning for unsaved changes.\n */\n onEditCancel?: CancelableEventHandler;\n}\n\nexport namespace TableProps {\n export type TrackBy<T> = string | ((item: T) => string);\n\n export interface CellContext<V> {\n currentValue: Optional<V>;\n setValue: (value: V | undefined) => void;\n }\n\n export interface EditConfig<T, V = any> {\n /**\n * Specifies a label for the edit control. Visually hidden but read\n * by screen readers.\n */\n ariaLabel?: string;\n /**\n * Specifies an ariaLabel for the error icon that is displayed when\n * the validation fails.\n */\n errorIconAriaLabel?: string;\n /**\n * Specifies an alternate text for the edit icon used in column header.\n */\n editIconAriaLabel?: string;\n /**\n * Constraint text that is displayed below the edit control.\n */\n constraintText?: string;\n /**\n * A function that allows you to validate the value of the edit control. Return\n * a string from the function to display an error message. Return\n * `undefined` (or no return) from the function to indicate that the value is valid.\n * @param item - The item that is being edited.\n * @param value - The current value of the edit control.\n */\n validation?: (item: T, value: Optional<V>) => Optional<string>;\n\n /**\n * Determines the display of a cell's content when inline edit is active.\n */\n editingCell(item: T, ctx: TableProps.CellContext<any>): React.ReactNode;\n }\n\n export type ColumnDefinition<ItemType> = {\n id?: string;\n header: React.ReactNode;\n ariaLabel?(data: LabelData): string;\n width?: number | string;\n minWidth?: number | string;\n maxWidth?: number | string;\n editConfig?: EditConfig<ItemType>;\n isRowHeader?: boolean;\n cell(item: ItemType): React.ReactNode;\n } & SortingColumn<ItemType>;\n\n export interface StickyColumns {\n first?: number;\n last?: number;\n }\n\n export type SelectionType = 'single' | 'multi';\n export type Variant = 'container' | 'embedded' | 'borderless' | 'stacked' | 'full-page';\n export interface SelectionState<T> {\n selectedItems: ReadonlyArray<T>;\n }\n export interface SelectionChangeDetail<T> {\n selectedItems: T[];\n }\n export type IsItemDisabled<T> = (item: T) => boolean;\n export interface AriaLabels<T> {\n allItemsSelectionLabel?: (data: TableProps.SelectionState<T>) => string;\n itemSelectionLabel?: (data: TableProps.SelectionState<T>, row: T) => string;\n selectionGroupLabel?: string;\n tableLabel?: string;\n // do not use <T> to prevent overly strict validation on consumer end\n // it works, practically, we are only interested in `id` and `header` properties only\n activateEditLabel?: (column: ColumnDefinition<any>, item: T) => string;\n cancelEditLabel?: (column: ColumnDefinition<any>) => string;\n submitEditLabel?: (column: ColumnDefinition<any>) => string;\n submittingEditText?: (column: ColumnDefinition<any>) => string;\n successfulEditLabel?: (column: ColumnDefinition<any>) => string;\n }\n export interface SortingState<T> {\n isDescending?: boolean;\n sortingColumn: SortingColumn<T>;\n }\n export interface SortingColumn<T> {\n sortingField?: string;\n sortingComparator?: (a: T, b: T) => number;\n }\n export interface LabelData {\n sorted: boolean;\n descending: boolean;\n disabled: boolean;\n }\n export interface OnRowClickDetail<T> {\n rowIndex: number;\n item: T;\n }\n export interface OnRowContextMenuDetail<T> {\n rowIndex: number;\n item: T;\n clientX: number;\n clientY: number;\n }\n\n export interface ColumnWidthsChangeDetail {\n widths: ReadonlyArray<number>;\n }\n\n export interface LiveAnnouncement {\n totalItemsCount?: number;\n firstIndex: number;\n lastIndex: number;\n }\n\n export interface Ref {\n /**\n * When the sticky header is enabled and you call this function, the table\n * scroll parent scrolls to reveal the first row of the table.\n */\n scrollToTop(): void;\n\n /**\n * Dismiss an inline edit if currently active.\n */\n cancelEdit?(): void;\n }\n\n export type SubmitEditFunction<ItemType, ValueType = unknown> = (\n item: ItemType,\n column: ColumnDefinition<ItemType>,\n newValue: ValueType\n ) => Promise<void> | void;\n\n export interface ColumnDisplayProperties {\n id: string;\n visible: boolean;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["table/interfaces.tsx"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler, CancelableEventHandler } from '../internal/events';\nimport { Optional } from '../internal/types';\nimport ColumnDisplayProperties = TableProps.ColumnDisplayProperties;\n\n/*\n * HACK: Cast the component to a named parametrized interface.\n *\n * This lets us use React.forwardRef and still let the component have type\n * parameters, and the naming convention lets the documenter know that this is\n * a forwardRef-wrapped component.\n *\n * We don't need to expose this type to customers because it's just a simple\n * function type.\n */\nexport interface TableForwardRefType {\n <T>(props: TableProps<T> & { ref?: React.Ref<TableProps.Ref> }): JSX.Element;\n}\n\nexport interface TableProps<T = any> extends BaseComponentProps {\n /**\n * Heading element of the table container. Use the [header component](/components/header/).\n */\n header?: React.ReactNode;\n\n /**\n * Footer of the table container.\n */\n footer?: React.ReactNode;\n\n /**\n * Displayed when the `items` property is an empty array. Use it to render an empty or no-match state.\n */\n empty?: React.ReactNode;\n\n /**\n * Specifies the data that's displayed in the table rows. Each item contains the data for one row. The display of a row is handled\n * by the `cell` property of each column definition in the `columnDefinitions` property.\n */\n items: ReadonlyArray<T>;\n\n /**\n * Renders the table in a loading state. We recommend that you also set a `loadingText`.\n */\n loading?: boolean;\n\n /**\n * Specifies the text that's displayed when the table is in a loading state.\n */\n loadingText?: string;\n\n /**\n * Specifies a property that uniquely identifies an individual item.\n * When it's set, it's used to provide [keys for React](https://reactjs.org/docs/lists-and-keys.html#keys)\n * for performance optimizations.\n *\n * It's also used to connect `items` and `selectedItems` values when they reference different objects.\n */\n trackBy?: TableProps.TrackBy<T>;\n\n /**\n * The columns configuration object\n * * `id` (string) - Specifies a unique column identifier. The property is used 1) as a [keys](https://reactjs.org/docs/lists-and-keys.html#keys) source for React rendering,\n * and 2) to match entries in the `columnDisplay` property, if defined.\n * * `header` (ReactNode) - Determines the display of the column header.\n * * `cell` ((item) => ReactNode) - Determines the display of a cell's content. You receive the current table row\n * item as an argument.\n * * `width` (string | number) - Specifies the column width. Corresponds to the `width` css-property. If the width is not set,\n * the browser automatically adjusts the column width based on the content. When `resizableColumns` property is\n * set to `true`, additional constraints apply: 1) string values are not allowed, and 2) the last visible column always\n * fills the remaining space of the table so the specified width is ignored.\n * * `minWidth` (string | number) - Specifies the minimum column width. Corresponds to the `min-width` css-property. When\n * `resizableColumns` property is set to `true`, additional constraints apply: 1) string values are not allowed,\n * and 2) the column can't resize below than the specified width (defaults to \"120px\"). We recommend that you set a minimum width\n * of at least 176px for columns that are editable.\n * * `maxWidth` (string | number) - Specifies the maximum column width. Corresponds to the `max-width` css-property.\n * Note that when the `resizableColumns` property is set to `true` this property is ignored.\n * * `ariaLabel` (LabelData => string) - An optional function that's called to provide an `aria-label` for the cell header.\n * It receives the current sorting state of this column, the direction it's sorted in, and an indication of\n * whether the sorting is disabled, as three Boolean values: `sorted`, `descending` and `disabled`.\n * We recommend that you use this for sortable columns to provide more meaningful labels based on the\n * current sorting direction.\n * * `sortingField` (string) - Enables default column sorting. The value is used in [collection hooks](/get-started/dev-guides/collection-hooks/)\n * to reorder the items. Provide the name of the property within each item that should be used for sorting by this column.\n * For more complex sorting use `sortingComparator` instead.\n * * `sortingComparator` ((T, T) => number) - Enables custom column sorting. The value is used in [collection hooks](/get-started/dev-guides/collection-hooks/)\n * to reorder the items. This property accepts a custom comparator that is used to compare two items.\n * The comparator must implement ascending ordering, and the output is inverted automatically in case of descending order.\n * If present, the `sortingField` property is ignored.\n * * `editConfig` (EditConfig) - Enables inline editing in column when present. The value is used to configure the editing behavior.\n * * * `editConfig.ariaLabel` (string) - Specifies a label for the edit control. Visually hidden but read by screen readers.\n * * * `editConfig.errorIconAriaLabel` (string) - Specifies an ariaLabel for the error icon that is displayed when the validation fails.\n * * * `editConfig.editIconAriaLabel` (string) - Specifies an alternate text for the edit icon used in column header.\n * * * `editConfig.constraintText` (string) - Constraint text that is displayed below the edit control.\n * * * `editConfig.validation` ((item, value) => string) - A function that allows you to validate the value of the edit control.\n * Return a string from the function to display an error message. Return `undefined` (or no return) from the function to indicate that the value is valid.\n * * * `editConfig.editingCell` ((item, cellContext) => ReactNode) - Determines the display of a cell's content when inline editing is active on a cell;\n * You receive the current table row `item` and a `cellContext` object as arguments.\n * The `cellContext` object contains the following properties:\n * * * `cellContext.currentValue` - State to keep track of a value in input fields while editing.\n * * * `cellContext.setValue` - Function to update `currentValue`. This should be called when the value in input field changes.\n * * `isRowHeader` (boolean) - Specifies that cells in this column should be used as row headers.\n */\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<T>>;\n /**\n * Specifies the selection type (`'single' | 'multi'`).\n */\n selectionType?: TableProps.SelectionType;\n /**\n * List of selected items.\n */\n selectedItems?: ReadonlyArray<T>;\n\n /**\n * Use this slot to add filtering controls to the table.\n */\n filter?: React.ReactNode;\n\n /**\n * Use this slot to add the [pagination component](/components/pagination/) to the table.\n */\n pagination?: React.ReactNode;\n\n /**\n * Use this slot to add [collection preferences](/components/collection-preferences/) to the table.\n */\n preferences?: React.ReactNode;\n\n /**\n * Determines whether a given item is disabled. If an item is disabled, the user can't select it.\n */\n isItemDisabled?: TableProps.IsItemDisabled<T>;\n\n /**\n * Specifies if text wraps within table cells. If set to `true`, long text within cells may wrap onto\n * multiple lines instead of being truncated with an ellipsis.\n */\n wrapLines?: boolean;\n\n /**\n * Specifies if table rows alternate being shaded and unshaded. If set to `true`, every other row will be shaded.\n */\n stripedRows?: boolean;\n\n /**\n * Toggles the content density of the table. Defaults to `'comfortable'`.\n */\n contentDensity?: 'comfortable' | 'compact';\n\n /**\n * Specifies if columns can be resized. If set to `true`, users can resize the columns in the table.\n */\n resizableColumns?: boolean;\n\n /**\n * Specifies alternative text for the selection components (checkboxes and radio buttons) as follows:\n * * `itemSelectionLabel` ((SelectionState, Item) => string) - Specifies the alternative text for an item.\n * * `allItemsSelectionLabel` ((SelectionState) => string) - Specifies the alternative text for multi-selection column header.\n * * `selectionGroupLabel` (string) - Specifies the alternative text for the whole selection and single-selection column header.\n * It is prefixed to `itemSelectionLabel` and `allItemsSelectionLabel` when they are set.\n * You can use the first argument of type `SelectionState` to access the current selection\n * state of the component (for example, the `selectedItems` list). The `itemSelectionLabel` for individual\n * items also receives the corresponding `Item` object. You can use the `selectionGroupLabel` to\n * add a meaningful description to the whole selection.\n * * `tableLabel` (string) - Provides an alternative text for the table. If you use a header for this table, you may reuse the string\n * to provide a caption-like description. For example, tableLabel=Instances will be announced as 'Instances table'.\n * * `resizerRoleDescription` (string) - Provides role description for table column resizer buttons.\n * * `activateEditLabel` (EditableColumnDefinition, Item) => string -\n * Specifies an alternative text for the edit button in editable cells.\n * * `cancelEditLabel` (EditableColumnDefinition) => string -\n * Specifies an alternative text for the cancel button in editable cells.\n * * `submitEditLabel` (EditableColumnDefinition) => string -\n * Specifies an alternative text for the submit button in editable cells.\n * * `successfulEditLabel` (EditableColumnDefinition) => string -\n * Specifies an alternative text for the success icon in editable cells. This text is also announced to screen readers.\n * * `submittingEditText` (EditableColumnDefinition) => string -\n * Specifies a text that is announced to screen readers when a cell edit operation is submitted.\n * @i18n\n */\n ariaLabels?: TableProps.AriaLabels<T>;\n\n /**\n * Specifies the definition object of the currently sorted column. Make sure you pass an object that's\n * present in the `columnDefinitions` array.\n */\n sortingColumn?: TableProps.SortingColumn<T>;\n /**\n * Specifies whether to use a descending sort order.\n */\n sortingDescending?: boolean;\n /**\n * Specifies if sorting buttons are disabled. For example, use this property\n * to prevent the user from sorting before items are fully loaded.\n */\n sortingDisabled?: boolean;\n\n /**\n * Specifies the number of first and/or last columns that should be sticky.\n *\n * If the available scrollable space is less than a certain threshold, the feature is deactivated.\n *\n * Use it in conjunction with the sticky columns preference of the\n * [collection preferences](/components/collection-preferences/) component.\n *\n */\n stickyColumns?: TableProps.StickyColumns;\n\n /**\n * Specifies an array that represents the table columns in the order in which they will be displayed, together with their visibility.\n *\n * If not set, all columns are displayed and the order is dictated by the `columnDefinitions` property.\n *\n * Use it in conjunction with the content display preference of the [collection preferences](/components/collection-preferences/) component.\n */\n columnDisplay?: ReadonlyArray<ColumnDisplayProperties>;\n\n /**\n * Specifies an array containing the `id`s of visible columns. If not set, all columns are displayed.\n *\n * Use it in conjunction with the visible content preference of the [collection preferences](/components/collection-preferences/) component.\n *\n * The order of ids doesn't influence the order in which columns are displayed - this is dictated by the `columnDefinitions` property.\n * */\n visibleColumns?: ReadonlyArray<string>;\n\n /**\n * Fired when the user resizes a table column. The event detail contains an array of column widths in pixels,\n * including the hidden via preferences columns. Use this event to persist the column widths.\n */\n onColumnWidthsChange?: NonCancelableEventHandler<TableProps.ColumnWidthsChangeDetail>;\n\n /**\n * Called when either the column to sort by or the direction of sorting changes upon user interaction.\n * The event detail contains the current sortingColumn and isDescending.\n */\n onSortingChange?: NonCancelableEventHandler<TableProps.SortingState<T>>;\n\n /**\n * Fired when a user interaction triggers a change in the list of selected items.\n * The event `detail` contains the current list of `selectedItems`.\n */\n onSelectionChange?: NonCancelableEventHandler<TableProps.SelectionChangeDetail<T>>;\n\n /**\n * Note: This feature is provided for backwards compatibility. Its use is not recommended,\n * and it may be deprecated in the future.\n *\n * Called when the user clicked at a table row. The event detail contains the index of the\n * clicked row and the row object itself. Use this event to define a row click behavior.\n */\n onRowClick?: NonCancelableEventHandler<TableProps.OnRowClickDetail<T>>;\n\n /**\n * Note: This feature is provided for backwards compatibility. Its use is not recommended,\n * and it may be deprecated in the future.\n *\n * Called when the user clicked at a table row with the right mouse click. The event detail\n * contains the index of the clicked row and the row object itself. Use this event to override\n * the default browser context menu behavior.\n */\n onRowContextMenu?: CancelableEventHandler<TableProps.OnRowContextMenuDetail<T>>;\n\n /**\n * If set to `true`, the table header remains visible when the user scrolls down.\n */\n stickyHeader?: boolean;\n\n /**\n * Specifies a vertical offset (in pixels) for the sticky header. For example, use this if you\n * need to position the sticky header below other fixed position elements on the page.\n */\n stickyHeaderVerticalOffset?: number;\n\n /**\n * Specify a table variant with one of the following:\n * * `container` - Use this variant to have the table displayed within a container.\n * * `borderless` - Use this variant when the table should have no outer borders or shadow\n * (such as in a dashboard item container).\n * * `embedded` - Use this variant within a parent container (such as a modal, expandable\n * section, container or split panel).\n * **Deprecated**, replaced by `borderless` and `container`.\n * * `stacked` - Use this variant adjacent to other stacked containers (such as a container,\n * table).\n * * `full-page` – Use this variant when the table is the entire content of a page. Full page variants\n * implement the high contrast header and content behavior automatically.\n * @visualrefresh `embedded`, `stacked`, and `full-page` variants\n */\n variant?: TableProps.Variant;\n\n /**\n * Use this property to inform screen readers how many items there are in a table.\n * It specifies the total count of all items in a table.\n * If there is an unknown total of items in a table, leave this property undefined. */\n totalItemsCount?: number;\n /**\n * Use this property to inform screen readers which range of items is currently displayed in the table.\n * It specifies the index (1-based) of the first item in the table.\n * If the table has no pagination, leave this property undefined. */\n firstIndex?: number;\n /**\n * Use this function to announce page changes to screen reader users.\n * Requires the properties firstIndex and totalItemsCount to be set correctly.\n */\n renderAriaLive?: (data: TableProps.LiveAnnouncement) => string;\n /**\n * Specifies a function that will be called after user submits an inline edit.\n * Return a promise to keep loading state while the submit request is in progress.\n */\n submitEdit?: TableProps.SubmitEditFunction<T>;\n\n /**\n * Called whenever user cancels an inline edit. Use this function to reset any\n * validation states, or show warning for unsaved changes.\n */\n onEditCancel?: CancelableEventHandler;\n}\n\nexport namespace TableProps {\n export type TrackBy<T> = string | ((item: T) => string);\n\n export interface CellContext<V> {\n currentValue: Optional<V>;\n setValue: (value: V | undefined) => void;\n }\n\n export interface EditConfig<T, V = any> {\n /**\n * Specifies a label for the edit control. Visually hidden but read\n * by screen readers.\n */\n ariaLabel?: string;\n /**\n * Specifies an ariaLabel for the error icon that is displayed when\n * the validation fails.\n */\n errorIconAriaLabel?: string;\n /**\n * Specifies an alternate text for the edit icon used in column header.\n */\n editIconAriaLabel?: string;\n /**\n * Constraint text that is displayed below the edit control.\n */\n constraintText?: string;\n /**\n * A function that allows you to validate the value of the edit control. Return\n * a string from the function to display an error message. Return\n * `undefined` (or no return) from the function to indicate that the value is valid.\n * @param item - The item that is being edited.\n * @param value - The current value of the edit control.\n */\n validation?: (item: T, value: Optional<V>) => Optional<string>;\n\n /**\n * Determines the display of a cell's content when inline edit is active.\n */\n editingCell(item: T, ctx: TableProps.CellContext<any>): React.ReactNode;\n }\n\n export type ColumnDefinition<ItemType> = {\n id?: string;\n header: React.ReactNode;\n ariaLabel?(data: LabelData): string;\n width?: number | string;\n minWidth?: number | string;\n maxWidth?: number | string;\n editConfig?: EditConfig<ItemType>;\n isRowHeader?: boolean;\n cell(item: ItemType): React.ReactNode;\n } & SortingColumn<ItemType>;\n\n export interface StickyColumns {\n first?: number;\n last?: number;\n }\n\n export type SelectionType = 'single' | 'multi';\n export type Variant = 'container' | 'embedded' | 'borderless' | 'stacked' | 'full-page';\n export interface SelectionState<T> {\n selectedItems: ReadonlyArray<T>;\n }\n export interface SelectionChangeDetail<T> {\n selectedItems: T[];\n }\n export type IsItemDisabled<T> = (item: T) => boolean;\n export interface AriaLabels<T> {\n allItemsSelectionLabel?: (data: TableProps.SelectionState<T>) => string;\n itemSelectionLabel?: (data: TableProps.SelectionState<T>, row: T) => string;\n selectionGroupLabel?: string;\n tableLabel?: string;\n resizerRoleDescription?: string;\n // do not use <T> to prevent overly strict validation on consumer end\n // it works, practically, we are only interested in `id` and `header` properties only\n activateEditLabel?: (column: ColumnDefinition<any>, item: T) => string;\n cancelEditLabel?: (column: ColumnDefinition<any>) => string;\n submitEditLabel?: (column: ColumnDefinition<any>) => string;\n submittingEditText?: (column: ColumnDefinition<any>) => string;\n successfulEditLabel?: (column: ColumnDefinition<any>) => string;\n }\n export interface SortingState<T> {\n isDescending?: boolean;\n sortingColumn: SortingColumn<T>;\n }\n export interface SortingColumn<T> {\n sortingField?: string;\n sortingComparator?: (a: T, b: T) => number;\n }\n export interface LabelData {\n sorted: boolean;\n descending: boolean;\n disabled: boolean;\n }\n export interface OnRowClickDetail<T> {\n rowIndex: number;\n item: T;\n }\n export interface OnRowContextMenuDetail<T> {\n rowIndex: number;\n item: T;\n clientX: number;\n clientY: number;\n }\n\n export interface ColumnWidthsChangeDetail {\n widths: ReadonlyArray<number>;\n }\n\n export interface LiveAnnouncement {\n totalItemsCount?: number;\n firstIndex: number;\n lastIndex: number;\n }\n\n export interface Ref {\n /**\n * When the sticky header is enabled and you call this function, the table\n * scroll parent scrolls to reveal the first row of the table.\n */\n scrollToTop(): void;\n\n /**\n * Dismiss an inline edit if currently active.\n */\n cancelEdit?(): void;\n }\n\n export type SubmitEditFunction<ItemType, ValueType = unknown> = (\n item: ItemType,\n column: ColumnDefinition<ItemType>,\n newValue: ValueType\n ) => Promise<void> | void;\n\n export interface ColumnDisplayProperties {\n id: string;\n visible: boolean;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["table/internal.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAc,MAAM,cAAc,CAAC;AA+C/D,eAAO,MAAM,sBAAsB,qBAWX,CAAC;AAEzB,QAAA,MAAM,aAAa,qBA+aK,CAAC;AAEzB,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["table/internal.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAc,MAAM,cAAc,CAAC;AA+C/D,eAAO,MAAM,sBAAsB,qBAWX,CAAC;AAEzB,QAAA,MAAM,aAAa,qBAgbK,CAAC;AAEzB,eAAe,aAAa,CAAC"}
package/table/internal.js CHANGED
@@ -148,6 +148,7 @@ const InternalTable = React.forwardRef((_a, ref) => {
148
148
  }
149
149
  },
150
150
  singleSelectionHeaderAriaLabel: ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.selectionGroupLabel,
151
+ resizerRoleDescription: ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.resizerRoleDescription,
151
152
  stripedRows,
152
153
  stickyState,
153
154
  selectionColumnId,
@@ -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,OA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,SAAS,CAAC,EAAE,QAAQ,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,k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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 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"]}
@@ -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":";AAUA,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;CACzB;AAMD,wBAAgB,OAAO,CAAC,EACtB,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,QAA+B,EAC/B,QAAQ,EACR,aAAa,EACb,OAAO,GACR,EAAE,YAAY,eA2Jd;AAED,wBAAgB,aAAa,gBAE5B"}
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"}
@@ -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 resizerRef = useRef(null);
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(resizerRef.current));
27
+ setHeaderCellWidth(getHeaderWidth(resizerToggleRef.current));
24
28
  }, []);
25
29
  useEffect(() => {
26
- const elements = getResizerElements(resizerRef.current);
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
- if (event.keyCode === KeyCode.left) {
80
- event.preventDefault();
81
- updateColumnWidth(elements.header.getBoundingClientRect().width - 10);
82
- setTimeout(() => onWidthUpdateCommit(), 0);
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
- if (event.keyCode === KeyCode.right) {
102
+ // Enter keyboard dragging mode
103
+ else if (event.keyCode === KeyCode.enter || event.keyCode === KeyCode.space) {
85
104
  event.preventDefault();
86
- updateColumnWidth(elements.header.getBoundingClientRect().width + 10);
87
- setTimeout(() => onWidthUpdateCommit(), 0);
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, resizerHasFocus, minWidth, onWidthUpdate, onWidthUpdateCommit]);
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("span", Object.assign({ ref: resizerRef, className: clsx(styles.resizer, isDragging && styles['resizer-active'], (resizerHasFocus || showFocusRing) && styles['has-focus']), onMouseDown: event => {
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
- // Prevents dragging mode activation for VO+Space click.
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(resizerRef.current));
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
- } }, resizerAriaProps, { tabIndex: tabIndex, "data-focus-id": focusId }))));
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.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,M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U,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,aAAa,CAAC,CAAC;IACjD,mBAAmB,GAAG,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;IAE7D,MAAM,WAAW,GAAG,WAAW,EAAE,CAAC;IAClC,MAAM,gBAAgB,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IACzD,MAAM,mBAAmB,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K,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-active_x7peu_1usw0_93",
5
- "resize-active-with-focus": "awsui_resize-active-with-focus_x7peu_1usw0_93",
6
- "resizer": "awsui_resizer_x7peu_1usw0_98",
7
- "resizer-active": "awsui_resizer-active_x7peu_1usw0_114",
8
- "has-focus": "awsui_has-focus_x7peu_1usw0_126",
9
- "tracker": "awsui_tracker_x7peu_1usw0_149"
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-active_x7peu_1usw0_93:not(#\9):not(.awsui_resize-active-with-focus_x7peu_1usw0_93) * {
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
- .awsui_resizer_x7peu_1usw0_98:not(#\9) {
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-active_x7peu_1usw0_93 .awsui_resizer_x7peu_1usw0_98:not(#\9) {
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 > .awsui_resizer_x7peu_1usw0_98 {
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) > .awsui_resizer_x7peu_1usw0_98:hover::before, th:not(#\9):not(:last-child) > .awsui_resizer-active_x7peu_1usw0_114::before {
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] .awsui_resizer_x7peu_1usw0_98.awsui_has-focus_x7peu_1usw0_126:not(#\9) {
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] .awsui_resizer_x7peu_1usw0_98.awsui_has-focus_x7peu_1usw0_126:not(#\9) {
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] .awsui_resizer_x7peu_1usw0_98.awsui_has-focus_x7peu_1usw0_126:not(#\9)::before {
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] .awsui_resizer_x7peu_1usw0_98.awsui_has-focus_x7peu_1usw0_126:not(#\9)::before {
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
- .awsui_tracker_x7peu_1usw0_149:not(#\9) {
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-active_x7peu_1usw0_93 .awsui_tracker_x7peu_1usw0_149:not(#\9) {
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-active_x7peu_1usw0_93",
6
- "resize-active-with-focus": "awsui_resize-active-with-focus_x7peu_1usw0_93",
7
- "resizer": "awsui_resizer_x7peu_1usw0_98",
8
- "resizer-active": "awsui_resizer-active_x7peu_1usw0_114",
9
- "has-focus": "awsui_has-focus_x7peu_1usw0_126",
10
- "tracker": "awsui_tracker_x7peu_1usw0_149"
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
@@ -22,6 +22,7 @@ export interface TheadProps {
22
22
  hidden?: boolean;
23
23
  stuck?: boolean;
24
24
  singleSelectionHeaderAriaLabel?: string;
25
+ resizerRoleDescription?: string;
25
26
  stripedRows?: boolean;
26
27
  stickyState: StickyColumnsModel;
27
28
  selectionColumnId: PropertyKey;
@@ -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,iBAAiB,EAAE,aAAa,CAAC,UAAU,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;IACnE,aAAa,EAAE,UAAU,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IACzD,iBAAiB,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;IAC5B,SAAS,EAAE,OAAO,G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AE,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;
@@ -1 +1 @@
1
- {"version":3,"file":"thead.js","sourceRoot":"lib/default/","sources":["table/thead.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAkB,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAA6B,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,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AAE,MAAM,EACd,mBAAmB,EAAE,aAAa,EAClC,iBAAiB,EAAE,iBAAiB,EACpC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EACjD,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,YAAY,CAAC,EAClD,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC,sBAAsB,CAAC,eAAe,EAAE,MAAM,CAAC,EAClE,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,EAC/B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,EACxC,SAAS,EAAE,SAAS,GACpB,CACH,CAAC;YACJ,CAAC,CAAC,CACC,CACC,CACT,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,KAAK,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 from 'react';\nimport { TableProps } from './interfaces';\nimport { SelectionControl, focusMarkers, SelectionProps } from './selection';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport { getColumnKey } from './utils';\nimport { TableHeaderCell } from './header-cell';\nimport { useColumnWidths } from './use-column-widths';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport styles from './styles.css.js';\nimport headerCellStyles from './header-cell/styles.css.js';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { StickyColumnsModel } from './sticky-columns';\nimport { getTableHeaderRowRoleProps, TableRole } from './table-role';\nimport { TableThElement } from './header-cell/th-element';\nimport { findUpUntil } from '@cloudscape-design/component-toolkit/dom';\n\nexport interface TheadProps {\n containerWidth: null | number;\n selectionType: TableProps.SelectionType | undefined;\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<any>>;\n sortingColumn: TableProps.SortingColumn<any> | undefined;\n sortingDescending: boolean | undefined;\n sortingDisabled: boolean | undefined;\n variant: TableProps.Variant;\n wrapLines: boolean | undefined;\n resizableColumns: boolean | undefined;\n getSelectAllProps: () => SelectionProps;\n onFocusMove: ((sourceElement: HTMLElement, fromIndex: number, direction: -1 | 1) => void) | undefined;\n onResizeFinish: (newWidths: Record<string, number>) => void;\n onSortingChange: NonCancelableEventHandler<TableProps.SortingState<any>> | undefined;\n sticky?: boolean;\n hidden?: boolean;\n stuck?: boolean;\n singleSelectionHeaderAriaLabel?: string;\n stripedRows?: boolean;\n stickyState: StickyColumnsModel;\n selectionColumnId: PropertyKey;\n focusedComponent?: null | string;\n onFocusedComponentChange?: (focusId: null | string) => void;\n tableRole: TableRole;\n}\n\nconst Thead = React.forwardRef(\n (\n {\n containerWidth,\n selectionType,\n getSelectAllProps,\n columnDefinitions,\n sortingColumn,\n sortingDisabled,\n sortingDescending,\n resizableColumns,\n variant,\n wrapLines,\n onFocusMove,\n onSortingChange,\n onResizeFinish,\n singleSelectionHeaderAriaLabel,\n stripedRows,\n sticky = false,\n hidden = false,\n stuck = false,\n stickyState,\n selectionColumnId,\n focusedComponent,\n onFocusedComponentChange,\n tableRole,\n }: TheadProps,\n outerRef: React.Ref<HTMLTableRowElement>\n ) => {\n const isVisualRefresh = useVisualRefresh();\n\n const headerCellClass = clsx(\n headerCellStyles['header-cell'],\n headerCellStyles[`header-cell-variant-${variant}`],\n sticky && headerCellStyles['header-cell-sticky'],\n stuck && headerCellStyles['header-cell-stuck'],\n stripedRows && headerCellStyles['has-striped-rows'],\n isVisualRefresh && headerCellStyles['is-visual-refresh']\n );\n\n const selectionCellClass = clsx(\n styles['selection-control'],\n styles['selection-control-header'],\n isVisualRefresh && styles['is-visual-refresh']\n );\n\n const { columnWidths, totalWidth, updateColumn, setCell } = useColumnWidths();\n\n return (\n <thead className={clsx(!hidden && styles['thead-active'])}>\n <tr\n {...focusMarkers.all}\n ref={outerRef}\n aria-rowindex={1}\n {...getTableHeaderRowRoleProps({ tableRole })}\n onFocus={event => {\n const focusControlElement = findUpUntil(event.target, element => !!element.getAttribute('data-focus-id'));\n const focusId = focusControlElement?.getAttribute('data-focus-id') ?? null;\n onFocusedComponentChange?.(focusId);\n }}\n onBlur={() => onFocusedComponentChange?.(null)}\n >\n {selectionType ? (\n <TableThElement\n className={clsx(headerCellClass, selectionCellClass, hidden && headerCellStyles['header-cell-hidden'])}\n hidden={hidden}\n tableRole={tableRole}\n colIndex={0}\n columnId={selectionColumnId}\n stickyState={stickyState}\n >\n {selectionType === 'multi' ? (\n <SelectionControl\n onFocusDown={event => {\n onFocusMove!(event.target as HTMLElement, -1, +1);\n }}\n focusedComponent={focusedComponent}\n {...getSelectAllProps()}\n {...(sticky ? { tabIndex: -1 } : {})}\n />\n ) : (\n <ScreenreaderOnly>{singleSelectionHeaderAriaLabel}</ScreenreaderOnly>\n )}\n </TableThElement>\n ) : null}\n\n {columnDefinitions.map((column, colIndex) => {\n const columnId = getColumnKey(column, colIndex);\n\n let widthOverride;\n if (resizableColumns) {\n if (columnWidths) {\n // use stateful value if available\n widthOverride = columnWidths[columnId];\n }\n if (colIndex === columnDefinitions.length - 1 && containerWidth && containerWidth > totalWidth) {\n // let the last column grow and fill the container width\n widthOverride = 'auto';\n }\n }\n return (\n <TableHeaderCell\n key={columnId}\n className={headerCellClass}\n style={{\n width: widthOverride || column.width,\n minWidth: sticky ? undefined : column.minWidth,\n maxWidth: resizableColumns || sticky ? undefined : column.maxWidth,\n }}\n tabIndex={sticky ? -1 : 0}\n focusedComponent={focusedComponent}\n column={column}\n activeSortingColumn={sortingColumn}\n sortingDescending={sortingDescending}\n sortingDisabled={sortingDisabled}\n wrapLines={wrapLines}\n hidden={hidden}\n colIndex={selectionType ? colIndex + 1 : colIndex}\n columnId={columnId}\n updateColumn={updateColumn}\n onResizeFinish={() => onResizeFinish(columnWidths)}\n resizableColumns={resizableColumns}\n onClick={detail => fireNonCancelableEvent(onSortingChange, detail)}\n isEditable={!!column.editConfig}\n stickyState={stickyState}\n cellRef={node => setCell(columnId, node)}\n tableRole={tableRole}\n />\n );\n })}\n </tr>\n </thead>\n );\n }\n);\n\nexport default Thead;\n"]}
1
+ {"version":3,"file":"thead.js","sourceRoot":"lib/default/","sources":["table/thead.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAkB,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAA6B,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAC3D,OAAO,gBAAgB,MAAM,0CAA0C,CAAC;AAExE,OAAO,EAAE,0BAA0B,EAAa,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AA6BvE,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAC5B,CACE,EACE,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,WAAW,EACX,e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W,EACxB,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,EACxC,SAAS,EAAE,SAAS,EACpB,sBAAsB,EAAE,sBAAsB,GAC9C,CACH,CAAC;YACJ,CAAC,CAAC,CACC,CACC,CACT,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,KAAK,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 from 'react';\nimport { TableProps } from './interfaces';\nimport { SelectionControl, focusMarkers, SelectionProps } from './selection';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport { getColumnKey } from './utils';\nimport { TableHeaderCell } from './header-cell';\nimport { useColumnWidths } from './use-column-widths';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport styles from './styles.css.js';\nimport headerCellStyles from './header-cell/styles.css.js';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { StickyColumnsModel } from './sticky-columns';\nimport { getTableHeaderRowRoleProps, TableRole } from './table-role';\nimport { TableThElement } from './header-cell/th-element';\nimport { findUpUntil } from '@cloudscape-design/component-toolkit/dom';\n\nexport interface TheadProps {\n containerWidth: null | number;\n selectionType: TableProps.SelectionType | undefined;\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<any>>;\n sortingColumn: TableProps.SortingColumn<any> | undefined;\n sortingDescending: boolean | undefined;\n sortingDisabled: boolean | undefined;\n variant: TableProps.Variant;\n wrapLines: boolean | undefined;\n resizableColumns: boolean | undefined;\n getSelectAllProps: () => SelectionProps;\n onFocusMove: ((sourceElement: HTMLElement, fromIndex: number, direction: -1 | 1) => void) | undefined;\n onResizeFinish: (newWidths: Record<string, number>) => void;\n onSortingChange: NonCancelableEventHandler<TableProps.SortingState<any>> | undefined;\n sticky?: boolean;\n hidden?: boolean;\n stuck?: boolean;\n singleSelectionHeaderAriaLabel?: string;\n resizerRoleDescription?: string;\n stripedRows?: boolean;\n stickyState: StickyColumnsModel;\n selectionColumnId: PropertyKey;\n focusedComponent?: null | string;\n onFocusedComponentChange?: (focusId: null | string) => void;\n tableRole: TableRole;\n}\n\nconst Thead = React.forwardRef(\n (\n {\n containerWidth,\n selectionType,\n getSelectAllProps,\n columnDefinitions,\n sortingColumn,\n sortingDisabled,\n sortingDescending,\n resizableColumns,\n variant,\n wrapLines,\n onFocusMove,\n onSortingChange,\n onResizeFinish,\n singleSelectionHeaderAriaLabel,\n stripedRows,\n sticky = false,\n hidden = false,\n stuck = false,\n stickyState,\n selectionColumnId,\n focusedComponent,\n onFocusedComponentChange,\n tableRole,\n resizerRoleDescription,\n }: TheadProps,\n outerRef: React.Ref<HTMLTableRowElement>\n ) => {\n const isVisualRefresh = useVisualRefresh();\n\n const headerCellClass = clsx(\n headerCellStyles['header-cell'],\n headerCellStyles[`header-cell-variant-${variant}`],\n sticky && headerCellStyles['header-cell-sticky'],\n stuck && headerCellStyles['header-cell-stuck'],\n stripedRows && headerCellStyles['has-striped-rows'],\n isVisualRefresh && headerCellStyles['is-visual-refresh']\n );\n\n const selectionCellClass = clsx(\n styles['selection-control'],\n styles['selection-control-header'],\n isVisualRefresh && styles['is-visual-refresh']\n );\n\n const { columnWidths, totalWidth, updateColumn, setCell } = useColumnWidths();\n\n return (\n <thead className={clsx(!hidden && styles['thead-active'])}>\n <tr\n {...focusMarkers.all}\n ref={outerRef}\n aria-rowindex={1}\n {...getTableHeaderRowRoleProps({ tableRole })}\n onFocus={event => {\n const focusControlElement = findUpUntil(event.target, element => !!element.getAttribute('data-focus-id'));\n const focusId = focusControlElement?.getAttribute('data-focus-id') ?? null;\n onFocusedComponentChange?.(focusId);\n }}\n onBlur={() => onFocusedComponentChange?.(null)}\n >\n {selectionType ? (\n <TableThElement\n className={clsx(headerCellClass, selectionCellClass, hidden && headerCellStyles['header-cell-hidden'])}\n hidden={hidden}\n tableRole={tableRole}\n colIndex={0}\n columnId={selectionColumnId}\n stickyState={stickyState}\n >\n {selectionType === 'multi' ? (\n <SelectionControl\n onFocusDown={event => {\n onFocusMove!(event.target as HTMLElement, -1, +1);\n }}\n focusedComponent={focusedComponent}\n {...getSelectAllProps()}\n {...(sticky ? { tabIndex: -1 } : {})}\n />\n ) : (\n <ScreenreaderOnly>{singleSelectionHeaderAriaLabel}</ScreenreaderOnly>\n )}\n </TableThElement>\n ) : null}\n\n {columnDefinitions.map((column, colIndex) => {\n const columnId = getColumnKey(column, colIndex);\n\n let widthOverride;\n if (resizableColumns) {\n if (columnWidths) {\n // use stateful value if available\n widthOverride = columnWidths[columnId];\n }\n if (colIndex === columnDefinitions.length - 1 && containerWidth && containerWidth > totalWidth) {\n // let the last column grow and fill the container width\n widthOverride = 'auto';\n }\n }\n return (\n <TableHeaderCell\n key={columnId}\n className={headerCellClass}\n style={{\n width: widthOverride || column.width,\n minWidth: sticky ? undefined : column.minWidth,\n maxWidth: resizableColumns || sticky ? undefined : column.maxWidth,\n }}\n tabIndex={sticky ? -1 : 0}\n focusedComponent={focusedComponent}\n column={column}\n activeSortingColumn={sortingColumn}\n sortingDescending={sortingDescending}\n sortingDisabled={sortingDisabled}\n wrapLines={wrapLines}\n hidden={hidden}\n colIndex={selectionType ? colIndex + 1 : colIndex}\n columnId={columnId}\n updateColumn={updateColumn}\n onResizeFinish={() => onResizeFinish(columnWidths)}\n resizableColumns={resizableColumns}\n onClick={detail => fireNonCancelableEvent(onSortingChange, detail)}\n isEditable={!!column.editConfig}\n stickyState={stickyState}\n cellRef={node => setCell(columnId, node)}\n tableRole={tableRole}\n resizerRoleDescription={resizerRoleDescription}\n />\n );\n })}\n </tr>\n </thead>\n );\n }\n);\n\nexport default Thead;\n"]}