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 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"TableExpandButton":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":10,"character":1},"arguments":[{"selector":"[ibmTableExpandButton]","template":"\n\t\t<button\n\t\t\t*ngIf=\"expandable\"\n\t\t\tclass=\"bx--table-expand__button\"\n\t\t\t[attr.aria-label]=\"getAriaLabel() | async\"\n\t\t\t(click)=\"expandRow.emit()\">\n\t\t\t<ibm-icon-chevron-right16 innerClass=\"bx--table-expand__svg\"></ibm-icon-chevron-right16>\n\t\t</button>\n\t"}]}],"members":{"expanded":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":27,"character":2}}]}],"expandable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":32,"character":2}}]}],"ariaLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":34,"character":2}}]}],"skeleton":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":43,"character":2}}]}],"expandClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":45,"character":2},"arguments":["class.bx--table-expand"]}]}],"previousValue":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":47,"character":2},"arguments":["attr.data-previous-value"]}]}],"expandRow":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":51,"character":2}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./../../i18n/i18n.module","name":"I18n","line":55,"character":29}]}],"getAriaLabel":[{"__symbolic":"method"}]}}}}]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
*
|
|
3
|
+
* carbon-angular v0.0.0 | table-expand-button.component.ngfactory.d.ts
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2014, 2019 IBM
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
*
|
|
3
|
+
* carbon-angular v0.0.0 | table-expand-button.component.ngfactory.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2014, 2019 IBM
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @fileoverview This file was generated by the Angular template compiler. Do not edit.
|
|
23
|
+
*
|
|
24
|
+
* @suppress {suspiciousCode,uselessCode,missingProperties,missingOverride,checkTypes}
|
|
25
|
+
* tslint:disable
|
|
26
|
+
*/
|
|
27
|
+
import * as i0 from "@angular/core";
|
|
28
|
+
import * as i1 from "@angular/common";
|
|
29
|
+
import * as i2 from "../../../../node_modules/@carbon/icons-angular/lib/chevron--right/16.ngfactory";
|
|
30
|
+
import * as i3 from "@carbon/icons-angular/lib/chevron--right/16";
|
|
31
|
+
import * as i4 from "./table-expand-button.component";
|
|
32
|
+
import * as i5 from "../../i18n/i18n.service";
|
|
33
|
+
var styles_TableExpandButton = [];
|
|
34
|
+
var RenderType_TableExpandButton = i0.ɵcrt({ encapsulation: 2, styles: styles_TableExpandButton, data: {} });
|
|
35
|
+
export { RenderType_TableExpandButton as RenderType_TableExpandButton };
|
|
36
|
+
function View_TableExpandButton_1(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 3, "button", [["class", "bx--table-expand__button"]], [[1, "aria-label", 0]], [[null, "click"]], function (_v, en, $event) { var ad = true; var _co = _v.component; if (("click" === en)) {
|
|
37
|
+
var pd_0 = (_co.expandRow.emit() !== false);
|
|
38
|
+
ad = (pd_0 && ad);
|
|
39
|
+
} return ad; }, null, null)), i0.ɵpid(131072, i1.AsyncPipe, [i0.ChangeDetectorRef]), (_l()(), i0.ɵeld(2, 0, null, null, 1, "ibm-icon-chevron-right16", [["innerClass", "bx--table-expand__svg"]], null, null, null, i2.View_ChevronRight16_0, i2.RenderType_ChevronRight16)), i0.ɵdid(3, 49152, null, 0, i3.ChevronRight16, [], { innerClass: [0, "innerClass"] }, null)], function (_ck, _v) { var currVal_1 = "bx--table-expand__svg"; _ck(_v, 3, 0, currVal_1); }, function (_ck, _v) { var _co = _v.component; var currVal_0 = i0.ɵunv(_v, 0, 0, i0.ɵnov(_v, 1).transform(_co.getAriaLabel())); _ck(_v, 0, 0, currVal_0); }); }
|
|
40
|
+
export function View_TableExpandButton_0(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵand(16777216, null, null, 1, null, View_TableExpandButton_1)), i0.ɵdid(1, 16384, null, 0, i1.NgIf, [i0.ViewContainerRef, i0.TemplateRef], { ngIf: [0, "ngIf"] }, null)], function (_ck, _v) { var _co = _v.component; var currVal_0 = _co.expandable; _ck(_v, 1, 0, currVal_0); }, null); }
|
|
41
|
+
export function View_TableExpandButton_Host_0(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 1, "div", [["ibmTableExpandButton", ""]], [[2, "bx--table-expand", null], [1, "data-previous-value", 0]], null, null, View_TableExpandButton_0, RenderType_TableExpandButton)), i0.ɵdid(1, 49152, null, 0, i4.TableExpandButton, [i5.I18n], null, null)], null, function (_ck, _v) { var currVal_0 = i0.ɵnov(_v, 1).expandClass; var currVal_1 = i0.ɵnov(_v, 1).previousValue; _ck(_v, 0, 0, currVal_0, currVal_1); }); }
|
|
42
|
+
var TableExpandButtonNgFactory = i0.ɵccf("[ibmTableExpandButton]", i4.TableExpandButton, View_TableExpandButton_Host_0, { expanded: "expanded", expandable: "expandable", ariaLabel: "ariaLabel", skeleton: "skeleton" }, { expandRow: "expandRow" }, []);
|
|
43
|
+
export { TableExpandButtonNgFactory as TableExpandButtonNgFactory };
|
|
44
|
+
//# sourceMappingURL=table-expand-button.component.ngfactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-expand-button.component.ngfactory.js","sourceRoot":"","sources":["../../src/table/cell/table-expand-button.component.ngfactory.ts","../../src/table/cell/table-expand-button.component.ts.TableExpandButton.html"],"names":[],"mappings":";;;;;;;;;;;;;;;4DCCE,0LAI4B,YAA3B;;wBAA0B;MAJ3B,wBAI4B,IAD3B,mDAA0C,KAE1C,iRAA6D,yBAAnC,uCAAkC,EAA5D,YAA6D,EAAnC,SAAkC,mDAF5D,8DAA0C,mBAH3C,YAI4B,EAD3B,SAA0C;mEAH3C,iLAI4B,iDAH3B,mBAAkB,aADnB,YAI4B,EAH3B,SAAkB","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n","\n\t\t<button\n\t\t\t*ngIf=\"expandable\"\n\t\t\tclass=\"bx--table-expand__button\"\n\t\t\t[attr.aria-label]=\"getAriaLabel() | async\"\n\t\t\t(click)=\"expandRow.emit()\">\n\t\t\t<ibm-icon-chevron-right16 innerClass=\"bx--table-expand__svg\"></ibm-icon-chevron-right16>\n\t\t</button>\n\t"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"moduleName":null,"summaries":[{"symbol":{"__symbol":0,"members":[]},"metadata":{"__symbolic":"class","members":{"expanded":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbol":1,"members":[]}}]}],"expandable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbol":1,"members":[]}}]}],"ariaLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbol":1,"members":[]}}]}],"skeleton":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbol":1,"members":[]}}]}],"expandClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbol":2,"members":[]},"arguments":["class.bx--table-expand"]}]}],"previousValue":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbol":2,"members":[]},"arguments":["attr.data-previous-value"]}]}],"expandRow":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbol":3,"members":[]}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbol":4,"members":[]}]}],"getAriaLabel":[{"__symbolic":"method"}]}},"type":{"summaryKind":1,"type":{"reference":{"__symbol":0,"members":[]},"diDeps":[{"isAttribute":false,"isHost":false,"isSelf":false,"isSkipSelf":false,"isOptional":false,"token":{"identifier":{"reference":{"__symbol":5,"members":[]}}}}],"lifecycleHooks":[]},"isComponent":true,"selector":"[ibmTableExpandButton]","exportAs":null,"inputs":{"expanded":"expanded","expandable":"expandable","ariaLabel":"ariaLabel","skeleton":"skeleton"},"outputs":{"expandRow":"expandRow"},"hostListeners":{},"hostProperties":{"class.bx--table-expand":"expandClass","attr.data-previous-value":"previousValue"},"hostAttributes":{},"providers":[],"viewProviders":[],"queries":[],"guards":{},"viewQueries":[],"entryComponents":[],"changeDetection":1,"template":{"ngContentSelectors":[],"encapsulation":2},"componentViewType":{"__symbol":6,"members":[]},"rendererType":{"__symbol":7,"members":[]},"componentFactory":{"__symbol":8,"members":[]}}}],"symbols":[{"__symbol":0,"name":"TableExpandButton","filePath":"./table-expand-button.component"},{"__symbol":1,"name":"Input","filePath":"@angular/core"},{"__symbol":2,"name":"HostBinding","filePath":"@angular/core"},{"__symbol":3,"name":"Output","filePath":"@angular/core"},{"__symbol":4,"name":"I18n","filePath":"../../i18n/i18n.module"},{"__symbol":5,"name":"I18n","filePath":"../../i18n/i18n.service"},{"__symbol":6,"name":"View_TableExpandButton_0","filePath":"./table-expand-button.component.ngfactory"},{"__symbol":7,"name":"RenderType_TableExpandButton","filePath":"./table-expand-button.component.ngfactory"},{"__symbol":8,"name":"TableExpandButtonNgFactory","filePath":"./table-expand-button.component.ngfactory"}]}
|
|
@@ -19,6 +19,11 @@
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
import { ElementRef, EventEmitter } from "@angular/core";
|
|
22
|
+
/**
|
|
23
|
+
* NOTE: This directive has been deprecated in favor of `DataGridInteractionModel`
|
|
24
|
+
*
|
|
25
|
+
* @deprecated
|
|
26
|
+
*/
|
|
22
27
|
export declare class DataGridFocus {
|
|
23
28
|
protected elementRef: ElementRef;
|
|
24
29
|
ibmDataGridFocus: boolean;
|
|
@@ -26,7 +31,6 @@ export declare class DataGridFocus {
|
|
|
26
31
|
columnIndexChange: EventEmitter<number>;
|
|
27
32
|
protected _columnIndex: number;
|
|
28
33
|
constructor(elementRef: ElementRef);
|
|
29
|
-
focus(element: any): void;
|
|
30
34
|
keyDown(event: KeyboardEvent): void;
|
|
31
35
|
onClick(): void;
|
|
32
36
|
}
|
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
import { Directive, Input, ElementRef, HostListener, Output, EventEmitter } from "@angular/core";
|
|
22
22
|
import { Table } from "./table.component";
|
|
23
23
|
import { getFocusElementList, tabbableSelectorIgnoreTabIndex } from "../common/tab.service";
|
|
24
|
+
/**
|
|
25
|
+
* NOTE: This directive has been deprecated in favor of `DataGridInteractionModel`
|
|
26
|
+
*
|
|
27
|
+
* @deprecated
|
|
28
|
+
*/
|
|
24
29
|
var DataGridFocus = /** @class */ (function () {
|
|
25
30
|
function DataGridFocus(elementRef) {
|
|
26
31
|
this.elementRef = elementRef;
|
|
@@ -40,18 +45,6 @@ var DataGridFocus = /** @class */ (function () {
|
|
|
40
45
|
enumerable: true,
|
|
41
46
|
configurable: true
|
|
42
47
|
});
|
|
43
|
-
DataGridFocus.prototype.focus = function (element) {
|
|
44
|
-
var focusElementList = getFocusElementList(element, tabbableSelectorIgnoreTabIndex);
|
|
45
|
-
if (element.firstElementChild && element.firstElementChild.classList.contains("bx--table-sort-v2")) {
|
|
46
|
-
focusElementList[1].focus();
|
|
47
|
-
}
|
|
48
|
-
else if (focusElementList.length > 0) {
|
|
49
|
-
focusElementList[0].focus();
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
element.focus();
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
48
|
DataGridFocus.prototype.keyDown = function (event) {
|
|
56
49
|
if (!this.ibmDataGridFocus) {
|
|
57
50
|
return;
|
|
@@ -71,7 +64,7 @@ var DataGridFocus = /** @class */ (function () {
|
|
|
71
64
|
var nextSibling = element.nextElementSibling;
|
|
72
65
|
Table.setTabIndex(element, -1);
|
|
73
66
|
Table.setTabIndex(nextSibling, 0);
|
|
74
|
-
|
|
67
|
+
Table.focus(nextSibling);
|
|
75
68
|
}
|
|
76
69
|
break;
|
|
77
70
|
case "Left": // IE specific value
|
|
@@ -82,7 +75,7 @@ var DataGridFocus = /** @class */ (function () {
|
|
|
82
75
|
var previousSibling = element.previousElementSibling;
|
|
83
76
|
Table.setTabIndex(element, -1);
|
|
84
77
|
Table.setTabIndex(previousSibling, 0);
|
|
85
|
-
|
|
78
|
+
Table.focus(previousSibling);
|
|
86
79
|
}
|
|
87
80
|
break;
|
|
88
81
|
case "Down": // IE specific value
|
|
@@ -94,14 +87,14 @@ var DataGridFocus = /** @class */ (function () {
|
|
|
94
87
|
Table.setTabIndex(element, -1);
|
|
95
88
|
if (rows[rowIndex].classList.contains("bx--expandable-row-v2") && !rows[rowIndex].classList.contains("bx--parent-row-v2")) {
|
|
96
89
|
Table.setTabIndex(row_1[0], 0);
|
|
97
|
-
|
|
90
|
+
Table.focus(row_1[0]);
|
|
98
91
|
}
|
|
99
92
|
else {
|
|
100
93
|
if (this.columnIndex > row_1.length - 1) {
|
|
101
94
|
this.columnIndex = row_1.length - 1;
|
|
102
95
|
}
|
|
103
96
|
Table.setTabIndex(row_1[this.columnIndex], 0);
|
|
104
|
-
|
|
97
|
+
Table.focus(row_1[this.columnIndex]);
|
|
105
98
|
}
|
|
106
99
|
}
|
|
107
100
|
break;
|
|
@@ -117,14 +110,14 @@ var DataGridFocus = /** @class */ (function () {
|
|
|
117
110
|
var row = rows[rowIndex].querySelectorAll("td, th");
|
|
118
111
|
if (rows[rowIndex].classList.contains("bx--expandable-row-v2") && !rows[rowIndex].classList.contains("bx--parent-row-v2")) {
|
|
119
112
|
Table.setTabIndex(row[0], 0);
|
|
120
|
-
|
|
113
|
+
Table.focus(row[0]);
|
|
121
114
|
}
|
|
122
115
|
else {
|
|
123
116
|
if (this.columnIndex > row.length - 1) {
|
|
124
117
|
this.columnIndex = row.length - 1;
|
|
125
118
|
}
|
|
126
119
|
Table.setTabIndex(row[this.columnIndex], 0);
|
|
127
|
-
|
|
120
|
+
Table.focus(row[this.columnIndex]);
|
|
128
121
|
}
|
|
129
122
|
break;
|
|
130
123
|
case "Home":
|
|
@@ -134,18 +127,18 @@ var DataGridFocus = /** @class */ (function () {
|
|
|
134
127
|
if (event.ctrlKey) {
|
|
135
128
|
if (Array.from(headerRow).some(function (th) { return getFocusElementList(th, tabbableSelectorIgnoreTabIndex).length > 0; })) {
|
|
136
129
|
Table.setTabIndex(headerRow[0], 0);
|
|
137
|
-
|
|
130
|
+
Table.focus(headerRow[0]);
|
|
138
131
|
}
|
|
139
132
|
else {
|
|
140
133
|
var firstBodyCell = rows[1].querySelectorAll("td")[0];
|
|
141
134
|
Table.setTabIndex(firstBodyCell, 0);
|
|
142
|
-
|
|
135
|
+
Table.focus(firstBodyCell);
|
|
143
136
|
}
|
|
144
137
|
}
|
|
145
138
|
else {
|
|
146
139
|
var firstRowCell = rows[rowIndex].querySelectorAll("th, td")[0];
|
|
147
140
|
Table.setTabIndex(firstRowCell, 0);
|
|
148
|
-
|
|
141
|
+
Table.focus(firstRowCell);
|
|
149
142
|
}
|
|
150
143
|
break;
|
|
151
144
|
case "End":
|
|
@@ -155,13 +148,13 @@ var DataGridFocus = /** @class */ (function () {
|
|
|
155
148
|
if (event.ctrlKey) {
|
|
156
149
|
this.columnIndex = lastRow.length - 1;
|
|
157
150
|
Table.setTabIndex(lastRow[this.columnIndex], 0);
|
|
158
|
-
|
|
151
|
+
Table.focus(lastRow[this.columnIndex]);
|
|
159
152
|
}
|
|
160
153
|
else {
|
|
161
154
|
var currentRow = rows[rowIndex].querySelectorAll("th, td");
|
|
162
155
|
this.columnIndex = currentRow.length - 1;
|
|
163
156
|
Table.setTabIndex(currentRow[this.columnIndex], 0);
|
|
164
|
-
|
|
157
|
+
Table.focus(currentRow[this.columnIndex]);
|
|
165
158
|
}
|
|
166
159
|
break;
|
|
167
160
|
}
|
|
@@ -173,7 +166,7 @@ var DataGridFocus = /** @class */ (function () {
|
|
|
173
166
|
var focusElementList = getFocusElementList(this.elementRef.nativeElement.closest("table"), tabbableSelectorIgnoreTabIndex);
|
|
174
167
|
focusElementList.forEach(function (element) { return Table.setTabIndex(element, -1); });
|
|
175
168
|
Table.setTabIndex(this.elementRef.nativeElement, 0);
|
|
176
|
-
|
|
169
|
+
Table.focus(this.elementRef.nativeElement);
|
|
177
170
|
};
|
|
178
171
|
DataGridFocus.decorators = [
|
|
179
172
|
{ type: Directive, args: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid-focus.directive.js","sourceRoot":"","sources":["../src/table/data-grid-focus.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,KAAK,EACL,UAAU,EACV,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAE5F;IAoBC,uBAAsB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QAJlC,sBAAiB,GAAyB,IAAI,YAAY,EAAE,CAAC;IAIxB,CAAC;IAfhD,sBAAa,sCAAW;aAOxB;YACC,OAAO,IAAI,CAAC,YAAY,CAAC;QAC1B,CAAC;aATD,UAAyB,KAAa;YACrC,IAAM,UAAU,GAAG,KAAK,KAAK,IAAI,CAAC,YAAY,CAAC;YAC/C,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;YAC1B,IAAI,UAAU,EAAE;gBACf,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAA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,CAAC;iBACzC;gBACD,MAAM;SACP;IACF,CAAC;IAGD,+BAAO,GADP;QAEC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;YAC3B,OAAO;SACP;QACD,IAAM,gBAAgB,GAAG,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,8BAA8B,CAAC,CAAC;QAC7H,gBAAgB,CAAC,OAAO,CAAC,UAAA,OAAO,IAAI,OAAA,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAA9B,CAA8B,CAAC,CAAC;QACpE,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;QACpD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAC3C,CAAC;;gBA3JD,SAAS,SAAC;oBACV,QAAQ,EAAE,oBAAoB;iBAC9B;;;;gBAVA,UAAU;;;mCAYT,KAAK;8BACL,KAAK;oCAWL,MAAM;0BAiBN,YAAY,SAAC,SAAS,EAAE,CAAC,QAAQ,CAAC;0BAiHlC,YAAY,SAAC,OAAO;;IAUtB,oBAAC;CAAA,AA5JD,IA4JC;SAzJY,aAAa","sourcesContent":["import {\n\tDirective,\n\tInput,\n\tElementRef,\n\tHostListener,\n\tOutput,\n\tEventEmitter\n} from \"@angular/core\";\nimport { Table } from \"./table.component\";\nimport { getFocusElementList, tabbableSelectorIgnoreTabIndex } from \"../common/tab.service\";\n\n@Directive({\n\tselector: \"[ibmDataGridFocus]\"\n})\nexport class DataGridFocus {\n\t@Input() ibmDataGridFocus: boolean;\n\t@Input() set columnIndex(value: number) {\n\t\tconst shouldEmit = value !== this._columnIndex;\n\t\tthis._columnIndex = value;\n\t\tif (shouldEmit) {\n\t\t\tthis.columnIndexChange.emit(value);\n\t\t}\n\t}\n\tget columnIndex(): number {\n\t\treturn this._columnIndex;\n\t}\n\n\t@Output() columnIndexChange: EventEmitter<number> = new EventEmitter();\n\n\tprotected _columnIndex: number;\n\n\tconstructor(protected elementRef: ElementRef) {}\n\n\tfocus(element) {\n\t\tconst focusElementList = getFocusElementList(element, tabbableSelectorIgnoreTabIndex);\n\t\tif (element.firstElementChild && element.firstElementChild.classList.contains(\"bx--table-sort-v2\")) {\n\t\t\tfocusElementList[1].focus();\n\t\t} else if (focusElementList.length > 0) {\n\t\t\tfocusElementList[0].focus();\n\t\t} else {\n\t\t\telement.focus();\n\t\t}\n\t}\n\n\t@HostListener(\"keydown\", [\"$event\"])\n\tkeyDown(event: KeyboardEvent) {\n\t\tif (!this.ibmDataGridFocus) {\n\t\t\treturn;\n\t\t}\n\t\tconst element = this.elementRef.nativeElement;\n\t\tconst rows = element.closest(\"table\").rows;\n\t\tconst closestTr = element.closest(\"tr\");\n\t\tlet rowIndex = Array.from(rows).indexOf(closestTr);\n\n\t\tconst headerRow = rows[0].querySelectorAll(\"th\");\n\n\t\tswitch (event.key) {\n\t\t\tcase \"Right\": // IE specific value\n\t\t\tcase \"ArrowRight\":\n\t\t\t\tconst firstBodyRow = rows[1].querySelectorAll(\"td\");\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (element.nextElementSibling && Array.from(headerRow).indexOf(element.nextElementSibling) < firstBodyRow.length) {\n\t\t\t\t\tthis.columnIndex++;\n\t\t\t\t\tconst nextSibling = element.nextElementSibling;\n\t\t\t\t\tTable.setTabIndex(element, -1);\n\t\t\t\t\tTable.setTabIndex(nextSibling, 0);\n\t\t\t\t\tthis.focus(nextSibling);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"Left\": // IE specific value\n\t\t\tcase \"ArrowLeft\":\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (element.previousElementSibling) {\n\t\t\t\t\tthis.columnIndex--;\n\t\t\t\t\tconst previousSibling = element.previousElementSibling;\n\t\t\t\t\tTable.setTabIndex(element, -1);\n\t\t\t\t\tTable.setTabIndex(previousSibling, 0);\n\t\t\t\t\tthis.focus(previousSibling);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"Down\": // IE specific value\n\t\t\tcase \"ArrowDown\":\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (rowIndex < rows.length - 1) {\n\t\t\t\t\trowIndex++;\n\t\t\t\t\tconst row = rows[rowIndex].querySelectorAll(\"td\");\n\t\t\t\t\tTable.setTabIndex(element, -1);\n\t\t\t\t\tif (rows[rowIndex].classList.contains(\"bx--expandable-row-v2\") && !rows[rowIndex].classList.contains(\"bx--parent-row-v2\")) {\n\t\t\t\t\t\tTable.setTabIndex(row[0], 0);\n\t\t\t\t\t\tthis.focus(row[0]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (this.columnIndex > row.length - 1) {\n\t\t\t\t\t\t\tthis.columnIndex = row.length - 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tTable.setTabIndex(row[this.columnIndex], 0);\n\t\t\t\t\t\tthis.focus(row[this.columnIndex]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"Up\": // IE specific value\n\t\t\tcase \"ArrowUp\":\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ((rowIndex === 1 && Array.from(headerRow).every(th => getFocusElementList(th, tabbableSelectorIgnoreTabIndex).length === 0)) ||\n\t\t\t\t\trowIndex === 0) {\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tTable.setTabIndex(element, -1);\n\t\t\t\trowIndex--;\n\t\t\t\tconst row = rows[rowIndex].querySelectorAll(\"td, th\");\n\t\t\t\tif (rows[rowIndex].classList.contains(\"bx--expandable-row-v2\") && !rows[rowIndex].classList.contains(\"bx--parent-row-v2\")) {\n\t\t\t\t\tTable.setTabIndex(row[0], 0);\n\t\t\t\t\tthis.focus(row[0]);\n\t\t\t\t} else {\n\t\t\t\t\tif (this.columnIndex > row.length - 1) {\n\t\t\t\t\t\tthis.columnIndex = row.length - 1;\n\t\t\t\t\t}\n\t\t\t\t\tTable.setTabIndex(row[this.columnIndex], 0);\n\t\t\t\t\tthis.focus(row[this.columnIndex]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"Home\":\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.columnIndex = 0;\n\t\t\t\tTable.setTabIndex(element, -1);\n\t\t\t\tif (event.ctrlKey) {\n\t\t\t\t\tif (Array.from(headerRow).some(th => getFocusElementList(th, tabbableSelectorIgnoreTabIndex).length > 0)) {\n\t\t\t\t\t\tTable.setTabIndex(headerRow[0], 0);\n\t\t\t\t\t\tthis.focus(headerRow[0]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst firstBodyCell = rows[1].querySelectorAll(\"td\")[0];\n\t\t\t\t\t\tTable.setTabIndex(firstBodyCell, 0);\n\t\t\t\t\t\tthis.focus(firstBodyCell);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst firstRowCell = rows[rowIndex].querySelectorAll(\"th, td\")[0];\n\t\t\t\t\tTable.setTabIndex(firstRowCell, 0);\n\t\t\t\t\tthis.focus(firstRowCell);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"End\":\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst lastRow = rows[rows.length - 1].querySelectorAll(\"td\");\n\t\t\t\tTable.setTabIndex(element, -1);\n\t\t\t\tif (event.ctrlKey) {\n\t\t\t\t\tthis.columnIndex = lastRow.length - 1;\n\t\t\t\t\tTable.setTabIndex(lastRow[this.columnIndex], 0);\n\t\t\t\t\tthis.focus(lastRow[this.columnIndex]);\n\t\t\t\t} else {\n\t\t\t\t\tconst currentRow = rows[rowIndex].querySelectorAll(\"th, td\");\n\t\t\t\t\tthis.columnIndex = currentRow.length - 1;\n\t\t\t\t\tTable.setTabIndex(currentRow[this.columnIndex], 0);\n\t\t\t\t\tthis.focus(currentRow[this.columnIndex]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t@HostListener(\"click\")\n\tonClick() {\n\t\tif (!this.ibmDataGridFocus) {\n\t\t\treturn;\n\t\t}\n\t\tconst focusElementList = getFocusElementList(this.elementRef.nativeElement.closest(\"table\"), tabbableSelectorIgnoreTabIndex);\n\t\tfocusElementList.forEach(element => Table.setTabIndex(element, -1));\n\t\tTable.setTabIndex(this.elementRef.nativeElement, 0);\n\t\tthis.focus(this.elementRef.nativeElement);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"data-grid-focus.directive.js","sourceRoot":"","sources":["../src/table/data-grid-focus.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,KAAK,EACL,UAAU,EACV,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAE5F;;;;GAIG;AACH;IAoBC,uBAAsB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QAJlC,sBAAiB,GAAyB,IAAI,YAAY,EAAE,CAAC;IAIxB,CAAC;IAfhD,sBAAa,sCAAW;aAOxB;YACC,OAAO,IAAI,CAAC,YAAY,CAAC;QAC1B,CAAC;aATD,UAAyB,KAAa;YACrC,IAAM,UAAU,GAAG,KAAK,KAAK,IAAI,CAAC,YAAY,CAAC;YAC/C,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;YAC1B,IAAI,UAAU,EAAE;gBACf,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACnC;QACF,CAAC;;;OAAA;IAYD,+BAAO,GADP,UACQ,KAAoB;QAC3B,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;YAC3B,OAAO;SACP;QACD,IAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;QAC9C,IAAM,IAAI,GAAG,OA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BAMN,YAAY,SAAC,SAAS,EAAE,CAAC,QAAQ,CAAC;0BAiHlC,YAAY,SAAC,OAAO;;IAUtB,oBAAC;CAAA,AAjJD,IAiJC;SA9IY,aAAa","sourcesContent":["import {\n\tDirective,\n\tInput,\n\tElementRef,\n\tHostListener,\n\tOutput,\n\tEventEmitter\n} from \"@angular/core\";\nimport { Table } from \"./table.component\";\nimport { getFocusElementList, tabbableSelectorIgnoreTabIndex } from \"../common/tab.service\";\n\n/**\n * NOTE: This directive has been deprecated in favor of `DataGridInteractionModel`\n *\n * @deprecated\n */\n@Directive({\n\tselector: \"[ibmDataGridFocus]\"\n})\nexport class DataGridFocus {\n\t@Input() ibmDataGridFocus: boolean;\n\t@Input() set columnIndex(value: number) {\n\t\tconst shouldEmit = value !== this._columnIndex;\n\t\tthis._columnIndex = value;\n\t\tif (shouldEmit) {\n\t\t\tthis.columnIndexChange.emit(value);\n\t\t}\n\t}\n\tget columnIndex(): number {\n\t\treturn this._columnIndex;\n\t}\n\n\t@Output() columnIndexChange: EventEmitter<number> = new EventEmitter();\n\n\tprotected _columnIndex: number;\n\n\tconstructor(protected elementRef: ElementRef) {}\n\n\t@HostListener(\"keydown\", [\"$event\"])\n\tkeyDown(event: KeyboardEvent) {\n\t\tif (!this.ibmDataGridFocus) {\n\t\t\treturn;\n\t\t}\n\t\tconst element = this.elementRef.nativeElement;\n\t\tconst rows = element.closest(\"table\").rows;\n\t\tconst closestTr = element.closest(\"tr\");\n\t\tlet rowIndex = Array.from(rows).indexOf(closestTr);\n\n\t\tconst headerRow = rows[0].querySelectorAll(\"th\");\n\n\t\tswitch (event.key) {\n\t\t\tcase \"Right\": // IE specific value\n\t\t\tcase \"ArrowRight\":\n\t\t\t\tconst firstBodyRow = rows[1].querySelectorAll(\"td\");\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (element.nextElementSibling && Array.from(headerRow).indexOf(element.nextElementSibling) < firstBodyRow.length) {\n\t\t\t\t\tthis.columnIndex++;\n\t\t\t\t\tconst nextSibling = element.nextElementSibling;\n\t\t\t\t\tTable.setTabIndex(element, -1);\n\t\t\t\t\tTable.setTabIndex(nextSibling, 0);\n\t\t\t\t\tTable.focus(nextSibling);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"Left\": // IE specific value\n\t\t\tcase \"ArrowLeft\":\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (element.previousElementSibling) {\n\t\t\t\t\tthis.columnIndex--;\n\t\t\t\t\tconst previousSibling = element.previousElementSibling;\n\t\t\t\t\tTable.setTabIndex(element, -1);\n\t\t\t\t\tTable.setTabIndex(previousSibling, 0);\n\t\t\t\t\tTable.focus(previousSibling);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"Down\": // IE specific value\n\t\t\tcase \"ArrowDown\":\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (rowIndex < rows.length - 1) {\n\t\t\t\t\trowIndex++;\n\t\t\t\t\tconst row = rows[rowIndex].querySelectorAll(\"td\");\n\t\t\t\t\tTable.setTabIndex(element, -1);\n\t\t\t\t\tif (rows[rowIndex].classList.contains(\"bx--expandable-row-v2\") && !rows[rowIndex].classList.contains(\"bx--parent-row-v2\")) {\n\t\t\t\t\t\tTable.setTabIndex(row[0], 0);\n\t\t\t\t\t\tTable.focus(row[0]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (this.columnIndex > row.length - 1) {\n\t\t\t\t\t\t\tthis.columnIndex = row.length - 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tTable.setTabIndex(row[this.columnIndex], 0);\n\t\t\t\t\t\tTable.focus(row[this.columnIndex]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"Up\": // IE specific value\n\t\t\tcase \"ArrowUp\":\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ((rowIndex === 1 && Array.from(headerRow).every(th => getFocusElementList(th, tabbableSelectorIgnoreTabIndex).length === 0)) ||\n\t\t\t\t\trowIndex === 0) {\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tTable.setTabIndex(element, -1);\n\t\t\t\trowIndex--;\n\t\t\t\tconst row = rows[rowIndex].querySelectorAll(\"td, th\");\n\t\t\t\tif (rows[rowIndex].classList.contains(\"bx--expandable-row-v2\") && !rows[rowIndex].classList.contains(\"bx--parent-row-v2\")) {\n\t\t\t\t\tTable.setTabIndex(row[0], 0);\n\t\t\t\t\tTable.focus(row[0]);\n\t\t\t\t} else {\n\t\t\t\t\tif (this.columnIndex > row.length - 1) {\n\t\t\t\t\t\tthis.columnIndex = row.length - 1;\n\t\t\t\t\t}\n\t\t\t\t\tTable.setTabIndex(row[this.columnIndex], 0);\n\t\t\t\t\tTable.focus(row[this.columnIndex]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"Home\":\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.columnIndex = 0;\n\t\t\t\tTable.setTabIndex(element, -1);\n\t\t\t\tif (event.ctrlKey) {\n\t\t\t\t\tif (Array.from(headerRow).some(th => getFocusElementList(th, tabbableSelectorIgnoreTabIndex).length > 0)) {\n\t\t\t\t\t\tTable.setTabIndex(headerRow[0], 0);\n\t\t\t\t\t\tTable.focus(headerRow[0]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst firstBodyCell = rows[1].querySelectorAll(\"td\")[0];\n\t\t\t\t\t\tTable.setTabIndex(firstBodyCell, 0);\n\t\t\t\t\t\tTable.focus(firstBodyCell);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst firstRowCell = rows[rowIndex].querySelectorAll(\"th, td\")[0];\n\t\t\t\t\tTable.setTabIndex(firstRowCell, 0);\n\t\t\t\t\tTable.focus(firstRowCell);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"End\":\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst lastRow = rows[rows.length - 1].querySelectorAll(\"td\");\n\t\t\t\tTable.setTabIndex(element, -1);\n\t\t\t\tif (event.ctrlKey) {\n\t\t\t\t\tthis.columnIndex = lastRow.length - 1;\n\t\t\t\t\tTable.setTabIndex(lastRow[this.columnIndex], 0);\n\t\t\t\t\tTable.focus(lastRow[this.columnIndex]);\n\t\t\t\t} else {\n\t\t\t\t\tconst currentRow = rows[rowIndex].querySelectorAll(\"th, td\");\n\t\t\t\t\tthis.columnIndex = currentRow.length - 1;\n\t\t\t\t\tTable.setTabIndex(currentRow[this.columnIndex], 0);\n\t\t\t\t\tTable.focus(currentRow[this.columnIndex]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t@HostListener(\"click\")\n\tonClick() {\n\t\tif (!this.ibmDataGridFocus) {\n\t\t\treturn;\n\t\t}\n\t\tconst focusElementList = getFocusElementList(this.elementRef.nativeElement.closest(\"table\"), tabbableSelectorIgnoreTabIndex);\n\t\tfocusElementList.forEach(element => Table.setTabIndex(element, -1));\n\t\tTable.setTabIndex(this.elementRef.nativeElement, 0);\n\t\tTable.focus(this.elementRef.nativeElement);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"DataGridFocus":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"DataGridFocus":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":16,"character":1},"arguments":[{"selector":"[ibmDataGridFocus]"}]}],"members":{"ibmDataGridFocus":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":2}}]}],"columnIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":21,"character":2}}]}],"columnIndexChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":32,"character":2}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":36,"character":35}]}],"keyDown":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":38,"character":2},"arguments":["keydown",["$event"]]}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":151,"character":2},"arguments":["click"]}]}]}}}}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"moduleName":null,"summaries":[{"symbol":{"__symbol":0,"members":[]},"metadata":{"__symbolic":"class","members":{"ibmDataGridFocus":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbol":1,"members":[]}}]}],"columnIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbol":1,"members":[]}}]}],"columnIndexChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbol":2,"members":[]}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbol":3,"members":[]}]}],"
|
|
1
|
+
{"moduleName":null,"summaries":[{"symbol":{"__symbol":0,"members":[]},"metadata":{"__symbolic":"class","members":{"ibmDataGridFocus":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbol":1,"members":[]}}]}],"columnIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbol":1,"members":[]}}]}],"columnIndexChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbol":2,"members":[]}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbol":3,"members":[]}]}],"keyDown":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbol":4,"members":[]},"arguments":["keydown",["$event"]]}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbol":4,"members":[]},"arguments":["click"]}]}]}},"type":{"summaryKind":1,"type":{"reference":{"__symbol":0,"members":[]},"diDeps":[{"isAttribute":false,"isHost":false,"isSelf":false,"isSkipSelf":false,"isOptional":false,"token":{"identifier":{"reference":{"__symbol":3,"members":[]}}}}],"lifecycleHooks":[]},"isComponent":false,"selector":"[ibmDataGridFocus]","exportAs":null,"inputs":{"ibmDataGridFocus":"ibmDataGridFocus","columnIndex":"columnIndex"},"outputs":{"columnIndexChange":"columnIndexChange"},"hostListeners":{"keydown":"keyDown($event)","click":"onClick()"},"hostProperties":{},"hostAttributes":{},"providers":[],"viewProviders":[],"queries":[],"guards":{},"viewQueries":[],"entryComponents":[],"changeDetection":null,"template":null,"componentViewType":null,"rendererType":null,"componentFactory":null}}],"symbols":[{"__symbol":0,"name":"DataGridFocus","filePath":"./data-grid-focus.directive"},{"__symbol":1,"name":"Input","filePath":"@angular/core"},{"__symbol":2,"name":"Output","filePath":"@angular/core"},{"__symbol":3,"name":"ElementRef","filePath":"@angular/core"},{"__symbol":4,"name":"HostListener","filePath":"@angular/core"}]}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
*
|
|
3
|
+
* carbon-angular v0.0.0 | data-grid-interaction-model.class.d.ts
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2014, 2019 IBM
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
import { BehaviorSubject, Observable } from "rxjs";
|
|
22
|
+
import { TableAdapter } from "./table-adapter.class";
|
|
23
|
+
/**
|
|
24
|
+
* The current and previous position in the grid.
|
|
25
|
+
*
|
|
26
|
+
* `current` and `previous` are tuples that follow the `[row, column]` convention.
|
|
27
|
+
*/
|
|
28
|
+
export interface DataGridPosition {
|
|
29
|
+
current: [number, number];
|
|
30
|
+
previous: [number, number];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* `DataGridInteractionModel` provides centralized control over arbitrary 2d grids, following the w3 specs.
|
|
34
|
+
*
|
|
35
|
+
* Refs:
|
|
36
|
+
* - https://www.w3.org/TR/wai-aria-practices/examples/grid/dataGrids.html
|
|
37
|
+
* - https://www.w3.org/TR/wai-aria-practices/#grid
|
|
38
|
+
*
|
|
39
|
+
* Example usage (taken from `table.component`):
|
|
40
|
+
```typescript
|
|
41
|
+
// a standard HTML table
|
|
42
|
+
const table = this.elementRef.nativeElement.querySelector("table") as HTMLTableElement;
|
|
43
|
+
|
|
44
|
+
// `TableDomAdapter` implements `TableAdapter` and provides a consistent interface to query rows and columns in a table
|
|
45
|
+
const tableAdapter = new TableDomAdapter(table);
|
|
46
|
+
|
|
47
|
+
// the keydown events that we'll use for keyboard navigation of the table
|
|
48
|
+
const keydownEventStream = fromEvent<KeyboardEvent>(table, "keydown");
|
|
49
|
+
|
|
50
|
+
// the click events we'll use to ensure focus is updated correctly on click
|
|
51
|
+
const clickEventStream = fromEvent<MouseEvent>(table, "click");
|
|
52
|
+
|
|
53
|
+
// the `DataGridInteractionModel` instance!
|
|
54
|
+
this.interactionModel = new DataGridInteractionModel(keydownEventStream, clickEventStream, tableAdapter);
|
|
55
|
+
|
|
56
|
+
// subscribe to the combined position updates
|
|
57
|
+
this.interactionModel.position.subscribe(event => {
|
|
58
|
+
const [currentRow, currentColumn] = event.current;
|
|
59
|
+
const [previousRow, previousColumn] = event.previous;
|
|
60
|
+
|
|
61
|
+
// query the TableAdapter for the cell at the current row and column ...
|
|
62
|
+
const currentElement = tableAdapter.getCell(currentRow, currentColumn);
|
|
63
|
+
// ... and make it focusable it
|
|
64
|
+
Table.setTabIndex(currentElement, 0);
|
|
65
|
+
|
|
66
|
+
// if the model has just initialized don't focus or reset anything
|
|
67
|
+
if (previousRow === -1 || previousColumn === -1) { return; }
|
|
68
|
+
|
|
69
|
+
// query the TableAdapter for the cell at the previous row and column ...
|
|
70
|
+
const previousElement = tableAdapter.getCell(previousRow, previousColumn);
|
|
71
|
+
// ... and make it unfocusable (now there is only a single focusable cell)
|
|
72
|
+
Table.setTabIndex(previousElement, -1);
|
|
73
|
+
|
|
74
|
+
// finally, focus the current cell (skipped during initilzation)
|
|
75
|
+
Table.focus(currentElement);
|
|
76
|
+
});
|
|
77
|
+
```
|
|
78
|
+
*/
|
|
79
|
+
export declare class DataGridInteractionModel {
|
|
80
|
+
protected keyboardEventStream: Observable<KeyboardEvent>;
|
|
81
|
+
protected clickEventStream: Observable<MouseEvent>;
|
|
82
|
+
protected tableAdapter: TableAdapter;
|
|
83
|
+
/**
|
|
84
|
+
* An Observable that provides an aggregated view of the `rowIndex` and `columnIndex` Observables
|
|
85
|
+
*/
|
|
86
|
+
readonly position: Observable<DataGridPosition>;
|
|
87
|
+
/**
|
|
88
|
+
* An Observable that provides the current and previous row indexes.
|
|
89
|
+
*/
|
|
90
|
+
readonly rowIndex: Observable<{
|
|
91
|
+
current: number;
|
|
92
|
+
previous: number;
|
|
93
|
+
}>;
|
|
94
|
+
/**
|
|
95
|
+
* An Observable that provides the current and previous column indexes.
|
|
96
|
+
*/
|
|
97
|
+
readonly columnIndex: Observable<{
|
|
98
|
+
current: number;
|
|
99
|
+
previous: number;
|
|
100
|
+
}>;
|
|
101
|
+
/**
|
|
102
|
+
* Internal subject to handle changes in row
|
|
103
|
+
*/
|
|
104
|
+
protected rowSubject: BehaviorSubject<{
|
|
105
|
+
current: number;
|
|
106
|
+
previous: number;
|
|
107
|
+
}>;
|
|
108
|
+
/**
|
|
109
|
+
* Internal subject to handle changes in column
|
|
110
|
+
*/
|
|
111
|
+
protected columnSubject: BehaviorSubject<{
|
|
112
|
+
current: number;
|
|
113
|
+
previous: number;
|
|
114
|
+
}>;
|
|
115
|
+
/**
|
|
116
|
+
* The latest value emitted by the rowSubject
|
|
117
|
+
*/
|
|
118
|
+
protected readonly currentRow: number;
|
|
119
|
+
/**
|
|
120
|
+
* The latest value emitted by the columnSubject
|
|
121
|
+
*/
|
|
122
|
+
protected readonly currentColumn: number;
|
|
123
|
+
/**
|
|
124
|
+
* The last column as reported by the adapter
|
|
125
|
+
*/
|
|
126
|
+
protected readonly lastColumn: number;
|
|
127
|
+
/**
|
|
128
|
+
* The last row as reported by the adapter
|
|
129
|
+
*/
|
|
130
|
+
protected readonly lastRow: number;
|
|
131
|
+
/**
|
|
132
|
+
* `DataGridInteractionModel` requires knowledge of events, and a representation of your table/grid to be useful.
|
|
133
|
+
*
|
|
134
|
+
* @param keyboardEventStream an Observable of KeyboardEvents. Should be scoped to the table container.
|
|
135
|
+
* @param clickEventStream an Observable of ClickEvents. should only include clicks that take action on items known by the TableAdapter
|
|
136
|
+
* @param tableAdapter an instance of a concrete class that implements TableAdapter. The standard carbon table uses TableDomAdapter
|
|
137
|
+
*/
|
|
138
|
+
constructor(keyboardEventStream: Observable<KeyboardEvent>, clickEventStream: Observable<MouseEvent>, tableAdapter: TableAdapter);
|
|
139
|
+
/**
|
|
140
|
+
* Handles moving the position according to the w3 datagrid navigation specs
|
|
141
|
+
*
|
|
142
|
+
* Refs:
|
|
143
|
+
* - https://www.w3.org/TR/wai-aria-practices/examples/grid/dataGrids.html
|
|
144
|
+
* - https://www.w3.org/TR/wai-aria-practices/#grid
|
|
145
|
+
*
|
|
146
|
+
* @param event the KeyboardEvent to handle
|
|
147
|
+
*/
|
|
148
|
+
handleKeyboardEvent(event: KeyboardEvent): void;
|
|
149
|
+
/**
|
|
150
|
+
* Handles moving the position to the clicked cell
|
|
151
|
+
*
|
|
152
|
+
* @param event the MouseEvent to handle
|
|
153
|
+
*/
|
|
154
|
+
handleClickEvent(event: MouseEvent): void;
|
|
155
|
+
/**
|
|
156
|
+
* Jump to a specific column without changing the row
|
|
157
|
+
*
|
|
158
|
+
* @param index column to jump to
|
|
159
|
+
*/
|
|
160
|
+
goToColumn(index: number): void;
|
|
161
|
+
/**
|
|
162
|
+
* Jump to a specific row without chaning the column
|
|
163
|
+
*
|
|
164
|
+
* @param index row to jump to
|
|
165
|
+
*/
|
|
166
|
+
goToRow(index: number): void;
|
|
167
|
+
/**
|
|
168
|
+
* Jump to the specified row and column
|
|
169
|
+
*
|
|
170
|
+
* @param param0 an object that contains `row` and `column` properties
|
|
171
|
+
*/
|
|
172
|
+
goTo({ row, column }: {
|
|
173
|
+
row: any;
|
|
174
|
+
column: any;
|
|
175
|
+
}): void;
|
|
176
|
+
/**
|
|
177
|
+
* Convenience method to reset the tab indexes on a standard carbon table.
|
|
178
|
+
* For custom tables you may want to reset the indexes manually and simply call `.reset()`
|
|
179
|
+
*/
|
|
180
|
+
resetTabIndexes(newTabIndex?: number): void;
|
|
181
|
+
/**
|
|
182
|
+
* Resets the models focus position
|
|
183
|
+
*/
|
|
184
|
+
reset(): void;
|
|
185
|
+
}
|