@abgov/angular-components 2.0.0-beta.1 → 2.0.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.
Files changed (84) hide show
  1. package/README.md +3 -45
  2. package/abgov-angular-components.d.ts +1 -0
  3. package/bundles/abgov-angular-components.umd.js +129 -2513
  4. package/bundles/abgov-angular-components.umd.js.map +1 -1
  5. package/esm2015/index.js +2 -26
  6. package/esm2015/lib/angular-components.module.js +16 -91
  7. package/esm2015/lib/value-directive.js +133 -0
  8. package/fesm2015/abgov-angular-components.js +117 -2001
  9. package/fesm2015/abgov-angular-components.js.map +1 -1
  10. package/index.d.ts +1 -25
  11. package/lib/angular-components.module.d.ts +7 -0
  12. package/lib/value-directive.d.ts +34 -0
  13. package/package.json +7 -12
  14. package/abgov-angular-components.metadata.json +0 -1
  15. package/esm2015/experimental/app-version-header/app-version-header.component.js +0 -30
  16. package/esm2015/experimental/badge/badge.component.js +0 -24
  17. package/esm2015/experimental/components.module.js +0 -28
  18. package/esm2015/experimental/index.js +0 -5
  19. package/esm2015/experimental/number-input/number-input.component.js +0 -151
  20. package/esm2015/lib/button/button.component.js +0 -66
  21. package/esm2015/lib/button-link/button-link.component.js +0 -66
  22. package/esm2015/lib/callout/callout.component.js +0 -34
  23. package/esm2015/lib/card/card.component.js +0 -37
  24. package/esm2015/lib/card/content/card-content.component.js +0 -24
  25. package/esm2015/lib/card/footer/card-footer.component.js +0 -24
  26. package/esm2015/lib/card/header/card-header.component.js +0 -24
  27. package/esm2015/lib/card/thumb/card-thumb.component.js +0 -27
  28. package/esm2015/lib/card-group/card.group.component.js +0 -23
  29. package/esm2015/lib/checkbox/checkbox-change.js +0 -3
  30. package/esm2015/lib/checkbox/checkbox.component.js +0 -136
  31. package/esm2015/lib/dropdown/dropdown.component.js +0 -326
  32. package/esm2015/lib/dropdown/option/option.component.js +0 -48
  33. package/esm2015/lib/dropdown/option-group/option-group.component.js +0 -46
  34. package/esm2015/lib/element-load-indicator/element-load-indicator.component.js +0 -63
  35. package/esm2015/lib/header/header.component.js +0 -47
  36. package/esm2015/lib/hero-banner/content/hero-banner-content.component.js +0 -15
  37. package/esm2015/lib/hero-banner/hero-banner.component.js +0 -21
  38. package/esm2015/lib/hero-banner/link/hero-banner-link.component.js +0 -18
  39. package/esm2015/lib/microsite-logo/microsite-logo.component.js +0 -34
  40. package/esm2015/lib/notification/notification.component.js +0 -59
  41. package/esm2015/lib/notification-banner/notification-banner.component.js +0 -32
  42. package/esm2015/lib/page-load-indicator/page-load-indicator.component.js +0 -117
  43. package/esm2015/lib/radio/radio-change.js +0 -3
  44. package/esm2015/lib/radio/radio.component.js +0 -146
  45. package/esm2015/lib/radio/radio.service.js +0 -20
  46. package/esm2015/lib/radio-group/radio-group.component.js +0 -282
  47. package/esm2015/lib/skeleton/skeleton-element.component.js +0 -21
  48. package/esm2015/lib/skeleton/skeleton-image-content.component.js +0 -19
  49. package/experimental/app-version-header/app-version-header.component.d.ts +0 -10
  50. package/experimental/badge/badge.component.d.ts +0 -7
  51. package/experimental/components.module.d.ts +0 -2
  52. package/experimental/index.d.ts +0 -4
  53. package/experimental/number-input/number-input.component.d.ts +0 -66
  54. package/lib/button/button.component.d.ts +0 -37
  55. package/lib/button-link/button-link.component.d.ts +0 -38
  56. package/lib/callout/callout.component.d.ts +0 -20
  57. package/lib/card/card.component.d.ts +0 -23
  58. package/lib/card/content/card-content.component.d.ts +0 -14
  59. package/lib/card/footer/card-footer.component.d.ts +0 -14
  60. package/lib/card/header/card-header.component.d.ts +0 -14
  61. package/lib/card/thumb/card-thumb.component.d.ts +0 -22
  62. package/lib/card-group/card.group.component.d.ts +0 -32
  63. package/lib/checkbox/checkbox-change.d.ts +0 -7
  64. package/lib/checkbox/checkbox.component.d.ts +0 -100
  65. package/lib/dropdown/dropdown.component.d.ts +0 -193
  66. package/lib/dropdown/option/option.component.d.ts +0 -39
  67. package/lib/dropdown/option-group/option-group.component.d.ts +0 -38
  68. package/lib/element-load-indicator/element-load-indicator.component.d.ts +0 -38
  69. package/lib/header/header.component.d.ts +0 -29
  70. package/lib/hero-banner/content/hero-banner-content.component.d.ts +0 -5
  71. package/lib/hero-banner/hero-banner.component.d.ts +0 -9
  72. package/lib/hero-banner/link/hero-banner-link.component.d.ts +0 -6
  73. package/lib/microsite-logo/microsite-logo.component.d.ts +0 -20
  74. package/lib/notification/notification.component.d.ts +0 -43
  75. package/lib/notification-banner/notification-banner.component.d.ts +0 -22
  76. package/lib/page-load-indicator/page-load-indicator.component.d.ts +0 -55
  77. package/lib/radio/radio-change.d.ts +0 -7
  78. package/lib/radio/radio.component.d.ts +0 -119
  79. package/lib/radio/radio.service.d.ts +0 -7
  80. package/lib/radio-group/radio-group.component.d.ts +0 -190
  81. package/lib/skeleton/skeleton-element.component.d.ts +0 -5
  82. package/lib/skeleton/skeleton-image-content.component.d.ts +0 -5
  83. package/theme.css +0 -164
  84. package/theme.css.map +0 -1
@@ -1,2038 +1,154 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, HostBinding, Input, ChangeDetectionStrategy, ViewChild, ChangeDetectorRef, ContentChildren, EventEmitter, Output, forwardRef, Injectable, InjectionToken, HostListener, NgModule } from '@angular/core';
3
- import { CommonModule } from '@angular/common';
4
- import { OverlayModule } from '@angular/cdk/overlay';
5
- import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
6
- import { BehaviorSubject } from 'rxjs';
2
+ import { forwardRef, Directive, HostListener, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
3
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
7
4
 
8
- /**
9
- * A Government of Alberta styled button.
10
- * selector: button[goa-button], input[type="button"][goa-button], input[type="submit"][goa-button]
11
- */
12
- class GoAButtonComponent {
13
- constructor() {
14
- /**
15
- * The appearance style of the button.
16
- */
17
- this.buttonType = 'primary';
18
- /**
19
- * The size of the button, controls font size and padding.
20
- */
21
- this.buttonSize = 'normal';
22
- }
23
- /**
24
- * Adds class goa-button to the host.
25
- * @ignore
26
- */
27
- get primaryBinding() {
28
- return true;
29
- }
30
- /**
31
- * Adds class goa--secondary to the host if the buttonStyle = secondary.
32
- * @ignore
33
- */
34
- get secondaryBinding() {
35
- return this.buttonType === 'secondary';
36
- }
37
- /**
38
- * Adds class goa--tertiary to the host if the buttonStyle = tertiary.
39
- * @ignore
40
- */
41
- get tertiaryBinding() {
42
- return this.buttonType === 'tertiary';
43
- }
44
- /**
45
- * Adds class btn-small to the host if the buttonSize = small.
46
- * @ignore
47
- */
48
- get smallBinding() {
49
- return this.buttonSize === 'small';
50
- }
51
- /* eslint-disable @angular-eslint/no-empty-lifecycle-method */
52
- ngOnInit() { }
53
- }
54
- GoAButtonComponent.decorators = [
55
- { type: Component, args: [{
56
- selector:
57
- // eslint-disable-next-line @angular-eslint/component-selector
58
- 'button[goa-button], input[type="button"][goa-button], input[type="submit"][goa-button]',
59
- template: "<ng-content></ng-content>\n",
60
- styles: [":host.goa-button{box-sizing:border-box;min-width:70px;padding:12px;border:2px solid #0070c4;border-radius:4px;background:#0070c4;cursor:pointer;color:#fff;font-size:18px;font-weight:700;line-height:1em}:host.goa-button.btn-small{font-size:16px;padding:8px;margin:12px 12px 0 0}:host.goa-button:last-of-type{margin-right:0}:host.goa-button:disabled,:host.goa-button:disabled.goa--secondary,:host.goa-button:disabled.goa--tertiary{pointer-events:none;color:#666;background-color:#f1f1f1;border-color:#f1f1f1}:host.goa-button:hover{border-color:#004f84;background:#004f84}:host.goa-button:focus,:host.goa-button:active{border-color:#004f84;box-shadow:0 0 0 3px #feba35;background:#004f84;outline:none}:host.goa-button.goa--secondary{border:2px solid #0070c4;background:#fff;color:#0070c4}:host.goa-button.goa--secondary:hover{border-color:#004f84;background:#fff;color:#004f84}:host.goa-button.goa--secondary:focus,:host.goa-button.goa--secondary:active{color:#004f84;background-color:#fff;border:2px solid #004f84;box-shadow:0 0 0 3px #feba35;outline:none}:host.goa-button.goa--tertiary{border-color:#dcdcdc;background:#fff;color:#0070c4}:host.goa-button.goa--tertiary:hover{background:#fff;color:#004f84}:host.goa-button.goa--tertiary:focus,:host.goa-button.goa--tertiary:active{border:2px solid #004f84;color:#004f84;background-color:#fff;box-shadow:0 0 0 3px #feba35;outline:none}:host.goa-button.goa--borderless{background:none;color:var(--color-blue-500);border:none;transition:transform .1s ease-in-out;transform:scale(1)}:host.goa-button.goa--borderless:hover{background:var(--color-blue-100);color:var(--color-blue-500)}:host.goa-button.goa--borderless:focus,:host.goa-button.goa--borderless:active{background-color:var(--color-blue-100);outline:none;box-shadow:none}:host.goa-button.goa--borderless:active{transform:scale(.95)}:host.goa-button.goa--red{color:var(--color-red-500);background:none;border:none;transition:transform .1s ease-in-out;transform:scale(1)}:host.goa-button.goa--red:hover{background:var(--color-red-100);color:var(--color-red-500)}:host.goa-button.goa--red:focus,:host.goa-button.goa--red:active{background:var(--color-red-100);color:var(--color-red-500);outline:none;box-shadow:none}:host.goa-button.goa--red:active{transform:scale(.95)}\n"]
61
- },] }
62
- ];
63
- GoAButtonComponent.ctorParameters = () => [];
64
- GoAButtonComponent.propDecorators = {
65
- primaryBinding: [{ type: HostBinding, args: ['class.goa-button',] }],
66
- secondaryBinding: [{ type: HostBinding, args: ['class.goa--secondary',] }],
67
- tertiaryBinding: [{ type: HostBinding, args: ['class.goa--tertiary',] }],
68
- smallBinding: [{ type: HostBinding, args: ['class.btn-small',] }],
69
- buttonType: [{ type: Input }],
70
- buttonSize: [{ type: Input }]
71
- };
72
-
73
- /**
74
- * A logo for a Government of Alberta hosted microsite.
75
- * selector: goa-microsite-logo
76
- */
77
- class GoAMicrositeLogoComponent {
78
- constructor() {
79
- /**
80
- * The home page URL of the microsite.
81
- */
82
- this.serviceHome = 'https://www.alberta.ca/index.aspx';
83
- }
84
- /**
85
- * @ignore
86
- */
87
- ngOnInit() {
88
- if (this.serviceName === undefined || this.serviceName === null) {
89
- throw new TypeError(`Input 'serviceName' is required.`);
90
- }
91
- }
92
- }
93
- GoAMicrositeLogoComponent.decorators = [
94
- { type: Component, args: [{
95
- selector: 'goa-microsite-logo',
96
- template: "<a href=\"{{serviceHome}}\" attr.aria-label=\"{{serviceHome}}\" class=\"microsite-link\">\n <span class=\"image-desktop-tablet\"></span>\n <span class=\"image-mobile\"></span>\n <span class=\"name\">\n {{serviceName}}\n </span>\n</a>\n",
97
- styles: ["a.microsite-link{color:inherit;text-decoration:none;white-space:nowrap;display:flex;align-items:center;height:66px}a.microsite-link:focus,a.microsite-link:hover,a.microsite-link:active{outline:none}a.microsite-link .image-desktop-tablet{width:150px;height:42px;display:inline-block;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='149.351' height='42' viewBox='0 0 149.351 42'%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill:none;%7D.b%7Bclip-path:url(%23a);%7D.c%7Bfill:%2300aad2;%7D.d%7Bfill:%235f6a72;%7D%3C/style%3E%3CclipPath id='a'%3E%3Crect class='a' width='149.351' height='42'/%3E%3C/clipPath%3E%3C/defs%3E%3Cg class='b'%3E%3Crect class='c' width='13.555' height='13.555' transform='translate(135.796 21.524)'/%3E%3Cpath class='d' d='M63.082,33.088c-1.383.138-2.835.277-4.357.346.553-4.357,2.835-10.373,5.671-9.405,1.66.553.761,5.671-1.314,9.059m-3.527,2.974a3.761,3.761,0,0,1-1.245,0,.851.851,0,0,0,.346-.692v-.553c.761,0,1.936-.138,3.389-.277a4.327,4.327,0,0,1-2.49,1.521M76.844,25.688c1.8-1.66,2.7-1.521,2.9-1.106.484.968-1.591,4.357-5.671,6.224a10.328,10.328,0,0,1,2.766-5.118m66.736,1.66c-.207-3.389-3.181-3.942-3.6-2.974-.138.346,1.106.207,1.106,2.628,0,3.942-4.011,9.129-9.129,9.129-5.532,0-6.985-4.357-7.261-6.432-.207-1.452.138-3.458-2.351-3.181-1.729.207-3.25,3.527-5.463,6.362-1.867,2.42-2.7,2.213-2.282.138.553-2.628,2.7-8.714,5.187-9.129,1.176-.207,1.591,1.8,2.075.553s.069-4.011-2.559-4.011c-1.8,0-3.942,1.936-5.74,4.08-1.521,1.936-9.336,13.416-12.656,10.927-1.521-1.176-1.383-5.878-.415-11.411,3.873-1.521,7.123-1.037,8.921-.138.9.415,1.037.346.622-.622-.553-1.452-3.665-3.734-8.575-2.7-.138,0-.207.069-.346.069.415-1.8.83-3.665,1.383-5.463.484-1.66,1.8-4.5-1.729-4.979-1.106-.207-.622.346-1.037,1.867-.692,2.766-1.521,6.362-2.144,10.028a19.745,19.745,0,0,0-7.538,8.091,38.59,38.59,0,0,0,.9-4.772,1.589,1.589,0,0,0-1.245-1.729c-.761-.207-1.729.138-2.628,1.452-2.144,3.043-4.841,7.815-8.99,9.82-2.974,1.452-4.288,0-4.357-2.282a9.869,9.869,0,0,0,1.521-.553c5.394-2.351,7.192-5.947,5.878-8.16-1.314-2.075-4.979-1.452-7.953,1.66a11.175,11.175,0,0,0-2.7,6.5c-1.245.277-2.628.484-4.219.692,2.49-4.08,2.282-9.613-1.383-10.581-4.288-1.106-6.432,3.043-7.331,6.5.346-3.873.9-7.745,1.591-11.549.346-1.66,1.452-4.5-2.075-4.979-1.106-.207-.968.346-.9,1.867.138,2.075-2.144,14.454-.968,19.848-1.521.484-2.144,1.66-.207,2.835,1.383.83,4.357,1.106,7.331-.346a9.3,9.3,0,0,0,2.766-2.144c1.8-.207,3.665-.553,5.394-.83.277,2.42,1.867,4.219,5.463,3.873,5.118-.484,9.682-6.777,11.411-9.82-.346,3.25-2.42,10.373,1.176,10.028,1.383-.138.83-.346.9-1.591.346-4.288,3.873-7.953,7.4-10.166-.622,5.256-.415,9.958,2.006,11.411,4.426,2.766,10.581-4.5,14.039-8.921-1.729,3.942-2.7,8.921-.138,9.682,3.043.9,5.463-4.219,8.3-8.091.346,2.766,2.213,7.607,9.682,7.607,8.022-.069,13.071-4.91,12.863-10.1m-108.3,8.645A66.439,66.439,0,0,1,27.4,32.534a59.168,59.168,0,0,0,6.777-2.974,54.453,54.453,0,0,0,1.106,6.432m20.4,3.873c-.069-.207-.622.069-1.106,0-1.452-.207-3.389-2.213-3.942-5.463-1.037-5.878-.415-11.687,1.314-20.332.346-1.66,1.452-4.5-2.075-5.048-1.106-.138-.553.415-.83,1.867C47.66,17.32,42.4,21.954,37.149,25.066,36.6,17.735,36.8,9.505,38.186,4.526c1.176-4.219,2.559-3.458.83-4.357s-3.734.277-5.325,3.458S24.839,23.89,13.221,35.439C7.273,41.317,1.879,38.274.842,37.375c-.9-.761-1.176.415-.138,1.591,4.772,5.256,11.826,2.282,14.384-.277,7.054-7.054,15.283-22.268,18.6-28.7a98.251,98.251,0,0,0,.277,16.874,50.129,50.129,0,0,1-8.3,3.181c-1.66.415-2.7,1.106-2.7,1.867s1.106,1.521,2.7,2.282c2.835,1.383,11.2,5.256,13.209,6.5,1.729,1.037,2.628.207,3.112-.9.692-1.452-1.176-2.282-2.974-2.766a60.545,60.545,0,0,1-1.66-9.267c4.219-2.628,8.437-6.086,10.788-10.443C47.522,20.916,46,33.3,49.873,38.482a5.451,5.451,0,0,0,4.564,2.213c.968-.069,1.383-.692,1.245-.83' transform='translate(-0.038 0.124)'/%3E%3C/g%3E%3C/svg%3E\");background-repeat:no-repeat;background-size:contain;background-position:center center}@media screen and (max-width: 767px){a.microsite-link .image-desktop-tablet{display:none}}@media screen and (min-width: 768px) and (max-width: 1199px){a.microsite-link .image-mobile{display:none}}@media screen and (min-width: 1200px){a.microsite-link .image-mobile{display:none}}@media screen and (max-width: 767px){a.microsite-link .image-mobile{width:34px;height:34px;display:inline-block;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='16' height='16' viewBox='0 0 16 16'%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill:none;%7D.b%7Bfill:%2300aad2;%7D.c%7Bclip-path:url(%23a);%7D.d%7Bfill:%23fff;%7D%3C/style%3E%3CclipPath id='a'%3E%3Crect class='a' width='14' height='14' transform='translate(-0.345 -0.21)'/%3E%3C/clipPath%3E%3C/defs%3E%3Cg transform='translate(0 -0.135)'%3E%3Ccircle class='b' cx='8' cy='8' r='8' transform='translate(0 0.135)'/%3E%3Cg transform='translate(1.345 1.344)'%3E%3Cg class='c' transform='translate(0 0)'%3E%3Cpath class='d' d='M12.612,13.636a16.24,16.24,0,0,1-1.86-.822,13.436,13.436,0,0,0,1.6-.708,11.312,11.312,0,0,0,.264,1.53M16.032,7.3c-.266-.034-.128.091-.2.442a5.465,5.465,0,0,1-2.8,3.338,16.141,16.141,0,0,1,.249-4.84c.275-1,.6-.813.2-1.022-.427-.22-.887.071-1.258.813A27.247,27.247,0,0,1,7.4,13.522a2.141,2.141,0,0,1-2.918.461c-.206-.174-.282.095-.026.37a2.412,2.412,0,0,0,3.387-.082A32.715,32.715,0,0,0,12.219,7.51a23.541,23.541,0,0,0,.063,3.971,11.464,11.464,0,0,1-1.964.749c-.388.1-.628.26-.635.439-.007.2.253.363.63.541.67.318,2.633,1.246,3.117,1.527.414.24.616.053.739-.207.16-.338-.279-.533-.7-.661a13.175,13.175,0,0,1-.382-2.179,7.143,7.143,0,0,0,2.547-2.454,4.7,4.7,0,0,0,.4-1.133,2.125,2.125,0,0,0,.048-.742s-.007-.054-.048-.059' transform='translate(-3.51 -3.943)'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E\");background-repeat:no-repeat;background-size:contain;background-position:center center}}a.microsite-link .name{margin-left:8px;font-size:16px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@media screen and (min-width: 1200px){a.microsite-link .name{margin-left:28px}}@media screen and (min-width: 768px) and (max-width: 1199px){a.microsite-link .name{margin-left:28px}}\n"]
98
- },] }
99
- ];
100
- GoAMicrositeLogoComponent.ctorParameters = () => [];
101
- GoAMicrositeLogoComponent.propDecorators = {
102
- serviceName: [{ type: Input }],
103
- serviceHome: [{ type: Input }]
104
- };
105
-
106
- /**
107
- * A header component for a Government of Alberta hosted microsite.
108
- * selector: goa-header
109
- */
110
- class GoAHeaderComponent {
111
- // ServiceLevel = this.ServiceLevel;
112
- constructor() {
113
- /**
114
- * The home page URL of the microsite.
115
- */
116
- this.serviceHome = 'https://www.alberta.ca/index.aspx';
117
- }
118
- /**
119
- * @ignore
120
- */
121
- ngOnInit() {
122
- this.checkRequiredProps('serviceLevel', 'serviceName', 'serviceHome');
123
- }
124
- serviceLevelCssClass() {
125
- return `service-level--${this.serviceLevel.toLowerCase()}`;
126
- }
127
- serviceLevelFormatted() {
128
- return this.serviceLevel.toLowerCase();
129
- }
130
- checkRequiredProps(...props) {
131
- props.forEach(prop => {
132
- if (!this[prop]) {
133
- throw new TypeError(`Input '${prop}' is required.`);
134
- }
135
- });
136
- }
137
- }
138
- GoAHeaderComponent.decorators = [
139
- { type: Component, args: [{
140
- selector: 'goa-header',
141
- template: "<header class=\"goa-header goa-official-site-header\">\n <div>\n <span class=\"service-level\" [ngClass]=\"serviceLevelCssClass()\">\n {{ serviceLevelFormatted() }}\n </span>\n </div>\n <div\n *ngIf=\"serviceLevel === 'live'; else elseNotLive\"\n class=\"site-text\"\n i18n=\"Alberta.ca official site text on header\"\n >\n An official site of the\n <a href=\"https://www.alberta.ca/index.aspx\" class=\"web-link\"\n >Alberta Government</a\n >\n </div>\n <ng-template #elseNotLive>\n <div class=\"site-text\" i18n=\"Alberta.ca site text on header\">\n This is a new\n <a href=\"https://www.alberta.ca/index.aspx\" class=\"web-link\"\n >Alberta Government</a\n >\n service\n </div>\n </ng-template>\n</header>\n<header class=\"goa-header goa-microsite-header\">\n <goa-microsite-logo\n [serviceName]=\"serviceName\"\n [serviceHome]=\"serviceHome\"\n ></goa-microsite-logo>\n <ng-content></ng-content>\n</header>\n",
142
- styles: [".goa-header{display:flex;align-items:center;padding-left:28px;padding-right:28px}@media screen and (min-width: 768px) and (max-width: 1199px){.goa-header{padding-left:28px;padding-right:28px}}@media screen and (max-width: 767px){.goa-header{padding-left:28px;padding-right:28px}}.goa-header.goa-microsite-header,.goa-header>.goa-microsite-header{background-color:#fff;top:0;display:flex;justify-content:space-between}.goa-header.goa-official-site-header,.goa-header>.goa-official-site-header{font-size:12px;background-color:#f1f1f1;line-height:22px}.goa-header.goa-official-site-header .site-text,.goa-header>.goa-official-site-header .site-text{white-space:nowrap;padding:0 4px}.goa-header.goa-official-site-header .service-level,.goa-header>.goa-official-site-header .service-level{padding:0 3px;font-weight:bold;vertical-align:baseline;text-transform:capitalize}.goa-header.goa-official-site-header .service-level--alpha,.goa-header>.goa-official-site-header .service-level--alpha{background-color:#feba35;color:#333}.goa-header.goa-official-site-header .service-level--beta,.goa-header>.goa-official-site-header .service-level--beta{background-color:#0081a2;color:#fff}.goa-header.goa-official-site-header .service-level--live,.goa-header>.goa-official-site-header .service-level--live{height:16px;width:16px;padding:0;color:transparent;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='16' height='16' viewBox='0 0 16 16'%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill:none;%7D.b%7Bfill:%2300aad2;%7D.c%7Bclip-path:url(%23a);%7D.d%7Bfill:%23fff;%7D%3C/style%3E%3CclipPath id='a'%3E%3Crect class='a' width='14' height='14' transform='translate(-0.345 -0.21)'/%3E%3C/clipPath%3E%3C/defs%3E%3Cg transform='translate(0 -0.135)'%3E%3Ccircle class='b' cx='8' cy='8' r='8' transform='translate(0 0.135)'/%3E%3Cg transform='translate(1.345 1.344)'%3E%3Cg class='c' transform='translate(0 0)'%3E%3Cpath class='d' d='M12.612,13.636a16.24,16.24,0,0,1-1.86-.822,13.436,13.436,0,0,0,1.6-.708,11.312,11.312,0,0,0,.264,1.53M16.032,7.3c-.266-.034-.128.091-.2.442a5.465,5.465,0,0,1-2.8,3.338,16.141,16.141,0,0,1,.249-4.84c.275-1,.6-.813.2-1.022-.427-.22-.887.071-1.258.813A27.247,27.247,0,0,1,7.4,13.522a2.141,2.141,0,0,1-2.918.461c-.206-.174-.282.095-.026.37a2.412,2.412,0,0,0,3.387-.082A32.715,32.715,0,0,0,12.219,7.51a23.541,23.541,0,0,0,.063,3.971,11.464,11.464,0,0,1-1.964.749c-.388.1-.628.26-.635.439-.007.2.253.363.63.541.67.318,2.633,1.246,3.117,1.527.414.24.616.053.739-.207.16-.338-.279-.533-.7-.661a13.175,13.175,0,0,1-.382-2.179,7.143,7.143,0,0,0,2.547-2.454,4.7,4.7,0,0,0,.4-1.133,2.125,2.125,0,0,0,.048-.742s-.007-.054-.048-.059' transform='translate(-3.51 -3.943)'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E\");background-repeat:no-repeat;background-size:contain;background-position:center center}.goa-header .web-link{color:#0070c4;text-align:left}\n"]
143
- },] }
144
- ];
145
- GoAHeaderComponent.ctorParameters = () => [];
146
- GoAHeaderComponent.propDecorators = {
147
- serviceName: [{ type: Input }],
148
- serviceHome: [{ type: Input }],
149
- serviceLevel: [{ type: Input }]
150
- };
151
-
152
- /**
153
- * Styles an anchor Design system compliant.
154
- * selector: a[goa-button]
155
- * @example <a goa-button linkType='right' href='...'>Text</a>
156
- */
157
- class GoAButtonLinkComponent {
158
- constructor() {
159
- /**
160
- * The type of arrow to use.
161
- */
162
- this.linkType = 'right';
163
- /**
164
- * The size of the button, controls font size and padding.
165
- */
166
- this.buttonSize = 'normal';
167
- }
168
- /**
169
- * Adds class goa-link-button to the host.
170
- * @ignore
171
- */
172
- get primaryBinding() {
173
- return true;
174
- }
175
- /**
176
- * Adds class right-arrow to the host if the linkType = right.
177
- * @ignore
178
- */
179
- get rightBinding() {
180
- return this.linkType === 'right';
181
- }
182
- /**
183
- * Adds class right-arrow to the host if the linkType = right.
184
- * @ignore
185
- */
186
- get upBinding() {
187
- return this.linkType === 'up';
188
- }
189
- /**
190
- * Adds class btn-small to the host if the buttonSize = small.
191
- * @ignore
192
- */
193
- get smallBinding() {
194
- return this.buttonSize === 'small';
195
- }
196
- /* eslint-disable @angular-eslint/no-empty-lifecycle-method */
197
- ngOnInit() { }
198
- }
199
- GoAButtonLinkComponent.decorators = [
200
- { type: Component, args: [{
201
- // eslint-disable-next-line @angular-eslint/component-selector
202
- selector: 'a[goa-button]',
203
- template: "<span>\n <ng-content></ng-content>\n</span>",
204
- styles: ["@charset \"UTF-8\";:host.goa-link-button{display:inline-block;text-decoration:none}:host.goa-link-button{box-sizing:border-box;min-width:70px;padding:12px;border:2px solid #0070c4;border-radius:4px;background:#0070c4;cursor:pointer;color:#fff;font-size:18px;font-weight:700;line-height:1em}:host.goa-link-button.btn-small{font-size:16px;padding:8px;margin:12px 12px 0 0}:host.goa-link-button:last-of-type{margin-right:0}:host.goa-link-button:disabled,:host.goa-link-button:disabled.goa--secondary,:host.goa-link-button:disabled.goa--tertiary{pointer-events:none;color:#666;background-color:#f1f1f1;border-color:#f1f1f1}:host.goa-link-button:hover{border-color:#004f84;background:#004f84}:host.goa-link-button:focus,:host.goa-link-button:active{border-color:#004f84;box-shadow:0 0 0 3px #feba35;background:#004f84;outline:none}:host.goa-link-button.goa--secondary{border:2px solid #0070c4;background:#fff;color:#0070c4}:host.goa-link-button.goa--secondary:hover{border-color:#004f84;background:#fff;color:#004f84}:host.goa-link-button.goa--secondary:focus,:host.goa-link-button.goa--secondary:active{color:#004f84;background-color:#fff;border:2px solid #004f84;box-shadow:0 0 0 3px #feba35;outline:none}:host.goa-link-button.goa--tertiary{border-color:#dcdcdc;background:#fff;color:#0070c4}:host.goa-link-button.goa--tertiary:hover{background:#fff;color:#004f84}:host.goa-link-button.goa--tertiary:focus,:host.goa-link-button.goa--tertiary:active{border:2px solid #004f84;color:#004f84;background-color:#fff;box-shadow:0 0 0 3px #feba35;outline:none}:host.goa-link-button.goa--borderless{background:none;color:var(--color-blue-500);border:none;transition:transform .1s ease-in-out;transform:scale(1)}:host.goa-link-button.goa--borderless:hover{background:var(--color-blue-100);color:var(--color-blue-500)}:host.goa-link-button.goa--borderless:focus,:host.goa-link-button.goa--borderless:active{background-color:var(--color-blue-100);outline:none;box-shadow:none}:host.goa-link-button.goa--borderless:active{transform:scale(.95)}:host.goa-link-button.goa--red{color:var(--color-red-500);background:none;border:none;transition:transform .1s ease-in-out;transform:scale(1)}:host.goa-link-button.goa--red:hover{background:var(--color-red-100);color:var(--color-red-500)}:host.goa-link-button.goa--red:focus,:host.goa-link-button.goa--red:active{background:var(--color-red-100);color:var(--color-red-500);outline:none;box-shadow:none}:host.goa-link-button.goa--red:active{transform:scale(.95)}:host.goa-link-button.right-arrow:after{color:#fff;margin-left:8px;content:\"\\2192\"}:host.goa-link-button.up-arrow:after{color:#fff;margin-left:8px;content:\"\\2191\"}:host.goa-link-button:visited,:host.goa-link-button:link{color:#fff}\n"]
205
- },] }
206
- ];
207
- GoAButtonLinkComponent.ctorParameters = () => [];
208
- GoAButtonLinkComponent.propDecorators = {
209
- primaryBinding: [{ type: HostBinding, args: ['class.goa-link-button',] }],
210
- rightBinding: [{ type: HostBinding, args: ['class.right-arrow',] }],
211
- upBinding: [{ type: HostBinding, args: ['class.up-arrow',] }],
212
- smallBinding: [{ type: HostBinding, args: ['class.btn-small',] }],
213
- linkType: [{ type: Input }],
214
- buttonSize: [{ type: Input }]
215
- };
216
-
217
- /**
218
- * Option component with to use with GoADropdown.
219
- * selector: goa-option
220
- */
221
- class GoAOptionComponent {
222
- constructor() {
223
- /**
224
- * Is the option currently selected
225
- * @ignore
226
- */
227
- this.selected = false;
228
- /**
229
- * Is the option selected by default?
230
- */
231
- this.defaultSelected = false;
232
- }
233
- /**
234
- * Lifecycle hook OnInit
235
- * @ignore
236
- */
237
- ngOnInit() {
238
- if (this.id === undefined || this.id === null) {
239
- throw new TypeError(`Input 'id' is required.`);
240
- }
241
- if (this.label === undefined || this.label === null) {
242
- throw new TypeError(`Input 'label' is required.`);
243
- }
244
- this.selected = this.defaultSelected;
245
- }
246
- }
247
- GoAOptionComponent.decorators = [
248
- { type: Component, args: [{
249
- selector: 'goa-option',
250
- template: "<ng-template #optionTemplate>\n <div class=\"goa-option\">\n <ng-content></ng-content>\n </div>\n</ng-template>",
251
- changeDetection: ChangeDetectionStrategy.OnPush,
252
- styles: [""]
253
- },] }
254
- ];
255
- GoAOptionComponent.ctorParameters = () => [];
256
- GoAOptionComponent.propDecorators = {
257
- id: [{ type: Input }],
258
- value: [{ type: Input }],
259
- label: [{ type: Input }],
260
- defaultSelected: [{ type: Input }],
261
- optionTemplate: [{ type: ViewChild, args: ['optionTemplate',] }]
262
- };
263
-
264
- /**
265
- * Option grouping component with to use with GoADropdown.
266
- * selector: goa-option-group
267
- */
268
- class GoAOptionGroupComponent {
269
- constructor(cdr) {
270
- this.cdr = cdr;
271
- }
272
- /**
273
- * Lifecycle hook OnInit
274
- * @ignore
275
- */
276
- ngOnInit() {
277
- if (this.label === undefined || this.label === null || this.label === '') {
278
- throw new TypeError(`The input 'label' is required.`);
279
- }
280
- }
281
- /**
282
- * Lifecycle hook AfterViewInit
283
- * @ignore
284
- */
285
- ngAfterViewInit() {
286
- this._filteredOptions = [...this.options];
287
- // The template output cache is populated by child components during render, so tell angular that
288
- // there have been changes during the render here.
289
- this.cdr.detectChanges();
290
- }
291
- }
292
- GoAOptionGroupComponent.decorators = [
293
- { type: Component, args: [{
294
- selector: 'goa-option-group',
295
- template: "<!--Grab the <option> template from the GoAOption -->\n<ng-template #optionGroupTemplate>\n <div class=\"goa-option-group\">\n {{label}}\n <div class=\"group-options\">\n <ng-container class=\"goa-option\"> \n <ng-template *ngFor=\"let option of _filteredOptions\" [ngTemplateOutlet]=\"option.optionTemplate\"></ng-template>\n </ng-container>\n </div>\n </div>\n</ng-template>",
296
- styles: [".goa-option-group{font-weight:bold}.goa-option-group .group-options{padding-left:1em;font-weight:normal}\n"]
297
- },] }
298
- ];
299
- GoAOptionGroupComponent.ctorParameters = () => [
300
- { type: ChangeDetectorRef }
301
- ];
302
- GoAOptionGroupComponent.propDecorators = {
303
- label: [{ type: Input }],
304
- options: [{ type: ContentChildren, args: [GoAOptionComponent, { descendants: true },] }],
305
- optionGroupTemplate: [{ type: ViewChild, args: ['optionGroupTemplate',] }]
306
- };
307
-
308
- /**
309
- * A dropdown component with Government of Alberta styling.
310
- * selector: goa-dropdown
311
- */
312
- class GoADropdownComponent {
313
- constructor(cdr) {
314
- this.cdr = cdr;
315
- /**
316
- * boolean for if the dropdown is open.
317
- * @ignore
318
- */
319
- this._isOpen = false;
320
- /**
321
- * Is the required error tripped?
322
- * @ignore
323
- */
324
- this._requiredError = false;
325
- /**
326
- * This position config ensures that the top "start" corner of the overlay
327
- * is aligned with with the bottom "start" of the origin by default (overlapping
328
- * the trigger completely). If the panel cannot fit below the trigger, it
329
- * will fall back to a position above the trigger.
330
- * @ignore
331
- */
332
- this._positions = [
333
- {
334
- originX: 'start',
335
- originY: 'bottom',
336
- overlayX: 'start',
337
- overlayY: 'top',
338
- },
339
- {
340
- originX: 'start',
341
- originY: 'top',
342
- overlayX: 'start',
343
- overlayY: 'bottom',
344
- },
345
- ];
346
- /**
347
- * All options currently matching filter including groups.
348
- * @ignore
349
- */
350
- this._allFilteredOptions = [];
351
- /**
352
- * Whats the mode for typeahead.
353
- */
354
- this.typeaheadMode = 'none';
355
- /**
356
- * Is the select disabled.
357
- */
358
- this.disabled = false;
359
- /**
360
- * @ignore
361
- */
362
- this._multiple = false;
363
- /**
364
- * @ignore
365
- */
366
- this._required = false;
367
- /**
368
- * Event emitted containing the value field of all selected options when the selection changes.
369
- */
370
- this.selectionChange = new EventEmitter();
371
- }
372
- /**
373
- * Update the selected options, select the options with the given ids
374
- */
375
- set selectedIds(ids) {
376
- if (this.allOptions === undefined) {
377
- // aren't initialized yet, return
378
- return;
379
- }
380
- if (ids === null || ids === undefined) {
381
- ids = [];
382
- }
383
- if (ids.length > 1 && this.multiple === false) {
384
- throw new Error('Cannot select multiple options when the dropdown has multiple set to false.');
385
- }
386
- const selectedOptions = [];
387
- this.allOptions.forEach(option => {
388
- if (ids.includes(option.id)) {
389
- option.selected = true;
390
- selectedOptions.push(option);
391
- }
392
- else {
393
- option.selected = false;
394
- }
395
- });
396
- this.selectionChanged(selectedOptions, true);
397
- }
398
- /**
399
- * Is multiple selection?
400
- */
401
- set multiple(value) {
402
- this._multiple = value;
403
- if (this._multiple === false) {
404
- // If we have changed from multiple to no multiple then deselect everything.
405
- this.selectedItems.forEach(option => {
406
- option.selected = false;
407
- });
408
- }
409
- }
410
- get multiple() {
411
- return this._multiple;
412
- }
413
- /**
414
- * Is a selection required?
415
- */
416
- set required(value) {
417
- this._required = value;
418
- this._requiredError = this.selectedItems.length === 0 && this._required === true;
419
- }
420
- get required() {
421
- return this._required;
422
- }
423
- /**
424
- * Lifecycle hook OnInit
425
- * @ignore
426
- */
427
- /* eslint-disable @angular-eslint/no-empty-lifecycle-method */
428
- ngOnInit() { }
429
- /**
430
- * Lifecycle hook AfterViewInit
431
- * @ignore
432
- */
433
- ngAfterViewInit() {
434
- this._triggerRect = this.textInput.nativeElement.getBoundingClientRect();
435
- this._filteredOptions = [...this.options];
436
- this._allFilteredOptions = [...this.allOptions];
437
- if (this.selectedItems.length > 0) {
438
- this.setTextInput(this.selectedItems[0].label);
439
- }
440
- // The template output cache is populated by child components during render,
441
- // so tell angular that there have been changes during the render here.
442
- this.cdr.detectChanges();
443
- }
444
- /**
445
- * Called when user updates the text in the searchbox.
446
- * @param text The text of the input
447
- * @ignore
448
- */
449
- onFilterChange(text) {
450
- // open the dropdown if it is not already
451
- if (!this._isOpen === true) {
452
- this._isOpen = true;
453
- }
454
- this.filterOptions(text);
455
- }
456
- /**
457
- * Handler for keyboard events when menu is open.
458
- * @param event keyboard event
459
- * @ignore
460
- */
461
- overlayKeydown(event) {
462
- if (event.code === 'Enter' || event.code === 'NumpadEnter') {
463
- this.optionClicked(this._activeOption);
464
- }
465
- else if (event.code === 'ArrowDown') {
466
- this._activeIndex = (this._activeIndex + 1) % this._allFilteredOptions.length;
467
- this._activeOption = this._allFilteredOptions[this._activeIndex];
468
- }
469
- else if (event.code === 'ArrowUp') {
470
- if (this._activeIndex > 0) {
471
- this._activeIndex = this._activeIndex - 1;
472
- this._activeOption = this._allFilteredOptions[this._activeIndex];
473
- }
474
- }
475
- }
476
- /**
477
- * Sets the active option. Active option is the option that when enter is pressed is selected.
478
- * @param option The option to make the active option
479
- * @ignore
480
- */
481
- setActiveOption(option) {
482
- this._activeOption = option;
483
- this._activeIndex = this._allFilteredOptions.findIndex((filteredOption) => filteredOption.id === option.id);
484
- }
485
- /**
486
- * Handler for when the input is clicked.
487
- * @ignore
488
- */
489
- inputClicked() {
490
- if (this.disabled === false) {
491
- this._isOpen = !this._isOpen;
492
- // set the active option to the first in the list
493
- if (this._allFilteredOptions.length > 0) {
494
- this._activeOption = this._allFilteredOptions[0];
495
- this._activeIndex = 0;
496
- }
497
- }
498
- }
499
- /**
500
- * Handler for when descendant an option is clicked.
501
- * @ignore
502
- */
503
- optionClicked(option) {
504
- let selectedOptions = [];
505
- if (this.multiple === true) {
506
- option.selected = !option.selected;
507
- selectedOptions = this.selectedItems;
508
- }
509
- else {
510
- option.selected = !option.selected;
511
- this.selectedItems.forEach((o) => {
512
- if (option.id !== o.id) {
513
- // change all options that weren't selected to false without notifying change
514
- o.selected = false;
515
- }
516
- selectedOptions = [option];
517
- });
518
- }
519
- this.selectionChanged(selectedOptions, true);
520
- if (this.multiple === false) {
521
- // close the dropdown if we are in single selection mode
522
- this._isOpen = false;
523
- }
524
- }
525
- /**
526
- * Update view when selection changes
527
- * @param options
528
- * @ignore
529
- */
530
- selectionChanged(options, emitEvent) {
531
- if (options.length > 0) {
532
- const selectedOptions = options.map(o => o.label).join(', ');
533
- this._requiredError = false;
534
- this.setTextInput(selectedOptions);
535
- }
536
- else {
537
- this._requiredError = this.required;
538
- this.setTextInput('');
539
- }
540
- if (emitEvent === true) {
541
- this.emitChange(options);
542
- }
543
- }
544
- /**
545
- * Emit selection change
546
- * @ignore
547
- */
548
- emitChange(options) {
549
- const values = options.map((option) => option.value);
550
- this.selectionChange.emit(values);
5
+ class ValueDirective {
6
+ constructor(elementRef) {
7
+ this.elementRef = elementRef;
8
+ this._value = "";
9
+ /* eslint-disable @typescript-eslint/no-explicit-any */
10
+ this.onChange = () => { };
11
+ this.onTouched = () => { };
551
12
  }
552
- /**
553
- * Gets all the currently selected options
554
- * @ignore
555
- */
556
- get selectedItems() {
557
- if (this.allOptions === undefined) {
558
- return [];
559
- }
560
- return [...this.allOptions.filter((option) => option.selected === true)];
561
- }
562
- /**
563
- * Set the text of the input.
564
- * @param value The value to set
565
- * @ignore
566
- */
567
- setTextInput(value) {
568
- if (this.textInput) {
569
- this.textInput.nativeElement.value = value;
570
- // Exact matches show whole list?
571
- this.filterOptions('');
572
- }
573
- }
574
- /**
575
- * Update the filtered options with the passed in filter text.
576
- * @param filterText The text to filter by
577
- * @ignore
578
- */
579
- filterOptions(filterText) {
580
- this.optionGroups.forEach(group => {
581
- group._filteredOptions = group.options.filter(this.typeaheadFilter.bind(this, filterText, this.typeaheadMode));
582
- });
583
- this._filteredOptions = this.options.filter(this.typeaheadFilter.bind(this, filterText, this.typeaheadMode));
584
- this._allFilteredOptions = this.allOptions.filter(this.typeaheadFilter.bind(this, filterText, this.typeaheadMode));
585
- // The filters have changed so update the active option incase it has been filtered out.
586
- this._activeOption = this._allFilteredOptions[this._activeIndex % this._allFilteredOptions.length];
587
- }
588
- /**
589
- * Filter for typeahead with logic for what mode we are in.
590
- * @param option
591
- * @ignore
592
- */
593
- typeaheadFilter(filterText, typeaheadMode, option) {
594
- if (typeaheadMode === 'none' || this.typeaheadMode === undefined) {
595
- return true;
596
- }
597
- if (typeaheadMode === 'startsWith') {
598
- return option.label.toLocaleLowerCase().startsWith(filterText.toLocaleLowerCase());
599
- }
600
- if (typeaheadMode === 'contains') {
601
- return option.label.toLocaleLowerCase().includes(filterText.toLocaleLowerCase());
602
- }
603
- }
604
- }
605
- GoADropdownComponent.decorators = [
606
- { type: Component, args: [{
607
- selector: 'goa-dropdown',
608
- template: "<div class=\"goa-dropdown\" [ngClass]=\"{\n 'single-selection': multiple === false,\n 'has-error': _requiredError === true,\n 'opened': _isOpen,\n 'disabled': disabled === true\n }\"> \n <label class=\"dropdown-label\">{{label}}\n <span *ngIf=\"required\" class=\"required-label\" i18n=\"Required label for dropdown\">(Required)</span>\n <div (click)=\"inputClicked()\" class=\"dropdown-grouping\" cdkOverlayOrigin #trigger=\"cdkOverlayOrigin\">\n <i class=\"goa-select-icon\"></i>\n <input class=\"dropdown-textbox margin-override\" \n #textInput \n (input)=\"onFilterChange($event.target.value)\"\n type=\"text\" \n [attr.readonly]=\"typeaheadMode === 'none' ? 'readonly' : null\"\n [attr.disabled]=\"disabled === true ? 'true' : null\"\n placeholder=\"{{description}}\"> \n <ng-template\n cdkConnectedOverlay\n cdkConnectedOverlayLockPosition\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayViewportMargin]=\"20\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"_isOpen = false\"\n (overlayKeydown)=\"overlayKeydown($event)\"\n (detach)=\"_isOpen = false\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"_isOpen\"\n [cdkConnectedOverlayPositions]=\"_positions\"\n [cdkConnectedOverlayMinWidth]=\"_triggerRect?.width\"\n [cdkConnectedOverlayHeight]=\"menuHeight\"\n [cdkConnectedOverlayFlexibleDimensions]=\"true\"\n >\n <div class=\"dropdown-menu\">\n <div *ngFor=\"let optionGroup of optionGroups\" class=\"option-group\">\n <div *ngIf=\"optionGroup._filteredOptions.length > 0\">\n <div class=\"option-group-label\">\n {{optionGroup.label}}\n </div>\n <!--Grab the <option> template from the GoAOption -->\n <div class=\"option\"\n [ngClass]=\"{\n 'selected': option.selected,\n 'active': option.id === _activeOption.id\n }\"\n *ngFor=\"let option of (optionGroup._filteredOptions)\" \n (click)=\"optionClicked(option)\"\n (mouseover)=\"setActiveOption(option)\">\n <ng-template [ngTemplateOutlet]=\"option.optionTemplate\"></ng-template>\n </div>\n </div>\n </div>\n <!--Grab the <option> template from the GoAOption -->\n <div class=\"option\" \n [ngClass]=\"{\n 'selected': option.selected,\n 'active': option.id === _activeOption.id\n }\"\n *ngFor=\"let option of (_filteredOptions)\" \n (click)=\"optionClicked(option)\"\n (mouseover)=\"setActiveOption(option)\"> \n <ng-template [ngTemplateOutlet]=\"option.optionTemplate\"></ng-template>\n </div>\n </div> \n </ng-template> \n </div>\n <span *ngIf=\"!_requiredError\" class=\"helper-text\">{{description}}</span>\n <span *ngIf=\"_requiredError === true\" class=\"error-text\" i18n=\"Required warning for dropdown\">At least one item must be selected.</span> \n </label>\n</div>\n",
609
- styles: [".dropdown-overlay{position:absolute;top:0;left:0;right:0;bottom:0}.dropdown-menu{border:solid 1px #dcdcdc;border-radius:4px;background:#fff;padding:0;margin-top:3px;width:100%;overflow-y:auto}.dropdown-menu .option-group .option-group-label{font-weight:bold;padding:4px 12px}.dropdown-menu .option-group .option{font-weight:normal;padding:4px 24px}.dropdown-menu .option{padding:4px 12px;color:#0070c4;border:1px solid #f1f1f1}.dropdown-menu .option.selected{background-color:#0070c4;color:#fff}.dropdown-menu .option.selected.active{background-color:#004f84;color:#fff}.dropdown-menu .option.active{background-color:#f1f1f1;color:#333}.goa-dropdown{position:relative}.goa-dropdown .dropdown-grouping input[type=text]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding-right:30px!important}.goa-dropdown .dropdown-grouping.disabled{opacity:30%}.goa-dropdown .dropdown-grouping .dropdown-textbox{box-sizing:border-box;width:100%;margin:8px 0 0;padding:12px 8px 12px 12px;border-radius:4px;border:1px solid #666;font-size:18px;font-weight:400;color:#0070c4;-webkit-appearance:none;-moz-appearance:none;appearance:none}.goa-dropdown .dropdown-grouping .dropdown-textbox:disabled{opacity:.3;pointer-events:none}.goa-dropdown .dropdown-grouping .dropdown-textbox::-ms-expand{display:none}.goa-dropdown .dropdown-grouping .dropdown-textbox:hover{border:1px solid #0070c4}.goa-dropdown .dropdown-grouping .dropdown-textbox:focus{box-shadow:0 0 0 3px #feba35;outline:none}.goa-dropdown .dropdown-grouping .dropdown-textbox.margin-override{margin:0}.goa-dropdown .dropdown-grouping .dropdown-textbox-filter{font-size:14px!important;border:none!important;margin:0!important}.goa-dropdown .dropdown-grouping .dropdown-textbox-filter{box-sizing:border-box;width:100%;margin:8px 0 0;padding:12px 8px 12px 12px;border-radius:4px;border:1px solid #666;font-size:18px;font-weight:400;color:#0070c4;-webkit-appearance:none;-moz-appearance:none;appearance:none}.goa-dropdown .dropdown-grouping .dropdown-textbox-filter:disabled{opacity:.3;pointer-events:none}.goa-dropdown .dropdown-grouping .dropdown-textbox-filter::-ms-expand{display:none}.goa-dropdown .dropdown-grouping .dropdown-textbox-filter:hover{border:1px solid #0070c4}.goa-dropdown .dropdown-grouping .dropdown-textbox-filter:focus{box-shadow:0 0 0 3px #feba35;outline:none}.goa-dropdown .dropdown-grouping .dropdown-textbox-filter:focus{box-shadow:none!important;outline:none}.goa-dropdown i.goa-select-icon{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cpath class='' opacity='1' d='M11.29,15.7a1,1,0,0,0,1.41,0l6-6A1,1,0,1,0,17.29,8.3L12,13.58,6.71,8.3a1,1,0,0,0-1.42,0,1,1,0,0,0,0,1.41Z'/%3E%3C/svg%3E%0A\");background-repeat:no-repeat;background-size:contain;background-position:center center;left:auto;right:8px;width:24px;height:24px;pointer-events:none;position:absolute;margin-top:16px;color:#0070c4}.goa-dropdown.disabled i.goa-select-icon{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cpath class='' opacity='0.3' d='M11.29,15.7a1,1,0,0,0,1.41,0l6-6A1,1,0,1,0,17.29,8.3L12,13.58,6.71,8.3a1,1,0,0,0-1.42,0,1,1,0,0,0,0,1.41Z'/%3E%3C/svg%3E%0A\");background-repeat:no-repeat;background-size:contain;background-position:center center}.goa-dropdown.opened i.goa-select-icon{transform:rotate(180deg)}.goa-dropdown.has-error .dropdown-grouping .dropdown-textbox{border:solid 2px #fc1921}.goa-dropdown .dropdown-label{font-size:18px;font-weight:bold;color:#333}.goa-dropdown .required-label{margin-left:8px;font-size:14px;color:#666}.goa-dropdown .helper-text{font-size:14px;font-weight:normal;color:#333}.goa-dropdown .error-text{color:#fc1921;font-size:14px}\n"]
610
- },] }
611
- ];
612
- GoADropdownComponent.ctorParameters = () => [
613
- { type: ChangeDetectorRef }
614
- ];
615
- GoADropdownComponent.propDecorators = {
616
- typeaheadMode: [{ type: Input }],
617
- menuHeight: [{ type: Input }],
618
- label: [{ type: Input }],
619
- description: [{ type: Input }],
620
- selectedIds: [{ type: Input }],
621
- disabled: [{ type: Input }],
622
- multiple: [{ type: Input }],
623
- required: [{ type: Input }],
624
- textInput: [{ type: ViewChild, args: ['textInput',] }],
625
- allOptions: [{ type: ContentChildren, args: [GoAOptionComponent, { descendants: true },] }],
626
- options: [{ type: ContentChildren, args: [GoAOptionComponent, { descendants: false },] }],
627
- optionGroups: [{ type: ContentChildren, args: [GoAOptionGroupComponent, { descendants: false },] }],
628
- selectionChange: [{ type: Output }]
629
- };
630
-
631
- const GOA_CHECKBOX_CONTROL_VALUE_ACCESSOR = {
632
- provide: NG_VALUE_ACCESSOR,
633
- useExisting: forwardRef(() => GoACheckboxComponent),
634
- multi: true
635
- };
636
- /**
637
- * Checkbox component with Government of Alberta styling.
638
- * selector: goa-checkbox
639
- */
640
- class GoACheckboxComponent {
641
- constructor(_changeDetectorRef) {
642
- this._changeDetectorRef = _changeDetectorRef;
643
- /**
644
- * @ignore
645
- */
646
- this._indeterminate = false;
647
- /**
648
- * The position to display the label/text for the checbox. Valid values are before and after.
649
- */
650
- this.labelPosition = 'after';
651
- /**
652
- * Event emitted containing the source checkbox, and whether or not it is checked.
653
- */
654
- this.selectionChange = new EventEmitter();
655
- /**
656
- * @ignore
657
- */
658
- this._propagateChange = (_) => { };
659
- this.uniqueId = `goa-checkbox-${GoACheckboxComponent.idNum++}`;
13
+ get value() {
14
+ return this._value;
660
15
  }
661
- /**
662
- * Boolean indicating whether or not the checkbox should display as indeterminate
663
- * (i.e. it has associated 'child' checkboxes, some of which are selected).
664
- */
665
- get indeterminate() { return this._indeterminate; }
666
- set indeterminate(value) {
667
- // only do something if value has changed from current
668
- if (value !== this.indeterminate) {
669
- this._indeterminate = value;
670
- // can't be indeterminate and checked, so clear checked
671
- if (this._indeterminate) {
672
- this.checked = false;
673
- }
16
+ set value(val) {
17
+ if (val !== this._value) {
18
+ this._value = val;
19
+ this.onChange(this._value);
20
+ this.onTouched();
21
+ this.elementRef.nativeElement.value = val;
674
22
  }
675
23
  }
676
- /**
677
- * Boolean indicating if the checkbox is required and not checked
678
- * @ignore
679
- */
680
- hasError() {
681
- return this.required && !this.checked;
682
- }
683
- /**
684
- * Implemented as part of ControlValueAccessor.
685
- * @param value The model bound property, i.e. the value of checked
686
- * @ignore
687
- */
688
24
  writeValue(value) {
689
- if ((value !== undefined) && (value !== null)) {
690
- this.checked = value;
691
- this._changeDetectorRef.detectChanges();
25
+ if (value) {
26
+ this.value = value;
692
27
  }
693
28
  }
694
- /**
695
- * Implemented as part of ControlValueAccessor.
696
- * @param fn The function to call on change. Provided by ControlValueAccessor
697
- * @ignore
698
- */
699
29
  registerOnChange(fn) {
700
- this._propagateChange = fn;
30
+ this.onChange = fn;
701
31
  }
702
- /**
703
- * Implemented as part of ControlValueAccessor.
704
- * @param fn The function to call on touch. Provided by ControlValueAccessor
705
- * @ignore
706
- */
707
32
  registerOnTouched(fn) {
708
- this._onTouchedCallback = fn;
33
+ this.onTouched = fn;
709
34
  }
710
- ;
711
- /**
712
- * Toggles the checked value of the checkbox
713
- * @ignore
714
- */
715
- toggle() {
716
- this.checked = !this.checked;
717
- }
718
- /**
719
- * User interaction event on click of the checkbox or its label to indicate toggling of the current checked status.
720
- * Emits selectionChange to parent components.
721
- * @ignore
722
- */
723
- onChange(event) {
724
- event.stopPropagation();
725
- this.toggle();
726
- // user manually clicking overrides indeterminate and sets it to false
727
- // this is because if they click and set to checked/unchecked, all 'child' checkboxes should get set to
728
- // checked/unchecked (by user routine, not here), so this checkbox is no longer indeterminate
729
- this.indeterminate = false;
730
- const checkBoxChange = {
731
- source: this,
732
- checked: this.checked
733
- };
734
- this._propagateChange(this.checked);
735
- this.selectionChange.emit(checkBoxChange);
736
- }
737
- }
738
- /**
739
- * @ignore
740
- */
741
- GoACheckboxComponent.idNum = 0;
742
- GoACheckboxComponent.decorators = [
743
- { type: Component, args: [{
744
- selector: 'goa-checkbox',
745
- template: "\n<div class=\"goa-checkbox\" [ngClass]=\"{'goa-checkbox-disabled': disabled, 'has-error': hasError(), 'goa-checkbox-label-before': labelPosition === 'before'}\">\n <label class=\"goa-checkbox-layout\" [attr.for]=\"uniqueId\">\n <div class=\"goa-checkbox-container\"\n [ngClass]=\"{'goa-checkbox-selected': checked, 'goa-checkbox-indeterminate': indeterminate}\">\n <input type=\"checkbox\"\n [id]=\"uniqueId\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n [attr.value]=\"value\"\n (change)=\"onChange($event)\"\n />\n <svg *ngIf=\"checked\" id='checkmark' xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 12.18\" class=\"goa-checkmark\">\n <path d=\"M5.09,9.64,1.27,5.82,0,7.09l5.09,5.09L16,1.27,14.73,0Z\"/>\n </svg>\n <svg *ngIf=\"indeterminate\" id='dashmark' xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 15 2\" class=\"goa-indeterminate\">\n <rect width=\"15\" height=\"2\"/>\n </svg>\n </div>\n <div class=\"goa-checkbox-label\">\n <ng-content></ng-content>\n </div>\n </label>\n</div>\n",
746
- //register our custom ControlValueAccessor with angular DI system so angular knows how to get instance of it for ngModel binding
747
- providers: [GOA_CHECKBOX_CONTROL_VALUE_ACCESSOR],
748
- changeDetection: ChangeDetectionStrategy.OnPush,
749
- styles: [".goa-checkbox input[type=checkbox]{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;outline:0;-webkit-appearance:none}.goa-checkbox .goa-checkbox-label{z-index:2;box-sizing:border-box;margin:0;padding:0 0 0 8px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;height:46px;display:flex;align-items:center}.goa-checkbox.goa-checkbox-disabled{opacity:30%}.goa-checkbox.goa-checkbox-disabled .goa-checkbox-label{cursor:default}.goa-checkbox.has-error .goa-checkbox-container{border:solid 2px #fc1921;color:#fc1921}.goa-checkbox.has-error .goa-checkbox-container svg{fill:#fc1921}.goa-checkbox .goa-checkbox-container{box-sizing:border-box;border:1px solid #666;border-radius:2px;height:24px;line-height:24px;width:24px;display:flex;flex-direction:column;justify-content:center;padding:3px}.goa-checkbox .goa-checkbox-container svg{display:none;flex:1 1 auto;fill:#fff}.goa-checkbox .goa-checkbox-container.goa-checkbox-selected{background-color:#0070c4}.goa-checkbox .goa-checkbox-container.goa-checkbox-selected .goa-checkmark{display:block!important}.goa-checkbox .goa-checkbox-container.goa-checkbox-selected .goa-indeterminate{display:none!important}.goa-checkbox .goa-checkbox-container.goa-checkbox-indeterminate{background-color:#0070c4}.goa-checkbox .goa-checkbox-container.goa-checkbox-indeterminate .goa-checkmark{display:none}.goa-checkbox .goa-checkbox-container.goa-checkbox-indeterminate .goa-indeterminate{display:block}.goa-checkbox .goa-checkbox-container:hover:not(.goa-checkbox-selected):not(.goa-checkbox-indeterminate){background-color:#f1f1f1}.goa-checkbox .goa-checkbox-container:focus-within{box-shadow:0 0 0 3px #feba35;outline:none}.goa-checkbox.goa-checkbox-label-before .goa-checkbox-container{order:1;margin-left:8px;margin-right:auto}.goa-checkbox-layout{display:inline-flex;align-items:center;line-height:2.5rem}\n"]
750
- },] }
751
- ];
752
- GoACheckboxComponent.ctorParameters = () => [
753
- { type: ChangeDetectorRef }
754
- ];
755
- GoACheckboxComponent.propDecorators = {
756
- value: [{ type: Input }],
757
- checked: [{ type: Input }],
758
- disabled: [{ type: Input }],
759
- required: [{ type: Input }],
760
- indeterminate: [{ type: Input }],
761
- labelPosition: [{ type: Input }],
762
- selectionChange: [{ type: Output }]
763
- };
764
-
765
- class GoARadioChange {
766
- }
767
-
768
- class GoARadioService {
769
- constructor() {
770
- this.radioChangeMessage = new BehaviorSubject(new GoARadioChange());
771
- }
772
- selectRadio(radioChange) {
773
- this.radioChangeMessage.next(radioChange);
774
- }
775
- }
776
- GoARadioService.ɵprov = i0.ɵɵdefineInjectable({ factory: function GoARadioService_Factory() { return new GoARadioService(); }, token: GoARadioService, providedIn: "root" });
777
- GoARadioService.decorators = [
778
- { type: Injectable, args: [{
779
- providedIn: 'root',
780
- },] }
781
- ];
782
- GoARadioService.ctorParameters = () => [];
783
-
784
- /**
785
- * Control value accessor to use for the component's provider
786
- * @ignore
787
- */
788
- const GOA_RADIO_CONTROL_VALUE_ACCESSOR = {
789
- provide: NG_VALUE_ACCESSOR,
790
- useExisting: forwardRef(() => GoARadioComponent),
791
- multi: true
792
- };
793
- /**
794
- * Radiobutton component with Government of Alberta styling.
795
- */
796
- class GoARadioComponent {
797
- constructor(_changeDetector, _radioService) {
798
- this._changeDetector = _changeDetector;
799
- this._radioService = _radioService;
800
- /**
801
- * The position to display the label/text for the radiobutton. Valid values are before and after.
802
- */
803
- this.labelPosition = 'after';
804
- /**
805
- * Event emitted containing the source radiobutton, and whether or not it is checked.
806
- */
807
- this.selectionChange = new EventEmitter();
808
- /**
809
- * @ignore
810
- */
811
- this._propagateChange = (_) => { };
812
- this.uniqueId = `goa-radiobutton-${GoARadioComponent.idNum++}`;
813
- }
814
- /**
815
- * Lifecycle hook OnInit. Used to subscribe to radio change messages from the radioService in order to know whether or not
816
- * this radio should be checked or not.
817
- * @ignore
818
- */
819
- ngOnInit() {
820
- this.radioServiceSubscription = this._radioService.radioChangeMessage.subscribe(rcm => {
821
- if (rcm && rcm.source && rcm.source.name === this.name && rcm.source.uniqueId !== this.uniqueId) {
822
- this.checked = false;
823
- this._changeDetector.detectChanges();
824
- }
825
- });
826
- }
827
- /**
828
- * Lifecycle hook OnDestroy. Used to unsubscribe from the radio change messages.
829
- * @ignore
830
- */
831
- ngOnDestroy() {
832
- this.radioServiceSubscription.unsubscribe();
833
- }
834
- /**
835
- * Boolean indicating if the radiobutton is required and not checked
836
- * @ignore
837
- */
838
- hasError() {
839
- return this.required && !this.checked;
840
- }
841
- /**
842
- * Marks the radio button as needing checking for change detection.
843
- * This method is exposed because the parent radio group will directly
844
- * update bound properties of the radio button.
845
- */
846
- markForCheck() {
847
- // When group value changes, the button will not be notified. Use `markForCheck` to explicitly
848
- // update radio button's status
849
- this._changeDetector.markForCheck();
850
- }
851
- /**
852
- * Implemented as part of ControlValueAccessor.
853
- * @param value The model bound property, i.e. the value of checked
854
- * @ignore
855
- */
856
- writeValue(value) {
857
- if ((value !== undefined) && (value !== null)) {
858
- this.checked = value;
859
- this._changeDetector.detectChanges();
860
- }
861
- }
862
- /**
863
- * Implemented as part of ControlValueAccessor.
864
- * @param fn The function to call on change. Provided by ControlValueAccessor
865
- * @ignore
866
- */
867
- registerOnChange(fn) {
868
- this._propagateChange = fn;
869
- }
870
- /**
871
- * Implemented as part of ControlValueAccessor.
872
- * @param fn The function to call on touch. Provided by ControlValueAccessor
873
- * @ignore
874
- */
875
- registerOnTouched(fn) {
876
- this._onTouchedCallback = fn;
877
- }
878
- ;
879
- /**
880
- * User interaction event on click of the radiobutton or its label to indicate toggling of the current checked status.
881
- * Emits selectionChange to parent components.
882
- * @ignore
883
- */
884
- onClick() {
885
- // flip the checked state of this radio
886
- this.checked = !this.checked;
887
- // emit radio change event for those interested
888
- const radioChange = {
889
- source: this,
890
- checked: this.checked
891
- };
892
- this._propagateChange(this.checked);
893
- this.selectionChange.emit(radioChange);
894
- // notify other radios in group/with same name via radio service so they know to flip their states to not checked
895
- this._radioService.selectRadio(radioChange);
35
+ listenForValueChange(value) {
36
+ this.value = value;
896
37
  }
897
38
  }
898
- /**
899
- * Used to generate unique Id for this component
900
- * @ignore
901
- */
902
- GoARadioComponent.idNum = 0;
903
- GoARadioComponent.decorators = [
904
- { type: Component, args: [{
905
- selector: 'goa-radio',
906
- template: "<div\n class=\"goa-radio\"\n [ngClass]=\"{\n 'goa-radio-disabled': disabled,\n 'has-error': hasError(),\n 'goa-radio-label-before': labelPosition === 'before'\n }\"\n>\n <div class=\"goa-radio-inline-block\">\n <label class=\"goa-radio-layout\" [attr.for]=\"uniqueId\">\n <div\n class=\"goa-radio-container\"\n [ngClass]=\"{ 'goa-radio-selected': checked }\"\n >\n <input\n type=\"radio\"\n [id]=\"uniqueId\"\n [(checked)]=\"checked\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n [attr.value]=\"value\"\n [name]=\"name\"\n (change)=\"onClick()\"\n />\n <svg\n *ngIf=\"checked\"\n id=\"radiomark\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n >\n <circle\n id=\"Ellipse_128\"\n data-name=\"Ellipse 128\"\n cx=\"6\"\n cy=\"6\"\n r=\"6\"\n fill=\"#fff\"\n />\n </svg>\n </div>\n <span class=\"goa-radio-label\">\n <ng-content></ng-content>\n </span>\n </label>\n </div>\n</div>\n",
907
- //register our custom ControlValueAccessor with angular DI system so angular knows how to get instance of it for ngModel binding
908
- providers: [GOA_RADIO_CONTROL_VALUE_ACCESSOR],
909
- changeDetection: ChangeDetectionStrategy.OnPush,
910
- styles: [".goa-radio{margin-bottom:10px}.goa-radio input[type=radio]{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;outline:0;-webkit-appearance:none}.goa-radio .goa-radio-label{z-index:2;box-sizing:border-box;margin:0;padding:0 0 0 8px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.goa-radio.goa-radio-disabled{opacity:30%}.goa-radio.goa-radio-disabled .goa-radio-label{cursor:default}.goa-radio.has-error .goa-radio-container{border:solid 2px #fc1921;color:#fc1921}.goa-radio.has-error .goa-radio-container svg{fill:#fc1921}.goa-radio .goa-radio-container{z-index:2;box-sizing:border-box;margin:0;border:1px solid #666;border-radius:12px;height:24px;width:24px;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:3px}.goa-radio .goa-radio-container svg{fill:#fff}.goa-radio .goa-radio-container.goa-radio-selected{background-color:#0070c4}.goa-radio .goa-radio-container.goa-radio-selected .goa-radiomark{display:block!important}.goa-radio .goa-radio-container:hover:not(.goa-radio-selected){background-color:#f1f1f1}.goa-radio .goa-radio-container:focus-within{box-shadow:0 0 0 3px #feba35;outline:none}.goa-radio.goa-radio-label-before .goa-radio-container{order:1;margin-left:8px;margin-right:auto}.goa-radio-layout{display:flex;flex-direction:row;align-items:center}.goa-radio-inline-block{display:inline-block;margin-bottom:5px;margin-top:5px;margin-left:5px}\n"]
911
- },] }
912
- ];
913
- GoARadioComponent.ctorParameters = () => [
914
- { type: ChangeDetectorRef },
915
- { type: GoARadioService }
916
- ];
917
- GoARadioComponent.propDecorators = {
918
- name: [{ type: Input }],
919
- value: [{ type: Input }],
920
- checked: [{ type: Input }],
921
- disabled: [{ type: Input }],
922
- required: [{ type: Input }],
923
- labelPosition: [{ type: Input }],
924
- selectionChange: [{ type: Output }]
925
- };
926
-
927
- /**
928
- * Control value accessor to use for the component's provider
929
- * @ignore
930
- */
931
- const GOA_RADIO_GROUP_CONTROL_VALUE_ACCESSOR = {
932
- provide: NG_VALUE_ACCESSOR,
933
- useExisting: forwardRef(() => GoARadioGroupComponent),
934
- multi: true
935
- };
936
- /**
937
- * Injection token that can be used to inject instances of `GoARadioGroupComponent`. It serves as
938
- * alternative token to the actual `GoARadioGroupComponent` class which could cause unnecessary
939
- * retention of the class and its component metadata.
940
- * @ignore
941
- */
942
- const GOA_RADIO_GROUP = new InjectionToken('GoARadioGroup');
943
- /**
944
- * Radiobutton group component with Government of Alberta styling. Used to group a set of related radio buttons.
945
- */
946
- class GoARadioGroupComponent {
947
- constructor(_changeDetector, _radioService) {
948
- this._changeDetector = _changeDetector;
949
- this._radioService = _radioService;
950
- /**
951
- * @ignore
952
- */
953
- this._name = `goa-radio-group-${GoARadioGroupComponent.idNum++}`;
954
- /**
955
- * @ignore
956
- */
957
- this._value = null;
958
- /**
959
- * @ignore
960
- */
961
- this._labelPosition = 'after';
962
- /**
963
- * The error message to display when the radio group selection is required and nothing has been selected
964
- */
965
- this.requiredErrorMessage = 'Please select one of the provided options.';
966
- /**
967
- * Event emitted containing the source radiobutton, and whether or not it is checked.
968
- */
969
- this.selectionChange = new EventEmitter();
970
- /**
971
- * @ignore
972
- */
973
- this._propagateChange = (_) => { };
974
- this.uniqueId = `goa-radiobutton-group-${GoARadioGroupComponent.idNum++}`;
975
- }
976
- /**
977
- * Indicates the "group" or set of radios this radio belongs to.
978
- */
979
- get name() { return this._name; }
980
- set name(value) {
981
- this._name = value;
982
- this._updateRadioButtonNames();
983
- }
984
- /**
985
- * Value/unique identifier for the object the radiobutton represents.
986
- */
987
- get value() { return this._value; }
988
- set value(newValue) {
989
- if (this._value !== newValue) {
990
- // Set this before proceeding to ensure no circular loop occurs with selection.
991
- this._value = newValue;
992
- this._updateSelectedRadioFromValue();
993
- this._setSelectedRadioToChecked();
994
- }
995
- }
996
- /**
997
- * The currently selected radio.
998
- */
999
- get selected() { return this._selected; }
1000
- set selected(selected) {
1001
- this._selected = selected;
1002
- this.value = selected ? selected.value : null;
1003
- this._setSelectedRadioToChecked();
39
+ ValueDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ValueDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
40
+ ValueDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: ValueDirective, selector: "[goaValue]", host: { listeners: { "_change": "listenForValueChange($event.detail.value)" } }, providers: [
41
+ {
42
+ provide: NG_VALUE_ACCESSOR,
43
+ useExisting: forwardRef(() => ValueDirective),
44
+ multi: true,
45
+ },
46
+ ], ngImport: i0 });
47
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ValueDirective, decorators: [{
48
+ type: Directive,
49
+ args: [{
50
+ selector: "[goaValue]",
51
+ providers: [
52
+ {
53
+ provide: NG_VALUE_ACCESSOR,
54
+ useExisting: forwardRef(() => ValueDirective),
55
+ multi: true,
56
+ },
57
+ ],
58
+ }]
59
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { listenForValueChange: [{
60
+ type: HostListener,
61
+ args: ["_change", ["$event.detail.value"]]
62
+ }] } });
63
+ class ValueListDirective {
64
+ constructor(elementRef) {
65
+ this.elementRef = elementRef;
66
+ this._value = [];
67
+ this.onChange = () => { };
68
+ this.onTouched = () => { };
1004
69
  }
1005
- /**
1006
- * Boolean indicating whether or not the radiobutton is disabled.
1007
- */
1008
- get disabled() { return this._disabled; }
1009
- set disabled(value) {
1010
- this._disabled = value;
1011
- this._updateRadioButtonDisabled();
1012
- }
1013
- /**
1014
- * Boolean indicating whether or not the radiobutton is required.
1015
- */
1016
- get required() { return this._required; }
1017
- set required(value) {
1018
- this._required = value;
1019
- this._updateRadioButtonRequired();
1020
- }
1021
- /**
1022
- * The position to display the label/text for the radiobutton. Valid values are before and after.
1023
- */
1024
- get labelPosition() {
1025
- return this._labelPosition;
1026
- }
1027
- set labelPosition(position) {
1028
- this._labelPosition = position === 'before' ? 'before' : 'after';
1029
- this._updateRadioButtonLabelPosition();
1030
- }
1031
- /**
1032
- * Lifecycle hook AfterContentInit. Used to set properties on child radios based on the radio group's properties.
1033
- * @ignore
1034
- */
1035
- ngAfterContentInit() {
1036
- this._updateRadioButtonNames();
1037
- this._updateRadioButtonDisabled();
1038
- this._updateRadioButtonRequired();
1039
- this._updateRadioButtonLabelPosition();
1040
- this._updateSelectedRadioFromValue();
1041
- }
1042
- /**
1043
- * Lifecycle hook OnInit. Used to subscribe to radio change messages from the radioService in order to set the 'selected' property
1044
- * of the radio group based on which radio was selected
1045
- * @ignore
1046
- */
1047
- ngOnInit() {
1048
- this.radioServiceSubscription = this._radioService.radioChangeMessage.subscribe(rcm => {
1049
- if (rcm && rcm.source && rcm.source.name === this.name && rcm.checked) {
1050
- this.selected = this._radios.find(r => r.uniqueId === rcm.source.uniqueId);
1051
- this.selectionChange.emit(rcm);
1052
- }
1053
- });
1054
- }
1055
- /**
1056
- * Lifecycle hook OnDestroy. Used to unsubscribe from the radio change messages.
1057
- * @ignore
1058
- */
1059
- ngOnDestroy() {
1060
- this.radioServiceSubscription.unsubscribe();
1061
- }
1062
- /**
1063
- * Updates the `selected` radio button from the internal _value state.
1064
- */
1065
- _updateSelectedRadioFromValue() {
1066
- // If the value already matches the selected radio, do nothing.
1067
- const isAlreadySelected = this._selected !== undefined && this._selected !== null && this._selected.value === this._value;
1068
- // need to wrap in setTimeout because _radios hasnt resolved yet when Input setter fires, need to get to next cycle in page lifecycle
1069
- setTimeout(() => {
1070
- if (this._radios && !isAlreadySelected) {
1071
- this._selected = null;
1072
- this._radios.forEach(radio => {
1073
- radio.checked = this.value === radio.value;
1074
- if (radio.checked) {
1075
- this._selected = radio;
1076
- }
1077
- });
1078
- }
1079
- });
1080
- }
1081
- /**
1082
- * Sets the selected radio to checked if it is not already checked
1083
- */
1084
- _setSelectedRadioToChecked() {
1085
- if (this.selected && !this.selected.checked) {
1086
- this.selected.checked = true;
1087
- }
1088
- }
1089
- /**
1090
- * Updates the 'name' property of the child radio buttons to match that of the group so they all function together
1091
- */
1092
- _updateRadioButtonNames() {
1093
- if (this._radios) {
1094
- this._radios.forEach(radio => {
1095
- radio.name = this.name;
1096
- radio.markForCheck();
1097
- });
1098
- }
1099
- }
1100
- /**
1101
- * Updates the 'disabled' property of the child radio buttons to match the disabled state of the radio group
1102
- */
1103
- _updateRadioButtonDisabled() {
1104
- if (this._radios) {
1105
- this._radios.forEach(radio => {
1106
- radio.required = this._required;
1107
- radio.markForCheck();
1108
- });
1109
- }
1110
- }
1111
- /**
1112
- * Updates the 'required' property of the child radio buttons to match the required state of the radio group
1113
- */
1114
- _updateRadioButtonRequired() {
1115
- if (this._radios) {
1116
- this._radios.forEach(radio => {
1117
- radio.required = this._required;
1118
- radio.markForCheck();
1119
- });
1120
- }
70
+ get value() {
71
+ return this._value;
1121
72
  }
1122
- /**
1123
- * Updates the 'labelPosition' property of the child radio buttons to match the labelPosition state of the radio group
1124
- */
1125
- _updateRadioButtonLabelPosition() {
1126
- if (this._radios) {
1127
- this._radios.forEach(radio => {
1128
- radio.labelPosition = this._labelPosition;
1129
- radio.markForCheck();
1130
- });
73
+ set value(val) {
74
+ if (val && val !== this._value) {
75
+ this._setValue(val);
76
+ this.elementRef.nativeElement.value = JSON.stringify(val);
1131
77
  }
1132
78
  }
1133
- /**
1134
- * Boolean indicating if the radiobutton is required and not checked
1135
- * @ignore
1136
- */
1137
- hasError() {
1138
- const hasSelectedRadio = this._radios.some(r => r.checked);
1139
- return this.required && !hasSelectedRadio;
1140
- }
1141
- /**
1142
- * Implemented as part of ControlValueAccessor.
1143
- * @param value The model bound property, i.e. the value of checked
1144
- * @ignore
1145
- */
1146
79
  writeValue(value) {
1147
- if ((value !== undefined) && (value !== null)) {
1148
- this.selected = value;
1149
- this._changeDetector.detectChanges();
80
+ if (value) {
81
+ this.value = value;
1150
82
  }
1151
83
  }
1152
- /**
1153
- * Implemented as part of ControlValueAccessor.
1154
- * @param fn The function to call on change. Provided by ControlValueAccessor
1155
- * @ignore
1156
- */
1157
84
  registerOnChange(fn) {
1158
- this._propagateChange = fn;
85
+ this.onChange = fn;
1159
86
  }
1160
- /**
1161
- * Implemented as part of ControlValueAccessor.
1162
- * @param fn The function to call on touch. Provided by ControlValueAccessor
1163
- * @ignore
1164
- */
1165
87
  registerOnTouched(fn) {
1166
- this._onTouchedCallback = fn;
1167
- }
1168
- ;
1169
- }
1170
- /**
1171
- * Used to generate unique Id for this component
1172
- * @ignore
1173
- */
1174
- GoARadioGroupComponent.idNum = 0;
1175
- GoARadioGroupComponent.decorators = [
1176
- { type: Component, args: [{
1177
- selector: 'goa-radio-group',
1178
- template: "<div class=\"goa-radio-group\" [ngClass]=\"{'goa-radio-group-disabled': disabled}\">\n <span *ngIf=\"title\" class=\"radio-group-title\">{{title}}</span>\n <span *ngIf=\"required\" class=\"required-label\" i18n=\"Required label for dropdown\">(Required)</span>\n <div *ngIf=\"helperText\" class=\"helper-text\">{{helperText}}</div>\n <div class=\"goa-radios\">\n <ng-content></ng-content>\n </div>\n <div *ngIf=\"hasError()\" class=\"error-text\">{{requiredErrorMessage}}</div>\n</div>\n",
1179
- providers: [
1180
- GOA_RADIO_GROUP_CONTROL_VALUE_ACCESSOR,
1181
- { provide: GOA_RADIO_GROUP, useExisting: GoARadioGroupComponent }
1182
- ],
1183
- changeDetection: ChangeDetectionStrategy.OnPush,
1184
- styles: [".goa-radio-group{margin-top:28px}.goa-radio-group.goa-radio-group-disabled.goa-radios{opacity:30%;cursor:default}.goa-radio-group .radio-group-title{font-size:18px;font-weight:bold;color:#333;line-height:28px}.goa-radio-group .helper-text{font-size:14px;font-weight:normal;color:#333;margin-bottom:20px}.goa-radio-group .required-label{margin-left:8px;font-size:14px;color:#666}.goa-radio-group .error-text{color:#fc1921;font-size:14px;margin-bottom:20px}\n"]
1185
- },] }
1186
- ];
1187
- GoARadioGroupComponent.ctorParameters = () => [
1188
- { type: ChangeDetectorRef },
1189
- { type: GoARadioService }
1190
- ];
1191
- GoARadioGroupComponent.propDecorators = {
1192
- _radios: [{ type: ContentChildren, args: [forwardRef(() => GoARadioComponent), { descendants: true },] }],
1193
- title: [{ type: Input }],
1194
- helperText: [{ type: Input }],
1195
- requiredErrorMessage: [{ type: Input }],
1196
- name: [{ type: Input }],
1197
- value: [{ type: Input }],
1198
- selected: [{ type: Input }],
1199
- disabled: [{ type: Input }],
1200
- required: [{ type: Input }],
1201
- labelPosition: [{ type: Input }],
1202
- selectionChange: [{ type: Output }]
1203
- };
1204
-
1205
- /**
1206
- * Callout component to describe important changes or facts.
1207
- * selector: goa-callout
1208
- */
1209
- class GoACalloutComponent {
1210
- constructor() {
1211
- /**
1212
- * The type of the callout, changes stylings and icons.
1213
- */
1214
- this.type = 'information';
1215
- }
1216
- /**
1217
- * @ignore
1218
- */
1219
- ngOnInit() {
1220
- if (this.title === undefined || this.title === null) {
1221
- throw new TypeError(`Input 'title' is required.`);
1222
- }
1223
- }
1224
- }
1225
- GoACalloutComponent.decorators = [
1226
- { type: Component, args: [{
1227
- selector: 'goa-callout',
1228
- template: "<div\n class=\"goa-callout\"\n [ngClass]=\"{\n 'goa--event': type === 'event',\n 'goa--important': type === 'important',\n 'goa--emergency': type === 'emergency',\n 'goa--success': type === 'success'\n }\"\n>\n <div>\n <h3>{{ title }}</h3>\n <div class=\"messages\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n",
1229
- styles: [".goa-callout{box-sizing:border-box;display:inline-block;position:relative;width:100%;margin:24px 0 0;padding:23px 24px;border-width:0;border-left-width:48px;border-style:solid;border-color:#0070c4;background:#f1f1f1}.goa-callout *:first-child{margin-top:0}.goa-callout *:last-child{margin-bottom:0}.goa-callout.goa--important{border-color:#feba35}.goa-callout.goa--emergency{border-color:#ec040b}.goa-callout.goa--error{border-color:#ec040b}.goa-callout.goa--success{border-color:#00853f}.goa-callout:before{position:absolute;top:28px;left:-36px;width:24px;height:24px;content:\"\";background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,20a9,9,0,1,1,9-9A9,9,0,0,1,12,21Z'/%3E%3Cpath fill='%23fff' d='M15.16,15.5h-2V9a1,1,0,0,0-1-1H9.82a1,1,0,0,0,0,2h1.36V15.5h-2a1,1,0,1,0,0,2h6a1,1,0,0,0,0-2Z'/%3E%3Cpath fill='%23fff' d='M12,7.33A1.29,1.29,0,1,0,10.73,6,1.29,1.29,0,0,0,12,7.33Z'/%3E%3C/svg%3E\");background-color:transparent;background-repeat:no-repeat;background-position:center center}.goa-callout.goa--emergency:before{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M11,9.41v4.52a1,1,0,0,0,2,0V9.41a1,1,0,0,0-2,0Z'/%3E%3Cpath fill='%23fff' d='M12,16.15a1.29,1.29,0,1,0,1.29,1.29A1.29,1.29,0,0,0,12,16.15Z'/%3E%3Cpath fill='%23fff' d='M22.87,20.14l-10-17.32a1,1,0,0,0-1.74,0l-10,17.32a1,1,0,0,0,0,1,1,1,0,0,0,.87.5H22a1,1,0,0,0,.87-.5A1,1,0,0,0,22.87,20.14Zm-19.14-.5L12,5.32l8.27,14.32Z'/%3E%3C/svg%3E\");background-color:transparent;background-repeat:no-repeat;background-position:center center}.goa-callout.goa--error:before{background-image:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><defs><style>.a{fill:none;}.b{fill:white;}<\\/style></defs><rect class=\"a\" width=\"24\" height=\"24\"/><path class=\"b\" d=\"M48.1,23a11,11,0,1,0-11-11A10.968,10.968,0,0,0,48.1,23Zm0-20a9,9,0,1,1-9,9A8.963,8.963,0,0,1,48.1,3Z\" transform=\"translate(-36)\"/><path class=\"b\" d=\"M43.6,16.4a.967.967,0,0,0,1.4,0l3-3,3,3a.967.967,0,0,0,1.4,0,.967.967,0,0,0,0-1.4l-3-3,3-3A.99.99,0,0,0,51,7.6l-3,3-3-3A.99.99,0,0,0,43.6,9l3,3-3,3A1.2,1.2,0,0,0,43.6,16.4Z\" transform=\"translate(-36)\"/></svg>');background-repeat:no-repeat;background-size:contain;background-position:center center}.goa-callout.goa--important:before{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,20a9,9,0,1,1,9-9A9,9,0,0,1,12,21Z'/%3E%3Cpath fill='%23000' d='M12,14.46a1,1,0,0,0,1-1V6.57a1,1,0,0,0-2,0v6.89A1,1,0,0,0,12,14.46Z'/%3E%3Cpath fill='%23000' d='M12,15.68A1.29,1.29,0,1,0,13.29,17,1.29,1.29,0,0,0,12,15.68Z'/%3E%3C/svg%3E\");background-color:transparent;background-repeat:no-repeat;background-position:center center}.goa-callout.goa--event:before{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3.27,22.85H20.73a2.14,2.14,0,0,0,2.14-2.14V5A2.14,2.14,0,0,0,20.73,2.9h-2.1v2h2.1a.14.14,0,0,1,.14.14V8.31H3.13V5a.14.14,0,0,1,.14-.14H5.48V6.28a1,1,0,1,0,2,0V1.85a1,1,0,1,0-2,0v1H3.27A2.14,2.14,0,0,0,1.13,5V20.71A2.14,2.14,0,0,0,3.27,22.85Zm17.6-12.54v10.4a.14.14,0,0,1-.14.14H3.27a.14.14,0,0,1-.14-.14V10.31Z'/%3E%3Cpath fill='%23fff' d='M16.45,7.28a1,1,0,0,0,1-1V1.85a1,1,0,0,0-2,0v1h-1.8v2h1.8V6.28A1,1,0,0,0,16.45,7.28Z'/%3E%3Cpath fill='%23fff' d='M11.47,7.28a1,1,0,0,0,1-1V1.85a1,1,0,1,0-2,0v1H8.66v2h1.81V6.28A1,1,0,0,0,11.47,7.28Z'/%3E%3Crect fill='%23fff' x='6.67' y='11.52' width='2.33' height='2.33'/%3E%3Crect fill='%23fff' x='11.22' y='11.52' width='2.33' height='2.33'/%3E%3Crect fill='%23fff' x='15.77' y='11.52' width='2.33' height='2.33'/%3E%3Crect fill='%23fff' x='3.64' y='15.83' width='2.33' height='2.33'/%3E%3Crect fill='%23fff' x='8.19' y='15.83' width='2.33' height='2.33'/%3E%3Crect fill='%23fff' x='12.74' y='15.83' width='2.33' height='2.33'/%3E%3C/svg%3E\");background-color:transparent;background-repeat:no-repeat;background-position:center center}.goa-callout.goa--event:before{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3.27,22.85H20.73a2.14,2.14,0,0,0,2.14-2.14V5A2.14,2.14,0,0,0,20.73,2.9h-2.1v2h2.1a.14.14,0,0,1,.14.14V8.31H3.13V5a.14.14,0,0,1,.14-.14H5.48V6.28a1,1,0,1,0,2,0V1.85a1,1,0,1,0-2,0v1H3.27A2.14,2.14,0,0,0,1.13,5V20.71A2.14,2.14,0,0,0,3.27,22.85Zm17.6-12.54v10.4a.14.14,0,0,1-.14.14H3.27a.14.14,0,0,1-.14-.14V10.31Z'/%3E%3Cpath fill='%23fff' d='M16.45,7.28a1,1,0,0,0,1-1V1.85a1,1,0,0,0-2,0v1h-1.8v2h1.8V6.28A1,1,0,0,0,16.45,7.28Z'/%3E%3Cpath fill='%23fff' d='M11.47,7.28a1,1,0,0,0,1-1V1.85a1,1,0,1,0-2,0v1H8.66v2h1.81V6.28A1,1,0,0,0,11.47,7.28Z'/%3E%3Crect fill='%23fff' x='6.67' y='11.52' width='2.33' height='2.33'/%3E%3Crect fill='%23fff' x='11.22' y='11.52' width='2.33' height='2.33'/%3E%3Crect fill='%23fff' x='15.77' y='11.52' width='2.33' height='2.33'/%3E%3Crect fill='%23fff' x='3.64' y='15.83' width='2.33' height='2.33'/%3E%3Crect fill='%23fff' x='8.19' y='15.83' width='2.33' height='2.33'/%3E%3Crect fill='%23fff' x='12.74' y='15.83' width='2.33' height='2.33'/%3E%3C/svg%3E\");background-color:transparent;background-repeat:no-repeat;background-position:center center}.goa-callout.goa--success:before{background-image:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><defs><style>.a{fill:none;}.b{fill:white;}<\\/style></defs><g transform=\"translate(-23 -68)\"><rect class=\"a\" width=\"24\" height=\"24\" transform=\"translate(23 68)\"/><path class=\"b\" d=\"M12,23A11,11,0,1,0,1,12,10.968,10.968,0,0,0,12,23ZM12,3a9,9,0,1,1-9,9A8.963,8.963,0,0,1,12,3Z\" transform=\"translate(23 68)\"/><path class=\"b\" d=\"M10.9,16.4a.908.908,0,0,0,.7.3h.1a.842.842,0,0,0,.7-.4L17.6,9a.913.913,0,0,0-.2-1.4,1,1,0,0,0-1.4.3l-4.5,6.3L8,10.5a.99.99,0,0,0-1.4,1.4Z\" transform=\"translate(23 68)\"/></g></svg>');background-repeat:no-repeat;background-size:contain;background-position:center center}.goa-callout .messages{margin-bottom:0;margin-top:1em}\n"]
1230
- },] }
1231
- ];
1232
- GoACalloutComponent.ctorParameters = () => [];
1233
- GoACalloutComponent.propDecorators = {
1234
- type: [{ type: Input }],
1235
- title: [{ type: Input }]
1236
- };
1237
-
1238
- /**
1239
- * Government of Alberta styled notification, comes in 4 variants: emergency, event, information, important.
1240
- * Can set the message and optionally a link url.
1241
- * selector: goa-notification
1242
- */
1243
- class GoANotificationComponent {
1244
- constructor(_changeDetectorRef) {
1245
- this._changeDetectorRef = _changeDetectorRef;
1246
- /**
1247
- * Whether or not the notification has been dismissed.
1248
- * @ignore
1249
- */
1250
- this._isDismissed = false;
1251
- /**
1252
- * The type of the notification, changes stylings and icons.
1253
- */
1254
- this.type = 'information';
1255
- /**
1256
- * Can the notification be dismissed?
1257
- */
1258
- this.isDismissable = true;
1259
- /**
1260
- * Event emitted when the notification has been dismissed by the user.
1261
- */
1262
- this.dismiss = new EventEmitter();
1263
- }
1264
- /**
1265
- * @ignore
1266
- */
1267
- ngOnInit() {
1268
- }
1269
- /**
1270
- * @ignore
1271
- */
1272
- dismissClick() {
1273
- this._isDismissed = true;
1274
- this._changeDetectorRef.detectChanges();
1275
- this.dismiss.emit();
1276
- }
1277
- }
1278
- GoANotificationComponent.decorators = [
1279
- { type: Component, args: [{
1280
- selector: 'goa-notification',
1281
- template: "\n<div class=\"goa-notification\"\n [ngClass]=\"{\n 'dismissed': _isDismissed === true,\n 'goa--event': type === 'event',\n 'goa--important': type === 'important',\n 'goa--emergency': type === 'emergency'\n }\">\n <div class=\"content\">\n <a *ngIf=\"notificationUrl\" class=\"message\" href={{notificationUrl}}>{{message}}</a>\n <span *ngIf=\"!notificationUrl\" class=\"message\">{{message}}</span>\n <a *ngIf=\"isDismissable === true\" class=\"close\" i18n-title title=\"Dismiss\" (click)=\"dismissClick()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\n <path d=\"M 15.99 14.54C 15.99 14.54 14.54 15.99 14.54 15.99 14.54 15.99 8 9.45 8 9.45 8 9.45 1.46 15.99 1.46 15.99 1.46 15.99 0.01 14.54 0.01 14.54 0.01 14.54 6.55 8 6.55 8 6.55 8 0.01 1.46 0.01 1.46 0.01 1.46 1.46 0.01 1.46 0.01 1.46 0.01 8 6.55 8 6.55 8 6.55 14.54 0.01 14.54 0.01 14.54 0.01 15.99 1.46 15.99 1.46 15.99 1.46 9.45 8 9.45 8 9.45 8 15.99 14.54 15.99 14.54Z\"/>\n </svg>\n </a>\n </div>\n</div>\n\n",
1282
- styles: [".goa-notification{box-sizing:border-box;display:inline-block;position:relative;width:100%;padding-left:72px;padding-right:72px;color:#fff;background:#0070c4}.goa-notification.dismissed{display:none}@media screen and (min-width: 768px) and (max-width: 1199px){.goa-notification{padding-left:24px;padding-right:24px}}@media screen and (max-width: 767px){.goa-notification{padding-left:24px;padding-right:24px}}.goa-notification .content{box-sizing:border-box;display:flex;width:100%;margin:0;position:relative;padding:0 36px}.goa-notification .content .message{flex:1 0 0;box-sizing:border-box;min-height:56px;padding:28px 0}.goa-notification .content .close{flex:0 1 auto;color:#fff}.goa-notification a{color:#fff}.goa-notification a:hover,.goa-notification a:focus{color:#fff;text-decoration:none}.goa-notification.goa--event{background-color:#00853f}.goa-notification.goa--important{background-color:#feba35}.goa-notification.goa--important .message{color:#333}.goa-notification.goa--important a{color:#333}.goa-notification.goa--important a:hover,.goa-notification.goa--important a:focus{color:#333}.goa-notification.goa--emergency{background-color:#ec040b}.goa-notification .close{align-self:center;position:absolute;right:12px;cursor:pointer}.goa-notification .close svg{fill:#fff;color:#fff}.goa-notification .content:before{position:absolute;top:50%;left:6px;width:24px;height:24px;margin-top:-12px;content:\"\";background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,20a9,9,0,1,1,9-9A9,9,0,0,1,12,21Z'/%3E%3Cpath fill='%23fff' d='M15.16,15.5h-2V9a1,1,0,0,0-1-1H9.82a1,1,0,0,0,0,2h1.36V15.5h-2a1,1,0,1,0,0,2h6a1,1,0,0,0,0-2Z'/%3E%3Cpath fill='%23fff' d='M12,7.33A1.29,1.29,0,1,0,10.73,6,1.29,1.29,0,0,0,12,7.33Z'/%3E%3C/svg%3E\");background-color:transparent;background-repeat:no-repeat;background-position:center center}.goa-notification.goa--emergency .content:before{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M11,9.41v4.52a1,1,0,0,0,2,0V9.41a1,1,0,0,0-2,0Z'/%3E%3Cpath fill='%23fff' d='M12,16.15a1.29,1.29,0,1,0,1.29,1.29A1.29,1.29,0,0,0,12,16.15Z'/%3E%3Cpath fill='%23fff' d='M22.87,20.14l-10-17.32a1,1,0,0,0-1.74,0l-10,17.32a1,1,0,0,0,0,1,1,1,0,0,0,.87.5H22a1,1,0,0,0,.87-.5A1,1,0,0,0,22.87,20.14Zm-19.14-.5L12,5.32l8.27,14.32Z'/%3E%3C/svg%3E\");background-color:transparent;background-repeat:no-repeat;background-position:center center}.goa-notification.goa--important .content:before{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,20a9,9,0,1,1,9-9A9,9,0,0,1,12,21Z'/%3E%3Cpath fill='%23000' d='M12,14.46a1,1,0,0,0,1-1V6.57a1,1,0,0,0-2,0v6.89A1,1,0,0,0,12,14.46Z'/%3E%3Cpath fill='%23000' d='M12,15.68A1.29,1.29,0,1,0,13.29,17,1.29,1.29,0,0,0,12,15.68Z'/%3E%3C/svg%3E\");background-color:transparent;background-repeat:no-repeat;background-position:center center}.goa-notification.goa--event .content:before{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3.27,22.85H20.73a2.14,2.14,0,0,0,2.14-2.14V5A2.14,2.14,0,0,0,20.73,2.9h-2.1v2h2.1a.14.14,0,0,1,.14.14V8.31H3.13V5a.14.14,0,0,1,.14-.14H5.48V6.28a1,1,0,1,0,2,0V1.85a1,1,0,1,0-2,0v1H3.27A2.14,2.14,0,0,0,1.13,5V20.71A2.14,2.14,0,0,0,3.27,22.85Zm17.6-12.54v10.4a.14.14,0,0,1-.14.14H3.27a.14.14,0,0,1-.14-.14V10.31Z'/%3E%3Cpath fill='%23fff' d='M16.45,7.28a1,1,0,0,0,1-1V1.85a1,1,0,0,0-2,0v1h-1.8v2h1.8V6.28A1,1,0,0,0,16.45,7.28Z'/%3E%3Cpath fill='%23fff' d='M11.47,7.28a1,1,0,0,0,1-1V1.85a1,1,0,1,0-2,0v1H8.66v2h1.81V6.28A1,1,0,0,0,11.47,7.28Z'/%3E%3Crect fill='%23fff' x='6.67' y='11.52' width='2.33' height='2.33'/%3E%3Crect fill='%23fff' x='11.22' y='11.52' width='2.33' height='2.33'/%3E%3Crect fill='%23fff' x='15.77' y='11.52' width='2.33' height='2.33'/%3E%3Crect fill='%23fff' x='3.64' y='15.83' width='2.33' height='2.33'/%3E%3Crect fill='%23fff' x='8.19' y='15.83' width='2.33' height='2.33'/%3E%3Crect fill='%23fff' x='12.74' y='15.83' width='2.33' height='2.33'/%3E%3C/svg%3E\");background-color:transparent;background-repeat:no-repeat;background-position:center center}\n"]
1283
- },] }
1284
- ];
1285
- GoANotificationComponent.ctorParameters = () => [
1286
- { type: ChangeDetectorRef }
1287
- ];
1288
- GoANotificationComponent.propDecorators = {
1289
- type: [{ type: Input }],
1290
- message: [{ type: Input }],
1291
- notificationUrl: [{ type: Input }],
1292
- isDismissable: [{ type: Input }],
1293
- dismiss: [{ type: Output }]
1294
- };
1295
-
1296
- /**
1297
- * Government of Alberta styled notification banner. Contains one or more notifications.
1298
- * selector: goa-notification-banner
1299
- */
1300
- class GoANotificationBannerComponent {
1301
- constructor() {
1302
- /**
1303
- * The accessibility title for the notification banner. Is not displayed.
1304
- */
1305
- this.title = 'Notifications';
1306
- }
1307
- /**
1308
- * @ignore
1309
- */
1310
- ngOnInit() {
1311
- }
1312
- }
1313
- GoANotificationBannerComponent.decorators = [
1314
- { type: Component, args: [{
1315
- selector: 'goa-notification-banner',
1316
- template: "<div class=\"goa-notifications\">\r\n <h2 class=\"title\">{{title}}</h2>\r\n <ng-content></ng-content>\r\n</div>\r\n\r\n",
1317
- styles: [".goa-notifications .title{position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);left:-10px;width:1px;height:1px;white-space:nowrap}.goa-notifications ul{box-sizing:border-box;display:inline-block;width:100%;margin:0;padding:0;list-style-type:none}.goa-notifications ul li{box-sizing:border-box;display:block;width:100%;margin:0;padding:0}\n"]
1318
- },] }
1319
- ];
1320
- GoANotificationBannerComponent.ctorParameters = () => [];
1321
- GoANotificationBannerComponent.propDecorators = {
1322
- title: [{ type: Input }],
1323
- _notifications: [{ type: ContentChildren, args: [GoANotificationComponent, { descendants: false },] }]
1324
- };
1325
-
1326
- class GoASkeletonImageContentComponent {
1327
- constructor() {
1328
- this.rows = 1;
1329
- this.arr = Array;
1330
- }
1331
- }
1332
- GoASkeletonImageContentComponent.decorators = [
1333
- { type: Component, args: [{
1334
- selector: 'goa-skeleton-image-content',
1335
- template: "<div class=\"skeleton-image-content\">\n <goa-skeleton-element type=\"thumbnail\"></goa-skeleton-element>\n <div class=\"skeleton-image-content__text\">\n <goa-skeleton-element\n type=\"title\"\n *ngFor=\"let i of arr(rows).fill(1)\"\n ></goa-skeleton-element>\n </div>\n</div>\n",
1336
- styles: ["@-webkit-keyframes pulse{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}:root{--fs-xs: .75rem;--fs-sm: .875rem;--fs-base: 1.125rem;--fs-lg: 1.25rem;--fs-xl: 1.5rem;--fs-2xl: 2.25rem;--fs-3xl: 3rem;--fw-thin: 100;--fw-light: 300;--fw-regular: 400;--fw-medium: 500;--fw-bold: 700;--fw-black: 900}@keyframes pulse{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}[data-skeleton]{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}[data-skeleton] *{border-color:#ddd!important;color:transparent!important}[data-skeleton] p,[data-skeleton] a{background-color:#ddd!important;-webkit-animation:pulse 2s infinite ease-in-out;animation:pulse 2s infinite ease-in-out;display:inline;line-height:0!important;font-size:50%!important}[data-skeleton] p:after,[data-skeleton] a:after{content:\"\"!important;display:block!important;margin-bottom:1rem!important;background-size:contain}[data-skeleton] h1,[data-skeleton] h2,[data-skeleton] h3,[data-skeleton] h4,[data-skeleton] h5,[data-skeleton] h6{background-color:#ddd!important;-webkit-animation:pulse 2s infinite ease-in-out;animation:pulse 2s infinite ease-in-out;margin-bottom:1rem}[data-skeleton] h1{height:calc(.6 * 3rem)!important;height:calc(.6 * var(--fs-3xl))!important}[data-skeleton] h2{height:calc(.6 * 2.25rem)!important;height:calc(.6 * var(--fs-2xl))!important}[data-skeleton] h3{height:calc(.6 * 1.5rem)!important;height:calc(.6 * var(--fs-xl))!important}[data-skeleton] h4{height:calc(.6 * 1.25rem)!important;height:calc(.6 * var(--fs-lg))!important}[data-skeleton] img{background-color:#ddd!important;-webkit-animation:pulse 2s infinite ease-in-out;animation:pulse 2s infinite ease-in-out}.skeleton{background-color:#ddd!important;-webkit-animation:pulse 2s infinite ease-in-out;animation:pulse 2s infinite ease-in-out;background:#dcdcdc;overflow:hidden;margin:10px 0}.skeleton.text{width:100%;height:12px;border-radius:4px}.skeleton.paragraph{width:100%;height:70px;border-radius:4px}.skeleton.title{width:50%;height:20px;margin-bottom:15px;border-radius:4px}.skeleton.avatar{width:100px;height:100px;border-radius:50%}.skeleton.thumbnail{width:100px;height:100px;border-radius:4px}.skeleton-image-content{display:flex;flex-direction:row;grid-gap:30px;gap:30px}.skeleton-image-content__text{flex:1 1 auto}.skeleton-content{display:grid;grid-template-columns:1fr;grid-gap:30px;gap:30px;align-items:left}.goa-card{box-sizing:border-box;background:#fff;border:1px solid #dcdcdc;transition:opacity .3s ease-in-out}.goa-card .card-content{padding:28px;border-top:8px solid #0081a2}.goa-card .card-content .goa-title,.goa-card .card-content .goa-text,.goa-card .card-content .goa-content{margin-bottom:28px}.goa-card .card-content .goa-text{color:#333;font-size:1.125rem;font-size:var(--fs-base);line-height:28px}.goa-card .card-content .goa-footer{font-size:1.125rem;font-size:var(--fs-base)}.goa-card .card-content .goa-title{font-size:1.5rem;font-size:var(--fs-xl);font-weight:400;line-height:32px}.goa-card .goa-poster{position:relative;display:block;padding:56.25% 0 0;overflow:hidden;background:#e5e5e5}.goa-card .goa-poster:empty{display:none}.goa-card .goa-poster img,.goa-card .goa-poster iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:none}.goa-card .goa-poster-image img{display:block;width:100%;-o-object-fit:cover;object-fit:cover}.goa-card.card-auto{width:auto}.goa-card.card-auto .card{flex-basis:auto;width:auto}.goa-card a:hover{color:#004f84;text-decoration:none}.goa-card a:focus{outline:3px solid #feba35;outline-offset:0}.goa-card[data-skeleton] .goa-poster-image{background-color:#ddd!important;-webkit-animation:pulse 2s infinite ease-in-out;animation:pulse 2s infinite ease-in-out;padding-bottom:56.25%}.goa-card[data-skeleton] .goa-poster-image img{display:none}.goa-card[data-skeleton] .goa-title{margin-bottom:1rem}.goa-card[data-skeleton] .goa-footer{background-color:#ddd!important;-webkit-animation:pulse 2s infinite ease-in-out;animation:pulse 2s infinite ease-in-out;max-height:1rem}\n"]
1337
- },] }
1338
- ];
1339
- GoASkeletonImageContentComponent.ctorParameters = () => [];
1340
- GoASkeletonImageContentComponent.propDecorators = {
1341
- rows: [{ type: Input }]
1342
- };
1343
-
1344
- class GoASkeletonElementComponent {
1345
- constructor() {
1346
- this.type = 'text';
88
+ this.onTouched = fn;
1347
89
  }
1348
- get elementClass() {
1349
- return `skeleton ${this.type}`;
1350
- }
1351
- }
1352
- GoASkeletonElementComponent.decorators = [
1353
- { type: Component, args: [{
1354
- selector: 'goa-skeleton-element',
1355
- template: "<div [ngClass]=\"elementClass\"></div>",
1356
- styles: ["@-webkit-keyframes pulse{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}:root{--fs-xs: .75rem;--fs-sm: .875rem;--fs-base: 1.125rem;--fs-lg: 1.25rem;--fs-xl: 1.5rem;--fs-2xl: 2.25rem;--fs-3xl: 3rem;--fw-thin: 100;--fw-light: 300;--fw-regular: 400;--fw-medium: 500;--fw-bold: 700;--fw-black: 900}@keyframes pulse{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}[data-skeleton]{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}[data-skeleton] *{border-color:#ddd!important;color:transparent!important}[data-skeleton] p,[data-skeleton] a{background-color:#ddd!important;-webkit-animation:pulse 2s infinite ease-in-out;animation:pulse 2s infinite ease-in-out;display:inline;line-height:0!important;font-size:50%!important}[data-skeleton] p:after,[data-skeleton] a:after{content:\"\"!important;display:block!important;margin-bottom:1rem!important;background-size:contain}[data-skeleton] h1,[data-skeleton] h2,[data-skeleton] h3,[data-skeleton] h4,[data-skeleton] h5,[data-skeleton] h6{background-color:#ddd!important;-webkit-animation:pulse 2s infinite ease-in-out;animation:pulse 2s infinite ease-in-out;margin-bottom:1rem}[data-skeleton] h1{height:calc(.6 * 3rem)!important;height:calc(.6 * var(--fs-3xl))!important}[data-skeleton] h2{height:calc(.6 * 2.25rem)!important;height:calc(.6 * var(--fs-2xl))!important}[data-skeleton] h3{height:calc(.6 * 1.5rem)!important;height:calc(.6 * var(--fs-xl))!important}[data-skeleton] h4{height:calc(.6 * 1.25rem)!important;height:calc(.6 * var(--fs-lg))!important}[data-skeleton] img{background-color:#ddd!important;-webkit-animation:pulse 2s infinite ease-in-out;animation:pulse 2s infinite ease-in-out}.skeleton{background-color:#ddd!important;-webkit-animation:pulse 2s infinite ease-in-out;animation:pulse 2s infinite ease-in-out;background:#dcdcdc;overflow:hidden;margin:10px 0}.skeleton.text{width:100%;height:12px;border-radius:4px}.skeleton.paragraph{width:100%;height:70px;border-radius:4px}.skeleton.title{width:50%;height:20px;margin-bottom:15px;border-radius:4px}.skeleton.avatar{width:100px;height:100px;border-radius:50%}.skeleton.thumbnail{width:100px;height:100px;border-radius:4px}.skeleton-image-content{display:flex;flex-direction:row;grid-gap:30px;gap:30px}.skeleton-image-content__text{flex:1 1 auto}.skeleton-content{display:grid;grid-template-columns:1fr;grid-gap:30px;gap:30px;align-items:left}.goa-card{box-sizing:border-box;background:#fff;border:1px solid #dcdcdc;transition:opacity .3s ease-in-out}.goa-card .card-content{padding:28px;border-top:8px solid #0081a2}.goa-card .card-content .goa-title,.goa-card .card-content .goa-text,.goa-card .card-content .goa-content{margin-bottom:28px}.goa-card .card-content .goa-text{color:#333;font-size:1.125rem;font-size:var(--fs-base);line-height:28px}.goa-card .card-content .goa-footer{font-size:1.125rem;font-size:var(--fs-base)}.goa-card .card-content .goa-title{font-size:1.5rem;font-size:var(--fs-xl);font-weight:400;line-height:32px}.goa-card .goa-poster{position:relative;display:block;padding:56.25% 0 0;overflow:hidden;background:#e5e5e5}.goa-card .goa-poster:empty{display:none}.goa-card .goa-poster img,.goa-card .goa-poster iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:none}.goa-card .goa-poster-image img{display:block;width:100%;-o-object-fit:cover;object-fit:cover}.goa-card.card-auto{width:auto}.goa-card.card-auto .card{flex-basis:auto;width:auto}.goa-card a:hover{color:#004f84;text-decoration:none}.goa-card a:focus{outline:3px solid #feba35;outline-offset:0}.goa-card[data-skeleton] .goa-poster-image{background-color:#ddd!important;-webkit-animation:pulse 2s infinite ease-in-out;animation:pulse 2s infinite ease-in-out;padding-bottom:56.25%}.goa-card[data-skeleton] .goa-poster-image img{display:none}.goa-card[data-skeleton] .goa-title{margin-bottom:1rem}.goa-card[data-skeleton] .goa-footer{background-color:#ddd!important;-webkit-animation:pulse 2s infinite ease-in-out;animation:pulse 2s infinite ease-in-out;max-height:1rem}\n"]
1357
- },] }
1358
- ];
1359
- GoASkeletonElementComponent.ctorParameters = () => [];
1360
- GoASkeletonElementComponent.propDecorators = {
1361
- type: [{ type: Input }]
1362
- };
1363
-
1364
- /**
1365
- * Header component used for Government of Alberta cards.
1366
- * Put header content inside of component and it will project to the header section of the card.
1367
- * selector: goa-card-header
1368
- * @example <goa-card><goa-card-header>My content</goa-card-header></goa-card>
1369
- */
1370
- class GoACardHeaderComponent {
1371
- constructor() { }
1372
- /**
1373
- * @ignore
1374
- */
1375
- ngOnInit() {
1376
- }
1377
- }
1378
- GoACardHeaderComponent.decorators = [
1379
- { type: Component, args: [{
1380
- selector: 'goa-card-header',
1381
- template: "<ng-container>\n <ng-content></ng-content>\n</ng-container>",
1382
- styles: [""]
1383
- },] }
1384
- ];
1385
- GoACardHeaderComponent.ctorParameters = () => [];
1386
-
1387
- /**
1388
- * Footer component used for Government of Alberta cards.
1389
- * Put footer content inside of component and it will project to the confootertent section of the card.
1390
- * selector: goa-card-footer
1391
- * @example <goa-card><goa-card-footer>My content</goa-card-footer></goa-card>
1392
- */
1393
- class GoACardFooterComponent {
1394
- constructor() { }
1395
- /**
1396
- * @ignore
1397
- */
1398
- ngOnInit() {
1399
- }
1400
- }
1401
- GoACardFooterComponent.decorators = [
1402
- { type: Component, args: [{
1403
- selector: 'goa-card-footer',
1404
- template: "<ng-container>\n <ng-content></ng-content>\n</ng-container>",
1405
- styles: [""]
1406
- },] }
1407
- ];
1408
- GoACardFooterComponent.ctorParameters = () => [];
1409
-
1410
- /**
1411
- * cardImage image component used for Government of Alberta cards.
1412
- * It will project to the content section of the card.
1413
- * selector: goa-card-thumb-image
1414
- * @example <goa-card><goa-card-thumb-image url="" alt=""></goa-card-thumb-image></goa-card>
1415
- */
1416
- class GoACardThumbImageComponent {
1417
- constructor() { }
1418
- /**
1419
- * @ignore
1420
- */
1421
- ngOnInit() { }
1422
- }
1423
- GoACardThumbImageComponent.decorators = [
1424
- { type: Component, args: [{
1425
- selector: 'goa-card-thumb-image',
1426
- template: "<ng-container>\n <img src=\"{{url}}\" [attr.alt]=\"alt\">\n</ng-container>",
1427
- styles: [":host img,:host iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:none}\n"]
1428
- },] }
1429
- ];
1430
- GoACardThumbImageComponent.ctorParameters = () => [];
1431
- GoACardThumbImageComponent.propDecorators = {
1432
- url: [{ type: Input }],
1433
- alt: [{ type: Input }]
1434
- };
1435
-
1436
- /**
1437
- * Content component used for Government of Alberta cards.
1438
- * Put content inside of component and it will project to the content section of the card.
1439
- * selector: goa-card-content
1440
- * @example <goa-card><goa-card-content>My content</goa-card-content></goa-card>
1441
- */
1442
- class GoACardContentComponent {
1443
- constructor() { }
1444
- /**
1445
- * @ignore
1446
- */
1447
- ngOnInit() {
1448
- }
1449
- }
1450
- GoACardContentComponent.decorators = [
1451
- { type: Component, args: [{
1452
- selector: 'goa-card-content',
1453
- template: "<ng-container>\n <ng-content></ng-content>\n</ng-container>",
1454
- styles: [""]
1455
- },] }
1456
- ];
1457
- GoACardContentComponent.ctorParameters = () => [];
1458
-
1459
- /**
1460
- * Card component with Government of Alberta styling.
1461
- * Place desired sub-components (goa-card-thumb-image, goa-card-header, goa-card-content, goa-card-footer) inside of content.
1462
- * selector: goa-card
1463
- */
1464
- class GoACardComponent {
1465
- constructor() {
1466
- /**
1467
- * What percentage of container width to take.
1468
- */
1469
- this.cardSize = 'full';
1470
- }
1471
- /**
1472
- * @ignore
1473
- */
1474
- ngOnInit() {
1475
- }
1476
- }
1477
- GoACardComponent.decorators = [
1478
- { type: Component, args: [{
1479
- selector: 'goa-card',
1480
- template: "<div\n class=\"goa-card\"\n [ngClass]=\"{\n 'card-auto': cardSize === 'auto'\n }\" [attr.data-skeleton]=\"isSkeleton ? '' : null\"\n>\n <div class=\"goa-poster\">\n <ng-content select=\"goa-card-thumb-image\"></ng-content>\n </div>\n <div class=\"card-content\">\n <a class=\"goa-title\" href=\"{{ titleUrl }}\">\n <ng-content select=\"goa-card-header\"></ng-content>\n </a>\n <div class=\"goa-text\">\n <ng-content select=\"goa-card-content\"></ng-content>\n </div>\n <div class=\"goa-footer\">\n <ng-content select=\"goa-card-footer\"></ng-content>\n </div>\n </div>\n</div>\n",
1481
- styles: [":root{--fs-xs: .75rem;--fs-sm: .875rem;--fs-base: 1.125rem;--fs-lg: 1.25rem;--fs-xl: 1.5rem;--fs-2xl: 2.25rem;--fs-3xl: 3rem;--fw-thin: 100;--fw-light: 300;--fw-regular: 400;--fw-medium: 500;--fw-bold: 700;--fw-black: 900}@-webkit-keyframes pulse{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}@keyframes pulse{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}[data-skeleton]{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}[data-skeleton] *{border-color:#ddd!important;color:transparent!important}[data-skeleton] p,[data-skeleton] a{background-color:#ddd!important;-webkit-animation:pulse 2s infinite ease-in-out;animation:pulse 2s infinite ease-in-out;display:inline;line-height:0!important;font-size:50%!important}[data-skeleton] p:after,[data-skeleton] a:after{content:\"\"!important;display:block!important;margin-bottom:1rem!important;background-size:contain}[data-skeleton] h1,[data-skeleton] h2,[data-skeleton] h3,[data-skeleton] h4,[data-skeleton] h5,[data-skeleton] h6{background-color:#ddd!important;-webkit-animation:pulse 2s infinite ease-in-out;animation:pulse 2s infinite ease-in-out;margin-bottom:1rem}[data-skeleton] h1{height:calc(.6 * 3rem)!important;height:calc(.6 * var(--fs-3xl))!important}[data-skeleton] h2{height:calc(.6 * 2.25rem)!important;height:calc(.6 * var(--fs-2xl))!important}[data-skeleton] h3{height:calc(.6 * 1.5rem)!important;height:calc(.6 * var(--fs-xl))!important}[data-skeleton] h4{height:calc(.6 * 1.25rem)!important;height:calc(.6 * var(--fs-lg))!important}[data-skeleton] img{background-color:#ddd!important;-webkit-animation:pulse 2s infinite ease-in-out;animation:pulse 2s infinite ease-in-out}.skeleton{background-color:#ddd!important;-webkit-animation:pulse 2s infinite ease-in-out;animation:pulse 2s infinite ease-in-out;background:#dcdcdc;overflow:hidden;margin:10px 0}.skeleton.text{width:100%;height:12px;border-radius:4px}.skeleton.paragraph{width:100%;height:70px;border-radius:4px}.skeleton.title{width:50%;height:20px;margin-bottom:15px;border-radius:4px}.skeleton.avatar{width:100px;height:100px;border-radius:50%}.skeleton.thumbnail{width:100px;height:100px;border-radius:4px}.skeleton-image-content{display:flex;flex-direction:row;grid-gap:30px;gap:30px}.skeleton-image-content__text{flex:1 1 auto}.skeleton-content{display:grid;grid-template-columns:1fr;grid-gap:30px;gap:30px;align-items:left}.goa-card{box-sizing:border-box;background:#fff;border:1px solid #dcdcdc;transition:opacity .3s ease-in-out}.goa-card .card-content{padding:28px;border-top:8px solid #0081a2}.goa-card .card-content .goa-title,.goa-card .card-content .goa-text,.goa-card .card-content .goa-content{margin-bottom:28px}.goa-card .card-content .goa-text{color:#333;font-size:1.125rem;font-size:var(--fs-base);line-height:28px}.goa-card .card-content .goa-footer{font-size:1.125rem;font-size:var(--fs-base)}.goa-card .card-content .goa-title{font-size:1.5rem;font-size:var(--fs-xl);font-weight:400;line-height:32px}.goa-card .goa-poster{position:relative;display:block;padding:56.25% 0 0;overflow:hidden;background:#e5e5e5}.goa-card .goa-poster:empty{display:none}.goa-card .goa-poster img,.goa-card .goa-poster iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:none}.goa-card .goa-poster-image img{display:block;width:100%;-o-object-fit:cover;object-fit:cover}.goa-card.card-auto{width:auto}.goa-card.card-auto .card{flex-basis:auto;width:auto}.goa-card a:hover{color:#004f84;text-decoration:none}.goa-card a:focus{outline:3px solid #feba35;outline-offset:0}.goa-card[data-skeleton] .goa-poster-image{background-color:#ddd!important;-webkit-animation:pulse 2s infinite ease-in-out;animation:pulse 2s infinite ease-in-out;padding-bottom:56.25%}.goa-card[data-skeleton] .goa-poster-image img{display:none}.goa-card[data-skeleton] .goa-title{margin-bottom:1rem}.goa-card[data-skeleton] .goa-footer{background-color:#ddd!important;-webkit-animation:pulse 2s infinite ease-in-out;animation:pulse 2s infinite ease-in-out;max-height:1rem}\n"]
1482
- },] }
1483
- ];
1484
- GoACardComponent.ctorParameters = () => [];
1485
- GoACardComponent.propDecorators = {
1486
- cardSize: [{ type: Input }],
1487
- titleUrl: [{ type: Input }],
1488
- isSkeleton: [{ type: Input }]
1489
- };
1490
-
1491
- /**
1492
- * A wrapper/group for a set of card display
1493
- */
1494
- class GoACardGroupComponent {
1495
- constructor() { }
1496
- /* eslint-disable @angular-eslint/no-empty-lifecycle-method */
1497
- ngOnInit() { }
1498
- }
1499
- GoACardGroupComponent.decorators = [
1500
- { type: Component, args: [{
1501
- selector: 'goa-card-group',
1502
- template: "<ng-container>\n <div class=\"goa-card-group\">\n <div class=\"card-group-title\">{{ title }}</div>\n <div\n [ngClass]=\"{\n 'card-group-basic': layout === 'basic',\n 'card-group-column': layout === 'column'\n }\"\n >\n <ng-content></ng-content>\n <div *ngFor=\"let card of cardItems\">\n <goa-card titleUrl=\"{{ card.titleUrl }}\">\n <goa-card-thumb-image\n url=\"{{ card.cardImageUrl }}\"\n alt=\"hero pic\"\n ></goa-card-thumb-image>\n <goa-card-header>{{ card.title }}</goa-card-header>\n <goa-card-content>{{ card.description }}</goa-card-content>\n </goa-card>\n </div>\n </div>\n </div>\n</ng-container>\n",
1503
- styles: [".goa-card-group{margin-top:14px;vertical-align:top}.goa-card-group .card-group-title{font-size:24px;font-weight:bold;color:#333}.goa-card-group .card-group-basic{display:flex;flex-direction:row;flex-wrap:wrap;align-items:stretch}.goa-card-group .card-group-basic>div{margin:14px 10px}.goa-card-group .card-group-basic-vue>div{display:flex;flex-direction:row;flex-wrap:wrap;align-items:stretch}.goa-card-group .card-group-basic-vue>div>div{margin:14px 10px}.goa-card-group .card-group-column{display:inline-block;flex-direction:column;-moz-column-count:3;column-count:3;flex-wrap:wrap;align-items:stretch}.goa-card-group .card-group-column>div{margin:14px}.goa-card-group .card-group-column-vue>div{display:inline-block;flex-direction:column;-moz-column-count:3;column-count:3;flex-wrap:wrap;align-items:stretch}.goa-card-group .card-group-column>div>div{margin:14px}\n"]
1504
- },] }
1505
- ];
1506
- GoACardGroupComponent.ctorParameters = () => [];
1507
- GoACardGroupComponent.propDecorators = {
1508
- layout: [{ type: Input }],
1509
- title: [{ type: Input }],
1510
- cardItems: [{ type: Input }]
1511
- };
1512
-
1513
- class GoAHeroBannerContentComponent {
1514
- constructor() { }
1515
- ngOnInit() {
1516
- }
1517
- }
1518
- GoAHeroBannerContentComponent.decorators = [
1519
- { type: Component, args: [{
1520
- selector: 'goa-hero-banner-content',
1521
- template: "<ng-container>\n <p class=\"goa-hero-banner-content\" role=\"note\">\n <ng-content></ng-content>\n </p>\n</ng-container>\n",
1522
- styles: [".goa-hero-banner-content{font-size:24px;line-height:32px;margin:0;color:#fff}@media screen and (min-width: 768px) and (max-width: 1199px){.goa-hero-banner-content{width:80%}}@media screen and (min-width: 1200px){.goa-hero-banner-content{width:40%}}.goa-hero-banner-content:last-of-type{margin-bottom:28px}\n"]
1523
- },] }
1524
- ];
1525
- GoAHeroBannerContentComponent.ctorParameters = () => [];
1526
-
1527
- class GoAHeroBannerLinkComponent {
1528
- constructor() { }
1529
- ngOnInit() {
1530
- }
1531
- }
1532
- GoAHeroBannerLinkComponent.decorators = [
1533
- { type: Component, args: [{
1534
- selector: 'goa-hero-banner-link',
1535
- template: "<ng-container>\n <a class=\"goa-link-button right-arrow\" [href]=\"url\" role=\"link\">\n <ng-content></ng-content>\n </a>\n</ng-container>\n",
1536
- styles: ["@charset \"UTF-8\";.goa-link-button.goa-link-button{display:inline-block;text-decoration:none}.goa-link-button.goa-link-button{box-sizing:border-box;min-width:70px;padding:12px;border:2px solid #0070c4;border-radius:4px;background:#0070c4;cursor:pointer;color:#fff;font-size:18px;font-weight:700;line-height:1em}.goa-link-button.goa-link-button.btn-small{font-size:16px;padding:8px;margin:12px 12px 0 0}.goa-link-button.goa-link-button:last-of-type{margin-right:0}.goa-link-button.goa-link-button:disabled,.goa-link-button.goa-link-button:disabled.goa--secondary,.goa-link-button.goa-link-button:disabled.goa--tertiary{pointer-events:none;color:#666;background-color:#f1f1f1;border-color:#f1f1f1}.goa-link-button.goa-link-button:hover{border-color:#004f84;background:#004f84}.goa-link-button.goa-link-button:focus,.goa-link-button.goa-link-button:active{border-color:#004f84;box-shadow:0 0 0 3px #feba35;background:#004f84;outline:none}.goa-link-button.goa-link-button.goa--secondary{border:2px solid #0070c4;background:#fff;color:#0070c4}.goa-link-button.goa-link-button.goa--secondary:hover{border-color:#004f84;background:#fff;color:#004f84}.goa-link-button.goa-link-button.goa--secondary:focus,.goa-link-button.goa-link-button.goa--secondary:active{color:#004f84;background-color:#fff;border:2px solid #004f84;box-shadow:0 0 0 3px #feba35;outline:none}.goa-link-button.goa-link-button.goa--tertiary{border-color:#dcdcdc;background:#fff;color:#0070c4}.goa-link-button.goa-link-button.goa--tertiary:hover{background:#fff;color:#004f84}.goa-link-button.goa-link-button.goa--tertiary:focus,.goa-link-button.goa-link-button.goa--tertiary:active{border:2px solid #004f84;color:#004f84;background-color:#fff;box-shadow:0 0 0 3px #feba35;outline:none}.goa-link-button.goa-link-button.goa--borderless{background:none;color:var(--color-blue-500);border:none;transition:transform .1s ease-in-out;transform:scale(1)}.goa-link-button.goa-link-button.goa--borderless:hover{background:var(--color-blue-100);color:var(--color-blue-500)}.goa-link-button.goa-link-button.goa--borderless:focus,.goa-link-button.goa-link-button.goa--borderless:active{background-color:var(--color-blue-100);outline:none;box-shadow:none}.goa-link-button.goa-link-button.goa--borderless:active{transform:scale(.95)}.goa-link-button.goa-link-button.goa--red{color:var(--color-red-500);background:none;border:none;transition:transform .1s ease-in-out;transform:scale(1)}.goa-link-button.goa-link-button.goa--red:hover{background:var(--color-red-100);color:var(--color-red-500)}.goa-link-button.goa-link-button.goa--red:focus,.goa-link-button.goa-link-button.goa--red:active{background:var(--color-red-100);color:var(--color-red-500);outline:none;box-shadow:none}.goa-link-button.goa-link-button.goa--red:active{transform:scale(.95)}.goa-link-button.goa-link-button.right-arrow:after{color:#fff;margin-left:8px;content:\"\\2192\"}.goa-link-button.goa-link-button.up-arrow:after{color:#fff;margin-left:8px;content:\"\\2191\"}.goa-link-button.goa-link-button:visited,.goa-link-button.goa-link-button:link{color:#fff}\n"]
1537
- },] }
1538
- ];
1539
- GoAHeroBannerLinkComponent.ctorParameters = () => [];
1540
- GoAHeroBannerLinkComponent.propDecorators = {
1541
- url: [{ type: Input }]
1542
- };
1543
-
1544
- class GoAHeroBannerComponent {
1545
- constructor() { }
1546
- ngOnInit() {
1547
- }
1548
- }
1549
- GoAHeroBannerComponent.decorators = [
1550
- { type: Component, args: [{
1551
- selector: 'goa-hero-banner',
1552
- template: "<div class=\"goa-hero\"\n style=\"background-image: linear-gradient(rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.40) 40%, rgba(0, 0, 0, 0.6) 100%), url({{backgroundUrl}});\"\n>\n <h1 role=\"heading\">{{ title }}</h1>\n <ng-content select=\"goa-hero-banner-content\"></ng-content>\n <ng-content select=\"goa-hero-banner-link\"></ng-content>\n</div>\n",
1553
- styles: [".goa-hero{box-sizing:border-box;display:flex;justify-content:flex-end;align-items:stretch;flex-direction:column;height:600px;border-bottom:8px solid #0081a2;color:#fff;background-position:center center;width:100%;padding:56px 28px}.goa-hero h1{margin:0 0 28px;padding:0;font-size:48px;line-height:56px;font-weight:700;color:#fff}\n"]
1554
- },] }
1555
- ];
1556
- GoAHeroBannerComponent.ctorParameters = () => [];
1557
- GoAHeroBannerComponent.propDecorators = {
1558
- title: [{ type: Input }],
1559
- backgroundUrl: [{ type: Input }]
1560
- };
1561
-
1562
- /**
1563
- * A page load indicator component with Government of Alberta styling.
1564
- * selector: goa-page-load-indicator
1565
- */
1566
- class GoAPageLoadIndicatorComponent {
1567
- constructor() {
1568
- /**
1569
- * Sets the page loader visibility state.
1570
- */
1571
- this.visible = false;
1572
- /**
1573
- * The type of page loader, deterministic and indeterministic.
1574
- */
1575
- this.type = 'infinite';
1576
- /**
1577
- * The message to display while loading.
1578
- */
1579
- this.message = '';
1580
- /**
1581
- * Sets the percentage value of the page loader while set to progress type, 0 - 100 percent.
1582
- */
1583
- this.value = 0;
1584
- /**
1585
- * Sets the page to locked and does not accept user input. When not set the component
1586
- * can be used as a child element without blocking user input.
1587
- */
1588
- this.pagelock = true;
1589
- /**
1590
- * Sets the progress indicator display type size.
1591
- */
1592
- this.displayType = 'large';
1593
- /**
1594
- * Set defaults
1595
- */
1596
- this.strokeDashoffsetDefault = 280;
1597
- this.progressMaxValue = 283;
1598
- this.strokeDashoffset = 0;
1599
- }
1600
- ngOnInit() {
1601
- if (this.type !== 'progress') {
1602
- this.strokeDashoffset = this.strokeDashoffsetDefault;
1603
- }
1604
- }
1605
- ngOnChanges(changes) {
1606
- if (changes.visible) {
1607
- this.blockScrollingToggle(changes.visible.currentValue);
1608
- }
1609
- if (changes.value) {
1610
- if (this.type === 'progress') {
1611
- this.setProgress(changes.value.currentValue);
1612
- }
1613
- }
1614
- }
1615
- /**
1616
- * Toggles the page scrolling based on page load indicator's visibility.
1617
- * @param isBlock The flag to enable/disable page scroll.
1618
- * @ignore
1619
- */
1620
- blockScrollingToggle(isBlock) {
1621
- if (!isBlock || !this.pagelock) {
1622
- document.body.style.removeProperty('height');
1623
- document.body.style.removeProperty('overflow');
1624
- }
1625
- else {
1626
- document.body.style.height = '100%';
1627
- document.body.style.overflow = 'hidden';
1628
- }
1629
- }
1630
- /**
1631
- * Blocks the keyboard input when page load indicator is visible.
1632
- * @ignore
1633
- */
1634
- disableKeyboardInputHandler(event) {
1635
- if (this.visible) {
1636
- event.returnValue = false;
1637
- event.preventDefault();
1638
- }
1639
- }
1640
- ngOnDestroy() {
1641
- this.blockScrollingToggle(false);
1642
- }
1643
- setProgress(progress) {
1644
- if (this.type !== 'progress') {
90
+ listenForValueChange(value) {
91
+ if (!value) {
92
+ this._setValue(undefined);
1645
93
  return;
1646
94
  }
1647
- ;
1648
- if (progress === 0) {
1649
- this.strokeDashoffset = this.progressMaxValue;
1650
- return;
1651
- }
1652
- if (progress >= 100) {
1653
- return;
1654
- }
1655
- const value = this.progressMaxValue - Math.round(this.progressMaxValue * progress / 100);
1656
- this.strokeDashoffset = value;
1657
- }
1658
- }
1659
- GoAPageLoadIndicatorComponent.decorators = [
1660
- { type: Component, args: [{
1661
- selector: 'goa-page-load-indicator',
1662
- template: "<div *ngIf=\"visible\" class=\"progress-container--{{ displayType }}\">\n <svg\n [ngClass]=\"{\n 'svg': displayType === 'large',\n 'svg--small': displayType === 'small'\n }\"\n fill=\"none\"\n viewBox=\"0 0 100 100\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <circle class=\"base-circle\" cx=\"50\" cy=\"50\" r=\"45\"/>\n <circle\n [ngClass]=\"{\n 'progress-circle--infinite': type === 'infinite',\n 'progress-circle': type === 'progress'\n }\"\n cx=\"50\"\n cy=\"50\"\n r=\"45\"\n [style.stroke-dashoffset]=\"strokeDashoffset\"/>\n </svg>\n\n <span class=\"progress-message--{{ displayType }}\">\n {{ message }}\n </span>\n</div>\n",
1663
- styles: [".svg{max-width:100px}.svg--small{max-width:65px}@-webkit-keyframes circle-animation{0%{stroke-dashoffset:75;transform:rotate(0)}to{stroke-dashoffset:75;transform:rotate(360deg)}}@keyframes circle-animation{0%{stroke-dashoffset:75;transform:rotate(0)}to{stroke-dashoffset:75;transform:rotate(360deg)}}.base-circle{display:block;fill:transparent;stroke:#c8eef9;stroke-width:7px}.progress-circle,.progress-circle--infinite{display:block;fill:transparent;stroke:#0070c4;stroke-linecap:round;stroke-dasharray:283;stroke-dashoffset:280;stroke-width:7px;transform-origin:50% 50%}.progress-circle--infinite{-webkit-animation:circle-animation 1.2s linear infinite;animation:circle-animation 1.2s linear infinite}.progress-message,.progress-message--small,.progress-message--large{font-style:normal;font-weight:normal}.progress-message--large{margin-top:32px;font-size:24px;color:#000}.progress-message--small{margin-top:18px;font-size:18px;color:#000}.progress-container,.progress-container--large,.progress-container--small{display:flex;flex-direction:column;align-items:center;justify-content:center;background:white}.progress-container--large{width:100%;height:100%}\n"]
1664
- },] }
1665
- ];
1666
- GoAPageLoadIndicatorComponent.ctorParameters = () => [];
1667
- GoAPageLoadIndicatorComponent.propDecorators = {
1668
- visible: [{ type: Input }],
1669
- type: [{ type: Input }],
1670
- message: [{ type: Input }],
1671
- value: [{ type: Input }],
1672
- pagelock: [{ type: Input }],
1673
- displayType: [{ type: Input }],
1674
- disableKeyboardInputHandler: [{ type: HostListener, args: ['document:keydown', ['$event'],] }]
1675
- };
1676
-
1677
- /**
1678
- * A page load indicator component with Government of Alberta styling.
1679
- * selector: goa-element-load-indicator
1680
- */
1681
- class GoAElementLoadIndicatorComponent {
1682
- constructor() {
1683
- /**
1684
- * Sets the page loader visibility state.
1685
- */
1686
- this.visible = true;
1687
- /**
1688
- * The diameter of the loader in pixels.
1689
- */
1690
- this.size = 'default';
1691
- /**
1692
- * The base color of the spinner.
1693
- */
1694
- this.baseColour = '#c8eef9';
1695
- /**
1696
- * The spinner color of the spinner.
1697
- */
1698
- this.spinnerColour = '#0070c4';
1699
- this.radius = this.size === 'small' ? 16 : 18;
1700
- this.innerRadius = this.radius - 4;
1701
- this.diameter = this.radius * 2;
1702
- this.dashArray = this.innerRadius * Math.PI * 2;
1703
- this.dashOffset = this.innerRadius * Math.PI * 0.5;
1704
- this.viewBox = `0 0 ${this.diameter} ${this.diameter}`;
1705
- }
1706
- /**
1707
- * @ignore
1708
- */
1709
- ngOnChanges(changes) {
1710
- if (changes.size) {
1711
- this.radius = changes.size.currentValue === 'small' ? 16 : 18;
1712
- this.innerRadius = this.radius - 4;
1713
- this.diameter = this.radius * 2;
1714
- this.viewBox = `0 0 ${this.diameter} ${this.diameter}`;
1715
- this.dashArray = this.innerRadius * Math.PI * 2;
1716
- this.dashOffset = this.innerRadius * Math.PI * 0.5;
1717
- }
1718
- }
1719
- /**
1720
- * @ignore
1721
- */
1722
- ngOnInit() { }
1723
- }
1724
- GoAElementLoadIndicatorComponent.decorators = [
1725
- { type: Component, args: [{
1726
- selector: 'goa-element-load-indicator',
1727
- template: "<div *ngIf=\"visible\">\n <svg\n fill=\"none\"\n [attr.viewBox]=\"viewBox\"\n [attr.width]=\"radius\"\n [attr.height]=\"radius\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n class=\"base-circle\"\n [attr.cx]=\"radius\"\n [attr.cy]=\"radius\"\n [attr.r]=\"innerRadius\"\n [style.stroke]=\"baseColour\"\n />\n <circle\n class=\"rotating-circle\"\n [attr.cx]=\"radius\"\n [style.stroke-dasharray]=\"dashArray\"\n [style.stroke-dashoffset]=\"dashOffset\"\n [attr.cy]=\"radius\"\n [attr.r]=\"innerRadius\"\n [style.stroke]=\"spinnerColour\"\n />\n </svg>\n</div>\n",
1728
- styles: ["@-webkit-keyframes rotate{to{transform:rotate(360deg)}}@keyframes rotate{to{transform:rotate(360deg)}}.circular-loader{-webkit-animation:rotate 1s linear infinite;animation:rotate 1s linear infinite}.base-circle{display:block;fill:transparent;stroke-width:7px}.rotating-circle{-webkit-animation:rotate 1s linear infinite;animation:rotate 1s linear infinite;display:block;fill:transparent;stroke-linecap:round;stroke-width:7px;transform-origin:50% 50%}\n"]
1729
- },] }
1730
- ];
1731
- GoAElementLoadIndicatorComponent.ctorParameters = () => [];
1732
- GoAElementLoadIndicatorComponent.propDecorators = {
1733
- visible: [{ type: Input }],
1734
- size: [{ type: Input }],
1735
- baseColour: [{ type: Input }],
1736
- spinnerColour: [{ type: Input }]
1737
- };
95
+ try {
96
+ this.value = JSON.parse(value);
97
+ }
98
+ catch (e) {
99
+ // we still need to trigger the events to prevent any previous valid value to remain set.
100
+ const v = value.match(/^[\w\s,]*$/) ? value.split(",") : undefined;
101
+ this._setValue(v);
102
+ }
103
+ }
104
+ _setValue(value) {
105
+ this._value = value;
106
+ this.onChange(value);
107
+ this.onTouched();
108
+ }
109
+ }
110
+ ValueListDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ValueListDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
111
+ ValueListDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: ValueListDirective, selector: "[goaValueList]", host: { listeners: { "_change": "listenForValueChange($event.detail.value)" } }, providers: [
112
+ {
113
+ provide: NG_VALUE_ACCESSOR,
114
+ useExisting: forwardRef(() => ValueListDirective),
115
+ multi: true,
116
+ },
117
+ ], ngImport: i0 });
118
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ValueListDirective, decorators: [{
119
+ type: Directive,
120
+ args: [{
121
+ selector: "[goaValueList]",
122
+ providers: [
123
+ {
124
+ provide: NG_VALUE_ACCESSOR,
125
+ useExisting: forwardRef(() => ValueListDirective),
126
+ multi: true,
127
+ },
128
+ ],
129
+ }]
130
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { listenForValueChange: [{
131
+ type: HostListener,
132
+ args: ["_change", ["$event.detail.value"]]
133
+ }] } });
1738
134
 
1739
135
  class AngularComponentsModule {
1740
136
  }
1741
- AngularComponentsModule.decorators = [
1742
- { type: NgModule, args: [{
1743
- imports: [CommonModule, OverlayModule],
1744
- exports: [
1745
- FormsModule,
1746
- OverlayModule,
1747
- CommonModule,
1748
- GoAButtonComponent,
1749
- GoAMicrositeLogoComponent,
1750
- GoAHeaderComponent,
1751
- GoAButtonLinkComponent,
1752
- GoAOptionComponent,
1753
- GoADropdownComponent,
1754
- GoAOptionGroupComponent,
1755
- GoACheckboxComponent,
1756
- GoACalloutComponent,
1757
- GoACardGroupComponent,
1758
- GoANotificationComponent,
1759
- GoANotificationBannerComponent,
1760
- GoACardComponent,
1761
- GoACardHeaderComponent,
1762
- GoACardFooterComponent,
1763
- GoACardContentComponent,
1764
- GoACardThumbImageComponent,
1765
- GoARadioComponent,
1766
- GoARadioGroupComponent,
1767
- GoAHeroBannerComponent,
1768
- GoAHeroBannerContentComponent,
1769
- GoAHeroBannerLinkComponent,
1770
- GoAPageLoadIndicatorComponent,
1771
- GoASkeletonImageContentComponent,
1772
- GoASkeletonElementComponent,
1773
- GoAElementLoadIndicatorComponent,
1774
- ],
1775
- declarations: [
1776
- GoAButtonComponent,
1777
- GoAMicrositeLogoComponent,
1778
- GoAHeaderComponent,
1779
- GoAButtonLinkComponent,
1780
- GoAOptionComponent,
1781
- GoADropdownComponent,
1782
- GoAOptionGroupComponent,
1783
- GoACheckboxComponent,
1784
- GoACalloutComponent,
1785
- GoACardGroupComponent,
1786
- GoANotificationComponent,
1787
- GoANotificationBannerComponent,
1788
- GoACardComponent,
1789
- GoACardHeaderComponent,
1790
- GoACardFooterComponent,
1791
- GoACardContentComponent,
1792
- GoACardThumbImageComponent,
1793
- GoARadioComponent,
1794
- GoARadioGroupComponent,
1795
- GoAHeroBannerComponent,
1796
- GoAHeroBannerContentComponent,
1797
- GoAHeroBannerLinkComponent,
1798
- GoAPageLoadIndicatorComponent,
1799
- GoASkeletonImageContentComponent,
1800
- GoASkeletonElementComponent,
1801
- GoAElementLoadIndicatorComponent,
1802
- ],
1803
- providers: [GoARadioService],
1804
- },] }
1805
- ];
1806
-
1807
- class GoACheckboxChange {
1808
- }
1809
-
1810
- class GoABadgeComponent {
1811
- constructor() {
1812
- this.type = 'light';
1813
- }
1814
- get badgeClass() {
1815
- return `badge-${this.type}`;
1816
- }
1817
- /* eslint-disable @angular-eslint/no-empty-lifecycle-method */
1818
- ngOnInit() { }
1819
- }
1820
- GoABadgeComponent.decorators = [
1821
- { type: Component, args: [{
1822
- selector: 'goa-badge',
1823
- template: "<div class=\"goa-badge\" [ngClass]=\"badgeClass\">\n <ng-content class=\"goa-badge-icon\" select=\"mat-icon,.goa-badge-icon\"></ng-content>\n <div class=\"goa-badge-content\">\n <ng-content></ng-content>\n </div>\n</div>\n",
1824
- changeDetection: ChangeDetectionStrategy.OnPush,
1825
- styles: [":global .goa-badge-icon{font-size:14px}.goa-badge{display:inline-flex;align-items:center;border-radius:4px;padding:0 .5rem;grid-gap:4px;gap:4px}.goa-badge+.goa-badge{margin-left:.25rem}.goa-badge-content{text-transform:capitalize;font-size:14px;font-weight:400;line-height:24px}.goa-badge.badge-information{background-color:#f1f1f1;color:#005daa}.goa-badge.badge-success{background-color:#00853f;color:#fff}.goa-badge.badge-warning{background-color:#feba35;color:#333}.goa-badge.badge-emergency{background-color:#ec040b;color:#fff}.goa-badge.badge-dark{background-color:#333;color:#fff}.goa-badge.badge-midtone{background-color:#767676;color:#fff}.goa-badge.badge-light{background-color:#fff;color:#333}.goa-badge.badge-inactive{background-color:#fff;color:#333}\n"]
1826
- },] }
1827
- ];
1828
- GoABadgeComponent.ctorParameters = () => [];
1829
- GoABadgeComponent.propDecorators = {
1830
- type: [{ type: Input }]
1831
- };
1832
-
1833
- class GoAAppVersionHeaderComponent {
1834
- constructor() {
1835
- this.isProdEnvironment = false;
1836
- this.environment = '';
1837
- this.version = '';
1838
- this.closed = new EventEmitter();
1839
- }
1840
- ngOnInit() {
1841
- }
1842
- onCloseClick() {
1843
- this.closed.next(true);
1844
- }
1845
- }
1846
- GoAAppVersionHeaderComponent.decorators = [
1847
- { type: Component, args: [{
1848
- selector: 'goa-app-version-header',
1849
- template: "<div\n *ngIf=\"!isProdEnvironment && (closed | async) === null\"\n class=\"goa-app-version-header\"\n>\n <span class=\"content-wrapper\">\n <span class=\"environment-and-version\">{{ environment }} {{ version }}</span>\n <span class=\"close\" (click)=\"onCloseClick()\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"ionicon\"\n viewBox=\"0 0 512 512\"\n >\n <title>Close</title>\n <path\n fill=\"currentColor\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"32\"\n d=\"M368 368L144 144M368 144L144 368\"\n />\n </svg>\n </span>\n </span>\n</div>\n",
1850
- changeDetection: ChangeDetectionStrategy.OnPush,
1851
- styles: [".goa-app-version-header{display:flex;justify-content:center;background-color:#dcdcdc}.goa-app-version-header .content-wrapper{display:flex;flex:1 1 auto;margin:0 24px;max-width:1200px}@media (min-width: 768px){.goa-app-version-header .content-wrapper{margin:0 72px}}.goa-app-version-header .content-wrapper .environment-and-version{display:flex;flex:1 1 auto;justify-content:center;padding-left:20px}.goa-app-version-header .content-wrapper .close{margin-left:auto;width:20px;text-align:right;font-weight:bold;font-size:small;align-self:center;cursor:pointer;display:flex}.goa-app-version-header .content-wrapper .close svg{color:#0070c4}\n"]
1852
- },] }
1853
- ];
1854
- GoAAppVersionHeaderComponent.ctorParameters = () => [];
1855
- GoAAppVersionHeaderComponent.propDecorators = {
1856
- isProdEnvironment: [{ type: Input }],
1857
- environment: [{ type: Input }],
1858
- version: [{ type: Input }],
1859
- closed: [{ type: Output }]
1860
- };
1861
-
1862
- class GoANumberInputComponent {
1863
- constructor() {
1864
- this._isTouched = false;
1865
- /**
1866
- * Sets the step value that is used when incrementing / decrementing
1867
- *
1868
- * @memberof GoANumberInputComponent
1869
- */
1870
- this.step = 1;
1871
- /**
1872
- * An event that fires whenever the value is changed
1873
- *
1874
- * @type {EventEmitter<number | undefined | null>}
1875
- * @memberof GoANumberInputComponent
1876
- */
1877
- this.valueChanged = new EventEmitter();
1878
- }
1879
- get input() {
1880
- var _a;
1881
- return (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.nativeElement;
1882
- }
1883
- /**
1884
- * The value of the NumberInput
1885
- *
1886
- * @memberof GoANumberInputComponent
1887
- */
1888
- set value(val) {
1889
- var _a;
1890
- const newVal = (val === undefined || val === null || Number.isNaN(val)) ? null : this.clampValue(val);
1891
- if (this._value !== newVal) {
1892
- this._value = newVal;
1893
- (_a = this.onChange) === null || _a === void 0 ? void 0 : _a.call(this, newVal);
1894
- this.valueChanged.emit(newVal);
1895
- }
1896
- if (this.input && this.input.valueAsNumber !== newVal) {
1897
- this.input.valueAsNumber = newVal;
1898
- }
1899
- }
1900
- get value() {
1901
- return this._value;
1902
- }
1903
- /**
1904
- * Sets the minimum value that the number input can take
1905
- *
1906
- * @memberof GoANumberInputComponent
1907
- */
1908
- set min(min) {
1909
- this._min = min;
1910
- // force reevaluation / clamping
1911
- this.value = this._value;
1912
- }
1913
- get min() {
1914
- return this._min;
1915
- }
1916
- /**
1917
- * Sets the maximum value that the number input can take
1918
- *
1919
- * @memberof GoANumberInputComponent
1920
- */
1921
- set max(max) {
1922
- this._max = max;
1923
- // force reevaluation / clamping
1924
- this.value = this._value;
1925
- }
1926
- get max() {
1927
- return this._max;
1928
- }
1929
- clampValue(val) {
1930
- if (Number.isFinite(this.max)) {
1931
- val = Math.min(this.max, val);
1932
- }
1933
- if (Number.isFinite(this.min)) {
1934
- val = Math.max(val, this.min);
1935
- }
1936
- return val;
1937
- }
1938
- markTouched() {
1939
- var _a;
1940
- if (this._isTouched === false) {
1941
- this._isTouched = true;
1942
- (_a = this.onTouched) === null || _a === void 0 ? void 0 : _a.call(this);
1943
- }
1944
- }
1945
- handleInput(event) {
1946
- var _a;
1947
- const inputString = (_a = event.data) !== null && _a !== void 0 ? _a : '';
1948
- // If someone is typing a negative number, let them
1949
- if (inputString.trim() !== '-') {
1950
- this.value = event.target.valueAsNumber;
1951
- }
1952
- }
1953
- /**
1954
- * Increment the number input
1955
- *
1956
- * @memberof GoANumberInputComponent
1957
- */
1958
- increment() {
1959
- // use built-in browser increment logic
1960
- this.input.stepUp();
1961
- this.value = this.input.valueAsNumber;
1962
- }
1963
- /**
1964
- * Decrement the number input
1965
- *
1966
- * @memberof GoANumberInputComponent
1967
- */
1968
- decrement() {
1969
- // use built-in browser decrement logic
1970
- this.input.stepDown();
1971
- this.value = this.input.valueAsNumber;
1972
- }
1973
- // CONTROL VALUE ACCESSOR INTERFACE
1974
- writeValue(value) {
1975
- this.value = value;
1976
- }
1977
- registerOnChange(handler) {
1978
- this.onChange = handler;
1979
- }
1980
- registerOnTouched(handler) {
1981
- this.onTouched = handler;
1982
- }
1983
- setDisabledState(isDisabled) {
1984
- this.disabled = isDisabled;
1985
- }
1986
- }
1987
- GoANumberInputComponent.decorators = [
1988
- { type: Component, args: [{
1989
- selector: 'goa-number-input',
1990
- template: "<div (focusout)=\"markTouched()\" class=\"number-input-container\">\n <button\n [disabled]=\"disabled || (min !== undefined && value <= min)\"\n goa-button\n buttonType=\"primary\"\n buttonSize=\"small\"\n type=\"button\"\n (click)=\"decrement()\"\n >\n <svg width=\"1em\" height=\"100%\" viewBox=\"0 0 100 100\">\n <line x1=\"25%\" y1=\"50%\" x2=\"75%\" y2=\"50%\" stroke-width=\"15%\" />\n </svg>\n </button>\n\n <input\n #numberInput\n type=\"number\"\n [min]=\"min\"\n [max]=\"max\"\n [value]=\"value\"\n [step]=\"step\"\n [disabled]=\"disabled\"\n (input)=\"handleInput($event)\"\n />\n\n <button\n goa-button\n [disabled]=\"disabled || (max !== undefined && value >= max)\"\n buttonType=\"primary\"\n buttonSize=\"small\"\n type=\"button\"\n (click)=\"increment()\"\n >\n <svg width=\"1em\" height=\"100%\" viewBox=\"0 0 100 100\">\n <line x1=\"25%\" y1=\"50%\" x2=\"75%\" y2=\"50%\" stroke-width=\"15%\" />\n <line x1=\"50%\" y1=\"25%\" x2=\"50%\" y2=\"75%\" stroke-width=\"15%\" />\n </svg>\n </button>\n</div>\n",
1991
- providers: [
1992
- {
1993
- provide: NG_VALUE_ACCESSOR,
1994
- useExisting: forwardRef(() => GoANumberInputComponent),
1995
- multi: true
1996
- },
1997
- ],
1998
- styles: ["::ng-deep .ng-touched.ng-invalid>.number-input-container{border:2px solid #fc1921;border-radius:6px}:host{display:block}.number-input-container{display:flex;flex-direction:row;align-items:stretch;height:40px;padding:0;outline:0px}.number-input-container>input{border:solid 1px #dcdcdc;min-width:75px;width:0;flex:1;border-radius:0;padding:6px;-moz-appearance:textfield}.number-input-container>input:focus-visible{outline:unset;border-color:#feba35;border-width:2px}.number-input-container>input::-webkit-outer-spin-button,.number-input-container>input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.number-input-container>:first-child{border-radius:4px 0 0 4px}.number-input-container>:last-child{border-radius:0 4px 4px 0}.number-input-container>button{min-width:30px;margin:0;padding:0;z-index:1;font-size:20px}.number-input-container>button>svg{stroke:#fff}.number-input-container>button:disabled>svg{stroke:#666}.number-input-container>button:hover>svg{stroke:#fff}\n"]
1999
- },] }
2000
- ];
2001
- GoANumberInputComponent.propDecorators = {
2002
- inputElement: [{ type: ViewChild, args: ['numberInput',] }],
2003
- disabled: [{ type: Input }],
2004
- step: [{ type: Input }],
2005
- valueChanged: [{ type: Output }],
2006
- value: [{ type: Input }],
2007
- min: [{ type: Input }],
2008
- max: [{ type: Input }]
2009
- };
2010
-
2011
- class ExperimentalComponentsModule {
2012
- }
2013
- ExperimentalComponentsModule.decorators = [
2014
- { type: NgModule, args: [{
2015
- imports: [
2016
- CommonModule,
2017
- AngularComponentsModule
2018
- ],
2019
- exports: [
2020
- GoABadgeComponent,
2021
- GoAAppVersionHeaderComponent,
2022
- GoANumberInputComponent,
2023
- ],
2024
- declarations: [
2025
- GoABadgeComponent,
2026
- GoAAppVersionHeaderComponent,
2027
- GoANumberInputComponent,
2028
- ],
2029
- providers: [],
2030
- },] }
2031
- ];
137
+ AngularComponentsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AngularComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
138
+ AngularComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AngularComponentsModule, declarations: [ValueDirective, ValueListDirective], exports: [ValueDirective, ValueListDirective] });
139
+ AngularComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AngularComponentsModule });
140
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AngularComponentsModule, decorators: [{
141
+ type: NgModule,
142
+ args: [{
143
+ declarations: [ValueDirective, ValueListDirective],
144
+ exports: [ValueDirective, ValueListDirective],
145
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
146
+ }]
147
+ }] });
2032
148
 
2033
149
  /**
2034
150
  * Generated bundle index. Do not edit.
2035
151
  */
2036
152
 
2037
- export { AngularComponentsModule, ExperimentalComponentsModule, GOA_CHECKBOX_CONTROL_VALUE_ACCESSOR, GOA_RADIO_CONTROL_VALUE_ACCESSOR, GOA_RADIO_GROUP, GOA_RADIO_GROUP_CONTROL_VALUE_ACCESSOR, GoAAppVersionHeaderComponent, GoABadgeComponent, GoAButtonComponent, GoAButtonLinkComponent, GoACalloutComponent, GoACardComponent, GoACardContentComponent, GoACardFooterComponent, GoACardGroupComponent, GoACardHeaderComponent, GoACardThumbImageComponent, GoACheckboxChange, GoACheckboxComponent, GoADropdownComponent, GoAElementLoadIndicatorComponent, GoAHeaderComponent, GoAHeroBannerComponent, GoAHeroBannerContentComponent, GoAHeroBannerLinkComponent, GoAMicrositeLogoComponent, GoANotificationBannerComponent, GoANotificationComponent, GoANumberInputComponent, GoAOptionComponent, GoAOptionGroupComponent, GoAPageLoadIndicatorComponent, GoARadioChange, GoARadioComponent, GoARadioGroupComponent, GoARadioService, GoASkeletonElementComponent, GoASkeletonImageContentComponent };
153
+ export { AngularComponentsModule, ValueDirective, ValueListDirective };
2038
154
  //# sourceMappingURL=abgov-angular-components.js.map