@ifsworld/granite-components 3.0.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/bundles/ifsworld-granite-components.umd.js +444 -4
  2. package/bundles/ifsworld-granite-components.umd.js.map +1 -1
  3. package/bundles/ifsworld-granite-components.umd.min.js +3 -3
  4. package/bundles/ifsworld-granite-components.umd.min.js.map +1 -1
  5. package/esm2015/ifsworld-granite-components.js +5 -0
  6. package/esm2015/ifsworld-granite-components.js.map +1 -1
  7. package/esm2015/ifsworld-granite-components.metadata.json +1 -1
  8. package/esm2015/index.js +7 -0
  9. package/esm2015/index.js.map +1 -1
  10. package/esm2015/index.metadata.json +1 -1
  11. package/esm2015/lib/core/pipes/pure-pipes.module.js +11 -0
  12. package/esm2015/lib/core/pipes/pure-pipes.module.js.map +1 -0
  13. package/esm2015/lib/core/pipes/pure-pipes.module.metadata.json +1 -0
  14. package/esm2015/lib/core/pipes/title.pipe.js +17 -0
  15. package/esm2015/lib/core/pipes/title.pipe.js.map +1 -0
  16. package/esm2015/lib/core/pipes/title.pipe.metadata.json +1 -0
  17. package/esm2015/lib/core/types.js +2 -0
  18. package/esm2015/lib/core/types.js.map +1 -0
  19. package/esm2015/lib/core/types.metadata.json +1 -0
  20. package/esm2015/lib/input-field/input-field.component.js +144 -0
  21. package/esm2015/lib/input-field/input-field.component.js.map +1 -0
  22. package/esm2015/lib/input-field/input-field.component.metadata.json +1 -0
  23. package/esm2015/lib/input-field/input-field.module.js +15 -0
  24. package/esm2015/lib/input-field/input-field.module.js.map +1 -0
  25. package/esm2015/lib/input-field/input-field.module.metadata.json +1 -0
  26. package/esm2015/lib/radio-button/radio-button.component.js +109 -0
  27. package/esm2015/lib/radio-button/radio-button.component.js.map +1 -0
  28. package/esm2015/lib/radio-button/radio-button.component.metadata.json +1 -0
  29. package/esm2015/lib/radio-button/radio-button.module.js +11 -0
  30. package/esm2015/lib/radio-button/radio-button.module.js.map +1 -0
  31. package/esm2015/lib/radio-button/radio-button.module.metadata.json +1 -0
  32. package/esm2015/lib/table/cell/cell.js +12 -0
  33. package/esm2015/lib/table/cell/cell.js.map +1 -0
  34. package/esm2015/lib/table/cell/cell.metadata.json +1 -0
  35. package/esm2015/lib/table/cell/table-data-cell.component.js +20 -0
  36. package/esm2015/lib/table/cell/table-data-cell.component.js.map +1 -0
  37. package/esm2015/lib/table/cell/table-data-cell.component.metadata.json +1 -0
  38. package/esm2015/lib/table/cell/table-header-cell.component.js +13 -0
  39. package/esm2015/lib/table/cell/table-header-cell.component.js.map +1 -0
  40. package/esm2015/lib/table/cell/table-header-cell.component.metadata.json +1 -0
  41. package/esm2015/lib/table/column/table-column.directive.js +16 -0
  42. package/esm2015/lib/table/column/table-column.directive.js.map +1 -0
  43. package/esm2015/lib/table/column/table-column.directive.metadata.json +1 -0
  44. package/esm2015/lib/table/table-constants.library.js +4 -0
  45. package/esm2015/lib/table/table-constants.library.js.map +1 -0
  46. package/esm2015/lib/table/table-constants.library.metadata.json +1 -0
  47. package/esm2015/lib/table/table.component.js +28 -0
  48. package/esm2015/lib/table/table.component.js.map +1 -0
  49. package/esm2015/lib/table/table.component.metadata.json +1 -0
  50. package/esm2015/lib/table/table.module.js +24 -0
  51. package/esm2015/lib/table/table.module.js.map +1 -0
  52. package/esm2015/lib/table/table.module.metadata.json +1 -0
  53. package/esm2015/lib/toggle-switch/toggle-switch.component.js.map +1 -1
  54. package/esm2015/lib/toggle-switch/toggle-switch.component.metadata.json +1 -1
  55. package/fesm2015/ifsworld-granite-components.js +392 -2
  56. package/fesm2015/ifsworld-granite-components.js.map +1 -1
  57. package/ifsworld-granite-components.d.ts +5 -0
  58. package/ifsworld-granite-components.metadata.json +1 -1
  59. package/index.d.ts +7 -0
  60. package/lib/core/pipes/pure-pipes.module.d.ts +2 -0
  61. package/lib/core/pipes/title.pipe.d.ts +4 -0
  62. package/lib/core/types.d.ts +1 -0
  63. package/lib/input-field/input-field.component.d.ts +39 -0
  64. package/lib/input-field/input-field.module.d.ts +2 -0
  65. package/lib/radio-button/radio-button.component.d.ts +32 -0
  66. package/lib/radio-button/radio-button.module.d.ts +2 -0
  67. package/lib/table/cell/cell.d.ts +5 -0
  68. package/lib/table/cell/table-data-cell.component.d.ts +10 -0
  69. package/lib/table/cell/table-header-cell.component.d.ts +3 -0
  70. package/lib/table/column/table-column.directive.d.ts +13 -0
  71. package/lib/table/table-constants.library.d.ts +3 -0
  72. package/lib/table/table.component.d.ts +16 -0
  73. package/lib/table/table.module.d.ts +2 -0
  74. package/lib/toggle-switch/toggle-switch.component.d.ts +1 -1
  75. package/package.json +1 -1
  76. package/src/lib/core/style/_responsive.scss +1 -0
@@ -0,0 +1 @@
1
+ [{"__symbolic":"module","version":4,"metadata":{"GraniteCell":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":3,"character":1}}],"members":{"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":5,"character":3}}]}],"column":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":8,"character":3}}]}]}}}}]
@@ -0,0 +1,20 @@
1
+ import { Component, Input, TemplateRef } from '@angular/core';
2
+ import { GraniteCell } from './cell';
3
+ export class GraniteTableDataCellComponent extends GraniteCell {
4
+ }
5
+ GraniteTableDataCellComponent.decorators = [
6
+ { type: Component, args: [{
7
+ // eslint-disable-next-line @angular-eslint/component-selector
8
+ selector: 'cdk-cell[graniteTableDataCell]',
9
+ template: "<span class=\"granite-table-data-cell-static-container\">\n <ng-template\n [ngTemplateOutlet]=\"tableCellTemplateRef || defaultTableCellTemplate\"\n [ngTemplateOutletContext]=\"{\n data: value,\n rowIndex: rowIndex,\n columnIndex: columnIndex,\n column: column\n }\"\n ></ng-template>\n</span>\n\n<ng-template #defaultTableCellTemplate>\n <ng-container [ngSwitch]=\"staticType\">\n <ng-container *ngSwitchCase=\"'badge'\">\n <granite-badge>{{ value }}</granite-badge>\n </ng-container>\n <ng-container *ngSwitchDefault>{{ value }}</ng-container>\n </ng-container>\n</ng-template>\n",
10
+ styles: [".granite-table-data-cell-static-container{padding:var(--granite-spacing-s);height:var(--granite-spacing-l);font-size:var(--granite-font-size-body-small);line-height:var(--granite-line-height-regular);display:flex;justify-content:center;align-items:center;color:var(--granite-color-text)}"]
11
+ },] }
12
+ ];
13
+ GraniteTableDataCellComponent.propDecorators = {
14
+ value: [{ type: Input }],
15
+ staticType: [{ type: Input }],
16
+ rowIndex: [{ type: Input }],
17
+ columnIndex: [{ type: Input }],
18
+ tableCellTemplateRef: [{ type: Input }]
19
+ };
20
+ //# sourceMappingURL=table-data-cell.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-data-cell.component.js","sourceRoot":"","sources":["../../../../../../../libs/granite-components/src/lib/table/cell/table-data-cell.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAUrC,MAAM,OAAO,6BAA8B,SAAQ,WAAW;;;YAN7D,SAAS,SAAC;gBACT,8DAA8D;gBAC9D,QAAQ,EAAE,gCAAgC;gBAC1C,goBAA+C;;aAEhD;;;oBAEE,KAAK;yBAGL,KAAK;uBAGL,KAAK;0BAGL,KAAK;mCAIL,KAAK","sourcesContent":["import { Component, Input, TemplateRef } from '@angular/core';\nimport { GraniteCell } from './cell';\n\nexport type StaticType = 'text' | 'badge';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'cdk-cell[graniteTableDataCell]',\n templateUrl: './table-data-cell.component.html',\n styleUrls: ['./table-data-cell.component.scss'],\n})\nexport class GraniteTableDataCellComponent extends GraniteCell {\n @Input()\n value: any;\n\n @Input()\n staticType: StaticType;\n\n @Input()\n rowIndex: number;\n\n @Input()\n columnIndex: number;\n\n // Custom template provided by the consumer\n @Input()\n tableCellTemplateRef: TemplateRef<any>;\n}\n"]}
@@ -0,0 +1 @@
1
+ [{"__symbolic":"module","version":4,"metadata":{"StaticType":{"__symbolic":"interface"},"GraniteTableDataCellComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./cell","name":"GraniteCell","line":11,"character":51},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":5,"character":1},"arguments":[{"selector":"cdk-cell[graniteTableDataCell]","template":"<span class=\"granite-table-data-cell-static-container\">\n <ng-template\n [ngTemplateOutlet]=\"tableCellTemplateRef || defaultTableCellTemplate\"\n [ngTemplateOutletContext]=\"{\n data: value,\n rowIndex: rowIndex,\n columnIndex: columnIndex,\n column: column\n }\"\n ></ng-template>\n</span>\n\n<ng-template #defaultTableCellTemplate>\n <ng-container [ngSwitch]=\"staticType\">\n <ng-container *ngSwitchCase=\"'badge'\">\n <granite-badge>{{ value }}</granite-badge>\n </ng-container>\n <ng-container *ngSwitchDefault>{{ value }}</ng-container>\n </ng-container>\n</ng-template>\n","styles":[".granite-table-data-cell-static-container{padding:var(--granite-spacing-s);height:var(--granite-spacing-l);font-size:var(--granite-font-size-body-small);line-height:var(--granite-line-height-regular);display:flex;justify-content:center;align-items:center;color:var(--granite-color-text)}"]}]}],"members":{"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":3}}]}],"staticType":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":3}}]}],"rowIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":18,"character":3}}]}],"columnIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":21,"character":3}}]}],"tableCellTemplateRef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":25,"character":3}}]}]}}}}]
@@ -0,0 +1,13 @@
1
+ import { Component } from '@angular/core';
2
+ import { GraniteCell } from './cell';
3
+ export class GraniteTableHeaderCellComponent extends GraniteCell {
4
+ }
5
+ GraniteTableHeaderCellComponent.decorators = [
6
+ { type: Component, args: [{
7
+ // eslint-disable-next-line @angular-eslint/component-selector
8
+ selector: 'cdk-header-cell[graniteTableHeaderCell]',
9
+ template: "<span class=\"granite-table-header-cell-title\">\n <ng-content></ng-content>\n</span>\n",
10
+ styles: [".granite-table-header-cell-title{padding:var(--granite-spacing-s);height:var(--granite-spacing-l);font-size:var(--granite-font-size-micro);line-height:var(--granite-line-height-flowing);letter-spacing:.015em;font-weight:400;display:flex;justify-content:center;align-items:center;color:var(--granite-color-text-weak)}"]
11
+ },] }
12
+ ];
13
+ //# sourceMappingURL=table-header-cell.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-header-cell.component.js","sourceRoot":"","sources":["../../../../../../../libs/granite-components/src/lib/table/cell/table-header-cell.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAQrC,MAAM,OAAO,+BAAgC,SAAQ,WAAW;;;YAN/D,SAAS,SAAC;gBACT,8DAA8D;gBAC9D,QAAQ,EAAE,yCAAyC;gBACnD,oGAAiD;;aAElD","sourcesContent":["import { Component } from '@angular/core';\nimport { GraniteCell } from './cell';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'cdk-header-cell[graniteTableHeaderCell]',\n templateUrl: './table-header-cell.component.html',\n styleUrls: ['./table-header-cell.component.scss'],\n})\nexport class GraniteTableHeaderCellComponent extends GraniteCell {}\n"]}
@@ -0,0 +1 @@
1
+ [{"__symbolic":"module","version":4,"metadata":{"GraniteTableHeaderCellComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./cell","name":"GraniteCell","line":9,"character":53},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"cdk-header-cell[graniteTableHeaderCell]","template":"<span class=\"granite-table-header-cell-title\">\n <ng-content></ng-content>\n</span>\n","styles":[".granite-table-header-cell-title{padding:var(--granite-spacing-s);height:var(--granite-spacing-l);font-size:var(--granite-font-size-micro);line-height:var(--granite-line-height-flowing);letter-spacing:.015em;font-weight:400;display:flex;justify-content:center;align-items:center;color:var(--granite-color-text-weak)}"]}]}]}}}]
@@ -0,0 +1,16 @@
1
+ import { ContentChild, Directive, Input, TemplateRef } from '@angular/core';
2
+ export class GraniteTableColumnDirective {
3
+ }
4
+ GraniteTableColumnDirective.decorators = [
5
+ { type: Directive, args: [{
6
+ // eslint-disable-next-line @angular-eslint/directive-selector
7
+ selector: 'granite-table-column',
8
+ },] }
9
+ ];
10
+ GraniteTableColumnDirective.propDecorators = {
11
+ name: [{ type: Input }],
12
+ title: [{ type: Input }],
13
+ staticType: [{ type: Input }],
14
+ tableCellTemplateRef: [{ type: ContentChild, args: ['graniteTableCellTemplate', { static: false },] }]
15
+ };
16
+ //# sourceMappingURL=table-column.directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-column.directive.js","sourceRoot":"","sources":["../../../../../../../libs/granite-components/src/lib/table/column/table-column.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAa5E,MAAM,OAAO,2BAA2B;;;YAJvC,SAAS,SAAC;gBACT,8DAA8D;gBAC9D,QAAQ,EAAE,sBAAsB;aACjC;;;mBAGE,KAAK;oBAGL,KAAK;yBAGL,KAAK;mCAGL,YAAY,SAAC,0BAA0B,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE","sourcesContent":["import { ContentChild, Directive, Input, TemplateRef } from '@angular/core';\nimport { StaticType } from '../cell/table-data-cell.component';\n\nexport interface GraniteTableColumnInterface {\n name: string;\n title?: string;\n staticType?: StaticType;\n}\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: 'granite-table-column',\n})\nexport class GraniteTableColumnDirective\n implements GraniteTableColumnInterface {\n @Input()\n name: string;\n\n @Input()\n title: string;\n\n @Input()\n staticType: StaticType;\n\n @ContentChild('graniteTableCellTemplate', { static: false })\n tableCellTemplateRef: TemplateRef<any>;\n}\n"]}
@@ -0,0 +1 @@
1
+ [{"__symbolic":"module","version":4,"metadata":{"GraniteTableColumnInterface":{"__symbolic":"interface"},"GraniteTableColumnDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":9,"character":1},"arguments":[{"selector":"granite-table-column"}]}],"members":{"name":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":3}}]}],"title":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":18,"character":3}}]}],"staticType":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":21,"character":3}}]}],"tableCellTemplateRef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":24,"character":3},"arguments":["graniteTableCellTemplate",{"static":false}]}]}]}}}}]
@@ -0,0 +1,4 @@
1
+ export class TableConstants {
2
+ }
3
+ TableConstants.CELL_ID_PREFIX = 'granite-cell';
4
+ //# sourceMappingURL=table-constants.library.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-constants.library.js","sourceRoot":"","sources":["../../../../../../libs/granite-components/src/lib/table/table-constants.library.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,cAAc;;AACT,6BAAc,GAAW,cAAc,CAAC","sourcesContent":["export class TableConstants {\n static readonly CELL_ID_PREFIX: string = 'granite-cell';\n}\n"]}
@@ -0,0 +1 @@
1
+ [{"__symbolic":"module","version":4,"metadata":{"TableConstants":{"__symbolic":"class","statics":{"CELL_ID_PREFIX":"granite-cell"}}}}]
@@ -0,0 +1,28 @@
1
+ import { Component, Input, ContentChildren, QueryList, ChangeDetectionStrategy, } from '@angular/core';
2
+ import { GraniteTableColumnDirective } from './column/table-column.directive';
3
+ import { TableConstants } from './table-constants.library';
4
+ export class GraniteTableComponent {
5
+ constructor() {
6
+ this.ariaLabel = null;
7
+ this.cellIdPrefix = TableConstants.CELL_ID_PREFIX;
8
+ }
9
+ ngAfterContentInit() {
10
+ this.columns = this.tableColumnsComponent.toArray();
11
+ this.renderedColumns = this.columns.map((column) => column.name);
12
+ }
13
+ }
14
+ GraniteTableComponent.decorators = [
15
+ { type: Component, args: [{
16
+ selector: 'granite-table',
17
+ template: "<cdk-table\n [dataSource]=\"dataSource\"\n multiTemplateDataRows\n [trackBy]=\"trackBy\"\n [attr.aria-label]=\"ariaLabel\"\n>\n <ng-container\n *ngFor=\"let column of columns; index as columnI\"\n [cdkColumnDef]=\"column.name\"\n >\n <!-- Cell Header -->\n <cdk-header-cell *cdkHeaderCellDef graniteTableHeaderCell>\n {{ (column.title ? column.title : column.name) | graniteTitle }}\n </cdk-header-cell>\n\n <!-- Cell Data -->\n <cdk-cell\n graniteTableDataCell\n *cdkCellDef=\"let element; let rowI = dataIndex\"\n [id]=\"cellIdPrefix + '-' + rowI + '-' + columnI\"\n [value]=\"element[column.name]\"\n [rowIndex]=\"rowI\"\n [columnIndex]=\"columnI\"\n [staticType]=\"column.staticType\"\n [column]=\"column\"\n [tableCellTemplateRef]=\"column.tableCellTemplateRef\"\n ></cdk-cell>\n </ng-container>\n\n <cdk-header-row *cdkHeaderRowDef=\"renderedColumns\"></cdk-header-row>\n <cdk-row\n *cdkRowDef=\"let row; let rowI = dataIndex; columns: renderedColumns\"\n [attr.aria-rowindex]=\"rowI + 1\"\n ></cdk-row>\n</cdk-table>\n",
18
+ changeDetection: ChangeDetectionStrategy.OnPush,
19
+ styles: [":host{box-sizing:border-box}:host *,:host :after,:host :before{box-sizing:inherit}cdk-table{flex-direction:column;background-color:var(--granite-color-background-variant)}cdk-header-row,cdk-row,cdk-table{display:flex}cdk-cell,cdk-header-cell{flex:1}cdk-cell{height:calc(var(--granite-spacing-m) * 2.5);border-top:1px solid var(--granite-color-border-soft)}"]
20
+ },] }
21
+ ];
22
+ GraniteTableComponent.propDecorators = {
23
+ dataSource: [{ type: Input }],
24
+ trackBy: [{ type: Input }],
25
+ ariaLabel: [{ type: Input, args: ['aria-label',] }],
26
+ tableColumnsComponent: [{ type: ContentChildren, args: [GraniteTableColumnDirective,] }]
27
+ };
28
+ //# sourceMappingURL=table.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.component.js","sourceRoot":"","sources":["../../../../../../libs/granite-components/src/lib/table/table.component.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,KAAK,EAEL,eAAe,EACf,SAAS,EAET,uBAAuB,GACxB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAa3D,MAAM,OAAO,qBAAqB;IANlC;QAcE,cAAS,GAAkB,IAAI,CAAC;QAKvB,iBAAY,GAAG,cAAc,CAAC,cAAc,CAAC;IASxD,CAAC;IAJC,kBAAkB;QAChB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,CAAC;QACpD,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnE,CAAC;;;YA3BF,SAAS,SAAC;gBACT,QAAQ,EAAE,eAAe;gBACzB,umCAAqC;gBAErC,eAAe,EAAE,uBAAuB,CAAC,MAAM;;aAChD;;;yBAEE,KAAK;sBAGL,KAAK;wBAGL,KAAK,SAAC,YAAY;oCAGlB,eAAe,SAAC,2BAA2B","sourcesContent":["import { DataSource } from '@angular/cdk/table';\nimport {\n Component,\n Input,\n TrackByFunction,\n ContentChildren,\n QueryList,\n AfterContentInit,\n ChangeDetectionStrategy,\n} from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { GraniteTableColumnDirective } from './column/table-column.directive';\nimport { TableConstants } from './table-constants.library';\n\ntype CdkTableDataSourceInput<T> =\n | readonly T[]\n | DataSource<T>\n | Observable<readonly T[]>;\n\n@Component({\n selector: 'granite-table',\n templateUrl: './table.component.html',\n styleUrls: ['./table.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GraniteTableComponent<T> implements AfterContentInit {\n @Input()\n dataSource: CdkTableDataSourceInput<T>;\n\n @Input()\n trackBy: TrackByFunction<T>;\n\n @Input('aria-label')\n ariaLabel: string | null = null;\n\n @ContentChildren(GraniteTableColumnDirective)\n tableColumnsComponent: QueryList<GraniteTableColumnDirective>;\n\n readonly cellIdPrefix = TableConstants.CELL_ID_PREFIX;\n\n columns: GraniteTableColumnDirective[];\n renderedColumns: string[];\n\n ngAfterContentInit(): void {\n this.columns = this.tableColumnsComponent.toArray();\n this.renderedColumns = this.columns.map((column) => column.name);\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ [{"__symbolic":"module","version":4,"metadata":{"GraniteTableComponent":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":19,"character":1},"arguments":[{"selector":"granite-table","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":23,"character":19},"member":"OnPush"},"template":"<cdk-table\n [dataSource]=\"dataSource\"\n multiTemplateDataRows\n [trackBy]=\"trackBy\"\n [attr.aria-label]=\"ariaLabel\"\n>\n <ng-container\n *ngFor=\"let column of columns; index as columnI\"\n [cdkColumnDef]=\"column.name\"\n >\n <!-- Cell Header -->\n <cdk-header-cell *cdkHeaderCellDef graniteTableHeaderCell>\n {{ (column.title ? column.title : column.name) | graniteTitle }}\n </cdk-header-cell>\n\n <!-- Cell Data -->\n <cdk-cell\n graniteTableDataCell\n *cdkCellDef=\"let element; let rowI = dataIndex\"\n [id]=\"cellIdPrefix + '-' + rowI + '-' + columnI\"\n [value]=\"element[column.name]\"\n [rowIndex]=\"rowI\"\n [columnIndex]=\"columnI\"\n [staticType]=\"column.staticType\"\n [column]=\"column\"\n [tableCellTemplateRef]=\"column.tableCellTemplateRef\"\n ></cdk-cell>\n </ng-container>\n\n <cdk-header-row *cdkHeaderRowDef=\"renderedColumns\"></cdk-header-row>\n <cdk-row\n *cdkRowDef=\"let row; let rowI = dataIndex; columns: renderedColumns\"\n [attr.aria-rowindex]=\"rowI + 1\"\n ></cdk-row>\n</cdk-table>\n","styles":[":host{box-sizing:border-box}:host *,:host :after,:host :before{box-sizing:inherit}cdk-table{flex-direction:column;background-color:var(--granite-color-background-variant)}cdk-header-row,cdk-row,cdk-table{display:flex}cdk-cell,cdk-header-cell{flex:1}cdk-cell{height:calc(var(--granite-spacing-m) * 2.5);border-top:1px solid var(--granite-color-border-soft)}"]}]}],"members":{"dataSource":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":26,"character":3}}]}],"trackBy":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":29,"character":3}}]}],"ariaLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":32,"character":3},"arguments":["aria-label"]}]}],"tableColumnsComponent":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":35,"character":3},"arguments":[{"__symbolic":"reference","module":"./column/table-column.directive","name":"GraniteTableColumnDirective","line":35,"character":19}]}]}],"ngAfterContentInit":[{"__symbolic":"method"}]}}}}]
@@ -0,0 +1,24 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { CdkTableModule } from '@angular/cdk/table';
4
+ import { GraniteTableComponent } from './table.component';
5
+ import { GraniteTableDataCellComponent } from './cell/table-data-cell.component';
6
+ import { GraniteTableHeaderCellComponent } from './cell/table-header-cell.component';
7
+ import { GraniteBadgeModule } from '../badge/badge.module';
8
+ import { GraniteTableColumnDirective } from './column/table-column.directive';
9
+ import { PurePipesModule } from '../core/pipes/pure-pipes.module';
10
+ export class GraniteTableModule {
11
+ }
12
+ GraniteTableModule.decorators = [
13
+ { type: NgModule, args: [{
14
+ declarations: [
15
+ GraniteTableComponent,
16
+ GraniteTableDataCellComponent,
17
+ GraniteTableHeaderCellComponent,
18
+ GraniteTableColumnDirective,
19
+ ],
20
+ imports: [CommonModule, CdkTableModule, GraniteBadgeModule, PurePipesModule],
21
+ exports: [GraniteTableComponent, GraniteTableColumnDirective],
22
+ },] }
23
+ ];
24
+ //# sourceMappingURL=table.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.module.js","sourceRoot":"","sources":["../../../../../../libs/granite-components/src/lib/table/table.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAYlE,MAAM,OAAO,kBAAkB;;;YAV9B,QAAQ,SAAC;gBACR,YAAY,EAAE;oBACZ,qBAAqB;oBACrB,6BAA6B;oBAC7B,+BAA+B;oBAC/B,2BAA2B;iBAC5B;gBACD,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,CAAC;gBAC5E,OAAO,EAAE,CAAC,qBAAqB,EAAE,2BAA2B,CAAC;aAC9D","sourcesContent":["import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { CdkTableModule } from '@angular/cdk/table';\nimport { GraniteTableComponent } from './table.component';\nimport { GraniteTableDataCellComponent } from './cell/table-data-cell.component';\nimport { GraniteTableHeaderCellComponent } from './cell/table-header-cell.component';\nimport { GraniteBadgeModule } from '../badge/badge.module';\nimport { GraniteTableColumnDirective } from './column/table-column.directive';\nimport { PurePipesModule } from '../core/pipes/pure-pipes.module';\n\n@NgModule({\n declarations: [\n GraniteTableComponent,\n GraniteTableDataCellComponent,\n GraniteTableHeaderCellComponent,\n GraniteTableColumnDirective,\n ],\n imports: [CommonModule, CdkTableModule, GraniteBadgeModule, PurePipesModule],\n exports: [GraniteTableComponent, GraniteTableColumnDirective],\n})\nexport class GraniteTableModule {}\n"]}
@@ -0,0 +1 @@
1
+ [{"__symbolic":"module","version":4,"metadata":{"GraniteTableModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":10,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./table.component","name":"GraniteTableComponent","line":12,"character":4},{"__symbolic":"reference","module":"./cell/table-data-cell.component","name":"GraniteTableDataCellComponent","line":13,"character":4},{"__symbolic":"reference","module":"./cell/table-header-cell.component","name":"GraniteTableHeaderCellComponent","line":14,"character":4},{"__symbolic":"reference","module":"./column/table-column.directive","name":"GraniteTableColumnDirective","line":15,"character":4}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":17,"character":12},{"__symbolic":"reference","module":"@angular/cdk/table","name":"CdkTableModule","line":17,"character":26},{"__symbolic":"reference","module":"../badge/badge.module","name":"GraniteBadgeModule","line":17,"character":42},{"__symbolic":"reference","module":"../core/pipes/pure-pipes.module","name":"PurePipesModule","line":17,"character":62}],"exports":[{"__symbolic":"reference","module":"./table.component","name":"GraniteTableComponent","line":18,"character":12},{"__symbolic":"reference","module":"./column/table-column.directive","name":"GraniteTableColumnDirective","line":18,"character":35}]}]}]}}}]
@@ -1 +1 @@
1
- {"version":3,"file":"toggle-switch.component.js","sourceRoot":"","sources":["../../../../../../libs/granite-components/src/lib/toggle-switch/toggle-switch.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,KAAK,EACL,MAAM,EAGN,YAAY,EACZ,UAAU,EACV,SAAS,GACV,MAAM,eAAe,CAAC;AAkBvB,MAAM,OAAO,4BAA4B;IAqCvC,YAAoB,aAA2B;QAA3B,kBAAa,GAAb,aAAa,CAAc;QAnC/C,OAAE,GAAkB,IAAI,CAAC;QAGzB,YAAO,GAAY,KAAK,CAAC;QAGzB,aAAQ,GAAY,KAAK,CAAC;QAG1B,aAAQ,GAAY,KAAK,CAAC;QAG1B,kBAAa,GAAa,OAAO,CAAC;QAGlC,cAAS,GAAkB,IAAI,CAAC;QAGhC,mBAAc,GAAkB,IAAI,CAAC;QAGrC,gBAAW,GAA0B,IAAI,YAAY,EAAW,CAAC;QAGjE,iBAAY,GAAuB,IAAI,YAAY,EAAQ,CAAC;QAG5D,eAAU,GAAuB,IAAI,YAAY,EAAQ,CAAC;QAK1D,oBAAe,GAAY,KAAK,CAAC;Q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;IACtC,CAAC;IAED,kBAAkB;QAChB,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;IAEO,gBAAgB;QACtB,OAAO,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC;IAC1C,CAAC;;;YAnGF,SAAS,SAAC;gBACT,QAAQ,EAAE,uBAAuB;gBACjC,QAAQ,EAAE,qBAAqB;gBAC/B,IAAI,EAAE;oBACJ,KAAK,EAAE,uBAAuB;oBAC9B,uCAAuC,EAAE,SAAS;oBAClD,wCAAwC,EAAE,UAAU;oBACpD,wCAAwC,EAAE,UAAU;oBACpD,4CAA4C,EAAE,iBAAiB;iBAChE;gBACD,0xBAA6C;gBAE7C,eAAe,EAAE,uBAAuB,CAAC,MAAM;;aAChD;;;YA7BQ,YAAY;;;iBA+BlB,KAAK;sBAGL,KAAK;uBAGL,KAAK;uBAGL,KAAK;4BAGL,KAAK;wBAGL,KAAK,SAAC,YAAY;6BAGlB,KAAK,SAAC,iBAAiB;0BAGvB,MAAM;2BAGN,MAAM;yBAGN,MAAM;4BAGN,SAAS,SAAC,OAAO","sourcesContent":["import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component,\n Input,\n Output,\n OnChanges,\n SimpleChanges,\n EventEmitter,\n ElementRef,\n ViewChild,\n} from '@angular/core';\n\nexport type Position = 'before' | 'after';\n\n@Component({\n selector: 'granite-toggle-switch',\n exportAs: 'graniteToggleSwitch',\n host: {\n class: 'granite-toggle-switch',\n '[class.granite-toggle-switch-checked]': 'checked',\n '[class.granite-toggle-switch-disabled]': 'disabled',\n '[class.granite-toggle-switch-readonly]': 'readonly',\n '[class.granite-toggle-switch-label-before]': '_positionBefore',\n },\n templateUrl: './toggle-switch.component.html',\n styleUrls: ['./toggle-switch.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GraniteToggleSwitchComponent implements OnChanges {\n @Input()\n id: string | null = null;\n\n @Input()\n checked: boolean = false;\n\n @Input()\n disabled: boolean = false;\n\n @Input()\n readonly: boolean = false;\n\n @Input()\n labelPosition: Position = 'after';\n\n @Input('aria-label')\n ariaLabel: string | null = null;\n\n @Input('aria-labelledby')\n ariaLabelledby: string | null = null;\n\n @Output()\n valueChange: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n @Output()\n toggleChange: EventEmitter<void> = new EventEmitter<void>();\n\n @Output()\n toggleBlur: EventEmitter<void> = new EventEmitter<void>();\n\n @ViewChild('input')\n private _inputElement: ElementRef<HTMLInputElement>;\n\n _positionBefore: boolean = false;\n _toggleSwitchDisabled: boolean = false;\n\n constructor(private _focusMonitor: FocusMonitor) {}\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.checked) {\n this.checked = coerceBooleanProperty(changes.checked.currentValue);\n }\n\n if (changes.disabled) {\n this.disabled = coerceBooleanProperty(changes.disabled.currentValue);\n }\n\n if (changes.readonly) {\n this.readonly = coerceBooleanProperty(changes.readonly.currentValue);\n }\n\n if (changes.labelPosition != null) {\n this._positionBefore =\n changes.labelPosition.currentValue != null &&\n changes.labelPosition.currentValue === 'before';\n }\n\n if (\n (changes.disabled || changes.readonly) &&\n (this.disabled || this.readonly)\n ) {\n this._toggleSwitchDisabled = true;\n }\n }\n\n focus(origin: FocusOrigin = 'program', options?: FocusOptions): void {\n this._focusMonitor.focusVia(this._getInputElement(), origin, options);\n }\n\n _onBlur(): void {\n this.toggleBlur.emit();\n }\n\n _toggleSwitchChange(): void {\n this.checked = this._getInputElement().checked;\n this.valueChange.emit(this.checked);\n }\n\n _toggleSwitchClick(): void {\n this.toggleChange.emit();\n }\n\n private _getInputElement(): HTMLInputElement {\n return this._inputElement.nativeElement;\n }\n}\n"]}
1
+ {"version":3,"file":"toggle-switch.component.js","sourceRoot":"","sources":["../../../../../../libs/granite-components/src/lib/toggle-switch/toggle-switch.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,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;4BAGL,KAAK;wBAGL,KAAK,SAAC,YAAY;6BAGlB,KAAK,SAAC,iBAAiB;0BAGvB,MAAM;2BAGN,MAAM;yBAGN,MAAM;4BAGN,SAAS,SAAC,OAAO","sourcesContent":["import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component,\n Input,\n Output,\n OnChanges,\n SimpleChanges,\n EventEmitter,\n ElementRef,\n ViewChild,\n} from '@angular/core';\n\nimport { Position } from '../core/types';\n\n@Component({\n selector: 'granite-toggle-switch',\n exportAs: 'graniteToggleSwitch',\n host: {\n class: 'granite-toggle-switch',\n '[class.granite-toggle-switch-checked]': 'checked',\n '[class.granite-toggle-switch-disabled]': 'disabled',\n '[class.granite-toggle-switch-readonly]': 'readonly',\n '[class.granite-toggle-switch-label-before]': '_positionBefore',\n },\n templateUrl: './toggle-switch.component.html',\n styleUrls: ['./toggle-switch.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GraniteToggleSwitchComponent implements OnChanges {\n @Input()\n id: string | null = null;\n\n @Input()\n checked: boolean = false;\n\n @Input()\n disabled: boolean = false;\n\n @Input()\n readonly: boolean = false;\n\n @Input()\n labelPosition: Position = 'after';\n\n @Input('aria-label')\n ariaLabel: string | null = null;\n\n @Input('aria-labelledby')\n ariaLabelledby: string | null = null;\n\n @Output()\n valueChange: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n @Output()\n toggleChange: EventEmitter<void> = new EventEmitter<void>();\n\n @Output()\n toggleBlur: EventEmitter<void> = new EventEmitter<void>();\n\n @ViewChild('input')\n private _inputElement: ElementRef<HTMLInputElement>;\n\n _positionBefore: boolean = false;\n _toggleSwitchDisabled: boolean = false;\n\n constructor(private _focusMonitor: FocusMonitor) {}\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.checked) {\n this.checked = coerceBooleanProperty(changes.checked.currentValue);\n }\n\n if (changes.disabled) {\n this.disabled = coerceBooleanProperty(changes.disabled.currentValue);\n }\n\n if (changes.readonly) {\n this.readonly = coerceBooleanProperty(changes.readonly.currentValue);\n }\n\n if (changes.labelPosition != null) {\n this._positionBefore =\n changes.labelPosition.currentValue != null &&\n changes.labelPosition.currentValue === 'before';\n }\n\n if (\n (changes.disabled || changes.readonly) &&\n (this.disabled || this.readonly)\n ) {\n this._toggleSwitchDisabled = true;\n }\n }\n\n focus(origin: FocusOrigin = 'program', options?: FocusOptions): void {\n this._focusMonitor.focusVia(this._getInputElement(), origin, options);\n }\n\n _onBlur(): void {\n this.toggleBlur.emit();\n }\n\n _toggleSwitchChange(): void {\n this.checked = this._getInputElement().checked;\n this.valueChange.emit(this.checked);\n }\n\n _toggleSwitchClick(): void {\n this.toggleChange.emit();\n }\n\n private _getInputElement(): HTMLInputElement {\n return this._inputElement.nativeElement;\n }\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"Position":{"__symbolic":"interface"},"GraniteToggleSwitchComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":16,"character":1},"arguments":[{"selector":"granite-toggle-switch","exportAs":"graniteToggleSwitch","host":{"class":"granite-toggle-switch","[class.granite-toggle-switch-checked]":"checked","[class.granite-toggle-switch-disabled]":"disabled","[class.granite-toggle-switch-readonly]":"readonly","[class.granite-toggle-switch-label-before]":"_positionBefore","$quoted$":["[class.granite-toggle-switch-checked]","[class.granite-toggle-switch-disabled]","[class.granite-toggle-switch-readonly]","[class.granite-toggle-switch-label-before]"]},"changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":28,"character":19},"member":"OnPush"},"template":"<label [attr.for]=\"id\" class=\"granite-toggle-switch-label\">\n <div class=\"granite-toggle-switch-bar\">\n <input\n #input\n [id]=\"id\"\n class=\"granite-toggle-switch-input cdk-visually-hidden\"\n role=\"switch\"\n type=\"checkbox\"\n [attr.aria-checked]=\"checked.toString()\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [checked]=\"checked\"\n [disabled]=\"_toggleSwitchDisabled\"\n [readonly]=\"readonly\"\n (click)=\"_toggleSwitchClick()\"\n (change)=\"_toggleSwitchChange()\"\n (blur)=\"_onBlur()\"\n />\n <div class=\"granite-toggle-switch-thumb\"></div>\n </div>\n <span class=\"granite-toggle-switch-text\"><ng-content></ng-content></span>\n</label>\n","styles":[".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none}:host{box-sizing:border-box}:host *,:host :after,:host :before{box-sizing:inherit;cursor:pointer}:host(.granite-toggle-switch){color:var(--granite-color-text)}:host(.granite-toggle-switch-checked) .granite-toggle-switch-bar{background-color:var(--granite-color-background-active)}:host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb{border:.0625rem solid var(--granite-color-background-active)}:host-context([dir=ltr]) :host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb,html[dir=ltr] :host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb{float:right}:host-context([dir=rtl]) :host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb,html[dir=rtl] :host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb{float:left}:host(.granite-toggle-switch-disabled) .granite-toggle-switch-label{opacity:.6}:host(.granite-toggle-switch-disabled) *,:host(.granite-toggle-switch-readonly) *{cursor:default}:host(.granite-toggle-switch-label-before) .granite-toggle-switch-label{flex-direction:row-reverse}:host(.granite-toggle-switch-label-before) .granite-toggle-switch-text{-webkit-padding-start:0;padding-inline-start:0;-webkit-padding-end:var(--granite-spacing-s);padding-inline-end:var(--granite-spacing-s)}.granite-toggle-switch-label{display:flex;align-items:center;width:-webkit-max-content;width:-moz-max-content;width:max-content}.granite-toggle-switch-bar{width:var(--granite-spacing-xl);height:var(--granite-spacing-m);border-radius:var(--granite-spacing-s);background-color:var(--granite-color-background-inactive);transition:background-color .1s linear;position:relative}.granite-toggle-switch-bar:focus-within{box-shadow:0 0 0 .0625rem var(--granite-color-focus)}.granite-toggle-switch-thumb{width:var(--granite-spacing-m);height:var(--granite-spacing-m);border-radius:var(--granite-spacing-m);background-color:var(--granite-color-text-static-light);border:.0625rem solid var(--granite-color-background-inactive);transition:float .1s linear}:host-context([dir=ltr]) .granite-toggle-switch-thumb,html[dir=ltr] .granite-toggle-switch-thumb{float:left}:host-context([dir=rtl]) .granite-toggle-switch-thumb,html[dir=rtl] .granite-toggle-switch-thumb{float:right}.granite-toggle-switch-text{-webkit-padding-start:var(--granite-spacing-s);padding-inline-start:var(--granite-spacing-s)}.granite-toggle-switch-text:empty{display:none}"]}]}],"members":{"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":3}}]}],"checked":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":34,"character":3}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":37,"character":3}}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":40,"character":3}}]}],"labelPosition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":43,"character":3}}]}],"ariaLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":3},"arguments":["aria-label"]}]}],"ariaLabelledby":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":49,"character":3},"arguments":["aria-labelledby"]}]}],"valueChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":52,"character":3}}]}],"toggleChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":55,"character":3}}]}],"toggleBlur":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":58,"character":3}}]}],"_inputElement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":61,"character":3},"arguments":["input"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/cdk/a11y","name":"FocusMonitor","line":67,"character":37}]}],"ngOnChanges":[{"__symbolic":"method"}],"focus":[{"__symbolic":"method"}],"_onBlur":[{"__symbolic":"method"}],"_toggleSwitchChange":[{"__symbolic":"method"}],"_toggleSwitchClick":[{"__symbolic":"method"}],"_getInputElement":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"GraniteToggleSwitchComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":16,"character":1},"arguments":[{"selector":"granite-toggle-switch","exportAs":"graniteToggleSwitch","host":{"class":"granite-toggle-switch","[class.granite-toggle-switch-checked]":"checked","[class.granite-toggle-switch-disabled]":"disabled","[class.granite-toggle-switch-readonly]":"readonly","[class.granite-toggle-switch-label-before]":"_positionBefore","$quoted$":["[class.granite-toggle-switch-checked]","[class.granite-toggle-switch-disabled]","[class.granite-toggle-switch-readonly]","[class.granite-toggle-switch-label-before]"]},"changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":28,"character":19},"member":"OnPush"},"template":"<label [attr.for]=\"id\" class=\"granite-toggle-switch-label\">\n <div class=\"granite-toggle-switch-bar\">\n <input\n #input\n [id]=\"id\"\n class=\"granite-toggle-switch-input cdk-visually-hidden\"\n role=\"switch\"\n type=\"checkbox\"\n [attr.aria-checked]=\"checked.toString()\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [checked]=\"checked\"\n [disabled]=\"_toggleSwitchDisabled\"\n [readonly]=\"readonly\"\n (click)=\"_toggleSwitchClick()\"\n (change)=\"_toggleSwitchChange()\"\n (blur)=\"_onBlur()\"\n />\n <div class=\"granite-toggle-switch-thumb\"></div>\n </div>\n <span class=\"granite-toggle-switch-text\"><ng-content></ng-content></span>\n</label>\n","styles":[".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none}:host{box-sizing:border-box}:host *,:host :after,:host :before{box-sizing:inherit;cursor:pointer}:host(.granite-toggle-switch){color:var(--granite-color-text)}:host(.granite-toggle-switch-checked) .granite-toggle-switch-bar{background-color:var(--granite-color-background-active)}:host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb{border:.0625rem solid var(--granite-color-background-active)}:host-context([dir=ltr]) :host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb,html[dir=ltr] :host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb{float:right}:host-context([dir=rtl]) :host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb,html[dir=rtl] :host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb{float:left}:host(.granite-toggle-switch-disabled) .granite-toggle-switch-label{opacity:.6}:host(.granite-toggle-switch-disabled) *,:host(.granite-toggle-switch-readonly) *{cursor:default}:host(.granite-toggle-switch-label-before) .granite-toggle-switch-label{flex-direction:row-reverse}:host(.granite-toggle-switch-label-before) .granite-toggle-switch-text{-webkit-padding-start:0;padding-inline-start:0;-webkit-padding-end:var(--granite-spacing-s);padding-inline-end:var(--granite-spacing-s)}.granite-toggle-switch-label{display:flex;align-items:center;width:-webkit-max-content;width:-moz-max-content;width:max-content}.granite-toggle-switch-bar{width:var(--granite-spacing-xl);height:var(--granite-spacing-m);border-radius:var(--granite-spacing-s);background-color:var(--granite-color-background-inactive);transition:background-color .1s linear;position:relative}.granite-toggle-switch-bar:focus-within{box-shadow:0 0 0 .0625rem var(--granite-color-focus)}.granite-toggle-switch-thumb{width:var(--granite-spacing-m);height:var(--granite-spacing-m);border-radius:var(--granite-spacing-m);background-color:var(--granite-color-text-static-light);border:.0625rem solid var(--granite-color-background-inactive);transition:float .1s linear}:host-context([dir=ltr]) .granite-toggle-switch-thumb,html[dir=ltr] .granite-toggle-switch-thumb{float:left}:host-context([dir=rtl]) .granite-toggle-switch-thumb,html[dir=rtl] .granite-toggle-switch-thumb{float:right}.granite-toggle-switch-text{-webkit-padding-start:var(--granite-spacing-s);padding-inline-start:var(--granite-spacing-s)}.granite-toggle-switch-text:empty{display:none}"]}]}],"members":{"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":3}}]}],"checked":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":34,"character":3}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":37,"character":3}}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":40,"character":3}}]}],"labelPosition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":43,"character":3}}]}],"ariaLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":3},"arguments":["aria-label"]}]}],"ariaLabelledby":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":49,"character":3},"arguments":["aria-labelledby"]}]}],"valueChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":52,"character":3}}]}],"toggleChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":55,"character":3}}]}],"toggleBlur":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":58,"character":3}}]}],"_inputElement":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":61,"character":3},"arguments":["input"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/cdk/a11y","name":"FocusMonitor","line":67,"character":37}]}],"ngOnChanges":[{"__symbolic":"method"}],"focus":[{"__symbolic":"method"}],"_onBlur":[{"__symbolic":"method"}],"_toggleSwitchChange":[{"__symbolic":"method"}],"_toggleSwitchClick":[{"__symbolic":"method"}],"_getInputElement":[{"__symbolic":"method"}]}}}}]