@one-paragon/angular-utilities 2.0.0-beta.2 → 2.0.0-beta.4

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 (290) hide show
  1. package/karma.conf.js +44 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +15 -27
  4. package/src/action-state/action-state-spinner/action-state-spinner.component.css +16 -0
  5. package/src/action-state/action-state-spinner/action-state-spinner.component.html +6 -0
  6. package/src/action-state/action-state-spinner/action-state-spinner.component.spec.ts +25 -0
  7. package/src/action-state/action-state-spinner/action-state-spinner.component.ts +25 -0
  8. package/src/action-state/action-state-ui/action-state-ui.module.ts +13 -0
  9. package/{action-state/index.d.ts → src/action-state/index.ts} +8 -4
  10. package/src/action-state/ngrx-ext/ngrx-ext.module.ts +15 -0
  11. package/src/action-state/ngrx.ts +69 -0
  12. package/src/http-request-state/HttpRequestStateFactory.ts +66 -0
  13. package/src/http-request-state/HttpRequestStateStore.ts +191 -0
  14. package/src/http-request-state/directives/HttpStateDirectiveBase.ts +29 -0
  15. package/src/http-request-state/directives/http-error-state-directive.ts +21 -0
  16. package/src/http-request-state/directives/http-inProgress-state-directive.ts +19 -0
  17. package/src/http-request-state/directives/http-notStarted-state-directive.ts +19 -0
  18. package/src/http-request-state/directives/http-success-state-directive.ts +29 -0
  19. package/{http-request-state/directives/index.d.ts → src/http-request-state/directives/index.ts} +5 -5
  20. package/src/http-request-state/directives/request-state-directive.spec.ts +72 -0
  21. package/src/http-request-state/directives/request-state-directive.ts +78 -0
  22. package/src/http-request-state/helpers.ts +30 -0
  23. package/src/http-request-state/http-request-state.ts +69 -0
  24. package/src/http-request-state/http-state-module.ts +23 -0
  25. package/{http-request-state/index.d.ts → src/http-request-state/index.ts} +6 -6
  26. package/src/http-request-state/observable.spec.ts +43 -0
  27. package/src/http-request-state/rxjs/getRequestorBody.ts +10 -0
  28. package/src/http-request-state/rxjs/getRequestorState.ts +8 -0
  29. package/{http-request-state/rxjs/index.d.ts → src/http-request-state/rxjs/index.ts} +4 -4
  30. package/src/http-request-state/rxjs/tapError.ts +16 -0
  31. package/src/http-request-state/rxjs/tapSuccess.ts +16 -0
  32. package/src/http-request-state/strategies.spec.ts +42 -0
  33. package/src/http-request-state/types.ts +55 -0
  34. package/src/ngrx/actionable-selector.ts +150 -0
  35. package/src/ngrx/index.ts +1 -0
  36. package/{public-api.d.ts → src/public-api.ts} +35 -16
  37. package/src/rxjs/defaultShareReplay.ts +8 -0
  38. package/{rxjs/index.d.ts → src/rxjs/index.ts} +5 -5
  39. package/src/rxjs/mapError.ts +8 -0
  40. package/src/rxjs/rxjs-operators.ts +132 -0
  41. package/src/rxjs/subjectifier.ts +17 -0
  42. package/src/rxjs/subscriber.directive.ts +57 -0
  43. package/src/specs/clickSubject.spec.ts +95 -0
  44. package/src/specs/dialog.spec.ts +101 -0
  45. package/src/specs/toggleGroupDirective.spec.ts +229 -0
  46. package/src/table-builder/classes/DefaultSettings.ts +11 -0
  47. package/src/table-builder/classes/MatTableObservableDataSource.ts +23 -0
  48. package/src/table-builder/classes/TableBuilderConfig.ts +42 -0
  49. package/src/table-builder/classes/TableBuilderDataSource.ts +66 -0
  50. package/src/table-builder/classes/TableState.ts +93 -0
  51. package/src/table-builder/classes/data-store.ts +10 -0
  52. package/{table-builder/classes/display-col.d.ts → src/table-builder/classes/display-col.ts} +5 -5
  53. package/src/table-builder/classes/filter-info.ts +123 -0
  54. package/src/table-builder/classes/table-builder-general-settings.ts +141 -0
  55. package/src/table-builder/classes/table-builder.ts +95 -0
  56. package/src/table-builder/classes/table-store.helpers.ts +102 -0
  57. package/src/table-builder/classes/table-store.ts +355 -0
  58. package/src/table-builder/components/array-column.component.ts +34 -0
  59. package/src/table-builder/components/column-builder/column-builder.component.html +69 -0
  60. package/src/table-builder/components/column-builder/column-builder.component.scss +43 -0
  61. package/src/table-builder/components/column-builder/column-builder.component.spec.ts +49 -0
  62. package/src/table-builder/components/column-builder/column-builder.component.ts +128 -0
  63. package/src/table-builder/components/column-builder/column-helpers.ts +52 -0
  64. package/src/table-builder/components/date-filter/date-filter.component.html +23 -0
  65. package/src/table-builder/components/date-filter/date-filter.component.ts +22 -0
  66. package/src/table-builder/components/date-time-filter/date-time-filter.component.html +9 -0
  67. package/src/table-builder/components/date-time-filter/date-time-filter.component.ts +20 -0
  68. package/src/table-builder/components/filter/filter.component.html +91 -0
  69. package/src/table-builder/components/filter/filter.component.scss +60 -0
  70. package/src/table-builder/components/filter/filter.component.spec.ts +87 -0
  71. package/src/table-builder/components/filter/filter.component.ts +59 -0
  72. package/src/table-builder/components/filter/in-list/in-list-filter.component.ts +85 -0
  73. package/src/table-builder/components/gen-col-displayer/gen-col-displayer.component.html +55 -0
  74. package/src/table-builder/components/gen-col-displayer/gen-col-displayer.component.scss +57 -0
  75. package/src/table-builder/components/gen-col-displayer/gen-col-displayer.component.ts +44 -0
  76. package/src/table-builder/components/generic-table/generic-table.component.html +77 -0
  77. package/src/table-builder/components/generic-table/generic-table.component.scss +38 -0
  78. package/src/table-builder/components/generic-table/generic-table.component.ts +330 -0
  79. package/src/table-builder/components/generic-table/paginator.component.ts +97 -0
  80. package/src/table-builder/components/group-by-list/group-by-list.component.css +8 -0
  81. package/src/table-builder/components/group-by-list/group-by-list.component.html +12 -0
  82. package/src/table-builder/components/group-by-list/group-by-list.component.spec.ts +23 -0
  83. package/src/table-builder/components/group-by-list/group-by-list.component.ts +18 -0
  84. package/src/table-builder/components/header-menu/header-menu.component.html +105 -0
  85. package/src/table-builder/components/header-menu/header-menu.component.scss +96 -0
  86. package/src/table-builder/components/header-menu/header-menu.component.ts +93 -0
  87. package/src/table-builder/components/in-filter/in-filter.component.css +3 -0
  88. package/src/table-builder/components/in-filter/in-filter.component.html +19 -0
  89. package/src/table-builder/components/in-filter/in-filter.component.ts +65 -0
  90. package/{table-builder/components/index.d.ts → src/table-builder/components/index.ts} +9 -9
  91. package/src/table-builder/components/initialization-component/initialization-component.html +29 -0
  92. package/src/table-builder/components/initialization-component/initialization-component.ts +22 -0
  93. package/src/table-builder/components/link-column.component.ts +45 -0
  94. package/src/table-builder/components/number-filter/number-filter.component.css +10 -0
  95. package/src/table-builder/components/number-filter/number-filter.component.html +22 -0
  96. package/src/table-builder/components/number-filter/number-filter.component.spec.ts +30 -0
  97. package/src/table-builder/components/number-filter/number-filter.component.ts +25 -0
  98. package/src/table-builder/components/profiles-menu/profiles-menu.component.html +73 -0
  99. package/src/table-builder/components/profiles-menu/profiles-menu.component.scss +126 -0
  100. package/src/table-builder/components/profiles-menu/profiles-menu.component.spec.ts +23 -0
  101. package/src/table-builder/components/profiles-menu/profiles-menu.component.ts +63 -0
  102. package/src/table-builder/components/scroll-strategy.ts +76 -0
  103. package/src/table-builder/components/sort-menu/sort-menu.component-store.ts +57 -0
  104. package/src/table-builder/components/sort-menu/sort-menu.component.html +109 -0
  105. package/src/table-builder/components/sort-menu/sort-menu.component.scss +119 -0
  106. package/src/table-builder/components/sort-menu/sort-menu.component.ts +88 -0
  107. package/{table-builder/components/table-container/table-container-imports.d.ts → src/table-builder/components/table-container/table-container-imports.ts} +27 -13
  108. package/src/table-builder/components/table-container/table-container.helpers/data-state.helpers.ts +141 -0
  109. package/src/table-builder/components/table-container/table-container.helpers/filter-state.helpers.ts +126 -0
  110. package/src/table-builder/components/table-container/table-container.helpers/groupBy.helpers.ts +86 -0
  111. package/src/table-builder/components/table-container/table-container.helpers/meta-data.helpers.ts +15 -0
  112. package/src/table-builder/components/table-container/table-container.helpers/sort-state.helpers.ts +45 -0
  113. package/src/table-builder/components/table-container/table-container.html +94 -0
  114. package/src/table-builder/components/table-container/table-container.scss +47 -0
  115. package/src/table-builder/components/table-container/table-container.spec.ts +154 -0
  116. package/src/table-builder/components/table-container/table-container.ts +307 -0
  117. package/src/table-builder/components/table-container/tableProps.ts +18 -0
  118. package/src/table-builder/components/table-container/virtual-scroll-container.ts +155 -0
  119. package/src/table-builder/components/table-container-filter/filter-list/filter-list.component.html +31 -0
  120. package/src/table-builder/components/table-container-filter/filter-list/filter-list.component.ts +44 -0
  121. package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.css +42 -0
  122. package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.html +10 -0
  123. package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.spec.ts +85 -0
  124. package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.ts +32 -0
  125. package/src/table-builder/components/table-container-filter/table-wrapper-filter-store.ts +23 -0
  126. package/src/table-builder/directives/custom-cell-directive.ts +58 -0
  127. package/{table-builder/directives/index.d.ts → src/table-builder/directives/index.ts} +6 -5
  128. package/src/table-builder/directives/multi-sort.directive.spec.ts +124 -0
  129. package/src/table-builder/directives/multi-sort.directive.ts +50 -0
  130. package/src/table-builder/directives/resize-column.directive.ts +107 -0
  131. package/src/table-builder/directives/table-wrapper.directive.ts +13 -0
  132. package/src/table-builder/directives/tb-filter.directive.ts +372 -0
  133. package/src/table-builder/enums/filterTypes.ts +40 -0
  134. package/src/table-builder/functions/boolean-filter-function.ts +12 -0
  135. package/src/table-builder/functions/date-filter-function.ts +68 -0
  136. package/src/table-builder/functions/download-data.ts +11 -0
  137. package/src/table-builder/functions/null-filter-function.ts +9 -0
  138. package/src/table-builder/functions/number-filter-function.ts +41 -0
  139. package/src/table-builder/functions/sort-data-function.ts +23 -0
  140. package/src/table-builder/functions/string-filter-function.ts +51 -0
  141. package/{table-builder/interfaces/ColumnInfo.d.ts → src/table-builder/interfaces/ColumnInfo.ts} +7 -6
  142. package/src/table-builder/interfaces/column-template.ts +9 -0
  143. package/{table-builder/interfaces/dictionary.d.ts → src/table-builder/interfaces/dictionary.ts} +3 -3
  144. package/src/table-builder/interfaces/report-def.ts +160 -0
  145. package/src/table-builder/ngrx/tableBuilderStateStore.ts +199 -0
  146. package/src/table-builder/pipes/column-total.pipe.ts +16 -0
  147. package/src/table-builder/pipes/format-filter-type.pipe.ts +12 -0
  148. package/src/table-builder/pipes/format-filter-value.pipe.ts +42 -0
  149. package/src/table-builder/pipes/key-display.ts +13 -0
  150. package/src/table-builder/services/export-to-csv.service.ts +75 -0
  151. package/src/table-builder/services/link-creator.service.ts +67 -0
  152. package/src/table-builder/services/table-template-service.ts +59 -0
  153. package/src/table-builder/services/transform-creator.ts +94 -0
  154. package/src/table-builder/specs/table-custom-filters.spec.ts +262 -0
  155. package/src/table-builder/styles/collapser.styles.scss +16 -0
  156. package/src/table-builder/table-builder.module.ts +73 -0
  157. package/src/test.ts +17 -0
  158. package/src/utilities/array-helpers.ts +13 -0
  159. package/src/utilities/directives/auto-focus.directive.ts +20 -0
  160. package/src/utilities/directives/clickEmitterDirective.ts +15 -0
  161. package/src/utilities/directives/clickSubject.ts +19 -0
  162. package/src/utilities/directives/conditional-classes.directive.ts +35 -0
  163. package/src/utilities/directives/dialog-service.ts +19 -0
  164. package/src/utilities/directives/dialog.ts +142 -0
  165. package/src/utilities/directives/mat-toggle-group-directive.ts +60 -0
  166. package/src/utilities/directives/prevent-enter.directive.ts +12 -0
  167. package/src/utilities/directives/stop-propagation.directive.ts +19 -0
  168. package/src/utilities/directives/styler.ts +39 -0
  169. package/src/utilities/directives/trim-whitespace.directive.ts +20 -0
  170. package/{utilities/index.d.ts → src/utilities/index.ts} +22 -15
  171. package/src/utilities/module.ts +55 -0
  172. package/src/utilities/pipes/function.pipe.ts +21 -0
  173. package/src/utilities/pipes/phone.pipe.ts +15 -0
  174. package/src/utilities/pipes/space-case.pipes.spec.ts +47 -0
  175. package/src/utilities/pipes/space-case.pipes.ts +26 -0
  176. package/tsconfig.lib.json +19 -0
  177. package/tsconfig.lib.prod.json +10 -0
  178. package/tsconfig.spec.json +17 -0
  179. package/action-state/action-state-spinner/action-state-spinner.component.d.ts +0 -12
  180. package/action-state/action-state-ui/action-state-ui.module.d.ts +0 -7
  181. package/action-state/ngrx-ext/ngrx-ext.module.d.ts +0 -8
  182. package/action-state/ngrx.d.ts +0 -31
  183. package/fesm2022/one-paragon-angular-utilities.mjs +0 -5681
  184. package/fesm2022/one-paragon-angular-utilities.mjs.map +0 -1
  185. package/http-request-state/HttpRequestStateFactory.d.ts +0 -17
  186. package/http-request-state/HttpRequestStateStore.d.ts +0 -58
  187. package/http-request-state/directives/HttpStateDirectiveBase.d.ts +0 -14
  188. package/http-request-state/directives/http-error-state-directive.d.ts +0 -9
  189. package/http-request-state/directives/http-inProgress-state-directive.d.ts +0 -9
  190. package/http-request-state/directives/http-notStarted-state-directive.d.ts +0 -9
  191. package/http-request-state/directives/http-success-state-directive.d.ts +0 -16
  192. package/http-request-state/directives/request-state-directive.d.ts +0 -34
  193. package/http-request-state/helpers.d.ts +0 -9
  194. package/http-request-state/http-request-state.d.ts +0 -12
  195. package/http-request-state/http-state-module.d.ts +0 -11
  196. package/http-request-state/rxjs/getRequestorBody.d.ts +0 -3
  197. package/http-request-state/rxjs/getRequestorState.d.ts +0 -3
  198. package/http-request-state/rxjs/tapError.d.ts +0 -3
  199. package/http-request-state/rxjs/tapSuccess.d.ts +0 -3
  200. package/http-request-state/types.d.ts +0 -41
  201. package/index.d.ts +0 -5
  202. package/ngrx/actionable-selector.d.ts +0 -31
  203. package/ngrx/index.d.ts +0 -1
  204. package/rxjs/defaultShareReplay.d.ts +0 -2
  205. package/rxjs/mapError.d.ts +0 -2
  206. package/rxjs/rxjs-operators.d.ts +0 -13
  207. package/rxjs/subjectifier.d.ts +0 -8
  208. package/rxjs/subscriber.directive.d.ts +0 -14
  209. package/table-builder/classes/DefaultSettings.d.ts +0 -9
  210. package/table-builder/classes/MatTableObservableDataSource.d.ts +0 -9
  211. package/table-builder/classes/TableBuilderConfig.d.ts +0 -23
  212. package/table-builder/classes/TableBuilderDataSource.d.ts +0 -18
  213. package/table-builder/classes/TableState.d.ts +0 -66
  214. package/table-builder/classes/data-store.d.ts +0 -8
  215. package/table-builder/classes/filter-info.d.ts +0 -37
  216. package/table-builder/classes/table-builder-general-settings.d.ts +0 -85
  217. package/table-builder/classes/table-builder.d.ts +0 -18
  218. package/table-builder/classes/table-store.d.ts +0 -130
  219. package/table-builder/classes/table-store.helpers.d.ts +0 -28
  220. package/table-builder/components/array-column.component.d.ts +0 -15
  221. package/table-builder/components/column-builder/column-builder.component.d.ts +0 -40
  222. package/table-builder/components/column-builder/column-helpers.d.ts +0 -36
  223. package/table-builder/components/date-filter/date-filter.component.d.ts +0 -37
  224. package/table-builder/components/date-time-filter/date-time-filter.component.d.ts +0 -37
  225. package/table-builder/components/filter/filter.component.d.ts +0 -46
  226. package/table-builder/components/filter/in-list/in-list-filter.component.d.ts +0 -23
  227. package/table-builder/components/gen-col-displayer/gen-col-displayer.component.d.ts +0 -17
  228. package/table-builder/components/generic-table/generic-table.component.d.ts +0 -72
  229. package/table-builder/components/generic-table/paginator.component.d.ts +0 -28
  230. package/table-builder/components/group-by-list/group-by-list.component.d.ts +0 -7
  231. package/table-builder/components/header-menu/header-menu.component.d.ts +0 -49
  232. package/table-builder/components/in-filter/in-filter.component.d.ts +0 -20
  233. package/table-builder/components/initialization-component/initialization-component.d.ts +0 -13
  234. package/table-builder/components/link-column.component.d.ts +0 -25
  235. package/table-builder/components/number-filter/number-filter.component.d.ts +0 -39
  236. package/table-builder/components/profiles-menu/profiles-menu.component.d.ts +0 -32
  237. package/table-builder/components/scroll-strategy.d.ts +0 -22
  238. package/table-builder/components/sort-menu/sort-menu.component-store.d.ts +0 -24
  239. package/table-builder/components/sort-menu/sort-menu.component.d.ts +0 -19
  240. package/table-builder/components/table-container/table-container.d.ts +0 -83
  241. package/table-builder/components/table-container/table-container.helpers/data-state.helpers.d.ts +0 -6
  242. package/table-builder/components/table-container/table-container.helpers/filter-state.helpers.d.ts +0 -19
  243. package/table-builder/components/table-container/table-container.helpers/groupBy.helpers.d.ts +0 -17
  244. package/table-builder/components/table-container/table-container.helpers/meta-data.helpers.d.ts +0 -2
  245. package/table-builder/components/table-container/table-container.helpers/sort-state.helpers.d.ts +0 -8
  246. package/table-builder/components/table-container/tableProps.d.ts +0 -10
  247. package/table-builder/components/table-container/virtual-scroll-container.d.ts +0 -36
  248. package/table-builder/components/table-container-filter/filter-list/filter-list.component.d.ts +0 -15
  249. package/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.d.ts +0 -12
  250. package/table-builder/components/table-container-filter/table-wrapper-filter-store.d.ts +0 -14
  251. package/table-builder/directives/custom-cell-directive.d.ts +0 -32
  252. package/table-builder/directives/multi-sort.directive.d.ts +0 -10
  253. package/table-builder/directives/resize-column.directive.d.ts +0 -43
  254. package/table-builder/directives/table-wrapper.directive.d.ts +0 -8
  255. package/table-builder/directives/tb-filter.directive.d.ts +0 -113
  256. package/table-builder/enums/filterTypes.d.ts +0 -36
  257. package/table-builder/functions/boolean-filter-function.d.ts +0 -3
  258. package/table-builder/functions/date-filter-function.d.ts +0 -4
  259. package/table-builder/functions/download-data.d.ts +0 -1
  260. package/table-builder/functions/null-filter-function.d.ts +0 -2
  261. package/table-builder/functions/number-filter-function.d.ts +0 -4
  262. package/table-builder/functions/sort-data-function.d.ts +0 -6
  263. package/table-builder/functions/string-filter-function.d.ts +0 -5
  264. package/table-builder/interfaces/report-def.d.ts +0 -151
  265. package/table-builder/ngrx/tableBuilderStateStore.d.ts +0 -70
  266. package/table-builder/pipes/column-total.pipe.d.ts +0 -8
  267. package/table-builder/pipes/format-filter-type.pipe.d.ts +0 -8
  268. package/table-builder/pipes/format-filter-value.pipe.d.ts +0 -11
  269. package/table-builder/pipes/key-display.d.ts +0 -9
  270. package/table-builder/services/export-to-csv.service.d.ts +0 -14
  271. package/table-builder/services/link-creator.service.d.ts +0 -16
  272. package/table-builder/services/table-template-service.d.ts +0 -14
  273. package/table-builder/services/transform-creator.d.ts +0 -15
  274. package/table-builder/table-builder.module.d.ts +0 -21
  275. package/utilities/array-helpers.d.ts +0 -1
  276. package/utilities/directives/auto-focus.directive.d.ts +0 -9
  277. package/utilities/directives/clickEmitterDirective.d.ts +0 -7
  278. package/utilities/directives/clickSubject.d.ts +0 -9
  279. package/utilities/directives/conditional-classes.directive.d.ts +0 -13
  280. package/utilities/directives/dialog-service.d.ts +0 -10
  281. package/utilities/directives/dialog.d.ts +0 -44
  282. package/utilities/directives/mat-toggle-group-directive.d.ts +0 -21
  283. package/utilities/directives/prevent-enter.directive.d.ts +0 -6
  284. package/utilities/directives/stop-propagation.directive.d.ts +0 -7
  285. package/utilities/directives/styler.d.ts +0 -15
  286. package/utilities/directives/trim-whitespace.directive.d.ts +0 -7
  287. package/utilities/module.d.ts +0 -19
  288. package/utilities/pipes/function.pipe.d.ts +0 -11
  289. package/utilities/pipes/phone.pipe.d.ts +0 -7
  290. package/utilities/pipes/space-case.pipes.d.ts +0 -17
@@ -0,0 +1,330 @@
1
+ import { Component, ChangeDetectionStrategy, ViewContainerRef, Injector, computed, inject, input, viewChild, effect, untracked, signal, output, linkedSignal } from '@angular/core';
2
+ import { MatFooterRowDef, MatHeaderRowDef, MatRowDef, MatTable, MatTableDataSource, MatTableModule } from '@angular/material/table';
3
+ import { SelectionChange, SelectionModel } from '@angular/cdk/collections';
4
+ import { TableStore } from '../../classes/table-store';
5
+ import { switchMap } from 'rxjs/operators';
6
+ import { ColumnBuilderComponent } from '../column-builder/column-builder.component';
7
+ import { Dictionary } from '../../interfaces/dictionary';
8
+ import { ColumnInfo } from '../../interfaces/ColumnInfo';
9
+ import { CdkDragDrop, CdkDropList, DragDropModule } from '@angular/cdk/drag-drop';
10
+ import { FunctionPipe } from '../../../utilities';
11
+ import { MatCheckboxModule } from '@angular/material/checkbox';
12
+ import { MatButtonModule } from '@angular/material/button';
13
+ import { MatIconModule } from '@angular/material/icon';
14
+ import { NgTemplateOutlet } from '@angular/common';
15
+ import { MatTooltipModule } from '@angular/material/tooltip';
16
+ import { TransformCreator } from '../../services/transform-creator';
17
+ import { initIndexSymbol } from '../table-container/table-container.helpers/sort-state.helpers';
18
+ import { VirtualScrollOptions } from '../../classes/table-builder-general-settings';
19
+ import { toObservable, toSignal } from '@angular/core/rxjs-interop';
20
+ import { DataStore } from '../../classes/data-store';
21
+
22
+ @Component({
23
+ selector: 'tb-generic-table',
24
+ templateUrl: './generic-table.component.html',
25
+ styleUrls: ['./generic-table.component.scss'],
26
+ changeDetection: ChangeDetectionStrategy.OnPush,
27
+ imports: [
28
+ MatTableModule, DragDropModule, MatCheckboxModule, MatButtonModule, MatIconModule, NgTemplateOutlet,
29
+ MatTooltipModule, FunctionPipe,
30
+ ],
31
+ })
32
+ export class GenericTableComponent {
33
+ protected state = inject(TableStore);
34
+ private dataStore = inject(DataStore);
35
+ private viewContainer = inject(ViewContainerRef);
36
+ private transformCreator = inject(TransformCreator);
37
+ private _injector = inject(Injector);
38
+
39
+ smallFooter = 10
40
+
41
+ $headerRow = viewChild(MatHeaderRowDef);
42
+ $footerRow = viewChild(MatFooterRowDef);
43
+ $table = viewChild(MatTable);
44
+ $dropList = viewChild(CdkDropList);
45
+
46
+ selection$ = output<SelectionChange<any>>({ alias: 'selection' });
47
+
48
+ $displayDataLength = input.required<number>({ alias: 'displayDataLength' });
49
+ $data = input.required<any[]>({ alias: 'data' })
50
+ $rows = input<MatRowDef<any>[]>([], { alias: 'rows' });
51
+ $columnInfos = input.required<ColumnInfo[]>({ alias: 'columnInfos' });
52
+ $dataSource = input.required<MatTableDataSource<any>>({ alias: 'dataSource' });
53
+
54
+
55
+ $keys = computed(() => {
56
+ const displayed = this.state.$orderedVisibleColumns();
57
+ const built = this.$columns();
58
+ const keys = displayed.filter(d => !!built[d]);
59
+ if(this.$hasSelectColumn()){
60
+ keys.unshift('select');
61
+ }
62
+ if(this.$hasIndexColumn()) {
63
+ keys.unshift('index');
64
+ }
65
+ return keys;
66
+ });
67
+ keys$ = toObservable(this.$keys);
68
+
69
+ $trackBy = input<string | undefined>(undefined, { alias: 'trackBy' });
70
+ $trackByFunction = computed(() => {
71
+ const trackBy = this.$trackBy();
72
+ if(!trackBy) return (index:number, item: any) => item[initIndexSymbol];
73
+ return ((index:number, item: any) => item[trackBy]);
74
+ });
75
+
76
+
77
+
78
+ $hasFooterMeta = computed(() => this.state.$metaDataArray().some(md => !!md.additional?.footer))
79
+ $hasCustomFooter = computed(() => this.$columnInfos()?.some(ci => !!ci.customCell?.columnDef?.footerCell));
80
+ $footerRowStyle = computed(() => {
81
+ const hasData = !!this.$displayDataLength();
82
+ const metaFooter = this.$hasFooterMeta();
83
+ const customFooter = this.$hasCustomFooter();
84
+ const hasSelectionColumn = this.state.$props().selectionColumn;
85
+ return customFooter || (hasData && (metaFooter || hasSelectionColumn)) ? 'regular-footer' : hasData ? 'no-footer' : 'small-footer';
86
+ });
87
+ $showFooterRow = computed(() => this.$footerRowStyle() !== 'no-footer');
88
+
89
+ injector = Injector.create({
90
+ providers: [
91
+ {provide: MatTable, useFactory: ()=> this.$table() },
92
+ {provide: CdkDropList, useFactory: ()=> this.$dropList() },
93
+ ],
94
+ parent: this._injector
95
+ });
96
+
97
+ $hasIndexColumn = computed(() => this.state.selectSignal(state => state.props.indexColumn)());
98
+ $columns = signal<Dictionary<ColumnBuilderComponent>>({});
99
+ $showHeader = computed(() => !this.state.$tableSettings().hideColumnHeader)
100
+ $offset = this.dataStore.selectSignal( s => s.virtualScrollOffset );
101
+
102
+ drop(event: CdkDragDrop<string[]>) {
103
+ this.state.setUserDefinedOrder({ newOrder:event.currentIndex, oldOrder:event.previousIndex })
104
+ }
105
+
106
+ #buildColumnsEffect = effect(() => {
107
+ const columnInfos = this.$columnInfos() || [];
108
+ const table = this.$table();
109
+ if(!table) return;
110
+
111
+ untracked(() => {
112
+
113
+ Object.entries(this.$columns()).forEach(([key, value]) => {
114
+ const columnInfo = columnInfos.find(ci => ci.metaData.key === key);
115
+ if(!columnInfo || columnInfo.customCell !== value.$customCell()) {
116
+ delete this.$columns()[key];
117
+ table?.removeColumnDef(value.$columnDef()!);
118
+ }
119
+ });
120
+
121
+ columnInfos.forEach(ci => this.buildColumn(ci))
122
+ })
123
+ });
124
+
125
+ #buildRowsEffect = effect(() => {
126
+ const table = this.$table();
127
+ const rows = this.$rows();
128
+ const keys = this.$keys();
129
+ if(!table) return;
130
+
131
+ untracked(() => {
132
+ rows.forEach(row => {
133
+ table.removeRowDef(row);
134
+ row.columns = keys;
135
+ table.addRowDef(row);
136
+ });
137
+ })
138
+ });
139
+
140
+ #buildHeaderRowEffect = effect(() => {
141
+ const headerRow = this.$headerRow();
142
+ const showHeader = this.$showHeader();
143
+ const table = this.$table();
144
+ untracked(() => {
145
+ if(headerRow && showHeader && table) table.addHeaderRowDef(headerRow);
146
+ else if(headerRow && table) table.removeHeaderRowDef(headerRow);
147
+ })
148
+ });
149
+
150
+ #buildFooterEffect = effect(() => {
151
+ const footerRow = this.$footerRow();
152
+ const showFooter = this.$showFooterRow();
153
+ const table = this.$table();
154
+
155
+ untracked(() => {
156
+ if(footerRow && showFooter && table) table.addFooterRowDef(footerRow);
157
+ else if(footerRow && table) table.removeFooterRowDef(footerRow);
158
+ })
159
+ });
160
+
161
+ $usePaginator = computed(() => this.state.$tableSettings().usePaginator);
162
+ $useVirtualScroll = computed(() => this.state.$viewType().includes('virtual'));
163
+ $offsetIndex = computed(() => {
164
+ const virtualStart = this.dataStore.selectSignal(d => d.virtualEnds.start)();
165
+ const pageSize = this.state.$pageSize();
166
+ const currentPage = this.state.$currentPage();
167
+ if(this.$useVirtualScroll()){
168
+ return virtualStart;
169
+ }
170
+ if(this.$usePaginator()){
171
+ return pageSize * currentPage;
172
+ }
173
+ return 0;
174
+ });
175
+
176
+
177
+ isGroupHeader(_: number, row: { isGroupHeader: boolean }) {
178
+ return row.isGroupHeader;
179
+ }
180
+
181
+ setExpanded(key: string, groupKey: string, isExpanded: boolean): void {
182
+ this.state.updateExpandedGroups({ key , isExpanded, groupKey });
183
+ }
184
+
185
+ buildColumn(column: ColumnInfo) {
186
+ const alreadyBuiltColumn = this.$columns()[column.metaData.key];
187
+ if(alreadyBuiltColumn) {
188
+ alreadyBuiltColumn.setMetaData(column.metaData);
189
+ } else {
190
+ const component = this.viewContainer.createComponent(ColumnBuilderComponent, {
191
+ index: 0,
192
+ injector: this.injector
193
+ });
194
+ component.instance.$customCell.set(column.customCell);
195
+ component.instance.setMetaData(column.metaData);
196
+ component.instance.$data = this.$data;
197
+ component.instance.whenViewInited(() => {
198
+ this.$columns.update(columnsDict => ({
199
+ ...columnsDict,
200
+ [column.metaData.key]: component.instance
201
+ }));
202
+ });
203
+ }
204
+ }
205
+
206
+ $hasSelectColumn = computed(() => this.state.selectSignal(state => state.props.selectionColumn)());
207
+ $selection = computed(() => {
208
+ const trackBy = this.$trackBy();
209
+ if(trackBy){
210
+ return new SelectionModel<any>(true, [], true, (a, b) => a[trackBy] === b[trackBy]);
211
+ }
212
+ return new SelectionModel<any>(true, []);
213
+ });
214
+ selectionChange$ = toObservable(this.$selection).pipe(switchMap(s => s.changed));
215
+ $selectionChange = toSignal(this.selectionChange$);
216
+ onSelectionChangeEffect = effect(() => {
217
+ const selectionChange = this.$selectionChange();
218
+ if(!selectionChange) return ;
219
+ untracked(() => this.selection$.emit(selectionChange))
220
+ });
221
+ $isAllSelected = computed(() => {
222
+ this.$selectionChange();
223
+ const selected = this.$selection()?.selected;
224
+ if(!selected) return false;
225
+ return this.$selectableData()?.length === selected.length;
226
+ });
227
+ $masterToggleChecked = this.$isAllSelected;
228
+ $masterToggleIndeterminate = computed(() => {
229
+ this.$selectionChange();
230
+ return !!this.$selection()?.selected.length && !this.$masterToggleChecked()});
231
+
232
+ $selectableData = computed(() => {
233
+ if(this.state.$viewType() === 'virtual paginator' || this.state.$viewType() === 'paginator'){
234
+ const previousPageRecords = this.state.$currentPage() * this.state.$pageSize();
235
+ return this.$data().slice(previousPageRecords, previousPageRecords + this.state.$pageSize());
236
+ }else if(this.state.$viewType() === 'all' || this.state.$viewType() === 'virtual all'){
237
+ return this.$data();
238
+ }
239
+ return [];
240
+ });
241
+ #onSelectableDataChangeEffect = effect(() => {
242
+ const selectableData = this.$selectableData();
243
+ untracked(() => {
244
+ const selected = this.$selection()?.selected;
245
+ if(!selected.length) return;
246
+ const trackBy = this.$trackBy();
247
+ const trackByFunc = trackBy ? (s) => selectableData.every(d => d[trackBy!] !== s[trackBy!]) : s => !selectableData.includes(s);
248
+ const removed = selected.filter(trackByFunc);
249
+ this.$selection().deselect(removed)
250
+ })
251
+ });
252
+
253
+ /** Selects all rows if they are not all selected; otherwise clear selection. */
254
+ masterToggle() {
255
+ if(this.$isAllSelected()){
256
+ this.$selection().clear()
257
+ } else {
258
+ this.$selection().select(...this.$selectableData());
259
+ }
260
+ }
261
+ $tableWidth = linkedSignal<number | undefined, { width: string }>({
262
+ source: this.state.$getUserDefinedTableWidth,
263
+ computation: (currentUserDefinedWidth, { source: previousUserDefinedWidth } = { value: null as any , source: 0 as any }) => {
264
+ if( currentUserDefinedWidth){
265
+ return ({width:`${currentUserDefinedWidth}px`, minWidth: 'initial'});
266
+ } if( wasReset() ){
267
+ return ({width:'initial'});
268
+ }
269
+ return ({} as { width: string });
270
+
271
+ function wasReset(){
272
+ return (previousUserDefinedWidth ?? 0) >=0 && currentUserDefinedWidth == null;
273
+ }
274
+ }
275
+ });
276
+
277
+ getTransform = (key: string, val: string) => {
278
+ if(val == undefined || val === 'null') return '';
279
+ try {
280
+ return this.transformCreator.createTransformer(this.$columns[key].metaData, true)({ [key]: val});
281
+ } catch (error) {
282
+ return val;
283
+ }
284
+ }
285
+
286
+ $rowHeight = this.state.selectSignal(s => {
287
+ if(this.state.$isVirtual() && (s.notPersistedTableSettings.useVirtualScroll as VirtualScrollOptions)?.enforceRowHeight){
288
+ const height = (s.notPersistedTableSettings.useVirtualScroll as VirtualScrollOptions)!.rowHeight;
289
+ return height + 'px' ;
290
+ }
291
+ if(typeof s.notPersistedTableSettings.rowHeight === 'number'){
292
+ return s.notPersistedTableSettings.rowHeight + 'px';
293
+ }
294
+ return s.notPersistedTableSettings.rowHeight;
295
+
296
+ });
297
+
298
+ $headerHeight = this.state.selectSignal(s => {
299
+ if(this.state.$isVirtual() && (s.notPersistedTableSettings.useVirtualScroll as VirtualScrollOptions)?.enforceHeaderHeight){
300
+ const height = (s.notPersistedTableSettings.useVirtualScroll as VirtualScrollOptions)!.headerHeight;
301
+ return height + 'px';
302
+ }
303
+ if(typeof s.notPersistedTableSettings.headerHeight === 'number'){
304
+ return s.notPersistedTableSettings.headerHeight + 'px';
305
+ }
306
+ return s.notPersistedTableSettings.headerHeight;
307
+ });
308
+
309
+ $groupHeaderHeight = this.state.selectSignal(s => {
310
+ if(s.notPersistedTableSettings.groupHeaderHeight){
311
+ return s.notPersistedTableSettings.groupHeaderHeight + 'px';
312
+ }
313
+ return this.$rowHeight();
314
+ });
315
+
316
+ $footerHeight = this.state.selectSignal(s => {
317
+ const footerStyle = this.$footerRowStyle();
318
+ switch (footerStyle) {
319
+ case 'regular-footer':
320
+ return this.$rowHeight();
321
+ case 'small-footer':
322
+ return `${this.smallFooter}px`;
323
+ default:
324
+ return '0px';
325
+ }
326
+ });
327
+
328
+
329
+ $stickyFooter = computed(() => this.state.$props().stickyFooter || this.state.$isVirtual());
330
+ }
@@ -0,0 +1,97 @@
1
+ import { Component, ChangeDetectionStrategy, ElementRef, computed, inject, viewChild, input, effect, untracked } from '@angular/core';
2
+ import { MatPaginator, MatPaginatorModule, PageEvent } from '@angular/material/paginator';
3
+ import { switchMap } from 'rxjs/operators';
4
+ import { TableStore } from '../../classes/table-store';
5
+ import { MatButtonModule } from '@angular/material/button';
6
+ import { DataStore } from '../../classes/data-store';
7
+ import { toObservable, toSignal } from '@angular/core/rxjs-interop';
8
+ import { notNull } from '../../../rxjs';
9
+
10
+ @Component({
11
+ selector: 'tb-paginator',
12
+ imports: [MatPaginatorModule, MatButtonModule],
13
+ template: `
14
+ <div class="paginator-row">
15
+ @if($currentPageData(); as pageData){
16
+ <div [class]="{ 'hide' : ! $collapseFooter(), 'page-amounts':true}">
17
+ @if(!$showAll()){ {{pageData.currentStart}} - {{pageData.currentEnd}} of }{{pageData.total}}
18
+ </div>
19
+ }
20
+ <mat-paginator [pageSizeOptions]="[5, 10, 20, 50, 100, 500]" showFirstLastButtons
21
+ [class]="{ 'hide' : $collapseFooter() }">
22
+ </mat-paginator>
23
+ @if ($showAllOption()) {<button mat-button (click)="updatePaginator()"><span [style.text-decoration]="$showAll() ? 'line-through' : ''" >All</span></button>}
24
+ </div>
25
+ `,
26
+ styleUrls: ['./generic-table.component.scss','../../styles/collapser.styles.scss'],
27
+ changeDetection: ChangeDetectionStrategy.OnPush,
28
+ })
29
+ export class PaginatorComponent {
30
+ private state = inject(TableStore);
31
+ private data = inject(DataStore);
32
+ $paginator = viewChild(MatPaginator);
33
+
34
+ $dataLength = this.data.selectSignal(d => d.dataLen);
35
+ pageEvent$ = toObservable(this.$paginator).pipe(notNull(), switchMap(p => p.page));
36
+ $pageEvent = toSignal(this.pageEvent$);
37
+ $pageIndexChangeEvent = computed(() => this.$pageEvent()?.pageIndex);
38
+ $pageSizeChangeEvent = computed(() => this.$pageEvent()?.pageSize);
39
+ $currentPageData = computed(() => {
40
+ const pageEvent = this.$pageEvent();
41
+ if(!pageEvent) return;
42
+ const paginator = this.$paginator()!;
43
+ // Reset because initial page event does not have page length
44
+ pageEvent.pageIndex = paginator.pageIndex;
45
+ pageEvent.pageSize = paginator.pageSize;
46
+ pageEvent.length = paginator.length;
47
+ const pageDetails = mapPaginationEventToCurrentPageDetails(pageEvent);
48
+ const dataLength = this.$dataLength();
49
+ return ({...pageDetails, total: dataLength})
50
+ })
51
+
52
+ onPageIndexEffect = effect(() => {
53
+ const index = this.$pageIndexChangeEvent();
54
+ if(index === undefined) return;
55
+ untracked(() => this.state.setCurrentPage(index))
56
+ });
57
+ onPageSizeEffect = effect(() => {
58
+ const size = this.$pageSizeChangeEvent();
59
+ if(!size) return;
60
+ untracked(() => this.state.setPageSize(size));
61
+ });
62
+ onMetaPageSizeEffect = effect(() => {
63
+ const paginator = this.$paginator();
64
+ if(!paginator) return;
65
+ const metaPageSize = this.state.$pageSize();
66
+ untracked(() => paginator._changePageSize(metaPageSize));
67
+ });
68
+ onDataLengthEffect = effect(() => {
69
+ const paginator = this.$paginator();
70
+ const dataLength = this.$dataLength();
71
+ untracked(() => {
72
+ if(paginator){
73
+ paginator.length = dataLength;
74
+ }
75
+ })
76
+ });
77
+ $collapseFooter = computed(() => this.state.selectSignal(state => state.persistedTableSettings.collapseFooter)() || this.$showAll());
78
+ $showAllOption = this.state.selectSignal(s => s.notPersistedTableSettings?.includeAllInPaginatorOptions);
79
+ $showAll = this.state.selectSignal(s => s.showAll);
80
+ updatePaginator = this.state.updater(state => ({ ...state, showAll: !state.showAll }));
81
+ showAll(){
82
+ this.updatePaginator();
83
+ }
84
+ }
85
+
86
+ const mapPaginationEventToCurrentPageDetails = (pageData: PageEvent):CurrentPageDetails => ({
87
+ currentStart : (pageData.pageIndex * pageData.pageSize) + 1,
88
+ currentEnd : Math.min(pageData.length , ((pageData.pageIndex + 1) * pageData.pageSize)),
89
+ total : pageData.length
90
+ });
91
+
92
+
93
+ interface CurrentPageDetails {
94
+ currentStart:number,
95
+ currentEnd:number,
96
+ total:number
97
+ }
@@ -0,0 +1,8 @@
1
+ .tb-group-label {
2
+ padding-right: 5px;
3
+ }
4
+
5
+ .nested-arrow {
6
+ margin-right: -8px;
7
+ margin-left: -8px;
8
+ }
@@ -0,0 +1,12 @@
1
+ <mat-chip-set>
2
+ <span class="tb-group-label">Group By:</span>
3
+ @for (groupByKey of tableStore.$groupByKeys(); track groupByKey) {
4
+ @if($index > 0){
5
+ <mat-icon class="nested-arrow">arrow_right</mat-icon>
6
+ }
7
+ <mat-chip (removed)="tableStore.removeGroupByKey(groupByKey)">
8
+ {{groupByKey | spaceCase}}
9
+ <mat-icon matChipRemove>cancel</mat-icon>
10
+ </mat-chip>
11
+ }
12
+ </mat-chip-set>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { GroupByListComponent } from './group-by-list.component';
4
+
5
+ describe('GroupByListComponent', () => {
6
+ let component: GroupByListComponent;
7
+ let fixture: ComponentFixture<GroupByListComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ GroupByListComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(GroupByListComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,18 @@
1
+ import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
2
+ import { TableStore } from '../../classes/table-store';
3
+ import { MatChipsModule } from '@angular/material/chips';
4
+ import { MatIconModule } from '@angular/material/icon';
5
+ import { SpaceCasePipe } from '../../../utilities';
6
+
7
+ @Component({
8
+ selector: 'group-by-list',
9
+ templateUrl: './group-by-list.component.html',
10
+ styleUrls: ['./group-by-list.component.css'],
11
+ changeDetection: ChangeDetectionStrategy.OnPush,
12
+ imports: [
13
+ MatChipsModule, MatIconModule, SpaceCasePipe
14
+ ]
15
+ })
16
+ export class GroupByListComponent {
17
+ tableStore = inject(TableStore);
18
+ }
@@ -0,0 +1,105 @@
1
+ @let metaData = $metaData();
2
+
3
+ <button mat-icon-button class="open-menu-icon-button" disableRipple [matMenuTriggerFor]="menu" [matMenuTriggerRestoreFocus]="false">
4
+ <mat-icon class="menu-icon">more_vert</mat-icon>
5
+ </button>
6
+ <mat-menu #menu="matMenu" >
7
+ @if (!(metaData.fieldType === FieldType.NotMapped))
8
+ {
9
+ <button mat-menu-item (click)="tableState.addGroupByKey(metaData.key)">
10
+ <mat-icon color="primary">group</mat-icon>
11
+ <span>Group By</span>
12
+ </button>
13
+ }
14
+ <button mat-menu-item (click)=hideField(metaData.key)>
15
+ <mat-icon color="primary">visibility_off</mat-icon>
16
+ <span>Hide Column</span>
17
+ </button>
18
+ @if (!(metaData.fieldType === FieldType.NotMapped))
19
+ {
20
+ <ng-form #myForm="ngForm" (keydown.enter)="onEnter(myForm.value)" class="tb-header-filter">
21
+ <input type="hidden" name="filterId" [ngModel]="'header-column-' + metaData.key" />
22
+ <input type="hidden" name="filterType" [ngModel]="myFilterType" />
23
+ <input type="hidden" name="key" [ngModel]="metaData.key" />
24
+ <input type="hidden" name="fieldType" [ngModel]="metaData.fieldType" />
25
+
26
+ @if(myFilterType === FilterType.Or || myFilterType === FilterType.In){
27
+ <tb-in-list-filter name='filterValue' [key]='metaData.key' [ngModel]="undefined"/>
28
+ }
29
+ @else if(metaData.fieldType === FieldType.Link || metaData.fieldType === FieldType.String || metaData.fieldType === FieldType.Array || metaData.fieldType === FieldType.Unknown || metaData.fieldType === FieldType.PhoneNumber) {
30
+ <mat-form-field stop-propagation class="font auto-width">
31
+ <mat-icon matPrefix class="search-icon">search</mat-icon>
32
+ <mat-label>{{myFilterType === FilterType.StringDoesNotContain ? 'Does Not Contain...' : 'Contains...'}}</mat-label>
33
+ <input matInput name="filterValue" [ngModel]="undefined"/>
34
+ <span matSuffix [matTooltip]="myFilterType === FilterType.StringDoesNotContain ? 'Contains' : 'Does Not Contain'">
35
+ <button mat-icon-button color="primary" (click)="setStringFilterType()" class="header-filter-icon-button">
36
+ <mat-icon [class]="{'chosen-icon': myFilterType === FilterType.StringDoesNotContain }">
37
+ block
38
+ </mat-icon>
39
+ </button>
40
+ </span>
41
+ </mat-form-field>
42
+ }
43
+ @else if (metaData.fieldType === FieldType.Number || metaData.fieldType === FieldType.Currency) {
44
+ <mat-form-field class="auto-width" stop-propagation>
45
+ <mat-label>{{myFilterType === FilterType.NumberEquals ? 'Equals...' : myFilterType === FilterType.NumberLessThan ? 'Less Than...' : 'More Than...'}}</mat-label>
46
+ <input matInput type='number' name="filterValue" [ngModel]="undefined" />
47
+ <span matPrefix class="tb-header-prefix">
48
+ <button mat-icon-button disableRipple class="header-filter-icon-button" (click)="setFilterType(FilterType.NumberLessThan)"
49
+ [class]="{'chosen-icon': myFilterType === FilterType.NumberLessThan }">
50
+ <mat-icon class="suffix-icons"
51
+ >
52
+ arrow_back_ios</mat-icon>
53
+ </button>
54
+ <button mat-icon-button disableRipple class="header-filter-icon-button" (click)="setFilterType(FilterType.NumberGreaterThan)"
55
+ [class]="{'chosen-icon': myFilterType === FilterType.NumberGreaterThan }" >
56
+ <mat-icon class="suffix-icons">arrow_forward_ios</mat-icon>
57
+ </button>
58
+ <button mat-icon-button disableRipple class="header-filter-icon-button" (click)="setFilterType(FilterType.NumberEquals)"
59
+ [class]="{'chosen-icon': myFilterType === FilterType.NumberEquals }">
60
+ <span class="suffix-icons">=</span>
61
+ </button>
62
+ </span>
63
+ </mat-form-field>
64
+ }
65
+ @else if (metaData.fieldType === FieldType.Boolean) {
66
+ <div>
67
+ <label>
68
+ <mat-icon class="search-icon">filter_list</mat-icon>
69
+ </label>
70
+ <mat-radio-group stop-propagation #ctrl="matRadioGroup" #boolField='ngModel' class="font" name="filterValue" [ngModel]="undefined" >
71
+ <mat-radio-button class="filter-radio-button" (click)="boolField.control.setValue(true);" [value]="true">True</mat-radio-button><br/>
72
+ <mat-radio-button class="filter-radio-button" (click)="boolField.control.setValue(false)" [value]="false">False</mat-radio-button><br/>
73
+ </mat-radio-group>
74
+ </div>
75
+ }
76
+ @else if (metaData.fieldType === FieldType.Date || metaData.fieldType === FieldType.DateTime) {
77
+ <mat-form-field class="font auto-width" stop-propagation >
78
+ <span matPrefix class="tb-header-prefix">
79
+ <button mat-icon-button disableRipple class="header-filter-icon-button" (click)="setFilterType(FilterType.DateOnOrAfter)"
80
+ [class]="{'chosen-icon': myFilterType === FilterType.DateOnOrAfter }">
81
+ <mat-icon class="suffix-icons underline">arrow_forward_ios</mat-icon>
82
+ </button>
83
+ <button mat-icon-button disableRipple class="header-filter-icon-button" (click)="setFilterType(FilterType.DateOnOrBefore)"
84
+ [class]="{'chosen-icon': myFilterType === FilterType.DateOnOrBefore }">
85
+ <mat-icon class="suffix-icons underline">arrow_back_ios</mat-icon>
86
+ </button>
87
+ <button mat-icon-button disableRipple class="header-filter-icon-button" (click)="setFilterType(FilterType.DateIsOn)"
88
+ [class]="{'chosen-icon': myFilterType === FilterType.DateIsOn }">
89
+ <span class="suffix-icons underline"> =</span>
90
+ </button>
91
+ </span>
92
+ <mat-label>{{myFilterType === FilterType.DateIsOn ? 'On...' :
93
+ myFilterType === FilterType.DateOnOrBefore ? 'On or Before...' : 'On or After...'}}</mat-label>
94
+ <input matInput name="filterValue" [ngModel]="undefined" [matDatepicker]="calendar"
95
+ (click)="calendar.open()"/>
96
+ <mat-datepicker-toggle class="date-toggle header-filter-icon-button" matSuffix [for]="calendar" preventEnter></mat-datepicker-toggle>
97
+ <mat-datepicker #calendar></mat-datepicker>
98
+ </mat-form-field>
99
+ }
100
+ <button mat-button (click)="onEnter(myForm.value)" [disabled]="myForm.value.filterValue == undefined" disableRipple>
101
+ Apply
102
+ </button>
103
+ </ng-form>
104
+ }
105
+ </mat-menu>