@cloudscape-design/components 3.0.1003 → 3.0.1005
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app-layout/visual-refresh-toolbar/skeleton/index.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/skeleton/index.js +10 -2
- package/app-layout/visual-refresh-toolbar/skeleton/index.js.map +1 -1
- package/app-layout-toolbar/index.d.ts.map +1 -1
- package/app-layout-toolbar/index.js +1 -9
- package/app-layout-toolbar/index.js.map +1 -1
- package/button/interfaces.d.ts +12 -0
- package/button/interfaces.d.ts.map +1 -1
- package/button/interfaces.js.map +1 -1
- package/collection-preferences/styles.css.js +38 -38
- package/collection-preferences/styles.scoped.css +39 -447
- package/collection-preferences/styles.selectors.js +38 -38
- package/i18n/messages/all.all.js +1 -1
- package/i18n/messages/all.all.json +1 -1
- package/i18n/messages/all.ar.js +1 -1
- package/i18n/messages/all.ar.json +1 -1
- package/i18n/messages/all.de.js +1 -1
- package/i18n/messages/all.de.json +1 -1
- package/i18n/messages/all.en-GB.js +1 -1
- package/i18n/messages/all.en-GB.json +1 -1
- package/i18n/messages/all.en.js +1 -1
- package/i18n/messages/all.en.json +1 -1
- package/i18n/messages/all.es.js +1 -1
- package/i18n/messages/all.es.json +1 -1
- package/i18n/messages/all.fr.js +1 -1
- package/i18n/messages/all.fr.json +1 -1
- package/i18n/messages/all.id.js +1 -1
- package/i18n/messages/all.id.json +1 -1
- package/i18n/messages/all.it.js +1 -1
- package/i18n/messages/all.it.json +1 -1
- package/i18n/messages/all.ja.js +1 -1
- package/i18n/messages/all.ja.json +1 -1
- package/i18n/messages/all.ko.js +1 -1
- package/i18n/messages/all.ko.json +1 -1
- package/i18n/messages/all.pt-BR.js +1 -1
- package/i18n/messages/all.pt-BR.json +1 -1
- package/i18n/messages/all.tr.js +1 -1
- package/i18n/messages/all.tr.json +1 -1
- package/i18n/messages/all.zh-CN.js +1 -1
- package/i18n/messages/all.zh-CN.json +1 -1
- package/i18n/messages/all.zh-TW.js +1 -1
- package/i18n/messages/all.zh-TW.json +1 -1
- package/i18n/messages-types.d.ts +10 -0
- package/i18n/messages-types.d.ts.map +1 -1
- package/i18n/messages-types.js.map +1 -1
- package/internal/base-component/styles.scoped.css +1 -1
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
- package/popover/styles.css.js +56 -56
- package/popover/styles.scoped.css +202 -746
- package/popover/styles.selectors.js +56 -56
- package/progress-bar/styles.css.js +19 -19
- package/progress-bar/styles.scoped.css +30 -202
- package/progress-bar/styles.selectors.js +19 -19
- package/table/body-cell/styles.css.js +47 -46
- package/table/body-cell/styles.scoped.css +376 -373
- package/table/body-cell/styles.selectors.js +47 -46
- package/table/body-cell/td-element.d.ts +1 -0
- package/table/body-cell/td-element.d.ts.map +1 -1
- package/table/body-cell/td-element.js +2 -2
- package/table/body-cell/td-element.js.map +1 -1
- package/table/header-cell/index.d.ts +3 -1
- package/table/header-cell/index.d.ts.map +1 -1
- package/table/header-cell/index.js +2 -2
- package/table/header-cell/index.js.map +1 -1
- package/table/header-cell/styles.css.js +29 -28
- package/table/header-cell/styles.scoped.css +69 -66
- package/table/header-cell/styles.selectors.js +29 -28
- package/table/header-cell/th-element.d.ts +2 -0
- package/table/header-cell/th-element.d.ts.map +1 -1
- package/table/header-cell/th-element.js +2 -2
- package/table/header-cell/th-element.js.map +1 -1
- package/table/internal.d.ts.map +1 -1
- package/table/internal.js +2 -1
- package/table/internal.js.map +1 -1
- package/table/thead.d.ts +1 -0
- package/table/thead.d.ts.map +1 -1
- package/table/thead.js +2 -1
- package/table/thead.js.map +1 -1
- package/tabs/styles.css.js +30 -30
- package/tabs/styles.scoped.css +51 -187
- package/tabs/styles.selectors.js +30 -30
- package/collection-preferences/content-display/styles.css.js +0 -16
- package/collection-preferences/content-display/styles.scoped.css +0 -380
- package/collection-preferences/content-display/styles.selectors.js +0 -17
|
@@ -2,51 +2,52 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"expandable-toggle-wrapper": "awsui_expandable-toggle-
|
|
6
|
-
"body-cell": "awsui_body-
|
|
7
|
-
"body-cell-content": "awsui_body-cell-
|
|
8
|
-
"expandable-level-0": "awsui_expandable-level-
|
|
9
|
-
"expandable-level-1": "awsui_expandable-level-
|
|
10
|
-
"expandable-level-2": "awsui_expandable-level-
|
|
11
|
-
"expandable-level-3": "awsui_expandable-level-
|
|
12
|
-
"expandable-level-4": "awsui_expandable-level-
|
|
13
|
-
"expandable-level-5": "awsui_expandable-level-
|
|
14
|
-
"expandable-level-6": "awsui_expandable-level-
|
|
15
|
-
"expandable-level-7": "awsui_expandable-level-
|
|
16
|
-
"expandable-level-8": "awsui_expandable-level-
|
|
17
|
-
"expandable-level-9": "awsui_expandable-level-
|
|
18
|
-
"expandable-level-next": "awsui_expandable-level-
|
|
19
|
-
"body-cell-align-top": "awsui_body-cell-align-
|
|
20
|
-
"body-cell-wrap": "awsui_body-cell-
|
|
21
|
-
"is-visual-refresh": "awsui_is-visual-
|
|
22
|
-
"body-cell-edit-active": "awsui_body-cell-edit-
|
|
23
|
-
"body-cell-expandable": "awsui_body-cell-
|
|
24
|
-
"body-cell-editable": "awsui_body-cell-
|
|
25
|
-
"has-striped-rows": "awsui_has-striped-
|
|
26
|
-
"sticky-cell-pad-inline-start": "awsui_sticky-cell-pad-inline-
|
|
27
|
-
"has-selection": "awsui_has-
|
|
28
|
-
"body-cell-first-row": "awsui_body-cell-first-
|
|
29
|
-
"body-cell-last-row": "awsui_body-cell-last-
|
|
30
|
-
"body-cell-selected": "awsui_body-cell-
|
|
31
|
-
"has-footer": "awsui_has-
|
|
32
|
-
"body-cell-shaded": "awsui_body-cell-
|
|
33
|
-
"sticky-cell": "awsui_sticky-
|
|
34
|
-
"
|
|
35
|
-
"sticky-cell-last-inline-
|
|
36
|
-
"
|
|
37
|
-
"body-cell-
|
|
38
|
-
"body-cell-
|
|
39
|
-
"body-cell-
|
|
40
|
-
"body-cell-
|
|
41
|
-
"body-cell-editor
|
|
42
|
-
"body-cell-editor-
|
|
43
|
-
"body-cell-editor-
|
|
44
|
-
"body-cell-editor-
|
|
45
|
-
"body-cell-editor-
|
|
46
|
-
"body-cell-editor-
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"body-cell-
|
|
5
|
+
"expandable-toggle-wrapper": "awsui_expandable-toggle-wrapper_c6tup_m7a2f_145",
|
|
6
|
+
"body-cell": "awsui_body-cell_c6tup_m7a2f_152",
|
|
7
|
+
"body-cell-content": "awsui_body-cell-content_c6tup_m7a2f_160",
|
|
8
|
+
"expandable-level-0": "awsui_expandable-level-0_c6tup_m7a2f_166",
|
|
9
|
+
"expandable-level-1": "awsui_expandable-level-1_c6tup_m7a2f_173",
|
|
10
|
+
"expandable-level-2": "awsui_expandable-level-2_c6tup_m7a2f_180",
|
|
11
|
+
"expandable-level-3": "awsui_expandable-level-3_c6tup_m7a2f_187",
|
|
12
|
+
"expandable-level-4": "awsui_expandable-level-4_c6tup_m7a2f_194",
|
|
13
|
+
"expandable-level-5": "awsui_expandable-level-5_c6tup_m7a2f_201",
|
|
14
|
+
"expandable-level-6": "awsui_expandable-level-6_c6tup_m7a2f_208",
|
|
15
|
+
"expandable-level-7": "awsui_expandable-level-7_c6tup_m7a2f_215",
|
|
16
|
+
"expandable-level-8": "awsui_expandable-level-8_c6tup_m7a2f_222",
|
|
17
|
+
"expandable-level-9": "awsui_expandable-level-9_c6tup_m7a2f_229",
|
|
18
|
+
"expandable-level-next": "awsui_expandable-level-next_c6tup_m7a2f_236",
|
|
19
|
+
"body-cell-align-top": "awsui_body-cell-align-top_c6tup_m7a2f_254",
|
|
20
|
+
"body-cell-wrap": "awsui_body-cell-wrap_c6tup_m7a2f_260",
|
|
21
|
+
"is-visual-refresh": "awsui_is-visual-refresh_c6tup_m7a2f_357",
|
|
22
|
+
"body-cell-edit-active": "awsui_body-cell-edit-active_c6tup_m7a2f_447",
|
|
23
|
+
"body-cell-expandable": "awsui_body-cell-expandable_c6tup_m7a2f_447",
|
|
24
|
+
"body-cell-editable": "awsui_body-cell-editable_c6tup_m7a2f_447",
|
|
25
|
+
"has-striped-rows": "awsui_has-striped-rows_c6tup_m7a2f_530",
|
|
26
|
+
"sticky-cell-pad-inline-start": "awsui_sticky-cell-pad-inline-start_c6tup_m7a2f_696",
|
|
27
|
+
"has-selection": "awsui_has-selection_c6tup_m7a2f_862",
|
|
28
|
+
"body-cell-first-row": "awsui_body-cell-first-row_c6tup_m7a2f_1031",
|
|
29
|
+
"body-cell-last-row": "awsui_body-cell-last-row_c6tup_m7a2f_1034",
|
|
30
|
+
"body-cell-selected": "awsui_body-cell-selected_c6tup_m7a2f_1034",
|
|
31
|
+
"has-footer": "awsui_has-footer_c6tup_m7a2f_1034",
|
|
32
|
+
"body-cell-shaded": "awsui_body-cell-shaded_c6tup_m7a2f_1044",
|
|
33
|
+
"sticky-cell": "awsui_sticky-cell_c6tup_m7a2f_696",
|
|
34
|
+
"table-variant-full-page": "awsui_table-variant-full-page_c6tup_m7a2f_1095",
|
|
35
|
+
"sticky-cell-last-inline-end": "awsui_sticky-cell-last-inline-end_c6tup_m7a2f_1112",
|
|
36
|
+
"sticky-cell-last-inline-start": "awsui_sticky-cell-last-inline-start_c6tup_m7a2f_1121",
|
|
37
|
+
"body-cell-next-selected": "awsui_body-cell-next-selected_c6tup_m7a2f_1143",
|
|
38
|
+
"body-cell-prev-selected": "awsui_body-cell-prev-selected_c6tup_m7a2f_1150",
|
|
39
|
+
"body-cell-editor-wrapper": "awsui_body-cell-editor-wrapper_c6tup_m7a2f_1176",
|
|
40
|
+
"body-cell-success": "awsui_body-cell-success_c6tup_m7a2f_1181",
|
|
41
|
+
"body-cell-editor": "awsui_body-cell-editor_c6tup_m7a2f_1176",
|
|
42
|
+
"body-cell-editor-disabled": "awsui_body-cell-editor-disabled_c6tup_m7a2f_1206",
|
|
43
|
+
"body-cell-editor-row": "awsui_body-cell-editor-row_c6tup_m7a2f_1215",
|
|
44
|
+
"body-cell-editor-controls": "awsui_body-cell-editor-controls_c6tup_m7a2f_1225",
|
|
45
|
+
"body-cell-editor-row-editor": "awsui_body-cell-editor-row-editor_c6tup_m7a2f_1228",
|
|
46
|
+
"body-cell-editor-focusable": "awsui_body-cell-editor-focusable_c6tup_m7a2f_1231",
|
|
47
|
+
"body-cell-editor-icon": "awsui_body-cell-editor-icon_c6tup_m7a2f_1255",
|
|
48
|
+
"resizable-columns": "awsui_resizable-columns_c6tup_m7a2f_1367",
|
|
49
|
+
"expandable-cell-content": "awsui_expandable-cell-content_c6tup_m7a2f_1370",
|
|
50
|
+
"body-cell-edit-disabled-popover": "awsui_body-cell-edit-disabled-popover_c6tup_m7a2f_1421",
|
|
51
|
+
"body-cell-has-success": "awsui_body-cell-has-success_c6tup_m7a2f_1424"
|
|
51
52
|
};
|
|
52
53
|
|
|
@@ -38,5 +38,6 @@ export interface TableTdElementProps {
|
|
|
38
38
|
isEditing: boolean;
|
|
39
39
|
isEditingDisabled?: boolean;
|
|
40
40
|
hasSuccessIcon?: boolean;
|
|
41
|
+
tableVariant?: string;
|
|
41
42
|
}
|
|
42
43
|
export declare const TableTdElement: React.ForwardRefExoticComponent<TableTdElementProps & React.RefAttributes<HTMLTableCellElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"td-element.d.ts","sourceRoot":"","sources":["../../../../src/table/body-cell/td-element.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAQtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAuB,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAyB,SAAS,EAAE,M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EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,kBAAkB,CAAC;IAChC,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;IACpC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,CAAC,EAAE,UAAU,CAAC,aAAa,CAAC;IACzC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,cAAc,kGA8G1B,CAAC"}
|
|
@@ -14,7 +14,7 @@ import { getStickyClassNames } from '../utils';
|
|
|
14
14
|
import tableStyles from '../styles.css.js';
|
|
15
15
|
import styles from './styles.css.js';
|
|
16
16
|
export const TableTdElement = React.forwardRef((_a, ref) => {
|
|
17
|
-
var { children, wrapLines, isRowHeader, isFirstRow, isLastRow, isSelected, isNextSelected, isPrevSelected, nativeAttributes, onClick, onFocus, onBlur, isEvenRow, stripedRows, isSelection, hasSelection, hasFooter, columnId, colIndex, stickyState, tableRole, level, isExpandable, isExpanded, onExpandableItemToggle, expandButtonLabel, collapseButtonLabel, verticalAlign, resizableColumns, resizableStyle, isEditable, isEditing, isEditingDisabled, hasSuccessIcon } = _a, rest = __rest(_a, ["children", "wrapLines", "isRowHeader", "isFirstRow", "isLastRow", "isSelected", "isNextSelected", "isPrevSelected", "nativeAttributes", "onClick", "onFocus", "onBlur", "isEvenRow", "stripedRows", "isSelection", "hasSelection", "hasFooter", "columnId", "colIndex", "stickyState", "tableRole", "level", "isExpandable", "isExpanded", "onExpandableItemToggle", "expandButtonLabel", "collapseButtonLabel", "verticalAlign", "resizableColumns", "resizableStyle", "isEditable", "isEditing", "isEditingDisabled", "hasSuccessIcon"]);
|
|
17
|
+
var { children, wrapLines, isRowHeader, isFirstRow, isLastRow, isSelected, isNextSelected, isPrevSelected, nativeAttributes, onClick, onFocus, onBlur, isEvenRow, stripedRows, isSelection, hasSelection, hasFooter, columnId, colIndex, stickyState, tableRole, level, isExpandable, isExpanded, onExpandableItemToggle, expandButtonLabel, collapseButtonLabel, verticalAlign, resizableColumns, resizableStyle, isEditable, isEditing, isEditingDisabled, hasSuccessIcon, tableVariant } = _a, rest = __rest(_a, ["children", "wrapLines", "isRowHeader", "isFirstRow", "isLastRow", "isSelected", "isNextSelected", "isPrevSelected", "nativeAttributes", "onClick", "onFocus", "onBlur", "isEvenRow", "stripedRows", "isSelection", "hasSelection", "hasFooter", "columnId", "colIndex", "stickyState", "tableRole", "level", "isExpandable", "isExpanded", "onExpandableItemToggle", "expandButtonLabel", "collapseButtonLabel", "verticalAlign", "resizableColumns", "resizableStyle", "isEditable", "isEditing", "isEditingDisabled", "hasSuccessIcon", "tableVariant"]);
|
|
18
18
|
const Element = isRowHeader ? 'th' : 'td';
|
|
19
19
|
const isVisualRefresh = useVisualRefresh();
|
|
20
20
|
resizableStyle = resizableColumns ? {} : resizableStyle;
|
|
@@ -28,7 +28,7 @@ export const TableTdElement = React.forwardRef((_a, ref) => {
|
|
|
28
28
|
const mergedRef = useMergeRefs(stickyStyles.ref, ref, cellRefObject);
|
|
29
29
|
const { tabIndex: cellTabIndex } = useSingleTabStopNavigation(cellRefObject);
|
|
30
30
|
const isEditingActive = isEditing && !isEditingDisabled;
|
|
31
|
-
return (React.createElement(Element, Object.assign({ style: Object.assign(Object.assign({}, resizableStyle), stickyStyles.style), className: clsx(styles['body-cell'], isFirstRow && styles['body-cell-first-row'], isLastRow && styles['body-cell-last-row'], isSelected && styles['body-cell-selected'], isNextSelected && styles['body-cell-next-selected'], isPrevSelected && styles['body-cell-prev-selected'], !isEvenRow && stripedRows && styles['body-cell-shaded'], stripedRows && styles['has-striped-rows'], isVisualRefresh && styles['is-visual-refresh'], isSelection && tableStyles['selection-control'], hasSelection && styles['has-selection'], hasFooter && styles['has-footer'], resizableColumns && styles['resizable-columns'], verticalAlign === 'top' && styles['body-cell-align-top'], isEditable && styles['body-cell-editable'], isEditing && !isEditingDisabled && styles['body-cell-edit-active'], isEditing && isEditingDisabled && styles['body-cell-edit-disabled-popover'], hasSuccessIcon && styles['body-cell-has-success'], level !== undefined && !isEditingActive && styles['body-cell-expandable'], level !== undefined && !isEditingActive && styles[`expandable-level-${getLevelClassSuffix(level)}`], stickyStyles.className), onClick: onClick, onFocus: onFocus, onBlur: onBlur, ref: mergedRef }, nativeAttributes, { tabIndex: cellTabIndex === -1 ? undefined : cellTabIndex }, copyAnalyticsMetadataAttribute(rest)),
|
|
31
|
+
return (React.createElement(Element, Object.assign({ style: Object.assign(Object.assign({}, resizableStyle), stickyStyles.style), className: clsx(styles['body-cell'], isFirstRow && styles['body-cell-first-row'], isLastRow && styles['body-cell-last-row'], isSelected && styles['body-cell-selected'], isNextSelected && styles['body-cell-next-selected'], isPrevSelected && styles['body-cell-prev-selected'], !isEvenRow && stripedRows && styles['body-cell-shaded'], stripedRows && styles['has-striped-rows'], isVisualRefresh && styles['is-visual-refresh'], isSelection && tableStyles['selection-control'], hasSelection && styles['has-selection'], hasFooter && styles['has-footer'], resizableColumns && styles['resizable-columns'], verticalAlign === 'top' && styles['body-cell-align-top'], isEditable && styles['body-cell-editable'], isEditing && !isEditingDisabled && styles['body-cell-edit-active'], isEditing && isEditingDisabled && styles['body-cell-edit-disabled-popover'], hasSuccessIcon && styles['body-cell-has-success'], level !== undefined && !isEditingActive && styles['body-cell-expandable'], level !== undefined && !isEditingActive && styles[`expandable-level-${getLevelClassSuffix(level)}`], tableVariant && styles[`table-variant-${tableVariant}`], stickyStyles.className), onClick: onClick, onFocus: onFocus, onBlur: onBlur, ref: mergedRef }, nativeAttributes, { tabIndex: cellTabIndex === -1 ? undefined : cellTabIndex }, copyAnalyticsMetadataAttribute(rest)),
|
|
32
32
|
level !== undefined && isExpandable && !isEditingActive && (React.createElement("div", { className: styles['expandable-toggle-wrapper'] },
|
|
33
33
|
React.createElement(ExpandToggleButton, { isExpanded: isExpanded, onExpandableItemToggle: onExpandableItemToggle, expandButtonLabel: expandButtonLabel, collapseButtonLabel: collapseButtonLabel }))),
|
|
34
34
|
React.createElement("div", { className: clsx(styles['body-cell-content'], wrapLines && styles['body-cell-wrap']) }, children)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"td-element.js","sourceRoot":"","sources":["../../../../src/table/body-cell/td-element.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,8BAA8B,EAAE,MAAM,kEAAkE,CAAC;AAElH,OAAO,EAAE,0BAA0B,EAAE,MAAM,2DAA2D,CAAC;AACvG,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,EAAsB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAa,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,MAAM,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"td-element.js","sourceRoot":"","sources":["../../../../src/table/body-cell/td-element.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,8BAA8B,EAAE,MAAM,kEAAkE,CAAC;AAElH,OAAO,EAAE,0BAA0B,EAAE,MAAM,2DAA2D,CAAC;AACvG,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,EAAsB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAa,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AA2CrC,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAC5C,CACE,EAqCC,EACD,GAAG,EACH,EAAE;QAvCF,EACE,QAAQ,EACR,SAAS,EACT,WAAW,EACX,UAAU,EACV,SAAS,EACT,UAAU,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,MAAM,EACN,SAAS,EACT,WAAW,EACX,WAAW,EACX,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,SAAS,EACT,KAAK,EACL,YAAY,EACZ,UAAU,EACV,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV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IACjB,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,sBAAsB,EAC9C,iBAAiB,EAAE,iBAAiB,EACpC,mBAAmB,EAAE,mBAAmB,GACxC,CACE,CACP;QAED,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,SAAS,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAC,IAAG,QAAQ,CAAO,CAClG,CACX,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,CAAC,IAAI,KAAK,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;AACnD,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\nimport { copyAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { useSingleTabStopNavigation } from '../../internal/context/single-tab-stop-navigation-context';\nimport { useVisualRefresh } from '../../internal/hooks/use-visual-mode';\nimport { ColumnWidthStyle } from '../column-widths-utils';\nimport { ExpandToggleButton } from '../expandable-rows/expand-toggle-button';\nimport { TableProps } from '../interfaces.js';\nimport { StickyColumnsModel, useStickyCellStyles } from '../sticky-columns';\nimport { getTableCellRoleProps, TableRole } from '../table-role';\nimport { getStickyClassNames } from '../utils';\n\nimport tableStyles from '../styles.css.js';\nimport styles from './styles.css.js';\n\nexport interface TableTdElementProps {\n wrapLines: boolean | undefined;\n isRowHeader?: boolean;\n isFirstRow: boolean;\n isLastRow: boolean;\n isSelected: boolean;\n isNextSelected: boolean;\n isPrevSelected: boolean;\n nativeAttributes?: Omit<\n React.TdHTMLAttributes<HTMLTableCellElement> | React.ThHTMLAttributes<HTMLTableCellElement>,\n 'style' | 'className' | 'onClick'\n >;\n onClick?: () => void;\n onFocus?: () => void;\n onBlur?: () => void;\n children?: React.ReactNode;\n isEvenRow?: boolean;\n stripedRows?: boolean;\n isSelection?: boolean;\n hasSelection?: boolean;\n hasFooter?: boolean;\n columnId: PropertyKey;\n colIndex: number;\n stickyState: StickyColumnsModel;\n tableRole: TableRole;\n level?: number;\n isExpandable?: boolean;\n isExpanded?: boolean;\n onExpandableItemToggle?: () => void;\n expandButtonLabel?: string;\n collapseButtonLabel?: string;\n verticalAlign?: TableProps.VerticalAlign;\n resizableColumns?: boolean;\n resizableStyle?: ColumnWidthStyle;\n isEditable: boolean;\n isEditing: boolean;\n isEditingDisabled?: boolean;\n hasSuccessIcon?: boolean;\n tableVariant?: string;\n}\n\nexport const TableTdElement = React.forwardRef<HTMLTableCellElement, TableTdElementProps>(\n (\n {\n children,\n wrapLines,\n isRowHeader,\n isFirstRow,\n isLastRow,\n isSelected,\n isNextSelected,\n isPrevSelected,\n nativeAttributes,\n onClick,\n onFocus,\n onBlur,\n isEvenRow,\n stripedRows,\n isSelection,\n hasSelection,\n hasFooter,\n columnId,\n colIndex,\n stickyState,\n tableRole,\n level,\n isExpandable,\n isExpanded,\n onExpandableItemToggle,\n expandButtonLabel,\n collapseButtonLabel,\n verticalAlign,\n resizableColumns,\n resizableStyle,\n isEditable,\n isEditing,\n isEditingDisabled,\n hasSuccessIcon,\n tableVariant,\n ...rest\n },\n ref\n ) => {\n const Element = isRowHeader ? 'th' : 'td';\n const isVisualRefresh = useVisualRefresh();\n\n resizableStyle = resizableColumns ? {} : resizableStyle;\n\n nativeAttributes = { ...nativeAttributes, ...getTableCellRoleProps({ tableRole, isRowHeader, colIndex }) };\n\n const stickyStyles = useStickyCellStyles({\n stickyColumns: stickyState,\n columnId,\n getClassName: props => getStickyClassNames(styles, props),\n });\n\n const cellRefObject = useRef<HTMLTableCellElement>(null);\n const mergedRef = useMergeRefs(stickyStyles.ref, ref, cellRefObject);\n const { tabIndex: cellTabIndex } = useSingleTabStopNavigation(cellRefObject);\n const isEditingActive = isEditing && !isEditingDisabled;\n\n return (\n <Element\n style={{ ...resizableStyle, ...stickyStyles.style }}\n className={clsx(\n styles['body-cell'],\n isFirstRow && styles['body-cell-first-row'],\n isLastRow && styles['body-cell-last-row'],\n isSelected && styles['body-cell-selected'],\n isNextSelected && styles['body-cell-next-selected'],\n isPrevSelected && styles['body-cell-prev-selected'],\n !isEvenRow && stripedRows && styles['body-cell-shaded'],\n stripedRows && styles['has-striped-rows'],\n isVisualRefresh && styles['is-visual-refresh'],\n isSelection && tableStyles['selection-control'],\n hasSelection && styles['has-selection'],\n hasFooter && styles['has-footer'],\n resizableColumns && styles['resizable-columns'],\n verticalAlign === 'top' && styles['body-cell-align-top'],\n isEditable && styles['body-cell-editable'],\n isEditing && !isEditingDisabled && styles['body-cell-edit-active'],\n isEditing && isEditingDisabled && styles['body-cell-edit-disabled-popover'],\n hasSuccessIcon && styles['body-cell-has-success'],\n level !== undefined && !isEditingActive && styles['body-cell-expandable'],\n level !== undefined && !isEditingActive && styles[`expandable-level-${getLevelClassSuffix(level)}`],\n tableVariant && styles[`table-variant-${tableVariant}`],\n stickyStyles.className\n )}\n onClick={onClick}\n onFocus={onFocus}\n onBlur={onBlur}\n ref={mergedRef}\n {...nativeAttributes}\n tabIndex={cellTabIndex === -1 ? undefined : cellTabIndex}\n {...copyAnalyticsMetadataAttribute(rest)}\n >\n {level !== undefined && isExpandable && !isEditingActive && (\n <div className={styles['expandable-toggle-wrapper']}>\n <ExpandToggleButton\n isExpanded={isExpanded}\n onExpandableItemToggle={onExpandableItemToggle}\n expandButtonLabel={expandButtonLabel}\n collapseButtonLabel={collapseButtonLabel}\n />\n </div>\n )}\n\n <div className={clsx(styles['body-cell-content'], wrapLines && styles['body-cell-wrap'])}>{children}</div>\n </Element>\n );\n }\n);\n\nfunction getLevelClassSuffix(level: number) {\n return 0 <= level && level <= 9 ? level : 'next';\n}\n"]}
|
|
@@ -30,6 +30,7 @@ export interface TableHeaderCellProps<ItemType> {
|
|
|
30
30
|
isExpandable?: boolean;
|
|
31
31
|
hasDynamicContent?: boolean;
|
|
32
32
|
variant: TableProps.Variant;
|
|
33
|
+
tableVariant?: string;
|
|
33
34
|
}
|
|
34
35
|
export declare function TableHeaderCell<ItemType>({
|
|
35
36
|
tabIndex,
|
|
@@ -57,5 +58,6 @@ export declare function TableHeaderCell<ItemType>({
|
|
|
57
58
|
resizerRoleDescription,
|
|
58
59
|
isExpandable,
|
|
59
60
|
hasDynamicContent,
|
|
60
|
-
variant
|
|
61
|
+
variant,
|
|
62
|
+
tableVariant
|
|
61
63
|
}: TableHeaderCellProps<ItemType>): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/table/header-cell/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAWtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAO1C,MAAM,WAAW,oBAAoB,CAAC,QAAQ;IAC5C,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,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB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AY,EACZ,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,UAAU,EACV,QAAQ,EACR,WAAW,EACX,OAAO,EACP,SAAS,EACT,sBAAsB,EACtB,YAAY,EACZ,iBAAiB,EACjB,OAAO,EACP,YAAY,GACb,EAAE,oBAAoB,CAAC,QAAQ,CAAC,eAqIhC"}
|
|
@@ -13,7 +13,7 @@ import { TableThElement } from './th-element';
|
|
|
13
13
|
import { getSortingIconName, getSortingStatus, isSorted } from './utils';
|
|
14
14
|
import analyticsSelectors from '../analytics-metadata/styles.css.js';
|
|
15
15
|
import styles from './styles.css.js';
|
|
16
|
-
export function TableHeaderCell({ tabIndex, column, activeSortingColumn, sortingDescending, sortingDisabled, wrapLines, focusedComponent, stuck, sticky, hidden, stripedRows, onClick, colIndex, updateColumn, resizableColumns, resizableStyle, onResizeFinish, isEditable, columnId, stickyState, cellRef, tableRole, resizerRoleDescription, isExpandable, hasDynamicContent, variant, }) {
|
|
16
|
+
export function TableHeaderCell({ tabIndex, column, activeSortingColumn, sortingDescending, sortingDisabled, wrapLines, focusedComponent, stuck, sticky, hidden, stripedRows, onClick, colIndex, updateColumn, resizableColumns, resizableStyle, onResizeFinish, isEditable, columnId, stickyState, cellRef, tableRole, resizerRoleDescription, isExpandable, hasDynamicContent, variant, tableVariant, }) {
|
|
17
17
|
var _a;
|
|
18
18
|
const i18n = useInternalI18n('table');
|
|
19
19
|
const sortable = !!column.sortingComparator || !!column.sortingField;
|
|
@@ -46,7 +46,7 @@ export function TableHeaderCell({ tabIndex, column, activeSortingColumn, sorting
|
|
|
46
46
|
useResizeObserver(hasDynamicContent ? cellRefObject : () => null, entry => {
|
|
47
47
|
updateColumn(columnId, entry.borderBoxWidth);
|
|
48
48
|
});
|
|
49
|
-
return (React.createElement(TableThElement, Object.assign({ resizableStyle: resizableStyle, cellRef: cellRefCombined, sortingStatus: sortingStatus, sortingDisabled: sortingDisabled, focusedComponent: focusedComponent, stuck: stuck, sticky: sticky, hidden: hidden, stripedRows: stripedRows, colIndex: colIndex, columnId: columnId, stickyState: stickyState, tableRole: tableRole, variant: variant }, (sortingDisabled
|
|
49
|
+
return (React.createElement(TableThElement, Object.assign({ resizableStyle: resizableStyle, cellRef: cellRefCombined, sortingStatus: sortingStatus, sortingDisabled: sortingDisabled, focusedComponent: focusedComponent, stuck: stuck, sticky: sticky, hidden: hidden, stripedRows: stripedRows, colIndex: colIndex, columnId: columnId, stickyState: stickyState, tableRole: tableRole, variant: variant, tableVariant: tableVariant }, (sortingDisabled
|
|
50
50
|
? {}
|
|
51
51
|
: getAnalyticsMetadataAttribute({
|
|
52
52
|
action: 'sort',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table/header-cell/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC7G,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,2DAA2D,CAAC;AACvG,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAIjD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEzE,OAAO,kBAAkB,MAAM,qCAAqC,CAAC;AACrE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AA+BrC,MAAM,U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AAE,IAAI,CAAC,gDAAgD,EAAE,MAAA,MAAM,CAAC,UAAU,0CAAE,iBAAiB,CAAC,GACvG,CACG,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,CAAC,CAAC,CAAC,CAClB,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,EAC3F,eAAe,EAAE,IAAI,CAAC,mCAAmC,EAAE,sBAAsB,CAAC,GAClF,CACH,CAAC,CAAC,CAAC,CACF,oBAAC,OAAO,IAAC,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,GAAI,CACjD,CACc,CAClB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useResizeObserver, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { useInternalI18n } from '../../i18n/context';\nimport InternalIcon from '../../icon/internal';\nimport { useSingleTabStopNavigation } from '../../internal/context/single-tab-stop-navigation-context';\nimport { KeyCode } from '../../internal/keycode';\nimport { GeneratedAnalyticsMetadataTableSort } from '../analytics-metadata/interfaces';\nimport { ColumnWidthStyle } from '../column-widths-utils';\nimport { TableProps } from '../interfaces';\nimport { Divider, Resizer } from '../resizer';\nimport { StickyColumnsModel } from '../sticky-columns';\nimport { TableRole } from '../table-role';\nimport { TableThElement } from './th-element';\nimport { getSortingIconName, getSortingStatus, isSorted } from './utils';\n\nimport analyticsSelectors from '../analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\nexport interface TableHeaderCellProps<ItemType> {\n tabIndex: number;\n column: TableProps.ColumnDefinition<ItemType>;\n activeSortingColumn?: TableProps.SortingColumn<ItemType>;\n sortingDescending?: boolean;\n sortingDisabled?: boolean;\n wrapLines?: boolean;\n stuck?: boolean;\n sticky?: boolean;\n hidden?: boolean;\n stripedRows?: 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 resizableStyle?: ColumnWidthStyle;\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 isExpandable?: boolean;\n hasDynamicContent?: boolean;\n variant: TableProps.Variant;\n}\n\nexport function TableHeaderCell<ItemType>({\n tabIndex,\n column,\n activeSortingColumn,\n sortingDescending,\n sortingDisabled,\n wrapLines,\n focusedComponent,\n stuck,\n sticky,\n hidden,\n stripedRows,\n onClick,\n colIndex,\n updateColumn,\n resizableColumns,\n resizableStyle,\n onResizeFinish,\n isEditable,\n columnId,\n stickyState,\n cellRef,\n tableRole,\n resizerRoleDescription,\n isExpandable,\n hasDynamicContent,\n variant,\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 const clickableHeaderRef = useRef<HTMLDivElement>(null);\n const { tabIndex: clickableHeaderTabIndex } = useSingleTabStopNavigation(clickableHeaderRef, { tabIndex });\n\n const cellRefObject = useRef<HTMLElement>(null);\n const cellRefCombined = useMergeRefs(cellRef, cellRefObject);\n\n // Keep sticky and non-sticky headers in sync for dynamic cell\n // content changes. This is only needed when:\n // - Column has dynamic content\n // - This is the non-sticky version of a sticky header (hidden === true)\n // - Columns are not resizable\n useResizeObserver(hasDynamicContent ? cellRefObject : () => null, entry => {\n updateColumn(columnId, entry.borderBoxWidth);\n });\n\n return (\n <TableThElement\n resizableStyle={resizableStyle}\n cellRef={cellRefCombined}\n sortingStatus={sortingStatus}\n sortingDisabled={sortingDisabled}\n focusedComponent={focusedComponent}\n stuck={stuck}\n sticky={sticky}\n hidden={hidden}\n stripedRows={stripedRows}\n colIndex={colIndex}\n columnId={columnId}\n stickyState={stickyState}\n tableRole={tableRole}\n variant={variant}\n {...(sortingDisabled\n ? {}\n : getAnalyticsMetadataAttribute({\n action: 'sort',\n detail: {\n position: `${colIndex + 1}`,\n columnId: column.id ? `${column.id}` : '',\n label: `.${analyticsSelectors['header-cell-text']}`,\n sortingDescending: `${!sortingDescending}`,\n },\n } as GeneratedAnalyticsMetadataTableSort))}\n >\n <div\n ref={clickableHeaderRef}\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 [styles['header-cell-content-expandable']]: isExpandable,\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: clickableHeaderTabIndex,\n role: 'button',\n onClick: handleClick,\n }\n : {})}\n >\n <div\n className={clsx(\n styles['header-cell-text'],\n analyticsSelectors['header-cell-text'],\n wrapLines && styles['header-cell-text-wrap']\n )}\n id={headerId}\n >\n {column.header}\n {isEditable ? (\n <span className={styles['edit-icon']}>\n <InternalIcon\n name=\"edit\"\n ariaLabel={i18n('columnDefinitions.editConfig.editIconAriaLabel', column.editConfig?.editIconAriaLabel)}\n />\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 <Divider className={styles['resize-divider']} />\n )}\n </TableThElement>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table/header-cell/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OA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AE,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,EAC3F,eAAe,EAAE,IAAI,CAAC,mCAAmC,EAAE,sBAAsB,CAAC,GAClF,CACH,CAAC,CAAC,CAAC,CACF,oBAAC,OAAO,IAAC,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,GAAI,CACjD,CACc,CAClB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useResizeObserver, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { useInternalI18n } from '../../i18n/context';\nimport InternalIcon from '../../icon/internal';\nimport { useSingleTabStopNavigation } from '../../internal/context/single-tab-stop-navigation-context';\nimport { KeyCode } from '../../internal/keycode';\nimport { GeneratedAnalyticsMetadataTableSort } from '../analytics-metadata/interfaces';\nimport { ColumnWidthStyle } from '../column-widths-utils';\nimport { TableProps } from '../interfaces';\nimport { Divider, Resizer } from '../resizer';\nimport { StickyColumnsModel } from '../sticky-columns';\nimport { TableRole } from '../table-role';\nimport { TableThElement } from './th-element';\nimport { getSortingIconName, getSortingStatus, isSorted } from './utils';\n\nimport analyticsSelectors from '../analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\nexport interface TableHeaderCellProps<ItemType> {\n tabIndex: number;\n column: TableProps.ColumnDefinition<ItemType>;\n activeSortingColumn?: TableProps.SortingColumn<ItemType>;\n sortingDescending?: boolean;\n sortingDisabled?: boolean;\n wrapLines?: boolean;\n stuck?: boolean;\n sticky?: boolean;\n hidden?: boolean;\n stripedRows?: 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 resizableStyle?: ColumnWidthStyle;\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 isExpandable?: boolean;\n hasDynamicContent?: boolean;\n variant: TableProps.Variant;\n tableVariant?: string;\n}\n\nexport function TableHeaderCell<ItemType>({\n tabIndex,\n column,\n activeSortingColumn,\n sortingDescending,\n sortingDisabled,\n wrapLines,\n focusedComponent,\n stuck,\n sticky,\n hidden,\n stripedRows,\n onClick,\n colIndex,\n updateColumn,\n resizableColumns,\n resizableStyle,\n onResizeFinish,\n isEditable,\n columnId,\n stickyState,\n cellRef,\n tableRole,\n resizerRoleDescription,\n isExpandable,\n hasDynamicContent,\n variant,\n tableVariant,\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 const clickableHeaderRef = useRef<HTMLDivElement>(null);\n const { tabIndex: clickableHeaderTabIndex } = useSingleTabStopNavigation(clickableHeaderRef, { tabIndex });\n\n const cellRefObject = useRef<HTMLElement>(null);\n const cellRefCombined = useMergeRefs(cellRef, cellRefObject);\n\n // Keep sticky and non-sticky headers in sync for dynamic cell\n // content changes. This is only needed when:\n // - Column has dynamic content\n // - This is the non-sticky version of a sticky header (hidden === true)\n // - Columns are not resizable\n useResizeObserver(hasDynamicContent ? cellRefObject : () => null, entry => {\n updateColumn(columnId, entry.borderBoxWidth);\n });\n\n return (\n <TableThElement\n resizableStyle={resizableStyle}\n cellRef={cellRefCombined}\n sortingStatus={sortingStatus}\n sortingDisabled={sortingDisabled}\n focusedComponent={focusedComponent}\n stuck={stuck}\n sticky={sticky}\n hidden={hidden}\n stripedRows={stripedRows}\n colIndex={colIndex}\n columnId={columnId}\n stickyState={stickyState}\n tableRole={tableRole}\n variant={variant}\n tableVariant={tableVariant}\n {...(sortingDisabled\n ? {}\n : getAnalyticsMetadataAttribute({\n action: 'sort',\n detail: {\n position: `${colIndex + 1}`,\n columnId: column.id ? `${column.id}` : '',\n label: `.${analyticsSelectors['header-cell-text']}`,\n sortingDescending: `${!sortingDescending}`,\n },\n } as GeneratedAnalyticsMetadataTableSort))}\n >\n <div\n ref={clickableHeaderRef}\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 [styles['header-cell-content-expandable']]: isExpandable,\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: clickableHeaderTabIndex,\n role: 'button',\n onClick: handleClick,\n }\n : {})}\n >\n <div\n className={clsx(\n styles['header-cell-text'],\n analyticsSelectors['header-cell-text'],\n wrapLines && styles['header-cell-text-wrap']\n )}\n id={headerId}\n >\n {column.header}\n {isEditable ? (\n <span className={styles['edit-icon']}>\n <InternalIcon\n name=\"edit\"\n ariaLabel={i18n('columnDefinitions.editConfig.editIconAriaLabel', column.editConfig?.editIconAriaLabel)}\n />\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 <Divider className={styles['resize-divider']} />\n )}\n </TableThElement>\n );\n}\n"]}
|
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"header-cell": "awsui_header-
|
|
5
|
-
"header-cell-fake-focus": "awsui_header-cell-fake-
|
|
6
|
-
"header-cell-sticky": "awsui_header-cell-
|
|
7
|
-
"header-cell-stuck": "awsui_header-cell-
|
|
8
|
-
"header-cell-variant-full-page": "awsui_header-cell-variant-full-
|
|
9
|
-
"header-cell-hidden": "awsui_header-cell-
|
|
10
|
-
"header-cell-variant-embedded": "awsui_header-cell-variant-
|
|
11
|
-
"is-visual-refresh": "awsui_is-visual-
|
|
12
|
-
"sticky-cell": "awsui_sticky-
|
|
13
|
-
"header-cell-variant-borderless": "awsui_header-cell-variant-
|
|
14
|
-
"header-cell-sortable": "awsui_header-cell-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"header-cell-content
|
|
24
|
-
"header-cell-
|
|
25
|
-
"header-cell-
|
|
26
|
-
"header-cell-
|
|
27
|
-
"header-cell-text
|
|
28
|
-
"header-cell-
|
|
29
|
-
"header-cell-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
4
|
+
"header-cell": "awsui_header-cell_1spae_xv9cn_149",
|
|
5
|
+
"header-cell-fake-focus": "awsui_header-cell-fake-focus_1spae_xv9cn_183",
|
|
6
|
+
"header-cell-sticky": "awsui_header-cell-sticky_1spae_xv9cn_204",
|
|
7
|
+
"header-cell-stuck": "awsui_header-cell-stuck_1spae_xv9cn_207",
|
|
8
|
+
"header-cell-variant-full-page": "awsui_header-cell-variant-full-page_1spae_xv9cn_207",
|
|
9
|
+
"header-cell-hidden": "awsui_header-cell-hidden_1spae_xv9cn_213",
|
|
10
|
+
"header-cell-variant-embedded": "awsui_header-cell-variant-embedded_1spae_xv9cn_216",
|
|
11
|
+
"is-visual-refresh": "awsui_is-visual-refresh_1spae_xv9cn_216",
|
|
12
|
+
"sticky-cell": "awsui_sticky-cell_1spae_xv9cn_216",
|
|
13
|
+
"header-cell-variant-borderless": "awsui_header-cell-variant-borderless_1spae_xv9cn_216",
|
|
14
|
+
"header-cell-sortable": "awsui_header-cell-sortable_1spae_xv9cn_219",
|
|
15
|
+
"table-variant-full-page": "awsui_table-variant-full-page_1spae_xv9cn_240",
|
|
16
|
+
"sticky-cell-pad-left": "awsui_sticky-cell-pad-left_1spae_xv9cn_243",
|
|
17
|
+
"has-selection": "awsui_has-selection_1spae_xv9cn_243",
|
|
18
|
+
"sticky-cell-last-inline-start": "awsui_sticky-cell-last-inline-start_1spae_xv9cn_246",
|
|
19
|
+
"resize-divider": "awsui_resize-divider_1spae_xv9cn_251",
|
|
20
|
+
"sticky-cell-last-inline-end": "awsui_sticky-cell-last-inline-end_1spae_xv9cn_258",
|
|
21
|
+
"sorting-icon": "awsui_sorting-icon_1spae_xv9cn_268",
|
|
22
|
+
"edit-icon": "awsui_edit-icon_1spae_xv9cn_276",
|
|
23
|
+
"header-cell-content": "awsui_header-cell-content_1spae_xv9cn_282",
|
|
24
|
+
"header-cell-content-expandable": "awsui_header-cell-content-expandable_1spae_xv9cn_288",
|
|
25
|
+
"header-cell-disabled": "awsui_header-cell-disabled_1spae_xv9cn_340",
|
|
26
|
+
"header-cell-sorted": "awsui_header-cell-sorted_1spae_xv9cn_340",
|
|
27
|
+
"header-cell-text": "awsui_header-cell-text_1spae_xv9cn_354",
|
|
28
|
+
"header-cell-text-wrap": "awsui_header-cell-text-wrap_1spae_xv9cn_358",
|
|
29
|
+
"header-cell-ascending": "awsui_header-cell-ascending_1spae_xv9cn_364",
|
|
30
|
+
"header-cell-descending": "awsui_header-cell-descending_1spae_xv9cn_365",
|
|
31
|
+
"has-striped-rows": "awsui_has-striped-rows_1spae_xv9cn_479",
|
|
32
|
+
"sticky-cell-pad-inline-start": "awsui_sticky-cell-pad-inline-start_1spae_xv9cn_479"
|
|
32
33
|
};
|
|
33
34
|
|