carbon-components-angular 5.43.1 → 5.45.0
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/README.md +3 -4
- package/docs/documentation/classes/NumberChange.html +37 -3
- package/docs/documentation/classes/TableModel.html +290 -76
- package/docs/documentation/components/NumberComponent.html +459 -71
- package/docs/documentation/components/Table.html +182 -136
- package/docs/documentation/components/TableHead.html +231 -44
- package/docs/documentation/components/TableHeadExpand.html +359 -6
- package/docs/documentation/coverage.html +13 -13
- package/docs/documentation/index.html +2 -3
- package/docs/documentation/js/search/search_index.js +2 -2
- package/docs/documentation/modules/ThemeModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ThemeModule.html +4 -4
- package/docs/documentation/modules/TimePickerModule/dependencies.svg +44 -40
- package/docs/documentation/modules/TimePickerModule.html +44 -40
- package/docs/documentation/modules/TimePickerSelectModule/dependencies.svg +49 -45
- package/docs/documentation/modules/TimePickerSelectModule.html +49 -45
- package/docs/documentation/modules/ToggleModule/dependencies.svg +45 -41
- package/docs/documentation/modules/ToggleModule.html +45 -41
- package/docs/documentation/modules/ToggletipModule/dependencies.svg +39 -39
- package/docs/documentation/modules/ToggletipModule.html +39 -39
- package/docs/documentation/modules/TooltipModule/dependencies.svg +28 -28
- package/docs/documentation/modules/TooltipModule.html +28 -28
- package/docs/documentation/modules/TreeviewModule/dependencies.svg +37 -37
- package/docs/documentation/modules/TreeviewModule.html +37 -37
- package/docs/documentation.json +853 -400
- package/docs/storybook/5868.37cc7ea3.iframe.bundle.js +1 -0
- package/docs/storybook/9115.1d90f93b.iframe.bundle.js +1 -0
- package/docs/storybook/iframe.html +2 -2
- package/docs/storybook/index.html +27 -10
- package/docs/storybook/index.json +1 -1
- package/docs/storybook/main.6e0761c8.iframe.bundle.js +1 -0
- package/docs/storybook/{number-input-number-stories.a1953960.iframe.bundle.js → number-input-number-stories.6aba5a3d.iframe.bundle.js} +1 -1
- package/docs/storybook/project.json +1 -1
- package/docs/storybook/{runtime~main.11c14460.iframe.bundle.js → runtime~main.2e05cdb7.iframe.bundle.js} +1 -1
- package/docs/storybook/stories.json +1 -1
- package/docs/storybook/table-table-stories.6669e4b6.iframe.bundle.js +1 -0
- package/esm2020/i18n/en.mjs +2 -1
- package/esm2020/number-input/number.component.mjs +54 -6
- package/esm2020/table/head/table-head-expand.component.mjs +50 -9
- package/esm2020/table/head/table-head.component.mjs +38 -5
- package/esm2020/table/table-model.class.mjs +34 -1
- package/esm2020/table/table.component.mjs +15 -3
- package/fesm2015/carbon-components-angular-i18n.mjs +1 -0
- package/fesm2015/carbon-components-angular-i18n.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-number-input.mjs +53 -5
- package/fesm2015/carbon-components-angular-number-input.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-table.mjs +137 -21
- package/fesm2015/carbon-components-angular-table.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-i18n.mjs +1 -0
- package/fesm2020/carbon-components-angular-i18n.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-number-input.mjs +53 -5
- package/fesm2020/carbon-components-angular-number-input.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-table.mjs +137 -21
- package/fesm2020/carbon-components-angular-table.mjs.map +1 -1
- package/i18n/en.d.ts +1 -0
- package/i18n/i18n.service.d.ts +4 -1
- package/number-input/number.component.d.ts +11 -1
- package/package.json +1 -1
- package/table/head/table-head-expand.component.d.ts +12 -1
- package/table/head/table-head.component.d.ts +15 -1
- package/table/table-model.class.d.ts +14 -0
- package/table/table.component.d.ts +5 -1
- package/telemetry.yml +1 -1
- package/docs/storybook/5868.53c4195a.iframe.bundle.js +0 -1
- package/docs/storybook/9115.b37cce0a.iframe.bundle.js +0 -1
- package/docs/storybook/main.d05d9d76.iframe.bundle.js +0 -1
- package/docs/storybook/table-table-stories.c19aca64.iframe.bundle.js +0 -1
package/docs/documentation.json
CHANGED
|
@@ -5937,12 +5937,12 @@
|
|
|
5937
5937
|
},
|
|
5938
5938
|
{
|
|
5939
5939
|
"name": "CustomHeaderItem",
|
|
5940
|
-
"id": "class-CustomHeaderItem-
|
|
5940
|
+
"id": "class-CustomHeaderItem-d20442e134f01e6097b5e23512d1691f788ea184e02b786f8cb22254ae63e7ec7a5b81956ec8f361838c63ed0c9eb64d182ad838d446aec119a04b09f74bd4d2-1",
|
|
5941
5941
|
"file": "src/table/stories/app-expansion-table.component.ts",
|
|
5942
5942
|
"deprecated": false,
|
|
5943
5943
|
"deprecationMessage": "",
|
|
5944
5944
|
"type": "class",
|
|
5945
|
-
"sourceCode": "import {\n\tTemplateRef,\n\tComponent,\n\tViewChild,\n\tInput,\n\tAfterViewInit\n} from \"@angular/core\";\nimport { TableModel } from \"../table-model.class\";\nimport { TableItem } from \"../table-item.class\";\nimport { TableHeaderItem } from \"../table-header-item.class\";\n\nclass CustomHeaderItem extends TableHeaderItem {\n\t// used for custom sorting\n\tcompare(one: TableItem, two: TableItem) {\n\t\tconst stringOne = (one.data.name || one.data.surname || one.data).toLowerCase();\n\t\tconst stringTwo = (two.data.name || two.data.surname || two.data).toLowerCase();\n\n\t\tif (stringOne > stringTwo) {\n\t\t\treturn 1;\n\t\t} else if (stringOne < stringTwo) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n}\n\n@Component({\n\tselector: \"app-expansion-table\",\n\ttemplate: `\n\t\t<ng-template #customTableItemTemplate let-data=\"data\">\n\t\t\t<a [attr.href]=\"data.link\">{{data.name}} {{data.surname}}</a>\n\t\t</ng-template>\n\t\t<ng-template #customHeaderTemplate let-data=\"data\">\n\t\t\t<i><a [attr.href]=\"data.link\">{{data.name}}</a></i>\n\t\t</ng-template>\n\n\t\t<cds-table\n\t\t\t[model]=\"model\"\n\t\t\t[size]=\"size\"\n\t\t\t[sortable]=\"sortable\"\n\t\t\t[showSelectionColumn]=\"showSelectionColumn\"\n\t\t\t[stickyHeader]=\"stickyHeader\"\n\t\t\t[skeleton]=\"skeleton\"\n\t\t\t[striped]=\"striped\"\n\t\t\t(sort)=\"customSort($event)\"\n\t\t\t(rowClick)=\"onRowClick($event)\"\n\t\t\t[isDataGrid]=\"isDataGrid\">\n\t\t</cds-table>\n\t`\n})\nexport class ExpansionTableStory implements AfterViewInit {\n\t@Input() model = new TableModel();\n\t@Input() size = \"md\";\n\t@Input() showSelectionColumn = true;\n\t@Input() striped = true;\n\t@Input() isDataGrid = false;\n\t@Input() sortable = true;\n\t@Input() stickyHeader = false;\n\t@Input() skeleton = false;\n\n\t@ViewChild(\"customHeaderTemplate\")\n\tprotected customHeaderTemplate: TemplateRef<any>;\n\t@ViewChild(\"customTableItemTemplate\")\n\tprotected customTableItemTemplate: TemplateRef<any>;\n\n\tngAfterViewInit() {\n\t\tthis.model.data = [\n\t\t\t[\n\t\t\t\tnew TableItem({ data: \"Name 1\", expandedData: \"No template\" }),\n\t\t\t\tnew TableItem({ data: { name: \"Lessy\", link: \"#\" }, template: this.customTableItemTemplate })\n\t\t\t],\n\t\t\t[\n\t\t\t\tnew TableItem({\n\t\t\t\t\tdata: \"Name 3\",\n\t\t\t\t\texpandedData: { name: \"In\", surname: \"Template\" },\n\t\t\t\t\texpandedTemplate: this.customTableItemTemplate\n\t\t\t\t}),\n\t\t\t\tnew TableItem({ data: \"swer\" })\n\t\t\t],\n\t\t\t[\n\t\t\t\tnew TableItem({\n\t\t\t\t\tdata: \"Name 3.1\",\n\t\t\t\t\texpandedData: [\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tnew TableItem({ data: \"More names\", expandedData: \"No template\" }),\n\t\t\t\t\t\t\tnew TableItem({ data: { name: \"Morey\", link: \"#\" }, template: this.customTableItemTemplate })\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tnew TableItem({ data: \"Core names\", expandedData: \"No template\" }),\n\t\t\t\t\t\t\tnew TableItem({ data: { name: \"Corey\", link: \"#\" }, template: this.customTableItemTemplate })\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\t\t\t\t\texpandAsTable: true\n\t\t\t\t}),\n\t\t\t\tnew TableItem({ data: \"swer\" })\n\t\t\t],\n\t\t\t[new TableItem({ data: \"Name 2\" }), new TableItem({ data: { name: \"Alice\", surname: \"Bob\" }, template: this.customTableItemTemplate })],\n\t\t\t[new TableItem({ data: \"Name 4\" }), new TableItem({ data: \"twer\" })],\n\t\t\t[new TableItem({ data: \"Name 5\" }), new TableItem({data: \"twer\"})],\n\t\t\t[new TableItem({ data: \"Name 6\" }), new TableItem({data: \"twer\"})],\n\t\t\t[new TableItem({ data: \"Name 7\" }), new TableItem({data: \"twer\"})]\n\t\t];\n\t\tthis.model.header = [\n\t\t\tnew TableHeaderItem({ data: \"Very long title indeed\" }),\n\t\t\tnew CustomHeaderItem({\n\t\t\t\tdata: { name: \"Custom header\", link: \"#\" },\n\t\t\t\ttemplate: this.customHeaderTemplate\n\t\t\t})\n\t\t];\n\t}\n\n\tcustomSort(index: number) {\n\t\tthis.sort(this.model, index);\n\t}\n\n\tonRowClick(index: number) {\n\t\tconsole.log(\"Row item selected:\", index);\n\t}\n\n\tsort(model, index: number) {\n\t\tif (model.header[index].sorted) {\n\t\t\t// if already sorted flip sorting direction\n\t\t\tmodel.header[index].ascending = model.header[index].descending;\n\t\t}\n\t\tmodel.sort(index);\n\t}\n}\n",
|
|
5945
|
+
"sourceCode": "import {\n\tTemplateRef,\n\tComponent,\n\tViewChild,\n\tInput,\n\tAfterViewInit\n} from \"@angular/core\";\nimport { TableModel } from \"../table-model.class\";\nimport { TableItem } from \"../table-item.class\";\nimport { TableHeaderItem } from \"../table-header-item.class\";\n\nclass CustomHeaderItem extends TableHeaderItem {\n\t// used for custom sorting\n\tcompare(one: TableItem, two: TableItem) {\n\t\tconst stringOne = (one.data.name || one.data.surname || one.data).toLowerCase();\n\t\tconst stringTwo = (two.data.name || two.data.surname || two.data).toLowerCase();\n\n\t\tif (stringOne > stringTwo) {\n\t\t\treturn 1;\n\t\t} else if (stringOne < stringTwo) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n}\n\n@Component({\n\tselector: \"app-expansion-table\",\n\ttemplate: `\n\t\t<ng-template #customTableItemTemplate let-data=\"data\">\n\t\t\t<a [attr.href]=\"data.link\">{{data.name}} {{data.surname}}</a>\n\t\t</ng-template>\n\t\t<ng-template #customHeaderTemplate let-data=\"data\">\n\t\t\t<i><a [attr.href]=\"data.link\">{{data.name}}</a></i>\n\t\t</ng-template>\n\n\t\t<cds-table\n\t\t\t[model]=\"model\"\n\t\t\t[size]=\"size\"\n\t\t\t[sortable]=\"sortable\"\n\t\t\t[showSelectionColumn]=\"showSelectionColumn\"\n\t\t\t[stickyHeader]=\"stickyHeader\"\n\t\t\t[skeleton]=\"skeleton\"\n\t\t\t[striped]=\"striped\"\n\t\t\t(sort)=\"customSort($event)\"\n\t\t\t(rowClick)=\"onRowClick($event)\"\n\t\t\t[isDataGrid]=\"isDataGrid\"\n\t\t\t[showExpandAllToggle]=\"showExpandAllToggle\">\n\t\t</cds-table>\n\n\t\t<br>\n\n\t\t<button cdsButton=\"primary\" size=\"sm\" (click)=\"model.expandAllRows(true)\">Expand all rows</button>\n\n\t\t<button cdsButton=\"secondary\" size=\"sm\" (click)=\"model.expandAllRows(false)\">Collapse all rows</button>\n\t`\n})\nexport class ExpansionTableStory implements AfterViewInit {\n\t@Input() model = new TableModel();\n\t@Input() size = \"md\";\n\t@Input() showSelectionColumn = true;\n\t@Input() striped = true;\n\t@Input() isDataGrid = false;\n\t@Input() sortable = true;\n\t@Input() stickyHeader = false;\n\t@Input() skeleton = false;\n\t@Input() showExpandAllToggle = false;\n\n\t@ViewChild(\"customHeaderTemplate\")\n\tprotected customHeaderTemplate: TemplateRef<any>;\n\t@ViewChild(\"customTableItemTemplate\")\n\tprotected customTableItemTemplate: TemplateRef<any>;\n\n\tngAfterViewInit() {\n\t\tthis.model.data = [\n\t\t\t[\n\t\t\t\tnew TableItem({ data: \"Name 1\", expandedData: \"No template\" }),\n\t\t\t\tnew TableItem({ data: { name: \"Lessy\", link: \"#\" }, template: this.customTableItemTemplate })\n\t\t\t],\n\t\t\t[\n\t\t\t\tnew TableItem({\n\t\t\t\t\tdata: \"Name 3\",\n\t\t\t\t\texpandedData: { name: \"In\", surname: \"Template\" },\n\t\t\t\t\texpandedTemplate: this.customTableItemTemplate\n\t\t\t\t}),\n\t\t\t\tnew TableItem({ data: \"swer\" })\n\t\t\t],\n\t\t\t[\n\t\t\t\tnew TableItem({\n\t\t\t\t\tdata: \"Name 3.1\",\n\t\t\t\t\texpandedData: [\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tnew TableItem({ data: \"More names\", expandedData: \"No template\" }),\n\t\t\t\t\t\t\tnew TableItem({ data: { name: \"Morey\", link: \"#\" }, template: this.customTableItemTemplate })\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tnew TableItem({ data: \"Core names\", expandedData: \"No template\" }),\n\t\t\t\t\t\t\tnew TableItem({ data: { name: \"Corey\", link: \"#\" }, template: this.customTableItemTemplate })\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\t\t\t\t\texpandAsTable: true\n\t\t\t\t}),\n\t\t\t\tnew TableItem({ data: \"swer\" })\n\t\t\t],\n\t\t\t[new TableItem({ data: \"Name 2\" }), new TableItem({ data: { name: \"Alice\", surname: \"Bob\" }, template: this.customTableItemTemplate })],\n\t\t\t[new TableItem({ data: \"Name 4\" }), new TableItem({ data: \"twer\" })],\n\t\t\t[new TableItem({ data: \"Name 5\" }), new TableItem({data: \"twer\"})],\n\t\t\t[new TableItem({ data: \"Name 6\" }), new TableItem({data: \"twer\"})],\n\t\t\t[new TableItem({ data: \"Name 7\" }), new TableItem({data: \"twer\"})]\n\t\t];\n\t\tthis.model.header = [\n\t\t\tnew TableHeaderItem({ data: \"Very long title indeed\" }),\n\t\t\tnew CustomHeaderItem({\n\t\t\t\tdata: { name: \"Custom header\", link: \"#\" },\n\t\t\t\ttemplate: this.customHeaderTemplate\n\t\t\t})\n\t\t];\n\t}\n\n\tcustomSort(index: number) {\n\t\tthis.sort(this.model, index);\n\t}\n\n\tonRowClick(index: number) {\n\t\tconsole.log(\"Row item selected:\", index);\n\t}\n\n\tsort(model, index: number) {\n\t\tif (model.header[index].sorted) {\n\t\t\t// if already sorted flip sorting direction\n\t\t\tmodel.header[index].ascending = model.header[index].descending;\n\t\t}\n\t\tmodel.sort(index);\n\t}\n}\n",
|
|
5946
5946
|
"inputsClass": [],
|
|
5947
5947
|
"outputsClass": [],
|
|
5948
5948
|
"properties": [
|
|
@@ -7051,12 +7051,12 @@
|
|
|
7051
7051
|
},
|
|
7052
7052
|
{
|
|
7053
7053
|
"name": "NumberChange",
|
|
7054
|
-
"id": "class-NumberChange-
|
|
7054
|
+
"id": "class-NumberChange-9f96963038fb60119a19b74c9c9868abb21dc983cbe9ae791c7f9916a4b113d526ffec3cb0816822dbea8d431361e3ad4bf0b6c14c97c4757a47853940dbca6b",
|
|
7055
7055
|
"file": "src/number-input/number.component.ts",
|
|
7056
7056
|
"deprecated": false,
|
|
7057
7057
|
"deprecationMessage": "",
|
|
7058
7058
|
"type": "class",
|
|
7059
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tHostBinding,\n\tEventEmitter,\n\tOutput,\n\tTemplateRef,\n\tHostListener\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from \"@angular/forms\";\n\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { Observable } from \"rxjs\";\n\n/**\n * Used to emit changes performed on number input components.\n */\nexport class NumberChange {\n\t/**\n\t * Contains the `Number` that has been changed.\n\t */\n\tsource: NumberComponent;\n\t/**\n\t * The value of the `Number` field encompassed in the `NumberChange` class.\n\t */\n\tvalue: number;\n}\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { NumberModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-number--basic)\n */\n@Component({\n\tselector: \"cds-number, ibm-number\",\n\ttemplate: `\n\t\t<div\n\t\t\tdata-numberinput\n\t\t\t[attr.data-invalid]=\"(invalid ? true : null)\"\n\t\t\tclass=\"cds--number\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--number--light': theme === 'light',\n\t\t\t\t'cds--number--nolabel': !label,\n\t\t\t\t'cds--number--helpertext': helperText,\n\t\t\t\t'cds--skeleton' : skeleton,\n\t\t\t\t'cds--number--sm': size === 'sm',\n\t\t\t\t'cds--number--md': size === 'md',\n\t\t\t\t'cds--number--lg': size === 'lg'\n\t\t\t}\">\n\t\t\t<label *ngIf=\"skeleton && label\" class=\"cds--label cds--skeleton\"></label>\n\t\t\t<label\n\t\t\t\t*ngIf=\"!skeleton && label\"\n\t\t\t\t[for]=\"id\"\n\t\t\t\tclass=\"cds--label\"\n\t\t\t\t[ngClass]=\"{'cds--label--disabled': disabled}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t</label>\n\t\t\t<div\n\t\t\t\tclass=\"cds--number__input-wrapper\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--number__input-wrapper--warning': warn\n\t\t\t\t}\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t[id]=\"id\"\n\t\t\t\t\t[value]=\"value\"\n\t\t\t\t\t[attr.min]=\"min\"\n\t\t\t\t\t[attr.max]=\"max\"\n\t\t\t\t\t[attr.step]=\"step\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t[required]=\"required\"\n\t\t\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t\t\t[attr.data-invalid]=\"invalid ? invalid : null\"\n\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t(change)=\"onNumberInputChange($event)\"/>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && invalid\"\n\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--number__invalid\">\n\t\t\t\t</svg>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && !invalid && warn\"\n\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--number__invalid cds--number__invalid--warning\">\n\t\t\t\t</svg>\n\t\t\t\t<div *ngIf=\"!skeleton\" class=\"cds--number__controls\">\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"cds--number__control-btn down-icon\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t[attr.disabled]=\"disabled ? true : null\"\n\t\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\t\t[attr.aria-label]=\"getDecrementLabel() | async\"\n\t\t\t\t\t\t(click)=\"onDecrement()\">\n\t\t\t\t\t\t<svg cdsIcon=\"subtract\" size=\"16\"></svg>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class=\"cds--number__rule-divider\"></div>\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"cds--number__control-btn up-icon\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t[attr.disabled]=\"disabled ? true : null\"\n\t\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\t\t[attr.aria-label]=\"getIncrementLabel() | async\"\n\t\t\t\t\t\t(click)=\"onIncrement()\">\n\t\t\t\t\t\t<svg cdsIcon=\"add\" size=\"16\"></svg>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class=\"cds--number__rule-divider\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\t*ngIf=\"helperText && !invalid && !warn\"\n\t\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--form__helper-text--disabled': disabled\n\t\t\t\t}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t\t</div>\n\t\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: NumberComponent,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class NumberComponent implements ControlValueAccessor {\n\t/**\n\t * Variable used for creating unique ids for number input components.\n\t */\n\tstatic numberCount = 0;\n\n\t@HostBinding(\"class.cds--form-item\") containerClass = true;\n\n\t/**\n\t * Set to `true` for readonly state.\n\t */\n\t@Input() @HostBinding(\"class.cds--number--readonly\") readonly = false;\n\t/**\n\t * @deprecated since v5 - Use `cdsLayer` directive instead\n\t * `light` or `dark` number input theme.\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\t/**\n\t * Set to `true` for a disabled number input.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Set to `true` for a loading number component.\n\t */\n\t@Input() skeleton = false;\n\t/**\n\t * Set to `true` for an invalid number component.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * The unique id for the number component.\n\t */\n\t@Input() id = `number-${NumberComponent.numberCount}`;\n\t/**\n\t * Sets the placeholder attribute on the `input` element.\n\t */\n\t@Input() placeholder = \"\";\n\t/**\n\t * Number input field render size\n\t */\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\t/**\n\t * Reflects the required attribute of the `input` element.\n\t */\n\t@Input() required: boolean;\n\t/**\n\t * Sets the value attribute on the `input` element.\n\t */\n\t@Input() set value(v: any) {\n\t\tif (v === \"\" || v === null) {\n\t\t\tthis._value = null;\n\t\t\treturn;\n\t\t}\n\t\tthis._value = Number(v);\n\t}\n\n\tget value() {\n\t\treturn this._value;\n\t}\n\t/**\n\t * Sets the min attribute on the `input` element.\n\t */\n\t@Input() min = null;\n\t/**\n\t * Sets the max attribute on the `input` element.\n\t */\n\t@Input() max = null;\n\t/**\n\t * Sets the text inside the `label` tag.\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Sets the optional helper text.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\t/**\n\t * Sets the invalid text.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\t/**\n\t * Sets the amount the number controls increment and decrement by.\n\t */\n\t@Input() step = 1;\n\t/**\n\t * If `step` is a decimal, we may want precision to be set to go around floating point precision.\n\t */\n\t@Input() precision: number;\n\t/**\n\t * Set to `true` to show a warning (contents set by warningText)\n\t */\n\t@Input() warn = false;\n\t/**\n\t * Sets the warning text\n\t */\n\t@Input() warnText: string | TemplateRef<any>;\n\t/**\n\t * Sets the arialabel for input\n\t */\n\t@Input() ariaLabel: string;\n\t/**\n\t * Emits event notifying other classes when a change in state occurs in the input.\n\t */\n\t@Output() change = new EventEmitter<NumberChange>();\n\n\t@Input()\n\tset decrementLabel(value: string | Observable<string>) {\n\t\tthis._decrementLabel.override(value);\n\t}\n\n\tget decrementLabel() {\n\t\treturn this._decrementLabel.value;\n\t}\n\n\t@Input()\n\tset incrementLabel(value: string | Observable<string>) {\n\t\tthis._incrementLabel.override(value);\n\t}\n\n\tget incrementLabel() {\n\t\treturn this._incrementLabel.value;\n\t}\n\n\tprotected _value = 0;\n\n\tprotected _decrementLabel: Overridable = this.i18n.getOverridable(\"NUMBER.DECREMENT\");\n\tprotected _incrementLabel: Overridable = this.i18n.getOverridable(\"NUMBER.INCREMENT\");\n\n\t/**\n\t * Creates an instance of `Number`.\n\t */\n\tconstructor(protected i18n: I18n) {\n\t\tNumberComponent.numberCount++;\n\t}\n\n\t/**\n\t * This is the initial value set to the component\n\t * @param value The input value.\n\t */\n\tpublic writeValue(value: any) {\n\t\tthis.value = value;\n\t}\n\n\t/**\n\t * Sets a method in order to propagate changes back to the form.\n\t */\n\tpublic registerOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\t/**\n\t * Registers a callback to be triggered when the control has been touched.\n\t * @param fn Callback to be triggered when the number input is touched.\n\t */\n\tpublic registerOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\t@HostListener(\"focusout\")\n\tfocusOut() {\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Sets the disabled state through the model\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\t/**\n\t * Called when number input is blurred. Needed to properly implement `ControlValueAccessor`.\n\t */\n\tonTouched: () => any = () => { };\n\n\t/**\n\t * Method set in `registerOnChange` to propagate changes back to the form.\n\t */\n\tpropagateChange = (_: any) => { };\n\n\t/**\n\t * Adds `step` to the current `value`.\n\t */\n\tonIncrement(): void {\n\t\tif (this.max === null || this.value + this.step <= this.max) {\n\t\t\tthis.value += this.step;\n\t\t\tthis.value = parseFloat(this.value.toPrecision(this.precision));\n\t\t\tthis.emitChangeEvent();\n\t\t}\n\t}\n\n\t/**\n\t * Subtracts `step` to the current `value`.\n\t */\n\tonDecrement(): void {\n\t\tif (this.min === null || this.value - this.step >= this.min) {\n\t\t\tthis.value -= this.step;\n\t\t\tthis.value = parseFloat(this.value.toPrecision(this.precision));\n\t\t\tthis.emitChangeEvent();\n\t\t}\n\t}\n\n\tgetDecrementLabel(): Observable<string> {\n\t\treturn this._decrementLabel.subject;\n\t}\n\n\tgetIncrementLabel(): Observable<string> {\n\t\treturn this._incrementLabel.subject;\n\t}\n\n\t/**\n\t * Creates a class of `NumberChange` to emit the change in the `Number`.\n\t */\n\temitChangeEvent(): void {\n\t\tlet event = new NumberChange();\n\t\tevent.source = this;\n\t\tevent.value = this.value;\n\t\tthis.change.emit(event);\n\t\tthis.propagateChange(this.value);\n\t}\n\n\tonNumberInputChange(event) {\n\t\tthis.value = event.target.value;\n\t\tthis.emitChangeEvent();\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n}\nexport { NumberComponent as Number };\n",
|
|
7059
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tHostBinding,\n\tEventEmitter,\n\tOutput,\n\tTemplateRef,\n\tHostListener\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\n\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { Observable } from \"rxjs\";\n\n/**\n * Used to emit changes performed on number input components.\n */\nexport class NumberChange {\n\t/**\n\t * Contains the `Number` that has been changed.\n\t */\n\tsource: NumberComponent;\n\t/**\n\t * The value of the `Number` field encompassed in the `NumberChange` class.\n\t */\n\tvalue: number;\n}\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { NumberModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-number--basic)\n */\n@Component({\n\tselector: \"cds-number, ibm-number\",\n\ttemplate: `\n\t\t<label *ngIf=\"skeleton && label\" class=\"cds--label cds--skeleton\"></label>\n\t\t<div\n\t\t\tdata-numberinput\n\t\t\t[attr.data-invalid]=\"(invalid ? true : null)\"\n\t\t\tclass=\"cds--number\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--number--light': theme === 'light',\n\t\t\t\t'cds--number--nolabel': !label,\n\t\t\t\t'cds--number--helpertext': helperText,\n\t\t\t\t'cds--skeleton' : skeleton,\n\t\t\t\t'cds--number--sm': size === 'sm',\n\t\t\t\t'cds--number--md': size === 'md',\n\t\t\t\t'cds--number--lg': size === 'lg'\n\t\t\t}\">\n\t\t\t<label\n\t\t\t\t*ngIf=\"!skeleton && label\"\n\t\t\t\t[for]=\"id\"\n\t\t\t\tclass=\"cds--label\"\n\t\t\t\t[ngClass]=\"{'cds--label--disabled': disabled}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t</label>\n\t\t\t<div\n\t\t\t\tclass=\"cds--number__input-wrapper\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--number__input-wrapper--warning': warn\n\t\t\t\t}\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t[id]=\"id\"\n\t\t\t\t\t[value]=\"value\"\n\t\t\t\t\t[attr.min]=\"min\"\n\t\t\t\t\t[attr.max]=\"max\"\n\t\t\t\t\t[attr.step]=\"step\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t[required]=\"required\"\n\t\t\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t\t\t[attr.data-invalid]=\"invalid ? invalid : null\"\n\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t(focus)=\"fluid ? handleFocus($event): null\"\n\t\t\t\t\t(blur)=\"fluid ? handleFocus($event): null\"\n\t\t\t\t\t(change)=\"onNumberInputChange($event)\"/>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && invalid\"\n\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--number__invalid\">\n\t\t\t\t</svg>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && !invalid && warn\"\n\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--number__invalid cds--number__invalid--warning\">\n\t\t\t\t</svg>\n\t\t\t\t<div *ngIf=\"!skeleton\" class=\"cds--number__controls\">\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"cds--number__control-btn down-icon\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t[attr.disabled]=\"disabled ? true : null\"\n\t\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\t\t[attr.aria-label]=\"getDecrementLabel() | async\"\n\t\t\t\t\t\t(click)=\"onDecrement()\">\n\t\t\t\t\t\t<svg cdsIcon=\"subtract\" size=\"16\"></svg>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class=\"cds--number__rule-divider\"></div>\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"cds--number__control-btn up-icon\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t[attr.disabled]=\"disabled ? true : null\"\n\t\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\t\t[attr.aria-label]=\"getIncrementLabel() | async\"\n\t\t\t\t\t\t(click)=\"onIncrement()\">\n\t\t\t\t\t\t<svg cdsIcon=\"add\" size=\"16\"></svg>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class=\"cds--number__rule-divider\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<hr *ngIf=\"fluid\" class=\"cds--number-input__divider\" />\n\t\t\t<div\n\t\t\t\t*ngIf=\"helperText && !invalid && !warn && !fluid\"\n\t\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--form__helper-text--disabled': disabled\n\t\t\t\t}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t\t</div>\n\t\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: NumberComponent,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class NumberComponent implements ControlValueAccessor {\n\t/**\n\t * Variable used for creating unique ids for number input components.\n\t */\n\tstatic numberCount = 0;\n\n\t@HostBinding(\"class.cds--form-item\") containerClass = true;\n\n\t/**\n\t * Set to `true` for readonly state.\n\t */\n\t@Input() @HostBinding(\"class.cds--number--readonly\") readonly = false;\n\t/**\n\t * @deprecated since v5 - Use `cdsLayer` directive instead\n\t * `light` or `dark` number input theme.\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\t/**\n\t * Set to `true` for a disabled number input.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Set to `true` for a loading number component.\n\t */\n\t@Input() skeleton = false;\n\t/**\n\t * Set to `true` for an invalid number component.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * The unique id for the number component.\n\t */\n\t@Input() id = `number-${NumberComponent.numberCount}`;\n\t/**\n\t * Sets the placeholder attribute on the `input` element.\n\t */\n\t@Input() placeholder = \"\";\n\t/**\n\t * Number input field render size\n\t */\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\t/**\n\t * Reflects the required attribute of the `input` element.\n\t */\n\t@Input() required: boolean;\n\t/**\n\t * Sets the value attribute on the `input` element.\n\t */\n\t@Input() set value(v: any) {\n\t\tif (v === \"\" || v === null) {\n\t\t\tthis._value = null;\n\t\t\treturn;\n\t\t}\n\t\tthis._value = Number(v);\n\t}\n\n\tget value() {\n\t\treturn this._value;\n\t}\n\t/**\n\t * Sets the min attribute on the `input` element.\n\t */\n\t@Input() min = null;\n\t/**\n\t * Sets the max attribute on the `input` element.\n\t */\n\t@Input() max = null;\n\t/**\n\t * Sets the text inside the `label` tag.\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Sets the optional helper text.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\t/**\n\t * Sets the invalid text.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\t/**\n\t * Sets the amount the number controls increment and decrement by.\n\t */\n\t@Input() step = 1;\n\t/**\n\t * If `step` is a decimal, we may want precision to be set to go around floating point precision.\n\t */\n\t@Input() precision: number;\n\t/**\n\t * Set to `true` to show a warning (contents set by warningText)\n\t */\n\t@Input() warn = false;\n\t/**\n\t * Sets the warning text\n\t */\n\t@Input() warnText: string | TemplateRef<any>;\n\t/**\n\t * Sets the arialabel for input\n\t */\n\t@Input() ariaLabel: string;\n\t/**\n\t * Emits event notifying other classes when a change in state occurs in the input.\n\t */\n\t@Output() change = new EventEmitter<NumberChange>();\n\n\t@Input()\n\tset decrementLabel(value: string | Observable<string>) {\n\t\tthis._decrementLabel.override(value);\n\t}\n\n\tget decrementLabel() {\n\t\treturn this._decrementLabel.value;\n\t}\n\n\t@Input()\n\tset incrementLabel(value: string | Observable<string>) {\n\t\tthis._incrementLabel.override(value);\n\t}\n\n\tget incrementLabel() {\n\t\treturn this._incrementLabel.value;\n\t}\n\n\t/**\n\t * Experimental: enable fluid state\n\t */\n\t@HostBinding(\"class.cds--number-input--fluid\") @Input() fluid = false;\n\n\t@HostBinding(\"class.cds--number-input--fluid--invalid\") get fluidInvalid() {\n\t\treturn this.fluid && this.invalid;\n\t}\n\n\t@HostBinding(\"class.cds--number-input--fluid--disabled\") get fluidDisabled() {\n\t\treturn this.fluid && this.disabled;\n\t}\n\n\t@HostBinding(\"class.cds--number-input--fluid--focus\") get fluidFocus() {\n\t\treturn this.fluid && this._isFocused;\n\t}\n\n\t@HostBinding(\"class.cds--text-input--fluid__skeleton\") get fluidSkeleton() {\n\t\treturn this.fluid && this.skeleton;\n\t}\n\n\tprotected _isFocused = false;\n\n\tprotected _value = 0;\n\n\tprotected _decrementLabel: Overridable = this.i18n.getOverridable(\"NUMBER.DECREMENT\");\n\tprotected _incrementLabel: Overridable = this.i18n.getOverridable(\"NUMBER.INCREMENT\");\n\n\t/**\n\t * Creates an instance of `Number`.\n\t */\n\tconstructor(protected i18n: I18n) {\n\t\tNumberComponent.numberCount++;\n\t}\n\n\t/**\n\t * This is the initial value set to the component\n\t * @param value The input value.\n\t */\n\tpublic writeValue(value: any) {\n\t\tthis.value = value;\n\t}\n\n\t/**\n\t * Sets a method in order to propagate changes back to the form.\n\t */\n\tpublic registerOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\t/**\n\t * Registers a callback to be triggered when the control has been touched.\n\t * @param fn Callback to be triggered when the number input is touched.\n\t */\n\tpublic registerOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\t@HostListener(\"focusout\")\n\tfocusOut() {\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Sets the disabled state through the model\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\t/**\n\t * Called when number input is blurred. Needed to properly implement `ControlValueAccessor`.\n\t */\n\tonTouched: () => any = () => { };\n\n\t/**\n\t * Method set in `registerOnChange` to propagate changes back to the form.\n\t */\n\tpropagateChange = (_: any) => { };\n\n\t/**\n\t * Adds `step` to the current `value`.\n\t */\n\tonIncrement(): void {\n\t\tif (this.max === null || this.value + this.step <= this.max) {\n\t\t\tthis.value += this.step;\n\t\t\tthis.value = parseFloat(this.value.toPrecision(this.precision));\n\t\t\tthis.emitChangeEvent();\n\t\t}\n\t}\n\n\t/**\n\t * Subtracts `step` to the current `value`.\n\t */\n\tonDecrement(): void {\n\t\tif (this.min === null || this.value - this.step >= this.min) {\n\t\t\tthis.value -= this.step;\n\t\t\tthis.value = parseFloat(this.value.toPrecision(this.precision));\n\t\t\tthis.emitChangeEvent();\n\t\t}\n\t}\n\n\tgetDecrementLabel(): Observable<string> {\n\t\treturn this._decrementLabel.subject;\n\t}\n\n\tgetIncrementLabel(): Observable<string> {\n\t\treturn this._incrementLabel.subject;\n\t}\n\n\t/**\n\t * Creates a class of `NumberChange` to emit the change in the `Number`.\n\t */\n\temitChangeEvent(): void {\n\t\tlet event = new NumberChange();\n\t\tevent.source = this;\n\t\tevent.value = this.value;\n\t\tthis.change.emit(event);\n\t\tthis.propagateChange(this.value);\n\t}\n\n\tonNumberInputChange(event) {\n\t\tthis.value = event.target.value;\n\t\tthis.emitChangeEvent();\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\thandleFocus(event: FocusEvent) {\n\t\tif (\"type\" in event.target && (<HTMLInputElement>event.target).type === \"button\") {\n\t\t\tthis._isFocused = false;\n\t\t} else {\n\t\t\tthis._isFocused = event.type === \"focus\";\n\t\t}\n\t}\n}\nexport { NumberComponent as Number };\n",
|
|
7060
7060
|
"inputsClass": [],
|
|
7061
7061
|
"outputsClass": [],
|
|
7062
7062
|
"properties": [
|
|
@@ -8796,19 +8796,19 @@
|
|
|
8796
8796
|
},
|
|
8797
8797
|
{
|
|
8798
8798
|
"name": "TableModel",
|
|
8799
|
-
"id": "class-TableModel-
|
|
8799
|
+
"id": "class-TableModel-b50033b9ec64d94390dbcf01a02ce31f03e30bff3081f86bb63f698f17513cd429f1c05ffa448fe6b85bade54c54cf2ad1843e74a5c8ad7a71e2c93520fbdd78",
|
|
8800
8800
|
"file": "src/table/table-model.class.ts",
|
|
8801
8801
|
"deprecated": false,
|
|
8802
8802
|
"deprecationMessage": "",
|
|
8803
8803
|
"type": "class",
|
|
8804
|
-
"sourceCode": "import { EventEmitter } from \"@angular/core\";\n\nimport { PaginationModel } from \"carbon-components-angular/pagination\";\nimport { TableHeaderItem } from \"./table-header-item.class\";\nimport { TableItem } from \"./table-item.class\";\nimport { TableRow } from \"./table-row.class\";\nimport { Subject } from \"rxjs\";\n\nexport type HeaderType = number | \"select\" | \"expand\";\n\n/**\n * TableModel represents a data model for two-dimensional data. It's used for all things table\n * (table component, table toolbar, pagination, etc)\n *\n * TableModel manages its internal data integrity very well if you use the provided helper\n * functions for modifying rows and columns and assigning header and data in that order.\n *\n * It also provides direct access to the data so you can read and modify it.\n * If you change the structure of the data (by directly pushing into the arrays or otherwise),\n * keep in mind to keep the data structure intact.\n *\n * Header length and length of every line in the data should be equal.\n *\n * If they are not consistent, unexpected things will happen.\n *\n * Use the provided functions when in doubt.\n */\nexport class TableModel implements PaginationModel {\n\t/**\n\t * The number of models instantiated, used for (among other things) unique id generation\n\t */\n\tprotected static COUNT = 0;\n\n\t/**\n\t * Sets data of the table.\n\t *\n\t * Make sure all rows are the same length to keep the column count accurate.\n\t */\n\tset data(newData: TableItem[][]) {\n\t\tif (!newData || (Array.isArray(newData) && newData.length === 0)) {\n\t\t\tnewData = [[]];\n\t\t}\n\n\t\tthis._data = newData;\n\n\t\t// init rowsSelected\n\t\tthis.rowsSelected = new Array<boolean>(this._data.length).fill(false);\n\t\tthis.rowsExpanded = new Array<boolean>(this._data.length).fill(false);\n\t\t// init rows indices\n\t\tthis.rowsIndices = [...Array(this._data.length).keys()];\n\t\t// init rowsContext\n\t\tthis.rowsContext = new Array<string>(this._data.length);\n\n\t\t// init rowsClass\n\t\tthis.rowsClass = new Array<string>(this._data.length);\n\n\t\t// only create a fresh header if necessary (header doesn't exist or differs in length)\n\t\tif (this.header == null || (this.header.length !== this._data[0].length && this._data[0].length > 0)) {\n\t\t\tlet header = new Array<TableHeaderItem>();\n\t\t\tfor (let i = 0; i < this._data[0].length; i++) {\n\t\t\t\theader.push(new TableHeaderItem());\n\t\t\t}\n\t\t\tthis.header = header;\n\t\t}\n\n\t\tthis.dataChange.emit();\n\t}\n\n\tdataChange = new EventEmitter();\n\trowsSelectedChange = new EventEmitter<number>();\n\trowsExpandedChange = new EventEmitter<number>();\n\t/**\n\t * Gets emitted when `selectAll` is called. Emits false if all rows are deselected and true if\n\t * all rows are selected.\n\t */\n\tselectAllChange = new Subject<boolean>();\n\n\t/**\n\t * Gets the full data.\n\t *\n\t * You can use it to alter individual `TableItem`s but if you need to change\n\t * table structure, use `addRow()` and/or `addColumn()`\n\t */\n\tget data() {\n\t\treturn this._data;\n\t}\n\n\t/**\n\t * Contains information about selection state of rows in the table.\n\t */\n\trowsSelected: boolean[] = [];\n\n\t/**\n\t * Contains information about expanded state of rows in the table.\n\t */\n\trowsExpanded: boolean[] = [];\n\n\t/**\n\t * Contains information about initial index of rows in the table\n\t */\n\trowsIndices: number[] = [];\n\n\t/**\n\t * Contains information about the context of the row.\n\t *\n\t * It affects styling of the row to reflect the context.\n\t *\n\t * string can be one of `\"success\" | \"warning\" | \"info\" | \"error\" | \"\"` and it's\n\t * empty or undefined by default\n\t */\n\trowsContext: string[] = [];\n\n\t/**\n\t * Contains class name(s) of the row.\n\t *\n\t * It affects styling of the row to reflect the appended class name(s).\n\t *\n\t * It's empty or undefined by default\n\t */\n\trowsClass: string[] = [];\n\n\t/**\n\t * Contains information about the header cells of the table.\n\t */\n\theader: TableHeaderItem[] = [];\n\n\t/**\n\t * Tracks the current page.\n\t */\n\tcurrentPage = 1;\n\n\t/**\n\t * Length of page.\n\t */\n\tpageLength = 10;\n\n\t/**\n\t * Set to true when there is no more data to load in the table\n\t */\n\tisEnd = false;\n\n\t/**\n\t * Set to true when lazy loading to show loading indicator\n\t */\n\tisLoading = false;\n\n\t/**\n\t * Absolute total number of rows of the table.\n\t */\n\tprotected _totalDataLength: number;\n\n\t/**\n\t * Manually set data length in case the data in the table doesn't\n\t * correctly reflect all the data that table is to display.\n\t *\n\t * Example: if you have multiple pages of data that table will display\n\t * but you're loading one at a time.\n\t *\n\t * Set to `null` to reset to default behavior.\n\t */\n\tset totalDataLength(length: number) {\n\t\t// if this function is called without a parameter we need to set to null to avoid having undefined != null\n\t\tthis._totalDataLength = isNaN(length) ? null : length;\n\t}\n\n\t/**\n\t * Total length of data that table has access to, or the amount manually set\n\t */\n\tget totalDataLength() {\n\t\t// if manually set data length\n\t\tif (this._totalDataLength !== null && this._totalDataLength >= 0) {\n\t\t\treturn this._totalDataLength;\n\t\t}\n\n\t\t// if empty dataset\n\t\tif (this.data && this.data.length === 1 && this.data[0].length === 0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn this.data.length;\n\t}\n\n\t/**\n\t * Used in `data`\n\t */\n\tprotected _data: TableItem[][] = [[]];\n\n\t/**\n\t * The number of models instantiated, this is to make sure each table has a different\n\t * model count for unique id generation.\n\t */\n\tprotected tableModelCount = 0;\n\n\tconstructor() {\n\t\tthis.tableModelCount = TableModel.COUNT++;\n\t}\n\n\t/**\n\t * Returns an id for the given column\n\t *\n\t * @param column the column to generate an id for\n\t * @param row the row of the header to generate an id for\n\t */\n\tgetId(column: HeaderType, row = 0): string {\n\t\treturn `table-header-${row}-${column}-${this.tableModelCount}`;\n\t}\n\n\t/**\n\t * Returns the id of the header. Used to link the cells with headers (or headers with headers)\n\t *\n\t * @param column the column to start getting headers for\n\t * @param colSpan the number of columns to get headers for (defaults to 1)\n\t */\n\tgetHeaderId(column: HeaderType, colSpan = 1): string {\n\t\tif (column === \"select\" || column === \"expand\") {\n\t\t\treturn this.getId(column);\n\t\t}\n\n\t\tlet ids = [];\n\t\tfor (let i = column; i >= 0; i--) {\n\t\t\tif (this.header[i]) {\n\t\t\t\tfor (let j = 0; j < colSpan; j++) {\n\t\t\t\t\tids.push(this.getId(i + j));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn ids.join(\" \");\n\t}\n\n\t/**\n\t * Finds closest header by trying the `column` and then working its way to the left\n\t *\n\t * @param column the target column\n\t */\n\tgetHeader(column: number): TableHeaderItem {\n\t\tif (!this.header) {\n\t\t\treturn null;\n\t\t}\n\n\t\tfor (let i = column; i >= 0; i--) {\n\t\t\tconst headerCell = this.header[i];\n\t\t\tif (headerCell) {\n\t\t\t\treturn headerCell;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Returns how many rows is currently selected\n\t */\n\tselectedRowsCount(): number {\n\t\tlet count = 0;\n\t\tif (this.rowsSelected) {\n\t\t\tthis.rowsSelected.forEach(rowSelected => {\n\t\t\t\tif (rowSelected) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn count;\n\t}\n\n\t/**\n\t * Returns how many rows is currently expanded\n\t */\n\texpandedRowsCount(): number {\n\t\tlet count = 0;\n\t\tif (this.rowsExpanded) {\n\t\t\tthis.rowsExpanded.forEach(rowExpanded => {\n\t\t\t\tif (rowExpanded) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn count;\n\t}\n\n\t/**\n\t * Returns `index`th row of the table.\n\t *\n\t * Negative index starts from the end. -1 being the last element.\n\t *\n\t * @param index\n\t */\n\trow(index: number): TableItem[] {\n\t\treturn this.data[this.realRowIndex(index)];\n\t}\n\n\t/**\n\t * Adds a row to the `index`th row or appends to table if index not provided.\n\t *\n\t * If row is shorter than other rows or not provided, it will be padded with\n\t * empty `TableItem` elements.\n\t *\n\t * If row is longer than other rows, others will be extended to match so no data is lost.\n\t *\n\t * If called on an empty table with no parameters, it creates a 1x1 table.\n\t *\n\t * Negative index starts from the end. -1 being the last element.\n\t *\n\t * @param [row]\n\t * @param [index]\n\t */\n\taddRow(row?: TableItem[], index?: number) {\n\t\t// if table empty create table with row\n\t\tif (!this.data || this.data.length === 0 || this.data[0].length === 0) {\n\t\t\tlet newData = new Array<Array<TableItem>>();\n\t\t\tnewData.push(row ? row : [new TableItem()]); // row or one empty one column row\n\t\t\tthis.data = newData;\n\n\t\t\treturn;\n\t\t}\n\n\t\tlet realRow = row;\n\t\tconst columnCount = this.data[0].length;\n\n\t\tif (row == null) {\n\t\t\trealRow = new Array<TableItem>();\n\t\t\tfor (let i = 0; i < columnCount; i++) {\n\t\t\t\trealRow.push(new TableItem());\n\t\t\t}\n\t\t}\n\n\t\tif (realRow.length < columnCount) {\n\t\t\t// extend the length of realRow\n\t\t\tconst difference = columnCount - realRow.length;\n\t\t\tfor (let i = 0; i < difference; i++) {\n\t\t\t\trealRow.push(new TableItem());\n\t\t\t}\n\t\t} else if (realRow.length > columnCount) {\n\t\t\t// extend the length of header\n\t\t\tlet difference = realRow.length - this.header.length;\n\t\t\tfor (let j = 0; j < difference; j++) {\n\t\t\t\tthis.header.push(new TableHeaderItem());\n\t\t\t}\n\t\t\t// extend the length of every other row\n\t\t\tfor (let i = 0; i < this.data.length; i++) {\n\t\t\t\tlet currentRow = this.data[i];\n\t\t\t\tdifference = realRow.length - currentRow.length;\n\t\t\t\tfor (let j = 0; j < difference; j++) {\n\t\t\t\t\tcurrentRow.push(new TableItem());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (index == null) {\n\t\t\tthis.data.push(realRow);\n\n\t\t\t// update rowsSelected property for length\n\t\t\tthis.rowsSelected.push(false);\n\n\t\t\t// update rowsExpanded property for length\n\t\t\tthis.rowsExpanded.push(false);\n\n\t\t\t// update rowsContext property for length\n\t\t\tthis.rowsContext.push(undefined);\n\n\t\t\t// update rowsClass property for length\n\t\t\tthis.rowsClass.push(undefined);\n\n\t\t\t// update rowsIndices property for length\n\t\t\tthis.rowsIndices.push(this.data.length - 1);\n\t\t} else {\n\t\t\tconst ri = this.realRowIndex(index);\n\t\t\tthis.data.splice(ri, 0, realRow);\n\n\t\t\t// update rowsSelected property for length\n\t\t\tthis.rowsSelected.splice(ri, 0, false);\n\n\t\t\t// update rowsExpanded property for length\n\t\t\tthis.rowsExpanded.splice(ri, 0, false);\n\n\t\t\t// update rowsContext property for length\n\t\t\tthis.rowsContext.splice(ri, 0, undefined);\n\n\t\t\t// update rowsClass property for length\n\t\t\tthis.rowsClass.splice(ri, 0, undefined);\n\n\t\t\t// update rowsIndices property for length\n\t\t\tthis.rowsIndices.splice(ri, 0, this.data.length - 1);\n\t\t}\n\n\t\tthis.dataChange.emit();\n\t}\n\n\t/**\n\t * Deletes `index`th row.\n\t *\n\t * Negative index starts from the end. -1 being the last element.\n\t *\n\t * @param index\n\t */\n\tdeleteRow(index: number) {\n\t\tconst rri = this.realRowIndex(index);\n\t\tthis.data.splice(rri, 1);\n\t\tthis.rowsSelected.splice(rri, 1);\n\t\tthis.rowsExpanded.splice(rri, 1);\n\t\tthis.rowsContext.splice(rri, 1);\n\t\tthis.rowsClass.splice(rri, 1);\n\n\t\tconst rowIndex = this.rowsIndices[rri];\n\t\tthis.rowsIndices.splice(rri, 1);\n\t\tthis.rowsIndices = this.rowsIndices.map((value) => (value > rowIndex) ? --value : value);\n\n\t\tthis.dataChange.emit();\n\t}\n\n\thasExpandableRows() {\n\t\treturn this.data.some(data => data.some(d => d && d.expandedData)); // checking for some in 2D array\n\t}\n\n\tisRowExpandable(index: number) {\n\t\treturn this.data[index].some(d => d && d.expandedData);\n\t}\n\n\tisRowExpanded(index: number) {\n\t\treturn this.rowsExpanded[index];\n\t}\n\n\tgetRowContext(index: number) {\n\t\treturn this.rowsContext[index];\n\t}\n\n\t/**\n\t * Returns `index`th column of the table.\n\t *\n\t * Negative index starts from the end. -1 being the last element.\n\t *\n\t * @param index\n\t */\n\tcolumn(index: number): TableItem[] {\n\t\tlet column = new Array<TableItem>();\n\t\tconst ri = this.realColumnIndex(index);\n\t\tconst rc = this.data.length;\n\n\t\tfor (let i = 0; i < rc; i++) {\n\t\t\tconst row = this.data[i];\n\t\t\tcolumn.push(row[ri]);\n\t\t}\n\n\t\treturn column;\n\t}\n\n\t/**\n\t * Adds a column to the `index`th column or appends to table if index not provided.\n\t *\n\t * If column is shorter than other columns or not provided, it will be padded with\n\t * empty `TableItem` elements.\n\t *\n\t * If column is longer than other columns, others will be extended to match so no data is lost.\n\t *\n\t * If called on an empty table with no parameters, it creates a 1x1 table.\n\t *\n\t * Negative index starts from the end. -1 being the last element.\n\t *\n\t * @param [column]\n\t * @param [index]\n\t */\n\taddColumn(column?: TableItem[], index?: number) {\n\t\t// if table empty create table with row\n\t\tif (!this.data || this.data.length === 0 || this.data[0].length === 0) {\n\t\t\tlet newData = new Array<Array<TableItem>>();\n\t\t\tif (column == null) {\n\t\t\t\tnewData.push([new TableItem()]);\n\t\t\t} else {\n\t\t\t\tfor (let i = 0; i < column.length; i++) {\n\t\t\t\t\tlet item = column[i];\n\t\t\t\t\tnewData.push([item]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.data = newData;\n\n\t\t\treturn;\n\t\t}\n\n\t\tlet rc = this.data.length; // row count\n\t\tlet ci = this.realColumnIndex(index);\n\n\t\t// append missing rows\n\t\tfor (let i = 0; column != null && i < column.length - rc; i++) {\n\t\t\tthis.addRow();\n\t\t}\n\t\trc = this.data.length;\n\t\tif (index == null) {\n\t\t\t// append to end\n\t\t\tfor (let i = 0; i < rc; i++) {\n\t\t\t\tlet row = this.data[i];\n\t\t\t\trow.push(column == null || column[i] == null ? new TableItem() : column[i]);\n\t\t\t}\n\t\t\t// update header if not already set by user\n\t\t\tif (this.header.length < this.data[0].length) {\n\t\t\t\tthis.header.push(new TableHeaderItem());\n\t\t\t}\n\t\t} else {\n\t\t\tif (index >= this.data[0].length) {\n\t\t\t\t// if trying to append\n\t\t\t\tci++;\n\t\t\t}\n\t\t\t// insert\n\t\t\tfor (let i = 0; i < rc; i++) {\n\t\t\t\tlet row = this.data[i];\n\t\t\t\trow.splice(ci, 0, column == null || column[i] == null ? new TableItem() : column[i]);\n\t\t\t}\n\t\t\t// update header if not already set by user\n\t\t\tif (this.header.length < this.data[0].length) {\n\t\t\t\tthis.header.splice(ci, 0, new TableHeaderItem());\n\t\t\t}\n\t\t}\n\n\t\tthis.dataChange.emit();\n\t}\n\n\t/**\n\t * Deletes `index`th column.\n\t *\n\t * Negative index starts from the end. -1 being the last element.\n\t *\n\t * @param index\n\t */\n\tdeleteColumn(index: number) {\n\t\tconst rci = this.realColumnIndex(index);\n\t\tconst rowCount = this.data.length;\n\t\tfor (let i = 0; i < rowCount; i++) {\n\t\t\tthis.data[i].splice(rci, 1);\n\t\t}\n\t\t// update header if not already set by user\n\t\tif (this.header.length > this.data[0].length) {\n\t\t\tthis.header.splice(rci, 1);\n\t\t}\n\n\t\tthis.dataChange.emit();\n\t}\n\n\tmoveColumn(indexFrom: number, indexTo: number) {\n\t\tconst headerFrom = this.header[indexFrom];\n\n\t\tthis.addColumn(this.column(indexFrom), indexTo);\n\t\tthis.deleteColumn(indexFrom + (indexTo < indexFrom ? 1 : 0));\n\n\t\tthis.header[indexTo + (indexTo > indexFrom ? -1 : 0)] = headerFrom;\n\t}\n\n\t/**\n\t * cycle through the three sort states\n\t * @param index\n\t */\n\tcycleSortState(index: number) {\n\t\t// no sort provided so do the simple sort\n\t\tswitch (this.header[index].sortDirection) {\n\t\t\tcase \"ASCENDING\":\n\t\t\t\tthis.header[index].sortDirection = \"DESCENDING\";\n\t\t\t\tbreak;\n\t\t\tcase \"DESCENDING\":\n\t\t\t\tthis.header[index].sortDirection = \"NONE\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis.header[index].sortDirection = \"ASCENDING\";\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Sorts the data currently present in the model based on `compare()`\n\t *\n\t * Direction is set by `ascending` and `descending` properties of `TableHeaderItem`\n\t * in `index`th column.\n\t *\n\t * @param index The column based on which it's sorting\n\t */\n\tsort(index: number) {\n\t\tthis.pushRowStateToModelData();\n\t\tconst headerSorted = this.header[index].sorted;\n\t\t// We only allow sorting by a single column, so reset sort state for all columns before specifying new sort state\n\t\tthis.header.forEach(column => column.sorted = false);\n\t\tif (this.header[index].sortDirection === \"NONE\" && headerSorted) {\n\t\t\t// Restore initial order of rows\n\t\t\tconst oldData = this._data;\n\t\t\tthis._data = [];\n\t\t\tfor (let i = 0; i < this.rowsIndices.length; i++) {\n\t\t\t\tconst ri = this.rowsIndices[i];\n\t\t\t\tthis._data[ri] = oldData[i];\n\t\t\t}\n\t\t} else {\n\t\t\tconst descending = this.header[index].sortDirection === \"DESCENDING\" ? -1 : 1;\n\t\t\tthis.data.sort((a, b) => {\n\t\t\t\treturn descending * this.header[index].compare(a[index], b[index]);\n\t\t\t});\n\t\t\tthis.header[index].sorted = true;\n\t\t}\n\t\tthis.popRowStateFromModelData();\n\t}\n\n\t/**\n\t * Appends `rowsSelected` and `rowsExpanded` info to model data.\n\t *\n\t * When sorting rows, do this first so information about row selection\n\t * gets sorted with the other row info.\n\t *\n\t * Call `popRowSelectionFromModelData()` after sorting to make everything\n\t * right with the world again.\n\t */\n\tpushRowStateToModelData() {\n\t\tfor (let i = 0; i < this.data.length; i++) {\n\t\t\tconst rowSelectedMark = new TableItem();\n\t\t\trowSelectedMark.data = this.rowsSelected[i];\n\t\t\tthis.data[i].push(rowSelectedMark);\n\n\t\t\tconst rowExpandedMark = new TableItem();\n\t\t\trowExpandedMark.data = this.rowsExpanded[i];\n\t\t\tthis.data[i].push(rowExpandedMark);\n\n\t\t\tconst rowContext = new TableItem();\n\t\t\trowContext.data = this.rowsContext[i];\n\t\t\tthis.data[i].push(rowContext);\n\n\t\t\tconst rowClass = new TableItem();\n\t\t\trowClass.data = this.rowsClass[i];\n\t\t\tthis.data[i].push(rowClass);\n\n\t\t\tconst rowIndex = new TableItem();\n\t\t\trowIndex.data = this.rowsIndices[i];\n\t\t\tthis.data[i].push(rowIndex);\n\t\t}\n\t}\n\n\t/**\n\t * Restores `rowsSelected` from data pushed by `pushRowSelectionToModelData()`\n\t *\n\t * Call after sorting data (if you previously pushed to maintain selection order)\n\t * to make everything right with the world again.\n\t */\n\tpopRowStateFromModelData() {\n\t\tfor (let i = 0; i < this.data.length; i++) {\n\t\t\tthis.rowsIndices[i] = this.data[i].pop().data;\n\t\t\tthis.rowsClass[i] = this.data[i].pop().data;\n\t\t\tthis.rowsContext[i] = this.data[i].pop().data;\n\t\t\tthis.rowsExpanded[i] = !!this.data[i].pop().data;\n\t\t\tthis.rowsSelected[i] = !!this.data[i].pop().data;\n\t\t}\n\t}\n\n\t/**\n\t * Checks if row is filtered out.\n\t *\n\t * @param index\n\t * @returns true if any of the filters in header filters out the `index`th row\n\t */\n\tisRowFiltered(index: number): boolean {\n\t\tconst realIndex = this.realRowIndex(index);\n\t\treturn this.header.some((item, i) => item && item.filter(this.row(realIndex)[i]));\n\t}\n\n\t/**\n\t * Select/deselect `index`th row based on value\n\t *\n\t * @param index index of the row to select\n\t * @param value state to set the row to. Defaults to `true`\n\t */\n\tselectRow(index: number, value = true) {\n\t\tif (this.isRowDisabled(index)) {\n\t\t\treturn;\n\t\t}\n\t\tthis.rowsSelected[index] = value;\n\t\tthis.rowsSelectedChange.emit(index);\n\t}\n\n\t/**\n\t * Selects or deselects all rows in the model\n\t *\n\t * @param value state to set all rows to. Defaults to `true`\n\t */\n\tselectAll(value = true) {\n\t\tif (this.data.length >= 1 && this.data[0].length >= 1) {\n\t\t\tfor (let i = 0; i < this.rowsSelected.length; i++) {\n\t\t\t\tthis.selectRow(i, value);\n\t\t\t}\n\t\t}\n\t\tthis.selectAllChange.next(value);\n\t}\n\n\tisRowSelected(index: number) {\n\t\treturn this.rowsSelected[index];\n\t}\n\n\t/**\n\t * Checks if row is disabled or not.\n\t */\n\tisRowDisabled(index: number) {\n\t\tconst row = this.data[index] as TableRow;\n\t\treturn !!row.disabled;\n\t}\n\n\t/**\n\t * Expands/Collapses `index`th row based on value\n\t *\n\t * @param index index of the row to expand or collapse\n\t * @param value expanded state of the row. `true` is expanded and `false` is collapsed\n\t */\n\texpandRow(index: number, value = true) {\n\t\tthis.rowsExpanded[index] = value;\n\t\tthis.rowsExpandedChange.emit(index);\n\t}\n\n\t/**\n\t * Gets the true index of a row based on it's relative position.\n\t * Like in Python, positive numbers start from the top and\n\t * negative numbers start from the bottom.\n\t *\n\t * @param index\n\t */\n\tprotected realRowIndex(index: number): number {\n\t\treturn this.realIndex(index, this.data.length);\n\t}\n\n\t/**\n\t * Gets the true index of a column based on it's relative position.\n\t * Like in Python, positive numbers start from the top and\n\t * negative numbers start from the bottom.\n\t *\n\t * @param index\n\t */\n\tprotected realColumnIndex(index: number): number {\n\t\treturn this.realIndex(index, this.data[0].length);\n\t}\n\n\t/**\n\t * Generic function to calculate the real index of something.\n\t * Used by `realRowIndex()` and `realColumnIndex()`\n\t *\n\t * @param index\n\t * @param length\n\t */\n\tprotected realIndex(index: number, length: number): number {\n\t\tif (index == null) {\n\t\t\treturn length - 1;\n\t\t} else if (index >= 0) {\n\t\t\treturn index >= length ? length - 1 : index;\n\t\t} else {\n\t\t\treturn -index >= length ? 0 : length + index;\n\t\t}\n\t}\n}\n",
|
|
8804
|
+
"sourceCode": "import { EventEmitter } from \"@angular/core\";\n\nimport { PaginationModel } from \"carbon-components-angular/pagination\";\nimport { TableHeaderItem } from \"./table-header-item.class\";\nimport { TableItem } from \"./table-item.class\";\nimport { TableRow } from \"./table-row.class\";\nimport { Subject } from \"rxjs\";\n\nexport type HeaderType = number | \"select\" | \"expand\";\n\n/**\n * TableModel represents a data model for two-dimensional data. It's used for all things table\n * (table component, table toolbar, pagination, etc)\n *\n * TableModel manages its internal data integrity very well if you use the provided helper\n * functions for modifying rows and columns and assigning header and data in that order.\n *\n * It also provides direct access to the data so you can read and modify it.\n * If you change the structure of the data (by directly pushing into the arrays or otherwise),\n * keep in mind to keep the data structure intact.\n *\n * Header length and length of every line in the data should be equal.\n *\n * If they are not consistent, unexpected things will happen.\n *\n * Use the provided functions when in doubt.\n */\nexport class TableModel implements PaginationModel {\n\t/**\n\t * The number of models instantiated, used for (among other things) unique id generation\n\t */\n\tprotected static COUNT = 0;\n\n\t/**\n\t * Sets data of the table.\n\t *\n\t * Make sure all rows are the same length to keep the column count accurate.\n\t */\n\tset data(newData: TableItem[][]) {\n\t\tif (!newData || (Array.isArray(newData) && newData.length === 0)) {\n\t\t\tnewData = [[]];\n\t\t}\n\n\t\tthis._data = newData;\n\n\t\t// init rowsSelected\n\t\tthis.rowsSelected = new Array<boolean>(this._data.length).fill(false);\n\t\tthis.rowsExpanded = new Array<boolean>(this._data.length).fill(false);\n\t\t// init rows indices\n\t\tthis.rowsIndices = [...Array(this._data.length).keys()];\n\t\t// init rowsContext\n\t\tthis.rowsContext = new Array<string>(this._data.length);\n\n\t\t// init rowsClass\n\t\tthis.rowsClass = new Array<string>(this._data.length);\n\n\t\t// only create a fresh header if necessary (header doesn't exist or differs in length)\n\t\tif (this.header == null || (this.header.length !== this._data[0].length && this._data[0].length > 0)) {\n\t\t\tlet header = new Array<TableHeaderItem>();\n\t\t\tfor (let i = 0; i < this._data[0].length; i++) {\n\t\t\t\theader.push(new TableHeaderItem());\n\t\t\t}\n\t\t\tthis.header = header;\n\t\t}\n\n\t\tthis.dataChange.emit();\n\t}\n\n\tdataChange = new EventEmitter();\n\trowsSelectedChange = new EventEmitter<number>();\n\trowsExpandedChange = new EventEmitter<number>();\n\trowsExpandedAllChange = new EventEmitter();\n\trowsCollapsedAllChange = new EventEmitter();\n\t/**\n\t * Gets emitted when `selectAll` is called. Emits false if all rows are deselected and true if\n\t * all rows are selected.\n\t */\n\tselectAllChange = new Subject<boolean>();\n\n\t/**\n\t * Gets the full data.\n\t *\n\t * You can use it to alter individual `TableItem`s but if you need to change\n\t * table structure, use `addRow()` and/or `addColumn()`\n\t */\n\tget data() {\n\t\treturn this._data;\n\t}\n\n\t/**\n\t * Contains information about selection state of rows in the table.\n\t */\n\trowsSelected: boolean[] = [];\n\n\t/**\n\t * Contains information about expanded state of rows in the table.\n\t */\n\trowsExpanded: boolean[] = [];\n\n\t/**\n\t * Contains information about initial index of rows in the table\n\t */\n\trowsIndices: number[] = [];\n\n\t/**\n\t * Contains information about the context of the row.\n\t *\n\t * It affects styling of the row to reflect the context.\n\t *\n\t * string can be one of `\"success\" | \"warning\" | \"info\" | \"error\" | \"\"` and it's\n\t * empty or undefined by default\n\t */\n\trowsContext: string[] = [];\n\n\t/**\n\t * Contains class name(s) of the row.\n\t *\n\t * It affects styling of the row to reflect the appended class name(s).\n\t *\n\t * It's empty or undefined by default\n\t */\n\trowsClass: string[] = [];\n\n\t/**\n\t * Contains information about the header cells of the table.\n\t */\n\theader: TableHeaderItem[] = [];\n\n\t/**\n\t * Tracks the current page.\n\t */\n\tcurrentPage = 1;\n\n\t/**\n\t * Length of page.\n\t */\n\tpageLength = 10;\n\n\t/**\n\t * Set to true when there is no more data to load in the table\n\t */\n\tisEnd = false;\n\n\t/**\n\t * Set to true when lazy loading to show loading indicator\n\t */\n\tisLoading = false;\n\n\t/**\n\t * Absolute total number of rows of the table.\n\t */\n\tprotected _totalDataLength: number;\n\n\t/**\n\t * Manually set data length in case the data in the table doesn't\n\t * correctly reflect all the data that table is to display.\n\t *\n\t * Example: if you have multiple pages of data that table will display\n\t * but you're loading one at a time.\n\t *\n\t * Set to `null` to reset to default behavior.\n\t */\n\tset totalDataLength(length: number) {\n\t\t// if this function is called without a parameter we need to set to null to avoid having undefined != null\n\t\tthis._totalDataLength = isNaN(length) ? null : length;\n\t}\n\n\t/**\n\t * Total length of data that table has access to, or the amount manually set\n\t */\n\tget totalDataLength() {\n\t\t// if manually set data length\n\t\tif (this._totalDataLength !== null && this._totalDataLength >= 0) {\n\t\t\treturn this._totalDataLength;\n\t\t}\n\n\t\t// if empty dataset\n\t\tif (this.data && this.data.length === 1 && this.data[0].length === 0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn this.data.length;\n\t}\n\n\t/**\n\t * Used in `data`\n\t */\n\tprotected _data: TableItem[][] = [[]];\n\n\t/**\n\t * The number of models instantiated, this is to make sure each table has a different\n\t * model count for unique id generation.\n\t */\n\tprotected tableModelCount = 0;\n\n\tconstructor() {\n\t\tthis.tableModelCount = TableModel.COUNT++;\n\t}\n\n\t/**\n\t * Returns an id for the given column\n\t *\n\t * @param column the column to generate an id for\n\t * @param row the row of the header to generate an id for\n\t */\n\tgetId(column: HeaderType, row = 0): string {\n\t\treturn `table-header-${row}-${column}-${this.tableModelCount}`;\n\t}\n\n\t/**\n\t * Returns the id of the header. Used to link the cells with headers (or headers with headers)\n\t *\n\t * @param column the column to start getting headers for\n\t * @param colSpan the number of columns to get headers for (defaults to 1)\n\t */\n\tgetHeaderId(column: HeaderType, colSpan = 1): string {\n\t\tif (column === \"select\" || column === \"expand\") {\n\t\t\treturn this.getId(column);\n\t\t}\n\n\t\tlet ids = [];\n\t\tfor (let i = column; i >= 0; i--) {\n\t\t\tif (this.header[i]) {\n\t\t\t\tfor (let j = 0; j < colSpan; j++) {\n\t\t\t\t\tids.push(this.getId(i + j));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn ids.join(\" \");\n\t}\n\n\t/**\n\t * Finds closest header by trying the `column` and then working its way to the left\n\t *\n\t * @param column the target column\n\t */\n\tgetHeader(column: number): TableHeaderItem {\n\t\tif (!this.header) {\n\t\t\treturn null;\n\t\t}\n\n\t\tfor (let i = column; i >= 0; i--) {\n\t\t\tconst headerCell = this.header[i];\n\t\t\tif (headerCell) {\n\t\t\t\treturn headerCell;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Returns how many rows is currently selected\n\t */\n\tselectedRowsCount(): number {\n\t\tlet count = 0;\n\t\tif (this.rowsSelected) {\n\t\t\tthis.rowsSelected.forEach(rowSelected => {\n\t\t\t\tif (rowSelected) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn count;\n\t}\n\n\t/**\n\t * Returns how many rows is currently expanded\n\t */\n\texpandedRowsCount(): number {\n\t\tlet count = 0;\n\t\tif (this.rowsExpanded) {\n\t\t\tthis.rowsExpanded.forEach(rowExpanded => {\n\t\t\t\tif (rowExpanded) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn count;\n\t}\n\n\t/**\n\t * Returns `index`th row of the table.\n\t *\n\t * Negative index starts from the end. -1 being the last element.\n\t *\n\t * @param index\n\t */\n\trow(index: number): TableItem[] {\n\t\treturn this.data[this.realRowIndex(index)];\n\t}\n\n\t/**\n\t * Adds a row to the `index`th row or appends to table if index not provided.\n\t *\n\t * If row is shorter than other rows or not provided, it will be padded with\n\t * empty `TableItem` elements.\n\t *\n\t * If row is longer than other rows, others will be extended to match so no data is lost.\n\t *\n\t * If called on an empty table with no parameters, it creates a 1x1 table.\n\t *\n\t * Negative index starts from the end. -1 being the last element.\n\t *\n\t * @param [row]\n\t * @param [index]\n\t */\n\taddRow(row?: TableItem[], index?: number) {\n\t\t// if table empty create table with row\n\t\tif (!this.data || this.data.length === 0 || this.data[0].length === 0) {\n\t\t\tlet newData = new Array<Array<TableItem>>();\n\t\t\tnewData.push(row ? row : [new TableItem()]); // row or one empty one column row\n\t\t\tthis.data = newData;\n\n\t\t\treturn;\n\t\t}\n\n\t\tlet realRow = row;\n\t\tconst columnCount = this.data[0].length;\n\n\t\tif (row == null) {\n\t\t\trealRow = new Array<TableItem>();\n\t\t\tfor (let i = 0; i < columnCount; i++) {\n\t\t\t\trealRow.push(new TableItem());\n\t\t\t}\n\t\t}\n\n\t\tif (realRow.length < columnCount) {\n\t\t\t// extend the length of realRow\n\t\t\tconst difference = columnCount - realRow.length;\n\t\t\tfor (let i = 0; i < difference; i++) {\n\t\t\t\trealRow.push(new TableItem());\n\t\t\t}\n\t\t} else if (realRow.length > columnCount) {\n\t\t\t// extend the length of header\n\t\t\tlet difference = realRow.length - this.header.length;\n\t\t\tfor (let j = 0; j < difference; j++) {\n\t\t\t\tthis.header.push(new TableHeaderItem());\n\t\t\t}\n\t\t\t// extend the length of every other row\n\t\t\tfor (let i = 0; i < this.data.length; i++) {\n\t\t\t\tlet currentRow = this.data[i];\n\t\t\t\tdifference = realRow.length - currentRow.length;\n\t\t\t\tfor (let j = 0; j < difference; j++) {\n\t\t\t\t\tcurrentRow.push(new TableItem());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (index == null) {\n\t\t\tthis.data.push(realRow);\n\n\t\t\t// update rowsSelected property for length\n\t\t\tthis.rowsSelected.push(false);\n\n\t\t\t// update rowsExpanded property for length\n\t\t\tthis.rowsExpanded.push(false);\n\n\t\t\t// update rowsContext property for length\n\t\t\tthis.rowsContext.push(undefined);\n\n\t\t\t// update rowsClass property for length\n\t\t\tthis.rowsClass.push(undefined);\n\n\t\t\t// update rowsIndices property for length\n\t\t\tthis.rowsIndices.push(this.data.length - 1);\n\t\t} else {\n\t\t\tconst ri = this.realRowIndex(index);\n\t\t\tthis.data.splice(ri, 0, realRow);\n\n\t\t\t// update rowsSelected property for length\n\t\t\tthis.rowsSelected.splice(ri, 0, false);\n\n\t\t\t// update rowsExpanded property for length\n\t\t\tthis.rowsExpanded.splice(ri, 0, false);\n\n\t\t\t// update rowsContext property for length\n\t\t\tthis.rowsContext.splice(ri, 0, undefined);\n\n\t\t\t// update rowsClass property for length\n\t\t\tthis.rowsClass.splice(ri, 0, undefined);\n\n\t\t\t// update rowsIndices property for length\n\t\t\tthis.rowsIndices.splice(ri, 0, this.data.length - 1);\n\t\t}\n\n\t\tthis.dataChange.emit();\n\t}\n\n\t/**\n\t * Deletes `index`th row.\n\t *\n\t * Negative index starts from the end. -1 being the last element.\n\t *\n\t * @param index\n\t */\n\tdeleteRow(index: number) {\n\t\tconst rri = this.realRowIndex(index);\n\t\tthis.data.splice(rri, 1);\n\t\tthis.rowsSelected.splice(rri, 1);\n\t\tthis.rowsExpanded.splice(rri, 1);\n\t\tthis.rowsContext.splice(rri, 1);\n\t\tthis.rowsClass.splice(rri, 1);\n\n\t\tconst rowIndex = this.rowsIndices[rri];\n\t\tthis.rowsIndices.splice(rri, 1);\n\t\tthis.rowsIndices = this.rowsIndices.map((value) => (value > rowIndex) ? --value : value);\n\n\t\tthis.dataChange.emit();\n\t}\n\n\thasExpandableRows() {\n\t\treturn this.data.some(data => data.some(d => d && d.expandedData)); // checking for some in 2D array\n\t}\n\n\t/**\n\t * Number of rows that can be expanded.\n\t *\n\t * @returns number\n\t */\n\texpandableRowsCount() {\n\t\treturn this.data.reduce((counter, _, index) => {\n\t\t\tcounter = (this.isRowExpandable(index)) ? counter + 1 : counter;\n\t\t\treturn counter;\n\t\t}, 0);\n\t}\n\n\tisRowExpandable(index: number) {\n\t\treturn this.data[index].some(d => d && d.expandedData);\n\t}\n\n\tisRowExpanded(index: number) {\n\t\treturn this.rowsExpanded[index];\n\t}\n\n\tgetRowContext(index: number) {\n\t\treturn this.rowsContext[index];\n\t}\n\n\t/**\n\t * Returns `index`th column of the table.\n\t *\n\t * Negative index starts from the end. -1 being the last element.\n\t *\n\t * @param index\n\t */\n\tcolumn(index: number): TableItem[] {\n\t\tlet column = new Array<TableItem>();\n\t\tconst ri = this.realColumnIndex(index);\n\t\tconst rc = this.data.length;\n\n\t\tfor (let i = 0; i < rc; i++) {\n\t\t\tconst row = this.data[i];\n\t\t\tcolumn.push(row[ri]);\n\t\t}\n\n\t\treturn column;\n\t}\n\n\t/**\n\t * Adds a column to the `index`th column or appends to table if index not provided.\n\t *\n\t * If column is shorter than other columns or not provided, it will be padded with\n\t * empty `TableItem` elements.\n\t *\n\t * If column is longer than other columns, others will be extended to match so no data is lost.\n\t *\n\t * If called on an empty table with no parameters, it creates a 1x1 table.\n\t *\n\t * Negative index starts from the end. -1 being the last element.\n\t *\n\t * @param [column]\n\t * @param [index]\n\t */\n\taddColumn(column?: TableItem[], index?: number) {\n\t\t// if table empty create table with row\n\t\tif (!this.data || this.data.length === 0 || this.data[0].length === 0) {\n\t\t\tlet newData = new Array<Array<TableItem>>();\n\t\t\tif (column == null) {\n\t\t\t\tnewData.push([new TableItem()]);\n\t\t\t} else {\n\t\t\t\tfor (let i = 0; i < column.length; i++) {\n\t\t\t\t\tlet item = column[i];\n\t\t\t\t\tnewData.push([item]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.data = newData;\n\n\t\t\treturn;\n\t\t}\n\n\t\tlet rc = this.data.length; // row count\n\t\tlet ci = this.realColumnIndex(index);\n\n\t\t// append missing rows\n\t\tfor (let i = 0; column != null && i < column.length - rc; i++) {\n\t\t\tthis.addRow();\n\t\t}\n\t\trc = this.data.length;\n\t\tif (index == null) {\n\t\t\t// append to end\n\t\t\tfor (let i = 0; i < rc; i++) {\n\t\t\t\tlet row = this.data[i];\n\t\t\t\trow.push(column == null || column[i] == null ? new TableItem() : column[i]);\n\t\t\t}\n\t\t\t// update header if not already set by user\n\t\t\tif (this.header.length < this.data[0].length) {\n\t\t\t\tthis.header.push(new TableHeaderItem());\n\t\t\t}\n\t\t} else {\n\t\t\tif (index >= this.data[0].length) {\n\t\t\t\t// if trying to append\n\t\t\t\tci++;\n\t\t\t}\n\t\t\t// insert\n\t\t\tfor (let i = 0; i < rc; i++) {\n\t\t\t\tlet row = this.data[i];\n\t\t\t\trow.splice(ci, 0, column == null || column[i] == null ? new TableItem() : column[i]);\n\t\t\t}\n\t\t\t// update header if not already set by user\n\t\t\tif (this.header.length < this.data[0].length) {\n\t\t\t\tthis.header.splice(ci, 0, new TableHeaderItem());\n\t\t\t}\n\t\t}\n\n\t\tthis.dataChange.emit();\n\t}\n\n\t/**\n\t * Deletes `index`th column.\n\t *\n\t * Negative index starts from the end. -1 being the last element.\n\t *\n\t * @param index\n\t */\n\tdeleteColumn(index: number) {\n\t\tconst rci = this.realColumnIndex(index);\n\t\tconst rowCount = this.data.length;\n\t\tfor (let i = 0; i < rowCount; i++) {\n\t\t\tthis.data[i].splice(rci, 1);\n\t\t}\n\t\t// update header if not already set by user\n\t\tif (this.header.length > this.data[0].length) {\n\t\t\tthis.header.splice(rci, 1);\n\t\t}\n\n\t\tthis.dataChange.emit();\n\t}\n\n\tmoveColumn(indexFrom: number, indexTo: number) {\n\t\tconst headerFrom = this.header[indexFrom];\n\n\t\tthis.addColumn(this.column(indexFrom), indexTo);\n\t\tthis.deleteColumn(indexFrom + (indexTo < indexFrom ? 1 : 0));\n\n\t\tthis.header[indexTo + (indexTo > indexFrom ? -1 : 0)] = headerFrom;\n\t}\n\n\t/**\n\t * cycle through the three sort states\n\t * @param index\n\t */\n\tcycleSortState(index: number) {\n\t\t// no sort provided so do the simple sort\n\t\tswitch (this.header[index].sortDirection) {\n\t\t\tcase \"ASCENDING\":\n\t\t\t\tthis.header[index].sortDirection = \"DESCENDING\";\n\t\t\t\tbreak;\n\t\t\tcase \"DESCENDING\":\n\t\t\t\tthis.header[index].sortDirection = \"NONE\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis.header[index].sortDirection = \"ASCENDING\";\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Sorts the data currently present in the model based on `compare()`\n\t *\n\t * Direction is set by `ascending` and `descending` properties of `TableHeaderItem`\n\t * in `index`th column.\n\t *\n\t * @param index The column based on which it's sorting\n\t */\n\tsort(index: number) {\n\t\tthis.pushRowStateToModelData();\n\t\tconst headerSorted = this.header[index].sorted;\n\t\t// We only allow sorting by a single column, so reset sort state for all columns before specifying new sort state\n\t\tthis.header.forEach(column => column.sorted = false);\n\t\tif (this.header[index].sortDirection === \"NONE\" && headerSorted) {\n\t\t\t// Restore initial order of rows\n\t\t\tconst oldData = this._data;\n\t\t\tthis._data = [];\n\t\t\tfor (let i = 0; i < this.rowsIndices.length; i++) {\n\t\t\t\tconst ri = this.rowsIndices[i];\n\t\t\t\tthis._data[ri] = oldData[i];\n\t\t\t}\n\t\t} else {\n\t\t\tconst descending = this.header[index].sortDirection === \"DESCENDING\" ? -1 : 1;\n\t\t\tthis.data.sort((a, b) => {\n\t\t\t\treturn descending * this.header[index].compare(a[index], b[index]);\n\t\t\t});\n\t\t\tthis.header[index].sorted = true;\n\t\t}\n\t\tthis.popRowStateFromModelData();\n\t}\n\n\t/**\n\t * Appends `rowsSelected` and `rowsExpanded` info to model data.\n\t *\n\t * When sorting rows, do this first so information about row selection\n\t * gets sorted with the other row info.\n\t *\n\t * Call `popRowSelectionFromModelData()` after sorting to make everything\n\t * right with the world again.\n\t */\n\tpushRowStateToModelData() {\n\t\tfor (let i = 0; i < this.data.length; i++) {\n\t\t\tconst rowSelectedMark = new TableItem();\n\t\t\trowSelectedMark.data = this.rowsSelected[i];\n\t\t\tthis.data[i].push(rowSelectedMark);\n\n\t\t\tconst rowExpandedMark = new TableItem();\n\t\t\trowExpandedMark.data = this.rowsExpanded[i];\n\t\t\tthis.data[i].push(rowExpandedMark);\n\n\t\t\tconst rowContext = new TableItem();\n\t\t\trowContext.data = this.rowsContext[i];\n\t\t\tthis.data[i].push(rowContext);\n\n\t\t\tconst rowClass = new TableItem();\n\t\t\trowClass.data = this.rowsClass[i];\n\t\t\tthis.data[i].push(rowClass);\n\n\t\t\tconst rowIndex = new TableItem();\n\t\t\trowIndex.data = this.rowsIndices[i];\n\t\t\tthis.data[i].push(rowIndex);\n\t\t}\n\t}\n\n\t/**\n\t * Restores `rowsSelected` from data pushed by `pushRowSelectionToModelData()`\n\t *\n\t * Call after sorting data (if you previously pushed to maintain selection order)\n\t * to make everything right with the world again.\n\t */\n\tpopRowStateFromModelData() {\n\t\tfor (let i = 0; i < this.data.length; i++) {\n\t\t\tthis.rowsIndices[i] = this.data[i].pop().data;\n\t\t\tthis.rowsClass[i] = this.data[i].pop().data;\n\t\t\tthis.rowsContext[i] = this.data[i].pop().data;\n\t\t\tthis.rowsExpanded[i] = !!this.data[i].pop().data;\n\t\t\tthis.rowsSelected[i] = !!this.data[i].pop().data;\n\t\t}\n\t}\n\n\t/**\n\t * Checks if row is filtered out.\n\t *\n\t * @param index\n\t * @returns true if any of the filters in header filters out the `index`th row\n\t */\n\tisRowFiltered(index: number): boolean {\n\t\tconst realIndex = this.realRowIndex(index);\n\t\treturn this.header.some((item, i) => item && item.filter(this.row(realIndex)[i]));\n\t}\n\n\t/**\n\t * Select/deselect `index`th row based on value\n\t *\n\t * @param index index of the row to select\n\t * @param value state to set the row to. Defaults to `true`\n\t */\n\tselectRow(index: number, value = true) {\n\t\tif (this.isRowDisabled(index)) {\n\t\t\treturn;\n\t\t}\n\t\tthis.rowsSelected[index] = value;\n\t\tthis.rowsSelectedChange.emit(index);\n\t}\n\n\t/**\n\t * Selects or deselects all rows in the model\n\t *\n\t * @param value state to set all rows to. Defaults to `true`\n\t */\n\tselectAll(value = true) {\n\t\tif (this.data.length >= 1 && this.data[0].length >= 1) {\n\t\t\tfor (let i = 0; i < this.rowsSelected.length; i++) {\n\t\t\t\tthis.selectRow(i, value);\n\t\t\t}\n\t\t}\n\t\tthis.selectAllChange.next(value);\n\t}\n\n\tisRowSelected(index: number) {\n\t\treturn this.rowsSelected[index];\n\t}\n\n\t/**\n\t * Checks if row is disabled or not.\n\t */\n\tisRowDisabled(index: number) {\n\t\tconst row = this.data[index] as TableRow;\n\t\treturn !!row.disabled;\n\t}\n\n\t/**\n\t * Expands/Collapses `index`th row based on value\n\t *\n\t * @param index index of the row to expand or collapse\n\t * @param value expanded state of the row. `true` is expanded and `false` is collapsed\n\t */\n\texpandRow(index: number, value = true) {\n\t\tthis.rowsExpanded[index] = value;\n\t\tthis.rowsExpandedChange.emit(index);\n\t}\n\n\t/**\n\t * Expands / collapses all rows\n\t *\n\t * @param value expanded state of the rows. `true` is expanded and `false` is collapsed\n\t */\n\texpandAllRows(value = true) {\n\t\tif (this.data.length > 0) {\n\t\t\tfor (let i = 0; i < this.data.length; i++) {\n\t\t\t\tif (this.isRowExpandable(i)) {\n\t\t\t\t\tthis.rowsExpanded[i] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tthis.rowsExpandedAllChange.emit();\n\t\t\t} else {\n\t\t\t\tthis.rowsCollapsedAllChange.emit();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Gets the true index of a row based on it's relative position.\n\t * Like in Python, positive numbers start from the top and\n\t * negative numbers start from the bottom.\n\t *\n\t * @param index\n\t */\n\tprotected realRowIndex(index: number): number {\n\t\treturn this.realIndex(index, this.data.length);\n\t}\n\n\t/**\n\t * Gets the true index of a column based on it's relative position.\n\t * Like in Python, positive numbers start from the top and\n\t * negative numbers start from the bottom.\n\t *\n\t * @param index\n\t */\n\tprotected realColumnIndex(index: number): number {\n\t\treturn this.realIndex(index, this.data[0].length);\n\t}\n\n\t/**\n\t * Generic function to calculate the real index of something.\n\t * Used by `realRowIndex()` and `realColumnIndex()`\n\t *\n\t * @param index\n\t * @param length\n\t */\n\tprotected realIndex(index: number, length: number): number {\n\t\tif (index == null) {\n\t\t\treturn length - 1;\n\t\t} else if (index >= 0) {\n\t\t\treturn index >= length ? length - 1 : index;\n\t\t} else {\n\t\t\treturn -index >= length ? 0 : length + index;\n\t\t}\n\t}\n}\n",
|
|
8805
8805
|
"constructorObj": {
|
|
8806
8806
|
"name": "constructor",
|
|
8807
8807
|
"description": "",
|
|
8808
8808
|
"deprecated": false,
|
|
8809
8809
|
"deprecationMessage": "",
|
|
8810
8810
|
"args": [],
|
|
8811
|
-
"line":
|
|
8811
|
+
"line": 194
|
|
8812
8812
|
},
|
|
8813
8813
|
"inputsClass": [],
|
|
8814
8814
|
"outputsClass": [],
|
|
@@ -8821,7 +8821,7 @@
|
|
|
8821
8821
|
"type": "number",
|
|
8822
8822
|
"optional": false,
|
|
8823
8823
|
"description": "<p>Tracks the current page.</p>\n",
|
|
8824
|
-
"line":
|
|
8824
|
+
"line": 132,
|
|
8825
8825
|
"rawdescription": "\n\nTracks the current page.\n"
|
|
8826
8826
|
},
|
|
8827
8827
|
{
|
|
@@ -8842,7 +8842,7 @@
|
|
|
8842
8842
|
"type": "TableHeaderItem[]",
|
|
8843
8843
|
"optional": false,
|
|
8844
8844
|
"description": "<p>Contains information about the header cells of the table.</p>\n",
|
|
8845
|
-
"line":
|
|
8845
|
+
"line": 127,
|
|
8846
8846
|
"rawdescription": "\n\nContains information about the header cells of the table.\n"
|
|
8847
8847
|
},
|
|
8848
8848
|
{
|
|
@@ -8853,7 +8853,7 @@
|
|
|
8853
8853
|
"type": "",
|
|
8854
8854
|
"optional": false,
|
|
8855
8855
|
"description": "<p>Set to true when there is no more data to load in the table</p>\n",
|
|
8856
|
-
"line":
|
|
8856
|
+
"line": 142,
|
|
8857
8857
|
"rawdescription": "\n\nSet to true when there is no more data to load in the table\n"
|
|
8858
8858
|
},
|
|
8859
8859
|
{
|
|
@@ -8864,7 +8864,7 @@
|
|
|
8864
8864
|
"type": "",
|
|
8865
8865
|
"optional": false,
|
|
8866
8866
|
"description": "<p>Set to true when lazy loading to show loading indicator</p>\n",
|
|
8867
|
-
"line":
|
|
8867
|
+
"line": 147,
|
|
8868
8868
|
"rawdescription": "\n\nSet to true when lazy loading to show loading indicator\n"
|
|
8869
8869
|
},
|
|
8870
8870
|
{
|
|
@@ -8875,7 +8875,7 @@
|
|
|
8875
8875
|
"type": "number",
|
|
8876
8876
|
"optional": false,
|
|
8877
8877
|
"description": "<p>Length of page.</p>\n",
|
|
8878
|
-
"line":
|
|
8878
|
+
"line": 137,
|
|
8879
8879
|
"rawdescription": "\n\nLength of page.\n"
|
|
8880
8880
|
},
|
|
8881
8881
|
{
|
|
@@ -8886,9 +8886,19 @@
|
|
|
8886
8886
|
"type": "string[]",
|
|
8887
8887
|
"optional": false,
|
|
8888
8888
|
"description": "<p>Contains class name(s) of the row.</p>\n<p>It affects styling of the row to reflect the appended class name(s).</p>\n<p>It's empty or undefined by default</p>\n",
|
|
8889
|
-
"line":
|
|
8889
|
+
"line": 122,
|
|
8890
8890
|
"rawdescription": "\n\nContains class name(s) of the row.\n\nIt affects styling of the row to reflect the appended class name(s).\n\nIt's empty or undefined by default\n"
|
|
8891
8891
|
},
|
|
8892
|
+
{
|
|
8893
|
+
"name": "rowsCollapsedAllChange",
|
|
8894
|
+
"defaultValue": "new EventEmitter()",
|
|
8895
|
+
"deprecated": false,
|
|
8896
|
+
"deprecationMessage": "",
|
|
8897
|
+
"type": "",
|
|
8898
|
+
"optional": false,
|
|
8899
|
+
"description": "",
|
|
8900
|
+
"line": 73
|
|
8901
|
+
},
|
|
8892
8902
|
{
|
|
8893
8903
|
"name": "rowsContext",
|
|
8894
8904
|
"defaultValue": "[]",
|
|
@@ -8897,7 +8907,7 @@
|
|
|
8897
8907
|
"type": "string[]",
|
|
8898
8908
|
"optional": false,
|
|
8899
8909
|
"description": "<p>Contains information about the context of the row.</p>\n<p>It affects styling of the row to reflect the context.</p>\n<p>string can be one of <code>"success" | "warning" | "info" | "error" | ""</code> and it's\nempty or undefined by default</p>\n",
|
|
8900
|
-
"line":
|
|
8910
|
+
"line": 113,
|
|
8901
8911
|
"rawdescription": "\n\nContains information about the context of the row.\n\nIt affects styling of the row to reflect the context.\n\nstring can be one of `\"success\" | \"warning\" | \"info\" | \"error\" | \"\"` and it's\nempty or undefined by default\n"
|
|
8902
8912
|
},
|
|
8903
8913
|
{
|
|
@@ -8908,9 +8918,19 @@
|
|
|
8908
8918
|
"type": "boolean[]",
|
|
8909
8919
|
"optional": false,
|
|
8910
8920
|
"description": "<p>Contains information about expanded state of rows in the table.</p>\n",
|
|
8911
|
-
"line":
|
|
8921
|
+
"line": 98,
|
|
8912
8922
|
"rawdescription": "\n\nContains information about expanded state of rows in the table.\n"
|
|
8913
8923
|
},
|
|
8924
|
+
{
|
|
8925
|
+
"name": "rowsExpandedAllChange",
|
|
8926
|
+
"defaultValue": "new EventEmitter()",
|
|
8927
|
+
"deprecated": false,
|
|
8928
|
+
"deprecationMessage": "",
|
|
8929
|
+
"type": "",
|
|
8930
|
+
"optional": false,
|
|
8931
|
+
"description": "",
|
|
8932
|
+
"line": 72
|
|
8933
|
+
},
|
|
8914
8934
|
{
|
|
8915
8935
|
"name": "rowsExpandedChange",
|
|
8916
8936
|
"defaultValue": "new EventEmitter<number>()",
|
|
@@ -8929,7 +8949,7 @@
|
|
|
8929
8949
|
"type": "number[]",
|
|
8930
8950
|
"optional": false,
|
|
8931
8951
|
"description": "<p>Contains information about initial index of rows in the table</p>\n",
|
|
8932
|
-
"line":
|
|
8952
|
+
"line": 103,
|
|
8933
8953
|
"rawdescription": "\n\nContains information about initial index of rows in the table\n"
|
|
8934
8954
|
},
|
|
8935
8955
|
{
|
|
@@ -8940,7 +8960,7 @@
|
|
|
8940
8960
|
"type": "boolean[]",
|
|
8941
8961
|
"optional": false,
|
|
8942
8962
|
"description": "<p>Contains information about selection state of rows in the table.</p>\n",
|
|
8943
|
-
"line":
|
|
8963
|
+
"line": 93,
|
|
8944
8964
|
"rawdescription": "\n\nContains information about selection state of rows in the table.\n"
|
|
8945
8965
|
},
|
|
8946
8966
|
{
|
|
@@ -8961,7 +8981,7 @@
|
|
|
8961
8981
|
"type": "",
|
|
8962
8982
|
"optional": false,
|
|
8963
8983
|
"description": "<p>Gets emitted when <code>selectAll</code> is called. Emits false if all rows are deselected and true if\nall rows are selected.</p>\n",
|
|
8964
|
-
"line":
|
|
8984
|
+
"line": 78,
|
|
8965
8985
|
"rawdescription": "\n\nGets emitted when `selectAll` is called. Emits false if all rows are deselected and true if\nall rows are selected.\n"
|
|
8966
8986
|
}
|
|
8967
8987
|
],
|
|
@@ -8989,7 +9009,7 @@
|
|
|
8989
9009
|
"optional": false,
|
|
8990
9010
|
"returnType": "void",
|
|
8991
9011
|
"typeParameters": [],
|
|
8992
|
-
"line":
|
|
9012
|
+
"line": 477,
|
|
8993
9013
|
"deprecated": false,
|
|
8994
9014
|
"deprecationMessage": "",
|
|
8995
9015
|
"rawdescription": "\n\nAdds a column to the `index`th column or appends to table if index not provided.\n\nIf column is shorter than other columns or not provided, it will be padded with\nempty `TableItem` elements.\n\nIf column is longer than other columns, others will be extended to match so no data is lost.\n\nIf called on an empty table with no parameters, it creates a 1x1 table.\n\nNegative index starts from the end. -1 being the last element.\n\n",
|
|
@@ -8997,8 +9017,8 @@
|
|
|
8997
9017
|
"jsdoctags": [
|
|
8998
9018
|
{
|
|
8999
9019
|
"name": {
|
|
9000
|
-
"pos":
|
|
9001
|
-
"end":
|
|
9020
|
+
"pos": 12361,
|
|
9021
|
+
"end": 12367,
|
|
9002
9022
|
"flags": 16842752,
|
|
9003
9023
|
"modifierFlagsCache": 0,
|
|
9004
9024
|
"transformFlags": 0,
|
|
@@ -9010,8 +9030,8 @@
|
|
|
9010
9030
|
"deprecationMessage": "",
|
|
9011
9031
|
"optional": true,
|
|
9012
9032
|
"tagName": {
|
|
9013
|
-
"pos":
|
|
9014
|
-
"end":
|
|
9033
|
+
"pos": 12354,
|
|
9034
|
+
"end": 12359,
|
|
9015
9035
|
"flags": 16842752,
|
|
9016
9036
|
"modifierFlagsCache": 0,
|
|
9017
9037
|
"transformFlags": 0,
|
|
@@ -9022,8 +9042,8 @@
|
|
|
9022
9042
|
},
|
|
9023
9043
|
{
|
|
9024
9044
|
"name": {
|
|
9025
|
-
"pos":
|
|
9026
|
-
"end":
|
|
9045
|
+
"pos": 12381,
|
|
9046
|
+
"end": 12386,
|
|
9027
9047
|
"flags": 16842752,
|
|
9028
9048
|
"modifierFlagsCache": 0,
|
|
9029
9049
|
"transformFlags": 0,
|
|
@@ -9035,8 +9055,8 @@
|
|
|
9035
9055
|
"deprecationMessage": "",
|
|
9036
9056
|
"optional": true,
|
|
9037
9057
|
"tagName": {
|
|
9038
|
-
"pos":
|
|
9039
|
-
"end":
|
|
9058
|
+
"pos": 12374,
|
|
9059
|
+
"end": 12379,
|
|
9040
9060
|
"flags": 16842752,
|
|
9041
9061
|
"modifierFlagsCache": 0,
|
|
9042
9062
|
"transformFlags": 0,
|
|
@@ -9068,7 +9088,7 @@
|
|
|
9068
9088
|
"optional": false,
|
|
9069
9089
|
"returnType": "void",
|
|
9070
9090
|
"typeParameters": [],
|
|
9071
|
-
"line":
|
|
9091
|
+
"line": 310,
|
|
9072
9092
|
"deprecated": false,
|
|
9073
9093
|
"deprecationMessage": "",
|
|
9074
9094
|
"rawdescription": "\n\nAdds a row to the `index`th row or appends to table if index not provided.\n\nIf row is shorter than other rows or not provided, it will be padded with\nempty `TableItem` elements.\n\nIf row is longer than other rows, others will be extended to match so no data is lost.\n\nIf called on an empty table with no parameters, it creates a 1x1 table.\n\nNegative index starts from the end. -1 being the last element.\n\n",
|
|
@@ -9076,8 +9096,8 @@
|
|
|
9076
9096
|
"jsdoctags": [
|
|
9077
9097
|
{
|
|
9078
9098
|
"name": {
|
|
9079
|
-
"pos":
|
|
9080
|
-
"end":
|
|
9099
|
+
"pos": 7948,
|
|
9100
|
+
"end": 7951,
|
|
9081
9101
|
"flags": 16842752,
|
|
9082
9102
|
"modifierFlagsCache": 0,
|
|
9083
9103
|
"transformFlags": 0,
|
|
@@ -9089,8 +9109,8 @@
|
|
|
9089
9109
|
"deprecationMessage": "",
|
|
9090
9110
|
"optional": true,
|
|
9091
9111
|
"tagName": {
|
|
9092
|
-
"pos":
|
|
9093
|
-
"end":
|
|
9112
|
+
"pos": 7941,
|
|
9113
|
+
"end": 7946,
|
|
9094
9114
|
"flags": 16842752,
|
|
9095
9115
|
"modifierFlagsCache": 0,
|
|
9096
9116
|
"transformFlags": 0,
|
|
@@ -9101,8 +9121,8 @@
|
|
|
9101
9121
|
},
|
|
9102
9122
|
{
|
|
9103
9123
|
"name": {
|
|
9104
|
-
"pos":
|
|
9105
|
-
"end":
|
|
9124
|
+
"pos": 7965,
|
|
9125
|
+
"end": 7970,
|
|
9106
9126
|
"flags": 16842752,
|
|
9107
9127
|
"modifierFlagsCache": 0,
|
|
9108
9128
|
"transformFlags": 0,
|
|
@@ -9114,8 +9134,8 @@
|
|
|
9114
9134
|
"deprecationMessage": "",
|
|
9115
9135
|
"optional": true,
|
|
9116
9136
|
"tagName": {
|
|
9117
|
-
"pos":
|
|
9118
|
-
"end":
|
|
9137
|
+
"pos": 7958,
|
|
9138
|
+
"end": 7963,
|
|
9119
9139
|
"flags": 16842752,
|
|
9120
9140
|
"modifierFlagsCache": 0,
|
|
9121
9141
|
"transformFlags": 0,
|
|
@@ -9139,7 +9159,7 @@
|
|
|
9139
9159
|
"optional": false,
|
|
9140
9160
|
"returnType": "TableItem[]",
|
|
9141
9161
|
"typeParameters": [],
|
|
9142
|
-
"line":
|
|
9162
|
+
"line": 449,
|
|
9143
9163
|
"deprecated": false,
|
|
9144
9164
|
"deprecationMessage": "",
|
|
9145
9165
|
"rawdescription": "\n\nReturns `index`th column of the table.\n\nNegative index starts from the end. -1 being the last element.\n\n",
|
|
@@ -9147,8 +9167,8 @@
|
|
|
9147
9167
|
"jsdoctags": [
|
|
9148
9168
|
{
|
|
9149
9169
|
"name": {
|
|
9150
|
-
"pos":
|
|
9151
|
-
"end":
|
|
9170
|
+
"pos": 11608,
|
|
9171
|
+
"end": 11613,
|
|
9152
9172
|
"flags": 16842752,
|
|
9153
9173
|
"modifierFlagsCache": 0,
|
|
9154
9174
|
"transformFlags": 0,
|
|
@@ -9159,8 +9179,8 @@
|
|
|
9159
9179
|
"deprecated": false,
|
|
9160
9180
|
"deprecationMessage": "",
|
|
9161
9181
|
"tagName": {
|
|
9162
|
-
"pos":
|
|
9163
|
-
"end":
|
|
9182
|
+
"pos": 11602,
|
|
9183
|
+
"end": 11607,
|
|
9164
9184
|
"flags": 16842752,
|
|
9165
9185
|
"modifierFlagsCache": 0,
|
|
9166
9186
|
"transformFlags": 0,
|
|
@@ -9184,7 +9204,7 @@
|
|
|
9184
9204
|
"optional": false,
|
|
9185
9205
|
"returnType": "void",
|
|
9186
9206
|
"typeParameters": [],
|
|
9187
|
-
"line":
|
|
9207
|
+
"line": 565,
|
|
9188
9208
|
"deprecated": false,
|
|
9189
9209
|
"deprecationMessage": "",
|
|
9190
9210
|
"rawdescription": "\n\ncycle through the three sort states\n",
|
|
@@ -9192,8 +9212,8 @@
|
|
|
9192
9212
|
"jsdoctags": [
|
|
9193
9213
|
{
|
|
9194
9214
|
"name": {
|
|
9195
|
-
"pos":
|
|
9196
|
-
"end":
|
|
9215
|
+
"pos": 14673,
|
|
9216
|
+
"end": 14678,
|
|
9197
9217
|
"flags": 16842752,
|
|
9198
9218
|
"modifierFlagsCache": 0,
|
|
9199
9219
|
"transformFlags": 0,
|
|
@@ -9204,8 +9224,8 @@
|
|
|
9204
9224
|
"deprecated": false,
|
|
9205
9225
|
"deprecationMessage": "",
|
|
9206
9226
|
"tagName": {
|
|
9207
|
-
"pos":
|
|
9208
|
-
"end":
|
|
9227
|
+
"pos": 14667,
|
|
9228
|
+
"end": 14672,
|
|
9209
9229
|
"flags": 16842752,
|
|
9210
9230
|
"modifierFlagsCache": 0,
|
|
9211
9231
|
"transformFlags": 0,
|
|
@@ -9229,7 +9249,7 @@
|
|
|
9229
9249
|
"optional": false,
|
|
9230
9250
|
"returnType": "void",
|
|
9231
9251
|
"typeParameters": [],
|
|
9232
|
-
"line":
|
|
9252
|
+
"line": 538,
|
|
9233
9253
|
"deprecated": false,
|
|
9234
9254
|
"deprecationMessage": "",
|
|
9235
9255
|
"rawdescription": "\n\nDeletes `index`th column.\n\nNegative index starts from the end. -1 being the last element.\n\n",
|
|
@@ -9237,8 +9257,8 @@
|
|
|
9237
9257
|
"jsdoctags": [
|
|
9238
9258
|
{
|
|
9239
9259
|
"name": {
|
|
9240
|
-
"pos":
|
|
9241
|
-
"end":
|
|
9260
|
+
"pos": 13972,
|
|
9261
|
+
"end": 13977,
|
|
9242
9262
|
"flags": 16842752,
|
|
9243
9263
|
"modifierFlagsCache": 0,
|
|
9244
9264
|
"transformFlags": 0,
|
|
@@ -9249,8 +9269,8 @@
|
|
|
9249
9269
|
"deprecated": false,
|
|
9250
9270
|
"deprecationMessage": "",
|
|
9251
9271
|
"tagName": {
|
|
9252
|
-
"pos":
|
|
9253
|
-
"end":
|
|
9272
|
+
"pos": 13966,
|
|
9273
|
+
"end": 13971,
|
|
9254
9274
|
"flags": 16842752,
|
|
9255
9275
|
"modifierFlagsCache": 0,
|
|
9256
9276
|
"transformFlags": 0,
|
|
@@ -9274,7 +9294,7 @@
|
|
|
9274
9294
|
"optional": false,
|
|
9275
9295
|
"returnType": "void",
|
|
9276
9296
|
"typeParameters": [],
|
|
9277
|
-
"line":
|
|
9297
|
+
"line": 399,
|
|
9278
9298
|
"deprecated": false,
|
|
9279
9299
|
"deprecationMessage": "",
|
|
9280
9300
|
"rawdescription": "\n\nDeletes `index`th row.\n\nNegative index starts from the end. -1 being the last element.\n\n",
|
|
@@ -9282,8 +9302,8 @@
|
|
|
9282
9302
|
"jsdoctags": [
|
|
9283
9303
|
{
|
|
9284
9304
|
"name": {
|
|
9285
|
-
"pos":
|
|
9286
|
-
"end":
|
|
9305
|
+
"pos": 10408,
|
|
9306
|
+
"end": 10413,
|
|
9287
9307
|
"flags": 16842752,
|
|
9288
9308
|
"modifierFlagsCache": 0,
|
|
9289
9309
|
"transformFlags": 0,
|
|
@@ -9294,8 +9314,8 @@
|
|
|
9294
9314
|
"deprecated": false,
|
|
9295
9315
|
"deprecationMessage": "",
|
|
9296
9316
|
"tagName": {
|
|
9297
|
-
"pos":
|
|
9298
|
-
"end":
|
|
9317
|
+
"pos": 10402,
|
|
9318
|
+
"end": 10407,
|
|
9299
9319
|
"flags": 16842752,
|
|
9300
9320
|
"modifierFlagsCache": 0,
|
|
9301
9321
|
"transformFlags": 0,
|
|
@@ -9306,13 +9326,86 @@
|
|
|
9306
9326
|
}
|
|
9307
9327
|
]
|
|
9308
9328
|
},
|
|
9329
|
+
{
|
|
9330
|
+
"name": "expandableRowsCount",
|
|
9331
|
+
"args": [],
|
|
9332
|
+
"optional": false,
|
|
9333
|
+
"returnType": "any",
|
|
9334
|
+
"typeParameters": [],
|
|
9335
|
+
"line": 423,
|
|
9336
|
+
"deprecated": false,
|
|
9337
|
+
"deprecationMessage": "",
|
|
9338
|
+
"rawdescription": "\n\nNumber of rows that can be expanded.\n\n",
|
|
9339
|
+
"description": "<p>Number of rows that can be expanded.</p>\n",
|
|
9340
|
+
"jsdoctags": [
|
|
9341
|
+
{
|
|
9342
|
+
"tagName": {
|
|
9343
|
+
"pos": 11041,
|
|
9344
|
+
"end": 11048,
|
|
9345
|
+
"flags": 16842752,
|
|
9346
|
+
"modifierFlagsCache": 0,
|
|
9347
|
+
"transformFlags": 0,
|
|
9348
|
+
"kind": 80,
|
|
9349
|
+
"escapedText": "returns"
|
|
9350
|
+
},
|
|
9351
|
+
"comment": "<p>number</p>\n"
|
|
9352
|
+
}
|
|
9353
|
+
]
|
|
9354
|
+
},
|
|
9355
|
+
{
|
|
9356
|
+
"name": "expandAllRows",
|
|
9357
|
+
"args": [
|
|
9358
|
+
{
|
|
9359
|
+
"name": "value",
|
|
9360
|
+
"type": "",
|
|
9361
|
+
"deprecated": false,
|
|
9362
|
+
"deprecationMessage": "",
|
|
9363
|
+
"defaultValue": "true"
|
|
9364
|
+
}
|
|
9365
|
+
],
|
|
9366
|
+
"optional": false,
|
|
9367
|
+
"returnType": "void",
|
|
9368
|
+
"typeParameters": [],
|
|
9369
|
+
"line": 727,
|
|
9370
|
+
"deprecated": false,
|
|
9371
|
+
"deprecationMessage": "",
|
|
9372
|
+
"rawdescription": "\n\nExpands / collapses all rows\n\n",
|
|
9373
|
+
"description": "<p>Expands / collapses all rows</p>\n",
|
|
9374
|
+
"jsdoctags": [
|
|
9375
|
+
{
|
|
9376
|
+
"name": {
|
|
9377
|
+
"pos": 19320,
|
|
9378
|
+
"end": 19325,
|
|
9379
|
+
"flags": 16842752,
|
|
9380
|
+
"modifierFlagsCache": 0,
|
|
9381
|
+
"transformFlags": 0,
|
|
9382
|
+
"kind": 80,
|
|
9383
|
+
"escapedText": "value"
|
|
9384
|
+
},
|
|
9385
|
+
"type": "",
|
|
9386
|
+
"deprecated": false,
|
|
9387
|
+
"deprecationMessage": "",
|
|
9388
|
+
"defaultValue": "true",
|
|
9389
|
+
"tagName": {
|
|
9390
|
+
"pos": 19314,
|
|
9391
|
+
"end": 19319,
|
|
9392
|
+
"flags": 16842752,
|
|
9393
|
+
"modifierFlagsCache": 0,
|
|
9394
|
+
"transformFlags": 0,
|
|
9395
|
+
"kind": 80,
|
|
9396
|
+
"escapedText": "param"
|
|
9397
|
+
},
|
|
9398
|
+
"comment": "<p>expanded state of the rows. <code>true</code> is expanded and <code>false</code> is collapsed</p>\n"
|
|
9399
|
+
}
|
|
9400
|
+
]
|
|
9401
|
+
},
|
|
9309
9402
|
{
|
|
9310
9403
|
"name": "expandedRowsCount",
|
|
9311
9404
|
"args": [],
|
|
9312
9405
|
"optional": false,
|
|
9313
9406
|
"returnType": "number",
|
|
9314
9407
|
"typeParameters": [],
|
|
9315
|
-
"line":
|
|
9408
|
+
"line": 272,
|
|
9316
9409
|
"deprecated": false,
|
|
9317
9410
|
"deprecationMessage": "",
|
|
9318
9411
|
"rawdescription": "\n\nReturns how many rows is currently expanded\n",
|
|
@@ -9338,7 +9431,7 @@
|
|
|
9338
9431
|
"optional": false,
|
|
9339
9432
|
"returnType": "void",
|
|
9340
9433
|
"typeParameters": [],
|
|
9341
|
-
"line":
|
|
9434
|
+
"line": 717,
|
|
9342
9435
|
"deprecated": false,
|
|
9343
9436
|
"deprecationMessage": "",
|
|
9344
9437
|
"rawdescription": "\n\nExpands/Collapses `index`th row based on value\n\n",
|
|
@@ -9346,8 +9439,8 @@
|
|
|
9346
9439
|
"jsdoctags": [
|
|
9347
9440
|
{
|
|
9348
9441
|
"name": {
|
|
9349
|
-
"pos":
|
|
9350
|
-
"end":
|
|
9442
|
+
"pos": 19008,
|
|
9443
|
+
"end": 19013,
|
|
9351
9444
|
"flags": 16842752,
|
|
9352
9445
|
"modifierFlagsCache": 0,
|
|
9353
9446
|
"transformFlags": 0,
|
|
@@ -9358,8 +9451,8 @@
|
|
|
9358
9451
|
"deprecated": false,
|
|
9359
9452
|
"deprecationMessage": "",
|
|
9360
9453
|
"tagName": {
|
|
9361
|
-
"pos":
|
|
9362
|
-
"end":
|
|
9454
|
+
"pos": 19002,
|
|
9455
|
+
"end": 19007,
|
|
9363
9456
|
"flags": 16842752,
|
|
9364
9457
|
"modifierFlagsCache": 0,
|
|
9365
9458
|
"transformFlags": 0,
|
|
@@ -9370,8 +9463,8 @@
|
|
|
9370
9463
|
},
|
|
9371
9464
|
{
|
|
9372
9465
|
"name": {
|
|
9373
|
-
"pos":
|
|
9374
|
-
"end":
|
|
9466
|
+
"pos": 19064,
|
|
9467
|
+
"end": 19069,
|
|
9375
9468
|
"flags": 16842752,
|
|
9376
9469
|
"modifierFlagsCache": 0,
|
|
9377
9470
|
"transformFlags": 0,
|
|
@@ -9383,8 +9476,8 @@
|
|
|
9383
9476
|
"deprecationMessage": "",
|
|
9384
9477
|
"defaultValue": "true",
|
|
9385
9478
|
"tagName": {
|
|
9386
|
-
"pos":
|
|
9387
|
-
"end":
|
|
9479
|
+
"pos": 19058,
|
|
9480
|
+
"end": 19063,
|
|
9388
9481
|
"flags": 16842752,
|
|
9389
9482
|
"modifierFlagsCache": 0,
|
|
9390
9483
|
"transformFlags": 0,
|
|
@@ -9408,7 +9501,7 @@
|
|
|
9408
9501
|
"optional": false,
|
|
9409
9502
|
"returnType": "TableHeaderItem",
|
|
9410
9503
|
"typeParameters": [],
|
|
9411
|
-
"line":
|
|
9504
|
+
"line": 239,
|
|
9412
9505
|
"deprecated": false,
|
|
9413
9506
|
"deprecationMessage": "",
|
|
9414
9507
|
"rawdescription": "\n\nFinds closest header by trying the `column` and then working its way to the left\n\n",
|
|
@@ -9416,8 +9509,8 @@
|
|
|
9416
9509
|
"jsdoctags": [
|
|
9417
9510
|
{
|
|
9418
9511
|
"name": {
|
|
9419
|
-
"pos":
|
|
9420
|
-
"end":
|
|
9512
|
+
"pos": 6487,
|
|
9513
|
+
"end": 6493,
|
|
9421
9514
|
"flags": 16842752,
|
|
9422
9515
|
"modifierFlagsCache": 0,
|
|
9423
9516
|
"transformFlags": 0,
|
|
@@ -9428,8 +9521,8 @@
|
|
|
9428
9521
|
"deprecated": false,
|
|
9429
9522
|
"deprecationMessage": "",
|
|
9430
9523
|
"tagName": {
|
|
9431
|
-
"pos":
|
|
9432
|
-
"end":
|
|
9524
|
+
"pos": 6481,
|
|
9525
|
+
"end": 6486,
|
|
9433
9526
|
"flags": 16842752,
|
|
9434
9527
|
"modifierFlagsCache": 0,
|
|
9435
9528
|
"transformFlags": 0,
|
|
@@ -9460,7 +9553,7 @@
|
|
|
9460
9553
|
"optional": false,
|
|
9461
9554
|
"returnType": "string",
|
|
9462
9555
|
"typeParameters": [],
|
|
9463
|
-
"line":
|
|
9556
|
+
"line": 216,
|
|
9464
9557
|
"deprecated": false,
|
|
9465
9558
|
"deprecationMessage": "",
|
|
9466
9559
|
"rawdescription": "\n\nReturns the id of the header. Used to link the cells with headers (or headers with headers)\n\n",
|
|
@@ -9468,8 +9561,8 @@
|
|
|
9468
9561
|
"jsdoctags": [
|
|
9469
9562
|
{
|
|
9470
9563
|
"name": {
|
|
9471
|
-
"pos":
|
|
9472
|
-
"end":
|
|
9564
|
+
"pos": 5903,
|
|
9565
|
+
"end": 5909,
|
|
9473
9566
|
"flags": 16842752,
|
|
9474
9567
|
"modifierFlagsCache": 0,
|
|
9475
9568
|
"transformFlags": 0,
|
|
@@ -9480,8 +9573,8 @@
|
|
|
9480
9573
|
"deprecated": false,
|
|
9481
9574
|
"deprecationMessage": "",
|
|
9482
9575
|
"tagName": {
|
|
9483
|
-
"pos":
|
|
9484
|
-
"end":
|
|
9576
|
+
"pos": 5897,
|
|
9577
|
+
"end": 5902,
|
|
9485
9578
|
"flags": 16842752,
|
|
9486
9579
|
"modifierFlagsCache": 0,
|
|
9487
9580
|
"transformFlags": 0,
|
|
@@ -9492,8 +9585,8 @@
|
|
|
9492
9585
|
},
|
|
9493
9586
|
{
|
|
9494
9587
|
"name": {
|
|
9495
|
-
"pos":
|
|
9496
|
-
"end":
|
|
9588
|
+
"pos": 5961,
|
|
9589
|
+
"end": 5968,
|
|
9497
9590
|
"flags": 16842752,
|
|
9498
9591
|
"modifierFlagsCache": 0,
|
|
9499
9592
|
"transformFlags": 0,
|
|
@@ -9505,8 +9598,8 @@
|
|
|
9505
9598
|
"deprecationMessage": "",
|
|
9506
9599
|
"defaultValue": "1",
|
|
9507
9600
|
"tagName": {
|
|
9508
|
-
"pos":
|
|
9509
|
-
"end":
|
|
9601
|
+
"pos": 5955,
|
|
9602
|
+
"end": 5960,
|
|
9510
9603
|
"flags": 16842752,
|
|
9511
9604
|
"modifierFlagsCache": 0,
|
|
9512
9605
|
"transformFlags": 0,
|
|
@@ -9537,7 +9630,7 @@
|
|
|
9537
9630
|
"optional": false,
|
|
9538
9631
|
"returnType": "string",
|
|
9539
9632
|
"typeParameters": [],
|
|
9540
|
-
"line":
|
|
9633
|
+
"line": 206,
|
|
9541
9634
|
"deprecated": false,
|
|
9542
9635
|
"deprecationMessage": "",
|
|
9543
9636
|
"rawdescription": "\n\nReturns an id for the given column\n\n",
|
|
@@ -9545,8 +9638,8 @@
|
|
|
9545
9638
|
"jsdoctags": [
|
|
9546
9639
|
{
|
|
9547
9640
|
"name": {
|
|
9548
|
-
"pos":
|
|
9549
|
-
"end":
|
|
9641
|
+
"pos": 5567,
|
|
9642
|
+
"end": 5573,
|
|
9550
9643
|
"flags": 16842752,
|
|
9551
9644
|
"modifierFlagsCache": 0,
|
|
9552
9645
|
"transformFlags": 0,
|
|
@@ -9557,8 +9650,8 @@
|
|
|
9557
9650
|
"deprecated": false,
|
|
9558
9651
|
"deprecationMessage": "",
|
|
9559
9652
|
"tagName": {
|
|
9560
|
-
"pos":
|
|
9561
|
-
"end":
|
|
9653
|
+
"pos": 5561,
|
|
9654
|
+
"end": 5566,
|
|
9562
9655
|
"flags": 16842752,
|
|
9563
9656
|
"modifierFlagsCache": 0,
|
|
9564
9657
|
"transformFlags": 0,
|
|
@@ -9569,8 +9662,8 @@
|
|
|
9569
9662
|
},
|
|
9570
9663
|
{
|
|
9571
9664
|
"name": {
|
|
9572
|
-
"pos":
|
|
9573
|
-
"end":
|
|
9665
|
+
"pos": 5618,
|
|
9666
|
+
"end": 5621,
|
|
9574
9667
|
"flags": 16842752,
|
|
9575
9668
|
"modifierFlagsCache": 0,
|
|
9576
9669
|
"transformFlags": 0,
|
|
@@ -9582,8 +9675,8 @@
|
|
|
9582
9675
|
"deprecationMessage": "",
|
|
9583
9676
|
"defaultValue": "0",
|
|
9584
9677
|
"tagName": {
|
|
9585
|
-
"pos":
|
|
9586
|
-
"end":
|
|
9678
|
+
"pos": 5612,
|
|
9679
|
+
"end": 5617,
|
|
9587
9680
|
"flags": 16842752,
|
|
9588
9681
|
"modifierFlagsCache": 0,
|
|
9589
9682
|
"transformFlags": 0,
|
|
@@ -9607,7 +9700,7 @@
|
|
|
9607
9700
|
"optional": false,
|
|
9608
9701
|
"returnType": "any",
|
|
9609
9702
|
"typeParameters": [],
|
|
9610
|
-
"line":
|
|
9703
|
+
"line": 438,
|
|
9611
9704
|
"deprecated": false,
|
|
9612
9705
|
"deprecationMessage": "",
|
|
9613
9706
|
"jsdoctags": [
|
|
@@ -9628,7 +9721,7 @@
|
|
|
9628
9721
|
"optional": false,
|
|
9629
9722
|
"returnType": "any",
|
|
9630
9723
|
"typeParameters": [],
|
|
9631
|
-
"line":
|
|
9724
|
+
"line": 414,
|
|
9632
9725
|
"deprecated": false,
|
|
9633
9726
|
"deprecationMessage": ""
|
|
9634
9727
|
},
|
|
@@ -9645,7 +9738,7 @@
|
|
|
9645
9738
|
"optional": false,
|
|
9646
9739
|
"returnType": "boolean",
|
|
9647
9740
|
"typeParameters": [],
|
|
9648
|
-
"line":
|
|
9741
|
+
"line": 706,
|
|
9649
9742
|
"deprecated": false,
|
|
9650
9743
|
"deprecationMessage": "",
|
|
9651
9744
|
"rawdescription": "\n\nChecks if row is disabled or not.\n",
|
|
@@ -9675,7 +9768,7 @@
|
|
|
9675
9768
|
"optional": false,
|
|
9676
9769
|
"returnType": "any",
|
|
9677
9770
|
"typeParameters": [],
|
|
9678
|
-
"line":
|
|
9771
|
+
"line": 430,
|
|
9679
9772
|
"deprecated": false,
|
|
9680
9773
|
"deprecationMessage": "",
|
|
9681
9774
|
"jsdoctags": [
|
|
@@ -9703,7 +9796,7 @@
|
|
|
9703
9796
|
"optional": false,
|
|
9704
9797
|
"returnType": "any",
|
|
9705
9798
|
"typeParameters": [],
|
|
9706
|
-
"line":
|
|
9799
|
+
"line": 434,
|
|
9707
9800
|
"deprecated": false,
|
|
9708
9801
|
"deprecationMessage": "",
|
|
9709
9802
|
"jsdoctags": [
|
|
@@ -9731,7 +9824,7 @@
|
|
|
9731
9824
|
"optional": false,
|
|
9732
9825
|
"returnType": "boolean",
|
|
9733
9826
|
"typeParameters": [],
|
|
9734
|
-
"line":
|
|
9827
|
+
"line": 666,
|
|
9735
9828
|
"deprecated": false,
|
|
9736
9829
|
"deprecationMessage": "",
|
|
9737
9830
|
"rawdescription": "\n\nChecks if row is filtered out.\n\n",
|
|
@@ -9739,8 +9832,8 @@
|
|
|
9739
9832
|
"jsdoctags": [
|
|
9740
9833
|
{
|
|
9741
9834
|
"name": {
|
|
9742
|
-
"pos":
|
|
9743
|
-
"end":
|
|
9835
|
+
"pos": 17763,
|
|
9836
|
+
"end": 17768,
|
|
9744
9837
|
"flags": 16842752,
|
|
9745
9838
|
"modifierFlagsCache": 0,
|
|
9746
9839
|
"transformFlags": 0,
|
|
@@ -9751,8 +9844,8 @@
|
|
|
9751
9844
|
"deprecated": false,
|
|
9752
9845
|
"deprecationMessage": "",
|
|
9753
9846
|
"tagName": {
|
|
9754
|
-
"pos":
|
|
9755
|
-
"end":
|
|
9847
|
+
"pos": 17757,
|
|
9848
|
+
"end": 17762,
|
|
9756
9849
|
"flags": 16842752,
|
|
9757
9850
|
"modifierFlagsCache": 0,
|
|
9758
9851
|
"transformFlags": 0,
|
|
@@ -9763,8 +9856,8 @@
|
|
|
9763
9856
|
},
|
|
9764
9857
|
{
|
|
9765
9858
|
"tagName": {
|
|
9766
|
-
"pos":
|
|
9767
|
-
"end":
|
|
9859
|
+
"pos": 17774,
|
|
9860
|
+
"end": 17781,
|
|
9768
9861
|
"flags": 16842752,
|
|
9769
9862
|
"modifierFlagsCache": 0,
|
|
9770
9863
|
"transformFlags": 0,
|
|
@@ -9788,7 +9881,7 @@
|
|
|
9788
9881
|
"optional": false,
|
|
9789
9882
|
"returnType": "any",
|
|
9790
9883
|
"typeParameters": [],
|
|
9791
|
-
"line":
|
|
9884
|
+
"line": 699,
|
|
9792
9885
|
"deprecated": false,
|
|
9793
9886
|
"deprecationMessage": "",
|
|
9794
9887
|
"jsdoctags": [
|
|
@@ -9822,7 +9915,7 @@
|
|
|
9822
9915
|
"optional": false,
|
|
9823
9916
|
"returnType": "void",
|
|
9824
9917
|
"typeParameters": [],
|
|
9825
|
-
"line":
|
|
9918
|
+
"line": 552,
|
|
9826
9919
|
"deprecated": false,
|
|
9827
9920
|
"deprecationMessage": "",
|
|
9828
9921
|
"jsdoctags": [
|
|
@@ -9852,7 +9945,7 @@
|
|
|
9852
9945
|
"optional": false,
|
|
9853
9946
|
"returnType": "void",
|
|
9854
9947
|
"typeParameters": [],
|
|
9855
|
-
"line":
|
|
9948
|
+
"line": 650,
|
|
9856
9949
|
"deprecated": false,
|
|
9857
9950
|
"deprecationMessage": "",
|
|
9858
9951
|
"rawdescription": "\n\nRestores `rowsSelected` from data pushed by `pushRowSelectionToModelData()`\n\nCall after sorting data (if you previously pushed to maintain selection order)\nto make everything right with the world again.\n",
|
|
@@ -9864,7 +9957,7 @@
|
|
|
9864
9957
|
"optional": false,
|
|
9865
9958
|
"returnType": "void",
|
|
9866
9959
|
"typeParameters": [],
|
|
9867
|
-
"line":
|
|
9960
|
+
"line": 620,
|
|
9868
9961
|
"deprecated": false,
|
|
9869
9962
|
"deprecationMessage": "",
|
|
9870
9963
|
"rawdescription": "\n\nAppends `rowsSelected` and `rowsExpanded` info to model data.\n\nWhen sorting rows, do this first so information about row selection\ngets sorted with the other row info.\n\nCall `popRowSelectionFromModelData()` after sorting to make everything\nright with the world again.\n",
|
|
@@ -9883,7 +9976,7 @@
|
|
|
9883
9976
|
"optional": false,
|
|
9884
9977
|
"returnType": "TableItem[]",
|
|
9885
9978
|
"typeParameters": [],
|
|
9886
|
-
"line":
|
|
9979
|
+
"line": 291,
|
|
9887
9980
|
"deprecated": false,
|
|
9888
9981
|
"deprecationMessage": "",
|
|
9889
9982
|
"rawdescription": "\n\nReturns `index`th row of the table.\n\nNegative index starts from the end. -1 being the last element.\n\n",
|
|
@@ -9891,8 +9984,8 @@
|
|
|
9891
9984
|
"jsdoctags": [
|
|
9892
9985
|
{
|
|
9893
9986
|
"name": {
|
|
9894
|
-
"pos":
|
|
9895
|
-
"end":
|
|
9987
|
+
"pos": 7392,
|
|
9988
|
+
"end": 7397,
|
|
9896
9989
|
"flags": 16842752,
|
|
9897
9990
|
"modifierFlagsCache": 0,
|
|
9898
9991
|
"transformFlags": 0,
|
|
@@ -9903,8 +9996,8 @@
|
|
|
9903
9996
|
"deprecated": false,
|
|
9904
9997
|
"deprecationMessage": "",
|
|
9905
9998
|
"tagName": {
|
|
9906
|
-
"pos":
|
|
9907
|
-
"end":
|
|
9999
|
+
"pos": 7386,
|
|
10000
|
+
"end": 7391,
|
|
9908
10001
|
"flags": 16842752,
|
|
9909
10002
|
"modifierFlagsCache": 0,
|
|
9910
10003
|
"transformFlags": 0,
|
|
@@ -9929,7 +10022,7 @@
|
|
|
9929
10022
|
"optional": false,
|
|
9930
10023
|
"returnType": "void",
|
|
9931
10024
|
"typeParameters": [],
|
|
9932
|
-
"line":
|
|
10025
|
+
"line": 690,
|
|
9933
10026
|
"deprecated": false,
|
|
9934
10027
|
"deprecationMessage": "",
|
|
9935
10028
|
"rawdescription": "\n\nSelects or deselects all rows in the model\n\n",
|
|
@@ -9937,8 +10030,8 @@
|
|
|
9937
10030
|
"jsdoctags": [
|
|
9938
10031
|
{
|
|
9939
10032
|
"name": {
|
|
9940
|
-
"pos":
|
|
9941
|
-
"end":
|
|
10033
|
+
"pos": 18436,
|
|
10034
|
+
"end": 18441,
|
|
9942
10035
|
"flags": 16842752,
|
|
9943
10036
|
"modifierFlagsCache": 0,
|
|
9944
10037
|
"transformFlags": 0,
|
|
@@ -9950,8 +10043,8 @@
|
|
|
9950
10043
|
"deprecationMessage": "",
|
|
9951
10044
|
"defaultValue": "true",
|
|
9952
10045
|
"tagName": {
|
|
9953
|
-
"pos":
|
|
9954
|
-
"end":
|
|
10046
|
+
"pos": 18430,
|
|
10047
|
+
"end": 18435,
|
|
9955
10048
|
"flags": 16842752,
|
|
9956
10049
|
"modifierFlagsCache": 0,
|
|
9957
10050
|
"transformFlags": 0,
|
|
@@ -9968,7 +10061,7 @@
|
|
|
9968
10061
|
"optional": false,
|
|
9969
10062
|
"returnType": "number",
|
|
9970
10063
|
"typeParameters": [],
|
|
9971
|
-
"line":
|
|
10064
|
+
"line": 257,
|
|
9972
10065
|
"deprecated": false,
|
|
9973
10066
|
"deprecationMessage": "",
|
|
9974
10067
|
"rawdescription": "\n\nReturns how many rows is currently selected\n",
|
|
@@ -9994,7 +10087,7 @@
|
|
|
9994
10087
|
"optional": false,
|
|
9995
10088
|
"returnType": "void",
|
|
9996
10089
|
"typeParameters": [],
|
|
9997
|
-
"line":
|
|
10090
|
+
"line": 677,
|
|
9998
10091
|
"deprecated": false,
|
|
9999
10092
|
"deprecationMessage": "",
|
|
10000
10093
|
"rawdescription": "\n\nSelect/deselect `index`th row based on value\n\n",
|
|
@@ -10002,8 +10095,8 @@
|
|
|
10002
10095
|
"jsdoctags": [
|
|
10003
10096
|
{
|
|
10004
10097
|
"name": {
|
|
10005
|
-
"pos":
|
|
10006
|
-
"end":
|
|
10098
|
+
"pos": 18099,
|
|
10099
|
+
"end": 18104,
|
|
10007
10100
|
"flags": 16842752,
|
|
10008
10101
|
"modifierFlagsCache": 0,
|
|
10009
10102
|
"transformFlags": 0,
|
|
@@ -10014,8 +10107,8 @@
|
|
|
10014
10107
|
"deprecated": false,
|
|
10015
10108
|
"deprecationMessage": "",
|
|
10016
10109
|
"tagName": {
|
|
10017
|
-
"pos":
|
|
10018
|
-
"end":
|
|
10110
|
+
"pos": 18093,
|
|
10111
|
+
"end": 18098,
|
|
10019
10112
|
"flags": 16842752,
|
|
10020
10113
|
"modifierFlagsCache": 0,
|
|
10021
10114
|
"transformFlags": 0,
|
|
@@ -10026,8 +10119,8 @@
|
|
|
10026
10119
|
},
|
|
10027
10120
|
{
|
|
10028
10121
|
"name": {
|
|
10029
|
-
"pos":
|
|
10030
|
-
"end":
|
|
10122
|
+
"pos": 18143,
|
|
10123
|
+
"end": 18148,
|
|
10031
10124
|
"flags": 16842752,
|
|
10032
10125
|
"modifierFlagsCache": 0,
|
|
10033
10126
|
"transformFlags": 0,
|
|
@@ -10039,8 +10132,8 @@
|
|
|
10039
10132
|
"deprecationMessage": "",
|
|
10040
10133
|
"defaultValue": "true",
|
|
10041
10134
|
"tagName": {
|
|
10042
|
-
"pos":
|
|
10043
|
-
"end":
|
|
10135
|
+
"pos": 18137,
|
|
10136
|
+
"end": 18142,
|
|
10044
10137
|
"flags": 16842752,
|
|
10045
10138
|
"modifierFlagsCache": 0,
|
|
10046
10139
|
"transformFlags": 0,
|
|
@@ -10064,7 +10157,7 @@
|
|
|
10064
10157
|
"optional": false,
|
|
10065
10158
|
"returnType": "void",
|
|
10066
10159
|
"typeParameters": [],
|
|
10067
|
-
"line":
|
|
10160
|
+
"line": 588,
|
|
10068
10161
|
"deprecated": false,
|
|
10069
10162
|
"deprecationMessage": "",
|
|
10070
10163
|
"rawdescription": "\n\nSorts the data currently present in the model based on `compare()`\n\nDirection is set by `ascending` and `descending` properties of `TableHeaderItem`\nin `index`th column.\n\n",
|
|
@@ -10072,8 +10165,8 @@
|
|
|
10072
10165
|
"jsdoctags": [
|
|
10073
10166
|
{
|
|
10074
10167
|
"name": {
|
|
10075
|
-
"pos":
|
|
10076
|
-
"end":
|
|
10168
|
+
"pos": 15260,
|
|
10169
|
+
"end": 15265,
|
|
10077
10170
|
"flags": 16842752,
|
|
10078
10171
|
"modifierFlagsCache": 0,
|
|
10079
10172
|
"transformFlags": 0,
|
|
@@ -10084,8 +10177,8 @@
|
|
|
10084
10177
|
"deprecated": false,
|
|
10085
10178
|
"deprecationMessage": "",
|
|
10086
10179
|
"tagName": {
|
|
10087
|
-
"pos":
|
|
10088
|
-
"end":
|
|
10180
|
+
"pos": 15254,
|
|
10181
|
+
"end": 15259,
|
|
10089
10182
|
"flags": 16842752,
|
|
10090
10183
|
"modifierFlagsCache": 0,
|
|
10091
10184
|
"transformFlags": 0,
|
|
@@ -10135,7 +10228,7 @@
|
|
|
10135
10228
|
"name": "data",
|
|
10136
10229
|
"type": "",
|
|
10137
10230
|
"returnType": "",
|
|
10138
|
-
"line":
|
|
10231
|
+
"line": 86,
|
|
10139
10232
|
"rawdescription": "\n\nGets the full data.\n\nYou can use it to alter individual `TableItem`s but if you need to change\ntable structure, use `addRow()` and/or `addColumn()`\n",
|
|
10140
10233
|
"description": "<p>Gets the full data.</p>\n<p>You can use it to alter individual <code>TableItem</code>s but if you need to change\ntable structure, use <code>addRow()</code> and/or <code>addColumn()</code></p>\n"
|
|
10141
10234
|
}
|
|
@@ -10156,7 +10249,7 @@
|
|
|
10156
10249
|
}
|
|
10157
10250
|
],
|
|
10158
10251
|
"returnType": "void",
|
|
10159
|
-
"line":
|
|
10252
|
+
"line": 163,
|
|
10160
10253
|
"rawdescription": "\n\nManually set data length in case the data in the table doesn't\ncorrectly reflect all the data that table is to display.\n\nExample: if you have multiple pages of data that table will display\nbut you're loading one at a time.\n\nSet to `null` to reset to default behavior.\n",
|
|
10161
10254
|
"description": "<p>Manually set data length in case the data in the table doesn't\ncorrectly reflect all the data that table is to display.</p>\n<p>Example: if you have multiple pages of data that table will display\nbut you're loading one at a time.</p>\n<p>Set to <code>null</code> to reset to default behavior.</p>\n",
|
|
10162
10255
|
"jsdoctags": [
|
|
@@ -10175,7 +10268,7 @@
|
|
|
10175
10268
|
"name": "totalDataLength",
|
|
10176
10269
|
"type": "",
|
|
10177
10270
|
"returnType": "",
|
|
10178
|
-
"line":
|
|
10271
|
+
"line": 171,
|
|
10179
10272
|
"rawdescription": "\n\nTotal length of data that table has access to, or the amount manually set\n",
|
|
10180
10273
|
"description": "<p>Total length of data that table has access to, or the amount manually set</p>\n"
|
|
10181
10274
|
}
|
|
@@ -30815,7 +30908,7 @@
|
|
|
30815
30908
|
},
|
|
30816
30909
|
{
|
|
30817
30910
|
"name": "ExpansionTableStory",
|
|
30818
|
-
"id": "component-ExpansionTableStory-
|
|
30911
|
+
"id": "component-ExpansionTableStory-d20442e134f01e6097b5e23512d1691f788ea184e02b786f8cb22254ae63e7ec7a5b81956ec8f361838c63ed0c9eb64d182ad838d446aec119a04b09f74bd4d2",
|
|
30819
30912
|
"file": "src/table/stories/app-expansion-table.component.ts",
|
|
30820
30913
|
"encapsulation": [],
|
|
30821
30914
|
"entryComponents": [],
|
|
@@ -30825,7 +30918,7 @@
|
|
|
30825
30918
|
"selector": "app-expansion-table",
|
|
30826
30919
|
"styleUrls": [],
|
|
30827
30920
|
"styles": [],
|
|
30828
|
-
"template": "<ng-template #customTableItemTemplate let-data=\"data\">\n\t<a [attr.href]=\"data.link\">{{data.name}} {{data.surname}}</a>\n</ng-template>\n<ng-template #customHeaderTemplate let-data=\"data\">\n\t<i><a [attr.href]=\"data.link\">{{data.name}}</a></i>\n</ng-template>\n\n<cds-table\n\t[model]=\"model\"\n\t[size]=\"size\"\n\t[sortable]=\"sortable\"\n\t[showSelectionColumn]=\"showSelectionColumn\"\n\t[stickyHeader]=\"stickyHeader\"\n\t[skeleton]=\"skeleton\"\n\t[striped]=\"striped\"\n\t(sort)=\"customSort($event)\"\n\t(rowClick)=\"onRowClick($event)\"\n\t[isDataGrid]=\"isDataGrid\">\n</cds-table>\n\t",
|
|
30921
|
+
"template": "<ng-template #customTableItemTemplate let-data=\"data\">\n\t<a [attr.href]=\"data.link\">{{data.name}} {{data.surname}}</a>\n</ng-template>\n<ng-template #customHeaderTemplate let-data=\"data\">\n\t<i><a [attr.href]=\"data.link\">{{data.name}}</a></i>\n</ng-template>\n\n<cds-table\n\t[model]=\"model\"\n\t[size]=\"size\"\n\t[sortable]=\"sortable\"\n\t[showSelectionColumn]=\"showSelectionColumn\"\n\t[stickyHeader]=\"stickyHeader\"\n\t[skeleton]=\"skeleton\"\n\t[striped]=\"striped\"\n\t(sort)=\"customSort($event)\"\n\t(rowClick)=\"onRowClick($event)\"\n\t[isDataGrid]=\"isDataGrid\"\n\t[showExpandAllToggle]=\"showExpandAllToggle\">\n</cds-table>\n\n<br>\n\n<button cdsButton=\"primary\" size=\"sm\" (click)=\"model.expandAllRows(true)\">Expand all rows</button>\n\n<button cdsButton=\"secondary\" size=\"sm\" (click)=\"model.expandAllRows(false)\">Collapse all rows</button>\n\t",
|
|
30829
30922
|
"templateUrl": [],
|
|
30830
30923
|
"viewProviders": [],
|
|
30831
30924
|
"hostDirectives": [],
|
|
@@ -30835,7 +30928,7 @@
|
|
|
30835
30928
|
"defaultValue": "false",
|
|
30836
30929
|
"deprecated": false,
|
|
30837
30930
|
"deprecationMessage": "",
|
|
30838
|
-
"line":
|
|
30931
|
+
"line": 64,
|
|
30839
30932
|
"type": "boolean",
|
|
30840
30933
|
"decorators": []
|
|
30841
30934
|
},
|
|
@@ -30844,16 +30937,25 @@
|
|
|
30844
30937
|
"defaultValue": "new TableModel()",
|
|
30845
30938
|
"deprecated": false,
|
|
30846
30939
|
"deprecationMessage": "",
|
|
30847
|
-
"line":
|
|
30940
|
+
"line": 60,
|
|
30848
30941
|
"type": "any",
|
|
30849
30942
|
"decorators": []
|
|
30850
30943
|
},
|
|
30944
|
+
{
|
|
30945
|
+
"name": "showExpandAllToggle",
|
|
30946
|
+
"defaultValue": "false",
|
|
30947
|
+
"deprecated": false,
|
|
30948
|
+
"deprecationMessage": "",
|
|
30949
|
+
"line": 68,
|
|
30950
|
+
"type": "boolean",
|
|
30951
|
+
"decorators": []
|
|
30952
|
+
},
|
|
30851
30953
|
{
|
|
30852
30954
|
"name": "showSelectionColumn",
|
|
30853
30955
|
"defaultValue": "true",
|
|
30854
30956
|
"deprecated": false,
|
|
30855
30957
|
"deprecationMessage": "",
|
|
30856
|
-
"line":
|
|
30958
|
+
"line": 62,
|
|
30857
30959
|
"type": "boolean",
|
|
30858
30960
|
"decorators": []
|
|
30859
30961
|
},
|
|
@@ -30862,7 +30964,7 @@
|
|
|
30862
30964
|
"defaultValue": "\"md\"",
|
|
30863
30965
|
"deprecated": false,
|
|
30864
30966
|
"deprecationMessage": "",
|
|
30865
|
-
"line":
|
|
30967
|
+
"line": 61,
|
|
30866
30968
|
"type": "string",
|
|
30867
30969
|
"decorators": []
|
|
30868
30970
|
},
|
|
@@ -30871,7 +30973,7 @@
|
|
|
30871
30973
|
"defaultValue": "false",
|
|
30872
30974
|
"deprecated": false,
|
|
30873
30975
|
"deprecationMessage": "",
|
|
30874
|
-
"line":
|
|
30976
|
+
"line": 67,
|
|
30875
30977
|
"type": "boolean",
|
|
30876
30978
|
"decorators": []
|
|
30877
30979
|
},
|
|
@@ -30880,7 +30982,7 @@
|
|
|
30880
30982
|
"defaultValue": "true",
|
|
30881
30983
|
"deprecated": false,
|
|
30882
30984
|
"deprecationMessage": "",
|
|
30883
|
-
"line":
|
|
30985
|
+
"line": 65,
|
|
30884
30986
|
"type": "boolean",
|
|
30885
30987
|
"decorators": []
|
|
30886
30988
|
},
|
|
@@ -30889,7 +30991,7 @@
|
|
|
30889
30991
|
"defaultValue": "false",
|
|
30890
30992
|
"deprecated": false,
|
|
30891
30993
|
"deprecationMessage": "",
|
|
30892
|
-
"line":
|
|
30994
|
+
"line": 66,
|
|
30893
30995
|
"type": "boolean",
|
|
30894
30996
|
"decorators": []
|
|
30895
30997
|
},
|
|
@@ -30898,7 +31000,7 @@
|
|
|
30898
31000
|
"defaultValue": "true",
|
|
30899
31001
|
"deprecated": false,
|
|
30900
31002
|
"deprecationMessage": "",
|
|
30901
|
-
"line":
|
|
31003
|
+
"line": 63,
|
|
30902
31004
|
"type": "boolean",
|
|
30903
31005
|
"decorators": []
|
|
30904
31006
|
}
|
|
@@ -30919,7 +31021,7 @@
|
|
|
30919
31021
|
"optional": false,
|
|
30920
31022
|
"returnType": "void",
|
|
30921
31023
|
"typeParameters": [],
|
|
30922
|
-
"line":
|
|
31024
|
+
"line": 121,
|
|
30923
31025
|
"deprecated": false,
|
|
30924
31026
|
"deprecationMessage": "",
|
|
30925
31027
|
"jsdoctags": [
|
|
@@ -30947,7 +31049,7 @@
|
|
|
30947
31049
|
"optional": false,
|
|
30948
31050
|
"returnType": "void",
|
|
30949
31051
|
"typeParameters": [],
|
|
30950
|
-
"line":
|
|
31052
|
+
"line": 125,
|
|
30951
31053
|
"deprecated": false,
|
|
30952
31054
|
"deprecationMessage": "",
|
|
30953
31055
|
"jsdoctags": [
|
|
@@ -30981,7 +31083,7 @@
|
|
|
30981
31083
|
"optional": false,
|
|
30982
31084
|
"returnType": "void",
|
|
30983
31085
|
"typeParameters": [],
|
|
30984
|
-
"line":
|
|
31086
|
+
"line": 129,
|
|
30985
31087
|
"deprecated": false,
|
|
30986
31088
|
"deprecationMessage": "",
|
|
30987
31089
|
"jsdoctags": [
|
|
@@ -31015,7 +31117,7 @@
|
|
|
31015
31117
|
"description": "",
|
|
31016
31118
|
"rawdescription": "\n",
|
|
31017
31119
|
"type": "component",
|
|
31018
|
-
"sourceCode": "import {\n\tTemplateRef,\n\tComponent,\n\tViewChild,\n\tInput,\n\tAfterViewInit\n} from \"@angular/core\";\nimport { TableModel } from \"../table-model.class\";\nimport { TableItem } from \"../table-item.class\";\nimport { TableHeaderItem } from \"../table-header-item.class\";\n\nclass CustomHeaderItem extends TableHeaderItem {\n\t// used for custom sorting\n\tcompare(one: TableItem, two: TableItem) {\n\t\tconst stringOne = (one.data.name || one.data.surname || one.data).toLowerCase();\n\t\tconst stringTwo = (two.data.name || two.data.surname || two.data).toLowerCase();\n\n\t\tif (stringOne > stringTwo) {\n\t\t\treturn 1;\n\t\t} else if (stringOne < stringTwo) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n}\n\n@Component({\n\tselector: \"app-expansion-table\",\n\ttemplate: `\n\t\t<ng-template #customTableItemTemplate let-data=\"data\">\n\t\t\t<a [attr.href]=\"data.link\">{{data.name}} {{data.surname}}</a>\n\t\t</ng-template>\n\t\t<ng-template #customHeaderTemplate let-data=\"data\">\n\t\t\t<i><a [attr.href]=\"data.link\">{{data.name}}</a></i>\n\t\t</ng-template>\n\n\t\t<cds-table\n\t\t\t[model]=\"model\"\n\t\t\t[size]=\"size\"\n\t\t\t[sortable]=\"sortable\"\n\t\t\t[showSelectionColumn]=\"showSelectionColumn\"\n\t\t\t[stickyHeader]=\"stickyHeader\"\n\t\t\t[skeleton]=\"skeleton\"\n\t\t\t[striped]=\"striped\"\n\t\t\t(sort)=\"customSort($event)\"\n\t\t\t(rowClick)=\"onRowClick($event)\"\n\t\t\t[isDataGrid]=\"isDataGrid\">\n\t\t</cds-table>\n\t`\n})\nexport class ExpansionTableStory implements AfterViewInit {\n\t@Input() model = new TableModel();\n\t@Input() size = \"md\";\n\t@Input() showSelectionColumn = true;\n\t@Input() striped = true;\n\t@Input() isDataGrid = false;\n\t@Input() sortable = true;\n\t@Input() stickyHeader = false;\n\t@Input() skeleton = false;\n\n\t@ViewChild(\"customHeaderTemplate\")\n\tprotected customHeaderTemplate: TemplateRef<any>;\n\t@ViewChild(\"customTableItemTemplate\")\n\tprotected customTableItemTemplate: TemplateRef<any>;\n\n\tngAfterViewInit() {\n\t\tthis.model.data = [\n\t\t\t[\n\t\t\t\tnew TableItem({ data: \"Name 1\", expandedData: \"No template\" }),\n\t\t\t\tnew TableItem({ data: { name: \"Lessy\", link: \"#\" }, template: this.customTableItemTemplate })\n\t\t\t],\n\t\t\t[\n\t\t\t\tnew TableItem({\n\t\t\t\t\tdata: \"Name 3\",\n\t\t\t\t\texpandedData: { name: \"In\", surname: \"Template\" },\n\t\t\t\t\texpandedTemplate: this.customTableItemTemplate\n\t\t\t\t}),\n\t\t\t\tnew TableItem({ data: \"swer\" })\n\t\t\t],\n\t\t\t[\n\t\t\t\tnew TableItem({\n\t\t\t\t\tdata: \"Name 3.1\",\n\t\t\t\t\texpandedData: [\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tnew TableItem({ data: \"More names\", expandedData: \"No template\" }),\n\t\t\t\t\t\t\tnew TableItem({ data: { name: \"Morey\", link: \"#\" }, template: this.customTableItemTemplate })\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tnew TableItem({ data: \"Core names\", expandedData: \"No template\" }),\n\t\t\t\t\t\t\tnew TableItem({ data: { name: \"Corey\", link: \"#\" }, template: this.customTableItemTemplate })\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\t\t\t\t\texpandAsTable: true\n\t\t\t\t}),\n\t\t\t\tnew TableItem({ data: \"swer\" })\n\t\t\t],\n\t\t\t[new TableItem({ data: \"Name 2\" }), new TableItem({ data: { name: \"Alice\", surname: \"Bob\" }, template: this.customTableItemTemplate })],\n\t\t\t[new TableItem({ data: \"Name 4\" }), new TableItem({ data: \"twer\" })],\n\t\t\t[new TableItem({ data: \"Name 5\" }), new TableItem({data: \"twer\"})],\n\t\t\t[new TableItem({ data: \"Name 6\" }), new TableItem({data: \"twer\"})],\n\t\t\t[new TableItem({ data: \"Name 7\" }), new TableItem({data: \"twer\"})]\n\t\t];\n\t\tthis.model.header = [\n\t\t\tnew TableHeaderItem({ data: \"Very long title indeed\" }),\n\t\t\tnew CustomHeaderItem({\n\t\t\t\tdata: { name: \"Custom header\", link: \"#\" },\n\t\t\t\ttemplate: this.customHeaderTemplate\n\t\t\t})\n\t\t];\n\t}\n\n\tcustomSort(index: number) {\n\t\tthis.sort(this.model, index);\n\t}\n\n\tonRowClick(index: number) {\n\t\tconsole.log(\"Row item selected:\", index);\n\t}\n\n\tsort(model, index: number) {\n\t\tif (model.header[index].sorted) {\n\t\t\t// if already sorted flip sorting direction\n\t\t\tmodel.header[index].ascending = model.header[index].descending;\n\t\t}\n\t\tmodel.sort(index);\n\t}\n}\n",
|
|
31120
|
+
"sourceCode": "import {\n\tTemplateRef,\n\tComponent,\n\tViewChild,\n\tInput,\n\tAfterViewInit\n} from \"@angular/core\";\nimport { TableModel } from \"../table-model.class\";\nimport { TableItem } from \"../table-item.class\";\nimport { TableHeaderItem } from \"../table-header-item.class\";\n\nclass CustomHeaderItem extends TableHeaderItem {\n\t// used for custom sorting\n\tcompare(one: TableItem, two: TableItem) {\n\t\tconst stringOne = (one.data.name || one.data.surname || one.data).toLowerCase();\n\t\tconst stringTwo = (two.data.name || two.data.surname || two.data).toLowerCase();\n\n\t\tif (stringOne > stringTwo) {\n\t\t\treturn 1;\n\t\t} else if (stringOne < stringTwo) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n}\n\n@Component({\n\tselector: \"app-expansion-table\",\n\ttemplate: `\n\t\t<ng-template #customTableItemTemplate let-data=\"data\">\n\t\t\t<a [attr.href]=\"data.link\">{{data.name}} {{data.surname}}</a>\n\t\t</ng-template>\n\t\t<ng-template #customHeaderTemplate let-data=\"data\">\n\t\t\t<i><a [attr.href]=\"data.link\">{{data.name}}</a></i>\n\t\t</ng-template>\n\n\t\t<cds-table\n\t\t\t[model]=\"model\"\n\t\t\t[size]=\"size\"\n\t\t\t[sortable]=\"sortable\"\n\t\t\t[showSelectionColumn]=\"showSelectionColumn\"\n\t\t\t[stickyHeader]=\"stickyHeader\"\n\t\t\t[skeleton]=\"skeleton\"\n\t\t\t[striped]=\"striped\"\n\t\t\t(sort)=\"customSort($event)\"\n\t\t\t(rowClick)=\"onRowClick($event)\"\n\t\t\t[isDataGrid]=\"isDataGrid\"\n\t\t\t[showExpandAllToggle]=\"showExpandAllToggle\">\n\t\t</cds-table>\n\n\t\t<br>\n\n\t\t<button cdsButton=\"primary\" size=\"sm\" (click)=\"model.expandAllRows(true)\">Expand all rows</button>\n\n\t\t<button cdsButton=\"secondary\" size=\"sm\" (click)=\"model.expandAllRows(false)\">Collapse all rows</button>\n\t`\n})\nexport class ExpansionTableStory implements AfterViewInit {\n\t@Input() model = new TableModel();\n\t@Input() size = \"md\";\n\t@Input() showSelectionColumn = true;\n\t@Input() striped = true;\n\t@Input() isDataGrid = false;\n\t@Input() sortable = true;\n\t@Input() stickyHeader = false;\n\t@Input() skeleton = false;\n\t@Input() showExpandAllToggle = false;\n\n\t@ViewChild(\"customHeaderTemplate\")\n\tprotected customHeaderTemplate: TemplateRef<any>;\n\t@ViewChild(\"customTableItemTemplate\")\n\tprotected customTableItemTemplate: TemplateRef<any>;\n\n\tngAfterViewInit() {\n\t\tthis.model.data = [\n\t\t\t[\n\t\t\t\tnew TableItem({ data: \"Name 1\", expandedData: \"No template\" }),\n\t\t\t\tnew TableItem({ data: { name: \"Lessy\", link: \"#\" }, template: this.customTableItemTemplate })\n\t\t\t],\n\t\t\t[\n\t\t\t\tnew TableItem({\n\t\t\t\t\tdata: \"Name 3\",\n\t\t\t\t\texpandedData: { name: \"In\", surname: \"Template\" },\n\t\t\t\t\texpandedTemplate: this.customTableItemTemplate\n\t\t\t\t}),\n\t\t\t\tnew TableItem({ data: \"swer\" })\n\t\t\t],\n\t\t\t[\n\t\t\t\tnew TableItem({\n\t\t\t\t\tdata: \"Name 3.1\",\n\t\t\t\t\texpandedData: [\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tnew TableItem({ data: \"More names\", expandedData: \"No template\" }),\n\t\t\t\t\t\t\tnew TableItem({ data: { name: \"Morey\", link: \"#\" }, template: this.customTableItemTemplate })\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tnew TableItem({ data: \"Core names\", expandedData: \"No template\" }),\n\t\t\t\t\t\t\tnew TableItem({ data: { name: \"Corey\", link: \"#\" }, template: this.customTableItemTemplate })\n\t\t\t\t\t\t]\n\t\t\t\t\t],\n\t\t\t\t\texpandAsTable: true\n\t\t\t\t}),\n\t\t\t\tnew TableItem({ data: \"swer\" })\n\t\t\t],\n\t\t\t[new TableItem({ data: \"Name 2\" }), new TableItem({ data: { name: \"Alice\", surname: \"Bob\" }, template: this.customTableItemTemplate })],\n\t\t\t[new TableItem({ data: \"Name 4\" }), new TableItem({ data: \"twer\" })],\n\t\t\t[new TableItem({ data: \"Name 5\" }), new TableItem({data: \"twer\"})],\n\t\t\t[new TableItem({ data: \"Name 6\" }), new TableItem({data: \"twer\"})],\n\t\t\t[new TableItem({ data: \"Name 7\" }), new TableItem({data: \"twer\"})]\n\t\t];\n\t\tthis.model.header = [\n\t\t\tnew TableHeaderItem({ data: \"Very long title indeed\" }),\n\t\t\tnew CustomHeaderItem({\n\t\t\t\tdata: { name: \"Custom header\", link: \"#\" },\n\t\t\t\ttemplate: this.customHeaderTemplate\n\t\t\t})\n\t\t];\n\t}\n\n\tcustomSort(index: number) {\n\t\tthis.sort(this.model, index);\n\t}\n\n\tonRowClick(index: number) {\n\t\tconsole.log(\"Row item selected:\", index);\n\t}\n\n\tsort(model, index: number) {\n\t\tif (model.header[index].sorted) {\n\t\t\t// if already sorted flip sorting direction\n\t\t\tmodel.header[index].ascending = model.header[index].descending;\n\t\t}\n\t\tmodel.sort(index);\n\t}\n}\n",
|
|
31019
31121
|
"assetsDirs": [],
|
|
31020
31122
|
"styleUrlsData": "",
|
|
31021
31123
|
"stylesData": "",
|
|
@@ -38068,7 +38170,7 @@
|
|
|
38068
38170
|
},
|
|
38069
38171
|
{
|
|
38070
38172
|
"name": "NumberComponent",
|
|
38071
|
-
"id": "component-NumberComponent-
|
|
38173
|
+
"id": "component-NumberComponent-9f96963038fb60119a19b74c9c9868abb21dc983cbe9ae791c7f9916a4b113d526ffec3cb0816822dbea8d431361e3ad4bf0b6c14c97c4757a47853940dbca6b",
|
|
38072
38174
|
"file": "src/number-input/number.component.ts",
|
|
38073
38175
|
"encapsulation": [],
|
|
38074
38176
|
"entryComponents": [],
|
|
@@ -38083,7 +38185,7 @@
|
|
|
38083
38185
|
"selector": "cds-number, ibm-number",
|
|
38084
38186
|
"styleUrls": [],
|
|
38085
38187
|
"styles": [],
|
|
38086
|
-
"template": "<div\n\tdata-numberinput\n\t[attr.data-invalid]=\"(invalid ? true : null)\"\n\tclass=\"cds--number\"\n\t[ngClass]=\"{\n\t\t'cds--number--light': theme === 'light',\n\t\t'cds--number--nolabel': !label,\n\t\t'cds--number--helpertext': helperText,\n\t\t'cds--skeleton' : skeleton,\n\t\t'cds--number--sm': size === 'sm',\n\t\t'cds--number--md': size === 'md',\n\t\t'cds--number--lg': size === 'lg'\n\t}\">\n\t<label
|
|
38188
|
+
"template": "<label *ngIf=\"skeleton && label\" class=\"cds--label cds--skeleton\"></label>\n<div\n\tdata-numberinput\n\t[attr.data-invalid]=\"(invalid ? true : null)\"\n\tclass=\"cds--number\"\n\t[ngClass]=\"{\n\t\t'cds--number--light': theme === 'light',\n\t\t'cds--number--nolabel': !label,\n\t\t'cds--number--helpertext': helperText,\n\t\t'cds--skeleton' : skeleton,\n\t\t'cds--number--sm': size === 'sm',\n\t\t'cds--number--md': size === 'md',\n\t\t'cds--number--lg': size === 'lg'\n\t}\">\n\t<label\n\t\t*ngIf=\"!skeleton && label\"\n\t\t[for]=\"id\"\n\t\tclass=\"cds--label\"\n\t\t[ngClass]=\"{'cds--label--disabled': disabled}\">\n\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t</label>\n\t<div\n\t\tclass=\"cds--number__input-wrapper\"\n\t\t[ngClass]=\"{\n\t\t\t'cds--number__input-wrapper--warning': warn\n\t\t}\">\n\t\t<input\n\t\t\ttype=\"number\"\n\t\t\t[id]=\"id\"\n\t\t\t[value]=\"value\"\n\t\t\t[attr.min]=\"min\"\n\t\t\t[attr.max]=\"max\"\n\t\t\t[attr.step]=\"step\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[required]=\"required\"\n\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t[attr.data-invalid]=\"invalid ? invalid : null\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t(focus)=\"fluid ? handleFocus($event): null\"\n\t\t\t(blur)=\"fluid ? handleFocus($event): null\"\n\t\t\t(change)=\"onNumberInputChange($event)\"/>\n\t\t<svg\n\t\t\t*ngIf=\"!skeleton && invalid\"\n\t\t\tcdsIcon=\"warning--filled\"\n\t\t\tsize=\"16\"\n\t\t\tclass=\"cds--number__invalid\">\n\t\t</svg>\n\t\t<svg\n\t\t\t*ngIf=\"!skeleton && !invalid && warn\"\n\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\tsize=\"16\"\n\t\t\tclass=\"cds--number__invalid cds--number__invalid--warning\">\n\t\t</svg>\n\t\t<div *ngIf=\"!skeleton\" class=\"cds--number__controls\">\n\t\t\t<button\n\t\t\t\tclass=\"cds--number__control-btn down-icon\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t[attr.disabled]=\"disabled ? true : null\"\n\t\t\t\taria-live=\"polite\"\n\t\t\t\taria-atomic=\"true\"\n\t\t\t\t[attr.aria-label]=\"getDecrementLabel() | async\"\n\t\t\t\t(click)=\"onDecrement()\">\n\t\t\t\t<svg cdsIcon=\"subtract\" size=\"16\"></svg>\n\t\t\t</button>\n\t\t\t<div class=\"cds--number__rule-divider\"></div>\n\t\t\t<button\n\t\t\t\tclass=\"cds--number__control-btn up-icon\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t[attr.disabled]=\"disabled ? true : null\"\n\t\t\t\taria-live=\"polite\"\n\t\t\t\taria-atomic=\"true\"\n\t\t\t\t[attr.aria-label]=\"getIncrementLabel() | async\"\n\t\t\t\t(click)=\"onIncrement()\">\n\t\t\t\t<svg cdsIcon=\"add\" size=\"16\"></svg>\n\t\t\t</button>\n\t\t\t<div class=\"cds--number__rule-divider\"></div>\n\t\t</div>\n\t</div>\n\t<hr *ngIf=\"fluid\" class=\"cds--number-input__divider\" />\n\t<div\n\t\t*ngIf=\"helperText && !invalid && !warn && !fluid\"\n\t\tclass=\"cds--form__helper-text\"\n\t\t[ngClass]=\"{\n\t\t\t'cds--form__helper-text--disabled': disabled\n\t\t}\">\n\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t</div>\n\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t</div>\n\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t</div>\n</div>\n\t",
|
|
38087
38189
|
"templateUrl": [],
|
|
38088
38190
|
"viewProviders": [],
|
|
38089
38191
|
"hostDirectives": [],
|
|
@@ -38094,7 +38196,7 @@
|
|
|
38094
38196
|
"deprecationMessage": "",
|
|
38095
38197
|
"rawdescription": "\n\nSets the arialabel for input\n",
|
|
38096
38198
|
"description": "<p>Sets the arialabel for input</p>\n",
|
|
38097
|
-
"line":
|
|
38199
|
+
"line": 247,
|
|
38098
38200
|
"type": "string",
|
|
38099
38201
|
"decorators": []
|
|
38100
38202
|
},
|
|
@@ -38102,7 +38204,7 @@
|
|
|
38102
38204
|
"name": "decrementLabel",
|
|
38103
38205
|
"deprecated": false,
|
|
38104
38206
|
"deprecationMessage": "",
|
|
38105
|
-
"line":
|
|
38207
|
+
"line": 254,
|
|
38106
38208
|
"type": "string | Observable",
|
|
38107
38209
|
"decorators": []
|
|
38108
38210
|
},
|
|
@@ -38113,7 +38215,18 @@
|
|
|
38113
38215
|
"deprecationMessage": "",
|
|
38114
38216
|
"rawdescription": "\n\nSet to `true` for a disabled number input.\n",
|
|
38115
38217
|
"description": "<p>Set to <code>true</code> for a disabled number input.</p>\n",
|
|
38116
|
-
"line":
|
|
38218
|
+
"line": 169,
|
|
38219
|
+
"type": "boolean",
|
|
38220
|
+
"decorators": []
|
|
38221
|
+
},
|
|
38222
|
+
{
|
|
38223
|
+
"name": "fluid",
|
|
38224
|
+
"defaultValue": "false",
|
|
38225
|
+
"deprecated": false,
|
|
38226
|
+
"deprecationMessage": "",
|
|
38227
|
+
"rawdescription": "\n\nExperimental: enable fluid state\n",
|
|
38228
|
+
"description": "<p>Experimental: enable fluid state</p>\n",
|
|
38229
|
+
"line": 274,
|
|
38117
38230
|
"type": "boolean",
|
|
38118
38231
|
"decorators": []
|
|
38119
38232
|
},
|
|
@@ -38123,7 +38236,7 @@
|
|
|
38123
38236
|
"deprecationMessage": "",
|
|
38124
38237
|
"rawdescription": "\n\nSets the optional helper text.\n",
|
|
38125
38238
|
"description": "<p>Sets the optional helper text.</p>\n",
|
|
38126
|
-
"line":
|
|
38239
|
+
"line": 223,
|
|
38127
38240
|
"type": "string | TemplateRef<any>",
|
|
38128
38241
|
"decorators": []
|
|
38129
38242
|
},
|
|
@@ -38134,7 +38247,7 @@
|
|
|
38134
38247
|
"deprecationMessage": "",
|
|
38135
38248
|
"rawdescription": "\n\nThe unique id for the number component.\n",
|
|
38136
38249
|
"description": "<p>The unique id for the number component.</p>\n",
|
|
38137
|
-
"line":
|
|
38250
|
+
"line": 181,
|
|
38138
38251
|
"type": "string",
|
|
38139
38252
|
"decorators": []
|
|
38140
38253
|
},
|
|
@@ -38142,7 +38255,7 @@
|
|
|
38142
38255
|
"name": "incrementLabel",
|
|
38143
38256
|
"deprecated": false,
|
|
38144
38257
|
"deprecationMessage": "",
|
|
38145
|
-
"line":
|
|
38258
|
+
"line": 263,
|
|
38146
38259
|
"type": "string | Observable",
|
|
38147
38260
|
"decorators": []
|
|
38148
38261
|
},
|
|
@@ -38153,7 +38266,7 @@
|
|
|
38153
38266
|
"deprecationMessage": "",
|
|
38154
38267
|
"rawdescription": "\n\nSet to `true` for an invalid number component.\n",
|
|
38155
38268
|
"description": "<p>Set to <code>true</code> for an invalid number component.</p>\n",
|
|
38156
|
-
"line":
|
|
38269
|
+
"line": 177,
|
|
38157
38270
|
"type": "boolean",
|
|
38158
38271
|
"decorators": []
|
|
38159
38272
|
},
|
|
@@ -38163,7 +38276,7 @@
|
|
|
38163
38276
|
"deprecationMessage": "",
|
|
38164
38277
|
"rawdescription": "\n\nSets the invalid text.\n",
|
|
38165
38278
|
"description": "<p>Sets the invalid text.</p>\n",
|
|
38166
|
-
"line":
|
|
38279
|
+
"line": 227,
|
|
38167
38280
|
"type": "string | TemplateRef<any>",
|
|
38168
38281
|
"decorators": []
|
|
38169
38282
|
},
|
|
@@ -38173,7 +38286,7 @@
|
|
|
38173
38286
|
"deprecationMessage": "",
|
|
38174
38287
|
"rawdescription": "\n\nSets the text inside the `label` tag.\n",
|
|
38175
38288
|
"description": "<p>Sets the text inside the <code>label</code> tag.</p>\n",
|
|
38176
|
-
"line":
|
|
38289
|
+
"line": 219,
|
|
38177
38290
|
"type": "string | TemplateRef<any>",
|
|
38178
38291
|
"decorators": []
|
|
38179
38292
|
},
|
|
@@ -38184,7 +38297,7 @@
|
|
|
38184
38297
|
"deprecationMessage": "",
|
|
38185
38298
|
"rawdescription": "\n\nSets the max attribute on the `input` element.\n",
|
|
38186
38299
|
"description": "<p>Sets the max attribute on the <code>input</code> element.</p>\n",
|
|
38187
|
-
"line":
|
|
38300
|
+
"line": 215,
|
|
38188
38301
|
"type": "any",
|
|
38189
38302
|
"decorators": []
|
|
38190
38303
|
},
|
|
@@ -38195,7 +38308,7 @@
|
|
|
38195
38308
|
"deprecationMessage": "",
|
|
38196
38309
|
"rawdescription": "\n\nSets the min attribute on the `input` element.\n",
|
|
38197
38310
|
"description": "<p>Sets the min attribute on the <code>input</code> element.</p>\n",
|
|
38198
|
-
"line":
|
|
38311
|
+
"line": 211,
|
|
38199
38312
|
"type": "any",
|
|
38200
38313
|
"decorators": []
|
|
38201
38314
|
},
|
|
@@ -38206,7 +38319,7 @@
|
|
|
38206
38319
|
"deprecationMessage": "",
|
|
38207
38320
|
"rawdescription": "\n\nSets the placeholder attribute on the `input` element.\n",
|
|
38208
38321
|
"description": "<p>Sets the placeholder attribute on the <code>input</code> element.</p>\n",
|
|
38209
|
-
"line":
|
|
38322
|
+
"line": 185,
|
|
38210
38323
|
"type": "string",
|
|
38211
38324
|
"decorators": []
|
|
38212
38325
|
},
|
|
@@ -38216,7 +38329,7 @@
|
|
|
38216
38329
|
"deprecationMessage": "",
|
|
38217
38330
|
"rawdescription": "\n\nIf `step` is a decimal, we may want precision to be set to go around floating point precision.\n",
|
|
38218
38331
|
"description": "<p>If <code>step</code> is a decimal, we may want precision to be set to go around floating point precision.</p>\n",
|
|
38219
|
-
"line":
|
|
38332
|
+
"line": 235,
|
|
38220
38333
|
"type": "number",
|
|
38221
38334
|
"decorators": []
|
|
38222
38335
|
},
|
|
@@ -38227,7 +38340,7 @@
|
|
|
38227
38340
|
"deprecationMessage": "",
|
|
38228
38341
|
"rawdescription": "\n\nSet to `true` for readonly state.\n",
|
|
38229
38342
|
"description": "<p>Set to <code>true</code> for readonly state.</p>\n",
|
|
38230
|
-
"line":
|
|
38343
|
+
"line": 160,
|
|
38231
38344
|
"type": "boolean",
|
|
38232
38345
|
"decorators": []
|
|
38233
38346
|
},
|
|
@@ -38237,7 +38350,7 @@
|
|
|
38237
38350
|
"deprecationMessage": "",
|
|
38238
38351
|
"rawdescription": "\n\nReflects the required attribute of the `input` element.\n",
|
|
38239
38352
|
"description": "<p>Reflects the required attribute of the <code>input</code> element.</p>\n",
|
|
38240
|
-
"line":
|
|
38353
|
+
"line": 193,
|
|
38241
38354
|
"type": "boolean",
|
|
38242
38355
|
"decorators": []
|
|
38243
38356
|
},
|
|
@@ -38248,7 +38361,7 @@
|
|
|
38248
38361
|
"deprecationMessage": "",
|
|
38249
38362
|
"rawdescription": "\n\nNumber input field render size\n",
|
|
38250
38363
|
"description": "<p>Number input field render size</p>\n",
|
|
38251
|
-
"line":
|
|
38364
|
+
"line": 189,
|
|
38252
38365
|
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
38253
38366
|
"decorators": []
|
|
38254
38367
|
},
|
|
@@ -38259,7 +38372,7 @@
|
|
|
38259
38372
|
"deprecationMessage": "",
|
|
38260
38373
|
"rawdescription": "\n\nSet to `true` for a loading number component.\n",
|
|
38261
38374
|
"description": "<p>Set to <code>true</code> for a loading number component.</p>\n",
|
|
38262
|
-
"line":
|
|
38375
|
+
"line": 173,
|
|
38263
38376
|
"type": "boolean",
|
|
38264
38377
|
"decorators": []
|
|
38265
38378
|
},
|
|
@@ -38270,7 +38383,7 @@
|
|
|
38270
38383
|
"deprecationMessage": "",
|
|
38271
38384
|
"rawdescription": "\n\nSets the amount the number controls increment and decrement by.\n",
|
|
38272
38385
|
"description": "<p>Sets the amount the number controls increment and decrement by.</p>\n",
|
|
38273
|
-
"line":
|
|
38386
|
+
"line": 231,
|
|
38274
38387
|
"type": "number",
|
|
38275
38388
|
"decorators": []
|
|
38276
38389
|
},
|
|
@@ -38281,15 +38394,15 @@
|
|
|
38281
38394
|
"deprecationMessage": "since v5 - Use `cdsLayer` directive instead\n`light` or `dark` number input theme.",
|
|
38282
38395
|
"jsdoctags": [
|
|
38283
38396
|
{
|
|
38284
|
-
"pos":
|
|
38285
|
-
"end":
|
|
38397
|
+
"pos": 4737,
|
|
38398
|
+
"end": 4837,
|
|
38286
38399
|
"flags": 16842752,
|
|
38287
38400
|
"modifierFlagsCache": 0,
|
|
38288
38401
|
"transformFlags": 0,
|
|
38289
38402
|
"kind": 338,
|
|
38290
38403
|
"tagName": {
|
|
38291
|
-
"pos":
|
|
38292
|
-
"end":
|
|
38404
|
+
"pos": 4738,
|
|
38405
|
+
"end": 4748,
|
|
38293
38406
|
"flags": 16842752,
|
|
38294
38407
|
"modifierFlagsCache": 0,
|
|
38295
38408
|
"transformFlags": 0,
|
|
@@ -38299,7 +38412,7 @@
|
|
|
38299
38412
|
"comment": "<p>since v5 - Use <code>cdsLayer</code> directive instead\n<code>light</code> or <code>dark</code> number input theme.</p>\n"
|
|
38300
38413
|
}
|
|
38301
38414
|
],
|
|
38302
|
-
"line":
|
|
38415
|
+
"line": 165,
|
|
38303
38416
|
"type": "\"light\" | \"dark\"",
|
|
38304
38417
|
"decorators": []
|
|
38305
38418
|
},
|
|
@@ -38309,7 +38422,7 @@
|
|
|
38309
38422
|
"deprecationMessage": "",
|
|
38310
38423
|
"rawdescription": "\n\nSets the value attribute on the `input` element.\n",
|
|
38311
38424
|
"description": "<p>Sets the value attribute on the <code>input</code> element.</p>\n",
|
|
38312
|
-
"line":
|
|
38425
|
+
"line": 197,
|
|
38313
38426
|
"type": "any",
|
|
38314
38427
|
"decorators": []
|
|
38315
38428
|
},
|
|
@@ -38320,7 +38433,7 @@
|
|
|
38320
38433
|
"deprecationMessage": "",
|
|
38321
38434
|
"rawdescription": "\n\nSet to `true` to show a warning (contents set by warningText)\n",
|
|
38322
38435
|
"description": "<p>Set to <code>true</code> to show a warning (contents set by warningText)</p>\n",
|
|
38323
|
-
"line":
|
|
38436
|
+
"line": 239,
|
|
38324
38437
|
"type": "boolean",
|
|
38325
38438
|
"decorators": []
|
|
38326
38439
|
},
|
|
@@ -38330,7 +38443,7 @@
|
|
|
38330
38443
|
"deprecationMessage": "",
|
|
38331
38444
|
"rawdescription": "\n\nSets the warning text\n",
|
|
38332
38445
|
"description": "<p>Sets the warning text</p>\n",
|
|
38333
|
-
"line":
|
|
38446
|
+
"line": 243,
|
|
38334
38447
|
"type": "string | TemplateRef<any>",
|
|
38335
38448
|
"decorators": []
|
|
38336
38449
|
}
|
|
@@ -38343,7 +38456,7 @@
|
|
|
38343
38456
|
"deprecationMessage": "",
|
|
38344
38457
|
"rawdescription": "\n\nEmits event notifying other classes when a change in state occurs in the input.\n",
|
|
38345
38458
|
"description": "<p>Emits event notifying other classes when a change in state occurs in the input.</p>\n",
|
|
38346
|
-
"line":
|
|
38459
|
+
"line": 251,
|
|
38347
38460
|
"type": "EventEmitter"
|
|
38348
38461
|
}
|
|
38349
38462
|
],
|
|
@@ -38356,7 +38469,7 @@
|
|
|
38356
38469
|
"type": "",
|
|
38357
38470
|
"optional": false,
|
|
38358
38471
|
"description": "",
|
|
38359
|
-
"line":
|
|
38472
|
+
"line": 155,
|
|
38360
38473
|
"decorators": [
|
|
38361
38474
|
{
|
|
38362
38475
|
"name": "HostBinding",
|
|
@@ -38375,7 +38488,7 @@
|
|
|
38375
38488
|
"type": "number",
|
|
38376
38489
|
"optional": false,
|
|
38377
38490
|
"description": "<p>Variable used for creating unique ids for number input components.</p>\n",
|
|
38378
|
-
"line":
|
|
38491
|
+
"line": 153,
|
|
38379
38492
|
"rawdescription": "\n\nVariable used for creating unique ids for number input components.\n",
|
|
38380
38493
|
"modifierKind": [
|
|
38381
38494
|
126
|
|
@@ -38389,7 +38502,7 @@
|
|
|
38389
38502
|
"type": "function",
|
|
38390
38503
|
"optional": false,
|
|
38391
38504
|
"description": "<p>Called when number input is blurred. Needed to properly implement <code>ControlValueAccessor</code>.</p>\n",
|
|
38392
|
-
"line":
|
|
38505
|
+
"line": 344,
|
|
38393
38506
|
"rawdescription": "\n\nCalled when number input is blurred. Needed to properly implement `ControlValueAccessor`.\n"
|
|
38394
38507
|
},
|
|
38395
38508
|
{
|
|
@@ -38400,7 +38513,7 @@
|
|
|
38400
38513
|
"type": "",
|
|
38401
38514
|
"optional": false,
|
|
38402
38515
|
"description": "<p>Method set in <code>registerOnChange</code> to propagate changes back to the form.</p>\n",
|
|
38403
|
-
"line":
|
|
38516
|
+
"line": 349,
|
|
38404
38517
|
"rawdescription": "\n\nMethod set in `registerOnChange` to propagate changes back to the form.\n"
|
|
38405
38518
|
}
|
|
38406
38519
|
],
|
|
@@ -38411,7 +38524,7 @@
|
|
|
38411
38524
|
"optional": false,
|
|
38412
38525
|
"returnType": "void",
|
|
38413
38526
|
"typeParameters": [],
|
|
38414
|
-
"line":
|
|
38527
|
+
"line": 384,
|
|
38415
38528
|
"deprecated": false,
|
|
38416
38529
|
"deprecationMessage": "",
|
|
38417
38530
|
"rawdescription": "\n\nCreates a class of `NumberChange` to emit the change in the `Number`.\n",
|
|
@@ -38423,7 +38536,7 @@
|
|
|
38423
38536
|
"optional": false,
|
|
38424
38537
|
"returnType": "void",
|
|
38425
38538
|
"typeParameters": [],
|
|
38426
|
-
"line":
|
|
38539
|
+
"line": 330,
|
|
38427
38540
|
"deprecated": false,
|
|
38428
38541
|
"deprecationMessage": "",
|
|
38429
38542
|
"decorators": [
|
|
@@ -38442,7 +38555,7 @@
|
|
|
38442
38555
|
"optional": false,
|
|
38443
38556
|
"returnType": "Observable<string>",
|
|
38444
38557
|
"typeParameters": [],
|
|
38445
|
-
"line":
|
|
38558
|
+
"line": 373,
|
|
38446
38559
|
"deprecated": false,
|
|
38447
38560
|
"deprecationMessage": ""
|
|
38448
38561
|
},
|
|
@@ -38452,10 +38565,38 @@
|
|
|
38452
38565
|
"optional": false,
|
|
38453
38566
|
"returnType": "Observable<string>",
|
|
38454
38567
|
"typeParameters": [],
|
|
38455
|
-
"line":
|
|
38568
|
+
"line": 377,
|
|
38456
38569
|
"deprecated": false,
|
|
38457
38570
|
"deprecationMessage": ""
|
|
38458
38571
|
},
|
|
38572
|
+
{
|
|
38573
|
+
"name": "handleFocus",
|
|
38574
|
+
"args": [
|
|
38575
|
+
{
|
|
38576
|
+
"name": "event",
|
|
38577
|
+
"type": "FocusEvent",
|
|
38578
|
+
"deprecated": false,
|
|
38579
|
+
"deprecationMessage": ""
|
|
38580
|
+
}
|
|
38581
|
+
],
|
|
38582
|
+
"optional": false,
|
|
38583
|
+
"returnType": "void",
|
|
38584
|
+
"typeParameters": [],
|
|
38585
|
+
"line": 401,
|
|
38586
|
+
"deprecated": false,
|
|
38587
|
+
"deprecationMessage": "",
|
|
38588
|
+
"jsdoctags": [
|
|
38589
|
+
{
|
|
38590
|
+
"name": "event",
|
|
38591
|
+
"type": "FocusEvent",
|
|
38592
|
+
"deprecated": false,
|
|
38593
|
+
"deprecationMessage": "",
|
|
38594
|
+
"tagName": {
|
|
38595
|
+
"text": "param"
|
|
38596
|
+
}
|
|
38597
|
+
}
|
|
38598
|
+
]
|
|
38599
|
+
},
|
|
38459
38600
|
{
|
|
38460
38601
|
"name": "isTemplate",
|
|
38461
38602
|
"args": [
|
|
@@ -38469,7 +38610,7 @@
|
|
|
38469
38610
|
"optional": false,
|
|
38470
38611
|
"returnType": "boolean",
|
|
38471
38612
|
"typeParameters": [],
|
|
38472
|
-
"line":
|
|
38613
|
+
"line": 397,
|
|
38473
38614
|
"deprecated": false,
|
|
38474
38615
|
"deprecationMessage": "",
|
|
38475
38616
|
"modifierKind": [
|
|
@@ -38493,7 +38634,7 @@
|
|
|
38493
38634
|
"optional": false,
|
|
38494
38635
|
"returnType": "void",
|
|
38495
38636
|
"typeParameters": [],
|
|
38496
|
-
"line":
|
|
38637
|
+
"line": 365,
|
|
38497
38638
|
"deprecated": false,
|
|
38498
38639
|
"deprecationMessage": "",
|
|
38499
38640
|
"rawdescription": "\n\nSubtracts `step` to the current `value`.\n",
|
|
@@ -38505,7 +38646,7 @@
|
|
|
38505
38646
|
"optional": false,
|
|
38506
38647
|
"returnType": "void",
|
|
38507
38648
|
"typeParameters": [],
|
|
38508
|
-
"line":
|
|
38649
|
+
"line": 354,
|
|
38509
38650
|
"deprecated": false,
|
|
38510
38651
|
"deprecationMessage": "",
|
|
38511
38652
|
"rawdescription": "\n\nAdds `step` to the current `value`.\n",
|
|
@@ -38524,7 +38665,7 @@
|
|
|
38524
38665
|
"optional": false,
|
|
38525
38666
|
"returnType": "void",
|
|
38526
38667
|
"typeParameters": [],
|
|
38527
|
-
"line":
|
|
38668
|
+
"line": 392,
|
|
38528
38669
|
"deprecated": false,
|
|
38529
38670
|
"deprecationMessage": "",
|
|
38530
38671
|
"jsdoctags": [
|
|
@@ -38552,7 +38693,7 @@
|
|
|
38552
38693
|
"optional": false,
|
|
38553
38694
|
"returnType": "void",
|
|
38554
38695
|
"typeParameters": [],
|
|
38555
|
-
"line":
|
|
38696
|
+
"line": 317,
|
|
38556
38697
|
"deprecated": false,
|
|
38557
38698
|
"deprecationMessage": "",
|
|
38558
38699
|
"rawdescription": "\n\nSets a method in order to propagate changes back to the form.\n",
|
|
@@ -38585,7 +38726,7 @@
|
|
|
38585
38726
|
"optional": false,
|
|
38586
38727
|
"returnType": "void",
|
|
38587
38728
|
"typeParameters": [],
|
|
38588
|
-
"line":
|
|
38729
|
+
"line": 325,
|
|
38589
38730
|
"deprecated": false,
|
|
38590
38731
|
"deprecationMessage": "",
|
|
38591
38732
|
"rawdescription": "\n\nRegisters a callback to be triggered when the control has been touched.\n",
|
|
@@ -38596,8 +38737,8 @@
|
|
|
38596
38737
|
"jsdoctags": [
|
|
38597
38738
|
{
|
|
38598
38739
|
"name": {
|
|
38599
|
-
"pos":
|
|
38600
|
-
"end":
|
|
38740
|
+
"pos": 8554,
|
|
38741
|
+
"end": 8556,
|
|
38601
38742
|
"flags": 16842752,
|
|
38602
38743
|
"modifierFlagsCache": 0,
|
|
38603
38744
|
"transformFlags": 0,
|
|
@@ -38608,8 +38749,8 @@
|
|
|
38608
38749
|
"deprecated": false,
|
|
38609
38750
|
"deprecationMessage": "",
|
|
38610
38751
|
"tagName": {
|
|
38611
|
-
"pos":
|
|
38612
|
-
"end":
|
|
38752
|
+
"pos": 8548,
|
|
38753
|
+
"end": 8553,
|
|
38613
38754
|
"flags": 16842752,
|
|
38614
38755
|
"modifierFlagsCache": 0,
|
|
38615
38756
|
"transformFlags": 0,
|
|
@@ -38633,7 +38774,7 @@
|
|
|
38633
38774
|
"optional": false,
|
|
38634
38775
|
"returnType": "void",
|
|
38635
38776
|
"typeParameters": [],
|
|
38636
|
-
"line":
|
|
38777
|
+
"line": 337,
|
|
38637
38778
|
"deprecated": false,
|
|
38638
38779
|
"deprecationMessage": "",
|
|
38639
38780
|
"rawdescription": "\n\nSets the disabled state through the model\n",
|
|
@@ -38663,7 +38804,7 @@
|
|
|
38663
38804
|
"optional": false,
|
|
38664
38805
|
"returnType": "void",
|
|
38665
38806
|
"typeParameters": [],
|
|
38666
|
-
"line":
|
|
38807
|
+
"line": 310,
|
|
38667
38808
|
"deprecated": false,
|
|
38668
38809
|
"deprecationMessage": "",
|
|
38669
38810
|
"rawdescription": "\n\nThis is the initial value set to the component\n",
|
|
@@ -38674,8 +38815,8 @@
|
|
|
38674
38815
|
"jsdoctags": [
|
|
38675
38816
|
{
|
|
38676
38817
|
"name": {
|
|
38677
|
-
"pos":
|
|
38678
|
-
"end":
|
|
38818
|
+
"pos": 8230,
|
|
38819
|
+
"end": 8235,
|
|
38679
38820
|
"flags": 16842752,
|
|
38680
38821
|
"modifierFlagsCache": 0,
|
|
38681
38822
|
"transformFlags": 0,
|
|
@@ -38686,8 +38827,8 @@
|
|
|
38686
38827
|
"deprecated": false,
|
|
38687
38828
|
"deprecationMessage": "",
|
|
38688
38829
|
"tagName": {
|
|
38689
|
-
"pos":
|
|
38690
|
-
"end":
|
|
38830
|
+
"pos": 8224,
|
|
38831
|
+
"end": 8229,
|
|
38691
38832
|
"flags": 16842752,
|
|
38692
38833
|
"modifierFlagsCache": 0,
|
|
38693
38834
|
"transformFlags": 0,
|
|
@@ -38707,7 +38848,39 @@
|
|
|
38707
38848
|
"defaultValue": "true",
|
|
38708
38849
|
"deprecated": false,
|
|
38709
38850
|
"deprecationMessage": "",
|
|
38710
|
-
"line":
|
|
38851
|
+
"line": 155,
|
|
38852
|
+
"type": "boolean",
|
|
38853
|
+
"decorators": []
|
|
38854
|
+
},
|
|
38855
|
+
{
|
|
38856
|
+
"name": "class.cds--number-input--fluid--disabled",
|
|
38857
|
+
"deprecated": false,
|
|
38858
|
+
"deprecationMessage": "",
|
|
38859
|
+
"line": 280,
|
|
38860
|
+
"type": "boolean",
|
|
38861
|
+
"decorators": []
|
|
38862
|
+
},
|
|
38863
|
+
{
|
|
38864
|
+
"name": "class.cds--number-input--fluid--focus",
|
|
38865
|
+
"deprecated": false,
|
|
38866
|
+
"deprecationMessage": "",
|
|
38867
|
+
"line": 284,
|
|
38868
|
+
"type": "boolean",
|
|
38869
|
+
"decorators": []
|
|
38870
|
+
},
|
|
38871
|
+
{
|
|
38872
|
+
"name": "class.cds--number-input--fluid--invalid",
|
|
38873
|
+
"deprecated": false,
|
|
38874
|
+
"deprecationMessage": "",
|
|
38875
|
+
"line": 276,
|
|
38876
|
+
"type": "boolean",
|
|
38877
|
+
"decorators": []
|
|
38878
|
+
},
|
|
38879
|
+
{
|
|
38880
|
+
"name": "class.cds--text-input--fluid__skeleton",
|
|
38881
|
+
"deprecated": false,
|
|
38882
|
+
"deprecationMessage": "",
|
|
38883
|
+
"line": 288,
|
|
38711
38884
|
"type": "boolean",
|
|
38712
38885
|
"decorators": []
|
|
38713
38886
|
}
|
|
@@ -38719,7 +38892,7 @@
|
|
|
38719
38892
|
"argsDecorator": [],
|
|
38720
38893
|
"deprecated": false,
|
|
38721
38894
|
"deprecationMessage": "",
|
|
38722
|
-
"line":
|
|
38895
|
+
"line": 330
|
|
38723
38896
|
}
|
|
38724
38897
|
],
|
|
38725
38898
|
"standalone": false,
|
|
@@ -38727,7 +38900,7 @@
|
|
|
38727
38900
|
"description": "<p>Get started with importing the module:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">import { NumberModule } from 'carbon-components-angular';</code></pre></div><p><a href=\"../../?path=/story/components-number--basic\">See demo</a></p>\n",
|
|
38728
38901
|
"rawdescription": "\n\nGet started with importing the module:\n\n```typescript\nimport { NumberModule } from 'carbon-components-angular';\n```\n\n[See demo](../../?path=/story/components-number--basic)\n",
|
|
38729
38902
|
"type": "component",
|
|
38730
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tHostBinding,\n\tEventEmitter,\n\tOutput,\n\tTemplateRef,\n\tHostListener\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from \"@angular/forms\";\n\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { Observable } from \"rxjs\";\n\n/**\n * Used to emit changes performed on number input components.\n */\nexport class NumberChange {\n\t/**\n\t * Contains the `Number` that has been changed.\n\t */\n\tsource: NumberComponent;\n\t/**\n\t * The value of the `Number` field encompassed in the `NumberChange` class.\n\t */\n\tvalue: number;\n}\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { NumberModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-number--basic)\n */\n@Component({\n\tselector: \"cds-number, ibm-number\",\n\ttemplate: `\n\t\t<div\n\t\t\tdata-numberinput\n\t\t\t[attr.data-invalid]=\"(invalid ? true : null)\"\n\t\t\tclass=\"cds--number\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--number--light': theme === 'light',\n\t\t\t\t'cds--number--nolabel': !label,\n\t\t\t\t'cds--number--helpertext': helperText,\n\t\t\t\t'cds--skeleton' : skeleton,\n\t\t\t\t'cds--number--sm': size === 'sm',\n\t\t\t\t'cds--number--md': size === 'md',\n\t\t\t\t'cds--number--lg': size === 'lg'\n\t\t\t}\">\n\t\t\t<label *ngIf=\"skeleton && label\" class=\"cds--label cds--skeleton\"></label>\n\t\t\t<label\n\t\t\t\t*ngIf=\"!skeleton && label\"\n\t\t\t\t[for]=\"id\"\n\t\t\t\tclass=\"cds--label\"\n\t\t\t\t[ngClass]=\"{'cds--label--disabled': disabled}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t</label>\n\t\t\t<div\n\t\t\t\tclass=\"cds--number__input-wrapper\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--number__input-wrapper--warning': warn\n\t\t\t\t}\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t[id]=\"id\"\n\t\t\t\t\t[value]=\"value\"\n\t\t\t\t\t[attr.min]=\"min\"\n\t\t\t\t\t[attr.max]=\"max\"\n\t\t\t\t\t[attr.step]=\"step\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t[required]=\"required\"\n\t\t\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t\t\t[attr.data-invalid]=\"invalid ? invalid : null\"\n\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t(change)=\"onNumberInputChange($event)\"/>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && invalid\"\n\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--number__invalid\">\n\t\t\t\t</svg>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && !invalid && warn\"\n\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--number__invalid cds--number__invalid--warning\">\n\t\t\t\t</svg>\n\t\t\t\t<div *ngIf=\"!skeleton\" class=\"cds--number__controls\">\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"cds--number__control-btn down-icon\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t[attr.disabled]=\"disabled ? true : null\"\n\t\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\t\t[attr.aria-label]=\"getDecrementLabel() | async\"\n\t\t\t\t\t\t(click)=\"onDecrement()\">\n\t\t\t\t\t\t<svg cdsIcon=\"subtract\" size=\"16\"></svg>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class=\"cds--number__rule-divider\"></div>\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"cds--number__control-btn up-icon\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t[attr.disabled]=\"disabled ? true : null\"\n\t\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\t\t[attr.aria-label]=\"getIncrementLabel() | async\"\n\t\t\t\t\t\t(click)=\"onIncrement()\">\n\t\t\t\t\t\t<svg cdsIcon=\"add\" size=\"16\"></svg>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class=\"cds--number__rule-divider\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\t*ngIf=\"helperText && !invalid && !warn\"\n\t\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--form__helper-text--disabled': disabled\n\t\t\t\t}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t\t</div>\n\t\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: NumberComponent,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class NumberComponent implements ControlValueAccessor {\n\t/**\n\t * Variable used for creating unique ids for number input components.\n\t */\n\tstatic numberCount = 0;\n\n\t@HostBinding(\"class.cds--form-item\") containerClass = true;\n\n\t/**\n\t * Set to `true` for readonly state.\n\t */\n\t@Input() @HostBinding(\"class.cds--number--readonly\") readonly = false;\n\t/**\n\t * @deprecated since v5 - Use `cdsLayer` directive instead\n\t * `light` or `dark` number input theme.\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\t/**\n\t * Set to `true` for a disabled number input.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Set to `true` for a loading number component.\n\t */\n\t@Input() skeleton = false;\n\t/**\n\t * Set to `true` for an invalid number component.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * The unique id for the number component.\n\t */\n\t@Input() id = `number-${NumberComponent.numberCount}`;\n\t/**\n\t * Sets the placeholder attribute on the `input` element.\n\t */\n\t@Input() placeholder = \"\";\n\t/**\n\t * Number input field render size\n\t */\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\t/**\n\t * Reflects the required attribute of the `input` element.\n\t */\n\t@Input() required: boolean;\n\t/**\n\t * Sets the value attribute on the `input` element.\n\t */\n\t@Input() set value(v: any) {\n\t\tif (v === \"\" || v === null) {\n\t\t\tthis._value = null;\n\t\t\treturn;\n\t\t}\n\t\tthis._value = Number(v);\n\t}\n\n\tget value() {\n\t\treturn this._value;\n\t}\n\t/**\n\t * Sets the min attribute on the `input` element.\n\t */\n\t@Input() min = null;\n\t/**\n\t * Sets the max attribute on the `input` element.\n\t */\n\t@Input() max = null;\n\t/**\n\t * Sets the text inside the `label` tag.\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Sets the optional helper text.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\t/**\n\t * Sets the invalid text.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\t/**\n\t * Sets the amount the number controls increment and decrement by.\n\t */\n\t@Input() step = 1;\n\t/**\n\t * If `step` is a decimal, we may want precision to be set to go around floating point precision.\n\t */\n\t@Input() precision: number;\n\t/**\n\t * Set to `true` to show a warning (contents set by warningText)\n\t */\n\t@Input() warn = false;\n\t/**\n\t * Sets the warning text\n\t */\n\t@Input() warnText: string | TemplateRef<any>;\n\t/**\n\t * Sets the arialabel for input\n\t */\n\t@Input() ariaLabel: string;\n\t/**\n\t * Emits event notifying other classes when a change in state occurs in the input.\n\t */\n\t@Output() change = new EventEmitter<NumberChange>();\n\n\t@Input()\n\tset decrementLabel(value: string | Observable<string>) {\n\t\tthis._decrementLabel.override(value);\n\t}\n\n\tget decrementLabel() {\n\t\treturn this._decrementLabel.value;\n\t}\n\n\t@Input()\n\tset incrementLabel(value: string | Observable<string>) {\n\t\tthis._incrementLabel.override(value);\n\t}\n\n\tget incrementLabel() {\n\t\treturn this._incrementLabel.value;\n\t}\n\n\tprotected _value = 0;\n\n\tprotected _decrementLabel: Overridable = this.i18n.getOverridable(\"NUMBER.DECREMENT\");\n\tprotected _incrementLabel: Overridable = this.i18n.getOverridable(\"NUMBER.INCREMENT\");\n\n\t/**\n\t * Creates an instance of `Number`.\n\t */\n\tconstructor(protected i18n: I18n) {\n\t\tNumberComponent.numberCount++;\n\t}\n\n\t/**\n\t * This is the initial value set to the component\n\t * @param value The input value.\n\t */\n\tpublic writeValue(value: any) {\n\t\tthis.value = value;\n\t}\n\n\t/**\n\t * Sets a method in order to propagate changes back to the form.\n\t */\n\tpublic registerOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\t/**\n\t * Registers a callback to be triggered when the control has been touched.\n\t * @param fn Callback to be triggered when the number input is touched.\n\t */\n\tpublic registerOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\t@HostListener(\"focusout\")\n\tfocusOut() {\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Sets the disabled state through the model\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\t/**\n\t * Called when number input is blurred. Needed to properly implement `ControlValueAccessor`.\n\t */\n\tonTouched: () => any = () => { };\n\n\t/**\n\t * Method set in `registerOnChange` to propagate changes back to the form.\n\t */\n\tpropagateChange = (_: any) => { };\n\n\t/**\n\t * Adds `step` to the current `value`.\n\t */\n\tonIncrement(): void {\n\t\tif (this.max === null || this.value + this.step <= this.max) {\n\t\t\tthis.value += this.step;\n\t\t\tthis.value = parseFloat(this.value.toPrecision(this.precision));\n\t\t\tthis.emitChangeEvent();\n\t\t}\n\t}\n\n\t/**\n\t * Subtracts `step` to the current `value`.\n\t */\n\tonDecrement(): void {\n\t\tif (this.min === null || this.value - this.step >= this.min) {\n\t\t\tthis.value -= this.step;\n\t\t\tthis.value = parseFloat(this.value.toPrecision(this.precision));\n\t\t\tthis.emitChangeEvent();\n\t\t}\n\t}\n\n\tgetDecrementLabel(): Observable<string> {\n\t\treturn this._decrementLabel.subject;\n\t}\n\n\tgetIncrementLabel(): Observable<string> {\n\t\treturn this._incrementLabel.subject;\n\t}\n\n\t/**\n\t * Creates a class of `NumberChange` to emit the change in the `Number`.\n\t */\n\temitChangeEvent(): void {\n\t\tlet event = new NumberChange();\n\t\tevent.source = this;\n\t\tevent.value = this.value;\n\t\tthis.change.emit(event);\n\t\tthis.propagateChange(this.value);\n\t}\n\n\tonNumberInputChange(event) {\n\t\tthis.value = event.target.value;\n\t\tthis.emitChangeEvent();\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n}\nexport { NumberComponent as Number };\n",
|
|
38903
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tHostBinding,\n\tEventEmitter,\n\tOutput,\n\tTemplateRef,\n\tHostListener\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\n\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { Observable } from \"rxjs\";\n\n/**\n * Used to emit changes performed on number input components.\n */\nexport class NumberChange {\n\t/**\n\t * Contains the `Number` that has been changed.\n\t */\n\tsource: NumberComponent;\n\t/**\n\t * The value of the `Number` field encompassed in the `NumberChange` class.\n\t */\n\tvalue: number;\n}\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { NumberModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-number--basic)\n */\n@Component({\n\tselector: \"cds-number, ibm-number\",\n\ttemplate: `\n\t\t<label *ngIf=\"skeleton && label\" class=\"cds--label cds--skeleton\"></label>\n\t\t<div\n\t\t\tdata-numberinput\n\t\t\t[attr.data-invalid]=\"(invalid ? true : null)\"\n\t\t\tclass=\"cds--number\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--number--light': theme === 'light',\n\t\t\t\t'cds--number--nolabel': !label,\n\t\t\t\t'cds--number--helpertext': helperText,\n\t\t\t\t'cds--skeleton' : skeleton,\n\t\t\t\t'cds--number--sm': size === 'sm',\n\t\t\t\t'cds--number--md': size === 'md',\n\t\t\t\t'cds--number--lg': size === 'lg'\n\t\t\t}\">\n\t\t\t<label\n\t\t\t\t*ngIf=\"!skeleton && label\"\n\t\t\t\t[for]=\"id\"\n\t\t\t\tclass=\"cds--label\"\n\t\t\t\t[ngClass]=\"{'cds--label--disabled': disabled}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t</label>\n\t\t\t<div\n\t\t\t\tclass=\"cds--number__input-wrapper\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--number__input-wrapper--warning': warn\n\t\t\t\t}\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t[id]=\"id\"\n\t\t\t\t\t[value]=\"value\"\n\t\t\t\t\t[attr.min]=\"min\"\n\t\t\t\t\t[attr.max]=\"max\"\n\t\t\t\t\t[attr.step]=\"step\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t[required]=\"required\"\n\t\t\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t\t\t[attr.data-invalid]=\"invalid ? invalid : null\"\n\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t(focus)=\"fluid ? handleFocus($event): null\"\n\t\t\t\t\t(blur)=\"fluid ? handleFocus($event): null\"\n\t\t\t\t\t(change)=\"onNumberInputChange($event)\"/>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && invalid\"\n\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--number__invalid\">\n\t\t\t\t</svg>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && !invalid && warn\"\n\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--number__invalid cds--number__invalid--warning\">\n\t\t\t\t</svg>\n\t\t\t\t<div *ngIf=\"!skeleton\" class=\"cds--number__controls\">\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"cds--number__control-btn down-icon\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t[attr.disabled]=\"disabled ? true : null\"\n\t\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\t\t[attr.aria-label]=\"getDecrementLabel() | async\"\n\t\t\t\t\t\t(click)=\"onDecrement()\">\n\t\t\t\t\t\t<svg cdsIcon=\"subtract\" size=\"16\"></svg>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class=\"cds--number__rule-divider\"></div>\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"cds--number__control-btn up-icon\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t[attr.disabled]=\"disabled ? true : null\"\n\t\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\t\t[attr.aria-label]=\"getIncrementLabel() | async\"\n\t\t\t\t\t\t(click)=\"onIncrement()\">\n\t\t\t\t\t\t<svg cdsIcon=\"add\" size=\"16\"></svg>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class=\"cds--number__rule-divider\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<hr *ngIf=\"fluid\" class=\"cds--number-input__divider\" />\n\t\t\t<div\n\t\t\t\t*ngIf=\"helperText && !invalid && !warn && !fluid\"\n\t\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--form__helper-text--disabled': disabled\n\t\t\t\t}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t\t</div>\n\t\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: NumberComponent,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class NumberComponent implements ControlValueAccessor {\n\t/**\n\t * Variable used for creating unique ids for number input components.\n\t */\n\tstatic numberCount = 0;\n\n\t@HostBinding(\"class.cds--form-item\") containerClass = true;\n\n\t/**\n\t * Set to `true` for readonly state.\n\t */\n\t@Input() @HostBinding(\"class.cds--number--readonly\") readonly = false;\n\t/**\n\t * @deprecated since v5 - Use `cdsLayer` directive instead\n\t * `light` or `dark` number input theme.\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\t/**\n\t * Set to `true` for a disabled number input.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Set to `true` for a loading number component.\n\t */\n\t@Input() skeleton = false;\n\t/**\n\t * Set to `true` for an invalid number component.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * The unique id for the number component.\n\t */\n\t@Input() id = `number-${NumberComponent.numberCount}`;\n\t/**\n\t * Sets the placeholder attribute on the `input` element.\n\t */\n\t@Input() placeholder = \"\";\n\t/**\n\t * Number input field render size\n\t */\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\t/**\n\t * Reflects the required attribute of the `input` element.\n\t */\n\t@Input() required: boolean;\n\t/**\n\t * Sets the value attribute on the `input` element.\n\t */\n\t@Input() set value(v: any) {\n\t\tif (v === \"\" || v === null) {\n\t\t\tthis._value = null;\n\t\t\treturn;\n\t\t}\n\t\tthis._value = Number(v);\n\t}\n\n\tget value() {\n\t\treturn this._value;\n\t}\n\t/**\n\t * Sets the min attribute on the `input` element.\n\t */\n\t@Input() min = null;\n\t/**\n\t * Sets the max attribute on the `input` element.\n\t */\n\t@Input() max = null;\n\t/**\n\t * Sets the text inside the `label` tag.\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Sets the optional helper text.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\t/**\n\t * Sets the invalid text.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\t/**\n\t * Sets the amount the number controls increment and decrement by.\n\t */\n\t@Input() step = 1;\n\t/**\n\t * If `step` is a decimal, we may want precision to be set to go around floating point precision.\n\t */\n\t@Input() precision: number;\n\t/**\n\t * Set to `true` to show a warning (contents set by warningText)\n\t */\n\t@Input() warn = false;\n\t/**\n\t * Sets the warning text\n\t */\n\t@Input() warnText: string | TemplateRef<any>;\n\t/**\n\t * Sets the arialabel for input\n\t */\n\t@Input() ariaLabel: string;\n\t/**\n\t * Emits event notifying other classes when a change in state occurs in the input.\n\t */\n\t@Output() change = new EventEmitter<NumberChange>();\n\n\t@Input()\n\tset decrementLabel(value: string | Observable<string>) {\n\t\tthis._decrementLabel.override(value);\n\t}\n\n\tget decrementLabel() {\n\t\treturn this._decrementLabel.value;\n\t}\n\n\t@Input()\n\tset incrementLabel(value: string | Observable<string>) {\n\t\tthis._incrementLabel.override(value);\n\t}\n\n\tget incrementLabel() {\n\t\treturn this._incrementLabel.value;\n\t}\n\n\t/**\n\t * Experimental: enable fluid state\n\t */\n\t@HostBinding(\"class.cds--number-input--fluid\") @Input() fluid = false;\n\n\t@HostBinding(\"class.cds--number-input--fluid--invalid\") get fluidInvalid() {\n\t\treturn this.fluid && this.invalid;\n\t}\n\n\t@HostBinding(\"class.cds--number-input--fluid--disabled\") get fluidDisabled() {\n\t\treturn this.fluid && this.disabled;\n\t}\n\n\t@HostBinding(\"class.cds--number-input--fluid--focus\") get fluidFocus() {\n\t\treturn this.fluid && this._isFocused;\n\t}\n\n\t@HostBinding(\"class.cds--text-input--fluid__skeleton\") get fluidSkeleton() {\n\t\treturn this.fluid && this.skeleton;\n\t}\n\n\tprotected _isFocused = false;\n\n\tprotected _value = 0;\n\n\tprotected _decrementLabel: Overridable = this.i18n.getOverridable(\"NUMBER.DECREMENT\");\n\tprotected _incrementLabel: Overridable = this.i18n.getOverridable(\"NUMBER.INCREMENT\");\n\n\t/**\n\t * Creates an instance of `Number`.\n\t */\n\tconstructor(protected i18n: I18n) {\n\t\tNumberComponent.numberCount++;\n\t}\n\n\t/**\n\t * This is the initial value set to the component\n\t * @param value The input value.\n\t */\n\tpublic writeValue(value: any) {\n\t\tthis.value = value;\n\t}\n\n\t/**\n\t * Sets a method in order to propagate changes back to the form.\n\t */\n\tpublic registerOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\t/**\n\t * Registers a callback to be triggered when the control has been touched.\n\t * @param fn Callback to be triggered when the number input is touched.\n\t */\n\tpublic registerOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\t@HostListener(\"focusout\")\n\tfocusOut() {\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Sets the disabled state through the model\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\t/**\n\t * Called when number input is blurred. Needed to properly implement `ControlValueAccessor`.\n\t */\n\tonTouched: () => any = () => { };\n\n\t/**\n\t * Method set in `registerOnChange` to propagate changes back to the form.\n\t */\n\tpropagateChange = (_: any) => { };\n\n\t/**\n\t * Adds `step` to the current `value`.\n\t */\n\tonIncrement(): void {\n\t\tif (this.max === null || this.value + this.step <= this.max) {\n\t\t\tthis.value += this.step;\n\t\t\tthis.value = parseFloat(this.value.toPrecision(this.precision));\n\t\t\tthis.emitChangeEvent();\n\t\t}\n\t}\n\n\t/**\n\t * Subtracts `step` to the current `value`.\n\t */\n\tonDecrement(): void {\n\t\tif (this.min === null || this.value - this.step >= this.min) {\n\t\t\tthis.value -= this.step;\n\t\t\tthis.value = parseFloat(this.value.toPrecision(this.precision));\n\t\t\tthis.emitChangeEvent();\n\t\t}\n\t}\n\n\tgetDecrementLabel(): Observable<string> {\n\t\treturn this._decrementLabel.subject;\n\t}\n\n\tgetIncrementLabel(): Observable<string> {\n\t\treturn this._incrementLabel.subject;\n\t}\n\n\t/**\n\t * Creates a class of `NumberChange` to emit the change in the `Number`.\n\t */\n\temitChangeEvent(): void {\n\t\tlet event = new NumberChange();\n\t\tevent.source = this;\n\t\tevent.value = this.value;\n\t\tthis.change.emit(event);\n\t\tthis.propagateChange(this.value);\n\t}\n\n\tonNumberInputChange(event) {\n\t\tthis.value = event.target.value;\n\t\tthis.emitChangeEvent();\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\thandleFocus(event: FocusEvent) {\n\t\tif (\"type\" in event.target && (<HTMLInputElement>event.target).type === \"button\") {\n\t\t\tthis._isFocused = false;\n\t\t} else {\n\t\t\tthis._isFocused = event.type === \"focus\";\n\t\t}\n\t}\n}\nexport { NumberComponent as Number };\n",
|
|
38731
38904
|
"assetsDirs": [],
|
|
38732
38905
|
"styleUrlsData": "",
|
|
38733
38906
|
"stylesData": "",
|
|
@@ -38744,7 +38917,7 @@
|
|
|
38744
38917
|
"deprecationMessage": ""
|
|
38745
38918
|
}
|
|
38746
38919
|
],
|
|
38747
|
-
"line":
|
|
38920
|
+
"line": 297,
|
|
38748
38921
|
"rawdescription": "\n\nCreates an instance of `Number`.\n",
|
|
38749
38922
|
"jsdoctags": [
|
|
38750
38923
|
{
|
|
@@ -38779,7 +38952,7 @@
|
|
|
38779
38952
|
}
|
|
38780
38953
|
],
|
|
38781
38954
|
"returnType": "void",
|
|
38782
|
-
"line":
|
|
38955
|
+
"line": 197,
|
|
38783
38956
|
"rawdescription": "\n\nSets the value attribute on the `input` element.\n",
|
|
38784
38957
|
"description": "<p>Sets the value attribute on the <code>input</code> element.</p>\n",
|
|
38785
38958
|
"jsdoctags": [
|
|
@@ -38798,7 +38971,7 @@
|
|
|
38798
38971
|
"name": "value",
|
|
38799
38972
|
"type": "",
|
|
38800
38973
|
"returnType": "",
|
|
38801
|
-
"line":
|
|
38974
|
+
"line": 205
|
|
38802
38975
|
}
|
|
38803
38976
|
},
|
|
38804
38977
|
"decrementLabel": {
|
|
@@ -38817,7 +38990,7 @@
|
|
|
38817
38990
|
}
|
|
38818
38991
|
],
|
|
38819
38992
|
"returnType": "void",
|
|
38820
|
-
"line":
|
|
38993
|
+
"line": 254,
|
|
38821
38994
|
"jsdoctags": [
|
|
38822
38995
|
{
|
|
38823
38996
|
"name": "value",
|
|
@@ -38834,7 +39007,7 @@
|
|
|
38834
39007
|
"name": "decrementLabel",
|
|
38835
39008
|
"type": "",
|
|
38836
39009
|
"returnType": "",
|
|
38837
|
-
"line":
|
|
39010
|
+
"line": 258
|
|
38838
39011
|
}
|
|
38839
39012
|
},
|
|
38840
39013
|
"incrementLabel": {
|
|
@@ -38853,7 +39026,7 @@
|
|
|
38853
39026
|
}
|
|
38854
39027
|
],
|
|
38855
39028
|
"returnType": "void",
|
|
38856
|
-
"line":
|
|
39029
|
+
"line": 263,
|
|
38857
39030
|
"jsdoctags": [
|
|
38858
39031
|
{
|
|
38859
39032
|
"name": "value",
|
|
@@ -38870,7 +39043,43 @@
|
|
|
38870
39043
|
"name": "incrementLabel",
|
|
38871
39044
|
"type": "",
|
|
38872
39045
|
"returnType": "",
|
|
38873
|
-
"line":
|
|
39046
|
+
"line": 267
|
|
39047
|
+
}
|
|
39048
|
+
},
|
|
39049
|
+
"fluidInvalid": {
|
|
39050
|
+
"name": "fluidInvalid",
|
|
39051
|
+
"getSignature": {
|
|
39052
|
+
"name": "fluidInvalid",
|
|
39053
|
+
"type": "",
|
|
39054
|
+
"returnType": "",
|
|
39055
|
+
"line": 276
|
|
39056
|
+
}
|
|
39057
|
+
},
|
|
39058
|
+
"fluidDisabled": {
|
|
39059
|
+
"name": "fluidDisabled",
|
|
39060
|
+
"getSignature": {
|
|
39061
|
+
"name": "fluidDisabled",
|
|
39062
|
+
"type": "",
|
|
39063
|
+
"returnType": "",
|
|
39064
|
+
"line": 280
|
|
39065
|
+
}
|
|
39066
|
+
},
|
|
39067
|
+
"fluidFocus": {
|
|
39068
|
+
"name": "fluidFocus",
|
|
39069
|
+
"getSignature": {
|
|
39070
|
+
"name": "fluidFocus",
|
|
39071
|
+
"type": "",
|
|
39072
|
+
"returnType": "",
|
|
39073
|
+
"line": 284
|
|
39074
|
+
}
|
|
39075
|
+
},
|
|
39076
|
+
"fluidSkeleton": {
|
|
39077
|
+
"name": "fluidSkeleton",
|
|
39078
|
+
"getSignature": {
|
|
39079
|
+
"name": "fluidSkeleton",
|
|
39080
|
+
"type": "",
|
|
39081
|
+
"returnType": "",
|
|
39082
|
+
"line": 288
|
|
38874
39083
|
}
|
|
38875
39084
|
}
|
|
38876
39085
|
}
|
|
@@ -53575,7 +53784,7 @@
|
|
|
53575
53784
|
},
|
|
53576
53785
|
{
|
|
53577
53786
|
"name": "Table",
|
|
53578
|
-
"id": "component-Table-
|
|
53787
|
+
"id": "component-Table-add4f2744657f84a37212b91e107ae8dedf1f937ee83de962f8e220fdcdca1bd0218cef51d8dd9845b2ed20d271cfb25d705a0a59f2cc5af088213e4a5ce1700",
|
|
53579
53788
|
"file": "src/table/table.component.ts",
|
|
53580
53789
|
"encapsulation": [],
|
|
53581
53790
|
"entryComponents": [],
|
|
@@ -53587,7 +53796,7 @@
|
|
|
53587
53796
|
"styles": [
|
|
53588
53797
|
"\n\t\t:host {\n\t\t\tdisplay: block;\n\t\t}\n\t"
|
|
53589
53798
|
],
|
|
53590
|
-
"template": "<table\n\tcdsTable\n\t[sortable]=\"sortable\"\n\t[noBorder]=\"noBorder\"\n\t[ngClass]=\"{'cds--data-table--sticky-header': stickyHeader}\"\n\t[size]=\"size\"\n\t[striped]=\"striped\"\n\t[skeleton]=\"skeleton\"\n\t[attr.aria-labelledby]=\"ariaLabelledby\"\n\t[attr.aria-describedby]=\"ariaDescribedby\">\n\t<thead\n\t\tcdsTableHead\n\t\t[sortable]=\"sortable\"\n\t\t(deselectAll)=\"onDeselectAll()\"\n\t\t(selectAll)=\"onSelectAll()\"\n\t\t(sort)=\"doSort($event)\"\n\t\t[checkboxHeaderLabel]=\"getCheckboxHeaderLabel()\"\n\t\t[filterTitle]=\"getFilterTitle()\"\n\t\t[model]=\"model\"\n\t\t[selectAllCheckbox]=\"selectAllCheckbox\"\n\t\t[selectAllCheckboxSomeSelected]=\"selectAllCheckboxSomeSelected\"\n\t\t[showSelectionColumn]=\"showSelectionColumn\"\n\t\t[enableSingleSelect]=\"enableSingleSelect\"\n\t\t[skeleton]=\"skeleton\"\n\t\t[sortAscendingLabel]=\"sortAscendingLabel\"\n\t\t[sortDescendingLabel]=\"sortDescendingLabel\"\n\t\t[stickyHeader]=\"stickyHeader\">\n\t</thead>\n\t<tbody\n\t\tcdsTableBody\n\t\t(deselectRow)=\"onSelectRow($event)\"\n\t\t(scroll)=\"onScroll($event)\"\n\t\t(selectRow)=\"onSelectRow($event)\"\n\t\t[checkboxRowLabel]=\"getCheckboxRowLabel()\"\n\t\t[enableSingleSelect]=\"enableSingleSelect\"\n\t\t(rowClick)=\"onRowClick($event)\"\n\t\t[expandButtonAriaLabel]=\"expandButtonAriaLabel\"\n\t\t[model]=\"model\"\n\t\t[size]=\"size\"\n\t\t[ngStyle]=\"{'overflow-y': 'scroll'}\"\n\t\t[selectionLabelColumn]=\"selectionLabelColumn\"\n\t\t[showSelectionColumn]=\"showSelectionColumn\"\n\t\t[skeleton]=\"skeleton\"\n\t\t*ngIf=\"!noData; else noDataTemplate\">\n\t</tbody>\n\t<ng-template #noDataTemplate><ng-content></ng-content></ng-template>\n\t<tfoot>\n\t\t<ng-template\n\t\t\t[ngTemplateOutlet]=\"footerTemplate\">\n\t\t</ng-template>\n\t\t<tr *ngIf=\"this.model.isLoading\">\n\t\t\t<td class=\"table_loading-indicator\">\n\t\t\t\t<div class=\"cds--loading cds--loading--small\">\n\t\t\t\t\t<svg class=\"cds--loading__svg\" viewBox=\"-75 -75 150 150\">\n\t\t\t\t\t\t<circle class=\"cds--loading__stroke\" cx=\"0\" cy=\"0\" r=\"37.5\" />\n\t\t\t\t\t</svg>\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr *ngIf=\"this.model.isEnd\">\n\t\t\t<td class=\"table_end-indicator\">\n\t\t\t\t<h5>{{getEndOfDataText() | async}}</h5>\n\t\t\t\t<button (click)=\"scrollToTop($event)\" class=\"btn--secondary-sm\">\n\t\t\t\t\t{{getScrollTopText() | async}}\n\t\t\t\t</button>\n\t\t\t</td>\n\t\t</tr>\n\t</tfoot>\n</table>\n",
|
|
53799
|
+
"template": "<table\n\tcdsTable\n\t[sortable]=\"sortable\"\n\t[noBorder]=\"noBorder\"\n\t[ngClass]=\"{'cds--data-table--sticky-header': stickyHeader}\"\n\t[size]=\"size\"\n\t[striped]=\"striped\"\n\t[skeleton]=\"skeleton\"\n\t[attr.aria-labelledby]=\"ariaLabelledby\"\n\t[attr.aria-describedby]=\"ariaDescribedby\">\n\t<thead\n\t\tcdsTableHead\n\t\t[sortable]=\"sortable\"\n\t\t(deselectAll)=\"onDeselectAll()\"\n\t\t(selectAll)=\"onSelectAll()\"\n\t\t(expandAllRows)=\"model.expandAllRows(true)\"\n\t\t(collapseAllRows)=\"model.expandAllRows(false)\"\n\t\t(sort)=\"doSort($event)\"\n\t\t[checkboxHeaderLabel]=\"getCheckboxHeaderLabel()\"\n\t\t[filterTitle]=\"getFilterTitle()\"\n\t\t[model]=\"model\"\n\t\t[selectAllCheckbox]=\"selectAllCheckbox\"\n\t\t[selectAllCheckboxSomeSelected]=\"selectAllCheckboxSomeSelected\"\n\t\t[showSelectionColumn]=\"showSelectionColumn\"\n\t\t[enableSingleSelect]=\"enableSingleSelect\"\n\t\t[showExpandAllToggle]=\"showExpandAllToggle\"\n\t\t[skeleton]=\"skeleton\"\n\t\t[sortAscendingLabel]=\"sortAscendingLabel\"\n\t\t[sortDescendingLabel]=\"sortDescendingLabel\"\n\t\t[stickyHeader]=\"stickyHeader\">\n\t</thead>\n\t<tbody\n\t\tcdsTableBody\n\t\t(deselectRow)=\"onSelectRow($event)\"\n\t\t(scroll)=\"onScroll($event)\"\n\t\t(selectRow)=\"onSelectRow($event)\"\n\t\t[checkboxRowLabel]=\"getCheckboxRowLabel()\"\n\t\t[enableSingleSelect]=\"enableSingleSelect\"\n\t\t(rowClick)=\"onRowClick($event)\"\n\t\t[expandButtonAriaLabel]=\"expandButtonAriaLabel\"\n\t\t[model]=\"model\"\n\t\t[size]=\"size\"\n\t\t[ngStyle]=\"{'overflow-y': 'scroll'}\"\n\t\t[selectionLabelColumn]=\"selectionLabelColumn\"\n\t\t[showSelectionColumn]=\"showSelectionColumn\"\n\t\t[skeleton]=\"skeleton\"\n\t\t*ngIf=\"!noData; else noDataTemplate\">\n\t</tbody>\n\t<ng-template #noDataTemplate><ng-content></ng-content></ng-template>\n\t<tfoot>\n\t\t<ng-template\n\t\t\t[ngTemplateOutlet]=\"footerTemplate\">\n\t\t</ng-template>\n\t\t<tr *ngIf=\"this.model.isLoading\">\n\t\t\t<td class=\"table_loading-indicator\">\n\t\t\t\t<div class=\"cds--loading cds--loading--small\">\n\t\t\t\t\t<svg class=\"cds--loading__svg\" viewBox=\"-75 -75 150 150\">\n\t\t\t\t\t\t<circle class=\"cds--loading__stroke\" cx=\"0\" cy=\"0\" r=\"37.5\" />\n\t\t\t\t\t</svg>\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr *ngIf=\"this.model.isEnd\">\n\t\t\t<td class=\"table_end-indicator\">\n\t\t\t\t<h5>{{getEndOfDataText() | async}}</h5>\n\t\t\t\t<button (click)=\"scrollToTop($event)\" class=\"btn--secondary-sm\">\n\t\t\t\t\t{{getScrollTopText() | async}}\n\t\t\t\t</button>\n\t\t\t</td>\n\t\t</tr>\n\t</tfoot>\n</table>\n",
|
|
53591
53800
|
"templateUrl": [],
|
|
53592
53801
|
"viewProviders": [],
|
|
53593
53802
|
"hostDirectives": [],
|
|
@@ -53598,7 +53807,7 @@
|
|
|
53598
53807
|
"deprecationMessage": "",
|
|
53599
53808
|
"rawdescription": "\n\nId of the table header description element\n",
|
|
53600
53809
|
"description": "<p>Id of the table header description element</p>\n",
|
|
53601
|
-
"line":
|
|
53810
|
+
"line": 313,
|
|
53602
53811
|
"type": "string",
|
|
53603
53812
|
"decorators": []
|
|
53604
53813
|
},
|
|
@@ -53608,7 +53817,7 @@
|
|
|
53608
53817
|
"deprecationMessage": "",
|
|
53609
53818
|
"rawdescription": "\n\nId of the table header title element\n",
|
|
53610
53819
|
"description": "<p>Id of the table header title element</p>\n",
|
|
53611
|
-
"line":
|
|
53820
|
+
"line": 309,
|
|
53612
53821
|
"type": "string",
|
|
53613
53822
|
"decorators": []
|
|
53614
53823
|
},
|
|
@@ -53619,7 +53828,7 @@
|
|
|
53619
53828
|
"deprecationMessage": "",
|
|
53620
53829
|
"rawdescription": "\n\nControls whether to enable multiple or single row selection.\n",
|
|
53621
53830
|
"description": "<p>Controls whether to enable multiple or single row selection.</p>\n",
|
|
53622
|
-
"line":
|
|
53831
|
+
"line": 407,
|
|
53623
53832
|
"type": "boolean",
|
|
53624
53833
|
"decorators": []
|
|
53625
53834
|
},
|
|
@@ -53629,15 +53838,15 @@
|
|
|
53629
53838
|
"deprecationMessage": "",
|
|
53630
53839
|
"jsdoctags": [
|
|
53631
53840
|
{
|
|
53632
|
-
"pos":
|
|
53633
|
-
"end":
|
|
53841
|
+
"pos": 12603,
|
|
53842
|
+
"end": 12783,
|
|
53634
53843
|
"flags": 16842752,
|
|
53635
53844
|
"modifierFlagsCache": 0,
|
|
53636
53845
|
"transformFlags": 0,
|
|
53637
53846
|
"kind": 334,
|
|
53638
53847
|
"tagName": {
|
|
53639
|
-
"pos":
|
|
53640
|
-
"end":
|
|
53848
|
+
"pos": 12604,
|
|
53849
|
+
"end": 12608,
|
|
53641
53850
|
"flags": 16842752,
|
|
53642
53851
|
"modifierFlagsCache": 0,
|
|
53643
53852
|
"transformFlags": 0,
|
|
@@ -53647,7 +53856,7 @@
|
|
|
53647
53856
|
"comment": "<ul>\n<li>Enable column resize when Carbon officially supports feature\nSet to <code>true</code> to enable users to resize columns.</li>\n</ul>\n<p>Works for columns with width set in pixels.</p>\n"
|
|
53648
53857
|
}
|
|
53649
53858
|
],
|
|
53650
|
-
"line":
|
|
53859
|
+
"line": 435,
|
|
53651
53860
|
"type": "string | Observable",
|
|
53652
53861
|
"decorators": []
|
|
53653
53862
|
},
|
|
@@ -53657,7 +53866,7 @@
|
|
|
53657
53866
|
"deprecationMessage": "",
|
|
53658
53867
|
"rawdescription": "\n\nSet footer template to customize what is displayed in the tfoot section of the table\n",
|
|
53659
53868
|
"description": "<p>Set footer template to customize what is displayed in the tfoot section of the table</p>\n",
|
|
53660
|
-
"line":
|
|
53869
|
+
"line": 496,
|
|
53661
53870
|
"type": "TemplateRef<any>",
|
|
53662
53871
|
"decorators": []
|
|
53663
53872
|
},
|
|
@@ -53667,7 +53876,7 @@
|
|
|
53667
53876
|
"deprecationMessage": "",
|
|
53668
53877
|
"rawdescription": "\n\nSet to `true` for a data grid with keyboard interactions.\n",
|
|
53669
53878
|
"description": "<p>Set to <code>true</code> for a data grid with keyboard interactions.</p>\n",
|
|
53670
|
-
"line":
|
|
53879
|
+
"line": 371,
|
|
53671
53880
|
"type": "boolean",
|
|
53672
53881
|
"decorators": []
|
|
53673
53882
|
},
|
|
@@ -53677,7 +53886,7 @@
|
|
|
53677
53886
|
"deprecationMessage": "",
|
|
53678
53887
|
"rawdescription": "\n\n`TableModel` with data the table is to display.\n",
|
|
53679
53888
|
"description": "<p><code>TableModel</code> with data the table is to display.</p>\n",
|
|
53680
|
-
"line":
|
|
53889
|
+
"line": 319,
|
|
53681
53890
|
"type": "TableModel",
|
|
53682
53891
|
"decorators": []
|
|
53683
53892
|
},
|
|
@@ -53686,7 +53895,7 @@
|
|
|
53686
53895
|
"defaultValue": "true",
|
|
53687
53896
|
"deprecated": false,
|
|
53688
53897
|
"deprecationMessage": "",
|
|
53689
|
-
"line":
|
|
53898
|
+
"line": 388,
|
|
53690
53899
|
"type": "boolean",
|
|
53691
53900
|
"decorators": []
|
|
53692
53901
|
},
|
|
@@ -53697,7 +53906,7 @@
|
|
|
53697
53906
|
"deprecationMessage": "",
|
|
53698
53907
|
"rawdescription": "\n\nDistance (in px) from the bottom that view has to reach before\n`scrollLoad` event is emitted.\n",
|
|
53699
53908
|
"description": "<p>Distance (in px) from the bottom that view has to reach before\n<code>scrollLoad</code> event is emitted.</p>\n",
|
|
53700
|
-
"line":
|
|
53909
|
+
"line": 413,
|
|
53701
53910
|
"type": "number",
|
|
53702
53911
|
"decorators": []
|
|
53703
53912
|
},
|
|
@@ -53707,10 +53916,21 @@
|
|
|
53707
53916
|
"deprecationMessage": "",
|
|
53708
53917
|
"rawdescription": "\n\nUsed to populate the row selection checkbox label with a useful value if set.\n\nExample:\n```\n<cds-table [selectionLabelColumn]=\"0\"></cds-table>\n<!-- results in aria-label=\"Select first column value\"\n(where \"first column value\" is the value of the first column in the row -->\n```\n",
|
|
53709
53918
|
"description": "<p>Used to populate the row selection checkbox label with a useful value if set.</p>\n<p>Example:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-none\"><cds-table [selectionLabelColumn]="0"></cds-table>\n<!-- results in aria-label="Select first column value"\n(where "first column value" is the value of the first column in the row --></code></pre></div>",
|
|
53710
|
-
"line":
|
|
53919
|
+
"line": 508,
|
|
53711
53920
|
"type": "number",
|
|
53712
53921
|
"decorators": []
|
|
53713
53922
|
},
|
|
53923
|
+
{
|
|
53924
|
+
"name": "showExpandAllToggle",
|
|
53925
|
+
"defaultValue": "false",
|
|
53926
|
+
"deprecated": false,
|
|
53927
|
+
"deprecationMessage": "",
|
|
53928
|
+
"rawdescription": "\n\nSet to `true` to show expansion toggle when table consists of row expansions\n",
|
|
53929
|
+
"description": "<p>Set to <code>true</code> to show expansion toggle when table consists of row expansions</p>\n",
|
|
53930
|
+
"line": 393,
|
|
53931
|
+
"type": "boolean",
|
|
53932
|
+
"decorators": []
|
|
53933
|
+
},
|
|
53714
53934
|
{
|
|
53715
53935
|
"name": "showSelectionColumn",
|
|
53716
53936
|
"defaultValue": "true",
|
|
@@ -53718,7 +53938,7 @@
|
|
|
53718
53938
|
"deprecationMessage": "",
|
|
53719
53939
|
"rawdescription": "\n\nControls whether to show the selection checkboxes column or not.\n",
|
|
53720
53940
|
"description": "<p>Controls whether to show the selection checkboxes column or not.</p>\n",
|
|
53721
|
-
"line":
|
|
53941
|
+
"line": 402,
|
|
53722
53942
|
"type": "boolean",
|
|
53723
53943
|
"decorators": []
|
|
53724
53944
|
},
|
|
@@ -53729,7 +53949,7 @@
|
|
|
53729
53949
|
"deprecationMessage": "",
|
|
53730
53950
|
"rawdescription": "\n\nSize of the table rows.\n",
|
|
53731
53951
|
"description": "<p>Size of the table rows.</p>\n",
|
|
53732
|
-
"line":
|
|
53952
|
+
"line": 363,
|
|
53733
53953
|
"type": "TableRowSize",
|
|
53734
53954
|
"decorators": []
|
|
53735
53955
|
},
|
|
@@ -53740,7 +53960,7 @@
|
|
|
53740
53960
|
"deprecationMessage": "",
|
|
53741
53961
|
"rawdescription": "\n\nSet to `true` for a loading table.\n",
|
|
53742
53962
|
"description": "<p>Set to <code>true</code> for a loading table.</p>\n",
|
|
53743
|
-
"line":
|
|
53963
|
+
"line": 367,
|
|
53744
53964
|
"type": "boolean",
|
|
53745
53965
|
"decorators": []
|
|
53746
53966
|
},
|
|
@@ -53751,7 +53971,7 @@
|
|
|
53751
53971
|
"deprecationMessage": "",
|
|
53752
53972
|
"rawdescription": "\n\nSetting sortable to false will disable all headers including headers which are sortable. Is is\npossible to set the sortable state on the header item to disable/enable sorting for only some headers.\n",
|
|
53753
53973
|
"description": "<p>Setting sortable to false will disable all headers including headers which are sortable. Is is\npossible to set the sortable state on the header item to disable/enable sorting for only some headers.</p>\n",
|
|
53754
|
-
"line":
|
|
53974
|
+
"line": 386,
|
|
53755
53975
|
"type": "boolean",
|
|
53756
53976
|
"decorators": []
|
|
53757
53977
|
},
|
|
@@ -53759,7 +53979,7 @@
|
|
|
53759
53979
|
"name": "sortAscendingLabel",
|
|
53760
53980
|
"deprecated": false,
|
|
53761
53981
|
"deprecationMessage": "",
|
|
53762
|
-
"line":
|
|
53982
|
+
"line": 449,
|
|
53763
53983
|
"type": "string | Observable",
|
|
53764
53984
|
"decorators": []
|
|
53765
53985
|
},
|
|
@@ -53767,7 +53987,7 @@
|
|
|
53767
53987
|
"name": "sortDescendingLabel",
|
|
53768
53988
|
"deprecated": false,
|
|
53769
53989
|
"deprecationMessage": "",
|
|
53770
|
-
"line":
|
|
53990
|
+
"line": 442,
|
|
53771
53991
|
"type": "string | Observable",
|
|
53772
53992
|
"decorators": []
|
|
53773
53993
|
},
|
|
@@ -53778,7 +53998,7 @@
|
|
|
53778
53998
|
"deprecationMessage": "",
|
|
53779
53999
|
"rawdescription": "\n\nSet to `true` to stick the header to the top of the table\n",
|
|
53780
54000
|
"description": "<p>Set to <code>true</code> to stick the header to the top of the table</p>\n",
|
|
53781
|
-
"line":
|
|
54001
|
+
"line": 491,
|
|
53782
54002
|
"type": "boolean",
|
|
53783
54003
|
"decorators": []
|
|
53784
54004
|
},
|
|
@@ -53789,7 +54009,7 @@
|
|
|
53789
54009
|
"deprecationMessage": "",
|
|
53790
54010
|
"rawdescription": "\n\nSet to `false` to remove table rows (zebra) stripes.\n",
|
|
53791
54011
|
"description": "<p>Set to <code>false</code> to remove table rows (zebra) stripes.</p>\n",
|
|
53792
|
-
"line":
|
|
54012
|
+
"line": 481,
|
|
53793
54013
|
"type": "boolean",
|
|
53794
54014
|
"decorators": []
|
|
53795
54015
|
},
|
|
@@ -53799,7 +54019,7 @@
|
|
|
53799
54019
|
"deprecationMessage": "",
|
|
53800
54020
|
"rawdescription": "\n\nExpects an object that contains some or all of:\n```\n{\n\t\t\"FILTER\": \"Filter\",\n\t\t\"END_OF_DATA\": \"You've reached the end of your content\",\n\t\t\"SCROLL_TOP\": \"Scroll to top\",\n\t\t\"CHECKBOX_HEADER\": \"Select all rows\",\n\t\t\"CHECKBOX_ROW\": \"Select row\"\n}\n```\n",
|
|
53801
54021
|
"description": "<p>Expects an object that contains some or all of:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-none\">{\n "FILTER": "Filter",\n "END_OF_DATA": "You've reached the end of your content",\n "SCROLL_TOP": "Scroll to top",\n "CHECKBOX_HEADER": "Select all rows",\n "CHECKBOX_ROW": "Select row"\n}</code></pre></div>",
|
|
53802
|
-
"line":
|
|
54022
|
+
"line": 469,
|
|
53803
54023
|
"type": "any",
|
|
53804
54024
|
"decorators": []
|
|
53805
54025
|
}
|
|
@@ -53814,15 +54034,15 @@
|
|
|
53814
54034
|
"description": "<p>Emits if all rows are deselected.</p>\n",
|
|
53815
54035
|
"jsdoctags": [
|
|
53816
54036
|
{
|
|
53817
|
-
"pos":
|
|
53818
|
-
"end":
|
|
54037
|
+
"pos": 17503,
|
|
54038
|
+
"end": 17518,
|
|
53819
54039
|
"flags": 16842752,
|
|
53820
54040
|
"modifierFlagsCache": 0,
|
|
53821
54041
|
"transformFlags": 0,
|
|
53822
54042
|
"kind": 348,
|
|
53823
54043
|
"tagName": {
|
|
53824
|
-
"pos":
|
|
53825
|
-
"end":
|
|
54044
|
+
"pos": 17504,
|
|
54045
|
+
"end": 17509,
|
|
53826
54046
|
"flags": 16842752,
|
|
53827
54047
|
"modifierFlagsCache": 0,
|
|
53828
54048
|
"transformFlags": 0,
|
|
@@ -53831,8 +54051,8 @@
|
|
|
53831
54051
|
},
|
|
53832
54052
|
"comment": "",
|
|
53833
54053
|
"name": {
|
|
53834
|
-
"pos":
|
|
53835
|
-
"end":
|
|
54054
|
+
"pos": 17510,
|
|
54055
|
+
"end": 17515,
|
|
53836
54056
|
"flags": 16842752,
|
|
53837
54057
|
"modifierFlagsCache": 0,
|
|
53838
54058
|
"transformFlags": 0,
|
|
@@ -53843,7 +54063,7 @@
|
|
|
53843
54063
|
"isBracketed": false
|
|
53844
54064
|
}
|
|
53845
54065
|
],
|
|
53846
|
-
"line":
|
|
54066
|
+
"line": 580,
|
|
53847
54067
|
"type": "EventEmitter"
|
|
53848
54068
|
},
|
|
53849
54069
|
{
|
|
@@ -53855,15 +54075,15 @@
|
|
|
53855
54075
|
"description": "<p>Emits if a single row is deselected.</p>\n",
|
|
53856
54076
|
"jsdoctags": [
|
|
53857
54077
|
{
|
|
53858
|
-
"pos":
|
|
53859
|
-
"end":
|
|
54078
|
+
"pos": 17792,
|
|
54079
|
+
"end": 17850,
|
|
53860
54080
|
"flags": 16842752,
|
|
53861
54081
|
"modifierFlagsCache": 0,
|
|
53862
54082
|
"transformFlags": 0,
|
|
53863
54083
|
"kind": 348,
|
|
53864
54084
|
"tagName": {
|
|
53865
|
-
"pos":
|
|
53866
|
-
"end":
|
|
54085
|
+
"pos": 17793,
|
|
54086
|
+
"end": 17798,
|
|
53867
54087
|
"flags": 16842752,
|
|
53868
54088
|
"modifierFlagsCache": 0,
|
|
53869
54089
|
"transformFlags": 0,
|
|
@@ -53872,8 +54092,8 @@
|
|
|
53872
54092
|
},
|
|
53873
54093
|
"comment": "<p>({model: this.model, deselectedRowIndex: index})</p>\n",
|
|
53874
54094
|
"name": {
|
|
53875
|
-
"pos":
|
|
53876
|
-
"end":
|
|
54095
|
+
"pos": 17799,
|
|
54096
|
+
"end": 17799,
|
|
53877
54097
|
"flags": 17104896,
|
|
53878
54098
|
"modifierFlagsCache": 0,
|
|
53879
54099
|
"transformFlags": 0,
|
|
@@ -53884,7 +54104,7 @@
|
|
|
53884
54104
|
"isBracketed": false
|
|
53885
54105
|
}
|
|
53886
54106
|
],
|
|
53887
|
-
"line":
|
|
54107
|
+
"line": 594,
|
|
53888
54108
|
"type": "EventEmitter"
|
|
53889
54109
|
},
|
|
53890
54110
|
{
|
|
@@ -53894,7 +54114,7 @@
|
|
|
53894
54114
|
"deprecationMessage": "",
|
|
53895
54115
|
"rawdescription": "\n\nEmits if a row item excluding expandButtons, checkboxes, or radios is clicked.\n",
|
|
53896
54116
|
"description": "<p>Emits if a row item excluding expandButtons, checkboxes, or radios is clicked.</p>\n",
|
|
53897
|
-
"line":
|
|
54117
|
+
"line": 599,
|
|
53898
54118
|
"type": "EventEmitter"
|
|
53899
54119
|
},
|
|
53900
54120
|
{
|
|
@@ -53904,7 +54124,7 @@
|
|
|
53904
54124
|
"deprecationMessage": "",
|
|
53905
54125
|
"rawdescription": "\n\nEmits when table requires more data to be loaded.\n",
|
|
53906
54126
|
"description": "<p>Emits when table requires more data to be loaded.</p>\n",
|
|
53907
|
-
"line":
|
|
54127
|
+
"line": 604,
|
|
53908
54128
|
"type": "EventEmitter"
|
|
53909
54129
|
},
|
|
53910
54130
|
{
|
|
@@ -53916,15 +54136,15 @@
|
|
|
53916
54136
|
"description": "<p>Emits if all rows are selected.</p>\n",
|
|
53917
54137
|
"jsdoctags": [
|
|
53918
54138
|
{
|
|
53919
|
-
"pos":
|
|
53920
|
-
"end":
|
|
54139
|
+
"pos": 17382,
|
|
54140
|
+
"end": 17397,
|
|
53921
54141
|
"flags": 16842752,
|
|
53922
54142
|
"modifierFlagsCache": 0,
|
|
53923
54143
|
"transformFlags": 0,
|
|
53924
54144
|
"kind": 348,
|
|
53925
54145
|
"tagName": {
|
|
53926
|
-
"pos":
|
|
53927
|
-
"end":
|
|
54146
|
+
"pos": 17383,
|
|
54147
|
+
"end": 17388,
|
|
53928
54148
|
"flags": 16842752,
|
|
53929
54149
|
"modifierFlagsCache": 0,
|
|
53930
54150
|
"transformFlags": 0,
|
|
@@ -53933,8 +54153,8 @@
|
|
|
53933
54153
|
},
|
|
53934
54154
|
"comment": "",
|
|
53935
54155
|
"name": {
|
|
53936
|
-
"pos":
|
|
53937
|
-
"end":
|
|
54156
|
+
"pos": 17389,
|
|
54157
|
+
"end": 17394,
|
|
53938
54158
|
"flags": 16842752,
|
|
53939
54159
|
"modifierFlagsCache": 0,
|
|
53940
54160
|
"transformFlags": 0,
|
|
@@ -53945,7 +54165,7 @@
|
|
|
53945
54165
|
"isBracketed": false
|
|
53946
54166
|
}
|
|
53947
54167
|
],
|
|
53948
|
-
"line":
|
|
54168
|
+
"line": 573,
|
|
53949
54169
|
"type": "EventEmitter"
|
|
53950
54170
|
},
|
|
53951
54171
|
{
|
|
@@ -53957,15 +54177,15 @@
|
|
|
53957
54177
|
"description": "<p>Emits if a single row is selected.</p>\n",
|
|
53958
54178
|
"jsdoctags": [
|
|
53959
54179
|
{
|
|
53960
|
-
"pos":
|
|
53961
|
-
"end":
|
|
54180
|
+
"pos": 17627,
|
|
54181
|
+
"end": 17683,
|
|
53962
54182
|
"flags": 16842752,
|
|
53963
54183
|
"modifierFlagsCache": 0,
|
|
53964
54184
|
"transformFlags": 0,
|
|
53965
54185
|
"kind": 348,
|
|
53966
54186
|
"tagName": {
|
|
53967
|
-
"pos":
|
|
53968
|
-
"end":
|
|
54187
|
+
"pos": 17628,
|
|
54188
|
+
"end": 17633,
|
|
53969
54189
|
"flags": 16842752,
|
|
53970
54190
|
"modifierFlagsCache": 0,
|
|
53971
54191
|
"transformFlags": 0,
|
|
@@ -53974,8 +54194,8 @@
|
|
|
53974
54194
|
},
|
|
53975
54195
|
"comment": "<p>({model: this.model, selectedRowIndex: index})</p>\n",
|
|
53976
54196
|
"name": {
|
|
53977
|
-
"pos":
|
|
53978
|
-
"end":
|
|
54197
|
+
"pos": 17634,
|
|
54198
|
+
"end": 17634,
|
|
53979
54199
|
"flags": 17104896,
|
|
53980
54200
|
"modifierFlagsCache": 0,
|
|
53981
54201
|
"transformFlags": 0,
|
|
@@ -53986,7 +54206,7 @@
|
|
|
53986
54206
|
"isBracketed": false
|
|
53987
54207
|
}
|
|
53988
54208
|
],
|
|
53989
|
-
"line":
|
|
54209
|
+
"line": 587,
|
|
53990
54210
|
"type": "EventEmitter"
|
|
53991
54211
|
},
|
|
53992
54212
|
{
|
|
@@ -53998,15 +54218,15 @@
|
|
|
53998
54218
|
"description": "<p>Emits an index of the column that wants to be sorted.</p>\n<p>If no observers are provided (default), table will attempt to do a simple sort of the data loaded\ninto the model.</p>\n<p>If an observer is provided, table will not attempt any sorting of its own and it is up to the observer\nto sort the table. This is what you typically want if you're using a backend query to get the sorted\ndata or want to sort data across multiple pages.</p>\n<p>Usage:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">@Component({\n selector: "app-table",\n template: `\n <cds-table\n [model]="model"\n (sort)="simpleSort($event)">\n No data.\n </cds-table>\n `\n})\nexport class TableApp implements OnInit, OnChanges {\n @Input() model = new TableModel();\n\n ngOnInit() {\n this.model.header = [\n new TableHeaderItem({ data: "Name" }),\n new TableHeaderItem({ data: "hwer" })\n ];\n\n this.model.data = [\n [new TableItem({ data: "Name 1" }), new TableItem({ data: "qwer" })],\n [new TableItem({ data: "Name 3" }), new TableItem({ data: "zwer" })],\n [new TableItem({ data: "Name 2" }), new TableItem({ data: "swer" })],\n [new TableItem({ data: "Name 4" }), new TableItem({data: "twer"})],\n [new TableItem({ data: "Name 5" }), new TableItem({data: "twer"})],\n [new TableItem({ data: "Name 6" }), new TableItem({data: "twer"})]\n ];\n }\n\n simpleSort(index: number) {\n // this function does a simple sort, which is the default for the table and if that's\n // all you want, you don't need to do this.\n\n // here you can query your backend and update the model.data based on the result\n if (this.model.header[index].sorted) {\n // if already sorted flip sorting direction\n this.model.header[index].ascending = this.model.header[index].descending;\n }\n this.model.sort(index);\n }\n}</code></pre></div>",
|
|
53999
54219
|
"jsdoctags": [
|
|
54000
54220
|
{
|
|
54001
|
-
"pos":
|
|
54002
|
-
"end":
|
|
54221
|
+
"pos": 15844,
|
|
54222
|
+
"end": 16089,
|
|
54003
54223
|
"flags": 16842752,
|
|
54004
54224
|
"modifierFlagsCache": 0,
|
|
54005
54225
|
"transformFlags": 0,
|
|
54006
54226
|
"kind": 334,
|
|
54007
54227
|
"tagName": {
|
|
54008
|
-
"pos":
|
|
54009
|
-
"end":
|
|
54228
|
+
"pos": 15845,
|
|
54229
|
+
"end": 15854,
|
|
54010
54230
|
"flags": 16842752,
|
|
54011
54231
|
"modifierFlagsCache": 0,
|
|
54012
54232
|
"transformFlags": 0,
|
|
@@ -54016,15 +54236,15 @@
|
|
|
54016
54236
|
"comment": "<p>({\nselector: "app-table",\ntemplate: <code><cds-table [model]="model" (sort)="simpleSort($event)"> No data. </cds-table></code>\n})\nexport class TableApp implements OnInit, OnChanges {</p>\n"
|
|
54017
54237
|
},
|
|
54018
54238
|
{
|
|
54019
|
-
"pos":
|
|
54020
|
-
"end":
|
|
54239
|
+
"pos": 16089,
|
|
54240
|
+
"end": 17283,
|
|
54021
54241
|
"flags": 16842752,
|
|
54022
54242
|
"modifierFlagsCache": 0,
|
|
54023
54243
|
"transformFlags": 0,
|
|
54024
54244
|
"kind": 334,
|
|
54025
54245
|
"tagName": {
|
|
54026
|
-
"pos":
|
|
54027
|
-
"end":
|
|
54246
|
+
"pos": 16090,
|
|
54247
|
+
"end": 16095,
|
|
54028
54248
|
"flags": 16842752,
|
|
54029
54249
|
"modifierFlagsCache": 0,
|
|
54030
54250
|
"transformFlags": 0,
|
|
@@ -54034,7 +54254,7 @@
|
|
|
54034
54254
|
"comment": "<p>() model = new TableModel();</p>\n<p>ngOnInit() {\nthis.model.header = [\nnew TableHeaderItem({ data: "Name" }),\nnew TableHeaderItem({ data: "hwer" })\n];</p>\n<p>this.model.data = [\n[new TableItem({ data: "Name 1" }), new TableItem({ data: "qwer" })],\n[new TableItem({ data: "Name 3" }), new TableItem({ data: "zwer" })],\n[new TableItem({ data: "Name 2" }), new TableItem({ data: "swer" })],\n[new TableItem({ data: "Name 4" }), new TableItem({data: "twer"})],\n[new TableItem({ data: "Name 5" }), new TableItem({data: "twer"})],\n[new TableItem({ data: "Name 6" }), new TableItem({data: "twer"})]\n];\n}</p>\n<p>simpleSort(index: number) {\n// this function does a simple sort, which is the default for the table and if that's\n// all you want, you don't need to do this.</p>\n<p>// here you can query your backend and update the model.data based on the result\nif (this.model.header[index].sorted) {\n// if already sorted flip sorting direction\nthis.model.header[index].ascending = this.model.header[index].descending;\n}\nthis.model.sort(index);\n}\n}\n```</p>\n"
|
|
54035
54255
|
}
|
|
54036
54256
|
],
|
|
54037
|
-
"line":
|
|
54257
|
+
"line": 566,
|
|
54038
54258
|
"type": "EventEmitter"
|
|
54039
54259
|
}
|
|
54040
54260
|
],
|
|
@@ -54047,7 +54267,7 @@
|
|
|
54047
54267
|
"type": "",
|
|
54048
54268
|
"optional": false,
|
|
54049
54269
|
"description": "",
|
|
54050
|
-
"line":
|
|
54270
|
+
"line": 623,
|
|
54051
54271
|
"modifierKind": [
|
|
54052
54272
|
125
|
|
54053
54273
|
]
|
|
@@ -54060,7 +54280,7 @@
|
|
|
54060
54280
|
"type": "string",
|
|
54061
54281
|
"optional": false,
|
|
54062
54282
|
"description": "",
|
|
54063
|
-
"line":
|
|
54283
|
+
"line": 624,
|
|
54064
54284
|
"modifierKind": [
|
|
54065
54285
|
125
|
|
54066
54286
|
]
|
|
@@ -54073,7 +54293,7 @@
|
|
|
54073
54293
|
"type": "",
|
|
54074
54294
|
"optional": false,
|
|
54075
54295
|
"description": "",
|
|
54076
|
-
"line":
|
|
54296
|
+
"line": 622,
|
|
54077
54297
|
"modifierKind": [
|
|
54078
54298
|
125
|
|
54079
54299
|
]
|
|
@@ -54086,7 +54306,7 @@
|
|
|
54086
54306
|
"type": "",
|
|
54087
54307
|
"optional": false,
|
|
54088
54308
|
"description": "<p>Controls if all checkboxes are viewed as selected.</p>\n",
|
|
54089
|
-
"line":
|
|
54309
|
+
"line": 609,
|
|
54090
54310
|
"rawdescription": "\n\nControls if all checkboxes are viewed as selected.\n"
|
|
54091
54311
|
},
|
|
54092
54312
|
{
|
|
@@ -54097,7 +54317,7 @@
|
|
|
54097
54317
|
"type": "",
|
|
54098
54318
|
"optional": false,
|
|
54099
54319
|
"description": "<p>Controls the indeterminate state of the header checkbox.</p>\n",
|
|
54100
|
-
"line":
|
|
54320
|
+
"line": 614,
|
|
54101
54321
|
"rawdescription": "\n\nControls the indeterminate state of the header checkbox.\n"
|
|
54102
54322
|
},
|
|
54103
54323
|
{
|
|
@@ -54108,7 +54328,7 @@
|
|
|
54108
54328
|
"type": "",
|
|
54109
54329
|
"optional": false,
|
|
54110
54330
|
"description": "<p>Allows table content to scroll horizontally</p>\n",
|
|
54111
|
-
"line":
|
|
54331
|
+
"line": 486,
|
|
54112
54332
|
"rawdescription": "\n\nAllows table content to scroll horizontally\n",
|
|
54113
54333
|
"decorators": [
|
|
54114
54334
|
{
|
|
@@ -54141,7 +54361,7 @@
|
|
|
54141
54361
|
"optional": false,
|
|
54142
54362
|
"returnType": "void",
|
|
54143
54363
|
"typeParameters": [],
|
|
54144
|
-
"line":
|
|
54364
|
+
"line": 825,
|
|
54145
54365
|
"deprecated": false,
|
|
54146
54366
|
"deprecationMessage": "",
|
|
54147
54367
|
"jsdoctags": [
|
|
@@ -54190,7 +54410,7 @@
|
|
|
54190
54410
|
"optional": false,
|
|
54191
54411
|
"returnType": "void",
|
|
54192
54412
|
"typeParameters": [],
|
|
54193
|
-
"line":
|
|
54413
|
+
"line": 830,
|
|
54194
54414
|
"deprecated": false,
|
|
54195
54415
|
"deprecationMessage": "",
|
|
54196
54416
|
"jsdoctags": [
|
|
@@ -54248,7 +54468,7 @@
|
|
|
54248
54468
|
"optional": false,
|
|
54249
54469
|
"returnType": "void",
|
|
54250
54470
|
"typeParameters": [],
|
|
54251
|
-
"line":
|
|
54471
|
+
"line": 835,
|
|
54252
54472
|
"deprecated": false,
|
|
54253
54473
|
"deprecationMessage": "",
|
|
54254
54474
|
"jsdoctags": [
|
|
@@ -54306,7 +54526,7 @@
|
|
|
54306
54526
|
"optional": false,
|
|
54307
54527
|
"returnType": "void",
|
|
54308
54528
|
"typeParameters": [],
|
|
54309
|
-
"line":
|
|
54529
|
+
"line": 839,
|
|
54310
54530
|
"deprecated": false,
|
|
54311
54531
|
"deprecationMessage": "",
|
|
54312
54532
|
"jsdoctags": [
|
|
@@ -54358,7 +54578,7 @@
|
|
|
54358
54578
|
"optional": false,
|
|
54359
54579
|
"returnType": "void",
|
|
54360
54580
|
"typeParameters": [],
|
|
54361
|
-
"line":
|
|
54581
|
+
"line": 819,
|
|
54362
54582
|
"deprecated": false,
|
|
54363
54583
|
"deprecationMessage": "",
|
|
54364
54584
|
"jsdoctags": [
|
|
@@ -54407,7 +54627,7 @@
|
|
|
54407
54627
|
"optional": false,
|
|
54408
54628
|
"returnType": "void",
|
|
54409
54629
|
"typeParameters": [],
|
|
54410
|
-
"line":
|
|
54630
|
+
"line": 847,
|
|
54411
54631
|
"deprecated": false,
|
|
54412
54632
|
"deprecationMessage": "",
|
|
54413
54633
|
"jsdoctags": [
|
|
@@ -54459,7 +54679,7 @@
|
|
|
54459
54679
|
"optional": false,
|
|
54460
54680
|
"returnType": "void",
|
|
54461
54681
|
"typeParameters": [],
|
|
54462
|
-
"line":
|
|
54682
|
+
"line": 800,
|
|
54463
54683
|
"deprecated": false,
|
|
54464
54684
|
"deprecationMessage": "",
|
|
54465
54685
|
"jsdoctags": [
|
|
@@ -54502,7 +54722,7 @@
|
|
|
54502
54722
|
"optional": false,
|
|
54503
54723
|
"returnType": "void",
|
|
54504
54724
|
"typeParameters": [],
|
|
54505
|
-
"line":
|
|
54725
|
+
"line": 795,
|
|
54506
54726
|
"deprecated": false,
|
|
54507
54727
|
"deprecationMessage": "",
|
|
54508
54728
|
"jsdoctags": [
|
|
@@ -54545,7 +54765,7 @@
|
|
|
54545
54765
|
"optional": false,
|
|
54546
54766
|
"returnType": "void",
|
|
54547
54767
|
"typeParameters": [],
|
|
54548
|
-
"line":
|
|
54768
|
+
"line": 782,
|
|
54549
54769
|
"deprecated": false,
|
|
54550
54770
|
"deprecationMessage": "",
|
|
54551
54771
|
"jsdoctags": [
|
|
@@ -54575,7 +54795,7 @@
|
|
|
54575
54795
|
"optional": false,
|
|
54576
54796
|
"returnType": "void",
|
|
54577
54797
|
"typeParameters": [],
|
|
54578
|
-
"line":
|
|
54798
|
+
"line": 710,
|
|
54579
54799
|
"deprecated": false,
|
|
54580
54800
|
"deprecationMessage": ""
|
|
54581
54801
|
},
|
|
@@ -54592,7 +54812,7 @@
|
|
|
54592
54812
|
"optional": false,
|
|
54593
54813
|
"returnType": "void",
|
|
54594
54814
|
"typeParameters": [],
|
|
54595
|
-
"line":
|
|
54815
|
+
"line": 858,
|
|
54596
54816
|
"deprecated": false,
|
|
54597
54817
|
"deprecationMessage": "",
|
|
54598
54818
|
"jsdoctags": [
|
|
@@ -54613,7 +54833,7 @@
|
|
|
54613
54833
|
"optional": false,
|
|
54614
54834
|
"returnType": "void",
|
|
54615
54835
|
"typeParameters": [],
|
|
54616
|
-
"line":
|
|
54836
|
+
"line": 680,
|
|
54617
54837
|
"deprecated": false,
|
|
54618
54838
|
"deprecationMessage": ""
|
|
54619
54839
|
},
|
|
@@ -54630,7 +54850,7 @@
|
|
|
54630
54850
|
"optional": false,
|
|
54631
54851
|
"returnType": "void",
|
|
54632
54852
|
"typeParameters": [],
|
|
54633
|
-
"line":
|
|
54853
|
+
"line": 294,
|
|
54634
54854
|
"deprecated": false,
|
|
54635
54855
|
"deprecationMessage": "",
|
|
54636
54856
|
"modifierKind": [
|
|
@@ -54654,7 +54874,7 @@
|
|
|
54654
54874
|
"optional": false,
|
|
54655
54875
|
"returnType": "any",
|
|
54656
54876
|
"typeParameters": [],
|
|
54657
|
-
"line":
|
|
54877
|
+
"line": 894,
|
|
54658
54878
|
"deprecated": false,
|
|
54659
54879
|
"deprecationMessage": ""
|
|
54660
54880
|
},
|
|
@@ -54664,7 +54884,7 @@
|
|
|
54664
54884
|
"optional": false,
|
|
54665
54885
|
"returnType": "any",
|
|
54666
54886
|
"typeParameters": [],
|
|
54667
|
-
"line":
|
|
54887
|
+
"line": 898,
|
|
54668
54888
|
"deprecated": false,
|
|
54669
54889
|
"deprecationMessage": ""
|
|
54670
54890
|
},
|
|
@@ -54674,7 +54894,7 @@
|
|
|
54674
54894
|
"optional": false,
|
|
54675
54895
|
"returnType": "any",
|
|
54676
54896
|
"typeParameters": [],
|
|
54677
|
-
"line":
|
|
54897
|
+
"line": 902,
|
|
54678
54898
|
"deprecated": false,
|
|
54679
54899
|
"deprecationMessage": ""
|
|
54680
54900
|
},
|
|
@@ -54684,7 +54904,7 @@
|
|
|
54684
54904
|
"optional": false,
|
|
54685
54905
|
"returnType": "any",
|
|
54686
54906
|
"typeParameters": [],
|
|
54687
|
-
"line":
|
|
54907
|
+
"line": 884,
|
|
54688
54908
|
"deprecated": false,
|
|
54689
54909
|
"deprecationMessage": ""
|
|
54690
54910
|
},
|
|
@@ -54694,7 +54914,7 @@
|
|
|
54694
54914
|
"optional": false,
|
|
54695
54915
|
"returnType": "any",
|
|
54696
54916
|
"typeParameters": [],
|
|
54697
|
-
"line":
|
|
54917
|
+
"line": 910,
|
|
54698
54918
|
"deprecated": false,
|
|
54699
54919
|
"deprecationMessage": ""
|
|
54700
54920
|
},
|
|
@@ -54704,7 +54924,7 @@
|
|
|
54704
54924
|
"optional": false,
|
|
54705
54925
|
"returnType": "any",
|
|
54706
54926
|
"typeParameters": [],
|
|
54707
|
-
"line":
|
|
54927
|
+
"line": 906,
|
|
54708
54928
|
"deprecated": false,
|
|
54709
54929
|
"deprecationMessage": ""
|
|
54710
54930
|
},
|
|
@@ -54721,7 +54941,7 @@
|
|
|
54721
54941
|
"optional": false,
|
|
54722
54942
|
"returnType": "{ value: any; }",
|
|
54723
54943
|
"typeParameters": [],
|
|
54724
|
-
"line":
|
|
54944
|
+
"line": 877,
|
|
54725
54945
|
"deprecated": false,
|
|
54726
54946
|
"deprecationMessage": "",
|
|
54727
54947
|
"jsdoctags": [
|
|
@@ -54742,7 +54962,7 @@
|
|
|
54742
54962
|
"optional": false,
|
|
54743
54963
|
"returnType": "any",
|
|
54744
54964
|
"typeParameters": [],
|
|
54745
|
-
"line":
|
|
54965
|
+
"line": 890,
|
|
54746
54966
|
"deprecated": false,
|
|
54747
54967
|
"deprecationMessage": ""
|
|
54748
54968
|
},
|
|
@@ -54752,7 +54972,7 @@
|
|
|
54752
54972
|
"optional": false,
|
|
54753
54973
|
"returnType": "any",
|
|
54754
54974
|
"typeParameters": [],
|
|
54755
|
-
"line":
|
|
54975
|
+
"line": 887,
|
|
54756
54976
|
"deprecated": false,
|
|
54757
54977
|
"deprecationMessage": ""
|
|
54758
54978
|
},
|
|
@@ -54762,7 +54982,7 @@
|
|
|
54762
54982
|
"optional": false,
|
|
54763
54983
|
"returnType": "void",
|
|
54764
54984
|
"typeParameters": [],
|
|
54765
|
-
"line":
|
|
54985
|
+
"line": 726,
|
|
54766
54986
|
"deprecated": false,
|
|
54767
54987
|
"deprecationMessage": ""
|
|
54768
54988
|
},
|
|
@@ -54779,7 +54999,7 @@
|
|
|
54779
54999
|
"optional": false,
|
|
54780
55000
|
"returnType": "void",
|
|
54781
55001
|
"typeParameters": [],
|
|
54782
|
-
"line":
|
|
55002
|
+
"line": 745,
|
|
54783
55003
|
"deprecated": false,
|
|
54784
55004
|
"deprecationMessage": "",
|
|
54785
55005
|
"jsdoctags": [
|
|
@@ -54807,7 +55027,7 @@
|
|
|
54807
55027
|
"optional": false,
|
|
54808
55028
|
"returnType": "void",
|
|
54809
55029
|
"typeParameters": [],
|
|
54810
|
-
"line":
|
|
55030
|
+
"line": 809,
|
|
54811
55031
|
"deprecated": false,
|
|
54812
55032
|
"deprecationMessage": "",
|
|
54813
55033
|
"rawdescription": "\n\nTriggered when the user scrolls on the `<tbody>` element.\nEmits the `scrollLoad` event.\n",
|
|
@@ -54830,7 +55050,7 @@
|
|
|
54830
55050
|
"optional": false,
|
|
54831
55051
|
"returnType": "void",
|
|
54832
55052
|
"typeParameters": [],
|
|
54833
|
-
"line":
|
|
55053
|
+
"line": 721,
|
|
54834
55054
|
"deprecated": false,
|
|
54835
55055
|
"deprecationMessage": ""
|
|
54836
55056
|
},
|
|
@@ -54847,7 +55067,7 @@
|
|
|
54847
55067
|
"optional": false,
|
|
54848
55068
|
"returnType": "void",
|
|
54849
55069
|
"typeParameters": [],
|
|
54850
|
-
"line":
|
|
55070
|
+
"line": 731,
|
|
54851
55071
|
"deprecated": false,
|
|
54852
55072
|
"deprecationMessage": "",
|
|
54853
55073
|
"jsdoctags": [
|
|
@@ -54876,7 +55096,7 @@
|
|
|
54876
55096
|
"optional": false,
|
|
54877
55097
|
"returnType": "void",
|
|
54878
55098
|
"typeParameters": [],
|
|
54879
|
-
"line":
|
|
55099
|
+
"line": 765,
|
|
54880
55100
|
"deprecated": false,
|
|
54881
55101
|
"deprecationMessage": "",
|
|
54882
55102
|
"jsdoctags": [
|
|
@@ -54905,7 +55125,7 @@
|
|
|
54905
55125
|
"optional": false,
|
|
54906
55126
|
"returnType": "void",
|
|
54907
55127
|
"typeParameters": [],
|
|
54908
|
-
"line":
|
|
55128
|
+
"line": 872,
|
|
54909
55129
|
"deprecated": false,
|
|
54910
55130
|
"deprecationMessage": "",
|
|
54911
55131
|
"rawdescription": "\n\nTriggered when the user scrolls on the `<tbody>` element.\nEmits the `scrollLoad` event.\n",
|
|
@@ -54941,7 +55161,7 @@
|
|
|
54941
55161
|
"optional": false,
|
|
54942
55162
|
"returnType": "void",
|
|
54943
55163
|
"typeParameters": [],
|
|
54944
|
-
"line":
|
|
55164
|
+
"line": 283,
|
|
54945
55165
|
"deprecated": false,
|
|
54946
55166
|
"deprecationMessage": "",
|
|
54947
55167
|
"modifierKind": [
|
|
@@ -54987,7 +55207,7 @@
|
|
|
54987
55207
|
"optional": false,
|
|
54988
55208
|
"returnType": "any",
|
|
54989
55209
|
"typeParameters": [],
|
|
54990
|
-
"line":
|
|
55210
|
+
"line": 264,
|
|
54991
55211
|
"deprecated": false,
|
|
54992
55212
|
"deprecationMessage": "",
|
|
54993
55213
|
"rawdescription": "\n\nCreates a skeleton model with a row and column count specified by the user\n\nExample:\n\n```typescript\nthis.model = Table.skeletonModel(5, 5);\n```\n",
|
|
@@ -55022,7 +55242,7 @@
|
|
|
55022
55242
|
"optional": false,
|
|
55023
55243
|
"returnType": "void",
|
|
55024
55244
|
"typeParameters": [],
|
|
55025
|
-
"line":
|
|
55245
|
+
"line": 749,
|
|
55026
55246
|
"deprecated": false,
|
|
55027
55247
|
"deprecationMessage": ""
|
|
55028
55248
|
}
|
|
@@ -55037,7 +55257,7 @@
|
|
|
55037
55257
|
"deprecationMessage": "",
|
|
55038
55258
|
"rawdescription": "\n\nAllows table content to scroll horizontally\n",
|
|
55039
55259
|
"description": "<p>Allows table content to scroll horizontally</p>\n",
|
|
55040
|
-
"line":
|
|
55260
|
+
"line": 486,
|
|
55041
55261
|
"type": "boolean",
|
|
55042
55262
|
"decorators": []
|
|
55043
55263
|
}
|
|
@@ -55048,7 +55268,7 @@
|
|
|
55048
55268
|
"description": "<p>Build your table with this component by extending things that differ from default.</p>\n<p><a href=\"../../?path=/story/components-table--basic\">See demo</a></p>\n<p>Instead of the usual write-your-own-html approach you had with <code><table></code>,\ncarbon table uses model-view-controller approach.</p>\n<p>Here, you create a view (with built-in controller) and provide it a model.\nChanges you make to the model are reflected in the view. Provide same model you use\nin the table to the <code><cds-pagination></code> components.\nThey provide a different view over the same data.</p>\n<h2>Basic usage</h2>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-html\"><cds-table [model]="model"></cds-table></code></pre></div><b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">public model = new TableModel();\n\nthis.model.data = [\n [new TableItem({data: "asdf"}), new TableItem({data: "qwer"})],\n [new TableItem({data: "csdf"}), new TableItem({data: "zwer"})],\n [new TableItem({data: "bsdf"}), new TableItem({data: "swer"})],\n [new TableItem({data: "csdf"}), new TableItem({data: "twer"})]\n];</code></pre></div><h2>Customization</h2>\n<p>If you have custom data in your table, you need a way to display it. You can do that\nby providing a template to <code>TableItem</code>.</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-html\"><ng-template #customTableItemTemplate let-data="data">\n <a [routerLink]="data.link">{{data.name}} {{data.surname}}</a>\n</ng-template></code></pre></div><b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">customTableItemTemplate: TemplateRef<any>;\n\nthis.customModel.data = [\n [new TableItem({data: "asdf"}), new TableItem({data: {name: "Lessy", link: "/table"}, template: this.customTableItemTemplate})],\n [new TableItem({data: "csdf"}), new TableItem({data: "swer"})],\n [new TableItem({data: "bsdf"}), new TableItem({data: {name: "Alice", surname: "Bob"}, template: this.customTableItemTemplate})],\n [new TableItem({data: "csdf"}), new TableItem({data: "twer"})],\n];</code></pre></div><h3>Sorting and filtering</h3>\n<p>In case you need custom sorting and/or filtering you should subclass <code>TableHeaderItem</code>\nand override needed functions.</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">class FilterableHeaderItem extends TableHeaderItem {\n // custom filter function\n filter(item: TableItem): boolean {\n if (typeof item.data === "string" && item.data.toLowerCase().indexOf(this.filterData.data.toLowerCase()) >= 0 ||\n item.data.name && item.data.name.toLowerCase().indexOf(this.filterData.data.toLowerCase()) >= 0 ||\n item.data.surname && item.data.surname.toLowerCase().indexOf(this.filterData.data.toLowerCase()) >= 0) {\n return false;\n }\n return true;\n }\n\n set filterCount(n) {}\n get filterCount() {\n return (this.filterData && this.filterData.data && this.filterData.data.length > 0) ? 1 : 0;\n }\n\n // used for custom sorting\n compare(one: TableItem, two: TableItem) {\n const stringOne = (one.data.name || one.data.surname || one.data).toLowerCase();\n const stringTwo = (two.data.name || two.data.surname || two.data).toLowerCase();\n\n if (stringOne > stringTwo) {\n return 1;\n } else if (stringOne < stringTwo) {\n return -1;\n } else {\n return 0;\n }\n }\n}</code></pre></div><p>If you want to do your sorting on the backend or query for sorted data as a result of user\nclicking the table header, check table <a href=\"#sort\"><code>sort</code></a> output documentation</p>\n<p>See <code>TableHeaderItem</code> class for more information.</p>\n<h2>No data template</h2>\n<p>When table has no data to show, it can show a message you provide it instead.</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-html\"><cds-table [model]="model">No data.</cds-table></code></pre></div><p>... will show <code>No data.</code> message, but you can get creative and provide any template you want\nto replace table's default <code>tbody</code>.</p>\n<h2>Use pagination as table footer</h2>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-html\"><cds-pagination [model]="model" (selectPage)="selectPage($event)"></cds-pagination></code></pre></div><p><code>selectPage()</code> function should fetch the data from backend, create new <code>data</code>, apply it to <code>model.data</code>,\nand update <code>model.currentPage</code>.</p>\n<p>If the data your server returns is a two dimensional array of objects, it would look something like this:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">selectPage(page) {\n this.getPage(page).then((data: Array<Array<any>>) => {\n // set the data and update page\n this.model.data = this.prepareData(data);\n this.model.currentPage = page;\n });\n}\n\nprotected prepareData(data: Array<Array<any>>) {\n // create new data from the service data\n let newData = [];\n data.forEach(dataRow => {\n let row = [];\n dataRow.forEach(dataElement => {\n row.push(new TableItem({\n data: dataElement,\n template: typeof dataElement === "string" ? undefined : this.paginationTableItemTemplate\n // your template can handle all the data types so you don't have to conditionally set it\n // you can also set different templates for different columns based on index\n }));\n });\n newData.push(row);\n });\n return newData;\n}</code></pre></div>",
|
|
55049
55269
|
"rawdescription": "\n\nBuild your table with this component by extending things that differ from default.\n\n[See demo](../../?path=/story/components-table--basic)\n\nInstead of the usual write-your-own-html approach you had with `<table>`,\ncarbon table uses model-view-controller approach.\n\nHere, you create a view (with built-in controller) and provide it a model.\nChanges you make to the model are reflected in the view. Provide same model you use\nin the table to the `<cds-pagination>` components.\nThey provide a different view over the same data.\n\n## Basic usage\n\n```html\n<cds-table [model]=\"model\"></cds-table>\n```\n\n```typescript\npublic model = new TableModel();\n\nthis.model.data = [\n\t[new TableItem({data: \"asdf\"}), new TableItem({data: \"qwer\"})],\n\t[new TableItem({data: \"csdf\"}), new TableItem({data: \"zwer\"})],\n\t[new TableItem({data: \"bsdf\"}), new TableItem({data: \"swer\"})],\n\t[new TableItem({data: \"csdf\"}), new TableItem({data: \"twer\"})]\n];\n```\n\n## Customization\n\nIf you have custom data in your table, you need a way to display it. You can do that\nby providing a template to `TableItem`.\n\n```html\n<ng-template #customTableItemTemplate let-data=\"data\">\n\t<a [routerLink]=\"data.link\">{{data.name}} {{data.surname}}</a>\n</ng-template>\n```\n\n```typescript\ncustomTableItemTemplate: TemplateRef<any>;\n\nthis.customModel.data = [\n\t[new TableItem({data: \"asdf\"}), new TableItem({data: {name: \"Lessy\", link: \"/table\"}, template: this.customTableItemTemplate})],\n\t[new TableItem({data: \"csdf\"}), new TableItem({data: \"swer\"})],\n\t[new TableItem({data: \"bsdf\"}), new TableItem({data: {name: \"Alice\", surname: \"Bob\"}, template: this.customTableItemTemplate})],\n\t[new TableItem({data: \"csdf\"}), new TableItem({data: \"twer\"})],\n];\n```\n\n### Sorting and filtering\n\nIn case you need custom sorting and/or filtering you should subclass `TableHeaderItem`\nand override needed functions.\n\n```typescript\nclass FilterableHeaderItem extends TableHeaderItem {\n\t// custom filter function\n\tfilter(item: TableItem): boolean {\n\t\tif (typeof item.data === \"string\" && item.data.toLowerCase().indexOf(this.filterData.data.toLowerCase()) >= 0 ||\n\t\titem.data.name && item.data.name.toLowerCase().indexOf(this.filterData.data.toLowerCase()) >= 0 ||\n\t\titem.data.surname && item.data.surname.toLowerCase().indexOf(this.filterData.data.toLowerCase()) >= 0) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tset filterCount(n) {}\n\tget filterCount() {\n\t\treturn (this.filterData && this.filterData.data && this.filterData.data.length > 0) ? 1 : 0;\n\t}\n\n\t// used for custom sorting\n\tcompare(one: TableItem, two: TableItem) {\n\t\tconst stringOne = (one.data.name || one.data.surname || one.data).toLowerCase();\n\t\tconst stringTwo = (two.data.name || two.data.surname || two.data).toLowerCase();\n\n\t\tif (stringOne > stringTwo) {\n\t\t\treturn 1;\n\t\t} else if (stringOne < stringTwo) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n}\n```\n\nIf you want to do your sorting on the backend or query for sorted data as a result of user\nclicking the table header, check table [`sort`](#sort) output documentation\n\nSee `TableHeaderItem` class for more information.\n\n## No data template\n\nWhen table has no data to show, it can show a message you provide it instead.\n\n```html\n<cds-table [model]=\"model\">No data.</cds-table>\n```\n\n... will show `No data.` message, but you can get creative and provide any template you want\nto replace table's default `tbody`.\n\n## Use pagination as table footer\n\n```html\n<cds-pagination [model]=\"model\" (selectPage)=\"selectPage($event)\"></cds-pagination>\n```\n\n`selectPage()` function should fetch the data from backend, create new `data`, apply it to `model.data`,\nand update `model.currentPage`.\n\nIf the data your server returns is a two dimensional array of objects, it would look something like this:\n\n```typescript\nselectPage(page) {\n\tthis.getPage(page).then((data: Array<Array<any>>) => {\n\t\t// set the data and update page\n\t\tthis.model.data = this.prepareData(data);\n\t\tthis.model.currentPage = page;\n\t});\n}\n\nprotected prepareData(data: Array<Array<any>>) {\n\t// create new data from the service data\n\tlet newData = [];\n\tdata.forEach(dataRow => {\n\t\tlet row = [];\n\t\tdataRow.forEach(dataElement => {\n\t\t\trow.push(new TableItem({\n\t\t\t\tdata: dataElement,\n\t\t\t\ttemplate: typeof dataElement === \"string\" ? undefined : this.paginationTableItemTemplate\n\t\t\t\t// your template can handle all the data types so you don't have to conditionally set it\n\t\t\t\t// you can also set different templates for different columns based on index\n\t\t\t}));\n\t\t});\n\t\tnewData.push(row);\n\t});\n\treturn newData;\n}\n```\n",
|
|
55050
55270
|
"type": "component",
|
|
55051
|
-
"sourceCode": "import {\n\tComponent,\n\tApplicationRef,\n\tInput,\n\tOnInit,\n\tOutput,\n\tEventEmitter,\n\tElementRef,\n\tAfterViewInit,\n\tTemplateRef,\n\tOnDestroy,\n\tHostBinding\n} from \"@angular/core\";\nimport { Subscription, fromEvent, Observable } from \"rxjs\";\n\nimport { TableModel } from \"./table-model.class\";\nimport { TableHeaderItem } from \"./table-header-item.class\";\nimport { TableItem } from \"./table-item.class\";\n\nimport { getFocusElementList, tabbableSelectorIgnoreTabIndex } from \"carbon-components-angular/common\";\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { merge } from \"carbon-components-angular/utils\";\nimport { DataGridInteractionModel } from \"./data-grid-interaction-model.class\";\nimport { TableDomAdapter } from \"./table-adapter.class\";\nimport { TableRowSize } from \"./table.types\";\n\n/**\n * Build your table with this component by extending things that differ from default.\n *\n * [See demo](../../?path=/story/components-table--basic)\n *\n * Instead of the usual write-your-own-html approach you had with `<table>`,\n * carbon table uses model-view-controller approach.\n *\n * Here, you create a view (with built-in controller) and provide it a model.\n * Changes you make to the model are reflected in the view. Provide same model you use\n * in the table to the `<cds-pagination>` components.\n * They provide a different view over the same data.\n *\n * ## Basic usage\n *\n * ```html\n * <cds-table [model]=\"model\"></cds-table>\n * ```\n *\n * ```typescript\n * public model = new TableModel();\n *\n * this.model.data = [\n * \t[new TableItem({data: \"asdf\"}), new TableItem({data: \"qwer\"})],\n * \t[new TableItem({data: \"csdf\"}), new TableItem({data: \"zwer\"})],\n * \t[new TableItem({data: \"bsdf\"}), new TableItem({data: \"swer\"})],\n * \t[new TableItem({data: \"csdf\"}), new TableItem({data: \"twer\"})]\n * ];\n * ```\n *\n * ## Customization\n *\n * If you have custom data in your table, you need a way to display it. You can do that\n * by providing a template to `TableItem`.\n *\n * ```html\n * <ng-template #customTableItemTemplate let-data=\"data\">\n * \t<a [routerLink]=\"data.link\">{{data.name}} {{data.surname}}</a>\n * </ng-template>\n * ```\n *\n * ```typescript\n * customTableItemTemplate: TemplateRef<any>;\n *\n * this.customModel.data = [\n * \t[new TableItem({data: \"asdf\"}), new TableItem({data: {name: \"Lessy\", link: \"/table\"}, template: this.customTableItemTemplate})],\n * \t[new TableItem({data: \"csdf\"}), new TableItem({data: \"swer\"})],\n * \t[new TableItem({data: \"bsdf\"}), new TableItem({data: {name: \"Alice\", surname: \"Bob\"}, template: this.customTableItemTemplate})],\n * \t[new TableItem({data: \"csdf\"}), new TableItem({data: \"twer\"})],\n * ];\n * ```\n *\n * ### Sorting and filtering\n *\n * In case you need custom sorting and/or filtering you should subclass `TableHeaderItem`\n * and override needed functions.\n *\n * ```typescript\n * class FilterableHeaderItem extends TableHeaderItem {\n * \t// custom filter function\n * \tfilter(item: TableItem): boolean {\n * \t\tif (typeof item.data === \"string\" && item.data.toLowerCase().indexOf(this.filterData.data.toLowerCase()) >= 0 ||\n * \t\titem.data.name && item.data.name.toLowerCase().indexOf(this.filterData.data.toLowerCase()) >= 0 ||\n * \t\titem.data.surname && item.data.surname.toLowerCase().indexOf(this.filterData.data.toLowerCase()) >= 0) {\n * \t\t\treturn false;\n * \t\t}\n * \t\treturn true;\n * \t}\n *\n * \tset filterCount(n) {}\n * \tget filterCount() {\n * \t\treturn (this.filterData && this.filterData.data && this.filterData.data.length > 0) ? 1 : 0;\n * \t}\n *\n * \t// used for custom sorting\n * \tcompare(one: TableItem, two: TableItem) {\n * \t\tconst stringOne = (one.data.name || one.data.surname || one.data).toLowerCase();\n * \t\tconst stringTwo = (two.data.name || two.data.surname || two.data).toLowerCase();\n *\n * \t\tif (stringOne > stringTwo) {\n * \t\t\treturn 1;\n * \t\t} else if (stringOne < stringTwo) {\n * \t\t\treturn -1;\n * \t\t} else {\n * \t\t\treturn 0;\n * \t\t}\n * \t}\n * }\n * ```\n *\n * If you want to do your sorting on the backend or query for sorted data as a result of user\n * clicking the table header, check table [`sort`](#sort) output documentation\n *\n * See `TableHeaderItem` class for more information.\n *\n * ## No data template\n *\n * When table has no data to show, it can show a message you provide it instead.\n *\n * ```html\n * <cds-table [model]=\"model\">No data.</cds-table>\n * ```\n *\n * ... will show `No data.` message, but you can get creative and provide any template you want\n * to replace table's default `tbody`.\n *\n * ## Use pagination as table footer\n *\n * ```html\n * <cds-pagination [model]=\"model\" (selectPage)=\"selectPage($event)\"></cds-pagination>\n * ```\n *\n * `selectPage()` function should fetch the data from backend, create new `data`, apply it to `model.data`,\n * and update `model.currentPage`.\n *\n * If the data your server returns is a two dimensional array of objects, it would look something like this:\n *\n * ```typescript\n * selectPage(page) {\n * \tthis.getPage(page).then((data: Array<Array<any>>) => {\n * \t\t// set the data and update page\n * \t\tthis.model.data = this.prepareData(data);\n * \t\tthis.model.currentPage = page;\n * \t});\n * }\n *\n * protected prepareData(data: Array<Array<any>>) {\n * \t// create new data from the service data\n * \tlet newData = [];\n * \tdata.forEach(dataRow => {\n * \t\tlet row = [];\n * \t\tdataRow.forEach(dataElement => {\n * \t\t\trow.push(new TableItem({\n * \t\t\t\tdata: dataElement,\n * \t\t\t\ttemplate: typeof dataElement === \"string\" ? undefined : this.paginationTableItemTemplate\n * \t\t\t\t// your template can handle all the data types so you don't have to conditionally set it\n * \t\t\t\t// you can also set different templates for different columns based on index\n * \t\t\t}));\n * \t\t});\n * \t\tnewData.push(row);\n * \t});\n * \treturn newData;\n * }\n * ```\n */\n@Component({\n\tselector: \"cds-table, ibm-table\",\n\ttemplate: `\n\t<table\n\t\tcdsTable\n\t\t[sortable]=\"sortable\"\n\t\t[noBorder]=\"noBorder\"\n\t\t[ngClass]=\"{'cds--data-table--sticky-header': stickyHeader}\"\n\t\t[size]=\"size\"\n\t\t[striped]=\"striped\"\n\t\t[skeleton]=\"skeleton\"\n\t\t[attr.aria-labelledby]=\"ariaLabelledby\"\n\t\t[attr.aria-describedby]=\"ariaDescribedby\">\n\t\t<thead\n\t\t\tcdsTableHead\n\t\t\t[sortable]=\"sortable\"\n\t\t\t(deselectAll)=\"onDeselectAll()\"\n\t\t\t(selectAll)=\"onSelectAll()\"\n\t\t\t(sort)=\"doSort($event)\"\n\t\t\t[checkboxHeaderLabel]=\"getCheckboxHeaderLabel()\"\n\t\t\t[filterTitle]=\"getFilterTitle()\"\n\t\t\t[model]=\"model\"\n\t\t\t[selectAllCheckbox]=\"selectAllCheckbox\"\n\t\t\t[selectAllCheckboxSomeSelected]=\"selectAllCheckboxSomeSelected\"\n\t\t\t[showSelectionColumn]=\"showSelectionColumn\"\n\t\t\t[enableSingleSelect]=\"enableSingleSelect\"\n\t\t\t[skeleton]=\"skeleton\"\n\t\t\t[sortAscendingLabel]=\"sortAscendingLabel\"\n\t\t\t[sortDescendingLabel]=\"sortDescendingLabel\"\n\t\t\t[stickyHeader]=\"stickyHeader\">\n\t\t</thead>\n\t\t<tbody\n\t\t\tcdsTableBody\n\t\t\t(deselectRow)=\"onSelectRow($event)\"\n\t\t\t(scroll)=\"onScroll($event)\"\n\t\t\t(selectRow)=\"onSelectRow($event)\"\n\t\t\t[checkboxRowLabel]=\"getCheckboxRowLabel()\"\n\t\t\t[enableSingleSelect]=\"enableSingleSelect\"\n\t\t\t(rowClick)=\"onRowClick($event)\"\n\t\t\t[expandButtonAriaLabel]=\"expandButtonAriaLabel\"\n\t\t\t[model]=\"model\"\n\t\t\t[size]=\"size\"\n\t\t\t[ngStyle]=\"{'overflow-y': 'scroll'}\"\n\t\t\t[selectionLabelColumn]=\"selectionLabelColumn\"\n\t\t\t[showSelectionColumn]=\"showSelectionColumn\"\n\t\t\t[skeleton]=\"skeleton\"\n\t\t\t*ngIf=\"!noData; else noDataTemplate\">\n\t\t</tbody>\n\t\t<ng-template #noDataTemplate><ng-content></ng-content></ng-template>\n\t\t<tfoot>\n\t\t\t<ng-template\n\t\t\t\t[ngTemplateOutlet]=\"footerTemplate\">\n\t\t\t</ng-template>\n\t\t\t<tr *ngIf=\"this.model.isLoading\">\n\t\t\t\t<td class=\"table_loading-indicator\">\n\t\t\t\t\t<div class=\"cds--loading cds--loading--small\">\n\t\t\t\t\t\t<svg class=\"cds--loading__svg\" viewBox=\"-75 -75 150 150\">\n\t\t\t\t\t\t\t<circle class=\"cds--loading__stroke\" cx=\"0\" cy=\"0\" r=\"37.5\" />\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr *ngIf=\"this.model.isEnd\">\n\t\t\t\t<td class=\"table_end-indicator\">\n\t\t\t\t\t<h5>{{getEndOfDataText() | async}}</h5>\n\t\t\t\t\t<button (click)=\"scrollToTop($event)\" class=\"btn--secondary-sm\">\n\t\t\t\t\t\t{{getScrollTopText() | async}}\n\t\t\t\t\t</button>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tfoot>\n\t</table>\n\t`,\n\tstyles: [`\n\t\t:host {\n\t\t\tdisplay: block;\n\t\t}\n\t`]\n})\nexport class Table implements OnInit, AfterViewInit, OnDestroy {\n\t/**\n\t * Creates a skeleton model with a row and column count specified by the user\n\t *\n\t * Example:\n\t *\n\t * ```typescript\n\t * this.model = Table.skeletonModel(5, 5);\n\t * ```\n\t */\n\tstatic skeletonModel(rowCount: number, columnCount: number) {\n\t\tconst model = new TableModel();\n\t\tlet header = new Array<TableHeaderItem>();\n\t\tlet data = new Array<Array<TableItem>>();\n\t\tlet row = new Array<TableItem>();\n\n\t\tfor (let i = 0; i < columnCount; i++) {\n\t\t\theader.push(new TableHeaderItem());\n\t\t\trow.push(new TableItem());\n\t\t}\n\t\tfor (let i = 0; i < rowCount - 1; i++) {\n\t\t\tdata.push(row);\n\t\t}\n\n\t\tmodel.header = header;\n\t\tmodel.data = data;\n\t\treturn model;\n\t}\n\n\tstatic setTabIndex(element: HTMLElement, index: -1 | 0) {\n\t\tconst focusElementList = getFocusElementList(element, tabbableSelectorIgnoreTabIndex);\n\t\tif (element.firstElementChild && element.firstElementChild.classList.contains(\"cds--table-sort\") && focusElementList.length > 1) {\n\t\t\tfocusElementList[1].tabIndex = index;\n\t\t} else if (focusElementList.length > 0) {\n\t\t\tfocusElementList[0].tabIndex = index;\n\t\t} else {\n\t\t\telement.tabIndex = index;\n\t\t}\n\t}\n\n\tstatic focus(element: HTMLElement) {\n\t\tconst focusElementList = getFocusElementList(element, tabbableSelectorIgnoreTabIndex);\n\t\tif (\n\t\t\t(element.firstElementChild?.classList.contains(\"cds--table-sort\") && focusElementList.length > 1) ||\n\t\t\tfocusElementList.length > 0\n\t\t) {\n\t\t\tfocusElementList[0].focus();\n\t\t} else {\n\t\t\telement.focus();\n\t\t}\n\t}\n\n\t/**\n\t * Id of the table header title element\n\t */\n\t@Input() ariaLabelledby: string;\n\t/**\n\t * Id of the table header description element\n\t */\n\t@Input() ariaDescribedby: string;\n\n\t/**\n\t * `TableModel` with data the table is to display.\n\t */\n\t@Input()\n\tset model(m: TableModel) {\n\t\tif (this._model) {\n\t\t\tthis.subscriptions.unsubscribe();\n\t\t\t// Need to create a new subscription instance here because unsubscribing prevents any new subscriptions\n\t\t\t// from being added for some reason. When a new model is set, none of the subscriptions would exist.\n\t\t\tthis.subscriptions = new Subscription();\n\t\t}\n\n\t\tthis._model = m;\n\n\t\tconst rowsChange = this._model.rowsSelectedChange.subscribe(() => this.updateSelectAllCheckbox());\n\t\tconst dataChange = this._model.dataChange.subscribe(() => {\n\t\t\tif (this.isDataGrid) {\n\t\t\t\tthis.resetTabIndex();\n\t\t\t}\n\t\t\tthis.updateSelectAllCheckbox();\n\t\t});\n\n\t\tthis.subscriptions.add(rowsChange);\n\t\tthis.subscriptions.add(dataChange);\n\n\t\tif (this.isDataGrid) {\n\t\t\tconst expandedChange = this._model.rowsExpandedChange.subscribe(() => {\n\t\t\t\t// Allows the expanded row to have a focus state when it exists in the DOM\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tconst expandedRows = this.elementRef.nativeElement.querySelectorAll(\".cds--expandable-row:not(.cds--parent-row)\");\n\t\t\t\t\tArray.from<any>(expandedRows).forEach(row => {\n\t\t\t\t\t\tif (row.firstElementChild.tabIndex === undefined || row.firstElementChild.tabIndex !== -1) {\n\t\t\t\t\t\t\trow.firstElementChild.tabIndex = -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t\tthis.subscriptions.add(expandedChange);\n\t\t}\n\t}\n\n\tget model(): TableModel {\n\t\treturn this._model;\n\t}\n\n\t/**\n\t * Size of the table rows.\n\t */\n\t@Input() size: TableRowSize = \"md\";\n\t/**\n\t * Set to `true` for a loading table.\n\t */\n\t@Input() skeleton = false;\n\t/**\n\t * Set to `true` for a data grid with keyboard interactions.\n\t */\n\t@Input() set isDataGrid(value: boolean) {\n\t\tthis._isDataGrid = value;\n\t\tif (this.isViewReady) {\n\t\t\tif (value) {\n\t\t\t\tthis.enableDataGridInteractions();\n\t\t\t} else {\n\t\t\t\tthis.disableDataGridInteractions();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Setting sortable to false will disable all headers including headers which are sortable. Is is\n\t * possible to set the sortable state on the header item to disable/enable sorting for only some headers.\n\t */\n\t@Input() sortable = true;\n\n\t@Input() noBorder = true;\n\n\tget isDataGrid(): boolean {\n\t\treturn this._isDataGrid;\n\t}\n\n\t/**\n\t * Controls whether to show the selection checkboxes column or not.\n\t */\n\t@Input() showSelectionColumn = true;\n\n\t/**\n\t * Controls whether to enable multiple or single row selection.\n\t */\n\t@Input() enableSingleSelect = false;\n\n\t/**\n\t * Distance (in px) from the bottom that view has to reach before\n\t * `scrollLoad` event is emitted.\n\t */\n\t@Input() scrollLoadDistance = 0;\n\n\t/**\n\t * @todo - Enable column resize when Carbon officially supports feature\n\t * Set to `true` to enable users to resize columns.\n\t *\n\t * Works for columns with width set in pixels.\n\t *\n\t */\n\t// @Input() columnsResizable = false;\n\n\t/**\n\t * @todo - Enable columns drag & drop when Carbon officially supports feature\n\t * Set to `true` to enable users to drag and drop columns.\n\t *\n\t * Changing the column order in table changes table model. Be aware of it when you add additional data\n\t * to the model.\n\t *\n\t */\n\t// @Input() columnsDraggable = false;\n\n\t@Input()\n\tset expandButtonAriaLabel(value: string | Observable<string>) {\n\t\tthis._expandButtonAriaLabel.override(value);\n\t}\n\tget expandButtonAriaLabel() {\n\t\treturn this._expandButtonAriaLabel.value;\n\t}\n\t@Input()\n\tset sortDescendingLabel(value: string | Observable<string>) {\n\t\tthis._sortDescendingLabel.override(value);\n\t}\n\tget sortDescendingLabel() {\n\t\treturn this._sortDescendingLabel.value;\n\t}\n\t@Input()\n\tset sortAscendingLabel(value: string | Observable<string>) {\n\t\tthis._sortAscendingLabel.override(value);\n\t}\n\tget sortAscendingLabel() {\n\t\treturn this._sortAscendingLabel.value;\n\t}\n\n\t/**\n\t * Expects an object that contains some or all of:\n\t * ```\n\t * {\n\t *\t\t\"FILTER\": \"Filter\",\n\t *\t\t\"END_OF_DATA\": \"You've reached the end of your content\",\n\t *\t\t\"SCROLL_TOP\": \"Scroll to top\",\n\t *\t\t\"CHECKBOX_HEADER\": \"Select all rows\",\n\t *\t\t\"CHECKBOX_ROW\": \"Select row\"\n\t * }\n\t * ```\n\t */\n\t@Input()\n\tset translations(value) {\n\t\tconst valueWithDefaults = merge(this.i18n.getMultiple(\"TABLE\"), value);\n\t\tthis._filterTitle.override(valueWithDefaults.FILTER);\n\t\tthis._endOfDataText.override(valueWithDefaults.END_OF_DATA);\n\t\tthis._scrollTopText.override(valueWithDefaults.SCROLL_TOP);\n\t\tthis._checkboxHeaderLabel.override(valueWithDefaults.CHECKBOX_HEADER);\n\t\tthis._checkboxRowLabel.override(valueWithDefaults.CHECKBOX_ROW);\n\t}\n\n\t/**\n\t * Set to `false` to remove table rows (zebra) stripes.\n\t */\n\t@Input() striped = true;\n\n\t/**\n\t * Allows table content to scroll horizontally\n\t */\n\t@HostBinding(\"class.cds--data-table-content\") tableContent = true;\n\n\t/**\n\t * Set to `true` to stick the header to the top of the table\n\t */\n\t@HostBinding(\"class.cds--data-table_inner-container\") @Input() stickyHeader = false;\n\n\t/**\n\t * Set footer template to customize what is displayed in the tfoot section of the table\n\t */\n\t@Input() footerTemplate: TemplateRef<any>;\n\n\t/**\n\t * Used to populate the row selection checkbox label with a useful value if set.\n\t *\n\t * Example:\n\t * ```\n\t * <cds-table [selectionLabelColumn]=\"0\"></cds-table>\n\t * <!-- results in aria-label=\"Select first column value\"\n\t * (where \"first column value\" is the value of the first column in the row -->\n\t * ```\n\t */\n\t@Input() selectionLabelColumn: number;\n\n\t/**\n\t * Emits an index of the column that wants to be sorted.\n\t *\n\t * If no observers are provided (default), table will attempt to do a simple sort of the data loaded\n\t * into the model.\n\t *\n\t * If an observer is provided, table will not attempt any sorting of its own and it is up to the observer\n\t * to sort the table. This is what you typically want if you're using a backend query to get the sorted\n\t * data or want to sort data across multiple pages.\n\t *\n\t * Usage:\n\t *\n\t * ```typescript\n\t * @Component({\n\t * \tselector: \"app-table\",\n\t * \ttemplate: `\n\t * \t\t<cds-table\n\t * \t\t\t[model]=\"model\"\n\t * \t\t\t(sort)=\"simpleSort($event)\">\n\t * \t\t\tNo data.\n\t * \t\t</cds-table>\n\t * \t`\n\t * })\n\t * export class TableApp implements OnInit, OnChanges {\n\t * \t@Input() model = new TableModel();\n\t *\n\t * \tngOnInit() {\n\t * \t\tthis.model.header = [\n\t * \t\t\tnew TableHeaderItem({ data: \"Name\" }),\n\t * \t\t\tnew TableHeaderItem({ data: \"hwer\" })\n\t * \t\t];\n\t *\n\t * \t\tthis.model.data = [\n\t * \t\t\t[new TableItem({ data: \"Name 1\" }), new TableItem({ data: \"qwer\" })],\n\t * \t\t\t[new TableItem({ data: \"Name 3\" }), new TableItem({ data: \"zwer\" })],\n\t * \t\t\t[new TableItem({ data: \"Name 2\" }), new TableItem({ data: \"swer\" })],\n\t * \t\t\t[new TableItem({ data: \"Name 4\" }), new TableItem({data: \"twer\"})],\n\t * \t\t\t[new TableItem({ data: \"Name 5\" }), new TableItem({data: \"twer\"})],\n\t * \t\t\t[new TableItem({ data: \"Name 6\" }), new TableItem({data: \"twer\"})]\n\t * \t\t];\n\t * \t}\n\t *\n\t * \tsimpleSort(index: number) {\n\t * \t\t// this function does a simple sort, which is the default for the table and if that's\n\t * \t\t// all you want, you don't need to do this.\n\t *\n\t * \t\t// here you can query your backend and update the model.data based on the result\n\t * \t\tif (this.model.header[index].sorted) {\n\t * \t\t\t// if already sorted flip sorting direction\n\t * \t\t\tthis.model.header[index].ascending = this.model.header[index].descending;\n\t * \t\t}\n\t * \t\tthis.model.sort(index);\n\t * \t}\n\t * }\n\t * ```\n\t */\n\t@Output() sort = new EventEmitter<number>();\n\n\t/**\n\t * Emits if all rows are selected.\n\t *\n\t * @param model\n\t */\n\t@Output() selectAll = new EventEmitter<Object>();\n\n\t/**\n\t * Emits if all rows are deselected.\n\t *\n\t * @param model\n\t */\n\t@Output() deselectAll = new EventEmitter<Object>();\n\n\t/**\n\t * Emits if a single row is selected.\n\t *\n\t * @param ({model: this.model, selectedRowIndex: index})\n\t */\n\t@Output() selectRow = new EventEmitter<Object>();\n\n\t/**\n\t * Emits if a single row is deselected.\n\t *\n\t * @param ({model: this.model, deselectedRowIndex: index})\n\t */\n\t@Output() deselectRow = new EventEmitter<Object>();\n\n\t/**\n\t * Emits if a row item excluding expandButtons, checkboxes, or radios is clicked.\n\t */\n\t@Output() rowClick = new EventEmitter<number>();\n\n\t/**\n\t * Emits when table requires more data to be loaded.\n\t */\n\t@Output() scrollLoad = new EventEmitter<TableModel>();\n\n\t/**\n\t * Controls if all checkboxes are viewed as selected.\n\t */\n\tselectAllCheckbox = false;\n\n\t/**\n\t * Controls the indeterminate state of the header checkbox.\n\t */\n\tselectAllCheckboxSomeSelected = false;\n\n\tget noData() {\n\t\treturn !this.model.data ||\n\t\t\tthis.model.data.length === 0 ||\n\t\t\tthis.model.data.length === 1 && this.model.data[0].length === 0;\n\t}\n\n\tpublic isColumnDragging = false;\n\tpublic columnDraggedHoverIndex = -1;\n\tpublic columnDraggedPosition = \"\";\n\n\tprotected _model: TableModel;\n\tprotected _isDataGrid = false;\n\t// flag to prevent getters/setters from querying the view before it's fully instantiated\n\tprotected isViewReady = false;\n\n\tprotected subscriptions = new Subscription();\n\tprotected positionSubscription: Subscription;\n\n\tprotected interactionModel: DataGridInteractionModel;\n\tprotected interactionPositionSubscription: Subscription;\n\n\tprotected _expandButtonAriaLabel = this.i18n.getOverridable(\"TABLE.EXPAND_BUTTON\");\n\tprotected _sortDescendingLabel = this.i18n.getOverridable(\"TABLE.SORT_DESCENDING\");\n\tprotected _sortAscendingLabel = this.i18n.getOverridable(\"TABLE.SORT_ASCENDING\");\n\tprotected _checkboxHeaderLabel = this.i18n.getOverridable(\"TABLE.CHECKBOX_HEADER\");\n\tprotected _checkboxRowLabel = this.i18n.getOverridable(\"TABLE.CHECKBOX_ROW\");\n\tprotected _endOfDataText = this.i18n.getOverridable(\"TABLE.END_OF_DATA\");\n\tprotected _scrollTopText = this.i18n.getOverridable(\"TABLE.SCROLL_TOP\");\n\tprotected _filterTitle = this.i18n.getOverridable(\"TABLE.FILTER\");\n\n\tprotected columnResizeWidth: number;\n\tprotected columnResizeMouseX: number;\n\tprotected mouseMoveSubscription: Subscription;\n\tprotected mouseUpSubscription: Subscription;\n\n\t/**\n\t * Creates an instance of Table.\n\t */\n\tconstructor(\n\t\tprotected elementRef: ElementRef,\n\t\tprotected applicationRef: ApplicationRef,\n\t\tprotected i18n: I18n\n\t) { }\n\n\tngOnInit() {\n\t\t// Manually trigger check to see if all checkboxes are selected\n\t\t// This is since subscription is made AFTER checkboxes are selected\n\t\tthis.updateSelectAllCheckbox();\n\t}\n\n\tngAfterViewInit() {\n\t\tthis.isViewReady = true;\n\t\tif (this.isDataGrid) {\n\t\t\tthis.enableDataGridInteractions();\n\t\t}\n\t}\n\n\tngOnDestroy() {\n\t\tthis.subscriptions.unsubscribe();\n\t\tif (this.positionSubscription) {\n\t\t\tthis.positionSubscription.unsubscribe();\n\t\t}\n\t}\n\n\tenableDataGridInteractions() {\n\t\t// if we have an `interactioModel` we've already enabled datagrid\n\t\tif (this.interactionModel) {\n\t\t\treturn;\n\t\t}\n\t\tconst table = this.elementRef.nativeElement.querySelector(\"table\") as HTMLTableElement;\n\t\tconst tableAdapter = new TableDomAdapter(table);\n\t\tconst keydownEventStream = fromEvent<KeyboardEvent>(table, \"keydown\");\n\t\tconst clickEventStream = fromEvent<MouseEvent>(table, \"click\");\n\t\tthis.interactionModel = new DataGridInteractionModel(keydownEventStream, clickEventStream, tableAdapter);\n\t\tthis.positionSubscription = this.interactionModel.position.subscribe(event => {\n\t\t\tconst [currentRow, currentColumn] = event.current;\n\t\t\tconst [previousRow, previousColumn] = event.previous;\n\n\t\t\tconst currentElement = tableAdapter.getCell(currentRow, currentColumn);\n\t\t\tTable.setTabIndex(currentElement, 0);\n\n\t\t\t// if the model has just initialized don't focus or reset anything\n\t\t\tif (previousRow === -1 || previousColumn === -1) { return; }\n\t\t\t// Make the previous cell unfocusable (if it's not the current)\n\t\t\tif (previousRow !== currentRow || previousColumn !== currentColumn) {\n\t\t\t\tconst previousElement = tableAdapter.getCell(previousRow, previousColumn);\n\t\t\t\tTable.setTabIndex(previousElement, -1);\n\t\t\t}\n\t\t\tTable.focus(currentElement);\n\t\t});\n\t\t// call this after assigning `this.interactionModel` since it depends on it\n\t\tthis.resetTabIndex();\n\t}\n\n\tdisableDataGridInteractions() {\n\t\t// unsubscribe first so we don't cause the focus to fly around\n\t\tif (this.positionSubscription) {\n\t\t\tthis.positionSubscription.unsubscribe();\n\t\t}\n\t\t// undo tab indexing (also resets the model)\n\t\tthis.resetTabIndex(0);\n\t\t// null out the model ref\n\t\tthis.interactionModel = null;\n\t}\n\n\tonSelectAll() {\n\t\tthis.model.selectAll(true);\n\t\tthis.selectAll.emit(this.model);\n\t}\n\n\tonDeselectAll() {\n\t\tthis.model.selectAll(false);\n\t\tthis.deselectAll.emit(this.model);\n\t}\n\n\tonSelectRow(event) {\n\t\t// check for the existence of the selectedRowIndex property\n\t\tif (Object.keys(event).includes(\"selectedRowIndex\")) {\n\t\t\tif (this.enableSingleSelect) {\n\t\t\t\tthis.model.selectAll(false);\n\t\t\t}\n\t\t\tthis.model.selectRow(event.selectedRowIndex, true);\n\t\t\tthis.selectRow.emit(event);\n\t\t} else {\n\t\t\tthis.model.selectRow(event.deselectedRowIndex, false);\n\t\t\tthis.deselectRow.emit(event);\n\t\t}\n\t}\n\n\tonRowClick(index: number) {\n\t\tthis.rowClick.emit(index);\n\t}\n\n\tupdateSelectAllCheckbox() {\n\t\tconst selectedRowsCount = this.model.selectedRowsCount();\n\n\t\tif (selectedRowsCount <= 0) {\n\t\t\t// reset select all checkbox if nothing selected\n\t\t\tthis.selectAllCheckbox = false;\n\t\t\tthis.selectAllCheckboxSomeSelected = false;\n\t\t} else if (selectedRowsCount < this.model.data.length) {\n\t\t\tthis.selectAllCheckbox = true;\n\t\t\tthis.selectAllCheckboxSomeSelected = true;\n\t\t} else {\n\t\t\tthis.selectAllCheckbox = true;\n\t\t\tthis.selectAllCheckboxSomeSelected = false;\n\t\t}\n\t}\n\n\tresetTabIndex(newTabIndex = -1) {\n\t\t// ensure the view is ready for the reset before we preform the actual reset\n\t\tsetTimeout(() => {\n\t\t\t// reset all the tabIndexes we can find\n\t\t\tconst focusElementList = getFocusElementList(this.elementRef.nativeElement, tabbableSelectorIgnoreTabIndex);\n\t\t\tif (focusElementList) {\n\t\t\t\tfocusElementList.forEach(tabbable => {\n\t\t\t\t\ttabbable.tabIndex = newTabIndex;\n\t\t\t\t});\n\t\t\t}\n\t\t\t// reset interaction model positions and tabIndexes\n\t\t\tif (this.interactionModel) {\n\t\t\t\tthis.interactionModel.resetTabIndexes(newTabIndex);\n\t\t\t}\n\t\t});\n\t}\n\n\tcolumnResizeStart(event, column) {\n\t\tthis.columnResizeWidth = parseInt(column.style.width, 10);\n\t\tthis.columnResizeMouseX = event.clientX;\n\t\tevent.preventDefault();\n\n\t\tthis.mouseMoveSubscription = fromEvent(document.body, \"mousemove\").subscribe(event => {\n\t\t\tthis.columnResizeProgress(event, column);\n\t\t});\n\t\tthis.mouseUpSubscription = fromEvent(document.body, \"mouseup\").subscribe(event => {\n\t\t\tthis.columnResizeEnd(event, column);\n\t\t});\n\t}\n\n\tcolumnResizeProgress(event, column) {\n\t\tconst move = event.clientX - this.columnResizeMouseX;\n\t\tcolumn.style.width = `${this.columnResizeWidth + move}px`;\n\t}\n\n\tcolumnResizeEnd(event, column) {\n\t\tthis.mouseMoveSubscription.unsubscribe();\n\t\tthis.mouseUpSubscription.unsubscribe();\n\t}\n\n\t/**\n\t * Triggered when the user scrolls on the `<tbody>` element.\n\t * Emits the `scrollLoad` event.\n\t */\n\tonScroll(event) {\n\t\tconst distanceFromBottom = event.target.scrollHeight - event.target.clientHeight - event.target.scrollTop;\n\n\t\tif (distanceFromBottom <= this.scrollLoadDistance) {\n\t\t\tthis.scrollLoad.emit(this.model);\n\t\t} else {\n\t\t\tthis.model.isEnd = false;\n\t\t}\n\t}\n\n\tcolumnDragStart(event, columnIndex) {\n\t\tthis.isColumnDragging = true;\n\t\tthis.columnDraggedHoverIndex = columnIndex;\n\t\tevent.dataTransfer.setData(\"columnIndex\", JSON.stringify(columnIndex));\n\t}\n\n\tcolumnDragEnd(event, columnIndex) {\n\t\tthis.isColumnDragging = false;\n\t\tthis.columnDraggedHoverIndex = -1;\n\t}\n\n\tcolumnDragEnter(event, position, columnIndex) {\n\t\tthis.columnDraggedPosition = position;\n\t\tthis.columnDraggedHoverIndex = columnIndex;\n\t}\n\n\tcolumnDragLeave(event, position, columnIndex) {\n\t\tthis.columnDraggedPosition = \"\";\n\t}\n\n\tcolumnDragover(event, position, columnIndex) {\n\t\tthis.columnDraggedHoverIndex = columnIndex;\n\t\tthis.columnDraggedPosition = position;\n\n\t\t// needed to tell browser to allow dropping\n\t\tevent.preventDefault();\n\t}\n\n\tcolumnDrop(event, position, columnIndex) {\n\t\tthis.isColumnDragging = false;\n\t\tthis.columnDraggedHoverIndex = -1;\n\t\tthis.columnDraggedPosition = \"\";\n\n\t\tthis.model.moveColumn(\n\t\t\tparseInt(event.dataTransfer.getData(\"columnIndex\"), 10),\n\t\t\tcolumnIndex + (position === \"right\" ? 1 : 0)\n\t\t);\n\t}\n\n\tdoSort(index: number) {\n\t\tif (this.sort.observers.length === 0) {\n\t\t\t// no sort provided so do the simple sort\n\t\t\tthis.model.cycleSortState(index);\n\t\t\tthis.model.sort(index);\n\t\t}\n\n\t\tthis.sort.emit(index);\n\t}\n\n\t/**\n\t * Triggered when the user scrolls on the `<tbody>` element.\n\t * Emits the `scrollLoad` event.\n\t */\n\tscrollToTop(event) {\n\t\tevent.target.parentElement.parentElement.parentElement.parentElement.children[1].scrollTop = 0;\n\t\tthis.model.isEnd = false;\n\t}\n\n\tgetSelectionLabelValue(row: TableItem[]) {\n\t\tif (!this.selectionLabelColumn) {\n\t\t\treturn { value: this.i18n.get().TABLE.ROW };\n\t\t}\n\t\treturn { value: row[this.selectionLabelColumn].data };\n\t}\n\n\tgetExpandButtonAriaLabel() {\n\t\treturn this._expandButtonAriaLabel.subject;\n\t}\n\tgetSortDescendingLabel() {\n\t\treturn this._sortDescendingLabel.subject;\n\t}\n\tgetSortAscendingLabel() {\n\t\treturn this._sortAscendingLabel.subject;\n\t}\n\n\tgetCheckboxHeaderLabel() {\n\t\treturn this._checkboxHeaderLabel.subject;\n\t}\n\n\tgetCheckboxRowLabel() {\n\t\treturn this._checkboxRowLabel.subject;\n\t}\n\n\tgetEndOfDataText() {\n\t\treturn this._endOfDataText.subject;\n\t}\n\n\tgetScrollTopText() {\n\t\treturn this._scrollTopText.subject;\n\t}\n\n\tgetFilterTitle() {\n\t\treturn this._filterTitle.subject;\n\t}\n}\n",
|
|
55271
|
+
"sourceCode": "import {\n\tComponent,\n\tApplicationRef,\n\tInput,\n\tOnInit,\n\tOutput,\n\tEventEmitter,\n\tElementRef,\n\tAfterViewInit,\n\tTemplateRef,\n\tOnDestroy,\n\tHostBinding\n} from \"@angular/core\";\nimport { Subscription, fromEvent, Observable } from \"rxjs\";\n\nimport { TableModel } from \"./table-model.class\";\nimport { TableHeaderItem } from \"./table-header-item.class\";\nimport { TableItem } from \"./table-item.class\";\n\nimport { getFocusElementList, tabbableSelectorIgnoreTabIndex } from \"carbon-components-angular/common\";\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { merge } from \"carbon-components-angular/utils\";\nimport { DataGridInteractionModel } from \"./data-grid-interaction-model.class\";\nimport { TableDomAdapter } from \"./table-adapter.class\";\nimport { TableRowSize } from \"./table.types\";\n\n/**\n * Build your table with this component by extending things that differ from default.\n *\n * [See demo](../../?path=/story/components-table--basic)\n *\n * Instead of the usual write-your-own-html approach you had with `<table>`,\n * carbon table uses model-view-controller approach.\n *\n * Here, you create a view (with built-in controller) and provide it a model.\n * Changes you make to the model are reflected in the view. Provide same model you use\n * in the table to the `<cds-pagination>` components.\n * They provide a different view over the same data.\n *\n * ## Basic usage\n *\n * ```html\n * <cds-table [model]=\"model\"></cds-table>\n * ```\n *\n * ```typescript\n * public model = new TableModel();\n *\n * this.model.data = [\n * \t[new TableItem({data: \"asdf\"}), new TableItem({data: \"qwer\"})],\n * \t[new TableItem({data: \"csdf\"}), new TableItem({data: \"zwer\"})],\n * \t[new TableItem({data: \"bsdf\"}), new TableItem({data: \"swer\"})],\n * \t[new TableItem({data: \"csdf\"}), new TableItem({data: \"twer\"})]\n * ];\n * ```\n *\n * ## Customization\n *\n * If you have custom data in your table, you need a way to display it. You can do that\n * by providing a template to `TableItem`.\n *\n * ```html\n * <ng-template #customTableItemTemplate let-data=\"data\">\n * \t<a [routerLink]=\"data.link\">{{data.name}} {{data.surname}}</a>\n * </ng-template>\n * ```\n *\n * ```typescript\n * customTableItemTemplate: TemplateRef<any>;\n *\n * this.customModel.data = [\n * \t[new TableItem({data: \"asdf\"}), new TableItem({data: {name: \"Lessy\", link: \"/table\"}, template: this.customTableItemTemplate})],\n * \t[new TableItem({data: \"csdf\"}), new TableItem({data: \"swer\"})],\n * \t[new TableItem({data: \"bsdf\"}), new TableItem({data: {name: \"Alice\", surname: \"Bob\"}, template: this.customTableItemTemplate})],\n * \t[new TableItem({data: \"csdf\"}), new TableItem({data: \"twer\"})],\n * ];\n * ```\n *\n * ### Sorting and filtering\n *\n * In case you need custom sorting and/or filtering you should subclass `TableHeaderItem`\n * and override needed functions.\n *\n * ```typescript\n * class FilterableHeaderItem extends TableHeaderItem {\n * \t// custom filter function\n * \tfilter(item: TableItem): boolean {\n * \t\tif (typeof item.data === \"string\" && item.data.toLowerCase().indexOf(this.filterData.data.toLowerCase()) >= 0 ||\n * \t\titem.data.name && item.data.name.toLowerCase().indexOf(this.filterData.data.toLowerCase()) >= 0 ||\n * \t\titem.data.surname && item.data.surname.toLowerCase().indexOf(this.filterData.data.toLowerCase()) >= 0) {\n * \t\t\treturn false;\n * \t\t}\n * \t\treturn true;\n * \t}\n *\n * \tset filterCount(n) {}\n * \tget filterCount() {\n * \t\treturn (this.filterData && this.filterData.data && this.filterData.data.length > 0) ? 1 : 0;\n * \t}\n *\n * \t// used for custom sorting\n * \tcompare(one: TableItem, two: TableItem) {\n * \t\tconst stringOne = (one.data.name || one.data.surname || one.data).toLowerCase();\n * \t\tconst stringTwo = (two.data.name || two.data.surname || two.data).toLowerCase();\n *\n * \t\tif (stringOne > stringTwo) {\n * \t\t\treturn 1;\n * \t\t} else if (stringOne < stringTwo) {\n * \t\t\treturn -1;\n * \t\t} else {\n * \t\t\treturn 0;\n * \t\t}\n * \t}\n * }\n * ```\n *\n * If you want to do your sorting on the backend or query for sorted data as a result of user\n * clicking the table header, check table [`sort`](#sort) output documentation\n *\n * See `TableHeaderItem` class for more information.\n *\n * ## No data template\n *\n * When table has no data to show, it can show a message you provide it instead.\n *\n * ```html\n * <cds-table [model]=\"model\">No data.</cds-table>\n * ```\n *\n * ... will show `No data.` message, but you can get creative and provide any template you want\n * to replace table's default `tbody`.\n *\n * ## Use pagination as table footer\n *\n * ```html\n * <cds-pagination [model]=\"model\" (selectPage)=\"selectPage($event)\"></cds-pagination>\n * ```\n *\n * `selectPage()` function should fetch the data from backend, create new `data`, apply it to `model.data`,\n * and update `model.currentPage`.\n *\n * If the data your server returns is a two dimensional array of objects, it would look something like this:\n *\n * ```typescript\n * selectPage(page) {\n * \tthis.getPage(page).then((data: Array<Array<any>>) => {\n * \t\t// set the data and update page\n * \t\tthis.model.data = this.prepareData(data);\n * \t\tthis.model.currentPage = page;\n * \t});\n * }\n *\n * protected prepareData(data: Array<Array<any>>) {\n * \t// create new data from the service data\n * \tlet newData = [];\n * \tdata.forEach(dataRow => {\n * \t\tlet row = [];\n * \t\tdataRow.forEach(dataElement => {\n * \t\t\trow.push(new TableItem({\n * \t\t\t\tdata: dataElement,\n * \t\t\t\ttemplate: typeof dataElement === \"string\" ? undefined : this.paginationTableItemTemplate\n * \t\t\t\t// your template can handle all the data types so you don't have to conditionally set it\n * \t\t\t\t// you can also set different templates for different columns based on index\n * \t\t\t}));\n * \t\t});\n * \t\tnewData.push(row);\n * \t});\n * \treturn newData;\n * }\n * ```\n */\n@Component({\n\tselector: \"cds-table, ibm-table\",\n\ttemplate: `\n\t<table\n\t\tcdsTable\n\t\t[sortable]=\"sortable\"\n\t\t[noBorder]=\"noBorder\"\n\t\t[ngClass]=\"{'cds--data-table--sticky-header': stickyHeader}\"\n\t\t[size]=\"size\"\n\t\t[striped]=\"striped\"\n\t\t[skeleton]=\"skeleton\"\n\t\t[attr.aria-labelledby]=\"ariaLabelledby\"\n\t\t[attr.aria-describedby]=\"ariaDescribedby\">\n\t\t<thead\n\t\t\tcdsTableHead\n\t\t\t[sortable]=\"sortable\"\n\t\t\t(deselectAll)=\"onDeselectAll()\"\n\t\t\t(selectAll)=\"onSelectAll()\"\n\t\t\t(expandAllRows)=\"model.expandAllRows(true)\"\n\t\t\t(collapseAllRows)=\"model.expandAllRows(false)\"\n\t\t\t(sort)=\"doSort($event)\"\n\t\t\t[checkboxHeaderLabel]=\"getCheckboxHeaderLabel()\"\n\t\t\t[filterTitle]=\"getFilterTitle()\"\n\t\t\t[model]=\"model\"\n\t\t\t[selectAllCheckbox]=\"selectAllCheckbox\"\n\t\t\t[selectAllCheckboxSomeSelected]=\"selectAllCheckboxSomeSelected\"\n\t\t\t[showSelectionColumn]=\"showSelectionColumn\"\n\t\t\t[enableSingleSelect]=\"enableSingleSelect\"\n\t\t\t[showExpandAllToggle]=\"showExpandAllToggle\"\n\t\t\t[skeleton]=\"skeleton\"\n\t\t\t[sortAscendingLabel]=\"sortAscendingLabel\"\n\t\t\t[sortDescendingLabel]=\"sortDescendingLabel\"\n\t\t\t[stickyHeader]=\"stickyHeader\">\n\t\t</thead>\n\t\t<tbody\n\t\t\tcdsTableBody\n\t\t\t(deselectRow)=\"onSelectRow($event)\"\n\t\t\t(scroll)=\"onScroll($event)\"\n\t\t\t(selectRow)=\"onSelectRow($event)\"\n\t\t\t[checkboxRowLabel]=\"getCheckboxRowLabel()\"\n\t\t\t[enableSingleSelect]=\"enableSingleSelect\"\n\t\t\t(rowClick)=\"onRowClick($event)\"\n\t\t\t[expandButtonAriaLabel]=\"expandButtonAriaLabel\"\n\t\t\t[model]=\"model\"\n\t\t\t[size]=\"size\"\n\t\t\t[ngStyle]=\"{'overflow-y': 'scroll'}\"\n\t\t\t[selectionLabelColumn]=\"selectionLabelColumn\"\n\t\t\t[showSelectionColumn]=\"showSelectionColumn\"\n\t\t\t[skeleton]=\"skeleton\"\n\t\t\t*ngIf=\"!noData; else noDataTemplate\">\n\t\t</tbody>\n\t\t<ng-template #noDataTemplate><ng-content></ng-content></ng-template>\n\t\t<tfoot>\n\t\t\t<ng-template\n\t\t\t\t[ngTemplateOutlet]=\"footerTemplate\">\n\t\t\t</ng-template>\n\t\t\t<tr *ngIf=\"this.model.isLoading\">\n\t\t\t\t<td class=\"table_loading-indicator\">\n\t\t\t\t\t<div class=\"cds--loading cds--loading--small\">\n\t\t\t\t\t\t<svg class=\"cds--loading__svg\" viewBox=\"-75 -75 150 150\">\n\t\t\t\t\t\t\t<circle class=\"cds--loading__stroke\" cx=\"0\" cy=\"0\" r=\"37.5\" />\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr *ngIf=\"this.model.isEnd\">\n\t\t\t\t<td class=\"table_end-indicator\">\n\t\t\t\t\t<h5>{{getEndOfDataText() | async}}</h5>\n\t\t\t\t\t<button (click)=\"scrollToTop($event)\" class=\"btn--secondary-sm\">\n\t\t\t\t\t\t{{getScrollTopText() | async}}\n\t\t\t\t\t</button>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tfoot>\n\t</table>\n\t`,\n\tstyles: [`\n\t\t:host {\n\t\t\tdisplay: block;\n\t\t}\n\t`]\n})\nexport class Table implements OnInit, AfterViewInit, OnDestroy {\n\t/**\n\t * Creates a skeleton model with a row and column count specified by the user\n\t *\n\t * Example:\n\t *\n\t * ```typescript\n\t * this.model = Table.skeletonModel(5, 5);\n\t * ```\n\t */\n\tstatic skeletonModel(rowCount: number, columnCount: number) {\n\t\tconst model = new TableModel();\n\t\tlet header = new Array<TableHeaderItem>();\n\t\tlet data = new Array<Array<TableItem>>();\n\t\tlet row = new Array<TableItem>();\n\n\t\tfor (let i = 0; i < columnCount; i++) {\n\t\t\theader.push(new TableHeaderItem());\n\t\t\trow.push(new TableItem());\n\t\t}\n\t\tfor (let i = 0; i < rowCount - 1; i++) {\n\t\t\tdata.push(row);\n\t\t}\n\n\t\tmodel.header = header;\n\t\tmodel.data = data;\n\t\treturn model;\n\t}\n\n\tstatic setTabIndex(element: HTMLElement, index: -1 | 0) {\n\t\tconst focusElementList = getFocusElementList(element, tabbableSelectorIgnoreTabIndex);\n\t\tif (element.firstElementChild && element.firstElementChild.classList.contains(\"cds--table-sort\") && focusElementList.length > 1) {\n\t\t\tfocusElementList[1].tabIndex = index;\n\t\t} else if (focusElementList.length > 0) {\n\t\t\tfocusElementList[0].tabIndex = index;\n\t\t} else {\n\t\t\telement.tabIndex = index;\n\t\t}\n\t}\n\n\tstatic focus(element: HTMLElement) {\n\t\tconst focusElementList = getFocusElementList(element, tabbableSelectorIgnoreTabIndex);\n\t\tif (\n\t\t\t(element.firstElementChild?.classList.contains(\"cds--table-sort\") && focusElementList.length > 1) ||\n\t\t\tfocusElementList.length > 0\n\t\t) {\n\t\t\tfocusElementList[0].focus();\n\t\t} else {\n\t\t\telement.focus();\n\t\t}\n\t}\n\n\t/**\n\t * Id of the table header title element\n\t */\n\t@Input() ariaLabelledby: string;\n\t/**\n\t * Id of the table header description element\n\t */\n\t@Input() ariaDescribedby: string;\n\n\t/**\n\t * `TableModel` with data the table is to display.\n\t */\n\t@Input()\n\tset model(m: TableModel) {\n\t\tif (this._model) {\n\t\t\tthis.subscriptions.unsubscribe();\n\t\t\t// Need to create a new subscription instance here because unsubscribing prevents any new subscriptions\n\t\t\t// from being added for some reason. When a new model is set, none of the subscriptions would exist.\n\t\t\tthis.subscriptions = new Subscription();\n\t\t}\n\n\t\tthis._model = m;\n\n\t\tconst rowsChange = this._model.rowsSelectedChange.subscribe(() => this.updateSelectAllCheckbox());\n\t\tconst dataChange = this._model.dataChange.subscribe(() => {\n\t\t\tif (this.isDataGrid) {\n\t\t\t\tthis.resetTabIndex();\n\t\t\t}\n\t\t\tthis.updateSelectAllCheckbox();\n\t\t});\n\n\t\tthis.subscriptions.add(rowsChange);\n\t\tthis.subscriptions.add(dataChange);\n\n\t\tif (this.isDataGrid) {\n\t\t\tconst expandedChange = this._model.rowsExpandedChange.subscribe(() => {\n\t\t\t\t// Allows the expanded row to have a focus state when it exists in the DOM\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tconst expandedRows = this.elementRef.nativeElement.querySelectorAll(\".cds--expandable-row:not(.cds--parent-row)\");\n\t\t\t\t\tArray.from<any>(expandedRows).forEach(row => {\n\t\t\t\t\t\tif (row.firstElementChild.tabIndex === undefined || row.firstElementChild.tabIndex !== -1) {\n\t\t\t\t\t\t\trow.firstElementChild.tabIndex = -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t\tthis.subscriptions.add(expandedChange);\n\t\t}\n\t}\n\n\tget model(): TableModel {\n\t\treturn this._model;\n\t}\n\n\t/**\n\t * Size of the table rows.\n\t */\n\t@Input() size: TableRowSize = \"md\";\n\t/**\n\t * Set to `true` for a loading table.\n\t */\n\t@Input() skeleton = false;\n\t/**\n\t * Set to `true` for a data grid with keyboard interactions.\n\t */\n\t@Input() set isDataGrid(value: boolean) {\n\t\tthis._isDataGrid = value;\n\t\tif (this.isViewReady) {\n\t\t\tif (value) {\n\t\t\t\tthis.enableDataGridInteractions();\n\t\t\t} else {\n\t\t\t\tthis.disableDataGridInteractions();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Setting sortable to false will disable all headers including headers which are sortable. Is is\n\t * possible to set the sortable state on the header item to disable/enable sorting for only some headers.\n\t */\n\t@Input() sortable = true;\n\n\t@Input() noBorder = true;\n\n\t/**\n\t * Set to `true` to show expansion toggle when table consists of row expansions\n\t */\n\t@Input() showExpandAllToggle = false;\n\n\tget isDataGrid(): boolean {\n\t\treturn this._isDataGrid;\n\t}\n\n\t/**\n\t * Controls whether to show the selection checkboxes column or not.\n\t */\n\t@Input() showSelectionColumn = true;\n\n\t/**\n\t * Controls whether to enable multiple or single row selection.\n\t */\n\t@Input() enableSingleSelect = false;\n\n\t/**\n\t * Distance (in px) from the bottom that view has to reach before\n\t * `scrollLoad` event is emitted.\n\t */\n\t@Input() scrollLoadDistance = 0;\n\n\t/**\n\t * @todo - Enable column resize when Carbon officially supports feature\n\t * Set to `true` to enable users to resize columns.\n\t *\n\t * Works for columns with width set in pixels.\n\t *\n\t */\n\t// @Input() columnsResizable = false;\n\n\t/**\n\t * @todo - Enable columns drag & drop when Carbon officially supports feature\n\t * Set to `true` to enable users to drag and drop columns.\n\t *\n\t * Changing the column order in table changes table model. Be aware of it when you add additional data\n\t * to the model.\n\t *\n\t */\n\t// @Input() columnsDraggable = false;\n\n\t@Input()\n\tset expandButtonAriaLabel(value: string | Observable<string>) {\n\t\tthis._expandButtonAriaLabel.override(value);\n\t}\n\tget expandButtonAriaLabel() {\n\t\treturn this._expandButtonAriaLabel.value;\n\t}\n\t@Input()\n\tset sortDescendingLabel(value: string | Observable<string>) {\n\t\tthis._sortDescendingLabel.override(value);\n\t}\n\tget sortDescendingLabel() {\n\t\treturn this._sortDescendingLabel.value;\n\t}\n\t@Input()\n\tset sortAscendingLabel(value: string | Observable<string>) {\n\t\tthis._sortAscendingLabel.override(value);\n\t}\n\tget sortAscendingLabel() {\n\t\treturn this._sortAscendingLabel.value;\n\t}\n\n\t/**\n\t * Expects an object that contains some or all of:\n\t * ```\n\t * {\n\t *\t\t\"FILTER\": \"Filter\",\n\t *\t\t\"END_OF_DATA\": \"You've reached the end of your content\",\n\t *\t\t\"SCROLL_TOP\": \"Scroll to top\",\n\t *\t\t\"CHECKBOX_HEADER\": \"Select all rows\",\n\t *\t\t\"CHECKBOX_ROW\": \"Select row\"\n\t * }\n\t * ```\n\t */\n\t@Input()\n\tset translations(value) {\n\t\tconst valueWithDefaults = merge(this.i18n.getMultiple(\"TABLE\"), value);\n\t\tthis._filterTitle.override(valueWithDefaults.FILTER);\n\t\tthis._endOfDataText.override(valueWithDefaults.END_OF_DATA);\n\t\tthis._scrollTopText.override(valueWithDefaults.SCROLL_TOP);\n\t\tthis._checkboxHeaderLabel.override(valueWithDefaults.CHECKBOX_HEADER);\n\t\tthis._checkboxRowLabel.override(valueWithDefaults.CHECKBOX_ROW);\n\t}\n\n\t/**\n\t * Set to `false` to remove table rows (zebra) stripes.\n\t */\n\t@Input() striped = true;\n\n\t/**\n\t * Allows table content to scroll horizontally\n\t */\n\t@HostBinding(\"class.cds--data-table-content\") tableContent = true;\n\n\t/**\n\t * Set to `true` to stick the header to the top of the table\n\t */\n\t@HostBinding(\"class.cds--data-table_inner-container\") @Input() stickyHeader = false;\n\n\t/**\n\t * Set footer template to customize what is displayed in the tfoot section of the table\n\t */\n\t@Input() footerTemplate: TemplateRef<any>;\n\n\t/**\n\t * Used to populate the row selection checkbox label with a useful value if set.\n\t *\n\t * Example:\n\t * ```\n\t * <cds-table [selectionLabelColumn]=\"0\"></cds-table>\n\t * <!-- results in aria-label=\"Select first column value\"\n\t * (where \"first column value\" is the value of the first column in the row -->\n\t * ```\n\t */\n\t@Input() selectionLabelColumn: number;\n\n\t/**\n\t * Emits an index of the column that wants to be sorted.\n\t *\n\t * If no observers are provided (default), table will attempt to do a simple sort of the data loaded\n\t * into the model.\n\t *\n\t * If an observer is provided, table will not attempt any sorting of its own and it is up to the observer\n\t * to sort the table. This is what you typically want if you're using a backend query to get the sorted\n\t * data or want to sort data across multiple pages.\n\t *\n\t * Usage:\n\t *\n\t * ```typescript\n\t * @Component({\n\t * \tselector: \"app-table\",\n\t * \ttemplate: `\n\t * \t\t<cds-table\n\t * \t\t\t[model]=\"model\"\n\t * \t\t\t(sort)=\"simpleSort($event)\">\n\t * \t\t\tNo data.\n\t * \t\t</cds-table>\n\t * \t`\n\t * })\n\t * export class TableApp implements OnInit, OnChanges {\n\t * \t@Input() model = new TableModel();\n\t *\n\t * \tngOnInit() {\n\t * \t\tthis.model.header = [\n\t * \t\t\tnew TableHeaderItem({ data: \"Name\" }),\n\t * \t\t\tnew TableHeaderItem({ data: \"hwer\" })\n\t * \t\t];\n\t *\n\t * \t\tthis.model.data = [\n\t * \t\t\t[new TableItem({ data: \"Name 1\" }), new TableItem({ data: \"qwer\" })],\n\t * \t\t\t[new TableItem({ data: \"Name 3\" }), new TableItem({ data: \"zwer\" })],\n\t * \t\t\t[new TableItem({ data: \"Name 2\" }), new TableItem({ data: \"swer\" })],\n\t * \t\t\t[new TableItem({ data: \"Name 4\" }), new TableItem({data: \"twer\"})],\n\t * \t\t\t[new TableItem({ data: \"Name 5\" }), new TableItem({data: \"twer\"})],\n\t * \t\t\t[new TableItem({ data: \"Name 6\" }), new TableItem({data: \"twer\"})]\n\t * \t\t];\n\t * \t}\n\t *\n\t * \tsimpleSort(index: number) {\n\t * \t\t// this function does a simple sort, which is the default for the table and if that's\n\t * \t\t// all you want, you don't need to do this.\n\t *\n\t * \t\t// here you can query your backend and update the model.data based on the result\n\t * \t\tif (this.model.header[index].sorted) {\n\t * \t\t\t// if already sorted flip sorting direction\n\t * \t\t\tthis.model.header[index].ascending = this.model.header[index].descending;\n\t * \t\t}\n\t * \t\tthis.model.sort(index);\n\t * \t}\n\t * }\n\t * ```\n\t */\n\t@Output() sort = new EventEmitter<number>();\n\n\t/**\n\t * Emits if all rows are selected.\n\t *\n\t * @param model\n\t */\n\t@Output() selectAll = new EventEmitter<Object>();\n\n\t/**\n\t * Emits if all rows are deselected.\n\t *\n\t * @param model\n\t */\n\t@Output() deselectAll = new EventEmitter<Object>();\n\n\t/**\n\t * Emits if a single row is selected.\n\t *\n\t * @param ({model: this.model, selectedRowIndex: index})\n\t */\n\t@Output() selectRow = new EventEmitter<Object>();\n\n\t/**\n\t * Emits if a single row is deselected.\n\t *\n\t * @param ({model: this.model, deselectedRowIndex: index})\n\t */\n\t@Output() deselectRow = new EventEmitter<Object>();\n\n\t/**\n\t * Emits if a row item excluding expandButtons, checkboxes, or radios is clicked.\n\t */\n\t@Output() rowClick = new EventEmitter<number>();\n\n\t/**\n\t * Emits when table requires more data to be loaded.\n\t */\n\t@Output() scrollLoad = new EventEmitter<TableModel>();\n\n\t/**\n\t * Controls if all checkboxes are viewed as selected.\n\t */\n\tselectAllCheckbox = false;\n\n\t/**\n\t * Controls the indeterminate state of the header checkbox.\n\t */\n\tselectAllCheckboxSomeSelected = false;\n\n\tget noData() {\n\t\treturn !this.model.data ||\n\t\t\tthis.model.data.length === 0 ||\n\t\t\tthis.model.data.length === 1 && this.model.data[0].length === 0;\n\t}\n\n\tpublic isColumnDragging = false;\n\tpublic columnDraggedHoverIndex = -1;\n\tpublic columnDraggedPosition = \"\";\n\n\tprotected _model: TableModel;\n\tprotected _isDataGrid = false;\n\t// flag to prevent getters/setters from querying the view before it's fully instantiated\n\tprotected isViewReady = false;\n\n\tprotected subscriptions = new Subscription();\n\tprotected positionSubscription: Subscription;\n\n\tprotected interactionModel: DataGridInteractionModel;\n\tprotected interactionPositionSubscription: Subscription;\n\n\tprotected _expandButtonAriaLabel = this.i18n.getOverridable(\"TABLE.EXPAND_BUTTON\");\n\tprotected _sortDescendingLabel = this.i18n.getOverridable(\"TABLE.SORT_DESCENDING\");\n\tprotected _sortAscendingLabel = this.i18n.getOverridable(\"TABLE.SORT_ASCENDING\");\n\tprotected _checkboxHeaderLabel = this.i18n.getOverridable(\"TABLE.CHECKBOX_HEADER\");\n\tprotected _checkboxRowLabel = this.i18n.getOverridable(\"TABLE.CHECKBOX_ROW\");\n\tprotected _endOfDataText = this.i18n.getOverridable(\"TABLE.END_OF_DATA\");\n\tprotected _scrollTopText = this.i18n.getOverridable(\"TABLE.SCROLL_TOP\");\n\tprotected _filterTitle = this.i18n.getOverridable(\"TABLE.FILTER\");\n\n\tprotected columnResizeWidth: number;\n\tprotected columnResizeMouseX: number;\n\tprotected mouseMoveSubscription: Subscription;\n\tprotected mouseUpSubscription: Subscription;\n\n\t/**\n\t * Creates an instance of Table.\n\t */\n\tconstructor(\n\t\tprotected elementRef: ElementRef,\n\t\tprotected applicationRef: ApplicationRef,\n\t\tprotected i18n: I18n\n\t) { }\n\n\tngOnInit() {\n\t\t// Manually trigger check to see if all checkboxes are selected\n\t\t// This is since subscription is made AFTER checkboxes are selected\n\t\tthis.updateSelectAllCheckbox();\n\t}\n\n\tngAfterViewInit() {\n\t\tthis.isViewReady = true;\n\t\tif (this.isDataGrid) {\n\t\t\tthis.enableDataGridInteractions();\n\t\t}\n\t}\n\n\tngOnDestroy() {\n\t\tthis.subscriptions.unsubscribe();\n\t\tif (this.positionSubscription) {\n\t\t\tthis.positionSubscription.unsubscribe();\n\t\t}\n\t}\n\n\tenableDataGridInteractions() {\n\t\t// if we have an `interactioModel` we've already enabled datagrid\n\t\tif (this.interactionModel) {\n\t\t\treturn;\n\t\t}\n\t\tconst table = this.elementRef.nativeElement.querySelector(\"table\") as HTMLTableElement;\n\t\tconst tableAdapter = new TableDomAdapter(table);\n\t\tconst keydownEventStream = fromEvent<KeyboardEvent>(table, \"keydown\");\n\t\tconst clickEventStream = fromEvent<MouseEvent>(table, \"click\");\n\t\tthis.interactionModel = new DataGridInteractionModel(keydownEventStream, clickEventStream, tableAdapter);\n\t\tthis.positionSubscription = this.interactionModel.position.subscribe(event => {\n\t\t\tconst [currentRow, currentColumn] = event.current;\n\t\t\tconst [previousRow, previousColumn] = event.previous;\n\n\t\t\tconst currentElement = tableAdapter.getCell(currentRow, currentColumn);\n\t\t\tTable.setTabIndex(currentElement, 0);\n\n\t\t\t// if the model has just initialized don't focus or reset anything\n\t\t\tif (previousRow === -1 || previousColumn === -1) { return; }\n\t\t\t// Make the previous cell unfocusable (if it's not the current)\n\t\t\tif (previousRow !== currentRow || previousColumn !== currentColumn) {\n\t\t\t\tconst previousElement = tableAdapter.getCell(previousRow, previousColumn);\n\t\t\t\tTable.setTabIndex(previousElement, -1);\n\t\t\t}\n\t\t\tTable.focus(currentElement);\n\t\t});\n\t\t// call this after assigning `this.interactionModel` since it depends on it\n\t\tthis.resetTabIndex();\n\t}\n\n\tdisableDataGridInteractions() {\n\t\t// unsubscribe first so we don't cause the focus to fly around\n\t\tif (this.positionSubscription) {\n\t\t\tthis.positionSubscription.unsubscribe();\n\t\t}\n\t\t// undo tab indexing (also resets the model)\n\t\tthis.resetTabIndex(0);\n\t\t// null out the model ref\n\t\tthis.interactionModel = null;\n\t}\n\n\tonSelectAll() {\n\t\tthis.model.selectAll(true);\n\t\tthis.selectAll.emit(this.model);\n\t}\n\n\tonDeselectAll() {\n\t\tthis.model.selectAll(false);\n\t\tthis.deselectAll.emit(this.model);\n\t}\n\n\tonSelectRow(event) {\n\t\t// check for the existence of the selectedRowIndex property\n\t\tif (Object.keys(event).includes(\"selectedRowIndex\")) {\n\t\t\tif (this.enableSingleSelect) {\n\t\t\t\tthis.model.selectAll(false);\n\t\t\t}\n\t\t\tthis.model.selectRow(event.selectedRowIndex, true);\n\t\t\tthis.selectRow.emit(event);\n\t\t} else {\n\t\t\tthis.model.selectRow(event.deselectedRowIndex, false);\n\t\t\tthis.deselectRow.emit(event);\n\t\t}\n\t}\n\n\tonRowClick(index: number) {\n\t\tthis.rowClick.emit(index);\n\t}\n\n\tupdateSelectAllCheckbox() {\n\t\tconst selectedRowsCount = this.model.selectedRowsCount();\n\n\t\tif (selectedRowsCount <= 0) {\n\t\t\t// reset select all checkbox if nothing selected\n\t\t\tthis.selectAllCheckbox = false;\n\t\t\tthis.selectAllCheckboxSomeSelected = false;\n\t\t} else if (selectedRowsCount < this.model.data.length) {\n\t\t\tthis.selectAllCheckbox = true;\n\t\t\tthis.selectAllCheckboxSomeSelected = true;\n\t\t} else {\n\t\t\tthis.selectAllCheckbox = true;\n\t\t\tthis.selectAllCheckboxSomeSelected = false;\n\t\t}\n\t}\n\n\tresetTabIndex(newTabIndex = -1) {\n\t\t// ensure the view is ready for the reset before we preform the actual reset\n\t\tsetTimeout(() => {\n\t\t\t// reset all the tabIndexes we can find\n\t\t\tconst focusElementList = getFocusElementList(this.elementRef.nativeElement, tabbableSelectorIgnoreTabIndex);\n\t\t\tif (focusElementList) {\n\t\t\t\tfocusElementList.forEach(tabbable => {\n\t\t\t\t\ttabbable.tabIndex = newTabIndex;\n\t\t\t\t});\n\t\t\t}\n\t\t\t// reset interaction model positions and tabIndexes\n\t\t\tif (this.interactionModel) {\n\t\t\t\tthis.interactionModel.resetTabIndexes(newTabIndex);\n\t\t\t}\n\t\t});\n\t}\n\n\tcolumnResizeStart(event, column) {\n\t\tthis.columnResizeWidth = parseInt(column.style.width, 10);\n\t\tthis.columnResizeMouseX = event.clientX;\n\t\tevent.preventDefault();\n\n\t\tthis.mouseMoveSubscription = fromEvent(document.body, \"mousemove\").subscribe(event => {\n\t\t\tthis.columnResizeProgress(event, column);\n\t\t});\n\t\tthis.mouseUpSubscription = fromEvent(document.body, \"mouseup\").subscribe(event => {\n\t\t\tthis.columnResizeEnd(event, column);\n\t\t});\n\t}\n\n\tcolumnResizeProgress(event, column) {\n\t\tconst move = event.clientX - this.columnResizeMouseX;\n\t\tcolumn.style.width = `${this.columnResizeWidth + move}px`;\n\t}\n\n\tcolumnResizeEnd(event, column) {\n\t\tthis.mouseMoveSubscription.unsubscribe();\n\t\tthis.mouseUpSubscription.unsubscribe();\n\t}\n\n\t/**\n\t * Triggered when the user scrolls on the `<tbody>` element.\n\t * Emits the `scrollLoad` event.\n\t */\n\tonScroll(event) {\n\t\tconst distanceFromBottom = event.target.scrollHeight - event.target.clientHeight - event.target.scrollTop;\n\n\t\tif (distanceFromBottom <= this.scrollLoadDistance) {\n\t\t\tthis.scrollLoad.emit(this.model);\n\t\t} else {\n\t\t\tthis.model.isEnd = false;\n\t\t}\n\t}\n\n\tcolumnDragStart(event, columnIndex) {\n\t\tthis.isColumnDragging = true;\n\t\tthis.columnDraggedHoverIndex = columnIndex;\n\t\tevent.dataTransfer.setData(\"columnIndex\", JSON.stringify(columnIndex));\n\t}\n\n\tcolumnDragEnd(event, columnIndex) {\n\t\tthis.isColumnDragging = false;\n\t\tthis.columnDraggedHoverIndex = -1;\n\t}\n\n\tcolumnDragEnter(event, position, columnIndex) {\n\t\tthis.columnDraggedPosition = position;\n\t\tthis.columnDraggedHoverIndex = columnIndex;\n\t}\n\n\tcolumnDragLeave(event, position, columnIndex) {\n\t\tthis.columnDraggedPosition = \"\";\n\t}\n\n\tcolumnDragover(event, position, columnIndex) {\n\t\tthis.columnDraggedHoverIndex = columnIndex;\n\t\tthis.columnDraggedPosition = position;\n\n\t\t// needed to tell browser to allow dropping\n\t\tevent.preventDefault();\n\t}\n\n\tcolumnDrop(event, position, columnIndex) {\n\t\tthis.isColumnDragging = false;\n\t\tthis.columnDraggedHoverIndex = -1;\n\t\tthis.columnDraggedPosition = \"\";\n\n\t\tthis.model.moveColumn(\n\t\t\tparseInt(event.dataTransfer.getData(\"columnIndex\"), 10),\n\t\t\tcolumnIndex + (position === \"right\" ? 1 : 0)\n\t\t);\n\t}\n\n\tdoSort(index: number) {\n\t\tif (this.sort.observers.length === 0) {\n\t\t\t// no sort provided so do the simple sort\n\t\t\tthis.model.cycleSortState(index);\n\t\t\tthis.model.sort(index);\n\t\t}\n\n\t\tthis.sort.emit(index);\n\t}\n\n\t/**\n\t * Triggered when the user scrolls on the `<tbody>` element.\n\t * Emits the `scrollLoad` event.\n\t */\n\tscrollToTop(event) {\n\t\tevent.target.parentElement.parentElement.parentElement.parentElement.children[1].scrollTop = 0;\n\t\tthis.model.isEnd = false;\n\t}\n\n\tgetSelectionLabelValue(row: TableItem[]) {\n\t\tif (!this.selectionLabelColumn) {\n\t\t\treturn { value: this.i18n.get().TABLE.ROW };\n\t\t}\n\t\treturn { value: row[this.selectionLabelColumn].data };\n\t}\n\n\tgetExpandButtonAriaLabel() {\n\t\treturn this._expandButtonAriaLabel.subject;\n\t}\n\tgetSortDescendingLabel() {\n\t\treturn this._sortDescendingLabel.subject;\n\t}\n\tgetSortAscendingLabel() {\n\t\treturn this._sortAscendingLabel.subject;\n\t}\n\n\tgetCheckboxHeaderLabel() {\n\t\treturn this._checkboxHeaderLabel.subject;\n\t}\n\n\tgetCheckboxRowLabel() {\n\t\treturn this._checkboxRowLabel.subject;\n\t}\n\n\tgetEndOfDataText() {\n\t\treturn this._endOfDataText.subject;\n\t}\n\n\tgetScrollTopText() {\n\t\treturn this._scrollTopText.subject;\n\t}\n\n\tgetFilterTitle() {\n\t\treturn this._filterTitle.subject;\n\t}\n}\n",
|
|
55052
55272
|
"assetsDirs": [],
|
|
55053
55273
|
"styleUrlsData": "",
|
|
55054
55274
|
"stylesData": "\n\t\t:host {\n\t\t\tdisplay: block;\n\t\t}\n\t\n",
|
|
@@ -55077,7 +55297,7 @@
|
|
|
55077
55297
|
"deprecationMessage": ""
|
|
55078
55298
|
}
|
|
55079
55299
|
],
|
|
55080
|
-
"line":
|
|
55300
|
+
"line": 649,
|
|
55081
55301
|
"rawdescription": "\n\nCreates an instance of Table.\n",
|
|
55082
55302
|
"jsdoctags": [
|
|
55083
55303
|
{
|
|
@@ -55132,7 +55352,7 @@
|
|
|
55132
55352
|
}
|
|
55133
55353
|
],
|
|
55134
55354
|
"returnType": "void",
|
|
55135
|
-
"line":
|
|
55355
|
+
"line": 319,
|
|
55136
55356
|
"rawdescription": "\n\n`TableModel` with data the table is to display.\n",
|
|
55137
55357
|
"description": "<p><code>TableModel</code> with data the table is to display.</p>\n",
|
|
55138
55358
|
"jsdoctags": [
|
|
@@ -55151,7 +55371,7 @@
|
|
|
55151
55371
|
"name": "model",
|
|
55152
55372
|
"type": "",
|
|
55153
55373
|
"returnType": "TableModel",
|
|
55154
|
-
"line":
|
|
55374
|
+
"line": 356
|
|
55155
55375
|
}
|
|
55156
55376
|
},
|
|
55157
55377
|
"isDataGrid": {
|
|
@@ -55170,7 +55390,7 @@
|
|
|
55170
55390
|
}
|
|
55171
55391
|
],
|
|
55172
55392
|
"returnType": "void",
|
|
55173
|
-
"line":
|
|
55393
|
+
"line": 371,
|
|
55174
55394
|
"rawdescription": "\n\nSet to `true` for a data grid with keyboard interactions.\n",
|
|
55175
55395
|
"description": "<p>Set to <code>true</code> for a data grid with keyboard interactions.</p>\n",
|
|
55176
55396
|
"jsdoctags": [
|
|
@@ -55189,7 +55409,7 @@
|
|
|
55189
55409
|
"name": "isDataGrid",
|
|
55190
55410
|
"type": "boolean",
|
|
55191
55411
|
"returnType": "boolean",
|
|
55192
|
-
"line":
|
|
55412
|
+
"line": 395
|
|
55193
55413
|
}
|
|
55194
55414
|
},
|
|
55195
55415
|
"expandButtonAriaLabel": {
|
|
@@ -55208,7 +55428,7 @@
|
|
|
55208
55428
|
}
|
|
55209
55429
|
],
|
|
55210
55430
|
"returnType": "void",
|
|
55211
|
-
"line":
|
|
55431
|
+
"line": 435,
|
|
55212
55432
|
"rawdescription": "\n\nSet to `true` to enable users to drag and drop columns.\n\nChanging the column order in table changes table model. Be aware of it when you add additional data\nto the model.\n\n",
|
|
55213
55433
|
"description": "<p>Set to <code>true</code> to enable users to drag and drop columns.</p>\n<p>Changing the column order in table changes table model. Be aware of it when you add additional data\nto the model.</p>\n",
|
|
55214
55434
|
"jsdoctags": [
|
|
@@ -55227,7 +55447,7 @@
|
|
|
55227
55447
|
"name": "expandButtonAriaLabel",
|
|
55228
55448
|
"type": "",
|
|
55229
55449
|
"returnType": "",
|
|
55230
|
-
"line":
|
|
55450
|
+
"line": 438
|
|
55231
55451
|
}
|
|
55232
55452
|
},
|
|
55233
55453
|
"sortDescendingLabel": {
|
|
@@ -55246,7 +55466,7 @@
|
|
|
55246
55466
|
}
|
|
55247
55467
|
],
|
|
55248
55468
|
"returnType": "void",
|
|
55249
|
-
"line":
|
|
55469
|
+
"line": 442,
|
|
55250
55470
|
"jsdoctags": [
|
|
55251
55471
|
{
|
|
55252
55472
|
"name": "value",
|
|
@@ -55263,7 +55483,7 @@
|
|
|
55263
55483
|
"name": "sortDescendingLabel",
|
|
55264
55484
|
"type": "",
|
|
55265
55485
|
"returnType": "",
|
|
55266
|
-
"line":
|
|
55486
|
+
"line": 445
|
|
55267
55487
|
}
|
|
55268
55488
|
},
|
|
55269
55489
|
"sortAscendingLabel": {
|
|
@@ -55282,7 +55502,7 @@
|
|
|
55282
55502
|
}
|
|
55283
55503
|
],
|
|
55284
55504
|
"returnType": "void",
|
|
55285
|
-
"line":
|
|
55505
|
+
"line": 449,
|
|
55286
55506
|
"jsdoctags": [
|
|
55287
55507
|
{
|
|
55288
55508
|
"name": "value",
|
|
@@ -55299,7 +55519,7 @@
|
|
|
55299
55519
|
"name": "sortAscendingLabel",
|
|
55300
55520
|
"type": "",
|
|
55301
55521
|
"returnType": "",
|
|
55302
|
-
"line":
|
|
55522
|
+
"line": 452
|
|
55303
55523
|
}
|
|
55304
55524
|
},
|
|
55305
55525
|
"translations": {
|
|
@@ -55318,7 +55538,7 @@
|
|
|
55318
55538
|
}
|
|
55319
55539
|
],
|
|
55320
55540
|
"returnType": "void",
|
|
55321
|
-
"line":
|
|
55541
|
+
"line": 469,
|
|
55322
55542
|
"rawdescription": "\n\nExpects an object that contains some or all of:\n```\n{\n\t\t\"FILTER\": \"Filter\",\n\t\t\"END_OF_DATA\": \"You've reached the end of your content\",\n\t\t\"SCROLL_TOP\": \"Scroll to top\",\n\t\t\"CHECKBOX_HEADER\": \"Select all rows\",\n\t\t\"CHECKBOX_ROW\": \"Select row\"\n}\n```\n",
|
|
55323
55543
|
"description": "<p>Expects an object that contains some or all of:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-none\">{\n "FILTER": "Filter",\n "END_OF_DATA": "You've reached the end of your content",\n "SCROLL_TOP": "Scroll to top",\n "CHECKBOX_HEADER": "Select all rows",\n "CHECKBOX_ROW": "Select row"\n}</code></pre></div>",
|
|
55324
55544
|
"jsdoctags": [
|
|
@@ -55340,7 +55560,7 @@
|
|
|
55340
55560
|
"name": "noData",
|
|
55341
55561
|
"type": "",
|
|
55342
55562
|
"returnType": "",
|
|
55343
|
-
"line":
|
|
55563
|
+
"line": 616
|
|
55344
55564
|
}
|
|
55345
55565
|
}
|
|
55346
55566
|
}
|
|
@@ -56589,7 +56809,7 @@
|
|
|
56589
56809
|
},
|
|
56590
56810
|
{
|
|
56591
56811
|
"name": "TableHead",
|
|
56592
|
-
"id": "component-TableHead-
|
|
56812
|
+
"id": "component-TableHead-cfe742ad940fa34f07a54dfeff16cc3bdad03f1cd874ad898d08d2d67cffa8b3959045159d929df7de79149ba3f24712e4060f04315fa90cc26de9014c8a9a35",
|
|
56593
56813
|
"file": "src/table/head/table-head.component.ts",
|
|
56594
56814
|
"encapsulation": [],
|
|
56595
56815
|
"entryComponents": [],
|
|
@@ -56601,7 +56821,7 @@
|
|
|
56601
56821
|
"styles": [
|
|
56602
56822
|
"\n\t\t.cds--table-expand-v2 {\n\t\t\tpadding-left: 2.5rem;\n\t\t}\n\t"
|
|
56603
56823
|
],
|
|
56604
|
-
"template": "<ng-container *ngIf=\"model\">\n\t<tr>\n\t\t<th\n\t\t\tcdsTableHeadExpand\n\t\t\t*ngIf=\"model.hasExpandableRows()\"\n\t\t\tscope=\"col\"\n\t\t\t[ngClass]=\"{'cds--table-expand-v2': stickyHeader}\"\n\t\t\t[id]=\"model.getId('expand')\">\n\t\t</th>\n\t\t<th\n\t\t\t*ngIf=\"!skeleton && showSelectionColumn && enableSingleSelect\"\n\t\t\tscope=\"col\"\n\t\t\t[id]=\"model.getId('select')\">\n\t\t\t<!-- add width 0; since the carbon styles don't seem to constrain this headers width -->\n\t\t</th>\n\t\t<th\n\t\t\tcdsTableHeadCheckbox\n\t\t\t*ngIf=\"!skeleton && showSelectionColumn && !enableSingleSelect\"\n\t\t\tscope=\"col\"\n\t\t\t[checked]=\"selectAllCheckbox\"\n\t\t\t[indeterminate]=\"selectAllCheckboxSomeSelected\"\n\t\t\t[ariaLabel]=\"getCheckboxHeaderLabel()\"\n\t\t\t[skeleton]=\"skeleton\"\n\t\t\t[name]=\"model.getHeaderId('select')\"\n\t\t\t(change)=\"onSelectAllCheckboxChange()\"\n\t\t\t[id]=\"model.getId('select')\">\n\t\t</th>\n\t\t<ng-container *ngFor=\"let column of model.header; let i = index\">\n\t\t\t<th\n\t\t\t\t*ngIf=\"column && column.visible\"\n\t\t\t\t[ngStyle]=\"column.style\"\n\t\t\t\tcdsTableHeadCell\n\t\t\t\tscope=\"col\"\n\t\t\t\t[class]=\"column.className\"\n\t\t\t\t[sortable]=\"sortable\"\n\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t[id]=\"model.getId(i)\"\n\t\t\t\t[column]=\"column\"\n\t\t\t\t[filterTitle]=\"getFilterTitle()\"\n\t\t\t\t[attr.colspan]=\"column.colSpan\"\n\t\t\t\t[attr.rowspan]=\"column.rowSpan\"\n\t\t\t\t(sort)=\"sort.emit(i)\">\n\t\t\t</th>\n\t\t</ng-container>\n\t\t<th *ngIf=\"!skeleton && stickyHeader && scrollbarWidth\"\n\t\t\tscope=\"col\"\n\t\t\t[ngStyle]=\"{'width': scrollbarWidth + 'px', 'padding': 0, 'border': 0}\">\n\t\t\t<!--\n\t\t\t\tScrollbar pushes body to the left so this header column is added to push\n\t\t\t\tthe title bar the same amount and keep the header and body columns aligned.\n\t\t\t-->\n\t\t</th>\n\t</tr>\n</ng-container>\n<ng-content></ng-content>\n",
|
|
56824
|
+
"template": "<ng-container *ngIf=\"model\">\n\t<tr>\n\t\t<th\n\t\t\tcdsTableHeadExpand\n\t\t\t*ngIf=\"model.hasExpandableRows()\"\n\t\t\tscope=\"col\"\n\t\t\t[showExpandAllToggle]=\"showExpandAllToggle\"\n\t\t\t[ngClass]=\"{'cds--table-expand-v2': stickyHeader}\"\n\t\t\t[id]=\"model.getId('expand')\"\n\t\t\t[expanded]=\"model.expandableRowsCount() === model.expandedRowsCount()\"\n\t\t\t(expandedChange)=\"onExpandAllRowsChange($event)\">\n\t\t</th>\n\t\t<th\n\t\t\t*ngIf=\"!skeleton && showSelectionColumn && enableSingleSelect\"\n\t\t\tscope=\"col\"\n\t\t\t[id]=\"model.getId('select')\">\n\t\t\t<!-- add width 0; since the carbon styles don't seem to constrain this headers width -->\n\t\t</th>\n\t\t<th\n\t\t\tcdsTableHeadCheckbox\n\t\t\t*ngIf=\"!skeleton && showSelectionColumn && !enableSingleSelect\"\n\t\t\tscope=\"col\"\n\t\t\t[checked]=\"selectAllCheckbox\"\n\t\t\t[indeterminate]=\"selectAllCheckboxSomeSelected\"\n\t\t\t[ariaLabel]=\"getCheckboxHeaderLabel()\"\n\t\t\t[skeleton]=\"skeleton\"\n\t\t\t[name]=\"model.getHeaderId('select')\"\n\t\t\t(change)=\"onSelectAllCheckboxChange()\"\n\t\t\t[id]=\"model.getId('select')\">\n\t\t</th>\n\t\t<ng-container *ngFor=\"let column of model.header; let i = index\">\n\t\t\t<th\n\t\t\t\t*ngIf=\"column && column.visible\"\n\t\t\t\t[ngStyle]=\"column.style\"\n\t\t\t\tcdsTableHeadCell\n\t\t\t\tscope=\"col\"\n\t\t\t\t[class]=\"column.className\"\n\t\t\t\t[sortable]=\"sortable\"\n\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t[id]=\"model.getId(i)\"\n\t\t\t\t[column]=\"column\"\n\t\t\t\t[filterTitle]=\"getFilterTitle()\"\n\t\t\t\t[attr.colspan]=\"column.colSpan\"\n\t\t\t\t[attr.rowspan]=\"column.rowSpan\"\n\t\t\t\t(sort)=\"sort.emit(i)\">\n\t\t\t</th>\n\t\t</ng-container>\n\t\t<th *ngIf=\"!skeleton && stickyHeader && scrollbarWidth\"\n\t\t\tscope=\"col\"\n\t\t\t[ngStyle]=\"{'width': scrollbarWidth + 'px', 'padding': 0, 'border': 0}\">\n\t\t\t<!--\n\t\t\t\tScrollbar pushes body to the left so this header column is added to push\n\t\t\t\tthe title bar the same amount and keep the header and body columns aligned.\n\t\t\t-->\n\t\t</th>\n\t</tr>\n</ng-container>\n<ng-content></ng-content>\n",
|
|
56605
56825
|
"templateUrl": [],
|
|
56606
56826
|
"viewProviders": [],
|
|
56607
56827
|
"hostDirectives": [],
|
|
@@ -56610,7 +56830,7 @@
|
|
|
56610
56830
|
"name": "checkboxHeaderLabel",
|
|
56611
56831
|
"deprecated": false,
|
|
56612
56832
|
"deprecationMessage": "",
|
|
56613
|
-
"line":
|
|
56833
|
+
"line": 117,
|
|
56614
56834
|
"type": "string | Observable",
|
|
56615
56835
|
"decorators": []
|
|
56616
56836
|
},
|
|
@@ -56619,7 +56839,7 @@
|
|
|
56619
56839
|
"defaultValue": "false",
|
|
56620
56840
|
"deprecated": false,
|
|
56621
56841
|
"deprecationMessage": "",
|
|
56622
|
-
"line":
|
|
56842
|
+
"line": 98,
|
|
56623
56843
|
"type": "boolean",
|
|
56624
56844
|
"decorators": []
|
|
56625
56845
|
},
|
|
@@ -56627,7 +56847,7 @@
|
|
|
56627
56847
|
"name": "filterTitle",
|
|
56628
56848
|
"deprecated": false,
|
|
56629
56849
|
"deprecationMessage": "",
|
|
56630
|
-
"line":
|
|
56850
|
+
"line": 144,
|
|
56631
56851
|
"type": "string | Observable",
|
|
56632
56852
|
"decorators": []
|
|
56633
56853
|
},
|
|
@@ -56635,7 +56855,7 @@
|
|
|
56635
56855
|
"name": "model",
|
|
56636
56856
|
"deprecated": false,
|
|
56637
56857
|
"deprecationMessage": "",
|
|
56638
|
-
"line":
|
|
56858
|
+
"line": 94,
|
|
56639
56859
|
"type": "TableModel",
|
|
56640
56860
|
"decorators": []
|
|
56641
56861
|
},
|
|
@@ -56644,7 +56864,7 @@
|
|
|
56644
56864
|
"defaultValue": "false",
|
|
56645
56865
|
"deprecated": false,
|
|
56646
56866
|
"deprecationMessage": "",
|
|
56647
|
-
"line":
|
|
56867
|
+
"line": 102,
|
|
56648
56868
|
"type": "boolean",
|
|
56649
56869
|
"decorators": []
|
|
56650
56870
|
},
|
|
@@ -56653,7 +56873,16 @@
|
|
|
56653
56873
|
"defaultValue": "false",
|
|
56654
56874
|
"deprecated": false,
|
|
56655
56875
|
"deprecationMessage": "",
|
|
56656
|
-
"line":
|
|
56876
|
+
"line": 100,
|
|
56877
|
+
"type": "boolean",
|
|
56878
|
+
"decorators": []
|
|
56879
|
+
},
|
|
56880
|
+
{
|
|
56881
|
+
"name": "showExpandAllToggle",
|
|
56882
|
+
"defaultValue": "false",
|
|
56883
|
+
"deprecated": false,
|
|
56884
|
+
"deprecationMessage": "",
|
|
56885
|
+
"line": 108,
|
|
56657
56886
|
"type": "boolean",
|
|
56658
56887
|
"decorators": []
|
|
56659
56888
|
},
|
|
@@ -56662,7 +56891,7 @@
|
|
|
56662
56891
|
"defaultValue": "true",
|
|
56663
56892
|
"deprecated": false,
|
|
56664
56893
|
"deprecationMessage": "",
|
|
56665
|
-
"line":
|
|
56894
|
+
"line": 96,
|
|
56666
56895
|
"type": "boolean",
|
|
56667
56896
|
"decorators": []
|
|
56668
56897
|
},
|
|
@@ -56671,7 +56900,7 @@
|
|
|
56671
56900
|
"defaultValue": "false",
|
|
56672
56901
|
"deprecated": false,
|
|
56673
56902
|
"deprecationMessage": "",
|
|
56674
|
-
"line":
|
|
56903
|
+
"line": 104,
|
|
56675
56904
|
"type": "boolean",
|
|
56676
56905
|
"decorators": []
|
|
56677
56906
|
},
|
|
@@ -56682,7 +56911,7 @@
|
|
|
56682
56911
|
"deprecationMessage": "",
|
|
56683
56912
|
"rawdescription": "\n\nSetting sortable to false will disable all headers including headers which are sortable. Is is\npossible to set the sortable state on the header item to disable/enable sorting for only some headers.\n",
|
|
56684
56913
|
"description": "<p>Setting sortable to false will disable all headers including headers which are sortable. Is is\npossible to set the sortable state on the header item to disable/enable sorting for only some headers.</p>\n",
|
|
56685
|
-
"line":
|
|
56914
|
+
"line": 114,
|
|
56686
56915
|
"type": "boolean",
|
|
56687
56916
|
"decorators": []
|
|
56688
56917
|
},
|
|
@@ -56690,7 +56919,7 @@
|
|
|
56690
56919
|
"name": "sortAscendingLabel",
|
|
56691
56920
|
"deprecated": false,
|
|
56692
56921
|
"deprecationMessage": "",
|
|
56693
|
-
"line":
|
|
56922
|
+
"line": 135,
|
|
56694
56923
|
"type": "string | Observable",
|
|
56695
56924
|
"decorators": []
|
|
56696
56925
|
},
|
|
@@ -56698,7 +56927,7 @@
|
|
|
56698
56927
|
"name": "sortDescendingLabel",
|
|
56699
56928
|
"deprecated": false,
|
|
56700
56929
|
"deprecationMessage": "",
|
|
56701
|
-
"line":
|
|
56930
|
+
"line": 126,
|
|
56702
56931
|
"type": "string | Observable",
|
|
56703
56932
|
"decorators": []
|
|
56704
56933
|
},
|
|
@@ -56707,12 +56936,53 @@
|
|
|
56707
56936
|
"defaultValue": "false",
|
|
56708
56937
|
"deprecated": false,
|
|
56709
56938
|
"deprecationMessage": "",
|
|
56710
|
-
"line":
|
|
56939
|
+
"line": 106,
|
|
56711
56940
|
"type": "boolean",
|
|
56712
56941
|
"decorators": []
|
|
56713
56942
|
}
|
|
56714
56943
|
],
|
|
56715
56944
|
"outputsClass": [
|
|
56945
|
+
{
|
|
56946
|
+
"name": "collapseAllRows",
|
|
56947
|
+
"defaultValue": "new EventEmitter<TableModel>()",
|
|
56948
|
+
"deprecated": false,
|
|
56949
|
+
"deprecationMessage": "",
|
|
56950
|
+
"rawdescription": "\n\nEmits if all rows are collapsed.\n\n",
|
|
56951
|
+
"description": "<p>Emits if all rows are collapsed.</p>\n",
|
|
56952
|
+
"jsdoctags": [
|
|
56953
|
+
{
|
|
56954
|
+
"pos": 4493,
|
|
56955
|
+
"end": 4508,
|
|
56956
|
+
"flags": 16842752,
|
|
56957
|
+
"modifierFlagsCache": 0,
|
|
56958
|
+
"transformFlags": 0,
|
|
56959
|
+
"kind": 348,
|
|
56960
|
+
"tagName": {
|
|
56961
|
+
"pos": 4494,
|
|
56962
|
+
"end": 4499,
|
|
56963
|
+
"flags": 16842752,
|
|
56964
|
+
"modifierFlagsCache": 0,
|
|
56965
|
+
"transformFlags": 0,
|
|
56966
|
+
"kind": 80,
|
|
56967
|
+
"escapedText": "param"
|
|
56968
|
+
},
|
|
56969
|
+
"comment": "",
|
|
56970
|
+
"name": {
|
|
56971
|
+
"pos": 4500,
|
|
56972
|
+
"end": 4505,
|
|
56973
|
+
"flags": 16842752,
|
|
56974
|
+
"modifierFlagsCache": 0,
|
|
56975
|
+
"transformFlags": 0,
|
|
56976
|
+
"kind": 80,
|
|
56977
|
+
"escapedText": "model"
|
|
56978
|
+
},
|
|
56979
|
+
"isNameFirst": true,
|
|
56980
|
+
"isBracketed": false
|
|
56981
|
+
}
|
|
56982
|
+
],
|
|
56983
|
+
"line": 179,
|
|
56984
|
+
"type": "EventEmitter"
|
|
56985
|
+
},
|
|
56716
56986
|
{
|
|
56717
56987
|
"name": "deselectAll",
|
|
56718
56988
|
"defaultValue": "new EventEmitter<TableModel>()",
|
|
@@ -56722,15 +56992,15 @@
|
|
|
56722
56992
|
"description": "<p>Emits if all rows are deselected.</p>\n",
|
|
56723
56993
|
"jsdoctags": [
|
|
56724
56994
|
{
|
|
56725
|
-
"pos":
|
|
56726
|
-
"end":
|
|
56995
|
+
"pos": 4242,
|
|
56996
|
+
"end": 4257,
|
|
56727
56997
|
"flags": 16842752,
|
|
56728
56998
|
"modifierFlagsCache": 0,
|
|
56729
56999
|
"transformFlags": 0,
|
|
56730
57000
|
"kind": 348,
|
|
56731
57001
|
"tagName": {
|
|
56732
|
-
"pos":
|
|
56733
|
-
"end":
|
|
57002
|
+
"pos": 4243,
|
|
57003
|
+
"end": 4248,
|
|
56734
57004
|
"flags": 16842752,
|
|
56735
57005
|
"modifierFlagsCache": 0,
|
|
56736
57006
|
"transformFlags": 0,
|
|
@@ -56739,8 +57009,8 @@
|
|
|
56739
57009
|
},
|
|
56740
57010
|
"comment": "",
|
|
56741
57011
|
"name": {
|
|
56742
|
-
"pos":
|
|
56743
|
-
"end":
|
|
57012
|
+
"pos": 4249,
|
|
57013
|
+
"end": 4254,
|
|
56744
57014
|
"flags": 16842752,
|
|
56745
57015
|
"modifierFlagsCache": 0,
|
|
56746
57016
|
"transformFlags": 0,
|
|
@@ -56751,7 +57021,48 @@
|
|
|
56751
57021
|
"isBracketed": false
|
|
56752
57022
|
}
|
|
56753
57023
|
],
|
|
56754
|
-
"line":
|
|
57024
|
+
"line": 167,
|
|
57025
|
+
"type": "EventEmitter"
|
|
57026
|
+
},
|
|
57027
|
+
{
|
|
57028
|
+
"name": "expandAllRows",
|
|
57029
|
+
"defaultValue": "new EventEmitter<TableModel>()",
|
|
57030
|
+
"deprecated": false,
|
|
57031
|
+
"deprecationMessage": "",
|
|
57032
|
+
"rawdescription": "\n\nEmits if all rows are expanded.\n\n",
|
|
57033
|
+
"description": "<p>Emits if all rows are expanded.</p>\n",
|
|
57034
|
+
"jsdoctags": [
|
|
57035
|
+
{
|
|
57036
|
+
"pos": 4366,
|
|
57037
|
+
"end": 4381,
|
|
57038
|
+
"flags": 16842752,
|
|
57039
|
+
"modifierFlagsCache": 0,
|
|
57040
|
+
"transformFlags": 0,
|
|
57041
|
+
"kind": 348,
|
|
57042
|
+
"tagName": {
|
|
57043
|
+
"pos": 4367,
|
|
57044
|
+
"end": 4372,
|
|
57045
|
+
"flags": 16842752,
|
|
57046
|
+
"modifierFlagsCache": 0,
|
|
57047
|
+
"transformFlags": 0,
|
|
57048
|
+
"kind": 80,
|
|
57049
|
+
"escapedText": "param"
|
|
57050
|
+
},
|
|
57051
|
+
"comment": "",
|
|
57052
|
+
"name": {
|
|
57053
|
+
"pos": 4373,
|
|
57054
|
+
"end": 4378,
|
|
57055
|
+
"flags": 16842752,
|
|
57056
|
+
"modifierFlagsCache": 0,
|
|
57057
|
+
"transformFlags": 0,
|
|
57058
|
+
"kind": 80,
|
|
57059
|
+
"escapedText": "model"
|
|
57060
|
+
},
|
|
57061
|
+
"isNameFirst": true,
|
|
57062
|
+
"isBracketed": false
|
|
57063
|
+
}
|
|
57064
|
+
],
|
|
57065
|
+
"line": 173,
|
|
56755
57066
|
"type": "EventEmitter"
|
|
56756
57067
|
},
|
|
56757
57068
|
{
|
|
@@ -56763,15 +57074,15 @@
|
|
|
56763
57074
|
"description": "<p>Emits if all rows are selected.</p>\n",
|
|
56764
57075
|
"jsdoctags": [
|
|
56765
57076
|
{
|
|
56766
|
-
"pos":
|
|
56767
|
-
"end":
|
|
57077
|
+
"pos": 4118,
|
|
57078
|
+
"end": 4133,
|
|
56768
57079
|
"flags": 16842752,
|
|
56769
57080
|
"modifierFlagsCache": 0,
|
|
56770
57081
|
"transformFlags": 0,
|
|
56771
57082
|
"kind": 348,
|
|
56772
57083
|
"tagName": {
|
|
56773
|
-
"pos":
|
|
56774
|
-
"end":
|
|
57084
|
+
"pos": 4119,
|
|
57085
|
+
"end": 4124,
|
|
56775
57086
|
"flags": 16842752,
|
|
56776
57087
|
"modifierFlagsCache": 0,
|
|
56777
57088
|
"transformFlags": 0,
|
|
@@ -56780,8 +57091,8 @@
|
|
|
56780
57091
|
},
|
|
56781
57092
|
"comment": "",
|
|
56782
57093
|
"name": {
|
|
56783
|
-
"pos":
|
|
56784
|
-
"end":
|
|
57094
|
+
"pos": 4125,
|
|
57095
|
+
"end": 4130,
|
|
56785
57096
|
"flags": 16842752,
|
|
56786
57097
|
"modifierFlagsCache": 0,
|
|
56787
57098
|
"transformFlags": 0,
|
|
@@ -56792,7 +57103,7 @@
|
|
|
56792
57103
|
"isBracketed": false
|
|
56793
57104
|
}
|
|
56794
57105
|
],
|
|
56795
|
-
"line":
|
|
57106
|
+
"line": 161,
|
|
56796
57107
|
"type": "EventEmitter"
|
|
56797
57108
|
},
|
|
56798
57109
|
{
|
|
@@ -56802,7 +57113,7 @@
|
|
|
56802
57113
|
"deprecationMessage": "",
|
|
56803
57114
|
"rawdescription": "\n\nEmits an index of the column that wants to be sorted.\n",
|
|
56804
57115
|
"description": "<p>Emits an index of the column that wants to be sorted.</p>\n",
|
|
56805
|
-
"line":
|
|
57116
|
+
"line": 155,
|
|
56806
57117
|
"type": "EventEmitter"
|
|
56807
57118
|
}
|
|
56808
57119
|
],
|
|
@@ -56815,7 +57126,7 @@
|
|
|
56815
57126
|
"type": "number",
|
|
56816
57127
|
"optional": false,
|
|
56817
57128
|
"description": "",
|
|
56818
|
-
"line":
|
|
57129
|
+
"line": 181,
|
|
56819
57130
|
"modifierKind": [
|
|
56820
57131
|
125
|
|
56821
57132
|
]
|
|
@@ -56828,7 +57139,7 @@
|
|
|
56828
57139
|
"optional": false,
|
|
56829
57140
|
"returnType": "Observable<string>",
|
|
56830
57141
|
"typeParameters": [],
|
|
56831
|
-
"line":
|
|
57142
|
+
"line": 212,
|
|
56832
57143
|
"deprecated": false,
|
|
56833
57144
|
"deprecationMessage": ""
|
|
56834
57145
|
},
|
|
@@ -56838,7 +57149,7 @@
|
|
|
56838
57149
|
"optional": false,
|
|
56839
57150
|
"returnType": "Observable<string>",
|
|
56840
57151
|
"typeParameters": [],
|
|
56841
|
-
"line":
|
|
57152
|
+
"line": 224,
|
|
56842
57153
|
"deprecated": false,
|
|
56843
57154
|
"deprecationMessage": ""
|
|
56844
57155
|
},
|
|
@@ -56848,7 +57159,7 @@
|
|
|
56848
57159
|
"optional": false,
|
|
56849
57160
|
"returnType": "Observable<string>",
|
|
56850
57161
|
"typeParameters": [],
|
|
56851
|
-
"line":
|
|
57162
|
+
"line": 220,
|
|
56852
57163
|
"deprecated": false,
|
|
56853
57164
|
"deprecationMessage": ""
|
|
56854
57165
|
},
|
|
@@ -56858,17 +57169,45 @@
|
|
|
56858
57169
|
"optional": false,
|
|
56859
57170
|
"returnType": "Observable<string>",
|
|
56860
57171
|
"typeParameters": [],
|
|
56861
|
-
"line":
|
|
57172
|
+
"line": 216,
|
|
56862
57173
|
"deprecated": false,
|
|
56863
57174
|
"deprecationMessage": ""
|
|
56864
57175
|
},
|
|
57176
|
+
{
|
|
57177
|
+
"name": "onExpandAllRowsChange",
|
|
57178
|
+
"args": [
|
|
57179
|
+
{
|
|
57180
|
+
"name": "expand",
|
|
57181
|
+
"type": "boolean",
|
|
57182
|
+
"deprecated": false,
|
|
57183
|
+
"deprecationMessage": ""
|
|
57184
|
+
}
|
|
57185
|
+
],
|
|
57186
|
+
"optional": false,
|
|
57187
|
+
"returnType": "void",
|
|
57188
|
+
"typeParameters": [],
|
|
57189
|
+
"line": 204,
|
|
57190
|
+
"deprecated": false,
|
|
57191
|
+
"deprecationMessage": "",
|
|
57192
|
+
"jsdoctags": [
|
|
57193
|
+
{
|
|
57194
|
+
"name": "expand",
|
|
57195
|
+
"type": "boolean",
|
|
57196
|
+
"deprecated": false,
|
|
57197
|
+
"deprecationMessage": "",
|
|
57198
|
+
"tagName": {
|
|
57199
|
+
"text": "param"
|
|
57200
|
+
}
|
|
57201
|
+
}
|
|
57202
|
+
]
|
|
57203
|
+
},
|
|
56865
57204
|
{
|
|
56866
57205
|
"name": "onSelectAllCheckboxChange",
|
|
56867
57206
|
"args": [],
|
|
56868
57207
|
"optional": false,
|
|
56869
57208
|
"returnType": "void",
|
|
56870
57209
|
"typeParameters": [],
|
|
56871
|
-
"line":
|
|
57210
|
+
"line": 196,
|
|
56872
57211
|
"deprecated": false,
|
|
56873
57212
|
"deprecationMessage": ""
|
|
56874
57213
|
}
|
|
@@ -56882,7 +57221,7 @@
|
|
|
56882
57221
|
"description": "<p>A subcomponent that creates the thead of the table</p>\n<h2>Basic usage</h2>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-html\"> <thead cdsTableHead [model]="model"></thead></code></pre></div>",
|
|
56883
57222
|
"rawdescription": "\n\nA subcomponent that creates the thead of the table\n\n## Basic usage\n\n```html\n\t<thead cdsTableHead [model]=\"model\"></thead>\n```\n",
|
|
56884
57223
|
"type": "component",
|
|
56885
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tAfterViewInit\n} from \"@angular/core\";\n\nimport { TableModel } from \"../table-model.class\";\nimport { getScrollbarWidth } from \"carbon-components-angular/utils\";\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { Observable } from \"rxjs\";\nimport { TableRowSize } from \"../table.types\";\n\n/**\n * A subcomponent that creates the thead of the table\n *\n * ## Basic usage\n *\n * ```html\n * \t<thead cdsTableHead [model]=\"model\"></thead>\n * ```\n */\n@Component({\n\t// tslint:disable-next-line:component-selector\n\tselector: \"[cdsTableHead], [ibmTableHead]\",\n\ttemplate: `\n\t<ng-container *ngIf=\"model\">\n\t\t<tr>\n\t\t\t<th\n\t\t\t\tcdsTableHeadExpand\n\t\t\t\t*ngIf=\"model.hasExpandableRows()\"\n\t\t\t\tscope=\"col\"\n\t\t\t\t[ngClass]=\"{'cds--table-expand-v2': stickyHeader}\"\n\t\t\t\t[id]=\"model.getId('expand')\">\n\t\t\t</th>\n\t\t\t<th\n\t\t\t\t*ngIf=\"!skeleton && showSelectionColumn && enableSingleSelect\"\n\t\t\t\tscope=\"col\"\n\t\t\t\t[id]=\"model.getId('select')\">\n\t\t\t\t<!-- add width 0; since the carbon styles don't seem to constrain this headers width -->\n\t\t\t</th>\n\t\t\t<th\n\t\t\t\tcdsTableHeadCheckbox\n\t\t\t\t*ngIf=\"!skeleton && showSelectionColumn && !enableSingleSelect\"\n\t\t\t\tscope=\"col\"\n\t\t\t\t[checked]=\"selectAllCheckbox\"\n\t\t\t\t[indeterminate]=\"selectAllCheckboxSomeSelected\"\n\t\t\t\t[ariaLabel]=\"getCheckboxHeaderLabel()\"\n\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t[name]=\"model.getHeaderId('select')\"\n\t\t\t\t(change)=\"onSelectAllCheckboxChange()\"\n\t\t\t\t[id]=\"model.getId('select')\">\n\t\t\t</th>\n\t\t\t<ng-container *ngFor=\"let column of model.header; let i = index\">\n\t\t\t\t<th\n\t\t\t\t\t*ngIf=\"column && column.visible\"\n\t\t\t\t\t[ngStyle]=\"column.style\"\n\t\t\t\t\tcdsTableHeadCell\n\t\t\t\t\tscope=\"col\"\n\t\t\t\t\t[class]=\"column.className\"\n\t\t\t\t\t[sortable]=\"sortable\"\n\t\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t\t[id]=\"model.getId(i)\"\n\t\t\t\t\t[column]=\"column\"\n\t\t\t\t\t[filterTitle]=\"getFilterTitle()\"\n\t\t\t\t\t[attr.colspan]=\"column.colSpan\"\n\t\t\t\t\t[attr.rowspan]=\"column.rowSpan\"\n\t\t\t\t\t(sort)=\"sort.emit(i)\">\n\t\t\t\t</th>\n\t\t\t</ng-container>\n\t\t\t<th *ngIf=\"!skeleton && stickyHeader && scrollbarWidth\"\n\t\t\t\tscope=\"col\"\n\t\t\t\t[ngStyle]=\"{'width': scrollbarWidth + 'px', 'padding': 0, 'border': 0}\">\n\t\t\t\t<!--\n\t\t\t\t\tScrollbar pushes body to the left so this header column is added to push\n\t\t\t\t\tthe title bar the same amount and keep the header and body columns aligned.\n\t\t\t\t-->\n\t\t\t</th>\n\t\t</tr>\n\t</ng-container>\n\t<ng-content></ng-content>\n\t`,\n\tstyles: [`\n\t\t.cds--table-expand-v2 {\n\t\t\tpadding-left: 2.5rem;\n\t\t}\n\t`]\n})\nexport class TableHead implements AfterViewInit {\n\t@Input() model: TableModel;\n\n\t@Input() showSelectionColumn = true;\n\n\t@Input() enableSingleSelect = false;\n\n\t@Input() selectAllCheckboxSomeSelected = false;\n\n\t@Input() selectAllCheckbox = false;\n\n\t@Input() skeleton = false;\n\n\t@Input() stickyHeader = false;\n\n\t/**\n\t * Setting sortable to false will disable all headers including headers which are sortable. Is is\n\t * possible to set the sortable state on the header item to disable/enable sorting for only some headers.\n\t */\n\t@Input() sortable = true;\n\n\t@Input()\n\tset checkboxHeaderLabel(value: string | Observable<string>) {\n\t\tthis._checkboxHeaderLabel.override(value);\n\t}\n\n\tget checkboxHeaderLabel() {\n\t\treturn this._checkboxHeaderLabel.value;\n\t}\n\n\t@Input()\n\tset sortDescendingLabel(value: string | Observable<string>) {\n\t\tthis._sortDescendingLabel.override(value);\n\t}\n\n\tget sortDescendingLabel() {\n\t\treturn this._sortDescendingLabel.value;\n\t}\n\n\t@Input()\n\tset sortAscendingLabel(value: string | Observable<string>) {\n\t\tthis._sortAscendingLabel.override(value);\n\t}\n\n\tget sortAscendingLabel() {\n\t\treturn this._sortAscendingLabel.value;\n\t}\n\n\t@Input()\n\tset filterTitle(value: string | Observable<string>) {\n\t\tthis._filterTitle.override(value);\n\t}\n\n\tget filterTitle() {\n\t\treturn this._filterTitle.value;\n\t}\n\n\t/**\n\t * Emits an index of the column that wants to be sorted.\n\t */\n\t@Output() sort = new EventEmitter<number>();\n\t/**\n\t * Emits if all rows are selected.\n\t *\n\t * @param model\n\t */\n\t@Output() selectAll = new EventEmitter<TableModel>();\n\t/**\n\t * Emits if all rows are deselected.\n\t *\n\t * @param model\n\t */\n\t@Output() deselectAll = new EventEmitter<TableModel>();\n\n\tpublic scrollbarWidth = 0;\n\n\tprotected _checkboxHeaderLabel = this.i18n.getOverridable(\"TABLE.CHECKBOX_HEADER\");\n\tprotected _sortDescendingLabel = this.i18n.getOverridable(\"TABLE.SORT_DESCENDING\");\n\tprotected _sortAscendingLabel = this.i18n.getOverridable(\"TABLE.SORT_ASCENDING\");\n\tprotected _filterTitle = this.i18n.getOverridable(\"TABLE.FILTER\");\n\n\tconstructor(protected i18n: I18n) {}\n\n\tngAfterViewInit() {\n\t\tsetTimeout(() => {\n\t\t\tthis.scrollbarWidth = getScrollbarWidth();\n\t\t});\n\t}\n\n\tonSelectAllCheckboxChange() {\n\t\tif (!this.selectAllCheckbox && !this.selectAllCheckboxSomeSelected) {\n\t\t\tthis.selectAll.emit(this.model);\n\t\t} else {\n\t\t\tthis.deselectAll.emit(this.model);\n\t\t}\n\t}\n\n\tgetCheckboxHeaderLabel(): Observable<string> {\n\t\treturn this._checkboxHeaderLabel.subject;\n\t}\n\n\tgetSortDescendingLabel(): Observable<string> {\n\t\treturn this._sortDescendingLabel.subject;\n\t}\n\n\tgetSortAscendingLabel(): Observable<string> {\n\t\treturn this._sortAscendingLabel.subject;\n\t}\n\n\tgetFilterTitle(): Observable<string> {\n\t\treturn this._filterTitle.subject;\n\t}\n}\n",
|
|
57224
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tAfterViewInit\n} from \"@angular/core\";\n\nimport { TableModel } from \"../table-model.class\";\nimport { getScrollbarWidth } from \"carbon-components-angular/utils\";\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { Observable } from \"rxjs\";\nimport { TableRowSize } from \"../table.types\";\n\n/**\n * A subcomponent that creates the thead of the table\n *\n * ## Basic usage\n *\n * ```html\n * \t<thead cdsTableHead [model]=\"model\"></thead>\n * ```\n */\n@Component({\n\t// tslint:disable-next-line:component-selector\n\tselector: \"[cdsTableHead], [ibmTableHead]\",\n\ttemplate: `\n\t<ng-container *ngIf=\"model\">\n\t\t<tr>\n\t\t\t<th\n\t\t\t\tcdsTableHeadExpand\n\t\t\t\t*ngIf=\"model.hasExpandableRows()\"\n\t\t\t\tscope=\"col\"\n\t\t\t\t[showExpandAllToggle]=\"showExpandAllToggle\"\n\t\t\t\t[ngClass]=\"{'cds--table-expand-v2': stickyHeader}\"\n\t\t\t\t[id]=\"model.getId('expand')\"\n\t\t\t\t[expanded]=\"model.expandableRowsCount() === model.expandedRowsCount()\"\n\t\t\t\t(expandedChange)=\"onExpandAllRowsChange($event)\">\n\t\t\t</th>\n\t\t\t<th\n\t\t\t\t*ngIf=\"!skeleton && showSelectionColumn && enableSingleSelect\"\n\t\t\t\tscope=\"col\"\n\t\t\t\t[id]=\"model.getId('select')\">\n\t\t\t\t<!-- add width 0; since the carbon styles don't seem to constrain this headers width -->\n\t\t\t</th>\n\t\t\t<th\n\t\t\t\tcdsTableHeadCheckbox\n\t\t\t\t*ngIf=\"!skeleton && showSelectionColumn && !enableSingleSelect\"\n\t\t\t\tscope=\"col\"\n\t\t\t\t[checked]=\"selectAllCheckbox\"\n\t\t\t\t[indeterminate]=\"selectAllCheckboxSomeSelected\"\n\t\t\t\t[ariaLabel]=\"getCheckboxHeaderLabel()\"\n\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t[name]=\"model.getHeaderId('select')\"\n\t\t\t\t(change)=\"onSelectAllCheckboxChange()\"\n\t\t\t\t[id]=\"model.getId('select')\">\n\t\t\t</th>\n\t\t\t<ng-container *ngFor=\"let column of model.header; let i = index\">\n\t\t\t\t<th\n\t\t\t\t\t*ngIf=\"column && column.visible\"\n\t\t\t\t\t[ngStyle]=\"column.style\"\n\t\t\t\t\tcdsTableHeadCell\n\t\t\t\t\tscope=\"col\"\n\t\t\t\t\t[class]=\"column.className\"\n\t\t\t\t\t[sortable]=\"sortable\"\n\t\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t\t[id]=\"model.getId(i)\"\n\t\t\t\t\t[column]=\"column\"\n\t\t\t\t\t[filterTitle]=\"getFilterTitle()\"\n\t\t\t\t\t[attr.colspan]=\"column.colSpan\"\n\t\t\t\t\t[attr.rowspan]=\"column.rowSpan\"\n\t\t\t\t\t(sort)=\"sort.emit(i)\">\n\t\t\t\t</th>\n\t\t\t</ng-container>\n\t\t\t<th *ngIf=\"!skeleton && stickyHeader && scrollbarWidth\"\n\t\t\t\tscope=\"col\"\n\t\t\t\t[ngStyle]=\"{'width': scrollbarWidth + 'px', 'padding': 0, 'border': 0}\">\n\t\t\t\t<!--\n\t\t\t\t\tScrollbar pushes body to the left so this header column is added to push\n\t\t\t\t\tthe title bar the same amount and keep the header and body columns aligned.\n\t\t\t\t-->\n\t\t\t</th>\n\t\t</tr>\n\t</ng-container>\n\t<ng-content></ng-content>\n\t`,\n\tstyles: [`\n\t\t.cds--table-expand-v2 {\n\t\t\tpadding-left: 2.5rem;\n\t\t}\n\t`]\n})\nexport class TableHead implements AfterViewInit {\n\t@Input() model: TableModel;\n\n\t@Input() showSelectionColumn = true;\n\n\t@Input() enableSingleSelect = false;\n\n\t@Input() selectAllCheckboxSomeSelected = false;\n\n\t@Input() selectAllCheckbox = false;\n\n\t@Input() skeleton = false;\n\n\t@Input() stickyHeader = false;\n\n\t@Input() showExpandAllToggle = false;\n\n\t/**\n\t * Setting sortable to false will disable all headers including headers which are sortable. Is is\n\t * possible to set the sortable state on the header item to disable/enable sorting for only some headers.\n\t */\n\t@Input() sortable = true;\n\n\t@Input()\n\tset checkboxHeaderLabel(value: string | Observable<string>) {\n\t\tthis._checkboxHeaderLabel.override(value);\n\t}\n\n\tget checkboxHeaderLabel() {\n\t\treturn this._checkboxHeaderLabel.value;\n\t}\n\n\t@Input()\n\tset sortDescendingLabel(value: string | Observable<string>) {\n\t\tthis._sortDescendingLabel.override(value);\n\t}\n\n\tget sortDescendingLabel() {\n\t\treturn this._sortDescendingLabel.value;\n\t}\n\n\t@Input()\n\tset sortAscendingLabel(value: string | Observable<string>) {\n\t\tthis._sortAscendingLabel.override(value);\n\t}\n\n\tget sortAscendingLabel() {\n\t\treturn this._sortAscendingLabel.value;\n\t}\n\n\t@Input()\n\tset filterTitle(value: string | Observable<string>) {\n\t\tthis._filterTitle.override(value);\n\t}\n\n\tget filterTitle() {\n\t\treturn this._filterTitle.value;\n\t}\n\n\t/**\n\t * Emits an index of the column that wants to be sorted.\n\t */\n\t@Output() sort = new EventEmitter<number>();\n\t/**\n\t * Emits if all rows are selected.\n\t *\n\t * @param model\n\t */\n\t@Output() selectAll = new EventEmitter<TableModel>();\n\t/**\n\t * Emits if all rows are deselected.\n\t *\n\t * @param model\n\t */\n\t@Output() deselectAll = new EventEmitter<TableModel>();\n\t/**\n\t * Emits if all rows are expanded.\n\t *\n\t * @param model\n\t */\n\t@Output() expandAllRows = new EventEmitter<TableModel>();\n\t/**\n\t * Emits if all rows are collapsed.\n\t *\n\t * @param model\n\t */\n\t@Output() collapseAllRows = new EventEmitter<TableModel>();\n\n\tpublic scrollbarWidth = 0;\n\n\tprotected _checkboxHeaderLabel = this.i18n.getOverridable(\"TABLE.CHECKBOX_HEADER\");\n\tprotected _sortDescendingLabel = this.i18n.getOverridable(\"TABLE.SORT_DESCENDING\");\n\tprotected _sortAscendingLabel = this.i18n.getOverridable(\"TABLE.SORT_ASCENDING\");\n\tprotected _filterTitle = this.i18n.getOverridable(\"TABLE.FILTER\");\n\n\tconstructor(protected i18n: I18n) {}\n\n\tngAfterViewInit() {\n\t\tsetTimeout(() => {\n\t\t\tthis.scrollbarWidth = getScrollbarWidth();\n\t\t});\n\t}\n\n\tonSelectAllCheckboxChange() {\n\t\tif (!this.selectAllCheckbox && !this.selectAllCheckboxSomeSelected) {\n\t\t\tthis.selectAll.emit(this.model);\n\t\t} else {\n\t\t\tthis.deselectAll.emit(this.model);\n\t\t}\n\t}\n\n\tonExpandAllRowsChange(expand: boolean) {\n\t\tif (expand) {\n\t\t\tthis.expandAllRows.emit(this.model);\n\t\t} else {\n\t\t\tthis.collapseAllRows.emit(this.model);\n\t\t}\n\t}\n\n\tgetCheckboxHeaderLabel(): Observable<string> {\n\t\treturn this._checkboxHeaderLabel.subject;\n\t}\n\n\tgetSortDescendingLabel(): Observable<string> {\n\t\treturn this._sortDescendingLabel.subject;\n\t}\n\n\tgetSortAscendingLabel(): Observable<string> {\n\t\treturn this._sortAscendingLabel.subject;\n\t}\n\n\tgetFilterTitle(): Observable<string> {\n\t\treturn this._filterTitle.subject;\n\t}\n}\n",
|
|
56886
57225
|
"assetsDirs": [],
|
|
56887
57226
|
"styleUrlsData": "",
|
|
56888
57227
|
"stylesData": "\n\t\t.cds--table-expand-v2 {\n\t\t\tpadding-left: 2.5rem;\n\t\t}\n\t\n",
|
|
@@ -56899,7 +57238,7 @@
|
|
|
56899
57238
|
"deprecationMessage": ""
|
|
56900
57239
|
}
|
|
56901
57240
|
],
|
|
56902
|
-
"line":
|
|
57241
|
+
"line": 186,
|
|
56903
57242
|
"jsdoctags": [
|
|
56904
57243
|
{
|
|
56905
57244
|
"name": "i18n",
|
|
@@ -56933,7 +57272,7 @@
|
|
|
56933
57272
|
}
|
|
56934
57273
|
],
|
|
56935
57274
|
"returnType": "void",
|
|
56936
|
-
"line":
|
|
57275
|
+
"line": 117,
|
|
56937
57276
|
"jsdoctags": [
|
|
56938
57277
|
{
|
|
56939
57278
|
"name": "value",
|
|
@@ -56950,7 +57289,7 @@
|
|
|
56950
57289
|
"name": "checkboxHeaderLabel",
|
|
56951
57290
|
"type": "",
|
|
56952
57291
|
"returnType": "",
|
|
56953
|
-
"line":
|
|
57292
|
+
"line": 121
|
|
56954
57293
|
}
|
|
56955
57294
|
},
|
|
56956
57295
|
"sortDescendingLabel": {
|
|
@@ -56969,7 +57308,7 @@
|
|
|
56969
57308
|
}
|
|
56970
57309
|
],
|
|
56971
57310
|
"returnType": "void",
|
|
56972
|
-
"line":
|
|
57311
|
+
"line": 126,
|
|
56973
57312
|
"jsdoctags": [
|
|
56974
57313
|
{
|
|
56975
57314
|
"name": "value",
|
|
@@ -56986,7 +57325,7 @@
|
|
|
56986
57325
|
"name": "sortDescendingLabel",
|
|
56987
57326
|
"type": "",
|
|
56988
57327
|
"returnType": "",
|
|
56989
|
-
"line":
|
|
57328
|
+
"line": 130
|
|
56990
57329
|
}
|
|
56991
57330
|
},
|
|
56992
57331
|
"sortAscendingLabel": {
|
|
@@ -57005,7 +57344,7 @@
|
|
|
57005
57344
|
}
|
|
57006
57345
|
],
|
|
57007
57346
|
"returnType": "void",
|
|
57008
|
-
"line":
|
|
57347
|
+
"line": 135,
|
|
57009
57348
|
"jsdoctags": [
|
|
57010
57349
|
{
|
|
57011
57350
|
"name": "value",
|
|
@@ -57022,7 +57361,7 @@
|
|
|
57022
57361
|
"name": "sortAscendingLabel",
|
|
57023
57362
|
"type": "",
|
|
57024
57363
|
"returnType": "",
|
|
57025
|
-
"line":
|
|
57364
|
+
"line": 139
|
|
57026
57365
|
}
|
|
57027
57366
|
},
|
|
57028
57367
|
"filterTitle": {
|
|
@@ -57041,7 +57380,7 @@
|
|
|
57041
57380
|
}
|
|
57042
57381
|
],
|
|
57043
57382
|
"returnType": "void",
|
|
57044
|
-
"line":
|
|
57383
|
+
"line": 144,
|
|
57045
57384
|
"jsdoctags": [
|
|
57046
57385
|
{
|
|
57047
57386
|
"name": "value",
|
|
@@ -57058,7 +57397,7 @@
|
|
|
57058
57397
|
"name": "filterTitle",
|
|
57059
57398
|
"type": "",
|
|
57060
57399
|
"returnType": "",
|
|
57061
|
-
"line":
|
|
57400
|
+
"line": 148
|
|
57062
57401
|
}
|
|
57063
57402
|
}
|
|
57064
57403
|
}
|
|
@@ -57651,7 +57990,7 @@
|
|
|
57651
57990
|
},
|
|
57652
57991
|
{
|
|
57653
57992
|
"name": "TableHeadExpand",
|
|
57654
|
-
"id": "component-TableHeadExpand-
|
|
57993
|
+
"id": "component-TableHeadExpand-310facdfe3384b586a6b1fbf3ba8cf4967ffe4664332b60625d2ef474e2bb162427502c81b9543d050df86772338327986dabf3c9c8c83010ebc0a99a95388d6",
|
|
57655
57994
|
"file": "src/table/head/table-head-expand.component.ts",
|
|
57656
57995
|
"encapsulation": [],
|
|
57657
57996
|
"entryComponents": [],
|
|
@@ -57661,12 +58000,40 @@
|
|
|
57661
58000
|
"selector": "[cdsTableHeadExpand], [ibmTableHeadExpand]",
|
|
57662
58001
|
"styleUrls": [],
|
|
57663
58002
|
"styles": [],
|
|
57664
|
-
"template": "<ng-content></ng-content>\n\t",
|
|
58003
|
+
"template": "<button\n\t*ngIf=\"showExpandAllToggle\"\n\tclass=\"cds--table-expand__button\"\n\t[attr.aria-label]=\"getAriaLabel() | async\"\n\t(click)=\"expandedChange.emit(!expanded)\">\n\t<svg cdsIcon=\"chevron--right\" size=\"16\" class=\"cds--table-expand__svg\"></svg>\n</button>\n<ng-container *ngIf=\"!showExpandAllToggle\">\n\t<ng-content></ng-content>\n</ng-container>\n\t",
|
|
57665
58004
|
"templateUrl": [],
|
|
57666
58005
|
"viewProviders": [],
|
|
57667
58006
|
"hostDirectives": [],
|
|
57668
|
-
"inputsClass": [
|
|
57669
|
-
|
|
58007
|
+
"inputsClass": [
|
|
58008
|
+
{
|
|
58009
|
+
"name": "expanded",
|
|
58010
|
+
"defaultValue": "false",
|
|
58011
|
+
"deprecated": false,
|
|
58012
|
+
"deprecationMessage": "",
|
|
58013
|
+
"line": 32,
|
|
58014
|
+
"type": "boolean",
|
|
58015
|
+
"decorators": []
|
|
58016
|
+
},
|
|
58017
|
+
{
|
|
58018
|
+
"name": "showExpandAllToggle",
|
|
58019
|
+
"defaultValue": "false",
|
|
58020
|
+
"deprecated": false,
|
|
58021
|
+
"deprecationMessage": "",
|
|
58022
|
+
"line": 30,
|
|
58023
|
+
"type": "boolean",
|
|
58024
|
+
"decorators": []
|
|
58025
|
+
}
|
|
58026
|
+
],
|
|
58027
|
+
"outputsClass": [
|
|
58028
|
+
{
|
|
58029
|
+
"name": "expandedChange",
|
|
58030
|
+
"defaultValue": "new EventEmitter<boolean>()",
|
|
58031
|
+
"deprecated": false,
|
|
58032
|
+
"deprecationMessage": "",
|
|
58033
|
+
"line": 34,
|
|
58034
|
+
"type": "EventEmitter"
|
|
58035
|
+
}
|
|
58036
|
+
],
|
|
57670
58037
|
"propertiesClass": [
|
|
57671
58038
|
{
|
|
57672
58039
|
"name": "hostClass",
|
|
@@ -57676,7 +58043,7 @@
|
|
|
57676
58043
|
"type": "",
|
|
57677
58044
|
"optional": false,
|
|
57678
58045
|
"description": "",
|
|
57679
|
-
"line":
|
|
58046
|
+
"line": 28,
|
|
57680
58047
|
"decorators": [
|
|
57681
58048
|
{
|
|
57682
58049
|
"name": "HostBinding",
|
|
@@ -57688,16 +58055,35 @@
|
|
|
57688
58055
|
]
|
|
57689
58056
|
}
|
|
57690
58057
|
],
|
|
57691
|
-
"methodsClass": [
|
|
58058
|
+
"methodsClass": [
|
|
58059
|
+
{
|
|
58060
|
+
"name": "getAriaLabel",
|
|
58061
|
+
"args": [],
|
|
58062
|
+
"optional": false,
|
|
58063
|
+
"returnType": "Observable<string>",
|
|
58064
|
+
"typeParameters": [],
|
|
58065
|
+
"line": 44,
|
|
58066
|
+
"deprecated": false,
|
|
58067
|
+
"deprecationMessage": ""
|
|
58068
|
+
}
|
|
58069
|
+
],
|
|
57692
58070
|
"deprecated": false,
|
|
57693
58071
|
"deprecationMessage": "",
|
|
57694
58072
|
"hostBindings": [
|
|
58073
|
+
{
|
|
58074
|
+
"name": "attr.data-previous-value",
|
|
58075
|
+
"deprecated": false,
|
|
58076
|
+
"deprecationMessage": "",
|
|
58077
|
+
"line": 36,
|
|
58078
|
+
"type": "string",
|
|
58079
|
+
"decorators": []
|
|
58080
|
+
},
|
|
57695
58081
|
{
|
|
57696
58082
|
"name": "class.cds--table-expand",
|
|
57697
58083
|
"defaultValue": "true",
|
|
57698
58084
|
"deprecated": false,
|
|
57699
58085
|
"deprecationMessage": "",
|
|
57700
|
-
"line":
|
|
58086
|
+
"line": 28,
|
|
57701
58087
|
"type": "boolean",
|
|
57702
58088
|
"decorators": []
|
|
57703
58089
|
}
|
|
@@ -57708,11 +58094,48 @@
|
|
|
57708
58094
|
"description": "",
|
|
57709
58095
|
"rawdescription": "\n",
|
|
57710
58096
|
"type": "component",
|
|
57711
|
-
"sourceCode": "import {\n\tComponent,\n\tHostBinding\n} from \"@angular/core\";\n\n@Component({\n\t// tslint:disable-next-line: component-selector\n\tselector: \"[cdsTableHeadExpand], [ibmTableHeadExpand]\",\n\ttemplate: `\n\t\t<ng-content></ng-content>\n\t`\n})\nexport class TableHeadExpand {\n\t@HostBinding(\"class.cds--table-expand\") hostClass = true;\n}\n",
|
|
58097
|
+
"sourceCode": "import {\n\tComponent,\n\tEventEmitter,\n\tHostBinding,\n\tInput,\n\tOutput\n} from \"@angular/core\";\nimport { I18n } from \"carbon-components-angular/i18n\";\nimport { Observable } from \"rxjs\";\n\n@Component({\n\t// tslint:disable-next-line: component-selector\n\tselector: \"[cdsTableHeadExpand], [ibmTableHeadExpand]\",\n\ttemplate: `\n\t\t<button\n\t\t\t*ngIf=\"showExpandAllToggle\"\n\t\t\tclass=\"cds--table-expand__button\"\n\t\t\t[attr.aria-label]=\"getAriaLabel() | async\"\n\t\t\t(click)=\"expandedChange.emit(!expanded)\">\n\t\t\t<svg cdsIcon=\"chevron--right\" size=\"16\" class=\"cds--table-expand__svg\"></svg>\n\t\t</button>\n\t\t<ng-container *ngIf=\"!showExpandAllToggle\">\n\t\t\t<ng-content></ng-content>\n\t\t</ng-container>\n\t`\n})\nexport class TableHeadExpand {\n\t@HostBinding(\"class.cds--table-expand\") hostClass = true;\n\n\t@Input() showExpandAllToggle = false;\n\n\t@Input() expanded = false;\n\n\t@Output() expandedChange = new EventEmitter<boolean>();\n\n\t@HostBinding(\"attr.data-previous-value\") get previousValue() {\n\t\treturn this.expanded ? \"collapsed\" : null;\n\t}\n\n\tprotected _ariaLabel = this.i18n.getOverridable(\"TABLE.EXPAND_ALL_BUTTON\");\n\n\tconstructor(protected i18n: I18n) { }\n\n\tgetAriaLabel(): Observable<string> {\n\t\treturn this._ariaLabel.subject;\n\t}\n}\n",
|
|
57712
58098
|
"assetsDirs": [],
|
|
57713
58099
|
"styleUrlsData": "",
|
|
57714
58100
|
"stylesData": "",
|
|
57715
|
-
"
|
|
58101
|
+
"constructorObj": {
|
|
58102
|
+
"name": "constructor",
|
|
58103
|
+
"description": "",
|
|
58104
|
+
"deprecated": false,
|
|
58105
|
+
"deprecationMessage": "",
|
|
58106
|
+
"args": [
|
|
58107
|
+
{
|
|
58108
|
+
"name": "i18n",
|
|
58109
|
+
"type": "I18n",
|
|
58110
|
+
"deprecated": false,
|
|
58111
|
+
"deprecationMessage": ""
|
|
58112
|
+
}
|
|
58113
|
+
],
|
|
58114
|
+
"line": 40,
|
|
58115
|
+
"jsdoctags": [
|
|
58116
|
+
{
|
|
58117
|
+
"name": "i18n",
|
|
58118
|
+
"type": "I18n",
|
|
58119
|
+
"deprecated": false,
|
|
58120
|
+
"deprecationMessage": "",
|
|
58121
|
+
"tagName": {
|
|
58122
|
+
"text": "param"
|
|
58123
|
+
}
|
|
58124
|
+
}
|
|
58125
|
+
]
|
|
58126
|
+
},
|
|
58127
|
+
"extends": [],
|
|
58128
|
+
"accessors": {
|
|
58129
|
+
"previousValue": {
|
|
58130
|
+
"name": "previousValue",
|
|
58131
|
+
"getSignature": {
|
|
58132
|
+
"name": "previousValue",
|
|
58133
|
+
"type": "",
|
|
58134
|
+
"returnType": "",
|
|
58135
|
+
"line": 36
|
|
58136
|
+
}
|
|
58137
|
+
}
|
|
58138
|
+
}
|
|
57716
58139
|
},
|
|
57717
58140
|
{
|
|
57718
58141
|
"name": "TableNoDataStory",
|
|
@@ -72827,7 +73250,7 @@
|
|
|
72827
73250
|
"deprecated": false,
|
|
72828
73251
|
"deprecationMessage": "",
|
|
72829
73252
|
"type": "",
|
|
72830
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-table-container>\n\t\t\t<cds-table-header>\n\t\t\t\t<h4 cdsTableHeaderTitle>{{title}}</h4>\n\t\t\t\t<p cdsTableHeaderDescription>{{description}}</p>\n\t\t\t</cds-table-header>\n\t\t\t<!--\n\t\t\tapp-* components are for demo purposes only.\n\t\t\tYou can create your own implementation by using the component source found at:\n\t\t\thttps://github.com/IBM/carbon-components-angular/tree/master/src/table/stories/app-expansion-table.component.ts\n\t\t\t-->\n\t\t\t<app-expansion-table\n\t\t\t\t[size]=\"size\"\n\t\t\t\t[showSelectionColumn]=\"showSelectionColumn\"\n\t\t\t\t[sortable]=\"sortable\"\n\t\t\t\t[stickyHeader]=\"stickyHeader\"\n\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t[striped]=\"striped\"\n\t\t\t\t[isDataGrid]=\"isDataGrid\">\n\t\t\t</app-expansion-table>\n\t\t</cds-table-container>\n\t`\n})"
|
|
73253
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-table-container>\n\t\t\t<cds-table-header>\n\t\t\t\t<h4 cdsTableHeaderTitle>{{title}}</h4>\n\t\t\t\t<p cdsTableHeaderDescription>{{description}}</p>\n\t\t\t</cds-table-header>\n\t\t\t<!--\n\t\t\tapp-* components are for demo purposes only.\n\t\t\tYou can create your own implementation by using the component source found at:\n\t\t\thttps://github.com/IBM/carbon-components-angular/tree/master/src/table/stories/app-expansion-table.component.ts\n\t\t\t-->\n\t\t\t<app-expansion-table\n\t\t\t\t[size]=\"size\"\n\t\t\t\t[showSelectionColumn]=\"showSelectionColumn\"\n\t\t\t\t[sortable]=\"sortable\"\n\t\t\t\t[stickyHeader]=\"stickyHeader\"\n\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t[striped]=\"striped\"\n\t\t\t\t[isDataGrid]=\"isDataGrid\"\n\t\t\t\t[showExpandAllToggle]=\"showExpandAllToggle\">\n\t\t\t</app-expansion-table>\n\t\t</cds-table-container>\n\t`\n})"
|
|
72831
73254
|
},
|
|
72832
73255
|
{
|
|
72833
73256
|
"name": "EXPERIMENTAL_SERVICE_PROVIDER",
|
|
@@ -72909,6 +73332,16 @@
|
|
|
72909
73332
|
"type": "",
|
|
72910
73333
|
"defaultValue": "Template.bind({})"
|
|
72911
73334
|
},
|
|
73335
|
+
{
|
|
73336
|
+
"name": "Fluid",
|
|
73337
|
+
"ctype": "miscellaneous",
|
|
73338
|
+
"subtype": "variable",
|
|
73339
|
+
"file": "src/number-input/number.stories.ts",
|
|
73340
|
+
"deprecated": false,
|
|
73341
|
+
"deprecationMessage": "",
|
|
73342
|
+
"type": "",
|
|
73343
|
+
"defaultValue": "Template.bind({})"
|
|
73344
|
+
},
|
|
72912
73345
|
{
|
|
72913
73346
|
"name": "Fluid",
|
|
72914
73347
|
"ctype": "miscellaneous",
|
|
@@ -73411,7 +73844,7 @@
|
|
|
73411
73844
|
"deprecated": false,
|
|
73412
73845
|
"deprecationMessage": "",
|
|
73413
73846
|
"type": "",
|
|
73414
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"[helperText]\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[min]=\"min\"\n\t\t\t[size]=\"size\"\n\t\t\t[max]=\"max\"\n\t\t\t[step]=\"step\"\n\t\t\t[precision]=\"precision\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[(ngModel)]=\"value\">\n\t\t</cds-number>\n\t\t{{ value }}\n\t`\n})"
|
|
73847
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"[helperText]\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[min]=\"min\"\n\t\t\t[size]=\"size\"\n\t\t\t[max]=\"max\"\n\t\t\t[step]=\"step\"\n\t\t\t[precision]=\"precision\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[(ngModel)]=\"value\"\n\t\t\t[fluid]=\"fluid\">\n\t\t</cds-number>\n\t\t{{ value }}\n\t`\n})"
|
|
73415
73848
|
},
|
|
73416
73849
|
{
|
|
73417
73850
|
"name": "ModelTemplate",
|
|
@@ -74468,7 +74901,7 @@
|
|
|
74468
74901
|
"deprecated": false,
|
|
74469
74902
|
"deprecationMessage": "",
|
|
74470
74903
|
"type": "",
|
|
74471
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number
|
|
74904
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\tlabel=\"Number input label\"\n\t\t\tskeleton=\"true\"\n\t\t\t[fluid]=\"fluid\">\n\t\t</cds-number>\n\t`\n})"
|
|
74472
74905
|
},
|
|
74473
74906
|
{
|
|
74474
74907
|
"name": "SkeletonTemplate",
|
|
@@ -74858,7 +75291,7 @@
|
|
|
74858
75291
|
"deprecated": false,
|
|
74859
75292
|
"deprecationMessage": "",
|
|
74860
75293
|
"type": "",
|
|
74861
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"[helperText]\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[min]=\"min\"\n\t\t\t[max]=\"max\"\n\t\t\t[step]=\"step\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[size]=\"size\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[disabled]=\"disabled\">\n\t\t</cds-number>\n\t`\n})"
|
|
75294
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"[helperText]\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[min]=\"min\"\n\t\t\t[max]=\"max\"\n\t\t\t[step]=\"step\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[size]=\"size\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[fluid]=\"fluid\">\n\t\t</cds-number>\n\t`\n})"
|
|
74862
75295
|
},
|
|
74863
75296
|
{
|
|
74864
75297
|
"name": "Template",
|
|
@@ -79800,6 +80233,16 @@
|
|
|
79800
80233
|
"type": "",
|
|
79801
80234
|
"defaultValue": "Template.bind({})"
|
|
79802
80235
|
},
|
|
80236
|
+
{
|
|
80237
|
+
"name": "Fluid",
|
|
80238
|
+
"ctype": "miscellaneous",
|
|
80239
|
+
"subtype": "variable",
|
|
80240
|
+
"file": "src/number-input/number.stories.ts",
|
|
80241
|
+
"deprecated": false,
|
|
80242
|
+
"deprecationMessage": "",
|
|
80243
|
+
"type": "",
|
|
80244
|
+
"defaultValue": "Template.bind({})"
|
|
80245
|
+
},
|
|
79803
80246
|
{
|
|
79804
80247
|
"name": "ModelTemplate",
|
|
79805
80248
|
"ctype": "miscellaneous",
|
|
@@ -79808,7 +80251,7 @@
|
|
|
79808
80251
|
"deprecated": false,
|
|
79809
80252
|
"deprecationMessage": "",
|
|
79810
80253
|
"type": "",
|
|
79811
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"[helperText]\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[min]=\"min\"\n\t\t\t[size]=\"size\"\n\t\t\t[max]=\"max\"\n\t\t\t[step]=\"step\"\n\t\t\t[precision]=\"precision\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[(ngModel)]=\"value\">\n\t\t</cds-number>\n\t\t{{ value }}\n\t`\n})"
|
|
80254
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"[helperText]\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[min]=\"min\"\n\t\t\t[size]=\"size\"\n\t\t\t[max]=\"max\"\n\t\t\t[step]=\"step\"\n\t\t\t[precision]=\"precision\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[(ngModel)]=\"value\"\n\t\t\t[fluid]=\"fluid\">\n\t\t</cds-number>\n\t\t{{ value }}\n\t`\n})"
|
|
79812
80255
|
},
|
|
79813
80256
|
{
|
|
79814
80257
|
"name": "NgModel",
|
|
@@ -79838,7 +80281,7 @@
|
|
|
79838
80281
|
"deprecated": false,
|
|
79839
80282
|
"deprecationMessage": "",
|
|
79840
80283
|
"type": "",
|
|
79841
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number
|
|
80284
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\tlabel=\"Number input label\"\n\t\t\tskeleton=\"true\"\n\t\t\t[fluid]=\"fluid\">\n\t\t</cds-number>\n\t`\n})"
|
|
79842
80285
|
},
|
|
79843
80286
|
{
|
|
79844
80287
|
"name": "Template",
|
|
@@ -79848,7 +80291,7 @@
|
|
|
79848
80291
|
"deprecated": false,
|
|
79849
80292
|
"deprecationMessage": "",
|
|
79850
80293
|
"type": "",
|
|
79851
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"[helperText]\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[min]=\"min\"\n\t\t\t[max]=\"max\"\n\t\t\t[step]=\"step\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[size]=\"size\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[disabled]=\"disabled\">\n\t\t</cds-number>\n\t`\n})"
|
|
80294
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"[helperText]\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[min]=\"min\"\n\t\t\t[max]=\"max\"\n\t\t\t[step]=\"step\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[size]=\"size\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[fluid]=\"fluid\">\n\t\t</cds-number>\n\t`\n})"
|
|
79852
80295
|
}
|
|
79853
80296
|
],
|
|
79854
80297
|
"src/pagination/pagination-nav.stories.ts": [
|
|
@@ -80340,7 +80783,7 @@
|
|
|
80340
80783
|
"deprecated": false,
|
|
80341
80784
|
"deprecationMessage": "",
|
|
80342
80785
|
"type": "",
|
|
80343
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-table-container>\n\t\t\t<cds-table-header>\n\t\t\t\t<h4 cdsTableHeaderTitle>{{title}}</h4>\n\t\t\t\t<p cdsTableHeaderDescription>{{description}}</p>\n\t\t\t</cds-table-header>\n\t\t\t<!--\n\t\t\tapp-* components are for demo purposes only.\n\t\t\tYou can create your own implementation by using the component source found at:\n\t\t\thttps://github.com/IBM/carbon-components-angular/tree/master/src/table/stories/app-expansion-table.component.ts\n\t\t\t-->\n\t\t\t<app-expansion-table\n\t\t\t\t[size]=\"size\"\n\t\t\t\t[showSelectionColumn]=\"showSelectionColumn\"\n\t\t\t\t[sortable]=\"sortable\"\n\t\t\t\t[stickyHeader]=\"stickyHeader\"\n\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t[striped]=\"striped\"\n\t\t\t\t[isDataGrid]=\"isDataGrid\">\n\t\t\t</app-expansion-table>\n\t\t</cds-table-container>\n\t`\n})"
|
|
80786
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-table-container>\n\t\t\t<cds-table-header>\n\t\t\t\t<h4 cdsTableHeaderTitle>{{title}}</h4>\n\t\t\t\t<p cdsTableHeaderDescription>{{description}}</p>\n\t\t\t</cds-table-header>\n\t\t\t<!--\n\t\t\tapp-* components are for demo purposes only.\n\t\t\tYou can create your own implementation by using the component source found at:\n\t\t\thttps://github.com/IBM/carbon-components-angular/tree/master/src/table/stories/app-expansion-table.component.ts\n\t\t\t-->\n\t\t\t<app-expansion-table\n\t\t\t\t[size]=\"size\"\n\t\t\t\t[showSelectionColumn]=\"showSelectionColumn\"\n\t\t\t\t[sortable]=\"sortable\"\n\t\t\t\t[stickyHeader]=\"stickyHeader\"\n\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t[striped]=\"striped\"\n\t\t\t\t[isDataGrid]=\"isDataGrid\"\n\t\t\t\t[showExpandAllToggle]=\"showExpandAllToggle\">\n\t\t\t</app-expansion-table>\n\t\t</cds-table-container>\n\t`\n})"
|
|
80344
80787
|
},
|
|
80345
80788
|
{
|
|
80346
80789
|
"name": "Filtering",
|
|
@@ -86831,8 +87274,8 @@
|
|
|
86831
87274
|
"type": "component",
|
|
86832
87275
|
"linktype": "component",
|
|
86833
87276
|
"name": "NumberComponent",
|
|
86834
|
-
"coveragePercent":
|
|
86835
|
-
"coverageCount": "
|
|
87277
|
+
"coveragePercent": 67,
|
|
87278
|
+
"coverageCount": "33/49",
|
|
86836
87279
|
"status": "good"
|
|
86837
87280
|
},
|
|
86838
87281
|
{
|
|
@@ -86854,6 +87297,16 @@
|
|
|
86854
87297
|
"coverageCount": "0/1",
|
|
86855
87298
|
"status": "low"
|
|
86856
87299
|
},
|
|
87300
|
+
{
|
|
87301
|
+
"filePath": "src/number-input/number.stories.ts",
|
|
87302
|
+
"type": "variable",
|
|
87303
|
+
"linktype": "miscellaneous",
|
|
87304
|
+
"linksubtype": "variable",
|
|
87305
|
+
"name": "Fluid",
|
|
87306
|
+
"coveragePercent": 0,
|
|
87307
|
+
"coverageCount": "0/1",
|
|
87308
|
+
"status": "low"
|
|
87309
|
+
},
|
|
86857
87310
|
{
|
|
86858
87311
|
"filePath": "src/number-input/number.stories.ts",
|
|
86859
87312
|
"type": "variable",
|
|
@@ -87998,7 +88451,7 @@
|
|
|
87998
88451
|
"linktype": "component",
|
|
87999
88452
|
"name": "TableHeadExpand",
|
|
88000
88453
|
"coveragePercent": 0,
|
|
88001
|
-
"coverageCount": "0/
|
|
88454
|
+
"coverageCount": "0/9",
|
|
88002
88455
|
"status": "low"
|
|
88003
88456
|
},
|
|
88004
88457
|
{
|
|
@@ -88006,8 +88459,8 @@
|
|
|
88006
88459
|
"type": "component",
|
|
88007
88460
|
"linktype": "component",
|
|
88008
88461
|
"name": "TableHead",
|
|
88009
|
-
"coveragePercent":
|
|
88010
|
-
"coverageCount": "
|
|
88462
|
+
"coveragePercent": 25,
|
|
88463
|
+
"coverageCount": "7/27",
|
|
88011
88464
|
"status": "low"
|
|
88012
88465
|
},
|
|
88013
88466
|
{
|
|
@@ -88061,7 +88514,7 @@
|
|
|
88061
88514
|
"linktype": "component",
|
|
88062
88515
|
"name": "ExpansionTableStory",
|
|
88063
88516
|
"coveragePercent": 0,
|
|
88064
|
-
"coverageCount": "0/
|
|
88517
|
+
"coverageCount": "0/13",
|
|
88065
88518
|
"status": "low"
|
|
88066
88519
|
},
|
|
88067
88520
|
{
|
|
@@ -88204,9 +88657,9 @@
|
|
|
88204
88657
|
"type": "class",
|
|
88205
88658
|
"linktype": "classe",
|
|
88206
88659
|
"name": "TableModel",
|
|
88207
|
-
"coveragePercent":
|
|
88208
|
-
"coverageCount": "
|
|
88209
|
-
"status": "
|
|
88660
|
+
"coveragePercent": 73,
|
|
88661
|
+
"coverageCount": "34/46",
|
|
88662
|
+
"status": "good"
|
|
88210
88663
|
},
|
|
88211
88664
|
{
|
|
88212
88665
|
"filePath": "src/table/table-row.class.ts",
|
|
@@ -88222,8 +88675,8 @@
|
|
|
88222
88675
|
"type": "component",
|
|
88223
88676
|
"linktype": "component",
|
|
88224
88677
|
"name": "Table",
|
|
88225
|
-
"coveragePercent":
|
|
88226
|
-
"coverageCount": "
|
|
88678
|
+
"coveragePercent": 47,
|
|
88679
|
+
"coverageCount": "32/68",
|
|
88227
88680
|
"status": "medium"
|
|
88228
88681
|
},
|
|
88229
88682
|
{
|