@coolon/angular-ui-powerups 1.10.0 → 1.11.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 (231) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/assets/styles.scss +7 -67
  3. package/bundles/coolon-angular-ui-powerups.umd.js +2649 -1623
  4. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  5. package/bundles/coolon-angular-ui-powerups.umd.min.js +2 -2
  6. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  7. package/coolon-angular-ui-powerups.d.ts +57 -44
  8. package/coolon-angular-ui-powerups.metadata.json +1 -1
  9. package/esm2015/coolon-angular-ui-powerups.js +55 -42
  10. package/esm2015/coolon-angular-ui-powerups.js.map +1 -1
  11. package/esm2015/coolon-angular-ui-powerups.metadata.json +1 -1
  12. package/esm2015/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
  13. package/esm2015/lib/components/card-container/card-container.component.js +1 -1
  14. package/esm2015/lib/components/card-container/card-container.component.metadata.json +1 -1
  15. package/esm2015/lib/components/components.module.js +37 -6
  16. package/esm2015/lib/components/components.module.js.map +1 -1
  17. package/esm2015/lib/components/components.module.metadata.json +1 -1
  18. package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
  19. package/esm2015/lib/components/forms/abstract-input-activity.js +47 -0
  20. package/esm2015/lib/components/forms/abstract-input-activity.js.map +1 -0
  21. package/esm2015/lib/components/forms/abstract-input-activity.metadata.json +1 -0
  22. package/esm2015/lib/components/forms/abstract-input-activity.ngfactory.js.map +1 -0
  23. package/esm2015/lib/components/forms/abstract-input.component.js +6 -1
  24. package/esm2015/lib/components/forms/abstract-input.component.js.map +1 -1
  25. package/esm2015/lib/components/forms/abstract-input.component.metadata.json +1 -1
  26. package/esm2015/lib/components/forms/number-input/number-input.component.js +1 -1
  27. package/esm2015/lib/components/forms/number-input/number-input.component.metadata.json +1 -1
  28. package/esm2015/lib/components/forms/password-input/password-input.component.js +1 -1
  29. package/esm2015/lib/components/forms/password-input/password-input.component.metadata.json +1 -1
  30. package/esm2015/lib/components/forms/string-input/string-input-activity.js +22 -0
  31. package/esm2015/lib/components/forms/string-input/string-input-activity.js.map +1 -0
  32. package/esm2015/lib/components/forms/string-input/string-input-activity.metadata.json +1 -0
  33. package/esm2015/lib/components/forms/string-input/string-input-activity.ngfactory.js.map +1 -0
  34. package/esm2015/lib/components/forms/string-input/string-input.component.js +1 -1
  35. package/esm2015/lib/components/forms/string-input/string-input.component.metadata.json +1 -1
  36. package/esm2015/lib/components/forms/text-input/text-input.component.js +1 -1
  37. package/esm2015/lib/components/forms/text-input/text-input.component.metadata.json +1 -1
  38. package/esm2015/lib/components/index.js +13 -0
  39. package/esm2015/lib/components/index.js.map +1 -1
  40. package/esm2015/lib/components/index.metadata.json +1 -1
  41. package/esm2015/lib/components/table/cell-editor.component.js +1 -0
  42. package/esm2015/lib/components/table/cell-editor.component.js.map +1 -0
  43. package/esm2015/lib/components/table/cell-editor.component.metadata.json +1 -0
  44. package/esm2015/lib/components/table/cell-renderer.js +1 -0
  45. package/esm2015/lib/components/table/cell-renderer.js.map +1 -0
  46. package/esm2015/lib/components/table/cell-renderer.metadata.json +1 -0
  47. package/esm2015/lib/components/table/column-model.js +160 -0
  48. package/esm2015/lib/components/table/column-model.js.map +1 -0
  49. package/esm2015/lib/components/table/column-model.metadata.json +1 -0
  50. package/esm2015/lib/components/table/column-template/column-template.directive.js +24 -0
  51. package/esm2015/lib/components/table/column-template/column-template.directive.js.map +1 -0
  52. package/esm2015/lib/components/table/column-template/column-template.directive.metadata.json +1 -0
  53. package/esm2015/lib/components/table/column-template/column-template.directive.ngfactory.js.map +1 -0
  54. package/esm2015/lib/components/table/column-text-properties.js +1 -0
  55. package/esm2015/lib/components/table/column-text-properties.js.map +1 -0
  56. package/esm2015/lib/components/table/column-text-properties.metadata.json +1 -0
  57. package/esm2015/lib/components/table/default-cell-renderer/default-cell-renderer.component.js +27 -0
  58. package/esm2015/lib/components/table/default-cell-renderer/default-cell-renderer.component.js.map +1 -0
  59. package/esm2015/lib/components/table/default-cell-renderer/default-cell-renderer.component.metadata.json +1 -0
  60. package/esm2015/lib/components/table/default-cell-renderer/default-cell-renderer.component.ngfactory.js.map +1 -0
  61. package/esm2015/lib/components/table/default-cell-renderer/default-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
  62. package/esm2015/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.js +21 -0
  63. package/esm2015/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.js.map +1 -0
  64. package/esm2015/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.metadata.json +1 -0
  65. package/esm2015/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.ngfactory.js.map +1 -0
  66. package/esm2015/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
  67. package/esm2015/lib/components/table/edit-row-controls/edit-row-controls.component.js +50 -0
  68. package/esm2015/lib/components/table/edit-row-controls/edit-row-controls.component.js.map +1 -0
  69. package/esm2015/lib/components/table/edit-row-controls/edit-row-controls.component.metadata.json +1 -0
  70. package/esm2015/lib/components/table/edit-row-controls/edit-row-controls.component.ngfactory.js.map +1 -0
  71. package/esm2015/lib/components/table/edit-row-controls/edit-row-controls.component.scss.shim.ngstyle.js.map +1 -0
  72. package/esm2015/lib/components/table/select-cell-renderer/select-cell-renderer.component.js +40 -0
  73. package/esm2015/lib/components/table/select-cell-renderer/select-cell-renderer.component.js.map +1 -0
  74. package/esm2015/lib/components/table/select-cell-renderer/select-cell-renderer.component.metadata.json +1 -0
  75. package/esm2015/lib/components/table/select-cell-renderer/select-cell-renderer.component.ngfactory.js.map +1 -0
  76. package/esm2015/lib/components/table/select-cell-renderer/select-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
  77. package/esm2015/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.js +32 -0
  78. package/esm2015/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.js.map +1 -0
  79. package/esm2015/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.metadata.json +1 -0
  80. package/esm2015/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.ngfactory.js.map +1 -0
  81. package/esm2015/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
  82. package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js +64 -0
  83. package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -0
  84. package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.metadata.json +1 -0
  85. package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.ngfactory.js.map +1 -0
  86. package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
  87. package/esm2015/lib/components/table/table-def.js +1 -0
  88. package/esm2015/lib/components/table/table-def.js.map +1 -0
  89. package/esm2015/lib/components/table/table-def.metadata.json +1 -0
  90. package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js +32 -0
  91. package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js.map +1 -0
  92. package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.metadata.json +1 -0
  93. package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.ngfactory.js.map +1 -0
  94. package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
  95. package/esm2015/lib/components/table/table-model.js +197 -0
  96. package/esm2015/lib/components/table/table-model.js.map +1 -0
  97. package/esm2015/lib/components/table/table-model.metadata.json +1 -0
  98. package/esm2015/lib/components/table/table.component.js +60 -0
  99. package/esm2015/lib/components/table/table.component.js.map +1 -0
  100. package/esm2015/lib/components/table/table.component.metadata.json +1 -0
  101. package/esm2015/lib/components/table/table.component.ngfactory.js.map +1 -0
  102. package/esm2015/lib/components/table/table.component.scss.shim.ngstyle.js.map +1 -0
  103. package/esm2015/lib/interaction/activity.js +7 -1
  104. package/esm2015/lib/interaction/activity.js.map +1 -1
  105. package/esm2015/lib/interaction/activity.metadata.json +1 -1
  106. package/esm2015/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.js +87 -0
  107. package/esm2015/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.js.map +1 -0
  108. package/esm2015/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.metadata.json +1 -0
  109. package/esm2015/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.ngfactory.js.map +1 -0
  110. package/esm2015/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.scss.shim.ngstyle.js.map +1 -0
  111. package/esm2015/lib/interaction/directives/interaction-context-trigger-for.directive.js +86 -0
  112. package/esm2015/lib/interaction/directives/interaction-context-trigger-for.directive.js.map +1 -0
  113. package/esm2015/lib/interaction/directives/interaction-context-trigger-for.directive.metadata.json +1 -0
  114. package/esm2015/lib/interaction/directives/interaction-context-trigger-for.directive.ngfactory.js.map +1 -0
  115. package/esm2015/lib/interaction/index.js +2 -0
  116. package/esm2015/lib/interaction/index.js.map +1 -1
  117. package/esm2015/lib/interaction/index.metadata.json +1 -1
  118. package/esm2015/lib/interaction/interaction.module.js +12 -3
  119. package/esm2015/lib/interaction/interaction.module.js.map +1 -1
  120. package/esm2015/lib/interaction/interaction.module.metadata.json +1 -1
  121. package/esm2015/lib/interaction/interaction.module.ngfactory.js.map +1 -1
  122. package/esm5/coolon-angular-ui-powerups.js +55 -42
  123. package/esm5/coolon-angular-ui-powerups.js.map +1 -1
  124. package/esm5/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
  125. package/esm5/lib/components/card-container/card-container.component.js +1 -1
  126. package/esm5/lib/components/components.module.js +37 -6
  127. package/esm5/lib/components/components.module.js.map +1 -1
  128. package/esm5/lib/components/components.module.ngfactory.js.map +1 -1
  129. package/esm5/lib/components/forms/abstract-input-activity.js +50 -0
  130. package/esm5/lib/components/forms/abstract-input-activity.js.map +1 -0
  131. package/esm5/lib/components/forms/abstract-input-activity.ngfactory.js.map +1 -0
  132. package/esm5/lib/components/forms/abstract-input.component.js +6 -1
  133. package/esm5/lib/components/forms/abstract-input.component.js.map +1 -1
  134. package/esm5/lib/components/forms/number-input/number-input.component.js +1 -1
  135. package/esm5/lib/components/forms/password-input/password-input.component.js +1 -1
  136. package/esm5/lib/components/forms/string-input/string-input-activity.js +18 -0
  137. package/esm5/lib/components/forms/string-input/string-input-activity.js.map +1 -0
  138. package/esm5/lib/components/forms/string-input/string-input-activity.ngfactory.js.map +1 -0
  139. package/esm5/lib/components/forms/string-input/string-input.component.js +1 -1
  140. package/esm5/lib/components/forms/text-input/text-input.component.js +1 -1
  141. package/esm5/lib/components/index.js +13 -0
  142. package/esm5/lib/components/index.js.map +1 -1
  143. package/esm5/lib/components/table/cell-editor.component.js +1 -0
  144. package/esm5/lib/components/table/cell-editor.component.js.map +1 -0
  145. package/esm5/lib/components/table/cell-renderer.js +1 -0
  146. package/esm5/lib/components/table/cell-renderer.js.map +1 -0
  147. package/esm5/lib/components/table/column-model.js +196 -0
  148. package/esm5/lib/components/table/column-model.js.map +1 -0
  149. package/esm5/lib/components/table/column-template/column-template.directive.js +25 -0
  150. package/esm5/lib/components/table/column-template/column-template.directive.js.map +1 -0
  151. package/esm5/lib/components/table/column-template/column-template.directive.ngfactory.js.map +1 -0
  152. package/esm5/lib/components/table/column-text-properties.js +1 -0
  153. package/esm5/lib/components/table/column-text-properties.js.map +1 -0
  154. package/esm5/lib/components/table/default-cell-renderer/default-cell-renderer.component.js +32 -0
  155. package/esm5/lib/components/table/default-cell-renderer/default-cell-renderer.component.js.map +1 -0
  156. package/esm5/lib/components/table/default-cell-renderer/default-cell-renderer.component.ngfactory.js.map +1 -0
  157. package/esm5/lib/components/table/default-cell-renderer/default-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
  158. package/esm5/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.js +22 -0
  159. package/esm5/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.js.map +1 -0
  160. package/esm5/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.ngfactory.js.map +1 -0
  161. package/esm5/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
  162. package/esm5/lib/components/table/edit-row-controls/edit-row-controls.component.js +57 -0
  163. package/esm5/lib/components/table/edit-row-controls/edit-row-controls.component.js.map +1 -0
  164. package/esm5/lib/components/table/edit-row-controls/edit-row-controls.component.ngfactory.js.map +1 -0
  165. package/esm5/lib/components/table/edit-row-controls/edit-row-controls.component.scss.shim.ngstyle.js.map +1 -0
  166. package/esm5/lib/components/table/select-cell-renderer/select-cell-renderer.component.js +47 -0
  167. package/esm5/lib/components/table/select-cell-renderer/select-cell-renderer.component.js.map +1 -0
  168. package/esm5/lib/components/table/select-cell-renderer/select-cell-renderer.component.ngfactory.js.map +1 -0
  169. package/esm5/lib/components/table/select-cell-renderer/select-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
  170. package/esm5/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.js +35 -0
  171. package/esm5/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.js.map +1 -0
  172. package/esm5/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.ngfactory.js.map +1 -0
  173. package/esm5/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
  174. package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.js +66 -0
  175. package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -0
  176. package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.ngfactory.js.map +1 -0
  177. package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
  178. package/esm5/lib/components/table/table-def.js +1 -0
  179. package/esm5/lib/components/table/table-def.js.map +1 -0
  180. package/esm5/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js +33 -0
  181. package/esm5/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js.map +1 -0
  182. package/esm5/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.ngfactory.js.map +1 -0
  183. package/esm5/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
  184. package/esm5/lib/components/table/table-model.js +213 -0
  185. package/esm5/lib/components/table/table-model.js.map +1 -0
  186. package/esm5/lib/components/table/table.component.js +62 -0
  187. package/esm5/lib/components/table/table.component.js.map +1 -0
  188. package/esm5/lib/components/table/table.component.ngfactory.js.map +1 -0
  189. package/esm5/lib/components/table/table.component.scss.shim.ngstyle.js.map +1 -0
  190. package/esm5/lib/interaction/activity.js +7 -2
  191. package/esm5/lib/interaction/activity.js.map +1 -1
  192. package/esm5/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.js +95 -0
  193. package/esm5/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.js.map +1 -0
  194. package/esm5/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.ngfactory.js.map +1 -0
  195. package/esm5/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.scss.shim.ngstyle.js.map +1 -0
  196. package/esm5/lib/interaction/directives/interaction-context-trigger-for.directive.js +90 -0
  197. package/esm5/lib/interaction/directives/interaction-context-trigger-for.directive.js.map +1 -0
  198. package/esm5/lib/interaction/directives/interaction-context-trigger-for.directive.ngfactory.js.map +1 -0
  199. package/esm5/lib/interaction/index.js +2 -0
  200. package/esm5/lib/interaction/index.js.map +1 -1
  201. package/esm5/lib/interaction/interaction.module.js +12 -3
  202. package/esm5/lib/interaction/interaction.module.js.map +1 -1
  203. package/esm5/lib/interaction/interaction.module.ngfactory.js.map +1 -1
  204. package/fesm2015/coolon-angular-ui-powerups.js +2280 -1372
  205. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  206. package/fesm5/coolon-angular-ui-powerups.js +2561 -1567
  207. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  208. package/lib/components/forms/abstract-input-activity.d.ts +18 -0
  209. package/lib/components/forms/abstract-input.component.d.ts +1 -0
  210. package/lib/components/forms/string-input/string-input-activity.d.ts +3 -0
  211. package/lib/components/index.d.ts +17 -0
  212. package/lib/components/table/cell-editor.component.d.ts +5 -0
  213. package/lib/components/table/cell-renderer.d.ts +3 -0
  214. package/lib/components/table/column-model.d.ts +84 -0
  215. package/lib/components/table/column-template/column-template.directive.d.ts +7 -0
  216. package/lib/components/table/column-text-properties.d.ts +3 -0
  217. package/lib/components/table/default-cell-renderer/default-cell-renderer.component.d.ts +6 -0
  218. package/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.d.ts +5 -0
  219. package/lib/components/table/edit-row-controls/edit-row-controls.component.d.ts +14 -0
  220. package/lib/components/table/select-cell-renderer/select-cell-renderer.component.d.ts +11 -0
  221. package/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.d.ts +9 -0
  222. package/lib/components/table/table-cell-renderer/table-cell-renderer.component.d.ts +18 -0
  223. package/lib/components/table/table-def.d.ts +7 -0
  224. package/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.d.ts +8 -0
  225. package/lib/components/table/table-model.d.ts +114 -0
  226. package/lib/components/table/table.component.d.ts +40 -0
  227. package/lib/interaction/activity.d.ts +1 -0
  228. package/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.d.ts +21 -0
  229. package/lib/interaction/directives/interaction-context-trigger-for.directive.d.ts +17 -0
  230. package/lib/interaction/index.d.ts +2 -0
  231. package/package.json +3 -2
@@ -1,27 +1,30 @@
1
1
  import { __extends, __decorate, __metadata, __param, __awaiter, __generator, __assign, __spread } from 'tslib';
2
2
  import { DOCUMENT, CommonModule, Location } from '@angular/common';
3
- import { ElementRef, Inject, Input, HostListener, Directive, NgZone, ɵɵdefineInjectable, ɵɵinject, Injectable, NgModule, Self, 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, HostBinding, Component, ContentChild, TemplateRef, Self, InjectionToken, Injector, ComponentFactoryResolver, ViewContainerRef, ViewChild, ViewChildren, QueryList, Optional, EventEmitter, Output, ChangeDetectorRef, ContentChildren, 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';
7
7
  import { MatSelectModule } from '@angular/material/select';
8
8
  import { MatTabsModule, MatTabGroup, MAT_TABS_CONFIG } from '@angular/material/tabs';
9
9
  import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
10
+ import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
10
11
  import { MatButtonModule } from '@angular/material/button';
11
12
  import { MatCheckboxModule } from '@angular/material/checkbox';
12
13
  import { MatIconModule } from '@angular/material/icon';
13
- import { DelegatingValueModel, assert, UnaryCommand, lang, Dsl, GarbageCollector, Logger, Command, FocusManager, DelegatingFormValueModel, TrackExternal, ListModel, StoreInListModel, ValueModel, StoreInValueModel, MutableValueModel, Deferred, Trace, MutableListModel, Guard, DebugContext, Binding, Functions } from '@coolon/pectin';
14
- import { PortalModule } from '@angular/cdk/portal';
14
+ import { MatTableModule } from '@angular/material/table';
15
+ import { DelegatingValueModel, assert, UnaryCommand, lang, Dsl, GarbageCollector, Logger, FocusManager, MutableValueModel, TrackExternal, Command, Deferred, Trace, MutableListModel, Form, DelegatingFormValueModel, ListModel, StoreInListModel, ValueModel, StoreInValueModel, MultipleSelectionModel, Guard, DebugContext, Binding, Functions } from '@coolon/pectin';
15
16
  import { FlexModule, GridModule } from '@angular/flex-layout';
16
17
  import { MatDialog, MatDialogConfig, MAT_DIALOG_DEFAULT_OPTIONS, MatDialogModule } from '@angular/material/dialog';
17
18
  import { RouterModule, UrlSegment, Router, UrlSerializer, NavigationStart, NavigationEnd, NavigationError, NavigationCancel, RouterOutlet } from '@angular/router';
18
19
  import ___default, { isEqual, isNil } from 'lodash';
19
20
  import ResizeObserver from 'resize-observer-polyfill';
20
21
  import { assert as assert$1, lang as lang$1, Opts, Klass } from '@coolon/typescript-utilities';
22
+ import { Overlay } from '@angular/cdk/overlay';
23
+ import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
24
+ import produce from 'immer';
21
25
  import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
22
26
  import { MatListModule } from '@angular/material/list';
23
27
  import { MatTooltipModule } from '@angular/material/tooltip';
24
- import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
25
28
  import { Memoize as Memoize$1 } from '@typescript-plus/fast-memoize-decorator';
26
29
  import 'reflect-metadata';
27
30
  import { style, query, group, animate, trigger, transition } from '@angular/animations';
@@ -362,45 +365,6 @@ var DirectivesModule = /** @class */ (function () {
362
365
  return DirectivesModule;
363
366
  }());
364
367
 
365
- var FocusContainerComponent = /** @class */ (function (_super) {
366
- __extends(FocusContainerComponent, _super);
367
- function FocusContainerComponent(focusManager) {
368
- var _this = _super.call(this) || this;
369
- _this.focusManager = focusManager;
370
- _this.restoreFocusCommand = Command.create(function () {
371
- _this.restoreFocus();
372
- });
373
- _this.tabIndex = -1;
374
- return _this;
375
- }
376
- FocusContainerComponent.prototype.ngOnInit = function () {
377
- };
378
- // @Trace()
379
- FocusContainerComponent.prototype.restoreFocus = function () {
380
- this.focusManager.restoreFocus();
381
- };
382
- FocusContainerComponent.ctorParameters = function () { return [
383
- { type: FocusManager, decorators: [{ type: Self }] }
384
- ]; };
385
- __decorate([
386
- HostBinding('attr.tabindex'),
387
- __metadata("design:type", Object)
388
- ], FocusContainerComponent.prototype, "tabIndex", void 0);
389
- FocusContainerComponent = __decorate([
390
- Component({
391
- selector: 'aup-focus-container',
392
- template: "<ng-content></ng-content>\n",
393
- providers: [
394
- { provide: FocusManager }
395
- ],
396
- styles: [":host{display:block}"]
397
- }),
398
- __param(0, Self()),
399
- __metadata("design:paramtypes", [FocusManager])
400
- ], FocusContainerComponent);
401
- return FocusContainerComponent;
402
- }(DisposableComponent));
403
-
404
368
  var FocusableComponent = /** @class */ (function (_super) {
405
369
  __extends(FocusableComponent, _super);
406
370
  function FocusableComponent(el, focusManager, focusBindingFactory) {
@@ -466,1840 +430,2785 @@ var FocusableComponent = /** @class */ (function (_super) {
466
430
  return FocusableComponent;
467
431
  }(DisposableComponent));
468
432
 
469
- var AbstractInputComponent = /** @class */ (function (_super) {
470
- __extends(AbstractInputComponent, _super);
471
- function AbstractInputComponent() {
472
- var _this = _super.call(this) || this;
473
- /**
474
- * A backing model for all our @Input() valueModel properties which should be defined as follows.
475
- *
476
- * @Input() @TrackExternal({useExisting: "delegatingFormValueModel"})
477
- * valueModel: FormValueModel<string> | MutableValueModel<string>;
478
- *
479
- * This approach allows the input to accept plain or form models but all backed by a form
480
- * friendly delegate. We have to use an existing delegate for union types as pectin just
481
- * gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).
482
- */
483
- // We have to register it as a disposable so it ditches any listeners when we're disposed.
484
- _this.delegatingFormValueModel = _this.registerDisposable(new DelegatingFormValueModel());
485
- // TODO: fix this.
486
- // tslint:disable-next-line:no-output-native
487
- _this.focus = new EventEmitter();
488
- // tslint:disable-next-line:no-output-native
489
- _this.blur = new EventEmitter();
490
- // tslint:disable-next-line:no-output-native
491
- _this.enterKey = new EventEmitter();
492
- // tslint:disable-next-line:no-output-native
493
- _this.escapeKey = new EventEmitter();
494
- var self = _this;
495
- _this.errorStateMatcher = {
496
- isErrorState: function (control, form) {
497
- return self.hasErrors();
498
- }
499
- };
500
- return _this;
433
+ var Dimension = /** @class */ (function () {
434
+ function Dimension(width, height) {
435
+ this.width = width;
436
+ this.height = height;
501
437
  }
502
- AbstractInputComponent.prototype.notifyClick = function () {
503
- this.safelyInvoke(this.clickCommand);
504
- };
505
- AbstractInputComponent.prototype.notifyFocusIn = function () {
506
- this.safelyInvoke(this.focusCommand);
507
- this.focus.emit();
508
- };
509
- AbstractInputComponent.prototype.notifyFocusOut = function () {
510
- this.safelyInvoke(this.blurCommand);
511
- this.blur.emit();
512
- };
513
- AbstractInputComponent.prototype.notifyEnterKey = function () {
514
- this.safelyInvoke(this.enterCommand);
515
- this.enterKey.emit();
438
+ return Dimension;
439
+ }());
440
+
441
+ var Point = /** @class */ (function () {
442
+ function Point(x, y) {
443
+ this.x = x;
444
+ this.y = y;
445
+ }
446
+ Point.from = function (data) {
447
+ return new Point(data.x, data.y);
516
448
  };
517
- AbstractInputComponent.prototype.notifyEscapeKey = function () {
518
- this.safelyInvoke(this.escapeCommand);
519
- this.escapeKey.emit();
449
+ Point.prototype.translate = function (x, y) {
450
+ return new Point(this.x + x, this.y + y);
520
451
  };
521
- AbstractInputComponent.prototype.safelyInvoke = function (command) {
522
- if (command && command.enabled.value) {
523
- command.execute();
452
+ return Point;
453
+ }());
454
+
455
+ var Bounds = /** @class */ (function (_super) {
456
+ __extends(Bounds, _super);
457
+ function Bounds(top, left, width, height) {
458
+ var _this = _super.call(this, width, height) || this;
459
+ _this.top = top;
460
+ _this.left = left;
461
+ _this.width = width;
462
+ _this.height = height;
463
+ return _this;
464
+ }
465
+ Bounds.prototype.relativePositionOf = function (point) {
466
+ if (point instanceof MouseEvent) {
467
+ return new Point(point.clientX - this.left, point.clientY - this.top);
468
+ }
469
+ else {
470
+ return new Point(point.x - this.left, point.y - this.top);
524
471
  }
525
472
  };
526
- AbstractInputComponent.prototype.ngOnInit = function () {
527
- };
528
- AbstractInputComponent.prototype.isEnabled = function () {
529
- return this.enabled.value;
473
+ return Bounds;
474
+ }(Dimension));
475
+ (function (Bounds) {
476
+ function ofElement(element) {
477
+ var rect = element.getBoundingClientRect();
478
+ return new Bounds(rect.top, rect.left, rect.width, rect.height);
479
+ }
480
+ Bounds.ofElement = ofElement;
481
+ })(Bounds || (Bounds = {}));
482
+
483
+ var ResizeAwareComponent = /** @class */ (function (_super) {
484
+ __extends(ResizeAwareComponent, _super);
485
+ function ResizeAwareComponent(elementRef, ngZone) {
486
+ var _this = _super.call(this) || this;
487
+ _this.elementRef = elementRef;
488
+ _this.ngZone = ngZone;
489
+ _this._boundsModel = new MutableValueModel(new Bounds(0, 0, 0, 0));
490
+ return _this;
491
+ }
492
+ ResizeAwareComponent.prototype.ngAfterViewInit = function () {
493
+ var _this = this;
494
+ this.updateBounds();
495
+ var element = this.elementRef.nativeElement;
496
+ var ro = new ResizeObserver(function (entries, observer) {
497
+ _this.ngZone.run(function () { return _this.updateBounds(); });
498
+ });
499
+ ro.observe(element);
500
+ this.onDispose(function () { return ro.disconnect(); });
530
501
  };
531
- Object.defineProperty(AbstractInputComponent.prototype, "enabled", {
502
+ Object.defineProperty(ResizeAwareComponent.prototype, "boundsModel", {
532
503
  get: function () {
533
- return this.delegatingFormValueModel.enabled;
504
+ return this._boundsModel.readonly;
534
505
  },
535
506
  enumerable: true,
536
507
  configurable: true
537
508
  });
538
- AbstractInputComponent.prototype.hasErrors = function () {
539
- return !this.errorList.query().isEmpty();
540
- };
541
- Object.defineProperty(AbstractInputComponent.prototype, "errorList", {
509
+ Object.defineProperty(ResizeAwareComponent.prototype, "nativeElement", {
542
510
  get: function () {
543
- return this.delegatingFormValueModel.errorList;
511
+ return this.elementRef.nativeElement;
544
512
  },
545
513
  enumerable: true,
546
514
  configurable: true
547
515
  });
548
- Object.defineProperty(AbstractInputComponent.prototype, "firstError", {
516
+ // TODO: Make this handle body scroll
517
+ ResizeAwareComponent.prototype.relativePositionOf = function (point) {
518
+ return this.bounds.relativePositionOf(point);
519
+ };
520
+ Object.defineProperty(ResizeAwareComponent.prototype, "bounds", {
549
521
  get: function () {
550
- return this.hasErrors() ? this.errorList.value[0] : null;
522
+ return this._boundsModel.value;
551
523
  },
552
524
  enumerable: true,
553
525
  configurable: true
554
526
  });
527
+ ResizeAwareComponent.prototype.updateBounds = function () {
528
+ this._boundsModel.value = Bounds.ofElement(this.nativeElement);
529
+ };
530
+ ResizeAwareComponent.ctorParameters = function () { return [
531
+ { type: ElementRef },
532
+ { type: NgZone }
533
+ ]; };
534
+ ResizeAwareComponent = __decorate([
535
+ Directive(),
536
+ __metadata("design:paramtypes", [ElementRef, NgZone])
537
+ ], ResizeAwareComponent);
538
+ return ResizeAwareComponent;
539
+ }(DisposableComponent));
540
+
541
+ /**
542
+ * @example
543
+ * // CSS Vars
544
+ * aup-card-container {
545
+ * --card-gap: var(--card-gap, 16px);
546
+ * --card-width: var(--card-width, 300px);
547
+ * --card-height: var(--card-height, auto);
548
+ * --card-min-height: var(--card-min-height, auto);
549
+ * --card-background: var(--card-background, #fcfcfb);
550
+ * }
551
+ *
552
+ * // Content Templates:
553
+ * #addCardTemplate
554
+ * <ng-template #addCardTemplate>
555
+ * This is a new card template, it will the the size of the other cards.
556
+ * </nav-template>
557
+ *
558
+ */
559
+ var CardContainerComponent = /** @class */ (function (_super) {
560
+ __extends(CardContainerComponent, _super);
561
+ function CardContainerComponent() {
562
+ return _super.call(this) || this;
563
+ }
564
+ CardContainerComponent.prototype.ngOnInit = function () {
565
+ };
555
566
  __decorate([
556
567
  Input(),
557
- __metadata("design:type", String)
558
- ], AbstractInputComponent.prototype, "label", void 0);
559
- __decorate([
560
- Input(),
561
- __metadata("design:type", String)
562
- ], AbstractInputComponent.prototype, "floatLabel", void 0);
563
- __decorate([
564
- Input(),
565
- __metadata("design:type", String)
566
- ], AbstractInputComponent.prototype, "hint", void 0);
567
- __decorate([
568
- Input(),
569
- __metadata("design:type", String)
570
- ], AbstractInputComponent.prototype, "placeholder", void 0);
571
- __decorate([
572
- Input('command.focus'),
573
- __metadata("design:type", Command)
574
- ], AbstractInputComponent.prototype, "focusCommand", void 0);
575
- __decorate([
576
- Input('command.blur'),
577
- __metadata("design:type", Command)
578
- ], AbstractInputComponent.prototype, "blurCommand", void 0);
579
- __decorate([
580
- Input('command.enter'),
581
- __metadata("design:type", Command)
582
- ], AbstractInputComponent.prototype, "enterCommand", void 0);
583
- __decorate([
584
- Input('command.escape'),
585
- __metadata("design:type", Command)
586
- ], AbstractInputComponent.prototype, "escapeCommand", void 0);
587
- __decorate([
588
- Input('command.click'),
568
+ TrackExternal(),
589
569
  __metadata("design:type", Command)
590
- ], AbstractInputComponent.prototype, "clickCommand", void 0);
570
+ ], CardContainerComponent.prototype, "addCardCommand", void 0);
591
571
  __decorate([
592
- Output(),
593
- __metadata("design:type", Object)
594
- ], AbstractInputComponent.prototype, "focus", void 0);
595
- __decorate([
596
- Output(),
597
- __metadata("design:type", Object)
598
- ], AbstractInputComponent.prototype, "blur", void 0);
599
- __decorate([
600
- Output(),
601
- __metadata("design:type", Object)
602
- ], AbstractInputComponent.prototype, "enterKey", void 0);
603
- __decorate([
604
- Output(),
605
- __metadata("design:type", Object)
606
- ], AbstractInputComponent.prototype, "escapeKey", void 0);
607
- __decorate([
608
- HostListener('click'),
609
- __metadata("design:type", Function),
610
- __metadata("design:paramtypes", []),
611
- __metadata("design:returntype", void 0)
612
- ], AbstractInputComponent.prototype, "notifyClick", null);
613
- __decorate([
614
- HostListener('focusin'),
615
- __metadata("design:type", Function),
616
- __metadata("design:paramtypes", []),
617
- __metadata("design:returntype", void 0)
618
- ], AbstractInputComponent.prototype, "notifyFocusIn", null);
619
- __decorate([
620
- HostListener('focusout'),
621
- __metadata("design:type", Function),
622
- __metadata("design:paramtypes", []),
623
- __metadata("design:returntype", void 0)
624
- ], AbstractInputComponent.prototype, "notifyFocusOut", null);
625
- AbstractInputComponent = __decorate([
626
- Component({ template: '' }),
572
+ ContentChild("addCardTemplate"),
573
+ __metadata("design:type", TemplateRef)
574
+ ], CardContainerComponent.prototype, "addCardTemplate", void 0);
575
+ CardContainerComponent = __decorate([
576
+ Component({
577
+ selector: 'aup-card-container',
578
+ template: "<div class=\"card-container\">\n <ng-content></ng-content>\n\n <div class=\"add-card-container\" *ngIf=\"addCardCommand.enabled.value\" [pectinCommand]=\"addCardCommand\">\n <mat-icon>add</mat-icon>\n </div>\n\n <div class=\"add-card-template\" *ngIf=\"addCardTemplate\">\n <ng-container [ngTemplateOutlet]=\"addCardTemplate\"></ng-container>\n </div>\n\n</div>\n",
579
+ styles: [":root{--aup-default-padding:var(--default-padding, 18px);--aup-default-background:white}.router-outlet-container>*{position:absolute;top:0;left:0;bottom:0;right:0}[no-tab-header]>mat-tab-header{display:none}[full-height-tabs] .mat-tab-body-wrapper,mat-tab-group.full-height-tabs .mat-tab-body-wrapper{flex:1}[full-height-tabs] .mat-tab-body-wrapper .mat-tab-body-content,[full-height-tabs] .mat-tab-body-wrapper mat-tab-body,mat-tab-group.full-height-tabs .mat-tab-body-wrapper .mat-tab-body-content,mat-tab-group.full-height-tabs .mat-tab-body-wrapper mat-tab-body{display:flex;flex-direction:column;justify-content:stretch}.dialog-interaction-context{max-width:95vw!important;max-height:95vh!important}.dialog-interaction-context mat-dialog-container{max-width:95vw!important;max-height:95vh!important;padding:0}.aup-popup-interaction-panel{background:var(--aup-default-background,#fff);box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);transition:box-shadow 280ms cubic-bezier(.4,0,.2,1)}.aup-input-activity{padding:calc(var(--aup-default-padding)/2)}.aup-input-component{display:block}.aup-input-component input,.aup-input-component mat-form-field{width:100%}.aup-input-component input mat-hint.faux-error,.aup-input-component mat-form-field mat-hint.faux-error{color:#f44336}aup-table-cell-renderer>.aup-input-component .mat-form-field-flex{padding-top:0}aup-table-cell-renderer>.aup-input-component .mat-form-field-infix{width:0}aup-table-cell-renderer>.aup-input-component .mat-form-field-label-wrapper{display:none}aup-table{--default-column-gap:var(--column-gap, 24px)}aup-table aup-table-cell-renderer:not(.first-column),aup-table aup-table-header-cell-renderer:not(.first-column){padding-left:var(--default-column-gap)}:host{--resolved-card-gap:var(--card-gap, 16px);--resolved-card-width:var(--card-width, 300px);--resolved-card-height:var(--card-height, auto);--resolved-card-min-height:var(--card-min-height, auto);--resolved-card-background:var(--card-background, #fcfcfb);flex:1;display:block;background:var(--resolved-card-background)}.card-container{display:-ms-grid;display:grid;grid-template-columns:repeat(auto-fill,var(--resolved-card-width));grid-template-rows:repeat(auto-fit,minmax(0,var(--resolved-card-height)));grid-gap:var(--resolved-card-gap);box-sizing:border-box;padding:var(--resolved-card-gap);min-height:calc(var(--resolved-card-height) + 2 * var(--resolved-card-gap));min-width:calc(var(--resolved-card-width) + 2 * var(--resolved-card-gap));width:calc((var(--resolved-card-width) + var(--resolved-card-gap)) * 2 + var(--grid-gap));max-width:100%}.add-card-container{width:var(--resolved-card-width);height:var(--resolved-card-height);min-height:var(--resolved-card-min-height);display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;border:2px dashed rgba(0,0,0,.1);border-radius:6px;font-weight:300;cursor:pointer;color:rgba(0,0,0,.54);background-color:rgba(255,255,255,.8);transition:280ms cubic-bezier(.4,0,.2,1)}.add-card-container mat-icon{font-size:200%}.add-card-container:hover{transition:280ms cubic-bezier(.4,0,.2,1);border-color:transparent;background-color:#fff;color:rgba(0,0,0,.54)}.add-card-container:hover:hover{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}.add-card-template-container{width:var(--resolved-card-width);height:var(--resolved-card-height);display:flex;flex-direction:column;align-items:stretch;justify-content:stretch}"]
580
+ }),
627
581
  __metadata("design:paramtypes", [])
628
- ], AbstractInputComponent);
629
- return AbstractInputComponent;
582
+ ], CardContainerComponent);
583
+ return CardContainerComponent;
630
584
  }(DisposableComponent));
631
585
 
632
- var CheckboxInputComponent = /** @class */ (function (_super) {
633
- __extends(CheckboxInputComponent, _super);
634
- function CheckboxInputComponent() {
586
+ var FocusContainerComponent = /** @class */ (function (_super) {
587
+ __extends(FocusContainerComponent, _super);
588
+ function FocusContainerComponent(focusManager) {
635
589
  var _this = _super.call(this) || this;
636
- _this.color = 'accent';
637
- _this.labelPosition = 'after';
590
+ _this.focusManager = focusManager;
591
+ _this.restoreFocusCommand = Command.create(function () {
592
+ _this.restoreFocus();
593
+ });
594
+ _this.tabIndex = -1;
638
595
  return _this;
639
596
  }
640
- CheckboxInputComponent.prototype.ngOnInit = function () {
597
+ FocusContainerComponent.prototype.ngOnInit = function () {
598
+ };
599
+ // @Trace()
600
+ FocusContainerComponent.prototype.restoreFocus = function () {
601
+ this.focusManager.restoreFocus();
641
602
  };
603
+ FocusContainerComponent.ctorParameters = function () { return [
604
+ { type: FocusManager, decorators: [{ type: Self }] }
605
+ ]; };
642
606
  __decorate([
643
- Input(), TrackExternal({ delegateTo: 'delegatingFormValueModel' }),
607
+ HostBinding('attr.tabindex'),
644
608
  __metadata("design:type", Object)
645
- ], CheckboxInputComponent.prototype, "valueModel", void 0);
646
- __decorate([
647
- Input(),
648
- __metadata("design:type", String)
649
- ], CheckboxInputComponent.prototype, "color", void 0);
650
- __decorate([
651
- Input(),
652
- __metadata("design:type", String)
653
- ], CheckboxInputComponent.prototype, "labelPosition", void 0);
654
- CheckboxInputComponent = __decorate([
609
+ ], FocusContainerComponent.prototype, "tabIndex", void 0);
610
+ FocusContainerComponent = __decorate([
655
611
  Component({
656
- selector: 'aup-checkbox-input',
657
- 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",
658
- 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}"]
612
+ selector: 'aup-focus-container',
613
+ template: "<ng-content></ng-content>\n",
614
+ providers: [
615
+ { provide: FocusManager }
616
+ ],
617
+ styles: [":host{display:block}"]
659
618
  }),
660
- __metadata("design:paramtypes", [])
661
- ], CheckboxInputComponent);
662
- return CheckboxInputComponent;
663
- }(AbstractInputComponent));
619
+ __param(0, Self()),
620
+ __metadata("design:paramtypes", [FocusManager])
621
+ ], FocusContainerComponent);
622
+ return FocusContainerComponent;
623
+ }(DisposableComponent));
664
624
 
665
- var NumberInputComponent = /** @class */ (function (_super) {
666
- __extends(NumberInputComponent, _super);
667
- function NumberInputComponent() {
668
- var _this = _super.call(this) || this;
669
- _this.min = Number.MIN_SAFE_INTEGER;
670
- _this.max = Number.MAX_SAFE_INTEGER;
625
+ var ACTIVITY_DATA = new InjectionToken('InteractionActivityData');
626
+ var Activity = /** @class */ (function (_super) {
627
+ __extends(Activity, _super);
628
+ function Activity() {
629
+ var _this = _super !== null && _super.apply(this, arguments) || this;
630
+ _this._busyModel = new DelegatingValueModel().withDefault(false);
631
+ _this.class = 'aup-activity';
671
632
  return _this;
672
633
  }
673
- NumberInputComponent.prototype.ngOnInit = function () {
634
+ Activity.prototype.initialise = function (nestedInteractionContext, activityContext) {
635
+ assert$1.isNil(this._activityContext);
636
+ this._activityContext = activityContext;
637
+ this._interactionContext = nestedInteractionContext;
638
+ };
639
+ Object.defineProperty(Activity.prototype, "interactionContext", {
640
+ get: function () {
641
+ assert$1.isTruthy(this.isInitialised());
642
+ return this._interactionContext;
643
+ },
644
+ enumerable: true,
645
+ configurable: true
646
+ });
647
+ Activity.prototype.done = function (result) {
648
+ return this._activityContext.onDone(result);
649
+ };
650
+ Activity.prototype.cancel = function (error) {
651
+ this._activityContext.onCancel(error);
652
+ };
653
+ // @Trace()
654
+ Activity.prototype.onActivityReady = function () {
655
+ };
656
+ Object.defineProperty(Activity.prototype, "busy", {
657
+ get: function () {
658
+ return this._busyModel.readonly;
659
+ },
660
+ enumerable: true,
661
+ configurable: true
662
+ });
663
+ Activity.prototype.busyWhile = function (busyModel) {
664
+ this._busyModel.setDelegate(busyModel);
665
+ };
666
+ Activity.prototype.isBusy = function () {
667
+ return this._busyModel.value;
668
+ };
669
+ Activity.prototype.isInitialised = function () {
670
+ return !!this._activityContext;
674
671
  };
675
672
  __decorate([
676
- Input(), TrackExternal({ delegateTo: 'delegatingFormValueModel' }),
677
- __metadata("design:type", Object)
678
- ], NumberInputComponent.prototype, "valueModel", void 0);
679
- __decorate([
680
- Input(),
681
- __metadata("design:type", Object)
682
- ], NumberInputComponent.prototype, "min", void 0);
683
- __decorate([
684
- Input(),
673
+ HostBinding('class'),
685
674
  __metadata("design:type", Object)
686
- ], NumberInputComponent.prototype, "max", void 0);
687
- NumberInputComponent = __decorate([
675
+ ], Activity.prototype, "class", void 0);
676
+ return Activity;
677
+ }(DisposableComponent));
678
+
679
+ var AlertDialogComponent = /** @class */ (function (_super) {
680
+ __extends(AlertDialogComponent, _super);
681
+ function AlertDialogComponent(alert) {
682
+ var _this = _super.call(this) || this;
683
+ _this.alert = alert;
684
+ return _this;
685
+ }
686
+ AlertDialogComponent.prototype.ngOnInit = function () {
687
+ };
688
+ AlertDialogComponent.ctorParameters = function () { return [
689
+ { type: undefined, decorators: [{ type: Inject, args: [ACTIVITY_DATA,] }] }
690
+ ]; };
691
+ AlertDialogComponent = __decorate([
688
692
  Component({
689
- selector: 'aup-number-input',
690
- 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 [min]=\"min\"\n [max]=\"max\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
691
- styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]
693
+ selector: 'aup-alert-dialog',
694
+ template: "<h3 matDialogTitle *ngIf=\"alert.title\">{{alert.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of alert.content()\">{{line}}</p>\n</div>\n<div matDialogActions>\n <button mat-raised-button color=\"primary\" (click)=\"done()\" data-cy=\"close-button\">{{alert.ok()}}</button>\n</div>\n",
695
+ styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-content{margin:0;padding:0}.mat-dialog-actions{margin-bottom:0!important;padding:0;align-items:flex-end;justify-content:flex-end}"]
692
696
  }),
693
- __metadata("design:paramtypes", [])
694
- ], NumberInputComponent);
695
- return NumberInputComponent;
696
- }(AbstractInputComponent));
697
+ __param(0, Inject(ACTIVITY_DATA)),
698
+ __metadata("design:paramtypes", [Object])
699
+ ], AlertDialogComponent);
700
+ return AlertDialogComponent;
701
+ }(Activity));
697
702
 
698
- var PasswordInputComponent = /** @class */ (function (_super) {
699
- __extends(PasswordInputComponent, _super);
700
- function PasswordInputComponent() {
701
- return _super.call(this) || this;
703
+ var ConfirmThenDialogComponent = /** @class */ (function (_super) {
704
+ __extends(ConfirmThenDialogComponent, _super);
705
+ function ConfirmThenDialogComponent(config) {
706
+ var _this = _super.call(this) || this;
707
+ _this.config = config;
708
+ assert.notNil(config);
709
+ return _this;
702
710
  }
703
- PasswordInputComponent.prototype.ngOnInit = function () {
711
+ ConfirmThenDialogComponent.prototype.ngOnInit = function () {
704
712
  };
705
- __decorate([
706
- Input(), TrackExternal({ delegateTo: "delegatingFormValueModel" }),
707
- __metadata("design:type", Object)
708
- ], PasswordInputComponent.prototype, "valueModel", void 0);
709
- PasswordInputComponent = __decorate([
713
+ Object.defineProperty(ConfirmThenDialogComponent.prototype, "confirm", {
714
+ get: function () {
715
+ return this.config.confirm;
716
+ },
717
+ enumerable: true,
718
+ configurable: true
719
+ });
720
+ ConfirmThenDialogComponent.prototype.isDestructive = function () {
721
+ return this.confirm.destructive && this.confirm.destructive();
722
+ };
723
+ ConfirmThenDialogComponent.prototype.onConfirm = function () {
724
+ var _this = this;
725
+ this.interactionContext.startActivity(this.config.activityType, this.config.data)
726
+ .then(function (result) { return _this.done(result); })
727
+ .catch(function (error) { return _this.cancel(error); });
728
+ };
729
+ ConfirmThenDialogComponent.ctorParameters = function () { return [
730
+ { type: undefined, decorators: [{ type: Inject, args: [ACTIVITY_DATA,] }] }
731
+ ]; };
732
+ ConfirmThenDialogComponent = __decorate([
710
733
  Component({
711
- selector: 'aup-password-input',
712
- 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",
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}"]
734
+ selector: 'aup-confirmation-dialog',
735
+ template: "<h3 matDialogTitle *ngIf=\"confirm.title\">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of confirm.content()\">{{line}}</p>\n</div>\n<div matDialogActions>\n <button mat-button (click)=\"cancel()\" data-cy=\"cancel-button\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\"\n (click)=\"onConfirm()\" data-cy=\"confirm-button\">{{confirm.ok()}}</button>\n</div>\n\n",
736
+ styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-content{margin:0;padding:0}.mat-dialog-actions{margin-bottom:0!important;padding:0;align-items:flex-end;justify-content:flex-end}"]
714
737
  }),
715
- __metadata("design:paramtypes", [])
716
- ], PasswordInputComponent);
717
- return PasswordInputComponent;
718
- }(AbstractInputComponent));
738
+ __param(0, Inject(ACTIVITY_DATA)),
739
+ __metadata("design:paramtypes", [Object])
740
+ ], ConfirmThenDialogComponent);
741
+ return ConfirmThenDialogComponent;
742
+ }(Activity));
719
743
 
720
- var SelectInputComponent = /** @class */ (function (_super) {
721
- __extends(SelectInputComponent, _super);
722
- function SelectInputComponent() {
744
+ var ConfirmationDialogComponent = /** @class */ (function (_super) {
745
+ __extends(ConfirmationDialogComponent, _super);
746
+ function ConfirmationDialogComponent(confirm) {
723
747
  var _this = _super.call(this) || this;
724
- _this.optionLabelFormat = function (option) { return (option && _this.optionLabel) ? option[_this.optionLabel] : option; };
748
+ _this.confirm = confirm;
749
+ assert.notNil(confirm);
725
750
  return _this;
726
751
  }
727
- SelectInputComponent.prototype.ngOnInit = function () {
752
+ ConfirmationDialogComponent.prototype.ngOnInit = function () {
728
753
  };
754
+ ConfirmationDialogComponent.prototype.isDestructive = function () {
755
+ return this.confirm.destructive && this.confirm.destructive();
756
+ };
757
+ ConfirmationDialogComponent.ctorParameters = function () { return [
758
+ { type: undefined, decorators: [{ type: Inject, args: [ACTIVITY_DATA,] }] }
759
+ ]; };
760
+ ConfirmationDialogComponent = __decorate([
761
+ Component({
762
+ selector: 'aup-confirmation-dialog',
763
+ template: "<h3 matDialogTitle *ngIf=\"confirm.title\">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of confirm.content()\">{{line}}</p>\n</div>\n<div matDialogActions>\n <button mat-button (click)=\"cancel()\" data-cy=\"cancel-button\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\"\n (click)=\"done()\" data-cy=\"confirm-button\">{{confirm.ok()}}</button>\n</div>\n\n",
764
+ styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-content{margin:0;padding:0}.mat-dialog-actions{margin-bottom:0!important;padding:0;align-items:flex-end;justify-content:flex-end}"]
765
+ }),
766
+ __param(0, Inject(ACTIVITY_DATA)),
767
+ __metadata("design:paramtypes", [Object])
768
+ ], ConfirmationDialogComponent);
769
+ return ConfirmationDialogComponent;
770
+ }(Activity));
771
+
772
+ var AbstractInteractionContext = /** @class */ (function () {
773
+ function AbstractInteractionContext() {
774
+ }
775
+ AbstractInteractionContext.prototype.startActivity = function (activityType, data) {
776
+ return this.createAndLaunchActivity(activityType, data, false);
777
+ };
778
+ AbstractInteractionContext.prototype.confirm = function (confirm) {
779
+ // Important: we have to implement confirmOrReject as the main entry point
780
+ // as the canDeactivation guards need to be able to cancel an interaction
781
+ // without caring about returning a value.
782
+ return this.confirmOrReject(confirm).then(function () { return true; }).catch(function () { return false; });
783
+ };
784
+ AbstractInteractionContext.prototype.alert = function (alert) {
785
+ // TODO: Test disableClose === false
786
+ return this.createAndLaunchActivity(AlertDialogComponent, alert, false);
787
+ };
788
+ AbstractInteractionContext.prototype.confirmOrReject = function (confirm) {
789
+ return this.createAndLaunchActivity(ConfirmationDialogComponent, confirm, true);
790
+ };
791
+ /**
792
+ * Presents the confirmation to the user and runs the activity only if the user confirms.
793
+ * @param confirm:Confirm the confirmation to display.
794
+ * @param activityType the activity to run if confirmed.
795
+ * @param data the activity data.
796
+ */
797
+ AbstractInteractionContext.prototype.confirmThen = function (confirm, activityType, data) {
798
+ return this.createAndLaunchActivity(ConfirmThenDialogComponent, {
799
+ confirm: confirm,
800
+ activityType: activityType,
801
+ data: data
802
+ }, true);
803
+ };
804
+ return AbstractInteractionContext;
805
+ }());
806
+
807
+ var ActivityRef = /** @class */ (function () {
808
+ function ActivityRef(activityClass, activityData, onComplete) {
809
+ this.activityClass = activityClass;
810
+ this.activityData = activityData;
811
+ this.onComplete = onComplete;
812
+ this._complete = false;
813
+ this.deferredResult = Deferred.defer();
814
+ }
815
+ ActivityRef.prototype.isActivityRealised = function () {
816
+ return !!this._activity;
817
+ };
818
+ ActivityRef.prototype.isComplete = function () {
819
+ return this._complete;
820
+ };
821
+ Object.defineProperty(ActivityRef.prototype, "activity", {
822
+ get: function () {
823
+ assert.isTruthy(this.isActivityRealised());
824
+ return this._activity;
825
+ },
826
+ enumerable: true,
827
+ configurable: true
828
+ });
829
+ ActivityRef.prototype.notifyActivityCreated = function (activity, nestedInteractionContext) {
830
+ assert.isNil(this._activity);
831
+ this._activity = activity;
832
+ var self = this;
833
+ this._activity.initialise(nestedInteractionContext, {
834
+ onDone: function (result) {
835
+ self.finishActivity(function (deferred) { return deferred.resolve(result); });
836
+ },
837
+ onCancel: function (error) {
838
+ self.finishActivity(function (deferred) { return deferred.reject(error); });
839
+ }
840
+ });
841
+ };
842
+ ActivityRef.prototype.finishActivity = function (resolveOrReject) {
843
+ assert.isFalsey(this.isComplete());
844
+ resolveOrReject(this.deferredResult);
845
+ this._complete = true;
846
+ this.onComplete(this);
847
+ };
848
+ ActivityRef.prototype.cancel = function () {
849
+ this.activity.cancel();
850
+ };
851
+ Object.defineProperty(ActivityRef.prototype, "activityResult", {
852
+ get: function () {
853
+ return this.deferredResult.promise;
854
+ },
855
+ enumerable: true,
856
+ configurable: true
857
+ });
858
+ return ActivityRef;
859
+ }());
860
+
861
+ /**
862
+ * ActivityOutletComponent creates and displays an activity and delegates the interaction context functionality to an
863
+ * external service.
864
+ */
865
+ var ActivityOutletComponent = /** @class */ (function () {
866
+ function ActivityOutletComponent(componentFactoryResolver, viewContainerRef, injector) {
867
+ this.componentFactoryResolver = componentFactoryResolver;
868
+ this.viewContainerRef = viewContainerRef;
869
+ this.injector = injector;
870
+ }
871
+ Object.defineProperty(ActivityOutletComponent.prototype, "activityRef", {
872
+ get: function () {
873
+ return this._activityRef;
874
+ },
875
+ set: function (activityRef) {
876
+ if (this.activityRef && !this.activityRef.isComplete()) {
877
+ lang$1.illegalState("changing activity before previous one has completed");
878
+ }
879
+ this._activityRef = activityRef;
880
+ this.loadActivity(activityRef);
881
+ },
882
+ enumerable: true,
883
+ configurable: true
884
+ });
885
+ ;
886
+ ActivityOutletComponent.prototype.ngOnInit = function () {
887
+ };
888
+ ActivityOutletComponent.prototype.loadActivity = function (activityRef) {
889
+ var injector = Injector.create({
890
+ providers: [
891
+ { provide: ACTIVITY_DATA, useValue: activityRef.activityData }
892
+ ],
893
+ parent: this.injector
894
+ });
895
+ var componentFactory = this.componentFactoryResolver.resolveComponentFactory(activityRef.activityClass);
896
+ this.viewContainerRef.clear();
897
+ // console.log(`creating component -> ${activityRef.activityClass.name}`);
898
+ this.activityComponentRef = this.viewContainerRef.createComponent(componentFactory, 0, injector);
899
+ this.activityRef.notifyActivityCreated(this.activityComponentRef.instance, this.nestedInteractionContext);
900
+ };
901
+ Object.defineProperty(ActivityOutletComponent.prototype, "component", {
902
+ get: function () {
903
+ return this.activityComponentRef.instance;
904
+ },
905
+ enumerable: true,
906
+ configurable: true
907
+ });
908
+ ActivityOutletComponent.ctorParameters = function () { return [
909
+ { type: ComponentFactoryResolver },
910
+ { type: ViewContainerRef },
911
+ { type: Injector }
912
+ ]; };
729
913
  __decorate([
730
- Input(), TrackExternal({ delegateTo: "delegatingFormValueModel" }),
731
- __metadata("design:type", Object)
732
- ], SelectInputComponent.prototype, "valueModel", void 0);
733
- __decorate([
734
- Input(), TrackExternal(),
735
- __metadata("design:type", ListModel)
736
- ], SelectInputComponent.prototype, "optionsModel", void 0);
914
+ Input(),
915
+ __metadata("design:type", Object)
916
+ ], ActivityOutletComponent.prototype, "nestedInteractionContext", void 0);
737
917
  __decorate([
738
- Input(), StoreInListModel('optionsModel'),
739
- __metadata("design:type", Array)
740
- ], SelectInputComponent.prototype, "options", void 0);
918
+ Input(),
919
+ __metadata("design:type", ActivityRef),
920
+ __metadata("design:paramtypes", [ActivityRef])
921
+ ], ActivityOutletComponent.prototype, "activityRef", null);
922
+ ActivityOutletComponent = __decorate([
923
+ Component({
924
+ selector: 'aup-activity-outlet',
925
+ template: '',
926
+ styles: [":host{display:block}"]
927
+ }),
928
+ __metadata("design:paramtypes", [ComponentFactoryResolver,
929
+ ViewContainerRef,
930
+ Injector])
931
+ ], ActivityOutletComponent);
932
+ return ActivityOutletComponent;
933
+ }());
934
+
935
+ var ActivityContainerComponent = /** @class */ (function (_super) {
936
+ __extends(ActivityContainerComponent, _super);
937
+ function ActivityContainerComponent() {
938
+ var _this = _super.call(this) || this;
939
+ _this.dynamicHeight = false;
940
+ _this.activityTabs = [];
941
+ _this.garbage = new GarbageCollector();
942
+ return _this;
943
+ }
944
+ ActivityContainerComponent.prototype.ngOnInit = function () {
945
+ };
946
+ ActivityContainerComponent.prototype.ngAfterViewInit = function () {
947
+ var _this = this;
948
+ var _a = Dsl.disposeWith(this), chain = _a.chain, observe = _a.observe;
949
+ // using the component directly rather than (animationDone)=.. allows us
950
+ // to keep our callback private.
951
+ observe.valuesFrom(this.tabs.animationDone).subscribe(function () { return _this.onAnimationFinished(); });
952
+ };
953
+ ActivityContainerComponent.prototype.initialise = function (identifier, api) {
954
+ assert.isFalsey(this.isInitialised());
955
+ assert.notNil(identifier);
956
+ assert.notNil(api);
957
+ this._identifier = identifier;
958
+ this.interactionServiceApi = api;
959
+ };
960
+ Object.defineProperty(ActivityContainerComponent.prototype, "identifier", {
961
+ get: function () {
962
+ return this._identifier;
963
+ },
964
+ enumerable: true,
965
+ configurable: true
966
+ });
967
+ ActivityContainerComponent.prototype.isInitialised = function () {
968
+ return !!this.identifier;
969
+ };
970
+ /**
971
+ * Returns true if an activity is currently running.
972
+ */
973
+ ActivityContainerComponent.prototype.isActive = function () {
974
+ return this.getActiveActivityCount() > 0;
975
+ };
976
+ ActivityContainerComponent.prototype.registerDisposable = function (disposable) {
977
+ return this.garbage.registerDisposable(disposable);
978
+ };
979
+ ActivityContainerComponent.prototype.dispose = function () {
980
+ // TODO: think about auto cancelling any outstanding activity on dispose.
981
+ // See NavigationState.Navigating for a use-case.
982
+ assert.isFalsey(this.isActive());
983
+ this.garbage.dispose();
984
+ };
985
+ ActivityContainerComponent.prototype.getActiveActivityRef = function () {
986
+ if (!this.isActive()) {
987
+ lang$1.illegalState('no activity in progress');
988
+ }
989
+ return ___default.findLast(this.activityTabs, function (tab) { return !tab.isComplete(); });
990
+ };
991
+ /**
992
+ * Cancels the current activity and returns true the context is no longer active, false if
993
+ * there is still another activity running.
994
+ */
995
+ // @Trace()
996
+ ActivityContainerComponent.prototype.cancelActiveActivity = function () {
997
+ return __awaiter(this, void 0, void 0, function () {
998
+ var activity;
999
+ return __generator(this, function (_a) {
1000
+ activity = this.getActiveActivityRef();
1001
+ activity.cancel();
1002
+ if (this.isCleaningUp()) {
1003
+ return [2 /*return*/, this.waitForInteractionContextCleanupToFinish()];
1004
+ }
1005
+ else {
1006
+ return [2 /*return*/, !this.isActive()];
1007
+ }
1008
+ return [2 /*return*/];
1009
+ });
1010
+ });
1011
+ };
1012
+ // TODO: this handling of multiple nested activities is only used by the activity component and is not a general case.
1013
+ // @Trace()
1014
+ ActivityContainerComponent.prototype.createAndLaunchActivity = function (activityType, data, disableClose) {
1015
+ var _this = this;
1016
+ assert.isTruthy(this.isInitialised()); // make sure we've been initialised
1017
+ var activityRef = new ActivityRef(activityType, data, function () {
1018
+ var activeActivityCount = _this.getActiveActivityCount() > 0;
1019
+ if (activeActivityCount) {
1020
+ _this.triggerTabSynchronisation();
1021
+ }
1022
+ else {
1023
+ _this.finishAndStartCleanup();
1024
+ }
1025
+ });
1026
+ this.launchActivity(activityRef);
1027
+ // if this is the first activity let the interaction service know.
1028
+ if (this.activityTabs.length === 1) {
1029
+ // console.log('Now active!!!');
1030
+ this.interactionServiceApi.notifyActive(this);
1031
+ }
1032
+ return activityRef.activityResult;
1033
+ };
1034
+ ActivityContainerComponent.prototype.getActiveActivityCount = function () {
1035
+ return this.activityTabs.filter(function (ref) { return !ref.isComplete(); }).length;
1036
+ };
1037
+ /**
1038
+ * Checks if this interaction context has finished an is in the process of waiting
1039
+ * for all the infrastructure (including route updates) to be completed.
1040
+ */
1041
+ ActivityContainerComponent.prototype.isCleaningUp = function () {
1042
+ return !!this._deferredCleanUp;
1043
+ };
1044
+ ActivityContainerComponent.prototype.waitForInteractionContextCleanupToFinish = function () {
1045
+ return __awaiter(this, void 0, void 0, function () {
1046
+ return __generator(this, function (_a) {
1047
+ return [2 /*return*/, this._deferredCleanUp ?
1048
+ this._deferredCleanUp :
1049
+ true];
1050
+ });
1051
+ });
1052
+ };
1053
+ // @Trace()
1054
+ ActivityContainerComponent.prototype.finishAndStartCleanup = function () {
1055
+ var _this = this;
1056
+ if (!this._deferredCleanUp) {
1057
+ // Important:
1058
+ // Clear our tabs so the next activity triggers a tab change.
1059
+ // Without this our animation done wasn't called when a single
1060
+ // new activity followed a single tab activity (since we're tracking
1061
+ // by activity index)
1062
+ this.activityTabs = [];
1063
+ var promise = this.interactionServiceApi.notifyFinished(this);
1064
+ this._deferredCleanUp = promise
1065
+ .finally(function () {
1066
+ _this._deferredCleanUp = null;
1067
+ });
1068
+ }
1069
+ };
1070
+ // @Trace()
1071
+ ActivityContainerComponent.prototype.launchActivity = function (activityRef) {
1072
+ var cleanedTabs = this.activityTabs.filter(function (tab) { return !tab.isComplete(); });
1073
+ this.activityTabs = cleanedTabs.concat(activityRef);
1074
+ this.synchroniseSelectedTabIndex();
1075
+ };
1076
+ ActivityContainerComponent.prototype.activityIndex = function (index, activityRef) {
1077
+ return index;
1078
+ };
1079
+ ;
1080
+ ActivityContainerComponent.prototype.onAnimationFinished = function () {
1081
+ if (this.onAnimationFinishedJob) {
1082
+ this.onAnimationFinishedJob();
1083
+ this.onAnimationFinishedJob = undefined;
1084
+ }
1085
+ };
1086
+ /**
1087
+ * Synchronises the selected tab index.
1088
+ */
1089
+ ActivityContainerComponent.prototype.synchroniseSelectedTabIndex = function () {
1090
+ var _this = this;
1091
+ var previousIndex = this.tabs.selectedIndex;
1092
+ var newIndex = this.getActiveActivityCount() - 1;
1093
+ if (previousIndex !== newIndex) {
1094
+ this.tabs.selectedIndex = newIndex;
1095
+ this.onAnimationFinishedJob = function () {
1096
+ _this.getSelectedOutlet().component.onActivityReady();
1097
+ _this.activityTabs = _this.activityTabs.filter(function (tab) { return !tab.isComplete(); });
1098
+ };
1099
+ }
1100
+ };
1101
+ ActivityContainerComponent.prototype.getSelectedOutlet = function () {
1102
+ return this.activityOutlets.toArray()[this.tabs.selectedIndex];
1103
+ };
1104
+ // @Trace()
1105
+ ActivityContainerComponent.prototype.triggerTabSynchronisation = function () {
1106
+ var _this = this;
1107
+ if (this.syncSelectedTabTimeout) {
1108
+ clearTimeout(this.syncSelectedTabTimeout);
1109
+ }
1110
+ this.syncSelectedTabTimeout = setTimeout(function () {
1111
+ _this.syncSelectedTabTimeout = null;
1112
+ _this.synchroniseSelectedTabIndex();
1113
+ }, 75);
1114
+ };
741
1115
  __decorate([
742
1116
  Input(),
743
1117
  __metadata("design:type", Object)
744
- ], SelectInputComponent.prototype, "optionLabel", void 0);
1118
+ ], ActivityContainerComponent.prototype, "dynamicHeight", void 0);
1119
+ __decorate([
1120
+ ViewChild('tabs', { static: true }),
1121
+ __metadata("design:type", MatTabGroup)
1122
+ ], ActivityContainerComponent.prototype, "tabs", void 0);
1123
+ __decorate([
1124
+ ViewChildren(ActivityOutletComponent),
1125
+ __metadata("design:type", QueryList)
1126
+ ], ActivityContainerComponent.prototype, "activityOutlets", void 0);
1127
+ __decorate([
1128
+ Trace(),
1129
+ __metadata("design:type", Function),
1130
+ __metadata("design:paramtypes", []),
1131
+ __metadata("design:returntype", void 0)
1132
+ ], ActivityContainerComponent.prototype, "dispose", null);
1133
+ ActivityContainerComponent = __decorate([
1134
+ Component({
1135
+ selector: 'aup-activity-container',
1136
+ template: "<mat-tab-group #tabs no-tab-header\n [dynamicHeight]=\"dynamicHeight\"\n [class.full-height-tabs]=\"!dynamicHeight\">\n <mat-tab *ngFor=\"let tab of activityTabs; trackBy: activityIndex\" >\n <aup-activity-outlet [nestedInteractionContext]=\"this\" [activityRef]=\"tab\"></aup-activity-outlet>\n </mat-tab>\n</mat-tab-group>\n",
1137
+ styles: [":host{display:flex;flex-direction:column}mat-tab-group{flex:1}"]
1138
+ }),
1139
+ __metadata("design:paramtypes", [])
1140
+ ], ActivityContainerComponent);
1141
+ return ActivityContainerComponent;
1142
+ }(AbstractInteractionContext));
1143
+
1144
+ var AddItemInteractionContextComponent = /** @class */ (function (_super) {
1145
+ __extends(AddItemInteractionContextComponent, _super);
1146
+ function AddItemInteractionContextComponent() {
1147
+ var _this = _super.call(this) || this;
1148
+ _this.tabindex = 0;
1149
+ _this.clickCommand = Command.create(function (context) {
1150
+ if (_this.activityClass) {
1151
+ _this.startActivity(_this.activityClass, _this.activityData).catch(function (e) {
1152
+ // don't care.
1153
+ });
1154
+ }
1155
+ else {
1156
+ _this.addCommand.withContext(context).execute();
1157
+ }
1158
+ });
1159
+ return _this;
1160
+ }
1161
+ Object.defineProperty(AddItemInteractionContextComponent.prototype, "active", {
1162
+ get: function () {
1163
+ return this.interactionContext ? this.interactionContext.isActive() : false;
1164
+ },
1165
+ enumerable: true,
1166
+ configurable: true
1167
+ });
1168
+ AddItemInteractionContextComponent.prototype.startActivity = function (activityType, data) {
1169
+ return this.interactionContext.startActivity(activityType, data);
1170
+ };
1171
+ AddItemInteractionContextComponent.prototype.ngOnInit = function () {
1172
+ };
1173
+ __decorate([
1174
+ Input(),
1175
+ __metadata("design:type", String)
1176
+ ], AddItemInteractionContextComponent.prototype, "label", void 0);
1177
+ __decorate([
1178
+ Input(),
1179
+ __metadata("design:type", Object)
1180
+ ], AddItemInteractionContextComponent.prototype, "activityClass", void 0);
1181
+ __decorate([
1182
+ Input(),
1183
+ __metadata("design:type", Object)
1184
+ ], AddItemInteractionContextComponent.prototype, "activityData", void 0);
745
1185
  __decorate([
746
1186
  Input(),
747
- __metadata("design:type", Boolean)
748
- ], SelectInputComponent.prototype, "allowNil", void 0);
1187
+ TrackExternal(),
1188
+ __metadata("design:type", Command)
1189
+ ], AddItemInteractionContextComponent.prototype, "addCommand", void 0);
749
1190
  __decorate([
750
- ContentChild("optionTemplate"),
751
- __metadata("design:type", TemplateRef)
752
- ], SelectInputComponent.prototype, "optionTemplateRef", void 0);
1191
+ ViewChild(InPlaceInteractionContextComponent),
1192
+ __metadata("design:type", InPlaceInteractionContextComponent)
1193
+ ], AddItemInteractionContextComponent.prototype, "interactionContext", void 0);
753
1194
  __decorate([
754
- ContentChild("nilOptionTemplate"),
755
- __metadata("design:type", TemplateRef)
756
- ], SelectInputComponent.prototype, "nilOptionTemplateRef", void 0);
1195
+ HostBinding('class.interaction-active'),
1196
+ __metadata("design:type", Boolean),
1197
+ __metadata("design:paramtypes", [])
1198
+ ], AddItemInteractionContextComponent.prototype, "active", null);
757
1199
  __decorate([
758
- Input(),
759
- __metadata("design:type", Function)
760
- ], SelectInputComponent.prototype, "optionLabelFormat", void 0);
761
- SelectInputComponent = __decorate([
1200
+ HostBinding('tabindex'),
1201
+ __metadata("design:type", Object)
1202
+ ], AddItemInteractionContextComponent.prototype, "tabindex", void 0);
1203
+ AddItemInteractionContextComponent = __decorate([
762
1204
  Component({
763
- selector: 'aup-select-input',
764
- 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",
765
- styles: [":host{display:inline-block}mat-form-field{width:100%}"]
1205
+ selector: 'aup-add-item-interaction-context',
1206
+ template: "<aup-in-place-interaction-context #interactionContext [animateFirstActivity]=\"false\">\n <a part=\"link\" class=\"link\" [pectinCommand]=\"clickCommand\"><mat-icon>add</mat-icon> {{label}}</a>\n</aup-in-place-interaction-context>\n",
1207
+ styles: [":host{--def-link-color:var(--link-color, currentColor);--def-link-backgound:var(--link-background, rgba(0, 0, 0, 0.05));--def-link-border-radius:var(--link-border-radius, 4px);--def-link-padding:var(--link-padding, calc(var(--aup-default-padding) / 2));display:flex;flex-direction:column;border-radius:var(--def-link-border-radius);box-sizing:border-box;outline:0}:host:hover{--link-background:rgba(0,0,0,0.1)}aup-in-place-interaction-context{border-radius:var(--def-link-border-radius)}a.link{display:flex;flex-direction:row;align-items:center;border-radius:var(--def-link-border-radius);color:var(--def-link-color);background:var(--def-link-backgound);padding:var(--def-link-padding);cursor:pointer;text-decoration:none}a.link mat-icon{margin-right:8px}"]
766
1208
  }),
767
1209
  __metadata("design:paramtypes", [])
768
- ], SelectInputComponent);
769
- return SelectInputComponent;
770
- }(AbstractInputComponent));
1210
+ ], AddItemInteractionContextComponent);
1211
+ return AddItemInteractionContextComponent;
1212
+ }(DisposableComponent));
771
1213
 
772
- var StringInputComponent = /** @class */ (function (_super) {
773
- __extends(StringInputComponent, _super);
774
- function StringInputComponent() {
775
- var _this = _super.call(this) || this;
776
- var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
777
- _this.clearCommand = Command.create(function () {
778
- _this.valueModel.value = null;
779
- });
780
- _this.clearCommand.disableWhile(chain.stringValue(_this.valueModel).isBlank());
781
- return _this;
1214
+ var InteractionServiceRoutingAdapter = /** @class */ (function () {
1215
+ function InteractionServiceRoutingAdapter(activeInteractionContextIds, activeModalContext, createExclusiveInteractionContext) {
1216
+ this.activeInteractionContextIds = activeInteractionContextIds;
1217
+ this.activeModalContext = activeModalContext;
1218
+ this.createExclusiveInteractionContext = createExclusiveInteractionContext;
782
1219
  }
783
- StringInputComponent.prototype.ngOnInit = function () {
1220
+ InteractionServiceRoutingAdapter.prototype.isActive = function () {
1221
+ return this.getActiveInteractionContextIds().length > 0;
784
1222
  };
785
- __decorate([
786
- Input(), TrackExternal({ delegateTo: 'delegatingFormValueModel' }),
787
- __metadata("design:type", Object)
788
- ], StringInputComponent.prototype, "valueModel", void 0);
789
- __decorate([
790
- Input(), TrackExternal({ defaultValue: false }),
791
- __metadata("design:type", ValueModel)
792
- ], StringInputComponent.prototype, "enableClearModel", void 0);
793
- __decorate([
794
- Input(), StoreInValueModel('enableClearModel'),
795
- __metadata("design:type", Boolean)
796
- ], StringInputComponent.prototype, "enableClear", void 0);
797
- StringInputComponent = __decorate([
798
- Component({
799
- selector: 'aup-string-input',
800
- 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",
801
- 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}"]
1223
+ InteractionServiceRoutingAdapter.prototype.isModalActive = function () {
1224
+ return !!this.activeModalContext.value;
1225
+ };
1226
+ // @Trace()
1227
+ InteractionServiceRoutingAdapter.prototype.isComponentInteracting = function (component) {
1228
+ return component.interactionContext && component.interactionContext.isActive();
1229
+ };
1230
+ InteractionServiceRoutingAdapter.prototype.getActiveInteractionContextIds = function () {
1231
+ return this.activeInteractionContextIds.value;
1232
+ };
1233
+ // @Trace()
1234
+ InteractionServiceRoutingAdapter.prototype.cancelCurrentModalInteraction = function () {
1235
+ return this.activeModalContext.value.cancelActiveActivity();
1236
+ };
1237
+ // @Trace()
1238
+ InteractionServiceRoutingAdapter.prototype.cancelComponentInteraction = function (component) {
1239
+ return component.interactionContext.cancelActiveActivity();
1240
+ };
1241
+ return InteractionServiceRoutingAdapter;
1242
+ }());
1243
+
1244
+ var ModalInteractionContextFactory = /** @class */ (function () {
1245
+ function ModalInteractionContextFactory() {
1246
+ }
1247
+ return ModalInteractionContextFactory;
1248
+ }());
1249
+
1250
+ var inplaceMonitorCount = 0;
1251
+ var InteractionService = /** @class */ (function () {
1252
+ function InteractionService(modelInteractionContextFactory) {
1253
+ this.modelInteractionContextFactory = modelInteractionContextFactory;
1254
+ this.garbage = new GarbageCollector();
1255
+ // private readonly _activeModalContext = new MutableValueModel<InteractionContext>();
1256
+ // private readonly _activeInlineContext = new MutableValueModel<InteractionContext>();
1257
+ // private readonly _activeContext: ValueModelChain<InteractionContext>;
1258
+ this._navigationInProgress = new DelegatingValueModel().withDefault(false);
1259
+ var _a = Dsl.disposeWith(this.garbage), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
1260
+ this.exclusiveInteractionRegistry = new InteractionService_1.ContextRegistry();
1261
+ this.modalInteractionRegistry = new InteractionService_1.ContextRegistry();
1262
+ this.inPlaceInteractionRegistry = new InteractionService_1.ContextRegistry();
1263
+ this.modalInteractionRegistry.disableWhen(valueOf.any(this.exclusiveInteractionRegistry.active, this.modalInteractionRegistry.active).areTruthy());
1264
+ this.inPlaceInteractionRegistry.disableWhen(valueOf.any(this.exclusiveInteractionRegistry.active, this.modalInteractionRegistry.active, this.inPlaceInteractionRegistry.active).areTruthy());
1265
+ this.active = valueOf.any(this.inPlaceInteractionRegistry.active, this.modalInteractionRegistry.active).areTruthy();
1266
+ // TODO: chain.concat(listOrValueModels) would be nice.
1267
+ this.activeInteractionContextIds = chain(this.inPlaceInteractionRegistry.interactionContextIds)
1268
+ .concat(this.modalInteractionRegistry.interactionContextIds);
1269
+ this.activeModalContext = chain(this.modalInteractionRegistry.interactionContexts).first();
1270
+ this.inModalInteraction = chain(this.activeModalContext).isNotNil();
1271
+ }
1272
+ InteractionService_1 = InteractionService;
1273
+ InteractionService.prototype.isActive = function () {
1274
+ return this.active.value;
1275
+ };
1276
+ /**
1277
+ * @deprecated use #createModalInteractionContextDisposedWith instead.
1278
+ * @param disposable
1279
+ */
1280
+ InteractionService.prototype.createModalInteractionContextFor = function (disposable) {
1281
+ return this.createModalInteractionContextDisposedWith(disposable);
1282
+ };
1283
+ /**
1284
+ * Creates a new model interaction context that will be disposed along with the component.
1285
+ * @param disposable
1286
+ */
1287
+ InteractionService.prototype.createModalInteractionContextDisposedWith = function (disposable) {
1288
+ // TODO: look at making the registry the factory..
1289
+ return this.modelInteractionContextFactory.createInteractionContext('modal', new InteractionService_1.ApiAdapter(this.placeRouter, this.modalInteractionRegistry));
1290
+ };
1291
+ InteractionService.prototype.registerInplaceInteractionContext = function (interactionContext) {
1292
+ // TODO: look at making the registry the factory..
1293
+ // Todo: check for double registration.
1294
+ // Todo: allow multiple inplace interactions..
1295
+ interactionContext.initialise("ip" + ++inplaceMonitorCount, new InteractionService_1.ApiAdapter(this.placeRouter, this.inPlaceInteractionRegistry));
1296
+ };
1297
+ /**
1298
+ * Creates an interaction context that will prevent any other contexts from starting an
1299
+ * activity until it is disposed. This is intended for use by the router for passing
1300
+ * to PlaceComponent.canDeactivate(interactionContext). This ensures components don't
1301
+ * try and interact in a way that we can't track and synchronise with the browser back
1302
+ * button.
1303
+ */
1304
+ InteractionService.prototype.registerPlaceRouter = function (router) {
1305
+ var _this = this;
1306
+ assert$1.isFalsey(this.placeRouter);
1307
+ this.placeRouter = router;
1308
+ this._navigationInProgress.setDelegate(this.placeRouter.navigationInProgress);
1309
+ var self = this;
1310
+ return new InteractionServiceRoutingAdapter(this.activeInteractionContextIds, this.activeModalContext, function () {
1311
+ return self.modelInteractionContextFactory.createInteractionContext('exclusive', new InteractionService_1.ApiAdapter(_this.placeRouter, _this.exclusiveInteractionRegistry));
1312
+ });
1313
+ };
1314
+ var InteractionService_1;
1315
+ InteractionService.ctorParameters = function () { return [
1316
+ { type: ModalInteractionContextFactory }
1317
+ ]; };
1318
+ InteractionService.ɵprov = ɵɵdefineInjectable({ factory: function InteractionService_Factory() { return new InteractionService(ɵɵinject(ModalInteractionContextFactory)); }, token: InteractionService, providedIn: "root" });
1319
+ InteractionService = InteractionService_1 = __decorate([
1320
+ Injectable({
1321
+ providedIn: 'root'
802
1322
  }),
803
- __metadata("design:paramtypes", [])
804
- ], StringInputComponent);
805
- return StringInputComponent;
806
- }(AbstractInputComponent));
1323
+ __metadata("design:paramtypes", [ModalInteractionContextFactory])
1324
+ ], InteractionService);
1325
+ return InteractionService;
1326
+ }());
1327
+ (function (InteractionService) {
1328
+ /**
1329
+ * Provides a mechanism for the service to keep track of what the API adapters are doing to
1330
+ * ensure the rules are followed, i.e. modal or in-place interaction aren't started while
1331
+ * an exclusive routing interaction is active.
1332
+ */
1333
+ var ContextRegistry = /** @class */ (function (_super) {
1334
+ __extends(ContextRegistry, _super);
1335
+ function ContextRegistry() {
1336
+ var _this = _super.call(this) || this;
1337
+ _this._interactions = new MutableListModel();
1338
+ _this._disabledDelegate = new DelegatingValueModel().withDefault(false);
1339
+ var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
1340
+ _this.active = chain(_this._interactions).isNotEmpty();
1341
+ _this.interactionContextIds = chain(_this._interactions).pluck("identifier");
1342
+ return _this;
1343
+ }
1344
+ Object.defineProperty(ContextRegistry.prototype, "interactionContexts", {
1345
+ get: function () {
1346
+ return this._interactions.readonly;
1347
+ },
1348
+ enumerable: true,
1349
+ configurable: true
1350
+ });
1351
+ ContextRegistry.prototype.start = function (context) {
1352
+ this._interactions.push(context);
1353
+ };
1354
+ ContextRegistry.prototype.finish = function (context) {
1355
+ this._interactions.remove(context);
1356
+ };
1357
+ ContextRegistry.prototype.isActive = function () {
1358
+ return this.active.value;
1359
+ };
1360
+ ContextRegistry.prototype.disableWhen = function (disabled) {
1361
+ this._disabledDelegate.setDelegate(disabled);
1362
+ };
1363
+ return ContextRegistry;
1364
+ }(GarbageCollector));
1365
+ InteractionService.ContextRegistry = ContextRegistry;
1366
+ var ApiAdapter = /** @class */ (function () {
1367
+ function ApiAdapter(placeRouter, contextRegistry) {
1368
+ this.placeRouter = placeRouter;
1369
+ this.contextRegistry = contextRegistry;
1370
+ }
1371
+ // @Trace()
1372
+ ApiAdapter.prototype.notifyActive = function (context) {
1373
+ assert$1.isTruthy(context.identifier);
1374
+ this.contextRegistry.start(context);
1375
+ return this.isNavigationInProgress() ? Promise.resolve() : this.placeRouter.syncInteractionContextIdsWithRouter();
1376
+ };
1377
+ // @Trace()
1378
+ ApiAdapter.prototype.isNavigationInProgress = function () {
1379
+ return this.placeRouter.navigationInProgress.value;
1380
+ };
1381
+ // @Trace()
1382
+ ApiAdapter.prototype.notifyFinished = function (context) {
1383
+ this.contextRegistry.finish(context);
1384
+ // :: Important ::
1385
+ // This method will be traversed by both the place router (during can canDeactivate guards) and user land code
1386
+ // (both when routing is idle and while it is active in PlaceComponent.canDeactivate()).
1387
+ // The result of pushInteractionIdsToRoute will not start until after the current route finishes, and the
1388
+ // current route won't finish until after this promise returns... Deadlock.
1389
+ // So in order to keep this logic out of the activities we perform the check here and ensure that
1390
+ // any interactions with the context while routing is active returns immediately.
1391
+ return this.isNavigationInProgress() ? Promise.resolve() : this.placeRouter.syncInteractionContextIdsWithRouter();
1392
+ };
1393
+ return ApiAdapter;
1394
+ }());
1395
+ InteractionService.ApiAdapter = ApiAdapter;
1396
+ })(InteractionService || (InteractionService = {}));
807
1397
 
808
- var TextInputComponent = /** @class */ (function (_super) {
809
- __extends(TextInputComponent, _super);
810
- function TextInputComponent() {
1398
+ var InPlaceInteractionContextComponent = /** @class */ (function (_super) {
1399
+ __extends(InPlaceInteractionContextComponent, _super);
1400
+ function InPlaceInteractionContextComponent(interactionService, tabConfig) {
811
1401
  var _this = _super.call(this) || this;
812
- _this.rows = 2;
1402
+ _this.interactionService = interactionService;
1403
+ _this.tabConfig = tabConfig;
1404
+ /**
1405
+ * If true then the first startActivity call will slide the activity into view. If false
1406
+ * the activity will replace the existing content immediately.
1407
+ */
1408
+ _this.animateFirstActivity = true;
813
1409
  return _this;
814
- // const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
815
1410
  }
816
- TextInputComponent.prototype.ngOnInit = function () {
1411
+ Object.defineProperty(InPlaceInteractionContextComponent.prototype, "animationDuration", {
1412
+ get: function () {
1413
+ var _a;
1414
+ return this.animateFirstActivity ? (((_a = this.tabConfig) === null || _a === void 0 ? void 0 : _a.animationDuration) || '500ms') : "0ms";
1415
+ },
1416
+ enumerable: true,
1417
+ configurable: true
1418
+ });
1419
+ InPlaceInteractionContextComponent.prototype.ngAfterViewInit = function () {
1420
+ this.interactionService.registerInplaceInteractionContext(this);
817
1421
  };
818
- __decorate([
819
- Input(), TrackExternal({ delegateTo: 'delegatingFormValueModel' }),
820
- __metadata("design:type", Object)
821
- ], TextInputComponent.prototype, "valueModel", void 0);
822
- __decorate([
823
- Input(),
824
- __metadata("design:type", Object)
825
- ], TextInputComponent.prototype, "rows", void 0);
826
- __decorate([
827
- Input(),
828
- __metadata("design:type", Number)
829
- ], TextInputComponent.prototype, "cols", void 0);
830
- TextInputComponent = __decorate([
831
- Component({
832
- selector: 'aup-text-input',
833
- template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <textarea 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 [rows]=\"rows\"\n [cols]=\"cols\"\n >\n </textarea>\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
834
- 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}textarea{overflow:auto}"]
835
- }),
836
- __metadata("design:paramtypes", [])
837
- ], TextInputComponent);
838
- return TextInputComponent;
839
- }(AbstractInputComponent));
840
-
841
- var NoopComponent = /** @class */ (function () {
842
- function NoopComponent() {
843
- }
844
- NoopComponent = __decorate([
845
- Component({
846
- selector: 'aup-noop',
847
- template: "",
848
- styles: [":host{display:block}"]
849
- }),
850
- __metadata("design:paramtypes", [])
851
- ], NoopComponent);
852
- return NoopComponent;
853
- }());
854
-
855
- var ScrollContainerComponent = /** @class */ (function () {
856
- function ScrollContainerComponent() {
857
- }
858
- ScrollContainerComponent.prototype.ngOnInit = function () {
1422
+ InPlaceInteractionContextComponent.prototype.initialise = function (id, api) {
1423
+ this.activityContainerComponent.initialise(id, api);
859
1424
  };
860
- ScrollContainerComponent = __decorate([
861
- Component({
862
- selector: 'aup-scroll-container',
863
- template: "<div class=\"container\">\n <ng-content></ng-content>\n</div>\n",
864
- styles: [":host{display:flex;flex-direction:column;min-height:0;align-items:stretch}.container{display:flex;flex-direction:column;flex:1;flex-basis:0;overflow-y:scroll;align-items:stretch}"]
865
- }),
866
- __metadata("design:paramtypes", [])
867
- ], ScrollContainerComponent);
868
- return ScrollContainerComponent;
869
- }());
870
-
871
- var SwitchCaseOption = /** @class */ (function () {
872
- function SwitchCaseOption(templateRef) {
873
- this.templateRef = templateRef;
874
- }
875
- Object.defineProperty(SwitchCaseOption.prototype, "name", {
1425
+ Object.defineProperty(InPlaceInteractionContextComponent.prototype, "identifier", {
876
1426
  get: function () {
877
- return this.constructor.name;
1427
+ return this.activityContainerComponent.identifier;
878
1428
  },
879
1429
  enumerable: true,
880
1430
  configurable: true
881
1431
  });
882
- return SwitchCaseOption;
883
- }());
884
- var SwitchCaseWhenDirective = /** @class */ (function (_super) {
885
- __extends(SwitchCaseWhenDirective, _super);
886
- function SwitchCaseWhenDirective(templateRef) {
887
- var _this = _super.call(this, templateRef) || this;
888
- _this.isDefault = false;
889
- return _this;
890
- }
891
- SwitchCaseWhenDirective_1 = SwitchCaseWhenDirective;
892
- SwitchCaseWhenDirective.prototype.matches = function (value) {
893
- return this.aupSwitchCaseWhen === value;
1432
+ InPlaceInteractionContextComponent.prototype.alert = function (alert) {
1433
+ return this.activityContainerComponent.alert(alert);
894
1434
  };
895
- var SwitchCaseWhenDirective_1;
896
- SwitchCaseWhenDirective.ctorParameters = function () { return [
897
- { type: TemplateRef }
1435
+ InPlaceInteractionContextComponent.prototype.cancelActiveActivity = function () {
1436
+ return this.activityContainerComponent.cancelActiveActivity();
1437
+ };
1438
+ InPlaceInteractionContextComponent.prototype.confirm = function (confirm) {
1439
+ return this.activityContainerComponent.confirm(confirm);
1440
+ };
1441
+ InPlaceInteractionContextComponent.prototype.confirmOrReject = function (confirm) {
1442
+ return this.activityContainerComponent.confirmOrReject(confirm);
1443
+ };
1444
+ InPlaceInteractionContextComponent.prototype.confirmThen = function (confirm, activityType, data) {
1445
+ return this.activityContainerComponent.confirmThen(confirm, activityType);
1446
+ };
1447
+ InPlaceInteractionContextComponent.prototype.isActive = function () {
1448
+ return this.activityContainerComponent.isActive();
1449
+ };
1450
+ InPlaceInteractionContextComponent.prototype.startActivity = function (activityType, data) {
1451
+ return this.activityContainerComponent.startActivity(activityType, data);
1452
+ };
1453
+ InPlaceInteractionContextComponent.ctorParameters = function () { return [
1454
+ { type: InteractionService },
1455
+ { type: undefined, decorators: [{ type: Inject, args: [MAT_TABS_CONFIG,] }, { type: Optional }] }
898
1456
  ]; };
1457
+ __decorate([
1458
+ ViewChild('activityContainer', { static: true }),
1459
+ __metadata("design:type", ActivityContainerComponent)
1460
+ ], InPlaceInteractionContextComponent.prototype, "activityContainerComponent", void 0);
899
1461
  __decorate([
900
1462
  Input(),
901
1463
  __metadata("design:type", Object)
902
- ], SwitchCaseWhenDirective.prototype, "aupSwitchCaseWhen", void 0);
903
- SwitchCaseWhenDirective = SwitchCaseWhenDirective_1 = __decorate([
904
- Directive({
905
- selector: '[aupSwitchCaseWhen]',
906
- providers: [{ provide: SwitchCaseOption, useExisting: SwitchCaseWhenDirective_1 }]
907
- }),
908
- __metadata("design:paramtypes", [TemplateRef])
909
- ], SwitchCaseWhenDirective);
910
- return SwitchCaseWhenDirective;
911
- }(SwitchCaseOption));
912
- var SwitchCaseDefaultDirective = /** @class */ (function (_super) {
913
- __extends(SwitchCaseDefaultDirective, _super);
914
- function SwitchCaseDefaultDirective(templateRef) {
915
- var _this = _super.call(this, templateRef) || this;
916
- _this.isDefault = true;
917
- return _this;
918
- }
919
- SwitchCaseDefaultDirective_1 = SwitchCaseDefaultDirective;
920
- SwitchCaseDefaultDirective.prototype.matches = function (value) {
921
- return false;
922
- };
923
- var SwitchCaseDefaultDirective_1;
924
- SwitchCaseDefaultDirective.ctorParameters = function () { return [
925
- { type: TemplateRef }
926
- ]; };
927
- SwitchCaseDefaultDirective = SwitchCaseDefaultDirective_1 = __decorate([
928
- Directive({
929
- selector: '[aupSwitchCaseDefault]',
930
- providers: [{ provide: SwitchCaseOption, useExisting: SwitchCaseDefaultDirective_1 }]
1464
+ ], InPlaceInteractionContextComponent.prototype, "animateFirstActivity", void 0);
1465
+ InPlaceInteractionContextComponent = __decorate([
1466
+ Component({
1467
+ selector: 'aup-in-place-interaction-context',
1468
+ template: "<mat-tab-group no-tab-header [selectedIndex]=\"isActive() ? 1 : 0\" full-height-tabs [dynamicHeight]=\"false\" [animationDuration]=\"animationDuration\">\n <mat-tab>\n <ng-content></ng-content>\n </mat-tab>\n <mat-tab>\n <aup-activity-container #activityContainer [dynamicHeight]=\"false\"></aup-activity-container>\n </mat-tab>\n</mat-tab-group>\n\n",
1469
+ styles: [":host{display:flex;flex-direction:column}mat-tab-group{flex:1}"]
931
1470
  }),
932
- __metadata("design:paramtypes", [TemplateRef])
933
- ], SwitchCaseDefaultDirective);
934
- return SwitchCaseDefaultDirective;
935
- }(SwitchCaseOption));
936
- var SwitchCaseComponent = /** @class */ (function (_super) {
937
- __extends(SwitchCaseComponent, _super);
938
- function SwitchCaseComponent(cdr) {
1471
+ __param(1, Inject(MAT_TABS_CONFIG)), __param(1, Optional()),
1472
+ __metadata("design:paramtypes", [InteractionService, Object])
1473
+ ], InPlaceInteractionContextComponent);
1474
+ return InPlaceInteractionContextComponent;
1475
+ }(DisposableComponent));
1476
+
1477
+ var PopupInteractionContextComponent = /** @class */ (function (_super) {
1478
+ __extends(PopupInteractionContextComponent, _super);
1479
+ function PopupInteractionContextComponent(_element, _overlay) {
939
1480
  var _this = _super.call(this) || this;
940
- _this.cdr = cdr;
941
- _this.selectedIndex = 0;
1481
+ _this._element = _element;
1482
+ _this._overlay = _overlay;
1483
+ _this.outputPortal = new ComponentPortal(InPlaceInteractionContextComponent);
1484
+ _this.anchorX = 'start';
1485
+ _this.anchorY = 'bottom';
942
1486
  return _this;
943
1487
  }
944
- SwitchCaseComponent.prototype.ngOnInit = function () {
945
- };
946
- SwitchCaseComponent.prototype.ngAfterContentInit = function () {
947
- var _this = this;
948
- var subscription = this.switchCaseOptions.changes.subscribe(function (change) { return _this.updateSelection(); });
949
- this.onDispose(function () { return subscription.unsubscribe(); });
950
- var _a = Dsl.disposeWith(this), chain = _a.chain, when = _a.when;
951
- when.valueOf(this.switchModel).changes(function () { return _this.updateSelection(); }, { initialValue: 'triggerChange' });
952
- this.cdr.detectChanges();
953
- };
954
- SwitchCaseComponent.prototype.updateSelection = function () {
1488
+ Object.defineProperty(PopupInteractionContextComponent.prototype, "active", {
1489
+ get: function () {
1490
+ return this.isActive();
1491
+ },
1492
+ enumerable: true,
1493
+ configurable: true
1494
+ });
1495
+ PopupInteractionContextComponent.prototype.startActivity = function (activityType, data) {
955
1496
  var _this = this;
956
- var matchingIndicies = [];
957
- this.switchCaseOptions.forEach(function (option, index) {
958
- if (option.matches(_this.switchModel.value)) {
959
- matchingIndicies.push(index);
960
- }
1497
+ var overlayRef = this._overlay.create({
1498
+ hasBackdrop: false,
1499
+ panelClass: 'aup-popup-interaction-panel',
1500
+ positionStrategy: this._overlay.position()
1501
+ .flexibleConnectedTo(this._element)
1502
+ .withPositions(this.computePositions())
1503
+ .withGrowAfterOpen(true)
961
1504
  });
962
- if (matchingIndicies.length > 1) {
963
- console.warn("found " + matchingIndicies.length + " matching case values, displaying the first.");
964
- }
965
- if (matchingIndicies.length === 0) {
966
- this.switchCaseOptions.forEach(function (option, index) {
967
- matchingIndicies.push(index);
1505
+ var componentRef = overlayRef.attach(this.outputPortal);
1506
+ this.interactionContext = componentRef.instance;
1507
+ return new Promise(function (resolve, reject) {
1508
+ // HACK: afterViewInit won't have been called yet. Need to add when.valueOf(interactionContext.ready).becomesTruthy(...)
1509
+ setTimeout(function () {
1510
+ _this.interactionContext.startActivity(activityType, data)
1511
+ .then(resolve)
1512
+ .catch(reject)
1513
+ .finally(function () { return overlayRef.dispose(); });
968
1514
  });
969
- if (matchingIndicies.length > 1) {
970
- console.warn("found " + matchingIndicies.length + " default case values, displaying the first.");
971
- }
972
- }
973
- if (matchingIndicies.length > 0) {
974
- this.selectedIndex = matchingIndicies[0];
975
- }
976
- else {
977
- console.warn("found no matching or default case values.");
978
- this.selectedIndex = -1;
979
- }
1515
+ });
980
1516
  };
981
- SwitchCaseComponent.ctorParameters = function () { return [
982
- { type: ChangeDetectorRef }
1517
+ PopupInteractionContextComponent.prototype.computePositions = function () {
1518
+ var overlayX = this.anchorX === 'start' ? 'start' : 'end';
1519
+ var overlayY = this.anchorY === 'top' ? 'bottom' : 'top';
1520
+ return [
1521
+ { originX: this.anchorX, originY: this.anchorY, overlayX: overlayX, overlayY: overlayY }
1522
+ // TODO: compute some meaningful alternatives.
1523
+ // { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },
1524
+ // { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' },
1525
+ // { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },
1526
+ // { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom' }
1527
+ ];
1528
+ };
1529
+ PopupInteractionContextComponent.prototype.cancelActiveActivity = function () {
1530
+ return this.interactionContext.cancelActiveActivity();
1531
+ };
1532
+ PopupInteractionContextComponent.prototype.isActive = function () {
1533
+ return this.interactionContext && this.interactionContext.isActive();
1534
+ };
1535
+ PopupInteractionContextComponent.prototype.ngOnInit = function () {
1536
+ };
1537
+ PopupInteractionContextComponent.ctorParameters = function () { return [
1538
+ { type: ElementRef },
1539
+ { type: Overlay }
983
1540
  ]; };
984
1541
  __decorate([
985
- Input(), TrackExternal(),
986
- __metadata("design:type", ValueModel)
987
- ], SwitchCaseComponent.prototype, "switchModel", void 0);
1542
+ HostBinding('class.interaction-active'),
1543
+ __metadata("design:type", Boolean),
1544
+ __metadata("design:paramtypes", [])
1545
+ ], PopupInteractionContextComponent.prototype, "active", null);
988
1546
  __decorate([
989
- Input(), StoreInValueModel('switchModel'),
990
- __metadata("design:type", Object)
991
- ], SwitchCaseComponent.prototype, "switch", void 0);
1547
+ Input(),
1548
+ __metadata("design:type", String)
1549
+ ], PopupInteractionContextComponent.prototype, "anchorX", void 0);
992
1550
  __decorate([
993
- ContentChildren(SwitchCaseOption),
994
- __metadata("design:type", QueryList)
995
- ], SwitchCaseComponent.prototype, "switchCaseOptions", void 0);
996
- SwitchCaseComponent = __decorate([
1551
+ Input(),
1552
+ __metadata("design:type", String)
1553
+ ], PopupInteractionContextComponent.prototype, "anchorY", void 0);
1554
+ PopupInteractionContextComponent = __decorate([
997
1555
  Component({
998
- selector: 'aup-switch-case',
999
- template: "<mat-tab-group class=\"content-wrapper\" no-tab-header full-height-tabs [selectedIndex]=\"selectedIndex\">\n <mat-tab *ngFor=\"let option of switchCaseOptions\">\n <ng-template [ngTemplateOutlet]=\"option.templateRef\"></ng-template>\n </mat-tab>\n</mat-tab-group>\n\n\n",
1000
- styles: [":host{display:flex;flex-direction:column;align-items:stretch}mat-tab-group{flex:1}"]
1556
+ selector: 'aup-popup-interaction-context',
1557
+ template: "<ng-content></ng-content>\n",
1558
+ styles: [":host{display:inline}:host.interaction-active{background:rgba(0,0,0,.05)}"]
1001
1559
  }),
1002
- __metadata("design:paramtypes", [ChangeDetectorRef])
1003
- ], SwitchCaseComponent);
1004
- return SwitchCaseComponent;
1560
+ __metadata("design:paramtypes", [ElementRef, Overlay])
1561
+ ], PopupInteractionContextComponent);
1562
+ return PopupInteractionContextComponent;
1005
1563
  }(DisposableComponent));
1006
1564
 
1007
- var VerticalFocusContainerComponent = /** @class */ (function (_super) {
1008
- __extends(VerticalFocusContainerComponent, _super);
1009
- function VerticalFocusContainerComponent(focusManager) {
1010
- var _this = _super.call(this, focusManager) || this;
1011
- _this.focusManager = focusManager;
1565
+ var InteractionContextTriggerFor = /** @class */ (function (_super) {
1566
+ __extends(InteractionContextTriggerFor, _super);
1567
+ function InteractionContextTriggerFor() {
1568
+ var _this = _super.call(this) || this;
1569
+ _this.activityDone = new EventEmitter();
1570
+ _this.activityCancelled = new EventEmitter();
1012
1571
  return _this;
1013
1572
  }
1014
- VerticalFocusContainerComponent.prototype.arrowLeft = function (event) {
1015
- if (this.leftArrowCommand.enabled.value) {
1016
- event.preventDefault();
1017
- event.stopPropagation();
1018
- this.leftArrowCommand.execute();
1573
+ InteractionContextTriggerFor.prototype.onEnter = function (event) {
1574
+ if (!this.aupInteractionContextTriggerFor.isActive()) {
1575
+ this.startActivity();
1576
+ }
1577
+ else {
1578
+ this.aupInteractionContextTriggerFor.cancelActiveActivity();
1019
1579
  }
1020
1580
  };
1021
- VerticalFocusContainerComponent.prototype.arrowRight = function (event) {
1022
- if (this.rightArrowCommand.enabled.value) {
1023
- event.preventDefault();
1024
- event.stopPropagation();
1025
- this.rightArrowCommand.execute();
1581
+ InteractionContextTriggerFor.prototype.onClick = function (event) {
1582
+ if (!this.aupInteractionContextTriggerFor.isActive()) {
1583
+ this.startActivity();
1584
+ }
1585
+ else {
1586
+ this.aupInteractionContextTriggerFor.cancelActiveActivity();
1026
1587
  }
1027
1588
  };
1028
- VerticalFocusContainerComponent.prototype.arrowDown = function (event) {
1029
- event.preventDefault();
1030
- event.stopPropagation();
1031
- this.focusManager.focusNext();
1032
- };
1033
- VerticalFocusContainerComponent.prototype.arrowUp = function (event) {
1034
- event.preventDefault();
1035
- event.stopPropagation();
1036
- this.focusManager.focusPrevious();
1589
+ InteractionContextTriggerFor.prototype.startActivity = function () {
1590
+ var _this = this;
1591
+ assert.isTruthy(this.aupInteractionContextTriggerFor);
1592
+ assert.isFalsey(this.aupInteractionContextTriggerFor.isActive());
1593
+ assert.isTruthy(this.activityClass);
1594
+ this.aupInteractionContextTriggerFor.startActivity(this.activityClass, this.activityData)
1595
+ .then(function (result) {
1596
+ _this.activityDone.emit(result);
1597
+ })
1598
+ .catch(function (error) {
1599
+ _this.activityCancelled.emit(error);
1600
+ });
1037
1601
  };
1038
- VerticalFocusContainerComponent.prototype.ngOnInit = function () {
1602
+ InteractionContextTriggerFor.prototype.prepareActivityData = function () {
1603
+ return ___default.isFunction(this.activityDataFactory()) ? this.activityDataFactory() : this.activityData;
1039
1604
  };
1040
- VerticalFocusContainerComponent.ctorParameters = function () { return [
1041
- { type: FocusManager, decorators: [{ type: Self }] }
1042
- ]; };
1043
1605
  __decorate([
1044
- Input('command.arrowRight'),
1045
- TrackExternal(),
1046
- __metadata("design:type", Command)
1047
- ], VerticalFocusContainerComponent.prototype, "rightArrowCommand", void 0);
1606
+ Input(),
1607
+ __metadata("design:type", Object)
1608
+ ], InteractionContextTriggerFor.prototype, "aupInteractionContextTriggerFor", void 0);
1048
1609
  __decorate([
1049
- Input('command.arrowLeft'),
1050
- TrackExternal(),
1051
- __metadata("design:type", Command)
1052
- ], VerticalFocusContainerComponent.prototype, "leftArrowCommand", void 0);
1610
+ Input(),
1611
+ __metadata("design:type", Object)
1612
+ ], InteractionContextTriggerFor.prototype, "activityClass", void 0);
1053
1613
  __decorate([
1054
- HostListener('keyup.arrowLeft', ['$event']),
1055
- __metadata("design:type", Function),
1056
- __metadata("design:paramtypes", [KeyboardEvent]),
1057
- __metadata("design:returntype", void 0)
1058
- ], VerticalFocusContainerComponent.prototype, "arrowLeft", null);
1614
+ Input(),
1615
+ __metadata("design:type", Object)
1616
+ ], InteractionContextTriggerFor.prototype, "activityData", void 0);
1059
1617
  __decorate([
1060
- HostListener('keyup.arrowRight', ['$event']),
1061
- __metadata("design:type", Function),
1062
- __metadata("design:paramtypes", [KeyboardEvent]),
1063
- __metadata("design:returntype", void 0)
1064
- ], VerticalFocusContainerComponent.prototype, "arrowRight", null);
1618
+ Input(),
1619
+ __metadata("design:type", Function)
1620
+ ], InteractionContextTriggerFor.prototype, "activityDataFactory", void 0);
1065
1621
  __decorate([
1066
- HostListener('keyup.arrowDown', ['$event']),
1622
+ Output(),
1623
+ __metadata("design:type", Object)
1624
+ ], InteractionContextTriggerFor.prototype, "activityDone", void 0);
1625
+ __decorate([
1626
+ Output(),
1627
+ __metadata("design:type", Object)
1628
+ ], InteractionContextTriggerFor.prototype, "activityCancelled", void 0);
1629
+ __decorate([
1630
+ HostListener('keyup.enter'),
1067
1631
  __metadata("design:type", Function),
1068
1632
  __metadata("design:paramtypes", [KeyboardEvent]),
1069
1633
  __metadata("design:returntype", void 0)
1070
- ], VerticalFocusContainerComponent.prototype, "arrowDown", null);
1634
+ ], InteractionContextTriggerFor.prototype, "onEnter", null);
1071
1635
  __decorate([
1072
- HostListener('keyup.arrowUp', ['$event']),
1636
+ HostListener('click'),
1073
1637
  __metadata("design:type", Function),
1074
- __metadata("design:paramtypes", [KeyboardEvent]),
1638
+ __metadata("design:paramtypes", [MouseEvent]),
1075
1639
  __metadata("design:returntype", void 0)
1076
- ], VerticalFocusContainerComponent.prototype, "arrowUp", null);
1077
- VerticalFocusContainerComponent = __decorate([
1078
- Component({
1079
- selector: 'aup-vertical-focus-container',
1080
- template: "<ng-content></ng-content>\n",
1081
- providers: [
1082
- { provide: FocusManager }
1083
- ],
1084
- styles: [":host{display:block}"]
1085
- }),
1086
- __param(0, Self()),
1087
- __metadata("design:paramtypes", [FocusManager])
1088
- ], VerticalFocusContainerComponent);
1089
- return VerticalFocusContainerComponent;
1090
- }(FocusContainerComponent));
1091
-
1092
- /**
1093
- * @example
1094
- * // CSS Vars
1095
- * aup-card-container {
1096
- * --card-gap: var(--card-gap, 16px);
1097
- * --card-width: var(--card-width, 300px);
1098
- * --card-height: var(--card-height, auto);
1099
- * --card-min-height: var(--card-min-height, auto);
1100
- * --card-background: var(--card-background, #fcfcfb);
1101
- * }
1102
- *
1103
- * // Content Templates:
1104
- * #addCardTemplate
1105
- * <ng-template #addCardTemplate>
1106
- * This is a new card template, it will the the size of the other cards.
1107
- * </nav-template>
1108
- *
1109
- */
1110
- var CardContainerComponent = /** @class */ (function (_super) {
1111
- __extends(CardContainerComponent, _super);
1112
- function CardContainerComponent() {
1113
- return _super.call(this) || this;
1114
- }
1115
- CardContainerComponent.prototype.ngOnInit = function () {
1116
- };
1117
- __decorate([
1118
- Input(),
1119
- TrackExternal(),
1120
- __metadata("design:type", Command)
1121
- ], CardContainerComponent.prototype, "addCardCommand", void 0);
1122
- __decorate([
1123
- ContentChild("addCardTemplate"),
1124
- __metadata("design:type", TemplateRef)
1125
- ], CardContainerComponent.prototype, "addCardTemplate", void 0);
1126
- CardContainerComponent = __decorate([
1127
- Component({
1128
- selector: 'aup-card-container',
1129
- template: "<div class=\"card-container\">\n <ng-content></ng-content>\n\n <div class=\"add-card-container\" *ngIf=\"addCardCommand.enabled.value\" [pectinCommand]=\"addCardCommand\">\n <mat-icon>add</mat-icon>\n </div>\n\n <div class=\"add-card-template\" *ngIf=\"addCardTemplate\">\n <ng-container [ngTemplateOutlet]=\"addCardTemplate\"></ng-container>\n </div>\n\n</div>\n",
1130
- styles: [":root{--aup-default-padding:var(--default-padding, 18px)}.dialog-interaction-context{max-width:95vw!important;max-height:95vh!important}.dialog-interaction-context mat-dialog-container{max-width:95vw!important;max-height:95vh!important;padding:0}[no-tab-header]>mat-tab-header{display:none}[full-height-tabs] .mat-tab-body-wrapper,mat-tab-group.full-height-tabs .mat-tab-body-wrapper{flex:1}[full-height-tabs] .mat-tab-body-wrapper .mat-tab-body-content,[full-height-tabs] .mat-tab-body-wrapper mat-tab-body,mat-tab-group.full-height-tabs .mat-tab-body-wrapper .mat-tab-body-content,mat-tab-group.full-height-tabs .mat-tab-body-wrapper mat-tab-body{display:flex;flex-direction:column;justify-content:stretch}.router-outlet-container>*{position:absolute;top:0;left:0;bottom:0;right:0}:host{--resolved-card-gap:var(--card-gap, 16px);--resolved-card-width:var(--card-width, 300px);--resolved-card-height:var(--card-height, auto);--resolved-card-min-height:var(--card-min-height, auto);--resolved-card-background:var(--card-background, #fcfcfb);flex:1;display:block;background:var(--resolved-card-background)}.card-container{display:-ms-grid;display:grid;grid-template-columns:repeat(auto-fill,var(--resolved-card-width));grid-template-rows:repeat(auto-fit,minmax(0,var(--resolved-card-height)));grid-gap:var(--resolved-card-gap);box-sizing:border-box;padding:var(--resolved-card-gap);min-height:calc(var(--resolved-card-height) + 2 * var(--resolved-card-gap));min-width:calc(var(--resolved-card-width) + 2 * var(--resolved-card-gap));width:calc((var(--resolved-card-width) + var(--resolved-card-gap)) * 2 + var(--grid-gap));max-width:100%}.add-card-container{width:var(--resolved-card-width);height:var(--resolved-card-height);min-height:var(--resolved-card-min-height);display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;border:2px dashed rgba(0,0,0,.1);border-radius:6px;font-weight:300;cursor:pointer;color:rgba(0,0,0,.54);background-color:rgba(255,255,255,.8);transition:280ms cubic-bezier(.4,0,.2,1)}.add-card-container mat-icon{font-size:200%}.add-card-container:hover{transition:280ms cubic-bezier(.4,0,.2,1);border-color:transparent;background-color:#fff;color:rgba(0,0,0,.54)}.add-card-container:hover:hover{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}.add-card-template-container{width:var(--resolved-card-width);height:var(--resolved-card-height);display:flex;flex-direction:column;align-items:stretch;justify-content:stretch}"]
1640
+ ], InteractionContextTriggerFor.prototype, "onClick", null);
1641
+ InteractionContextTriggerFor = __decorate([
1642
+ Directive({
1643
+ selector: '[aupInteractionContextTriggerFor]'
1131
1644
  }),
1132
1645
  __metadata("design:paramtypes", [])
1133
- ], CardContainerComponent);
1134
- return CardContainerComponent;
1135
- }(DisposableComponent));
1136
-
1137
- var ComponentsModule = /** @class */ (function () {
1138
- function ComponentsModule() {
1139
- }
1140
- ComponentsModule = __decorate([
1141
- NgModule({
1142
- declarations: [
1143
- NumberInputComponent,
1144
- StringInputComponent,
1145
- TextInputComponent,
1146
- PasswordInputComponent,
1147
- SelectInputComponent,
1148
- CheckboxInputComponent,
1149
- ScrollContainerComponent,
1150
- NoopComponent,
1151
- AbstractInputComponent,
1152
- SwitchCaseComponent,
1153
- SwitchCaseWhenDirective,
1154
- SwitchCaseDefaultDirective,
1155
- FocusContainerComponent,
1156
- VerticalFocusContainerComponent,
1157
- FocusableComponent,
1158
- CardContainerComponent
1159
- ],
1160
- imports: [
1161
- CommonModule,
1162
- BrowserAnimationsModule,
1163
- FormsModule,
1164
- MatInputModule,
1165
- MatFormFieldModule,
1166
- MatSelectModule,
1167
- MatTabsModule,
1168
- DirectivesModule,
1169
- MatIconModule,
1170
- MatButtonModule,
1171
- MatCheckboxModule
1172
- ],
1173
- exports: [
1174
- NumberInputComponent,
1175
- StringInputComponent,
1176
- TextInputComponent,
1177
- PasswordInputComponent,
1178
- CheckboxInputComponent,
1179
- SelectInputComponent,
1180
- ScrollContainerComponent,
1181
- NoopComponent,
1182
- SwitchCaseComponent,
1183
- SwitchCaseWhenDirective,
1184
- SwitchCaseDefaultDirective,
1185
- FocusContainerComponent,
1186
- VerticalFocusContainerComponent,
1187
- FocusableComponent,
1188
- CardContainerComponent
1189
- ],
1190
- providers: [
1191
- FocusBindingFactory
1192
- ]
1193
- })
1194
- ], ComponentsModule);
1195
- return ComponentsModule;
1196
- }());
1197
-
1198
- var Dimension = /** @class */ (function () {
1199
- function Dimension(width, height) {
1200
- this.width = width;
1201
- this.height = height;
1202
- }
1203
- return Dimension;
1204
- }());
1646
+ ], InteractionContextTriggerFor);
1647
+ return InteractionContextTriggerFor;
1648
+ }(GarbageCollector));
1205
1649
 
1206
- var Point = /** @class */ (function () {
1207
- function Point(x, y) {
1208
- this.x = x;
1209
- this.y = y;
1650
+ var DialogInteractionContext = /** @class */ (function (_super) {
1651
+ __extends(DialogInteractionContext, _super);
1652
+ function DialogInteractionContext(identifier, api, dialogService, config) {
1653
+ var _this = _super.call(this) || this;
1654
+ _this.identifier = identifier;
1655
+ _this.api = api;
1656
+ _this.dialogService = dialogService;
1657
+ _this.config = config;
1658
+ _this.garbage = new GarbageCollector();
1659
+ assert$1.notNil(dialogService);
1660
+ return _this;
1210
1661
  }
1211
- Point.from = function (data) {
1212
- return new Point(data.x, data.y);
1662
+ DialogInteractionContext.prototype.cancelActiveActivity = function () {
1663
+ return this.activityContainer.cancelActiveActivity();
1213
1664
  };
1214
- Point.prototype.translate = function (x, y) {
1215
- return new Point(this.x + x, this.y + y);
1665
+ DialogInteractionContext.prototype.dispose = function () {
1666
+ if (this.isActive()) {
1667
+ lang.illegalState('Dispose called while active.');
1668
+ }
1669
+ this.garbage.dispose();
1670
+ };
1671
+ DialogInteractionContext.prototype.registerDisposable = function (disposable) {
1672
+ return this.garbage.registerDisposable(disposable);
1673
+ };
1674
+ DialogInteractionContext.prototype.isActive = function () {
1675
+ return !!this.activityContainer && this.activityContainer.isActive();
1676
+ };
1677
+ DialogInteractionContext.prototype.createAndLaunchActivity = function (activityType, data, disableClose) {
1678
+ var _this = this;
1679
+ assert$1.isNil(this._currentActivityRef);
1680
+ var config = __assign(__assign({}, this.config), {
1681
+ disableClose: disableClose,
1682
+ panelClass: 'dialog-interaction-context'
1683
+ });
1684
+ var self = this;
1685
+ var matDialogRef = this.dialogService.open(ActivityContainerComponent, config);
1686
+ var activityContainer = this.activityContainer = matDialogRef.componentInstance;
1687
+ this.activityContainer.initialise(this.identifier, this.api);
1688
+ var activityResult = this.activityContainer.startActivity(activityType, data);
1689
+ activityResult.finally(function () { return matDialogRef.close(); });
1690
+ // we need to check if our onDone/onCancel methods above we called or if we were
1691
+ // closed by the user clicking the backdrop. If the later then we need to cancel our
1692
+ // activity.
1693
+ matDialogRef.afterClosed().subscribe(function (promiseAlreadyFinished) {
1694
+ if (activityContainer.isActive()) {
1695
+ activityContainer.cancelActiveActivity();
1696
+ }
1697
+ _this.activityContainer = null;
1698
+ });
1699
+ matDialogRef.updateSize();
1700
+ matDialogRef.afterOpened().subscribe(function (promiseAlreadyFinished) {
1701
+ matDialogRef.updateSize();
1702
+ });
1703
+ return activityResult;
1704
+ };
1705
+ return DialogInteractionContext;
1706
+ }(AbstractInteractionContext));
1707
+
1708
+ var DIALOG_INTERACTION_SERVICE_DEFAULTS = new InjectionToken('DIALOG_INTERACTION_SERVICE_DEFAULTS');
1709
+ var DialogInteractionContextFactory = /** @class */ (function (_super) {
1710
+ __extends(DialogInteractionContextFactory, _super);
1711
+ function DialogInteractionContextFactory(dialogService, dialogServiceDefaults, matDialogDefaultConfig) {
1712
+ var _this = _super.call(this) || this;
1713
+ _this.dialogService = dialogService;
1714
+ _this.dialogServiceDefaults = dialogServiceDefaults;
1715
+ _this.matDialogDefaultConfig = matDialogDefaultConfig;
1716
+ assert$1.notNil(dialogService);
1717
+ return _this;
1718
+ }
1719
+ DialogInteractionContextFactory.prototype.createInteractionContext = function (identifier, api) {
1720
+ var config = __assign(__assign({ autoFocus: false, hasBackdrop: true, closeOnNavigation: false }, this.matDialogDefaultConfig), this.dialogServiceDefaults);
1721
+ return new DialogInteractionContext(identifier, api, this.dialogService, config);
1216
1722
  };
1217
- return Point;
1218
- }());
1723
+ DialogInteractionContextFactory.ctorParameters = function () { return [
1724
+ { type: MatDialog },
1725
+ { type: MatDialogConfig, decorators: [{ type: Optional }, { type: Inject, args: [DIALOG_INTERACTION_SERVICE_DEFAULTS,] }] },
1726
+ { type: MatDialogConfig, decorators: [{ type: Optional }, { type: Inject, args: [MAT_DIALOG_DEFAULT_OPTIONS,] }] }
1727
+ ]; };
1728
+ DialogInteractionContextFactory.ɵprov = ɵɵdefineInjectable({ factory: function DialogInteractionContextFactory_Factory() { return new DialogInteractionContextFactory(ɵɵinject(MatDialog), ɵɵinject(DIALOG_INTERACTION_SERVICE_DEFAULTS, 8), ɵɵinject(MAT_DIALOG_DEFAULT_OPTIONS, 8)); }, token: DialogInteractionContextFactory, providedIn: "root" });
1729
+ DialogInteractionContextFactory = __decorate([
1730
+ Injectable({
1731
+ providedIn: 'root'
1732
+ }),
1733
+ __param(1, Optional()), __param(1, Inject(DIALOG_INTERACTION_SERVICE_DEFAULTS)),
1734
+ __param(2, Optional()), __param(2, Inject(MAT_DIALOG_DEFAULT_OPTIONS)),
1735
+ __metadata("design:paramtypes", [MatDialog,
1736
+ MatDialogConfig,
1737
+ MatDialogConfig])
1738
+ ], DialogInteractionContextFactory);
1739
+ return DialogInteractionContextFactory;
1740
+ }(ModalInteractionContextFactory));
1219
1741
 
1220
- var Bounds = /** @class */ (function (_super) {
1221
- __extends(Bounds, _super);
1222
- function Bounds(top, left, width, height) {
1223
- var _this = _super.call(this, width, height) || this;
1224
- _this.top = top;
1225
- _this.left = left;
1226
- _this.width = width;
1227
- _this.height = height;
1742
+ /**
1743
+ * @file Automatically generated by barrelsby.
1744
+ */
1745
+
1746
+ var AbstractInputActivity = /** @class */ (function (_super) {
1747
+ __extends(AbstractInputActivity, _super);
1748
+ function AbstractInputActivity(data) {
1749
+ var _this = _super.call(this) || this;
1750
+ _this.data = data;
1751
+ _this.class = 'aup-input-activity';
1752
+ var form = new Form();
1753
+ _this.valueModel = form.valueModel(_this.data.initialValue);
1754
+ _this.valueModel.validateUsing(data.validators || []);
1755
+ _this.confirmCommand = Command.create(function () {
1756
+ if (_this.valueModel.validate()) {
1757
+ if (data.save) {
1758
+ return Promise.resolve(data.save(_this.valueModel, _this.interactionContext))
1759
+ .then(function () { return _this.done(); });
1760
+ }
1761
+ else {
1762
+ _this.done(_this.valueModel.value);
1763
+ }
1764
+ }
1765
+ });
1766
+ _this.cancelCommand = Command.create(function () {
1767
+ _this.cancel();
1768
+ });
1228
1769
  return _this;
1229
1770
  }
1230
- Bounds.prototype.relativePositionOf = function (point) {
1231
- if (point instanceof MouseEvent) {
1232
- return new Point(point.clientX - this.left, point.clientY - this.top);
1233
- }
1234
- else {
1235
- return new Point(point.x - this.left, point.y - this.top);
1236
- }
1771
+ AbstractInputActivity.prototype.onActivityReady = function () {
1772
+ this.valueModel.focusContext.requestFocus();
1237
1773
  };
1238
- return Bounds;
1239
- }(Dimension));
1240
- (function (Bounds) {
1241
- function ofElement(element) {
1242
- var rect = element.getBoundingClientRect();
1243
- return new Bounds(rect.top, rect.left, rect.width, rect.height);
1244
- }
1245
- Bounds.ofElement = ofElement;
1246
- })(Bounds || (Bounds = {}));
1774
+ AbstractInputActivity.ctorParameters = function () { return [
1775
+ { type: undefined, decorators: [{ type: Inject, args: [ACTIVITY_DATA,] }] }
1776
+ ]; };
1777
+ __decorate([
1778
+ HostBinding('class'),
1779
+ __metadata("design:type", Object)
1780
+ ], AbstractInputActivity.prototype, "class", void 0);
1781
+ AbstractInputActivity = __decorate([
1782
+ Component({
1783
+ template: ""
1784
+ }),
1785
+ __param(0, Inject(ACTIVITY_DATA)),
1786
+ __metadata("design:paramtypes", [Object])
1787
+ ], AbstractInputActivity);
1788
+ return AbstractInputActivity;
1789
+ }(Activity));
1247
1790
 
1248
- var ResizeAwareComponent = /** @class */ (function (_super) {
1249
- __extends(ResizeAwareComponent, _super);
1250
- function ResizeAwareComponent(elementRef, ngZone) {
1791
+ var AbstractInputComponent = /** @class */ (function (_super) {
1792
+ __extends(AbstractInputComponent, _super);
1793
+ function AbstractInputComponent() {
1251
1794
  var _this = _super.call(this) || this;
1252
- _this.elementRef = elementRef;
1253
- _this.ngZone = ngZone;
1254
- _this._boundsModel = new MutableValueModel(new Bounds(0, 0, 0, 0));
1795
+ /**
1796
+ * A backing model for all our @Input() valueModel properties which should be defined as follows.
1797
+ *
1798
+ * @Input() @TrackExternal({useExisting: "delegatingFormValueModel"})
1799
+ * valueModel: FormValueModel<string> | MutableValueModel<string>;
1800
+ *
1801
+ * This approach allows the input to accept plain or form models but all backed by a form
1802
+ * friendly delegate. We have to use an existing delegate for union types as pectin just
1803
+ * gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).
1804
+ */
1805
+ // We have to register it as a disposable so it ditches any listeners when we're disposed.
1806
+ _this.delegatingFormValueModel = _this.registerDisposable(new DelegatingFormValueModel());
1807
+ // TODO: fix this.
1808
+ // tslint:disable-next-line:no-output-native
1809
+ _this.focus = new EventEmitter();
1810
+ // tslint:disable-next-line:no-output-native
1811
+ _this.blur = new EventEmitter();
1812
+ // tslint:disable-next-line:no-output-native
1813
+ _this.enterKey = new EventEmitter();
1814
+ // tslint:disable-next-line:no-output-native
1815
+ _this.escapeKey = new EventEmitter();
1816
+ _this.baseClassName = 'aup-input-component';
1817
+ var self = _this;
1818
+ _this.errorStateMatcher = {
1819
+ isErrorState: function (control, form) {
1820
+ return self.hasErrors();
1821
+ }
1822
+ };
1255
1823
  return _this;
1256
1824
  }
1257
- ResizeAwareComponent.prototype.ngAfterViewInit = function () {
1258
- var _this = this;
1259
- this.updateBounds();
1260
- var element = this.elementRef.nativeElement;
1261
- var ro = new ResizeObserver(function (entries, observer) {
1262
- _this.ngZone.run(function () { return _this.updateBounds(); });
1263
- });
1264
- ro.observe(element);
1265
- this.onDispose(function () { return ro.disconnect(); });
1825
+ AbstractInputComponent.prototype.notifyClick = function () {
1826
+ this.safelyInvoke(this.clickCommand);
1266
1827
  };
1267
- Object.defineProperty(ResizeAwareComponent.prototype, "boundsModel", {
1828
+ AbstractInputComponent.prototype.notifyFocusIn = function () {
1829
+ this.safelyInvoke(this.focusCommand);
1830
+ this.focus.emit();
1831
+ };
1832
+ AbstractInputComponent.prototype.notifyFocusOut = function () {
1833
+ this.safelyInvoke(this.blurCommand);
1834
+ this.blur.emit();
1835
+ };
1836
+ AbstractInputComponent.prototype.notifyEnterKey = function () {
1837
+ this.safelyInvoke(this.enterCommand);
1838
+ this.enterKey.emit();
1839
+ };
1840
+ AbstractInputComponent.prototype.notifyEscapeKey = function () {
1841
+ this.safelyInvoke(this.escapeCommand);
1842
+ this.escapeKey.emit();
1843
+ };
1844
+ AbstractInputComponent.prototype.safelyInvoke = function (command) {
1845
+ if (command && command.enabled.value) {
1846
+ command.execute();
1847
+ }
1848
+ };
1849
+ AbstractInputComponent.prototype.ngOnInit = function () {
1850
+ };
1851
+ AbstractInputComponent.prototype.isEnabled = function () {
1852
+ return this.enabled.value;
1853
+ };
1854
+ Object.defineProperty(AbstractInputComponent.prototype, "enabled", {
1268
1855
  get: function () {
1269
- return this._boundsModel.readonly;
1856
+ return this.delegatingFormValueModel.enabled;
1270
1857
  },
1271
1858
  enumerable: true,
1272
1859
  configurable: true
1273
1860
  });
1274
- Object.defineProperty(ResizeAwareComponent.prototype, "nativeElement", {
1861
+ AbstractInputComponent.prototype.hasErrors = function () {
1862
+ return !this.errorList.query().isEmpty();
1863
+ };
1864
+ Object.defineProperty(AbstractInputComponent.prototype, "errorList", {
1275
1865
  get: function () {
1276
- return this.elementRef.nativeElement;
1866
+ return this.delegatingFormValueModel.errorList;
1277
1867
  },
1278
1868
  enumerable: true,
1279
1869
  configurable: true
1280
1870
  });
1281
- // TODO: Make this handle body scroll
1282
- ResizeAwareComponent.prototype.relativePositionOf = function (point) {
1283
- return this.bounds.relativePositionOf(point);
1284
- };
1285
- Object.defineProperty(ResizeAwareComponent.prototype, "bounds", {
1871
+ Object.defineProperty(AbstractInputComponent.prototype, "firstError", {
1286
1872
  get: function () {
1287
- return this._boundsModel.value;
1873
+ return this.hasErrors() ? this.errorList.value[0] : null;
1288
1874
  },
1289
1875
  enumerable: true,
1290
1876
  configurable: true
1291
1877
  });
1292
- ResizeAwareComponent.prototype.updateBounds = function () {
1293
- this._boundsModel.value = Bounds.ofElement(this.nativeElement);
1294
- };
1295
- ResizeAwareComponent.ctorParameters = function () { return [
1296
- { type: ElementRef },
1297
- { type: NgZone }
1298
- ]; };
1299
- ResizeAwareComponent = __decorate([
1300
- Directive(),
1301
- __metadata("design:paramtypes", [ElementRef, NgZone])
1302
- ], ResizeAwareComponent);
1303
- return ResizeAwareComponent;
1304
- }(DisposableComponent));
1305
-
1306
- /**
1307
- * @file Automatically generated by barrelsby.
1308
- */
1878
+ __decorate([
1879
+ Input(),
1880
+ __metadata("design:type", String)
1881
+ ], AbstractInputComponent.prototype, "label", void 0);
1882
+ __decorate([
1883
+ Input(),
1884
+ __metadata("design:type", String)
1885
+ ], AbstractInputComponent.prototype, "floatLabel", void 0);
1886
+ __decorate([
1887
+ Input(),
1888
+ __metadata("design:type", String)
1889
+ ], AbstractInputComponent.prototype, "hint", void 0);
1890
+ __decorate([
1891
+ Input(),
1892
+ __metadata("design:type", String)
1893
+ ], AbstractInputComponent.prototype, "placeholder", void 0);
1894
+ __decorate([
1895
+ Input('command.focus'),
1896
+ __metadata("design:type", Command)
1897
+ ], AbstractInputComponent.prototype, "focusCommand", void 0);
1898
+ __decorate([
1899
+ Input('command.blur'),
1900
+ __metadata("design:type", Command)
1901
+ ], AbstractInputComponent.prototype, "blurCommand", void 0);
1902
+ __decorate([
1903
+ Input('command.enter'),
1904
+ __metadata("design:type", Command)
1905
+ ], AbstractInputComponent.prototype, "enterCommand", void 0);
1906
+ __decorate([
1907
+ Input('command.escape'),
1908
+ __metadata("design:type", Command)
1909
+ ], AbstractInputComponent.prototype, "escapeCommand", void 0);
1910
+ __decorate([
1911
+ Input('command.click'),
1912
+ __metadata("design:type", Command)
1913
+ ], AbstractInputComponent.prototype, "clickCommand", void 0);
1914
+ __decorate([
1915
+ Output(),
1916
+ __metadata("design:type", Object)
1917
+ ], AbstractInputComponent.prototype, "focus", void 0);
1918
+ __decorate([
1919
+ Output(),
1920
+ __metadata("design:type", Object)
1921
+ ], AbstractInputComponent.prototype, "blur", void 0);
1922
+ __decorate([
1923
+ Output(),
1924
+ __metadata("design:type", Object)
1925
+ ], AbstractInputComponent.prototype, "enterKey", void 0);
1926
+ __decorate([
1927
+ Output(),
1928
+ __metadata("design:type", Object)
1929
+ ], AbstractInputComponent.prototype, "escapeKey", void 0);
1930
+ __decorate([
1931
+ HostBinding('class'),
1932
+ __metadata("design:type", Object)
1933
+ ], AbstractInputComponent.prototype, "baseClassName", void 0);
1934
+ __decorate([
1935
+ HostListener('click'),
1936
+ __metadata("design:type", Function),
1937
+ __metadata("design:paramtypes", []),
1938
+ __metadata("design:returntype", void 0)
1939
+ ], AbstractInputComponent.prototype, "notifyClick", null);
1940
+ __decorate([
1941
+ HostListener('focusin'),
1942
+ __metadata("design:type", Function),
1943
+ __metadata("design:paramtypes", []),
1944
+ __metadata("design:returntype", void 0)
1945
+ ], AbstractInputComponent.prototype, "notifyFocusIn", null);
1946
+ __decorate([
1947
+ HostListener('focusout'),
1948
+ __metadata("design:type", Function),
1949
+ __metadata("design:paramtypes", []),
1950
+ __metadata("design:returntype", void 0)
1951
+ ], AbstractInputComponent.prototype, "notifyFocusOut", null);
1952
+ AbstractInputComponent = __decorate([
1953
+ Component({ template: '' }),
1954
+ __metadata("design:paramtypes", [])
1955
+ ], AbstractInputComponent);
1956
+ return AbstractInputComponent;
1957
+ }(DisposableComponent));
1309
1958
 
1310
- var ActivityActionsComponent = /** @class */ (function (_super) {
1311
- __extends(ActivityActionsComponent, _super);
1312
- function ActivityActionsComponent() {
1313
- var _this = _super !== null && _super.apply(this, arguments) || this;
1314
- _this.align = 'start';
1959
+ var CheckboxInputComponent = /** @class */ (function (_super) {
1960
+ __extends(CheckboxInputComponent, _super);
1961
+ function CheckboxInputComponent() {
1962
+ var _this = _super.call(this) || this;
1963
+ _this.color = 'accent';
1964
+ _this.labelPosition = 'after';
1315
1965
  return _this;
1316
1966
  }
1317
- Object.defineProperty(ActivityActionsComponent.prototype, "alignEnd", {
1318
- get: function () {
1319
- return this.align === 'end';
1320
- },
1321
- enumerable: true,
1322
- configurable: true
1323
- });
1324
- ActivityActionsComponent.prototype.ngOnInit = function () {
1325
- };
1326
- ActivityActionsComponent.prototype.hasConfirmText = function () {
1327
- return !___default.isEmpty(this.confirmText);
1967
+ CheckboxInputComponent.prototype.ngOnInit = function () {
1328
1968
  };
1329
1969
  __decorate([
1330
- Input(),
1331
- TrackExternal(),
1332
- __metadata("design:type", Command)
1333
- ], ActivityActionsComponent.prototype, "confirmCommand", void 0);
1970
+ Input(), TrackExternal({ delegateTo: 'delegatingFormValueModel' }),
1971
+ __metadata("design:type", Object)
1972
+ ], CheckboxInputComponent.prototype, "valueModel", void 0);
1334
1973
  __decorate([
1335
1974
  Input(),
1336
1975
  __metadata("design:type", String)
1337
- ], ActivityActionsComponent.prototype, "confirmText", void 0);
1338
- __decorate([
1339
- Input(),
1340
- TrackExternal(),
1341
- __metadata("design:type", Command)
1342
- ], ActivityActionsComponent.prototype, "cancelCommand", void 0);
1976
+ ], CheckboxInputComponent.prototype, "color", void 0);
1343
1977
  __decorate([
1344
1978
  Input(),
1345
1979
  __metadata("design:type", String)
1346
- ], ActivityActionsComponent.prototype, "align", void 0);
1347
- __decorate([
1348
- HostBinding('class.align-end'),
1349
- __metadata("design:type", Boolean),
1350
- __metadata("design:paramtypes", [])
1351
- ], ActivityActionsComponent.prototype, "alignEnd", null);
1352
- ActivityActionsComponent = __decorate([
1980
+ ], CheckboxInputComponent.prototype, "labelPosition", void 0);
1981
+ CheckboxInputComponent = __decorate([
1353
1982
  Component({
1354
- selector: 'aup-activity-actions',
1355
- template: "<button class=\"cancel\" mat-icon-button [pectinCommand]=\"cancelCommand\">\n <mat-icon>clear</mat-icon>\n</button>\n<button class=\"confirm\" *ngIf=\"!hasConfirmText()\" mat-icon-button [pectinCommand]=\"confirmCommand\">\n <mat-icon>done</mat-icon>\n</button>\n<button class=\"confirm\" *ngIf=\"hasConfirmText()\" mat-button [pectinCommand]=\"confirmCommand\">{{confirmText}}</button>\n<div class=\"content\">\n <ng-content></ng-content>\n</div>\n",
1356
- styles: [":host{display:-ms-grid;display:grid;grid-template-areas:\"cancel confirm content\";-ms-grid-columns:auto auto 1fr;grid-template-columns:auto auto 1fr;-ms-grid-rows:auto;grid-template-rows:auto;align-items:center;justify-content:end}:host.align-end{grid-template-areas:\"content cancel confirm\";-ms-grid-columns:1fr auto auto;grid-template-columns:1fr auto auto}.cancel{-ms-grid-row:1;-ms-grid-column:1;grid-area:cancel}:host.align-end>.cancel{-ms-grid-row:1;-ms-grid-column:2}.confirm{-ms-grid-row:1;-ms-grid-column:2;grid-area:confirm}:host.align-end>.confirm{-ms-grid-row:1;-ms-grid-column:3}.content{-ms-grid-row:1;-ms-grid-column:3;grid-area:content;text-align:left}:host.align-end>.content{-ms-grid-row:1;-ms-grid-column:1}"]
1357
- })
1358
- ], ActivityActionsComponent);
1359
- return ActivityActionsComponent;
1360
- }(DisposableComponent));
1361
-
1362
- var ACTIVITY_DATA = new InjectionToken('InteractionActivityData');
1363
- var Activity = /** @class */ (function (_super) {
1364
- __extends(Activity, _super);
1365
- function Activity() {
1366
- var _this = _super !== null && _super.apply(this, arguments) || this;
1367
- _this._busyModel = new DelegatingValueModel().withDefault(false);
1368
- return _this;
1369
- }
1370
- Activity.prototype.initialise = function (nestedInteractionContext, activityContext) {
1371
- assert$1.isNil(this._activityContext);
1372
- this._activityContext = activityContext;
1373
- this._interactionContext = nestedInteractionContext;
1374
- };
1375
- Object.defineProperty(Activity.prototype, "interactionContext", {
1376
- get: function () {
1377
- assert$1.isTruthy(this.isInitialised());
1378
- return this._interactionContext;
1379
- },
1380
- enumerable: true,
1381
- configurable: true
1382
- });
1383
- Activity.prototype.done = function (result) {
1384
- return this._activityContext.onDone(result);
1385
- };
1386
- Activity.prototype.cancel = function (error) {
1387
- this._activityContext.onCancel(error);
1388
- };
1389
- // @Trace()
1390
- Activity.prototype.onActivityReady = function () {
1391
- };
1392
- Object.defineProperty(Activity.prototype, "busy", {
1393
- get: function () {
1394
- return this._busyModel.readonly;
1395
- },
1396
- enumerable: true,
1397
- configurable: true
1398
- });
1399
- Activity.prototype.busyWhile = function (busyModel) {
1400
- this._busyModel.setDelegate(busyModel);
1401
- };
1402
- Activity.prototype.isBusy = function () {
1403
- return this._busyModel.value;
1404
- };
1405
- Activity.prototype.isInitialised = function () {
1406
- return !!this._activityContext;
1407
- };
1408
- return Activity;
1409
- }(DisposableComponent));
1983
+ selector: 'aup-checkbox-input',
1984
+ 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",
1985
+ 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}"]
1986
+ }),
1987
+ __metadata("design:paramtypes", [])
1988
+ ], CheckboxInputComponent);
1989
+ return CheckboxInputComponent;
1990
+ }(AbstractInputComponent));
1410
1991
 
1411
- var AlertDialogComponent = /** @class */ (function (_super) {
1412
- __extends(AlertDialogComponent, _super);
1413
- function AlertDialogComponent(alert) {
1992
+ var NumberInputComponent = /** @class */ (function (_super) {
1993
+ __extends(NumberInputComponent, _super);
1994
+ function NumberInputComponent() {
1414
1995
  var _this = _super.call(this) || this;
1415
- _this.alert = alert;
1996
+ _this.min = Number.MIN_SAFE_INTEGER;
1997
+ _this.max = Number.MAX_SAFE_INTEGER;
1416
1998
  return _this;
1417
1999
  }
1418
- AlertDialogComponent.prototype.ngOnInit = function () {
2000
+ NumberInputComponent.prototype.ngOnInit = function () {
1419
2001
  };
1420
- AlertDialogComponent.ctorParameters = function () { return [
1421
- { type: undefined, decorators: [{ type: Inject, args: [ACTIVITY_DATA,] }] }
1422
- ]; };
1423
- AlertDialogComponent = __decorate([
2002
+ __decorate([
2003
+ Input(), TrackExternal({ delegateTo: 'delegatingFormValueModel' }),
2004
+ __metadata("design:type", Object)
2005
+ ], NumberInputComponent.prototype, "valueModel", void 0);
2006
+ __decorate([
2007
+ Input(),
2008
+ __metadata("design:type", Object)
2009
+ ], NumberInputComponent.prototype, "min", void 0);
2010
+ __decorate([
2011
+ Input(),
2012
+ __metadata("design:type", Object)
2013
+ ], NumberInputComponent.prototype, "max", void 0);
2014
+ NumberInputComponent = __decorate([
1424
2015
  Component({
1425
- selector: 'aup-alert-dialog',
1426
- template: "<h3 matDialogTitle *ngIf=\"alert.title\">{{alert.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of alert.content()\">{{line}}</p>\n</div>\n<div matDialogActions>\n <button mat-raised-button color=\"primary\" (click)=\"done()\" data-cy=\"close-button\">{{alert.ok()}}</button>\n</div>\n",
1427
- styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-content{margin:0;padding:0}.mat-dialog-actions{margin-bottom:0!important;padding:0;align-items:flex-end;justify-content:flex-end}"]
2016
+ selector: 'aup-number-input',
2017
+ 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 [min]=\"min\"\n [max]=\"max\"\n >\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n",
2018
+ styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}:host-context(aup-table-cell-renderer) mat-form-field div.mat-form-field-infix{width:auto}"]
1428
2019
  }),
1429
- __param(0, Inject(ACTIVITY_DATA)),
1430
- __metadata("design:paramtypes", [Object])
1431
- ], AlertDialogComponent);
1432
- return AlertDialogComponent;
1433
- }(Activity));
2020
+ __metadata("design:paramtypes", [])
2021
+ ], NumberInputComponent);
2022
+ return NumberInputComponent;
2023
+ }(AbstractInputComponent));
1434
2024
 
1435
- var ConfirmThenDialogComponent = /** @class */ (function (_super) {
1436
- __extends(ConfirmThenDialogComponent, _super);
1437
- function ConfirmThenDialogComponent(config) {
1438
- var _this = _super.call(this) || this;
1439
- _this.config = config;
1440
- assert.notNil(config);
1441
- return _this;
2025
+ var PasswordInputComponent = /** @class */ (function (_super) {
2026
+ __extends(PasswordInputComponent, _super);
2027
+ function PasswordInputComponent() {
2028
+ return _super.call(this) || this;
1442
2029
  }
1443
- ConfirmThenDialogComponent.prototype.ngOnInit = function () {
1444
- };
1445
- Object.defineProperty(ConfirmThenDialogComponent.prototype, "confirm", {
1446
- get: function () {
1447
- return this.config.confirm;
1448
- },
1449
- enumerable: true,
1450
- configurable: true
1451
- });
1452
- ConfirmThenDialogComponent.prototype.isDestructive = function () {
1453
- return this.confirm.destructive && this.confirm.destructive();
1454
- };
1455
- ConfirmThenDialogComponent.prototype.onConfirm = function () {
1456
- var _this = this;
1457
- this.interactionContext.startActivity(this.config.activityType, this.config.data)
1458
- .then(function (result) { return _this.done(result); })
1459
- .catch(function (error) { return _this.cancel(error); });
2030
+ PasswordInputComponent.prototype.ngOnInit = function () {
1460
2031
  };
1461
- ConfirmThenDialogComponent.ctorParameters = function () { return [
1462
- { type: undefined, decorators: [{ type: Inject, args: [ACTIVITY_DATA,] }] }
1463
- ]; };
1464
- ConfirmThenDialogComponent = __decorate([
2032
+ __decorate([
2033
+ Input(), TrackExternal({ delegateTo: "delegatingFormValueModel" }),
2034
+ __metadata("design:type", Object)
2035
+ ], PasswordInputComponent.prototype, "valueModel", void 0);
2036
+ PasswordInputComponent = __decorate([
1465
2037
  Component({
1466
- selector: 'aup-confirmation-dialog',
1467
- template: "<h3 matDialogTitle *ngIf=\"confirm.title\">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of confirm.content()\">{{line}}</p>\n</div>\n<div matDialogActions>\n <button mat-button (click)=\"cancel()\" data-cy=\"cancel-button\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\"\n (click)=\"onConfirm()\" data-cy=\"confirm-button\">{{confirm.ok()}}</button>\n</div>\n\n",
1468
- styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-content{margin:0;padding:0}.mat-dialog-actions{margin-bottom:0!important;padding:0;align-items:flex-end;justify-content:flex-end}"]
2038
+ selector: 'aup-password-input',
2039
+ 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",
2040
+ styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}:host-context(aup-table-cell-renderer) mat-form-field div.mat-form-field-infix{width:auto}"]
1469
2041
  }),
1470
- __param(0, Inject(ACTIVITY_DATA)),
1471
- __metadata("design:paramtypes", [Object])
1472
- ], ConfirmThenDialogComponent);
1473
- return ConfirmThenDialogComponent;
1474
- }(Activity));
2042
+ __metadata("design:paramtypes", [])
2043
+ ], PasswordInputComponent);
2044
+ return PasswordInputComponent;
2045
+ }(AbstractInputComponent));
1475
2046
 
1476
- var ConfirmationDialogComponent = /** @class */ (function (_super) {
1477
- __extends(ConfirmationDialogComponent, _super);
1478
- function ConfirmationDialogComponent(confirm) {
2047
+ var SelectInputComponent = /** @class */ (function (_super) {
2048
+ __extends(SelectInputComponent, _super);
2049
+ function SelectInputComponent() {
1479
2050
  var _this = _super.call(this) || this;
1480
- _this.confirm = confirm;
1481
- assert.notNil(confirm);
2051
+ _this.optionLabelFormat = function (option) { return (option && _this.optionLabel) ? option[_this.optionLabel] : option; };
1482
2052
  return _this;
1483
2053
  }
1484
- ConfirmationDialogComponent.prototype.ngOnInit = function () {
1485
- };
1486
- ConfirmationDialogComponent.prototype.isDestructive = function () {
1487
- return this.confirm.destructive && this.confirm.destructive();
2054
+ SelectInputComponent.prototype.ngOnInit = function () {
1488
2055
  };
1489
- ConfirmationDialogComponent.ctorParameters = function () { return [
1490
- { type: undefined, decorators: [{ type: Inject, args: [ACTIVITY_DATA,] }] }
1491
- ]; };
1492
- ConfirmationDialogComponent = __decorate([
2056
+ __decorate([
2057
+ Input(), TrackExternal({ delegateTo: "delegatingFormValueModel" }),
2058
+ __metadata("design:type", Object)
2059
+ ], SelectInputComponent.prototype, "valueModel", void 0);
2060
+ __decorate([
2061
+ Input(), TrackExternal(),
2062
+ __metadata("design:type", ListModel)
2063
+ ], SelectInputComponent.prototype, "optionsModel", void 0);
2064
+ __decorate([
2065
+ Input(), StoreInListModel('optionsModel'),
2066
+ __metadata("design:type", Array)
2067
+ ], SelectInputComponent.prototype, "options", void 0);
2068
+ __decorate([
2069
+ Input(),
2070
+ __metadata("design:type", Object)
2071
+ ], SelectInputComponent.prototype, "optionLabel", void 0);
2072
+ __decorate([
2073
+ Input(),
2074
+ __metadata("design:type", Boolean)
2075
+ ], SelectInputComponent.prototype, "allowNil", void 0);
2076
+ __decorate([
2077
+ ContentChild("optionTemplate"),
2078
+ __metadata("design:type", TemplateRef)
2079
+ ], SelectInputComponent.prototype, "optionTemplateRef", void 0);
2080
+ __decorate([
2081
+ ContentChild("nilOptionTemplate"),
2082
+ __metadata("design:type", TemplateRef)
2083
+ ], SelectInputComponent.prototype, "nilOptionTemplateRef", void 0);
2084
+ __decorate([
2085
+ Input(),
2086
+ __metadata("design:type", Function)
2087
+ ], SelectInputComponent.prototype, "optionLabelFormat", void 0);
2088
+ SelectInputComponent = __decorate([
1493
2089
  Component({
1494
- selector: 'aup-confirmation-dialog',
1495
- template: "<h3 matDialogTitle *ngIf=\"confirm.title\">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor=\"let line of confirm.content()\">{{line}}</p>\n</div>\n<div matDialogActions>\n <button mat-button (click)=\"cancel()\" data-cy=\"cancel-button\">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]=\"isDestructive() ? 'warn' : 'primary'\"\n (click)=\"done()\" data-cy=\"confirm-button\">{{confirm.ok()}}</button>\n</div>\n\n",
1496
- styles: [":host{display:block;padding:var(--aup-default-padding)}.mat-dialog-content{margin:0;padding:0}.mat-dialog-actions{margin-bottom:0!important;padding:0;align-items:flex-end;justify-content:flex-end}"]
2090
+ selector: 'aup-select-input',
2091
+ 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",
2092
+ styles: [":host{display:inline-block}mat-form-field{width:100%}"]
1497
2093
  }),
1498
- __param(0, Inject(ACTIVITY_DATA)),
1499
- __metadata("design:paramtypes", [Object])
1500
- ], ConfirmationDialogComponent);
1501
- return ConfirmationDialogComponent;
1502
- }(Activity));
2094
+ __metadata("design:paramtypes", [])
2095
+ ], SelectInputComponent);
2096
+ return SelectInputComponent;
2097
+ }(AbstractInputComponent));
1503
2098
 
1504
- var AbstractInteractionContext = /** @class */ (function () {
1505
- function AbstractInteractionContext() {
2099
+ var StringInputActivity = /** @class */ (function (_super) {
2100
+ __extends(StringInputActivity, _super);
2101
+ function StringInputActivity() {
2102
+ return _super !== null && _super.apply(this, arguments) || this;
1506
2103
  }
1507
- AbstractInteractionContext.prototype.startActivity = function (activityType, data) {
1508
- return this.createAndLaunchActivity(activityType, data, false);
1509
- };
1510
- AbstractInteractionContext.prototype.confirm = function (confirm) {
1511
- // Important: we have to implement confirmOrReject as the main entry point
1512
- // as the canDeactivation guards need to be able to cancel an interaction
1513
- // without caring about returning a value.
1514
- return this.confirmOrReject(confirm).then(function () { return true; }).catch(function () { return false; });
1515
- };
1516
- AbstractInteractionContext.prototype.alert = function (alert) {
1517
- // TODO: Test disableClose === false
1518
- return this.createAndLaunchActivity(AlertDialogComponent, alert, false);
1519
- };
1520
- AbstractInteractionContext.prototype.confirmOrReject = function (confirm) {
1521
- return this.createAndLaunchActivity(ConfirmationDialogComponent, confirm, true);
1522
- };
1523
- /**
1524
- * Presents the confirmation to the user and runs the activity only if the user confirms.
1525
- * @param confirm:Confirm the confirmation to display.
1526
- * @param activityType the activity to run if confirmed.
1527
- * @param data the activity data.
1528
- */
1529
- AbstractInteractionContext.prototype.confirmThen = function (confirm, activityType, data) {
1530
- return this.createAndLaunchActivity(ConfirmThenDialogComponent, {
1531
- confirm: confirm,
1532
- activityType: activityType,
1533
- data: data
1534
- }, true);
1535
- };
1536
- return AbstractInteractionContext;
1537
- }());
2104
+ StringInputActivity = __decorate([
2105
+ Component({
2106
+ selector: 'aup-string-input-activity',
2107
+ template: "\n <aup-string-input [valueModel]=\"valueModel\"\n [label]=\"data.label\"\n [placeholder]=\"data.placeholder\"\n [command.enter]=\"confirmCommand\"\n [command.escape]=\"cancelCommand\"></aup-string-input>\n <aup-activity-actions align=\"end\"\n [confirmCommand]=\"confirmCommand\"\n [cancelCommand]=\"cancelCommand\"></aup-activity-actions>\n "
2108
+ })
2109
+ ], StringInputActivity);
2110
+ return StringInputActivity;
2111
+ }(AbstractInputActivity));
1538
2112
 
1539
- var ActivityRef = /** @class */ (function () {
1540
- function ActivityRef(activityClass, activityData, onComplete) {
1541
- this.activityClass = activityClass;
1542
- this.activityData = activityData;
1543
- this.onComplete = onComplete;
1544
- this._complete = false;
1545
- this.deferredResult = Deferred.defer();
1546
- }
1547
- ActivityRef.prototype.isActivityRealised = function () {
1548
- return !!this._activity;
1549
- };
1550
- ActivityRef.prototype.isComplete = function () {
1551
- return this._complete;
1552
- };
1553
- Object.defineProperty(ActivityRef.prototype, "activity", {
1554
- get: function () {
1555
- assert.isTruthy(this.isActivityRealised());
1556
- return this._activity;
1557
- },
1558
- enumerable: true,
1559
- configurable: true
1560
- });
1561
- ActivityRef.prototype.notifyActivityCreated = function (activity, nestedInteractionContext) {
1562
- assert.isNil(this._activity);
1563
- this._activity = activity;
1564
- var self = this;
1565
- this._activity.initialise(nestedInteractionContext, {
1566
- onDone: function (result) {
1567
- self.finishActivity(function (deferred) { return deferred.resolve(result); });
1568
- },
1569
- onCancel: function (error) {
1570
- self.finishActivity(function (deferred) { return deferred.reject(error); });
1571
- }
2113
+ var StringInputComponent = /** @class */ (function (_super) {
2114
+ __extends(StringInputComponent, _super);
2115
+ function StringInputComponent() {
2116
+ var _this = _super.call(this) || this;
2117
+ var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
2118
+ _this.clearCommand = Command.create(function () {
2119
+ _this.valueModel.value = null;
1572
2120
  });
2121
+ _this.clearCommand.disableWhile(chain.stringValue(_this.valueModel).isBlank());
2122
+ return _this;
2123
+ }
2124
+ StringInputComponent.prototype.ngOnInit = function () {
1573
2125
  };
1574
- ActivityRef.prototype.finishActivity = function (resolveOrReject) {
1575
- assert.isFalsey(this.isComplete());
1576
- resolveOrReject(this.deferredResult);
1577
- this._complete = true;
1578
- this.onComplete(this);
1579
- };
1580
- ActivityRef.prototype.cancel = function () {
1581
- this.activity.cancel();
1582
- };
1583
- Object.defineProperty(ActivityRef.prototype, "activityResult", {
1584
- get: function () {
1585
- return this.deferredResult.promise;
1586
- },
1587
- enumerable: true,
1588
- configurable: true
1589
- });
1590
- return ActivityRef;
1591
- }());
2126
+ __decorate([
2127
+ Input(), TrackExternal({ delegateTo: 'delegatingFormValueModel' }),
2128
+ __metadata("design:type", Object)
2129
+ ], StringInputComponent.prototype, "valueModel", void 0);
2130
+ __decorate([
2131
+ Input(), TrackExternal({ defaultValue: false }),
2132
+ __metadata("design:type", ValueModel)
2133
+ ], StringInputComponent.prototype, "enableClearModel", void 0);
2134
+ __decorate([
2135
+ Input(), StoreInValueModel('enableClearModel'),
2136
+ __metadata("design:type", Boolean)
2137
+ ], StringInputComponent.prototype, "enableClear", void 0);
2138
+ StringInputComponent = __decorate([
2139
+ Component({
2140
+ selector: 'aup-string-input',
2141
+ 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",
2142
+ styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}:host-context(aup-table-cell-renderer) mat-form-field div.mat-form-field-infix{width:auto}button[disabled]{visibility:hidden}"]
2143
+ }),
2144
+ __metadata("design:paramtypes", [])
2145
+ ], StringInputComponent);
2146
+ return StringInputComponent;
2147
+ }(AbstractInputComponent));
1592
2148
 
1593
- /**
1594
- * ActivityOutletComponent creates and displays an activity and delegates the interaction context functionality to an
1595
- * external service.
1596
- */
1597
- var ActivityOutletComponent = /** @class */ (function () {
1598
- function ActivityOutletComponent(componentFactoryResolver, viewContainerRef, injector) {
1599
- this.componentFactoryResolver = componentFactoryResolver;
1600
- this.viewContainerRef = viewContainerRef;
1601
- this.injector = injector;
2149
+ var TextInputComponent = /** @class */ (function (_super) {
2150
+ __extends(TextInputComponent, _super);
2151
+ function TextInputComponent() {
2152
+ var _this = _super.call(this) || this;
2153
+ _this.rows = 2;
2154
+ return _this;
2155
+ // const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
1602
2156
  }
1603
- Object.defineProperty(ActivityOutletComponent.prototype, "activityRef", {
1604
- get: function () {
1605
- return this._activityRef;
1606
- },
1607
- set: function (activityRef) {
1608
- if (this.activityRef && !this.activityRef.isComplete()) {
1609
- lang$1.illegalState("changing activity before previous one has completed");
1610
- }
1611
- this._activityRef = activityRef;
1612
- this.loadActivity(activityRef);
1613
- },
1614
- enumerable: true,
1615
- configurable: true
1616
- });
1617
- ;
1618
- ActivityOutletComponent.prototype.ngOnInit = function () {
1619
- };
1620
- ActivityOutletComponent.prototype.loadActivity = function (activityRef) {
1621
- var injector = Injector.create({
1622
- providers: [
1623
- { provide: ACTIVITY_DATA, useValue: activityRef.activityData }
1624
- ],
1625
- parent: this.injector
1626
- });
1627
- var componentFactory = this.componentFactoryResolver.resolveComponentFactory(activityRef.activityClass);
1628
- this.viewContainerRef.clear();
1629
- // console.log(`creating component -> ${activityRef.activityClass.name}`);
1630
- this.activityComponentRef = this.viewContainerRef.createComponent(componentFactory, 0, injector);
1631
- this.activityRef.notifyActivityCreated(this.activityComponentRef.instance, this.nestedInteractionContext);
2157
+ TextInputComponent.prototype.ngOnInit = function () {
1632
2158
  };
1633
- Object.defineProperty(ActivityOutletComponent.prototype, "component", {
1634
- get: function () {
1635
- return this.activityComponentRef.instance;
1636
- },
1637
- enumerable: true,
1638
- configurable: true
1639
- });
1640
- ActivityOutletComponent.ctorParameters = function () { return [
1641
- { type: ComponentFactoryResolver },
1642
- { type: ViewContainerRef },
1643
- { type: Injector }
1644
- ]; };
2159
+ __decorate([
2160
+ Input(), TrackExternal({ delegateTo: 'delegatingFormValueModel' }),
2161
+ __metadata("design:type", Object)
2162
+ ], TextInputComponent.prototype, "valueModel", void 0);
1645
2163
  __decorate([
1646
2164
  Input(),
1647
2165
  __metadata("design:type", Object)
1648
- ], ActivityOutletComponent.prototype, "nestedInteractionContext", void 0);
2166
+ ], TextInputComponent.prototype, "rows", void 0);
1649
2167
  __decorate([
1650
2168
  Input(),
1651
- __metadata("design:type", ActivityRef),
1652
- __metadata("design:paramtypes", [ActivityRef])
1653
- ], ActivityOutletComponent.prototype, "activityRef", null);
1654
- ActivityOutletComponent = __decorate([
2169
+ __metadata("design:type", Number)
2170
+ ], TextInputComponent.prototype, "cols", void 0);
2171
+ TextInputComponent = __decorate([
1655
2172
  Component({
1656
- selector: 'aup-activity-outlet',
1657
- template: '',
2173
+ selector: 'aup-text-input',
2174
+ template: "<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <textarea 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 [rows]=\"rows\"\n [cols]=\"cols\"\n >\n </textarea>\n <mat-hint *ngIf=\"hint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n",
2175
+ styles: [":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}:host-context(aup-table-cell-renderer) mat-form-field div.mat-form-field-infix{width:auto}button[disabled]{visibility:hidden}textarea{overflow:auto}"]
2176
+ }),
2177
+ __metadata("design:paramtypes", [])
2178
+ ], TextInputComponent);
2179
+ return TextInputComponent;
2180
+ }(AbstractInputComponent));
2181
+
2182
+ var NoopComponent = /** @class */ (function () {
2183
+ function NoopComponent() {
2184
+ }
2185
+ NoopComponent = __decorate([
2186
+ Component({
2187
+ selector: 'aup-noop',
2188
+ template: "",
1658
2189
  styles: [":host{display:block}"]
1659
2190
  }),
1660
- __metadata("design:paramtypes", [ComponentFactoryResolver,
1661
- ViewContainerRef,
1662
- Injector])
1663
- ], ActivityOutletComponent);
1664
- return ActivityOutletComponent;
2191
+ __metadata("design:paramtypes", [])
2192
+ ], NoopComponent);
2193
+ return NoopComponent;
1665
2194
  }());
1666
2195
 
1667
- var ActivityContainerComponent = /** @class */ (function (_super) {
1668
- __extends(ActivityContainerComponent, _super);
1669
- function ActivityContainerComponent() {
1670
- var _this = _super.call(this) || this;
1671
- _this.dynamicHeight = false;
1672
- _this.activityTabs = [];
1673
- _this.garbage = new GarbageCollector();
1674
- return _this;
1675
- }
1676
- ActivityContainerComponent.prototype.ngOnInit = function () {
1677
- };
1678
- ActivityContainerComponent.prototype.ngAfterViewInit = function () {
1679
- var _this = this;
1680
- var _a = Dsl.disposeWith(this), chain = _a.chain, observe = _a.observe;
1681
- // using the component directly rather than (animationDone)=.. allows us
1682
- // to keep our callback private.
1683
- observe.valuesFrom(this.tabs.animationDone).subscribe(function () { return _this.onAnimationFinished(); });
1684
- };
1685
- ActivityContainerComponent.prototype.initialise = function (identifier, api) {
1686
- assert.isFalsey(this.isInitialised());
1687
- assert.notNil(identifier);
1688
- assert.notNil(api);
1689
- this._identifier = identifier;
1690
- this.interactionServiceApi = api;
2196
+ var ScrollContainerComponent = /** @class */ (function () {
2197
+ function ScrollContainerComponent() {
2198
+ }
2199
+ ScrollContainerComponent.prototype.ngOnInit = function () {
1691
2200
  };
1692
- Object.defineProperty(ActivityContainerComponent.prototype, "identifier", {
2201
+ ScrollContainerComponent = __decorate([
2202
+ Component({
2203
+ selector: 'aup-scroll-container',
2204
+ template: "<div class=\"container\">\n <ng-content></ng-content>\n</div>\n",
2205
+ styles: [":host{display:flex;flex-direction:column;min-height:0;align-items:stretch}.container{display:flex;flex-direction:column;flex:1;flex-basis:0;overflow-y:scroll;align-items:stretch}"]
2206
+ }),
2207
+ __metadata("design:paramtypes", [])
2208
+ ], ScrollContainerComponent);
2209
+ return ScrollContainerComponent;
2210
+ }());
2211
+
2212
+ var SwitchCaseOption = /** @class */ (function () {
2213
+ function SwitchCaseOption(templateRef) {
2214
+ this.templateRef = templateRef;
2215
+ }
2216
+ Object.defineProperty(SwitchCaseOption.prototype, "name", {
1693
2217
  get: function () {
1694
- return this._identifier;
2218
+ return this.constructor.name;
1695
2219
  },
1696
2220
  enumerable: true,
1697
2221
  configurable: true
1698
2222
  });
1699
- ActivityContainerComponent.prototype.isInitialised = function () {
1700
- return !!this.identifier;
1701
- };
1702
- /**
1703
- * Returns true if an activity is currently running.
1704
- */
1705
- ActivityContainerComponent.prototype.isActive = function () {
1706
- return this.getActiveActivityCount() > 0;
1707
- };
1708
- ActivityContainerComponent.prototype.registerDisposable = function (disposable) {
1709
- return this.garbage.registerDisposable(disposable);
2223
+ return SwitchCaseOption;
2224
+ }());
2225
+ var SwitchCaseWhenDirective = /** @class */ (function (_super) {
2226
+ __extends(SwitchCaseWhenDirective, _super);
2227
+ function SwitchCaseWhenDirective(templateRef) {
2228
+ var _this = _super.call(this, templateRef) || this;
2229
+ _this.isDefault = false;
2230
+ return _this;
2231
+ }
2232
+ SwitchCaseWhenDirective_1 = SwitchCaseWhenDirective;
2233
+ SwitchCaseWhenDirective.prototype.matches = function (value) {
2234
+ return this.aupSwitchCaseWhen === value;
1710
2235
  };
1711
- ActivityContainerComponent.prototype.dispose = function () {
1712
- // TODO: think about auto cancelling any outstanding activity on dispose.
1713
- // See NavigationState.Navigating for a use-case.
1714
- assert.isFalsey(this.isActive());
1715
- this.garbage.dispose();
2236
+ var SwitchCaseWhenDirective_1;
2237
+ SwitchCaseWhenDirective.ctorParameters = function () { return [
2238
+ { type: TemplateRef }
2239
+ ]; };
2240
+ __decorate([
2241
+ Input(),
2242
+ __metadata("design:type", Object)
2243
+ ], SwitchCaseWhenDirective.prototype, "aupSwitchCaseWhen", void 0);
2244
+ SwitchCaseWhenDirective = SwitchCaseWhenDirective_1 = __decorate([
2245
+ Directive({
2246
+ selector: '[aupSwitchCaseWhen]',
2247
+ providers: [{ provide: SwitchCaseOption, useExisting: SwitchCaseWhenDirective_1 }]
2248
+ }),
2249
+ __metadata("design:paramtypes", [TemplateRef])
2250
+ ], SwitchCaseWhenDirective);
2251
+ return SwitchCaseWhenDirective;
2252
+ }(SwitchCaseOption));
2253
+ var SwitchCaseDefaultDirective = /** @class */ (function (_super) {
2254
+ __extends(SwitchCaseDefaultDirective, _super);
2255
+ function SwitchCaseDefaultDirective(templateRef) {
2256
+ var _this = _super.call(this, templateRef) || this;
2257
+ _this.isDefault = true;
2258
+ return _this;
2259
+ }
2260
+ SwitchCaseDefaultDirective_1 = SwitchCaseDefaultDirective;
2261
+ SwitchCaseDefaultDirective.prototype.matches = function (value) {
2262
+ return false;
1716
2263
  };
1717
- ActivityContainerComponent.prototype.getActiveActivityRef = function () {
1718
- if (!this.isActive()) {
1719
- lang$1.illegalState('no activity in progress');
1720
- }
1721
- return ___default.findLast(this.activityTabs, function (tab) { return !tab.isComplete(); });
2264
+ var SwitchCaseDefaultDirective_1;
2265
+ SwitchCaseDefaultDirective.ctorParameters = function () { return [
2266
+ { type: TemplateRef }
2267
+ ]; };
2268
+ SwitchCaseDefaultDirective = SwitchCaseDefaultDirective_1 = __decorate([
2269
+ Directive({
2270
+ selector: '[aupSwitchCaseDefault]',
2271
+ providers: [{ provide: SwitchCaseOption, useExisting: SwitchCaseDefaultDirective_1 }]
2272
+ }),
2273
+ __metadata("design:paramtypes", [TemplateRef])
2274
+ ], SwitchCaseDefaultDirective);
2275
+ return SwitchCaseDefaultDirective;
2276
+ }(SwitchCaseOption));
2277
+ var SwitchCaseComponent = /** @class */ (function (_super) {
2278
+ __extends(SwitchCaseComponent, _super);
2279
+ function SwitchCaseComponent(cdr) {
2280
+ var _this = _super.call(this) || this;
2281
+ _this.cdr = cdr;
2282
+ _this.selectedIndex = 0;
2283
+ return _this;
2284
+ }
2285
+ SwitchCaseComponent.prototype.ngOnInit = function () {
1722
2286
  };
1723
- /**
1724
- * Cancels the current activity and returns true the context is no longer active, false if
1725
- * there is still another activity running.
1726
- */
1727
- // @Trace()
1728
- ActivityContainerComponent.prototype.cancelActiveActivity = function () {
1729
- return __awaiter(this, void 0, void 0, function () {
1730
- var activity;
1731
- return __generator(this, function (_a) {
1732
- activity = this.getActiveActivityRef();
1733
- activity.cancel();
1734
- if (this.isCleaningUp()) {
1735
- return [2 /*return*/, this.waitForInteractionContextCleanupToFinish()];
1736
- }
1737
- else {
1738
- return [2 /*return*/, !this.isActive()];
1739
- }
1740
- return [2 /*return*/];
1741
- });
1742
- });
2287
+ SwitchCaseComponent.prototype.ngAfterContentInit = function () {
2288
+ var _this = this;
2289
+ var subscription = this.switchCaseOptions.changes.subscribe(function (change) { return _this.updateSelection(); });
2290
+ this.onDispose(function () { return subscription.unsubscribe(); });
2291
+ var _a = Dsl.disposeWith(this), chain = _a.chain, when = _a.when;
2292
+ when.valueOf(this.switchModel).changes(function () { return _this.updateSelection(); }, { initialValue: 'triggerChange' });
2293
+ this.cdr.detectChanges();
1743
2294
  };
1744
- // TODO: this handling of multiple nested activities is only used by the activity component and is not a general case.
1745
- // @Trace()
1746
- ActivityContainerComponent.prototype.createAndLaunchActivity = function (activityType, data, disableClose) {
2295
+ SwitchCaseComponent.prototype.updateSelection = function () {
1747
2296
  var _this = this;
1748
- assert.isTruthy(this.isInitialised()); // make sure we've been initialised
1749
- var activityRef = new ActivityRef(activityType, data, function () {
1750
- var activeActivityCount = _this.getActiveActivityCount() > 0;
1751
- if (activeActivityCount) {
1752
- _this.triggerTabSynchronisation();
1753
- }
1754
- else {
1755
- _this.finishAndStartCleanup();
2297
+ var matchingIndicies = [];
2298
+ this.switchCaseOptions.forEach(function (option, index) {
2299
+ if (option.matches(_this.switchModel.value)) {
2300
+ matchingIndicies.push(index);
1756
2301
  }
1757
2302
  });
1758
- this.launchActivity(activityRef);
1759
- // if this is the first activity let the interaction service know.
1760
- if (this.activityTabs.length === 1) {
1761
- // console.log('Now active!!!');
1762
- this.interactionServiceApi.notifyActive(this);
2303
+ if (matchingIndicies.length > 1) {
2304
+ console.warn("found " + matchingIndicies.length + " matching case values, displaying the first.");
1763
2305
  }
1764
- return activityRef.activityResult;
1765
- };
1766
- ActivityContainerComponent.prototype.getActiveActivityCount = function () {
1767
- return this.activityTabs.filter(function (ref) { return !ref.isComplete(); }).length;
1768
- };
1769
- /**
1770
- * Checks if this interaction context has finished an is in the process of waiting
1771
- * for all the infrastructure (including route updates) to be completed.
1772
- */
1773
- ActivityContainerComponent.prototype.isCleaningUp = function () {
1774
- return !!this._deferredCleanUp;
1775
- };
1776
- ActivityContainerComponent.prototype.waitForInteractionContextCleanupToFinish = function () {
1777
- return __awaiter(this, void 0, void 0, function () {
1778
- return __generator(this, function (_a) {
1779
- return [2 /*return*/, this._deferredCleanUp ?
1780
- this._deferredCleanUp :
1781
- true];
1782
- });
1783
- });
1784
- };
1785
- // @Trace()
1786
- ActivityContainerComponent.prototype.finishAndStartCleanup = function () {
1787
- var _this = this;
1788
- if (!this._deferredCleanUp) {
1789
- // Important:
1790
- // Clear our tabs so the next activity triggers a tab change.
1791
- // Without this our animation done wasn't called when a single
1792
- // new activity followed a single tab activity (since we're tracking
1793
- // by activity index)
1794
- this.activityTabs = [];
1795
- var promise = this.interactionServiceApi.notifyFinished(this);
1796
- this._deferredCleanUp = promise
1797
- .finally(function () {
1798
- _this._deferredCleanUp = null;
2306
+ if (matchingIndicies.length === 0) {
2307
+ this.switchCaseOptions.forEach(function (option, index) {
2308
+ matchingIndicies.push(index);
1799
2309
  });
2310
+ if (matchingIndicies.length > 1) {
2311
+ console.warn("found " + matchingIndicies.length + " default case values, displaying the first.");
2312
+ }
1800
2313
  }
1801
- };
1802
- // @Trace()
1803
- ActivityContainerComponent.prototype.launchActivity = function (activityRef) {
1804
- var cleanedTabs = this.activityTabs.filter(function (tab) { return !tab.isComplete(); });
1805
- this.activityTabs = cleanedTabs.concat(activityRef);
1806
- this.synchroniseSelectedTabIndex();
1807
- };
1808
- ActivityContainerComponent.prototype.activityIndex = function (index, activityRef) {
1809
- return index;
1810
- };
1811
- ;
1812
- ActivityContainerComponent.prototype.onAnimationFinished = function () {
1813
- if (this.onAnimationFinishedJob) {
1814
- this.onAnimationFinishedJob();
1815
- this.onAnimationFinishedJob = undefined;
1816
- }
1817
- };
1818
- /**
1819
- * Synchronises the selected tab index.
1820
- */
1821
- ActivityContainerComponent.prototype.synchroniseSelectedTabIndex = function () {
1822
- var _this = this;
1823
- var previousIndex = this.tabs.selectedIndex;
1824
- var newIndex = this.getActiveActivityCount() - 1;
1825
- if (previousIndex !== newIndex) {
1826
- this.tabs.selectedIndex = newIndex;
1827
- this.onAnimationFinishedJob = function () {
1828
- _this.getSelectedOutlet().component.onActivityReady();
1829
- _this.activityTabs = _this.activityTabs.filter(function (tab) { return !tab.isComplete(); });
1830
- };
2314
+ if (matchingIndicies.length > 0) {
2315
+ this.selectedIndex = matchingIndicies[0];
1831
2316
  }
1832
- };
1833
- ActivityContainerComponent.prototype.getSelectedOutlet = function () {
1834
- return this.activityOutlets.toArray()[this.tabs.selectedIndex];
1835
- };
1836
- // @Trace()
1837
- ActivityContainerComponent.prototype.triggerTabSynchronisation = function () {
1838
- var _this = this;
1839
- if (this.syncSelectedTabTimeout) {
1840
- clearTimeout(this.syncSelectedTabTimeout);
2317
+ else {
2318
+ console.warn("found no matching or default case values.");
2319
+ this.selectedIndex = -1;
1841
2320
  }
1842
- this.syncSelectedTabTimeout = setTimeout(function () {
1843
- _this.syncSelectedTabTimeout = null;
1844
- _this.synchroniseSelectedTabIndex();
1845
- }, 75);
1846
2321
  };
2322
+ SwitchCaseComponent.ctorParameters = function () { return [
2323
+ { type: ChangeDetectorRef }
2324
+ ]; };
1847
2325
  __decorate([
1848
- Input(),
1849
- __metadata("design:type", Object)
1850
- ], ActivityContainerComponent.prototype, "dynamicHeight", void 0);
2326
+ Input(), TrackExternal(),
2327
+ __metadata("design:type", ValueModel)
2328
+ ], SwitchCaseComponent.prototype, "switchModel", void 0);
1851
2329
  __decorate([
1852
- ViewChild('tabs', { static: true }),
1853
- __metadata("design:type", MatTabGroup)
1854
- ], ActivityContainerComponent.prototype, "tabs", void 0);
2330
+ Input(), StoreInValueModel('switchModel'),
2331
+ __metadata("design:type", Object)
2332
+ ], SwitchCaseComponent.prototype, "switch", void 0);
1855
2333
  __decorate([
1856
- ViewChildren(ActivityOutletComponent),
2334
+ ContentChildren(SwitchCaseOption),
1857
2335
  __metadata("design:type", QueryList)
1858
- ], ActivityContainerComponent.prototype, "activityOutlets", void 0);
2336
+ ], SwitchCaseComponent.prototype, "switchCaseOptions", void 0);
2337
+ SwitchCaseComponent = __decorate([
2338
+ Component({
2339
+ selector: 'aup-switch-case',
2340
+ template: "<mat-tab-group class=\"content-wrapper\" no-tab-header full-height-tabs [selectedIndex]=\"selectedIndex\">\n <mat-tab *ngFor=\"let option of switchCaseOptions\">\n <ng-template [ngTemplateOutlet]=\"option.templateRef\"></ng-template>\n </mat-tab>\n</mat-tab-group>\n\n\n",
2341
+ styles: [":host{display:flex;flex-direction:column;align-items:stretch}mat-tab-group{flex:1}"]
2342
+ }),
2343
+ __metadata("design:paramtypes", [ChangeDetectorRef])
2344
+ ], SwitchCaseComponent);
2345
+ return SwitchCaseComponent;
2346
+ }(DisposableComponent));
2347
+
2348
+ var DefaultCellRendererComponent = /** @class */ (function () {
2349
+ function DefaultCellRendererComponent() {
2350
+ }
2351
+ Object.defineProperty(DefaultCellRendererComponent.prototype, "value", {
2352
+ get: function () {
2353
+ return this._value;
2354
+ },
2355
+ set: function (value) {
2356
+ this._value = value;
2357
+ },
2358
+ enumerable: true,
2359
+ configurable: true
2360
+ });
1859
2361
  __decorate([
1860
- Trace(),
1861
- __metadata("design:type", Function),
1862
- __metadata("design:paramtypes", []),
1863
- __metadata("design:returntype", void 0)
1864
- ], ActivityContainerComponent.prototype, "dispose", null);
1865
- ActivityContainerComponent = __decorate([
2362
+ Input(),
2363
+ __metadata("design:type", Object),
2364
+ __metadata("design:paramtypes", [Object])
2365
+ ], DefaultCellRendererComponent.prototype, "value", null);
2366
+ DefaultCellRendererComponent = __decorate([
1866
2367
  Component({
1867
- selector: 'aup-activity-container',
1868
- template: "<mat-tab-group #tabs no-tab-header\n [dynamicHeight]=\"dynamicHeight\"\n [class.full-height-tabs]=\"!dynamicHeight\">\n <mat-tab *ngFor=\"let tab of activityTabs; trackBy: activityIndex\" >\n <aup-activity-outlet [nestedInteractionContext]=\"this\" [activityRef]=\"tab\"></aup-activity-outlet>\n </mat-tab>\n</mat-tab-group>\n",
1869
- styles: [":host{display:flex;flex-direction:column}mat-tab-group{flex:1}"]
2368
+ selector: 'aup-default-cell-renderer',
2369
+ template: "{{value}}\n",
2370
+ styles: [""]
1870
2371
  }),
1871
2372
  __metadata("design:paramtypes", [])
1872
- ], ActivityContainerComponent);
1873
- return ActivityContainerComponent;
1874
- }(AbstractInteractionContext));
2373
+ ], DefaultCellRendererComponent);
2374
+ return DefaultCellRendererComponent;
2375
+ }());
1875
2376
 
1876
- var InteractionServiceRoutingAdapter = /** @class */ (function () {
1877
- function InteractionServiceRoutingAdapter(activeInteractionContextIds, activeModalContext, createExclusiveInteractionContext) {
1878
- this.activeInteractionContextIds = activeInteractionContextIds;
1879
- this.activeModalContext = activeModalContext;
1880
- this.createExclusiveInteractionContext = createExclusiveInteractionContext;
2377
+ var DefaultHeaderCellRendererComponent = /** @class */ (function () {
2378
+ function DefaultHeaderCellRendererComponent() {
1881
2379
  }
1882
- InteractionServiceRoutingAdapter.prototype.isActive = function () {
1883
- return this.getActiveInteractionContextIds().length > 0;
2380
+ __decorate([
2381
+ Input(),
2382
+ __metadata("design:type", ColumnModel)
2383
+ ], DefaultHeaderCellRendererComponent.prototype, "columnModel", void 0);
2384
+ DefaultHeaderCellRendererComponent = __decorate([
2385
+ Component({
2386
+ selector: 'aup-default-header-renderer',
2387
+ template: "{{columnModel.getHeaderText()}}\n",
2388
+ styles: [""]
2389
+ }),
2390
+ __metadata("design:paramtypes", [])
2391
+ ], DefaultHeaderCellRendererComponent);
2392
+ return DefaultHeaderCellRendererComponent;
2393
+ }());
2394
+
2395
+ // export type StringPropertiesOf<T> = { [K in keyof T]: T[K] extends string ? K : never }[keyof T];
2396
+ // export type NumberPropertiesOf<T> = { [K in keyof T]: T[K] extends number ? K : never }[keyof T];
2397
+ /**
2398
+ * Example:
2399
+ * @example
2400
+ * const model = TableModel.fromList(heroList, table => {
2401
+ * table.pluck("firstName");
2402
+ * table.pluck("lastName");
2403
+ * table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
2404
+ * });
2405
+ *
2406
+ * Editable tables
2407
+ * @example
2408
+ * const saveCommand = UnaryCommand.create((form: Form<Hero>) => {
2409
+ * if (form.validate()) {
2410
+ * // normal form save stuff
2411
+ * return true; // finish editing
2412
+ * }
2413
+ * return false; // continue editiing
2414
+ * }
2415
+ * const colorsNames: ListModel<string> = ...;
2416
+ * const model = TableModel.fromList(heroList, table => {
2417
+ * table.pluck("firstName").cellEditor(StringInputComponent); <-- interface CellEditor { valueModel: FormValueModel<string> | ValueModel<string>; }
2418
+ * table.pluck("lastName").cellEditor(StringInputComponent, {
2419
+ * validators: [Validator.present("We need a last name")]
2420
+ * });
2421
+ * table.pluck("age").cellEditor(NumberInputComponent);
2422
+ * table.pluck("favoriteColor").cellEditor(SelectInputComponent, {
2423
+ * initialiseComponent(component: SelectInputComponent) {
2424
+ * selectInput.optionsModel = colorsNames; // <- initialise our component
2425
+ * }
2426
+ * });
2427
+ * table.addEditControls(saveCommand); // <- required to enable editing
2428
+ * });
2429
+ *
2430
+ * Selection models
2431
+ * @example
2432
+ * const model = TableModel.fromList(heroList, table => {
2433
+ * table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model
2434
+ * table.pluck("firstName");
2435
+ * table.pluck("lastName");
2436
+ * });
2437
+ *
2438
+ * Custom cell renderers and editors
2439
+ * @example
2440
+ * const model = TableModel.fromList(heroList, table => {
2441
+ * table.pluck("favoriteColor")
2442
+ * .cellHeaderRenderer(CellHeaderRendererComponent, (component, column) => {
2443
+ * // configure your component with what ever you need.
2444
+ * });
2445
+ * .cellRenderer(CellRendererComponent) // <-- interface CellEditor { value: string; }
2446
+ * .cellEditor(CellEditorComponent.); // <-- interface CellEditor { valueModel: FormValueModel<string> | ValueModel<string>; }
2447
+ * table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
2448
+ * });
2449
+ *
2450
+ * I18n
2451
+ * @example
2452
+ * [table.yml]
2453
+ * table:
2454
+ * columns(ColumnTextProperties[]):
2455
+ * firstName:
2456
+ * headerText: "First Name"
2457
+ * fullName:
2458
+ * headerText: "Full Name"
2459
+ *
2460
+ * const model = TableModel.fromList(heroList, table => {
2461
+ * table.pluck("favoriteColor").cellRenderer(...).cellEditor(...);
2462
+ * table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
2463
+ *
2464
+ * table.columnTextProperties(I18n.table.columns); // <- configures all columns
2465
+ * });
2466
+ */
2467
+ var TableModel = /** @class */ (function () {
2468
+ function TableModel(sourceOfTruth) {
2469
+ this.sourceOfTruth = sourceOfTruth;
2470
+ this._garbage = new GarbageCollector();
2471
+ this._columns = new MutableListModel();
2472
+ this._editorSessions = new MutableListModel();
2473
+ this.identityOf = sourceOfTruth.identityOf;
2474
+ var _a = Dsl.disposeWith(this._garbage), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
2475
+ this._columnsById = chain(this._columns).indexBy('columnId');
2476
+ this._rowsBeingEdited = new MutableListModel([], {
2477
+ identifiedWith: this.identityOf
2478
+ });
2479
+ this._editorSessionByRowId = chain(this._editorSessions).indexBy('rowId');
2480
+ this.editing = chain(this._editorSessions).count().isGreaterThan(0);
2481
+ this.dataSource = chain(this.sourceOfTruth).replaceAll(this.rowsBeingEdited);
2482
+ }
2483
+ TableModel_1 = TableModel;
2484
+ TableModel.fromList = function (sourceOfTruth, builder) {
2485
+ var model = new TableModel_1(sourceOfTruth);
2486
+ builder(model);
2487
+ return model;
1884
2488
  };
1885
- InteractionServiceRoutingAdapter.prototype.isModalActive = function () {
1886
- return !!this.activeModalContext.value;
2489
+ Object.defineProperty(TableModel.prototype, "rowsBeingEdited", {
2490
+ get: function () {
2491
+ return this._rowsBeingEdited.readonly;
2492
+ },
2493
+ enumerable: true,
2494
+ configurable: true
2495
+ });
2496
+ TableModel.prototype.getTrackByFunction = function () {
2497
+ var _this = this;
2498
+ return function (index, item) {
2499
+ return _this.identityOf ? _this.identityOf(item) : index;
2500
+ };
1887
2501
  };
1888
- // @Trace()
1889
- InteractionServiceRoutingAdapter.prototype.isComponentInteracting = function (component) {
1890
- return component.interactionContext && component.interactionContext.isActive();
2502
+ Object.defineProperty(TableModel.prototype, "columns", {
2503
+ get: function () {
2504
+ return this._columns.readonly;
2505
+ },
2506
+ enumerable: true,
2507
+ configurable: true
2508
+ });
2509
+ TableModel.prototype.pluck = function (property) {
2510
+ return this.addColumn(new PropertyColumnModel(property, this));
1891
2511
  };
1892
- InteractionServiceRoutingAdapter.prototype.getActiveInteractionContextIds = function () {
1893
- return this.activeInteractionContextIds.value;
2512
+ TableModel.prototype.addSelectionColumn = function (selectionModel) {
2513
+ return this.addColumn(new SelectionColumnModel('selection', this, selectionModel));
1894
2514
  };
1895
- // @Trace()
1896
- InteractionServiceRoutingAdapter.prototype.cancelCurrentModalInteraction = function () {
1897
- return this.activeModalContext.value.cancelActiveActivity();
2515
+ TableModel.prototype.addEditControls = function (saveCommand) {
2516
+ this.saveCommand = saveCommand;
2517
+ return this.addColumn(new EditorControlColumnModel('editControls', saveCommand, this));
1898
2518
  };
1899
- // @Trace()
1900
- InteractionServiceRoutingAdapter.prototype.cancelComponentInteraction = function (component) {
1901
- return component.interactionContext.cancelActiveActivity();
2519
+ TableModel.prototype.addCustomColumn = function (columnId, dataAccessor) {
2520
+ return this.addColumn(new CustomValueColumnModel(columnId, this, dataAccessor));
1902
2521
  };
1903
- return InteractionServiceRoutingAdapter;
1904
- }());
1905
-
1906
- var ModalInteractionContextFactory = /** @class */ (function () {
1907
- function ModalInteractionContextFactory() {
1908
- }
1909
- return ModalInteractionContextFactory;
1910
- }());
1911
-
1912
- var inplaceMonitorCount = 0;
1913
- var InteractionService = /** @class */ (function () {
1914
- function InteractionService(modelInteractionContextFactory) {
1915
- this.modelInteractionContextFactory = modelInteractionContextFactory;
1916
- this.garbage = new GarbageCollector();
1917
- // private readonly _activeModalContext = new MutableValueModel<InteractionContext>();
1918
- // private readonly _activeInlineContext = new MutableValueModel<InteractionContext>();
1919
- // private readonly _activeContext: ValueModelChain<InteractionContext>;
1920
- this._navigationInProgress = new DelegatingValueModel().withDefault(false);
1921
- var _a = Dsl.disposeWith(this.garbage), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
1922
- this.exclusiveInteractionRegistry = new InteractionService_1.ContextRegistry();
1923
- this.modalInteractionRegistry = new InteractionService_1.ContextRegistry();
1924
- this.inPlaceInteractionRegistry = new InteractionService_1.ContextRegistry();
1925
- this.modalInteractionRegistry.disableWhen(valueOf.any(this.exclusiveInteractionRegistry.active, this.modalInteractionRegistry.active).areTruthy());
1926
- this.inPlaceInteractionRegistry.disableWhen(valueOf.any(this.exclusiveInteractionRegistry.active, this.modalInteractionRegistry.active, this.inPlaceInteractionRegistry.active).areTruthy());
1927
- this.active = valueOf.any(this.inPlaceInteractionRegistry.active, this.modalInteractionRegistry.active).areTruthy();
1928
- // TODO: chain.concat(listOrValueModels) would be nice.
1929
- this.activeInteractionContextIds = chain(this.inPlaceInteractionRegistry.interactionContextIds)
1930
- .concat(this.modalInteractionRegistry.interactionContextIds);
1931
- this.activeModalContext = chain(this.modalInteractionRegistry.interactionContexts).first();
1932
- this.inModalInteraction = chain(this.activeModalContext).isNotNil();
1933
- }
1934
- InteractionService_1 = InteractionService;
1935
- InteractionService.prototype.isActive = function () {
1936
- return this.active.value;
2522
+ TableModel.prototype.addColumn = function (column) {
2523
+ if (this._columnsById.get(column.columnId)) {
2524
+ lang.illegalState("Column with id=" + column.columnId + " already exists");
2525
+ }
2526
+ else {
2527
+ this._columns.push(column);
2528
+ }
2529
+ return column;
1937
2530
  };
1938
- /**
1939
- * @deprecated use #createModalInteractionContextDisposedWith instead.
1940
- * @param disposable
1941
- */
1942
- InteractionService.prototype.createModalInteractionContextFor = function (disposable) {
1943
- return this.createModalInteractionContextDisposedWith(disposable);
2531
+ TableModel.prototype.columnTextProperties = function (columnTextProperties) {
2532
+ this._columnTextPropertiesLookup = columnTextProperties;
1944
2533
  };
1945
- /**
1946
- * Creates a new model interaction context that will be disposed along with the component.
1947
- * @param disposable
1948
- */
1949
- InteractionService.prototype.createModalInteractionContextDisposedWith = function (disposable) {
1950
- // TODO: look at making the registry the factory..
1951
- return this.modelInteractionContextFactory.createInteractionContext('modal', new InteractionService_1.ApiAdapter(this.placeRouter, this.modalInteractionRegistry));
2534
+ TableModel.prototype.getColumnTextProperties = function (column) {
2535
+ var factory = this._columnTextPropertiesLookup[column.columnId];
2536
+ return factory ? factory() : undefined;
1952
2537
  };
1953
- InteractionService.prototype.registerInplaceInteractionContext = function (interactionContext) {
1954
- // TODO: look at making the registry the factory..
1955
- // Todo: check for double registration.
1956
- // Todo: allow multiple inplace interactions..
1957
- interactionContext.initialise("ip" + ++inplaceMonitorCount, new InteractionService_1.ApiAdapter(this.placeRouter, this.inPlaceInteractionRegistry));
2538
+ TableModel.prototype.startEditSession = function (row) {
2539
+ var _this = this;
2540
+ var rowId = this.identityOf(row);
2541
+ if (this._rowsBeingEdited.query().indexOf(row) > -1) {
2542
+ return lang.illegalState("Row with id=" + rowId + " already being edited");
2543
+ }
2544
+ else {
2545
+ var editSession_1 = new TableModel_1.EditSession(rowId, row, this.saveCommand);
2546
+ var when = Dsl.disposeWith(editSession_1).when;
2547
+ when.valueOf(editSession_1.rowValueModel).changes(function (editedValue) {
2548
+ _this._rowsBeingEdited.replaceOrPush(editedValue);
2549
+ }, { initialValue: 'triggerChangeUnlessNil' });
2550
+ this._editorSessions.push(editSession_1);
2551
+ editSession_1.onDispose(function () {
2552
+ _this._rowsBeingEdited.remove(editSession_1.rowValueModel.value);
2553
+ _this._editorSessions.remove(editSession_1);
2554
+ });
2555
+ return editSession_1;
2556
+ }
1958
2557
  };
1959
- /**
1960
- * Creates an interaction context that will prevent any other contexts from starting an
1961
- * activity until it is disposed. This is intended for use by the router for passing
1962
- * to PlaceComponent.canDeactivate(interactionContext). This ensures components don't
1963
- * try and interact in a way that we can't track and synchronise with the browser back
1964
- * button.
1965
- */
1966
- InteractionService.prototype.registerPlaceRouter = function (router) {
2558
+ TableModel.prototype.getEditSessionFor = function (row) {
2559
+ return this._editorSessionByRowId.get(this.identityOf(row));
2560
+ };
2561
+ TableModel.prototype.cancelAllEditorSessions = function () {
1967
2562
  var _this = this;
1968
- assert$1.isFalsey(this.placeRouter);
1969
- this.placeRouter = router;
1970
- this._navigationInProgress.setDelegate(this.placeRouter.navigationInProgress);
1971
- var self = this;
1972
- return new InteractionServiceRoutingAdapter(this.activeInteractionContextIds, this.activeModalContext, function () {
1973
- return self.modelInteractionContextFactory.createInteractionContext('exclusive', new InteractionService_1.ApiAdapter(_this.placeRouter, _this.exclusiveInteractionRegistry));
2563
+ this._editorSessions.runInTransaction(function (draft) {
2564
+ _this._rowsBeingEdited.runInTransaction(function () {
2565
+ draft.value.forEach(function (session) { return session.dispose(); });
2566
+ });
1974
2567
  });
1975
2568
  };
1976
- var InteractionService_1;
1977
- InteractionService.ctorParameters = function () { return [
1978
- { type: ModalInteractionContextFactory }
2569
+ var TableModel_1;
2570
+ TableModel.ctorParameters = function () { return [
2571
+ { type: ListModel }
1979
2572
  ]; };
1980
- InteractionService.ɵprov = ɵɵdefineInjectable({ factory: function InteractionService_Factory() { return new InteractionService(ɵɵinject(ModalInteractionContextFactory)); }, token: InteractionService, providedIn: "root" });
1981
- InteractionService = InteractionService_1 = __decorate([
1982
- Injectable({
1983
- providedIn: 'root'
1984
- }),
1985
- __metadata("design:paramtypes", [ModalInteractionContextFactory])
1986
- ], InteractionService);
1987
- return InteractionService;
1988
- }());
1989
- (function (InteractionService) {
1990
- /**
1991
- * Provides a mechanism for the service to keep track of what the API adapters are doing to
1992
- * ensure the rules are followed, i.e. modal or in-place interaction aren't started while
1993
- * an exclusive routing interaction is active.
1994
- */
1995
- var ContextRegistry = /** @class */ (function (_super) {
1996
- __extends(ContextRegistry, _super);
1997
- function ContextRegistry() {
1998
- var _this = _super.call(this) || this;
1999
- _this._interactions = new MutableListModel();
2000
- _this._disabledDelegate = new DelegatingValueModel().withDefault(false);
2001
- var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
2002
- _this.active = chain(_this._interactions).isNotEmpty();
2003
- _this.interactionContextIds = chain(_this._interactions).pluck("identifier");
2004
- return _this;
2005
- }
2006
- Object.defineProperty(ContextRegistry.prototype, "interactionContexts", {
2007
- get: function () {
2008
- return this._interactions.readonly;
2009
- },
2010
- enumerable: true,
2011
- configurable: true
2012
- });
2013
- ContextRegistry.prototype.start = function (context) {
2014
- this._interactions.push(context);
2015
- };
2016
- ContextRegistry.prototype.finish = function (context) {
2017
- this._interactions.remove(context);
2018
- };
2019
- ContextRegistry.prototype.isActive = function () {
2020
- return this.active.value;
2021
- };
2022
- ContextRegistry.prototype.disableWhen = function (disabled) {
2023
- this._disabledDelegate.setDelegate(disabled);
2024
- };
2025
- return ContextRegistry;
2026
- }(GarbageCollector));
2027
- InteractionService.ContextRegistry = ContextRegistry;
2028
- var ApiAdapter = /** @class */ (function () {
2029
- function ApiAdapter(placeRouter, contextRegistry) {
2030
- this.placeRouter = placeRouter;
2031
- this.contextRegistry = contextRegistry;
2032
- }
2033
- // @Trace()
2034
- ApiAdapter.prototype.notifyActive = function (context) {
2035
- assert$1.isTruthy(context.identifier);
2036
- this.contextRegistry.start(context);
2037
- return this.isNavigationInProgress() ? Promise.resolve() : this.placeRouter.syncInteractionContextIdsWithRouter();
2038
- };
2039
- // @Trace()
2040
- ApiAdapter.prototype.isNavigationInProgress = function () {
2041
- return this.placeRouter.navigationInProgress.value;
2042
- };
2043
- // @Trace()
2044
- ApiAdapter.prototype.notifyFinished = function (context) {
2045
- this.contextRegistry.finish(context);
2046
- // :: Important ::
2047
- // This method will be traversed by both the place router (during can canDeactivate guards) and user land code
2048
- // (both when routing is idle and while it is active in PlaceComponent.canDeactivate()).
2049
- // The result of pushInteractionIdsToRoute will not start until after the current route finishes, and the
2050
- // current route won't finish until after this promise returns... Deadlock.
2051
- // So in order to keep this logic out of the activities we perform the check here and ensure that
2052
- // any interactions with the context while routing is active returns immediately.
2053
- return this.isNavigationInProgress() ? Promise.resolve() : this.placeRouter.syncInteractionContextIdsWithRouter();
2054
- };
2055
- return ApiAdapter;
2056
- }());
2057
- InteractionService.ApiAdapter = ApiAdapter;
2058
- })(InteractionService || (InteractionService = {}));
2573
+ TableModel = TableModel_1 = __decorate([
2574
+ TrackExternal.Strategy(new TrackExternal.OneTimeBinding()),
2575
+ __metadata("design:paramtypes", [ListModel])
2576
+ ], TableModel);
2577
+ return TableModel;
2578
+ }());
2579
+ (function (TableModel) {
2580
+ var EditSession = /** @class */ (function (_super) {
2581
+ __extends(EditSession, _super);
2582
+ function EditSession(rowId, row, saveCommand) {
2583
+ var _this = _super.call(this) || this;
2584
+ _this.rowId = rowId;
2585
+ _this.saveCommand = saveCommand;
2586
+ _this._editorValue = new MutableValueModel();
2587
+ _this.rowValueModel = _this._editorValue.readonly;
2588
+ _this.form = new Form();
2589
+ _this.form.load(row);
2590
+ _this._editorValue.value = row;
2591
+ _this.form.onEdit(function () {
2592
+ _this._editorValue.value = produce(_this._editorValue.value, function (draft) {
2593
+ _this.form.writeDirtyStateTo(draft);
2594
+ });
2595
+ });
2596
+ return _this;
2597
+ }
2598
+ return EditSession;
2599
+ }(GarbageCollector));
2600
+ TableModel.EditSession = EditSession;
2601
+ })(TableModel || (TableModel = {}));
2059
2602
 
2060
- var InPlaceInteractionContextComponent = /** @class */ (function (_super) {
2061
- __extends(InPlaceInteractionContextComponent, _super);
2062
- function InPlaceInteractionContextComponent(interactionService, tabConfig) {
2603
+ var EditRowControls = /** @class */ (function (_super) {
2604
+ __extends(EditRowControls, _super);
2605
+ function EditRowControls() {
2063
2606
  var _this = _super.call(this) || this;
2064
- _this.interactionService = interactionService;
2065
- _this.tabConfig = tabConfig;
2066
- /**
2067
- * If true then the first startActivity call will slide the activity into view. If false
2068
- * the activity will replace the existing content immediately.
2069
- */
2070
- _this.animateFirstActivity = true;
2607
+ _this.saveCommand = Command.create(function () {
2608
+ _this.editSession.saveCommand.execute(_this.editSession.form)
2609
+ .then(function (finished) {
2610
+ if (finished) {
2611
+ _this.editSession.dispose();
2612
+ }
2613
+ });
2614
+ });
2615
+ _this.cancelCommand = Command.create(function () {
2616
+ _this.editSession.dispose();
2617
+ });
2071
2618
  return _this;
2072
2619
  }
2073
- Object.defineProperty(InPlaceInteractionContextComponent.prototype, "animationDuration", {
2620
+ EditRowControls.prototype.ngOnInit = function () {
2621
+ };
2622
+ Object.defineProperty(EditRowControls.prototype, "form", {
2074
2623
  get: function () {
2075
2624
  var _a;
2076
- return this.animateFirstActivity ? (((_a = this.tabConfig) === null || _a === void 0 ? void 0 : _a.animationDuration) || '500ms') : "0ms";
2625
+ return (_a = this.editSession) === null || _a === void 0 ? void 0 : _a.form;
2077
2626
  },
2078
2627
  enumerable: true,
2079
2628
  configurable: true
2080
2629
  });
2081
- InPlaceInteractionContextComponent.prototype.ngAfterViewInit = function () {
2082
- this.interactionService.registerInplaceInteractionContext(this);
2083
- };
2084
- InPlaceInteractionContextComponent.prototype.initialise = function (id, api) {
2085
- this.activityContainerComponent.initialise(id, api);
2086
- };
2087
- Object.defineProperty(InPlaceInteractionContextComponent.prototype, "identifier", {
2630
+ __decorate([
2631
+ Input(),
2632
+ __metadata("design:type", Object)
2633
+ ], EditRowControls.prototype, "row", void 0);
2634
+ __decorate([
2635
+ Input(),
2636
+ TrackExternal(),
2637
+ __metadata("design:type", Command)
2638
+ ], EditRowControls.prototype, "editRowCommand", void 0);
2639
+ __decorate([
2640
+ Input(),
2641
+ __metadata("design:type", TableModel.EditSession)
2642
+ ], EditRowControls.prototype, "editSession", void 0);
2643
+ EditRowControls = __decorate([
2644
+ Component({
2645
+ selector: 'aup-row-editor-controls',
2646
+ template: "<button *ngIf=\"!editSession\" mat-icon-button [pectinCommand]=\"editRowCommand\" class=\"edit-button\"><mat-icon>edit</mat-icon></button>\n<button *ngIf=\"editSession\" mat-icon-button [pectinCommand]=\"saveCommand\"><mat-icon>done</mat-icon></button>\n<button *ngIf=\"editSession\" mat-icon-button [pectinCommand]=\"cancelCommand\"><mat-icon>clear</mat-icon></button>\n",
2647
+ styles: [":host{display:block;width:80px}.edit-button{visibility:hidden}:host-context(tr:hover) .edit-button{visibility:visible}"]
2648
+ }),
2649
+ __metadata("design:paramtypes", [])
2650
+ ], EditRowControls);
2651
+ return EditRowControls;
2652
+ }(DisposableComponent));
2653
+
2654
+ var SelectCellRendererComponent = /** @class */ (function (_super) {
2655
+ __extends(SelectCellRendererComponent, _super);
2656
+ function SelectCellRendererComponent() {
2657
+ var _this = _super.call(this) || this;
2658
+ _this.selectCommand = Command.create(function () {
2659
+ _this.selectionModel.selectCommand.execute(_this.row);
2660
+ });
2661
+ return _this;
2662
+ }
2663
+ Object.defineProperty(SelectCellRendererComponent.prototype, "row", {
2088
2664
  get: function () {
2089
- return this.activityContainerComponent.identifier;
2665
+ return this._row;
2666
+ },
2667
+ set: function (value) {
2668
+ this._row = value;
2090
2669
  },
2091
2670
  enumerable: true,
2092
2671
  configurable: true
2093
2672
  });
2094
- InPlaceInteractionContextComponent.prototype.alert = function (alert) {
2095
- return this.activityContainerComponent.alert(alert);
2096
- };
2097
- InPlaceInteractionContextComponent.prototype.cancelActiveActivity = function () {
2098
- return this.activityContainerComponent.cancelActiveActivity();
2099
- };
2100
- InPlaceInteractionContextComponent.prototype.confirm = function (confirm) {
2101
- return this.activityContainerComponent.confirm(confirm);
2102
- };
2103
- InPlaceInteractionContextComponent.prototype.confirmOrReject = function (confirm) {
2104
- return this.activityContainerComponent.confirmOrReject(confirm);
2105
- };
2106
- InPlaceInteractionContextComponent.prototype.confirmThen = function (confirm, activityType, data) {
2107
- return this.activityContainerComponent.confirmThen(confirm, activityType);
2108
- };
2109
- InPlaceInteractionContextComponent.prototype.isActive = function () {
2110
- return this.activityContainerComponent.isActive();
2111
- };
2112
- InPlaceInteractionContextComponent.prototype.startActivity = function (activityType, data) {
2113
- return this.activityContainerComponent.startActivity(activityType, data);
2673
+ SelectCellRendererComponent.prototype.isSelected = function () {
2674
+ return this.selectionModel.isSelected(this.row);
2114
2675
  };
2115
- InPlaceInteractionContextComponent.ctorParameters = function () { return [
2116
- { type: InteractionService },
2117
- { type: undefined, decorators: [{ type: Inject, args: [MAT_TABS_CONFIG,] }, { type: Optional }] }
2118
- ]; };
2119
2676
  __decorate([
2120
- ViewChild('activityContainer', { static: true }),
2121
- __metadata("design:type", ActivityContainerComponent)
2122
- ], InPlaceInteractionContextComponent.prototype, "activityContainerComponent", void 0);
2677
+ Input(),
2678
+ __metadata("design:type", Object),
2679
+ __metadata("design:paramtypes", [Object])
2680
+ ], SelectCellRendererComponent.prototype, "row", null);
2123
2681
  __decorate([
2124
2682
  Input(),
2125
2683
  __metadata("design:type", Object)
2126
- ], InPlaceInteractionContextComponent.prototype, "animateFirstActivity", void 0);
2127
- InPlaceInteractionContextComponent = __decorate([
2684
+ ], SelectCellRendererComponent.prototype, "selectionModel", void 0);
2685
+ SelectCellRendererComponent = __decorate([
2128
2686
  Component({
2129
- selector: 'aup-in-place-interaction-context',
2130
- template: "<mat-tab-group no-tab-header [selectedIndex]=\"isActive() ? 1 : 0\" full-height-tabs [dynamicHeight]=\"false\" [animationDuration]=\"animationDuration\">\n <mat-tab>\n <ng-content></ng-content>\n </mat-tab>\n <mat-tab>\n <aup-activity-container #activityContainer [dynamicHeight]=\"false\"></aup-activity-container>\n </mat-tab>\n</mat-tab-group>\n\n",
2131
- styles: [":host{display:flex;flex-direction:column}mat-tab-group{flex:1}"]
2687
+ selector: 'aup-select-cell-renderer',
2688
+ template: "<mat-checkbox [pectinCommand]=\"selectCommand\" [checked]=\"isSelected()\"></mat-checkbox>\n",
2689
+ styles: [""]
2132
2690
  }),
2133
- __param(1, Inject(MAT_TABS_CONFIG)), __param(1, Optional()),
2134
- __metadata("design:paramtypes", [InteractionService, Object])
2135
- ], InPlaceInteractionContextComponent);
2136
- return InPlaceInteractionContextComponent;
2691
+ __metadata("design:paramtypes", [])
2692
+ ], SelectCellRendererComponent);
2693
+ return SelectCellRendererComponent;
2137
2694
  }(DisposableComponent));
2138
2695
 
2139
- var DialogInteractionContext = /** @class */ (function (_super) {
2140
- __extends(DialogInteractionContext, _super);
2141
- function DialogInteractionContext(identifier, api, dialogService, config) {
2696
+ var SelectHeaderCellRendererComponent = /** @class */ (function (_super) {
2697
+ __extends(SelectHeaderCellRendererComponent, _super);
2698
+ function SelectHeaderCellRendererComponent() {
2142
2699
  var _this = _super.call(this) || this;
2143
- _this.identifier = identifier;
2144
- _this.api = api;
2145
- _this.dialogService = dialogService;
2146
- _this.config = config;
2147
- _this.garbage = new GarbageCollector();
2148
- assert$1.notNil(dialogService);
2700
+ _this.selectCommand = Command.create(function () {
2701
+ _this.selectionModel.toggleAllCommand.execute();
2702
+ });
2149
2703
  return _this;
2150
2704
  }
2151
- DialogInteractionContext.prototype.cancelActiveActivity = function () {
2152
- return this.activityContainer.cancelActiveActivity();
2705
+ SelectHeaderCellRendererComponent.prototype.isSelected = function () {
2706
+ return this.selectionModel.allSelected.value;
2153
2707
  };
2154
- DialogInteractionContext.prototype.dispose = function () {
2155
- if (this.isActive()) {
2156
- lang.illegalState('Dispose called while active.');
2157
- }
2158
- this.garbage.dispose();
2708
+ SelectHeaderCellRendererComponent.prototype.isIntermediate = function () {
2709
+ return this.selectionModel.someSelected.value;
2159
2710
  };
2160
- DialogInteractionContext.prototype.registerDisposable = function (disposable) {
2161
- return this.garbage.registerDisposable(disposable);
2711
+ __decorate([
2712
+ Input(),
2713
+ __metadata("design:type", MultipleSelectionModel)
2714
+ ], SelectHeaderCellRendererComponent.prototype, "selectionModel", void 0);
2715
+ SelectHeaderCellRendererComponent = __decorate([
2716
+ Component({
2717
+ selector: 'aup-select-header-cell-renderer',
2718
+ template: "<mat-checkbox [pectinCommand]=\"selectCommand\" [checked]=\"isSelected()\" [indeterminate]=\"this.isIntermediate()\"></mat-checkbox>\n",
2719
+ styles: [""]
2720
+ }),
2721
+ __metadata("design:paramtypes", [])
2722
+ ], SelectHeaderCellRendererComponent);
2723
+ return SelectHeaderCellRendererComponent;
2724
+ }(DisposableComponent));
2725
+
2726
+ var ColumnModel = /** @class */ (function () {
2727
+ function ColumnModel(columnId, defaults) {
2728
+ this.columnId = columnId;
2729
+ this.defaults = defaults;
2730
+ this.cellHeaderRenderer(DefaultHeaderCellRendererComponent, function (component, column) {
2731
+ component.columnModel = column;
2732
+ });
2733
+ }
2734
+ ColumnModel.prototype.getHeaderText = function () {
2735
+ var _a;
2736
+ return ((_a = this.getColumnTextProperties()) === null || _a === void 0 ? void 0 : _a.headerText()) || this.getDefaultHeaderText();
2162
2737
  };
2163
- DialogInteractionContext.prototype.isActive = function () {
2164
- return !!this.activityContainer && this.activityContainer.isActive();
2738
+ ColumnModel.prototype.getDefaultHeaderText = function () {
2739
+ return this.columnId;
2165
2740
  };
2166
- DialogInteractionContext.prototype.createAndLaunchActivity = function (activityType, data, disableClose) {
2741
+ ColumnModel.prototype.getColumnTextProperties = function () {
2742
+ return this._columnTextProperties || this.defaults.getColumnTextProperties(this);
2743
+ };
2744
+ ColumnModel.prototype.textProperties = function (columnTextProperties) {
2745
+ this._columnTextProperties = columnTextProperties;
2746
+ return this;
2747
+ };
2748
+ ColumnModel.prototype.setCellRenderer = function (cellRenderer, initialiser) {
2749
+ this._cellRendererConfig = {
2750
+ portal: new ComponentPortal(cellRenderer),
2751
+ pushState: initialiser
2752
+ };
2753
+ };
2754
+ ColumnModel.prototype.cellHeaderRenderer = function (cellRenderer, initialiser) {
2755
+ this._columnHeaderConfig = {
2756
+ portal: new ComponentPortal(cellRenderer),
2757
+ initialiseComponent: initialiser
2758
+ };
2759
+ };
2760
+ ColumnModel.prototype.setCellEditor = function (cellEditor) {
2761
+ this._cellEditorConfig = cellEditor;
2762
+ };
2763
+ Object.defineProperty(ColumnModel.prototype, "cellRendererPortal", {
2764
+ get: function () {
2765
+ return this._cellRendererConfig.portal;
2766
+ },
2767
+ enumerable: true,
2768
+ configurable: true
2769
+ });
2770
+ Object.defineProperty(ColumnModel.prototype, "columnHeaderCellRendererPortal", {
2771
+ get: function () {
2772
+ return this._columnHeaderConfig.portal;
2773
+ },
2774
+ enumerable: true,
2775
+ configurable: true
2776
+ });
2777
+ Object.defineProperty(ColumnModel.prototype, "cellEditorPortal", {
2778
+ get: function () {
2779
+ var _a;
2780
+ return (_a = this._cellEditorConfig) === null || _a === void 0 ? void 0 : _a.portal;
2781
+ },
2782
+ enumerable: true,
2783
+ configurable: true
2784
+ });
2785
+ ColumnModel.prototype.hasEditor = function () {
2786
+ return !!this._cellEditorConfig;
2787
+ };
2788
+ ColumnModel.prototype.updateCellRenderer = function (component, row, editRowCommand, editSession) {
2789
+ this._cellRendererConfig.pushState(component, row, editRowCommand, editSession);
2790
+ };
2791
+ ColumnModel.prototype.initialiseHeader = function (component) {
2792
+ this._columnHeaderConfig.initialiseComponent(component, this);
2793
+ };
2794
+ ColumnModel.prototype.initialiseEditor = function (component, editSession) {
2795
+ this._cellEditorConfig.initialiseComponent(component, editSession);
2796
+ };
2797
+ __decorate([
2798
+ Memoize(),
2799
+ __metadata("design:type", Function),
2800
+ __metadata("design:paramtypes", []),
2801
+ __metadata("design:returntype", String)
2802
+ ], ColumnModel.prototype, "getHeaderText", null);
2803
+ __decorate([
2804
+ Memoize(),
2805
+ __metadata("design:type", Function),
2806
+ __metadata("design:paramtypes", []),
2807
+ __metadata("design:returntype", Object)
2808
+ ], ColumnModel.prototype, "getColumnTextProperties", null);
2809
+ return ColumnModel;
2810
+ }());
2811
+ var PropertyColumnModel = /** @class */ (function (_super) {
2812
+ __extends(PropertyColumnModel, _super);
2813
+ function PropertyColumnModel(property, defaults) {
2814
+ var _this = _super.call(this, property.toString(), defaults) || this;
2815
+ _this.property = property;
2816
+ _this.cellRenderer(DefaultCellRendererComponent);
2817
+ return _this;
2818
+ }
2819
+ PropertyColumnModel.prototype.cellRenderer = function (componentType) {
2167
2820
  var _this = this;
2168
- assert$1.isNil(this._currentActivityRef);
2169
- var config = __assign(__assign({}, this.config), {
2170
- disableClose: disableClose,
2171
- panelClass: 'dialog-interaction-context'
2821
+ this.setCellRenderer(componentType, function (component, row) {
2822
+ component.value = row[_this.property];
2172
2823
  });
2173
- var self = this;
2174
- var matDialogRef = this.dialogService.open(ActivityContainerComponent, config);
2175
- var activityContainer = this.activityContainer = matDialogRef.componentInstance;
2176
- this.activityContainer.initialise(this.identifier, this.api);
2177
- var activityResult = this.activityContainer.startActivity(activityType, data);
2178
- activityResult.finally(function () { return matDialogRef.close(); });
2179
- // we need to check if our onDone/onCancel methods above we called or if we were
2180
- // closed by the user clicking the backdrop. If the later then we need to cancel our
2181
- // activity.
2182
- matDialogRef.afterClosed().subscribe(function (promiseAlreadyFinished) {
2183
- if (activityContainer.isActive()) {
2184
- activityContainer.cancelActiveActivity();
2824
+ };
2825
+ PropertyColumnModel.prototype.cellEditor = function (editor, options) {
2826
+ var _this = this;
2827
+ this.setCellEditor({
2828
+ portal: new ComponentPortal(editor),
2829
+ initialiseComponent: function (component, editSession) {
2830
+ var formValueModel = editSession.form.pluck(_this.property);
2831
+ if (options === null || options === void 0 ? void 0 : options.validators) {
2832
+ formValueModel.validateUsing(options.validators);
2833
+ }
2834
+ component.valueModel = formValueModel;
2835
+ if (options === null || options === void 0 ? void 0 : options.initialiseComponent) {
2836
+ options.initialiseComponent(component);
2837
+ }
2185
2838
  }
2186
- _this.activityContainer = null;
2187
2839
  });
2188
- matDialogRef.updateSize();
2189
- matDialogRef.afterOpened().subscribe(function (promiseAlreadyFinished) {
2190
- matDialogRef.updateSize();
2840
+ return this;
2841
+ };
2842
+ return PropertyColumnModel;
2843
+ }(ColumnModel));
2844
+ var CustomValueColumnModel = /** @class */ (function (_super) {
2845
+ __extends(CustomValueColumnModel, _super);
2846
+ function CustomValueColumnModel(columnId, defaults, getValue) {
2847
+ var _this = _super.call(this, columnId, defaults) || this;
2848
+ _this.getValue = getValue;
2849
+ _this.cellRenderer(DefaultCellRendererComponent);
2850
+ return _this;
2851
+ }
2852
+ CustomValueColumnModel.prototype.cellRenderer = function (componentType) {
2853
+ var _this = this;
2854
+ this.setCellRenderer(componentType, function (component, row) {
2855
+ component.value = _this.getValue(row);
2191
2856
  });
2192
- return activityResult;
2193
2857
  };
2194
- return DialogInteractionContext;
2195
- }(AbstractInteractionContext));
2858
+ return CustomValueColumnModel;
2859
+ }(ColumnModel));
2860
+ var EditorControlColumnModel = /** @class */ (function (_super) {
2861
+ __extends(EditorControlColumnModel, _super);
2862
+ function EditorControlColumnModel(columnId, saveCommand, defaults) {
2863
+ var _this = _super.call(this, columnId, defaults) || this;
2864
+ _this.cellRenderer(EditRowControls);
2865
+ return _this;
2866
+ }
2867
+ EditorControlColumnModel.prototype.cellRenderer = function (componentType) {
2868
+ this.setCellRenderer(componentType, function (component, row, editRowCommand, editSession) {
2869
+ component.row = row;
2870
+ component.editSession = editSession;
2871
+ component.editRowCommand = editRowCommand;
2872
+ });
2873
+ };
2874
+ EditorControlColumnModel.prototype.getDefaultHeaderText = function () {
2875
+ return '';
2876
+ };
2877
+ return EditorControlColumnModel;
2878
+ }(ColumnModel));
2879
+ var CustomTemplateColumnModel = /** @class */ (function (_super) {
2880
+ __extends(CustomTemplateColumnModel, _super);
2881
+ function CustomTemplateColumnModel(columnId, defaults, component) {
2882
+ return _super.call(this, columnId, defaults) || this;
2883
+ }
2884
+ return CustomTemplateColumnModel;
2885
+ }(ColumnModel));
2886
+ var SelectionColumnModel = /** @class */ (function (_super) {
2887
+ __extends(SelectionColumnModel, _super);
2888
+ function SelectionColumnModel(columnId, defaults, selectionModel) {
2889
+ var _this = _super.call(this, columnId, defaults) || this;
2890
+ if (selectionModel instanceof MultipleSelectionModel) {
2891
+ _this.cellHeaderRenderer(SelectHeaderCellRendererComponent, function (component) {
2892
+ component.selectionModel = selectionModel;
2893
+ });
2894
+ }
2895
+ _this.setCellRenderer(SelectCellRendererComponent, function (component, row, editRowCommand, editSession) {
2896
+ component.row = row;
2897
+ component.selectionModel = selectionModel;
2898
+ });
2899
+ return _this;
2900
+ }
2901
+ SelectionColumnModel.prototype.getDefaultHeaderText = function () {
2902
+ return '';
2903
+ };
2904
+ return SelectionColumnModel;
2905
+ }(ColumnModel));
2906
+
2907
+ /**
2908
+ * Create your model:
2909
+ * @example
2910
+ * this.heroTableModel = TableModel.fromList(heroList, table => {
2911
+ * table.pluck("firstName");
2912
+ * table.pluck("lastName");
2913
+ * table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
2914
+ * });
2915
+ *
2916
+ * Create your table
2917
+ * @example
2918
+ * <aup-table [tableModel]="heroTableModel"></aup-table>
2919
+ *
2920
+ * Styling
2921
+ * @example
2922
+ * aup-table {
2923
+ * --column-gap: 10px; // defaults to 24px
2924
+ * aup-table-cell-renderer {
2925
+ * &:first-column {
2926
+ * // do stuff
2927
+ * }
2928
+ * &:last-column {
2929
+ * // do stuff
2930
+ * }
2931
+ * }
2932
+ * }
2933
+ */
2934
+ var TableComponent = /** @class */ (function (_super) {
2935
+ __extends(TableComponent, _super);
2936
+ function TableComponent() {
2937
+ return _super.call(this) || this;
2938
+ }
2939
+ TableComponent.prototype.ngOnInit = function () {
2940
+ var _a = Dsl.disposeWith(this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
2941
+ this.columns = chain(this.tableModel.columns);
2942
+ this.columnIds = chain(this.columns).pluck('columnId');
2943
+ };
2944
+ TableComponent.prototype.isEditing = function (row) {
2945
+ return !!this.tableModel.getEditSessionFor(row);
2946
+ };
2947
+ __decorate([
2948
+ Input(),
2949
+ TrackExternal(),
2950
+ __metadata("design:type", TableModel)
2951
+ ], TableComponent.prototype, "tableModel", void 0);
2952
+ TableComponent = __decorate([
2953
+ Component({
2954
+ selector: 'aup-table',
2955
+ template: "<table mat-table [dataSource]=\"tableModel.dataSource.value\" [trackBy]=\"tableModel.getTrackByFunction()\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\" matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef>\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\">\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"tableModel\"\n [editSession]=\"tableModel.getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value;\"></tr>\n\n</table>\n",
2956
+ styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host table{flex:1}"]
2957
+ }),
2958
+ __metadata("design:paramtypes", [])
2959
+ ], TableComponent);
2960
+ return TableComponent;
2961
+ }(DisposableComponent));
2962
+
2963
+ var ColumnTemplateDirective = /** @class */ (function () {
2964
+ function ColumnTemplateDirective(host, templateRef, viewContainer) {
2965
+ this.templateRef = templateRef;
2966
+ this.viewContainer = viewContainer;
2967
+ }
2968
+ ColumnTemplateDirective.ctorParameters = function () { return [
2969
+ { type: TableComponent },
2970
+ { type: TemplateRef },
2971
+ { type: ViewContainerRef }
2972
+ ]; };
2973
+ ColumnTemplateDirective = __decorate([
2974
+ Directive({
2975
+ selector: '[aupColumnTemplate]'
2976
+ }),
2977
+ __metadata("design:paramtypes", [TableComponent,
2978
+ TemplateRef,
2979
+ ViewContainerRef])
2980
+ ], ColumnTemplateDirective);
2981
+ return ColumnTemplateDirective;
2982
+ }());
2983
+
2984
+ var TableCellRendererComponent = /** @class */ (function () {
2985
+ function TableCellRendererComponent() {
2986
+ var _this = this;
2987
+ this.defaultClassNames = "aup-header-cell-renderer";
2988
+ this.editRowCommand = Command.create(function () {
2989
+ _this.tableModel.startEditSession(_this.row);
2990
+ });
2991
+ }
2992
+ TableCellRendererComponent.prototype.initialiseRenderer = function (instance) {
2993
+ if (this.renderer !== instance) {
2994
+ this.renderer = instance;
2995
+ this.column.updateCellRenderer(this.renderer, this.row, this.editRowCommand, this.editSession);
2996
+ }
2997
+ };
2998
+ TableCellRendererComponent.prototype.initialiseEditor = function (instance) {
2999
+ if (this.editor !== instance) {
3000
+ this.editor = instance;
3001
+ this.column.initialiseEditor(this.editor, this.editSession);
3002
+ }
3003
+ };
3004
+ TableCellRendererComponent.prototype.ngOnChanges = function (changes) {
3005
+ if (this.renderer) {
3006
+ this.column.updateCellRenderer(this.renderer, this.row, this.editRowCommand, this.editSession);
3007
+ this.renderer.editSession = this.editSession;
3008
+ }
3009
+ };
3010
+ TableCellRendererComponent.prototype.hasActiveEditor = function () {
3011
+ return this.editSession && this.column.hasEditor();
3012
+ };
3013
+ __decorate([
3014
+ Input(),
3015
+ __metadata("design:type", Object)
3016
+ ], TableCellRendererComponent.prototype, "row", void 0);
3017
+ __decorate([
3018
+ Input(),
3019
+ __metadata("design:type", ColumnModel)
3020
+ ], TableCellRendererComponent.prototype, "column", void 0);
3021
+ __decorate([
3022
+ Input(),
3023
+ __metadata("design:type", TableModel.EditSession)
3024
+ ], TableCellRendererComponent.prototype, "editSession", void 0);
3025
+ __decorate([
3026
+ Input(),
3027
+ __metadata("design:type", TableModel)
3028
+ ], TableCellRendererComponent.prototype, "tableModel", void 0);
3029
+ __decorate([
3030
+ HostBinding('class'),
3031
+ __metadata("design:type", Object)
3032
+ ], TableCellRendererComponent.prototype, "defaultClassNames", void 0);
3033
+ TableCellRendererComponent = __decorate([
3034
+ Component({
3035
+ selector: 'aup-table-cell-renderer',
3036
+ template: "<ng-container *ngIf=\"!hasActiveEditor()\" [cdkPortalOutlet]=\"column.cellRendererPortal\" (attached)=\"initialiseRenderer($event.instance)\"></ng-container>\n<ng-container *ngIf=\"hasActiveEditor()\" [cdkPortalOutlet]=\"column.cellEditorPortal\" (attached)=\"initialiseEditor($event.instance)\"></ng-container>\n",
3037
+ styles: [":host{display:flex;flex-direction:column;align-items:stretch}"]
3038
+ }),
3039
+ __metadata("design:paramtypes", [])
3040
+ ], TableCellRendererComponent);
3041
+ return TableCellRendererComponent;
3042
+ }());
3043
+
3044
+ var TableHeaderCellRendererComponent = /** @class */ (function () {
3045
+ function TableHeaderCellRendererComponent() {
3046
+ this.defaultClassNames = "aup-header-cell-renderer";
3047
+ }
3048
+ TableHeaderCellRendererComponent.prototype.initialiseHeader = function (instance) {
3049
+ if (this.renderer !== instance) {
3050
+ this.renderer = instance;
3051
+ this.column.initialiseHeader(this.renderer);
3052
+ }
3053
+ };
3054
+ __decorate([
3055
+ Input(),
3056
+ __metadata("design:type", ColumnModel)
3057
+ ], TableHeaderCellRendererComponent.prototype, "column", void 0);
3058
+ __decorate([
3059
+ HostBinding('class'),
3060
+ __metadata("design:type", Object)
3061
+ ], TableHeaderCellRendererComponent.prototype, "defaultClassNames", void 0);
3062
+ TableHeaderCellRendererComponent = __decorate([
3063
+ Component({
3064
+ selector: 'aup-table-header-cell-renderer',
3065
+ template: "<ng-container [cdkPortalOutlet]=\"column.columnHeaderCellRendererPortal\" (attached)=\"initialiseHeader($event.instance)\"></ng-container>\n",
3066
+ styles: [":host{display:flex;flex-direction:column;align-items:stretch}"]
3067
+ }),
3068
+ __metadata("design:paramtypes", [])
3069
+ ], TableHeaderCellRendererComponent);
3070
+ return TableHeaderCellRendererComponent;
3071
+ }());
2196
3072
 
2197
- var DIALOG_INTERACTION_SERVICE_DEFAULTS = new InjectionToken('DIALOG_INTERACTION_SERVICE_DEFAULTS');
2198
- var DialogInteractionContextFactory = /** @class */ (function (_super) {
2199
- __extends(DialogInteractionContextFactory, _super);
2200
- function DialogInteractionContextFactory(dialogService, dialogServiceDefaults, matDialogDefaultConfig) {
2201
- var _this = _super.call(this) || this;
2202
- _this.dialogService = dialogService;
2203
- _this.dialogServiceDefaults = dialogServiceDefaults;
2204
- _this.matDialogDefaultConfig = matDialogDefaultConfig;
2205
- assert$1.notNil(dialogService);
3073
+ var VerticalFocusContainerComponent = /** @class */ (function (_super) {
3074
+ __extends(VerticalFocusContainerComponent, _super);
3075
+ function VerticalFocusContainerComponent(focusManager) {
3076
+ var _this = _super.call(this, focusManager) || this;
3077
+ _this.focusManager = focusManager;
2206
3078
  return _this;
2207
3079
  }
2208
- DialogInteractionContextFactory.prototype.createInteractionContext = function (identifier, api) {
2209
- var config = __assign(__assign({ autoFocus: false, hasBackdrop: true, closeOnNavigation: false }, this.matDialogDefaultConfig), this.dialogServiceDefaults);
2210
- return new DialogInteractionContext(identifier, api, this.dialogService, config);
3080
+ VerticalFocusContainerComponent.prototype.arrowLeft = function (event) {
3081
+ if (this.leftArrowCommand.enabled.value) {
3082
+ event.preventDefault();
3083
+ event.stopPropagation();
3084
+ this.leftArrowCommand.execute();
3085
+ }
2211
3086
  };
2212
- DialogInteractionContextFactory.ctorParameters = function () { return [
2213
- { type: MatDialog },
2214
- { type: MatDialogConfig, decorators: [{ type: Optional }, { type: Inject, args: [DIALOG_INTERACTION_SERVICE_DEFAULTS,] }] },
2215
- { type: MatDialogConfig, decorators: [{ type: Optional }, { type: Inject, args: [MAT_DIALOG_DEFAULT_OPTIONS,] }] }
3087
+ VerticalFocusContainerComponent.prototype.arrowRight = function (event) {
3088
+ if (this.rightArrowCommand.enabled.value) {
3089
+ event.preventDefault();
3090
+ event.stopPropagation();
3091
+ this.rightArrowCommand.execute();
3092
+ }
3093
+ };
3094
+ VerticalFocusContainerComponent.prototype.arrowDown = function (event) {
3095
+ event.preventDefault();
3096
+ event.stopPropagation();
3097
+ this.focusManager.focusNext();
3098
+ };
3099
+ VerticalFocusContainerComponent.prototype.arrowUp = function (event) {
3100
+ event.preventDefault();
3101
+ event.stopPropagation();
3102
+ this.focusManager.focusPrevious();
3103
+ };
3104
+ VerticalFocusContainerComponent.prototype.ngOnInit = function () {
3105
+ };
3106
+ VerticalFocusContainerComponent.ctorParameters = function () { return [
3107
+ { type: FocusManager, decorators: [{ type: Self }] }
2216
3108
  ]; };
2217
- DialogInteractionContextFactory.ɵprov = ɵɵdefineInjectable({ factory: function DialogInteractionContextFactory_Factory() { return new DialogInteractionContextFactory(ɵɵinject(MatDialog), ɵɵinject(DIALOG_INTERACTION_SERVICE_DEFAULTS, 8), ɵɵinject(MAT_DIALOG_DEFAULT_OPTIONS, 8)); }, token: DialogInteractionContextFactory, providedIn: "root" });
2218
- DialogInteractionContextFactory = __decorate([
2219
- Injectable({
2220
- providedIn: 'root'
3109
+ __decorate([
3110
+ Input('command.arrowRight'),
3111
+ TrackExternal(),
3112
+ __metadata("design:type", Command)
3113
+ ], VerticalFocusContainerComponent.prototype, "rightArrowCommand", void 0);
3114
+ __decorate([
3115
+ Input('command.arrowLeft'),
3116
+ TrackExternal(),
3117
+ __metadata("design:type", Command)
3118
+ ], VerticalFocusContainerComponent.prototype, "leftArrowCommand", void 0);
3119
+ __decorate([
3120
+ HostListener('keyup.arrowLeft', ['$event']),
3121
+ __metadata("design:type", Function),
3122
+ __metadata("design:paramtypes", [KeyboardEvent]),
3123
+ __metadata("design:returntype", void 0)
3124
+ ], VerticalFocusContainerComponent.prototype, "arrowLeft", null);
3125
+ __decorate([
3126
+ HostListener('keyup.arrowRight', ['$event']),
3127
+ __metadata("design:type", Function),
3128
+ __metadata("design:paramtypes", [KeyboardEvent]),
3129
+ __metadata("design:returntype", void 0)
3130
+ ], VerticalFocusContainerComponent.prototype, "arrowRight", null);
3131
+ __decorate([
3132
+ HostListener('keyup.arrowDown', ['$event']),
3133
+ __metadata("design:type", Function),
3134
+ __metadata("design:paramtypes", [KeyboardEvent]),
3135
+ __metadata("design:returntype", void 0)
3136
+ ], VerticalFocusContainerComponent.prototype, "arrowDown", null);
3137
+ __decorate([
3138
+ HostListener('keyup.arrowUp', ['$event']),
3139
+ __metadata("design:type", Function),
3140
+ __metadata("design:paramtypes", [KeyboardEvent]),
3141
+ __metadata("design:returntype", void 0)
3142
+ ], VerticalFocusContainerComponent.prototype, "arrowUp", null);
3143
+ VerticalFocusContainerComponent = __decorate([
3144
+ Component({
3145
+ selector: 'aup-vertical-focus-container',
3146
+ template: "<ng-content></ng-content>\n",
3147
+ providers: [
3148
+ { provide: FocusManager }
3149
+ ],
3150
+ styles: [":host{display:block}"]
2221
3151
  }),
2222
- __param(1, Optional()), __param(1, Inject(DIALOG_INTERACTION_SERVICE_DEFAULTS)),
2223
- __param(2, Optional()), __param(2, Inject(MAT_DIALOG_DEFAULT_OPTIONS)),
2224
- __metadata("design:paramtypes", [MatDialog,
2225
- MatDialogConfig,
2226
- MatDialogConfig])
2227
- ], DialogInteractionContextFactory);
2228
- return DialogInteractionContextFactory;
2229
- }(ModalInteractionContextFactory));
3152
+ __param(0, Self()),
3153
+ __metadata("design:paramtypes", [FocusManager])
3154
+ ], VerticalFocusContainerComponent);
3155
+ return VerticalFocusContainerComponent;
3156
+ }(FocusContainerComponent));
2230
3157
 
2231
3158
  /**
2232
3159
  * @file Automatically generated by barrelsby.
2233
3160
  */
2234
3161
 
2235
- var AddItemInteractionContextComponent = /** @class */ (function (_super) {
2236
- __extends(AddItemInteractionContextComponent, _super);
2237
- function AddItemInteractionContextComponent() {
2238
- var _this = _super.call(this) || this;
2239
- _this.tabindex = 0;
2240
- _this.clickCommand = Command.create(function (context) {
2241
- if (_this.activityClass) {
2242
- _this.startActivity(_this.activityClass, _this.activityData).catch(function (e) {
2243
- // don't care.
2244
- });
2245
- }
2246
- else {
2247
- _this.addCommand.withContext(context).execute();
2248
- }
2249
- });
3162
+ var ActivityActionsComponent = /** @class */ (function (_super) {
3163
+ __extends(ActivityActionsComponent, _super);
3164
+ function ActivityActionsComponent() {
3165
+ var _this = _super !== null && _super.apply(this, arguments) || this;
3166
+ _this.align = 'start';
2250
3167
  return _this;
2251
3168
  }
2252
- Object.defineProperty(AddItemInteractionContextComponent.prototype, "active", {
3169
+ Object.defineProperty(ActivityActionsComponent.prototype, "alignEnd", {
2253
3170
  get: function () {
2254
- return this.interactionContext ? this.interactionContext.isActive() : false;
3171
+ return this.align === 'end';
2255
3172
  },
2256
3173
  enumerable: true,
2257
3174
  configurable: true
2258
3175
  });
2259
- AddItemInteractionContextComponent.prototype.startActivity = function (activityType, data) {
2260
- return this.interactionContext.startActivity(activityType, data);
3176
+ ActivityActionsComponent.prototype.ngOnInit = function () {
2261
3177
  };
2262
- AddItemInteractionContextComponent.prototype.ngOnInit = function () {
3178
+ ActivityActionsComponent.prototype.hasConfirmText = function () {
3179
+ return !___default.isEmpty(this.confirmText);
2263
3180
  };
2264
3181
  __decorate([
2265
3182
  Input(),
2266
- __metadata("design:type", String)
2267
- ], AddItemInteractionContextComponent.prototype, "label", void 0);
2268
- __decorate([
2269
- Input(),
2270
- __metadata("design:type", Object)
2271
- ], AddItemInteractionContextComponent.prototype, "activityClass", void 0);
3183
+ TrackExternal(),
3184
+ __metadata("design:type", Command)
3185
+ ], ActivityActionsComponent.prototype, "confirmCommand", void 0);
2272
3186
  __decorate([
2273
3187
  Input(),
2274
- __metadata("design:type", Object)
2275
- ], AddItemInteractionContextComponent.prototype, "activityData", void 0);
3188
+ __metadata("design:type", String)
3189
+ ], ActivityActionsComponent.prototype, "confirmText", void 0);
2276
3190
  __decorate([
2277
3191
  Input(),
2278
3192
  TrackExternal(),
2279
3193
  __metadata("design:type", Command)
2280
- ], AddItemInteractionContextComponent.prototype, "addCommand", void 0);
3194
+ ], ActivityActionsComponent.prototype, "cancelCommand", void 0);
2281
3195
  __decorate([
2282
- ViewChild(InPlaceInteractionContextComponent),
2283
- __metadata("design:type", InPlaceInteractionContextComponent)
2284
- ], AddItemInteractionContextComponent.prototype, "interactionContext", void 0);
3196
+ Input(),
3197
+ __metadata("design:type", String)
3198
+ ], ActivityActionsComponent.prototype, "align", void 0);
2285
3199
  __decorate([
2286
- HostBinding('class.interaction-active'),
3200
+ HostBinding('class.align-end'),
2287
3201
  __metadata("design:type", Boolean),
2288
3202
  __metadata("design:paramtypes", [])
2289
- ], AddItemInteractionContextComponent.prototype, "active", null);
2290
- __decorate([
2291
- HostBinding('tabindex'),
2292
- __metadata("design:type", Object)
2293
- ], AddItemInteractionContextComponent.prototype, "tabindex", void 0);
2294
- AddItemInteractionContextComponent = __decorate([
3203
+ ], ActivityActionsComponent.prototype, "alignEnd", null);
3204
+ ActivityActionsComponent = __decorate([
2295
3205
  Component({
2296
- selector: 'aup-add-item-interaction-context',
2297
- template: "<aup-in-place-interaction-context #interactionContext [animateFirstActivity]=\"false\">\n <a part=\"link\" class=\"link\" [pectinCommand]=\"clickCommand\"><mat-icon>add</mat-icon> {{label}}</a>\n</aup-in-place-interaction-context>\n",
2298
- styles: [":host{--def-link-color:var(--link-color, currentColor);--def-link-backgound:var(--link-background, rgba(0, 0, 0, 0.05));--def-link-border-radius:var(--link-border-radius, 4px);--def-link-padding:var(--link-padding, calc(var(--aup-default-padding) / 2));display:flex;flex-direction:column;border-radius:var(--def-link-border-radius);box-sizing:border-box;outline:0}:host:hover{--link-background:rgba(0,0,0,0.1)}aup-in-place-interaction-context{border-radius:var(--def-link-border-radius)}a.link{display:flex;flex-direction:row;align-items:center;border-radius:var(--def-link-border-radius);color:var(--def-link-color);background:var(--def-link-backgound);padding:var(--def-link-padding);cursor:pointer;text-decoration:none}a.link mat-icon{margin-right:8px}"]
2299
- }),
2300
- __metadata("design:paramtypes", [])
2301
- ], AddItemInteractionContextComponent);
2302
- return AddItemInteractionContextComponent;
3206
+ selector: 'aup-activity-actions',
3207
+ template: "<button class=\"cancel\" mat-icon-button [pectinCommand]=\"cancelCommand\">\n <mat-icon>clear</mat-icon>\n</button>\n<button class=\"confirm\" *ngIf=\"!hasConfirmText()\" mat-icon-button [pectinCommand]=\"confirmCommand\">\n <mat-icon>done</mat-icon>\n</button>\n<button class=\"confirm\" *ngIf=\"hasConfirmText()\" mat-button [pectinCommand]=\"confirmCommand\">{{confirmText}}</button>\n<div class=\"content\">\n <ng-content></ng-content>\n</div>\n",
3208
+ styles: [":host{display:-ms-grid;display:grid;grid-template-areas:\"cancel confirm content\";-ms-grid-columns:auto auto 1fr;grid-template-columns:auto auto 1fr;-ms-grid-rows:auto;grid-template-rows:auto;align-items:center;justify-content:end}:host.align-end{grid-template-areas:\"content cancel confirm\";-ms-grid-columns:1fr auto auto;grid-template-columns:1fr auto auto}.cancel{-ms-grid-row:1;-ms-grid-column:1;grid-area:cancel}:host.align-end>.cancel{-ms-grid-row:1;-ms-grid-column:2}.confirm{-ms-grid-row:1;-ms-grid-column:2;grid-area:confirm}:host.align-end>.confirm{-ms-grid-row:1;-ms-grid-column:3}.content{-ms-grid-row:1;-ms-grid-column:3;grid-area:content;text-align:left}:host.align-end>.content{-ms-grid-row:1;-ms-grid-column:1}"]
3209
+ })
3210
+ ], ActivityActionsComponent);
3211
+ return ActivityActionsComponent;
2303
3212
  }(DisposableComponent));
2304
3213
 
2305
3214
  var InteractionModule = /** @class */ (function () {
@@ -2327,14 +3236,18 @@ var InteractionModule = /** @class */ (function () {
2327
3236
  ActivityOutletComponent,
2328
3237
  InPlaceInteractionContextComponent,
2329
3238
  AddItemInteractionContextComponent,
2330
- ActivityActionsComponent
3239
+ ActivityActionsComponent,
3240
+ PopupInteractionContextComponent,
3241
+ InteractionContextTriggerFor
2331
3242
  ],
2332
3243
  exports: [
2333
3244
  ActivityContainerComponent,
2334
3245
  ActivityOutletComponent,
2335
3246
  InPlaceInteractionContextComponent,
2336
3247
  AddItemInteractionContextComponent,
2337
- ActivityActionsComponent
3248
+ ActivityActionsComponent,
3249
+ PopupInteractionContextComponent,
3250
+ InteractionContextTriggerFor
2338
3251
  ],
2339
3252
  entryComponents: [
2340
3253
  ActivityContainerComponent,
@@ -2343,13 +3256,94 @@ var InteractionModule = /** @class */ (function () {
2343
3256
  AlertDialogComponent
2344
3257
  ],
2345
3258
  providers: [
2346
- InteractionService,
3259
+ InteractionService
3260
+ // {
3261
+ // provide: MAT_TABS_CONFIG, useValue: { animationDuration: "2s" }
3262
+ // }
2347
3263
  ]
2348
3264
  })
2349
3265
  ], InteractionModule);
2350
3266
  return InteractionModule;
2351
3267
  }());
2352
3268
 
3269
+ var ComponentsModule = /** @class */ (function () {
3270
+ function ComponentsModule() {
3271
+ }
3272
+ ComponentsModule = __decorate([
3273
+ NgModule({
3274
+ declarations: [
3275
+ AbstractInputComponent,
3276
+ AbstractInputActivity,
3277
+ NumberInputComponent,
3278
+ StringInputComponent,
3279
+ StringInputActivity,
3280
+ TextInputComponent,
3281
+ PasswordInputComponent,
3282
+ SelectInputComponent,
3283
+ CheckboxInputComponent,
3284
+ ScrollContainerComponent,
3285
+ NoopComponent,
3286
+ SwitchCaseComponent,
3287
+ SwitchCaseWhenDirective,
3288
+ SwitchCaseDefaultDirective,
3289
+ FocusContainerComponent,
3290
+ VerticalFocusContainerComponent,
3291
+ FocusableComponent,
3292
+ CardContainerComponent,
3293
+ TableComponent,
3294
+ EditRowControls,
3295
+ ColumnTemplateDirective,
3296
+ DefaultCellRendererComponent,
3297
+ TableCellRendererComponent,
3298
+ SelectCellRendererComponent,
3299
+ SelectHeaderCellRendererComponent,
3300
+ DefaultHeaderCellRendererComponent,
3301
+ TableHeaderCellRendererComponent
3302
+ ],
3303
+ imports: [
3304
+ CommonModule,
3305
+ BrowserAnimationsModule,
3306
+ FormsModule,
3307
+ MatInputModule,
3308
+ MatFormFieldModule,
3309
+ MatSelectModule,
3310
+ MatTabsModule,
3311
+ DirectivesModule,
3312
+ MatIconModule,
3313
+ MatButtonModule,
3314
+ MatCheckboxModule,
3315
+ InteractionModule,
3316
+ MatTableModule,
3317
+ PortalModule
3318
+ ],
3319
+ exports: [
3320
+ NumberInputComponent,
3321
+ StringInputComponent,
3322
+ TextInputComponent,
3323
+ PasswordInputComponent,
3324
+ CheckboxInputComponent,
3325
+ SelectInputComponent,
3326
+ ScrollContainerComponent,
3327
+ NoopComponent,
3328
+ SwitchCaseComponent,
3329
+ SwitchCaseWhenDirective,
3330
+ SwitchCaseDefaultDirective,
3331
+ FocusContainerComponent,
3332
+ VerticalFocusContainerComponent,
3333
+ FocusableComponent,
3334
+ CardContainerComponent,
3335
+ TableComponent,
3336
+ EditRowControls,
3337
+ ColumnTemplateDirective
3338
+ ],
3339
+ providers: [
3340
+ FocusBindingFactory,
3341
+ ]
3342
+ })
3343
+ ], ComponentsModule);
3344
+ return ComponentsModule;
3345
+ }());
3346
+
2353
3347
  var ParameterDefinition = /** @class */ (function () {
2354
3348
  function ParameterDefinition(propertyName, options, urlFormat) {
2355
3349
  this.propertyName = propertyName;
@@ -5126,5 +6120,5 @@ function VisitParameterList(options) {
5126
6120
  * Generated bundle index. Do not edit.
5127
6121
  */
5128
6122
 
5129
- export { ACTIVITY_DATA, AUP_PLACE_CONFIG, AbstractInputComponent, AbstractInteractionContext, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, Activity, ActivityActionsComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, AddItemInteractionContextComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CardContainerComponent, 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, SidePlaceNavigationComponent, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TextInputComponent, UrlService, UrlSnapshot, VerticalFocusContainerComponent, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationEventsFinish, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, DirectivesModule as ɵa, CommandDirective as ɵb, PlaceOutletComponent as ɵba, leftRightPlaceAnimation as ɵbb, LEFT_RIGHT_PLACE_ANIMATION as ɵbc, AUP_PLACE_CONFIG as ɵbd, PlaceRouter as ɵbf, InteractionService as ɵbg, ModalInteractionContextFactory as ɵbh, UrlService as ɵbi, PlaceHistory as ɵbj, TabbedPlaceNavigationComponent as ɵbk, AbstractPlaceNavigationComponent as ɵbl, ListPlaceNavComponent as ɵbm, SidePlaceNavigationComponent as ɵbn, InteractionModule as ɵbo, ActivityContainerComponent as ɵbp, AbstractInteractionContext as ɵbq, ActivityOutletComponent as ɵbr, ConfirmationDialogComponent as ɵbs, ACTIVITY_DATA as ɵbt, Activity as ɵbu, ConfirmThenDialogComponent as ɵbw, AlertDialogComponent as ɵbx, InPlaceInteractionContextComponent as ɵbz, FocusBindingDirective as ɵc, AddItemInteractionContextComponent as ɵca, DisposableComponent as ɵcb, InPlaceInteractionContextComponent as ɵcc, ActivityActionsComponent as ɵcd, DisposableComponent as ɵd, FocusBindingFactory as ɵe, ComponentsModule as ɵf, NumberInputComponent as ɵg, AbstractInputComponent as ɵh, StringInputComponent as ɵi, TextInputComponent as ɵj, PasswordInputComponent as ɵk, SelectInputComponent as ɵl, CheckboxInputComponent as ɵm, ScrollContainerComponent as ɵn, NoopComponent as ɵo, SwitchCaseOption as ɵp, SwitchCaseWhenDirective as ɵq, SwitchCaseDefaultDirective as ɵr, SwitchCaseComponent as ɵs, FocusContainerComponent as ɵt, VerticalFocusContainerComponent as ɵu, FocusableComponent as ɵv, CardContainerComponent as ɵw, PlaceModule as ɵx, EmptyStateComponent as ɵy, BusyOverlayComponent as ɵz };
6123
+ export { ACTIVITY_DATA, AUP_PLACE_CONFIG, AbstractInputActivity, AbstractInputComponent, AbstractInteractionContext, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, Activity, ActivityActionsComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, AddItemInteractionContextComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CardContainerComponent, CheckboxInputComponent, ColumnModel, ColumnTemplateDirective, CommandDirective, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditorControlColumnModel, EmptyStateComponent, EventCleanUpSession, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, InPlaceInteractionContextComponent, InteractionContextTriggerFor, 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, PopupInteractionContextComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SelectCellRendererComponent, SelectHeaderCellRendererComponent, SelectInputComponent, SelectionColumnModel, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableCellRendererComponent, TableComponent, TableHeaderCellRendererComponent, TableModel, TextInputComponent, UrlService, UrlSnapshot, VerticalFocusContainerComponent, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationEventsFinish, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, DirectivesModule as ɵa, CommandDirective as ɵb, CardContainerComponent as ɵba, TableComponent as ɵbb, EditRowControls as ɵbc, ColumnTemplateDirective as ɵbd, DefaultCellRendererComponent as ɵbe, TableCellRendererComponent as ɵbf, SelectCellRendererComponent as ɵbg, SelectHeaderCellRendererComponent as ɵbh, DefaultHeaderCellRendererComponent as ɵbi, TableHeaderCellRendererComponent 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, InteractionService as ɵbw, ModalInteractionContextFactory as ɵbx, AddItemInteractionContextComponent as ɵby, DisposableComponent as ɵbz, FocusBindingDirective as ɵc, InPlaceInteractionContextComponent as ɵca, ActivityActionsComponent as ɵcb, PopupInteractionContextComponent as ɵcc, InteractionContextTriggerFor as ɵcd, PlaceModule as ɵce, EmptyStateComponent as ɵcf, BusyOverlayComponent as ɵcg, PlaceOutletComponent as ɵch, leftRightPlaceAnimation as ɵci, LEFT_RIGHT_PLACE_ANIMATION as ɵcj, AUP_PLACE_CONFIG as ɵck, PlaceRouter as ɵcm, UrlService as ɵcn, PlaceHistory as ɵco, TabbedPlaceNavigationComponent as ɵcp, AbstractPlaceNavigationComponent as ɵcq, ListPlaceNavComponent as ɵcr, SidePlaceNavigationComponent as ɵcs, DisposableComponent as ɵd, FocusBindingFactory as ɵe, ComponentsModule as ɵf, AbstractInputComponent as ɵg, AbstractInputActivity as ɵh, Activity as ɵi, ACTIVITY_DATA as ɵj, NumberInputComponent as ɵk, StringInputComponent as ɵl, StringInputActivity as ɵm, TextInputComponent as ɵn, PasswordInputComponent as ɵo, SelectInputComponent as ɵp, CheckboxInputComponent as ɵq, ScrollContainerComponent as ɵr, NoopComponent as ɵs, SwitchCaseOption as ɵt, SwitchCaseWhenDirective as ɵu, SwitchCaseDefaultDirective as ɵv, SwitchCaseComponent as ɵw, FocusContainerComponent as ɵx, VerticalFocusContainerComponent as ɵy, FocusableComponent as ɵz };
5130
6124
  //# sourceMappingURL=coolon-angular-ui-powerups.js.map