@ifsworld/granite-components 3.2.0 → 3.5.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 (38) hide show
  1. package/bundles/ifsworld-granite-components.umd.js +267 -6
  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/index.js +4 -0
  6. package/esm2015/index.js.map +1 -1
  7. package/esm2015/index.metadata.json +1 -1
  8. package/esm2015/lib/checkbox/checkbox.component.js +89 -0
  9. package/esm2015/lib/checkbox/checkbox.component.js.map +1 -0
  10. package/esm2015/lib/checkbox/checkbox.component.metadata.json +1 -0
  11. package/esm2015/lib/checkbox/checkbox.module.js +11 -0
  12. package/esm2015/lib/checkbox/checkbox.module.js.map +1 -0
  13. package/esm2015/lib/checkbox/checkbox.module.metadata.json +1 -0
  14. package/esm2015/lib/input-field/input-field.component.js +144 -0
  15. package/esm2015/lib/input-field/input-field.component.js.map +1 -0
  16. package/esm2015/lib/input-field/input-field.component.metadata.json +1 -0
  17. package/esm2015/lib/input-field/input-field.module.js +15 -0
  18. package/esm2015/lib/input-field/input-field.module.js.map +1 -0
  19. package/esm2015/lib/input-field/input-field.module.metadata.json +1 -0
  20. package/esm2015/lib/table/cell/table-data-cell.component.js +4 -3
  21. package/esm2015/lib/table/cell/table-data-cell.component.js.map +1 -1
  22. package/esm2015/lib/table/cell/table-data-cell.component.metadata.json +1 -1
  23. package/esm2015/lib/table/cell/table-header-cell.component.js +1 -1
  24. package/esm2015/lib/table/cell/table-header-cell.component.metadata.json +1 -1
  25. package/esm2015/lib/table/table.component.js +2 -2
  26. package/esm2015/lib/table/table.component.js.map +1 -1
  27. package/esm2015/lib/table/table.component.metadata.json +1 -1
  28. package/fesm2015/ifsworld-granite-components.js +254 -7
  29. package/fesm2015/ifsworld-granite-components.js.map +1 -1
  30. package/ifsworld-granite-components.metadata.json +1 -1
  31. package/index.d.ts +4 -0
  32. package/lib/checkbox/checkbox.component.d.ts +26 -0
  33. package/lib/checkbox/checkbox.module.d.ts +2 -0
  34. package/lib/input-field/input-field.component.d.ts +39 -0
  35. package/lib/input-field/input-field.module.d.ts +2 -0
  36. package/lib/table/cell/table-data-cell.component.d.ts +1 -0
  37. package/package.json +1 -1
  38. package/src/lib/core/style/_mixins.scss +10 -0
@@ -1 +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"}]}}}}]
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 row; let rowI = dataIndex\"\n [id]=\"cellIdPrefix + '-' + rowI + '-' + columnI\"\n [value]=\"row[column.name]\"\n [rowIndex]=\"rowI\"\n [columnIndex]=\"columnI\"\n [staticType]=\"column.staticType\"\n [column]=\"column\"\n [tableCellTemplateRef]=\"column.tableCellTemplateRef\"\n [row]=\"row\"\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;height:calc(var(--granite-spacing-m) * 2.5)}cdk-cell{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"}]}}}}]
@@ -2274,6 +2274,101 @@ GraniteRadioButtonModule.decorators = [
2274
2274
  },] }
2275
2275
  ];
2276
2276
 
2277
+ class GraniteCheckboxComponent {
2278
+ constructor(_focusMonitor) {
2279
+ this._focusMonitor = _focusMonitor;
2280
+ this.id = null;
2281
+ this.checked = false;
2282
+ this.disabled = false;
2283
+ this.readonly = false;
2284
+ this.labelPosition = 'after';
2285
+ this.ariaLabel = null;
2286
+ this.ariaLabelledby = null;
2287
+ this.valueChange = new EventEmitter();
2288
+ this.checkboxChange = new EventEmitter();
2289
+ this.checkboxBlur = new EventEmitter();
2290
+ this._positionBefore = false;
2291
+ this._checkboxDisabled = false;
2292
+ }
2293
+ ngOnChanges(changes) {
2294
+ if (changes.checked) {
2295
+ this.checked = coerceBooleanProperty(changes.checked.currentValue);
2296
+ }
2297
+ if (changes.disabled) {
2298
+ this.disabled = coerceBooleanProperty(changes.disabled.currentValue);
2299
+ }
2300
+ if (changes.readonly) {
2301
+ this.readonly = coerceBooleanProperty(changes.readonly.currentValue);
2302
+ }
2303
+ if (changes.labelPosition != null) {
2304
+ this._positionBefore =
2305
+ changes.labelPosition.currentValue != null &&
2306
+ changes.labelPosition.currentValue === 'before';
2307
+ }
2308
+ if ((changes.disabled || changes.readonly) &&
2309
+ (this.disabled || this.readonly)) {
2310
+ this._checkboxDisabled = true;
2311
+ }
2312
+ }
2313
+ focus(origin = 'program', options) {
2314
+ this._focusMonitor.focusVia(this._getInputElement(), origin, options);
2315
+ }
2316
+ _onBlur() {
2317
+ this.checkboxBlur.emit();
2318
+ }
2319
+ _checkboxChange() {
2320
+ this.checked = this._getInputElement().checked;
2321
+ this.valueChange.emit(this.checked);
2322
+ }
2323
+ _checkboxClick() {
2324
+ this.checkboxChange.emit();
2325
+ }
2326
+ _getInputElement() {
2327
+ return this._inputElement.nativeElement;
2328
+ }
2329
+ }
2330
+ GraniteCheckboxComponent.decorators = [
2331
+ { type: Component, args: [{
2332
+ selector: 'granite-checkbox',
2333
+ exportAs: 'graniteCheckbox',
2334
+ host: {
2335
+ class: 'granite-checkbox',
2336
+ '[class.granite-checkbox-checked]': 'checked',
2337
+ '[class.granite-checkbox-disabled]': 'disabled',
2338
+ '[class.granite-checkbox-readonly]': 'readonly',
2339
+ '[class.granite-checkbox-label-before]': '_positionBefore',
2340
+ },
2341
+ template: "<label [attr.for]=\"id\" class=\"granite-checkbox-label\">\n <div class=\"granite-checkbox-box\">\n <input\n #input\n [id]=\"id\"\n class=\"granite-checkbox-input cdk-visually-hidden\"\n role=\"checkbox\"\n type=\"checkbox\"\n [attr.aria-checked]=\"checked.toString()\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [checked]=\"checked\"\n [disabled]=\"_checkboxDisabled\"\n [readonly]=\"readonly\"\n (click)=\"_checkboxClick()\"\n (change)=\"_checkboxChange()\"\n (blur)=\"_onBlur()\"\n />\n <div class=\"granite-checkbox-check\"></div>\n </div>\n <span class=\"granite-checkbox-text\"><ng-content></ng-content></span>\n</label>\n",
2342
+ changeDetection: ChangeDetectionStrategy.OnPush,
2343
+ 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-checkbox){color:var(--granite-color-text)}:host(.granite-checkbox):not(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-label:hover .granite-checkbox-box{border-color:var(--granite-color-background-active)}:host(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-label:hover .granite-checkbox-box{background-color:var(--granite-color-background-active-hover);border-color:var(--granite-color-background-active-hover)}:host(.granite-checkbox-checked) .granite-checkbox-box{border-color:var(--granite-color-background-active);background-color:var(--granite-color-background-active)}:host(.granite-checkbox-checked) .granite-checkbox-box:focus-within{border-color:var(--granite-color-focus)}:host(.granite-checkbox-checked) .granite-checkbox-check{display:flex}:host(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-box{-webkit-animation:fadeInAnimation .2s;animation:fadeInAnimation .2s;-webkit-animation-iteration-count:1;animation-iteration-count:1}:host(:not(.granite-checkbox-checked)) .granite-checkbox-box{-webkit-animation:fadeOutAnimation .2s;animation:fadeOutAnimation .2s;-webkit-animation-iteration-count:1;animation-iteration-count:1}:host(.granite-checkbox-readonly.granite-checkbox-checked) .granite-checkbox-box{background-color:var(--granite-color-text);border-color:var(--granite-color-text)}:host(.granite-checkbox-readonly.granite-checkbox-checked) .granite-checkbox-box .granite-checkbox-check{border-color:var(--granite-color-background)}:host(.granite-checkbox-disabled) .granite-checkbox-box{opacity:.3;background-color:var(--granite-color-border-soft)}:host(.granite-checkbox-disabled) .granite-checkbox-label{opacity:.6}:host(.granite-checkbox-disabled) *,:host(.granite-checkbox-readonly) *{cursor:default}:host(.granite-checkbox-label-before) .granite-checkbox-label{flex-direction:row-reverse}:host(.granite-checkbox-label-before) .granite-checkbox-text{-webkit-padding-start:0;padding-inline-start:0;-webkit-padding-end:var(--granite-spacing-s);padding-inline-end:var(--granite-spacing-s)}.granite-checkbox-label{display:flex;align-items:center;width:-webkit-max-content;width:-moz-max-content;width:max-content}.granite-checkbox-box{width:var(--granite-spacing-m);height:var(--granite-spacing-m);border:solid var(--granite-color-background-inactive);border-width:calc(var(--granite-spacing-xs) / 4);border-radius:var(--granite-spacing-xs);display:flex;justify-content:center;position:relative}.granite-checkbox-box:focus-within{border:calc(var(--granite-spacing-xs) / 4) solid var(--granite-color-focus)}.granite-checkbox-check{position:relative;display:none;width:calc(var(--granite-spacing-s) + (var(--granite-spacing-xs) / 4));height:calc(var(--granite-spacing-xs) + (var(--granite-spacing-xs) / 4));background-color:transparent;border:solid var(--granite-color-text-static-light);transform:rotate(-45deg);margin-top:var(--granite-spacing-xs);border-left-width:calc(var(--granite-spacing-xs) / 2);border-bottom-width:calc(var(--granite-spacing-xs) / 2);border-right-width:0;border-top-width:0}.granite-checkbox-text{-webkit-padding-start:var(--granite-spacing-s);padding-inline-start:var(--granite-spacing-s)}.granite-checkbox-text:empty{display:none}@-webkit-keyframes fadeInAnimation{0%{opacity:0}to{opacity:1}}@keyframes fadeInAnimation{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fadeOutAnimation{0%{opacity:1}to{opacity:0}}@keyframes fadeOutAnimation{0%{opacity:1}to{opacity:0}}"]
2344
+ },] }
2345
+ ];
2346
+ GraniteCheckboxComponent.ctorParameters = () => [
2347
+ { type: FocusMonitor }
2348
+ ];
2349
+ GraniteCheckboxComponent.propDecorators = {
2350
+ id: [{ type: Input }],
2351
+ checked: [{ type: Input }],
2352
+ disabled: [{ type: Input }],
2353
+ readonly: [{ type: Input }],
2354
+ labelPosition: [{ type: Input }],
2355
+ ariaLabel: [{ type: Input, args: ['aria-label',] }],
2356
+ ariaLabelledby: [{ type: Input, args: ['aria-labelledby',] }],
2357
+ valueChange: [{ type: Output }],
2358
+ checkboxChange: [{ type: Output }],
2359
+ checkboxBlur: [{ type: Output }],
2360
+ _inputElement: [{ type: ViewChild, args: ['input',] }]
2361
+ };
2362
+
2363
+ class GraniteCheckboxModule {
2364
+ }
2365
+ GraniteCheckboxModule.decorators = [
2366
+ { type: NgModule, args: [{
2367
+ declarations: [GraniteCheckboxComponent],
2368
+ exports: [GraniteCheckboxComponent],
2369
+ },] }
2370
+ ];
2371
+
2277
2372
  /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
2278
2373
  const disabledMixin = (Base = class {
2279
2374
  }) => {
@@ -2428,9 +2523,9 @@ class GraniteTableComponent {
2428
2523
  GraniteTableComponent.decorators = [
2429
2524
  { type: Component, args: [{
2430
2525
  selector: 'granite-table',
2431
- 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",
2526
+ 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 row; let rowI = dataIndex\"\n [id]=\"cellIdPrefix + '-' + rowI + '-' + columnI\"\n [value]=\"row[column.name]\"\n [rowIndex]=\"rowI\"\n [columnIndex]=\"columnI\"\n [staticType]=\"column.staticType\"\n [column]=\"column\"\n [tableCellTemplateRef]=\"column.tableCellTemplateRef\"\n [row]=\"row\"\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",
2432
2527
  changeDetection: ChangeDetectionStrategy.OnPush,
2433
- 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)}"]
2528
+ 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;height:calc(var(--granite-spacing-m) * 2.5)}cdk-cell{border-top:1px solid var(--granite-color-border-soft)}"]
2434
2529
  },] }
2435
2530
  ];
2436
2531
  GraniteTableComponent.propDecorators = {
@@ -2456,8 +2551,8 @@ GraniteTableDataCellComponent.decorators = [
2456
2551
  { type: Component, args: [{
2457
2552
  // eslint-disable-next-line @angular-eslint/component-selector
2458
2553
  selector: 'cdk-cell[graniteTableDataCell]',
2459
- 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",
2460
- 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)}"]
2554
+ 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 row: row\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",
2555
+ styles: [":host{box-sizing:border-box}:host *,:host :after,:host :before{box-sizing:inherit}.granite-table-data-cell-static-container{padding:var(--granite-spacing-s);height:inherit;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)}"]
2461
2556
  },] }
2462
2557
  ];
2463
2558
  GraniteTableDataCellComponent.propDecorators = {
@@ -2465,7 +2560,8 @@ GraniteTableDataCellComponent.propDecorators = {
2465
2560
  staticType: [{ type: Input }],
2466
2561
  rowIndex: [{ type: Input }],
2467
2562
  columnIndex: [{ type: Input }],
2468
- tableCellTemplateRef: [{ type: Input }]
2563
+ tableCellTemplateRef: [{ type: Input }],
2564
+ row: [{ type: Input }]
2469
2565
  };
2470
2566
 
2471
2567
  class GraniteTableHeaderCellComponent extends GraniteCell {
@@ -2475,7 +2571,7 @@ GraniteTableHeaderCellComponent.decorators = [
2475
2571
  // eslint-disable-next-line @angular-eslint/component-selector
2476
2572
  selector: 'cdk-header-cell[graniteTableHeaderCell]',
2477
2573
  template: "<span class=\"granite-table-header-cell-title\">\n <ng-content></ng-content>\n</span>\n",
2478
- 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)}"]
2574
+ styles: [":host{box-sizing:border-box}:host *,:host :after,:host :before{box-sizing:inherit}.granite-table-header-cell-title{padding:var(--granite-spacing-s);height:inherit;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)}"]
2479
2575
  },] }
2480
2576
  ];
2481
2577
 
@@ -2519,6 +2615,157 @@ GraniteTableModule.decorators = [
2519
2615
  },] }
2520
2616
  ];
2521
2617
 
2618
+ const GRANITE_INPUT_INCLUDES = ['text', 'number', 'password', 'textarea'];
2619
+ class GraniteInputFieldComponent {
2620
+ constructor(_focusMonitor) {
2621
+ this._focusMonitor = _focusMonitor;
2622
+ this.id = null;
2623
+ this.name = null;
2624
+ this.type = 'text';
2625
+ this.value = '';
2626
+ this.required = false;
2627
+ this.readonly = false;
2628
+ this.invalid = false;
2629
+ this.disabled = false;
2630
+ this.placeholder = '';
2631
+ this.maxlength = 255;
2632
+ this.countcharacters = false;
2633
+ this.ariaLabel = null;
2634
+ this.ariaLabelledby = null;
2635
+ this.valueChange = new EventEmitter();
2636
+ this._supported = true;
2637
+ this._empty = false;
2638
+ this._passwordFieldIcon = 'view';
2639
+ this._passwordField = false;
2640
+ this._passwordToggled = false;
2641
+ this._currentCharCount = 0;
2642
+ }
2643
+ ngOnInit() {
2644
+ this._validateType();
2645
+ this._passwordField = this.type == 'password';
2646
+ this._empty = this.value == null || this.value === '';
2647
+ }
2648
+ ngOnChanges(changes) {
2649
+ if (changes.required) {
2650
+ this.required = coerceBooleanProperty(changes.required.currentValue);
2651
+ }
2652
+ if (changes.readonly) {
2653
+ this.readonly = coerceBooleanProperty(changes.readonly.currentValue);
2654
+ }
2655
+ if (changes.invalid) {
2656
+ this.invalid = coerceBooleanProperty(changes.invalid.currentValue);
2657
+ }
2658
+ if (changes.disabled) {
2659
+ this.disabled = coerceBooleanProperty(changes.disabled.currentValue);
2660
+ }
2661
+ if (changes.countcharacters) {
2662
+ this.countcharacters = coerceBooleanProperty(changes.countcharacters.currentValue);
2663
+ }
2664
+ if (changes.value) {
2665
+ this._empty = this.value == null || this.value === '';
2666
+ }
2667
+ if (changes.type) {
2668
+ this._validateType();
2669
+ }
2670
+ }
2671
+ focus(origin = 'program', options) {
2672
+ if (this.type === 'text') {
2673
+ this._focusMonitor.focusVia(this._getInputElement(), origin, options);
2674
+ }
2675
+ else if (this.type === 'textarea') {
2676
+ this._focusMonitor.focusVia(this._getTextareaElement(), origin, options);
2677
+ }
2678
+ }
2679
+ _togglePassword() {
2680
+ if (this._passwordToggled) {
2681
+ this._passwordToggled = false;
2682
+ this.type = 'password';
2683
+ this._passwordFieldIcon = 'view';
2684
+ }
2685
+ else {
2686
+ this._passwordToggled = true;
2687
+ this.type = 'text';
2688
+ this._passwordFieldIcon = 'view-disabled';
2689
+ }
2690
+ }
2691
+ _onKeyUp(event) {
2692
+ const inputEvent = event.target;
2693
+ this._applyCharacterCount(inputEvent.value);
2694
+ this._empty = inputEvent.value == null || inputEvent.value === '';
2695
+ this.valueChange.emit(inputEvent.value);
2696
+ }
2697
+ _onInput(event) {
2698
+ const inputEvent = event.target;
2699
+ this._empty = inputEvent.value == null || inputEvent.value === '';
2700
+ this.valueChange.emit(inputEvent.value);
2701
+ }
2702
+ _validateType() {
2703
+ if (GRANITE_INPUT_INCLUDES.indexOf(this.type) < 0) {
2704
+ this._supported = false;
2705
+ throw Error(`Input type "${this.type}" isn't supported by graniteInputField.`);
2706
+ }
2707
+ }
2708
+ _applyCharacterCount(inputString) {
2709
+ if (this.countcharacters) {
2710
+ this._currentCharCount = inputString.length;
2711
+ if (this._currentCharCount > this.maxlength) {
2712
+ inputString = inputString.slice(0, this.maxlength);
2713
+ this._currentCharCount = this.maxlength;
2714
+ }
2715
+ }
2716
+ }
2717
+ _getInputElement() {
2718
+ return this._inputElement.nativeElement;
2719
+ }
2720
+ _getTextareaElement() {
2721
+ return this._textareaElement.nativeElement;
2722
+ }
2723
+ }
2724
+ GraniteInputFieldComponent.decorators = [
2725
+ { type: Component, args: [{
2726
+ selector: 'granite-input-field',
2727
+ exportAs: 'graniteInputField',
2728
+ template: "<div\n *ngIf=\"_supported\"\n class=\"granite-input-container\"\n [class.granite-input-disabled]=\"disabled\"\n [class.granite-input-readonly]=\"readonly\"\n [class.granite-input-disabled]=\"disabled\"\n [class.granite-input-readonly]=\"readonly\"\n>\n <div\n class=\"granite-input-top-row\"\n [class.granite-input-required]=\"required\"\n [class.granite-input-empty]=\"_empty\"\n [class.granite-input-disabled]=\"disabled\"\n [class.granite-input-readonly]=\"readonly\"\n >\n <div\n *ngIf=\"prefixicon\"\n class=\"granite-input-prepend\"\n [class.granite-input-required]=\"required\"\n [class.granite-input-empty]=\"_empty\"\n >\n <granite-icon class=\"granite-input-prepend-icon\">\n {{ prefixicon }}\n </granite-icon>\n </div>\n\n <ng-container\n *ngIf=\"type != 'textarea'; then inputElement; else textareaElement\"\n ></ng-container>\n\n <ng-template #inputElement>\n <input\n #input\n [id]=\"id\"\n class=\"granite-input-base\"\n [class.granite-input-invalid]=\"invalid\"\n [class.granite-input-empty]=\"_empty\"\n [name]=\"name\"\n [attr.type]=\"type\"\n [required]=\"required\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n [attr.maxlength]=\"maxlength\"\n [value]=\"value\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-invalid]=\"invalid\"\n (keyup)=\"_onKeyUp($event)\"\n (input)=\"_onInput($event)\"\n />\n </ng-template>\n\n <button\n *ngIf=\"_passwordField\"\n class=\"granite-input-append\"\n [class.granite-input-required]=\"required\"\n [class.granite-input-empty]=\"_empty\"\n (click)=\"_togglePassword()\"\n >\n <granite-icon class=\"granite-input-password-toggle-icon\">\n {{ _passwordFieldIcon }}\n </granite-icon>\n </button>\n\n <ng-template #textareaElement>\n <textarea\n #textarea\n [id]=\"id\"\n class=\"granite-input-base granite-text-area\"\n [class.granite-input-invalid]=\"invalid\"\n [class.granite-input-empty]=\"_empty\"\n rows=\"1\"\n [name]=\"name\"\n [attr.type]=\"type\"\n [required]=\"required\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n [value]=\"value\"\n [attr.maxlength]=\"maxlength\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-required]=\"required\"\n [attr.aria-invalid]=\"invalid\"\n (keyup)=\"_onKeyUp($event)\"\n (input)=\"_onInput($event)\"\n ></textarea>\n </ng-template>\n\n <div\n class=\"granite-input-hover-bar\"\n [class.granite-input-invalid]=\"invalid\"\n [class.granite-input-empty]=\"_empty\"\n ></div>\n </div>\n\n <div *ngIf=\"countcharacters\" class=\"granite-input-bottom-row\">\n <div class=\"granite-input-char-count\">\n {{ _currentCharCount }}/{{ maxlength }}\n </div>\n </div>\n</div>\n",
2729
+ host: {
2730
+ class: 'granite-input-field',
2731
+ },
2732
+ changeDetection: ChangeDetectionStrategy.OnPush,
2733
+ styles: [":host{transition:all .2s ease-out;width:calc(var(--granite-spacing-3-xl) * 3.625);height:var(--granite-spacing-xl);box-sizing:border-box}:host *,:host :after,:host :before{box-sizing:inherit}.granite-input-container{height:inherit;width:inherit;font-size:var(--granite-font-size-body-small)}.granite-input-container .granite-input-top-row{display:inline-flex;width:inherit;height:inherit;position:relative;background:var(--granite-color-background)}.granite-input-container .granite-input-top-row:hover .granite-input-hover-bar{height:calc(var(--granite-spacing-xs)/2)}.granite-input-container .granite-input-top-row:hover .granite-input-hover-bar.granite-input-invalid.granite-input-empty{background-color:var(--granite-color-focus)}.granite-input-container .granite-input-top-row .granite-text-area{min-width:calc(var(--granite-spacing-3-xl) * 3.625);min-height:var(--granite-spacing-xl)}.granite-input-container .granite-input-top-row.granite-input-disabled,.granite-input-container .granite-input-top-row.granite-input-readonly{background-color:transparent;box-shadow:none}.granite-input-container .granite-input-top-row.granite-input-disabled .granite-input-hover-bar,.granite-input-container .granite-input-top-row.granite-input-readonly .granite-input-hover-bar{background-color:transparent}.granite-input-container .granite-input-top-row .granite-input-base{-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;border:none;background-color:var(--granite-color-background-input);padding:var(--granite-spacing-s);width:inherit;height:inherit;color:var(--granite-color-text);font:inherit;font-weight:var(--granite-font-weight-regular);line-height:100%}.granite-input-container .granite-input-top-row .granite-input-base:required.granite-input-empty{background-color:var(--granite-color-background-failure)}.granite-input-container .granite-input-top-row .granite-input-base:required::-moz-placeholder{color:var(--granite-color-text-weak)}.granite-input-container .granite-input-top-row .granite-input-base:required:-ms-input-placeholder{color:var(--granite-color-text-weak)}.granite-input-container .granite-input-top-row .granite-input-base:required::placeholder{color:var(--granite-color-text-weak)}.granite-input-container .granite-input-top-row .granite-input-base:-moz-read-only{background-color:transparent}.granite-input-container .granite-input-top-row .granite-input-base:read-only{background-color:transparent}.granite-input-container .granite-input-top-row .granite-input-base:disabled{opacity:.3}.granite-input-container .granite-input-top-row .granite-input-base::-moz-placeholder{color:var(--granite-color-text-hint)}.granite-input-container .granite-input-top-row .granite-input-base:-ms-input-placeholder{color:var(--granite-color-text-hint)}.granite-input-container .granite-input-top-row .granite-input-base::placeholder{color:var(--granite-color-text-hint)}.granite-input-container .granite-input-top-row .granite-input-base:hover::-moz-placeholder{color:var(--granite-color-text)}.granite-input-container .granite-input-top-row .granite-input-base:hover:-ms-input-placeholder{color:var(--granite-color-text)}.granite-input-container .granite-input-top-row .granite-input-base:hover::placeholder{color:var(--granite-color-text)}.granite-input-container .granite-input-top-row .granite-input-base:focus{box-shadow:inset 0 calc(var(--granite-spacing-xs)/2) var(--granite-color-focus),inset calc(var(--granite-spacing-xs)/2) 0 var(--granite-color-focus),inset calc(var(--granite-spacing-xs)/2 * -1) 0 var(--granite-color-focus),inset 0 calc(var(--granite-spacing-xs)/2 * -1) var(--granite-color-focus)}.granite-input-container .granite-input-top-row .granite-input-base:focus.granite-input-invalid{box-shadow:inset 0 calc(var(--granite-spacing-xs)/2 * -1) var(--granite-color-signal-failure),inset 0 calc(var(--granite-spacing-xs)/2) var(--granite-color-focus),inset calc(var(--granite-spacing-xs)/2) 0 var(--granite-color-focus),inset calc(var(--granite-spacing-xs)/2 * -1) 0 var(--granite-color-focus)}.granite-input-container .granite-input-top-row .granite-input-base:focus::-moz-placeholder{color:transparent}.granite-input-container .granite-input-top-row .granite-input-base:focus:-ms-input-placeholder{color:transparent}.granite-input-container .granite-input-top-row .granite-input-base:focus::placeholder{color:transparent}.granite-input-container .granite-input-top-row .granite-input-hover-bar{height:calc(var(--granite-spacing-xs)/4);background-color:var(--granite-color-border-hard);position:absolute;width:inherit;bottom:0}.granite-input-container .granite-input-top-row .granite-input-hover-bar.granite-input-invalid{background-color:var(--granite-color-signal-failure)}.granite-input-container .granite-input-top-row:focus-within .granite-input-hover-bar{background-color:transparent}.granite-input-container .granite-input-prepend{display:flex;align-items:center;padding:0 var(--granite-spacing-s);background:var(--granite-color-background-input)}.granite-input-container .granite-input-prepend .granite-input-prepend-icon{width:var(--granite-spacing-m);height:var(--granite-spacing-m);color:var(--granite-color-text);box-shadow:none}.granite-input-container .granite-input-prepend.granite-input-required.granite-input-empty{background-color:var(--granite-color-background-failure)}.granite-input-container .granite-input-append{-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;border:none;background-color:var(--granite-color-background-input);position:relative}.granite-input-container .granite-input-append:focus{box-shadow:inset 0 calc(var(--granite-spacing-xs)/2) var(--granite-color-focus),inset calc(var(--granite-spacing-xs)/2) 0 var(--granite-color-focus),inset calc(var(--granite-spacing-xs)/2 * -1) 0 var(--granite-color-focus),inset 0 calc(var(--granite-spacing-xs)/2 * -1) var(--granite-color-focus)}.granite-input-container .granite-input-append .granite-input-password-toggle-icon{width:-webkit-max-content;width:-moz-max-content;width:max-content;height:-webkit-max-content;height:-moz-max-content;height:max-content;color:var(--granite-color-text);box-shadow:none}.granite-input-container .granite-input-append.granite-input-required.granite-input-empty{background-color:var(--granite-color-background-failure)}.granite-input-container .granite-input-bottom-row{box-shadow:none}.granite-input-container .granite-input-char-count{background:var(--granite-color-background-warning);border-radius:0 0 var(--granite-spacing-xs) var(--granite-spacing-xs);padding:var(--granite-spacing-s);background-size:contain;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;box-shadow:none}.granite-input-container.granite-input-disabled,.granite-input-container.granite-input-readonly{background-color:transparent}"]
2734
+ },] }
2735
+ ];
2736
+ GraniteInputFieldComponent.ctorParameters = () => [
2737
+ { type: FocusMonitor }
2738
+ ];
2739
+ GraniteInputFieldComponent.propDecorators = {
2740
+ id: [{ type: Input }],
2741
+ name: [{ type: Input }],
2742
+ type: [{ type: Input }],
2743
+ value: [{ type: Input }],
2744
+ required: [{ type: Input }],
2745
+ readonly: [{ type: Input }],
2746
+ invalid: [{ type: Input }],
2747
+ disabled: [{ type: Input }],
2748
+ placeholder: [{ type: Input }],
2749
+ prefixicon: [{ type: Input }],
2750
+ maxlength: [{ type: Input }],
2751
+ countcharacters: [{ type: Input }],
2752
+ ariaLabel: [{ type: Input, args: ['aria-label',] }],
2753
+ ariaLabelledby: [{ type: Input, args: ['aria-labelledby',] }],
2754
+ valueChange: [{ type: Output }],
2755
+ _inputElement: [{ type: ViewChild, args: ['input',] }],
2756
+ _textareaElement: [{ type: ViewChild, args: ['textarea',] }]
2757
+ };
2758
+
2759
+ class GraniteInputFieldModule {
2760
+ }
2761
+ GraniteInputFieldModule.decorators = [
2762
+ { type: NgModule, args: [{
2763
+ imports: [CommonModule, GraniteIconModule, GraniteButtonModule],
2764
+ declarations: [GraniteInputFieldComponent],
2765
+ exports: [GraniteInputFieldComponent],
2766
+ },] }
2767
+ ];
2768
+
2522
2769
  const ɵ0 = deviceDesktop.output;
2523
2770
  /**
2524
2771
  * Directive used to tell components and their sub components that client output
@@ -2623,5 +2870,5 @@ GraniteCoreModule.decorators = [
2623
2870
  * Generated bundle index. Do not edit.
2624
2871
  */
2625
2872
 
2626
- export { ClientInputDesktopDirective, ClientInputTouchDirective, ClientOutputDesktopDirective, ClientOutputTouchDirective, GRANITE_CLIENT_INPUT, GRANITE_CLIENT_OUTPUT, GraniteAnchorComponent, GraniteArrangeGridComponent, GraniteArrangeGridItemComponent, GraniteArrangeGridModule, GraniteArrangeGridOrientation, GraniteBadgeComponent, GraniteBadgeHarness, GraniteBadgeModule, GraniteButtonComponent, GraniteButtonModule, GraniteCoreModule, GraniteDividerDirective, GraniteGridComponent, GraniteGridItemComponent, GraniteGridModule, GraniteIconComponent, GraniteIconModule, GraniteMenuComponent, GraniteMenuHarness, GraniteMenuItemComponent, GraniteMenuItemHarness, GraniteMenuModule, GraniteMenuTouchCloseComponent, GraniteMenuTouchTitleItemComponent, GraniteMenuTriggerForDirective, GraniteRadioButtonComponent, GraniteRadioButtonModule, GraniteTableColumnDirective, GraniteTableComponent, GraniteTableModule, GraniteToggleSwitchComponent, GraniteToggleSwitchModule, _MenuBaseComponent, deviceDesktop, deviceTouch, disabledMixin, graniteMenuDesktopAnimations, graniteMenuTouchAnimations, ɵ0$1 as ɵ0, GRANITE_MENU_PANEL as ɵa, getEaseOutSteep as ɵc, getEaseLinear as ɵd, GraniteTableDataCellComponent as ɵe, GraniteCell as ɵf, GraniteTableHeaderCellComponent as ɵg, PurePipesModule as ɵh, GraniteTitlePipe as ɵi };
2873
+ export { ClientInputDesktopDirective, ClientInputTouchDirective, ClientOutputDesktopDirective, ClientOutputTouchDirective, GRANITE_CLIENT_INPUT, GRANITE_CLIENT_OUTPUT, GraniteAnchorComponent, GraniteArrangeGridComponent, GraniteArrangeGridItemComponent, GraniteArrangeGridModule, GraniteArrangeGridOrientation, GraniteBadgeComponent, GraniteBadgeHarness, GraniteBadgeModule, GraniteButtonComponent, GraniteButtonModule, GraniteCheckboxComponent, GraniteCheckboxModule, GraniteCoreModule, GraniteDividerDirective, GraniteGridComponent, GraniteGridItemComponent, GraniteGridModule, GraniteIconComponent, GraniteIconModule, GraniteInputFieldComponent, GraniteInputFieldModule, GraniteMenuComponent, GraniteMenuHarness, GraniteMenuItemComponent, GraniteMenuItemHarness, GraniteMenuModule, GraniteMenuTouchCloseComponent, GraniteMenuTouchTitleItemComponent, GraniteMenuTriggerForDirective, GraniteRadioButtonComponent, GraniteRadioButtonModule, GraniteTableColumnDirective, GraniteTableComponent, GraniteTableModule, GraniteToggleSwitchComponent, GraniteToggleSwitchModule, _MenuBaseComponent, deviceDesktop, deviceTouch, disabledMixin, graniteMenuDesktopAnimations, graniteMenuTouchAnimations, ɵ0$1 as ɵ0, GRANITE_MENU_PANEL as ɵa, getEaseOutSteep as ɵc, getEaseLinear as ɵd, GraniteTableDataCellComponent as ɵe, GraniteCell as ɵf, GraniteTableHeaderCellComponent as ɵg, PurePipesModule as ɵh, GraniteTitlePipe as ɵi };
2627
2874
  //# sourceMappingURL=ifsworld-granite-components.js.map