@porscheinformatik/material-addons 10.4.1 → 14.0.0-beta.0

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 (246) hide show
  1. package/esm2020/lib/button/button.mjs +7 -0
  2. package/esm2020/lib/button/button.module.mjs +26 -0
  3. package/esm2020/lib/button/danger-button/danger-button.component.mjs +28 -0
  4. package/esm2020/lib/button/flat-button/link-button.component.mjs +28 -0
  5. package/esm2020/lib/button/icon-button/icon-button.component.mjs +28 -0
  6. package/esm2020/lib/button/mad-basic-button.mjs +39 -0
  7. package/esm2020/lib/button/outline-button/outline-button.component.mjs +28 -0
  8. package/esm2020/lib/button/primary-button/primary-button.component.mjs +28 -0
  9. package/esm2020/lib/card/card.component.mjs +129 -0
  10. package/esm2020/lib/card/card.mjs +2 -0
  11. package/esm2020/lib/card/card.module.mjs +23 -0
  12. package/esm2020/lib/content-panel/content-header/content-header.component.mjs +11 -0
  13. package/esm2020/lib/content-panel/content-panel-container/content-panel-container.component.mjs +11 -0
  14. package/esm2020/lib/content-panel/content-panel-container-content/content-panel-container-content.component.mjs +11 -0
  15. package/esm2020/lib/content-panel/content-panel-container-footer/content-panel-container-footer.component.mjs +11 -0
  16. package/esm2020/lib/content-panel/content-panel.module.mjs +42 -0
  17. package/esm2020/lib/content-panel/main-container/main-container.component.mjs +11 -0
  18. package/esm2020/lib/data-table/data-table-action-type.mjs +6 -0
  19. package/esm2020/lib/data-table/data-table-action.mjs +2 -0
  20. package/esm2020/lib/data-table/data-table-column-definition.mjs +2 -0
  21. package/esm2020/lib/data-table/data-table-column.mjs +2 -0
  22. package/esm2020/lib/data-table/data-table-columns-modal/data-table-columns-modal.component.mjs +103 -0
  23. package/esm2020/lib/data-table/data-table.component.mjs +504 -0
  24. package/esm2020/lib/data-table/data-table.mjs +3 -0
  25. package/esm2020/lib/data-table/data-table.module.mjs +81 -0
  26. package/esm2020/lib/flowbar/flowbar.component.mjs +190 -0
  27. package/esm2020/lib/flowbar/flowbar.module.mjs +19 -0
  28. package/esm2020/lib/material-action-button/material-action-button.component.mjs +34 -0
  29. package/esm2020/lib/material-action-button/material-action-button.module.mjs +22 -0
  30. package/esm2020/lib/material-addons.module.mjs +45 -0
  31. package/esm2020/lib/numeric-field/number-format.service.mjs +139 -0
  32. package/esm2020/lib/numeric-field/numeric-field.directive.mjs +295 -0
  33. package/esm2020/lib/numeric-field/numeric-field.mjs +2 -0
  34. package/esm2020/lib/numeric-field/numeric-field.module.mjs +24 -0
  35. package/esm2020/lib/quick-list/base-quick-list.component.mjs +101 -0
  36. package/esm2020/lib/quick-list/quick-list-compact/quick-list-compact.component.mjs +20 -0
  37. package/esm2020/lib/quick-list/quick-list.component.mjs +21 -0
  38. package/esm2020/lib/quick-list/quick-list.mjs +4 -0
  39. package/esm2020/lib/quick-list/quick-list.module.mjs +23 -0
  40. package/esm2020/lib/readonly/readonly-form-field/readonly-form-field.component.mjs +155 -0
  41. package/esm2020/lib/readonly/readonly-form-field-wrapper/readonly-form-field-wrapper.component.mjs +185 -0
  42. package/esm2020/lib/readonly/readonly-form-field.module.mjs +24 -0
  43. package/esm2020/lib/stepper/mad-stepper-animation.mjs +13 -0
  44. package/esm2020/lib/stepper/step-header/step-header.component.mjs +78 -0
  45. package/esm2020/lib/stepper/stepper.component.mjs +160 -0
  46. package/esm2020/lib/stepper/stepper.module.mjs +23 -0
  47. package/esm2020/lib/table/column-header.mjs +2 -0
  48. package/esm2020/lib/table/table-action.mjs +2 -0
  49. package/esm2020/lib/table/table.component.mjs +130 -0
  50. package/esm2020/lib/table/table.mjs +2 -0
  51. package/esm2020/lib/table/table.module.mjs +56 -0
  52. package/esm2020/lib/throttle-click/throttle-click.directive.mjs +38 -0
  53. package/esm2020/lib/throttle-click/throttle-click.module.mjs +18 -0
  54. package/esm2020/lib/toolbar/toolbar-action.interface.mjs +2 -0
  55. package/esm2020/lib/toolbar/toolbar.component.mjs +78 -0
  56. package/esm2020/lib/toolbar/toolbar.module.mjs +56 -0
  57. package/esm2020/lib/toolbar/toolbar.service.mjs +124 -0
  58. package/esm2020/porscheinformatik-material-addons.mjs +5 -0
  59. package/esm2020/public_api.mjs +41 -0
  60. package/fesm2015/porscheinformatik-material-addons.mjs +2984 -0
  61. package/fesm2015/porscheinformatik-material-addons.mjs.map +1 -0
  62. package/fesm2020/porscheinformatik-material-addons.mjs +2962 -0
  63. package/fesm2020/porscheinformatik-material-addons.mjs.map +1 -0
  64. package/index.d.ts +6 -0
  65. package/lib/button/button.d.ts +7 -0
  66. package/lib/button/button.d.ts.map +1 -0
  67. package/lib/button/button.module.d.ts +15 -0
  68. package/lib/button/button.module.d.ts.map +1 -0
  69. package/lib/button/danger-button/danger-button.component.d.ts +4 -0
  70. package/lib/button/danger-button/danger-button.component.d.ts.map +1 -0
  71. package/lib/button/flat-button/link-button.component.d.ts +4 -0
  72. package/lib/button/flat-button/link-button.component.d.ts.map +1 -0
  73. package/lib/button/icon-button/icon-button.component.d.ts +4 -0
  74. package/lib/button/icon-button/icon-button.component.d.ts.map +1 -0
  75. package/lib/button/mad-basic-button.d.ts +5 -1
  76. package/lib/button/mad-basic-button.d.ts.map +1 -0
  77. package/lib/button/outline-button/outline-button.component.d.ts +4 -0
  78. package/lib/button/outline-button/outline-button.component.d.ts.map +1 -0
  79. package/lib/button/primary-button/primary-button.component.d.ts +4 -0
  80. package/lib/button/primary-button/primary-button.component.d.ts.map +1 -0
  81. package/lib/card/card.component.d.ts +4 -0
  82. package/lib/card/card.component.d.ts.map +1 -0
  83. package/lib/card/card.d.ts +2 -0
  84. package/lib/card/card.d.ts.map +1 -0
  85. package/lib/card/card.module.d.ts +12 -0
  86. package/lib/card/card.module.d.ts.map +1 -0
  87. package/lib/content-panel/content-header/content-header.component.d.ts +4 -0
  88. package/lib/content-panel/content-header/content-header.component.d.ts.map +1 -0
  89. package/lib/content-panel/content-panel-container/content-panel-container.component.d.ts +4 -0
  90. package/lib/content-panel/content-panel-container/content-panel-container.component.d.ts.map +1 -0
  91. package/lib/content-panel/content-panel-container-content/content-panel-container-content.component.d.ts +4 -0
  92. package/lib/content-panel/content-panel-container-content/content-panel-container-content.component.d.ts.map +1 -0
  93. package/lib/content-panel/content-panel-container-footer/content-panel-container-footer.component.d.ts +4 -0
  94. package/lib/content-panel/content-panel-container-footer/content-panel-container-footer.component.d.ts.map +1 -0
  95. package/lib/content-panel/content-panel.module.d.ts +11 -0
  96. package/lib/content-panel/content-panel.module.d.ts.map +1 -0
  97. package/lib/content-panel/main-container/main-container.component.d.ts +4 -0
  98. package/lib/content-panel/main-container/main-container.component.d.ts.map +1 -0
  99. package/lib/data-table/data-table-action-type.d.ts +1 -0
  100. package/lib/data-table/data-table-action-type.d.ts.map +1 -0
  101. package/lib/data-table/data-table-action.d.ts +1 -0
  102. package/lib/data-table/data-table-action.d.ts.map +1 -0
  103. package/lib/data-table/data-table-column-definition.d.ts +1 -0
  104. package/lib/data-table/data-table-column-definition.d.ts.map +1 -0
  105. package/lib/data-table/data-table-column.d.ts +1 -0
  106. package/lib/data-table/data-table-column.d.ts.map +1 -0
  107. package/lib/data-table/data-table-columns-modal/data-table-columns-modal.component.d.ts +4 -0
  108. package/lib/data-table/data-table-columns-modal/data-table-columns-modal.component.d.ts.map +1 -0
  109. package/lib/data-table/data-table.component.d.ts +4 -0
  110. package/lib/data-table/data-table.component.d.ts.map +1 -0
  111. package/lib/data-table/data-table.d.ts +3 -0
  112. package/lib/data-table/data-table.d.ts.map +1 -0
  113. package/lib/data-table/data-table.module.d.ts +23 -0
  114. package/lib/data-table/data-table.module.d.ts.map +1 -0
  115. package/lib/flowbar/flowbar.component.d.ts +4 -0
  116. package/lib/flowbar/flowbar.component.d.ts.map +1 -0
  117. package/lib/flowbar/flowbar.module.d.ts +8 -0
  118. package/lib/flowbar/flowbar.module.d.ts.map +1 -0
  119. package/lib/material-action-button/material-action-button.component.d.ts +4 -0
  120. package/lib/material-action-button/material-action-button.component.d.ts.map +1 -0
  121. package/lib/material-action-button/material-action-button.module.d.ts +11 -0
  122. package/lib/material-action-button/material-action-button.module.d.ts.map +1 -0
  123. package/lib/material-addons.module.d.ts +13 -0
  124. package/lib/material-addons.module.d.ts.map +1 -0
  125. package/lib/numeric-field/number-format.service.d.ts +4 -0
  126. package/lib/numeric-field/number-format.service.d.ts.map +1 -0
  127. package/lib/numeric-field/numeric-field.d.ts +2 -0
  128. package/lib/numeric-field/numeric-field.d.ts.map +1 -0
  129. package/lib/numeric-field/numeric-field.directive.d.ts +4 -0
  130. package/lib/numeric-field/numeric-field.directive.d.ts.map +1 -0
  131. package/lib/numeric-field/numeric-field.module.d.ts +6 -0
  132. package/lib/numeric-field/numeric-field.module.d.ts.map +1 -0
  133. package/lib/quick-list/base-quick-list.component.d.ts +4 -0
  134. package/lib/quick-list/base-quick-list.component.d.ts.map +1 -0
  135. package/lib/quick-list/quick-list-compact/quick-list-compact.component.d.ts +4 -0
  136. package/lib/quick-list/quick-list-compact/quick-list-compact.component.d.ts.map +1 -0
  137. package/lib/quick-list/quick-list.component.d.ts +4 -0
  138. package/lib/quick-list/quick-list.component.d.ts.map +1 -0
  139. package/lib/quick-list/quick-list.d.ts +4 -0
  140. package/lib/quick-list/quick-list.d.ts.map +1 -0
  141. package/lib/quick-list/quick-list.module.d.ts +12 -0
  142. package/lib/quick-list/quick-list.module.d.ts.map +1 -0
  143. package/lib/readonly/readonly-form-field/readonly-form-field.component.d.ts +4 -0
  144. package/lib/readonly/readonly-form-field/readonly-form-field.component.d.ts.map +1 -0
  145. package/lib/readonly/readonly-form-field-wrapper/readonly-form-field-wrapper.component.d.ts +4 -0
  146. package/lib/readonly/readonly-form-field-wrapper/readonly-form-field-wrapper.component.d.ts.map +1 -0
  147. package/lib/readonly/readonly-form-field.module.d.ts +13 -0
  148. package/lib/readonly/readonly-form-field.module.d.ts.map +1 -0
  149. package/lib/stepper/mad-stepper-animation.d.ts +1 -0
  150. package/lib/stepper/mad-stepper-animation.d.ts.map +1 -0
  151. package/lib/stepper/step-header/step-header.component.d.ts +4 -0
  152. package/lib/stepper/step-header/step-header.component.d.ts.map +1 -0
  153. package/lib/stepper/stepper.component.d.ts +7 -1
  154. package/lib/stepper/stepper.component.d.ts.map +1 -0
  155. package/lib/stepper/stepper.module.d.ts +12 -0
  156. package/lib/stepper/stepper.module.d.ts.map +1 -0
  157. package/lib/table/column-header.d.ts +1 -0
  158. package/lib/table/column-header.d.ts.map +1 -0
  159. package/lib/table/table-action.d.ts +1 -0
  160. package/lib/table/table-action.d.ts.map +1 -0
  161. package/lib/table/table.component.d.ts +4 -0
  162. package/lib/table/table.component.d.ts.map +1 -0
  163. package/lib/table/table.d.ts +2 -0
  164. package/lib/table/table.d.ts.map +1 -0
  165. package/lib/table/table.module.d.ts +16 -0
  166. package/lib/table/table.module.d.ts.map +1 -0
  167. package/lib/throttle-click/throttle-click.directive.d.ts +4 -0
  168. package/lib/throttle-click/throttle-click.directive.d.ts.map +1 -0
  169. package/lib/throttle-click/throttle-click.module.d.ts +7 -0
  170. package/lib/throttle-click/throttle-click.module.d.ts.map +1 -0
  171. package/lib/toolbar/toolbar-action.interface.d.ts +1 -0
  172. package/lib/toolbar/toolbar-action.interface.d.ts.map +1 -0
  173. package/lib/toolbar/toolbar.component.d.ts +4 -0
  174. package/lib/toolbar/toolbar.component.d.ts.map +1 -0
  175. package/lib/toolbar/toolbar.module.d.ts +16 -0
  176. package/lib/toolbar/toolbar.module.d.ts.map +1 -0
  177. package/lib/toolbar/toolbar.service.d.ts +4 -0
  178. package/lib/toolbar/toolbar.service.d.ts.map +1 -0
  179. package/package.json +35 -20
  180. package/porscheinformatik-material-addons.d.ts.map +1 -0
  181. package/{public-api.d.ts → public_api.d.ts} +5 -0
  182. package/public_api.d.ts.map +1 -0
  183. package/themes/common/styles.scss +23 -22
  184. package/bundles/porscheinformatik-material-addons.umd.js +0 -3301
  185. package/bundles/porscheinformatik-material-addons.umd.js.map +0 -1
  186. package/bundles/porscheinformatik-material-addons.umd.min.js +0 -17
  187. package/bundles/porscheinformatik-material-addons.umd.min.js.map +0 -1
  188. package/esm2015/lib/button/button.module.js +0 -21
  189. package/esm2015/lib/button/danger-button/danger-button.component.js +0 -25
  190. package/esm2015/lib/button/flat-button/link-button.component.js +0 -25
  191. package/esm2015/lib/button/icon-button/icon-button.component.js +0 -25
  192. package/esm2015/lib/button/mad-basic-button.js +0 -28
  193. package/esm2015/lib/button/outline-button/outline-button.component.js +0 -25
  194. package/esm2015/lib/button/primary-button/primary-button.component.js +0 -25
  195. package/esm2015/lib/card/card.component.js +0 -86
  196. package/esm2015/lib/card/card.module.js +0 -18
  197. package/esm2015/lib/content-panel/content-header/content-header.component.js +0 -11
  198. package/esm2015/lib/content-panel/content-panel-container/content-panel-container.component.js +0 -11
  199. package/esm2015/lib/content-panel/content-panel-container-content/content-panel-container-content.component.js +0 -11
  200. package/esm2015/lib/content-panel/content-panel-container-footer/content-panel-container-footer.component.js +0 -11
  201. package/esm2015/lib/content-panel/content-panel.module.js +0 -29
  202. package/esm2015/lib/content-panel/main-container/main-container.component.js +0 -11
  203. package/esm2015/lib/data-table/data-table-action-type.js +0 -6
  204. package/esm2015/lib/data-table/data-table-action.js +0 -1
  205. package/esm2015/lib/data-table/data-table-column-definition.js +0 -1
  206. package/esm2015/lib/data-table/data-table-column.js +0 -1
  207. package/esm2015/lib/data-table/data-table-columns-modal/data-table-columns-modal.component.js +0 -93
  208. package/esm2015/lib/data-table/data-table.component.js +0 -459
  209. package/esm2015/lib/data-table/data-table.js +0 -1
  210. package/esm2015/lib/data-table/data-table.module.js +0 -46
  211. package/esm2015/lib/flowbar/flowbar.component.js +0 -182
  212. package/esm2015/lib/flowbar/flowbar.module.js +0 -14
  213. package/esm2015/lib/material-action-button/material-action-button.component.js +0 -25
  214. package/esm2015/lib/material-action-button/material-action-button.module.js +0 -17
  215. package/esm2015/lib/material-addons.module.js +0 -26
  216. package/esm2015/lib/numeric-field/number-format.service.js +0 -137
  217. package/esm2015/lib/numeric-field/numeric-field.directive.js +0 -275
  218. package/esm2015/lib/numeric-field/numeric-field.module.js +0 -19
  219. package/esm2015/lib/quick-list/base-quick-list.component.js +0 -91
  220. package/esm2015/lib/quick-list/quick-list-compact/quick-list-compact.component.js +0 -18
  221. package/esm2015/lib/quick-list/quick-list.component.js +0 -19
  222. package/esm2015/lib/quick-list/quick-list.module.js +0 -18
  223. package/esm2015/lib/readonly/readonly-form-field/readonly-form-field.component.js +0 -131
  224. package/esm2015/lib/readonly/readonly-form-field-wrapper/readonly-form-field-wrapper.component.js +0 -164
  225. package/esm2015/lib/readonly/readonly-form-field.module.js +0 -19
  226. package/esm2015/lib/stepper/mad-stepper-animation.js +0 -13
  227. package/esm2015/lib/stepper/step-header/step-header.component.js +0 -75
  228. package/esm2015/lib/stepper/stepper.component.js +0 -169
  229. package/esm2015/lib/stepper/stepper.module.js +0 -18
  230. package/esm2015/lib/table/column-header.js +0 -1
  231. package/esm2015/lib/table/table-action.js +0 -1
  232. package/esm2015/lib/table/table.component.js +0 -106
  233. package/esm2015/lib/table/table.js +0 -1
  234. package/esm2015/lib/table/table.module.js +0 -33
  235. package/esm2015/lib/throttle-click/throttle-click.directive.js +0 -32
  236. package/esm2015/lib/throttle-click/throttle-click.module.js +0 -13
  237. package/esm2015/lib/toolbar/toolbar-action.interface.js +0 -1
  238. package/esm2015/lib/toolbar/toolbar.component.js +0 -71
  239. package/esm2015/lib/toolbar/toolbar.module.js +0 -33
  240. package/esm2015/lib/toolbar/toolbar.service.js +0 -127
  241. package/esm2015/porscheinformatik-material-addons.js +0 -19
  242. package/esm2015/public-api.js +0 -37
  243. package/fesm2015/porscheinformatik-material-addons.js +0 -2658
  244. package/fesm2015/porscheinformatik-material-addons.js.map +0 -1
  245. package/porscheinformatik-material-addons.d.ts +0 -19
  246. package/porscheinformatik-material-addons.metadata.json +0 -1
@@ -0,0 +1,2962 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, Input, NgModule, HostBinding, ElementRef, ViewChild, LOCALE_ID, Injectable, Inject, EventEmitter, forwardRef, Directive, Output, HostListener, TemplateRef, ContentChild, ViewChildren, ViewEncapsulation, ChangeDetectionStrategy, QueryList, Optional, ContentChildren } from '@angular/core';
3
+ import * as i1 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import * as i1$1 from '@angular/router';
6
+ import { RouterModule, NavigationEnd } from '@angular/router';
7
+ import * as i1$2 from '@angular/material/button';
8
+ import { MatButtonModule } from '@angular/material/button';
9
+ import * as i2 from '@angular/material/icon';
10
+ import { MatIconModule } from '@angular/material/icon';
11
+ import * as i5 from '@angular/material/tooltip';
12
+ import { MatTooltipModule } from '@angular/material/tooltip';
13
+ import * as i3 from '@angular/material/form-field';
14
+ import { MatFormFieldModule } from '@angular/material/form-field';
15
+ import * as i4 from '@angular/material/input';
16
+ import { MatInputModule } from '@angular/material/input';
17
+ import * as i5$1 from '@angular/forms';
18
+ import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
19
+ import { of, Subject, Subscription } from 'rxjs';
20
+ import * as i1$3 from '@angular/cdk/layout';
21
+ import { Breakpoints } from '@angular/cdk/layout';
22
+ import { map, throttleTime, switchMap, tap, startWith, takeUntil, distinctUntilChanged } from 'rxjs/operators';
23
+ import * as i2$2 from '@angular/platform-browser';
24
+ import * as i2$1 from '@ngx-translate/core';
25
+ import { TranslateModule } from '@ngx-translate/core';
26
+ import * as i6 from '@angular/material/menu';
27
+ import { MatMenuModule } from '@angular/material/menu';
28
+ import * as i8 from '@angular/material/toolbar';
29
+ import { MatToolbarModule } from '@angular/material/toolbar';
30
+ import * as i14 from '@angular/material/badge';
31
+ import { MatBadgeModule } from '@angular/material/badge';
32
+ import { trigger, transition, style, animate, state } from '@angular/animations';
33
+ import * as i2$3 from '@angular/material/card';
34
+ import { MatCardModule } from '@angular/material/card';
35
+ import * as i8$1 from '@angular/material/table';
36
+ import { MatTableDataSource, MatTableModule } from '@angular/material/table';
37
+ import * as i6$1 from '@angular/material/paginator';
38
+ import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
39
+ import * as i7 from '@angular/material/sort';
40
+ import { MatSort, MatSortModule } from '@angular/material/sort';
41
+ import * as i1$4 from '@angular/material/dialog';
42
+ import { MAT_DIALOG_DATA } from '@angular/material/dialog';
43
+ import * as i10 from '@angular/cdk/drag-drop';
44
+ import { moveItemInArray, transferArrayItem, DragDropModule } from '@angular/cdk/drag-drop';
45
+ import { SelectionModel } from '@angular/cdk/collections';
46
+ import { v4 } from 'uuid';
47
+ import * as i10$1 from '@angular/material/progress-spinner';
48
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
49
+ import * as i13 from '@angular/material/checkbox';
50
+ import { MatCheckboxModule } from '@angular/material/checkbox';
51
+ import { CdkStepHeader, STEP_STATE, CdkStep, CdkStepper, CdkStepperModule } from '@angular/cdk/stepper';
52
+ import * as i1$5 from '@angular/cdk/a11y';
53
+ import * as i4$1 from '@angular/flex-layout';
54
+ import { FlexModule } from '@angular/flex-layout';
55
+ import * as i4$2 from '@angular/cdk/bidi';
56
+ import * as i2$4 from '@angular/material/stepper';
57
+ import { MatStepperModule } from '@angular/material/stepper';
58
+
59
+ class MaterialActionButtonComponent {
60
+ constructor() {
61
+ this.icon = 'add';
62
+ // Sets the lower padding higher providing some bottom space for a fixed paginator
63
+ this.liftHigher = true;
64
+ this.liftHigher2 = false;
65
+ }
66
+ }
67
+ MaterialActionButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MaterialActionButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
68
+ MaterialActionButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: MaterialActionButtonComponent, selector: "mad-material-action-button", inputs: { actionName: "actionName", id: "id", icon: "icon", routerLink: "routerLink", liftHigher: "liftHigher", liftHigher2: "liftHigher2" }, ngImport: i0, template: "<div class=\"material-action-button {{ liftHigher ? 'lift-higher' : '' }} {{ liftHigher2 ? 'lift-higher-2' : '' }}\">\n <a [routerLink]=\"routerLink\">\n <button [id]=\"id\" mat-fab [matTooltipPosition]=\"'left'\" [matTooltip]=\"actionName\" color=\"primary\" *ngIf=\"!liftHigher2\">\n <mat-icon>{{ icon }}</mat-icon>\n </button>\n <button [id]=\"id\" mat-mini-fab [matTooltipPosition]=\"'left'\" [matTooltip]=\"actionName\" color=\"accent\" *ngIf=\"liftHigher2\">\n <mat-icon>{{ icon }}</mat-icon>\n </button>\n </a>\n</div>\n", styles: [".material-action-button{position:fixed;bottom:20px;right:20px;z-index:100;display:flex;flex-direction:column-reverse;align-items:center}.lift-higher{bottom:61px}.lift-higher-2{right:28px;bottom:121px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
69
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MaterialActionButtonComponent, decorators: [{
70
+ type: Component,
71
+ args: [{ selector: 'mad-material-action-button', template: "<div class=\"material-action-button {{ liftHigher ? 'lift-higher' : '' }} {{ liftHigher2 ? 'lift-higher-2' : '' }}\">\n <a [routerLink]=\"routerLink\">\n <button [id]=\"id\" mat-fab [matTooltipPosition]=\"'left'\" [matTooltip]=\"actionName\" color=\"primary\" *ngIf=\"!liftHigher2\">\n <mat-icon>{{ icon }}</mat-icon>\n </button>\n <button [id]=\"id\" mat-mini-fab [matTooltipPosition]=\"'left'\" [matTooltip]=\"actionName\" color=\"accent\" *ngIf=\"liftHigher2\">\n <mat-icon>{{ icon }}</mat-icon>\n </button>\n </a>\n</div>\n", styles: [".material-action-button{position:fixed;bottom:20px;right:20px;z-index:100;display:flex;flex-direction:column-reverse;align-items:center}.lift-higher{bottom:61px}.lift-higher-2{right:28px;bottom:121px}\n"] }]
72
+ }], propDecorators: { actionName: [{
73
+ type: Input
74
+ }], id: [{
75
+ type: Input
76
+ }], icon: [{
77
+ type: Input
78
+ }], routerLink: [{
79
+ type: Input
80
+ }], liftHigher: [{
81
+ type: Input
82
+ }], liftHigher2: [{
83
+ type: Input
84
+ }] } });
85
+
86
+ class MaterialActionButtonModule {
87
+ }
88
+ MaterialActionButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MaterialActionButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
89
+ MaterialActionButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: MaterialActionButtonModule, declarations: [MaterialActionButtonComponent], imports: [CommonModule, RouterModule, MatButtonModule, MatIconModule, MatTooltipModule], exports: [MaterialActionButtonComponent] });
90
+ MaterialActionButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MaterialActionButtonModule, imports: [CommonModule, RouterModule, MatButtonModule, MatIconModule, MatTooltipModule] });
91
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MaterialActionButtonModule, decorators: [{
92
+ type: NgModule,
93
+ args: [{
94
+ declarations: [MaterialActionButtonComponent],
95
+ imports: [CommonModule, RouterModule, MatButtonModule, MatIconModule, MatTooltipModule],
96
+ exports: [MaterialActionButtonComponent],
97
+ }]
98
+ }] });
99
+
100
+ class MadBasicButton {
101
+ constructor() {
102
+ this.disableClick = (e) => e.stopPropagation();
103
+ }
104
+ get pointerEvent() {
105
+ return this.disabled ? 'none' : 'auto';
106
+ }
107
+ get opacity() {
108
+ return this.disabled ? '0.35' : '1';
109
+ }
110
+ ngOnChanges() {
111
+ this.disableButton();
112
+ }
113
+ disableButton() {
114
+ if (this.disabled) {
115
+ this.button.nativeElement.addEventListener('click', this.disableClick);
116
+ }
117
+ else {
118
+ this.button.nativeElement.removeEventListener('click', this.disableClick);
119
+ }
120
+ }
121
+ }
122
+ MadBasicButton.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MadBasicButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
123
+ MadBasicButton.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: MadBasicButton, selector: "ng-component", host: { properties: { "style.pointer-events": "this.pointerEvent", "style.opacity": "this.opacity" } }, usesOnChanges: true, ngImport: i0, template: '', isInline: true });
124
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MadBasicButton, decorators: [{
125
+ type: Component,
126
+ args: [{
127
+ template: ''
128
+ }]
129
+ }], propDecorators: { pointerEvent: [{
130
+ type: HostBinding,
131
+ args: ['style.pointer-events']
132
+ }], opacity: [{
133
+ type: HostBinding,
134
+ args: ['style.opacity']
135
+ }] } });
136
+
137
+ class DangerButtonComponent extends MadBasicButton {
138
+ constructor() {
139
+ super();
140
+ this.title = '';
141
+ super.button = this.button;
142
+ super.disabled = this.disabled;
143
+ }
144
+ }
145
+ DangerButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DangerButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
146
+ DangerButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: DangerButtonComponent, selector: "mad-danger-button", inputs: { type: "type", disabled: "disabled", title: "title" }, viewQueries: [{ propertyName: "button", first: true, predicate: ["btn"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<button mat-raised-button color=\"warn\" [type]=\"type\" [title]=\"title\" #btn>\n <ng-content></ng-content>\n</button>\n", styles: [""], dependencies: [{ kind: "component", type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
147
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DangerButtonComponent, decorators: [{
148
+ type: Component,
149
+ args: [{ selector: 'mad-danger-button', template: "<button mat-raised-button color=\"warn\" [type]=\"type\" [title]=\"title\" #btn>\n <ng-content></ng-content>\n</button>\n" }]
150
+ }], ctorParameters: function () { return []; }, propDecorators: { type: [{
151
+ type: Input
152
+ }], disabled: [{
153
+ type: Input
154
+ }], title: [{
155
+ type: Input
156
+ }], button: [{
157
+ type: ViewChild,
158
+ args: ['btn', { read: ElementRef, static: true }]
159
+ }] } });
160
+
161
+ class LinkButtonComponent extends MadBasicButton {
162
+ constructor() {
163
+ super();
164
+ this.title = '';
165
+ super.button = this.button;
166
+ super.disabled = this.disabled;
167
+ }
168
+ }
169
+ LinkButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: LinkButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
170
+ LinkButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: LinkButtonComponent, selector: "mad-link-button", inputs: { type: "type", disabled: "disabled", title: "title" }, viewQueries: [{ propertyName: "button", first: true, predicate: ["btn"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<button [title]=\"title\" [type]=\"type\" color=\"primary\" #btn mat-button>\n <ng-content></ng-content>\n</button>\n", styles: [""], dependencies: [{ kind: "component", type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
171
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: LinkButtonComponent, decorators: [{
172
+ type: Component,
173
+ args: [{ selector: 'mad-link-button', template: "<button [title]=\"title\" [type]=\"type\" color=\"primary\" #btn mat-button>\n <ng-content></ng-content>\n</button>\n" }]
174
+ }], ctorParameters: function () { return []; }, propDecorators: { type: [{
175
+ type: Input
176
+ }], disabled: [{
177
+ type: Input
178
+ }], title: [{
179
+ type: Input
180
+ }], button: [{
181
+ type: ViewChild,
182
+ args: ['btn', { read: ElementRef, static: true }]
183
+ }] } });
184
+
185
+ class IconButtonComponent extends MadBasicButton {
186
+ constructor() {
187
+ super();
188
+ this.title = '';
189
+ super.button = this.button;
190
+ super.disabled = this.disabled;
191
+ }
192
+ }
193
+ IconButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: IconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
194
+ IconButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: IconButtonComponent, selector: "mad-icon-button", inputs: { type: "type", disabled: "disabled", title: "title" }, viewQueries: [{ propertyName: "button", first: true, predicate: ["btn"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<button mat-icon-button color=\"primary\" [type]=\"type\" [title]=\"title\" #btn>\n <ng-content></ng-content>\n</button>\n", styles: [""], dependencies: [{ kind: "component", type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
195
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: IconButtonComponent, decorators: [{
196
+ type: Component,
197
+ args: [{ selector: 'mad-icon-button', template: "<button mat-icon-button color=\"primary\" [type]=\"type\" [title]=\"title\" #btn>\n <ng-content></ng-content>\n</button>\n" }]
198
+ }], ctorParameters: function () { return []; }, propDecorators: { type: [{
199
+ type: Input
200
+ }], disabled: [{
201
+ type: Input
202
+ }], title: [{
203
+ type: Input
204
+ }], button: [{
205
+ type: ViewChild,
206
+ args: ['btn', { read: ElementRef, static: true }]
207
+ }] } });
208
+
209
+ class OutlineButtonComponent extends MadBasicButton {
210
+ constructor() {
211
+ super();
212
+ this.title = '';
213
+ super.button = this.button;
214
+ super.disabled = this.disabled;
215
+ }
216
+ }
217
+ OutlineButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: OutlineButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
218
+ OutlineButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: { type: "type", disabled: "disabled", title: "title" }, viewQueries: [{ propertyName: "button", first: true, predicate: ["btn"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<button mat-stroked-button color=\"primary\" [type]=\"type\" [title]=\"title\" #btn>\n <ng-content></ng-content>\n</button>\n", styles: [""], dependencies: [{ kind: "component", type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
219
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: OutlineButtonComponent, decorators: [{
220
+ type: Component,
221
+ args: [{ selector: 'mad-outline-button', template: "<button mat-stroked-button color=\"primary\" [type]=\"type\" [title]=\"title\" #btn>\n <ng-content></ng-content>\n</button>\n" }]
222
+ }], ctorParameters: function () { return []; }, propDecorators: { type: [{
223
+ type: Input
224
+ }], disabled: [{
225
+ type: Input
226
+ }], title: [{
227
+ type: Input
228
+ }], button: [{
229
+ type: ViewChild,
230
+ args: ['btn', { read: ElementRef, static: true }]
231
+ }] } });
232
+
233
+ class PrimaryButtonComponent extends MadBasicButton {
234
+ constructor() {
235
+ super();
236
+ this.title = '';
237
+ super.button = this.button;
238
+ super.disabled = this.disabled;
239
+ }
240
+ }
241
+ PrimaryButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: PrimaryButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
242
+ PrimaryButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: PrimaryButtonComponent, selector: "mad-primary-button", inputs: { type: "type", disabled: "disabled", title: "title" }, viewQueries: [{ propertyName: "button", first: true, predicate: ["btn"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<button mat-raised-button color=\"primary\" [type]=\"type\" [title]=\"title\" #btn>\n <ng-content></ng-content>\n</button>\n", styles: [""], dependencies: [{ kind: "component", type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
243
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: PrimaryButtonComponent, decorators: [{
244
+ type: Component,
245
+ args: [{ selector: 'mad-primary-button', template: "<button mat-raised-button color=\"primary\" [type]=\"type\" [title]=\"title\" #btn>\n <ng-content></ng-content>\n</button>\n" }]
246
+ }], ctorParameters: function () { return []; }, propDecorators: { type: [{
247
+ type: Input
248
+ }], disabled: [{
249
+ type: Input
250
+ }], title: [{
251
+ type: Input
252
+ }], button: [{
253
+ type: ViewChild,
254
+ args: ['btn', { read: ElementRef, static: true }]
255
+ }] } });
256
+
257
+ class ButtonModule {
258
+ }
259
+ ButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
260
+ ButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: ButtonModule, declarations: [PrimaryButtonComponent, OutlineButtonComponent, LinkButtonComponent, DangerButtonComponent, IconButtonComponent], imports: [CommonModule, RouterModule, MatButtonModule, MatIconModule, MatTooltipModule], exports: [PrimaryButtonComponent, OutlineButtonComponent, LinkButtonComponent, DangerButtonComponent, IconButtonComponent] });
261
+ ButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ButtonModule, imports: [CommonModule, RouterModule, MatButtonModule, MatIconModule, MatTooltipModule] });
262
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ButtonModule, decorators: [{
263
+ type: NgModule,
264
+ args: [{
265
+ declarations: [PrimaryButtonComponent, OutlineButtonComponent, LinkButtonComponent, DangerButtonComponent, IconButtonComponent],
266
+ imports: [CommonModule, RouterModule, MatButtonModule, MatIconModule, MatTooltipModule],
267
+ exports: [PrimaryButtonComponent, OutlineButtonComponent, LinkButtonComponent, DangerButtonComponent, IconButtonComponent],
268
+ }]
269
+ }] });
270
+
271
+ class NumberFormatService {
272
+ constructor(locale) {
273
+ this.allowedKeys = [];
274
+ // try to get the current formatting
275
+ const localeDecimalSeparator = (1.1).toLocaleString(locale).charAt(1);
276
+ this.decimalSeparator = localeDecimalSeparator === ',' ? ',' : '.';
277
+ this.groupingSeparator = localeDecimalSeparator === ',' ? '.' : ',';
278
+ this.allowedKeys = [...NumberFormatService.NUMBERS, NumberFormatService.NEGATIVE, this.decimalSeparator];
279
+ }
280
+ static valueIsSet(value) {
281
+ return typeof value !== 'undefined' && value !== null && (typeof value !== 'string' || value.length !== 0);
282
+ }
283
+ format(value, options) {
284
+ return NumberFormatService.valueIsSet(value)
285
+ ? this.formatNumber(value.toString().replace(new RegExp('[.]', 'g'), this.decimalSeparator), options)
286
+ : '';
287
+ }
288
+ formatNumber(value, options) {
289
+ const autofillDecimals = this.valueOrDefault(options?.autofillDecimals, NumberFormatService.DEFAULT_AUTOFILL_DECIMALS);
290
+ const decimalPlaces = this.valueOrDefault(options?.decimalPlaces, NumberFormatService.DEFAULT_DECIMAL_PLACES);
291
+ const finalFormatting = this.valueOrDefault(options?.finalFormatting, NumberFormatService.DEFAULT_FINAL_FORMATTING);
292
+ let result = this.strip(value, { decimalPlaces, removeLeadingZeros: finalFormatting });
293
+ /* add grouping separator */
294
+ const decimalIndex = result.indexOf(this.decimalSeparator);
295
+ const isNegative = result.startsWith(NumberFormatService.NEGATIVE);
296
+ let i = decimalIndex > -1 ? decimalIndex : result.length;
297
+ while (i > (isNegative ? 4 : 3)) {
298
+ i -= 3;
299
+ result = result.substring(0, i) + this.groupingSeparator + result.substring(i, result.length);
300
+ }
301
+ if (finalFormatting) {
302
+ if (decimalPlaces > 0 && !!result) {
303
+ /* autofill decimal places */
304
+ let actualDecimalIndex = result.indexOf(this.decimalSeparator);
305
+ if (autofillDecimals) {
306
+ if (actualDecimalIndex === -1) {
307
+ actualDecimalIndex = result.length;
308
+ result += this.decimalSeparator;
309
+ }
310
+ result = this.addMissingLeadingZero(result, actualDecimalIndex);
311
+ actualDecimalIndex = result.indexOf(this.decimalSeparator);
312
+ const actualDecimalPlaces = result.length - actualDecimalIndex - 1;
313
+ for (let j = 0; j < decimalPlaces - actualDecimalPlaces; j++) {
314
+ result += '0';
315
+ }
316
+ }
317
+ else {
318
+ result = this.addMissingLeadingZero(result, actualDecimalIndex);
319
+ }
320
+ }
321
+ }
322
+ return result;
323
+ }
324
+ strip(value, options) {
325
+ const decimalPlaces = this.valueOrDefault(options?.decimalPlaces, NumberFormatService.DEFAULT_DECIMAL_PLACES);
326
+ const removeLeadingZeros = this.valueOrDefault(options?.removeLeadingZeros, NumberFormatService.DEFAULT_REMOVE_LEADING_ZEROS);
327
+ let result = '';
328
+ let indexDecimalSep = -1;
329
+ let j = -1;
330
+ let ignoredChars = 0;
331
+ for (const char of value) {
332
+ j++;
333
+ if (this.allowedKeys.includes(char)) {
334
+ if (char === this.decimalSeparator) {
335
+ if (decimalPlaces === 0) {
336
+ /* dismiss content after a decimal separator, when no places allowed */
337
+ break;
338
+ }
339
+ else if (indexDecimalSep > -1) {
340
+ /* ignore subsequent decimal separators */
341
+ continue;
342
+ }
343
+ indexDecimalSep = j;
344
+ }
345
+ if (char === '0' && removeLeadingZeros) {
346
+ /* remove leading zero only if it's not the only zero in the 'value' string */
347
+ if ((result.length === 0 && j + 1 !== value.length) || result === NumberFormatService.NEGATIVE) {
348
+ ignoredChars++;
349
+ continue;
350
+ }
351
+ }
352
+ if (char === NumberFormatService.NEGATIVE && j > 0) {
353
+ /* dismiss content after a negative sign not on first position */
354
+ break;
355
+ }
356
+ if (indexDecimalSep > -1 && result.length + ignoredChars > indexDecimalSep + decimalPlaces) {
357
+ /* dismiss content after maximum decimal places reached */
358
+ break;
359
+ }
360
+ result += char;
361
+ }
362
+ else if (char === this.groupingSeparator) {
363
+ if (indexDecimalSep === -1) {
364
+ ignoredChars++;
365
+ }
366
+ }
367
+ else {
368
+ /* dismiss content after a invalid character */
369
+ break;
370
+ }
371
+ }
372
+ return result;
373
+ }
374
+ addMissingLeadingZero(result, actualDecimalIndex) {
375
+ const isNegative = result.startsWith(NumberFormatService.NEGATIVE);
376
+ /* autoadd a zero before decimal separator, when it's missing */
377
+ if (actualDecimalIndex === 0) {
378
+ result = '0' + result;
379
+ }
380
+ /* autoadd a zero before decimal separator, when it's missing, for negative values */
381
+ if (actualDecimalIndex === 1 && isNegative) {
382
+ result = result[0] + '0' + result.substring(1, result.length);
383
+ }
384
+ return result;
385
+ }
386
+ valueOrDefault(value, defaultValue) {
387
+ return NumberFormatService.valueIsSet(value) ? value : defaultValue;
388
+ }
389
+ }
390
+ NumberFormatService.NEGATIVE = '-';
391
+ NumberFormatService.NUMBERS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
392
+ NumberFormatService.DEFAULT_FINAL_FORMATTING = true;
393
+ NumberFormatService.DEFAULT_DECIMAL_PLACES = 2;
394
+ NumberFormatService.DEFAULT_AUTOFILL_DECIMALS = false;
395
+ NumberFormatService.DEFAULT_REMOVE_LEADING_ZEROS = false;
396
+ NumberFormatService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: NumberFormatService, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Injectable });
397
+ NumberFormatService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: NumberFormatService, providedIn: 'any' });
398
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: NumberFormatService, decorators: [{
399
+ type: Injectable,
400
+ args: [{
401
+ providedIn: 'any',
402
+ }]
403
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
404
+ type: Inject,
405
+ args: [LOCALE_ID]
406
+ }] }]; } });
407
+
408
+ /**
409
+ * Read-only mat-form-field representation of provided value
410
+ *
411
+ * @author Stefan Laesser
412
+ */
413
+ class ReadOnlyFormFieldComponent {
414
+ constructor(changeDetector, renderer, numberFormatService) {
415
+ this.changeDetector = changeDetector;
416
+ this.renderer = renderer;
417
+ this.numberFormatService = numberFormatService;
418
+ this.textAlign = 'left';
419
+ this.formatNumber = false;
420
+ this.decimalPlaces = 2;
421
+ this.roundValue = false;
422
+ this.autofillDecimals = false;
423
+ this.unit = null;
424
+ this.unitPosition = 'left';
425
+ this.errorMessage = null;
426
+ this.multiline = false;
427
+ this.rows = 3;
428
+ /*
429
+ * If shrinkIfEmpty is set to "false", nothing changes
430
+ * If set to "true" and multiline is also "true", the textarea will
431
+ * shrink to one row, if value is empty/null/undefined.
432
+ * Otherwise, the defined rows-value will be used
433
+ */
434
+ this.shrinkIfEmpty = false;
435
+ this.errorMatcher = {
436
+ isErrorState: () => !!this.errorMessage,
437
+ };
438
+ }
439
+ ngOnChanges(_) {
440
+ if (!NumberFormatService.valueIsSet(this.value)) {
441
+ this.value = '-';
442
+ if (this.shrinkIfEmpty) {
443
+ this.rows = 1;
444
+ }
445
+ }
446
+ else if (this.formatNumber && typeof this.value === 'number') {
447
+ this.value = this.numberFormatService.format(this.value, {
448
+ decimalPlaces: this.decimalPlaces,
449
+ finalFormatting: true,
450
+ autofillDecimals: this.autofillDecimals,
451
+ });
452
+ }
453
+ this.changeDetector.detectChanges();
454
+ }
455
+ // TODO direct copy from NumericFieldDirective
456
+ ngAfterViewChecked() {
457
+ this.injectUnitSymbol();
458
+ }
459
+ injectUnitSymbol() {
460
+ // Need to inject the unit symbol when the input element width is set to its actual value,
461
+ // otherwise the icon wont show in the correct position
462
+ if (!!this.unit && !this.unitSpan && this.inputEl.nativeElement.offsetWidth !== 0) {
463
+ // Get the input wrapper and apply necessary styles
464
+ const inputWrapper = this.inputEl.nativeElement.parentNode.parentNode;
465
+ // Create the span with unit symbol and apply necessary styles
466
+ this.unitSpan = this.renderer.createElement('span');
467
+ if (this.unitPosition === 'left') {
468
+ this.renderer.setAttribute(this.unitSpan, 'matPrefix', '');
469
+ this.renderer.setStyle(this.unitSpan, 'padding-right', '5px');
470
+ this.renderer.insertBefore(inputWrapper, this.unitSpan, inputWrapper.children[0]);
471
+ }
472
+ else {
473
+ this.renderer.setAttribute(this.unitSpan, 'matSuffix', '');
474
+ this.renderer.setStyle(this.unitSpan, 'padding-left', '5px');
475
+ this.renderer.appendChild(inputWrapper, this.unitSpan);
476
+ }
477
+ }
478
+ // special handling to move unit symbol along with display value
479
+ if (!!this.unitSpan && this.textAlign === 'left' && this.unitPosition === 'right') {
480
+ const inputStyles = window.getComputedStyle(this.inputEl.nativeElement.parentElement, null);
481
+ this.unitSpan.style.position = 'absolute';
482
+ this.unitSpan.style.marginTop = inputStyles.getPropertyValue('border-top-width');
483
+ this.unitSpan.style.paddingTop = inputStyles.getPropertyValue('padding-top');
484
+ this.unitSpan.style.paddingBottom = inputStyles.getPropertyValue('padding-bottom');
485
+ if (!this.textSpan) {
486
+ this.textSpan = document.createElement('span');
487
+ document.body.appendChild(this.textSpan);
488
+ this.textSpan.style.font = inputStyles.getPropertyValue('font');
489
+ this.textSpan.style.fontSize = inputStyles.getPropertyValue('font-size');
490
+ this.textSpan.style.height = 'auto';
491
+ this.textSpan.style.width = 'auto';
492
+ this.textSpan.style.position = 'absolute';
493
+ this.textSpan.style.top = '0';
494
+ this.textSpan.style.whiteSpace = 'no-wrap';
495
+ this.textSpan.style.visibility = 'hidden';
496
+ }
497
+ this.textSpan.innerHTML = this.value;
498
+ const width = Math.min(this.inputEl.nativeElement.clientWidth - this.unitSpan.clientWidth, Math.ceil(this.textSpan.clientWidth));
499
+ this.unitSpan.style.left = width + 'px';
500
+ }
501
+ // always reset unit symbol
502
+ if (!!this.unitSpan) {
503
+ this.unitSpan.textContent = this.unit;
504
+ }
505
+ }
506
+ }
507
+ ReadOnlyFormFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ReadOnlyFormFieldComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: NumberFormatService }], target: i0.ɵɵFactoryTarget.Component });
508
+ ReadOnlyFormFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: ReadOnlyFormFieldComponent, selector: "mad-readonly-form-field", inputs: { value: "value", label: "label", textAlign: "textAlign", formatNumber: "formatNumber", decimalPlaces: "decimalPlaces", roundValue: ["roundDisplayValue", "roundValue"], autofillDecimals: "autofillDecimals", unit: "unit", unitPosition: "unitPosition", errorMessage: "errorMessage", multiline: "multiline", rows: "rows", id: "id", shrinkIfEmpty: "shrinkIfEmpty" }, viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<mat-form-field class=\"form-group\" appearance=\"none\">\n <mat-label>{{ label }}</mat-label>\n <input\n *ngIf=\"!multiline\"\n [ngModel]=\"value\"\n [ngClass]=\"'text-' + textAlign\"\n [errorStateMatcher]=\"errorMatcher\"\n [id]=\"id\"\n readonly\n matInput\n #inputEl\n />\n\n <textarea\n *ngIf=\"multiline\"\n [rows]=\"rows\"\n [ngModel]=\"value\"\n class=\"multiline\"\n [errorStateMatcher]=\"errorMatcher\"\n [id]=\"id\"\n readonly\n matInput\n ></textarea>\n <mat-error>{{ errorMessage }}</mat-error>\n</mat-form-field>\n", styles: ["mat-form-field{width:100%;width:-webkit-fill-available;width:-moz-available;width:stretch}mat-label{line-height:1.4}span[matPrefix]{padding-right:5px}span[matSuffix]{padding-left:5px}.text-left{text-align:left}.text-right{text-align:right}.multiline{resize:none}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i5$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
509
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ReadOnlyFormFieldComponent, decorators: [{
510
+ type: Component,
511
+ args: [{ selector: 'mad-readonly-form-field', template: "<mat-form-field class=\"form-group\" appearance=\"none\">\n <mat-label>{{ label }}</mat-label>\n <input\n *ngIf=\"!multiline\"\n [ngModel]=\"value\"\n [ngClass]=\"'text-' + textAlign\"\n [errorStateMatcher]=\"errorMatcher\"\n [id]=\"id\"\n readonly\n matInput\n #inputEl\n />\n\n <textarea\n *ngIf=\"multiline\"\n [rows]=\"rows\"\n [ngModel]=\"value\"\n class=\"multiline\"\n [errorStateMatcher]=\"errorMatcher\"\n [id]=\"id\"\n readonly\n matInput\n ></textarea>\n <mat-error>{{ errorMessage }}</mat-error>\n</mat-form-field>\n", styles: ["mat-form-field{width:100%;width:-webkit-fill-available;width:-moz-available;width:stretch}mat-label{line-height:1.4}span[matPrefix]{padding-right:5px}span[matSuffix]{padding-left:5px}.text-left{text-align:left}.text-right{text-align:right}.multiline{resize:none}\n"] }]
512
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: NumberFormatService }]; }, propDecorators: { value: [{
513
+ type: Input,
514
+ args: ['value']
515
+ }], label: [{
516
+ type: Input,
517
+ args: ['label']
518
+ }], textAlign: [{
519
+ type: Input,
520
+ args: ['textAlign']
521
+ }], formatNumber: [{
522
+ type: Input,
523
+ args: ['formatNumber']
524
+ }], decimalPlaces: [{
525
+ type: Input,
526
+ args: ['decimalPlaces']
527
+ }], roundValue: [{
528
+ type: Input,
529
+ args: ['roundDisplayValue']
530
+ }], autofillDecimals: [{
531
+ type: Input,
532
+ args: ['autofillDecimals']
533
+ }], unit: [{
534
+ type: Input,
535
+ args: ['unit']
536
+ }], unitPosition: [{
537
+ type: Input,
538
+ args: ['unitPosition']
539
+ }], errorMessage: [{
540
+ type: Input,
541
+ args: ['errorMessage']
542
+ }], multiline: [{
543
+ type: Input
544
+ }], rows: [{
545
+ type: Input
546
+ }], id: [{
547
+ type: Input
548
+ }], shrinkIfEmpty: [{
549
+ type: Input
550
+ }], inputEl: [{
551
+ type: ViewChild,
552
+ args: ['inputEl']
553
+ }] } });
554
+
555
+ /**
556
+ * Wraps a mat-form-field to replace it by a readOnly representation if necessary
557
+ *
558
+ * @author Stefan Laesser
559
+ */
560
+ class ReadOnlyFormFieldWrapperComponent {
561
+ constructor(changeDetector, elementRef) {
562
+ this.changeDetector = changeDetector;
563
+ this.elementRef = elementRef;
564
+ /**
565
+ * If set to "false", the contained mat-form-field is rendered in all it's glory.
566
+ * If set to "true", a readonly representation of the value is shown using the mat-form-fields label.
567
+ */
568
+ this.readonly = true;
569
+ this.textAlign = 'left';
570
+ this.formatNumber = false;
571
+ this.decimalPlaces = 2;
572
+ this.roundValue = false;
573
+ this.autofillDecimals = false;
574
+ this.unit = null;
575
+ this.unitPosition = 'left';
576
+ this.errorMessage = null;
577
+ /**
578
+ * If set to "false", a readonly input will be rendered.
579
+ * If set to "true", a readonly textarea will be rendered instead.
580
+ */
581
+ this.multiline = false;
582
+ /**
583
+ * Defines the rows for the readonly textarea.
584
+ */
585
+ this.rows = 3;
586
+ /**
587
+ * If shrinkIfEmpty is set to "false", nothing changes
588
+ * If set to "true" and multiline is also "true", the textarea will
589
+ * shrink to one row, if value is empty/null/undefined.
590
+ * Otherwise, the defined rows-value will be used
591
+ */
592
+ this.shrinkIfEmpty = false;
593
+ this.toolTipForInputEnabled = false;
594
+ }
595
+ ngOnInit() {
596
+ this.doRendering();
597
+ }
598
+ ngAfterViewInit() {
599
+ this.setReadonlyFieldStyle();
600
+ this.doRendering();
601
+ }
602
+ ngAfterViewChecked() {
603
+ this.setReadonlyFieldStyle();
604
+ this.setTooltipForOverflownField();
605
+ }
606
+ ngOnChanges(_) {
607
+ this.doRendering();
608
+ }
609
+ getLabel() {
610
+ if (!this.label) {
611
+ this.extractLabel();
612
+ }
613
+ return this.label;
614
+ }
615
+ doRendering() {
616
+ if (!this.originalContent) {
617
+ return;
618
+ }
619
+ if (!this.readonly) {
620
+ this.correctWidth();
621
+ return;
622
+ }
623
+ this.changeDetector.detectChanges();
624
+ }
625
+ extractLabel() {
626
+ if (!this.originalContent || !this.originalContent.nativeElement) {
627
+ return null;
628
+ }
629
+ const labelElement = this.originalContent.nativeElement.querySelector('mat-label');
630
+ this.label = labelElement ? labelElement.innerHTML : 'mat-label is missing!';
631
+ }
632
+ correctWidth() {
633
+ const formField = this.originalContent.nativeElement.querySelector('mat-form-field');
634
+ if (formField) {
635
+ formField.setAttribute('style', 'width:100%');
636
+ }
637
+ }
638
+ setReadonlyFieldStyle() {
639
+ const input = this.readOnlyContentWrapper?.nativeElement?.querySelector('input');
640
+ if (input) {
641
+ const textOverFlowStyleValue = this.getTextOverFlowStyleValue();
642
+ if (textOverFlowStyleValue) {
643
+ input.setAttribute('style', 'text-overflow: ' + textOverFlowStyleValue);
644
+ }
645
+ }
646
+ }
647
+ // Ellipsis is enabled by default as text-overflow behaviour
648
+ getTextOverFlowStyleValue() {
649
+ // it works only if the style is added to the component directly. Should find a way for get it from the calculated
650
+ // style. Than it would be possible to define the text-overflow in css for the whole application
651
+ const textOverflow = this.elementRef?.nativeElement?.style.textOverflow;
652
+ if (!textOverflow) {
653
+ return 'ellipsis';
654
+ }
655
+ return textOverflow;
656
+ }
657
+ setTooltipForOverflownField() {
658
+ if (this.isEllipsisForTextOverflowEnabled()) {
659
+ const input = this.readOnlyContentWrapper?.nativeElement?.querySelector('input');
660
+ if (input) {
661
+ this.toolTipForInputEnabled = this.isTextOverflown(input);
662
+ if (this.toolTipForInputEnabled) {
663
+ this.toolTipText = this.calculateToolTipText();
664
+ }
665
+ this.changeDetector.detectChanges();
666
+ }
667
+ }
668
+ }
669
+ isEllipsisForTextOverflowEnabled() {
670
+ return this.getTextOverFlowStyleValue() === 'ellipsis';
671
+ }
672
+ isTextOverflown(input) {
673
+ if (input) {
674
+ return input.offsetWidth < input.scrollWidth;
675
+ }
676
+ return false;
677
+ }
678
+ calculateToolTipText() {
679
+ if (!this.unit) {
680
+ return this.value;
681
+ }
682
+ return this.unitPosition === 'left' ? this.unit + ' ' + this.value : this.value + ' ' + this.unit;
683
+ }
684
+ }
685
+ ReadOnlyFormFieldWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ReadOnlyFormFieldWrapperComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
686
+ ReadOnlyFormFieldWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: ReadOnlyFormFieldWrapperComponent, selector: "mad-readonly-form-field-wrapper", inputs: { readonly: "readonly", value: "value", textAlign: "textAlign", formatNumber: "formatNumber", decimalPlaces: "decimalPlaces", roundValue: ["roundDisplayValue", "roundValue"], autofillDecimals: "autofillDecimals", unit: "unit", unitPosition: "unitPosition", errorMessage: "errorMessage", id: "id", multiline: "multiline", rows: "rows", shrinkIfEmpty: "shrinkIfEmpty" }, viewQueries: [{ propertyName: "originalContent", first: true, predicate: ["contentWrapper"], descendants: true }, { propertyName: "readOnlyContentWrapper", first: true, predicate: ["readOnlyContentWrapper"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div #contentWrapper [hidden]=\"readonly\">\n <ng-content></ng-content>\n</div>\n\n<div #readOnlyContentWrapper>\n <ng-container *ngIf=\"!!readonly\">\n <mad-readonly-form-field\n [label]=\"getLabel()\"\n [value]=\"value\"\n [textAlign]=\"textAlign\"\n [formatNumber]=\"formatNumber\"\n [decimalPlaces]=\"decimalPlaces\"\n [roundDisplayValue]=\"roundValue\"\n [autofillDecimals]=\"autofillDecimals\"\n [unit]=\"unit\"\n [unitPosition]=\"unitPosition\"\n [errorMessage]=\"errorMessage\"\n [multiline]=\"multiline\"\n [rows]=\"rows\"\n [shrinkIfEmpty]=\"shrinkIfEmpty\"\n [id]=\"id\"\n matTooltip=\"{{toolTipText}}\"\n matTooltipPosition=\"right\"\n matTooltipClass=\"custom-tooltip\"\n matTooltipDisabled=\"{{!toolTipForInputEnabled}}\">\n </mad-readonly-form-field>\n </ng-container>\n</div>\n", styles: ["mat-form-field{width:inherit}div{width:inherit}::ng-deep .custom-tooltip{font-size:14px!important;word-break:break-all!important;white-space:normal!important}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: ReadOnlyFormFieldComponent, selector: "mad-readonly-form-field", inputs: ["value", "label", "textAlign", "formatNumber", "decimalPlaces", "roundDisplayValue", "autofillDecimals", "unit", "unitPosition", "errorMessage", "multiline", "rows", "id", "shrinkIfEmpty"] }] });
687
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ReadOnlyFormFieldWrapperComponent, decorators: [{
688
+ type: Component,
689
+ args: [{ selector: 'mad-readonly-form-field-wrapper', template: "<div #contentWrapper [hidden]=\"readonly\">\n <ng-content></ng-content>\n</div>\n\n<div #readOnlyContentWrapper>\n <ng-container *ngIf=\"!!readonly\">\n <mad-readonly-form-field\n [label]=\"getLabel()\"\n [value]=\"value\"\n [textAlign]=\"textAlign\"\n [formatNumber]=\"formatNumber\"\n [decimalPlaces]=\"decimalPlaces\"\n [roundDisplayValue]=\"roundValue\"\n [autofillDecimals]=\"autofillDecimals\"\n [unit]=\"unit\"\n [unitPosition]=\"unitPosition\"\n [errorMessage]=\"errorMessage\"\n [multiline]=\"multiline\"\n [rows]=\"rows\"\n [shrinkIfEmpty]=\"shrinkIfEmpty\"\n [id]=\"id\"\n matTooltip=\"{{toolTipText}}\"\n matTooltipPosition=\"right\"\n matTooltipClass=\"custom-tooltip\"\n matTooltipDisabled=\"{{!toolTipForInputEnabled}}\">\n </mad-readonly-form-field>\n </ng-container>\n</div>\n", styles: ["mat-form-field{width:inherit}div{width:inherit}::ng-deep .custom-tooltip{font-size:14px!important;word-break:break-all!important;white-space:normal!important}\n"] }]
690
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { originalContent: [{
691
+ type: ViewChild,
692
+ args: ['contentWrapper', { static: false }]
693
+ }], readOnlyContentWrapper: [{
694
+ type: ViewChild,
695
+ args: ['readOnlyContentWrapper', { static: false }]
696
+ }], readonly: [{
697
+ type: Input
698
+ }], value: [{
699
+ type: Input,
700
+ args: ['value']
701
+ }], textAlign: [{
702
+ type: Input,
703
+ args: ['textAlign']
704
+ }], formatNumber: [{
705
+ type: Input,
706
+ args: ['formatNumber']
707
+ }], decimalPlaces: [{
708
+ type: Input,
709
+ args: ['decimalPlaces']
710
+ }], roundValue: [{
711
+ type: Input,
712
+ args: ['roundDisplayValue']
713
+ }], autofillDecimals: [{
714
+ type: Input,
715
+ args: ['autofillDecimals']
716
+ }], unit: [{
717
+ type: Input,
718
+ args: ['unit']
719
+ }], unitPosition: [{
720
+ type: Input,
721
+ args: ['unitPosition']
722
+ }], errorMessage: [{
723
+ type: Input,
724
+ args: ['errorMessage']
725
+ }], id: [{
726
+ type: Input
727
+ }], multiline: [{
728
+ type: Input
729
+ }], rows: [{
730
+ type: Input
731
+ }], shrinkIfEmpty: [{
732
+ type: Input
733
+ }] } });
734
+
735
+ class ReadOnlyFormFieldModule {
736
+ }
737
+ ReadOnlyFormFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ReadOnlyFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
738
+ ReadOnlyFormFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: ReadOnlyFormFieldModule, declarations: [ReadOnlyFormFieldComponent, ReadOnlyFormFieldWrapperComponent], imports: [CommonModule, RouterModule, MatFormFieldModule, MatInputModule, FormsModule, MatTooltipModule], exports: [ReadOnlyFormFieldComponent, ReadOnlyFormFieldWrapperComponent] });
739
+ ReadOnlyFormFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ReadOnlyFormFieldModule, imports: [CommonModule, RouterModule, MatFormFieldModule, MatInputModule, FormsModule, MatTooltipModule] });
740
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ReadOnlyFormFieldModule, decorators: [{
741
+ type: NgModule,
742
+ args: [{
743
+ declarations: [ReadOnlyFormFieldComponent, ReadOnlyFormFieldWrapperComponent],
744
+ imports: [CommonModule, RouterModule, MatFormFieldModule, MatInputModule, FormsModule, MatTooltipModule],
745
+ exports: [ReadOnlyFormFieldComponent, ReadOnlyFormFieldWrapperComponent],
746
+ }]
747
+ }] });
748
+
749
+ class ToolbarService {
750
+ constructor(router, translate) {
751
+ this.router = router;
752
+ this.translate = translate;
753
+ this.mainActions = []; // shown on the left, next to title, as big buttons
754
+ this.toolbarActions = []; // shown on the right as icons
755
+ this.toolbarActionsAlwaysAsMenu = false; // show the mobile view (burger menu) for toolbar actions
756
+ this.toolbarActionsMenuTitle = 'More'; // title of the burger menu
757
+ this.routerSubscription = this.router.events.subscribe(routingEvent => {
758
+ if (routingEvent instanceof NavigationEnd) {
759
+ if (this.currentUrl !== routingEvent.urlAfterRedirects) {
760
+ this.clearToolbarActions();
761
+ this.clearMainActions();
762
+ delete this.backAction;
763
+ delete this.dataTitle;
764
+ }
765
+ this.currentUrl = router.url;
766
+ }
767
+ });
768
+ }
769
+ get toolbarTitle() {
770
+ return this.title;
771
+ }
772
+ set toolbarTitle(toolbarTitle) {
773
+ this.title = toolbarTitle;
774
+ }
775
+ ngOnDestroy() {
776
+ if (this.routerSubscription) {
777
+ this.routerSubscription.unsubscribe();
778
+ }
779
+ }
780
+ getToolbarActions() {
781
+ return this.toolbarActions;
782
+ }
783
+ addToolbarAction(action) {
784
+ this.translate
785
+ .get(action.i18nActionKey)
786
+ .toPromise()
787
+ .then(translated => {
788
+ action.actionName = translated;
789
+ this.toolbarActions.push(action);
790
+ });
791
+ }
792
+ setDataTitle(dataTitle) {
793
+ this.dataTitle = dataTitle;
794
+ }
795
+ setToolbarActionsAlwaysAsMenu(toolbarActionsAlwaysAsMenu) {
796
+ this.toolbarActionsAlwaysAsMenu = toolbarActionsAlwaysAsMenu;
797
+ }
798
+ getToolbarActionsAlwaysAsMenu() {
799
+ return this.toolbarActionsAlwaysAsMenu;
800
+ }
801
+ getDataTitle() {
802
+ return this.dataTitle;
803
+ }
804
+ clearToolbarActions() {
805
+ this.toolbarActions = [];
806
+ }
807
+ getMainActions() {
808
+ return this.mainActions;
809
+ }
810
+ getBackAction() {
811
+ return this.backAction;
812
+ }
813
+ setToolbarActionsMenuTitle(toolbarActionsMenuTitle) {
814
+ this.toolbarActionsMenuTitle = toolbarActionsMenuTitle;
815
+ }
816
+ getToolbarActionsMenuTitle() {
817
+ return this.toolbarActionsMenuTitle;
818
+ }
819
+ addMainAction(mainAction) {
820
+ this.translate
821
+ .get(mainAction.i18nActionKey)
822
+ .toPromise()
823
+ .then(translated => {
824
+ mainAction.actionName = translated;
825
+ this.mainActions.push(mainAction);
826
+ });
827
+ }
828
+ /**
829
+ * Per default the goBackRoute is a routerLink. But if a href should be used (for absolute browser routing) then isAbsoluteUrl can be set to true.
830
+ */
831
+ addBackAction(goBackRoute, isAbsoluteUrl = false) {
832
+ this.backAction = {
833
+ matIcon: 'keyboard_backspace',
834
+ i18nActionKey: '',
835
+ };
836
+ if (!isAbsoluteUrl) {
837
+ this.backAction.routerLink = goBackRoute;
838
+ }
839
+ else {
840
+ this.backAction.href = goBackRoute;
841
+ }
842
+ }
843
+ addSimpleBackButton(overrideIfPresent = false) {
844
+ if (this.getBackAction() && !overrideIfPresent) {
845
+ return;
846
+ }
847
+ this.backAction = {
848
+ matIcon: 'keyboard_backspace',
849
+ i18nActionKey: '',
850
+ action() {
851
+ window.history.back();
852
+ },
853
+ };
854
+ }
855
+ clearMainActions() {
856
+ this.mainActions = [];
857
+ }
858
+ }
859
+ ToolbarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToolbarService, deps: [{ token: i1$1.Router }, { token: i2$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
860
+ ToolbarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToolbarService, providedIn: 'root' });
861
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToolbarService, decorators: [{
862
+ type: Injectable,
863
+ args: [{
864
+ providedIn: 'root',
865
+ }]
866
+ }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i2$1.TranslateService }]; } });
867
+
868
+ class ToolbarComponent {
869
+ constructor(breakpointObserver, titleService, toolbarService) {
870
+ this.breakpointObserver = breakpointObserver;
871
+ this.titleService = titleService;
872
+ this.toolbarService = toolbarService;
873
+ this.isHandset$ = this.breakpointObserver.observe([Breakpoints.Handset]).pipe(map(result => result.matches));
874
+ }
875
+ getTitle() {
876
+ const dataTitle = this.toolbarService.getDataTitle();
877
+ const toolbarTitle = this.toolbarService.toolbarTitle;
878
+ const title = !toolbarTitle || toolbarTitle.length <= 0 ? this.titleService.getTitle() : toolbarTitle;
879
+ return !dataTitle || dataTitle.length <= 0 ? title : title + ': ' + dataTitle;
880
+ }
881
+ getToolbarActions() {
882
+ return this.toolbarService.getToolbarActions();
883
+ }
884
+ getMainActions() {
885
+ return this.toolbarService.getMainActions();
886
+ }
887
+ hasPermission(action) {
888
+ if (!action || !action.showIf) {
889
+ return of(true);
890
+ }
891
+ return action.showIf;
892
+ }
893
+ isRouterLink() {
894
+ return this.toolbarService.getBackAction() && !!this.toolbarService.getBackAction().routerLink;
895
+ }
896
+ isAbsoluteLink() {
897
+ return this.toolbarService.getBackAction() && !!this.toolbarService.getBackAction().href;
898
+ }
899
+ isAction() {
900
+ return this.toolbarService.getBackAction() && !!this.toolbarService.getBackAction().action;
901
+ }
902
+ getBackAction() {
903
+ return this.toolbarService.getBackAction();
904
+ }
905
+ getToolbarActionsAlwaysAsMenu() {
906
+ return this.toolbarService.getToolbarActionsAlwaysAsMenu();
907
+ }
908
+ getToolbarActionsMenuTitle() {
909
+ return this.toolbarService.getToolbarActionsMenuTitle();
910
+ }
911
+ showBadgeForMenu() {
912
+ return (this.getToolbarActions()
913
+ .slice(1) // the first icon is not shown in menu
914
+ .filter(value => value.badge && value.badge.value).length > 0);
915
+ }
916
+ hasImportantToolbarActions() {
917
+ return this.getToolbarActions().filter(value => !!value.importantAction).length > 0;
918
+ }
919
+ }
920
+ ToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToolbarComponent, deps: [{ token: i1$3.BreakpointObserver }, { token: i2$2.Title }, { token: ToolbarService }], target: i0.ɵɵFactoryTarget.Component });
921
+ ToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: ToolbarComponent, selector: "mad-toolbar", ngImport: i0, template: "<mat-toolbar class=\"content-toolbar\">\n <a [routerLink]=\"getBackAction().routerLink\" *ngIf=\"isRouterLink()\">\n <button [id]=\"'go-back'\" color=\"primary\" mat-icon-button class=\"go-back-button\">\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n <a [href]=\"getBackAction().href\" *ngIf=\"isAbsoluteLink()\">\n <button [id]=\"'go-back'\" class=\"go-back-button\" color=\"primary\" mat-icon-button>\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n <a (click)=\"getBackAction().action()\" *ngIf=\"isAction()\">\n <button [id]=\"'go-back'\" color=\"primary\" mat-icon-button class=\"go-back-button\">\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n\n <span class=\"toolbar-title\">{{ getTitle() }}</span>\n\n <ng-container *ngFor=\"let mainAction of getMainActions(); let i = index\">\n <ng-container *ngIf=\"hasPermission(mainAction) | async\">\n <div *ngIf=\"!(isHandset$ | async)\">\n <a [routerLink]=\"mainAction.routerLink\">\n <mad-primary-button [id]=\"mainAction.matIcon\" style=\"margin-left: 56px\">\n <mat-icon>{{ mainAction.matIcon }}</mat-icon>\n {{ mainAction.actionName }}\n </mad-primary-button>\n </a>\n </div>\n <div *ngIf=\"isHandset$ | async\">\n <mad-material-action-button\n [actionName]=\"mainAction.actionName\"\n [icon]=\"mainAction.matIcon\"\n [liftHigher]=\"mainAction.liftHigherOnMobile\"\n [liftHigher2]=\"i > 0\"\n [routerLink]=\"mainAction.routerLink\"\n [id]=\"mainAction.matIcon\"\n >\n </mad-material-action-button>\n </div>\n </ng-container>\n </ng-container>\n\n <div class=\"right-aligned no-print\">\n <ng-container *ngFor=\"let action of getToolbarActions(); let i = index\">\n <ng-container *ngIf=\"hasPermission(action) | async\">\n <mad-icon-button\n (click)=\"action.action()\"\n *ngIf=\"(!(isHandset$ | async) && !getToolbarActionsAlwaysAsMenu()) || i < (getToolbarActions().length > 2 ? (hasImportantToolbarActions() ? 0:1) : 2) || !!action.importantAction\"\n [id]=\"action.matIcon\"\n [matTooltip]=\"action.actionName\"\n type=\"button\">\n <mat-icon\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n matBadgePosition=\"below after\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n >{{ action.matIcon }}</mat-icon>\n </mad-icon-button>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"(isHandset$ | async) || getToolbarActionsAlwaysAsMenu()\">\n <ng-container *ngIf=\"getToolbarActions().length > 2\">\n <mad-icon-button type=\"button\" [matMenuTriggerFor]=\"burgerMenu\" [matTooltip]=\"getToolbarActionsMenuTitle()\">\n <mat-icon\n matBadgeColor=\"warn\"\n [matBadge]=\"showBadgeForMenu() ? '&#8288;' : null\"\n matBadgeSize=\"small\"\n matBadgePosition=\"above after\"\n >more_vert\n </mat-icon>\n </mad-icon-button>\n <mat-menu #burgerMenu=\"matMenu\" class=\"no-print\">\n <ng-container *ngFor=\"let action of getToolbarActions(); let i = index\">\n <ng-container *ngIf=\"!action.importantAction\">\n <ng-container *ngIf=\"hasPermission(action) | async\">\n <button *ngIf=\"i >= (hasImportantToolbarActions() ? 0:1)\" mat-menu-item (click)=\"action.action()\">\n <mat-icon\n color=\"primary\"\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n matBadgePosition=\"below after\"\n >{{ action.matIcon }}</mat-icon\n >\n {{ action.actionName }}\n </button>\n </ng-container>\n </ng-container>\n </ng-container>\n </mat-menu>\n </ng-container>\n </ng-container>\n </div>\n</mat-toolbar>\n", styles: ["mat-toolbar{background:white}.content-toolbar{height:57px;border-bottom:1px solid #dcdcdc}.right-aligned{overflow:hidden;margin-left:auto;margin-right:0}.go-back-button{padding-left:0;padding-right:0}.toolbar-title{margin-right:72px}::ng-deep .mat-badge-content{bottom:-7px!important;right:-7px!important}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i8.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MaterialActionButtonComponent, selector: "mad-material-action-button", inputs: ["actionName", "id", "icon", "routerLink", "liftHigher", "liftHigher2"] }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: PrimaryButtonComponent, selector: "mad-primary-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button", inputs: ["type", "disabled", "title"] }, { kind: "directive", type: i14.MatBadge, selector: "[matBadge]", inputs: ["matBadgeDisabled", "matBadgeColor", "matBadgeOverlap", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
922
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToolbarComponent, decorators: [{
923
+ type: Component,
924
+ args: [{ selector: 'mad-toolbar', template: "<mat-toolbar class=\"content-toolbar\">\n <a [routerLink]=\"getBackAction().routerLink\" *ngIf=\"isRouterLink()\">\n <button [id]=\"'go-back'\" color=\"primary\" mat-icon-button class=\"go-back-button\">\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n <a [href]=\"getBackAction().href\" *ngIf=\"isAbsoluteLink()\">\n <button [id]=\"'go-back'\" class=\"go-back-button\" color=\"primary\" mat-icon-button>\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n <a (click)=\"getBackAction().action()\" *ngIf=\"isAction()\">\n <button [id]=\"'go-back'\" color=\"primary\" mat-icon-button class=\"go-back-button\">\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n\n <span class=\"toolbar-title\">{{ getTitle() }}</span>\n\n <ng-container *ngFor=\"let mainAction of getMainActions(); let i = index\">\n <ng-container *ngIf=\"hasPermission(mainAction) | async\">\n <div *ngIf=\"!(isHandset$ | async)\">\n <a [routerLink]=\"mainAction.routerLink\">\n <mad-primary-button [id]=\"mainAction.matIcon\" style=\"margin-left: 56px\">\n <mat-icon>{{ mainAction.matIcon }}</mat-icon>\n {{ mainAction.actionName }}\n </mad-primary-button>\n </a>\n </div>\n <div *ngIf=\"isHandset$ | async\">\n <mad-material-action-button\n [actionName]=\"mainAction.actionName\"\n [icon]=\"mainAction.matIcon\"\n [liftHigher]=\"mainAction.liftHigherOnMobile\"\n [liftHigher2]=\"i > 0\"\n [routerLink]=\"mainAction.routerLink\"\n [id]=\"mainAction.matIcon\"\n >\n </mad-material-action-button>\n </div>\n </ng-container>\n </ng-container>\n\n <div class=\"right-aligned no-print\">\n <ng-container *ngFor=\"let action of getToolbarActions(); let i = index\">\n <ng-container *ngIf=\"hasPermission(action) | async\">\n <mad-icon-button\n (click)=\"action.action()\"\n *ngIf=\"(!(isHandset$ | async) && !getToolbarActionsAlwaysAsMenu()) || i < (getToolbarActions().length > 2 ? (hasImportantToolbarActions() ? 0:1) : 2) || !!action.importantAction\"\n [id]=\"action.matIcon\"\n [matTooltip]=\"action.actionName\"\n type=\"button\">\n <mat-icon\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n matBadgePosition=\"below after\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n >{{ action.matIcon }}</mat-icon>\n </mad-icon-button>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"(isHandset$ | async) || getToolbarActionsAlwaysAsMenu()\">\n <ng-container *ngIf=\"getToolbarActions().length > 2\">\n <mad-icon-button type=\"button\" [matMenuTriggerFor]=\"burgerMenu\" [matTooltip]=\"getToolbarActionsMenuTitle()\">\n <mat-icon\n matBadgeColor=\"warn\"\n [matBadge]=\"showBadgeForMenu() ? '&#8288;' : null\"\n matBadgeSize=\"small\"\n matBadgePosition=\"above after\"\n >more_vert\n </mat-icon>\n </mad-icon-button>\n <mat-menu #burgerMenu=\"matMenu\" class=\"no-print\">\n <ng-container *ngFor=\"let action of getToolbarActions(); let i = index\">\n <ng-container *ngIf=\"!action.importantAction\">\n <ng-container *ngIf=\"hasPermission(action) | async\">\n <button *ngIf=\"i >= (hasImportantToolbarActions() ? 0:1)\" mat-menu-item (click)=\"action.action()\">\n <mat-icon\n color=\"primary\"\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n matBadgePosition=\"below after\"\n >{{ action.matIcon }}</mat-icon\n >\n {{ action.actionName }}\n </button>\n </ng-container>\n </ng-container>\n </ng-container>\n </mat-menu>\n </ng-container>\n </ng-container>\n </div>\n</mat-toolbar>\n", styles: ["mat-toolbar{background:white}.content-toolbar{height:57px;border-bottom:1px solid #dcdcdc}.right-aligned{overflow:hidden;margin-left:auto;margin-right:0}.go-back-button{padding-left:0;padding-right:0}.toolbar-title{margin-right:72px}::ng-deep .mat-badge-content{bottom:-7px!important;right:-7px!important}\n"] }]
925
+ }], ctorParameters: function () { return [{ type: i1$3.BreakpointObserver }, { type: i2$2.Title }, { type: ToolbarService }]; } });
926
+
927
+ class ToolbarModule {
928
+ }
929
+ ToolbarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToolbarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
930
+ ToolbarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: ToolbarModule, declarations: [ToolbarComponent], imports: [CommonModule,
931
+ RouterModule,
932
+ MatMenuModule,
933
+ MatButtonModule,
934
+ MatToolbarModule,
935
+ MatIconModule,
936
+ MaterialActionButtonModule,
937
+ MatTooltipModule,
938
+ ButtonModule,
939
+ MatBadgeModule], exports: [ToolbarComponent] });
940
+ ToolbarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToolbarModule, imports: [CommonModule,
941
+ RouterModule,
942
+ MatMenuModule,
943
+ MatButtonModule,
944
+ MatToolbarModule,
945
+ MatIconModule,
946
+ MaterialActionButtonModule,
947
+ MatTooltipModule,
948
+ ButtonModule,
949
+ MatBadgeModule] });
950
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToolbarModule, decorators: [{
951
+ type: NgModule,
952
+ args: [{
953
+ declarations: [ToolbarComponent],
954
+ imports: [
955
+ CommonModule,
956
+ RouterModule,
957
+ MatMenuModule,
958
+ MatButtonModule,
959
+ MatToolbarModule,
960
+ MatIconModule,
961
+ MaterialActionButtonModule,
962
+ MatTooltipModule,
963
+ ButtonModule,
964
+ MatBadgeModule,
965
+ ],
966
+ exports: [ToolbarComponent],
967
+ }]
968
+ }] });
969
+
970
+ /*
971
+ * Copyright (c) 2018-2020 Porsche Informatik. All Rights Reserved.
972
+ * This software is released under MIT license.
973
+ * The full license information can be found in LICENSE in the root directory of this project.
974
+ */
975
+ const BACK_KEYCODE = 8;
976
+ const SPACE_KEYCODE = 32;
977
+ const DEL_KEYCODE = 46;
978
+ const CONTROL_KEYCODES_UPPER_BORDER = 46;
979
+ const OTHER_CONTROL_KEYS = new Set([224, 91, 93]);
980
+ class NumericFieldDirective {
981
+ constructor(renderer, inputEl, numberFormatService) {
982
+ this.renderer = renderer;
983
+ this.inputEl = inputEl;
984
+ this.numberFormatService = numberFormatService;
985
+ this.textAlign = 'right';
986
+ this.decimalPlaces = 2;
987
+ this.roundValue = false;
988
+ this.autofillDecimals = false;
989
+ this.unit = null;
990
+ this.unitPosition = 'right';
991
+ this.numericValueChanged = new EventEmitter();
992
+ this.displayValue = '';
993
+ this.originalValue = NaN;
994
+ /* Control Values Accessor Stuff below */
995
+ // eslint-disable-next-line
996
+ this.onChange = () => { };
997
+ // eslint-disable-next-line
998
+ this.onTouched = () => { };
999
+ }
1000
+ set numericValue(value) {
1001
+ if (this._numericValue !== value && !(isNaN(this._numericValue) && (isNaN(value) || value === null))) {
1002
+ this.originalValue = value;
1003
+ // Don't roundOrTruncate if value was set to empty otherwise input value will be set to 0 instead of empty
1004
+ // which happens when an input is being reset
1005
+ this._numericValue = value === null || value === undefined ? value : this.roundOrTruncate(value); // eslint-disable-line
1006
+ this.handleInputChanged();
1007
+ }
1008
+ }
1009
+ registerOnChange(fn) {
1010
+ this.onChange = fn;
1011
+ }
1012
+ registerOnTouched(fn) {
1013
+ this.onTouched = fn;
1014
+ }
1015
+ setDisabledState() {
1016
+ // Dont need to implement since its just a directive
1017
+ }
1018
+ writeValue(value) {
1019
+ this.numericValue = value;
1020
+ }
1021
+ ngOnInit() {
1022
+ /* needs to be parsed as number explicitly as it comes as string from user input */
1023
+ this.decimalPlaces = parseInt(this.decimalPlaces.toString(), 10);
1024
+ this.inputChangeListener = this.renderer.listen(this.inputEl.nativeElement, 'blur', event => {
1025
+ this.formatInput(event.target, true);
1026
+ });
1027
+ this.keyupListener = this.renderer.listen(this.inputEl.nativeElement, 'keyup', event => {
1028
+ if (event.keyCode === BACK_KEYCODE || (event.keyCode >= CONTROL_KEYCODES_UPPER_BORDER && !OTHER_CONTROL_KEYS.has(event.keyCode))) {
1029
+ this.formatInput(event.target, false);
1030
+ }
1031
+ });
1032
+ this.keydownListener = this.renderer.listen(this.inputEl.nativeElement, 'keydown', event => {
1033
+ const value = event.target.value;
1034
+ if (this.numberFormatService.allowedKeys.includes(event.key) ||
1035
+ (event.keyCode <= CONTROL_KEYCODES_UPPER_BORDER && event.keyCode > 0 && event.keyCode !== SPACE_KEYCODE) ||
1036
+ event.metaKey ||
1037
+ event.ctrlKey ||
1038
+ event.altKey) {
1039
+ /* allow negative sign only as first character and none exists outside of text selection */
1040
+ const indexNegativeSign = value.indexOf(NumberFormatService.NEGATIVE);
1041
+ if (event.key === NumberFormatService.NEGATIVE &&
1042
+ (event.target.selectionStart > 0 || indexNegativeSign > -1) &&
1043
+ (event.target.selectionStart === event.target.selectionEnd ||
1044
+ !(indexNegativeSign >= event.target.selectionStart && indexNegativeSign <= event.target.selectionEnd))) {
1045
+ return false;
1046
+ }
1047
+ /* no duplicate decimal separators */
1048
+ const indexDecimalSep = value.indexOf(this.numberFormatService.decimalSeparator);
1049
+ if (event.key === this.numberFormatService.decimalSeparator &&
1050
+ (indexDecimalSep > -1 || this.decimalPlaces === 0) &&
1051
+ (event.target.selectionStart === event.target.selectionEnd ||
1052
+ !(indexDecimalSep >= event.target.selectionStart && indexDecimalSep <= event.target.selectionEnd))) {
1053
+ return false;
1054
+ }
1055
+ /* prevent too many decimal places */
1056
+ if (NumberFormatService.NUMBERS.includes(event.key) &&
1057
+ indexDecimalSep > -1 &&
1058
+ indexDecimalSep < event.target.selectionStart &&
1059
+ event.target.selectionStart === event.target.selectionEnd &&
1060
+ value.length > indexDecimalSep + this.decimalPlaces) {
1061
+ return false;
1062
+ }
1063
+ /* when deleting thousand separator, remove the digit before or after it */
1064
+ const cursorStart = event.target.selectionStart;
1065
+ if (cursorStart === event.target.selectionEnd) {
1066
+ if (event.keyCode === BACK_KEYCODE && value.substr(cursorStart - 1, 1) === this.numberFormatService.groupingSeparator) {
1067
+ event.target.value = value.substring(0, cursorStart - 2) + value.substring(cursorStart - 1, value.length);
1068
+ event.target.selectionStart = event.target.selectionEnd = cursorStart - 1;
1069
+ return false;
1070
+ }
1071
+ else if (event.keyCode === DEL_KEYCODE && value.substr(cursorStart, 1) === this.numberFormatService.groupingSeparator) {
1072
+ event.target.value = value.substring(0, cursorStart + 1) + value.substring(cursorStart + 2, value.length);
1073
+ event.target.selectionStart = event.target.selectionEnd = cursorStart + 1;
1074
+ return false;
1075
+ }
1076
+ }
1077
+ this.originalValue = NaN;
1078
+ }
1079
+ else {
1080
+ return false;
1081
+ }
1082
+ return true;
1083
+ });
1084
+ }
1085
+ ngOnDestroy() {
1086
+ this.detachListener();
1087
+ }
1088
+ ngAfterViewChecked() {
1089
+ this.injectUnitSymbol();
1090
+ }
1091
+ handleInputChanged() {
1092
+ // Call in set timeout to avoid Expression has changed after it has been checked error.
1093
+ // Sometimes the value changes because we cut off decimal places
1094
+ setTimeout(() => {
1095
+ this.updateInput(this.numberFormatService.format(this._numericValue, {
1096
+ decimalPlaces: this.decimalPlaces,
1097
+ finalFormatting: false,
1098
+ autofillDecimals: this.autofillDecimals,
1099
+ }));
1100
+ }, 1);
1101
+ }
1102
+ formatInput(element, finalFormatting) {
1103
+ const cursorPos = element.selectionStart;
1104
+ const length = element.value.length;
1105
+ const setCursor = this.displayValue !== element.value;
1106
+ const textFormatted = this.numberFormatService.formatNumber(element.value, {
1107
+ decimalPlaces: this.decimalPlaces,
1108
+ finalFormatting,
1109
+ autofillDecimals: this.autofillDecimals,
1110
+ });
1111
+ // special handling to move unit symbol along with display value
1112
+ if (this.textAlign === 'left' && this.unitPosition === 'right') {
1113
+ const inputStyles = window.getComputedStyle(this.inputEl.nativeElement.parentElement, null);
1114
+ this.unitSpan.style.position = 'absolute';
1115
+ this.unitSpan.style.marginTop = inputStyles.getPropertyValue('border-top-width');
1116
+ this.unitSpan.style.paddingTop = inputStyles.getPropertyValue('padding-top');
1117
+ this.unitSpan.style.paddingBottom = inputStyles.getPropertyValue('padding-bottom');
1118
+ if (!this.textSpan) {
1119
+ this.textSpan = document.createElement('span');
1120
+ document.body.appendChild(this.textSpan);
1121
+ this.textSpan.style.font = inputStyles.getPropertyValue('font');
1122
+ this.textSpan.style.fontSize = inputStyles.getPropertyValue('font-size');
1123
+ this.textSpan.style.height = 'auto';
1124
+ this.textSpan.style.width = 'auto';
1125
+ this.textSpan.style.position = 'absolute';
1126
+ this.textSpan.style.top = '0';
1127
+ this.textSpan.style.whiteSpace = 'no-wrap';
1128
+ this.textSpan.style.visibility = 'hidden';
1129
+ }
1130
+ this.textSpan.innerHTML = textFormatted;
1131
+ const width = Math.min(this.inputEl.nativeElement.clientWidth - this.unitSpan.clientWidth, Math.ceil(this.textSpan.clientWidth));
1132
+ this.unitSpan.style.left = width + 'px';
1133
+ }
1134
+ this.updateInput(textFormatted);
1135
+ if (setCursor) {
1136
+ element.selectionStart = element.selectionEnd = Math.max(cursorPos + element.value.length - length, 0);
1137
+ }
1138
+ }
1139
+ updateInput(value) {
1140
+ this.displayValue = value;
1141
+ this.inputEl.nativeElement.value = value;
1142
+ this._numericValue = parseFloat(this.numberFormatService.strip(value, { decimalPlaces: this.decimalPlaces }).replace(this.numberFormatService.decimalSeparator, '.'));
1143
+ if (this._numericValue !== this.roundOrTruncate(this.originalValue)) {
1144
+ this.originalValue = this._numericValue;
1145
+ this.numericValueChanged.emit(this._numericValue);
1146
+ }
1147
+ }
1148
+ getValueForFormControl() {
1149
+ this.formatInput(this.inputEl.nativeElement, false);
1150
+ if (isNaN(this._numericValue)) {
1151
+ // Return undefined instead of NaN to support the default required validator.
1152
+ return undefined; // eslint-disable-line
1153
+ }
1154
+ return this._numericValue;
1155
+ }
1156
+ injectUnitSymbol() {
1157
+ // Need to inject the unit symbol when the input element width is set to its actual value,
1158
+ // otherwise the icon wont show in the correct position
1159
+ if (!!this.unit && !this.unitSpan && this.inputEl.nativeElement.offsetWidth !== 0) {
1160
+ // Get the input wrapper and apply necessary styles
1161
+ const inputWrapper = this.inputEl.nativeElement.parentNode.parentNode;
1162
+ // Create the span with unit symbol and apply necessary styles
1163
+ this.unitSpan = this.renderer.createElement('span');
1164
+ if (this.unitPosition === 'left') {
1165
+ this.renderer.setAttribute(this.unitSpan, 'matPrefix', '');
1166
+ this.renderer.setStyle(this.unitSpan, 'padding-right', '5px');
1167
+ this.renderer.insertBefore(inputWrapper, this.unitSpan, inputWrapper.children[0]);
1168
+ }
1169
+ else {
1170
+ this.renderer.setAttribute(this.unitSpan, 'matSuffix', '');
1171
+ this.renderer.setStyle(this.unitSpan, 'padding-left', '5px');
1172
+ this.renderer.appendChild(inputWrapper, this.unitSpan);
1173
+ }
1174
+ }
1175
+ // do not display unit symbol if the unit should move along display value
1176
+ if (!!this.unitSpan && this.textAlign === 'left' && this.unitPosition === 'right') {
1177
+ if (NumberFormatService.valueIsSet(this.displayValue)) {
1178
+ this.unitSpan.style.display = 'unset';
1179
+ }
1180
+ else {
1181
+ this.unitSpan.style.display = 'none';
1182
+ }
1183
+ }
1184
+ // always reset unit symbol
1185
+ if (!!this.unitSpan) {
1186
+ this.unitSpan.textContent = this.unit;
1187
+ }
1188
+ }
1189
+ detachListener() {
1190
+ if (this.inputChangeListener) {
1191
+ this.inputChangeListener();
1192
+ delete this.inputChangeListener;
1193
+ }
1194
+ if (this.keydownListener) {
1195
+ this.keydownListener();
1196
+ delete this.keydownListener;
1197
+ }
1198
+ if (this.keyupListener) {
1199
+ this.keyupListener();
1200
+ delete this.keyupListener;
1201
+ }
1202
+ }
1203
+ roundOrTruncate(value) {
1204
+ const method = this.roundValue ? 'round' : value < 0 ? 'ceil' : 'floor';
1205
+ return Math[method](value * Math.pow(10, this.decimalPlaces)) / Math.pow(10, this.decimalPlaces);
1206
+ }
1207
+ }
1208
+ NumericFieldDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: NumericFieldDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: NumberFormatService }], target: i0.ɵɵFactoryTarget.Directive });
1209
+ NumericFieldDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.2", type: NumericFieldDirective, selector: "[madNumericField]", inputs: { textAlign: "textAlign", decimalPlaces: "decimalPlaces", roundValue: ["roundDisplayValue", "roundValue"], autofillDecimals: "autofillDecimals", unit: "unit", unitPosition: "unitPosition", numericValue: "numericValue" }, outputs: { numericValueChanged: "numericValueChange" }, host: { listeners: { "change": "onChange(getValueForFormControl())", "input": "onChange(getValueForFormControl())", "blur": "onTouched()" }, properties: { "class.text-right": "textAlign === \"right\"" } }, providers: [
1210
+ {
1211
+ provide: NG_VALUE_ACCESSOR,
1212
+ useExisting: forwardRef(() => NumericFieldDirective),
1213
+ multi: true,
1214
+ },
1215
+ ], ngImport: i0 });
1216
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: NumericFieldDirective, decorators: [{
1217
+ type: Directive,
1218
+ args: [{
1219
+ selector: '[madNumericField]',
1220
+ host: {
1221
+ '[class.text-right]': 'textAlign === "right"',
1222
+ '(change)': 'onChange(getValueForFormControl())',
1223
+ '(input)': 'onChange(getValueForFormControl())',
1224
+ '(blur)': 'onTouched()',
1225
+ },
1226
+ providers: [
1227
+ {
1228
+ provide: NG_VALUE_ACCESSOR,
1229
+ useExisting: forwardRef(() => NumericFieldDirective),
1230
+ multi: true,
1231
+ },
1232
+ ],
1233
+ }]
1234
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: NumberFormatService }]; }, propDecorators: { textAlign: [{
1235
+ type: Input,
1236
+ args: ['textAlign']
1237
+ }], decimalPlaces: [{
1238
+ type: Input,
1239
+ args: ['decimalPlaces']
1240
+ }], roundValue: [{
1241
+ type: Input,
1242
+ args: ['roundDisplayValue']
1243
+ }], autofillDecimals: [{
1244
+ type: Input,
1245
+ args: ['autofillDecimals']
1246
+ }], unit: [{
1247
+ type: Input,
1248
+ args: ['unit']
1249
+ }], unitPosition: [{
1250
+ type: Input,
1251
+ args: ['unitPosition']
1252
+ }], numericValueChanged: [{
1253
+ type: Output,
1254
+ args: ['numericValueChange']
1255
+ }], numericValue: [{
1256
+ type: Input,
1257
+ args: ['numericValue']
1258
+ }] } });
1259
+
1260
+ class NumericFieldModule {
1261
+ static forRoot() {
1262
+ return {
1263
+ ngModule: NumericFieldModule,
1264
+ providers: [NumberFormatService],
1265
+ };
1266
+ }
1267
+ }
1268
+ NumericFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: NumericFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1269
+ NumericFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: NumericFieldModule, declarations: [NumericFieldDirective], exports: [NumericFieldDirective] });
1270
+ NumericFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: NumericFieldModule, providers: [NumberFormatService] });
1271
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: NumericFieldModule, decorators: [{
1272
+ type: NgModule,
1273
+ args: [{
1274
+ providers: [NumberFormatService],
1275
+ declarations: [NumericFieldDirective],
1276
+ exports: [NumericFieldDirective],
1277
+ }]
1278
+ }] });
1279
+
1280
+ class ThrottleClickDirective {
1281
+ constructor() {
1282
+ this.throttleTime = 300;
1283
+ this.throttleClick = new EventEmitter();
1284
+ this.clicks = new Subject();
1285
+ }
1286
+ clickEvent(event) {
1287
+ event.preventDefault();
1288
+ event.stopPropagation();
1289
+ this.clicks.next(event);
1290
+ }
1291
+ ngOnInit() {
1292
+ this.subscription = this.clicks.pipe(throttleTime(this.throttleTime)).subscribe(e => this.throttleClick.emit(e));
1293
+ }
1294
+ ngOnDestroy() {
1295
+ this.subscription.unsubscribe();
1296
+ }
1297
+ }
1298
+ ThrottleClickDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ThrottleClickDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1299
+ ThrottleClickDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.2", type: ThrottleClickDirective, selector: "[madThrottleClick]", inputs: { throttleTime: "throttleTime" }, outputs: { throttleClick: "throttleClick" }, host: { listeners: { "click": "clickEvent($event)" } }, ngImport: i0 });
1300
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ThrottleClickDirective, decorators: [{
1301
+ type: Directive,
1302
+ args: [{
1303
+ selector: '[madThrottleClick]',
1304
+ }]
1305
+ }], propDecorators: { throttleTime: [{
1306
+ type: Input
1307
+ }], throttleClick: [{
1308
+ type: Output
1309
+ }], clickEvent: [{
1310
+ type: HostListener,
1311
+ args: ['click', ['$event']]
1312
+ }] } });
1313
+
1314
+ class CardComponent {
1315
+ constructor() {
1316
+ this.cancelDisabled = false;
1317
+ this.cancelText = 'NOT SET';
1318
+ this.readonly = true;
1319
+ this.editText = 'NOT SET';
1320
+ this.expandable = true;
1321
+ this.expanded = true;
1322
+ this.saveDisabled = false;
1323
+ this.saveText = 'NOT SET';
1324
+ this.editMode = false;
1325
+ this.additionalActionText = '';
1326
+ this.edit = new EventEmitter();
1327
+ this.cancel = new EventEmitter();
1328
+ this.save = new EventEmitter();
1329
+ this.additionalAction = new EventEmitter();
1330
+ }
1331
+ onCancel() {
1332
+ this.cancel.emit(undefined);
1333
+ }
1334
+ onEdit() {
1335
+ this.edit.emit(undefined);
1336
+ this.expanded = true;
1337
+ }
1338
+ onSave() {
1339
+ this.save.emit(undefined);
1340
+ }
1341
+ toggleCollapse() {
1342
+ this.expanded = !this.expanded;
1343
+ }
1344
+ additionalActionClicked() {
1345
+ this.additionalAction.emit(undefined);
1346
+ }
1347
+ }
1348
+ CardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1349
+ CardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: CardComponent, selector: "mad-card", inputs: { cancelDisabled: "cancelDisabled", cancelText: "cancelText", readonly: "readonly", editText: "editText", expandable: "expandable", expanded: "expanded", saveDisabled: "saveDisabled", saveText: "saveText", title: "title", editMode: "editMode", additionalActionIcon: "additionalActionIcon", additionalActionText: "additionalActionText" }, outputs: { edit: "edit", cancel: "cancel", save: "save", additionalAction: "additionalAction" }, ngImport: i0, template: "<mat-card>\n <mat-card-header>\n <mat-card-title>\n {{ title }}\n <mad-icon-button (click)=\"toggleCollapse()\" *ngIf=\"expandable && !editMode\">\n <mat-icon [@rotateIcon]=\"!expanded\">keyboard_arrow_down</mat-icon>\n </mad-icon-button>\n </mat-card-title>\n <span>\n <mad-icon-button (click)=\"additionalActionClicked()\" *ngIf=\"additionalActionIcon\" [title]=\"additionalActionText\" type=\"button\">\n <mat-icon>{{additionalActionIcon}}</mat-icon>\n </mad-icon-button>\n <mad-icon-button [title]=\"editText\" (click)=\"onEdit()\" *ngIf=\"!readonly && !editMode\">\n <mat-icon>create</mat-icon>\n </mad-icon-button>\n </span>\n </mat-card-header>\n <mat-card-content [@collapseExpandAnimation] *ngIf=\"expanded\">\n <ng-content></ng-content>\n </mat-card-content>\n <mat-card-actions *ngIf=\"!readonly && editMode\">\n <mad-primary-button [title]=\"saveText\" [disabled]=\"saveDisabled\" (throttleClick)=\"onSave()\" madThrottleClick>\n {{ saveText }}\n </mad-primary-button>\n <mad-outline-button [title]=\"cancelText\" [disabled]=\"cancelDisabled\" (click)=\"onCancel()\">\n {{ cancelText }}\n </mad-outline-button>\n </mat-card-actions>\n</mat-card>\n", styles: ["mat-card-header{display:flex;flex-direction:row;justify-content:space-between}mat-card-header mat-card-title{justify-content:space-between}mat-card-header mat-card-title:hover{background:unset!important}mat-card-header h3{margin:0 .25em 0 0;float:left;line-height:40px;font-weight:700}.mat-card-actions{margin-left:0;margin-right:0}.mat-card>.mat-card-actions:last-child{margin-bottom:0}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$3.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i2$3.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i2$3.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { kind: "directive", type: i2$3.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "directive", type: i2$3.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: PrimaryButtonComponent, selector: "mad-primary-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button", inputs: ["type", "disabled", "title"] }, { kind: "directive", type: ThrottleClickDirective, selector: "[madThrottleClick]", inputs: ["throttleTime"], outputs: ["throttleClick"] }], animations: [
1350
+ trigger('collapseExpandAnimation', [
1351
+ transition(':enter', [
1352
+ style({ opacity: 0, height: 0, overflow: 'hidden' }),
1353
+ animate('100ms', style({
1354
+ opacity: 1,
1355
+ height: '*',
1356
+ })),
1357
+ ]),
1358
+ transition(':leave', [
1359
+ style({ opacity: 1, height: '*', overflow: 'hidden' }),
1360
+ animate('100ms', style({
1361
+ opacity: 0,
1362
+ height: 0,
1363
+ })),
1364
+ ]),
1365
+ ]),
1366
+ trigger('rotateIcon', [
1367
+ state('true', style({ transform: 'rotate(0)' })),
1368
+ state('false', style({ transform: 'rotate(180deg)' })),
1369
+ transition('true => false', animate('100ms ease-out')),
1370
+ transition('false => true', animate('100ms ease-in')),
1371
+ ]),
1372
+ ] });
1373
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: CardComponent, decorators: [{
1374
+ type: Component,
1375
+ args: [{ selector: 'mad-card', animations: [
1376
+ trigger('collapseExpandAnimation', [
1377
+ transition(':enter', [
1378
+ style({ opacity: 0, height: 0, overflow: 'hidden' }),
1379
+ animate('100ms', style({
1380
+ opacity: 1,
1381
+ height: '*',
1382
+ })),
1383
+ ]),
1384
+ transition(':leave', [
1385
+ style({ opacity: 1, height: '*', overflow: 'hidden' }),
1386
+ animate('100ms', style({
1387
+ opacity: 0,
1388
+ height: 0,
1389
+ })),
1390
+ ]),
1391
+ ]),
1392
+ trigger('rotateIcon', [
1393
+ state('true', style({ transform: 'rotate(0)' })),
1394
+ state('false', style({ transform: 'rotate(180deg)' })),
1395
+ transition('true => false', animate('100ms ease-out')),
1396
+ transition('false => true', animate('100ms ease-in')),
1397
+ ]),
1398
+ ], template: "<mat-card>\n <mat-card-header>\n <mat-card-title>\n {{ title }}\n <mad-icon-button (click)=\"toggleCollapse()\" *ngIf=\"expandable && !editMode\">\n <mat-icon [@rotateIcon]=\"!expanded\">keyboard_arrow_down</mat-icon>\n </mad-icon-button>\n </mat-card-title>\n <span>\n <mad-icon-button (click)=\"additionalActionClicked()\" *ngIf=\"additionalActionIcon\" [title]=\"additionalActionText\" type=\"button\">\n <mat-icon>{{additionalActionIcon}}</mat-icon>\n </mad-icon-button>\n <mad-icon-button [title]=\"editText\" (click)=\"onEdit()\" *ngIf=\"!readonly && !editMode\">\n <mat-icon>create</mat-icon>\n </mad-icon-button>\n </span>\n </mat-card-header>\n <mat-card-content [@collapseExpandAnimation] *ngIf=\"expanded\">\n <ng-content></ng-content>\n </mat-card-content>\n <mat-card-actions *ngIf=\"!readonly && editMode\">\n <mad-primary-button [title]=\"saveText\" [disabled]=\"saveDisabled\" (throttleClick)=\"onSave()\" madThrottleClick>\n {{ saveText }}\n </mad-primary-button>\n <mad-outline-button [title]=\"cancelText\" [disabled]=\"cancelDisabled\" (click)=\"onCancel()\">\n {{ cancelText }}\n </mad-outline-button>\n </mat-card-actions>\n</mat-card>\n", styles: ["mat-card-header{display:flex;flex-direction:row;justify-content:space-between}mat-card-header mat-card-title{justify-content:space-between}mat-card-header mat-card-title:hover{background:unset!important}mat-card-header h3{margin:0 .25em 0 0;float:left;line-height:40px;font-weight:700}.mat-card-actions{margin-left:0;margin-right:0}.mat-card>.mat-card-actions:last-child{margin-bottom:0}\n"] }]
1399
+ }], propDecorators: { cancelDisabled: [{
1400
+ type: Input
1401
+ }], cancelText: [{
1402
+ type: Input
1403
+ }], readonly: [{
1404
+ type: Input
1405
+ }], editText: [{
1406
+ type: Input
1407
+ }], expandable: [{
1408
+ type: Input
1409
+ }], expanded: [{
1410
+ type: Input
1411
+ }], saveDisabled: [{
1412
+ type: Input
1413
+ }], saveText: [{
1414
+ type: Input
1415
+ }], title: [{
1416
+ type: Input
1417
+ }], editMode: [{
1418
+ type: Input
1419
+ }], additionalActionIcon: [{
1420
+ type: Input
1421
+ }], additionalActionText: [{
1422
+ type: Input
1423
+ }], edit: [{
1424
+ type: Output
1425
+ }], cancel: [{
1426
+ type: Output
1427
+ }], save: [{
1428
+ type: Output
1429
+ }], additionalAction: [{
1430
+ type: Output
1431
+ }] } });
1432
+
1433
+ class ThrottleClickModule {
1434
+ }
1435
+ ThrottleClickModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ThrottleClickModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1436
+ ThrottleClickModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: ThrottleClickModule, declarations: [ThrottleClickDirective], imports: [CommonModule], exports: [ThrottleClickDirective] });
1437
+ ThrottleClickModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ThrottleClickModule, imports: [CommonModule] });
1438
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ThrottleClickModule, decorators: [{
1439
+ type: NgModule,
1440
+ args: [{
1441
+ declarations: [ThrottleClickDirective],
1442
+ imports: [CommonModule],
1443
+ exports: [ThrottleClickDirective],
1444
+ }]
1445
+ }] });
1446
+
1447
+ class CardModule {
1448
+ }
1449
+ CardModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: CardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1450
+ CardModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: CardModule, declarations: [CardComponent], imports: [CommonModule, MatCardModule, MatIconModule, ButtonModule, MatButtonModule, ThrottleClickModule], exports: [CardComponent] });
1451
+ CardModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: CardModule, imports: [CommonModule, MatCardModule, MatIconModule, ButtonModule, MatButtonModule, ThrottleClickModule] });
1452
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: CardModule, decorators: [{
1453
+ type: NgModule,
1454
+ args: [{
1455
+ declarations: [CardComponent],
1456
+ imports: [CommonModule, MatCardModule, MatIconModule, ButtonModule, MatButtonModule, ThrottleClickModule],
1457
+ exports: [CardComponent],
1458
+ }]
1459
+ }] });
1460
+
1461
+ class BaseQuickListComponent {
1462
+ constructor(changeDetectorRef) {
1463
+ this.changeDetectorRef = changeDetectorRef;
1464
+ this.allItems = [];
1465
+ this.addLabel = 'NOT SET';
1466
+ this.addPossible = true;
1467
+ this.removePossible = true;
1468
+ this.blankItem = {};
1469
+ this.added = new EventEmitter();
1470
+ this.removed = new EventEmitter();
1471
+ }
1472
+ ngOnInit() {
1473
+ this.addEventFunction = this.addItem.bind(this);
1474
+ if (this.minItems) {
1475
+ for (let n = this.allItems.length; n < this.minItems; n++) {
1476
+ this.interalAddItem();
1477
+ }
1478
+ }
1479
+ }
1480
+ ngAfterViewInit() {
1481
+ setTimeout(() => this.setFocusOnAdd(), 1);
1482
+ }
1483
+ addItem() {
1484
+ const newItem = this.interalAddItem();
1485
+ if (!!newItem) {
1486
+ this.added.emit(newItem);
1487
+ }
1488
+ }
1489
+ removeItem(item) {
1490
+ if (this.isDeleteAllowed()) {
1491
+ this.allItems.splice(this.allItems.indexOf(item), 1);
1492
+ this.removed.emit(item);
1493
+ }
1494
+ }
1495
+ setFocusOnAdd() {
1496
+ this.rowCountFocus = this.itemRows.length;
1497
+ this.itemRows.changes.subscribe((els) => {
1498
+ if (els.length > this.rowCountFocus && !!els.last) {
1499
+ const firstFocusable = els.last.nativeElement.querySelector("button, a, input, select, textarea, [tabindex]:not([tabindex='-1'])");
1500
+ if (firstFocusable) {
1501
+ firstFocusable.focus();
1502
+ }
1503
+ }
1504
+ this.rowCountFocus = els.length;
1505
+ });
1506
+ }
1507
+ isAddAllowed() {
1508
+ return this.addPossible && (!this.maxItems || this.allItems.length < this.maxItems);
1509
+ }
1510
+ isDeleteAllowed() {
1511
+ return this.removePossible && (!this.minItems || this.allItems.length > this.minItems);
1512
+ }
1513
+ interalAddItem() {
1514
+ if (this.isAddAllowed()) {
1515
+ const newItem = { ...this.blankItem };
1516
+ // creates ids in the form of "n5kdz1pljl8"
1517
+ newItem.id = Math.random()
1518
+ .toString(36)
1519
+ .substring(2);
1520
+ this.allItems.push(newItem);
1521
+ this.changeDetectorRef.detectChanges();
1522
+ return newItem;
1523
+ }
1524
+ return null;
1525
+ }
1526
+ }
1527
+ BaseQuickListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BaseQuickListComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1528
+ BaseQuickListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: BaseQuickListComponent, selector: "mad-base-quick-list", inputs: { allItems: "allItems", addLabel: "addLabel", addPossible: "addPossible", removePossible: "removePossible", blankItem: "blankItem", readonly: "readonly", maxItems: "maxItems", minItems: "minItems" }, outputs: { added: "added", removed: "removed" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "itemRows", predicate: ["row"], descendants: true }], ngImport: i0, template: '', isInline: true });
1529
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BaseQuickListComponent, decorators: [{
1530
+ type: Component,
1531
+ args: [{ selector: 'mad-base-quick-list', template: '' }]
1532
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { allItems: [{
1533
+ type: Input
1534
+ }], addLabel: [{
1535
+ type: Input
1536
+ }], addPossible: [{
1537
+ type: Input
1538
+ }], removePossible: [{
1539
+ type: Input
1540
+ }], blankItem: [{
1541
+ type: Input
1542
+ }], readonly: [{
1543
+ type: Input
1544
+ }], maxItems: [{
1545
+ type: Input
1546
+ }], minItems: [{
1547
+ type: Input
1548
+ }], added: [{
1549
+ type: Output
1550
+ }], removed: [{
1551
+ type: Output
1552
+ }], itemTemplate: [{
1553
+ type: ContentChild,
1554
+ args: [TemplateRef]
1555
+ }], itemRows: [{
1556
+ type: ViewChildren,
1557
+ args: ['row']
1558
+ }] } });
1559
+
1560
+ class QuickListCompactComponent extends BaseQuickListComponent {
1561
+ constructor(changeDetectorRef) {
1562
+ super(changeDetectorRef);
1563
+ this.changeDetectorRef = changeDetectorRef;
1564
+ }
1565
+ }
1566
+ QuickListCompactComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: QuickListCompactComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1567
+ QuickListCompactComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: QuickListCompactComponent, selector: "mad-quick-list-compact", usesInheritance: true, ngImport: i0, template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n<ng-container *ngFor=\"let item of allItems; let isLast = last;\">\n <div class=\"flex-container\" *ngIf=\"itemTemplate\" #row>\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n <mad-icon-button *ngIf=\"!readonly && isDeleteAllowed()\" (click)=\"removeItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n <mad-icon-button *ngIf=\"!readonly && isLast\" [disabled]=\"!isAddAllowed()\" (click)=\"addItem()\">\n <mat-icon>add_circle_outline</mat-icon>\n </mad-icon-button>\n </div>\n</ng-container>\n<mad-link-button *ngIf=\"!readonly && !this.allItems.length\"\n (click)=\"addItem()\"\n [disabled]=\"!isAddAllowed()\">\n {{ addLabel }}\n</mad-link-button>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: LinkButtonComponent, selector: "mad-link-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button", inputs: ["type", "disabled", "title"] }] });
1568
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: QuickListCompactComponent, decorators: [{
1569
+ type: Component,
1570
+ args: [{ selector: 'mad-quick-list-compact', template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n<ng-container *ngFor=\"let item of allItems; let isLast = last;\">\n <div class=\"flex-container\" *ngIf=\"itemTemplate\" #row>\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n <mad-icon-button *ngIf=\"!readonly && isDeleteAllowed()\" (click)=\"removeItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n <mad-icon-button *ngIf=\"!readonly && isLast\" [disabled]=\"!isAddAllowed()\" (click)=\"addItem()\">\n <mat-icon>add_circle_outline</mat-icon>\n </mad-icon-button>\n </div>\n</ng-container>\n<mad-link-button *ngIf=\"!readonly && !this.allItems.length\"\n (click)=\"addItem()\"\n [disabled]=\"!isAddAllowed()\">\n {{ addLabel }}\n</mad-link-button>\n" }]
1571
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
1572
+
1573
+ // Based on https://github.com/porscheinformatik/clarity-addons/blob/master/src/clr-addons/generic-quick-list/generic-quick-list.ts
1574
+ class QuickListComponent extends BaseQuickListComponent {
1575
+ constructor(changeDetectorRef) {
1576
+ super(changeDetectorRef);
1577
+ this.changeDetectorRef = changeDetectorRef;
1578
+ }
1579
+ }
1580
+ QuickListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: QuickListComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1581
+ QuickListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: QuickListComponent, selector: "mad-quick-list", usesInheritance: true, ngImport: i0, template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n<ng-container *ngFor=\"let item of allItems\">\n <div *ngIf=\"itemTemplate\" #row>\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n <mad-icon-button *ngIf=\"!readonly && isDeleteAllowed()\" (click)=\"removeItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n </div>\n</ng-container>\n<mad-link-button *ngIf=\"!readonly\" (click)=\"addItem()\"\n [disabled]=\"!addPossible || !isAddAllowed()\">\n {{ addLabel }}\n</mad-link-button>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: LinkButtonComponent, selector: "mad-link-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button", inputs: ["type", "disabled", "title"] }] });
1582
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: QuickListComponent, decorators: [{
1583
+ type: Component,
1584
+ args: [{ selector: 'mad-quick-list', template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n<ng-container *ngFor=\"let item of allItems\">\n <div *ngIf=\"itemTemplate\" #row>\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n <mad-icon-button *ngIf=\"!readonly && isDeleteAllowed()\" (click)=\"removeItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n </div>\n</ng-container>\n<mad-link-button *ngIf=\"!readonly\" (click)=\"addItem()\"\n [disabled]=\"!addPossible || !isAddAllowed()\">\n {{ addLabel }}\n</mad-link-button>\n" }]
1585
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
1586
+
1587
+ class QuickListModule {
1588
+ }
1589
+ QuickListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: QuickListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1590
+ QuickListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: QuickListModule, declarations: [QuickListComponent, BaseQuickListComponent, QuickListCompactComponent], imports: [CommonModule, MatButtonModule, MatIconModule, ButtonModule], exports: [QuickListComponent, QuickListCompactComponent, BaseQuickListComponent] });
1591
+ QuickListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: QuickListModule, imports: [CommonModule, MatButtonModule, MatIconModule, ButtonModule] });
1592
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: QuickListModule, decorators: [{
1593
+ type: NgModule,
1594
+ args: [{
1595
+ declarations: [QuickListComponent, BaseQuickListComponent, QuickListCompactComponent],
1596
+ imports: [CommonModule, MatButtonModule, MatIconModule, ButtonModule],
1597
+ exports: [QuickListComponent, QuickListCompactComponent, BaseQuickListComponent],
1598
+ }]
1599
+ }] });
1600
+
1601
+ class TableComponent {
1602
+ constructor() {
1603
+ this.columns = [];
1604
+ this.filterLabel = 'NOT SET';
1605
+ this.filterPlaceholder = 'NOT SET';
1606
+ this.pageSizeOptions = [5, 10, 15];
1607
+ this.defaultPageSize = this.pageSizeOptions?.[0] || 10;
1608
+ this.rowActions = [];
1609
+ this.tableActions = [];
1610
+ this.tableAction = new EventEmitter();
1611
+ this.rowAction = new EventEmitter();
1612
+ this.sortEvent = new EventEmitter();
1613
+ this.ACTION_COLUMN_NAME = '__action__';
1614
+ this.isFilterEnabled = false;
1615
+ this.isPaginationEnabled = false;
1616
+ }
1617
+ set displayedData(data) {
1618
+ if (!this.dataSource) {
1619
+ this.dataSource = new MatTableDataSource(data);
1620
+ }
1621
+ else {
1622
+ this.dataSource.data = data;
1623
+ }
1624
+ }
1625
+ set paginationEnabled(isPaginationEnabled) {
1626
+ this.isPaginationEnabled = isPaginationEnabled;
1627
+ // eslint-disable-next-line
1628
+ const pageSize = this.isPaginationEnabled ? this.defaultPageSize : Number.MAX_VALUE;
1629
+ if (this.dataSource.paginator) {
1630
+ this.dataSource.paginator._changePageSize(pageSize);
1631
+ }
1632
+ }
1633
+ set filterEnabled(isFilterEnabled) {
1634
+ this.isFilterEnabled = isFilterEnabled;
1635
+ this.setFilterValue(undefined);
1636
+ }
1637
+ ngOnInit() {
1638
+ this.columnNames = this.columns.map(column => column.label);
1639
+ this.isRowClickable = this.rowActions.length > 0;
1640
+ if (this.isRowClickable) {
1641
+ this.columnNames.unshift(this.ACTION_COLUMN_NAME);
1642
+ this.defaultAction = this.rowActions[0];
1643
+ }
1644
+ }
1645
+ ngAfterViewInit() {
1646
+ this.dataSource.paginator = this.paginator;
1647
+ this.dataSource.sort = this.sort;
1648
+ // set custom filter predicate to enable search for multiple search strings:
1649
+ // e.g. "one two three"
1650
+ this.dataSource.filterPredicate = (data, filter) => !filter || filter.split(/\s+/).every(term => !!Object.keys(data).find(key => data[key].includes(term)));
1651
+ }
1652
+ onFilter(value) {
1653
+ this.setFilterValue(value);
1654
+ }
1655
+ onRowEvent(event, row, action = this.defaultAction) {
1656
+ if (!!action && !this.isClickOnRowMenuIcon(event)) {
1657
+ this.rowAction.emit({ ...action, outputRow: row });
1658
+ }
1659
+ }
1660
+ onSortingEvent(sortingParams) {
1661
+ this.sortEvent.emit(sortingParams);
1662
+ }
1663
+ onTableAction(tableAction) {
1664
+ if (!!tableAction) {
1665
+ this.tableAction.emit(tableAction);
1666
+ }
1667
+ }
1668
+ setFilterValue(value) {
1669
+ this.dataSource.filter = value?.trim().toLowerCase();
1670
+ }
1671
+ isClickOnRowMenuIcon(event) {
1672
+ return event?.target?.classList.contains('mat-icon');
1673
+ }
1674
+ }
1675
+ TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1676
+ TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: TableComponent, selector: "mad-table", inputs: { columns: "columns", filterLabel: "filterLabel", filterPlaceholder: "filterPlaceholder", noDataText: "noDataText", pageSizeOptions: "pageSizeOptions", defaultPageSize: "defaultPageSize", rowActions: "rowActions", tableActions: "tableActions", displayedData: "displayedData", paginationEnabled: "paginationEnabled", filterEnabled: "filterEnabled" }, outputs: { tableAction: "tableAction", rowAction: "rowAction", sortEvent: "sortEvent" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }], ngImport: i0, template: "<!-- Table actions -->\n<div *ngIf=\"tableActions?.length\">\n <mad-primary-button class=\"table-action\" *ngFor=\"let tableAction of tableActions\" (click)=\"onTableAction(tableAction)\">\n {{ tableAction.label }}\n </mad-primary-button>\n</div>\n\n<!-- Row action buttons -->\n<mat-menu #menu=\"matMenu\">\n <ng-template matMenuContent let-element=\"element\">\n <button *ngFor=\"let rowAction of rowActions\" mat-menu-item class=\"row-action\" (click)=\"onRowEvent($event, element, rowAction)\">\n {{ rowAction.label }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- Table filter -->\n<mat-form-field *ngIf=\"isFilterEnabled\">\n <mat-label>{{ filterLabel }}</mat-label>\n <input matInput (keyup)=\"onFilter($event?.target?.value)\" placeholder=\"{{ filterPlaceholder }}\" />\n</mat-form-field>\n\n<!-- Table -->\n<div *ngIf=\"dataSource?.data?.length > 0; else noData\" class=\"mad-table\">\n <table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSortingEvent($event)\">\n <!-- Row actions column -->\n <ng-container [matColumnDef]=\"ACTION_COLUMN_NAME\" *ngIf=\"rowActions?.length\" sticky>\n <th mat-header-cell *matHeaderCellDef class=\"row-action-button\"></th>\n <td mat-cell *matCellDef=\"let element\" class=\"row-action-button\">\n <mad-icon-button [matMenuTriggerData]=\"{ element: element }\" [matMenuTriggerFor]=\"menu\">\n <mat-icon>more_vert</mat-icon>\n </mad-icon-button>\n </td>\n </ng-container>\n <!-- Columns with data -->\n <ng-container *ngFor=\"let column of columns\" [matColumnDef]=\"column.label\" [sticky]=\"column.isSticky\">\n <ng-container *ngIf=\"column.isSortable; else noSort\">\n <th\n mat-header-cell\n *matHeaderCellDef\n mat-sort-header=\"{{ column.label }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n [class.text-right]=\"column.isRightAligned\"\n >\n {{ column.label }}\n </th>\n </ng-container>\n <ng-template #noSort>\n <th mat-header-cell *matHeaderCellDef [class.text-right]=\"column.isRightAligned\">\n {{ column.label }}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" [class.text-right]=\"column.isRightAligned\">\n {{ element[column.dataPropertyName] }}\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"columnNames\"></tr>\n <tr\n mat-row\n [class.clickable-table-row]=\"isRowClickable\"\n (click)=\"onRowEvent($event, row)\"\n *matRowDef=\"let row; columns: columnNames\"\n ></tr>\n </table>\n</div>\n<!-- Pagination -->\n<mat-paginator\n [style.display]=\"isPaginationEnabled ? 'block' : 'none'\"\n [pageSize]=\"defaultPageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n showFirstLastButtons\n>\n</mat-paginator>\n\n<!-- No data alert -->\n<ng-template #noData>\n <div class=\"noDataText\">\n {{ noDataText }}\n </div>\n</ng-template>\n", styles: [".text-right{text-align:right!important}.table-action{margin-right:.5em;margin-bottom:.5em}.row-action-button{width:10px}.noDataText{width:100%;text-align:center}.mad-table{width:100%;overflow-x:auto}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i6.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "component", type: i6$1.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "directive", type: i7.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i7.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: i8$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i8$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i8$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i8$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i8$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i8$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i8$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i8$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i8$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i8$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: PrimaryButtonComponent, selector: "mad-primary-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button", inputs: ["type", "disabled", "title"] }] });
1677
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: TableComponent, decorators: [{
1678
+ type: Component,
1679
+ args: [{ selector: 'mad-table', template: "<!-- Table actions -->\n<div *ngIf=\"tableActions?.length\">\n <mad-primary-button class=\"table-action\" *ngFor=\"let tableAction of tableActions\" (click)=\"onTableAction(tableAction)\">\n {{ tableAction.label }}\n </mad-primary-button>\n</div>\n\n<!-- Row action buttons -->\n<mat-menu #menu=\"matMenu\">\n <ng-template matMenuContent let-element=\"element\">\n <button *ngFor=\"let rowAction of rowActions\" mat-menu-item class=\"row-action\" (click)=\"onRowEvent($event, element, rowAction)\">\n {{ rowAction.label }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- Table filter -->\n<mat-form-field *ngIf=\"isFilterEnabled\">\n <mat-label>{{ filterLabel }}</mat-label>\n <input matInput (keyup)=\"onFilter($event?.target?.value)\" placeholder=\"{{ filterPlaceholder }}\" />\n</mat-form-field>\n\n<!-- Table -->\n<div *ngIf=\"dataSource?.data?.length > 0; else noData\" class=\"mad-table\">\n <table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSortingEvent($event)\">\n <!-- Row actions column -->\n <ng-container [matColumnDef]=\"ACTION_COLUMN_NAME\" *ngIf=\"rowActions?.length\" sticky>\n <th mat-header-cell *matHeaderCellDef class=\"row-action-button\"></th>\n <td mat-cell *matCellDef=\"let element\" class=\"row-action-button\">\n <mad-icon-button [matMenuTriggerData]=\"{ element: element }\" [matMenuTriggerFor]=\"menu\">\n <mat-icon>more_vert</mat-icon>\n </mad-icon-button>\n </td>\n </ng-container>\n <!-- Columns with data -->\n <ng-container *ngFor=\"let column of columns\" [matColumnDef]=\"column.label\" [sticky]=\"column.isSticky\">\n <ng-container *ngIf=\"column.isSortable; else noSort\">\n <th\n mat-header-cell\n *matHeaderCellDef\n mat-sort-header=\"{{ column.label }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n [class.text-right]=\"column.isRightAligned\"\n >\n {{ column.label }}\n </th>\n </ng-container>\n <ng-template #noSort>\n <th mat-header-cell *matHeaderCellDef [class.text-right]=\"column.isRightAligned\">\n {{ column.label }}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" [class.text-right]=\"column.isRightAligned\">\n {{ element[column.dataPropertyName] }}\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"columnNames\"></tr>\n <tr\n mat-row\n [class.clickable-table-row]=\"isRowClickable\"\n (click)=\"onRowEvent($event, row)\"\n *matRowDef=\"let row; columns: columnNames\"\n ></tr>\n </table>\n</div>\n<!-- Pagination -->\n<mat-paginator\n [style.display]=\"isPaginationEnabled ? 'block' : 'none'\"\n [pageSize]=\"defaultPageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n showFirstLastButtons\n>\n</mat-paginator>\n\n<!-- No data alert -->\n<ng-template #noData>\n <div class=\"noDataText\">\n {{ noDataText }}\n </div>\n</ng-template>\n", styles: [".text-right{text-align:right!important}.table-action{margin-right:.5em;margin-bottom:.5em}.row-action-button{width:10px}.noDataText{width:100%;text-align:center}.mad-table{width:100%;overflow-x:auto}\n"] }]
1680
+ }], propDecorators: { columns: [{
1681
+ type: Input
1682
+ }], filterLabel: [{
1683
+ type: Input
1684
+ }], filterPlaceholder: [{
1685
+ type: Input
1686
+ }], noDataText: [{
1687
+ type: Input
1688
+ }], pageSizeOptions: [{
1689
+ type: Input
1690
+ }], defaultPageSize: [{
1691
+ type: Input
1692
+ }], rowActions: [{
1693
+ type: Input
1694
+ }], tableActions: [{
1695
+ type: Input
1696
+ }], tableAction: [{
1697
+ type: Output
1698
+ }], rowAction: [{
1699
+ type: Output
1700
+ }], sortEvent: [{
1701
+ type: Output
1702
+ }], paginator: [{
1703
+ type: ViewChild,
1704
+ args: [MatPaginator, { static: false }]
1705
+ }], sort: [{
1706
+ type: ViewChild,
1707
+ args: [MatSort, { static: true }]
1708
+ }], displayedData: [{
1709
+ type: Input
1710
+ }], paginationEnabled: [{
1711
+ type: Input
1712
+ }], filterEnabled: [{
1713
+ type: Input
1714
+ }] } });
1715
+
1716
+ class TableModule {
1717
+ }
1718
+ TableModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: TableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1719
+ TableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: TableModule, declarations: [TableComponent], imports: [CommonModule,
1720
+ MatButtonModule,
1721
+ MatIconModule,
1722
+ MatFormFieldModule,
1723
+ MatInputModule,
1724
+ MatMenuModule,
1725
+ MatPaginatorModule,
1726
+ MatSortModule,
1727
+ MatTableModule,
1728
+ ButtonModule], exports: [TableComponent] });
1729
+ TableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: TableModule, imports: [CommonModule,
1730
+ MatButtonModule,
1731
+ MatIconModule,
1732
+ MatFormFieldModule,
1733
+ MatInputModule,
1734
+ MatMenuModule,
1735
+ MatPaginatorModule,
1736
+ MatSortModule,
1737
+ MatTableModule,
1738
+ ButtonModule] });
1739
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: TableModule, decorators: [{
1740
+ type: NgModule,
1741
+ args: [{
1742
+ declarations: [TableComponent],
1743
+ imports: [
1744
+ CommonModule,
1745
+ MatButtonModule,
1746
+ MatIconModule,
1747
+ MatFormFieldModule,
1748
+ MatInputModule,
1749
+ MatMenuModule,
1750
+ MatPaginatorModule,
1751
+ MatSortModule,
1752
+ MatTableModule,
1753
+ ButtonModule,
1754
+ ],
1755
+ exports: [TableComponent],
1756
+ }]
1757
+ }] });
1758
+
1759
+ class DataTableColumnsModalComponent {
1760
+ constructor(dialogRef, data) {
1761
+ this.dialogRef = dialogRef;
1762
+ this.data = data;
1763
+ this.selectedColumns = [];
1764
+ this.availableColumns = [];
1765
+ this.filteredAvailableColumns = [];
1766
+ }
1767
+ ngOnInit() {
1768
+ this.definition = this.data.definition;
1769
+ for (const column of this.data.allColumns) {
1770
+ const columnId = column.id;
1771
+ const selectedColumnIds = this.definition.displayedColumns.map(col => col.id);
1772
+ if (selectedColumnIds.includes(columnId)) {
1773
+ this.selectedColumns.push(column);
1774
+ }
1775
+ else {
1776
+ this.availableColumns.push(column);
1777
+ }
1778
+ }
1779
+ this.clearFilterValue();
1780
+ }
1781
+ onDrop(event) {
1782
+ if (event.previousContainer === event.container) {
1783
+ moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
1784
+ }
1785
+ else {
1786
+ const itemIndex = this.findMatchingItemIndex(event.previousContainer, event.item);
1787
+ transferArrayItem(event.previousContainer.data, event.container.data, itemIndex, event.currentIndex);
1788
+ this.clearFilterValue();
1789
+ this.availableColumns.sort((a, b) => a.label.localeCompare(b.label));
1790
+ }
1791
+ }
1792
+ onSave() {
1793
+ this.definition.displayedColumns = this.selectedColumns;
1794
+ const saveChange = {
1795
+ action: 'SAVE',
1796
+ definition: this.definition,
1797
+ };
1798
+ this.dialogRef.close(saveChange);
1799
+ }
1800
+ onDelete() {
1801
+ const deleteChange = {
1802
+ action: 'DELETE',
1803
+ definition: this.definition,
1804
+ };
1805
+ this.dialogRef.close(deleteChange);
1806
+ }
1807
+ onCancel() {
1808
+ this.dialogRef.close();
1809
+ }
1810
+ updateFilterValue() {
1811
+ if (this.searchFilter?.length > 0) {
1812
+ this.filteredAvailableColumns = this.availableColumns.filter(c => c.label.toLowerCase().includes(this.searchFilter.toLowerCase()));
1813
+ }
1814
+ else {
1815
+ this.filteredAvailableColumns = [...this.availableColumns];
1816
+ }
1817
+ }
1818
+ findMatchingItemIndex(previousContainer, item) {
1819
+ const itemId = item.element.nativeElement.id;
1820
+ const previousContainerItems = [...previousContainer.data];
1821
+ if (previousContainerItems?.length < 1) {
1822
+ return 0;
1823
+ }
1824
+ for (let itemIndex = 0; itemIndex < previousContainerItems.length; itemIndex++) {
1825
+ if (previousContainerItems[itemIndex].id === itemId) {
1826
+ return itemIndex;
1827
+ }
1828
+ }
1829
+ return 0;
1830
+ }
1831
+ clearFilterValue() {
1832
+ this.searchFilter = '';
1833
+ this.filteredAvailableColumns = [...this.availableColumns];
1834
+ }
1835
+ }
1836
+ DataTableColumnsModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DataTableColumnsModalComponent, deps: [{ token: i1$4.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
1837
+ DataTableColumnsModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: DataTableColumnsModalComponent, selector: "mad-data-table-columns-modal.component", ngImport: i0, template: "<h1 mat-dialog-title>{{ data?.titleLabel | translate }}</h1>\n<div mat-dialog-content>\n <div class=\"column-drag-main-content\">\n <div class=\"column-drag-container\">\n <div class=\"column-drag-info-area\">{{ data?.infoTextLabel | translate }}</div>\n <div class=\"column-drag-container-header\">{{ data?.selectedLabel | translate }}</div>\n <div\n cdkDropList\n #selectedList=\"cdkDropList\"\n [cdkDropListData]=\"selectedColumns\"\n [cdkDropListConnectedTo]=\"[availableList]\"\n class=\"column-drag-list selected-drag-list\"\n (cdkDropListDropped)=\"onDrop($event)\">\n <div class=\"column-drag-box\"\n *ngFor=\"let selectedColumn of selectedColumns; let i = index\"\n cdkDrag\n [id]=\"selectedColumn.id\"\n >\n {{i + 1}}. {{selectedColumn.label | translate }}\n </div>\n </div>\n </div>\n\n <div class=\"column-drag-container\">\n <div class=\"column-drag-info-area\">\n <!-- Table filter -->\n <mat-form-field>\n <mat-label>{{ data?.filterColumnsLabel | translate }}</mat-label>\n <input matInput autocomplete=\"off\" (keyup)=\"updateFilterValue()\"\n placeholder=\"{{ data?.filterColumnsPlaceHolder | translate }}\" [(ngModel)]=\"searchFilter\"/>\n <button *ngIf=\"searchFilter\" matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"clearFilterValue()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </div>\n <div class=\"column-drag-container-header\">{{ data?.availableLabel | translate }}</div>\n <div\n cdkDropList\n cdkDropListSortingDisabled\n #availableList=\"cdkDropList\"\n [cdkDropListData]=\"availableColumns\"\n [cdkDropListConnectedTo]=\"[selectedList]\"\n class=\"column-drag-list\"\n (cdkDropListDropped)=\"onDrop($event)\">\n <div *ngFor=\"let availableColumn of filteredAvailableColumns\" class=\"column-drag-box\" cdkDrag [id]=\"availableColumn.id\">\n {{availableColumn.label}}\n </div>\n </div>\n </div>\n </div>\n\n</div>\n<div mat-dialog-actions [align]=\"'end'\">\n <mad-outline-button (click)=\"onCancel()\">\n {{ data?.cancelLabel | translate }}\n </mad-outline-button>\n <mad-danger-button *ngIf=\"data?.deleteDefinitionAllowed\" (click)=\"onDelete()\">\n {{ data?.deleteLabel | translate }}\n </mad-danger-button>\n <mad-primary-button (click)=\"onSave()\" [disabled]=\"!(this.selectedColumns?.length > 0)\">\n {{ data?.saveLabel | translate }}\n </mad-primary-button>\n</div>\n", styles: [".column-drag-main-content{display:flex;flex-direction:row;width:544px;justify-content:space-between;padding:8px 8px 16px;margin-bottom:16px;border-bottom:1px solid whitesmoke}.column-drag-container{width:256px;max-width:100%;display:inline-block;vertical-align:top;font-size:small}.info-box{width:100%;font-size:small;margin-bottom:16px;color:#000000a8}.column-drag-info-area{width:100%;height:36px;margin-bottom:32px;color:#000000a8;font-size:small;display:flex;justify-content:right;align-items:stretch;flex-direction:column}.column-drag-list{border:solid 1px #ccc;height:200px;box-sizing:border-box;background:white;border-radius:4px;overflow:auto;display:block}.column-drag-container-header{font-weight:700;margin-bottom:4px}.column-drag-box{padding:12px 10px;border-bottom:solid 1px #ccc;color:#000000de;display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;height:40px;cursor:move;background:white;font-size:14px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.column-drag-box:last-child{border:none}.column-drag-list.cdk-drop-list-dragging .column-drag-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: PrimaryButtonComponent, selector: "mad-primary-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: DangerButtonComponent, selector: "mad-danger-button", inputs: ["type", "disabled", "title"] }, { kind: "directive", type: i10.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i10.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i5$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
1838
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DataTableColumnsModalComponent, decorators: [{
1839
+ type: Component,
1840
+ args: [{ selector: 'mad-data-table-columns-modal.component', template: "<h1 mat-dialog-title>{{ data?.titleLabel | translate }}</h1>\n<div mat-dialog-content>\n <div class=\"column-drag-main-content\">\n <div class=\"column-drag-container\">\n <div class=\"column-drag-info-area\">{{ data?.infoTextLabel | translate }}</div>\n <div class=\"column-drag-container-header\">{{ data?.selectedLabel | translate }}</div>\n <div\n cdkDropList\n #selectedList=\"cdkDropList\"\n [cdkDropListData]=\"selectedColumns\"\n [cdkDropListConnectedTo]=\"[availableList]\"\n class=\"column-drag-list selected-drag-list\"\n (cdkDropListDropped)=\"onDrop($event)\">\n <div class=\"column-drag-box\"\n *ngFor=\"let selectedColumn of selectedColumns; let i = index\"\n cdkDrag\n [id]=\"selectedColumn.id\"\n >\n {{i + 1}}. {{selectedColumn.label | translate }}\n </div>\n </div>\n </div>\n\n <div class=\"column-drag-container\">\n <div class=\"column-drag-info-area\">\n <!-- Table filter -->\n <mat-form-field>\n <mat-label>{{ data?.filterColumnsLabel | translate }}</mat-label>\n <input matInput autocomplete=\"off\" (keyup)=\"updateFilterValue()\"\n placeholder=\"{{ data?.filterColumnsPlaceHolder | translate }}\" [(ngModel)]=\"searchFilter\"/>\n <button *ngIf=\"searchFilter\" matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"clearFilterValue()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </div>\n <div class=\"column-drag-container-header\">{{ data?.availableLabel | translate }}</div>\n <div\n cdkDropList\n cdkDropListSortingDisabled\n #availableList=\"cdkDropList\"\n [cdkDropListData]=\"availableColumns\"\n [cdkDropListConnectedTo]=\"[selectedList]\"\n class=\"column-drag-list\"\n (cdkDropListDropped)=\"onDrop($event)\">\n <div *ngFor=\"let availableColumn of filteredAvailableColumns\" class=\"column-drag-box\" cdkDrag [id]=\"availableColumn.id\">\n {{availableColumn.label}}\n </div>\n </div>\n </div>\n </div>\n\n</div>\n<div mat-dialog-actions [align]=\"'end'\">\n <mad-outline-button (click)=\"onCancel()\">\n {{ data?.cancelLabel | translate }}\n </mad-outline-button>\n <mad-danger-button *ngIf=\"data?.deleteDefinitionAllowed\" (click)=\"onDelete()\">\n {{ data?.deleteLabel | translate }}\n </mad-danger-button>\n <mad-primary-button (click)=\"onSave()\" [disabled]=\"!(this.selectedColumns?.length > 0)\">\n {{ data?.saveLabel | translate }}\n </mad-primary-button>\n</div>\n", styles: [".column-drag-main-content{display:flex;flex-direction:row;width:544px;justify-content:space-between;padding:8px 8px 16px;margin-bottom:16px;border-bottom:1px solid whitesmoke}.column-drag-container{width:256px;max-width:100%;display:inline-block;vertical-align:top;font-size:small}.info-box{width:100%;font-size:small;margin-bottom:16px;color:#000000a8}.column-drag-info-area{width:100%;height:36px;margin-bottom:32px;color:#000000a8;font-size:small;display:flex;justify-content:right;align-items:stretch;flex-direction:column}.column-drag-list{border:solid 1px #ccc;height:200px;box-sizing:border-box;background:white;border-radius:4px;overflow:auto;display:block}.column-drag-container-header{font-weight:700;margin-bottom:4px}.column-drag-box{padding:12px 10px;border-bottom:solid 1px #ccc;color:#000000de;display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;height:40px;cursor:move;background:white;font-size:14px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.column-drag-box:last-child{border:none}.column-drag-list.cdk-drop-list-dragging .column-drag-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
1841
+ }], ctorParameters: function () { return [{ type: i1$4.MatDialogRef }, { type: undefined, decorators: [{
1842
+ type: Inject,
1843
+ args: [MAT_DIALOG_DATA]
1844
+ }] }]; } });
1845
+
1846
+ class DataTableActionType {
1847
+ }
1848
+ DataTableActionType.SINGLE = 'SINGLE';
1849
+ DataTableActionType.BATCH = 'BATCH';
1850
+ DataTableActionType.NONE = 'NONE';
1851
+
1852
+ class DataTableComponent {
1853
+ constructor(matDialog) {
1854
+ this.matDialog = matDialog;
1855
+ // Translations
1856
+ this.filterLabel = 'Filter';
1857
+ this.filterPlaceholder = '';
1858
+ this.filterColumnsLabel = 'Filter';
1859
+ this.filterColumnsPlaceHolder = 'Filter available columns';
1860
+ this.noDataText = 'No matching data found';
1861
+ this.columnSettingsModalTitleLabel = 'Column settings';
1862
+ this.selectedLabel = 'Selected columns';
1863
+ this.availableLabel = 'Available columns';
1864
+ this.saveLabel = 'Save';
1865
+ this.deleteLabel = 'Delete';
1866
+ this.cancelLabel = 'Cancel';
1867
+ this.infoTextLabel = 'Drag and drop a column to select or reorder it.';
1868
+ this.pageSizeOptions = [5, 10, 15];
1869
+ this.actions = [];
1870
+ this.deleteDefinitionAllowed = false;
1871
+ this.useAsync = false;
1872
+ this.sortEvent = new EventEmitter();
1873
+ this.actionEvent = new EventEmitter();
1874
+ this.pageEvent = new EventEmitter();
1875
+ this.allColumnsEvent = new EventEmitter();
1876
+ this.columnDefinitionChangeEvent = new EventEmitter();
1877
+ this.viewDefinitionChangeEvent = new EventEmitter();
1878
+ this.ACTION_COLUMN_NAME = '__action__';
1879
+ this.SINGLE = DataTableActionType.SINGLE;
1880
+ this.BATCH = DataTableActionType.BATCH;
1881
+ this.NONE = DataTableActionType.NONE;
1882
+ this.tableActions = [];
1883
+ this.rowActions = [];
1884
+ this.columns = [];
1885
+ this.allSelected = false;
1886
+ this.displayedDataMap = new Map();
1887
+ this.actualDataMap = new Map();
1888
+ this.selectionModel = new SelectionModel(true);
1889
+ this.allColumnDefinitions = [];
1890
+ this.isFilterEnabled = false;
1891
+ this.isPaginationEnabled = false;
1892
+ this.mode = this.NONE;
1893
+ this.isRowClickable = false;
1894
+ this.showColumnModal = false;
1895
+ this.isLoading = false;
1896
+ this.paginatorLength = 0;
1897
+ this.paginatorPageIndex = 0;
1898
+ this.paginatorPageSize = 50;
1899
+ }
1900
+ set displayedColumns(cols) {
1901
+ if (!this.displayedColumnDefinition) {
1902
+ this.columns = cols ? [...cols] : [];
1903
+ this.columnIds = this.columns.map(column => column.id);
1904
+ this.columnIds.unshift(this.ACTION_COLUMN_NAME);
1905
+ }
1906
+ }
1907
+ set displayedColumnDefinition(def) {
1908
+ this.selectedColumnDefinion = def;
1909
+ this.columns = def.displayedColumns;
1910
+ this.columnIds = this.columns.map(column => column.id);
1911
+ this.columnIds.unshift(this.ACTION_COLUMN_NAME);
1912
+ }
1913
+ set tableData(data) {
1914
+ if (!this.dataSource) {
1915
+ this.dataSource = new MatTableDataSource(data);
1916
+ }
1917
+ this.createDataMapsAndSetDisplayedDataSourceData(data);
1918
+ }
1919
+ set page(page) {
1920
+ this.paginatorPageIndex = page.pageIndex;
1921
+ this.paginatorPageSize = page.pageSize;
1922
+ this.paginatorLength = page.length;
1923
+ }
1924
+ set columnDefinitions(definitions) {
1925
+ this.editableColumnDefinitions = [];
1926
+ this.viewableColumnDefinitions = [];
1927
+ this.allColumnDefinitions = [...definitions];
1928
+ for (const definition of definitions) {
1929
+ if (definition.editable) {
1930
+ this.editableColumnDefinitions.push(definition);
1931
+ }
1932
+ if (definition.displayedColumns?.length > 0) {
1933
+ this.viewableColumnDefinitions.push(definition);
1934
+ }
1935
+ }
1936
+ }
1937
+ set loading(isLoading) {
1938
+ this.isLoading = isLoading;
1939
+ }
1940
+ set defaultPageSize(defaultSize) {
1941
+ this.paginatorPageSize = defaultSize;
1942
+ }
1943
+ set externalPaginator(paginator) {
1944
+ this.extPaginator = paginator;
1945
+ }
1946
+ set paginationEnabled(isPaginationEnabled) {
1947
+ this.isPaginationEnabled = isPaginationEnabled;
1948
+ this.unsetPageSizeIfNecessary();
1949
+ }
1950
+ set allColumns(allColumns) {
1951
+ this.allAvailableColumns = allColumns;
1952
+ if (allColumns && this.showColumnModal) {
1953
+ this.openColumnModal();
1954
+ }
1955
+ }
1956
+ set filterEnabled(isFilterEnabled) {
1957
+ this.isFilterEnabled = !this.useAsync ? isFilterEnabled : false;
1958
+ this.setFilterValue(undefined);
1959
+ }
1960
+ set forceMode(mode) {
1961
+ if (mode === this.SINGLE || mode === this.BATCH || mode === this.NONE) {
1962
+ this._forceMode = mode;
1963
+ this.mode = mode;
1964
+ this.setActions();
1965
+ }
1966
+ }
1967
+ static compare(a, b, sort) {
1968
+ const x = a[sort.active];
1969
+ const y = b[sort.active];
1970
+ const ascending = sort.direction === 'asc';
1971
+ switch (typeof x) {
1972
+ case 'number':
1973
+ return DataTableComponent.compareNumber(x, y, ascending);
1974
+ case 'string':
1975
+ return DataTableComponent.compareString(x, y, ascending);
1976
+ case 'boolean':
1977
+ return DataTableComponent.compareBoolean(x, y, ascending);
1978
+ default:
1979
+ // cannot compare -> return equal
1980
+ return 0;
1981
+ }
1982
+ }
1983
+ static compareNumber(x, y, ascending) {
1984
+ return ascending ? x - y : y - x;
1985
+ }
1986
+ static compareString(x, y, ascending) {
1987
+ return ascending ? x.localeCompare(y) : y.localeCompare(x);
1988
+ }
1989
+ static compareBoolean(x, y, ascending) {
1990
+ if (x === y) {
1991
+ return 0;
1992
+ }
1993
+ if (ascending) {
1994
+ // true first
1995
+ return x ? -1 : 1;
1996
+ }
1997
+ else {
1998
+ // false first
1999
+ return x ? 1 : -1;
2000
+ }
2001
+ }
2002
+ static transformData(value, transformer, transformerParams) {
2003
+ if (!transformer || !(transformer instanceof Function)) {
2004
+ return value;
2005
+ }
2006
+ return transformer(value, transformerParams);
2007
+ }
2008
+ static generateRowId() {
2009
+ return v4();
2010
+ }
2011
+ static isClickOnRowMenuIcon(event) {
2012
+ return event?.target?.classList.contains('mat-icon');
2013
+ }
2014
+ ngOnInit() {
2015
+ this.mode = this.getTableMode();
2016
+ this.setActions();
2017
+ if (this.mode !== this.NONE) {
2018
+ this.isRowClickable = true;
2019
+ this.defaultAction = this.rowActions[0];
2020
+ }
2021
+ }
2022
+ ngAfterViewInit() {
2023
+ this.dataSource.paginator = this.paginator;
2024
+ this.dataSource.sort = this.sort;
2025
+ }
2026
+ onColumnSettings(definition) {
2027
+ this.showColumnModal = true;
2028
+ this.selectedDefinition = definition ? definition : this.allColumnDefinitions[0];
2029
+ if (this.allAvailableColumns) {
2030
+ this.openColumnModal();
2031
+ }
2032
+ else {
2033
+ // if no complete definitions have been loaded yet send an event so the app can load it
2034
+ this.allColumnsEvent.emit();
2035
+ }
2036
+ }
2037
+ onViewDefinition(definition) {
2038
+ this.selectedDefinition = definition;
2039
+ this.viewDefinitionChangeEvent.emit(definition);
2040
+ }
2041
+ isCurrentDefinition(definition) {
2042
+ return this.selectedDefinition && this.selectedDefinition.id === definition.id;
2043
+ }
2044
+ get selectedCount() {
2045
+ return this.selectionModel?.selected ? this.selectionModel.selected.length : 0;
2046
+ }
2047
+ get rowCount() {
2048
+ return this.getAllDataSourceRowsOfCurrentPage() ? this.getAllDataSourceRowsOfCurrentPage().length : 0;
2049
+ }
2050
+ getAllDataSourceRowsOfCurrentPage() {
2051
+ return this.dataSource?._pageData(this.dataSource.data);
2052
+ }
2053
+ getSelectedCount(actionType) {
2054
+ const count = this.selectedCount;
2055
+ if (actionType !== this.BATCH || count < 2) {
2056
+ return '';
2057
+ }
2058
+ return ' (' + count + ')';
2059
+ }
2060
+ isDisabled(actionType) {
2061
+ switch (actionType) {
2062
+ case this.SINGLE:
2063
+ return this.selectedCount !== 1;
2064
+ case this.BATCH:
2065
+ return this.selectedCount < 1;
2066
+ default:
2067
+ return false;
2068
+ }
2069
+ }
2070
+ onToggleSelectAll() {
2071
+ // clear all selection first
2072
+ this.selectionModel.clear();
2073
+ // toggle all checkbox
2074
+ this.allSelected = !this.allSelected;
2075
+ if (this.allSelected) {
2076
+ // select all rows of the current page
2077
+ this.getAllDataSourceRowsOfCurrentPage().forEach(row => {
2078
+ this.selectionModel.select('' + row.rowId);
2079
+ });
2080
+ }
2081
+ }
2082
+ isSelected(rowId) {
2083
+ return this.selectionModel.isSelected(rowId);
2084
+ }
2085
+ setFilterValue(value) {
2086
+ this.dataSource.filter = value?.trim().toLowerCase();
2087
+ }
2088
+ onRowCheckbox(event, row) {
2089
+ event.stopPropagation(); // no click event on row
2090
+ this.selectionModel.toggle(row.rowId);
2091
+ }
2092
+ onRowEvent(event, row, action = this.defaultAction) {
2093
+ switch (this.mode) {
2094
+ case this.BATCH:
2095
+ this.onRowCheckbox(event, row);
2096
+ break;
2097
+ case this.SINGLE:
2098
+ // emit the default action if the row (not the icon!) was clicked
2099
+ if (!!action && !DataTableComponent.isClickOnRowMenuIcon(event)) {
2100
+ const selected = [];
2101
+ // if ID-generator is provided, return the ID, else return the ACTUAL data
2102
+ selected.push(this.idGenerator ? row.rowId : this.actualDataMap.get(row.rowId));
2103
+ this.emitTableAction(action, selected);
2104
+ }
2105
+ break;
2106
+ default:
2107
+ // do nothing if mode is NONE (or null)
2108
+ return;
2109
+ }
2110
+ }
2111
+ onSortingEvent(sort) {
2112
+ if (this.useAsync) {
2113
+ this.sortEvent.emit(sort);
2114
+ }
2115
+ else {
2116
+ this.internalSort(sort);
2117
+ }
2118
+ }
2119
+ onPageEvent(event) {
2120
+ if (this.useAsync) {
2121
+ this.pageEvent.emit(event);
2122
+ }
2123
+ }
2124
+ onTableAction(tableAction) {
2125
+ if (!!tableAction) {
2126
+ const selection = [];
2127
+ for (const selected of this.selectionModel.selected) {
2128
+ selection.push(this.idGenerator ? selected : this.actualDataMap.get(selected));
2129
+ }
2130
+ tableAction.selected = selection;
2131
+ this.actionEvent.emit(tableAction);
2132
+ }
2133
+ }
2134
+ emitTableAction(action, selected) {
2135
+ const emitAction = { ...action };
2136
+ if (action.type !== this.NONE) {
2137
+ emitAction.selected = [...selected];
2138
+ }
2139
+ this.actionEvent.emit(emitAction);
2140
+ }
2141
+ generateDisplayedDataElement(rowId, actualDataElement) {
2142
+ const displayedDataElement = {};
2143
+ displayedDataElement.rowId = rowId;
2144
+ for (const column of this.columns) {
2145
+ const actualValue = actualDataElement[column.dataPropertyName];
2146
+ displayedDataElement[column.dataPropertyName] = DataTableComponent.transformData(actualValue, column.transformer, column.transformerParams);
2147
+ }
2148
+ return displayedDataElement;
2149
+ }
2150
+ internalSort(sort) {
2151
+ const sortedData = [...this.dataSource.data].sort((a, b) => DataTableComponent.compare(a, b, sort));
2152
+ this.dataSource.data = [...sortedData];
2153
+ }
2154
+ setActions() {
2155
+ this.rowActions = [];
2156
+ this.tableActions = [];
2157
+ for (const action of this.actions) {
2158
+ if (this.mode !== action.hiddenInMode) {
2159
+ switch (action.type) {
2160
+ case this.SINGLE:
2161
+ if (this.mode === this.SINGLE) {
2162
+ this.rowActions.push(action);
2163
+ }
2164
+ else {
2165
+ this.tableActions.push(action);
2166
+ }
2167
+ break;
2168
+ case this.BATCH:
2169
+ if (this.mode !== this.SINGLE) {
2170
+ this.tableActions.push(action);
2171
+ }
2172
+ break;
2173
+ default:
2174
+ this.tableActions.push(action);
2175
+ }
2176
+ }
2177
+ }
2178
+ }
2179
+ createDataMapsAndSetDisplayedDataSourceData(data) {
2180
+ const displayedDataList = [];
2181
+ this.actualDataMap.clear();
2182
+ this.displayedDataMap.clear();
2183
+ if (data?.length > 0) {
2184
+ for (const dataEntry of data) {
2185
+ const rowId = this.idGenerator ? this.idGenerator(dataEntry) : DataTableComponent.generateRowId();
2186
+ this.actualDataMap.set(rowId, dataEntry);
2187
+ const displayedDataElement = this.generateDisplayedDataElement(rowId, dataEntry);
2188
+ this.displayedDataMap.set(rowId, displayedDataElement);
2189
+ displayedDataList.push(displayedDataElement);
2190
+ }
2191
+ }
2192
+ this.dataSource.data = displayedDataList;
2193
+ this.unsetPageSizeIfNecessary();
2194
+ }
2195
+ openColumnModal() {
2196
+ const dialogData = {
2197
+ allColumns: this.allAvailableColumns,
2198
+ definition: this.selectedDefinition,
2199
+ deleteDefinitionAllowed: this.deleteDefinitionAllowed,
2200
+ filterColumnsLabel: this.filterColumnsLabel,
2201
+ filterColumnsPlaceHolder: this.filterColumnsPlaceHolder,
2202
+ noDataText: this.noDataText,
2203
+ titleLabel: this.columnSettingsModalTitleLabel,
2204
+ selectedLabel: this.selectedLabel,
2205
+ availableLabel: this.availableLabel,
2206
+ saveLabel: this.saveLabel,
2207
+ deleteLabel: this.deleteLabel,
2208
+ cancelLabel: this.cancelLabel,
2209
+ infoTextLabel: this.infoTextLabel,
2210
+ };
2211
+ const dialog = this.matDialog.open(DataTableColumnsModalComponent, { data: dialogData });
2212
+ dialog.afterClosed().subscribe(result => {
2213
+ // no event on CANCEL
2214
+ if (result) {
2215
+ this.columnDefinitionChangeEvent.emit(result);
2216
+ }
2217
+ });
2218
+ }
2219
+ getTableMode() {
2220
+ if (this._forceMode) {
2221
+ return this._forceMode;
2222
+ }
2223
+ if (!this.actions) {
2224
+ return this.NONE;
2225
+ }
2226
+ const distinctActionTypes = new Set();
2227
+ for (const rowAction of this.actions) {
2228
+ distinctActionTypes.add(rowAction.type);
2229
+ }
2230
+ if (distinctActionTypes.has(this.BATCH)) {
2231
+ return this.BATCH;
2232
+ }
2233
+ if (distinctActionTypes.has(this.SINGLE)) {
2234
+ return this.SINGLE;
2235
+ }
2236
+ return this.NONE;
2237
+ }
2238
+ unsetPageSizeIfNecessary() {
2239
+ if (!this.useAsync && !this.isPaginationEnabled) {
2240
+ const dataCount = this.dataSource.data ? this.dataSource.data.length : 0;
2241
+ this.paginatorPageSize = dataCount;
2242
+ this.paginatorLength = dataCount;
2243
+ }
2244
+ }
2245
+ }
2246
+ DataTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DataTableComponent, deps: [{ token: i1$4.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
2247
+ DataTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: DataTableComponent, selector: "mad-data-table", inputs: { filterLabel: "filterLabel", filterPlaceholder: "filterPlaceholder", filterColumnsLabel: "filterColumnsLabel", filterColumnsPlaceHolder: "filterColumnsPlaceHolder", noDataText: "noDataText", columnSettingsModalTitleLabel: "columnSettingsModalTitleLabel", selectedLabel: "selectedLabel", availableLabel: "availableLabel", saveLabel: "saveLabel", deleteLabel: "deleteLabel", cancelLabel: "cancelLabel", infoTextLabel: "infoTextLabel", tableClass: "tableClass", pageSizeOptions: "pageSizeOptions", externalFilter: "externalFilter", actions: "actions", idGenerator: "idGenerator", deleteDefinitionAllowed: "deleteDefinitionAllowed", useAsync: "useAsync", displayedColumns: "displayedColumns", displayedColumnDefinition: "displayedColumnDefinition", tableData: "tableData", page: "page", columnDefinitions: "columnDefinitions", loading: "loading", defaultPageSize: "defaultPageSize", externalPaginator: "externalPaginator", paginationEnabled: "paginationEnabled", allColumns: "allColumns", filterEnabled: "filterEnabled", forceMode: "forceMode" }, outputs: { sortEvent: "sortEvent", actionEvent: "actionEvent", pageEvent: "pageEvent", allColumnsEvent: "allColumnsEvent", columnDefinitionChangeEvent: "columnDefinitionChangeEvent", viewDefinitionChangeEvent: "viewDefinitionChangeEvent" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }], ngImport: i0, template: "<div class=\"mad-datatable-action-bar\">\n <!-- Table actions: displayed before the table -->\n <div *ngIf=\"tableActions?.length\">\n <mad-outline-button\n [disabled]=\"isDisabled(tableAction.type)\"\n class=\"table-action\"\n *ngFor=\"let tableAction of tableActions\"\n (click)=\"onTableAction(tableAction)\">\n {{ tableAction.label | translate }} {{ getSelectedCount(tableAction.type) }}\n </mad-outline-button>\n </div>\n <!-- Table filter -->\n <mat-form-field *ngIf=\"isFilterEnabled\">\n <mat-label>{{ filterLabel | translate }}</mat-label>\n <input matInput autocomplete=\"off\" (keyup)=\"setFilterValue($event?.target?.value)\"\n placeholder=\"{{ filterPlaceholder }}\" />\n </mat-form-field>\n</div>\n\n\n<!-- Row action menu -->\n<mat-menu #rowActionMenu=\"matMenu\">\n <ng-template matMenuContent let-element=\"element\">\n <button *ngFor=\"let rowAction of rowActions\" mat-menu-item class=\"row-action\"\n (click)=\"onRowEvent($event, element, rowAction)\">\n {{ rowAction.label | translate }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- editable definition menu -->\n<mat-menu #editableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n <button *ngFor=\"let definition of editableColumnDefinitions\"\n mat-menu-item\n class=\"row-action\"\n (click)=\"onColumnSettings(definition)\"\n [ngClass]=\"{'active-column-definition': isCurrentDefinition(definition)}\"\n >\n {{ definition.label | translate }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- viewable definition menu -->\n<mat-menu #viewableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n <button *ngFor=\"let definition of viewableColumnDefinitions\"\n mat-menu-item\n class=\"row-action\"\n (click)=\"onViewDefinition(definition)\"\n [ngClass]=\"{'active-column-definition': isCurrentDefinition(definition)}\"\n >\n {{ definition.label | translate }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- Table -->\n<div *ngIf=\"rowCount > 0; else noData\" class=\"datatable\" [class]=\"tableClass\">\n <div class=\"mad-datatable-spinner-wrapper\" *ngIf=\"isLoading\">\n <mat-spinner [diameter]=\"50\" [strokeWidth]=\"3\"></mat-spinner>\n </div>\n\n <table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSortingEvent($event)\">\n <!-- Row actions column-->\n <ng-container [matColumnDef]=\"ACTION_COLUMN_NAME\">\n <th scope=\"col\" mat-header-cell *matHeaderCellDef class=\"row-action-button\">\n <!-- BATCH: master checkbox -->\n <div *ngIf=\"mode === BATCH\" class=\"mad-datatable-checkbox-container\">\n <mat-checkbox\n (change)=\"onToggleSelectAll()\"\n [checked]=\"allSelected\"\n >\n </mat-checkbox>\n </div>\n <!-- SINGLE / NONE: nothing in header row -->\n </th>\n <td mat-cell *matCellDef=\"let element\" class=\"row-action-button\">\n <!-- BATCH: row checkbox -->\n <div *ngIf=\"mode === BATCH\" class=\"mad-datatable-checkbox-container\">\n <mat-checkbox\n (click)=\"onRowCheckbox($event, element.rowId)\"\n [checked]=\"isSelected(element.rowId)\"\n >\n </mat-checkbox>\n </div>\n <!-- SINGLE: row action menu icon -->\n <mad-icon-button\n *ngIf=\"mode === SINGLE\"\n [matMenuTriggerData]=\"{ element: element }\" [matMenuTriggerFor]=\"rowActionMenu\"\n >\n <mat-icon>more_vert</mat-icon>\n </mad-icon-button>\n <!-- NONE: nothing -->\n </td>\n </ng-container>\n <!-- Columns with data -->\n <ng-container *ngFor=\"let column of columns\" [matColumnDef]=\"column.id\">\n <ng-container *ngIf=\"column.isSortable; else noSort\">\n <th\n scope=\"col\"\n mat-header-cell\n *matHeaderCellDef\n mat-sort-header=\"{{ column.orderByName? column.orderByName : column.dataPropertyName }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n [class.text-right]=\"column.isRightAligned\"\n >\n {{ column.label | translate }}\n </th>\n </ng-container>\n <ng-template #noSort>\n <th scope=\"col\" mat-header-cell *matHeaderCellDef [class.text-right]=\"column.isRightAligned\">\n {{ column.label | translate }}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" [class.text-right]=\"column.isRightAligned\" [ngSwitch]=\"column.transformer\">\n <span>\n {{ element[column.dataPropertyName] }}\n </span>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"columnIds\"></tr>\n <tr\n mat-row\n [class.clickable-table-row]=\"isRowClickable\"\n (click)=\"onRowEvent($event, row)\"\n *matRowDef=\"let row; columns: columnIds\"\n ></tr>\n </table>\n</div>\n<div class=\"mad-data-table-bottom-area\">\n <div class=\"mad-data-table-bottom-info-area\">\n <!-- column settings: 1 definition -->\n <mad-icon-button\n *ngIf=\"this.editableColumnDefinitions?.length == 1\"\n (click)=\"onColumnSettings()\"\n >\n <mat-icon class=\"material-icons-outlined\">view_column</mat-icon>\n </mad-icon-button>\n <!-- column settings: multiple definitions -->\n <mad-icon-button\n *ngIf=\"this.editableColumnDefinitions?.length > 0\" [matMenuTriggerFor]=\"editableDefinitionMenu\"\n >\n <mat-icon>view_column</mat-icon>\n </mad-icon-button>\n <!-- column view: multiple definitions -->\n <mad-icon-button\n *ngIf=\"this.viewableColumnDefinitions?.length > 0\" [matMenuTriggerFor]=\"viewableDefinitionMenu\"\n >\n <mat-icon>preview</mat-icon>\n </mad-icon-button>\n </div>\n\n <!-- Pagination -->\n <mat-paginator\n [style.display]=\"isPaginationEnabled ? 'block' : 'none'\"\n [length]=\"paginatorLength\"\n [pageIndex]=\"paginatorPageIndex\"\n [pageSize]=\"paginatorPageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n (page)=\"onPageEvent($event)\"\n showFirstLastButtons\n >\n </mat-paginator>\n</div>\n\n<!-- No data alert -->\n<ng-template #noData>\n <div class=\"noDataText\">\n <div class=\"mad-datatable-spinner-wrapper\" *ngIf=\"isLoading\">\n <mat-spinner [diameter]=\"50\" [strokeWidth]=\"3\"></mat-spinner>\n </div>\n {{ noDataText }}\n </div>\n</ng-template>\n", styles: [":host{display:flex;flex-direction:column;min-height:112px;flex:1 1 auto;background-color:#fff}.datatable-vertical-stretch-to-parent{flex:1;max-height:100%;width:100%;display:flex;flex-direction:column}.datatable-max-height-500{max-height:500px}.datatable-max-height-300{max-height:300px}.datatable-max-height,.datatable-max-height-500,.datatable-max-height-300{flex:1;width:100%;display:flex;flex-direction:column}.datatable{overflow:auto;flex:1 1 auto;height:100%;position:relative;width:100%}.datatable table{max-height:100%;width:100%}.datatable th,.datatable td{overflow:hidden;width:auto;text-overflow:ellipsis;white-space:nowrap}.text-right{text-align:right!important;padding-right:24px!important}.table-action{margin-right:.5em;margin-bottom:.5em}.row-action-button{width:10px}.noDataText{width:100%;text-align:center;position:relative}.mad-datatable-action-bar{display:flex;justify-content:space-between;align-items:baseline}.mad-datatable-checkbox-container{margin-right:16px}.mad-datatable-spinner-wrapper{background-color:#fff;opacity:.8;position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;z-index:99999;pointer-events:unset}.mad-data-table-bottom-area{display:flex;flex-direction:row}.mad-data-table-bottom-area .mad-data-table-bottom-info-area{display:flex;flex:1}.mat-header-row th{position:sticky;top:0;background-color:#fff;z-index:1}.active-column-definition{color:#000;background-color:#f5f5f5}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i6.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "component", type: i6$1.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "directive", type: i7.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i7.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: i8$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i8$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i8$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i8$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i8$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i8$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i8$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i8$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i8$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i8$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i10$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: i13.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
2248
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DataTableComponent, decorators: [{
2249
+ type: Component,
2250
+ args: [{ selector: 'mad-data-table', template: "<div class=\"mad-datatable-action-bar\">\n <!-- Table actions: displayed before the table -->\n <div *ngIf=\"tableActions?.length\">\n <mad-outline-button\n [disabled]=\"isDisabled(tableAction.type)\"\n class=\"table-action\"\n *ngFor=\"let tableAction of tableActions\"\n (click)=\"onTableAction(tableAction)\">\n {{ tableAction.label | translate }} {{ getSelectedCount(tableAction.type) }}\n </mad-outline-button>\n </div>\n <!-- Table filter -->\n <mat-form-field *ngIf=\"isFilterEnabled\">\n <mat-label>{{ filterLabel | translate }}</mat-label>\n <input matInput autocomplete=\"off\" (keyup)=\"setFilterValue($event?.target?.value)\"\n placeholder=\"{{ filterPlaceholder }}\" />\n </mat-form-field>\n</div>\n\n\n<!-- Row action menu -->\n<mat-menu #rowActionMenu=\"matMenu\">\n <ng-template matMenuContent let-element=\"element\">\n <button *ngFor=\"let rowAction of rowActions\" mat-menu-item class=\"row-action\"\n (click)=\"onRowEvent($event, element, rowAction)\">\n {{ rowAction.label | translate }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- editable definition menu -->\n<mat-menu #editableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n <button *ngFor=\"let definition of editableColumnDefinitions\"\n mat-menu-item\n class=\"row-action\"\n (click)=\"onColumnSettings(definition)\"\n [ngClass]=\"{'active-column-definition': isCurrentDefinition(definition)}\"\n >\n {{ definition.label | translate }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- viewable definition menu -->\n<mat-menu #viewableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n <button *ngFor=\"let definition of viewableColumnDefinitions\"\n mat-menu-item\n class=\"row-action\"\n (click)=\"onViewDefinition(definition)\"\n [ngClass]=\"{'active-column-definition': isCurrentDefinition(definition)}\"\n >\n {{ definition.label | translate }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- Table -->\n<div *ngIf=\"rowCount > 0; else noData\" class=\"datatable\" [class]=\"tableClass\">\n <div class=\"mad-datatable-spinner-wrapper\" *ngIf=\"isLoading\">\n <mat-spinner [diameter]=\"50\" [strokeWidth]=\"3\"></mat-spinner>\n </div>\n\n <table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSortingEvent($event)\">\n <!-- Row actions column-->\n <ng-container [matColumnDef]=\"ACTION_COLUMN_NAME\">\n <th scope=\"col\" mat-header-cell *matHeaderCellDef class=\"row-action-button\">\n <!-- BATCH: master checkbox -->\n <div *ngIf=\"mode === BATCH\" class=\"mad-datatable-checkbox-container\">\n <mat-checkbox\n (change)=\"onToggleSelectAll()\"\n [checked]=\"allSelected\"\n >\n </mat-checkbox>\n </div>\n <!-- SINGLE / NONE: nothing in header row -->\n </th>\n <td mat-cell *matCellDef=\"let element\" class=\"row-action-button\">\n <!-- BATCH: row checkbox -->\n <div *ngIf=\"mode === BATCH\" class=\"mad-datatable-checkbox-container\">\n <mat-checkbox\n (click)=\"onRowCheckbox($event, element.rowId)\"\n [checked]=\"isSelected(element.rowId)\"\n >\n </mat-checkbox>\n </div>\n <!-- SINGLE: row action menu icon -->\n <mad-icon-button\n *ngIf=\"mode === SINGLE\"\n [matMenuTriggerData]=\"{ element: element }\" [matMenuTriggerFor]=\"rowActionMenu\"\n >\n <mat-icon>more_vert</mat-icon>\n </mad-icon-button>\n <!-- NONE: nothing -->\n </td>\n </ng-container>\n <!-- Columns with data -->\n <ng-container *ngFor=\"let column of columns\" [matColumnDef]=\"column.id\">\n <ng-container *ngIf=\"column.isSortable; else noSort\">\n <th\n scope=\"col\"\n mat-header-cell\n *matHeaderCellDef\n mat-sort-header=\"{{ column.orderByName? column.orderByName : column.dataPropertyName }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n [class.text-right]=\"column.isRightAligned\"\n >\n {{ column.label | translate }}\n </th>\n </ng-container>\n <ng-template #noSort>\n <th scope=\"col\" mat-header-cell *matHeaderCellDef [class.text-right]=\"column.isRightAligned\">\n {{ column.label | translate }}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" [class.text-right]=\"column.isRightAligned\" [ngSwitch]=\"column.transformer\">\n <span>\n {{ element[column.dataPropertyName] }}\n </span>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"columnIds\"></tr>\n <tr\n mat-row\n [class.clickable-table-row]=\"isRowClickable\"\n (click)=\"onRowEvent($event, row)\"\n *matRowDef=\"let row; columns: columnIds\"\n ></tr>\n </table>\n</div>\n<div class=\"mad-data-table-bottom-area\">\n <div class=\"mad-data-table-bottom-info-area\">\n <!-- column settings: 1 definition -->\n <mad-icon-button\n *ngIf=\"this.editableColumnDefinitions?.length == 1\"\n (click)=\"onColumnSettings()\"\n >\n <mat-icon class=\"material-icons-outlined\">view_column</mat-icon>\n </mad-icon-button>\n <!-- column settings: multiple definitions -->\n <mad-icon-button\n *ngIf=\"this.editableColumnDefinitions?.length > 0\" [matMenuTriggerFor]=\"editableDefinitionMenu\"\n >\n <mat-icon>view_column</mat-icon>\n </mad-icon-button>\n <!-- column view: multiple definitions -->\n <mad-icon-button\n *ngIf=\"this.viewableColumnDefinitions?.length > 0\" [matMenuTriggerFor]=\"viewableDefinitionMenu\"\n >\n <mat-icon>preview</mat-icon>\n </mad-icon-button>\n </div>\n\n <!-- Pagination -->\n <mat-paginator\n [style.display]=\"isPaginationEnabled ? 'block' : 'none'\"\n [length]=\"paginatorLength\"\n [pageIndex]=\"paginatorPageIndex\"\n [pageSize]=\"paginatorPageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n (page)=\"onPageEvent($event)\"\n showFirstLastButtons\n >\n </mat-paginator>\n</div>\n\n<!-- No data alert -->\n<ng-template #noData>\n <div class=\"noDataText\">\n <div class=\"mad-datatable-spinner-wrapper\" *ngIf=\"isLoading\">\n <mat-spinner [diameter]=\"50\" [strokeWidth]=\"3\"></mat-spinner>\n </div>\n {{ noDataText }}\n </div>\n</ng-template>\n", styles: [":host{display:flex;flex-direction:column;min-height:112px;flex:1 1 auto;background-color:#fff}.datatable-vertical-stretch-to-parent{flex:1;max-height:100%;width:100%;display:flex;flex-direction:column}.datatable-max-height-500{max-height:500px}.datatable-max-height-300{max-height:300px}.datatable-max-height,.datatable-max-height-500,.datatable-max-height-300{flex:1;width:100%;display:flex;flex-direction:column}.datatable{overflow:auto;flex:1 1 auto;height:100%;position:relative;width:100%}.datatable table{max-height:100%;width:100%}.datatable th,.datatable td{overflow:hidden;width:auto;text-overflow:ellipsis;white-space:nowrap}.text-right{text-align:right!important;padding-right:24px!important}.table-action{margin-right:.5em;margin-bottom:.5em}.row-action-button{width:10px}.noDataText{width:100%;text-align:center;position:relative}.mad-datatable-action-bar{display:flex;justify-content:space-between;align-items:baseline}.mad-datatable-checkbox-container{margin-right:16px}.mad-datatable-spinner-wrapper{background-color:#fff;opacity:.8;position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;z-index:99999;pointer-events:unset}.mad-data-table-bottom-area{display:flex;flex-direction:row}.mad-data-table-bottom-area .mad-data-table-bottom-info-area{display:flex;flex:1}.mat-header-row th{position:sticky;top:0;background-color:#fff;z-index:1}.active-column-definition{color:#000;background-color:#f5f5f5}\n"] }]
2251
+ }], ctorParameters: function () { return [{ type: i1$4.MatDialog }]; }, propDecorators: { filterLabel: [{
2252
+ type: Input
2253
+ }], filterPlaceholder: [{
2254
+ type: Input
2255
+ }], filterColumnsLabel: [{
2256
+ type: Input
2257
+ }], filterColumnsPlaceHolder: [{
2258
+ type: Input
2259
+ }], noDataText: [{
2260
+ type: Input
2261
+ }], columnSettingsModalTitleLabel: [{
2262
+ type: Input
2263
+ }], selectedLabel: [{
2264
+ type: Input
2265
+ }], availableLabel: [{
2266
+ type: Input
2267
+ }], saveLabel: [{
2268
+ type: Input
2269
+ }], deleteLabel: [{
2270
+ type: Input
2271
+ }], cancelLabel: [{
2272
+ type: Input
2273
+ }], infoTextLabel: [{
2274
+ type: Input
2275
+ }], tableClass: [{
2276
+ type: Input
2277
+ }], pageSizeOptions: [{
2278
+ type: Input
2279
+ }], externalFilter: [{
2280
+ type: Input
2281
+ }], actions: [{
2282
+ type: Input
2283
+ }], idGenerator: [{
2284
+ type: Input
2285
+ }], deleteDefinitionAllowed: [{
2286
+ type: Input
2287
+ }], useAsync: [{
2288
+ type: Input
2289
+ }], displayedColumns: [{
2290
+ type: Input
2291
+ }], displayedColumnDefinition: [{
2292
+ type: Input
2293
+ }], tableData: [{
2294
+ type: Input
2295
+ }], page: [{
2296
+ type: Input
2297
+ }], columnDefinitions: [{
2298
+ type: Input
2299
+ }], loading: [{
2300
+ type: Input
2301
+ }], defaultPageSize: [{
2302
+ type: Input
2303
+ }], externalPaginator: [{
2304
+ type: Input
2305
+ }], paginationEnabled: [{
2306
+ type: Input
2307
+ }], allColumns: [{
2308
+ type: Input
2309
+ }], filterEnabled: [{
2310
+ type: Input
2311
+ }], forceMode: [{
2312
+ type: Input
2313
+ }], sortEvent: [{
2314
+ type: Output
2315
+ }], actionEvent: [{
2316
+ type: Output
2317
+ }], pageEvent: [{
2318
+ type: Output
2319
+ }], allColumnsEvent: [{
2320
+ type: Output
2321
+ }], columnDefinitionChangeEvent: [{
2322
+ type: Output
2323
+ }], viewDefinitionChangeEvent: [{
2324
+ type: Output
2325
+ }], paginator: [{
2326
+ type: ViewChild,
2327
+ args: [MatPaginator, { static: false }]
2328
+ }], sort: [{
2329
+ type: ViewChild,
2330
+ args: [MatSort, { static: true }]
2331
+ }] } });
2332
+
2333
+ class DataTableModule {
2334
+ }
2335
+ DataTableModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DataTableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2336
+ DataTableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: DataTableModule, declarations: [DataTableComponent, DataTableColumnsModalComponent], imports: [CommonModule,
2337
+ MatButtonModule,
2338
+ MatIconModule,
2339
+ MatFormFieldModule,
2340
+ MatInputModule,
2341
+ MatMenuModule,
2342
+ MatPaginatorModule,
2343
+ MatSortModule,
2344
+ MatTableModule,
2345
+ MatProgressSpinnerModule,
2346
+ ButtonModule,
2347
+ TranslateModule,
2348
+ MatCheckboxModule,
2349
+ MatBadgeModule,
2350
+ DragDropModule,
2351
+ FormsModule], exports: [DataTableComponent, DataTableColumnsModalComponent] });
2352
+ DataTableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DataTableModule, imports: [CommonModule,
2353
+ MatButtonModule,
2354
+ MatIconModule,
2355
+ MatFormFieldModule,
2356
+ MatInputModule,
2357
+ MatMenuModule,
2358
+ MatPaginatorModule,
2359
+ MatSortModule,
2360
+ MatTableModule,
2361
+ MatProgressSpinnerModule,
2362
+ ButtonModule,
2363
+ TranslateModule,
2364
+ MatCheckboxModule,
2365
+ MatBadgeModule,
2366
+ DragDropModule,
2367
+ FormsModule] });
2368
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DataTableModule, decorators: [{
2369
+ type: NgModule,
2370
+ args: [{
2371
+ declarations: [DataTableComponent, DataTableColumnsModalComponent],
2372
+ imports: [
2373
+ CommonModule,
2374
+ MatButtonModule,
2375
+ MatIconModule,
2376
+ MatFormFieldModule,
2377
+ MatInputModule,
2378
+ MatMenuModule,
2379
+ MatPaginatorModule,
2380
+ MatSortModule,
2381
+ MatTableModule,
2382
+ MatProgressSpinnerModule,
2383
+ ButtonModule,
2384
+ TranslateModule,
2385
+ MatCheckboxModule,
2386
+ MatBadgeModule,
2387
+ DragDropModule,
2388
+ FormsModule,
2389
+ ],
2390
+ exports: [DataTableComponent, DataTableColumnsModalComponent],
2391
+ }]
2392
+ }] });
2393
+
2394
+ class StepHeaderComponent extends CdkStepHeader {
2395
+ constructor(_focusMonitor, _elementRef) {
2396
+ super(_elementRef);
2397
+ this._focusMonitor = _focusMonitor;
2398
+ }
2399
+ ngAfterViewInit() {
2400
+ this._focusMonitor.monitor(this._elementRef, true);
2401
+ }
2402
+ ngOnDestroy() {
2403
+ this._focusMonitor.stopMonitoring(this._elementRef);
2404
+ }
2405
+ /** Focuses the step header. */
2406
+ focus(origin, options) {
2407
+ if (origin) {
2408
+ this._focusMonitor.focusVia(this._elementRef, origin, options);
2409
+ }
2410
+ else {
2411
+ this._elementRef.nativeElement.focus(options);
2412
+ }
2413
+ }
2414
+ getCssForState() {
2415
+ if (this.state === STEP_STATE.NUMBER && !this.completed && !this.hasError) {
2416
+ return 'step-state-neutral'; //initiale state is 'number'
2417
+ }
2418
+ else if (this.completed) {
2419
+ return 'step-state-complete';
2420
+ }
2421
+ else if (this.hasError) {
2422
+ return 'step-state-error';
2423
+ }
2424
+ }
2425
+ getIcon() {
2426
+ if (this.completed) {
2427
+ return 'check_circle_outline';
2428
+ }
2429
+ else if (this.hasError) {
2430
+ return 'error_outline';
2431
+ }
2432
+ return '';
2433
+ }
2434
+ }
2435
+ StepHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: StepHeaderComponent, deps: [{ token: i1$5.FocusMonitor }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
2436
+ StepHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: StepHeaderComponent, selector: "mad-step-header", inputs: { color: "color", index: "index", label: "label", state: "state", errorMessage: "errorMessage", selected: "selected", active: "active", optional: "optional", hasError: "hasError", completed: "completed", closed: "closed" }, host: { attributes: { "role": "tab" }, classAttribute: "mad-step-header" }, usesInheritance: true, ngImport: i0, template: "<div\n class=\"header\"\n fxLayout=\"row\"\n fxLayoutGap=\"1em\"\n [style.background]=\"this.selected && !this.closed ? '#d8e2e9' : '#ffffff'\"\n [ngClass]=\"this.hasError ? 'error-border' : 'check-border'\"\n>\n <div [ngClass]=\"this.getCssForState()\"></div>\n <div class=\"header-label\">\n <mat-icon class=\"material-icons-outlined\">\n {{ this.selected && !this.closed ? 'keyboard_arrow_down' : 'keyboard_arrow_right' }}\n </mat-icon>\n </div>\n <div *ngIf=\"this.completed || this.hasError\" class=\"header-label\">\n <mat-icon [ngClass]=\"this.completed ? 'green-check' : 'red-error'\">\n {{ getIcon() }}\n </mat-icon>\n </div>\n <span *ngIf=\"!this.hasError && !this.completed\" class=\"header-label\">{{ this.index + 1 + '.' }}</span>\n <div class=\"header-label\">{{ this.label }}</div>\n</div>\n", styles: [".header{overflow:hidden;outline:var(--warn-color);cursor:pointer;box-sizing:content-box;-webkit-tap-highlight-color:transparent;border:1px solid lightgrey;width:100%;height:62px}.header-label{align-items:center;display:flex}.step-state-complete{width:5px;background:green}.step-state-error{width:5px;background:var(--warn-color)}.step-state-neutral{width:5px;background:lightgrey}.green-check{color:green}.red-error{color:var(--warn-color)}.check-border{border-color:#d3d3d3}.error-border{border-color:var(--warn-color)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i4$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4$1.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2437
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: StepHeaderComponent, decorators: [{
2438
+ type: Component,
2439
+ args: [{ selector: 'mad-step-header', inputs: ['color'], host: {
2440
+ class: 'mad-step-header',
2441
+ role: 'tab',
2442
+ }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"header\"\n fxLayout=\"row\"\n fxLayoutGap=\"1em\"\n [style.background]=\"this.selected && !this.closed ? '#d8e2e9' : '#ffffff'\"\n [ngClass]=\"this.hasError ? 'error-border' : 'check-border'\"\n>\n <div [ngClass]=\"this.getCssForState()\"></div>\n <div class=\"header-label\">\n <mat-icon class=\"material-icons-outlined\">\n {{ this.selected && !this.closed ? 'keyboard_arrow_down' : 'keyboard_arrow_right' }}\n </mat-icon>\n </div>\n <div *ngIf=\"this.completed || this.hasError\" class=\"header-label\">\n <mat-icon [ngClass]=\"this.completed ? 'green-check' : 'red-error'\">\n {{ getIcon() }}\n </mat-icon>\n </div>\n <span *ngIf=\"!this.hasError && !this.completed\" class=\"header-label\">{{ this.index + 1 + '.' }}</span>\n <div class=\"header-label\">{{ this.label }}</div>\n</div>\n", styles: [".header{overflow:hidden;outline:var(--warn-color);cursor:pointer;box-sizing:content-box;-webkit-tap-highlight-color:transparent;border:1px solid lightgrey;width:100%;height:62px}.header-label{align-items:center;display:flex}.step-state-complete{width:5px;background:green}.step-state-error{width:5px;background:var(--warn-color)}.step-state-neutral{width:5px;background:lightgrey}.green-check{color:green}.red-error{color:var(--warn-color)}.check-border{border-color:#d3d3d3}.error-border{border-color:var(--warn-color)}\n"] }]
2443
+ }], ctorParameters: function () { return [{ type: i1$5.FocusMonitor }, { type: i0.ElementRef }]; }, propDecorators: { index: [{
2444
+ type: Input
2445
+ }], label: [{
2446
+ type: Input
2447
+ }], state: [{
2448
+ type: Input
2449
+ }], errorMessage: [{
2450
+ type: Input
2451
+ }], selected: [{
2452
+ type: Input
2453
+ }], active: [{
2454
+ type: Input
2455
+ }], optional: [{
2456
+ type: Input
2457
+ }], hasError: [{
2458
+ type: Input
2459
+ }], completed: [{
2460
+ type: Input
2461
+ }], closed: [{
2462
+ type: Input
2463
+ }] } });
2464
+
2465
+ /**
2466
+ * Animations used by the MAD stepper.
2467
+ */
2468
+ const madStepperAnimations = {
2469
+ verticalStepTransition: trigger('stepTransition', [
2470
+ state('previous', style({ height: '0px', visibility: 'hidden' })),
2471
+ state('next', style({ height: '0px', visibility: 'hidden' })),
2472
+ state('current', style({ height: '*', visibility: 'visible' })),
2473
+ transition('* <=> current', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
2474
+ ]),
2475
+ };
2476
+
2477
+ class StepComponent extends CdkStep {
2478
+ constructor(stepper, _viewContainerRef) {
2479
+ super(stepper);
2480
+ this.stepper = stepper;
2481
+ this._viewContainerRef = _viewContainerRef;
2482
+ /** Action event for the next button. If not set the StepComponent will handle the step navigation */
2483
+ this.onNext = new EventEmitter();
2484
+ /** Action event for the done button. If not set the StepComponent will handle the step navigation */
2485
+ this.onDone = new EventEmitter();
2486
+ /*** Action event when the header is clicked. If not set the StepComponent will handle the step navigation*/
2487
+ this.onHeaderClick = new EventEmitter();
2488
+ this.stepClosed = false;
2489
+ this._isSelected = Subscription.EMPTY;
2490
+ }
2491
+ ngAfterContentInit() {
2492
+ this._isSelected = this._stepper.steps.changes
2493
+ .pipe(switchMap(() => this._stepper.selectionChange.pipe(map(event => event.selectedStep === this), tap(() => (this.stepClosed = false)), startWith(this._stepper.selected === this))))
2494
+ .subscribe();
2495
+ }
2496
+ ngOnDestroy() {
2497
+ this._isSelected.unsubscribe();
2498
+ }
2499
+ next(markFormAsTouched = true) {
2500
+ this.stepValidation(markFormAsTouched);
2501
+ if (this.onNext.observers.length <= 0) {
2502
+ this.stepper.next();
2503
+ }
2504
+ this.onNext.emit();
2505
+ }
2506
+ selectAndMarkAsTouched(index) {
2507
+ //Mark current selected step as touched before selecting to display errors in the from
2508
+ this._stepper.selected?.stepControl?.markAllAsTouched();
2509
+ this.stepClosed = false;
2510
+ if (this.onHeaderClick.observers.length <= 0) {
2511
+ this.select();
2512
+ }
2513
+ this.onHeaderClick.emit(index);
2514
+ }
2515
+ completeLast() {
2516
+ this.stepValidation(true);
2517
+ this.stepClosed = true;
2518
+ if (this.onDone.observers.length <= 0) {
2519
+ this.stepper.next();
2520
+ }
2521
+ this.onDone.emit();
2522
+ }
2523
+ resetValidations() {
2524
+ this.hasError = false;
2525
+ this.completed = true;
2526
+ this.state = STEP_STATE.DONE;
2527
+ }
2528
+ stepValidation(markFormAsTouched) {
2529
+ if (markFormAsTouched) {
2530
+ this.stepControl?.markAllAsTouched();
2531
+ }
2532
+ if (this.stepControl?.valid) {
2533
+ this.hasError = false;
2534
+ this.completed = true;
2535
+ this.state = STEP_STATE.DONE;
2536
+ }
2537
+ else {
2538
+ this.completed = false;
2539
+ this.hasError = true;
2540
+ this.state = STEP_STATE.ERROR;
2541
+ }
2542
+ }
2543
+ }
2544
+ StepComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: StepComponent, deps: [{ token: forwardRef(() => StepperComponent) }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
2545
+ StepComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: StepComponent, selector: "mad-step", outputs: { onNext: "onNext", onDone: "onDone", onHeaderClick: "onHeaderClick" }, providers: [{ provide: CdkStep, useExisting: StepComponent }], usesInheritance: true, ngImport: i0, template: "<ng-template let-last=\"last\" let-nextBtnLbl=\"nextBtnLbl\" let-doneBtnLbl=\"doneBtnLbl\">\n <div class=\"step-container\" fxLayout=\"column\">\n <div class=\"step-content\">\n <ng-content></ng-content>\n </div>\n <div class=\"step-buttons\">\n <div *ngIf=\"!last\">\n <button mat-stroked-button color=\"primary\" (click)=\"next()\">{{nextBtnLbl}}</button>\n </div>\n <div *ngIf=\"last\">\n <button mat-stroked-button color=\"primary\" (click)=\"completeLast()\">{{doneBtnLbl}}</button>\n </div>\n </div>\n </div>\n</ng-template>\n", styles: [".stepper-vertical{display:block}.mat-vertical-stepper-header{display:flex;align-items:center;border:none!important;height:10px}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}.vertical-content-container{border:none}[dir=rtl] .vertical-content-container{margin-left:0;margin-right:36px}.vertical-stepper-content{overflow:hidden;outline:0}.vertical-content{padding:0 24px}.step-container{border-left:1px solid lightgrey;border-right:1px solid lightgrey;border-bottom:1px solid lightgrey}.step-content,.step-buttons{padding:2em}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2546
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: StepComponent, decorators: [{
2547
+ type: Component,
2548
+ args: [{ selector: 'mad-step', providers: [{ provide: CdkStep, useExisting: StepComponent }], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template let-last=\"last\" let-nextBtnLbl=\"nextBtnLbl\" let-doneBtnLbl=\"doneBtnLbl\">\n <div class=\"step-container\" fxLayout=\"column\">\n <div class=\"step-content\">\n <ng-content></ng-content>\n </div>\n <div class=\"step-buttons\">\n <div *ngIf=\"!last\">\n <button mat-stroked-button color=\"primary\" (click)=\"next()\">{{nextBtnLbl}}</button>\n </div>\n <div *ngIf=\"last\">\n <button mat-stroked-button color=\"primary\" (click)=\"completeLast()\">{{doneBtnLbl}}</button>\n </div>\n </div>\n </div>\n</ng-template>\n", styles: [".stepper-vertical{display:block}.mat-vertical-stepper-header{display:flex;align-items:center;border:none!important;height:10px}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}.vertical-content-container{border:none}[dir=rtl] .vertical-content-container{margin-left:0;margin-right:36px}.vertical-stepper-content{overflow:hidden;outline:0}.vertical-content{padding:0 24px}.step-container{border-left:1px solid lightgrey;border-right:1px solid lightgrey;border-bottom:1px solid lightgrey}.step-content,.step-buttons{padding:2em}\n"] }]
2549
+ }], ctorParameters: function () { return [{ type: StepperComponent, decorators: [{
2550
+ type: Inject,
2551
+ args: [forwardRef(() => StepperComponent)]
2552
+ }] }, { type: i0.ViewContainerRef }]; }, propDecorators: { onNext: [{
2553
+ type: Output
2554
+ }], onDone: [{
2555
+ type: Output
2556
+ }], onHeaderClick: [{
2557
+ type: Output
2558
+ }] } });
2559
+ class StepperComponent extends CdkStepper {
2560
+ constructor(dir, changeDetectorRef, elementRef) {
2561
+ super(dir, changeDetectorRef, elementRef);
2562
+ /** Event emitted when the current step is done transitioning in. */
2563
+ this.animationDone = new EventEmitter();
2564
+ /** Steps that belong to the current stepper, excluding ones from nested steppers. */
2565
+ this.steps = new QueryList();
2566
+ this._animationDone = new Subject();
2567
+ this.orientation = 'vertical';
2568
+ }
2569
+ ngOnInit() {
2570
+ // Only linear stepper implementation is supported
2571
+ super.linear = true;
2572
+ }
2573
+ ngAfterContentInit() {
2574
+ super.ngAfterContentInit();
2575
+ this.steps.changes.pipe(takeUntil(this._destroyed)).subscribe(() => {
2576
+ this._stateChanged();
2577
+ });
2578
+ this._animationDone
2579
+ .pipe(distinctUntilChanged((x, y) => x.fromState === y.fromState && x.toState === y.toState), takeUntil(this._destroyed))
2580
+ .subscribe(event => {
2581
+ if (event.toState === 'current') {
2582
+ this.animationDone.emit();
2583
+ }
2584
+ });
2585
+ }
2586
+ /**
2587
+ * Method patched to enable the closing of the last step.
2588
+ */
2589
+ _getAnimationDirection(index) {
2590
+ const closeLastStep = this.selectedIndex === this.steps.length - 1 && this._steps.last?.completed && this._steps.last?.stepClosed;
2591
+ if (closeLastStep) {
2592
+ return 'next';
2593
+ }
2594
+ return super._getAnimationDirection(index);
2595
+ }
2596
+ _stepIsNavigable(index, step) {
2597
+ return step.completed || this.selectedIndex === index || !this.linear;
2598
+ }
2599
+ }
2600
+ StepperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: StepperComponent, deps: [{ token: i4$2.Directionality, optional: true }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
2601
+ StepperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: StepperComponent, selector: "mad-stepper", inputs: { nextButtonLabel: "nextButtonLabel", doneButtonLabel: "doneButtonLabel" }, outputs: { animationDone: "animationDone" }, host: { attributes: { "role": "tablist" }, properties: { "class.stepper-vertical": "true", "attr.aria-orientation": "\"vertical\"" } }, providers: [{ provide: CdkStepper, useExisting: StepperComponent }], queries: [{ propertyName: "_steps", predicate: StepComponent, descendants: true }], viewQueries: [{ propertyName: "_stepHeader", predicate: StepHeaderComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<!-- Vertical stepper -->\n<ng-container>\n <div *ngFor=\"let step of steps; let i = index; let isLast = last; let isFirst = first\">\n <ng-container\n [ngTemplateOutlet]=\"stepTemplate\"\n [ngTemplateOutletContext]=\"{step: step, i: i}\"></ng-container>\n <div class=\"vertical-content-container\" [class.mat-stepper-vertical-line]=\"!isLast\">\n <div class=\"vertical-stepper-content\" role=\"tabpanel\"\n [@stepTransition]=\"_getAnimationDirection(i)\"\n (@stepTransition.done)=\"_animationDone.next($event)\"\n [id]=\"_getStepContentId(i)\"\n [attr.aria-labelledby]=\"_getStepLabelId(i)\"\n [attr.aria-expanded]=\"selectedIndex === i\">\n <div class=\"vertical-content\">\n <ng-container [ngTemplateOutlet]=\"step.content\"\n [ngTemplateOutletContext]=\"{step: step, i: i, last: isLast, first: isFirst, nextBtnLbl: this.nextButtonLabel, doneBtnLbl: this.doneButtonLabel}\"></ng-container>\n </div>\n </div>\n </div>\n </div>\n</ng-container>\n\n<ng-template let-step=\"step\" let-i=\"i\" #stepTemplate>\n <mad-step-header\n class=\"mat-vertical-stepper-header\"\n (click)=\"step.selectAndMarkAsTouched(i)\"\n (keydown)=\"_onKeydown($event)\"\n [tabIndex]=\"_getFocusIndex() === i ? 0 : -1\"\n [id]=\"_getStepLabelId(i)\"\n [attr.aria-posinset]=\"i + 1\"\n [attr.aria-setsize]=\"steps.length\"\n [attr.aria-controls]=\"_getStepContentId(i)\"\n [attr.aria-selected]=\"selectedIndex == i\"\n [attr.aria-label]=\"step.ariaLabel || null\"\n [attr.aria-labelledby]=\"(!step.ariaLabel && step.ariaLabelledby) ? step.ariaLabelledby : null\"\n [attr.aria-disabled]=\"_stepIsNavigable(i, step) ? null : true\"\n [index]=\"i\"\n [completed]=\"step.completed\"\n [hasError]=\"step.hasError\"\n [state]=\"_getIndicatorType(i, step.state)\"\n [label]=\"step.stepLabel || step.label\"\n [selected]=\"selectedIndex === i\"\n [active]=\"_stepIsNavigable(i, step)\"\n [optional]=\"step.optional\"\n [closed]=\"step.stepClosed\"\n [errorMessage]=\"step.errorMessage\"></mad-step-header>\n</ng-template>\n", styles: [".stepper-vertical{display:block}.mat-vertical-stepper-header{display:flex;align-items:center;border:none!important;height:10px}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}.vertical-content-container{border:none}[dir=rtl] .vertical-content-container{margin-left:0;margin-right:36px}.vertical-stepper-content{overflow:hidden;outline:0}.vertical-content{padding:0 24px}.step-container{border-left:1px solid lightgrey;border-right:1px solid lightgrey;border-bottom:1px solid lightgrey}.step-content,.step-buttons{padding:2em}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: StepHeaderComponent, selector: "mad-step-header", inputs: ["color", "index", "label", "state", "errorMessage", "selected", "active", "optional", "hasError", "completed", "closed"] }], animations: [madStepperAnimations.verticalStepTransition], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2602
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: StepperComponent, decorators: [{
2603
+ type: Component,
2604
+ args: [{ selector: 'mad-stepper', host: {
2605
+ '[class.stepper-vertical]': 'true',
2606
+ '[attr.aria-orientation]': '"vertical"',
2607
+ role: 'tablist',
2608
+ }, animations: [madStepperAnimations.verticalStepTransition], providers: [{ provide: CdkStepper, useExisting: StepperComponent }], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- Vertical stepper -->\n<ng-container>\n <div *ngFor=\"let step of steps; let i = index; let isLast = last; let isFirst = first\">\n <ng-container\n [ngTemplateOutlet]=\"stepTemplate\"\n [ngTemplateOutletContext]=\"{step: step, i: i}\"></ng-container>\n <div class=\"vertical-content-container\" [class.mat-stepper-vertical-line]=\"!isLast\">\n <div class=\"vertical-stepper-content\" role=\"tabpanel\"\n [@stepTransition]=\"_getAnimationDirection(i)\"\n (@stepTransition.done)=\"_animationDone.next($event)\"\n [id]=\"_getStepContentId(i)\"\n [attr.aria-labelledby]=\"_getStepLabelId(i)\"\n [attr.aria-expanded]=\"selectedIndex === i\">\n <div class=\"vertical-content\">\n <ng-container [ngTemplateOutlet]=\"step.content\"\n [ngTemplateOutletContext]=\"{step: step, i: i, last: isLast, first: isFirst, nextBtnLbl: this.nextButtonLabel, doneBtnLbl: this.doneButtonLabel}\"></ng-container>\n </div>\n </div>\n </div>\n </div>\n</ng-container>\n\n<ng-template let-step=\"step\" let-i=\"i\" #stepTemplate>\n <mad-step-header\n class=\"mat-vertical-stepper-header\"\n (click)=\"step.selectAndMarkAsTouched(i)\"\n (keydown)=\"_onKeydown($event)\"\n [tabIndex]=\"_getFocusIndex() === i ? 0 : -1\"\n [id]=\"_getStepLabelId(i)\"\n [attr.aria-posinset]=\"i + 1\"\n [attr.aria-setsize]=\"steps.length\"\n [attr.aria-controls]=\"_getStepContentId(i)\"\n [attr.aria-selected]=\"selectedIndex == i\"\n [attr.aria-label]=\"step.ariaLabel || null\"\n [attr.aria-labelledby]=\"(!step.ariaLabel && step.ariaLabelledby) ? step.ariaLabelledby : null\"\n [attr.aria-disabled]=\"_stepIsNavigable(i, step) ? null : true\"\n [index]=\"i\"\n [completed]=\"step.completed\"\n [hasError]=\"step.hasError\"\n [state]=\"_getIndicatorType(i, step.state)\"\n [label]=\"step.stepLabel || step.label\"\n [selected]=\"selectedIndex === i\"\n [active]=\"_stepIsNavigable(i, step)\"\n [optional]=\"step.optional\"\n [closed]=\"step.stepClosed\"\n [errorMessage]=\"step.errorMessage\"></mad-step-header>\n</ng-template>\n", styles: [".stepper-vertical{display:block}.mat-vertical-stepper-header{display:flex;align-items:center;border:none!important;height:10px}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}.vertical-content-container{border:none}[dir=rtl] .vertical-content-container{margin-left:0;margin-right:36px}.vertical-stepper-content{overflow:hidden;outline:0}.vertical-content{padding:0 24px}.step-container{border-left:1px solid lightgrey;border-right:1px solid lightgrey;border-bottom:1px solid lightgrey}.step-content,.step-buttons{padding:2em}\n"] }]
2609
+ }], ctorParameters: function () { return [{ type: i4$2.Directionality, decorators: [{
2610
+ type: Optional
2611
+ }] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { animationDone: [{
2612
+ type: Output
2613
+ }], nextButtonLabel: [{
2614
+ type: Input
2615
+ }], doneButtonLabel: [{
2616
+ type: Input
2617
+ }], _stepHeader: [{
2618
+ type: ViewChildren,
2619
+ args: [StepHeaderComponent]
2620
+ }], _steps: [{
2621
+ type: ContentChildren,
2622
+ args: [StepComponent, { descendants: true }]
2623
+ }] } });
2624
+
2625
+ class StepperModule {
2626
+ }
2627
+ StepperModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: StepperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2628
+ StepperModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: StepperModule, declarations: [StepperComponent, StepHeaderComponent, StepComponent], imports: [CommonModule, MatButtonModule, MatIconModule, CdkStepperModule, FlexModule], exports: [StepperComponent, StepHeaderComponent, StepComponent] });
2629
+ StepperModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: StepperModule, imports: [CommonModule, MatButtonModule, MatIconModule, CdkStepperModule, FlexModule] });
2630
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: StepperModule, decorators: [{
2631
+ type: NgModule,
2632
+ args: [{
2633
+ declarations: [StepperComponent, StepHeaderComponent, StepComponent],
2634
+ imports: [CommonModule, MatButtonModule, MatIconModule, CdkStepperModule, FlexModule],
2635
+ exports: [StepperComponent, StepHeaderComponent, StepComponent],
2636
+ }]
2637
+ }] });
2638
+
2639
+ class ContentHeaderComponent {
2640
+ }
2641
+ ContentHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2642
+ ContentHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: ContentHeaderComponent, selector: "mad-content-header", ngImport: i0, template: "<div class=\"content-header\">\n <ng-content></ng-content>\n</div>\n", styles: [".content-header{padding-right:.5rem}\n"] });
2643
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentHeaderComponent, decorators: [{
2644
+ type: Component,
2645
+ args: [{ selector: 'mad-content-header', template: "<div class=\"content-header\">\n <ng-content></ng-content>\n</div>\n", styles: [".content-header{padding-right:.5rem}\n"] }]
2646
+ }] });
2647
+
2648
+ class ContentPanelContainerComponent {
2649
+ }
2650
+ ContentPanelContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2651
+ ContentPanelContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: ContentPanelContainerComponent, selector: "mad-content-panel-container", ngImport: i0, template: "<div class=\"content-panel-outer-wrapper\">\n <ng-content select=\"mad-content-panel-container-content\"></ng-content>\n <ng-content select=\"mad-content-panel-container-footer\"></ng-content>\n</div>\n", styles: [":host{position:relative;overflow:hidden;display:flex;flex:1 1 auto;min-height:.05rem}.content-panel-outer-wrapper{display:flex;flex:1 1 auto;flex-direction:column}\n"] });
2652
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelContainerComponent, decorators: [{
2653
+ type: Component,
2654
+ args: [{ selector: 'mad-content-panel-container', template: "<div class=\"content-panel-outer-wrapper\">\n <ng-content select=\"mad-content-panel-container-content\"></ng-content>\n <ng-content select=\"mad-content-panel-container-footer\"></ng-content>\n</div>\n", styles: [":host{position:relative;overflow:hidden;display:flex;flex:1 1 auto;min-height:.05rem}.content-panel-outer-wrapper{display:flex;flex:1 1 auto;flex-direction:column}\n"] }]
2655
+ }] });
2656
+
2657
+ class ContentPanelContainerContentComponent {
2658
+ }
2659
+ ContentPanelContainerContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelContainerContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2660
+ ContentPanelContainerContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: ContentPanelContainerContentComponent, selector: "mad-content-panel-container-content", ngImport: i0, template: "<ng-content></ng-content>", styles: [":host{flex:1 1 auto;overflow-y:auto;border-top:.05rem solid #cccccc;padding:1rem;height:1rem}\n"] });
2661
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelContainerContentComponent, decorators: [{
2662
+ type: Component,
2663
+ args: [{ selector: 'mad-content-panel-container-content', template: "<ng-content></ng-content>", styles: [":host{flex:1 1 auto;overflow-y:auto;border-top:.05rem solid #cccccc;padding:1rem;height:1rem}\n"] }]
2664
+ }] });
2665
+
2666
+ class ContentPanelContainerFooterComponent {
2667
+ }
2668
+ ContentPanelContainerFooterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelContainerFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2669
+ ContentPanelContainerFooterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: ContentPanelContainerFooterComponent, selector: "mad-content-panel-container-footer", ngImport: i0, template: "<ng-content></ng-content>", styles: [":host{border-top:.05rem solid #cccccc;padding:.25rem 1rem;display:flex;flex:0 0 auto;align-items:center;min-height:2rem}\n"] });
2670
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelContainerFooterComponent, decorators: [{
2671
+ type: Component,
2672
+ args: [{ selector: 'mad-content-panel-container-footer', template: "<ng-content></ng-content>", styles: [":host{border-top:.05rem solid #cccccc;padding:.25rem 1rem;display:flex;flex:0 0 auto;align-items:center;min-height:2rem}\n"] }]
2673
+ }] });
2674
+
2675
+ class MainContainerComponent {
2676
+ }
2677
+ MainContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MainContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2678
+ MainContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: MainContainerComponent, selector: "mad-main-container", ngImport: i0, template: "<div class=\"main-container\">\n <ng-content select=\"mad-content-header\"></ng-content>\n <ng-content select=\"mad-flowbar\"></ng-content>\n <ng-content select=\"mad-content-panel-container\"></ng-content>\n</div>\n", styles: [".main-container{height:100%;display:flex;flex-direction:column}\n"] });
2679
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MainContainerComponent, decorators: [{
2680
+ type: Component,
2681
+ args: [{ selector: 'mad-main-container', template: "<div class=\"main-container\">\n <ng-content select=\"mad-content-header\"></ng-content>\n <ng-content select=\"mad-flowbar\"></ng-content>\n <ng-content select=\"mad-content-panel-container\"></ng-content>\n</div>\n", styles: [".main-container{height:100%;display:flex;flex-direction:column}\n"] }]
2682
+ }] });
2683
+
2684
+ class ContentPanelModule {
2685
+ }
2686
+ ContentPanelModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2687
+ ContentPanelModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelModule, declarations: [ContentHeaderComponent,
2688
+ ContentPanelContainerComponent,
2689
+ ContentPanelContainerContentComponent,
2690
+ ContentPanelContainerFooterComponent,
2691
+ MainContainerComponent], imports: [CommonModule], exports: [ContentHeaderComponent,
2692
+ ContentPanelContainerComponent,
2693
+ ContentPanelContainerContentComponent,
2694
+ ContentPanelContainerFooterComponent,
2695
+ MainContainerComponent] });
2696
+ ContentPanelModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelModule, imports: [CommonModule] });
2697
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelModule, decorators: [{
2698
+ type: NgModule,
2699
+ args: [{
2700
+ declarations: [
2701
+ ContentHeaderComponent,
2702
+ ContentPanelContainerComponent,
2703
+ ContentPanelContainerContentComponent,
2704
+ ContentPanelContainerFooterComponent,
2705
+ MainContainerComponent,
2706
+ ],
2707
+ imports: [CommonModule],
2708
+ exports: [
2709
+ ContentHeaderComponent,
2710
+ ContentPanelContainerComponent,
2711
+ ContentPanelContainerContentComponent,
2712
+ ContentPanelContainerFooterComponent,
2713
+ MainContainerComponent,
2714
+ ],
2715
+ }]
2716
+ }] });
2717
+
2718
+ class FlowbarComponent {
2719
+ constructor() {
2720
+ this._steps = [];
2721
+ this._activeStepChange = new EventEmitter(true);
2722
+ /**
2723
+ * Event emitted when a step header is clicked.
2724
+ * When defined header navigation has to be implemented programmatically.
2725
+ * e.g. {@see changeActiveStepOnHeader}
2726
+ */
2727
+ this._headerClick = new EventEmitter(true);
2728
+ }
2729
+ get currentStepLabel() {
2730
+ return this._activeStep.label;
2731
+ }
2732
+ get currentSubStepLabel() {
2733
+ return this._activeStep.activeSubStep?.label;
2734
+ }
2735
+ ngOnInit() {
2736
+ // If no active step is set as input or the active step is not enabled, select the first enabled step
2737
+ if (!this._activeStep || !this._activeStep.enabled) {
2738
+ this._activeStep = this._steps.find(step => step.enabled);
2739
+ if (this._activeStep) {
2740
+ // If sub steps exist then set the first non disabled sub step per default
2741
+ if (this.activeTabHasSubSteps()) {
2742
+ this._activeStep.activeSubStep = this._activeStep.subSteps.find(step => step.enabled);
2743
+ }
2744
+ this._activeStepChange.emit(this._activeStep);
2745
+ }
2746
+ }
2747
+ }
2748
+ ngAfterViewInit() {
2749
+ this.stepper._getIndicatorType = () => 'number';
2750
+ }
2751
+ getIndexForActiveStep() {
2752
+ const selectedIndex = this._steps.indexOf(this._activeStep);
2753
+ return selectedIndex === -1 ? 0 : selectedIndex;
2754
+ }
2755
+ changeActiveStep(step) {
2756
+ const previousIndex = this._steps.indexOf(this._activeStep);
2757
+ this._activeStep = step;
2758
+ if (this.activeTabHasSubSteps()) {
2759
+ if (previousIndex < this._steps.indexOf(this._activeStep)) {
2760
+ this._activeStep.activeSubStep = this._activeStep.subSteps[0];
2761
+ }
2762
+ else {
2763
+ this._activeStep.activeSubStep = this._activeStep.subSteps[this._activeStep.subSteps.length - 1];
2764
+ }
2765
+ }
2766
+ this._activeStepChange.emit(this._activeStep);
2767
+ }
2768
+ changeActiveStepOnHeader(step) {
2769
+ const stepIndex = this._steps.indexOf(step);
2770
+ this._activeStep = step;
2771
+ this.stepper.selected = this.stepper._steps.find((_, i) => i === stepIndex);
2772
+ }
2773
+ changeActiveSubStep(subStep) {
2774
+ this._activeStep.activeSubStep = subStep;
2775
+ }
2776
+ previous() {
2777
+ if (this.isPreviousAvailable()) {
2778
+ // If active step has no sub steps or first sub step is selected -> go to previous main step
2779
+ if (!this.activeTabHasSubSteps() || this.isFirstSubStep()) {
2780
+ const previousEnabledStep = this.findPreviousEnabledStep();
2781
+ this.changeActiveStep(previousEnabledStep);
2782
+ this.stepper.selectedIndex = this._steps.indexOf(previousEnabledStep);
2783
+ }
2784
+ else {
2785
+ const subStepIndex = this._activeStep.subSteps.indexOf(this._activeStep.activeSubStep);
2786
+ this._activeStep.activeSubStep = this._activeStep.subSteps[subStepIndex - 1];
2787
+ }
2788
+ }
2789
+ }
2790
+ next() {
2791
+ if (this.isNextAvailable()) {
2792
+ // If active step has no sub steps or last sub step is selected -> go to next main step
2793
+ if (!this.activeTabHasSubSteps() || this.isLastSubStep()) {
2794
+ const nextEnabledStep = this.findNextEnabledStep();
2795
+ this.changeActiveStep(nextEnabledStep);
2796
+ this.stepper.selectedIndex = this._steps.indexOf(nextEnabledStep);
2797
+ }
2798
+ else {
2799
+ const subStepIndex = this._activeStep.subSteps.indexOf(this._activeStep.activeSubStep);
2800
+ this._activeStep.activeSubStep = this._activeStep.subSteps[subStepIndex + 1];
2801
+ }
2802
+ }
2803
+ }
2804
+ isPreviousAvailable() {
2805
+ if (this._activeStep) {
2806
+ if (!this.activeTabHasSubSteps() || this.isFirstSubStep()) {
2807
+ const index = this.getCurrentIndex();
2808
+ return index > 0 && this.isAnyPreviousStepEnabled(index);
2809
+ }
2810
+ else {
2811
+ return true;
2812
+ }
2813
+ }
2814
+ return false;
2815
+ }
2816
+ isNextAvailable() {
2817
+ if (this._activeStep) {
2818
+ if (!this.activeTabHasSubSteps() || this.isLastSubStep()) {
2819
+ const index = this.getCurrentIndex();
2820
+ return index < this._steps.length - 1 && this.isAnyFollowingStepEnabled(index);
2821
+ }
2822
+ else {
2823
+ return true;
2824
+ }
2825
+ }
2826
+ return false;
2827
+ }
2828
+ isLastStep() {
2829
+ if (this.getCurrentIndex() === this._steps.length - 1) {
2830
+ if (this.activeTabHasSubSteps()) {
2831
+ return this.isLastSubStep();
2832
+ }
2833
+ else {
2834
+ return true;
2835
+ }
2836
+ }
2837
+ return false;
2838
+ }
2839
+ getCurrentIndex() {
2840
+ return this._steps.findIndex(value => value === this._activeStep);
2841
+ }
2842
+ getCurrentSubStepIndex() {
2843
+ return this._activeStep.subSteps.findIndex(value => value === this._activeStep.activeSubStep);
2844
+ }
2845
+ triggerClick() {
2846
+ const selectedStep = this._steps[this.stepper.selectedIndex];
2847
+ this.changeActiveStep(selectedStep);
2848
+ }
2849
+ headerClick(event, step) {
2850
+ event.stopPropagation(); //stop processing current header click event
2851
+ this._headerClick.emit(step);
2852
+ }
2853
+ activeTabHasSubSteps() {
2854
+ return this._activeStep.subSteps && this._activeStep.subSteps.length > 0;
2855
+ }
2856
+ isFirstSubStep() {
2857
+ return this._activeStep.activeSubStep === this._activeStep.subSteps[0];
2858
+ }
2859
+ isLastSubStep() {
2860
+ return this._activeStep.activeSubStep === this._activeStep.subSteps[this._activeStep.subSteps.length - 1];
2861
+ }
2862
+ isAnyPreviousStepEnabled(index) {
2863
+ // eslint-disable-next-line id-blacklist
2864
+ return this._steps.slice(0, index).find(step => step.enabled) !== undefined;
2865
+ }
2866
+ isAnyFollowingStepEnabled(index) {
2867
+ // eslint-disable-next-line id-blacklist
2868
+ return this._steps.slice(index + 1, this._steps.length).find(step => step.enabled) !== undefined;
2869
+ }
2870
+ findPreviousEnabledStep() {
2871
+ const index = this.getCurrentIndex();
2872
+ return this._steps
2873
+ .slice(0, index)
2874
+ .reverse()
2875
+ .find(step => step.enabled);
2876
+ }
2877
+ findNextEnabledStep() {
2878
+ const index = this.getCurrentIndex();
2879
+ return this._steps.slice(index + 1, this._steps.length).find(step => step.enabled);
2880
+ }
2881
+ }
2882
+ FlowbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: FlowbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2883
+ FlowbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: FlowbarComponent, selector: "mad-flowbar", inputs: { _steps: ["steps", "_steps"], _activeStep: ["activeStep", "_activeStep"] }, outputs: { _activeStepChange: "activeStepChange", _headerClick: "headerClick" }, viewQueries: [{ propertyName: "stepper", first: true, predicate: ["stepper"], descendants: true }], ngImport: i0, template: "<div class=\"stepper-container\">\n <mat-horizontal-stepper #stepper [selectedIndex]=\"this.getIndexForActiveStep()\" (click)=\"triggerClick()\">\n <mat-step *ngFor=\"let step of _steps\" [aria-labelledby]=\"!step.enabled ? 'disabled' : null\">\n <ng-template matStepLabel>\n <div class=\"step-header-overlay\" *ngIf=\"this._headerClick.observers.length > 0\" (click)=\"headerClick($event, step)\"></div>\n <span>{{step.label}}</span>\n </ng-template>\n </mat-step>\n </mat-horizontal-stepper>\n</div>\n", styles: [".stepper-container{display:flex;padding:0 1rem}::ng-deep .mat-stepper-horizontal .mat-horizontal-stepper-header{padding:0;height:auto}::ng-deep .mat-step-header[aria-labelledby=disabled]{pointer-events:none!important;cursor:not-allowed}::ng-deep .mat-stepper-horizontal .mat-horizontal-content-container{padding:0 0 10px}::ng-deep .mat-stepper-horizontal .mat-stepper-horizontal-line{margin:0 5px;border-top-width:4px}.step-header-overlay{position:absolute;width:100%;height:100%;right:0;top:0}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$4.MatStep, selector: "mat-step", inputs: ["color"], exportAs: ["matStep"] }, { kind: "directive", type: i2$4.MatStepLabel, selector: "[matStepLabel]" }, { kind: "component", type: i2$4.MatStepper, selector: "mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]", inputs: ["selectedIndex", "disableRipple", "color", "labelPosition", "headerPosition", "animationDuration"], outputs: ["animationDone"], exportAs: ["matStepper", "matVerticalStepper", "matHorizontalStepper"] }] });
2884
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: FlowbarComponent, decorators: [{
2885
+ type: Component,
2886
+ args: [{ selector: 'mad-flowbar', template: "<div class=\"stepper-container\">\n <mat-horizontal-stepper #stepper [selectedIndex]=\"this.getIndexForActiveStep()\" (click)=\"triggerClick()\">\n <mat-step *ngFor=\"let step of _steps\" [aria-labelledby]=\"!step.enabled ? 'disabled' : null\">\n <ng-template matStepLabel>\n <div class=\"step-header-overlay\" *ngIf=\"this._headerClick.observers.length > 0\" (click)=\"headerClick($event, step)\"></div>\n <span>{{step.label}}</span>\n </ng-template>\n </mat-step>\n </mat-horizontal-stepper>\n</div>\n", styles: [".stepper-container{display:flex;padding:0 1rem}::ng-deep .mat-stepper-horizontal .mat-horizontal-stepper-header{padding:0;height:auto}::ng-deep .mat-step-header[aria-labelledby=disabled]{pointer-events:none!important;cursor:not-allowed}::ng-deep .mat-stepper-horizontal .mat-horizontal-content-container{padding:0 0 10px}::ng-deep .mat-stepper-horizontal .mat-stepper-horizontal-line{margin:0 5px;border-top-width:4px}.step-header-overlay{position:absolute;width:100%;height:100%;right:0;top:0}\n"] }]
2887
+ }], propDecorators: { _steps: [{
2888
+ type: Input,
2889
+ args: ['steps']
2890
+ }], _activeStep: [{
2891
+ type: Input,
2892
+ args: ['activeStep']
2893
+ }], _activeStepChange: [{
2894
+ type: Output,
2895
+ args: ['activeStepChange']
2896
+ }], _headerClick: [{
2897
+ type: Output,
2898
+ args: ['headerClick']
2899
+ }], stepper: [{
2900
+ type: ViewChild,
2901
+ args: ['stepper']
2902
+ }] } });
2903
+
2904
+ class FlowbarModule {
2905
+ }
2906
+ FlowbarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: FlowbarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2907
+ FlowbarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: FlowbarModule, declarations: [FlowbarComponent], imports: [CommonModule, MatStepperModule], exports: [FlowbarComponent] });
2908
+ FlowbarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: FlowbarModule, imports: [CommonModule, MatStepperModule] });
2909
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: FlowbarModule, decorators: [{
2910
+ type: NgModule,
2911
+ args: [{
2912
+ declarations: [FlowbarComponent],
2913
+ imports: [CommonModule, MatStepperModule],
2914
+ exports: [FlowbarComponent],
2915
+ }]
2916
+ }] });
2917
+
2918
+ class MaterialAddonsModule {
2919
+ }
2920
+ MaterialAddonsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MaterialAddonsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2921
+ MaterialAddonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: MaterialAddonsModule, exports: [ReadOnlyFormFieldModule,
2922
+ ButtonModule,
2923
+ ToolbarModule,
2924
+ MaterialActionButtonModule,
2925
+ NumericFieldModule,
2926
+ CardModule,
2927
+ QuickListModule,
2928
+ ThrottleClickModule] });
2929
+ MaterialAddonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MaterialAddonsModule, imports: [ReadOnlyFormFieldModule,
2930
+ ButtonModule,
2931
+ ToolbarModule,
2932
+ MaterialActionButtonModule,
2933
+ NumericFieldModule,
2934
+ CardModule,
2935
+ QuickListModule,
2936
+ ThrottleClickModule] });
2937
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MaterialAddonsModule, decorators: [{
2938
+ type: NgModule,
2939
+ args: [{
2940
+ exports: [
2941
+ ReadOnlyFormFieldModule,
2942
+ ButtonModule,
2943
+ ToolbarModule,
2944
+ MaterialActionButtonModule,
2945
+ NumericFieldModule,
2946
+ CardModule,
2947
+ QuickListModule,
2948
+ ThrottleClickModule,
2949
+ ],
2950
+ }]
2951
+ }] });
2952
+
2953
+ /*
2954
+ * Public API Surface of material-addons
2955
+ */
2956
+
2957
+ /**
2958
+ * Generated bundle index. Do not edit.
2959
+ */
2960
+
2961
+ export { BaseQuickListComponent, ButtonModule, CardComponent, CardModule, ContentHeaderComponent, ContentPanelContainerComponent, ContentPanelContainerContentComponent, ContentPanelContainerFooterComponent, ContentPanelModule, DangerButtonComponent, DataTableColumnsModalComponent, DataTableComponent, DataTableModule, FlowbarComponent, FlowbarModule, IconButtonComponent, LinkButtonComponent, MadBasicButton, MainContainerComponent, MaterialActionButtonComponent, MaterialActionButtonModule, MaterialAddonsModule, NumberFormatService, NumericFieldDirective, NumericFieldModule, OutlineButtonComponent, PrimaryButtonComponent, QuickListCompactComponent, QuickListComponent, QuickListModule, ReadOnlyFormFieldComponent, ReadOnlyFormFieldModule, ReadOnlyFormFieldWrapperComponent, StepComponent, StepHeaderComponent, StepperComponent, StepperModule, TableComponent, TableModule, ThrottleClickDirective, ThrottleClickModule, ToolbarComponent, ToolbarModule, ToolbarService, madStepperAnimations };
2962
+ //# sourceMappingURL=porscheinformatik-material-addons.mjs.map