@cloudscape-design/components 3.0.161 → 3.0.163

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/app-layout/visual-refresh/styles.css.js +60 -60
  2. package/app-layout/visual-refresh/styles.scoped.css +147 -147
  3. package/app-layout/visual-refresh/styles.selectors.js +60 -60
  4. package/button/internal.d.ts +1 -0
  5. package/button/internal.d.ts.map +1 -1
  6. package/button/internal.js +2 -2
  7. package/button/internal.js.map +1 -1
  8. package/code-editor/index.d.ts.map +1 -1
  9. package/code-editor/index.js +5 -8
  10. package/code-editor/index.js.map +1 -1
  11. package/code-editor/pane.d.ts.map +1 -1
  12. package/code-editor/pane.js +4 -4
  13. package/code-editor/pane.js.map +1 -1
  14. package/code-editor/resizable-box/index.d.ts +9 -0
  15. package/code-editor/resizable-box/index.d.ts.map +1 -0
  16. package/code-editor/resizable-box/index.js +44 -0
  17. package/code-editor/resizable-box/index.js.map +1 -0
  18. package/code-editor/resizable-box/styles.css.js +8 -0
  19. package/code-editor/resizable-box/styles.scoped.css +50 -0
  20. package/code-editor/resizable-box/styles.selectors.js +9 -0
  21. package/code-editor/styles.css.js +32 -33
  22. package/code-editor/styles.scoped.css +109 -139
  23. package/code-editor/styles.selectors.js +32 -33
  24. package/flashbar/styles.css.js +33 -33
  25. package/flashbar/styles.scoped.css +115 -115
  26. package/flashbar/styles.selectors.js +33 -33
  27. package/form-field/interfaces.d.ts +10 -0
  28. package/form-field/interfaces.d.ts.map +1 -1
  29. package/form-field/interfaces.js.map +1 -1
  30. package/form-field/internal.d.ts +1 -1
  31. package/form-field/internal.d.ts.map +1 -1
  32. package/form-field/internal.js +5 -4
  33. package/form-field/internal.js.map +1 -1
  34. package/input/internal.d.ts.map +1 -1
  35. package/input/internal.js +16 -4
  36. package/input/internal.js.map +1 -1
  37. package/internal/components/live-region/index.d.ts +1 -1
  38. package/internal/components/live-region/index.d.ts.map +1 -1
  39. package/internal/components/live-region/index.js +29 -6
  40. package/internal/components/live-region/index.js.map +1 -1
  41. package/internal/context/form-field-context.d.ts +6 -2
  42. package/internal/context/form-field-context.d.ts.map +1 -1
  43. package/internal/context/form-field-context.js +7 -1
  44. package/internal/context/form-field-context.js.map +1 -1
  45. package/internal/environment.js +1 -1
  46. package/internal/hooks/use-telemetry/index.d.ts.map +1 -1
  47. package/internal/hooks/use-telemetry/index.js +4 -0
  48. package/internal/hooks/use-telemetry/index.js.map +1 -1
  49. package/internal/manifest.json +1 -1
  50. package/internal/metrics.d.ts +2 -2
  51. package/internal/metrics.d.ts.map +1 -1
  52. package/internal/metrics.js +20 -17
  53. package/internal/metrics.js.map +1 -1
  54. package/internal/types.d.ts +9 -0
  55. package/internal/types.d.ts.map +1 -1
  56. package/internal/types.js +0 -2
  57. package/internal/types.js.map +1 -1
  58. package/internal/vendor/d3-scale.js +8 -8
  59. package/mixed-line-bar-chart/styles.css.js +19 -19
  60. package/mixed-line-bar-chart/styles.scoped.css +26 -26
  61. package/mixed-line-bar-chart/styles.selectors.js +19 -19
  62. package/package.json +30 -34
  63. package/progress-bar/index.d.ts.map +1 -1
  64. package/progress-bar/index.js +14 -3
  65. package/progress-bar/index.js.map +1 -1
  66. package/select/parts/styles.css.js +9 -9
  67. package/select/parts/styles.scoped.css +27 -9
  68. package/select/parts/styles.selectors.js +9 -9
  69. package/side-navigation/internal.d.ts.map +1 -1
  70. package/side-navigation/internal.js +2 -2
  71. package/side-navigation/internal.js.map +1 -1
  72. package/table/body-cell/click-away.d.ts +9 -0
  73. package/table/body-cell/click-away.d.ts.map +1 -0
  74. package/table/body-cell/click-away.js +38 -0
  75. package/table/body-cell/click-away.js.map +1 -0
  76. package/table/body-cell/index.d.ts +10 -19
  77. package/table/body-cell/index.d.ts.map +1 -1
  78. package/table/body-cell/index.js +49 -9
  79. package/table/body-cell/index.js.map +1 -1
  80. package/table/body-cell/inline-editor.d.ts +12 -0
  81. package/table/body-cell/inline-editor.d.ts.map +1 -0
  82. package/table/body-cell/inline-editor.js +88 -0
  83. package/table/body-cell/inline-editor.js.map +1 -0
  84. package/table/body-cell/styles.css.js +18 -12
  85. package/table/body-cell/styles.scoped.css +229 -46
  86. package/table/body-cell/styles.selectors.js +18 -12
  87. package/table/body-cell/td-element.d.ts +21 -0
  88. package/table/body-cell/td-element.d.ts.map +1 -0
  89. package/table/body-cell/td-element.js +11 -0
  90. package/table/body-cell/td-element.js.map +1 -0
  91. package/table/body-cell/use-stable-scroll-position.d.ts +17 -0
  92. package/table/body-cell/use-stable-scroll-position.d.ts.map +1 -0
  93. package/table/body-cell/use-stable-scroll-position.js +48 -0
  94. package/table/body-cell/use-stable-scroll-position.js.map +1 -0
  95. package/table/header-cell/index.d.ts +8 -7
  96. package/table/header-cell/index.d.ts.map +1 -1
  97. package/table/header-cell/index.js +6 -2
  98. package/table/header-cell/index.js.map +1 -1
  99. package/table/header-cell/styles.css.js +19 -18
  100. package/table/header-cell/styles.scoped.css +40 -35
  101. package/table/header-cell/styles.selectors.js +19 -18
  102. package/table/interfaces.d.ts +73 -6
  103. package/table/interfaces.d.ts.map +1 -1
  104. package/table/interfaces.js.map +1 -1
  105. package/table/internal.d.ts.map +1 -1
  106. package/table/internal.js +68 -18
  107. package/table/internal.js.map +1 -1
  108. package/table/thead.d.ts.map +1 -1
  109. package/table/thead.js +1 -1
  110. package/table/thead.js.map +1 -1
  111. package/table/use-table-focus-navigation.d.ts +16 -0
  112. package/table/use-table-focus-navigation.d.ts.map +1 -0
  113. package/table/use-table-focus-navigation.js +131 -0
  114. package/table/use-table-focus-navigation.js.map +1 -0
  115. package/tabs/index.d.ts +1 -1
  116. package/tabs/index.d.ts.map +1 -1
  117. package/tabs/index.js +2 -2
  118. package/tabs/index.js.map +1 -1
  119. package/tabs/interfaces.d.ts +14 -0
  120. package/tabs/interfaces.d.ts.map +1 -1
  121. package/tabs/interfaces.js.map +1 -1
  122. package/tabs/tab-header-bar.d.ts +2 -1
  123. package/tabs/tab-header-bar.d.ts.map +1 -1
  124. package/tabs/tab-header-bar.js +3 -7
  125. package/tabs/tab-header-bar.js.map +1 -1
  126. package/test-utils/dom/table/index.d.ts +4 -0
  127. package/test-utils/dom/table/index.js +21 -5
  128. package/test-utils/dom/table/index.js.map +1 -1
  129. package/test-utils/selectors/table/index.d.ts +4 -0
  130. package/test-utils/selectors/table/index.js +21 -5
  131. package/test-utils/selectors/table/index.js.map +1 -1
  132. package/test-utils/tsconfig.tsbuildinfo +1 -1
  133. package/wizard/internal/analytics.js +3 -3
  134. package/wizard/internal/analytics.js.map +1 -1
  135. package/code-editor/resize-handler.d.ts +0 -3
  136. package/code-editor/resize-handler.d.ts.map +0 -1
  137. package/code-editor/resize-handler.js +0 -7
  138. package/code-editor/resize-handler.js.map +0 -1
  139. package/internal/components/dynamic-aria-live/index.d.ts +0 -28
  140. package/internal/components/dynamic-aria-live/index.d.ts.map +0 -1
  141. package/internal/components/dynamic-aria-live/index.js +0 -38
  142. package/internal/components/dynamic-aria-live/index.js.map +0 -1
  143. package/internal/components/live-region/aria-liva-tag.d.ts +0 -13
  144. package/internal/components/live-region/aria-liva-tag.d.ts.map +0 -1
  145. package/internal/components/live-region/aria-liva-tag.js +0 -18
  146. package/internal/components/live-region/aria-liva-tag.js.map +0 -1
  147. package/internal/components/live-region/utils.d.ts +0 -8
  148. package/internal/components/live-region/utils.d.ts.map +0 -1
  149. package/internal/components/live-region/utils.js +0 -24
  150. package/internal/components/live-region/utils.js.map +0 -1
@@ -12,7 +12,8 @@ import { Resizer } from '../resizer';
12
12
  import { useUniqueId } from '../../internal/hooks/use-unique-id';
13
13
  export function TableHeaderCell(_a) {
14
14
  var _b, _c, _d;
15
- var className = _a.className, style = _a.style, tabIndex = _a.tabIndex, column = _a.column, activeSortingColumn = _a.activeSortingColumn, sortingDescending = _a.sortingDescending, sortingDisabled = _a.sortingDisabled, wrapLines = _a.wrapLines, showFocusRing = _a.showFocusRing, hidden = _a.hidden, onClick = _a.onClick, colIndex = _a.colIndex, onFocus = _a.onFocus, onBlur = _a.onBlur, updateColumn = _a.updateColumn, resizableColumns = _a.resizableColumns, onResizeFinish = _a.onResizeFinish;
15
+ var _e;
16
+ var className = _a.className, style = _a.style, tabIndex = _a.tabIndex, column = _a.column, activeSortingColumn = _a.activeSortingColumn, sortingDescending = _a.sortingDescending, sortingDisabled = _a.sortingDisabled, wrapLines = _a.wrapLines, showFocusRing = _a.showFocusRing, hidden = _a.hidden, onClick = _a.onClick, colIndex = _a.colIndex, onFocus = _a.onFocus, onBlur = _a.onBlur, updateColumn = _a.updateColumn, resizableColumns = _a.resizableColumns, onResizeFinish = _a.onResizeFinish, isEditable = _a.isEditable;
16
17
  var focusVisible = useFocusVisible();
17
18
  var sortable = !!column.sortingComparator || !!column.sortingField;
18
19
  var sorted = !!activeSortingColumn && isSorted(column, activeSortingColumn);
@@ -54,7 +55,10 @@ export function TableHeaderCell(_a) {
54
55
  })
55
56
  : undefined }, (sortingDisabled || !sortingStatus
56
57
  ? (_d = {}, _d['aria-disabled'] = 'true', _d) : __assign(__assign({ onKeyPress: handleKeyPress, tabIndex: tabIndex, role: 'button' }, focusVisible), { onClick: handleClick, onFocus: onFocus, onBlur: onBlur }))),
57
- React.createElement("div", { className: clsx(styles['header-cell-text'], wrapLines && styles['header-cell-text-wrap']), id: headerId }, column.header),
58
+ React.createElement("div", { className: clsx(styles['header-cell-text'], wrapLines && styles['header-cell-text-wrap']), id: headerId },
59
+ column.header,
60
+ isEditable ? (React.createElement("span", { className: styles['edit-icon'], role: "img", "aria-label": (_e = column.editConfig) === null || _e === void 0 ? void 0 : _e.editIconAriaLabel },
61
+ React.createElement(InternalIcon, { name: "edit" }))) : null),
58
62
  sortingStatus && (React.createElement("span", { className: styles['sorting-icon'] },
59
63
  React.createElement(InternalIcon, { name: getSortingIconName(sortingStatus) })))),
60
64
  resizableColumns && (React.createElement(React.Fragment, null,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table/header-cell/index.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served.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport InternalIcon from '../../icon/internal';\nimport useFocusVisible from '../../internal/hooks/focus-visible';\nimport { KeyCode } from '../../internal/keycode';\nimport { TableProps } from '../interfaces';\nimport { getAriaSort, getSortingIconName, getSortingStatus, isSorted } from './utils';\nimport styles from './styles.css.js';\nimport { Resizer } from '../resizer';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\n\ninterface TableHeaderCellProps {\n className?: string;\n style?: React.CSSProperties;\n tabIndex: number;\n column: TableProps.ColumnDefinition<any>;\n activeSortingColumn: TableProps.SortingColumn<any> | undefined;\n sortingDescending: boolean | undefined;\n sortingDisabled: boolean | undefined;\n wrapLines: boolean | undefined;\n showFocusRing: boolean;\n hidden?: boolean;\n onClick(detail: TableProps.SortingState<any>): void;\n onResizeFinish: () => void;\n colIndex: number;\n updateColumn: (colIndex: number, newWidth: number) => void;\n onFocus?: () => void;\n onBlur?: () => void;\n resizableColumns?: boolean;\n}\n\nexport function TableHeaderCell({\n className,\n style,\n tabIndex,\n column,\n activeSortingColumn,\n sortingDescending,\n sortingDisabled,\n wrapLines,\n showFocusRing,\n hidden,\n onClick,\n colIndex,\n onFocus,\n onBlur,\n updateColumn,\n resizableColumns,\n onResizeFinish,\n}: TableHeaderCellProps) {\n const focusVisible = useFocusVisible();\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 <th\n className={clsx(className, {\n [styles['header-cell-resizable']]: !!resizableColumns,\n [styles['header-cell-sortable']]: sortingStatus,\n [styles['header-cell-sorted']]: sortingStatus === 'ascending' || sortingStatus === 'descending',\n [styles['header-cell-disabled']]: sortingDisabled,\n [styles['header-cell-ascending']]: sortingStatus === 'ascending',\n [styles['header-cell-descending']]: sortingStatus === 'descending',\n [styles['header-cell-hidden']]: hidden,\n })}\n aria-sort={sortingStatus && getAriaSort(sortingStatus)}\n style={style}\n scope=\"col\"\n >\n <div\n className={clsx(styles['header-cell-content'], {\n [styles['header-cell-fake-focus']]: showFocusRing && focusVisible['data-awsui-focus-visible'],\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 {...(sortingDisabled || !sortingStatus\n ? { ['aria-disabled']: 'true' }\n : {\n onKeyPress: handleKeyPress,\n tabIndex: tabIndex,\n role: 'button',\n ...focusVisible,\n onClick: handleClick,\n onFocus,\n onBlur,\n })}\n >\n <div className={clsx(styles['header-cell-text'], wrapLines && styles['header-cell-text-wrap'])} id={headerId}>\n {column.header}\n </div>\n {sortingStatus && (\n <span className={styles['sorting-icon']}>\n <InternalIcon name={getSortingIconName(sortingStatus)} />\n </span>\n )}\n </div>\n {resizableColumns && (\n <>\n <Resizer\n onDragMove={newWidth => updateColumn(colIndex, newWidth)}\n onFinish={onResizeFinish}\n ariaLabelledby={headerId}\n minWidth={typeof column.minWidth === 'string' ? parseInt(column.minWidth) : column.minWidth}\n />\n </>\n )}\n </th>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table/header-cell/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAA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AQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,GAC3F,CACD,CACJ,CACE,CACN,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 useFocusVisible from '../../internal/hooks/focus-visible';\nimport { KeyCode } from '../../internal/keycode';\nimport { TableProps } from '../interfaces';\nimport { getAriaSort, getSortingIconName, getSortingStatus, isSorted } from './utils';\nimport styles from './styles.css.js';\nimport { Resizer } from '../resizer';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\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 showFocusRing: boolean;\n hidden?: boolean;\n onClick(detail: TableProps.SortingState<any>): void;\n onResizeFinish: () => void;\n colIndex: number;\n updateColumn: (colIndex: number, newWidth: number) => void;\n onFocus?: () => void;\n onBlur?: () => void;\n resizableColumns?: boolean;\n isEditable?: boolean;\n}\n\nexport function TableHeaderCell<ItemType>({\n className,\n style,\n tabIndex,\n column,\n activeSortingColumn,\n sortingDescending,\n sortingDisabled,\n wrapLines,\n showFocusRing,\n hidden,\n onClick,\n colIndex,\n onFocus,\n onBlur,\n updateColumn,\n resizableColumns,\n onResizeFinish,\n isEditable,\n}: TableHeaderCellProps<ItemType>) {\n const focusVisible = useFocusVisible();\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 <th\n className={clsx(className, {\n [styles['header-cell-resizable']]: !!resizableColumns,\n [styles['header-cell-sortable']]: sortingStatus,\n [styles['header-cell-sorted']]: sortingStatus === 'ascending' || sortingStatus === 'descending',\n [styles['header-cell-disabled']]: sortingDisabled,\n [styles['header-cell-ascending']]: sortingStatus === 'ascending',\n [styles['header-cell-descending']]: sortingStatus === 'descending',\n [styles['header-cell-hidden']]: hidden,\n })}\n aria-sort={sortingStatus && getAriaSort(sortingStatus)}\n style={style}\n scope=\"col\"\n >\n <div\n className={clsx(styles['header-cell-content'], {\n [styles['header-cell-fake-focus']]: showFocusRing && focusVisible['data-awsui-focus-visible'],\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 {...(sortingDisabled || !sortingStatus\n ? { ['aria-disabled']: 'true' }\n : {\n onKeyPress: handleKeyPress,\n tabIndex: tabIndex,\n role: 'button',\n ...focusVisible,\n onClick: handleClick,\n onFocus,\n onBlur,\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 className={styles['edit-icon']} role=\"img\" aria-label={column.editConfig?.editIconAriaLabel}>\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 <>\n <Resizer\n onDragMove={newWidth => updateColumn(colIndex, newWidth)}\n onFinish={onResizeFinish}\n ariaLabelledby={headerId}\n minWidth={typeof column.minWidth === 'string' ? parseInt(column.minWidth) : column.minWidth}\n />\n </>\n )}\n </th>\n );\n}\n"]}
@@ -1,23 +1,24 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "header-cell": "awsui_header-cell_1spae_1d6sg_93",
5
- "header-cell-sticky": "awsui_header-cell-sticky_1spae_1d6sg_105",
6
- "header-cell-stuck": "awsui_header-cell-stuck_1spae_1d6sg_108",
7
- "header-cell-variant-full-page": "awsui_header-cell-variant-full-page_1spae_1d6sg_108",
8
- "header-cell-hidden": "awsui_header-cell-hidden_1spae_1d6sg_111",
9
- "header-cell-sortable": "awsui_header-cell-sortable_1spae_1d6sg_114",
10
- "header-cell-resizable": "awsui_header-cell-resizable_1spae_1d6sg_126",
11
- "sorting-icon": "awsui_sorting-icon_1spae_1d6sg_130",
12
- "header-cell-disabled": "awsui_header-cell-disabled_1spae_1d6sg_137",
13
- "header-cell-sorted": "awsui_header-cell-sorted_1spae_1d6sg_137",
14
- "header-cell-content": "awsui_header-cell-content_1spae_1d6sg_137",
15
- "header-cell-fake-focus": "awsui_header-cell-fake-focus_1spae_1d6sg_170",
16
- "header-cell-text": "awsui_header-cell-text_1spae_1d6sg_199",
17
- "header-cell-text-wrap": "awsui_header-cell-text-wrap_1spae_1d6sg_199",
18
- "header-cell-ascending": "awsui_header-cell-ascending_1spae_1d6sg_205",
19
- "header-cell-descending": "awsui_header-cell-descending_1spae_1d6sg_206",
20
- "is-visual-refresh": "awsui_is-visual-refresh_1spae_1d6sg_216",
21
- "has-striped-rows": "awsui_has-striped-rows_1spae_1d6sg_227"
4
+ "header-cell": "awsui_header-cell_1spae_lzlsa_93",
5
+ "header-cell-sticky": "awsui_header-cell-sticky_1spae_lzlsa_105",
6
+ "header-cell-stuck": "awsui_header-cell-stuck_1spae_lzlsa_108",
7
+ "header-cell-variant-full-page": "awsui_header-cell-variant-full-page_1spae_lzlsa_108",
8
+ "header-cell-hidden": "awsui_header-cell-hidden_1spae_lzlsa_111",
9
+ "header-cell-sortable": "awsui_header-cell-sortable_1spae_lzlsa_114",
10
+ "header-cell-resizable": "awsui_header-cell-resizable_1spae_lzlsa_126",
11
+ "sorting-icon": "awsui_sorting-icon_1spae_lzlsa_130",
12
+ "edit-icon": "awsui_edit-icon_1spae_lzlsa_137",
13
+ "header-cell-content": "awsui_header-cell-content_1spae_lzlsa_143",
14
+ "header-cell-fake-focus": "awsui_header-cell-fake-focus_1spae_lzlsa_172",
15
+ "header-cell-disabled": "awsui_header-cell-disabled_1spae_lzlsa_190",
16
+ "header-cell-sorted": "awsui_header-cell-sorted_1spae_lzlsa_190",
17
+ "header-cell-text": "awsui_header-cell-text_1spae_lzlsa_204",
18
+ "header-cell-text-wrap": "awsui_header-cell-text-wrap_1spae_lzlsa_204",
19
+ "header-cell-ascending": "awsui_header-cell-ascending_1spae_lzlsa_210",
20
+ "header-cell-descending": "awsui_header-cell-descending_1spae_lzlsa_211",
21
+ "is-visual-refresh": "awsui_is-visual-refresh_1spae_lzlsa_221",
22
+ "has-striped-rows": "awsui_has-striped-rows_1spae_lzlsa_232"
22
23
  };
23
24
 
@@ -90,7 +90,7 @@ 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_header-cell_1spae_1d6sg_93:not(#\9) {
93
+ .awsui_header-cell_1spae_lzlsa_93:not(#\9) {
94
94
  position: relative;
95
95
  text-align: left;
96
96
  box-sizing: border-box;
@@ -102,19 +102,19 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
102
102
  -moz-osx-font-smoothing: var(--font-smoothing-moz-osx-nkh1jb, grayscale);
103
103
  padding: var(--space-scaled-xxs-95dhkm, 4px) var(--space-scaled-xs-6859qs, 8px);
104
104
  }
105
- .awsui_header-cell-sticky_1spae_1d6sg_105:not(#\9) {
105
+ .awsui_header-cell-sticky_1spae_lzlsa_105:not(#\9) {
106
106
  border-bottom: var(--border-table-sticky-width-h1tlxy, 2px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
107
107
  }
108
- .awsui_header-cell-stuck_1spae_1d6sg_108:not(#\9):not(.awsui_header-cell-variant-full-page_1spae_1d6sg_108) {
108
+ .awsui_header-cell-stuck_1spae_lzlsa_108:not(#\9):not(.awsui_header-cell-variant-full-page_1spae_lzlsa_108) {
109
109
  border-bottom-color: transparent;
110
110
  }
111
- .awsui_header-cell-variant-full-page_1spae_1d6sg_108.awsui_header-cell-hidden_1spae_1d6sg_111:not(#\9) {
111
+ .awsui_header-cell-variant-full-page_1spae_lzlsa_108.awsui_header-cell-hidden_1spae_lzlsa_111:not(#\9) {
112
112
  border-bottom-color: transparent;
113
113
  }
114
- .awsui_header-cell_1spae_1d6sg_93:not(#\9):last-child, .awsui_header-cell_1spae_1d6sg_93.awsui_header-cell-sortable_1spae_1d6sg_114:not(#\9) {
114
+ .awsui_header-cell_1spae_lzlsa_93:not(#\9):last-child, .awsui_header-cell_1spae_lzlsa_93.awsui_header-cell-sortable_1spae_lzlsa_114:not(#\9) {
115
115
  padding-right: var(--space-xs-rsr2qu, 8px);
116
116
  }
117
- .awsui_header-cell_1spae_1d6sg_93:not(#\9):not(:last-child):before {
117
+ .awsui_header-cell_1spae_lzlsa_93:not(#\9):not(:last-child):before {
118
118
  content: "";
119
119
  position: absolute;
120
120
  right: 0;
@@ -123,40 +123,42 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
123
123
  border-left: var(--border-divider-section-width-4wm2it, 2px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
124
124
  box-sizing: border-box;
125
125
  }
126
- .awsui_header-cell-resizable_1spae_1d6sg_126:not(#\9):not(:last-child):before {
126
+ .awsui_header-cell-resizable_1spae_lzlsa_126:not(#\9):not(:last-child):before {
127
127
  border-left-color: var(--color-border-divider-interactive-default-rcasvw, #e9ebed);
128
128
  }
129
129
 
130
- .awsui_sorting-icon_1spae_1d6sg_130:not(#\9) {
130
+ .awsui_sorting-icon_1spae_lzlsa_130:not(#\9) {
131
131
  position: absolute;
132
132
  top: var(--space-scaled-xxs-95dhkm, 4px);
133
133
  right: var(--space-xxs-ynfts5, 4px);
134
134
  color: var(--color-text-column-sorting-icon-q5sr09, #414d5c);
135
135
  }
136
136
 
137
- .awsui_header-cell-disabled_1spae_1d6sg_137.awsui_header-cell-sorted_1spae_1d6sg_137 > .awsui_header-cell-content_1spae_1d6sg_137 > .awsui_sorting-icon_1spae_1d6sg_130:not(#\9) {
138
- color: var(--color-text-interactive-disabled-3pbb07, #9ba7b6);
137
+ .awsui_edit-icon_1spae_lzlsa_137:not(#\9) {
138
+ margin-left: var(--space-xxs-ynfts5, 4px);
139
+ margin-top: var(--space-scaled-xxs-95dhkm, 4px);
140
+ color: inherit;
139
141
  }
140
142
 
141
- .awsui_header-cell-content_1spae_1d6sg_137:not(#\9) {
143
+ .awsui_header-cell-content_1spae_lzlsa_143:not(#\9) {
142
144
  position: relative;
143
145
  padding: var(--space-scaled-xxs-95dhkm, 4px) var(--space-s-hv8c1d, 12px);
144
146
  }
145
- .awsui_header-cell-sortable_1spae_1d6sg_114 > .awsui_header-cell-content_1spae_1d6sg_137:not(#\9) {
147
+ .awsui_header-cell-sortable_1spae_lzlsa_114 > .awsui_header-cell-content_1spae_lzlsa_143:not(#\9) {
146
148
  padding-right: calc(var(--space-xl-a39hup, 24px) + var(--space-xxs-ynfts5, 4px));
147
149
  }
148
- .awsui_header-cell-content_1spae_1d6sg_137:not(#\9):focus {
150
+ .awsui_header-cell-content_1spae_lzlsa_143:not(#\9):focus {
149
151
  outline: none;
150
152
  text-decoration: none;
151
153
  }
152
- .awsui_header-cell-content_1spae_1d6sg_137[data-awsui-focus-visible=true]:not(#\9):focus {
154
+ .awsui_header-cell-content_1spae_lzlsa_143[data-awsui-focus-visible=true]:not(#\9):focus {
153
155
  position: relative;
154
156
  }
155
- .awsui_header-cell-content_1spae_1d6sg_137[data-awsui-focus-visible=true]:not(#\9):focus {
157
+ .awsui_header-cell-content_1spae_lzlsa_143[data-awsui-focus-visible=true]:not(#\9):focus {
156
158
  outline: 2px dotted transparent;
157
159
  outline-offset: calc(var(--space-table-header-focus-outline-gutter-rbx7m7, 0px) - 1px);
158
160
  }
159
- .awsui_header-cell-content_1spae_1d6sg_137[data-awsui-focus-visible=true]:not(#\9):focus::before {
161
+ .awsui_header-cell-content_1spae_lzlsa_143[data-awsui-focus-visible=true]:not(#\9):focus::before {
160
162
  content: " ";
161
163
  display: block;
162
164
  position: absolute;
@@ -167,14 +169,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
167
169
  border-radius: var(--border-radius-control-default-focus-ring-7661kz, 4px);
168
170
  box-shadow: 0 0 0 2px var(--color-border-item-focused-ap3b6s, #0972d3);
169
171
  }
170
- .awsui_header-cell-content_1spae_1d6sg_137.awsui_header-cell-fake-focus_1spae_1d6sg_170:not(#\9) {
172
+ .awsui_header-cell-content_1spae_lzlsa_143.awsui_header-cell-fake-focus_1spae_lzlsa_172:not(#\9) {
171
173
  position: relative;
172
174
  }
173
- .awsui_header-cell-content_1spae_1d6sg_137.awsui_header-cell-fake-focus_1spae_1d6sg_170:not(#\9) {
175
+ .awsui_header-cell-content_1spae_lzlsa_143.awsui_header-cell-fake-focus_1spae_lzlsa_172:not(#\9) {
174
176
  outline: 2px dotted transparent;
175
177
  outline-offset: calc(var(--space-table-header-focus-outline-gutter-rbx7m7, 0px) - 1px);
176
178
  }
177
- .awsui_header-cell-content_1spae_1d6sg_137.awsui_header-cell-fake-focus_1spae_1d6sg_170:not(#\9)::before {
179
+ .awsui_header-cell-content_1spae_lzlsa_143.awsui_header-cell-fake-focus_1spae_lzlsa_172:not(#\9)::before {
178
180
  content: " ";
179
181
  display: block;
180
182
  position: absolute;
@@ -185,54 +187,57 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
185
187
  border-radius: var(--border-radius-control-default-focus-ring-7661kz, 4px);
186
188
  box-shadow: 0 0 0 2px var(--color-border-item-focused-ap3b6s, #0972d3);
187
189
  }
190
+ .awsui_header-cell-disabled_1spae_lzlsa_190.awsui_header-cell-sorted_1spae_lzlsa_190 > .awsui_header-cell-content_1spae_lzlsa_143 > .awsui_sorting-icon_1spae_lzlsa_130:not(#\9) {
191
+ color: var(--color-text-interactive-disabled-3pbb07, #9ba7b6);
192
+ }
188
193
 
189
- .awsui_header-cell-sortable_1spae_1d6sg_114:not(#\9):not(.awsui_header-cell-disabled_1spae_1d6sg_137) > .awsui_header-cell-content_1spae_1d6sg_137 {
194
+ .awsui_header-cell-sortable_1spae_lzlsa_114:not(#\9):not(.awsui_header-cell-disabled_1spae_lzlsa_190) > .awsui_header-cell-content_1spae_lzlsa_143 {
190
195
  cursor: pointer;
191
196
  }
192
- .awsui_header-cell-sortable_1spae_1d6sg_114:not(#\9):not(.awsui_header-cell-disabled_1spae_1d6sg_137) > .awsui_header-cell-content_1spae_1d6sg_137:hover, .awsui_header-cell-sortable_1spae_1d6sg_114:not(#\9):not(.awsui_header-cell-disabled_1spae_1d6sg_137).awsui_header-cell-sorted_1spae_1d6sg_137 > .awsui_header-cell-content_1spae_1d6sg_137 {
197
+ .awsui_header-cell-sortable_1spae_lzlsa_114:not(#\9):not(.awsui_header-cell-disabled_1spae_lzlsa_190) > .awsui_header-cell-content_1spae_lzlsa_143:hover, .awsui_header-cell-sortable_1spae_lzlsa_114:not(#\9):not(.awsui_header-cell-disabled_1spae_lzlsa_190).awsui_header-cell-sorted_1spae_lzlsa_190 > .awsui_header-cell-content_1spae_lzlsa_143 {
193
198
  color: var(--color-text-interactive-active-vol84d, #000716);
194
199
  }
195
- .awsui_header-cell-sortable_1spae_1d6sg_114:not(#\9):not(.awsui_header-cell-disabled_1spae_1d6sg_137) > .awsui_header-cell-content_1spae_1d6sg_137:hover > .awsui_sorting-icon_1spae_1d6sg_130, .awsui_header-cell-sortable_1spae_1d6sg_114:not(#\9):not(.awsui_header-cell-disabled_1spae_1d6sg_137).awsui_header-cell-sorted_1spae_1d6sg_137 > .awsui_header-cell-content_1spae_1d6sg_137 > .awsui_sorting-icon_1spae_1d6sg_130 {
200
+ .awsui_header-cell-sortable_1spae_lzlsa_114:not(#\9):not(.awsui_header-cell-disabled_1spae_lzlsa_190) > .awsui_header-cell-content_1spae_lzlsa_143:hover > .awsui_sorting-icon_1spae_lzlsa_130, .awsui_header-cell-sortable_1spae_lzlsa_114:not(#\9):not(.awsui_header-cell-disabled_1spae_lzlsa_190).awsui_header-cell-sorted_1spae_lzlsa_190 > .awsui_header-cell-content_1spae_lzlsa_143 > .awsui_sorting-icon_1spae_lzlsa_130 {
196
201
  color: var(--color-text-interactive-active-vol84d, #000716);
197
202
  }
198
203
 
199
- .awsui_header-cell-text_1spae_1d6sg_199:not(#\9):not(.awsui_header-cell-text-wrap_1spae_1d6sg_199) {
204
+ .awsui_header-cell-text_1spae_lzlsa_204:not(#\9):not(.awsui_header-cell-text-wrap_1spae_lzlsa_204) {
200
205
  white-space: nowrap;
201
206
  overflow: hidden;
202
207
  text-overflow: ellipsis;
203
208
  }
204
209
 
205
- .awsui_header-cell-ascending_1spae_1d6sg_205:not(#\9),
206
- .awsui_header-cell-descending_1spae_1d6sg_206:not(#\9) {
210
+ .awsui_header-cell-ascending_1spae_lzlsa_210:not(#\9),
211
+ .awsui_header-cell-descending_1spae_lzlsa_211:not(#\9) {
207
212
  /* used in test-utils */
208
213
  }
209
214
 
210
215
  /*
211
216
  In Visual Refresh the first cell in the header should align
212
- with the left edge of the table as closely as possible. If the
213
- last header cell is sortable the sort icon should align with the
217
+ with the left edge of the table as closely as possible. If the
218
+ last header cell is sortable the sort icon should align with the
214
219
  settings icon in the pagination slot.
215
220
  */
216
- .awsui_header-cell_1spae_1d6sg_93:not(#\9):not(.awsui_is-visual-refresh_1spae_1d6sg_216):first-child {
221
+ .awsui_header-cell_1spae_lzlsa_93:not(#\9):not(.awsui_is-visual-refresh_1spae_lzlsa_221):first-child {
217
222
  padding-left: var(--space-xs-rsr2qu, 8px);
218
223
  }
219
224
 
220
- .awsui_header-cell_1spae_1d6sg_93.awsui_is-visual-refresh_1spae_1d6sg_216:not(#\9) {
225
+ .awsui_header-cell_1spae_lzlsa_93.awsui_is-visual-refresh_1spae_lzlsa_221:not(#\9) {
221
226
  /*
222
- Striped rows requires additional left padding because the
223
- shaded background makes the child content appear too close
227
+ Striped rows requires additional left padding because the
228
+ shaded background makes the child content appear too close
224
229
  to the table edge.
225
230
  */
226
231
  }
227
- .awsui_header-cell_1spae_1d6sg_93.awsui_is-visual-refresh_1spae_1d6sg_216:not(#\9):first-child:not(.awsui_has-striped-rows_1spae_1d6sg_227) {
232
+ .awsui_header-cell_1spae_lzlsa_93.awsui_is-visual-refresh_1spae_lzlsa_221:not(#\9):first-child:not(.awsui_has-striped-rows_1spae_lzlsa_232) {
228
233
  padding-left: var(--space-xxxs-k2w98v, 2px);
229
234
  }
230
- .awsui_header-cell_1spae_1d6sg_93.awsui_is-visual-refresh_1spae_1d6sg_216:not(#\9):first-child.awsui_has-striped-rows_1spae_1d6sg_227 {
235
+ .awsui_header-cell_1spae_lzlsa_93.awsui_is-visual-refresh_1spae_lzlsa_221:not(#\9):first-child.awsui_has-striped-rows_1spae_lzlsa_232 {
231
236
  padding-left: var(--space-xxs-ynfts5, 4px);
232
237
  }
233
- .awsui_header-cell_1spae_1d6sg_93.awsui_is-visual-refresh_1spae_1d6sg_216:not(#\9):first-child > .awsui_header-cell-content_1spae_1d6sg_137 {
238
+ .awsui_header-cell_1spae_lzlsa_93.awsui_is-visual-refresh_1spae_lzlsa_221:not(#\9):first-child > .awsui_header-cell-content_1spae_lzlsa_143 {
234
239
  padding-left: 0;
235
240
  }
236
- .awsui_header-cell_1spae_1d6sg_93.awsui_is-visual-refresh_1spae_1d6sg_216:not(#\9):last-child.awsui_header-cell-sortable_1spae_1d6sg_114 {
241
+ .awsui_header-cell_1spae_lzlsa_93.awsui_is-visual-refresh_1spae_lzlsa_221:not(#\9):last-child.awsui_header-cell-sortable_1spae_lzlsa_114 {
237
242
  padding-right: var(--space-xxxs-k2w98v, 2px);
238
243
  }
@@ -2,23 +2,24 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "header-cell": "awsui_header-cell_1spae_1d6sg_93",
6
- "header-cell-sticky": "awsui_header-cell-sticky_1spae_1d6sg_105",
7
- "header-cell-stuck": "awsui_header-cell-stuck_1spae_1d6sg_108",
8
- "header-cell-variant-full-page": "awsui_header-cell-variant-full-page_1spae_1d6sg_108",
9
- "header-cell-hidden": "awsui_header-cell-hidden_1spae_1d6sg_111",
10
- "header-cell-sortable": "awsui_header-cell-sortable_1spae_1d6sg_114",
11
- "header-cell-resizable": "awsui_header-cell-resizable_1spae_1d6sg_126",
12
- "sorting-icon": "awsui_sorting-icon_1spae_1d6sg_130",
13
- "header-cell-disabled": "awsui_header-cell-disabled_1spae_1d6sg_137",
14
- "header-cell-sorted": "awsui_header-cell-sorted_1spae_1d6sg_137",
15
- "header-cell-content": "awsui_header-cell-content_1spae_1d6sg_137",
16
- "header-cell-fake-focus": "awsui_header-cell-fake-focus_1spae_1d6sg_170",
17
- "header-cell-text": "awsui_header-cell-text_1spae_1d6sg_199",
18
- "header-cell-text-wrap": "awsui_header-cell-text-wrap_1spae_1d6sg_199",
19
- "header-cell-ascending": "awsui_header-cell-ascending_1spae_1d6sg_205",
20
- "header-cell-descending": "awsui_header-cell-descending_1spae_1d6sg_206",
21
- "is-visual-refresh": "awsui_is-visual-refresh_1spae_1d6sg_216",
22
- "has-striped-rows": "awsui_has-striped-rows_1spae_1d6sg_227"
5
+ "header-cell": "awsui_header-cell_1spae_lzlsa_93",
6
+ "header-cell-sticky": "awsui_header-cell-sticky_1spae_lzlsa_105",
7
+ "header-cell-stuck": "awsui_header-cell-stuck_1spae_lzlsa_108",
8
+ "header-cell-variant-full-page": "awsui_header-cell-variant-full-page_1spae_lzlsa_108",
9
+ "header-cell-hidden": "awsui_header-cell-hidden_1spae_lzlsa_111",
10
+ "header-cell-sortable": "awsui_header-cell-sortable_1spae_lzlsa_114",
11
+ "header-cell-resizable": "awsui_header-cell-resizable_1spae_lzlsa_126",
12
+ "sorting-icon": "awsui_sorting-icon_1spae_lzlsa_130",
13
+ "edit-icon": "awsui_edit-icon_1spae_lzlsa_137",
14
+ "header-cell-content": "awsui_header-cell-content_1spae_lzlsa_143",
15
+ "header-cell-fake-focus": "awsui_header-cell-fake-focus_1spae_lzlsa_172",
16
+ "header-cell-disabled": "awsui_header-cell-disabled_1spae_lzlsa_190",
17
+ "header-cell-sorted": "awsui_header-cell-sorted_1spae_lzlsa_190",
18
+ "header-cell-text": "awsui_header-cell-text_1spae_lzlsa_204",
19
+ "header-cell-text-wrap": "awsui_header-cell-text-wrap_1spae_lzlsa_204",
20
+ "header-cell-ascending": "awsui_header-cell-ascending_1spae_lzlsa_210",
21
+ "header-cell-descending": "awsui_header-cell-descending_1spae_lzlsa_211",
22
+ "is-visual-refresh": "awsui_is-visual-refresh_1spae_lzlsa_221",
23
+ "has-striped-rows": "awsui_has-striped-rows_1spae_lzlsa_232"
23
24
  };
24
25
 
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { BaseComponentProps } from '../internal/base-component';
3
3
  import { NonCancelableEventHandler, CancelableEventHandler } from '../internal/events';
4
+ import { Optional } from '../internal/types';
4
5
  export interface TableForwardRefType {
5
6
  <T>(props: TableProps<T> & {
6
7
  ref?: React.Ref<TableProps.Ref>;
@@ -53,7 +54,8 @@ export interface TableProps<T = any> extends BaseComponentProps {
53
54
  * fills the remaining space of the table so the specified width is ignored.
54
55
  * * `minWidth` (string | number) - Specifies the minimum column width. Corresponds to the `min-width` css-property. When
55
56
  * `resizableColumns` property is set to `true`, additional constraints apply: 1) string values are not allowed,
56
- * and 2) the column can't resize below than the specified width (defaults to "120px").
57
+ * and 2) the column can't resize below than the specified width (defaults to "120px"). We recommend that you set a minimum width
58
+ * of at least 176px for columns that are editable.
57
59
  * * `maxWidth` (string | number) - Specifies the maximum column width. Corresponds to the `max-width` css-property.
58
60
  * Note that when the `resizableColumns` property is set to `true` this property is ignored.
59
61
  * * `ariaLabel` (LabelData => string) - An optional function that's called to provide an `aria-label` for the cell header.
@@ -68,6 +70,13 @@ export interface TableProps<T = any> extends BaseComponentProps {
68
70
  * to reorder the items. This property accepts a custom comparator that is used to compare two items.
69
71
  * The comparator must implement ascending ordering, and the output is inverted automatically in case of descending order.
70
72
  * If present, the `sortingField` property is ignored.
73
+ * * `editConfig` (EditConfig) - Enables inline editing in column when present. The value is used to configure the editing behavior.
74
+ * * * `editConfig.ariaLabel` (string) - Specifies a label for the edit control. Visually hidden but read by screen readers.
75
+ * * * `editConfig.errorIconAriaLabel` (string) - Specifies an ariaLabel for the error icon that is displayed when the validation fails.
76
+ * * * `editConfig.editIconAriaLabel` (string) - Specifies an alternate text for the edit icon used in column header.
77
+ * * * `editConfig.constraintText` (string) - Constraint text that is displayed below the edit control.
78
+ * * * `editConfig.validation` ((item, value) => string) - A function that allows you to validate the value of the edit control.
79
+ * 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.
71
80
  *
72
81
  */
73
82
  columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<T>>;
@@ -114,13 +123,19 @@ export interface TableProps<T = any> extends BaseComponentProps {
114
123
  * * `allItemsSelectionLabel` ((SelectionState) => string) - Specifies the alternative text for multi-selection column header.
115
124
  * * `selectionGroupLabel` (string) - Specifies the alternative text for the whole selection and single-selection column header.
116
125
  * It is prefixed to `itemSelectionLabel` and `allItemsSelectionLabel` when they are set.
117
- * * `tableLabel` (string) - Provides a alternative text for the table. If you use a header for this table, you may reuse the string
126
+ * * `tableLabel` (string) - Provides an alternative text for the table. If you use a header for this table, you may reuse the string
118
127
  * to provide a caption-like description. For example, tableLabel=Instances will be announced as 'Instances table'.
119
- *
120
128
  * You can use the first argument of type `SelectionState` to access the current selection
121
129
  * state of the component (for example, the `selectedItems` list). The `itemSelectionLabel` for individual
122
130
  * items also receives the corresponding `Item` object. You can use the `selectionGroupLabel` to
123
131
  * add a meaningful description to the whole selection.
132
+ *
133
+ * * `activateEditLabel` (EditableColumnDefinition) => string -
134
+ * Specifies an alternative text for the edit button in editable cells.
135
+ * * `cancelEditLabel` (EditableColumnDefinition) => string -
136
+ * Specifies an alternative text for the cancel button in editable cells.
137
+ * * `submitEditLabel` (EditableColumnDefinition) => string -
138
+ * Specifies an alternative text for the submit button in editable cells.
124
139
  */
125
140
  ariaLabels?: TableProps.AriaLabels<T>;
126
141
  /**
@@ -212,18 +227,62 @@ export interface TableProps<T = any> extends BaseComponentProps {
212
227
  * Requires the properties firstIndex and totalItemsCount to be set correctly.
213
228
  */
214
229
  renderAriaLive?: (data: TableProps.LiveAnnouncement) => string;
230
+ /**
231
+ * Specifies a function that will be called after user submits an inline edit.
232
+ * Return a promise to keep loading state while the submit request is in progress.
233
+ */
234
+ submitEdit?: TableProps.SubmitEditFunction<T>;
235
+ /**
236
+ * Called whenever user cancels an inline edit. Use this function to reset any
237
+ * validation states, or show warning for unsaved changes.
238
+ */
239
+ onEditCancel?: CancelableEventHandler;
215
240
  }
216
241
  export declare namespace TableProps {
217
242
  type TrackBy<T> = string | ((item: T) => string);
218
- type ColumnDefinition<T> = {
243
+ interface CellContext<V> {
244
+ isEditing?: boolean;
245
+ currentValue: Optional<V>;
246
+ setValue: (value: V | undefined) => void;
247
+ }
248
+ interface EditConfig<T, V = any> {
249
+ /**
250
+ * Specifies a label for the edit control. Visually hidden but read
251
+ * by screen readers.
252
+ */
253
+ ariaLabel?: string;
254
+ /**
255
+ * Specifies an ariaLabel for the error icon that is displayed when
256
+ * the validation fails.
257
+ */
258
+ errorIconAriaLabel?: string;
259
+ /**
260
+ * Specifies an alternate text for the edit icon used in column header.
261
+ */
262
+ editIconAriaLabel?: string;
263
+ /**
264
+ * Constraint text that is displayed below the edit control.
265
+ */
266
+ constraintText?: string;
267
+ /**
268
+ * A function that allows you to validate the value of the edit control. Return
269
+ * a string from the function to display an error message. Return
270
+ * `undefined` (or no return) from the function to indicate that the value is valid.
271
+ * @param item - The item that is being edited.
272
+ * @param value - The current value of the edit control.
273
+ */
274
+ validation?: (item: T, value: Optional<V>) => Optional<string>;
275
+ }
276
+ type ColumnDefinition<ItemType> = {
219
277
  id?: string;
220
278
  header: React.ReactNode;
221
- cell(item: T): React.ReactNode;
222
279
  ariaLabel?(data: LabelData): string;
223
280
  width?: number | string;
224
281
  minWidth?: number | string;
225
282
  maxWidth?: number | string;
226
- } & SortingColumn<T>;
283
+ editConfig?: EditConfig<ItemType>;
284
+ cell(item: ItemType, context: CellContext<any>): React.ReactNode;
285
+ } & SortingColumn<ItemType>;
227
286
  type SelectionType = 'single' | 'multi';
228
287
  type Variant = 'container' | 'embedded' | 'stacked' | 'full-page';
229
288
  interface SelectionState<T> {
@@ -238,6 +297,9 @@ export declare namespace TableProps {
238
297
  itemSelectionLabel?: (data: TableProps.SelectionState<T>, row: T) => string;
239
298
  selectionGroupLabel?: string;
240
299
  tableLabel?: string;
300
+ activateEditLabel?: (column: ColumnDefinition<any>) => string;
301
+ cancelEditLabel?: (column: ColumnDefinition<any>) => string;
302
+ submitEditLabel?: (column: ColumnDefinition<any>) => string;
241
303
  }
242
304
  interface SortingState<T> {
243
305
  isDescending?: boolean;
@@ -276,6 +338,11 @@ export declare namespace TableProps {
276
338
  * scroll parent scrolls to reveal the first row of the table.
277
339
  */
278
340
  scrollToTop(): void;
341
+ /**
342
+ * Dismiss an inline edit if currently active.
343
+ */
344
+ cancelEdit?(): void;
279
345
  }
346
+ type SubmitEditFunction<ItemType, ValueType = unknown> = (item: ItemType, column: ColumnDefinition<ItemType>, newValue: ValueType) => Promise<void> | void;
280
347
  }
281
348
  //# sourceMappingURL=interfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/table/interfaces.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAYvF,MAAM,WAAW,mBAAmB;IAClC,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG;QAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;KAAE,GAAG,GAAG,CAAC,OAAO,CAAC;CAC9E;AACD,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,kBAAkB;IAC7D;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAExB;;;OAGG;IACH,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAExB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,iBAAiB,EAAE,aAAa,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IACjE;;OAEG;IACH,aAAa,CAAC,EAAE,UAAU,CAAC,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AAO,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;CAC3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/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';\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}\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 `visibleColumns` 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\").\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 *\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 * 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 * * `tableLabel` (string) - Provides a 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 *\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 */\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 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 * * `embedded` - Use this variant within a parent container (such as a modal, expandable\n * section, container or split panel).\n * * `stacked` - Use this variant adjacent to other stacked containers (such as a container,\n * table).\n * * `full-page` – Use this variant when table is the primary element on the page.\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\nexport namespace TableProps {\n export type TrackBy<T> = string | ((item: T) => string);\n\n export type ColumnDefinition<T> = {\n id?: string;\n header: React.ReactNode;\n cell(item: T): React.ReactNode;\n ariaLabel?(data: LabelData): string;\n width?: number | string;\n minWidth?: number | string;\n maxWidth?: number | string;\n } & SortingColumn<T>;\n\n export type SelectionType = 'single' | 'multi';\n export type Variant = 'container' | 'embedded' | '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 }\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"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/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';\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 `visibleColumns` 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 *\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 * 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 * * `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 * 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 *\n * * `activateEditLabel` (EditableColumnDefinition) => 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 */\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 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 * * `embedded` - Use this variant within a parent container (such as a modal, expandable\n * section, container or split panel).\n * * `stacked` - Use this variant adjacent to other stacked containers (such as a container,\n * table).\n * * `full-page` – Use this variant when table is the primary element on the page.\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 isEditing?: boolean;\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 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 cell(item: ItemType, context: CellContext<any>): React.ReactNode;\n } & SortingColumn<ItemType>;\n\n export type SelectionType = 'single' | 'multi';\n export type Variant = 'container' | 'embedded' | '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>) => string;\n cancelEditLabel?: (column: ColumnDefinition<any>) => string;\n submitEditLabel?: (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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/table/internal.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAc,MAAM,cAAc,CAAC;AAiC/D,QAAA,MAAM,aAAa,qBAsVK,CAAC;AAEzB,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/table/internal.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAc,MAAM,cAAc,CAAC;AAmC/D,QAAA,MAAM,aAAa,qBA8XK,CAAC;AAEzB,eAAe,aAAa,CAAC"}