@one-paragon/angular-utilities 0.3.10 → 0.3.11-beta.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 (395) hide show
  1. package/karma.conf.js +44 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +16 -30
  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 +26 -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 +29 -0
  13. package/src/http-request-state/HttpRequestStateStore.ts +147 -0
  14. package/src/http-request-state/directives/HttpStateDirectiveBase.ts +38 -0
  15. package/src/http-request-state/directives/http-error-state-directive.ts +32 -0
  16. package/src/http-request-state/directives/http-inProgress-state-directive.ts +32 -0
  17. package/src/http-request-state/directives/http-notStarted-state-directive.ts +31 -0
  18. package/src/http-request-state/directives/http-success-state-directive.ts +40 -0
  19. package/src/http-request-state/directives/request-state-directive.spec.ts +72 -0
  20. package/src/http-request-state/directives/request-state-directive.ts +79 -0
  21. package/src/http-request-state/helpers.ts +30 -0
  22. package/src/http-request-state/http-request-state.ts +69 -0
  23. package/src/http-request-state/http-state-module.ts +23 -0
  24. package/{http-request-state/index.d.ts → src/http-request-state/index.ts} +1 -1
  25. package/src/http-request-state/observable.spec.ts +43 -0
  26. package/src/http-request-state/rxjs/getRequestorBody.ts +10 -0
  27. package/src/http-request-state/rxjs/getRequestorState.ts +8 -0
  28. package/src/http-request-state/rxjs/tapError.ts +16 -0
  29. package/src/http-request-state/rxjs/tapSuccess.ts +16 -0
  30. package/src/http-request-state/strategies.spec.ts +42 -0
  31. package/src/http-request-state/types.ts +50 -0
  32. package/src/ngrx/actionable-selector.ts +95 -0
  33. package/src/ngrx/index.ts +1 -0
  34. package/{public-api.d.ts → src/public-api.ts} +35 -16
  35. package/src/rxjs/defaultShareReplay.ts +8 -0
  36. package/{rxjs/index.d.ts → src/rxjs/index.ts} +4 -4
  37. package/src/rxjs/mapError.ts +8 -0
  38. package/src/rxjs/rxjs-operators.ts +132 -0
  39. package/src/rxjs/subjectifier.ts +15 -0
  40. package/src/specs/clickSubject.spec.ts +95 -0
  41. package/src/specs/dialog.spec.ts +101 -0
  42. package/src/specs/toggleGroupDirective.spec.ts +229 -0
  43. package/src/table-builder/classes/DefaultSettings.ts +11 -0
  44. package/src/table-builder/classes/MatTableObservableDataSource.ts +23 -0
  45. package/src/table-builder/classes/TableBuilderConfig.ts +35 -0
  46. package/src/table-builder/classes/TableBuilderDataSource.ts +57 -0
  47. package/src/table-builder/classes/TableState.ts +83 -0
  48. package/src/table-builder/classes/filter-info.ts +131 -0
  49. package/src/table-builder/classes/table-builder-general-settings.ts +90 -0
  50. package/src/table-builder/classes/table-builder.ts +52 -0
  51. package/src/table-builder/classes/table-store.ts +394 -0
  52. package/src/table-builder/components/array-column.component.ts +36 -0
  53. package/src/table-builder/components/column-builder/column-builder.component.html +58 -0
  54. package/src/table-builder/components/column-builder/column-builder.component.scss +43 -0
  55. package/src/table-builder/components/column-builder/column-builder.component.spec.ts +49 -0
  56. package/src/table-builder/components/column-builder/column-builder.component.ts +117 -0
  57. package/src/table-builder/components/column-builder/column-helpers.ts +38 -0
  58. package/src/table-builder/components/date-filter/date-filter.component.html +23 -0
  59. package/src/table-builder/components/date-filter/date-filter.component.ts +24 -0
  60. package/src/table-builder/components/date-time-filter/date-time-filter.component.html +9 -0
  61. package/src/table-builder/components/date-time-filter/date-time-filter.component.ts +22 -0
  62. package/src/table-builder/components/filter/filter.component.html +88 -0
  63. package/src/table-builder/components/filter/filter.component.scss +64 -0
  64. package/src/table-builder/components/filter/filter.component.spec.ts +87 -0
  65. package/src/table-builder/components/filter/filter.component.ts +55 -0
  66. package/src/table-builder/components/filter/in-list/in-list-filter.component.ts +92 -0
  67. package/src/table-builder/components/gen-col-displayer/gen-col-displayer.component.html +55 -0
  68. package/src/table-builder/components/gen-col-displayer/gen-col-displayer.component.scss +57 -0
  69. package/src/table-builder/components/gen-col-displayer/gen-col-displayer.component.ts +55 -0
  70. package/src/table-builder/components/generic-table/generic-table.component.html +71 -0
  71. package/src/table-builder/components/generic-table/generic-table.component.scss +51 -0
  72. package/src/table-builder/components/generic-table/generic-table.component.ts +220 -0
  73. package/src/table-builder/components/generic-table/paginator.component.ts +94 -0
  74. package/src/table-builder/components/group-by-list/group-by-list.component.css +8 -0
  75. package/src/table-builder/components/group-by-list/group-by-list.component.html +12 -0
  76. package/src/table-builder/components/group-by-list/group-by-list.component.spec.ts +23 -0
  77. package/src/table-builder/components/group-by-list/group-by-list.component.ts +21 -0
  78. package/src/table-builder/components/header-menu/header-menu.component.html +98 -0
  79. package/src/table-builder/components/header-menu/header-menu.component.scss +96 -0
  80. package/src/table-builder/components/header-menu/header-menu.component.ts +98 -0
  81. package/src/table-builder/components/in-filter/in-filter.component.css +3 -0
  82. package/src/table-builder/components/in-filter/in-filter.component.html +20 -0
  83. package/src/table-builder/components/in-filter/in-filter.component.ts +64 -0
  84. package/{table-builder/components/index.d.ts → src/table-builder/components/index.ts} +9 -9
  85. package/src/table-builder/components/initialization-component/initialization-component.html +29 -0
  86. package/src/table-builder/components/initialization-component/initialization-component.ts +24 -0
  87. package/src/table-builder/components/link-column.component.ts +47 -0
  88. package/src/table-builder/components/number-filter/number-filter.component.css +10 -0
  89. package/src/table-builder/components/number-filter/number-filter.component.html +19 -0
  90. package/src/table-builder/components/number-filter/number-filter.component.spec.ts +30 -0
  91. package/src/table-builder/components/number-filter/number-filter.component.ts +25 -0
  92. package/src/table-builder/components/scroll-strategy.ts +82 -0
  93. package/src/table-builder/components/sort-menu/sort-menu.component-store.ts +62 -0
  94. package/src/table-builder/components/sort-menu/sort-menu.component.html +111 -0
  95. package/src/table-builder/components/sort-menu/sort-menu.component.scss +119 -0
  96. package/src/table-builder/components/sort-menu/sort-menu.component.ts +95 -0
  97. package/{table-builder/components/table-container/table-container-imports.d.ts → src/table-builder/components/table-container/table-container-imports.ts} +30 -14
  98. package/src/table-builder/components/table-container/table-container.css +45 -0
  99. package/src/table-builder/components/table-container/table-container.helpers/data-state.helpers.ts +141 -0
  100. package/src/table-builder/components/table-container/table-container.helpers/filter-state.helpers.ts +106 -0
  101. package/src/table-builder/components/table-container/table-container.helpers/groupBy.helpers.ts +69 -0
  102. package/src/table-builder/components/table-container/table-container.helpers/sort-state.helpers.ts +45 -0
  103. package/src/table-builder/components/table-container/table-container.html +117 -0
  104. package/src/table-builder/components/table-container/table-container.spec.ts +154 -0
  105. package/src/table-builder/components/table-container/table-container.ts +325 -0
  106. package/src/table-builder/components/table-container/tableProps.ts +18 -0
  107. package/src/table-builder/components/table-container/virtual-scroll-container.ts +126 -0
  108. package/src/table-builder/components/table-container-filter/filter-list/filter-list.component.html +31 -0
  109. package/src/table-builder/components/table-container-filter/filter-list/filter-list.component.ts +52 -0
  110. package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.css +42 -0
  111. package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.html +10 -0
  112. package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.spec.ts +86 -0
  113. package/src/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.ts +38 -0
  114. package/src/table-builder/components/table-container-filter/table-wrapper-filter-store.ts +23 -0
  115. package/src/table-builder/directives/custom-cell-directive.ts +46 -0
  116. package/{table-builder/directives/index.d.ts → src/table-builder/directives/index.ts} +6 -5
  117. package/src/table-builder/directives/multi-sort.directive.spec.ts +124 -0
  118. package/src/table-builder/directives/multi-sort.directive.ts +49 -0
  119. package/src/table-builder/directives/resize-column.directive.ts +105 -0
  120. package/src/table-builder/directives/table-wrapper.directive.ts +14 -0
  121. package/src/table-builder/directives/tb-filter.directive.ts +370 -0
  122. package/src/table-builder/enums/filterTypes.ts +79 -0
  123. package/src/table-builder/functions/boolean-filter-function.ts +13 -0
  124. package/src/table-builder/functions/date-filter-function.ts +69 -0
  125. package/src/table-builder/functions/download-data.ts +11 -0
  126. package/src/table-builder/functions/null-filter-function.ts +9 -0
  127. package/src/table-builder/functions/number-filter-function.ts +42 -0
  128. package/src/table-builder/functions/sort-data-function.ts +23 -0
  129. package/src/table-builder/functions/string-filter-function.ts +52 -0
  130. package/{table-builder/interfaces/ColumnInfo.d.ts → src/table-builder/interfaces/ColumnInfo.ts} +3 -2
  131. package/src/table-builder/interfaces/column-template.ts +9 -0
  132. package/{table-builder/interfaces/dictionary.d.ts → src/table-builder/interfaces/dictionary.ts} +3 -3
  133. package/src/table-builder/interfaces/report-def.ts +153 -0
  134. package/src/table-builder/ngrx/tableBuilderStateStore.ts +143 -0
  135. package/src/table-builder/pipes/column-total.pipe.ts +17 -0
  136. package/src/table-builder/pipes/format-filter-type.pipe.ts +12 -0
  137. package/src/table-builder/pipes/format-filter-value.pipe.ts +41 -0
  138. package/src/table-builder/pipes/key-display.ts +16 -0
  139. package/src/table-builder/services/export-to-csv.service.ts +96 -0
  140. package/src/table-builder/services/link-creator.service.ts +68 -0
  141. package/src/table-builder/services/table-template-service.ts +55 -0
  142. package/src/table-builder/services/transform-creator.ts +92 -0
  143. package/src/table-builder/specs/table-custom-filters.spec.ts +262 -0
  144. package/src/table-builder/styles/collapser.styles.scss +15 -0
  145. package/src/table-builder/table-builder.module.ts +73 -0
  146. package/src/test.ts +17 -0
  147. package/src/utilities/array-helpers.ts +13 -0
  148. package/src/utilities/directives/auto-focus.directive.ts +20 -0
  149. package/src/utilities/directives/clickEmitterDirective.ts +16 -0
  150. package/src/utilities/directives/clickSubject.ts +20 -0
  151. package/src/utilities/directives/conditional-classes.directive.ts +36 -0
  152. package/src/utilities/directives/dialog-service.ts +19 -0
  153. package/src/utilities/directives/dialog.ts +142 -0
  154. package/src/utilities/directives/mat-toggle-group-directive.ts +61 -0
  155. package/src/utilities/directives/prevent-enter.directive.ts +13 -0
  156. package/src/utilities/directives/stop-propagation.directive.ts +20 -0
  157. package/src/utilities/directives/styler.ts +39 -0
  158. package/src/utilities/directives/trim-whitespace.directive.ts +21 -0
  159. package/{utilities/index.d.ts → src/utilities/index.ts} +22 -15
  160. package/src/utilities/module.ts +55 -0
  161. package/src/utilities/pipes/function.pipe.ts +16 -0
  162. package/src/utilities/pipes/phone.pipe.ts +15 -0
  163. package/src/utilities/pipes/space-case.pipes.spec.ts +47 -0
  164. package/src/utilities/pipes/space-case.pipes.ts +23 -0
  165. package/tsconfig.lib.json +19 -0
  166. package/tsconfig.lib.prod.json +10 -0
  167. package/tsconfig.spec.json +17 -0
  168. package/action-state/action-state-spinner/action-state-spinner.component.d.ts +0 -12
  169. package/action-state/action-state-ui/action-state-ui.module.d.ts +0 -7
  170. package/action-state/ngrx-ext/ngrx-ext.module.d.ts +0 -8
  171. package/action-state/ngrx.d.ts +0 -31
  172. package/esm2022/action-state/action-state-spinner/action-state-spinner.component.mjs +0 -24
  173. package/esm2022/action-state/action-state-ui/action-state-ui.module.mjs +0 -20
  174. package/esm2022/action-state/index.mjs +0 -8
  175. package/esm2022/action-state/ngrx-ext/ngrx-ext.module.mjs +0 -23
  176. package/esm2022/action-state/ngrx.mjs +0 -42
  177. package/esm2022/http-request-state/HttpRequestStateFactory.mjs +0 -27
  178. package/esm2022/http-request-state/HttpRequestStateStore.mjs +0 -98
  179. package/esm2022/http-request-state/directives/HttpStateDirectiveBase.mjs +0 -34
  180. package/esm2022/http-request-state/directives/http-error-state-directive.mjs +0 -29
  181. package/esm2022/http-request-state/directives/http-inProgress-state-directive.mjs +0 -29
  182. package/esm2022/http-request-state/directives/http-notStarted-state-directive.mjs +0 -29
  183. package/esm2022/http-request-state/directives/http-success-state-directive.mjs +0 -34
  184. package/esm2022/http-request-state/directives/index.mjs +0 -6
  185. package/esm2022/http-request-state/directives/request-state-directive.mjs +0 -60
  186. package/esm2022/http-request-state/helpers.mjs +0 -22
  187. package/esm2022/http-request-state/http-request-state.mjs +0 -39
  188. package/esm2022/http-request-state/http-state-module.mjs +0 -40
  189. package/esm2022/http-request-state/index.mjs +0 -7
  190. package/esm2022/http-request-state/rxjs/getRequestorBody.mjs +0 -4
  191. package/esm2022/http-request-state/rxjs/getRequestorState.mjs +0 -3
  192. package/esm2022/http-request-state/rxjs/index.mjs +0 -5
  193. package/esm2022/http-request-state/rxjs/tapError.mjs +0 -12
  194. package/esm2022/http-request-state/rxjs/tapSuccess.mjs +0 -12
  195. package/esm2022/http-request-state/types.mjs +0 -16
  196. package/esm2022/ngrx/actionable-selector.mjs +0 -73
  197. package/esm2022/ngrx/index.mjs +0 -2
  198. package/esm2022/one-paragon-angular-utilities.mjs +0 -5
  199. package/esm2022/public-api.mjs +0 -20
  200. package/esm2022/rxjs/defaultShareReplay.mjs +0 -7
  201. package/esm2022/rxjs/index.mjs +0 -5
  202. package/esm2022/rxjs/mapError.mjs +0 -8
  203. package/esm2022/rxjs/rxjs-operators.mjs +0 -92
  204. package/esm2022/rxjs/subjectifier.mjs +0 -15
  205. package/esm2022/table-builder/classes/DefaultSettings.mjs +0 -6
  206. package/esm2022/table-builder/classes/MatTableObservableDataSource.mjs +0 -21
  207. package/esm2022/table-builder/classes/TableBuilderConfig.mjs +0 -18
  208. package/esm2022/table-builder/classes/TableBuilderDataSource.mjs +0 -50
  209. package/esm2022/table-builder/classes/TableState.mjs +0 -42
  210. package/esm2022/table-builder/classes/display-col.mjs +0 -2
  211. package/esm2022/table-builder/classes/filter-info.mjs +0 -73
  212. package/esm2022/table-builder/classes/table-builder-general-settings.mjs +0 -68
  213. package/esm2022/table-builder/classes/table-builder.mjs +0 -82
  214. package/esm2022/table-builder/classes/table-store.mjs +0 -314
  215. package/esm2022/table-builder/components/array-column.component.mjs +0 -78
  216. package/esm2022/table-builder/components/column-builder/column-builder.component.mjs +0 -118
  217. package/esm2022/table-builder/components/date-filter/date-filter.component.mjs +0 -29
  218. package/esm2022/table-builder/components/date-time-filter/date-time-filter.component.mjs +0 -24
  219. package/esm2022/table-builder/components/filter/filter.component.mjs +0 -66
  220. package/esm2022/table-builder/components/filter/in-list/in-list-filter.component.mjs +0 -101
  221. package/esm2022/table-builder/components/gen-col-displayer/gen-col-displayer.component.mjs +0 -52
  222. package/esm2022/table-builder/components/generic-table/generic-table.component.mjs +0 -205
  223. package/esm2022/table-builder/components/generic-table/paginator.component.mjs +0 -79
  224. package/esm2022/table-builder/components/group-by-list/group-by-list.component.mjs +0 -23
  225. package/esm2022/table-builder/components/header-menu/header-menu.component.mjs +0 -101
  226. package/esm2022/table-builder/components/in-filter/in-filter.component.mjs +0 -64
  227. package/esm2022/table-builder/components/index.mjs +0 -10
  228. package/esm2022/table-builder/components/initialization-component/initialization-component.mjs +0 -36
  229. package/esm2022/table-builder/components/link-column.component.mjs +0 -73
  230. package/esm2022/table-builder/components/number-filter/number-filter.component.mjs +0 -29
  231. package/esm2022/table-builder/components/scroll-strategy.mjs +0 -63
  232. package/esm2022/table-builder/components/sort-menu/sort-menu.component-store.mjs +0 -43
  233. package/esm2022/table-builder/components/sort-menu/sort-menu.component.mjs +0 -81
  234. package/esm2022/table-builder/components/table-container/table-container-imports.mjs +0 -26
  235. package/esm2022/table-builder/components/table-container/table-container.helpers/data-state.helpers.mjs +0 -2
  236. package/esm2022/table-builder/components/table-container/table-container.helpers/filter-state.helpers.mjs +0 -62
  237. package/esm2022/table-builder/components/table-container/table-container.helpers/groupBy.helpers.mjs +0 -56
  238. package/esm2022/table-builder/components/table-container/table-container.helpers/sort-state.helpers.mjs +0 -36
  239. package/esm2022/table-builder/components/table-container/table-container.mjs +0 -337
  240. package/esm2022/table-builder/components/table-container/tableProps.mjs +0 -9
  241. package/esm2022/table-builder/components/table-container/virtual-scroll-container.mjs +0 -101
  242. package/esm2022/table-builder/components/table-container-filter/filter-list/filter-list.component.mjs +0 -47
  243. package/esm2022/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.mjs +0 -36
  244. package/esm2022/table-builder/components/table-container-filter/table-wrapper-filter-store.mjs +0 -25
  245. package/esm2022/table-builder/components/table-context.mjs +0 -2
  246. package/esm2022/table-builder/directives/custom-cell-directive.mjs +0 -60
  247. package/esm2022/table-builder/directives/index.mjs +0 -6
  248. package/esm2022/table-builder/directives/multi-sort.directive.mjs +0 -50
  249. package/esm2022/table-builder/directives/resize-column.directive.mjs +0 -87
  250. package/esm2022/table-builder/directives/table-wrapper.directive.mjs +0 -20
  251. package/esm2022/table-builder/directives/tb-filter.directive.mjs +0 -410
  252. package/esm2022/table-builder/enums/filterTypes.mjs +0 -72
  253. package/esm2022/table-builder/functions/boolean-filter-function.mjs +0 -10
  254. package/esm2022/table-builder/functions/date-filter-function.mjs +0 -58
  255. package/esm2022/table-builder/functions/download-data.mjs +0 -12
  256. package/esm2022/table-builder/functions/null-filter-function.mjs +0 -8
  257. package/esm2022/table-builder/functions/number-filter-function.mjs +0 -32
  258. package/esm2022/table-builder/functions/sort-data-function.mjs +0 -17
  259. package/esm2022/table-builder/functions/string-filter-function.mjs +0 -41
  260. package/esm2022/table-builder/interfaces/ColumnInfo.mjs +0 -2
  261. package/esm2022/table-builder/interfaces/dictionary.mjs +0 -2
  262. package/esm2022/table-builder/interfaces/report-def.mjs +0 -35
  263. package/esm2022/table-builder/ngrx/tableBuilderStateStore.mjs +0 -115
  264. package/esm2022/table-builder/pipes/column-total.pipe.mjs +0 -22
  265. package/esm2022/table-builder/pipes/format-filter-type.pipe.mjs +0 -18
  266. package/esm2022/table-builder/pipes/format-filter-value.pipe.mjs +0 -45
  267. package/esm2022/table-builder/pipes/key-display.mjs +0 -20
  268. package/esm2022/table-builder/services/export-to-csv.service.mjs +0 -88
  269. package/esm2022/table-builder/services/link-creator.service.mjs +0 -42
  270. package/esm2022/table-builder/services/table-template-service.mjs +0 -44
  271. package/esm2022/table-builder/services/transform-creator.mjs +0 -78
  272. package/esm2022/table-builder/table-builder.module.mjs +0 -124
  273. package/esm2022/utilities/array-helpers.mjs +0 -14
  274. package/esm2022/utilities/directives/auto-focus.directive.mjs +0 -27
  275. package/esm2022/utilities/directives/clickEmitterDirective.mjs +0 -22
  276. package/esm2022/utilities/directives/clickSubject.mjs +0 -28
  277. package/esm2022/utilities/directives/conditional-classes.directive.mjs +0 -36
  278. package/esm2022/utilities/directives/dialog-service.mjs +0 -23
  279. package/esm2022/utilities/directives/dialog.mjs +0 -138
  280. package/esm2022/utilities/directives/mat-toggle-group-directive.mjs +0 -60
  281. package/esm2022/utilities/directives/prevent-enter.directive.mjs +0 -20
  282. package/esm2022/utilities/directives/stop-propagation.directive.mjs +0 -26
  283. package/esm2022/utilities/directives/styler.mjs +0 -42
  284. package/esm2022/utilities/directives/trim-whitespace.directive.mjs +0 -30
  285. package/esm2022/utilities/index.mjs +0 -16
  286. package/esm2022/utilities/module.mjs +0 -90
  287. package/esm2022/utilities/pipes/function.pipe.mjs +0 -22
  288. package/esm2022/utilities/pipes/phone.pipe.mjs +0 -20
  289. package/esm2022/utilities/pipes/space-case.pipes.mjs +0 -28
  290. package/fesm2022/one-paragon-angular-utilities.mjs +0 -5045
  291. package/fesm2022/one-paragon-angular-utilities.mjs.map +0 -1
  292. package/http-request-state/HttpRequestStateFactory.d.ts +0 -15
  293. package/http-request-state/HttpRequestStateStore.d.ts +0 -49
  294. package/http-request-state/directives/HttpStateDirectiveBase.d.ts +0 -16
  295. package/http-request-state/directives/http-error-state-directive.d.ts +0 -12
  296. package/http-request-state/directives/http-inProgress-state-directive.d.ts +0 -12
  297. package/http-request-state/directives/http-notStarted-state-directive.d.ts +0 -12
  298. package/http-request-state/directives/http-success-state-directive.d.ts +0 -21
  299. package/http-request-state/directives/request-state-directive.d.ts +0 -35
  300. package/http-request-state/helpers.d.ts +0 -9
  301. package/http-request-state/http-request-state.d.ts +0 -12
  302. package/http-request-state/http-state-module.d.ts +0 -11
  303. package/http-request-state/rxjs/getRequestorBody.d.ts +0 -3
  304. package/http-request-state/rxjs/getRequestorState.d.ts +0 -3
  305. package/http-request-state/rxjs/tapError.d.ts +0 -3
  306. package/http-request-state/rxjs/tapSuccess.d.ts +0 -3
  307. package/http-request-state/types.d.ts +0 -36
  308. package/index.d.ts +0 -5
  309. package/ngrx/actionable-selector.d.ts +0 -17
  310. package/ngrx/index.d.ts +0 -1
  311. package/rxjs/defaultShareReplay.d.ts +0 -2
  312. package/rxjs/mapError.d.ts +0 -2
  313. package/rxjs/rxjs-operators.d.ts +0 -13
  314. package/rxjs/subjectifier.d.ts +0 -9
  315. package/table-builder/classes/DefaultSettings.d.ts +0 -9
  316. package/table-builder/classes/MatTableObservableDataSource.d.ts +0 -9
  317. package/table-builder/classes/TableBuilderConfig.d.ts +0 -21
  318. package/table-builder/classes/TableBuilderDataSource.d.ts +0 -13
  319. package/table-builder/classes/TableState.d.ts +0 -55
  320. package/table-builder/classes/filter-info.d.ts +0 -127
  321. package/table-builder/classes/table-builder-general-settings.d.ts +0 -43
  322. package/table-builder/classes/table-builder.d.ts +0 -14
  323. package/table-builder/classes/table-store.d.ts +0 -124
  324. package/table-builder/components/array-column.component.d.ts +0 -14
  325. package/table-builder/components/column-builder/column-builder.component.d.ts +0 -54
  326. package/table-builder/components/date-filter/date-filter.component.d.ts +0 -10
  327. package/table-builder/components/date-time-filter/date-time-filter.component.d.ts +0 -10
  328. package/table-builder/components/filter/filter.component.d.ts +0 -112
  329. package/table-builder/components/filter/in-list/in-list-filter.component.d.ts +0 -27
  330. package/table-builder/components/gen-col-displayer/gen-col-displayer.component.d.ts +0 -16
  331. package/table-builder/components/generic-table/generic-table.component.d.ts +0 -69
  332. package/table-builder/components/generic-table/paginator.component.d.ts +0 -27
  333. package/table-builder/components/group-by-list/group-by-list.component.d.ts +0 -7
  334. package/table-builder/components/header-menu/header-menu.component.d.ts +0 -25
  335. package/table-builder/components/in-filter/in-filter.component.d.ts +0 -21
  336. package/table-builder/components/initialization-component/initialization-component.d.ts +0 -12
  337. package/table-builder/components/link-column.component.d.ts +0 -17
  338. package/table-builder/components/number-filter/number-filter.component.d.ts +0 -12
  339. package/table-builder/components/scroll-strategy.d.ts +0 -23
  340. package/table-builder/components/sort-menu/sort-menu.component-store.d.ts +0 -24
  341. package/table-builder/components/sort-menu/sort-menu.component.d.ts +0 -25
  342. package/table-builder/components/table-container/table-container.d.ts +0 -75
  343. package/table-builder/components/table-container/table-container.helpers/data-state.helpers.d.ts +0 -5
  344. package/table-builder/components/table-container/table-container.helpers/filter-state.helpers.d.ts +0 -15
  345. package/table-builder/components/table-container/table-container.helpers/groupBy.helpers.d.ts +0 -15
  346. package/table-builder/components/table-container/table-container.helpers/sort-state.helpers.d.ts +0 -9
  347. package/table-builder/components/table-container/tableProps.d.ts +0 -11
  348. package/table-builder/components/table-container/virtual-scroll-container.d.ts +0 -17
  349. package/table-builder/components/table-container-filter/filter-list/filter-list.component.d.ts +0 -16
  350. package/table-builder/components/table-container-filter/gen-filter-displayer/gen-filter-displayer.component.d.ts +0 -14
  351. package/table-builder/components/table-container-filter/table-wrapper-filter-store.d.ts +0 -14
  352. package/table-builder/components/table-context.d.ts +0 -10
  353. package/table-builder/directives/custom-cell-directive.d.ts +0 -19
  354. package/table-builder/directives/multi-sort.directive.d.ts +0 -11
  355. package/table-builder/directives/resize-column.directive.d.ts +0 -43
  356. package/table-builder/directives/table-wrapper.directive.d.ts +0 -8
  357. package/table-builder/directives/tb-filter.directive.d.ts +0 -120
  358. package/table-builder/enums/filterTypes.d.ts +0 -77
  359. package/table-builder/functions/boolean-filter-function.d.ts +0 -3
  360. package/table-builder/functions/date-filter-function.d.ts +0 -4
  361. package/table-builder/functions/download-data.d.ts +0 -1
  362. package/table-builder/functions/null-filter-function.d.ts +0 -2
  363. package/table-builder/functions/number-filter-function.d.ts +0 -4
  364. package/table-builder/functions/sort-data-function.d.ts +0 -6
  365. package/table-builder/functions/string-filter-function.d.ts +0 -7
  366. package/table-builder/interfaces/report-def.d.ts +0 -147
  367. package/table-builder/ngrx/tableBuilderStateStore.d.ts +0 -62
  368. package/table-builder/pipes/column-total.pipe.d.ts +0 -8
  369. package/table-builder/pipes/format-filter-type.pipe.d.ts +0 -8
  370. package/table-builder/pipes/format-filter-value.pipe.d.ts +0 -14
  371. package/table-builder/pipes/key-display.d.ts +0 -11
  372. package/table-builder/services/export-to-csv.service.d.ts +0 -22
  373. package/table-builder/services/link-creator.service.d.ts +0 -12
  374. package/table-builder/services/table-template-service.d.ts +0 -14
  375. package/table-builder/services/transform-creator.d.ts +0 -19
  376. package/table-builder/table-builder.module.d.ts +0 -21
  377. package/utilities/array-helpers.d.ts +0 -1
  378. package/utilities/directives/auto-focus.directive.d.ts +0 -10
  379. package/utilities/directives/clickEmitterDirective.d.ts +0 -7
  380. package/utilities/directives/clickSubject.d.ts +0 -9
  381. package/utilities/directives/conditional-classes.directive.d.ts +0 -14
  382. package/utilities/directives/dialog-service.d.ts +0 -10
  383. package/utilities/directives/dialog.d.ts +0 -46
  384. package/utilities/directives/mat-toggle-group-directive.d.ts +0 -21
  385. package/utilities/directives/prevent-enter.directive.d.ts +0 -6
  386. package/utilities/directives/stop-propagation.directive.d.ts +0 -7
  387. package/utilities/directives/styler.d.ts +0 -16
  388. package/utilities/directives/trim-whitespace.directive.d.ts +0 -9
  389. package/utilities/module.d.ts +0 -19
  390. package/utilities/pipes/function.pipe.d.ts +0 -7
  391. package/utilities/pipes/phone.pipe.d.ts +0 -7
  392. package/utilities/pipes/space-case.pipes.d.ts +0 -17
  393. /package/{http-request-state/directives/index.d.ts → src/http-request-state/directives/index.ts} +0 -0
  394. /package/{http-request-state/rxjs/index.d.ts → src/http-request-state/rxjs/index.ts} +0 -0
  395. /package/{table-builder/classes/display-col.d.ts → src/table-builder/classes/display-col.ts} +0 -0
@@ -0,0 +1,142 @@
1
+ import { Directive, TemplateRef, Input, OnDestroy, Component, Output, EventEmitter, ViewContainerRef, Injector, ComponentFactoryResolver, ChangeDetectionStrategy } from '@angular/core';
2
+ import { MatDialog, MatDialogRef, MatDialogConfig } from '@angular/material/dialog';
3
+ import { Observable, Subscription, Subject } from 'rxjs';
4
+ import { switchAll } from 'rxjs/operators';
5
+ import { DialogService } from './dialog-service';
6
+
7
+ interface DialogViewContext<T> {
8
+ $implicit: T,
9
+ opDialog: T,
10
+ close: () => void,
11
+ }
12
+
13
+ @Component({
14
+ selector: 'dialog-wrapper',
15
+ template: ``,
16
+ standalone: true,
17
+ changeDetection: ChangeDetectionStrategy.OnPush,
18
+ })
19
+ export class DialogWrapper<T = any> {
20
+ viewEmbedded = false;
21
+ viewContext = {
22
+ close: () => {},
23
+ } as DialogViewContext<T>;
24
+ set template(tmpl: TemplateRef<DialogViewContext<T>>) {
25
+ if (this.viewEmbedded) {
26
+ this.vcr.clear();
27
+ }
28
+ this.viewEmbedded = true;
29
+ this.vcr.createEmbeddedView(tmpl, this.viewContext);
30
+ }
31
+
32
+ set close(closeMethod: () => void ) {
33
+ this.viewContext.close = closeMethod;
34
+ }
35
+
36
+ set data(value: T) {
37
+ this.viewContext.$implicit = value;
38
+ this.viewContext.opDialog = value;
39
+ }
40
+ constructor(private vcr: ViewContainerRef ) {
41
+ }
42
+
43
+ }
44
+
45
+
46
+ const defaultDialogConfig: MatDialogConfig = {
47
+ maxHeight: '95vh',
48
+ }
49
+
50
+
51
+ @Directive(
52
+ { selector: '[opDialog]', standalone: true }
53
+ ) export class DialogDirective<T> implements OnDestroy {
54
+ @Output() opDialogClosed: EventEmitter<boolean> = new EventEmitter();
55
+ _dialogConfig: MatDialogConfig<T> = defaultDialogConfig;
56
+ @Input() opDialogAddDialogClass = true;
57
+ @Input() set opDialogConfig(config: MatDialogConfig<T>) {
58
+
59
+ this._dialogConfig = { ...defaultDialogConfig, ...config };
60
+ }
61
+
62
+ get opDialogConfig() : MatDialogConfig<T> {
63
+ return this._dialogConfig;
64
+ }
65
+ @Input('opDialog') set state(open_close: Observable<T>) {
66
+ this._data.next(open_close);
67
+ }
68
+ @Input('opDialogOrigin') nativeElement? : HTMLElement;
69
+ dialogRef?: MatDialogRef<any, boolean>;
70
+ subscription: Subscription;
71
+ componentWrapper?: DialogWrapper<T>;
72
+
73
+ constructor(
74
+ private templateRef: TemplateRef<DialogViewContext<T>>,
75
+ private dialog: MatDialog,
76
+ private service: DialogService) {
77
+ this.subscription = this._data.pipe(
78
+ switchAll()
79
+ ).subscribe(d => {
80
+ if (d) {
81
+ this.opDialogConfig.data = d;
82
+ this.setDialogState(true);
83
+ } else {
84
+ this.setDialogState(false);
85
+ }
86
+ });
87
+ }
88
+
89
+ _data = new Subject<Observable<T>>();
90
+
91
+ close() {
92
+ this.dialogRef?.close();
93
+ }
94
+
95
+ initDialog() {
96
+ if(this.nativeElement){
97
+ const rect = this.nativeElement.getBoundingClientRect();
98
+ const position = { left: `${rect.left}px`, top: `${rect.bottom - 50}px` };
99
+ this.opDialogConfig = {...this.opDialogConfig , position};
100
+ }
101
+ if (this.opDialogAddDialogClass) {
102
+ this.opDialogConfig.panelClass = [...(Array.isArray(this.opDialogConfig.panelClass) ? this.opDialogConfig.panelClass : this.opDialogConfig.panelClass ? [this.opDialogConfig.panelClass] : []), 'opDialog'];
103
+ }
104
+ this.dialogRef = this.dialog.open(DialogWrapper, this.opDialogConfig);
105
+ this.componentWrapper = this.dialogRef.componentInstance;
106
+ this.componentWrapper!.close = () => this.dialogRef?.close();
107
+ this.componentWrapper!.data = this.opDialogConfig.data as T;
108
+ this.componentWrapper!.template = this.templateRef;
109
+ if (!this.opDialogConfig.disableClose) {
110
+ this.service.addDialogRef(this.dialogRef);
111
+ }
112
+ const sub = this.dialogRef.afterClosed().subscribe(() => {
113
+ this.opDialogClosed.emit(true);
114
+ this.service.removeDialogRef(this.dialogRef!);
115
+ this.dialogRef = undefined;
116
+ sub.unsubscribe();
117
+ });
118
+ }
119
+
120
+ setDialogState(open: boolean) {
121
+ if (open) {
122
+ if (!this.dialogRef) {
123
+ this.initDialog();
124
+ } else {
125
+ this.componentWrapper!.data = this.opDialogConfig.data as T;
126
+ }
127
+ } else if (!open && this.dialogRef) {
128
+ this.dialogRef.close();
129
+ }
130
+ }
131
+
132
+ ngOnDestroy() {
133
+ if (this.subscription) {
134
+ this.subscription.unsubscribe();
135
+ }
136
+ }
137
+
138
+ static ngTemplateContextGuard<T>(dir: DialogDirective<T>, ctx: any): ctx is DialogViewContext<Exclude<T, false | 0 | '' | null | undefined>> {
139
+ return true;
140
+ }
141
+
142
+ }
@@ -0,0 +1,61 @@
1
+ import { ContentChildren, Directive, Input, Output, QueryList } from "@angular/core";
2
+ import { MatSlideToggle } from "@angular/material/slide-toggle";
3
+ import { merge, Observable, ReplaySubject, scan, startWith, switchMap } from "rxjs";
4
+
5
+
6
+ @Directive(
7
+ { selector: '[opMatSlideToggleGroup]',
8
+ standalone: true
9
+ }
10
+ ) export class MatSlideToggleGroupDirective {
11
+ @Input() allowMultiple = false;
12
+
13
+ _toggles!: QueryList<MatSlideToggle>;
14
+ @ContentChildren(MatSlideToggle) set toggles(val: QueryList<MatSlideToggle>) {
15
+ this._toggles = val;
16
+ this._ready.next(true);
17
+ }
18
+
19
+ private _ready = new ReplaySubject<boolean>(1);
20
+
21
+ @Output() get valueEmitter() : Observable<{[key:string]: boolean}> {
22
+ return this._ready.pipe( switchMap( _ => this.getObs()));
23
+ }
24
+
25
+
26
+ getInitValue() {
27
+ const startValue = this._toggles.reduce( (prev,cur) => {
28
+ if(!cur.name) {
29
+ throw new Error('toggle must have the name attribute set');
30
+ }
31
+ prev[cur.name] = cur.checked
32
+ return prev;
33
+ }, {} as {[k:string]: boolean});
34
+ return startValue;
35
+ }
36
+
37
+ getObs() {
38
+ var toggleChanges = merge(...this._toggles.map( toggle => toggle.change ));
39
+
40
+ const startValue = this.getInitValue();
41
+
42
+ return toggleChanges.pipe(
43
+ scan( (prev,cur) => {
44
+ const toggleName = cur.source.name!;
45
+ const newVal = {...prev,[toggleName]:cur.checked};
46
+ if(cur.checked && !this.allowMultiple) {
47
+ Object.keys(prev)
48
+ .filter( key => key !== toggleName && prev[key])
49
+ .forEach( key => {
50
+ newVal[key] = false;
51
+ this._toggles.find( toggle => toggle.name === key)!.toggle();
52
+ });
53
+ }
54
+ return newVal;
55
+ },startValue),
56
+ startWith(startValue),
57
+ );
58
+
59
+ }
60
+
61
+ }
@@ -0,0 +1,13 @@
1
+ import { Directive, HostListener } from '@angular/core';
2
+
3
+ @Directive({
4
+ selector: 'preventEnter',
5
+ standalone: true
6
+ })
7
+ export class PreventEnterDirective {
8
+
9
+ @HostListener('keydown.enter', ['$event'])
10
+ onKeyDown() {
11
+ return false
12
+ }
13
+ }
@@ -0,0 +1,20 @@
1
+ import {Directive, HostListener} from "@angular/core";
2
+
3
+ @Directive({
4
+ selector: "[stop-propagation]",
5
+ standalone: true
6
+ })
7
+ export class StopPropagationDirective
8
+ {
9
+ @HostListener("click", ["$event"])
10
+ public onClick(event: any): void
11
+ {
12
+ event.stopPropagation();
13
+ }
14
+
15
+ @HostListener("mousedown", ["$event"])
16
+ public onMousedown(event: any): void
17
+ {
18
+ event.stopPropagation();
19
+ }
20
+ }
@@ -0,0 +1,39 @@
1
+ import { Directive, Input, ElementRef, Renderer2 } from '@angular/core';
2
+ import { Dictionary } from '@ngrx/entity';
3
+
4
+
5
+ @Directive({
6
+ selector: '[styler]',
7
+ standalone: true
8
+ }) export class StylerDirective {
9
+ stylesApplied : Dictionary<string> = {};
10
+ @Input() element?: any;
11
+ @Input() set styler(styles: StylerStyle){
12
+ const toApply = Object.entries(styles ?? {}).reduce((acc, [key, val]) => {
13
+ if(typeof(val) === 'string'){
14
+ acc[key] = val;
15
+ this.el.nativeElement.style[key] = val;
16
+ } else if(val?.condition === true || val?.condition(this.element)){
17
+ const value = typeof(val.value) === 'string' ? val.value : val?.value(this.element);
18
+ acc[key] = value;
19
+ this.el.nativeElement.style[key] = value;
20
+ }
21
+ return acc;
22
+ }, {} as Dictionary<string>);
23
+
24
+ Object.keys(this.stylesApplied).filter(key => !Object.keys(toApply).includes(key)).forEach(key => {
25
+ this.renderer.removeStyle(this.el.nativeElement, key);
26
+ });
27
+ this.stylesApplied = toApply;
28
+ };
29
+ constructor(private el: ElementRef, private renderer: Renderer2) {
30
+ }
31
+ }
32
+
33
+ export type StylerStyle = Dictionary<
34
+ string
35
+ |
36
+ {
37
+ condition: ((t:any) => boolean) | true,
38
+ value: ((t:any) => string) | string
39
+ }>
@@ -0,0 +1,21 @@
1
+ import { Directive, ElementRef, HostListener } from '@angular/core';
2
+
3
+ @Directive({
4
+ selector: 'input[trimWhitespace]',
5
+ standalone: true
6
+ })
7
+ export class TrimWhitespaceDirective {
8
+
9
+ constructor(private elem: ElementRef) { }
10
+
11
+ @HostListener('blur') onBlur() {
12
+ const inputString = this.elem.nativeElement.value;
13
+ if(inputString) {
14
+ const newValue = inputString.trim().replace(/\t/g, '');
15
+ if(inputString !== newValue) {
16
+ this.elem.nativeElement.value = newValue;
17
+ this.elem.nativeElement.dispatchEvent(new Event('input', {bubbles:true}));
18
+ }
19
+ }
20
+ }
21
+ }
@@ -1,15 +1,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';
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
+
@@ -0,0 +1,55 @@
1
+ import { NgModule } from "@angular/core";
2
+ import { AutoFocusDirective } from "./directives/auto-focus.directive";
3
+ import { ClickEmitterDirective } from "./directives/clickEmitterDirective";
4
+ import { ClickSubjectDirective } from "./directives/clickSubject";
5
+ import { ConditionalClassesDirective } from "./directives/conditional-classes.directive";
6
+ import { DialogDirective } from "./directives/dialog";
7
+ import { DialogService } from "./directives/dialog-service";
8
+ import { MatSlideToggleGroupDirective } from "./directives/mat-toggle-group-directive";
9
+ import { PreventEnterDirective } from "./directives/prevent-enter.directive";
10
+ import { StopPropagationDirective } from "./directives/stop-propagation.directive";
11
+ import { TrimWhitespaceDirective } from "./directives/trim-whitespace.directive";
12
+ import { StylerDirective } from "./directives/styler";
13
+ import { FunctionPipe } from "./pipes/function.pipe";
14
+ import { PhoneNumberPipe } from "./pipes/phone.pipe";
15
+ import { SpaceCasePipe } from "./pipes/space-case.pipes";
16
+
17
+ @NgModule({
18
+ exports: [
19
+ StopPropagationDirective,
20
+ PreventEnterDirective,
21
+ SpaceCasePipe,
22
+ PhoneNumberPipe,
23
+ FunctionPipe,
24
+ StopPropagationDirective,
25
+ TrimWhitespaceDirective,
26
+ StylerDirective,
27
+ PreventEnterDirective,
28
+ AutoFocusDirective,
29
+ ClickSubjectDirective,
30
+ ClickEmitterDirective,
31
+ DialogDirective,
32
+ MatSlideToggleGroupDirective,
33
+ ConditionalClassesDirective,
34
+ ],
35
+ imports: [
36
+ SpaceCasePipe,
37
+ PhoneNumberPipe,
38
+ FunctionPipe,
39
+ StopPropagationDirective,
40
+ StylerDirective,
41
+ PreventEnterDirective,
42
+ AutoFocusDirective,
43
+ TrimWhitespaceDirective,
44
+ ClickSubjectDirective,
45
+ ClickEmitterDirective,
46
+ DialogDirective,
47
+ MatSlideToggleGroupDirective,
48
+ ConditionalClassesDirective,
49
+ ],
50
+ providers: [
51
+ DialogService
52
+ ]
53
+ })
54
+ export class UtilitiesModule {
55
+ }
@@ -0,0 +1,16 @@
1
+ import { Pipe, PipeTransform } from '@angular/core';
2
+
3
+ @Pipe({
4
+ name: 'func',
5
+ standalone: true
6
+ })
7
+ export class FunctionPipe implements PipeTransform {
8
+ transform<T>(func: ( (...args: any[])=> T ) | string, ...args: any[]): T {
9
+ if(typeof func === 'string') {
10
+ const [instance, ...tail] = args;
11
+ const method = instance[func].bind(instance);
12
+ return method(...tail);
13
+ }
14
+ return func(...args);
15
+ }
16
+ }
@@ -0,0 +1,15 @@
1
+ import { Pipe, PipeTransform } from '@angular/core';
2
+
3
+ @Pipe({name: 'phone', standalone: true})
4
+ export class PhoneNumberPipe implements PipeTransform {
5
+
6
+ transform(phoneNum: string): any {
7
+ if (phoneNum) {
8
+ phoneNum = phoneNum.replace(/\D/g,'');
9
+ if(phoneNum[0] === '1') {
10
+ phoneNum = phoneNum.substring(1);
11
+ }
12
+ return '(' + phoneNum.slice(0, 3) + ') ' + phoneNum.slice(3, 6) + '-' + phoneNum.slice(6, 10) + ' ' + phoneNum.slice(10);
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,47 @@
1
+ import { SpaceCasePipe } from './space-case.pipes';
2
+
3
+ const pipe = new SpaceCasePipe();
4
+
5
+ describe('Space Case Pipe', () => {
6
+
7
+ it('one word camel case', () => {
8
+ const result = pipe.transform('promissory');
9
+ expect(result).toEqual('Promissory');
10
+ });
11
+
12
+ it('one word pascal case', () => {
13
+ const result = pipe.transform('Promissory');
14
+ expect(result).toEqual('Promissory');
15
+ });
16
+
17
+ it('two words camel case', () => {
18
+ const result = pipe.transform('promissoryNote');
19
+ expect(result).toEqual('Promissory Note');
20
+ });
21
+
22
+ it('two words pascal case', () => {
23
+ const result = pipe.transform('PromissoryNote');
24
+ expect(result).toEqual('Promissory Note');
25
+ });
26
+
27
+ it('bunch of capital letters in a row', () => {
28
+ const result = pipe.transform('IRALLCSingleMember');
29
+ expect(result).toEqual('IRALLC Single Member');
30
+ });
31
+
32
+ it('underscores', () => {
33
+ const result = pipe.transform('Secured_promissory_Note_more');
34
+ expect(result).toEqual('Secured Promissory Note More');
35
+ });
36
+
37
+ it('underscores', () => {
38
+ const result = pipe.transform('IRA_LLCSingleMember');
39
+ expect(result).toEqual('IRA LLC Single Member');
40
+ });
41
+
42
+ it('blank', () => {
43
+ const result = pipe.transform('');
44
+ expect(result).toEqual('');
45
+ });
46
+
47
+ });
@@ -0,0 +1,23 @@
1
+ import { Pipe, PipeTransform } from '@angular/core';
2
+
3
+ @Pipe({name: 'spaceCase', standalone: true})
4
+ export class SpaceCasePipe implements PipeTransform {
5
+ transform(value: string): string {
6
+ return spaceCase(value);
7
+ }
8
+ }
9
+
10
+ /**
11
+ * Adds a space before uppercase letters that either
12
+ * 1. follows a lowercase letter or digit
13
+ * 2. or precedes a lowercase letter and follows an alpha-numeric character
14
+ *
15
+ * Uppercases the first digit
16
+ *
17
+ * Turns underscores into spaces
18
+ */
19
+ export function spaceCase(value: string){
20
+ const phrase = value?.replace(/([a-z0-9])([A-Z])|([a-zA-Z0-9])([A-Z])(?=[a-z])|_/g, '$1$3 $2$4')
21
+ // uppercase the first character of every word
22
+ return phrase?.replace(/(^| )(\w)/g, x => x.toUpperCase());
23
+ }
@@ -0,0 +1,19 @@
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "../../tsconfig.json",
4
+ "compilerOptions": {
5
+ "outDir": "../../out-tsc/lib",
6
+ "declaration": true,
7
+ "declarationMap": true,
8
+ "inlineSources": true,
9
+ "types": [],
10
+ "lib": [
11
+ "dom",
12
+ "es2021"
13
+ ]
14
+ },
15
+ "exclude": [
16
+ "src/test.ts",
17
+ "**/*.spec.ts"
18
+ ]
19
+ }
@@ -0,0 +1,10 @@
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "./tsconfig.lib.json",
4
+ "compilerOptions": {
5
+ "declarationMap": false
6
+ },
7
+ "angularCompilerOptions": {
8
+ "compilationMode": "partial"
9
+ }
10
+ }
@@ -0,0 +1,17 @@
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "../../tsconfig.json",
4
+ "compilerOptions": {
5
+ "outDir": "../../out-tsc/spec",
6
+ "types": [
7
+ "jasmine"
8
+ ]
9
+ },
10
+ "files": [
11
+ "src/test.ts"
12
+ ],
13
+ "include": [
14
+ "**/*.spec.ts",
15
+ "**/*.d.ts"
16
+ ]
17
+ }
@@ -1,12 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- import { Observable } from 'rxjs';
3
- import { ActionStatus, serverStatusTypes } from '../ngrx';
4
- import * as i0 from "@angular/core";
5
- export declare class ActionStateSpinnerComponent implements OnInit {
6
- status$: Observable<ActionStatus>;
7
- serverActionStatus$: Observable<ActionStatus>;
8
- serverStatusTypes: typeof serverStatusTypes;
9
- ngOnInit(): void;
10
- static ɵfac: i0.ɵɵFactoryDeclaration<ActionStateSpinnerComponent, never>;
11
- static ɵcmp: i0.ɵɵComponentDeclaration<ActionStateSpinnerComponent, "lib-action-state-spinner", never, { "status$": { "alias": "status$"; "required": false; }; }, {}, never, never, true, never>;
12
- }
@@ -1,7 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "../action-state-spinner/action-state-spinner.component";
3
- export declare class ActionStateUiModule {
4
- static ɵfac: i0.ɵɵFactoryDeclaration<ActionStateUiModule, never>;
5
- static ɵmod: i0.ɵɵNgModuleDeclaration<ActionStateUiModule, never, [typeof i1.ActionStateSpinnerComponent], [typeof i1.ActionStateSpinnerComponent]>;
6
- static ɵinj: i0.ɵɵInjectorDeclaration<ActionStateUiModule>;
7
- }
@@ -1,8 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "@angular/common";
3
- import * as i2 from "@ngrx/store";
4
- export declare class NgrxExtModule {
5
- static ɵfac: i0.ɵɵFactoryDeclaration<NgrxExtModule, never>;
6
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgrxExtModule, never, [typeof i1.CommonModule, typeof i2.StoreFeatureModule], never>;
7
- static ɵinj: i0.ɵɵInjectorDeclaration<NgrxExtModule>;
8
- }
@@ -1,31 +0,0 @@
1
- import { Action } from '@ngrx/store';
2
- import { EntityState } from '@ngrx/entity';
3
- export declare class AppStatusState {
4
- readonly ActionStatusBar: ActionStatus[];
5
- }
6
- export interface StatusState {
7
- ids: string[];
8
- entities: {
9
- [id: string]: ActionStatus;
10
- };
11
- }
12
- export declare class ActionStatus {
13
- id: string;
14
- displayName?: string;
15
- status: serverStatusTypes;
16
- responsePayload?: any;
17
- }
18
- export declare enum serverStatusTypes {
19
- notStarted = 0,
20
- inProgress = 1,
21
- success = 2,
22
- error = 3
23
- }
24
- export declare const statusAdapter: import("@ngrx/entity").EntityAdapter<ActionStatus>;
25
- export interface State extends EntityState<ActionStatus> {
26
- }
27
- export declare const initialState: StatusState;
28
- export declare const getStatusState: import("@ngrx/store").MemoizedSelector<object, State, import("@ngrx/store").DefaultProjectorFn<State>>;
29
- export declare const selectIds: (state: object) => string[] | number[], selectEntities: (state: object) => import("@ngrx/entity").Dictionary<ActionStatus>, selectAll: (state: object) => ActionStatus[], selectTotal: (state: object) => number;
30
- export declare const selectEntity: (id: string) => import("@ngrx/store").MemoizedSelector<object, any, (s1: import("@ngrx/entity").Dictionary<ActionStatus>) => any>;
31
- export declare function actionStatusReducer(state: StatusState | undefined, action: Action): StatusState;
@@ -1,24 +0,0 @@
1
- import { Component, Input } from '@angular/core';
2
- import { serverStatusTypes } from '../ngrx';
3
- import { delayOn } from '../../rxjs';
4
- import { AsyncPipe } from '@angular/common';
5
- import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
6
- import * as i0 from "@angular/core";
7
- import * as i1 from "@angular/material/progress-spinner";
8
- export class ActionStateSpinnerComponent {
9
- constructor() {
10
- this.serverStatusTypes = serverStatusTypes;
11
- }
12
- ngOnInit() {
13
- this.serverActionStatus$ = this.status$.pipe(delayOn(a => a.status === serverStatusTypes.inProgress, 500));
14
- }
15
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ActionStateSpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
16
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.0.3", type: ActionStateSpinnerComponent, isStandalone: true, selector: "lib-action-state-spinner", inputs: { status$: "status$" }, ngImport: i0, template: "@if((serverActionStatus$ | async)?.status === serverStatusTypes.inProgress){\r\n <div id=\"blocker\">\r\n <mat-spinner class=\"spinner\" [diameter]=\"200\" />\r\n </div>\r\n}\r\n\r\n", styles: ["#blocker{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#0e0d0d69;z-index:999999}.spinner{position:absolute;top:50%;left:40%;transform:translate(-50%,-50%)}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }] }); }
17
- }
18
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.3", ngImport: i0, type: ActionStateSpinnerComponent, decorators: [{
19
- type: Component,
20
- args: [{ selector: 'lib-action-state-spinner', standalone: true, imports: [AsyncPipe, MatProgressSpinnerModule], template: "@if((serverActionStatus$ | async)?.status === serverStatusTypes.inProgress){\r\n <div id=\"blocker\">\r\n <mat-spinner class=\"spinner\" [diameter]=\"200\" />\r\n </div>\r\n}\r\n\r\n", styles: ["#blocker{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#0e0d0d69;z-index:999999}.spinner{position:absolute;top:50%;left:40%;transform:translate(-50%,-50%)}\n"] }]
21
- }], propDecorators: { status$: [{
22
- type: Input
23
- }] } });
24
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWN0aW9uLXN0YXRlLXNwaW5uZXIuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvYW5ndWxhci11dGlsaXRpZXMvc3JjL2FjdGlvbi1zdGF0ZS9hY3Rpb24tc3RhdGUtc3Bpbm5lci9hY3Rpb24tc3RhdGUtc3Bpbm5lci5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmd1bGFyLXV0aWxpdGllcy9zcmMvYWN0aW9uLXN0YXRlL2FjdGlvbi1zdGF0ZS1zcGlubmVyL2FjdGlvbi1zdGF0ZS1zcGlubmVyLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQVUsS0FBSyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRXpELE9BQU8sRUFBZ0IsaUJBQWlCLEVBQUUsTUFBTSxTQUFTLENBQUM7QUFDMUQsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLFlBQVksQ0FBQztBQUNyQyxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDNUMsT0FBTyxFQUFFLHdCQUF3QixFQUFFLE1BQU0sb0NBQW9DLENBQUM7OztBQVM5RSxNQUFNLE9BQU8sMkJBQTJCO0lBUHhDO1FBV0Usc0JBQWlCLEdBQUcsaUJBQWlCLENBQUM7S0FPdkM7SUFMQyxRQUFRO1FBQ04sSUFBSSxDQUFDLG1CQUFtQixHQUFHLElBQUksQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUMxQyxPQUFPLENBQUUsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsTUFBTSxLQUFLLGlCQUFpQixDQUFDLFVBQVUsRUFBRyxHQUFHLENBQUMsQ0FDL0QsQ0FBQztJQUNKLENBQUM7OEdBVlUsMkJBQTJCO2tHQUEzQiwyQkFBMkIsb0hDZHhDLDZMQU1BLHdPRE1ZLFNBQVMsNkNBQUUsd0JBQXdCOzsyRkFFbEMsMkJBQTJCO2tCQVB2QyxTQUFTOytCQUNFLDBCQUEwQixjQUd4QixJQUFJLFdBQ1AsQ0FBQyxTQUFTLEVBQUUsd0JBQXdCLENBQUM7OEJBSXJDLE9BQU87c0JBQWYsS0FBSyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENvbXBvbmVudCwgT25Jbml0LCBJbnB1dCB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xyXG5pbXBvcnQgeyBPYnNlcnZhYmxlIH0gZnJvbSAncnhqcyc7XHJcbmltcG9ydCB7IEFjdGlvblN0YXR1cywgc2VydmVyU3RhdHVzVHlwZXMgfSBmcm9tICcuLi9uZ3J4JztcclxuaW1wb3J0IHsgZGVsYXlPbiB9IGZyb20gJy4uLy4uL3J4anMnO1xyXG5pbXBvcnQgeyBBc3luY1BpcGUgfSBmcm9tICdAYW5ndWxhci9jb21tb24nO1xyXG5pbXBvcnQgeyBNYXRQcm9ncmVzc1NwaW5uZXJNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9tYXRlcmlhbC9wcm9ncmVzcy1zcGlubmVyJztcclxuXHJcbkBDb21wb25lbnQoe1xyXG4gIHNlbGVjdG9yOiAnbGliLWFjdGlvbi1zdGF0ZS1zcGlubmVyJyxcclxuICB0ZW1wbGF0ZVVybDogJy4vYWN0aW9uLXN0YXRlLXNwaW5uZXIuY29tcG9uZW50Lmh0bWwnLFxyXG4gIHN0eWxlVXJsczogWycuL2FjdGlvbi1zdGF0ZS1zcGlubmVyLmNvbXBvbmVudC5jc3MnXSxcclxuICBzdGFuZGFsb25lOiB0cnVlLFxyXG4gIGltcG9ydHM6IFtBc3luY1BpcGUsIE1hdFByb2dyZXNzU3Bpbm5lck1vZHVsZV1cclxufSlcclxuZXhwb3J0IGNsYXNzIEFjdGlvblN0YXRlU3Bpbm5lckNvbXBvbmVudCBpbXBsZW1lbnRzIE9uSW5pdCB7XHJcblxyXG4gIEBJbnB1dCgpIHN0YXR1cyQhOiBPYnNlcnZhYmxlPEFjdGlvblN0YXR1cz47XHJcbiAgc2VydmVyQWN0aW9uU3RhdHVzJCE6IE9ic2VydmFibGU8QWN0aW9uU3RhdHVzPjtcclxuICBzZXJ2ZXJTdGF0dXNUeXBlcyA9IHNlcnZlclN0YXR1c1R5cGVzO1xyXG5cclxuICBuZ09uSW5pdCgpIHtcclxuICAgIHRoaXMuc2VydmVyQWN0aW9uU3RhdHVzJCA9IHRoaXMuc3RhdHVzJC5waXBlKFxyXG4gICAgICBkZWxheU9uKCBhID0+IGEuc3RhdHVzID09PSBzZXJ2ZXJTdGF0dXNUeXBlcy5pblByb2dyZXNzICwgNTAwKVxyXG4gICAgKTtcclxuICB9XHJcbn1cclxuIiwiQGlmKChzZXJ2ZXJBY3Rpb25TdGF0dXMkIHwgYXN5bmMpPy5zdGF0dXMgPT09IHNlcnZlclN0YXR1c1R5cGVzLmluUHJvZ3Jlc3Mpe1xyXG4gIDxkaXYgaWQ9XCJibG9ja2VyXCI+XHJcbiAgICA8bWF0LXNwaW5uZXIgY2xhc3M9XCJzcGlubmVyXCIgW2RpYW1ldGVyXT1cIjIwMFwiIC8+XHJcbiAgPC9kaXY+XHJcbn1cclxuXHJcbiJdfQ==