@porscheinformatik/material-addons 0.0.34 → 0.0.99

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