@theseam/ui-common 0.4.10 → 0.4.12

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 (93) hide show
  1. package/buttons/badge-button/badge-button.component.d.ts +7 -7
  2. package/buttons/button/button.component.d.ts +6 -6
  3. package/buttons/buttons.module.d.ts +1 -1
  4. package/buttons/progress-circle-button/progress-circle-button.component.d.ts +4 -4
  5. package/buttons/toggle-button/toggle-button.component.d.ts +4 -4
  6. package/esm2020/buttons/badge-button/badge-button.component.mjs +10 -10
  7. package/esm2020/buttons/button/button.component.mjs +9 -9
  8. package/esm2020/buttons/buttons.module.mjs +29 -29
  9. package/esm2020/buttons/progress-circle-button/progress-circle-button.component.mjs +10 -10
  10. package/esm2020/buttons/toggle-button/toggle-button.component.mjs +8 -8
  11. package/esm2020/carousel/carousel.component.mjs +3 -2
  12. package/esm2020/datatable/datatable-export-button/datatable-export-button.component.mjs +1 -1
  13. package/esm2020/framework/dashboard/dashboard-widgets/dashboard-widgets.component.mjs +1 -1
  14. package/esm2020/framework/schema-form-controls/schema-form-submit-split/schema-form-submit-split.component.mjs +1 -1
  15. package/esm2020/framework/side-nav/side-nav-item/side-nav-item.component.mjs +11 -3
  16. package/esm2020/framework/side-nav/side-nav.component.mjs +29 -4
  17. package/esm2020/framework/side-nav/side-nav.models.mjs +1 -1
  18. package/esm2020/google-maps/google-maps-places-autocomplete/google-maps-places-autocomplete.component.mjs +3 -3
  19. package/esm2020/loading/loading/loading.component.mjs +5 -5
  20. package/esm2020/loading/loading-overlay.service.mjs +3 -3
  21. package/esm2020/loading/loading.module.mjs +6 -6
  22. package/esm2020/services/preferences/preferences-accessor.mjs +1 -1
  23. package/esm2020/services/preferences/preferences-manager.service.mjs +1 -1
  24. package/esm2020/services/preferences/preferences-record.mjs +1 -1
  25. package/esm2020/services/preferences/preferences.models.mjs +1 -1
  26. package/esm2020/story-helpers/arg-type-helpers.mjs +5 -9
  27. package/esm2020/story-helpers/story-preferences-accessor.service.mjs +1 -1
  28. package/esm2020/testing/get-harness.mjs +8 -2
  29. package/esm2020/testing/story-expect.mjs +3 -2
  30. package/esm2020/toggle-edit/toggle-edit.component.mjs +1 -1
  31. package/esm2020/utils/geo-json/coerce-feature-collection.mjs +1 -1
  32. package/esm2020/utils/geo-json/is-feature-collection.validator.mjs +1 -1
  33. package/esm2020/utils/geo-json/is-only-geometry-types.mjs +1 -1
  34. package/esm2020/utils/geo-json/merge-polygons.mjs +1 -1
  35. package/esm2020/utils/geo-json/no-inner-rings.validator.mjs +1 -1
  36. package/esm2020/utils/geo-json/split-multi-polygons.mjs +1 -1
  37. package/esm2020/widget/preferences/widget-preferences.models.mjs +1 -1
  38. package/esm2020/widget/preferences/widget-preferences.service.mjs +1 -1
  39. package/esm2020/widget/preferences/widget-preferences.token.mjs +1 -1
  40. package/esm2020/widget/widget/widget.component.mjs +3 -3
  41. package/esm2020/widget/widget.models.mjs +1 -1
  42. package/fesm2015/theseam-ui-common-buttons.mjs +55 -55
  43. package/fesm2015/theseam-ui-common-buttons.mjs.map +1 -1
  44. package/fesm2015/theseam-ui-common-carousel.mjs +2 -1
  45. package/fesm2015/theseam-ui-common-carousel.mjs.map +1 -1
  46. package/fesm2015/theseam-ui-common-datatable.mjs +1 -1
  47. package/fesm2015/theseam-ui-common-datatable.mjs.map +1 -1
  48. package/fesm2015/theseam-ui-common-framework.mjs +41 -8
  49. package/fesm2015/theseam-ui-common-framework.mjs.map +1 -1
  50. package/fesm2015/theseam-ui-common-google-maps.mjs +2 -2
  51. package/fesm2015/theseam-ui-common-google-maps.mjs.map +1 -1
  52. package/fesm2015/theseam-ui-common-loading.mjs +10 -10
  53. package/fesm2015/theseam-ui-common-loading.mjs.map +1 -1
  54. package/fesm2015/theseam-ui-common-services.mjs.map +1 -1
  55. package/fesm2015/theseam-ui-common-story-helpers.mjs +4 -8
  56. package/fesm2015/theseam-ui-common-story-helpers.mjs.map +1 -1
  57. package/fesm2015/theseam-ui-common-testing.mjs +9 -2
  58. package/fesm2015/theseam-ui-common-testing.mjs.map +1 -1
  59. package/fesm2015/theseam-ui-common-toggle-edit.mjs +1 -1
  60. package/fesm2015/theseam-ui-common-toggle-edit.mjs.map +1 -1
  61. package/fesm2015/theseam-ui-common-utils.mjs.map +1 -1
  62. package/fesm2015/theseam-ui-common-widget.mjs +2 -2
  63. package/fesm2015/theseam-ui-common-widget.mjs.map +1 -1
  64. package/fesm2020/theseam-ui-common-buttons.mjs +55 -55
  65. package/fesm2020/theseam-ui-common-buttons.mjs.map +1 -1
  66. package/fesm2020/theseam-ui-common-carousel.mjs +2 -1
  67. package/fesm2020/theseam-ui-common-carousel.mjs.map +1 -1
  68. package/fesm2020/theseam-ui-common-datatable.mjs +1 -1
  69. package/fesm2020/theseam-ui-common-datatable.mjs.map +1 -1
  70. package/fesm2020/theseam-ui-common-framework.mjs +40 -7
  71. package/fesm2020/theseam-ui-common-framework.mjs.map +1 -1
  72. package/fesm2020/theseam-ui-common-google-maps.mjs +2 -2
  73. package/fesm2020/theseam-ui-common-google-maps.mjs.map +1 -1
  74. package/fesm2020/theseam-ui-common-loading.mjs +10 -10
  75. package/fesm2020/theseam-ui-common-loading.mjs.map +1 -1
  76. package/fesm2020/theseam-ui-common-services.mjs.map +1 -1
  77. package/fesm2020/theseam-ui-common-story-helpers.mjs +4 -8
  78. package/fesm2020/theseam-ui-common-story-helpers.mjs.map +1 -1
  79. package/fesm2020/theseam-ui-common-testing.mjs +9 -2
  80. package/fesm2020/theseam-ui-common-testing.mjs.map +1 -1
  81. package/fesm2020/theseam-ui-common-toggle-edit.mjs +1 -1
  82. package/fesm2020/theseam-ui-common-toggle-edit.mjs.map +1 -1
  83. package/fesm2020/theseam-ui-common-utils.mjs.map +1 -1
  84. package/fesm2020/theseam-ui-common-widget.mjs +2 -2
  85. package/fesm2020/theseam-ui-common-widget.mjs.map +1 -1
  86. package/framework/side-nav/side-nav-item/side-nav-item.component.d.ts +5 -2
  87. package/framework/side-nav/side-nav.component.d.ts +6 -2
  88. package/framework/side-nav/side-nav.models.d.ts +12 -0
  89. package/loading/loading/loading.component.d.ts +3 -3
  90. package/loading/loading.module.d.ts +1 -1
  91. package/package.json +1 -1
  92. package/testing/get-harness.d.ts +2 -2
  93. package/testing/story-expect.d.ts +1 -0
@@ -26,7 +26,7 @@ const primaryThemeConfig = {
26
26
  tertiaryColour: 'rgba(53,126,189,0.7)'
27
27
  };
28
28
 
29
- class LoadingComponent {
29
+ class TheSeamLoadingComponent {
30
30
  constructor() {
31
31
  this._theme = defaultThemeConfig;
32
32
  }
@@ -39,9 +39,9 @@ class LoadingComponent {
39
39
  }
40
40
  }
41
41
  }
42
- LoadingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: LoadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
43
- LoadingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: LoadingComponent, selector: "seam-loading", inputs: { theme: "theme" }, ngImport: i0, template: "<ngx-loading [show]=\"true\" [config]=\"_theme\"></ngx-loading>\n", styles: [":host{display:block;position:absolute;inset:0;z-index:9000}\n"], dependencies: [{ kind: "component", type: i1.NgxLoadingComponent, selector: "ngx-loading", inputs: ["config", "show", "template"] }] });
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: LoadingComponent, decorators: [{
42
+ TheSeamLoadingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: TheSeamLoadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
43
+ TheSeamLoadingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: TheSeamLoadingComponent, selector: "seam-loading", inputs: { theme: "theme" }, ngImport: i0, template: "<ngx-loading [show]=\"true\" [config]=\"_theme\"></ngx-loading>\n", styles: [":host{display:block;position:absolute;inset:0;z-index:9000}\n"], dependencies: [{ kind: "component", type: i1.NgxLoadingComponent, selector: "ngx-loading", inputs: ["config", "show", "template"] }] });
44
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: TheSeamLoadingComponent, decorators: [{
45
45
  type: Component,
46
46
  args: [{ selector: 'seam-loading', template: "<ngx-loading [show]=\"true\" [config]=\"_theme\"></ngx-loading>\n", styles: [":host{display:block;position:absolute;inset:0;z-index:9000}\n"] }]
47
47
  }], propDecorators: { theme: [{
@@ -74,7 +74,7 @@ class TheSeamLoadingOverlayService {
74
74
  width: '100%',
75
75
  height: '100%'
76
76
  });
77
- this._overlayRef.attach(new ComponentPortal(LoadingComponent));
77
+ this._overlayRef.attach(new ComponentPortal(TheSeamLoadingComponent));
78
78
  this._enabled = true;
79
79
  }
80
80
  disable() {
@@ -104,9 +104,9 @@ const loadingForRoot = NgxLoadingModule.forRoot(defaultThemeConfig);
104
104
  class TheSeamLoadingModule {
105
105
  }
106
106
  TheSeamLoadingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: TheSeamLoadingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
107
- TheSeamLoadingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: TheSeamLoadingModule, declarations: [LoadingComponent], imports: [CommonModule,
107
+ TheSeamLoadingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: TheSeamLoadingModule, declarations: [TheSeamLoadingComponent], imports: [CommonModule,
108
108
  OverlayModule,
109
- PortalModule, i1.NgxLoadingModule], exports: [LoadingComponent] });
109
+ PortalModule, i1.NgxLoadingModule], exports: [TheSeamLoadingComponent] });
110
110
  TheSeamLoadingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: TheSeamLoadingModule, providers: [
111
111
  TheSeamLoadingOverlayService
112
112
  ], imports: [CommonModule,
@@ -116,7 +116,7 @@ TheSeamLoadingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ve
116
116
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: TheSeamLoadingModule, decorators: [{
117
117
  type: NgModule,
118
118
  args: [{
119
- declarations: [LoadingComponent],
119
+ declarations: [TheSeamLoadingComponent],
120
120
  imports: [
121
121
  CommonModule,
122
122
  OverlayModule,
@@ -126,7 +126,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
126
126
  providers: [
127
127
  TheSeamLoadingOverlayService
128
128
  ],
129
- exports: [LoadingComponent]
129
+ exports: [TheSeamLoadingComponent]
130
130
  }]
131
131
  }] });
132
132
 
@@ -134,5 +134,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
134
134
  * Generated bundle index. Do not edit.
135
135
  */
136
136
 
137
- export { LoadingComponent, TheSeamLoadingModule, TheSeamLoadingOverlayService, defaultThemeConfig, loadingForRoot, primaryThemeConfig };
137
+ export { TheSeamLoadingComponent, TheSeamLoadingModule, TheSeamLoadingOverlayService, defaultThemeConfig, loadingForRoot, primaryThemeConfig };
138
138
  //# sourceMappingURL=theseam-ui-common-loading.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"theseam-ui-common-loading.mjs","sources":["../../../projects/ui-common/loading/loading-themes.ts","../../../projects/ui-common/loading/loading/loading.component.ts","../../../projects/ui-common/loading/loading/loading.component.html","../../../projects/ui-common/loading/loading-overlay.service.ts","../../../projects/ui-common/loading/loading.module.ts","../../../projects/ui-common/loading/theseam-ui-common-loading.ts"],"sourcesContent":["import { ngxLoadingAnimationTypes, NgxLoadingConfig } from '@marklb/ngx-loading'\n\nexport const defaultThemeConfig: NgxLoadingConfig = {\n animationType: ngxLoadingAnimationTypes.threeBounce,\n backdropBackgroundColour: 'rgba(0,0,0,0.3)',\n backdropBorderRadius: '0px',\n primaryColour: '#ffffff',\n secondaryColour: '#ffffff',\n tertiaryColour: '#ffffff'\n}\n\nexport const primaryThemeConfig: NgxLoadingConfig = {\n animationType: ngxLoadingAnimationTypes.threeBounce,\n backdropBackgroundColour: 'rgba(250,250,250,0.2)',\n backdropBorderRadius: '0px',\n primaryColour: 'rgba(53,126,189,0.7)',\n secondaryColour: 'rgba(53,126,189,0.7)',\n tertiaryColour: 'rgba(53,126,189,0.7)'\n}\n","import { Component, Input } from '@angular/core'\n\nimport { NgxLoadingConfig } from '@marklb/ngx-loading'\n\nimport { defaultThemeConfig, primaryThemeConfig } from '../loading-themes'\nimport type { TheSeamLoadingTheme } from '../loading.models'\n\n@Component({\n selector: 'seam-loading',\n templateUrl: './loading.component.html',\n styleUrls: ['./loading.component.scss']\n})\nexport class LoadingComponent {\n\n @Input()\n set theme(value: TheSeamLoadingTheme) {\n if (value === 'primary') {\n this._theme = primaryThemeConfig\n } else {\n this._theme = defaultThemeConfig\n }\n }\n _theme: NgxLoadingConfig = defaultThemeConfig\n\n}\n","<ngx-loading [show]=\"true\" [config]=\"_theme\"></ngx-loading>\n","import { Overlay, OverlayRef } from '@angular/cdk/overlay'\nimport { ComponentPortal } from '@angular/cdk/portal'\nimport { Injectable } from '@angular/core'\nimport { Observable, throwError } from 'rxjs'\nimport { catchError, finalize, tap } from 'rxjs/operators'\n\nimport { LoadingComponent } from './loading/loading.component'\n\n@Injectable()\nexport class TheSeamLoadingOverlayService {\n\n private _enabled = false\n\n private _overlayRef?: OverlayRef\n\n constructor(\n private _overlay: Overlay\n ) { }\n\n get enabled(): boolean {\n return this._enabled\n }\n\n public toggle(enabled?: boolean) {\n const enable = enabled === undefined ? !this.enabled : enabled\n if (enable && !this.enabled) {\n this.enable()\n } else if (!enable && this.enabled) {\n this.disable()\n }\n }\n\n public enable() {\n if (this.enabled) { return }\n\n this._overlayRef = this._overlay.create({\n hasBackdrop: false,\n width: '100%',\n height: '100%'\n })\n this._overlayRef.attach(new ComponentPortal(LoadingComponent))\n\n this._enabled = true\n }\n\n public disable() {\n if (!this.enabled) { return }\n\n this._overlayRef?.dispose()\n\n this._enabled = false\n }\n\n public while<T = any>(source: Observable<T>): Observable<T> {\n this.enable()\n return source\n .pipe(\n tap(() => this.disable()),\n catchError(err => {\n this.disable()\n return throwError(err)\n }),\n finalize(() => this.disable())\n )\n }\n\n}\n","import { OverlayModule } from '@angular/cdk/overlay'\nimport { PortalModule } from '@angular/cdk/portal'\nimport { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\n\nimport { NgxLoadingModule } from '@marklb/ngx-loading'\n\nimport { TheSeamLoadingOverlayService } from './loading-overlay.service'\nimport { defaultThemeConfig } from './loading-themes'\nimport { LoadingComponent } from './loading/loading.component'\n\n// NOTE: Named export used for this because of a function calling bug in the builder.\nexport const loadingForRoot = NgxLoadingModule.forRoot(defaultThemeConfig)\n\n@NgModule({\n declarations: [LoadingComponent],\n imports: [\n CommonModule,\n OverlayModule,\n PortalModule,\n loadingForRoot\n ],\n providers: [\n TheSeamLoadingOverlayService\n ],\n exports: [LoadingComponent]\n})\nexport class TheSeamLoadingModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;AAEa,MAAA,kBAAkB,GAAqB;IAClD,aAAa,EAAE,wBAAwB,CAAC,WAAW;AACnD,IAAA,wBAAwB,EAAE,iBAAiB;AAC3C,IAAA,oBAAoB,EAAE,KAAK;AAC3B,IAAA,aAAa,EAAE,SAAS;AACxB,IAAA,eAAe,EAAE,SAAS;AAC1B,IAAA,cAAc,EAAE,SAAS;EAC1B;AAEY,MAAA,kBAAkB,GAAqB;IAClD,aAAa,EAAE,wBAAwB,CAAC,WAAW;AACnD,IAAA,wBAAwB,EAAE,uBAAuB;AACjD,IAAA,oBAAoB,EAAE,KAAK;AAC3B,IAAA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a;wBACb,YAAY;wBACZ,cAAc;AACjB,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACP,4BAA4B;AAC/B,qBAAA;oBACD,OAAO,EAAE,CAAC,gBAAgB,CAAC;AAC9B,iBAAA,CAAA;;;AC1BD;;AAEG;;;;"}
1
+ {"version":3,"file":"theseam-ui-common-loading.mjs","sources":["../../../projects/ui-common/loading/loading-themes.ts","../../../projects/ui-common/loading/loading/loading.component.ts","../../../projects/ui-common/loading/loading/loading.component.html","../../../projects/ui-common/loading/loading-overlay.service.ts","../../../projects/ui-common/loading/loading.module.ts","../../../projects/ui-common/loading/theseam-ui-common-loading.ts"],"sourcesContent":["import { ngxLoadingAnimationTypes, NgxLoadingConfig } from '@marklb/ngx-loading'\n\nexport const defaultThemeConfig: NgxLoadingConfig = {\n animationType: ngxLoadingAnimationTypes.threeBounce,\n backdropBackgroundColour: 'rgba(0,0,0,0.3)',\n backdropBorderRadius: '0px',\n primaryColour: '#ffffff',\n secondaryColour: '#ffffff',\n tertiaryColour: '#ffffff'\n}\n\nexport const primaryThemeConfig: NgxLoadingConfig = {\n animationType: ngxLoadingAnimationTypes.threeBounce,\n backdropBackgroundColour: 'rgba(250,250,250,0.2)',\n backdropBorderRadius: '0px',\n primaryColour: 'rgba(53,126,189,0.7)',\n secondaryColour: 'rgba(53,126,189,0.7)',\n tertiaryColour: 'rgba(53,126,189,0.7)'\n}\n","import { Component, Input } from '@angular/core'\n\nimport { NgxLoadingConfig } from '@marklb/ngx-loading'\n\nimport { defaultThemeConfig, primaryThemeConfig } from '../loading-themes'\nimport type { TheSeamLoadingTheme } from '../loading.models'\n\n@Component({\n selector: 'seam-loading',\n templateUrl: './loading.component.html',\n styleUrls: ['./loading.component.scss']\n})\nexport class TheSeamLoadingComponent {\n\n @Input()\n set theme(value: TheSeamLoadingTheme) {\n if (value === 'primary') {\n this._theme = primaryThemeConfig\n } else {\n this._theme = defaultThemeConfig\n }\n }\n _theme: NgxLoadingConfig = defaultThemeConfig\n\n}\n","<ngx-loading [show]=\"true\" [config]=\"_theme\"></ngx-loading>\n","import { Overlay, OverlayRef } from '@angular/cdk/overlay'\nimport { ComponentPortal } from '@angular/cdk/portal'\nimport { Injectable } from '@angular/core'\nimport { Observable, throwError } from 'rxjs'\nimport { catchError, finalize, tap } from 'rxjs/operators'\n\nimport { TheSeamLoadingComponent } from './loading/loading.component'\n\n@Injectable()\nexport class TheSeamLoadingOverlayService {\n\n private _enabled = false\n\n private _overlayRef?: OverlayRef\n\n constructor(\n private _overlay: Overlay\n ) { }\n\n get enabled(): boolean {\n return this._enabled\n }\n\n public toggle(enabled?: boolean) {\n const enable = enabled === undefined ? !this.enabled : enabled\n if (enable && !this.enabled) {\n this.enable()\n } else if (!enable && this.enabled) {\n this.disable()\n }\n }\n\n public enable() {\n if (this.enabled) { return }\n\n this._overlayRef = this._overlay.create({\n hasBackdrop: false,\n width: '100%',\n height: '100%'\n })\n this._overlayRef.attach(new ComponentPortal(TheSeamLoadingComponent))\n\n this._enabled = true\n }\n\n public disable() {\n if (!this.enabled) { return }\n\n this._overlayRef?.dispose()\n\n this._enabled = false\n }\n\n public while<T = any>(source: Observable<T>): Observable<T> {\n this.enable()\n return source\n .pipe(\n tap(() => this.disable()),\n catchError(err => {\n this.disable()\n return throwError(err)\n }),\n finalize(() => this.disable())\n )\n }\n\n}\n","import { OverlayModule } from '@angular/cdk/overlay'\nimport { PortalModule } from '@angular/cdk/portal'\nimport { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\n\nimport { NgxLoadingModule } from '@marklb/ngx-loading'\n\nimport { TheSeamLoadingOverlayService } from './loading-overlay.service'\nimport { defaultThemeConfig } from './loading-themes'\nimport { TheSeamLoadingComponent } from './loading/loading.component'\n\n// NOTE: Named export used for this because of a function calling bug in the builder.\nexport const loadingForRoot = NgxLoadingModule.forRoot(defaultThemeConfig)\n\n@NgModule({\n declarations: [TheSeamLoadingComponent],\n imports: [\n CommonModule,\n OverlayModule,\n PortalModule,\n loadingForRoot\n ],\n providers: [\n TheSeamLoadingOverlayService\n ],\n exports: [TheSeamLoadingComponent]\n})\nexport class TheSeamLoadingModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;AAEa,MAAA,kBAAkB,GAAqB;IAClD,aAAa,EAAE,wBAAwB,CAAC,WAAW;AACnD,IAAA,wBAAwB,EAAE,iBAAiB;AAC3C,IAAA,oBAAoB,EAAE,KAAK;AAC3B,IAAA,aAAa,EAAE,SAAS;AACxB,IAAA,eAAe,EAAE,SAAS;AAC1B,IAAA,cAAc,EAAE,SAAS;EAC1B;AAEY,MAAA,kBAAkB,GAAqB;IAClD,aAAa,EAAE,wBAAwB,CAAC,WAAW;AACnD,IAAA,wBAAwB,EAAE,uBAAuB;AACjD,IAAA,oBAAoB,EAAE,KAAK;AAC3B,IAAA,aAAa,EAAE,sBAAsB;AACrC,IAAA,eAAe,EAAE,sBAAsB;AACvC,IAAA,cAAc,EAAE,sBAAsB;;;MCL3B,uBAAuB,CAAA;AALpC,IAAA,WAAA,GAAA;QAeE,IAAM,CAAA,MAAA,GAAqB,kBAAkB,CAAA;AAE9C,KAAA;IAVC,IACI,KAAK,CAAC,KAA0B,EAAA;QAClC,IAAI,KAAK,KAAK,SAAS,EAAE;AACvB,YAAA,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAA;AACjC,SAAA;AAAM,aAAA;AACL,YAAA,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAA;AACjC,SAAA;KACF;;oHATU,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAvB,uBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,uBAAuB,gFCZpC,mEACA,EAAA,MAAA,EAAA,CAAA,+D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ElC,YAAY;QACZ,aAAa;AACb,QAAA,YAAY,kCAMN,uBAAuB,CAAA,EAAA,CAAA,CAAA;AAExB,oBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,EALlB,SAAA,EAAA;QACP,4BAA4B;AAC/B,KAAA,EAAA,OAAA,EAAA,CAPG,YAAY;QACZ,aAAa;QACb,YAAY;QACZ,cAAc,CAAA,EAAA,CAAA,CAAA;2FAOT,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAbhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,uBAAuB,CAAC;AACvC,oBAAA,OAAO,EAAE;wBACL,YAAY;wBACZ,aAAa;wBACb,YAAY;wBACZ,cAAc;AACjB,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACP,4BAA4B;AAC/B,qBAAA;oBACD,OAAO,EAAE,CAAC,uBAAuB,CAAC;AACrC,iBAAA,CAAA;;;AC1BD;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"theseam-ui-common-services.mjs","sources":["../../../projects/ui-common/services/preferences/preferences-record.ts","../../../projects/ui-common/services/preferences/preferences-manager.service.ts","../../../projects/ui-common/services/asset-loader.service.ts","../../../projects/ui-common/services/router-helpers.service.ts","../../../projects/ui-common/services/font-loader.service.ts","../../../projects/ui-common/services/theseam-ui-common-services.ts"],"sourcesContent":["import { isDevMode } from '@angular/core'\r\nimport { map, Observable, of, shareReplay, startWith, Subject, switchMap, take, tap } from 'rxjs'\r\n\r\nimport { notNullOrUndefined } from '@theseam/ui-common/utils'\r\n\r\nimport { TheSeamPreferencesAccessor } from './preferences-accessor'\r\nimport { TheSeamPreferencesBase } from './preferences.models'\r\n\r\nexport type TheSeamPreferencesRecordStatus = 'pending' | 'loaded'\r\n\r\nexport interface TheSeamPreferencesRecordStatusChange {\r\n previous: TheSeamPreferencesRecordStatus\r\n current: TheSeamPreferencesRecordStatus\r\n}\r\n\r\nexport class TheSeamPreferencesMapRecord {\r\n\r\n private readonly _refreshSubject = new Subject<void>()\r\n private readonly _statusChangeSubject = new Subject<TheSeamPreferencesRecordStatusChange>()\r\n\r\n private _status: TheSeamPreferencesRecordStatus = 'pending'\r\n\r\n public readonly observable: Observable<TheSeamPreferencesBase>\r\n public readonly statusChange: Observable<TheSeamPreferencesRecordStatusChange>\r\n\r\n constructor(\r\n private readonly _key: string,\r\n private readonly _accessor: TheSeamPreferencesAccessor,\r\n private readonly _emptyPrefs: TheSeamPreferencesBase,\r\n ) {\r\n this.observable = this._createObservable()\r\n this.statusChange = this._statusChangeSubject.asObservable()\r\n }\r\n\r\n private _createObservable(): Observable<TheSeamPreferencesBase> {\r\n if (!this._accessor) {\r\n return of(this._emptyPrefs)\r\n }\r\n\r\n const accessor = (key: string): Observable<string> =>\r\n this._accessor ? this._accessor.get(key) : of(JSON.stringify(this._emptyPrefs))\r\n\r\n return this._refreshSubject.pipe(\r\n startWith(undefined),\r\n switchMap(() => accessor(this._key).pipe(\r\n map(v => {\r\n if (!v) {\r\n return null\r\n }\r\n\r\n // TODO: Add a schema validator and migration tool to avoid parsing issues.\r\n try {\r\n return this._descerializePreferences(v)\r\n } catch (error) {\r\n if (isDevMode()) {\r\n // eslint-disable-next-line no-console\r\n console.error(error)\r\n }\r\n return null\r\n }\r\n }),\r\n map(v => notNullOrUndefined(v) ? v : this._emptyPrefs),\r\n tap(() => {\r\n this._setStatus('loaded')\r\n })\r\n )),\r\n shareReplay({ bufferSize: 1, refCount: true }),\r\n )\r\n }\r\n\r\n public update(value: TheSeamPreferencesBase): void {\r\n this._accessor.update(this._key, JSON.stringify(value)).pipe(take(1)).subscribe()\r\n }\r\n\r\n public delete(): void {\r\n this._accessor.delete(this._key).pipe(take(1)).subscribe()\r\n }\r\n\r\n public refresh(): void {\r\n this._setStatus('pending')\r\n this._refreshSubject.next()\r\n }\r\n\r\n public isSameAccessor(accessor: TheSeamPreferencesAccessor): boolean {\r\n return this._accessor === accessor\r\n }\r\n\r\n public isSameEmptyPrefs(emptyPrefs: TheSeamPreferencesBase): boolean {\r\n return JSON.stringify(this._emptyPrefs) === JSON.stringify(emptyPrefs)\r\n }\r\n\r\n get status(): TheSeamPreferencesRecordStatus {\r\n return this._status\r\n }\r\n\r\n private _setStatus(status: TheSeamPreferencesRecordStatus): void {\r\n if (this._status === status) {\r\n return\r\n }\r\n const prev = this._status\r\n this._status = status\r\n this._statusChangeSubject.next({ previous: prev, current: status })\r\n }\r\n\r\n private _descerializePreferences(serialized: string): TheSeamPreferencesBase {\r\n const prefs = JSON.parse(serialized)\r\n\r\n // TODO: Implement migration\r\n\r\n return prefs\r\n }\r\n}\r\n","import { Injectable } from '@angular/core'\r\nimport { map, Observable } from 'rxjs'\r\n\r\nimport { TheSeamPreferencesBase } from './preferences.models'\r\nimport { TheSeamPreferencesAccessor } from './preferences-accessor'\r\nimport { TheSeamPreferencesMapRecord } from './preferences-record'\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class TheSeamPreferencesManagerService {\r\n\r\n private readonly _tablePrefsMap = new Map<string, TheSeamPreferencesMapRecord>()\r\n\r\n public preferences(\r\n preferenceKey: string,\r\n accessor: TheSeamPreferencesAccessor,\r\n emptyPrefs: TheSeamPreferencesBase,\r\n ): Observable<TheSeamPreferencesBase> {\r\n let prefs = this._tablePrefsMap.get(preferenceKey)\r\n\r\n if (prefs && !prefs.isSameAccessor(accessor)) {\r\n throw Error(`Preferences accessor mismatch for key '${preferenceKey}'. Changing the accessor is not supported.`)\r\n }\r\n\r\n if (prefs && !prefs.isSameEmptyPrefs(emptyPrefs)) {\r\n throw Error(`Preferences emptyPrefs mismatch for key '${preferenceKey}'. Changing the emptyPrefs is not supported.`)\r\n }\r\n\r\n if (!prefs) {\r\n prefs = new TheSeamPreferencesMapRecord(preferenceKey, accessor, emptyPrefs)\r\n this._tablePrefsMap.set(preferenceKey, prefs)\r\n }\r\n return prefs.observable.pipe(\r\n map(v => {\r\n // This is for assuming the accessor returned an empty object, as a\r\n // default for a missing preference. Instead of throwing an error, we\r\n // return a valid empty preferences.\r\n //\r\n // NOTE: May remove this, when a more generic preferences implementation\r\n // is finished.\r\n if (Object.keys(v).length === 0) {\r\n return emptyPrefs\r\n }\r\n\r\n return v\r\n }),\r\n )\r\n }\r\n\r\n public update(preferenceKey: string, value: TheSeamPreferencesBase): void {\r\n const prefs = this._tablePrefsMap.get(preferenceKey)\r\n if (prefs) {\r\n prefs.update(value)\r\n }\r\n }\r\n\r\n public delete(preferenceKey: string): void {\r\n const prefs = this._tablePrefsMap.get(preferenceKey)\r\n if (prefs) {\r\n prefs.delete()\r\n }\r\n }\r\n\r\n public refresh(preferenceKey: string): void {\r\n const prefs = this._tablePrefsMap.get(preferenceKey)\r\n if (prefs) {\r\n prefs.refresh()\r\n }\r\n }\r\n\r\n public isPending(preferenceKey: string): boolean {\r\n const prefs = this._tablePrefsMap.get(preferenceKey)\r\n return prefs ? prefs.status === 'pending' : false\r\n }\r\n\r\n public isLoaded(preferenceKey: string): boolean {\r\n const prefs = this._tablePrefsMap.get(preferenceKey)\r\n return prefs ? prefs.status === 'loaded' : false\r\n }\r\n\r\n}\r\n","import { Injectable } from '@angular/core'\nimport { defer, Observable } from 'rxjs'\nimport { map } from 'rxjs/operators'\n\nimport { loadStyle, loadStyleSheet } from '@theseam/ui-common/utils'\n\nexport class LoadedAssetRef<T extends HTMLLinkElement | HTMLScriptElement | HTMLStyleElement> {\n\n constructor(\n public readonly nativeElement: T,\n public readonly path?: string,\n public readonly content?: string\n ) {\n\n }\n\n public destroy(): void {\n this.nativeElement.parentElement?.removeChild(this.nativeElement)\n }\n\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AssetLoaderService {\n\n public loadStyleSheet(path: string): Observable<LoadedAssetRef<HTMLLinkElement>> {\n return defer(() => loadStyleSheet(path)).pipe(map(v => new LoadedAssetRef(v, path)))\n }\n\n public loadStyle(content: string): Observable<LoadedAssetRef<HTMLStyleElement>> {\n return defer(() => loadStyle(content)).pipe(map(v => new LoadedAssetRef(v, undefined, content)))\n }\n\n}\n","import { Injectable } from '@angular/core'\nimport { IsActiveMatchOptions, NavigationEnd, Router, UrlTree } from '@angular/router'\nimport { Observable } from 'rxjs'\nimport { filter, map, startWith } from 'rxjs/operators'\n\n@Injectable({\n providedIn: 'root'\n})\nexport class RouterHelpersService {\n\n constructor(\n private _router: Router\n ) { }\n\n public isActive(url: string | UrlTree, exact: boolean): Observable<boolean> {\n const opts: IsActiveMatchOptions = exact\n ? { paths: 'exact', queryParams: 'exact', fragment: 'ignored', matrixParams: 'ignored' }\n : { paths: 'subset', queryParams: 'subset', fragment: 'ignored', matrixParams: 'ignored' }\n\n return this._router.events.pipe(\n filter(event => event instanceof NavigationEnd),\n map(event => this._router.isActive(url, opts)),\n startWith(this._router.isActive(url, opts))\n )\n }\n}\n","import { Injectable } from '@angular/core'\n\nimport { Observable, Subscriber } from 'rxjs'\nimport WebFont from 'webfontloader'\n\nimport { hasProperty } from '@theseam/ui-common/utils'\n\nexport type TheSeamFontEvents =\n { type: 'loading' } |\n { type: 'active' } |\n { type: 'inactive' } |\n { type: 'fontloading', familyName: string, fvd: string } |\n { type: 'fontactive', familyName: string, fvd: string } |\n { type: 'fontinactive', familyName: string, fvd: string }\n\n/**\n * Service to help loading fonts.\n *\n * Currently this is just a wrapper for the parts of webfontloader that we need.\n * Eventually this should be generic enough that we can switch loaders without\n * config differences being confusing.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class TheSeamFontLoaderService {\n\n /**\n * Since this method is just a wrapper for webfontloader right now it accepts\n * anything webfontloader's config accepts, so the event callbacks can still\n * be used, but you should us the emitted objects instead. If we decide to\n * support other font loaders then the event callbacks will most likely be\n * removed.\n *\n * NOTE: If you need to use the events callbacks for some reason, this\n * method's returned observable will still need to be subscribed to, because\n * it doesn't start till subscribed to.\n */\n public load(config: WebFont.Config): Observable<TheSeamFontEvents> {\n return new Observable((subscriber: Subscriber<TheSeamFontEvents>) => {\n WebFont.load({\n ...config,\n /** This event is triggered when all fonts have been requested. */\n loading: () => {\n if (hasProperty(config, 'loading')) {\n config.loading()\n }\n subscriber.next({ type: 'loading' })\n },\n /** This event is triggered when the fonts have rendered. */\n active: () => {\n if (hasProperty(config, 'active')) {\n config.active()\n }\n subscriber.next({ type: 'active' })\n },\n /** This event is triggered when the browser does not support linked fonts or if none of the fonts could be loaded. */\n inactive: () => {\n if (hasProperty(config, 'inactive')) {\n config.inactive()\n }\n subscriber.next({ type: 'inactive' })\n },\n /** This event is triggered once for each font that's loaded. */\n fontloading: (familyName: string, fvd: string) => {\n if (hasProperty(config, 'fontloading')) {\n config.fontloading(familyName, fvd)\n }\n subscriber.next({ type: 'fontloading', familyName, fvd })\n },\n /** This event is triggered once for each font that renders. */\n fontactive: (familyName: string, fvd: string) => {\n if (hasProperty(config, 'fontactive')) {\n config.fontactive(familyName, fvd)\n }\n subscriber.next({ type: 'fontactive', familyName, fvd })\n },\n /** This event is triggered if the font can't be loaded. */\n fontinactive: (familyName: string, fvd: string) => {\n if (hasProperty(config, 'fontinactive')) {\n config.fontinactive(familyName, fvd)\n }\n subscriber.next({ type: 'fontinactive', familyName, fvd })\n },\n })\n })\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["map","startWith"],"mappings":";;;;;;;;;MAea,2BAA2B,CAAA;AAUtC,IAAA,WAAA,CACmB,IAAY,EACZ,SAAqC,EACrC,WAAmC,EAAA;QAFnC,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAQ;QACZ,IAAS,CAAA,SAAA,GAAT,SAAS,CAA4B;QACrC,IAAW,CAAA,WAAA,GAAX,WAAW,CAAwB;AAXrC,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,OAAO,EAAQ,CAAA;AACrC,QAAA,IAAA,CAAA,oBAAoB,GA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EAAA,CAAA;kBAHpC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACxBD;;AAEG;;;;"}
1
+ {"version":3,"file":"theseam-ui-common-services.mjs","sources":["../../../projects/ui-common/services/preferences/preferences-record.ts","../../../projects/ui-common/services/preferences/preferences-manager.service.ts","../../../projects/ui-common/services/asset-loader.service.ts","../../../projects/ui-common/services/router-helpers.service.ts","../../../projects/ui-common/services/font-loader.service.ts","../../../projects/ui-common/services/theseam-ui-common-services.ts"],"sourcesContent":["import { isDevMode } from '@angular/core'\nimport { map, Observable, of, shareReplay, startWith, Subject, switchMap, take, tap } from 'rxjs'\n\nimport { notNullOrUndefined } from '@theseam/ui-common/utils'\n\nimport { TheSeamPreferencesAccessor } from './preferences-accessor'\nimport { TheSeamPreferencesBase } from './preferences.models'\n\nexport type TheSeamPreferencesRecordStatus = 'pending' | 'loaded'\n\nexport interface TheSeamPreferencesRecordStatusChange {\n previous: TheSeamPreferencesRecordStatus\n current: TheSeamPreferencesRecordStatus\n}\n\nexport class TheSeamPreferencesMapRecord {\n\n private readonly _refreshSubject = new Subject<void>()\n private readonly _statusChangeSubject = new Subject<TheSeamPreferencesRecordStatusChange>()\n\n private _status: TheSeamPreferencesRecordStatus = 'pending'\n\n public readonly observable: Observable<TheSeamPreferencesBase>\n public readonly statusChange: Observable<TheSeamPreferencesRecordStatusChange>\n\n constructor(\n private readonly _key: string,\n private readonly _accessor: TheSeamPreferencesAccessor,\n private readonly _emptyPrefs: TheSeamPreferencesBase,\n ) {\n this.observable = this._createObservable()\n this.statusChange = this._statusChangeSubject.asObservable()\n }\n\n private _createObservable(): Observable<TheSeamPreferencesBase> {\n if (!this._accessor) {\n return of(this._emptyPrefs)\n }\n\n const accessor = (key: string): Observable<string> =>\n this._accessor ? this._accessor.get(key) : of(JSON.stringify(this._emptyPrefs))\n\n return this._refreshSubject.pipe(\n startWith(undefined),\n switchMap(() => accessor(this._key).pipe(\n map(v => {\n if (!v) {\n return null\n }\n\n // TODO: Add a schema validator and migration tool to avoid parsing issues.\n try {\n return this._descerializePreferences(v)\n } catch (error) {\n if (isDevMode()) {\n // eslint-disable-next-line no-console\n console.error(error)\n }\n return null\n }\n }),\n map(v => notNullOrUndefined(v) ? v : this._emptyPrefs),\n tap(() => {\n this._setStatus('loaded')\n })\n )),\n shareReplay({ bufferSize: 1, refCount: true }),\n )\n }\n\n public update(value: TheSeamPreferencesBase): void {\n this._accessor.update(this._key, JSON.stringify(value)).pipe(take(1)).subscribe()\n }\n\n public delete(): void {\n this._accessor.delete(this._key).pipe(take(1)).subscribe()\n }\n\n public refresh(): void {\n this._setStatus('pending')\n this._refreshSubject.next()\n }\n\n public isSameAccessor(accessor: TheSeamPreferencesAccessor): boolean {\n return this._accessor === accessor\n }\n\n public isSameEmptyPrefs(emptyPrefs: TheSeamPreferencesBase): boolean {\n return JSON.stringify(this._emptyPrefs) === JSON.stringify(emptyPrefs)\n }\n\n get status(): TheSeamPreferencesRecordStatus {\n return this._status\n }\n\n private _setStatus(status: TheSeamPreferencesRecordStatus): void {\n if (this._status === status) {\n return\n }\n const prev = this._status\n this._status = status\n this._statusChangeSubject.next({ previous: prev, current: status })\n }\n\n private _descerializePreferences(serialized: string): TheSeamPreferencesBase {\n const prefs = JSON.parse(serialized)\n\n // TODO: Implement migration\n\n return prefs\n }\n}\n","import { Injectable } from '@angular/core'\nimport { map, Observable } from 'rxjs'\n\nimport { TheSeamPreferencesBase } from './preferences.models'\nimport { TheSeamPreferencesAccessor } from './preferences-accessor'\nimport { TheSeamPreferencesMapRecord } from './preferences-record'\n\n@Injectable({\n providedIn: 'root'\n})\nexport class TheSeamPreferencesManagerService {\n\n private readonly _tablePrefsMap = new Map<string, TheSeamPreferencesMapRecord>()\n\n public preferences(\n preferenceKey: string,\n accessor: TheSeamPreferencesAccessor,\n emptyPrefs: TheSeamPreferencesBase,\n ): Observable<TheSeamPreferencesBase> {\n let prefs = this._tablePrefsMap.get(preferenceKey)\n\n if (prefs && !prefs.isSameAccessor(accessor)) {\n throw Error(`Preferences accessor mismatch for key '${preferenceKey}'. Changing the accessor is not supported.`)\n }\n\n if (prefs && !prefs.isSameEmptyPrefs(emptyPrefs)) {\n throw Error(`Preferences emptyPrefs mismatch for key '${preferenceKey}'. Changing the emptyPrefs is not supported.`)\n }\n\n if (!prefs) {\n prefs = new TheSeamPreferencesMapRecord(preferenceKey, accessor, emptyPrefs)\n this._tablePrefsMap.set(preferenceKey, prefs)\n }\n return prefs.observable.pipe(\n map(v => {\n // This is for assuming the accessor returned an empty object, as a\n // default for a missing preference. Instead of throwing an error, we\n // return a valid empty preferences.\n //\n // NOTE: May remove this, when a more generic preferences implementation\n // is finished.\n if (Object.keys(v).length === 0) {\n return emptyPrefs\n }\n\n return v\n }),\n )\n }\n\n public update(preferenceKey: string, value: TheSeamPreferencesBase): void {\n const prefs = this._tablePrefsMap.get(preferenceKey)\n if (prefs) {\n prefs.update(value)\n }\n }\n\n public delete(preferenceKey: string): void {\n const prefs = this._tablePrefsMap.get(preferenceKey)\n if (prefs) {\n prefs.delete()\n }\n }\n\n public refresh(preferenceKey: string): void {\n const prefs = this._tablePrefsMap.get(preferenceKey)\n if (prefs) {\n prefs.refresh()\n }\n }\n\n public isPending(preferenceKey: string): boolean {\n const prefs = this._tablePrefsMap.get(preferenceKey)\n return prefs ? prefs.status === 'pending' : false\n }\n\n public isLoaded(preferenceKey: string): boolean {\n const prefs = this._tablePrefsMap.get(preferenceKey)\n return prefs ? prefs.status === 'loaded' : false\n }\n\n}\n","import { Injectable } from '@angular/core'\nimport { defer, Observable } from 'rxjs'\nimport { map } from 'rxjs/operators'\n\nimport { loadStyle, loadStyleSheet } from '@theseam/ui-common/utils'\n\nexport class LoadedAssetRef<T extends HTMLLinkElement | HTMLScriptElement | HTMLStyleElement> {\n\n constructor(\n public readonly nativeElement: T,\n public readonly path?: string,\n public readonly content?: string\n ) {\n\n }\n\n public destroy(): void {\n this.nativeElement.parentElement?.removeChild(this.nativeElement)\n }\n\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AssetLoaderService {\n\n public loadStyleSheet(path: string): Observable<LoadedAssetRef<HTMLLinkElement>> {\n return defer(() => loadStyleSheet(path)).pipe(map(v => new LoadedAssetRef(v, path)))\n }\n\n public loadStyle(content: string): Observable<LoadedAssetRef<HTMLStyleElement>> {\n return defer(() => loadStyle(content)).pipe(map(v => new LoadedAssetRef(v, undefined, content)))\n }\n\n}\n","import { Injectable } from '@angular/core'\nimport { IsActiveMatchOptions, NavigationEnd, Router, UrlTree } from '@angular/router'\nimport { Observable } from 'rxjs'\nimport { filter, map, startWith } from 'rxjs/operators'\n\n@Injectable({\n providedIn: 'root'\n})\nexport class RouterHelpersService {\n\n constructor(\n private _router: Router\n ) { }\n\n public isActive(url: string | UrlTree, exact: boolean): Observable<boolean> {\n const opts: IsActiveMatchOptions = exact\n ? { paths: 'exact', queryParams: 'exact', fragment: 'ignored', matrixParams: 'ignored' }\n : { paths: 'subset', queryParams: 'subset', fragment: 'ignored', matrixParams: 'ignored' }\n\n return this._router.events.pipe(\n filter(event => event instanceof NavigationEnd),\n map(event => this._router.isActive(url, opts)),\n startWith(this._router.isActive(url, opts))\n )\n }\n}\n","import { Injectable } from '@angular/core'\n\nimport { Observable, Subscriber } from 'rxjs'\nimport WebFont from 'webfontloader'\n\nimport { hasProperty } from '@theseam/ui-common/utils'\n\nexport type TheSeamFontEvents =\n { type: 'loading' } |\n { type: 'active' } |\n { type: 'inactive' } |\n { type: 'fontloading', familyName: string, fvd: string } |\n { type: 'fontactive', familyName: string, fvd: string } |\n { type: 'fontinactive', familyName: string, fvd: string }\n\n/**\n * Service to help loading fonts.\n *\n * Currently this is just a wrapper for the parts of webfontloader that we need.\n * Eventually this should be generic enough that we can switch loaders without\n * config differences being confusing.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class TheSeamFontLoaderService {\n\n /**\n * Since this method is just a wrapper for webfontloader right now it accepts\n * anything webfontloader's config accepts, so the event callbacks can still\n * be used, but you should us the emitted objects instead. If we decide to\n * support other font loaders then the event callbacks will most likely be\n * removed.\n *\n * NOTE: If you need to use the events callbacks for some reason, this\n * method's returned observable will still need to be subscribed to, because\n * it doesn't start till subscribed to.\n */\n public load(config: WebFont.Config): Observable<TheSeamFontEvents> {\n return new Observable((subscriber: Subscriber<TheSeamFontEvents>) => {\n WebFont.load({\n ...config,\n /** This event is triggered when all fonts have been requested. */\n loading: () => {\n if (hasProperty(config, 'loading')) {\n config.loading()\n }\n subscriber.next({ type: 'loading' })\n },\n /** This event is triggered when the fonts have rendered. */\n active: () => {\n if (hasProperty(config, 'active')) {\n config.active()\n }\n subscriber.next({ type: 'active' })\n },\n /** This event is triggered when the browser does not support linked fonts or if none of the fonts could be loaded. */\n inactive: () => {\n if (hasProperty(config, 'inactive')) {\n config.inactive()\n }\n subscriber.next({ type: 'inactive' })\n },\n /** This event is triggered once for each font that's loaded. */\n fontloading: (familyName: string, fvd: string) => {\n if (hasProperty(config, 'fontloading')) {\n config.fontloading(familyName, fvd)\n }\n subscriber.next({ type: 'fontloading', familyName, fvd })\n },\n /** This event is triggered once for each font that renders. */\n fontactive: (familyName: string, fvd: string) => {\n if (hasProperty(config, 'fontactive')) {\n config.fontactive(familyName, fvd)\n }\n subscriber.next({ type: 'fontactive', familyName, fvd })\n },\n /** This event is triggered if the font can't be loaded. */\n fontinactive: (familyName: string, fvd: string) => {\n if (hasProperty(config, 'fontinactive')) {\n config.fontinactive(familyName, fvd)\n }\n subscriber.next({ type: 'fontinactive', familyName, fvd })\n },\n })\n })\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["map","startWith"],"mappings":";;;;;;;;;MAea,2BAA2B,CAAA;AAUtC,IAAA,WAAA,CACmB,IAAY,EACZ,SAAqC,EACrC,WAAmC,EAAA;QAFnC,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAQ;QACZ,IAAS,CAAA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AA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,cAFvB,MAAM,EAAA,CAAA,CAAA;2FAEP,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAHpC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACxBD;;AAEG;;;;"}
@@ -13,34 +13,30 @@ import { ModalRef, MODAL_DATA } from '@theseam/ui-common/modal';
13
13
 
14
14
  // import { ArgType } from '@storybook/addons'
15
15
  const themeArgType = {
16
- defaultValue: 'primary',
16
+ options: ThemeNames,
17
17
  control: {
18
18
  type: 'select',
19
- options: ThemeNames
20
19
  },
21
20
  description: `Theme style.`
22
21
  };
23
22
  const themeWithOutlineArgType = {
24
- defaultValue: 'primary',
23
+ options: [...ThemeNames, ...OutlineThemeNames],
25
24
  control: {
26
25
  type: 'select',
27
- options: [...ThemeNames, ...OutlineThemeNames]
28
26
  },
29
27
  description: `Theme style.`
30
28
  };
31
29
  const sizeArgType = {
32
- defaultValue: undefined,
30
+ options: [undefined, 'sm', 'lg'],
33
31
  control: {
34
32
  type: 'select',
35
- options: [undefined, 'sm', 'lg']
36
33
  },
37
34
  description: `Size.`
38
35
  };
39
36
  const buttonTypeArgType = {
40
- defaultValue: 'button',
37
+ options: ['button', 'submit'],
41
38
  control: {
42
39
  type: 'select',
43
- options: ['button', 'submit']
44
40
  },
45
41
  description: `Button type.`
46
42
  };
@@ -1 +1 @@
1
- {"version":3,"file":"theseam-ui-common-story-helpers.mjs","sources":["../../../projects/ui-common/story-helpers/arg-type-helpers.ts","../../../projects/ui-common/story-helpers/story-empty.component.ts","../../../projects/ui-common/story-helpers/initial-route-factory.ts","../../../projects/ui-common/story-helpers/initial-route.service.ts","../../../projects/ui-common/story-helpers/story-initial-route.ts","../../../projects/ui-common/story-helpers/route-button.ts","../../../projects/ui-common/story-helpers/routes-arg-type.ts","../../../projects/ui-common/story-helpers/story-empty-with-route.component.ts","../../../projects/ui-common/story-helpers/story-modal-container.component.ts","../../../projects/ui-common/story-helpers/story-helper-components.module.ts","../../../projects/ui-common/story-helpers/story-toastr.service.ts","../../../projects/ui-common/story-helpers/on-story-bootstrapped-exec.ts","../../../projects/ui-common/story-helpers/on-story-bootstrapped-trigger.ts","../../../projects/ui-common/story-helpers/story-preferences-accessor.service.ts","../../../projects/ui-common/story-helpers/theseam-ui-common-story-helpers.ts"],"sourcesContent":["// import { ArgType } from '@storybook/addons'\n\nimport { OutlineThemeNames, ThemeNames } from '@theseam/ui-common/models'\n\ndeclare type ArgType = any\n\nexport const themeArgType: ArgType = {\n defaultValue: 'primary',\n control: {\n type: 'select',\n options: ThemeNames\n },\n description: `Theme style.`\n}\n\nexport const themeWithOutlineArgType: ArgType = {\n defaultValue: 'primary',\n control: {\n type: 'select',\n options: [ ...ThemeNames, ...OutlineThemeNames ]\n },\n description: `Theme style.`\n}\n\nexport const sizeArgType: ArgType = {\n defaultValue: undefined,\n control: {\n type: 'select',\n options: [ undefined, 'sm', 'lg' ]\n },\n description: `Size.`\n}\n\nexport const buttonTypeArgType: ArgType = {\n defaultValue: 'button',\n control: {\n type: 'select',\n options: [ 'button', 'submit' ]\n },\n description: `Button type.`\n}\n","import { Component } from '@angular/core'\n\n@Component({ template: `` })\nexport class StoryEmptyComponent { }\n","import { StoryInitialRouteService } from './initial-route.service'\n\nexport function storyInitialRouteFactory(_storyInitialRouteService: StoryInitialRouteService) {\n return () => _storyInitialRouteService.setInitialRoute()\n}\n","import { Injectable, InjectionToken, Injector } from '@angular/core'\nimport { NavigationEnd, Router } from '@angular/router'\nimport { filter, take } from 'rxjs/operators'\n\nexport const STORY_INITIAL_ROUTE_URL = new InjectionToken<any>('STORY_INITIAL_ROUTE_URL')\n\n@Injectable()\nexport class StoryInitialRouteService {\n\n constructor(\n private _injector: Injector\n ) { }\n\n public setInitialRoute() {\n const _router = this._injector.get(Router)\n const url = this._injector.get(STORY_INITIAL_ROUTE_URL)\n if (_router.navigated) {\n _router.navigateByUrl(url)\n } else {\n _router.events.pipe(\n filter(e => e instanceof NavigationEnd),\n take(1)\n )\n .subscribe(() => { _router.navigateByUrl(url) })\n }\n }\n\n}\n","import { APP_INITIALIZER, ModuleWithProviders, NgModule } from '@angular/core'\n\nimport { storyInitialRouteFactory } from './initial-route-factory'\nimport { StoryInitialRouteService, STORY_INITIAL_ROUTE_URL } from './initial-route.service'\n\n@NgModule()\nexport class StoryInitialRouteModule {\n static forRoot(url: string): ModuleWithProviders<StoryInitialRouteModule> {\n return {\n ngModule: StoryInitialRouteModule,\n providers: [\n StoryInitialRouteService,\n {\n provide: APP_INITIALIZER,\n useFactory: storyInitialRouteFactory,\n deps: [ StoryInitialRouteService ],\n multi: true\n },\n { provide: STORY_INITIAL_ROUTE_URL, useValue: url }\n ]\n }\n }\n\n}\n","// import { button } from '@storybook/addon-knobs'\n\n/**\n * Until I find a way to avoid '@storybook/addon-knobs' from interfering with\n * NgZone I can't import it in the knob when built by ng-packagr.\n */\nexport function routeButton(buttonKnob: any, url: string) {\n return buttonKnob(url, () => {\n location.hash = `#${url}`\n return false\n })\n}\n","// import { ArgType } from '@storybook/addons'\n\ndeclare const __STORYBOOK_ADDONS: any\n\nfunction goToHashUrl(url: string): void { location.hash = `#${url}` }\n\n// __STORYBOOK_ADDONS.getChannel().on('custom/go-to-hash', (data: { hash: string }) => {\n\n// goToHashUrl(data.hash)\n// })\n\n// __STORYBOOK_ADDONS.getChannel().on('storyArgsUpdated', (data: { hash: string }) => {\n// console.log('storyArgsUpdated')\n// })\n\nexport function routesArgType(routes: string[])/*: ArgType*/ {\n return {\n options: routes,\n control: {\n type: 'select',\n // Runs in the 'manager', so I am emitting to a channel in the 'preview'.\n onChange: (e: any, a: any) => { __STORYBOOK_ADDONS.getChannel().emit('custom/go-to-hash', { hash: e }); return e }\n }\n }\n}\n","import { Component } from '@angular/core'\n\n@Component({ template: `<router-outlet></router-outlet>` })\nexport class StoryEmptyWithRouteComponent { }\n","import { Component, Injector, Input, OnDestroy } from '@angular/core'\nimport { combineLatest, Observable, of, ReplaySubject, Subject } from 'rxjs'\nimport { auditTime, map, startWith, takeUntil } from 'rxjs/operators'\n\nimport { ModalConfig, ModalRef, MODAL_DATA } from '@theseam/ui-common/modal'\nimport type { ComponentType } from '@theseam/ui-common/models'\n\nclass FakeModalRef<T, R = any> implements Partial<ModalRef<T, R>> {\n\n afterOpened() { return of(undefined) }\n\n close(dialogResult?: R): void { }\n\n}\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'story-modal-container-component',\n template: `\n <div class=\"cdk-overlay-container\">\n <div class=\"cdk-overlay-backdrop cdk-overlay-dark-backdrop cdk-overlay-backdrop-showing\"></div>\n <div class=\"cdk-global-overlay-wrapper\"\n dir=\"ltr\"\n style=\"justify-content: flex-start; align-items: center; pointer-events: auto\"\n seamOverlayScrollbar>\n <div class=\"seam-modal-container modal-dialog modal-dialog-centered {{ modalConfig ? modalConfig.modalSize : 'modal-lg' }}\"\n tabindex=\"-1\"\n [class.modal-lg]=\"!modalConfig\">\n <div class=\"modal-content\">\n <ng-container *ngIf=\"_outletData$ | async as outletData\">\n <ng-container *ngComponentOutlet=\"outletData.component; injector: outletData.injector;\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n `,\n styles: [`\n .seam-modal-container[tabindex=\"-1\"]:focus {\n outline: 0 !important;\n }\n `]\n})\nexport class StoryModalContainerComponent<T, D = any> implements OnDestroy {\n\n private readonly _ngUnsubscribe = new Subject<void>()\n\n @Input() set component(c: ComponentType<T>) { this._component.next(c) }\n @Input() set data(d: D) { this._data.next(d) }\n\n @Input() modalConfig?: ModalConfig<D>\n\n _component = new ReplaySubject<ComponentType<T>>(1)\n _data = new ReplaySubject<D>(1)\n\n _outletData$: Observable<{ component: ComponentType<T>, injector: Injector } | null>\n\n constructor(\n private _injector: Injector\n ) {\n this._outletData$ = combineLatest([\n this._component.asObservable(),\n this._data.asObservable().pipe(startWith(undefined))\n ]).pipe(\n auditTime(0),\n map(([ component, data ]) => ({\n component,\n injector: this._createInjector(data)\n })),\n takeUntil(this._ngUnsubscribe)\n )\n }\n\n ngOnDestroy() {\n this._ngUnsubscribe.next(undefined)\n this._ngUnsubscribe.complete()\n }\n\n private _createInjector(data?: D): Injector {\n return Injector.create({\n providers: [\n { provide: ModalRef, useClass: FakeModalRef, deps: [] },\n { provide: MODAL_DATA, useValue: data }\n ],\n parent: this._injector\n })\n }\n\n}\n","import { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\nimport { RouterModule } from '@angular/router'\n\nimport { TheSeamScrollbarModule } from '@theseam/ui-common/scrollbar'\n\nimport { StoryEmptyWithRouteComponent } from './story-empty-with-route.component'\nimport { StoryEmptyComponent } from './story-empty.component'\nimport { StoryModalContainerComponent } from './story-modal-container.component'\n\n@NgModule({\n declarations: [\n StoryEmptyComponent,\n StoryEmptyWithRouteComponent,\n StoryModalContainerComponent\n ],\n imports: [\n CommonModule,\n RouterModule,\n TheSeamScrollbarModule\n ],\n exports: [\n StoryEmptyComponent,\n StoryEmptyWithRouteComponent,\n StoryModalContainerComponent\n ]\n})\nexport class StoryHelperComponentsModule { }\n","import { Injectable } from '@angular/core'\n\nimport { ActiveToast, GlobalConfig, IndividualConfig, ToastContainerDirective } from 'ngx-toastr'\n\n@Injectable()\nexport class StoryToastrService {\n toastrConfig?: GlobalConfig\n currentlyActive = 0\n toasts: ActiveToast<any>[] = []\n overlayContainer?: ToastContainerDirective\n previousToastMessage: string | undefined\n\n /** show toast */\n show(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {},\n type = ''\n ) { }\n\n /** show successful toast */\n success(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /** show error toast */\n error(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /** show info toast */\n info(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /** show warning toast */\n warning(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /**\n * Remove all or a single toast by id\n */\n clear(toastId?: number) { }\n\n /**\n * Remove and destroy a single toast by id\n */\n remove(toastId: number) { }\n\n /**\n * Determines if toast message is already shown\n */\n findDuplicate(message: string, resetOnDuplicate: boolean, countDuplicates: boolean) { }\n\n}\n","import { APP_BOOTSTRAP_LISTENER, ComponentRef } from '@angular/core'\n// import { STORY } from '@storybook/angular/dist/ts3.9/client/preview/angular/app.token'\n// import { StoryFnAngularReturnType } from '@storybook/angular/dist/ts3.9/client/preview/types'\nimport { Observable } from 'rxjs'\nimport { first } from 'rxjs/operators'\n\n/**\n * Can be used to access a stories component after the story has been bootstrapped.\n *\n * Example:\n * ```ts\n * @Component({\n * selector: 'story-example',\n * template: `Touched: {{ exControl.touched }}`\n * })\n * class StoryExampleComponent {\n * exControl = new FormControl('')\n * }\n *\n * export const TouchExample2 = () => ({\n * moduleMetadata: {\n * declarations: [ StoryExampleComponent ],\n * providers: [ onStoryBootstrappedExec((c: StoryExampleComponent) => c.exControl.markAsTouched()) ]\n * },\n * props: { },\n * component: StoryExampleComponent\n * })\n * ```\n */\n// export function onStoryBootstrappedExec<T = any>(callback: (component: T) => void) {\n// function bootstrapped(componentRef: ComponentRef<any>) {\n// const data = componentRef.instance.target.injector.get(STORY, null) as Observable<StoryFnAngularReturnType> | null\n// if (!data) {\n// console.warn(`STORY provider not found.`)\n// return\n// }\n// data?.pipe(first()).subscribe(story => {\n// if (!story.component) {\n// console.warn(`'onStoryBootstrappedExec' only supported on stories that provide 'component' property.`)\n// return\n// }\n\n// let c = null\n// for (let i = 0; i < componentRef.instance.target.length; i++) {\n// const tmp = componentRef.instance.target._embeddedViews[i].nodes?.find((f: any) => f?.instance instanceof story.component)\n// const comp = tmp?.instance\n// if (comp) {\n// c = comp\n// break\n// }\n// }\n\n// if (!c) {\n// console.warn(`Story component instance not found.`)\n// return\n// }\n\n// if (c) {\n// callback(c)\n// }\n// })\n// }\n\n// return {\n// provide: APP_BOOTSTRAP_LISTENER,\n// useValue: bootstrapped,\n// multi: true\n// }\n// }\n","import { APP_BOOTSTRAP_LISTENER, ComponentRef, ElementRef } from '@angular/core'\n\n// TODO: Consider supporting a target selection function, so that complex\n// selections that can't be expressed by a simple selector can be used.\n\n/**\n * Can be used to trigger an event on a target element when the story component has been bootstrapped.\n *\n * Example:\n * ```\n * export const TouchExample1 = () => ({\n * moduleMetadata: {\n * providers: [ onStoryBootstrappedTrigger('input', 'blur') ]\n * },\n * props: { control: new FormControl('') },\n * template: `\n * <input type=\"text\" [formControl]=\"control\">\n * Touched: {{ control.touched }}\n * `\n * })\n * ```\n */\nexport function onStoryBootstrappedTrigger(targetSelector: string, eventName: string) {\n function bootstrapped(componentRef: ComponentRef<any>) {\n const elementRef = componentRef.injector.get(ElementRef, null)\n const target = elementRef?.nativeElement.querySelector(targetSelector)\n if (!target) {\n // eslint-disable-next-line no-console\n console.warn(`Unable to trigger event '${eventName}'. Target '${targetSelector}' not found.`)\n }\n\n const e = document.createEvent('HTMLEvents')\n e.initEvent('blur', false, true)\n target.dispatchEvent(e)\n }\n\n return {\n provide: APP_BOOTSTRAP_LISTENER,\n useValue: bootstrapped,\n multi: true\n }\n}\n","import { Injectable } from '@angular/core'\r\nimport { Observable, of } from 'rxjs'\r\n\r\nimport { TheSeamPreferencesAccessor } from '@theseam/ui-common/services'\r\n\r\nconst ACCESSOR_PREFIX = 'story-pref'\r\n\r\n@Injectable()\r\nexport class StoryPreferencesAccessorService implements TheSeamPreferencesAccessor {\r\n\r\n /**\r\n * Gets a preference.\r\n */\r\n public get(name: string): Observable<string> {\r\n console.log('get', name)\r\n return of(localStorage.getItem(`${ACCESSOR_PREFIX}-${name}`) || '{}')\r\n }\r\n\r\n /**\r\n * Update a preference.\r\n */\r\n public update(name: string, value: string): Observable<string> {\r\n // console.log('update', name)\r\n localStorage.setItem(`${ACCESSOR_PREFIX}-${name}`, value)\r\n return this.get(name)\r\n }\r\n\r\n /**\r\n * Delete a preference.\r\n */\r\n public delete(name: string): Observable<boolean> {\r\n localStorage.removeItem(`${ACCESSOR_PREFIX}-${name}`)\r\n return of(true)\r\n }\r\n\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;AAAA;AAMa,MAAA,YAAY,GAAY;AACnC,IAAA,YAAY,EAAE,SAAS;AACvB,IAAA,OAAO,EAAE;AACP,QAAA,IAAI,EAAE,QAAQ;AACd,QAAA,OAAO,EAAE,UAAU;AACpB,KAAA;AACD,IAAA,WAAW,EAAE,CAAc,YAAA,CAAA;EAC5B;AAEY,MAAA,uBAAuB,GAAY;AAC9C,IAAA,YAAY,EAAE,SAAS;AACvB,IAAA,OAAO,EAAE;AACP,QAAA,IAAI,EAAE,QAAQ;AACd,QAAA,OAAO,EAAE,CAAE,GAAG,UAAU,EAAE,GAAG,iBAAiB,CAAE;AACjD,KAAA;AACD,IAAA,WAAW,EAAE,CAAc,YAAA,CAAA;EAC5B;AAEY,MAAA,WAAW,GAAY;AAClC,IAAA,YAAY,EAAE,SAAS;AACvB,IAAA,OAAO,EAAE;AACP,QAAA,IAAI,EAAE,QAAQ;AACd,QAAA,OAAO,EAAE,CAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAE;AACnC,KAAA;AACD,IAAA,WAAW,EAAE,CAAO,KAAA,CAAA;EACrB;AAEY,MAAA,iBAAiB,GAAY;AACxC,IAAA,YAAY,EAAE,QAAQ;AACtB,IAAA,OAAO,EAAE;AACP,QAAA,IAAI,EAAE,QAAQ;AACd,QAAA,OAAO,EAAE,CAAE,QAAQ,EAAE,QAAQ,CAAE;AAChC,KAAA;AACD,IAAA,WAAW,EAAE,CAAc,YAAA,CAAA;;;MCpChB,mBAAmB,CAAA;;gHAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MA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CAAC,CAAA,EAAG,eAAe,CAAA,CAAA,EAAI,IAAI,CAAE,CAAA,CAAC,IAAI,IAAI,CAAC,CAAA;KACtE;AAED;;AAEG;IACI,MAAM,CAAC,IAAY,EAAE,KAAa,EAAA;;QAEvC,YAAY,CAAC,OAAO,CAAC,CAAG,EAAA,eAAe,CAAI,CAAA,EAAA,IAAI,CAAE,CAAA,EAAE,KAAK,CAAC,CAAA;AACzD,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;KACtB;AAED;;AAEG;AACI,IAAA,MAAM,CAAC,IAAY,EAAA;QACxB,YAAY,CAAC,UAAU,CAAC,CAAA,EAAG,eAAe,CAAI,CAAA,EAAA,IAAI,CAAE,CAAA,CAAC,CAAA;AACrD,QAAA,OAAO,EAAE,CAAC,IAAI,CAAC,CAAA;KAChB;;4HAzBU,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;gIAA/B,+BAA+B,EAAA,CAAA,CAAA;2FAA/B,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAD3C,UAAU;;;ACPX;;AAEG;;;;"}
1
+ {"version":3,"file":"theseam-ui-common-story-helpers.mjs","sources":["../../../projects/ui-common/story-helpers/arg-type-helpers.ts","../../../projects/ui-common/story-helpers/story-empty.component.ts","../../../projects/ui-common/story-helpers/initial-route-factory.ts","../../../projects/ui-common/story-helpers/initial-route.service.ts","../../../projects/ui-common/story-helpers/story-initial-route.ts","../../../projects/ui-common/story-helpers/route-button.ts","../../../projects/ui-common/story-helpers/routes-arg-type.ts","../../../projects/ui-common/story-helpers/story-empty-with-route.component.ts","../../../projects/ui-common/story-helpers/story-modal-container.component.ts","../../../projects/ui-common/story-helpers/story-helper-components.module.ts","../../../projects/ui-common/story-helpers/story-toastr.service.ts","../../../projects/ui-common/story-helpers/on-story-bootstrapped-exec.ts","../../../projects/ui-common/story-helpers/on-story-bootstrapped-trigger.ts","../../../projects/ui-common/story-helpers/story-preferences-accessor.service.ts","../../../projects/ui-common/story-helpers/theseam-ui-common-story-helpers.ts"],"sourcesContent":["// import { ArgType } from '@storybook/addons'\n\nimport { OutlineThemeNames, ThemeNames } from '@theseam/ui-common/models'\n\ndeclare type ArgType = any\n\nexport const themeArgType: ArgType = {\n options: ThemeNames,\n control: {\n type: 'select',\n },\n description: `Theme style.`\n}\n\nexport const themeWithOutlineArgType: ArgType = {\n options: [ ...ThemeNames, ...OutlineThemeNames ],\n control: {\n type: 'select',\n },\n description: `Theme style.`\n}\n\nexport const sizeArgType: ArgType = {\n options: [ undefined, 'sm', 'lg' ],\n control: {\n type: 'select',\n },\n description: `Size.`\n}\n\nexport const buttonTypeArgType: ArgType = {\n options: [ 'button', 'submit' ],\n control: {\n type: 'select',\n },\n description: `Button type.`\n}\n","import { Component } from '@angular/core'\n\n@Component({ template: `` })\nexport class StoryEmptyComponent { }\n","import { StoryInitialRouteService } from './initial-route.service'\n\nexport function storyInitialRouteFactory(_storyInitialRouteService: StoryInitialRouteService) {\n return () => _storyInitialRouteService.setInitialRoute()\n}\n","import { Injectable, InjectionToken, Injector } from '@angular/core'\nimport { NavigationEnd, Router } from '@angular/router'\nimport { filter, take } from 'rxjs/operators'\n\nexport const STORY_INITIAL_ROUTE_URL = new InjectionToken<any>('STORY_INITIAL_ROUTE_URL')\n\n@Injectable()\nexport class StoryInitialRouteService {\n\n constructor(\n private _injector: Injector\n ) { }\n\n public setInitialRoute() {\n const _router = this._injector.get(Router)\n const url = this._injector.get(STORY_INITIAL_ROUTE_URL)\n if (_router.navigated) {\n _router.navigateByUrl(url)\n } else {\n _router.events.pipe(\n filter(e => e instanceof NavigationEnd),\n take(1)\n )\n .subscribe(() => { _router.navigateByUrl(url) })\n }\n }\n\n}\n","import { APP_INITIALIZER, ModuleWithProviders, NgModule } from '@angular/core'\n\nimport { storyInitialRouteFactory } from './initial-route-factory'\nimport { StoryInitialRouteService, STORY_INITIAL_ROUTE_URL } from './initial-route.service'\n\n@NgModule()\nexport class StoryInitialRouteModule {\n static forRoot(url: string): ModuleWithProviders<StoryInitialRouteModule> {\n return {\n ngModule: StoryInitialRouteModule,\n providers: [\n StoryInitialRouteService,\n {\n provide: APP_INITIALIZER,\n useFactory: storyInitialRouteFactory,\n deps: [ StoryInitialRouteService ],\n multi: true\n },\n { provide: STORY_INITIAL_ROUTE_URL, useValue: url }\n ]\n }\n }\n\n}\n","// import { button } from '@storybook/addon-knobs'\n\n/**\n * Until I find a way to avoid '@storybook/addon-knobs' from interfering with\n * NgZone I can't import it in the knob when built by ng-packagr.\n */\nexport function routeButton(buttonKnob: any, url: string) {\n return buttonKnob(url, () => {\n location.hash = `#${url}`\n return false\n })\n}\n","// import { ArgType } from '@storybook/addons'\n\ndeclare const __STORYBOOK_ADDONS: any\n\nfunction goToHashUrl(url: string): void { location.hash = `#${url}` }\n\n// __STORYBOOK_ADDONS.getChannel().on('custom/go-to-hash', (data: { hash: string }) => {\n\n// goToHashUrl(data.hash)\n// })\n\n// __STORYBOOK_ADDONS.getChannel().on('storyArgsUpdated', (data: { hash: string }) => {\n// console.log('storyArgsUpdated')\n// })\n\nexport function routesArgType(routes: string[])/*: ArgType*/ {\n return {\n options: routes,\n control: {\n type: 'select',\n // Runs in the 'manager', so I am emitting to a channel in the 'preview'.\n onChange: (e: any, a: any) => { __STORYBOOK_ADDONS.getChannel().emit('custom/go-to-hash', { hash: e }); return e }\n }\n }\n}\n","import { Component } from '@angular/core'\n\n@Component({ template: `<router-outlet></router-outlet>` })\nexport class StoryEmptyWithRouteComponent { }\n","import { Component, Injector, Input, OnDestroy } from '@angular/core'\nimport { combineLatest, Observable, of, ReplaySubject, Subject } from 'rxjs'\nimport { auditTime, map, startWith, takeUntil } from 'rxjs/operators'\n\nimport { ModalConfig, ModalRef, MODAL_DATA } from '@theseam/ui-common/modal'\nimport type { ComponentType } from '@theseam/ui-common/models'\n\nclass FakeModalRef<T, R = any> implements Partial<ModalRef<T, R>> {\n\n afterOpened() { return of(undefined) }\n\n close(dialogResult?: R): void { }\n\n}\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'story-modal-container-component',\n template: `\n <div class=\"cdk-overlay-container\">\n <div class=\"cdk-overlay-backdrop cdk-overlay-dark-backdrop cdk-overlay-backdrop-showing\"></div>\n <div class=\"cdk-global-overlay-wrapper\"\n dir=\"ltr\"\n style=\"justify-content: flex-start; align-items: center; pointer-events: auto\"\n seamOverlayScrollbar>\n <div class=\"seam-modal-container modal-dialog modal-dialog-centered {{ modalConfig ? modalConfig.modalSize : 'modal-lg' }}\"\n tabindex=\"-1\"\n [class.modal-lg]=\"!modalConfig\">\n <div class=\"modal-content\">\n <ng-container *ngIf=\"_outletData$ | async as outletData\">\n <ng-container *ngComponentOutlet=\"outletData.component; injector: outletData.injector;\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n `,\n styles: [`\n .seam-modal-container[tabindex=\"-1\"]:focus {\n outline: 0 !important;\n }\n `]\n})\nexport class StoryModalContainerComponent<T, D = any> implements OnDestroy {\n\n private readonly _ngUnsubscribe = new Subject<void>()\n\n @Input() set component(c: ComponentType<T>) { this._component.next(c) }\n @Input() set data(d: D) { this._data.next(d) }\n\n @Input() modalConfig?: ModalConfig<D>\n\n _component = new ReplaySubject<ComponentType<T>>(1)\n _data = new ReplaySubject<D>(1)\n\n _outletData$: Observable<{ component: ComponentType<T>, injector: Injector } | null>\n\n constructor(\n private _injector: Injector\n ) {\n this._outletData$ = combineLatest([\n this._component.asObservable(),\n this._data.asObservable().pipe(startWith(undefined))\n ]).pipe(\n auditTime(0),\n map(([ component, data ]) => ({\n component,\n injector: this._createInjector(data)\n })),\n takeUntil(this._ngUnsubscribe)\n )\n }\n\n ngOnDestroy() {\n this._ngUnsubscribe.next(undefined)\n this._ngUnsubscribe.complete()\n }\n\n private _createInjector(data?: D): Injector {\n return Injector.create({\n providers: [\n { provide: ModalRef, useClass: FakeModalRef, deps: [] },\n { provide: MODAL_DATA, useValue: data }\n ],\n parent: this._injector\n })\n }\n\n}\n","import { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\nimport { RouterModule } from '@angular/router'\n\nimport { TheSeamScrollbarModule } from '@theseam/ui-common/scrollbar'\n\nimport { StoryEmptyWithRouteComponent } from './story-empty-with-route.component'\nimport { StoryEmptyComponent } from './story-empty.component'\nimport { StoryModalContainerComponent } from './story-modal-container.component'\n\n@NgModule({\n declarations: [\n StoryEmptyComponent,\n StoryEmptyWithRouteComponent,\n StoryModalContainerComponent\n ],\n imports: [\n CommonModule,\n RouterModule,\n TheSeamScrollbarModule\n ],\n exports: [\n StoryEmptyComponent,\n StoryEmptyWithRouteComponent,\n StoryModalContainerComponent\n ]\n})\nexport class StoryHelperComponentsModule { }\n","import { Injectable } from '@angular/core'\n\nimport { ActiveToast, GlobalConfig, IndividualConfig, ToastContainerDirective } from 'ngx-toastr'\n\n@Injectable()\nexport class StoryToastrService {\n toastrConfig?: GlobalConfig\n currentlyActive = 0\n toasts: ActiveToast<any>[] = []\n overlayContainer?: ToastContainerDirective\n previousToastMessage: string | undefined\n\n /** show toast */\n show(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {},\n type = ''\n ) { }\n\n /** show successful toast */\n success(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /** show error toast */\n error(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /** show info toast */\n info(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /** show warning toast */\n warning(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /**\n * Remove all or a single toast by id\n */\n clear(toastId?: number) { }\n\n /**\n * Remove and destroy a single toast by id\n */\n remove(toastId: number) { }\n\n /**\n * Determines if toast message is already shown\n */\n findDuplicate(message: string, resetOnDuplicate: boolean, countDuplicates: boolean) { }\n\n}\n","import { APP_BOOTSTRAP_LISTENER, ComponentRef } from '@angular/core'\n// import { STORY } from '@storybook/angular/dist/ts3.9/client/preview/angular/app.token'\n// import { StoryFnAngularReturnType } from '@storybook/angular/dist/ts3.9/client/preview/types'\nimport { Observable } from 'rxjs'\nimport { first } from 'rxjs/operators'\n\n/**\n * Can be used to access a stories component after the story has been bootstrapped.\n *\n * Example:\n * ```ts\n * @Component({\n * selector: 'story-example',\n * template: `Touched: {{ exControl.touched }}`\n * })\n * class StoryExampleComponent {\n * exControl = new FormControl('')\n * }\n *\n * export const TouchExample2 = () => ({\n * moduleMetadata: {\n * declarations: [ StoryExampleComponent ],\n * providers: [ onStoryBootstrappedExec((c: StoryExampleComponent) => c.exControl.markAsTouched()) ]\n * },\n * props: { },\n * component: StoryExampleComponent\n * })\n * ```\n */\n// export function onStoryBootstrappedExec<T = any>(callback: (component: T) => void) {\n// function bootstrapped(componentRef: ComponentRef<any>) {\n// const data = componentRef.instance.target.injector.get(STORY, null) as Observable<StoryFnAngularReturnType> | null\n// if (!data) {\n// console.warn(`STORY provider not found.`)\n// return\n// }\n// data?.pipe(first()).subscribe(story => {\n// if (!story.component) {\n// console.warn(`'onStoryBootstrappedExec' only supported on stories that provide 'component' property.`)\n// return\n// }\n\n// let c = null\n// for (let i = 0; i < componentRef.instance.target.length; i++) {\n// const tmp = componentRef.instance.target._embeddedViews[i].nodes?.find((f: any) => f?.instance instanceof story.component)\n// const comp = tmp?.instance\n// if (comp) {\n// c = comp\n// break\n// }\n// }\n\n// if (!c) {\n// console.warn(`Story component instance not found.`)\n// return\n// }\n\n// if (c) {\n// callback(c)\n// }\n// })\n// }\n\n// return {\n// provide: APP_BOOTSTRAP_LISTENER,\n// useValue: bootstrapped,\n// multi: true\n// }\n// }\n","import { APP_BOOTSTRAP_LISTENER, ComponentRef, ElementRef } from '@angular/core'\n\n// TODO: Consider supporting a target selection function, so that complex\n// selections that can't be expressed by a simple selector can be used.\n\n/**\n * Can be used to trigger an event on a target element when the story component has been bootstrapped.\n *\n * Example:\n * ```\n * export const TouchExample1 = () => ({\n * moduleMetadata: {\n * providers: [ onStoryBootstrappedTrigger('input', 'blur') ]\n * },\n * props: { control: new FormControl('') },\n * template: `\n * <input type=\"text\" [formControl]=\"control\">\n * Touched: {{ control.touched }}\n * `\n * })\n * ```\n */\nexport function onStoryBootstrappedTrigger(targetSelector: string, eventName: string) {\n function bootstrapped(componentRef: ComponentRef<any>) {\n const elementRef = componentRef.injector.get(ElementRef, null)\n const target = elementRef?.nativeElement.querySelector(targetSelector)\n if (!target) {\n // eslint-disable-next-line no-console\n console.warn(`Unable to trigger event '${eventName}'. Target '${targetSelector}' not found.`)\n }\n\n const e = document.createEvent('HTMLEvents')\n e.initEvent('blur', false, true)\n target.dispatchEvent(e)\n }\n\n return {\n provide: APP_BOOTSTRAP_LISTENER,\n useValue: bootstrapped,\n multi: true\n }\n}\n","import { Injectable } from '@angular/core'\nimport { Observable, of } from 'rxjs'\n\nimport { TheSeamPreferencesAccessor } from '@theseam/ui-common/services'\n\nconst ACCESSOR_PREFIX = 'story-pref'\n\n@Injectable()\nexport class StoryPreferencesAccessorService implements TheSeamPreferencesAccessor {\n\n /**\n * Gets a preference.\n */\n public get(name: string): Observable<string> {\n console.log('get', name)\n return of(localStorage.getItem(`${ACCESSOR_PREFIX}-${name}`) || '{}')\n }\n\n /**\n * Update a preference.\n */\n public update(name: string, value: string): Observable<string> {\n // console.log('update', name)\n localStorage.setItem(`${ACCESSOR_PREFIX}-${name}`, value)\n return this.get(name)\n }\n\n /**\n * Delete a preference.\n */\n public delete(name: string): Observable<boolean> {\n localStorage.removeItem(`${ACCESSOR_PREFIX}-${name}`)\n return of(true)\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;AAAA;AAMa,MAAA,YAAY,GAAY;AACnC,IAAA,OAAO,EAAE,UAAU;AACnB,IAAA,OAAO,EAAE;AACP,QAAA,IAAI,EAAE,QAAQ;AACf,K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,CAAC,CAAA;KAChB;;4HAzBU,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;gIAA/B,+BAA+B,EAAA,CAAA,CAAA;2FAA/B,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAD3C,UAAU;;;ACPX;;AAEG;;;;"}
@@ -165,19 +165,26 @@ function expectFn(value) {
165
165
  // const t = isInJasmine ? expectJasmineFn(value) : expect(value)
166
166
  const t = expect(value);
167
167
  return {
168
- toBe: toBeFn(t)
168
+ toBe: toBeFn(t),
169
+ toStrictEqual: t.toStrictEqual
169
170
  };
170
171
  }
171
172
 
172
173
  async function getHarness(harnessType, options) {
173
174
  if (options.fixture !== undefined) {
174
- return TestbedHarnessEnvironment.harnessForFixture(options.fixture, harnessType);
175
+ if (isComponentHarnessConstructor(harnessType)) {
176
+ return TestbedHarnessEnvironment.harnessForFixture(options.fixture, harnessType);
177
+ }
178
+ throw Error(`Unable to get harness. harnessType must be a ComponentHarness.`);
175
179
  }
176
180
  if (options.canvasElement !== undefined) {
177
181
  return (new StorybookHarnessEnvironment(options.canvasElement))
178
182
  .getHarness(harnessType);
179
183
  }
180
184
  throw Error(`Unable to get harness. fixture or canvasElement must be provided.`);
185
+ }
186
+ function isComponentHarnessConstructor(value) {
187
+ return typeof value === 'function' && Object.prototype.hasOwnProperty.call(value, 'hostSelector');
181
188
  }
182
189
 
183
190
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"theseam-ui-common-testing.mjs","sources":["../../../projects/ui-common/testing/fake-toastr.ts","../../../projects/ui-common/testing/render-story.ts","../../../projects/ui-common/testing/tick-helper.ts","../../../projects/ui-common/testing/current-tick-time.ts","../../../projects/ui-common/testing/story-expect.ts","../../../projects/ui-common/testing/get-harness.ts","../../../projects/ui-common/testing/theseam-ui-common-testing.ts"],"sourcesContent":["import { ActiveToast, GlobalConfig, IndividualConfig, ToastContainerDirective } from 'ngx-toastr'\n\nexport class FakeToastrService {\n toastrConfig!: GlobalConfig\n currentlyActive = 0\n toasts: ActiveToast<any>[] = []\n overlayContainer!: ToastContainerDirective\n previousToastMessage: string | undefined\n\n /** show toast */\n show(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {},\n type = ''\n ) { }\n\n /** show successful toast */\n success(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /** show error toast */\n error(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /** show info toast */\n info(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /** show warning toast */\n warning(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /**\n * Remove all or a single toast by id\n */\n clear(toastId?: number) { }\n\n /**\n * Remove and destroy a single toast by id\n */\n remove(toastId: number) { }\n\n /**\n * Determines if toast message is already shown\n */\n findDuplicate(message: string, resetOnDuplicate: boolean, countDuplicates: boolean) { }\n\n}\n","// import { createMountableStoryComponent } from '@storybook/testing-angular'\nimport { render, RenderResult } from '@testing-library/angular'\n\n// NOTE: This is an experimental attempt at removing some of the boilerplate. If\n// this ends up being worth it, then I will add it to `@storybook/testing-angular`.\nexport async function renderStory<ComponentType = any>(story: any): Promise<RenderResult<ComponentType, ComponentType>> {\n // const { component, ngModule } = createMountableStoryComponent(\n // story({}, {} as any)\n // )\n // return await render(component, { imports: [ ngModule ] })\n return null as any\n}\n","import { tick } from '@angular/core/testing'\n\n/**\n * Helps advance tests to specific elapsed times.\n *\n * # When to use\n *\n * If a test needs to do something at 100 ticks, but expected values should\n * also be tested at multiple ticks before 100 ticks, then the previous tick\n * sum needs to be counted. If the elapsed can be easily counted by just\n * skimming the code you should just use `tick()`.\n *\n * The following example is simple enough that `tick()` is probably better, but\n * it shows how it is used.\n *\n * ## Example without\n *\n * ```ts\n * const thing = new Thing()\n * thing.dieAfterTicks(100)\n *\n * tick(25)\n * expect(thing.isAlive).toBe(true)\n *\n * tick(25)\n * expect(thing.isAlive).toBe(true)\n *\n * tick(25)\n * expect(thing.isAlive).toBe(true)\n *\n * tick(25)\n * expect(thing.isAlive).toBe(false)\n * ```\n *\n * ## Example with\n *\n * ```ts\n * const t = new TickHelper()\n * const thing = new Thing()\n * thing.dieAfterTicks(100)\n *\n * t.tickTo(25)\n * expect(thing.isAlive).toBe(true)\n *\n * t.tickTo(50)\n * expect(thing.isAlive).toBe(true)\n *\n * t.tickTo(75)\n * expect(thing.isAlive).toBe(true)\n *\n * t.tickTo(100)\n * expect(thing.isAlive).toBe(false)\n * ```\n */\nexport class TickHelper {\n\n private _startTime = Date.now()\n\n /**\n * Returns the number of ticks that have elapsed since this class was\n * initialized.\n */\n public get ticksElapsed() { return Date.now() - this._startTime }\n\n /**\n * Calls `tick()` for the remaining number of ticks to reach elapsed ticks.\n *\n * ```\n * const t = new TickHelper()\n * tick(3)\n * t.tickTo(10) // Equivalent to `tick(7)` in this case to reach 10 ticks.\n * ```\n */\n public tickTo(ticks: number) { tick(ticks - this.ticksElapsed) }\n\n}\n","\n/**\n * When using `fakeAsync` this can access the internal currentTickTime of the\n * fake zone's scheduler.\n *\n * NOTE: Do **NOT** rely on this in tests. It is accesses private properties\n * that could break or change at any time, which could cause it to not have the\n * same meaning and be inaccurate in a future version.\n *\n * NOTE: This is accessing private properties, so I don't recommend relying on\n * this in tests. I find it useful to sometimes set this on a global property\n * that I can observe in the debugger's watch variables.\n */\nexport function currentTickTime(documentWindow: any = window): number {\n return documentWindow.Zone.current._properties.FakeAsyncTestZoneSpec._scheduler._currentTickTime\n}\n","// eslint-disable-next-line import/no-named-default\nimport { default as expectPatched } from '@storybook/expect'\nimport { instrument } from '@storybook/instrumenter'\nimport * as mock from 'jest-mock'\n\nexport const { jest } = instrument({ jest: mock })\n\n// const expectJasmineFn = (window as any).expect\nconst expectJestFn = expectPatched\n// const isInJasmine = expectJasmineFn !== undefined && expectJasmineFn !== null\n// const expectFn = expectJasmineFn || exp\nconst isInJasmine = false\n\n// console.log('isInJasmine', isInJasmine)\n\nconst { expect } = instrument(\n // { expect: expectJasmineFn || expectJestFn },\n { expect: expectJestFn },\n // { intercept: (method, path) => path[0] !== 'expect' }\n { intercept: (method, path) => {\n // console.log('intercept', method, path)\n return path[0] !== 'expect'\n } }\n)\n\nfunction toBeFn(matcher: any): (value: any) => Promise<void> {\n // if (isInJasmine) {\n // // @ts-ignore\n // const m = matcher as jasmine.Matchers<any>\n // return async (value: any) => m.toBe(value) as any\n // } else {\n // const m = matcher as ReturnType<typeof expectJestFn>\n // return async (value: any) => m.toBe(value) as any\n // }\n const m = matcher as ReturnType<typeof expectJestFn>\n return async (value: any) => m.toBe(value) as any\n}\n\nexport function expectFn(value: any) {\n // const t = isInJasmine ? expectJasmineFn(value) : expect(value)\n const t = expect(value)\n return {\n toBe: toBeFn(t)\n }\n}\n","import { ComponentHarness, ComponentHarnessConstructor } from '@angular/cdk/testing'\nimport { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'\nimport { ComponentFixture } from '@angular/core/testing'\n\nimport { StorybookHarnessEnvironment } from '@marklb/storybook-harness'\n\nexport interface GetHarnessOptions<TComponent = any> {\n canvasElement?: HTMLElement\n fixture?: ComponentFixture<TComponent>\n}\n\nexport async function getHarness<T extends ComponentHarness>(\n harnessType: ComponentHarnessConstructor<T>,\n options: GetHarnessOptions\n): Promise<T> {\n if (options.fixture !== undefined) {\n return TestbedHarnessEnvironment.harnessForFixture(options.fixture, harnessType)\n }\n\n if (options.canvasElement !== undefined) {\n return (new StorybookHarnessEnvironment(options.canvasElement))\n .getHarness(harnessType)\n }\n\n throw Error(`Unable to get harness. fixture or canvasElement must be provided.`)\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAEa,iBAAiB,CAAA;AAA9B,IAAA,WAAA,GAAA;QAEE,IAAe,CAAA,eAAA,GAAG,CAAC,CAAA;QACnB,IAAM,CAAA,MAAA,GAAu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CAAmE,iEAAA,CAAA,CAAC,CAAA;AAClF;;ACzBA;;AAEG;;;;"}
1
+ {"version":3,"file":"theseam-ui-common-testing.mjs","sources":["../../../projects/ui-common/testing/fake-toastr.ts","../../../projects/ui-common/testing/render-story.ts","../../../projects/ui-common/testing/tick-helper.ts","../../../projects/ui-common/testing/current-tick-time.ts","../../../projects/ui-common/testing/story-expect.ts","../../../projects/ui-common/testing/get-harness.ts","../../../projects/ui-common/testing/theseam-ui-common-testing.ts"],"sourcesContent":["import { ActiveToast, GlobalConfig, IndividualConfig, ToastContainerDirective } from 'ngx-toastr'\n\nexport class FakeToastrService {\n toastrConfig!: GlobalConfig\n currentlyActive = 0\n toasts: ActiveToast<any>[] = []\n overlayContainer!: ToastContainerDirective\n previousToastMessage: string | undefined\n\n /** show toast */\n show(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {},\n type = ''\n ) { }\n\n /** show successful toast */\n success(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /** show error toast */\n error(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /** show info toast */\n info(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /** show warning toast */\n warning(\n message?: string,\n title?: string,\n override: Partial<IndividualConfig> = {}\n ) { }\n\n /**\n * Remove all or a single toast by id\n */\n clear(toastId?: number) { }\n\n /**\n * Remove and destroy a single toast by id\n */\n remove(toastId: number) { }\n\n /**\n * Determines if toast message is already shown\n */\n findDuplicate(message: string, resetOnDuplicate: boolean, countDuplicates: boolean) { }\n\n}\n","// import { createMountableStoryComponent } from '@storybook/testing-angular'\nimport { render, RenderResult } from '@testing-library/angular'\n\n// NOTE: This is an experimental attempt at removing some of the boilerplate. If\n// this ends up being worth it, then I will add it to `@storybook/testing-angular`.\nexport async function renderStory<ComponentType = any>(story: any): Promise<RenderResult<ComponentType, ComponentType>> {\n // const { component, ngModule } = createMountableStoryComponent(\n // story({}, {} as any)\n // )\n // return await render(component, { imports: [ ngModule ] })\n return null as any\n}\n","import { tick } from '@angular/core/testing'\n\n/**\n * Helps advance tests to specific elapsed times.\n *\n * # When to use\n *\n * If a test needs to do something at 100 ticks, but expected values should\n * also be tested at multiple ticks before 100 ticks, then the previous tick\n * sum needs to be counted. If the elapsed can be easily counted by just\n * skimming the code you should just use `tick()`.\n *\n * The following example is simple enough that `tick()` is probably better, but\n * it shows how it is used.\n *\n * ## Example without\n *\n * ```ts\n * const thing = new Thing()\n * thing.dieAfterTicks(100)\n *\n * tick(25)\n * expect(thing.isAlive).toBe(true)\n *\n * tick(25)\n * expect(thing.isAlive).toBe(true)\n *\n * tick(25)\n * expect(thing.isAlive).toBe(true)\n *\n * tick(25)\n * expect(thing.isAlive).toBe(false)\n * ```\n *\n * ## Example with\n *\n * ```ts\n * const t = new TickHelper()\n * const thing = new Thing()\n * thing.dieAfterTicks(100)\n *\n * t.tickTo(25)\n * expect(thing.isAlive).toBe(true)\n *\n * t.tickTo(50)\n * expect(thing.isAlive).toBe(true)\n *\n * t.tickTo(75)\n * expect(thing.isAlive).toBe(true)\n *\n * t.tickTo(100)\n * expect(thing.isAlive).toBe(false)\n * ```\n */\nexport class TickHelper {\n\n private _startTime = Date.now()\n\n /**\n * Returns the number of ticks that have elapsed since this class was\n * initialized.\n */\n public get ticksElapsed() { return Date.now() - this._startTime }\n\n /**\n * Calls `tick()` for the remaining number of ticks to reach elapsed ticks.\n *\n * ```\n * const t = new TickHelper()\n * tick(3)\n * t.tickTo(10) // Equivalent to `tick(7)` in this case to reach 10 ticks.\n * ```\n */\n public tickTo(ticks: number) { tick(ticks - this.ticksElapsed) }\n\n}\n","\n/**\n * When using `fakeAsync` this can access the internal currentTickTime of the\n * fake zone's scheduler.\n *\n * NOTE: Do **NOT** rely on this in tests. It is accesses private properties\n * that could break or change at any time, which could cause it to not have the\n * same meaning and be inaccurate in a future version.\n *\n * NOTE: This is accessing private properties, so I don't recommend relying on\n * this in tests. I find it useful to sometimes set this on a global property\n * that I can observe in the debugger's watch variables.\n */\nexport function currentTickTime(documentWindow: any = window): number {\n return documentWindow.Zone.current._properties.FakeAsyncTestZoneSpec._scheduler._currentTickTime\n}\n","// eslint-disable-next-line import/no-named-default\nimport { default as expectPatched } from '@storybook/expect'\nimport { instrument } from '@storybook/instrumenter'\nimport * as mock from 'jest-mock'\n\nexport const { jest } = instrument({ jest: mock })\n\n// const expectJasmineFn = (window as any).expect\nconst expectJestFn = expectPatched\n// const isInJasmine = expectJasmineFn !== undefined && expectJasmineFn !== null\n// const expectFn = expectJasmineFn || exp\nconst isInJasmine = false\n\n// console.log('isInJasmine', isInJasmine)\n\nconst { expect } = instrument(\n // { expect: expectJasmineFn || expectJestFn },\n { expect: expectJestFn },\n // { intercept: (method, path) => path[0] !== 'expect' }\n { intercept: (method, path) => {\n // console.log('intercept', method, path)\n return path[0] !== 'expect'\n } }\n)\n\nfunction toBeFn(matcher: any): (value: any) => Promise<void> {\n // if (isInJasmine) {\n // // @ts-ignore\n // const m = matcher as jasmine.Matchers<any>\n // return async (value: any) => m.toBe(value) as any\n // } else {\n // const m = matcher as ReturnType<typeof expectJestFn>\n // return async (value: any) => m.toBe(value) as any\n // }\n const m = matcher as ReturnType<typeof expectJestFn>\n return async (value: any) => m.toBe(value) as any\n}\n\nexport function expectFn(value: any) {\n // const t = isInJasmine ? expectJasmineFn(value) : expect(value)\n const t = expect(value)\n return {\n toBe: toBeFn(t),\n toStrictEqual: t.toStrictEqual\n }\n}\n","import { ComponentHarness, ComponentHarnessConstructor, HarnessQuery } from '@angular/cdk/testing'\nimport { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'\nimport { ComponentFixture } from '@angular/core/testing'\n\nimport { StorybookHarnessEnvironment } from '@marklb/storybook-harness'\n\nexport interface GetHarnessOptions<TComponent = any> {\n canvasElement?: HTMLElement\n fixture?: ComponentFixture<TComponent>\n}\n\nexport async function getHarness<T extends ComponentHarness>(\n harnessType: HarnessQuery<T>,\n options: GetHarnessOptions\n): Promise<T> {\n if (options.fixture !== undefined) {\n if (isComponentHarnessConstructor(harnessType)) {\n return TestbedHarnessEnvironment.harnessForFixture(options.fixture, harnessType)\n }\n throw Error(`Unable to get harness. harnessType must be a ComponentHarness.`)\n }\n\n if (options.canvasElement !== undefined) {\n return (new StorybookHarnessEnvironment(options.canvasElement))\n .getHarness(harnessType)\n }\n\n throw Error(`Unable to get harness. fixture or canvasElement must be provided.`)\n}\n\nfunction isComponentHarnessConstructor<T extends ComponentHarness>(value: HarnessQuery<T>): value is ComponentHarnessConstructor<T> {\n return typeof value === 'function' && Object.prototype.hasOwnProperty.call(value, 'hostSelector')\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAEa,iBAAiB,CAAA;AAA9B,IAAA,WAAA,GAAA;QAEE,IAAe,CAAA,eAAA,GAAG,CAAC,CAAA;QACnB,IAAM,CAAA,MAAA,GAAuB,EAAE,CAAA;KAuDhC;;AAlDC,IAAA,IAAI,CACF,OAAgB,EAChB,KAAc,EACd,QAAA,GAAsC,EAAE,EACxC,IAAI,GAAG,EAAE,EAAA,GACN;;IAGL,OAAO,CACL,OAAgB,EAChB,KAAc,EACd,QAAsC,GAAA,EAAE,KACrC;;IAGL,KAAK,CACH,OAAgB,EAChB,KAAc,EACd,QAAsC,GAAA,EAAE,KACrC;;IAGL,IAAI,CACF,OAAgB,EAChB,KAAc,EACd,QAAsC,GAAA,EAAE,KACrC;;IAGL,OAAO,CACL,OAAgB,EAChB,KAAc,EACd,QAAsC,GAAA,EAAE,KACrC;AAEL;;AAEG;IACH,KAAK,CAAC,OAAgB,EAAA,GAAK;AAE3B;;AAEG;IACH,MAAM,CAAC,OAAe,EAAA,GAAK;AAE3B;;AAEG;AACH,IAAA,aAAa,CAAC,OAAe,EAAE,gBAAyB,EAAE,eAAwB,KAAK;AAExF;;ACzDD;AACA;AACO,eAAe,WAAW,CAAsB,KAAU,EAAA;;;;;AAK/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,CAAA;AACnD,CAAC;AAEK,SAAU,QAAQ,CAAC,KAAU,EAAA;;AAEjC,IAAA,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IACvB,OAAO;AACL,QAAA,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;QACf,aAAa,EAAE,CAAC,CAAC,aAAa;KAC/B,CAAA;AACH;;AClCO,eAAe,UAAU,CAC9B,WAA4B,EAC5B,OAA0B,EAAA;AAE1B,IAAA,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE;AACjC,QAAA,IAAI,6BAA6B,CAAC,WAAW,CAAC,EAAE;YAC9C,OAAO,yBAAyB,CAAC,iBAAiB,CAAC,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,CAAA;AACjF,SAAA;AACD,QAAA,MAAM,KAAK,CAAC,CAAgE,8DAAA,CAAA,CAAC,CAAA;AAC9E,KAAA;AAED,IAAA,IAAI,OAAO,CAAC,aAAa,KAAK,SAAS,EAAE;QACvC,OAAO,CAAC,IAAI,2BAA2B,CAAC,OAAO,CAAC,aAAa,CAAC;aAC3D,UAAU,CAAC,WAAW,CAAC,CAAA;AAC3B,KAAA;AAED,IAAA,MAAM,KAAK,CAAC,CAAmE,iEAAA,CAAA,CAAC,CAAA;AAClF,CAAC;AAED,SAAS,6BAA6B,CAA6B,KAAsB,EAAA;AACvF,IAAA,OAAO,OAAO,KAAK,KAAK,UAAU,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,cAAc,CAAC,CAAA;AACnG;;AChCA;;AAEG;;;;"}
@@ -452,7 +452,7 @@ class ToggleEditComponent {
452
452
  }
453
453
  }
454
454
  ToggleEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ToggleEditComponent, deps: [{ token: i0.ElementRef }, { token: i1.ControlContainer, optional: true, self: true }, { token: i2.TheSeamFormFieldComponent, host: true, optional: true }, { token: ToggleEditKeyboardListenerService }, { token: i4.FocusMonitor }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ViewContainerRef }, { token: i5.Overlay }], target: i0.ɵɵFactoryTarget.Component });
455
- ToggleEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: ToggleEditComponent, selector: "seam-toggle-edit", inputs: { cancelOnBlur: "cancelOnBlur", waitOnSubmit: "waitOnSubmit", placeholder: "placeholder", editing: "editing" }, outputs: { changeAccepted: "changeAccepted", changeDeclined: "changeDeclined", editingChange: "editingChange" }, host: { properties: { "class.toggle-edit-active": "this._toggleEditActiveClass" } }, queries: [{ propertyName: "displayTpl", first: true, predicate: ToggleEditDisplayTplDirective, descendants: true, static: true }], viewQueries: [{ propertyName: "templatePortalContent", first: true, predicate: ["templatePortalContent"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"toggle-edit-not-editing rounded\"\n [class.w-100]=\"editing\"\n [class.toggle-edit-editing]=\"editing\"\n [class.is-disabled]=\"disabled\"\n (seamElemResized)=\"resized()\">\n <div class=\"toggle-edit-content-container\">\n <div class=\"toggle-edit-content\" (click)=\"toggleEditing(true)\">\n <ng-container *ngIf=\"editing; else notEditingTpl\">\n <ng-content></ng-content>\n </ng-container>\n <ng-template #notEditingTpl>\n <ng-container *ngIf=\"displayTpl; else noDisplayTpl\">\n <ng-template [ngTemplateOutlet]=\"displayTpl.template\" [ngTemplateOutletContext]=\"{ $implicit: getValue() || placeholder }\"></ng-template>\n </ng-container>\n <ng-template #noDisplayTpl>\n <div class=\"pl-1 pr-1\">\n {{ getValue() || placeholder }}\n </div>\n </ng-template>\n </ng-template>\n </div>\n <div>\n <ng-template *ngIf=\"!editing\" [cdkPortalOutlet]=\"templatePortal\"></ng-template>\n <ng-template #templatePortalContent>\n <seam-toggle-edit-actions-container\n [class.bg-light]=\"editing\"\n tabindex=\"-1\"\n cdkMonitorSubtreeFocus\n (cdkFocusChange)=\"actionsFocusChange($event)\">\n <button *ngIf=\"!editing\"\n type=\"button\"\n class=\"toggle-edit-edit-btn btn text-secondary bg-transparent p-1 border-0\"\n (click)=\"toggleEditing(true)\">\n <fa-icon [icon]=\"faPen\"></fa-icon>\n </button>\n <button *ngIf=\"editing\"\n type=\"button\"\n [disabled]=\"!canSubmit()\"\n class=\"toggle-edit-submit-btn btn text-secondary bg-transparent p-1 border-0\"\n (click)=\"submitEdit()\">\n <fa-icon [icon]=\"faCheck\"></fa-icon>\n </button>\n <button *ngIf=\"editing\"\n type=\"button\"\n class=\"toggle-edit-cancel-btn btn text-secondary bg-transparent p-1 border-0\"\n (click)=\"cancelEdit()\">\n <fa-icon [icon]=\"faTimes\"></fa-icon>\n </button>\n </seam-toggle-edit-actions-container>\n </ng-template>\n </div>\n </div>\n</div>\n\n<seam-loading *ngIf=\"isSubmitting()\"></seam-loading>\n", styles: [":host{display:block;position:relative}.toggle-edit-not-editing{transition:.25s ease-in-out background-color}.toggle-edit-not-editing .toggle-edit-content-container{display:flex;flex-direction:row}.toggle-edit-not-editing .toggle-edit-content-container .toggle-edit-content{flex:1 1 auto;display:flex;align-items:center}.toggle-edit-not-editing:not(.is-disabled):hover,.toggle-edit-not-editing:not(.is-disabled).toggle-edit-editing{background-color:#f8f9fa}.toggle-edit-not-editing:not(.is-disabled):hover .toggle-edit-edit-btn,.toggle-edit-not-editing:not(.is-disabled).toggle-edit-editing .toggle-edit-edit-btn{opacity:1;visibility:visible}.toggle-edit-not-editing .toggle-edit-edit-btn{opacity:0;visibility:hidden}.toggle-edit-not-editing .toggle-edit-edit-btn,.toggle-edit-not-editing .toggle-edit-submit-btn,.toggle-edit-not-editing .toggle-edit-cancel-btn{transition:.25s ease-in-out}.toggle-edit-not-editing .toggle-edit-edit-btn{border-top-left-radius:0;border-bottom-left-radius:0}.toggle-edit-not-editing .toggle-edit-submit-btn{border-radius:0}.toggle-edit-not-editing .toggle-edit-cancel-btn{border-top-left-radius:0;border-bottom-left-radius:0}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i7.ElemResizedDirective, selector: "[seamElemResized]", outputs: ["seamElemResized"] }, { kind: "component", type: i8.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { kind: "directive", type: i9.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "directive", type: i4.CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: ["cdkFocusChange"], exportAs: ["cdkMonitorFocus"] }, { kind: "component", type: i10.LoadingComponent, selector: "seam-loading", inputs: ["theme"] }, { kind: "component", type: ToggleEditActionsContainerComponent, selector: "seam-toggle-edit-actions-container" }] });
455
+ ToggleEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: ToggleEditComponent, selector: "seam-toggle-edit", inputs: { cancelOnBlur: "cancelOnBlur", waitOnSubmit: "waitOnSubmit", placeholder: "placeholder", editing: "editing" }, outputs: { changeAccepted: "changeAccepted", changeDeclined: "changeDeclined", editingChange: "editingChange" }, host: { properties: { "class.toggle-edit-active": "this._toggleEditActiveClass" } }, queries: [{ propertyName: "displayTpl", first: true, predicate: ToggleEditDisplayTplDirective, descendants: true, static: true }], viewQueries: [{ propertyName: "templatePortalContent", first: true, predicate: ["templatePortalContent"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"toggle-edit-not-editing rounded\"\n [class.w-100]=\"editing\"\n [class.toggle-edit-editing]=\"editing\"\n [class.is-disabled]=\"disabled\"\n (seamElemResized)=\"resized()\">\n <div class=\"toggle-edit-content-container\">\n <div class=\"toggle-edit-content\" (click)=\"toggleEditing(true)\">\n <ng-container *ngIf=\"editing; else notEditingTpl\">\n <ng-content></ng-content>\n </ng-container>\n <ng-template #notEditingTpl>\n <ng-container *ngIf=\"displayTpl; else noDisplayTpl\">\n <ng-template [ngTemplateOutlet]=\"displayTpl.template\" [ngTemplateOutletContext]=\"{ $implicit: getValue() || placeholder }\"></ng-template>\n </ng-container>\n <ng-template #noDisplayTpl>\n <div class=\"pl-1 pr-1\">\n {{ getValue() || placeholder }}\n </div>\n </ng-template>\n </ng-template>\n </div>\n <div>\n <ng-template *ngIf=\"!editing\" [cdkPortalOutlet]=\"templatePortal\"></ng-template>\n <ng-template #templatePortalContent>\n <seam-toggle-edit-actions-container\n [class.bg-light]=\"editing\"\n tabindex=\"-1\"\n cdkMonitorSubtreeFocus\n (cdkFocusChange)=\"actionsFocusChange($event)\">\n <button *ngIf=\"!editing\"\n type=\"button\"\n class=\"toggle-edit-edit-btn btn text-secondary bg-transparent p-1 border-0\"\n (click)=\"toggleEditing(true)\">\n <fa-icon [icon]=\"faPen\"></fa-icon>\n </button>\n <button *ngIf=\"editing\"\n type=\"button\"\n [disabled]=\"!canSubmit()\"\n class=\"toggle-edit-submit-btn btn text-secondary bg-transparent p-1 border-0\"\n (click)=\"submitEdit()\">\n <fa-icon [icon]=\"faCheck\"></fa-icon>\n </button>\n <button *ngIf=\"editing\"\n type=\"button\"\n class=\"toggle-edit-cancel-btn btn text-secondary bg-transparent p-1 border-0\"\n (click)=\"cancelEdit()\">\n <fa-icon [icon]=\"faTimes\"></fa-icon>\n </button>\n </seam-toggle-edit-actions-container>\n </ng-template>\n </div>\n </div>\n</div>\n\n<seam-loading *ngIf=\"isSubmitting()\"></seam-loading>\n", styles: [":host{display:block;position:relative}.toggle-edit-not-editing{transition:.25s ease-in-out background-color}.toggle-edit-not-editing .toggle-edit-content-container{display:flex;flex-direction:row}.toggle-edit-not-editing .toggle-edit-content-container .toggle-edit-content{flex:1 1 auto;display:flex;align-items:center}.toggle-edit-not-editing:not(.is-disabled):hover,.toggle-edit-not-editing:not(.is-disabled).toggle-edit-editing{background-color:#f8f9fa}.toggle-edit-not-editing:not(.is-disabled):hover .toggle-edit-edit-btn,.toggle-edit-not-editing:not(.is-disabled).toggle-edit-editing .toggle-edit-edit-btn{opacity:1;visibility:visible}.toggle-edit-not-editing .toggle-edit-edit-btn{opacity:0;visibility:hidden}.toggle-edit-not-editing .toggle-edit-edit-btn,.toggle-edit-not-editing .toggle-edit-submit-btn,.toggle-edit-not-editing .toggle-edit-cancel-btn{transition:.25s ease-in-out}.toggle-edit-not-editing .toggle-edit-edit-btn{border-top-left-radius:0;border-bottom-left-radius:0}.toggle-edit-not-editing .toggle-edit-submit-btn{border-radius:0}.toggle-edit-not-editing .toggle-edit-cancel-btn{border-top-left-radius:0;border-bottom-left-radius:0}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i7.ElemResizedDirective, selector: "[seamElemResized]", outputs: ["seamElemResized"] }, { kind: "component", type: i8.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { kind: "directive", type: i9.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "directive", type: i4.CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: ["cdkFocusChange"], exportAs: ["cdkMonitorFocus"] }, { kind: "component", type: i10.TheSeamLoadingComponent, selector: "seam-loading", inputs: ["theme"] }, { kind: "component", type: ToggleEditActionsContainerComponent, selector: "seam-toggle-edit-actions-container" }] });
456
456
  __decorate([
457
457
  InputBoolean()
458
458
  ], ToggleEditComponent.prototype, "cancelOnBlur", void 0);