@one-paragon/angular-utilities 1.2.18 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/action-state/action-state-spinner/action-state-spinner.component.d.ts +12 -0
  2. package/action-state/action-state-ui/action-state-ui.module.d.ts +7 -0
  3. package/{src/action-state/index.ts → action-state/index.d.ts} +4 -8
  4. package/action-state/ngrx-ext/ngrx-ext.module.d.ts +8 -0
  5. package/action-state/ngrx.d.ts +31 -0
  6. package/fesm2022/one-paragon-angular-utilities.mjs +5760 -0
  7. package/fesm2022/one-paragon-angular-utilities.mjs.map +1 -0
  8. package/http-request-state/HttpRequestStateFactory.d.ts +17 -0
  9. package/http-request-state/HttpRequestStateStore.d.ts +58 -0
  10. package/http-request-state/directives/HttpStateDirectiveBase.d.ts +14 -0
  11. package/http-request-state/directives/http-error-state-directive.d.ts +9 -0
  12. package/http-request-state/directives/http-inProgress-state-directive.d.ts +9 -0
  13. package/http-request-state/directives/http-notStarted-state-directive.d.ts +9 -0
  14. package/http-request-state/directives/http-success-state-directive.d.ts +16 -0
  15. package/{src/http-request-state/directives/index.ts → http-request-state/directives/index.d.ts} +5 -5
  16. package/http-request-state/directives/request-state-directive.d.ts +34 -0
  17. package/http-request-state/helpers.d.ts +9 -0
  18. package/http-request-state/http-request-state.d.ts +12 -0
  19. package/http-request-state/http-state-module.d.ts +11 -0
  20. package/{src/http-request-state/index.ts → http-request-state/index.d.ts} +6 -6
  21. package/http-request-state/rxjs/getRequestorBody.d.ts +3 -0
  22. package/http-request-state/rxjs/getRequestorState.d.ts +3 -0
  23. package/{src/http-request-state/rxjs/index.ts → http-request-state/rxjs/index.d.ts} +4 -4
  24. package/http-request-state/rxjs/tapError.d.ts +3 -0
  25. package/http-request-state/rxjs/tapSuccess.d.ts +3 -0
  26. package/http-request-state/types.d.ts +41 -0
  27. package/index.d.ts +5 -0
  28. package/ngrx/actionable-selector.d.ts +31 -0
  29. package/ngrx/index.d.ts +1 -0
  30. package/package.json +28 -16
  31. package/{src/public-api.ts → public-api.d.ts} +16 -35
  32. package/rxjs/defaultShareReplay.d.ts +2 -0
  33. package/{src/rxjs/index.ts → rxjs/index.d.ts} +5 -5
  34. package/rxjs/mapError.d.ts +2 -0
  35. package/rxjs/rxjs-operators.d.ts +13 -0
  36. package/rxjs/subjectifier.d.ts +8 -0
  37. package/rxjs/subscriber.directive.d.ts +14 -0
  38. package/table-builder/classes/DefaultSettings.d.ts +9 -0
  39. package/table-builder/classes/MatTableObservableDataSource.d.ts +9 -0
  40. package/table-builder/classes/TableBuilderConfig.d.ts +23 -0
  41. package/table-builder/classes/TableBuilderDataSource.d.ts +12 -0
  42. package/table-builder/classes/TableState.d.ts +66 -0
  43. package/table-builder/classes/data-store.d.ts +8 -0
  44. package/{src/table-builder/classes/display-col.ts → table-builder/classes/display-col.d.ts} +5 -5
  45. package/table-builder/classes/filter-info.d.ts +35 -0
  46. package/table-builder/classes/table-builder-general-settings.d.ts +85 -0
  47. package/table-builder/classes/table-builder.d.ts +18 -0
  48. package/table-builder/classes/table-store.d.ts +138 -0
  49. package/table-builder/components/array-column.component.d.ts +15 -0
  50. package/table-builder/components/column-builder/column-builder.component.d.ts +50 -0
  51. package/table-builder/components/column-builder/column-helpers.d.ts +36 -0
  52. package/table-builder/components/date-filter/date-filter.component.d.ts +37 -0
  53. package/table-builder/components/date-time-filter/date-time-filter.component.d.ts +37 -0
  54. package/table-builder/components/filter/filter.component.d.ts +46 -0
  55. package/table-builder/components/filter/in-list/in-list-filter.component.d.ts +24 -0
  56. package/table-builder/components/gen-col-displayer/gen-col-displayer.component.d.ts +17 -0
  57. package/table-builder/components/generic-table/generic-table.component.d.ts +84 -0
  58. package/table-builder/components/generic-table/paginator.component.d.ts +30 -0
  59. package/table-builder/components/group-by-list/group-by-list.component.d.ts +7 -0
  60. package/table-builder/components/header-menu/header-menu.component.d.ts +51 -0
  61. package/table-builder/components/in-filter/in-filter.component.d.ts +20 -0
  62. package/{src/table-builder/components/index.ts → table-builder/components/index.d.ts} +9 -9
  63. package/table-builder/components/initialization-component/initialization-component.d.ts +13 -0
  64. package/table-builder/components/link-column.component.d.ts +25 -0
  65. package/table-builder/components/number-filter/number-filter.component.d.ts +39 -0
  66. package/table-builder/components/profiles-menu/profiles-menu.component.d.ts +32 -0
  67. package/table-builder/components/scroll-strategy.d.ts +22 -0
  68. package/table-builder/components/sort-menu/sort-menu.component-store.d.ts +24 -0
  69. package/table-builder/components/sort-menu/sort-menu.component.d.ts +24 -0
  70. package/{src/table-builder/components/table-container/table-container-imports.ts → table-builder/components/table-container/table-container-imports.d.ts} +14 -32
  71. package/table-builder/components/table-container/table-container.d.ts +81 -0
  72. package/table-builder/components/table-container/table-container.helpers/data-state.helpers.d.ts +6 -0
  73. package/table-builder/components/table-container/table-container.helpers/filter-state.helpers.d.ts +17 -0
  74. package/table-builder/components/table-container/table-container.helpers/groupBy.helpers.d.ts +17 -0
  75. package/table-builder/components/table-container/table-container.helpers/sort-state.helpers.d.ts +8 -0
  76. package/table-builder/components/table-container/tableProps.d.ts +12 -0
  77. package/table-builder/components/table-container/virtual-scroll-container.d.ts +36 -0
  78. package/table-builder/components/table-container-filter/filter-list/filter-list.component.d.ts +15 -0
  79. package/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.d.ts +12 -0
  80. package/table-builder/components/table-container-filter/table-wrapper-filter-store.d.ts +14 -0
  81. package/table-builder/directives/custom-cell-directive.d.ts +33 -0
  82. package/{src/table-builder/directives/index.ts → table-builder/directives/index.d.ts} +5 -6
  83. package/table-builder/directives/multi-sort.directive.d.ts +10 -0
  84. package/table-builder/directives/resize-column.directive.d.ts +43 -0
  85. package/table-builder/directives/table-wrapper.directive.d.ts +8 -0
  86. package/table-builder/directives/tb-filter.directive.d.ts +115 -0
  87. package/table-builder/enums/filterTypes.d.ts +36 -0
  88. package/table-builder/functions/boolean-filter-function.d.ts +3 -0
  89. package/table-builder/functions/date-filter-function.d.ts +4 -0
  90. package/table-builder/functions/download-data.d.ts +1 -0
  91. package/table-builder/functions/null-filter-function.d.ts +2 -0
  92. package/table-builder/functions/number-filter-function.d.ts +4 -0
  93. package/table-builder/functions/sort-data-function.d.ts +6 -0
  94. package/table-builder/functions/string-filter-function.d.ts +5 -0
  95. package/{src/table-builder/interfaces/ColumnInfo.ts → table-builder/interfaces/ColumnInfo.d.ts} +6 -7
  96. package/{src/table-builder/interfaces/dictionary.ts → table-builder/interfaces/dictionary.d.ts} +3 -3
  97. package/table-builder/interfaces/report-def.d.ts +147 -0
  98. package/table-builder/ngrx/tableBuilderStateStore.d.ts +70 -0
  99. package/table-builder/pipes/column-total.pipe.d.ts +8 -0
  100. package/table-builder/pipes/format-filter-type.pipe.d.ts +8 -0
  101. package/table-builder/pipes/format-filter-value.pipe.d.ts +12 -0
  102. package/table-builder/pipes/key-display.d.ts +10 -0
  103. package/table-builder/services/export-to-csv.service.d.ts +14 -0
  104. package/table-builder/services/link-creator.service.d.ts +16 -0
  105. package/table-builder/services/table-template-service.d.ts +14 -0
  106. package/table-builder/services/transform-creator.d.ts +16 -0
  107. package/table-builder/table-builder.module.d.ts +21 -0
  108. package/utilities/array-helpers.d.ts +1 -0
  109. package/utilities/directives/auto-focus.directive.d.ts +9 -0
  110. package/utilities/directives/clickEmitterDirective.d.ts +7 -0
  111. package/utilities/directives/clickSubject.d.ts +9 -0
  112. package/utilities/directives/conditional-classes.directive.d.ts +13 -0
  113. package/utilities/directives/dialog-service.d.ts +10 -0
  114. package/utilities/directives/dialog.d.ts +44 -0
  115. package/utilities/directives/mat-toggle-group-directive.d.ts +21 -0
  116. package/utilities/directives/prevent-enter.directive.d.ts +6 -0
  117. package/utilities/directives/stop-propagation.directive.d.ts +7 -0
  118. package/utilities/directives/styler.d.ts +15 -0
  119. package/utilities/directives/trim-whitespace.directive.d.ts +7 -0
  120. package/{src/utilities/index.ts → utilities/index.d.ts} +15 -22
  121. package/utilities/module.d.ts +19 -0
  122. package/utilities/pipes/function.pipe.d.ts +7 -0
  123. package/utilities/pipes/phone.pipe.d.ts +7 -0
  124. package/utilities/pipes/space-case.pipes.d.ts +17 -0
  125. package/karma.conf.js +0 -44
  126. package/ng-package.json +0 -7
  127. package/src/action-state/action-state-spinner/action-state-spinner.component.css +0 -16
  128. package/src/action-state/action-state-spinner/action-state-spinner.component.html +0 -6
  129. package/src/action-state/action-state-spinner/action-state-spinner.component.spec.ts +0 -25
  130. package/src/action-state/action-state-spinner/action-state-spinner.component.ts +0 -26
  131. package/src/action-state/action-state-ui/action-state-ui.module.ts +0 -13
  132. package/src/action-state/ngrx-ext/ngrx-ext.module.ts +0 -15
  133. package/src/action-state/ngrx.ts +0 -69
  134. package/src/http-request-state/HttpRequestStateFactory.ts +0 -66
  135. package/src/http-request-state/HttpRequestStateStore.ts +0 -191
  136. package/src/http-request-state/directives/HttpStateDirectiveBase.ts +0 -29
  137. package/src/http-request-state/directives/http-error-state-directive.ts +0 -21
  138. package/src/http-request-state/directives/http-inProgress-state-directive.ts +0 -19
  139. package/src/http-request-state/directives/http-notStarted-state-directive.ts +0 -19
  140. package/src/http-request-state/directives/http-success-state-directive.ts +0 -29
  141. package/src/http-request-state/directives/request-state-directive.spec.ts +0 -72
  142. package/src/http-request-state/directives/request-state-directive.ts +0 -78
  143. package/src/http-request-state/helpers.ts +0 -30
  144. package/src/http-request-state/http-request-state.ts +0 -69
  145. package/src/http-request-state/http-state-module.ts +0 -23
  146. package/src/http-request-state/observable.spec.ts +0 -43
  147. package/src/http-request-state/rxjs/getRequestorBody.ts +0 -10
  148. package/src/http-request-state/rxjs/getRequestorState.ts +0 -8
  149. package/src/http-request-state/rxjs/tapError.ts +0 -16
  150. package/src/http-request-state/rxjs/tapSuccess.ts +0 -16
  151. package/src/http-request-state/strategies.spec.ts +0 -42
  152. package/src/http-request-state/types.ts +0 -55
  153. package/src/ngrx/actionable-selector.ts +0 -152
  154. package/src/ngrx/index.ts +0 -1
  155. package/src/rxjs/defaultShareReplay.ts +0 -8
  156. package/src/rxjs/mapError.ts +0 -8
  157. package/src/rxjs/rxjs-operators.ts +0 -132
  158. package/src/rxjs/subjectifier.ts +0 -17
  159. package/src/rxjs/subscriber.directive.ts +0 -57
  160. package/src/specs/clickSubject.spec.ts +0 -95
  161. package/src/specs/dialog.spec.ts +0 -101
  162. package/src/specs/toggleGroupDirective.spec.ts +0 -229
  163. package/src/table-builder/classes/DefaultSettings.ts +0 -11
  164. package/src/table-builder/classes/MatTableObservableDataSource.ts +0 -23
  165. package/src/table-builder/classes/TableBuilderConfig.ts +0 -36
  166. package/src/table-builder/classes/TableBuilderDataSource.ts +0 -61
  167. package/src/table-builder/classes/TableState.ts +0 -93
  168. package/src/table-builder/classes/data-store.ts +0 -10
  169. package/src/table-builder/classes/filter-info.ts +0 -108
  170. package/src/table-builder/classes/table-builder-general-settings.ts +0 -141
  171. package/src/table-builder/classes/table-builder.ts +0 -95
  172. package/src/table-builder/classes/table-store.ts +0 -476
  173. package/src/table-builder/components/array-column.component.ts +0 -36
  174. package/src/table-builder/components/column-builder/column-builder.component.html +0 -61
  175. package/src/table-builder/components/column-builder/column-builder.component.scss +0 -43
  176. package/src/table-builder/components/column-builder/column-builder.component.spec.ts +0 -49
  177. package/src/table-builder/components/column-builder/column-builder.component.ts +0 -146
  178. package/src/table-builder/components/column-builder/column-helpers.ts +0 -52
  179. package/src/table-builder/components/date-filter/date-filter.component.html +0 -23
  180. package/src/table-builder/components/date-filter/date-filter.component.ts +0 -24
  181. package/src/table-builder/components/date-time-filter/date-time-filter.component.html +0 -9
  182. package/src/table-builder/components/date-time-filter/date-time-filter.component.ts +0 -22
  183. package/src/table-builder/components/filter/filter.component.html +0 -91
  184. package/src/table-builder/components/filter/filter.component.scss +0 -60
  185. package/src/table-builder/components/filter/filter.component.spec.ts +0 -87
  186. package/src/table-builder/components/filter/filter.component.ts +0 -60
  187. package/src/table-builder/components/filter/in-list/in-list-filter.component.ts +0 -93
  188. package/src/table-builder/components/gen-col-displayer/gen-col-displayer.component.html +0 -55
  189. package/src/table-builder/components/gen-col-displayer/gen-col-displayer.component.scss +0 -57
  190. package/src/table-builder/components/gen-col-displayer/gen-col-displayer.component.ts +0 -46
  191. package/src/table-builder/components/generic-table/generic-table.component.html +0 -77
  192. package/src/table-builder/components/generic-table/generic-table.component.scss +0 -38
  193. package/src/table-builder/components/generic-table/generic-table.component.ts +0 -325
  194. package/src/table-builder/components/generic-table/paginator.component.ts +0 -99
  195. package/src/table-builder/components/group-by-list/group-by-list.component.css +0 -8
  196. package/src/table-builder/components/group-by-list/group-by-list.component.html +0 -12
  197. package/src/table-builder/components/group-by-list/group-by-list.component.spec.ts +0 -23
  198. package/src/table-builder/components/group-by-list/group-by-list.component.ts +0 -21
  199. package/src/table-builder/components/header-menu/header-menu.component.html +0 -104
  200. package/src/table-builder/components/header-menu/header-menu.component.scss +0 -96
  201. package/src/table-builder/components/header-menu/header-menu.component.ts +0 -99
  202. package/src/table-builder/components/in-filter/in-filter.component.css +0 -3
  203. package/src/table-builder/components/in-filter/in-filter.component.html +0 -20
  204. package/src/table-builder/components/in-filter/in-filter.component.ts +0 -66
  205. package/src/table-builder/components/initialization-component/initialization-component.html +0 -29
  206. package/src/table-builder/components/initialization-component/initialization-component.ts +0 -24
  207. package/src/table-builder/components/link-column.component.ts +0 -47
  208. package/src/table-builder/components/number-filter/number-filter.component.css +0 -10
  209. package/src/table-builder/components/number-filter/number-filter.component.html +0 -19
  210. package/src/table-builder/components/number-filter/number-filter.component.spec.ts +0 -30
  211. package/src/table-builder/components/number-filter/number-filter.component.ts +0 -25
  212. package/src/table-builder/components/profiles-menu/profiles-menu.component.html +0 -78
  213. package/src/table-builder/components/profiles-menu/profiles-menu.component.scss +0 -126
  214. package/src/table-builder/components/profiles-menu/profiles-menu.component.spec.ts +0 -23
  215. package/src/table-builder/components/profiles-menu/profiles-menu.component.ts +0 -65
  216. package/src/table-builder/components/scroll-strategy.ts +0 -76
  217. package/src/table-builder/components/sort-menu/sort-menu.component-store.ts +0 -66
  218. package/src/table-builder/components/sort-menu/sort-menu.component.html +0 -111
  219. package/src/table-builder/components/sort-menu/sort-menu.component.scss +0 -119
  220. package/src/table-builder/components/sort-menu/sort-menu.component.ts +0 -98
  221. package/src/table-builder/components/table-container/table-container.helpers/data-state.helpers.ts +0 -141
  222. package/src/table-builder/components/table-container/table-container.helpers/filter-state.helpers.ts +0 -106
  223. package/src/table-builder/components/table-container/table-container.helpers/groupBy.helpers.ts +0 -86
  224. package/src/table-builder/components/table-container/table-container.helpers/sort-state.helpers.ts +0 -45
  225. package/src/table-builder/components/table-container/table-container.html +0 -94
  226. package/src/table-builder/components/table-container/table-container.scss +0 -47
  227. package/src/table-builder/components/table-container/table-container.spec.ts +0 -154
  228. package/src/table-builder/components/table-container/table-container.ts +0 -356
  229. package/src/table-builder/components/table-container/tableProps.ts +0 -20
  230. package/src/table-builder/components/table-container/virtual-scroll-container.ts +0 -156
  231. package/src/table-builder/components/table-container-filter/filter-list/filter-list.component.html +0 -31
  232. package/src/table-builder/components/table-container-filter/filter-list/filter-list.component.ts +0 -46
  233. package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.css +0 -42
  234. package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.html +0 -10
  235. package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.spec.ts +0 -85
  236. package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.ts +0 -33
  237. package/src/table-builder/components/table-container-filter/table-wrapper-filter-store.ts +0 -23
  238. package/src/table-builder/directives/custom-cell-directive.ts +0 -58
  239. package/src/table-builder/directives/multi-sort.directive.spec.ts +0 -124
  240. package/src/table-builder/directives/multi-sort.directive.ts +0 -51
  241. package/src/table-builder/directives/resize-column.directive.ts +0 -108
  242. package/src/table-builder/directives/table-wrapper.directive.ts +0 -14
  243. package/src/table-builder/directives/tb-filter.directive.ts +0 -382
  244. package/src/table-builder/enums/filterTypes.ts +0 -40
  245. package/src/table-builder/functions/boolean-filter-function.ts +0 -12
  246. package/src/table-builder/functions/date-filter-function.ts +0 -68
  247. package/src/table-builder/functions/download-data.ts +0 -11
  248. package/src/table-builder/functions/null-filter-function.ts +0 -9
  249. package/src/table-builder/functions/number-filter-function.ts +0 -41
  250. package/src/table-builder/functions/sort-data-function.ts +0 -23
  251. package/src/table-builder/functions/string-filter-function.ts +0 -51
  252. package/src/table-builder/interfaces/column-template.ts +0 -9
  253. package/src/table-builder/interfaces/report-def.ts +0 -155
  254. package/src/table-builder/ngrx/tableBuilderStateStore.ts +0 -199
  255. package/src/table-builder/pipes/column-total.pipe.ts +0 -17
  256. package/src/table-builder/pipes/format-filter-type.pipe.ts +0 -12
  257. package/src/table-builder/pipes/format-filter-value.pipe.ts +0 -42
  258. package/src/table-builder/pipes/key-display.ts +0 -16
  259. package/src/table-builder/services/export-to-csv.service.ts +0 -78
  260. package/src/table-builder/services/link-creator.service.ts +0 -67
  261. package/src/table-builder/services/table-template-service.ts +0 -59
  262. package/src/table-builder/services/transform-creator.ts +0 -95
  263. package/src/table-builder/specs/table-custom-filters.spec.ts +0 -262
  264. package/src/table-builder/styles/collapser.styles.scss +0 -16
  265. package/src/table-builder/table-builder.module.ts +0 -73
  266. package/src/test.ts +0 -17
  267. package/src/utilities/array-helpers.ts +0 -13
  268. package/src/utilities/directives/auto-focus.directive.ts +0 -21
  269. package/src/utilities/directives/clickEmitterDirective.ts +0 -16
  270. package/src/utilities/directives/clickSubject.ts +0 -20
  271. package/src/utilities/directives/conditional-classes.directive.ts +0 -36
  272. package/src/utilities/directives/dialog-service.ts +0 -19
  273. package/src/utilities/directives/dialog.ts +0 -144
  274. package/src/utilities/directives/mat-toggle-group-directive.ts +0 -61
  275. package/src/utilities/directives/prevent-enter.directive.ts +0 -13
  276. package/src/utilities/directives/stop-propagation.directive.ts +0 -20
  277. package/src/utilities/directives/styler.ts +0 -40
  278. package/src/utilities/directives/trim-whitespace.directive.ts +0 -21
  279. package/src/utilities/module.ts +0 -55
  280. package/src/utilities/pipes/function.pipe.ts +0 -16
  281. package/src/utilities/pipes/phone.pipe.ts +0 -15
  282. package/src/utilities/pipes/space-case.pipes.spec.ts +0 -47
  283. package/src/utilities/pipes/space-case.pipes.ts +0 -23
  284. package/tsconfig.lib.json +0 -19
  285. package/tsconfig.lib.prod.json +0 -10
  286. package/tsconfig.spec.json +0 -17
@@ -0,0 +1,12 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { TableStore } from '../classes/table-store';
3
+ import { Observable } from 'rxjs';
4
+ import { FilterType } from '../enums/filterTypes';
5
+ import * as i0 from "@angular/core";
6
+ export declare class FormatFilterValuePipe implements PipeTransform {
7
+ tableState: TableStore;
8
+ private datePipe;
9
+ transform(value: any, key: string, filterType: FilterType): Observable<string>;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormatFilterValuePipe, never>;
11
+ static ɵpipe: i0.ɵɵPipeDeclaration<FormatFilterValuePipe, "formatFilterValue", true>;
12
+ }
@@ -0,0 +1,10 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { TableStore } from '../classes/table-store';
3
+ import { Observable } from 'rxjs';
4
+ import * as i0 from "@angular/core";
5
+ export declare class KeyDisplayPipe implements PipeTransform {
6
+ tableState: TableStore;
7
+ transform(key: string): Observable<string>;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<KeyDisplayPipe, never>;
9
+ static ɵpipe: i0.ɵɵPipeDeclaration<KeyDisplayPipe, "keyDisplay", true>;
10
+ }
@@ -0,0 +1,14 @@
1
+ import { TableStore } from '../classes/table-store';
2
+ import { MetaData } from '../interfaces/report-def';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ExportToCsvService<T> {
5
+ state: TableStore;
6
+ private config;
7
+ private datePipe;
8
+ exportToCsv: (data: T[]) => void;
9
+ csvData: (data: Array<T>, metaData: MetaData<T>[]) => string;
10
+ metaToField: (meta: MetaData<T>, row: T) => any;
11
+ private transform;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<ExportToCsvService<any>, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<ExportToCsvService<any>>;
14
+ }
@@ -0,0 +1,16 @@
1
+ import { MetaData } from "../interfaces/report-def";
2
+ import { Dictionary } from "@ngrx/entity";
3
+ import { QueryParamsHandling } from "@angular/router";
4
+ export declare function createLinkCreatorDict<T>(metaDatas: MetaData<T>[]): Dictionary<LinkInfo>;
5
+ export declare function createLinkCreator<T>(metaData: MetaData<T>): LinkInfo;
6
+ export interface LinkInfo {
7
+ link: (element: any) => string;
8
+ target: string;
9
+ useRouterLink: boolean;
10
+ routerLinkOptions?: {
11
+ queryParams: (element: any) => any;
12
+ fragment?: string;
13
+ preserveFragment?: boolean;
14
+ queryParamsHandling?: QueryParamsHandling;
15
+ };
16
+ }
@@ -0,0 +1,14 @@
1
+ import { TemplateRef } from "@angular/core";
2
+ import { MetaData } from "../interfaces/report-def";
3
+ import { InitializationComponent } from "../components/initialization-component/initialization-component";
4
+ import * as i0 from "@angular/core";
5
+ export declare class TableTemplateService {
6
+ instance: InitializationComponent;
7
+ templates: any;
8
+ initTemplates(): void;
9
+ getTemplate(metaData: MetaData): TemplateRef<any>;
10
+ constructor();
11
+ tableConfig: import("../classes/TableBuilderConfig").TableBuilderConfig;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableTemplateService, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<TableTemplateService>;
14
+ }
@@ -0,0 +1,16 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { MetaData } from '../interfaces/report-def';
3
+ import * as i0 from "@angular/core";
4
+ export declare function isPipe(o: any): o is PipeTransform;
5
+ export declare class TransformCreator {
6
+ private datePipe;
7
+ private currencyPipe;
8
+ private phonePipe;
9
+ private casePipe;
10
+ private config;
11
+ createTransformer(metaData: MetaData<any, any>, noIcons?: boolean): ((value: any, ...args: any[]) => any);
12
+ createItemTransformer: <T = any, AdditionalFields extends string[] = []>(metaData: MetaData<T, AdditionalFields>, noIcons?: boolean, mutate?: boolean) => (t: T) => void;
13
+ createItemTransformers: <T = any, AdditionalFields extends string[] = []>(metaDatas: MetaData<T, AdditionalFields>[], noIcons?: boolean, mutate?: boolean) => (t: T) => T;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<TransformCreator, never>;
15
+ static ɵprov: i0.ɵɵInjectableDeclaration<TransformCreator>;
16
+ }
@@ -0,0 +1,21 @@
1
+ import { ModuleWithProviders } from '@angular/core';
2
+ import { TableBuilderConfig } from './classes/TableBuilderConfig';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "@angular/common";
5
+ import * as i2 from "@angular/material/dialog";
6
+ import * as i3 from "@angular/material/core";
7
+ import * as i4 from "@angular/router";
8
+ import * as i5 from "./components/table-container/table-container";
9
+ import * as i6 from "./components/generic-table/generic-table.component";
10
+ import * as i7 from "./directives/custom-cell-directive";
11
+ import * as i8 from "./components/filter/filter.component";
12
+ import * as i9 from "./directives/tb-filter.directive";
13
+ import * as i10 from "./directives/table-wrapper.directive";
14
+ import * as i11 from "./directives/resize-column.directive";
15
+ import * as i12 from "../utilities/module";
16
+ export declare class TableBuilderModule {
17
+ static forRoot(config: TableBuilderConfig): ModuleWithProviders<TableBuilderModule>;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableBuilderModule, never>;
19
+ static ɵmod: i0.ɵɵNgModuleDeclaration<TableBuilderModule, never, [typeof i1.CommonModule, typeof i2.MatDialogModule, typeof i3.MatNativeDateModule, typeof i4.RouterModule, typeof i5.TableContainerComponent, typeof i6.GenericTableComponent, typeof i5.TableContainerComponent, typeof i7.CustomCellDirective, typeof i8.FilterComponent, typeof i9.MatSlideToggleTbFilterDirective, typeof i9.MatRadioButtonTbFilterDirective, typeof i9.MatOptionTbFilterDirective, typeof i9.MatCheckboxTbFilterDirective, typeof i9.MatButtonToggleFilterDirective, typeof i9.TableFilterDirective, typeof i9.TableFilterStringContainsDirective, typeof i10.TableWrapperDirective, typeof i11.ResizeColumnDirective, typeof i12.UtilitiesModule], [typeof i6.GenericTableComponent, typeof i5.TableContainerComponent, typeof i7.CustomCellDirective, typeof i8.FilterComponent, typeof i9.MatSlideToggleTbFilterDirective, typeof i9.MatRadioButtonTbFilterDirective, typeof i9.MatOptionTbFilterDirective, typeof i9.MatCheckboxTbFilterDirective, typeof i9.MatButtonToggleFilterDirective, typeof i9.TableFilterDirective, typeof i9.TableFilterStringContainsDirective, typeof i10.TableWrapperDirective, typeof i11.ResizeColumnDirective, typeof i12.UtilitiesModule]>;
20
+ static ɵinj: i0.ɵɵInjectorDeclaration<TableBuilderModule>;
21
+ }
@@ -0,0 +1 @@
1
+ export declare const replaceInArrayWithClone: <T = any>(arr: T[], findMeth: (t: T) => boolean, actionOnClone?: (t: T) => any) => T[];
@@ -0,0 +1,9 @@
1
+ import { AfterViewInit } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class AutoFocusDirective implements AfterViewInit {
4
+ private elementRef;
5
+ autoFocus: boolean;
6
+ ngAfterViewInit(): void;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<AutoFocusDirective, never>;
8
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AutoFocusDirective, "[autoFocus]", never, { "autoFocus": { "alias": "autoFocus"; "required": false; }; }, {}, never, never, true, never>;
9
+ }
@@ -0,0 +1,7 @@
1
+ import { Subject } from 'rxjs';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ClickEmitterDirective extends Subject<boolean> {
4
+ constructor();
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<ClickEmitterDirective, never>;
6
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ClickEmitterDirective, "[clickEmitter]", ["clickEmitter"], {}, {}, never, never, true, never>;
7
+ }
@@ -0,0 +1,9 @@
1
+ import { Subject } from 'rxjs';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ClickSubjectDirective<T = boolean> extends Subject<T> {
4
+ constructor();
5
+ _val: T;
6
+ set clickSubject(val: T);
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<ClickSubjectDirective<any>, never>;
8
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ClickSubjectDirective<any>, "[clickSubject]", ["clickSubject"], { "clickSubject": { "alias": "clickSubject"; "required": false; }; }, {}, never, never, true, never>;
9
+ }
@@ -0,0 +1,13 @@
1
+ import { SimpleChanges } from '@angular/core';
2
+ import { Dictionary, Predicate } from '@ngrx/entity';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ConditionalClassesDirective {
5
+ private el;
6
+ private renderer;
7
+ element?: any;
8
+ classes?: Dictionary<Predicate<any>>;
9
+ classesApplied: string[];
10
+ ngOnChanges(changes: SimpleChanges): void;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConditionalClassesDirective, never>;
12
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ConditionalClassesDirective, "[conditionalClasses]", never, { "element": { "alias": "element"; "required": false; }; "classes": { "alias": "conditionalClasses"; "required": false; }; }, {}, never, never, true, never>;
13
+ }
@@ -0,0 +1,10 @@
1
+ import { MatDialogRef } from '@angular/material/dialog';
2
+ import * as i0 from "@angular/core";
3
+ export declare class DialogService {
4
+ allOpenOpDialogs: MatDialogRef<any>[];
5
+ addDialogRef(ref: MatDialogRef<any>): void;
6
+ removeDialogRef(ref: MatDialogRef<any>): void;
7
+ closeAllOpDialogs(): void;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<DialogService, never>;
9
+ static ɵprov: i0.ɵɵInjectableDeclaration<DialogService>;
10
+ }
@@ -0,0 +1,44 @@
1
+ import { TemplateRef, EventEmitter, Injector, Signal } from '@angular/core';
2
+ import { MatDialogRef, MatDialogConfig } from '@angular/material/dialog';
3
+ import { Observable, Subject } from 'rxjs';
4
+ import * as i0 from "@angular/core";
5
+ interface DialogViewContext<T> {
6
+ $implicit: T;
7
+ opDialog: T;
8
+ close: () => void;
9
+ }
10
+ export declare class DialogWrapper<T = any> {
11
+ private vcr;
12
+ viewEmbedded: boolean;
13
+ viewContext: DialogViewContext<T>;
14
+ set template(tmpl: TemplateRef<DialogViewContext<T>>);
15
+ set close(closeMethod: () => void);
16
+ set data(value: T);
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<DialogWrapper<any>, never>;
18
+ static ɵcmp: i0.ɵɵComponentDeclaration<DialogWrapper<any>, "dialog-wrapper", never, {}, {}, never, never, true, never>;
19
+ }
20
+ export declare class DialogDirective<T> {
21
+ private templateRef;
22
+ private dialog;
23
+ private service;
24
+ opDialogClosed: EventEmitter<boolean>;
25
+ _dialogConfig: MatDialogConfig<T>;
26
+ opDialogAddDialogClass: boolean;
27
+ set opDialogConfig(config: MatDialogConfig<T>);
28
+ get opDialogConfig(): MatDialogConfig<T>;
29
+ injector: Injector;
30
+ subscriber: import("../../rxjs").Subscriber;
31
+ set setControl(i: Observable<T> | Signal<T>);
32
+ nativeElement?: HTMLElement;
33
+ dialogRef?: MatDialogRef<any, boolean>;
34
+ componentWrapper?: DialogWrapper<T>;
35
+ _data: Subject<Observable<T>>;
36
+ close(): void;
37
+ initDialog(): void;
38
+ setDataAndState: (data: T) => void;
39
+ setDialogState(open: boolean): void;
40
+ static ngTemplateContextGuard<T>(dir: DialogDirective<T>, ctx: any): ctx is DialogViewContext<Exclude<T, false | 0 | '' | null | undefined>>;
41
+ static ɵfac: i0.ɵɵFactoryDeclaration<DialogDirective<any>, never>;
42
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DialogDirective<any>, "[opDialog]", never, { "opDialogAddDialogClass": { "alias": "opDialogAddDialogClass"; "required": false; }; "opDialogConfig": { "alias": "opDialogConfig"; "required": false; }; "setControl": { "alias": "opDialog"; "required": false; }; "nativeElement": { "alias": "opDialogOrigin"; "required": false; }; }, { "opDialogClosed": "opDialogClosed"; }, never, never, true, never>;
43
+ }
44
+ export {};
@@ -0,0 +1,21 @@
1
+ import { QueryList } from "@angular/core";
2
+ import { MatSlideToggle } from "@angular/material/slide-toggle";
3
+ import { Observable } from "rxjs";
4
+ import * as i0 from "@angular/core";
5
+ export declare class MatSlideToggleGroupDirective {
6
+ allowMultiple: boolean;
7
+ _toggles: QueryList<MatSlideToggle>;
8
+ set toggles(val: QueryList<MatSlideToggle>);
9
+ private _ready;
10
+ get valueEmitter(): Observable<{
11
+ [key: string]: boolean;
12
+ }>;
13
+ getInitValue(): {
14
+ [k: string]: boolean;
15
+ };
16
+ getObs(): Observable<{
17
+ [k: string]: boolean;
18
+ }>;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<MatSlideToggleGroupDirective, never>;
20
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MatSlideToggleGroupDirective, "[opMatSlideToggleGroup]", never, { "allowMultiple": { "alias": "allowMultiple"; "required": false; }; }, { "valueEmitter": "valueEmitter"; }, ["toggles"], never, true, never>;
21
+ }
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class PreventEnterDirective {
3
+ onKeyDown(): boolean;
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<PreventEnterDirective, never>;
5
+ static ɵdir: i0.ɵɵDirectiveDeclaration<PreventEnterDirective, "preventEnter", never, {}, {}, never, never, true, never>;
6
+ }
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class StopPropagationDirective {
3
+ onClick(event: any): void;
4
+ onMousedown(event: any): void;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<StopPropagationDirective, never>;
6
+ static ɵdir: i0.ɵɵDirectiveDeclaration<StopPropagationDirective, "[stop-propagation]", never, {}, {}, never, never, true, never>;
7
+ }
@@ -0,0 +1,15 @@
1
+ import { Dictionary } from '@ngrx/entity';
2
+ import * as i0 from "@angular/core";
3
+ export declare class StylerDirective {
4
+ private el;
5
+ private renderer;
6
+ stylesApplied: Dictionary<string>;
7
+ element?: any;
8
+ set styler(styles: StylerStyle);
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<StylerDirective, never>;
10
+ static ɵdir: i0.ɵɵDirectiveDeclaration<StylerDirective, "[styler]", never, { "element": { "alias": "element"; "required": false; }; "styler": { "alias": "styler"; "required": false; }; }, {}, never, never, true, never>;
11
+ }
12
+ export type StylerStyle = Dictionary<string | {
13
+ condition: ((t: any) => boolean) | true;
14
+ value: ((t: any) => string) | string;
15
+ }>;
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class TrimWhitespaceDirective {
3
+ private elem;
4
+ onBlur(): void;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<TrimWhitespaceDirective, never>;
6
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TrimWhitespaceDirective, "input[trimWhitespace]", never, {}, {}, never, never, true, never>;
7
+ }
@@ -1,22 +1,15 @@
1
- export * from './directives/prevent-enter.directive';
2
- export * from './directives/stop-propagation.directive';
3
- export * from './directives/auto-focus.directive';
4
- export * from './directives/clickSubject';
5
- export * from './directives/clickEmitterDirective';
6
- export * from './directives/dialog';
7
- export * from './directives/styler';
8
- export * from './directives/mat-toggle-group-directive';
9
- export * from './directives/trim-whitespace.directive';
10
-
11
- export * from './pipes/function.pipe';
12
- export * from './pipes/phone.pipe';
13
- export * from './pipes/space-case.pipes';
14
-
15
- export * from './directives/dialog-service';
16
-
17
- export * from './directives/conditional-classes.directive'
18
-
19
-
20
- export * from './module';
21
-
22
-
1
+ export * from './directives/prevent-enter.directive';
2
+ export * from './directives/stop-propagation.directive';
3
+ export * from './directives/auto-focus.directive';
4
+ export * from './directives/clickSubject';
5
+ export * from './directives/clickEmitterDirective';
6
+ export * from './directives/dialog';
7
+ export * from './directives/styler';
8
+ export * from './directives/mat-toggle-group-directive';
9
+ export * from './directives/trim-whitespace.directive';
10
+ export * from './pipes/function.pipe';
11
+ export * from './pipes/phone.pipe';
12
+ export * from './pipes/space-case.pipes';
13
+ export * from './directives/dialog-service';
14
+ export * from './directives/conditional-classes.directive';
15
+ export * from './module';
@@ -0,0 +1,19 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./pipes/space-case.pipes";
3
+ import * as i2 from "./pipes/phone.pipe";
4
+ import * as i3 from "./pipes/function.pipe";
5
+ import * as i4 from "./directives/stop-propagation.directive";
6
+ import * as i5 from "./directives/styler";
7
+ import * as i6 from "./directives/prevent-enter.directive";
8
+ import * as i7 from "./directives/auto-focus.directive";
9
+ import * as i8 from "./directives/trim-whitespace.directive";
10
+ import * as i9 from "./directives/clickSubject";
11
+ import * as i10 from "./directives/clickEmitterDirective";
12
+ import * as i11 from "./directives/dialog";
13
+ import * as i12 from "./directives/mat-toggle-group-directive";
14
+ import * as i13 from "./directives/conditional-classes.directive";
15
+ export declare class UtilitiesModule {
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<UtilitiesModule, never>;
17
+ static ɵmod: i0.ɵɵNgModuleDeclaration<UtilitiesModule, never, [typeof i1.SpaceCasePipe, typeof i2.PhoneNumberPipe, typeof i3.FunctionPipe, typeof i4.StopPropagationDirective, typeof i5.StylerDirective, typeof i6.PreventEnterDirective, typeof i7.AutoFocusDirective, typeof i8.TrimWhitespaceDirective, typeof i9.ClickSubjectDirective, typeof i10.ClickEmitterDirective, typeof i11.DialogDirective, typeof i12.MatSlideToggleGroupDirective, typeof i13.ConditionalClassesDirective], [typeof i4.StopPropagationDirective, typeof i6.PreventEnterDirective, typeof i1.SpaceCasePipe, typeof i2.PhoneNumberPipe, typeof i3.FunctionPipe, typeof i4.StopPropagationDirective, typeof i8.TrimWhitespaceDirective, typeof i5.StylerDirective, typeof i6.PreventEnterDirective, typeof i7.AutoFocusDirective, typeof i9.ClickSubjectDirective, typeof i10.ClickEmitterDirective, typeof i11.DialogDirective, typeof i12.MatSlideToggleGroupDirective, typeof i13.ConditionalClassesDirective]>;
18
+ static ɵinj: i0.ɵɵInjectorDeclaration<UtilitiesModule>;
19
+ }
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class FunctionPipe implements PipeTransform {
4
+ transform<T, TParam extends any[]>(func: ((...args: [...TParam]) => T) | string, ...args: [...TParam]): T;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<FunctionPipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<FunctionPipe, "func", true>;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class PhoneNumberPipe implements PipeTransform {
4
+ transform(phoneNum: string): any;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<PhoneNumberPipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<PhoneNumberPipe, "phone", true>;
7
+ }
@@ -0,0 +1,17 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class SpaceCasePipe implements PipeTransform {
4
+ transform(value: string): string;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<SpaceCasePipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<SpaceCasePipe, "spaceCase", true>;
7
+ }
8
+ /**
9
+ * Adds a space before uppercase letters that either
10
+ * 1. follows a lowercase letter or digit
11
+ * 2. or precedes a lowercase letter and follows an alpha-numeric character
12
+ *
13
+ * Uppercases the first digit
14
+ *
15
+ * Turns underscores into spaces
16
+ */
17
+ export declare function spaceCase(value: string): string;
package/karma.conf.js DELETED
@@ -1,44 +0,0 @@
1
- // Karma configuration file, see link for more information
2
- // https://karma-runner.github.io/1.0/config/configuration-file.html
3
-
4
- module.exports = function (config) {
5
- config.set({
6
- basePath: '',
7
- frameworks: ['jasmine', '@angular-devkit/build-angular'],
8
- plugins: [
9
- require('karma-jasmine'),
10
- require('karma-chrome-launcher'),
11
- require('karma-jasmine-html-reporter'),
12
- require('karma-coverage'),
13
- require('@angular-devkit/build-angular/plugins/karma')
14
- ],
15
- client: {
16
- jasmine: {
17
- // you can add configuration options for Jasmine here
18
- // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
19
- // for example, you can disable the random execution with `random: false`
20
- // or set a specific seed with `seed: 4321`
21
- },
22
- clearContext: false // leave Jasmine Spec Runner output visible in browser
23
- },
24
- jasmineHtmlReporter: {
25
- suppressAll: true // removes the duplicated traces
26
- },
27
- coverageReporter: {
28
- dir: require('path').join(__dirname, '../../coverage/http-request-state'),
29
- subdir: '.',
30
- reporters: [
31
- { type: 'html' },
32
- { type: 'text-summary' }
33
- ]
34
- },
35
- reporters: ['progress', 'kjhtml'],
36
- port: 9876,
37
- colors: true,
38
- logLevel: config.LOG_INFO,
39
- autoWatch: true,
40
- browsers: ['Chrome'],
41
- singleRun: false,
42
- restartOnFileChange: true
43
- });
44
- };
package/ng-package.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
- "dest": "../../dist/angular-utilities",
4
- "lib": {
5
- "entryFile": "src/public-api.ts"
6
- }
7
- }
@@ -1,16 +0,0 @@
1
- #blocker {
2
- position:fixed;
3
- top: 0px;
4
- left: 0px;
5
- width:100%;
6
- height:100%;
7
- background-color:rgba(14, 13, 13, 0.411);
8
- z-index:999999;
9
- }
10
-
11
- .spinner{
12
- position: absolute;
13
- top:50%;
14
- left:40%;
15
- transform: translate(-50%, -50%);
16
- }
@@ -1,6 +0,0 @@
1
- @if((serverActionStatus$ | async)?.status === serverStatusTypes.inProgress){
2
- <div id="blocker">
3
- <mat-spinner class="spinner" [diameter]="200" />
4
- </div>
5
- }
6
-
@@ -1,25 +0,0 @@
1
- import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { ActionStateSpinnerComponent } from './action-state-spinner.component';
4
-
5
- describe('ActionStateSpinnerComponent', () => {
6
- let component: ActionStateSpinnerComponent;
7
- let fixture: ComponentFixture<ActionStateSpinnerComponent>;
8
-
9
- beforeEach(async(() => {
10
- TestBed.configureTestingModule({
11
- declarations: [ ActionStateSpinnerComponent ]
12
- })
13
- .compileComponents();
14
- }));
15
-
16
- beforeEach(() => {
17
- fixture = TestBed.createComponent(ActionStateSpinnerComponent);
18
- component = fixture.componentInstance;
19
- fixture.detectChanges();
20
- });
21
-
22
- it('should create', () => {
23
- expect(component).toBeTruthy();
24
- });
25
- });
@@ -1,26 +0,0 @@
1
- import { Component, OnInit, Input } from '@angular/core';
2
- import { Observable } from 'rxjs';
3
- import { ActionStatus, serverStatusTypes } from '../ngrx';
4
- import { delayOn } from '../../rxjs';
5
- import { AsyncPipe } from '@angular/common';
6
- import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
7
-
8
- @Component({
9
- selector: 'lib-action-state-spinner',
10
- templateUrl: './action-state-spinner.component.html',
11
- styleUrls: ['./action-state-spinner.component.css'],
12
- standalone: true,
13
- imports: [AsyncPipe, MatProgressSpinnerModule]
14
- })
15
- export class ActionStateSpinnerComponent implements OnInit {
16
-
17
- @Input() status$!: Observable<ActionStatus>;
18
- serverActionStatus$!: Observable<ActionStatus>;
19
- serverStatusTypes = serverStatusTypes;
20
-
21
- ngOnInit() {
22
- this.serverActionStatus$ = this.status$.pipe(
23
- delayOn( a => a.status === serverStatusTypes.inProgress , 500)
24
- );
25
- }
26
- }
@@ -1,13 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { ActionStateSpinnerComponent } from '../action-state-spinner/action-state-spinner.component';
3
-
4
-
5
- @NgModule({
6
- imports: [
7
- ActionStateSpinnerComponent,
8
- ],
9
- exports: [
10
- ActionStateSpinnerComponent,
11
- ]
12
- })
13
- export class ActionStateUiModule { }
@@ -1,15 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
- import { actionStatusReducer } from '../ngrx';
4
- import { StoreModule } from '@ngrx/store';
5
-
6
-
7
-
8
- @NgModule({
9
- declarations: [],
10
- imports: [
11
- CommonModule,
12
- StoreModule.forFeature('ActionStatus', actionStatusReducer),
13
- ]
14
- })
15
- export class NgrxExtModule { }
@@ -1,69 +0,0 @@
1
- import { Action, createFeatureSelector, createSelector } from '@ngrx/store';
2
- import { createEntityAdapter, EntityState } from '@ngrx/entity';
3
- import { get } from 'lodash';
4
-
5
- // State
6
- export class AppStatusState {
7
- readonly ActionStatusBar!: ActionStatus[];
8
- }
9
-
10
- export interface StatusState {
11
- ids: string[];
12
- entities: {[id: string]: ActionStatus};
13
- }
14
-
15
- export class ActionStatus {
16
- id!: string;
17
- displayName?: string;
18
- status!: serverStatusTypes;
19
- responsePayload?: any;
20
- }
21
-
22
- const InitialState: StatusState = {
23
- ids: [],
24
- entities: {}
25
- };
26
-
27
- export enum serverStatusTypes {
28
- notStarted = 0,
29
- inProgress = 1,
30
- success = 2,
31
- error = 3
32
- }
33
-
34
- // Entity and Selectors
35
- export const statusAdapter = createEntityAdapter<ActionStatus>();
36
- export interface State extends EntityState<ActionStatus> {}
37
- export const initialState: StatusState = statusAdapter.getInitialState(InitialState);
38
-
39
- export const getStatusState = createFeatureSelector<State>('ActionStatus');
40
- export const {
41
- selectIds,
42
- selectEntities,
43
- selectAll,
44
- selectTotal
45
- } = statusAdapter.getSelectors(getStatusState);
46
-
47
- export const selectEntity = (id: string) => createSelector(
48
- selectEntities,
49
- (entities: any) => entities[id]
50
- );
51
-
52
- // Reducers
53
- export function actionStatusReducer(state: StatusState = initialState, action: Action) {
54
-
55
- const actionStatus: ActionStatus = get(action, 'payload.actionStatus' ) as any;
56
-
57
- if ( actionStatus ) {
58
- if ( state.ids.find(id => id === actionStatus.id) ) {
59
- const modifiedObj = {...state.entities[actionStatus.id] };
60
- modifiedObj.status = actionStatus.status;
61
- modifiedObj.responsePayload = actionStatus.responsePayload;
62
- return statusAdapter.upsertOne( modifiedObj, state);
63
- } else {
64
- return statusAdapter.addOne(actionStatus , state);
65
- }
66
-
67
- }
68
- return state;
69
- }