carbon-components-angular 5.12.4 → 5.13.1
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 +2 -0
- package/docs/documentation/classes/NumberChange.html +1 -1
- package/docs/documentation/classes/TableHeaderItem.html +124 -124
- package/docs/documentation/classes/TableModel.html +253 -86
- package/docs/documentation/components/Checkbox.html +45 -52
- package/docs/documentation/components/NumberComponent.html +3 -3
- package/docs/documentation/components/Table.html +21 -24
- package/docs/documentation/components/TextareaLabelComponent.html +5 -5
- package/docs/documentation/components/Toggle.html +24 -29
- package/docs/documentation/coverage.html +6 -6
- package/docs/documentation/index.html +12 -0
- package/docs/documentation/js/search/search_index.js +2 -2
- package/docs/documentation/miscellaneous/typealiases.html +21 -0
- package/docs/documentation/modules/CodeSnippetModule/dependencies.svg +4 -4
- package/docs/documentation/modules/CodeSnippetModule.html +4 -4
- package/docs/documentation/modules/DatePickerInputModule/dependencies.svg +38 -42
- package/docs/documentation/modules/DatePickerInputModule.html +38 -42
- package/docs/documentation/modules/FileUploaderModule/dependencies.svg +4 -4
- package/docs/documentation/modules/FileUploaderModule.html +4 -4
- package/docs/documentation/modules/NumberModule/dependencies.svg +4 -4
- package/docs/documentation/modules/NumberModule.html +4 -4
- package/docs/documentation/modules/PanelModule/dependencies.svg +36 -36
- package/docs/documentation/modules/PanelModule.html +36 -36
- package/docs/documentation/modules/RadioModule/dependencies.svg +49 -49
- package/docs/documentation/modules/RadioModule.html +49 -49
- package/docs/documentation/modules/SelectModule/dependencies.svg +43 -43
- package/docs/documentation/modules/SelectModule.html +43 -43
- package/docs/documentation/modules/SliderModule/dependencies.svg +4 -4
- package/docs/documentation/modules/SliderModule.html +4 -4
- package/docs/documentation/modules/TableModule/dependencies.svg +216 -216
- package/docs/documentation/modules/TableModule.html +216 -216
- package/docs/documentation/modules/TabsModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TabsModule.html +4 -4
- package/docs/documentation/modules/TagModule/dependencies.svg +29 -29
- package/docs/documentation/modules/TagModule.html +29 -29
- package/docs/documentation/modules/TilesModule/dependencies.svg +102 -102
- package/docs/documentation/modules/TilesModule.html +102 -102
- package/docs/documentation/modules/TimePickerSelectModule/dependencies.svg +45 -49
- package/docs/documentation/modules/TimePickerSelectModule.html +45 -49
- package/docs/documentation/modules/ToggleModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ToggleModule.html +4 -4
- package/docs/documentation/modules/ToggletipModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ToggletipModule.html +4 -4
- package/docs/documentation/modules/TooltipModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TooltipModule.html +4 -4
- package/docs/documentation.json +422 -308
- package/docs/storybook/1895.a7b85b78.iframe.bundle.js +1 -0
- package/docs/storybook/5868.9c8a5d5f.iframe.bundle.js +1 -0
- package/docs/storybook/{7153.91b7684a.iframe.bundle.js → 7153.81ca3a2c.iframe.bundle.js} +1 -1
- package/docs/storybook/checkbox-checkbox-stories.74791354.iframe.bundle.js +1 -0
- package/docs/storybook/dialog-overflow-menu-overflow-menu-stories.15eb7f8e.iframe.bundle.js +1 -0
- package/docs/storybook/iframe.html +2 -2
- package/docs/storybook/main.43c62519.iframe.bundle.js +1 -0
- package/docs/storybook/number-input-number-stories.8828b5f1.iframe.bundle.js +1 -0
- package/docs/storybook/project.json +1 -1
- package/docs/storybook/{runtime~main.84b152cd.iframe.bundle.js → runtime~main.c4aa93fd.iframe.bundle.js} +1 -1
- package/docs/storybook/toggle-toggle-stories.758276ec.iframe.bundle.js +1 -0
- package/esm2020/checkbox/checkbox.component.mjs +1 -3
- package/esm2020/input/textarea-label.component.mjs +5 -5
- package/esm2020/number-input/number.component.mjs +3 -3
- package/esm2020/table/table-header-item.class.mjs +6 -11
- package/esm2020/table/table-model.class.mjs +55 -4
- package/esm2020/table/table.component.mjs +2 -5
- package/fesm2015/carbon-components-angular-checkbox.mjs +0 -2
- package/fesm2015/carbon-components-angular-checkbox.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-input.mjs +4 -4
- package/fesm2015/carbon-components-angular-input.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-number-input.mjs +2 -2
- package/fesm2015/carbon-components-angular-number-input.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-table.mjs +60 -17
- package/fesm2015/carbon-components-angular-table.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-checkbox.mjs +0 -2
- package/fesm2020/carbon-components-angular-checkbox.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-input.mjs +4 -4
- package/fesm2020/carbon-components-angular-input.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-number-input.mjs +2 -2
- package/fesm2020/carbon-components-angular-number-input.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-table.mjs +60 -17
- package/fesm2020/carbon-components-angular-table.mjs.map +1 -1
- package/package.json +1 -1
- package/table/table-header-item.class.d.ts +16 -20
- package/table/table-model.class.d.ts +9 -0
- package/docs/storybook/1895.f908bfb8.iframe.bundle.js +0 -1
- package/docs/storybook/5868.140403a3.iframe.bundle.js +0 -1
- package/docs/storybook/checkbox-checkbox-stories.9fdbae41.iframe.bundle.js +0 -1
- package/docs/storybook/dialog-overflow-menu-overflow-menu-stories.ae41f3c6.iframe.bundle.js +0 -1
- package/docs/storybook/main.8d868a96.iframe.bundle.js +0 -1
- package/docs/storybook/number-input-number-stories.0bc36a19.iframe.bundle.js +0 -1
- package/docs/storybook/toggle-toggle-stories.3f40e3b9.iframe.bundle.js +0 -1
package/docs/documentation.json
CHANGED
|
@@ -5233,7 +5233,7 @@
|
|
|
5233
5233
|
"type": "string",
|
|
5234
5234
|
"optional": false,
|
|
5235
5235
|
"description": "<p>The label for the sort button</p>\n",
|
|
5236
|
-
"line":
|
|
5236
|
+
"line": 155,
|
|
5237
5237
|
"rawdescription": "\n\nThe label for the sort button\n",
|
|
5238
5238
|
"inheritance": {
|
|
5239
5239
|
"file": "TableHeaderItem"
|
|
@@ -5246,7 +5246,7 @@
|
|
|
5246
5246
|
"type": "string",
|
|
5247
5247
|
"optional": false,
|
|
5248
5248
|
"description": "<p>Attach a class to the column, both the header and column cells.</p>\n",
|
|
5249
|
-
"line":
|
|
5249
|
+
"line": 97,
|
|
5250
5250
|
"rawdescription": "\n\nAttach a class to the column, both the header and column cells.\n\n",
|
|
5251
5251
|
"inheritance": {
|
|
5252
5252
|
"file": "TableHeaderItem"
|
|
@@ -5260,7 +5260,7 @@
|
|
|
5260
5260
|
"type": "number",
|
|
5261
5261
|
"optional": false,
|
|
5262
5262
|
"description": "<p>The number of columns to span</p>\n",
|
|
5263
|
-
"line":
|
|
5263
|
+
"line": 91,
|
|
5264
5264
|
"rawdescription": "\n\nThe number of columns to span\n",
|
|
5265
5265
|
"inheritance": {
|
|
5266
5266
|
"file": "TableHeaderItem"
|
|
@@ -5273,7 +5273,7 @@
|
|
|
5273
5273
|
"type": "any",
|
|
5274
5274
|
"optional": false,
|
|
5275
5275
|
"description": "<p>Data for the header item.</p>\n",
|
|
5276
|
-
"line":
|
|
5276
|
+
"line": 110,
|
|
5277
5277
|
"rawdescription": "\n\nData for the header item.\n",
|
|
5278
5278
|
"inheritance": {
|
|
5279
5279
|
"file": "TableHeaderItem"
|
|
@@ -5287,7 +5287,7 @@
|
|
|
5287
5287
|
"type": "number",
|
|
5288
5288
|
"optional": false,
|
|
5289
5289
|
"description": "<p>Number of applied filters.</p>\n<p><code>filter()</code> should set it to appropriate number.</p>\n",
|
|
5290
|
-
"line":
|
|
5290
|
+
"line": 80,
|
|
5291
5291
|
"rawdescription": "\n\nNumber of applied filters.\n\n`filter()` should set it to appropriate number.\n\n",
|
|
5292
5292
|
"inheritance": {
|
|
5293
5293
|
"file": "TableHeaderItem"
|
|
@@ -5300,7 +5300,7 @@
|
|
|
5300
5300
|
"type": "any",
|
|
5301
5301
|
"optional": false,
|
|
5302
5302
|
"description": "<p>This is where you store your data when applying filter.</p>\n<p>It is the actual object you have access to with <code>let-filter="data"</code> in your template.</p>\n<p>Make sure to store data in <code>filter.data</code> in your template, and you will have it\navailable in <code>filterData.data</code> in your extension of <code>TableHeaderItem</code>.</p>\n<p>Because angular and object references.</p>\n",
|
|
5303
|
-
"line":
|
|
5303
|
+
"line": 226,
|
|
5304
5304
|
"rawdescription": "\n\nThis is where you store your data when applying filter.\n\nIt is the actual object you have access to with `let-filter=\"data\"` in your template.\n\nMake sure to store data in `filter.data` in your template, and you will have it\navailable in `filterData.data` in your extension of `TableHeaderItem`.\n\nBecause angular and object references.\n",
|
|
5305
5305
|
"inheritance": {
|
|
5306
5306
|
"file": "TableHeaderItem"
|
|
@@ -5313,7 +5313,7 @@
|
|
|
5313
5313
|
"type": "TemplateRef<any>",
|
|
5314
5314
|
"optional": false,
|
|
5315
5315
|
"description": "<p>Used along with <code>filterTemplate</code> to construct the filter popover</p>\n",
|
|
5316
|
-
"line":
|
|
5316
|
+
"line": 214,
|
|
5317
5317
|
"rawdescription": "\n\nUsed along with `filterTemplate` to construct the filter popover\n",
|
|
5318
5318
|
"inheritance": {
|
|
5319
5319
|
"file": "TableHeaderItem"
|
|
@@ -5326,7 +5326,7 @@
|
|
|
5326
5326
|
"type": "TemplateRef<any>",
|
|
5327
5327
|
"optional": false,
|
|
5328
5328
|
"description": "<p>Used as a template for popover filter.</p>\n<p><code>let-popover="popover"</code> will give you access to popover component and allow you to\nmanipulate it if needed.</p>\n<p><code>let-filter="filter"</code> will give you access to the "filter". The main takeaway is\nstore the data you need to <code>filter.data</code>. You will be able to access it as\n<code>this.filterData.data</code> from your <code>filter()</code> function when you extend <code>TableHeaderItem</code></p>\n<p>Example:</p>\n<div><pre class=\"line-numbers\"><code class=\"language-html\"><ng-template #filter let-popover="popover">\n <cds-label class="first-label">\n Value\n <input type="text" [(ngModel)]="filter1" class="input-field">\n </cds-label>\n</ng-template>\n\n<ng-template #filterFooter let-popover="popover" let-filter="data">\n <button class="btn--primary" (click)="filter.data = filter1; popover.onClose()">Apply</button>\n <button class="btn--secondary" (click)="popover.onClose()">Cancel</button>\n</ng-template></code></pre></div><p>Set the template with, for example:</p>\n<div><pre class=\"line-numbers\"><code class=\"language-typescript\">new FilterableHeaderItem({\n filterTemplate: this.filter,\n filterFooter: this.filterFooter\n})</code></pre></div><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.indexOf(this.filterData.data) >= 0) {\n this.filterCount = 1;\n return false;\n }\n this.filterCount = 0;\n return true;\n }\n}</code></pre></div>",
|
|
5329
|
-
"line":
|
|
5329
|
+
"line": 209,
|
|
5330
5330
|
"rawdescription": "\n\nUsed as a template for popover filter.\n\n`let-popover=\"popover\"` will give you access to popover component and allow you to\nmanipulate it if needed.\n\n`let-filter=\"filter\"` will give you access to the \"filter\". The main takeaway is\nstore the data you need to `filter.data`. You will be able to access it as\n`this.filterData.data` from your `filter()` function when you extend `TableHeaderItem`\n\nExample:\n```html\n<ng-template #filter let-popover=\"popover\">\n\t<cds-label class=\"first-label\">\n\t\tValue\n\t\t<input type=\"text\" [(ngModel)]=\"filter1\" class=\"input-field\">\n\t</cds-label>\n</ng-template>\n\n<ng-template #filterFooter let-popover=\"popover\" let-filter=\"data\">\n\t<button class=\"btn--primary\" (click)=\"filter.data = filter1; popover.onClose()\">Apply</button>\n\t<button class=\"btn--secondary\" (click)=\"popover.onClose()\">Cancel</button>\n</ng-template>\n```\n\nSet the template with, for example:\n```typescript\nnew FilterableHeaderItem({\n\tfilterTemplate: this.filter,\n\tfilterFooter: this.filterFooter\n})\n```\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.indexOf(this.filterData.data) >= 0) {\n\t\t\tthis.filterCount = 1;\n\t\t\treturn false;\n\t\t}\n\t\tthis.filterCount = 0;\n\t\treturn true;\n\t}\n}\n```\n",
|
|
5331
5331
|
"inheritance": {
|
|
5332
5332
|
"file": "TableHeaderItem"
|
|
@@ -5339,7 +5339,7 @@
|
|
|
5339
5339
|
"type": "function",
|
|
5340
5340
|
"optional": false,
|
|
5341
5341
|
"description": "<p>A callback function to format the sort label. Will be heavily called.</p>\n",
|
|
5342
|
-
"line":
|
|
5342
|
+
"line": 160,
|
|
5343
5343
|
"rawdescription": "\n\nA callback function to format the sort label. Will be heavily called.\n",
|
|
5344
5344
|
"inheritance": {
|
|
5345
5345
|
"file": "TableHeaderItem"
|
|
@@ -5352,7 +5352,7 @@
|
|
|
5352
5352
|
"type": "any",
|
|
5353
5353
|
"optional": false,
|
|
5354
5354
|
"description": "<p>Data for the header item for general usage in the controller.\nFor example, which <code>field</code> is this column related to.</p>\n",
|
|
5355
|
-
"line":
|
|
5355
|
+
"line": 116,
|
|
5356
5356
|
"rawdescription": "\n\nData for the header item for general usage in the controller.\nFor example, which `field` is this column related to.\n",
|
|
5357
5357
|
"inheritance": {
|
|
5358
5358
|
"file": "TableHeaderItem"
|
|
@@ -5366,7 +5366,7 @@
|
|
|
5366
5366
|
"type": "number",
|
|
5367
5367
|
"optional": false,
|
|
5368
5368
|
"description": "<p>The number of rows to span\n<strong>NOTE:</strong> not supported by the default carbon table</p>\n",
|
|
5369
|
-
"line":
|
|
5369
|
+
"line": 86,
|
|
5370
5370
|
"rawdescription": "\n\nThe number of rows to span\n**NOTE:** not supported by the default carbon table\n",
|
|
5371
5371
|
"inheritance": {
|
|
5372
5372
|
"file": "TableHeaderItem"
|
|
@@ -5380,12 +5380,25 @@
|
|
|
5380
5380
|
"type": "",
|
|
5381
5381
|
"optional": false,
|
|
5382
5382
|
"description": "<p>Enables sorting on click by default.\nIf false then this column won't show a sorting arrow at all.</p>\n",
|
|
5383
|
-
"line":
|
|
5383
|
+
"line": 72,
|
|
5384
5384
|
"rawdescription": "\n\nEnables sorting on click by default.\nIf false then this column won't show a sorting arrow at all.\n\n",
|
|
5385
5385
|
"inheritance": {
|
|
5386
5386
|
"file": "TableHeaderItem"
|
|
5387
5387
|
}
|
|
5388
5388
|
},
|
|
5389
|
+
{
|
|
5390
|
+
"name": "sortDirection",
|
|
5391
|
+
"defaultValue": "\"NONE\"",
|
|
5392
|
+
"deprecated": false,
|
|
5393
|
+
"deprecationMessage": "",
|
|
5394
|
+
"type": "SortType",
|
|
5395
|
+
"optional": false,
|
|
5396
|
+
"description": "",
|
|
5397
|
+
"line": 228,
|
|
5398
|
+
"inheritance": {
|
|
5399
|
+
"file": "TableHeaderItem"
|
|
5400
|
+
}
|
|
5401
|
+
},
|
|
5389
5402
|
{
|
|
5390
5403
|
"name": "sorted",
|
|
5391
5404
|
"defaultValue": "false",
|
|
@@ -5394,7 +5407,7 @@
|
|
|
5394
5407
|
"type": "",
|
|
5395
5408
|
"optional": false,
|
|
5396
5409
|
"description": "<p>Disables sorting by default.</p>\n",
|
|
5397
|
-
"line":
|
|
5410
|
+
"line": 65,
|
|
5398
5411
|
"rawdescription": "\n\nDisables sorting by default.\n\n",
|
|
5399
5412
|
"inheritance": {
|
|
5400
5413
|
"file": "TableHeaderItem"
|
|
@@ -5408,7 +5421,7 @@
|
|
|
5408
5421
|
"type": "object",
|
|
5409
5422
|
"optional": false,
|
|
5410
5423
|
"description": "<p>Style for the column, applied to every element in the column.</p>\n<p>ngStyle-like format</p>\n",
|
|
5411
|
-
"line":
|
|
5424
|
+
"line": 105,
|
|
5412
5425
|
"rawdescription": "\n\nStyle for the column, applied to every element in the column.\n\nngStyle-like format\n\n",
|
|
5413
5426
|
"inheritance": {
|
|
5414
5427
|
"file": "TableHeaderItem"
|
|
@@ -5421,7 +5434,7 @@
|
|
|
5421
5434
|
"type": "TemplateRef<any>",
|
|
5422
5435
|
"optional": false,
|
|
5423
5436
|
"description": "<p>Used to display data in a desired way.</p>\n<p>If not provided, displays data as a simple string.</p>\n<p>Usage:</p>\n<p>In a component where you're using the table create a template like:</p>\n<div><pre class=\"line-numbers\"><code class=\"language-html\"><ng-template #customHeaderTemplate let-data="data">\n <i><a [routerLink]="data.link">{{data.name}}</a></i>\n</ng-template></code></pre></div><p>where we assume your data contains <code>link</code> and <code>name</code>. <code>let-data="data"</code> is\nnecessary for you to be able to access item's data in the template.</p>\n<p>Create <code>ViewChild</code> property with:</p>\n<div><pre class=\"line-numbers\"><code class=\"language-typescript\">(at)ViewChild("customHeaderTemplate")\nprotected customHeaderTemplate: TemplateRef<any>;</code></pre></div><p>Set the template to the header item, for example:</p>\n<div><pre class=\"line-numbers\"><code class=\"language-typescript\">this.model.header = [\n new TableHeaderItem({data: {name: "Custom header", link: "/table"}, template: this.customHeaderTemplate})\n];</code></pre></div>",
|
|
5424
|
-
"line":
|
|
5437
|
+
"line": 150,
|
|
5425
5438
|
"rawdescription": "\n\nUsed to display data in a desired way.\n\nIf not provided, displays data as a simple string.\n\nUsage:\n\nIn a component where you're using the table create a template like:\n\n```html\n<ng-template #customHeaderTemplate let-data=\"data\">\n\t\t<i><a [routerLink]=\"data.link\">{{data.name}}</a></i>\n</ng-template>\n```\nwhere we assume your data contains `link` and `name`. `let-data=\"data\"` is\nnecessary for you to be able to access item's data in the template.\n\nCreate `ViewChild` property with:\n\n```typescript\n(at)ViewChild(\"customHeaderTemplate\")\nprotected customHeaderTemplate: TemplateRef<any>;\n```\n\nSet the template to the header item, for example:\n\n```typescript\nthis.model.header = [\n\t\tnew TableHeaderItem({data: {name: \"Custom header\", link: \"/table\"}, template: this.customHeaderTemplate})\n];\n```\n",
|
|
5426
5439
|
"inheritance": {
|
|
5427
5440
|
"file": "TableHeaderItem"
|
|
@@ -5435,7 +5448,7 @@
|
|
|
5435
5448
|
"type": "",
|
|
5436
5449
|
"optional": false,
|
|
5437
5450
|
"description": "<p>Defines if column under this TableHeaderItem should be displayed.</p>\n",
|
|
5438
|
-
"line":
|
|
5451
|
+
"line": 59,
|
|
5439
5452
|
"rawdescription": "\n\nDefines if column under this TableHeaderItem should be displayed.\n\n",
|
|
5440
5453
|
"inheritance": {
|
|
5441
5454
|
"file": "TableHeaderItem"
|
|
@@ -5502,7 +5515,7 @@
|
|
|
5502
5515
|
"optional": false,
|
|
5503
5516
|
"returnType": "boolean",
|
|
5504
5517
|
"typeParameters": [],
|
|
5505
|
-
"line":
|
|
5518
|
+
"line": 293,
|
|
5506
5519
|
"deprecated": false,
|
|
5507
5520
|
"deprecationMessage": "",
|
|
5508
5521
|
"rawdescription": "\n\nUsed to filter rows in the table.\n\nOverride to make a custom filter.\n\nEven though there is just one filter function, there can be multiple filters.\nWhen implementing filter, set `filterCount` before returning.\n\n`true` to hide the row\n`false` to show the row\n",
|
|
@@ -5546,7 +5559,7 @@
|
|
|
5546
5559
|
"type": "string",
|
|
5547
5560
|
"optional": false,
|
|
5548
5561
|
"description": "<p>The label for the sort button</p>\n",
|
|
5549
|
-
"line":
|
|
5562
|
+
"line": 155,
|
|
5550
5563
|
"rawdescription": "\n\nThe label for the sort button\n",
|
|
5551
5564
|
"inheritance": {
|
|
5552
5565
|
"file": "TableHeaderItem"
|
|
@@ -5559,7 +5572,7 @@
|
|
|
5559
5572
|
"type": "string",
|
|
5560
5573
|
"optional": false,
|
|
5561
5574
|
"description": "<p>Attach a class to the column, both the header and column cells.</p>\n",
|
|
5562
|
-
"line":
|
|
5575
|
+
"line": 97,
|
|
5563
5576
|
"rawdescription": "\n\nAttach a class to the column, both the header and column cells.\n\n",
|
|
5564
5577
|
"inheritance": {
|
|
5565
5578
|
"file": "TableHeaderItem"
|
|
@@ -5573,7 +5586,7 @@
|
|
|
5573
5586
|
"type": "number",
|
|
5574
5587
|
"optional": false,
|
|
5575
5588
|
"description": "<p>The number of columns to span</p>\n",
|
|
5576
|
-
"line":
|
|
5589
|
+
"line": 91,
|
|
5577
5590
|
"rawdescription": "\n\nThe number of columns to span\n",
|
|
5578
5591
|
"inheritance": {
|
|
5579
5592
|
"file": "TableHeaderItem"
|
|
@@ -5586,7 +5599,7 @@
|
|
|
5586
5599
|
"type": "any",
|
|
5587
5600
|
"optional": false,
|
|
5588
5601
|
"description": "<p>Data for the header item.</p>\n",
|
|
5589
|
-
"line":
|
|
5602
|
+
"line": 110,
|
|
5590
5603
|
"rawdescription": "\n\nData for the header item.\n",
|
|
5591
5604
|
"inheritance": {
|
|
5592
5605
|
"file": "TableHeaderItem"
|
|
@@ -5600,7 +5613,7 @@
|
|
|
5600
5613
|
"type": "number",
|
|
5601
5614
|
"optional": false,
|
|
5602
5615
|
"description": "<p>Number of applied filters.</p>\n<p><code>filter()</code> should set it to appropriate number.</p>\n",
|
|
5603
|
-
"line":
|
|
5616
|
+
"line": 80,
|
|
5604
5617
|
"rawdescription": "\n\nNumber of applied filters.\n\n`filter()` should set it to appropriate number.\n\n",
|
|
5605
5618
|
"inheritance": {
|
|
5606
5619
|
"file": "TableHeaderItem"
|
|
@@ -5613,7 +5626,7 @@
|
|
|
5613
5626
|
"type": "any",
|
|
5614
5627
|
"optional": false,
|
|
5615
5628
|
"description": "<p>This is where you store your data when applying filter.</p>\n<p>It is the actual object you have access to with <code>let-filter="data"</code> in your template.</p>\n<p>Make sure to store data in <code>filter.data</code> in your template, and you will have it\navailable in <code>filterData.data</code> in your extension of <code>TableHeaderItem</code>.</p>\n<p>Because angular and object references.</p>\n",
|
|
5616
|
-
"line":
|
|
5629
|
+
"line": 226,
|
|
5617
5630
|
"rawdescription": "\n\nThis is where you store your data when applying filter.\n\nIt is the actual object you have access to with `let-filter=\"data\"` in your template.\n\nMake sure to store data in `filter.data` in your template, and you will have it\navailable in `filterData.data` in your extension of `TableHeaderItem`.\n\nBecause angular and object references.\n",
|
|
5618
5631
|
"inheritance": {
|
|
5619
5632
|
"file": "TableHeaderItem"
|
|
@@ -5626,7 +5639,7 @@
|
|
|
5626
5639
|
"type": "TemplateRef<any>",
|
|
5627
5640
|
"optional": false,
|
|
5628
5641
|
"description": "<p>Used along with <code>filterTemplate</code> to construct the filter popover</p>\n",
|
|
5629
|
-
"line":
|
|
5642
|
+
"line": 214,
|
|
5630
5643
|
"rawdescription": "\n\nUsed along with `filterTemplate` to construct the filter popover\n",
|
|
5631
5644
|
"inheritance": {
|
|
5632
5645
|
"file": "TableHeaderItem"
|
|
@@ -5639,7 +5652,7 @@
|
|
|
5639
5652
|
"type": "TemplateRef<any>",
|
|
5640
5653
|
"optional": false,
|
|
5641
5654
|
"description": "<p>Used as a template for popover filter.</p>\n<p><code>let-popover="popover"</code> will give you access to popover component and allow you to\nmanipulate it if needed.</p>\n<p><code>let-filter="filter"</code> will give you access to the "filter". The main takeaway is\nstore the data you need to <code>filter.data</code>. You will be able to access it as\n<code>this.filterData.data</code> from your <code>filter()</code> function when you extend <code>TableHeaderItem</code></p>\n<p>Example:</p>\n<div><pre class=\"line-numbers\"><code class=\"language-html\"><ng-template #filter let-popover="popover">\n <cds-label class="first-label">\n Value\n <input type="text" [(ngModel)]="filter1" class="input-field">\n </cds-label>\n</ng-template>\n\n<ng-template #filterFooter let-popover="popover" let-filter="data">\n <button class="btn--primary" (click)="filter.data = filter1; popover.onClose()">Apply</button>\n <button class="btn--secondary" (click)="popover.onClose()">Cancel</button>\n</ng-template></code></pre></div><p>Set the template with, for example:</p>\n<div><pre class=\"line-numbers\"><code class=\"language-typescript\">new FilterableHeaderItem({\n filterTemplate: this.filter,\n filterFooter: this.filterFooter\n})</code></pre></div><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.indexOf(this.filterData.data) >= 0) {\n this.filterCount = 1;\n return false;\n }\n this.filterCount = 0;\n return true;\n }\n}</code></pre></div>",
|
|
5642
|
-
"line":
|
|
5655
|
+
"line": 209,
|
|
5643
5656
|
"rawdescription": "\n\nUsed as a template for popover filter.\n\n`let-popover=\"popover\"` will give you access to popover component and allow you to\nmanipulate it if needed.\n\n`let-filter=\"filter\"` will give you access to the \"filter\". The main takeaway is\nstore the data you need to `filter.data`. You will be able to access it as\n`this.filterData.data` from your `filter()` function when you extend `TableHeaderItem`\n\nExample:\n```html\n<ng-template #filter let-popover=\"popover\">\n\t<cds-label class=\"first-label\">\n\t\tValue\n\t\t<input type=\"text\" [(ngModel)]=\"filter1\" class=\"input-field\">\n\t</cds-label>\n</ng-template>\n\n<ng-template #filterFooter let-popover=\"popover\" let-filter=\"data\">\n\t<button class=\"btn--primary\" (click)=\"filter.data = filter1; popover.onClose()\">Apply</button>\n\t<button class=\"btn--secondary\" (click)=\"popover.onClose()\">Cancel</button>\n</ng-template>\n```\n\nSet the template with, for example:\n```typescript\nnew FilterableHeaderItem({\n\tfilterTemplate: this.filter,\n\tfilterFooter: this.filterFooter\n})\n```\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.indexOf(this.filterData.data) >= 0) {\n\t\t\tthis.filterCount = 1;\n\t\t\treturn false;\n\t\t}\n\t\tthis.filterCount = 0;\n\t\treturn true;\n\t}\n}\n```\n",
|
|
5644
5657
|
"inheritance": {
|
|
5645
5658
|
"file": "TableHeaderItem"
|
|
@@ -5652,7 +5665,7 @@
|
|
|
5652
5665
|
"type": "function",
|
|
5653
5666
|
"optional": false,
|
|
5654
5667
|
"description": "<p>A callback function to format the sort label. Will be heavily called.</p>\n",
|
|
5655
|
-
"line":
|
|
5668
|
+
"line": 160,
|
|
5656
5669
|
"rawdescription": "\n\nA callback function to format the sort label. Will be heavily called.\n",
|
|
5657
5670
|
"inheritance": {
|
|
5658
5671
|
"file": "TableHeaderItem"
|
|
@@ -5665,7 +5678,7 @@
|
|
|
5665
5678
|
"type": "any",
|
|
5666
5679
|
"optional": false,
|
|
5667
5680
|
"description": "<p>Data for the header item for general usage in the controller.\nFor example, which <code>field</code> is this column related to.</p>\n",
|
|
5668
|
-
"line":
|
|
5681
|
+
"line": 116,
|
|
5669
5682
|
"rawdescription": "\n\nData for the header item for general usage in the controller.\nFor example, which `field` is this column related to.\n",
|
|
5670
5683
|
"inheritance": {
|
|
5671
5684
|
"file": "TableHeaderItem"
|
|
@@ -5679,7 +5692,7 @@
|
|
|
5679
5692
|
"type": "number",
|
|
5680
5693
|
"optional": false,
|
|
5681
5694
|
"description": "<p>The number of rows to span\n<strong>NOTE:</strong> not supported by the default carbon table</p>\n",
|
|
5682
|
-
"line":
|
|
5695
|
+
"line": 86,
|
|
5683
5696
|
"rawdescription": "\n\nThe number of rows to span\n**NOTE:** not supported by the default carbon table\n",
|
|
5684
5697
|
"inheritance": {
|
|
5685
5698
|
"file": "TableHeaderItem"
|
|
@@ -5693,12 +5706,25 @@
|
|
|
5693
5706
|
"type": "",
|
|
5694
5707
|
"optional": false,
|
|
5695
5708
|
"description": "<p>Enables sorting on click by default.\nIf false then this column won't show a sorting arrow at all.</p>\n",
|
|
5696
|
-
"line":
|
|
5709
|
+
"line": 72,
|
|
5697
5710
|
"rawdescription": "\n\nEnables sorting on click by default.\nIf false then this column won't show a sorting arrow at all.\n\n",
|
|
5698
5711
|
"inheritance": {
|
|
5699
5712
|
"file": "TableHeaderItem"
|
|
5700
5713
|
}
|
|
5701
5714
|
},
|
|
5715
|
+
{
|
|
5716
|
+
"name": "sortDirection",
|
|
5717
|
+
"defaultValue": "\"NONE\"",
|
|
5718
|
+
"deprecated": false,
|
|
5719
|
+
"deprecationMessage": "",
|
|
5720
|
+
"type": "SortType",
|
|
5721
|
+
"optional": false,
|
|
5722
|
+
"description": "",
|
|
5723
|
+
"line": 228,
|
|
5724
|
+
"inheritance": {
|
|
5725
|
+
"file": "TableHeaderItem"
|
|
5726
|
+
}
|
|
5727
|
+
},
|
|
5702
5728
|
{
|
|
5703
5729
|
"name": "sorted",
|
|
5704
5730
|
"defaultValue": "false",
|
|
@@ -5707,7 +5733,7 @@
|
|
|
5707
5733
|
"type": "",
|
|
5708
5734
|
"optional": false,
|
|
5709
5735
|
"description": "<p>Disables sorting by default.</p>\n",
|
|
5710
|
-
"line":
|
|
5736
|
+
"line": 65,
|
|
5711
5737
|
"rawdescription": "\n\nDisables sorting by default.\n\n",
|
|
5712
5738
|
"inheritance": {
|
|
5713
5739
|
"file": "TableHeaderItem"
|
|
@@ -5721,7 +5747,7 @@
|
|
|
5721
5747
|
"type": "object",
|
|
5722
5748
|
"optional": false,
|
|
5723
5749
|
"description": "<p>Style for the column, applied to every element in the column.</p>\n<p>ngStyle-like format</p>\n",
|
|
5724
|
-
"line":
|
|
5750
|
+
"line": 105,
|
|
5725
5751
|
"rawdescription": "\n\nStyle for the column, applied to every element in the column.\n\nngStyle-like format\n\n",
|
|
5726
5752
|
"inheritance": {
|
|
5727
5753
|
"file": "TableHeaderItem"
|
|
@@ -5734,7 +5760,7 @@
|
|
|
5734
5760
|
"type": "TemplateRef<any>",
|
|
5735
5761
|
"optional": false,
|
|
5736
5762
|
"description": "<p>Used to display data in a desired way.</p>\n<p>If not provided, displays data as a simple string.</p>\n<p>Usage:</p>\n<p>In a component where you're using the table create a template like:</p>\n<div><pre class=\"line-numbers\"><code class=\"language-html\"><ng-template #customHeaderTemplate let-data="data">\n <i><a [routerLink]="data.link">{{data.name}}</a></i>\n</ng-template></code></pre></div><p>where we assume your data contains <code>link</code> and <code>name</code>. <code>let-data="data"</code> is\nnecessary for you to be able to access item's data in the template.</p>\n<p>Create <code>ViewChild</code> property with:</p>\n<div><pre class=\"line-numbers\"><code class=\"language-typescript\">(at)ViewChild("customHeaderTemplate")\nprotected customHeaderTemplate: TemplateRef<any>;</code></pre></div><p>Set the template to the header item, for example:</p>\n<div><pre class=\"line-numbers\"><code class=\"language-typescript\">this.model.header = [\n new TableHeaderItem({data: {name: "Custom header", link: "/table"}, template: this.customHeaderTemplate})\n];</code></pre></div>",
|
|
5737
|
-
"line":
|
|
5763
|
+
"line": 150,
|
|
5738
5764
|
"rawdescription": "\n\nUsed to display data in a desired way.\n\nIf not provided, displays data as a simple string.\n\nUsage:\n\nIn a component where you're using the table create a template like:\n\n```html\n<ng-template #customHeaderTemplate let-data=\"data\">\n\t\t<i><a [routerLink]=\"data.link\">{{data.name}}</a></i>\n</ng-template>\n```\nwhere we assume your data contains `link` and `name`. `let-data=\"data\"` is\nnecessary for you to be able to access item's data in the template.\n\nCreate `ViewChild` property with:\n\n```typescript\n(at)ViewChild(\"customHeaderTemplate\")\nprotected customHeaderTemplate: TemplateRef<any>;\n```\n\nSet the template to the header item, for example:\n\n```typescript\nthis.model.header = [\n\t\tnew TableHeaderItem({data: {name: \"Custom header\", link: \"/table\"}, template: this.customHeaderTemplate})\n];\n```\n",
|
|
5739
5765
|
"inheritance": {
|
|
5740
5766
|
"file": "TableHeaderItem"
|
|
@@ -5748,7 +5774,7 @@
|
|
|
5748
5774
|
"type": "",
|
|
5749
5775
|
"optional": false,
|
|
5750
5776
|
"description": "<p>Defines if column under this TableHeaderItem should be displayed.</p>\n",
|
|
5751
|
-
"line":
|
|
5777
|
+
"line": 59,
|
|
5752
5778
|
"rawdescription": "\n\nDefines if column under this TableHeaderItem should be displayed.\n\n",
|
|
5753
5779
|
"inheritance": {
|
|
5754
5780
|
"file": "TableHeaderItem"
|
|
@@ -5815,7 +5841,7 @@
|
|
|
5815
5841
|
"optional": false,
|
|
5816
5842
|
"returnType": "boolean",
|
|
5817
5843
|
"typeParameters": [],
|
|
5818
|
-
"line":
|
|
5844
|
+
"line": 293,
|
|
5819
5845
|
"deprecated": false,
|
|
5820
5846
|
"deprecationMessage": "",
|
|
5821
5847
|
"rawdescription": "\n\nUsed to filter rows in the table.\n\nOverride to make a custom filter.\n\nEven though there is just one filter function, there can be multiple filters.\nWhen implementing filter, set `filterCount` before returning.\n\n`true` to hide the row\n`false` to show the row\n",
|
|
@@ -6623,12 +6649,12 @@
|
|
|
6623
6649
|
},
|
|
6624
6650
|
{
|
|
6625
6651
|
"name": "NumberChange",
|
|
6626
|
-
"id": "class-NumberChange-
|
|
6652
|
+
"id": "class-NumberChange-a6aacb7486479b480eface10d4c6826c322ea7990da07d0dab0028be78418c849142be19618daca2163db2ac8bc147cf6033d2df3a4865f9350355d93f406d49",
|
|
6627
6653
|
"file": "src/number-input/number.component.ts",
|
|
6628
6654
|
"deprecated": false,
|
|
6629
6655
|
"deprecationMessage": "",
|
|
6630
6656
|
"type": "class",
|
|
6631
|
-
"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 * [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[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(input)=\"onNumberInputChange($event)\"/>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && !warn && 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=\"!warn && 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 * @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",
|
|
6657
|
+
"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 * [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[attr.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[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(input)=\"onNumberInputChange($event)\"/>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && !warn && 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=\"!warn && 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 * @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",
|
|
6632
6658
|
"properties": [
|
|
6633
6659
|
{
|
|
6634
6660
|
"name": "source",
|
|
@@ -7790,12 +7816,12 @@
|
|
|
7790
7816
|
},
|
|
7791
7817
|
{
|
|
7792
7818
|
"name": "TableHeaderItem",
|
|
7793
|
-
"id": "class-TableHeaderItem-
|
|
7819
|
+
"id": "class-TableHeaderItem-8546e7b6b9613f5bd626bf443294a91a5a2a559aa93d484ad79b8ba6baef091eda70f907cd76d84f7f32c7f4af93d85425765c1731fa9fe41e786c1b07020b27",
|
|
7794
7820
|
"file": "src/table/table-header-item.class.ts",
|
|
7795
7821
|
"deprecated": false,
|
|
7796
7822
|
"deprecationMessage": "",
|
|
7797
7823
|
"type": "class",
|
|
7798
|
-
"sourceCode": "import { TableItem } from \"./table-item.class\";\nimport {
|
|
7824
|
+
"sourceCode": "import { TableItem } from \"./table-item.class\";\nimport { TemplateRef } from \"@angular/core\";\n\nexport type SortType = \"ASCENDING\" | \"DESCENDING\" | \"NONE\";\nexport class TableHeaderItem {\n\t/**\n\t * If true, sort is set to ascending, if false descending will be true.\n\t *\n\t */\n\tset ascending(asc: boolean) {\n\t\tthis.sortDirection = asc ? \"ASCENDING\" : \"DESCENDING\";\n\t}\n\tget ascending() {\n\t\treturn this.sortDirection === \"ASCENDING\";\n\t}\n\n\t/**\n\t * If true, sort is set to descending, if false ascending will be true.\n\t *\n\t */\n\tset descending(desc: boolean) {\n\t\tthis.sortDirection = desc ? \"DESCENDING\" : \"ASCENDING\";\n\t}\n\tget descending() {\n\t\treturn this.sortDirection === \"DESCENDING\";\n\t}\n\n\tget title() {\n\t\tif (this._title) {\n\t\t\treturn this._title;\n\t\t}\n\n\t\tif (!this.data) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\tif (typeof this.data === \"string\") {\n\t\t\treturn this.data;\n\t\t}\n\n\t\tif (\n\t\t\tthis.data.toString &&\n\t\t\tthis.data.constructor !== ({}).constructor\n\t\t) {\n\t\t\treturn this.data.toString();\n\t\t}\n\n\t\t// data can’t be reasonably converted to an end user readable string\n\t\treturn \"\";\n\t}\n\n\tset title(title) {\n\t\tthis._title = title;\n\t}\n\t/**\n\t * Defines if column under this TableHeaderItem should be displayed.\n\t *\n\t */\n\tvisible = true;\n\n\t/**\n\t * Disables sorting by default.\n\t *\n\t */\n\tsorted = false;\n\n\t/**\n\t * Enables sorting on click by default.\n\t * If false then this column won't show a sorting arrow at all.\n\t *\n\t */\n\tsortable = true;\n\n\t/**\n\t * Number of applied filters.\n\t *\n\t * `filter()` should set it to appropriate number.\n\t *\n\t */\n\tfilterCount = 0;\n\n\t/**\n\t * The number of rows to span\n\t * **NOTE:** not supported by the default carbon table\n\t */\n\trowSpan = 1;\n\n\t/**\n\t * The number of columns to span\n\t */\n\tcolSpan = 1;\n\n\t/**\n\t * Attach a class to the column, both the header and column cells.\n\t *\n\t */\n\tclassName: string;\n\n\t/**\n\t * Style for the column, applied to every element in the column.\n\t *\n\t * ngStyle-like format\n\t *\n\t */\n\tstyle = {};\n\n\t/**\n\t * Data for the header item.\n\t */\n\tdata: any;\n\n\t/**\n\t * Data for the header item for general usage in the controller.\n\t * For example, which `field` is this column related to.\n\t */\n\tmetadata: any;\n\n\t/**\n\t * Used to display data in a desired way.\n\t *\n\t * If not provided, displays data as a simple string.\n\t *\n\t * Usage:\n\t *\n\t * In a component where you're using the table create a template like:\n\t *\n\t * ```html\n\t * <ng-template #customHeaderTemplate let-data=\"data\">\n\t * \t\t<i><a [routerLink]=\"data.link\">{{data.name}}</a></i>\n\t * </ng-template>\n\t * ```\n\t * where we assume your data contains `link` and `name`. `let-data=\"data\"` is\n\t * necessary for you to be able to access item's data in the template.\n\t *\n\t * Create `ViewChild` property with:\n\t *\n\t * ```typescript\n\t * (at)ViewChild(\"customHeaderTemplate\")\n\t * protected customHeaderTemplate: TemplateRef<any>;\n\t * ```\n\t *\n\t * Set the template to the header item, for example:\n\t *\n\t * ```typescript\n\t * this.model.header = [\n\t * \t\tnew TableHeaderItem({data: {name: \"Custom header\", link: \"/table\"}, template: this.customHeaderTemplate})\n\t * ];\n\t * ```\n\t */\n\ttemplate: TemplateRef<any>;\n\n\t/**\n\t * The label for the sort button\n\t */\n\tariaSortLabel: string;\n\n\t/**\n\t * A callback function to format the sort label. Will be heavily called.\n\t */\n\tformatSortLabel: (label: string, staticLabel?: string) => string;\n\n\t/**\n\t * Used as a template for popover filter.\n\t *\n\t * `let-popover=\"popover\"` will give you access to popover component and allow you to\n\t * manipulate it if needed.\n\t *\n\t * `let-filter=\"filter\"` will give you access to the \"filter\". The main takeaway is\n\t * store the data you need to `filter.data`. You will be able to access it as\n\t * `this.filterData.data` from your `filter()` function when you extend `TableHeaderItem`\n\t *\n\t * Example:\n\t * ```html\n\t * <ng-template #filter let-popover=\"popover\">\n\t * \t<cds-label class=\"first-label\">\n\t * \t\tValue\n\t * \t\t<input type=\"text\" [(ngModel)]=\"filter1\" class=\"input-field\">\n\t * \t</cds-label>\n\t * </ng-template>\n\t *\n\t * <ng-template #filterFooter let-popover=\"popover\" let-filter=\"data\">\n\t * \t<button class=\"btn--primary\" (click)=\"filter.data = filter1; popover.onClose()\">Apply</button>\n\t * \t<button class=\"btn--secondary\" (click)=\"popover.onClose()\">Cancel</button>\n\t * </ng-template>\n\t * ```\n\t *\n\t * Set the template with, for example:\n\t * ```typescript\n\t * new FilterableHeaderItem({\n\t * \tfilterTemplate: this.filter,\n\t *\tfilterFooter: this.filterFooter\n\t * })\n\t * ```\n\t *\n\t * ```typescript\n\t * class FilterableHeaderItem extends TableHeaderItem {\n\t * \t// custom filter function\n\t * \tfilter(item: TableItem): boolean {\n\t * \t\tif (typeof item.data === \"string\" && item.data.indexOf(this.filterData.data) >= 0) {\n\t * \t\t\tthis.filterCount = 1;\n\t * \t\t\treturn false;\n\t * \t\t}\n\t * \t\tthis.filterCount = 0;\n\t * \t\treturn true;\n\t * \t}\n\t * }\n\t * ```\n\t */\n\tfilterTemplate: TemplateRef<any>;\n\n\t/**\n\t * Used along with `filterTemplate` to construct the filter popover\n\t */\n\tfilterFooter: TemplateRef<any>;\n\n\t/**\n\t * This is where you store your data when applying filter.\n\t *\n\t * It is the actual object you have access to with `let-filter=\"data\"` in your template.\n\t *\n\t * Make sure to store data in `filter.data` in your template, and you will have it\n\t * available in `filterData.data` in your extension of `TableHeaderItem`.\n\t *\n\t * Because angular and object references.\n\t */\n\tfilterData: any;\n\n\tsortDirection: SortType = \"NONE\";\n\n\n\n\tprivate _title: string;\n\n\t/**\n\t * Creates an instance of TableHeaderItem.\n\t */\n\tconstructor(rawData?: any) {\n\t\t// defaults so we dont leave things empty\n\t\tconst defaults = {\n\t\t\tdata: \"\",\n\t\t\tvisible: this.visible,\n\t\t\tstyle: this.style,\n\t\t\tfilterCount: this.filterCount,\n\t\t\tfilterData: {data: \"\"}\n\t\t};\n\t\t// fill our object with provided props, and fallback to defaults\n\t\tconst data = Object.assign({}, defaults, rawData);\n\t\tfor (let property of Object.getOwnPropertyNames(data)) {\n\t\t\tif (data.hasOwnProperty(property)) {\n\t\t\t\tthis[property] = data[property];\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Used for sorting rows of the table.\n\t *\n\t * Override to enable different sorting.\n\t *\n\t * < 0 if `one` should go before `two`\n\t * > 0 if `one` should go after `two`\n\t * 0 if it doesn't matter (they are the same)\n\t */\n\tcompare(one: TableItem, two: TableItem): number {\n\t\tif (!one || !two) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (typeof one.data === \"string\") {\n\t\t\treturn one.data.localeCompare(two.data);\n\t\t}\n\n\t\tif (one.data < two.data) {\n\t\t\treturn -1;\n\t\t} else if (one.data > two.data) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\t/**\n\t * Used to filter rows in the table.\n\t *\n\t * Override to make a custom filter.\n\t *\n\t * Even though there is just one filter function, there can be multiple filters.\n\t * When implementing filter, set `filterCount` before returning.\n\t *\n\t * `true` to hide the row\n\t * `false` to show the row\n\t */\n\tfilter(item: TableItem): boolean {\n\t\tthis.filterCount = 0;\n\t\treturn false;\n\t}\n}\n",
|
|
7799
7825
|
"constructorObj": {
|
|
7800
7826
|
"name": "constructor",
|
|
7801
7827
|
"description": "<p>Creates an instance of TableHeaderItem.</p>\n",
|
|
@@ -7810,7 +7836,7 @@
|
|
|
7810
7836
|
"optional": true
|
|
7811
7837
|
}
|
|
7812
7838
|
],
|
|
7813
|
-
"line":
|
|
7839
|
+
"line": 232,
|
|
7814
7840
|
"rawdescription": "\n\nCreates an instance of TableHeaderItem.\n",
|
|
7815
7841
|
"jsdoctags": [
|
|
7816
7842
|
{
|
|
@@ -7833,7 +7859,7 @@
|
|
|
7833
7859
|
"type": "string",
|
|
7834
7860
|
"optional": false,
|
|
7835
7861
|
"description": "<p>The label for the sort button</p>\n",
|
|
7836
|
-
"line":
|
|
7862
|
+
"line": 155,
|
|
7837
7863
|
"rawdescription": "\n\nThe label for the sort button\n"
|
|
7838
7864
|
},
|
|
7839
7865
|
{
|
|
@@ -7843,7 +7869,7 @@
|
|
|
7843
7869
|
"type": "string",
|
|
7844
7870
|
"optional": false,
|
|
7845
7871
|
"description": "<p>Attach a class to the column, both the header and column cells.</p>\n",
|
|
7846
|
-
"line":
|
|
7872
|
+
"line": 97,
|
|
7847
7873
|
"rawdescription": "\n\nAttach a class to the column, both the header and column cells.\n\n"
|
|
7848
7874
|
},
|
|
7849
7875
|
{
|
|
@@ -7854,7 +7880,7 @@
|
|
|
7854
7880
|
"type": "number",
|
|
7855
7881
|
"optional": false,
|
|
7856
7882
|
"description": "<p>The number of columns to span</p>\n",
|
|
7857
|
-
"line":
|
|
7883
|
+
"line": 91,
|
|
7858
7884
|
"rawdescription": "\n\nThe number of columns to span\n"
|
|
7859
7885
|
},
|
|
7860
7886
|
{
|
|
@@ -7864,7 +7890,7 @@
|
|
|
7864
7890
|
"type": "any",
|
|
7865
7891
|
"optional": false,
|
|
7866
7892
|
"description": "<p>Data for the header item.</p>\n",
|
|
7867
|
-
"line":
|
|
7893
|
+
"line": 110,
|
|
7868
7894
|
"rawdescription": "\n\nData for the header item.\n"
|
|
7869
7895
|
},
|
|
7870
7896
|
{
|
|
@@ -7875,7 +7901,7 @@
|
|
|
7875
7901
|
"type": "number",
|
|
7876
7902
|
"optional": false,
|
|
7877
7903
|
"description": "<p>Number of applied filters.</p>\n<p><code>filter()</code> should set it to appropriate number.</p>\n",
|
|
7878
|
-
"line":
|
|
7904
|
+
"line": 80,
|
|
7879
7905
|
"rawdescription": "\n\nNumber of applied filters.\n\n`filter()` should set it to appropriate number.\n\n"
|
|
7880
7906
|
},
|
|
7881
7907
|
{
|
|
@@ -7885,7 +7911,7 @@
|
|
|
7885
7911
|
"type": "any",
|
|
7886
7912
|
"optional": false,
|
|
7887
7913
|
"description": "<p>This is where you store your data when applying filter.</p>\n<p>It is the actual object you have access to with <code>let-filter="data"</code> in your template.</p>\n<p>Make sure to store data in <code>filter.data</code> in your template, and you will have it\navailable in <code>filterData.data</code> in your extension of <code>TableHeaderItem</code>.</p>\n<p>Because angular and object references.</p>\n",
|
|
7888
|
-
"line":
|
|
7914
|
+
"line": 226,
|
|
7889
7915
|
"rawdescription": "\n\nThis is where you store your data when applying filter.\n\nIt is the actual object you have access to with `let-filter=\"data\"` in your template.\n\nMake sure to store data in `filter.data` in your template, and you will have it\navailable in `filterData.data` in your extension of `TableHeaderItem`.\n\nBecause angular and object references.\n"
|
|
7890
7916
|
},
|
|
7891
7917
|
{
|
|
@@ -7895,7 +7921,7 @@
|
|
|
7895
7921
|
"type": "TemplateRef<any>",
|
|
7896
7922
|
"optional": false,
|
|
7897
7923
|
"description": "<p>Used along with <code>filterTemplate</code> to construct the filter popover</p>\n",
|
|
7898
|
-
"line":
|
|
7924
|
+
"line": 214,
|
|
7899
7925
|
"rawdescription": "\n\nUsed along with `filterTemplate` to construct the filter popover\n"
|
|
7900
7926
|
},
|
|
7901
7927
|
{
|
|
@@ -7905,7 +7931,7 @@
|
|
|
7905
7931
|
"type": "TemplateRef<any>",
|
|
7906
7932
|
"optional": false,
|
|
7907
7933
|
"description": "<p>Used as a template for popover filter.</p>\n<p><code>let-popover="popover"</code> will give you access to popover component and allow you to\nmanipulate it if needed.</p>\n<p><code>let-filter="filter"</code> will give you access to the "filter". The main takeaway is\nstore the data you need to <code>filter.data</code>. You will be able to access it as\n<code>this.filterData.data</code> from your <code>filter()</code> function when you extend <code>TableHeaderItem</code></p>\n<p>Example:</p>\n<div><pre class=\"line-numbers\"><code class=\"language-html\"><ng-template #filter let-popover="popover">\n <cds-label class="first-label">\n Value\n <input type="text" [(ngModel)]="filter1" class="input-field">\n </cds-label>\n</ng-template>\n\n<ng-template #filterFooter let-popover="popover" let-filter="data">\n <button class="btn--primary" (click)="filter.data = filter1; popover.onClose()">Apply</button>\n <button class="btn--secondary" (click)="popover.onClose()">Cancel</button>\n</ng-template></code></pre></div><p>Set the template with, for example:</p>\n<div><pre class=\"line-numbers\"><code class=\"language-typescript\">new FilterableHeaderItem({\n filterTemplate: this.filter,\n filterFooter: this.filterFooter\n})</code></pre></div><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.indexOf(this.filterData.data) >= 0) {\n this.filterCount = 1;\n return false;\n }\n this.filterCount = 0;\n return true;\n }\n}</code></pre></div>",
|
|
7908
|
-
"line":
|
|
7934
|
+
"line": 209,
|
|
7909
7935
|
"rawdescription": "\n\nUsed as a template for popover filter.\n\n`let-popover=\"popover\"` will give you access to popover component and allow you to\nmanipulate it if needed.\n\n`let-filter=\"filter\"` will give you access to the \"filter\". The main takeaway is\nstore the data you need to `filter.data`. You will be able to access it as\n`this.filterData.data` from your `filter()` function when you extend `TableHeaderItem`\n\nExample:\n```html\n<ng-template #filter let-popover=\"popover\">\n\t<cds-label class=\"first-label\">\n\t\tValue\n\t\t<input type=\"text\" [(ngModel)]=\"filter1\" class=\"input-field\">\n\t</cds-label>\n</ng-template>\n\n<ng-template #filterFooter let-popover=\"popover\" let-filter=\"data\">\n\t<button class=\"btn--primary\" (click)=\"filter.data = filter1; popover.onClose()\">Apply</button>\n\t<button class=\"btn--secondary\" (click)=\"popover.onClose()\">Cancel</button>\n</ng-template>\n```\n\nSet the template with, for example:\n```typescript\nnew FilterableHeaderItem({\n\tfilterTemplate: this.filter,\n\tfilterFooter: this.filterFooter\n})\n```\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.indexOf(this.filterData.data) >= 0) {\n\t\t\tthis.filterCount = 1;\n\t\t\treturn false;\n\t\t}\n\t\tthis.filterCount = 0;\n\t\treturn true;\n\t}\n}\n```\n"
|
|
7910
7936
|
},
|
|
7911
7937
|
{
|
|
@@ -7915,7 +7941,7 @@
|
|
|
7915
7941
|
"type": "function",
|
|
7916
7942
|
"optional": false,
|
|
7917
7943
|
"description": "<p>A callback function to format the sort label. Will be heavily called.</p>\n",
|
|
7918
|
-
"line":
|
|
7944
|
+
"line": 160,
|
|
7919
7945
|
"rawdescription": "\n\nA callback function to format the sort label. Will be heavily called.\n"
|
|
7920
7946
|
},
|
|
7921
7947
|
{
|
|
@@ -7925,7 +7951,7 @@
|
|
|
7925
7951
|
"type": "any",
|
|
7926
7952
|
"optional": false,
|
|
7927
7953
|
"description": "<p>Data for the header item for general usage in the controller.\nFor example, which <code>field</code> is this column related to.</p>\n",
|
|
7928
|
-
"line":
|
|
7954
|
+
"line": 116,
|
|
7929
7955
|
"rawdescription": "\n\nData for the header item for general usage in the controller.\nFor example, which `field` is this column related to.\n"
|
|
7930
7956
|
},
|
|
7931
7957
|
{
|
|
@@ -7936,7 +7962,7 @@
|
|
|
7936
7962
|
"type": "number",
|
|
7937
7963
|
"optional": false,
|
|
7938
7964
|
"description": "<p>The number of rows to span\n<strong>NOTE:</strong> not supported by the default carbon table</p>\n",
|
|
7939
|
-
"line":
|
|
7965
|
+
"line": 86,
|
|
7940
7966
|
"rawdescription": "\n\nThe number of rows to span\n**NOTE:** not supported by the default carbon table\n"
|
|
7941
7967
|
},
|
|
7942
7968
|
{
|
|
@@ -7947,9 +7973,19 @@
|
|
|
7947
7973
|
"type": "",
|
|
7948
7974
|
"optional": false,
|
|
7949
7975
|
"description": "<p>Enables sorting on click by default.\nIf false then this column won't show a sorting arrow at all.</p>\n",
|
|
7950
|
-
"line":
|
|
7976
|
+
"line": 72,
|
|
7951
7977
|
"rawdescription": "\n\nEnables sorting on click by default.\nIf false then this column won't show a sorting arrow at all.\n\n"
|
|
7952
7978
|
},
|
|
7979
|
+
{
|
|
7980
|
+
"name": "sortDirection",
|
|
7981
|
+
"defaultValue": "\"NONE\"",
|
|
7982
|
+
"deprecated": false,
|
|
7983
|
+
"deprecationMessage": "",
|
|
7984
|
+
"type": "SortType",
|
|
7985
|
+
"optional": false,
|
|
7986
|
+
"description": "",
|
|
7987
|
+
"line": 228
|
|
7988
|
+
},
|
|
7953
7989
|
{
|
|
7954
7990
|
"name": "sorted",
|
|
7955
7991
|
"defaultValue": "false",
|
|
@@ -7958,7 +7994,7 @@
|
|
|
7958
7994
|
"type": "",
|
|
7959
7995
|
"optional": false,
|
|
7960
7996
|
"description": "<p>Disables sorting by default.</p>\n",
|
|
7961
|
-
"line":
|
|
7997
|
+
"line": 65,
|
|
7962
7998
|
"rawdescription": "\n\nDisables sorting by default.\n\n"
|
|
7963
7999
|
},
|
|
7964
8000
|
{
|
|
@@ -7969,7 +8005,7 @@
|
|
|
7969
8005
|
"type": "object",
|
|
7970
8006
|
"optional": false,
|
|
7971
8007
|
"description": "<p>Style for the column, applied to every element in the column.</p>\n<p>ngStyle-like format</p>\n",
|
|
7972
|
-
"line":
|
|
8008
|
+
"line": 105,
|
|
7973
8009
|
"rawdescription": "\n\nStyle for the column, applied to every element in the column.\n\nngStyle-like format\n\n"
|
|
7974
8010
|
},
|
|
7975
8011
|
{
|
|
@@ -7979,7 +8015,7 @@
|
|
|
7979
8015
|
"type": "TemplateRef<any>",
|
|
7980
8016
|
"optional": false,
|
|
7981
8017
|
"description": "<p>Used to display data in a desired way.</p>\n<p>If not provided, displays data as a simple string.</p>\n<p>Usage:</p>\n<p>In a component where you're using the table create a template like:</p>\n<div><pre class=\"line-numbers\"><code class=\"language-html\"><ng-template #customHeaderTemplate let-data="data">\n <i><a [routerLink]="data.link">{{data.name}}</a></i>\n</ng-template></code></pre></div><p>where we assume your data contains <code>link</code> and <code>name</code>. <code>let-data="data"</code> is\nnecessary for you to be able to access item's data in the template.</p>\n<p>Create <code>ViewChild</code> property with:</p>\n<div><pre class=\"line-numbers\"><code class=\"language-typescript\">(at)ViewChild("customHeaderTemplate")\nprotected customHeaderTemplate: TemplateRef<any>;</code></pre></div><p>Set the template to the header item, for example:</p>\n<div><pre class=\"line-numbers\"><code class=\"language-typescript\">this.model.header = [\n new TableHeaderItem({data: {name: "Custom header", link: "/table"}, template: this.customHeaderTemplate})\n];</code></pre></div>",
|
|
7982
|
-
"line":
|
|
8018
|
+
"line": 150,
|
|
7983
8019
|
"rawdescription": "\n\nUsed to display data in a desired way.\n\nIf not provided, displays data as a simple string.\n\nUsage:\n\nIn a component where you're using the table create a template like:\n\n```html\n<ng-template #customHeaderTemplate let-data=\"data\">\n\t\t<i><a [routerLink]=\"data.link\">{{data.name}}</a></i>\n</ng-template>\n```\nwhere we assume your data contains `link` and `name`. `let-data=\"data\"` is\nnecessary for you to be able to access item's data in the template.\n\nCreate `ViewChild` property with:\n\n```typescript\n(at)ViewChild(\"customHeaderTemplate\")\nprotected customHeaderTemplate: TemplateRef<any>;\n```\n\nSet the template to the header item, for example:\n\n```typescript\nthis.model.header = [\n\t\tnew TableHeaderItem({data: {name: \"Custom header\", link: \"/table\"}, template: this.customHeaderTemplate})\n];\n```\n"
|
|
7984
8020
|
},
|
|
7985
8021
|
{
|
|
@@ -7990,7 +8026,7 @@
|
|
|
7990
8026
|
"type": "",
|
|
7991
8027
|
"optional": false,
|
|
7992
8028
|
"description": "<p>Defines if column under this TableHeaderItem should be displayed.</p>\n",
|
|
7993
|
-
"line":
|
|
8029
|
+
"line": 59,
|
|
7994
8030
|
"rawdescription": "\n\nDefines if column under this TableHeaderItem should be displayed.\n\n"
|
|
7995
8031
|
}
|
|
7996
8032
|
],
|
|
@@ -8014,7 +8050,7 @@
|
|
|
8014
8050
|
"optional": false,
|
|
8015
8051
|
"returnType": "number",
|
|
8016
8052
|
"typeParameters": [],
|
|
8017
|
-
"line":
|
|
8053
|
+
"line": 264,
|
|
8018
8054
|
"deprecated": false,
|
|
8019
8055
|
"deprecationMessage": "",
|
|
8020
8056
|
"rawdescription": "\n\nUsed for sorting rows of the table.\n\nOverride to enable different sorting.\n\n< 0 if `one` should go before `two`\n> 0 if `one` should go after `two`\n0 if it doesn't matter (they are the same)\n",
|
|
@@ -8053,7 +8089,7 @@
|
|
|
8053
8089
|
"optional": false,
|
|
8054
8090
|
"returnType": "boolean",
|
|
8055
8091
|
"typeParameters": [],
|
|
8056
|
-
"line":
|
|
8092
|
+
"line": 293,
|
|
8057
8093
|
"deprecated": false,
|
|
8058
8094
|
"deprecationMessage": "",
|
|
8059
8095
|
"rawdescription": "\n\nUsed to filter rows in the table.\n\nOverride to make a custom filter.\n\nEven though there is just one filter function, there can be multiple filters.\nWhen implementing filter, set `filterCount` before returning.\n\n`true` to hide the row\n`false` to show the row\n",
|
|
@@ -8083,19 +8119,19 @@
|
|
|
8083
8119
|
"args": [
|
|
8084
8120
|
{
|
|
8085
8121
|
"name": "asc",
|
|
8086
|
-
"type": "",
|
|
8122
|
+
"type": "boolean",
|
|
8087
8123
|
"deprecated": false,
|
|
8088
8124
|
"deprecationMessage": ""
|
|
8089
8125
|
}
|
|
8090
8126
|
],
|
|
8091
8127
|
"returnType": "void",
|
|
8092
|
-
"line":
|
|
8128
|
+
"line": 10,
|
|
8093
8129
|
"rawdescription": "\n\nIf true, sort is set to ascending, if false descending will be true.\n\n",
|
|
8094
8130
|
"description": "<p>If true, sort is set to ascending, if false descending will be true.</p>\n",
|
|
8095
8131
|
"jsdoctags": [
|
|
8096
8132
|
{
|
|
8097
8133
|
"name": "asc",
|
|
8098
|
-
"type": "",
|
|
8134
|
+
"type": "boolean",
|
|
8099
8135
|
"deprecated": false,
|
|
8100
8136
|
"deprecationMessage": "",
|
|
8101
8137
|
"tagName": {
|
|
@@ -8108,7 +8144,7 @@
|
|
|
8108
8144
|
"name": "ascending",
|
|
8109
8145
|
"type": "",
|
|
8110
8146
|
"returnType": "",
|
|
8111
|
-
"line":
|
|
8147
|
+
"line": 13
|
|
8112
8148
|
}
|
|
8113
8149
|
},
|
|
8114
8150
|
"descending": {
|
|
@@ -8121,19 +8157,19 @@
|
|
|
8121
8157
|
"args": [
|
|
8122
8158
|
{
|
|
8123
8159
|
"name": "desc",
|
|
8124
|
-
"type": "",
|
|
8160
|
+
"type": "boolean",
|
|
8125
8161
|
"deprecated": false,
|
|
8126
8162
|
"deprecationMessage": ""
|
|
8127
8163
|
}
|
|
8128
8164
|
],
|
|
8129
8165
|
"returnType": "void",
|
|
8130
|
-
"line":
|
|
8166
|
+
"line": 21,
|
|
8131
8167
|
"rawdescription": "\n\nIf true, sort is set to descending, if false ascending will be true.\n\n",
|
|
8132
8168
|
"description": "<p>If true, sort is set to descending, if false ascending will be true.</p>\n",
|
|
8133
8169
|
"jsdoctags": [
|
|
8134
8170
|
{
|
|
8135
8171
|
"name": "desc",
|
|
8136
|
-
"type": "",
|
|
8172
|
+
"type": "boolean",
|
|
8137
8173
|
"deprecated": false,
|
|
8138
8174
|
"deprecationMessage": "",
|
|
8139
8175
|
"tagName": {
|
|
@@ -8146,7 +8182,7 @@
|
|
|
8146
8182
|
"name": "descending",
|
|
8147
8183
|
"type": "",
|
|
8148
8184
|
"returnType": "",
|
|
8149
|
-
"line":
|
|
8185
|
+
"line": 24
|
|
8150
8186
|
}
|
|
8151
8187
|
},
|
|
8152
8188
|
"title": {
|
|
@@ -8165,7 +8201,7 @@
|
|
|
8165
8201
|
}
|
|
8166
8202
|
],
|
|
8167
8203
|
"returnType": "void",
|
|
8168
|
-
"line":
|
|
8204
|
+
"line": 52,
|
|
8169
8205
|
"jsdoctags": [
|
|
8170
8206
|
{
|
|
8171
8207
|
"name": "title",
|
|
@@ -8182,7 +8218,7 @@
|
|
|
8182
8218
|
"name": "title",
|
|
8183
8219
|
"type": "",
|
|
8184
8220
|
"returnType": "",
|
|
8185
|
-
"line":
|
|
8221
|
+
"line": 28
|
|
8186
8222
|
}
|
|
8187
8223
|
}
|
|
8188
8224
|
},
|
|
@@ -8349,19 +8385,19 @@
|
|
|
8349
8385
|
},
|
|
8350
8386
|
{
|
|
8351
8387
|
"name": "TableModel",
|
|
8352
|
-
"id": "class-TableModel-
|
|
8388
|
+
"id": "class-TableModel-b433548b3707dafa0b0bd1551423e1ef143db428ebed1b33c17b265d91f1aa454e4a347ccd998a4677cfb55a291cb3e25f3b07d7c8008fe683ea7af3fd2040ce",
|
|
8353
8389
|
"file": "src/table/table-model.class.ts",
|
|
8354
8390
|
"deprecated": false,
|
|
8355
8391
|
"deprecationMessage": "",
|
|
8356
8392
|
"type": "class",
|
|
8357
|
-
"sourceCode": "import {\n\tEventEmitter\n} 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\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 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\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\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\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 * 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\tthis.data.sort((a, b) => (this.header[index].descending ? -1 : 1) * this.header[index].compare(a[index], b[index]));\n\t\tthis.popRowStateFromModelData();\n\t\tthis.header.forEach(column => column.sorted = false);\n\t\tthis.header[index].sorted = true;\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\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.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",
|
|
8393
|
+
"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",
|
|
8358
8394
|
"constructorObj": {
|
|
8359
8395
|
"name": "constructor",
|
|
8360
8396
|
"description": "",
|
|
8361
8397
|
"deprecated": false,
|
|
8362
8398
|
"deprecationMessage": "",
|
|
8363
8399
|
"args": [],
|
|
8364
|
-
"line":
|
|
8400
|
+
"line": 192
|
|
8365
8401
|
},
|
|
8366
8402
|
"properties": [
|
|
8367
8403
|
{
|
|
@@ -8372,7 +8408,7 @@
|
|
|
8372
8408
|
"type": "number",
|
|
8373
8409
|
"optional": false,
|
|
8374
8410
|
"description": "<p>Tracks the current page.</p>\n",
|
|
8375
|
-
"line":
|
|
8411
|
+
"line": 130,
|
|
8376
8412
|
"rawdescription": "\n\nTracks the current page.\n"
|
|
8377
8413
|
},
|
|
8378
8414
|
{
|
|
@@ -8383,7 +8419,7 @@
|
|
|
8383
8419
|
"type": "",
|
|
8384
8420
|
"optional": false,
|
|
8385
8421
|
"description": "",
|
|
8386
|
-
"line":
|
|
8422
|
+
"line": 69
|
|
8387
8423
|
},
|
|
8388
8424
|
{
|
|
8389
8425
|
"name": "header",
|
|
@@ -8393,7 +8429,7 @@
|
|
|
8393
8429
|
"type": "TableHeaderItem[]",
|
|
8394
8430
|
"optional": false,
|
|
8395
8431
|
"description": "<p>Contains information about the header cells of the table.</p>\n",
|
|
8396
|
-
"line":
|
|
8432
|
+
"line": 125,
|
|
8397
8433
|
"rawdescription": "\n\nContains information about the header cells of the table.\n"
|
|
8398
8434
|
},
|
|
8399
8435
|
{
|
|
@@ -8404,7 +8440,7 @@
|
|
|
8404
8440
|
"type": "",
|
|
8405
8441
|
"optional": false,
|
|
8406
8442
|
"description": "<p>Set to true when there is no more data to load in the table</p>\n",
|
|
8407
|
-
"line":
|
|
8443
|
+
"line": 140,
|
|
8408
8444
|
"rawdescription": "\n\nSet to true when there is no more data to load in the table\n"
|
|
8409
8445
|
},
|
|
8410
8446
|
{
|
|
@@ -8415,7 +8451,7 @@
|
|
|
8415
8451
|
"type": "",
|
|
8416
8452
|
"optional": false,
|
|
8417
8453
|
"description": "<p>Set to true when lazy loading to show loading indicator</p>\n",
|
|
8418
|
-
"line":
|
|
8454
|
+
"line": 145,
|
|
8419
8455
|
"rawdescription": "\n\nSet to true when lazy loading to show loading indicator\n"
|
|
8420
8456
|
},
|
|
8421
8457
|
{
|
|
@@ -8426,7 +8462,7 @@
|
|
|
8426
8462
|
"type": "number",
|
|
8427
8463
|
"optional": false,
|
|
8428
8464
|
"description": "<p>Length of page.</p>\n",
|
|
8429
|
-
"line":
|
|
8465
|
+
"line": 135,
|
|
8430
8466
|
"rawdescription": "\n\nLength of page.\n"
|
|
8431
8467
|
},
|
|
8432
8468
|
{
|
|
@@ -8437,7 +8473,7 @@
|
|
|
8437
8473
|
"type": "string[]",
|
|
8438
8474
|
"optional": false,
|
|
8439
8475
|
"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",
|
|
8440
|
-
"line":
|
|
8476
|
+
"line": 120,
|
|
8441
8477
|
"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"
|
|
8442
8478
|
},
|
|
8443
8479
|
{
|
|
@@ -8448,7 +8484,7 @@
|
|
|
8448
8484
|
"type": "string[]",
|
|
8449
8485
|
"optional": false,
|
|
8450
8486
|
"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",
|
|
8451
|
-
"line":
|
|
8487
|
+
"line": 111,
|
|
8452
8488
|
"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"
|
|
8453
8489
|
},
|
|
8454
8490
|
{
|
|
@@ -8459,7 +8495,7 @@
|
|
|
8459
8495
|
"type": "boolean[]",
|
|
8460
8496
|
"optional": false,
|
|
8461
8497
|
"description": "<p>Contains information about expanded state of rows in the table.</p>\n",
|
|
8462
|
-
"line":
|
|
8498
|
+
"line": 96,
|
|
8463
8499
|
"rawdescription": "\n\nContains information about expanded state of rows in the table.\n"
|
|
8464
8500
|
},
|
|
8465
8501
|
{
|
|
@@ -8470,7 +8506,18 @@
|
|
|
8470
8506
|
"type": "",
|
|
8471
8507
|
"optional": false,
|
|
8472
8508
|
"description": "",
|
|
8473
|
-
"line":
|
|
8509
|
+
"line": 71
|
|
8510
|
+
},
|
|
8511
|
+
{
|
|
8512
|
+
"name": "rowsIndices",
|
|
8513
|
+
"defaultValue": "[]",
|
|
8514
|
+
"deprecated": false,
|
|
8515
|
+
"deprecationMessage": "",
|
|
8516
|
+
"type": "number[]",
|
|
8517
|
+
"optional": false,
|
|
8518
|
+
"description": "<p>Contains information about initial index of rows in the table</p>\n",
|
|
8519
|
+
"line": 101,
|
|
8520
|
+
"rawdescription": "\n\nContains information about initial index of rows in the table\n"
|
|
8474
8521
|
},
|
|
8475
8522
|
{
|
|
8476
8523
|
"name": "rowsSelected",
|
|
@@ -8480,7 +8527,7 @@
|
|
|
8480
8527
|
"type": "boolean[]",
|
|
8481
8528
|
"optional": false,
|
|
8482
8529
|
"description": "<p>Contains information about selection state of rows in the table.</p>\n",
|
|
8483
|
-
"line":
|
|
8530
|
+
"line": 91,
|
|
8484
8531
|
"rawdescription": "\n\nContains information about selection state of rows in the table.\n"
|
|
8485
8532
|
},
|
|
8486
8533
|
{
|
|
@@ -8491,7 +8538,7 @@
|
|
|
8491
8538
|
"type": "",
|
|
8492
8539
|
"optional": false,
|
|
8493
8540
|
"description": "",
|
|
8494
|
-
"line":
|
|
8541
|
+
"line": 70
|
|
8495
8542
|
},
|
|
8496
8543
|
{
|
|
8497
8544
|
"name": "selectAllChange",
|
|
@@ -8501,7 +8548,7 @@
|
|
|
8501
8548
|
"type": "",
|
|
8502
8549
|
"optional": false,
|
|
8503
8550
|
"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",
|
|
8504
|
-
"line":
|
|
8551
|
+
"line": 76,
|
|
8505
8552
|
"rawdescription": "\n\nGets emitted when `selectAll` is called. Emits false if all rows are deselected and true if\nall rows are selected.\n"
|
|
8506
8553
|
}
|
|
8507
8554
|
],
|
|
@@ -8529,7 +8576,7 @@
|
|
|
8529
8576
|
"optional": false,
|
|
8530
8577
|
"returnType": "void",
|
|
8531
8578
|
"typeParameters": [],
|
|
8532
|
-
"line":
|
|
8579
|
+
"line": 463,
|
|
8533
8580
|
"deprecated": false,
|
|
8534
8581
|
"deprecationMessage": "",
|
|
8535
8582
|
"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",
|
|
@@ -8537,8 +8584,8 @@
|
|
|
8537
8584
|
"jsdoctags": [
|
|
8538
8585
|
{
|
|
8539
8586
|
"name": {
|
|
8540
|
-
"pos":
|
|
8541
|
-
"end":
|
|
8587
|
+
"pos": 12019,
|
|
8588
|
+
"end": 12025,
|
|
8542
8589
|
"flags": 8421376,
|
|
8543
8590
|
"modifierFlagsCache": 0,
|
|
8544
8591
|
"transformFlags": 0,
|
|
@@ -8550,8 +8597,8 @@
|
|
|
8550
8597
|
"deprecationMessage": "",
|
|
8551
8598
|
"optional": true,
|
|
8552
8599
|
"tagName": {
|
|
8553
|
-
"pos":
|
|
8554
|
-
"end":
|
|
8600
|
+
"pos": 12012,
|
|
8601
|
+
"end": 12017,
|
|
8555
8602
|
"flags": 8421376,
|
|
8556
8603
|
"modifierFlagsCache": 0,
|
|
8557
8604
|
"transformFlags": 0,
|
|
@@ -8562,8 +8609,8 @@
|
|
|
8562
8609
|
},
|
|
8563
8610
|
{
|
|
8564
8611
|
"name": {
|
|
8565
|
-
"pos":
|
|
8566
|
-
"end":
|
|
8612
|
+
"pos": 12039,
|
|
8613
|
+
"end": 12044,
|
|
8567
8614
|
"flags": 8421376,
|
|
8568
8615
|
"modifierFlagsCache": 0,
|
|
8569
8616
|
"transformFlags": 0,
|
|
@@ -8575,8 +8622,8 @@
|
|
|
8575
8622
|
"deprecationMessage": "",
|
|
8576
8623
|
"optional": true,
|
|
8577
8624
|
"tagName": {
|
|
8578
|
-
"pos":
|
|
8579
|
-
"end":
|
|
8625
|
+
"pos": 12032,
|
|
8626
|
+
"end": 12037,
|
|
8580
8627
|
"flags": 8421376,
|
|
8581
8628
|
"modifierFlagsCache": 0,
|
|
8582
8629
|
"transformFlags": 0,
|
|
@@ -8608,7 +8655,7 @@
|
|
|
8608
8655
|
"optional": false,
|
|
8609
8656
|
"returnType": "void",
|
|
8610
8657
|
"typeParameters": [],
|
|
8611
|
-
"line":
|
|
8658
|
+
"line": 308,
|
|
8612
8659
|
"deprecated": false,
|
|
8613
8660
|
"deprecationMessage": "",
|
|
8614
8661
|
"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",
|
|
@@ -8616,8 +8663,8 @@
|
|
|
8616
8663
|
"jsdoctags": [
|
|
8617
8664
|
{
|
|
8618
8665
|
"name": {
|
|
8619
|
-
"pos":
|
|
8620
|
-
"end":
|
|
8666
|
+
"pos": 7857,
|
|
8667
|
+
"end": 7860,
|
|
8621
8668
|
"flags": 8421376,
|
|
8622
8669
|
"modifierFlagsCache": 0,
|
|
8623
8670
|
"transformFlags": 0,
|
|
@@ -8629,8 +8676,8 @@
|
|
|
8629
8676
|
"deprecationMessage": "",
|
|
8630
8677
|
"optional": true,
|
|
8631
8678
|
"tagName": {
|
|
8632
|
-
"pos":
|
|
8633
|
-
"end":
|
|
8679
|
+
"pos": 7850,
|
|
8680
|
+
"end": 7855,
|
|
8634
8681
|
"flags": 8421376,
|
|
8635
8682
|
"modifierFlagsCache": 0,
|
|
8636
8683
|
"transformFlags": 0,
|
|
@@ -8641,8 +8688,8 @@
|
|
|
8641
8688
|
},
|
|
8642
8689
|
{
|
|
8643
8690
|
"name": {
|
|
8644
|
-
"pos":
|
|
8645
|
-
"end":
|
|
8691
|
+
"pos": 7874,
|
|
8692
|
+
"end": 7879,
|
|
8646
8693
|
"flags": 8421376,
|
|
8647
8694
|
"modifierFlagsCache": 0,
|
|
8648
8695
|
"transformFlags": 0,
|
|
@@ -8654,8 +8701,8 @@
|
|
|
8654
8701
|
"deprecationMessage": "",
|
|
8655
8702
|
"optional": true,
|
|
8656
8703
|
"tagName": {
|
|
8657
|
-
"pos":
|
|
8658
|
-
"end":
|
|
8704
|
+
"pos": 7867,
|
|
8705
|
+
"end": 7872,
|
|
8659
8706
|
"flags": 8421376,
|
|
8660
8707
|
"modifierFlagsCache": 0,
|
|
8661
8708
|
"transformFlags": 0,
|
|
@@ -8679,7 +8726,7 @@
|
|
|
8679
8726
|
"optional": false,
|
|
8680
8727
|
"returnType": "TableItem[]",
|
|
8681
8728
|
"typeParameters": [],
|
|
8682
|
-
"line":
|
|
8729
|
+
"line": 435,
|
|
8683
8730
|
"deprecated": false,
|
|
8684
8731
|
"deprecationMessage": "",
|
|
8685
8732
|
"rawdescription": "\n\nReturns `index`th column of the table.\n\nNegative index starts from the end. -1 being the last element.\n\n",
|
|
@@ -8687,8 +8734,8 @@
|
|
|
8687
8734
|
"jsdoctags": [
|
|
8688
8735
|
{
|
|
8689
8736
|
"name": {
|
|
8690
|
-
"pos":
|
|
8691
|
-
"end":
|
|
8737
|
+
"pos": 11266,
|
|
8738
|
+
"end": 11271,
|
|
8692
8739
|
"flags": 8421376,
|
|
8693
8740
|
"modifierFlagsCache": 0,
|
|
8694
8741
|
"transformFlags": 0,
|
|
@@ -8699,8 +8746,53 @@
|
|
|
8699
8746
|
"deprecated": false,
|
|
8700
8747
|
"deprecationMessage": "",
|
|
8701
8748
|
"tagName": {
|
|
8702
|
-
"pos":
|
|
8703
|
-
"end":
|
|
8749
|
+
"pos": 11260,
|
|
8750
|
+
"end": 11265,
|
|
8751
|
+
"flags": 8421376,
|
|
8752
|
+
"modifierFlagsCache": 0,
|
|
8753
|
+
"transformFlags": 0,
|
|
8754
|
+
"kind": 79,
|
|
8755
|
+
"escapedText": "param"
|
|
8756
|
+
},
|
|
8757
|
+
"comment": ""
|
|
8758
|
+
}
|
|
8759
|
+
]
|
|
8760
|
+
},
|
|
8761
|
+
{
|
|
8762
|
+
"name": "cycleSortState",
|
|
8763
|
+
"args": [
|
|
8764
|
+
{
|
|
8765
|
+
"name": "index",
|
|
8766
|
+
"type": "number",
|
|
8767
|
+
"deprecated": false,
|
|
8768
|
+
"deprecationMessage": ""
|
|
8769
|
+
}
|
|
8770
|
+
],
|
|
8771
|
+
"optional": false,
|
|
8772
|
+
"returnType": "void",
|
|
8773
|
+
"typeParameters": [],
|
|
8774
|
+
"line": 551,
|
|
8775
|
+
"deprecated": false,
|
|
8776
|
+
"deprecationMessage": "",
|
|
8777
|
+
"rawdescription": "\n\ncycle through the three sort states\n",
|
|
8778
|
+
"description": "<p>cycle through the three sort states</p>\n",
|
|
8779
|
+
"jsdoctags": [
|
|
8780
|
+
{
|
|
8781
|
+
"name": {
|
|
8782
|
+
"pos": 14331,
|
|
8783
|
+
"end": 14336,
|
|
8784
|
+
"flags": 8421376,
|
|
8785
|
+
"modifierFlagsCache": 0,
|
|
8786
|
+
"transformFlags": 0,
|
|
8787
|
+
"kind": 79,
|
|
8788
|
+
"escapedText": "index"
|
|
8789
|
+
},
|
|
8790
|
+
"type": "number",
|
|
8791
|
+
"deprecated": false,
|
|
8792
|
+
"deprecationMessage": "",
|
|
8793
|
+
"tagName": {
|
|
8794
|
+
"pos": 14325,
|
|
8795
|
+
"end": 14330,
|
|
8704
8796
|
"flags": 8421376,
|
|
8705
8797
|
"modifierFlagsCache": 0,
|
|
8706
8798
|
"transformFlags": 0,
|
|
@@ -8724,7 +8816,7 @@
|
|
|
8724
8816
|
"optional": false,
|
|
8725
8817
|
"returnType": "void",
|
|
8726
8818
|
"typeParameters": [],
|
|
8727
|
-
"line":
|
|
8819
|
+
"line": 524,
|
|
8728
8820
|
"deprecated": false,
|
|
8729
8821
|
"deprecationMessage": "",
|
|
8730
8822
|
"rawdescription": "\n\nDeletes `index`th column.\n\nNegative index starts from the end. -1 being the last element.\n\n",
|
|
@@ -8732,8 +8824,8 @@
|
|
|
8732
8824
|
"jsdoctags": [
|
|
8733
8825
|
{
|
|
8734
8826
|
"name": {
|
|
8735
|
-
"pos":
|
|
8736
|
-
"end":
|
|
8827
|
+
"pos": 13630,
|
|
8828
|
+
"end": 13635,
|
|
8737
8829
|
"flags": 8421376,
|
|
8738
8830
|
"modifierFlagsCache": 0,
|
|
8739
8831
|
"transformFlags": 0,
|
|
@@ -8744,8 +8836,8 @@
|
|
|
8744
8836
|
"deprecated": false,
|
|
8745
8837
|
"deprecationMessage": "",
|
|
8746
8838
|
"tagName": {
|
|
8747
|
-
"pos":
|
|
8748
|
-
"end":
|
|
8839
|
+
"pos": 13624,
|
|
8840
|
+
"end": 13629,
|
|
8749
8841
|
"flags": 8421376,
|
|
8750
8842
|
"modifierFlagsCache": 0,
|
|
8751
8843
|
"transformFlags": 0,
|
|
@@ -8769,7 +8861,7 @@
|
|
|
8769
8861
|
"optional": false,
|
|
8770
8862
|
"returnType": "void",
|
|
8771
8863
|
"typeParameters": [],
|
|
8772
|
-
"line":
|
|
8864
|
+
"line": 397,
|
|
8773
8865
|
"deprecated": false,
|
|
8774
8866
|
"deprecationMessage": "",
|
|
8775
8867
|
"rawdescription": "\n\nDeletes `index`th row.\n\nNegative index starts from the end. -1 being the last element.\n\n",
|
|
@@ -8777,8 +8869,8 @@
|
|
|
8777
8869
|
"jsdoctags": [
|
|
8778
8870
|
{
|
|
8779
8871
|
"name": {
|
|
8780
|
-
"pos":
|
|
8781
|
-
"end":
|
|
8872
|
+
"pos": 10317,
|
|
8873
|
+
"end": 10322,
|
|
8782
8874
|
"flags": 8421376,
|
|
8783
8875
|
"modifierFlagsCache": 0,
|
|
8784
8876
|
"transformFlags": 0,
|
|
@@ -8789,8 +8881,8 @@
|
|
|
8789
8881
|
"deprecated": false,
|
|
8790
8882
|
"deprecationMessage": "",
|
|
8791
8883
|
"tagName": {
|
|
8792
|
-
"pos":
|
|
8793
|
-
"end":
|
|
8884
|
+
"pos": 10311,
|
|
8885
|
+
"end": 10316,
|
|
8794
8886
|
"flags": 8421376,
|
|
8795
8887
|
"modifierFlagsCache": 0,
|
|
8796
8888
|
"transformFlags": 0,
|
|
@@ -8807,7 +8899,7 @@
|
|
|
8807
8899
|
"optional": false,
|
|
8808
8900
|
"returnType": "number",
|
|
8809
8901
|
"typeParameters": [],
|
|
8810
|
-
"line":
|
|
8902
|
+
"line": 270,
|
|
8811
8903
|
"deprecated": false,
|
|
8812
8904
|
"deprecationMessage": "",
|
|
8813
8905
|
"rawdescription": "\n\nReturns how many rows is currently expanded\n",
|
|
@@ -8833,7 +8925,7 @@
|
|
|
8833
8925
|
"optional": false,
|
|
8834
8926
|
"returnType": "void",
|
|
8835
8927
|
"typeParameters": [],
|
|
8836
|
-
"line":
|
|
8928
|
+
"line": 703,
|
|
8837
8929
|
"deprecated": false,
|
|
8838
8930
|
"deprecationMessage": "",
|
|
8839
8931
|
"rawdescription": "\n\nExpands/Collapses `index`th row based on value\n\n",
|
|
@@ -8841,8 +8933,8 @@
|
|
|
8841
8933
|
"jsdoctags": [
|
|
8842
8934
|
{
|
|
8843
8935
|
"name": {
|
|
8844
|
-
"pos":
|
|
8845
|
-
"end":
|
|
8936
|
+
"pos": 18666,
|
|
8937
|
+
"end": 18671,
|
|
8846
8938
|
"flags": 8421376,
|
|
8847
8939
|
"modifierFlagsCache": 0,
|
|
8848
8940
|
"transformFlags": 0,
|
|
@@ -8853,8 +8945,8 @@
|
|
|
8853
8945
|
"deprecated": false,
|
|
8854
8946
|
"deprecationMessage": "",
|
|
8855
8947
|
"tagName": {
|
|
8856
|
-
"pos":
|
|
8857
|
-
"end":
|
|
8948
|
+
"pos": 18660,
|
|
8949
|
+
"end": 18665,
|
|
8858
8950
|
"flags": 8421376,
|
|
8859
8951
|
"modifierFlagsCache": 0,
|
|
8860
8952
|
"transformFlags": 0,
|
|
@@ -8865,8 +8957,8 @@
|
|
|
8865
8957
|
},
|
|
8866
8958
|
{
|
|
8867
8959
|
"name": {
|
|
8868
|
-
"pos":
|
|
8869
|
-
"end":
|
|
8960
|
+
"pos": 18722,
|
|
8961
|
+
"end": 18727,
|
|
8870
8962
|
"flags": 8421376,
|
|
8871
8963
|
"modifierFlagsCache": 0,
|
|
8872
8964
|
"transformFlags": 0,
|
|
@@ -8878,8 +8970,8 @@
|
|
|
8878
8970
|
"deprecationMessage": "",
|
|
8879
8971
|
"defaultValue": "true",
|
|
8880
8972
|
"tagName": {
|
|
8881
|
-
"pos":
|
|
8882
|
-
"end":
|
|
8973
|
+
"pos": 18716,
|
|
8974
|
+
"end": 18721,
|
|
8883
8975
|
"flags": 8421376,
|
|
8884
8976
|
"modifierFlagsCache": 0,
|
|
8885
8977
|
"transformFlags": 0,
|
|
@@ -8903,7 +8995,7 @@
|
|
|
8903
8995
|
"optional": false,
|
|
8904
8996
|
"returnType": "TableHeaderItem",
|
|
8905
8997
|
"typeParameters": [],
|
|
8906
|
-
"line":
|
|
8998
|
+
"line": 237,
|
|
8907
8999
|
"deprecated": false,
|
|
8908
9000
|
"deprecationMessage": "",
|
|
8909
9001
|
"rawdescription": "\n\nFinds closest header by trying the `column` and then working its way to the left\n\n",
|
|
@@ -8911,8 +9003,8 @@
|
|
|
8911
9003
|
"jsdoctags": [
|
|
8912
9004
|
{
|
|
8913
9005
|
"name": {
|
|
8914
|
-
"pos":
|
|
8915
|
-
"end":
|
|
9006
|
+
"pos": 6396,
|
|
9007
|
+
"end": 6402,
|
|
8916
9008
|
"flags": 8421376,
|
|
8917
9009
|
"modifierFlagsCache": 0,
|
|
8918
9010
|
"transformFlags": 0,
|
|
@@ -8923,8 +9015,8 @@
|
|
|
8923
9015
|
"deprecated": false,
|
|
8924
9016
|
"deprecationMessage": "",
|
|
8925
9017
|
"tagName": {
|
|
8926
|
-
"pos":
|
|
8927
|
-
"end":
|
|
9018
|
+
"pos": 6390,
|
|
9019
|
+
"end": 6395,
|
|
8928
9020
|
"flags": 8421376,
|
|
8929
9021
|
"modifierFlagsCache": 0,
|
|
8930
9022
|
"transformFlags": 0,
|
|
@@ -8955,7 +9047,7 @@
|
|
|
8955
9047
|
"optional": false,
|
|
8956
9048
|
"returnType": "string",
|
|
8957
9049
|
"typeParameters": [],
|
|
8958
|
-
"line":
|
|
9050
|
+
"line": 214,
|
|
8959
9051
|
"deprecated": false,
|
|
8960
9052
|
"deprecationMessage": "",
|
|
8961
9053
|
"rawdescription": "\n\nReturns the id of the header. Used to link the cells with headers (or headers with headers)\n\n",
|
|
@@ -8963,8 +9055,8 @@
|
|
|
8963
9055
|
"jsdoctags": [
|
|
8964
9056
|
{
|
|
8965
9057
|
"name": {
|
|
8966
|
-
"pos":
|
|
8967
|
-
"end":
|
|
9058
|
+
"pos": 5812,
|
|
9059
|
+
"end": 5818,
|
|
8968
9060
|
"flags": 8421376,
|
|
8969
9061
|
"modifierFlagsCache": 0,
|
|
8970
9062
|
"transformFlags": 0,
|
|
@@ -8975,8 +9067,8 @@
|
|
|
8975
9067
|
"deprecated": false,
|
|
8976
9068
|
"deprecationMessage": "",
|
|
8977
9069
|
"tagName": {
|
|
8978
|
-
"pos":
|
|
8979
|
-
"end":
|
|
9070
|
+
"pos": 5806,
|
|
9071
|
+
"end": 5811,
|
|
8980
9072
|
"flags": 8421376,
|
|
8981
9073
|
"modifierFlagsCache": 0,
|
|
8982
9074
|
"transformFlags": 0,
|
|
@@ -8987,8 +9079,8 @@
|
|
|
8987
9079
|
},
|
|
8988
9080
|
{
|
|
8989
9081
|
"name": {
|
|
8990
|
-
"pos":
|
|
8991
|
-
"end":
|
|
9082
|
+
"pos": 5870,
|
|
9083
|
+
"end": 5877,
|
|
8992
9084
|
"flags": 8421376,
|
|
8993
9085
|
"modifierFlagsCache": 0,
|
|
8994
9086
|
"transformFlags": 0,
|
|
@@ -9000,8 +9092,8 @@
|
|
|
9000
9092
|
"deprecationMessage": "",
|
|
9001
9093
|
"defaultValue": "1",
|
|
9002
9094
|
"tagName": {
|
|
9003
|
-
"pos":
|
|
9004
|
-
"end":
|
|
9095
|
+
"pos": 5864,
|
|
9096
|
+
"end": 5869,
|
|
9005
9097
|
"flags": 8421376,
|
|
9006
9098
|
"modifierFlagsCache": 0,
|
|
9007
9099
|
"transformFlags": 0,
|
|
@@ -9032,7 +9124,7 @@
|
|
|
9032
9124
|
"optional": false,
|
|
9033
9125
|
"returnType": "string",
|
|
9034
9126
|
"typeParameters": [],
|
|
9035
|
-
"line":
|
|
9127
|
+
"line": 204,
|
|
9036
9128
|
"deprecated": false,
|
|
9037
9129
|
"deprecationMessage": "",
|
|
9038
9130
|
"rawdescription": "\n\nReturns an id for the given column\n\n",
|
|
@@ -9040,8 +9132,8 @@
|
|
|
9040
9132
|
"jsdoctags": [
|
|
9041
9133
|
{
|
|
9042
9134
|
"name": {
|
|
9043
|
-
"pos":
|
|
9044
|
-
"end":
|
|
9135
|
+
"pos": 5476,
|
|
9136
|
+
"end": 5482,
|
|
9045
9137
|
"flags": 8421376,
|
|
9046
9138
|
"modifierFlagsCache": 0,
|
|
9047
9139
|
"transformFlags": 0,
|
|
@@ -9052,8 +9144,8 @@
|
|
|
9052
9144
|
"deprecated": false,
|
|
9053
9145
|
"deprecationMessage": "",
|
|
9054
9146
|
"tagName": {
|
|
9055
|
-
"pos":
|
|
9056
|
-
"end":
|
|
9147
|
+
"pos": 5470,
|
|
9148
|
+
"end": 5475,
|
|
9057
9149
|
"flags": 8421376,
|
|
9058
9150
|
"modifierFlagsCache": 0,
|
|
9059
9151
|
"transformFlags": 0,
|
|
@@ -9064,8 +9156,8 @@
|
|
|
9064
9156
|
},
|
|
9065
9157
|
{
|
|
9066
9158
|
"name": {
|
|
9067
|
-
"pos":
|
|
9068
|
-
"end":
|
|
9159
|
+
"pos": 5527,
|
|
9160
|
+
"end": 5530,
|
|
9069
9161
|
"flags": 8421376,
|
|
9070
9162
|
"modifierFlagsCache": 0,
|
|
9071
9163
|
"transformFlags": 0,
|
|
@@ -9077,8 +9169,8 @@
|
|
|
9077
9169
|
"deprecationMessage": "",
|
|
9078
9170
|
"defaultValue": "0",
|
|
9079
9171
|
"tagName": {
|
|
9080
|
-
"pos":
|
|
9081
|
-
"end":
|
|
9172
|
+
"pos": 5521,
|
|
9173
|
+
"end": 5526,
|
|
9082
9174
|
"flags": 8421376,
|
|
9083
9175
|
"modifierFlagsCache": 0,
|
|
9084
9176
|
"transformFlags": 0,
|
|
@@ -9102,7 +9194,7 @@
|
|
|
9102
9194
|
"optional": false,
|
|
9103
9195
|
"returnType": "any",
|
|
9104
9196
|
"typeParameters": [],
|
|
9105
|
-
"line":
|
|
9197
|
+
"line": 424,
|
|
9106
9198
|
"deprecated": false,
|
|
9107
9199
|
"deprecationMessage": "",
|
|
9108
9200
|
"jsdoctags": [
|
|
@@ -9123,7 +9215,7 @@
|
|
|
9123
9215
|
"optional": false,
|
|
9124
9216
|
"returnType": "any",
|
|
9125
9217
|
"typeParameters": [],
|
|
9126
|
-
"line":
|
|
9218
|
+
"line": 412,
|
|
9127
9219
|
"deprecated": false,
|
|
9128
9220
|
"deprecationMessage": ""
|
|
9129
9221
|
},
|
|
@@ -9140,7 +9232,7 @@
|
|
|
9140
9232
|
"optional": false,
|
|
9141
9233
|
"returnType": "boolean",
|
|
9142
9234
|
"typeParameters": [],
|
|
9143
|
-
"line":
|
|
9235
|
+
"line": 692,
|
|
9144
9236
|
"deprecated": false,
|
|
9145
9237
|
"deprecationMessage": "",
|
|
9146
9238
|
"rawdescription": "\n\nChecks if row is disabled or not.\n",
|
|
@@ -9170,7 +9262,7 @@
|
|
|
9170
9262
|
"optional": false,
|
|
9171
9263
|
"returnType": "any",
|
|
9172
9264
|
"typeParameters": [],
|
|
9173
|
-
"line":
|
|
9265
|
+
"line": 416,
|
|
9174
9266
|
"deprecated": false,
|
|
9175
9267
|
"deprecationMessage": "",
|
|
9176
9268
|
"jsdoctags": [
|
|
@@ -9198,7 +9290,7 @@
|
|
|
9198
9290
|
"optional": false,
|
|
9199
9291
|
"returnType": "any",
|
|
9200
9292
|
"typeParameters": [],
|
|
9201
|
-
"line":
|
|
9293
|
+
"line": 420,
|
|
9202
9294
|
"deprecated": false,
|
|
9203
9295
|
"deprecationMessage": "",
|
|
9204
9296
|
"jsdoctags": [
|
|
@@ -9226,7 +9318,7 @@
|
|
|
9226
9318
|
"optional": false,
|
|
9227
9319
|
"returnType": "boolean",
|
|
9228
9320
|
"typeParameters": [],
|
|
9229
|
-
"line":
|
|
9321
|
+
"line": 652,
|
|
9230
9322
|
"deprecated": false,
|
|
9231
9323
|
"deprecationMessage": "",
|
|
9232
9324
|
"rawdescription": "\n\nChecks if row is filtered out.\n\n",
|
|
@@ -9234,8 +9326,8 @@
|
|
|
9234
9326
|
"jsdoctags": [
|
|
9235
9327
|
{
|
|
9236
9328
|
"name": {
|
|
9237
|
-
"pos":
|
|
9238
|
-
"end":
|
|
9329
|
+
"pos": 17421,
|
|
9330
|
+
"end": 17426,
|
|
9239
9331
|
"flags": 8421376,
|
|
9240
9332
|
"modifierFlagsCache": 0,
|
|
9241
9333
|
"transformFlags": 0,
|
|
@@ -9246,8 +9338,8 @@
|
|
|
9246
9338
|
"deprecated": false,
|
|
9247
9339
|
"deprecationMessage": "",
|
|
9248
9340
|
"tagName": {
|
|
9249
|
-
"pos":
|
|
9250
|
-
"end":
|
|
9341
|
+
"pos": 17415,
|
|
9342
|
+
"end": 17420,
|
|
9251
9343
|
"flags": 8421376,
|
|
9252
9344
|
"modifierFlagsCache": 0,
|
|
9253
9345
|
"transformFlags": 0,
|
|
@@ -9258,8 +9350,8 @@
|
|
|
9258
9350
|
},
|
|
9259
9351
|
{
|
|
9260
9352
|
"tagName": {
|
|
9261
|
-
"pos":
|
|
9262
|
-
"end":
|
|
9353
|
+
"pos": 17432,
|
|
9354
|
+
"end": 17439,
|
|
9263
9355
|
"flags": 8421376,
|
|
9264
9356
|
"modifierFlagsCache": 0,
|
|
9265
9357
|
"transformFlags": 0,
|
|
@@ -9283,7 +9375,7 @@
|
|
|
9283
9375
|
"optional": false,
|
|
9284
9376
|
"returnType": "any",
|
|
9285
9377
|
"typeParameters": [],
|
|
9286
|
-
"line":
|
|
9378
|
+
"line": 685,
|
|
9287
9379
|
"deprecated": false,
|
|
9288
9380
|
"deprecationMessage": "",
|
|
9289
9381
|
"jsdoctags": [
|
|
@@ -9317,7 +9409,7 @@
|
|
|
9317
9409
|
"optional": false,
|
|
9318
9410
|
"returnType": "void",
|
|
9319
9411
|
"typeParameters": [],
|
|
9320
|
-
"line":
|
|
9412
|
+
"line": 538,
|
|
9321
9413
|
"deprecated": false,
|
|
9322
9414
|
"deprecationMessage": "",
|
|
9323
9415
|
"jsdoctags": [
|
|
@@ -9347,7 +9439,7 @@
|
|
|
9347
9439
|
"optional": false,
|
|
9348
9440
|
"returnType": "void",
|
|
9349
9441
|
"typeParameters": [],
|
|
9350
|
-
"line":
|
|
9442
|
+
"line": 636,
|
|
9351
9443
|
"deprecated": false,
|
|
9352
9444
|
"deprecationMessage": "",
|
|
9353
9445
|
"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",
|
|
@@ -9359,7 +9451,7 @@
|
|
|
9359
9451
|
"optional": false,
|
|
9360
9452
|
"returnType": "void",
|
|
9361
9453
|
"typeParameters": [],
|
|
9362
|
-
"line":
|
|
9454
|
+
"line": 606,
|
|
9363
9455
|
"deprecated": false,
|
|
9364
9456
|
"deprecationMessage": "",
|
|
9365
9457
|
"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",
|
|
@@ -9378,7 +9470,7 @@
|
|
|
9378
9470
|
"optional": false,
|
|
9379
9471
|
"returnType": "TableItem[]",
|
|
9380
9472
|
"typeParameters": [],
|
|
9381
|
-
"line":
|
|
9473
|
+
"line": 289,
|
|
9382
9474
|
"deprecated": false,
|
|
9383
9475
|
"deprecationMessage": "",
|
|
9384
9476
|
"rawdescription": "\n\nReturns `index`th row of the table.\n\nNegative index starts from the end. -1 being the last element.\n\n",
|
|
@@ -9386,8 +9478,8 @@
|
|
|
9386
9478
|
"jsdoctags": [
|
|
9387
9479
|
{
|
|
9388
9480
|
"name": {
|
|
9389
|
-
"pos":
|
|
9390
|
-
"end":
|
|
9481
|
+
"pos": 7301,
|
|
9482
|
+
"end": 7306,
|
|
9391
9483
|
"flags": 8421376,
|
|
9392
9484
|
"modifierFlagsCache": 0,
|
|
9393
9485
|
"transformFlags": 0,
|
|
@@ -9398,8 +9490,8 @@
|
|
|
9398
9490
|
"deprecated": false,
|
|
9399
9491
|
"deprecationMessage": "",
|
|
9400
9492
|
"tagName": {
|
|
9401
|
-
"pos":
|
|
9402
|
-
"end":
|
|
9493
|
+
"pos": 7295,
|
|
9494
|
+
"end": 7300,
|
|
9403
9495
|
"flags": 8421376,
|
|
9404
9496
|
"modifierFlagsCache": 0,
|
|
9405
9497
|
"transformFlags": 0,
|
|
@@ -9424,7 +9516,7 @@
|
|
|
9424
9516
|
"optional": false,
|
|
9425
9517
|
"returnType": "void",
|
|
9426
9518
|
"typeParameters": [],
|
|
9427
|
-
"line":
|
|
9519
|
+
"line": 676,
|
|
9428
9520
|
"deprecated": false,
|
|
9429
9521
|
"deprecationMessage": "",
|
|
9430
9522
|
"rawdescription": "\n\nSelects or deselects all rows in the model\n\n",
|
|
@@ -9432,8 +9524,8 @@
|
|
|
9432
9524
|
"jsdoctags": [
|
|
9433
9525
|
{
|
|
9434
9526
|
"name": {
|
|
9435
|
-
"pos":
|
|
9436
|
-
"end":
|
|
9527
|
+
"pos": 18094,
|
|
9528
|
+
"end": 18099,
|
|
9437
9529
|
"flags": 8421376,
|
|
9438
9530
|
"modifierFlagsCache": 0,
|
|
9439
9531
|
"transformFlags": 0,
|
|
@@ -9445,8 +9537,8 @@
|
|
|
9445
9537
|
"deprecationMessage": "",
|
|
9446
9538
|
"defaultValue": "true",
|
|
9447
9539
|
"tagName": {
|
|
9448
|
-
"pos":
|
|
9449
|
-
"end":
|
|
9540
|
+
"pos": 18088,
|
|
9541
|
+
"end": 18093,
|
|
9450
9542
|
"flags": 8421376,
|
|
9451
9543
|
"modifierFlagsCache": 0,
|
|
9452
9544
|
"transformFlags": 0,
|
|
@@ -9463,7 +9555,7 @@
|
|
|
9463
9555
|
"optional": false,
|
|
9464
9556
|
"returnType": "number",
|
|
9465
9557
|
"typeParameters": [],
|
|
9466
|
-
"line":
|
|
9558
|
+
"line": 255,
|
|
9467
9559
|
"deprecated": false,
|
|
9468
9560
|
"deprecationMessage": "",
|
|
9469
9561
|
"rawdescription": "\n\nReturns how many rows is currently selected\n",
|
|
@@ -9489,7 +9581,7 @@
|
|
|
9489
9581
|
"optional": false,
|
|
9490
9582
|
"returnType": "void",
|
|
9491
9583
|
"typeParameters": [],
|
|
9492
|
-
"line":
|
|
9584
|
+
"line": 663,
|
|
9493
9585
|
"deprecated": false,
|
|
9494
9586
|
"deprecationMessage": "",
|
|
9495
9587
|
"rawdescription": "\n\nSelect/deselect `index`th row based on value\n\n",
|
|
@@ -9497,8 +9589,8 @@
|
|
|
9497
9589
|
"jsdoctags": [
|
|
9498
9590
|
{
|
|
9499
9591
|
"name": {
|
|
9500
|
-
"pos":
|
|
9501
|
-
"end":
|
|
9592
|
+
"pos": 17757,
|
|
9593
|
+
"end": 17762,
|
|
9502
9594
|
"flags": 8421376,
|
|
9503
9595
|
"modifierFlagsCache": 0,
|
|
9504
9596
|
"transformFlags": 0,
|
|
@@ -9509,8 +9601,8 @@
|
|
|
9509
9601
|
"deprecated": false,
|
|
9510
9602
|
"deprecationMessage": "",
|
|
9511
9603
|
"tagName": {
|
|
9512
|
-
"pos":
|
|
9513
|
-
"end":
|
|
9604
|
+
"pos": 17751,
|
|
9605
|
+
"end": 17756,
|
|
9514
9606
|
"flags": 8421376,
|
|
9515
9607
|
"modifierFlagsCache": 0,
|
|
9516
9608
|
"transformFlags": 0,
|
|
@@ -9521,8 +9613,8 @@
|
|
|
9521
9613
|
},
|
|
9522
9614
|
{
|
|
9523
9615
|
"name": {
|
|
9524
|
-
"pos":
|
|
9525
|
-
"end":
|
|
9616
|
+
"pos": 17801,
|
|
9617
|
+
"end": 17806,
|
|
9526
9618
|
"flags": 8421376,
|
|
9527
9619
|
"modifierFlagsCache": 0,
|
|
9528
9620
|
"transformFlags": 0,
|
|
@@ -9534,8 +9626,8 @@
|
|
|
9534
9626
|
"deprecationMessage": "",
|
|
9535
9627
|
"defaultValue": "true",
|
|
9536
9628
|
"tagName": {
|
|
9537
|
-
"pos":
|
|
9538
|
-
"end":
|
|
9629
|
+
"pos": 17795,
|
|
9630
|
+
"end": 17800,
|
|
9539
9631
|
"flags": 8421376,
|
|
9540
9632
|
"modifierFlagsCache": 0,
|
|
9541
9633
|
"transformFlags": 0,
|
|
@@ -9559,7 +9651,7 @@
|
|
|
9559
9651
|
"optional": false,
|
|
9560
9652
|
"returnType": "void",
|
|
9561
9653
|
"typeParameters": [],
|
|
9562
|
-
"line":
|
|
9654
|
+
"line": 574,
|
|
9563
9655
|
"deprecated": false,
|
|
9564
9656
|
"deprecationMessage": "",
|
|
9565
9657
|
"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",
|
|
@@ -9567,8 +9659,8 @@
|
|
|
9567
9659
|
"jsdoctags": [
|
|
9568
9660
|
{
|
|
9569
9661
|
"name": {
|
|
9570
|
-
"pos":
|
|
9571
|
-
"end":
|
|
9662
|
+
"pos": 14918,
|
|
9663
|
+
"end": 14923,
|
|
9572
9664
|
"flags": 8421376,
|
|
9573
9665
|
"modifierFlagsCache": 0,
|
|
9574
9666
|
"transformFlags": 0,
|
|
@@ -9579,8 +9671,8 @@
|
|
|
9579
9671
|
"deprecated": false,
|
|
9580
9672
|
"deprecationMessage": "",
|
|
9581
9673
|
"tagName": {
|
|
9582
|
-
"pos":
|
|
9583
|
-
"end":
|
|
9674
|
+
"pos": 14912,
|
|
9675
|
+
"end": 14917,
|
|
9584
9676
|
"flags": 8421376,
|
|
9585
9677
|
"modifierFlagsCache": 0,
|
|
9586
9678
|
"transformFlags": 0,
|
|
@@ -9610,7 +9702,7 @@
|
|
|
9610
9702
|
}
|
|
9611
9703
|
],
|
|
9612
9704
|
"returnType": "void",
|
|
9613
|
-
"line":
|
|
9705
|
+
"line": 39,
|
|
9614
9706
|
"rawdescription": "\n\nSets data of the table.\n\nMake sure all rows are the same length to keep the column count accurate.\n",
|
|
9615
9707
|
"description": "<p>Sets data of the table.</p>\n<p>Make sure all rows are the same length to keep the column count accurate.</p>\n",
|
|
9616
9708
|
"jsdoctags": [
|
|
@@ -9629,7 +9721,7 @@
|
|
|
9629
9721
|
"name": "data",
|
|
9630
9722
|
"type": "",
|
|
9631
9723
|
"returnType": "",
|
|
9632
|
-
"line":
|
|
9724
|
+
"line": 84,
|
|
9633
9725
|
"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",
|
|
9634
9726
|
"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"
|
|
9635
9727
|
}
|
|
@@ -9650,7 +9742,7 @@
|
|
|
9650
9742
|
}
|
|
9651
9743
|
],
|
|
9652
9744
|
"returnType": "void",
|
|
9653
|
-
"line":
|
|
9745
|
+
"line": 161,
|
|
9654
9746
|
"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",
|
|
9655
9747
|
"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",
|
|
9656
9748
|
"jsdoctags": [
|
|
@@ -9669,7 +9761,7 @@
|
|
|
9669
9761
|
"name": "totalDataLength",
|
|
9670
9762
|
"type": "",
|
|
9671
9763
|
"returnType": "",
|
|
9672
|
-
"line":
|
|
9764
|
+
"line": 169,
|
|
9673
9765
|
"rawdescription": "\n\nTotal length of data that table has access to, or the amount manually set\n",
|
|
9674
9766
|
"description": "<p>Total length of data that table has access to, or the amount manually set</p>\n"
|
|
9675
9767
|
}
|
|
@@ -20129,7 +20221,7 @@
|
|
|
20129
20221
|
},
|
|
20130
20222
|
{
|
|
20131
20223
|
"name": "Checkbox",
|
|
20132
|
-
"id": "component-Checkbox-
|
|
20224
|
+
"id": "component-Checkbox-6867b7c8ca0114cc75323f10b4cf45c8179bc2ceccad44296a3f3afbbabe388791153a6af8ea1f2e8c41e9f06c217f595954d9c33e555e0eb548edeb22dd725f",
|
|
20133
20225
|
"file": "src/checkbox/checkbox.component.ts",
|
|
20134
20226
|
"changeDetection": "ChangeDetectionStrategy.OnPush",
|
|
20135
20227
|
"encapsulation": [],
|
|
@@ -20151,10 +20243,9 @@
|
|
|
20151
20243
|
"inputsClass": [
|
|
20152
20244
|
{
|
|
20153
20245
|
"name": "ariaLabel",
|
|
20154
|
-
"defaultValue": "\"\"",
|
|
20155
20246
|
"deprecated": false,
|
|
20156
20247
|
"deprecationMessage": "",
|
|
20157
|
-
"line":
|
|
20248
|
+
"line": 102,
|
|
20158
20249
|
"type": "string",
|
|
20159
20250
|
"decorators": []
|
|
20160
20251
|
},
|
|
@@ -20162,7 +20253,7 @@
|
|
|
20162
20253
|
"name": "ariaLabelledby",
|
|
20163
20254
|
"deprecated": false,
|
|
20164
20255
|
"deprecationMessage": "",
|
|
20165
|
-
"line":
|
|
20256
|
+
"line": 103,
|
|
20166
20257
|
"type": "string",
|
|
20167
20258
|
"decorators": []
|
|
20168
20259
|
},
|
|
@@ -20172,7 +20263,7 @@
|
|
|
20172
20263
|
"deprecationMessage": "",
|
|
20173
20264
|
"rawdescription": "\n\nSets the `checked` state. `true` for checked, `false` for unchecked\n\nAllows double binding with the `checkedChange` Output.\n",
|
|
20174
20265
|
"description": "<p>Sets the <code>checked</code> state. <code>true</code> for checked, <code>false</code> for unchecked</p>\n<p>Allows double binding with the <code>checkedChange</code> Output.</p>\n",
|
|
20175
|
-
"line":
|
|
20266
|
+
"line": 142,
|
|
20176
20267
|
"type": "boolean",
|
|
20177
20268
|
"decorators": []
|
|
20178
20269
|
},
|
|
@@ -20215,7 +20306,7 @@
|
|
|
20215
20306
|
"deprecationMessage": "",
|
|
20216
20307
|
"rawdescription": "\n\nSet the checkbox's indeterminate state to match the parameter and transition the view to reflect the change.\n\nAllows double binding with the `indeterminateChange` Output.\n",
|
|
20217
20308
|
"description": "<p>Set the checkbox's indeterminate state to match the parameter and transition the view to reflect the change.</p>\n<p>Allows double binding with the <code>indeterminateChange</code> Output.</p>\n",
|
|
20218
|
-
"line":
|
|
20309
|
+
"line": 110,
|
|
20219
20310
|
"type": "boolean",
|
|
20220
20311
|
"decorators": []
|
|
20221
20312
|
},
|
|
@@ -20269,7 +20360,7 @@
|
|
|
20269
20360
|
"deprecationMessage": "",
|
|
20270
20361
|
"rawdescription": "\n\nEmits an event when the value of the checkbox changes.\n\nAllows double biding with the `checked` Input.\n",
|
|
20271
20362
|
"description": "<p>Emits an event when the value of the checkbox changes.</p>\n<p>Allows double biding with the <code>checked</code> Input.</p>\n",
|
|
20272
|
-
"line":
|
|
20363
|
+
"line": 163,
|
|
20273
20364
|
"type": "EventEmitter"
|
|
20274
20365
|
},
|
|
20275
20366
|
{
|
|
@@ -20279,7 +20370,7 @@
|
|
|
20279
20370
|
"deprecationMessage": "",
|
|
20280
20371
|
"rawdescription": "\n\nEmits click event.\n",
|
|
20281
20372
|
"description": "<p>Emits click event.</p>\n",
|
|
20282
|
-
"line":
|
|
20373
|
+
"line": 156,
|
|
20283
20374
|
"type": "EventEmitter"
|
|
20284
20375
|
},
|
|
20285
20376
|
{
|
|
@@ -20289,7 +20380,7 @@
|
|
|
20289
20380
|
"deprecationMessage": "",
|
|
20290
20381
|
"rawdescription": "\n\nEmits event notifying other classes when a change in state occurs specifically\non an indeterminate checkbox.\n",
|
|
20291
20382
|
"description": "<p>Emits event notifying other classes when a change in state occurs specifically\non an indeterminate checkbox.</p>\n",
|
|
20292
|
-
"line":
|
|
20383
|
+
"line": 169,
|
|
20293
20384
|
"type": "EventEmitter"
|
|
20294
20385
|
}
|
|
20295
20386
|
],
|
|
@@ -20302,7 +20393,7 @@
|
|
|
20302
20393
|
"type": "",
|
|
20303
20394
|
"optional": false,
|
|
20304
20395
|
"description": "<p>Set to <code>true</code> if the input checkbox is selected (or checked).</p>\n",
|
|
20305
|
-
"line":
|
|
20396
|
+
"line": 174,
|
|
20306
20397
|
"rawdescription": "\n\nSet to `true` if the input checkbox is selected (or checked).\n"
|
|
20307
20398
|
},
|
|
20308
20399
|
{
|
|
@@ -20313,7 +20404,7 @@
|
|
|
20313
20404
|
"type": "",
|
|
20314
20405
|
"optional": false,
|
|
20315
20406
|
"description": "<p>Set to <code>true</code> if the input checkbox is in state indeterminate.</p>\n",
|
|
20316
|
-
"line":
|
|
20407
|
+
"line": 178,
|
|
20317
20408
|
"rawdescription": "\n\nSet to `true` if the input checkbox is in state indeterminate.\n"
|
|
20318
20409
|
},
|
|
20319
20410
|
{
|
|
@@ -20338,7 +20429,7 @@
|
|
|
20338
20429
|
"type": "",
|
|
20339
20430
|
"optional": false,
|
|
20340
20431
|
"description": "<p>Keeps a reference to the checkboxes current state, as defined in <code>CheckboxState</code>.</p>\n",
|
|
20341
|
-
"line":
|
|
20432
|
+
"line": 183,
|
|
20342
20433
|
"rawdescription": "\n\nKeeps a reference to the checkboxes current state, as defined in `CheckboxState`.\n"
|
|
20343
20434
|
},
|
|
20344
20435
|
{
|
|
@@ -20348,7 +20439,7 @@
|
|
|
20348
20439
|
"type": "ElementRef",
|
|
20349
20440
|
"optional": false,
|
|
20350
20441
|
"description": "<p>Maintains a reference to the view DOM element of the <code>Checkbox</code>.</p>\n",
|
|
20351
|
-
"line":
|
|
20442
|
+
"line": 188,
|
|
20352
20443
|
"rawdescription": "\n\nMaintains a reference to the view DOM element of the `Checkbox`.\n",
|
|
20353
20444
|
"decorators": [
|
|
20354
20445
|
{
|
|
@@ -20368,7 +20459,7 @@
|
|
|
20368
20459
|
"type": "function",
|
|
20369
20460
|
"optional": false,
|
|
20370
20461
|
"description": "<p>Called when checkbox is blurred. Needed to properly implement <code>ControlValueAccessor</code>.</p>\n",
|
|
20371
|
-
"line":
|
|
20462
|
+
"line": 278,
|
|
20372
20463
|
"rawdescription": "\n\nCalled when checkbox is blurred. Needed to properly implement `ControlValueAccessor`.\n"
|
|
20373
20464
|
},
|
|
20374
20465
|
{
|
|
@@ -20379,7 +20470,7 @@
|
|
|
20379
20470
|
"type": "",
|
|
20380
20471
|
"optional": false,
|
|
20381
20472
|
"description": "<p>Method set in <code>registerOnChange</code> to propagate changes back to the form.</p>\n",
|
|
20382
|
-
"line":
|
|
20473
|
+
"line": 307,
|
|
20383
20474
|
"rawdescription": "\n\nMethod set in `registerOnChange` to propagate changes back to the form.\n"
|
|
20384
20475
|
}
|
|
20385
20476
|
],
|
|
@@ -20390,7 +20481,7 @@
|
|
|
20390
20481
|
"optional": false,
|
|
20391
20482
|
"returnType": "void",
|
|
20392
20483
|
"typeParameters": [],
|
|
20393
|
-
"line":
|
|
20484
|
+
"line": 290,
|
|
20394
20485
|
"deprecated": false,
|
|
20395
20486
|
"deprecationMessage": "",
|
|
20396
20487
|
"rawdescription": "\n\nCreates instance of `CheckboxChange` used to propagate the change event.\n",
|
|
@@ -20402,7 +20493,7 @@
|
|
|
20402
20493
|
"optional": false,
|
|
20403
20494
|
"returnType": "void",
|
|
20404
20495
|
"typeParameters": [],
|
|
20405
|
-
"line":
|
|
20496
|
+
"line": 245,
|
|
20406
20497
|
"deprecated": false,
|
|
20407
20498
|
"deprecationMessage": "",
|
|
20408
20499
|
"decorators": [
|
|
@@ -20428,7 +20519,7 @@
|
|
|
20428
20519
|
"optional": false,
|
|
20429
20520
|
"returnType": "void",
|
|
20430
20521
|
"typeParameters": [],
|
|
20431
|
-
"line":
|
|
20522
|
+
"line": 252,
|
|
20432
20523
|
"deprecated": false,
|
|
20433
20524
|
"deprecationMessage": "",
|
|
20434
20525
|
"rawdescription": "\n\nExecutes on the event of a change within `Checkbox` to block propagation.\n",
|
|
@@ -20458,7 +20549,7 @@
|
|
|
20458
20549
|
"optional": false,
|
|
20459
20550
|
"returnType": "void",
|
|
20460
20551
|
"typeParameters": [],
|
|
20461
|
-
"line":
|
|
20552
|
+
"line": 259,
|
|
20462
20553
|
"deprecated": false,
|
|
20463
20554
|
"deprecationMessage": "",
|
|
20464
20555
|
"rawdescription": "\n\nHandles click events on the `Checkbox` and emits changes to other classes.\n",
|
|
@@ -20488,7 +20579,7 @@
|
|
|
20488
20579
|
"optional": false,
|
|
20489
20580
|
"returnType": "void",
|
|
20490
20581
|
"typeParameters": [],
|
|
20491
|
-
"line":
|
|
20582
|
+
"line": 220,
|
|
20492
20583
|
"deprecated": false,
|
|
20493
20584
|
"deprecationMessage": "",
|
|
20494
20585
|
"rawdescription": "\n\nSets a method in order to propagate changes back to the form.\n",
|
|
@@ -20521,7 +20612,7 @@
|
|
|
20521
20612
|
"optional": false,
|
|
20522
20613
|
"returnType": "void",
|
|
20523
20614
|
"typeParameters": [],
|
|
20524
|
-
"line":
|
|
20615
|
+
"line": 228,
|
|
20525
20616
|
"deprecated": false,
|
|
20526
20617
|
"deprecationMessage": "",
|
|
20527
20618
|
"rawdescription": "\n\nRegisters a callback to be triggered when the control has been touched.\n",
|
|
@@ -20532,8 +20623,8 @@
|
|
|
20532
20623
|
"jsdoctags": [
|
|
20533
20624
|
{
|
|
20534
20625
|
"name": {
|
|
20535
|
-
"pos":
|
|
20536
|
-
"end":
|
|
20626
|
+
"pos": 5324,
|
|
20627
|
+
"end": 5326,
|
|
20537
20628
|
"flags": 8421376,
|
|
20538
20629
|
"modifierFlagsCache": 0,
|
|
20539
20630
|
"transformFlags": 0,
|
|
@@ -20544,8 +20635,8 @@
|
|
|
20544
20635
|
"deprecated": false,
|
|
20545
20636
|
"deprecationMessage": "",
|
|
20546
20637
|
"tagName": {
|
|
20547
|
-
"pos":
|
|
20548
|
-
"end":
|
|
20638
|
+
"pos": 5318,
|
|
20639
|
+
"end": 5323,
|
|
20549
20640
|
"flags": 8421376,
|
|
20550
20641
|
"modifierFlagsCache": 0,
|
|
20551
20642
|
"transformFlags": 0,
|
|
@@ -20569,7 +20660,7 @@
|
|
|
20569
20660
|
"optional": false,
|
|
20570
20661
|
"returnType": "void",
|
|
20571
20662
|
"typeParameters": [],
|
|
20572
|
-
"line":
|
|
20663
|
+
"line": 239,
|
|
20573
20664
|
"deprecated": false,
|
|
20574
20665
|
"deprecationMessage": "",
|
|
20575
20666
|
"rawdescription": "\n\n`ControlValueAccessor` method to programmatically disable the checkbox.\n\nex: `this.formGroup.get(\"myCheckbox\").disable();`\n\n",
|
|
@@ -20577,8 +20668,8 @@
|
|
|
20577
20668
|
"jsdoctags": [
|
|
20578
20669
|
{
|
|
20579
20670
|
"name": {
|
|
20580
|
-
"pos":
|
|
20581
|
-
"end":
|
|
20671
|
+
"pos": 5605,
|
|
20672
|
+
"end": 5615,
|
|
20582
20673
|
"flags": 8421376,
|
|
20583
20674
|
"modifierFlagsCache": 0,
|
|
20584
20675
|
"transformFlags": 0,
|
|
@@ -20589,8 +20680,8 @@
|
|
|
20589
20680
|
"deprecated": false,
|
|
20590
20681
|
"deprecationMessage": "",
|
|
20591
20682
|
"tagName": {
|
|
20592
|
-
"pos":
|
|
20593
|
-
"end":
|
|
20683
|
+
"pos": 5599,
|
|
20684
|
+
"end": 5604,
|
|
20594
20685
|
"flags": 8421376,
|
|
20595
20686
|
"modifierFlagsCache": 0,
|
|
20596
20687
|
"transformFlags": 0,
|
|
@@ -20607,7 +20698,7 @@
|
|
|
20607
20698
|
"optional": false,
|
|
20608
20699
|
"returnType": "void",
|
|
20609
20700
|
"typeParameters": [],
|
|
20610
|
-
"line":
|
|
20701
|
+
"line": 200,
|
|
20611
20702
|
"deprecated": false,
|
|
20612
20703
|
"deprecationMessage": "",
|
|
20613
20704
|
"rawdescription": "\n\nToggle the selected state of the checkbox.\n",
|
|
@@ -20629,7 +20720,7 @@
|
|
|
20629
20720
|
"optional": false,
|
|
20630
20721
|
"returnType": "void",
|
|
20631
20722
|
"typeParameters": [],
|
|
20632
|
-
"line":
|
|
20723
|
+
"line": 283,
|
|
20633
20724
|
"deprecated": false,
|
|
20634
20725
|
"deprecationMessage": "",
|
|
20635
20726
|
"rawdescription": "\n\nHandles changes between checkbox states.\n",
|
|
@@ -20659,7 +20750,7 @@
|
|
|
20659
20750
|
"optional": false,
|
|
20660
20751
|
"returnType": "void",
|
|
20661
20752
|
"typeParameters": [],
|
|
20662
|
-
"line":
|
|
20753
|
+
"line": 212,
|
|
20663
20754
|
"deprecated": false,
|
|
20664
20755
|
"deprecationMessage": "",
|
|
20665
20756
|
"rawdescription": "\n\nWrites a value from `ngModel` to the component.\n\nIn this case the value is the `checked` property.\n\n",
|
|
@@ -20670,8 +20761,8 @@
|
|
|
20670
20761
|
"jsdoctags": [
|
|
20671
20762
|
{
|
|
20672
20763
|
"name": {
|
|
20673
|
-
"pos":
|
|
20674
|
-
"end":
|
|
20764
|
+
"pos": 4916,
|
|
20765
|
+
"end": 4921,
|
|
20675
20766
|
"flags": 8421376,
|
|
20676
20767
|
"modifierFlagsCache": 0,
|
|
20677
20768
|
"transformFlags": 0,
|
|
@@ -20682,8 +20773,8 @@
|
|
|
20682
20773
|
"deprecated": false,
|
|
20683
20774
|
"deprecationMessage": "",
|
|
20684
20775
|
"tagName": {
|
|
20685
|
-
"pos":
|
|
20686
|
-
"end":
|
|
20776
|
+
"pos": 4910,
|
|
20777
|
+
"end": 4915,
|
|
20687
20778
|
"flags": 8421376,
|
|
20688
20779
|
"modifierFlagsCache": 0,
|
|
20689
20780
|
"transformFlags": 0,
|
|
@@ -20705,7 +20796,7 @@
|
|
|
20705
20796
|
"argsDecorator": [],
|
|
20706
20797
|
"deprecated": false,
|
|
20707
20798
|
"deprecationMessage": "",
|
|
20708
|
-
"line":
|
|
20799
|
+
"line": 245
|
|
20709
20800
|
}
|
|
20710
20801
|
],
|
|
20711
20802
|
"standalone": false,
|
|
@@ -20713,7 +20804,7 @@
|
|
|
20713
20804
|
"description": "<p><a href=\"../../?path=/story/components-checkbox--basic\">See demo</a></p>\n",
|
|
20714
20805
|
"rawdescription": "\n\n[See demo](../../?path=/story/components-checkbox--basic)\n",
|
|
20715
20806
|
"type": "component",
|
|
20716
|
-
"sourceCode": "import {\n\tAfterViewInit,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tElementRef,\n\tEventEmitter,\n\tInput,\n\tOutput,\n\tViewChild,\n\tHostListener\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from \"@angular/forms\";\nimport { CheckboxValue } from \"./checkbox.types\";\n\n/**\n * Defines the set of states for a checkbox component.\n */\nexport enum CheckboxState {\n\tInit,\n\tIndeterminate,\n\tChecked,\n\tUnchecked\n}\n\n/**\n * [See demo](../../?path=/story/components-checkbox--basic)\n */\n@Component({\n\tselector: \"cds-checkbox, ibm-checkbox\",\n\ttemplate: `\n\t\t<div class=\"cds--form-item cds--checkbox-wrapper\">\n\t\t\t<input\n\t\t\t\t#inputCheckbox\n\t\t\t\tclass=\"cds--checkbox\"\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\t[id]=\"id + '_input'\"\n\t\t\t\t[value]=\"value\"\n\t\t\t\t[name]=\"name\"\n\t\t\t\t[required]=\"required\"\n\t\t\t\t[checked]=\"checked\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[attr.aria-labelledby]=\"ariaLabelledby\"\n\t\t\t\t(change)=\"onChange($event)\"\n\t\t\t\t(click)=\"onClick($event)\">\n\t\t\t<label\n\t\t\t\t[for]=\"id + '_input'\"\n\t\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t\tclass=\"cds--checkbox-label\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--skeleton' : skeleton\n\t\t\t\t}\">\n\t\t\t\t<span [ngClass]=\"{'cds--visually-hidden' : hideLabel}\" class=\"cds--checkbox-label-text\">\n\t\t\t\t\t<ng-content></ng-content>\n\t\t\t\t</span>\n\t\t\t</label>\n\t\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: Checkbox,\n\t\t\tmulti: true\n\t\t}\n\t],\n\tchangeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class Checkbox implements ControlValueAccessor, AfterViewInit {\n\t/**\n\t * Variable used for creating unique ids for checkbox components.\n\t */\n\tstatic checkboxCount = 0;\n\n\t/**\n\t * Set to `true` for a disabled checkbox.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Set to `true` for a loading checkbox.\n\t */\n\t@Input() skeleton = false;\n\t/**\n\t * Set to `true` to hide the checkbox labels.\n\t */\n\t@Input() hideLabel = false;\n\t/**\n\t * Sets the name attribute on the `input` element.\n\t */\n\t@Input() name: string;\n\t/**\n\t * The unique id for the checkbox component.\n\t */\n\t@Input() id = `checkbox-${Checkbox.checkboxCount}`;\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() value: CheckboxValue;\n\t
|
|
20807
|
+
"sourceCode": "import {\n\tAfterViewInit,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tElementRef,\n\tEventEmitter,\n\tInput,\n\tOutput,\n\tViewChild,\n\tHostListener\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from \"@angular/forms\";\nimport { CheckboxValue } from \"./checkbox.types\";\n\n/**\n * Defines the set of states for a checkbox component.\n */\nexport enum CheckboxState {\n\tInit,\n\tIndeterminate,\n\tChecked,\n\tUnchecked\n}\n\n/**\n * [See demo](../../?path=/story/components-checkbox--basic)\n */\n@Component({\n\tselector: \"cds-checkbox, ibm-checkbox\",\n\ttemplate: `\n\t\t<div class=\"cds--form-item cds--checkbox-wrapper\">\n\t\t\t<input\n\t\t\t\t#inputCheckbox\n\t\t\t\tclass=\"cds--checkbox\"\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\t[id]=\"id + '_input'\"\n\t\t\t\t[value]=\"value\"\n\t\t\t\t[name]=\"name\"\n\t\t\t\t[required]=\"required\"\n\t\t\t\t[checked]=\"checked\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[attr.aria-labelledby]=\"ariaLabelledby\"\n\t\t\t\t(change)=\"onChange($event)\"\n\t\t\t\t(click)=\"onClick($event)\">\n\t\t\t<label\n\t\t\t\t[for]=\"id + '_input'\"\n\t\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t\tclass=\"cds--checkbox-label\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--skeleton' : skeleton\n\t\t\t\t}\">\n\t\t\t\t<span [ngClass]=\"{'cds--visually-hidden' : hideLabel}\" class=\"cds--checkbox-label-text\">\n\t\t\t\t\t<ng-content></ng-content>\n\t\t\t\t</span>\n\t\t\t</label>\n\t\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: Checkbox,\n\t\t\tmulti: true\n\t\t}\n\t],\n\tchangeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class Checkbox implements ControlValueAccessor, AfterViewInit {\n\t/**\n\t * Variable used for creating unique ids for checkbox components.\n\t */\n\tstatic checkboxCount = 0;\n\n\t/**\n\t * Set to `true` for a disabled checkbox.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Set to `true` for a loading checkbox.\n\t */\n\t@Input() skeleton = false;\n\t/**\n\t * Set to `true` to hide the checkbox labels.\n\t */\n\t@Input() hideLabel = false;\n\t/**\n\t * Sets the name attribute on the `input` element.\n\t */\n\t@Input() name: string;\n\t/**\n\t * The unique id for the checkbox component.\n\t */\n\t@Input() id = `checkbox-${Checkbox.checkboxCount}`;\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() value: CheckboxValue;\n\t@Input() ariaLabel: string;\n\t@Input() ariaLabelledby: string;\n\n\t/**\n\t * Set the checkbox's indeterminate state to match the parameter and transition the view to reflect the change.\n\t *\n\t * Allows double binding with the `indeterminateChange` Output.\n\t */\n\t@Input() set indeterminate(indeterminate: boolean) {\n\t\tif (indeterminate === this._indeterminate) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._indeterminate = indeterminate;\n\n\t\tif (this._indeterminate) {\n\t\t\tthis.transitionCheckboxState(CheckboxState.Indeterminate);\n\t\t} else {\n\t\t\tthis.transitionCheckboxState(this.checked ? CheckboxState.Checked : CheckboxState.Unchecked);\n\t\t}\n\n\t\tif (this.inputCheckbox && this.inputCheckbox.nativeElement) {\n\t\t\tthis.inputCheckbox.nativeElement.indeterminate = indeterminate;\n\t\t}\n\t\tthis.changeDetectorRef.markForCheck();\n\t\tthis.indeterminateChange.emit(this._indeterminate);\n\t}\n\n\t/**\n\t * Reflects whether the checkbox state is indeterminate.\n\t */\n\tget indeterminate() {\n\t\treturn this._indeterminate;\n\t}\n\n\t/**\n\t * Sets the `checked` state. `true` for checked, `false` for unchecked\n\t *\n\t * Allows double binding with the `checkedChange` Output.\n\t */\n\t@Input() set checked (checked: boolean) {\n\t\tthis.setChecked(checked, false);\n\t}\n\n\t/**\n\t * Returns value `true` if state is selected for the checkbox.\n\t */\n\tget checked() {\n\t\treturn this._checked;\n\t}\n\n\t/**\n\t * Emits click event.\n\t */\n\t@Output() click = new EventEmitter<void>();\n\n\t/**\n\t * Emits an event when the value of the checkbox changes.\n\t *\n\t * Allows double biding with the `checked` Input.\n\t */\n\t@Output() checkedChange = new EventEmitter<boolean>();\n\n\t/**\n\t * Emits event notifying other classes when a change in state occurs specifically\n\t * on an indeterminate checkbox.\n\t */\n\t@Output() indeterminateChange = new EventEmitter<boolean>();\n\n\t/**\n\t * Set to `true` if the input checkbox is selected (or checked).\n\t */\n\t_checked = false;\n\t/**\n\t * Set to `true` if the input checkbox is in state indeterminate.\n\t */\n\t_indeterminate = false;\n\n\t/**\n\t * Keeps a reference to the checkboxes current state, as defined in `CheckboxState`.\n\t */\n\tcurrentCheckboxState = CheckboxState.Init;\n\n\t/**\n\t * Maintains a reference to the view DOM element of the `Checkbox`.\n\t */\n\t@ViewChild(\"inputCheckbox\") inputCheckbox: ElementRef;\n\n\t/**\n\t * Creates an instance of `Checkbox`.\n\t */\n\tconstructor(protected changeDetectorRef: ChangeDetectorRef) {\n\t\tCheckbox.checkboxCount++;\n\t}\n\n\t/**\n\t * Toggle the selected state of the checkbox.\n\t */\n\tpublic toggle() {\n\t\t// Flip checked and reset indeterminate\n\t\tthis.setChecked(!this.checked, true);\n\t}\n\n\t/**\n\t * Writes a value from `ngModel` to the component.\n\t *\n\t * In this case the value is the `checked` property.\n\t *\n\t * @param value boolean, corresponds to the `checked` property.\n\t */\n\tpublic writeValue(value: any) {\n\t\t// Set checked and reset indeterminate\n\t\tthis.setChecked(!!value, true);\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 checkbox is touched.\n\t */\n\tpublic registerOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\t/**\n\t * `ControlValueAccessor` method to programmatically disable the checkbox.\n\t *\n\t * ex: `this.formGroup.get(\"myCheckbox\").disable();`\n\t *\n\t * @param isDisabled `true` to disable the checkbox\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t\tthis.changeDetectorRef.markForCheck();\n\t}\n\n\t@HostListener(\"focusout\")\n\tfocusOut() {\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Executes on the event of a change within `Checkbox` to block propagation.\n\t */\n\tonChange(event: Event) {\n\t\tevent.stopPropagation();\n\t}\n\n\t/**\n\t * Handles click events on the `Checkbox` and emits changes to other classes.\n\t */\n\tonClick(event: Event) {\n\t\tif (this.click.observers.length) {\n\t\t\t// Disable default checkbox activation behavior which flips checked and resets indeterminate.\n\t\t\t// This allows the parent component to control the checked/indeterminate properties.\n\t\t\tevent.preventDefault();\n\t\t\tthis.click.emit();\n\t\t\treturn;\n\t\t}\n\t\tif (!this.disabled) {\n\t\t\tthis.toggle();\n\t\t\tthis.transitionCheckboxState(this._checked ? CheckboxState.Checked : CheckboxState.Unchecked);\n\t\t\tthis.emitChangeEvent();\n\t\t}\n\t}\n\n\n\t/**\n\t * Called when checkbox is blurred. Needed to properly implement `ControlValueAccessor`.\n\t */\n\tonTouched: () => any = () => {};\n\n\t/**\n\t * Handles changes between checkbox states.\n\t */\n\ttransitionCheckboxState(newState: CheckboxState) {\n\t\tthis.currentCheckboxState = newState;\n\t}\n\n\t/**\n\t * Creates instance of `CheckboxChange` used to propagate the change event.\n\t */\n\temitChangeEvent() {\n\t\tthis.checkedChange.emit(this.checked);\n\t\tthis.propagateChange(this.checked);\n\t}\n\n\t/**\n\t * Updates the checkbox if it is in the indeterminate state.\n\t */\n\tngAfterViewInit() {\n\t\tif (this.indeterminate && this.inputCheckbox && this.inputCheckbox.nativeElement) {\n\t\t\tthis.inputCheckbox.nativeElement.indeterminate = true;\n\t\t}\n\t}\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 * Sets checked state and optionally resets indeterminate state.\n\t */\n\tprivate setChecked(checked: boolean, resetIndeterminate: boolean) {\n\t\tif (checked === this._checked) {\n\t\t\treturn;\n\t\t}\n\t\tthis._checked = checked;\n\t\t// Reset indeterminate if requested\n\t\tif (resetIndeterminate && this._indeterminate) {\n\t\t\tthis._indeterminate = false;\n\t\t\tPromise.resolve().then(() => {\n\t\t\t\tthis.indeterminateChange.emit(this._indeterminate);\n\t\t\t});\n\t\t}\n\t\tthis.changeDetectorRef.markForCheck();\n\t}\n}\n",
|
|
20717
20808
|
"assetsDirs": [],
|
|
20718
20809
|
"styleUrlsData": "",
|
|
20719
20810
|
"stylesData": "",
|
|
@@ -20730,7 +20821,7 @@
|
|
|
20730
20821
|
"deprecationMessage": ""
|
|
20731
20822
|
}
|
|
20732
20823
|
],
|
|
20733
|
-
"line":
|
|
20824
|
+
"line": 188,
|
|
20734
20825
|
"rawdescription": "\n\nCreates an instance of `Checkbox`.\n",
|
|
20735
20826
|
"jsdoctags": [
|
|
20736
20827
|
{
|
|
@@ -20765,7 +20856,7 @@
|
|
|
20765
20856
|
}
|
|
20766
20857
|
],
|
|
20767
20858
|
"returnType": "void",
|
|
20768
|
-
"line":
|
|
20859
|
+
"line": 110,
|
|
20769
20860
|
"rawdescription": "\n\nSet the checkbox's indeterminate state to match the parameter and transition the view to reflect the change.\n\nAllows double binding with the `indeterminateChange` Output.\n",
|
|
20770
20861
|
"description": "<p>Set the checkbox's indeterminate state to match the parameter and transition the view to reflect the change.</p>\n<p>Allows double binding with the <code>indeterminateChange</code> Output.</p>\n",
|
|
20771
20862
|
"jsdoctags": [
|
|
@@ -20784,7 +20875,7 @@
|
|
|
20784
20875
|
"name": "indeterminate",
|
|
20785
20876
|
"type": "",
|
|
20786
20877
|
"returnType": "",
|
|
20787
|
-
"line":
|
|
20878
|
+
"line": 133,
|
|
20788
20879
|
"rawdescription": "\n\nReflects whether the checkbox state is indeterminate.\n",
|
|
20789
20880
|
"description": "<p>Reflects whether the checkbox state is indeterminate.</p>\n"
|
|
20790
20881
|
}
|
|
@@ -20805,7 +20896,7 @@
|
|
|
20805
20896
|
}
|
|
20806
20897
|
],
|
|
20807
20898
|
"returnType": "void",
|
|
20808
|
-
"line":
|
|
20899
|
+
"line": 142,
|
|
20809
20900
|
"rawdescription": "\n\nSets the `checked` state. `true` for checked, `false` for unchecked\n\nAllows double binding with the `checkedChange` Output.\n",
|
|
20810
20901
|
"description": "<p>Sets the <code>checked</code> state. <code>true</code> for checked, <code>false</code> for unchecked</p>\n<p>Allows double binding with the <code>checkedChange</code> Output.</p>\n",
|
|
20811
20902
|
"jsdoctags": [
|
|
@@ -20824,7 +20915,7 @@
|
|
|
20824
20915
|
"name": "checked",
|
|
20825
20916
|
"type": "",
|
|
20826
20917
|
"returnType": "",
|
|
20827
|
-
"line":
|
|
20918
|
+
"line": 149,
|
|
20828
20919
|
"rawdescription": "\n\nReturns value `true` if state is selected for the checkbox.\n",
|
|
20829
20920
|
"description": "<p>Returns value <code>true</code> if state is selected for the checkbox.</p>\n"
|
|
20830
20921
|
}
|
|
@@ -36189,7 +36280,7 @@
|
|
|
36189
36280
|
},
|
|
36190
36281
|
{
|
|
36191
36282
|
"name": "NumberComponent",
|
|
36192
|
-
"id": "component-NumberComponent-
|
|
36283
|
+
"id": "component-NumberComponent-a6aacb7486479b480eface10d4c6826c322ea7990da07d0dab0028be78418c849142be19618daca2163db2ac8bc147cf6033d2df3a4865f9350355d93f406d49",
|
|
36193
36284
|
"file": "src/number-input/number.component.ts",
|
|
36194
36285
|
"encapsulation": [],
|
|
36195
36286
|
"entryComponents": [],
|
|
@@ -36204,7 +36295,7 @@
|
|
|
36204
36295
|
"selector": "cds-number, ibm-number",
|
|
36205
36296
|
"styleUrls": [],
|
|
36206
36297
|
"styles": [],
|
|
36207
|
-
"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 *ngIf=\"skeleton && label\" class=\"cds--label cds--skeleton\"></label>\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[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(input)=\"onNumberInputChange($event)\"/>\n\t\t<svg\n\t\t\t*ngIf=\"!skeleton && !warn && 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<div\n\t\t*ngIf=\"helperText && !invalid && !warn\"\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=\"!warn && 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",
|
|
36298
|
+
"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 *ngIf=\"skeleton && label\" class=\"cds--label cds--skeleton\"></label>\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[attr.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[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(input)=\"onNumberInputChange($event)\"/>\n\t\t<svg\n\t\t\t*ngIf=\"!skeleton && !warn && 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<div\n\t\t*ngIf=\"helperText && !invalid && !warn\"\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=\"!warn && 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",
|
|
36208
36299
|
"templateUrl": [],
|
|
36209
36300
|
"viewProviders": [],
|
|
36210
36301
|
"hostDirectives": [],
|
|
@@ -36391,15 +36482,15 @@
|
|
|
36391
36482
|
"deprecationMessage": "since v5 - Use `cdsLayer` directive instead\n`light` or `dark` number input theme.",
|
|
36392
36483
|
"jsdoctags": [
|
|
36393
36484
|
{
|
|
36394
|
-
"pos":
|
|
36395
|
-
"end":
|
|
36485
|
+
"pos": 4314,
|
|
36486
|
+
"end": 4414,
|
|
36396
36487
|
"flags": 8421376,
|
|
36397
36488
|
"modifierFlagsCache": 0,
|
|
36398
36489
|
"transformFlags": 0,
|
|
36399
36490
|
"kind": 334,
|
|
36400
36491
|
"tagName": {
|
|
36401
|
-
"pos":
|
|
36402
|
-
"end":
|
|
36492
|
+
"pos": 4315,
|
|
36493
|
+
"end": 4325,
|
|
36403
36494
|
"flags": 8421376,
|
|
36404
36495
|
"modifierFlagsCache": 0,
|
|
36405
36496
|
"transformFlags": 0,
|
|
@@ -36706,8 +36797,8 @@
|
|
|
36706
36797
|
"jsdoctags": [
|
|
36707
36798
|
{
|
|
36708
36799
|
"name": {
|
|
36709
|
-
"pos":
|
|
36710
|
-
"end":
|
|
36800
|
+
"pos": 7500,
|
|
36801
|
+
"end": 7502,
|
|
36711
36802
|
"flags": 8421376,
|
|
36712
36803
|
"modifierFlagsCache": 0,
|
|
36713
36804
|
"transformFlags": 0,
|
|
@@ -36718,8 +36809,8 @@
|
|
|
36718
36809
|
"deprecated": false,
|
|
36719
36810
|
"deprecationMessage": "",
|
|
36720
36811
|
"tagName": {
|
|
36721
|
-
"pos":
|
|
36722
|
-
"end":
|
|
36812
|
+
"pos": 7494,
|
|
36813
|
+
"end": 7499,
|
|
36723
36814
|
"flags": 8421376,
|
|
36724
36815
|
"modifierFlagsCache": 0,
|
|
36725
36816
|
"transformFlags": 0,
|
|
@@ -36784,8 +36875,8 @@
|
|
|
36784
36875
|
"jsdoctags": [
|
|
36785
36876
|
{
|
|
36786
36877
|
"name": {
|
|
36787
|
-
"pos":
|
|
36788
|
-
"end":
|
|
36878
|
+
"pos": 7176,
|
|
36879
|
+
"end": 7181,
|
|
36789
36880
|
"flags": 8421376,
|
|
36790
36881
|
"modifierFlagsCache": 0,
|
|
36791
36882
|
"transformFlags": 0,
|
|
@@ -36796,8 +36887,8 @@
|
|
|
36796
36887
|
"deprecated": false,
|
|
36797
36888
|
"deprecationMessage": "",
|
|
36798
36889
|
"tagName": {
|
|
36799
|
-
"pos":
|
|
36800
|
-
"end":
|
|
36890
|
+
"pos": 7170,
|
|
36891
|
+
"end": 7175,
|
|
36801
36892
|
"flags": 8421376,
|
|
36802
36893
|
"modifierFlagsCache": 0,
|
|
36803
36894
|
"transformFlags": 0,
|
|
@@ -36837,7 +36928,7 @@
|
|
|
36837
36928
|
"description": "<p><a href=\"../../?path=/story/components-number--basic\">See demo</a></p>\n",
|
|
36838
36929
|
"rawdescription": "\n\n[See demo](../../?path=/story/components-number--basic)\n",
|
|
36839
36930
|
"type": "component",
|
|
36840
|
-
"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 * [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[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(input)=\"onNumberInputChange($event)\"/>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && !warn && 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=\"!warn && 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 * @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",
|
|
36931
|
+
"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 * [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[attr.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[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(input)=\"onNumberInputChange($event)\"/>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && !warn && 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=\"!warn && 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 * @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",
|
|
36841
36932
|
"assetsDirs": [],
|
|
36842
36933
|
"styleUrlsData": "",
|
|
36843
36934
|
"stylesData": "",
|
|
@@ -50699,7 +50790,7 @@
|
|
|
50699
50790
|
},
|
|
50700
50791
|
{
|
|
50701
50792
|
"name": "Table",
|
|
50702
|
-
"id": "component-Table-
|
|
50793
|
+
"id": "component-Table-336338b18c45e0b604ff6a1c28747e5a8d5a6171314cd64f1e96d58caf00ed4c20a7ef3ab0db0dd91d72f89f1db6c76c9329fe8c385a04695f9f9dbfcd9d93c7",
|
|
50703
50794
|
"file": "src/table/table.component.ts",
|
|
50704
50795
|
"encapsulation": [],
|
|
50705
50796
|
"entryComponents": [],
|
|
@@ -51778,7 +51869,7 @@
|
|
|
51778
51869
|
"optional": false,
|
|
51779
51870
|
"returnType": "any",
|
|
51780
51871
|
"typeParameters": [],
|
|
51781
|
-
"line":
|
|
51872
|
+
"line": 878,
|
|
51782
51873
|
"deprecated": false,
|
|
51783
51874
|
"deprecationMessage": ""
|
|
51784
51875
|
},
|
|
@@ -51788,7 +51879,7 @@
|
|
|
51788
51879
|
"optional": false,
|
|
51789
51880
|
"returnType": "any",
|
|
51790
51881
|
"typeParameters": [],
|
|
51791
|
-
"line":
|
|
51882
|
+
"line": 882,
|
|
51792
51883
|
"deprecated": false,
|
|
51793
51884
|
"deprecationMessage": ""
|
|
51794
51885
|
},
|
|
@@ -51798,7 +51889,7 @@
|
|
|
51798
51889
|
"optional": false,
|
|
51799
51890
|
"returnType": "any",
|
|
51800
51891
|
"typeParameters": [],
|
|
51801
|
-
"line":
|
|
51892
|
+
"line": 886,
|
|
51802
51893
|
"deprecated": false,
|
|
51803
51894
|
"deprecationMessage": ""
|
|
51804
51895
|
},
|
|
@@ -51808,7 +51899,7 @@
|
|
|
51808
51899
|
"optional": false,
|
|
51809
51900
|
"returnType": "any",
|
|
51810
51901
|
"typeParameters": [],
|
|
51811
|
-
"line":
|
|
51902
|
+
"line": 868,
|
|
51812
51903
|
"deprecated": false,
|
|
51813
51904
|
"deprecationMessage": ""
|
|
51814
51905
|
},
|
|
@@ -51818,7 +51909,7 @@
|
|
|
51818
51909
|
"optional": false,
|
|
51819
51910
|
"returnType": "any",
|
|
51820
51911
|
"typeParameters": [],
|
|
51821
|
-
"line":
|
|
51912
|
+
"line": 894,
|
|
51822
51913
|
"deprecated": false,
|
|
51823
51914
|
"deprecationMessage": ""
|
|
51824
51915
|
},
|
|
@@ -51828,7 +51919,7 @@
|
|
|
51828
51919
|
"optional": false,
|
|
51829
51920
|
"returnType": "any",
|
|
51830
51921
|
"typeParameters": [],
|
|
51831
|
-
"line":
|
|
51922
|
+
"line": 890,
|
|
51832
51923
|
"deprecated": false,
|
|
51833
51924
|
"deprecationMessage": ""
|
|
51834
51925
|
},
|
|
@@ -51845,7 +51936,7 @@
|
|
|
51845
51936
|
"optional": false,
|
|
51846
51937
|
"returnType": "{ value: any; }",
|
|
51847
51938
|
"typeParameters": [],
|
|
51848
|
-
"line":
|
|
51939
|
+
"line": 861,
|
|
51849
51940
|
"deprecated": false,
|
|
51850
51941
|
"deprecationMessage": "",
|
|
51851
51942
|
"jsdoctags": [
|
|
@@ -51866,7 +51957,7 @@
|
|
|
51866
51957
|
"optional": false,
|
|
51867
51958
|
"returnType": "any",
|
|
51868
51959
|
"typeParameters": [],
|
|
51869
|
-
"line":
|
|
51960
|
+
"line": 874,
|
|
51870
51961
|
"deprecated": false,
|
|
51871
51962
|
"deprecationMessage": ""
|
|
51872
51963
|
},
|
|
@@ -51876,7 +51967,7 @@
|
|
|
51876
51967
|
"optional": false,
|
|
51877
51968
|
"returnType": "any",
|
|
51878
51969
|
"typeParameters": [],
|
|
51879
|
-
"line":
|
|
51970
|
+
"line": 871,
|
|
51880
51971
|
"deprecated": false,
|
|
51881
51972
|
"deprecationMessage": ""
|
|
51882
51973
|
},
|
|
@@ -52029,7 +52120,7 @@
|
|
|
52029
52120
|
"optional": false,
|
|
52030
52121
|
"returnType": "void",
|
|
52031
52122
|
"typeParameters": [],
|
|
52032
|
-
"line":
|
|
52123
|
+
"line": 856,
|
|
52033
52124
|
"deprecated": false,
|
|
52034
52125
|
"deprecationMessage": "",
|
|
52035
52126
|
"rawdescription": "\n\nTriggered when the user scrolls on the `<tbody>` element.\nEmits the `scrollLoad` event.\n",
|
|
@@ -52172,7 +52263,7 @@
|
|
|
52172
52263
|
"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<div><pre class=\"line-numbers\"><code class=\"language-html\"><cds-table [model]="model"></cds-table></code></pre></div><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<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><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<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<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<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<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>",
|
|
52173
52264
|
"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",
|
|
52174
52265
|
"type": "component",
|
|
52175
|
-
"sourceCode": "import {\n\tComponent,\n\tApplicationRef,\n\tInput,\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 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 (element.firstElementChild && element.firstElementChild.classList.contains(\"cds--table-sort\") && focusElementList.length > 1) {\n\t\t\tfocusElementList[1].focus();\n\t\t} else if (focusElementList.length > 0) {\n\t\t\tfocusElementList[0].focus();\n\t\t} else {\n\t\t\telement.focus();\n\t\t}\n\t}\n\n\t/**\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\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\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\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",
|
|
52266
|
+
"sourceCode": "import {\n\tComponent,\n\tApplicationRef,\n\tInput,\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 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 (element.firstElementChild && element.firstElementChild.classList.contains(\"cds--table-sort\") && focusElementList.length > 1) {\n\t\t\tfocusElementList[1].focus();\n\t\t} else if (focusElementList.length > 0) {\n\t\t\tfocusElementList[0].focus();\n\t\t} else {\n\t\t\telement.focus();\n\t\t}\n\t}\n\n\t/**\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\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",
|
|
52176
52267
|
"assetsDirs": [],
|
|
52177
52268
|
"styleUrlsData": "",
|
|
52178
52269
|
"stylesData": "\n\t\t:host {\n\t\t\tdisplay: block;\n\t\t}\n\t\n",
|
|
@@ -57920,7 +58011,7 @@
|
|
|
57920
58011
|
},
|
|
57921
58012
|
{
|
|
57922
58013
|
"name": "TextareaLabelComponent",
|
|
57923
|
-
"id": "component-TextareaLabelComponent-
|
|
58014
|
+
"id": "component-TextareaLabelComponent-b0cb92af0c0b5b5625687996da5ce4ba9dccb27e45b22e29b5db1b636dd2d87c08e3e2873a2a25a468d26be2e89f16cd3fd1ced76ea2b32dbbfa40495f8a83c4",
|
|
57924
58015
|
"file": "src/input/textarea-label.component.ts",
|
|
57925
58016
|
"encapsulation": [],
|
|
57926
58017
|
"entryComponents": [],
|
|
@@ -57930,7 +58021,7 @@
|
|
|
57930
58021
|
"selector": "cds-textarea-label, ibm-textarea-label",
|
|
57931
58022
|
"styleUrls": [],
|
|
57932
58023
|
"styles": [],
|
|
57933
|
-
"template": "<label\n\t[for]=\"labelInputID\"\n\t[attr.aria-label]=\"ariaLabel\"\n\tclass=\"cds--label\"\n\t[ngClass]=\"{\n\t\t'cds--label--disabled': disabled,\n\t\t'cds--skeleton': skeleton\n\t}\">\n\t<ng-template *ngIf=\"labelTemplate; else labelContent\" [ngTemplateOutlet]=\"labelTemplate\"></ng-template>\n\t<ng-template #labelContent>\n\t\t<ng-content></ng-content>\n\t</ng-template>\n</label>\n<div\n\tclass=\"cds--text-area__wrapper\"\n\t[ngClass]=\"{\n\t\t'cds--text-input__field-wrapper--warning': warn\n\t}\"\n\t[attr.data-invalid]=\"(invalid ? true : null)\"\n\t#wrapper>\n\t<svg\n\t\t*ngIf=\"!warn && invalid\"\n\t\
|
|
58024
|
+
"template": "<label\n\t[for]=\"labelInputID\"\n\t[attr.aria-label]=\"ariaLabel\"\n\tclass=\"cds--label\"\n\t[ngClass]=\"{\n\t\t'cds--label--disabled': disabled,\n\t\t'cds--skeleton': skeleton\n\t}\">\n\t<ng-template *ngIf=\"labelTemplate; else labelContent\" [ngTemplateOutlet]=\"labelTemplate\"></ng-template>\n\t<ng-template #labelContent>\n\t\t<ng-content></ng-content>\n\t</ng-template>\n</label>\n<div\n\tclass=\"cds--text-area__wrapper\"\n\t[ngClass]=\"{\n\t\t'cds--text-input__field-wrapper--warning': warn\n\t}\"\n\t[attr.data-invalid]=\"(invalid ? true : null)\"\n\t#wrapper>\n\t<svg\n\t\t*ngIf=\"!warn && invalid\"\n\t\tcdsIcon=\"warning--filled\"\n\t\tsize=\"16\"\n\t\tclass=\"cds--text-area__invalid-icon\">\n\t</svg>\n\t<svg\n\t\t*ngIf=\"!invalid && warn\"\n\t\tcdsIcon=\"warning--alt--filled\"\n\t\tsize=\"16\"\n\t\tclass=\"cds--text-input__invalid-icon cds--text-input__invalid-icon--warning\">\n\t</svg>\n\t<ng-template *ngIf=\"textAreaTemplate; else textAreaContent\" [ngTemplateOutlet]=\"textAreaTemplate\"></ng-template>\n\t<ng-template #textAreaContent>\n\t\t<ng-content select=\"textarea\"></ng-content>\n\t</ng-template>\n</div>\n<div\n\t*ngIf=\"!skeleton && helperText && !invalid && !warn\"\n\tclass=\"cds--form__helper-text\"\n\t[ngClass]=\"{'cds--form__helper-text--disabled': disabled}\">\n\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n</div>\n<div *ngIf=\"!warn && invalid\" class=\"cds--form-requirement\">\n\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n</div>\n<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n</div>\n\t",
|
|
57934
58025
|
"templateUrl": [],
|
|
57935
58026
|
"viewProviders": [],
|
|
57936
58027
|
"hostDirectives": [],
|
|
@@ -58173,7 +58264,7 @@
|
|
|
58173
58264
|
"description": "",
|
|
58174
58265
|
"rawdescription": "\n",
|
|
58175
58266
|
"type": "component",
|
|
58176
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tAfterViewInit,\n\tElementRef,\n\tHostBinding,\n\tTemplateRef,\n\tViewChild,\n\tContentChild,\n\tChangeDetectorRef\n} from \"@angular/core\";\n\nimport { TextArea } from \"./text-area.directive\";\n\n@Component({\n\tselector: \"cds-textarea-label, ibm-textarea-label\",\n\ttemplate: `\n\t\t<label\n\t\t\t[for]=\"labelInputID\"\n\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\tclass=\"cds--label\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--label--disabled': disabled,\n\t\t\t\t'cds--skeleton': skeleton\n\t\t\t}\">\n\t\t\t<ng-template *ngIf=\"labelTemplate; else labelContent\" [ngTemplateOutlet]=\"labelTemplate\"></ng-template>\n\t\t\t<ng-template #labelContent>\n\t\t\t\t<ng-content></ng-content>\n\t\t\t</ng-template>\n\t\t</label>\n\t\t<div\n\t\t\tclass=\"cds--text-area__wrapper\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--text-input__field-wrapper--warning': warn\n\t\t\t}\"\n\t\t\t[attr.data-invalid]=\"(invalid ? true : null)\"\n\t\t\t#wrapper>\n\t\t\t<svg\n\t\t\t\t*ngIf=\"!warn && invalid\"\n\t\t\t\
|
|
58267
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tAfterViewInit,\n\tElementRef,\n\tHostBinding,\n\tTemplateRef,\n\tViewChild,\n\tContentChild,\n\tChangeDetectorRef\n} from \"@angular/core\";\n\nimport { TextArea } from \"./text-area.directive\";\n\n@Component({\n\tselector: \"cds-textarea-label, ibm-textarea-label\",\n\ttemplate: `\n\t\t<label\n\t\t\t[for]=\"labelInputID\"\n\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\tclass=\"cds--label\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--label--disabled': disabled,\n\t\t\t\t'cds--skeleton': skeleton\n\t\t\t}\">\n\t\t\t<ng-template *ngIf=\"labelTemplate; else labelContent\" [ngTemplateOutlet]=\"labelTemplate\"></ng-template>\n\t\t\t<ng-template #labelContent>\n\t\t\t\t<ng-content></ng-content>\n\t\t\t</ng-template>\n\t\t</label>\n\t\t<div\n\t\t\tclass=\"cds--text-area__wrapper\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--text-input__field-wrapper--warning': warn\n\t\t\t}\"\n\t\t\t[attr.data-invalid]=\"(invalid ? true : null)\"\n\t\t\t#wrapper>\n\t\t\t<svg\n\t\t\t\t*ngIf=\"!warn && invalid\"\n\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\tsize=\"16\"\n\t\t\t\tclass=\"cds--text-area__invalid-icon\">\n\t\t\t</svg>\n\t\t\t<svg\n\t\t\t\t*ngIf=\"!invalid && warn\"\n\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\tsize=\"16\"\n\t\t\t\tclass=\"cds--text-input__invalid-icon cds--text-input__invalid-icon--warning\">\n\t\t\t</svg>\n\t\t\t<ng-template *ngIf=\"textAreaTemplate; else textAreaContent\" [ngTemplateOutlet]=\"textAreaTemplate\"></ng-template>\n\t\t\t<ng-template #textAreaContent>\n\t\t\t\t<ng-content select=\"textarea\"></ng-content>\n\t\t\t</ng-template>\n\t\t</div>\n\t\t<div\n\t\t\t*ngIf=\"!skeleton && helperText && !invalid && !warn\"\n\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t[ngClass]=\"{'cds--form__helper-text--disabled': disabled}\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t</div>\n\t\t<div *ngIf=\"!warn && invalid\" class=\"cds--form-requirement\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t</div>\n\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t</div>\n\t`\n})\nexport class TextareaLabelComponent implements AfterViewInit {\n\t/**\n\t * Used to build the id of the input item associated with the `Label`.\n\t */\n\tstatic labelCounter = 0;\n\t/**\n\t * The id of the input item associated with the `Label`. This value is also used to associate the `Label` with\n\t * its input counterpart through the 'for' attribute.\n\t*/\n\t@Input() labelInputID = \"ibm-textarea-\" + TextareaLabelComponent.labelCounter;\n\n\t/**\n\t * Set to `true` for a disabled label.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Set to `true` for a loading label.\n\t */\n\t@Input() skeleton = false;\n\n\t/**\n\t * Helper input property for ease of migration\n\t * Since we cannot pass ng-content down easily from label component, we will accept the templates\n\t */\n\t@Input() labelTemplate: TemplateRef<any>;\n\t@Input() textAreaTemplate: TemplateRef<any>;\n\t/**\n\t * Optional helper text that appears under the label.\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 * Set to `true` for an invalid label component.\n\t */\n\t@Input() invalid = false;\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 * Set the arialabel for label\n\t */\n\t@Input() ariaLabel: string;\n\n\t// @ts-ignore\n\t@ViewChild(\"wrapper\", { static: false }) wrapper: ElementRef<HTMLDivElement>;\n\n\t// @ts-ignore\n\t@ContentChild(TextArea, { static: false }) textArea: TextArea;\n\n\t@HostBinding(\"class.cds--form-item\") labelClass = true;\n\n\t/**\n\t * Creates an instance of Label.\n\t */\n\tconstructor(protected changeDetectorRef: ChangeDetectorRef) {}\n\n\t/**\n\t * Sets the id on the input item associated with the `Label`.\n\t */\n\tngAfterViewInit() {\n\t\tif (this.wrapper) {\n\t\t\t// Prioritize setting id to `textarea` over div\n\t\t\tconst inputElement = this.wrapper.nativeElement.querySelector(\"textarea\");\n\t\t\tif (inputElement) {\n\t\t\t\t// avoid overriding ids already set by the user reuse it instead\n\t\t\t\tif (inputElement.id) {\n\t\t\t\t\tthis.labelInputID = inputElement.id;\n\t\t\t\t\tthis.changeDetectorRef.detectChanges();\n\t\t\t\t}\n\t\t\t\tinputElement.setAttribute(\"id\", this.labelInputID);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst divElement = this.wrapper.nativeElement.querySelector(\"div\");\n\t\t\tif (divElement) {\n\t\t\t\tif (divElement.id) {\n\t\t\t\t\tthis.labelInputID = divElement.id;\n\t\t\t\t\tthis.changeDetectorRef.detectChanges();\n\t\t\t\t}\n\t\t\t\tdivElement.setAttribute(\"id\", this.labelInputID);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n}\n",
|
|
58177
58268
|
"assetsDirs": [],
|
|
58178
58269
|
"styleUrlsData": "",
|
|
58179
58270
|
"stylesData": "",
|
|
@@ -60533,10 +60624,9 @@
|
|
|
60533
60624
|
},
|
|
60534
60625
|
{
|
|
60535
60626
|
"name": "ariaLabel",
|
|
60536
|
-
"defaultValue": "\"\"",
|
|
60537
60627
|
"deprecated": false,
|
|
60538
60628
|
"deprecationMessage": "",
|
|
60539
|
-
"line":
|
|
60629
|
+
"line": 102,
|
|
60540
60630
|
"type": "string",
|
|
60541
60631
|
"decorators": [],
|
|
60542
60632
|
"inheritance": {
|
|
@@ -60547,7 +60637,7 @@
|
|
|
60547
60637
|
"name": "ariaLabelledby",
|
|
60548
60638
|
"deprecated": false,
|
|
60549
60639
|
"deprecationMessage": "",
|
|
60550
|
-
"line":
|
|
60640
|
+
"line": 103,
|
|
60551
60641
|
"type": "string",
|
|
60552
60642
|
"decorators": [],
|
|
60553
60643
|
"inheritance": {
|
|
@@ -60560,7 +60650,7 @@
|
|
|
60560
60650
|
"deprecationMessage": "",
|
|
60561
60651
|
"rawdescription": "\n\nSets the `checked` state. `true` for checked, `false` for unchecked\n\nAllows double binding with the `checkedChange` Output.\n",
|
|
60562
60652
|
"description": "<p>Sets the <code>checked</code> state. <code>true</code> for checked, <code>false</code> for unchecked</p>\n<p>Allows double binding with the <code>checkedChange</code> Output.</p>\n",
|
|
60563
|
-
"line":
|
|
60653
|
+
"line": 142,
|
|
60564
60654
|
"type": "boolean",
|
|
60565
60655
|
"decorators": [],
|
|
60566
60656
|
"inheritance": {
|
|
@@ -60601,7 +60691,7 @@
|
|
|
60601
60691
|
"deprecationMessage": "",
|
|
60602
60692
|
"rawdescription": "\n\nSet the checkbox's indeterminate state to match the parameter and transition the view to reflect the change.\n\nAllows double binding with the `indeterminateChange` Output.\n",
|
|
60603
60693
|
"description": "<p>Set the checkbox's indeterminate state to match the parameter and transition the view to reflect the change.</p>\n<p>Allows double binding with the <code>indeterminateChange</code> Output.</p>\n",
|
|
60604
|
-
"line":
|
|
60694
|
+
"line": 110,
|
|
60605
60695
|
"type": "boolean",
|
|
60606
60696
|
"decorators": [],
|
|
60607
60697
|
"inheritance": {
|
|
@@ -60656,7 +60746,7 @@
|
|
|
60656
60746
|
"deprecationMessage": "",
|
|
60657
60747
|
"rawdescription": "\n\nEmits an event when the value of the checkbox changes.\n\nAllows double biding with the `checked` Input.\n",
|
|
60658
60748
|
"description": "<p>Emits an event when the value of the checkbox changes.</p>\n<p>Allows double biding with the <code>checked</code> Input.</p>\n",
|
|
60659
|
-
"line":
|
|
60749
|
+
"line": 163,
|
|
60660
60750
|
"type": "EventEmitter",
|
|
60661
60751
|
"inheritance": {
|
|
60662
60752
|
"file": "Checkbox"
|
|
@@ -60669,7 +60759,7 @@
|
|
|
60669
60759
|
"deprecationMessage": "",
|
|
60670
60760
|
"rawdescription": "\n\nEmits click event.\n",
|
|
60671
60761
|
"description": "<p>Emits click event.</p>\n",
|
|
60672
|
-
"line":
|
|
60762
|
+
"line": 156,
|
|
60673
60763
|
"type": "EventEmitter",
|
|
60674
60764
|
"inheritance": {
|
|
60675
60765
|
"file": "Checkbox"
|
|
@@ -60682,7 +60772,7 @@
|
|
|
60682
60772
|
"deprecationMessage": "",
|
|
60683
60773
|
"rawdescription": "\n\nEmits event notifying other classes when a change in state occurs specifically\non an indeterminate checkbox.\n",
|
|
60684
60774
|
"description": "<p>Emits event notifying other classes when a change in state occurs specifically\non an indeterminate checkbox.</p>\n",
|
|
60685
|
-
"line":
|
|
60775
|
+
"line": 169,
|
|
60686
60776
|
"type": "EventEmitter",
|
|
60687
60777
|
"inheritance": {
|
|
60688
60778
|
"file": "Checkbox"
|
|
@@ -60742,7 +60832,7 @@
|
|
|
60742
60832
|
"type": "",
|
|
60743
60833
|
"optional": false,
|
|
60744
60834
|
"description": "<p>Set to <code>true</code> if the input checkbox is selected (or checked).</p>\n",
|
|
60745
|
-
"line":
|
|
60835
|
+
"line": 174,
|
|
60746
60836
|
"rawdescription": "\n\nSet to `true` if the input checkbox is selected (or checked).\n",
|
|
60747
60837
|
"inheritance": {
|
|
60748
60838
|
"file": "Checkbox"
|
|
@@ -60756,7 +60846,7 @@
|
|
|
60756
60846
|
"type": "",
|
|
60757
60847
|
"optional": false,
|
|
60758
60848
|
"description": "<p>Set to <code>true</code> if the input checkbox is in state indeterminate.</p>\n",
|
|
60759
|
-
"line":
|
|
60849
|
+
"line": 178,
|
|
60760
60850
|
"rawdescription": "\n\nSet to `true` if the input checkbox is in state indeterminate.\n",
|
|
60761
60851
|
"inheritance": {
|
|
60762
60852
|
"file": "Checkbox"
|
|
@@ -60787,7 +60877,7 @@
|
|
|
60787
60877
|
"type": "",
|
|
60788
60878
|
"optional": false,
|
|
60789
60879
|
"description": "<p>Keeps a reference to the checkboxes current state, as defined in <code>CheckboxState</code>.</p>\n",
|
|
60790
|
-
"line":
|
|
60880
|
+
"line": 183,
|
|
60791
60881
|
"rawdescription": "\n\nKeeps a reference to the checkboxes current state, as defined in `CheckboxState`.\n",
|
|
60792
60882
|
"inheritance": {
|
|
60793
60883
|
"file": "Checkbox"
|
|
@@ -60800,7 +60890,7 @@
|
|
|
60800
60890
|
"type": "ElementRef",
|
|
60801
60891
|
"optional": false,
|
|
60802
60892
|
"description": "<p>Maintains a reference to the view DOM element of the <code>Checkbox</code>.</p>\n",
|
|
60803
|
-
"line":
|
|
60893
|
+
"line": 188,
|
|
60804
60894
|
"rawdescription": "\n\nMaintains a reference to the view DOM element of the `Checkbox`.\n",
|
|
60805
60895
|
"decorators": [
|
|
60806
60896
|
{
|
|
@@ -60823,7 +60913,7 @@
|
|
|
60823
60913
|
"type": "function",
|
|
60824
60914
|
"optional": false,
|
|
60825
60915
|
"description": "<p>Called when checkbox is blurred. Needed to properly implement <code>ControlValueAccessor</code>.</p>\n",
|
|
60826
|
-
"line":
|
|
60916
|
+
"line": 278,
|
|
60827
60917
|
"rawdescription": "\n\nCalled when checkbox is blurred. Needed to properly implement `ControlValueAccessor`.\n",
|
|
60828
60918
|
"inheritance": {
|
|
60829
60919
|
"file": "Checkbox"
|
|
@@ -60837,7 +60927,7 @@
|
|
|
60837
60927
|
"type": "",
|
|
60838
60928
|
"optional": false,
|
|
60839
60929
|
"description": "<p>Method set in <code>registerOnChange</code> to propagate changes back to the form.</p>\n",
|
|
60840
|
-
"line":
|
|
60930
|
+
"line": 307,
|
|
60841
60931
|
"rawdescription": "\n\nMethod set in `registerOnChange` to propagate changes back to the form.\n",
|
|
60842
60932
|
"inheritance": {
|
|
60843
60933
|
"file": "Checkbox"
|
|
@@ -60975,7 +61065,7 @@
|
|
|
60975
61065
|
"optional": false,
|
|
60976
61066
|
"returnType": "void",
|
|
60977
61067
|
"typeParameters": [],
|
|
60978
|
-
"line":
|
|
61068
|
+
"line": 245,
|
|
60979
61069
|
"deprecated": false,
|
|
60980
61070
|
"deprecationMessage": "",
|
|
60981
61071
|
"decorators": [
|
|
@@ -61004,7 +61094,7 @@
|
|
|
61004
61094
|
"optional": false,
|
|
61005
61095
|
"returnType": "void",
|
|
61006
61096
|
"typeParameters": [],
|
|
61007
|
-
"line":
|
|
61097
|
+
"line": 252,
|
|
61008
61098
|
"deprecated": false,
|
|
61009
61099
|
"deprecationMessage": "",
|
|
61010
61100
|
"rawdescription": "\n\nExecutes on the event of a change within `Checkbox` to block propagation.\n",
|
|
@@ -61037,7 +61127,7 @@
|
|
|
61037
61127
|
"optional": false,
|
|
61038
61128
|
"returnType": "void",
|
|
61039
61129
|
"typeParameters": [],
|
|
61040
|
-
"line":
|
|
61130
|
+
"line": 259,
|
|
61041
61131
|
"deprecated": false,
|
|
61042
61132
|
"deprecationMessage": "",
|
|
61043
61133
|
"rawdescription": "\n\nHandles click events on the `Checkbox` and emits changes to other classes.\n",
|
|
@@ -61070,7 +61160,7 @@
|
|
|
61070
61160
|
"optional": false,
|
|
61071
61161
|
"returnType": "void",
|
|
61072
61162
|
"typeParameters": [],
|
|
61073
|
-
"line":
|
|
61163
|
+
"line": 220,
|
|
61074
61164
|
"deprecated": false,
|
|
61075
61165
|
"deprecationMessage": "",
|
|
61076
61166
|
"rawdescription": "\n\nSets a method in order to propagate changes back to the form.\n",
|
|
@@ -61106,7 +61196,7 @@
|
|
|
61106
61196
|
"optional": false,
|
|
61107
61197
|
"returnType": "void",
|
|
61108
61198
|
"typeParameters": [],
|
|
61109
|
-
"line":
|
|
61199
|
+
"line": 228,
|
|
61110
61200
|
"deprecated": false,
|
|
61111
61201
|
"deprecationMessage": "",
|
|
61112
61202
|
"rawdescription": "\n\nRegisters a callback to be triggered when the control has been touched.\n",
|
|
@@ -61117,8 +61207,8 @@
|
|
|
61117
61207
|
"jsdoctags": [
|
|
61118
61208
|
{
|
|
61119
61209
|
"name": {
|
|
61120
|
-
"pos":
|
|
61121
|
-
"end":
|
|
61210
|
+
"pos": 5324,
|
|
61211
|
+
"end": 5326,
|
|
61122
61212
|
"flags": 8421376,
|
|
61123
61213
|
"modifierFlagsCache": 0,
|
|
61124
61214
|
"transformFlags": 0,
|
|
@@ -61129,8 +61219,8 @@
|
|
|
61129
61219
|
"deprecated": false,
|
|
61130
61220
|
"deprecationMessage": "",
|
|
61131
61221
|
"tagName": {
|
|
61132
|
-
"pos":
|
|
61133
|
-
"end":
|
|
61222
|
+
"pos": 5318,
|
|
61223
|
+
"end": 5323,
|
|
61134
61224
|
"flags": 8421376,
|
|
61135
61225
|
"modifierFlagsCache": 0,
|
|
61136
61226
|
"transformFlags": 0,
|
|
@@ -61150,7 +61240,7 @@
|
|
|
61150
61240
|
"optional": false,
|
|
61151
61241
|
"returnType": "void",
|
|
61152
61242
|
"typeParameters": [],
|
|
61153
|
-
"line":
|
|
61243
|
+
"line": 200,
|
|
61154
61244
|
"deprecated": false,
|
|
61155
61245
|
"deprecationMessage": "",
|
|
61156
61246
|
"rawdescription": "\n\nToggle the selected state of the checkbox.\n",
|
|
@@ -61175,7 +61265,7 @@
|
|
|
61175
61265
|
"optional": false,
|
|
61176
61266
|
"returnType": "void",
|
|
61177
61267
|
"typeParameters": [],
|
|
61178
|
-
"line":
|
|
61268
|
+
"line": 283,
|
|
61179
61269
|
"deprecated": false,
|
|
61180
61270
|
"deprecationMessage": "",
|
|
61181
61271
|
"rawdescription": "\n\nHandles changes between checkbox states.\n",
|
|
@@ -61208,7 +61298,7 @@
|
|
|
61208
61298
|
"optional": false,
|
|
61209
61299
|
"returnType": "void",
|
|
61210
61300
|
"typeParameters": [],
|
|
61211
|
-
"line":
|
|
61301
|
+
"line": 212,
|
|
61212
61302
|
"deprecated": false,
|
|
61213
61303
|
"deprecationMessage": "",
|
|
61214
61304
|
"rawdescription": "\n\nWrites a value from `ngModel` to the component.\n\nIn this case the value is the `checked` property.\n\n",
|
|
@@ -61219,8 +61309,8 @@
|
|
|
61219
61309
|
"jsdoctags": [
|
|
61220
61310
|
{
|
|
61221
61311
|
"name": {
|
|
61222
|
-
"pos":
|
|
61223
|
-
"end":
|
|
61312
|
+
"pos": 4916,
|
|
61313
|
+
"end": 4921,
|
|
61224
61314
|
"flags": 8421376,
|
|
61225
61315
|
"modifierFlagsCache": 0,
|
|
61226
61316
|
"transformFlags": 0,
|
|
@@ -61231,8 +61321,8 @@
|
|
|
61231
61321
|
"deprecated": false,
|
|
61232
61322
|
"deprecationMessage": "",
|
|
61233
61323
|
"tagName": {
|
|
61234
|
-
"pos":
|
|
61235
|
-
"end":
|
|
61324
|
+
"pos": 4910,
|
|
61325
|
+
"end": 4915,
|
|
61236
61326
|
"flags": 8421376,
|
|
61237
61327
|
"modifierFlagsCache": 0,
|
|
61238
61328
|
"transformFlags": 0,
|
|
@@ -61283,7 +61373,7 @@
|
|
|
61283
61373
|
"argsDecorator": [],
|
|
61284
61374
|
"deprecated": false,
|
|
61285
61375
|
"deprecationMessage": "",
|
|
61286
|
-
"line":
|
|
61376
|
+
"line": 245,
|
|
61287
61377
|
"inheritance": {
|
|
61288
61378
|
"file": "Checkbox"
|
|
61289
61379
|
}
|
|
@@ -71652,6 +71742,17 @@
|
|
|
71652
71742
|
"description": "",
|
|
71653
71743
|
"kind": 189
|
|
71654
71744
|
},
|
|
71745
|
+
{
|
|
71746
|
+
"name": "SortType",
|
|
71747
|
+
"ctype": "miscellaneous",
|
|
71748
|
+
"subtype": "typealias",
|
|
71749
|
+
"rawtype": "\"ASCENDING\" | \"DESCENDING\" | \"NONE\"",
|
|
71750
|
+
"file": "src/table/table-header-item.class.ts",
|
|
71751
|
+
"deprecated": false,
|
|
71752
|
+
"deprecationMessage": "",
|
|
71753
|
+
"description": "",
|
|
71754
|
+
"kind": 189
|
|
71755
|
+
},
|
|
71655
71756
|
{
|
|
71656
71757
|
"name": "TableRowSize",
|
|
71657
71758
|
"ctype": "miscellaneous",
|
|
@@ -77338,6 +77439,19 @@
|
|
|
77338
77439
|
"kind": 189
|
|
77339
77440
|
}
|
|
77340
77441
|
],
|
|
77442
|
+
"src/table/table-header-item.class.ts": [
|
|
77443
|
+
{
|
|
77444
|
+
"name": "SortType",
|
|
77445
|
+
"ctype": "miscellaneous",
|
|
77446
|
+
"subtype": "typealias",
|
|
77447
|
+
"rawtype": "\"ASCENDING\" | \"DESCENDING\" | \"NONE\"",
|
|
77448
|
+
"file": "src/table/table-header-item.class.ts",
|
|
77449
|
+
"deprecated": false,
|
|
77450
|
+
"deprecationMessage": "",
|
|
77451
|
+
"description": "",
|
|
77452
|
+
"kind": 189
|
|
77453
|
+
}
|
|
77454
|
+
],
|
|
77341
77455
|
"src/table/table.types.ts": [
|
|
77342
77456
|
{
|
|
77343
77457
|
"name": "TableRowSize",
|
|
@@ -81688,8 +81802,8 @@
|
|
|
81688
81802
|
"type": "class",
|
|
81689
81803
|
"linktype": "classe",
|
|
81690
81804
|
"name": "CustomHeaderItem",
|
|
81691
|
-
"coveragePercent":
|
|
81692
|
-
"coverageCount": "17/
|
|
81805
|
+
"coveragePercent": 85,
|
|
81806
|
+
"coverageCount": "17/20",
|
|
81693
81807
|
"status": "very-good"
|
|
81694
81808
|
},
|
|
81695
81809
|
{
|
|
@@ -81706,8 +81820,8 @@
|
|
|
81706
81820
|
"type": "class",
|
|
81707
81821
|
"linktype": "classe",
|
|
81708
81822
|
"name": "CustomHeaderItem",
|
|
81709
|
-
"coveragePercent":
|
|
81710
|
-
"coverageCount": "17/
|
|
81823
|
+
"coveragePercent": 85,
|
|
81824
|
+
"coverageCount": "17/20",
|
|
81711
81825
|
"status": "very-good"
|
|
81712
81826
|
},
|
|
81713
81827
|
{
|
|
@@ -81823,8 +81937,8 @@
|
|
|
81823
81937
|
"type": "class",
|
|
81824
81938
|
"linktype": "classe",
|
|
81825
81939
|
"name": "TableHeaderItem",
|
|
81826
|
-
"coveragePercent":
|
|
81827
|
-
"coverageCount": "19/
|
|
81940
|
+
"coveragePercent": 90,
|
|
81941
|
+
"coverageCount": "19/21",
|
|
81828
81942
|
"status": "very-good"
|
|
81829
81943
|
},
|
|
81830
81944
|
{
|
|
@@ -81841,9 +81955,9 @@
|
|
|
81841
81955
|
"type": "class",
|
|
81842
81956
|
"linktype": "classe",
|
|
81843
81957
|
"name": "TableModel",
|
|
81844
|
-
"coveragePercent":
|
|
81845
|
-
"coverageCount": "
|
|
81846
|
-
"status": "good"
|
|
81958
|
+
"coveragePercent": 76,
|
|
81959
|
+
"coverageCount": "32/42",
|
|
81960
|
+
"status": "very-good"
|
|
81847
81961
|
},
|
|
81848
81962
|
{
|
|
81849
81963
|
"filePath": "src/table/table-row.class.ts",
|