@coolon/angular-ui-powerups 3.10.3 → 3.10.4

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.
@@ -1,8 +1,9 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
2
  import { Component, Input } from '@angular/core';
3
- import { StoreInValueModel, TrackExternal, ValueModel } from '@coolon/pectin';
4
- export class BusyOverlayComponent {
3
+ import { GarbageCollector, StoreInValueModel, TrackExternal, ValueModel } from '@coolon/pectin';
4
+ export class BusyOverlayComponent extends GarbageCollector {
5
5
  constructor() {
6
+ super();
6
7
  }
7
8
  ngOnInit() {
8
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"busy-overlay.component.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/busy-overlay/busy-overlay.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAU,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAO9E,MAAM,OAAO,oBAAoB;IAQ/B;IACA,CAAC;IAED,QAAQ;IACR,CAAC;;;YAjBF,SAAS,SAAC;gBACT,QAAQ,EAAE,kBAAkB;gBAC5B,0MAA4C;;aAE7C;;;;wBAGE,KAAK;mBAGL,KAAK;;AAFN;IADU,aAAa,EAAE;8BACd,UAAU;uDAAU;AAG/B;IADU,iBAAiB,CAAC,WAAW,CAAC;;kDAC1B","sourcesContent":["import { Component, Input, OnInit } from '@angular/core';\nimport { StoreInValueModel, TrackExternal, ValueModel } from '@coolon/pectin';\n\n@Component({\n selector: 'aup-busy-overlay',\n templateUrl: `./busy-overlay.component.html`,\n styleUrls: ['./busy-overlay.component.scss']\n})\nexport class BusyOverlayComponent implements OnInit {\n\n @Input() @TrackExternal()\n busyModel: ValueModel<boolean>;\n\n @Input() @StoreInValueModel('busyModel')\n busy: boolean;\n\n constructor() {\n }\n\n ngOnInit() {\n }\n\n}\n"]}
1
+ {"version":3,"file":"busy-overlay.component.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/busy-overlay/busy-overlay.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAU,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAOhG,MAAM,OAAO,oBAAqB,SAAQ,gBAAgB;IAQxD;QACE,KAAK,EAAE,CAAA;IACT,CAAC;IAED,QAAQ;IACR,CAAC;;;YAlBF,SAAS,SAAC;gBACT,QAAQ,EAAE,kBAAkB;gBAC5B,0MAA4C;;aAE7C;;;;wBAGE,KAAK;mBAGL,KAAK;;AAFN;IADU,aAAa,EAAE;8BACd,UAAU;uDAAU;AAG/B;IADU,iBAAiB,CAAC,WAAW,CAAC;;kDAC1B","sourcesContent":["import { Component, Input, OnInit } from '@angular/core';\nimport { GarbageCollector, StoreInValueModel, TrackExternal, ValueModel } from '@coolon/pectin';\n\n@Component({\n selector: 'aup-busy-overlay',\n templateUrl: `./busy-overlay.component.html`,\n styleUrls: ['./busy-overlay.component.scss']\n})\nexport class BusyOverlayComponent extends GarbageCollector implements OnInit {\n\n @Input() @TrackExternal()\n busyModel: ValueModel<boolean>;\n\n @Input() @StoreInValueModel('busyModel')\n busy: boolean;\n\n constructor() {\n super()\n }\n\n ngOnInit() {\n }\n\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"BusyOverlayComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"aup-busy-overlay","template":"<ng-content></ng-content>\n<div class=\"busy-overlay-backdrop\" *ngIf=\"busyModel.value\">\n <mat-progress-spinner mode=\"indeterminate\" [diameter]=\"52\"></mat-progress-spinner>\n</div>\n","styles":[":host{position:relative}div.busy-overlay-backdrop{-ms-grid-columns:auto;-ms-grid-rows:auto;background-color:rgba(0,0,0,.2);bottom:0;display:-ms-grid;display:grid;grid-template-columns:auto;grid-template-rows:auto;left:0;place-content:center;position:absolute;right:0;top:0}"]}]}],"members":{"busyModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":10,"character":12}}]}],"busy":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInValueModel","line":13,"character":12},"arguments":["busyModel"]}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"BusyOverlayComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@coolon/pectin","name":"GarbageCollector","line":8,"character":42},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"aup-busy-overlay","template":"<ng-content></ng-content>\n<div class=\"busy-overlay-backdrop\" *ngIf=\"busyModel.value\">\n <mat-progress-spinner mode=\"indeterminate\" [diameter]=\"52\"></mat-progress-spinner>\n</div>\n","styles":[":host{position:relative}div.busy-overlay-backdrop{-ms-grid-columns:auto;-ms-grid-rows:auto;background-color:rgba(0,0,0,.2);bottom:0;display:-ms-grid;display:grid;grid-template-columns:auto;grid-template-rows:auto;left:0;place-content:center;position:absolute;right:0;top:0}"]}]}],"members":{"busyModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":10,"character":12}}]}],"busy":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInValueModel","line":13,"character":12},"arguments":["busyModel"]}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}]}}}}]
@@ -76,7 +76,9 @@ export class SwitchCaseComponent extends DisposableComponent {
76
76
  }
77
77
  if (matchingIndicies.length === 0) {
78
78
  this.switchCaseOptions.forEach((option, index) => {
79
- matchingIndicies.push(index);
79
+ if (option.isDefault) {
80
+ matchingIndicies.push(index);
81
+ }
80
82
  });
81
83
  if (matchingIndicies.length > 1) {
82
84
  console.warn(`found ${matchingIndicies.length} default case values, displaying the first.`);
@@ -1 +1 @@
1
- {"version":3,"file":"switch-case.component.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/switch-case/switch-case.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAEL,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,SAAS,EACT,KAAK,EAEL,SAAS,EACT,WAAW,EACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,GAAG,EAAE,iBAAiB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAG9D,MAAM,OAAgB,gBAAgB;IAIpC,YAAqB,WAAgC;QAAhC,gBAAW,GAAX,WAAW,CAAqB;IACrD,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;CAGF;AAMD,MAAM,OAAO,uBAA2B,SAAQ,gBAAmB;IAIjE,YAAY,WAAgC;QAC1C,KAAK,CAAC,WAAW,CAAC,CAAC;QAHZ,cAAS,GAAG,KAAK,CAAC;IAI3B,CAAC;IAED,OAAO,CA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,KAAK;qBAGL,KAAK;gCAGL,eAAe,SAAC,gBAAgB;;AALjC;IADU,aAAa,EAAE;8BACZ,UAAU;wDAAI;AAG3B;IADU,iBAAiB,CAAC,aAAa,CAAC;;mDAChC","sourcesContent":["import {\n AfterContentInit,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Directive,\n Input,\n OnInit,\n QueryList,\n TemplateRef\n} from '@angular/core';\n\nimport { Dsl, StoreInValueModel, TrackExternal, ValueModel } from '@coolon/pectin';\nimport { DisposableComponent } from '../disposable-component';\n\n\nexport abstract class SwitchCaseOption<T> {\n\n abstract readonly isDefault: boolean;\n\n constructor(readonly templateRef: TemplateRef<Object>) {\n }\n\n get name() {\n return this.constructor.name;\n }\n\n abstract matches(value: T): boolean;\n}\n\n@Directive({\n selector: '[aupSwitchCaseWhen]',\n providers: [{ provide: SwitchCaseOption, useExisting: SwitchCaseWhenDirective }]\n})\nexport class SwitchCaseWhenDirective<T> extends SwitchCaseOption<T> {\n @Input() aupSwitchCaseWhen: T;\n readonly isDefault = false;\n\n constructor(templateRef: TemplateRef<Object>) {\n super(templateRef);\n }\n\n matches(value: T): boolean {\n return this.aupSwitchCaseWhen === value;\n }\n}\n\n@Directive({\n selector: '[aupSwitchCaseDefault]',\n providers: [{ provide: SwitchCaseOption, useExisting: SwitchCaseDefaultDirective }]\n})\nexport class SwitchCaseDefaultDirective<T> extends SwitchCaseOption<T> {\n readonly isDefault = true;\n\n constructor(templateRef: TemplateRef<Object>) {\n super(templateRef);\n }\n\n matches(value: T): boolean {\n return false;\n }\n}\n\n\n@Component({\n selector: 'aup-switch-case',\n templateUrl: './switch-case.component.html',\n styleUrls: ['./switch-case.component.scss']\n})\nexport class SwitchCaseComponent<T> extends DisposableComponent implements OnInit, AfterContentInit {\n\n @Input() @TrackExternal()\n switchModel: ValueModel<T>;\n\n @Input() @StoreInValueModel('switchModel')\n switch: T;\n\n @ContentChildren(SwitchCaseOption)\n switchCaseOptions: QueryList<SwitchCaseOption<T>>;\n\n selectedIndex = 0;\n\n constructor(private cdr: ChangeDetectorRef) {\n super();\n }\n\n ngOnInit(): void {\n }\n\n ngAfterContentInit(): void {\n const subscription = this.switchCaseOptions.changes.subscribe(change => this.updateSelection());\n this.onDispose(() => subscription.unsubscribe());\n const { chain, when } = Dsl.disposeWith(this);\n when(this.switchModel).changes(() => this.updateSelection(), { initialValue: 'triggerChange' });\n this.cdr.detectChanges();\n }\n\n private updateSelection() {\n const matchingIndicies = [];\n this.switchCaseOptions.forEach((option, index) => {\n if (option.matches(this.switchModel.value)) {\n matchingIndicies.push(index);\n }\n });\n if (matchingIndicies.length > 1) {\n console.warn(`found ${matchingIndicies.length} matching case values, displaying the first.`);\n }\n if (matchingIndicies.length === 0) {\n this.switchCaseOptions.forEach((option, index) => {\n matchingIndicies.push(index);\n });\n if (matchingIndicies.length > 1) {\n console.warn(`found ${matchingIndicies.length} default case values, displaying the first.`);\n }\n }\n if (matchingIndicies.length > 0) {\n this.selectedIndex = matchingIndicies[0];\n } else {\n console.warn(`found no matching or default case values.`);\n this.selectedIndex = -1;\n }\n }\n}\n\n"]}
1
+ {"version":3,"file":"switch-case.component.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/switch-case/switch-case.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAEL,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,SAAS,EACT,KAAK,EAEL,SAAS,EACT,WAAW,EACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,GAAG,EAAE,iBAAiB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAG9D,MAAM,OAAgB,gBAAgB;IAIpC,YAAqB,WAAgC;QAAhC,gBAAW,GAAX,WAAW,CAAqB;IACrD,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;CAGF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IAAI,CAAC,2CAA2C,CAAC,CAAC;YAC1D,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;SACzB;IACH,CAAC;;;YA3DF,SAAS,SAAC;gBACT,QAAQ,EAAE,iBAAiB;gBAC3B,+RAA2C;;aAE5C;;;YAlEC,iBAAiB;;;0BAqEhB,KAAK;qBAGL,KAAK;gCAGL,eAAe,SAAC,gBAAgB;;AALjC;IADU,aAAa,EAAE;8BACZ,UAAU;wDAAI;AAG3B;IADU,iBAAiB,CAAC,aAAa,CAAC;;mDAChC","sourcesContent":["import {\n AfterContentInit,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Directive,\n Input,\n OnInit,\n QueryList,\n TemplateRef\n} from '@angular/core';\n\nimport { Dsl, StoreInValueModel, TrackExternal, ValueModel } from '@coolon/pectin';\nimport { DisposableComponent } from '../disposable-component';\n\n\nexport abstract class SwitchCaseOption<T> {\n\n abstract readonly isDefault: boolean;\n\n constructor(readonly templateRef: TemplateRef<Object>) {\n }\n\n get name() {\n return this.constructor.name;\n }\n\n abstract matches(value: T): boolean;\n}\n\n@Directive({\n selector: '[aupSwitchCaseWhen]',\n providers: [{ provide: SwitchCaseOption, useExisting: SwitchCaseWhenDirective }]\n})\nexport class SwitchCaseWhenDirective<T> extends SwitchCaseOption<T> {\n @Input() aupSwitchCaseWhen: T;\n readonly isDefault = false;\n\n constructor(templateRef: TemplateRef<Object>) {\n super(templateRef);\n }\n\n matches(value: T): boolean {\n return this.aupSwitchCaseWhen === value;\n }\n}\n\n@Directive({\n selector: '[aupSwitchCaseDefault]',\n providers: [{ provide: SwitchCaseOption, useExisting: SwitchCaseDefaultDirective }]\n})\nexport class SwitchCaseDefaultDirective<T> extends SwitchCaseOption<T> {\n readonly isDefault = true;\n\n constructor(templateRef: TemplateRef<Object>) {\n super(templateRef);\n }\n\n matches(value: T): boolean {\n return false;\n }\n}\n\n\n@Component({\n selector: 'aup-switch-case',\n templateUrl: './switch-case.component.html',\n styleUrls: ['./switch-case.component.scss']\n})\nexport class SwitchCaseComponent<T> extends DisposableComponent implements OnInit, AfterContentInit {\n\n @Input() @TrackExternal()\n switchModel: ValueModel<T>;\n\n @Input() @StoreInValueModel('switchModel')\n switch: T;\n\n @ContentChildren(SwitchCaseOption)\n switchCaseOptions: QueryList<SwitchCaseOption<T>>;\n\n selectedIndex = 0;\n\n constructor(private cdr: ChangeDetectorRef) {\n super();\n }\n\n ngOnInit(): void {\n }\n\n ngAfterContentInit(): void {\n const subscription = this.switchCaseOptions.changes.subscribe(change => this.updateSelection());\n this.onDispose(() => subscription.unsubscribe());\n const { chain, when } = Dsl.disposeWith(this);\n when(this.switchModel).changes(() => this.updateSelection(), { initialValue: 'triggerChange' });\n this.cdr.detectChanges();\n }\n\n private updateSelection() {\n const matchingIndicies = [];\n this.switchCaseOptions.forEach((option, index) => {\n if (option.matches(this.switchModel.value)) {\n matchingIndicies.push(index);\n }\n });\n if (matchingIndicies.length > 1) {\n console.warn(`found ${matchingIndicies.length} matching case values, displaying the first.`);\n }\n if (matchingIndicies.length === 0) {\n this.switchCaseOptions.forEach((option, index) => {\n if (option.isDefault) {\n matchingIndicies.push(index);\n }\n });\n if (matchingIndicies.length > 1) {\n console.warn(`found ${matchingIndicies.length} default case values, displaying the first.`);\n }\n }\n if (matchingIndicies.length > 0) {\n this.selectedIndex = matchingIndicies[0];\n } else {\n console.warn(`found no matching or default case values.`);\n this.selectedIndex = -1;\n }\n }\n}\n\n"]}
@@ -319,8 +319,9 @@ DirectivesModule.decorators = [
319
319
  },] }
320
320
  ];
321
321
 
322
- class BusyOverlayComponent {
322
+ class BusyOverlayComponent extends GarbageCollector {
323
323
  constructor() {
324
+ super();
324
325
  }
325
326
  ngOnInit() {
326
327
  }
@@ -1770,7 +1771,9 @@ class SwitchCaseComponent extends DisposableComponent {
1770
1771
  }
1771
1772
  if (matchingIndicies.length === 0) {
1772
1773
  this.switchCaseOptions.forEach((option, index) => {
1773
- matchingIndicies.push(index);
1774
+ if (option.isDefault) {
1775
+ matchingIndicies.push(index);
1776
+ }
1774
1777
  });
1775
1778
  if (matchingIndicies.length > 1) {
1776
1779
  console.warn(`found ${matchingIndicies.length} default case values, displaying the first.`);