@coolon/angular-ui-powerups 1.3.5 → 1.3.7

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 (72) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/bundles/coolon-angular-ui-powerups.umd.js +123 -180
  3. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  5. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  6. package/coolon-angular-ui-powerups.d.ts +13 -13
  7. package/coolon-angular-ui-powerups.metadata.json +1 -1
  8. package/esm2015/coolon-angular-ui-powerups.js +13 -13
  9. package/esm2015/coolon-angular-ui-powerups.js.map +1 -1
  10. package/esm2015/coolon-angular-ui-powerups.metadata.json +1 -1
  11. package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
  12. package/esm2015/lib/components/focusable.component.js +1 -1
  13. package/esm2015/lib/components/focusable.component.js.map +1 -1
  14. package/esm2015/lib/components/forms/abstract-input.component.js.map +1 -1
  15. package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.js +1 -1
  16. package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.js.map +1 -1
  17. package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.metadata.json +1 -1
  18. package/esm2015/lib/components/forms/number-input/number-input.component.js +1 -1
  19. package/esm2015/lib/components/forms/number-input/number-input.component.js.map +1 -1
  20. package/esm2015/lib/components/forms/number-input/number-input.component.metadata.json +1 -1
  21. package/esm2015/lib/components/forms/password-input/password-input.component.js +1 -1
  22. package/esm2015/lib/components/forms/password-input/password-input.component.js.map +1 -1
  23. package/esm2015/lib/components/forms/password-input/password-input.component.metadata.json +1 -1
  24. package/esm2015/lib/components/forms/select-input/select-input.component.js +1 -1
  25. package/esm2015/lib/components/forms/select-input/select-input.component.js.map +1 -1
  26. package/esm2015/lib/components/forms/select-input/select-input.component.metadata.json +1 -1
  27. package/esm2015/lib/components/forms/string-input/string-input.component.js +1 -1
  28. package/esm2015/lib/components/forms/string-input/string-input.component.js.map +1 -1
  29. package/esm2015/lib/components/forms/string-input/string-input.component.metadata.json +1 -1
  30. package/esm2015/lib/directives/focus-binding-factory.js +2 -1
  31. package/esm2015/lib/directives/focus-binding-factory.js.map +1 -1
  32. package/esm2015/lib/directives/focus-binding.directive.js +11 -62
  33. package/esm2015/lib/directives/focus-binding.directive.js.map +1 -1
  34. package/esm2015/lib/directives/focus-binding.directive.metadata.json +1 -1
  35. package/esm2015/lib/directives/focus-binding.js +1 -0
  36. package/esm2015/lib/directives/focus-binding.js.map +1 -1
  37. package/esm2015/lib/directives/focus-binding.metadata.json +1 -1
  38. package/esm2015/lib/place/route/visit-sanitiser.js +2 -9
  39. package/esm2015/lib/place/route/visit-sanitiser.js.map +1 -1
  40. package/esm2015/lib/place/route/visit-sanitiser.metadata.json +1 -1
  41. package/esm5/coolon-angular-ui-powerups.js +13 -13
  42. package/esm5/coolon-angular-ui-powerups.js.map +1 -1
  43. package/esm5/lib/components/components.module.ngfactory.js.map +1 -1
  44. package/esm5/lib/components/focusable.component.js +1 -1
  45. package/esm5/lib/components/focusable.component.js.map +1 -1
  46. package/esm5/lib/components/forms/abstract-input.component.js.map +1 -1
  47. package/esm5/lib/components/forms/checkbox-input/checkbox-input.component.js +1 -1
  48. package/esm5/lib/components/forms/checkbox-input/checkbox-input.component.js.map +1 -1
  49. package/esm5/lib/components/forms/number-input/number-input.component.js +1 -1
  50. package/esm5/lib/components/forms/number-input/number-input.component.js.map +1 -1
  51. package/esm5/lib/components/forms/password-input/password-input.component.js +1 -1
  52. package/esm5/lib/components/forms/password-input/password-input.component.js.map +1 -1
  53. package/esm5/lib/components/forms/select-input/select-input.component.js +1 -1
  54. package/esm5/lib/components/forms/select-input/select-input.component.js.map +1 -1
  55. package/esm5/lib/components/forms/string-input/string-input.component.js +1 -1
  56. package/esm5/lib/components/forms/string-input/string-input.component.js.map +1 -1
  57. package/esm5/lib/directives/focus-binding-factory.js +2 -1
  58. package/esm5/lib/directives/focus-binding-factory.js.map +1 -1
  59. package/esm5/lib/directives/focus-binding.directive.js +11 -65
  60. package/esm5/lib/directives/focus-binding.directive.js.map +1 -1
  61. package/esm5/lib/directives/focus-binding.js +1 -0
  62. package/esm5/lib/directives/focus-binding.js.map +1 -1
  63. package/esm5/lib/place/route/visit-sanitiser.js +2 -9
  64. package/esm5/lib/place/route/visit-sanitiser.js.map +1 -1
  65. package/fesm2015/coolon-angular-ui-powerups.js +93 -147
  66. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  67. package/fesm5/coolon-angular-ui-powerups.js +109 -166
  68. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  69. package/lib/components/forms/abstract-input.component.d.ts +1 -1
  70. package/lib/directives/focus-binding-factory.d.ts +2 -2
  71. package/lib/directives/focus-binding.directive.d.ts +6 -11
  72. package/package.json +13 -5
@@ -1 +1 @@
1
- {"version":3,"file":"focus-binding.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/directives/focus-binding.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAc,MAAM,EAAc,MAAM,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7E;IAAkC,gCAAgB;IAIhD,sBAA6B,kBAA+B,EACf,MAAc,EAC7B,QAAa,EACtB,YAAkC;QAHvD,YAIE,iBAAO,SAWR;QAf4B,wBAAkB,GAAlB,kBAAkB,CAAa;QACf,YAAM,GAAN,MAAM,CAAQ;QAEtC,kBAAY,GAAZ,YAAY,CAAsB;QAErD,kHAAkH;QAClH,KAAI,CAAC,QAAQ,GAAG,QAAoB,CAAC;QAErC,iEAAiE;QACzD,IAAA,kCAAI,CAA2B;QACvC,IAAI,CAAC,OAAO,CAAC,K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qBAAM;oBACL,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,wEAAwE,CAAC,CAAC;iBACjG;aACF;SACF;IACH,CAAC;IAED,sBAAI,qCAAW;aAAf;YACE,OAAO,IAAI,CAAC,kBAAkB,CAAC;QACjC,CAAC;;;OAAA;IAED,yCAAyC;IACzC,gDAAyB,GAAzB;QACE,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC;IACzC,CAAC;IAED,yCAAyC;IACzC,+BAAQ,GAAR;QACE,IAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,qBAAqB,EAAE,CAAC;QAC3D,IAAM,OAAO,GAAG,SAAS,CAAC,MAAM,IAAI,CAAC,IAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAC;QAC/D,6CAA6C;QAC7C,OAAO,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAClD,CAAC;IA3EU,YAAY;QAKV,WAAA,MAAM,CAAC,MAAM,CAAC,CAAA;QACd,WAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;yCAFoB,WAAW;YACP,MAAM;OALhD,YAAY,CA4ExB;IAAD,mBAAC;CAAA,AA5ED,CAAkC,gBAAgB,GA4EjD;SA5EY,YAAY","sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { ElementRef, Inject, Injectable, NgZone } from '@angular/core';\nimport { Dsl, FocusManager, GarbageCollector, Logger } from '@coolon/pectin';\n\nexport class FocusBinding extends GarbageCollector {\n\n private readonly document: Document;\n\n constructor(private readonly focusTargetElement: HTMLElement,\n @Inject(NgZone) private readonly ngZone: NgZone,\n @Inject(DOCUMENT) document: any,\n readonly focusContext: FocusManager.Context) {\n super();\n // @see https://stackoverflow.com/questions/49513359/could-not-resolve-type-document-in-angular5/53715642#53715642\n this.document = document as Document;\n\n // TODO: Make this also track the current enabled/disabled state.\n const { when } = Dsl.disposeWith(this);\n when.valueOf(this.focusContext.focused).changes((focused) => {\n if (focused && !this.alreadyHasFocus()) {\n this.tryAndFocus();\n }\n }, { initialValue: 'triggerChangeUnlessNil' });\n }\n\n onFocusIn() {\n this.focusContext.notifyFocusIn();\n }\n\n onFocusOut() {\n this.focusContext.notifyFocusOut();\n }\n\n // Hook method for debugging via tracing.\n alreadyHasFocus() {\n return this.isElementFocused(this.focusTarget);\n }\n\n // Hook method for debugging via tracing.\n isElementFocused(element: Element): boolean {\n return this.document.activeElement === element;\n }\n\n tryAndFocus(retries: number = 5) {\n if (this.modelShouldStillHaveFocus() && this.canFocus()) {\n if (!this.alreadyHasFocus()) {\n this.focusTarget.focus();\n }\n // if we didn't get the focus we try again later.\n if (!this.alreadyHasFocus()) {\n Logger.get(this).log(`focus failed, trying ${retries} more times`);\n if (retries > 0) {\n // try again on the next paint\n // TODO: is there an angular way of doing this without calling a window function.\n requestAnimationFrame(() => {\n this.tryAndFocus(retries - 1);\n });\n } else {\n Logger.get(this).warn(`Tried to focus but gave up as the component wasn't enabled or visible.`);\n }\n }\n }\n }\n\n get focusTarget(): HTMLElement {\n return this.focusTargetElement;\n }\n\n // Hook method for debugging via tracing.\n modelShouldStillHaveFocus() {\n return this.focusContext.focused.value;\n }\n\n // Hook method for debugging via tracing.\n canFocus(): boolean {\n const dimension = this.focusTarget.getBoundingClientRect();\n const hasSize = dimension.height >= 0 && dimension.height >= 0;\n // tslint:disable-next-line:no-string-literal\n return hasSize && !this.focusTarget['disabled'];\n }\n}\n"]}
1
+ {"version":3,"file":"focus-binding.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/directives/focus-binding.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7E;IAAk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Manager, GarbageCollector, Logger } from '@coolon/pectin';\n\nexport class FocusBinding extends GarbageCollector {\n\n private readonly document: Document;\n\n // TODO: update to support alternate focus mechanisms so we can interoperate with mat-checkbox\n constructor(private readonly focusTargetElement: HTMLElement,\n @Inject(NgZone) private readonly ngZone: NgZone,\n @Inject(DOCUMENT) document: any,\n readonly focusContext: FocusManager.Context) {\n super();\n // @see https://stackoverflow.com/questions/49513359/could-not-resolve-type-document-in-angular5/53715642#53715642\n this.document = document as Document;\n\n // TODO: Make this also track the current enabled/disabled state.\n const { when } = Dsl.disposeWith(this);\n when.valueOf(this.focusContext.focused).changes((focused) => {\n if (focused && !this.alreadyHasFocus()) {\n this.tryAndFocus();\n }\n }, { initialValue: 'triggerChangeUnlessNil' });\n }\n\n onFocusIn() {\n this.focusContext.notifyFocusIn();\n }\n\n onFocusOut() {\n this.focusContext.notifyFocusOut();\n }\n\n // Hook method for debugging via tracing.\n alreadyHasFocus() {\n return this.isElementFocused(this.focusTarget);\n }\n\n // Hook method for debugging via tracing.\n isElementFocused(element: Element): boolean {\n return this.document.activeElement === element;\n }\n\n tryAndFocus(retries: number = 5) {\n if (this.modelShouldStillHaveFocus() && this.canFocus()) {\n if (!this.alreadyHasFocus()) {\n this.focusTarget.focus();\n }\n // if we didn't get the focus we try again later.\n if (!this.alreadyHasFocus()) {\n Logger.get(this).log(`focus failed, trying ${retries} more times`);\n if (retries > 0) {\n // try again on the next paint\n // TODO: is there an angular way of doing this without calling a window function.\n requestAnimationFrame(() => {\n this.tryAndFocus(retries - 1);\n });\n } else {\n Logger.get(this).warn(`Tried to focus but gave up as the component wasn't enabled or visible.`);\n }\n }\n }\n }\n\n get focusTarget(): HTMLElement {\n return this.focusTargetElement;\n }\n\n // Hook method for debugging via tracing.\n modelShouldStillHaveFocus() {\n return this.focusContext.focused.value;\n }\n\n // Hook method for debugging via tracing.\n canFocus(): boolean {\n const dimension = this.focusTarget.getBoundingClientRect();\n const hasSize = dimension.height >= 0 && dimension.height >= 0;\n // tslint:disable-next-line:no-string-literal\n return hasSize && !this.focusTarget['disabled'];\n }\n}\n"]}
@@ -1,6 +1,4 @@
1
- import { __awaiter, __decorate, __generator, __metadata } from "tslib";
2
- import { Trace } from '@coolon/pectin';
3
- import { Visit } from '../visit';
1
+ import { __awaiter, __generator } from "tslib";
4
2
  var VisitSanitiser = /** @class */ (function () {
5
3
  function VisitSanitiser(navigationSession, activatedRoute, router, placeHistory, injector) {
6
4
  this.navigationSession = navigationSession;
@@ -9,6 +7,7 @@ var VisitSanitiser = /** @class */ (function () {
9
7
  this.placeHistory = placeHistory;
10
8
  this.injector = injector;
11
9
  }
10
+ // @Trace()
12
11
  VisitSanitiser.prototype.sanitise = function (visit) {
13
12
  return __awaiter(this, void 0, void 0, function () {
14
13
  var placeDef, routeIdDef, routeId, sanitisedValue, parameterDefs, sanitisedVisit, i, def, value, sanitisedValue;
@@ -57,12 +56,6 @@ var VisitSanitiser = /** @class */ (function () {
57
56
  });
58
57
  });
59
58
  };
60
- __decorate([
61
- Trace(),
62
- __metadata("design:type", Function),
63
- __metadata("design:paramtypes", [Visit]),
64
- __metadata("design:returntype", Promise)
65
- ], VisitSanitiser.prototype, "sanitise", null);
66
59
  return VisitSanitiser;
67
60
  }());
68
61
  export { VisitSanitiser };
@@ -1 +1 @@
1
- {"version":3,"file":"visit-sanitiser.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/route/visit-sanitiser.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGvC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC;IACE,wBAAoB,iBAAoC,EAAU,cAAsC,EAAU,MAAc,EAAU,YAA0B,EAAU,QAAkB;QAA5K,sBAAiB,GAAjB,iBAAiB,CAAmB;QAAU,mBAAc,GAAd,cAAc,CAAwB;QAAU,WAAM,GAAN,MAAM,CAAQ;QAAU,iBAAY,GAAZ,YAAY,CAAc;QAAU,aA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AU,CAAC,EAAA;;wBAA/H,cAAc,GAAG,SAA8G;wBACrI,IAAI,GAAG,CAAC,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,EAAE;4BACzC,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;yBAC9D;;;wBANuC,CAAC,EAAE,CAAA;;4BAS7C,sBAAO,cAAc,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,EAAC;;;;KACtE;IA/BD;QADC,KAAK,EAAE;;yCACc,KAAK;;kDA+B1B;IAEH,qBAAC;CAAA,AAvCD,IAuCC;SAvCY,cAAc","sourcesContent":["import { Injector } from '@angular/core';\nimport { ActivatedRouteSnapshot, Router } from '@angular/router';\nimport { Trace } from '@coolon/pectin';\nimport { NavigationSession } from '../navigation/session/navigation-session';\nimport { PlaceHistory } from '../place-history';\nimport { Visit } from '../visit';\n\nexport class VisitSanitiser {\n constructor(private navigationSession: NavigationSession, private activatedRoute: ActivatedRouteSnapshot, private router: Router, private placeHistory: PlaceHistory, private injector: Injector) {\n\n }\n\n @Trace()\n async sanitise(visit: Visit): Promise<Visit> {\n const placeDef = visit.placeDefinition;\n if (placeDef.hasRouteId()) {\n const routeIdDef = placeDef.getRouteIdParameterDef();\n const routeId = visit.getRouteId();\n const sanitisedValue = await routeIdDef.sanitise(routeId, visit, this.placeHistory, this.injector, this.navigationSession.isPopState);\n console.log({routeId, sanitisedValue});\n // ###------- EARLY EXIT --------###\n if (routeIdDef.hasChanged(routeId, sanitisedValue)) {\n // if the route id has changed we redirect immediately as other\n // parameter sanitisers might use it.\n return visit.replace(routeIdDef, sanitisedValue);\n }\n }\n\n // if we didn't replace the routeId we continue the url present parameters.\n const parameterDefs = placeDef.getVisitParameterDefs({\n includeRouteParameters: true,\n includeNonRouteParameters: true\n });\n let sanitisedVisit: Visit = visit;\n for (let i = 0; i < parameterDefs.length; i++) {\n const def = parameterDefs[i];\n const value = visit.getParameter(def.name);\n const sanitisedValue = await def.sanitise(value, sanitisedVisit, this.placeHistory, this.injector, this.navigationSession.isPopState);\n if (def.hasChanged(value, sanitisedValue)) {\n sanitisedVisit = sanitisedVisit.replace(def, sanitisedValue);\n }\n }\n\n return sanitisedVisit.hasChangedFrom(visit) ? sanitisedVisit : visit;\n }\n\n}\n"]}
1
+ {"version":3,"file":"visit-sanitiser.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/route/visit-sanitiser.ts"],"names":[],"mappings":";AAOA;IACE,wBAAoB,iBAAoC,EAAU,cAAsC,EAAU,MAAc,EAAU,YAA0B,EAAU,QAAkB;QAA5K,sBAAiB,GAAjB,iBAAiB,CAAmB;QAAU,mBAAc,GAAd,cAAc,CAAwB;QAAU,WAAM,GAAN,MAAM,CAAQ;QAAU,iBAAY,GAAZ,YAAY,CAAc;QAAU,aAAQ,GAAR,QAAQ,CAAU;IAEhM,CAAC;IAED,WAAW;IACL,iCAAQ,GAAd,UAAe,KAAY;;;;;;wBACnB,QAAQ,GAAG,KAAK,CAAC,eAAe,CAAC;6BACnC,QAAQ,CAAC,UAAU,EAAE,EAArB,wBAAqB;wBACjB,UAAU,GAAG,QAAQ,CAAC,sBAAsB,EAAE,CAAC;wBAC/C,OAAO,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC;wBACZ,qBAAM,UAAU,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,EAAA;;wBAA/H,cAAc,GAAG,SAA8G;wBACrI,OAAO,CAAC,GAAG,CAAC,EAAC,OAAO,SAAA,EAAE,cAAc,gBAAA,EAAC,CAAC,CAAC;wBACvC,oCAAoC;wBACpC,IAAI,UAAU,CAAC,UAAU,CAAC,OAAO,EAAE,cAAc,CAAC,EAAE;4BAClD,+DAA+D;4BAC/D,qCAAqC;4BACrC,sBAAO,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC,EAAC;yBAClD;;;wBAIG,aAAa,GAAG,QAAQ,CAAC,qBAAqB,CAAC;4BACnD,sBAAsB,EAAE,IAAI;4BAC5B,yBAAyB,EAAE,IAAI;yBAChC,CAAC,CAAC;wBACC,cAAc,GAAU,KAAK,CAAC;wBACzB,CAAC,GAAG,CAAC;;;6BAAE,CAAA,CAAC,GAAG,aAAa,CAAC,MAAM,CAAA;wBAChC,GAAG,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;wBACvB,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;wBACpB,qBAAM,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,EAAA;;wBAA/H,cAAc,GAAG,SAA8G;wBACrI,IAAI,GAAG,CAAC,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,EAAE;4BACzC,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;yBAC9D;;;wBANuC,CAAC,EAAE,CAAA;;4BAS7C,sBAAO,cAAc,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,EAAC;;;;KACtE;IAEH,qBAAC;AAAD,CAAC,AAvCD,IAuCC","sourcesContent":["import { Injector } from '@angular/core';\nimport { ActivatedRouteSnapshot, Router } from '@angular/router';\nimport { Trace } from '@coolon/pectin';\nimport { NavigationSession } from '../navigation/session/navigation-session';\nimport { PlaceHistory } from '../place-history';\nimport { Visit } from '../visit';\n\nexport class VisitSanitiser {\n constructor(private navigationSession: NavigationSession, private activatedRoute: ActivatedRouteSnapshot, private router: Router, private placeHistory: PlaceHistory, private injector: Injector) {\n\n }\n\n // @Trace()\n async sanitise(visit: Visit): Promise<Visit> {\n const placeDef = visit.placeDefinition;\n if (placeDef.hasRouteId()) {\n const routeIdDef = placeDef.getRouteIdParameterDef();\n const routeId = visit.getRouteId();\n const sanitisedValue = await routeIdDef.sanitise(routeId, visit, this.placeHistory, this.injector, this.navigationSession.isPopState);\n console.log({routeId, sanitisedValue});\n // ###------- EARLY EXIT --------###\n if (routeIdDef.hasChanged(routeId, sanitisedValue)) {\n // if the route id has changed we redirect immediately as other\n // parameter sanitisers might use it.\n return visit.replace(routeIdDef, sanitisedValue);\n }\n }\n\n // if we didn't replace the routeId we continue the url present parameters.\n const parameterDefs = placeDef.getVisitParameterDefs({\n includeRouteParameters: true,\n includeNonRouteParameters: true\n });\n let sanitisedVisit: Visit = visit;\n for (let i = 0; i < parameterDefs.length; i++) {\n const def = parameterDefs[i];\n const value = visit.getParameter(def.name);\n const sanitisedValue = await def.sanitise(value, sanitisedVisit, this.placeHistory, this.injector, this.navigationSession.isPopState);\n if (def.hasChanged(value, sanitisedValue)) {\n sanitisedVisit = sanitisedVisit.replace(def, sanitisedValue);\n }\n }\n\n return sanitisedVisit.hasChangedFrom(visit) ? sanitisedVisit : visit;\n }\n\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __metadata, __param, __awaiter } from 'tslib';
2
2
  import { DOCUMENT, CommonModule, Location } from '@angular/common';
3
- import { ElementRef, Inject, Input, HostListener, Directive, NgZone, NgModule, ɵɵdefineInjectable, ɵɵinject, Injectable, Host, HostBinding, Component, EventEmitter, Output, ContentChild, TemplateRef, ChangeDetectorRef, ContentChildren, QueryList, InjectionToken, Injector, ComponentFactoryResolver, ViewContainerRef, ViewChild, ViewChildren, Optional, SkipSelf } from '@angular/core';
3
+ import { ElementRef, Inject, Input, HostListener, Directive, NgZone, ɵɵdefineInjectable, ɵɵinject, Injectable, NgModule, Host, HostBinding, Component, EventEmitter, Output, ContentChild, TemplateRef, ChangeDetectorRef, ContentChildren, QueryList, InjectionToken, Injector, ComponentFactoryResolver, ViewContainerRef, ViewChild, ViewChildren, Optional, SkipSelf } from '@angular/core';
4
4
  import { FormsModule } from '@angular/forms';
5
5
  import { MatFormFieldModule } from '@angular/material/form-field';
6
6
  import { MatInputModule } from '@angular/material/input';
@@ -135,49 +135,35 @@ DisposableComponent = __decorate([
135
135
  Directive()
136
136
  ], DisposableComponent);
137
137
 
138
- let FocusBindingDirective = class FocusBindingDirective extends DisposableComponent {
139
- constructor(el, ngZone, document) {
138
+ let FocusBinding = class FocusBinding extends GarbageCollector {
139
+ // TODO: update to support alternate focus mechanisms so we can interoperate with mat-checkbox
140
+ constructor(focusTargetElement, ngZone, document, focusContext) {
140
141
  super();
141
- this.el = el;
142
+ this.focusTargetElement = focusTargetElement;
142
143
  this.ngZone = ngZone;
144
+ this.focusContext = focusContext;
143
145
  // @see https://stackoverflow.com/questions/49513359/could-not-resolve-type-document-in-angular5/53715642#53715642
144
146
  this.document = document;
147
+ // TODO: Make this also track the current enabled/disabled state.
148
+ const { when } = Dsl.disposeWith(this);
149
+ when.valueOf(this.focusContext.focused).changes((focused) => {
150
+ if (focused && !this.alreadyHasFocus()) {
151
+ this.tryAndFocus();
152
+ }
153
+ }, { initialValue: 'triggerChangeUnlessNil' });
145
154
  }
146
155
  onFocusIn() {
147
- if (this.hasBinding()) {
148
- this.pectinFocusBinding.focusContext.notifyFocusIn();
149
- }
156
+ this.focusContext.notifyFocusIn();
150
157
  }
151
158
  onFocusOut() {
152
- if (this.hasBinding()) {
153
- this.pectinFocusBinding.focusContext.notifyFocusOut();
154
- }
155
- }
156
- ngOnInit() {
157
- }
158
- ngAfterViewInit() {
159
- // TODO: Make this also track the current enabled/disabled state.
160
- if (this.hasBinding()) {
161
- const { when } = Dsl.disposeWith(this);
162
- when.valueOf(this.pectinFocusBinding.focusContext.focused).changes((focused) => {
163
- if (focused && !this.alreadyHasFocus()) {
164
- this.tryAndFocus();
165
- }
166
- }, { initialValue: 'triggerChange' });
167
- }
168
- else {
169
- Logger.get(this).warn('pectinFocusBinding was nil');
170
- }
171
- }
172
- hasBinding() {
173
- return !!this.pectinFocusBinding && !!this.pectinFocusBinding.focusContext;
159
+ this.focusContext.notifyFocusOut();
174
160
  }
175
161
  // Hook method for debugging via tracing.
176
162
  alreadyHasFocus() {
177
- return this.isFocused(this.focusTarget);
163
+ return this.isElementFocused(this.focusTarget);
178
164
  }
179
165
  // Hook method for debugging via tracing.
180
- isFocused(element) {
166
+ isElementFocused(element) {
181
167
  return this.document.activeElement === element;
182
168
  }
183
169
  tryAndFocus(retries = 5) {
@@ -202,11 +188,11 @@ let FocusBindingDirective = class FocusBindingDirective extends DisposableCompon
202
188
  }
203
189
  }
204
190
  get focusTarget() {
205
- return this.focusBindingTarget || this.el.nativeElement;
191
+ return this.focusTargetElement;
206
192
  }
207
193
  // Hook method for debugging via tracing.
208
194
  modelShouldStillHaveFocus() {
209
- return this.hasBinding() && this.pectinFocusBinding.focusContext.focused.value;
195
+ return this.focusContext.focused.value;
210
196
  }
211
197
  // Hook method for debugging via tracing.
212
198
  canFocus() {
@@ -216,11 +202,74 @@ let FocusBindingDirective = class FocusBindingDirective extends DisposableCompon
216
202
  return hasSize && !this.focusTarget['disabled'];
217
203
  }
218
204
  };
219
- FocusBindingDirective.ctorParameters = () => [
220
- { type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
205
+ FocusBinding = __decorate([
206
+ __param(1, Inject(NgZone)),
207
+ __param(2, Inject(DOCUMENT)),
208
+ __metadata("design:paramtypes", [HTMLElement,
209
+ NgZone, Object, Object])
210
+ ], FocusBinding);
211
+
212
+ let FocusBindingFactory = class FocusBindingFactory {
213
+ constructor(ngZone, document) {
214
+ this.ngZone = ngZone;
215
+ // @see https://stackoverflow.com/questions/49513359/could-not-resolve-type-document-in-angular5/53715642#53715642
216
+ this.document = document;
217
+ }
218
+ // @Trace()
219
+ createBinding(el, focusContext) {
220
+ return new FocusBinding(el, this.ngZone, this.document, focusContext);
221
+ }
222
+ };
223
+ FocusBindingFactory.ctorParameters = () => [
221
224
  { type: NgZone, decorators: [{ type: Inject, args: [NgZone,] }] },
222
225
  { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
223
226
  ];
227
+ FocusBindingFactory.ɵprov = ɵɵdefineInjectable({ factory: function FocusBindingFactory_Factory() { return new FocusBindingFactory(ɵɵinject(NgZone), ɵɵinject(DOCUMENT)); }, token: FocusBindingFactory, providedIn: "root" });
228
+ FocusBindingFactory = __decorate([
229
+ Injectable({
230
+ providedIn: 'root'
231
+ }),
232
+ __param(0, Inject(NgZone)), __param(1, Inject(DOCUMENT)),
233
+ __metadata("design:paramtypes", [NgZone, Object])
234
+ ], FocusBindingFactory);
235
+
236
+ let FocusBindingDirective = class FocusBindingDirective extends DisposableComponent {
237
+ constructor(el, focusBindingFactory) {
238
+ super();
239
+ this.el = el;
240
+ this.focusBindingFactory = focusBindingFactory;
241
+ }
242
+ onFocusIn() {
243
+ if (this.hasBinding()) {
244
+ this.pectinFocusBinding.notifyFocusIn();
245
+ }
246
+ }
247
+ onFocusOut() {
248
+ if (this.hasBinding()) {
249
+ this.pectinFocusBinding.notifyFocusOut();
250
+ }
251
+ }
252
+ ngOnInit() {
253
+ }
254
+ ngAfterViewInit() {
255
+ if (this.hasBinding()) {
256
+ this.registerDisposable(this.focusBindingFactory.createBinding(this.focusTarget, this.pectinFocusBinding));
257
+ }
258
+ else {
259
+ Logger.get(this).warn('pectinFocusBinding was nil');
260
+ }
261
+ }
262
+ hasBinding() {
263
+ return !!this.pectinFocusBinding && !!this.pectinFocusBinding;
264
+ }
265
+ get focusTarget() {
266
+ return this.focusBindingTarget || this.el.nativeElement;
267
+ }
268
+ };
269
+ FocusBindingDirective.ctorParameters = () => [
270
+ { type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
271
+ { type: FocusBindingFactory }
272
+ ];
224
273
  __decorate([
225
274
  Input(),
226
275
  __metadata("design:type", Object)
@@ -247,10 +296,8 @@ FocusBindingDirective = __decorate([
247
296
  selector: '[pectinFocusBinding]'
248
297
  }),
249
298
  __param(0, Inject(ElementRef)),
250
- __param(1, Inject(NgZone)),
251
- __param(2, Inject(DOCUMENT)),
252
299
  __metadata("design:paramtypes", [ElementRef,
253
- NgZone, Object])
300
+ FocusBindingFactory])
254
301
  ], FocusBindingDirective);
255
302
 
256
303
  let DirectivesModule = class DirectivesModule {
@@ -277,102 +324,6 @@ DirectivesModule = __decorate([
277
324
  })
278
325
  ], DirectivesModule);
279
326
 
280
- let FocusBinding = class FocusBinding extends GarbageCollector {
281
- constructor(focusTargetElement, ngZone, document, focusContext) {
282
- super();
283
- this.focusTargetElement = focusTargetElement;
284
- this.ngZone = ngZone;
285
- this.focusContext = focusContext;
286
- // @see https://stackoverflow.com/questions/49513359/could-not-resolve-type-document-in-angular5/53715642#53715642
287
- this.document = document;
288
- // TODO: Make this also track the current enabled/disabled state.
289
- const { when } = Dsl.disposeWith(this);
290
- when.valueOf(this.focusContext.focused).changes((focused) => {
291
- if (focused && !this.alreadyHasFocus()) {
292
- this.tryAndFocus();
293
- }
294
- }, { initialValue: 'triggerChangeUnlessNil' });
295
- }
296
- onFocusIn() {
297
- this.focusContext.notifyFocusIn();
298
- }
299
- onFocusOut() {
300
- this.focusContext.notifyFocusOut();
301
- }
302
- // Hook method for debugging via tracing.
303
- alreadyHasFocus() {
304
- return this.isElementFocused(this.focusTarget);
305
- }
306
- // Hook method for debugging via tracing.
307
- isElementFocused(element) {
308
- return this.document.activeElement === element;
309
- }
310
- tryAndFocus(retries = 5) {
311
- if (this.modelShouldStillHaveFocus() && this.canFocus()) {
312
- if (!this.alreadyHasFocus()) {
313
- this.focusTarget.focus();
314
- }
315
- // if we didn't get the focus we try again later.
316
- if (!this.alreadyHasFocus()) {
317
- Logger.get(this).log(`focus failed, trying ${retries} more times`);
318
- if (retries > 0) {
319
- // try again on the next paint
320
- // TODO: is there an angular way of doing this without calling a window function.
321
- requestAnimationFrame(() => {
322
- this.tryAndFocus(retries - 1);
323
- });
324
- }
325
- else {
326
- Logger.get(this).warn(`Tried to focus but gave up as the component wasn't enabled or visible.`);
327
- }
328
- }
329
- }
330
- }
331
- get focusTarget() {
332
- return this.focusTargetElement;
333
- }
334
- // Hook method for debugging via tracing.
335
- modelShouldStillHaveFocus() {
336
- return this.focusContext.focused.value;
337
- }
338
- // Hook method for debugging via tracing.
339
- canFocus() {
340
- const dimension = this.focusTarget.getBoundingClientRect();
341
- const hasSize = dimension.height >= 0 && dimension.height >= 0;
342
- // tslint:disable-next-line:no-string-literal
343
- return hasSize && !this.focusTarget['disabled'];
344
- }
345
- };
346
- FocusBinding = __decorate([
347
- __param(1, Inject(NgZone)),
348
- __param(2, Inject(DOCUMENT)),
349
- __metadata("design:paramtypes", [HTMLElement,
350
- NgZone, Object, Object])
351
- ], FocusBinding);
352
-
353
- let FocusBindingFactory = class FocusBindingFactory {
354
- constructor(ngZone, document) {
355
- this.ngZone = ngZone;
356
- // @see https://stackoverflow.com/questions/49513359/could-not-resolve-type-document-in-angular5/53715642#53715642
357
- this.document = document;
358
- }
359
- createBinding(el, focusContext) {
360
- return new FocusBinding(el.nativeElement, this.ngZone, this.document, focusContext);
361
- }
362
- };
363
- FocusBindingFactory.ctorParameters = () => [
364
- { type: NgZone, decorators: [{ type: Inject, args: [NgZone,] }] },
365
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
366
- ];
367
- FocusBindingFactory.ɵprov = ɵɵdefineInjectable({ factory: function FocusBindingFactory_Factory() { return new FocusBindingFactory(ɵɵinject(NgZone), ɵɵinject(DOCUMENT)); }, token: FocusBindingFactory, providedIn: "root" });
368
- FocusBindingFactory = __decorate([
369
- Injectable({
370
- providedIn: 'root'
371
- }),
372
- __param(0, Inject(NgZone)), __param(1, Inject(DOCUMENT)),
373
- __metadata("design:paramtypes", [NgZone, Object])
374
- ], FocusBindingFactory);
375
-
376
327
  let FocusContainerComponent = class FocusContainerComponent extends DisposableComponent {
377
328
  constructor(focusManager) {
378
329
  super();
@@ -419,7 +370,7 @@ let FocusableComponent = class FocusableComponent extends DisposableComponent {
419
370
  const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
420
371
  if (this.focusManager) {
421
372
  this._focusContext = this.focusManager.registerFocusable(this);
422
- this.registerDisposable(focusBindingFactory.createBinding(el, this.focusContext));
373
+ this.registerDisposable(focusBindingFactory.createBinding(el.nativeElement, this.focusContext));
423
374
  }
424
375
  }
425
376
  get focusable() {
@@ -636,7 +587,7 @@ __decorate([
636
587
  CheckboxInputComponent = __decorate([
637
588
  Component({
638
589
  selector: 'aup-checkbox-input',
639
- template: "<mat-checkbox\n [(ngModel)]=\"valueModel.value\"\n [color]=\"color\"\n [labelPosition]=\"labelPosition\"\n [disabled]=\"!isEnabled()\"\n>{{label}}</mat-checkbox>\n<mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n<mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n",
590
+ template: "<!-- TODO: add focus binding -->\n<mat-checkbox\n [(ngModel)]=\"valueModel.value\"\n [color]=\"color\"\n [labelPosition]=\"labelPosition\"\n [disabled]=\"!isEnabled()\"\n>{{label}}</mat-checkbox>\n<mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n<mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n",
640
591
  styles: [":host{display:inline-flex;flex-direction:column;margin-top:24px;margin-bottom:16px}mat-error,mat-hint{margin-top:4px;margin-left:24px;font-size:12px;font-weight:400;line-height:13.5px}"]
641
592
  }),
642
593
  __metadata("design:paramtypes", [])
@@ -656,7 +607,7 @@ __decorate([
656
607
  NumberInputComponent = __decorate([
657
608
  Component({
658
609
  selector: 'aup-number-input',
659
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"number\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
610
+ template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"number\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"delegatingFormValueModel?.focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
660
611
  styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
661
612
  }),
662
613
  __metadata("design:paramtypes", [])
@@ -676,7 +627,7 @@ __decorate([
676
627
  PasswordInputComponent = __decorate([
677
628
  Component({
678
629
  selector: 'aup-password-input',
679
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"password\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
630
+ template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"password\"\n matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"delegatingFormValueModel.focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
680
631
  styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
681
632
  }),
682
633
  __metadata("design:paramtypes", [])
@@ -725,7 +676,7 @@ __decorate([
725
676
  SelectInputComponent = __decorate([
726
677
  Component({
727
678
  selector: 'aup-select-input',
728
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-option *ngIf=\"allowNil\">{{placeholder}}</mat-option>\n <mat-option *ngFor=\"let option of optionsModel.value; let i = index\" [value]=\"option\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(option)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: option, index: i }\"\n >\n </ng-container>\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
679
+ template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <mat-select placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"delegatingFormValueModel.focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-option *ngIf=\"allowNil\">{{placeholder}}</mat-option>\n <mat-option *ngFor=\"let option of optionsModel.value; let i = index\" [value]=\"option\">\n <ng-container *ngIf=\"!optionTemplateRef\">{{optionLabelFormat(option)}}</ng-container>\n <ng-container *ngIf=\"optionTemplateRef\"\n [ngTemplateOutlet]=\"optionTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: option, index: i }\"\n >\n </ng-container>\n </mat-option>\n </mat-select>\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
729
680
  styles: [":host{display:inline-block}mat-form-field{width:100%}"]
730
681
  }),
731
682
  __metadata("design:paramtypes", [])
@@ -758,7 +709,7 @@ __decorate([
758
709
  StringInputComponent = __decorate([
759
710
  Component({
760
711
  selector: 'aup-string-input',
761
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"valueModel\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n <button mat-button mat-icon-button matSuffix *ngIf=\"enableClear\" [pectinCommand]=\"clearCommand\">\n <mat-icon>close</mat-icon>\n </button>\n</mat-form-field>\n\n",
712
+ template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"valueModel.value\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"delegatingFormValueModel.focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n <button mat-button mat-icon-button matSuffix *ngIf=\"enableClear\" [pectinCommand]=\"clearCommand\">\n <mat-icon>close</mat-icon>\n </button>\n</mat-form-field>\n\n",
762
713
  styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}button[disabled]{visibility:hidden}"]
763
714
  }),
764
715
  __metadata("design:paramtypes", [])
@@ -4019,6 +3970,7 @@ class VisitSanitiser {
4019
3970
  this.placeHistory = placeHistory;
4020
3971
  this.injector = injector;
4021
3972
  }
3973
+ // @Trace()
4022
3974
  sanitise(visit) {
4023
3975
  return __awaiter(this, void 0, void 0, function* () {
4024
3976
  const placeDef = visit.placeDefinition;
@@ -4052,12 +4004,6 @@ class VisitSanitiser {
4052
4004
  });
4053
4005
  }
4054
4006
  }
4055
- __decorate([
4056
- Trace(),
4057
- __metadata("design:type", Function),
4058
- __metadata("design:paramtypes", [Visit]),
4059
- __metadata("design:returntype", Promise)
4060
- ], VisitSanitiser.prototype, "sanitise", null);
4061
4007
 
4062
4008
  class PlaceGuard {
4063
4009
  constructor(router, urlService, placeRouter, placeHistory, interactionService, injector) {
@@ -4260,5 +4206,5 @@ function VisitParameterList(options) {
4260
4206
  * Generated bundle index. Do not edit.
4261
4207
  */
4262
4208
 
4263
- export { ACTIVITY_DATA, AUP_PLACE_CONFIG, AbstractInputComponent, AbstractInteractionContext, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, Activity, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CheckboxInputComponent, CommandDirective, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EmptyStateComponent, EventCleanUpSession, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, InPlaceInteractionContextComponent, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, LEFT_RIGHT_PLACE_ANIMATION, ListPlaceNavComponent, ModalInteractionContextFactory, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NumberInputComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SelectInputComponent, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, UrlService, UrlSnapshot, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationEventsFinish, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, DirectivesModule as ɵa, CommandDirective as ɵb, AUP_PLACE_CONFIG as ɵba, PlaceRouter as ɵbc, InteractionService as ɵbd, ModalInteractionContextFactory as ɵbe, UrlService as ɵbf, PlaceHistory as ɵbg, TabbedPlaceNavigationComponent as ɵbh, AbstractPlaceNavigationComponent as ɵbi, ListPlaceNavComponent as ɵbj, InteractionModule as ɵbk, ActivityContainerComponent as ɵbl, AbstractInteractionContext as ɵbm, ActivityOutletComponent as ɵbn, ConfirmationDialogComponent as ɵbo, ACTIVITY_DATA as ɵbp, Activity as ɵbq, ConfirmThenDialogComponent as ɵbs, AlertDialogComponent as ɵbt, InPlaceInteractionContextComponent as ɵbv, FocusBindingDirective as ɵc, DisposableComponent as ɵd, ComponentsModule as ɵe, NumberInputComponent as ɵf, AbstractInputComponent as ɵg, StringInputComponent as ɵh, PasswordInputComponent as ɵi, SelectInputComponent as ɵj, CheckboxInputComponent as ɵk, ScrollContainerComponent as ɵl, NoopComponent as ɵm, SwitchCaseOption as ɵn, SwitchCaseWhenDirective as ɵo, SwitchCaseDefaultDirective as ɵp, SwitchCaseComponent as ɵq, FocusContainerComponent as ɵr, FocusableComponent as ɵs, FocusBindingFactory as ɵt, PlaceModule as ɵu, EmptyStateComponent as ɵv, BusyOverlayComponent as ɵw, PlaceOutletComponent as ɵx, leftRightPlaceAnimation as ɵy, LEFT_RIGHT_PLACE_ANIMATION as ɵz };
4209
+ export { ACTIVITY_DATA, AUP_PLACE_CONFIG, AbstractInputComponent, AbstractInteractionContext, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, Activity, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CheckboxInputComponent, CommandDirective, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EmptyStateComponent, EventCleanUpSession, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, InPlaceInteractionContextComponent, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, LEFT_RIGHT_PLACE_ANIMATION, ListPlaceNavComponent, ModalInteractionContextFactory, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NumberInputComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SelectInputComponent, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, UrlService, UrlSnapshot, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationEventsFinish, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, DirectivesModule as ɵa, CommandDirective as ɵb, AUP_PLACE_CONFIG as ɵba, PlaceRouter as ɵbc, InteractionService as ɵbd, ModalInteractionContextFactory as ɵbe, UrlService as ɵbf, PlaceHistory as ɵbg, TabbedPlaceNavigationComponent as ɵbh, AbstractPlaceNavigationComponent as ɵbi, ListPlaceNavComponent as ɵbj, InteractionModule as ɵbk, ActivityContainerComponent as ɵbl, AbstractInteractionContext as ɵbm, ActivityOutletComponent as ɵbn, ConfirmationDialogComponent as ɵbo, ACTIVITY_DATA as ɵbp, Activity as ɵbq, ConfirmThenDialogComponent as ɵbs, AlertDialogComponent as ɵbt, InPlaceInteractionContextComponent as ɵbv, FocusBindingDirective as ɵc, DisposableComponent as ɵd, FocusBindingFactory as ɵe, ComponentsModule as ɵf, NumberInputComponent as ɵg, AbstractInputComponent as ɵh, StringInputComponent as ɵi, PasswordInputComponent as ɵj, SelectInputComponent as ɵk, CheckboxInputComponent as ɵl, ScrollContainerComponent as ɵm, NoopComponent as ɵn, SwitchCaseOption as ɵo, SwitchCaseWhenDirective as ɵp, SwitchCaseDefaultDirective as ɵq, SwitchCaseComponent as ɵr, FocusContainerComponent as ɵs, FocusableComponent as ɵt, PlaceModule as ɵu, EmptyStateComponent as ɵv, BusyOverlayComponent as ɵw, PlaceOutletComponent as ɵx, leftRightPlaceAnimation as ɵy, LEFT_RIGHT_PLACE_ANIMATION as ɵz };
4264
4210
  //# sourceMappingURL=coolon-angular-ui-powerups.js.map