@coolon/angular-ui-powerups 11.0.0-alpha.9 → 11.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/bundles/coolon-angular-ui-powerups.umd.js +192 -22
  2. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  3. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  5. package/coolon-angular-ui-powerups.metadata.json +1 -1
  6. package/esm2015/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
  7. package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
  8. package/esm2015/lib/components/table/default-cell-renderer/default-cell-renderer.component.js +1 -1
  9. package/esm2015/lib/components/table/default-cell-renderer/default-cell-renderer.component.js.map +1 -1
  10. package/esm2015/lib/components/table/default-cell-renderer/default-cell-renderer.component.metadata.json +1 -1
  11. package/esm2015/lib/components/track-by.js +5 -1
  12. package/esm2015/lib/components/track-by.js.map +1 -1
  13. package/esm2015/lib/directives/directives.module.js +8 -2
  14. package/esm2015/lib/directives/directives.module.js.map +1 -1
  15. package/esm2015/lib/directives/directives.module.metadata.json +1 -1
  16. package/esm2015/lib/directives/directives.module.ngfactory.js.map +1 -1
  17. package/esm2015/lib/directives/exports.js +2 -0
  18. package/esm2015/lib/directives/exports.js.map +1 -1
  19. package/esm2015/lib/directives/exports.metadata.json +1 -1
  20. package/esm2015/lib/directives/highlight-text-model.directive.js +25 -0
  21. package/esm2015/lib/directives/highlight-text-model.directive.js.map +1 -0
  22. package/esm2015/lib/directives/highlight-text-model.directive.metadata.json +1 -0
  23. package/esm2015/lib/directives/highlight-text-model.directive.ngfactory.js.map +1 -0
  24. package/esm2015/lib/directives/highlight.pipe.js +43 -0
  25. package/esm2015/lib/directives/highlight.pipe.js.map +1 -0
  26. package/esm2015/lib/directives/highlight.pipe.metadata.json +1 -0
  27. package/esm2015/lib/directives/highlight.pipe.ngfactory.js.map +1 -0
  28. package/esm2015/lib/interaction/interaction.module.ngfactory.js.map +1 -1
  29. package/esm2015/lib/place/components/abstract-place-navigation.component.js +10 -15
  30. package/esm2015/lib/place/components/abstract-place-navigation.component.js.map +1 -1
  31. package/esm2015/lib/place/components/abstract-place-navigation.component.metadata.json +1 -1
  32. package/esm2015/lib/place/place.module.ngfactory.js.map +1 -1
  33. package/esm2015/lib/services/exports.js +5 -0
  34. package/esm2015/lib/services/exports.js.map +1 -0
  35. package/esm2015/lib/services/exports.metadata.json +1 -0
  36. package/esm2015/lib/services/visibility-service.js +74 -0
  37. package/esm2015/lib/services/visibility-service.js.map +1 -0
  38. package/esm2015/lib/services/visibility-service.metadata.json +1 -0
  39. package/esm2015/lib/services/visibility-service.ngfactory.js.map +1 -0
  40. package/esm2015/public-api.js +1 -0
  41. package/esm2015/public-api.js.map +1 -1
  42. package/esm2015/public-api.metadata.json +1 -1
  43. package/fesm2015/coolon-angular-ui-powerups.js +159 -22
  44. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  45. package/lib/components/track-by.d.ts +3 -1
  46. package/lib/directives/exports.d.ts +2 -0
  47. package/lib/directives/highlight-text-model.directive.d.ts +7 -0
  48. package/lib/directives/highlight.pipe.d.ts +11 -0
  49. package/lib/place/components/abstract-place-navigation.component.d.ts +1 -1
  50. package/lib/services/exports.d.ts +4 -0
  51. package/lib/services/visibility-service.d.ts +12 -0
  52. package/package.json +1 -1
  53. package/public-api.d.ts +1 -0
  54. package/schematics/aup-i18n/index.js +8 -28
  55. package/schematics/aup-i18n/index.js.map +1 -1
  56. package/schematics/aup-i18n/templates/app/aup.i18n.yml.template +80 -0
  57. package/schematics/bootstrap-app/index.js +5 -4
  58. package/schematics/bootstrap-app/index.js.map +1 -1
  59. package/schematics/bootstrap-app/templates/{i18n/config.json.template → i18n.config.json.template} +2 -0
  60. package/schematics/ng-add/index.js +2 -2
  61. package/schematics/ng-add/index.js.map +1 -1
  62. package/schematics/place-add/index.js +4 -5
  63. package/schematics/place-add/index.js.map +1 -1
  64. package/schematics/place-add/templates/component/__name@dasherize__.component.ts.template +3 -1
  65. package/schematics/place-add/templates/component/__name@dasherize__.i18n.yml.template +5 -0
  66. package/schematics/aup-i18n/templates/i18n/aup/components.yml.template +0 -69
  67. package/schematics/bootstrap-app/templates/i18n/notifications.yml.template +0 -19
  68. package/schematics/place-add/templates/files/i18n/places/__name@dasherize__.yml.template +0 -7
  69. /package/schematics/bootstrap-app/templates/{app → src/app}/app-routing.module.ts.template +0 -0
  70. /package/schematics/bootstrap-app/templates/{app → src/app}/app.component.html.template +0 -0
  71. /package/schematics/bootstrap-app/templates/{app → src/app}/app.component.scss.template +0 -0
  72. /package/schematics/bootstrap-app/templates/{app → src/app}/app.component.ts.template +0 -0
  73. /package/schematics/bootstrap-app/templates/{app → src/app}/app.module.ts.template +0 -0
  74. /package/schematics/bootstrap-app/templates/{app → src/app}/i18n.ts.template +0 -0
  75. /package/schematics/bootstrap-app/templates/{assets → src/assets}/fonts/material-design-icons/MaterialIcons-Regular.eot +0 -0
  76. /package/schematics/bootstrap-app/templates/{assets → src/assets}/fonts/material-design-icons/MaterialIcons-Regular.ijmap +0 -0
  77. /package/schematics/bootstrap-app/templates/{assets → src/assets}/fonts/material-design-icons/MaterialIcons-Regular.svg +0 -0
  78. /package/schematics/bootstrap-app/templates/{assets → src/assets}/fonts/material-design-icons/MaterialIcons-Regular.ttf +0 -0
  79. /package/schematics/bootstrap-app/templates/{assets → src/assets}/fonts/material-design-icons/MaterialIcons-Regular.woff +0 -0
  80. /package/schematics/bootstrap-app/templates/{assets → src/assets}/fonts/material-design-icons/MaterialIcons-Regular.woff2 +0 -0
  81. /package/schematics/bootstrap-app/templates/{assets → src/assets}/fonts/material-design-icons/README.md +0 -0
  82. /package/schematics/bootstrap-app/templates/{assets → src/assets}/fonts/material-design-icons/codepoints +0 -0
  83. /package/schematics/bootstrap-app/templates/{assets → src/assets}/fonts/material-design-icons/material-icons.css +0 -0
  84. /package/schematics/bootstrap-app/templates/{index.html.template → src/index.html.template} +0 -0
  85. /package/schematics/bootstrap-app/templates/{styles → src/styles}/global-variables.scss.template +0 -0
  86. /package/schematics/bootstrap-app/templates/{styles.scss.template → src/styles.scss.template} +0 -0
@@ -0,0 +1,74 @@
1
+ // TODO: Merge various wake detection events into this class. visibility, wake events, websocket connection, online detection.
2
+ import { DOCUMENT } from '@angular/common';
3
+ import { Inject, Injectable } from '@angular/core';
4
+ import { Dsl, GarbageCollector, MutableValueModel } from '@coolon/pectin';
5
+ import * as wakeEvent from 'wake-event';
6
+ import * as i0 from "@angular/core";
7
+ import * as i1 from "@angular/common";
8
+ // Taken from: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
9
+ export class VisibilityService extends GarbageCollector {
10
+ // private _wakeEvents = new MutableStream<Instant>();
11
+ // private _throttledWakeEvents: Stream<Instant>;
12
+ constructor(document) {
13
+ super();
14
+ this._visibleModel = new MutableValueModel();
15
+ this.document = document; // see https://stackoverflow.com/a/53715642
16
+ const { chain } = Dsl.disposeWith(this);
17
+ // Set the name of the hidden property and the change event for visibility
18
+ if (typeof this.document.hidden !== 'undefined') { // Opera 12.10 and Firefox 18 and later support
19
+ this.attributeName = 'hidden';
20
+ this.eventName = 'visibilitychange';
21
+ }
22
+ else if (typeof this.document['msHidden'] !== 'undefined') {
23
+ this.attributeName = 'msHidden';
24
+ this.eventName = 'msvisibilitychange';
25
+ }
26
+ else if (typeof this.document['webkitHidden'] !== 'undefined') {
27
+ this.attributeName = 'webkitHidden';
28
+ this.eventName = 'webkitvisibilitychange';
29
+ }
30
+ // Warn if the browser doesn't support addEventListener or the Page Visibility API
31
+ if (typeof this.document.addEventListener === 'undefined' || typeof document[this.attributeName] === 'undefined') {
32
+ console.log('This demo requires a browser, such as Google Chrome or Firefox, that supports the Page Visibility API.');
33
+ }
34
+ else {
35
+ // Handle page visibility change
36
+ const handler = () => this.updateVisibilityState();
37
+ this.document.addEventListener(this.eventName, handler, false);
38
+ this.onDispose(() => {
39
+ this.document.removeEventListener(this.eventName, handler);
40
+ });
41
+ }
42
+ wakeEvent(() => this.updateVisibilityState());
43
+ this._visibleModel.value = this.isVisible();
44
+ // give the network a chance to come back or we end up with a bunch of failed requests.
45
+ // should probably also implement a connection service so that we can go
46
+ // connectionServer.ensureConnectedThen(fireWakeEvent);
47
+ // this._throttledWakeEvents = chain(this._wakeEvents).throttle(300);
48
+ }
49
+ // get wakeEvents(): Stream<Instant> {
50
+ // return this._throttledWakeEvents;
51
+ // }
52
+ // @trace
53
+ updateVisibilityState() {
54
+ this._visibleModel.value = this.isVisible();
55
+ // this._wakeEvents.publish(Instant.now());
56
+ }
57
+ get visibleModel() {
58
+ return this._visibleModel.readonly;
59
+ }
60
+ isHidden() {
61
+ return !!this.document[this.attributeName];
62
+ }
63
+ isVisible() {
64
+ return !this.isHidden();
65
+ }
66
+ }
67
+ VisibilityService.ɵprov = i0.ɵɵdefineInjectable({ factory: function VisibilityService_Factory() { return new VisibilityService(i0.ɵɵinject(i1.DOCUMENT)); }, token: VisibilityService, providedIn: "root" });
68
+ VisibilityService.decorators = [
69
+ { type: Injectable, args: [{ providedIn: 'root' },] }
70
+ ];
71
+ VisibilityService.ctorParameters = () => [
72
+ { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
73
+ ];
74
+ //# sourceMappingURL=visibility-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"visibility-service.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/services/visibility-service.ts"],"names":[],"mappings":"AAAA,+HAA+H;AAG/H,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,gBAAgB,EAAE,iBAAiB,EAAc,MAAM,gBAAgB,CAAC;AACtF,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;;;AAExC,mFAAmF;AAGnF,MAAM,OAAO,iBAAkB,SAAQ,gBAAgB;IAOrD,sDAAsD;IACtD,iDAAiD;IAEjD,YAA8B,QAAa;QACzC,KAAK,EAAE,CAAC;QALF,kBAAa,GAAG,IAAI,iBAAiB,EAAW,CAAC;QAMvD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC,2CAA2C;QAErE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAExC,0EAA0E;QAC1E,IAAI,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,WAAW,EAAE,EAAE,+CAA+C;YAChG,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;YAC9B,IAAI,CAAC,SAAS,GAAG,kBAAkB,CAAC;SACrC;aAAM,IAAI,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,WAAW,EAAE;YAC3D,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC;YAChC,IAAI,CAAC,SAAS,GAAG,oBAAoB,CAAC;SACvC;aAAM,IAAI,OAAO,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,WAAW,EAAE;YAC/D,IAAI,CAAC,aAAa,GAAG,cAAc,CAAC;YACpC,IAAI,CAAC,SAAS,GAAG,wBAAwB,CAAC;SAC3C;QAED,kFAAkF;QAClF,IAAI,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,KAAK,WAAW,IAAI,OAAO,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,WAAW,EAAE;YAChH,OAAO,CAAC,GAAG,CAAC,wGAAwG,CAAC,CAAC;SACvH;aAAM;YACL,gCAAgC;YAChC,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;YACnD,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;YAC/D,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE;gBAClB,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAC7D,CAAC,CAAC,CAAC;SAEJ;QAED,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC,aAAa,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAE5C,uFAAuF;QACvF,wEAAwE;QACxE,uDAAuD;QACvD,qEAAqE;IAEvE,CAAC;IAED,sCAAsC;IACtC,sCAAsC;IACtC,IAAI;IAEJ,SAAS;IACC,qBAAqB;QAC7B,IAAI,CAAC,aAAa,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAC5C,2CAA2C;IAC7C,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC;IACrC,CAAC;IAED,QAAQ;QACN,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC7C,CAAC;IAED,SAAS;QACP,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;;;;YAxEF,UAAU,SAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;4CAWnB,MAAM,SAAC,QAAQ","sourcesContent":["// TODO: Merge various wake detection events into this class. visibility, wake events, websocket connection, online detection.\n\n\nimport { DOCUMENT } from '@angular/common';\nimport { Inject, Injectable } from '@angular/core';\nimport { Dsl, GarbageCollector, MutableValueModel, ValueModel } from '@coolon/pectin';\nimport * as wakeEvent from 'wake-event';\n\n// Taken from: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API\n\n@Injectable({ providedIn: 'root' })\nexport class VisibilityService extends GarbageCollector {\n\n private readonly document: Document;\n private readonly attributeName: string;\n private readonly eventName: string;\n\n private _visibleModel = new MutableValueModel<boolean>();\n // private _wakeEvents = new MutableStream<Instant>();\n // private _throttledWakeEvents: Stream<Instant>;\n\n constructor(@Inject(DOCUMENT) document: any) {\n super();\n this.document = document; // see https://stackoverflow.com/a/53715642\n\n const { chain } = Dsl.disposeWith(this);\n\n // Set the name of the hidden property and the change event for visibility\n if (typeof this.document.hidden !== 'undefined') { // Opera 12.10 and Firefox 18 and later support\n this.attributeName = 'hidden';\n this.eventName = 'visibilitychange';\n } else if (typeof this.document['msHidden'] !== 'undefined') {\n this.attributeName = 'msHidden';\n this.eventName = 'msvisibilitychange';\n } else if (typeof this.document['webkitHidden'] !== 'undefined') {\n this.attributeName = 'webkitHidden';\n this.eventName = 'webkitvisibilitychange';\n }\n\n // Warn if the browser doesn't support addEventListener or the Page Visibility API\n if (typeof this.document.addEventListener === 'undefined' || typeof document[this.attributeName] === 'undefined') {\n console.log('This demo requires a browser, such as Google Chrome or Firefox, that supports the Page Visibility API.');\n } else {\n // Handle page visibility change\n const handler = () => this.updateVisibilityState();\n this.document.addEventListener(this.eventName, handler, false);\n this.onDispose(() => {\n this.document.removeEventListener(this.eventName, handler);\n });\n\n }\n\n wakeEvent(() => this.updateVisibilityState());\n this._visibleModel.value = this.isVisible();\n\n // give the network a chance to come back or we end up with a bunch of failed requests.\n // should probably also implement a connection service so that we can go\n // connectionServer.ensureConnectedThen(fireWakeEvent);\n // this._throttledWakeEvents = chain(this._wakeEvents).throttle(300);\n\n }\n\n // get wakeEvents(): Stream<Instant> {\n // return this._throttledWakeEvents;\n // }\n\n // @trace\n protected updateVisibilityState() {\n this._visibleModel.value = this.isVisible();\n // this._wakeEvents.publish(Instant.now());\n }\n\n get visibleModel(): ValueModel<boolean> {\n return this._visibleModel.readonly;\n }\n\n isHidden(): boolean {\n return !!this.document[this.attributeName];\n }\n\n isVisible(): boolean {\n return !this.isHidden();\n }\n\n}\n"]}
@@ -0,0 +1 @@
1
+ [{"__symbolic":"module","version":4,"metadata":{"VisibilityService":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@coolon/pectin","name":"GarbageCollector","line":11,"character":39},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":10,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":21,"character":15},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":21,"character":22}]}]],"parameters":[{"__symbolic":"reference","name":"any"}]}],"updateVisibilityState":[{"__symbolic":"method"}],"isHidden":[{"__symbolic":"method"}],"isVisible":[{"__symbolic":"method"}]},"statics":{"ɵprov":{}}}}}]
@@ -0,0 +1 @@
1
+ {"version":3,"file":"visibility-service.ngfactory.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/services/visibility-service.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
@@ -4,4 +4,5 @@ export * from './lib/components/exports';
4
4
  export * from './lib/directives/exports';
5
5
  export * from './lib/interaction/exports';
6
6
  export * from './lib/place/exports';
7
+ export * from './lib/services/exports';
7
8
  //# sourceMappingURL=public-api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"public-api.js","sourceRoot":"","sources":["../../../../libs/angular-ui-powerups/src/public-api.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC","sourcesContent":["export * from './lib/angular-ui-powerups.module';\nexport * from './lib/animations/exports';\nexport * from './lib/components/exports';\nexport * from './lib/directives/exports';\nexport * from './lib/interaction/exports';\nexport * from './lib/place/exports';\n"]}
1
+ {"version":3,"file":"public-api.js","sourceRoot":"","sources":["../../../../libs/angular-ui-powerups/src/public-api.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC","sourcesContent":["export * from './lib/angular-ui-powerups.module';\nexport * from './lib/animations/exports';\nexport * from './lib/components/exports';\nexport * from './lib/directives/exports';\nexport * from './lib/interaction/exports';\nexport * from './lib/place/exports';\nexport * from './lib/services/exports';\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./lib/angular-ui-powerups.module"},{"from":"./lib/animations/exports"},{"from":"./lib/components/exports"},{"from":"./lib/directives/exports"},{"from":"./lib/interaction/exports"},{"from":"./lib/place/exports"}]}]
1
+ [{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./lib/angular-ui-powerups.module"},{"from":"./lib/animations/exports"},{"from":"./lib/components/exports"},{"from":"./lib/directives/exports"},{"from":"./lib/interaction/exports"},{"from":"./lib/place/exports"},{"from":"./lib/services/exports"}]}]
@@ -1,5 +1,5 @@
1
1
  import { DOCUMENT, CommonModule, Location } from '@angular/common';
2
- import { Directive, ElementRef, Inject, Host, Optional, Input, HostListener, NgZone, ɵɵdefineInjectable, ɵɵinject, Injectable, NgModule, Component, ContentChild, ViewEncapsulation, HostBinding, InjectionToken, ViewChildren, SkipSelf, EventEmitter, ViewChild, Output, Self, TemplateRef, ChangeDetectorRef, ContentChildren, ViewContainerRef, Injector, ComponentFactoryResolver, INJECTOR } from '@angular/core';
2
+ import { Directive, ElementRef, Inject, Host, Optional, Input, HostListener, NgZone, ɵɵdefineInjectable, ɵɵinject, Injectable, Pipe, NgModule, Component, ContentChild, ViewEncapsulation, HostBinding, InjectionToken, ViewChildren, SkipSelf, EventEmitter, ViewChild, Output, Self, TemplateRef, ChangeDetectorRef, ContentChildren, ViewContainerRef, Injector, ComponentFactoryResolver, INJECTOR } from '@angular/core';
3
3
  import { FormsModule } from '@angular/forms';
4
4
  import { MatFormFieldModule } from '@angular/material/form-field';
5
5
  import { MatInputModule } from '@angular/material/input';
@@ -19,10 +19,11 @@ import { MatTableModule } from '@angular/material/table';
19
19
  import { MatTooltipModule } from '@angular/material/tooltip';
20
20
  import { FontAwesomeModule, FaIconLibrary } from '@fortawesome/angular-fontawesome';
21
21
  import { fas } from '@fortawesome/free-solid-svg-icons';
22
- import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, ValueModel, StoreInValueModel, Command, MutableListModel, StoreInListModel, Disposable, MutableValueModel, DelegatingListModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, MultipleSelectionModel, DelegatingSelectionModel, AbstractComputedListModel, DirtyTrackingForm, ComputedListModel, PageController, Deferred, Trace, TransactionObserver, Functions } from '@coolon/pectin';
22
+ import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, ValueModel, StoreInValueModel, Command, MutableListModel, StoreInListModel, Disposable, MutableValueModel, DelegatingListModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, MultipleSelectionModel, DelegatingSelectionModel, AbstractComputedListModel, DirtyTrackingForm, ComputedListModel, PageController, Deferred, Trace, Functions } from '@coolon/pectin';
23
23
  import { __decorate, __metadata, __awaiter } from 'tslib';
24
- import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
24
+ import { DomSanitizer } from '@angular/platform-browser';
25
25
  import _, { find, filter, each, isNil, isEqual } from 'lodash';
26
+ import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
26
27
  import { Enum } from 'typescript-string-enums';
27
28
  import ResizeObserver from 'resize-observer-polyfill';
28
29
  import { assert as assert$1, Stringy, Mixin, Opts, lang as lang$1, Klass } from '@coolon/typescript-utilities';
@@ -35,6 +36,7 @@ import { MatListModule } from '@angular/material/list';
35
36
  import { Memoize as Memoize$1 } from '@typescript-plus/fast-memoize-decorator';
36
37
  import 'reflect-metadata';
37
38
  import { style, query, group, animate, trigger, transition } from '@angular/animations';
39
+ import * as wakeEvent from 'wake-event';
38
40
 
39
41
  class CommandDirective extends GarbageCollector {
40
42
  constructor(elementRef, matButton, matMenuItem) {
@@ -295,13 +297,75 @@ FocusBindingDirective.propDecorators = {
295
297
  onFocusOut: [{ type: HostListener, args: ['focusout',] }]
296
298
  };
297
299
 
300
+ class HighlightTextModelDirective extends GarbageCollector {
301
+ constructor() {
302
+ super();
303
+ }
304
+ ngOnDestroy() {
305
+ this.dispose();
306
+ }
307
+ }
308
+ HighlightTextModelDirective.decorators = [
309
+ { type: Directive, args: [{
310
+ selector: '[aupHighlightTextModel]'
311
+ },] }
312
+ ];
313
+ HighlightTextModelDirective.ctorParameters = () => [];
314
+ HighlightTextModelDirective.propDecorators = {
315
+ aupHighlightTextModel: [{ type: Input }]
316
+ };
317
+ __decorate([
318
+ TrackExternal(),
319
+ __metadata("design:type", ValueModel)
320
+ ], HighlightTextModelDirective.prototype, "aupHighlightTextModel", void 0);
321
+
322
+ class HighlightPipe extends GarbageCollector {
323
+ constructor(sanitizer, highlightContext) {
324
+ super();
325
+ this.sanitizer = sanitizer;
326
+ this.highlightContext = highlightContext;
327
+ }
328
+ ngOnDestroy() {
329
+ this.dispose();
330
+ }
331
+ transform(value, searchModel) {
332
+ var _a;
333
+ const model = searchModel !== null && searchModel !== void 0 ? searchModel : (_a = this.highlightContext) === null || _a === void 0 ? void 0 : _a.aupHighlightTextModel;
334
+ const searchText = model === null || model === void 0 ? void 0 : model.value;
335
+ if (_.isEmpty(searchText) || !_.isString(value)) {
336
+ return value;
337
+ }
338
+ // Match in a case insensitive manner
339
+ const re = new RegExp(searchText, 'gi');
340
+ const match = value.match(re);
341
+ // If there's no match, just return the original value.
342
+ if (!match) {
343
+ return value;
344
+ }
345
+ const result = value.replace(re, '<mark>' + match[0] + '</mark>');
346
+ return this.sanitizer.bypassSecurityTrustHtml(result);
347
+ }
348
+ }
349
+ HighlightPipe.decorators = [
350
+ { type: Pipe, args: [{
351
+ name: 'aupHighlight',
352
+ pure: false
353
+ },] }
354
+ ];
355
+ HighlightPipe.ctorParameters = () => [
356
+ { type: DomSanitizer },
357
+ { type: HighlightTextModelDirective, decorators: [{ type: Optional }] }
358
+ ];
359
+
298
360
  class DirectivesModule {
299
361
  }
300
362
  DirectivesModule.decorators = [
301
363
  { type: NgModule, args: [{
302
364
  declarations: [
303
365
  CommandDirective,
304
- FocusBindingDirective
366
+ FocusBindingDirective,
367
+ HighlightPipe,
368
+ HighlightTextModelDirective
305
369
  ],
306
370
  imports: [
307
371
  CommonModule,
@@ -314,7 +378,9 @@ DirectivesModule.decorators = [
314
378
  ],
315
379
  exports: [
316
380
  CommandDirective,
317
- FocusBindingDirective
381
+ FocusBindingDirective,
382
+ HighlightPipe,
383
+ HighlightTextModelDirective
318
384
  ]
319
385
  },] }
320
386
  ];
@@ -821,7 +887,11 @@ __decorate([
821
887
 
822
888
  var TrackBy;
823
889
  (function (TrackBy) {
824
- TrackBy.byIndex = (data, index) => index;
890
+ TrackBy.byIndex = (index, item) => index;
891
+ function trackByProperty(property) {
892
+ return (index, item) => item[property];
893
+ }
894
+ TrackBy.trackByProperty = trackByProperty;
825
895
  })(TrackBy || (TrackBy = {}));
826
896
 
827
897
  class CommandContainer extends GarbageCollector {
@@ -2007,7 +2077,7 @@ class DefaultCellRendererComponent {
2007
2077
  DefaultCellRendererComponent.decorators = [
2008
2078
  { type: Component, args: [{
2009
2079
  selector: 'aup-default-cell-renderer',
2010
- template: "{{value}}\n",
2080
+ template: "<span [innerHTML]=\"value| aupHighlight\"></span>\n",
2011
2081
  styles: [""]
2012
2082
  },] }
2013
2083
  ];
@@ -7269,12 +7339,7 @@ class AbstractPlaceNavigationComponent extends DisposableComponent {
7269
7339
  this.commandFactory = Command.createFactory((placeDefinition) => {
7270
7340
  this.placeOutlet.navigate(new Visit(placeDefinition));
7271
7341
  });
7272
- when(this.placeOutletModel).changes(outlet => {
7273
- // NOTE: this updates during a change cycle and causes our isActiveMethod to return 2 different
7274
- // values in the one change detection cycle. So instead we delay the update to a different
7275
- // tick.
7276
- setTimeout(() => this._activePlaceComponent.setDelegate(outlet ? outlet.activePlaceModel : null));
7277
- });
7342
+ when(this.placeOutletModel).changes(outlet => this.handlePlaceOutLetChanged(outlet), { initialValue: "triggerChange" });
7278
7343
  this.activePlaceDefinition = chain(this._activePlaceComponent).pluck('placeDefinition');
7279
7344
  this.menuItems = chain(this.placeDefinitions).map(d => {
7280
7345
  return {
@@ -7284,11 +7349,14 @@ class AbstractPlaceNavigationComponent extends DisposableComponent {
7284
7349
  }, {
7285
7350
  dependsOn: this.activePlaceDefinition
7286
7351
  });
7287
- const txo = new TransactionObserver({ verbose: true }).onEvent(e => console.log(e.name, e.payload));
7288
- txo.observe('this.placesModel', this.placesModel);
7289
- txo.observe('this.placeDefinitions', this.placeDefinitions);
7290
- txo.observe('this.activePlaceDefinition', this.activePlaceDefinition);
7291
- txo.observe('this.menuItems', this.menuItems);
7352
+ // const txo = new TransactionObserver({ verbose: true }).onEvent(e => console.log(e.name, e.payload));
7353
+ // txo.observe('this.placesModel', this.placesModel);
7354
+ // txo.observe('this.placeDefinitions', this.placeDefinitions);
7355
+ // txo.observe('this.activePlaceDefinition', this.activePlaceDefinition);
7356
+ // txo.observe('this.menuItems', this.menuItems);
7357
+ }
7358
+ handlePlaceOutLetChanged(outlet) {
7359
+ this._activePlaceComponent.setDelegate(outlet ? outlet.activePlaceModel : null);
7292
7360
  }
7293
7361
  getNavigationFace(placeDef) {
7294
7362
  const navItem = placeDef.getPlaceData('nav');
@@ -7298,9 +7366,6 @@ class AbstractPlaceNavigationComponent extends DisposableComponent {
7298
7366
  icon: () => navItem && navItem.icon ? navItem.icon() : placeDef.getPlaceData('navIcon', null)
7299
7367
  };
7300
7368
  }
7301
- isActive(place) {
7302
- return;
7303
- }
7304
7369
  ngOnInit() {
7305
7370
  }
7306
7371
  }
@@ -7964,6 +8029,78 @@ function VisitParameterList(options) {
7964
8029
  };
7965
8030
  }
7966
8031
 
8032
+ /**
8033
+ * @file Automatically generated by barrelsby.
8034
+ */
8035
+
8036
+ // TODO: Merge various wake detection events into this class. visibility, wake events, websocket connection, online detection.
8037
+ // Taken from: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
8038
+ class VisibilityService extends GarbageCollector {
8039
+ // private _wakeEvents = new MutableStream<Instant>();
8040
+ // private _throttledWakeEvents: Stream<Instant>;
8041
+ constructor(document) {
8042
+ super();
8043
+ this._visibleModel = new MutableValueModel();
8044
+ this.document = document; // see https://stackoverflow.com/a/53715642
8045
+ const { chain } = Dsl.disposeWith(this);
8046
+ // Set the name of the hidden property and the change event for visibility
8047
+ if (typeof this.document.hidden !== 'undefined') { // Opera 12.10 and Firefox 18 and later support
8048
+ this.attributeName = 'hidden';
8049
+ this.eventName = 'visibilitychange';
8050
+ }
8051
+ else if (typeof this.document['msHidden'] !== 'undefined') {
8052
+ this.attributeName = 'msHidden';
8053
+ this.eventName = 'msvisibilitychange';
8054
+ }
8055
+ else if (typeof this.document['webkitHidden'] !== 'undefined') {
8056
+ this.attributeName = 'webkitHidden';
8057
+ this.eventName = 'webkitvisibilitychange';
8058
+ }
8059
+ // Warn if the browser doesn't support addEventListener or the Page Visibility API
8060
+ if (typeof this.document.addEventListener === 'undefined' || typeof document[this.attributeName] === 'undefined') {
8061
+ console.log('This demo requires a browser, such as Google Chrome or Firefox, that supports the Page Visibility API.');
8062
+ }
8063
+ else {
8064
+ // Handle page visibility change
8065
+ const handler = () => this.updateVisibilityState();
8066
+ this.document.addEventListener(this.eventName, handler, false);
8067
+ this.onDispose(() => {
8068
+ this.document.removeEventListener(this.eventName, handler);
8069
+ });
8070
+ }
8071
+ wakeEvent(() => this.updateVisibilityState());
8072
+ this._visibleModel.value = this.isVisible();
8073
+ // give the network a chance to come back or we end up with a bunch of failed requests.
8074
+ // should probably also implement a connection service so that we can go
8075
+ // connectionServer.ensureConnectedThen(fireWakeEvent);
8076
+ // this._throttledWakeEvents = chain(this._wakeEvents).throttle(300);
8077
+ }
8078
+ // get wakeEvents(): Stream<Instant> {
8079
+ // return this._throttledWakeEvents;
8080
+ // }
8081
+ // @trace
8082
+ updateVisibilityState() {
8083
+ this._visibleModel.value = this.isVisible();
8084
+ // this._wakeEvents.publish(Instant.now());
8085
+ }
8086
+ get visibleModel() {
8087
+ return this._visibleModel.readonly;
8088
+ }
8089
+ isHidden() {
8090
+ return !!this.document[this.attributeName];
8091
+ }
8092
+ isVisible() {
8093
+ return !this.isHidden();
8094
+ }
8095
+ }
8096
+ VisibilityService.ɵprov = ɵɵdefineInjectable({ factory: function VisibilityService_Factory() { return new VisibilityService(ɵɵinject(DOCUMENT)); }, token: VisibilityService, providedIn: "root" });
8097
+ VisibilityService.decorators = [
8098
+ { type: Injectable, args: [{ providedIn: 'root' },] }
8099
+ ];
8100
+ VisibilityService.ctorParameters = () => [
8101
+ { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
8102
+ ];
8103
+
7967
8104
  /**
7968
8105
  * @file Automatically generated by barrelsby.
7969
8106
  */
@@ -7972,5 +8109,5 @@ function VisitParameterList(options) {
7972
8109
  * Generated bundle index. Do not edit.
7973
8110
  */
7974
8111
 
7975
- export { ACTIVITY_DATA, AUP_PLACE_CONFIG, AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT, AbstractInputActivity, AbstractInputComponent, AbstractInteractionContext, AbstractListInputComponent, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, AbstractPopupMenuComponent, AbstractTableModel, AbstractValueInputComponent, Activity, ActivityActionsComponent, ActivityBodyComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, ActivityTitleComponent, AddItemInteractionContextComponent, AlertDialogComponent, AngularUiPowerupsModule, AutocompleteInputComponent, Bounds, BusyOverlayComponent, CELL_EDITOR_PORTAL, CELL_RENDERER_PORTAL, CardContainerComponent, CellEditorPortalRef, CellHeaderPortalRef, CellPortalRef, CellRendererPortalRef, CheckboxInputComponent, ColumnModel, ColumnTemplateDirective, CommandComponent, CommandContainer, CommandDirective, CommandFace, CommandFaceComponent, ComponentCellRendererPortalRef, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DecoratedTreeNode, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EventCleanUpSession, FlattenStrategy, FlexComponent, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, HEADER_CELL_RENDERER_PORTAL, IconComponent, InPlaceInteractionContextComponent, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, LEFT_RIGHT_PLACE_ANIMATION, ListPlaceNavComponent, ListPropertyColumnModel, ModalInteractionContextFactory, MoreMenuComponent, MultipleSelectInputComponent, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NotAuthorisedNoticeComponent, NumberInputComponent, POPUP_CONTAINER, PORTAL_EDITOR_COMPONENT, PORTAL_RENDERER_COMPONENT, PaginatorComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceAccessGuard, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupAwareComponent, PopupInteractionContextComponent, PopupMenuComponent, PopupMenuRendererComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SectionHeaderComponent, SelectCellRendererComponent, SelectHeaderCellRendererComponent, SelectInputActivity, SelectInputComponent, SelectionColumnModel, SelfAndDescendantsVisitor, SeparatorComponent, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableCellRendererComponent, TableComponent, TableHeaderCellRendererComponent, TableModel, TableRowMenuComponent, TemplateCellRendererPortalRef, TextInputComponent, ToolBarComponent, TrackBy, TreeExpansionModel, TreeInheritanceIconComponent, TreeLabelCellRendererComponent, TreeLabelColumnModel, TreeTableComponent, TreeTableModel, TreeToListModel, UrlService, UrlSnapshot, VerticalFocusContainerComponent, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationTypeDetermined, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, ɵ0 };
8112
+ export { ACTIVITY_DATA, AUP_PLACE_CONFIG, AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT, AbstractInputActivity, AbstractInputComponent, AbstractInteractionContext, AbstractListInputComponent, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, AbstractPopupMenuComponent, AbstractTableModel, AbstractValueInputComponent, Activity, ActivityActionsComponent, ActivityBodyComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, ActivityTitleComponent, AddItemInteractionContextComponent, AlertDialogComponent, AngularUiPowerupsModule, AutocompleteInputComponent, Bounds, BusyOverlayComponent, CELL_EDITOR_PORTAL, CELL_RENDERER_PORTAL, CardContainerComponent, CellEditorPortalRef, CellHeaderPortalRef, CellPortalRef, CellRendererPortalRef, CheckboxInputComponent, ColumnModel, ColumnTemplateDirective, CommandComponent, CommandContainer, CommandDirective, CommandFace, CommandFaceComponent, ComponentCellRendererPortalRef, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DecoratedTreeNode, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EventCleanUpSession, FlattenStrategy, FlexComponent, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, HEADER_CELL_RENDERER_PORTAL, HighlightPipe, HighlightTextModelDirective, IconComponent, InPlaceInteractionContextComponent, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, LEFT_RIGHT_PLACE_ANIMATION, ListPlaceNavComponent, ListPropertyColumnModel, ModalInteractionContextFactory, MoreMenuComponent, MultipleSelectInputComponent, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NotAuthorisedNoticeComponent, NumberInputComponent, POPUP_CONTAINER, PORTAL_EDITOR_COMPONENT, PORTAL_RENDERER_COMPONENT, PaginatorComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceAccessGuard, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupAwareComponent, PopupInteractionContextComponent, PopupMenuComponent, PopupMenuRendererComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SectionHeaderComponent, SelectCellRendererComponent, SelectHeaderCellRendererComponent, SelectInputActivity, SelectInputComponent, SelectionColumnModel, SelfAndDescendantsVisitor, SeparatorComponent, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableCellRendererComponent, TableComponent, TableHeaderCellRendererComponent, TableModel, TableRowMenuComponent, TemplateCellRendererPortalRef, TextInputComponent, ToolBarComponent, TrackBy, TreeExpansionModel, TreeInheritanceIconComponent, TreeLabelCellRendererComponent, TreeLabelColumnModel, TreeTableComponent, TreeTableModel, TreeToListModel, UrlService, UrlSnapshot, VerticalFocusContainerComponent, VisibilityService, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationTypeDetermined, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, ɵ0 };
7976
8113
  //# sourceMappingURL=coolon-angular-ui-powerups.js.map