carbon-components-angular 3.16.3 → 3.17.3
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/docs/documentation/classes/DataGridInteractionModel.html +1462 -0
- package/docs/documentation/classes/NumberChange.html +8 -7
- package/docs/documentation/classes/TableAdapter.html +852 -0
- package/docs/documentation/classes/TableCellAdapter.html +445 -0
- package/docs/documentation/classes/TableDomAdapter.html +968 -0
- package/docs/documentation/classes/TableHeaderItem.html +125 -64
- package/docs/documentation/classes/TableItem.html +5 -18
- package/docs/documentation/classes/TableModel.html +445 -180
- package/docs/documentation/classes/TableRowAdapter.html +445 -0
- package/docs/documentation/components/Accordion.html +2 -2
- package/docs/documentation/components/AccordionItem.html +2 -2
- package/docs/documentation/components/AlertModal.html +2 -2
- package/docs/documentation/components/Breadcrumb.html +2 -2
- package/docs/documentation/components/BreadcrumbItemComponent.html +2 -2
- package/docs/documentation/components/Checkbox.html +2 -2
- package/docs/documentation/components/ClickableTile.html +2 -2
- package/docs/documentation/components/CodeSnippet.html +2 -2
- package/docs/documentation/components/ComboBox.html +2 -2
- package/docs/documentation/components/ContentSwitcher.html +2 -2
- package/docs/documentation/components/DatePicker.html +2 -2
- package/docs/documentation/components/DatePickerInput.html +2 -2
- package/docs/documentation/components/Dialog.html +2 -2
- package/docs/documentation/components/DialogPlaceholder.html +2 -2
- package/docs/documentation/components/Documentation.html +2 -2
- package/docs/documentation/components/Dropdown.html +12 -7
- package/docs/documentation/components/DropdownList.html +2 -2
- package/docs/documentation/components/ExpandableTile.html +2 -2
- package/docs/documentation/components/File.html +51 -8
- package/docs/documentation/components/FileUploader.html +41 -29
- package/docs/documentation/components/Hamburger.html +2 -2
- package/docs/documentation/components/Header.html +430 -13
- package/docs/documentation/components/HeaderAction.html +8 -10
- package/docs/documentation/components/HeaderGlobal.html +2 -2
- package/docs/documentation/components/HeaderItem.html +2 -2
- package/docs/documentation/components/HeaderMenu.html +2 -2
- package/docs/documentation/components/HeaderNavigation.html +2 -2
- package/docs/documentation/components/InlineLoading.html +2 -2
- package/docs/documentation/components/Label.html +2 -2
- package/docs/documentation/components/ListColumn.html +2 -2
- package/docs/documentation/components/ListHeader.html +2 -2
- package/docs/documentation/components/ListRow.html +2 -2
- package/docs/documentation/components/Loading.html +2 -2
- package/docs/documentation/components/Modal.html +2 -2
- package/docs/documentation/components/ModalFooter.html +2 -2
- package/docs/documentation/components/ModalHeader.html +2 -2
- package/docs/documentation/components/ModalPlaceholder.html +2 -2
- package/docs/documentation/components/Notification.html +39 -7
- package/docs/documentation/components/{Number.html → NumberComponent.html} +14 -13
- package/docs/documentation/components/OverflowMenu.html +2 -2
- package/docs/documentation/components/OverflowMenuOption.html +2 -2
- package/docs/documentation/components/OverflowMenuPane.html +2 -2
- package/docs/documentation/components/Overlay.html +2 -2
- package/docs/documentation/components/Pagination.html +2 -2
- package/docs/documentation/components/Panel.html +2 -2
- package/docs/documentation/components/Placeholder.html +2 -2
- package/docs/documentation/components/ProductSwitcher.html +2 -2
- package/docs/documentation/components/ProgressIndicator.html +2 -2
- package/docs/documentation/components/Radio.html +2 -2
- package/docs/documentation/components/RadioGroup.html +2 -2
- package/docs/documentation/components/Sample.html +2 -2
- package/docs/documentation/components/SampleSub.html +2 -2
- package/docs/documentation/components/Search.html +2 -2
- package/docs/documentation/components/Select.html +2 -2
- package/docs/documentation/components/SelectionTile.html +2 -2
- package/docs/documentation/components/SideNav.html +2 -2
- package/docs/documentation/components/SideNavHeader.html +2 -2
- package/docs/documentation/components/SideNavItem.html +2 -2
- package/docs/documentation/components/SideNavMenu.html +2 -2
- package/docs/documentation/components/Slider.html +2 -2
- package/docs/documentation/components/StructuredList.html +2 -2
- package/docs/documentation/components/SwitcherList.html +2 -2
- package/docs/documentation/components/SwitcherListItem.html +2 -2
- package/docs/documentation/components/Tab.html +2 -2
- package/docs/documentation/components/TabHeaders.html +34 -32
- package/docs/documentation/components/Table.html +1039 -1121
- package/docs/documentation/components/TableBody.html +1145 -0
- package/docs/documentation/components/TableCheckbox.html +828 -0
- package/docs/documentation/components/TableContainer.html +2 -2
- package/docs/documentation/components/TableData.html +307 -0
- package/docs/documentation/components/TableExpandButton.html +762 -0
- package/docs/documentation/components/TableExpandedRow.html +567 -0
- package/docs/documentation/components/TableHead.html +1549 -0
- package/docs/documentation/components/TableHeadCell.html +1307 -0
- package/docs/documentation/components/TableHeadCheckbox.html +792 -0
- package/docs/documentation/components/TableHeadExpand.html +292 -0
- package/docs/documentation/components/TableHeader.html +2 -2
- package/docs/documentation/components/TableRowComponent.html +1414 -0
- package/docs/documentation/components/TableToolbar.html +2 -2
- package/docs/documentation/components/TableToolbarActions.html +2 -2
- package/docs/documentation/components/TableToolbarContent.html +2 -2
- package/docs/documentation/components/TableToolbarSearch.html +2 -2
- package/docs/documentation/components/Tabs.html +2 -2
- package/docs/documentation/components/Tag.html +2 -2
- package/docs/documentation/components/TagFilter.html +2 -2
- package/docs/documentation/components/Tile.html +2 -2
- package/docs/documentation/components/TileGroup.html +2 -2
- package/docs/documentation/components/TimePicker.html +2 -2
- package/docs/documentation/components/TimePickerSelect.html +2 -2
- package/docs/documentation/components/Toast.html +79 -9
- package/docs/documentation/components/Toggle.html +2 -2
- package/docs/documentation/components/Tooltip.html +2 -2
- package/docs/documentation/components/TooltipDefinition.html +2 -2
- package/docs/documentation/components/TooltipIcon.html +2 -2
- package/docs/documentation/coverage.html +297 -25
- package/docs/documentation/directives/DataGridFocus.html +38 -117
- package/docs/documentation/directives/TableDirective.html +452 -0
- package/docs/documentation/graph/dependencies.dot +2 -4
- package/docs/documentation/images/coverage-badge-documentation.svg +1 -1
- package/docs/documentation/interfaces/DataGridPosition.html +490 -0
- package/docs/documentation/interfaces/FileItem.html +66 -0
- package/docs/documentation/interfaces/NotificationContent.html +39 -0
- package/docs/documentation/interfaces/TableTranslations.html +254 -455
- package/docs/documentation/interfaces/ToastContent.html +1 -0
- package/docs/documentation/js/menu-wc.js +1 -1
- package/docs/documentation/js/search/search_index.js +2 -2
- package/docs/documentation/modules/FileUploaderModule.html +3 -1
- package/docs/documentation/modules/NumberModule/dependencies.svg +30 -56
- package/docs/documentation/modules/NumberModule.html +32 -58
- package/docs/documentation/modules/TableModule/dependencies.svg +424 -160
- package/docs/documentation/modules/TableModule.html +575 -182
- package/docs/documentation/overview.html +4 -4
- package/docs/storybook/iframe.html +3 -3
- package/docs/storybook/{main.9e8069cf2ee0957ae098.bundle.js → main.edce6b8dbd74b486e13b.bundle.js} +4631 -2440
- package/docs/storybook/main.edce6b8dbd74b486e13b.bundle.js.map +1 -0
- package/docs/storybook/{runtime~main.9e8069cf2ee0957ae098.bundle.js → runtime~main.edce6b8dbd74b486e13b.bundle.js} +1 -1
- package/docs/storybook/{runtime~main.9e8069cf2ee0957ae098.bundle.js.map → runtime~main.edce6b8dbd74b486e13b.bundle.js.map} +1 -1
- package/docs/storybook/{vendors~main.9e8069cf2ee0957ae098.bundle.js → vendors~main.edce6b8dbd74b486e13b.bundle.js} +1 -1
- package/docs/storybook/{vendors~main.9e8069cf2ee0957ae098.bundle.js.map → vendors~main.edce6b8dbd74b486e13b.bundle.js.map} +1 -1
- package/dropdown/dropdown.component.js +4 -0
- package/dropdown/dropdown.component.js.map +1 -1
- package/file-uploader/file-item.interface.d.ts +2 -0
- package/file-uploader/file-item.interface.js.map +1 -1
- package/file-uploader/file-uploader.component.js +3 -1
- package/file-uploader/file-uploader.component.js.map +1 -1
- package/file-uploader/file-uploader.component.metadata.json +1 -1
- package/file-uploader/file-uploader.component.ngfactory.js +9 -8
- package/file-uploader/file-uploader.component.ngfactory.js.map +1 -1
- package/file-uploader/file-uploader.module.js +3 -1
- package/file-uploader/file-uploader.module.js.map +1 -1
- package/file-uploader/file-uploader.module.metadata.json +1 -1
- package/file-uploader/file-uploader.module.ngfactory.js +2 -1
- package/file-uploader/file-uploader.module.ngfactory.js.map +1 -1
- package/file-uploader/file-uploader.module.ngsummary.json +1 -1
- package/file-uploader/file.component.d.ts +1 -0
- package/file-uploader/file.component.js +10 -2
- package/file-uploader/file.component.js.map +1 -1
- package/file-uploader/file.component.metadata.json +1 -1
- package/file-uploader/file.component.ngfactory.js +19 -16
- package/file-uploader/file.component.ngfactory.js.map +1 -1
- package/file-uploader/file.component.ngsummary.json +1 -1
- package/index.ngsummary.json +1 -1
- package/notification/notification-content.interface.d.ts +1 -0
- package/notification/notification-content.interface.js.map +1 -1
- package/notification/notification.component.d.ts +1 -0
- package/notification/notification.component.js +7 -1
- package/notification/notification.component.js.map +1 -1
- package/notification/notification.component.metadata.json +1 -1
- package/notification/notification.component.ngfactory.js +1 -1
- package/notification/notification.component.ngsummary.json +1 -1
- package/notification/toast.component.d.ts +1 -0
- package/notification/toast.component.js +7 -1
- package/notification/toast.component.js.map +1 -1
- package/notification/toast.component.metadata.json +1 -1
- package/notification/toast.component.ngfactory.js +1 -1
- package/notification/toast.component.ngsummary.json +1 -1
- package/number-input/number.component.d.ts +3 -2
- package/number-input/number.component.js +21 -20
- package/number-input/number.component.js.map +1 -1
- package/package.json +1 -1
- package/table/body/table-body.component.d.ts +77 -0
- package/table/body/table-body.component.js +120 -0
- package/table/body/table-body.component.js.map +1 -0
- package/table/body/table-body.component.metadata.json +1 -0
- package/{utils/window-tools.d.ts → table/body/table-body.component.ngfactory.d.ts} +2 -2
- package/table/body/table-body.component.ngfactory.js +62 -0
- package/table/body/table-body.component.ngfactory.js.map +1 -0
- package/table/body/table-body.component.ngsummary.json +1 -0
- package/table/body/table-expanded-row.component.d.ts +28 -0
- package/table/body/table-expanded-row.component.js +58 -0
- package/table/body/table-expanded-row.component.js.map +1 -0
- package/table/body/table-expanded-row.component.metadata.json +1 -0
- package/table/body/table-expanded-row.component.ngfactory.d.ts +21 -0
- package/table/body/table-expanded-row.component.ngfactory.js +39 -0
- package/table/body/table-expanded-row.component.ngfactory.js.map +1 -0
- package/table/body/table-expanded-row.component.ngsummary.json +1 -0
- package/table/body/table-row.component.d.ts +85 -0
- package/table/body/table-row.component.js +163 -0
- package/table/body/table-row.component.js.map +1 -0
- package/table/body/table-row.component.metadata.json +1 -0
- package/table/body/table-row.component.ngfactory.d.ts +21 -0
- package/table/body/table-row.component.ngfactory.js +55 -0
- package/table/body/table-row.component.ngfactory.js.map +1 -0
- package/table/body/table-row.component.ngsummary.json +1 -0
- package/table/cell/table-checkbox.component.d.ts +56 -0
- package/table/cell/table-checkbox.component.js +80 -0
- package/table/cell/table-checkbox.component.js.map +1 -0
- package/table/cell/table-checkbox.component.metadata.json +1 -0
- package/table/cell/table-checkbox.component.ngfactory.d.ts +21 -0
- package/table/cell/table-checkbox.component.ngfactory.js +46 -0
- package/table/cell/table-checkbox.component.ngfactory.js.map +1 -0
- package/table/cell/table-checkbox.component.ngsummary.json +1 -0
- package/table/cell/table-data.component.d.ts +24 -0
- package/table/cell/table-data.component.js +40 -0
- package/table/cell/table-data.component.js.map +1 -0
- package/table/cell/table-data.component.metadata.json +1 -0
- package/table/cell/table-data.component.ngfactory.d.ts +21 -0
- package/table/cell/table-data.component.ngfactory.js +39 -0
- package/table/cell/table-data.component.ngfactory.js.map +1 -0
- package/table/cell/table-data.component.ngsummary.json +1 -0
- package/table/cell/table-expand-button.component.d.ts +43 -0
- package/table/cell/table-expand-button.component.js +83 -0
- package/table/cell/table-expand-button.component.js.map +1 -0
- package/table/cell/table-expand-button.component.metadata.json +1 -0
- package/table/cell/table-expand-button.component.ngfactory.d.ts +21 -0
- package/table/cell/table-expand-button.component.ngfactory.js +44 -0
- package/table/cell/table-expand-button.component.ngfactory.js.map +1 -0
- package/table/cell/table-expand-button.component.ngsummary.json +1 -0
- package/table/data-grid-focus.directive.d.ts +5 -1
- package/table/data-grid-focus.directive.js +17 -24
- package/table/data-grid-focus.directive.js.map +1 -1
- package/table/data-grid-focus.directive.metadata.json +1 -1
- package/table/data-grid-focus.directive.ngsummary.json +1 -1
- package/table/data-grid-interaction-model.class.d.ts +185 -0
- package/table/data-grid-interaction-model.class.js +269 -0
- package/table/data-grid-interaction-model.class.js.map +1 -0
- package/table/data-grid-interaction-model.class.metadata.json +1 -0
- package/table/data-grid-interaction-model.class.ngsummary.json +1 -0
- package/table/head/table-head-cell.component.d.ts +46 -0
- package/table/head/table-head-cell.component.js +117 -0
- package/table/head/table-head-cell.component.js.map +1 -0
- package/table/head/table-head-cell.component.metadata.json +1 -0
- package/table/head/table-head-cell.component.ngfactory.d.ts +21 -0
- package/table/head/table-head-cell.component.ngfactory.js +55 -0
- package/table/head/table-head-cell.component.ngfactory.js.map +1 -0
- package/table/head/table-head-cell.component.ngsummary.json +1 -0
- package/table/head/table-head-checkbox.component.d.ts +40 -0
- package/table/head/table-head-checkbox.component.js +75 -0
- package/table/head/table-head-checkbox.component.js.map +1 -0
- package/table/head/table-head-checkbox.component.metadata.json +1 -0
- package/table/head/table-head-checkbox.component.ngfactory.d.ts +21 -0
- package/table/head/table-head-checkbox.component.ngfactory.js +45 -0
- package/table/head/table-head-checkbox.component.ngfactory.js.map +1 -0
- package/table/head/table-head-checkbox.component.ngsummary.json +1 -0
- package/table/head/table-head-expand.component.d.ts +23 -0
- package/table/head/table-head-expand.component.js +39 -0
- package/table/head/table-head-expand.component.js.map +1 -0
- package/table/head/table-head-expand.component.metadata.json +1 -0
- package/table/head/table-head-expand.component.ngfactory.d.ts +21 -0
- package/table/head/table-head-expand.component.ngfactory.js +36 -0
- package/table/head/table-head-expand.component.ngfactory.js.map +1 -0
- package/table/head/table-head-expand.component.ngsummary.json +1 -0
- package/table/head/table-head.component.d.ts +77 -0
- package/table/head/table-head.component.js +157 -0
- package/table/head/table-head.component.js.map +1 -0
- package/table/head/table-head.component.metadata.json +1 -0
- package/table/head/table-head.component.ngfactory.d.ts +21 -0
- package/table/head/table-head.component.ngfactory.js +56 -0
- package/table/head/table-head.component.ngfactory.js.map +1 -0
- package/table/head/table-head.component.ngsummary.json +1 -0
- package/table/table-adapter.class.d.ts +149 -0
- package/table/table-adapter.class.js +210 -0
- package/table/table-adapter.class.js.map +1 -0
- package/table/table-adapter.class.metadata.json +1 -0
- package/table/table-adapter.class.ngsummary.json +1 -0
- package/table/table-header-item.class.d.ts +8 -35
- package/table/table-header-item.class.js +0 -17
- package/table/table-header-item.class.js.map +1 -1
- package/table/table-item.class.d.ts +0 -13
- package/table/table-item.class.js +0 -2
- package/table/table-item.class.js.map +1 -1
- package/table/table-model.class.d.ts +41 -105
- package/table/table-model.class.js +45 -73
- package/table/table-model.class.js.map +1 -1
- package/table/table-model.class.metadata.json +1 -1
- package/table/table-model.class.ngsummary.json +1 -1
- package/table/table.component.d.ts +45 -81
- package/table/table.component.js +191 -200
- package/table/table.component.js.map +1 -1
- package/table/table.component.metadata.json +1 -1
- package/table/table.component.ngfactory.js +30 -199
- package/table/table.component.ngfactory.js.map +1 -1
- package/table/table.component.ngsummary.json +1 -1
- package/table/table.directive.d.ts +33 -0
- package/table/table.directive.js +72 -0
- package/table/table.directive.js.map +1 -0
- package/table/table.directive.metadata.json +1 -0
- package/table/table.directive.ngfactory.js.map +1 -0
- package/table/table.directive.ngsummary.json +1 -0
- package/table/table.module.d.ts +25 -11
- package/table/table.module.js +60 -21
- package/table/table.module.js.map +1 -1
- package/table/table.module.metadata.json +1 -1
- package/table/table.module.ngfactory.js.map +1 -1
- package/table/table.module.ngsummary.json +1 -1
- package/tabs/tab-headers.component.js +1 -1
- package/tabs/tab-headers.component.js.map +1 -1
- package/tabs/tab-headers.component.metadata.json +1 -1
- package/tabs/tab-headers.component.ngfactory.js +1 -1
- package/tabs/tab-headers.component.ngfactory.js.map +1 -1
- package/ui-shell/header/header-action.component.js +1 -1
- package/ui-shell/header/header-action.component.js.map +1 -1
- package/ui-shell/header/header-action.component.metadata.json +1 -1
- package/ui-shell/header/header-action.component.ngfactory.js +5 -6
- package/ui-shell/header/header-action.component.ngfactory.js.map +1 -1
- package/ui-shell/header/header.component.d.ts +26 -1
- package/ui-shell/header/header.component.js +40 -5
- package/ui-shell/header/header.component.js.map +1 -1
- package/ui-shell/header/header.component.metadata.json +1 -1
- package/ui-shell/header/header.component.ngfactory.js +9 -3
- package/ui-shell/header/header.component.ngfactory.js.map +1 -1
- package/ui-shell/header/header.component.ngsummary.json +1 -1
- package/ui-shell/header/header.module.ngfactory.js.map +1 -1
- package/common/utils.d.ts +0 -35
- package/common/utils.js +0 -40
- package/common/utils.js.map +0 -1
- package/common/utils.metadata.json +0 -1
- package/common/utils.ngsummary.json +0 -1
- package/docs/storybook/main.9e8069cf2ee0957ae098.bundle.js.map +0 -1
- package/utils/window-tools.js +0 -46
- package/utils/window-tools.js.map +0 -1
- package/utils/window-tools.metadata.json +0 -1
- package/utils/window-tools.ngsummary.json +0 -1
|
@@ -0,0 +1,1462 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html class="no-js" lang="">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
6
|
+
<title>carbon-components-angular documentation</title>
|
|
7
|
+
<meta name="description" content="">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
+
|
|
10
|
+
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
|
|
11
|
+
<link rel="stylesheet" href="../styles/style.css">
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
|
|
15
|
+
<div class="navbar navbar-default navbar-fixed-top visible-xs">
|
|
16
|
+
<a href="../" class="navbar-brand">carbon-components-angular documentation</a>
|
|
17
|
+
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div class="xs-menu menu" id="mobile-menu">
|
|
21
|
+
<div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="container-fluid main">
|
|
25
|
+
<div class="row main">
|
|
26
|
+
<div class="hidden-xs menu">
|
|
27
|
+
<compodoc-menu mode="normal"></compodoc-menu>
|
|
28
|
+
</div>
|
|
29
|
+
<!-- START CONTENT -->
|
|
30
|
+
<div class="content class">
|
|
31
|
+
<div class="content-data">
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
<ol class="breadcrumb">
|
|
44
|
+
<li>Classes</li>
|
|
45
|
+
<li>DataGridInteractionModel</li>
|
|
46
|
+
</ol>
|
|
47
|
+
|
|
48
|
+
<ul class="nav nav-tabs" role="tablist">
|
|
49
|
+
<li class="active">
|
|
50
|
+
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a>
|
|
51
|
+
</li>
|
|
52
|
+
<li >
|
|
53
|
+
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a>
|
|
54
|
+
</li>
|
|
55
|
+
</ul>
|
|
56
|
+
|
|
57
|
+
<div class="tab-content">
|
|
58
|
+
<div class="tab-pane fade active in" id="c-info">
|
|
59
|
+
<p class="comment">
|
|
60
|
+
<h3>File</h3>
|
|
61
|
+
</p>
|
|
62
|
+
<p class="comment">
|
|
63
|
+
<code>src/table/data-grid-interaction-model.class.ts</code>
|
|
64
|
+
</p>
|
|
65
|
+
|
|
66
|
+
<p class="comment">
|
|
67
|
+
<h3>Description</h3>
|
|
68
|
+
</p>
|
|
69
|
+
<p class="comment">
|
|
70
|
+
<p><code>DataGridInteractionModel</code> provides centralized control over arbitrary 2d grids, following the w3 specs.</p>
|
|
71
|
+
<p>Refs:</p>
|
|
72
|
+
<ul>
|
|
73
|
+
<li><a href="https://www.w3.org/TR/wai-aria-practices/examples/grid/dataGrids.html">https://www.w3.org/TR/wai-aria-practices/examples/grid/dataGrids.html</a></li>
|
|
74
|
+
<li><a href="https://www.w3.org/TR/wai-aria-practices/#grid">https://www.w3.org/TR/wai-aria-practices/#grid</a></li>
|
|
75
|
+
</ul>
|
|
76
|
+
<p>Example usage (taken from <code>table.component</code>):</p>
|
|
77
|
+
<div><pre class="line-numbers"><code class="language-typescript">// a standard HTML table
|
|
78
|
+
const table = this.elementRef.nativeElement.querySelector("table") as HTMLTableElement;
|
|
79
|
+
|
|
80
|
+
// `TableDomAdapter` implements `TableAdapter` and provides a consistent interface to query rows and columns in a table
|
|
81
|
+
const tableAdapter = new TableDomAdapter(table);
|
|
82
|
+
|
|
83
|
+
// the keydown events that we'll use for keyboard navigation of the table
|
|
84
|
+
const keydownEventStream = fromEvent<KeyboardEvent>(table, "keydown");
|
|
85
|
+
|
|
86
|
+
// the click events we'll use to ensure focus is updated correctly on click
|
|
87
|
+
const clickEventStream = fromEvent<MouseEvent>(table, "click");
|
|
88
|
+
|
|
89
|
+
// the `DataGridInteractionModel` instance!
|
|
90
|
+
this.interactionModel = new DataGridInteractionModel(keydownEventStream, clickEventStream, tableAdapter);
|
|
91
|
+
|
|
92
|
+
// subscribe to the combined position updates
|
|
93
|
+
this.interactionModel.position.subscribe(event => {
|
|
94
|
+
const [currentRow, currentColumn] = event.current;
|
|
95
|
+
const [previousRow, previousColumn] = event.previous;
|
|
96
|
+
|
|
97
|
+
// query the TableAdapter for the cell at the current row and column ...
|
|
98
|
+
const currentElement = tableAdapter.getCell(currentRow, currentColumn);
|
|
99
|
+
// ... and make it focusable it
|
|
100
|
+
Table.setTabIndex(currentElement, 0);
|
|
101
|
+
|
|
102
|
+
// if the model has just initialized don't focus or reset anything
|
|
103
|
+
if (previousRow === -1 || previousColumn === -1) { return; }
|
|
104
|
+
|
|
105
|
+
// query the TableAdapter for the cell at the previous row and column ...
|
|
106
|
+
const previousElement = tableAdapter.getCell(previousRow, previousColumn);
|
|
107
|
+
// ... and make it unfocusable (now there is only a single focusable cell)
|
|
108
|
+
Table.setTabIndex(previousElement, -1);
|
|
109
|
+
|
|
110
|
+
// finally, focus the current cell (skipped during initilzation)
|
|
111
|
+
Table.focus(currentElement);
|
|
112
|
+
});</code></pre></div>
|
|
113
|
+
</p>
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
<section>
|
|
119
|
+
<h3 id="index">Index</h3>
|
|
120
|
+
<table class="table table-sm table-bordered index-table">
|
|
121
|
+
<tbody>
|
|
122
|
+
<tr>
|
|
123
|
+
<td class="col-md-4">
|
|
124
|
+
<h6><b>Properties</b></h6>
|
|
125
|
+
</td>
|
|
126
|
+
</tr>
|
|
127
|
+
<tr>
|
|
128
|
+
<td class="col-md-4">
|
|
129
|
+
<ul class="index-list">
|
|
130
|
+
<li>
|
|
131
|
+
<span class="modifier">Readonly</span>
|
|
132
|
+
<a href="#columnIndex">columnIndex</a>
|
|
133
|
+
</li>
|
|
134
|
+
<li>
|
|
135
|
+
<span class="modifier">Protected</span>
|
|
136
|
+
<a href="#columnSubject">columnSubject</a>
|
|
137
|
+
</li>
|
|
138
|
+
<li>
|
|
139
|
+
<span class="modifier">Readonly</span>
|
|
140
|
+
<a href="#position">position</a>
|
|
141
|
+
</li>
|
|
142
|
+
<li>
|
|
143
|
+
<span class="modifier">Readonly</span>
|
|
144
|
+
<a href="#rowIndex">rowIndex</a>
|
|
145
|
+
</li>
|
|
146
|
+
<li>
|
|
147
|
+
<span class="modifier">Protected</span>
|
|
148
|
+
<a href="#rowSubject">rowSubject</a>
|
|
149
|
+
</li>
|
|
150
|
+
</ul>
|
|
151
|
+
</td>
|
|
152
|
+
</tr>
|
|
153
|
+
|
|
154
|
+
<tr>
|
|
155
|
+
<td class="col-md-4">
|
|
156
|
+
<h6><b>Methods</b></h6>
|
|
157
|
+
</td>
|
|
158
|
+
</tr>
|
|
159
|
+
<tr>
|
|
160
|
+
<td class="col-md-4">
|
|
161
|
+
<ul class="index-list">
|
|
162
|
+
<li>
|
|
163
|
+
<a href="#goTo">goTo</a>
|
|
164
|
+
</li>
|
|
165
|
+
<li>
|
|
166
|
+
<a href="#goToColumn">goToColumn</a>
|
|
167
|
+
</li>
|
|
168
|
+
<li>
|
|
169
|
+
<a href="#goToRow">goToRow</a>
|
|
170
|
+
</li>
|
|
171
|
+
<li>
|
|
172
|
+
<a href="#handleClickEvent">handleClickEvent</a>
|
|
173
|
+
</li>
|
|
174
|
+
<li>
|
|
175
|
+
<a href="#handleKeyboardEvent">handleKeyboardEvent</a>
|
|
176
|
+
</li>
|
|
177
|
+
<li>
|
|
178
|
+
<a href="#reset">reset</a>
|
|
179
|
+
</li>
|
|
180
|
+
<li>
|
|
181
|
+
<a href="#resetTabIndexes">resetTabIndexes</a>
|
|
182
|
+
</li>
|
|
183
|
+
</ul>
|
|
184
|
+
</td>
|
|
185
|
+
</tr>
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
<tr>
|
|
192
|
+
<td class="col-md-4">
|
|
193
|
+
<h6><b>Accessors</b></h6>
|
|
194
|
+
</td>
|
|
195
|
+
</tr>
|
|
196
|
+
<tr>
|
|
197
|
+
<td class="col-md-4">
|
|
198
|
+
<ul class="index-list">
|
|
199
|
+
<li>
|
|
200
|
+
<a href="#currentRow">currentRow</a>
|
|
201
|
+
</li>
|
|
202
|
+
<li>
|
|
203
|
+
<a href="#currentColumn">currentColumn</a>
|
|
204
|
+
</li>
|
|
205
|
+
<li>
|
|
206
|
+
<a href="#lastColumn">lastColumn</a>
|
|
207
|
+
</li>
|
|
208
|
+
<li>
|
|
209
|
+
<a href="#lastRow">lastRow</a>
|
|
210
|
+
</li>
|
|
211
|
+
</ul>
|
|
212
|
+
</td>
|
|
213
|
+
</tr>
|
|
214
|
+
</tbody>
|
|
215
|
+
</table>
|
|
216
|
+
</section>
|
|
217
|
+
|
|
218
|
+
<section>
|
|
219
|
+
<h3 id="constructor">Constructor</h3>
|
|
220
|
+
<table class="table table-sm table-bordered">
|
|
221
|
+
<tbody>
|
|
222
|
+
<tr>
|
|
223
|
+
<td class="col-md-4">
|
|
224
|
+
<code>constructor(keyboardEventStream: Observable<KeyboardEvent>, clickEventStream: Observable<MouseEvent>, tableAdapter: <a href="../classes/TableAdapter.html">TableAdapter</a>)</code>
|
|
225
|
+
</td>
|
|
226
|
+
</tr>
|
|
227
|
+
<tr>
|
|
228
|
+
<td class="col-md-4">
|
|
229
|
+
<div class="io-line">Defined in <a href="" data-line="116" class="link-to-prism">src/table/data-grid-interaction-model.class.ts:116</a></div>
|
|
230
|
+
</td>
|
|
231
|
+
</tr>
|
|
232
|
+
|
|
233
|
+
<tr>
|
|
234
|
+
<td class="col-md-4">
|
|
235
|
+
<div class="io-description"><p><code>DataGridInteractionModel</code> requires knowledge of events, and a representation of your table/grid to be useful.</p>
|
|
236
|
+
</div>
|
|
237
|
+
<div>
|
|
238
|
+
<b>Parameters :</b>
|
|
239
|
+
<table class="params">
|
|
240
|
+
<thead>
|
|
241
|
+
<tr>
|
|
242
|
+
<td>Name</td>
|
|
243
|
+
<td>Type</td>
|
|
244
|
+
<td>Optional</td>
|
|
245
|
+
<td>Description</td>
|
|
246
|
+
</tr>
|
|
247
|
+
</thead>
|
|
248
|
+
<tbody>
|
|
249
|
+
<tr>
|
|
250
|
+
<td>keyboardEventStream</td>
|
|
251
|
+
|
|
252
|
+
<td>
|
|
253
|
+
<code>Observable<KeyboardEvent></code>
|
|
254
|
+
</td>
|
|
255
|
+
|
|
256
|
+
<td>
|
|
257
|
+
No
|
|
258
|
+
</td>
|
|
259
|
+
|
|
260
|
+
<td>
|
|
261
|
+
<code><p>an Observable of KeyboardEvents. Should be scoped to the table container.</p>
|
|
262
|
+
</code>
|
|
263
|
+
</td>
|
|
264
|
+
</tr>
|
|
265
|
+
<tr>
|
|
266
|
+
<td>clickEventStream</td>
|
|
267
|
+
|
|
268
|
+
<td>
|
|
269
|
+
<code>Observable<MouseEvent></code>
|
|
270
|
+
</td>
|
|
271
|
+
|
|
272
|
+
<td>
|
|
273
|
+
No
|
|
274
|
+
</td>
|
|
275
|
+
|
|
276
|
+
<td>
|
|
277
|
+
<code><p>an Observable of ClickEvents. should only include clicks that take action on items known by the TableAdapter</p>
|
|
278
|
+
</code>
|
|
279
|
+
</td>
|
|
280
|
+
</tr>
|
|
281
|
+
<tr>
|
|
282
|
+
<td>tableAdapter</td>
|
|
283
|
+
|
|
284
|
+
<td>
|
|
285
|
+
<code><a href="../classes/TableAdapter.html" target="_self" >TableAdapter</a></code>
|
|
286
|
+
</td>
|
|
287
|
+
|
|
288
|
+
<td>
|
|
289
|
+
No
|
|
290
|
+
</td>
|
|
291
|
+
|
|
292
|
+
<td>
|
|
293
|
+
<code><p>an instance of a concrete class that implements TableAdapter. The standard carbon table uses TableDomAdapter</p>
|
|
294
|
+
</code>
|
|
295
|
+
</td>
|
|
296
|
+
</tr>
|
|
297
|
+
</tbody>
|
|
298
|
+
</table>
|
|
299
|
+
</div>
|
|
300
|
+
</td>
|
|
301
|
+
</tr>
|
|
302
|
+
</tbody>
|
|
303
|
+
</table>
|
|
304
|
+
</section>
|
|
305
|
+
|
|
306
|
+
<section>
|
|
307
|
+
|
|
308
|
+
<h3 id="inputs">
|
|
309
|
+
Properties
|
|
310
|
+
</h3>
|
|
311
|
+
<table class="table table-sm table-bordered">
|
|
312
|
+
<tbody>
|
|
313
|
+
<tr>
|
|
314
|
+
<td class="col-md-4">
|
|
315
|
+
<a name="columnIndex"></a>
|
|
316
|
+
<span class="name">
|
|
317
|
+
<b>
|
|
318
|
+
<span class="modifier">Readonly</span>
|
|
319
|
+
columnIndex
|
|
320
|
+
</b>
|
|
321
|
+
<a href="#columnIndex"><span class="icon ion-ios-link"></span></a>
|
|
322
|
+
</span>
|
|
323
|
+
</td>
|
|
324
|
+
</tr>
|
|
325
|
+
<tr>
|
|
326
|
+
<td class="col-md-4">
|
|
327
|
+
<span class="modifier-icon icon ion-ios-reset"></span><code>columnIndex: <code>Observable<literal type></code>
|
|
328
|
+
</code>
|
|
329
|
+
</td>
|
|
330
|
+
</tr>
|
|
331
|
+
<tr>
|
|
332
|
+
<td class="col-md-4">
|
|
333
|
+
<i>Type : </i> <code>Observable<literal type></code>
|
|
334
|
+
|
|
335
|
+
</td>
|
|
336
|
+
</tr>
|
|
337
|
+
<tr>
|
|
338
|
+
<td class="col-md-4">
|
|
339
|
+
<div class="io-line">Defined in <a href="" data-line="79" class="link-to-prism">src/table/data-grid-interaction-model.class.ts:79</a></div>
|
|
340
|
+
</td>
|
|
341
|
+
</tr>
|
|
342
|
+
|
|
343
|
+
<tr>
|
|
344
|
+
<td class="col-md-4">
|
|
345
|
+
<div class="io-description"><p>An Observable that provides the current and previous column indexes.</p>
|
|
346
|
+
</div>
|
|
347
|
+
</td>
|
|
348
|
+
</tr>
|
|
349
|
+
|
|
350
|
+
</tbody>
|
|
351
|
+
</table>
|
|
352
|
+
<table class="table table-sm table-bordered">
|
|
353
|
+
<tbody>
|
|
354
|
+
<tr>
|
|
355
|
+
<td class="col-md-4">
|
|
356
|
+
<a name="columnSubject"></a>
|
|
357
|
+
<span class="name">
|
|
358
|
+
<b>
|
|
359
|
+
<span class="modifier">Protected</span>
|
|
360
|
+
columnSubject
|
|
361
|
+
</b>
|
|
362
|
+
<a href="#columnSubject"><span class="icon ion-ios-link"></span></a>
|
|
363
|
+
</span>
|
|
364
|
+
</td>
|
|
365
|
+
</tr>
|
|
366
|
+
<tr>
|
|
367
|
+
<td class="col-md-4">
|
|
368
|
+
<span class="modifier-icon icon ion-ios-reset"></span><code>columnSubject: <code></code>
|
|
369
|
+
</code>
|
|
370
|
+
</td>
|
|
371
|
+
</tr>
|
|
372
|
+
<tr>
|
|
373
|
+
<td class="col-md-4">
|
|
374
|
+
<i>Default value : </i><code>new BehaviorSubject({ current: 0, previous: -1 })</code>
|
|
375
|
+
</td>
|
|
376
|
+
</tr>
|
|
377
|
+
<tr>
|
|
378
|
+
<td class="col-md-4">
|
|
379
|
+
<div class="io-line">Defined in <a href="" data-line="88" class="link-to-prism">src/table/data-grid-interaction-model.class.ts:88</a></div>
|
|
380
|
+
</td>
|
|
381
|
+
</tr>
|
|
382
|
+
|
|
383
|
+
<tr>
|
|
384
|
+
<td class="col-md-4">
|
|
385
|
+
<div class="io-description"><p>Internal subject to handle changes in column</p>
|
|
386
|
+
</div>
|
|
387
|
+
</td>
|
|
388
|
+
</tr>
|
|
389
|
+
|
|
390
|
+
</tbody>
|
|
391
|
+
</table>
|
|
392
|
+
<table class="table table-sm table-bordered">
|
|
393
|
+
<tbody>
|
|
394
|
+
<tr>
|
|
395
|
+
<td class="col-md-4">
|
|
396
|
+
<a name="position"></a>
|
|
397
|
+
<span class="name">
|
|
398
|
+
<b>
|
|
399
|
+
<span class="modifier">Readonly</span>
|
|
400
|
+
position
|
|
401
|
+
</b>
|
|
402
|
+
<a href="#position"><span class="icon ion-ios-link"></span></a>
|
|
403
|
+
</span>
|
|
404
|
+
</td>
|
|
405
|
+
</tr>
|
|
406
|
+
<tr>
|
|
407
|
+
<td class="col-md-4">
|
|
408
|
+
<span class="modifier-icon icon ion-ios-reset"></span><code>position: <code><a href="../interfaces/DataGridPosition.html" target="_self" >Observable<DataGridPosition></a></code>
|
|
409
|
+
</code>
|
|
410
|
+
</td>
|
|
411
|
+
</tr>
|
|
412
|
+
<tr>
|
|
413
|
+
<td class="col-md-4">
|
|
414
|
+
<i>Type : </i> <code><a href="../interfaces/DataGridPosition.html" target="_self" >Observable<DataGridPosition></a></code>
|
|
415
|
+
|
|
416
|
+
</td>
|
|
417
|
+
</tr>
|
|
418
|
+
<tr>
|
|
419
|
+
<td class="col-md-4">
|
|
420
|
+
<div class="io-line">Defined in <a href="" data-line="71" class="link-to-prism">src/table/data-grid-interaction-model.class.ts:71</a></div>
|
|
421
|
+
</td>
|
|
422
|
+
</tr>
|
|
423
|
+
|
|
424
|
+
<tr>
|
|
425
|
+
<td class="col-md-4">
|
|
426
|
+
<div class="io-description"><p>An Observable that provides an aggregated view of the <code>rowIndex</code> and <code>columnIndex</code> Observables</p>
|
|
427
|
+
</div>
|
|
428
|
+
</td>
|
|
429
|
+
</tr>
|
|
430
|
+
|
|
431
|
+
</tbody>
|
|
432
|
+
</table>
|
|
433
|
+
<table class="table table-sm table-bordered">
|
|
434
|
+
<tbody>
|
|
435
|
+
<tr>
|
|
436
|
+
<td class="col-md-4">
|
|
437
|
+
<a name="rowIndex"></a>
|
|
438
|
+
<span class="name">
|
|
439
|
+
<b>
|
|
440
|
+
<span class="modifier">Readonly</span>
|
|
441
|
+
rowIndex
|
|
442
|
+
</b>
|
|
443
|
+
<a href="#rowIndex"><span class="icon ion-ios-link"></span></a>
|
|
444
|
+
</span>
|
|
445
|
+
</td>
|
|
446
|
+
</tr>
|
|
447
|
+
<tr>
|
|
448
|
+
<td class="col-md-4">
|
|
449
|
+
<span class="modifier-icon icon ion-ios-reset"></span><code>rowIndex: <code>Observable<literal type></code>
|
|
450
|
+
</code>
|
|
451
|
+
</td>
|
|
452
|
+
</tr>
|
|
453
|
+
<tr>
|
|
454
|
+
<td class="col-md-4">
|
|
455
|
+
<i>Type : </i> <code>Observable<literal type></code>
|
|
456
|
+
|
|
457
|
+
</td>
|
|
458
|
+
</tr>
|
|
459
|
+
<tr>
|
|
460
|
+
<td class="col-md-4">
|
|
461
|
+
<div class="io-line">Defined in <a href="" data-line="75" class="link-to-prism">src/table/data-grid-interaction-model.class.ts:75</a></div>
|
|
462
|
+
</td>
|
|
463
|
+
</tr>
|
|
464
|
+
|
|
465
|
+
<tr>
|
|
466
|
+
<td class="col-md-4">
|
|
467
|
+
<div class="io-description"><p>An Observable that provides the current and previous row indexes.</p>
|
|
468
|
+
</div>
|
|
469
|
+
</td>
|
|
470
|
+
</tr>
|
|
471
|
+
|
|
472
|
+
</tbody>
|
|
473
|
+
</table>
|
|
474
|
+
<table class="table table-sm table-bordered">
|
|
475
|
+
<tbody>
|
|
476
|
+
<tr>
|
|
477
|
+
<td class="col-md-4">
|
|
478
|
+
<a name="rowSubject"></a>
|
|
479
|
+
<span class="name">
|
|
480
|
+
<b>
|
|
481
|
+
<span class="modifier">Protected</span>
|
|
482
|
+
rowSubject
|
|
483
|
+
</b>
|
|
484
|
+
<a href="#rowSubject"><span class="icon ion-ios-link"></span></a>
|
|
485
|
+
</span>
|
|
486
|
+
</td>
|
|
487
|
+
</tr>
|
|
488
|
+
<tr>
|
|
489
|
+
<td class="col-md-4">
|
|
490
|
+
<span class="modifier-icon icon ion-ios-reset"></span><code>rowSubject: <code></code>
|
|
491
|
+
</code>
|
|
492
|
+
</td>
|
|
493
|
+
</tr>
|
|
494
|
+
<tr>
|
|
495
|
+
<td class="col-md-4">
|
|
496
|
+
<i>Default value : </i><code>new BehaviorSubject({ current: 0, previous: -1 })</code>
|
|
497
|
+
</td>
|
|
498
|
+
</tr>
|
|
499
|
+
<tr>
|
|
500
|
+
<td class="col-md-4">
|
|
501
|
+
<div class="io-line">Defined in <a href="" data-line="84" class="link-to-prism">src/table/data-grid-interaction-model.class.ts:84</a></div>
|
|
502
|
+
</td>
|
|
503
|
+
</tr>
|
|
504
|
+
|
|
505
|
+
<tr>
|
|
506
|
+
<td class="col-md-4">
|
|
507
|
+
<div class="io-description"><p>Internal subject to handle changes in row</p>
|
|
508
|
+
</div>
|
|
509
|
+
</td>
|
|
510
|
+
</tr>
|
|
511
|
+
|
|
512
|
+
</tbody>
|
|
513
|
+
</table>
|
|
514
|
+
</section>
|
|
515
|
+
|
|
516
|
+
<section>
|
|
517
|
+
|
|
518
|
+
<h3 id="methods">
|
|
519
|
+
Methods
|
|
520
|
+
</h3>
|
|
521
|
+
<table class="table table-sm table-bordered">
|
|
522
|
+
<tbody>
|
|
523
|
+
<tr>
|
|
524
|
+
<td class="col-md-4">
|
|
525
|
+
<a name="goTo"></a>
|
|
526
|
+
<span class="name">
|
|
527
|
+
<b>
|
|
528
|
+
goTo
|
|
529
|
+
</b>
|
|
530
|
+
<a href="#goTo"><span class="icon ion-ios-link"></span></a>
|
|
531
|
+
</span>
|
|
532
|
+
</td>
|
|
533
|
+
</tr>
|
|
534
|
+
<tr>
|
|
535
|
+
<td class="col-md-4">
|
|
536
|
+
<code>goTo(undefined)</code>
|
|
537
|
+
</td>
|
|
538
|
+
</tr>
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
<tr>
|
|
542
|
+
<td class="col-md-4">
|
|
543
|
+
<div class="io-line">Defined in <a href="" data-line="235" class="link-to-prism">src/table/data-grid-interaction-model.class.ts:235</a></div>
|
|
544
|
+
</td>
|
|
545
|
+
</tr>
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
<tr>
|
|
549
|
+
<td class="col-md-4">
|
|
550
|
+
<div class="io-description"><p>Jump to the specified row and column</p>
|
|
551
|
+
</div>
|
|
552
|
+
|
|
553
|
+
<div class="io-description">
|
|
554
|
+
<b>Parameters :</b>
|
|
555
|
+
<table class="params">
|
|
556
|
+
<thead>
|
|
557
|
+
<tr>
|
|
558
|
+
<td>Name</td>
|
|
559
|
+
<td>Optional</td>
|
|
560
|
+
</tr>
|
|
561
|
+
</thead>
|
|
562
|
+
<tbody>
|
|
563
|
+
<tr>
|
|
564
|
+
|
|
565
|
+
<td>
|
|
566
|
+
No
|
|
567
|
+
</td>
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
</tr>
|
|
571
|
+
</tbody>
|
|
572
|
+
</table>
|
|
573
|
+
</div>
|
|
574
|
+
<div>
|
|
575
|
+
</div>
|
|
576
|
+
<div class="io-description">
|
|
577
|
+
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
578
|
+
|
|
579
|
+
</div>
|
|
580
|
+
<div class="io-description">
|
|
581
|
+
|
|
582
|
+
</div>
|
|
583
|
+
</td>
|
|
584
|
+
</tr>
|
|
585
|
+
</tbody>
|
|
586
|
+
</table>
|
|
587
|
+
<table class="table table-sm table-bordered">
|
|
588
|
+
<tbody>
|
|
589
|
+
<tr>
|
|
590
|
+
<td class="col-md-4">
|
|
591
|
+
<a name="goToColumn"></a>
|
|
592
|
+
<span class="name">
|
|
593
|
+
<b>
|
|
594
|
+
goToColumn
|
|
595
|
+
</b>
|
|
596
|
+
<a href="#goToColumn"><span class="icon ion-ios-link"></span></a>
|
|
597
|
+
</span>
|
|
598
|
+
</td>
|
|
599
|
+
</tr>
|
|
600
|
+
<tr>
|
|
601
|
+
<td class="col-md-4">
|
|
602
|
+
<code>goToColumn(index: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank">number</a>)</code>
|
|
603
|
+
</td>
|
|
604
|
+
</tr>
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
<tr>
|
|
608
|
+
<td class="col-md-4">
|
|
609
|
+
<div class="io-line">Defined in <a href="" data-line="215" class="link-to-prism">src/table/data-grid-interaction-model.class.ts:215</a></div>
|
|
610
|
+
</td>
|
|
611
|
+
</tr>
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
<tr>
|
|
615
|
+
<td class="col-md-4">
|
|
616
|
+
<div class="io-description"><p>Jump to a specific column without changing the row</p>
|
|
617
|
+
</div>
|
|
618
|
+
|
|
619
|
+
<div class="io-description">
|
|
620
|
+
<b>Parameters :</b>
|
|
621
|
+
<table class="params">
|
|
622
|
+
<thead>
|
|
623
|
+
<tr>
|
|
624
|
+
<td>Name</td>
|
|
625
|
+
<td>Type</td>
|
|
626
|
+
<td>Optional</td>
|
|
627
|
+
<td>Description</td>
|
|
628
|
+
</tr>
|
|
629
|
+
</thead>
|
|
630
|
+
<tbody>
|
|
631
|
+
<tr>
|
|
632
|
+
<td>index</td>
|
|
633
|
+
<td>
|
|
634
|
+
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
|
|
635
|
+
</td>
|
|
636
|
+
|
|
637
|
+
<td>
|
|
638
|
+
No
|
|
639
|
+
</td>
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
<td>
|
|
643
|
+
<code><p>column to jump to</p>
|
|
644
|
+
</code>
|
|
645
|
+
</td>
|
|
646
|
+
</tr>
|
|
647
|
+
</tbody>
|
|
648
|
+
</table>
|
|
649
|
+
</div>
|
|
650
|
+
<div>
|
|
651
|
+
</div>
|
|
652
|
+
<div class="io-description">
|
|
653
|
+
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
654
|
+
|
|
655
|
+
</div>
|
|
656
|
+
<div class="io-description">
|
|
657
|
+
|
|
658
|
+
</div>
|
|
659
|
+
</td>
|
|
660
|
+
</tr>
|
|
661
|
+
</tbody>
|
|
662
|
+
</table>
|
|
663
|
+
<table class="table table-sm table-bordered">
|
|
664
|
+
<tbody>
|
|
665
|
+
<tr>
|
|
666
|
+
<td class="col-md-4">
|
|
667
|
+
<a name="goToRow"></a>
|
|
668
|
+
<span class="name">
|
|
669
|
+
<b>
|
|
670
|
+
goToRow
|
|
671
|
+
</b>
|
|
672
|
+
<a href="#goToRow"><span class="icon ion-ios-link"></span></a>
|
|
673
|
+
</span>
|
|
674
|
+
</td>
|
|
675
|
+
</tr>
|
|
676
|
+
<tr>
|
|
677
|
+
<td class="col-md-4">
|
|
678
|
+
<code>goToRow(index: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank">number</a>)</code>
|
|
679
|
+
</td>
|
|
680
|
+
</tr>
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
<tr>
|
|
684
|
+
<td class="col-md-4">
|
|
685
|
+
<div class="io-line">Defined in <a href="" data-line="225" class="link-to-prism">src/table/data-grid-interaction-model.class.ts:225</a></div>
|
|
686
|
+
</td>
|
|
687
|
+
</tr>
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
<tr>
|
|
691
|
+
<td class="col-md-4">
|
|
692
|
+
<div class="io-description"><p>Jump to a specific row without chaning the column</p>
|
|
693
|
+
</div>
|
|
694
|
+
|
|
695
|
+
<div class="io-description">
|
|
696
|
+
<b>Parameters :</b>
|
|
697
|
+
<table class="params">
|
|
698
|
+
<thead>
|
|
699
|
+
<tr>
|
|
700
|
+
<td>Name</td>
|
|
701
|
+
<td>Type</td>
|
|
702
|
+
<td>Optional</td>
|
|
703
|
+
<td>Description</td>
|
|
704
|
+
</tr>
|
|
705
|
+
</thead>
|
|
706
|
+
<tbody>
|
|
707
|
+
<tr>
|
|
708
|
+
<td>index</td>
|
|
709
|
+
<td>
|
|
710
|
+
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
|
|
711
|
+
</td>
|
|
712
|
+
|
|
713
|
+
<td>
|
|
714
|
+
No
|
|
715
|
+
</td>
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
<td>
|
|
719
|
+
<code><p>row to jump to</p>
|
|
720
|
+
</code>
|
|
721
|
+
</td>
|
|
722
|
+
</tr>
|
|
723
|
+
</tbody>
|
|
724
|
+
</table>
|
|
725
|
+
</div>
|
|
726
|
+
<div>
|
|
727
|
+
</div>
|
|
728
|
+
<div class="io-description">
|
|
729
|
+
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
730
|
+
|
|
731
|
+
</div>
|
|
732
|
+
<div class="io-description">
|
|
733
|
+
|
|
734
|
+
</div>
|
|
735
|
+
</td>
|
|
736
|
+
</tr>
|
|
737
|
+
</tbody>
|
|
738
|
+
</table>
|
|
739
|
+
<table class="table table-sm table-bordered">
|
|
740
|
+
<tbody>
|
|
741
|
+
<tr>
|
|
742
|
+
<td class="col-md-4">
|
|
743
|
+
<a name="handleClickEvent"></a>
|
|
744
|
+
<span class="name">
|
|
745
|
+
<b>
|
|
746
|
+
handleClickEvent
|
|
747
|
+
</b>
|
|
748
|
+
<a href="#handleClickEvent"><span class="icon ion-ios-link"></span></a>
|
|
749
|
+
</span>
|
|
750
|
+
</td>
|
|
751
|
+
</tr>
|
|
752
|
+
<tr>
|
|
753
|
+
<td class="col-md-4">
|
|
754
|
+
<code>handleClickEvent(event: MouseEvent)</code>
|
|
755
|
+
</td>
|
|
756
|
+
</tr>
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
<tr>
|
|
760
|
+
<td class="col-md-4">
|
|
761
|
+
<div class="io-line">Defined in <a href="" data-line="204" class="link-to-prism">src/table/data-grid-interaction-model.class.ts:204</a></div>
|
|
762
|
+
</td>
|
|
763
|
+
</tr>
|
|
764
|
+
|
|
765
|
+
|
|
766
|
+
<tr>
|
|
767
|
+
<td class="col-md-4">
|
|
768
|
+
<div class="io-description"><p>Handles moving the position to the clicked cell</p>
|
|
769
|
+
</div>
|
|
770
|
+
|
|
771
|
+
<div class="io-description">
|
|
772
|
+
<b>Parameters :</b>
|
|
773
|
+
<table class="params">
|
|
774
|
+
<thead>
|
|
775
|
+
<tr>
|
|
776
|
+
<td>Name</td>
|
|
777
|
+
<td>Type</td>
|
|
778
|
+
<td>Optional</td>
|
|
779
|
+
<td>Description</td>
|
|
780
|
+
</tr>
|
|
781
|
+
</thead>
|
|
782
|
+
<tbody>
|
|
783
|
+
<tr>
|
|
784
|
+
<td>event</td>
|
|
785
|
+
<td>
|
|
786
|
+
<code>MouseEvent</code>
|
|
787
|
+
</td>
|
|
788
|
+
|
|
789
|
+
<td>
|
|
790
|
+
No
|
|
791
|
+
</td>
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
<td>
|
|
795
|
+
<code><p>the MouseEvent to handle</p>
|
|
796
|
+
</code>
|
|
797
|
+
</td>
|
|
798
|
+
</tr>
|
|
799
|
+
</tbody>
|
|
800
|
+
</table>
|
|
801
|
+
</div>
|
|
802
|
+
<div>
|
|
803
|
+
</div>
|
|
804
|
+
<div class="io-description">
|
|
805
|
+
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
806
|
+
|
|
807
|
+
</div>
|
|
808
|
+
<div class="io-description">
|
|
809
|
+
|
|
810
|
+
</div>
|
|
811
|
+
</td>
|
|
812
|
+
</tr>
|
|
813
|
+
</tbody>
|
|
814
|
+
</table>
|
|
815
|
+
<table class="table table-sm table-bordered">
|
|
816
|
+
<tbody>
|
|
817
|
+
<tr>
|
|
818
|
+
<td class="col-md-4">
|
|
819
|
+
<a name="handleKeyboardEvent"></a>
|
|
820
|
+
<span class="name">
|
|
821
|
+
<b>
|
|
822
|
+
handleKeyboardEvent
|
|
823
|
+
</b>
|
|
824
|
+
<a href="#handleKeyboardEvent"><span class="icon ion-ios-link"></span></a>
|
|
825
|
+
</span>
|
|
826
|
+
</td>
|
|
827
|
+
</tr>
|
|
828
|
+
<tr>
|
|
829
|
+
<td class="col-md-4">
|
|
830
|
+
<code>handleKeyboardEvent(event: KeyboardEvent)</code>
|
|
831
|
+
</td>
|
|
832
|
+
</tr>
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
<tr>
|
|
836
|
+
<td class="col-md-4">
|
|
837
|
+
<div class="io-line">Defined in <a href="" data-line="152" class="link-to-prism">src/table/data-grid-interaction-model.class.ts:152</a></div>
|
|
838
|
+
</td>
|
|
839
|
+
</tr>
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
<tr>
|
|
843
|
+
<td class="col-md-4">
|
|
844
|
+
<div class="io-description"><p>Handles moving the position according to the w3 datagrid navigation specs</p>
|
|
845
|
+
<p>Refs:</p>
|
|
846
|
+
<ul>
|
|
847
|
+
<li><a href="https://www.w3.org/TR/wai-aria-practices/examples/grid/dataGrids.html">https://www.w3.org/TR/wai-aria-practices/examples/grid/dataGrids.html</a></li>
|
|
848
|
+
<li><a href="https://www.w3.org/TR/wai-aria-practices/#grid">https://www.w3.org/TR/wai-aria-practices/#grid</a></li>
|
|
849
|
+
</ul>
|
|
850
|
+
</div>
|
|
851
|
+
|
|
852
|
+
<div class="io-description">
|
|
853
|
+
<b>Parameters :</b>
|
|
854
|
+
<table class="params">
|
|
855
|
+
<thead>
|
|
856
|
+
<tr>
|
|
857
|
+
<td>Name</td>
|
|
858
|
+
<td>Type</td>
|
|
859
|
+
<td>Optional</td>
|
|
860
|
+
<td>Description</td>
|
|
861
|
+
</tr>
|
|
862
|
+
</thead>
|
|
863
|
+
<tbody>
|
|
864
|
+
<tr>
|
|
865
|
+
<td>event</td>
|
|
866
|
+
<td>
|
|
867
|
+
<code>KeyboardEvent</code>
|
|
868
|
+
</td>
|
|
869
|
+
|
|
870
|
+
<td>
|
|
871
|
+
No
|
|
872
|
+
</td>
|
|
873
|
+
|
|
874
|
+
|
|
875
|
+
<td>
|
|
876
|
+
<code><p>the KeyboardEvent to handle</p>
|
|
877
|
+
</code>
|
|
878
|
+
</td>
|
|
879
|
+
</tr>
|
|
880
|
+
</tbody>
|
|
881
|
+
</table>
|
|
882
|
+
</div>
|
|
883
|
+
<div>
|
|
884
|
+
</div>
|
|
885
|
+
<div class="io-description">
|
|
886
|
+
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
887
|
+
|
|
888
|
+
</div>
|
|
889
|
+
<div class="io-description">
|
|
890
|
+
|
|
891
|
+
</div>
|
|
892
|
+
</td>
|
|
893
|
+
</tr>
|
|
894
|
+
</tbody>
|
|
895
|
+
</table>
|
|
896
|
+
<table class="table table-sm table-bordered">
|
|
897
|
+
<tbody>
|
|
898
|
+
<tr>
|
|
899
|
+
<td class="col-md-4">
|
|
900
|
+
<a name="reset"></a>
|
|
901
|
+
<span class="name">
|
|
902
|
+
<b>
|
|
903
|
+
reset
|
|
904
|
+
</b>
|
|
905
|
+
<a href="#reset"><span class="icon ion-ios-link"></span></a>
|
|
906
|
+
</span>
|
|
907
|
+
</td>
|
|
908
|
+
</tr>
|
|
909
|
+
<tr>
|
|
910
|
+
<td class="col-md-4">
|
|
911
|
+
<code>reset()</code>
|
|
912
|
+
</td>
|
|
913
|
+
</tr>
|
|
914
|
+
|
|
915
|
+
|
|
916
|
+
<tr>
|
|
917
|
+
<td class="col-md-4">
|
|
918
|
+
<div class="io-line">Defined in <a href="" data-line="260" class="link-to-prism">src/table/data-grid-interaction-model.class.ts:260</a></div>
|
|
919
|
+
</td>
|
|
920
|
+
</tr>
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
<tr>
|
|
924
|
+
<td class="col-md-4">
|
|
925
|
+
<div class="io-description"><p>Resets the models focus position</p>
|
|
926
|
+
</div>
|
|
927
|
+
|
|
928
|
+
<div class="io-description">
|
|
929
|
+
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
930
|
+
|
|
931
|
+
</div>
|
|
932
|
+
</td>
|
|
933
|
+
</tr>
|
|
934
|
+
</tbody>
|
|
935
|
+
</table>
|
|
936
|
+
<table class="table table-sm table-bordered">
|
|
937
|
+
<tbody>
|
|
938
|
+
<tr>
|
|
939
|
+
<td class="col-md-4">
|
|
940
|
+
<a name="resetTabIndexes"></a>
|
|
941
|
+
<span class="name">
|
|
942
|
+
<b>
|
|
943
|
+
resetTabIndexes
|
|
944
|
+
</b>
|
|
945
|
+
<a href="#resetTabIndexes"><span class="icon ion-ios-link"></span></a>
|
|
946
|
+
</span>
|
|
947
|
+
</td>
|
|
948
|
+
</tr>
|
|
949
|
+
<tr>
|
|
950
|
+
<td class="col-md-4">
|
|
951
|
+
<code>resetTabIndexes(newTabIndex)</code>
|
|
952
|
+
</td>
|
|
953
|
+
</tr>
|
|
954
|
+
|
|
955
|
+
|
|
956
|
+
<tr>
|
|
957
|
+
<td class="col-md-4">
|
|
958
|
+
<div class="io-line">Defined in <a href="" data-line="244" class="link-to-prism">src/table/data-grid-interaction-model.class.ts:244</a></div>
|
|
959
|
+
</td>
|
|
960
|
+
</tr>
|
|
961
|
+
|
|
962
|
+
|
|
963
|
+
<tr>
|
|
964
|
+
<td class="col-md-4">
|
|
965
|
+
<div class="io-description"><p>Convenience method to reset the tab indexes on a standard carbon table.
|
|
966
|
+
For custom tables you may want to reset the indexes manually and simply call <code>.reset()</code></p>
|
|
967
|
+
</div>
|
|
968
|
+
|
|
969
|
+
<div class="io-description">
|
|
970
|
+
<b>Parameters :</b>
|
|
971
|
+
<table class="params">
|
|
972
|
+
<thead>
|
|
973
|
+
<tr>
|
|
974
|
+
<td>Name</td>
|
|
975
|
+
<td>Optional</td>
|
|
976
|
+
<td>Default value</td>
|
|
977
|
+
</tr>
|
|
978
|
+
</thead>
|
|
979
|
+
<tbody>
|
|
980
|
+
<tr>
|
|
981
|
+
<td>newTabIndex</td>
|
|
982
|
+
|
|
983
|
+
<td>
|
|
984
|
+
No
|
|
985
|
+
</td>
|
|
986
|
+
|
|
987
|
+
<td>
|
|
988
|
+
<code>-1</code>
|
|
989
|
+
</td>
|
|
990
|
+
|
|
991
|
+
</tr>
|
|
992
|
+
</tbody>
|
|
993
|
+
</table>
|
|
994
|
+
</div>
|
|
995
|
+
<div>
|
|
996
|
+
</div>
|
|
997
|
+
<div class="io-description">
|
|
998
|
+
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
999
|
+
|
|
1000
|
+
</div>
|
|
1001
|
+
<div class="io-description">
|
|
1002
|
+
|
|
1003
|
+
</div>
|
|
1004
|
+
</td>
|
|
1005
|
+
</tr>
|
|
1006
|
+
</tbody>
|
|
1007
|
+
</table>
|
|
1008
|
+
</section>
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
<section>
|
|
1016
|
+
<h3 id="accessors">
|
|
1017
|
+
Accessors
|
|
1018
|
+
</h3>
|
|
1019
|
+
<table class="table table-sm table-bordered">
|
|
1020
|
+
<tbody>
|
|
1021
|
+
<tr>
|
|
1022
|
+
<td class="col-md-4">
|
|
1023
|
+
<a name="currentRow"></a>
|
|
1024
|
+
<span class="name"><b>currentRow</b><a href="#currentRow"><span class="icon ion-ios-link"></span></a></span>
|
|
1025
|
+
</td>
|
|
1026
|
+
</tr>
|
|
1027
|
+
|
|
1028
|
+
<tr>
|
|
1029
|
+
<td class="col-md-4">
|
|
1030
|
+
<span class="accessor"><b>get</b><code>currentRow()</code></span>
|
|
1031
|
+
</td>
|
|
1032
|
+
</tr>
|
|
1033
|
+
<tr>
|
|
1034
|
+
<td class="col-md-4">
|
|
1035
|
+
<div class="io-line">Defined in <a href="" data-line="93" class="link-to-prism">src/table/data-grid-interaction-model.class.ts:93</a></div>
|
|
1036
|
+
</td>
|
|
1037
|
+
</tr>
|
|
1038
|
+
<tr>
|
|
1039
|
+
<td class="col-md-4">
|
|
1040
|
+
<div class="io-description"><p>The latest value emitted by the rowSubject</p>
|
|
1041
|
+
</div>
|
|
1042
|
+
|
|
1043
|
+
</td>
|
|
1044
|
+
</tr>
|
|
1045
|
+
|
|
1046
|
+
</tbody>
|
|
1047
|
+
</table>
|
|
1048
|
+
<table class="table table-sm table-bordered">
|
|
1049
|
+
<tbody>
|
|
1050
|
+
<tr>
|
|
1051
|
+
<td class="col-md-4">
|
|
1052
|
+
<a name="currentColumn"></a>
|
|
1053
|
+
<span class="name"><b>currentColumn</b><a href="#currentColumn"><span class="icon ion-ios-link"></span></a></span>
|
|
1054
|
+
</td>
|
|
1055
|
+
</tr>
|
|
1056
|
+
|
|
1057
|
+
<tr>
|
|
1058
|
+
<td class="col-md-4">
|
|
1059
|
+
<span class="accessor"><b>get</b><code>currentColumn()</code></span>
|
|
1060
|
+
</td>
|
|
1061
|
+
</tr>
|
|
1062
|
+
<tr>
|
|
1063
|
+
<td class="col-md-4">
|
|
1064
|
+
<div class="io-line">Defined in <a href="" data-line="100" class="link-to-prism">src/table/data-grid-interaction-model.class.ts:100</a></div>
|
|
1065
|
+
</td>
|
|
1066
|
+
</tr>
|
|
1067
|
+
<tr>
|
|
1068
|
+
<td class="col-md-4">
|
|
1069
|
+
<div class="io-description"><p>The latest value emitted by the columnSubject</p>
|
|
1070
|
+
</div>
|
|
1071
|
+
|
|
1072
|
+
</td>
|
|
1073
|
+
</tr>
|
|
1074
|
+
|
|
1075
|
+
</tbody>
|
|
1076
|
+
</table>
|
|
1077
|
+
<table class="table table-sm table-bordered">
|
|
1078
|
+
<tbody>
|
|
1079
|
+
<tr>
|
|
1080
|
+
<td class="col-md-4">
|
|
1081
|
+
<a name="lastColumn"></a>
|
|
1082
|
+
<span class="name"><b>lastColumn</b><a href="#lastColumn"><span class="icon ion-ios-link"></span></a></span>
|
|
1083
|
+
</td>
|
|
1084
|
+
</tr>
|
|
1085
|
+
|
|
1086
|
+
<tr>
|
|
1087
|
+
<td class="col-md-4">
|
|
1088
|
+
<span class="accessor"><b>get</b><code>lastColumn()</code></span>
|
|
1089
|
+
</td>
|
|
1090
|
+
</tr>
|
|
1091
|
+
<tr>
|
|
1092
|
+
<td class="col-md-4">
|
|
1093
|
+
<div class="io-line">Defined in <a href="" data-line="107" class="link-to-prism">src/table/data-grid-interaction-model.class.ts:107</a></div>
|
|
1094
|
+
</td>
|
|
1095
|
+
</tr>
|
|
1096
|
+
<tr>
|
|
1097
|
+
<td class="col-md-4">
|
|
1098
|
+
<div class="io-description"><p>The last column as reported by the adapter</p>
|
|
1099
|
+
</div>
|
|
1100
|
+
|
|
1101
|
+
</td>
|
|
1102
|
+
</tr>
|
|
1103
|
+
|
|
1104
|
+
</tbody>
|
|
1105
|
+
</table>
|
|
1106
|
+
<table class="table table-sm table-bordered">
|
|
1107
|
+
<tbody>
|
|
1108
|
+
<tr>
|
|
1109
|
+
<td class="col-md-4">
|
|
1110
|
+
<a name="lastRow"></a>
|
|
1111
|
+
<span class="name"><b>lastRow</b><a href="#lastRow"><span class="icon ion-ios-link"></span></a></span>
|
|
1112
|
+
</td>
|
|
1113
|
+
</tr>
|
|
1114
|
+
|
|
1115
|
+
<tr>
|
|
1116
|
+
<td class="col-md-4">
|
|
1117
|
+
<span class="accessor"><b>get</b><code>lastRow()</code></span>
|
|
1118
|
+
</td>
|
|
1119
|
+
</tr>
|
|
1120
|
+
<tr>
|
|
1121
|
+
<td class="col-md-4">
|
|
1122
|
+
<div class="io-line">Defined in <a href="" data-line="114" class="link-to-prism">src/table/data-grid-interaction-model.class.ts:114</a></div>
|
|
1123
|
+
</td>
|
|
1124
|
+
</tr>
|
|
1125
|
+
<tr>
|
|
1126
|
+
<td class="col-md-4">
|
|
1127
|
+
<div class="io-description"><p>The last row as reported by the adapter</p>
|
|
1128
|
+
</div>
|
|
1129
|
+
|
|
1130
|
+
</td>
|
|
1131
|
+
</tr>
|
|
1132
|
+
|
|
1133
|
+
</tbody>
|
|
1134
|
+
</table>
|
|
1135
|
+
</section>
|
|
1136
|
+
</div>
|
|
1137
|
+
|
|
1138
|
+
|
|
1139
|
+
<div class="tab-pane fade tab-source-code" id="c-source">
|
|
1140
|
+
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
|
|
1141
|
+
BehaviorSubject,
|
|
1142
|
+
Observable,
|
|
1143
|
+
combineLatest
|
|
1144
|
+
} from "rxjs";
|
|
1145
|
+
import { map } from "rxjs/operators";
|
|
1146
|
+
import { TableAdapter } from "./table-adapter.class";
|
|
1147
|
+
import { tabbableSelectorIgnoreTabIndex, getFocusElementList } from "./../common/tab.service";
|
|
1148
|
+
|
|
1149
|
+
/**
|
|
1150
|
+
* The current and previous position in the grid.
|
|
1151
|
+
*
|
|
1152
|
+
* `current` and `previous` are tuples that follow the `[row, column]` convention.
|
|
1153
|
+
*/
|
|
1154
|
+
export interface DataGridPosition {
|
|
1155
|
+
current: [number, number];
|
|
1156
|
+
previous: [number, number];
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
/**
|
|
1160
|
+
* `DataGridInteractionModel` provides centralized control over arbitrary 2d grids, following the w3 specs.
|
|
1161
|
+
*
|
|
1162
|
+
* Refs:
|
|
1163
|
+
* - https://www.w3.org/TR/wai-aria-practices/examples/grid/dataGrids.html
|
|
1164
|
+
* - https://www.w3.org/TR/wai-aria-practices/#grid
|
|
1165
|
+
*
|
|
1166
|
+
* Example usage (taken from `table.component`):
|
|
1167
|
+
```typescript
|
|
1168
|
+
// a standard HTML table
|
|
1169
|
+
const table = this.elementRef.nativeElement.querySelector("table") as HTMLTableElement;
|
|
1170
|
+
|
|
1171
|
+
// `TableDomAdapter` implements `TableAdapter` and provides a consistent interface to query rows and columns in a table
|
|
1172
|
+
const tableAdapter = new TableDomAdapter(table);
|
|
1173
|
+
|
|
1174
|
+
// the keydown events that we'll use for keyboard navigation of the table
|
|
1175
|
+
const keydownEventStream = fromEvent<KeyboardEvent>(table, "keydown");
|
|
1176
|
+
|
|
1177
|
+
// the click events we'll use to ensure focus is updated correctly on click
|
|
1178
|
+
const clickEventStream = fromEvent<MouseEvent>(table, "click");
|
|
1179
|
+
|
|
1180
|
+
// the `DataGridInteractionModel` instance!
|
|
1181
|
+
this.interactionModel = new DataGridInteractionModel(keydownEventStream, clickEventStream, tableAdapter);
|
|
1182
|
+
|
|
1183
|
+
// subscribe to the combined position updates
|
|
1184
|
+
this.interactionModel.position.subscribe(event => {
|
|
1185
|
+
const [currentRow, currentColumn] = event.current;
|
|
1186
|
+
const [previousRow, previousColumn] = event.previous;
|
|
1187
|
+
|
|
1188
|
+
// query the TableAdapter for the cell at the current row and column ...
|
|
1189
|
+
const currentElement = tableAdapter.getCell(currentRow, currentColumn);
|
|
1190
|
+
// ... and make it focusable it
|
|
1191
|
+
Table.setTabIndex(currentElement, 0);
|
|
1192
|
+
|
|
1193
|
+
// if the model has just initialized don't focus or reset anything
|
|
1194
|
+
if (previousRow === -1 || previousColumn === -1) { return; }
|
|
1195
|
+
|
|
1196
|
+
// query the TableAdapter for the cell at the previous row and column ...
|
|
1197
|
+
const previousElement = tableAdapter.getCell(previousRow, previousColumn);
|
|
1198
|
+
// ... and make it unfocusable (now there is only a single focusable cell)
|
|
1199
|
+
Table.setTabIndex(previousElement, -1);
|
|
1200
|
+
|
|
1201
|
+
// finally, focus the current cell (skipped during initilzation)
|
|
1202
|
+
Table.focus(currentElement);
|
|
1203
|
+
});
|
|
1204
|
+
```
|
|
1205
|
+
*/
|
|
1206
|
+
export class DataGridInteractionModel {
|
|
1207
|
+
/**
|
|
1208
|
+
* An Observable that provides an aggregated view of the `rowIndex` and `columnIndex` Observables
|
|
1209
|
+
*/
|
|
1210
|
+
readonly position: Observable<DataGridPosition>;
|
|
1211
|
+
/**
|
|
1212
|
+
* An Observable that provides the current and previous row indexes.
|
|
1213
|
+
*/
|
|
1214
|
+
readonly rowIndex: Observable<{ current: number, previous: number }>;
|
|
1215
|
+
/**
|
|
1216
|
+
* An Observable that provides the current and previous column indexes.
|
|
1217
|
+
*/
|
|
1218
|
+
readonly columnIndex: Observable<{ current: number, previous: number }>;
|
|
1219
|
+
|
|
1220
|
+
/**
|
|
1221
|
+
* Internal subject to handle changes in row
|
|
1222
|
+
*/
|
|
1223
|
+
protected rowSubject = new BehaviorSubject({ current: 0, previous: -1 });
|
|
1224
|
+
/**
|
|
1225
|
+
* Internal subject to handle changes in column
|
|
1226
|
+
*/
|
|
1227
|
+
protected columnSubject = new BehaviorSubject({ current: 0, previous: -1 });
|
|
1228
|
+
|
|
1229
|
+
/**
|
|
1230
|
+
* The latest value emitted by the rowSubject
|
|
1231
|
+
*/
|
|
1232
|
+
protected get currentRow() {
|
|
1233
|
+
return this.rowSubject.getValue().current;
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
/**
|
|
1237
|
+
* The latest value emitted by the columnSubject
|
|
1238
|
+
*/
|
|
1239
|
+
protected get currentColumn() {
|
|
1240
|
+
return this.columnSubject.getValue().current;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* The last column as reported by the adapter
|
|
1245
|
+
*/
|
|
1246
|
+
protected get lastColumn() {
|
|
1247
|
+
return this.tableAdapter.lastColumnIndex;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* The last row as reported by the adapter
|
|
1252
|
+
*/
|
|
1253
|
+
protected get lastRow() {
|
|
1254
|
+
return this.tableAdapter.lastRowIndex;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
/**
|
|
1258
|
+
* `DataGridInteractionModel` requires knowledge of events, and a representation of your table/grid to be useful.
|
|
1259
|
+
*
|
|
1260
|
+
* @param keyboardEventStream an Observable of KeyboardEvents. Should be scoped to the table container.
|
|
1261
|
+
* @param clickEventStream an Observable of ClickEvents. should only include clicks that take action on items known by the TableAdapter
|
|
1262
|
+
* @param tableAdapter an instance of a concrete class that implements TableAdapter. The standard carbon table uses TableDomAdapter
|
|
1263
|
+
*/
|
|
1264
|
+
constructor(
|
|
1265
|
+
protected keyboardEventStream: Observable<KeyboardEvent>,
|
|
1266
|
+
protected clickEventStream: Observable<MouseEvent>,
|
|
1267
|
+
protected tableAdapter: TableAdapter
|
|
1268
|
+
) {
|
|
1269
|
+
this.rowIndex = this.rowSubject.asObservable();
|
|
1270
|
+
this.columnIndex = this.columnSubject.asObservable();
|
|
1271
|
+
this.position = combineLatest(this.rowIndex, this.columnIndex).pipe(map(positions => {
|
|
1272
|
+
const [row, column] = positions;
|
|
1273
|
+
return {
|
|
1274
|
+
current: [row.current, column.current],
|
|
1275
|
+
previous: [row.previous, column.previous]
|
|
1276
|
+
};
|
|
1277
|
+
})) as Observable<DataGridPosition>;
|
|
1278
|
+
this.keyboardEventStream.subscribe(this.handleKeyboardEvent.bind(this));
|
|
1279
|
+
this.clickEventStream.subscribe(this.handleClickEvent.bind(this));
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
/**
|
|
1283
|
+
* Handles moving the position according to the w3 datagrid navigation specs
|
|
1284
|
+
*
|
|
1285
|
+
* Refs:
|
|
1286
|
+
* - https://www.w3.org/TR/wai-aria-practices/examples/grid/dataGrids.html
|
|
1287
|
+
* - https://www.w3.org/TR/wai-aria-practices/#grid
|
|
1288
|
+
*
|
|
1289
|
+
* @param event the KeyboardEvent to handle
|
|
1290
|
+
*/
|
|
1291
|
+
handleKeyboardEvent(event: KeyboardEvent) {
|
|
1292
|
+
const currentCell = this.tableAdapter.getCell(this.currentRow, this.currentColumn);
|
|
1293
|
+
switch (event.key) {
|
|
1294
|
+
case "Right": // IE specific value
|
|
1295
|
+
case "ArrowRight":
|
|
1296
|
+
event.preventDefault();
|
|
1297
|
+
// add the colspan since getColumnFromCell will return the
|
|
1298
|
+
// first column containing the cell (of N columns it may span)
|
|
1299
|
+
// and we want to navigate to the next "real" column
|
|
1300
|
+
this.goToColumn(this.tableAdapter.findColumnIndex(currentCell) + currentCell.colSpan);
|
|
1301
|
+
break;
|
|
1302
|
+
case "Left": // IE specific value
|
|
1303
|
+
case "ArrowLeft":
|
|
1304
|
+
event.preventDefault();
|
|
1305
|
+
// we only ever need to subtract 1 from the column, since getColumnFromCell returns the
|
|
1306
|
+
// first of N columns containing the cell
|
|
1307
|
+
this.goToColumn(this.tableAdapter.findColumnIndex(currentCell) - 1);
|
|
1308
|
+
break;
|
|
1309
|
+
case "Down": // IE specific value
|
|
1310
|
+
case "ArrowDown":
|
|
1311
|
+
event.preventDefault();
|
|
1312
|
+
this.goToRow(this.currentRow + 1);
|
|
1313
|
+
break;
|
|
1314
|
+
case "Up": // IE specific value
|
|
1315
|
+
case "ArrowUp":
|
|
1316
|
+
event.preventDefault();
|
|
1317
|
+
this.goToRow(this.currentRow - 1);
|
|
1318
|
+
break;
|
|
1319
|
+
case "Home":
|
|
1320
|
+
event.preventDefault();
|
|
1321
|
+
if (event.ctrlKey) {
|
|
1322
|
+
this.goTo({row: 0, column: 0});
|
|
1323
|
+
} else {
|
|
1324
|
+
this.goToColumn(0);
|
|
1325
|
+
}
|
|
1326
|
+
break;
|
|
1327
|
+
case "End":
|
|
1328
|
+
event.preventDefault();
|
|
1329
|
+
if (event.ctrlKey) {
|
|
1330
|
+
this.goTo({ row: this.lastRow, column: this.lastColumn });
|
|
1331
|
+
} else {
|
|
1332
|
+
this.goToColumn(this.lastColumn);
|
|
1333
|
+
}
|
|
1334
|
+
break;
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
/**
|
|
1339
|
+
* Handles moving the position to the clicked cell
|
|
1340
|
+
*
|
|
1341
|
+
* @param event the MouseEvent to handle
|
|
1342
|
+
*/
|
|
1343
|
+
handleClickEvent(event: MouseEvent) {
|
|
1344
|
+
const cell = (event.target as HTMLElement).closest("td, th") as HTMLTableCellElement;
|
|
1345
|
+
const [rowIndex, cellIndex] = this.tableAdapter.findIndex(cell);
|
|
1346
|
+
this.goTo({ row: rowIndex, column: cellIndex });
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
/**
|
|
1350
|
+
* Jump to a specific column without changing the row
|
|
1351
|
+
*
|
|
1352
|
+
* @param index column to jump to
|
|
1353
|
+
*/
|
|
1354
|
+
goToColumn(index: number) {
|
|
1355
|
+
if (index > this.lastColumn || index < 0) { return; }
|
|
1356
|
+
this.goTo({ row: this.currentRow, column: index});
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
/**
|
|
1360
|
+
* Jump to a specific row without chaning the column
|
|
1361
|
+
*
|
|
1362
|
+
* @param index row to jump to
|
|
1363
|
+
*/
|
|
1364
|
+
goToRow(index: number) {
|
|
1365
|
+
if (index > this.lastRow || index < 0) { return; }
|
|
1366
|
+
this.goTo({row: index, column: this.currentColumn});
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
/**
|
|
1370
|
+
* Jump to the specified row and column
|
|
1371
|
+
*
|
|
1372
|
+
* @param param0 an object that contains `row` and `column` properties
|
|
1373
|
+
*/
|
|
1374
|
+
goTo({row, column}) {
|
|
1375
|
+
this.rowSubject.next({ current: row, previous: this.currentRow });
|
|
1376
|
+
this.columnSubject.next({ current: column, previous: this.currentColumn });
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* Convenience method to reset the tab indexes on a standard carbon table.
|
|
1381
|
+
* For custom tables you may want to reset the indexes manually and simply call `.reset()`
|
|
1382
|
+
*/
|
|
1383
|
+
resetTabIndexes(newTabIndex = -1) {
|
|
1384
|
+
for (let i = 0; i < this.tableAdapter.lastRowIndex; i++) {
|
|
1385
|
+
const row = this.tableAdapter.getRow(i) as HTMLTableRowElement;
|
|
1386
|
+
for (const cell of Array.from(row.cells)) {
|
|
1387
|
+
const tabbableElements = getFocusElementList(cell, tabbableSelectorIgnoreTabIndex);
|
|
1388
|
+
tabbableElements.forEach((node: HTMLElement) => node.tabIndex = newTabIndex);
|
|
1389
|
+
cell.tabIndex = newTabIndex;
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
this.reset();
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
/**
|
|
1397
|
+
* Resets the models focus position
|
|
1398
|
+
*/
|
|
1399
|
+
reset() {
|
|
1400
|
+
this.rowSubject.next({ current: 0, previous: -1 });
|
|
1401
|
+
this.columnSubject.next({ current: 0, previous: -1 });
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
</code></pre>
|
|
1405
|
+
</div>
|
|
1406
|
+
</div>
|
|
1407
|
+
|
|
1408
|
+
|
|
1409
|
+
|
|
1410
|
+
|
|
1411
|
+
|
|
1412
|
+
|
|
1413
|
+
|
|
1414
|
+
</div><div class="search-results">
|
|
1415
|
+
<div class="has-results">
|
|
1416
|
+
<h1 class="search-results-title"><span class='search-results-count'></span> result-matching "<span class='search-query'></span>"</h1>
|
|
1417
|
+
<ul class="search-results-list"></ul>
|
|
1418
|
+
</div>
|
|
1419
|
+
<div class="no-results">
|
|
1420
|
+
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
|
|
1421
|
+
</div>
|
|
1422
|
+
</div>
|
|
1423
|
+
</div>
|
|
1424
|
+
<!-- END CONTENT -->
|
|
1425
|
+
</div>
|
|
1426
|
+
</div>
|
|
1427
|
+
|
|
1428
|
+
<script>
|
|
1429
|
+
var COMPODOC_CURRENT_PAGE_DEPTH = 1;
|
|
1430
|
+
var COMPODOC_CURRENT_PAGE_CONTEXT = 'class';
|
|
1431
|
+
var COMPODOC_CURRENT_PAGE_URL = 'DataGridInteractionModel.html';
|
|
1432
|
+
</script>
|
|
1433
|
+
|
|
1434
|
+
<script src="../js/libs/custom-elements.min.js"></script>
|
|
1435
|
+
<script src="../js/libs/lit-html.js"></script>
|
|
1436
|
+
<!-- Required to polyfill modern browsers as code is ES5 for IE... -->
|
|
1437
|
+
<script src="../js/libs/custom-elements-es5-adapter.js" charset="utf-8" defer></script>
|
|
1438
|
+
<script src="../js/menu-wc.js" defer></script>
|
|
1439
|
+
|
|
1440
|
+
<script src="../js/libs/bootstrap-native.js"></script>
|
|
1441
|
+
|
|
1442
|
+
<script src="../js/libs/es6-shim.min.js"></script>
|
|
1443
|
+
<script src="../js/libs/EventDispatcher.js"></script>
|
|
1444
|
+
<script src="../js/libs/promise.min.js"></script>
|
|
1445
|
+
<script src="../js/libs/zepto.min.js"></script>
|
|
1446
|
+
|
|
1447
|
+
<script src="../js/compodoc.js"></script>
|
|
1448
|
+
|
|
1449
|
+
<script src="../js/tabs.js"></script>
|
|
1450
|
+
<script src="../js/menu.js"></script>
|
|
1451
|
+
<script src="../js/libs/clipboard.min.js"></script>
|
|
1452
|
+
<script src="../js/libs/prism.js"></script>
|
|
1453
|
+
<script src="../js/sourceCode.js"></script>
|
|
1454
|
+
<script src="../js/search/search.js"></script>
|
|
1455
|
+
<script src="../js/search/lunr.min.js"></script>
|
|
1456
|
+
<script src="../js/search/search-lunr.js"></script>
|
|
1457
|
+
<script src="../js/search/search_index.js"></script>
|
|
1458
|
+
<script src="../js/lazy-load-graphs.js"></script>
|
|
1459
|
+
|
|
1460
|
+
|
|
1461
|
+
</body>
|
|
1462
|
+
</html>
|